@agentuity/opencode 1.0.16 → 1.0.18
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/architect.d.ts +1 -1
- package/dist/agents/architect.d.ts.map +1 -1
- package/dist/agents/architect.js +30 -33
- package/dist/agents/architect.js.map +1 -1
- package/dist/agents/builder.d.ts +1 -1
- package/dist/agents/builder.d.ts.map +1 -1
- package/dist/agents/builder.js +53 -60
- package/dist/agents/builder.js.map +1 -1
- package/dist/agents/expert-backend.d.ts +1 -1
- package/dist/agents/expert-backend.d.ts.map +1 -1
- package/dist/agents/expert-backend.js +31 -39
- package/dist/agents/expert-backend.js.map +1 -1
- package/dist/agents/expert-frontend.d.ts +1 -1
- package/dist/agents/expert-frontend.d.ts.map +1 -1
- package/dist/agents/expert-frontend.js +17 -23
- package/dist/agents/expert-frontend.js.map +1 -1
- package/dist/agents/expert-ops.d.ts +1 -1
- package/dist/agents/expert-ops.d.ts.map +1 -1
- package/dist/agents/expert-ops.js +36 -50
- package/dist/agents/expert-ops.js.map +1 -1
- package/dist/agents/expert.d.ts +1 -1
- package/dist/agents/expert.d.ts.map +1 -1
- package/dist/agents/expert.js +32 -42
- package/dist/agents/expert.js.map +1 -1
- package/dist/agents/lead.d.ts +1 -1
- package/dist/agents/lead.d.ts.map +1 -1
- package/dist/agents/lead.js +182 -225
- 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 +62 -90
- package/dist/agents/memory.js.map +1 -1
- package/dist/agents/monitor.d.ts +1 -1
- package/dist/agents/monitor.d.ts.map +1 -1
- package/dist/agents/monitor.js +93 -42
- package/dist/agents/monitor.js.map +1 -1
- package/dist/agents/product.d.ts +1 -1
- package/dist/agents/product.d.ts.map +1 -1
- package/dist/agents/product.js +16 -22
- package/dist/agents/product.js.map +1 -1
- package/dist/agents/reviewer.d.ts +1 -1
- package/dist/agents/reviewer.d.ts.map +1 -1
- package/dist/agents/reviewer.js +14 -26
- package/dist/agents/reviewer.js.map +1 -1
- package/dist/agents/runner.d.ts +1 -1
- package/dist/agents/runner.d.ts.map +1 -1
- package/dist/agents/runner.js +52 -76
- package/dist/agents/runner.js.map +1 -1
- package/dist/agents/scout.d.ts +1 -1
- package/dist/agents/scout.d.ts.map +1 -1
- package/dist/agents/scout.js +41 -42
- package/dist/agents/scout.js.map +1 -1
- package/dist/agents/types.d.ts +8 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/background/manager.d.ts +17 -0
- package/dist/background/manager.d.ts.map +1 -1
- package/dist/background/manager.js +176 -19
- package/dist/background/manager.js.map +1 -1
- package/dist/background/types.d.ts +3 -0
- package/dist/background/types.d.ts.map +1 -1
- package/dist/config/loader.js +2 -2
- package/dist/plugin/hooks/cadence.d.ts.map +1 -1
- package/dist/plugin/hooks/cadence.js +5 -9
- package/dist/plugin/hooks/cadence.js.map +1 -1
- package/dist/plugin/hooks/completion.d.ts +14 -0
- package/dist/plugin/hooks/completion.d.ts.map +1 -0
- package/dist/plugin/hooks/completion.js +60 -0
- package/dist/plugin/hooks/completion.js.map +1 -0
- package/dist/plugin/hooks/params.d.ts +46 -1
- package/dist/plugin/hooks/params.d.ts.map +1 -1
- package/dist/plugin/hooks/params.js +77 -0
- package/dist/plugin/hooks/params.js.map +1 -1
- package/dist/plugin/hooks/session-memory.d.ts.map +1 -1
- package/dist/plugin/hooks/session-memory.js +4 -0
- package/dist/plugin/hooks/session-memory.js.map +1 -1
- package/dist/plugin/hooks/tools.d.ts.map +1 -1
- package/dist/plugin/hooks/tools.js +26 -1
- package/dist/plugin/hooks/tools.js.map +1 -1
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/plugin.js +9 -2
- package/dist/plugin/plugin.js.map +1 -1
- package/dist/tools/background.d.ts.map +1 -1
- package/dist/tools/background.js +15 -0
- package/dist/tools/background.js.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +3 -3
- package/src/agents/architect.ts +30 -33
- package/src/agents/builder.ts +53 -60
- package/src/agents/expert-backend.ts +31 -39
- package/src/agents/expert-frontend.ts +17 -23
- package/src/agents/expert-ops.ts +36 -50
- package/src/agents/expert.ts +32 -42
- package/src/agents/lead.ts +182 -225
- package/src/agents/memory.ts +62 -90
- package/src/agents/monitor.ts +93 -42
- package/src/agents/product.ts +16 -22
- package/src/agents/reviewer.ts +14 -26
- package/src/agents/runner.ts +52 -76
- package/src/agents/scout.ts +41 -42
- package/src/agents/types.ts +8 -0
- package/src/background/manager.ts +198 -19
- package/src/background/types.ts +3 -0
- package/src/config/loader.ts +2 -2
- package/src/plugin/hooks/cadence.ts +5 -9
- package/src/plugin/hooks/completion.ts +81 -0
- package/src/plugin/hooks/params.ts +97 -1
- package/src/plugin/hooks/session-memory.ts +4 -0
- package/src/plugin/hooks/tools.ts +32 -1
- package/src/plugin/plugin.ts +9 -2
- package/src/tools/background.ts +28 -0
- package/src/types.ts +10 -0
package/src/plugin/plugin.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { createKeywordHooks } from './hooks/keyword';
|
|
|
15
15
|
import { createParamsHooks } from './hooks/params';
|
|
16
16
|
import { createCadenceHooks } from './hooks/cadence';
|
|
17
17
|
import { createSessionMemoryHooks } from './hooks/session-memory';
|
|
18
|
+
import { createCompletionHooks } from './hooks/completion';
|
|
18
19
|
import type { AgentRole } from '../types';
|
|
19
20
|
import { BackgroundManager } from '../background';
|
|
20
21
|
import type { SessionTreeNode } from '../sqlite';
|
|
@@ -99,7 +100,8 @@ export async function createCoderPlugin(ctx: PluginInput): Promise<Hooks> {
|
|
|
99
100
|
const sessionHooks = createSessionHooks(ctx, coderConfig);
|
|
100
101
|
const toolHooks = createToolHooks(ctx, coderConfig);
|
|
101
102
|
const keywordHooks = createKeywordHooks(ctx, coderConfig);
|
|
102
|
-
const paramsHooks = createParamsHooks(ctx, coderConfig
|
|
103
|
+
const paramsHooks = createParamsHooks(ctx, coderConfig);
|
|
104
|
+
const completionHooks = createCompletionHooks(ctx, coderConfig);
|
|
103
105
|
const tmuxManager = coderConfig.tmux?.enabled
|
|
104
106
|
? new TmuxSessionManager(ctx, coderConfig.tmux, {
|
|
105
107
|
onLog: (message) =>
|
|
@@ -208,11 +210,15 @@ export async function createCoderPlugin(ctx: PluginInput): Promise<Hooks> {
|
|
|
208
210
|
...(tools ? { tool: tools } : {}),
|
|
209
211
|
config: configHandler,
|
|
210
212
|
'chat.message': async (input: unknown, output: unknown) => {
|
|
213
|
+
completionHooks.onMessage(input);
|
|
211
214
|
await keywordHooks.onMessage(input, output);
|
|
212
215
|
await sessionHooks.onMessage(input, output);
|
|
213
216
|
await cadenceHooks.onMessage(input, output);
|
|
214
217
|
},
|
|
215
|
-
'chat.params':
|
|
218
|
+
'chat.params': async (input: unknown, output: unknown) => {
|
|
219
|
+
completionHooks.onParams(input);
|
|
220
|
+
await paramsHooks.onParams(input, output);
|
|
221
|
+
},
|
|
216
222
|
'tool.execute.before': toolHooks.before,
|
|
217
223
|
'tool.execute.after': toolHooks.after,
|
|
218
224
|
'shell.env': async (_input: unknown, output: unknown) => {
|
|
@@ -397,6 +403,7 @@ function createAgentConfigs(
|
|
|
397
403
|
...(agent.reasoningEffort ? { reasoningEffort: agent.reasoningEffort } : {}),
|
|
398
404
|
...(agent.thinking ? { thinking: agent.thinking } : {}),
|
|
399
405
|
...(agent.hidden ? { hidden: agent.hidden } : {}),
|
|
406
|
+
...(agent.fallbackModels?.length ? { fallbackModels: agent.fallbackModels } : {}),
|
|
400
407
|
};
|
|
401
408
|
}
|
|
402
409
|
|
package/src/tools/background.ts
CHANGED
|
@@ -105,6 +105,12 @@ export function createBackgroundTools(manager: BackgroundManager): {
|
|
|
105
105
|
status: string;
|
|
106
106
|
result?: string;
|
|
107
107
|
error?: string;
|
|
108
|
+
progress?: {
|
|
109
|
+
toolCalls: number;
|
|
110
|
+
lastTool?: string;
|
|
111
|
+
lastToolSec: number;
|
|
112
|
+
activeTools: number;
|
|
113
|
+
};
|
|
108
114
|
}> {
|
|
109
115
|
const task = manager.getTask(args.task_id);
|
|
110
116
|
if (!task) {
|
|
@@ -114,12 +120,34 @@ export function createBackgroundTools(manager: BackgroundManager): {
|
|
|
114
120
|
error: 'Task not found.',
|
|
115
121
|
};
|
|
116
122
|
}
|
|
123
|
+
|
|
124
|
+
// Include compact progress snapshot only for active tasks.
|
|
125
|
+
// Three numbers + optional tool name — minimal context cost.
|
|
126
|
+
// lastToolSec: seconds since the last tool call event was received.
|
|
127
|
+
// 0 = active right now; >300 with activeTools=0 = genuinely stuck.
|
|
128
|
+
let progress:
|
|
129
|
+
| { toolCalls: number; lastTool?: string; lastToolSec: number; activeTools: number }
|
|
130
|
+
| undefined;
|
|
131
|
+
|
|
132
|
+
if ((task.status === 'running' || task.status === 'pending') && task.progress) {
|
|
133
|
+
const lastToolSec = Math.floor(
|
|
134
|
+
(Date.now() - task.progress.lastUpdate.getTime()) / 1000
|
|
135
|
+
);
|
|
136
|
+
progress = {
|
|
137
|
+
toolCalls: task.progress.toolCalls,
|
|
138
|
+
lastTool: task.progress.lastTool,
|
|
139
|
+
lastToolSec,
|
|
140
|
+
activeTools: task.progress.activeToolCallsInFlight,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
117
144
|
return {
|
|
118
145
|
taskId: task.id,
|
|
119
146
|
sessionId: task.sessionId,
|
|
120
147
|
status: task.status,
|
|
121
148
|
result: task.result,
|
|
122
149
|
error: task.error,
|
|
150
|
+
progress,
|
|
123
151
|
};
|
|
124
152
|
},
|
|
125
153
|
};
|
package/src/types.ts
CHANGED
|
@@ -89,6 +89,16 @@ export interface AgentConfig {
|
|
|
89
89
|
reasoningEffort?: ReasoningEffort;
|
|
90
90
|
/** Extended thinking configuration for Anthropic models */
|
|
91
91
|
thinking?: ThinkingConfig;
|
|
92
|
+
/**
|
|
93
|
+
* Ordered list of fallback model IDs to try when the primary model fails
|
|
94
|
+
* with a retryable error (429 rate limit, 500/502/503 server error).
|
|
95
|
+
* Models are tried in order until one succeeds.
|
|
96
|
+
*
|
|
97
|
+
* Example: ['anthropic/claude-sonnet-4-20250514', 'openai/gpt-4.1']
|
|
98
|
+
*/
|
|
99
|
+
fallbackModels?: string[];
|
|
100
|
+
/** Hidden from @ autocomplete */
|
|
101
|
+
hidden?: boolean;
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
export interface AgentContext {
|