@agentuity/opencode 0.1.15
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/AGENTS.md +40 -0
- package/README.md +113 -0
- package/dist/agents/builder.d.ts +4 -0
- package/dist/agents/builder.d.ts.map +1 -0
- package/dist/agents/builder.js +298 -0
- package/dist/agents/builder.js.map +1 -0
- package/dist/agents/expert.d.ts +4 -0
- package/dist/agents/expert.d.ts.map +1 -0
- package/dist/agents/expert.js +773 -0
- package/dist/agents/expert.js.map +1 -0
- package/dist/agents/index.d.ts +10 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +40 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/lead.d.ts +4 -0
- package/dist/agents/lead.d.ts.map +1 -0
- package/dist/agents/lead.js +463 -0
- package/dist/agents/lead.js.map +1 -0
- package/dist/agents/memory.d.ts +4 -0
- package/dist/agents/memory.d.ts.map +1 -0
- package/dist/agents/memory.js +317 -0
- package/dist/agents/memory.js.map +1 -0
- package/dist/agents/reviewer.d.ts +4 -0
- package/dist/agents/reviewer.d.ts.map +1 -0
- package/dist/agents/reviewer.js +321 -0
- package/dist/agents/reviewer.js.map +1 -0
- package/dist/agents/scout.d.ts +4 -0
- package/dist/agents/scout.d.ts.map +1 -0
- package/dist/agents/scout.js +280 -0
- package/dist/agents/scout.js.map +1 -0
- package/dist/agents/types.d.ts +29 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/types.js +2 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +2 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +14 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +98 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/mcps/context7.d.ts +3 -0
- package/dist/mcps/context7.d.ts.map +1 -0
- package/dist/mcps/context7.js +7 -0
- package/dist/mcps/context7.js.map +1 -0
- package/dist/mcps/grep-app.d.ts +3 -0
- package/dist/mcps/grep-app.d.ts.map +1 -0
- package/dist/mcps/grep-app.js +7 -0
- package/dist/mcps/grep-app.js.map +1 -0
- package/dist/mcps/index.d.ts +8 -0
- package/dist/mcps/index.d.ts.map +1 -0
- package/dist/mcps/index.js +25 -0
- package/dist/mcps/index.js.map +1 -0
- package/dist/plugin/hooks/keyword.d.ts +6 -0
- package/dist/plugin/hooks/keyword.d.ts.map +1 -0
- package/dist/plugin/hooks/keyword.js +110 -0
- package/dist/plugin/hooks/keyword.js.map +1 -0
- package/dist/plugin/hooks/params.d.ts +20 -0
- package/dist/plugin/hooks/params.d.ts.map +1 -0
- package/dist/plugin/hooks/params.js +157 -0
- package/dist/plugin/hooks/params.js.map +1 -0
- package/dist/plugin/hooks/session.d.ts +6 -0
- package/dist/plugin/hooks/session.d.ts.map +1 -0
- package/dist/plugin/hooks/session.js +20 -0
- package/dist/plugin/hooks/session.js.map +1 -0
- package/dist/plugin/hooks/tools.d.ts +7 -0
- package/dist/plugin/hooks/tools.d.ts.map +1 -0
- package/dist/plugin/hooks/tools.js +111 -0
- package/dist/plugin/hooks/tools.js.map +1 -0
- package/dist/plugin/index.d.ts +2 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +2 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/plugin.d.ts +3 -0
- package/dist/plugin/plugin.d.ts.map +1 -0
- package/dist/plugin/plugin.js +249 -0
- package/dist/plugin/plugin.js.map +1 -0
- package/dist/services/auth.d.ts +14 -0
- package/dist/services/auth.d.ts.map +1 -0
- package/dist/services/auth.js +54 -0
- package/dist/services/auth.js.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +2 -0
- package/dist/services/index.js.map +1 -0
- package/dist/tools/delegate.d.ts +35 -0
- package/dist/tools/delegate.d.ts.map +1 -0
- package/dist/tools/delegate.js +51 -0
- package/dist/tools/delegate.js.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types.d.ts +143 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/package.json +56 -0
- package/src/agents/builder.ts +300 -0
- package/src/agents/expert.ts +775 -0
- package/src/agents/index.ts +49 -0
- package/src/agents/lead.ts +466 -0
- package/src/agents/memory.ts +320 -0
- package/src/agents/reviewer.ts +323 -0
- package/src/agents/scout.ts +283 -0
- package/src/agents/types.ts +30 -0
- package/src/config/index.ts +1 -0
- package/src/config/loader.ts +127 -0
- package/src/index.ts +24 -0
- package/src/mcps/context7.ts +8 -0
- package/src/mcps/grep-app.ts +8 -0
- package/src/mcps/index.ts +34 -0
- package/src/plugin/hooks/keyword.ts +126 -0
- package/src/plugin/hooks/params.ts +188 -0
- package/src/plugin/hooks/session.ts +27 -0
- package/src/plugin/hooks/tools.ts +127 -0
- package/src/plugin/index.ts +1 -0
- package/src/plugin/plugin.ts +280 -0
- package/src/services/auth.ts +88 -0
- package/src/services/index.ts +1 -0
- package/src/tools/delegate.ts +62 -0
- package/src/tools/index.ts +1 -0
- package/src/types.ts +131 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { agents } from '../agents';
|
|
2
|
+
import { loadCoderConfig, getDefaultConfig, mergeConfig } from '../config';
|
|
3
|
+
import { createSessionHooks } from './hooks/session';
|
|
4
|
+
import { createToolHooks } from './hooks/tools';
|
|
5
|
+
import { createKeywordHooks } from './hooks/keyword';
|
|
6
|
+
import { createParamsHooks } from './hooks/params';
|
|
7
|
+
// Agent display names for @mentions
|
|
8
|
+
const AGENT_MENTIONS = {
|
|
9
|
+
lead: '@Agentuity Coder Lead',
|
|
10
|
+
scout: '@Agentuity Coder Scout',
|
|
11
|
+
builder: '@Agentuity Coder Builder',
|
|
12
|
+
reviewer: '@Agentuity Coder Reviewer',
|
|
13
|
+
memory: '@Agentuity Coder Memory',
|
|
14
|
+
expert: '@Agentuity Coder Expert',
|
|
15
|
+
};
|
|
16
|
+
export async function createCoderPlugin(ctx) {
|
|
17
|
+
ctx.client.app.log({
|
|
18
|
+
body: {
|
|
19
|
+
service: 'agentuity-coder',
|
|
20
|
+
level: 'info',
|
|
21
|
+
message: 'Agentuity Coder plugin initializing',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
const userConfig = await loadCoderConfig();
|
|
25
|
+
const coderConfig = mergeConfig(getDefaultConfig(), userConfig);
|
|
26
|
+
const sessionHooks = createSessionHooks(ctx, coderConfig);
|
|
27
|
+
const toolHooks = createToolHooks(ctx, coderConfig);
|
|
28
|
+
const keywordHooks = createKeywordHooks(ctx, coderConfig);
|
|
29
|
+
const paramsHooks = createParamsHooks(ctx, coderConfig);
|
|
30
|
+
const configHandler = createConfigHandler(coderConfig);
|
|
31
|
+
// Get the tool helper from Open Code context if available
|
|
32
|
+
const toolHelper = ctx.tool;
|
|
33
|
+
const tools = toolHelper ? createTools(toolHelper) : undefined;
|
|
34
|
+
// Show startup toast (fire and forget, don't block)
|
|
35
|
+
try {
|
|
36
|
+
ctx.client.tui?.showToast?.({ body: { message: '🚀 Agentuity Coder ready' } });
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// Toast may not be available
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
...(tools ? { tool: tools } : {}),
|
|
43
|
+
config: configHandler,
|
|
44
|
+
'chat.message': async (input, output) => {
|
|
45
|
+
await keywordHooks.onMessage(input, output);
|
|
46
|
+
await sessionHooks.onMessage(input, output);
|
|
47
|
+
},
|
|
48
|
+
'chat.params': paramsHooks.onParams,
|
|
49
|
+
'tool.execute.before': toolHooks.before,
|
|
50
|
+
'tool.execute.after': toolHooks.after,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function createConfigHandler(coderConfig) {
|
|
54
|
+
return async (config) => {
|
|
55
|
+
const agentConfigs = createAgentConfigs(coderConfig);
|
|
56
|
+
const commands = createCommands();
|
|
57
|
+
config.agent = {
|
|
58
|
+
...config.agent,
|
|
59
|
+
...agentConfigs,
|
|
60
|
+
};
|
|
61
|
+
config.command = {
|
|
62
|
+
...config.command,
|
|
63
|
+
...commands,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function createAgentConfigs(config) {
|
|
68
|
+
const result = {};
|
|
69
|
+
for (const agent of Object.values(agents)) {
|
|
70
|
+
const modelConfig = config.agents?.[agent.role];
|
|
71
|
+
// Convert tools.exclude to Open Code format (tool: false)
|
|
72
|
+
const tools = {};
|
|
73
|
+
if (agent.tools?.exclude) {
|
|
74
|
+
for (const tool of agent.tools.exclude) {
|
|
75
|
+
tools[tool] = false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
result[agent.displayName] = {
|
|
79
|
+
description: agent.description,
|
|
80
|
+
model: modelConfig?.model ?? agent.defaultModel,
|
|
81
|
+
prompt: agent.systemPrompt,
|
|
82
|
+
mode: agent.mode ?? 'subagent',
|
|
83
|
+
...(Object.keys(tools).length > 0 ? { tools } : {}),
|
|
84
|
+
// Pass through thinking/reasoning settings
|
|
85
|
+
...(agent.variant ? { variant: agent.variant } : {}),
|
|
86
|
+
...(agent.temperature !== undefined ? { temperature: agent.temperature } : {}),
|
|
87
|
+
...(agent.maxSteps !== undefined ? { maxSteps: agent.maxSteps } : {}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
function createCommands() {
|
|
93
|
+
return {
|
|
94
|
+
'agentuity-coder': {
|
|
95
|
+
name: 'agentuity-coder',
|
|
96
|
+
description: 'Run a task with the Agentuity Coder agent team (use @Agentuity Coder Lead, @Agentuity Coder Scout, etc.)',
|
|
97
|
+
template: `<coder-mode>
|
|
98
|
+
You are the Agentuity Coder Lead agent orchestrating the Agentuity Coder team.
|
|
99
|
+
|
|
100
|
+
## Your Team (use @mentions to invoke)
|
|
101
|
+
- **@Agentuity Coder Scout**: Explore codebase, find patterns, research docs (read-only)
|
|
102
|
+
- **@Agentuity Coder Builder**: Implement features, write code, run tests
|
|
103
|
+
- **@Agentuity Coder Reviewer**: Review changes, catch issues, apply fixes
|
|
104
|
+
- **@Agentuity Coder Memory**: Store context, remember decisions
|
|
105
|
+
- **@Agentuity Coder Expert**: Agentuity CLI and cloud services specialist
|
|
106
|
+
|
|
107
|
+
## Task
|
|
108
|
+
$ARGUMENTS
|
|
109
|
+
|
|
110
|
+
## Guidelines
|
|
111
|
+
1. Use @Agentuity Coder Scout first to understand context
|
|
112
|
+
2. Delegate implementation to @Agentuity Coder Builder
|
|
113
|
+
3. Have @Agentuity Coder Reviewer check the work
|
|
114
|
+
4. Use @Agentuity Coder Expert for Agentuity CLI questions
|
|
115
|
+
5. Only use cloud services when genuinely helpful
|
|
116
|
+
6. **When done, tell @Agentuity Coder Memory to memorialize the session**
|
|
117
|
+
</coder-mode>`,
|
|
118
|
+
agent: 'Agentuity Coder Lead',
|
|
119
|
+
argumentHint: '"task description"',
|
|
120
|
+
},
|
|
121
|
+
'agentuity-memory-save': {
|
|
122
|
+
name: 'agentuity-memory-save',
|
|
123
|
+
description: 'Save the current session to memory for future recall',
|
|
124
|
+
template: `Memorialize this session. Summarize what was accomplished in this conversation:
|
|
125
|
+
- Problem/task that was addressed
|
|
126
|
+
- Key decisions and their rationale
|
|
127
|
+
- Patterns and approaches used
|
|
128
|
+
- Solutions implemented
|
|
129
|
+
- Open questions or follow-ups
|
|
130
|
+
|
|
131
|
+
Save to vector storage using the coder-sessions namespace so the team can recall this work in future sessions.
|
|
132
|
+
|
|
133
|
+
$ARGUMENTS`,
|
|
134
|
+
agent: 'Agentuity Coder Memory',
|
|
135
|
+
argumentHint: '(optional additional context)',
|
|
136
|
+
},
|
|
137
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
138
|
+
// Agentuity Cloud Service Commands
|
|
139
|
+
// ─────────────────────────────────────────────────────────────────────
|
|
140
|
+
'agentuity-cloud': {
|
|
141
|
+
name: 'agentuity-cloud',
|
|
142
|
+
description: '☁️ Agentuity cloud services (KV, Storage, Vector, Sandbox, DB, SSH, etc.)',
|
|
143
|
+
template: `You are the Agentuity Coder Expert helping with Agentuity cloud services.
|
|
144
|
+
|
|
145
|
+
Use the \`agentuity\` CLI to execute the user's request.
|
|
146
|
+
|
|
147
|
+
## Available Services
|
|
148
|
+
| Service | CLI | Purpose |
|
|
149
|
+
|---------|-----|---------|
|
|
150
|
+
| KV | \`agentuity cloud kv\` | Key-value storage (namespaces, keys) |
|
|
151
|
+
| Storage | \`agentuity cloud storage\` | Object/file storage (buckets) |
|
|
152
|
+
| Vector | \`agentuity cloud vector\` | Embeddings & semantic search |
|
|
153
|
+
| Sandbox | \`agentuity cloud sandbox\` | Isolated execution environments |
|
|
154
|
+
| Database | \`agentuity cloud db\` | Postgres databases |
|
|
155
|
+
| SSH | \`agentuity cloud ssh\` | SSH into deployments/sandboxes |
|
|
156
|
+
| Deployments | \`agentuity cloud deployment\` | Manage deployments |
|
|
157
|
+
| Agents | \`agentuity cloud agent\` | Cloud agent management |
|
|
158
|
+
| Sessions | \`agentuity cloud session\` | Agent session data |
|
|
159
|
+
| Threads | \`agentuity cloud thread\` | Conversation threads |
|
|
160
|
+
|
|
161
|
+
## Guidelines
|
|
162
|
+
1. First check auth: \`agentuity auth whoami\`
|
|
163
|
+
2. Prefer \`--json\` for programmatic output
|
|
164
|
+
3. List/inspect before creating new resources
|
|
165
|
+
4. Explain what commands you're running
|
|
166
|
+
|
|
167
|
+
## User Request
|
|
168
|
+
$ARGUMENTS`,
|
|
169
|
+
agent: 'Agentuity Coder Expert',
|
|
170
|
+
subtask: true,
|
|
171
|
+
argumentHint: '"list kv namespaces" or "upload file.txt to storage"',
|
|
172
|
+
},
|
|
173
|
+
'agentuity-sandbox': {
|
|
174
|
+
name: 'agentuity-sandbox',
|
|
175
|
+
description: '🏖️ Agentuity sandboxes (isolated execution environments)',
|
|
176
|
+
template: `You are the Agentuity Coder Expert helping with Agentuity sandboxes.
|
|
177
|
+
|
|
178
|
+
Use the \`agentuity cloud sandbox\` CLI commands to help the user.
|
|
179
|
+
|
|
180
|
+
## Common Commands
|
|
181
|
+
\`\`\`bash
|
|
182
|
+
agentuity cloud sandbox runtime list --json # List available runtimes (bun:1, python:3.14, etc.)
|
|
183
|
+
agentuity cloud sandbox run [--memory 1Gi] [--cpu 1000m] \\
|
|
184
|
+
[--runtime <name>] [--runtimeId <id>] \\
|
|
185
|
+
[--name <name>] [--description <text>] \\
|
|
186
|
+
-- <command> # One-shot execution
|
|
187
|
+
agentuity cloud sandbox create --json [--memory 1Gi] [--cpu 1000m] \\
|
|
188
|
+
[--network] [--runtime <name>] [--runtimeId <id>] \\
|
|
189
|
+
[--name <name>] [--description <text>] # Create persistent sandbox
|
|
190
|
+
agentuity cloud sandbox list --json # List sandboxes (includes telemetry)
|
|
191
|
+
agentuity cloud sandbox exec <id> -- <command> # Run in existing sandbox
|
|
192
|
+
agentuity cloud sandbox files <id> [path] --json # List files
|
|
193
|
+
agentuity cloud sandbox cp ./local <id>:/home/agentuity # Copy files to sandbox
|
|
194
|
+
agentuity cloud sandbox delete <id> --json # Delete sandbox
|
|
195
|
+
agentuity cloud sandbox snapshot create <id> \\
|
|
196
|
+
[--name <name>] [--description <text>] [--tag <tag>] # Save sandbox state
|
|
197
|
+
\`\`\`
|
|
198
|
+
|
|
199
|
+
## Guidelines
|
|
200
|
+
1. First check auth: \`agentuity auth whoami\`
|
|
201
|
+
2. Use \`--json\` for programmatic output
|
|
202
|
+
3. Explain what commands you're running
|
|
203
|
+
4. Default working directory inside sandboxes: \`/home/agentuity\`
|
|
204
|
+
5. Use \`runtime list\` to find runtimes, then pass \`--runtime\` or \`--runtimeId\` on \`run\`/\`create\`
|
|
205
|
+
6. Use \`--name\` and \`--description\` for better tracking
|
|
206
|
+
7. Snapshot \`--tag\` defaults to \`latest\`, max 128 chars, must match \`^[a-zA-Z0-9][a-zA-Z0-9._-]*$\`
|
|
207
|
+
8. Telemetry fields from \`list\`/\`get\`: \`cpuTimeMs\`, \`memoryByteSec\`, \`networkEgressBytes\`, \`networkEnabled\`, \`mode\`
|
|
208
|
+
|
|
209
|
+
## User Request
|
|
210
|
+
$ARGUMENTS`,
|
|
211
|
+
agent: 'Agentuity Coder Expert',
|
|
212
|
+
subtask: true,
|
|
213
|
+
argumentHint: '"run bun test" or "create a sandbox with 2Gi memory"',
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function createTools(tool) {
|
|
218
|
+
const coderDelegate = tool((s) => ({
|
|
219
|
+
description: `Delegate a task to a specialized Agentuity Coder agent.
|
|
220
|
+
|
|
221
|
+
Use this to:
|
|
222
|
+
- Scout: Explore codebase, find patterns, research documentation
|
|
223
|
+
- Builder: Implement features, write code, run tests
|
|
224
|
+
- Reviewer: Review changes, catch issues, apply fixes
|
|
225
|
+
- Memory: Store context, remember decisions across sessions
|
|
226
|
+
- Expert: Get help with Agentuity CLI and cloud services`,
|
|
227
|
+
args: s.object({
|
|
228
|
+
agent: s
|
|
229
|
+
.enum(['scout', 'builder', 'reviewer', 'memory', 'expert'])
|
|
230
|
+
.describe('Which agent to delegate to'),
|
|
231
|
+
task: s.string().describe('Clear description of the task'),
|
|
232
|
+
context: s.string().optional().describe('Additional context from previous tasks'),
|
|
233
|
+
}),
|
|
234
|
+
execute: async (args) => {
|
|
235
|
+
const mention = AGENT_MENTIONS[args.agent];
|
|
236
|
+
let prompt = `${mention}\n\n## Task\n${args.task}`;
|
|
237
|
+
if (args.context) {
|
|
238
|
+
prompt = `${mention}\n\n## Context\n${args.context}\n\n## Task\n${args.task}`;
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
output: `To delegate this task, use the Task tool with this prompt:\n\n${prompt}\n\nThe ${args.agent} agent will handle this task.`,
|
|
242
|
+
};
|
|
243
|
+
},
|
|
244
|
+
}));
|
|
245
|
+
return {
|
|
246
|
+
coder_delegate: coderDelegate,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/plugin/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAInD,oCAAoC;AACpC,MAAM,cAAc,GAA8B;IACjD,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,wBAAwB;IAC/B,OAAO,EAAE,0BAA0B;IACnC,QAAQ,EAAE,2BAA2B;IACrC,MAAM,EAAE,yBAAyB;IACjC,MAAM,EAAE,yBAAyB;CACjC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,GAAkB;IACzD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QAClB,IAAI,EAAE;YACL,OAAO,EAAE,iBAAiB;YAC1B,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,qCAAqC;SAC9C;KACD,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,MAAM,eAAe,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,WAAW,CAAC,gBAAgB,EAAE,EAAE,UAAU,CAAC,CAAC;IAEhE,MAAM,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string;
|
|
4
|
+
userId?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function getCloudContext(): Promise<CloudContext>;
|
|
7
|
+
export declare function checkAuth(): Promise<{
|
|
8
|
+
ok: true;
|
|
9
|
+
context: CloudContext;
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
error: string;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/services/auth.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC5B,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAkCD,wBAAsB,eAAe,IAAI,OAAO,CAAC,YAAY,CAAC,CAuB7D;AAED,wBAAsB,SAAS,IAAI,OAAO,CACzC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAClE,CAkBA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { YAML } from 'bun';
|
|
4
|
+
const AGENTUITY_CONFIG_DIR = join(homedir(), '.config', 'agentuity');
|
|
5
|
+
const DEFAULT_PROFILE = 'production.yaml';
|
|
6
|
+
async function getProfilePath() {
|
|
7
|
+
const profileFile = Bun.file(join(AGENTUITY_CONFIG_DIR, 'profile'));
|
|
8
|
+
if (await profileFile.exists()) {
|
|
9
|
+
const savedPath = (await profileFile.text()).trim();
|
|
10
|
+
const savedFile = Bun.file(savedPath);
|
|
11
|
+
if (await savedFile.exists()) {
|
|
12
|
+
return savedPath;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return join(AGENTUITY_CONFIG_DIR, DEFAULT_PROFILE);
|
|
16
|
+
}
|
|
17
|
+
export async function getCloudContext() {
|
|
18
|
+
try {
|
|
19
|
+
const configPath = await getProfilePath();
|
|
20
|
+
const configFile = Bun.file(configPath);
|
|
21
|
+
if (!(await configFile.exists())) {
|
|
22
|
+
return { authenticated: false };
|
|
23
|
+
}
|
|
24
|
+
const content = await configFile.text();
|
|
25
|
+
const config = YAML.parse(content);
|
|
26
|
+
const hasAuth = Boolean(config.auth?.api_key);
|
|
27
|
+
const orgId = config.preferences?.orgId;
|
|
28
|
+
return {
|
|
29
|
+
authenticated: hasAuth,
|
|
30
|
+
orgId,
|
|
31
|
+
userId: config.auth?.user_id,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return { authenticated: false };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export async function checkAuth() {
|
|
39
|
+
const context = await getCloudContext();
|
|
40
|
+
if (!context.authenticated) {
|
|
41
|
+
return {
|
|
42
|
+
ok: false,
|
|
43
|
+
error: 'Not authenticated. Run `agentuity auth login` first.',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
if (!context.orgId) {
|
|
47
|
+
return {
|
|
48
|
+
ok: false,
|
|
49
|
+
error: 'No organization selected. Run `agentuity cloud org select` first.',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return { ok: true, context };
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/services/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAuB3B,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SA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;SAC5B,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IACjC,CAAC;AACF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS;IAG9B,MAAM,OAAO,GAAG,MAAM,eAAe,EAAE,CAAC;IAExC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC5B,OAAO;YACN,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,sDAAsD;SAC7D,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACpB,OAAO;YACN,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,mEAAmE;SAC1E,CAAC;IACH,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAqB,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const DelegateArgsSchema: z.ZodObject<{
|
|
3
|
+
agent: z.ZodEnum<{
|
|
4
|
+
scout: "scout";
|
|
5
|
+
builder: "builder";
|
|
6
|
+
reviewer: "reviewer";
|
|
7
|
+
memory: "memory";
|
|
8
|
+
expert: "expert";
|
|
9
|
+
}>;
|
|
10
|
+
task: z.ZodString;
|
|
11
|
+
context: z.ZodOptional<z.ZodString>;
|
|
12
|
+
waitForResult: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type DelegateArgs = z.infer<typeof DelegateArgsSchema>;
|
|
15
|
+
export declare const delegateTool: {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
args: z.ZodObject<{
|
|
19
|
+
agent: z.ZodEnum<{
|
|
20
|
+
scout: "scout";
|
|
21
|
+
builder: "builder";
|
|
22
|
+
reviewer: "reviewer";
|
|
23
|
+
memory: "memory";
|
|
24
|
+
expert: "expert";
|
|
25
|
+
}>;
|
|
26
|
+
task: z.ZodString;
|
|
27
|
+
context: z.ZodOptional<z.ZodString>;
|
|
28
|
+
waitForResult: z.ZodDefault<z.ZodBoolean>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
execute(args: DelegateArgs, _context: unknown): Promise<{
|
|
31
|
+
output: string;
|
|
32
|
+
}>;
|
|
33
|
+
};
|
|
34
|
+
export default delegateTool;
|
|
35
|
+
//# sourceMappingURL=delegate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;iBAU7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAY9D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;kBAeJ,YAAY,YAAY,OAAO,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAgBjF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// Schema for the delegate tool
|
|
3
|
+
export const DelegateArgsSchema = z.object({
|
|
4
|
+
agent: z
|
|
5
|
+
.enum(['scout', 'builder', 'reviewer', 'memory', 'expert'])
|
|
6
|
+
.describe('The agent to delegate to'),
|
|
7
|
+
task: z.string().describe('Clear description of the task to delegate'),
|
|
8
|
+
context: z.string().optional().describe('Additional context from previous tasks'),
|
|
9
|
+
waitForResult: z
|
|
10
|
+
.boolean()
|
|
11
|
+
.default(true)
|
|
12
|
+
.describe('Whether to wait for the result before continuing'),
|
|
13
|
+
});
|
|
14
|
+
// Agent display names for @mentions
|
|
15
|
+
const AGENT_MENTIONS = {
|
|
16
|
+
lead: '@Agentuity Coder Lead',
|
|
17
|
+
scout: '@Agentuity Coder Scout',
|
|
18
|
+
builder: '@Agentuity Coder Builder',
|
|
19
|
+
reviewer: '@Agentuity Coder Reviewer',
|
|
20
|
+
memory: '@Agentuity Coder Memory',
|
|
21
|
+
expert: '@Agentuity Coder Expert',
|
|
22
|
+
};
|
|
23
|
+
export const delegateTool = {
|
|
24
|
+
name: 'coder_delegate',
|
|
25
|
+
description: `Delegate a task to a specialized Agentuity Coder agent.
|
|
26
|
+
|
|
27
|
+
Use this to:
|
|
28
|
+
- Scout: Explore codebase, find patterns, research documentation
|
|
29
|
+
- Builder: Implement features, write code, run tests
|
|
30
|
+
- Reviewer: Review changes, catch issues, apply fixes
|
|
31
|
+
- Memory: Store context, remember decisions across sessions
|
|
32
|
+
- Expert: Get help with Agentuity CLI and cloud services
|
|
33
|
+
|
|
34
|
+
The task will be executed by the specified agent and the result returned.`,
|
|
35
|
+
args: DelegateArgsSchema,
|
|
36
|
+
async execute(args, _context) {
|
|
37
|
+
const mention = AGENT_MENTIONS[args.agent];
|
|
38
|
+
// Build the delegation prompt
|
|
39
|
+
let prompt = `${mention}\n\n## Task\n${args.task}`;
|
|
40
|
+
if (args.context) {
|
|
41
|
+
prompt = `${mention}\n\n## Context\n${args.context}\n\n## Task\n${args.task}`;
|
|
42
|
+
}
|
|
43
|
+
// In Open Code, this would trigger the Task tool with the appropriate agent
|
|
44
|
+
// For now, return the formatted prompt that Lead should use
|
|
45
|
+
return {
|
|
46
|
+
output: `To delegate this task, use the Task tool with this prompt:\n\n${prompt}\n\nThe ${args.agent} agent will handle this task.`,
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
export default delegateTool;
|
|
51
|
+
//# sourceMappingURL=delegate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegate.js","sourceRoot":"","sources":["../../src/tools/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,+BAA+B;AAC/B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;SAC1D,QAAQ,CAAC,0BAA0B,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IACtE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;IACjF,aAAa,EAAE,CAAC;SACd,OAAO,EAAE;SACT,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,kDAAkD,CAAC;CAC9D,CAAC,CAAC;AAIH,oCAAoC;AACpC,MAAM,cAAc,GAA8B;IACjD,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,wBAAwB;IAC/B,OAAO,EAAE,0BAA0B;IACnC,QAAQ,EAAE,2BAA2B;IACrC,MAAM,EAAE,yBAAyB;IACjC,MAAM,EAAE,yBAAyB;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE;;;;;;;;;0EAS4D;IAEzE,IAAI,EAAE,kBAAkB;IAExB,KAAK,CAAC,OAAO,CAAC,IAAkB,EAAE,QAAiB;QAClD,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,KAAkB,CAAC,CAAC;QAExD,8BAA8B;QAC9B,IAAI,MAAM,GAAG,GAAG,OAAO,gBAAgB,IAAI,CAAC,IAAI,EAAE,CAAC;QAEnD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,GAAG,GAAG,OAAO,mBAAmB,IAAI,CAAC,OAAO,gBAAgB,IAAI,CAAC,IAAI,EAAE,CAAC;QAC/E,CAAC;QAED,4EAA4E;QAC5E,4DAA4D;QAC5D,OAAO;YACN,MAAM,EAAE,iEAAiE,MAAM,WAAW,IAAI,CAAC,KAAK,+BAA+B;SACnI,CAAC;IACH,CAAC;CACD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAqB,MAAM,YAAY,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AgentRoleSchema: z.ZodEnum<{
|
|
3
|
+
lead: "lead";
|
|
4
|
+
scout: "scout";
|
|
5
|
+
builder: "builder";
|
|
6
|
+
reviewer: "reviewer";
|
|
7
|
+
memory: "memory";
|
|
8
|
+
expert: "expert";
|
|
9
|
+
}>;
|
|
10
|
+
export type AgentRole = z.infer<typeof AgentRoleSchema>;
|
|
11
|
+
export declare const TaskStatusSchema: z.ZodEnum<{
|
|
12
|
+
pending: "pending";
|
|
13
|
+
running: "running";
|
|
14
|
+
completed: "completed";
|
|
15
|
+
failed: "failed";
|
|
16
|
+
cancelled: "cancelled";
|
|
17
|
+
}>;
|
|
18
|
+
export type TaskStatus = z.infer<typeof TaskStatusSchema>;
|
|
19
|
+
export declare const OrchestrationPatternSchema: z.ZodEnum<{
|
|
20
|
+
single: "single";
|
|
21
|
+
fanout: "fanout";
|
|
22
|
+
pipeline: "pipeline";
|
|
23
|
+
}>;
|
|
24
|
+
export type OrchestrationPattern = z.infer<typeof OrchestrationPatternSchema>;
|
|
25
|
+
export interface AgentConfig {
|
|
26
|
+
/** Agent description - explains what it does and when to use it */
|
|
27
|
+
description: string;
|
|
28
|
+
/** Model ID in provider/model-id format */
|
|
29
|
+
model: string;
|
|
30
|
+
/** System prompt content (not a file path) */
|
|
31
|
+
prompt: string;
|
|
32
|
+
/** Agent mode: 'primary', 'subagent', or 'all' (default) */
|
|
33
|
+
mode?: 'primary' | 'subagent' | 'all';
|
|
34
|
+
/** Tool configuration */
|
|
35
|
+
tools?: Record<string, boolean>;
|
|
36
|
+
/** Model variant for thinking/reasoning (e.g., 'high', 'max' for Anthropic) */
|
|
37
|
+
variant?: string;
|
|
38
|
+
/** Temperature for response creativity (0.0-2.0) */
|
|
39
|
+
temperature?: number;
|
|
40
|
+
/** Maximum agentic steps before forcing text response */
|
|
41
|
+
maxSteps?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface AgentContext {
|
|
44
|
+
projectRoot: string;
|
|
45
|
+
orgId?: string;
|
|
46
|
+
sessionId?: string;
|
|
47
|
+
taskId?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface CoderTask {
|
|
50
|
+
id: string;
|
|
51
|
+
title: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
status: TaskStatus;
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
updatedAt: Date;
|
|
56
|
+
assignedTo?: AgentRole;
|
|
57
|
+
parentTaskId?: string;
|
|
58
|
+
result?: string;
|
|
59
|
+
error?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface CoderConfig {
|
|
62
|
+
org?: string;
|
|
63
|
+
agents?: Partial<Record<AgentRole, AgentModelConfig>>;
|
|
64
|
+
disabledMcps?: string[];
|
|
65
|
+
/** CLI command patterns to block for security (e.g., 'cloud secrets', 'auth token') */
|
|
66
|
+
blockedCommands?: string[];
|
|
67
|
+
}
|
|
68
|
+
export interface AgentModelConfig {
|
|
69
|
+
model?: string;
|
|
70
|
+
temperature?: number;
|
|
71
|
+
}
|
|
72
|
+
export declare const CoderConfigSchema: z.ZodObject<{
|
|
73
|
+
org: z.ZodOptional<z.ZodString>;
|
|
74
|
+
agents: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
75
|
+
lead: "lead";
|
|
76
|
+
scout: "scout";
|
|
77
|
+
builder: "builder";
|
|
78
|
+
reviewer: "reviewer";
|
|
79
|
+
memory: "memory";
|
|
80
|
+
expert: "expert";
|
|
81
|
+
}>, z.ZodObject<{
|
|
82
|
+
model: z.ZodOptional<z.ZodString>;
|
|
83
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
}, z.core.$strip>>>;
|
|
85
|
+
disabledMcps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
blockedCommands: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export interface McpConfig {
|
|
89
|
+
name: string;
|
|
90
|
+
type: 'remote';
|
|
91
|
+
url: string;
|
|
92
|
+
enabled: boolean;
|
|
93
|
+
headers?: Record<string, string>;
|
|
94
|
+
}
|
|
95
|
+
export interface PluginClient {
|
|
96
|
+
app: {
|
|
97
|
+
log: (options: {
|
|
98
|
+
body: {
|
|
99
|
+
service: string;
|
|
100
|
+
level: string;
|
|
101
|
+
message: string;
|
|
102
|
+
extra?: unknown;
|
|
103
|
+
};
|
|
104
|
+
}) => void;
|
|
105
|
+
};
|
|
106
|
+
tui?: {
|
|
107
|
+
showToast?: (options: {
|
|
108
|
+
body: {
|
|
109
|
+
message: string;
|
|
110
|
+
};
|
|
111
|
+
}) => void;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export interface PluginContext {
|
|
115
|
+
directory: string;
|
|
116
|
+
client: PluginClient;
|
|
117
|
+
}
|
|
118
|
+
export interface PluginHooks {
|
|
119
|
+
agents?: Record<string, AgentConfig>;
|
|
120
|
+
tool?: Record<string, unknown>;
|
|
121
|
+
config?: (config: Record<string, unknown>) => Promise<void>;
|
|
122
|
+
'chat.message'?: (input: unknown, output: unknown) => Promise<void>;
|
|
123
|
+
'chat.params'?: (input: unknown, output: unknown) => Promise<void>;
|
|
124
|
+
'tool.execute.before'?: (input: unknown, output: unknown) => Promise<void>;
|
|
125
|
+
'tool.execute.after'?: (input: unknown, output: unknown) => Promise<void>;
|
|
126
|
+
event?: (input: unknown) => Promise<void>;
|
|
127
|
+
}
|
|
128
|
+
export interface CommandDefinition {
|
|
129
|
+
name: string;
|
|
130
|
+
description?: string;
|
|
131
|
+
template: string;
|
|
132
|
+
agent?: string;
|
|
133
|
+
model?: string;
|
|
134
|
+
argumentHint?: string;
|
|
135
|
+
/** Force command to run as subagent for context isolation */
|
|
136
|
+
subtask?: boolean;
|
|
137
|
+
}
|
|
138
|
+
export interface ToolDefinition {
|
|
139
|
+
description: string;
|
|
140
|
+
args: unknown;
|
|
141
|
+
execute: (args: unknown, context: unknown) => Promise<unknown>;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;;;;;;EAAuE,CAAC;AACpG,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,gBAAgB;;;;;;EAAqE,CA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|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const AgentRoleSchema = z.enum(['lead', 'scout', 'builder', 'reviewer', 'memory', 'expert']);
|
|
3
|
+
export const TaskStatusSchema = z.enum(['pending', 'running', 'completed', 'failed', 'cancelled']);
|
|
4
|
+
export const OrchestrationPatternSchema = z.enum(['single', 'fanout', 'pipeline']);
|
|
5
|
+
export const CoderConfigSchema = z.object({
|
|
6
|
+
org: z.string().optional(),
|
|
7
|
+
agents: z
|
|
8
|
+
.record(AgentRoleSchema, z.object({
|
|
9
|
+
model: z.string().optional(),
|
|
10
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
11
|
+
}))
|
|
12
|
+
.optional(),
|
|
13
|
+
disabledMcps: z.array(z.string()).optional(),
|
|
14
|
+
blockedCommands: z.array(z.string()).optional(),
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGpG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAGnG,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;AAuDnF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;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