@electric-ax/agents 0.2.4 → 0.4.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/dist/entrypoint.js +541 -810
- package/dist/index.cjs +537 -804
- package/dist/index.d.cts +84 -45
- package/dist/index.d.ts +86 -47
- package/dist/index.js +558 -824
- package/docs/entities/agents/horton.md +2 -5
- package/docs/index.md +4 -2
- package/docs/quickstart.md +2 -2
- package/docs/reference/handler-context.md +0 -35
- package/docs/reference/mcp-registry.md +189 -0
- package/docs/reference/mcp-server-config.md +226 -0
- package/docs/usage/clients-and-react.md +0 -4
- package/docs/usage/embedded-builtins.md +26 -16
- package/docs/usage/mcp-servers.md +354 -0
- package/docs/usage/overview.md +1 -3
- package/docs/usage/programmatic-runtime-client.md +1 -1
- package/docs/usage/writing-handlers.md +0 -5
- package/package.json +7 -5
- package/docs/entities/agents/coder.md +0 -99
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AgentTool,
|
|
1
|
+
import { AgentConfig, AgentTool, AvailableProvider, DispatchPolicy, EntityRegistry, EntityStreamDBWithActions, HandlerContext, HeadersProvider, PullWakeRunnerConfig, RuntimeHandler, WakeEvent } from "@electric-ax/agents-runtime";
|
|
2
2
|
import { ChangeEvent } from "@durable-streams/state";
|
|
3
3
|
import { AgentTool as AgentTool$1, StreamFn } from "@mariozechner/pi-agent-core";
|
|
4
4
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
5
|
+
import { ListedEntry as McpListedEntry, McpConfig, McpServerConfig, McpServerConfig as McpServerConfig$1, Registry, Registry as McpRegistry, RegistrySnapshot, RegistrySubscriber } from "@electric-ax/agents-mcp";
|
|
5
6
|
import { braveSearchTool } from "@electric-ax/agents-runtime/tools";
|
|
6
7
|
|
|
7
8
|
//#region src/skills/types.d.ts
|
|
@@ -40,6 +41,10 @@ interface BuiltinAgentHandlerOptions {
|
|
|
40
41
|
serveEndpoint?: string;
|
|
41
42
|
workingDirectory?: string;
|
|
42
43
|
streamFn?: StreamFn;
|
|
44
|
+
publicUrl?: string;
|
|
45
|
+
runtimeName?: string;
|
|
46
|
+
serverHeaders?: HeadersProvider;
|
|
47
|
+
defaultDispatchPolicyForType?: (typeName: string) => DispatchPolicy | undefined;
|
|
43
48
|
createElectricTools?: (context: {
|
|
44
49
|
entityUrl: string;
|
|
45
50
|
entityType: string;
|
|
@@ -82,12 +87,44 @@ declare const registerAgentTypes: typeof registerBuiltinAgentTypes;
|
|
|
82
87
|
//#region src/server.d.ts
|
|
83
88
|
interface BuiltinAgentsServerOptions {
|
|
84
89
|
agentServerUrl: string;
|
|
85
|
-
baseUrl?: string;
|
|
86
|
-
port: number;
|
|
87
|
-
host?: string;
|
|
88
90
|
workingDirectory?: string;
|
|
89
91
|
mockStreamFn?: StreamFn;
|
|
90
|
-
|
|
92
|
+
/** Pull-wake runner configuration for built-in agents. */
|
|
93
|
+
pullWake: {
|
|
94
|
+
runnerId: string;
|
|
95
|
+
ownerUserId?: string;
|
|
96
|
+
label?: string;
|
|
97
|
+
registerRunner?: boolean;
|
|
98
|
+
headers?: PullWakeRunnerConfig[`headers`];
|
|
99
|
+
claimHeaders?: PullWakeRunnerConfig[`claimHeaders`];
|
|
100
|
+
claimTokenHeader?: PullWakeRunnerConfig[`claimTokenHeader`];
|
|
101
|
+
heartbeatIntervalMs?: PullWakeRunnerConfig[`heartbeatIntervalMs`];
|
|
102
|
+
leaseMs?: PullWakeRunnerConfig[`leaseMs`];
|
|
103
|
+
};
|
|
104
|
+
/** Invoked when an `authorizationCode` server needs user consent. */
|
|
105
|
+
openAuthorizeUrl?: (url: string, server: string) => void;
|
|
106
|
+
/**
|
|
107
|
+
* MCP servers contributed by the embedder. Merged with `mcp.json`
|
|
108
|
+
* when `loadProjectMcpConfig` is set; on name conflict `mcp.json`
|
|
109
|
+
* wins. `authorizationCode` servers are wired to `keychainPersistence`.
|
|
110
|
+
*/
|
|
111
|
+
extraMcpServers?: ReadonlyArray<McpServerConfig$1>;
|
|
112
|
+
/** Invoked when applying MCP config fails. Errors are always logged. */
|
|
113
|
+
onConfigError?: (error: unknown) => void;
|
|
114
|
+
/**
|
|
115
|
+
* Base for OAuth redirect URIs — full URI is
|
|
116
|
+
* `<base>/oauth/callback/<server-name>`. Must be stable across
|
|
117
|
+
* restarts so DCR client info stays valid. The runtime never
|
|
118
|
+
* listens at this URI; the embedder intercepts the redirect.
|
|
119
|
+
* Defaults to the runtime's own listen URL.
|
|
120
|
+
*/
|
|
121
|
+
mcpOAuthRedirectBase?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Load `<workingDirectory>/mcp.json` (and watch it for changes).
|
|
124
|
+
* Off by default — stdio MCP servers can spawn local commands,
|
|
125
|
+
* so the embedder must opt in.
|
|
126
|
+
*/
|
|
127
|
+
loadProjectMcpConfig?: boolean;
|
|
91
128
|
createElectricTools?: (context: {
|
|
92
129
|
entityUrl: string;
|
|
93
130
|
entityType: string;
|
|
@@ -122,17 +159,20 @@ interface BuiltinAgentsServerOptions {
|
|
|
122
159
|
}) => Array<AgentTool> | Promise<Array<AgentTool>>;
|
|
123
160
|
}
|
|
124
161
|
declare class BuiltinAgentsServer {
|
|
125
|
-
private server;
|
|
126
162
|
private bootstrap;
|
|
127
|
-
private
|
|
128
|
-
private
|
|
163
|
+
private _mcpRegistry;
|
|
164
|
+
private mcpWatcherCloser;
|
|
165
|
+
private mcpToolProviderName;
|
|
166
|
+
private mcpApplyInFlight;
|
|
167
|
+
private mcpStopping;
|
|
168
|
+
private pullWakeRunner;
|
|
129
169
|
readonly options: BuiltinAgentsServerOptions;
|
|
130
170
|
constructor(options: BuiltinAgentsServerOptions);
|
|
131
|
-
|
|
132
|
-
get
|
|
171
|
+
/** Embedded MCP registry. `null` until `start()` has run. */
|
|
172
|
+
get mcpRegistry(): Registry | null;
|
|
133
173
|
start(): Promise<string>;
|
|
134
174
|
stop(): Promise<void>;
|
|
135
|
-
private
|
|
175
|
+
private registerPullWakeRunner;
|
|
136
176
|
}
|
|
137
177
|
|
|
138
178
|
//#endregion
|
|
@@ -159,22 +199,50 @@ declare function runBuiltinAgentsEntrypoint({
|
|
|
159
199
|
url: string;
|
|
160
200
|
}>;
|
|
161
201
|
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region src/model-catalog.d.ts
|
|
204
|
+
type BuiltinModelProvider = AvailableProvider;
|
|
205
|
+
interface BuiltinModelChoice {
|
|
206
|
+
provider: BuiltinModelProvider;
|
|
207
|
+
id: string;
|
|
208
|
+
label: string;
|
|
209
|
+
value: string;
|
|
210
|
+
reasoning: boolean;
|
|
211
|
+
}
|
|
212
|
+
interface BuiltinModelCatalog {
|
|
213
|
+
choices: Array<BuiltinModelChoice>;
|
|
214
|
+
defaultChoice: BuiltinModelChoice;
|
|
215
|
+
}
|
|
216
|
+
declare const REASONING_EFFORT_VALUES: readonly ["auto", "minimal", "low", "medium", "high"];
|
|
217
|
+
type BuiltinReasoningEffort = (typeof REASONING_EFFORT_VALUES)[number];
|
|
218
|
+
type ExplicitReasoningEffort = Exclude<BuiltinReasoningEffort, `auto`>;
|
|
219
|
+
type BuiltinAgentModelConfig = Pick<AgentConfig, `model` | `provider` | `onPayload` | `getApiKey`> & {
|
|
220
|
+
reasoningEffort?: ExplicitReasoningEffort;
|
|
221
|
+
};
|
|
222
|
+
declare function resolveBuiltinModelConfig(catalog: BuiltinModelCatalog, args: Readonly<Record<string, unknown>>): BuiltinAgentModelConfig;
|
|
223
|
+
|
|
162
224
|
//#endregion
|
|
163
225
|
//#region src/agents/horton.d.ts
|
|
164
226
|
declare const HORTON_MODEL = "claude-sonnet-4-6";
|
|
165
|
-
declare function generateTitle(userMessage: string, llmCall
|
|
227
|
+
declare function generateTitle(userMessage: string, llmCall: (prompt: string) => Promise<string>, onFallback?: (reason: string) => void): Promise<string>;
|
|
166
228
|
declare function buildHortonSystemPrompt(workingDirectory: string, opts?: {
|
|
167
229
|
hasDocsSupport?: boolean;
|
|
168
230
|
hasSkills?: boolean;
|
|
169
231
|
docsUrl?: string;
|
|
232
|
+
modelProvider?: string;
|
|
233
|
+
modelId?: string;
|
|
170
234
|
}): string;
|
|
171
235
|
declare function createHortonTools(workingDirectory: string, ctx: HandlerContext, readSet: Set<string>, opts?: {
|
|
172
236
|
docsSearchTool?: AgentTool$1;
|
|
237
|
+
modelConfig?: ReturnType<typeof resolveBuiltinModelConfig>;
|
|
238
|
+
modelCatalog?: BuiltinModelCatalog;
|
|
239
|
+
logPrefix?: string;
|
|
173
240
|
}): Array<AgentTool$1>;
|
|
174
241
|
declare function registerHorton(registry: EntityRegistry, options: {
|
|
175
242
|
workingDirectory: string;
|
|
176
243
|
streamFn?: StreamFn;
|
|
177
244
|
skillsRegistry?: SkillsRegistry | null;
|
|
245
|
+
modelCatalog: BuiltinModelCatalog;
|
|
178
246
|
docsUrl?: string;
|
|
179
247
|
}): Array<string>;
|
|
180
248
|
|
|
@@ -183,43 +251,14 @@ declare function registerHorton(registry: EntityRegistry, options: {
|
|
|
183
251
|
declare function registerWorker(registry: EntityRegistry, options: {
|
|
184
252
|
workingDirectory: string;
|
|
185
253
|
streamFn?: StreamFn;
|
|
254
|
+
modelCatalog: BuiltinModelCatalog;
|
|
186
255
|
}): void;
|
|
187
256
|
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region src/agents/coding-session.d.ts
|
|
190
|
-
/**
|
|
191
|
-
* Abstraction over the claude/codex CLI. Default implementation spawns
|
|
192
|
-
* the real binary; tests can inject a fake.
|
|
193
|
-
*
|
|
194
|
-
* `sessionId` is undefined for the first prompt on a fresh session —
|
|
195
|
-
* the runner should then let the CLI generate its own id. For every
|
|
196
|
-
* subsequent prompt, pass the id so the CLI resumes that conversation.
|
|
197
|
-
*/
|
|
198
|
-
interface CodingSessionCliRunner {
|
|
199
|
-
run(opts: {
|
|
200
|
-
agent: CodingAgentType;
|
|
201
|
-
sessionId?: string;
|
|
202
|
-
cwd: string;
|
|
203
|
-
prompt: string;
|
|
204
|
-
}): Promise<{
|
|
205
|
-
exitCode: number;
|
|
206
|
-
stdout: string;
|
|
207
|
-
stderr: string;
|
|
208
|
-
}>;
|
|
209
|
-
}
|
|
210
|
-
interface RegisterCodingSessionOptions {
|
|
211
|
-
/** Working directory the CLI runs in when `args.cwd` is not provided. Defaults to `process.cwd()`. */
|
|
212
|
-
defaultWorkingDirectory?: string;
|
|
213
|
-
/** Override the CLI runner (for tests or alternate backends). */
|
|
214
|
-
cliRunner?: CodingSessionCliRunner;
|
|
215
|
-
}
|
|
216
|
-
declare function registerCodingSession(registry: EntityRegistry, options?: RegisterCodingSessionOptions): void;
|
|
217
|
-
|
|
218
257
|
//#endregion
|
|
219
258
|
//#region src/tools/spawn-worker.d.ts
|
|
220
|
-
declare const WORKER_TOOL_NAMES: readonly ["bash", "read", "write", "edit", "
|
|
259
|
+
declare const WORKER_TOOL_NAMES: readonly ["bash", "read", "write", "edit", "web_search", "fetch_url", "spawn_worker"];
|
|
221
260
|
type WorkerToolName = (typeof WORKER_TOOL_NAMES)[number];
|
|
222
|
-
declare function createSpawnWorkerTool(ctx: HandlerContext): AgentTool$1;
|
|
261
|
+
declare function createSpawnWorkerTool(ctx: HandlerContext, modelConfig?: BuiltinAgentModelConfig): AgentTool$1;
|
|
223
262
|
|
|
224
263
|
//#endregion
|
|
225
264
|
//#region src/docs/knowledge-base.d.ts
|
|
@@ -240,4 +279,4 @@ declare function createHortonDocsSupport(workingDirectory: string, opts?: {
|
|
|
240
279
|
}): HortonDocsSupport | null;
|
|
241
280
|
|
|
242
281
|
//#endregion
|
|
243
|
-
export { AgentHandlerResult, BuiltinAgentHandlerOptions, BuiltinAgentsEntrypointOptions, BuiltinAgentsEntrypointServer, BuiltinAgentsServer, BuiltinAgentsServerOptions,
|
|
282
|
+
export { AgentHandlerResult, BuiltinAgentHandlerOptions, BuiltinAgentsEntrypointOptions, BuiltinAgentsEntrypointServer, BuiltinAgentsServer, BuiltinAgentsServerOptions, DEFAULT_BUILTIN_AGENT_HANDLER_PATH, HORTON_MODEL, McpConfig, McpListedEntry, McpRegistry, McpServerConfig, RegistrySnapshot, RegistrySubscriber, RunBuiltinAgentsEntrypointOptions, WORKER_TOOL_NAMES, WorkerToolName, braveSearchTool, buildHortonSystemPrompt, createAgentHandler, createBuiltinAgentHandler, createHortonDocsSupport, createHortonTools, createSpawnWorkerTool, generateTitle, registerAgentTypes, registerBuiltinAgentTypes, registerHorton, registerWorker, resolveBuiltinAgentsEntrypointOptions, runBuiltinAgentsEntrypoint };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { AgentTool,
|
|
2
|
-
import { braveSearchTool } from "@electric-ax/agents-runtime/tools";
|
|
3
|
-
import { IncomingMessage, ServerResponse } from "node:http";
|
|
1
|
+
import { AgentConfig, AgentTool, AvailableProvider, DispatchPolicy, EntityRegistry, EntityStreamDBWithActions, HandlerContext, HeadersProvider, PullWakeRunnerConfig, RuntimeHandler, WakeEvent } from "@electric-ax/agents-runtime";
|
|
4
2
|
import { ChangeEvent } from "@durable-streams/state";
|
|
3
|
+
import { braveSearchTool } from "@electric-ax/agents-runtime/tools";
|
|
4
|
+
import { ListedEntry as McpListedEntry, McpConfig, McpServerConfig, McpServerConfig as McpServerConfig$1, Registry, Registry as McpRegistry, RegistrySnapshot, RegistrySubscriber } from "@electric-ax/agents-mcp";
|
|
5
5
|
import { AgentTool as AgentTool$1, StreamFn } from "@mariozechner/pi-agent-core";
|
|
6
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
6
7
|
|
|
7
8
|
//#region src/skills/types.d.ts
|
|
8
9
|
interface SkillMeta {
|
|
@@ -40,6 +41,10 @@ interface BuiltinAgentHandlerOptions {
|
|
|
40
41
|
serveEndpoint?: string;
|
|
41
42
|
workingDirectory?: string;
|
|
42
43
|
streamFn?: StreamFn;
|
|
44
|
+
publicUrl?: string;
|
|
45
|
+
runtimeName?: string;
|
|
46
|
+
serverHeaders?: HeadersProvider;
|
|
47
|
+
defaultDispatchPolicyForType?: (typeName: string) => DispatchPolicy | undefined;
|
|
43
48
|
createElectricTools?: (context: {
|
|
44
49
|
entityUrl: string;
|
|
45
50
|
entityType: string;
|
|
@@ -82,12 +87,44 @@ declare const registerAgentTypes: typeof registerBuiltinAgentTypes;
|
|
|
82
87
|
//#region src/server.d.ts
|
|
83
88
|
interface BuiltinAgentsServerOptions {
|
|
84
89
|
agentServerUrl: string;
|
|
85
|
-
baseUrl?: string;
|
|
86
|
-
port: number;
|
|
87
|
-
host?: string;
|
|
88
90
|
workingDirectory?: string;
|
|
89
91
|
mockStreamFn?: StreamFn;
|
|
90
|
-
|
|
92
|
+
/** Pull-wake runner configuration for built-in agents. */
|
|
93
|
+
pullWake: {
|
|
94
|
+
runnerId: string;
|
|
95
|
+
ownerUserId?: string;
|
|
96
|
+
label?: string;
|
|
97
|
+
registerRunner?: boolean;
|
|
98
|
+
headers?: PullWakeRunnerConfig[`headers`];
|
|
99
|
+
claimHeaders?: PullWakeRunnerConfig[`claimHeaders`];
|
|
100
|
+
claimTokenHeader?: PullWakeRunnerConfig[`claimTokenHeader`];
|
|
101
|
+
heartbeatIntervalMs?: PullWakeRunnerConfig[`heartbeatIntervalMs`];
|
|
102
|
+
leaseMs?: PullWakeRunnerConfig[`leaseMs`];
|
|
103
|
+
};
|
|
104
|
+
/** Invoked when an `authorizationCode` server needs user consent. */
|
|
105
|
+
openAuthorizeUrl?: (url: string, server: string) => void;
|
|
106
|
+
/**
|
|
107
|
+
* MCP servers contributed by the embedder. Merged with `mcp.json`
|
|
108
|
+
* when `loadProjectMcpConfig` is set; on name conflict `mcp.json`
|
|
109
|
+
* wins. `authorizationCode` servers are wired to `keychainPersistence`.
|
|
110
|
+
*/
|
|
111
|
+
extraMcpServers?: ReadonlyArray<McpServerConfig$1>;
|
|
112
|
+
/** Invoked when applying MCP config fails. Errors are always logged. */
|
|
113
|
+
onConfigError?: (error: unknown) => void;
|
|
114
|
+
/**
|
|
115
|
+
* Base for OAuth redirect URIs — full URI is
|
|
116
|
+
* `<base>/oauth/callback/<server-name>`. Must be stable across
|
|
117
|
+
* restarts so DCR client info stays valid. The runtime never
|
|
118
|
+
* listens at this URI; the embedder intercepts the redirect.
|
|
119
|
+
* Defaults to the runtime's own listen URL.
|
|
120
|
+
*/
|
|
121
|
+
mcpOAuthRedirectBase?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Load `<workingDirectory>/mcp.json` (and watch it for changes).
|
|
124
|
+
* Off by default — stdio MCP servers can spawn local commands,
|
|
125
|
+
* so the embedder must opt in.
|
|
126
|
+
*/
|
|
127
|
+
loadProjectMcpConfig?: boolean;
|
|
91
128
|
createElectricTools?: (context: {
|
|
92
129
|
entityUrl: string;
|
|
93
130
|
entityType: string;
|
|
@@ -122,17 +159,20 @@ interface BuiltinAgentsServerOptions {
|
|
|
122
159
|
}) => Array<AgentTool> | Promise<Array<AgentTool>>;
|
|
123
160
|
}
|
|
124
161
|
declare class BuiltinAgentsServer {
|
|
125
|
-
private server;
|
|
126
162
|
private bootstrap;
|
|
127
|
-
private
|
|
128
|
-
private
|
|
163
|
+
private _mcpRegistry;
|
|
164
|
+
private mcpWatcherCloser;
|
|
165
|
+
private mcpToolProviderName;
|
|
166
|
+
private mcpApplyInFlight;
|
|
167
|
+
private mcpStopping;
|
|
168
|
+
private pullWakeRunner;
|
|
129
169
|
readonly options: BuiltinAgentsServerOptions;
|
|
130
170
|
constructor(options: BuiltinAgentsServerOptions);
|
|
131
|
-
|
|
132
|
-
get
|
|
171
|
+
/** Embedded MCP registry. `null` until `start()` has run. */
|
|
172
|
+
get mcpRegistry(): Registry | null;
|
|
133
173
|
start(): Promise<string>;
|
|
134
174
|
stop(): Promise<void>;
|
|
135
|
-
private
|
|
175
|
+
private registerPullWakeRunner;
|
|
136
176
|
}
|
|
137
177
|
|
|
138
178
|
//#endregion
|
|
@@ -159,22 +199,50 @@ declare function runBuiltinAgentsEntrypoint({
|
|
|
159
199
|
url: string;
|
|
160
200
|
}>;
|
|
161
201
|
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region src/model-catalog.d.ts
|
|
204
|
+
type BuiltinModelProvider = AvailableProvider;
|
|
205
|
+
interface BuiltinModelChoice {
|
|
206
|
+
provider: BuiltinModelProvider;
|
|
207
|
+
id: string;
|
|
208
|
+
label: string;
|
|
209
|
+
value: string;
|
|
210
|
+
reasoning: boolean;
|
|
211
|
+
}
|
|
212
|
+
interface BuiltinModelCatalog {
|
|
213
|
+
choices: Array<BuiltinModelChoice>;
|
|
214
|
+
defaultChoice: BuiltinModelChoice;
|
|
215
|
+
}
|
|
216
|
+
declare const REASONING_EFFORT_VALUES: readonly ["auto", "minimal", "low", "medium", "high"];
|
|
217
|
+
type BuiltinReasoningEffort = (typeof REASONING_EFFORT_VALUES)[number];
|
|
218
|
+
type ExplicitReasoningEffort = Exclude<BuiltinReasoningEffort, `auto`>;
|
|
219
|
+
type BuiltinAgentModelConfig = Pick<AgentConfig, `model` | `provider` | `onPayload` | `getApiKey`> & {
|
|
220
|
+
reasoningEffort?: ExplicitReasoningEffort;
|
|
221
|
+
};
|
|
222
|
+
declare function resolveBuiltinModelConfig(catalog: BuiltinModelCatalog, args: Readonly<Record<string, unknown>>): BuiltinAgentModelConfig;
|
|
223
|
+
|
|
162
224
|
//#endregion
|
|
163
225
|
//#region src/agents/horton.d.ts
|
|
164
226
|
declare const HORTON_MODEL = "claude-sonnet-4-6";
|
|
165
|
-
declare function generateTitle(userMessage: string, llmCall
|
|
227
|
+
declare function generateTitle(userMessage: string, llmCall: (prompt: string) => Promise<string>, onFallback?: (reason: string) => void): Promise<string>;
|
|
166
228
|
declare function buildHortonSystemPrompt(workingDirectory: string, opts?: {
|
|
167
229
|
hasDocsSupport?: boolean;
|
|
168
230
|
hasSkills?: boolean;
|
|
169
231
|
docsUrl?: string;
|
|
232
|
+
modelProvider?: string;
|
|
233
|
+
modelId?: string;
|
|
170
234
|
}): string;
|
|
171
235
|
declare function createHortonTools(workingDirectory: string, ctx: HandlerContext, readSet: Set<string>, opts?: {
|
|
172
236
|
docsSearchTool?: AgentTool$1;
|
|
237
|
+
modelConfig?: ReturnType<typeof resolveBuiltinModelConfig>;
|
|
238
|
+
modelCatalog?: BuiltinModelCatalog;
|
|
239
|
+
logPrefix?: string;
|
|
173
240
|
}): Array<AgentTool$1>;
|
|
174
241
|
declare function registerHorton(registry: EntityRegistry, options: {
|
|
175
242
|
workingDirectory: string;
|
|
176
243
|
streamFn?: StreamFn;
|
|
177
244
|
skillsRegistry?: SkillsRegistry | null;
|
|
245
|
+
modelCatalog: BuiltinModelCatalog;
|
|
178
246
|
docsUrl?: string;
|
|
179
247
|
}): Array<string>;
|
|
180
248
|
|
|
@@ -183,43 +251,14 @@ declare function registerHorton(registry: EntityRegistry, options: {
|
|
|
183
251
|
declare function registerWorker(registry: EntityRegistry, options: {
|
|
184
252
|
workingDirectory: string;
|
|
185
253
|
streamFn?: StreamFn;
|
|
254
|
+
modelCatalog: BuiltinModelCatalog;
|
|
186
255
|
}): void;
|
|
187
256
|
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region src/agents/coding-session.d.ts
|
|
190
|
-
/**
|
|
191
|
-
* Abstraction over the claude/codex CLI. Default implementation spawns
|
|
192
|
-
* the real binary; tests can inject a fake.
|
|
193
|
-
*
|
|
194
|
-
* `sessionId` is undefined for the first prompt on a fresh session —
|
|
195
|
-
* the runner should then let the CLI generate its own id. For every
|
|
196
|
-
* subsequent prompt, pass the id so the CLI resumes that conversation.
|
|
197
|
-
*/
|
|
198
|
-
interface CodingSessionCliRunner {
|
|
199
|
-
run(opts: {
|
|
200
|
-
agent: CodingAgentType;
|
|
201
|
-
sessionId?: string;
|
|
202
|
-
cwd: string;
|
|
203
|
-
prompt: string;
|
|
204
|
-
}): Promise<{
|
|
205
|
-
exitCode: number;
|
|
206
|
-
stdout: string;
|
|
207
|
-
stderr: string;
|
|
208
|
-
}>;
|
|
209
|
-
}
|
|
210
|
-
interface RegisterCodingSessionOptions {
|
|
211
|
-
/** Working directory the CLI runs in when `args.cwd` is not provided. Defaults to `process.cwd()`. */
|
|
212
|
-
defaultWorkingDirectory?: string;
|
|
213
|
-
/** Override the CLI runner (for tests or alternate backends). */
|
|
214
|
-
cliRunner?: CodingSessionCliRunner;
|
|
215
|
-
}
|
|
216
|
-
declare function registerCodingSession(registry: EntityRegistry, options?: RegisterCodingSessionOptions): void;
|
|
217
|
-
|
|
218
257
|
//#endregion
|
|
219
258
|
//#region src/tools/spawn-worker.d.ts
|
|
220
|
-
declare const WORKER_TOOL_NAMES: readonly ["bash", "read", "write", "edit", "
|
|
259
|
+
declare const WORKER_TOOL_NAMES: readonly ["bash", "read", "write", "edit", "web_search", "fetch_url", "spawn_worker"];
|
|
221
260
|
type WorkerToolName = (typeof WORKER_TOOL_NAMES)[number];
|
|
222
|
-
declare function createSpawnWorkerTool(ctx: HandlerContext): AgentTool$1;
|
|
261
|
+
declare function createSpawnWorkerTool(ctx: HandlerContext, modelConfig?: BuiltinAgentModelConfig): AgentTool$1;
|
|
223
262
|
|
|
224
263
|
//#endregion
|
|
225
264
|
//#region src/docs/knowledge-base.d.ts
|
|
@@ -240,4 +279,4 @@ declare function createHortonDocsSupport(workingDirectory: string, opts?: {
|
|
|
240
279
|
}): HortonDocsSupport | null;
|
|
241
280
|
|
|
242
281
|
//#endregion
|
|
243
|
-
export { AgentHandlerResult, BuiltinAgentHandlerOptions, BuiltinAgentsEntrypointOptions, BuiltinAgentsEntrypointServer, BuiltinAgentsServer, BuiltinAgentsServerOptions,
|
|
282
|
+
export { AgentHandlerResult, BuiltinAgentHandlerOptions, BuiltinAgentsEntrypointOptions, BuiltinAgentsEntrypointServer, BuiltinAgentsServer, BuiltinAgentsServerOptions, DEFAULT_BUILTIN_AGENT_HANDLER_PATH, HORTON_MODEL, McpConfig, McpListedEntry, McpRegistry, McpServerConfig, RegistrySnapshot, RegistrySubscriber, RunBuiltinAgentsEntrypointOptions, WORKER_TOOL_NAMES, WorkerToolName, braveSearchTool, buildHortonSystemPrompt, createAgentHandler, createBuiltinAgentHandler, createHortonDocsSupport, createHortonTools, createSpawnWorkerTool, generateTitle, registerAgentTypes, registerBuiltinAgentTypes, registerHorton, registerWorker, resolveBuiltinAgentsEntrypointOptions, runBuiltinAgentsEntrypoint };
|