electric-ax 0.1.10 → 0.1.13

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.
@@ -35,6 +35,7 @@ const AGENTS_COMMANDS = [
35
35
  `start-builtin`,
36
36
  `stop`,
37
37
  `quickstart`,
38
+ `init`,
38
39
  `completion`
39
40
  ];
40
41
  const TYPES_SUBCOMMANDS = [`inspect`, `delete`];
@@ -37,6 +37,7 @@ const AGENTS_COMMANDS = [
37
37
  `start-builtin`,
38
38
  `stop`,
39
39
  `quickstart`,
40
+ `init`,
40
41
  `completion`
41
42
  ];
42
43
  const TYPES_SUBCOMMANDS = [`inspect`, `delete`];
@@ -1,4 +1,4 @@
1
- const require_completions = require('./completions-CO5UBiNh.cjs');
1
+ const require_completions = require('./completions-Bj4D5DRa.cjs');
2
2
 
3
3
  exports.fetchEntityTypeNames = require_completions.fetchEntityTypeNames
4
4
  exports.fetchEntityUrls = require_completions.fetchEntityUrls
@@ -1,4 +1,4 @@
1
- import { ElectricCliEnv } from "./index-Bx8g95OI.cjs";
1
+ import { ElectricCliEnv } from "./index-BNTf2uZL.cjs";
2
2
 
3
3
  //#region src/completions.d.ts
4
4
  declare function fetchEntityTypeNames(env: ElectricCliEnv): Promise<Array<string>>;
@@ -1,4 +1,4 @@
1
- import { ElectricCliEnv } from "./index-Co_ocoIu.js";
1
+ import { ElectricCliEnv } from "./index-DS2RpaPZ.js";
2
2
 
3
3
  //#region src/completions.d.ts
4
4
  declare function fetchEntityTypeNames(env: ElectricCliEnv): Promise<Array<string>>;
@@ -1,3 +1,3 @@
1
- import { fetchEntityTypeNames, fetchEntityUrls, installCompletions, setupCompletions } from "./completions-BHILvHgZ.js";
1
+ import { fetchEntityTypeNames, fetchEntityUrls, installCompletions, setupCompletions } from "./completions-B-Lf28Wy.js";
2
2
 
3
3
  export { fetchEntityTypeNames, fetchEntityUrls, installCompletions, setupCompletions };
@@ -87,6 +87,7 @@ interface ElectricCliHandlers {
87
87
  startBuiltin: (options: StartBuiltinCommandOptions) => Promise<StartedBuiltinAgentsEnvironment>;
88
88
  stop: (options: StopCommandOptions) => Promise<StoppedDevEnvironment>;
89
89
  quickstart: (options: StartBuiltinCommandOptions) => Promise<void>;
90
+ init: (projectName?: string) => Promise<void>;
90
91
  }
