deepline 0.1.119 → 0.1.121

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 (148) hide show
  1. package/README.md +4 -0
  2. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/README.md +21 -0
  3. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/batching.ts +185 -0
  4. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-batch.ts +107 -0
  5. package/dist/{repo → bundling-sources}/sdk/src/client.ts +116 -12
  6. package/dist/bundling-sources/sdk/src/compat.ts +191 -0
  7. package/dist/bundling-sources/sdk/src/gtm.ts +146 -0
  8. package/dist/bundling-sources/sdk/src/helpers.ts +12 -0
  9. package/dist/{repo → bundling-sources}/sdk/src/index.ts +2 -1
  10. package/dist/{repo → bundling-sources}/sdk/src/play.ts +3 -1
  11. package/dist/{repo → bundling-sources}/sdk/src/plays/bundle-play-file.ts +17 -5
  12. package/dist/{repo → bundling-sources}/sdk/src/release.ts +2 -2
  13. package/dist/{repo → bundling-sources}/sdk/src/runs/observe-transport.ts +2 -3
  14. package/dist/bundling-sources/shared_libs/play-data-plane/index.ts +3 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +838 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +5510 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/ctx-contract.ts +261 -0
  18. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +828 -0
  19. package/dist/bundling-sources/shared_libs/play-runtime/dataset-id.ts +10 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/daytona-runtime-config.ts +50 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/durability-store.ts +20 -0
  22. package/dist/bundling-sources/shared_libs/play-runtime/event-wait-tools.ts +9 -0
  23. package/dist/bundling-sources/shared_libs/play-runtime/governor/in-memory-rate-state-backend.ts +171 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/hatchet-cold-execution-diagnosis.ts +321 -0
  25. package/dist/bundling-sources/shared_libs/play-runtime/hatchet-cold-execution-target.ts +158 -0
  26. package/dist/bundling-sources/shared_libs/play-runtime/internal-step-ids.ts +34 -0
  27. package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +34 -0
  28. package/dist/bundling-sources/shared_libs/play-runtime/live-state-contract.ts +50 -0
  29. package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +119 -0
  30. package/dist/{repo → bundling-sources}/shared_libs/play-runtime/map-row-identity.ts +1 -1
  31. package/dist/bundling-sources/shared_libs/play-runtime/play-latency-trace.ts +636 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/postgres-json.ts +9 -0
  33. package/dist/bundling-sources/shared_libs/play-runtime/progress-emitter.ts +197 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/projection.ts +262 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +143 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/public-play-contract.ts +42 -0
  37. package/dist/bundling-sources/shared_libs/play-runtime/receipt-status.ts +40 -0
  38. package/dist/bundling-sources/shared_libs/play-runtime/runtime-actions.ts +178 -0
  39. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +4015 -0
  40. package/dist/bundling-sources/shared_libs/play-runtime/runtime-constraints.ts +2 -0
  41. package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver-neon-serverless.ts +238 -0
  42. package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver-pg.ts +53 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver.ts +149 -0
  44. package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +68 -0
  45. package/dist/bundling-sources/shared_libs/play-runtime/tool-batch-executor.ts +149 -0
  46. package/dist/bundling-sources/shared_libs/play-runtime/tool-result-types.ts +159 -0
  47. package/dist/bundling-sources/shared_libs/play-runtime/tracing.ts +33 -0
  48. package/dist/bundling-sources/shared_libs/play-runtime/waterfall-replay.ts +79 -0
  49. package/dist/bundling-sources/shared_libs/play-runtime/worker-api-types.ts +139 -0
  50. package/dist/bundling-sources/shared_libs/plays/artifact-transport.ts +14 -0
  51. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +49 -0
  52. package/dist/bundling-sources/shared_libs/plays/compiler-manifest.ts +41 -0
  53. package/dist/bundling-sources/shared_libs/plays/dataset-summary.ts +163 -0
  54. package/dist/bundling-sources/shared_libs/plays/definition.ts +267 -0
  55. package/dist/bundling-sources/shared_libs/plays/file-refs.ts +11 -0
  56. package/dist/bundling-sources/shared_libs/plays/input-contract.ts +146 -0
  57. package/dist/bundling-sources/shared_libs/plays/resolve-static-pipeline.ts +190 -0
  58. package/dist/bundling-sources/shared_libs/plays/runtime-validation.ts +417 -0
  59. package/dist/bundling-sources/shared_libs/plays/tool-codegen.ts +142 -0
  60. package/dist/bundling-sources/shared_libs/security/safe-outbound-fetch.ts +274 -0
  61. package/dist/bundling-sources/shared_libs/temporal/preview-config.ts +150 -0
  62. package/dist/cli/index.js +811 -2207
  63. package/dist/cli/index.mjs +847 -2258
  64. package/dist/compiler-manifest-BjoRENv9.d.mts +227 -0
  65. package/dist/compiler-manifest-BjoRENv9.d.ts +227 -0
  66. package/dist/index.d.mts +8 -231
  67. package/dist/index.d.ts +8 -231
  68. package/dist/index.js +101 -15
  69. package/dist/index.mjs +101 -15
  70. package/dist/plays/bundle-play-file.d.mts +120 -0
  71. package/dist/plays/bundle-play-file.d.ts +120 -0
  72. package/dist/plays/bundle-play-file.mjs +1830 -0
  73. package/package.json +4 -9
  74. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/child-play-await.ts +0 -0
  75. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/child-play-submit.ts +0 -0
  76. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/coordinator-entry.ts +0 -0
  77. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/dedup-do.ts +0 -0
  78. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/entry.ts +0 -0
  79. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/runtime/csv-rows.ts +0 -0
  80. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/runtime/dataset-handles.ts +0 -0
  81. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/runtime/harness-receipt-store.ts +0 -0
  82. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/runtime/live-progress.ts +0 -0
  83. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/runtime/map-chunk-plan.ts +0 -0
  84. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/runtime/receipts.ts +0 -0
  85. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/runtime/row-isolation.ts +0 -0
  86. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/runtime/tool-http-errors.ts +0 -0
  87. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/workflow-instance-create.ts +0 -0
  88. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/workflow-retry-state.ts +0 -0
  89. /package/dist/{repo → bundling-sources}/apps/play-runner-workers/src/workflow-retry.ts +0 -0
  90. /package/dist/{repo → bundling-sources}/sdk/src/agent-runtime.ts +0 -0
  91. /package/dist/{repo → bundling-sources}/sdk/src/config.ts +0 -0
  92. /package/dist/{repo → bundling-sources}/sdk/src/errors.ts +0 -0
  93. /package/dist/{repo → bundling-sources}/sdk/src/http.ts +0 -0
  94. /package/dist/{repo → bundling-sources}/sdk/src/plays/harness-stub.ts +0 -0
  95. /package/dist/{repo → bundling-sources}/sdk/src/plays/local-file-discovery.ts +0 -0
  96. /package/dist/{repo → bundling-sources}/sdk/src/stream-reconnect.ts +0 -0
  97. /package/dist/{repo → bundling-sources}/sdk/src/tool-output.ts +0 -0
  98. /package/dist/{repo → bundling-sources}/sdk/src/types.ts +0 -0
  99. /package/dist/{repo → bundling-sources}/sdk/src/version.ts +0 -0
  100. /package/dist/{repo → bundling-sources}/sdk/src/worker-play-entry.ts +0 -0
  101. /package/dist/{repo → bundling-sources}/shared_libs/play-data-plane/cell-policy.ts +0 -0
  102. /package/dist/{repo → bundling-sources}/shared_libs/play-data-plane/column-names.ts +0 -0
  103. /package/dist/{repo → bundling-sources}/shared_libs/play-data-plane/sheet-contract.ts +0 -0
  104. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/backend.ts +0 -0
  105. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/batch-runtime.ts +0 -0
  106. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/batching-types.ts +0 -0
  107. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/cell-staleness.ts +0 -0
  108. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/coordinator-headers.ts +0 -0
  109. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/csv-rename.ts +0 -0
  110. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/db-session-crypto.ts +0 -0
  111. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/db-session-plan.ts +0 -0
  112. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/db-session.ts +0 -0
  113. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/dedup-backend.ts +0 -0
  114. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/default-batch-strategies.ts +0 -0
  115. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/email-status.ts +0 -0
  116. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/execution-plan.ts +0 -0
  117. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/extractor-targets.ts +0 -0
  118. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/fullenrich-batching.ts +0 -0
  119. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/governor/coordinator-rate-state-backend.ts +0 -0
  120. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/governor/governor.ts +0 -0
  121. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/governor/policy.ts +0 -0
  122. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/governor/rate-state-backend.ts +0 -0
  123. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/live-events.ts +0 -0
  124. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/play-runtime-batching-registry.ts +0 -0
  125. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/profiles.ts +0 -0
  126. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/providers.ts +0 -0
  127. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/run-failure.ts +0 -0
  128. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/run-ledger.ts +0 -0
  129. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/run-snapshot-stream.ts +0 -0
  130. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/scheduler-backend.ts +0 -0
  131. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/secret-capability.ts +0 -0
  132. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/secret-redaction.ts +0 -0
  133. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/step-lifecycle-tracker.ts +0 -0
  134. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/step-program-dataset-builder.ts +0 -0
  135. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/submit-limits.ts +0 -0
  136. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/tool-result.ts +0 -0
  137. /package/dist/{repo → bundling-sources}/shared_libs/play-runtime/work-receipts.ts +0 -0
  138. /package/dist/{repo → bundling-sources}/shared_libs/plays/bootstrap-routes.ts +0 -0
  139. /package/dist/{repo → bundling-sources}/shared_libs/plays/bundling/index.ts +0 -0
  140. /package/dist/{repo → bundling-sources}/shared_libs/plays/bundling/limits.ts +0 -0
  141. /package/dist/{repo → bundling-sources}/shared_libs/plays/contracts.ts +0 -0
  142. /package/dist/{repo → bundling-sources}/shared_libs/plays/dataset.ts +0 -0
  143. /package/dist/{repo → bundling-sources}/shared_libs/plays/row-identity.ts +0 -0
  144. /package/dist/{repo → bundling-sources}/shared_libs/plays/secret-guardrails.ts +0 -0
  145. /package/dist/{repo → bundling-sources}/shared_libs/plays/static-pipeline.ts +0 -0
  146. /package/dist/{repo → bundling-sources}/shared_libs/security/outbound-url-policy.ts +0 -0
  147. /package/dist/{repo → bundling-sources}/shared_libs/security/safe-fetch.ts +0 -0
  148. /package/dist/{repo → bundling-sources}/shared_libs/temporal/constants.ts +0 -0
