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
package/dist/tools/index.d.ts
CHANGED
|
@@ -18,6 +18,13 @@ export declare function decideSecondaryModelUse(fetchResult: CachedFetch, prompt
|
|
|
18
18
|
use: boolean;
|
|
19
19
|
reason: "prompt_present";
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Exposed for tests so they can avoid real wall-clock sleeps.
|
|
23
|
+
* Not part of the public API.
|
|
24
|
+
*/
|
|
25
|
+
export declare const _testConfig: {
|
|
26
|
+
deleteRetryDelayMs: number;
|
|
27
|
+
};
|
|
21
28
|
export declare function runSecondaryModelWithFallback(client: OpenCodeClient, directory: string, models: SecondaryModel[], prompt: string, content: string): Promise<{
|
|
22
29
|
model: SecondaryModel;
|
|
23
30
|
text: string;
|
package/dist/tui.js
CHANGED
|
@@ -30,8 +30,72 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
30
30
|
return to;
|
|
31
31
|
};
|
|
32
32
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
+
var __returnValue = (v) => v;
|
|
34
|
+
function __exportSetter(name, newValue) {
|
|
35
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
+
}
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, {
|
|
40
|
+
get: all[name],
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true,
|
|
43
|
+
set: __exportSetter.bind(all, name)
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
33
47
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
34
48
|
|
|
49
|
+
// src/utils/compat.ts
|
|
50
|
+
import { spawn as nodeSpawn } from "node:child_process";
|
|
51
|
+
import { writeFile as fsWriteFile } from "node:fs/promises";
|
|
52
|
+
function collectStream(stream) {
|
|
53
|
+
if (!stream)
|
|
54
|
+
return () => Promise.resolve("");
|
|
55
|
+
const chunks = [];
|
|
56
|
+
stream.on("data", (chunk) => chunks.push(chunk));
|
|
57
|
+
return () => new Promise((resolve, reject) => {
|
|
58
|
+
if (!stream.readable) {
|
|
59
|
+
resolve(Buffer.concat(chunks).toString("utf-8"));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
stream.on("end", () => resolve(Buffer.concat(chunks).toString("utf-8")));
|
|
63
|
+
stream.on("error", reject);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function crossSpawn(command, options) {
|
|
67
|
+
const [cmd, ...args] = command;
|
|
68
|
+
const proc = nodeSpawn(cmd, args, {
|
|
69
|
+
stdio: [
|
|
70
|
+
options?.stdin ?? "ignore",
|
|
71
|
+
options?.stdout ?? "pipe",
|
|
72
|
+
options?.stderr ?? "pipe"
|
|
73
|
+
],
|
|
74
|
+
cwd: options?.cwd,
|
|
75
|
+
env: options?.env
|
|
76
|
+
});
|
|
77
|
+
const stdoutCollector = collectStream(proc.stdout);
|
|
78
|
+
const stderrCollector = collectStream(proc.stderr);
|
|
79
|
+
const exited = new Promise((resolve, reject) => {
|
|
80
|
+
proc.on("error", reject);
|
|
81
|
+
proc.on("close", (code) => resolve(code ?? 1));
|
|
82
|
+
});
|
|
83
|
+
return {
|
|
84
|
+
proc,
|
|
85
|
+
stdout: stdoutCollector,
|
|
86
|
+
stderr: stderrCollector,
|
|
87
|
+
exited,
|
|
88
|
+
kill: (signal) => proc.kill(signal),
|
|
89
|
+
get exitCode() {
|
|
90
|
+
return proc.exitCode;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
async function crossWrite(path, data) {
|
|
95
|
+
await fsWriteFile(path, Buffer.from(data));
|
|
96
|
+
}
|
|
97
|
+
var init_compat = () => {};
|
|
98
|
+
|
|
35
99
|
// src/tui.ts
|
|
36
100
|
import { createElement, insert, setProp } from "@opentui/solid";
|
|
37
101
|
|
|
@@ -50,8 +114,7 @@ var SUBAGENT_NAMES = [
|
|
|
50
114
|
"council",
|
|
51
115
|
"councillor"
|
|
52
116
|
];
|
|
53
|
-
var
|
|
54
|
-
var ALL_AGENT_NAMES = [ORCHESTRATOR_NAME, ...SUBAGENT_NAMES];
|
|
117
|
+
var ALL_AGENT_NAMES = ["orchestrator", ...SUBAGENT_NAMES];
|
|
55
118
|
var PROTECTED_AGENTS = new Set(["orchestrator", "councillor"]);
|
|
56
119
|
var DEFAULT_MODELS = {
|
|
57
120
|
orchestrator: undefined,
|
|
@@ -65,10 +128,10 @@ var DEFAULT_MODELS = {
|
|
|
65
128
|
councillor: "openai/gpt-5.4-mini"
|
|
66
129
|
};
|
|
67
130
|
var POLL_INTERVAL_BACKGROUND_MS = 2000;
|
|
68
|
-
var DEFAULT_TIMEOUT_MS = 2 * 60 * 1000;
|
|
69
131
|
var MAX_POLL_TIME_MS = 5 * 60 * 1000;
|
|
70
132
|
var DEFAULT_MAX_SUBAGENT_DEPTH = 3;
|
|
71
133
|
var PHASE_REMINDER_TEXT = `!IMPORTANT! Scheduler workflow: plan lanes/dependencies → dispatch background specialists → track task IDs → wait for hook-driven completion → reconcile terminal results → verify. Do not poll running jobs, consume running-job output, or advance dependent work. !END!`;
|
|
134
|
+
var PHASE_REMINDER = `<internal_reminder>${PHASE_REMINDER_TEXT}</internal_reminder>`;
|
|
72
135
|
var WRITABLE_FILE_OPERATIONS_RULES = `**File Operations Rules**:
|
|
73
136
|
- 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.
|
|
74
137
|
- Use bash for execution and automation: git, package managers, tests, builds, scripts, diagnostics, and shell-native filesystem operations.
|
|
@@ -92,55 +155,8 @@ var DEFAULT_DISABLED_AGENTS = ["observer"];
|
|
|
92
155
|
import * as fs from "node:fs";
|
|
93
156
|
import * as path from "node:path";
|
|
94
157
|
|
|
95
|
-
// src/
|
|
96
|
-
|
|
97
|
-
import { writeFile as fsWriteFile } from "node:fs/promises";
|
|
98
|
-
var isBun = typeof globalThis.Bun !== "undefined";
|
|
99
|
-
function collectStream(stream) {
|
|
100
|
-
if (!stream)
|
|
101
|
-
return () => Promise.resolve("");
|
|
102
|
-
const chunks = [];
|
|
103
|
-
stream.on("data", (chunk) => chunks.push(chunk));
|
|
104
|
-
return () => new Promise((resolve, reject) => {
|
|
105
|
-
if (!stream.readable) {
|
|
106
|
-
resolve(Buffer.concat(chunks).toString("utf-8"));
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
stream.on("end", () => resolve(Buffer.concat(chunks).toString("utf-8")));
|
|
110
|
-
stream.on("error", reject);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
function crossSpawn(command, options) {
|
|
114
|
-
const [cmd, ...args] = command;
|
|
115
|
-
const proc = nodeSpawn(cmd, args, {
|
|
116
|
-
stdio: [
|
|
117
|
-
options?.stdin ?? "ignore",
|
|
118
|
-
options?.stdout ?? "pipe",
|
|
119
|
-
options?.stderr ?? "pipe"
|
|
120
|
-
],
|
|
121
|
-
cwd: options?.cwd,
|
|
122
|
-
env: options?.env
|
|
123
|
-
});
|
|
124
|
-
const stdoutCollector = collectStream(proc.stdout);
|
|
125
|
-
const stderrCollector = collectStream(proc.stderr);
|
|
126
|
-
const exited = new Promise((resolve, reject) => {
|
|
127
|
-
proc.on("error", reject);
|
|
128
|
-
proc.on("close", (code) => resolve(code ?? 1));
|
|
129
|
-
});
|
|
130
|
-
return {
|
|
131
|
-
proc,
|
|
132
|
-
stdout: stdoutCollector,
|
|
133
|
-
stderr: stderrCollector,
|
|
134
|
-
exited,
|
|
135
|
-
kill: (signal) => proc.kill(signal),
|
|
136
|
-
get exitCode() {
|
|
137
|
-
return proc.exitCode;
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
async function crossWrite(path, data) {
|
|
142
|
-
await fsWriteFile(path, Buffer.from(data));
|
|
143
|
-
}
|
|
158
|
+
// src/cli/config-io.ts
|
|
159
|
+
init_compat();
|
|
144
160
|
|
|
145
161
|
// src/cli/paths.ts
|
|
146
162
|
import { homedir } from "node:os";
|
|
@@ -216,17 +232,11 @@ var CouncilConfigSchema = z.object({
|
|
|
216
232
|
default_preset: z.string().default("default"),
|
|
217
233
|
councillor_execution_mode: CouncillorExecutionModeSchema.describe('Execution mode for councillors. "serial" runs them one at a time (required for single-model systems). "parallel" runs them concurrently (default, faster for multi-model systems).'),
|
|
218
234
|
councillor_retries: z.number().int().min(0).max(5).default(3).describe("Number of retry attempts for councillors that return empty responses " + "(e.g. due to provider rate limiting). Default: 3 retries."),
|
|
219
|
-
master: z.unknown().optional().describe("DEPRECATED — ignored. Council agent synthesizes directly.")
|
|
220
|
-
master_timeout: z.unknown().optional().describe('DEPRECATED — ignored. Use "timeout" instead.'),
|
|
221
|
-
master_fallback: z.unknown().optional().describe("DEPRECATED — ignored. No separate master session.")
|
|
235
|
+
master: z.unknown().optional().describe("DEPRECATED — ignored. Council agent synthesizes directly.")
|
|
222
236
|
}).transform((data) => {
|
|
223
237
|
const deprecated = [];
|
|
224
238
|
if (data.master !== undefined)
|
|
225
239
|
deprecated.push("master");
|
|
226
|
-
if (data.master_timeout !== undefined)
|
|
227
|
-
deprecated.push("master_timeout");
|
|
228
|
-
if (data.master_fallback !== undefined)
|
|
229
|
-
deprecated.push("master_fallback");
|
|
230
240
|
const legacyMasterModel = typeof data.master === "object" && data.master !== null && "model" in data.master && typeof data.master.model === "string" ? data.master.model : undefined;
|
|
231
241
|
return {
|
|
232
242
|
presets: data.presets,
|
|
@@ -268,15 +278,6 @@ var ManualPlanSchema = z2.object({
|
|
|
268
278
|
librarian: ManualAgentPlanSchema,
|
|
269
279
|
fixer: ManualAgentPlanSchema
|
|
270
280
|
}).strict();
|
|
271
|
-
var AgentModelChainSchema = z2.array(z2.string()).min(1);
|
|
272
|
-
var FallbackChainsSchema = z2.object({
|
|
273
|
-
orchestrator: AgentModelChainSchema.optional(),
|
|
274
|
-
oracle: AgentModelChainSchema.optional(),
|
|
275
|
-
designer: AgentModelChainSchema.optional(),
|
|
276
|
-
explorer: AgentModelChainSchema.optional(),
|
|
277
|
-
librarian: AgentModelChainSchema.optional(),
|
|
278
|
-
fixer: AgentModelChainSchema.optional()
|
|
279
|
-
}).catchall(AgentModelChainSchema);
|
|
280
281
|
var AgentOverrideConfigSchema = z2.object({
|
|
281
282
|
model: z2.union([
|
|
282
283
|
z2.string(),
|
|
@@ -339,14 +340,32 @@ var FailoverConfigSchema = z2.object({
|
|
|
339
340
|
enabled: z2.boolean().default(true),
|
|
340
341
|
timeoutMs: z2.number().min(0).default(15000),
|
|
341
342
|
retryDelayMs: z2.number().min(0).default(500),
|
|
342
|
-
chains: FallbackChainsSchema.default({}),
|
|
343
343
|
retry_on_empty: z2.boolean().default(true).describe("When true (default), empty provider responses are treated as failures, " + "triggering fallback/retry. Set to false to treat them as successes.")
|
|
344
|
-
});
|
|
344
|
+
}).strict();
|
|
345
345
|
var CompanionConfigSchema = z2.object({
|
|
346
346
|
enabled: z2.boolean().optional(),
|
|
347
|
+
binaryPath: z2.string().min(1).optional().describe("Path to a custom companion binary to launch."),
|
|
347
348
|
position: z2.enum(["bottom-right", "bottom-left", "top-right", "top-left"]).optional(),
|
|
348
|
-
size: z2.enum(["small", "medium", "large"]).optional()
|
|
349
|
+
size: z2.enum(["small", "medium", "large"]).optional(),
|
|
350
|
+
gifPack: z2.enum(["default"]).optional().describe("Bundled companion animation pack to use."),
|
|
351
|
+
loopStyle: z2.enum(["classic", "smooth"]).optional().describe("Companion animation playback style: classic loops or smooth ping-pong playback."),
|
|
352
|
+
speed: z2.number().min(0.25).max(4).optional().describe("Companion animation playback speed multiplier. Defaults to 1."),
|
|
353
|
+
debug: z2.boolean().optional().describe("Enable verbose native companion debug logs.")
|
|
349
354
|
});
|
|
355
|
+
var AcpAgentPermissionModeSchema = z2.enum(["ask", "allow", "reject"]);
|
|
356
|
+
var AcpAgentConfigSchema = z2.object({
|
|
357
|
+
command: z2.string().min(1),
|
|
358
|
+
args: z2.array(z2.string()).default([]),
|
|
359
|
+
env: z2.record(z2.string(), z2.string()).default({}),
|
|
360
|
+
cwd: z2.string().min(1).optional(),
|
|
361
|
+
description: z2.string().min(1).optional(),
|
|
362
|
+
prompt: z2.string().min(1).optional(),
|
|
363
|
+
orchestratorPrompt: z2.string().min(1).optional(),
|
|
364
|
+
wrapperModel: ProviderModelIdSchema.optional(),
|
|
365
|
+
timeoutMs: z2.number().int().min(1000).max(900000).default(300000),
|
|
366
|
+
permissionMode: AcpAgentPermissionModeSchema.default("ask")
|
|
367
|
+
}).strict();
|
|
368
|
+
var AcpAgentsConfigSchema = z2.record(z2.string(), AcpAgentConfigSchema);
|
|
350
369
|
function validateCustomOnlyPromptFields(overrides, ctx, pathPrefix) {
|
|
351
370
|
for (const [name, override] of Object.entries(overrides)) {
|
|
352
371
|
const isBuiltInOrAlias = ALL_AGENT_NAMES.includes(name) || AGENT_ALIASES[name] !== undefined;
|
|
@@ -372,10 +391,7 @@ function validateCustomOnlyPromptFields(overrides, ctx, pathPrefix) {
|
|
|
372
391
|
var PluginConfigSchema = z2.object({
|
|
373
392
|
preset: z2.string().optional(),
|
|
374
393
|
setDefaultAgent: z2.boolean().optional(),
|
|
375
|
-
scoringEngineVersion: z2.enum(["v1", "v2-shadow", "v2"]).optional(),
|
|
376
|
-
balanceProviderUsage: z2.boolean().optional(),
|
|
377
394
|
autoUpdate: z2.boolean().optional().describe("Disable automatic installation of plugin updates when false. Defaults to true."),
|
|
378
|
-
manualPlan: ManualPlanSchema.optional(),
|
|
379
395
|
presets: z2.record(z2.string(), PresetSchema).optional(),
|
|
380
396
|
agents: z2.record(z2.string(), AgentOverrideConfigSchema).optional(),
|
|
381
397
|
disabled_agents: z2.array(z2.string()).optional().describe("Agent names to disable completely. " + "Disabled agents are not instantiated and cannot be delegated to. " + "Orchestrator and council internal agents (councillor) cannot be disabled. " + "By default, 'observer' is disabled. Remove it from this list and configure a vision-capable model to enable."),
|
|
@@ -387,7 +403,8 @@ var PluginConfigSchema = z2.object({
|
|
|
387
403
|
backgroundJobs: BackgroundJobsConfigSchema.optional(),
|
|
388
404
|
fallback: FailoverConfigSchema.optional(),
|
|
389
405
|
council: CouncilConfigSchema.optional(),
|
|
390
|
-
companion: CompanionConfigSchema.optional()
|
|
406
|
+
companion: CompanionConfigSchema.optional(),
|
|
407
|
+
acpAgents: AcpAgentsConfigSchema.optional()
|
|
391
408
|
}).superRefine((value, ctx) => {
|
|
392
409
|
if (value.agents) {
|
|
393
410
|
validateCustomOnlyPromptFields(value.agents, ctx, ["agents"]);
|
|
@@ -412,6 +429,9 @@ function getCustomAgentNames(config) {
|
|
|
412
429
|
return !ALL_AGENT_NAMES.includes(name);
|
|
413
430
|
});
|
|
414
431
|
}
|
|
432
|
+
function getAcpAgentNames(config) {
|
|
433
|
+
return Object.keys(config?.acpAgents ?? {});
|
|
434
|
+
}
|
|
415
435
|
// src/config/agent-mcps.ts
|
|
416
436
|
var DEFAULT_AGENT_MCPS = {
|
|
417
437
|
orchestrator: ["*", "!context7"],
|
|
@@ -473,11 +493,23 @@ var CUSTOM_SKILLS = [
|
|
|
473
493
|
allowedAgents: ["orchestrator"],
|
|
474
494
|
sourcePath: "src/skills/deepwork"
|
|
475
495
|
},
|
|
496
|
+
{
|
|
497
|
+
name: "reflect",
|
|
498
|
+
description: "Review repeated work and suggest reusable workflow improvements",
|
|
499
|
+
allowedAgents: ["orchestrator"],
|
|
500
|
+
sourcePath: "src/skills/reflect"
|
|
501
|
+
},
|
|
476
502
|
{
|
|
477
503
|
name: "oh-my-opencode-slim",
|
|
478
504
|
description: "Configure, customize, and safely improve oh-my-opencode-slim setups",
|
|
479
505
|
allowedAgents: ["orchestrator"],
|
|
480
506
|
sourcePath: "src/skills/oh-my-opencode-slim"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
name: "worktrees",
|
|
510
|
+
description: "Manage Git worktrees as OMO safe isolated coding lanes for complex/risky/parallel work",
|
|
511
|
+
allowedAgents: ["orchestrator"],
|
|
512
|
+
sourcePath: "src/skills/worktrees"
|
|
481
513
|
}
|
|
482
514
|
];
|
|
483
515
|
|
|
@@ -576,6 +608,7 @@ function mergePluginConfigs(base, override) {
|
|
|
576
608
|
backgroundJobs: deepMerge(base.backgroundJobs, override.backgroundJobs),
|
|
577
609
|
fallback: deepMerge(base.fallback, override.fallback),
|
|
578
610
|
council: deepMerge(base.council, override.council),
|
|
611
|
+
acpAgents: deepMerge(base.acpAgents, override.acpAgents),
|
|
579
612
|
companion: deepMerge(base.companion, override.companion)
|
|
580
613
|
};
|
|
581
614
|
}
|
|
@@ -629,8 +662,13 @@ function loadPluginConfig(directory, options) {
|
|
|
629
662
|
if (config.companion) {
|
|
630
663
|
config.companion = {
|
|
631
664
|
enabled: config.companion.enabled ?? false,
|
|
665
|
+
binaryPath: config.companion.binaryPath,
|
|
632
666
|
position: config.companion.position ?? "bottom-right",
|
|
633
|
-
size: config.companion.size ?? "medium"
|
|
667
|
+
size: config.companion.size ?? "medium",
|
|
668
|
+
gifPack: config.companion.gifPack ?? "default",
|
|
669
|
+
loopStyle: config.companion.loopStyle ?? "classic",
|
|
670
|
+
speed: config.companion.speed ?? 1,
|
|
671
|
+
debug: config.companion.debug ?? false
|
|
634
672
|
};
|
|
635
673
|
}
|
|
636
674
|
return config;
|
|
@@ -10,23 +10,6 @@ import { type PluginConfig } from '../config';
|
|
|
10
10
|
* normalizeAgentName(" explore ") // returns "explore"
|
|
11
11
|
*/
|
|
12
12
|
export declare function normalizeAgentName(agentName: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Resolves the variant configuration for a specific agent.
|
|
15
|
-
*
|
|
16
|
-
* Looks up the agent's variant in the plugin configuration. Returns undefined if:
|
|
17
|
-
* - No config is provided
|
|
18
|
-
* - The agent has no variant configured
|
|
19
|
-
* - The variant is not a string
|
|
20
|
-
* - The variant is empty or whitespace-only
|
|
21
|
-
*
|
|
22
|
-
* @param config - The plugin configuration object
|
|
23
|
-
* @param agentName - The name of the agent (with or without @ prefix)
|
|
24
|
-
* @returns The trimmed variant string, or undefined if no valid variant is found
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* resolveAgentVariant(config, "@oracle") // returns "high" if configured
|
|
28
|
-
*/
|
|
29
|
-
export declare function resolveAgentVariant(config: PluginConfig | undefined, agentName: string): string | undefined;
|
|
30
13
|
/**
|
|
31
14
|
* Resolve a runtime-provided agent name to an internal agent name.
|
|
32
15
|
*
|
|
@@ -38,26 +21,3 @@ export declare function resolveAgentVariant(config: PluginConfig | undefined, ag
|
|
|
38
21
|
export declare function resolveRuntimeAgentName(config: PluginConfig | undefined, agentName: string): string;
|
|
39
22
|
export type DisplayNameMentionRewriter = (text: string) => string;
|
|
40
23
|
export declare function createDisplayNameMentionRewriter(config: PluginConfig | undefined): DisplayNameMentionRewriter;
|
|
41
|
-
/**
|
|
42
|
-
* Rewrites user-facing display-name mentions (e.g. @advisor) into internal
|
|
43
|
-
* agent mentions (e.g. @oracle) for runtime routing.
|
|
44
|
-
*/
|
|
45
|
-
export declare function rewriteDisplayNameMentions(config: PluginConfig | undefined, text: string): string;
|
|
46
|
-
/**
|
|
47
|
-
* Applies a variant to a request body if the body doesn't already have one.
|
|
48
|
-
*
|
|
49
|
-
* This function will NOT override an existing variant in the body. If no variant
|
|
50
|
-
* is provided or the body already has a variant, the original body is returned.
|
|
51
|
-
*
|
|
52
|
-
* @template T - The type of the body object, must have an optional variant property
|
|
53
|
-
* @param variant - The variant string to apply (or undefined)
|
|
54
|
-
* @param body - The request body object
|
|
55
|
-
* @returns The body with the variant applied (new object) or the original body unchanged
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* applyAgentVariant("high", { agent: "oracle" }) // returns { agent: "oracle", variant: "high" }
|
|
59
|
-
* applyAgentVariant("high", { agent: "oracle", variant: "low" }) // returns original body with variant: "low"
|
|
60
|
-
*/
|
|
61
|
-
export declare function applyAgentVariant<T extends {
|
|
62
|
-
variant?: string;
|
|
63
|
-
}>(variant: string | undefined, body: T): T;
|
package/dist/utils/compat.d.ts
CHANGED
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export * from './agent-variant';
|
|
2
2
|
export * from './background-job-board';
|
|
3
|
-
export * from './env';
|
|
4
3
|
export * from './internal-initiator';
|
|
5
|
-
export { getLogDir, initLogger, log
|
|
4
|
+
export { getLogDir, initLogger, log } from './logger';
|
|
6
5
|
export * from './polling';
|
|
7
6
|
export * from './session';
|
|
8
7
|
export * from './task';
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
declare function getLogDir(): string;
|
|
2
2
|
export declare function initLogger(sessionId: string): void;
|
|
3
|
+
export { getLogDir };
|
|
3
4
|
/** @internal Reset logger state for testing */
|
|
4
5
|
export declare function resetLogger(): void;
|
|
5
6
|
/** @internal Wait for queued log writes in tests. */
|
|
6
7
|
export declare function flushLoggerForTesting(): Promise<void>;
|
|
7
|
-
export { getLogDir };
|
|
8
8
|
export declare function log(message: string, data?: unknown): void;
|
package/dist/utils/task.d.ts
CHANGED
|
@@ -13,10 +13,8 @@ export interface TaskStatusOutput {
|
|
|
13
13
|
timedOut: boolean;
|
|
14
14
|
result?: string;
|
|
15
15
|
}
|
|
16
|
-
export type TaskStatusClassification = 'running' | 'terminal' | 'timeout' | 'transient_process_error' | 'unknown_error';
|
|
17
16
|
export declare function parseTaskIdFromTaskOutput(output: string): string | undefined;
|
|
18
17
|
export declare function parseTaskLaunchOutput(output: string): TaskLaunchOutput | undefined;
|
|
19
18
|
export declare function parseTaskStatusOutput(output: string): TaskStatusOutput | undefined;
|
|
20
|
-
export declare function classifyTaskStatusOutput(status: TaskStatusOutput): TaskStatusClassification;
|
|
21
19
|
export declare function parseTaskStateFromOutput(output: string): TaskOutputState | undefined;
|
|
22
20
|
export declare function parseTaskResultFromOutput(output: string): string | undefined;
|