deepline 0.1.314 → 0.1.316

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.
@@ -157,7 +157,7 @@ export const SDK_RELEASE = {
157
157
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
158
158
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
159
159
  // Operators use the checkout-local deepline-admin binary instead.
160
- version: '0.1.314',
160
+ version: '0.1.316',
161
161
  contracts: {
162
162
  api: {
163
163
  name: 'sdk-http-api',
@@ -814,36 +814,36 @@ export class AppRuntimeRateStateBackend implements RateStateBackend {
814
814
  }
815
815
 
816
816
  /**
817
- * Multiplier applied to a default-pacing rule's `requestsPerWindow` to derive the
818
- * `adaptiveMaxRps` ceiling. Matches the DB seed's `DEFAULT_PACING_MAX_RPS_MULTIPLIER`
819
- * and the old in-memory AIMD range (default RPS ramps up to base * 25).
817
+ * Multiplier applied to an adaptive pacing rule's `requestsPerWindow` to derive
818
+ * its `adaptiveMaxRps` ceiling. The configured rate is a safe seed, while 429
819
+ * feedback drives AIMD toward the provider's actual limit.
820
820
  */
821
- const DEFAULT_PACING_ADAPTIVE_MAX_RPS_MULTIPLIER = 25;
821
+ const ADAPTIVE_MAX_RPS_MULTIPLIER = 25;
822
822
 
823
823
  /**
824
824
  * A rule id shaped `default:<toolId>` is the undeclared-tool default-pacing rule
825
- * minted by `defaultPacingForTool` in governor.ts. Only those ramp above their
826
- * base rate; declared providers pin at their contractual rate.
825
+ * minted by `defaultPacingForTool` in governor.ts.
827
826
  */
828
827
  function isDefaultPacingRuleId(ruleId: string): boolean {
829
828
  return ruleId.startsWith('default:');
830
829
  }
831
830
 
832
831
  /**
833
- * Preserve explicit advisory ceilings and stamp the legacy base * 25 ceiling
834
- * only onto undeclared default-pacing rules. Declared rules without a ceiling
835
- * remain pinned at base.
832
+ * Preserve explicit advisory ceilings. Otherwise stamp the base * 25 ceiling
833
+ * onto legacy default-pacing rules and declared per-second rules. This lets a
834
+ * declared 10 QPS provider discover a higher entitlement, while longer-window
835
+ * declared budgets remain fixed because multiplying RPM into RPS is unsafe.
836
836
  */
837
837
  function withAdaptiveMaxRps(rules: readonly PacingRule[]): PacingRule[] {
838
838
  return rules.map((rule) =>
839
839
  rule.adaptiveMaxRps != null
840
840
  ? rule
841
- : isDefaultPacingRuleId(rule.ruleId)
841
+ : isDefaultPacingRuleId(rule.ruleId) || rule.windowMs === 1_000
842
842
  ? ({
843
843
  ...rule,
844
844
  adaptiveMaxRps:
845
845
  rule.requestsPerWindow *
846
- DEFAULT_PACING_ADAPTIVE_MAX_RPS_MULTIPLIER,
846
+ ADAPTIVE_MAX_RPS_MULTIPLIER,
847
847
  } as PacingRule)
848
848
  : rule,
849
849
  );
@@ -7,6 +7,7 @@ const CLOUDFLARE_WORKFLOW_ENDPOINT_UNAVAILABLE_RE =
7
7
  const VERCEL_RUNTIME_API_DEPLOYMENT_MISSING_RE =
8
8
  /runtime API 404:[\s\S]*(?:DeploymentNotFound|DEPLOYMENT_NOT_FOUND|requested deployment .*exist|deployment could not be found on Vercel)/i;
9
9
  const RUNTIME_LIMIT_EXCEEDED_RE = /\bRUNTIME_LIMIT_EXCEEDED\b/i;
10
+ const RUNTIME_RUNNER_LOST_RE = /\bRUNTIME_RUNNER_LOST\b/i;
10
11
  const RUNTIME_SANDBOX_INSPECTION_UNAVAILABLE_RE =
11
12
  /\bRUNTIME_SANDBOX_INSPECTION_UNAVAILABLE\b/i;
12
13
  const RUNTIME_SANDBOX_LOST_RE = /\bRUNTIME_SANDBOX_LOST\b/i;
@@ -32,6 +33,8 @@ export const RUNTIME_SANDBOX_KILLED_MESSAGE =
32
33
  '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.';
33
34
  export const RUNTIME_LIMIT_EXCEEDED_MESSAGE =
34
35
  '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.';
36
+ export const RUNTIME_RUNNER_LOST_MESSAGE =
37
+ '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.';
35
38
  export const RUNTIME_SANDBOX_INSPECTION_UNAVAILABLE_MESSAGE =
36
39
  'The play stopped after Deepline could not verify the execution sandbox state. Completed row state was preserved. Re-run from the persisted rows; if this keeps happening, contact Deepline support with the run ID.';
37
40
 
@@ -266,6 +269,20 @@ export function normalizePlayRunFailure(error: unknown): PlayRunFailureDetails {
266
269
  cause,
267
270
  };
268
271
  }
272
+ if (RUNTIME_RUNNER_LOST_RE.test(rawCause)) {
273
+ const stack = error instanceof Error ? boundedFailureStack(error) : null;
274
+ const causes = error instanceof Error ? failureCauseTexts(error) : [];
275
+ return {
276
+ code: 'RUNTIME_RUNNER_LOST',
277
+ phase: 'infrastructure',
278
+ message: RUNTIME_RUNNER_LOST_MESSAGE,
279
+ retryable: false,
280
+ cause,
281
+ ...(error instanceof Error ? { name: error.name || 'Error' } : {}),
282
+ ...(stack ? { stack } : {}),
283
+ ...(causes.length > 0 ? { causes } : {}),
284
+ };
285
+ }
269
286
  if (RUNTIME_SANDBOX_INSPECTION_UNAVAILABLE_RE.test(rawCause)) {
270
287
  return {
271
288
  code: 'RUNTIME_SANDBOX_INSPECTION_UNAVAILABLE',
@@ -1038,6 +1038,7 @@ export const daytonaPlayRunnerBackend: PlayRunnerBackend = {
1038
1038
  exitCodePath: stagedPayload.exitCodePath,
1039
1039
  runtimeCompletedPath: stagedPayload.runtimeCompletedPath,
1040
1040
  startedAtMs: Date.now(),
1041
+ heartbeatTimeoutMs: push.leaseSeconds * 1_000,
1041
1042
  ceilingMs:
1042
1043
  (executionTimeoutSeconds + PLAY_RUNNER_TERMINAL_GRACE_SECONDS) *
1043
1044
  1_000,
@@ -23,8 +23,8 @@ export type PlayExecutionSuspension =
23
23
  * Push-execution park (B2-final): the Daytona runner command was started
24
24
  * DETACHED and the worker parks instead of holding anything. The parked
25
25
  * attempt wakes on the runner's pushed terminal (the gateway emits the
26
- * absurd wake event) or on the ceiling timeout, then finalizes from
27
- * persisted state.
26
+ * absurd wake event), the scheduler-owned heartbeat deadline, or the
27
+ * hard execution ceiling, then finalizes from persisted state.
28
28
  */
29
29
  kind: 'detached_runner';
30
30
  boundaryId: string;
@@ -42,6 +42,9 @@ export type PlayExecutionSuspension =
42
42
  /** Exact customer-code completion fence inside the Daytona sandbox. */
43
43
  runtimeCompletedPath?: string;
44
44
  startedAtMs: number;
45
+ /** Scheduler-owned liveness deadline. The sandbox can renew it only by
46
+ * persisting `heartbeat_at` through the receipt gateway. */
47
+ heartbeatTimeoutMs: number;
45
48
  /** Overall run ceiling; the park timeout. */
46
49
  ceilingMs: number;
47
50
  };
package/dist/cli/index.js CHANGED
@@ -1037,7 +1037,7 @@ var SDK_RELEASE = {
1037
1037
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
1038
1038
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
1039
1039
  // Operators use the checkout-local deepline-admin binary instead.
1040
- version: "0.1.314",
1040
+ version: "0.1.316",
1041
1041
  contracts: {
1042
1042
  api: {
1043
1043
  name: "sdk-http-api",
@@ -1022,7 +1022,7 @@ var SDK_RELEASE = {
1022
1022
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
1023
1023
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
1024
1024
  // Operators use the checkout-local deepline-admin binary instead.
1025
- version: "0.1.314",
1025
+ version: "0.1.316",
1026
1026
  contracts: {
1027
1027
  api: {
1028
1028
  name: "sdk-http-api",
package/dist/index.js CHANGED
@@ -760,7 +760,7 @@ var SDK_RELEASE = {
760
760
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
761
761
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
762
762
  // Operators use the checkout-local deepline-admin binary instead.
763
- version: "0.1.314",
763
+ version: "0.1.316",
764
764
  contracts: {
765
765
  api: {
766
766
  name: "sdk-http-api",
package/dist/index.mjs CHANGED
@@ -686,7 +686,7 @@ var SDK_RELEASE = {
686
686
  // 0.1.253 makes play-page browser opening opt-in and retires --no-open.
687
687
  // 0.1.254 removes the internal operations tree from the published SDK CLI.
688
688
  // Operators use the checkout-local deepline-admin binary instead.
689
- version: "0.1.314",
689
+ version: "0.1.316",
690
690
  contracts: {
691
691
  api: {
692
692
  name: "sdk-http-api",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.314",
3
+ "version": "0.1.316",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {