electric-ax 0.2.9 → 0.2.11

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/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  const require_chunk = require('./chunk-BCwAaXi7.cjs');
4
4
  const require_completions = require('./completions-BJ1fys8I.cjs');
5
5
  const require_entity_stream_db = require('./entity-stream-db-DHcwosd1.cjs');
6
- const require_env = require('./env-BXUgom_C.cjs');
6
+ const require_version = require('./version-W81aZejx.cjs');
7
7
  const __electric_ax_agents_runtime = require_chunk.__toESM(require("@electric-ax/agents-runtime"));
8
8
  const node_fs = require_chunk.__toESM(require("node:fs"));
9
9
  const node_os = require_chunk.__toESM(require("node:os"));
@@ -72,7 +72,7 @@ async function ensureAnthropicApiKey(options, io = defaultPromptIO()) {
72
72
  }
73
73
  let resolvedKey;
74
74
  try {
75
- resolvedKey = require_env.resolveAnthropicApiKey(options);
75
+ resolvedKey = require_version.resolveAnthropicApiKey(options);
76
76
  } catch (error) {
77
77
  if (!io.isTTY) throw error;
78
78
  }
@@ -688,7 +688,7 @@ Examples:
688
688
  }
689
689
  function createElectricProgram({ env = getElectricCliEnv(), commandName = `electric`, commandPrefix = commandExample(commandName), handlers = createElectricCliHandlers(env, commandPrefix) } = {}) {
690
690
  const program = new commander.Command();
691
- program.name(commandName).description(`Manage Electric tooling`).showHelpAfterError().showSuggestionAfterError().addHelpText(`after`, getHelpText(commandName));
691
+ program.name(commandName).version(require_version.ELECTRIC_AX_CLI_VERSION).description(`Manage Electric tooling`).showHelpAfterError().showSuggestionAfterError().addHelpText(`after`, getHelpText(commandName));
692
692
  const agentsCommand = program.command(`agents`).description(`Manage Electric Agents`);
693
693
  const typesCommand = agentsCommand.command(`types`).description(`List entity types`).action(async () => {
694
694
  await handlers.listTypes();
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { installCompletions, setupCompletions } from "./completions-BkhbBSPI.js";
3
3
  import { createEntityStreamDB, entityApiPath } from "./entity-stream-db-58-SuPa4.js";
4
- import { resolveAnthropicApiKey$1 as resolveAnthropicApiKey } from "./env-LZtIfFz1.js";
4
+ import { ELECTRIC_AX_CLI_VERSION, resolveAnthropicApiKey$1 as resolveAnthropicApiKey } from "./version-Dmda0QTw.js";
5
5
  import { appendPathToUrl, buildEntityTimelineData, buildSections } from "@electric-ax/agents-runtime";
6
6
  import { existsSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
7
7
  import { hostname, userInfo } from "node:os";
@@ -686,7 +686,7 @@ Examples:
686
686
  }
687
687
  function createElectricProgram({ env = getElectricCliEnv(), commandName = `electric`, commandPrefix = commandExample(commandName), handlers = createElectricCliHandlers(env, commandPrefix) } = {}) {
688
688
  const program = new Command();
689
- program.name(commandName).description(`Manage Electric tooling`).showHelpAfterError().showSuggestionAfterError().addHelpText(`after`, getHelpText(commandName));
689
+ program.name(commandName).version(ELECTRIC_AX_CLI_VERSION).description(`Manage Electric tooling`).showHelpAfterError().showSuggestionAfterError().addHelpText(`after`, getHelpText(commandName));
690
690
  const agentsCommand = program.command(`agents`).description(`Manage Electric Agents`);
691
691
  const typesCommand = agentsCommand.command(`types`).description(`List entity types`).action(async () => {
692
692
  await handlers.listTypes();
package/dist/start.cjs CHANGED
@@ -1,24 +1,12 @@
1
1
  "use strict";
2
2
  const require_chunk = require('./chunk-BCwAaXi7.cjs');
3
- const require_env = require('./env-BXUgom_C.cjs');
3
+ const require_version = require('./version-W81aZejx.cjs');
4
4
  const __electric_ax_agents_runtime = require_chunk.__toESM(require("@electric-ax/agents-runtime"));
5
5
  const node_url = require_chunk.__toESM(require("node:url"));
6
6
  const __electric_ax_agents_server_headers = require_chunk.__toESM(require("@electric-ax/agents/server-headers"));
7
7
  const node_child_process = require_chunk.__toESM(require("node:child_process"));
8
8
  const __electric_ax_agents = require_chunk.__toESM(require("@electric-ax/agents"));
9
9
 
10
- //#region src/version.ts
11
- /**
12
- * Default Docker image tags used by the CLI when launching
13
- * the dev environment via docker compose.
14
- *
15
- * For release builds these remain "latest".
16
- * The canary CI overwrites them to "canary" before building.
17
- */
18
- const ELECTRIC_IMAGE_TAG = `latest`;
19
- const ELECTRIC_AGENTS_SERVER_IMAGE_TAG = `latest`;
20
-
21
- //#endregion
22
10
  //#region src/start.ts
23
11
  const DEFAULT_ELECTRIC_AGENTS_PORT = 4437;
24
12
  const DEFAULT_COMPOSE_PROJECT_NAME = `electric-agents`;
@@ -26,7 +14,7 @@ const DEFAULT_PULL_WAKE_RUNNER_ID = `builtin-agents`;
26
14
  const DEFAULT_PULL_WAKE_OWNER_PRINCIPAL = `/principal/system%3Abuiltin-agents`;
27
15
  const PRINCIPAL_URL_PREFIX = `/principal/`;
28
16
  const DOCKER_COMPOSE_FILE = (0, node_url.fileURLToPath)(new URL(`../docker-compose.full.yml`, require("url").pathToFileURL(__filename).href));
29
- function resolveElectricAgentsPort(env = process.env, fileEnv = require_env.readDotEnvFile()) {
17
+ function resolveElectricAgentsPort(env = process.env, fileEnv = require_version.readDotEnvFile()) {
30
18
  const raw = env.ELECTRIC_AGENTS_PORT?.trim() || fileEnv.ELECTRIC_AGENTS_PORT?.trim();
31
19
  const parsed = raw ? Number(raw) : DEFAULT_ELECTRIC_AGENTS_PORT;
32
20
  if (!Number.isInteger(parsed) || parsed <= 0) throw new Error(`ELECTRIC_AGENTS_PORT must be a positive integer`);
@@ -70,10 +58,10 @@ function runnerIdFromIdentity(identity) {
70
58
  function principalUrlFromConfig(value) {
71
59
  return value.startsWith(PRINCIPAL_URL_PREFIX) ? value : `${PRINCIPAL_URL_PREFIX}${encodeURIComponent(value)}`;
72
60
  }
73
- function resolvePullWakeRunnerId(env = process.env, fileEnv = require_env.readDotEnvFile()) {
61
+ function resolvePullWakeRunnerId(env = process.env, fileEnv = require_version.readDotEnvFile()) {
74
62
  return readConfigValue(env, fileEnv, [`ELECTRIC_AGENTS_PULL_WAKE_RUNNER_ID`, `PULL_WAKE_RUNNER_ID`]) ?? runnerIdFromIdentity(readConfigValue(env, fileEnv, [`ELECTRIC_AGENTS_IDENTITY`]));
75
63
  }
76
- function resolvePullWakeOwnerPrincipal(env = process.env, fileEnv = require_env.readDotEnvFile()) {
64
+ function resolvePullWakeOwnerPrincipal(env = process.env, fileEnv = require_version.readDotEnvFile()) {
77
65
  const principal = readConfigValue(env, fileEnv, [`ELECTRIC_AGENTS_PRINCIPAL`]);
78
66
  if (principal) return principalUrlFromConfig(principal);
79
67
  const identity = readConfigValue(env, fileEnv, [`ELECTRIC_AGENTS_IDENTITY`]);
@@ -165,7 +153,7 @@ async function waitForElectricAgentsServer(baseUrl, options = {}) {
165
153
  throw new Error(`Timed out waiting for Electric Agents server at ${healthUrl}${lastError ? `: ${lastError}` : ``}`);
166
154
  }
167
155
  async function startElectricAgentsDevEnvironment(_options = {}, env = process.env, cwd = process.cwd()) {
168
- const fileEnv = require_env.readDotEnvFile(cwd);
156
+ const fileEnv = require_version.readDotEnvFile(cwd);
169
157
  const port = resolveElectricAgentsPort(env, fileEnv);
170
158
  const composeProjectName = resolveComposeProjectName(cwd, env);
171
159
  await runDockerCompose([
@@ -178,8 +166,8 @@ async function startElectricAgentsDevEnvironment(_options = {}, env = process.en
178
166
  ...env,
179
167
  COMPOSE_PROJECT_NAME: composeProjectName,
180
168
  ELECTRIC_AGENTS_PORT: String(port),
181
- ELECTRIC_IMAGE_TAG: env.ELECTRIC_IMAGE_TAG ?? ELECTRIC_IMAGE_TAG,
182
- ELECTRIC_AGENTS_SERVER_IMAGE_TAG: env.ELECTRIC_AGENTS_SERVER_IMAGE_TAG ?? ELECTRIC_AGENTS_SERVER_IMAGE_TAG
169
+ ELECTRIC_IMAGE_TAG: env.ELECTRIC_IMAGE_TAG ?? require_version.ELECTRIC_IMAGE_TAG,
170
+ ELECTRIC_AGENTS_SERVER_IMAGE_TAG: env.ELECTRIC_AGENTS_SERVER_IMAGE_TAG ?? require_version.ELECTRIC_AGENTS_SERVER_IMAGE_TAG
183
171
  });
184
172
  const uiUrl = `http://localhost:${port}`;
185
173
  await waitForElectricAgentsServer(uiUrl);
@@ -235,8 +223,8 @@ function waitForShutdown(stop, signalSource = process) {
235
223
  async function startBuiltinAgentsServer(options, params = {}) {
236
224
  const env = params.env ?? process.env;
237
225
  const cwd = params.cwd ?? process.cwd();
238
- const fileEnv = require_env.readDotEnvFile(cwd);
239
- const anthropicApiKey = require_env.resolveAnthropicApiKey(options, env, fileEnv);
226
+ const fileEnv = require_version.readDotEnvFile(cwd);
227
+ const anthropicApiKey = require_version.resolveAnthropicApiKey(options, env, fileEnv);
240
228
  const runnerId = resolvePullWakeRunnerId(env, fileEnv);
241
229
  const ownerPrincipal = resolvePullWakeOwnerPrincipal(env, fileEnv);
242
230
  const serverHeaders = mergeHeaders(resolveServerHeaders(env, fileEnv));
@@ -271,8 +259,8 @@ async function startBuiltinAgentsServer(options, params = {}) {
271
259
  exports.getStartedBuiltinAgentsMessage = getStartedBuiltinAgentsMessage
272
260
  exports.getStartedEnvironmentMessage = getStartedEnvironmentMessage
273
261
  exports.getStoppedEnvironmentMessage = getStoppedEnvironmentMessage
274
- exports.readDotEnvFile = require_env.readDotEnvFile
275
- exports.resolveAnthropicApiKey = require_env.resolveAnthropicApiKey
262
+ exports.readDotEnvFile = require_version.readDotEnvFile
263
+ exports.resolveAnthropicApiKey = require_version.resolveAnthropicApiKey
276
264
  exports.resolveComposeProjectName = resolveComposeProjectName
277
265
  exports.resolveElectricAgentsPort = resolveElectricAgentsPort
278
266
  exports.resolvePullWakeOwnerPrincipal = resolvePullWakeOwnerPrincipal
package/dist/start.js CHANGED
@@ -1,22 +1,10 @@
1
- import { readDotEnvFile$1 as readDotEnvFile, resolveAnthropicApiKey$1 as resolveAnthropicApiKey } from "./env-LZtIfFz1.js";
1
+ import { ELECTRIC_AGENTS_SERVER_IMAGE_TAG, ELECTRIC_IMAGE_TAG, readDotEnvFile$1 as readDotEnvFile, resolveAnthropicApiKey$1 as resolveAnthropicApiKey } from "./version-Dmda0QTw.js";
2
2
  import { appendPathToUrl } from "@electric-ax/agents-runtime";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { mergeElectricPrincipalHeader } from "@electric-ax/agents/server-headers";
5
5
  import { spawn } from "node:child_process";
6
6
  import { BuiltinAgentsServer } from "@electric-ax/agents";
7
7
 
8
- //#region src/version.ts
9
- /**
10
- * Default Docker image tags used by the CLI when launching
11
- * the dev environment via docker compose.
12
- *
13
- * For release builds these remain "latest".
14
- * The canary CI overwrites them to "canary" before building.
15
- */
16
- const ELECTRIC_IMAGE_TAG = `latest`;
17
- const ELECTRIC_AGENTS_SERVER_IMAGE_TAG = `latest`;
18
-
19
- //#endregion
20
8
  //#region src/start.ts
21
9
  const DEFAULT_ELECTRIC_AGENTS_PORT = 4437;
22
10
  const DEFAULT_COMPOSE_PROJECT_NAME = `electric-agents`;
@@ -35,4 +35,18 @@ function resolveAnthropicApiKey(options, env = process.env, fileEnv = readDotEnv
35
35
  }
36
36
 
37
37
  //#endregion
38
- export { readDotEnvFile as readDotEnvFile$1, resolveAnthropicApiKey as resolveAnthropicApiKey$1 };
38
+ //#region src/version.ts
39
+ /**
40
+ * Default Docker image tags used by the CLI when launching
41
+ * the dev environment via docker compose.
42
+ *
43
+ * For release builds these remain "latest".
44
+ * The canary CI overwrites them to "canary" before building.
45
+ */
46
+ const injectedCliVersion = `0.2.11`;
47
+ const ELECTRIC_AX_CLI_VERSION = injectedCliVersion.startsWith(`__ELECTRIC_AX_`) ? `0.0.0` : injectedCliVersion;
48
+ const ELECTRIC_IMAGE_TAG = `latest`;
49
+ const ELECTRIC_AGENTS_SERVER_IMAGE_TAG = `latest`;
50
+
51
+ //#endregion
52
+ export { ELECTRIC_AGENTS_SERVER_IMAGE_TAG, ELECTRIC_AX_CLI_VERSION, ELECTRIC_IMAGE_TAG, readDotEnvFile as readDotEnvFile$1, resolveAnthropicApiKey as resolveAnthropicApiKey$1 };
@@ -37,6 +37,38 @@ function resolveAnthropicApiKey(options, env = process.env, fileEnv = readDotEnv
37
37
  }
38
38
 
39
39
  //#endregion
40
+ //#region src/version.ts
41
+ /**
42
+ * Default Docker image tags used by the CLI when launching
43
+ * the dev environment via docker compose.
44
+ *
45
+ * For release builds these remain "latest".
46
+ * The canary CI overwrites them to "canary" before building.
47
+ */
48
+ const injectedCliVersion = `0.2.11`;
49
+ const ELECTRIC_AX_CLI_VERSION = injectedCliVersion.startsWith(`__ELECTRIC_AX_`) ? `0.0.0` : injectedCliVersion;
50
+ const ELECTRIC_IMAGE_TAG = `latest`;
51
+ const ELECTRIC_AGENTS_SERVER_IMAGE_TAG = `latest`;
52
+
53
+ //#endregion
54
+ Object.defineProperty(exports, 'ELECTRIC_AGENTS_SERVER_IMAGE_TAG', {
55
+ enumerable: true,
56
+ get: function () {
57
+ return ELECTRIC_AGENTS_SERVER_IMAGE_TAG;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, 'ELECTRIC_AX_CLI_VERSION', {
61
+ enumerable: true,
62
+ get: function () {
63
+ return ELECTRIC_AX_CLI_VERSION;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, 'ELECTRIC_IMAGE_TAG', {
67
+ enumerable: true,
68
+ get: function () {
69
+ return ELECTRIC_IMAGE_TAG;
70
+ }
71
+ });
40
72
  Object.defineProperty(exports, 'readDotEnvFile', {
41
73
  enumerable: true,
42
74
  get: function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electric-ax",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "CLI for Electric Agents",
5
5
  "author": "ElectricSQL team and contributors",
6
6
  "license": "Apache-2.0",
@@ -37,17 +37,17 @@
37
37
  "./package.json": "./package.json"
38
38
  },
39
39
  "dependencies": {
40
- "@durable-streams/client": "https://pkg.pr.new/durable-streams/durable-streams/@durable-streams/client@5d5c217",
41
- "@durable-streams/state": "https://pkg.pr.new/durable-streams/durable-streams/@durable-streams/state@5d5c217",
42
- "@electric-sql/client": "^1.5.19",
40
+ "@durable-streams/client": "^0.2.6",
41
+ "@durable-streams/state": "^0.2.9",
42
+ "@electric-sql/client": "^1.5.20",
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.4.9",
50
- "@electric-ax/agents-runtime": "0.3.5"
49
+ "@electric-ax/agents": "0.4.11",
50
+ "@electric-ax/agents-runtime": "0.3.7"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@vitest/coverage-v8": "^4.1.0",
@@ -85,6 +85,7 @@
85
85
  "sideEffects": false,
86
86
  "scripts": {
87
87
  "build": "tsdown",
88
+ "build:desktop": "tsdown --config tsdown.desktop.config.ts",
88
89
  "dev": "tsdown --watch",
89
90
  "test": "vitest run",
90
91
  "coverage": "pnpm exec vitest run --coverage",