Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,4 @@
}
}
}
}

}
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description mentions "Update package description to use lowercase elizaos", but the actual diff for package.json only shows removal of a trailing blank line. There don't appear to be any branding changes in the description field. Either the description field was already using lowercase "elizaos", or the PR description is inaccurate.

Copilot uses AI. Check for mistakes.
2 changes: 1 addition & 1 deletion src/actions/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const gitLogAction: Action = {
message: Memory,
_state: State | undefined
): Promise<boolean> => {
const text = message.content.text.toLowerCase();
const text = (message.content.text || '').toLowerCase();

// Check for git log related keywords
const hasLogKeywords = (
Expand Down
2 changes: 1 addition & 1 deletion src/actions/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const gitStatusAction: Action = {
message: Memory,
_state: State | undefined
): Promise<boolean> => {
const text = message.content.text.toLowerCase();
const text = (message.content.text || '').toLowerCase();

// Check for git status related keywords
const hasStatusKeywords = (
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export {
parseGitUrl,
isSshUrl,
isHttpsUrl,

// Execution utilities
redactUrl,
redactArgs,
Expand All @@ -90,7 +90,7 @@ export {
parseLogOutput,
parseBranchOutput,
parseRemoteOutput,

// State persistence utilities
getGitStateCacheKey,
createEmptyGitState,
Expand Down
4 changes: 3 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { GitService } from './services/git';
// Providers
import {
gitInstructionsProvider,
gitSettingsProvider,
gitWorkingCopiesProvider,
gitStatusProvider,
gitBranchesProvider,
Expand Down Expand Up @@ -96,7 +97,7 @@ export const gitPlugin: Plugin = {
logger.info('[Git] Initializing plugin-git...');

// Log configuration (without sensitive values)
const configKeys = Object.keys(config).filter(k =>
const configKeys = Object.keys(config).filter(k =>
!k.includes('TOKEN') && !k.includes('PASSWORD')
);
if (configKeys.length > 0) {
Expand Down Expand Up @@ -139,6 +140,7 @@ export const gitPlugin: Plugin = {
// Providers - inject git state into agent context
providers: [
gitInstructionsProvider, // Comprehensive usage instructions (highest priority)
gitSettingsProvider, // Current settings (non-sensitive)
gitWorkingCopiesProvider, // Shows managed repositories
gitStatusProvider, // Shows current repo status
gitLogProvider, // Shows recent commit history
Expand Down
1 change: 1 addition & 0 deletions src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

export { gitInstructionsProvider } from './instructions';
export { gitSettingsProvider } from './settings';
export { gitWorkingCopiesProvider } from './workingCopies';
export { gitStatusProvider } from './status';
export { gitBranchesProvider } from './branches';
Expand Down
124 changes: 124 additions & 0 deletions src/providers/settings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/**
* GIT_SETTINGS Provider
*
* Exposes current git plugin settings (non-sensitive only).
* Helps users understand their current configuration.
*/

import type {
IAgentRuntime,
Memory,
Provider,
ProviderResult,
State,
} from '@elizaos/core';
import { GitService } from '../services/git';
import { getActiveRepository, getWorkingCopies } from '../utils/state';

export const gitSettingsProvider: Provider = {
name: 'GIT_SETTINGS',
description: 'Current git plugin configuration and settings (non-sensitive)',

get: async (
runtime: IAgentRuntime,
message: Memory,
_state?: State
): Promise<ProviderResult> => {
const gitService = runtime.getService<GitService>('git');

// Get non-sensitive settings
const allowedPath = runtime.getSetting('GIT_ALLOWED_PATH') || 'not restricted';
const authorName = runtime.getSetting('GIT_AUTHOR_NAME') || 'not set';
const authorEmail = runtime.getSetting('GIT_AUTHOR_EMAIL') || 'not set';
const cloneTimeout = runtime.getSetting('GIT_CLONE_TIMEOUT') || '300';
const workingCopiesDir = runtime.getSetting('GIT_WORKING_COPIES_DIR') || '~/.eliza/git';

// Check auth status without exposing credentials
const hasToken = !!runtime.getSetting('GIT_TOKEN');
const hasUserPass = !!runtime.getSetting('GIT_USERNAME') && !!runtime.getSetting('GIT_PASSWORD');
const authConfigured = hasToken || hasUserPass;
const authMethod = hasToken ? 'token' : hasUserPass ? 'username/password' : 'none';

// Get git CLI status
let gitVersion = 'unknown';
let gitInstalled = false;
if (gitService) {
gitInstalled = await gitService.isGitInstalled();
if (gitInstalled) {
gitVersion = (await gitService.getGitVersion()) || 'unknown';
}
}

// Get repository state
const activeRepo = await getActiveRepository(runtime, message.roomId);
const workingCopies = await getWorkingCopies(runtime, message.roomId);

// Check for workspace integration
const workspaceService = runtime.getService('workspace');
const usingWorkspace = !!workspaceService;

const settings = {
gitInstalled,
gitVersion,
allowedPath,
workingCopiesDir,
cloneTimeoutSeconds: parseInt(cloneTimeout),
author: {
name: authorName,
email: authorEmail,
},
authentication: {
configured: authConfigured,
method: authMethod,
},
state: {
activeRepo: activeRepo
? {
path: activeRepo.path,
branch: activeRepo.branch,
remote: activeRepo.remote,
}
: null,
workingCopiesCount: workingCopies.length,
},
usingWorkspace,
};

const lines = [
'## Git Plugin Settings',
'',
`**Git CLI:** ${settings.gitInstalled ? `Installed (${settings.gitVersion})` : 'Not installed'}`,
'',
'**Directories:**',
`- Allowed Path: \`${settings.allowedPath}\``,
`- Working Copies: \`${settings.workingCopiesDir}\``,
`- Using Workspace: ${settings.usingWorkspace ? 'Yes' : 'No'}`,
'',
'**Clone Timeout:** ' + settings.cloneTimeoutSeconds + 's',
'',
'**Author:**',
`- Name: ${settings.author.name}`,
`- Email: ${settings.author.email}`,
'',
'**Authentication:**',
`- Configured: ${settings.authentication.configured ? 'Yes' : 'No'}`,
`- Method: ${settings.authentication.method}`,
'',
'**State:**',
`- Working Copies: ${settings.state.workingCopiesCount}`,
];

if (settings.state.activeRepo) {
lines.push(`- Active Repo: \`${settings.state.activeRepo.path}\``);
lines.push(`- Branch: ${settings.state.activeRepo.branch}`);
} else {
lines.push('- Active Repo: None');
}

return {
text: lines.join('\n'),
values: settings,
data: { settings },
};
},
};
Loading