deepline 0.3.407 → 0.3.409

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 (127) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +8 -1
  2. package/dist/bundling-sources/sdk/src/play.ts +13 -0
  3. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  4. package/dist/bundling-sources/sdk/src/types.ts +23 -0
  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/runner-app/index.ts +2 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/local-process.ts +15 -6
  10. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +188 -45
  11. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +22 -4
  12. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +10 -4
  13. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +72 -0
  14. package/dist/bundling-sources/shared_libs/play-runtime/webhook-receipt-source-commit-retry.ts +90 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/worker-api-types.ts +5 -0
  16. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +6 -0
  17. package/dist/cli/{auth-WURWNNLE.mjs → auth-5HIIACF7.mjs} +4 -4
  18. package/dist/cli/auth-F6BX32XZ.js +40 -0
  19. package/dist/cli/{billing-2QJGXGJX.js → billing-4275N7FL.js} +92 -85
  20. package/dist/cli/{billing-BP3E6WIM.mjs → billing-EVZ3ZWKC.mjs} +23 -16
  21. package/dist/cli/{chunk-WXLOW623.mjs → chunk-264PC2RN.mjs} +14 -7
  22. package/dist/cli/{chunk-RMZAOYDN.js → chunk-2GI3QD3L.js} +53 -53
  23. package/dist/cli/{chunk-ZBCTXQ3P.mjs → chunk-2PRO2JTX.mjs} +1 -1
  24. package/dist/cli/{chunk-GAMFK2ZP.mjs → chunk-44ZTYHMQ.mjs} +10 -3
  25. package/dist/cli/{chunk-G4LJS2RE.js → chunk-53HN7WZN.js} +8 -8
  26. package/dist/cli/{chunk-URWF7NGQ.js → chunk-5MLCBXXU.js} +36 -15
  27. package/dist/cli/{chunk-XT6GG3QO.mjs → chunk-7AALNGTA.mjs} +3 -3
  28. package/dist/cli/{chunk-WJYPBHTE.js → chunk-ALD4COBH.js} +11 -4
  29. package/dist/cli/{chunk-RZLXVHNO.js → chunk-AU4OFDFX.js} +26 -26
  30. package/dist/cli/{chunk-N6OAMAO5.mjs → chunk-BEVLCKXG.mjs} +1 -1
  31. package/dist/cli/{chunk-7LKYHZVB.js → chunk-DEC3JECC.js} +1 -1
  32. package/dist/cli/{chunk-UFFSOV6I.mjs → chunk-FHPCKULR.mjs} +2 -2
  33. package/dist/cli/{chunk-THHM4DPE.js → chunk-FJCIUF34.js} +4 -4
  34. package/dist/cli/{chunk-H6EWQFPQ.js → chunk-GAICVLKL.js} +2 -2
  35. package/dist/cli/{chunk-4TV43THC.mjs → chunk-IT3XBJQR.mjs} +4 -4
  36. package/dist/cli/{chunk-UFS752TU.mjs → chunk-J6DCKJNM.mjs} +5 -1
  37. package/dist/cli/{chunk-AYHLUHE5.js → chunk-JGHG4NBA.js} +6 -2
  38. package/dist/cli/{chunk-BKC6VMYZ.mjs → chunk-JRAVVJ3T.mjs} +73 -4
  39. package/dist/cli/{chunk-ZI2ZNDJK.mjs → chunk-LFSHGNT2.mjs} +36 -15
  40. package/dist/cli/{chunk-L25GBGQU.mjs → chunk-N44JHMKY.mjs} +6 -6
  41. package/dist/cli/{chunk-QJAX7QN7.mjs → chunk-NZSF57UO.mjs} +2 -2
  42. package/dist/cli/{chunk-IY6GKJ4O.js → chunk-O3VSXP2F.js} +50 -50
  43. package/dist/cli/{chunk-J67NU4MQ.mjs → chunk-PBZYY7VZ.mjs} +5 -2
  44. package/dist/cli/{chunk-G6U74WNM.js → chunk-RTCDW2GU.js} +15 -15
  45. package/dist/cli/{chunk-UPEOEYZ3.mjs → chunk-TQNHMWUR.mjs} +1 -1
  46. package/dist/cli/{chunk-KUQAU5MG.js → chunk-V76R6HMV.js} +10 -7
  47. package/dist/cli/{chunk-6JZZNP5G.mjs → chunk-VWBTTJYQ.mjs} +2 -2
  48. package/dist/cli/{chunk-SOQIPKF2.js → chunk-WHG43Z67.js} +8 -8
  49. package/dist/cli/{chunk-Y6CX4QPR.js → chunk-WLOCMJWV.js} +67 -67
  50. package/dist/cli/{chunk-QJBJZVG6.js → chunk-WNUR6VP5.js} +15 -8
  51. package/dist/cli/{chunk-P7HOTKOK.mjs → chunk-WYQO2CBS.mjs} +4 -4
  52. package/dist/cli/{chunk-D2ZRMZKF.js → chunk-YD7B53RW.js} +99 -30
  53. package/dist/cli/command-docs.js +2 -2
  54. package/dist/cli/command-docs.mjs +1 -1
  55. package/dist/cli/{csv-N6KYTG7L.mjs → csv-A2MP6EFV.mjs} +3 -3
  56. package/dist/cli/{csv-7E5BE23B.js → csv-BBOTCGQY.js} +12 -12
  57. package/dist/cli/{db-XMBJNVBD.mjs → db-3W5DMTUX.mjs} +4 -4
  58. package/dist/cli/{db-4VLZP33O.js → db-G4CODDCA.js} +25 -25
  59. package/dist/cli/{describe-4I6EIVXD.js → describe-PQTQ5B6F.js} +11 -11
  60. package/dist/cli/{describe-WERH4TD2.mjs → describe-XYJ2ZT4M.mjs} +7 -7
  61. package/dist/cli/describe-core.d.mts +2 -2
  62. package/dist/cli/describe-core.d.ts +2 -2
  63. package/dist/cli/{executions-W7TWJRBK.js → executions-TLANVR7Y.js} +6 -6
  64. package/dist/cli/{executions-JWQXE7G6.mjs → executions-UR67CA5H.mjs} +4 -4
  65. package/dist/cli/{feedback-FMGRC6KO.js → feedback-6C2YTRJL.js} +7 -7
  66. package/dist/cli/{feedback-OEJFX4F7.mjs → feedback-WHCMGEIL.mjs} +3 -3
  67. package/dist/cli/{git-IVC4KHXX.mjs → git-GWLB6VSA.mjs} +4 -4
  68. package/dist/cli/git-VQFF6D7C.js +24 -0
  69. package/dist/cli/index.js +204 -127
  70. package/dist/cli/index.mjs +124 -47
  71. package/dist/cli/{legacy-noops-LT36CLWZ.mjs → legacy-noops-KF4XIFEF.mjs} +4 -4
  72. package/dist/cli/{legacy-noops-X3BQ7MUK.js → legacy-noops-ZUFA7RWI.js} +7 -7
  73. package/dist/cli/{monitors-MNLCELF7.mjs → monitors-6UOIDIMB.mjs} +4 -4
  74. package/dist/cli/{monitors-DLIIAVLW.js → monitors-TB3K2IVE.js} +84 -84
  75. package/dist/cli/{org-CYHDEW7P.js → org-CKWMBPIR.js} +64 -64
  76. package/dist/cli/{org-QV5LMUPT.mjs → org-WGHHMVDZ.mjs} +4 -4
  77. package/dist/cli/{play-5Z4ROZ3P.mjs → play-LYPAXCLD.mjs} +70 -18
  78. package/dist/cli/{play-MEFXC2QA.js → play-N2B3KAVS.js} +345 -293
  79. package/dist/cli/{providers-FJLYSHB3.mjs → providers-6DI5BVZJ.mjs} +4 -4
  80. package/dist/cli/{providers-2MKUNFBQ.js → providers-UR42MD6Z.js} +7 -7
  81. package/dist/cli/{quickstart-ULWXKAOT.js → quickstart-FCJG4XGB.js} +5 -5
  82. package/dist/cli/{quickstart-PQO3OQRT.mjs → quickstart-MNA2S6PO.mjs} +3 -3
  83. package/dist/cli/search-NCEEONMQ.js +30 -0
  84. package/dist/cli/{search-KGAAXMDG.mjs → search-VPPYUJ2M.mjs} +5 -5
  85. package/dist/cli/{secrets-PD5I3KAF.mjs → secrets-DRI4W7Z5.mjs} +4 -4
  86. package/dist/cli/{secrets-X2VGG2PO.js → secrets-QOSMVO36.js} +13 -13
  87. package/dist/cli/{sessions-R3XAKTBQ.js → sessions-3WYKQABW.js} +5 -5
  88. package/dist/cli/{sessions-3WVEU4PE.mjs → sessions-DQNUKP43.mjs} +4 -4
  89. package/dist/cli/{settings-645RSFQX.mjs → settings-DWDK3Y2R.mjs} +8 -8
  90. package/dist/cli/{settings-ZIDO3IP6.js → settings-JUGGCOPS.js} +75 -75
  91. package/dist/cli/{setup-LH5HOZ3D.js → setup-AWBHNYXK.js} +42 -42
  92. package/dist/cli/{setup-LISKIJKP.mjs → setup-D5DWVNY4.mjs} +7 -7
  93. package/dist/cli/skills-AKPAJVSO.js +29 -0
  94. package/dist/cli/{skills-VVQJHLSF.mjs → skills-YV2XR35J.mjs} +5 -5
  95. package/dist/cli/{tools-FTPJCNAM.js → tools-RBKEK6PM.js} +8 -8
  96. package/dist/cli/{tools-Y3LOMXFT.mjs → tools-VFJYHNV2.mjs} +7 -7
  97. package/dist/cli/{update-DOBNQNJI.mjs → update-IM6VOTGL.mjs} +7 -7
  98. package/dist/cli/update-VFNUBLDA.js +29 -0
  99. package/dist/cli/{workflow-ZMAA5VCN.mjs → workflow-26URBWPV.mjs} +5 -5
  100. package/dist/cli/{workflow-LGENKZBV.js → workflow-3BS6U6SL.js} +15 -15
  101. package/dist/{client-IrPHUE5J.d.ts → client-BMjJFpan.d.ts} +28 -2
  102. package/dist/{client-6rEB46Lv.d.mts → client-BfInrZPB.d.mts} +28 -2
  103. package/dist/{compiler-manifest-BHnXE43X.d.ts → compiler-manifest-Ycx-hoAr.d.mts} +2 -0
  104. package/dist/{compiler-manifest-BHnXE43X.d.mts → compiler-manifest-Ycx-hoAr.d.ts} +2 -0
  105. package/dist/{index-Da_Y8z5e.d.mts → index-CZXgiN3E.d.mts} +1 -1
  106. package/dist/{index-SODb2ROS.d.ts → index-NPG5pqxQ.d.ts} +1 -1
  107. package/dist/index.d.mts +5 -5
  108. package/dist/index.d.ts +5 -5
  109. package/dist/index.js +26 -9
  110. package/dist/index.mjs +23 -6
  111. package/dist/install-integrity.json +86 -84
  112. package/dist/plays/bundle-play-file.d.mts +3 -3
  113. package/dist/plays/bundle-play-file.d.ts +3 -3
  114. package/dist/plays/play-description.d.mts +2 -2
  115. package/dist/plays/play-description.d.ts +2 -2
  116. package/dist/plays/run-request.d.mts +2 -2
  117. package/dist/plays/run-request.d.ts +2 -2
  118. package/dist/release.d.mts +1 -1
  119. package/dist/release.d.ts +1 -1
  120. package/dist/release.js +2 -2
  121. package/dist/release.mjs +1 -1
  122. package/package.json +1 -1
  123. package/dist/cli/auth-4JTX6AGM.js +0 -40
  124. package/dist/cli/git-OFXE7G4X.js +0 -24
  125. package/dist/cli/search-ANKSJ224.js +0 -30
  126. package/dist/cli/skills-WLHYSVQA.js +0 -29
  127. package/dist/cli/update-A622H2DZ.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.
