deepline 0.3.309 → 0.3.311

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 (88) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +7 -3
  3. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +67 -14
  4. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +4 -1
  5. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +53 -7
  6. package/dist/cli/{auth-AA5SXOB6.mjs → auth-2A7OYHFJ.mjs} +4 -4
  7. package/dist/cli/auth-66JFXP6C.js +31 -0
  8. package/dist/cli/{billing-6DJWMFV7.js → billing-2PQ4VDRR.js} +70 -70
  9. package/dist/cli/{billing-CXUIXODY.mjs → billing-P7GIAP3U.mjs} +4 -4
  10. package/dist/cli/{chunk-ATTN5BOA.mjs → chunk-4WFNAWVO.mjs} +2 -2
  11. package/dist/cli/{chunk-5VHI2LFM.js → chunk-5IBHISKA.js} +6 -6
  12. package/dist/cli/{chunk-W3CSORIT.mjs → chunk-5OVNL6LS.mjs} +1 -1
  13. package/dist/cli/{chunk-CO5TGXG2.js → chunk-7TT4LZIR.js} +250 -125
  14. package/dist/cli/{chunk-YBKMQLH2.mjs → chunk-DUEHAEPM.mjs} +1 -1
  15. package/dist/cli/{chunk-3SZSFTLQ.js → chunk-FYPZ43Y4.js} +1 -1
  16. package/dist/cli/{chunk-YV5USGOP.mjs → chunk-G3QP2WYR.mjs} +6 -6
  17. package/dist/cli/{chunk-52FXVKVC.js → chunk-GCX3343L.js} +48 -48
  18. package/dist/cli/{chunk-TQ5BV5RT.mjs → chunk-HOCPOTDX.mjs} +2 -2
  19. package/dist/cli/{chunk-IQYTESPK.js → chunk-IB7OGQGH.js} +6 -6
  20. package/dist/cli/{chunk-OTX2Z2Y7.mjs → chunk-ICZB4GTY.mjs} +3 -3
  21. package/dist/cli/{chunk-M2V27CEE.js → chunk-LRI2FQF2.js} +26 -26
  22. package/dist/cli/{chunk-N6P7NBX3.mjs → chunk-Q3LYQTSO.mjs} +1 -1
  23. package/dist/cli/{chunk-4A6BYN66.mjs → chunk-QJA6SJHA.mjs} +2 -2
  24. package/dist/cli/{chunk-6QWXPOZM.js → chunk-QO3GH6UP.js} +2 -2
  25. package/dist/cli/{chunk-PAJVT47Z.js → chunk-QYL5ZV4U.js} +6 -6
  26. package/dist/cli/{chunk-NZCFZXDP.js → chunk-RNJ74JDH.js} +4 -4
  27. package/dist/cli/{chunk-3EVKBS6J.mjs → chunk-SGTSJCOA.mjs} +1 -1
  28. package/dist/cli/{chunk-GUUQJJBS.mjs → chunk-SPUTBCUR.mjs} +1 -1
  29. package/dist/cli/{chunk-A74BQEUC.mjs → chunk-TBX7AA7Y.mjs} +175 -50
  30. package/dist/cli/{chunk-4SAHSARB.js → chunk-VODJJUKE.js} +15 -15
  31. package/dist/cli/{chunk-V5PB43SQ.js → chunk-XDUQQTIS.js} +6 -6
  32. package/dist/cli/client-ADWRS22F.js +20 -0
  33. package/dist/cli/{client-GXT2WRBH.mjs → client-PNLDT2M3.mjs} +3 -3
  34. package/dist/cli/{csv-OLMTSK4E.mjs → csv-KUAATBZQ.mjs} +3 -3
  35. package/dist/cli/{csv-FY7CVAUY.js → csv-L5DN7F45.js} +12 -12
  36. package/dist/cli/{db-XHHF7SFB.js → db-6NIH4KTZ.js} +20 -20
  37. package/dist/cli/{db-HWYKGEOK.mjs → db-WZOD6NP5.mjs} +4 -4
  38. package/dist/cli/{executions-5L7YUA7K.mjs → executions-RDDXGT2Y.mjs} +4 -4
  39. package/dist/cli/{executions-K2IJEKEN.js → executions-TQ5WRHDS.js} +6 -6
  40. package/dist/cli/{feedback-FZLBZKF7.js → feedback-NYKLEQB6.js} +6 -6
  41. package/dist/cli/{feedback-BIN2IWO4.mjs → feedback-ZB4WKBSS.mjs} +3 -3
  42. package/dist/cli/git-E56KOYJR.js +23 -0
  43. package/dist/cli/{git-G4ULJPIH.mjs → git-E6DKAX3X.mjs} +4 -4
  44. package/dist/cli/index.js +73 -73
  45. package/dist/cli/index.mjs +30 -30
  46. package/dist/cli/{legacy-noops-YBBLHKUV.mjs → legacy-noops-25B7JCOZ.mjs} +4 -4
  47. package/dist/cli/{legacy-noops-TBTYKXMK.js → legacy-noops-26Y5NSU6.js} +7 -7
  48. package/dist/cli/{monitors-PXBJTE6Q.js → monitors-L3GFT4MG.js} +85 -85
  49. package/dist/cli/{monitors-ZRNDHLTP.mjs → monitors-WRTHO7DT.mjs} +4 -4
  50. package/dist/cli/{org-AUPHYG4W.js → org-BNCTGPWF.js} +60 -60
  51. package/dist/cli/{org-GR7CKJDU.mjs → org-ZTHOFVEO.mjs} +4 -4
  52. package/dist/cli/{play-BXX6KDC5.js → play-BCMGFYTF.js} +220 -220
  53. package/dist/cli/{play-7C4XXDLJ.mjs → play-SOG5Q2GE.mjs} +6 -6
  54. package/dist/cli/{providers-X3W5I7AI.js → providers-MLOKTD6O.js} +7 -7
  55. package/dist/cli/{providers-2ALIWVHI.mjs → providers-SLAPPVMU.mjs} +4 -4
  56. package/dist/cli/{quickstart-YU2FOUGV.js → quickstart-IWJLGET3.js} +5 -5
  57. package/dist/cli/{quickstart-HFLMM6CB.mjs → quickstart-LZRKZLNQ.mjs} +3 -3
  58. package/dist/cli/{search-LBAPKYPL.js → search-6FBDSA3K.js} +6 -6
  59. package/dist/cli/{search-5W6CX5FT.mjs → search-RCDGSNWW.mjs} +5 -5
  60. package/dist/cli/{secrets-4JYV6372.js → secrets-24KEMSCU.js} +13 -13
  61. package/dist/cli/{secrets-N3LH3EFK.mjs → secrets-GDPYV6OC.mjs} +4 -4
  62. package/dist/cli/{sessions-66MKLRBI.js → sessions-QOUUGVP3.js} +5 -5
  63. package/dist/cli/{sessions-4TCBDROP.mjs → sessions-ST5XQQZN.mjs} +4 -4
  64. package/dist/cli/{settings-GQMXHDZN.js → settings-4XWDMAA2.js} +74 -74
  65. package/dist/cli/{settings-33RZDJOH.mjs → settings-V6Z775TO.mjs} +7 -7
  66. package/dist/cli/{setup-754356IS.mjs → setup-QPZLP25U.mjs} +6 -6
  67. package/dist/cli/{setup-HU6LC4VR.js → setup-W7SPZTUL.js} +41 -41
  68. package/dist/cli/{skills-FLWPPQMH.mjs → skills-QG22R2EI.mjs} +4 -4
  69. package/dist/cli/skills-WKOQBJY7.js +28 -0
  70. package/dist/cli/{tools-IRLN4KYG.mjs → tools-G4HGCHNQ.mjs} +5 -5
  71. package/dist/cli/{tools-N4OW6HZK.js → tools-WN7T25LW.js} +50 -50
  72. package/dist/cli/{update-TOQOHGVE.mjs → update-5PSYBGVU.mjs} +6 -6
  73. package/dist/cli/update-WKVCWGYY.js +28 -0
  74. package/dist/cli/{workflow-DRH7T3P4.mjs → workflow-EK7DV4AQ.mjs} +5 -5
  75. package/dist/cli/{workflow-WSYT32Y3.js → workflow-ZEQ46MGG.js} +15 -15
  76. package/dist/index.js +6 -6
  77. package/dist/index.mjs +3 -3
  78. package/dist/install-integrity.json +68 -68
  79. package/dist/release.d.mts +1 -1
  80. package/dist/release.d.ts +1 -1
  81. package/dist/release.js +2 -2
  82. package/dist/release.mjs +1 -1
  83. package/package.json +1 -1
  84. package/dist/cli/auth-MXBOMMLC.js +0 -31
  85. package/dist/cli/client-B2MYCJW5.js +0 -20
  86. package/dist/cli/git-KSXSQSH2.js +0 -23
  87. package/dist/cli/skills-WWO2EIQU.js +0 -28
  88. package/dist/cli/update-CLSJ7ODP.js +0 -28
