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
@@ -2,14 +2,17 @@
2
2
  var CONVENTIONS = `
3
3
  [[cli:
4
4
  Conventions (apply to every command):
5
- Output mode: readable text by default. --json prints JSON. tools execute
6
- is the exception: it prints JSON; --output-format csv prints a readable
7
- summary and writes the rows to a CSV file.
8
- Streams: stdout carries only the command result. Progress, update notices,
9
- skills-sync notes, and warnings go to stderr.
10
- Piping JSON: pass --json only when a program parses the output, and parse
11
- stdout alone. 2>&1 puts stderr text in front of the JSON, so the parse
12
- fails and the real error is hidden; | head and | tail cut the document.
5
+ Output mode: readable text by default. Add --json for machine-readable
6
+ output: stdout is one JSON document, including errors and notices;
7
+ stderr stays empty. tools execute is the exception: it prints JSON;
8
+ --output-format csv prints a readable summary and writes the rows to a
9
+ CSV file.
10
+ Streams: without --json, stdout carries only the command result. Progress,
11
+ update notices, skills-sync notes, and warnings go to stderr.
12
+ Piping JSON: pass --json only when a program parses the output. Under
13
+ --json, usage errors are {ok:false,error:{code,message,details.help}}
14
+ and notices (update available, skills, auth) arrive in notices[];
15
+ | head and | tail cut the document.
13
16
  JSON envelope: most payloads include render.sections[].lines (the human
14
17
  summary as text), next.* (exact follow-up commands; run commands name
15
18
  them actions.*Cmd), and command_context.
@@ -269,13 +272,18 @@ When:
269
272
  reports a balance or insufficient-credits error.
270
273
  [[cli:
271
274
  Input:
272
- No arguments. Prints one line, "Balance: N credits". --verbose adds
273
- reservations and usage awaiting settlement; --json returns the full record.
275
+ No arguments. Prints the posted balance, spendable credits and pending
276
+ spending. --verbose adds exposure details; --json returns the full record.
274
277
  ]]
275
278
  [[cli:
276
279
  Output (JSON):
277
280
  balance (Deepline credits), balance_display, rough_usd_balance,
278
- balance_status, and render.sections. The balance includes other activity
281
+ balance_status, posted_balance_credits, pending_spend_credits,
282
+ spendable_balance_credits, spendable_balance_status and render.sections.
283
+ The three credit amounts come from the same admission snapshot. Spendable
284
+ credits subtract pending spending; a partial exposure diagnostic is not
285
+ spendable capacity. Null/unavailable means complete capacity could not be read.
286
+ Spending limits can still block a funded call. The balance includes other activity
279
287
  in the workspace, so a before and after difference does not isolate one
280
288
  command; use billing usage for that.
281
289
  ]]
@@ -485,7 +493,8 @@ When:
485
493
  [[cli:
486
494
  Input:
487
495
  The tool id. Prints readable text by default; read that
488
- form and pass --json only for a program. --pricing-only, --schema-only,
496
+ form and pass --json only for a program; stdout is then one JSON
497
+ document. --pricing-only, --schema-only,
489
498
  --examples-only, --getters-only print one section. --out <path> saves the
490
499
  output to a file. get is an alias of describe, and deepline describe <id>
491
500
  is the same read for a tool, a play, or a monitor type.
@@ -815,6 +824,7 @@ When:
815
824
  Input:
816
825
  The play reference from search (prebuilt/... or <workspace>/...).
817
826
  --compact shortens schemas. --json prints JSON.
827
+ To parse the output, add --json; stdout is then one JSON document.
818
828
  ]]
819
829
  [[cli:
820
830
  Output (JSON):
@@ -943,7 +953,8 @@ Output (JSON, printed when the run ends):
943
953
  exact follow-up commands: getRunCmd, getFullRunCmd, getBillingCmd,
944
954
  getLogsCmd, exportDatasetCmds[], queryTableSqlCmds[]. Rows are not in this
945
955
  payload. Progress lines are printed while it waits; the JSON is the last
946
- thing printed.
956
+ thing printed. To parse it, add --json: progress is suppressed and stdout
957
+ is one JSON document.
947
958
  ]]
948
959
  [[mcp:
949
960
  Output:
@@ -1168,6 +1179,7 @@ Input:
1168
1179
  billing and timeline (large). --log-failed attaches the failure log window.
1169
1180
  --input prints the original input (may contain customer data). --json
1170
1181
  prints JSON; --json run.status,datasets.name selects fields.
1182
+ To parse the output (also with --full), add --json; stdout is then one JSON document.
1171
1183
  ]]
1172
1184
  [[cli:
1173
1185
  Output (JSON):
@@ -1254,6 +1266,7 @@ Input:
1254
1266
  returned more than one (default: the returned dataset, usually
1255
1267
  result.rows). --metadata-out <path.json> writes the export metadata. --json
1256
1268
  prints the receipt as JSON; it does not change the file format.
1269
+ To parse the receipt, add --json; stdout is then one JSON document.
1257
1270
  ]]
1258
1271
  Output (JSON):
1259
1272
  csv_path or json_path (absolute), source, rowCount, columns[] (the CSV
@@ -1343,7 +1356,8 @@ Input:
1343
1356
  Output:
1344
1357
  Log lines (human) or a JSON envelope; with --out, the file path. Follow
1345
1358
  next.logs for the next page of events, and pass nextCursor to --cursor for
1346
- older text logs.
1359
+ older text logs. To parse the output, add --json; stdout is then one JSON
1360
+ document.
1347
1361
  ]]
1348
1362
  Cost:
1349
1363
  Free.
@@ -24,7 +24,7 @@ import {
24
24
  RETAINED_PIPELINE_RECEIVERS_HEADER,
25
25
  RUNTIME_ENVIRONMENT_TOKEN_HEADER,
26
26
  resolveConfig
27
- } from "./chunk-CGX4NSS3.mjs";
27
+ } from "./chunk-SD7MXAJA.mjs";
28
28
  import {
29
29
  CustomerDbQueryOutcomeUnknownError
30
30
  } from "./chunk-YHPYUZZX.mjs";
@@ -3432,8 +3432,8 @@ var DeeplineClient = class _DeeplineClient {
3432
3432
  /**
3433
3433
  * Search available tools using Deepline's ranked backend search.
3434
3434
  *
3435
- * This is the same discovery surface used by the CLI: it ranks across
3436
- * tool metadata, categories, agent guidance, and input schema fields.
3435
+ * The CLI uses the same search.
3436
+ * The search ranks tool metadata, categories, agent guidance, and input schema fields.
3437
3437
  */
3438
3438
  async searchTools(options = {}) {
3439
3439
  return this.http.get(
@@ -3498,13 +3498,12 @@ var DeeplineClient = class _DeeplineClient {
3498
3498
  /**
3499
3499
  * Describe a Deepline Agent model and its provider-specific option surface.
3500
3500
  *
3501
- * Combines live AI Gateway model metadata with Deepline's generated AI SDK
3502
- * provider option registry so agents can construct `providerOptions`
3503
- * payloads before executing `deeplineagent`.
3501
+ * The method combines live AI Gateway model metadata with Deepline's generated registry of AI SDK provider options.
3502
+ * Agents can use this information to construct `providerOptions` payloads before they execute `deeplineagent`.
3504
3503
  *
3505
- * The returned option schemas describe accepted provider option shapes, not
3506
- * guaranteed support for every model. Runtime AI SDK/Gateway errors remain
3507
- * authoritative for model-gated values.
3504
+ * The returned schemas describe accepted shapes for provider options.
3505
+ * These schemas do not guarantee that every model supports each option.
3506
+ * Runtime AI SDK and Gateway errors determine support for model-specific values.
3508
3507
  *
3509
3508
  * @param model - Exact-case Gateway model id such as `"openai/gpt-5.6-luna"`
3510
3509
  * @returns Model metadata, provider option shapes, and runnable examples
@@ -3520,8 +3519,8 @@ var DeeplineClient = class _DeeplineClient {
3520
3519
  /**
3521
3520
  * Quote dynamic AI inference pricing for a concrete payload.
3522
3521
  *
3523
- * The result separates a planning estimate from a proven authorization
3524
- * maximum and contains Deepline credits only.
3522
+ * The result contains a planning estimate and a separate, proven authorization maximum.
3523
+ * Both values use Deepline credits.
3525
3524
  */
3526
3525
  async quoteInferenceTool(toolId, payload) {
3527
3526
  return this.http.post(
@@ -3596,13 +3595,16 @@ var DeeplineClient = class _DeeplineClient {
3596
3595
  * entrypoints: the CLI, {@link Deepline.connect}, {@link submitPlay},
3597
3596
  * or {@link runPlay}.
3598
3597
  *
3599
- * Supported invocation surfaces intentionally share this same run contract:
3600
- * `deepline plays run`, repo scripts such as `bun run deepline -- plays run`,
3601
- * SDK context calls like `Deepline.connect().play(name).run()`, and direct
3602
- * `POST /api/v2/plays/run` calls all return a workflow/run id. The completed
3603
- * output is always retrievable from `getPlayStatus(runId).result` (or from
3604
- * `PlayJob.get()` for SDK context calls). Execution logs live under
3605
- * `progress.logs`; they are not part of the user output object.
3598
+ * These interfaces share the run contract and return a workflow or run ID:
3599
+ *
3600
+ * - `deepline plays run`.
3601
+ * - Repository scripts such as `bun run deepline -- plays run`.
3602
+ * - SDK context calls such as `Deepline.connect().play(name).run()`.
3603
+ * - Direct `POST /api/v2/plays/run` calls.
3604
+ *
3605
+ * Read completed output from `getPlayStatus(runId).result`.
3606
+ * For SDK context calls, read output from `PlayJob.get()`.
3607
+ * Execution logs appear under `progress.logs`. The user output object does not contain these logs.
3606
3608
  *
3607
3609
  * @param request - Play run configuration (name, code, input, etc.)
3608
3610
  * @returns Run metadata including the public `workflowId`
@@ -3767,9 +3769,8 @@ var DeeplineClient = class _DeeplineClient {
3767
3769
  /**
3768
3770
  * Compile a bundled play artifact into the server-side compiler manifest.
3769
3771
  *
3770
- * The manifest records imports, trigger bindings, static pipeline shape, and
3771
- * runtime metadata needed before a play artifact can be checked, registered,
3772
- * or run.
3772
+ * The manifest records imports, trigger bindings, static pipeline shape, and runtime metadata.
3773
+ * The compiler needs these records before it checks, registers, or runs a Play artifact.
3773
3774
  */
3774
3775
  async compilePlayManifest(input) {
3775
3776
  const retryDelays = COMPILE_MANIFEST_RETRY_DELAYS_MS.slice(
@@ -3816,8 +3817,8 @@ var DeeplineClient = class _DeeplineClient {
3816
3817
  /**
3817
3818
  * Register an already-bundled play artifact and start a run from it.
3818
3819
  *
3819
- * This is the low-level file-backed run path used by SDK/CLI packaging
3820
- * wrappers after local bundling has produced the runtime artifact.
3820
+ * SDK and CLI packaging wrappers use this low-level run method for file-based Plays.
3821
+ * Local bundling must produce the runtime artifact first.
3821
3822
  */
3822
3823
  async startPlayRunFromBundle(input) {
3823
3824
  const compilerManifest = input.compilerManifest ?? await this.compilePlayManifest({
@@ -3855,15 +3856,15 @@ var DeeplineClient = class _DeeplineClient {
3855
3856
  /**
3856
3857
  * Register a bundled play artifact and start a run from the live revision.
3857
3858
  *
3858
- * Convenience wrapper around {@link registerPlayArtifact} plus
3859
- * {@link startPlayRun}. This is the canonical file-backed path used by wrappers.
3860
- * The returned id can be passed to {@link getPlayStatus} to retrieve the same
3861
- * durable `{ result }` object that the CLI prints after `plays run` completes.
3859
+ * This method wraps {@link registerPlayArtifact} and {@link startPlayRun}.
3860
+ * Packaging wrappers use this method for file-based Plays.
3861
+ * Pass the returned ID to {@link getPlayStatus}.
3862
+ * The method returns the same durable `{ result }` object that the CLI prints after `plays run` completes.
3862
3863
  *
3863
- * @param code - Source string fallback; the bundled artifact should be passed in `options.artifact`
3864
- * @param csvPath - Path to input CSV file, or `null`
3865
- * @param name - Play name (extracted from source if omitted)
3866
- * @param options - Additional submission options
3864
+ * @param code - Fallback source string. Pass the bundled artifact in `options.artifact`.
3865
+ * @param csvPath - Path to the input CSV file, or `null`.
3866
+ * @param name - Play name. The SDK derives it from the source when omitted.
3867
+ * @param options - Additional submission options.
3867
3868
  * @returns Workflow metadata with `workflowId`
3868
3869
  *
3869
3870
  * @example
@@ -3956,9 +3957,8 @@ var DeeplineClient = class _DeeplineClient {
3956
3957
  /**
3957
3958
  * Mint short-lived presigned upload targets for staged play files.
3958
3959
  *
3959
- * Internal primitive used by {@link stagePlayFiles}. The server returns an
3960
- * already-staged ref (no upload needed) for content-addressed files it
3961
- * already holds, or a presigned PUT URL the caller uploads the body to.
3960
+ * 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.
3961
+ * For other files, the server returns a presigned PUT URL. Upload the file body to that URL.
3962
3962
  */
3963
3963
  async mintStagedPlayFileUploads(files) {
3964
3964
  return mintStagedPlayFileUploads(this.http, files);
@@ -3966,8 +3966,7 @@ var DeeplineClient = class _DeeplineClient {
3966
3966
  /**
3967
3967
  * Resolve staged play files by content hash without uploading bytes.
3968
3968
  *
3969
- * Missing files are returned so callers can upload only the files the server
3970
- * does not already have.
3969
+ * The response identifies missing files. Callers need to upload only these files.
3971
3970
  */
3972
3971
  async resolveStagedPlayFiles(files) {
3973
3972
  return this.http.post("/api/v2/plays/files/stage", { files });
@@ -4451,11 +4450,11 @@ var DeeplineClient = class _DeeplineClient {
4451
4450
  /**
4452
4451
  * Start a fresh run from a prior run's retained input and pinned revision.
4453
4452
  *
4454
- * Every invocation sends an `Idempotency-Key`. When the caller does not
4455
- * supply one, a fresh key is generated once per call so the transport's own
4456
- * network retries converge on a single rerun. Pass the same explicit key
4457
- * across separate invocations to repeat an ambiguous result safely; a
4458
- * different key intentionally starts another rerun.
4453
+ * Every invocation sends an `Idempotency-Key`.
4454
+ * When the caller supplies no key, the SDK creates a fresh key once per call.
4455
+ * The transport reuses that key for network retries, so those retries produce one rerun.
4456
+ * Reuse an explicit key across separate invocations when the previous result is uncertain.
4457
+ * A different key starts another rerun.
4459
4458
  */
4460
4459
  async rerun(runId, options) {
4461
4460
  const idempotencyKey = options?.idempotencyKey?.trim();
@@ -4795,8 +4794,8 @@ var DeeplineClient = class _DeeplineClient {
4795
4794
  );
4796
4795
  }
4797
4796
  /**
4798
- * Stop every active run visible to the current workspace, or with
4799
- * `dryRun: true` enumerate the exact candidates without cancelling anything.
4797
+ * Stop every active run visible to the current workspace.
4798
+ * With `dryRun: true`, list the exact candidates without cancelling any run.
4800
4799
  *
4801
4800
  * This is the SDK equivalent of:
4802
4801
  *
@@ -4805,8 +4804,8 @@ var DeeplineClient = class _DeeplineClient {
4805
4804
  * deepline runs stop-all --reason "stale lock"
4806
4805
  * ```
