@specsafe/core 0.4.0 → 0.5.0
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/dist/agents/adapters/base.d.ts +44 -0
- package/dist/agents/adapters/base.d.ts.map +1 -0
- package/dist/agents/adapters/base.js +164 -0
- package/dist/agents/adapters/base.js.map +1 -0
- package/dist/agents/adapters/claude-code.d.ts +14 -0
- package/dist/agents/adapters/claude-code.d.ts.map +1 -0
- package/dist/agents/adapters/claude-code.js +120 -0
- package/dist/agents/adapters/claude-code.js.map +1 -0
- package/dist/agents/adapters/copilot.d.ts +13 -0
- package/dist/agents/adapters/copilot.d.ts.map +1 -0
- package/dist/agents/adapters/copilot.js +115 -0
- package/dist/agents/adapters/copilot.js.map +1 -0
- package/dist/agents/adapters/cursor.d.ts +13 -0
- package/dist/agents/adapters/cursor.d.ts.map +1 -0
- package/dist/agents/adapters/cursor.js +105 -0
- package/dist/agents/adapters/cursor.js.map +1 -0
- package/dist/agents/adapters/gemini-cli.d.ts +13 -0
- package/dist/agents/adapters/gemini-cli.d.ts.map +1 -0
- package/dist/agents/adapters/gemini-cli.js +79 -0
- package/dist/agents/adapters/gemini-cli.js.map +1 -0
- package/dist/agents/adapters/index.d.ts +16 -0
- package/dist/agents/adapters/index.d.ts.map +1 -0
- package/dist/agents/adapters/index.js +47 -0
- package/dist/agents/adapters/index.js.map +1 -0
- package/dist/agents/adapters/opencode.d.ts +13 -0
- package/dist/agents/adapters/opencode.d.ts.map +1 -0
- package/dist/agents/adapters/opencode.js +67 -0
- package/dist/agents/adapters/opencode.js.map +1 -0
- package/dist/agents/index.d.ts +8 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +9 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/registry.d.ts +70 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +194 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/types.d.ts +71 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +6 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/delta/merger.d.ts +36 -0
- package/dist/delta/merger.d.ts.map +1 -0
- package/dist/delta/merger.js +264 -0
- package/dist/delta/merger.js.map +1 -0
- package/dist/delta/parser.d.ts +27 -0
- package/dist/delta/parser.d.ts.map +1 -0
- package/dist/delta/parser.js +196 -0
- package/dist/delta/parser.js.map +1 -0
- package/dist/delta/types.d.ts +39 -0
- package/dist/delta/types.d.ts.map +1 -0
- package/dist/delta/types.js +6 -0
- package/dist/delta/types.js.map +1 -0
- package/dist/ears/index.d.ts +11 -0
- package/dist/ears/index.d.ts.map +1 -0
- package/dist/ears/index.js +11 -0
- package/dist/ears/index.js.map +1 -0
- package/dist/ears/parser.d.ts +22 -0
- package/dist/ears/parser.d.ts.map +1 -0
- package/dist/ears/parser.js +273 -0
- package/dist/ears/parser.js.map +1 -0
- package/dist/ears/template.d.ts +20 -0
- package/dist/ears/template.d.ts.map +1 -0
- package/dist/ears/template.js +364 -0
- package/dist/ears/template.js.map +1 -0
- package/dist/ears/types.d.ts +58 -0
- package/dist/ears/types.d.ts.map +1 -0
- package/dist/ears/types.js +6 -0
- package/dist/ears/types.js.map +1 -0
- package/dist/ears/validator.d.ts +37 -0
- package/dist/ears/validator.d.ts.map +1 -0
- package/dist/ears/validator.js +234 -0
- package/dist/ears/validator.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/templates/delta-template.d.ts +18 -0
- package/dist/templates/delta-template.d.ts.map +1 -0
- package/dist/templates/delta-template.js +191 -0
- package/dist/templates/delta-template.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini CLI Adapter
|
|
3
|
+
* Generates configuration for Gemini CLI
|
|
4
|
+
*/
|
|
5
|
+
import { BaseAgentAdapter } from './base.js';
|
|
6
|
+
import { getRequiredAgentDefinition } from '../registry.js';
|
|
7
|
+
export class GeminiCliAdapter extends BaseAgentAdapter {
|
|
8
|
+
agent = getRequiredAgentDefinition('gemini-cli');
|
|
9
|
+
async generateConfig(projectDir, options) {
|
|
10
|
+
const files = [];
|
|
11
|
+
// Generate config.yaml
|
|
12
|
+
files.push({
|
|
13
|
+
path: '.gemini/config.yaml',
|
|
14
|
+
content: `# Gemini CLI configuration for SpecSafe v1.0
|
|
15
|
+
name: SpecSafe
|
|
16
|
+
version: 1.0.0
|
|
17
|
+
|
|
18
|
+
# Context files to always include
|
|
19
|
+
context:
|
|
20
|
+
- PROJECT_STATE.md
|
|
21
|
+
- specsafe.config.json
|
|
22
|
+
- specs/active/*.md
|
|
23
|
+
|
|
24
|
+
# Custom prompts directory
|
|
25
|
+
prompts_dir: .gemini/prompts
|
|
26
|
+
|
|
27
|
+
# Default model
|
|
28
|
+
model: gemini-1.5-pro
|
|
29
|
+
|
|
30
|
+
# System instructions
|
|
31
|
+
system: |
|
|
32
|
+
${this.getMainContext().split('\n').join('\n ')}
|
|
33
|
+
`,
|
|
34
|
+
});
|
|
35
|
+
return files;
|
|
36
|
+
}
|
|
37
|
+
async generateCommands(projectDir, options) {
|
|
38
|
+
const files = [];
|
|
39
|
+
// Generate prompt files for each command
|
|
40
|
+
for (const command of this.getWorkflowCommands()) {
|
|
41
|
+
files.push({
|
|
42
|
+
path: `.gemini/prompts/${command}.md`,
|
|
43
|
+
content: `# ${this.getCommandDescription(command)}
|
|
44
|
+
|
|
45
|
+
${this.getCommandPrompt(command)}
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
Command: /${command}
|
|
49
|
+
`,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return files;
|
|
53
|
+
}
|
|
54
|
+
getInstructions() {
|
|
55
|
+
return `Gemini CLI Setup Complete!
|
|
56
|
+
|
|
57
|
+
Files created:
|
|
58
|
+
- .gemini/config.yaml - Main configuration
|
|
59
|
+
- .gemini/prompts/ - Workflow command prompts
|
|
60
|
+
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
1. Install Gemini CLI if not already installed
|
|
64
|
+
2. Navigate to your project directory
|
|
65
|
+
3. Use commands:
|
|
66
|
+
- gemini /specsafe - Check status
|
|
67
|
+
- gemini /specsafe-explore - Start exploration
|
|
68
|
+
- gemini /specsafe-new - Create spec
|
|
69
|
+
- gemini /specsafe-spec - Generate detailed spec
|
|
70
|
+
- gemini /specsafe-test-create - Generate tests
|
|
71
|
+
- gemini /specsafe-test-apply - Implement
|
|
72
|
+
- gemini /specsafe-verify - Verify tests
|
|
73
|
+
- gemini /specsafe-done - Complete spec
|
|
74
|
+
|
|
75
|
+
The CLI will use the prompts in .gemini/prompts/ to guide the workflow.
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=gemini-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gemini-cli.js","sourceRoot":"","sources":["../../../src/agents/adapters/gemini-cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAE5D,MAAM,OAAO,gBAAiB,SAAQ,gBAAgB;IAC3C,KAAK,GAAoB,0BAA0B,CAAC,YAAY,CAAC,CAAC;IAE3E,KAAK,CAAC,cAAc,CAAC,UAAkB,EAAE,OAAyB;QAChE,MAAM,KAAK,GAAoB,EAAE,CAAC;QAElC,uBAAuB;QACvB,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE;;;;;;;;;;;;;;;;;;IAkBX,IAAI,CAAC,cAAc,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;CACjD;SACI,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,UAAkB,EAAE,OAAyB;QAClE,MAAM,KAAK,GAAoB,EAAE,CAAC;QAElC,yCAAyC;QACzC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,mBAAmB,EAAE,EAAE,CAAC;YACjD,KAAK,CAAC,IAAI,CAAC;gBACT,IAAI,EAAE,mBAAmB,OAAO,KAAK;gBACrC,OAAO,EAAE,KAAK,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC;;EAEvD,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;;;YAGpB,OAAO;CAClB;aACM,CAAC,CAAC;QACL,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,eAAe;QACb,OAAO;;;;;;;;;;;;;;;;;;;;;CAqBV,CAAC;IACA,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Adapters Index
|
|
3
|
+
* Exports all agent adapters and registers them with the registry
|
|
4
|
+
*/
|
|
5
|
+
export { BaseAgentAdapter } from './base.js';
|
|
6
|
+
export { ClaudeCodeAdapter } from './claude-code.js';
|
|
7
|
+
export { CursorAdapter } from './cursor.js';
|
|
8
|
+
export { CopilotAdapter } from './copilot.js';
|
|
9
|
+
export { GeminiCliAdapter } from './gemini-cli.js';
|
|
10
|
+
export { OpenCodeAdapter } from './opencode.js';
|
|
11
|
+
/**
|
|
12
|
+
* Initialize and register all adapters
|
|
13
|
+
* This function is idempotent - calling it multiple times is safe
|
|
14
|
+
*/
|
|
15
|
+
export declare function initializeAdapters(): void;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAKhD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAuBzC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Adapters Index
|
|
3
|
+
* Exports all agent adapters and registers them with the registry
|
|
4
|
+
*/
|
|
5
|
+
import { ClaudeCodeAdapter } from './claude-code.js';
|
|
6
|
+
import { CursorAdapter } from './cursor.js';
|
|
7
|
+
import { CopilotAdapter } from './copilot.js';
|
|
8
|
+
import { GeminiCliAdapter } from './gemini-cli.js';
|
|
9
|
+
import { OpenCodeAdapter } from './opencode.js';
|
|
10
|
+
import { registerAgent, getAgentDefinition } from '../registry.js';
|
|
11
|
+
// Export adapters
|
|
12
|
+
export { BaseAgentAdapter } from './base.js';
|
|
13
|
+
export { ClaudeCodeAdapter } from './claude-code.js';
|
|
14
|
+
export { CursorAdapter } from './cursor.js';
|
|
15
|
+
export { CopilotAdapter } from './copilot.js';
|
|
16
|
+
export { GeminiCliAdapter } from './gemini-cli.js';
|
|
17
|
+
export { OpenCodeAdapter } from './opencode.js';
|
|
18
|
+
// Track initialization state
|
|
19
|
+
let initialized = false;
|
|
20
|
+
/**
|
|
21
|
+
* Initialize and register all adapters
|
|
22
|
+
* This function is idempotent - calling it multiple times is safe
|
|
23
|
+
*/
|
|
24
|
+
export function initializeAdapters() {
|
|
25
|
+
if (initialized) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Define adapters to register as [id, AdapterClass] pairs
|
|
29
|
+
const adapters = [
|
|
30
|
+
['claude-code', ClaudeCodeAdapter],
|
|
31
|
+
['cursor', CursorAdapter],
|
|
32
|
+
['copilot', CopilotAdapter],
|
|
33
|
+
['gemini-cli', GeminiCliAdapter],
|
|
34
|
+
['opencode', OpenCodeAdapter],
|
|
35
|
+
];
|
|
36
|
+
// Register each adapter
|
|
37
|
+
for (const [id, AdapterClass] of adapters) {
|
|
38
|
+
const definition = getAgentDefinition(id);
|
|
39
|
+
if (definition) {
|
|
40
|
+
registerAgent(definition, new AdapterClass());
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
initialized = true;
|
|
44
|
+
}
|
|
45
|
+
// Auto-initialize when module is imported
|
|
46
|
+
initializeAdapters();
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/adapters/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEnE,kBAAkB;AAClB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,6BAA6B;AAC7B,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO;IACT,CAAC;IAED,0DAA0D;IAC1D,MAAM,QAAQ,GAAgD;QAC5D,CAAC,aAAa,EAAE,iBAAiB,CAAC;QAClC,CAAC,QAAQ,EAAE,aAAa,CAAC;QACzB,CAAC,SAAS,EAAE,cAAc,CAAC;QAC3B,CAAC,YAAY,EAAE,gBAAgB,CAAC;QAChC,CAAC,UAAU,EAAE,eAAe,CAAC;KAC9B,CAAC;IAEF,wBAAwB;IACxB,KAAK,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC1C,MAAM,UAAU,GAAG,kBAAkB,CAAC,EAAE,CAAC,CAAC;QAC1C,IAAI,UAAU,EAAE,CAAC;YACf,aAAa,CAAC,UAAU,EAAE,IAAI,YAAY,EAAE,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,WAAW,GAAG,IAAI,CAAC;AACrB,CAAC;AAED,0CAA0C;AAC1C,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenCode Adapter
|
|
3
|
+
* Generates configuration for OpenCode (Charm)
|
|
4
|
+
*/
|
|
5
|
+
import { BaseAgentAdapter } from './base.js';
|
|
6
|
+
import type { AgentDefinition, GeneratedFile, GenerateOptions } from '../types.js';
|
|
7
|
+
export declare class OpenCodeAdapter extends BaseAgentAdapter {
|
|
8
|
+
readonly agent: AgentDefinition;
|
|
9
|
+
generateConfig(projectDir: string, options?: GenerateOptions): Promise<GeneratedFile[]>;
|
|
10
|
+
generateCommands(projectDir: string, options?: GenerateOptions): Promise<GeneratedFile[]>;
|
|
11
|
+
getInstructions(): string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=opencode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/opencode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnF,qBAAa,eAAgB,SAAQ,gBAAgB;IACnD,QAAQ,CAAC,KAAK,EAAE,eAAe,CAA0C;IAEnE,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAwBvF,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAiB/F,eAAe,IAAI,MAAM;CAsB1B"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenCode Adapter
|
|
3
|
+
* Generates configuration for OpenCode (Charm)
|
|
4
|
+
*/
|
|
5
|
+
import { BaseAgentAdapter } from './base.js';
|
|
6
|
+
import { getRequiredAgentDefinition } from '../registry.js';
|
|
7
|
+
export class OpenCodeAdapter extends BaseAgentAdapter {
|
|
8
|
+
agent = getRequiredAgentDefinition('opencode');
|
|
9
|
+
async generateConfig(projectDir, options) {
|
|
10
|
+
const files = [];
|
|
11
|
+
// Generate README for context
|
|
12
|
+
files.push({
|
|
13
|
+
path: '.opencode/README.md',
|
|
14
|
+
content: `# SpecSafe Commands for OpenCode
|
|
15
|
+
|
|
16
|
+
${this.getMainContext()}
|
|
17
|
+
|
|
18
|
+
## Available Commands
|
|
19
|
+
|
|
20
|
+
${this.getWorkflowCommands().map((cmd) => `- /${cmd} - ${this.getCommandDescription(cmd)}`).join('\n')}
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
Invoke commands using \`/command-name\` syntax.
|
|
25
|
+
Each command is defined in the commands/ directory.
|
|
26
|
+
`,
|
|
27
|
+
});
|
|
28
|
+
return files;
|
|
29
|
+
}
|
|
30
|
+
async generateCommands(projectDir, options) {
|
|
31
|
+
const files = [];
|
|
32
|
+
// Generate command files
|
|
33
|
+
for (const command of this.getWorkflowCommands()) {
|
|
34
|
+
files.push({
|
|
35
|
+
path: `.opencode/commands/${command}.md`,
|
|
36
|
+
content: `# ${this.getCommandDescription(command)}
|
|
37
|
+
|
|
38
|
+
${this.getCommandPrompt(command)}
|
|
39
|
+
`,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return files;
|
|
43
|
+
}
|
|
44
|
+
getInstructions() {
|
|
45
|
+
return `OpenCode Setup Complete!
|
|
46
|
+
|
|
47
|
+
Files created:
|
|
48
|
+
- .opencode/README.md - Overview
|
|
49
|
+
- .opencode/commands/ - Workflow commands
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
1. Open your project with OpenCode
|
|
54
|
+
2. Use slash commands:
|
|
55
|
+
- /specsafe - Check status
|
|
56
|
+
- /specsafe-explore - Start exploration
|
|
57
|
+
- /specsafe-new - Create spec
|
|
58
|
+
- /specsafe-test-create - Generate tests
|
|
59
|
+
- /specsafe-test-apply - Implement
|
|
60
|
+
- /specsafe-verify - Verify tests
|
|
61
|
+
- /specsafe-done - Complete spec
|
|
62
|
+
|
|
63
|
+
OpenCode will load commands from .opencode/commands/ directory.
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=opencode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../../src/agents/adapters/opencode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAE5D,MAAM,OAAO,eAAgB,SAAQ,gBAAgB;IAC1C,KAAK,GAAoB,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAEzE,KAAK,CAAC,cAAc,CAAC,UAAkB,EAAE,OAAyB;QAChE,MAAM,KAAK,GAAoB,EAAE,CAAC;QAElC,8BAA8B;QAC9B,KAAK,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE;;EAEb,IAAI,CAAC,cAAc,EAAE;;;;EAIrB,IAAI,CAAC,mBAAmB,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;CAMrG;SACI,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,UAAkB,EAAE,OAAyB;QAClE,MAAM,KAAK,GAAoB,EAAE,CAAC;QAElC,yBAAyB;QACzB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,mBAAmB,EAAE,EAAE,CAAC;YACjD,KAAK,CAAC,IAAI,CAAC;gBACT,IAAI,EAAE,sBAAsB,OAAO,KAAK;gBACxC,OAAO,EAAE,KAAK,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC;;EAEvD,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;CAC/B;aACM,CAAC,CAAC;QACL,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,eAAe;QACb,OAAO;;;;;;;;;;;;;;;;;;;CAmBV,CAAC;IACA,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agents Module Index
|
|
3
|
+
* Exports agent registry, types, and adapters
|
|
4
|
+
*/
|
|
5
|
+
export type { AgentDefinition, AgentAdapter, AgentRegistryEntry, GenerateOptions, GeneratedFile, } from './types.js';
|
|
6
|
+
export { getAgent, listAgents, getSupportedAgents, isValidAgent, getAgentDefinition, registerAgent, AGENT_DEFINITIONS, } from './registry.js';
|
|
7
|
+
export { ClaudeCodeAdapter, CursorAdapter, CopilotAdapter, GeminiCliAdapter, OpenCodeAdapter, BaseAgentAdapter, initializeAdapters, } from './adapters/index.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EACV,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,aAAa,GACd,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agents Module Index
|
|
3
|
+
* Exports agent registry, types, and adapters
|
|
4
|
+
*/
|
|
5
|
+
// Export registry functions
|
|
6
|
+
export { getAgent, listAgents, getSupportedAgents, isValidAgent, getAgentDefinition, registerAgent, AGENT_DEFINITIONS, } from './registry.js';
|
|
7
|
+
// Export adapters (this will auto-initialize them)
|
|
8
|
+
export { ClaudeCodeAdapter, CursorAdapter, CopilotAdapter, GeminiCliAdapter, OpenCodeAdapter, BaseAgentAdapter, initializeAdapters, } from './adapters/index.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,4BAA4B;AAC5B,OAAO,EACL,QAAQ,EACR,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,mDAAmD;AACnD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Registry
|
|
3
|
+
* Central registry for all supported AI coding agents
|
|
4
|
+
*/
|
|
5
|
+
import type { AgentDefinition, AgentRegistryEntry, AgentAdapter } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Supported agent definitions
|
|
8
|
+
*/
|
|
9
|
+
export declare const AGENT_DEFINITIONS: AgentDefinition[];
|
|
10
|
+
/**
|
|
11
|
+
* Agent registry - stores agent definitions with their adapters
|
|
12
|
+
*/
|
|
13
|
+
declare class AgentRegistry {
|
|
14
|
+
private agents;
|
|
15
|
+
/**
|
|
16
|
+
* Register an agent with its adapter
|
|
17
|
+
*/
|
|
18
|
+
register(definition: AgentDefinition, adapter: AgentAdapter): void;
|
|
19
|
+
/**
|
|
20
|
+
* Get agent by ID
|
|
21
|
+
*/
|
|
22
|
+
getAgent(id: string): AgentRegistryEntry | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Get all registered agents
|
|
25
|
+
*/
|
|
26
|
+
listAgents(): AgentRegistryEntry[];
|
|
27
|
+
/**
|
|
28
|
+
* Get agent IDs
|
|
29
|
+
*/
|
|
30
|
+
getAgentIds(): string[];
|
|
31
|
+
/**
|
|
32
|
+
* Check if agent is registered
|
|
33
|
+
*/
|
|
34
|
+
hasAgent(id: string): boolean;
|
|
35
|
+
}
|
|
36
|
+
declare const registry: AgentRegistry;
|
|
37
|
+
/**
|
|
38
|
+
* Get agent definition by ID
|
|
39
|
+
*/
|
|
40
|
+
export declare function getAgent(id: string): AgentRegistryEntry | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Get all registered agents
|
|
43
|
+
*/
|
|
44
|
+
export declare function listAgents(): AgentRegistryEntry[];
|
|
45
|
+
/**
|
|
46
|
+
* Get list of supported agent IDs
|
|
47
|
+
*/
|
|
48
|
+
export declare function getSupportedAgents(): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Check if an agent ID is supported (static check against AGENT_DEFINITIONS)
|
|
51
|
+
* Note: This checks if the agent is defined, not if it has an adapter registered.
|
|
52
|
+
* Use getAgent() to check if an adapter is available at runtime.
|
|
53
|
+
*/
|
|
54
|
+
export declare function isValidAgent(id: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Get agent definition (without adapter) by ID
|
|
57
|
+
*/
|
|
58
|
+
export declare function getAgentDefinition(id: string): AgentDefinition | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Get agent definition by ID with error if not found
|
|
61
|
+
* Use this when you expect the agent to exist (e.g., in adapters)
|
|
62
|
+
*/
|
|
63
|
+
export declare function getRequiredAgentDefinition(id: string): AgentDefinition;
|
|
64
|
+
/**
|
|
65
|
+
* Register an agent adapter
|
|
66
|
+
* Used by adapters to register themselves with the registry
|
|
67
|
+
*/
|
|
68
|
+
export declare function registerAgent(definition: AgentDefinition, adapter: AgentAdapter): void;
|
|
69
|
+
export { registry };
|
|
70
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/agents/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEpF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,eAAe,EA4F9C,CAAC;AAEF;;GAEG;AACH,cAAM,aAAa;IACjB,OAAO,CAAC,MAAM,CAA8C;IAE5D;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI;IAOlE;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAIpD;;OAEG;IACH,UAAU,IAAI,kBAAkB,EAAE;IAIlC;;OAEG;IACH,WAAW,IAAI,MAAM,EAAE;IAIvB;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;CAG9B;AAGD,QAAA,MAAM,QAAQ,eAAsB,CAAC;AAErC;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAEnE;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,kBAAkB,EAAE,CAEjD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAE1E;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,CAMtE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,GAAG,IAAI,CAEtF;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Registry
|
|
3
|
+
* Central registry for all supported AI coding agents
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Supported agent definitions
|
|
7
|
+
*/
|
|
8
|
+
export const AGENT_DEFINITIONS = [
|
|
9
|
+
{
|
|
10
|
+
id: 'claude-code',
|
|
11
|
+
name: 'Claude Code',
|
|
12
|
+
configDir: '.claude',
|
|
13
|
+
commandDir: '.claude/skills',
|
|
14
|
+
fileExtension: '.md',
|
|
15
|
+
commandFormat: '/command-name',
|
|
16
|
+
detectionFiles: ['CLAUDE.md', '.claude/skills'],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: 'cursor',
|
|
20
|
+
name: 'Cursor IDE',
|
|
21
|
+
configDir: undefined,
|
|
22
|
+
commandDir: undefined,
|
|
23
|
+
fileExtension: '.cursorrules',
|
|
24
|
+
commandFormat: '@command',
|
|
25
|
+
detectionFiles: ['.cursorrules'],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'copilot',
|
|
29
|
+
name: 'GitHub Copilot',
|
|
30
|
+
configDir: '.github',
|
|
31
|
+
commandDir: undefined,
|
|
32
|
+
fileExtension: '.md',
|
|
33
|
+
commandFormat: '@workspace /command',
|
|
34
|
+
detectionFiles: ['.github/copilot-instructions.md'],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'gemini-cli',
|
|
38
|
+
name: 'Gemini CLI',
|
|
39
|
+
configDir: '.gemini',
|
|
40
|
+
commandDir: '.gemini/prompts',
|
|
41
|
+
fileExtension: '.md',
|
|
42
|
+
commandFormat: '/command',
|
|
43
|
+
detectionFiles: ['.gemini/config.yaml', '.gemini/prompts'],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'opencode',
|
|
47
|
+
name: 'OpenCode',
|
|
48
|
+
configDir: '.opencode',
|
|
49
|
+
commandDir: '.opencode/commands',
|
|
50
|
+
fileExtension: '.md',
|
|
51
|
+
commandFormat: '/command',
|
|
52
|
+
detectionFiles: ['.opencode/commands'],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'windsurf',
|
|
56
|
+
name: 'Windsurf',
|
|
57
|
+
configDir: '.windsurf',
|
|
58
|
+
commandDir: '.windsurf/rules',
|
|
59
|
+
fileExtension: '.md',
|
|
60
|
+
commandFormat: '@command',
|
|
61
|
+
detectionFiles: ['.windsurf/rules.md'],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'continue',
|
|
65
|
+
name: 'Continue.dev',
|
|
66
|
+
configDir: '.continue',
|
|
67
|
+
commandDir: '.continue/prompts',
|
|
68
|
+
fileExtension: '.md',
|
|
69
|
+
commandFormat: '/command',
|
|
70
|
+
detectionFiles: ['.continue/config.yaml'],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'crush',
|
|
74
|
+
name: 'Crush',
|
|
75
|
+
configDir: '.opencode',
|
|
76
|
+
commandDir: '.opencode/commands',
|
|
77
|
+
fileExtension: '.md',
|
|
78
|
+
commandFormat: '/command',
|
|
79
|
+
// Note: Crush shares the same .opencode structure as OpenCode - they are compatible
|
|
80
|
+
detectionFiles: ['.opencode/commands'],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 'codex',
|
|
84
|
+
name: 'Codex',
|
|
85
|
+
configDir: '.codex',
|
|
86
|
+
commandDir: '.codex/commands',
|
|
87
|
+
fileExtension: '.md',
|
|
88
|
+
commandFormat: '/command',
|
|
89
|
+
detectionFiles: ['.codex/config.json'],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'qwen-code',
|
|
93
|
+
name: 'Qwen Code',
|
|
94
|
+
configDir: '.qwen',
|
|
95
|
+
commandDir: '.qwen/prompts',
|
|
96
|
+
fileExtension: '.md',
|
|
97
|
+
commandFormat: '/command',
|
|
98
|
+
detectionFiles: ['.qwen/config.yaml'],
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
/**
|
|
102
|
+
* Agent registry - stores agent definitions with their adapters
|
|
103
|
+
*/
|
|
104
|
+
class AgentRegistry {
|
|
105
|
+
agents = new Map();
|
|
106
|
+
/**
|
|
107
|
+
* Register an agent with its adapter
|
|
108
|
+
*/
|
|
109
|
+
register(definition, adapter) {
|
|
110
|
+
this.agents.set(definition.id, {
|
|
111
|
+
...definition,
|
|
112
|
+
adapter,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get agent by ID
|
|
117
|
+
*/
|
|
118
|
+
getAgent(id) {
|
|
119
|
+
return this.agents.get(id);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get all registered agents
|
|
123
|
+
*/
|
|
124
|
+
listAgents() {
|
|
125
|
+
return Array.from(this.agents.values());
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get agent IDs
|
|
129
|
+
*/
|
|
130
|
+
getAgentIds() {
|
|
131
|
+
return Array.from(this.agents.keys());
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Check if agent is registered
|
|
135
|
+
*/
|
|
136
|
+
hasAgent(id) {
|
|
137
|
+
return this.agents.has(id);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// Global registry instance
|
|
141
|
+
const registry = new AgentRegistry();
|
|
142
|
+
/**
|
|
143
|
+
* Get agent definition by ID
|
|
144
|
+
*/
|
|
145
|
+
export function getAgent(id) {
|
|
146
|
+
return registry.getAgent(id);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Get all registered agents
|
|
150
|
+
*/
|
|
151
|
+
export function listAgents() {
|
|
152
|
+
return registry.listAgents();
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Get list of supported agent IDs
|
|
156
|
+
*/
|
|
157
|
+
export function getSupportedAgents() {
|
|
158
|
+
return AGENT_DEFINITIONS.map((a) => a.id);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Check if an agent ID is supported (static check against AGENT_DEFINITIONS)
|
|
162
|
+
* Note: This checks if the agent is defined, not if it has an adapter registered.
|
|
163
|
+
* Use getAgent() to check if an adapter is available at runtime.
|
|
164
|
+
*/
|
|
165
|
+
export function isValidAgent(id) {
|
|
166
|
+
return AGENT_DEFINITIONS.some((a) => a.id === id);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Get agent definition (without adapter) by ID
|
|
170
|
+
*/
|
|
171
|
+
export function getAgentDefinition(id) {
|
|
172
|
+
return AGENT_DEFINITIONS.find((a) => a.id === id);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Get agent definition by ID with error if not found
|
|
176
|
+
* Use this when you expect the agent to exist (e.g., in adapters)
|
|
177
|
+
*/
|
|
178
|
+
export function getRequiredAgentDefinition(id) {
|
|
179
|
+
const definition = AGENT_DEFINITIONS.find((a) => a.id === id);
|
|
180
|
+
if (!definition) {
|
|
181
|
+
throw new Error(`Agent definition not found: ${id}. This is a configuration error.`);
|
|
182
|
+
}
|
|
183
|
+
return definition;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Register an agent adapter
|
|
187
|
+
* Used by adapters to register themselves with the registry
|
|
188
|
+
*/
|
|
189
|
+
export function registerAgent(definition, adapter) {
|
|
190
|
+
registry.register(definition, adapter);
|
|
191
|
+
}
|
|
192
|
+
// Export registry instance for advanced use cases
|
|
193
|
+
export { registry };
|
|
194
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/agents/registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD;QACE,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,SAAS;QACpB,UAAU,EAAE,gBAAgB;QAC5B,aAAa,EAAE,KAAK;QACpB,aAAa,EAAE,eAAe;QAC9B,cAAc,EAAE,CAAC,WAAW,EAAE,gBAAgB,CAAC;KAChD;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE,SAAS;QACpB,UAAU,EAAE,SAAS;QACrB,aAAa,EAAE,cAAc;QAC7B,aAAa,EAAE,UAAU;QACzB,cAAc,EAAE,CAAC,cAAc,CAAC;KACjC;IACD;QACE,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,SAAS;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+
*/
|
|
8
|
+
export interface AgentDefinition {
|
|
9
|
+
/** Unique identifier for the agent (e.g., 'claude-code', 'cursor') */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Human-readable name */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Configuration directory path (e.g., '.claude') */
|
|
14
|
+
configDir?: string;
|
|
15
|
+
/** Command directory path (e.g., '.claude/skills') */
|
|
16
|
+
commandDir?: string;
|
|
17
|
+
/** Config file extension (e.g., '.md', '.json', '.yaml') */
|
|
18
|
+
fileExtension: string;
|
|
19
|
+
/** Command format used by the agent (e.g., '/command', '@command') */
|
|
20
|
+
commandFormat: string;
|
|
21
|
+
/** Configuration file names to detect */
|
|
22
|
+
detectionFiles: string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Agent adapter interface
|
|
26
|
+
* Each agent implements this to generate its specific configuration
|
|
27
|
+
*/
|
|
28
|
+
export interface AgentAdapter {
|
|
29
|
+
/** Agent definition */
|
|
30
|
+
agent: AgentDefinition;
|
|
31
|
+
/** Generate main configuration file(s) for this agent */
|
|
32
|
+
generateConfig(projectDir: string, options?: GenerateOptions): Promise<GeneratedFile[]>;
|
|
33
|
+
/** Generate command/skill files for workflow commands */
|
|
34
|
+
generateCommands(projectDir: string, options?: GenerateOptions): Promise<GeneratedFile[]>;
|
|
35
|
+
/** Get instructions for using this agent with SpecSafe */
|
|
36
|
+
getInstructions(): string;
|
|
37
|
+
/** Detect if this agent is already configured in the project */
|
|
38
|
+
detect(projectDir: string): Promise<boolean>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Options for generating agent configurations
|
|
42
|
+
*/
|
|
43
|
+
export interface GenerateOptions {
|
|
44
|
+
/** Overwrite existing files */
|
|
45
|
+
force?: boolean;
|
|
46
|
+
/** Project name */
|
|
47
|
+
projectName?: string;
|
|
48
|
+
/** Test framework */
|
|
49
|
+
testFramework?: string;
|
|
50
|
+
/** Custom configuration values */
|
|
51
|
+
custom?: Record<string, unknown>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Generated file metadata
|
|
55
|
+
*/
|
|
56
|
+
export interface GeneratedFile {
|
|
57
|
+
/** Relative path from project root */
|
|
58
|
+
path: string;
|
|
59
|
+
/** File content */
|
|
60
|
+
content: string;
|
|
61
|
+
/** Whether this is an executable file */
|
|
62
|
+
executable?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Agent registry entry with metadata
|
|
66
|
+
*/
|
|
67
|
+
export interface AgentRegistryEntry extends AgentDefinition {
|
|
68
|
+
/** Adapter implementation */
|
|
69
|
+
adapter: AgentAdapter;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agents/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,aAAa,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,aAAa,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,KAAK,EAAE,eAAe,CAAC;IAEvB,yDAAyD;IACzD,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAExF,yDAAyD;IACzD,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAA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