deepline 0.3.88 → 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 (280) hide show
  1. package/contracts/install-commands.json +29 -0
  2. package/dist/bundling-sources/sdk/src/client.ts +652 -39
  3. package/dist/bundling-sources/sdk/src/config.ts +77 -0
  4. package/dist/bundling-sources/sdk/src/http.ts +76 -30
  5. package/dist/bundling-sources/sdk/src/index.ts +10 -0
  6. package/dist/bundling-sources/sdk/src/monitor-fleet-contract.ts +1 -1
  7. package/dist/bundling-sources/sdk/src/pagination.ts +25 -0
  8. package/dist/bundling-sources/sdk/src/play.ts +15 -1
  9. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +3 -3
  10. package/dist/bundling-sources/sdk/src/release.ts +16 -9
  11. package/dist/bundling-sources/sdk/src/types.ts +106 -4
  12. package/dist/bundling-sources/shared_libs/integration-contracts/AGENTS.md +9 -0
  13. package/dist/bundling-sources/shared_libs/integration-contracts/README.md +3 -0
  14. package/dist/bundling-sources/shared_libs/integration-contracts/index.ts +2 -0
  15. package/dist/bundling-sources/shared_libs/monitors/analytics-install-guides.ts +77 -0
  16. package/dist/bundling-sources/shared_libs/monitors/analytics-public.ts +10 -0
  17. package/dist/bundling-sources/shared_libs/monitors/billing/charges.ts +125 -0
  18. package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +686 -0
  19. package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +54 -0
  20. package/dist/bundling-sources/shared_libs/monitors/billing/public-pricing.ts +72 -0
  21. package/dist/bundling-sources/shared_libs/monitors/billing/session.ts +45 -0
  22. package/dist/bundling-sources/shared_libs/monitors/billing/state.ts +454 -0
  23. package/dist/bundling-sources/shared_libs/monitors/billing/tamradar.ts +260 -0
  24. package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +215 -0
  25. package/dist/bundling-sources/shared_libs/monitors/callback-security.ts +333 -0
  26. package/dist/bundling-sources/shared_libs/monitors/cursor-page.ts +42 -0
  27. package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +16 -0
  28. package/dist/bundling-sources/shared_libs/monitors/framework-managed-payload-fields.ts +71 -0
  29. package/dist/bundling-sources/shared_libs/monitors/generated/provider-monitor-callback-admission-targets.ts +16 -0
  30. package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +270 -0
  31. package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +39 -0
  32. package/dist/bundling-sources/shared_libs/monitors/inbound-queue.ts +82 -0
  33. package/dist/bundling-sources/shared_libs/monitors/inventory-reconciliation.ts +59 -0
  34. package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +471 -0
  35. package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +1 -1
  36. package/dist/bundling-sources/shared_libs/monitors/package.json +36 -0
  37. package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +1125 -0
  38. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +305 -0
  39. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +964 -0
  40. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts +56 -0
  41. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +131 -0
  42. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +535 -0
  43. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-legacy-aliases.ts +16 -0
  44. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-priority-execution.ts +56 -0
  45. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +28 -0
  46. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-runtime-read-eligibility.ts +38 -0
  47. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +122 -0
  48. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-status.ts +10 -0
  49. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +112 -0
  50. package/dist/bundling-sources/shared_libs/monitors/provider-webhook-monitor-runtime.ts +300 -0
  51. package/dist/bundling-sources/shared_libs/monitors/quickstart-prompts.ts +22 -0
  52. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +245 -0
  53. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-message.ts +38 -0
  54. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-ack-probe.ts +94 -0
  55. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-delivery.ts +60 -0
  56. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue.ts +60 -0
  57. package/dist/bundling-sources/shared_libs/monitors/snitcher-install-validation.ts +93 -0
  58. package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +332 -0
  59. package/dist/bundling-sources/shared_libs/monitors/snitcher-radar.ts +221 -0
  60. package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +105 -0
  61. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +73 -0
  62. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +81 -0
  63. package/dist/bundling-sources/shared_libs/monitors/tsconfig.json +10 -0
  64. package/dist/bundling-sources/shared_libs/observability/build-context.ts +13 -0
  65. package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +160 -0
  66. package/dist/bundling-sources/shared_libs/observability/request-context.ts +68 -0
  67. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +654 -0
  68. package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +35 -0
  69. package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +5 -0
  70. package/dist/bundling-sources/shared_libs/play-data-plane/neon-constants.ts +9 -0
  71. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +272 -0
  72. package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +6 -11
  73. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +135 -12
  74. package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +66 -1
  75. package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +77 -0
  76. package/dist/bundling-sources/shared_libs/play-runtime/bounceban-batching.ts +137 -0
  77. package/dist/bundling-sources/shared_libs/play-runtime/checkpoint-boundaries.ts +70 -0
  78. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +1159 -166
  79. package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +1 -32
  80. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +103 -0
  81. package/dist/bundling-sources/shared_libs/play-runtime/daytona-payload-contract.ts +68 -0
  82. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +103 -0
  83. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +725 -0
  84. package/dist/bundling-sources/shared_libs/play-runtime/default-batch-strategies.ts +20 -1
  85. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +29 -0
  86. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +29 -0
  87. package/dist/bundling-sources/shared_libs/play-runtime/execution-gateway-invocation-fence.ts +442 -0
  88. package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +7 -1
  89. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +18 -0
  90. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +9 -0
  91. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +1 -1
  92. package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +1 -1
  93. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/contracts.ts +66 -0
  94. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/job.ts +145 -0
  95. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/ports.ts +21 -0
  96. package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/postgres-store.ts +170 -0
  97. package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +1322 -0
  98. package/dist/bundling-sources/shared_libs/play-runtime/internal-step-ids.ts +2 -2
  99. package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +189 -0
  100. package/dist/bundling-sources/shared_libs/play-runtime/launch-source-policy.ts +112 -0
  101. package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +8 -0
  102. package/dist/bundling-sources/shared_libs/play-runtime/perf-trace.ts +127 -0
  103. package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +5 -0
  104. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
  105. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/contracts.ts +56 -0
  106. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/index.ts +13 -0
  107. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/job.ts +41 -0
  108. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/ports.ts +17 -0
  109. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/postgres-adapter.ts +54 -0
  110. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/contracts.ts +114 -0
  111. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/engine-suspension.ts +108 -0
  112. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/index.ts +36 -0
  113. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/job.ts +97 -0
  114. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/ports.ts +104 -0
  115. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/postgres-fence-adapter.ts +263 -0
  116. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/worker-terminal-projection.ts +64 -0
  117. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/contracts.ts +29 -0
  118. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +56 -0
  119. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/index.ts +15 -0
  120. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/job.ts +65 -0
  121. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/ports.ts +17 -0
  122. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +42 -0
  123. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/index.ts +17 -0
  124. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +142 -0
  125. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/ports.ts +42 -0
  126. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/postgres-adapter.ts +102 -0
  127. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/contracts.ts +60 -0
  128. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/index.ts +16 -0
  129. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/job.ts +78 -0
  130. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/ports.ts +54 -0
  131. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/postgres-adapter.ts +71 -0
  132. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +4 -0
  133. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +28 -0
  134. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +4 -0
  135. package/dist/bundling-sources/shared_libs/play-runtime/receipt-status.ts +5 -8
  136. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +23 -2
  137. package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +168 -0
  138. package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +1 -1
  139. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +90 -13
  140. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +6 -12
  141. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-start-admission.ts +68 -0
  142. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +21 -0
  143. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/bundle.ts +0 -1
  144. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +14 -43
  145. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +67 -213
  146. package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +201 -0
  147. package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +20 -0
  148. package/dist/bundling-sources/shared_libs/play-runtime/runtime-contract.ts +6 -0
  149. package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +12 -0
  150. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +67 -0
  151. package/dist/bundling-sources/shared_libs/play-runtime/runtime-release-environment.ts +2 -0
  152. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +68 -0
  153. package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +38 -2
  154. package/dist/bundling-sources/shared_libs/play-runtime/runtime-telemetry.ts +108 -0
  155. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -0
  156. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +3 -0
  157. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +37 -1
  158. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +88 -0
  159. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-deploy-task.ts +124 -0
  160. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-run-task.ts +68 -0
  161. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +193 -0
  162. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-lifecycle.ts +269 -0
  163. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-suffix.ts +73 -0
  164. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +6642 -0
  165. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +897 -0
  166. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-metrics.ts +120 -0
  167. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +76 -0
  168. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +476 -0
  169. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-heavy-request-admission.ts +47 -0
  170. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-progress-registry.ts +147 -0
  171. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/index.ts +27 -0
  172. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/lazy.ts +50 -0
  173. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/play-run-recovery.ts +98 -0
  174. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-budget-state.ts +260 -0
  175. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +1416 -0
  176. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1255 -0
  177. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +942 -0
  178. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +14636 -0
  179. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +888 -0
  180. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +355 -0
  181. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-terminal-transition.ts +46 -0
  182. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runner-push.ts +60 -0
  183. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +33 -0
  184. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-gateway-health.ts +64 -0
  185. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +835 -0
  186. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +1218 -0
  187. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +207 -0
  188. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-scheduler-schema.ts +10 -0
  189. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-capacity.ts +123 -0
  190. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-launch-read-observability.ts +78 -0
  191. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/submit-admission.ts +169 -0
  192. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/terminal-contract.ts +20 -0
  193. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-queue-metrics.ts +34 -0
  194. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-resource-metrics.ts +249 -0
  195. package/dist/bundling-sources/shared_libs/play-runtime/sheet-attempt-sql.ts +7 -0
  196. package/dist/bundling-sources/shared_libs/play-runtime/step-progress.ts +296 -0
  197. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/native-batch.ts +3 -3
  198. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts +20 -1
  199. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +60 -15
  200. package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +20 -0
  201. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +1 -1
  202. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +1 -1
  203. package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +12 -0
  204. package/dist/bundling-sources/shared_libs/play-runtime/vercel-protection.ts +14 -1
  205. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +165 -0
  206. package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +15 -23
  207. package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +169 -0
  208. package/dist/bundling-sources/shared_libs/play-runtime/zerobounce-batching.ts +122 -0
  209. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +8 -3
  210. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +454 -17
  211. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +19 -4
  212. package/dist/bundling-sources/shared_libs/plays/contracts.ts +8 -14
  213. package/dist/bundling-sources/shared_libs/plays/core.ts +11 -6
  214. package/dist/bundling-sources/shared_libs/plays/deployment-status.ts +1 -1
  215. package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +16 -11
  216. package/dist/bundling-sources/shared_libs/plays/docflow.ts +1 -1
  217. package/dist/bundling-sources/shared_libs/plays/email-status.ts +1 -1
  218. package/dist/bundling-sources/shared_libs/plays/play-grep-search.ts +39 -0
  219. package/dist/bundling-sources/shared_libs/plays/resolve-static-pipeline.ts +1 -1
  220. package/dist/bundling-sources/shared_libs/plays/share/copy.ts +271 -0
  221. package/dist/bundling-sources/shared_libs/plays/share/metrics.ts +140 -0
  222. package/dist/bundling-sources/shared_libs/plays/share/public-read-model.ts +86 -0
  223. package/dist/bundling-sources/shared_libs/plays/share/seo-quality.ts +181 -0
  224. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +658 -0
  225. package/dist/bundling-sources/shared_libs/plays/share/types.ts +197 -0
  226. package/dist/bundling-sources/shared_libs/plays/slack-hitl-timeout-error.ts +37 -0
  227. package/dist/bundling-sources/shared_libs/plays/slug.ts +115 -0
  228. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +50 -15
  229. package/dist/bundling-sources/shared_libs/plays/tool-category-descriptions.ts +2 -2
  230. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
  231. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +877 -0
  232. package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +456 -0
  233. package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +566 -0
  234. package/dist/bundling-sources/shared_libs/product-notifications/content.ts +28 -0
  235. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +60 -0
  236. package/dist/bundling-sources/shared_libs/product-notifications/email.ts +246 -0
  237. package/dist/bundling-sources/shared_libs/product-notifications/evaluation.ts +280 -0
  238. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +433 -0
  239. package/dist/bundling-sources/shared_libs/product-notifications/legacy-slack.ts +80 -0
  240. package/dist/bundling-sources/shared_libs/product-notifications/overflow.ts +18 -0
  241. package/dist/bundling-sources/shared_libs/product-notifications/rolling-limit.ts +24 -0
  242. package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +624 -0
  243. package/dist/bundling-sources/shared_libs/product-notifications/slack-payload.ts +140 -0
  244. package/dist/bundling-sources/shared_libs/product-notifications/slack-transport.ts +75 -0
  245. package/dist/bundling-sources/shared_libs/product-notifications/workspace.ts +38 -0
  246. package/dist/bundling-sources/shared_libs/runtime-env.ts +12 -0
  247. package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +42 -0
  248. package/dist/bundling-sources/shared_libs/security/header-safe-env.ts +35 -0
  249. package/dist/bundling-sources/shared_libs/security/internal-actor.ts +50 -0
  250. package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +267 -0
  251. package/dist/bundling-sources/shared_libs/security/slack-sanitize.ts +133 -0
  252. package/dist/cli/getting-started.d.mts +52 -0
  253. package/dist/cli/getting-started.d.ts +52 -0
  254. package/dist/cli/getting-started.js +65 -0
  255. package/dist/cli/getting-started.mjs +36 -0
  256. package/dist/cli/index.d.mts +9 -0
  257. package/dist/cli/index.d.ts +9 -0
  258. package/dist/cli/index.js +1611 -453
  259. package/dist/cli/index.mjs +1596 -447
  260. package/dist/{compiler-manifest-Dbov16F7.d.mts → compiler-manifest-BaJfE-5H.d.mts} +136 -10
  261. package/dist/{compiler-manifest-Dbov16F7.d.ts → compiler-manifest-BaJfE-5H.d.ts} +136 -10
  262. package/dist/index.d.mts +910 -155
  263. package/dist/index.d.ts +910 -155
  264. package/dist/index.js +550 -64
  265. package/dist/index.mjs +550 -64
  266. package/dist/install-integrity.json +193 -4
  267. package/dist/monitor-fleet-contract.d.mts +138 -0
  268. package/dist/monitor-fleet-contract.d.ts +138 -0
  269. package/dist/monitor-fleet-contract.js +404 -0
  270. package/dist/monitor-fleet-contract.mjs +367 -0
  271. package/dist/plays/bundle-play-file.d.mts +8 -3
  272. package/dist/plays/bundle-play-file.d.ts +8 -3
  273. package/dist/plays/bundle-play-file.mjs +100 -20
  274. package/dist/release.d.mts +255 -0
  275. package/dist/release.d.ts +255 -0
  276. package/dist/release.js +215 -0
  277. package/dist/release.mjs +188 -0
  278. package/package.json +23 -4
  279. /package/dist/bundling-sources/shared_libs/{integrations/bettercontact-execution-policy.ts → integration-contracts/bettercontact/execution-policy.ts} +0 -0
  280. /package/dist/bundling-sources/shared_libs/{integrations/theirstack-execution-policy.ts → integration-contracts/theirstack/execution-policy.ts} +0 -0
