electric-ax 0.1.16 → 0.1.18
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/completions.d.cts +1 -1
- package/dist/completions.d.ts +1 -1
- package/dist/{index-Dgoj3VzA.d.cts → index-B2MsxFCW.d.cts} +2 -1
- package/dist/{index-si6k6XW1.d.ts → index-BDO8dHhT.d.ts} +2 -1
- package/dist/index.cjs +9 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -4
- package/dist/observe-ui.cjs +26 -0
- package/dist/observe-ui.js +26 -0
- package/dist/start.cjs +9 -1
- package/dist/start.d.cts +2 -2
- package/dist/start.d.ts +2 -2
- package/dist/start.js +9 -2
- package/package.json +4 -4
package/dist/completions.d.cts
CHANGED
package/dist/completions.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ interface WaitForServerOptions {
|
|
|
30
30
|
intervalMs?: number;
|
|
31
31
|
}
|
|
32
32
|
declare function resolveBuiltinAgentsPort(env?: NodeJS.ProcessEnv, fileEnv?: Record<string, string>): number;
|
|
33
|
+
declare function resolveBuiltinAgentsHost(env?: NodeJS.ProcessEnv, fileEnv?: Record<string, string>): string;
|
|
33
34
|
declare function resolveElectricAgentsPort(env?: NodeJS.ProcessEnv, fileEnv?: Record<string, string>): number;
|
|
34
35
|
declare function getStartedEnvironmentMessage(started: StartedDevEnvironment): string;
|
|
35
36
|
declare function getStoppedEnvironmentMessage(stopped: StoppedDevEnvironment): string;
|
|
@@ -123,4 +124,4 @@ declare function createElectricProgram({
|
|
|
123
124
|
declare function run(argv?: Array<string>): Promise<void>;
|
|
124
125
|
|
|
125
126
|
//#endregion
|
|
126
|
-
export { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, formatQuickstartBackendStartedMessage, getElectricCliEnv, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsPort, resolveCommandPrefix, resolveComposeProjectName, resolveElectricAgentsPort, run, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer };
|
|
127
|
+
export { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, formatQuickstartBackendStartedMessage, getElectricCliEnv, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsHost, resolveBuiltinAgentsPort, resolveCommandPrefix, resolveComposeProjectName, resolveElectricAgentsPort, run, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer };
|
|
@@ -30,6 +30,7 @@ interface WaitForServerOptions {
|
|
|
30
30
|
intervalMs?: number;
|
|
31
31
|
}
|
|
32
32
|
declare function resolveBuiltinAgentsPort(env?: NodeJS.ProcessEnv, fileEnv?: Record<string, string>): number;
|
|
33
|
+
declare function resolveBuiltinAgentsHost(env?: NodeJS.ProcessEnv, fileEnv?: Record<string, string>): string;
|
|
33
34
|
declare function resolveElectricAgentsPort(env?: NodeJS.ProcessEnv, fileEnv?: Record<string, string>): number;
|
|
34
35
|
declare function getStartedEnvironmentMessage(started: StartedDevEnvironment): string;
|
|
35
36
|
declare function getStoppedEnvironmentMessage(stopped: StoppedDevEnvironment): string;
|
|
@@ -123,4 +124,4 @@ declare function createElectricProgram({
|
|
|
123
124
|
declare function run(argv?: Array<string>): Promise<void>;
|
|
124
125
|
|
|
125
126
|
//#endregion
|
|
126
|
-
export { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, formatQuickstartBackendStartedMessage, getElectricCliEnv, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsPort, resolveCommandPrefix, resolveComposeProjectName, resolveElectricAgentsPort, run, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer };
|
|
127
|
+
export { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, formatQuickstartBackendStartedMessage, getElectricCliEnv, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsHost, resolveBuiltinAgentsPort, resolveCommandPrefix, resolveComposeProjectName, resolveElectricAgentsPort, run, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer };
|
package/dist/index.cjs
CHANGED
|
@@ -67,11 +67,16 @@ async function ensureAnthropicApiKey(options, io = defaultPromptIO()) {
|
|
|
67
67
|
await validate(explicitKey);
|
|
68
68
|
return explicitKey;
|
|
69
69
|
}
|
|
70
|
+
let resolvedKey;
|
|
70
71
|
try {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
resolvedKey = require_env.resolveAnthropicApiKey(options);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
if (!io.isTTY) throw error;
|
|
75
|
+
}
|
|
76
|
+
if (resolvedKey !== void 0) try {
|
|
77
|
+
assertAnthropicApiKeyPrefix(resolvedKey);
|
|
78
|
+
await validate(resolvedKey);
|
|
79
|
+
return resolvedKey;
|
|
75
80
|
} catch (error) {
|
|
76
81
|
if (!io.isTTY) throw error;
|
|
77
82
|
initialError = error;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, formatQuickstartBackendStartedMessage, getElectricCliEnv, resolveCommandPrefix, run } from "./index-
|
|
2
|
+
import { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, formatQuickstartBackendStartedMessage, getElectricCliEnv, resolveCommandPrefix, run } from "./index-B2MsxFCW.cjs";
|
|
3
3
|
export { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, formatQuickstartBackendStartedMessage, getElectricCliEnv, resolveCommandPrefix, run };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, formatQuickstartBackendStartedMessage, getElectricCliEnv, resolveCommandPrefix, run } from "./index-
|
|
2
|
+
import { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, formatQuickstartBackendStartedMessage, getElectricCliEnv, resolveCommandPrefix, run } from "./index-BDO8dHhT.js";
|
|
3
3
|
export { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, formatQuickstartBackendStartedMessage, getElectricCliEnv, resolveCommandPrefix, run };
|
package/dist/index.js
CHANGED
|
@@ -65,11 +65,16 @@ async function ensureAnthropicApiKey(options, io = defaultPromptIO()) {
|
|
|
65
65
|
await validate(explicitKey);
|
|
66
66
|
return explicitKey;
|
|
67
67
|
}
|
|
68
|
+
let resolvedKey;
|
|
68
69
|
try {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
resolvedKey = resolveAnthropicApiKey(options);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
if (!io.isTTY) throw error;
|
|
73
|
+
}
|
|
74
|
+
if (resolvedKey !== void 0) try {
|
|
75
|
+
assertAnthropicApiKeyPrefix(resolvedKey);
|
|
76
|
+
await validate(resolvedKey);
|
|
77
|
+
return resolvedKey;
|
|
73
78
|
} catch (error) {
|
|
74
79
|
if (!io.isTTY) throw error;
|
|
75
80
|
initialError = error;
|
package/dist/observe-ui.cjs
CHANGED
|
@@ -231,6 +231,31 @@ function AgentResponseView({ section, label, isStreaming }) {
|
|
|
231
231
|
]
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
|
+
function wakeReason(section) {
|
|
235
|
+
const { payload } = section;
|
|
236
|
+
if (payload.timeout) return `timeout`;
|
|
237
|
+
if (payload.finished_child) return `child ${payload.finished_child.run_status}`;
|
|
238
|
+
if (payload.changes.length > 0) return `${payload.changes.length} ${payload.changes.length === 1 ? `change` : `changes`}`;
|
|
239
|
+
if (payload.other_children && payload.other_children.length > 0) return `${payload.other_children.length} child ${payload.other_children.length === 1 ? `update` : `updates`}`;
|
|
240
|
+
return payload.source;
|
|
241
|
+
}
|
|
242
|
+
function WakeView({ section }) {
|
|
243
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ink.Box, {
|
|
244
|
+
flexDirection: "column",
|
|
245
|
+
marginTop: 1,
|
|
246
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ink.Text, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ink.Text, {
|
|
247
|
+
bold: true,
|
|
248
|
+
color: "magenta",
|
|
249
|
+
children: `┌ wake`
|
|
250
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ink.Text, {
|
|
251
|
+
dimColor: true,
|
|
252
|
+
children: ` ${formatTime(new Date(section.timestamp).toISOString())}`
|
|
253
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ink.Text, {
|
|
254
|
+
dimColor: true,
|
|
255
|
+
children: `│ ${wakeReason(section)} from ${section.payload.source}`
|
|
256
|
+
})]
|
|
257
|
+
});
|
|
258
|
+
}
|
|
234
259
|
function ObserveView({ db, entityUrl, baseUrl, identity }) {
|
|
235
260
|
const timelineQuery = (0, react.useMemo)(() => (0, __electric_ax_agents_runtime.createEntityIncludesQuery)(db), [db]);
|
|
236
261
|
const { data: timelineRows = [] } = (0, __tanstack_react_db.useLiveQuery)(timelineQuery, [timelineQuery]);
|
|
@@ -276,6 +301,7 @@ function ObserveView({ db, entityUrl, baseUrl, identity }) {
|
|
|
276
301
|
payload: { text: section.text },
|
|
277
302
|
timestamp: new Date(section.timestamp).toISOString()
|
|
278
303
|
} }, `msg-${i}`);
|
|
304
|
+
if (section.kind === `wake`) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WakeView, { section }, `wake-${i}`);
|
|
279
305
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AgentResponseView, {
|
|
280
306
|
section,
|
|
281
307
|
label: entityUrl,
|
package/dist/observe-ui.js
CHANGED
|
@@ -229,6 +229,31 @@ function AgentResponseView({ section, label, isStreaming }) {
|
|
|
229
229
|
]
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
|
+
function wakeReason(section) {
|
|
233
|
+
const { payload } = section;
|
|
234
|
+
if (payload.timeout) return `timeout`;
|
|
235
|
+
if (payload.finished_child) return `child ${payload.finished_child.run_status}`;
|
|
236
|
+
if (payload.changes.length > 0) return `${payload.changes.length} ${payload.changes.length === 1 ? `change` : `changes`}`;
|
|
237
|
+
if (payload.other_children && payload.other_children.length > 0) return `${payload.other_children.length} child ${payload.other_children.length === 1 ? `update` : `updates`}`;
|
|
238
|
+
return payload.source;
|
|
239
|
+
}
|
|
240
|
+
function WakeView({ section }) {
|
|
241
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
242
|
+
flexDirection: "column",
|
|
243
|
+
marginTop: 1,
|
|
244
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [/* @__PURE__ */ jsx(Text, {
|
|
245
|
+
bold: true,
|
|
246
|
+
color: "magenta",
|
|
247
|
+
children: `┌ wake`
|
|
248
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
249
|
+
dimColor: true,
|
|
250
|
+
children: ` ${formatTime(new Date(section.timestamp).toISOString())}`
|
|
251
|
+
})] }), /* @__PURE__ */ jsx(Text, {
|
|
252
|
+
dimColor: true,
|
|
253
|
+
children: `│ ${wakeReason(section)} from ${section.payload.source}`
|
|
254
|
+
})]
|
|
255
|
+
});
|
|
256
|
+
}
|
|
232
257
|
function ObserveView({ db, entityUrl, baseUrl, identity }) {
|
|
233
258
|
const timelineQuery = useMemo(() => createEntityIncludesQuery(db), [db]);
|
|
234
259
|
const { data: timelineRows = [] } = useLiveQuery(timelineQuery, [timelineQuery]);
|
|
@@ -274,6 +299,7 @@ function ObserveView({ db, entityUrl, baseUrl, identity }) {
|
|
|
274
299
|
payload: { text: section.text },
|
|
275
300
|
timestamp: new Date(section.timestamp).toISOString()
|
|
276
301
|
} }, `msg-${i}`);
|
|
302
|
+
if (section.kind === `wake`) return /* @__PURE__ */ jsx(WakeView, { section }, `wake-${i}`);
|
|
277
303
|
return /* @__PURE__ */ jsx(AgentResponseView, {
|
|
278
304
|
section,
|
|
279
305
|
label: entityUrl,
|
package/dist/start.cjs
CHANGED
|
@@ -20,6 +20,7 @@ const ELECTRIC_AGENTS_SERVER_IMAGE_TAG = `latest`;
|
|
|
20
20
|
//#region src/start.ts
|
|
21
21
|
const DEFAULT_ELECTRIC_AGENTS_PORT = 4437;
|
|
22
22
|
const DEFAULT_BUILTIN_AGENTS_PORT = 4448;
|
|
23
|
+
const DEFAULT_BUILTIN_AGENTS_HOST = `0.0.0.0`;
|
|
23
24
|
const DEFAULT_COMPOSE_PROJECT_NAME = `electric-agents`;
|
|
24
25
|
const DOCKER_COMPOSE_FILE = (0, node_url.fileURLToPath)(new URL(`../docker-compose.full.yml`, require("url").pathToFileURL(__filename).href));
|
|
25
26
|
function resolveBuiltinAgentsPort(env = process.env, fileEnv = require_env.readDotEnvFile()) {
|
|
@@ -28,6 +29,9 @@ function resolveBuiltinAgentsPort(env = process.env, fileEnv = require_env.readD
|
|
|
28
29
|
if (!Number.isInteger(parsed) || parsed <= 0) throw new Error(`ELECTRIC_AGENTS_BUILTIN_PORT must be a positive integer`);
|
|
29
30
|
return parsed;
|
|
30
31
|
}
|
|
32
|
+
function resolveBuiltinAgentsHost(env = process.env, fileEnv = require_env.readDotEnvFile()) {
|
|
33
|
+
return env.ELECTRIC_AGENTS_BUILTIN_HOST?.trim() || fileEnv.ELECTRIC_AGENTS_BUILTIN_HOST?.trim() || DEFAULT_BUILTIN_AGENTS_HOST;
|
|
34
|
+
}
|
|
31
35
|
function resolveElectricAgentsPort(env = process.env, fileEnv = require_env.readDotEnvFile()) {
|
|
32
36
|
const raw = env.ELECTRIC_AGENTS_PORT?.trim() || fileEnv.ELECTRIC_AGENTS_PORT?.trim();
|
|
33
37
|
const parsed = raw ? Number(raw) : DEFAULT_ELECTRIC_AGENTS_PORT;
|
|
@@ -177,14 +181,17 @@ async function startBuiltinAgentsServer(options, params = {}) {
|
|
|
177
181
|
const cwd = params.cwd ?? process.cwd();
|
|
178
182
|
const fileEnv = require_env.readDotEnvFile(cwd);
|
|
179
183
|
const anthropicApiKey = require_env.resolveAnthropicApiKey(options, env, fileEnv);
|
|
184
|
+
const host = resolveBuiltinAgentsHost(env, fileEnv);
|
|
180
185
|
const port = resolveBuiltinAgentsPort(env, fileEnv);
|
|
181
186
|
const agentServerUrl = params.agentServerUrl ?? env.ELECTRIC_AGENTS_URL?.trim() ?? `http://localhost:${resolveElectricAgentsPort(env, fileEnv)}`;
|
|
182
187
|
process.env.ANTHROPIC_API_KEY = anthropicApiKey;
|
|
183
188
|
await waitForElectricAgentsServer(agentServerUrl);
|
|
184
189
|
const server = new __electric_ax_agents.BuiltinAgentsServer({
|
|
185
190
|
agentServerUrl,
|
|
191
|
+
host,
|
|
186
192
|
port,
|
|
187
|
-
workingDirectory: cwd
|
|
193
|
+
workingDirectory: cwd,
|
|
194
|
+
loadProjectMcpConfig: true
|
|
188
195
|
});
|
|
189
196
|
await server.start();
|
|
190
197
|
const started = {
|
|
@@ -204,6 +211,7 @@ exports.getStartedEnvironmentMessage = getStartedEnvironmentMessage
|
|
|
204
211
|
exports.getStoppedEnvironmentMessage = getStoppedEnvironmentMessage
|
|
205
212
|
exports.readDotEnvFile = require_env.readDotEnvFile
|
|
206
213
|
exports.resolveAnthropicApiKey = require_env.resolveAnthropicApiKey
|
|
214
|
+
exports.resolveBuiltinAgentsHost = resolveBuiltinAgentsHost
|
|
207
215
|
exports.resolveBuiltinAgentsPort = resolveBuiltinAgentsPort
|
|
208
216
|
exports.resolveComposeProjectName = resolveComposeProjectName
|
|
209
217
|
exports.resolveElectricAgentsPort = resolveElectricAgentsPort
|
package/dist/start.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer } from "./index-
|
|
2
|
-
export { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer };
|
|
1
|
+
import { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsHost, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer } from "./index-B2MsxFCW.cjs";
|
|
2
|
+
export { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsHost, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer };
|
package/dist/start.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer } from "./index-
|
|
2
|
-
export { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer };
|
|
1
|
+
import { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsHost, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer } from "./index-BDO8dHhT.js";
|
|
2
|
+
export { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsHost, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer };
|
package/dist/start.js
CHANGED
|
@@ -18,6 +18,7 @@ const ELECTRIC_AGENTS_SERVER_IMAGE_TAG = `latest`;
|
|
|
18
18
|
//#region src/start.ts
|
|
19
19
|
const DEFAULT_ELECTRIC_AGENTS_PORT = 4437;
|
|
20
20
|
const DEFAULT_BUILTIN_AGENTS_PORT = 4448;
|
|
21
|
+
const DEFAULT_BUILTIN_AGENTS_HOST = `0.0.0.0`;
|
|
21
22
|
const DEFAULT_COMPOSE_PROJECT_NAME = `electric-agents`;
|
|
22
23
|
const DOCKER_COMPOSE_FILE = fileURLToPath(new URL(`../docker-compose.full.yml`, import.meta.url));
|
|
23
24
|
function resolveBuiltinAgentsPort(env = process.env, fileEnv = readDotEnvFile()) {
|
|
@@ -26,6 +27,9 @@ function resolveBuiltinAgentsPort(env = process.env, fileEnv = readDotEnvFile())
|
|
|
26
27
|
if (!Number.isInteger(parsed) || parsed <= 0) throw new Error(`ELECTRIC_AGENTS_BUILTIN_PORT must be a positive integer`);
|
|
27
28
|
return parsed;
|
|
28
29
|
}
|
|
30
|
+
function resolveBuiltinAgentsHost(env = process.env, fileEnv = readDotEnvFile()) {
|
|
31
|
+
return env.ELECTRIC_AGENTS_BUILTIN_HOST?.trim() || fileEnv.ELECTRIC_AGENTS_BUILTIN_HOST?.trim() || DEFAULT_BUILTIN_AGENTS_HOST;
|
|
32
|
+
}
|
|
29
33
|
function resolveElectricAgentsPort(env = process.env, fileEnv = readDotEnvFile()) {
|
|
30
34
|
const raw = env.ELECTRIC_AGENTS_PORT?.trim() || fileEnv.ELECTRIC_AGENTS_PORT?.trim();
|
|
31
35
|
const parsed = raw ? Number(raw) : DEFAULT_ELECTRIC_AGENTS_PORT;
|
|
@@ -175,14 +179,17 @@ async function startBuiltinAgentsServer(options, params = {}) {
|
|
|
175
179
|
const cwd = params.cwd ?? process.cwd();
|
|
176
180
|
const fileEnv = readDotEnvFile(cwd);
|
|
177
181
|
const anthropicApiKey = resolveAnthropicApiKey(options, env, fileEnv);
|
|
182
|
+
const host = resolveBuiltinAgentsHost(env, fileEnv);
|
|
178
183
|
const port = resolveBuiltinAgentsPort(env, fileEnv);
|
|
179
184
|
const agentServerUrl = params.agentServerUrl ?? env.ELECTRIC_AGENTS_URL?.trim() ?? `http://localhost:${resolveElectricAgentsPort(env, fileEnv)}`;
|
|
180
185
|
process.env.ANTHROPIC_API_KEY = anthropicApiKey;
|
|
181
186
|
await waitForElectricAgentsServer(agentServerUrl);
|
|
182
187
|
const server = new BuiltinAgentsServer({
|
|
183
188
|
agentServerUrl,
|
|
189
|
+
host,
|
|
184
190
|
port,
|
|
185
|
-
workingDirectory: cwd
|
|
191
|
+
workingDirectory: cwd,
|
|
192
|
+
loadProjectMcpConfig: true
|
|
186
193
|
});
|
|
187
194
|
await server.start();
|
|
188
195
|
const started = {
|
|
@@ -197,4 +204,4 @@ async function startBuiltinAgentsServer(options, params = {}) {
|
|
|
197
204
|
}
|
|
198
205
|
|
|
199
206
|
//#endregion
|
|
200
|
-
export { getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer };
|
|
207
|
+
export { getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsHost, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electric-ax",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "CLI for Electric Agents",
|
|
5
5
|
"author": "ElectricSQL team and contributors",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,15 +39,15 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@durable-streams/client": "npm:@electric-ax/durable-streams-client-beta@^0.3.0",
|
|
41
41
|
"@durable-streams/state": "npm:@electric-ax/durable-streams-state-beta@^0.3.0",
|
|
42
|
-
"@electric-sql/client": "^1.5.
|
|
42
|
+
"@electric-sql/client": "^1.5.17",
|
|
43
43
|
"@tanstack/db": "^0.6.4",
|
|
44
44
|
"@tanstack/react-db": "^0.1.82",
|
|
45
45
|
"commander": "^13.1.0",
|
|
46
46
|
"ink": "^6.8.0",
|
|
47
47
|
"omelette": "^0.4.17",
|
|
48
48
|
"react": "^19.2.0",
|
|
49
|
-
"@electric-ax/agents": "0.
|
|
50
|
-
"@electric-ax/agents-runtime": "0.1.
|
|
49
|
+
"@electric-ax/agents": "0.3.0",
|
|
50
|
+
"@electric-ax/agents-runtime": "0.1.3"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@vitest/coverage-v8": "^4.1.0",
|