electric-ax 0.2.19 → 0.2.21
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-uLb8jOQA.cjs');
|
|
6
|
-
const require_version = require('./version-
|
|
6
|
+
const require_version = require('./version-BU1gpSFU.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"));
|
|
@@ -219,6 +219,9 @@ var CliError = class extends Error {};
|
|
|
219
219
|
function getDefaultElectricAgentsIdentity() {
|
|
220
220
|
return `${(0, node_os.userInfo)().username}@${(0, node_os.hostname)()}`;
|
|
221
221
|
}
|
|
222
|
+
function getDefaultElectricAgentsPrincipal() {
|
|
223
|
+
return `system:cli-${(0, node_os.userInfo)().username}`;
|
|
224
|
+
}
|
|
222
225
|
function parseElectricAgentsHeaders(raw) {
|
|
223
226
|
const trimmed = raw?.trim();
|
|
224
227
|
if (!trimmed) return void 0;
|
|
@@ -239,11 +242,12 @@ function parseElectricAgentsHeaders(raw) {
|
|
|
239
242
|
}
|
|
240
243
|
function getElectricCliEnv(env = process.env) {
|
|
241
244
|
const explicitIdentity = env.ELECTRIC_AGENTS_IDENTITY?.trim();
|
|
245
|
+
const explicitPrincipal = env.ELECTRIC_AGENTS_PRINCIPAL?.trim();
|
|
242
246
|
const headers = parseElectricAgentsHeaders(env.ELECTRIC_AGENTS_SERVER_HEADERS);
|
|
243
247
|
return {
|
|
244
248
|
electricAgentsUrl: env.ELECTRIC_AGENTS_URL || DEFAULT_ELECTRIC_AGENTS_URL,
|
|
245
249
|
electricAgentsIdentity: explicitIdentity || getDefaultElectricAgentsIdentity(),
|
|
246
|
-
electricAgentsHeaders: (0, __electric_ax_agents_server_headers.mergeElectricPrincipalHeader)(headers,
|
|
250
|
+
electricAgentsHeaders: (0, __electric_ax_agents_server_headers.mergeElectricPrincipalHeader)(headers, explicitPrincipal || getDefaultElectricAgentsPrincipal())
|
|
247
251
|
};
|
|
248
252
|
}
|
|
249
253
|
function getErrorMessage(error) {
|
|
@@ -493,10 +497,7 @@ async function spawnEntity(env, urlPath, options) {
|
|
|
493
497
|
}
|
|
494
498
|
async function sendMessage(env, url, message, options) {
|
|
495
499
|
const payload = parsePayload(message, options.json ?? false);
|
|
496
|
-
const body = {
|
|
497
|
-
from: env.electricAgentsIdentity,
|
|
498
|
-
payload
|
|
499
|
-
};
|
|
500
|
+
const body = { payload };
|
|
500
501
|
if (options.type) body.type = options.type;
|
|
501
502
|
const res = await electricAgentsFetch(env, require_entity_stream_db.entityApiPath(url, `/send`), {
|
|
502
503
|
method: `POST`,
|
|
@@ -671,7 +672,7 @@ function getHelpText(commandName) {
|
|
|
671
672
|
Environment:
|
|
672
673
|
ELECTRIC_AGENTS_URL Base URL of the server (default: ${DEFAULT_ELECTRIC_AGENTS_URL})
|
|
673
674
|
ELECTRIC_AGENTS_IDENTITY Sender identity for messages (default: ${getDefaultElectricAgentsIdentity()})
|
|
674
|
-
ELECTRIC_AGENTS_PRINCIPAL
|
|
675
|
+
ELECTRIC_AGENTS_PRINCIPAL Principal key sent as the Electric-Principal header (default: ${getDefaultElectricAgentsPrincipal()})
|
|
675
676
|
ELECTRIC_AGENTS_SERVER_HEADERS Optional JSON object of additional server headers
|
|
676
677
|
ANTHROPIC_API_KEY Required for '${agentsCommand} start-builtin' and '${agentsCommand} quickstart'
|
|
677
678
|
|
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-UBN2gowE.js";
|
|
4
|
-
import { ELECTRIC_AX_CLI_VERSION, resolveAnthropicApiKey$1 as resolveAnthropicApiKey } from "./version-
|
|
4
|
+
import { ELECTRIC_AX_CLI_VERSION, resolveAnthropicApiKey$1 as resolveAnthropicApiKey } from "./version-BXm4o7Lz.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";
|
|
@@ -217,6 +217,9 @@ var CliError = class extends Error {};
|
|
|
217
217
|
function getDefaultElectricAgentsIdentity() {
|
|
218
218
|
return `${userInfo().username}@${hostname()}`;
|
|
219
219
|
}
|
|
220
|
+
function getDefaultElectricAgentsPrincipal() {
|
|
221
|
+
return `system:cli-${userInfo().username}`;
|
|
222
|
+
}
|
|
220
223
|
function parseElectricAgentsHeaders(raw) {
|
|
221
224
|
const trimmed = raw?.trim();
|
|
222
225
|
if (!trimmed) return void 0;
|
|
@@ -237,11 +240,12 @@ function parseElectricAgentsHeaders(raw) {
|
|
|
237
240
|
}
|
|
238
241
|
function getElectricCliEnv(env = process.env) {
|
|
239
242
|
const explicitIdentity = env.ELECTRIC_AGENTS_IDENTITY?.trim();
|
|
243
|
+
const explicitPrincipal = env.ELECTRIC_AGENTS_PRINCIPAL?.trim();
|
|
240
244
|
const headers = parseElectricAgentsHeaders(env.ELECTRIC_AGENTS_SERVER_HEADERS);
|
|
241
245
|
return {
|
|
242
246
|
electricAgentsUrl: env.ELECTRIC_AGENTS_URL || DEFAULT_ELECTRIC_AGENTS_URL,
|
|
243
247
|
electricAgentsIdentity: explicitIdentity || getDefaultElectricAgentsIdentity(),
|
|
244
|
-
electricAgentsHeaders: mergeElectricPrincipalHeader(headers,
|
|
248
|
+
electricAgentsHeaders: mergeElectricPrincipalHeader(headers, explicitPrincipal || getDefaultElectricAgentsPrincipal())
|
|
245
249
|
};
|
|
246
250
|
}
|
|
247
251
|
function getErrorMessage(error) {
|
|
@@ -491,10 +495,7 @@ async function spawnEntity(env, urlPath, options) {
|
|
|
491
495
|
}
|
|
492
496
|
async function sendMessage(env, url, message, options) {
|
|
493
497
|
const payload = parsePayload(message, options.json ?? false);
|
|
494
|
-
const body = {
|
|
495
|
-
from: env.electricAgentsIdentity,
|
|
496
|
-
payload
|
|
497
|
-
};
|
|
498
|
+
const body = { payload };
|
|
498
499
|
if (options.type) body.type = options.type;
|
|
499
500
|
const res = await electricAgentsFetch(env, entityApiPath(url, `/send`), {
|
|
500
501
|
method: `POST`,
|
|
@@ -669,7 +670,7 @@ function getHelpText(commandName) {
|
|
|
669
670
|
Environment:
|
|
670
671
|
ELECTRIC_AGENTS_URL Base URL of the server (default: ${DEFAULT_ELECTRIC_AGENTS_URL})
|
|
671
672
|
ELECTRIC_AGENTS_IDENTITY Sender identity for messages (default: ${getDefaultElectricAgentsIdentity()})
|
|
672
|
-
ELECTRIC_AGENTS_PRINCIPAL
|
|
673
|
+
ELECTRIC_AGENTS_PRINCIPAL Principal key sent as the Electric-Principal header (default: ${getDefaultElectricAgentsPrincipal()})
|
|
673
674
|
ELECTRIC_AGENTS_SERVER_HEADERS Optional JSON object of additional server headers
|
|
674
675
|
ANTHROPIC_API_KEY Required for '${agentsCommand} start-builtin' and '${agentsCommand} quickstart'
|
|
675
676
|
|
package/dist/start.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-BCwAaXi7.cjs');
|
|
3
|
-
const require_version = require('./version-
|
|
3
|
+
const require_version = require('./version-BU1gpSFU.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"));
|
package/dist/start.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ELECTRIC_AGENTS_SERVER_IMAGE_TAG, ELECTRIC_IMAGE_TAG, readDotEnvFile$1 as readDotEnvFile, resolveAnthropicApiKey$1 as resolveAnthropicApiKey } from "./version-
|
|
1
|
+
import { ELECTRIC_AGENTS_SERVER_IMAGE_TAG, ELECTRIC_IMAGE_TAG, readDotEnvFile$1 as readDotEnvFile, resolveAnthropicApiKey$1 as resolveAnthropicApiKey } from "./version-BXm4o7Lz.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";
|
|
@@ -45,7 +45,7 @@ function resolveAnthropicApiKey(options, env = process.env, fileEnv = readDotEnv
|
|
|
45
45
|
* For release builds these remain "latest".
|
|
46
46
|
* The canary CI overwrites them to "canary" before building.
|
|
47
47
|
*/
|
|
48
|
-
const injectedCliVersion = `0.2.
|
|
48
|
+
const injectedCliVersion = `0.2.21`;
|
|
49
49
|
const ELECTRIC_AX_CLI_VERSION = injectedCliVersion.startsWith(`__ELECTRIC_AX_`) ? `0.0.0` : injectedCliVersion;
|
|
50
50
|
const ELECTRIC_IMAGE_TAG = `latest`;
|
|
51
51
|
const ELECTRIC_AGENTS_SERVER_IMAGE_TAG = `latest`;
|
|
@@ -43,7 +43,7 @@ function resolveAnthropicApiKey(options, env = process.env, fileEnv = readDotEnv
|
|
|
43
43
|
* For release builds these remain "latest".
|
|
44
44
|
* The canary CI overwrites them to "canary" before building.
|
|
45
45
|
*/
|
|
46
|
-
const injectedCliVersion = `0.2.
|
|
46
|
+
const injectedCliVersion = `0.2.21`;
|
|
47
47
|
const ELECTRIC_AX_CLI_VERSION = injectedCliVersion.startsWith(`__ELECTRIC_AX_`) ? `0.0.0` : injectedCliVersion;
|
|
48
48
|
const ELECTRIC_IMAGE_TAG = `latest`;
|
|
49
49
|
const ELECTRIC_AGENTS_SERVER_IMAGE_TAG = `latest`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electric-ax",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
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": "0.
|
|
50
|
-
"@electric-ax/agents-runtime": "0.
|
|
49
|
+
"@electric-ax/agents": "0.6.1",
|
|
50
|
+
"@electric-ax/agents-runtime": "0.6.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@vitest/coverage-v8": "^4.1.0",
|