deepline 0.1.249 → 0.1.251
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/sdk/src/client.ts +82 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +93 -9
- package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-runtime-config.ts +10 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +19 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-environment.ts +44 -0
- package/dist/bundling-sources/shared_libs/play-runtime/secret-redaction.ts +18 -0
- package/dist/cli/index.js +112 -14
- package/dist/cli/index.mjs +112 -14
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +102 -2
- package/dist/index.mjs +102 -2
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -632,7 +632,7 @@ var SDK_RELEASE = {
|
|
|
632
632
|
// runtime intentionally no longer compiles at publish or launch time.
|
|
633
633
|
// 0.1.242 removes the retired Workers/ESM compiler, generated bundles, and
|
|
634
634
|
// deploy-time artifact migration. Play authoring now has one CJS contract.
|
|
635
|
-
version: "0.1.
|
|
635
|
+
version: "0.1.251",
|
|
636
636
|
apiContract: "2026-07-cjs-absurd-only-play-runtime-hard-cutover",
|
|
637
637
|
supportPolicy: {
|
|
638
638
|
minimumSupported: "0.1.53",
|
|
@@ -790,6 +790,7 @@ var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
|
|
|
790
790
|
var COORDINATOR_URL_OVERRIDE_HEADER = "x-deepline-coordinator-url";
|
|
791
791
|
var WORKER_CALLBACK_URL_OVERRIDE_HEADER = "x-deepline-worker-callback-url";
|
|
792
792
|
var RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER = "x-deepline-runtime-scheduler-schema";
|
|
793
|
+
var RUNTIME_ENVIRONMENT_TOKEN_HEADER = "x-deepline-runtime-environment-token";
|
|
793
794
|
var ABSURD_RELEASE_OVERRIDE_HEADER = "x-deepline-absurd-release";
|
|
794
795
|
var SYNTHETIC_RUN_HEADER = "x-deepline-synthetic-run";
|
|
795
796
|
|
|
@@ -1454,9 +1455,25 @@ function createSecretRedactionContext(initialValues = []) {
|
|
|
1454
1455
|
}
|
|
1455
1456
|
return value;
|
|
1456
1457
|
}
|
|
1458
|
+
function redactKnownSecrets(value) {
|
|
1459
|
+
if (typeof value === "string") return redactString(value);
|
|
1460
|
+
if (Array.isArray(value)) {
|
|
1461
|
+
return value.map((entry) => redactKnownSecrets(entry));
|
|
1462
|
+
}
|
|
1463
|
+
if (value && typeof value === "object") {
|
|
1464
|
+
return Object.fromEntries(
|
|
1465
|
+
Object.entries(value).map(([key, entry]) => [
|
|
1466
|
+
key,
|
|
1467
|
+
redactKnownSecrets(entry)
|
|
1468
|
+
])
|
|
1469
|
+
);
|
|
1470
|
+
}
|
|
1471
|
+
return value;
|
|
1472
|
+
}
|
|
1457
1473
|
return {
|
|
1458
1474
|
register,
|
|
1459
1475
|
redactString,
|
|
1476
|
+
redactKnownSecrets,
|
|
1460
1477
|
redact
|
|
1461
1478
|
};
|
|
1462
1479
|
}
|
|
@@ -2363,6 +2380,29 @@ async function* observeRunEvents(options) {
|
|
|
2363
2380
|
}
|
|
2364
2381
|
}
|
|
2365
2382
|
|
|
2383
|
+
// ../shared_libs/play-runtime/runtime-environment.ts
|
|
2384
|
+
var PLAY_RUNTIME_ENVIRONMENTS = ["preview"];
|
|
2385
|
+
var PLAY_RUNTIME_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]{0,30}$/;
|
|
2386
|
+
function normalizePlayRuntimeNamespace(value) {
|
|
2387
|
+
if (typeof value !== "string") return null;
|
|
2388
|
+
const normalized = value.trim();
|
|
2389
|
+
return PLAY_RUNTIME_NAMESPACE_PATTERN.test(normalized) ? normalized : null;
|
|
2390
|
+
}
|
|
2391
|
+
function normalizePlayRuntimeSelection(value) {
|
|
2392
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
2393
|
+
const record = value;
|
|
2394
|
+
if (Object.keys(record).some(
|
|
2395
|
+
(key) => key !== "environment" && key !== "namespace"
|
|
2396
|
+
) || record.environment !== "preview") {
|
|
2397
|
+
return null;
|
|
2398
|
+
}
|
|
2399
|
+
const namespace = normalizePlayRuntimeNamespace(record.namespace);
|
|
2400
|
+
return namespace ? { environment: "preview", namespace } : null;
|
|
2401
|
+
}
|
|
2402
|
+
function normalizePlayRuntimeEnvironment(value) {
|
|
2403
|
+
return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2366
2406
|
// src/client.ts
|
|
2367
2407
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
2368
2408
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
@@ -2385,6 +2425,61 @@ function resolvePlayRunIntegrationMode(request) {
|
|
|
2385
2425
|
request.integrationMode ?? process.env.DEEPLINE_EVAL_INTEGRATION_MODE
|
|
2386
2426
|
);
|
|
2387
2427
|
}
|
|
2428
|
+
function resolvePlayRunRuntimeSelection(request) {
|
|
2429
|
+
if (request.runtime !== void 0) {
|
|
2430
|
+
const runtime = normalizePlayRuntimeSelection(request.runtime);
|
|
2431
|
+
if (!runtime) {
|
|
2432
|
+
throw new DeeplineError(
|
|
2433
|
+
'runtime must be exactly { environment: "preview", namespace } with namespace matching ^[a-z][a-z0-9-]{0,30}$.',
|
|
2434
|
+
void 0,
|
|
2435
|
+
"INVALID_RUNTIME_SELECTION"
|
|
2436
|
+
);
|
|
2437
|
+
}
|
|
2438
|
+
return runtime;
|
|
2439
|
+
}
|
|
2440
|
+
const configured = process.env.DEEPLINE_RUNTIME_ENVIRONMENT?.trim();
|
|
2441
|
+
const configuredNamespace = process.env.DEEPLINE_RUNTIME_NAMESPACE?.trim();
|
|
2442
|
+
const configuredToken = process.env.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN?.trim();
|
|
2443
|
+
if (!configured) {
|
|
2444
|
+
if (configuredNamespace || configuredToken) {
|
|
2445
|
+
throw new DeeplineError(
|
|
2446
|
+
"DEEPLINE_RUNTIME_ENVIRONMENT=preview and DEEPLINE_RUNTIME_NAMESPACE are required when runtime selection configuration is present.",
|
|
2447
|
+
void 0,
|
|
2448
|
+
"INVALID_RUNTIME_ENVIRONMENT"
|
|
2449
|
+
);
|
|
2450
|
+
}
|
|
2451
|
+
return void 0;
|
|
2452
|
+
}
|
|
2453
|
+
const environment = normalizePlayRuntimeEnvironment(configured);
|
|
2454
|
+
if (!environment) {
|
|
2455
|
+
throw new DeeplineError(
|
|
2456
|
+
`DEEPLINE_RUNTIME_ENVIRONMENT supports only explicit preview selection. Received "${configured}". Omit it to use the app-native runtime.`,
|
|
2457
|
+
void 0,
|
|
2458
|
+
"INVALID_RUNTIME_ENVIRONMENT"
|
|
2459
|
+
);
|
|
2460
|
+
}
|
|
2461
|
+
const namespace = normalizePlayRuntimeNamespace(configuredNamespace);
|
|
2462
|
+
if (!namespace) {
|
|
2463
|
+
throw new DeeplineError(
|
|
2464
|
+
"DEEPLINE_RUNTIME_NAMESPACE is required for preview and must match ^[a-z][a-z0-9-]{0,30}$.",
|
|
2465
|
+
void 0,
|
|
2466
|
+
"INVALID_RUNTIME_NAMESPACE"
|
|
2467
|
+
);
|
|
2468
|
+
}
|
|
2469
|
+
return { environment, namespace };
|
|
2470
|
+
}
|
|
2471
|
+
function runtimeSelectionHeaders(runtime) {
|
|
2472
|
+
if (!runtime) return void 0;
|
|
2473
|
+
const token = process.env.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN?.trim();
|
|
2474
|
+
if (!token) {
|
|
2475
|
+
throw new DeeplineError(
|
|
2476
|
+
"DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
|
|
2477
|
+
void 0,
|
|
2478
|
+
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
2479
|
+
);
|
|
2480
|
+
}
|
|
2481
|
+
return { [RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token };
|
|
2482
|
+
}
|
|
2388
2483
|
function normalizeTestPolicyOverrides(value, source) {
|
|
2389
2484
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
2390
2485
|
return value;
|
|
@@ -3083,6 +3178,7 @@ var DeeplineClient = class {
|
|
|
3083
3178
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
3084
3179
|
const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
|
|
3085
3180
|
const forceToolRefresh = request.forceToolRefresh === true;
|
|
3181
|
+
const runtime = resolvePlayRunRuntimeSelection(request);
|
|
3086
3182
|
const response = await this.http.post(
|
|
3087
3183
|
"/api/v2/plays/run",
|
|
3088
3184
|
{
|
|
@@ -3109,9 +3205,10 @@ var DeeplineClient = class {
|
|
|
3109
3205
|
// defaults to absurd; callers normally omit this field.
|
|
3110
3206
|
...request.profile ? { profile: request.profile } : {},
|
|
3111
3207
|
...integrationMode ? { integrationMode } : {},
|
|
3208
|
+
...runtime ? { runtime } : {},
|
|
3112
3209
|
...testPolicyOverrides ? { testPolicyOverrides } : {}
|
|
3113
3210
|
},
|
|
3114
|
-
|
|
3211
|
+
runtimeSelectionHeaders(runtime),
|
|
3115
3212
|
// A start can reach the server even when its response is lost or times
|
|
3116
3213
|
// out. Retrying this mutation without an idempotency key can create a
|
|
3117
3214
|
// second root run, so callers must resolve ambiguous failures explicitly.
|
|
@@ -3134,6 +3231,7 @@ var DeeplineClient = class {
|
|
|
3134
3231
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
3135
3232
|
const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
|
|
3136
3233
|
const forceToolRefresh = request.forceToolRefresh === true;
|
|
3234
|
+
const runtime = resolvePlayRunRuntimeSelection(request);
|
|
3137
3235
|
const body = {
|
|
3138
3236
|
...request.name ? { name: request.name } : {},
|
|
3139
3237
|
...request.revisionId ? { revisionId: request.revisionId } : {},
|
|
@@ -3156,6 +3254,7 @@ var DeeplineClient = class {
|
|
|
3156
3254
|
...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
|
|
3157
3255
|
...request.profile ? { profile: request.profile } : {},
|
|
3158
3256
|
...integrationMode ? { integrationMode } : {},
|
|
3257
|
+
...runtime ? { runtime } : {},
|
|
3159
3258
|
...testPolicyOverrides ? { testPolicyOverrides } : {}
|
|
3160
3259
|
};
|
|
3161
3260
|
for await (const event of this.http.streamSse(
|
|
@@ -3163,6 +3262,7 @@ var DeeplineClient = class {
|
|
|
3163
3262
|
{
|
|
3164
3263
|
method: "POST",
|
|
3165
3264
|
body,
|
|
3265
|
+
headers: runtimeSelectionHeaders(runtime),
|
|
3166
3266
|
signal: options?.signal
|
|
3167
3267
|
}
|
|
3168
3268
|
)) {
|
|
@@ -24350,7 +24450,7 @@ function renderAvailableToolsText(payload) {
|
|
|
24350
24450
|
const returned = asFiniteNumber(payload.returned) ?? tools.length;
|
|
24351
24451
|
const total = asFiniteNumber(payload.total);
|
|
24352
24452
|
const lines = [
|
|
24353
|
-
total !== void 0 ? `
|
|
24453
|
+
total !== void 0 ? `Monitor types you can deploy (${returned} of ${total}):` : "Monitor types you can deploy:"
|
|
24354
24454
|
];
|
|
24355
24455
|
let currentProvider;
|
|
24356
24456
|
for (const raw of tools) {
|
|
@@ -24385,7 +24485,7 @@ function renderAvailableToolsText(payload) {
|
|
|
24385
24485
|
" See monitors already deployed in this workspace:",
|
|
24386
24486
|
" deepline monitors list",
|
|
24387
24487
|
" Validate a monitor definition before deploying:",
|
|
24388
|
-
` deepline monitors check '{"key":"my-
|
|
24488
|
+
` deepline monitors check '{"key":"my-monitor","tool":"<provider.tool>","payload":{...}}'`
|
|
24389
24489
|
);
|
|
24390
24490
|
return `${lines.join("\n")}
|
|
24391
24491
|
`;
|
|
@@ -24689,7 +24789,7 @@ Examples:
|
|
|
24689
24789
|
deepline monitors deploy --file monitor.json
|
|
24690
24790
|
deepline monitors list --status all --json
|
|
24691
24791
|
deepline monitors get my-monitor --json
|
|
24692
|
-
deepline monitors update my-monitor '{"
|
|
24792
|
+
deepline monitors update my-monitor '{"name":"Interested replies"}' --json
|
|
24693
24793
|
deepline monitors delete my-monitor --dry-run
|
|
24694
24794
|
deepline monitors reactivate my-monitor --dry-run
|
|
24695
24795
|
`
|
|
@@ -24779,8 +24879,8 @@ Examples:
|
|
|
24779
24879
|
`
|
|
24780
24880
|
Notes:
|
|
24781
24881
|
Read-only validation. <definition> is a JSON object with key, tool, payload,
|
|
24782
|
-
and optional controls (Deepline lifecycle metadata,
|
|
24783
|
-
|
|
24882
|
+
and optional controls (Deepline lifecycle metadata). Pass it positionally,
|
|
24883
|
+
via --file <path>, or
|
|
24784
24884
|
from stdin with --file -. Does not deploy or spend credits.
|
|
24785
24885
|
|
|
24786
24886
|
Examples:
|
|
@@ -24799,9 +24899,8 @@ Examples:
|
|
|
24799
24899
|
`
|
|
24800
24900
|
Notes:
|
|
24801
24901
|
Mutates workspace state and may spend Deepline credits. <definition> is a JSON
|
|
24802
|
-
object with key, tool, payload, and optional controls
|
|
24803
|
-
|
|
24804
|
-
from stdin with --file -.
|
|
24902
|
+
object with key, tool, payload, and optional controls. Pass it positionally,
|
|
24903
|
+
via --file <path>, or from stdin with --file -.
|
|
24805
24904
|
--dry-run validates the definition and shows the plan (deploy cost in Deepline
|
|
24806
24905
|
credits when the server reports it, plus any existing monitors that may
|
|
24807
24906
|
already cover this scope) WITHOUT deploying. Exits 0 when valid, 7 when not.
|
|
@@ -24824,12 +24923,11 @@ Examples:
|
|
|
24824
24923
|
"after",
|
|
24825
24924
|
`
|
|
24826
24925
|
Notes:
|
|
24827
|
-
Mutates workspace state. <patch> is a JSON object of fields to update
|
|
24828
|
-
|
|
24829
|
-
via --file <path>, or from stdin with --file -.
|
|
24926
|
+
Mutates workspace state. <patch> is a JSON object of fields to update. Pass it
|
|
24927
|
+
positionally, via --file <path>, or from stdin with --file -.
|
|
24830
24928
|
|
|
24831
24929
|
Examples:
|
|
24832
|
-
deepline monitors update my-monitor '{"
|
|
24930
|
+
deepline monitors update my-monitor '{"name":"Interested replies"}' --json
|
|
24833
24931
|
deepline monitors update my-monitor --file patch.json
|
|
24834
24932
|
`
|
|
24835
24933
|
).option(
|
package/dist/cli/index.mjs
CHANGED
|
@@ -617,7 +617,7 @@ var SDK_RELEASE = {
|
|
|
617
617
|
// runtime intentionally no longer compiles at publish or launch time.
|
|
618
618
|
// 0.1.242 removes the retired Workers/ESM compiler, generated bundles, and
|
|
619
619
|
// deploy-time artifact migration. Play authoring now has one CJS contract.
|
|
620
|
-
version: "0.1.
|
|
620
|
+
version: "0.1.251",
|
|
621
621
|
apiContract: "2026-07-cjs-absurd-only-play-runtime-hard-cutover",
|
|
622
622
|
supportPolicy: {
|
|
623
623
|
minimumSupported: "0.1.53",
|
|
@@ -775,6 +775,7 @@ var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
|
|
|
775
775
|
var COORDINATOR_URL_OVERRIDE_HEADER = "x-deepline-coordinator-url";
|
|
776
776
|
var WORKER_CALLBACK_URL_OVERRIDE_HEADER = "x-deepline-worker-callback-url";
|
|
777
777
|
var RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER = "x-deepline-runtime-scheduler-schema";
|
|
778
|
+
var RUNTIME_ENVIRONMENT_TOKEN_HEADER = "x-deepline-runtime-environment-token";
|
|
778
779
|
var ABSURD_RELEASE_OVERRIDE_HEADER = "x-deepline-absurd-release";
|
|
779
780
|
var SYNTHETIC_RUN_HEADER = "x-deepline-synthetic-run";
|
|
780
781
|
|
|
@@ -1439,9 +1440,25 @@ function createSecretRedactionContext(initialValues = []) {
|
|
|
1439
1440
|
}
|
|
1440
1441
|
return value;
|
|
1441
1442
|
}
|
|
1443
|
+
function redactKnownSecrets(value) {
|
|
1444
|
+
if (typeof value === "string") return redactString(value);
|
|
1445
|
+
if (Array.isArray(value)) {
|
|
1446
|
+
return value.map((entry) => redactKnownSecrets(entry));
|
|
1447
|
+
}
|
|
1448
|
+
if (value && typeof value === "object") {
|
|
1449
|
+
return Object.fromEntries(
|
|
1450
|
+
Object.entries(value).map(([key, entry]) => [
|
|
1451
|
+
key,
|
|
1452
|
+
redactKnownSecrets(entry)
|
|
1453
|
+
])
|
|
1454
|
+
);
|
|
1455
|
+
}
|
|
1456
|
+
return value;
|
|
1457
|
+
}
|
|
1442
1458
|
return {
|
|
1443
1459
|
register,
|
|
1444
1460
|
redactString,
|
|
1461
|
+
redactKnownSecrets,
|
|
1445
1462
|
redact
|
|
1446
1463
|
};
|
|
1447
1464
|
}
|
|
@@ -2348,6 +2365,29 @@ async function* observeRunEvents(options) {
|
|
|
2348
2365
|
}
|
|
2349
2366
|
}
|
|
2350
2367
|
|
|
2368
|
+
// ../shared_libs/play-runtime/runtime-environment.ts
|
|
2369
|
+
var PLAY_RUNTIME_ENVIRONMENTS = ["preview"];
|
|
2370
|
+
var PLAY_RUNTIME_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]{0,30}$/;
|
|
2371
|
+
function normalizePlayRuntimeNamespace(value) {
|
|
2372
|
+
if (typeof value !== "string") return null;
|
|
2373
|
+
const normalized = value.trim();
|
|
2374
|
+
return PLAY_RUNTIME_NAMESPACE_PATTERN.test(normalized) ? normalized : null;
|
|
2375
|
+
}
|
|
2376
|
+
function normalizePlayRuntimeSelection(value) {
|
|
2377
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
2378
|
+
const record = value;
|
|
2379
|
+
if (Object.keys(record).some(
|
|
2380
|
+
(key) => key !== "environment" && key !== "namespace"
|
|
2381
|
+
) || record.environment !== "preview") {
|
|
2382
|
+
return null;
|
|
2383
|
+
}
|
|
2384
|
+
const namespace = normalizePlayRuntimeNamespace(record.namespace);
|
|
2385
|
+
return namespace ? { environment: "preview", namespace } : null;
|
|
2386
|
+
}
|
|
2387
|
+
function normalizePlayRuntimeEnvironment(value) {
|
|
2388
|
+
return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2351
2391
|
// src/client.ts
|
|
2352
2392
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
2353
2393
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
@@ -2370,6 +2410,61 @@ function resolvePlayRunIntegrationMode(request) {
|
|
|
2370
2410
|
request.integrationMode ?? process.env.DEEPLINE_EVAL_INTEGRATION_MODE
|
|
2371
2411
|
);
|
|
2372
2412
|
}
|
|
2413
|
+
function resolvePlayRunRuntimeSelection(request) {
|
|
2414
|
+
if (request.runtime !== void 0) {
|
|
2415
|
+
const runtime = normalizePlayRuntimeSelection(request.runtime);
|
|
2416
|
+
if (!runtime) {
|
|
2417
|
+
throw new DeeplineError(
|
|
2418
|
+
'runtime must be exactly { environment: "preview", namespace } with namespace matching ^[a-z][a-z0-9-]{0,30}$.',
|
|
2419
|
+
void 0,
|
|
2420
|
+
"INVALID_RUNTIME_SELECTION"
|
|
2421
|
+
);
|
|
2422
|
+
}
|
|
2423
|
+
return runtime;
|
|
2424
|
+
}
|
|
2425
|
+
const configured = process.env.DEEPLINE_RUNTIME_ENVIRONMENT?.trim();
|
|
2426
|
+
const configuredNamespace = process.env.DEEPLINE_RUNTIME_NAMESPACE?.trim();
|
|
2427
|
+
const configuredToken = process.env.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN?.trim();
|
|
2428
|
+
if (!configured) {
|
|
2429
|
+
if (configuredNamespace || configuredToken) {
|
|
2430
|
+
throw new DeeplineError(
|
|
2431
|
+
"DEEPLINE_RUNTIME_ENVIRONMENT=preview and DEEPLINE_RUNTIME_NAMESPACE are required when runtime selection configuration is present.",
|
|
2432
|
+
void 0,
|
|
2433
|
+
"INVALID_RUNTIME_ENVIRONMENT"
|
|
2434
|
+
);
|
|
2435
|
+
}
|
|
2436
|
+
return void 0;
|
|
2437
|
+
}
|
|
2438
|
+
const environment = normalizePlayRuntimeEnvironment(configured);
|
|
2439
|
+
if (!environment) {
|
|
2440
|
+
throw new DeeplineError(
|
|
2441
|
+
`DEEPLINE_RUNTIME_ENVIRONMENT supports only explicit preview selection. Received "${configured}". Omit it to use the app-native runtime.`,
|
|
2442
|
+
void 0,
|
|
2443
|
+
"INVALID_RUNTIME_ENVIRONMENT"
|
|
2444
|
+
);
|
|
2445
|
+
}
|
|
2446
|
+
const namespace = normalizePlayRuntimeNamespace(configuredNamespace);
|
|
2447
|
+
if (!namespace) {
|
|
2448
|
+
throw new DeeplineError(
|
|
2449
|
+
"DEEPLINE_RUNTIME_NAMESPACE is required for preview and must match ^[a-z][a-z0-9-]{0,30}$.",
|
|
2450
|
+
void 0,
|
|
2451
|
+
"INVALID_RUNTIME_NAMESPACE"
|
|
2452
|
+
);
|
|
2453
|
+
}
|
|
2454
|
+
return { environment, namespace };
|
|
2455
|
+
}
|
|
2456
|
+
function runtimeSelectionHeaders(runtime) {
|
|
2457
|
+
if (!runtime) return void 0;
|
|
2458
|
+
const token = process.env.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN?.trim();
|
|
2459
|
+
if (!token) {
|
|
2460
|
+
throw new DeeplineError(
|
|
2461
|
+
"DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
|
|
2462
|
+
void 0,
|
|
2463
|
+
"RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
|
|
2464
|
+
);
|
|
2465
|
+
}
|
|
2466
|
+
return { [RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token };
|
|
2467
|
+
}
|
|
2373
2468
|
function normalizeTestPolicyOverrides(value, source) {
|
|
2374
2469
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
2375
2470
|
return value;
|
|
@@ -3068,6 +3163,7 @@ var DeeplineClient = class {
|
|
|
3068
3163
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
3069
3164
|
const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
|
|
3070
3165
|
const forceToolRefresh = request.forceToolRefresh === true;
|
|
3166
|
+
const runtime = resolvePlayRunRuntimeSelection(request);
|
|
3071
3167
|
const response = await this.http.post(
|
|
3072
3168
|
"/api/v2/plays/run",
|
|
3073
3169
|
{
|
|
@@ -3094,9 +3190,10 @@ var DeeplineClient = class {
|
|
|
3094
3190
|
// defaults to absurd; callers normally omit this field.
|
|
3095
3191
|
...request.profile ? { profile: request.profile } : {},
|
|
3096
3192
|
...integrationMode ? { integrationMode } : {},
|
|
3193
|
+
...runtime ? { runtime } : {},
|
|
3097
3194
|
...testPolicyOverrides ? { testPolicyOverrides } : {}
|
|
3098
3195
|
},
|
|
3099
|
-
|
|
3196
|
+
runtimeSelectionHeaders(runtime),
|
|
3100
3197
|
// A start can reach the server even when its response is lost or times
|
|
3101
3198
|
// out. Retrying this mutation without an idempotency key can create a
|
|
3102
3199
|
// second root run, so callers must resolve ambiguous failures explicitly.
|
|
@@ -3119,6 +3216,7 @@ var DeeplineClient = class {
|
|
|
3119
3216
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
3120
3217
|
const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
|
|
3121
3218
|
const forceToolRefresh = request.forceToolRefresh === true;
|
|
3219
|
+
const runtime = resolvePlayRunRuntimeSelection(request);
|
|
3122
3220
|
const body = {
|
|
3123
3221
|
...request.name ? { name: request.name } : {},
|
|
3124
3222
|
...request.revisionId ? { revisionId: request.revisionId } : {},
|
|
@@ -3141,6 +3239,7 @@ var DeeplineClient = class {
|
|
|
3141
3239
|
...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
|
|
3142
3240
|
...request.profile ? { profile: request.profile } : {},
|
|
3143
3241
|
...integrationMode ? { integrationMode } : {},
|
|
3242
|
+
...runtime ? { runtime } : {},
|
|
3144
3243
|
...testPolicyOverrides ? { testPolicyOverrides } : {}
|
|
3145
3244
|
};
|
|
3146
3245
|
for await (const event of this.http.streamSse(
|
|
@@ -3148,6 +3247,7 @@ var DeeplineClient = class {
|
|
|
3148
3247
|
{
|
|
3149
3248
|
method: "POST",
|
|
3150
3249
|
body,
|
|
3250
|
+
headers: runtimeSelectionHeaders(runtime),
|
|
3151
3251
|
signal: options?.signal
|
|
3152
3252
|
}
|
|
3153
3253
|
)) {
|
|
@@ -24386,7 +24486,7 @@ function renderAvailableToolsText(payload) {
|
|
|
24386
24486
|
const returned = asFiniteNumber(payload.returned) ?? tools.length;
|
|
24387
24487
|
const total = asFiniteNumber(payload.total);
|
|
24388
24488
|
const lines = [
|
|
24389
|
-
total !== void 0 ? `
|
|
24489
|
+
total !== void 0 ? `Monitor types you can deploy (${returned} of ${total}):` : "Monitor types you can deploy:"
|
|
24390
24490
|
];
|
|
24391
24491
|
let currentProvider;
|
|
24392
24492
|
for (const raw of tools) {
|
|
@@ -24421,7 +24521,7 @@ function renderAvailableToolsText(payload) {
|
|
|
24421
24521
|
" See monitors already deployed in this workspace:",
|
|
24422
24522
|
" deepline monitors list",
|
|
24423
24523
|
" Validate a monitor definition before deploying:",
|
|
24424
|
-
` deepline monitors check '{"key":"my-
|
|
24524
|
+
` deepline monitors check '{"key":"my-monitor","tool":"<provider.tool>","payload":{...}}'`
|
|
24425
24525
|
);
|
|
24426
24526
|
return `${lines.join("\n")}
|
|
24427
24527
|
`;
|
|
@@ -24725,7 +24825,7 @@ Examples:
|
|
|
24725
24825
|
deepline monitors deploy --file monitor.json
|
|
24726
24826
|
deepline monitors list --status all --json
|
|
24727
24827
|
deepline monitors get my-monitor --json
|
|
24728
|
-
deepline monitors update my-monitor '{"
|
|
24828
|
+
deepline monitors update my-monitor '{"name":"Interested replies"}' --json
|
|
24729
24829
|
deepline monitors delete my-monitor --dry-run
|
|
24730
24830
|
deepline monitors reactivate my-monitor --dry-run
|
|
24731
24831
|
`
|
|
@@ -24815,8 +24915,8 @@ Examples:
|
|
|
24815
24915
|
`
|
|
24816
24916
|
Notes:
|
|
24817
24917
|
Read-only validation. <definition> is a JSON object with key, tool, payload,
|
|
24818
|
-
and optional controls (Deepline lifecycle metadata,
|
|
24819
|
-
|
|
24918
|
+
and optional controls (Deepline lifecycle metadata). Pass it positionally,
|
|
24919
|
+
via --file <path>, or
|
|
24820
24920
|
from stdin with --file -. Does not deploy or spend credits.
|
|
24821
24921
|
|
|
24822
24922
|
Examples:
|
|
@@ -24835,9 +24935,8 @@ Examples:
|
|
|
24835
24935
|
`
|
|
24836
24936
|
Notes:
|
|
24837
24937
|
Mutates workspace state and may spend Deepline credits. <definition> is a JSON
|
|
24838
|
-
object with key, tool, payload, and optional controls
|
|
24839
|
-
|
|
24840
|
-
from stdin with --file -.
|
|
24938
|
+
object with key, tool, payload, and optional controls. Pass it positionally,
|
|
24939
|
+
via --file <path>, or from stdin with --file -.
|
|
24841
24940
|
--dry-run validates the definition and shows the plan (deploy cost in Deepline
|
|
24842
24941
|
credits when the server reports it, plus any existing monitors that may
|
|
24843
24942
|
already cover this scope) WITHOUT deploying. Exits 0 when valid, 7 when not.
|
|
@@ -24860,12 +24959,11 @@ Examples:
|
|
|
24860
24959
|
"after",
|
|
24861
24960
|
`
|
|
24862
24961
|
Notes:
|
|
24863
|
-
Mutates workspace state. <patch> is a JSON object of fields to update
|
|
24864
|
-
|
|
24865
|
-
via --file <path>, or from stdin with --file -.
|
|
24962
|
+
Mutates workspace state. <patch> is a JSON object of fields to update. Pass it
|
|
24963
|
+
positionally, via --file <path>, or from stdin with --file -.
|
|
24866
24964
|
|
|
24867
24965
|
Examples:
|
|
24868
|
-
deepline monitors update my-monitor '{"
|
|
24966
|
+
deepline monitors update my-monitor '{"name":"Interested replies"}' --json
|
|
24869
24967
|
deepline monitors update my-monitor --file patch.json
|
|
24870
24968
|
`
|
|
24871
24969
|
).option(
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { a as PlayCompilerManifest } from './compiler-manifest-DlE7dnRm.mjs';
|
|
2
2
|
|
|
3
|
+
type PlayRuntimeSelection = {
|
|
4
|
+
environment: 'preview';
|
|
5
|
+
/** Caller-named isolation scope inside a remote runtime environment. */
|
|
6
|
+
namespace: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
declare const DEEPLINE_TOOL_CATEGORIES: readonly ["company_search", "people_search", "people_enrich", "email_finder", "email_verify", "phone_finder", "phone_verify", "identity_resolution", "reverse_lookup", "enrichment", "batch", "premium", "free"];
|
|
4
10
|
type DeeplineToolCategory = (typeof DEEPLINE_TOOL_CATEGORIES)[number] | (string & {});
|
|
5
11
|
declare const PLAY_BOOTSTRAP_TEMPLATES: readonly ["people-list", "company-list", "people-email", "people-phone", "company-people", "company-people-email", "company-people-phone"];
|
|
@@ -1194,6 +1200,8 @@ interface StartPlayRunRequest {
|
|
|
1194
1200
|
profile?: string;
|
|
1195
1201
|
/** Optional per-run provider execution mode for eval/smoke runs. */
|
|
1196
1202
|
integrationMode?: 'live' | 'eval_stub' | 'fixture';
|
|
1203
|
+
/** Internal runtime estate selection. The app host remains unchanged. */
|
|
1204
|
+
runtime?: PlayRuntimeSelection;
|
|
1197
1205
|
/** Internal/dev-only runtime policy overrides for black-box durability tests. */
|
|
1198
1206
|
testPolicyOverrides?: Record<string, unknown>;
|
|
1199
1207
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { a as PlayCompilerManifest } from './compiler-manifest-DlE7dnRm.js';
|
|
2
2
|
|
|
3
|
+
type PlayRuntimeSelection = {
|
|
4
|
+
environment: 'preview';
|
|
5
|
+
/** Caller-named isolation scope inside a remote runtime environment. */
|
|
6
|
+
namespace: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
declare const DEEPLINE_TOOL_CATEGORIES: readonly ["company_search", "people_search", "people_enrich", "email_finder", "email_verify", "phone_finder", "phone_verify", "identity_resolution", "reverse_lookup", "enrichment", "batch", "premium", "free"];
|
|
4
10
|
type DeeplineToolCategory = (typeof DEEPLINE_TOOL_CATEGORIES)[number] | (string & {});
|
|
5
11
|
declare const PLAY_BOOTSTRAP_TEMPLATES: readonly ["people-list", "company-list", "people-email", "people-phone", "company-people", "company-people-email", "company-people-phone"];
|
|
@@ -1194,6 +1200,8 @@ interface StartPlayRunRequest {
|
|
|
1194
1200
|
profile?: string;
|
|
1195
1201
|
/** Optional per-run provider execution mode for eval/smoke runs. */
|
|
1196
1202
|
integrationMode?: 'live' | 'eval_stub' | 'fixture';
|
|
1203
|
+
/** Internal runtime estate selection. The app host remains unchanged. */
|
|
1204
|
+
runtime?: PlayRuntimeSelection;
|
|
1197
1205
|
/** Internal/dev-only runtime policy overrides for black-box durability tests. */
|
|
1198
1206
|
testPolicyOverrides?: Record<string, unknown>;
|
|
1199
1207
|
}
|