deepline 0.3.3 → 0.3.5

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.
@@ -40,7 +40,7 @@ export type {
40
40
 
41
41
  export { extractDefinedPlayName } from '../../../shared_libs/plays/bundling/index.js';
42
42
 
43
- const PLAY_BUNDLE_CACHE_VERSION = 33;
43
+ const PLAY_BUNDLE_CACHE_VERSION = 35;
44
44
  const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
45
45
  const SDK_PACKAGE_ROOT = resolve(MODULE_DIR, '..', '..');
46
46
  const SOURCE_REPO_ROOT = resolve(SDK_PACKAGE_ROOT, '..');
@@ -192,7 +192,7 @@ export const SDK_RELEASE = {
192
192
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
193
193
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
194
194
  // getters keep their established compatibility behavior.
195
- version: '0.3.3',
195
+ version: '0.3.5',
196
196
  updateSummary:
197
197
  'New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.',
198
198
  contracts: {
@@ -9,6 +9,7 @@ const CLOUDFLARE_WORKFLOW_ENDPOINT_UNAVAILABLE_RE =
9
9
  const VERCEL_RUNTIME_API_DEPLOYMENT_MISSING_RE =
10
10
  /runtime API 404:[\s\S]*(?:DeploymentNotFound|DEPLOYMENT_NOT_FOUND|requested deployment .*exist|deployment could not be found on Vercel)/i;
11
11
  const RUNTIME_LIMIT_EXCEEDED_RE = /\bRUNTIME_LIMIT_EXCEEDED\b/i;
12
+ const SANDBOX_CAPACITY_EXCEEDED_RE = /\bSANDBOX_CAPACITY_EXCEEDED\b/i;
12
13
  const RUNTIME_RUNNER_LOST_RE = /\bRUNTIME_RUNNER_LOST\b/i;
13
14
  const RUNTIME_SANDBOX_INSPECTION_UNAVAILABLE_RE =
14
15
  /\bRUNTIME_SANDBOX_INSPECTION_UNAVAILABLE\b/i;
@@ -36,6 +37,8 @@ export const RUNTIME_SANDBOX_KILLED_MESSAGE =
36
37
  'The execution sandbox was killed before it could return a result, and the kill reason is unavailable. Completed work is durably recorded. Retry the same command safely; Deepline reuses completed steps and does not repeat their provider calls.';
37
38
  export const RUNTIME_LIMIT_EXCEEDED_MESSAGE =
38
39
  'The play reached its 30 minute runtime limit and was stopped. Completed row state was preserved; run a smaller batch or continue from the persisted rows.';
40
+ export const SANDBOX_CAPACITY_EXCEEDED_MESSAGE =
41
+ 'Your organization has reached its concurrency limit, so this play did not start. Try again after another play finishes, or contact Deepline to request a higher limit.';
39
42
  export const RUNTIME_RUNNER_LOST_MESSAGE =
40
43
  'The execution runner stopped reporting liveness before returning a terminal result. Completed work is preserved, but Deepline did not automatically replay the run because provider side effects may already exist. Re-run only when it is safe to do so.';
41
44
  export const RUNTIME_SANDBOX_INSPECTION_UNAVAILABLE_MESSAGE =
@@ -324,6 +327,15 @@ export function normalizePlayRunFailure(error: unknown): PlayRunFailureDetails {
324
327
  ? runtimeLimitExceededFailure(configuredSeconds, cause)
325
328
  : runtimeLimitExceededFailure(30 * 60, cause);
326
329
  }
330
+ if (SANDBOX_CAPACITY_EXCEEDED_RE.test(rawCause)) {
331
+ return {
332
+ code: 'SANDBOX_CAPACITY_EXCEEDED',
333
+ phase: 'admission',
334
+ message: SANDBOX_CAPACITY_EXCEEDED_MESSAGE,
335
+ retryable: true,
336
+ cause,
337
+ };
338
+ }
327
339
  if (RUNTIME_RUNNER_LOST_RE.test(rawCause)) {
328
340
  const stack = error instanceof Error ? boundedFailureStack(error) : null;
329
341
  const causes = error instanceof Error ? failureCauseTexts(error) : [];
@@ -120,6 +120,11 @@ export type PlaySchedulerSubmitInput = {
120
120
  triggerSource?: 'api' | 'webhook' | 'cron' | 'sql_listener';
121
121
  /** Null lets a durable trigger wait for capacity; a number bounds queue delay. */
122
122
  queueMaxDelaySeconds?: number | null;
123
+ /**
124
+ * Durable relative queue ordering. Higher values win within an organization
125
+ * after cross-org fairness has selected that organization.
126
+ */
127
+ queuePriority?: number | null;
123
128
  executionProfile?: string | null;
124
129
  /** runner backend to use for executing attempts */
125
130
  runtimeBackend: string;
@@ -60,7 +60,7 @@ import { PLAY_AUTHORING_CONTRACT_EDITION } from '../authoring-contract';
60
60
  // of the artifact bytes. Do not reuse a local bundle cached before either
61
61
  // compatibility selection or docflow instrumentation entered graph analysis.
62
62
  // Keep this aligned with the app and SDK adapters' cache namespace.
63
- const PLAY_BUNDLE_CACHE_VERSION = 33;
63
+ const PLAY_BUNDLE_CACHE_VERSION = 35;
64
64
  const PLAY_ARTIFACT_CACHE_DIR = join(
65
65
  tmpdir(),
66
66
  `deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION}`,
@@ -1508,7 +1508,7 @@ function docflowObservedExpression(input: {
1508
1508
  const callback = input.awaitsResult
1509
1509
  ? `async()=>(${input.expression})`
1510
1510
  : `()=>(${input.expression})`;
1511
- const observation = `${input.contextName}.__deeplineObserveDocflowNode(${JSON.stringify(input.nodeId)},${docflowInputCaptureSource(input.inputs)},${JSON.stringify(input.outputs)},${callback})`;
1511
+ const observation = `((runtimeContext,inputCaptures,execute)=>typeof runtimeContext.__deeplineObserveDocflowNode==="function"?runtimeContext.__deeplineObserveDocflowNode(${JSON.stringify(input.nodeId)},inputCaptures,${JSON.stringify(input.outputs)},execute):execute())(${input.contextName},${docflowInputCaptureSource(input.inputs)},${callback})`;
1512
1512
  return input.awaitsResult ? `await ${observation}` : observation;
1513
1513
  }
1514
1514
 
@@ -1624,7 +1624,7 @@ export function instrumentPlayDocflowRuntimeHits(sourceCode: string): string {
1624
1624
  replacements.push({
1625
1625
  start: lineStart + indentationLength,
1626
1626
  end: lineStart + indentationLength,
1627
- value: `await ${contextName}.__deeplineDocflowHit(${JSON.stringify(binding.nodeId)}); `,
1627
+ value: `await (typeof ${contextName}.__deeplineDocflowHit==="function"?${contextName}.__deeplineDocflowHit(${JSON.stringify(binding.nodeId)}):void 0); `,
1628
1628
  });
1629
1629
  }
1630
1630
  }
package/dist/cli/index.js CHANGED
@@ -1047,7 +1047,7 @@ var SDK_RELEASE = {
1047
1047
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
1048
1048
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1049
1049
  // getters keep their established compatibility behavior.
1050
- version: "0.3.3",
1050
+ version: "0.3.5",
1051
1051
  updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
1052
1052
  contracts: {
1053
1053
  api: {
@@ -16912,7 +16912,7 @@ function collectInlineSecretFindings(sourceCode) {
16912
16912
  var MAX_PLAY_BUNDLE_BYTES = 30 * 1024 * 1024;
16913
16913
 
16914
16914
  // ../shared_libs/plays/bundling/index.ts
16915
- var PLAY_BUNDLE_CACHE_VERSION = 33;
16915
+ var PLAY_BUNDLE_CACHE_VERSION = 35;
16916
16916
  var PLAY_ARTIFACT_CACHE_DIR = (0, import_node_path11.join)(
16917
16917
  (0, import_node_os8.tmpdir)(),
16918
16918
  `deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION}`
@@ -1033,7 +1033,7 @@ var SDK_RELEASE = {
1033
1033
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
1034
1034
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1035
1035
  // getters keep their established compatibility behavior.
1036
- version: "0.3.3",
1036
+ version: "0.3.5",
1037
1037
  updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
1038
1038
  contracts: {
1039
1039
  api: {
@@ -16965,7 +16965,7 @@ function collectInlineSecretFindings(sourceCode) {
16965
16965
  var MAX_PLAY_BUNDLE_BYTES = 30 * 1024 * 1024;
16966
16966
 
16967
16967
  // ../shared_libs/plays/bundling/index.ts
16968
- var PLAY_BUNDLE_CACHE_VERSION = 33;
16968
+ var PLAY_BUNDLE_CACHE_VERSION = 35;
16969
16969
  var PLAY_ARTIFACT_CACHE_DIR = join7(
16970
16970
  tmpdir2(),
16971
16971
  `deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION}`
package/dist/index.js CHANGED
@@ -783,7 +783,7 @@ var SDK_RELEASE = {
783
783
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
784
784
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
785
785
  // getters keep their established compatibility behavior.
786
- version: "0.3.3",
786
+ version: "0.3.5",
787
787
  updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
788
788
  contracts: {
789
789
  api: {
package/dist/index.mjs CHANGED
@@ -706,7 +706,7 @@ var SDK_RELEASE = {
706
706
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
707
707
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
708
708
  // getters keep their established compatibility behavior.
709
- version: "0.3.3",
709
+ version: "0.3.5",
710
710
  updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
711
711
  contracts: {
712
712
  api: {
@@ -5245,7 +5245,7 @@ function validatePlaySourceFilesHaveNoInlineSecrets(sourceFiles) {
5245
5245
  var MAX_PLAY_BUNDLE_BYTES = 30 * 1024 * 1024;
5246
5246
 
5247
5247
  // ../shared_libs/plays/bundling/index.ts
5248
- var PLAY_BUNDLE_CACHE_VERSION = 33;
5248
+ var PLAY_BUNDLE_CACHE_VERSION = 35;
5249
5249
  var PLAY_ARTIFACT_CACHE_DIR = join(
5250
5250
  tmpdir(),
5251
5251
  `deepline-play-artifacts-v${PLAY_BUNDLE_CACHE_VERSION}`
@@ -6054,7 +6054,7 @@ function docflowObservationTarget(statement) {
6054
6054
  }
6055
6055
  function docflowObservedExpression(input) {
6056
6056
  const callback = input.awaitsResult ? `async()=>(${input.expression})` : `()=>(${input.expression})`;
6057
- const observation = `${input.contextName}.__deeplineObserveDocflowNode(${JSON.stringify(input.nodeId)},${docflowInputCaptureSource(input.inputs)},${JSON.stringify(input.outputs)},${callback})`;
6057
+ const observation = `((runtimeContext,inputCaptures,execute)=>typeof runtimeContext.__deeplineObserveDocflowNode==="function"?runtimeContext.__deeplineObserveDocflowNode(${JSON.stringify(input.nodeId)},inputCaptures,${JSON.stringify(input.outputs)},execute):execute())(${input.contextName},${docflowInputCaptureSource(input.inputs)},${callback})`;
6058
6058
  return input.awaitsResult ? `await ${observation}` : observation;
6059
6059
  }
6060
6060
  function expressionContainsTopLevelAwait(expression) {
@@ -6106,7 +6106,7 @@ function instrumentPlayDocflowRuntimeHits(sourceCode) {
6106
6106
  replacements.push({
6107
6107
  start: lineStart + indentationLength,
6108
6108
  end: lineStart + indentationLength,
6109
- value: `await ${contextName}.__deeplineDocflowHit(${JSON.stringify(binding.nodeId)}); `
6109
+ value: `await (typeof ${contextName}.__deeplineDocflowHit==="function"?${contextName}.__deeplineDocflowHit(${JSON.stringify(binding.nodeId)}):void 0); `
6110
6110
  });
6111
6111
  }
6112
6112
  }
@@ -7143,7 +7143,7 @@ async function discoverPackagedLocalFiles(entryFile) {
7143
7143
  }
7144
7144
 
7145
7145
  // src/plays/bundle-play-file.ts
7146
- var PLAY_BUNDLE_CACHE_VERSION2 = 33;
7146
+ var PLAY_BUNDLE_CACHE_VERSION2 = 35;
7147
7147
  var MODULE_DIR = dirname3(fileURLToPath(import.meta.url));
7148
7148
  var SDK_PACKAGE_ROOT = resolve3(MODULE_DIR, "..", "..");
7149
7149
  var SOURCE_REPO_ROOT = resolve3(SDK_PACKAGE_ROOT, "..");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",