@@ -754,7 +763,8 @@ Cost:
754
763
  core: `
755
764
  Purpose:
756
765
  Inventory of saved and prebuilt plays, one bounded page at a time.[[cli: It is
757
- the command that carries cost estimates.]]
766
+ the command that carries cost estimates.]][[mcp: Search returns Play summaries;
767
+ deepline_describe_play returns input/output schemas and CSV contracts.]]
758
768
  When:
759
769
  [[cli:
760
770
  To price a play before running it: plays list --show-cost, then read the
@@ -778,6 +788,12 @@ Output (JSON):
778
788
  next (the next-page command), render.sections with a "cost estimate:"
779
789
  line per play.
780
790
  ]]
791
+ [[mcp:
792
+ Output:
793
+ data[] with Play names, references, descriptions, ownership, and revision
794
+ metadata. Use deepline_describe_play for input/output schemas and CSV
795
+ contracts before running a Play.
796
+ ]]
781
797
  Cost:
782
798
  Free.
783
799
  [[cli:
@@ -815,6 +831,7 @@ When:
815
831
  Input:
816
832
  The play reference from search (prebuilt/... or <workspace>/...).
817
833
  --compact shortens schemas. --json prints JSON.
834
+ To parse the output, add --json; stdout is then one JSON document.
818
835
  ]]
819
836
  [[cli:
820
837
  Output (JSON):
@@ -943,7 +960,8 @@ Output (JSON, printed when the run ends):
943
960
  exact follow-up commands: getRunCmd, getFullRunCmd, getBillingCmd,
944
961
  getLogsCmd, exportDatasetCmds[], queryTableSqlCmds[]. Rows are not in this
945
962
  payload. Progress lines are printed while it waits; the JSON is the last
946
- thing printed.
963
+ thing printed. To parse it, add --json: progress is suppressed and stdout
964
+ is one JSON document.
947
965
  ]]
948
966
  [[mcp:
949
967
  Output:
@@ -1168,6 +1186,7 @@ Input:
1168
1186
  billing and timeline (large). --log-failed attaches the failure log window.
1169
1187
  --input prints the original input (may contain customer data). --json
1170
1188
  prints JSON; --json run.status,datasets.name selects fields.
1189
+ To parse the output (also with --full), add --json; stdout is then one JSON document.
1171
1190
  ]]
1172
1191
  [[cli:
1173
1192
  Output (JSON):
@@ -1254,6 +1273,7 @@ Input:
1254
1273
  returned more than one (default: the returned dataset, usually
1255
1274
  result.rows). --metadata-out <path.json> writes the export metadata. --json
1256
1275
  prints the receipt as JSON; it does not change the file format.
1276
+ To parse the receipt, add --json; stdout is then one JSON document.
1257
1277
  ]]
1258
1278
  Output (JSON):
1259
1279
  csv_path or json_path (absolute), source, rowCount, columns[] (the CSV
@@ -1343,7 +1363,8 @@ Input:
1343
1363
  Output:
1344
1364
  Log lines (human) or a JSON envelope; with --out, the file path. Follow
1345
1365
  next.logs for the next page of events, and pass nextCursor to --cursor for
1346
- older text logs.
1366
+ older text logs. To parse the output, add --json; stdout is then one JSON
1367
+ document.
1347
1368
  ]]
1348
1369
  Cost:
1349
1370
  Free.
@@ -3,15 +3,15 @@ import {
3
3
  } from "./chunk-LJ5747UC.mjs";
4
4
  import {
5
5
  DeeplineClient
6
- } from "./chunk-J67NU4MQ.mjs";
6
+ } from "./chunk-PBZYY7VZ.mjs";
7
7
  import {
8
8
  printCommandEnvelope,
9
9
  renderCommandEnvelopeText
10
- } from "./chunk-BKC6VMYZ.mjs";
10
+ } from "./chunk-JRAVVJ3T.mjs";
11
11
  import {
12
12
  resolveConfig,
13
13
  sdkCliStateDirPath
14
- } from "./chunk-ZBCTXQ3P.mjs";
14
+ } from "./chunk-2PRO2JTX.mjs";
15
15
 
16
16
  // src/cli/commands/search.ts
17
17
  import { Option } from "commander";
@@ -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 _chunkYD7B53RWjs = require('./chunk-YD7B53RW.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 && !_chunkYD7B53RWjs.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 (_chunkYD7B53RWjs.isJsonOutputMode.call(void 0, )) return;
37
44
  if (!this.enabled) {
38
45
  process.stderr.write(`${line}
