@vendian/cli 0.0.13 → 0.0.15
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/cli-wrapper.mjs +137 -10
- package/package.json +1 -1
package/cli-wrapper.mjs
CHANGED
|
@@ -36779,7 +36779,7 @@ import fs12 from "node:fs";
|
|
|
36779
36779
|
import readlinePromises from "node:readline/promises";
|
|
36780
36780
|
|
|
36781
36781
|
// src/version.js
|
|
36782
|
-
var CLI_VERSION = true ? "0.0.
|
|
36782
|
+
var CLI_VERSION = true ? "0.0.15" : process.env.npm_package_version || "0.0.0-dev";
|
|
36783
36783
|
|
|
36784
36784
|
// src/npm-update.js
|
|
36785
36785
|
var NPM_CHECK_INTERVAL_MS = 30 * 60 * 1e3;
|
|
@@ -37185,16 +37185,24 @@ function applyServeEvent(state, event) {
|
|
|
37185
37185
|
return { ...next, activity: `Preparing ${agentLabel(event)}` };
|
|
37186
37186
|
}
|
|
37187
37187
|
if (event.type === "agent_prepare_completed") {
|
|
37188
|
-
const
|
|
37188
|
+
const isError = event.status === "error";
|
|
37189
|
+
const isDisabled = event.status === "disabled";
|
|
37190
|
+
const runState = isError ? setAgentRunState(state.agentRunState, agentLabel(event), {
|
|
37189
37191
|
status: "error",
|
|
37190
37192
|
lastEventAt: event.timestamp || (/* @__PURE__ */ new Date()).toISOString(),
|
|
37191
37193
|
errorMessage: stringValue(event.error || event.errorMessage || "Agent setup failed")
|
|
37194
|
+
}) : isDisabled ? setAgentRunState(state.agentRunState, agentLabel(event), {
|
|
37195
|
+
status: "disabled",
|
|
37196
|
+
lastEventAt: event.timestamp || (/* @__PURE__ */ new Date()).toISOString(),
|
|
37197
|
+
disabledReason: stringValue(event.disabledReason || event.warning || "System dependency not met"),
|
|
37198
|
+
resolutionHints: Array.isArray(event.resolutionHints) ? event.resolutionHints : []
|
|
37192
37199
|
}) : state.agentRunState;
|
|
37200
|
+
const activityLabel = isError ? `${agentLabel(event)} needs setup` : isDisabled ? `${agentLabel(event)} disabled (deps not met locally)` : `${agentLabel(event)} ready`;
|
|
37193
37201
|
return {
|
|
37194
37202
|
...next,
|
|
37195
|
-
activity:
|
|
37203
|
+
activity: activityLabel,
|
|
37196
37204
|
agentRunState: runState,
|
|
37197
|
-
errors: event.error ? appendError(state.errors, agentLabel(event), event.error) : state.errors
|
|
37205
|
+
errors: isError && event.error ? appendError(state.errors, agentLabel(event), event.error) : state.errors
|
|
37198
37206
|
};
|
|
37199
37207
|
}
|
|
37200
37208
|
if (event.type === "inventory_synced") {
|
|
@@ -37309,12 +37317,14 @@ function applyServeEvent(state, event) {
|
|
|
37309
37317
|
return next;
|
|
37310
37318
|
}
|
|
37311
37319
|
function agentSummary(agents = []) {
|
|
37312
|
-
const summary = { online: 0, ready: 0, needsSetup: 0, errors: 0, total: agents.length };
|
|
37320
|
+
const summary = { online: 0, ready: 0, needsSetup: 0, errors: 0, disabled: 0, total: agents.length };
|
|
37313
37321
|
for (const agent of agents) {
|
|
37314
37322
|
const status = String(agent.status || "");
|
|
37315
37323
|
if (status === "error") {
|
|
37316
37324
|
summary.errors += 1;
|
|
37317
37325
|
summary.needsSetup += 1;
|
|
37326
|
+
} else if (status === "disabled") {
|
|
37327
|
+
summary.disabled += 1;
|
|
37318
37328
|
} else if (status === "online") {
|
|
37319
37329
|
summary.online += 1;
|
|
37320
37330
|
summary.ready += 1;
|
|
@@ -37500,6 +37510,15 @@ function agentRuntimeStatus(agent, agentRunState = {}) {
|
|
|
37500
37510
|
if (run2?.status === "error" || inventoryStatus === "error") {
|
|
37501
37511
|
return { status: "error", label: "error", run: run2 };
|
|
37502
37512
|
}
|
|
37513
|
+
if (run2?.status === "disabled" || inventoryStatus === "disabled") {
|
|
37514
|
+
return {
|
|
37515
|
+
status: "disabled",
|
|
37516
|
+
label: "disabled",
|
|
37517
|
+
run: run2,
|
|
37518
|
+
disabledReason: run2?.disabledReason || agent?.disabledReason || "System dependency not met locally",
|
|
37519
|
+
resolutionHints: run2?.resolutionHints || agent?.resolutionHints || []
|
|
37520
|
+
};
|
|
37521
|
+
}
|
|
37503
37522
|
if (inventoryStatus === "online") {
|
|
37504
37523
|
return { status: run2?.status === "completed" ? "completed" : "ready", label: "ready", run: run2 };
|
|
37505
37524
|
}
|
|
@@ -37532,11 +37551,20 @@ function reconcileInventoryRunState(agentRunState, agents, timestamp) {
|
|
|
37532
37551
|
lastEventAt: timestamp || (/* @__PURE__ */ new Date()).toISOString(),
|
|
37533
37552
|
errorMessage: stringValue(agent.errorMessage || agent.error || "Agent setup failed")
|
|
37534
37553
|
});
|
|
37535
|
-
} else if (agent?.status === "
|
|
37554
|
+
} else if (agent?.status === "disabled") {
|
|
37555
|
+
next = setAgentRunState(next, path8, {
|
|
37556
|
+
status: "disabled",
|
|
37557
|
+
lastEventAt: timestamp || (/* @__PURE__ */ new Date()).toISOString(),
|
|
37558
|
+
disabledReason: stringValue(agent.disabledReason || "System dependency not met locally"),
|
|
37559
|
+
resolutionHints: Array.isArray(agent.resolutionHints) ? agent.resolutionHints : []
|
|
37560
|
+
});
|
|
37561
|
+
} else if (agent?.status === "online" && (current?.status === "error" || current?.status === "disabled") && !current?.runId) {
|
|
37536
37562
|
next = setAgentRunState(next, path8, {
|
|
37537
37563
|
status: "ready",
|
|
37538
37564
|
lastEventAt: timestamp || (/* @__PURE__ */ new Date()).toISOString(),
|
|
37539
|
-
errorMessage: null
|
|
37565
|
+
errorMessage: null,
|
|
37566
|
+
disabledReason: null,
|
|
37567
|
+
resolutionHints: null
|
|
37540
37568
|
});
|
|
37541
37569
|
}
|
|
37542
37570
|
}
|
|
@@ -38583,6 +38611,7 @@ function ServeScreen({ env: env3, platform: platform2, input, onBack, onState, o
|
|
|
38583
38611
|
null,
|
|
38584
38612
|
h(Text2, { color: colors.muted }, " Agents: "),
|
|
38585
38613
|
h(Text2, { color: colors.success, bold: true }, `${summary.ready} ready`),
|
|
38614
|
+
summary.disabled > 0 && h(Text2, { color: colors.warning }, ` ${fig.dot} ${summary.disabled} disabled`),
|
|
38586
38615
|
summary.needsSetup > 0 && h(Text2, { color: colors.warning }, ` ${fig.dot} ${summary.needsSetup} needs setup`),
|
|
38587
38616
|
summary.errors > 0 && h(Text2, { color: colors.error }, ` ${fig.dot} ${summary.errors} errors`),
|
|
38588
38617
|
h(Text2, { color: colors.muted }, ` ${fig.dot} ${summary.total} total`)
|
|
@@ -38595,6 +38624,7 @@ function ServeScreen({ env: env3, platform: platform2, input, onBack, onState, o
|
|
|
38595
38624
|
),
|
|
38596
38625
|
h(AgentTable, { agents: state.agents, agentRunState: state.agentRunState }),
|
|
38597
38626
|
state.retry && h(Text2, { color: colors.warning }, ` ${fig.warning} Retry: ${state.retry.activity} in ${Number(state.retry.delaySeconds || 0).toFixed(1)}s`),
|
|
38627
|
+
h(DisabledAgentsFooter, { agents: state.agents, agentRunState: state.agentRunState }),
|
|
38598
38628
|
state.errors.length > 0 && h(
|
|
38599
38629
|
Box2,
|
|
38600
38630
|
{ flexDirection: "column", marginTop: 1 },
|
|
@@ -38658,18 +38688,109 @@ function AgentTable({ agents, agentRunState = {} }) {
|
|
|
38658
38688
|
hiddenCount > 0 && h(Text2, { color: colors.muted }, ` ${fig.ellipsis} and ${hiddenCount} more`)
|
|
38659
38689
|
);
|
|
38660
38690
|
}
|
|
38691
|
+
function DisabledAgentsFooter({ agents, agentRunState = {} }) {
|
|
38692
|
+
const disabledAgents = (agents || []).filter((agent) => {
|
|
38693
|
+
const runtime = agentRuntimeStatus(agent, agentRunState);
|
|
38694
|
+
return runtime.status === "disabled";
|
|
38695
|
+
});
|
|
38696
|
+
if (!disabledAgents.length) return null;
|
|
38697
|
+
const allHints = /* @__PURE__ */ new Set();
|
|
38698
|
+
for (const agent of disabledAgents) {
|
|
38699
|
+
const runtime = agentRuntimeStatus(agent, agentRunState);
|
|
38700
|
+
const hints = runtime.resolutionHints || agent.resolutionHints || [];
|
|
38701
|
+
for (const hint of hints) {
|
|
38702
|
+
allHints.add(hint);
|
|
38703
|
+
}
|
|
38704
|
+
}
|
|
38705
|
+
const disabledNames = disabledAgents.slice(0, 3).map((a) => a.manifestName || a.relativePath || "agent").join(", ");
|
|
38706
|
+
const suffix = disabledAgents.length > 3 ? ` (+${disabledAgents.length - 3} more)` : "";
|
|
38707
|
+
const lines = [
|
|
38708
|
+
h(
|
|
38709
|
+
Text2,
|
|
38710
|
+
{ key: "disabled-header", color: colors.warning },
|
|
38711
|
+
` ${fig.warning} ${disabledAgents.length} agent${disabledAgents.length === 1 ? "" : "s"} disabled locally (will work when deployed): ${disabledNames}${suffix}`
|
|
38712
|
+
)
|
|
38713
|
+
];
|
|
38714
|
+
const hintArr = [...allHints].slice(0, 3);
|
|
38715
|
+
for (let i = 0; i < hintArr.length; i++) {
|
|
38716
|
+
lines.push(
|
|
38717
|
+
h(Text2, { key: `hint-${i}`, color: colors.muted }, ` ${fig.arrowRight} ${hintArr[i]}`)
|
|
38718
|
+
);
|
|
38719
|
+
}
|
|
38720
|
+
return h(Box2, { flexDirection: "column", marginTop: 1 }, ...lines);
|
|
38721
|
+
}
|
|
38661
38722
|
function runtimeStatusColor(status) {
|
|
38662
38723
|
if (status === "running") return colors.accent;
|
|
38663
38724
|
if (status === "ready" || status === "completed") return colors.success;
|
|
38725
|
+
if (status === "disabled") return colors.warning;
|
|
38664
38726
|
if (status === "error") return colors.error;
|
|
38665
38727
|
return colors.warning;
|
|
38666
38728
|
}
|
|
38667
38729
|
function runtimeStatusIcon(status) {
|
|
38668
38730
|
if (status === "running") return fig.arrow;
|
|
38669
38731
|
if (status === "ready" || status === "completed") return fig.dot;
|
|
38732
|
+
if (status === "disabled") return fig.warning;
|
|
38670
38733
|
if (status === "error") return fig.cross;
|
|
38671
38734
|
return fig.dotEmpty;
|
|
38672
38735
|
}
|
|
38736
|
+
function agentStatusReason(agent) {
|
|
38737
|
+
const status = agent.status?.status;
|
|
38738
|
+
if (status === "error") {
|
|
38739
|
+
const msg = agent.status?.run?.errorMessage || agent.status?.run?.disabledReason || "";
|
|
38740
|
+
return msg || "Setup failed";
|
|
38741
|
+
}
|
|
38742
|
+
if (status === "disabled") {
|
|
38743
|
+
const msg = agent.status?.disabledReason || agent.status?.run?.disabledReason || "";
|
|
38744
|
+
return msg || "Deps not met locally";
|
|
38745
|
+
}
|
|
38746
|
+
return "";
|
|
38747
|
+
}
|
|
38748
|
+
function agentDetailStatusBlock(runtime, agent, agentRunState, relativePath) {
|
|
38749
|
+
const runState = (agentRunState || {})[relativePath];
|
|
38750
|
+
const lines = [];
|
|
38751
|
+
if (runtime.status === "error") {
|
|
38752
|
+
const errorMsg = runState?.errorMessage || agent?.errorMessage || "Unknown error during agent setup";
|
|
38753
|
+
lines.push(
|
|
38754
|
+
h(
|
|
38755
|
+
Text2,
|
|
38756
|
+
{ key: "err-header", color: colors.error, bold: true },
|
|
38757
|
+
` ${fig.cross} Error: Agent failed to prepare`
|
|
38758
|
+
)
|
|
38759
|
+
);
|
|
38760
|
+
lines.push(
|
|
38761
|
+
h(
|
|
38762
|
+
Text2,
|
|
38763
|
+
{ key: "err-msg", color: colors.error },
|
|
38764
|
+
` ${errorMsg}`
|
|
38765
|
+
)
|
|
38766
|
+
);
|
|
38767
|
+
lines.push(h(Text2, { key: "err-spacer" }, ""));
|
|
38768
|
+
} else if (runtime.status === "disabled") {
|
|
38769
|
+
const reason = runState?.disabledReason || runtime.disabledReason || agent?.disabledReason || "System dependency not met locally";
|
|
38770
|
+
const hints = runState?.resolutionHints || runtime.resolutionHints || agent?.resolutionHints || [];
|
|
38771
|
+
lines.push(
|
|
38772
|
+
h(
|
|
38773
|
+
Text2,
|
|
38774
|
+
{ key: "dis-header", color: colors.warning, bold: true },
|
|
38775
|
+
` ${fig.warning} Disabled: ${reason}`
|
|
38776
|
+
)
|
|
38777
|
+
);
|
|
38778
|
+
if (hints.length > 0) {
|
|
38779
|
+
for (let i = 0; i < Math.min(hints.length, 3); i++) {
|
|
38780
|
+
lines.push(
|
|
38781
|
+
h(
|
|
38782
|
+
Text2,
|
|
38783
|
+
{ key: `dis-hint-${i}`, color: colors.muted },
|
|
38784
|
+
` ${fig.arrowRight} ${hints[i]}`
|
|
38785
|
+
)
|
|
38786
|
+
);
|
|
38787
|
+
}
|
|
38788
|
+
}
|
|
38789
|
+
lines.push(h(Text2, { key: "dis-spacer" }, ""));
|
|
38790
|
+
}
|
|
38791
|
+
if (lines.length === 0) return null;
|
|
38792
|
+
return h(Box2, { flexDirection: "column" }, ...lines);
|
|
38793
|
+
}
|
|
38673
38794
|
function FooterBar({ items }) {
|
|
38674
38795
|
if (!items || !items.length) return null;
|
|
38675
38796
|
return h(
|
|
@@ -38756,7 +38877,8 @@ function AgentLogPicker({ agents, agentLogs, agentRunState = {}, onSelectAgent,
|
|
|
38756
38877
|
...agentList.map((agent, i) => {
|
|
38757
38878
|
const isActive = i === selectedIndex;
|
|
38758
38879
|
const logCountColor = agent.hasErrors ? colors.error : agent.logCount > 0 ? colors.success : colors.muted;
|
|
38759
|
-
const lastEvent = agent.lastLog ? formatAgentLogEntry(agent.lastLog) : "No logs";
|
|
38880
|
+
const lastEvent = agent.lastLog ? formatAgentLogEntry(agent.lastLog) : agentStatusReason(agent) || "No logs";
|
|
38881
|
+
const lastEventColor = agent.lastLog ? colors.muted : agent.status.status === "error" ? colors.error : agent.status.status === "disabled" ? colors.warning : colors.muted;
|
|
38760
38882
|
return h(
|
|
38761
38883
|
Text2,
|
|
38762
38884
|
{ key: agent.path },
|
|
@@ -38764,7 +38886,7 @@ function AgentLogPicker({ agents, agentLogs, agentRunState = {}, onSelectAgent,
|
|
|
38764
38886
|
h(Text2, { bold: isActive }, clip(agent.name, nameW - 2).padEnd(nameW)),
|
|
38765
38887
|
h(Text2, { color: runtimeStatusColor(agent.status.status) }, `${runtimeStatusIcon(agent.status.status)} ${agent.status.label}`.padEnd(statusW)),
|
|
38766
38888
|
h(Text2, { color: logCountColor }, String(agent.logCount).padEnd(6)),
|
|
38767
|
-
h(Text2, { color:
|
|
38889
|
+
h(Text2, { color: lastEventColor }, clip(lastEvent, 36))
|
|
38768
38890
|
);
|
|
38769
38891
|
}),
|
|
38770
38892
|
h(Text2, null, ""),
|
|
@@ -38810,7 +38932,12 @@ function AgentLogDetail({ relativePath, agentLogs, agentRunState = {}, agents, o
|
|
|
38810
38932
|
h(Text2, { color: runtimeStatusColor(runtime.status) }, `${runtimeStatusIcon(runtime.status)} ${runtime.label}`)
|
|
38811
38933
|
),
|
|
38812
38934
|
h(Text2, null, ""),
|
|
38813
|
-
logs.length === 0 ? h(
|
|
38935
|
+
logs.length === 0 ? h(
|
|
38936
|
+
Box2,
|
|
38937
|
+
{ flexDirection: "column" },
|
|
38938
|
+
agentDetailStatusBlock(runtime, agent, agentRunState, relativePath),
|
|
38939
|
+
h(Text2, { color: colors.muted }, " No run logs recorded yet. Logs appear during runs.")
|
|
38940
|
+
) : h(
|
|
38814
38941
|
Box2,
|
|
38815
38942
|
{ flexDirection: "column" },
|
|
38816
38943
|
...visibleRows.map((row, i) => {
|