@electric-ax/agents 0.1.4 → 0.2.1
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 +650 -407
- package/dist/index.cjs +668 -418
- package/dist/index.d.cts +36 -3
- package/dist/index.d.ts +36 -3
- package/dist/index.js +653 -410
- package/package.json +7 -10
- package/skills/init.md +71 -0
- package/skills/quickstart/scaffold/entities/.gitkeep +0 -0
- package/skills/quickstart/scaffold/lib/electric-tools.ts +80 -0
- package/skills/quickstart/scaffold/package.json +17 -0
- package/skills/quickstart/scaffold/server.ts +51 -0
- package/skills/quickstart/scaffold/tsconfig.json +15 -0
- package/skills/quickstart.md +672 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AgentTool, EntityRegistry, EntityStreamDBWithActions, HandlerContext, RuntimeHandler, WakeEvent } from "@electric-ax/agents-runtime";
|
|
1
|
+
import { AgentTool, CodingAgentType, EntityRegistry, EntityStreamDBWithActions, HandlerContext, 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 { braveSearchTool } from "@electric-ax/agents-runtime/tools";
|
|
5
6
|
|
|
6
7
|
//#region src/skills/types.d.ts
|
|
7
8
|
interface SkillMeta {
|
|
@@ -160,11 +161,12 @@ declare function runBuiltinAgentsEntrypoint({
|
|
|
160
161
|
|
|
161
162
|
//#endregion
|
|
162
163
|
//#region src/agents/horton.d.ts
|
|
163
|
-
declare const HORTON_MODEL = "claude-sonnet-4-
|
|
164
|
+
declare const HORTON_MODEL = "claude-sonnet-4-6";
|
|
164
165
|
declare function generateTitle(userMessage: string, llmCall?: (prompt: string) => Promise<string>): Promise<string>;
|
|
165
166
|
declare function buildHortonSystemPrompt(workingDirectory: string, opts?: {
|
|
166
167
|
hasDocsSupport?: boolean;
|
|
167
168
|
hasSkills?: boolean;
|
|
169
|
+
docsUrl?: string;
|
|
168
170
|
}): string;
|
|
169
171
|
declare function createHortonTools(workingDirectory: string, ctx: HandlerContext, readSet: Set<string>, opts?: {
|
|
170
172
|
docsSearchTool?: AgentTool$1;
|
|
@@ -173,6 +175,7 @@ declare function registerHorton(registry: EntityRegistry, options: {
|
|
|
173
175
|
workingDirectory: string;
|
|
174
176
|
streamFn?: StreamFn;
|
|
175
177
|
skillsRegistry?: SkillsRegistry | null;
|
|
178
|
+
docsUrl?: string;
|
|
176
179
|
}): Array<string>;
|
|
177
180
|
|
|
178
181
|
//#endregion
|
|
@@ -182,6 +185,36 @@ declare function registerWorker(registry: EntityRegistry, options: {
|
|
|
182
185
|
streamFn?: StreamFn;
|
|
183
186
|
}): void;
|
|
184
187
|
|
|
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
|
+
|
|
185
218
|
//#endregion
|
|
186
219
|
//#region src/tools/spawn-worker.d.ts
|
|
187
220
|
declare const WORKER_TOOL_NAMES: readonly ["bash", "read", "write", "edit", "brave_search", "fetch_url", "spawn_worker"];
|
|
@@ -207,4 +240,4 @@ declare function createHortonDocsSupport(workingDirectory: string, opts?: {
|
|
|
207
240
|
}): HortonDocsSupport | null;
|
|
208
241
|
|
|
209
242
|
//#endregion
|
|
210
|
-
export { AgentHandlerResult, BuiltinAgentHandlerOptions, BuiltinAgentsEntrypointOptions, BuiltinAgentsEntrypointServer, BuiltinAgentsServer, BuiltinAgentsServerOptions, DEFAULT_BUILTIN_AGENT_HANDLER_PATH, HORTON_MODEL, RunBuiltinAgentsEntrypointOptions, WORKER_TOOL_NAMES, WorkerToolName, buildHortonSystemPrompt, createAgentHandler, createBuiltinAgentHandler, createHortonDocsSupport, createHortonTools, createSpawnWorkerTool, generateTitle, registerAgentTypes, registerBuiltinAgentTypes, registerHorton, registerWorker, resolveBuiltinAgentsEntrypointOptions, runBuiltinAgentsEntrypoint };
|
|
243
|
+
export { AgentHandlerResult, BuiltinAgentHandlerOptions, BuiltinAgentsEntrypointOptions, BuiltinAgentsEntrypointServer, BuiltinAgentsServer, BuiltinAgentsServerOptions, CodingSessionCliRunner, DEFAULT_BUILTIN_AGENT_HANDLER_PATH, HORTON_MODEL, RegisterCodingSessionOptions, RunBuiltinAgentsEntrypointOptions, WORKER_TOOL_NAMES, WorkerToolName, braveSearchTool, buildHortonSystemPrompt, createAgentHandler, createBuiltinAgentHandler, createHortonDocsSupport, createHortonTools, createSpawnWorkerTool, generateTitle, registerAgentTypes, registerBuiltinAgentTypes, registerCodingSession, registerHorton, registerWorker, resolveBuiltinAgentsEntrypointOptions, runBuiltinAgentsEntrypoint };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AgentTool, EntityRegistry, EntityStreamDBWithActions, HandlerContext, RuntimeHandler, WakeEvent } from "@electric-ax/agents-runtime";
|
|
1
|
+
import { AgentTool, CodingAgentType, EntityRegistry, EntityStreamDBWithActions, HandlerContext, RuntimeHandler, WakeEvent } from "@electric-ax/agents-runtime";
|
|
2
|
+
import { braveSearchTool } from "@electric-ax/agents-runtime/tools";
|
|
2
3
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
3
4
|
import { ChangeEvent } from "@durable-streams/state";
|
|
4
5
|
import { AgentTool as AgentTool$1, StreamFn } from "@mariozechner/pi-agent-core";
|
|
@@ -160,11 +161,12 @@ declare function runBuiltinAgentsEntrypoint({
|
|
|
160
161
|
|
|
161
162
|
//#endregion
|
|
162
163
|
//#region src/agents/horton.d.ts
|
|
163
|
-
declare const HORTON_MODEL = "claude-sonnet-4-
|
|
164
|
+
declare const HORTON_MODEL = "claude-sonnet-4-6";
|
|
164
165
|
declare function generateTitle(userMessage: string, llmCall?: (prompt: string) => Promise<string>): Promise<string>;
|
|
165
166
|
declare function buildHortonSystemPrompt(workingDirectory: string, opts?: {
|
|
166
167
|
hasDocsSupport?: boolean;
|
|
167
168
|
hasSkills?: boolean;
|
|
169
|
+
docsUrl?: string;
|
|
168
170
|
}): string;
|
|
169
171
|
declare function createHortonTools(workingDirectory: string, ctx: HandlerContext, readSet: Set<string>, opts?: {
|
|
170
172
|
docsSearchTool?: AgentTool$1;
|
|
@@ -173,6 +175,7 @@ declare function registerHorton(registry: EntityRegistry, options: {
|
|
|
173
175
|
workingDirectory: string;
|
|
174
176
|
streamFn?: StreamFn;
|
|
175
177
|
skillsRegistry?: SkillsRegistry | null;
|
|
178
|
+
docsUrl?: string;
|
|
176
179
|
}): Array<string>;
|
|
177
180
|
|
|
178
181
|
//#endregion
|
|
@@ -182,6 +185,36 @@ declare function registerWorker(registry: EntityRegistry, options: {
|
|
|
182
185
|
streamFn?: StreamFn;
|
|
183
186
|
}): void;
|
|
184
187
|
|
|
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
|
+
|
|
185
218
|
//#endregion
|
|
186
219
|
//#region src/tools/spawn-worker.d.ts
|
|
187
220
|
declare const WORKER_TOOL_NAMES: readonly ["bash", "read", "write", "edit", "brave_search", "fetch_url", "spawn_worker"];
|
|
@@ -207,4 +240,4 @@ declare function createHortonDocsSupport(workingDirectory: string, opts?: {
|
|
|
207
240
|
}): HortonDocsSupport | null;
|
|
208
241
|
|
|
209
242
|
//#endregion
|
|
210
|
-
export { AgentHandlerResult, BuiltinAgentHandlerOptions, BuiltinAgentsEntrypointOptions, BuiltinAgentsEntrypointServer, BuiltinAgentsServer, BuiltinAgentsServerOptions, DEFAULT_BUILTIN_AGENT_HANDLER_PATH, HORTON_MODEL, RunBuiltinAgentsEntrypointOptions, WORKER_TOOL_NAMES, WorkerToolName, buildHortonSystemPrompt, createAgentHandler, createBuiltinAgentHandler, createHortonDocsSupport, createHortonTools, createSpawnWorkerTool, generateTitle, registerAgentTypes, registerBuiltinAgentTypes, registerHorton, registerWorker, resolveBuiltinAgentsEntrypointOptions, runBuiltinAgentsEntrypoint };
|
|
243
|
+
export { AgentHandlerResult, BuiltinAgentHandlerOptions, BuiltinAgentsEntrypointOptions, BuiltinAgentsEntrypointServer, BuiltinAgentsServer, BuiltinAgentsServerOptions, CodingSessionCliRunner, DEFAULT_BUILTIN_AGENT_HANDLER_PATH, HORTON_MODEL, RegisterCodingSessionOptions, RunBuiltinAgentsEntrypointOptions, WORKER_TOOL_NAMES, WorkerToolName, braveSearchTool, buildHortonSystemPrompt, createAgentHandler, createBuiltinAgentHandler, createHortonDocsSupport, createHortonTools, createSpawnWorkerTool, generateTitle, registerAgentTypes, registerBuiltinAgentTypes, registerCodingSession, registerHorton, registerWorker, resolveBuiltinAgentsEntrypointOptions, runBuiltinAgentsEntrypoint };
|