@bitfab/sdk 0.64.14 → 0.64.15
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/cloudReplay.py +250 -55
- package/dist/{chunk-2EWCNKQL.js → chunk-2MHRNZH5.js} +10 -5
- package/dist/{chunk-2EWCNKQL.js.map → chunk-2MHRNZH5.js.map} +1 -1
- package/dist/{chunk-PXNFY22G.js → chunk-7ZJ7KXEV.js} +2 -2
- package/dist/{chunk-GURR5AWG.js → chunk-KVGRTCIE.js} +2 -2
- package/dist/{chunk-GURR5AWG.js.map → chunk-KVGRTCIE.js.map} +1 -1
- package/dist/{chunk-F5ZFL5W6.js → chunk-NYLVYTBO.js} +6 -6
- package/dist/{chunk-F5ZFL5W6.js.map → chunk-NYLVYTBO.js.map} +1 -1
- package/dist/{chunk-A7NX4OKG.js → chunk-Z4DIFZTO.js} +2 -2
- package/dist/{chunk-A7NX4OKG.js.map → chunk-Z4DIFZTO.js.map} +1 -1
- package/dist/{http-C44ETCJK.js → http-36VJ3FFM.js} +2 -2
- package/dist/{http-QX6O4EDS.js → http-IQ2AC36B.js} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- 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-MFZF4SY7.js → replay-2QFPGFS7.js} +3 -3
- package/dist/replayCli.js +13 -2
- package/dist/replayCli.js.map +1 -1
- package/dist/seedCli.js +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-PXNFY22G.js.map → chunk-7ZJ7KXEV.js.map} +0 -0
- /package/dist/{http-C44ETCJK.js.map → http-36VJ3FFM.js.map} +0 -0
- /package/dist/{http-QX6O4EDS.js.map → http-IQ2AC36B.js.map} +0 -0
- /package/dist/{replay-MFZF4SY7.js.map → replay-2QFPGFS7.js.map} +0 -0
package/dist/node.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getCurrentTrace,
|
|
28
28
|
reseedFromRegistry,
|
|
29
29
|
seedFromRegistry
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-NYLVYTBO.js";
|
|
31
31
|
import "./chunk-YWXQM6J3.js";
|
|
32
32
|
import {
|
|
33
33
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
ReplayError,
|
|
37
37
|
reportReplayProgress,
|
|
38
38
|
serializeReplayResult
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-7ZJ7KXEV.js";
|
|
40
40
|
import {
|
|
41
41
|
BitfabError,
|
|
42
42
|
DEFAULT_SERVICE_URL,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
MixedTracingError,
|
|
45
45
|
__version__,
|
|
46
46
|
flushTraces
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-Z4DIFZTO.js";
|
|
48
48
|
import {
|
|
49
49
|
assertAsyncStorageRegistered,
|
|
50
50
|
registerAsyncLocalStorageClass
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
sleepForReplayPersistence,
|
|
11
11
|
waitForReplayPersistence,
|
|
12
12
|
warnJudgeAssertionsDeprecated
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-7ZJ7KXEV.js";
|
|
14
|
+
import "./chunk-Z4DIFZTO.js";
|
|
15
15
|
import "./chunk-MT36GJMW.js";
|
|
16
16
|
export {
|
|
17
17
|
BITFAB_PROGRESS_PREFIX,
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
waitForReplayPersistence,
|
|
27
27
|
warnJudgeAssertionsDeprecated
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=replay-
|
|
29
|
+
//# sourceMappingURL=replay-2QFPGFS7.js.map
|
package/dist/replayCli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
checkReplayCliArgs,
|
|
3
4
|
importRegistry,
|
|
4
5
|
parseRegistryCommandArgs,
|
|
5
6
|
resolveRegistry,
|
|
@@ -7,8 +8,8 @@ import {
|
|
|
7
8
|
runRegistryMain,
|
|
8
9
|
runReplayCli,
|
|
9
10
|
runSeedCli
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-2MHRNZH5.js";
|
|
12
|
+
import "./chunk-KVGRTCIE.js";
|
|
12
13
|
|
|
13
14
|
// src/cloudReplayCli.ts
|
|
14
15
|
var CLOUD_REPLAY_HINT = "Add --cloud to run the same replay on GitHub Actions; bitfab-replay --cloud --help explains it.";
|
|
@@ -56,6 +57,7 @@ async function runCloudReplayCommand(argv, helper) {
|
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
// src/replayCli.ts
|
|
60
|
+
var CHECK_ARGUMENTS_FLAG = "--check-arguments";
|
|
59
61
|
var USAGE = `Usage: bitfab-replay --registry <path> <pipeline> [options]
|
|
60
62
|
bitfab-replay --registry <path> <pipeline> --resume <experimentId>
|
|
61
63
|
bitfab-replay --registry <path> <pipeline> --seed <cases.jsonl> [--run]
|
|
@@ -73,6 +75,15 @@ async function runReplayCommand(argv, io = {}, importer = importRegistry) {
|
|
|
73
75
|
return runReplayCli(registry, commandArgs, io, registryPath);
|
|
74
76
|
}
|
|
75
77
|
async function runReplayMain(argv, io = {}) {
|
|
78
|
+
if (argv[0] === CHECK_ARGUMENTS_FLAG) {
|
|
79
|
+
return runRegistryMain(async () => {
|
|
80
|
+
const { commandArgs } = await parseRegistryCommandArgs(
|
|
81
|
+
argv.slice(1),
|
|
82
|
+
USAGE
|
|
83
|
+
);
|
|
84
|
+
checkReplayCliArgs(commandArgs);
|
|
85
|
+
}, io);
|
|
86
|
+
}
|
|
76
87
|
if (isCloudReplayCommand(argv)) {
|
|
77
88
|
return runCloudReplayCommand(argv);
|
|
78
89
|
}
|
package/dist/replayCli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cloudReplayCli.ts","../src/replayCli.ts"],"sourcesContent":["export const CLOUD_REPLAY_HINT =\n \"Add --cloud to run the same replay on GitHub Actions; bitfab-replay --cloud --help explains it.\"\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 helper?: string,\n): Promise<number> {\n const [{ spawn }, { fileURLToPath }] = await Promise.all([\n import(\"node:child_process\"),\n import(\"node:url\"),\n ])\n const script =\n helper ?? fileURLToPath(new URL(\"../cloudReplay.py\", import.meta.url))\n const replayCommand = [\n process.execPath,\n ...process.execArgv.filter((flag) => !/^--(inspect|debug)/.test(flag)),\n fileURLToPath(new URL(\"./replayCli.js\", import.meta.url)),\n ]\n const keepWaiting = () => {}\n process.on(\"SIGINT\", keepWaiting)\n try {\n return await new Promise<number>((resolve) => {\n const child = spawn(\"python3\", [script, ...argv], {\n stdio: \"inherit\",\n env: {\n ...process.env,\n BITFAB_REPLAY_COMMAND: JSON.stringify(replayCommand),\n BITFAB_SDK_LANGUAGE: \"typescript\",\n },\n })\n child.on(\"error\", () => {\n process.stderr.write(\n \"Cloud replay needs Python 3.10+ on PATH as python3\\n\",\n )\n resolve(1)\n })\n child.on(\"close\", (code, signal) =>\n resolve(code ?? (signal === \"SIGINT\" ? 130 : 1)),\n )\n })\n } finally {\n process.off(\"SIGINT\", keepWaiting)\n }\n}\n","#!/usr/bin/env node\n\nimport {\n CLOUD_REPLAY_HINT,\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> --resume <experimentId>\\n bitfab-replay --registry <path> <pipeline> --seed <cases.jsonl> [--run]\\nRun bitfab-replay --registry <path> --help to list replay options.\\n${CLOUD_REPLAY_HINT}`\n\nexport async function runReplayCommand(\n argv: readonly string[],\n io: ReplayCliIo = {},\n importer: RegistryImporter = importRegistry,\n): Promise<ReplayResult<unknown> | SeedResult | ReseedRegistryResult> {\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, registryPath)\n}\n\nexport async function runReplayMain(\n argv: readonly string[],\n io: ReplayCliIo = {},\n): Promise<number> {\n if (isCloudReplayCommand(argv)) {\n return runCloudReplayCommand(argv)\n }\n return runRegistryMain(() => runReplayCommand(argv, io), io)\n}\n\nrunIfEntrypoint(import.meta.url, () => runReplayMain(process.argv.slice(2)))\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cloudReplayCli.ts","../src/replayCli.ts"],"sourcesContent":["export const CLOUD_REPLAY_HINT =\n \"Add --cloud to run the same replay on GitHub Actions; bitfab-replay --cloud --help explains it.\"\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 helper?: string,\n): Promise<number> {\n const [{ spawn }, { fileURLToPath }] = await Promise.all([\n import(\"node:child_process\"),\n import(\"node:url\"),\n ])\n const script =\n helper ?? fileURLToPath(new URL(\"../cloudReplay.py\", import.meta.url))\n const replayCommand = [\n process.execPath,\n ...process.execArgv.filter((flag) => !/^--(inspect|debug)/.test(flag)),\n fileURLToPath(new URL(\"./replayCli.js\", import.meta.url)),\n ]\n const keepWaiting = () => {}\n process.on(\"SIGINT\", keepWaiting)\n try {\n return await new Promise<number>((resolve) => {\n const child = spawn(\"python3\", [script, ...argv], {\n stdio: \"inherit\",\n env: {\n ...process.env,\n BITFAB_REPLAY_COMMAND: JSON.stringify(replayCommand),\n BITFAB_SDK_LANGUAGE: \"typescript\",\n },\n })\n child.on(\"error\", () => {\n process.stderr.write(\n \"Cloud replay needs Python 3.10+ on PATH as python3\\n\",\n )\n resolve(1)\n })\n child.on(\"close\", (code, signal) =>\n resolve(code ?? (signal === \"SIGINT\" ? 130 : 1)),\n )\n })\n } finally {\n process.off(\"SIGINT\", keepWaiting)\n }\n}\n","#!/usr/bin/env node\n\nimport {\n CLOUD_REPLAY_HINT,\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 checkReplayCliArgs,\n type ReplayCliIo,\n type ReseedRegistryResult,\n runReplayCli,\n runSeedCli,\n type SeedResult,\n} from \"./replayRegistry.js\"\n\nconst CHECK_ARGUMENTS_FLAG = \"--check-arguments\"\n\nconst USAGE = `Usage: bitfab-replay --registry <path> <pipeline> [options]\\n bitfab-replay --registry <path> <pipeline> --resume <experimentId>\\n bitfab-replay --registry <path> <pipeline> --seed <cases.jsonl> [--run]\\nRun bitfab-replay --registry <path> --help to list replay options.\\n${CLOUD_REPLAY_HINT}`\n\nexport async function runReplayCommand(\n argv: readonly string[],\n io: ReplayCliIo = {},\n importer: RegistryImporter = importRegistry,\n): Promise<ReplayResult<unknown> | SeedResult | ReseedRegistryResult> {\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, registryPath)\n}\n\nexport async function runReplayMain(\n argv: readonly string[],\n io: ReplayCliIo = {},\n): Promise<number> {\n if (argv[0] === CHECK_ARGUMENTS_FLAG) {\n return runRegistryMain(async () => {\n const { commandArgs } = await parseRegistryCommandArgs(\n argv.slice(1),\n USAGE,\n )\n checkReplayCliArgs(commandArgs)\n }, io)\n }\n if (isCloudReplayCommand(argv)) {\n return runCloudReplayCommand(argv)\n }\n return runRegistryMain(() => runReplayCommand(argv, io), io)\n}\n\nrunIfEntrypoint(import.meta.url, () => runReplayMain(process.argv.slice(2)))\n"],"mappings":";;;;;;;;;;;;;;AAAO,IAAM,oBACX;AAEK,SAAS,qBAAqB,MAAkC;AACrE,SAAO,KAAK,KAAK,CAAC,QAAQ,QAAQ,aAAa,IAAI,WAAW,UAAU,CAAC;AAC3E;AAEA,eAAsB,sBACpB,MACA,QACiB;AACjB,QAAM,CAAC,EAAE,MAAM,GAAG,EAAE,cAAc,CAAC,IAAI,MAAM,QAAQ,IAAI;AAAA,IACvD,OAAO,eAAoB;AAAA,IAC3B,OAAO,KAAU;AAAA,EACnB,CAAC;AACD,QAAM,SACJ,UAAU,cAAc,IAAI,IAAI,qBAAqB,YAAY,GAAG,CAAC;AACvE,QAAM,gBAAgB;AAAA,IACpB,QAAQ;AAAA,IACR,GAAG,QAAQ,SAAS,OAAO,CAAC,SAAS,CAAC,qBAAqB,KAAK,IAAI,CAAC;AAAA,IACrE,cAAc,IAAI,IAAI,kBAAkB,YAAY,GAAG,CAAC;AAAA,EAC1D;AACA,QAAM,cAAc,MAAM;AAAA,EAAC;AAC3B,UAAQ,GAAG,UAAU,WAAW;AAChC,MAAI;AACF,WAAO,MAAM,IAAI,QAAgB,CAAC,YAAY;AAC5C,YAAM,QAAQ,MAAM,WAAW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AiB,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-2MHRNZH5.js";
|
|
10
|
+
import "./chunk-KVGRTCIE.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.";
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|