deepline 0.3.300 → 0.3.302

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.
Files changed (95) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/play-runtime/live-state-contract.ts +2 -0
  4. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +2 -4
  5. package/dist/bundling-sources/shared_libs/play-runtime/run-log-buffer.ts +60 -0
  6. package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +13 -0
  7. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +16 -5
  8. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-start-admission.ts +7 -1
  9. package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +6 -4
  10. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +2 -2
  11. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +229 -98
  12. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +2 -4
  13. package/dist/cli/{auth-RVK23SLA.mjs → auth-WHKDFARX.mjs} +4 -4
  14. package/dist/cli/auth-ZJDK7HFJ.js +31 -0
  15. package/dist/cli/{billing-CBWRPMBG.mjs → billing-7C66HEMK.mjs} +4 -4
  16. package/dist/cli/{billing-6LEQNTUS.js → billing-IMFI76GS.js} +70 -70
  17. package/dist/cli/{chunk-YLYVPHEG.mjs → chunk-2TCHWWRP.mjs} +1 -1
  18. package/dist/cli/{chunk-M5SHROFS.js → chunk-5FKCLTLS.js} +14 -7
  19. package/dist/cli/{chunk-OCKGMK6B.js → chunk-7AXKBZWF.js} +2 -2
  20. package/dist/cli/{chunk-NXOML2N6.mjs → chunk-A4UUUINX.mjs} +1 -1
  21. package/dist/cli/{chunk-6CLYAWXK.js → chunk-AAZBNN6N.js} +4 -4
  22. package/dist/cli/{chunk-6AUI2MS4.mjs → chunk-AIIVF62D.mjs} +1 -1
  23. package/dist/cli/{chunk-BLANZQG2.mjs → chunk-DTGPHQFC.mjs} +2 -2
  24. package/dist/cli/{chunk-BFGSCAZ7.mjs → chunk-GHYU5YWJ.mjs} +1 -1
  25. package/dist/cli/{chunk-MFGPKFJC.mjs → chunk-GWIY7C7U.mjs} +1 -1
  26. package/dist/cli/{chunk-YR26QBMJ.js → chunk-GXYR7DV4.js} +1 -1
  27. package/dist/cli/{chunk-NMTG3N2J.js → chunk-J2PPXZE4.js} +6 -6
  28. package/dist/cli/{chunk-XUA3QCZU.js → chunk-JX3CNS4W.js} +26 -26
  29. package/dist/cli/{chunk-N5A3LWPC.js → chunk-KEPIGAJS.js} +57 -57
  30. package/dist/cli/{chunk-OKKAFDXS.js → chunk-KI5DPDF2.js} +15 -15
  31. package/dist/cli/{chunk-DRLNWL4W.js → chunk-NRIVXKMQ.js} +6 -6
  32. package/dist/cli/{chunk-BW3WGFLG.js → chunk-OTAGK5MS.js} +48 -48
  33. package/dist/cli/{chunk-2C5H32YE.js → chunk-OUREAAOT.js} +6 -6
  34. package/dist/cli/{chunk-LH7IBCW2.mjs → chunk-PZOHVTQ3.mjs} +3 -3
  35. package/dist/cli/{chunk-Z3RMVRCQ.mjs → chunk-S6XS2ABF.mjs} +9 -2
  36. package/dist/cli/{chunk-E6S4RTMG.mjs → chunk-TVBPWUII.mjs} +4 -4
  37. package/dist/cli/{chunk-GQISQAAZ.mjs → chunk-V4WVYW3G.mjs} +2 -2
  38. package/dist/cli/{chunk-RLDEQJQQ.mjs → chunk-YLVIJZ2W.mjs} +2 -2
  39. package/dist/cli/client-FVPE6PB4.js +20 -0
  40. package/dist/cli/{client-6D6UBKDX.mjs → client-M7OBRULN.mjs} +3 -3
  41. package/dist/cli/{csv-VK327Z63.mjs → csv-AKVUO3PP.mjs} +3 -3
  42. package/dist/cli/{csv-O4HDE34Y.js → csv-SAJB2PYV.js} +12 -12
  43. package/dist/cli/{db-IL35EIOE.js → db-AASVDGJB.js} +20 -20
  44. package/dist/cli/{db-TRNRYJL6.mjs → db-KREGQID3.mjs} +4 -4
  45. package/dist/cli/{executions-CFWDNHOQ.js → executions-XSKRZWVG.js} +6 -6
  46. package/dist/cli/{executions-JEUBKNUA.mjs → executions-YL5UM6BY.mjs} +4 -4
  47. package/dist/cli/{feedback-BSSEEXR2.mjs → feedback-ITNK5A5V.mjs} +3 -3
  48. package/dist/cli/{feedback-F7HXHQY3.js → feedback-XZNAGHZ4.js} +6 -6
  49. package/dist/cli/git-IOUJDZDJ.js +23 -0
  50. package/dist/cli/{git-I3AAHTCJ.mjs → git-IXYZ5H7T.mjs} +4 -4
  51. package/dist/cli/index.js +73 -73
  52. package/dist/cli/index.mjs +30 -30
  53. package/dist/cli/{legacy-noops-HNN7WPWF.js → legacy-noops-BJZ3P455.js} +7 -7
  54. package/dist/cli/{legacy-noops-KTRWO7NA.mjs → legacy-noops-MT5VFDXS.mjs} +4 -4
  55. package/dist/cli/{monitors-D64KB7G2.mjs → monitors-QL4XDOQT.mjs} +4 -4
  56. package/dist/cli/{monitors-4Y4M3ZJ3.js → monitors-XU62FCBX.js} +85 -85
  57. package/dist/cli/{org-ELLMCZRC.js → org-6WSIPHVV.js} +60 -60
  58. package/dist/cli/{org-UGIVFU7B.mjs → org-NKFPS763.mjs} +4 -4
  59. package/dist/cli/{play-LUNGZ5ZJ.mjs → play-CKL7RDIS.mjs} +6 -6
  60. package/dist/cli/{play-NXV5UJYW.js → play-RZO7CZKL.js} +200 -200
  61. package/dist/cli/{providers-AL6YIZVA.js → providers-PQPH374E.js} +7 -7
  62. package/dist/cli/{providers-YCNHAEFJ.mjs → providers-UKNXDCPJ.mjs} +4 -4
  63. package/dist/cli/{quickstart-LK5IBLYY.js → quickstart-3FFTESEL.js} +5 -5
  64. package/dist/cli/{quickstart-R6AOCVA2.mjs → quickstart-JUTTMWIC.mjs} +3 -3
  65. package/dist/cli/{search-PGW2ZEZ3.js → search-TKLHBKKK.js} +6 -6
  66. package/dist/cli/{search-77YOO5TG.mjs → search-WGBQ5LE5.mjs} +5 -5
  67. package/dist/cli/{secrets-OWNCPA6L.mjs → secrets-EV6IOJLN.mjs} +4 -4
  68. package/dist/cli/{secrets-5OV4C2UI.js → secrets-GGQRCGLA.js} +13 -13
  69. package/dist/cli/{sessions-RVJHCSYH.mjs → sessions-HL3Q22O5.mjs} +4 -4
  70. package/dist/cli/{sessions-NOLZ4NAQ.js → sessions-VZJ23U7E.js} +5 -5
  71. package/dist/cli/{settings-326S34JQ.js → settings-LJB5VZWM.js} +74 -74
  72. package/dist/cli/{settings-LEYUQDYL.mjs → settings-M5MSM7U6.mjs} +7 -7
  73. package/dist/cli/{setup-7RTEC2RE.js → setup-ASOUDNYM.js} +41 -41
  74. package/dist/cli/{setup-CNE25BAJ.mjs → setup-ZURYYFBI.mjs} +6 -6
  75. package/dist/cli/{skills-R4EC4IXL.mjs → skills-4SRVGVA6.mjs} +4 -4
  76. package/dist/cli/skills-KMGB73LN.js +28 -0
  77. package/dist/cli/{tools-BEBLJVVA.mjs → tools-UEFB5OPX.mjs} +5 -5
  78. package/dist/cli/{tools-ZVTN62JI.js → tools-UNDZCH7R.js} +50 -50
  79. package/dist/cli/update-4AZ7S666.js +28 -0
  80. package/dist/cli/{update-5JG7TQZ4.mjs → update-WUIQXM5B.mjs} +6 -6
  81. package/dist/cli/{workflow-FQVZBGT3.mjs → workflow-BCXLF24Z.mjs} +5 -5
  82. package/dist/cli/{workflow-VTDHF75U.js → workflow-FUXRNNWD.js} +15 -15
  83. package/dist/index.js +6 -6
  84. package/dist/index.mjs +3 -3
  85. package/dist/install-integrity.json +68 -68
  86. package/dist/release.d.mts +1 -1
  87. package/dist/release.d.ts +1 -1
  88. package/dist/release.js +2 -2
  89. package/dist/release.mjs +1 -1
  90. package/package.json +1 -1
  91. package/dist/cli/auth-6JUPJXSW.js +0 -31
  92. package/dist/cli/client-HAGQESNI.js +0 -20
  93. package/dist/cli/git-T5WWT3DW.js +0 -23
  94. package/dist/cli/skills-SE54MI6I.js +0 -28
  95. package/dist/cli/update-IQYOCMLG.js +0 -28
