deepline 0.3.89 → 0.3.90

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 (211) hide show
  1. package/contracts/install-commands.json +29 -0
  2. package/dist/bundling-sources/sdk/src/client.ts +120 -37
  3. package/dist/bundling-sources/sdk/src/index.ts +4 -0
  4. package/dist/bundling-sources/sdk/src/pagination.ts +25 -0
  5. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/release.ts +16 -9
  7. package/dist/bundling-sources/sdk/src/types.ts +23 -0
  8. package/dist/bundling-sources/shared_libs/monitors/analytics-public.ts +10 -0
  9. package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +3 -0
  10. package/dist/bundling-sources/shared_libs/monitors/inbound-queue.ts +4 -4
  11. package/dist/bundling-sources/shared_libs/monitors/inventory-reconciliation.ts +59 -0
  12. package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +7 -9
  13. package/dist/bundling-sources/shared_libs/monitors/package.json +7 -0
  14. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +44 -2
  15. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts +2 -2
  16. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +2 -2
  17. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +1 -1
  18. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +245 -0
  19. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-message.ts +38 -0
  20. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-ack-probe.ts +94 -0
  21. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-delivery.ts +60 -0
  22. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue.ts +60 -0
  23. package/dist/bundling-sources/shared_libs/monitors/snitcher-install-validation.ts +1 -1
  24. package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +2 -2
  25. package/dist/bundling-sources/shared_libs/monitors/snitcher-radar.ts +1 -1
  26. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +1 -1
  27. package/dist/bundling-sources/shared_libs/observability/build-context.ts +13 -0
  28. package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +160 -0
  29. package/dist/bundling-sources/shared_libs/observability/request-context.ts +68 -0
  30. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +654 -0
  31. package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +35 -0
  32. package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +5 -0
  33. package/dist/bundling-sources/shared_libs/play-data-plane/neon-constants.ts +9 -0
  34. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +272 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +45 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +66 -1
  37. package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +0 -1
  38. package/dist/bundling-sources/shared_libs/play-runtime/bounceban-batching.ts +137 -0
  39. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +779 -140
  40. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +46 -0
  41. package/dist/bundling-sources/shared_libs/play-runtime/daytona-payload-contract.ts +68 -0
  42. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +103 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +725 -0
  44. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +29 -0
  45. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +23 -0
  46. package/dist/bundling-sources/shared_libs/play-runtime/execution-gateway-invocation-fence.ts +442 -0
  47. package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +3 -3
  48. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +18 -0
  49. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +9 -0
  50. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +1 -1
  51. package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +1 -1
  52. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/contracts.ts +66 -0
  53. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/job.ts +145 -0
  54. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/ports.ts +21 -0
  55. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/postgres-store.ts +170 -0
  56. package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +1322 -0
  57. package/dist/bundling-sources/shared_libs/play-runtime/internal-step-ids.ts +2 -2
  58. package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +1 -1
  59. package/dist/bundling-sources/shared_libs/play-runtime/launch-source-policy.ts +112 -0
  60. package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +8 -0
  61. package/dist/bundling-sources/shared_libs/play-runtime/perf-trace.ts +127 -0
  62. package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +5 -0
  63. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
  64. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/contracts.ts +56 -0
  65. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/index.ts +13 -0
  66. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/job.ts +41 -0
  67. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/ports.ts +17 -0
  68. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/postgres-adapter.ts +54 -0
  69. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/contracts.ts +114 -0
  70. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/engine-suspension.ts +108 -0
  71. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/index.ts +36 -0
  72. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/job.ts +97 -0
  73. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/ports.ts +104 -0
  74. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/postgres-fence-adapter.ts +263 -0
  75. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/worker-terminal-projection.ts +64 -0
  76. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/contracts.ts +29 -0
  77. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +56 -0
  78. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/index.ts +15 -0
  79. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/job.ts +65 -0
  80. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/ports.ts +17 -0
  81. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +42 -0
  82. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/index.ts +17 -0
  83. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +142 -0
  84. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/ports.ts +42 -0
  85. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/postgres-adapter.ts +102 -0
  86. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/contracts.ts +60 -0
  87. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/index.ts +16 -0
  88. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/job.ts +78 -0
  89. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/ports.ts +54 -0
  90. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/postgres-adapter.ts +71 -0
  91. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +4 -0
  92. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +2 -0
  93. package/dist/bundling-sources/shared_libs/play-runtime/receipt-status.ts +5 -8
  94. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +3 -5
  95. package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +168 -0
  96. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +72 -9
  97. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +6 -12
  98. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +19 -0
  99. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/bundle.ts +0 -1
  100. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +14 -44
  101. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +57 -205
  102. package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +201 -0
  103. package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +6 -0
  104. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +67 -0
  105. package/dist/bundling-sources/shared_libs/play-runtime/runtime-release-environment.ts +2 -0
  106. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +68 -0
  107. package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +14 -2
  108. package/dist/bundling-sources/shared_libs/play-runtime/runtime-telemetry.ts +108 -0
  109. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -0
  110. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +3 -0
  111. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
  112. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +88 -0
  113. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-deploy-task.ts +124 -0
  114. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-run-task.ts +68 -0
  115. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +193 -0
  116. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-lifecycle.ts +269 -0
  117. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-suffix.ts +73 -0
  118. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +6642 -0
  119. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +897 -0
  120. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-metrics.ts +120 -0
  121. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +76 -0
  122. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +476 -0
  123. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-heavy-request-admission.ts +47 -0
  124. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-progress-registry.ts +147 -0
  125. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/index.ts +27 -0
  126. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/lazy.ts +50 -0
  127. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/play-run-recovery.ts +98 -0
  128. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-budget-state.ts +260 -0
  129. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +1416 -0
  130. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1255 -0
  131. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +942 -0
  132. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +14636 -0
  133. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +888 -0
  134. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +355 -0
  135. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-terminal-transition.ts +46 -0
  136. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runner-push.ts +60 -0
  137. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +33 -0
  138. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-gateway-health.ts +64 -0
  139. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +835 -0
  140. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +1218 -0
  141. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +207 -0
  142. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-scheduler-schema.ts +10 -0
  143. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-capacity.ts +123 -0
  144. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-launch-read-observability.ts +78 -0
  145. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/submit-admission.ts +169 -0
  146. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/terminal-contract.ts +20 -0
  147. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-queue-metrics.ts +34 -0
  148. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-resource-metrics.ts +249 -0
  149. package/dist/bundling-sources/shared_libs/play-runtime/sheet-attempt-sql.ts +7 -0
  150. package/dist/bundling-sources/shared_libs/play-runtime/step-progress.ts +296 -0
  151. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/native-batch.ts +3 -3
  152. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts +20 -1
  153. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +60 -15
  154. package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +20 -0
  155. package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +12 -0
  156. package/dist/bundling-sources/shared_libs/play-runtime/vercel-protection.ts +14 -1
  157. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +165 -0
  158. package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +15 -23
  159. package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +169 -0
  160. package/dist/bundling-sources/shared_libs/play-runtime/zerobounce-batching.ts +122 -0
  161. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +2 -0
  162. package/dist/bundling-sources/shared_libs/plays/contracts.ts +2 -0
  163. package/dist/bundling-sources/shared_libs/plays/deployment-status.ts +1 -1
  164. package/dist/bundling-sources/shared_libs/plays/docflow.ts +1 -1
  165. package/dist/bundling-sources/shared_libs/plays/play-grep-search.ts +39 -0
  166. package/dist/bundling-sources/shared_libs/plays/share/copy.ts +271 -0
  167. package/dist/bundling-sources/shared_libs/plays/share/metrics.ts +140 -0
  168. package/dist/bundling-sources/shared_libs/plays/share/public-read-model.ts +86 -0
  169. package/dist/bundling-sources/shared_libs/plays/share/seo-quality.ts +181 -0
  170. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +658 -0
  171. package/dist/bundling-sources/shared_libs/plays/share/types.ts +197 -0
  172. package/dist/bundling-sources/shared_libs/plays/slack-hitl-timeout-error.ts +37 -0
  173. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +6 -1
  174. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
  175. package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +7 -1
  176. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +3 -2
  177. package/dist/bundling-sources/shared_libs/product-notifications/overflow.ts +18 -0
  178. package/dist/bundling-sources/shared_libs/product-notifications/rolling-limit.ts +24 -0
  179. package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +624 -0
  180. package/dist/bundling-sources/shared_libs/product-notifications/slack-payload.ts +140 -0
  181. package/dist/bundling-sources/shared_libs/product-notifications/slack-transport.ts +75 -0
  182. package/dist/bundling-sources/shared_libs/runtime-env.ts +6 -0
  183. package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +42 -0
  184. package/dist/bundling-sources/shared_libs/security/header-safe-env.ts +10 -3
  185. package/dist/bundling-sources/shared_libs/security/slack-sanitize.ts +133 -0
  186. package/dist/cli/getting-started.d.mts +52 -0
  187. package/dist/cli/getting-started.d.ts +52 -0
  188. package/dist/cli/getting-started.js +65 -0
  189. package/dist/cli/getting-started.mjs +36 -0
  190. package/dist/cli/index.d.mts +9 -0
  191. package/dist/cli/index.d.ts +9 -0
  192. package/dist/cli/index.js +545 -264
  193. package/dist/cli/index.mjs +543 -271
  194. package/dist/{compiler-manifest-DsLbQaew.d.mts → compiler-manifest-BaJfE-5H.d.mts} +5 -3
  195. package/dist/{compiler-manifest-DsLbQaew.d.ts → compiler-manifest-BaJfE-5H.d.ts} +5 -3
  196. package/dist/index.d.mts +81 -148
  197. package/dist/index.d.ts +81 -148
  198. package/dist/index.js +83 -26
  199. package/dist/index.mjs +83 -26
  200. package/dist/install-integrity.json +130 -2
  201. package/dist/monitor-fleet-contract.d.mts +138 -0
  202. package/dist/monitor-fleet-contract.d.ts +138 -0
  203. package/dist/monitor-fleet-contract.js +404 -0
  204. package/dist/monitor-fleet-contract.mjs +367 -0
  205. package/dist/plays/bundle-play-file.d.mts +2 -2
  206. package/dist/plays/bundle-play-file.d.ts +2 -2
  207. package/dist/release.d.mts +255 -0
  208. package/dist/release.d.ts +255 -0
  209. package/dist/release.js +215 -0
  210. package/dist/release.mjs +188 -0
  211. package/package.json +21 -4
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Package-owned types for Shareable Play Pages.
3
+ *
4
+ * These types are imported by Convex functions (`packages/convex/playSharePages.ts`),
5
+ * Next.js API routes, and the public landing page. They are the single,
6
+ * bounded contract for everything that crosses the public boundary.
7
+ *
8
+ * See docs/shareable-play-pages-plan.md.
9
+ */
10
+ // This Module is bundled by Convex through its workspace dependency graph.
11
+ import type { PlayStaticSubstep } from '../static-pipeline';
12
+
13
+ /** SEO indexing posture for a share page or a specific version URL. */
14
+ export type PlayShareSeoIndexing = 'index' | 'noindex';
15
+
16
+ /**
17
+ * Generated landing-page copy, tied to one immutable Play Revision.
18
+ *
19
+ * Every field is plain human/agent-readable text. Nothing here may contain
20
+ * provider spend, secrets, raw runtime internals, or unpublished source.
21
+ */
22
+ export type PlayShareGeneratedCopy = {
23
+ /** Concrete, job-focused landing title. */
24
+ title: string;
25
+ /** One paragraph, plain English. */
26
+ shortDescription: string;
27
+ /** The job the Play performs (jobs-to-be-done). */
28
+ jtbd: string;
29
+ /** 3-5 bullets describing when to reach for this Play. */
30
+ whenToUse: string[];
31
+ /** Concrete required inputs. */
32
+ inputs: string[];
33
+ /** Concrete produced outputs. */
34
+ outputs: string[];
35
+ /** Paste-ready Claude Code/Cursor/Codex instruction. */
36
+ agentPrompt: string;
37
+ /** Explicit, readable summary for LLM ingestion. */
38
+ llmSummary: string;
39
+ /** Search-result title. */
40
+ seoTitle: string;
41
+ /** Search-result description. */
42
+ seoDescription: string;
43
+ };
44
+
45
+ /** Owner overrides merge over generated copy at read time. */
46
+ export type PlayShareCopyOverrides = Partial<PlayShareGeneratedCopy>;
47
+
48
+ /**
49
+ * A single node in the bounded pipeline preview. Never includes source code,
50
+ * params, secrets, or provider spend — only a shape and a human label.
51
+ */
52
+ export type PlaySharePreviewStep = {
53
+ /** Human-readable action, e.g. "search people by domain". */
54
+ label: string;
55
+ /** Provider name backing this step, when known. */
56
+ provider: string | null;
57
+ };
58
+
59
+ export type PlaySharePreviewNode = {
60
+ type:
61
+ | 'csv'
62
+ | 'dataset'
63
+ | 'tool'
64
+ | 'waterfall'
65
+ | 'step_suite'
66
+ | 'control_flow'
67
+ | 'play_call'
68
+ | 'play_launch'
69
+ | 'run_javascript'
70
+ | 'code';
71
+ /** Human-readable label, e.g. "Apollo" or "Dataset rows". */
72
+ label: string;
73
+ /** Optional provider name when this node calls a provider. */
74
+ provider?: string | null;
75
+ /** Optional secondary line, e.g. an input field or step kind. */
76
+ detail?: string | null;
77
+ /** Ordered sub-steps for waterfall / step-suite nodes (bounded). */
78
+ steps?: PlaySharePreviewStep[];
79
+ };
80
+
81
+ /** Bounded static-pipeline summary safe for public display. */
82
+ export type PlayShareStaticPipelineSummary = {
83
+ stepCount: number;
84
+ providerCount: number;
85
+ hasMap: boolean;
86
+ previewNodes: PlaySharePreviewNode[];
87
+ };
88
+
89
+ /** Bounded, safe representation of the revision's input/output shape. */
90
+ export type PlayShareSchemaShape = {
91
+ fields: string[];
92
+ } | null;
93
+
94
+ /**
95
+ * The ONLY object consumed by the public page and the public share API.
96
+ * Everything here is safe to expose to anyone with the unlisted link.
97
+ */
98
+ export type PublishedPlayPagePackage = {
99
+ page: {
100
+ /** Internal stable record id. Never a public URL — pages are namespaced. */
101
+ shareSlug: string;
102
+ /** Org URL handle; the public page lives at `/p/:orgSlug/:playName`. */
103
+ orgSlug: string;
104
+ visibility: 'unlisted';
105
+ seoIndexing: PlayShareSeoIndexing;
106
+ /** Canonical path, e.g. `/p/:orgSlug/:playName/v/:publishedVersion`. */
107
+ canonicalPath: string;
108
+ /** Whether the requested URL is the currently-published version. */
109
+ isPublishedVersion: boolean;
110
+ /** When this version's public page was last published/updated. */
111
+ publishedAt: number;
112
+ };
113
+ definition: {
114
+ name: string;
115
+ ownerDisplayName: string | null;
116
+ };
117
+ revision: {
118
+ id: string;
119
+ version: number;
120
+ graphHash: string | null;
121
+ staticPipelineSummary: PlayShareStaticPipelineSummary;
122
+ /** Sanitized top-level substeps for the real v2 step-graph render. */
123
+ substeps: PlayStaticSubstep[];
124
+ inputSchema: PlayShareSchemaShape;
125
+ outputSchema: PlayShareSchemaShape;
126
+ };
127
+ copy: PlayShareGeneratedCopy;
128
+ publicMetrics: PublishedPlayPageMetrics;
129
+ };
130
+
131
+ /**
132
+ * Which cost denominator is comparable across runs of different input sizes,
133
+ * derived from the play's map shape. See `classifyCostBasis`.
134
+ */
135
+ export type PlayCostBasis = 'run' | 'row' | 'none';
136
+
137
+ /** Public, credit-only metrics. Provider spend is never present. */
138
+ export type PublishedPlayPageMetrics = {
139
+ averageDeeplineCostCredits: number | null;
140
+ averageCostPerInputRowCredits: number | null;
141
+ averageCostPerOutputLeadCredits: number | null;
142
+ averageLatencyMs: number | null;
143
+ sampleRunCount: number;
144
+ /**
145
+ * The only cost denominator that is comparable across runs of different input
146
+ * sizes, derived from the play's map shape: `'run'` (flat play), `'row'`
147
+ * (single dataset over input rows), or `'none'` (multiple/nested datasets — no honest
148
+ * denominator, so cost is suppressed). Drives which credit metric the page
149
+ * renders, if any.
150
+ */
151
+ costBasis: PlayCostBasis;
152
+ };
153
+
154
+ /**
155
+ * Authenticated owner view of a share page (returned by GET/POST/PATCH
156
+ * `/api/v2/plays/:name/share`). Includes management metadata not exposed
157
+ * to the public read model.
158
+ */
159
+ export type PlaySharePageOwnerView = {
160
+ shareSlug: string;
161
+ /** Org URL handle; the public page lives at `/p/:orgSlug/:playName`. */
162
+ orgSlug: string;
163
+ publishedRevisionId: string;
164
+ publishedVersion: number;
165
+ visibility: 'unlisted';
166
+ seoIndexing: PlayShareSeoIndexing;
167
+ showAverageDeeplineCost: boolean;
168
+ showAverageLatency: boolean;
169
+ publicPath: string;
170
+ canonicalPath: string;
171
+ createdAt: number;
172
+ updatedAt: number;
173
+ };
174
+
175
+ /**
176
+ * One row in the byte-bounded owner-facing version picker. The status response
177
+ * includes recent revisions plus any older working, live, public, or explicitly
178
+ * selected dashboard revision.
179
+ */
180
+ export type PlaySharePageRevisionOption = {
181
+ revisionId: string;
182
+ version: number;
183
+ hasMap: boolean;
184
+ createdAt: number;
185
+ isLive: boolean;
186
+ isWorking: boolean;
187
+ isPublished: boolean;
188
+ hasCard: boolean;
189
+ };
190
+
191
+ /** Full payload for GET `/api/v2/plays/:name/share`. */
192
+ export type PlaySharePageStatusResponse = {
193
+ playName: string;
194
+ share: PlaySharePageOwnerView | null;
195
+ publishedCopy: PlayShareGeneratedCopy | null;
196
+ revisions: PlaySharePageRevisionOption[];
197
+ };
@@ -0,0 +1,37 @@
1
+ import { ToolExecutionError } from './tool-execution-error';
2
+
3
+ /** Stable code for an unanswered `slack_message_with_hitl` approval. */
4
+ export const SLACK_HITL_TIMEOUT_ERROR_CODE = 'SLACK_HITL_TIMEOUT' as const;
5
+
6
+ /**
7
+ * A Slack human-in-the-loop approval reached its deadline without a decision.
8
+ *
9
+ * Deepline first confirms that it replaced the Slack card with “Interaction
10
+ * timed out.” and removed its controls. The error is non-retryable and
11
+ * runner-fatal: an authored `try/catch` may observe it, but cannot settle the
12
+ * Play successfully or start another durable operation. Retry the Play only
13
+ * after changing its input or timeout policy.
14
+ *
15
+ */
16
+ export class SlackHitlTimeoutError extends ToolExecutionError {
17
+ constructor(message?: string) {
18
+ const detail =
19
+ message?.trim() ||
20
+ 'Slack approval timed out before a human decision was received.';
21
+ super(`${SLACK_HITL_TIMEOUT_ERROR_CODE}: ${detail}`, {
22
+ toolId: 'slack_message_with_hitl',
23
+ provider: 'slack',
24
+ operation: 'slack_message_with_hitl',
25
+ code: SLACK_HITL_TIMEOUT_ERROR_CODE,
26
+ origin: 'deepline',
27
+ category: 'conflict',
28
+ retryable: false,
29
+ statusCode: 408,
30
+ requestId: null,
31
+ retryAfterMs: null,
32
+ networkKind: null,
33
+ networkScope: null,
34
+ });
35
+ this.name = 'SlackHitlTimeoutError';
36
+ }
37
+ }
@@ -442,7 +442,12 @@ function truncateStaticSubstepsForStorage(
442
442
  columns: base.columns
443
443
  ? base.columns.map((column) => ({
444
444
  ...column,
445
- producers: column.producers.map((producer) => ({
445
+ // `producers` was added after some persisted runtime Sheet
446
+ // contracts already existed. It is descriptive provenance, not
447
+ // required to identify or persist a Sheet column, so normalize
448
+ // a legacy omission to its semantic empty value while retaining
449
+ // the original column contract.
450
+ producers: (column.producers ?? []).map((producer) => ({
446
451
  ...omitUndefinedProperties({ ...producer }),
447
452
  sourceRange: cloneStorageSafeSourceRange(producer.sourceRange),
448
453
  steps: producer.steps
@@ -5,7 +5,7 @@ import type { PlayDataset, SerializedPlayDataset } from './dataset';
5
5
  export type ToolResultExecutionMetadata = {
6
6
  idempotent: true;
7
7
  cached: boolean;
8
- source: 'live' | 'checkpoint' | 'cache' | 'in_flight';
8
+ source: 'live' | 'checkpoint' | 'cache' | 'in_flight' | 'source_run';
9
9
  cacheKey?: string;
10
10
  receiptRole?: 'owner' | 'follower';
11
11
  receiptKey?: string;
@@ -72,10 +72,16 @@ export type ProductNotificationTrigger =
72
72
  export type ProductNotificationDeliveryTiming =
73
73
  | { mode: 'immediate' }
74
74
  | {
75
- mode: 'immediate_first' | 'digest_only';
75
+ mode: 'immediate_first' | 'digest_only' | 'rolling_limit';
76
76
  windowMs: number;
77
77
  };
78
78
 
79
+ export const DEFAULT_PRODUCT_NOTIFICATION_DELIVERY_TIMING: ProductNotificationDeliveryTiming =
80
+ {
81
+ mode: 'rolling_limit',
82
+ windowMs: 3_600_000,
83
+ };
84
+
79
85
  export type ProductNotificationRepeatMode = 'on_enter' | 'every_match';
80
86
 
81
87
  export type ProductNotificationDefaultPolicy = {
@@ -3,6 +3,7 @@ import {
3
3
  validateProductNotificationRuleDefinition,
4
4
  } from './catalog';
5
5
  import {
6
+ DEFAULT_PRODUCT_NOTIFICATION_DELIVERY_TIMING,
6
7
  resolveEffectiveProductNotificationConfiguration,
7
8
  validateProductNotificationDeliveryTiming,
8
9
  type ProductNotificationDefaultPolicy,
@@ -13,13 +14,13 @@ import {
13
14
  * they create sparse copy-on-write overrides.
14
15
  */
15
16
  export const CURRENT_PRODUCT_NOTIFICATION_DEFAULT_POLICY = {
16
- version: 4,
17
+ version: 5,
17
18
  groups: [
18
19
  {
19
20
  groupKey: 'default',
20
21
  name: 'Default Notifications',
21
22
  enabled: true,
22
- deliveryTiming: { mode: 'immediate' },
23
+ deliveryTiming: DEFAULT_PRODUCT_NOTIFICATION_DELIVERY_TIMING,
23
24
  },
24
25
  ],
25
26
  destinations: [
@@ -0,0 +1,18 @@
1
+ export const NOTIFICATION_GROUP_WINDOW_MS = 60 * 60_000;
2
+ export const NOTIFICATION_GROUP_HOURLY_LIMIT = 10;
3
+ const DIGEST_ITEM_LIMIT = 100;
4
+ // Bound the whole preview so 100 entries fit within a Convex document.
5
+ const DIGEST_PREVIEW_CHARACTERS = 1_000;
6
+
7
+ type OverflowItem = { ruleKey: string; summary: string };
8
+
9
+ export function appendGroupOverflowItem(
10
+ previous: readonly OverflowItem[],
11
+ item: OverflowItem,
12
+ ): OverflowItem[] {
13
+ const summary =
14
+ item.summary.length <= DIGEST_PREVIEW_CHARACTERS
15
+ ? item.summary
16
+ : `${item.summary.slice(0, DIGEST_PREVIEW_CHARACTERS - 1)}…`;
17
+ return [...previous, { ...item, summary }].slice(-DIGEST_ITEM_LIMIT);
18
+ }
@@ -0,0 +1,24 @@
1
+ export const NOTIFICATION_RULE_IMMEDIATE_LIMIT = 10;
2
+
3
+ /** Admit below the rolling limit; otherwise anchor the digest to its oldest admission. */
4
+ export function admitRollingNotification(
5
+ admittedAt: readonly number[],
6
+ now: number,
7
+ windowMs: number,
8
+ limit: number,
9
+ ): { admittedAt: number[]; digestAt: number | null } {
10
+ const history = [...admittedAt].sort((left, right) => left - right);
11
+ const inWindow = history.filter((time) => time > now - windowMs);
12
+ if (inWindow.length >= limit) {
13
+ return {
14
+ admittedAt: history,
15
+ digestAt: inWindow[inWindow.length - limit]! + windowMs,
16
+ };
17
+ }
18
+ return {
19
+ admittedAt: [...history, now]
20
+ .sort((left, right) => left - right)
21
+ .slice(-limit),
22
+ digestAt: null,
23
+ };
24
+ }