@electric-ax/agents 0.1.0 → 0.1.2
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 +641 -38
- package/dist/index.cjs +645 -42
- package/dist/index.d.cts +30 -4
- package/dist/index.d.ts +30 -4
- package/dist/index.js +642 -39
- package/package.json +7 -2
package/dist/index.d.cts
CHANGED
|
@@ -3,14 +3,36 @@ 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
5
|
|
|
6
|
+
//#region src/skills/types.d.ts
|
|
7
|
+
interface SkillMeta {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
whenToUse: string;
|
|
11
|
+
keywords: Array<string>;
|
|
12
|
+
arguments?: Array<string>;
|
|
13
|
+
argumentHint?: string;
|
|
14
|
+
userInvocable?: boolean;
|
|
15
|
+
max: number;
|
|
16
|
+
charCount: number;
|
|
17
|
+
contentHash: string;
|
|
18
|
+
source: string;
|
|
19
|
+
}
|
|
20
|
+
interface SkillsRegistry {
|
|
21
|
+
/** All skill metadata, keyed by name. */
|
|
22
|
+
catalog: ReadonlyMap<string, SkillMeta>;
|
|
23
|
+
/** Render the skill catalog as text for context injection. Fits within budget (chars). */
|
|
24
|
+
renderCatalog: (budget?: number) => string;
|
|
25
|
+
/** Read skill content from disk. Returns null if skill not found. */
|
|
26
|
+
readContent: (name: string) => Promise<string | null>;
|
|
27
|
+
} //#endregion
|
|
6
28
|
//#region src/bootstrap.d.ts
|
|
7
|
-
|
|
8
29
|
declare const DEFAULT_BUILTIN_AGENT_HANDLER_PATH = "/_electric/builtin-agent-handler";
|
|
9
30
|
interface AgentHandlerResult {
|
|
10
31
|
handler: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
11
32
|
runtime: RuntimeHandler;
|
|
12
33
|
registry: EntityRegistry;
|
|
13
34
|
typeNames: Array<string>;
|
|
35
|
+
skillsRegistry: SkillsRegistry | null;
|
|
14
36
|
}
|
|
15
37
|
interface BuiltinAgentHandlerOptions {
|
|
16
38
|
agentServerUrl: string;
|
|
@@ -50,10 +72,12 @@ interface BuiltinAgentHandlerOptions {
|
|
|
50
72
|
}>;
|
|
51
73
|
}) => Array<AgentTool> | Promise<Array<AgentTool>>;
|
|
52
74
|
}
|
|
53
|
-
declare function createBuiltinAgentHandler(options: BuiltinAgentHandlerOptions): AgentHandlerResult | null
|
|
54
|
-
declare function createAgentHandler(agentServerUrl: string, workingDirectory?: string, streamFn?: StreamFn, createElectricTools?: BuiltinAgentHandlerOptions[`createElectricTools`], serveEndpoint?: string): AgentHandlerResult | null
|
|
75
|
+
declare function createBuiltinAgentHandler(options: BuiltinAgentHandlerOptions): Promise<AgentHandlerResult | null>;
|
|
76
|
+
declare function createAgentHandler(agentServerUrl: string, workingDirectory?: string, streamFn?: StreamFn, createElectricTools?: BuiltinAgentHandlerOptions[`createElectricTools`], serveEndpoint?: string): Promise<AgentHandlerResult | null>;
|
|
55
77
|
declare function registerBuiltinAgentTypes(bootstrap: AgentHandlerResult): Promise<void>;
|
|
56
|
-
declare const registerAgentTypes: typeof registerBuiltinAgentTypes;
|
|
78
|
+
declare const registerAgentTypes: typeof registerBuiltinAgentTypes;
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
57
81
|
//#region src/server.d.ts
|
|
58
82
|
interface BuiltinAgentsServerOptions {
|
|
59
83
|
agentServerUrl: string;
|
|
@@ -140,6 +164,7 @@ declare const HORTON_MODEL = "claude-sonnet-4-5-20250929";
|
|
|
140
164
|
declare function generateTitle(userMessage: string, llmCall?: (prompt: string) => Promise<string>): Promise<string>;
|
|
141
165
|
declare function buildHortonSystemPrompt(workingDirectory: string, opts?: {
|
|
142
166
|
hasDocsSupport?: boolean;
|
|
167
|
+
hasSkills?: boolean;
|
|
143
168
|
}): string;
|
|
144
169
|
declare function createHortonTools(workingDirectory: string, ctx: HandlerContext, readSet: Set<string>, opts?: {
|
|
145
170
|
docsSearchTool?: AgentTool$1;
|
|
@@ -147,6 +172,7 @@ declare function createHortonTools(workingDirectory: string, ctx: HandlerContext
|
|
|
147
172
|
declare function registerHorton(registry: EntityRegistry, options: {
|
|
148
173
|
workingDirectory: string;
|
|
149
174
|
streamFn?: StreamFn;
|
|
175
|
+
skillsRegistry?: SkillsRegistry | null;
|
|
150
176
|
}): Array<string>;
|
|
151
177
|
|
|
152
178
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -3,14 +3,36 @@ import { IncomingMessage, ServerResponse } from "node:http";
|
|
|
3
3
|
import { ChangeEvent } from "@durable-streams/state";
|
|
4
4
|
import { AgentTool as AgentTool$1, StreamFn } from "@mariozechner/pi-agent-core";
|
|
5
5
|
|
|
6
|
+
//#region src/skills/types.d.ts
|
|
7
|
+
interface SkillMeta {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
whenToUse: string;
|
|
11
|
+
keywords: Array<string>;
|
|
12
|
+
arguments?: Array<string>;
|
|
13
|
+
argumentHint?: string;
|
|
14
|
+
userInvocable?: boolean;
|
|
15
|
+
max: number;
|
|
16
|
+
charCount: number;
|
|
17
|
+
contentHash: string;
|
|
18
|
+
source: string;
|
|
19
|
+
}
|
|
20
|
+
interface SkillsRegistry {
|
|
21
|
+
/** All skill metadata, keyed by name. */
|
|
22
|
+
catalog: ReadonlyMap<string, SkillMeta>;
|
|
23
|
+
/** Render the skill catalog as text for context injection. Fits within budget (chars). */
|
|
24
|
+
renderCatalog: (budget?: number) => string;
|
|
25
|
+
/** Read skill content from disk. Returns null if skill not found. */
|
|
26
|
+
readContent: (name: string) => Promise<string | null>;
|
|
27
|
+
} //#endregion
|
|
6
28
|
//#region src/bootstrap.d.ts
|
|
7
|
-
|
|
8
29
|
declare const DEFAULT_BUILTIN_AGENT_HANDLER_PATH = "/_electric/builtin-agent-handler";
|
|
9
30
|
interface AgentHandlerResult {
|
|
10
31
|
handler: (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
11
32
|
runtime: RuntimeHandler;
|
|
12
33
|
registry: EntityRegistry;
|
|
13
34
|
typeNames: Array<string>;
|
|
35
|
+
skillsRegistry: SkillsRegistry | null;
|
|
14
36
|
}
|
|
15
37
|
interface BuiltinAgentHandlerOptions {
|
|
16
38
|
agentServerUrl: string;
|
|
@@ -50,10 +72,12 @@ interface BuiltinAgentHandlerOptions {
|
|
|
50
72
|
}>;
|
|
51
73
|
}) => Array<AgentTool> | Promise<Array<AgentTool>>;
|
|
52
74
|
}
|
|
53
|
-
declare function createBuiltinAgentHandler(options: BuiltinAgentHandlerOptions): AgentHandlerResult | null
|
|
54
|
-
declare function createAgentHandler(agentServerUrl: string, workingDirectory?: string, streamFn?: StreamFn, createElectricTools?: BuiltinAgentHandlerOptions[`createElectricTools`], serveEndpoint?: string): AgentHandlerResult | null
|
|
75
|
+
declare function createBuiltinAgentHandler(options: BuiltinAgentHandlerOptions): Promise<AgentHandlerResult | null>;
|
|
76
|
+
declare function createAgentHandler(agentServerUrl: string, workingDirectory?: string, streamFn?: StreamFn, createElectricTools?: BuiltinAgentHandlerOptions[`createElectricTools`], serveEndpoint?: string): Promise<AgentHandlerResult | null>;
|
|
55
77
|
declare function registerBuiltinAgentTypes(bootstrap: AgentHandlerResult): Promise<void>;
|
|
56
|
-
declare const registerAgentTypes: typeof registerBuiltinAgentTypes;
|
|
78
|
+
declare const registerAgentTypes: typeof registerBuiltinAgentTypes;
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
57
81
|
//#region src/server.d.ts
|
|
58
82
|
interface BuiltinAgentsServerOptions {
|
|
59
83
|
agentServerUrl: string;
|
|
@@ -140,6 +164,7 @@ declare const HORTON_MODEL = "claude-sonnet-4-5-20250929";
|
|
|
140
164
|
declare function generateTitle(userMessage: string, llmCall?: (prompt: string) => Promise<string>): Promise<string>;
|
|
141
165
|
declare function buildHortonSystemPrompt(workingDirectory: string, opts?: {
|
|
142
166
|
hasDocsSupport?: boolean;
|
|
167
|
+
hasSkills?: boolean;
|
|
143
168
|
}): string;
|
|
144
169
|
declare function createHortonTools(workingDirectory: string, ctx: HandlerContext, readSet: Set<string>, opts?: {
|
|
145
170
|
docsSearchTool?: AgentTool$1;
|
|
@@ -147,6 +172,7 @@ declare function createHortonTools(workingDirectory: string, ctx: HandlerContext
|
|
|
147
172
|
declare function registerHorton(registry: EntityRegistry, options: {
|
|
148
173
|
workingDirectory: string;
|
|
149
174
|
streamFn?: StreamFn;
|
|
175
|
+
skillsRegistry?: SkillsRegistry | null;
|
|
150
176
|
}): Array<string>;
|
|
151
177
|
|
|
152
178
|
//#endregion
|