@electric-ax/agents 0.4.1 → 0.4.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/dist/entrypoint.js +18 -7
- package/dist/index.cjs +8 -7
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -7
- package/dist/server-headers-65vIhxvJ.cjs +25 -0
- package/dist/server-headers-KD5yHFYT.js +12 -0
- package/dist/server-headers.cjs +4 -0
- package/dist/server-headers.d.cts +6 -0
- package/dist/server-headers.d.ts +6 -0
- package/dist/server-headers.js +3 -0
- package/docs/reference/cli.md +2 -0
- package/docs/usage/embedded-builtins.md +2 -0
- package/package.json +12 -2
package/dist/entrypoint.js
CHANGED
|
@@ -885,11 +885,11 @@ function createSpawnWorkerTool(ctx, modelConfig) {
|
|
|
885
885
|
return {
|
|
886
886
|
name: `spawn_worker`,
|
|
887
887
|
label: `Spawn Worker`,
|
|
888
|
-
description: `Dispatch a subagent (worker) to perform an isolated subtask. Provide a system prompt
|
|
888
|
+
description: `Dispatch a subagent (worker) to perform an isolated subtask. Provide a brief system prompt to give it its role and then a detailed initialMessage which briefs the worker like a colleague who just walked into the room (file paths, line numbers, what specifically to do, what form of answer you want back) and pick the subset of tools the worker needs.`,
|
|
889
889
|
parameters: Type.Object({
|
|
890
|
-
systemPrompt: Type.String({ description: `System prompt for the worker
|
|
890
|
+
systemPrompt: Type.String({ description: `System prompt for the worker.` }),
|
|
891
891
|
tools: Type.Array(Type.Union(WORKER_TOOL_NAMES.map((n) => Type.Literal(n))), { description: `Subset of tool names to enable for the worker. Must include at least one.` }),
|
|
892
|
-
initialMessage: Type.String({ description: `First user message sent to the worker. This is what kicks off its run — without it the worker will idle. Describe the concrete task to perform.` })
|
|
892
|
+
initialMessage: Type.String({ description: `First user message sent to the worker. Be concrete: include file paths, line numbers, and the form of answer you want back. This is what kicks off its run — without it the worker will idle. Describe the concrete task to perform and what form of message you want back.` })
|
|
893
893
|
}),
|
|
894
894
|
execute: async (_toolCallId, params) => {
|
|
895
895
|
const { systemPrompt, tools, initialMessage } = params;
|
|
@@ -1943,7 +1943,7 @@ async function createBuiltinAgentHandler(options) {
|
|
|
1943
1943
|
subscriptionPathForType: (name) => `/${name}/*/main`,
|
|
1944
1944
|
defaultDispatchPolicyForType,
|
|
1945
1945
|
serverHeaders,
|
|
1946
|
-
idleTimeout:
|
|
1946
|
+
idleTimeout: 5 * 6e4,
|
|
1947
1947
|
createElectricTools,
|
|
1948
1948
|
publicUrl,
|
|
1949
1949
|
name: runtimeName ?? `builtin-agents`
|
|
@@ -2113,11 +2113,11 @@ var BuiltinAgentsServer = class {
|
|
|
2113
2113
|
claimHeaders: pullWake.claimHeaders,
|
|
2114
2114
|
claimTokenHeader: pullWake.claimTokenHeader,
|
|
2115
2115
|
heartbeatIntervalMs: pullWake.heartbeatIntervalMs,
|
|
2116
|
+
eventHeartbeatThrottleMs: pullWake.eventHeartbeatThrottleMs,
|
|
2116
2117
|
leaseMs: pullWake.leaseMs,
|
|
2117
2118
|
offset: registeredRunner?.wake_stream_offset,
|
|
2118
2119
|
onError: (error) => {
|
|
2119
2120
|
serverLog.error(`[builtin-agents] pull-wake runner failed`, error);
|
|
2120
|
-
return true;
|
|
2121
2121
|
}
|
|
2122
2122
|
});
|
|
2123
2123
|
this.pullWakeRunner.start();
|
|
@@ -2172,7 +2172,7 @@ var BuiltinAgentsServer = class {
|
|
|
2172
2172
|
headers,
|
|
2173
2173
|
body: JSON.stringify({
|
|
2174
2174
|
id: pullWake.runnerId,
|
|
2175
|
-
|
|
2175
|
+
owner_principal: pullWake.ownerPrincipal,
|
|
2176
2176
|
label: pullWake.label ?? `Built-in agents`,
|
|
2177
2177
|
kind: `local`,
|
|
2178
2178
|
admin_status: `enabled`
|
|
@@ -2183,6 +2183,17 @@ var BuiltinAgentsServer = class {
|
|
|
2183
2183
|
}
|
|
2184
2184
|
};
|
|
2185
2185
|
|
|
2186
|
+
//#endregion
|
|
2187
|
+
//#region src/server-headers.ts
|
|
2188
|
+
const ELECTRIC_PRINCIPAL_HEADER = `electric-principal`;
|
|
2189
|
+
function mergeElectricPrincipalHeader(headers, principal) {
|
|
2190
|
+
const merged = new Headers(headers);
|
|
2191
|
+
const trimmedPrincipal = principal?.trim();
|
|
2192
|
+
if (trimmedPrincipal !== void 0 && trimmedPrincipal.length > 0) merged.set(ELECTRIC_PRINCIPAL_HEADER, trimmedPrincipal);
|
|
2193
|
+
const normalized = Object.fromEntries(merged.entries());
|
|
2194
|
+
return Object.keys(normalized).length > 0 ? normalized : void 0;
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2186
2197
|
//#endregion
|
|
2187
2198
|
//#region src/entrypoint-lib.ts
|
|
2188
2199
|
function readEnv(env, names) {
|
|
@@ -2238,7 +2249,7 @@ function hasHeader(headers, name) {
|
|
|
2238
2249
|
function resolveBuiltinAgentsEntrypointOptions(env = process.env, cwd = process.cwd()) {
|
|
2239
2250
|
const agentServerUrl = validateUrl(`agent server URL`, readRequiredEnv(env, [`ELECTRIC_AGENTS_SERVER_URL`, `ELECTRIC_AGENTS_BASE_URL`], `agent server base URL`));
|
|
2240
2251
|
const runnerId = readRequiredEnv(env, [`ELECTRIC_AGENTS_PULL_WAKE_RUNNER_ID`, `PULL_WAKE_RUNNER_ID`], `pull-wake runner id`);
|
|
2241
|
-
const serverHeaders = mergeHeaders(parseAdditionalServerHeaders(env));
|
|
2252
|
+
const serverHeaders = mergeHeaders(mergeElectricPrincipalHeader(parseAdditionalServerHeaders(env), readEnv(env, [`ELECTRIC_AGENTS_PRINCIPAL`])));
|
|
2242
2253
|
return {
|
|
2243
2254
|
agentServerUrl,
|
|
2244
2255
|
workingDirectory: readEnv(env, [`ELECTRIC_AGENTS_WORKING_DIRECTORY`, `WORKING_DIRECTORY`]) ?? cwd,
|
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
}) : target, mod));
|
|
23
23
|
|
|
24
24
|
//#endregion
|
|
25
|
+
const require_server_headers = require('./server-headers-65vIhxvJ.cjs');
|
|
25
26
|
const node_path = __toESM(require("node:path"));
|
|
26
27
|
const node_url = __toESM(require("node:url"));
|
|
27
28
|
const __electric_ax_agents_runtime = __toESM(require("@electric-ax/agents-runtime"));
|
|
@@ -908,11 +909,11 @@ function createSpawnWorkerTool(ctx, modelConfig) {
|
|
|
908
909
|
return {
|
|
909
910
|
name: `spawn_worker`,
|
|
910
911
|
label: `Spawn Worker`,
|
|
911
|
-
description: `Dispatch a subagent (worker) to perform an isolated subtask. Provide a system prompt
|
|
912
|
+
description: `Dispatch a subagent (worker) to perform an isolated subtask. Provide a brief system prompt to give it its role and then a detailed initialMessage which briefs the worker like a colleague who just walked into the room (file paths, line numbers, what specifically to do, what form of answer you want back) and pick the subset of tools the worker needs.`,
|
|
912
913
|
parameters: __sinclair_typebox.Type.Object({
|
|
913
|
-
systemPrompt: __sinclair_typebox.Type.String({ description: `System prompt for the worker
|
|
914
|
+
systemPrompt: __sinclair_typebox.Type.String({ description: `System prompt for the worker.` }),
|
|
914
915
|
tools: __sinclair_typebox.Type.Array(__sinclair_typebox.Type.Union(WORKER_TOOL_NAMES.map((n) => __sinclair_typebox.Type.Literal(n))), { description: `Subset of tool names to enable for the worker. Must include at least one.` }),
|
|
915
|
-
initialMessage: __sinclair_typebox.Type.String({ description: `First user message sent to the worker. This is what kicks off its run — without it the worker will idle. Describe the concrete task to perform.` })
|
|
916
|
+
initialMessage: __sinclair_typebox.Type.String({ description: `First user message sent to the worker. Be concrete: include file paths, line numbers, and the form of answer you want back. This is what kicks off its run — without it the worker will idle. Describe the concrete task to perform and what form of message you want back.` })
|
|
916
917
|
}),
|
|
917
918
|
execute: async (_toolCallId, params) => {
|
|
918
919
|
const { systemPrompt, tools, initialMessage } = params;
|
|
@@ -1968,7 +1969,7 @@ async function createBuiltinAgentHandler(options) {
|
|
|
1968
1969
|
subscriptionPathForType: (name) => `/${name}/*/main`,
|
|
1969
1970
|
defaultDispatchPolicyForType,
|
|
1970
1971
|
serverHeaders,
|
|
1971
|
-
idleTimeout:
|
|
1972
|
+
idleTimeout: 5 * 6e4,
|
|
1972
1973
|
createElectricTools,
|
|
1973
1974
|
publicUrl,
|
|
1974
1975
|
name: runtimeName ?? `builtin-agents`
|
|
@@ -2148,11 +2149,11 @@ var BuiltinAgentsServer = class {
|
|
|
2148
2149
|
claimHeaders: pullWake.claimHeaders,
|
|
2149
2150
|
claimTokenHeader: pullWake.claimTokenHeader,
|
|
2150
2151
|
heartbeatIntervalMs: pullWake.heartbeatIntervalMs,
|
|
2152
|
+
eventHeartbeatThrottleMs: pullWake.eventHeartbeatThrottleMs,
|
|
2151
2153
|
leaseMs: pullWake.leaseMs,
|
|
2152
2154
|
offset: registeredRunner?.wake_stream_offset,
|
|
2153
2155
|
onError: (error) => {
|
|
2154
2156
|
serverLog.error(`[builtin-agents] pull-wake runner failed`, error);
|
|
2155
|
-
return true;
|
|
2156
2157
|
}
|
|
2157
2158
|
});
|
|
2158
2159
|
this.pullWakeRunner.start();
|
|
@@ -2207,7 +2208,7 @@ var BuiltinAgentsServer = class {
|
|
|
2207
2208
|
headers,
|
|
2208
2209
|
body: JSON.stringify({
|
|
2209
2210
|
id: pullWake.runnerId,
|
|
2210
|
-
|
|
2211
|
+
owner_principal: pullWake.ownerPrincipal,
|
|
2211
2212
|
label: pullWake.label ?? `Built-in agents`,
|
|
2212
2213
|
kind: `local`,
|
|
2213
2214
|
admin_status: `enabled`
|
|
@@ -2273,7 +2274,7 @@ function hasHeader(headers, name) {
|
|
|
2273
2274
|
function resolveBuiltinAgentsEntrypointOptions(env = process.env, cwd = process.cwd()) {
|
|
2274
2275
|
const agentServerUrl = validateUrl(`agent server URL`, readRequiredEnv(env, [`ELECTRIC_AGENTS_SERVER_URL`, `ELECTRIC_AGENTS_BASE_URL`], `agent server base URL`));
|
|
2275
2276
|
const runnerId = readRequiredEnv(env, [`ELECTRIC_AGENTS_PULL_WAKE_RUNNER_ID`, `PULL_WAKE_RUNNER_ID`], `pull-wake runner id`);
|
|
2276
|
-
const serverHeaders = mergeHeaders(parseAdditionalServerHeaders(env));
|
|
2277
|
+
const serverHeaders = mergeHeaders(require_server_headers.mergeElectricPrincipalHeader(parseAdditionalServerHeaders(env), readEnv(env, [`ELECTRIC_AGENTS_PRINCIPAL`])));
|
|
2277
2278
|
return {
|
|
2278
2279
|
agentServerUrl,
|
|
2279
2280
|
workingDirectory: readEnv(env, [`ELECTRIC_AGENTS_WORKING_DIRECTORY`, `WORKING_DIRECTORY`]) ?? cwd,
|
package/dist/index.d.cts
CHANGED
|
@@ -94,13 +94,14 @@ interface BuiltinAgentsServerOptions {
|
|
|
94
94
|
/** Pull-wake runner configuration for built-in agents. */
|
|
95
95
|
pullWake: {
|
|
96
96
|
runnerId: string;
|
|
97
|
-
|
|
97
|
+
ownerPrincipal?: string;
|
|
98
98
|
label?: string;
|
|
99
99
|
registerRunner?: boolean;
|
|
100
100
|
headers?: PullWakeRunnerConfig[`headers`];
|
|
101
101
|
claimHeaders?: PullWakeRunnerConfig[`claimHeaders`];
|
|
102
102
|
claimTokenHeader?: PullWakeRunnerConfig[`claimTokenHeader`];
|
|
103
103
|
heartbeatIntervalMs?: PullWakeRunnerConfig[`heartbeatIntervalMs`];
|
|
104
|
+
eventHeartbeatThrottleMs?: PullWakeRunnerConfig[`eventHeartbeatThrottleMs`];
|
|
104
105
|
leaseMs?: PullWakeRunnerConfig[`leaseMs`];
|
|
105
106
|
};
|
|
106
107
|
/** Invoked when an `authorizationCode` server needs user consent. */
|
package/dist/index.d.ts
CHANGED
|
@@ -94,13 +94,14 @@ interface BuiltinAgentsServerOptions {
|
|
|
94
94
|
/** Pull-wake runner configuration for built-in agents. */
|
|
95
95
|
pullWake: {
|
|
96
96
|
runnerId: string;
|
|
97
|
-
|
|
97
|
+
ownerPrincipal?: string;
|
|
98
98
|
label?: string;
|
|
99
99
|
registerRunner?: boolean;
|
|
100
100
|
headers?: PullWakeRunnerConfig[`headers`];
|
|
101
101
|
claimHeaders?: PullWakeRunnerConfig[`claimHeaders`];
|
|
102
102
|
claimTokenHeader?: PullWakeRunnerConfig[`claimTokenHeader`];
|
|
103
103
|
heartbeatIntervalMs?: PullWakeRunnerConfig[`heartbeatIntervalMs`];
|
|
104
|
+
eventHeartbeatThrottleMs?: PullWakeRunnerConfig[`eventHeartbeatThrottleMs`];
|
|
104
105
|
leaseMs?: PullWakeRunnerConfig[`leaseMs`];
|
|
105
106
|
};
|
|
106
107
|
/** Invoked when an `authorizationCode` server needs user consent. */
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mergeElectricPrincipalHeader } from "./server-headers-KD5yHFYT.js";
|
|
1
2
|
import path from "node:path";
|
|
2
3
|
import { fileURLToPath } from "node:url";
|
|
3
4
|
import { appendPathToUrl, completeWithLowCostModel, createEntityRegistry, createPullWakeRunner, createRuntimeHandler, db, detectAvailableProviders, readCodexAccessToken, registerToolProvider, unregisterToolProvider } from "@electric-ax/agents-runtime";
|
|
@@ -884,11 +885,11 @@ function createSpawnWorkerTool(ctx, modelConfig) {
|
|
|
884
885
|
return {
|
|
885
886
|
name: `spawn_worker`,
|
|
886
887
|
label: `Spawn Worker`,
|
|
887
|
-
description: `Dispatch a subagent (worker) to perform an isolated subtask. Provide a system prompt
|
|
888
|
+
description: `Dispatch a subagent (worker) to perform an isolated subtask. Provide a brief system prompt to give it its role and then a detailed initialMessage which briefs the worker like a colleague who just walked into the room (file paths, line numbers, what specifically to do, what form of answer you want back) and pick the subset of tools the worker needs.`,
|
|
888
889
|
parameters: Type.Object({
|
|
889
|
-
systemPrompt: Type.String({ description: `System prompt for the worker
|
|
890
|
+
systemPrompt: Type.String({ description: `System prompt for the worker.` }),
|
|
890
891
|
tools: Type.Array(Type.Union(WORKER_TOOL_NAMES.map((n) => Type.Literal(n))), { description: `Subset of tool names to enable for the worker. Must include at least one.` }),
|
|
891
|
-
initialMessage: Type.String({ description: `First user message sent to the worker. This is what kicks off its run — without it the worker will idle. Describe the concrete task to perform.` })
|
|
892
|
+
initialMessage: Type.String({ description: `First user message sent to the worker. Be concrete: include file paths, line numbers, and the form of answer you want back. This is what kicks off its run — without it the worker will idle. Describe the concrete task to perform and what form of message you want back.` })
|
|
892
893
|
}),
|
|
893
894
|
execute: async (_toolCallId, params) => {
|
|
894
895
|
const { systemPrompt, tools, initialMessage } = params;
|
|
@@ -1944,7 +1945,7 @@ async function createBuiltinAgentHandler(options) {
|
|
|
1944
1945
|
subscriptionPathForType: (name) => `/${name}/*/main`,
|
|
1945
1946
|
defaultDispatchPolicyForType,
|
|
1946
1947
|
serverHeaders,
|
|
1947
|
-
idleTimeout:
|
|
1948
|
+
idleTimeout: 5 * 6e4,
|
|
1948
1949
|
createElectricTools,
|
|
1949
1950
|
publicUrl,
|
|
1950
1951
|
name: runtimeName ?? `builtin-agents`
|
|
@@ -2124,11 +2125,11 @@ var BuiltinAgentsServer = class {
|
|
|
2124
2125
|
claimHeaders: pullWake.claimHeaders,
|
|
2125
2126
|
claimTokenHeader: pullWake.claimTokenHeader,
|
|
2126
2127
|
heartbeatIntervalMs: pullWake.heartbeatIntervalMs,
|
|
2128
|
+
eventHeartbeatThrottleMs: pullWake.eventHeartbeatThrottleMs,
|
|
2127
2129
|
leaseMs: pullWake.leaseMs,
|
|
2128
2130
|
offset: registeredRunner?.wake_stream_offset,
|
|
2129
2131
|
onError: (error) => {
|
|
2130
2132
|
serverLog.error(`[builtin-agents] pull-wake runner failed`, error);
|
|
2131
|
-
return true;
|
|
2132
2133
|
}
|
|
2133
2134
|
});
|
|
2134
2135
|
this.pullWakeRunner.start();
|
|
@@ -2183,7 +2184,7 @@ var BuiltinAgentsServer = class {
|
|
|
2183
2184
|
headers,
|
|
2184
2185
|
body: JSON.stringify({
|
|
2185
2186
|
id: pullWake.runnerId,
|
|
2186
|
-
|
|
2187
|
+
owner_principal: pullWake.ownerPrincipal,
|
|
2187
2188
|
label: pullWake.label ?? `Built-in agents`,
|
|
2188
2189
|
kind: `local`,
|
|
2189
2190
|
admin_status: `enabled`
|
|
@@ -2249,7 +2250,7 @@ function hasHeader(headers, name) {
|
|
|
2249
2250
|
function resolveBuiltinAgentsEntrypointOptions(env = process.env, cwd = process.cwd()) {
|
|
2250
2251
|
const agentServerUrl = validateUrl(`agent server URL`, readRequiredEnv(env, [`ELECTRIC_AGENTS_SERVER_URL`, `ELECTRIC_AGENTS_BASE_URL`], `agent server base URL`));
|
|
2251
2252
|
const runnerId = readRequiredEnv(env, [`ELECTRIC_AGENTS_PULL_WAKE_RUNNER_ID`, `PULL_WAKE_RUNNER_ID`], `pull-wake runner id`);
|
|
2252
|
-
const serverHeaders = mergeHeaders(parseAdditionalServerHeaders(env));
|
|
2253
|
+
const serverHeaders = mergeHeaders(mergeElectricPrincipalHeader(parseAdditionalServerHeaders(env), readEnv(env, [`ELECTRIC_AGENTS_PRINCIPAL`])));
|
|
2253
2254
|
return {
|
|
2254
2255
|
agentServerUrl,
|
|
2255
2256
|
workingDirectory: readEnv(env, [`ELECTRIC_AGENTS_WORKING_DIRECTORY`, `WORKING_DIRECTORY`]) ?? cwd,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
//#region src/server-headers.ts
|
|
4
|
+
const ELECTRIC_PRINCIPAL_HEADER = `electric-principal`;
|
|
5
|
+
function mergeElectricPrincipalHeader(headers, principal) {
|
|
6
|
+
const merged = new Headers(headers);
|
|
7
|
+
const trimmedPrincipal = principal?.trim();
|
|
8
|
+
if (trimmedPrincipal !== void 0 && trimmedPrincipal.length > 0) merged.set(ELECTRIC_PRINCIPAL_HEADER, trimmedPrincipal);
|
|
9
|
+
const normalized = Object.fromEntries(merged.entries());
|
|
10
|
+
return Object.keys(normalized).length > 0 ? normalized : void 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
Object.defineProperty(exports, 'ELECTRIC_PRINCIPAL_HEADER', {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () {
|
|
17
|
+
return ELECTRIC_PRINCIPAL_HEADER;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, 'mergeElectricPrincipalHeader', {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () {
|
|
23
|
+
return mergeElectricPrincipalHeader;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/server-headers.ts
|
|
2
|
+
const ELECTRIC_PRINCIPAL_HEADER = `electric-principal`;
|
|
3
|
+
function mergeElectricPrincipalHeader(headers, principal) {
|
|
4
|
+
const merged = new Headers(headers);
|
|
5
|
+
const trimmedPrincipal = principal?.trim();
|
|
6
|
+
if (trimmedPrincipal !== void 0 && trimmedPrincipal.length > 0) merged.set(ELECTRIC_PRINCIPAL_HEADER, trimmedPrincipal);
|
|
7
|
+
const normalized = Object.fromEntries(merged.entries());
|
|
8
|
+
return Object.keys(normalized).length > 0 ? normalized : void 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ELECTRIC_PRINCIPAL_HEADER, mergeElectricPrincipalHeader };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/server-headers.d.ts
|
|
2
|
+
declare const ELECTRIC_PRINCIPAL_HEADER = "electric-principal";
|
|
3
|
+
declare function mergeElectricPrincipalHeader(headers: HeadersInit | undefined, principal: string | undefined): Record<string, string> | undefined;
|
|
4
|
+
|
|
5
|
+
//#endregion
|
|
6
|
+
export { ELECTRIC_PRINCIPAL_HEADER, mergeElectricPrincipalHeader };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/server-headers.d.ts
|
|
2
|
+
declare const ELECTRIC_PRINCIPAL_HEADER = "electric-principal";
|
|
3
|
+
declare function mergeElectricPrincipalHeader(headers: HeadersInit | undefined, principal: string | undefined): Record<string, string> | undefined;
|
|
4
|
+
|
|
5
|
+
//#endregion
|
|
6
|
+
export { ELECTRIC_PRINCIPAL_HEADER, mergeElectricPrincipalHeader };
|
package/docs/reference/cli.md
CHANGED
|
@@ -20,6 +20,8 @@ npm install -g electric-ax
|
|
|
20
20
|
| -------------------------------- | ----------------------- | -------------------------------------------- |
|
|
21
21
|
| `ELECTRIC_AGENTS_URL` | `http://localhost:4437` | Server URL for entity commands and built-ins |
|
|
22
22
|
| `ELECTRIC_AGENTS_IDENTITY` | `user@hostname` | Sender identity for messages |
|
|
23
|
+
| `ELECTRIC_AGENTS_PRINCIPAL` | - | Optional principal key sent as `Electric-Principal` |
|
|
24
|
+
| `ELECTRIC_AGENTS_SERVER_HEADERS` | - | Optional JSON object of additional server headers |
|
|
23
25
|
| `ELECTRIC_AGENTS_PORT` | `4437` | Port used by `start` / `quickstart` |
|
|
24
26
|
| `ELECTRIC_AGENTS_BUILTIN_PORT` | `4448` | Webhook port for `start-builtin` |
|
|
25
27
|
| `ELECTRIC_AGENTS_COMPOSE_PROJECT` | `electric-agents` | Docker Compose project name |
|
|
@@ -168,6 +168,8 @@ Environment variables:
|
|
|
168
168
|
| Variable | Description |
|
|
169
169
|
| -------------------------------- | ----------------------------------------------------- |
|
|
170
170
|
| `ELECTRIC_AGENTS_SERVER_URL` | Required coordinator server URL. |
|
|
171
|
+
| `ELECTRIC_AGENTS_PRINCIPAL` | Optional principal key sent as `Electric-Principal`. |
|
|
172
|
+
| `ELECTRIC_AGENTS_SERVER_HEADERS` | Optional JSON object of additional server headers. |
|
|
171
173
|
| `ELECTRIC_AGENTS_BUILTIN_BASE_URL` | Public webhook base URL for the built-in server. |
|
|
172
174
|
| `ELECTRIC_AGENTS_BUILTIN_HOST` | Bind host. |
|
|
173
175
|
| `ELECTRIC_AGENTS_BUILTIN_PORT` | Built-in server port. Defaults to `4448`. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@electric-ax/agents",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Built-in Electric Agents runtimes such as Horton and worker",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,6 +25,16 @@
|
|
|
25
25
|
"default": "./dist/index.cjs"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
+
"./server-headers": {
|
|
29
|
+
"import": {
|
|
30
|
+
"types": "./dist/server-headers.d.ts",
|
|
31
|
+
"default": "./dist/server-headers.js"
|
|
32
|
+
},
|
|
33
|
+
"require": {
|
|
34
|
+
"types": "./dist/server-headers.d.cts",
|
|
35
|
+
"default": "./dist/server-headers.cjs"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
28
38
|
"./package.json": "./package.json"
|
|
29
39
|
},
|
|
30
40
|
"dependencies": {
|
|
@@ -39,7 +49,7 @@
|
|
|
39
49
|
"sqlite-vec": "^0.1.9",
|
|
40
50
|
"zod": "^4.3.6",
|
|
41
51
|
"@electric-ax/agents-mcp": "0.2.2",
|
|
42
|
-
"@electric-ax/agents-runtime": "0.2.
|
|
52
|
+
"@electric-ax/agents-runtime": "0.2.2"
|
|
43
53
|
},
|
|
44
54
|
"devDependencies": {
|
|
45
55
|
"@types/better-sqlite3": "^7.6.13",
|