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
@@ -0,0 +1,122 @@
1
+ /**
2
+ * The customer-visible state of a monitor. Provider work and audit evidence
3
+ * intentionally live on separate axes; neither may add a third value here.
4
+ */
5
+ export type ProviderMonitorState = 'active' | 'inactive';
6
+
7
+ declare const providerMonitorResourceIdBrand: unique symbol;
8
+
9
+ /**
10
+ * A non-empty provider-owned resource handle. This deliberately says
11
+ * nothing about the provider or its wire format: an adapter is the only
12
+ * layer that knows whether this happens to be a radar, subscription, etc.
13
+ */
14
+ export type ProviderMonitorResourceId = string & {
15
+ readonly [providerMonitorResourceIdBrand]: 'ProviderMonitorResourceId';
16
+ };
17
+
18
+ /** Turn untrusted storage/API input into the proof used by active state. */
19
+ export function providerMonitorResourceId(
20
+ value: string | null | undefined,
21
+ ): ProviderMonitorResourceId | null {
22
+ const normalized = typeof value === 'string' ? value.trim() : '';
23
+ return normalized === '' ? null : (normalized as ProviderMonitorResourceId);
24
+ }
25
+
26
+ /**
27
+ * A provider-neutral proof that this control record has an upstream
28
+ * counterpart. The identifier might be a radar id today and a different
29
+ * provider's resource id tomorrow; callers outside an adapter must never need
30
+ * to know which.
31
+ */
32
+ export type ProviderMonitorResourceBinding =
33
+ | { kind: 'bound'; providerResourceId: ProviderMonitorResourceId }
34
+ | { kind: 'unbound'; providerResourceId: null };
35
+
36
+ /**
37
+ * The state safe to show as a monitor's current operational state.
38
+ *
39
+ * An active intent without a resource is valid *work* (a create is pending or
40
+ * a historical record needs repair), but it is not an active monitor. The
41
+ * discriminated `active` branch therefore proves a non-empty provider id to
42
+ * TypeScript at every API/worker boundary that administers a live resource.
43
+ */
44
+ export type OperationalProviderMonitorState =
45
+ | {
46
+ state: 'active';
47
+ desired: 'active';
48
+ providerResourceId: ProviderMonitorResourceId;
49
+ binding: 'bound';
50
+ }
51
+ | {
52
+ state: 'inactive';
53
+ desired: ProviderMonitorState;
54
+ providerResourceId: string | null;
55
+ binding: 'bound' | 'unbound';
56
+ };
57
+
58
+ export type ActiveOperationalProviderMonitorState = Extract<
59
+ OperationalProviderMonitorState,
60
+ { state: 'active' }
61
+ >;
62
+
63
+ export function providerMonitorOperationalState(input: {
64
+ desired: ProviderMonitorState;
65
+ providerResourceId: string | null | undefined;
66
+ }): OperationalProviderMonitorState {
67
+ const providerResourceId = providerMonitorResourceId(input.providerResourceId);
68
+ if (input.desired === 'active' && providerResourceId !== null) {
69
+ return {
70
+ state: 'active',
71
+ desired: 'active',
72
+ providerResourceId,
73
+ binding: 'bound',
74
+ };
75
+ }
76
+ return {
77
+ state: 'inactive',
78
+ desired: input.desired,
79
+ providerResourceId,
80
+ binding: providerResourceId === null ? 'unbound' : 'bound',
81
+ };
82
+ }
83
+
84
+ /**
85
+ * Runtime boundary for code that is about to publish or administer an active
86
+ * resource. Its return type is the same proof exposed to callers: an active
87
+ * record necessarily has a non-empty, provider-neutral resource id.
88
+ */
89
+ export function requireActiveProviderMonitorBinding(input: {
90
+ providerResourceId: string | null | undefined;
91
+ }): ActiveOperationalProviderMonitorState {
92
+ const operational = providerMonitorOperationalState({
93
+ desired: 'active',
94
+ providerResourceId: input.providerResourceId,
95
+ });
96
+ if (operational.state !== 'active') {
97
+ throw new Error(
98
+ 'An active provider monitor requires a non-empty provider resource id. Keep it pending until upstream provisioning returns one.',
99
+ );
100
+ }
101
+ return operational;
102
+ }
103
+
104
+ /**
105
+ * Translate the historical control-record lifecycle label at the sole
106
+ * compatibility boundary. New code persists `desired` and returns this type;
107
+ * this mapping exists only while the online backfill drains existing rows.
108
+ */
109
+ export function providerMonitorStateForLegacyStatus(
110
+ status: string | undefined,
111
+ ): ProviderMonitorState {
112
+ switch (status) {
113
+ case 'active':
114
+ case 'pending_create':
115
+ case 'replacement_pending':
116
+ case 'replacement_active_old_cleanup_pending':
117
+ case 'replacement_cleanup_failed':
118
+ return 'active';
119
+ default:
120
+ return 'inactive';
121
+ }
122
+ }
@@ -0,0 +1,10 @@
1
+ export type ProviderMonitorStatus =
2
+ | 'replacement_pending'
3
+ | 'replacement_active_old_cleanup_pending'
4
+ | 'replacement_cleanup_failed'
5
+ | 'active'
6
+ | 'disabled'
7
+ | 'deleted'
8
+ | 'deleting'
9
+ | 'error'
10
+ | 'pending_create';
@@ -0,0 +1,112 @@
1
+ // Convex-safe provider monitor identity contract.
2
+ //
3
+ // This deliberately contains only declarative identity metadata and pure
4
+ // normalization. Convex claim mutations import it directly, so it must not
5
+ // pull in the Node-only provider registry, generated OpenAPI loaders, or any
6
+ // deployment runtime. A monitor provider adds its account-unique identity here
7
+ // and declares the same fields on its capability; registry validation keeps the
8
+ // two declarations aligned.
9
+
10
+ export type ProviderMonitorUpstreamIdentityValue = string | null;
11
+
12
+ export type ProviderMonitorUpstreamIdentitySignature = {
13
+ tool: string;
14
+ key: Record<string, ProviderMonitorUpstreamIdentityValue>;
15
+ };
16
+
17
+ type ProviderMonitorUpstreamIdentityField = {
18
+ name: string;
19
+ // A provider runtime payload can use its upstream request name while the
20
+ // public monitor definition uses a clearer field name. Identity backfills
21
+ // use this declarative alias rather than provider-specific conditionals.
22
+ runtimePayloadAliases?: readonly string[];
23
+ };
24
+
25
+ const PROVIDER_MONITOR_UPSTREAM_IDENTITY_FIELDS = {
26
+ 'deepline_native.company_radar': [{ name: 'radar_type' }, { name: 'domain' }],
27
+ 'deepline_native.contact_radar': [
28
+ { name: 'radar_type' },
29
+ { name: 'profile_url' },
30
+ ],
31
+ 'deepline_native.industry_radar': [
32
+ { name: 'radar_type' },
33
+ { name: 'industry', runtimePayloadAliases: ['keyword'] },
34
+ ],
35
+ } as const satisfies Record<
36
+ string,
37
+ readonly ProviderMonitorUpstreamIdentityField[]
38
+ >;
39
+
40
+ function canonicalMonitorTool(tool: string) {
41
+ // Public TamRadar ids existed before the deepline_native hard cutover. Keep
42
+ // their legacy control records in the same claim namespace during migration.
43
+ return tool.startsWith('tamradar.')
44
+ ? `deepline_native.${tool.slice('tamradar.'.length)}`
45
+ : tool;
46
+ }
47
+
48
+ function stableJson(value: unknown): string {
49
+ if (Array.isArray(value)) return `[${value.map(stableJson).join(',')}]`;
50
+ if (value && typeof value === 'object') {
51
+ const entries = Object.entries(value as Record<string, unknown>)
52
+ .filter(([, entry]) => entry !== undefined)
53
+ .sort(([left], [right]) => left.localeCompare(right))
54
+ .map(([key, entry]) => `${JSON.stringify(key)}:${stableJson(entry)}`);
55
+ return `{${entries.join(',')}}`;
56
+ }
57
+ return JSON.stringify(value) ?? 'null';
58
+ }
59
+
60
+ export function normalizeProviderMonitorUpstreamIdentityValue(
61
+ value: unknown,
62
+ ): ProviderMonitorUpstreamIdentityValue {
63
+ if (value === null || value === undefined) return null;
64
+ if (typeof value === 'string') {
65
+ const normalized = value.trim().toLowerCase();
66
+ return normalized || null;
67
+ }
68
+ if (typeof value === 'number' || typeof value === 'boolean') {
69
+ return String(value);
70
+ }
71
+ if (Array.isArray(value)) {
72
+ const normalized = value
73
+ .map(normalizeProviderMonitorUpstreamIdentityValue)
74
+ .filter((entry): entry is string => entry !== null)
75
+ .sort();
76
+ return normalized.length ? normalized.join(',') : null;
77
+ }
78
+ return stableJson(value).toLowerCase();
79
+ }
80
+
81
+ export function providerMonitorUpstreamIdentityFields(tool: string) {
82
+ const canonical = canonicalMonitorTool(tool);
83
+ return PROVIDER_MONITOR_UPSTREAM_IDENTITY_FIELDS[
84
+ canonical as keyof typeof PROVIDER_MONITOR_UPSTREAM_IDENTITY_FIELDS
85
+ ]?.map((field) => field.name);
86
+ }
87
+
88
+ export function providerMonitorUpstreamIdentitySignature(
89
+ tool: string,
90
+ payload: Record<string, unknown> | null | undefined,
91
+ ): ProviderMonitorUpstreamIdentitySignature | null {
92
+ const canonical = canonicalMonitorTool(tool);
93
+ const fields =
94
+ PROVIDER_MONITOR_UPSTREAM_IDENTITY_FIELDS[
95
+ canonical as keyof typeof PROVIDER_MONITOR_UPSTREAM_IDENTITY_FIELDS
96
+ ];
97
+ if (!fields?.length) return null;
98
+ const key: Record<string, ProviderMonitorUpstreamIdentityValue> = {};
99
+ for (const field of fields) {
100
+ const aliases =
101
+ 'runtimePayloadAliases' in field
102
+ ? field.runtimePayloadAliases
103
+ : undefined;
104
+ const value =
105
+ payload?.[field.name] ??
106
+ aliases
107
+ ?.map((alias) => payload?.[alias])
108
+ .find((aliasValue) => aliasValue !== undefined);
109
+ key[field.name] = normalizeProviderMonitorUpstreamIdentityValue(value);
110
+ }
111
+ return { tool: canonical, key };
112
+ }
@@ -0,0 +1,300 @@
1
+ import { randomBytes } from 'node:crypto';
2
+ import { existsSync, readFileSync } from 'node:fs';
3
+ import type { ProviderMonitorCapabilityDefinition } from '@deepline/monitors/provider-monitor-capability';
4
+ import {
5
+ createProviderCallbackSecret,
6
+ MONITOR_CALLBACK_SECRET_HEADER,
7
+ } from '@deepline/monitors/provider-callback-verification';
8
+
9
+ type ProviderMonitorDefinitionLike = {
10
+ key: string;
11
+ name?: string;
12
+ payload?: Record<string, unknown>;
13
+ };
14
+
15
+ const DEFAULT_MONITOR_CALLBACK_BASE_URL = 'http://localhost:3000';
16
+ const DEFAULT_PREVIEW_CALLBACK_URL_FILE =
17
+ '.cache/dev/plays-preview-callback-url';
18
+
19
+ function readRecord(value: unknown): Record<string, unknown> {
20
+ return value && typeof value === 'object' && !Array.isArray(value)
21
+ ? (value as Record<string, unknown>)
22
+ : {};
23
+ }
24
+
25
+ function readString(value: unknown) {
26
+ if (typeof value === 'number' && Number.isFinite(value)) return String(value);
27
+ if (typeof value !== 'string') return null;
28
+ const trimmed = value.trim();
29
+ return trimmed || null;
30
+ }
31
+
32
+ function firstString(...values: unknown[]) {
33
+ for (const value of values) {
34
+ const string = readString(value);
35
+ if (string) return string;
36
+ }
37
+ return null;
38
+ }
39
+
40
+ function isAbsoluteFilePath(value: string) {
41
+ return value.startsWith('/') || /^[a-zA-Z]:[\\/]/.test(value);
42
+ }
43
+
44
+ function cwdRelativePath(value: string) {
45
+ return isAbsoluteFilePath(value) ? value : `${process.cwd()}/${value}`;
46
+ }
47
+
48
+ function readPreviewCallbackUrlFile(
49
+ environment: NodeJS.ProcessEnv = process.env,
50
+ ) {
51
+ const configuredPath = environment.DEEPLINE_PREVIEW_CALLBACK_URL_FILE?.trim();
52
+ const filePath = cwdRelativePath(
53
+ configuredPath || DEFAULT_PREVIEW_CALLBACK_URL_FILE,
54
+ );
55
+ try {
56
+ if (!existsSync(filePath)) return null;
57
+ return readString(readFileSync(filePath, 'utf8'));
58
+ } catch {
59
+ return null;
60
+ }
61
+ }
62
+
63
+ function readStringArray(value: unknown) {
64
+ if (!Array.isArray(value)) return [];
65
+ return value
66
+ .map((item) => readString(item))
67
+ .filter((item): item is string => Boolean(item));
68
+ }
69
+
70
+ function readNumberArray(value: unknown) {
71
+ if (!Array.isArray(value)) return [];
72
+ return value.filter(
73
+ (item): item is number =>
74
+ typeof item === 'number' && Number.isInteger(item),
75
+ );
76
+ }
77
+
78
+ function boundedName(value: string, maxLength: number) {
79
+ const normalized = value.replace(/\s+/g, ' ').trim();
80
+ if (normalized.length <= maxLength) return normalized;
81
+ return normalized.slice(0, maxLength).trim();
82
+ }
83
+
84
+ function managedWebhookName(input: {
85
+ definition: ProviderMonitorDefinitionLike;
86
+ provider: string;
87
+ maxLength?: number;
88
+ }) {
89
+ const source = input.definition.name ?? input.definition.key;
90
+ const name = `Deepline ${input.provider} ${source}`;
91
+ return boundedName(name, input.maxLength ?? 80);
92
+ }
93
+
94
+ /**
95
+ * Resolve the externally reachable origin for provider callbacks and durable
96
+ * workers. Local Convex actions need the preview tunnel, not a loopback URL.
97
+ */
98
+ export function resolveProviderMonitorCallbackBaseUrl(
99
+ explicit?: string | null,
100
+ environment: NodeJS.ProcessEnv = process.env,
101
+ ) {
102
+ const baseUrl =
103
+ explicit ||
104
+ environment.DEEPLINE_WORKER_CALLBACK_URL ||
105
+ readPreviewCallbackUrlFile(environment) ||
106
+ environment.WORKTREE_PUBLIC_APP_URL ||
107
+ environment.DEEPLINE_API_BASE_URL ||
108
+ environment.NEXT_PUBLIC_APP_URL ||
109
+ environment.APP_URL ||
110
+ environment.VERCEL_URL ||
111
+ DEFAULT_MONITOR_CALLBACK_BASE_URL;
112
+ return baseUrl.startsWith('http') ? baseUrl : `https://${baseUrl}`;
113
+ }
114
+
115
+ export function createProviderWebhookCallbackToken() {
116
+ return randomBytes(32).toString('hex');
117
+ }
118
+
119
+ export function providerWebhookCallbackPath(input: {
120
+ provider: string;
121
+ orgId: string;
122
+ token: string;
123
+ }) {
124
+ return `/api/v2/monitors/provider-callbacks/webhook/${encodeURIComponent(
125
+ input.provider,
126
+ )}/${encodeURIComponent(input.orgId)}/${encodeURIComponent(input.token)}`;
127
+ }
128
+
129
+ export function buildProviderWebhookCallbackUrl(input: {
130
+ provider: string;
131
+ orgId: string;
132
+ token: string;
133
+ callbackBaseUrl?: string | null;
134
+ }) {
135
+ const baseUrl = resolveProviderMonitorCallbackBaseUrl(input.callbackBaseUrl);
136
+ if (input.provider === 'snitcher') {
137
+ return `${baseUrl.replace(/\/$/, '')}/api/v2/monitors/provider-callbacks/deepline-analytics`;
138
+ }
139
+ return `${baseUrl.replace(/\/$/, '')}${providerWebhookCallbackPath(input)}`;
140
+ }
141
+
142
+ export function readProviderWebhookCallbackUrl(
143
+ payload: Record<string, unknown>,
144
+ ) {
145
+ const webhook = readRecord(payload.webhook);
146
+ return firstString(
147
+ payload.target_url,
148
+ payload.target_hook_url,
149
+ payload.webhook_url,
150
+ webhook.webhook_url,
151
+ );
152
+ }
153
+
154
+ export function extractProviderWebhookId(raw: unknown) {
155
+ const root = readRecord(raw);
156
+ const data = readRecord(root.data);
157
+ const result = readRecord(root.result);
158
+ const resultData = readRecord(result.data);
159
+ const webhook = readRecord(root.webhook);
160
+ const dataWebhook = readRecord(data.webhook);
161
+ const id = readRecord(root.id);
162
+ const dataId = readRecord(data.id);
163
+ const resultDataId = readRecord(resultData.id);
164
+ return firstString(
165
+ root.webhook_id,
166
+ root.webhookId,
167
+ root.hook_id,
168
+ root.hookId,
169
+ root.id,
170
+ root._id,
171
+ data.webhook_id,
172
+ data.webhookId,
173
+ data.hook_id,
174
+ data.hookId,
175
+ data.id,
176
+ data._id,
177
+ result.webhook_id,
178
+ result.webhookId,
179
+ result.hook_id,
180
+ result.hookId,
181
+ result.id,
182
+ result._id,
183
+ resultData.webhook_id,
184
+ resultData.webhookId,
185
+ resultData.hook_id,
186
+ resultData.hookId,
187
+ resultData.id,
188
+ resultData._id,
189
+ webhook.webhook_id,
190
+ webhook.id,
191
+ dataWebhook.webhook_id,
192
+ dataWebhook.id,
193
+ id.webhook_id,
194
+ dataId.webhook_id,
195
+ resultDataId.webhook_id,
196
+ );
197
+ }
198
+
199
+ export function buildProviderWebhookRuntimePayload(input: {
200
+ definition: ProviderMonitorDefinitionLike;
201
+ capability: ProviderMonitorCapabilityDefinition;
202
+ callbackUrl: string;
203
+ }) {
204
+ const payload = input.definition.payload ?? {};
205
+ const provider = input.capability.provider;
206
+ switch (provider) {
207
+ case 'attio':
208
+ return {
209
+ target_url: input.callbackUrl,
210
+ subscriptions: readStringArray(payload.event_types).map(
211
+ (eventType) => ({
212
+ event_type: eventType,
213
+ }),
214
+ ),
215
+ };
216
+ case 'lemlist':
217
+ return {
218
+ target_url: input.callbackUrl,
219
+ type: readString(payload.event_type),
220
+ secret: createProviderCallbackSecret('lemlist'),
221
+ ...(readString(payload.campaign_id)
222
+ ? { campaign_id: readString(payload.campaign_id) }
223
+ : {}),
224
+ };
225
+ case 'instantly':
226
+ return {
227
+ target_hook_url: input.callbackUrl,
228
+ event_type: readString(payload.event_type),
229
+ headers: {
230
+ [MONITOR_CALLBACK_SECRET_HEADER]:
231
+ createProviderCallbackSecret('instantly'),
232
+ },
233
+ name: managedWebhookName({
234
+ definition: input.definition,
235
+ provider,
236
+ }),
237
+ ...(readString(payload.campaign_id)
238
+ ? { campaign: readString(payload.campaign_id) }
239
+ : {}),
240
+ };
241
+ case 'smartlead':
242
+ return {
243
+ campaign_id: payload.campaign_id,
244
+ webhook: {
245
+ id: null,
246
+ name: managedWebhookName({
247
+ definition: input.definition,
248
+ provider,
249
+ }),
250
+ webhook_url: input.callbackUrl,
251
+ event_types: readStringArray(payload.event_types),
252
+ ...(readStringArray(payload.categories).length
253
+ ? { categories: readStringArray(payload.categories) }
254
+ : {}),
255
+ },
256
+ };
257
+ case 'heyreach':
258
+ return {
259
+ webhook_name: managedWebhookName({
260
+ definition: input.definition,
261
+ provider,
262
+ maxLength: 25,
263
+ }),
264
+ webhook_url: input.callbackUrl,
265
+ event_type: readString(payload.event_type),
266
+ ...(readNumberArray(payload.campaign_ids).length
267
+ ? { campaign_ids: readNumberArray(payload.campaign_ids) }
268
+ : {}),
269
+ };
270
+ case 'vector':
271
+ // Vector's dashboard owns the webhook resource. This payload is durable
272
+ // setup evidence, not an upstream API request.
273
+ return {
274
+ callback_url: input.callbackUrl,
275
+ event_type: 'contact.visited',
276
+ };
277
+ case 'rb2b':
278
+ // RB2B's dashboard owns the single webhook connection. This payload is
279
+ // durable setup evidence, not an upstream API request.
280
+ return {
281
+ callback_url: input.callbackUrl,
282
+ };
283
+ case 'snitcher':
284
+ // Radar is configured at the operator level. The callback URL is durable
285
+ // evidence of the Deepline-owned receiver; the setup API creates the
286
+ // customer tracker and configures session delivery upstream.
287
+ return {
288
+ callback_url: input.callbackUrl,
289
+ domains: readStringArray(payload.domains),
290
+ form_tracking: payload.formTracking === true,
291
+ click_tracking: payload.clickTracking === true,
292
+ custom_events: payload.customEvents !== false,
293
+ wait_for_consent: payload.waitForConsent !== false,
294
+ };
295
+ default:
296
+ throw new Error(
297
+ `Provider webhook monitor payload builder is not implemented for ${provider}.`,
298
+ );
299
+ }
300
+ }
@@ -0,0 +1,22 @@
1
+ export type MonitorQuickstartPrompt = {
2
+ prompt: string;
3
+ icon: 'job-change' | 'new-hires' | 'hiring-signal';
4
+ };
5
+
6
+ export const MONITOR_QUICKSTART_PROMPTS: MonitorQuickstartPrompt[] = [
7
+ {
8
+ prompt:
9
+ '/deepline-gtm Monitor my target accounts for new VP Sales, Marketing, and Revenue hires.',
10
+ icon: 'new-hires',
11
+ },
12
+ {
13
+ prompt:
14
+ '/deepline-gtm Monitor when people at my target accounts change jobs.',
15
+ icon: 'job-change',
16
+ },
17
+ {
18
+ prompt:
19
+ '/deepline-gtm Monitor my target accounts for job openings in the roles I sell to.',
20
+ icon: 'hiring-signal',
21
+ },
22
+ ];