@botbuddy/cli 1.64.23 → 1.64.24

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.
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.64.23",
3
- "source_commit": "7ddae49af589d2fd829eb0a418114a16d69bde05",
4
- "source_sha256": "1516cc538b4b9d9dd1d81a6a5403bbdca1f2238385126993852e342a817c5c85",
2
+ "release_version": "1.64.24",
3
+ "source_commit": "7bfc909b46cc2bf6f7d45264be7e52ca16e69e13",
4
+ "source_sha256": "680b44125605dea4db83af948177743740b848b08f26619329e949e5a2e6253a",
5
5
  "target": "darwin-arm64",
6
- "sha256": "44289087b95f9f27b0b68743543ff65667849be9817f1dad2dc4c22ed5c8c4f0"
6
+ "sha256": "554e01cb52c8966c4946b467858873733afadc9f645e7add1598098bc7ec7b98"
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.64.23",
3
- "source_commit": "7ddae49af589d2fd829eb0a418114a16d69bde05",
4
- "source_sha256": "1516cc538b4b9d9dd1d81a6a5403bbdca1f2238385126993852e342a817c5c85",
2
+ "release_version": "1.64.24",
3
+ "source_commit": "7bfc909b46cc2bf6f7d45264be7e52ca16e69e13",
4
+ "source_sha256": "680b44125605dea4db83af948177743740b848b08f26619329e949e5a2e6253a",
5
5
  "target": "linux-x64",
6
- "sha256": "4f8a4996d9254a1c621bf4cd3c76cb5f676f7f2af9fe0700f2598ee4fce1728c"
6
+ "sha256": "01533501078482e1ac720ba05cd763c6f4196831ad55c6c15dcf5e8dda30d459"
7
7
  }
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "release_version": "1.64.23",
4
- "source_commit": "7ddae49af589d2fd829eb0a418114a16d69bde05",
5
- "source_sha256": "1516cc538b4b9d9dd1d81a6a5403bbdca1f2238385126993852e342a817c5c85",
3
+ "release_version": "1.64.24",
4
+ "source_commit": "7bfc909b46cc2bf6f7d45264be7e52ca16e69e13",
5
+ "source_sha256": "680b44125605dea4db83af948177743740b848b08f26619329e949e5a2e6253a",
6
6
  "targets": {
7
7
  "darwin-arm64": {
8
8
  "goos": "darwin",
9
9
  "goarch": "arm64",
10
10
  "binary": "daemon/bin/darwin-arm64/botbuddy-daemon",
11
- "sha256": "44289087b95f9f27b0b68743543ff65667849be9817f1dad2dc4c22ed5c8c4f0",
11
+ "sha256": "554e01cb52c8966c4946b467858873733afadc9f645e7add1598098bc7ec7b98",
12
12
  "mode": "0755"
13
13
  },
14
14
  "linux-x64": {
15
15
  "goos": "linux",
16
16
  "goarch": "amd64",
17
17
  "binary": "daemon/bin/linux-x64/botbuddy-daemon",
18
- "sha256": "4f8a4996d9254a1c621bf4cd3c76cb5f676f7f2af9fe0700f2598ee4fce1728c",
18
+ "sha256": "01533501078482e1ac720ba05cd763c6f4196831ad55c6c15dcf5e8dda30d459",
19
19
  "mode": "0755"
20
20
  }
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbuddy/cli",
3
- "version": "1.64.23",
3
+ "version": "1.64.24",
4
4
  "description": "BotBuddy \u2014 Swarm coordination CLI for multi-agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,103 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { randomUUID } from "node:crypto";
3
- import { mkdtemp, readdir } from "node:fs/promises";
4
- import { tmpdir } from "node:os";
5
- import { join } from "node:path";
6
- import { cmdFeedback } from "./feedback.mjs";
7
- import { cmdRun, OUTCOME_CHANNEL } from "./stack.mjs";
8
- import { harnessSessionIdFromEnv } from "./agent-state.mjs";
9
-
10
- const endpoint = process.argv[2];
11
- const out = [], errors = [];
12
- const evidenceLink = "https://app.bot-buddy.ai/waits?wait=485c66f8-c804-4a0f-a49e-2ceaf06344f8";
13
- const deps = (foreign = false) => ({
14
- read: async () => JSON.stringify({ idempotency_key: randomUUID(), kind: "bug", surface: "cli", title: "CLI feedback integration", impact: "slowed", evidence: [{ type: "url", value: evidenceLink }] }),
15
- resolveAuth: async () => ({ auth: {} }),
16
- call: async (tool, args) => (await fetch(endpoint, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ tool, args, foreign }) })).json(),
17
- log: (line) => out.push(line), errorLog: (line) => errors.push(line),
18
- });
19
- assert.equal(await cmdFeedback(["submit", "--file", "report.json"], deps()), 0);
20
- const receipt = JSON.parse(out.pop()), id = receipt.feedback_id;
21
- assert.equal(receipt.status_command, `bb feedback status --feedback-id ${id}`);
22
- assert.equal(await cmdFeedback(["status", "--feedback-id", id], deps()), 0);
23
- const status = JSON.parse(out.pop());
24
- assert.equal(status.feedback_id, id);
25
- assert.equal(status.report.evidence[0].value, evidenceLink);
26
- assert.equal(await cmdFeedback(["updates", "--feedback-id", id], deps()), 0);
27
- const updates = JSON.parse(out.pop());
28
- assert.ok(updates.items.length > 0);
29
- const revision = updates.items[0].revision;
30
- assert.equal(updates.items[0].acknowledge_command, `bb feedback acknowledge --feedback-id ${id} --revision ${revision}`);
31
- assert.equal(await cmdFeedback(["acknowledge", "--feedback-id", id, "--revision", String(revision)], deps()), 0);
32
- assert.equal(JSON.parse(out.pop()).revision, revision);
33
- assert.equal(await cmdFeedback(["updates", "--feedback-id", id], deps()), 0);
34
- assert.ok(JSON.parse(out.pop()).items[0].acknowledged_at);
35
- assert.deepEqual(errors, []);
36
- assert.equal(await cmdFeedback(["status", "--feedback-id", id], deps(true)), 1);
37
- assert.match(errors[0], /unavailable/);
38
- const sourceRun = randomUUID();
39
- const failure = { exitCode: 6, outcome: "failed", code: "TUNNEL_LOST", parkReason: "tunnel_lost", leaseId: randomUUID(), childExitCode: 143, cleanup: { ok: true }, fenced: false };
40
- Object.defineProperty(failure, OUTCOME_CHANNEL, { value: { auth: {}, callTool: deps().call }, enumerable: false });
41
- const originalWrite = process.stdout.write;
42
- let stackReceipt = "", feedbackMessage = "";
43
- try {
44
- process.stdout.write = (chunk) => { stackReceipt += chunk; return true; };
45
- const code = await cmdRun({ repo: "botbuddy-web", ticket: "BOT-1540", runId: sourceRun }, ["true"], { lifecycle: async () => failure, env: { BOTBUDDY_STACK_RUN_OUTCOME: "on" }, feedbackLog: (message) => { feedbackMessage += message; }, markFeedback: () => {} });
46
- assert.equal(code, 6);
47
- } finally { process.stdout.write = originalWrite; }
48
- assert.equal(JSON.parse(stackReceipt).exit_code, 6);
49
- assert.equal(JSON.parse(stackReceipt).feedback_recovery.recover_command, "bb feedback recover");
50
- const capturedId = /bb feedback status --feedback-id ([0-9a-f-]+)/i.exec(feedbackMessage)?.[1];
51
- assert.ok(capturedId, "stack failure must expose the captured feedback ID");
52
- assert.ok(feedbackMessage.includes(`bb feedback enrich --feedback-id ${capturedId}`));
53
- assert.equal(await cmdFeedback(["status", "--feedback-id", capturedId], deps()), 0);
54
- const auto = JSON.parse(out.pop());
55
- assert.equal(auto.report.correlation_id, sourceRun);
56
- assert.equal(auto.capture_state, "needs_context");
57
- assert.equal(auto.failure_attribution, "exact");
58
- const duplicateDeps = deps();
59
- duplicateDeps.read = async () => JSON.stringify({ idempotency_key: randomUUID(), kind: "bug", surface: "stack", title: "A separately drafted report", impact: "blocked", correlation_id: sourceRun });
60
- const duplicateExit = await cmdFeedback(["submit", "--file", "report.json"], duplicateDeps);
61
- assert.equal(duplicateExit, 1, `duplicate-source receipt: ${out.at(-1)}`);
62
- const duplicate = JSON.parse(out.pop());
63
- assert.equal(duplicate.error, "source_already_reported");
64
- assert.equal(duplicate.feedback_id, capturedId);
65
- assert.equal(duplicate.submitted_context_saved, false);
66
- assert.deepEqual(duplicate.enrich_argv, ["bb", "feedback", "enrich", "--feedback-id", capturedId, "--file", "report.json"]);
67
- assert.equal(await cmdFeedback(["recover"], deps()), 0);
68
- assert.equal(JSON.parse(out.pop()).complete, true);
69
- // Lose the first reply after the real MCP handler commits; the private outbox
70
- // must replay the same key only after real session whoami confirms its owner.
71
- const root = await mkdtemp(join(tmpdir(), "bb-feedback-live-replay-"));
72
- const queueKey = randomUUID(), fixtureToken = "fixture-session-token";
73
- let dropResponse = true;
74
- const outboxDeps = {
75
- ...deps(), cwd: root, rootFor: async () => root,
76
- loadState: async () => ({ agent_id: process.argv[3], tenant: "botbuddy", agent_session_token: fixtureToken, harness_session_id: harnessSessionIdFromEnv() }),
77
- resolveAuth: async () => ({ auth: { "x-agent-api-key": fixtureToken }, sessionToken: true }),
78
- read: async () => JSON.stringify({ idempotency_key: queueKey, kind: "bug", surface: "cli", title: "Offline replay fixture", impact: "slowed", evidence: [{ type: "url", value: evidenceLink }] }),
79
- call: async (tool, args) => {
80
- const response = await (await fetch(endpoint, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ tool, args, session: true }) })).json();
81
- if (tool === "submit_feedback" && dropResponse) { dropResponse = false; return { ok: false, status: null, error: "lost_reply" }; }
82
- return response;
83
- },
84
- };
85
- assert.equal(await cmdFeedback(["submit", "--file", "report.json"], outboxDeps), 5);
86
- assert.equal(JSON.parse(out.pop()).queued_locally, true);
87
- assert.equal(await cmdFeedback(["flush"], outboxDeps), 0);
88
- assert.equal(JSON.parse(out.pop()).delivered, 1);
89
- assert.deepEqual(await readdir(join(root, ".botbuddy", "feedback-outbox")), []);
90
- dropResponse = true;
91
- const duplicateKey = randomUUID();
92
- outboxDeps.read = async () => JSON.stringify({ idempotency_key: duplicateKey, kind: "bug", surface: "stack", title: "Queued tunnel report", impact: "blocked", correlation_id: sourceRun });
93
- assert.equal(await cmdFeedback(["submit", "--file", "report.json"], outboxDeps), 5);
94
- assert.equal(JSON.parse(out.pop()).queued_locally, true);
95
- assert.equal(await cmdFeedback(["flush"], outboxDeps), 1);
96
- const queuedDuplicate = JSON.parse(out.pop());
97
- assert.equal(queuedDuplicate.error, "source_already_reported");
98
- assert.equal(queuedDuplicate.feedback_id, capturedId);
99
- assert.equal(await cmdFeedback(["enrich", "--feedback-id", capturedId, "--file", queuedDuplicate.enrich_argv[6]], outboxDeps), 0);
100
- out.pop();
101
- assert.equal(await cmdFeedback(["flush"], outboxDeps), 0);
102
- assert.equal(JSON.parse(out.pop()).delivered, 1);
103
- process.stdout.write("feedback CLI round-trip passed\n");