@agentuity/opencode 0.1.31 â 0.1.32
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/README.md +12 -9
- package/dist/agents/lead.d.ts +1 -1
- package/dist/agents/lead.d.ts.map +1 -1
- package/dist/agents/lead.js +132 -5
- package/dist/agents/lead.js.map +1 -1
- package/dist/agents/memory.d.ts +1 -1
- package/dist/agents/memory.d.ts.map +1 -1
- package/dist/agents/memory.js +67 -0
- package/dist/agents/memory.js.map +1 -1
- package/dist/plugin/hooks/cadence.d.ts +7 -6
- package/dist/plugin/hooks/cadence.d.ts.map +1 -1
- package/dist/plugin/hooks/cadence.js +207 -16
- package/dist/plugin/hooks/cadence.js.map +1 -1
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/plugin.js +1 -115
- package/dist/plugin/plugin.js.map +1 -1
- package/dist/types.d.ts +23 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/agents/lead.ts +132 -5
- package/src/agents/memory.ts +67 -0
- package/src/plugin/hooks/cadence.ts +245 -17
- package/src/plugin/plugin.ts +1 -118
- package/src/types.ts +23 -0
package/src/plugin/plugin.ts
CHANGED
|
@@ -65,6 +65,7 @@ export async function createCoderPlugin(ctx: PluginContext): Promise<PluginHooks
|
|
|
65
65
|
'tool.execute.before': toolHooks.before,
|
|
66
66
|
'tool.execute.after': toolHooks.after,
|
|
67
67
|
event: cadenceHooks.onEvent,
|
|
68
|
+
'experimental.session.compacting': cadenceHooks.onCompacting,
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
71
|
|
|
@@ -301,124 +302,6 @@ $ARGUMENTS
|
|
|
301
302
|
argumentHint: 'build the new auth feature with tests',
|
|
302
303
|
},
|
|
303
304
|
|
|
304
|
-
'agentuity-cadence-status': {
|
|
305
|
-
name: 'agentuity-cadence-status',
|
|
306
|
-
description: 'đ Check status of active Cadence loops',
|
|
307
|
-
template: `Check the status of active Cadence loops.
|
|
308
|
-
|
|
309
|
-
## Instructions
|
|
310
|
-
|
|
311
|
-
1. Search for active loops:
|
|
312
|
-
\`\`\`bash
|
|
313
|
-
agentuity cloud kv search agentuity-opencode-tasks "loop:" --json
|
|
314
|
-
\`\`\`
|
|
315
|
-
|
|
316
|
-
2. For each loop found, get its state:
|
|
317
|
-
\`\`\`bash
|
|
318
|
-
agentuity cloud kv get agentuity-opencode-tasks "loop:{loopId}:state" --json
|
|
319
|
-
\`\`\`
|
|
320
|
-
|
|
321
|
-
3. Report status in a clear format:
|
|
322
|
-
- Loop ID
|
|
323
|
-
- Status (running/paused/completed/failed/cancelled)
|
|
324
|
-
- Current iteration / max iterations
|
|
325
|
-
- Original task (brief)
|
|
326
|
-
- Last update time
|
|
327
|
-
|
|
328
|
-
$ARGUMENTS`,
|
|
329
|
-
agent: 'Agentuity Coder Lead',
|
|
330
|
-
argumentHint: '(optional: specific loop ID)',
|
|
331
|
-
},
|
|
332
|
-
|
|
333
|
-
'agentuity-cadence-pause': {
|
|
334
|
-
name: 'agentuity-cadence-pause',
|
|
335
|
-
description: 'â¸ī¸ Pause an active Cadence loop',
|
|
336
|
-
template: `Pause the active Cadence loop.
|
|
337
|
-
|
|
338
|
-
## Instructions
|
|
339
|
-
|
|
340
|
-
1. Find the active loop (or use the provided loop ID):
|
|
341
|
-
\`\`\`bash
|
|
342
|
-
agentuity cloud kv search agentuity-opencode-tasks "loop:" --json
|
|
343
|
-
\`\`\`
|
|
344
|
-
|
|
345
|
-
2. Update the loop status to paused:
|
|
346
|
-
\`\`\`bash
|
|
347
|
-
agentuity cloud kv get agentuity-opencode-tasks "loop:{loopId}:state" --json
|
|
348
|
-
# Then update with status: "paused"
|
|
349
|
-
agentuity cloud kv set agentuity-opencode-tasks "loop:{loopId}:state" '{...updated state with status: "paused"...}'
|
|
350
|
-
\`\`\`
|
|
351
|
-
|
|
352
|
-
3. Confirm the pause to the user.
|
|
353
|
-
|
|
354
|
-
$ARGUMENTS`,
|
|
355
|
-
agent: 'Agentuity Coder Lead',
|
|
356
|
-
argumentHint: '(optional: specific loop ID)',
|
|
357
|
-
},
|
|
358
|
-
|
|
359
|
-
'agentuity-cadence-resume': {
|
|
360
|
-
name: 'agentuity-cadence-resume',
|
|
361
|
-
description: 'âļī¸ Resume a paused Cadence loop',
|
|
362
|
-
template: `[CADENCE MODE]
|
|
363
|
-
|
|
364
|
-
Resume a paused Cadence loop.
|
|
365
|
-
|
|
366
|
-
## Instructions
|
|
367
|
-
|
|
368
|
-
1. Find the paused loop (or use the provided loop ID):
|
|
369
|
-
\`\`\`bash
|
|
370
|
-
agentuity cloud kv search agentuity-opencode-tasks "loop:" --json
|
|
371
|
-
\`\`\`
|
|
372
|
-
|
|
373
|
-
2. Get the loop state and last checkpoint:
|
|
374
|
-
\`\`\`bash
|
|
375
|
-
agentuity cloud kv get agentuity-opencode-tasks "loop:{loopId}:state" --json
|
|
376
|
-
\`\`\`
|
|
377
|
-
|
|
378
|
-
3. Ask Memory for context:
|
|
379
|
-
- Get the last few checkpoints
|
|
380
|
-
- Get any handoff packet if available
|
|
381
|
-
- Get relevant corrections
|
|
382
|
-
|
|
383
|
-
4. Update status to running and continue from where you left off:
|
|
384
|
-
\`\`\`bash
|
|
385
|
-
agentuity cloud kv set agentuity-opencode-tasks "loop:{loopId}:state" '{...updated state with status: "running"...}'
|
|
386
|
-
\`\`\`
|
|
387
|
-
|
|
388
|
-
5. Continue the Cadence loop following the iteration workflow.
|
|
389
|
-
|
|
390
|
-
$ARGUMENTS`,
|
|
391
|
-
agent: 'Agentuity Coder Lead',
|
|
392
|
-
argumentHint: '(optional: specific loop ID)',
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
'agentuity-cadence-stop': {
|
|
396
|
-
name: 'agentuity-cadence-stop',
|
|
397
|
-
description: 'âšī¸ Stop and cancel a Cadence loop',
|
|
398
|
-
template: `Stop and cancel the Cadence loop.
|
|
399
|
-
|
|
400
|
-
## Instructions
|
|
401
|
-
|
|
402
|
-
1. Find the active loop (or use the provided loop ID):
|
|
403
|
-
\`\`\`bash
|
|
404
|
-
agentuity cloud kv search agentuity-opencode-tasks "loop:" --json
|
|
405
|
-
\`\`\`
|
|
406
|
-
|
|
407
|
-
2. Update the loop status to cancelled:
|
|
408
|
-
\`\`\`bash
|
|
409
|
-
agentuity cloud kv get agentuity-opencode-tasks "loop:{loopId}:state" --json
|
|
410
|
-
# Then update with status: "cancelled"
|
|
411
|
-
agentuity cloud kv set agentuity-opencode-tasks "loop:{loopId}:state" '{...updated state with status: "cancelled"...}'
|
|
412
|
-
\`\`\`
|
|
413
|
-
|
|
414
|
-
3. Ask Memory to store a final checkpoint noting the cancellation reason.
|
|
415
|
-
|
|
416
|
-
4. Confirm the stop to the user.
|
|
417
|
-
|
|
418
|
-
$ARGUMENTS`,
|
|
419
|
-
agent: 'Agentuity Coder Lead',
|
|
420
|
-
argumentHint: '(optional: specific loop ID)',
|
|
421
|
-
},
|
|
422
305
|
};
|
|
423
306
|
}
|
|
424
307
|
|
package/src/types.ts
CHANGED
|
@@ -123,6 +123,16 @@ export interface PluginClient {
|
|
|
123
123
|
tui?: {
|
|
124
124
|
showToast?: (options: { body: { message: string } }) => void;
|
|
125
125
|
};
|
|
126
|
+
session?: {
|
|
127
|
+
prompt?: (options: {
|
|
128
|
+
path: { id: string };
|
|
129
|
+
body: {
|
|
130
|
+
parts: Array<{ type: 'text'; text: string }>;
|
|
131
|
+
agent?: string;
|
|
132
|
+
};
|
|
133
|
+
noReply?: boolean;
|
|
134
|
+
}) => Promise<unknown>;
|
|
135
|
+
};
|
|
126
136
|
}
|
|
127
137
|
|
|
128
138
|
export interface PluginContext {
|
|
@@ -130,6 +140,15 @@ export interface PluginContext {
|
|
|
130
140
|
client: PluginClient;
|
|
131
141
|
}
|
|
132
142
|
|
|
143
|
+
export interface CompactingInput {
|
|
144
|
+
sessionID: string;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface CompactingOutput {
|
|
148
|
+
context: string[];
|
|
149
|
+
prompt?: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
133
152
|
export interface PluginHooks {
|
|
134
153
|
agents?: Record<string, AgentConfig>;
|
|
135
154
|
tool?: Record<string, unknown>; // Open Code tool format (created via tool() helper)
|
|
@@ -139,6 +158,10 @@ export interface PluginHooks {
|
|
|
139
158
|
'tool.execute.before'?: (input: unknown, output: unknown) => Promise<void>;
|
|
140
159
|
'tool.execute.after'?: (input: unknown, output: unknown) => Promise<void>;
|
|
141
160
|
event?: (input: unknown) => Promise<void>;
|
|
161
|
+
'experimental.session.compacting'?: (
|
|
162
|
+
input: CompactingInput,
|
|
163
|
+
output: CompactingOutput
|
|
164
|
+
) => Promise<void>;
|
|
142
165
|
}
|
|
143
166
|
|
|
144
167
|
export interface CommandDefinition {
|