deepline 0.3.408 → 0.3.410

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 (217) hide show
  1. package/dist/bundling-sources/sdk/src/agent-runtime.ts +18 -1
  2. package/dist/bundling-sources/sdk/src/client.ts +212 -334
  3. package/dist/bundling-sources/sdk/src/compat.ts +45 -2
  4. package/dist/bundling-sources/sdk/src/db/query.ts +9 -10
  5. package/dist/bundling-sources/sdk/src/http.ts +38 -20
  6. package/dist/bundling-sources/sdk/src/index.ts +4 -5
  7. package/dist/bundling-sources/sdk/src/play.ts +10 -10
  8. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +6 -4
  9. package/dist/bundling-sources/sdk/src/plays/check-local-play-graph.ts +114 -0
  10. package/dist/bundling-sources/sdk/src/plays/client.ts +431 -0
  11. package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +2 -2
  12. package/dist/bundling-sources/sdk/src/plays/run-request.ts +106 -16
  13. package/dist/bundling-sources/sdk/src/release.ts +13 -7
  14. package/dist/bundling-sources/sdk/src/runs/read-errors.ts +8 -0
  15. package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +124 -13
  16. package/dist/bundling-sources/sdk/src/tool-calls.ts +108 -19
  17. package/dist/bundling-sources/sdk/src/types.ts +18 -0
  18. package/dist/bundling-sources/shared_libs/integration-contracts/execute-retry-contract.ts +37 -0
  19. package/dist/bundling-sources/shared_libs/integration-contracts/package.json +3 -0
  20. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +3 -1
  21. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +277 -76
  22. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
  23. package/dist/bundling-sources/shared_libs/play-runtime/dataset-row-input.ts +124 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +6 -62
  25. package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +1 -0
  26. package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +67 -0
  27. package/dist/bundling-sources/shared_libs/play-runtime/execute-server-timing.ts +64 -6
  28. package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +1 -5
  29. package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +1 -1
  30. package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +3 -0
  31. package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +10 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +3 -0
  33. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/egress-probe.ts +3 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +26 -16
  35. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +36 -11
  36. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +35 -0
  37. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +21 -0
  38. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +21 -6
  39. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +11 -2
  40. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +85 -20
  41. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +71 -13
  42. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-execution-queries.ts +100 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +9 -5
  44. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +337 -146
  45. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +26 -12
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +3 -1
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +425 -102
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
  49. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +4 -0
  50. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +9 -0
  51. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +181 -124
  52. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +152 -0
  53. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +5 -3
  54. package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +31 -0
  55. package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +10 -0
  56. package/dist/bundling-sources/shared_libs/plays/ambiguous-write-error.ts +25 -0
  57. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +4 -0
  58. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +63 -68
  59. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +129 -63
  60. package/dist/bundling-sources/shared_libs/plays/contracts.ts +14 -0
  61. package/dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts +58 -16
  62. package/dist/bundling-sources/shared_libs/plays/fetch-http-error.ts +50 -0
  63. package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +351 -0
  64. package/dist/bundling-sources/shared_libs/plays/tool-list-getter-mode.ts +9 -0
  65. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
  66. package/dist/cli/{auth-UVD3CUBB.mjs → auth-LLXLIILR.mjs} +6 -6
  67. package/dist/cli/auth-UG4WOYGL.js +40 -0
  68. package/dist/cli/{billing-BZVTXXLM.mjs → billing-5FVXZYAC.mjs} +8 -8
  69. package/dist/cli/{billing-BZVYAF6T.js → billing-NFPK7GYP.js} +84 -84
  70. package/dist/cli/{chunk-ZAAKSJAS.js → chunk-27GJKC5Q.js} +17 -10
  71. package/dist/cli/{chunk-UHNDVD3P.js → chunk-2H4EY7KH.js} +100 -41
  72. package/dist/cli/{chunk-WTT6CLED.mjs → chunk-2YR7BIIC.mjs} +5 -2
  73. package/dist/cli/{chunk-3ZB6IIA7.js → chunk-36AHOWVS.js} +26 -26
  74. package/dist/cli/{chunk-OSDXE27V.mjs → chunk-4PG4ARL2.mjs} +17 -10
  75. package/dist/cli/{chunk-LOYISF7S.mjs → chunk-4XQLVUC7.mjs} +738 -512
  76. package/dist/cli/{chunk-J5PTX66Y.js → chunk-5MLCBXXU.js} +8 -1
  77. package/dist/cli/chunk-5TUGWDEB.js +313 -0
  78. package/dist/cli/{chunk-D6FFBSM5.js → chunk-5UUQAGJS.js} +5 -2
  79. package/dist/cli/{chunk-4CFULMRB.mjs → chunk-5V5Y37BC.mjs} +2 -2
  80. package/dist/cli/{chunk-PMVFAYL7.mjs → chunk-63ILLN5H.mjs} +2 -2
  81. package/dist/cli/{chunk-AUMD2VXP.js → chunk-63S7X326.js} +1032 -806
  82. package/dist/cli/{chunk-4QFT5LGV.mjs → chunk-6PGATQ6L.mjs} +6 -3
  83. package/dist/cli/{chunk-6BJK4EJ3.mjs → chunk-AARWVK4C.mjs} +2132 -65
  84. package/dist/cli/{chunk-FERRDNMO.js → chunk-AD47BXN2.js} +5 -5
  85. package/dist/cli/{chunk-4RNDKFNQ.js → chunk-D37FEBES.js} +2 -2
  86. package/dist/cli/{chunk-S6R3OX7B.js → chunk-E4CABWXL.js} +25 -2
  87. package/dist/cli/{chunk-NXGCO4JB.mjs → chunk-E4IXDAZI.mjs} +5 -0
  88. package/dist/cli/chunk-EQ4Z7RJW.mjs +35 -0
  89. package/dist/cli/chunk-FR2ILQ4G.mjs +8 -0
  90. package/dist/cli/{chunk-QUAQX3FQ.js → chunk-FVLNYDI4.js} +128 -376
  91. package/dist/cli/{chunk-BRJUESQV.js → chunk-FZJAM576.js} +50 -50
  92. package/dist/cli/{chunk-BZAMOCPA.mjs → chunk-IMZ56EOH.mjs} +3 -3
  93. package/dist/cli/{chunk-IOHRWLQE.mjs → chunk-IPG42SD2.mjs} +452 -138
  94. package/dist/cli/chunk-J33TSWO5.js +8 -0
  95. package/dist/cli/{chunk-XXLXOUUU.mjs → chunk-JNXJZ577.mjs} +1 -1
  96. package/dist/cli/{chunk-JI2B4RZP.mjs → chunk-KCC3FKIW.mjs} +71 -12
  97. package/dist/cli/{chunk-6IKARAYD.mjs → chunk-L2VKAASU.mjs} +23 -0
  98. package/dist/cli/{chunk-PYZZMAJQ.mjs → chunk-LFSHGNT2.mjs} +8 -1
  99. package/dist/cli/{chunk-2XXXFPTD.js → chunk-LTFL4JRN.js} +426 -721
  100. package/dist/cli/{chunk-YHPYUZZX.mjs → chunk-MAMVGOSC.mjs} +1 -1
  101. package/dist/cli/{chunk-URACNNLO.mjs → chunk-MN2OWLFA.mjs} +2 -2
  102. package/dist/cli/{chunk-Q3PUHXOY.js → chunk-NF4V5DTY.js} +12 -12
  103. package/dist/cli/{chunk-Q2E4E4FJ.js → chunk-NPBJI7RE.js} +8 -8
  104. package/dist/cli/chunk-NTVLGHFM.js +501 -0
  105. package/dist/cli/{chunk-HQXL5526.mjs → chunk-NUX2QHNC.mjs} +1 -1
  106. package/dist/cli/{chunk-E3PJF6YP.js → chunk-OBB4QXHA.js} +19 -4
  107. package/dist/cli/{chunk-SEFMGO3Z.js → chunk-OQQOXSYA.js} +2184 -117
  108. package/dist/cli/chunk-OZ6E3IRZ.js +6084 -0
  109. package/dist/cli/{chunk-7P5AA3SN.js → chunk-PPDBRJRW.js} +6 -1
  110. package/dist/cli/{chunk-IWBXJDZA.mjs → chunk-PZSLPBDA.mjs} +2 -2
  111. package/dist/cli/{chunk-ILHRA7AD.js → chunk-QADCFSGH.js} +7 -7
  112. package/dist/cli/{chunk-ECVLPS67.js → chunk-QJI5FIOW.js} +170 -49
  113. package/dist/cli/{chunk-I3DHIXVJ.mjs → chunk-QL22Y56M.mjs} +149 -28
  114. package/dist/cli/{chunk-SD7MXAJA.mjs → chunk-RFB25DSQ.mjs} +36 -284
  115. package/dist/cli/chunk-T44IIOT6.mjs +501 -0
  116. package/dist/cli/chunk-VK2LZ5IP.js +35 -0
  117. package/dist/cli/chunk-VKKVSFRD.js +62 -0
  118. package/dist/cli/{chunk-RWCY6YI2.js → chunk-VYKV5XHL.js} +644 -330
  119. package/dist/cli/{chunk-GSK6NHVM.js → chunk-WU4U6VSB.js} +5 -5
  120. package/dist/cli/chunk-XHLKJOTN.mjs +313 -0
  121. package/dist/cli/{chunk-MJELBQBU.mjs → chunk-XIHWSXSV.mjs} +330 -625
  122. package/dist/cli/chunk-XNZJKRJA.mjs +6084 -0
  123. package/dist/cli/chunk-ZCALLYF6.mjs +62 -0
  124. package/dist/cli/{chunk-ZBABPK6Y.js → chunk-ZFZ427HN.js} +11 -8
  125. package/dist/cli/{chunk-SJVVBWRL.mjs → chunk-ZKYEW55U.mjs} +16 -1
  126. package/dist/cli/command-docs.js +2 -2
  127. package/dist/cli/command-docs.mjs +1 -1
  128. package/dist/cli/{csv-XLGLHJ6P.js → csv-7U3FJYKZ.js} +14 -14
  129. package/dist/cli/{csv-WPSXG6ZZ.mjs → csv-ZWLDMM4A.mjs} +5 -5
  130. package/dist/cli/{db-5PTNJG4X.js → db-DNCGV5PC.js} +42 -47
  131. package/dist/cli/{db-ABS57ABJ.mjs → db-IMYXVMGI.mjs} +15 -20
  132. package/dist/cli/{describe-PVWQJ2PB.mjs → describe-Q23DWJUK.mjs} +20 -15
  133. package/dist/cli/{describe-EZS6PQXA.js → describe-S34JUX5W.js} +27 -22
  134. package/dist/cli/describe-core.d.mts +2 -2
  135. package/dist/cli/describe-core.d.ts +2 -2
  136. package/dist/cli/describe-core.js +6 -6
  137. package/dist/cli/describe-core.mjs +5 -5
  138. package/dist/cli/{executions-OKJGATQZ.mjs → executions-A73EUGSI.mjs} +8 -8
  139. package/dist/cli/{executions-FNTAFQ7Y.js → executions-XOMPX2YJ.js} +10 -10
  140. package/dist/cli/{feedback-W27HDMRR.mjs → feedback-N4GJ2POI.mjs} +11 -7
  141. package/dist/cli/{feedback-6YBOMSUA.js → feedback-QTCHNJJH.js} +13 -9
  142. package/dist/cli/{git-YOOUEL6M.mjs → git-4Q3JIQYZ.mjs} +6 -6
  143. package/dist/cli/git-I6CPBEVG.js +24 -0
  144. package/dist/cli/index.js +240 -352
  145. package/dist/cli/index.mjs +163 -275
  146. package/dist/cli/{legacy-noops-V6OKW7VR.mjs → legacy-noops-3SOVGFF7.mjs} +6 -6
  147. package/dist/cli/{legacy-noops-2VZ7XT6C.js → legacy-noops-4OSHZM34.js} +9 -9
  148. package/dist/cli/{monitors-FBWGVIUS.js → monitors-LVE2KZNG.js} +94 -94
  149. package/dist/cli/{monitors-P2YYWTWT.mjs → monitors-QP2XID2B.mjs} +8 -8
  150. package/dist/cli/{org-DVMG6H3C.mjs → org-IVRETVQA.mjs} +8 -8
  151. package/dist/cli/{org-3XUSVX5T.js → org-XFLK5IAP.js} +68 -68
  152. package/dist/cli/{play-GNC5CQAS.mjs → play-DE7VH6NU.mjs} +533 -98
  153. package/dist/cli/{play-YG5L4BWQ.js → play-XXTPPP23.js} +1067 -632
  154. package/dist/cli/{providers-7PSWG2OV.js → providers-DLD3I4JF.js} +11 -11
  155. package/dist/cli/{providers-JR33SLWL.mjs → providers-GX2NIZQQ.mjs} +8 -8
  156. package/dist/cli/{quickstart-VUOBQYIQ.mjs → quickstart-72B4L4PK.mjs} +5 -5
  157. package/dist/cli/{quickstart-FDVZ5BL3.js → quickstart-XNS3HSWC.js} +7 -7
  158. package/dist/cli/search-6NCH4HB5.js +30 -0
  159. package/dist/cli/{search-JZYLO33K.mjs → search-SUTRANJI.mjs} +9 -9
  160. package/dist/cli/{secrets-VS266FVA.js → secrets-6OBLOVEV.js} +17 -17
  161. package/dist/cli/{secrets-3MCYBT4I.mjs → secrets-FPFXXNUH.mjs} +8 -8
  162. package/dist/cli/sessions-235532DR.js +16 -0
  163. package/dist/cli/{sessions-ELLLT23E.mjs → sessions-R25I4QKN.mjs} +6 -6
  164. package/dist/cli/{settings-PZCKAFII.mjs → settings-AOP6F5PZ.mjs} +12 -12
  165. package/dist/cli/{settings-7364NMMA.js → settings-VL5FOFPN.js} +79 -79
  166. package/dist/cli/{setup-PMWYLCT6.js → setup-BSC67YT3.js} +45 -44
  167. package/dist/cli/{setup-A7GQ4KIA.mjs → setup-ZMPHBHVJ.mjs} +11 -10
  168. package/dist/cli/skills-3IWLYYRL.js +29 -0
  169. package/dist/cli/{skills-WS6BIFPQ.mjs → skills-KF65TVFO.mjs} +7 -7
  170. package/dist/cli/tools-LR66SPYU.js +44 -0
  171. package/dist/cli/{tools-BR4DOZA2.mjs → tools-SX4XIPM7.mjs} +19 -14
  172. package/dist/cli/{update-D2B7UNFT.mjs → update-QRMFRAQQ.mjs} +11 -9
  173. package/dist/cli/update-SP7UEO53.js +31 -0
  174. package/dist/cli/{workflow-PQXC2R47.mjs → workflow-FOEEEB7G.mjs} +44 -20
  175. package/dist/cli/{workflow-6ODTCYXU.js → workflow-KOCK2FLW.js} +54 -30
  176. package/dist/{client-Z9Pye1Wm.d.mts → client-74k4IPh6.d.mts} +137 -54
  177. package/dist/{client-BcvhDfJJ.d.ts → client-C1IK1f8c.d.ts} +137 -54
  178. package/dist/{compiler-manifest-Ycx-hoAr.d.mts → compiler-manifest-lzWpbV3w.d.mts} +83 -66
  179. package/dist/{compiler-manifest-Ycx-hoAr.d.ts → compiler-manifest-lzWpbV3w.d.ts} +83 -66
  180. package/dist/{index-CZXgiN3E.d.mts → index-C8Cy-YTm.d.ts} +5 -1
  181. package/dist/{index-NPG5pqxQ.d.ts → index-CtNK-0nI.d.mts} +5 -1
  182. package/dist/index.d.mts +47 -9
  183. package/dist/index.d.ts +47 -9
  184. package/dist/index.js +17 -14
  185. package/dist/index.mjs +13 -10
  186. package/dist/install-integrity.json +120 -104
  187. package/dist/plays/bundle-play-file.d.mts +3 -3
  188. package/dist/plays/bundle-play-file.d.ts +3 -3
  189. package/dist/plays/bundle-play-file.mjs +5 -4
  190. package/dist/plays/csv-data-input.js +3 -3
  191. package/dist/plays/csv-data-input.mjs +2 -2
  192. package/dist/plays/play-description.d.mts +2 -2
  193. package/dist/plays/play-description.d.ts +2 -2
  194. package/dist/plays/run-request.d.mts +2 -2
  195. package/dist/plays/run-request.d.ts +2 -2
  196. package/dist/plays/run-request.js +11 -3
  197. package/dist/plays/run-request.mjs +10 -2
  198. package/dist/release.d.mts +15 -6
  199. package/dist/release.d.ts +15 -6
  200. package/dist/release.js +2 -2
  201. package/dist/release.mjs +1 -1
  202. package/package.json +2 -2
  203. package/dist/cli/auth-3GB2K636.js +0 -40
  204. package/dist/cli/chunk-67RWR34T.mjs +0 -155
  205. package/dist/cli/chunk-CLJGSOVM.mjs +0 -1716
  206. package/dist/cli/chunk-HQY2SG3K.js +0 -83
  207. package/dist/cli/chunk-OSFWFV72.js +0 -155
  208. package/dist/cli/chunk-Q3LFI3VH.js +0 -392
  209. package/dist/cli/chunk-WPAB4DCU.mjs +0 -83
  210. package/dist/cli/chunk-YMOFWHGO.mjs +0 -392
  211. package/dist/cli/chunk-Z4VNJOF7.js +0 -1716
  212. package/dist/cli/git-YKUXXJOR.js +0 -24
  213. package/dist/cli/search-PPPYC5OZ.js +0 -30
  214. package/dist/cli/sessions-TEHEWW7O.js +0 -16
  215. package/dist/cli/skills-SYS7VRRK.js +0 -29
  216. package/dist/cli/tools-KK4BKVQR.js +0 -39
  217. package/dist/cli/update-2IV5JTX2.js +0 -29