39
46
  `);
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkD2ZRMZKFjs = require('./chunk-D2ZRMZKF.js');
5
+ var _chunkYD7B53RWjs = require('./chunk-YD7B53RW.js');
6
6
 
7
7
 
8
- var _chunkTHHM4DPEjs = require('./chunk-THHM4DPE.js');
8
+ var _chunkFJCIUF34js = require('./chunk-FJCIUF34.js');
9
9
 
10
10
  // src/cli/commands/git.ts
11
11
  function shellQuote(value) {
@@ -32,11 +32,11 @@ function renderDeployment(deployment) {
32
32
  return `${deployment.id} ${source} (${kind}) - ${deployment.status}${suffix}`;
33
33
  }
34
34
  async function handleList(options) {
35
- const { http } = _chunkD2ZRMZKFjs.getAuthedHttpClient.call(void 0, );
35
+ const { http } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
36
36
  const payload = await http.get(
37
37
  `/api/v2/play-projects${options.all ? "?includeDisabled=1" : ""}`
38
38
  );
39
- _chunkD2ZRMZKFjs.printCommandEnvelope.call(void 0,
39
+ _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
40
40
  {
41
41
  projects: payload.projects,
42
42
  count: payload.projects.length,
@@ -73,7 +73,7 @@ function describeInstallationStatus(installation) {
73
73
  }
74
74
  }
75
75
  async function handleStatus(options) {
76
- const { http } = _chunkD2ZRMZKFjs.getAuthedHttpClient.call(void 0, );
76
+ const { http } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
77
77
  const payload = await http.get("/api/v2/github/installation");
78
78
  const installation = payload.installation;
79
79
  const others = (_nullishCoalesce(payload.installations, () => ( []))).filter(
@@ -136,7 +136,7 @@ async function handleStatus(options) {
136
136
  )
137
137
  );
138
138
  }
139
- _chunkD2ZRMZKFjs.printCommandEnvelope.call(void 0,
139
+ _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
140
140
  {
141
141
  installation,
142
142
  installations: _nullishCoalesce(payload.installations, () => ( [])),
@@ -147,10 +147,10 @@ async function handleStatus(options) {
147
147
  );
148
148
  }
149
149
  async function handleRepos(options) {
150
- const { http } = _chunkD2ZRMZKFjs.getAuthedHttpClient.call(void 0, );
150
+ const { http } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
151
151
  const query = options.installation ? `?installationId=${encodeURIComponent(options.installation)}` : "";
152
152
  const payload = await http.get(`/api/v2/github/repos${query}`);
153
- _chunkD2ZRMZKFjs.printCommandEnvelope.call(void 0,
153
+ _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
154
154
  {
155
155
  installation: payload.installation,
156
156
  repositories: payload.repositories,
@@ -171,7 +171,7 @@ async function handleRepos(options) {
171
171
  }
172
172
  async function resolveRepoId(repo, installation) {
173
173
  if (/^\d+$/.test(repo)) return Number(repo);
174
- const { http } = _chunkD2ZRMZKFjs.getAuthedHttpClient.call(void 0, );
174
+ const { http } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
175
175
  const query = installation ? `?installationId=${encodeURIComponent(installation)}` : "";
176
176
  const payload = await http.get(
177
177
  `/api/v2/github/repos${query}`
@@ -188,7 +188,7 @@ async function resolveRepoId(repo, installation) {
188
188
  }
189
189
  async function handleLink(repo, options) {
190
190
  const repoId = await resolveRepoId(repo, options.installation);
191
- const { http } = _chunkD2ZRMZKFjs.getAuthedHttpClient.call(void 0, );
191
+ const { http } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
192
192
  const payload = await http.post("/api/v2/play-projects", {
193
193
  repoId,
194
194
  ...options.installation !== void 0 ? { installationId: options.installation } : {},
@@ -197,7 +197,7 @@ async function handleLink(repo, options) {
197
197
  ...options.branch !== void 0 ? { productionBranch: options.branch } : {},
198
198
  ...options.prChecks !== void 0 ? { checkOnPullRequest: options.prChecks } : {}
199
199
  });
200
- _chunkD2ZRMZKFjs.printCommandEnvelope.call(void 0,
200
+ _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
201
201
  {
202
202
  project: payload.project,
203
203
  render: {
@@ -220,11 +220,11 @@ async function handleLink(repo, options) {
220
220
  );
221
221
  }
222
222
  async function handleGet(id, options) {
223
- const { http } = _chunkD2ZRMZKFjs.getAuthedHttpClient.call(void 0, );
223
+ const { http } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
224
224
  const payload = await http.get(
225
225
  `/api/v2/play-projects/${encodeURIComponent(id)}`
226
226
  );
227
- _chunkD2ZRMZKFjs.printCommandEnvelope.call(void 0,
227
+ _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
228
228
  {
229
229
  project: payload.project,
230
230
  render: {
@@ -240,7 +240,7 @@ async function handleGet(id, options) {
240
240
  );
241
241
  }
242
242
  async function handleSet(id, options) {
243
- const { http } = _chunkD2ZRMZKFjs.getAuthedHttpClient.call(void 0, );
243
+ const { http } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
244
244
  const payload = await http.patch(
245
245
  `/api/v2/play-projects/${encodeURIComponent(id)}`,
246
246
  {
@@ -251,7 +251,7 @@ async function handleSet(id, options) {
251
251
  ...options.disabled !== void 0 ? { disabled: options.disabled } : {}
252
252
  }
253
253
  );
254
- _chunkD2ZRMZKFjs.printCommandEnvelope.call(void 0,
254
+ _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
255
255
  {
256
256
  project: payload.project,
257
257
  render: {
@@ -264,9 +264,9 @@ async function handleSet(id, options) {
264
264
  );
265
265
  }
266
266
  async function handleUnlink(id, options) {
267
- const { http } = _chunkD2ZRMZKFjs.getAuthedHttpClient.call(void 0, );
267
+ const { http } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
268
268
  await http.delete(`/api/v2/play-projects/${encodeURIComponent(id)}`);
269
- _chunkD2ZRMZKFjs.printCommandEnvelope.call(void 0,
269
+ _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
270
270
  {
271
271
  ok: true,
272
272
  id,
@@ -286,10 +286,10 @@ async function handleUnlink(id, options) {
286
286
  );
287
287
  }
288
288
  async function handleConnect(options) {
289
- const baseUrl = _chunkTHHM4DPEjs.resolveBaseUrlOnly.call(void 0, );
289
+ const baseUrl = _chunkFJCIUF34js.resolveBaseUrlOnly.call(void 0, );
290
290
  const connectUrl = `${baseUrl.replace(/\/$/, "")}/api/v2/github/connect`;
291
- const opened = _chunkD2ZRMZKFjs.openInBrowser.call(void 0, connectUrl);
292
- _chunkD2ZRMZKFjs.printCommandEnvelope.call(void 0,
291
+ const opened = _chunkYD7B53RWjs.openInBrowser.call(void 0, connectUrl);
292
+ _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
293
293
  {
294
294
  connectUrl,
295
295
  browser: opened,
@@ -311,7 +311,7 @@ async function handleConnect(options) {
311
311
  );
312
312
  }
313
313
  async function handleDeploymentsList(options) {
314
- const { http } = _chunkD2ZRMZKFjs.getAuthedHttpClient.call(void 0, );
314
+ const { http } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
315
315
  const query = new URLSearchParams();
316
316
  if (options.repo) query.set("projectId", options.repo);
317
317
  if (options.limit) query.set("limit", options.limit);
@@ -319,7 +319,7 @@ async function handleDeploymentsList(options) {
319
319
  const payload = await http.get(
320
320
  `/api/v2/deployments${suffix}`
321
321
  );
322
- _chunkD2ZRMZKFjs.printCommandEnvelope.call(void 0,
322
+ _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
323
323
  {
324
324
  deployments: payload.deployments,
325
325
  count: payload.deployments.length,
@@ -363,12 +363,12 @@ function renderDeploymentMonitorLines(results) {
363
363
  ]);
364
364
  }
365
365
  async function handleDeploymentGet(id, options) {
366
- const { http } = _chunkD2ZRMZKFjs.getAuthedHttpClient.call(void 0, );
366
+ const { http } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
367
367
  const payload = await http.get(`/api/v2/deployments/${encodeURIComponent(id)}`);
368
368
  const playLines = renderDeploymentPlayLines(payload.deployment.results);
369
369
  const monitorLines = renderDeploymentMonitorLines(payload.deployment.results);
370
370
  const repository = _nullishCoalesce(_optionalChain([payload, 'access', _10 => _10.project, 'optionalAccess', _11 => _11.repoFullName]), () => ( payload.deployment.repoFullName));
371
- _chunkD2ZRMZKFjs.printCommandEnvelope.call(void 0,
371
+ _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
372
372
  {
373
373
  deployment: payload.deployment,
374
374
  project: payload.project,
@@ -387,9 +387,9 @@ async function handleDeploymentGet(id, options) {
387
387
  );
388
388
  }
389
389
  async function handleDeploymentCancel(id, options) {
390
- const { http } = _chunkD2ZRMZKFjs.getAuthedHttpClient.call(void 0, );
390
+ const { http } = _chunkYD7B53RWjs.getAuthedHttpClient.call(void 0, );
391
391
  const payload = await http.post(`/api/v2/deployments/${encodeURIComponent(id)}/cancel`, {});
392
- _chunkD2ZRMZKFjs.printCommandEnvelope.call(void 0,
392
+ _chunkYD7B53RWjs.printCommandEnvelope.call(void 0,
393
393
  {
394
394
  cancelled: payload.cancelled,
395
395
  deployment: payload.deployment,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveShellSpawn
3
- } from "./chunk-4TV43THC.mjs";
3
+ } from "./chunk-IT3XBJQR.mjs";
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  import { spawnSync } from "child_process";
@@ -49,7 +49,7 @@ var SDK_RELEASE = {
49
49
  // getters keep their established compatibility behavior.
50
50
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
51
51
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
52
- version: "0.3.407",
52
+ version: "0.3.409",
53
53
  updateSummary: "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.",
54
54
  packageCapabilities: {
55
55
  updatePreferences: 1,
@@ -2,7 +2,7 @@ import {
2
2
  argsWantJson,
3
3
  openInBrowser,
4
4
  printCommandEnvelope
5
- } from "./chunk-BKC6VMYZ.mjs";
5
+ } from "./chunk-JRAVVJ3T.mjs";
6
6
  import {
7
7
  ACTIVE_ORG_ID_ENV,
8
8
  ACTIVE_ORG_NAME_ENV,
@@ -25,7 +25,7 @@ import {
25
25
  saveHostEnvValues,
26
26
  saveProjectDeeplineEnvValues,
27
27
  storedHostApiKey
28
- } from "./chunk-ZBCTXQ3P.mjs";
28
+ } from "./chunk-2PRO2JTX.mjs";
29
29
 
30
30
  // src/cli/commands/auth.ts
31
31
  import {
@@ -17,7 +17,7 @@ var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
17
17
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
18
18
 
19
19
 
20
- var _chunk7LKYHZVBjs = require('./chunk-7LKYHZVB.js');
20
+ var _chunkDEC3JECCjs = require('./chunk-DEC3JECC.js');
21
21
 
22
22
  // src/config.ts
23
23
 
@@ -649,9 +649,9 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
649
649
  }
650
650
 
651
651
  // src/version.ts
652
- var SDK_VERSION = _chunk7LKYHZVBjs.SDK_RELEASE.version;
653
- var SDK_API_MAJOR = _chunk7LKYHZVBjs.SDK_RELEASE.contracts.api.currentMajor;
654
- var SDK_API_CONTRACT = _nullishCoalesce(_chunk7LKYHZVBjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
652
+ var SDK_VERSION = _chunkDEC3JECCjs.SDK_RELEASE.version;
653
+ var SDK_API_MAJOR = _chunkDEC3JECCjs.SDK_RELEASE.contracts.api.currentMajor;
654
+ var SDK_API_CONTRACT = _nullishCoalesce(_chunkDEC3JECCjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
655
655
 
656
656
  // src/agent-runtime.ts
657
657
 
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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; }
2
2
 
3
- var _chunkY6CX4QPRjs = require('./chunk-Y6CX4QPR.js');
3
+ var _chunkWLOCMJWVjs = require('./chunk-WLOCMJWV.js');
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  var _child_process = require('child_process');
@@ -13,7 +13,7 @@ function npmSupportsAllowScripts(version) {
13
13
  }
14
14
  function readNpmVersion(env) {
15
15
  try {
16
- const plan = _chunkY6CX4QPRjs.resolveShellSpawn.call(void 0, "npm", ["--version"], process.platform, env);
16
+ const plan = _chunkWLOCMJWVjs.resolveShellSpawn.call(void 0, "npm", ["--version"], process.platform, env);
17
17
  const result = _child_process.spawnSync.call(void 0, plan.command, plan.args, {
18
18
  encoding: "utf8",
19
19
  env,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getActiveCliProgress
3
- } from "./chunk-GAMFK2ZP.mjs";
3
+ } from "./chunk-44ZTYHMQ.mjs";
4
4
  import {
5
5
  printCommandEnvelope
6
- } from "./chunk-BKC6VMYZ.mjs";
6
+ } from "./chunk-JRAVVJ3T.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-ZBCTXQ3P.mjs";
25
+ } from "./chunk-2PRO2JTX.mjs";
26
26
  import {
27
27
  DeeplineError
28
28
  } from "./chunk-NXGCO4JB.mjs";
29
29
  import {
30
30
  SDK_RELEASE
31
- } from "./chunk-UPEOEYZ3.mjs";
31
+ } from "./chunk-TQNHMWUR.mjs";
32
32
 
33
33
  // src/cli/commands/skills.ts
34
34
  import { spawn as spawn2 } from "child_process";
@@ -1,3 +1,7 @@
1
+ import {
2
+ writeRawStderr
3
+ } from "./chunk-JRAVVJ3T.mjs";
4
+
1
5
  // src/cli/trace.ts
2
6
  var cliTraceStartedAt = Date.now();
3
7
  function isTruthyEnv(value) {
@@ -17,7 +21,7 @@ function recordCliTrace(event) {
17
21
  sinceStartMs: now - cliTraceStartedAt,
18
22
  ...event
19
23
  };
20
- process.stderr.write(`[cli-trace] ${JSON.stringify(payload)}
24
+ writeRawStderr(`[cli-trace] ${JSON.stringify(payload)}
21
25
  `);
