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/index.js CHANGED
@@ -431,7 +431,7 @@ var SDK_RELEASE = {
431
431
  // runtime intentionally no longer compiles at publish or launch time.
432
432
  // 0.1.242 removes the retired Workers/ESM compiler, generated bundles, and
433
433
  // deploy-time artifact migration. Play authoring now has one CJS contract.
434
- version: "0.1.249",
434
+ version: "0.1.251",
435
435
  apiContract: "2026-07-cjs-absurd-only-play-runtime-hard-cutover",
436
436
  supportPolicy: {
437
437
  minimumSupported: "0.1.53",
@@ -589,6 +589,7 @@ var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
589
589
  var COORDINATOR_URL_OVERRIDE_HEADER = "x-deepline-coordinator-url";
590
590
  var WORKER_CALLBACK_URL_OVERRIDE_HEADER = "x-deepline-worker-callback-url";
591
591
  var RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER = "x-deepline-runtime-scheduler-schema";
592
+ var RUNTIME_ENVIRONMENT_TOKEN_HEADER = "x-deepline-runtime-environment-token";
592
593
  var ABSURD_RELEASE_OVERRIDE_HEADER = "x-deepline-absurd-release";
593
594
  var SYNTHETIC_RUN_HEADER = "x-deepline-synthetic-run";
594
595
 
@@ -1253,9 +1254,25 @@ function createSecretRedactionContext(initialValues = []) {
1253
1254
  }
1254
1255
  return value;
1255
1256
  }
1257
+ function redactKnownSecrets(value) {
1258
+ if (typeof value === "string") return redactString(value);
1259
+ if (Array.isArray(value)) {
1260
+ return value.map((entry) => redactKnownSecrets(entry));
1261
+ }
1262
+ if (value && typeof value === "object") {
1263
+ return Object.fromEntries(
1264
+ Object.entries(value).map(([key, entry]) => [
1265
+ key,
1266
+ redactKnownSecrets(entry)
1267
+ ])
1268
+ );
1269
+ }
1270
+ return value;
1271
+ }
1256
1272
  return {
1257
1273
  register,
1258
1274
  redactString,
1275
+ redactKnownSecrets,
1259
1276
  redact
1260
1277
  };
1261
1278
  }
@@ -2162,6 +2179,29 @@ async function* observeRunEvents(options) {
2162
2179
  }
2163
2180
  }
2164
2181
 
2182
+ // ../shared_libs/play-runtime/runtime-environment.ts
2183
+ var PLAY_RUNTIME_ENVIRONMENTS = ["preview"];
2184
+ var PLAY_RUNTIME_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]{0,30}$/;
2185
+ function normalizePlayRuntimeNamespace(value) {
2186
+ if (typeof value !== "string") return null;
2187
+ const normalized = value.trim();
2188
+ return PLAY_RUNTIME_NAMESPACE_PATTERN.test(normalized) ? normalized : null;
2189
+ }
2190
+ function normalizePlayRuntimeSelection(value) {
2191
+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;
2192
+ const record = value;
2193
+ if (Object.keys(record).some(
2194
+ (key) => key !== "environment" && key !== "namespace"
2195
+ ) || record.environment !== "preview") {
2196
+ return null;
2197
+ }
2198
+ const namespace = normalizePlayRuntimeNamespace(record.namespace);
2199
+ return namespace ? { environment: "preview", namespace } : null;
2200
+ }
2201
+ function normalizePlayRuntimeEnvironment(value) {
2202
+ return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
2203
+ }
2204
+
2165
2205
  // src/client.ts
2166
2206
  var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
2167
2207
  var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
@@ -2184,6 +2224,61 @@ function resolvePlayRunIntegrationMode(request) {
2184
2224
  request.integrationMode ?? process.env.DEEPLINE_EVAL_INTEGRATION_MODE
2185
2225
  );
2186
2226
  }