@@ -1,9 +1,8 @@
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; }
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; } var _class;
2
2
 
3
- var _chunkOSFWFV72js = require('./chunk-OSFWFV72.js');
3
+ var _chunkNF4V5DTYjs = require('./chunk-NF4V5DTY.js');
4
4
 
5
5
 
6
- var _chunkQ3PUHXOYjs = require('./chunk-Q3PUHXOY.js');
7
6
 
8
7
 
9
8
 
@@ -18,159 +17,16 @@ var _chunkQ3PUHXOYjs = require('./chunk-Q3PUHXOY.js');
18
17
 
19
18
 
20
19
 
20
+ var _chunkFVLNYDI4js = require('./chunk-FVLNYDI4.js');
21
21
 
22
22
 
23
+ var _chunkPPDBRJRWjs = require('./chunk-PPDBRJRW.js');
23
24
 
24
25
 
25
- var _chunkQUAQX3FQjs = require('./chunk-QUAQX3FQ.js');
26
-
27
-
28
- var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
29
-
30
-
31
- var _chunkD6FFBSM5js = require('./chunk-D6FFBSM5.js');
32
-
33
- // src/cli/commands/skills.ts
34
- var _child_process = require('child_process');
35
- var _fs = require('fs');
36
- var _os = require('os');
37
- var _path = require('path');
38
-
39
- // contracts/install-commands.json
40
- var install_commands_default = {
41
- skills: {
42
- index_path: "/.well-known/skills/index.json",
43
- default_agents: [
44
- "codex",
45
- "claude-code",
46
- "cursor",
47
- "gemini-cli",
48
- "antigravity"
49
- ],
50
- npx_binary: "npx",
51
- npx_add_args_template: [
52
- "--yes",
53
- "skills@1.5.15",
54
- "add",
55
- "{skills_source_url}",
56
- "--agent",
57
- "{agents}",
58
- "--global",
59
- "--yes",
60
- "--skill",
61
- "{skill_name}",
62
- "--full-depth"
63
- ]
64
- },
65
- cli: {
66
- sdk_npm_global: "npm install -g deepline@latest"
67
- }
68
- };
69
-
70
- // src/cli/install-commands.ts
71
- var INSTALL_COMMANDS = install_commands_default;
72
- var skillsNpxPackage = INSTALL_COMMANDS.skills.npx_add_args_template.find(
73
- (arg) => /^skills@\d+\.\d+\.\d+$/.test(arg)
74
- );
75
- if (!skillsNpxPackage) {
76
- throw new Error(
77
- "shared_libs/cli/install-commands.json must pin an exact skills package version."
78
- );
79
- }
80
- var SKILLS_NPX_PACKAGE = skillsNpxPackage;
81
- var DEFAULT_V1_SKILL_NAMES = [
82
- "deepline-org-chart",
83
- "build-tam",
84
- "clay-to-deepline",
85
- "deepline-analytics",
86
- "deepline-engine",
87
- // Retired: its guidance lives in `feedback send --help` and `sessions send
88
- // --help`. Kept as a stub because installed CLIs list it and refuse to
89
- // sync any skill when the published index lacks a listed name. Move to
90
- // LEGACY_SKILL_NAMES_TO_REMOVE once those CLIs are out of the field.
91
- "deepline-feedback",
92
- "deepline-gtm",
93
- "deepline-start",
94
- "deepline-plays",
95
- "deepline-quickstart",
96
- "deepline-research",
97
- "deepline-scoring",
98
- "find-qualified-titles",
99
- "linkedin-url-lookup",
100
- // Deprecated alias for `deepline-scoring`, kept installable so saved prompts
101
- // and scripts using `/niche-signal-discovery` keep routing to the renamed
102
- // skill. Move to LEGACY_SKILL_NAMES_TO_REMOVE once the window closes.
103
- "niche-signal-discovery",
104
- "portfolio-prospecting"
105
- ];
106
- var DEFAULT_SDK_SKILL_NAMES = [...DEFAULT_V1_SKILL_NAMES];
107
- var LEGACY_SKILL_NAMES_TO_REMOVE = [
108
- "deepline-plays-feedback",
109
- "deepline-plays-quickstart",
110
- "workflow-hello-world"
111
- ];
112
- function normalizeBaseUrl(baseUrl) {
113
- return baseUrl.replace(/\/$/, "");
114
- }
115
- function renderTemplate(template, values) {
116
- return template.replace(/\{([a-z_]+)\}/g, (match, key) => {
117
- return _nullishCoalesce(values[key], () => ( match));
118
- });
119
- }
120
- function skillsIndexUrl(baseUrl) {
121
- return `${normalizeBaseUrl(baseUrl)}${INSTALL_COMMANDS.skills.index_path}`;
122
- }
123
- function skillsSourceUrl(baseUrl) {
124
- return normalizeBaseUrl(baseUrl);
125
- }
126
- function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
127
- const skillNames = Array.isArray(skillName) ? skillName : [skillName];
128
- const [firstSkillName, ...extraSkillNames] = skillNames;
129
- const agents = _nullishCoalesce(options.agents, () => ( _chunkQUAQX3FQjs.DEFAULT_SKILL_AGENTS));
130
- const values = {
131
- skills_index_url: skillsIndexUrl(baseUrl),
132
- skills_source_url: skillsSourceUrl(baseUrl),
133
- agents: agents.join(" "),
134
- skill_name: _nullishCoalesce(firstSkillName, () => ( ""))
135
- };
136
- const rendered = INSTALL_COMMANDS.skills.npx_add_args_template.flatMap(
137
- (arg, index) => {
138
- const next = index === 0 && options.firstArg ? options.firstArg : arg;
139
- const value = renderTemplate(next, values);
140
- if (arg === "{agents}") {
141
- return agents;
142
- }
143
- if (arg === "{skill_name}") {
144
- return [
145
- value,
146
- ...extraSkillNames.flatMap((name) => ["--skill", name])
147
- ];
148
- }
149
- return value;
150
- }
151
- );
152
- return rendered;
153
- }
154
-
155
- // src/cli/skills-sync.ts
156
-
157
- var _crypto = require('crypto');
158
-
159
- var _zlib = require('zlib');
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
-
26
+ var _chunk5UUQAGJSjs = require('./chunk-5UUQAGJS.js');
172
27
 
173
28
  // src/compat.ts
29
+ var _crypto = require('crypto');
174
30
 
175
31
 
176
32
 
@@ -178,11 +34,11 @@ var _zlib = require('zlib');
178
34
 
179
35
 
180
36
 
181
-
182
-
183
-
184
-
37
+ var _fs = require('fs');
38
+ var _os = require('os');
39
+ var _path = require('path');
185
40
  var CHECK_TIMEOUT_MS = 2e3;
41
+ var SDK_CLI_AUTO_UPDATE_CAPABILITY = "safe-continuation-v1";
186
42
  var SDK_COMPATIBILITY_TRUST_MS = 10 * 60 * 1e3;
187
43
  var SDK_COMPATIBILITY_CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
188
44
  var SDK_COMPATIBILITY_FAST_DEADLINE_MS = 400;
@@ -201,33 +57,33 @@ function shouldSkipCompatibilityCheck() {
201
57
  const value = _optionalChain([process, 'access', _ => _.env, 'access', _2 => _2.DEEPLINE_SKIP_SDK_COMPAT_CHECK, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4(), 'access', _5 => _5.toLowerCase, 'call', _6 => _6()]);
202
58
  return value === "1" || value === "true" || value === "yes";
203
59
  }
204
- function sdkCompatibilityCachePath(baseUrl, homeDir = _os.homedir.call(void 0, )) {
205
- return _path.join.call(void 0, _chunkQUAQX3FQjs.sdkCliStateDirPath.call(void 0, baseUrl, homeDir), "compat-cache.json");
60
+ function sdkCompatibilityCachePath(baseUrl, homeDir = _optionalChain([process, 'access', _7 => _7.env, 'access', _8 => _8.HOME, 'optionalAccess', _9 => _9.trim, 'call', _10 => _10()]) || _os.homedir.call(void 0, )) {
61
+ return _path.join.call(void 0, _chunkFVLNYDI4js.sdkCliStateDirPath.call(void 0, baseUrl, homeDir), "compat-cache.json");
206
62
  }
207
- function legacySdkCompatibilityCachePath(homeDir = _os.homedir.call(void 0, )) {
63
+ function legacySdkCompatibilityCachePath(homeDir = _optionalChain([process, 'access', _11 => _11.env, 'access', _12 => _12.HOME, 'optionalAccess', _13 => _13.trim, 'call', _14 => _14()]) || _os.homedir.call(void 0, )) {
208
64
  return _path.join.call(void 0, homeDir, ".cache", "deepline", "sdk-compat-cache.json");
209
65
  }
210
66
  function compatibilityCacheKey(baseUrl, command, skillsVersion) {
211
67
  return JSON.stringify({
212
68
  baseUrl: baseUrl.replace(/\/$/, ""),
213
- version: _chunkQUAQX3FQjs.SDK_VERSION,
214
- apiContract: _chunkQUAQX3FQjs.SDK_API_CONTRACT,
215
- apiMajor: _chunkQUAQX3FQjs.SDK_API_MAJOR,
216
- command: _optionalChain([command, 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]) || null,
69
+ version: _chunkFVLNYDI4js.SDK_VERSION,
70
+ apiContract: _chunkFVLNYDI4js.SDK_API_CONTRACT,
71
+ apiMajor: _chunkFVLNYDI4js.SDK_API_MAJOR,
72
+ command: _optionalChain([command, 'optionalAccess', _15 => _15.trim, 'call', _16 => _16()]) || null,
217
73
  skillsVersion: _nullishCoalesce(skillsVersion, () => ( null))
218
74
  });
219
75
  }
220
76
  function legacyCompatibilityCacheKey(baseUrl, command) {
221
77
  return JSON.stringify({
222
78
  baseUrl: baseUrl.replace(/\/$/, ""),
223
- version: _chunkQUAQX3FQjs.SDK_VERSION,
224
- apiContract: _chunkQUAQX3FQjs.SDK_API_CONTRACT,
225
- command: _optionalChain([command, 'optionalAccess', _9 => _9.trim, 'call', _10 => _10()]) || null
79
+ version: _chunkFVLNYDI4js.SDK_VERSION,
80
+ apiContract: _chunkFVLNYDI4js.SDK_API_CONTRACT,
81
+ command: _optionalChain([command, 'optionalAccess', _17 => _17.trim, 'call', _18 => _18()]) || null
226
82
  });
227
83
  }
228
84
  function isCleanCompatibilityPolicy(response) {
229
85
  if (!response) return false;
230
- return response.ok === true && response.update_required !== true && response.status !== "unsupported" && !_optionalChain([response, 'access', _11 => _11.auto_update, 'optionalAccess', _12 => _12.should_auto_update]) && !response.cli_family;
86
+ return response.ok === true && response.update_required !== true && response.status !== "unsupported" && !_optionalChain([response, 'access', _19 => _19.auto_update, 'optionalAccess', _20 => _20.should_auto_update]) && !response.cli_family;
231
87
  }
232
88
  function readFreshCleanCompatibility(baseUrl, command, skillsVersion) {
233
89
  const cached = readCachedCompatibility(baseUrl, command, skillsVersion);
@@ -244,8 +100,24 @@ function isSavedWithin(savedAt, windowMs, now) {
244
100
  const age = now - savedAt;
245
101
  return Number.isFinite(age) && age >= 0 && age <= windowMs;
246
102
  }
103
+ var UPDATE_ADVISORY_INTERVAL_MS = 24 * 60 * 60 * 1e3;
104
+ function claimUpdateAdvisory(baseUrl, now = Date.now()) {
105
+ const path = _path.join.call(void 0, _chunkFVLNYDI4js.sdkCliStateDirPath.call(void 0, baseUrl), "update-advisory.json");
106
+ try {
107
+ const { shownAt } = JSON.parse(_fs.readFileSync.call(void 0, path, "utf8"));
108
+ if (isSavedWithin(shownAt, UPDATE_ADVISORY_INTERVAL_MS, now)) return false;
109
+ } catch (e) {
110
+ }
111
+ try {
112
+ _fs.mkdirSync.call(void 0, _path.dirname.call(void 0, path), { recursive: true });
113
+ _fs.writeFileSync.call(void 0, path, `${JSON.stringify({ shownAt: now })}
114
+ `);
115
+ } catch (e2) {
116
+ }
117
+ return true;
118
+ }
247
119
  function readCachedCompatibility(baseUrl, command, skillsVersion) {
248
- return _nullishCoalesce(_optionalChain([readCachedCompatibilityEntry, 'call', _13 => _13(baseUrl, command, skillsVersion), 'optionalAccess', _14 => _14.response]), () => ( null));
120
+ return _nullishCoalesce(_optionalChain([readCachedCompatibilityEntry, 'call', _21 => _21(baseUrl, command, skillsVersion), 'optionalAccess', _22 => _22.response]), () => ( null));
249
121
  }
250
122
  function readCachedCompatibilityEntry(baseUrl, command, skillsVersion) {
251
123
  try {
@@ -259,12 +131,12 @@ function readCachedCompatibilityEntry(baseUrl, command, skillsVersion) {
259
131
  const parsed = JSON.parse(
260
132
  _fs.readFileSync.call(void 0, cachePath, "utf8")
261
133
  );
262
- const entry = _nullishCoalesce(_optionalChain([parsed, 'access', _15 => _15.entries, 'optionalAccess', _16 => _16[compatibilityCacheKey(baseUrl, command, skillsVersion)]]), () => ( (useLegacyCache ? _optionalChain([parsed, 'access', _17 => _17.entries, 'optionalAccess', _18 => _18[legacyCompatibilityCacheKey(baseUrl, command)]]) : void 0)));
134
+ const entry = _nullishCoalesce(_optionalChain([parsed, 'access', _23 => _23.entries, 'optionalAccess', _24 => _24[compatibilityCacheKey(baseUrl, command, skillsVersion)]]), () => ( (useLegacyCache ? _optionalChain([parsed, 'access', _25 => _25.entries, 'optionalAccess', _26 => _26[legacyCompatibilityCacheKey(baseUrl, command)]]) : void 0)));
263
135
  if (!entry || !isSavedWithin(entry.savedAt, SDK_COMPATIBILITY_CACHE_TTL_MS, Date.now())) {
264
136
  return null;
265
137
  }
266
138
  return entry;
267
- } catch (e) {
139
+ } catch (e3) {
268
140
  return null;
269
141
  }
270
142
  }
@@ -281,7 +153,7 @@ function invalidateCachedCompatibility(baseUrl, command, skillsVersion) {
281
153
  delete entries[compatibilityCacheKey(baseUrl, command, skillsVersion)];
282
154
  delete entries[legacyCompatibilityCacheKey(baseUrl, command)];
283
155
  writeCompatibilityCacheFile(cachePath, { entries });
284
- } catch (e2) {
156
+ } catch (e4) {
285
157
  }
286
158
  }
287
159
  function writeCachedCompatibility(baseUrl, command, skillsVersion, response) {
@@ -291,7 +163,7 @@ function writeCachedCompatibility(baseUrl, command, skillsVersion, response) {
291
163
  if (_fs.existsSync.call(void 0, path)) {
292
164
  try {
293
165
  existing = JSON.parse(_fs.readFileSync.call(void 0, path, "utf8"));
294
- } catch (e3) {
166
+ } catch (e5) {
295
167
  }
296
168
  }
297
169
  const entries = _nullishCoalesce(existing.entries, () => ( {}));
@@ -300,7 +172,7 @@ function writeCachedCompatibility(baseUrl, command, skillsVersion, response) {
300
172
  response
301
173
  };
302
174
  writeCompatibilityCacheFile(path, { entries });
303
- } catch (e4) {
175
+ } catch (e6) {
304
176
  }
305
177
  }
306
178
  async function checkSdkCompatibility(baseUrl, options = {}) {
@@ -314,30 +186,35 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
314
186
  );
315
187
  try {
316
188
  const url = new URL("/api/v2/sdk/compat", baseUrl);
317
- url.searchParams.set("version", _chunkQUAQX3FQjs.SDK_VERSION);
318
- if (_optionalChain([options, 'access', _19 => _19.command, 'optionalAccess', _20 => _20.trim, 'call', _21 => _21()])) {
189
+ url.searchParams.set("version", _chunkFVLNYDI4js.SDK_VERSION);
190
+ if (_optionalChain([options, 'access', _27 => _27.command, 'optionalAccess', _28 => _28.trim, 'call', _29 => _29()])) {
319
191
  url.searchParams.set("command", options.command.trim());
320
192
  }
321
193
  if (options.skillsVersion !== void 0) {
322
194
  url.searchParams.set("skills_version", _nullishCoalesce(options.skillsVersion, () => ( "")));
323
195
  url.searchParams.set(
324
196
  "skills_cli_capability",
325
- String(_chunkD6FFBSM5js.SDK_RELEASE.packageCapabilities.skillsGuidance)
197
+ String(_chunk5UUQAGJSjs.SDK_RELEASE.packageCapabilities.skillsGuidance)
326
198
  );
327
199
  }
328
200
  if (options.catalog) {
329
201
  url.searchParams.set("catalog_tool_id", options.catalog.toolId);
202
+ if (options.catalog.purpose) {
203
+ url.searchParams.set("catalog_purpose", options.catalog.purpose);
204
+ }
330
205
  }
331
206
  const response = await fetch(url, {
332
207
  method: "GET",
333
208
  headers: {
334
- ..._chunkQUAQX3FQjs.deploymentProtectionHeaders.call(void 0, ),
335
- "User-Agent": `deepline-ts-sdk/${_chunkQUAQX3FQjs.SDK_VERSION}`,
336
- "X-Deepline-SDK-Version": _chunkQUAQX3FQjs.SDK_VERSION,
337
- "X-Deepline-API-Major": String(_chunkQUAQX3FQjs.SDK_API_MAJOR),
338
- "X-Deepline-API-Contract": _chunkQUAQX3FQjs.SDK_API_CONTRACT,
209
+ ..._chunkFVLNYDI4js.deploymentProtectionHeaders.call(void 0, ),
210
+ "User-Agent": `deepline-ts-sdk/${_chunkFVLNYDI4js.SDK_VERSION}`,
211
+ "X-Deepline-SDK-Version": _chunkFVLNYDI4js.SDK_VERSION,
212
+ "X-Deepline-API-Major": String(_chunkFVLNYDI4js.SDK_API_MAJOR),
213
+ "X-Deepline-API-Contract": _chunkFVLNYDI4js.SDK_API_CONTRACT,
339
214
  "X-Deepline-CLI-Update-Preferences": "1",
340
- ...options.catalog ? { Authorization: `Bearer ${_chunkQUAQX3FQjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl)}` } : {}
215
+ "X-Deepline-CLI-Auto-Update-Capability": SDK_CLI_AUTO_UPDATE_CAPABILITY,
216
+ ...options.catalog ? { Authorization: `Bearer ${_chunkFVLNYDI4js.resolveApiKeyForBaseUrl.call(void 0, baseUrl)}` } : {},
217
+ ..._optionalChain([options, 'access', _30 => _30.catalog, 'optionalAccess', _31 => _31.cliInvocationId]) ? { "X-Deepline-CLI-Invocation-ID": options.catalog.cliInvocationId } : {}
341
218
  },
342
219
  signal: controller.signal
343
220
  });
@@ -356,7 +233,7 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
356
233
  data
357
234
  );
358
235
  }
359
- if (options.catalog && catalogMetadata && typeof catalogMetadata === "object" && "toolId" in catalogMetadata && catalogMetadata.toolId === options.catalog.toolId) {
236
+ if (data.ok && options.catalog && catalogMetadata && typeof catalogMetadata === "object" && "toolId" in catalogMetadata && catalogMetadata.toolId === options.catalog.toolId) {
360
237
  options.catalog.acceptMetadata(catalogMetadata);
361
238
  }
362
239
  return { response: data, error: null };
@@ -386,7 +263,7 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
386
263
  }
387
264
  function isCiEnvironment() {
388
265
  return ["CI", "GITHUB_ACTIONS"].some((name) => {
389
- const value = _optionalChain([process, 'access', _22 => _22.env, 'access', _23 => _23[name], 'optionalAccess', _24 => _24.trim, 'call', _25 => _25(), 'access', _26 => _26.toLowerCase, 'call', _27 => _27()]);
266
+ const value = _optionalChain([process, 'access', _32 => _32.env, 'access', _33 => _33[name], 'optionalAccess', _34 => _34.trim, 'call', _35 => _35(), 'access', _36 => _36.toLowerCase, 'call', _37 => _37()]);
390
267
  return value === "1" || value === "true" || value === "yes";
391
268
  });
392
269
  }
@@ -403,6 +280,269 @@ function enforceSdkCompatibilityResponse(response, options = {}) {
403
280
  }
404
281
  }
405
282
 
283
+ // contracts/install-commands.json
284
+ var install_commands_default = {
285
+ skills: {
286
+ index_path: "/.well-known/skills/index.json",
287
+ default_agents: [
288
+ "codex",
289
+ "claude-code",
290
+ "cursor",
291
+ "gemini-cli",
292
+ "antigravity"
293
+ ],
294
+ npx_binary: "npx",
295
+ npx_add_args_template: [
296
+ "--yes",
297
+ "skills@1.5.15",
298
+ "add",
299
+ "{skills_source_url}",
300
+ "--agent",
301
+ "{agents}",
302
+ "--global",
303
+ "--yes",
304
+ "--skill",
305
+ "{skill_name}",
306
+ "--full-depth"
307
+ ]
308
+ },
309
+ cli: {
310
+ sdk_npm_global: "npm install -g deepline@latest"
311
+ }
312
+ };
313
+
314
+ // src/cli/install-commands.ts
315
+ var INSTALL_COMMANDS = install_commands_default;
316
+ var skillsNpxPackage = INSTALL_COMMANDS.skills.npx_add_args_template.find(
317
+ (arg) => /^skills@\d+\.\d+\.\d+$/.test(arg)
318
+ );
319
+ if (!skillsNpxPackage) {
320
+ throw new Error(
321
+ "shared_libs/cli/install-commands.json must pin an exact skills package version."
322
+ );
323
+ }
324
+ var SKILLS_NPX_PACKAGE = skillsNpxPackage;
325
+ var DEFAULT_V1_SKILL_NAMES = [
326
+ "deepline-org-chart",
327
+ "build-tam",
328
+ "clay-to-deepline",
329
+ "deepline-analytics",
330
+ "deepline-engine",
331
+ // Retired: its guidance lives in `feedback send --help` and `sessions send
332
+ // --help`. Kept as a stub because installed CLIs list it and refuse to
333
+ // sync any skill when the published index lacks a listed name. Move to
334
+ // LEGACY_SKILL_NAMES_TO_REMOVE once those CLIs are out of the field.
335
+ "deepline-feedback",
336
+ "deepline-gtm",
337
+ "deepline-start",
338
+ "deepline-plays",
339
+ "deepline-quickstart",
340
+ "deepline-research",
341
+ "deepline-scoring",
342
+ "find-qualified-titles",
343
+ "linkedin-url-lookup",
344
+ // Deprecated alias for `deepline-scoring`, kept installable so saved prompts
345
+ // and scripts using `/niche-signal-discovery` keep routing to the renamed
346
+ // skill. Move to LEGACY_SKILL_NAMES_TO_REMOVE once the window closes.
347
+ "niche-signal-discovery",
348
+ "portfolio-prospecting"
349
+ ];
350
+ var DEFAULT_SDK_SKILL_NAMES = [...DEFAULT_V1_SKILL_NAMES];
351
+ var LEGACY_SKILL_NAMES_TO_REMOVE = [
352
+ "deepline-plays-feedback",
353
+ "deepline-plays-quickstart",
354
+ "workflow-hello-world"
355
+ ];
356
+ function normalizeBaseUrl(baseUrl) {
357
+ return baseUrl.replace(/\/$/, "");
358
+ }
359
+ function renderTemplate(template, values) {
360
+ return template.replace(/\{([a-z_]+)\}/g, (match, key) => {
361
+ return _nullishCoalesce(values[key], () => ( match));
362
+ });
363
+ }
364
+ function skillsIndexUrl(baseUrl) {
365
+ return `${normalizeBaseUrl(baseUrl)}${INSTALL_COMMANDS.skills.index_path}`;
366
+ }
367
+ function skillsSourceUrl(baseUrl) {
368
+ return normalizeBaseUrl(baseUrl);
369
+ }
370
+ function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
371
+ const skillNames = Array.isArray(skillName) ? skillName : [skillName];
372
+ const [firstSkillName, ...extraSkillNames] = skillNames;
373
+ const agents = _nullishCoalesce(options.agents, () => ( _chunkFVLNYDI4js.DEFAULT_SKILL_AGENTS));
374
+ const values = {
375
+ skills_index_url: skillsIndexUrl(baseUrl),
376
+ skills_source_url: skillsSourceUrl(baseUrl),
377
+ agents: agents.join(" "),
378
+ skill_name: _nullishCoalesce(firstSkillName, () => ( ""))
379
+ };
380
+ const rendered = INSTALL_COMMANDS.skills.npx_add_args_template.flatMap(
381
+ (arg, index) => {
382
+ const next = index === 0 && options.firstArg ? options.firstArg : arg;
383
+ const value = renderTemplate(next, values);
384
+ if (arg === "{agents}") {
385
+ return agents;
386
+ }
387
+ if (arg === "{skill_name}") {
388
+ return [
389
+ value,
390
+ ...extraSkillNames.flatMap((name) => ["--skill", name])
391
+ ];
392
+ }
393
+ return value;
394
+ }
395
+ );
396
+ return rendered;
397
+ }
398
+
399
+ // src/cli/progress.ts
400
+ var _worker_threads = require('worker_threads');
401
+ var CliProgress = (_class = class {
402
+ __init() {this.lastMessage = null}
403
+ __init2() {this.interactive = Boolean(process.stderr.isTTY)}
404
+ __init3() {this.grey = "\x1B[90m"}
405
+ __init4() {this.cyan = "\x1B[36m"}
406
+ __init5() {this.dim = "\x1B[2m"}
407
+ __init6() {this.reset = "\x1B[0m"}
408
+ __init7() {this.worker = null}
409
+
410
+ // --json output is one JSON document: progress never renders under it.
411
+ 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);
412
+ this.enabled = enabled && !_chunkNF4V5DTYjs.isJsonOutputMode.call(void 0, );
413
+ }
414
+ phase(message) {
415
+ if (!this.enabled || this.lastMessage === message) {
416
+ return;
417
+ }
418
+ if (this.interactive && this.lastMessage) {
419
+ this.settle("\u2713");
420
+ }
421
+ this.lastMessage = message;
422
+ if (!this.interactive) {
423
+ process.stderr.write(`${message}
424
+ `);
425
+ return;
426
+ }
427
+ this.ensureWorker();
428
+ _optionalChain([this, 'access', _38 => _38.worker, 'optionalAccess', _39 => _39.postMessage, 'call', _40 => _40({ type: "phase", message })]);
429
+ }
430
+ complete() {
431
+ this.settle("\u2713");
432
+ }
433
+ fail() {
434
+ this.settle("\u2717");
435
+ }
436
+ writeLogLine(line) {
437
+ if (_chunkNF4V5DTYjs.isJsonOutputMode.call(void 0, )) return;
438
+ if (!this.enabled) {
439
+ process.stderr.write(`${line}
440
+ `);
441
+ return;
442
+ }
443
+ const message = this.interactive ? `${this.cyan}[logs]${this.reset} ${this.dim}${line}${this.reset}` : `[logs] ${line}`;
444
+ if (!this.interactive) {
445
+ process.stderr.write(`${message}
446
+ `);
447
+ return;
448
+ }
449
+ const activeMessage = this.lastMessage;
450
+ _optionalChain([this, 'access', _41 => _41.worker, 'optionalAccess', _42 => _42.terminate, 'call', _43 => _43(), 'access', _44 => _44.catch, 'call', _45 => _45(() => void 0)]);
451
+ this.worker = null;
452
+ process.stderr.write(`\r\x1B[2K${message}
453
+ `);
454
+ if (activeMessage) {
455
+ this.startWorker().postMessage({ type: "phase", message: activeMessage });
456
+ }
457
+ }
458
+ writeLine(line, stream = process.stderr) {
459
+ if (!this.enabled || !this.interactive) {
460
+ stream.write(`${line}
461
+ `);
462
+ return;
463
+ }
464
+ const activeMessage = this.lastMessage;
465
+ _optionalChain([this, 'access', _46 => _46.worker, 'optionalAccess', _47 => _47.terminate, 'call', _48 => _48(), 'access', _49 => _49.catch, 'call', _50 => _50(() => void 0)]);
466
+ this.worker = null;
467
+ stream.write(`\r\x1B[2K${line}
468
+ `);
469
+ if (activeMessage) {
470
+ this.startWorker().postMessage({ type: "phase", message: activeMessage });
471
+ }
472
+ }
473
+ settle(mark) {
474
+ if (!this.enabled || !this.lastMessage) {
475
+ return;
476
+ }
477
+ if (this.interactive) {
478
+ _optionalChain([this, 'access', _51 => _51.worker, 'optionalAccess', _52 => _52.terminate, 'call', _53 => _53(), 'access', _54 => _54.catch, 'call', _55 => _55(() => void 0)]);
479
+ this.worker = null;
480
+ process.stderr.write(
481
+ `\r\x1B[2K${this.grey}${mark} ${this.lastMessage}${this.reset}
482
+ `
483
+ );
484
+ }
485
+ this.lastMessage = null;
486
+ }
487
+ ensureWorker() {
488
+ this.startWorker();
489
+ }
490
+ startWorker() {
491
+ if (this.worker) {
492
+ return this.worker;
493
+ }
494
+ this.worker = new (0, _worker_threads.Worker)(
495
+ `
496
+ const { parentPort } = require('node:worker_threads');
497
+ const { writeSync } = require('node:fs');
498
+ const frames = ['\u2014', '\\\\', '|', '/'];
499
+ const grey = '\\x1b[90m';
500
+ const reset = '\\x1b[0m';
501
+ let message = '';
502
+ let frameIndex = 0;
503
+ let timer = null;
504
+ function render() {
505
+ if (!message) return;
506
+ const frame = frames[frameIndex % frames.length] || '\u2014';
507
+ frameIndex += 1;
508
+ writeSync(2, '\\r\\x1b[2K' + grey + frame + ' ' + message + reset);
509
+ }
510
+ parentPort.on('message', (event) => {
511
+ if (event.type === 'phase') {
512
+ message = String(event.message || '');
513
+ frameIndex = 0;
514
+ render();
515
+ if (!timer) {
516
+ timer = setInterval(render, 120);
517
+ timer.unref && timer.unref();
518
+ }
519
+ }
520
+ if (event.type === 'stop') {
521
+ if (timer) clearInterval(timer);
522
+ timer = null;
523
+ writeSync(2, '\\r\\x1b[2K');
524
+ }
525
+ });
526
+ `,
527
+ { eval: true }
528
+ );
529
+ this.worker.unref();
530
+ return this.worker;
531
+ }
532
+ }, _class);
533
+ var activeProgress = null;
534
+ function setActiveCliProgress(progress) {
535
+ activeProgress = progress;
536
+ }
537
+ function getActiveCliProgress() {
538
+ return activeProgress;
539
+ }
540
+ function createCliProgress(enabled) {
541
+ const progress = new CliProgress(enabled);
542
+ setActiveCliProgress(progress);
543
+ return progress;
544
+ }
545
+
406
546
  // src/cli/windows-arg-escape.ts