4807
4806
  *
4808
- * Use this when a failed parent run left child or waiting runs active and you
4809
- * need to clear the workspace run-slot state without knowing each run id.
4807
+ * Use this method when a failed parent leaves active child or waiting runs.
4808
+ * The method clears workspace run-slot state without requiring each run ID.
4810
4809
  */
4811
4810
  async stopAllRuns(options) {
4812
4811
  const dryRun = options?.dryRun === true;
@@ -4827,8 +4826,8 @@ var DeeplineClient = class _DeeplineClient {
4827
4826
  return result;
4828
4827
  }
4829
4828
  /**
4830
- * List one page of callable plays; grep retains exhaustive matching results.
4831
- * Use listPlaysPage to retain pagination metadata.
4829
+ * List one page of callable Plays. With grep, the method retains all matching results.
4830
+ * Use listPlaysPage for pagination metadata.
4832
4831
  *
4833
4832
  * Pass `origin: "prebuilt"` for Deepline-managed prebuilts or
4834
4833
  * `origin: "owned"` for org-owned plays.
@@ -5265,8 +5264,7 @@ var DeeplineClient = class _DeeplineClient {
5265
5264
  /**
5266
5265
  * Get the full definition and state of a named play.
5267
5266
  *
5268
- * Returns the play's revision state (draft, live), recent runs,
5269
- * sheet processing summary, and database URL.
5267
+ * The response includes revision state (draft or live), recent runs, a summary of sheet processing, and the database URL.
5270
5268
  *
5271
5269
  * @param name - Play name
5272
5270
  * @returns Complete play detail
@@ -5303,10 +5301,10 @@ var DeeplineClient = class _DeeplineClient {
5303
5301
  /**
5304
5302
  * Get a normalized play description suitable for agents and CLIs.
5305
5303
  *
5306
- * The description includes runnable examples, input/output summaries, clone
5307
- * guidance, revision state, and latest run metadata when available. Pass
5308
- * `{ pipeline: true }` to include the compiled pipeline, which can be
5309
- * hundreds of kilobytes and is otherwise left out.
5304
+ * The description includes runnable examples, input and output summaries, clone guidance, and revision state.
5305
+ * It also includes metadata for the latest run when available.
5306
+ * Set `{ pipeline: true }` to include the compiled pipeline.
5307
+ * The pipeline can be hundreds of kilobytes. The response omits it by default.
5310
5308
  */
5311
5309
  async describePlay(name, options = {}) {
5312
5310
  if (options.pipeline) {
@@ -5355,8 +5353,7 @@ var DeeplineClient = class _DeeplineClient {
5355
5353
  * Make a play revision live.
5356
5354
  *
5357
5355
  * When `revisionId` is omitted, the current working revision becomes live.
5358
- * The live version is what executes when the play is run by name without
5359
- * specifying an explicit revision.
5356
+ * A call by Play name executes the live revision unless the caller specifies another revision.
5360
5357
  *
5361
5358
  * @param name - Play name
5362
5359
  * @param request - Optional explicit revision to make live
@@ -5615,9 +5612,9 @@ var DeeplineClient = class _DeeplineClient {
5615
5612
  return event;
5616
5613
  }
5617
5614
  /**
5618
- * What Deepline has billed each run so far (customer-visible credits, never
5619
- * provider spend) and whether any of its charges is still settling — the
5620
- * same read the dashboard's runs grid shows. `GET /api/v2/runs/billing`.
5615
+ * Read Deepline credits billed to each run and whether charges are still settling.
5616
+ * The response never shows provider spend. The dashboard runs grid uses the same read.
5617
+ * HTTP endpoint: `GET /api/v2/runs/billing`.
5621
5618
  */
5622
5619
  async getRunBilling(runIds) {
5623
5620
  const params = new URLSearchParams();
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getActiveCliProgress
3
- } from "./chunk-GAMFK2ZP.mjs";
3
+ } from "./chunk-67RWR34T.mjs";
4
4
  import {
5
5
  printCommandEnvelope
6
- } from "./chunk-5IGBBYXH.mjs";
6
+ } from "./chunk-4CFULMRB.mjs";
7
7
  import {
8
8
  DEFAULT_SKILL_AGENTS,
9
9
  KNOWN_SKILL_AGENTS,
@@ -22,13 +22,13 @@ import {
22
22
  sdkCliStateDirPath,
23
23
  skillsAgentPathSegment,
24
24
  writeSdkSkillsLocalVersion
25
- } from "./chunk-CGX4NSS3.mjs";
25
+ } from "./chunk-SD7MXAJA.mjs";
26
26
  import {
27
27
  DeeplineError
28
28
  } from "./chunk-NXGCO4JB.mjs";
29
29
  import {
30
30
  SDK_RELEASE
31
- } from "./chunk-42RUJLQI.mjs";
31
+ } from "./chunk-WTT6CLED.mjs";
32
32
 
33
33
  // src/cli/commands/skills.ts
34
34
  import { spawn as spawn2 } from "child_process";
@@ -1,9 +1,10 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;// src/cli/progress.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
+
3
+ var _chunkQ3PUHXOYjs = require('./chunk-Q3PUHXOY.js');
4
+
5
+ // src/cli/progress.ts
2
6
  var _worker_threads = require('worker_threads');
3
7
  var CliProgress = (_class = class {
4
- constructor(enabled) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);
5
- this.enabled = enabled;
6
- }
7
8
  __init() {this.lastMessage = null}
8
9
  __init2() {this.interactive = Boolean(process.stderr.isTTY)}
9
10
  __init3() {this.grey = "\x1B[90m"}
@@ -11,6 +12,11 @@ var CliProgress = (_class = class {
11
12
  __init5() {this.dim = "\x1B[2m"}
12
13
  __init6() {this.reset = "\x1B[0m"}
13
14
  __init7() {this.worker = null}
15
+
16
+ // --json output is one JSON document: progress never renders under it.
17
+ constructor(enabled) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);
18
+ this.enabled = enabled && !_chunkQ3PUHXOYjs.isJsonOutputMode.call(void 0, );
19
+ }
14
20
  phase(message) {
15
21
  if (!this.enabled || this.lastMessage === message) {
16
22
  return;
@@ -34,6 +40,7 @@ var CliProgress = (_class = class {
34
40
  this.settle("\u2717");
35
41
  }
36
42
  writeLogLine(line) {
43
+ if (_chunkQ3PUHXOYjs.isJsonOutputMode.call(void 0, )) return;
37
44
  if (!this.enabled) {
38
45
  process.stderr.write(`${line}
39
46
  `);
@@ -2,14 +2,17 @@
2
2
  var CONVENTIONS = `
3
3
  [[cli:
4
4
  Conventions (apply to every command):
5
- Output mode: readable text by default. --json prints JSON. tools execute
6
- is the exception: it prints JSON; --output-format csv prints a readable
7
- summary and writes the rows to a CSV file.
8
- Streams: stdout carries only the command result. Progress, update notices,
9
- skills-sync notes, and warnings go to stderr.
10
- Piping JSON: pass --json only when a program parses the output, and parse
11
- stdout alone. 2>&1 puts stderr text in front of the JSON, so the parse
12
- fails and the real error is hidden; | head and | tail cut the document.
5
+ Output mode: readable text by default. Add --json for machine-readable
6
+ output: stdout is one JSON document, including errors and notices;
7
+ stderr stays empty. tools execute is the exception: it prints JSON;
8
+ --output-format csv prints a readable summary and writes the rows to a
9
+ CSV file.
10
+ Streams: without --json, stdout carries only the command result. Progress,
11
+ update notices, skills-sync notes, and warnings go to stderr.
12
+ Piping JSON: pass --json only when a program parses the output. Under
13
+ --json, usage errors are {ok:false,error:{code,message,details.help}}
14
+ and notices (update available, skills, auth) arrive in notices[];
15
+ | head and | tail cut the document.
13
16
  JSON envelope: most payloads include render.sections[].lines (the human
14
17
  summary as text), next.* (exact follow-up commands; run commands name
15
18
  them actions.*Cmd), and command_context.
@@ -269,13 +272,18 @@ When:
269
272
  reports a balance or insufficient-credits error.
270
273
  [[cli:
271
274
  Input:
272
- No arguments. Prints one line, "Balance: N credits". --verbose adds
273
- reservations and usage awaiting settlement; --json returns the full record.
275
+ No arguments. Prints the posted balance, spendable credits and pending
276
+ spending. --verbose adds exposure details; --json returns the full record.
274
277
  ]]
275
278
  [[cli:
276
279
  Output (JSON):
277
280
  balance (Deepline credits), balance_display, rough_usd_balance,
278
- balance_status, and render.sections. The balance includes other activity
281
+ balance_status, posted_balance_credits, pending_spend_credits,
282
+ spendable_balance_credits, spendable_balance_status and render.sections.
283
+ The three credit amounts come from the same admission snapshot. Spendable
284
+ credits subtract pending spending; a partial exposure diagnostic is not
285
+ spendable capacity. Null/unavailable means complete capacity could not be read.
286
+ Spending limits can still block a funded call. The balance includes other activity
279
287
  in the workspace, so a before and after difference does not isolate one
280
288
  command; use billing usage for that.
281
289
  ]]
@@ -485,7 +493,8 @@ When:
485
493
  [[cli:
486
494
  Input:
487
495
  The tool id. Prints readable text by default; read that
488
- form and pass --json only for a program. --pricing-only, --schema-only,
496
+ form and pass --json only for a program; stdout is then one JSON
497
+ document. --pricing-only, --schema-only,
489
498
  --examples-only, --getters-only print one section. --out <path> saves the
490
499
  output to a file. get is an alias of describe, and deepline describe <id>
491
500
  is the same read for a tool, a play, or a monitor type.
@@ -815,6 +824,7 @@ When:
815
824
  Input:
816
825
  The play reference from search (prebuilt/... or <workspace>/...).
817
826
  --compact shortens schemas. --json prints JSON.
827
+ To parse the output, add --json; stdout is then one JSON document.
818
828
  ]]
819
829
  [[cli:
820
830
  Output (JSON):
@@ -943,7 +953,8 @@ Output (JSON, printed when the run ends):
943
953
  exact follow-up commands: getRunCmd, getFullRunCmd, getBillingCmd,
944
954
  getLogsCmd, exportDatasetCmds[], queryTableSqlCmds[]. Rows are not in this
945
955
  payload. Progress lines are printed while it waits; the JSON is the last
946
- thing printed.
956
+ thing printed. To parse it, add --json: progress is suppressed and stdout
957
+ is one JSON document.
947
958
  ]]
948
959
  [[mcp:
949
960
  Output:
@@ -1168,6 +1179,7 @@ Input:
1168
1179
  billing and timeline (large). --log-failed attaches the failure log window.
1169
1180
  --input prints the original input (may contain customer data). --json
1170
1181
  prints JSON; --json run.status,datasets.name selects fields.
1182
+ To parse the output (also with --full), add --json; stdout is then one JSON document.
1171
1183
  ]]
1172
1184
  [[cli:
1173
1185
  Output (JSON):
@@ -1254,6 +1266,7 @@ Input:
1254
1266
  returned more than one (default: the returned dataset, usually
1255
1267
  result.rows). --metadata-out <path.json> writes the export metadata. --json
1256
1268
  prints the receipt as JSON; it does not change the file format.
1269
+ To parse the receipt, add --json; stdout is then one JSON document.
1257
1270
  ]]
1258
1271
  Output (JSON):
1259
1272
  csv_path or json_path (absolute), source, rowCount, columns[] (the CSV
@@ -1343,7 +1356,8 @@ Input:
1343
1356
  Output:
1344
1357
  Log lines (human) or a JSON envelope; with --out, the file path. Follow
1345
1358
  next.logs for the next page of events, and pass nextCursor to --cursor for
1346
- older text logs.
1359
+ older text logs. To parse the output, add --json; stdout is then one JSON
1360
+ document.
1347
1361
  ]]
1348
1362
  Cost:
1349
1363
  Free.
@@ -3,15 +3,15 @@
3
3
  var _chunkZM2YPJQJjs = require('./chunk-ZM2YPJQJ.js');
4
4
 
5
5
 
6
- var _chunkAPLRSERFjs = require('./chunk-APLRSERF.js');
6
+ var _chunkAUMD2VXPjs = require('./chunk-AUMD2VXP.js');
7
7
 
8
8
 
9
9
 
10
- var _chunkNYDRX6JJjs = require('./chunk-NYDRX6JJ.js');
10
+ var _chunkQ3PUHXOYjs = require('./chunk-Q3PUHXOY.js');
11
11
 
12
12
 
13
13
 
14
- var _chunkYSAZVLJDjs = require('./chunk-YSAZVLJD.js');
14
+ var _chunkQUAQX3FQjs = require('./chunk-QUAQX3FQ.js');
15
15
 
16
16
  // src/cli/commands/search.ts
17
17
  var _commander = require('commander');
@@ -21,7 +21,7 @@ var _fs = require('fs');
21
21
  var _path = require('path');
22
22
  var SEARCH_REF_TTL_MS = 15 * 6e4;
23
23
  function lastSearchPath() {
24
- return _path.join.call(void 0, _chunkYSAZVLJDjs.sdkCliStateDirPath.call(void 0, _chunkYSAZVLJDjs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
24
+ return _path.join.call(void 0, _chunkQUAQX3FQjs.sdkCliStateDirPath.call(void 0, _chunkQUAQX3FQjs.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
25
25
  }
26
26
  function rememberSearchRef(searchRef) {
27
27
  try {
@@ -167,7 +167,7 @@ function searchRow(item) {
167
167
  }
168
168
  function renderSearchResults(result) {
169
169
  if (result.results.length === 0)
170
- return _chunkNYDRX6JJjs.renderCommandEnvelopeText.call(void 0, result);
170
+ return _chunkQ3PUHXOYjs.renderCommandEnvelopeText.call(void 0, result);
171
171
  const rows = result.results.map(searchRow);
172
172
  const kinds = new Set(rows.map((row) => row.kind));
173
173
  const onlyTools = kinds.size === 1 && kinds.has("tool");
@@ -198,7 +198,7 @@ function renderSearchResults(result) {
198
198
  actions: _optionalChain([render, 'optionalAccess', _11 => _11.actions])
199
199
  };
200
200
  const followUps = _optionalChain([remaining, 'access', _12 => _12.sections, 'optionalAccess', _13 => _13.length]) || _optionalChain([remaining, 'access', _14 => _14.actions, 'optionalAccess', _15 => _15.length]) ? `
201
- ${_chunkNYDRX6JJjs.renderCommandEnvelopeText.call(void 0, { render: remaining })}` : "";
201
+ ${_chunkQ3PUHXOYjs.renderCommandEnvelopeText.call(void 0, { render: remaining })}` : "";
202
202
  const notes = rows.flatMap(
203
203
  (row) => row.notes.map((note) => ` ${row.id}: ${note}`)
204
204
  );
@@ -275,7 +275,7 @@ async function runSearch(queryInput, options, types, exclude = []) {
275
275
  console.error(USAGE);
276
276
  return 1;
277
277
  }
278
- const { search_ref: searchRef, ...result } = await new (0, _chunkAPLRSERFjs.DeeplineClient)().search({
278
+ const { search_ref: searchRef, ...result } = await new (0, _chunkAUMD2VXPjs.DeeplineClient)().search({
279
279
  query,
280
280
  types,
281
281
  exclude,
@@ -289,7 +289,7 @@ async function runSearch(queryInput, options, types, exclude = []) {
289
289
  });
290
290
  if (searchRef) rememberSearchRef(searchRef);
291
291
  pointAtDescribe(result);
292
- _chunkNYDRX6JJjs.printCommandEnvelope.call(void 0, result, {
292
+ _chunkQ3PUHXOYjs.printCommandEnvelope.call(void 0, result, {
293
293
  json: options.json === true,
294
294
  text: renderSearchResults(result)
295
295
  });