oh-my-opencode-slim 2.0.1 → 2.0.3
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.ja-JP.md +31 -1
- package/README.ko-KR.md +31 -1
- package/README.md +41 -2
- package/README.zh-CN.md +31 -1
- package/dist/agents/orchestrator.d.ts +0 -2
- package/dist/cli/companion.d.ts +2 -2
- package/dist/cli/index.js +326 -89
- package/dist/companion/manager.d.ts +1 -0
- package/dist/companion/updater.d.ts +36 -0
- package/dist/config/agent-mcps.d.ts +0 -4
- package/dist/config/constants.d.ts +1 -7
- package/dist/config/council-schema.d.ts +0 -15
- package/dist/config/index.d.ts +1 -1
- package/dist/config/runtime-preset.d.ts +0 -1
- package/dist/config/schema.d.ts +78 -68
- package/dist/config/utils.d.ts +1 -0
- package/dist/hooks/auto-update-checker/skill-sync.d.ts +9 -0
- package/dist/hooks/auto-update-checker/types.d.ts +2 -0
- package/dist/hooks/filter-available-skills/index.d.ts +1 -13
- package/dist/hooks/foreground-fallback/index.d.ts +1 -1
- package/dist/hooks/image-hook.d.ts +1 -13
- package/dist/hooks/index.d.ts +3 -2
- package/dist/hooks/phase-reminder/index.d.ts +10 -16
- package/dist/hooks/reflect/index.d.ts +13 -0
- package/dist/hooks/task-session-manager/index.d.ts +2 -16
- package/dist/hooks/types.d.ts +23 -0
- package/dist/index.js +1610 -585
- package/dist/tools/acp-run.d.ts +3 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/smartfetch/secondary-model.d.ts +7 -0
- package/dist/tui.js +114 -76
- package/dist/utils/agent-variant.d.ts +0 -40
- package/dist/utils/compat.d.ts +0 -1
- package/dist/utils/guards.d.ts +4 -0
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/logger.d.ts +1 -1
- package/dist/utils/task.d.ts +0 -2
- package/oh-my-opencode-slim.schema.json +103 -249
- package/package.json +2 -1
- package/src/companion/companion-manifest.json +12 -0
- package/src/skills/codemap.md +4 -1
- package/src/skills/reflect/SKILL.md +193 -0
- package/src/skills/worktrees/SKILL.md +164 -0
- package/dist/config/fallback-chains.d.ts +0 -1
- package/dist/hooks/apply-patch/patch.d.ts +0 -2
- package/dist/hooks/delegate-task-retry/guidance.d.ts +0 -2
- package/dist/hooks/delegate-task-retry/index.d.ts +0 -4
- package/dist/hooks/json-error-recovery/index.d.ts +0 -1
- package/dist/utils/env.d.ts +0 -1
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
export declare const AGENT_ALIASES: Record<string, string>;
|
|
2
2
|
export declare const SUBAGENT_NAMES: readonly ["explorer", "librarian", "oracle", "designer", "fixer", "observer", "council", "councillor"];
|
|
3
|
-
export declare const ORCHESTRATOR_NAME: "orchestrator";
|
|
4
3
|
export declare const ALL_AGENT_NAMES: readonly ["orchestrator", "explorer", "librarian", "oracle", "designer", "fixer", "observer", "council", "councillor"];
|
|
5
4
|
export type AgentName = (typeof ALL_AGENT_NAMES)[number];
|
|
6
|
-
export declare const ORCHESTRATABLE_AGENTS: readonly ["explorer", "librarian", "oracle", "designer", "fixer", "observer", "council"];
|
|
7
5
|
/** Agents that cannot be disabled even if listed in disabled_agents config. */
|
|
8
6
|
export declare const PROTECTED_AGENTS: Set<string>;
|
|
9
7
|
/**
|
|
10
8
|
* Get the list of orchestratable agents, excluding any disabled agents.
|
|
11
9
|
* This is used for delegation validation at runtime.
|
|
12
10
|
*/
|
|
13
|
-
export declare function getOrchestratableAgents(disabledAgents?: Set<string>): string[];
|
|
14
|
-
export declare const SUBAGENT_DELEGATION_RULES: Record<AgentName, readonly string[]>;
|
|
15
11
|
export declare const DEFAULT_MODELS: Record<AgentName, string | undefined>;
|
|
16
12
|
export declare const POLL_INTERVAL_MS = 500;
|
|
17
|
-
export declare const POLL_INTERVAL_SLOW_MS = 1000;
|
|
18
13
|
export declare const POLL_INTERVAL_BACKGROUND_MS = 2000;
|
|
19
|
-
export declare const DEFAULT_TIMEOUT_MS: number;
|
|
20
14
|
export declare const MAX_POLL_TIME_MS: number;
|
|
21
|
-
export declare const FALLBACK_FAILOVER_TIMEOUT_MS = 15000;
|
|
22
15
|
export declare const DEFAULT_MAX_SUBAGENT_DEPTH = 3;
|
|
23
16
|
export declare const PHASE_REMINDER_TEXT = "!IMPORTANT! Scheduler workflow: plan lanes/dependencies \u2192 dispatch background specialists \u2192 track task IDs \u2192 wait for hook-driven completion \u2192 reconcile terminal results \u2192 verify. Do not poll running jobs, consume running-job output, or advance dependent work. !END!";
|
|
17
|
+
export declare const PHASE_REMINDER = "<internal_reminder>!IMPORTANT! Scheduler workflow: plan lanes/dependencies \u2192 dispatch background specialists \u2192 track task IDs \u2192 wait for hook-driven completion \u2192 reconcile terminal results \u2192 verify. Do not poll running jobs, consume running-job output, or advance dependent work. !END!</internal_reminder>";
|
|
24
18
|
export declare const WRITABLE_FILE_OPERATIONS_RULES = "**File Operations Rules**:\n- Prefer dedicated file tools for normal code work: glob/grep/ast_grep_search for discovery, read for file contents, and edit/write/apply_patch for targeted source changes.\n- Use bash for execution and automation: git, package managers, tests, builds, scripts, diagnostics, and shell-native filesystem operations.\n- Shell is acceptable for bulk or mechanical filesystem changes when it is clearer or safer than many individual edits (for example: truncate generated logs, remove build artifacts, batch rename/move files), especially when the user explicitly asks for that shell operation.\n- Before destructive or broad shell operations, verify the target set and quote paths. Prefer a dry-run/listing first when practical.\n- Do not use cat/head/tail/sed/awk only to read code into context; use read/grep unless a shell pipeline is genuinely the better diagnostic.";
|
|
25
19
|
export declare const READONLY_FILE_OPERATIONS_RULES = "**File Operations Rules**:\n- READ-ONLY: inspect and report; do not modify files.\n- Prefer dedicated file tools for codebase inspection: glob/grep/ast_grep_search for discovery and read for file contents.\n- Bash is allowed for non-mutating diagnostics and shell-native inspection when it is the clearest tool, but not for modifying files.\n- Do not use cat/head/tail/sed/awk only to read code into context; use read/grep unless a shell pipeline is genuinely the better diagnostic.";
|
|
26
20
|
export declare const NO_SHELL_READONLY_FILE_OPERATIONS_RULES = "**File Operations Rules**:\n- READ-ONLY: inspect and report; do not modify files.\n- Use glob/grep/ast_grep_search for discovery and read for file contents.\n- Do not use bash or shell commands.";
|
|
@@ -69,8 +69,6 @@ export declare const CouncilConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
69
69
|
}>>;
|
|
70
70
|
councillor_retries: z.ZodDefault<z.ZodNumber>;
|
|
71
71
|
master: z.ZodOptional<z.ZodUnknown>;
|
|
72
|
-
master_timeout: z.ZodOptional<z.ZodUnknown>;
|
|
73
|
-
master_fallback: z.ZodOptional<z.ZodUnknown>;
|
|
74
72
|
}, z.core.$strip>, z.ZodTransform<{
|
|
75
73
|
presets: Record<string, Record<string, {
|
|
76
74
|
model: string;
|
|
@@ -94,22 +92,9 @@ export declare const CouncilConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
94
92
|
councillor_execution_mode: "parallel" | "serial";
|
|
95
93
|
councillor_retries: number;
|
|
96
94
|
master?: unknown;
|
|
97
|
-
master_timeout?: unknown;
|
|
98
|
-
master_fallback?: unknown;
|
|
99
95
|
}>>;
|
|
100
96
|
export type CouncilConfig = z.infer<typeof CouncilConfigSchema>;
|
|
101
97
|
export type CouncillorExecutionMode = z.infer<typeof CouncillorExecutionModeSchema>;
|
|
102
|
-
/**
|
|
103
|
-
* A sensible default council configuration that users can copy into their
|
|
104
|
-
* opencode.jsonc. Provides a 3-councillor preset using common models.
|
|
105
|
-
*
|
|
106
|
-
* Users should replace models with ones they have access to.
|
|
107
|
-
*
|
|
108
|
-
* ```jsonc
|
|
109
|
-
* "council": DEFAULT_COUNCIL_CONFIG
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
export declare const DEFAULT_COUNCIL_CONFIG: z.input<typeof CouncilConfigSchema>;
|
|
113
98
|
/**
|
|
114
99
|
* Result of a council session.
|
|
115
100
|
*/
|
package/dist/config/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export * from './constants';
|
|
|
2
2
|
export * from './council-schema';
|
|
3
3
|
export { deepMerge, loadAgentPrompt, loadPluginConfig, } from './loader';
|
|
4
4
|
export * from './schema';
|
|
5
|
-
export { getAgentOverride, getCustomAgentNames } from './utils';
|
|
5
|
+
export { getAcpAgentNames, getAgentOverride, getCustomAgentNames, } from './utils';
|
|
@@ -9,4 +9,3 @@ export declare function setActiveRuntimePreset(name: string | null): void;
|
|
|
9
9
|
export declare function getActiveRuntimePreset(): string | null;
|
|
10
10
|
export declare function getPreviousRuntimePreset(): string | null;
|
|
11
11
|
export declare function setActiveRuntimePresetWithPrevious(name: string | null): void;
|
|
12
|
-
export declare function rollbackRuntimePreset(previous: string | null): void;
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
declare const FALLBACK_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "fixer"];
|
|
3
2
|
declare const MANUAL_AGENT_NAMES: readonly ["orchestrator", "oracle", "designer", "explorer", "librarian", "fixer"];
|
|
4
3
|
export declare const ProviderModelIdSchema: z.ZodString;
|
|
5
4
|
export declare const ManualAgentPlanSchema: z.ZodObject<{
|
|
@@ -49,7 +48,6 @@ export declare const ManualPlanSchema: z.ZodObject<{
|
|
|
49
48
|
export type ManualAgentName = (typeof MANUAL_AGENT_NAMES)[number];
|
|
50
49
|
export type ManualAgentPlan = z.infer<typeof ManualAgentPlanSchema>;
|
|
51
50
|
export type ManualPlan = z.infer<typeof ManualPlanSchema>;
|
|
52
|
-
export type FallbackAgentName = (typeof FALLBACK_AGENT_NAMES)[number];
|
|
53
51
|
export declare const AgentOverrideConfigSchema: z.ZodObject<{
|
|
54
52
|
model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
55
53
|
id: z.ZodString;
|
|
@@ -177,19 +175,12 @@ export declare const FailoverConfigSchema: z.ZodObject<{
|
|
|
177
175
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
178
176
|
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
179
177
|
retryDelayMs: z.ZodDefault<z.ZodNumber>;
|
|
180
|
-
chains: z.ZodDefault<z.ZodObject<{
|
|
181
|
-
orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
182
|
-
oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
183
|
-
designer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
184
|
-
explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
185
|
-
librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
186
|
-
fixer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
187
|
-
}, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
|
|
188
178
|
retry_on_empty: z.ZodDefault<z.ZodBoolean>;
|
|
189
|
-
}, z.core.$
|
|
179
|
+
}, z.core.$strict>;
|
|
190
180
|
export type FailoverConfig = z.infer<typeof FailoverConfigSchema>;
|
|
191
181
|
export declare const CompanionConfigSchema: z.ZodObject<{
|
|
192
182
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
binaryPath: z.ZodOptional<z.ZodString>;
|
|
193
184
|
position: z.ZodOptional<z.ZodEnum<{
|
|
194
185
|
"bottom-right": "bottom-right";
|
|
195
186
|
"bottom-left": "bottom-left";
|
|
@@ -201,56 +192,61 @@ export declare const CompanionConfigSchema: z.ZodObject<{
|
|
|
201
192
|
medium: "medium";
|
|
202
193
|
large: "large";
|
|
203
194
|
}>>;
|
|
195
|
+
gifPack: z.ZodOptional<z.ZodEnum<{
|
|
196
|
+
default: "default";
|
|
197
|
+
}>>;
|
|
198
|
+
loopStyle: z.ZodOptional<z.ZodEnum<{
|
|
199
|
+
classic: "classic";
|
|
200
|
+
smooth: "smooth";
|
|
201
|
+
}>>;
|
|
202
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
debug: z.ZodOptional<z.ZodBoolean>;
|
|
204
204
|
}, z.core.$strip>;
|
|
205
205
|
export type CompanionConfig = z.infer<typeof CompanionConfigSchema>;
|
|
206
|
+
export declare const AcpAgentPermissionModeSchema: z.ZodEnum<{
|
|
207
|
+
allow: "allow";
|
|
208
|
+
ask: "ask";
|
|
209
|
+
reject: "reject";
|
|
210
|
+
}>;
|
|
211
|
+
export declare const AcpAgentConfigSchema: z.ZodObject<{
|
|
212
|
+
command: z.ZodString;
|
|
213
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
214
|
+
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
215
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
216
|
+
description: z.ZodOptional<z.ZodString>;
|
|
217
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
218
|
+
orchestratorPrompt: z.ZodOptional<z.ZodString>;
|
|
219
|
+
wrapperModel: z.ZodOptional<z.ZodString>;
|
|
220
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
221
|
+
permissionMode: z.ZodDefault<z.ZodEnum<{
|
|
222
|
+
allow: "allow";
|
|
223
|
+
ask: "ask";
|
|
224
|
+
reject: "reject";
|
|
225
|
+
}>>;
|
|
226
|
+
}, z.core.$strict>;
|
|
227
|
+
export declare const AcpAgentsConfigSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
228
|
+
command: z.ZodString;
|
|
229
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
230
|
+
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
231
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
232
|
+
description: z.ZodOptional<z.ZodString>;
|
|
233
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
234
|
+
orchestratorPrompt: z.ZodOptional<z.ZodString>;
|
|
235
|
+
wrapperModel: z.ZodOptional<z.ZodString>;
|
|
236
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
237
|
+
permissionMode: z.ZodDefault<z.ZodEnum<{
|
|
238
|
+
allow: "allow";
|
|
239
|
+
ask: "ask";
|
|
240
|
+
reject: "reject";
|
|
241
|
+
}>>;
|
|
242
|
+
}, z.core.$strict>>;
|
|
243
|
+
export type AcpAgentPermissionMode = z.infer<typeof AcpAgentPermissionModeSchema>;
|
|
244
|
+
export type AcpAgentConfig = z.infer<typeof AcpAgentConfigSchema>;
|
|
245
|
+
export type AcpAgentsConfig = z.infer<typeof AcpAgentsConfigSchema>;
|
|
206
246
|
export declare const PluginConfigSchema: z.ZodObject<{
|
|
207
247
|
preset: z.ZodOptional<z.ZodString>;
|
|
208
248
|
setDefaultAgent: z.ZodOptional<z.ZodBoolean>;
|
|
209
|
-
scoringEngineVersion: z.ZodOptional<z.ZodEnum<{
|
|
210
|
-
v1: "v1";
|
|
211
|
-
"v2-shadow": "v2-shadow";
|
|
212
|
-
v2: "v2";
|
|
213
|
-
}>>;
|
|
214
|
-
balanceProviderUsage: z.ZodOptional<z.ZodBoolean>;
|
|
215
249
|
autoUpdate: z.ZodOptional<z.ZodBoolean>;
|
|
216
|
-
manualPlan: z.ZodOptional<z.ZodObject<{
|
|
217
|
-
orchestrator: z.ZodObject<{
|
|
218
|
-
primary: z.ZodString;
|
|
219
|
-
fallback1: z.ZodString;
|
|
220
|
-
fallback2: z.ZodString;
|
|
221
|
-
fallback3: z.ZodString;
|
|
222
|
-
}, z.core.$strip>;
|
|
223
|
-
oracle: z.ZodObject<{
|
|
224
|
-
primary: z.ZodString;
|
|
225
|
-
fallback1: z.ZodString;
|
|
226
|
-
fallback2: z.ZodString;
|
|
227
|
-
fallback3: z.ZodString;
|
|
228
|
-
}, z.core.$strip>;
|
|
229
|
-
designer: z.ZodObject<{
|
|
230
|
-
primary: z.ZodString;
|
|
231
|
-
fallback1: z.ZodString;
|
|
232
|
-
fallback2: z.ZodString;
|
|
233
|
-
fallback3: z.ZodString;
|
|
234
|
-
}, z.core.$strip>;
|
|
235
|
-
explorer: z.ZodObject<{
|
|
236
|
-
primary: z.ZodString;
|
|
237
|
-
fallback1: z.ZodString;
|
|
238
|
-
fallback2: z.ZodString;
|
|
239
|
-
fallback3: z.ZodString;
|
|
240
|
-
}, z.core.$strip>;
|
|
241
|
-
librarian: z.ZodObject<{
|
|
242
|
-
primary: z.ZodString;
|
|
243
|
-
fallback1: z.ZodString;
|
|
244
|
-
fallback2: z.ZodString;
|
|
245
|
-
fallback3: z.ZodString;
|
|
246
|
-
}, z.core.$strip>;
|
|
247
|
-
fixer: z.ZodObject<{
|
|
248
|
-
primary: z.ZodString;
|
|
249
|
-
fallback1: z.ZodString;
|
|
250
|
-
fallback2: z.ZodString;
|
|
251
|
-
fallback3: z.ZodString;
|
|
252
|
-
}, z.core.$strip>;
|
|
253
|
-
}, z.core.$strict>>;
|
|
254
250
|
presets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
255
251
|
model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
256
252
|
id: z.ZodString;
|
|
@@ -334,16 +330,8 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
334
330
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
335
331
|
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
336
332
|
retryDelayMs: z.ZodDefault<z.ZodNumber>;
|
|
337
|
-
chains: z.ZodDefault<z.ZodObject<{
|
|
338
|
-
orchestrator: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
339
|
-
oracle: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
340
|
-
designer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
341
|
-
explorer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
342
|
-
librarian: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
343
|
-
fixer: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
344
|
-
}, z.core.$catchall<z.ZodArray<z.ZodString>>>>;
|
|
345
333
|
retry_on_empty: z.ZodDefault<z.ZodBoolean>;
|
|
346
|
-
}, z.core.$
|
|
334
|
+
}, z.core.$strict>>;
|
|
347
335
|
council: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
348
336
|
presets: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>, z.ZodTransform<Record<string, {
|
|
349
337
|
model: string;
|
|
@@ -358,8 +346,6 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
358
346
|
}>>;
|
|
359
347
|
councillor_retries: z.ZodDefault<z.ZodNumber>;
|
|
360
348
|
master: z.ZodOptional<z.ZodUnknown>;
|
|
361
|
-
master_timeout: z.ZodOptional<z.ZodUnknown>;
|
|
362
|
-
master_fallback: z.ZodOptional<z.ZodUnknown>;
|
|
363
349
|
}, z.core.$strip>, z.ZodTransform<{
|
|
364
350
|
presets: Record<string, Record<string, {
|
|
365
351
|
model: string;
|
|
@@ -383,11 +369,10 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
383
369
|
councillor_execution_mode: "parallel" | "serial";
|
|
384
370
|
councillor_retries: number;
|
|
385
371
|
master?: unknown;
|
|
386
|
-
master_timeout?: unknown;
|
|
387
|
-
master_fallback?: unknown;
|
|
388
372
|
}>>>;
|
|
389
373
|
companion: z.ZodOptional<z.ZodObject<{
|
|
390
374
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
375
|
+
binaryPath: z.ZodOptional<z.ZodString>;
|
|
391
376
|
position: z.ZodOptional<z.ZodEnum<{
|
|
392
377
|
"bottom-right": "bottom-right";
|
|
393
378
|
"bottom-left": "bottom-left";
|
|
@@ -399,7 +384,32 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
399
384
|
medium: "medium";
|
|
400
385
|
large: "large";
|
|
401
386
|
}>>;
|
|
387
|
+
gifPack: z.ZodOptional<z.ZodEnum<{
|
|
388
|
+
default: "default";
|
|
389
|
+
}>>;
|
|
390
|
+
loopStyle: z.ZodOptional<z.ZodEnum<{
|
|
391
|
+
classic: "classic";
|
|
392
|
+
smooth: "smooth";
|
|
393
|
+
}>>;
|
|
394
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
395
|
+
debug: z.ZodOptional<z.ZodBoolean>;
|
|
402
396
|
}, z.core.$strip>>;
|
|
397
|
+
acpAgents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
398
|
+
command: z.ZodString;
|
|
399
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
400
|
+
env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
401
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
402
|
+
description: z.ZodOptional<z.ZodString>;
|
|
403
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
404
|
+
orchestratorPrompt: z.ZodOptional<z.ZodString>;
|
|
405
|
+
wrapperModel: z.ZodOptional<z.ZodString>;
|
|
406
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
407
|
+
permissionMode: z.ZodDefault<z.ZodEnum<{
|
|
408
|
+
allow: "allow";
|
|
409
|
+
ask: "ask";
|
|
410
|
+
reject: "reject";
|
|
411
|
+
}>>;
|
|
412
|
+
}, z.core.$strict>>>;
|
|
403
413
|
}, z.core.$strip>;
|
|
404
414
|
export type PluginConfig = z.infer<typeof PluginConfigSchema>;
|
|
405
415
|
export type { AgentName } from './constants';
|
package/dist/config/utils.d.ts
CHANGED
|
@@ -15,3 +15,4 @@ export declare function getAgentOverride(config: PluginConfig | undefined, name:
|
|
|
15
15
|
* legacy aliases.
|
|
16
16
|
*/
|
|
17
17
|
export declare function getCustomAgentNames(config: PluginConfig | undefined): string[];
|
|
18
|
+
export declare function getAcpAgentNames(config: PluginConfig | undefined): string[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface SkillSyncResult {
|
|
2
|
+
installed: string[];
|
|
3
|
+
skippedExisting: string[];
|
|
4
|
+
failed: string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Synchronizes bundled skills from the newly installed package root to OpenCode config skills directory.
|
|
8
|
+
*/
|
|
9
|
+
export declare function syncBundledSkillsFromPackage(packageRoot: string): SkillSyncResult;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CompanionConfig } from '../../config/schema';
|
|
1
2
|
export interface NpmDistTags {
|
|
2
3
|
latest: string;
|
|
3
4
|
[key: string]: string;
|
|
@@ -23,6 +24,7 @@ export interface PackageJson {
|
|
|
23
24
|
}
|
|
24
25
|
export interface AutoUpdateCheckerOptions {
|
|
25
26
|
autoUpdate?: boolean;
|
|
27
|
+
companion?: CompanionConfig;
|
|
26
28
|
}
|
|
27
29
|
export interface PluginEntryInfo {
|
|
28
30
|
entry: string;
|
|
@@ -5,19 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { PluginInput } from '@opencode-ai/plugin';
|
|
7
7
|
import { type PluginConfig } from '../../config';
|
|
8
|
-
|
|
9
|
-
role: string;
|
|
10
|
-
agent?: string;
|
|
11
|
-
}
|
|
12
|
-
interface MessagePart {
|
|
13
|
-
type: string;
|
|
14
|
-
text?: string;
|
|
15
|
-
[key: string]: unknown;
|
|
16
|
-
}
|
|
17
|
-
interface MessageWithParts {
|
|
18
|
-
info: MessageInfo;
|
|
19
|
-
parts: MessagePart[];
|
|
20
|
-
}
|
|
8
|
+
import type { MessageWithParts } from '../types';
|
|
21
9
|
type SkillRule = 'allow' | 'ask' | 'deny';
|
|
22
10
|
declare function filterAvailableSkillsText(text: string, permissionRules: Record<string, SkillRule>): string;
|
|
23
11
|
/**
|
|
@@ -20,7 +20,7 @@ export declare function isRateLimitError(error: unknown): boolean;
|
|
|
20
20
|
* Manages runtime model fallback for foreground agent sessions.
|
|
21
21
|
*
|
|
22
22
|
* Constructed at plugin init with the ordered fallback chains for each agent
|
|
23
|
-
* (built from _modelArray entries
|
|
23
|
+
* (built from _modelArray entries in agents.<name>.model).
|
|
24
24
|
*/
|
|
25
25
|
export declare class ForegroundFallbackManager {
|
|
26
26
|
private readonly client;
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
info: {
|
|
3
|
-
role: string;
|
|
4
|
-
agent?: string;
|
|
5
|
-
sessionID?: string;
|
|
6
|
-
};
|
|
7
|
-
parts: Array<{
|
|
8
|
-
type: string;
|
|
9
|
-
text?: string;
|
|
10
|
-
[key: string]: unknown;
|
|
11
|
-
}>;
|
|
12
|
-
}
|
|
1
|
+
import type { MessageWithParts } from './types';
|
|
13
2
|
export declare function processImageAttachments(args: {
|
|
14
3
|
messages: MessageWithParts[];
|
|
15
4
|
workDir: string;
|
|
16
5
|
disabledAgents: Set<string>;
|
|
17
6
|
log: (msg: string) => void;
|
|
18
7
|
}): void;
|
|
19
|
-
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -3,11 +3,12 @@ export type { AutoUpdateCheckerOptions } from './auto-update-checker';
|
|
|
3
3
|
export { createAutoUpdateCheckerHook } from './auto-update-checker';
|
|
4
4
|
export { createChatHeadersHook } from './chat-headers';
|
|
5
5
|
export { createDeepworkCommandHook } from './deepwork';
|
|
6
|
-
export { createDelegateTaskRetryHook } from './delegate-task-retry';
|
|
6
|
+
export { createDelegateTaskRetryHook } from './delegate-task-retry/hook';
|
|
7
7
|
export { createFilterAvailableSkillsHook } from './filter-available-skills';
|
|
8
8
|
export { ForegroundFallbackManager, isRateLimitError, } from './foreground-fallback';
|
|
9
9
|
export { processImageAttachments } from './image-hook';
|
|
10
|
-
export { createJsonErrorRecoveryHook } from './json-error-recovery';
|
|
10
|
+
export { createJsonErrorRecoveryHook } from './json-error-recovery/hook';
|
|
11
11
|
export { createPhaseReminderHook } from './phase-reminder';
|
|
12
12
|
export { createPostFileToolNudgeHook } from './post-file-tool-nudge';
|
|
13
|
+
export { createReflectCommandHook } from './reflect';
|
|
13
14
|
export { createTaskSessionManagerHook } from './task-session-manager';
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
interface MessageWithParts {
|
|
13
|
-
info: MessageInfo;
|
|
14
|
-
parts: MessagePart[];
|
|
15
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Phase reminder to append after each latest user message.
|
|
3
|
+
*
|
|
4
|
+
* Keeping this at the tail preserves immediate workflow guidance without
|
|
5
|
+
* mutating the cached system prompt or prepending request-local content ahead
|
|
6
|
+
* of the user's actual turn.
|
|
7
|
+
*/
|
|
8
|
+
import { PHASE_REMINDER } from '../../config/constants';
|
|
9
|
+
import type { MessageWithParts } from '../types';
|
|
10
|
+
export { PHASE_REMINDER };
|
|
16
11
|
/**
|
|
17
12
|
* Creates the experimental.chat.messages.transform hook for phase reminder injection.
|
|
18
13
|
* This hook runs right before sending to API, so it doesn't affect UI display.
|
|
@@ -23,4 +18,3 @@ export declare function createPhaseReminderHook(): {
|
|
|
23
18
|
messages: MessageWithParts[];
|
|
24
19
|
}) => Promise<void>;
|
|
25
20
|
};
|
|
26
|
-
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function createReflectCommandHook(): {
|
|
2
|
+
registerCommand: (config: Record<string, unknown>) => void;
|
|
3
|
+
handleCommandExecuteBefore: (input: {
|
|
4
|
+
command: string;
|
|
5
|
+
sessionID: string;
|
|
6
|
+
arguments: string;
|
|
7
|
+
}, output: {
|
|
8
|
+
parts: Array<{
|
|
9
|
+
type: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
}>;
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
};
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
2
|
import { BackgroundJobBoard } from '../../utils';
|
|
3
|
-
|
|
4
|
-
type: string;
|
|
5
|
-
text?: string;
|
|
6
|
-
[key: string]: unknown;
|
|
7
|
-
}
|
|
8
|
-
interface ChatMessage {
|
|
9
|
-
info: {
|
|
10
|
-
role: string;
|
|
11
|
-
agent?: string;
|
|
12
|
-
sessionID?: string;
|
|
13
|
-
id?: string;
|
|
14
|
-
};
|
|
15
|
-
parts: ChatMessagePart[];
|
|
16
|
-
}
|
|
3
|
+
import type { MessageWithParts } from '../types';
|
|
17
4
|
export declare function createTaskSessionManagerHook(_ctx: PluginInput, options: {
|
|
18
5
|
maxSessionsPerAgent: number;
|
|
19
6
|
readContextMinLines?: number;
|
|
@@ -37,7 +24,7 @@ export declare function createTaskSessionManagerHook(_ctx: PluginInput, options:
|
|
|
37
24
|
metadata?: unknown;
|
|
38
25
|
}) => Promise<void>;
|
|
39
26
|
'experimental.chat.messages.transform': (_input: Record<string, never>, output: {
|
|
40
|
-
messages:
|
|
27
|
+
messages: MessageWithParts[];
|
|
41
28
|
}) => Promise<void>;
|
|
42
29
|
event: (input: {
|
|
43
30
|
event: {
|
|
@@ -58,4 +45,3 @@ export declare function createTaskSessionManagerHook(_ctx: PluginInput, options:
|
|
|
58
45
|
};
|
|
59
46
|
}) => Promise<void>;
|
|
60
47
|
};
|
|
61
|
-
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared message type shapes for the OpenCode plugin API's `messages` array.
|
|
3
|
+
*
|
|
4
|
+
* These types describe the structure of chat messages passed through
|
|
5
|
+
* `experimental.chat.messages.transform` and related hooks. All fields
|
|
6
|
+
* are unioned across the files that previously defined them privately —
|
|
7
|
+
* optional extras are harmless under structural typing.
|
|
8
|
+
*/
|
|
9
|
+
export type MessageInfo = {
|
|
10
|
+
role: string;
|
|
11
|
+
agent?: string;
|
|
12
|
+
sessionID?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
};
|
|
15
|
+
export type MessagePart = {
|
|
16
|
+
type: string;
|
|
17
|
+
text?: string;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
export type MessageWithParts = {
|
|
21
|
+
info: MessageInfo;
|
|
22
|
+
parts: MessagePart[];
|
|
23
|
+
};
|