91
92
  interface InvocationEnv {
92
93
  npm_command?: string;
@@ -87,6 +87,7 @@ interface ElectricCliHandlers {
87
87
  startBuiltin: (options: StartBuiltinCommandOptions) => Promise<StartedBuiltinAgentsEnvironment>;
88
88
  stop: (options: StopCommandOptions) => Promise<StoppedDevEnvironment>;
89
89
  quickstart: (options: StartBuiltinCommandOptions) => Promise<void>;
90
+ init: (projectName?: string) => Promise<void>;
90
91
  }
91
92
  interface InvocationEnv {
92
93
  npm_command?: string;
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  const require_chunk = require('./chunk-BCwAaXi7.cjs');
4
- const require_completions = require('./completions-CO5UBiNh.cjs');
4
+ const require_completions = require('./completions-Bj4D5DRa.cjs');
5
5
  const require_env = require('./env-BXUgom_C.cjs');
6
6
  const node_fs = require_chunk.__toESM(require("node:fs"));
7
7
  const node_os = require_chunk.__toESM(require("node:os"));
@@ -60,13 +60,13 @@ function resolveCommandName(argv) {
60
60
  return invoked.replace(/\.(c|m)?js$/, ``);
61
61
  }
62
62
  function commandExample(commandName) {
63
- return `${commandName} agent`;
63
+ return `${commandName} agents`;
64
64
  }
65
65
  function resolveCommandPrefix(argv, env = process.env) {
66
66
  if (env.npm_command === `exec`) {
67
67
  const userAgent = env.npm_config_user_agent ?? ``;
68
- if (userAgent.startsWith(`pnpm/`)) return `pnpx electric-ax agent`;
69
- if (userAgent.startsWith(`npm/`)) return `npx electric-ax agent`;
68
+ if (userAgent.startsWith(`pnpm/`)) return `pnpx electric-ax agents`;
69
+ if (userAgent.startsWith(`npm/`)) return `npx electric-ax agents`;
70
70
  }
71
71
  return commandExample(resolveCommandName(argv));
72
72
  }
@@ -285,6 +285,10 @@ function createElectricCliHandlers(env, commandPrefix = commandExample(`electric
285
285
  ].join(`\n`));
286
286
  console.log(``);
287
287
  await startBuiltinAgentsServer(options, { agentServerUrl: started.uiUrl });
288
+ },
289
+ init: async (projectName) => {
290
+ const { initProject } = await import(`./init.js`);
291
+ await initProject(projectName);
288
292
  }
289
293
  };
290
294
  }
@@ -309,7 +313,7 @@ Examples:
309
313
  function createElectricProgram({ env = getElectricCliEnv(), commandName = `electric`, commandPrefix = commandExample(commandName), handlers = createElectricCliHandlers(env, commandPrefix) } = {}) {
310
314
  const program = new commander.Command();
311
315
  program.name(commandName).description(`Manage Electric tooling`).showHelpAfterError().showSuggestionAfterError().addHelpText(`after`, getHelpText(commandName));
312
- const agentsCommand = program.command(`agent`).alias(`agents`).description(`Manage Electric Agents`);
316
+ const agentsCommand = program.command(`agents`).description(`Manage Electric Agents`);
313
317
  const typesCommand = agentsCommand.command(`types`).description(`List entity types`).action(async () => {
314
318
  await handlers.listTypes();
315
319
  });
@@ -362,6 +366,10 @@ function createElectricProgram({ env = getElectricCliEnv(), commandName = `elect
362
366
  const command = getCommandActionArg(actionArgs);
363
367
  await handlers.quickstart(command.opts());
364
368
  });
369
+ agentsCommand.command(`init [project-name]`).description(`Scaffold a new Electric Agents project from a starter template`).action(async (...actionArgs) => {
370
+ const projectName = actionArgs[0];
371
+ await handlers.init(projectName);
372
+ });
365
373
  const completionCommand = agentsCommand.command(`completion [action]`).description(`Set up shell completion`).addHelpText(`after`, `
366
374
  Setup (add to your shell init file):
367
375
 
@@ -370,7 +378,7 @@ Setup (add to your shell init file):
370
378
  Fish: ${commandName} --completion-fish | source # add to config.fish
371
379
 
372
380
  Auto-install (detects your shell and updates init file):
373
- ${commandName} agent completion install
381
+ ${commandName} agents completion install
374
382
  `).action((action) => {
375
383
  if (action === `install`) {
376
384
  try {
@@ -385,7 +393,7 @@ Auto-install (detects your shell and updates init file):
385
393
  console.log(`Add to your shell init file:`);
386
394
  console.log(` Bash/Zsh: eval "$(${commandName} --completion)"`);
387
395
  console.log(` Fish: ${commandName} --completion-fish | source\n`);
388
- console.log(`Or auto-install: ${commandName} agent completion install`);
396
+ console.log(`Or auto-install: ${commandName} agents completion install`);
389
397
  });
390
398
  completionCommand.alias(`completions`);
391
399
  return program;
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, getElectricCliEnv, resolveCommandPrefix, run } from "./index-Bx8g95OI.cjs";
2
+ import { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, getElectricCliEnv, resolveCommandPrefix, run } from "./index-BNTf2uZL.cjs";
3
3
  export { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, 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, getElectricCliEnv, resolveCommandPrefix, run } from "./index-Co_ocoIu.js";
2
+ import { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, getElectricCliEnv, resolveCommandPrefix, run } from "./index-DS2RpaPZ.js";
3
3
  export { DEFAULT_ELECTRIC_AGENTS_URL, ElectricCliEnv, ElectricCliHandlers, ObserveCommandOptions, PsCommandOptions, SendCommandOptions, SpawnCommandOptions, StartBuiltinCommandOptions, StartCommandOptions, StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StopCommandOptions, StoppedDevEnvironment, createElectricCliHandlers, createElectricProgram, getElectricCliEnv, resolveCommandPrefix, run };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { installCompletions, setupCompletions } from "./completions-BHILvHgZ.js";
2
+ import { installCompletions, setupCompletions } from "./completions-B-Lf28Wy.js";
3
3
  import { resolveAnthropicApiKey$1 as resolveAnthropicApiKey } from "./env-LZtIfFz1.js";
4
4
  import { realpathSync } from "node:fs";
5
5
  import { hostname, userInfo } from "node:os";
@@ -58,19 +58,19 @@ function resolveCommandName(argv) {
58
58
  return invoked.replace(/\.(c|m)?js$/, ``);
59
59
  }
60
60
  function commandExample(commandName) {
61
- return `${commandName} agent`;
61
+ return `${commandName} agents`;
62
62
  }
63
63
  function resolveCommandPrefix(argv, env = process.env) {
64
64
  if (env.npm_command === `exec`) {
65
65
  const userAgent = env.npm_config_user_agent ?? ``;
66
- if (userAgent.startsWith(`pnpm/`)) return `pnpx electric-ax agent`;
67
- if (userAgent.startsWith(`npm/`)) return `npx electric-ax agent`;
66
+ if (userAgent.startsWith(`pnpm/`)) return `pnpx electric-ax agents`;
67
+ if (userAgent.startsWith(`npm/`)) return `npx electric-ax agents`;
68
68
  }
69
69
  return commandExample(resolveCommandName(argv));
70
70
  }
71
- async function electricAgentsFetch(env, path, opts = {}) {
71
+ async function electricAgentsFetch(env, path$1, opts = {}) {
72
72
  try {
73
- return await fetch(`${env.electricAgentsUrl}${path}`, {
73
+ return await fetch(`${env.electricAgentsUrl}${path$1}`, {
74
74
  ...opts,
75
75
  headers: {
76
76
  "content-type": `application/json`,
@@ -283,6 +283,10 @@ function createElectricCliHandlers(env, commandPrefix = commandExample(`electric
283
283
  ].join(`\n`));
284
284
  console.log(``);
285
285
  await startBuiltinAgentsServer(options, { agentServerUrl: started.uiUrl });
286
+ },
287
+ init: async (projectName) => {
288
+ const { initProject } = await import(`./init.js`);
289
+ await initProject(projectName);
286
290
  }
287
291
  };
288
292
  }
@@ -307,7 +311,7 @@ Examples:
307
311
  function createElectricProgram({ env = getElectricCliEnv(), commandName = `electric`, commandPrefix = commandExample(commandName), handlers = createElectricCliHandlers(env, commandPrefix) } = {}) {
308
312
  const program = new Command();
309
313
  program.name(commandName).description(`Manage Electric tooling`).showHelpAfterError().showSuggestionAfterError().addHelpText(`after`, getHelpText(commandName));
310
- const agentsCommand = program.command(`agent`).alias(`agents`).description(`Manage Electric Agents`);
314
+ const agentsCommand = program.command(`agents`).description(`Manage Electric Agents`);
311
315
  const typesCommand = agentsCommand.command(`types`).description(`List entity types`).action(async () => {
312
316
  await handlers.listTypes();
313
317
  });
@@ -360,6 +364,10 @@ function createElectricProgram({ env = getElectricCliEnv(), commandName = `elect
360
364
  const command = getCommandActionArg(actionArgs);
361
365
  await handlers.quickstart(command.opts());
362
366
  });
367
+ agentsCommand.command(`init [project-name]`).description(`Scaffold a new Electric Agents project from a starter template`).action(async (...actionArgs) => {
368
+ const projectName = actionArgs[0];
369
+ await handlers.init(projectName);
370
+ });
363
371
  const completionCommand = agentsCommand.command(`completion [action]`).description(`Set up shell completion`).addHelpText(`after`, `
364
372
  Setup (add to your shell init file):
365
373
 
@@ -368,7 +376,7 @@ Setup (add to your shell init file):
368
376
  Fish: ${commandName} --completion-fish | source # add to config.fish
369
377
 
370
378
  Auto-install (detects your shell and updates init file):
371
- ${commandName} agent completion install
379
+ ${commandName} agents completion install
372
380
  `).action((action) => {
373
381
  if (action === `install`) {
374
382
  try {
@@ -383,7 +391,7 @@ Auto-install (detects your shell and updates init file):
383
391
  console.log(`Add to your shell init file:`);
384
392
  console.log(` Bash/Zsh: eval "$(${commandName} --completion)"`);
385
393
  console.log(` Fish: ${commandName} --completion-fish | source\n`);
386
- console.log(`Or auto-install: ${commandName} agent completion install`);
394
+ console.log(`Or auto-install: ${commandName} agents completion install`);
387
395
  });
388
396
  completionCommand.alias(`completions`);
389
397
  return program;
package/dist/init.cjs ADDED
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ const require_chunk = require('./chunk-BCwAaXi7.cjs');
3
+ const node_fs = require_chunk.__toESM(require("node:fs"));
4
+ const node_path = require_chunk.__toESM(require("node:path"));
5
+ const node_child_process = require_chunk.__toESM(require("node:child_process"));
6
+
7
+ //#region src/init.ts
8
+ const TEMPLATE_REPO = `electric-sql/electric/tree/main/examples/agents-chat-starter`;
9
+ async function initProject(projectName) {
10
+ const name = projectName ?? `my-agents-app`;
11
+ const targetDir = node_path.default.resolve(process.cwd(), name);
12
+ if (node_fs.default.existsSync(targetDir)) {
13
+ console.error(`Error: directory "${name}" already exists`);
14
+ process.exit(1);
15
+ }
16
+ console.log(`Scaffolding Electric Agents project into ${name}...`);
17
+ console.log(``);
18
+ try {
19
+ (0, node_child_process.execSync)(`npx gitpick ${TEMPLATE_REPO} ${name}`, {
20
+ stdio: `inherit`,
21
+ cwd: process.cwd()
22
+ });
23
+ } catch {
24
+ console.error(`Failed to scaffold project. Make sure npx is available.`);
25
+ process.exit(1);
26
+ }
27
+ console.log(``);
28
+ console.log(`Done! Next steps:`);
29
+ console.log(``);
30
+ console.log(` cd ${name}`);
31
+ console.log(` pnpm install`);
32
+ console.log(` cp .env.example .env`);
33
+ console.log(``);
34
+ console.log(`Then set your ANTHROPIC_API_KEY in .env`);
35
+ console.log(`Get one at https://console.anthropic.com/settings/keys`);
36
+ console.log(``);
37
+ console.log(`Start infrastructure and run:`);
38
+ console.log(` npx electric-ax agents quickstart # in one terminal`);
39
+ console.log(` pnpm dev # in another terminal`);
40
+ console.log(``);
41
+ }
42
+
43
+ //#endregion
44
+ exports.initProject = initProject
@@ -0,0 +1,5 @@
1
+ //#region src/init.d.ts
2
+ declare function initProject(projectName?: string): Promise<void>;
3
+
4
+ //#endregion
5
+ export { initProject };
package/dist/init.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ //#region src/init.d.ts
2
+ declare function initProject(projectName?: string): Promise<void>;
3
+
4
+ //#endregion
5
+ export { initProject };
package/dist/init.js ADDED
@@ -0,0 +1,42 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { execSync } from "node:child_process";
4
+
5
+ //#region src/init.ts
6
+ const TEMPLATE_REPO = `electric-sql/electric/tree/main/examples/agents-chat-starter`;
7
+ async function initProject(projectName) {
8
+ const name = projectName ?? `my-agents-app`;
9
+ const targetDir = path.resolve(process.cwd(), name);
10
+ if (fs.existsSync(targetDir)) {
11
+ console.error(`Error: directory "${name}" already exists`);
12
+ process.exit(1);
13
+ }
14
+ console.log(`Scaffolding Electric Agents project into ${name}...`);
15
+ console.log(``);
16
+ try {
17
+ execSync(`npx gitpick ${TEMPLATE_REPO} ${name}`, {
18
+ stdio: `inherit`,
19
+ cwd: process.cwd()
20
+ });
21
+ } catch {
22
+ console.error(`Failed to scaffold project. Make sure npx is available.`);
23
+ process.exit(1);
24
+ }
25
+ console.log(``);
26
+ console.log(`Done! Next steps:`);
27
+ console.log(``);
28
+ console.log(` cd ${name}`);
29
+ console.log(` pnpm install`);
30
+ console.log(` cp .env.example .env`);
31
+ console.log(``);
32
+ console.log(`Then set your ANTHROPIC_API_KEY in .env`);
33
+ console.log(`Get one at https://console.anthropic.com/settings/keys`);
34
+ console.log(``);
35
+ console.log(`Start infrastructure and run:`);
36
+ console.log(` npx electric-ax agents quickstart # in one terminal`);
37
+ console.log(` pnpm dev # in another terminal`);
38
+ console.log(``);
39
+ }
40
+
41
+ //#endregion
42
+ export { initProject };
package/dist/start.cjs CHANGED
@@ -5,6 +5,18 @@ const node_url = require_chunk.__toESM(require("node:url"));
5
5
  const node_child_process = require_chunk.__toESM(require("node:child_process"));
6
6
  const __electric_ax_agents = require_chunk.__toESM(require("@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
8
20
  //#region src/start.ts
9
21
  const DEFAULT_ELECTRIC_AGENTS_PORT = 4437;
10
22
  const DEFAULT_BUILTIN_AGENTS_PORT = 4448;
@@ -105,7 +117,9 @@ async function startElectricAgentsDevEnvironment(_options = {}, env = process.en
105
117
  ], {
106
118
  ...env,
107
119
  COMPOSE_PROJECT_NAME: composeProjectName,
108
- ELECTRIC_AGENTS_PORT: String(port)
120
+ ELECTRIC_AGENTS_PORT: String(port),
121
+ ELECTRIC_IMAGE_TAG: env.ELECTRIC_IMAGE_TAG ?? ELECTRIC_IMAGE_TAG,
122
+ ELECTRIC_AGENTS_SERVER_IMAGE_TAG: env.ELECTRIC_AGENTS_SERVER_IMAGE_TAG ?? ELECTRIC_AGENTS_SERVER_IMAGE_TAG
109
123
  });
110
124
  const uiUrl = `http://localhost:${port}`;
111
125
  await waitForElectricAgentsServer(uiUrl);
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-Bx8g95OI.cjs";
1
+ import { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer } from "./index-BNTf2uZL.cjs";
2
2
  export { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, 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-Co_ocoIu.js";
1
+ import { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer } from "./index-DS2RpaPZ.js";
2
2
  export { StartedBuiltinAgentsEnvironment, StartedDevEnvironment, StoppedDevEnvironment, getStartedBuiltinAgentsMessage, getStartedEnvironmentMessage, getStoppedEnvironmentMessage, readDotEnvFile, resolveAnthropicApiKey, resolveBuiltinAgentsPort, resolveComposeProjectName, resolveElectricAgentsPort, startBuiltinAgentsServer, startElectricAgentsDevEnvironment, stopElectricAgentsDevEnvironment, waitForElectricAgentsServer };
package/dist/start.js CHANGED
@@ -3,6 +3,18 @@ import { fileURLToPath } from "node:url";
3
3
  import { spawn } from "node:child_process";
4
4
  import { BuiltinAgentsServer } from "@electric-ax/agents";
5
5
 
6
+ //#region src/version.ts
7
+ /**
8
+ * Default Docker image tags used by the CLI when launching
9
+ * the dev environment via docker compose.
10
+ *
11
+ * For release builds these remain "latest".
12
+ * The canary CI overwrites them to "canary" before building.
13
+ */
14
+ const ELECTRIC_IMAGE_TAG = `latest`;
15
+ const ELECTRIC_AGENTS_SERVER_IMAGE_TAG = `latest`;
16
+
17
+ //#endregion
6
18
  //#region src/start.ts
7
19
  const DEFAULT_ELECTRIC_AGENTS_PORT = 4437;
8
20
  const DEFAULT_BUILTIN_AGENTS_PORT = 4448;
@@ -103,7 +115,9 @@ async function startElectricAgentsDevEnvironment(_options = {}, env = process.en
103
115
  ], {
104
116
  ...env,
105
117
  COMPOSE_PROJECT_NAME: composeProjectName,
106
- ELECTRIC_AGENTS_PORT: String(port)
118
+ ELECTRIC_AGENTS_PORT: String(port),
119
+ ELECTRIC_IMAGE_TAG: env.ELECTRIC_IMAGE_TAG ?? ELECTRIC_IMAGE_TAG,
120
+ ELECTRIC_AGENTS_SERVER_IMAGE_TAG: env.ELECTRIC_AGENTS_SERVER_IMAGE_TAG ?? ELECTRIC_AGENTS_SERVER_IMAGE_TAG
107
121
  });
108
122
  const uiUrl = `http://localhost:${port}`;
109
123
  await waitForElectricAgentsServer(uiUrl);
@@ -27,7 +27,7 @@ services:
27
27
  - electric-agents-postgres-data:/var/lib/postgresql
28
28
 
29
29
  electric:
30
- image: electricsql/electric:latest
30
+ image: electricsql/electric:${ELECTRIC_IMAGE_TAG:-latest}
31
31
  restart: unless-stopped
32
32
  depends_on:
33
33
  postgres:
@@ -37,7 +37,8 @@ services:
37
37
  ELECTRIC_INSECURE: 'true'
38
38
 
39
39
  electric-agents:
40
- image: electricax/agents-server:latest
40
+ image: electricax/agents-server:${ELECTRIC_AGENTS_SERVER_IMAGE_TAG:-latest}
41
+ pull_policy: always
41
42
  restart: unless-stopped
42
43
  extra_hosts:
43
44
  - 'host.docker.internal:host-gateway'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electric-ax",
3
- "version": "0.1.10",
3
+ "version": "0.1.13",
4
4
  "description": "CLI for Electric Agents",
5
5
  "author": "ElectricSQL team and contributors",
6
6
  "license": "Apache-2.0",
@@ -46,8 +46,8 @@
46
46
  "ink": "^6.8.0",
47
47
  "omelette": "^0.4.17",
48
48
  "react": "^19.2.0",
49
- "@electric-ax/agents-runtime": "0.0.4",
50
- "@electric-ax/agents": "0.1.5"
49
+ "@electric-ax/agents": "0.2.2",
50
+ "@electric-ax/agents-runtime": "0.1.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@vitest/coverage-v8": "^4.1.0",