@smithers-orchestrator/agents 0.16.9 → 0.18.0
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/package.json +6 -4
- package/src/AgentLike.ts +4 -1
- package/src/AmpAgent.js +2 -0
- package/src/AnthropicAgent.js +10 -3
- package/src/BaseCliAgent/AgentGenerateOptions.ts +24 -0
- package/src/BaseCliAgent/BaseCliAgent.js +166 -32
- package/src/BaseCliAgent/extractPrompt.js +0 -1
- package/src/BaseCliAgent/extractTextFromJsonValue.js +2 -0
- package/src/BaseCliAgent/index.js +1 -0
- package/src/ClaudeCodeAgent.js +10 -3
- package/src/ClaudeCodeAgentOptions.ts +16 -0
- package/src/CodexAgent.js +6 -0
- package/src/CodexAgentOptions.ts +15 -0
- package/src/ForgeAgent.js +2 -0
- package/src/GeminiAgent.js +6 -2
- package/src/GeminiAgentOptions.ts +12 -0
- package/src/KimiAgent.js +211 -6
- package/src/KimiAgentOptions.ts +8 -0
- package/src/OpenAIAgent.js +10 -3
- package/src/OpenCodeAgent.js +495 -0
- package/src/OpenCodeAgent.ts +43 -0
- package/src/PiAgent.js +1 -1
- package/src/__type-tests__/AgentLike.assignability.test-d.ts +31 -0
- package/src/capability-registry/AgentCapabilityRegistry.ts +1 -1
- package/src/cli-capabilities/CliAgentCapabilityAdapterId.ts +1 -0
- package/src/cli-capabilities/getCliAgentCapabilityReport.js +6 -0
- package/src/index.d.ts +65 -64
- package/src/index.js +3 -0
package/src/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { ToolLoopAgent, ToolSet, ToolLoopAgentSettings } from 'ai';
|
|
|
4
4
|
import { anthropic } from '@ai-sdk/anthropic';
|
|
5
5
|
import { Effect } from 'effect';
|
|
6
6
|
import { SmithersError } from '@smithers-orchestrator/errors/SmithersError';
|
|
7
|
-
import * as zod from 'zod';
|
|
8
7
|
import * as zod_v4_core from 'zod/v4/core';
|
|
9
8
|
|
|
10
9
|
type SmithersToolSurface$2 = "raw" | "semantic";
|
|
@@ -113,7 +112,7 @@ type AgentToolDescriptor$1 = {
|
|
|
113
112
|
|
|
114
113
|
type AgentCapabilityRegistry$3 = {
|
|
115
114
|
version: 1;
|
|
116
|
-
engine: "claude-code" | "codex" | "gemini" | "kimi" | "pi" | "amp" | "forge";
|
|
115
|
+
engine: "claude-code" | "codex" | "gemini" | "kimi" | "pi" | "amp" | "forge" | "opencode";
|
|
117
116
|
runtimeTools: Record<string, AgentToolDescriptor$1>;
|
|
118
117
|
mcp: {
|
|
119
118
|
bootstrap: "inline-config" | "project-config" | "allow-list" | "unsupported";
|
|
@@ -152,6 +151,8 @@ type AgentLike$1 = {
|
|
|
152
151
|
tools?: Record<string, unknown>;
|
|
153
152
|
/** Optional structured capability registry for cache and diagnostics */
|
|
154
153
|
capabilities?: AgentCapabilityRegistry$1;
|
|
154
|
+
/** True when the agent consumes outputSchema through a native structured-output API. */
|
|
155
|
+
supportsNativeStructuredOutput?: boolean;
|
|
155
156
|
/**
|
|
156
157
|
* Generates a response or action based on the provided arguments.
|
|
157
158
|
*
|
|
@@ -165,7 +166,7 @@ type AgentLike$1 = {
|
|
|
165
166
|
* @param args.outputSchema - Optional Zod schema defining the expected structured output format
|
|
166
167
|
* @returns A promise resolving to the generated output
|
|
167
168
|
*/
|
|
168
|
-
generate: (args
|
|
169
|
+
generate: (args?: AgentGenerateOptions) => Promise<unknown>;
|
|
169
170
|
};
|
|
170
171
|
|
|
171
172
|
type RunCommandResult = {
|
|
@@ -238,11 +239,11 @@ declare class BaseCliAgent {
|
|
|
238
239
|
maxOutputBytes: number | undefined;
|
|
239
240
|
extraArgs: string[] | undefined;
|
|
240
241
|
/**
|
|
241
|
-
* @param {AgentGenerateOptions}
|
|
242
|
+
* @param {AgentGenerateOptions | undefined} options
|
|
242
243
|
* @param {AgentInvocationOperation} operation
|
|
243
244
|
* @returns {Effect.Effect<GenerateTextResult<Record<string, never>, unknown>, SmithersError>}
|
|
244
245
|
*/
|
|
245
|
-
runGenerateEffect(options
|
|
246
|
+
runGenerateEffect(options: AgentGenerateOptions | undefined, operation: AgentInvocationOperation): Effect.Effect<GenerateTextResult$3<Record<string, never>, unknown>, SmithersError>;
|
|
246
247
|
/**
|
|
247
248
|
* @param {AgentGenerateOptions} [options]
|
|
248
249
|
* @returns {Promise<GenerateTextResult<Record<string, never>, unknown>>}
|
|
@@ -304,20 +305,12 @@ declare class AnthropicAgent extends ToolLoopAgent<never, any, never> {
|
|
|
304
305
|
constructor(opts: AnthropicAgentOptions$1<CALL_OPTIONS, TOOLS>);
|
|
305
306
|
hijackEngine: string;
|
|
306
307
|
/**
|
|
307
|
-
* @param {
|
|
308
|
+
* @param {AgentGenerateOptions} [args]
|
|
308
309
|
* @returns {Promise<GenerateTextResult<TOOLS, never>>}
|
|
309
310
|
*/
|
|
310
|
-
generate(args
|
|
311
|
+
generate(args?: AgentGenerateOptions): Promise<GenerateTextResult$2<TOOLS, never>>;
|
|
311
312
|
}
|
|
312
|
-
type AgentCallParameters$1 = any;
|
|
313
313
|
type AnthropicAgentOptions$1<CALL_OPTIONS = never, TOOLS = ai.ToolSet> = AnthropicAgentOptions$2<CALL_OPTIONS, TOOLS>;
|
|
314
|
-
type ExtendedGenerateArgs$1<CALL_OPTIONS, TOOLS> = AgentCallParameters$1<CALL_OPTIONS, TOOLS> & {
|
|
315
|
-
onStdout?: (text: string) => void;
|
|
316
|
-
onStderr?: (text: string) => void;
|
|
317
|
-
onEvent?: (event: unknown) => Promise<void> | void;
|
|
318
|
-
outputSchema?: zod.ZodTypeAny;
|
|
319
|
-
resumeSession?: string;
|
|
320
|
-
};
|
|
321
314
|
type GenerateTextResult$2 = ai.GenerateTextResult<any, any>;
|
|
322
315
|
|
|
323
316
|
/** @typedef {import("ai").AgentCallParameters} AgentCallParameters */
|
|
@@ -337,19 +330,11 @@ declare class OpenAIAgent extends ToolLoopAgent<never, any, never> {
|
|
|
337
330
|
constructor(opts: OpenAIAgentOptions$1<CALL_OPTIONS, TOOLS>);
|
|
338
331
|
hijackEngine: string;
|
|
339
332
|
/**
|
|
340
|
-
* @param {
|
|
333
|
+
* @param {AgentGenerateOptions} [args]
|
|
341
334
|
* @returns {Promise<GenerateTextResult<TOOLS, never>>}
|
|
342
335
|
*/
|
|
343
|
-
generate(args
|
|
336
|
+
generate(args?: AgentGenerateOptions): Promise<GenerateTextResult$1<TOOLS, never>>;
|
|
344
337
|
}
|
|
345
|
-
type AgentCallParameters = any;
|
|
346
|
-
type ExtendedGenerateArgs<CALL_OPTIONS, TOOLS> = AgentCallParameters<CALL_OPTIONS, TOOLS> & {
|
|
347
|
-
onStdout?: (text: string) => void;
|
|
348
|
-
onStderr?: (text: string) => void;
|
|
349
|
-
onEvent?: (event: unknown) => Promise<void> | void;
|
|
350
|
-
outputSchema?: zod.ZodTypeAny;
|
|
351
|
-
resumeSession?: string;
|
|
352
|
-
};
|
|
353
338
|
type GenerateTextResult$1 = ai.GenerateTextResult<any, any>;
|
|
354
339
|
type OpenAIAgentOptions$1<CALL_OPTIONS = never, TOOLS = ai.ToolSet> = OpenAIAgentOptions$2<CALL_OPTIONS, TOOLS>;
|
|
355
340
|
|
|
@@ -391,25 +376,7 @@ declare class AmpAgent extends BaseCliAgent {
|
|
|
391
376
|
*/
|
|
392
377
|
constructor(opts?: AmpAgentOptions);
|
|
393
378
|
opts: AmpAgentOptions$1;
|
|
394
|
-
capabilities:
|
|
395
|
-
version: number;
|
|
396
|
-
engine: string;
|
|
397
|
-
runtimeTools: {};
|
|
398
|
-
mcp: {
|
|
399
|
-
bootstrap: string;
|
|
400
|
-
supportsProjectScope: boolean;
|
|
401
|
-
supportsUserScope: boolean;
|
|
402
|
-
};
|
|
403
|
-
skills: {
|
|
404
|
-
supportsSkills: boolean;
|
|
405
|
-
smithersSkillIds: never[];
|
|
406
|
-
};
|
|
407
|
-
humanInteraction: {
|
|
408
|
-
supportsUiRequests: boolean;
|
|
409
|
-
methods: never[];
|
|
410
|
-
};
|
|
411
|
-
builtIns: string[];
|
|
412
|
-
};
|
|
379
|
+
capabilities: AgentCapabilityRegistry$3;
|
|
413
380
|
cliEngine: string;
|
|
414
381
|
/**
|
|
415
382
|
* @returns {CliOutputInterpreter}
|
|
@@ -526,6 +493,21 @@ type CodexAgentOptions$1 = BaseCliAgentOptions$1 & {
|
|
|
526
493
|
color?: "always" | "never" | "auto";
|
|
527
494
|
json?: boolean;
|
|
528
495
|
outputLastMessage?: string;
|
|
496
|
+
/**
|
|
497
|
+
* Path to an isolated Codex CLI config directory. Sets `CODEX_HOME` on the
|
|
498
|
+
* spawned process so this invocation uses the credentials stored at
|
|
499
|
+
* `<configDir>/auth.json` (instead of the user's default `~/.codex/`).
|
|
500
|
+
*
|
|
501
|
+
* Use this to run multiple Codex / ChatGPT subscriptions side-by-side. Set
|
|
502
|
+
* up the directory by running `CODEX_HOME=<path> codex login` once.
|
|
503
|
+
*/
|
|
504
|
+
configDir?: string;
|
|
505
|
+
/**
|
|
506
|
+
* OpenAI API key for billing this invocation against the API instead of a
|
|
507
|
+
* ChatGPT Plus/Pro subscription. Sets `OPENAI_API_KEY` on the spawned
|
|
508
|
+
* process.
|
|
509
|
+
*/
|
|
510
|
+
apiKey?: string;
|
|
529
511
|
};
|
|
530
512
|
|
|
531
513
|
declare class CodexAgent extends BaseCliAgent {
|
|
@@ -758,25 +740,7 @@ declare class ForgeAgent extends BaseCliAgent {
|
|
|
758
740
|
*/
|
|
759
741
|
constructor(opts?: ForgeAgentOptions);
|
|
760
742
|
opts: ForgeAgentOptions$1;
|
|
761
|
-
capabilities:
|
|
762
|
-
version: number;
|
|
763
|
-
engine: string;
|
|
764
|
-
runtimeTools: {};
|
|
765
|
-
mcp: {
|
|
766
|
-
bootstrap: string;
|
|
767
|
-
supportsProjectScope: boolean;
|
|
768
|
-
supportsUserScope: boolean;
|
|
769
|
-
};
|
|
770
|
-
skills: {
|
|
771
|
-
supportsSkills: boolean;
|
|
772
|
-
smithersSkillIds: never[];
|
|
773
|
-
};
|
|
774
|
-
humanInteraction: {
|
|
775
|
-
supportsUiRequests: boolean;
|
|
776
|
-
methods: never[];
|
|
777
|
-
};
|
|
778
|
-
builtIns: string[];
|
|
779
|
-
};
|
|
743
|
+
capabilities: AgentCapabilityRegistry$3;
|
|
780
744
|
cliEngine: string;
|
|
781
745
|
issuedConversationId: any;
|
|
782
746
|
/**
|
|
@@ -800,6 +764,42 @@ declare class ForgeAgent extends BaseCliAgent {
|
|
|
800
764
|
type CliOutputInterpreter = CliOutputInterpreter$8;
|
|
801
765
|
type ForgeAgentOptions = ForgeAgentOptions$1;
|
|
802
766
|
|
|
767
|
+
type OpenCodeAgentOptions$1 = BaseCliAgentOptions$1 & {
|
|
768
|
+
/** Model identifier (e.g., "anthropic/claude-opus-4-20250514", "openai/gpt-5.4") */
|
|
769
|
+
model?: string;
|
|
770
|
+
/** OpenCode agent name (maps to --agent flag, selects predefined agent config) */
|
|
771
|
+
agentName?: string;
|
|
772
|
+
/** Files to attach to the prompt via -f flags */
|
|
773
|
+
attachFiles?: string[];
|
|
774
|
+
/** Continue a previous session */
|
|
775
|
+
continueSession?: boolean;
|
|
776
|
+
/** Resume a specific session by ID */
|
|
777
|
+
sessionId?: string;
|
|
778
|
+
/** Provider-specific model variant/reasoning effort level */
|
|
779
|
+
variant?: string;
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
declare class OpenCodeAgent extends BaseCliAgent {
|
|
783
|
+
constructor(opts?: OpenCodeAgentOptions);
|
|
784
|
+
opts: OpenCodeAgentOptions$1;
|
|
785
|
+
capabilities: AgentCapabilityRegistry$3;
|
|
786
|
+
cliEngine: "opencode";
|
|
787
|
+
createOutputInterpreter(): CliOutputInterpreter;
|
|
788
|
+
buildCommand(params: {
|
|
789
|
+
prompt: string;
|
|
790
|
+
systemPrompt?: string;
|
|
791
|
+
cwd: string;
|
|
792
|
+
options: any;
|
|
793
|
+
}): Promise<{
|
|
794
|
+
command: string;
|
|
795
|
+
args: string[];
|
|
796
|
+
outputFormat: "stream-json";
|
|
797
|
+
env?: Record<string, string>;
|
|
798
|
+
stdoutBannerPatterns: RegExp[];
|
|
799
|
+
stdoutErrorPatterns: RegExp[];
|
|
800
|
+
}>;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
803
|
/**
|
|
804
804
|
* @param {CreateSmithersAgentContractOptions} options
|
|
805
805
|
* @returns {SmithersAgentContract}
|
|
@@ -859,6 +859,7 @@ type AgentCapabilityRegistry = AgentCapabilityRegistry$3;
|
|
|
859
859
|
type AgentLike = AgentLike$1;
|
|
860
860
|
type AgentToolDescriptor = AgentToolDescriptor$1;
|
|
861
861
|
type AnthropicAgentOptions<CALL_OPTIONS = never, TOOLS = ai.ToolSet> = AnthropicAgentOptions$2<CALL_OPTIONS, TOOLS>;
|
|
862
|
+
type OpenCodeAgentOptions = OpenCodeAgentOptions$1;
|
|
862
863
|
type OpenAIAgentOptions<CALL_OPTIONS = never, TOOLS = ai.ToolSet> = OpenAIAgentOptions$2<CALL_OPTIONS, TOOLS>;
|
|
863
864
|
type PiAgentOptions = PiAgentOptions$2;
|
|
864
865
|
type PiExtensionUiRequest = PiExtensionUiRequest$1;
|
|
@@ -869,4 +870,4 @@ type SmithersAgentToolCategory = SmithersAgentToolCategory$1;
|
|
|
869
870
|
type SmithersListedTool = SmithersListedTool$2;
|
|
870
871
|
type SmithersToolSurface = SmithersToolSurface$2;
|
|
871
872
|
|
|
872
|
-
export { type AgentCapabilityRegistry, type AgentLike, type AgentToolDescriptor, AmpAgent, AnthropicAgent, type AnthropicAgentOptions, BaseCliAgent, ClaudeCodeAgent, CodexAgent, ForgeAgent, GeminiAgent, KimiAgent, OpenAIAgent, type OpenAIAgentOptions, PiAgent, type PiAgentOptions, type PiExtensionUiRequest, type PiExtensionUiResponse, type SmithersAgentContract, type SmithersAgentContractTool, type SmithersAgentToolCategory, type SmithersListedTool, type SmithersToolSurface, createSmithersAgentContract, hashCapabilityRegistry, renderSmithersAgentPromptGuidance, sanitizeForOpenAI, zodToOpenAISchema };
|
|
873
|
+
export { type AgentCapabilityRegistry, type AgentGenerateOptions, type AgentLike, type AgentToolDescriptor, AmpAgent, AnthropicAgent, type AnthropicAgentOptions, BaseCliAgent, ClaudeCodeAgent, CodexAgent, ForgeAgent, GeminiAgent, KimiAgent, OpenAIAgent, type OpenAIAgentOptions, OpenCodeAgent, type OpenCodeAgentOptions, PiAgent, type PiAgentOptions, type PiExtensionUiRequest, type PiExtensionUiResponse, type SmithersAgentContract, type SmithersAgentContractTool, type SmithersAgentToolCategory, type SmithersListedTool, type SmithersToolSurface, createSmithersAgentContract, hashCapabilityRegistry, renderSmithersAgentPromptGuidance, sanitizeForOpenAI, zodToOpenAISchema };
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @smithers-type-exports-begin
|
|
2
2
|
/** @typedef {import("./capability-registry/AgentCapabilityRegistry.ts").AgentCapabilityRegistry} AgentCapabilityRegistry */
|
|
3
|
+
/** @typedef {import("./BaseCliAgent/AgentGenerateOptions.ts").AgentGenerateOptions} AgentGenerateOptions */
|
|
3
4
|
/** @typedef {import("./AgentLike.ts").AgentLike} AgentLike */
|
|
4
5
|
/** @typedef {import("./capability-registry/AgentToolDescriptor.ts").AgentToolDescriptor} AgentToolDescriptor */
|
|
5
6
|
/**
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
/** @typedef {import("./PiAgentOptions.ts").PiAgentOptions} PiAgentOptions */
|
|
16
17
|
/** @typedef {import("./BaseCliAgent/PiExtensionUiRequest.ts").PiExtensionUiRequest} PiExtensionUiRequest */
|
|
17
18
|
/** @typedef {import("./BaseCliAgent/PiExtensionUiResponse.ts").PiExtensionUiResponse} PiExtensionUiResponse */
|
|
19
|
+
/** @typedef {import("./OpenCodeAgent.ts").OpenCodeAgentOptions} OpenCodeAgentOptions */
|
|
18
20
|
/** @typedef {import("./agent-contract/SmithersAgentContract.ts").SmithersAgentContract} SmithersAgentContract */
|
|
19
21
|
/** @typedef {import("./agent-contract/SmithersAgentContractTool.ts").SmithersAgentContractTool} SmithersAgentContractTool */
|
|
20
22
|
/** @typedef {import("./agent-contract/SmithersAgentToolCategory.ts").SmithersAgentToolCategory} SmithersAgentToolCategory */
|
|
@@ -33,6 +35,7 @@ export { GeminiAgent } from "./GeminiAgent.js";
|
|
|
33
35
|
export { PiAgent } from "./PiAgent.js";
|
|
34
36
|
export { KimiAgent } from "./KimiAgent.js";
|
|
35
37
|
export { ForgeAgent } from "./ForgeAgent.js";
|
|
38
|
+
export { OpenCodeAgent } from "./OpenCodeAgent.js";
|
|
36
39
|
export { createSmithersAgentContract } from "./agent-contract/createSmithersAgentContract.js";
|
|
37
40
|
export { renderSmithersAgentPromptGuidance } from "./agent-contract/renderSmithersAgentPromptGuidance.js";
|
|
38
41
|
export { zodToOpenAISchema } from "./zodToOpenAISchema.js";
|