@@ -200,7 +200,7 @@ export const SDK_RELEASE = {
200
200
  // getters keep their established compatibility behavior.
201
201
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
202
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
203
- version: '0.3.300',
203
+ version: '0.3.302',
204
204
  updateSummary:
205
205
  'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
206
206
  packageCapabilities: {
@@ -95,7 +95,7 @@ async function backfillRotatedLogTail(input: {
95
95
  }): Promise<PlayRunLiveSnapshot> {
96
96
  // A late first attach intentionally shows the retained tail and its gap
97
97
  // marker. Backfill only lines that rotated out after this watcher attached.
98
- if (!input.previous.runSignature) {
98
+ if (!input.previous.runSignature || input.snapshot.logsUnavailable) {
99
99
  return input.snapshot;
100
100
  }
101
101
  const gap = resolvePlayRunLogGap(input.snapshot, input.previous.lastLogSeq);
@@ -84,6 +84,8 @@ export type PlayRunLiveSnapshot = {
84
84
  status: PlayRunLiveStatus;
85
85
  updatedAt: number | null;
86
86
  logs: string[];
87
+ /** Present when an optional canonical log read failed for this snapshot. */
88
+ logsUnavailable?: true;
87
89
  activeArtifactTableNamespace: string | null;
88
90
  resultTableNamespace: string | null;
89
91
  nodeStates: PlayVisualNodeStateSnapshot[];
@@ -5,7 +5,7 @@ import {
5
5
  dispatchRunLedgerOutboxToLedgerThroughEventWithClientScope,
6
6
  type PostgresSchedulerOptions,
7
7
  type PostgresSchedulerOutboxDrainResult,
8
- type PostgresSchedulerQueryClient,
8
+ type RunLedgerOutboxWithClient,
9
9
  } from '../../scheduler-backends/postgres';
10
10
 
11
11
  import type { RunLedgerProjectionPorts } from '../../play-runs/projection/ports';
@@ -17,9 +17,7 @@ export type GatewayRunLedgerProjectionAdapterInput = {
17
17
  * against the active outbox lease while retaining supported transport hooks.
18
18
  */
19
19
  runtimeApi: WorkerRuntimeApiContext;
20
- withClient: <T>(
21
- operation: (client: PostgresSchedulerQueryClient) => Promise<T>,
22
- ) => Promise<T>;
20
+ withClient: RunLedgerOutboxWithClient;
23
21
  schedulerOptions?: Pick<PostgresSchedulerOptions, 'schema'>;
24
22
  };
25
23
 
@@ -117,3 +117,63 @@ export function normalizeRunLogIds(
117
117
  );
118
118
  return value;
119
119
  }
120
+
121
+ /** One owner for every per-line annotation crossing a runtime boundary. */
122
+ export const RUN_LOG_ANNOTATION_FIELDS = [
123
+ 'lineContexts',
124
+ 'lineMetadata',
125
+ 'lineIds',
126
+ ] as const;
127
+
128
+ export function hasRunLogAnnotations(value: object): boolean {
129
+ return RUN_LOG_ANNOTATION_FIELDS.some((field) =>
130
+ Object.prototype.hasOwnProperty.call(value, field),
131
+ );
132
+ }
133
+
134
+ /** Old producers may omit annotations; present arrays must stay aligned. */
135
+ export function normalizeRunLogAnnotations(
136
+ value: {
137
+ lineContexts?: unknown;
138
+ lineMetadata?: unknown;
139
+ lineIds?: unknown;
140
+ },
141
+ lines: readonly unknown[],
142
+ ): {
143
+ lineContexts?: Array<PlayLogContext | null>;
144
+ lineMetadata?: Array<PlayLogMetadata | null>;
145
+ lineIds?: Array<string | null>;
146
+ } {
147
+ for (const field of ['lineContexts', 'lineMetadata'] as const) {
148
+ const entries = value[field];
149
+ if (
150
+ entries !== undefined &&
151
+ (!Array.isArray(entries) || entries.length !== lines.length)
152
+ ) {
153
+ throw new TypeError(`Run log ${field} must align with their lines.`);
154
+ }
155
+ }
156
+ const lineContexts = Array.isArray(value.lineContexts)
157
+ ? value.lineContexts.map(normalizePlayLogContext)
158
+ : undefined;
159
+ const lineMetadata = Array.isArray(value.lineMetadata)
160
+ ? value.lineMetadata.map(normalizePlayLogMetadata)
161
+ : undefined;
162
+ const lineIds = normalizeRunLogIds(value.lineIds, lines);
163
+ return {
164
+ ...(lineContexts ? { lineContexts } : {}),
165
+ ...(lineMetadata ? { lineMetadata } : {}),
166
+ ...(lineIds ? { lineIds } : {}),
167
+ };
168
+ }
169
+
170
+ /** Search owns these annotations; compatibility projections omit them together. */
171
+ export function stripRunLogAnnotations<T extends object>(
172
+ value: T,
173
+ ): Omit<T, (typeof RUN_LOG_ANNOTATION_FIELDS)[number]> {
174
+ const copy = { ...value };
175
+ for (const field of RUN_LOG_ANNOTATION_FIELDS) {
176
+ delete (copy as Record<string, unknown>)[field];
177
+ }
178
+ return copy;
179
+ }
@@ -99,6 +99,12 @@ export type PlayRunLiveSnapshot = {
99
99
  * crossed the retention cap (ADR-0009). Additive/optional on the wire.
100
100
  */
101
101
  logsTruncated?: boolean;
102
+ /**
103
+ * The canonical log store could not be read for this snapshot. The run
104
+ * status remains authoritative; callers should retry logs on the next poll
105
+ * or use the paginated logs endpoint. The log cursor does not advance.
106
+ */
107
+ logsUnavailable?: true;
102
108
  activeArtifactTableNamespace: string | null;
103
109
  resultTableNamespace: string | null;
104
110
  datasets?: PlayRunLedgerDatasetSnapshot[];
@@ -573,6 +579,13 @@ function diffLogLines(input: {
573
579
  lastLogSeq: number;
574
580
  }): { lines: string[]; lastLogSeq: number; firstSeq: number | null } {
575
581
  const { logs, totalLogCount } = input.snapshot;
582
+ if (input.snapshot.logsUnavailable) {
583
+ return {
584
+ lines: [],
585
+ lastLogSeq: input.lastLogSeq,
586
+ firstSeq: null,
587
+ };
588
+ }
576
589
  if (totalLogCount <= input.lastLogSeq) {
577
590
  return { lines: [], lastLogSeq: input.lastLogSeq, firstSeq: null };
578
591
  }
@@ -694,12 +694,22 @@ async function acquireOneShotDaytonaSandbox(input: {
694
694
  },
695
695
  );
696
696
  input.emitStage('create:start');
697
+ const admissionRequestedAt = Date.now();
698
+ let admissionWaitMs = 0;
699
+ let admissionQueued = false;
700
+ const create = () => {
701
+ admissionWaitMs = Date.now() - admissionRequestedAt;
702
+ if (admissionQueued) {
703
+ input.emitStage('create:admission_ready', { admissionWaitMs });
704
+ }
705
+ return createRetriedOneShotDaytonaSandbox(input);
706
+ };
697
707
  const result = input.startAdmission
698
- ? await input.startAdmission.run(
699
- () => createRetriedOneShotDaytonaSandbox(input),
700
- input.cancellationSignal,
701
- )
702
- : await createRetriedOneShotDaytonaSandbox(input);
708
+ ? await input.startAdmission.run(create, input.cancellationSignal, () => {
709
+ admissionQueued = true;
710
+ input.emitStage('create:admission_wait');
711
+ })
712
+ : await create();
703
713
  // The runner's egress probe measures the sandbox-to-estate round trip; the
704
714
  // sandbox's target names the region that round trip crosses.
705
715
  console.info('[play-runner.daytona.sandbox_acquired]', {
@@ -779,6 +789,7 @@ async function acquireOneShotDaytonaSandbox(input: {
779
789
  sandboxId: sandbox.id,
780
790
  attempt: result.attempt,
781
791
  elapsedMs: billingStartedAt - input.startedAt,
792
+ admissionWaitMs,
782
793
  attemptElapsedMs: result.attemptElapsedMs,
783
794
  // Daytona's default snapshot is intentionally provider-managed. Record the
784
795
  // resolved immutable snapshot identifier so a slow acquisition can be
@@ -1,7 +1,11 @@
1
1
  import { RUNTIME_CAPACITY_POLICY } from '../../runtime-capacity-policy';
2
2
 
3
3
  export type DaytonaSandboxStartAdmission = {
4
- run<T>(operation: () => Promise<T>, signal?: AbortSignal): Promise<T>;
4
+ run<T>(
5
+ operation: () => Promise<T>,
6
+ signal?: AbortSignal,
7
+ onQueued?: () => void,
8
+ ): Promise<T>;
5
9
  };
6
10
 
7
11
  /**
@@ -45,6 +49,7 @@ export function createDaytonaSandboxStartAdmission(
45
49
  async run<T>(
46
50
  operation: () => Promise<T>,
47
51
  signal?: AbortSignal,
52
+ onQueued?: () => void,
48
53
  ): Promise<T> {
49
54
  signal?.throwIfAborted();
50
55
  // Preserve eager prepare semantics when capacity is free: the provider
@@ -57,6 +62,7 @@ export function createDaytonaSandboxStartAdmission(
57
62
  return createRelease();
58
63
  })()
59
64
  : await new Promise<() => void>((resolve, reject) => {
65
+ onQueued?.();
60
66
  const accept = (release: () => void) => {
61
67
  signal?.removeEventListener('abort', abort);
62
68
  resolve(release);
@@ -66,11 +66,13 @@ export const RUNTIME_CAPACITY_POLICY = {
66
66
  sandboxAcquisition: {
67
67
  /**
68
68
  * Starting a Daytona sandbox is a provider control-plane transition, not
69
- * an Absurd execution slot. Serialize starts within each worker process;
70
- * once started, all eight execution slots may run concurrently.
69
+ * an Absurd execution slot. Allow up to five concurrent starts within one
70
+ * worker process; the fleet-wide limiter paces lifecycle admissions, and
71
+ * this semaphore bounds concurrent create/retry ladders. A worker has
72
+ * eight execution slots.
71
73
  */
72
- daytonaConcurrentStartsPerProcess: 1,
73
- /** Fleet-wide AIMD start pacing, separate from execution-slot scaling. */
74
+ daytonaConcurrentStartsPerProcess: 5,
75
+ /** Fleet-wide AIMD lifecycle-admission pacing. */
74
76
  daytonaInitialStartsPerMinute: 120,
75
77
  daytonaMaximumStartsPerMinute: 600,
76
78
  },
@@ -870,8 +870,8 @@ function buildDefaultDeps(absurd: Absurd): AbsurdRuntimeWorkerDeps {
870
870
  ...absurdRuntimeApiFromLaunch(launch),
871
871
  ...(signal ? { signal } : {}),
872
872
  },
873
- withClient: (operation) =>
874
- withRuntimeSchedulerClient(getPool(), operation),
873
+ withClient: (operation, trace) =>
874
+ withRuntimeSchedulerClient(getPool(), operation, trace),
875
875
  schedulerOptions: options,
876
876
  }),
877
877
  }).deliver(targetEventId ? { targetEventId } : {}),