@botbuddy/cli 1.63.0 → 1.63.1
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/daemon/bin/darwin-arm64/botbuddy-daemon +0 -0
- package/daemon/bin/linux-x64/botbuddy-daemon +0 -0
- package/daemon-release/darwin-arm64.json +4 -4
- package/daemon-release/linux-x64.json +4 -4
- package/daemon-release/manifest.json +5 -5
- package/package.json +1 -1
- package/src/wait-result.mjs +30 -8
- package/src/wait.mjs +2 -1
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.63.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.63.1",
|
|
3
|
+
"source_commit": "7f42fb391734dbc962548fddd42d4ccf84e63039",
|
|
4
|
+
"source_sha256": "7e21669993256b7566102111fe48ea9a2f7f5a309c962a99b82b4a2d27016d3d",
|
|
5
5
|
"target": "darwin-arm64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "a3d98f8e3d76fc7d30266fd5e261880615b5e8377e1211cf87fe3927dfb9f156"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.63.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.63.1",
|
|
3
|
+
"source_commit": "7f42fb391734dbc962548fddd42d4ccf84e63039",
|
|
4
|
+
"source_sha256": "7e21669993256b7566102111fe48ea9a2f7f5a309c962a99b82b4a2d27016d3d",
|
|
5
5
|
"target": "linux-x64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "1edca9db4f9e8e8d72b9112acf63ec6ba4ca09423cee8ef0afe4bae0abb78bc2"
|
|
7
7
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
|
-
"release_version": "1.63.
|
|
4
|
-
"source_commit": "
|
|
5
|
-
"source_sha256": "
|
|
3
|
+
"release_version": "1.63.1",
|
|
4
|
+
"source_commit": "7f42fb391734dbc962548fddd42d4ccf84e63039",
|
|
5
|
+
"source_sha256": "7e21669993256b7566102111fe48ea9a2f7f5a309c962a99b82b4a2d27016d3d",
|
|
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": "
|
|
11
|
+
"sha256": "a3d98f8e3d76fc7d30266fd5e261880615b5e8377e1211cf87fe3927dfb9f156",
|
|
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": "
|
|
18
|
+
"sha256": "1edca9db4f9e8e8d72b9112acf63ec6ba4ca09423cee8ef0afe4bae0abb78bc2",
|
|
19
19
|
"mode": "0755"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/package.json
CHANGED
package/src/wait-result.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { WaitCheckpointError } from "./wait-checkpoint.mjs";
|
|
|
10
10
|
const MAX_ARTIFACT_BYTES = 256 * 1024;
|
|
11
11
|
const MAX_RECEIPT_BYTES = 64 * 1024;
|
|
12
12
|
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
13
|
+
const COMMAND_STATUSES = new Set(["success", "failure", "cancelled", "timed_out", "owner_lost"]);
|
|
13
14
|
const TERMINAL_OUTCOMES = new Set(["matched", "timeout", "error", "superseded", "lease_lost", "abandoned", "cancelled"]);
|
|
14
15
|
|
|
15
16
|
// Persisted != delivered. Await the stream callback before exiting, including
|
|
@@ -73,16 +74,37 @@ async function receiptFromArtifact(path) {
|
|
|
73
74
|
const buffer = Buffer.alloc(MAX_ARTIFACT_BYTES + 1);
|
|
74
75
|
const { bytesRead } = await handle.read(buffer, 0, buffer.length, 0);
|
|
75
76
|
if (bytesRead > MAX_ARTIFACT_BYTES) throw new Error("unbounded artifact");
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
const content = buffer.subarray(0, bytesRead).toString("utf8");
|
|
78
|
+
let values;
|
|
79
|
+
try { values = [JSON.parse(content)]; }
|
|
80
|
+
catch {
|
|
81
|
+
values = [];
|
|
82
|
+
for (const line of content.split(/\r?\n/)) {
|
|
83
|
+
if (!line.trimStart().startsWith("{")) continue;
|
|
84
|
+
// A partial JSON document alongside a receipt is ambiguous. In
|
|
85
|
+
// particular, never ignore a pretty command receipt and accept a later
|
|
86
|
+
// wait line from the same artifact.
|
|
87
|
+
values.push(JSON.parse(line));
|
|
88
|
+
}
|
|
82
89
|
}
|
|
90
|
+
const receipts = values.filter((value) => value?.schema_version === 1 &&
|
|
91
|
+
(typeof value.outcome === "string" || (typeof value.run_id === "string" && typeof value.status === "string")));
|
|
83
92
|
if (receipts.length !== 1) throw new Error("expected exactly one receipt");
|
|
84
|
-
|
|
85
|
-
|
|
93
|
+
const [receipt] = receipts;
|
|
94
|
+
if (!receipt.outcome && UUID.test(receipt.run_id) && COMMAND_STATUSES.has(receipt.status)) {
|
|
95
|
+
// A diagnostic, never evidence that this caller owns the command or that
|
|
96
|
+
// its workload passed. Only a validated UUID may enter recovery argv;
|
|
97
|
+
// never echo command text, logs, paths, or recovery_command from the file.
|
|
98
|
+
const recovery = `Run bb run inspect ${receipt.run_id} from the owning checkout; preserve the command receipt and read its bounded_log for the workload verdict. Do not rerun unchanged validation.`;
|
|
99
|
+
const error = new WaitCheckpointError("wait_result_wrong_artifact", `This is a command-run receipt, not a bb wait receipt. ${recovery}`);
|
|
100
|
+
error.recoveryArgv = ["run", "inspect", receipt.run_id];
|
|
101
|
+
error.recovery = recovery;
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
if (typeof receipt.outcome !== "string") throw new Error("not a wait receipt");
|
|
105
|
+
return receipt;
|
|
106
|
+
} catch (error) {
|
|
107
|
+
if (error instanceof WaitCheckpointError) throw error;
|
|
86
108
|
// Never echo arbitrary artifact contents (which may include credentials).
|
|
87
109
|
throw new WaitCheckpointError("wait_observation_gap", "completion artifact must contain exactly one bounded terminal receipt");
|
|
88
110
|
} finally { await handle?.close(); }
|
package/src/wait.mjs
CHANGED
|
@@ -241,7 +241,8 @@ SUBCOMMANDS (saved waits live in this worktree's .botbuddy/waits/)
|
|
|
241
241
|
bb wait result [<local_wait_id>] [--from-file <path> --exit-code <n>]
|
|
242
242
|
read a terminal receipt without re-arming or acknowledging;
|
|
243
243
|
--from-file validates redirected output AFTER the original
|
|
244
|
-
command exits (see EXAMPLES)
|
|
244
|
+
wait command exits (see EXAMPLES). Command-run .receipt.json files
|
|
245
|
+
belong to bb run inspect <run_id>, not bb wait result.
|
|
245
246
|
bb wait resume <local_wait_id> recover one explicitly named saved wait
|
|
246
247
|
bb wait cancel <local_wait_id> explicitly stop one saved wait
|
|
247
248
|
bb wait acknowledge <local_wait_id> mark one saved terminal receipt read (after acting on it)
|