deepline 0.1.54 → 0.1.55
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/cli/index.js +214 -67
- package/dist/cli/index.mjs +222 -68
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/repo/sdk/src/plays/bundle-play-file.ts +27 -18
- package/dist/repo/sdk/src/release.ts +2 -2
- package/dist/repo/shared_libs/play-runtime/profiles.ts +26 -54
- package/dist/repo/shared_libs/play-runtime/providers.ts +71 -0
- package/dist/repo/shared_libs/play-runtime/scheduler-backend.ts +9 -1
- package/dist/repo/shared_libs/plays/bundling/index.ts +225 -69
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -197,10 +197,10 @@ function resolveConfig(options) {
|
|
|
197
197
|
|
|
198
198
|
// src/release.ts
|
|
199
199
|
var SDK_RELEASE = {
|
|
200
|
-
version: "0.1.
|
|
200
|
+
version: "0.1.55",
|
|
201
201
|
apiContract: "2026-05-run-response-package",
|
|
202
202
|
supportPolicy: {
|
|
203
|
-
latest: "0.1.
|
|
203
|
+
latest: "0.1.55",
|
|
204
204
|
minimumSupported: "0.1.53",
|
|
205
205
|
deprecatedBelow: "0.1.53"
|
|
206
206
|
}
|
|
@@ -4009,7 +4009,14 @@ import { createHash } from "crypto";
|
|
|
4009
4009
|
import { existsSync as existsSync4, readFileSync as readFileSync4 } from "fs";
|
|
4010
4010
|
import { mkdir as mkdir3, readFile, realpath, stat, writeFile as writeFile3 } from "fs/promises";
|
|
4011
4011
|
import { tmpdir } from "os";
|
|
4012
|
-
import {
|
|
4012
|
+
import {
|
|
4013
|
+
basename,
|
|
4014
|
+
dirname as dirname5,
|
|
4015
|
+
extname,
|
|
4016
|
+
isAbsolute,
|
|
4017
|
+
join as join3,
|
|
4018
|
+
resolve as resolve6
|
|
4019
|
+
} from "path";
|
|
4013
4020
|
import { builtinModules } from "module";
|
|
4014
4021
|
import { build } from "esbuild";
|
|
4015
4022
|
|
|
@@ -4073,11 +4080,23 @@ var PLAY_ARTIFACT_CACHE_DIR = join3(
|
|
|
4073
4080
|
`deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION}`
|
|
4074
4081
|
);
|
|
4075
4082
|
var PLAY_PROXY_NAMESPACE = "deepline-play-runtime-ref";
|
|
4076
|
-
var SOURCE_EXTENSIONS = [
|
|
4083
|
+
var SOURCE_EXTENSIONS = [
|
|
4084
|
+
".ts",
|
|
4085
|
+
".tsx",
|
|
4086
|
+
".mts",
|
|
4087
|
+
".cts",
|
|
4088
|
+
".js",
|
|
4089
|
+
".jsx",
|
|
4090
|
+
".mjs",
|
|
4091
|
+
".cjs",
|
|
4092
|
+
".json"
|
|
4093
|
+
];
|
|
4077
4094
|
var WORKERS_PLAY_ENTRY_VIRTUAL = "deepline-play-entry";
|
|
4078
4095
|
var PLAY_SOURCE_FILE_PATTERN = /\.play\.(?:[cm]?[jt]sx?)$/i;
|
|
4079
4096
|
var NODE_BUILTIN_SET = new Set(
|
|
4080
|
-
builtinModules.flatMap(
|
|
4097
|
+
builtinModules.flatMap(
|
|
4098
|
+
(name) => name.startsWith("node:") ? [name, name.slice(5)] : [name, `node:${name}`]
|
|
4099
|
+
)
|
|
4081
4100
|
);
|
|
4082
4101
|
function assertValidExportName(exportName) {
|
|
4083
4102
|
if (exportName === "default") return;
|
|
@@ -4157,15 +4176,27 @@ function findSourceImportReferences(sourceCode) {
|
|
|
4157
4176
|
};
|
|
4158
4177
|
const staticImportPattern = /\b(?:import|export)\s+(?!type\b)(?:[\s\S]*?\s+from\s*)?(['"])([^'"\n]+)\1/g;
|
|
4159
4178
|
for (const match of source.matchAll(staticImportPattern)) {
|
|
4160
|
-
addReference(
|
|
4179
|
+
addReference(
|
|
4180
|
+
match[2],
|
|
4181
|
+
match.index + match[0].lastIndexOf(match[1]),
|
|
4182
|
+
"static"
|
|
4183
|
+
);
|
|
4161
4184
|
}
|
|
4162
4185
|
const dynamicImportPattern = /\bimport\s*\(\s*(['"])([^'"\n]+)\1/g;
|
|
4163
4186
|
for (const match of source.matchAll(dynamicImportPattern)) {
|
|
4164
|
-
addReference(
|
|
4187
|
+
addReference(
|
|
4188
|
+
match[2],
|
|
4189
|
+
match.index + match[0].lastIndexOf(match[1]),
|
|
4190
|
+
"dynamic-import"
|
|
4191
|
+
);
|
|
4165
4192
|
}
|
|
4166
4193
|
const requirePattern = /\brequire\s*\(\s*(['"])([^'"\n]+)\1/g;
|
|
4167
4194
|
for (const match of source.matchAll(requirePattern)) {
|
|
4168
|
-
addReference(
|
|
4195
|
+
addReference(
|
|
4196
|
+
match[2],
|
|
4197
|
+
match.index + match[0].lastIndexOf(match[1]),
|
|
4198
|
+
"require"
|
|
4199
|
+
);
|
|
4169
4200
|
}
|
|
4170
4201
|
const literalDynamicImportIndexes = new Set(
|
|
4171
4202
|
[...source.matchAll(dynamicImportPattern)].map((match) => match.index)
|
|
@@ -4198,7 +4229,9 @@ function unquoteStringLiteral(literal) {
|
|
|
4198
4229
|
return null;
|
|
4199
4230
|
}
|
|
4200
4231
|
try {
|
|
4201
|
-
return JSON.parse(
|
|
4232
|
+
return JSON.parse(
|
|
4233
|
+
quote === '"' ? trimmed : `"${trimmed.slice(1, -1).replace(/"/g, '\\"')}"`
|
|
4234
|
+
);
|
|
4202
4235
|
} catch {
|
|
4203
4236
|
return trimmed.slice(1, -1);
|
|
4204
4237
|
}
|
|
@@ -4250,7 +4283,9 @@ function extractDefinedPlayName(sourceCode) {
|
|
|
4250
4283
|
const closeBrace = findMatchingBrace(source, argIndex);
|
|
4251
4284
|
if (closeBrace < 0) continue;
|
|
4252
4285
|
const objectSource = source.slice(argIndex + 1, closeBrace);
|
|
4253
|
-
const idMatch = objectSource.match(
|
|
4286
|
+
const idMatch = objectSource.match(
|
|
4287
|
+
/(?:^|[,{\s])(?:id|['"]id['"])\s*:\s*(['"])([\s\S]*?)\1/
|
|
4288
|
+
);
|
|
4254
4289
|
if (idMatch?.[2]?.trim()) {
|
|
4255
4290
|
return idMatch[2].trim();
|
|
4256
4291
|
}
|
|
@@ -4359,7 +4394,12 @@ function workersNamedPlayEntryAliasPlugin(playFilePath, exportName) {
|
|
|
4359
4394
|
};
|
|
4360
4395
|
}
|
|
4361
4396
|
function workersNodeBuiltinStubPlugin() {
|
|
4362
|
-
const UNSUPPORTED = /* @__PURE__ */ new Set([
|
|
4397
|
+
const UNSUPPORTED = /* @__PURE__ */ new Set([
|
|
4398
|
+
"node:fs",
|
|
4399
|
+
"node:fs/promises",
|
|
4400
|
+
"node:os",
|
|
4401
|
+
"node:child_process"
|
|
4402
|
+
]);
|
|
4363
4403
|
return {
|
|
4364
4404
|
name: "deepline-workers-node-builtin-stub",
|
|
4365
4405
|
setup(buildContext) {
|
|
@@ -4408,16 +4448,13 @@ function zodNonEnglishLocaleStubPlugin() {
|
|
|
4408
4448
|
}
|
|
4409
4449
|
return { path: args.path, namespace: NAMESPACE };
|
|
4410
4450
|
});
|
|
4411
|
-
buildContext.onLoad(
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
loader: "js"
|
|
4419
|
-
})
|
|
4420
|
-
);
|
|
4451
|
+
buildContext.onLoad({ filter: /.*/, namespace: NAMESPACE }, () => ({
|
|
4452
|
+
// zod locales export a default object literal. Empty object is
|
|
4453
|
+
// structurally compatible — accessing any locale key returns
|
|
4454
|
+
// undefined and zod falls back to its built-in English.
|
|
4455
|
+
contents: "export default {};",
|
|
4456
|
+
loader: "js"
|
|
4457
|
+
}));
|
|
4421
4458
|
}
|
|
4422
4459
|
};
|
|
4423
4460
|
}
|
|
@@ -4488,7 +4525,10 @@ function importedPlayProxyPlugin(importedPlayDependencies) {
|
|
|
4488
4525
|
return null;
|
|
4489
4526
|
}
|
|
4490
4527
|
const dependenciesByPath = new Map(
|
|
4491
|
-
importedPlayDependencies.map((dependency) => [
|
|
4528
|
+
importedPlayDependencies.map((dependency) => [
|
|
4529
|
+
dependency.filePath,
|
|
4530
|
+
dependency
|
|
4531
|
+
])
|
|
4492
4532
|
);
|
|
4493
4533
|
return {
|
|
4494
4534
|
name: "deepline-imported-play-proxy",
|
|
@@ -4508,17 +4548,20 @@ function importedPlayProxyPlugin(importedPlayDependencies) {
|
|
|
4508
4548
|
pluginData: dependency
|
|
4509
4549
|
};
|
|
4510
4550
|
});
|
|
4511
|
-
buildContext.onLoad(
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4551
|
+
buildContext.onLoad(
|
|
4552
|
+
{ filter: /.*/, namespace: PLAY_PROXY_NAMESPACE },
|
|
4553
|
+
async (args) => {
|
|
4554
|
+
const dependency = args.pluginData ?? dependenciesByPath.get(args.path);
|
|
4555
|
+
if (!dependency) {
|
|
4556
|
+
return null;
|
|
4557
|
+
}
|
|
4558
|
+
return {
|
|
4559
|
+
contents: buildImportedPlayProxyModule(dependency.playName),
|
|
4560
|
+
loader: "ts",
|
|
4561
|
+
resolveDir: dirname5(args.path)
|
|
4562
|
+
};
|
|
4515
4563
|
}
|
|
4516
|
-
|
|
4517
|
-
contents: buildImportedPlayProxyModule(dependency.playName),
|
|
4518
|
-
loader: "ts",
|
|
4519
|
-
resolveDir: dirname5(args.path)
|
|
4520
|
-
};
|
|
4521
|
-
});
|
|
4564
|
+
);
|
|
4522
4565
|
}
|
|
4523
4566
|
};
|
|
4524
4567
|
}
|
|
@@ -4538,18 +4581,26 @@ async function resolveLocalImport(fromFile, specifier) {
|
|
|
4538
4581
|
const candidates = [base];
|
|
4539
4582
|
const explicitExtension = extname(base).toLowerCase();
|
|
4540
4583
|
if (!explicitExtension) {
|
|
4541
|
-
candidates.push(
|
|
4542
|
-
|
|
4584
|
+
candidates.push(
|
|
4585
|
+
...SOURCE_EXTENSIONS.map((extension) => `${base}${extension}`)
|
|
4586
|
+
);
|
|
4587
|
+
candidates.push(
|
|
4588
|
+
...SOURCE_EXTENSIONS.map((extension) => join3(base, `index${extension}`))
|
|
4589
|
+
);
|
|
4543
4590
|
} else if ([".js", ".jsx", ".mjs", ".cjs"].includes(explicitExtension)) {
|
|
4544
4591
|
const stem = base.slice(0, -explicitExtension.length);
|
|
4545
|
-
candidates.push(
|
|
4592
|
+
candidates.push(
|
|
4593
|
+
...SOURCE_EXTENSIONS.map((extension) => `${stem}${extension}`)
|
|
4594
|
+
);
|
|
4546
4595
|
}
|
|
4547
4596
|
for (const candidate of candidates) {
|
|
4548
4597
|
if (await fileExists(candidate)) {
|
|
4549
4598
|
return normalizeLocalPath(candidate);
|
|
4550
4599
|
}
|
|
4551
4600
|
}
|
|
4552
|
-
throw new Error(
|
|
4601
|
+
throw new Error(
|
|
4602
|
+
`Could not resolve local import "${specifier}" from ${fromFile}`
|
|
4603
|
+
);
|
|
4553
4604
|
}
|
|
4554
4605
|
function resolvePackageImport(specifier, fromFile, adapter) {
|
|
4555
4606
|
const packageName = getPackageName(specifier);
|
|
@@ -4597,7 +4648,9 @@ async function analyzeSourceGraph(entryFile, adapter) {
|
|
|
4597
4648
|
);
|
|
4598
4649
|
}
|
|
4599
4650
|
if (NODE_BUILTIN_SET.has(specifier)) {
|
|
4600
|
-
nodeBuiltins.add(
|
|
4651
|
+
nodeBuiltins.add(
|
|
4652
|
+
specifier.startsWith("node:") ? specifier : `node:${specifier}`
|
|
4653
|
+
);
|
|
4601
4654
|
return;
|
|
4602
4655
|
}
|
|
4603
4656
|
if (isLocalSpecifier(specifier)) {
|
|
@@ -4632,7 +4685,11 @@ async function analyzeSourceGraph(entryFile, adapter) {
|
|
|
4632
4685
|
`${absolutePath}:${line}:${column} Unsupported import specifier "${specifier}". Allowed imports are relative files, Node builtins, and installed packages.`
|
|
4633
4686
|
);
|
|
4634
4687
|
}
|
|
4635
|
-
const packageImport = resolvePackageImport(
|
|
4688
|
+
const packageImport = resolvePackageImport(
|
|
4689
|
+
specifier,
|
|
4690
|
+
absolutePath,
|
|
4691
|
+
adapter
|
|
4692
|
+
);
|
|
4636
4693
|
packages.set(packageImport.name, packageImport.version);
|
|
4637
4694
|
};
|
|
4638
4695
|
try {
|
|
@@ -4682,16 +4739,23 @@ async function analyzeSourceGraph(entryFile, adapter) {
|
|
|
4682
4739
|
packages: [...packages.entries()].map(([name, version]) => ({ name, version })).sort((left, right) => left.name.localeCompare(right.name))
|
|
4683
4740
|
},
|
|
4684
4741
|
playName,
|
|
4685
|
-
importedPlayDependencies: [...importedPlayDependencies.values()].sort(
|
|
4742
|
+
importedPlayDependencies: [...importedPlayDependencies.values()].sort(
|
|
4743
|
+
(left, right) => left.filePath.localeCompare(right.filePath)
|
|
4744
|
+
)
|
|
4686
4745
|
};
|
|
4687
4746
|
}
|
|
4688
4747
|
async function computeWorkersHarnessFingerprintWithAdapter(adapter) {
|
|
4689
4748
|
const { readdir } = await import("fs/promises");
|
|
4690
|
-
const entries = await readdir(adapter.workersHarnessFilesDir, {
|
|
4749
|
+
const entries = await readdir(adapter.workersHarnessFilesDir, {
|
|
4750
|
+
withFileTypes: true
|
|
4751
|
+
});
|
|
4691
4752
|
const tsFiles = entries.filter((e) => e.isFile() && /\.[cm]?ts$/.test(e.name)).map((e) => e.name).sort();
|
|
4692
4753
|
const parts = [];
|
|
4693
4754
|
for (const name of tsFiles) {
|
|
4694
|
-
const contents = await readFile(
|
|
4755
|
+
const contents = await readFile(
|
|
4756
|
+
join3(adapter.workersHarnessFilesDir, name),
|
|
4757
|
+
"utf-8"
|
|
4758
|
+
);
|
|
4695
4759
|
parts.push({ name, hash: sha256(contents) });
|
|
4696
4760
|
}
|
|
4697
4761
|
return sha256(JSON.stringify(parts));
|
|
@@ -4867,9 +4931,47 @@ async function runEsbuildForEsmWorkers(playEntryFile, importedPlayDependencies,
|
|
|
4867
4931
|
outputExtension: "mjs"
|
|
4868
4932
|
};
|
|
4869
4933
|
}
|
|
4934
|
+
var PLAY_ARTIFACT_TARGET_ADAPTERS = {
|
|
4935
|
+
[PLAY_ARTIFACT_KINDS.cjsNode20]: {
|
|
4936
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
4937
|
+
codeFormat: "cjs_module",
|
|
4938
|
+
includeWorkersHarnessInGraphHash: false,
|
|
4939
|
+
runEsbuild: ({
|
|
4940
|
+
entryFile,
|
|
4941
|
+
importedPlayDependencies,
|
|
4942
|
+
adapter,
|
|
4943
|
+
exportName
|
|
4944
|
+
}) => runEsbuildForCjsNode(
|
|
4945
|
+
entryFile,
|
|
4946
|
+
importedPlayDependencies,
|
|
4947
|
+
adapter,
|
|
4948
|
+
exportName
|
|
4949
|
+
)
|
|
4950
|
+
},
|
|
4951
|
+
[PLAY_ARTIFACT_KINDS.esmWorkers]: {
|
|
4952
|
+
artifactKind: PLAY_ARTIFACT_KINDS.esmWorkers,
|
|
4953
|
+
codeFormat: "esm_module",
|
|
4954
|
+
includeWorkersHarnessInGraphHash: true,
|
|
4955
|
+
runEsbuild: ({
|
|
4956
|
+
entryFile,
|
|
4957
|
+
importedPlayDependencies,
|
|
4958
|
+
adapter,
|
|
4959
|
+
exportName
|
|
4960
|
+
}) => runEsbuildForEsmWorkers(
|
|
4961
|
+
entryFile,
|
|
4962
|
+
importedPlayDependencies,
|
|
4963
|
+
adapter,
|
|
4964
|
+
exportName
|
|
4965
|
+
)
|
|
4966
|
+
}
|
|
4967
|
+
};
|
|
4968
|
+
function resolvePlayArtifactTargetAdapter(artifactKind) {
|
|
4969
|
+
return PLAY_ARTIFACT_TARGET_ADAPTERS[artifactKind];
|
|
4970
|
+
}
|
|
4870
4971
|
async function bundlePlayFile(filePath, options) {
|
|
4871
4972
|
const adapter = options.adapter;
|
|
4872
4973
|
const target = options.target ?? PLAY_ARTIFACT_KINDS.cjsNode20;
|
|
4974
|
+
const targetAdapter = resolvePlayArtifactTargetAdapter(target);
|
|
4873
4975
|
const exportName = options.exportName?.trim() || "default";
|
|
4874
4976
|
assertValidExportName(exportName);
|
|
4875
4977
|
const absolutePath = await normalizeLocalPath(filePath);
|
|
@@ -4880,7 +4982,7 @@ async function bundlePlayFile(filePath, options) {
|
|
|
4880
4982
|
`${analysis.graphHash}
|
|
4881
4983
|
entry-export:${exportName}`
|
|
4882
4984
|
);
|
|
4883
|
-
if (
|
|
4985
|
+
if (targetAdapter.includeWorkersHarnessInGraphHash) {
|
|
4884
4986
|
const harnessFingerprint = await computeWorkersHarnessFingerprintWithAdapter(adapter);
|
|
4885
4987
|
analysis.graphHash = sha256(
|
|
4886
4988
|
`${analysis.graphHash}
|
|
@@ -4893,7 +4995,9 @@ workers-harness:${harnessFingerprint}`
|
|
|
4893
4995
|
sourcePath: absolutePath,
|
|
4894
4996
|
importedFilePaths: [
|
|
4895
4997
|
...analysis.importPolicy.localFiles,
|
|
4896
|
-
...analysis.importedPlayDependencies.map(
|
|
4998
|
+
...analysis.importedPlayDependencies.map(
|
|
4999
|
+
(dependency) => dependency.filePath
|
|
5000
|
+
)
|
|
4897
5001
|
]
|
|
4898
5002
|
}) ?? []
|
|
4899
5003
|
];
|
|
@@ -4904,7 +5008,11 @@ workers-harness:${harnessFingerprint}`
|
|
|
4904
5008
|
errors: typecheckErrors
|
|
4905
5009
|
};
|
|
4906
5010
|
}
|
|
4907
|
-
const cachedArtifact = await readArtifactCache(
|
|
5011
|
+
const cachedArtifact = await readArtifactCache(
|
|
5012
|
+
analysis.graphHash,
|
|
5013
|
+
target,
|
|
5014
|
+
adapter
|
|
5015
|
+
);
|
|
4908
5016
|
const discoveredFiles = await adapter.discoverPackagedLocalFiles(absolutePath);
|
|
4909
5017
|
if (cachedArtifact) {
|
|
4910
5018
|
const cachedArtifactSizeError = getBundleSizeError(
|
|
@@ -4931,7 +5039,12 @@ workers-harness:${harnessFingerprint}`
|
|
|
4931
5039
|
importedPlayDependencies: analysis.importedPlayDependencies
|
|
4932
5040
|
};
|
|
4933
5041
|
}
|
|
4934
|
-
const buildOutcome =
|
|
5042
|
+
const buildOutcome = await targetAdapter.runEsbuild({
|
|
5043
|
+
entryFile: absolutePath,
|
|
5044
|
+
importedPlayDependencies: analysis.importedPlayDependencies,
|
|
5045
|
+
adapter,
|
|
5046
|
+
exportName
|
|
5047
|
+
});
|
|
4935
5048
|
if (Array.isArray(buildOutcome)) {
|
|
4936
5049
|
return {
|
|
4937
5050
|
success: false,
|
|
@@ -4958,9 +5071,8 @@ workers-harness:${harnessFingerprint}`
|
|
|
4958
5071
|
errors: [bundleSizeError]
|
|
4959
5072
|
};
|
|
4960
5073
|
}
|
|
4961
|
-
const codeFormat = target === PLAY_ARTIFACT_KINDS.esmWorkers ? "esm_module" : "cjs_module";
|
|
4962
5074
|
const artifact = {
|
|
4963
|
-
codeFormat,
|
|
5075
|
+
codeFormat: targetAdapter.codeFormat,
|
|
4964
5076
|
artifactKind: target,
|
|
4965
5077
|
entryFile: absolutePath,
|
|
4966
5078
|
virtualFilename,
|
|
@@ -5004,6 +5116,13 @@ workers-harness:${harnessFingerprint}`
|
|
|
5004
5116
|
}
|
|
5005
5117
|
}
|
|
5006
5118
|
|
|
5119
|
+
// ../shared_libs/play-runtime/dedup-backend.ts
|
|
5120
|
+
var PLAY_DEDUP_BACKENDS = {
|
|
5121
|
+
inMemory: "in_memory",
|
|
5122
|
+
neonTable: "neon_table",
|
|
5123
|
+
durableObject: "durable_object"
|
|
5124
|
+
};
|
|
5125
|
+
|
|
5007
5126
|
// ../shared_libs/play-runtime/scheduler-backend.ts
|
|
5008
5127
|
var PLAY_SCHEDULER_BACKENDS = {
|
|
5009
5128
|
temporal: "temporal",
|
|
@@ -5011,44 +5130,65 @@ var PLAY_SCHEDULER_BACKENDS = {
|
|
|
5011
5130
|
inProcess: "in-process"
|
|
5012
5131
|
};
|
|
5013
5132
|
|
|
5014
|
-
// ../shared_libs/play-runtime/
|
|
5015
|
-
var
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
durableObject: "durable_object"
|
|
5133
|
+
// ../shared_libs/play-runtime/providers.ts
|
|
5134
|
+
var PLAY_RUNTIME_PROVIDER_IDS = {
|
|
5135
|
+
workersEdge: "workers_edge",
|
|
5136
|
+
local: "local"
|
|
5019
5137
|
};
|
|
5020
|
-
|
|
5021
|
-
// ../shared_libs/play-runtime/profiles.ts
|
|
5022
|
-
var PLAY_EXECUTION_PROFILES = {
|
|
5138
|
+
var PLAY_RUNTIME_PROVIDERS = {
|
|
5023
5139
|
workers_edge: {
|
|
5024
|
-
id:
|
|
5140
|
+
id: PLAY_RUNTIME_PROVIDER_IDS.workersEdge,
|
|
5025
5141
|
scheduler: PLAY_SCHEDULER_BACKENDS.cfWorkflows,
|
|
5026
5142
|
runner: PLAY_RUNTIME_BACKENDS.cloudflareWorkers,
|
|
5027
5143
|
dedup: PLAY_DEDUP_BACKENDS.durableObject,
|
|
5144
|
+
artifactKind: PLAY_ARTIFACT_KINDS.esmWorkers,
|
|
5028
5145
|
label: "Cloudflare Dynamic Workflows + Dynamic Workers + DO dedup"
|
|
5029
5146
|
},
|
|
5030
5147
|
local: {
|
|
5031
|
-
id:
|
|
5148
|
+
id: PLAY_RUNTIME_PROVIDER_IDS.local,
|
|
5032
5149
|
scheduler: PLAY_SCHEDULER_BACKENDS.temporal,
|
|
5033
5150
|
runner: PLAY_RUNTIME_BACKENDS.localProcess,
|
|
5034
5151
|
dedup: PLAY_DEDUP_BACKENDS.inMemory,
|
|
5152
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
5035
5153
|
label: "Local Temporal scheduler + local subprocess runner (tests)"
|
|
5036
5154
|
}
|
|
5037
5155
|
};
|
|
5038
|
-
function
|
|
5039
|
-
return
|
|
5156
|
+
function defaultPlayRuntimeProvider() {
|
|
5157
|
+
return PLAY_RUNTIME_PROVIDERS.workers_edge;
|
|
5040
5158
|
}
|
|
5041
|
-
function
|
|
5159
|
+
function resolvePlayRuntimeProvider(override) {
|
|
5042
5160
|
if (override?.trim()) {
|
|
5043
5161
|
const id = override.trim();
|
|
5044
|
-
if (id in
|
|
5045
|
-
return
|
|
5162
|
+
if (id in PLAY_RUNTIME_PROVIDERS) {
|
|
5163
|
+
return PLAY_RUNTIME_PROVIDERS[id];
|
|
5046
5164
|
}
|
|
5047
5165
|
throw new Error(
|
|
5048
|
-
`Unknown
|
|
5166
|
+
`Unknown play runtime provider "${id}". Expected one of: ${Object.keys(
|
|
5167
|
+
PLAY_RUNTIME_PROVIDERS
|
|
5168
|
+
).join(", ")}.`
|
|
5049
5169
|
);
|
|
5050
5170
|
}
|
|
5051
|
-
return
|
|
5171
|
+
return defaultPlayRuntimeProvider();
|
|
5172
|
+
}
|
|
5173
|
+
|
|
5174
|
+
// ../shared_libs/play-runtime/profiles.ts
|
|
5175
|
+
var PLAY_EXECUTION_PROFILE_IDS = {
|
|
5176
|
+
...PLAY_RUNTIME_PROVIDER_IDS
|
|
5177
|
+
};
|
|
5178
|
+
var PLAY_EXECUTION_PROFILES = PLAY_RUNTIME_PROVIDERS;
|
|
5179
|
+
function resolveExecutionProfile(override) {
|
|
5180
|
+
try {
|
|
5181
|
+
return resolvePlayRuntimeProvider(override);
|
|
5182
|
+
} catch (error) {
|
|
5183
|
+
if (override?.trim()) {
|
|
5184
|
+
throw new Error(
|
|
5185
|
+
`Unknown execution profile "${override.trim()}". Expected one of: ${Object.keys(
|
|
5186
|
+
PLAY_EXECUTION_PROFILES
|
|
5187
|
+
).join(", ")}.`
|
|
5188
|
+
);
|
|
5189
|
+
}
|
|
5190
|
+
throw error;
|
|
5191
|
+
}
|
|
5052
5192
|
}
|
|
5053
5193
|
|
|
5054
5194
|
// src/plays/local-file-discovery.ts
|
|
@@ -5366,8 +5506,19 @@ var SDK_PACKAGE_JSON = resolve8(SDK_PACKAGE_ROOT, "package.json");
|
|
|
5366
5506
|
var SDK_ENTRY_FILE = resolve8(SDK_SOURCE_ROOT, "index.ts");
|
|
5367
5507
|
var SDK_TYPES_ENTRY_FILE = HAS_SOURCE_BUNDLING_SOURCES ? SDK_ENTRY_FILE : resolve8(SDK_PACKAGE_ROOT, "dist", "index.d.ts");
|
|
5368
5508
|
var SDK_WORKERS_ENTRY_FILE = resolve8(SDK_SOURCE_ROOT, "worker-play-entry.ts");
|
|
5369
|
-
var WORKERS_HARNESS_ENTRY_FILE = resolve8(
|
|
5370
|
-
|
|
5509
|
+
var WORKERS_HARNESS_ENTRY_FILE = resolve8(
|
|
5510
|
+
PROJECT_ROOT,
|
|
5511
|
+
"apps",
|
|
5512
|
+
"play-runner-workers",
|
|
5513
|
+
"src",
|
|
5514
|
+
"entry.ts"
|
|
5515
|
+
);
|
|
5516
|
+
var WORKERS_HARNESS_FILES_DIR = resolve8(
|
|
5517
|
+
PROJECT_ROOT,
|
|
5518
|
+
"apps",
|
|
5519
|
+
"play-runner-workers",
|
|
5520
|
+
"src"
|
|
5521
|
+
);
|
|
5371
5522
|
var hasWarnedAboutNonDevelopmentBundling = false;
|
|
5372
5523
|
function warnAboutNonDevelopmentBundling(filePath) {
|
|
5373
5524
|
if (hasWarnedAboutNonDevelopmentBundling) {
|
|
@@ -5386,13 +5537,16 @@ function warnAboutNonDevelopmentBundling(filePath) {
|
|
|
5386
5537
|
);
|
|
5387
5538
|
}
|
|
5388
5539
|
function defaultPlayBundleTarget() {
|
|
5389
|
-
return
|
|
5540
|
+
return resolveExecutionProfile(null).artifactKind;
|
|
5390
5541
|
}
|
|
5391
5542
|
function createSdkPlayBundlingAdapter() {
|
|
5392
5543
|
return {
|
|
5393
5544
|
projectRoot: PROJECT_ROOT,
|
|
5394
5545
|
nodeModulesDir: resolve8(PROJECT_ROOT, "node_modules"),
|
|
5395
|
-
cacheDir: join5(
|
|
5546
|
+
cacheDir: join5(
|
|
5547
|
+
tmpdir2(),
|
|
5548
|
+
`deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION2}`
|
|
5549
|
+
),
|
|
5396
5550
|
sdkSourceRoot: SDK_SOURCE_ROOT,
|
|
5397
5551
|
sdkPackageJson: SDK_PACKAGE_JSON,
|
|
5398
5552
|
sdkEntryFile: SDK_ENTRY_FILE,
|
package/dist/index.js
CHANGED
|
@@ -216,10 +216,10 @@ function resolveConfig(options) {
|
|
|
216
216
|
|
|
217
217
|
// src/release.ts
|
|
218
218
|
var SDK_RELEASE = {
|
|
219
|
-
version: "0.1.
|
|
219
|
+
version: "0.1.55",
|
|
220
220
|
apiContract: "2026-05-run-response-package",
|
|
221
221
|
supportPolicy: {
|
|
222
|
-
latest: "0.1.
|
|
222
|
+
latest: "0.1.55",
|
|
223
223
|
minimumSupported: "0.1.53",
|
|
224
224
|
deprecatedBelow: "0.1.53"
|
|
225
225
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -170,10 +170,10 @@ function resolveConfig(options) {
|
|
|
170
170
|
|
|
171
171
|
// src/release.ts
|
|
172
172
|
var SDK_RELEASE = {
|
|
173
|
-
version: "0.1.
|
|
173
|
+
version: "0.1.55",
|
|
174
174
|
apiContract: "2026-05-run-response-package",
|
|
175
175
|
supportPolicy: {
|
|
176
|
-
latest: "0.1.
|
|
176
|
+
latest: "0.1.55",
|
|
177
177
|
minimumSupported: "0.1.53",
|
|
178
178
|
deprecatedBelow: "0.1.53"
|
|
179
179
|
}
|
|
@@ -14,13 +14,10 @@ import {
|
|
|
14
14
|
} from '../../../shared_libs/plays/bundling/index.js';
|
|
15
15
|
import {
|
|
16
16
|
PLAY_ARTIFACT_KINDS,
|
|
17
|
-
PLAY_BACKEND_DESCRIPTORS,
|
|
18
17
|
type PlayArtifactKind,
|
|
19
18
|
} from '../../../shared_libs/play-runtime/backend.js';
|
|
20
19
|
import { resolveExecutionProfile } from '../../../shared_libs/play-runtime/profiles.js';
|
|
21
|
-
import {
|
|
22
|
-
discoverPackagedLocalFiles,
|
|
23
|
-
} from './local-file-discovery.js';
|
|
20
|
+
import { discoverPackagedLocalFiles } from './local-file-discovery.js';
|
|
24
21
|
|
|
25
22
|
export type {
|
|
26
23
|
BundlePlayFileOptions,
|
|
@@ -39,9 +36,7 @@ export type {
|
|
|
39
36
|
PlayRuntimeFeature,
|
|
40
37
|
} from '../../../shared_libs/plays/bundling/index.js';
|
|
41
38
|
|
|
42
|
-
export {
|
|
43
|
-
extractDefinedPlayName,
|
|
44
|
-
} from '../../../shared_libs/plays/bundling/index.js';
|
|
39
|
+
export { extractDefinedPlayName } from '../../../shared_libs/plays/bundling/index.js';
|
|
45
40
|
|
|
46
41
|
const PLAY_BUNDLE_CACHE_VERSION = 30;
|
|
47
42
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
@@ -57,21 +52,32 @@ const HAS_PACKAGED_BUNDLING_SOURCES = existsSync(
|
|
|
57
52
|
const PROJECT_ROOT = HAS_SOURCE_BUNDLING_SOURCES
|
|
58
53
|
? SOURCE_REPO_ROOT
|
|
59
54
|
: HAS_PACKAGED_BUNDLING_SOURCES
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
? PACKAGED_REPO_ROOT
|
|
56
|
+
: resolve(SDK_PACKAGE_ROOT, '..');
|
|
62
57
|
const SDK_SOURCE_ROOT = HAS_SOURCE_BUNDLING_SOURCES
|
|
63
58
|
? resolve(SOURCE_REPO_ROOT, 'sdk', 'src')
|
|
64
59
|
: HAS_PACKAGED_BUNDLING_SOURCES
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
? resolve(PACKAGED_REPO_ROOT, 'sdk', 'src')
|
|
61
|
+
: resolve(SDK_PACKAGE_ROOT, 'src');
|
|
67
62
|
const SDK_PACKAGE_JSON = resolve(SDK_PACKAGE_ROOT, 'package.json');
|
|
68
63
|
const SDK_ENTRY_FILE = resolve(SDK_SOURCE_ROOT, 'index.ts');
|
|
69
64
|
const SDK_TYPES_ENTRY_FILE = HAS_SOURCE_BUNDLING_SOURCES
|
|
70
65
|
? SDK_ENTRY_FILE
|
|
71
66
|
: resolve(SDK_PACKAGE_ROOT, 'dist', 'index.d.ts');
|
|
72
67
|
const SDK_WORKERS_ENTRY_FILE = resolve(SDK_SOURCE_ROOT, 'worker-play-entry.ts');
|
|
73
|
-
const WORKERS_HARNESS_ENTRY_FILE = resolve(
|
|
74
|
-
|
|
68
|
+
const WORKERS_HARNESS_ENTRY_FILE = resolve(
|
|
69
|
+
PROJECT_ROOT,
|
|
70
|
+
'apps',
|
|
71
|
+
'play-runner-workers',
|
|
72
|
+
'src',
|
|
73
|
+
'entry.ts',
|
|
74
|
+
);
|
|
75
|
+
const WORKERS_HARNESS_FILES_DIR = resolve(
|
|
76
|
+
PROJECT_ROOT,
|
|
77
|
+
'apps',
|
|
78
|
+
'play-runner-workers',
|
|
79
|
+
'src',
|
|
80
|
+
);
|
|
75
81
|
let hasWarnedAboutNonDevelopmentBundling = false;
|
|
76
82
|
|
|
77
83
|
/**
|
|
@@ -93,7 +99,9 @@ function warnAboutNonDevelopmentBundling(filePath: string): void {
|
|
|
93
99
|
return;
|
|
94
100
|
}
|
|
95
101
|
|
|
96
|
-
const nodeEnv = String(process.env.NODE_ENV ?? '')
|
|
102
|
+
const nodeEnv = String(process.env.NODE_ENV ?? '')
|
|
103
|
+
.trim()
|
|
104
|
+
.toLowerCase();
|
|
97
105
|
if (!nodeEnv || nodeEnv === 'development' || nodeEnv === 'test') {
|
|
98
106
|
return;
|
|
99
107
|
}
|
|
@@ -111,16 +119,17 @@ function warnAboutNonDevelopmentBundling(filePath: string): void {
|
|
|
111
119
|
}
|
|
112
120
|
|
|
113
121
|
function defaultPlayBundleTarget(): PlayArtifactKind {
|
|
114
|
-
return
|
|
115
|
-
resolveExecutionProfile(null).runner
|
|
116
|
-
].artifactKind;
|
|
122
|
+
return resolveExecutionProfile(null).artifactKind;
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
export function createSdkPlayBundlingAdapter(): PlayBundlingAdapter {
|
|
120
126
|
return {
|
|
121
127
|
projectRoot: PROJECT_ROOT,
|
|
122
128
|
nodeModulesDir: resolve(PROJECT_ROOT, 'node_modules'),
|
|
123
|
-
cacheDir: join(
|
|
129
|
+
cacheDir: join(
|
|
130
|
+
tmpdir(),
|
|
131
|
+
`deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION}`,
|
|
132
|
+
),
|
|
124
133
|
sdkSourceRoot: SDK_SOURCE_ROOT,
|
|
125
134
|
sdkPackageJson: SDK_PACKAGE_JSON,
|
|
126
135
|
sdkEntryFile: SDK_ENTRY_FILE,
|
|
@@ -50,10 +50,10 @@ export type SdkRelease = {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
export const SDK_RELEASE = {
|
|
53
|
-
version: '0.1.
|
|
53
|
+
version: '0.1.55',
|
|
54
54
|
apiContract: '2026-05-run-response-package',
|
|
55
55
|
supportPolicy: {
|
|
56
|
-
latest: '0.1.
|
|
56
|
+
latest: '0.1.55',
|
|
57
57
|
minimumSupported: '0.1.53',
|
|
58
58
|
deprecatedBelow: '0.1.53',
|
|
59
59
|
},
|