@vendian/cli 0.0.13 → 0.0.14

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.
Files changed (2) hide show
  1. package/cli-wrapper.mjs +70 -7
  2. 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.13" : process.env.npm_package_version || "0.0.0-dev";
36782
+ var CLI_VERSION = true ? "0.0.14" : 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 runState = event.status === "error" ? setAgentRunState(state.agentRunState, agentLabel(event), {
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: `${agentLabel(event)} ${event.status === "error" ? "needs setup" : "ready"}`,
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 === "online" && current?.status === "error" && !current?.runId) {
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,15 +38688,48 @@ 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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendian/cli",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Public Vendian CLI bootstrapper and launcher",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,