@eve-horizon/cli 0.2.37 → 0.2.38
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.js +117 -18
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -62200,6 +62200,84 @@ var import_child_process = require("child_process");
|
|
|
62200
62200
|
var import_util4 = require("util");
|
|
62201
62201
|
var execFileAsync = (0, import_util4.promisify)(import_child_process.execFile);
|
|
62202
62202
|
|
|
62203
|
+
// src/lib/logs.ts
|
|
62204
|
+
function normalizeLogLine(line) {
|
|
62205
|
+
const kind = line.kind;
|
|
62206
|
+
const raw = line.raw;
|
|
62207
|
+
if (!kind || !raw) {
|
|
62208
|
+
return {
|
|
62209
|
+
type: line.type || "log",
|
|
62210
|
+
message: line.message || line.text || void 0,
|
|
62211
|
+
tool: line.tool,
|
|
62212
|
+
toolInput: line.tool_input,
|
|
62213
|
+
raw: line
|
|
62214
|
+
};
|
|
62215
|
+
}
|
|
62216
|
+
const rawType = raw.type;
|
|
62217
|
+
const item = raw.item;
|
|
62218
|
+
if (rawType === "item.completed" && item) {
|
|
62219
|
+
const itemType = item.type;
|
|
62220
|
+
if (itemType === "agent_message" && typeof item.text === "string") {
|
|
62221
|
+
return { type: "assistant", message: item.text, raw: line };
|
|
62222
|
+
}
|
|
62223
|
+
if (itemType === "command_execution") {
|
|
62224
|
+
const cmd = item.command;
|
|
62225
|
+
const exitCode = item.exit_code;
|
|
62226
|
+
const status = item.status;
|
|
62227
|
+
if (status === "completed" || exitCode !== void 0) {
|
|
62228
|
+
return { type: "tool_result", message: `exit ${exitCode ?? "?"}`, tool: "bash", toolInput: cmd, raw: line };
|
|
62229
|
+
}
|
|
62230
|
+
return { type: "tool_use", tool: "bash", toolInput: cmd, raw: line };
|
|
62231
|
+
}
|
|
62232
|
+
if (itemType === "file_change") {
|
|
62233
|
+
const changes = item.changes;
|
|
62234
|
+
if (changes?.length) {
|
|
62235
|
+
const summary = changes.map((c) => {
|
|
62236
|
+
const changeKind = c.kind || "?";
|
|
62237
|
+
const filePath = c.path || "";
|
|
62238
|
+
const shortPath = filePath.split("/").slice(-3).join("/");
|
|
62239
|
+
return `${changeKind}: ${shortPath}`;
|
|
62240
|
+
}).join(", ");
|
|
62241
|
+
return { type: "tool_use", tool: "file_change", toolInput: summary, raw: line };
|
|
62242
|
+
}
|
|
62243
|
+
}
|
|
62244
|
+
}
|
|
62245
|
+
if (rawType === "item.started" && item) {
|
|
62246
|
+
const itemType = item.type;
|
|
62247
|
+
if (itemType === "command_execution") {
|
|
62248
|
+
const cmd = item.command;
|
|
62249
|
+
return { type: "tool_use", tool: "bash", toolInput: cmd, raw: line };
|
|
62250
|
+
}
|
|
62251
|
+
}
|
|
62252
|
+
if (rawType === "turn.completed") {
|
|
62253
|
+
return { type: "skip", raw: line };
|
|
62254
|
+
}
|
|
62255
|
+
if (rawType === "assistant") {
|
|
62256
|
+
const message = raw.message;
|
|
62257
|
+
const text = message?.content?.filter((c) => c.text).map((c) => c.text).join("\n");
|
|
62258
|
+
return { type: "assistant", message: text || void 0, raw: line };
|
|
62259
|
+
}
|
|
62260
|
+
if (kind === "assistant") {
|
|
62261
|
+
const msg = raw.msg;
|
|
62262
|
+
const text = msg?.text || item?.text || void 0;
|
|
62263
|
+
return { type: "assistant", message: text, raw: line };
|
|
62264
|
+
}
|
|
62265
|
+
if (kind === "tool_use") {
|
|
62266
|
+
return { type: "tool_use", tool: line.tool || void 0, raw: line };
|
|
62267
|
+
}
|
|
62268
|
+
if (kind === "error") {
|
|
62269
|
+
return { type: "error", message: raw.error || raw.content || void 0, raw: line };
|
|
62270
|
+
}
|
|
62271
|
+
if (rawType === "stderr") {
|
|
62272
|
+
const content = raw.content;
|
|
62273
|
+
return { type: "status", message: content, raw: line };
|
|
62274
|
+
}
|
|
62275
|
+
if (rawType === "harness_startup") {
|
|
62276
|
+
return { type: "skip", raw: line };
|
|
62277
|
+
}
|
|
62278
|
+
return { type: kind || "log", raw: line };
|
|
62279
|
+
}
|
|
62280
|
+
|
|
62203
62281
|
// src/commands/job.ts
|
|
62204
62282
|
async function handleJob(subcommand, positionals, flags, context2) {
|
|
62205
62283
|
const json = Boolean(flags.json);
|
|
@@ -63732,30 +63810,46 @@ function formatLogEntry(log) {
|
|
|
63732
63810
|
}
|
|
63733
63811
|
return;
|
|
63734
63812
|
}
|
|
63735
|
-
const
|
|
63736
|
-
const
|
|
63737
|
-
|
|
63813
|
+
const normalized = normalizeLogLine(line);
|
|
63814
|
+
const nType = normalized.type;
|
|
63815
|
+
if (nType === "skip") return;
|
|
63816
|
+
const message = normalized.message || line.message || line.text || "";
|
|
63817
|
+
const tool = normalized.tool || line.tool || void 0;
|
|
63818
|
+
const toolInput = normalized.toolInput || line.tool_input || void 0;
|
|
63738
63819
|
const toolResult = line.tool_result;
|
|
63739
|
-
switch (
|
|
63820
|
+
switch (nType) {
|
|
63740
63821
|
case "assistant":
|
|
63741
63822
|
case "text":
|
|
63742
|
-
|
|
63823
|
+
if (message) {
|
|
63824
|
+
console.log(`[${timestamp}] ${message}`);
|
|
63825
|
+
}
|
|
63743
63826
|
break;
|
|
63744
63827
|
case "tool_use":
|
|
63745
|
-
|
|
63828
|
+
if (tool) {
|
|
63829
|
+
const inputPreview = toolInput ? ` ${toolInput.substring(0, 80)}${toolInput.length > 80 ? "..." : ""}` : "";
|
|
63830
|
+
console.log(`[${timestamp}] ${tool}${inputPreview}`);
|
|
63831
|
+
}
|
|
63746
63832
|
break;
|
|
63747
63833
|
case "tool_result":
|
|
63748
|
-
const resultPreview = (toolResult || "").substring(0, 100);
|
|
63749
|
-
|
|
63834
|
+
const resultPreview = (toolResult || normalized.message || "").substring(0, 100);
|
|
63835
|
+
if (resultPreview) {
|
|
63836
|
+
console.log(`[${timestamp}] -> ${resultPreview}${(toolResult?.length || 0) > 100 ? "..." : ""}`);
|
|
63837
|
+
}
|
|
63750
63838
|
break;
|
|
63751
63839
|
case "error":
|
|
63752
|
-
console.log(`[${timestamp}]
|
|
63840
|
+
console.log(`[${timestamp}] Error: ${message || JSON.stringify(line)}`);
|
|
63753
63841
|
break;
|
|
63754
63842
|
case "status":
|
|
63755
|
-
|
|
63843
|
+
if (message) {
|
|
63844
|
+
console.log(`[${timestamp}] > ${message}`);
|
|
63845
|
+
}
|
|
63756
63846
|
break;
|
|
63757
63847
|
default:
|
|
63758
|
-
|
|
63848
|
+
if (message) {
|
|
63849
|
+
console.log(`[${timestamp}] ${message}`);
|
|
63850
|
+
} else if (Object.keys(line).length > 0) {
|
|
63851
|
+
console.log(`[${timestamp}] ${JSON.stringify(line)}`);
|
|
63852
|
+
}
|
|
63759
63853
|
}
|
|
63760
63854
|
}
|
|
63761
63855
|
function getLifecycleIcon(phase) {
|
|
@@ -64676,10 +64770,13 @@ function formatFollowLogLine(event) {
|
|
|
64676
64770
|
);
|
|
64677
64771
|
return;
|
|
64678
64772
|
}
|
|
64679
|
-
const
|
|
64680
|
-
const
|
|
64681
|
-
|
|
64682
|
-
|
|
64773
|
+
const normalized = normalizeLogLine(line);
|
|
64774
|
+
const nType = normalized.type;
|
|
64775
|
+
if (nType === "skip") return;
|
|
64776
|
+
const message = normalized.message || line.message || line.text || "";
|
|
64777
|
+
const tool = normalized.tool || line.tool || void 0;
|
|
64778
|
+
const toolInput = normalized.toolInput || line.tool_input || void 0;
|
|
64779
|
+
switch (nType) {
|
|
64683
64780
|
case "assistant":
|
|
64684
64781
|
case "text":
|
|
64685
64782
|
if (message) {
|
|
@@ -64688,14 +64785,16 @@ function formatFollowLogLine(event) {
|
|
|
64688
64785
|
break;
|
|
64689
64786
|
case "tool_use":
|
|
64690
64787
|
if (tool) {
|
|
64691
|
-
const inputPreview = toolInput ? ` ${toolInput.substring(0,
|
|
64692
|
-
console.log(`[${timestamp}]
|
|
64788
|
+
const inputPreview = toolInput ? ` ${toolInput.substring(0, 80)}${toolInput.length > 80 ? "..." : ""}` : "";
|
|
64789
|
+
console.log(`[${timestamp}] ${tool}${inputPreview}`);
|
|
64693
64790
|
}
|
|
64694
64791
|
break;
|
|
64695
64792
|
case "tool_result":
|
|
64696
64793
|
break;
|
|
64697
64794
|
case "status":
|
|
64698
|
-
|
|
64795
|
+
if (message) {
|
|
64796
|
+
console.log(`[${timestamp}] > ${message}`);
|
|
64797
|
+
}
|
|
64699
64798
|
break;
|
|
64700
64799
|
case "error":
|
|
64701
64800
|
console.log(`[${timestamp}] Error: ${message || JSON.stringify(line)}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eve-horizon/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.38",
|
|
4
4
|
"description": "Eve Horizon CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,9 +18,6 @@
|
|
|
18
18
|
"assets",
|
|
19
19
|
"README.md"
|
|
20
20
|
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --target=node22 --outfile=dist/index.js --format=cjs --external:yaml"
|
|
23
|
-
},
|
|
24
21
|
"publishConfig": {
|
|
25
22
|
"access": "public"
|
|
26
23
|
},
|
|
@@ -31,11 +28,14 @@
|
|
|
31
28
|
"yaml": "^2.5.1"
|
|
32
29
|
},
|
|
33
30
|
"devDependencies": {
|
|
34
|
-
"@eve/migrate": "workspace:*",
|
|
35
|
-
"@eve/shared": "workspace:*",
|
|
36
31
|
"@types/node": "^22.0.0",
|
|
37
32
|
"esbuild": "^0.27.3",
|
|
38
33
|
"postgres": "^3.4.0",
|
|
39
|
-
"typescript": "^5.7.0"
|
|
34
|
+
"typescript": "^5.7.0",
|
|
35
|
+
"@eve/migrate": "0.0.1",
|
|
36
|
+
"@eve/shared": "0.0.1"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --target=node22 --outfile=dist/index.js --format=cjs --external:yaml"
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
}
|