@@ -49,6 +49,12 @@ export const HOST_URL_ENV = 'DEEPLINE_HOST_URL';
49
49
  export const API_KEY_ENV = 'DEEPLINE_API_KEY';
50
50
  export const ACTIVE_ORG_ID_ENV = 'DEEPLINE_ACTIVE_ORG_ID';
51
51
  export const ACTIVE_ORG_NAME_ENV = 'DEEPLINE_ACTIVE_ORG_NAME';
52
+ /**
53
+ * Comma-separated gated feature keys the server reported for the active
54
+ * workspace (`github-deploy`, …). Refreshed whenever credentials are saved;
55
+ * the CLI hides gated command groups whose key is absent.
56
+ */
57
+ export const FEATURES_ENV = 'DEEPLINE_FEATURES';
52
58
 
53
59
  /** Production API base URL. */
54
60
  const PROD_URL = 'https://code.deepline.com';
@@ -83,8 +89,70 @@ const CLI_ENV_ALLOWED_KEYS = new Set([
83
89
  API_KEY_ENV,
84
90
  ACTIVE_ORG_ID_ENV,
85
91
  ACTIVE_ORG_NAME_ENV,
92
+ FEATURES_ENV,
86
93
  ]);
87
94
 
95
+ /** Env line for a server-reported `features` list; absent input writes nothing. */
96
+ export function featureEnvValues(data: {
97
+ features?: unknown;
98
+ }): Record<string, string> {
99
+ if (!Array.isArray(data.features)) return {};
100
+ return {
101
+ [FEATURES_ENV]: data.features
102
+ .filter(
103
+ (key): key is string => typeof key === 'string' && key.trim() !== '',
104
+ )
105
+ .map((key) => key.trim())
106
+ .join(','),
107
+ };
108
+ }
109
+
110
+ /** The API key saved in the host's global credentials, or '' when none. */
111
+ export function storedHostApiKey(baseUrl: string): string {
112
+ return loadCliEnv(normalizeBaseUrl(baseUrl) || baseUrl)[API_KEY_ENV] ?? '';
113
+ }
114
+
115
+ /** The raw features line saved with the host's global credentials, if any. */
116
+ export function storedHostFeatures(baseUrl: string): string | undefined {
117
+ return loadCliEnv(normalizeBaseUrl(baseUrl) || baseUrl)[FEATURES_ENV];
118
+ }
119
+
120
+ /** Whether a stored features list names `feature`. */
121
+ export function envHasFeature(env: EnvValues, feature: string): boolean {
122
+ return (env[FEATURES_ENV] ?? '')
123
+ .split(',')
124
+ .map((key) => key.trim())
125
+ .includes(feature);
126
+ }
127
+
128
+ /**
129
+ * Whether the active workspace was last seen with `feature` enabled. Reads
130
+ * the same credential sources, in the same order, as the API key: process
131
+ * env, the folder credentials pinned to the resolved host, then the host's
132
+ * global credentials. A host that cannot be resolved counts as no feature.
133
+ */
134
+ export function cliFeatureEnabled(feature: string): boolean {
135
+ const processEnv = process.env as EnvValues;
136
+ if (envHasFeature(processEnv, feature)) return true;
137
+ // A process-env key wins for API calls, so only process-env features may
138
+ // describe it: a stored file's list belongs to a different credential.
139
+ if (processEnv[API_KEY_ENV]?.trim()) return false;
140
+ try {
141
+ const baseUrl = resolveBaseUrlOnly();
142
+ // The credential source that supplies the key also owns the features:
143
+ // a folder credential with no features line means "none", never "ask
144
+ // the global file", which may belong to a different workspace.
145
+ const projectEnv = loadProjectEnvCandidates().find(
146
+ ({ env }) =>
147
+ normalizeBaseUrl(env[HOST_URL_ENV] ?? '') === baseUrl &&
148
+ Boolean(env[API_KEY_ENV]),
149
+ );
150
+ return envHasFeature(projectEnv?.env ?? loadCliEnv(baseUrl), feature);
151
+ } catch {
152
+ return false;
153
+ }
154
+ }
155
+
88
156
  export type CliCommandContext = {
89
157
  active_organization: {
90
158
  org_id: string;
@@ -402,6 +470,12 @@ function mergePersistedEnvValues(
402
470
  ) {
403
471
  delete merged[ACTIVE_ORG_ID_ENV];
404
472
  delete merged[ACTIVE_ORG_NAME_ENV];
473
+ delete merged[FEATURES_ENV];
474
+ }
475
+ // An explicit empty features list means "none": drop the stale line
476
+ // rather than keeping the previous workspace's features around.
477
+ if (values[FEATURES_ENV] === '') {
478
+ delete merged[FEATURES_ENV];
405
479
  }
406
480
  return merged;
407
481
  }
@@ -582,6 +656,9 @@ export function resolveConfig(options?: DeeplineClientOptions): ResolvedConfig {
582
656
  baseUrl,
583
657
  timeout: options?.timeout ?? DEFAULT_TIMEOUT,
584
658
  maxRetries: options?.maxRetries ?? DEFAULT_MAX_RETRIES,
659
+ // Pass through untouched: the transport owns case-insensitive merging so
660
+ // there is exactly one place that decides which header wins.
661
+ ...(options?.headers ? { headers: { ...options.headers } } : {}),
585
662
  };
586
663
  }