2227
+ function resolvePlayRunRuntimeSelection(request) {
2228
+ if (request.runtime !== void 0) {
2229
+ const runtime = normalizePlayRuntimeSelection(request.runtime);
2230
+ if (!runtime) {
2231
+ throw new DeeplineError(
2232
+ 'runtime must be exactly { environment: "preview", namespace } with namespace matching ^[a-z][a-z0-9-]{0,30}$.',
2233
+ void 0,
2234
+ "INVALID_RUNTIME_SELECTION"
2235
+ );
2236
+ }
2237
+ return runtime;
2238
+ }
2239
+ const configured = process.env.DEEPLINE_RUNTIME_ENVIRONMENT?.trim();
2240
+ const configuredNamespace = process.env.DEEPLINE_RUNTIME_NAMESPACE?.trim();
2241
+ const configuredToken = process.env.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN?.trim();
2242
+ if (!configured) {
2243
+ if (configuredNamespace || configuredToken) {
2244
+ throw new DeeplineError(
2245
+ "DEEPLINE_RUNTIME_ENVIRONMENT=preview and DEEPLINE_RUNTIME_NAMESPACE are required when runtime selection configuration is present.",
2246
+ void 0,
2247
+ "INVALID_RUNTIME_ENVIRONMENT"
2248
+ );
2249
+ }
2250
+ return void 0;
2251
+ }
2252
+ const environment = normalizePlayRuntimeEnvironment(configured);
2253
+ if (!environment) {
2254
+ throw new DeeplineError(
2255
+ `DEEPLINE_RUNTIME_ENVIRONMENT supports only explicit preview selection. Received "${configured}". Omit it to use the app-native runtime.`,
2256
+ void 0,
2257
+ "INVALID_RUNTIME_ENVIRONMENT"
2258
+ );
2259
+ }
2260
+ const namespace = normalizePlayRuntimeNamespace(configuredNamespace);
2261
+ if (!namespace) {
2262
+ throw new DeeplineError(
2263
+ "DEEPLINE_RUNTIME_NAMESPACE is required for preview and must match ^[a-z][a-z0-9-]{0,30}$.",
2264
+ void 0,
2265
+ "INVALID_RUNTIME_NAMESPACE"
2266
+ );
2267
+ }
2268
+ return { environment, namespace };
2269
+ }
2270
+ function runtimeSelectionHeaders(runtime) {
2271
+ if (!runtime) return void 0;
2272
+ const token = process.env.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN?.trim();
2273
+ if (!token) {
2274
+ throw new DeeplineError(
2275
+ "DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
2276
+ void 0,
2277
+ "RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
2278
+ );
2279
+ }
2280
+ return { [RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token };
2281
+ }
2187
2282
  function normalizeTestPolicyOverrides(value, source) {
2188
2283
  if (value && typeof value === "object" && !Array.isArray(value)) {
2189
2284
  return value;
@@ -2882,6 +2977,7 @@ var DeeplineClient = class {
2882
2977
  const integrationMode = resolvePlayRunIntegrationMode(request);
2883
2978
  const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
2884
2979
  const forceToolRefresh = request.forceToolRefresh === true;
2980
+ const runtime = resolvePlayRunRuntimeSelection(request);
2885
2981
  const response = await this.http.post(
2886
2982
  "/api/v2/plays/run",
2887
2983
  {
@@ -2908,9 +3004,10 @@ var DeeplineClient = class {
2908
3004
  // defaults to absurd; callers normally omit this field.
2909
3005
  ...request.profile ? { profile: request.profile } : {},
2910
3006
  ...integrationMode ? { integrationMode } : {},
3007
+ ...runtime ? { runtime } : {},
2911
3008
  ...testPolicyOverrides ? { testPolicyOverrides } : {}
2912
3009
  },
2913
- void 0,
3010
+ runtimeSelectionHeaders(runtime),
2914
3011
  // A start can reach the server even when its response is lost or times
2915
3012
  // out. Retrying this mutation without an idempotency key can create a
2916
3013
  // second root run, so callers must resolve ambiguous failures explicitly.
@@ -2933,6 +3030,7 @@ var DeeplineClient = class {
2933
3030
  const integrationMode = resolvePlayRunIntegrationMode(request);
2934
3031
  const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
2935
3032
  const forceToolRefresh = request.forceToolRefresh === true;
3033
+ const runtime = resolvePlayRunRuntimeSelection(request);
2936
3034
  const body = {
2937
3035
  ...request.name ? { name: request.name } : {},
2938
3036
  ...request.revisionId ? { revisionId: request.revisionId } : {},
@@ -2955,6 +3053,7 @@ var DeeplineClient = class {
2955
3053
  ...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
2956
3054
  ...request.profile ? { profile: request.profile } : {},
2957
3055
  ...integrationMode ? { integrationMode } : {},
3056
+ ...runtime ? { runtime } : {},
2958
3057
  ...testPolicyOverrides ? { testPolicyOverrides } : {}
2959
3058
  };
2960
3059
  for await (const event of this.http.streamSse(
@@ -2962,6 +3061,7 @@ var DeeplineClient = class {
2962
3061
  {
2963
3062
  method: "POST",
2964
3063
  body,
3064
+ headers: runtimeSelectionHeaders(runtime),
2965
3065
  signal: options?.signal
2966
3066
  }
2967
3067
  )) {
package/dist/index.mjs CHANGED
@@ -361,7 +361,7 @@ var SDK_RELEASE = {
361
361
  // runtime intentionally no longer compiles at publish or launch time.
362
362
  // 0.1.242 removes the retired Workers/ESM compiler, generated bundles, and
363
363
  // deploy-time artifact migration. Play authoring now has one CJS contract.
364
- version: "0.1.249",
364
+ version: "0.1.251",
365
365
  apiContract: "2026-07-cjs-absurd-only-play-runtime-hard-cutover",
366
366
  supportPolicy: {
367
367
  minimumSupported: "0.1.53",
@@ -519,6 +519,7 @@ var COORDINATOR_INTERNAL_TOKEN_HEADER = "x-deepline-internal-token";
519
519
  var COORDINATOR_URL_OVERRIDE_HEADER = "x-deepline-coordinator-url";
520
520
  var WORKER_CALLBACK_URL_OVERRIDE_HEADER = "x-deepline-worker-callback-url";
521
521
  var RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER = "x-deepline-runtime-scheduler-schema";
522
+ var RUNTIME_ENVIRONMENT_TOKEN_HEADER = "x-deepline-runtime-environment-token";
522
523
  var ABSURD_RELEASE_OVERRIDE_HEADER = "x-deepline-absurd-release";
523
524
  var SYNTHETIC_RUN_HEADER = "x-deepline-synthetic-run";
524
525
 
@@ -1183,9 +1184,25 @@ function createSecretRedactionContext(initialValues = []) {
1183
1184
  }
1184
1185
  return value;
1185
1186
  }
1187
+ function redactKnownSecrets(value) {
1188
+ if (typeof value === "string") return redactString(value);
1189
+ if (Array.isArray(value)) {
1190
+ return value.map((entry) => redactKnownSecrets(entry));
1191
+ }
1192
+ if (value && typeof value === "object") {
1193
+ return Object.fromEntries(
1194
+ Object.entries(value).map(([key, entry]) => [
1195
+ key,
1196
+ redactKnownSecrets(entry)
1197
+ ])
1198
+ );
1199
+ }
1200
+ return value;
1201
+ }
1186
1202
  return {
1187
1203
  register,
1188
1204
  redactString,
1205
+ redactKnownSecrets,
1189
1206
  redact
1190
1207
  };
1191
1208
  }
@@ -2092,6 +2109,29 @@ async function* observeRunEvents(options) {
2092
2109
  }
2093
2110
  }
2094
2111
 
2112
+ // ../shared_libs/play-runtime/runtime-environment.ts
2113
+ var PLAY_RUNTIME_ENVIRONMENTS = ["preview"];
2114
+ var PLAY_RUNTIME_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]{0,30}$/;
2115
+ function normalizePlayRuntimeNamespace(value) {
2116
+ if (typeof value !== "string") return null;
2117
+ const normalized = value.trim();
2118
+ return PLAY_RUNTIME_NAMESPACE_PATTERN.test(normalized) ? normalized : null;
2119
+ }
2120
+ function normalizePlayRuntimeSelection(value) {
2121
+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;
2122
+ const record = value;
2123
+ if (Object.keys(record).some(
2124
+ (key) => key !== "environment" && key !== "namespace"
2125
+ ) || record.environment !== "preview") {
2126
+ return null;
2127
+ }
2128
+ const namespace = normalizePlayRuntimeNamespace(record.namespace);
2129
+ return namespace ? { environment: "preview", namespace } : null;
2130
+ }
2131
+ function normalizePlayRuntimeEnvironment(value) {
2132
+ return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
2133
+ }
2134
+
2095
2135
  // src/client.ts
2096
2136
  var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
2097
2137
  var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
@@ -2114,6 +2154,61 @@ function resolvePlayRunIntegrationMode(request) {
2114
2154
  request.integrationMode ?? process.env.DEEPLINE_EVAL_INTEGRATION_MODE
2115
2155
  );
2116
2156
  }
2157
+ function resolvePlayRunRuntimeSelection(request) {
2158
+ if (request.runtime !== void 0) {
2159
+ const runtime = normalizePlayRuntimeSelection(request.runtime);
2160
+ if (!runtime) {
2161
+ throw new DeeplineError(
2162
+ 'runtime must be exactly { environment: "preview", namespace } with namespace matching ^[a-z][a-z0-9-]{0,30}$.',
2163
+ void 0,
2164
+ "INVALID_RUNTIME_SELECTION"
2165
+ );
2166
+ }
2167
+ return runtime;
2168
+ }
2169
+ const configured = process.env.DEEPLINE_RUNTIME_ENVIRONMENT?.trim();
2170
+ const configuredNamespace = process.env.DEEPLINE_RUNTIME_NAMESPACE?.trim();
2171
+ const configuredToken = process.env.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN?.trim();
2172
+ if (!configured) {
2173
+ if (configuredNamespace || configuredToken) {
2174
+ throw new DeeplineError(
2175
+ "DEEPLINE_RUNTIME_ENVIRONMENT=preview and DEEPLINE_RUNTIME_NAMESPACE are required when runtime selection configuration is present.",
2176
+ void 0,
2177
+ "INVALID_RUNTIME_ENVIRONMENT"
2178
+ );
2179
+ }
2180
+ return void 0;
2181
+ }
2182
+ const environment = normalizePlayRuntimeEnvironment(configured);
2183
+ if (!environment) {
2184
+ throw new DeeplineError(
2185
+ `DEEPLINE_RUNTIME_ENVIRONMENT supports only explicit preview selection. Received "${configured}". Omit it to use the app-native runtime.`,
2186
+ void 0,
2187
+ "INVALID_RUNTIME_ENVIRONMENT"
2188
+ );
2189
+ }
2190
+ const namespace = normalizePlayRuntimeNamespace(configuredNamespace);
2191
+ if (!namespace) {
2192
+ throw new DeeplineError(
2193
+ "DEEPLINE_RUNTIME_NAMESPACE is required for preview and must match ^[a-z][a-z0-9-]{0,30}$.",
2194
+ void 0,
2195
+ "INVALID_RUNTIME_NAMESPACE"
2196
+ );
2197
+ }
2198
+ return { environment, namespace };
2199
+ }
2200
+ function runtimeSelectionHeaders(runtime) {
2201
+ if (!runtime) return void 0;
2202
+ const token = process.env.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN?.trim();
2203
+ if (!token) {
2204
+ throw new DeeplineError(
2205
+ "DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN is required for explicit preview runtime selection.",
2206
+ void 0,
2207
+ "RUNTIME_ENVIRONMENT_TOKEN_REQUIRED"
2208
+ );
2209
+ }
2210
+ return { [RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token };
2211
+ }
2117
2212
  function normalizeTestPolicyOverrides(value, source) {
2118
2213
  if (value && typeof value === "object" && !Array.isArray(value)) {
2119
2214
  return value;
@@ -2812,6 +2907,7 @@ var DeeplineClient = class {
2812
2907
  const integrationMode = resolvePlayRunIntegrationMode(request);
2813
2908
  const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
2814
2909
  const forceToolRefresh = request.forceToolRefresh === true;
2910
+ const runtime = resolvePlayRunRuntimeSelection(request);
2815
2911
  const response = await this.http.post(
2816
2912
  "/api/v2/plays/run",
2817
2913
  {
@@ -2838,9 +2934,10 @@ var DeeplineClient = class {
2838
2934
  // defaults to absurd; callers normally omit this field.
2839
2935
  ...request.profile ? { profile: request.profile } : {},
2840
2936
  ...integrationMode ? { integrationMode } : {},
2937
+ ...runtime ? { runtime } : {},
2841
2938
  ...testPolicyOverrides ? { testPolicyOverrides } : {}
2842
2939
  },
2843
- void 0,
2940
+ runtimeSelectionHeaders(runtime),
2844
2941
  // A start can reach the server even when its response is lost or times
2845
2942
  // out. Retrying this mutation without an idempotency key can create a
2846
2943
  // second root run, so callers must resolve ambiguous failures explicitly.
@@ -2863,6 +2960,7 @@ var DeeplineClient = class {
2863
2960
  const integrationMode = resolvePlayRunIntegrationMode(request);
2864
2961
  const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
2865
2962
  const forceToolRefresh = request.forceToolRefresh === true;
2963
+ const runtime = resolvePlayRunRuntimeSelection(request);
2866
2964
  const body = {
2867
2965
  ...request.name ? { name: request.name } : {},
2868
2966
  ...request.revisionId ? { revisionId: request.revisionId } : {},
@@ -2885,6 +2983,7 @@ var DeeplineClient = class {
2885
2983
  ...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
2886
2984
  ...request.profile ? { profile: request.profile } : {},
2887
2985
  ...integrationMode ? { integrationMode } : {},
2986
+ ...runtime ? { runtime } : {},
2888
2987
  ...testPolicyOverrides ? { testPolicyOverrides } : {}
2889
2988
  };
2890
2989
  for await (const event of this.http.streamSse(
@@ -2892,6 +2991,7 @@ var DeeplineClient = class {
2892
2991
  {
2893
2992
  method: "POST",
2894
2993
  body,
2994
+ headers: runtimeSelectionHeaders(runtime),
2895
2995
  signal: options?.signal
2896
2996
  }
2897
2997
  )) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.249",
3
+ "version": "0.1.251",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {