deepline 0.3.406 → 0.3.408

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 (130) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +56 -57
  2. package/dist/bundling-sources/sdk/src/play.ts +21 -5
  3. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  4. package/dist/bundling-sources/sdk/src/types.ts +27 -3
  5. package/dist/bundling-sources/shared_libs/play-runtime/admission-timings.ts +64 -0
  6. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +11 -1
  7. package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +1 -4
  8. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +4 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +2 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/local-process.ts +15 -6
  11. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +1 -0
  12. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +275 -73
  13. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +22 -4
  14. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +10 -4
  15. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +72 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/webhook-receipt-source-commit-retry.ts +90 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/worker-api-types.ts +5 -0
  18. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +6 -1
  19. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +6 -0
  20. package/dist/cli/auth-3GB2K636.js +40 -0
  21. package/dist/cli/{auth-U7LIMXIS.mjs → auth-UVD3CUBB.mjs} +4 -4
  22. package/dist/cli/{billing-KGGS3444.mjs → billing-BZVTXXLM.mjs} +23 -16
  23. package/dist/cli/{billing-5ABVIJFU.js → billing-BZVYAF6T.js} +92 -85
  24. package/dist/cli/{chunk-KPU53YBB.js → chunk-2XXXFPTD.js} +67 -67
  25. package/dist/cli/{chunk-FQBKK5DG.js → chunk-3ZB6IIA7.js} +26 -26
  26. package/dist/cli/{chunk-5IGBBYXH.mjs → chunk-4CFULMRB.mjs} +73 -4
  27. package/dist/cli/{chunk-OPHLT4TM.mjs → chunk-4QFT5LGV.mjs} +2 -2
  28. package/dist/cli/{chunk-W2BAO4OR.js → chunk-4RNDKFNQ.js} +2 -2
  29. package/dist/cli/{chunk-GAMFK2ZP.mjs → chunk-67RWR34T.mjs} +10 -3
  30. package/dist/cli/{chunk-APLRSERF.js → chunk-AUMD2VXP.js} +60 -63
  31. package/dist/cli/{chunk-N6DJQQ2S.js → chunk-BRJUESQV.js} +50 -50
  32. package/dist/cli/{chunk-W3ZNQE5Y.js → chunk-D6FFBSM5.js} +1 -1
  33. package/dist/cli/{chunk-AYHLUHE5.js → chunk-E3PJF6YP.js} +6 -2
  34. package/dist/cli/{chunk-IE6IKRQA.js → chunk-ECVLPS67.js} +15 -15
  35. package/dist/cli/{chunk-QJBJZVG6.js → chunk-HQY2SG3K.js} +15 -8
  36. package/dist/cli/{chunk-2OFPPAUY.mjs → chunk-I3DHIXVJ.mjs} +4 -4
  37. package/dist/cli/{chunk-RXDJKAM2.mjs → chunk-IOHRWLQE.mjs} +6 -6
  38. package/dist/cli/{chunk-2MLY2ZBT.mjs → chunk-IWBXJDZA.mjs} +2 -2
  39. package/dist/cli/{chunk-URWF7NGQ.js → chunk-J5PTX66Y.js} +28 -14
  40. package/dist/cli/{chunk-7ZMVAV2B.mjs → chunk-LOYISF7S.mjs} +55 -58
  41. package/dist/cli/{chunk-T7YF4MQH.mjs → chunk-MJELBQBU.mjs} +4 -4
  42. package/dist/cli/{chunk-WJYPBHTE.js → chunk-OSFWFV72.js} +11 -4
  43. package/dist/cli/{chunk-ZI2ZNDJK.mjs → chunk-PYZZMAJQ.mjs} +28 -14
  44. package/dist/cli/{chunk-N43PX2CA.js → chunk-Q3LFI3VH.js} +8 -8
  45. package/dist/cli/{chunk-NYDRX6JJ.js → chunk-Q3PUHXOY.js} +99 -30
  46. package/dist/cli/{chunk-YSAZVLJD.js → chunk-QUAQX3FQ.js} +4 -4
  47. package/dist/cli/{chunk-4REBZQNK.js → chunk-RWCY6YI2.js} +53 -53
  48. package/dist/cli/{chunk-CGX4NSS3.mjs → chunk-SD7MXAJA.mjs} +1 -1
  49. package/dist/cli/{chunk-UFS752TU.mjs → chunk-SJVVBWRL.mjs} +5 -1
  50. package/dist/cli/{chunk-V3OTRWVK.mjs → chunk-URACNNLO.mjs} +2 -2
  51. package/dist/cli/{chunk-WXLOW623.mjs → chunk-WPAB4DCU.mjs} +14 -7
  52. package/dist/cli/{chunk-42RUJLQI.mjs → chunk-WTT6CLED.mjs} +1 -1
  53. package/dist/cli/{chunk-YLV6PT6B.mjs → chunk-XXLXOUUU.mjs} +1 -1
  54. package/dist/cli/{chunk-77UGRG6X.mjs → chunk-YMOFWHGO.mjs} +3 -3
  55. package/dist/cli/{chunk-EKS2FXL5.js → chunk-ZBABPK6Y.js} +8 -8
  56. package/dist/cli/command-docs.js +2 -2
  57. package/dist/cli/command-docs.mjs +1 -1
  58. package/dist/cli/{csv-HXJAAW3H.mjs → csv-WPSXG6ZZ.mjs} +3 -3
  59. package/dist/cli/{csv-U36TIOKU.js → csv-XLGLHJ6P.js} +12 -12
  60. package/dist/cli/{db-T5MLQQWJ.js → db-5PTNJG4X.js} +25 -25
  61. package/dist/cli/{db-GRWD3JAC.mjs → db-ABS57ABJ.mjs} +4 -4
  62. package/dist/cli/{describe-NFX6THJE.js → describe-EZS6PQXA.js} +11 -11
  63. package/dist/cli/{describe-HXFEIZFO.mjs → describe-PVWQJ2PB.mjs} +7 -7
  64. package/dist/cli/describe-core.d.mts +2 -2
  65. package/dist/cli/describe-core.d.ts +2 -2
  66. package/dist/cli/{executions-KBHTDL3A.js → executions-FNTAFQ7Y.js} +6 -6
  67. package/dist/cli/{executions-YGOS5E44.mjs → executions-OKJGATQZ.mjs} +4 -4
  68. package/dist/cli/{feedback-VP3GWJIH.js → feedback-6YBOMSUA.js} +7 -7
  69. package/dist/cli/{feedback-NEQGCSHB.mjs → feedback-W27HDMRR.mjs} +3 -3
  70. package/dist/cli/git-YKUXXJOR.js +24 -0
  71. package/dist/cli/{git-JJ3CHOTL.mjs → git-YOOUEL6M.mjs} +4 -4
  72. package/dist/cli/index.js +204 -127
  73. package/dist/cli/index.mjs +124 -47
  74. package/dist/cli/{legacy-noops-ITTD33ZN.js → legacy-noops-2VZ7XT6C.js} +7 -7
  75. package/dist/cli/{legacy-noops-A6KGBODU.mjs → legacy-noops-V6OKW7VR.mjs} +4 -4
  76. package/dist/cli/{monitors-DXVP5YFC.js → monitors-FBWGVIUS.js} +84 -84
  77. package/dist/cli/{monitors-NGEXCUEY.mjs → monitors-P2YYWTWT.mjs} +4 -4
  78. package/dist/cli/{org-C4ZTOSQC.js → org-3XUSVX5T.js} +64 -64
  79. package/dist/cli/{org-34DBJSFP.mjs → org-DVMG6H3C.mjs} +4 -4
  80. package/dist/cli/{play-SVLQKZBG.mjs → play-GNC5CQAS.mjs} +70 -18
  81. package/dist/cli/{play-5FWTZCHN.js → play-YG5L4BWQ.js} +345 -293
  82. package/dist/cli/{providers-QWR2HRNY.js → providers-7PSWG2OV.js} +7 -7
  83. package/dist/cli/{providers-RQTSGYE4.mjs → providers-JR33SLWL.mjs} +4 -4
  84. package/dist/cli/{quickstart-DHFNEMGY.js → quickstart-FDVZ5BL3.js} +5 -5
  85. package/dist/cli/{quickstart-W5UHZAEU.mjs → quickstart-VUOBQYIQ.mjs} +3 -3
  86. package/dist/cli/{search-U4AJC3FH.mjs → search-JZYLO33K.mjs} +5 -5
  87. package/dist/cli/search-PPPYC5OZ.js +30 -0
  88. package/dist/cli/{secrets-YSMQ7CVZ.mjs → secrets-3MCYBT4I.mjs} +4 -4
  89. package/dist/cli/{secrets-HH4H7BLE.js → secrets-VS266FVA.js} +13 -13
  90. package/dist/cli/{sessions-URONRCTV.mjs → sessions-ELLLT23E.mjs} +4 -4
  91. package/dist/cli/{sessions-AJZXYUCJ.js → sessions-TEHEWW7O.js} +5 -5
  92. package/dist/cli/{settings-QAW62BH4.js → settings-7364NMMA.js} +75 -75
  93. package/dist/cli/{settings-KGAMW4MN.mjs → settings-PZCKAFII.mjs} +8 -8
  94. package/dist/cli/{setup-P54DPBFO.mjs → setup-A7GQ4KIA.mjs} +7 -7
  95. package/dist/cli/{setup-KAMFU5VE.js → setup-PMWYLCT6.js} +42 -42
  96. package/dist/cli/skills-SYS7VRRK.js +29 -0
  97. package/dist/cli/{skills-UMWRJ6TL.mjs → skills-WS6BIFPQ.mjs} +5 -5
  98. package/dist/cli/{tools-HN4EFVY7.mjs → tools-BR4DOZA2.mjs} +7 -7
  99. package/dist/cli/{tools-HX3BHT55.js → tools-KK4BKVQR.js} +8 -8
  100. package/dist/cli/update-2IV5JTX2.js +29 -0
  101. package/dist/cli/{update-7AFQCJ75.mjs → update-D2B7UNFT.mjs} +7 -7
  102. package/dist/cli/{workflow-7EHU5ZPX.js → workflow-6ODTCYXU.js} +15 -15
  103. package/dist/cli/{workflow-ARDO4VHU.mjs → workflow-PQXC2R47.mjs} +5 -5
  104. package/dist/{client-Db1jFLpF.d.ts → client-BcvhDfJJ.d.ts} +80 -58
  105. package/dist/{client-Buv1_ktG.d.mts → client-Z9Pye1Wm.d.mts} +80 -58
  106. package/dist/{compiler-manifest-N77W75Py.d.ts → compiler-manifest-Ycx-hoAr.d.mts} +8 -1
  107. package/dist/{compiler-manifest-N77W75Py.d.mts → compiler-manifest-Ycx-hoAr.d.ts} +8 -1
  108. package/dist/{index-3WOfyVhW.d.mts → index-CZXgiN3E.d.mts} +1 -1
  109. package/dist/{index-CtIJFTCl.d.ts → index-NPG5pqxQ.d.ts} +1 -1
  110. package/dist/index.d.mts +13 -10
  111. package/dist/index.d.ts +13 -10
  112. package/dist/index.js +28 -11
  113. package/dist/index.mjs +25 -8
  114. package/dist/install-integrity.json +86 -84
  115. package/dist/plays/bundle-play-file.d.mts +3 -3
  116. package/dist/plays/bundle-play-file.d.ts +3 -3
  117. package/dist/plays/play-description.d.mts +2 -2
  118. package/dist/plays/play-description.d.ts +2 -2
  119. package/dist/plays/run-request.d.mts +2 -2
  120. package/dist/plays/run-request.d.ts +2 -2
  121. package/dist/release.d.mts +1 -1
  122. package/dist/release.d.ts +1 -1
  123. package/dist/release.js +2 -2
  124. package/dist/release.mjs +1 -1
  125. package/package.json +1 -1
  126. package/dist/cli/auth-K5QAZH42.js +0 -40
  127. package/dist/cli/git-63RYCZSI.js +0 -24
  128. package/dist/cli/search-YAYYU3WD.js +0 -30
  129. package/dist/cli/skills-M2GGHYJU.js +0 -29
  130. package/dist/cli/update-I23NN5QI.js +0 -29
