deepline 0.1.210 → 0.1.212
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/bundling-sources/apps/play-runner-workers/src/entry.ts +203 -12
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/customer-console.ts +23 -0
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/map-chunk-plan.ts +15 -0
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/map-latency-profile.ts +90 -0
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-dispatch.ts +162 -100
- package/dist/bundling-sources/sdk/src/client.ts +118 -3
- package/dist/bundling-sources/sdk/src/play.ts +2 -0
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/sdk/src/types.ts +47 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +253 -30
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +365 -103
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +12 -0
- package/dist/bundling-sources/shared_libs/play-runtime/dataset-id.ts +10 -4
- package/dist/bundling-sources/shared_libs/play-runtime/db-session.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +45 -8
- package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +14 -2
- package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +4 -2
- package/dist/bundling-sources/shared_libs/play-runtime/receipt-sql.ts +21 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +128 -6
- package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +5 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +37 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +19 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +63 -7
- package/dist/bundling-sources/shared_libs/play-runtime/secret-capability.ts +18 -4
- package/dist/bundling-sources/shared_libs/play-runtime/single-flight.ts +31 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +12 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +29 -9
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-state-machine.ts +22 -1
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +79 -1
- package/dist/bundling-sources/shared_libs/plays/dataset.ts +41 -5
- package/dist/cli/index.js +728 -239
- package/dist/cli/index.mjs +728 -239
- package/dist/index.d.mts +93 -7
- package/dist/index.d.ts +93 -7
- package/dist/index.js +245 -46
- package/dist/index.mjs +245 -46
- package/dist/plays/bundle-play-file.mjs +65 -4
- package/package.json +1 -1
|
@@ -131,7 +131,7 @@ var MAX_PLAY_BUNDLE_BYTES = 30 * 1024 * 1024;
|
|
|
131
131
|
var MAX_ESM_WORKERS_BUNDLE_BYTES = 115e4;
|
|
132
132
|
|
|
133
133
|
// ../shared_libs/plays/bundling/index.ts
|
|
134
|
-
var PLAY_BUNDLE_CACHE_VERSION =
|
|
134
|
+
var PLAY_BUNDLE_CACHE_VERSION = 25;
|
|
135
135
|
var PLAY_ARTIFACT_CACHE_DIR = join(
|
|
136
136
|
tmpdir(),
|
|
137
137
|
`deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION}`
|
|
@@ -898,6 +898,58 @@ function workersPlayEntryAliasPlugin(playFilePath) {
|
|
|
898
898
|
}
|
|
899
899
|
};
|
|
900
900
|
}
|
|
901
|
+
var CUSTOMER_CONSOLE_CAPTURE_GLOBAL = "__deeplineCaptureCustomerConsole";
|
|
902
|
+
function sourceLoaderForPath(path) {
|
|
903
|
+
const extension = extname(path).toLowerCase();
|
|
904
|
+
if (extension === ".tsx") return "tsx";
|
|
905
|
+
if (extension === ".jsx") return "jsx";
|
|
906
|
+
if (extension === ".js" || extension === ".mjs" || extension === ".cjs") {
|
|
907
|
+
return "js";
|
|
908
|
+
}
|
|
909
|
+
return "ts";
|
|
910
|
+
}
|
|
911
|
+
function workersCustomerConsolePlugin(customerSourceFilePaths) {
|
|
912
|
+
const customerSourceFiles = new Set(
|
|
913
|
+
customerSourceFilePaths.filter((path) => extname(path).toLowerCase() !== ".json").map((path) => resolve(path))
|
|
914
|
+
);
|
|
915
|
+
return {
|
|
916
|
+
name: "deepline-workers-customer-console",
|
|
917
|
+
setup(buildContext) {
|
|
918
|
+
buildContext.onLoad({ filter: /./ }, (args) => {
|
|
919
|
+
if (!customerSourceFiles.has(resolve(args.path))) return void 0;
|
|
920
|
+
const source = readFileSync(args.path, "utf8");
|
|
921
|
+
const declaresOwnConsole = /(?:^|\n)\s*(?:(?:const|let|var|class|function)\s+console\b|import[^\n]*\bconsole\b)/m.test(
|
|
922
|
+
source
|
|
923
|
+
);
|
|
924
|
+
if (declaresOwnConsole) {
|
|
925
|
+
return {
|
|
926
|
+
contents: source,
|
|
927
|
+
loader: sourceLoaderForPath(args.path),
|
|
928
|
+
resolveDir: dirname(args.path)
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
const prelude = `
|
|
932
|
+
const console = new Proxy(globalThis.console, {
|
|
933
|
+
get(target, property) {
|
|
934
|
+
const capture = globalThis.${CUSTOMER_CONSOLE_CAPTURE_GLOBAL};
|
|
935
|
+
if (typeof capture === 'function') {
|
|
936
|
+
return (...args) => capture(String(property), args);
|
|
937
|
+
}
|
|
938
|
+
const value = Reflect.get(target, property);
|
|
939
|
+
return typeof value === 'function' ? value.bind(target) : value;
|
|
940
|
+
},
|
|
941
|
+
});
|
|
942
|
+
`;
|
|
943
|
+
return {
|
|
944
|
+
contents: `${prelude}
|
|
945
|
+
${source}`,
|
|
946
|
+
loader: sourceLoaderForPath(args.path),
|
|
947
|
+
resolveDir: dirname(args.path)
|
|
948
|
+
};
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
}
|
|
901
953
|
function workersNamedPlayEntryAliasPlugin(playFilePath, exportName) {
|
|
902
954
|
return {
|
|
903
955
|
name: "deepline-workers-named-play-entry-alias",
|
|
@@ -1401,7 +1453,7 @@ function getBundleSizeError(filePath, bundledCode, artifactKind) {
|
|
|
1401
1453
|
artifactKind
|
|
1402
1454
|
);
|
|
1403
1455
|
}
|
|
1404
|
-
async function runEsbuildForCjsNode(entryFile, importedPlayDependencies, adapter, exportName) {
|
|
1456
|
+
async function runEsbuildForCjsNode(entryFile, _customerSourceFilePaths, importedPlayDependencies, adapter, exportName) {
|
|
1405
1457
|
const sdkAliasPlugin = localSdkAliasPlugin(adapter);
|
|
1406
1458
|
const playProxyPlugin = importedPlayProxyPlugin(importedPlayDependencies);
|
|
1407
1459
|
const namedExportShim = exportName === "default" ? null : `export { ${exportName} as default } from ${JSON.stringify(entryFile)};
|
|
@@ -1442,10 +1494,13 @@ async function runEsbuildForCjsNode(entryFile, importedPlayDependencies, adapter
|
|
|
1442
1494
|
outputExtension: "cjs"
|
|
1443
1495
|
};
|
|
1444
1496
|
}
|
|
1445
|
-
async function runEsbuildForEsmWorkers(playEntryFile, importedPlayDependencies, adapter, exportName) {
|
|
1497
|
+
async function runEsbuildForEsmWorkers(playEntryFile, customerSourceFilePaths, importedPlayDependencies, adapter, exportName) {
|
|
1446
1498
|
const sdkAliasPlugin = localSdkAliasPlugin(adapter, { workersRuntime: true });
|
|
1447
1499
|
const playProxyPlugin = importedPlayProxyPlugin(importedPlayDependencies);
|
|
1448
1500
|
const playEntryAlias = exportName === "default" ? workersPlayEntryAliasPlugin(playEntryFile) : workersNamedPlayEntryAliasPlugin(playEntryFile, exportName);
|
|
1501
|
+
const customerConsolePlugin = workersCustomerConsolePlugin(
|
|
1502
|
+
customerSourceFilePaths
|
|
1503
|
+
);
|
|
1449
1504
|
const result = await build({
|
|
1450
1505
|
// Entry is the Workers harness; it imports the play via the virtual
|
|
1451
1506
|
// `deepline-play-entry` alias resolved by workersPlayEntryAliasPlugin.
|
|
@@ -1490,6 +1545,7 @@ async function runEsbuildForEsmWorkers(playEntryFile, importedPlayDependencies,
|
|
|
1490
1545
|
sdkAliasPlugin,
|
|
1491
1546
|
playProxyPlugin,
|
|
1492
1547
|
playEntryAlias,
|
|
1548
|
+
customerConsolePlugin,
|
|
1493
1549
|
workersNodeBuiltinStubPlugin(),
|
|
1494
1550
|
// Strip non-English zod locale data from the bundle. zod's locales
|
|
1495
1551
|
// are re-exported as a static namespace from `zod/v4/core`, so
|
|
@@ -1520,11 +1576,13 @@ var PLAY_ARTIFACT_TARGET_ADAPTERS = {
|
|
|
1520
1576
|
includeWorkersHarnessInGraphHash: false,
|
|
1521
1577
|
runEsbuild: ({
|
|
1522
1578
|
entryFile,
|
|
1579
|
+
customerSourceFilePaths,
|
|
1523
1580
|
importedPlayDependencies,
|
|
1524
1581
|
adapter,
|
|
1525
1582
|
exportName
|
|
1526
1583
|
}) => runEsbuildForCjsNode(
|
|
1527
1584
|
entryFile,
|
|
1585
|
+
customerSourceFilePaths,
|
|
1528
1586
|
importedPlayDependencies,
|
|
1529
1587
|
adapter,
|
|
1530
1588
|
exportName
|
|
@@ -1536,11 +1594,13 @@ var PLAY_ARTIFACT_TARGET_ADAPTERS = {
|
|
|
1536
1594
|
includeWorkersHarnessInGraphHash: true,
|
|
1537
1595
|
runEsbuild: ({
|
|
1538
1596
|
entryFile,
|
|
1597
|
+
customerSourceFilePaths,
|
|
1539
1598
|
importedPlayDependencies,
|
|
1540
1599
|
adapter,
|
|
1541
1600
|
exportName
|
|
1542
1601
|
}) => runEsbuildForEsmWorkers(
|
|
1543
1602
|
entryFile,
|
|
1603
|
+
customerSourceFilePaths,
|
|
1544
1604
|
importedPlayDependencies,
|
|
1545
1605
|
adapter,
|
|
1546
1606
|
exportName
|
|
@@ -1643,6 +1703,7 @@ workers-harness:${harnessFingerprint}`
|
|
|
1643
1703
|
}
|
|
1644
1704
|
const buildOutcome = await targetAdapter.runEsbuild({
|
|
1645
1705
|
entryFile: absolutePath,
|
|
1706
|
+
customerSourceFilePaths: analysis.importPolicy.localFiles,
|
|
1646
1707
|
importedPlayDependencies: analysis.importedPlayDependencies,
|
|
1647
1708
|
adapter,
|
|
1648
1709
|
exportName
|
|
@@ -2146,7 +2207,7 @@ async function discoverPackagedLocalFiles(entryFile) {
|
|
|
2146
2207
|
}
|
|
2147
2208
|
|
|
2148
2209
|
// src/plays/bundle-play-file.ts
|
|
2149
|
-
var PLAY_BUNDLE_CACHE_VERSION2 =
|
|
2210
|
+
var PLAY_BUNDLE_CACHE_VERSION2 = 31;
|
|
2150
2211
|
var MODULE_DIR = dirname3(fileURLToPath(import.meta.url));
|
|
2151
2212
|
var SDK_PACKAGE_ROOT = resolve3(MODULE_DIR, "..", "..");
|
|
2152
2213
|
var SOURCE_REPO_ROOT = resolve3(SDK_PACKAGE_ROOT, "..");
|