587
664
 
@@ -104,6 +104,31 @@ function normalizeRequestAbortError(
104
104
  return normalized;
105
105
  }
106
106
 
107
+ /**
108
+ * Merge caller-supplied headers over everything the transport already derived
109
+ * from the environment, so an explicitly passed header always wins.
110
+ *
111
+ * HTTP header names are case-insensitive, so an existing header is removed by
112
+ * case-insensitive match before the normalized lowercase name is set. Without
113
+ * that, `Authorization` and `authorization` would both survive into the record
114
+ * and `new Headers(record)` would concatenate the two values.
115
+ */
116
+ function applyExplicitHeaders(
117
+ headers: Record<string, string>,
118
+ explicit: Record<string, string> | undefined,
119
+ ): Record<string, string> {
120
+ if (!explicit) return headers;
121
+ for (const [rawName, value] of Object.entries(explicit)) {
122
+ const name = rawName.trim().toLowerCase();
123
+ if (!name) continue;
124
+ for (const existing of Object.keys(headers)) {
125
+ if (existing.toLowerCase() === name) delete headers[existing];
126
+ }
127
+ headers[name] = value;
128
+ }
129
+ return headers;
130
+ }
131
+
107
132
  function isAbortLikeError(error: Error): boolean {
108
133
  const name = error.name.toLowerCase();
109
134
  const message = error.message.toLowerCase();
@@ -114,6 +139,17 @@ function isAbortLikeError(error: Error): boolean {
114
139
  );
115
140
  }