@@ -3,7 +3,7 @@
3
3
  var _chunkWJYPBHTEjs = require('./chunk-WJYPBHTE.js');
4
4
 
5
5
 
6
- var _chunkV5PB43SQjs = require('./chunk-V5PB43SQ.js');
6
+ var _chunkXDUQQTISjs = require('./chunk-XDUQQTIS.js');
7
7
 
8
8
 
9
9
 
@@ -22,7 +22,7 @@ var _chunkV5PB43SQjs = require('./chunk-V5PB43SQ.js');
22
22
 
23
23
 
24
24
 
25
- var _chunkNZCFZXDPjs = require('./chunk-NZCFZXDP.js');
25
+ var _chunkRNJ74JDHjs = require('./chunk-RNJ74JDH.js');
26
26
 
27
27
 
28
28
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
@@ -116,7 +116,7 @@ function skillsSourceUrl(baseUrl) {
116
116
  function buildSkillsAddArgs(baseUrl, skillName, options = {}) {
117
117
  const skillNames = Array.isArray(skillName) ? skillName : [skillName];
118
118
  const [firstSkillName, ...extraSkillNames] = skillNames;
119
- const agents = _nullishCoalesce(options.agents, () => ( _chunkNZCFZXDPjs.DEFAULT_SKILL_AGENTS));
119
+ const agents = _nullishCoalesce(options.agents, () => ( _chunkRNJ74JDHjs.DEFAULT_SKILL_AGENTS));
120
120
  const values = {
121
121
  skills_index_url: skillsIndexUrl(baseUrl),
122
122
  skills_source_url: skillsSourceUrl(baseUrl),
@@ -192,7 +192,7 @@ function shouldSkipCompatibilityCheck() {
192
192
  return value === "1" || value === "true" || value === "yes";
193
193
  }
194
194
  function sdkCompatibilityCachePath(baseUrl, homeDir = _os.homedir.call(void 0, )) {
195
- return _path.join.call(void 0, _chunkNZCFZXDPjs.sdkCliStateDirPath.call(void 0, baseUrl, homeDir), "compat-cache.json");
195
+ return _path.join.call(void 0, _chunkRNJ74JDHjs.sdkCliStateDirPath.call(void 0, baseUrl, homeDir), "compat-cache.json");
196
196
  }
197
197
  function legacySdkCompatibilityCachePath(homeDir = _os.homedir.call(void 0, )) {
198
198
  return _path.join.call(void 0, homeDir, ".cache", "deepline", "sdk-compat-cache.json");
@@ -200,9 +200,9 @@ function legacySdkCompatibilityCachePath(homeDir = _os.homedir.call(void 0, )) {
200
200
  function compatibilityCacheKey(baseUrl, command, skillsVersion) {
201
201
  return JSON.stringify({
202
202
  baseUrl: baseUrl.replace(/\/$/, ""),
203
- version: _chunkNZCFZXDPjs.SDK_VERSION,
204
- apiContract: _chunkNZCFZXDPjs.SDK_API_CONTRACT,
205
- apiMajor: _chunkNZCFZXDPjs.SDK_API_MAJOR,
203
+ version: _chunkRNJ74JDHjs.SDK_VERSION,
204
+ apiContract: _chunkRNJ74JDHjs.SDK_API_CONTRACT,
205
+ apiMajor: _chunkRNJ74JDHjs.SDK_API_MAJOR,
206
206
  command: _optionalChain([command, 'optionalAccess', _7 => _7.trim, 'call', _8 => _8()]) || null,
207
207
  skillsVersion: _nullishCoalesce(skillsVersion, () => ( null))
208
208
  });
@@ -210,8 +210,8 @@ function compatibilityCacheKey(baseUrl, command, skillsVersion) {
210
210
  function legacyCompatibilityCacheKey(baseUrl, command) {
211
211
  return JSON.stringify({
212
212
  baseUrl: baseUrl.replace(/\/$/, ""),
213
- version: _chunkNZCFZXDPjs.SDK_VERSION,
214
- apiContract: _chunkNZCFZXDPjs.SDK_API_CONTRACT,
213
+ version: _chunkRNJ74JDHjs.SDK_VERSION,
214
+ apiContract: _chunkRNJ74JDHjs.SDK_API_CONTRACT,
215
215
  command: _optionalChain([command, 'optionalAccess', _9 => _9.trim, 'call', _10 => _10()]) || null
216
216
  });
217
217
  }
@@ -304,7 +304,7 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
304
304
  );
305
305
  try {
306
306
  const url = new URL("/api/v2/sdk/compat", baseUrl);
307
- url.searchParams.set("version", _chunkNZCFZXDPjs.SDK_VERSION);
307
+ url.searchParams.set("version", _chunkRNJ74JDHjs.SDK_VERSION);
308
308
  if (_optionalChain([options, 'access', _19 => _19.command, 'optionalAccess', _20 => _20.trim, 'call', _21 => _21()])) {
309
309
  url.searchParams.set("command", options.command.trim());
310
310
  }
@@ -317,13 +317,13 @@ async function checkSdkCompatibility(baseUrl, options = {}) {
317
317
  const response = await fetch(url, {
318
318
  method: "GET",
319
319
  headers: {
320
- ..._chunkNZCFZXDPjs.deploymentProtectionHeaders.call(void 0, ),
321
- "User-Agent": `deepline-ts-sdk/${_chunkNZCFZXDPjs.SDK_VERSION}`,
322
- "X-Deepline-SDK-Version": _chunkNZCFZXDPjs.SDK_VERSION,
323
- "X-Deepline-API-Major": String(_chunkNZCFZXDPjs.SDK_API_MAJOR),
324
- "X-Deepline-API-Contract": _chunkNZCFZXDPjs.SDK_API_CONTRACT,
320
+ ..._chunkRNJ74JDHjs.deploymentProtectionHeaders.call(void 0, ),
321
+ "User-Agent": `deepline-ts-sdk/${_chunkRNJ74JDHjs.SDK_VERSION}`,
322
+ "X-Deepline-SDK-Version": _chunkRNJ74JDHjs.SDK_VERSION,
323
+ "X-Deepline-API-Major": String(_chunkRNJ74JDHjs.SDK_API_MAJOR),
324
+ "X-Deepline-API-Contract": _chunkRNJ74JDHjs.SDK_API_CONTRACT,
325
325
  "X-Deepline-CLI-Update-Preferences": "1",
326
- ...options.catalog ? { Authorization: `Bearer ${_chunkNZCFZXDPjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl)}` } : {}
326
+ ...options.catalog ? { Authorization: `Bearer ${_chunkRNJ74JDHjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl)}` } : {}
327
327
  },
328
328
  signal: controller.signal
329
329
  });
@@ -388,6 +388,8 @@ function enforceSdkCompatibilityResponse(response, options = {}) {
388
388
  }
389
389
 
390
390
  // src/cli/windows-arg-escape.ts
391
+
392
+
391
393
  var CMD_META_CHARS = /([()\][%!^"`<>&|;, *?])/g;
392
394
  function escapeCmdArgument(arg, forBatchFile = true) {
393
395
  let escaped = arg.replace(/(\\*)"/g, '$1$1\\"');
@@ -399,16 +401,46 @@ function escapeCmdArgument(arg, forBatchFile = true) {
399
401
  function escapeCmdCommand(command) {
400
402
  return command.replace(CMD_META_CHARS, "^$1");
401
403
  }
402
- function resolveShellSpawn(command, args, platform2 = process.platform) {
404
+ function resolveShellSpawn(command, args, platform2 = process.platform, env = process.env, cwd = process.cwd()) {
403
405
  if (platform2 !== "win32") {
404
406
  return { command, args: [...args], shell: false };
405
407
  }
408
+ const resolved = resolveWindowsExecutable(command, env, cwd);
409
+ const executable = _nullishCoalesce(resolved, () => ( command));
410
+ const batchFile = /\.(cmd|bat)$/i.test(executable) || !resolved && /^(npm|npx|pnpm)$/i.test(command);
411
+ if (!batchFile) {
412
+ if (/^bunx(?:\.exe)?$/i.test(_path.win32.basename(executable))) {
413
+ const bun = resolveWindowsExecutable("bun", env, cwd);
414
+ if (bun && /\.exe$/i.test(bun)) {
415
+ return { command: bun, args: ["x", ...args], shell: false };
416
+ }
417
+ }
418
+ return { command: executable, args: [...args], shell: false };
419
+ }
406
420
  return {
407
- command: escapeCmdCommand(command),
421
+ command: escapeCmdCommand(executable),
408
422
  args: args.map((arg) => escapeCmdArgument(arg)),
409
423
  shell: true
410
424
  };
411
425
  }
426
+ function resolveWindowsExecutable(command, env, cwd) {
427
+ const extensions = _path.win32.extname(command) ? [""] : (_nullishCoalesce(env.PATHEXT, () => ( ".COM;.EXE;.BAT;.CMD"))).split(";").filter(Boolean);
428
+ const directories = /[\\/]/.test(command) ? [""] : [cwd, ...(_nullishCoalesce(env.PATH, () => ( ""))).split(";")];
429
+ for (const directory of directories) {
430
+ for (const extension of extensions) {
431
+ const candidate = directory ? _path.win32.resolve(
432
+ cwd,
433
+ directory.replace(/^"|"$/g, ""),
434
+ command + extension
435
+ ) : _path.win32.resolve(cwd, command + extension);
436
+ try {
437
+ if (_fs.statSync.call(void 0, candidate).isFile()) return candidate;
438
+ } catch (e5) {
439
+ }
440
+ }
441
+ }
442
+ return void 0;
443
+ }
412
444
 
413
445
  // src/cli/failure-reporting.ts
414
446
 
@@ -542,7 +574,7 @@ function buildEnvironmentContext() {
542
574
  node_version: process.version,
543
575
  runtime: "Node.js",
544
576
  hostname: _os.hostname.call(void 0, ),
545
- agent_runtime: _chunkNZCFZXDPjs.detectAgentRuntime.call(void 0, )
577
+ agent_runtime: _chunkRNJ74JDHjs.detectAgentRuntime.call(void 0, )
546
578
  };
547
579
  for (const key of ["CLAUDE_CODE_REMOTE", "DEEPLINE_PLUGIN_MODE"]) {
548
580
  const normalized = _optionalChain([process, 'access', _32 => _32.env, 'access', _33 => _33[key], 'optionalAccess', _34 => _34.trim, 'call', _35 => _35()]);
@@ -566,12 +598,12 @@ function failureReportHeaders(apiKey) {
566
598
  return {
567
599
  Authorization: `Bearer ${apiKey}`,
568
600
  "Content-Type": "application/json",
569
- "User-Agent": `deepline-ts-sdk/${_chunkNZCFZXDPjs.SDK_VERSION}`,
601
+ "User-Agent": `deepline-ts-sdk/${_chunkRNJ74JDHjs.SDK_VERSION}`,
570
602
  "X-Deepline-Client-Family": "sdk",
571
603
  "X-Deepline-CLI-Family": "sdk",
572
- "X-Deepline-Agent-Runtime": _chunkNZCFZXDPjs.detectAgentRuntime.call(void 0, ),
573
- "X-Deepline-CLI-Version": _chunkNZCFZXDPjs.SDK_VERSION,
574
- "X-Deepline-SDK-Version": _chunkNZCFZXDPjs.SDK_VERSION
604
+ "X-Deepline-Agent-Runtime": _chunkRNJ74JDHjs.detectAgentRuntime.call(void 0, ),
605
+ "X-Deepline-CLI-Version": _chunkRNJ74JDHjs.SDK_VERSION,
606
+ "X-Deepline-SDK-Version": _chunkRNJ74JDHjs.SDK_VERSION
575
607
  };
576
608
  }
577
609
  async function postFailureReport(input) {
@@ -586,7 +618,7 @@ async function postFailureReport(input) {
586
618
  signal: controller.signal
587
619
  });
588
620
  return true;
589
- } catch (e5) {
621
+ } catch (e6) {
590
622
  return false;
591
623
  } finally {
592
624
  clearTimeout(timeout);
@@ -599,8 +631,8 @@ async function maybeReportAutomaticSkillsSyncFailure(input) {
599
631
  if (isFailureReportingDisabled()) return false;
600
632
  let apiKey = "";
601
633
  try {
602
- apiKey = _chunkNZCFZXDPjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
603
- } catch (e6) {
634
+ apiKey = _chunkRNJ74JDHjs.resolveApiKeyForBaseUrl.call(void 0, input.baseUrl);
635
+ } catch (e7) {
604
636
  return false;
605
637
  }
606
638
  if (!apiKey) return false;
@@ -626,7 +658,7 @@ async function maybeReportAutomaticSkillsSyncFailure(input) {
626
658
  failure_code: failureCode2,
627
659
  failure_stage: failureStage,
628
660
  error_body: "Automatic Deepline skills installation failed.",
629
- cli_version: _chunkNZCFZXDPjs.SDK_VERSION,
661
+ cli_version: _chunkRNJ74JDHjs.SDK_VERSION,
630
662
  context: {
631
663
  environment: buildEnvironmentContext(),
632
664
  skills_sync: {
@@ -711,7 +743,7 @@ function safeRequestDiagnostics(error) {
711
743
  if (url.protocol === "https:" || url.protocol === "http:") {
712
744
  result.url = redactFailureText(`${url.origin}${url.pathname}`, 1e3);
713
745
  }
714
- } catch (e7) {
746
+ } catch (e8) {
715
747
  }
716
748
  }
717
749
  if (typeof value.failedAtUtc === "string" && Number.isFinite(Date.parse(value.failedAtUtc))) {
@@ -746,7 +778,7 @@ function buildFailureReport(input) {
746
778
  failure_kind: failureKind,
747
779
  failure_code: code,
748
780
  failure_stage: input.error === void 0 ? "command_exit" : "cli_main",
749
- cli_version: _chunkNZCFZXDPjs.SDK_VERSION,
781
+ cli_version: _chunkRNJ74JDHjs.SDK_VERSION,
750
782
  context: {
751
783
  base_url: redactFailureText(input.baseUrl, 400),
752
784
  command_summary: sanitizeCommand(input.argv),
@@ -766,8 +798,8 @@ async function maybeReportSdkCliFailure(input) {
766
798
  if (isServerLoggedPlayRunStartFailure(input)) return false;
767
799
  const exitCode = resolvedExitCode(input);
768
800
  if (!shouldReport({ exitCode, error: input.error })) return false;
769
- const baseUrl = _chunkNZCFZXDPjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
770
- const apiKey = _chunkNZCFZXDPjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
801
+ const baseUrl = _chunkRNJ74JDHjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
802
+ const apiKey = _chunkRNJ74JDHjs.resolveApiKeyForBaseUrl.call(void 0, baseUrl);
771
803
  if (!apiKey) return false;
772
804
  return postFailureReport({
773
805
  baseUrl,
@@ -788,25 +820,25 @@ var CHECK_TIMEOUT_MS2 = 3e3;
788
820
  var INSTALLER_PROBE_TIMEOUT_MS = 1e3;
789
821
  var PUBLISHED_VERIFICATION_RETRY_MS = 5 * 6e4;
790
822
  function shouldSkipSkillsSync() {
791
- if (_chunkNZCFZXDPjs.detectAgentRuntime.call(void 0, ) === "claude_cowork" || isCiEnvironment()) {
823
+ if (_chunkRNJ74JDHjs.detectAgentRuntime.call(void 0, ) === "claude_cowork" || isCiEnvironment()) {
792
824
  return true;
793
825
  }
794
826
  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()]);
795
827
  return value === "1" || value === "true" || value === "yes" || value === "on";
796
828
  }
797
829
  function unavailableSkillsNoticePath(baseUrl) {
798
- return _path.join.call(void 0, _chunkNZCFZXDPjs.sdkCliStateDirPath.call(void 0, baseUrl), "skills-sync-unavailable-version");
830
+ return _path.join.call(void 0, _chunkRNJ74JDHjs.sdkCliStateDirPath.call(void 0, baseUrl), "skills-sync-unavailable-version");
799
831
  }
800
832
  var SKILLS_SYNC_IN_PROGRESS_TTL_MS = 10 * 60 * 1e3;
801
833
  var SKILLS_SYNC_IN_PROGRESS_PID_CAP_MS = 6 * 60 * 60 * 1e3;
802
- var agentLeaseSegment = _chunkNZCFZXDPjs.skillsAgentPathSegment;
834
+ var agentLeaseSegment = _chunkRNJ74JDHjs.skillsAgentPathSegment;
803
835
  function sortedLeaseAgents(agents) {
804
- const expanded = agents.includes("*") ? [...agents, ..._chunkNZCFZXDPjs.KNOWN_SKILL_AGENTS] : agents;
836
+ const expanded = agents.includes("*") ? [...agents, ..._chunkRNJ74JDHjs.KNOWN_SKILL_AGENTS] : agents;
805
837
  return [...new Set(expanded)].sort((a, b) => a.localeCompare(b));
806
838
  }
807
839
  function inProgressSkillsSyncPath(baseUrl, agent) {
808
840
  return _path.join.call(void 0,
809
- _chunkNZCFZXDPjs.sdkCliStateDirPath.call(void 0, baseUrl),
841
+ _chunkRNJ74JDHjs.sdkCliStateDirPath.call(void 0, baseUrl),
810
842
  `skills-sync-in-progress-${agentLeaseSegment(agent)}`
811
843
  );
812
844
  }
@@ -866,7 +898,7 @@ function quarantine(path, tag) {
866
898
  try {
867
899
  _fs.renameSync.call(void 0, path, holding);
868
900
  return holding;
869
- } catch (e8) {
901
+ } catch (e9) {
870
902
  return null;
871
903
  }
872
904
  }
@@ -894,9 +926,13 @@ function claimOneInProgressSkillsSync(baseUrl, remoteVersion, agent, owner) {
894
926
  };
895
927
  try {
896
928
  _fs.mkdirSync.call(void 0, _path.dirname.call(void 0, dir), { recursive: true });
929
+ } catch (error) {
930
+ return { state: "unavailable", error };
931
+ }
932
+ try {
897
933
  return create();
898
934
  } catch (error) {
899
- if (errorCode(error) !== "EEXIST") return { state: "unavailable" };
935
+ if (errorCode(error) !== "EEXIST") return { state: "unavailable", error };
900
936
  }
901
937
  if (isFreshInProgressSkillsSync(readInProgressSkillsSyncLease(baseUrl, agent))) {
902
938
  return { state: "held" };
@@ -909,7 +945,7 @@ function claimOneInProgressSkillsSync(baseUrl, remoteVersion, agent, owner) {
909
945
  try {
910
946
  return create();
911
947
  } catch (error) {
912
- return errorCode(error) === "EEXIST" ? { state: "held" } : { state: "unavailable" };
948
+ return errorCode(error) === "EEXIST" ? { state: "held" } : { state: "unavailable", error };
913
949
  }
914
950
  }
915
951
  function claimInProgressSkillsSync(baseUrl, remoteVersion, agents) {
@@ -924,16 +960,25 @@ function claimInProgressSkillsSync(baseUrl, remoteVersion, agents) {
924
960
  );
925
961
  if (claim.state !== "claimed") {
926
962
  releaseInProgressSkillsSync(baseUrl, claimTokens);
927
- return { state: claim.state };
963
+ return claim;
928
964
  }
929
965
  claimTokens.set(agent, claim.claimToken);
930
966
  }
931
967
  return { state: "claimed", claimTokens, owner };
932
968
  }
933
- function claimAndSpawnDetachedSkillsSync(baseUrl, agents, remoteVersion, spawnDetached) {
969
+ function claimAndSpawnDetachedSkillsSync(baseUrl, agents, remoteVersion, spawnDetached, shouldSpawn) {
934
970
  const claim = claimInProgressSkillsSync(baseUrl, remoteVersion, agents);
935
- if (claim.state !== "claimed") return claim.state;
971
+ if (claim.state !== "claimed") return claim;
936
972
  const { claimTokens, owner } = claim;
973
+ try {
974
+ if (shouldSpawn && !shouldSpawn()) {
975
+ releaseInProgressSkillsSync(baseUrl, claimTokens);
976
+ return { state: "skipped" };
977
+ }
978
+ } catch (error) {
979
+ releaseInProgressSkillsSync(baseUrl, claimTokens);
980
+ throw error;
981
+ }
937
982
  spawnDetached([SKILLS_AUTO_SYNC_COMMAND, "--claim", owner], () => {
938
983
  releaseInProgressSkillsSync(baseUrl, claimTokens);
939
984
  if (remoteVersion !== UNRESOLVED_SKILLS_CLAIM_VERSION) {
@@ -946,7 +991,22 @@ function claimAndSpawnDetachedSkillsSync(baseUrl, agents, remoteVersion, spawnDe
946
991
  "Deepline skills refresh failed to start; run `deepline skills` to retry."
947
992
  );
948
993
  });
949
- return "claimed";
994
+ return { state: "claimed" };
995
+ }
996
+ var SkillsStateUnavailableError = class extends Error {
997
+ constructor(baseUrl, error) {
998
+ const detail = error instanceof Error ? error.message : String(error);
999
+ super(
1000
+ `Could not save skills state in ${_chunkRNJ74JDHjs.sdkCliStateDirPath.call(void 0, baseUrl)}: ${detail}`
1001
+ );
1002
+ this.name = "SkillsStateUnavailableError";
1003
+ }
1004
+ };
1005
+ function writeSkillsStateUnavailableNotice(baseUrl, agents, error) {
1006
+ const retry = agents.length === 1 ? `deepline skills --agent ${agents[0]} --json` : "deepline skills --json";
1007
+ writeSdkSkillsStatusLine(
1008
+ `Automatic skills update skipped. ${new SkillsStateUnavailableError(baseUrl, error).message}. Your command will continue. Resolve this filesystem error, then run: ${retry}`
1009
+ );
950
1010
  }
951
1011
  function recordOwnPidOnInProgressSkillsSync(baseUrl, leases) {
952
1012
  for (const [agent, lease] of leases) {
@@ -958,7 +1018,7 @@ function recordOwnPidOnInProgressSkillsSync(baseUrl, leases) {
958
1018
  `,
959
1019
  "utf-8"
960
1020
  );
961
- } catch (e9) {
1021
+ } catch (e10) {
962
1022
  }
963
1023
  }
964
1024
  }
@@ -968,7 +1028,7 @@ function releaseInProgressSkillsSync(baseUrl, claimTokens) {
968
1028
  if (!claimToken) {
969
1029
  try {
970
1030
  _fs.rmSync.call(void 0, dir, { recursive: true, force: true });
971
- } catch (e10) {
1031
+ } catch (e11) {
972
1032
  }
973
1033
  continue;
974
1034
  }
@@ -979,7 +1039,7 @@ function releaseInProgressSkillsSync(baseUrl, claimTokens) {
979
1039
  _fs.renameSync.call(void 0, tombstone, dir);
980
1040
  continue;
981
1041
  }
982
- } catch (e11) {
1042
+ } catch (e12) {
983
1043
  }
984
1044
  _fs.rmSync.call(void 0, tombstone, { recursive: true, force: true });
985
1045
  }
@@ -998,8 +1058,7 @@ async function acquireSkillsInstallLease(baseUrl, agents, version, options = {
998
1058
  for (; ; ) {
999
1059
  const claim = claimInProgressSkillsSync(baseUrl, version, agents);
1000
1060
  if (claim.state === "unavailable") {
1001
- return { release: () => {
1002
- } };
1061
+ throw new SkillsStateUnavailableError(baseUrl, claim.error);
1003
1062
  }
1004
1063
  if (claim.state === "claimed") {
1005
1064
  recordOwnPidOnInProgressSkillsSync(
@@ -1023,7 +1082,7 @@ function skillsInstallLeasePath(baseUrl, agents) {
1023
1082
  }
1024
1083
  function deferredSkillsNoticePath(baseUrl, agents) {
1025
1084
  return _path.join.call(void 0,
1026
- _chunkNZCFZXDPjs.sdkCliStateDirPath.call(void 0, baseUrl),
1085
+ _chunkRNJ74JDHjs.sdkCliStateDirPath.call(void 0, baseUrl),
1027
1086
  `skills-sync-notice-${sortedLeaseAgents(agents).map(agentLeaseSegment).join("-")}`
1028
1087
  );
1029
1088
  }
@@ -1034,7 +1093,7 @@ function deferSkillsNotice(baseUrl, agents) {
1034
1093
  _fs.mkdirSync.call(void 0, _path.dirname.call(void 0, path), { recursive: true });
1035
1094
  _fs.appendFileSync.call(void 0, path, `${text.trimEnd()}
1036
1095
  `, "utf-8");
1037
- } catch (e12) {
1096
+ } catch (e13) {
1038
1097
  }
1039
1098
  };
1040
1099
  }
@@ -1046,19 +1105,19 @@ function flushDeferredSkillsNotices(baseUrl, agents) {
1046
1105
  let text = "";
1047
1106
  try {
1048
1107
  text = _fs.readFileSync.call(void 0, tombstone, "utf-8");
1049
- } catch (e13) {
1108
+ } catch (e14) {
1050
1109
  return;
1051
1110
  } finally {
1052
1111
  try {
1053
1112
  _fs.unlinkSync.call(void 0, tombstone);
1054
- } catch (e14) {
1113
+ } catch (e15) {
1055
1114
  }
1056
1115
  }
1057
1116
  if (text.trim()) writeSdkSkillsStatusLine(text.trimEnd());
1058
1117
  }
1059
1118
  function flushDeferredSkillsSyncNotices(baseUrl) {
1060
- if (shouldSkipSkillsSync() || _chunkNZCFZXDPjs.hasActivePluginSkills.call(void 0, )) return;
1061
- const agents = _chunkNZCFZXDPjs.resolveAutoSyncSkillAgents.call(void 0, );
1119
+ if (shouldSkipSkillsSync() || _chunkRNJ74JDHjs.hasActivePluginSkills.call(void 0, )) return;
1120
+ const agents = _chunkRNJ74JDHjs.resolveAutoSyncSkillAgents.call(void 0, );
1062
1121
  if (agents.length === 0) return;
1063
1122
  flushDeferredSkillsNotices(baseUrl, agents);
1064
1123
  }
@@ -1074,7 +1133,7 @@ function spawnDetachedSkillsSyncChild(argv, onSpawnError) {
1074
1133
  }
1075
1134
  function failedSkillsSyncPath(baseUrl, agents) {
1076
1135
  return _path.join.call(void 0,
1077
- _chunkNZCFZXDPjs.sdkCliStateDirPath.call(void 0, baseUrl),
1136
+ _chunkRNJ74JDHjs.sdkCliStateDirPath.call(void 0, baseUrl),
1078
1137
  `skills-sync-failed-${sortedLeaseAgents(agents).map(agentLeaseSegment).join("-")}-version`
1079
1138
  );
1080
1139
  }
@@ -1084,7 +1143,7 @@ function hasMarkedSkillsSyncVersion(path, version) {
1084
1143
  function readMarkedSkillsSyncVersion(path) {
1085
1144
  try {
1086
1145
  return _fs.existsSync.call(void 0, path) ? _fs.readFileSync.call(void 0, path, "utf-8").trim() : "";
1087
- } catch (e15) {
1146
+ } catch (e16) {
1088
1147
  return "";
1089
1148
  }
1090
1149
  }
@@ -1094,7 +1153,7 @@ function writeMarkedSkillsSyncVersion(path, version) {
1094
1153
  _fs.writeFileSync.call(void 0, path, `${version}
1095
1154
  `, "utf-8");
1096
1155
  return true;
1097
- } catch (e16) {
1156
+ } catch (e17) {
1098
1157
  return false;
1099
1158
  }
1100
1159
  }
@@ -1103,7 +1162,7 @@ function writeUnavailableSkillsNotice(baseUrl, remoteVersion, skillNames, reason
1103
1162
  if (hasMarkedSkillsSyncVersion(path, remoteVersion)) return;
1104
1163
  writeMarkedSkillsSyncVersion(path, remoteVersion);
1105
1164
  const probes = reason === "no-installer" ? _nullishCoalesce(knownProbes, () => ( probeInstallers())) : null;
1106
- const manualCommand = _optionalChain([probes, 'optionalAccess', _65 => _65.npx]) === "missing" && probes.bunx !== "missing" ? `bunx ${buildBunxSkillsInstallArgs(baseUrl, skillNames, _chunkNZCFZXDPjs.DEFAULT_SKILL_AGENTS).map(shellQuote).join(" ")}` : `npx ${buildSkillsInstallArgs(baseUrl, skillNames).join(" ")}`;
1165
+ const manualCommand = _optionalChain([probes, 'optionalAccess', _65 => _65.npx]) === "missing" && probes.bunx !== "missing" ? `bunx ${buildBunxSkillsInstallArgs(baseUrl, skillNames, _chunkRNJ74JDHjs.DEFAULT_SKILL_AGENTS).map(shellQuote).join(" ")}` : `npx ${buildSkillsInstallArgs(baseUrl, skillNames).join(" ")}`;
1107
1166
  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.`;
1108
1167
  notice(
1109
1168
  `Deepline agent skills are out of date, but ${explanation} To install manually, run:
@@ -1113,7 +1172,7 @@ ${manualCommand}`
1113
1172
  function clearUnavailableSkillsNotice(baseUrl) {
1114
1173
  try {
1115
1174
  _fs.unlinkSync.call(void 0, unavailableSkillsNoticePath(baseUrl));
1116
- } catch (e17) {
1175
+ } catch (e18) {
1117
1176
  }
1118
1177
  }
1119
1178
  function hasFailedSkillsSync(baseUrl, remoteVersion, agents) {
@@ -1125,7 +1184,7 @@ function hasFailedSkillsSync(baseUrl, remoteVersion, agents) {
1125
1184
  const retry = JSON.parse(marked);
1126
1185
  const now = Date.now();
1127
1186
  return retry.version === remoteVersion && typeof retry.retryAfter === "number" && retry.retryAfter > now && retry.retryAfter <= now + PUBLISHED_VERIFICATION_RETRY_MS;
1128
- } catch (e18) {
1187
+ } catch (e19) {
1129
1188
  return false;
1130
1189
  }
1131
1190
  }
@@ -1150,11 +1209,12 @@ function deferPublishedVerificationRetry(baseUrl, remoteVersion, agents) {
1150
1209
  function clearFailedSkillsSync(baseUrl, agents) {
1151
1210
  try {
1152
1211
  _fs.unlinkSync.call(void 0, failedSkillsSyncPath(baseUrl, agents));
1153
- } catch (e19) {
1212
+ } catch (e20) {
1154
1213
  }
1155
1214
  }
1156
1215
  function clearFailedAutomaticSkillsSync(baseUrl, agents) {
1157
1216
  clearFailedSkillsSync(baseUrl, agents);
1217
+ clearUnavailableInstallerProbes(baseUrl);
1158
1218
  }
1159
1219
  function sortedUniqueSkillNames(names) {
1160
1220
  return [...new Set(names.map((name) => name.trim()).filter(Boolean))].sort(
@@ -1172,7 +1232,7 @@ async function fetchV1SkillIndex(baseUrl) {
1172
1232
  if (!response.ok) return null;
1173
1233
  const data = await response.json().catch(() => null);
1174
1234
  return data;
1175
- } catch (e20) {
1235
+ } catch (e21) {
1176
1236
  return null;
1177
1237
  } finally {
1178
1238
  clearTimeout(timeout);
@@ -1190,7 +1250,7 @@ function buildSdkSkillNames(v1SkillNames2) {
1190
1250
  return sortedUniqueSkillNames(v1SkillNames2);
1191
1251
  }
1192
1252
  function isDefaultAgentSet(agents) {
1193
- return agents.length === _chunkNZCFZXDPjs.DEFAULT_SKILL_AGENTS.length && agents.every((agent, index) => agent === _chunkNZCFZXDPjs.DEFAULT_SKILL_AGENTS[index]);
1253
+ return agents.length === _chunkRNJ74JDHjs.DEFAULT_SKILL_AGENTS.length && agents.every((agent, index) => agent === _chunkRNJ74JDHjs.DEFAULT_SKILL_AGENTS[index]);
1194
1254
  }
1195
1255
  function safeSkillFilePath(value) {
1196
1256
  if (typeof value !== "string" || !value) return false;
@@ -1361,7 +1421,7 @@ async function fetchSkillsUpdate(baseUrl, localVersion) {
1361
1421
  needsUpdate: skills.needs_update === true,
1362
1422
  remoteVersion: typeof _optionalChain([skills, 'access', _75 => _75.remote, 'optionalAccess', _76 => _76.version]) === "string" ? skills.remote.version.trim() : ""
1363
1423
  };
1364
- } catch (e21) {
1424
+ } catch (e22) {
1365
1425
  return null;
1366
1426
  } finally {
1367
1427
  clearTimeout(timeout);
@@ -1378,7 +1438,7 @@ function buildBunxSkillsInstallArgs(baseUrl, skillNames, agents) {
1378
1438
  agents
1379
1439
  });
1380
1440
  }
1381
- var NEGATIVE_INSTALLER_PROBE_TTL_MS = 5 * 60 * 1e3;
1441
+ var NEGATIVE_INSTALLER_PROBE_TTL_MS = 30 * 60 * 1e3;
1382
1442
  function probeInstallers(timeoutMs) {
1383
1443
  return {
1384
1444
  bunx: probeCommand("bunx", timeoutMs),
@@ -1387,21 +1447,26 @@ function probeInstallers(timeoutMs) {
1387
1447
  }
1388
1448
  function noInstallerProbePath(baseUrl) {
1389
1449
  return _path.join.call(void 0,
1390
- _chunkNZCFZXDPjs.sdkCliStateDirPath.call(void 0, baseUrl),
1450
+ _chunkRNJ74JDHjs.sdkCliStateDirPath.call(void 0, baseUrl),
1391
1451
  "skills-sync-no-installer-unknown.json"
1392
1452
  );
1393
1453
  }
1394
- function dueUnknownInstallerProbes(baseUrl, remoteVersion) {
1454
+ function cachedUnavailableInstallerProbes(baseUrl, remoteVersion, allowBoundedFailures = false) {
1395
1455
  const path = noInstallerProbePath(baseUrl);
1396
1456
  try {
1397
1457
  const cached = JSON.parse(_fs.readFileSync.call(void 0, path, "utf-8"));
1398
- if (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")) {
1458
+ 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
1459
+ // will fail. Older caches without probe provenance are ambiguous too.
1460
+ (allowBoundedFailures || cached.probeTimeoutMs === null || cached.probes.bunx === "missing" && cached.probes.npx === "missing")) {
1399
1461
  return cached.probes;
1400
1462
  }
1401
- } catch (e22) {
1463
+ } catch (e23) {
1402
1464
  }
1403
- const probes = probeInstallers(INSTALLER_PROBE_TIMEOUT_MS);
1465
+ return null;
1466
+ }
1467
+ function rememberUnavailableInstallerProbes(baseUrl, remoteVersion, probes, probeTimeoutMs = null) {
1404
1468
  if (probes.bunx !== "available" && probes.npx !== "available") {
1469
+ const path = noInstallerProbePath(baseUrl);
1405
1470
  try {
1406
1471
  _fs.mkdirSync.call(void 0, _path.dirname.call(void 0, path), { recursive: true });
1407
1472
  _fs.writeFileSync.call(void 0,
@@ -1409,13 +1474,31 @@ function dueUnknownInstallerProbes(baseUrl, remoteVersion) {
1409
1474
  JSON.stringify({
1410
1475
  version: remoteVersion,
1411
1476
  checkedAt: Date.now(),
1477
+ probeTimeoutMs,
1412
1478
  probes
1413
1479
  }),
1414
1480
  "utf-8"
1415
1481
  );
1416
- } catch (e23) {
1482
+ } catch (e24) {
1417
1483
  }
1418
1484
  }
1485
+ }
1486
+ function clearUnavailableInstallerProbes(baseUrl) {
1487
+ try {
1488
+ _fs.unlinkSync.call(void 0, noInstallerProbePath(baseUrl));
1489
+ } catch (e25) {
1490
+ }
1491
+ }
1492
+ function dueUnknownInstallerProbes(baseUrl, remoteVersion) {
1493
+ const cached = cachedUnavailableInstallerProbes(baseUrl, remoteVersion, true);
1494
+ if (cached) return cached;
1495
+ const probes = probeInstallers(INSTALLER_PROBE_TIMEOUT_MS);
1496
+ rememberUnavailableInstallerProbes(
1497
+ baseUrl,
1498
+ remoteVersion,
1499
+ probes,
1500
+ INSTALLER_PROBE_TIMEOUT_MS
1501
+ );
1419
1502
  return probes;
1420
1503
  }
1421
1504
  function probeCommand(command, timeoutMs) {
@@ -1443,9 +1526,10 @@ function temporarySkillsSyncSkipCommand() {
1443
1526
  function resolveSkillsInstallSpawn(install, platform2 = process.platform) {
1444
1527
  return resolveShellSpawn(install.command, install.args, platform2);
1445
1528
  }
1446
- function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents = _chunkNZCFZXDPjs.DEFAULT_SKILL_AGENTS) {
1529
+ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents = _chunkRNJ74JDHjs.DEFAULT_SKILL_AGENTS, knownProbes) {
1447
1530
  const commands = [];
1448
- if (hasCommand("bunx")) {
1531
+ const probes = _nullishCoalesce(knownProbes, () => ( probeInstallers()));
1532
+ if (probes.bunx === "available") {
1449
1533
  const bunxArgs = buildBunxSkillsInstallArgs(baseUrl, skillNames, agents);
1450
1534
  commands.push({
1451
1535
  command: "bunx",
@@ -1453,7 +1537,7 @@ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NA
1453
1537
  manualCommand: `bunx ${bunxArgs.map(shellQuote).join(" ")}`
1454
1538
  });
1455
1539
  }
1456
- if (hasCommand("npx")) {
1540
+ if (probes.npx === "available") {
1457
1541
  const npxArgs = buildSkillsInstallArgs(baseUrl, skillNames, agents);
1458
1542
  commands.push({
1459
1543
  command: "npx",
@@ -1594,11 +1678,11 @@ function writeSdkSkillsStatusLine(line) {
1594
1678
  }
1595
1679
  async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
1596
1680
  if (shouldSkipSkillsSync()) return;
1597
- const usingPluginSkills = _chunkNZCFZXDPjs.hasActivePluginSkills.call(void 0, );
1681
+ const usingPluginSkills = _chunkRNJ74JDHjs.hasActivePluginSkills.call(void 0, );
1598
1682
  if (usingPluginSkills) {
1599
1683
  return;
1600
1684
  }
1601
- const agents = _chunkNZCFZXDPjs.resolveAutoSyncSkillAgents.call(void 0, );
1685
+ const agents = _chunkRNJ74JDHjs.resolveAutoSyncSkillAgents.call(void 0, );
1602
1686
  if (options.mode === "detached" && agents.length > 0) {
1603
1687
  flushDeferredSkillsNotices(baseUrl, agents);
1604
1688
  }
@@ -1613,16 +1697,20 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
1613
1697
  if (leases) recordOwnPidOnInProgressSkillsSync(baseUrl, leases);
1614
1698
  const claimedVersion = leases ? claimedSkillsVersion(leases) : "";
1615
1699
  if (options.mode === "detached" && agents.length > 0 && options.update === void 0 && !claimedVersion) {
1616
- claimAndSpawnDetachedSkillsSync(
1700
+ if (cachedUnavailableInstallerProbes(baseUrl)) return;
1701
+ const outcome = claimAndSpawnDetachedSkillsSync(
1617
1702
  baseUrl,
1618
1703
  agents,
1619
1704
  UNRESOLVED_SKILLS_CLAIM_VERSION,
1620
1705
  _nullishCoalesce(options.spawnDetached, () => ( spawnDetachedSkillsSyncChild))
1621
1706
  );
1707
+ if (outcome.state === "unavailable") {
1708
+ writeSkillsStateUnavailableNotice(baseUrl, agents, outcome.error);
1709
+ }
1622
1710
  return;
1623
1711
  }
1624
1712
  try {
1625
- const localVersion = _chunkNZCFZXDPjs.readSdkSkillsLocalVersion.call(void 0, baseUrl);
1713
+ const localVersion = _chunkRNJ74JDHjs.readSdkSkillsLocalVersion.call(void 0, baseUrl);
1626
1714
  const update = options.update === void 0 ? claimedVersion ? { needsUpdate: true, remoteVersion: claimedVersion } : await fetchSkillsUpdate(baseUrl, localVersion) : options.update ? {
1627
1715
  needsUpdate: options.update.needs_update,
1628
1716
  remoteVersion: options.update.remote.version
@@ -1643,16 +1731,24 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
1643
1731
  return;
1644
1732
  }
1645
1733
  if (options.mode === "detached" && agents.length > 0) {
1646
- if (isDefaultAgentSet(agents)) {
1647
- if (agents.some(
1648
- (agent) => isFreshInProgressSkillsSync(
1649
- readInProgressSkillsSyncLease(baseUrl, agent)
1650
- )
1651
- )) {
1652
- return;
1653
- }
1654
- const probes = dueUnknownInstallerProbes(baseUrl, update.remoteVersion);
1655
- if (probes.bunx !== "available" && probes.npx !== "available") {
1734
+ if (cachedUnavailableInstallerProbes(
1735
+ baseUrl,
1736
+ update.remoteVersion,
1737
+ isDefaultAgentSet(agents)
1738
+ ))
1739
+ return;
1740
+ const outcome = claimAndSpawnDetachedSkillsSync(
1741
+ baseUrl,
1742
+ agents,
1743
+ update.remoteVersion,
1744
+ _nullishCoalesce(options.spawnDetached, () => ( spawnDetachedSkillsSyncChild)),
1745
+ isDefaultAgentSet(agents) ? () => {
1746
+ const probes = dueUnknownInstallerProbes(
1747
+ baseUrl,
1748
+ update.remoteVersion
1749
+ );
1750
+ if (probes.bunx === "available" || probes.npx === "available")
1751
+ return true;
1656
1752
  writeUnavailableSkillsNotice(
1657
1753
  baseUrl,
1658
1754
  update.remoteVersion,
@@ -1661,22 +1757,17 @@ async function syncSdkSkillsIfNeeded(baseUrl, options = {}) {
1661
1757
  writeSdkSkillsStatusLine,
1662
1758
  probes
1663
1759
  );
1664
- return;
1665
- }
1666
- }
1667
- const outcome = claimAndSpawnDetachedSkillsSync(
1668
- baseUrl,
1669
- agents,
1670
- update.remoteVersion,
1671
- _nullishCoalesce(options.spawnDetached, () => ( spawnDetachedSkillsSyncChild))
1760
+ return false;
1761
+ } : void 0
1672
1762
  );
1673
- if (outcome === "held") return;
1674
- if (outcome === "claimed") {
1763
+ if (outcome.state === "held" || outcome.state === "skipped") return;
1764
+ if (outcome.state === "claimed") {
1675
1765
  writeSdkSkillsStatusLine(
1676
1766
  "Deepline skills are out of date; updating in the background."
1677
1767
  );
1678
1768
  return;
1679
1769
  }
1770
+ writeSkillsStateUnavailableNotice(baseUrl, agents, outcome.error);
1680
1771
  return;
1681
1772
  }
1682
1773
  await runInlineSkillsSync(
@@ -1710,14 +1801,22 @@ async function runInlineSkillsSync(baseUrl, remoteVersion, agents, notices) {
1710
1801
  );
1711
1802
  return;
1712
1803
  }
1713
- const installs = resolveSkillsInstallCommands(baseUrl, skillNames, agents);
1804
+ const probes = probeInstallers();
1805
+ const installs = resolveSkillsInstallCommands(
1806
+ baseUrl,
1807
+ skillNames,
1808
+ agents,
1809
+ probes
1810
+ );
1714
1811
  if (installs.length === 0) {
1812
+ rememberUnavailableInstallerProbes(baseUrl, remoteVersion, probes);
1715
1813
  writeUnavailableSkillsNotice(
1716
1814
  baseUrl,
1717
1815
  update.remoteVersion,
1718
1816
  skillNames,
1719
1817
  "no-installer",
1720
- notice
1818
+ notice,
1819
+ probes
1721
1820
  );
1722
1821
  return;
1723
1822
  }
@@ -1777,7 +1876,7 @@ async function runInlineSkillsSync(baseUrl, remoteVersion, agents, notices) {
1777
1876
  }
1778
1877
  }
1779
1878
  runLegacySkillsCleanup(agents);
1780
- if (!_chunkNZCFZXDPjs.writeSdkSkillsLocalVersion.call(void 0, baseUrl, update.remoteVersion, agents)) {
1879
+ if (!_chunkRNJ74JDHjs.writeSdkSkillsLocalVersion.call(void 0, baseUrl, update.remoteVersion, agents)) {
1781
1880
  notice(
1782
1881
  "Deepline agent skills installed, but the local skills version could not be recorded. A later command will retry the refresh."
1783
1882
  );
@@ -1785,6 +1884,7 @@ async function runInlineSkillsSync(baseUrl, remoteVersion, agents, notices) {
1785
1884
  }
1786
1885
  clearUnavailableSkillsNotice(baseUrl);
1787
1886
  clearFailedSkillsSync(baseUrl, agents);
1887
+ clearUnavailableInstallerProbes(baseUrl);
1788
1888
  notice("Deepline agent skills are up to date.");
1789
1889
  }
1790
1890
 
@@ -1835,7 +1935,7 @@ function inferActiveSkillsScope(entrypoint = _nullishCoalesce(process.argv[1], (
1835
1935
  return /[\\/]\.deepline[\\/]runtime[\\/]/.test(entrypoint) ? "local" : "global";
1836
1936
  }
1837
1937
  function resolveLocalRoot() {
1838
- const target = _chunkNZCFZXDPjs.resolveProjectPinTarget.call(void 0, );
1938
+ const target = _chunkRNJ74JDHjs.resolveProjectPinTarget.call(void 0, );
1839
1939
  if (!target.ok) {
1840
1940
  throw new Error(
1841
1941
  `Cowork project folder is ambiguous. Candidate folders: ${target.candidates.join(
@@ -1846,7 +1946,7 @@ function resolveLocalRoot() {
1846
1946
  return target.dir;
1847
1947
  }
1848
1948
  function detectSkillsAgents(input) {
1849
- const runtime = _nullishCoalesce(input.runtime, () => ( _chunkNZCFZXDPjs.detectAgentRuntime.call(void 0, )));
1949
+ const runtime = _nullishCoalesce(input.runtime, () => ( _chunkRNJ74JDHjs.detectAgentRuntime.call(void 0, )));
1850
1950
  const knownAgent = RUNTIME_TO_SKILLS_AGENT[runtime];
1851
1951
  if (knownAgent) return [knownAgent];
1852
1952
  const roots = [
@@ -1861,7 +1961,7 @@ function detectSkillsAgents(input) {
1861
1961
  return detected.length > 0 ? detected : ["*"];
1862
1962
  }
1863
1963
  function skillsStatePathForScope(baseUrl, scope, root) {
1864
- return scope === "local" && root ? _path.join.call(void 0, root, ".deepline", "setup", "skills.json") : _path.join.call(void 0, _chunkNZCFZXDPjs.sdkCliStateDirPath.call(void 0, baseUrl), "skills-install.json");
1964
+ return scope === "local" && root ? _path.join.call(void 0, root, ".deepline", "setup", "skills.json") : _path.join.call(void 0, _chunkRNJ74JDHjs.sdkCliStateDirPath.call(void 0, baseUrl), "skills-install.json");
1865
1965
  }
1866
1966
  function buildSkillsPlan(input) {
1867
1967
  const scopeArgs = input.scope === "global" ? ["--global"] : [];
@@ -1930,13 +2030,19 @@ function readSkillsInstallState(path) {
1930
2030
  try {
1931
2031
  const parsed = JSON.parse(_fs.readFileSync.call(void 0, path, "utf8"));
1932
2032
  return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
1933
- } catch (e24) {
2033
+ } catch (e26) {
1934
2034
  return null;
1935
2035
  }
1936
2036
  }
1937
2037
  function runProcess(command, args, cwd) {
1938
2038
  return new Promise((resolve, reject) => {
1939
- const plan = resolveShellSpawn(command, args);
2039
+ const plan = resolveShellSpawn(
2040
+ command,
2041
+ args,
2042
+ process.platform,
2043
+ process.env,
2044
+ cwd
2045
+ );
1940
2046
  const child = _child_process.spawn.call(void 0, plan.command, plan.args, {
1941
2047
  cwd,
1942
2048
  env: process.env,
@@ -1977,7 +2083,7 @@ async function runSkillsCommand(options, dependencies = {}) {
1977
2083
  scope = normalizeScope(options.scope);
1978
2084
  root = scope === "local" ? resolveLocalRoot() : null;
1979
2085
  } catch (error) {
1980
- _chunkV5PB43SQjs.printCommandEnvelope.call(void 0,
2086
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0,
1981
2087
  {
1982
2088
  ok: false,
1983
2089
  status: "failed",
@@ -1989,22 +2095,22 @@ async function runSkillsCommand(options, dependencies = {}) {
1989
2095
  );
1990
2096
  return 2;
1991
2097
  }
1992
- const baseUrl = _chunkNZCFZXDPjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
2098
+ const baseUrl = _chunkRNJ74JDHjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, "");
1993
2099
  const catalog = {
1994
2100
  skillNames: [...DEFAULT_SDK_SKILL_NAMES],
1995
- version: _chunkNZCFZXDPjs.SDK_VERSION
2101
+ version: _chunkRNJ74JDHjs.SDK_VERSION
1996
2102
  };
1997
2103
  const agents = options.agent ? [options.agent] : detectSkillsAgents({ scope, root });
1998
2104
  const plan = buildSkillsPlan({ baseUrl, scope, root, agents, ...catalog });
1999
2105
  if (options.dryRun) {
2000
- _chunkV5PB43SQjs.printCommandEnvelope.call(void 0,
2106
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0,
2001
2107
  { ok: true, status: "planned", dryRun: true, ...plan },
2002
2108
  { json: options.json }
2003
2109
  );
2004
2110
  return 0;
2005
2111
  }
2006
2112
  if (isSkillsPlanCurrent(plan, readSkillsInstallState(plan.statePath)) && !hasFailedAutomaticSkillsSync(baseUrl, agents)) {
2007
- _chunkV5PB43SQjs.printCommandEnvelope.call(void 0,
2113
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0,
2008
2114
  {
2009
2115
  ok: true,
2010
2116
  status: "current",
@@ -2039,22 +2145,41 @@ async function runSkillsCommand(options, dependencies = {}) {
2039
2145
  .../* @__PURE__ */ new Set([...plan.skillNames, ...LEGACY_SKILL_NAMES_TO_REMOVE])
2040
2146
  ];
2041
2147
  const agentRoots = workspaceSkillRootsForAgents(plan.agents);
2042
- _chunkNZCFZXDPjs.ensureProjectPrivatePathsIgnored.call(void 0, root, [
2148
+ _chunkRNJ74JDHjs.ensureProjectPrivatePathsIgnored.call(void 0, root, [
2043
2149
  ".deepline/",
2044
2150
  ...agentRoots.flatMap(
2045
2151
  (agentRoot) => managedNames.map((name) => `${agentRoot}/skills/${name}/`)
2046
2152
  )
2047
2153
  ]);
2048
2154
  }
2049
- const lease = scope === "global" ? await acquireSkillsInstallLease(baseUrl, agents, plan.version, {
2050
- waitMs: _nullishCoalesce(dependencies.installLeaseWaitMs, () => ( SKILLS_INSTALL_LEASE_WAIT_MS)),
2051
- onWait: () => process.stderr.write(
2052
- "Waiting for a background Deepline skills refresh to finish...\n"
2053
- )
2054
- }) : { release: () => {
2055
- } };
2155
+ let lease;
2156
+ try {
2157
+ lease = scope === "global" ? await acquireSkillsInstallLease(baseUrl, agents, plan.version, {
2158
+ waitMs: _nullishCoalesce(dependencies.installLeaseWaitMs, () => ( SKILLS_INSTALL_LEASE_WAIT_MS)),
2159
+ onWait: () => process.stderr.write(
2160
+ "Waiting for a background Deepline skills refresh to finish...\n"
2161
+ )
2162
+ }) : { release: () => {
2163
+ } };
2164
+ } catch (error) {
2165
+ if (!(error instanceof SkillsStateUnavailableError)) throw error;
2166
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0,
2167
+ {
2168
+ ok: false,
2169
+ status: "failed",
2170
+ code: "SKILLS_STATE_UNAVAILABLE",
2171
+ exitCode: 5,
2172
+ scope,
2173
+ agents,
2174
+ message: error.message,
2175
+ next: `Resolve this filesystem error, then run: deepline skills --scope ${scope} --json`
2176
+ },
2177
+ { json: options.json }
2178
+ );
2179
+ return 5;
2180
+ }
2056
2181
  if (!lease) {
2057
- _chunkV5PB43SQjs.printCommandEnvelope.call(void 0,
2182
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0,
2058
2183
  {
2059
2184
  ok: false,
2060
2185
  status: "failed",
@@ -2100,7 +2225,7 @@ async function runSkillsInstallWithLease(input) {
2100
2225
  throw new Error("Could not install the current Deepline skills.");
2101
2226
  }
2102
2227
  } catch (error) {
2103
- _chunkV5PB43SQjs.printCommandEnvelope.call(void 0,
2228
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0,
2104
2229
  {
2105
2230
  ok: false,
2106
2231
  status: "failed",
@@ -2139,7 +2264,7 @@ async function runSkillsInstallWithLease(input) {
2139
2264
  {
2140
2265
  schemaVersion: 1,
2141
2266
  installedAt: (/* @__PURE__ */ new Date()).toISOString(),
2142
- cliVersion: _chunkNZCFZXDPjs.SDK_VERSION,
2267
+ cliVersion: _chunkRNJ74JDHjs.SDK_VERSION,
2143
2268
  scope,
2144
2269
  agents,
2145
2270
  skillsVersion: plan.version,
@@ -2154,7 +2279,7 @@ async function runSkillsInstallWithLease(input) {
2154
2279
  if (scope === "global") {
2155
2280
  clearFailedAutomaticSkillsSync(baseUrl, agents);
2156
2281
  }
2157
- _chunkV5PB43SQjs.printCommandEnvelope.call(void 0,
2282
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0,
2158
2283
  {
2159
2284
  ok: true,
2160
2285
  status: "complete",
@@ -2203,7 +2328,7 @@ Examples:
2203
2328
  ).action(async (options) => {
2204
2329
  const claim = _optionalChain([options, 'access', _88 => _88.claim, 'optionalAccess', _89 => _89.trim, 'call', _90 => _90()]);
2205
2330
  if (!claim) {
2206
- _chunkV5PB43SQjs.printCommandEnvelope.call(void 0,
2331
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0,
2207
2332
  {
2208
2333
  ok: false,
2209
2334
  status: "failed",
@@ -2216,7 +2341,7 @@ Examples:
2216
2341
  process.exitCode = 2;
2217
2342
  return;
2218
2343
  }
2219
- await syncSdkSkillsIfNeeded(_chunkNZCFZXDPjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, ""), {
2344
+ await syncSdkSkillsIfNeeded(_chunkRNJ74JDHjs.autoDetectBaseUrl.call(void 0, ).replace(/\/$/, ""), {
2220
2345
  mode: "inline",
2221
2346
  notices: "defer",
2222
2347
  claim