electric-ax 0.1.17 → 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/index.cjs +9 -4
- package/dist/index.js +9 -4
- package/dist/observe-ui.cjs +26 -0
- package/dist/observe-ui.js +26 -0
- package/dist/start.cjs +2 -1
- package/dist/start.js +2 -1
- package/package.json +4 -4
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.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
package/dist/start.js
CHANGED
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",
|