@chit-run/cli 0.4.0 → 0.5.0

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/dist/chit.js +47 -0
  2. package/package.json +2 -2
package/dist/chit.js CHANGED
@@ -35842,6 +35842,9 @@ class ConvergeStore {
35842
35842
  if (this.sessions.has(loopId))
35843
35843
  this.lastTouched.set(loopId, now);
35844
35844
  }
35845
+ list() {
35846
+ return [...this.sessions.values()];
35847
+ }
35845
35848
  sweep(now) {
35846
35849
  const evicted = [];
35847
35850
  for (const [loopId, session] of this.sessions) {
@@ -36078,6 +36081,9 @@ class RunStore {
36078
36081
  if (this.runs.has(runId))
36079
36082
  this.lastTouched.set(runId, now);
36080
36083
  }
36084
+ list() {
36085
+ return [...this.runs.values()];
36086
+ }
36081
36087
  sweep(now) {
36082
36088
  const evicted = [];
36083
36089
  for (const [runId, run] of this.runs) {
@@ -36098,6 +36104,39 @@ class RunStore {
36098
36104
  }
36099
36105
  }
36100
36106
 
36107
+ // src/surfaces/mcp/status.ts
36108
+ function summarizeRunForStatus(run) {
36109
+ const complete = isComplete(run);
36110
+ return {
36111
+ run_id: run.runId,
36112
+ manifest: run.manifest.id,
36113
+ complete,
36114
+ ready: complete ? [] : readySteps(run),
36115
+ audited: run.recorder !== undefined && run.recorder.lastError === undefined
36116
+ };
36117
+ }
36118
+ function byNewest(items) {
36119
+ return [...items].sort((a, b) => b.startedAtMs - a.startedAtMs);
36120
+ }
36121
+ function recentRuns(auditStore, recentLimit) {
36122
+ if (recentLimit === 0)
36123
+ return [];
36124
+ try {
36125
+ return listAudit(auditStore, recentLimit);
36126
+ } catch {
36127
+ return [];
36128
+ }
36129
+ }
36130
+ function buildStatus(runs, convergeSessions, auditStore, recentLimit) {
36131
+ return {
36132
+ active: {
36133
+ runs: byNewest(runs.list()).map(summarizeRunForStatus),
36134
+ loops: byNewest(convergeSessions.list()).map(describeConverge)
36135
+ },
36136
+ recent: recentRuns(auditStore, recentLimit)
36137
+ };
36138
+ }
36139
+
36101
36140
  // src/surfaces/mcp/server.ts
36102
36141
  var runs = new RunStore;
36103
36142
  var controllers = new Map;
@@ -36480,6 +36519,14 @@ server.registerTool("chit_audit_show", {
36480
36519
  return errorResult(e.message);
36481
36520
  }
36482
36521
  });
36522
+ server.registerTool("chit_status", {
36523
+ description: "Operator overview: the stepwise runs and converge loops live in THIS server right now (each loop with its status and next action), plus a compact list of recently audited runs (newest first). Read-only; answers 'what is active and what should I do next?'. Active state is per-session (a new session starts empty, and idle runs are evicted); recent state is durable. Drill into one item with chit_converge_status/chit_trace, or chit_audit_show for a run's receipt.",
36524
+ inputSchema: {
36525
+ recent_limit: exports_external.number().int().min(0).default(5).describe("How many recently audited runs to include (newest first). Default 5; 0 for none.")
36526
+ }
36527
+ }, async ({ recent_limit }) => {
36528
+ return jsonResult(buildStatus(runs, convergeSessions, auditStore, recent_limit));
36529
+ });
36483
36530
  async function startMcpServer() {
36484
36531
  await server.connect(new StdioServerTransport);
36485
36532
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chit-run/cli",
3
- "version": "0.4.0",
4
- "description": "A thin runtime for multi-agent workflows. Stop being the glue between your agents.",
3
+ "version": "0.5.0",
4
+ "description": "Versioned, cross-vendor agent routines with an audit trail. Stop being the glue between your agents.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "homepage": "https://chit.run",