407
547
 
408
548
 
@@ -451,7 +591,7 @@ function resolveWindowsExecutable(command, env, cwd) {
451
591
  ) : _path.win32.resolve(cwd, command + extension);
452
592
  try {
453
593
  if (_fs.statSync.call(void 0, candidate).isFile()) return candidate;
454
- } catch (e5) {
594
+ } catch (e7) {
455
595
  }
456
596
  }
457
597
  }
@@ -482,7 +622,7 @@ function isFailureReportingDisabled() {
482
622
  return truthyEnv(FAILURE_REPORT_DISABLE_ENV);
483
623
  }
484
624
  function redactFailureText(value, maxChars = MAX_FAILURE_TEXT_CHARS) {
485
- const home = _optionalChain([process, 'access', _28 => _28.env, 'access', _29 => _29.HOME, 'optionalAccess', _30 => _30.trim, 'call', _31 => _31()]);
625
+ const home = _optionalChain([process, 'access', _56 => _56.env, 'access', _57 => _57.HOME, 'optionalAccess', _58 => _58.trim, 'call', _59 => _59()]);
486
626
  let text = String(_nullishCoalesce(value, () => ( "")));
487
627
  if (!text) return "";
488
628
  if (home && home !== "/") {
@@ -547,7 +687,13 @@ function classifyNetworkFailure(error) {
547
687
  if (combined.includes("remotedisconnected") || combined.includes("remote end closed connection") || combined.includes("other side closed") || combined.includes("socket hang up")) {
548
688
  return "network_remote_disconnected";
549
689
  }
550
- if (combined.includes("ssl") || combined.includes("tls") || combined.includes("unexpected_eof_while_reading")) {
690
+ if (
691
+ // Local filenames and retry commands may contain "ssl" or "tls".
692
+ // Require a transport identifier or protocol failure text instead.
693
+ code.includes("ssl") || code.includes("tls") || name.includes("ssl") || name.includes("tls") || /(?:^|[\s[(:])(?:ssl|tls)[\s:_-]+(?:error|handshake|certificate|routines|connection|failed|failure)(?:$|[\s:_-])/.test(
694
+ text
695
+ ) || combined.includes("unexpected_eof_while_reading")
696
+ ) {
551
697
  return "network_ssl_error";
552
698
  }
553
699
  current = _nullishCoalesce(record.cause, () => ( record.context));
@@ -578,7 +724,7 @@ function classifyNetworkCauseCategory(error) {
578
724
  }
579
725
  function isNetworkFailure(error) {
580
726
  if (!(error instanceof Error)) return false;
581
- if (error instanceof _chunk7P5AA3SNjs.DeeplineError && error.statusCode) return false;
727
+ if (error instanceof _chunkPPDBRJRWjs.DeeplineError && error.statusCode) return false;
582
728
  const code = classifyNetworkFailure(error);
583
729
  return code !== "network_error" || /unable to connect|unable to stream/i.test(error.message);
584
730
  }
@@ -590,37 +736,37 @@ function buildEnvironmentContext() {
590
736
  node_version: process.version,
591
737
  runtime: "Node.js",
592
738
  hostname: _os.hostname.call(void 0, ),
593
- agent_runtime: _chunkQUAQX3FQjs.detectAgentRuntime.call(void 0, )
739
+ agent_runtime: _chunkFVLNYDI4js.detectAgentRuntime.call(void 0, )
594
740
  };
595
741
  for (const key of ["CLAUDE_CODE_REMOTE", "DEEPLINE_PLUGIN_MODE"]) {
596
- const normalized = _optionalChain([process, 'access', _32 => _32.env, 'access', _33 => _33[key], 'optionalAccess', _34 => _34.trim, 'call', _35 => _35()]);
742
+ const normalized = _optionalChain([process, 'access', _60 => _60.env, 'access', _61 => _61[key], 'optionalAccess', _62 => _62.trim, 'call', _63 => _63()]);
597
743
  if (normalized) context[key.toLowerCase()] = normalized;
598
744
  }
599
- if (_optionalChain([process, 'access', _36 => _36.env, 'access', _37 => _37.CLAUDE_PROJECT_DIR, 'optionalAccess', _38 => _38.trim, 'call', _39 => _39()])) {
745
+ if (_optionalChain([process, 'access', _64 => _64.env, 'access', _65 => _65.CLAUDE_PROJECT_DIR, 'optionalAccess', _66 => _66.trim, 'call', _67 => _67()])) {
600
746
  context.claude_project_dir_present = "true";
601
747
  }
602
- if (_optionalChain([process, 'access', _40 => _40.env, 'access', _41 => _41.DEEPLINE_PLUGIN_ROOT, 'optionalAccess', _42 => _42.trim, 'call', _43 => _43()])) {
748
+ if (_optionalChain([process, 'access', _68 => _68.env, 'access', _69 => _69.DEEPLINE_PLUGIN_ROOT, 'optionalAccess', _70 => _70.trim, 'call', _71 => _71()])) {
603
749
  context.deepline_plugin_root_present = "true";
604
750
  }
605
- if (_optionalChain([process, 'access', _44 => _44.env, 'access', _45 => _45.DEEPLINE_PLUGIN_SKILLS_DIR, 'optionalAccess', _46 => _46.trim, 'call', _47 => _47()])) {
751
+ if (_optionalChain([process, 'access', _72 => _72.env, 'access', _73 => _73.DEEPLINE_PLUGIN_SKILLS_DIR, 'optionalAccess', _74 => _74.trim, 'call', _75 => _75()])) {
606
752
  context.deepline_plugin_skills_dir_present = "true";
607
753
  }
608
- if (_optionalChain([process, 'access', _48 => _48.env, 'access', _49 => _49.HOME, 'optionalAccess', _50 => _50.trim, 'call', _51 => _51(), 'access', _52 => _52.startsWith, 'call', _53 => _53("/sessions/")])) {
754
+ if (_optionalChain([process, 'access', _76 => _76.env, 'access', _77 => _77.HOME, 'optionalAccess', _78 => _78.trim, 'call', _79 => _79(), 'access', _80 => _80.startsWith, 'call', _81 => _81("/sessions/")])) {
609
755
  context.home_scope = "sessions";
610
756
  }
611
757
  return context;
612
758
  }
613
759
  function failureReportHeaders(apiKey) {
614
760
  return {
615
- ..._chunkQUAQX3FQjs.deploymentProtectionHeaders.call(void 0, ),
761
+ ..._chunkFVLNYDI4js.deploymentProtectionHeaders.call(void 0, ),
616
762
  Authorization: `Bearer ${apiKey}`,
617
763
  "Content-Type": "application/json",
618
- "User-Agent": `deepline-ts-sdk/${_chunkQUAQX3FQjs.SDK_VERSION}`,
764
+ "User-Agent": `deepline-ts-sdk/${_chunkFVLNYDI4js.SDK_VERSION}`,
619
765
  "X-Deepline-Client-Family": "sdk",
620
766
  "X-Deepline-CLI-Family": "sdk",
621
- "X-Deepline-Agent-Runtime": _chunkQUAQX3FQjs.detectAgentRuntime.call(void 0, ),
622
- "X-Deepline-CLI-Version": _chunkQUAQX3FQjs.SDK_VERSION,
623
- "X-Deepline-SDK-Version": _chunkQUAQX3FQjs.SDK_VERSION
767
+ "X-Deepline-Agent-Runtime": _chunkFVLNYDI4js.detectAgentRuntime.call(void 0, ),
768
+ "X-Deepline-CLI-Version": _chunkFVLNYDI4js.SDK_VERSION,
769
+ "X-Deepline-SDK-Version": _chunkFVLNYDI4js.SDK_VERSION
624
770
  };
625
771
  }
626
772
  async function postFailureReport(input) {
@@ -635,7 +781,7 @@ async function postFailureReport(input) {
635
781
  signal: controller.signal
636
782
  });
637
783
  return true;
638
- } catch (e6) {
784
+ } catch (e8) {
639
785
  return false;
640
786
  } finally {
641
787
  clearTimeout(timeout);
@@ -648,8 +794,8 @@ async function maybeReportAutomaticSkillsSyncFailure(input) {
648
794
  if (isFailureReportingDisabled()) return false;
649
795
  let apiKey = "";
650
796
  try {
651
- apiKey = _chunkQUAQX3FQjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
652
- } catch (e7) {
797
+ apiKey = _chunkFVLNYDI4js.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
798
+ } catch (e9) {
653
799
  return false;
654
800
  }
655
801
  if (!apiKey) return false;
@@ -675,7 +821,7 @@ async function maybeReportAutomaticSkillsSyncFailure(input) {
675
821
  failure_code: failureCode2,
676
822
  failure_stage: failureStage,
677
823
  error_body: "Automatic Deepline skills installation failed.",
678
- cli_version: _chunkQUAQX3FQjs.SDK_VERSION,
824
+ cli_version: _chunkFVLNYDI4js.SDK_VERSION,
679
825
  context: {
680
826
  environment: buildEnvironmentContext(),
681
827
  skills_sync: {
@@ -706,7 +852,7 @@ function commandTokens(argv) {
706
852
  }
707
853
  function isServerLoggedPlayRunStartFailure(input) {
708
854
  const [subcommand, command] = commandTokens(input.argv);
709
- return subcommand === "plays" && command === "run" && input.error instanceof _chunk7P5AA3SNjs.DeeplineError && typeof input.error.statusCode === "number";
855
+ return subcommand === "plays" && command === "run" && input.error instanceof _chunkPPDBRJRWjs.DeeplineError && typeof input.error.statusCode === "number";
710
856
  }
711
857
  function shouldReport(input) {
712
858
  if (input.error !== void 0) return true;
@@ -716,7 +862,7 @@ function failureCode(input) {
716
862
  if (input.error !== void 0) {
717
863
  if (isNetworkFailure(input.error))
718
864
  return classifyNetworkFailure(input.error);
719
- if (input.error instanceof _chunk7P5AA3SNjs.DeeplineError && input.error.code) {
865
+ if (input.error instanceof _chunkPPDBRJRWjs.DeeplineError && input.error.code) {
720
866
  return input.error.code;
721
867
  }
722
868
  if (input.error instanceof Error && input.error.name)
@@ -739,8 +885,8 @@ function resolvedFailureKind(input) {
739
885
  return input.error === void 0 ? "command_exit" : "uncaught_exception";
740
886
  }
741
887
  function safeRequestDiagnostics(error) {
742
- if (!(error instanceof _chunk7P5AA3SNjs.DeeplineError)) return null;
743
- const request = _optionalChain([error, 'access', _54 => _54.details, 'optionalAccess', _55 => _55.request]);
888
+ if (!(error instanceof _chunkPPDBRJRWjs.DeeplineError)) return null;
889
+ const request = _optionalChain([error, 'access', _82 => _82.details, 'optionalAccess', _83 => _83.request]);
744
890
  if (!request || typeof request !== "object" || Array.isArray(request))
745
891
  return null;
746
892
  const value = request;
@@ -760,7 +906,7 @@ function safeRequestDiagnostics(error) {
760
906
  if (url.protocol === "https:" || url.protocol === "http:") {
761
907
  result.url = redactFailureText(`${url.origin}${url.pathname}`, 1e3);
762
908
  }
763
- } catch (e8) {
909
+ } catch (e10) {
764
910
  }
765
911
  }
766
912
  if (typeof value.failedAtUtc === "string" && Number.isFinite(Date.parse(value.failedAtUtc))) {
@@ -795,7 +941,7 @@ function buildFailureReport(input) {
795
941
  failure_kind: failureKind,
796
942
  failure_code: code,
797
943
  failure_stage: input.error === void 0 ? "command_exit" : "cli_main",
798
- cli_version: _chunkQUAQX3FQjs.SDK_VERSION,
944
+ cli_version: _chunkFVLNYDI4js.SDK_VERSION,
799
945
  context: {
800
946
  base_url: redactFailureText(input.baseUrl, 400),
801
947
  command_summary: sanitizeCommand(input.argv),
@@ -815,8 +961,8 @@ async function maybeReportSdkCliFailure(input) {
815
961
  if (isServerLoggedPlayRunStartFailure(input)) return false;
816
962
  const exitCode = resolvedExitCode(input);
817
963
  if (!shouldReport({ exitCode, error: input.error })) return false;
818
- const baseUrl = _chunkQUAQX3FQjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
819
- const apiKey = _chunkQUAQX3FQjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
964
+ const baseUrl = _chunkFVLNYDI4js.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
965
+ const apiKey = _chunkFVLNYDI4js.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
820
966
  if (!apiKey) return false;
821
967
  return postFailureReport({
822
968
  baseUrl,
@@ -833,29 +979,45 @@ async function maybeReportSdkCliFailure(input) {
833
979
  }
834
980
 
835
981
  // src/cli/skills-sync.ts
982
+ var _child_process = require('child_process');
983
+
984
+
985
+ var _zlib = require('zlib');
986
+
987
+
988
+
989
+
990
+
991
+
992
+
993
+
994
+
995
+
996
+
997
+
836
998
  var CHECK_TIMEOUT_MS2 = 3e3;
837
999
  var INSTALLER_PROBE_TIMEOUT_MS = 1e3;
838
1000
  var PUBLISHED_VERIFICATION_RETRY_MS = 5 * 6e4;
839
1001
  function shouldSkipSkillsSync() {
840
- if (_chunkQUAQX3FQjs.detectAgentRuntime.call(void 0, ) === "claude_cowork" || isCiEnvironment()) {
1002
+ if (_chunkFVLNYDI4js.detectAgentRuntime.call(void 0, ) === "claude_cowork" || isCiEnvironment()) {
841
1003
  return true;
842
1004
  }
843
- const value = _optionalChain([process, 'access', _56 => _56.env, 'access', _57 => _57.DEEPLINE_SKIP_SKILLS_SYNC, 'optionalAccess', _58 => _58.trim, 'call', _59 => _59(), 'access', _60 => _60.toLowerCase, 'call', _61 => _61()]);
1005
+ const value = _optionalChain([process, 'access', _84 => _84.env, 'access', _85 => _85.DEEPLINE_SKIP_SKILLS_SYNC, 'optionalAccess', _86 => _86.trim, 'call', _87 => _87(), 'access', _88 => _88.toLowerCase, 'call', _89 => _89()]);
844
1006
  return value === "1" || value === "true" || value === "yes" || value === "on";
845
1007
  }
846
1008
  function unavailableSkillsNoticePath(baseUrl) {
847
- return _path.join.call(void 0, _chunkQUAQX3FQjs.sdkCliStateDirPath.call(void 0, baseUrl), "skills-sync-unavailable-version");
1009
+ return _path.join.call(void 0, _chunkFVLNYDI4js.sdkCliStateDirPath.call(void 0, baseUrl), "skills-sync-unavailable-version");
848
1010
  }
849
1011
  var SKILLS_SYNC_IN_PROGRESS_TTL_MS = 10 * 60 * 1e3;
850
1012
  var SKILLS_SYNC_IN_PROGRESS_PID_CAP_MS = 6 * 60 * 60 * 1e3;
851
- var agentLeaseSegment = _chunkQUAQX3FQjs.skillsAgentPathSegment;
1013
+ var agentLeaseSegment = _chunkFVLNYDI4js.skillsAgentPathSegment;
852
1014
  function sortedLeaseAgents(agents) {
853
- const expanded = agents.includes("*") ? [...agents, ..._chunkQUAQX3FQjs.KNOWN_SKILL_AGENTS] : agents;
1015
+ const expanded = agents.includes("*") ? [...agents, ..._chunkFVLNYDI4js.KNOWN_SKILL_AGENTS] : agents;
854
1016
  return [...new Set(expanded)].sort((a, b) => a.localeCompare(b));
855
1017
  }
856
1018
  function inProgressSkillsSyncPath(baseUrl, agent) {
857
1019
  return _path.join.call(void 0,
858
- _chunkQUAQX3FQjs.sdkCliStateDirPath.call(void 0, baseUrl),
1020
+ _chunkFVLNYDI4js.sdkCliStateDirPath.call(void 0, baseUrl),
859
1021
  `skills-sync-in-progress-${agentLeaseSegment(agent)}`
860
1022
  );
861
1023
  }
@@ -915,7 +1077,7 @@ function quarantine(path, tag) {
915
1077
  try {
916
1078
  _fs.renameSync.call(void 0, path, holding);
917
1079
  return holding;
918
- } catch (e9) {
1080
+ } catch (e11) {
919
1081
  return null;
920
1082
  }
921
1083
  }
@@ -1014,7 +1176,7 @@ var SkillsStateUnavailableError = class extends Error {
1014
1176
  constructor(baseUrl, error) {
1015
1177
  const detail = error instanceof Error ? error.message : String(error);
1016
1178
  super(
1017
- `Could not save skills state in ${_chunkQUAQX3FQjs.sdkCliStateDirPath.call(void 0, baseUrl)}: ${detail}`
1179
+ `Could not save skills state in ${_chunkFVLNYDI4js.sdkCliStateDirPath.call(void 0, baseUrl)}: ${detail}`
1018
1180
  );
1019
1181
  this.name = "SkillsStateUnavailableError";
1020
1182
  }
@@ -1035,7 +1197,7 @@ function recordOwnPidOnInProgressSkillsSync(baseUrl, leases) {
1035
1197
  `,
1036
1198
  "utf-8"
1037
1199
  );
1038
- } catch (e10) {
1200
+ } catch (e12) {
1039
1201
  }
1040
1202
  }
1041
1203
  }
@@ -1045,7 +1207,7 @@ function releaseInProgressSkillsSync(baseUrl, claimTokens) {
1045
1207
  if (!claimToken) {
1046
1208
  try {
1047
1209
  _fs.rmSync.call(void 0, dir, { recursive: true, force: true });
1048
- } catch (e11) {
1210
+ } catch (e13) {
1049
1211
  }
1050
1212
  continue;
1051
1213
  }
@@ -1056,7 +1218,7 @@ function releaseInProgressSkillsSync(baseUrl, claimTokens) {
1056
1218
  _fs.renameSync.call(void 0, tombstone, dir);
1057
1219
  continue;
1058
1220
  }
1059
- } catch (e12) {
1221
+ } catch (e14) {
1060
1222
  }
1061
1223
  _fs.rmSync.call(void 0, tombstone, { recursive: true, force: true });
1062
1224
  }
@@ -1089,7 +1251,7 @@ async function acquireSkillsInstallLease(baseUrl, agents, version, options = {
1089
1251
  if (Date.now() >= deadline) return null;
1090
1252
  if (!waited) {
1091
1253
  waited = true;
1092
- _optionalChain([options, 'access', _62 => _62.onWait, 'optionalCall', _63 => _63()]);
1254
+ _optionalChain([options, 'access', _90 => _90.onWait, 'optionalCall', _91 => _91()]);
1093
1255
  }
1094
1256
  await new Promise((resolve) => setTimeout(resolve, pollMs));
1095
1257
  }
@@ -1099,7 +1261,7 @@ function skillsInstallLeasePath(baseUrl, agents) {
1099
1261
  }
1100
1262
  function deferredSkillsNoticePath(baseUrl, agents) {
1101
1263
  return _path.join.call(void 0,
1102
- _chunkQUAQX3FQjs.sdkCliStateDirPath.call(void 0, baseUrl),
1264
+ _chunkFVLNYDI4js.sdkCliStateDirPath.call(void 0, baseUrl),
1103
1265
  `skills-sync-notice-${sortedLeaseAgents(agents).map(agentLeaseSegment).join("-")}`
1104
1266
  );
1105
1267
  }
@@ -1110,7 +1272,7 @@ function deferSkillsNotice(baseUrl, agents) {
1110
1272
  _fs.mkdirSync.call(void 0, _path.dirname.call(void 0, path), { recursive: true });
1111
1273
  _fs.appendFileSync.call(void 0, path, `${text.trimEnd()}
1112
1274
  `, "utf-8");
1113
- } catch (e13) {
1275
+ } catch (e15) {
1114
1276
  }
1115
1277
  };
1116
1278
  }
@@ -1122,19 +1284,19 @@ function flushDeferredSkillsNotices(baseUrl, agents) {
1122
1284
  let text = "";
1123
1285
  try {
1124
1286
  text = _fs.readFileSync.call(void 0, tombstone, "utf-8");
1125
- } catch (e14) {
1287
+ } catch (e16) {
1126
1288
  return;
1127
1289
  } finally {
1128
1290
  try {
1129
1291
  _fs.unlinkSync.call(void 0, tombstone);
1130
- } catch (e15) {
1292
+ } catch (e17) {
1131
1293
  }
1132
1294
  }
1133
1295
  if (text.trim()) writeSdkSkillsStatusLine(text.trimEnd());
1134
1296
  }
1135
1297
  function flushDeferredSkillsSyncNotices(baseUrl) {
1136
- if (shouldSkipSkillsSync() || _chunkQUAQX3FQjs.hasActivePluginSkills.call(void 0, )) return;
1137
- const agents = _chunkQUAQX3FQjs.resolveAutoSyncSkillAgents.call(void 0, );
1298
+ if (shouldSkipSkillsSync() || _chunkFVLNYDI4js.hasActivePluginSkills.call(void 0, )) return;
1299
+ const agents = _chunkFVLNYDI4js.resolveAutoSyncSkillAgents.call(void 0, );
1138
1300
  if (agents.length === 0) return;
1139
1301
  flushDeferredSkillsNotices(baseUrl, agents);
1140
1302
  }
@@ -1145,12 +1307,12 @@ function spawnDetachedSkillsSyncChild(argv, onSpawnError) {
1145
1307
  stdio: "ignore",
1146
1308
  env: process.env
1147
1309
  });
1148
- child.on("error", () => _optionalChain([onSpawnError, 'optionalCall', _64 => _64()]));
1310
+ child.on("error", () => _optionalChain([onSpawnError, 'optionalCall', _92 => _92()]));
1149
1311
  child.unref();
1150
1312
  }
1151
1313
  function failedSkillsSyncPath(baseUrl, agents) {
1152
1314
  return _path.join.call(void 0,
1153
- _chunkQUAQX3FQjs.sdkCliStateDirPath.call(void 0, baseUrl),
1315
+ _chunkFVLNYDI4js.sdkCliStateDirPath.call(void 0, baseUrl),
1154
1316
  `skills-sync-failed-${sortedLeaseAgents(agents).map(agentLeaseSegment).join("-")}-version`
1155
1317
  );
1156
1318
  }
@@ -1160,7 +1322,7 @@ function hasMarkedSkillsSyncVersion(path, version) {
1160
1322
  function readMarkedSkillsSyncVersion(path) {
1161
1323
  try {
1162
1324
  return _fs.existsSync.call(void 0, path) ? _fs.readFileSync.call(void 0, path, "utf-8").trim() : "";
1163
- } catch (e16) {
1325
+ } catch (e18) {
1164
1326
  return "";
1165
1327
  }
1166
1328
  }
@@ -1170,7 +1332,7 @@ function writeMarkedSkillsSyncVersion(path, version) {
1170
1332
  _fs.writeFileSync.call(void 0, path, `${version}
1171
1333
  `, "utf-8");
1172
1334
  return true;
1173
- } catch (e17) {
1335
+ } catch (e19) {
1174
1336
  return false;
1175
1337
  }
1176
1338
  }
@@ -1179,8 +1341,8 @@ function writeUnavailableSkillsNotice(baseUrl, remoteVersion, skillNames, reason
1179
1341
  if (hasMarkedSkillsSyncVersion(path, remoteVersion)) return;
1180
1342
  writeMarkedSkillsSyncVersion(path, remoteVersion);
1181
1343
  const probes = reason === "no-installer" ? _nullishCoalesce(knownProbes, () => ( probeInstallers())) : null;
1182
- const manualCommand = _optionalChain([probes, 'optionalAccess', _65 => _65.npx]) === "missing" && probes.bunx !== "missing" ? `bunx ${buildBunxSkillsInstallArgs(baseUrl, skillNames, _chunkQUAQX3FQjs.DEFAULT_SKILL_AGENTS).map(shellQuote).join(" ")}` : `npx ${buildSkillsInstallArgs(baseUrl, skillNames).join(" ")}`;
1183
- const explanation = reason === "unsupported-agent" ? "the detected agent has no automatic skills sync target. Automatic sync was skipped." : _optionalChain([probes, 'optionalAccess', _66 => _66.bunx]) === "missing" && probes.npx === "missing" ? "neither `bunx` nor `npx` was found on PATH. Make one available." : `installer version check failed for ${Object.entries(_nullishCoalesce(probes, () => ( {}))).filter(([, result]) => result === "failed").map(([command]) => `\`${command}\``).join(" and ")}. Check those commands with --version.`;
1344
+ const manualCommand = _optionalChain([probes, 'optionalAccess', _93 => _93.npx]) === "missing" && probes.bunx !== "missing" ? `bunx ${buildBunxSkillsInstallArgs(baseUrl, skillNames, _chunkFVLNYDI4js.DEFAULT_SKILL_AGENTS).map(shellQuote).join(" ")}` : `npx ${buildSkillsInstallArgs(baseUrl, skillNames).join(" ")}`;
1345
+ const explanation = reason === "unsupported-agent" ? "the detected agent has no automatic skills sync target. Automatic sync was skipped." : _optionalChain([probes, 'optionalAccess', _94 => _94.bunx]) === "missing" && probes.npx === "missing" ? "neither `bunx` nor `npx` was found on PATH. Make one available." : `installer version check failed for ${Object.entries(_nullishCoalesce(probes, () => ( {}))).filter(([, result]) => result === "failed").map(([command]) => `\`${command}\``).join(" and ")}. Check those commands with --version.`;
1184
1346
  notice(
1185
1347
  `Deepline agent skills are out of date, but ${explanation} To install manually, run:
1186
1348
  ${manualCommand}`
@@ -1189,7 +1351,7 @@ ${manualCommand}`
1189
1351
  function clearUnavailableSkillsNotice(baseUrl) {
1190
1352
  try {
1191
1353
  _fs.unlinkSync.call(void 0, unavailableSkillsNoticePath(baseUrl));
1192
- } catch (e18) {
1354
+ } catch (e20) {
1193
1355
  }
1194
1356
  }
1195
1357
  function hasFailedSkillsSync(baseUrl, remoteVersion, agents) {
@@ -1201,7 +1363,7 @@ function hasFailedSkillsSync(baseUrl, remoteVersion, agents) {
1201
1363
  const retry = JSON.parse(marked);
1202
1364
  const now = Date.now();
1203
1365
  return retry.version === remoteVersion && typeof retry.retryAfter === "number" && retry.retryAfter > now && retry.retryAfter <= now + PUBLISHED_VERIFICATION_RETRY_MS;
1204
- } catch (e19) {
1366
+ } catch (e21) {
1205
1367
  return false;
1206
1368
  }
1207
1369
  }
@@ -1226,7 +1388,7 @@ function deferPublishedVerificationRetry(baseUrl, remoteVersion, agents) {
1226
1388
  function clearFailedSkillsSync(baseUrl, agents) {
1227
1389
  try {
1228
1390
  _fs.unlinkSync.call(void 0, failedSkillsSyncPath(baseUrl, agents));
1229
- } catch (e20) {
1391
+ } catch (e22) {
1230
1392
  }
1231
1393
  }
1232
1394
  function clearFailedAutomaticSkillsSync(baseUrl, agents) {
@@ -1249,14 +1411,14 @@ async function fetchV1SkillIndex(baseUrl) {
1249
1411
  if (!response.ok) return null;
1250
1412
  const data = await response.json().catch(() => null);
1251
1413
  return data;
1252
- } catch (e21) {
1414
+ } catch (e23) {
1253
1415
  return null;
1254
1416
  } finally {
1255
1417
  clearTimeout(timeout);
1256
1418
  }
1257
1419
  }
1258
1420
  function v1SkillNames(index) {
1259
- const skills = Array.isArray(_optionalChain([index, 'optionalAccess', _67 => _67.skills])) ? index.skills : [];
1421
+ const skills = Array.isArray(_optionalChain([index, 'optionalAccess', _95 => _95.skills])) ? index.skills : [];
1260
1422
  return sortedUniqueSkillNames(
1261
1423
  skills.filter((skill) => skill && skill.install_surface === "v1").map((skill) => skill.name).filter(
1262
1424
  (name) => typeof name === "string" && name.length > 0
@@ -1267,7 +1429,7 @@ function buildSdkSkillNames(v1SkillNames2) {
1267
1429
  return sortedUniqueSkillNames(v1SkillNames2);
1268
1430
  }
1269
1431
  function isDefaultAgentSet(agents) {
1270
- return agents.length === _chunkQUAQX3FQjs.DEFAULT_SKILL_AGENTS.length && agents.every((agent, index) => agent === _chunkQUAQX3FQjs.DEFAULT_SKILL_AGENTS[index]);
1432
+ return agents.length === _chunkFVLNYDI4js.DEFAULT_SKILL_AGENTS.length && agents.every((agent, index) => agent === _chunkFVLNYDI4js.DEFAULT_SKILL_AGENTS[index]);
1271
1433
  }
1272
1434
  function safeSkillFilePath(value) {
1273
1435
  if (typeof value !== "string" || !value) return false;
@@ -1327,7 +1489,7 @@ function publishedArchiveFiles(bytes, expectedFiles, name) {
1327
1489
  var PublishedSkillsVerificationError = class extends Error {
1328
1490
  };
1329
1491
  async function verifyDefaultAgentSkillsInstall(baseUrl, remoteVersion, skillNames, index) {
1330
- if (_optionalChain([index, 'optionalAccess', _68 => _68.version]) !== remoteVersion) {
1492
+ if (_optionalChain([index, 'optionalAccess', _96 => _96.version]) !== remoteVersion) {
1331
1493
  throw new PublishedSkillsVerificationError(
1332
1494
  "the published skill index version does not match the server version"
1333
1495
  );
@@ -1343,7 +1505,7 @@ async function verifyDefaultAgentSkillsInstall(baseUrl, remoteVersion, skillName
1343
1505
  const entry = entries.find(
1344
1506
  (skill) => skill && skill.name === name && skill.install_surface === "v1"
1345
1507
  );
1346
- if (!Array.isArray(_optionalChain([entry, 'optionalAccess', _69 => _69.files])) || !entry.files.length || !entry.files.every(safeSkillFilePath) || new Set(entry.files).size !== entry.files.length || !entry.files.includes("SKILL.md") || entry.type !== "archive" || entry.url !== `./archives/${name}.tar.gz` || typeof entry.digest !== "string" || !/^sha256:[a-f0-9]{64}$/.test(entry.digest)) {
1508
+ if (!Array.isArray(_optionalChain([entry, 'optionalAccess', _97 => _97.files])) || !entry.files.length || !entry.files.every(safeSkillFilePath) || new Set(entry.files).size !== entry.files.length || !entry.files.includes("SKILL.md") || entry.type !== "archive" || entry.url !== `./archives/${name}.tar.gz` || typeof entry.digest !== "string" || !/^sha256:[a-f0-9]{64}$/.test(entry.digest)) {
1347
1509
  throw new PublishedSkillsVerificationError(
1348
1510
  `invalid published file list for ${name}`
1349
1511
  );
@@ -1397,7 +1559,7 @@ async function verifyDefaultAgentSkillsInstall(baseUrl, remoteVersion, skillName
1397
1559
  controller.abort();
1398
1560
  }
1399
1561
  const home = _os.homedir.call(void 0, );
1400
- const claudeConfigDir = _optionalChain([process, 'access', _70 => _70.env, 'access', _71 => _71.CLAUDE_CONFIG_DIR, 'optionalAccess', _72 => _72.trim, 'call', _73 => _73()]) || _path.join.call(void 0, home, ".claude");
1562
+ const claudeConfigDir = _optionalChain([process, 'access', _98 => _98.env, 'access', _99 => _99.CLAUDE_CONFIG_DIR, 'optionalAccess', _100 => _100.trim, 'call', _101 => _101()]) || _path.join.call(void 0, home, ".claude");
1401
1563
  for (const [name, { files }] of published) {
1402
1564
  for (const root of [
1403
1565
  _path.join.call(void 0, home, ".agents", "skills", name),
@@ -1424,23 +1586,23 @@ async function fetchSkillsUpdate(baseUrl, localVersion) {
1424
1586
  method: "POST",
1425
1587
  headers: { "Content-Type": "application/json" },
1426
1588
  body: JSON.stringify({
1427
- sdk_cli: { version: _chunkQUAQX3FQjs.SDK_VERSION },
1589
+ sdk_cli: { version: _chunkFVLNYDI4js.SDK_VERSION },
1428
1590
  skills: {
1429
1591
  version: localVersion,
1430
- capability: _chunkD6FFBSM5js.SDK_RELEASE.packageCapabilities.skillsGuidance
1592
+ capability: _chunk5UUQAGJSjs.SDK_RELEASE.packageCapabilities.skillsGuidance
1431
1593
  }
1432
1594
  }),
1433
1595
  signal: controller.signal
1434
1596
  });
1435
1597
  if (!response.ok) return null;
1436
1598
  const data = await response.json().catch(() => null);
1437
- const skills = _optionalChain([data, 'optionalAccess', _74 => _74.skills]);
1599
+ const skills = _optionalChain([data, 'optionalAccess', _102 => _102.skills]);
1438
1600
  if (!skills) return null;
1439
1601
  return {
1440
1602
  needsUpdate: skills.needs_update === true,
1441
- remoteVersion: typeof _optionalChain([skills, 'access', _75 => _75.remote, 'optionalAccess', _76 => _76.version]) === "string" ? skills.remote.version.trim() : ""
1603
+ remoteVersion: typeof _optionalChain([skills, 'access', _103 => _103.remote, 'optionalAccess', _104 => _104.version]) === "string" ? skills.remote.version.trim() : ""
1442
1604
  };
1443
- } catch (e22) {
1605
+ } catch (e24) {
1444
1606
  return null;
1445
1607
  } finally {
1446
1608
  clearTimeout(timeout);
@@ -1466,7 +1628,7 @@ function probeInstallers(timeoutMs) {
1466
1628
  }
1467
1629
  function noInstallerProbePath(baseUrl) {
1468
1630
  return _path.join.call(void 0,
1469
- _chunkQUAQX3FQjs.sdkCliStateDirPath.call(void 0, baseUrl),
1631
+ _chunkFVLNYDI4js.sdkCliStateDirPath.call(void 0, baseUrl),
1470
1632
  "skills-sync-no-installer-unknown.json"
1471
1633
  );
1472
1634
  }
@@ -1474,12 +1636,12 @@ function cachedUnavailableInstallerProbes(baseUrl, remoteVersion, allowBoundedFa
1474
1636
  const path = noInstallerProbePath(baseUrl);
1475
1637
  try {
1476
1638
  const cached = JSON.parse(_fs.readFileSync.call(void 0, path, "utf-8"));
1477
- if (typeof cached.version === "string" && (!remoteVersion || cached.version === remoteVersion) && typeof cached.checkedAt === "number" && cached.checkedAt <= Date.now() && Date.now() - cached.checkedAt < NEGATIVE_INSTALLER_PROBE_TTL_MS && (_optionalChain([cached, 'access', _77 => _77.probes, 'optionalAccess', _78 => _78.bunx]) === "missing" || _optionalChain([cached, 'access', _79 => _79.probes, 'optionalAccess', _80 => _80.bunx]) === "failed") && (_optionalChain([cached, 'access', _81 => _81.probes, 'optionalAccess', _82 => _82.npx]) === "missing" || _optionalChain([cached, 'access', _83 => _83.probes, 'optionalAccess', _84 => _84.npx]) === "failed") && // A terminal timeout is not evidence that the unbounded child probe
1639
+ if (typeof cached.version === "string" && (!remoteVersion || cached.version === remoteVersion) && typeof cached.checkedAt === "number" && cached.checkedAt <= Date.now() && Date.now() - cached.checkedAt < NEGATIVE_INSTALLER_PROBE_TTL_MS && (_optionalChain([cached, 'access', _105 => _105.probes, 'optionalAccess', _106 => _106.bunx]) === "missing" || _optionalChain([cached, 'access', _107 => _107.probes, 'optionalAccess', _108 => _108.bunx]) === "failed") && (_optionalChain([cached, 'access', _109 => _109.probes, 'optionalAccess', _110 => _110.npx]) === "missing" || _optionalChain([cached, 'access', _111 => _111.probes, 'optionalAccess', _112 => _112.npx]) === "failed") && // A terminal timeout is not evidence that the unbounded child probe
1478
1640
  // will fail. Older caches without probe provenance are ambiguous too.
1479
1641
  (allowBoundedFailures || cached.probeTimeoutMs === null || cached.probes.bunx === "missing" && cached.probes.npx === "missing")) {
1480
1642
  return cached.probes;
1481
1643
  }
1482
- } catch (e23) {
1644
+ } catch (e25) {
1483
1645
  }
1484
1646
  return null;
1485
1647
  }
@@ -1498,14 +1660,14 @@ function rememberUnavailableInstallerProbes(baseUrl, remoteVersion, probes, prob
1498
1660
  }),
1499
1661
  "utf-8"
1500
1662
  );
1501
- } catch (e24) {
1663
+ } catch (e26) {
1502
1664
  }
1503
1665
  }
1504
1666
  }
1505
1667
  function clearUnavailableInstallerProbes(baseUrl) {
1506
1668
  try {
1507
1669
  _fs.unlinkSync.call(void 0, noInstallerProbePath(baseUrl));
1508
- } catch (e25) {
1670
+ } catch (e27) {
1509
1671
  }
1510
1672
  }
1511
1673
  function dueUnknownInstallerProbes(baseUrl, remoteVersion) {
@@ -1528,7 +1690,7 @@ function probeCommand(command, timeoutMs) {
1528
1690
  timeout: timeoutMs
1529
1691
  });
1530
1692
  if (result.status === 0) return "available";
1531
- return _optionalChain([result, 'access', _85 => _85.error, 'optionalAccess', _86 => _86.code]) === "ENOENT" ? "missing" : "failed";
1693
+ return _optionalChain([result, 'access', _113 => _113.error, 'optionalAccess', _114 => _114.code]) === "ENOENT" ? "missing" : "failed";
1532
1694
  }
1533
1695
  function hasCommand(command) {
1534
1696
  return probeCommand(command) === "available";
@@ -1545,7 +1707,7 @@ function temporarySkillsSyncSkipCommand() {
1545
1707
  function resolveSkillsInstallSpawn(install, platform2 = process.platform) {
1546
1708
  return resolveShellSpawn(install.command, install.args, platform2);
1547
1709
  }
1548
- function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents = _chunkQUAQX3FQjs.DEFAULT_SKILL_AGENTS, knownProbes) {
1710
+ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents = _chunkFVLNYDI4js.DEFAULT_SKILL_AGENTS, knownProbes) {
1549
1711
  const commands = [];
1550
1712
  const probes = _nullishCoalesce(knownProbes, () => ( probeInstallers()));
1551
1713
  if (probes.bunx === "available") {
@@ -1687,7 +1849,7 @@ function runLegacySkillsCleanup(agents) {
1687
1849
  }
1688
1850
  }
1689
1851
  function writeSdkSkillsStatusLine(line) {
1690
- const progress = _chunkOSFWFV72js.getActiveCliProgress.call(void 0, );
1852
+ const progress = getActiveCliProgress();
1691
1853
  if (progress) {
1692
1854
  progress.writeLine(line);
1693
1855
  return;
@@ -1697,11 +1859,11 @@ function writeSdkSkillsStatusLine(line) {
1697
1859
  }
1698
1860
  async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
1699
1861
  if (shouldSkipSkillsSync()) return;
1700
- const usingPluginSkills = _chunkQUAQX3FQjs.hasActivePluginSkills.call(void 0, );
1862
+ const usingPluginSkills = _chunkFVLNYDI4js.hasActivePluginSkills.call(void 0, );
1701
1863
  if (usingPluginSkills) {
1702
1864
  return;
1703
1865
  }
1704
- const agents = _chunkQUAQX3FQjs.resolveAutoSyncSkillAgents.call(void 0, );
1866
+ const agents = _chunkFVLNYDI4js.resolveAutoSyncSkillAgents.call(void 0, );
1705
1867
  if (options.mode === "detached" && agents.length > 0) {
1706
1868
  flushDeferredSkillsNotices(baseUrl, agents);
1707
1869
  }
@@ -1729,12 +1891,12 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
1729
1891
  return;
1730
1892
  }
1731
1893
  try {
1732
- const localVersion = _chunkQUAQX3FQjs.readSdkSkillsLocalVersion.call(void 0, baseUrl);
1894
+ const localVersion = _chunkFVLNYDI4js.readSdkSkillsLocalVersion.call(void 0, baseUrl);
1733
1895
  const update = options.update === void 0 ? claimedVersion ? { needsUpdate: true, remoteVersion: claimedVersion } : await fetchSkillsUpdate(baseUrl, localVersion) : options.update ? {
1734
1896
  needsUpdate: options.update.needs_update,
1735
1897
  remoteVersion: options.update.remote.version
1736
1898
  } : null;
1737
- if (!_optionalChain([update, 'optionalAccess', _87 => _87.needsUpdate]) || !update.remoteVersion) {
1899
+ if (!_optionalChain([update, 'optionalAccess', _115 => _115.needsUpdate]) || !update.remoteVersion) {
1738
1900
  return;
1739
1901
  }
1740
1902
  if (agents.length > 0 && hasFailedSkillsSync(baseUrl, update.remoteVersion, agents)) {
@@ -1895,7 +2057,7 @@ async function runInlineSkillsSync(baseUrl, remoteVersion, agents, notices) {
1895
2057
  }
1896
2058
  }
1897
2059
  runLegacySkillsCleanup(agents);
1898
- if (!_chunkQUAQX3FQjs.writeSdkSkillsLocalVersion.call(void 0, baseUrl, update.remoteVersion, agents)) {
2060
+ if (!_chunkFVLNYDI4js.writeSdkSkillsLocalVersion.call(void 0, baseUrl, update.remoteVersion, agents)) {
1899
2061
  notice(
1900
2062
  "Deepline agent skills installed, but the local skills version could not be recorded. A later command will retry the refresh."
1901
2063
  );
@@ -1907,466 +2069,6 @@ async function runInlineSkillsSync(baseUrl, remoteVersion, agents, notices) {
1907
2069
  notice("Deepline agent skills are up to date.");
1908
2070
  }
1909
2071
 
1910
- // src/cli/commands/skills.ts
1911
- var SKILLS_INSTALL_LEASE_WAIT_MS = 9e4;
1912
- var SKILLS_PROCESS_TIMEOUT_MS = 45e3;
1913
- var RUNTIME_TO_SKILLS_AGENT = {
1914
- antigravity: "antigravity",
1915
- claude_code: "claude-code",
1916
- claude_cowork: "claude-code",
1917
- cline: "cline",
1918
- codex: "codex",
1919
- cursor: "cursor",
1920
- gemini: "gemini-cli",
1921
- windsurf: "windsurf"
1922
- };
1923
- var AGENT_MARKERS = [
1924
- { agent: "codex", paths: [".codex"] },
1925
- { agent: "claude-code", paths: [".claude"] },
1926
- { agent: "cursor", paths: [".cursor"] },
1927
- { agent: "gemini-cli", paths: [".gemini", ".gemini-cli"] },
1928
- { agent: "antigravity", paths: [".antigravity"] }
1929
- ];
1930
- var WORKSPACE_SKILL_ROOTS_BY_AGENT = {
1931
- antigravity: [".agents"],
1932
- "claude-code": [".claude"],
1933
- cline: [".agents"],
1934
- codex: [".agents"],
1935
- cursor: [".agents"],
1936
- "gemini-cli": [".agents"],
1937
- windsurf: [".windsurf"],
1938
- "*": [".agents", ".claude", ".windsurf"]
1939
- };
1940
- function workspaceSkillRootsForAgents(agents) {
1941
- return [
1942
- ...new Set(
1943
- agents.flatMap((agent) => _nullishCoalesce(WORKSPACE_SKILL_ROOTS_BY_AGENT[agent], () => ( [])))
1944
- )
1945
- ].sort((a, b) => a.localeCompare(b));
1946
- }
1947
- function normalizeScope(value) {
1948
- if (value === "global") return "global";
1949
- if (value === "local") return "local";
1950
- if (!value) return inferActiveSkillsScope();
1951
- throw new Error("--scope must be one of: global, local");
1952
- }
1953
- function inferActiveSkillsScope(entrypoint = _nullishCoalesce(process.argv[1], () => ( ""))) {
1954
- return /[\\/]\.deepline[\\/]runtime[\\/]/.test(entrypoint) ? "local" : "global";
1955
- }
1956
- function resolveLocalRoot() {
1957
- const target = _chunkQUAQX3FQjs.resolveProjectPinTarget.call(void 0, );
1958
- if (!target.ok) {
1959
- throw new Error(
1960
- `Cowork project folder is ambiguous. Candidate folders: ${target.candidates.join(
1961
- ", "
1962
- )}. Set CLAUDE_PROJECT_DIR or cd into the intended project folder.`
1963
- );
1964
- }
1965
- return target.dir;
1966
- }
1967
- function detectSkillsAgents(input) {
1968
- const runtime = _nullishCoalesce(input.runtime, () => ( _chunkQUAQX3FQjs.detectAgentRuntime.call(void 0, )));
1969
- const knownAgent = RUNTIME_TO_SKILLS_AGENT[runtime];
1970
- if (knownAgent) return [knownAgent];
1971
- const roots = [
1972
- ...input.scope === "local" && input.root ? [input.root] : [],
1973
- _nullishCoalesce(input.homeDir, () => ( _os.homedir.call(void 0, )))
1974
- ];
1975
- const detected = AGENT_MARKERS.filter(
1976
- (marker) => roots.some(
1977
- (root) => marker.paths.some((path) => _fs.existsSync.call(void 0, _path.join.call(void 0, root, path)))
1978
- )
1979
- ).map((marker) => marker.agent);
1980
- return detected.length > 0 ? detected : ["*"];
1981
- }
1982
- function skillsStatePathForScope(baseUrl, scope, root) {
1983
- return scope === "local" && root ? _path.join.call(void 0, root, ".deepline", "setup", "skills.json") : _path.join.call(void 0, _chunkQUAQX3FQjs.sdkCliStateDirPath.call(void 0, baseUrl), "skills-install.json");
1984
- }
1985
- function buildSkillsPlan(input) {
1986
- const scopeArgs = input.scope === "global" ? ["--global"] : [];
1987
- const legacyNames = [...LEGACY_SKILL_NAMES_TO_REMOVE].sort(
1988
- (a, b) => a.localeCompare(b)
1989
- );
1990
- return {
1991
- scope: input.scope,
1992
- root: input.root,
1993
- agents: input.agents,
1994
- skillNames: input.skillNames,
1995
- version: input.version,
1996
- remove: {
1997
- command: "npm",
1998
- args: [
1999
- "exec",
2000
- "--yes",
2001
- `--package=${SKILLS_NPX_PACKAGE}`,
2002
- "--",
2003
- "skills",
2004
- "remove",
2005
- ...scopeArgs,
2006
- "--agent",
2007
- ...input.agents,
2008
- "-y",
2009
- ...legacyNames
2010
- ]
2011
- },
2012
- install: {
2013
- command: "npm",
2014
- args: [
2015
- "exec",
2016
- "--yes",
2017
- `--package=${SKILLS_NPX_PACKAGE}`,
2018
- "--",
2019
- "skills",
2020
- "add",
2021
- skillsSourceUrl(input.baseUrl),
2022
- "--agent",
2023
- ...input.agents,
2024
- ...scopeArgs,
2025
- "--yes",
2026
- ...input.skillNames.flatMap((name) => ["--skill", name]),
2027
- "--full-depth"
2028
- ]
2029
- },
2030
- statePath: skillsStatePathForScope(input.baseUrl, input.scope, input.root)
2031
- };
2032
- }
2033
- function sortedStrings(value) {
2034
- if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string")) {
2035
- return null;
2036
- }
2037
- return [...value].sort((a, b) => a.localeCompare(b));
2038
- }
2039
- function isSkillsPlanCurrent(plan, state) {
2040
- if (!state || state.scope !== plan.scope || state.skillsVersion !== plan.version) {
2041
- return false;
2042
- }
2043
- const installedAgents = sortedStrings(state.agents);
2044
- const installedSkillNames = sortedStrings(state.skillNames);
2045
- if (!installedAgents || !installedSkillNames) return false;
2046
- return installedAgents.join("\0") === [...plan.agents].sort((a, b) => a.localeCompare(b)).join("\0") && installedSkillNames.join("\0") === [...plan.skillNames].sort((a, b) => a.localeCompare(b)).join("\0");
2047
- }
2048
- function readSkillsInstallState(path) {
2049
- try {
2050
- const parsed = JSON.parse(_fs.readFileSync.call(void 0, path, "utf8"));
2051
- return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
2052
- } catch (e26) {
2053
- return null;
2054
- }
2055
- }
2056
- function runProcess(command, args, cwd) {
2057
- return new Promise((resolve, reject) => {
2058
- const plan = resolveShellSpawn(
2059
- command,
2060
- args,
2061
- process.platform,
2062
- process.env,
2063
- cwd
2064
- );
2065
- const child = _child_process.spawn.call(void 0, plan.command, plan.args, {
2066
- cwd,
2067
- env: process.env,
2068
- stdio: ["ignore", "ignore", "pipe"],
2069
- shell: plan.shell
2070
- });
2071
- let stderr = "";
2072
- child.stderr.on("data", (chunk) => {
2073
- stderr += chunk.toString("utf8");
2074
- process.stderr.write(chunk);
2075
- });
2076
- const timeout = setTimeout(() => {
2077
- child.kill("SIGTERM");
2078
- reject(
2079
- new Error(
2080
- `${SKILLS_NPX_PACKAGE} timed out after ${SKILLS_PROCESS_TIMEOUT_MS}ms.`
2081
- )
2082
- );
2083
- }, SKILLS_PROCESS_TIMEOUT_MS);
2084
- child.once("error", (error) => {
2085
- clearTimeout(timeout);
2086
- reject(error);
2087
- });
2088
- child.once("close", (code) => {
2089
- clearTimeout(timeout);
2090
- if (code && stderr.trim()) {
2091
- process.stderr.write(`${SKILLS_NPX_PACKAGE} exited ${code}.
2092
- `);
2093
- }
2094
- resolve(_nullishCoalesce(code, () => ( 1)));
2095
- });
2096
- });
2097
- }
2098
- async function runSkillsCommand(options, dependencies = {}) {
2099
- let scope;
2100
- let root;
2101
- try {
2102
- scope = normalizeScope(options.scope);
2103
- root = scope === "local" ? resolveLocalRoot() : null;
2104
- } catch (error) {
2105
- _chunkQ3PUHXOYjs.printCommandEnvelope.call(void 0,
2106
- {
2107
- ok: false,
2108
- status: "failed",
2109
- code: "INVALID_SKILLS_SCOPE",
2110
- exitCode: 2,
2111
- message: error instanceof Error ? error.message : String(error)
2112
- },
2113
- { json: options.json }
2114
- );
2115
- return 2;
2116
- }
2117
- const baseUrl = _chunkQUAQX3FQjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
2118
- const catalog = {
2119
- skillNames: [...DEFAULT_SDK_SKILL_NAMES],
2120
- version: _chunkQUAQX3FQjs.SDK_VERSION
2121
- };
2122
- const agents = options.agent ? [options.agent] : detectSkillsAgents({ scope, root });
2123
- const plan = buildSkillsPlan({ baseUrl, scope, root, agents, ...catalog });
2124
- if (options.dryRun) {
2125
- _chunkQ3PUHXOYjs.printCommandEnvelope.call(void 0,
2126
- { ok: true, status: "planned", dryRun: true, ...plan },
2127
- { json: options.json }
2128
- );
2129
- return 0;
2130
- }
2131
- if (isSkillsPlanCurrent(plan, readSkillsInstallState(plan.statePath)) && !hasFailedAutomaticSkillsSync(baseUrl, agents)) {
2132
- _chunkQ3PUHXOYjs.printCommandEnvelope.call(void 0,
2133
- {
2134
- ok: true,
2135
- status: "current",
2136
- complete: true,
2137
- changed: false,
2138
- skipped: true,
2139
- skipReason: "skills_version_current",
2140
- scope,
2141
- agents,
2142
- skillsVersion: plan.version,
2143
- skillCount: plan.skillNames.length,
2144
- statePath: plan.statePath,
2145
- render: {
2146
- sections: [
2147
- {
2148
- title: "skills",
2149
- lines: [
2150
- `Scope: ${scope}`,
2151
- `Agents: ${agents.join(", ")}`,
2152
- `Current: ${plan.skillNames.length}`
2153
- ]
2154
- }
2155
- ]
2156
- }
2157
- },
2158
- { json: options.json }
2159
- );
2160
- return 0;
2161
- }
2162
- if (scope === "local" && root) {
2163
- const managedNames = [
2164
- .../* @__PURE__ */ new Set([...plan.skillNames, ...LEGACY_SKILL_NAMES_TO_REMOVE])
2165
- ];
2166
- const agentRoots = workspaceSkillRootsForAgents(plan.agents);
2167
- _chunkQUAQX3FQjs.ensureProjectPrivatePathsIgnored.call(void 0, root, [
2168
- ".deepline/",
2169
- ...agentRoots.flatMap(
2170
- (agentRoot) => managedNames.map((name) => `${agentRoot}/skills/${name}/`)
2171
- )
2172
- ]);
2173
- }
2174
- let lease;
2175
- try {
2176
- lease = scope === "global" ? await acquireSkillsInstallLease(baseUrl, agents, plan.version, {
2177
- waitMs: _nullishCoalesce(dependencies.installLeaseWaitMs, () => ( SKILLS_INSTALL_LEASE_WAIT_MS)),
2178
- onWait: () => process.stderr.write(
2179
- "Waiting for a background Deepline skills refresh to finish...\n"
2180
- )
2181
- }) : { release: () => {
2182
- } };
2183
- } catch (error) {
2184
- if (!(error instanceof SkillsStateUnavailableError)) throw error;
2185
- _chunkQ3PUHXOYjs.printCommandEnvelope.call(void 0,
2186
- {
2187
- ok: false,
2188
- status: "failed",
2189
- code: "SKILLS_STATE_UNAVAILABLE",
2190
- exitCode: 5,
2191
- scope,
2192
- agents,
2193
- message: error.message,
2194
- next: `Resolve this filesystem error, then run: deepline skills --scope ${scope}`
2195
- },
2196
- { json: options.json }
2197
- );
2198
- return 5;
2199
- }
2200
- if (!lease) {
2201
- _chunkQ3PUHXOYjs.printCommandEnvelope.call(void 0,
2202
- {
2203
- ok: false,
2204
- status: "failed",
2205
- code: "SKILLS_SYNC_IN_PROGRESS",
2206
- exitCode: 7,
2207
- scope,
2208
- agents,
2209
- message: "A background Deepline skills refresh is still running for these agents.",
2210
- next: `Retry in a moment: deepline skills --scope ${scope}. If no refresh is running, remove ${skillsInstallLeasePath(baseUrl, agents)}`
2211
- },
2212
- { json: options.json }
2213
- );
2214
- return 7;
2215
- }
2216
- try {
2217
- return await runSkillsInstallWithLease({
2218
- options,
2219
- dependencies,
2220
- baseUrl,
2221
- scope,
2222
- root,
2223
- agents,
2224
- plan
2225
- });
2226
- } finally {
2227
- lease.release();
2228
- }
2229
- }
2230
- async function runSkillsInstallWithLease(input) {
2231
- const { options, dependencies, baseUrl, scope, root, agents, plan } = input;
2232
- process.stderr.write(
2233
- `Replacing Deepline skills for ${agents.join(", ")} (${scope})...
2234
- `
2235
- );
2236
- const execute = _nullishCoalesce(dependencies.runProcess, () => ( runProcess));
2237
- try {
2238
- const installCode = await execute(
2239
- plan.install.command,
2240
- plan.install.args,
2241
- _nullishCoalesce(root, () => ( void 0))
2242
- );
2243
- if (installCode !== 0) {
2244
- throw new Error("Could not install the current Deepline skills.");
2245
- }
2246
- } catch (error) {
2247
- _chunkQ3PUHXOYjs.printCommandEnvelope.call(void 0,
2248
- {
2249
- ok: false,
2250
- status: "failed",
2251
- code: "SKILLS_INSTALL_FAILED",
2252
- exitCode: 5,
2253
- scope,
2254
- agents,
2255
- message: error instanceof Error ? error.message : String(error),
2256
- next: `deepline skills --scope ${scope}`
2257
- },
2258
- { json: options.json }
2259
- );
2260
- return 5;
2261
- }
2262
- try {
2263
- const removeCode = await execute(
2264
- plan.remove.command,
2265
- plan.remove.args,
2266
- _nullishCoalesce(root, () => ( void 0))
2267
- );
2268
- if (removeCode !== 0) {
2269
- process.stderr.write(
2270
- "Current Deepline skills installed, but legacy skill cleanup failed. The installed skills remain usable.\n"
2271
- );
2272
- }
2273
- } catch (error) {
2274
- process.stderr.write(
2275
- `Current Deepline skills installed, but legacy skill cleanup failed: ${error instanceof Error ? error.message : String(error)}. The installed skills remain usable.
2276
- `
2277
- );
2278
- }
2279
- _fs.mkdirSync.call(void 0, _path.dirname.call(void 0, plan.statePath), { recursive: true });
2280
- _fs.writeFileSync.call(void 0,
2281
- plan.statePath,
2282
- `${JSON.stringify(
2283
- {
2284
- schemaVersion: 1,
2285
- installedAt: (/* @__PURE__ */ new Date()).toISOString(),
2286
- cliVersion: _chunkQUAQX3FQjs.SDK_VERSION,
2287
- scope,
2288
- agents,
2289
- skillsVersion: plan.version,
2290
- skillNames: plan.skillNames
2291
- },
2292
- null,
2293
- 2
2294
- )}
2295
- `,
2296
- "utf8"
2297
- );
2298
- if (scope === "global") {
2299
- clearFailedAutomaticSkillsSync(baseUrl, agents);
2300
- }
2301
- _chunkQ3PUHXOYjs.printCommandEnvelope.call(void 0,
2302
- {
2303
- ok: true,
2304
- status: "complete",
2305
- scope,
2306
- agents,
2307
- skillsVersion: plan.version,
2308
- skillCount: plan.skillNames.length,
2309
- statePath: plan.statePath,
2310
- render: {
2311
- sections: [
2312
- {
2313
- title: "skills",
2314
- lines: [
2315
- `Scope: ${scope}`,
2316
- `Agents: ${agents.join(", ")}`,
2317
- `Installed: ${plan.skillNames.length}`
2318
- ]
2319
- }
2320
- ]
2321
- }
2322
- },
2323
- { json: options.json }
2324
- );
2325
- return 0;
2326
- }
2327
- function registerSkillsCommand(program) {
2328
- program.command("skills").description("Replace Deepline agent skills with the current release.").option("--scope <scope>", "Install scope: global or local").option("--agent <agent>", "Override the detected agent target").option("--dry-run", "Print the install plan without changing files").option("--json", "Emit one JSON result envelope").addHelpText(
2329
- "after",
2330
- `
2331
- Notes:
2332
- This command reinstalls current Deepline-managed skills using ${SKILLS_NPX_PACKAGE},
2333
- then removes legacy Deepline skill names. Local scope writes into the resolved
2334
- persistent project.
2335
-
2336
- Examples:
2337
- deepline skills
2338
- deepline skills --scope local
2339
- deepline skills --agent codex --dry-run
2340
- `
2341
- ).action(async (options) => {
2342
- process.exitCode = await runSkillsCommand(options);
2343
- });
2344
- program.command(SKILLS_AUTO_SYNC_COMMAND, { hidden: true }).description("Refresh Deepline agent skills in the background.").option(
2345
- "--claim <token>",
2346
- "Owner token of the leases this child was started for."
2347
- ).action(async (options) => {
2348
- const claim = _optionalChain([options, 'access', _88 => _88.claim, 'optionalAccess', _89 => _89.trim, 'call', _90 => _90()]);
2349
- if (!claim) {
2350
- _chunkQ3PUHXOYjs.printCommandEnvelope.call(void 0,
2351
- {
2352
- ok: false,
2353
- status: "failed",
2354
- code: "SKILLS_AUTO_SYNC_CLAIM_REQUIRED",
2355
- exitCode: 2,
2356
- message: "skills-auto-sync is started by ordinary deepline commands and requires the lease token they pass; run `deepline skills` to install skills yourself."
2357
- },
2358
- { json: true }
2359
- );
2360
- process.exitCode = 2;
2361
- return;
2362
- }
2363
- await syncSdkSkillsIfNeeded(_chunkQUAQX3FQjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, ""), {
2364
- mode: "inline",
2365
- notices: "defer",
2366
- claim
2367
- });
2368
- });
2369
- }
2370
2072
 
2371
2073
 
2372
2074
 
@@ -2393,4 +2095,7 @@ Examples:
2393
2095
 
2394
2096
 
2395
2097
 
2396
- exports.SDK_COMPATIBILITY_FAST_DEADLINE_MS = SDK_COMPATIBILITY_FAST_DEADLINE_MS; exports.readFreshCleanCompatibility = readFreshCleanCompatibility; exports.readTrustedCleanCompatibility = readTrustedCleanCompatibility; exports.checkSdkCompatibility = checkSdkCompatibility; exports.isCiEnvironment = isCiEnvironment; exports.enforceSdkCompatibilityResponse = enforceSdkCompatibilityResponse; exports.resolveShellSpawn = resolveShellSpawn; exports.isFailureReportingDisabled = isFailureReportingDisabled; exports.redactFailureText = redactFailureText; exports.sanitizeCommand = sanitizeCommand; exports.failureReportHeaders = failureReportHeaders; exports.resolveSdkCliFailureExitCode = resolveSdkCliFailureExitCode; exports.maybeReportSdkCliFailure = maybeReportSdkCliFailure; exports.flushDeferredSkillsSyncNotices = flushDeferredSkillsSyncNotices; exports.SKILLS_AUTO_SYNC_COMMAND = SKILLS_AUTO_SYNC_COMMAND; exports.syncSdkSkillsIfNeeded = syncSdkSkillsIfNeeded; exports.workspaceSkillRootsForAgents = workspaceSkillRootsForAgents; exports.inferActiveSkillsScope = inferActiveSkillsScope; exports.detectSkillsAgents = detectSkillsAgents; exports.skillsStatePathForScope = skillsStatePathForScope; exports.buildSkillsPlan = buildSkillsPlan; exports.isSkillsPlanCurrent = isSkillsPlanCurrent; exports.runSkillsCommand = runSkillsCommand; exports.registerSkillsCommand = registerSkillsCommand;
2098
+
2099
+
2100
+
2101
+ exports.SDK_COMPATIBILITY_FAST_DEADLINE_MS = SDK_COMPATIBILITY_FAST_DEADLINE_MS; exports.readFreshCleanCompatibility = readFreshCleanCompatibility; exports.readTrustedCleanCompatibility = readTrustedCleanCompatibility; exports.claimUpdateAdvisory = claimUpdateAdvisory; exports.checkSdkCompatibility = checkSdkCompatibility; exports.isCiEnvironment = isCiEnvironment; exports.enforceSdkCompatibilityResponse = enforceSdkCompatibilityResponse; exports.SKILLS_NPX_PACKAGE = SKILLS_NPX_PACKAGE; exports.DEFAULT_SDK_SKILL_NAMES = DEFAULT_SDK_SKILL_NAMES; exports.LEGACY_SKILL_NAMES_TO_REMOVE = LEGACY_SKILL_NAMES_TO_REMOVE; exports.skillsSourceUrl = skillsSourceUrl; exports.getActiveCliProgress = getActiveCliProgress; exports.createCliProgress = createCliProgress; exports.resolveShellSpawn = resolveShellSpawn; exports.isFailureReportingDisabled = isFailureReportingDisabled; exports.redactFailureText = redactFailureText; exports.sanitizeCommand = sanitizeCommand; exports.failureReportHeaders = failureReportHeaders; exports.resolveSdkCliFailureExitCode = resolveSdkCliFailureExitCode; exports.maybeReportSdkCliFailure = maybeReportSdkCliFailure; exports.SkillsStateUnavailableError = SkillsStateUnavailableError; exports.acquireSkillsInstallLease = acquireSkillsInstallLease; exports.skillsInstallLeasePath = skillsInstallLeasePath; exports.flushDeferredSkillsSyncNotices = flushDeferredSkillsSyncNotices; exports.SKILLS_AUTO_SYNC_COMMAND = SKILLS_AUTO_SYNC_COMMAND; exports.hasFailedAutomaticSkillsSync = hasFailedAutomaticSkillsSync; exports.clearFailedAutomaticSkillsSync = clearFailedAutomaticSkillsSync; exports.syncSdkSkillsIfNeeded = syncSdkSkillsIfNeeded;