@@ -0,0 +1,227 @@
1
+ /**
2
+ * The runtime shape of a built play artifact. Different runner backends need
3
+ * different bundle outputs:
4
+ * - cjs_node20: Daytona + local-process (full Node.js sandbox).
5
+ * - esm_workers: Cloudflare Workers (V8 isolate, no `fs`/`child_process`).
6
+ *
7
+ * The CLI selects which kind to build based on the target backend; the worker
8
+ * validates the kind matches the backend it's about to dispatch to.
9
+ */
10
+ declare const PLAY_ARTIFACT_KINDS: {
11
+ readonly cjsNode20: "cjs_node20";
12
+ readonly esmWorkers: "esm_workers";
13
+ };
14
+ type PlayArtifactKind = (typeof PLAY_ARTIFACT_KINDS)[keyof typeof PLAY_ARTIFACT_KINDS];
15
+
16
+ /**
17
+ * A top-level key the play's function literally `return`s. Derived from the
18
+ * `return { ... }` object literal — NOT from dataset `.withColumn(...)` names —
19
+ * so the "Returns" graph node mirrors the function's real output shape.
20
+ * `isDataset` is true when the key's value is a `PlayDataset` handle (a table).
21
+ */
22
+ interface PlayStaticReturnField {
23
+ name: string;
24
+ isDataset: boolean;
25
+ }
26
+ interface PlayStaticPipeline {
27
+ tableNamespace?: string;
28
+ inputFields?: string[];
29
+ rowKeyFields?: string[];
30
+ csvArg?: string;
31
+ hasInlineData?: boolean;
32
+ csvDescription?: string;
33
+ datasetDescription?: string;
34
+ fields: string[];
35
+ /**
36
+ * Top-level keys of the play's `return { ... }` object literal, in source
37
+ * order. Undefined when the terminal return isn't a statically-known object
38
+ * literal (bare value, dataset handle, conditional returns, etc.).
39
+ */
40
+ returnFields?: PlayStaticReturnField[];
41
+ stages?: PlayStaticSubstep[];
42
+ substeps: PlayStaticSubstep[];
43
+ sheetContract?: PlaySheetContract | null;
44
+ sheetContractErrors?: string[];
45
+ }
46
+ type PlaySheetColumnSource = 'input' | 'datasetColumn' | 'waterfallStep' | 'childPlayColumn';
47
+ interface PlaySheetColumnContract {
48
+ id: string;
49
+ sqlName: string;
50
+ source: PlaySheetColumnSource;
51
+ field?: string;
52
+ parentField?: string;
53
+ playId?: string;
54
+ waterfallId?: string;
55
+ outputField?: string;
56
+ outputSqlName?: string;
57
+ stepId?: string;
58
+ toolId?: string;
59
+ isRowKey?: boolean;
60
+ }
61
+ interface PlaySheetContract {
62
+ tableNamespace: string;
63
+ columns: PlaySheetColumnContract[];
64
+ }
65
+ type PlayStaticColumnProducerKind = 'tool' | 'waterfall' | 'stepProgram' | 'playCall' | 'controlFlow' | 'transform';
66
+ interface PlayStaticColumnProducer {
67
+ id: string;
68
+ kind: PlayStaticColumnProducerKind;
69
+ field: string;
70
+ toolId?: string;
71
+ playId?: string;
72
+ dependsOnFields?: string[];
73
+ recompute?: boolean;
74
+ recomputeOnError?: boolean;
75
+ staleAfterSeconds?: number;
76
+ conditional?: boolean;
77
+ sourceRange?: PlayStaticSourceRange;
78
+ steps?: PlayStaticColumnProducer[];
79
+ substep: PlayStaticSubstep;
80
+ }
81
+ interface PlayStaticDatasetColumn {
82
+ id: string;
83
+ source: PlaySheetColumnSource;
84
+ sqlName?: string;
85
+ recompute?: boolean;
86
+ recomputeOnError?: boolean;
87
+ staleAfterSeconds?: number;
88
+ producers: PlayStaticColumnProducer[];
89
+ }
90
+ interface PlayStaticSourceRange {
91
+ sourcePath?: string;
92
+ startLine: number;
93
+ endLine: number;
94
+ startColumn: number;
95
+ endColumn: number;
96
+ }
97
+ type PlayStaticSubstepMetadata = {
98
+ conditional?: boolean;
99
+ dependsOnFields?: string[];
100
+ recompute?: boolean;
101
+ recomputeOnError?: boolean;
102
+ staleAfterSeconds?: number;
103
+ };
104
+ type PlayStaticSubstep = PlayStaticSubstepMetadata & ({
105
+ type: 'csv';
106
+ field: string;
107
+ path?: string;
108
+ description?: string;
109
+ sourceRange?: PlayStaticSourceRange;
110
+ callDepth?: number;
111
+ callPath?: string[];
112
+ } | {
113
+ type: 'dataset';
114
+ field: string;
115
+ name?: string;
116
+ tableNamespace?: string;
117
+ inputFields?: string[];
118
+ rowKeyFields?: string[];
119
+ outputFields?: string[];
120
+ columns?: PlayStaticDatasetColumn[];
121
+ waterfallIds?: string[];
122
+ steps?: PlayStaticSubstep[];
123
+ sheetContract?: PlaySheetContract | null;
124
+ description?: string;
125
+ sourceRange?: PlayStaticSourceRange;
126
+ callDepth?: number;
127
+ callPath?: string[];
128
+ } | {
129
+ type: 'tool';
130
+ toolId: string;
131
+ field: string;
132
+ paramsSource?: string;
133
+ sourceText?: string;
134
+ description?: string;
135
+ inLoop?: boolean;
136
+ isEventWait?: boolean;
137
+ sourceRange?: PlayStaticSourceRange;
138
+ callDepth?: number;
139
+ callPath?: string[];
140
+ } | {
141
+ type: 'waterfall';
142
+ tool?: string;
143
+ field: string;
144
+ inLoop?: boolean;
145
+ id?: string;
146
+ output?: string;
147
+ minResults?: number;
148
+ sourceText?: string;
149
+ steps?: Array<{
150
+ id: string;
151
+ kind?: 'tool' | 'code';
152
+ toolId?: string;
153
+ paramsSource?: string;
154
+ }>;
155
+ description?: string;
156
+ sourceRange?: PlayStaticSourceRange;
157
+ callDepth?: number;
158
+ callPath?: string[];
159
+ } | {
160
+ type: 'step_suite';
161
+ field: string;
162
+ steps: PlayStaticSubstep[];
163
+ returnSource?: string;
164
+ description?: string;
165
+ sourceRange?: PlayStaticSourceRange;
166
+ callDepth?: number;
167
+ callPath?: string[];
168
+ } | {
169
+ type: 'play_call';
170
+ playId: string;
171
+ field: string;
172
+ inLoop?: boolean;
173
+ pipeline?: PlayStaticPipeline | null;
174
+ cycleDetected?: boolean;
175
+ resolutionError?: string;
176
+ description?: string;
177
+ sourceRange?: PlayStaticSourceRange;
178
+ callDepth?: number;
179
+ callPath?: string[];
180
+ } | {
181
+ type: 'control_flow';
182
+ kind: 'conditional' | 'loop';
183
+ field: string;
184
+ steps: PlayStaticSubstep[];
185
+ description?: string;
186
+ sourceRange?: PlayStaticSourceRange;
187
+ callDepth?: number;
188
+ callPath?: string[];
189
+ } | {
190
+ type: 'run_javascript';
191
+ alias: string;
192
+ sourceText?: string;
193
+ description?: string;
194
+ sourceRange?: PlayStaticSourceRange;
195
+ callDepth?: number;
196
+ callPath?: string[];
197
+ } | {
198
+ type: 'code';
199
+ field: string;
200
+ sourceText?: string;
201
+ description?: string;
202
+ sourceRange?: PlayStaticSourceRange;
203
+ callDepth?: number;
204
+ callPath?: string[];
205
+ });
206
+
207
+ type PlayCompilerDependencyManifest = {
208
+ playName: string;
209
+ /** Original source path for direct imported definePlay dependencies. */
210
+ filePath?: string;
211
+ sourceHash: string;
212
+ graphHash: string;
213
+ artifactHash: string;
214
+ staticPipeline: PlayStaticPipeline;
215
+ };
216
+ type PlayCompilerManifest = {
217
+ compilerVersion: number;
218
+ playName: string;
219
+ sourceHash: string;
220
+ graphHash: string;
221
+ artifactHash: string;
222
+ artifactKind?: PlayArtifactKind;
223
+ staticPipeline: PlayStaticPipeline;
224
+ importedPlayDependencies: PlayCompilerDependencyManifest[];
225
+ };
226
+
227
+ export { type PlayArtifactKind as P, type PlayCompilerManifest as a, PLAY_ARTIFACT_KINDS as b };
@@ -0,0 +1,227 @@
1
+ /**
2
+ * The runtime shape of a built play artifact. Different runner backends need
3
+ * different bundle outputs:
4
+ * - cjs_node20: Daytona + local-process (full Node.js sandbox).
5
+ * - esm_workers: Cloudflare Workers (V8 isolate, no `fs`/`child_process`).
6
+ *
7
+ * The CLI selects which kind to build based on the target backend; the worker
8
+ * validates the kind matches the backend it's about to dispatch to.
9
+ */
10
+ declare const PLAY_ARTIFACT_KINDS: {
11
+ readonly cjsNode20: "cjs_node20";
12
+ readonly esmWorkers: "esm_workers";
13
+ };
14
+ type PlayArtifactKind = (typeof PLAY_ARTIFACT_KINDS)[keyof typeof PLAY_ARTIFACT_KINDS];
15
+
16
+ /**
17
+ * A top-level key the play's function literally `return`s. Derived from the
18
+ * `return { ... }` object literal — NOT from dataset `.withColumn(...)` names —
19
+ * so the "Returns" graph node mirrors the function's real output shape.
20
+ * `isDataset` is true when the key's value is a `PlayDataset` handle (a table).
21
+ */
22
+ interface PlayStaticReturnField {
23
+ name: string;
24
+ isDataset: boolean;
25
+ }
26
+ interface PlayStaticPipeline {
27
+ tableNamespace?: string;
28
+ inputFields?: string[];
29
+ rowKeyFields?: string[];
30
+ csvArg?: string;
31
+ hasInlineData?: boolean;
32
+ csvDescription?: string;
33
+ datasetDescription?: string;
34
+ fields: string[];
35
+ /**
36
+ * Top-level keys of the play's `return { ... }` object literal, in source
37
+ * order. Undefined when the terminal return isn't a statically-known object
38
+ * literal (bare value, dataset handle, conditional returns, etc.).
39
+ */
40
+ returnFields?: PlayStaticReturnField[];
41
+ stages?: PlayStaticSubstep[];
42
+ substeps: PlayStaticSubstep[];
43
+ sheetContract?: PlaySheetContract | null;
44
+ sheetContractErrors?: string[];
45
+ }
46
+ type PlaySheetColumnSource = 'input' | 'datasetColumn' | 'waterfallStep' | 'childPlayColumn';
47
+ interface PlaySheetColumnContract {
48
+ id: string;
49
+ sqlName: string;
50
+ source: PlaySheetColumnSource;
51
+ field?: string;
52
+ parentField?: string;
53
+ playId?: string;
54
+ waterfallId?: string;
55
+ outputField?: string;
56
+ outputSqlName?: string;
57
+ stepId?: string;
58
+ toolId?: string;
59
+ isRowKey?: boolean;
60
+ }
61
+ interface PlaySheetContract {
62
+ tableNamespace: string;
63
+ columns: PlaySheetColumnContract[];
64
+ }
65
+ type PlayStaticColumnProducerKind = 'tool' | 'waterfall' | 'stepProgram' | 'playCall' | 'controlFlow' | 'transform';
66
+ interface PlayStaticColumnProducer {
67
+ id: string;
68
+ kind: PlayStaticColumnProducerKind;
69
+ field: string;
70
+ toolId?: string;
71
+ playId?: string;
72
+ dependsOnFields?: string[];
73
+ recompute?: boolean;
74
+ recomputeOnError?: boolean;
75
+ staleAfterSeconds?: number;
76
+ conditional?: boolean;
77
+ sourceRange?: PlayStaticSourceRange;
78
+ steps?: PlayStaticColumnProducer[];
79
+ substep: PlayStaticSubstep;
80
+ }
81
+ interface PlayStaticDatasetColumn {
82
+ id: string;
83
+ source: PlaySheetColumnSource;
84
+ sqlName?: string;
85
+ recompute?: boolean;
86
+ recomputeOnError?: boolean;
87
+ staleAfterSeconds?: number;
88
+ producers: PlayStaticColumnProducer[];
89
+ }
90
+ interface PlayStaticSourceRange {
91
+ sourcePath?: string;
92
+ startLine: number;
93
+ endLine: number;
94
+ startColumn: number;
95
+ endColumn: number;
96
+ }
97
+ type PlayStaticSubstepMetadata = {
98
+ conditional?: boolean;
99
+ dependsOnFields?: string[];
100
+ recompute?: boolean;
101
+ recomputeOnError?: boolean;
102
+ staleAfterSeconds?: number;
103
+ };
104
+ type PlayStaticSubstep = PlayStaticSubstepMetadata & ({
105
+ type: 'csv';
106
+ field: string;
107
+ path?: string;
108
+ description?: string;
109
+ sourceRange?: PlayStaticSourceRange;
110
+ callDepth?: number;
111
+ callPath?: string[];
112
+ } | {
113
+ type: 'dataset';
114
+ field: string;
115
+ name?: string;
116
+ tableNamespace?: string;
117
+ inputFields?: string[];
118
+ rowKeyFields?: string[];
119
+ outputFields?: string[];
120
+ columns?: PlayStaticDatasetColumn[];
121
+ waterfallIds?: string[];
122
+ steps?: PlayStaticSubstep[];
123
+ sheetContract?: PlaySheetContract | null;
124
+ description?: string;
125
+ sourceRange?: PlayStaticSourceRange;
126
+ callDepth?: number;
127
+ callPath?: string[];
128
+ } | {
129
+ type: 'tool';
130
+ toolId: string;
131
+ field: string;
132
+ paramsSource?: string;
133
+ sourceText?: string;
134
+ description?: string;
135
+ inLoop?: boolean;
136
+ isEventWait?: boolean;
137
+ sourceRange?: PlayStaticSourceRange;
138
+ callDepth?: number;
139
+ callPath?: string[];
140
+ } | {
141
+ type: 'waterfall';
142
+ tool?: string;
143
+ field: string;
144
+ inLoop?: boolean;
145
+ id?: string;
146
+ output?: string;
147
+ minResults?: number;
148
+ sourceText?: string;
149
+ steps?: Array<{
150
+ id: string;
151
+ kind?: 'tool' | 'code';
152
+ toolId?: string;
153
+ paramsSource?: string;
154
+ }>;
155
+ description?: string;
156
+ sourceRange?: PlayStaticSourceRange;
157
+ callDepth?: number;
158
+ callPath?: string[];
159
+ } | {
160
+ type: 'step_suite';
161
+ field: string;
162
+ steps: PlayStaticSubstep[];
163
+ returnSource?: string;
164
+ description?: string;
165
+ sourceRange?: PlayStaticSourceRange;
166
+ callDepth?: number;
167
+ callPath?: string[];
168
+ } | {
169
+ type: 'play_call';
170
+ playId: string;
171
+ field: string;
172
+ inLoop?: boolean;
173
+ pipeline?: PlayStaticPipeline | null;
174
+ cycleDetected?: boolean;
175
+ resolutionError?: string;
176
+ description?: string;
177
+ sourceRange?: PlayStaticSourceRange;
178
+ callDepth?: number;
179
+ callPath?: string[];
180
+ } | {
181
+ type: 'control_flow';
182
+ kind: 'conditional' | 'loop';
183
+ field: string;
184
+ steps: PlayStaticSubstep[];
185
+ description?: string;
186
+ sourceRange?: PlayStaticSourceRange;
187
+ callDepth?: number;
188
+ callPath?: string[];
189
+ } | {
190
+ type: 'run_javascript';
191
+ alias: string;
192
+ sourceText?: string;
193
+ description?: string;
194
+ sourceRange?: PlayStaticSourceRange;
195
+ callDepth?: number;
196
+ callPath?: string[];
197
+ } | {
198
+ type: 'code';
199
+ field: string;
200
+ sourceText?: string;
201
+ description?: string;
202
+ sourceRange?: PlayStaticSourceRange;
203
+ callDepth?: number;
204
+ callPath?: string[];
205
+ });
206
+
207
+ type PlayCompilerDependencyManifest = {
208
+ playName: string;
209
+ /** Original source path for direct imported definePlay dependencies. */
210
+ filePath?: string;
211
+ sourceHash: string;
212
+ graphHash: string;
213
+ artifactHash: string;
214
+ staticPipeline: PlayStaticPipeline;
215
+ };
216
+ type PlayCompilerManifest = {
217
+ compilerVersion: number;
218
+ playName: string;
219
+ sourceHash: string;
220
+ graphHash: string;
221
+ artifactHash: string;
222
+ artifactKind?: PlayArtifactKind;
223
+ staticPipeline: PlayStaticPipeline;
224
+ importedPlayDependencies: PlayCompilerDependencyManifest[];
225
+ };
226
+
227
+ export { type PlayArtifactKind as P, type PlayCompilerManifest as a, PLAY_ARTIFACT_KINDS as b };
package/dist/index.d.mts CHANGED
@@ -1,228 +1,4 @@
1
- /**
2
- * The runtime shape of a built play artifact. Different runner backends need
3
- * different bundle outputs:
4
- * - cjs_node20: Daytona + local-process (full Node.js sandbox).
5
- * - esm_workers: Cloudflare Workers (V8 isolate, no `fs`/`child_process`).
6
- *
7
- * The CLI selects which kind to build based on the target backend; the worker
8
- * validates the kind matches the backend it's about to dispatch to.
9
- */
10
- declare const PLAY_ARTIFACT_KINDS: {
11
- readonly cjsNode20: "cjs_node20";
12
- readonly esmWorkers: "esm_workers";
13
- };
14
- type PlayArtifactKind = (typeof PLAY_ARTIFACT_KINDS)[keyof typeof PLAY_ARTIFACT_KINDS];
15
-
16
- /**
17
- * A top-level key the play's function literally `return`s. Derived from the
18
- * `return { ... }` object literal — NOT from dataset `.withColumn(...)` names —
19
- * so the "Returns" graph node mirrors the function's real output shape.
20
- * `isDataset` is true when the key's value is a `PlayDataset` handle (a table).
21
- */
22
- interface PlayStaticReturnField {
23
- name: string;
24
- isDataset: boolean;
25
- }
26
- interface PlayStaticPipeline {
27
- tableNamespace?: string;
28
- inputFields?: string[];
29
- rowKeyFields?: string[];
30
- csvArg?: string;
31
- hasInlineData?: boolean;
32
- csvDescription?: string;
33
- datasetDescription?: string;
34
- fields: string[];
35
- /**
36
- * Top-level keys of the play's `return { ... }` object literal, in source
37
- * order. Undefined when the terminal return isn't a statically-known object
38
- * literal (bare value, dataset handle, conditional returns, etc.).
39
- */
40
- returnFields?: PlayStaticReturnField[];
41
- stages?: PlayStaticSubstep[];
42
- substeps: PlayStaticSubstep[];
43
- sheetContract?: PlaySheetContract | null;
44
- sheetContractErrors?: string[];
45
- }
46
- type PlaySheetColumnSource = 'input' | 'datasetColumn' | 'waterfallStep' | 'childPlayColumn';
47
- interface PlaySheetColumnContract {
48
- id: string;
49
- sqlName: string;
50
- source: PlaySheetColumnSource;
51
- field?: string;
52
- parentField?: string;
53
- playId?: string;
54
- waterfallId?: string;
55
- outputField?: string;
56
- outputSqlName?: string;
57
- stepId?: string;
58
- toolId?: string;
59
- isRowKey?: boolean;
60
- }
61
- interface PlaySheetContract {
62
- tableNamespace: string;
63
- columns: PlaySheetColumnContract[];
64
- }
65
- type PlayStaticColumnProducerKind = 'tool' | 'waterfall' | 'stepProgram' | 'playCall' | 'controlFlow' | 'transform';
66
- interface PlayStaticColumnProducer {
67
- id: string;
68
- kind: PlayStaticColumnProducerKind;
69
- field: string;
70
- toolId?: string;
71
- playId?: string;
72
- dependsOnFields?: string[];
73
- recompute?: boolean;
74
- recomputeOnError?: boolean;
75
- staleAfterSeconds?: number;
76
- conditional?: boolean;
77
- sourceRange?: PlayStaticSourceRange;
78
- steps?: PlayStaticColumnProducer[];
79
- substep: PlayStaticSubstep;
80
- }
81
- interface PlayStaticDatasetColumn {
82
- id: string;
83
- source: PlaySheetColumnSource;
84
- sqlName?: string;
85
- recompute?: boolean;
86
- recomputeOnError?: boolean;
87
- staleAfterSeconds?: number;
88
- producers: PlayStaticColumnProducer[];
89
- }
90
- interface PlayStaticSourceRange {
91
- sourcePath?: string;
92
- startLine: number;
93
- endLine: number;
94
- startColumn: number;
95
- endColumn: number;
96
- }
97
- type PlayStaticSubstepMetadata = {
98
- conditional?: boolean;
99
- dependsOnFields?: string[];
100
- recompute?: boolean;
101
- recomputeOnError?: boolean;
102
- staleAfterSeconds?: number;
103
- };
104
- type PlayStaticSubstep = PlayStaticSubstepMetadata & ({
105
- type: 'csv';
106
- field: string;
107
- path?: string;
108
- description?: string;
109
- sourceRange?: PlayStaticSourceRange;
110
- callDepth?: number;
111
- callPath?: string[];
112
- } | {
113
- type: 'dataset';
114
- field: string;
115
- name?: string;
116
- tableNamespace?: string;
117
- inputFields?: string[];
118
- rowKeyFields?: string[];
119
- outputFields?: string[];
120
- columns?: PlayStaticDatasetColumn[];
121
- waterfallIds?: string[];
122
- steps?: PlayStaticSubstep[];
123
- sheetContract?: PlaySheetContract | null;
124
- description?: string;
125
- sourceRange?: PlayStaticSourceRange;
126
- callDepth?: number;
127
- callPath?: string[];
128
- } | {
129
- type: 'tool';
130
- toolId: string;
131
- field: string;
132
- paramsSource?: string;
133
- sourceText?: string;
134
- description?: string;
135
- inLoop?: boolean;
136
- isEventWait?: boolean;
137
- sourceRange?: PlayStaticSourceRange;
138
- callDepth?: number;
139
- callPath?: string[];
140
- } | {
141
- type: 'waterfall';
142
- tool?: string;
143
- field: string;
144
- inLoop?: boolean;
145
- id?: string;
146
- output?: string;
147
- minResults?: number;
148
- sourceText?: string;
149
- steps?: Array<{
150
- id: string;
151
- kind?: 'tool' | 'code';
152
- toolId?: string;
153
- paramsSource?: string;
154
- }>;
155
- description?: string;
156
- sourceRange?: PlayStaticSourceRange;
157
- callDepth?: number;
158
- callPath?: string[];
159
- } | {
160
- type: 'step_suite';
161
- field: string;
162
- steps: PlayStaticSubstep[];
163
- returnSource?: string;
164
- description?: string;
165
- sourceRange?: PlayStaticSourceRange;
166
- callDepth?: number;
167
- callPath?: string[];
168
- } | {
169
- type: 'play_call';
170
- playId: string;
171
- field: string;
172
- inLoop?: boolean;
173
- pipeline?: PlayStaticPipeline | null;
174
- cycleDetected?: boolean;
175
- resolutionError?: string;
176
- description?: string;
177
- sourceRange?: PlayStaticSourceRange;
178
- callDepth?: number;
179
- callPath?: string[];
180
- } | {
181
- type: 'control_flow';
182
- kind: 'conditional' | 'loop';
183
- field: string;
184
- steps: PlayStaticSubstep[];
185
- description?: string;
186
- sourceRange?: PlayStaticSourceRange;
187
- callDepth?: number;
188
- callPath?: string[];
189
- } | {
190
- type: 'run_javascript';
191
- alias: string;
192
- sourceText?: string;
193
- description?: string;
194
- sourceRange?: PlayStaticSourceRange;
195
- callDepth?: number;
196
- callPath?: string[];
197
- } | {
198
- type: 'code';
199
- field: string;
200
- sourceText?: string;
201
- description?: string;
202
- sourceRange?: PlayStaticSourceRange;
203
- callDepth?: number;
204
- callPath?: string[];
205
- });
206
-
207
- type PlayCompilerDependencyManifest = {
208
- playName: string;
209
- /** Original source path for direct imported definePlay dependencies. */
210
- filePath?: string;
211
- sourceHash: string;
212
- graphHash: string;
213
- artifactHash: string;
214
- staticPipeline: PlayStaticPipeline;
215
- };
216
- type PlayCompilerManifest = {
217
- compilerVersion: number;
218
- playName: string;
219
- sourceHash: string;
220
- graphHash: string;
221
- artifactHash: string;
222
- artifactKind?: PlayArtifactKind;
223
- staticPipeline: PlayStaticPipeline;
224
- importedPlayDependencies: PlayCompilerDependencyManifest[];
225
- };
1
+ import { a as PlayCompilerManifest } from './compiler-manifest-BjoRENv9.mjs';
226
2
 
