bitfab 0.60.0 → 0.61.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.
- package/dist/{chunk-HKQGI5WP.js → chunk-2M62EGYK.js} +2 -2
- package/dist/{chunk-HKQGI5WP.js.map → chunk-2M62EGYK.js.map} +1 -1
- package/dist/{chunk-ASJPN3L2.js → chunk-3BTITSNA.js} +2 -2
- package/dist/{chunk-ASJPN3L2.js.map → chunk-3BTITSNA.js.map} +1 -1
- package/dist/{chunk-7GIZS4E2.js → chunk-6JQL37VC.js} +2 -2
- package/dist/{chunk-YS75T7YL.js → chunk-J54ZR6NF.js} +3 -3
- package/dist/{chunk-RXKKTRSN.js → chunk-O52C6BRF.js} +6 -6
- package/dist/chunk-O52C6BRF.js.map +1 -0
- package/dist/{http-EQLFIFHN.js → http-2EZA7I4F.js} +2 -2
- package/dist/{http-QKQUDVEX.js → http-PKQBVZD6.js} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +3 -3
- package/dist/node.cjs +1 -1
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +3 -3
- package/dist/{replay-TAYX5PBU.js → replay-XC2YOK4X.js} +3 -3
- package/dist/replayCli.js +81 -3
- package/dist/replayCli.js.map +1 -1
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-RXKKTRSN.js.map +0 -1
- /package/dist/{chunk-7GIZS4E2.js.map → chunk-6JQL37VC.js.map} +0 -0
- /package/dist/{chunk-YS75T7YL.js.map → chunk-J54ZR6NF.js.map} +0 -0
- /package/dist/{http-EQLFIFHN.js.map → http-2EZA7I4F.js.map} +0 -0
- /package/dist/{http-QKQUDVEX.js.map → http-PKQBVZD6.js.map} +0 -0
- /package/dist/{replay-TAYX5PBU.js.map → replay-XC2YOK4X.js.map} +0 -0
package/dist/node.js
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
getCurrentTrace,
|
|
36
36
|
reseedFromRegistry,
|
|
37
37
|
seedFromRegistry
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-O52C6BRF.js";
|
|
39
39
|
import "./chunk-5DNB7EN7.js";
|
|
40
40
|
import {
|
|
41
41
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
ReplayError,
|
|
45
45
|
reportReplayProgress,
|
|
46
46
|
serializeReplayResult
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-6JQL37VC.js";
|
|
48
48
|
import {
|
|
49
49
|
BitfabError,
|
|
50
50
|
DEFAULT_SERVICE_URL,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
MixedTracingError,
|
|
53
53
|
__version__,
|
|
54
54
|
flushTraces
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-2M62EGYK.js";
|
|
56
56
|
import {
|
|
57
57
|
assertAsyncStorageRegistered,
|
|
58
58
|
registerAsyncLocalStorageClass
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
serializeReplayResult,
|
|
9
9
|
sleepForReplayPersistence,
|
|
10
10
|
waitForReplayPersistence
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-6JQL37VC.js";
|
|
12
|
+
import "./chunk-2M62EGYK.js";
|
|
13
13
|
import "./chunk-BAOIRE5T.js";
|
|
14
14
|
export {
|
|
15
15
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -22,4 +22,4 @@ export {
|
|
|
22
22
|
sleepForReplayPersistence,
|
|
23
23
|
waitForReplayPersistence
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=replay-
|
|
25
|
+
//# sourceMappingURL=replay-XC2YOK4X.js.map
|
package/dist/replayCli.js
CHANGED
|
@@ -7,12 +7,90 @@ import {
|
|
|
7
7
|
runRegistryMain,
|
|
8
8
|
runReplayCli,
|
|
9
9
|
runSeedCli
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import
|
|
10
|
+
} from "./chunk-J54ZR6NF.js";
|
|
11
|
+
import {
|
|
12
|
+
BitfabError
|
|
13
|
+
} from "./chunk-3BTITSNA.js";
|
|
14
|
+
|
|
15
|
+
// src/cloudReplayCli.ts
|
|
16
|
+
var CLOUD_REPLAY_HELP = "Direct GitHub replay: --cloud <pipeline> --trace-ids <UUIDs> [--registry <path>] [--max-concurrency 1..32] [--cloud-include <file>] [--cloud-dry-run] [--cloud-detach] [--cloud-request-id <UUID>]. Lifecycle: --cloud-status|--cloud-watch|--cloud-cancel|--cloud-cleanup <UUID>. Requires git, gh auth login, Python 3.10+, and bitfab:setup cloud.";
|
|
17
|
+
function isCloudReplayCommand(argv) {
|
|
18
|
+
return argv.some((arg) => arg === "--cloud" || arg.startsWith("--cloud-"));
|
|
19
|
+
}
|
|
20
|
+
async function runCloudReplayCommand(argv, io = {}) {
|
|
21
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
22
|
+
;
|
|
23
|
+
(io.stdout ?? console.log)(CLOUD_REPLAY_HELP);
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
const [{ execFileSync, spawn }, { realpath }, path] = await Promise.all([
|
|
27
|
+
import("child_process"),
|
|
28
|
+
import("fs/promises"),
|
|
29
|
+
import("path")
|
|
30
|
+
]);
|
|
31
|
+
const root = execFileSync("git", ["rev-parse", "--show-toplevel"], {
|
|
32
|
+
encoding: "utf8",
|
|
33
|
+
timeout: 15e3,
|
|
34
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
35
|
+
}).trim();
|
|
36
|
+
const helper = path.join(root, ".bitfab", "cloudReplay.py");
|
|
37
|
+
try {
|
|
38
|
+
if (await realpath(helper) !== path.join(await realpath(root), ".bitfab", "cloudReplay.py")) {
|
|
39
|
+
throw new Error("Symlinked helper");
|
|
40
|
+
}
|
|
41
|
+
} catch {
|
|
42
|
+
throw new BitfabError(
|
|
43
|
+
"Run bitfab:setup cloud first. Expected .bitfab/cloudReplay.py inside this repository."
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
const output = await new Promise((resolve, reject) => {
|
|
47
|
+
const child = spawn("python3", [helper, ...argv], {
|
|
48
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
49
|
+
});
|
|
50
|
+
let stdout = "";
|
|
51
|
+
child.stdout.setEncoding("utf8");
|
|
52
|
+
child.stderr.setEncoding("utf8");
|
|
53
|
+
child.stdout.on("data", (chunk) => {
|
|
54
|
+
stdout += chunk;
|
|
55
|
+
});
|
|
56
|
+
child.stderr.on("data", (chunk) => {
|
|
57
|
+
;
|
|
58
|
+
(io.stderr ?? ((text) => process.stderr.write(text)))(chunk);
|
|
59
|
+
});
|
|
60
|
+
child.on(
|
|
61
|
+
"error",
|
|
62
|
+
() => reject(new BitfabError("Cloud replay requires Python 3.10+ on PATH"))
|
|
63
|
+
);
|
|
64
|
+
child.on("close", (code) => {
|
|
65
|
+
if (code !== 0) {
|
|
66
|
+
if (stdout.trim() !== "") {
|
|
67
|
+
;
|
|
68
|
+
(io.stdout ?? console.log)(stdout.trim());
|
|
69
|
+
}
|
|
70
|
+
reject(
|
|
71
|
+
new BitfabError(
|
|
72
|
+
"Cloud replay failed. See diagnostics; use the execution UUID to recover a dispatched job."
|
|
73
|
+
)
|
|
74
|
+
);
|
|
75
|
+
} else {
|
|
76
|
+
resolve(stdout);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
const result = JSON.parse(output);
|
|
81
|
+
(io.stdout ?? console.log)(JSON.stringify(result, null, 2));
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
12
84
|
|
|
13
85
|
// src/replayCli.ts
|
|
14
|
-
var USAGE =
|
|
86
|
+
var USAGE = `Usage: bitfab-replay --registry <path> <pipeline> [options]
|
|
87
|
+
bitfab-replay --registry <path> <pipeline> --seed <cases.jsonl> [--run]
|
|
88
|
+
Run bitfab-replay --registry <path> --help to list replay options.
|
|
89
|
+
${CLOUD_REPLAY_HELP}`;
|
|
15
90
|
async function runReplayCommand(argv, io = {}, importer = importRegistry) {
|
|
91
|
+
if (isCloudReplayCommand(argv)) {
|
|
92
|
+
return runCloudReplayCommand(argv, io);
|
|
93
|
+
}
|
|
16
94
|
const { registryPath, commandArgs } = await parseRegistryCommandArgs(
|
|
17
95
|
argv,
|
|
18
96
|
USAGE
|
package/dist/replayCli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/replayCli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport {\n importRegistry,\n parseRegistryCommandArgs,\n type RegistryImporter,\n resolveRegistry,\n runIfEntrypoint,\n runRegistryMain,\n} from \"./registryCommand.js\"\nimport type { ReplayResult } from \"./replay.js\"\nimport {\n type ReplayCliIo,\n type ReseedRegistryResult,\n runReplayCli,\n runSeedCli,\n type SeedResult,\n} from \"./replayRegistry.js\"\n\nconst USAGE
|
|
1
|
+
{"version":3,"sources":["../src/cloudReplayCli.ts","../src/replayCli.ts"],"sourcesContent":["import { BitfabError } from \"./errors.js\"\nimport type { ReplayCliIo } from \"./replayRegistry.js\"\n\nexport const CLOUD_REPLAY_HELP =\n \"Direct GitHub replay: --cloud <pipeline> --trace-ids <UUIDs> [--registry <path>] [--max-concurrency 1..32] [--cloud-include <file>] [--cloud-dry-run] [--cloud-detach] [--cloud-request-id <UUID>]. Lifecycle: --cloud-status|--cloud-watch|--cloud-cancel|--cloud-cleanup <UUID>. Requires git, gh auth login, Python 3.10+, and bitfab:setup cloud.\"\n\nexport function isCloudReplayCommand(argv: readonly string[]): boolean {\n return argv.some((arg) => arg === \"--cloud\" || arg.startsWith(\"--cloud-\"))\n}\n\nexport async function runCloudReplayCommand(\n argv: readonly string[],\n io: ReplayCliIo = {},\n): Promise<Record<string, unknown>> {\n if (argv.includes(\"--help\") || argv.includes(\"-h\")) {\n ;(io.stdout ?? console.log)(CLOUD_REPLAY_HELP)\n return {}\n }\n const [{ execFileSync, spawn }, { realpath }, path] = await Promise.all([\n import(\"node:child_process\"),\n import(\"node:fs/promises\"),\n import(\"node:path\"),\n ])\n const root = execFileSync(\"git\", [\"rev-parse\", \"--show-toplevel\"], {\n encoding: \"utf8\",\n timeout: 15_000,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n }).trim()\n const helper = path.join(root, \".bitfab\", \"cloudReplay.py\")\n try {\n if (\n (await realpath(helper)) !==\n path.join(await realpath(root), \".bitfab\", \"cloudReplay.py\")\n ) {\n throw new Error(\"Symlinked helper\")\n }\n } catch {\n throw new BitfabError(\n \"Run bitfab:setup cloud first. Expected .bitfab/cloudReplay.py inside this repository.\",\n )\n }\n const output = await new Promise<string>((resolve, reject) => {\n const child = spawn(\"python3\", [helper, ...argv], {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n })\n let stdout = \"\"\n child.stdout.setEncoding(\"utf8\")\n child.stderr.setEncoding(\"utf8\")\n child.stdout.on(\"data\", (chunk: string) => {\n stdout += chunk\n })\n child.stderr.on(\"data\", (chunk: string) => {\n ;(io.stderr ?? ((text) => process.stderr.write(text)))(chunk)\n })\n child.on(\"error\", () =>\n reject(new BitfabError(\"Cloud replay requires Python 3.10+ on PATH\")),\n )\n child.on(\"close\", (code) => {\n if (code !== 0) {\n if (stdout.trim() !== \"\") {\n ;(io.stdout ?? console.log)(stdout.trim())\n }\n reject(\n new BitfabError(\n \"Cloud replay failed. See diagnostics; use the execution UUID to recover a dispatched job.\",\n ),\n )\n } else {\n resolve(stdout)\n }\n })\n })\n const result = JSON.parse(output) as Record<string, unknown>\n ;(io.stdout ?? console.log)(JSON.stringify(result, null, 2))\n return result\n}\n","#!/usr/bin/env node\n\nimport {\n CLOUD_REPLAY_HELP,\n isCloudReplayCommand,\n runCloudReplayCommand,\n} from \"./cloudReplayCli.js\"\nimport {\n importRegistry,\n parseRegistryCommandArgs,\n type RegistryImporter,\n resolveRegistry,\n runIfEntrypoint,\n runRegistryMain,\n} from \"./registryCommand.js\"\nimport type { ReplayResult } from \"./replay.js\"\nimport {\n type ReplayCliIo,\n type ReseedRegistryResult,\n runReplayCli,\n runSeedCli,\n type SeedResult,\n} from \"./replayRegistry.js\"\n\nconst USAGE = `Usage: bitfab-replay --registry <path> <pipeline> [options]\\n bitfab-replay --registry <path> <pipeline> --seed <cases.jsonl> [--run]\\nRun bitfab-replay --registry <path> --help to list replay options.\\n${CLOUD_REPLAY_HELP}`\n\nexport async function runReplayCommand(\n argv: readonly string[],\n io: ReplayCliIo = {},\n importer: RegistryImporter = importRegistry,\n): Promise<\n | ReplayResult<unknown>\n | SeedResult\n | ReseedRegistryResult\n | Record<string, unknown>\n> {\n if (isCloudReplayCommand(argv)) {\n return runCloudReplayCommand(argv, io)\n }\n const { registryPath, commandArgs } = await parseRegistryCommandArgs(\n argv,\n USAGE,\n )\n const registry = resolveRegistry(await importer(registryPath), registryPath)\n if (commandArgs.includes(\"--seed\")) {\n return runSeedCli(registry, commandArgs, io)\n }\n return runReplayCli(registry, commandArgs, io)\n}\n\nexport async function runReplayMain(\n argv: readonly string[],\n io: ReplayCliIo = {},\n): Promise<number> {\n return runRegistryMain(() => runReplayCommand(argv, io), io)\n}\n\nrunIfEntrypoint(import.meta.url, () => runReplayMain(process.argv.slice(2)))\n"],"mappings":";;;;;;;;;;;;;;;AAGO,IAAM,oBACX;AAEK,SAAS,qBAAqB,MAAkC;AACrE,SAAO,KAAK,KAAK,CAAC,QAAQ,QAAQ,aAAa,IAAI,WAAW,UAAU,CAAC;AAC3E;AAEA,eAAsB,sBACpB,MACA,KAAkB,CAAC,GACe;AAClC,MAAI,KAAK,SAAS,QAAQ,KAAK,KAAK,SAAS,IAAI,GAAG;AAClD;AAAC,KAAC,GAAG,UAAU,QAAQ,KAAK,iBAAiB;AAC7C,WAAO,CAAC;AAAA,EACV;AACA,QAAM,CAAC,EAAE,cAAc,MAAM,GAAG,EAAE,SAAS,GAAG,IA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AU,QAAQ,KAAK,OAAO,KAAK,CAAC;AAAA,QAC3C;AACA;AAAA,UACE,IAAI;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF,OAAO;AACL,gBAAQ,MAAM;AAAA,MAChB;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACD,QAAM,SAAS,KAAK,MAAM,MAAM;AAC/B,GAAC,GAAG,UAAU,QAAQ,KAAK,KAAK,UAAU,QAAQ,MAAM,CAAC,CAAC;AAC3D,SAAO;AACT;;;ACnDA,IAAM,QAAQ;AAAA;AAAA;AAAA,EAAoN,iBAAiB;AAEnP,eAAsB,iBACpB,MACA,KAAkB,CAAC,GACnB,WAA6B,gBAM7B;AACA,MAAI,qBAAqB,IAAI,GAAG;AAC9B,WAAO,sBAAsB,MAAM,EAAE;AAAA,EACvC;AACA,QAAM,EAAE,cAAc,YAAY,IAAI,MAAM;AAAA,IAC1C;AAAA,IACA;AAAA,EACF;AACA,QAAM,WAAW,gBAAgB,MAAM,SAAS,YAAY,GAAG,YAAY;AAC3E,MAAI,YAAY,SAAS,QAAQ,GAAG;AAClC,WAAO,WAAW,UAAU,aAAa,EAAE;AAAA,EAC7C;AACA,SAAO,aAAa,UAAU,aAAa,EAAE;AAC/C;AAEA,eAAsB,cACpB,MACA,KAAkB,CAAC,GACF;AACjB,SAAO,gBAAgB,MAAM,iBAAiB,MAAM,EAAE,GAAG,EAAE;AAC7D;AAEA,gBAAgB,YAAY,KAAK,MAAM,cAAc,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC;","names":[]}
|
package/dist/seedCli.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
runIfEntrypoint,
|
|
7
7
|
runRegistryMain,
|
|
8
8
|
runSeedCli
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-J54ZR6NF.js";
|
|
10
|
+
import "./chunk-3BTITSNA.js";
|
|
11
11
|
|
|
12
12
|
// src/seedCli.ts
|
|
13
13
|
var USAGE = "Usage: bitfab-seed --registry <path> <pipeline> --from-trace <id>[,<id>...]\n bitfab-seed --registry <path> <pipeline> --cases <cases.jsonl> [--run]\nRun bitfab-seed --registry <path> <pipeline> --help for details.";
|