22
26
  }
23
27
  async function traceCliSpan(phase, fields, run) {
@@ -1,4 +1,8 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/cli/trace.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkYD7B53RWjs = require('./chunk-YD7B53RW.js');
4
+
5
+ // src/cli/trace.ts
2
6
  var cliTraceStartedAt = Date.now();
3
7
  function isTruthyEnv(value) {
4
8
  return value === "1" || value === "true" || value === "yes";
@@ -17,7 +21,7 @@ function recordCliTrace(event) {
17
21
  sinceStartMs: now - cliTraceStartedAt,
18
22
  ...event
19
23
  };
20
- process.stderr.write(`[cli-trace] ${JSON.stringify(payload)}
24
+ _chunkYD7B53RWjs.writeRawStderr.call(void 0, `[cli-trace] ${JSON.stringify(payload)}
21
25
  `);
22
26
  }
23
27
  async function traceCliSpan(phase, fields, run) {
@@ -3,7 +3,7 @@ import {
3
3
  detectAgentRuntime,
4
4
  resolveCliCommandContext,
5
5
  resolveConfig
6
- } from "./chunk-ZBCTXQ3P.mjs";
6
+ } from "./chunk-2PRO2JTX.mjs";
7
7
  import {
8
8
  DeeplineError,
9
9
  serializeToolExecutionFailure
@@ -118,6 +118,68 @@ function describeArgs(target, options) {
118
118
  ];
119
119
  }
120
120
 
121
+ // src/cli/json-mode.ts
122
+ var ANSI_PATTERN = /\x1b\[[0-9;?]*[A-Za-z]|\r/g;
123
+ var installed = false;
124
+ var pending = [];
125
+ var rawStderrWrite = null;
126
+ var stdoutWritten = false;
127
+ function isJsonOutputMode() {
128
+ return process.argv.includes("--json");
129
+ }
130
+ function installJsonStderrGuard() {
131
+ if (installed || !isJsonOutputMode()) return;
132
+ installed = true;
133
+ rawStderrWrite = process.stderr.write.bind(process.stderr);
134
+ const stdoutWrite = process.stdout.write.bind(process.stdout);
135
+ process.stdout.write = ((...args) => {
136
+ stdoutWritten = true;
137
+ return stdoutWrite(...args);
138
+ });
139
+ const capture = (chunk) => {
140
+ const text = (typeof chunk === "string" ? chunk : chunk instanceof Uint8Array ? Buffer.from(chunk).toString("utf8") : String(chunk)).replace(ANSI_PATTERN, "").trim();
141
+ if (text) pending.push(text);
142
+ };
143
+ process.stderr.write = ((chunk, ...rest) => {
144
+ capture(chunk);
145
+ const callback = rest.find((arg) => typeof arg === "function");
146
+ callback?.();
147
+ return true;
148
+ });
149
+ const toNotice = (...args) => capture(
150
+ args.map(
151
+ (arg) => typeof arg === "string" ? arg : arg instanceof Error ? arg.message : JSON.stringify(arg)
152
+ ).join(" ")
153
+ );
154
+ console.error = toNotice;
155
+ console.warn = toNotice;
156
+ }
157
+ function addJsonNotice(notice) {
158
+ if (installed) pending.push(notice);
159
+ }
160
+ function writeRawStderr(text) {
161
+ (rawStderrWrite ?? process.stderr.write.bind(process.stderr))(text);
162
+ }
163
+ function takeSilentJsonFailureMessage(exitCode) {
164
+ if (!installed || stdoutWritten || !exitCode || Number(exitCode) === 0) {
165
+ return null;
166
+ }
167
+ const index = pending.findIndex((notice) => typeof notice === "string");
168
+ if (index === -1) return "Command failed without an error message.";
169
+ const [message] = pending.splice(index, 1);
170
+ return message;
171
+ }
172
+ function withJsonNotices(value) {
173
+ if (pending.length === 0 || value === null || typeof value !== "object" || Array.isArray(value)) {
174
+ return value;
175
+ }
176
+ const record = value;
177
+ const existing = Array.isArray(record.notices) ? record.notices : [];
178
+ const notices = [...existing, ...pending];
179
+ pending = [];
180
+ return { ...record, notices };
181
+ }
182
+
121
183
  // src/cli/utils.ts
122
184
  import { createHash } from "crypto";
123
185
  import {
@@ -821,13 +883,15 @@ function withAgentCommandContext(value) {
821
883
  }
822
884
  function printJson(value, fields) {
823
885
  process.stdout.write(
824
- `${JSON.stringify(selectJsonFields(withAgentCommandContext(value), fields), null, 2)}
886
+ `${JSON.stringify(withJsonNotices(selectJsonFields(withAgentCommandContext(value), fields)), null, 2)}
825
887
  `
826
888
  );
827
889
  }
828
890
  function printCompactJson(value) {
829
- process.stdout.write(`${JSON.stringify(withAgentCommandContext(value))}
830
- `);
891
+ process.stdout.write(
892
+ `${JSON.stringify(withJsonNotices(withAgentCommandContext(value)))}
893
+ `
894
+ );
831
895
  }
832
896
  function cliToolExecutionFailure(error) {
833
897
  const failure = serializeToolExecutionFailure(error);
@@ -976,6 +1040,11 @@ export {
976
1040
  parseJsonFields,
977
1041
  jsonFieldArgs,
978
1042
  describeArgs,
1043
+ isJsonOutputMode,
1044
+ installJsonStderrGuard,
1045
+ addJsonNotice,
1046
+ writeRawStderr,
1047
+ takeSilentJsonFailureMessage,
979
1048
  getAuthedHttpClient,
980
1049
  openInBrowser,
981
1050
  sleep,