@@ -2613,6 +2613,8 @@ export type BillingQuoteResult = {
2613
2613
  cpu: number;
2614
2614
  diskGiB: number;
2615
2615
  };
2616
+ maximum_backend?: 'daytona' | 'modal';
2617
+ priced_backends?: Array<'daytona' | 'modal'>;
2616
2618
  maximum_credits: number;
2617
2619
  maximum_billing_seconds: number;
2618
2620
  total_play_credits: null;
@@ -3232,8 +3234,8 @@ export class DeeplineClient {
3232
3234
  /**
3233
3235
  * Search available tools using Deepline's ranked backend search.
3234
3236
  *
3235
- * This is the same discovery surface used by the CLI: it ranks across
3236
- * tool metadata, categories, agent guidance, and input schema fields.
3237
+ * The CLI uses the same search.
3238
+ * The search ranks tool metadata, categories, agent guidance, and input schema fields.
3237
3239
  */
3238
3240
  async searchTools(
3239
3241
  options: ToolSearchOptions = {},
@@ -3308,13 +3310,12 @@ export class DeeplineClient {
3308
3310
  /**
3309
3311
  * Describe a Deepline Agent model and its provider-specific option surface.
3310
3312
  *
3311
- * Combines live AI Gateway model metadata with Deepline's generated AI SDK
3312
- * provider option registry so agents can construct `providerOptions`
3313
- * payloads before executing `deeplineagent`.
3313
+ * The method combines live AI Gateway model metadata with Deepline's generated registry of AI SDK provider options.
3314
+ * Agents can use this information to construct `providerOptions` payloads before they execute `deeplineagent`.
3314
3315
  *
3315
- * The returned option schemas describe accepted provider option shapes, not
3316
- * guaranteed support for every model. Runtime AI SDK/Gateway errors remain
3317
- * authoritative for model-gated values.
3316
+ * The returned schemas describe accepted shapes for provider options.
3317
+ * These schemas do not guarantee that every model supports each option.
3318
+ * Runtime AI SDK and Gateway errors determine support for model-specific values.
3318
3319
  *
3319
3320
  * @param model - Exact-case Gateway model id such as `"openai/gpt-5.6-luna"`
3320
3321
  * @returns Model metadata, provider option shapes, and runnable examples
@@ -3331,8 +3332,8 @@ export class DeeplineClient {
3331
3332
  /**
3332
3333
  * Quote dynamic AI inference pricing for a concrete payload.
3333
3334
  *
3334
- * The result separates a planning estimate from a proven authorization
3335
- * maximum and contains Deepline credits only.
3335
+ * The result contains a planning estimate and a separate, proven authorization maximum.
3336
+ * Both values use Deepline credits.
3336
3337
  */
3337
3338
  async quoteInferenceTool(
3338
3339
  toolId: 'ai_evaluate' | 'ai_inference' | 'deeplineagent',
@@ -3437,13 +3438,16 @@ export class DeeplineClient {
3437
3438
  * entrypoints: the CLI, {@link Deepline.connect}, {@link submitPlay},
3438
3439
  * or {@link runPlay}.
3439
3440
  *
3440
- * Supported invocation surfaces intentionally share this same run contract:
3441
- * `deepline plays run`, repo scripts such as `bun run deepline -- plays run`,
3442
- * SDK context calls like `Deepline.connect().play(name).run()`, and direct
3443
- * `POST /api/v2/plays/run` calls all return a workflow/run id. The completed
3444
- * output is always retrievable from `getPlayStatus(runId).result` (or from
3445
- * `PlayJob.get()` for SDK context calls). Execution logs live under
3446
- * `progress.logs`; they are not part of the user output object.
3441
+ * These interfaces share the run contract and return a workflow or run ID:
3442
+ *
3443
+ * - `deepline plays run`.
3444
+ * - Repository scripts such as `bun run deepline -- plays run`.
3445
+ * - SDK context calls such as `Deepline.connect().play(name).run()`.
3446
+ * - Direct `POST /api/v2/plays/run` calls.
3447
+ *
3448
+ * Read completed output from `getPlayStatus(runId).result`.
3449
+ * For SDK context calls, read output from `PlayJob.get()`.
3450
+ * Execution logs appear under `progress.logs`. The user output object does not contain these logs.
3447
3451
  *
3448
3452
  * @param request - Play run configuration (name, code, input, etc.)
3449
3453
  * @returns Run metadata including the public `workflowId`
@@ -3718,9 +3722,8 @@ export class DeeplineClient {
3718
3722
  /**
3719
3723
  * Compile a bundled play artifact into the server-side compiler manifest.
3720
3724
  *
3721
- * The manifest records imports, trigger bindings, static pipeline shape, and
3722
- * runtime metadata needed before a play artifact can be checked, registered,
3723
- * or run.
3725
+ * The manifest records imports, trigger bindings, static pipeline shape, and runtime metadata.
3726
+ * The compiler needs these records before it checks, registers, or runs a Play artifact.
3724
3727
  */
3725
3728
  async compilePlayManifest(input: {
3726
3729
  name: string;
@@ -3802,8 +3805,8 @@ export class DeeplineClient {
3802
3805
  /**
3803
3806
  * Register an already-bundled play artifact and start a run from it.
3804
3807
  *
3805
- * This is the low-level file-backed run path used by SDK/CLI packaging
3806
- * wrappers after local bundling has produced the runtime artifact.
3808
+ * SDK and CLI packaging wrappers use this low-level run method for file-based Plays.
3809
+ * Local bundling must produce the runtime artifact first.
3807
3810
  */
3808
3811
  async startPlayRunFromBundle(input: {
3809
3812
  name: string;
@@ -3859,15 +3862,15 @@ export class DeeplineClient {
3859
3862
  /**
3860
3863
  * Register a bundled play artifact and start a run from the live revision.
3861
3864
  *
3862
- * Convenience wrapper around {@link registerPlayArtifact} plus
3863
- * {@link startPlayRun}. This is the canonical file-backed path used by wrappers.
3864
- * The returned id can be passed to {@link getPlayStatus} to retrieve the same
3865
- * durable `{ result }` object that the CLI prints after `plays run` completes.
3865
+ * This method wraps {@link registerPlayArtifact} and {@link startPlayRun}.
3866
+ * Packaging wrappers use this method for file-based Plays.
3867
+ * Pass the returned ID to {@link getPlayStatus}.
3868
+ * The method returns the same durable `{ result }` object that the CLI prints after `plays run` completes.
3866
3869
  *
3867
- * @param code - Source string fallback; the bundled artifact should be passed in `options.artifact`
3868
- * @param csvPath - Path to input CSV file, or `null`
3869
- * @param name - Play name (extracted from source if omitted)
3870
- * @param options - Additional submission options
3870
+ * @param code - Fallback source string. Pass the bundled artifact in `options.artifact`.
3871
+ * @param csvPath - Path to the input CSV file, or `null`.
3872
+ * @param name - Play name. The SDK derives it from the source when omitted.
3873
+ * @param options - Additional submission options.
3871
3874
  * @returns Workflow metadata with `workflowId`
3872
3875
  *
3873
3876
  * @example
@@ -3998,9 +4001,8 @@ export class DeeplineClient {
3998
4001
  /**
3999
4002
  * Mint short-lived presigned upload targets for staged play files.
4000
4003
  *
4001
- * Internal primitive used by {@link stagePlayFiles}. The server returns an
4002
- * already-staged ref (no upload needed) for content-addressed files it
4003
- * already holds, or a presigned PUT URL the caller uploads the body to.
4004
+ * Internal primitive used by {@link stagePlayFiles}. For a content-addressed file already in storage, the server returns a staged reference. That file needs no upload.
4005
+ * For other files, the server returns a presigned PUT URL. Upload the file body to that URL.
4004
4006
  */
4005
4007
  async mintStagedPlayFileUploads(
4006
4008
  files: Array<{
@@ -4016,8 +4018,7 @@ export class DeeplineClient {
4016
4018
  /**
4017
4019
  * Resolve staged play files by content hash without uploading bytes.
4018
4020
  *
4019
- * Missing files are returned so callers can upload only the files the server
4020
- * does not already have.
4021
+ * The response identifies missing files. Callers need to upload only these files.
4021
4022
  */
4022
4023
  async resolveStagedPlayFiles(
4023
4024
  files: Array<{
@@ -4658,11 +4659,11 @@ export class DeeplineClient {
4658
4659
  /**
4659
4660
  * Start a fresh run from a prior run's retained input and pinned revision.
4660
4661
  *
4661
- * Every invocation sends an `Idempotency-Key`. When the caller does not
4662
- * supply one, a fresh key is generated once per call so the transport's own
4663
- * network retries converge on a single rerun. Pass the same explicit key
4664
- * across separate invocations to repeat an ambiguous result safely; a
4665
- * different key intentionally starts another rerun.
4662
+ * Every invocation sends an `Idempotency-Key`.
4663
+ * When the caller supplies no key, the SDK creates a fresh key once per call.
4664
+ * The transport reuses that key for network retries, so those retries produce one rerun.
4665
+ * Reuse an explicit key across separate invocations when the previous result is uncertain.
4666
+ * A different key starts another rerun.
4666
4667
  */
4667
4668
  async rerun(
4668
4669
  runId: string,
@@ -5113,8 +5114,8 @@ export class DeeplineClient {
5113
5114
  options?: StopAllRunsOptions,
5114
5115
  ): Promise<StopAllPlayRunsResult>;
5115
5116
  /**
5116
- * Stop every active run visible to the current workspace, or with
5117
- * `dryRun: true` enumerate the exact candidates without cancelling anything.
5117
+ * Stop every active run visible to the current workspace.
5118
+ * With `dryRun: true`, list the exact candidates without cancelling any run.
5118
5119
  *
5119
5120
  * This is the SDK equivalent of:
5120
5121
  *
@@ -5123,8 +5124,8 @@ export class DeeplineClient {
5123
5124
  * deepline runs stop-all --reason "stale lock"
5124
5125
  * ```
5125
5126
  *
5126
- * Use this when a failed parent run left child or waiting runs active and you
5127
- * need to clear the workspace run-slot state without knowing each run id.
5127
+ * Use this method when a failed parent leaves active child or waiting runs.
5128
+ * The method clears workspace run-slot state without requiring each run ID.
5128
5129
  */
5129
5130
  async stopAllRuns(
5130
5131
  options?: StopAllRunsOptions,
@@ -5150,8 +5151,8 @@ export class DeeplineClient {
5150
5151
  }
5151
5152
 
5152
5153
  /**
5153
- * List one page of callable plays; grep retains exhaustive matching results.
5154
- * Use listPlaysPage to retain pagination metadata.
5154
+ * List one page of callable Plays. With grep, the method retains all matching results.
5155
+ * Use listPlaysPage for pagination metadata.
5155
5156
  *
5156
5157
  * Pass `origin: "prebuilt"` for Deepline-managed prebuilts or
5157
5158
  * `origin: "owned"` for org-owned plays.
@@ -5736,8 +5737,7 @@ export class DeeplineClient {
5736
5737
  /**
5737
5738
  * Get the full definition and state of a named play.
5738
5739
  *
5739
- * Returns the play's revision state (draft, live), recent runs,
5740
- * sheet processing summary, and database URL.
5740
+ * The response includes revision state (draft or live), recent runs, a summary of sheet processing, and the database URL.
5741
5741
  *
5742
5742
  * @param name - Play name
5743
5743
  * @returns Complete play detail
@@ -5813,10 +5813,10 @@ export class DeeplineClient {
5813
5813
  /**
5814
5814
  * Get a normalized play description suitable for agents and CLIs.
5815
5815
  *
5816
- * The description includes runnable examples, input/output summaries, clone
5817
- * guidance, revision state, and latest run metadata when available. Pass
5818
- * `{ pipeline: true }` to include the compiled pipeline, which can be
5819
- * hundreds of kilobytes and is otherwise left out.
5816
+ * The description includes runnable examples, input and output summaries, clone guidance, and revision state.
5817
+ * It also includes metadata for the latest run when available.
5818
+ * Set `{ pipeline: true }` to include the compiled pipeline.
5819
+ * The pipeline can be hundreds of kilobytes. The response omits it by default.
5820
5820
  */
5821
5821
  async describePlay(
5822
5822
  name: string,
@@ -5884,8 +5884,7 @@ export class DeeplineClient {
5884
5884
  * Make a play revision live.
5885
5885
  *
5886
5886
  * When `revisionId` is omitted, the current working revision becomes live.
5887
- * The live version is what executes when the play is run by name without
5888
- * specifying an explicit revision.
5887
+ * A call by Play name executes the live revision unless the caller specifies another revision.
5889
5888
  *
5890
5889
  * @param name - Play name
5891
5890
  * @param request - Optional explicit revision to make live
@@ -6211,9 +6210,9 @@ export class DeeplineClient {
6211
6210
  }
6212
6211
 
6213
6212
  /**
6214
- * What Deepline has billed each run so far (customer-visible credits, never
6215
- * provider spend) and whether any of its charges is still settling — the
6216
- * same read the dashboard's runs grid shows. `GET /api/v2/runs/billing`.
6213
+ * Read Deepline credits billed to each run and whether charges are still settling.
6214
+ * The response never shows provider spend. The dashboard runs grid uses the same read.
6215
+ * HTTP endpoint: `GET /api/v2/runs/billing`.
6217
6216
  */
6218
6217
  async getRunBilling(runIds: readonly string[]): Promise<RunBillingResult> {
6219
6218
  const params = new URLSearchParams();
@@ -192,8 +192,8 @@ export type PlayFetchResponse = PlayAuthoringFetchResponse;
192
192
  * A play can be triggered three ways, declared as the third argument to
193
193
  * {@link definePlay}:
194
194
  * - `webhook` — an inbound HTTP call (with optional legacy HMAC or Standard
195
- * Webhooks signature verification);
196
- * - `cron` — a schedule; or
195
+ * Webhooks signature verification).
196
+ * - `cron` — a schedule.
197
197
  * - `sqlListeners` — a **monitor**: the play runs whenever a monitor writes a new
198
198
  * row to its output stream. This is how you build a play "on top of" a monitor
199
199
  * (e.g. run enrichment every time a watched company posts a new job). Each
@@ -1232,8 +1232,8 @@ export class DeeplineContext {
1232
1232
  * Run a named or prebuilt play and wait for its output.
1233
1233
  *
1234
1234
  * This is the high-level SDK equivalent of `ctx.play(name).runSync(input)`.
1235
- * Inside a play runtime, prefer the in-play `ctx.runPlay(key, playRef, input,
1236
- * options)` form so the child run is checkpointed under a stable key.
1235
+ * Inside a Play, prefer `ctx.runPlay(key, playRef, input, options)`.
1236
+ * The runtime checkpoints the child run under a stable key.
1237
1237
  *
1238
1238
  * @param playOrRef - Play name or prebuilt/reference object.
1239
1239
  * @param input - JSON input passed to the play.
@@ -1313,6 +1313,16 @@ function stringArray(value: unknown): string[] {
1313
1313
  return Array.isArray(value) ? value.map(String) : [];
1314
1314
  }
1315
1315
 
1316
+ function listAliasRecord(value: unknown): Record<string, string> | undefined {
1317
+ if (!isRecord(value)) return undefined;
1318
+ return Object.fromEntries(
1319
+ Object.entries(value).filter(
1320
+ (entry): entry is [string, string] =>
1321
+ typeof entry[1] === 'string' && entry[1].length > 0,
1322
+ ),
1323
+ );
1324
+ }
1325
+
1316
1326
  function emailStatusExtractorConfig(
1317
1327
  value: unknown,
1318
1328
  ): EmailStatusExtractorConfig | undefined {
@@ -1590,6 +1600,9 @@ function toolExecutionEnvelopeToResult(
1590
1600
  extractors: extractorDescriptorRecord(toolMetadata.extractors),
1591
1601
  targetGetters: stringArrayRecord(toolMetadata.targetGetters),
1592
1602
  listExtractorPaths: stringArray(toolMetadata.listExtractorPaths),
1603
+ listExtractorAliases: listAliasRecord(
1604
+ toolMetadata.listExtractorAliases,
1605
+ ),
1593
1606
  listIdentityGetters: stringArrayRecord(
1594
1607
  toolMetadata.listIdentityGetters,
1595
1608
  ),
@@ -1630,7 +1643,10 @@ export function defineInput<TInput>(
1630
1643
  /**
1631
1644
  * Define a play — a composable TypeScript workflow for the Deepline platform.
1632
1645
  *
1633
- * The returned value is both a callable function, invoked by the Deepline runtime with a runtime context, and a named play handle carrying `.run()`, `.versions()`, `.get()` and `.publish()` for remote lifecycle management. Plays are the primary abstraction for repeatable data pipelines and execute durably, with automatic retries and timeouts.
1646
+ * The returned value is both a callable function and a named Play handle.
1647
+ * The Deepline runtime calls the function with a runtime context.
1648
+ * The handle provides `.run()`, `.versions()`, `.get()`, and `.publish()` for remote lifecycle operations.
1649
+ * Plays define repeatable data pipelines. The runtime executes them durably with automatic retries and timeouts.
1634
1650
  *
1635
1651
  * @typeParam TInput - The input type accepted by the play
1636
1652
  * @typeParam TOutput - The return type of the play
@@ -202,7 +202,7 @@ export const SDK_RELEASE = {
202
202
  // getters keep their established compatibility behavior.
203
203
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
204
204
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
205
- version: '0.3.406',
205
+ version: '0.3.408',
206
206
  updateSummary:
207
207
  'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
208
208
  packageCapabilities: {
@@ -1181,9 +1181,10 @@ export interface StopPlayRunResult {
1181
1181
  /** True if HITL state or its same-message Slack card still needs retrying. */
1182
1182
  hitlCancellationPending?: boolean;
1183
1183
  /**
1184
- * True only when the scheduler and the canonical run ledger disagree (for
1185
- * example a terminal scheduler run whose ledger projection is pending), so
1186
- * the stop could not be confirmed. Never set for a queued cancellation.
1184
+ * True only when the scheduler and the canonical run ledger disagree and
1185
+ * the server could not confirm the stop.
1186
+ * For example, the scheduler can report a terminal run while the ledger
1187
+ * projection is pending. This field is never true for a queued cancellation.
1187
1188
  */
1188
1189
  staleSchedulerState?: boolean;
1189
1190
  /** Server-side error detail when the stop failed (`state: 'failed'`). */
@@ -1580,6 +1581,17 @@ export type PlayCostEstimate =
1580
1581
  sampleRunCount: number;
1581
1582
  basedOnRunId: string | null;
1582
1583
  modelVersion: string;
1584
+ compute?: {
1585
+ scope: 'sandbox_session';
1586
+ maximumCredits: number;
1587
+ maximumBillingSeconds: number;
1588
+ maximumBackend: 'daytona' | 'modal';
1589
+ pricedBackends: Array<'daytona' | 'modal'>;
1590
+ totalPlayCredits: null;
1591
+ totalPlayCreditsSupported: false;
1592
+ actualUsageBased: true;
1593
+ totalSandboxSessions: 'unbounded';
1594
+ };
1583
1595
  }
1584
1596
  | {
1585
1597
  status: 'unavailable';
@@ -1587,9 +1599,21 @@ export type PlayCostEstimate =
1587
1599
  | 'ambiguous_output_unit'
1588
1600
  | 'unbounded_loop'
1589
1601
  | 'unresolved_tool'
1602
+ | 'unresolved_call_graph'
1590
1603
  | 'mixed_run_and_row_costs';
1591
1604
  message: string;
1592
1605
  modelVersion: string;
1606
+ compute?: {
1607
+ scope: 'sandbox_session';
1608
+ maximumCredits: number;
1609
+ maximumBillingSeconds: number;
1610
+ maximumBackend: 'daytona' | 'modal';
1611
+ pricedBackends: Array<'daytona' | 'modal'>;
1612
+ totalPlayCredits: null;
1613
+ totalPlayCreditsSupported: false;
1614
+ actualUsageBased: true;
1615
+ totalSandboxSessions: 'unbounded';
1616
+ };
1593
1617
  };
1594
1618
 
1595
1619
  export interface PlayListItem {
@@ -0,0 +1,64 @@
1
+ export function createPlayAdmissionBatchTimings() {
2
+ return {
3
+ payloadReadMs: 0,
4
+ sourceAdmissionMs: 0,
5
+ validationMs: 0,
6
+ dataPlaneProbeMs: 0,
7
+ dataPlaneReadyMs: 0,
8
+ authorityMs: 0,
9
+ preloadWaitMs: 0,
10
+ canonicalInputMs: 0,
11
+ canonicalInputWaitMs: 0,
12
+ launchPlanMs: 0,
13
+ schedulerImportMs: 0,
14
+ schedulerResolveMs: 0,
15
+ schedulerCapacityWaitMs: 0,
16
+ schedulerSubmitMs: 0,
17
+ };
18
+ }
19
+
20
+ export type PlayAdmissionBatchTimings = ReturnType<
21
+ typeof createPlayAdmissionBatchTimings
22
+ >;
23
+
24
+ export type PlayAdmissionResponseTimings = Partial<
25
+ { admissionHandlerStartedAt: number } & Record<
26
+ `admission_${'preflightMs' | keyof PlayAdmissionBatchTimings}`,
27
+ number
28
+ >
29
+ >;
30
+
31
+ const ADMISSION_RESPONSE_TIMING_KEYS: readonly (
32
+ | 'preflightMs'
33
+ | keyof PlayAdmissionBatchTimings
34
+ )[] = [
35
+ 'preflightMs',
36
+ ...(Object.keys(
37
+ createPlayAdmissionBatchTimings(),
38
+ ) as (keyof PlayAdmissionBatchTimings)[]),
39
+ ];
40
+
41
+ /** Accept only this endpoint's fixed numeric diagnostics, never raw headers. */
42
+ export function readPlayAdmissionResponseTimings(
43
+ response: Pick<Response, 'headers'>,
44
+ ) {
45
+ const timings: PlayAdmissionResponseTimings = {};
46
+ const startedAt = response.headers.get(
47
+ 'x-deepline-admission-handler-started-at',
48
+ );
49
+ if (startedAt !== null && /^\d+$/.test(startedAt)) {
50
+ const value = Number(startedAt);
51
+ if (Number.isSafeInteger(value)) timings.admissionHandlerStartedAt = value;
52
+ }
53
+ const serverTiming = response.headers.get('server-timing') ?? '';
54
+ for (const key of ADMISSION_RESPONSE_TIMING_KEYS) {
55
+ const match = serverTiming.match(
56
+ new RegExp(`(?:^|,\\s*)${key};dur=(\\d+(?:\\.\\d+)?)(?=,|$)`),
57
+ );
58
+ if (match) {
59
+ const value = Number(match[1]);
60
+ if (Number.isFinite(value)) timings[`admission_${key}`] = value;
61
+ }
62
+ }
63
+ return timings;
64
+ }
@@ -191,6 +191,7 @@ import {
191
191
  relayPublishedToolResultReference,
192
192
  serializeToolExecuteResult,
193
193
  deserializeToolExecuteResult,
194
+ mergeToolExecuteResultListGetterMetadata,
194
195
  type ParsedToolExecuteResponse,
195
196
  type ToolExecuteResult,
196
197
  type ToolResultExecutionMetadata,
@@ -7670,6 +7671,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
7670
7671
  extractors: metadata?.extractors ?? {},
7671
7672
  targetGetters: metadata?.targetGetters ?? {},
7672
7673
  listExtractorPaths: metadata?.listExtractorPaths ?? [],
7674
+ listExtractorAliases: metadata?.listExtractorAliases,
7673
7675
  listIdentityGetters: metadata?.listIdentityGetters ?? {},
7674
7676
  };
7675
7677
  }
@@ -7694,10 +7696,18 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
7694
7696
  requestInput?: Record<string, unknown>;
7695
7697
  }): Promise<ToolExecuteResult> {
7696
7698
  if (isToolExecuteResult(input.result)) {
7699
+ const result =
7700
+ input.toolId === 'hunter_discover'
7701
+ ? mergeToolExecuteResultListGetterMetadata(
7702
+ input.result,
7703
+ input.metadata ??
7704
+ (await this.resolveToolResultMetadata(input.toolId)),
7705
+ )
7706
+ : input.result;
7697
7707
  const wrapped = await this.attachCustomerDbDatasetResult(
7698
7708
  input.toolId,
7699
7709
  input.requestInput,
7700
- cloneToolExecuteResultWithExecution(input.result, input.execution),
7710
+ cloneToolExecuteResultWithExecution(result, input.execution),
7701
7711
  );
7702
7712
  return input.receiptOutputRef
7703
7713
  ? attachRelayPublishedToolResultReference(
@@ -9,10 +9,7 @@ import {
9
9
  export const MODAL_RUNNER_APP_NAME = 'deepline-play-runner';
10
10
  export const MODAL_RUNNER_IMAGE = 'node:20-bookworm-slim';
11
11
  export const MODAL_RUNNER_WORKDIR = '/root/deepline';
12
-
13
- // Modal bills one physical core as two vCPUs. This matches the standard
14
- // Deepline one-vCPU / one-GiB sandbox.
15
- export const MODAL_SANDBOX_CPU_CORES = 0.5;
12
+ export { MODAL_SANDBOX_CPU_CORES } from './worker-api-types';
16
13
  export const MODAL_SANDBOX_MEMORY_MIB = 1024;
17
14
 
18
15
  export type ModalRequiredConfig = {
@@ -5,6 +5,7 @@ import {
5
5
  dispatchRunLedgerOutboxToLedgerThroughEventWithClientScope,
6
6
  type PostgresSchedulerOptions,
7
7
  type PostgresSchedulerOutboxDrainResult,
8
+ type RunLedgerDispatchLaunch,
8
9
  type RunLedgerOutboxWithClient,
9
10
  } from '../../scheduler-backends/postgres';
10
11
 
@@ -17,6 +18,8 @@ export type GatewayRunLedgerProjectionAdapterInput = {
17
18
  * against the active outbox lease while retaining supported transport hooks.
18
19
  */
19
20
  runtimeApi: WorkerRuntimeApiContext;
21
+ /** Immutable launch already read by the worker that committed the terminal. */
22
+ launch?: RunLedgerDispatchLaunch;
20
23
  withClient: RunLedgerOutboxWithClient;
21
24
  schedulerOptions?: Pick<PostgresSchedulerOptions, 'schema'>;
22
25
  };
@@ -35,6 +38,7 @@ export function createGatewayRunLedgerProjectionAdapter(
35
38
  runId: input.runId,
36
39
  runtimeApi: input.runtimeApi,
37
40
  tokenAuthority: 'gateway' as const,
41
+ ...(input.launch ? { dispatchLaunch: input.launch } : {}),
38
42
  ...(input.runtimeApi.signal ? { signal: input.runtimeApi.signal } : {}),
39
43
  };
40
44
  return {
@@ -371,6 +371,7 @@ type RuntimeToolMetadata = {
371
371
  };
372
372
  targetGetters?: Record<string, string[]>;
373
373
  listExtractorPaths?: string[];
374
+ listExtractorAliases?: ToolResultMetadataInput['listExtractorAliases'];
374
375
  listIdentityGetters?: Record<string, string[]>;
375
376
  eventWait?: boolean;
376
377
  asyncOperation?:
@@ -2564,6 +2565,7 @@ async function run(
2564
2565
  extractors: metadata.extractors ?? {},
2565
2566
  targetGetters: metadata.targetGetters ?? {},
2566
2567
  listExtractorPaths: metadata.listExtractorPaths ?? [],
2568
+ listExtractorAliases: metadata.listExtractorAliases,
2567
2569
  listIdentityGetters: metadata.listIdentityGetters ?? {},
2568
2570
  };
2569
2571
  },
@@ -59,6 +59,13 @@ const LOCAL_PROCESS_COMPUTE_DISK_GIB = 3;
59
59
  export const LOCAL_PROCESS_CANCEL_GRACE_MS = 2_000;
60
60
  const LOCAL_PROCESS_CANCELLED_ERROR = 'Local play runner cancelled';
61
61
 
62
+ function localProcessCancellationMessage(signal?: AbortSignal): string {
63
+ const reason = signal?.reason;
64
+ return typeof reason === 'string' && reason.trim()
65
+ ? reason.trim()
66
+ : LOCAL_PROCESS_CANCELLED_ERROR;
67
+ }
68
+
62
69
  export const LOCAL_PROCESS_COMPUTE_PROFILE = {
63
70
  source: LOCAL_PROCESS_COMPUTE_SOURCE,
64
71
  cpu: LOCAL_PROCESS_COMPUTE_CPU,
@@ -88,7 +95,11 @@ async function runCommand(
88
95
  ): Promise<CommandExecutionResult> {
89
96
  return await new Promise((resolve, reject) => {
90
97
  if (callbacks?.cancellationSignal?.aborted) {
91
- reject(new Error(LOCAL_PROCESS_CANCELLED_ERROR));
98
+ reject(
99
+ new Error(
100
+ localProcessCancellationMessage(callbacks.cancellationSignal),
101
+ ),
102
+ );
92
103
  return;
93
104
  }
94
105
 
@@ -156,11 +167,9 @@ async function runCommand(
156
167
  return;
157
168
  }
158
169
  cancellationRequested = true;
159
- const reason = callbacks?.cancellationSignal?.reason;
160
- cancellationErrorMessage =
161
- typeof reason === 'string' && reason.trim()
162
- ? reason.trim()
163
- : LOCAL_PROCESS_CANCELLED_ERROR;
170
+ cancellationErrorMessage = localProcessCancellationMessage(
171
+ callbacks?.cancellationSignal,
172
+ );
164
173
  killTree('SIGTERM');
165
174
  cancelKillTimer = setTimeout(() => {
166
175
  // Kill the whole group even if the direct child already exited: a
@@ -872,6 +872,7 @@ function buildDefaultDeps(absurd: Absurd): AbsurdRuntimeWorkerDeps {
872
872
  await createRunLedgerProjectionJob({
873
873
  outbox: createGatewayRunLedgerProjectionAdapter({
874
874
  runId,
875
+ launch,
875
876
  runtimeApi: {
876
877
  ...absurdRuntimeApiFromLaunch(launch),
877
878
  ...(signal ? { signal } : {}),