227
3
  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"];
228
4
  type DeeplineToolCategory = (typeof DEEPLINE_TOOL_CATEGORIES)[number] | (string & {});
@@ -2047,17 +1823,18 @@ declare class DeeplineClient {
2047
1823
  */
2048
1824
  listRuns(options: RunsListOptions): Promise<PlayRunListItem[]>;
2049
1825
  /**
2050
- * Observe one run's live events through the Convex Run Snapshot
2051
- * subscription transport (ADR-0008). Yields the same `play.*` event
2052
- * envelopes as {@link streamPlayRunEvents} and ends after the terminal
2053
- * snapshot. Throws {@link RunObserveTransportUnavailableError} when this
2054
- * server cannot serve the transport (older server, unconfigured grants, or
2055
- * unreachable Convex) — callers fall back to the SSE stream with a notice.
1826
+ * Observe one run's live events. Uses the Convex Run Snapshot subscription
1827
+ * transport first (ADR-0008), then falls back to the canonical SSE stream
1828
+ * when the subscription transport or its optional client modules are not
1829
+ * available. Pass `fallback: 'none'` to receive
1830
+ * {@link RunObserveTransportUnavailableError} instead.
2056
1831
  */
2057
1832
  observeRunEvents(runId: string, options?: {
2058
1833
  signal?: AbortSignal;
2059
1834
  onNotice?: (message: string) => void;
1835
+ fallback?: 'sse' | 'none';
2060
1836
  }): AsyncGenerator<PlayLiveEvent>;
1837
+ private streamPlayRunEventsUntilTerminal;
2061
1838
  /**
2062
1839
  * Tail one run through the subscription transport until terminal, then
2063
1840
  * return one durable REST status read (the final Run Response Package).