@cleocode/adapters 2026.4.59 → 2026.4.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/__tests__/claude-code-adapter.test.ts +5 -5
- package/src/__tests__/cursor-adapter.test.ts +4 -4
- package/src/__tests__/opencode-adapter.test.ts +5 -5
- package/dist/cant-context.js +0 -711
- package/dist/cant-context.js.map +0 -1
- package/dist/providers/claude-code/adapter.js +0 -222
- package/dist/providers/claude-code/adapter.js.map +0 -1
- package/dist/providers/claude-code/context-monitor.js +0 -159
- package/dist/providers/claude-code/context-monitor.js.map +0 -1
- package/dist/providers/claude-code/hooks.js +0 -395
- package/dist/providers/claude-code/hooks.js.map +0 -1
- package/dist/providers/claude-code/index.js +0 -41
- package/dist/providers/claude-code/index.js.map +0 -1
- package/dist/providers/claude-code/install.js +0 -199
- package/dist/providers/claude-code/install.js.map +0 -1
- package/dist/providers/claude-code/paths.js +0 -41
- package/dist/providers/claude-code/paths.js.map +0 -1
- package/dist/providers/claude-code/spawn.js +0 -198
- package/dist/providers/claude-code/spawn.js.map +0 -1
- package/dist/providers/claude-code/statusline.js +0 -130
- package/dist/providers/claude-code/statusline.js.map +0 -1
- package/dist/providers/claude-code/task-sync.js +0 -119
- package/dist/providers/claude-code/task-sync.js.map +0 -1
- package/dist/providers/claude-code/transport.js +0 -29
- package/dist/providers/claude-code/transport.js.map +0 -1
- package/dist/providers/claude-sdk/index.js +0 -16
- package/dist/providers/claude-sdk/index.js.map +0 -1
- package/dist/providers/claude-sdk/mcp-registry.js +0 -66
- package/dist/providers/claude-sdk/mcp-registry.js.map +0 -1
- package/dist/providers/claude-sdk/session-store.js +0 -84
- package/dist/providers/claude-sdk/session-store.js.map +0 -1
- package/dist/providers/claude-sdk/spawn.js +0 -225
- package/dist/providers/claude-sdk/spawn.js.map +0 -1
- package/dist/providers/claude-sdk/tool-bridge.js +0 -50
- package/dist/providers/claude-sdk/tool-bridge.js.map +0 -1
- package/dist/providers/codex/adapter.js +0 -146
- package/dist/providers/codex/adapter.js.map +0 -1
- package/dist/providers/codex/hooks.js +0 -113
- package/dist/providers/codex/hooks.js.map +0 -1
- package/dist/providers/codex/index.js +0 -39
- package/dist/providers/codex/index.js.map +0 -1
- package/dist/providers/codex/install.js +0 -124
- package/dist/providers/codex/install.js.map +0 -1
- package/dist/providers/cursor/adapter.js +0 -151
- package/dist/providers/cursor/adapter.js.map +0 -1
- package/dist/providers/cursor/hooks.js +0 -208
- package/dist/providers/cursor/hooks.js.map +0 -1
- package/dist/providers/cursor/index.js +0 -36
- package/dist/providers/cursor/index.js.map +0 -1
- package/dist/providers/cursor/install.js +0 -180
- package/dist/providers/cursor/install.js.map +0 -1
- package/dist/providers/cursor/spawn.js +0 -59
- package/dist/providers/cursor/spawn.js.map +0 -1
- package/dist/providers/gemini-cli/adapter.js +0 -158
- package/dist/providers/gemini-cli/adapter.js.map +0 -1
- package/dist/providers/gemini-cli/hooks.js +0 -128
- package/dist/providers/gemini-cli/hooks.js.map +0 -1
- package/dist/providers/gemini-cli/index.js +0 -39
- package/dist/providers/gemini-cli/index.js.map +0 -1
- package/dist/providers/gemini-cli/install.js +0 -124
- package/dist/providers/gemini-cli/install.js.map +0 -1
- package/dist/providers/kimi/adapter.js +0 -145
- package/dist/providers/kimi/adapter.js.map +0 -1
- package/dist/providers/kimi/hooks.js +0 -79
- package/dist/providers/kimi/hooks.js.map +0 -1
- package/dist/providers/kimi/index.js +0 -39
- package/dist/providers/kimi/index.js.map +0 -1
- package/dist/providers/kimi/install.js +0 -124
- package/dist/providers/kimi/install.js.map +0 -1
- package/dist/providers/openai-sdk/adapter.js +0 -120
- package/dist/providers/openai-sdk/adapter.js.map +0 -1
- package/dist/providers/openai-sdk/guardrails.js +0 -139
- package/dist/providers/openai-sdk/guardrails.js.map +0 -1
- package/dist/providers/openai-sdk/handoff.js +0 -124
- package/dist/providers/openai-sdk/handoff.js.map +0 -1
- package/dist/providers/openai-sdk/index.js +0 -39
- package/dist/providers/openai-sdk/index.js.map +0 -1
- package/dist/providers/openai-sdk/install.js +0 -120
- package/dist/providers/openai-sdk/install.js.map +0 -1
- package/dist/providers/openai-sdk/spawn.js +0 -214
- package/dist/providers/openai-sdk/spawn.js.map +0 -1
- package/dist/providers/openai-sdk/tracing.js +0 -157
- package/dist/providers/openai-sdk/tracing.js.map +0 -1
- package/dist/providers/opencode/adapter.js +0 -166
- package/dist/providers/opencode/adapter.js.map +0 -1
- package/dist/providers/opencode/hooks.js +0 -206
- package/dist/providers/opencode/hooks.js.map +0 -1
- package/dist/providers/opencode/index.js +0 -37
- package/dist/providers/opencode/index.js.map +0 -1
- package/dist/providers/opencode/install.js +0 -115
- package/dist/providers/opencode/install.js.map +0 -1
- package/dist/providers/opencode/spawn.js +0 -256
- package/dist/providers/opencode/spawn.js.map +0 -1
- package/dist/providers/pi/adapter.js +0 -220
- package/dist/providers/pi/adapter.js.map +0 -1
- package/dist/providers/pi/hooks.js +0 -223
- package/dist/providers/pi/hooks.js.map +0 -1
- package/dist/providers/pi/index.js +0 -38
- package/dist/providers/pi/index.js.map +0 -1
- package/dist/providers/pi/install.js +0 -175
- package/dist/providers/pi/install.js.map +0 -1
- package/dist/providers/pi/spawn.js +0 -187
- package/dist/providers/pi/spawn.js.map +0 -1
- package/dist/providers/shared/conduit-trace-writer.js +0 -65
- package/dist/providers/shared/conduit-trace-writer.js.map +0 -1
- package/dist/providers/shared/sdk-result-mapper.js +0 -54
- package/dist/providers/shared/sdk-result-mapper.js.map +0 -1
- package/dist/providers/shared/transcript-reader.js +0 -124
- package/dist/providers/shared/transcript-reader.js.map +0 -1
- package/dist/registry.js +0 -92
- package/dist/registry.js.map +0 -1
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor Install Provider
|
|
3
|
-
*
|
|
4
|
-
* Handles CLEO installation into Cursor environments:
|
|
5
|
-
* - Ensures .cursorrules has CLEO @-references (legacy format)
|
|
6
|
-
* - Creates .cursor/rules/cleo.mdc with CLEO references (modern format)
|
|
7
|
-
*
|
|
8
|
-
* Cursor supports two instruction file formats:
|
|
9
|
-
* 1. Legacy: .cursorrules (flat file, project root)
|
|
10
|
-
* 2. Modern: .cursor/rules/*.mdc (MDC format, per-rule files)
|
|
11
|
-
*
|
|
12
|
-
* This provider writes to both for maximum compatibility.
|
|
13
|
-
*
|
|
14
|
-
* @task T5240
|
|
15
|
-
*/
|
|
16
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
17
|
-
import { join } from 'node:path';
|
|
18
|
-
/** Lines that should appear in instruction files to reference CLEO. */
|
|
19
|
-
const INSTRUCTION_REFERENCES = ['@~/.cleo/templates/CLEO-INJECTION.md', '@.cleo/memory-bridge.md'];
|
|
20
|
-
/**
|
|
21
|
-
* Install provider for Cursor.
|
|
22
|
-
*
|
|
23
|
-
* Manages CLEO's integration with Cursor by:
|
|
24
|
-
* 1. Creating/updating .cursorrules with @-references (legacy)
|
|
25
|
-
* 2. Creating .cursor/rules/cleo.mdc with @-references (modern)
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* Installation is idempotent and writes to both instruction file formats
|
|
29
|
-
* for maximum compatibility. The legacy `.cursorrules` file is only modified
|
|
30
|
-
* if it already exists (never created from scratch). The modern MDC file
|
|
31
|
-
* is always created or updated to ensure Cursor's rule engine picks it up.
|
|
32
|
-
*/
|
|
33
|
-
export class CursorInstallProvider {
|
|
34
|
-
/**
|
|
35
|
-
* Install CLEO into a Cursor project.
|
|
36
|
-
*
|
|
37
|
-
* @param options - Installation options including project directory
|
|
38
|
-
* @returns Result describing what was installed
|
|
39
|
-
*/
|
|
40
|
-
async install(options) {
|
|
41
|
-
const { projectDir } = options;
|
|
42
|
-
const installedAt = new Date().toISOString();
|
|
43
|
-
let instructionFileUpdated = false;
|
|
44
|
-
const details = {};
|
|
45
|
-
// Step 1: Ensure instruction files have @-references
|
|
46
|
-
instructionFileUpdated = this.updateInstructionFiles(projectDir);
|
|
47
|
-
if (instructionFileUpdated) {
|
|
48
|
-
details.instructionFiles = this.getUpdatedFileList(projectDir);
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
success: true,
|
|
52
|
-
installedAt,
|
|
53
|
-
instructionFileUpdated,
|
|
54
|
-
details,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Uninstall CLEO from the current Cursor project.
|
|
59
|
-
*
|
|
60
|
-
* Does not remove instruction file references (they are harmless if CLEO is not present).
|
|
61
|
-
*/
|
|
62
|
-
async uninstall() { }
|
|
63
|
-
/**
|
|
64
|
-
* Check whether CLEO is installed in the current environment.
|
|
65
|
-
*
|
|
66
|
-
* Checks for .cursor/rules/cleo.mdc or .cursorrules with CLEO references.
|
|
67
|
-
*/
|
|
68
|
-
async isInstalled() {
|
|
69
|
-
const mdcPath = join(process.cwd(), '.cursor', 'rules', 'cleo.mdc');
|
|
70
|
-
if (existsSync(mdcPath)) {
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
const rulesPath = join(process.cwd(), '.cursorrules');
|
|
74
|
-
if (existsSync(rulesPath)) {
|
|
75
|
-
try {
|
|
76
|
-
const content = readFileSync(rulesPath, 'utf-8');
|
|
77
|
-
if (INSTRUCTION_REFERENCES.some((ref) => content.includes(ref))) {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
// Fall through
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Ensure instruction files contain @-references to CLEO.
|
|
89
|
-
*
|
|
90
|
-
* Updates .cursorrules (legacy) and creates .cursor/rules/cleo.mdc (modern).
|
|
91
|
-
*
|
|
92
|
-
* @param projectDir - Project root directory
|
|
93
|
-
*/
|
|
94
|
-
async ensureInstructionReferences(projectDir) {
|
|
95
|
-
this.updateInstructionFiles(projectDir);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Update instruction files with CLEO @-references.
|
|
99
|
-
*
|
|
100
|
-
* Handles both legacy (.cursorrules) and modern (.cursor/rules/cleo.mdc) formats.
|
|
101
|
-
*
|
|
102
|
-
* @returns true if any file was created or modified
|
|
103
|
-
*/
|
|
104
|
-
updateInstructionFiles(projectDir) {
|
|
105
|
-
let updated = false;
|
|
106
|
-
// Update legacy .cursorrules if it exists
|
|
107
|
-
if (this.updateLegacyRules(projectDir)) {
|
|
108
|
-
updated = true;
|
|
109
|
-
}
|
|
110
|
-
// Create/update modern .cursor/rules/cleo.mdc
|
|
111
|
-
if (this.updateModernRules(projectDir)) {
|
|
112
|
-
updated = true;
|
|
113
|
-
}
|
|
114
|
-
return updated;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Update legacy .cursorrules file with @-references.
|
|
118
|
-
* Only modifies the file if it already exists (does not create it).
|
|
119
|
-
*
|
|
120
|
-
* @returns true if the file was modified
|
|
121
|
-
*/
|
|
122
|
-
updateLegacyRules(projectDir) {
|
|
123
|
-
const rulesPath = join(projectDir, '.cursorrules');
|
|
124
|
-
if (!existsSync(rulesPath)) {
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
let content = readFileSync(rulesPath, 'utf-8');
|
|
128
|
-
const missingRefs = INSTRUCTION_REFERENCES.filter((ref) => !content.includes(ref));
|
|
129
|
-
if (missingRefs.length === 0) {
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
const separator = content.endsWith('\n') ? '' : '\n';
|
|
133
|
-
content = content + separator + missingRefs.join('\n') + '\n';
|
|
134
|
-
writeFileSync(rulesPath, content, 'utf-8');
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Create or update .cursor/rules/cleo.mdc with CLEO references.
|
|
139
|
-
*
|
|
140
|
-
* MDC (Markdown Component) format is Cursor's modern rule file format.
|
|
141
|
-
* Each .mdc file in .cursor/rules/ is loaded as a rule set.
|
|
142
|
-
*
|
|
143
|
-
* @returns true if the file was created or modified
|
|
144
|
-
*/
|
|
145
|
-
updateModernRules(projectDir) {
|
|
146
|
-
const rulesDir = join(projectDir, '.cursor', 'rules');
|
|
147
|
-
const mdcPath = join(rulesDir, 'cleo.mdc');
|
|
148
|
-
const expectedContent = [
|
|
149
|
-
'---',
|
|
150
|
-
'description: CLEO task management protocol references',
|
|
151
|
-
'globs: "**/*"',
|
|
152
|
-
'alwaysApply: true',
|
|
153
|
-
'---',
|
|
154
|
-
'',
|
|
155
|
-
...INSTRUCTION_REFERENCES,
|
|
156
|
-
'',
|
|
157
|
-
].join('\n');
|
|
158
|
-
if (existsSync(mdcPath)) {
|
|
159
|
-
const existing = readFileSync(mdcPath, 'utf-8');
|
|
160
|
-
if (existing === expectedContent) {
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
mkdirSync(rulesDir, { recursive: true });
|
|
165
|
-
writeFileSync(mdcPath, expectedContent, 'utf-8');
|
|
166
|
-
return true;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Get list of instruction files that were updated.
|
|
170
|
-
*/
|
|
171
|
-
getUpdatedFileList(projectDir) {
|
|
172
|
-
const files = [];
|
|
173
|
-
if (existsSync(join(projectDir, '.cursorrules'))) {
|
|
174
|
-
files.push(join(projectDir, '.cursorrules'));
|
|
175
|
-
}
|
|
176
|
-
files.push(join(projectDir, '.cursor', 'rules', 'cleo.mdc'));
|
|
177
|
-
return files;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
//# sourceMappingURL=install.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/providers/cursor/install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,C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,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;QAC/C,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;QAC7D,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor Spawn Provider
|
|
3
|
-
*
|
|
4
|
-
* Cursor is a GUI-based AI code editor and does not support
|
|
5
|
-
* CLI-based subagent spawning. This provider implements
|
|
6
|
-
* the AdapterSpawnProvider interface with appropriate rejections.
|
|
7
|
-
*
|
|
8
|
-
* @task T5240
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Spawn provider for Cursor.
|
|
12
|
-
*
|
|
13
|
-
* Cursor does not support subagent spawning via CLI. The adapter
|
|
14
|
-
* declares supportsSpawn: false in its capabilities. All methods
|
|
15
|
-
* either reject or return empty results.
|
|
16
|
-
*/
|
|
17
|
-
export class CursorSpawnProvider {
|
|
18
|
-
/**
|
|
19
|
-
* Check if Cursor supports spawning subagents.
|
|
20
|
-
*
|
|
21
|
-
* @returns false (Cursor does not support CLI spawning)
|
|
22
|
-
*/
|
|
23
|
-
async canSpawn() {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Attempt to spawn a subagent via Cursor.
|
|
28
|
-
*
|
|
29
|
-
* Always throws because Cursor does not support subagent spawning.
|
|
30
|
-
* Callers should check canSpawn() before calling this method.
|
|
31
|
-
*
|
|
32
|
-
* @param _context - Unused; spawning is not supported
|
|
33
|
-
* @throws Error explaining that Cursor does not support subagent spawning
|
|
34
|
-
*/
|
|
35
|
-
async spawn(_context) {
|
|
36
|
-
throw new Error('Cursor does not support subagent spawning. ' +
|
|
37
|
-
'Cursor is a GUI-based editor without CLI subagent capabilities. ' +
|
|
38
|
-
'Use a provider that supports spawning (e.g., Claude Code or OpenCode).');
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* List running Cursor subagent processes.
|
|
42
|
-
*
|
|
43
|
-
* @returns Empty array (no processes can be spawned)
|
|
44
|
-
*/
|
|
45
|
-
async listRunning() {
|
|
46
|
-
return [];
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Terminate a Cursor subagent process.
|
|
50
|
-
*
|
|
51
|
-
* No-op because Cursor cannot spawn processes.
|
|
52
|
-
*
|
|
53
|
-
* @param _instanceId - Unused; no processes to terminate
|
|
54
|
-
*/
|
|
55
|
-
async terminate(_instanceId) {
|
|
56
|
-
// No-op: Cursor does not spawn processes.
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=spawn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../../src/providers/cursor/spawn.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;GAMG;AACH,MAAM,OAAO,mBAAmB;IAC9B;;;;OAIG;IACH,KAAK,CAAC,QAAQ;QACZ,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,KAAK,CAAC,QAAsB;QAChC,MAAM,IAAI,KAAK,CACb,6CAA6C;YAC3C,kEAAkE;YAClE,wEAAwE,CAC3E,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,WAAW;QACf,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,SAAS,CAAC,WAAmB;QACjC,0CAA0C;IAC5C,CAAC;CACF"}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI Adapter
|
|
3
|
-
*
|
|
4
|
-
* Main CLEOProviderAdapter implementation for Google Gemini CLI.
|
|
5
|
-
* Provides hooks and install capabilities for CLEO integration.
|
|
6
|
-
*
|
|
7
|
-
* @task T161
|
|
8
|
-
* @epic T134
|
|
9
|
-
*/
|
|
10
|
-
import { exec } from 'node:child_process';
|
|
11
|
-
import { existsSync } from 'node:fs';
|
|
12
|
-
import { homedir } from 'node:os';
|
|
13
|
-
import { join } from 'node:path';
|
|
14
|
-
import { promisify } from 'node:util';
|
|
15
|
-
import { GeminiCliHookProvider } from './hooks.js';
|
|
16
|
-
import { GeminiCliInstallProvider } from './install.js';
|
|
17
|
-
const execAsync = promisify(exec);
|
|
18
|
-
/**
|
|
19
|
-
* CLEO provider adapter for Google Gemini CLI.
|
|
20
|
-
*
|
|
21
|
-
* Bridges CLEO's adapter system with Gemini CLI's native capabilities:
|
|
22
|
-
* - Hooks: Maps Gemini CLI events (SessionStart, PreToolUse, etc.) to CAAMP events
|
|
23
|
-
* - Install: Ensures AGENTS.md references for CLEO instruction files
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* Gemini CLI supports 10 canonical CAAMP events through its hook system,
|
|
27
|
-
* including PreModel and PostModel which most other providers lack. It has
|
|
28
|
-
* no spawn or transport capabilities. Integration is through AGENTS.md
|
|
29
|
-
* instruction files and the Gemini CLI's configuration at `~/.gemini/`.
|
|
30
|
-
*
|
|
31
|
-
* @task T161
|
|
32
|
-
* @epic T134
|
|
33
|
-
*/
|
|
34
|
-
export class GeminiCliAdapter {
|
|
35
|
-
/** Unique provider identifier. */
|
|
36
|
-
id = 'gemini-cli';
|
|
37
|
-
/** Human-readable provider name. */
|
|
38
|
-
name = 'Gemini CLI';
|
|
39
|
-
/** Adapter version string. */
|
|
40
|
-
version = '1.0.0';
|
|
41
|
-
/** Declared capabilities for this provider. */
|
|
42
|
-
capabilities = {
|
|
43
|
-
supportsHooks: true,
|
|
44
|
-
supportedHookEvents: [
|
|
45
|
-
'SessionStart',
|
|
46
|
-
'SessionEnd',
|
|
47
|
-
'BeforeAgent',
|
|
48
|
-
'AfterAgent',
|
|
49
|
-
'BeforeTool',
|
|
50
|
-
'AfterTool',
|
|
51
|
-
'BeforeModel',
|
|
52
|
-
'AfterModel',
|
|
53
|
-
'PreCompress',
|
|
54
|
-
'Notification',
|
|
55
|
-
],
|
|
56
|
-
supportsSpawn: false,
|
|
57
|
-
supportsInstall: true,
|
|
58
|
-
supportsInstructionFiles: false,
|
|
59
|
-
supportsContextMonitor: false,
|
|
60
|
-
supportsStatusline: false,
|
|
61
|
-
supportsProviderPaths: false,
|
|
62
|
-
supportsTransport: false,
|
|
63
|
-
supportsTaskSync: false,
|
|
64
|
-
};
|
|
65
|
-
/** Hook provider for CAAMP event mapping. */
|
|
66
|
-
hooks;
|
|
67
|
-
/** Install provider for managing instruction files. */
|
|
68
|
-
install;
|
|
69
|
-
/** Project directory this adapter was initialized with, or null. */
|
|
70
|
-
projectDir = null;
|
|
71
|
-
/** Whether {@link initialize} has been called. */
|
|
72
|
-
initialized = false;
|
|
73
|
-
constructor() {
|
|
74
|
-
this.hooks = new GeminiCliHookProvider();
|
|
75
|
-
this.install = new GeminiCliInstallProvider();
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Initialize the adapter for a given project directory.
|
|
79
|
-
*
|
|
80
|
-
* @param projectDir - Root directory of the project
|
|
81
|
-
* @task T161
|
|
82
|
-
*/
|
|
83
|
-
async initialize(projectDir) {
|
|
84
|
-
this.projectDir = projectDir;
|
|
85
|
-
this.initialized = true;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Dispose the adapter and clean up resources.
|
|
89
|
-
*
|
|
90
|
-
* Unregisters hooks and releases any tracked state.
|
|
91
|
-
* @task T161
|
|
92
|
-
*/
|
|
93
|
-
async dispose() {
|
|
94
|
-
if (this.hooks.isRegistered()) {
|
|
95
|
-
await this.hooks.unregisterNativeHooks();
|
|
96
|
-
}
|
|
97
|
-
this.initialized = false;
|
|
98
|
-
this.projectDir = null;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Run a health check to verify Gemini CLI is accessible.
|
|
102
|
-
*
|
|
103
|
-
* Checks:
|
|
104
|
-
* 1. Adapter has been initialized
|
|
105
|
-
* 2. Gemini CLI binary is available in PATH
|
|
106
|
-
* 3. ~/.gemini/ configuration directory exists
|
|
107
|
-
*
|
|
108
|
-
* @returns Health status with details about each check
|
|
109
|
-
* @task T161
|
|
110
|
-
*/
|
|
111
|
-
async healthCheck() {
|
|
112
|
-
const details = {};
|
|
113
|
-
if (!this.initialized) {
|
|
114
|
-
return {
|
|
115
|
-
healthy: false,
|
|
116
|
-
provider: this.id,
|
|
117
|
-
details: { error: 'Adapter not initialized' },
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
// Check Gemini CLI availability
|
|
121
|
-
let cliAvailable = false;
|
|
122
|
-
try {
|
|
123
|
-
const { stdout } = await execAsync('which gemini');
|
|
124
|
-
cliAvailable = stdout.trim().length > 0;
|
|
125
|
-
details.cliPath = stdout.trim();
|
|
126
|
-
}
|
|
127
|
-
catch {
|
|
128
|
-
details.cliAvailable = false;
|
|
129
|
-
}
|
|
130
|
-
// Check for Gemini CLI config directory
|
|
131
|
-
const geminiConfigDir = join(homedir(), '.gemini');
|
|
132
|
-
const configExists = existsSync(geminiConfigDir);
|
|
133
|
-
details.configDirExists = configExists;
|
|
134
|
-
// Healthy if CLI is available (primary requirement)
|
|
135
|
-
const healthy = cliAvailable;
|
|
136
|
-
details.cliAvailable = cliAvailable;
|
|
137
|
-
return {
|
|
138
|
-
healthy,
|
|
139
|
-
provider: this.id,
|
|
140
|
-
details,
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Check whether the adapter has been initialized.
|
|
145
|
-
* @task T161
|
|
146
|
-
*/
|
|
147
|
-
isInitialized() {
|
|
148
|
-
return this.initialized;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Get the project directory this adapter was initialized with.
|
|
152
|
-
* @task T161
|
|
153
|
-
*/
|
|
154
|
-
getProjectDir() {
|
|
155
|
-
return this.projectDir;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
//# sourceMappingURL=adapter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../src/providers/gemini-cli/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAMtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,gBAAgB;IAC3B,kCAAkC;IACzB,EAAE,GAAG,YAAY,CAAC;IAC3B,oCAAoC;IAC3B,IAAI,GAAG,YAAY,CAAC;IAC7B,8BAA8B;IACrB,OAAO,GAAG,OAAO,CAAC;IAE3B,+CAA+C;IAC/C,YAAY,GAAwB;QAClC,aAAa,EAAE,IAAI;QACnB,mBAAmB,EAAE;YACnB,cAAc;YACd,YAAY;YACZ,aAAa;YACb,YAAY;YACZ,YAAY;YACZ,WAAW;YACX,aAAa;YACb,YAAY;YACZ,aAAa;YACb,cAAc;SACf;QACD,aAAa,EAAE,KAAK;QACpB,eAAe,EAAE,IAAI;QACrB,wBAAwB,EAAE,KAAK;QAC/B,sBAAsB,EAAE,KAAK;QAC7B,kBAAkB,EAAE,KAAK;QACzB,qBAAqB,EAAE,KAAK;QAC5B,iBAAiB,EAAE,KAAK;QACxB,gBAAgB,EAAE,KAAK;KACxB,CAAC;IAEF,6CAA6C;IAC7C,KAAK,CAAwB;IAC7B,uDAAuD;I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AAC;YACP,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC;QAC/B,CAAC;QAED,wCAAwC;QACxC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;QACnD,MAAM,YAAY,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;QACjD,OAAO,CAAC,eAAe,GAAG,YAAY,CAAC;QAEvC,oDAAoD;QACpD,MAAM,OAAO,GAAG,YAAY,CAAC;QAC7B,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC;QAEpC,OAAO;YACL,OAAO;YACP,QAAQ,EAAE,IAAI,CAAC,EAAE;YACjB,OAAO;SACR,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI Hook Provider
|
|
3
|
-
*
|
|
4
|
-
* Maps Gemini CLI's native hook events to CAAMP canonical hook events.
|
|
5
|
-
* Gemini CLI supports 11 canonical events through its hook system.
|
|
6
|
-
*
|
|
7
|
-
* Gemini CLI event mapping:
|
|
8
|
-
* - SessionStart -> SessionStart
|
|
9
|
-
* - SessionEnd -> SessionEnd
|
|
10
|
-
* - PromptSubmit -> BeforeAgent
|
|
11
|
-
* - ResponseComplete -> AfterAgent
|
|
12
|
-
* - PreToolUse -> BeforeTool
|
|
13
|
-
* - PostToolUse -> AfterTool
|
|
14
|
-
* - PreModel -> BeforeModel
|
|
15
|
-
* - PostModel -> AfterModel
|
|
16
|
-
* - PreCompact -> PreCompress
|
|
17
|
-
* - Notification -> Notification
|
|
18
|
-
*
|
|
19
|
-
* @task T161
|
|
20
|
-
* @epic T134
|
|
21
|
-
*/
|
|
22
|
-
import { homedir } from 'node:os';
|
|
23
|
-
import { join } from 'node:path';
|
|
24
|
-
import { readLatestTranscript } from '../shared/transcript-reader.js';
|
|
25
|
-
/**
|
|
26
|
-
* Mapping from Gemini CLI native event names to CAAMP canonical event names.
|
|
27
|
-
*/
|
|
28
|
-
const GEMINI_CLI_EVENT_MAP = {
|
|
29
|
-
SessionStart: 'SessionStart',
|
|
30
|
-
SessionEnd: 'SessionEnd',
|
|
31
|
-
PromptSubmit: 'BeforeAgent',
|
|
32
|
-
ResponseComplete: 'AfterAgent',
|
|
33
|
-
PreToolUse: 'BeforeTool',
|
|
34
|
-
PostToolUse: 'AfterTool',
|
|
35
|
-
PreModel: 'BeforeModel',
|
|
36
|
-
PostModel: 'AfterModel',
|
|
37
|
-
PreCompact: 'PreCompress',
|
|
38
|
-
Notification: 'Notification',
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Hook provider for Gemini CLI.
|
|
42
|
-
*
|
|
43
|
-
* Gemini CLI registers hooks via its configuration system at
|
|
44
|
-
* ~/.gemini/. Hook handlers are shell scripts or commands that
|
|
45
|
-
* execute when the corresponding event fires.
|
|
46
|
-
*
|
|
47
|
-
* Since hooks are registered through the config system (managed by
|
|
48
|
-
* the install provider), registerNativeHooks and unregisterNativeHooks
|
|
49
|
-
* track registration state without performing filesystem operations.
|
|
50
|
-
*
|
|
51
|
-
* @remarks
|
|
52
|
-
* Gemini CLI uses its own event naming convention (e.g. BeforeAgent,
|
|
53
|
-
* AfterTool, PreCompress) which differs from both the PascalCase CAAMP
|
|
54
|
-
* canonical names and other providers' conventions. The static event map
|
|
55
|
-
* covers all 10 supported canonical events.
|
|
56
|
-
*
|
|
57
|
-
* @task T161
|
|
58
|
-
* @epic T134
|
|
59
|
-
*/
|
|
60
|
-
export class GeminiCliHookProvider {
|
|
61
|
-
/** Whether hooks have been registered for the current session. */
|
|
62
|
-
registered = false;
|
|
63
|
-
/**
|
|
64
|
-
* Map a Gemini CLI native event name to a CAAMP hook event name.
|
|
65
|
-
*
|
|
66
|
-
* @param providerEvent - Gemini CLI event name (e.g. "SessionStart", "PreToolUse")
|
|
67
|
-
* @returns CAAMP event name or null if unmapped
|
|
68
|
-
* @task T161
|
|
69
|
-
*/
|
|
70
|
-
mapProviderEvent(providerEvent) {
|
|
71
|
-
return GEMINI_CLI_EVENT_MAP[providerEvent] ?? null;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Register native hooks for a project.
|
|
75
|
-
*
|
|
76
|
-
* For Gemini CLI, hooks are registered via the config system
|
|
77
|
-
* (~/.gemini/), which is handled by the install provider.
|
|
78
|
-
* This method marks hooks as registered without performing
|
|
79
|
-
* filesystem operations.
|
|
80
|
-
*
|
|
81
|
-
* @param _projectDir - Project directory (unused; hooks are global)
|
|
82
|
-
* @task T161
|
|
83
|
-
*/
|
|
84
|
-
async registerNativeHooks(_projectDir) {
|
|
85
|
-
this.registered = true;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Unregister native hooks.
|
|
89
|
-
*
|
|
90
|
-
* For Gemini CLI, this is a no-op since hooks are managed through
|
|
91
|
-
* the config system. Unregistration happens via the install
|
|
92
|
-
* provider's uninstall method.
|
|
93
|
-
* @task T161
|
|
94
|
-
*/
|
|
95
|
-
async unregisterNativeHooks() {
|
|
96
|
-
this.registered = false;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Check whether hooks have been registered via registerNativeHooks.
|
|
100
|
-
* @task T161
|
|
101
|
-
*/
|
|
102
|
-
isRegistered() {
|
|
103
|
-
return this.registered;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Get the full event mapping for introspection/debugging.
|
|
107
|
-
* @task T161
|
|
108
|
-
*/
|
|
109
|
-
getEventMap() {
|
|
110
|
-
return { ...GEMINI_CLI_EVENT_MAP };
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Extract a plain-text transcript from Gemini CLI session data.
|
|
114
|
-
*
|
|
115
|
-
* Reads the most recent JSON/JSONL session file under `~/.gemini/`
|
|
116
|
-
* and returns its turns as a flat string for brain observation extraction.
|
|
117
|
-
*
|
|
118
|
-
* Returns null when no session data is found or on any read error.
|
|
119
|
-
*
|
|
120
|
-
* @param _sessionId - CLEO session ID (unused; reads the most recent file)
|
|
121
|
-
* @param _projectDir - Project directory (unused; Gemini CLI uses global paths)
|
|
122
|
-
* @task T161 @epic T134
|
|
123
|
-
*/
|
|
124
|
-
async getTranscript(_sessionId, _projectDir) {
|
|
125
|
-
return readLatestTranscript(join(homedir(), '.gemini'));
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/providers/gemini-cli/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE;;GAEG;AACH,MAAM,oBAAoB,GAA2B;IACnD,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,aAAa;IAC3B,gBAAgB,EAAE,YAAY;IAC9B,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,WAAW;IACxB,QAAQ,EAAE,aAAa;IACvB,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,cAAc;CAC7B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,qBAAqB;IAChC,kEAAkE;IAC1D,UAAU,GAAG,KAAK,CAAC;IAE3B;;;;;;OAMG;IACH,gBAAgB,CAAC,aAAqB;QACpC,OAAO,oBAAoB,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC;IACrD,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,mBAAmB,CAAC,WAAmB;QAC3C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,qBAAqB;QACzB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,EAAE,GAAG,oBAAoB,EAAE,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,aAAa,CAAC,UAAkB,EAAE,WAAmB;QACzD,OAAO,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;IAC1D,CAAC;CACF"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
*
|
|
4
|
-
* CLEO provider adapter for Google Gemini CLI.
|
|
5
|
-
* Default export is the adapter class for dynamic loading by AdapterManager.
|
|
6
|
-
*
|
|
7
|
-
* @task T161
|
|
8
|
-
* @epic T134
|
|
9
|
-
*/
|
|
10
|
-
import { GeminiCliAdapter } from './adapter.js';
|
|
11
|
-
export { GeminiCliAdapter } from './adapter.js';
|
|
12
|
-
export { GeminiCliHookProvider } from './hooks.js';
|
|
13
|
-
export { GeminiCliInstallProvider } from './install.js';
|
|
14
|
-
export default GeminiCliAdapter;
|
|
15
|
-
/**
|
|
16
|
-
* Factory function for creating adapter instances.
|
|
17
|
-
* Used by AdapterManager's dynamic import fallback.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* This is the primary entry point for dynamic adapter loading.
|
|
21
|
-
* AdapterManager calls this function when it resolves the gemini-cli
|
|
22
|
-
* provider via its import-based discovery mechanism.
|
|
23
|
-
*
|
|
24
|
-
* @returns A new {@link GeminiCliAdapter} instance ready for initialization
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```typescript
|
|
28
|
-
* import { createAdapter } from '@cleocode/adapters/providers/gemini-cli';
|
|
29
|
-
*
|
|
30
|
-
* const adapter = createAdapter();
|
|
31
|
-
* await adapter.initialize('/path/to/project');
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @task T161
|
|
35
|
-
*/
|
|
36
|
-
export function createAdapter() {
|
|
37
|
-
return new GeminiCliAdapter();
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/gemini-cli/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,eAAe,gBAAgB,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,IAAI,gBAAgB,EAAE,CAAC;AAChC,CAAC"}
|