116
141
 
142
+ function withErrorCause<T extends Error>(error: T, cause: unknown): T {
143
+ if (cause !== null && cause !== undefined) {
144
+ Object.defineProperty(error, 'cause', {
145
+ value: cause,
146
+ configurable: true,
147
+ writable: true,
148
+ });
149
+ }
150
+ return error;
151
+ }
152
+
117
153
  function mapNetworkError(
118
154
  baseUrl: string,
119
155
  error: Error | null,
@@ -312,7 +348,11 @@ export class HttpClient {
312
348
  headers[COORDINATOR_INTERNAL_TOKEN_HEADER] =
313
349
  coordinatorInternalToken.trim();
314
350
  }
315
- return headers;
351
+ // Explicit client-option headers (e.g. `deepline plays run --header`) are
352
+ // applied last so an operator can override an env-derived header without
353
+ // rewriting the environment. Authorization of these headers stays
354
+ // server-side.
355
+ return applyExplicitHeaders(headers, this.config.headers);
316
356
  }
317
357
 
318
358
  /**
@@ -540,37 +580,43 @@ export class HttpClient {
540
580
  );
541
581
  if (options?.toolId) {
542
582
  const code = mappedNetworkError.code;
543
- throw new ToolExecutionError(
544
- withCoworkNetworkHint(mappedNetworkError.message),
545
- {
546
- toolId: options.toolId,
547
- provider: providerLabelFromToolId(options.toolId),
548
- operation: options.toolId,
549
- code,
550
- origin: 'deepline',
551
- category: 'network',
552
- // A direct client timeout has ambiguous delivery. Fail closed unless
553
- // the server returns the authoritative action delivery contract.
554
- retryable: false,
555
- statusCode: null,
556
- requestId: null,
557
- retryAfterMs: null,
558
- networkKind:
559
- code === 'NETWORK_TIMEOUT'
560
- ? 'timeout'
561
- : code === 'NETWORK_ABORTED'
562
- ? 'unknown'
563
- : 'unavailable',
564
- networkScope: 'client_to_deepline',
565
- details: mappedNetworkError.details,
566
- },
583
+ throw withErrorCause(
584
+ new ToolExecutionError(
585
+ withCoworkNetworkHint(mappedNetworkError.message),
586
+ {
587
+ toolId: options.toolId,
588
+ provider: providerLabelFromToolId(options.toolId),
589
+ operation: options.toolId,
590
+ code,
591
+ origin: 'deepline',
592
+ category: 'network',
593
+ // A direct client timeout has ambiguous delivery. Fail closed unless
594
+ // the server returns the authoritative action delivery contract.
595
+ retryable: false,
596
+ statusCode: null,
597
+ requestId: null,
598
+ retryAfterMs: null,
599
+ networkKind:
600
+ code === 'NETWORK_TIMEOUT'
601
+ ? 'timeout'
602
+ : code === 'NETWORK_ABORTED'
603
+ ? 'unknown'
604
+ : 'unavailable',
605
+ networkScope: 'client_to_deepline',
606
+ details: mappedNetworkError.details,
607
+ },
608
+ ),
609
+ lastError,
567
610
  );
568
611
  }
569
- throw new DeeplineError(
570
- withCoworkNetworkHint(mappedNetworkError.message),
571
- undefined,
572
- mappedNetworkError.code,
573
- mappedNetworkError.details,
612
+ throw withErrorCause(
613
+ new DeeplineError(
614
+ withCoworkNetworkHint(mappedNetworkError.message),
615
+ undefined,
616
+ mappedNetworkError.code,
617
+ mappedNetworkError.details,
618
+ ),
619
+ lastError,
574
620
  );
575
621
  }
576
622
 
@@ -94,11 +94,16 @@ export type {
94
94
  MonitorFleetWaitOptions,
95
95
  MonitorFleetResult,
96
96
  MonitorFleetsNamespace,
97
+ CreateNotificationGroupInput,
98
+ CreateNotificationGroupResult,
97
99
  IngestionStorageRepairResult,
98
100
  PlayStatus,
99
101
  PlaySheetRow,
100
102
  PlaySheetRowsResult,
101
103
  RunsListOptions,
104
+ RunsListPage,
105
+ PlaysListOptions,
106
+ PlaysListPage,
102
107
  RunsLogsOptions,
103
108
  RunsLogsResult,
104
109
  RunsNamespace,
@@ -232,6 +237,7 @@ export type {
232
237
  PublishPlayVersionRequest,
233
238
  PublishPlayVersionResult,
234
239
  StartPlayRunRequest,
240
+ PlayCostEstimate,
235
241
  PlayListItem,
236
242
  CustomerDbQueryResult,
237
243
  DeeplineToolCategory,
@@ -270,6 +276,10 @@ export type {
270
276
  PlayDatasetInput,
271
277
  PlayCallExecution,
272
278
  PlayCallOptions,
279
+ PlayAsyncCallOptions,
280
+ AsyncPlayRunRef,
281
+ PlayRunId,
282
+ PlayReferenceLike,
273
283
  PlayFetchResponse,
274
284
  RuntimeStepOptions,
275
285
  FetchOptions,
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The fleet member ceiling, mirrored — deliberately a literal.
3
3
  *
4
- * The canonical declaration is shared_libs/monitors/monitor-fleet-limits.ts,
4
+ * The canonical declaration is packages/monitors/monitor-fleet-limits.ts,
5
5
  * which the Convex commit mutation reads to size its transaction. This package
6
6
  * cannot import it: the workspace-architecture ratchet forbids NEW shared_libs
7
7
  * imports from packages absolutely (only relocations of pre-existing edges
@@ -0,0 +1,25 @@
1
+ /** Walk bounded cursor pages without reporting a partial result as complete. */
2
+ export async function* iterateCursorPages<T>(
3
+ fetchPage: (cursor: string | null) => Promise<{
4
+ items: T[];
5
+ hasMore: boolean;
6
+ cursor: string | null;
7
+ }>,
8
+ ): AsyncGenerator<T[]> {
9
+ let cursor: string | null = null;
10
+ const seen = new Set<string>();
11
+ for (;;) {
12
+ const page = await fetchPage(cursor);
13
+ if (page.hasMore) {
14
+ if (!page.cursor || seen.has(page.cursor)) {
15
+ throw new Error(
16
+ 'Pagination reported more results without an advancing cursor',
17
+ );
18
+ }
19
+ seen.add(page.cursor);
20
+ }
21
+ yield page.items;
22
+ if (!page.hasMore) return;
23
+ cursor = page.cursor;
24
+ }
25
+ }
@@ -113,6 +113,9 @@ import type { ToolExecution } from './client.js';
113
113
  import type {
114
114
  DurableCallStaleAfterSeconds,
115
115
  PlayAuthoringBindings,
116
+ AsyncPlayRunRef as PlayAuthoringAsyncPlayRunRef,
117
+ PlayAuthoringAsyncCallOptions,
118
+ PlayRunId as PlayAuthoringRunId,
116
119
  PlayAuthoringCallExecution,
117
120
  PlayAuthoringCallOptions,
118
121
  PlayAuthoringColumnResolver,
@@ -676,7 +679,18 @@ export type PrebuiltPlayRef = {
676
679
  readonly name: string;
677
680
  };
678
681
 
679
- export type PlayReferenceLike = PlayAuthoringReferenceLike;
682
+ export type PlayReferenceLike<
683
+ TInput extends Record<string, unknown> = Record<string, unknown>,
684
+ > = PlayAuthoringReferenceLike<TInput>;
685
+
686
+ /** Branded durable identity returned by ctx.runPlayAsync. */
687
+ export type PlayRunId = PlayAuthoringRunId;
688
+
689
+ /** Serializable reference to an independently scheduled Play Run. */
690
+ export type AsyncPlayRunRef = PlayAuthoringAsyncPlayRunRef;
691
+
692
+ /** Author intent for an independently scheduled child Run. */
693
+ export type PlayAsyncCallOptions = PlayAuthoringAsyncCallOptions;
680
694
 
681
695
  export type {
682
696
  PlayDataset,
@@ -40,7 +40,7 @@ export type {
40
40
 
41
41
  export { extractDefinedPlayName } from '../../../shared_libs/plays/bundling/index.js';
42
42
 
43
- const PLAY_BUNDLE_CACHE_VERSION = 35;
43
+ const PLAY_BUNDLE_CACHE_VERSION = 37;
44
44
  const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
45
45
  const SDK_PACKAGE_ROOT = resolve(MODULE_DIR, '..', '..');
46
46
  const SOURCE_REPO_ROOT = resolve(SDK_PACKAGE_ROOT, '..', '..');
@@ -84,12 +84,12 @@ let hasWarnedAboutNonDevelopmentBundling = false;
84
84
  * The SDK's job is to turn a local play file into a portable artifact using
85
85
  * only SDK/runtime sources. It must work for installed packages, source
86
86
  * checkouts, CI smoke jobs, and clean worktrees without app-generated files
87
- * such as `src/lib/generated/tool-typecheck-catalog.jsonl`.
87
+ * such as `packages/integrations/generated/tool-typecheck-catalog.jsonl`.
88
88
  *
89
89
  * Tool-aware validation belongs to the Deepline API after upload:
90
90
  * `compilePlayManifest` / server preflight runs the cloud typechecker inside
91
91
  * the app deployment, where the generated catalog is a normal build artifact.
92
- * Do not import `src/lib/plays/cloud-tool-typecheck` or any generated app
92
+ * Do not import `apps/deepline-api/src/lib/plays/cloud-tool-typecheck` or any generated app
93
93
  * catalog from this SDK adapter.
94
94
  */
95
95
  function warnAboutNonDevelopmentBundling(filePath: string): void {
@@ -23,12 +23,12 @@ import { CURRENT_PLAY_ARTIFACT_CONTRACT_VERSION } from '../../shared_libs/plays/
23
23
  * Everything else derives from these values:
24
24
  *
25
25
  * - `packages/sdk/src/version.ts` re-exports `SDK_VERSION` and `SDK_API_CONTRACT`.
26
- * - `src/lib/sdk/release-policy.ts` re-exports `SDK_RELEASE_POLICY`.
26
+ * - `apps/deepline-api/src/lib/sdk/release-policy.ts` re-exports `SDK_RELEASE_POLICY`.
27
27
  * - `packages/sdk/package.json` `version` is stamped from `SDK_RELEASE.version` by
28
28
  * `scripts/sync-sdk-package-version.ts`, which runs as part of
29
29
  * `bun run sdk:build`.
30
30
  * - `contracts/sdk-api.manifest.json` is regenerated at build time from
31
- * `src/lib/sdk/api-routes.ts` and the apiContract here; the matching
31
+ * `apps/deepline-api/src/lib/sdk/api-routes.ts` and the apiContract here; the matching
32
32
  * `contracts/sdk-api.manifest.hash` is an ignored local/CI audit artifact.
33
33
  *
34
34
  * Any drift between release source and derived release locations is a
@@ -199,21 +199,28 @@ export const SDK_RELEASE = {
199
199
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
200
200
  // getters keep their established compatibility behavior.
201
201
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
- version: '0.3.88',
202
+ // 0.3.90 is the first deliberately versioned SDK release for API v3. Play
203
+ // grep hard-cuts to the single Convex full-text index; it does not retain a
204
+ // registry/scanner reader for any SDK/API major.
205
+ version: '0.3.90',
203
206
  updateSummary:
204
- 'Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.',
207
+ 'Play grep now uses one source-only Convex full-text index. It no longer scans the registry, pages through the complete indexed match set, and rejects retired grep modes. 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.',
205
208
  packageCapabilities: {
206
209
  updatePreferences: 1,
207
210
  },
208
211
  contracts: {
209
212
  api: {
210
213
  name: 'sdk-http-api',
211
- // API v2 is append-only. A breaking public request/response change needs
212
- // v3 and an explicit v2 support-window decision, never a patch release.
213
- currentMajor: 2,
214
- supportedMajors: [2],
215
- // Accepted only to bridge SDKs released before X-Deepline-API-Major.
214
+ // API v3 hard-cuts Play grep to the canonical Convex index. API v2 stays
215
+ // admitted for the explicit SDK support window, but it selects neither a
216
+ // registry scanner nor another grep reader: every accepted grep request
217
+ // uses the same indexed query and retired flags fail at the API boundary.
218
+ currentMajor: 3,
219
+ supportedMajors: [3, 2],
220
+ // The first wire id is emitted by the current SDK. Remaining ids are
221
+ // accepted only while the API v2 support window is open.
216
222
  legacyWireIds: [
223
+ '2026-09-play-grep-convex-index-hard-cutover',
217
224
  '2026-07-admin-cli-local-cutover',
218
225
  '2026-07-native-monitor-launch-hard-cutover',
219
226
  ],
@@ -19,6 +19,19 @@ import type {
19
19
  PlayBootstrapStageKind,
20
20
  PlayBootstrapTemplate,
21
21
  } from '../../shared_libs/plays/bootstrap-routes';
22
+ import type {
23
+ EffectiveProductNotificationConfiguration,
24
+ ProductNotificationConfigurationChange,
25
+ ProductNotificationDefaultPolicy,
26
+ } from '../../shared_libs/product-notifications/configuration';
27
+ import type { ProductNotificationTypeCatalogItem } from '../../shared_libs/product-notifications/catalog';
28
+
29
+ export type {
30
+ EffectiveProductNotificationConfiguration,
31
+ ProductNotificationConfigurationChange,
32
+ ProductNotificationDefaultPolicy,
33
+ ProductNotificationTypeCatalogItem,
34
+ };
22
35
 
23
36
  // ——————————————————————————————————————————————————————————
24
37
  // Config
@@ -56,6 +69,17 @@ export interface DeeplineClientOptions {
56
69
  timeout?: number;
57
70
  /** Maximum retry attempts for transient failures (network errors, 429s). Default: `3`. */
58
71
  maxRetries?: number;
72
+ /**
73
+ * Extra request headers attached to every request this client sends.
74
+ *
75
+ * They are merged *after* the headers the transport derives from the
76
+ * environment, so an explicit header replaces the env-derived one. Header
77
+ * names match case-insensitively and are normalized to lowercase.
78
+ *
79
+ * This is transport plumbing only: the server still authorizes every
80
+ * internal header it honors.
81
+ */
82
+ headers?: Record<string, string>;
59
83
  }
60
84
 
61
85
  /**
@@ -72,6 +96,12 @@ export interface ResolvedConfig {
72
96
  timeout: number;
73
97
  /** Max retry count for transient failures. */
74
98
  maxRetries: number;
99
+ /**
100
+ * Caller-supplied headers merged over the env-derived headers on every
101
+ * request. Absent unless the caller passed
102
+ * {@link DeeplineClientOptions.headers}.
103
+ */
104
+ headers?: Record<string, string>;
75
105
  }
76
106
 
77
107
  /** Column metadata returned by a customer data query. */
@@ -795,8 +825,9 @@ export interface PlayStatus {
795
825
  /**
796
826
  * Projected settled-charge billing for the run. Returned by `runs.get`.
797
827
  * `totalCredits`/`providerEvents` describe THIS run only; `rollup` (present
798
- * with `--full`) carries the true subtree cost including ctx.runPlay children.
799
- * Deepline credits only — provider spend is never exposed.
828
+ * with `--full`) carries the true subtree cost including independently
829
+ * executing ctx.runPlayAsync descendants. Deepline credits only — provider
830
+ * spend is never exposed.
800
831
  */
801
832
  billing?: RunBillingSummary;
802
833
  /**
@@ -808,14 +839,26 @@ export interface PlayStatus {
808
839
  billingChildCredits?: number;
809
840
  /** True when the child-run billing rollup could not be fully resolved. */
810
841
  billingRollupIncomplete?: boolean;
811
- /** Durable summaries of ctx.runPlay children, returned by `runs.get --full`. */
842
+ /** Durable summaries of ctx.runPlayAsync children, returned by `runs.get --full`. */
812
843
  childRuns?: ChildRunSummary[];
844
+ /**
845
+ * Child Runs grouped by the authored ctx.runPlayAsync launch key. `complete`
846
+ * is false when the bounded response is a lower bound rather than the full
847
+ * direct-child set; use each opaque `runId` to retrieve a child Run.
848
+ */
849
+ childRunProjection?: AsyncChildRunProjection;
813
850
  }
814
851
 
815
- /** One ctx.runPlay child run exposed on the parent's `--full` payload. */
852
+ /** One ctx.runPlayAsync child Run exposed on the parent's `--full` payload. */
816
853
  export interface ChildRunSummary {
817
854
  runId: string;
818
855
  playName?: string | null;
856
+ /** Authored ctx.runPlayAsync key; stable across row fanout. */
857
+ launchKey?: string | null;
858
+ /** Opaque durable identity for one authored invocation. */
859
+ invocationKey?: string | null;
860
+ /** Whether this child uses root-owned Deepline billing attribution. */
861
+ rootBillingOwned?: boolean;
819
862
  status: string;
820
863
  parentRunId?: string | null;
821
864
  rootRunId?: string | null;
@@ -824,6 +867,32 @@ export interface ChildRunSummary {
824
867
  finishedAt?: number | null;
825
868
  }
826
869
 
870
+ export interface AsyncChildRunStatusCounts {
871
+ total: number;
872
+ queued: number;
873
+ active: number;
874
+ waiting: number;
875
+ succeeded: number;
876
+ failed: number;
877
+ cancelled: number;
878
+ unknown: number;
879
+ }
880
+
881
+ export interface AsyncChildRunLaunchProjection {
882
+ launchKey: string | null;
883
+ playName: string | null;
884
+ counts: AsyncChildRunStatusCounts;
885
+ children: ChildRunSummary[];
886
+ }
887
+
888
+ export interface AsyncChildRunProjection {
889
+ kind: 'async_child_runs';
890
+ returnedCount: number;
891
+ complete: boolean;
892
+ counts: AsyncChildRunStatusCounts;
893
+ launches: AsyncChildRunLaunchProjection[];
894
+ }
895
+
827
896
  /**
828
897
  * Rolled-up billing for a run subtree, projected from settled Charge Lifecycle
829
898
  * facts. Deepline credits only — never provider spend.
@@ -1114,6 +1183,28 @@ export interface PlayDefinitionDetail {
1114
1183
  currentPublishedVersion?: number | null;
1115
1184
  }
1116
1185
 
1186
+ export type PlayCostEstimate =
1187
+ | {
1188
+ status: 'available';
1189
+ source: 'observed' | 'static';
1190
+ unit: 'row' | 'run';
1191
+ lowCredits: number;
1192
+ highCredits: number;
1193
+ sampleRunCount: number;
1194
+ basedOnRunId: string | null;
1195
+ modelVersion: string;
1196
+ }
1197
+ | {
1198
+ status: 'unavailable';
1199
+ reason:
1200
+ | 'ambiguous_output_unit'
1201
+ | 'unbounded_loop'
1202
+ | 'unresolved_tool'
1203
+ | 'mixed_run_and_row_costs';
1204
+ message: string;
1205
+ modelVersion: string;
1206
+ };
1207
+
1117
1208
  export interface PlayListItem {
1118
1209
  playKey?: string;
1119
1210
  reference?: string;
@@ -1143,6 +1234,7 @@ export interface PlayListItem {
1143
1234
  liveRevision?: PlayRevisionSummary | null;
1144
1235
  aliases?: string[];
1145
1236
  triggerStatus?: PlayTriggerStatus;
1237
+ costEstimate?: PlayCostEstimate;
1146
1238
  }
1147
1239
 
1148
1240
  /** Additive live trigger state shared by list, get, and describe. */
@@ -1189,6 +1281,16 @@ export interface ProductNotification {
1189
1281
  lastErrorMessage?: string;
1190
1282
  }
1191
1283
 
1284
+ export interface ProductNotificationConfigurationResponse {
1285
+ configuration: EffectiveProductNotificationConfiguration;
1286
+ catalog: readonly ProductNotificationTypeCatalogItem[];
1287
+ slackConnection: {
1288
+ connected: boolean;
1289
+ status: string;
1290
+ connectionId?: string;
1291
+ };
1292
+ }
1293
+
1192
1294
  export interface PlayDescription {
1193
1295
  name: string;
1194
1296
  /** Stable registry key. Same value `plays list` reports for this play. */
@@ -0,0 +1,9 @@
1
+ # Integration Contracts
2
+
3
+ This package is the only integration-owned boundary shared with public clients.
4
+
5
+ - Put a value here only when both `packages/integrations` and a public client such as `packages/sdk` must interpret it identically.
6
+ - Keep contracts pure and dependency-light. Do not import provider runtimes, generated catalogs, credentials, billing implementations, action schemas, or application code.
7
+ - Provider implementations and server-only policy remain in `packages/integrations`.
8
+ - The public SDK bundles this package; it must not acquire a runtime dependency on a private workspace package.
9
+ - Prefer a server-driven protocol over adding provider-specific client knowledge when compatibility permits it.
@@ -0,0 +1,3 @@
1
+ # `@deepline/integration-contracts`
2
+
3
+ Pure contracts that must be interpreted identically by integration runtimes and public clients. Server-only integration code belongs in `packages/integrations`; SDK-only behavior belongs in `packages/sdk`.
@@ -0,0 +1,2 @@
1
+ export * from './bettercontact/execution-policy';
2
+ export * from './theirstack/execution-policy';