deepline 0.3.308 → 0.3.310

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 (87) hide show
  1. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  2. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +67 -14
  3. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +4 -1
  4. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +97 -22
  5. package/dist/cli/auth-CP4YBO33.js +31 -0
  6. package/dist/cli/{auth-ZWX4BF5K.mjs → auth-CS6NQ737.mjs} +4 -4
  7. package/dist/cli/{billing-H24FGAKE.js → billing-7SIQJUEI.js} +70 -70
  8. package/dist/cli/{billing-CLV5QRFQ.mjs → billing-SDRP5BYV.mjs} +4 -4
  9. package/dist/cli/{chunk-WEZVPZPE.js → chunk-4YCPND5A.js} +2 -2
  10. package/dist/cli/{chunk-O7NNH76S.js → chunk-5VVRQY4Y.js} +6 -6
  11. package/dist/cli/{chunk-XFYVL7EM.mjs → chunk-7L27LIZO.mjs} +2 -2
  12. package/dist/cli/{chunk-ASWZTTKT.mjs → chunk-AV4CJWNP.mjs} +175 -50
  13. package/dist/cli/{chunk-IFIGQWHC.js → chunk-D3HSRXCJ.js} +6 -6
  14. package/dist/cli/{chunk-UGTYNMRX.js → chunk-DCUYMHHV.js} +48 -48
  15. package/dist/cli/{chunk-3GIUCJAT.mjs → chunk-HYACJPRJ.mjs} +1 -1
  16. package/dist/cli/{chunk-SRZ6XDX3.js → chunk-JVCD2CWD.js} +26 -26
  17. package/dist/cli/{chunk-GONK2N7U.js → chunk-KKAAKV77.js} +1 -1
  18. package/dist/cli/{chunk-CXU7ME5X.mjs → chunk-LUJGLZCJ.mjs} +2 -2
  19. package/dist/cli/{chunk-T3P4NRZU.mjs → chunk-M4KGWEN2.mjs} +1 -1
  20. package/dist/cli/{chunk-GBFIAI4L.js → chunk-MWY35HT3.js} +250 -125
  21. package/dist/cli/{chunk-ZHHF24O5.js → chunk-N2VXH4GK.js} +15 -15
  22. package/dist/cli/{chunk-HGI6RGHB.mjs → chunk-NKRSVEP4.mjs} +1 -1
  23. package/dist/cli/{chunk-XSDL3NHZ.mjs → chunk-NXFFT73P.mjs} +3 -3
  24. package/dist/cli/{chunk-ABMGEW3C.mjs → chunk-OJWZADOG.mjs} +1 -1
  25. package/dist/cli/{chunk-TH3YBIJT.js → chunk-PNNFR4L5.js} +6 -6
  26. package/dist/cli/{chunk-QTCFSRGC.js → chunk-QARMMLYE.js} +4 -4
  27. package/dist/cli/{chunk-YEJMVAD3.js → chunk-RYO6353O.js} +6 -6
  28. package/dist/cli/{chunk-JUAVGRD7.mjs → chunk-T25I3M2J.mjs} +6 -6
  29. package/dist/cli/{chunk-YSZSERRZ.mjs → chunk-VN7Y4LVH.mjs} +1 -1
  30. package/dist/cli/{chunk-BPD7TR27.mjs → chunk-XOIOZ5JA.mjs} +2 -2
  31. package/dist/cli/{client-A5ILG5GT.mjs → client-G7HWPY6S.mjs} +3 -3
  32. package/dist/cli/client-MIVDO6SP.js +20 -0
  33. package/dist/cli/{csv-NZ7KAYEF.mjs → csv-4JIXNZ6J.mjs} +3 -3
  34. package/dist/cli/{csv-VSSAAXFX.js → csv-6GDEDRY6.js} +12 -12
  35. package/dist/cli/{db-ICLEBSNO.js → db-MXNCRZNY.js} +20 -20
  36. package/dist/cli/{db-YSAJUBLD.mjs → db-TGAQ7XWX.mjs} +4 -4
  37. package/dist/cli/{executions-XCAJB5TF.js → executions-VEBKTUFZ.js} +6 -6
  38. package/dist/cli/{executions-MUJRAT5R.mjs → executions-XSGG4VCW.mjs} +4 -4
  39. package/dist/cli/{feedback-DBZMBHZG.js → feedback-GI3Q4RGW.js} +6 -6
  40. package/dist/cli/{feedback-6C7Y2SCJ.mjs → feedback-PY4ZCKEV.mjs} +3 -3
  41. package/dist/cli/git-5KB2XFJ6.js +23 -0
  42. package/dist/cli/{git-EAH67ITA.mjs → git-7QAK7CKT.mjs} +4 -4
  43. package/dist/cli/index.js +73 -73
  44. package/dist/cli/index.mjs +30 -30
  45. package/dist/cli/{legacy-noops-EJTOLTVO.js → legacy-noops-2VT7K2VQ.js} +7 -7
  46. package/dist/cli/{legacy-noops-O5INQP6Q.mjs → legacy-noops-KCG3YZCN.mjs} +4 -4
  47. package/dist/cli/{monitors-5OYO2DPJ.js → monitors-7CLNZE7C.js} +85 -85
  48. package/dist/cli/{monitors-SBBBMUFY.mjs → monitors-GTIHVO56.mjs} +4 -4
  49. package/dist/cli/{org-Z7LTOL3H.mjs → org-FCPAM7NW.mjs} +4 -4
  50. package/dist/cli/{org-SJRPJG42.js → org-HTA6MXVO.js} +60 -60
  51. package/dist/cli/{play-VQJ6ABZ2.js → play-Q5SVL5MG.js} +220 -220
  52. package/dist/cli/{play-2JTIEOZM.mjs → play-YO22ZNSN.mjs} +6 -6
  53. package/dist/cli/{providers-MX4CV2EH.mjs → providers-25X5A5JC.mjs} +4 -4
  54. package/dist/cli/{providers-43MR5XOV.js → providers-YHWPMW4J.js} +7 -7
  55. package/dist/cli/{quickstart-A6W3HEE2.js → quickstart-SLE7UMAK.js} +5 -5
  56. package/dist/cli/{quickstart-Y4YLKRZ3.mjs → quickstart-Z4CXNAQ3.mjs} +3 -3
  57. package/dist/cli/{search-FRKDLJQG.mjs → search-RQO3ZVKK.mjs} +5 -5
  58. package/dist/cli/{search-AMUFSAFP.js → search-UBWCREKT.js} +6 -6
  59. package/dist/cli/{secrets-E4EX7O3J.mjs → secrets-MV6MRXW5.mjs} +4 -4
  60. package/dist/cli/{secrets-XITHKZW2.js → secrets-N37STTK4.js} +13 -13
  61. package/dist/cli/{sessions-6YXAUJII.mjs → sessions-4M2BUN2J.mjs} +4 -4
  62. package/dist/cli/{sessions-6HJFDIR2.js → sessions-KBWZYHNE.js} +5 -5
  63. package/dist/cli/{settings-LBJSZIET.mjs → settings-EYMOSUED.mjs} +7 -7
  64. package/dist/cli/{settings-J5NRLCV2.js → settings-OCRYSYWC.js} +74 -74
  65. package/dist/cli/{setup-2ES4CTO5.js → setup-3UKEGBFB.js} +41 -41
  66. package/dist/cli/{setup-75FENNVH.mjs → setup-TUVPIGJV.mjs} +6 -6
  67. package/dist/cli/{skills-XGZDUXW6.mjs → skills-56ADS5BA.mjs} +4 -4
  68. package/dist/cli/skills-CUWFLZG4.js +28 -0
  69. package/dist/cli/{tools-2LEKXOGY.mjs → tools-M73P2E7K.mjs} +5 -5
  70. package/dist/cli/{tools-ZOQOGDKI.js → tools-XSF6FCIM.js} +50 -50
  71. package/dist/cli/update-QOQRJM2S.js +28 -0
  72. package/dist/cli/{update-SNK3IN3I.mjs → update-Y6KMCBWD.mjs} +6 -6
  73. package/dist/cli/{workflow-W3AYTB3J.js → workflow-DHQ3NCVT.js} +15 -15
  74. package/dist/cli/{workflow-G7ZM3MAC.mjs → workflow-DWKZA4FR.mjs} +5 -5
  75. package/dist/index.js +6 -6
  76. package/dist/index.mjs +3 -3
  77. package/dist/install-integrity.json +68 -68
  78. package/dist/release.d.mts +1 -1
  79. package/dist/release.d.ts +1 -1
  80. package/dist/release.js +2 -2
  81. package/dist/release.mjs +1 -1
  82. package/package.json +1 -1
  83. package/dist/cli/auth-LWNR7TQB.js +0 -31
  84. package/dist/cli/client-3J76AMVE.js +0 -20
  85. package/dist/cli/git-2NSE4WIK.js +0 -23
  86. package/dist/cli/skills-VLTAVA4K.js +0 -28
  87. package/dist/cli/update-5CZOVYQT.js +0 -28
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GAMFK2ZP.mjs";
4
4
  import {
5
5
  printCommandEnvelope
6
- } from "./chunk-ABMGEW3C.mjs";
6
+ } from "./chunk-OJWZADOG.mjs";
7
7
  import {
8
8
  DEFAULT_SKILL_AGENTS,
9
9
  KNOWN_SKILL_AGENTS,
@@ -22,7 +22,7 @@ import {
22
22
  sdkCliStateDirPath,
23
23
  skillsAgentPathSegment,
24
24
  writeSdkSkillsLocalVersion
25
- } from "./chunk-T3P4NRZU.mjs";
25
+ } from "./chunk-M4KGWEN2.mjs";
26
26
  import {
27
27
  DeeplineError
28
28
  } from "./chunk-NXGCO4JB.mjs";
@@ -388,6 +388,8 @@ function enforceSdkCompatibilityResponse(response, options = {}) {
388
388
  }
389
389
 
390
390
  // src/cli/windows-arg-escape.ts
391
+ import { statSync } from "fs";
392
+ import { win32 } from "path";
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 = 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(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 = win32.extname(command) ? [""] : (env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean);
428
+ const directories = /[\\/]/.test(command) ? [""] : [cwd, ...(env.PATH ?? "").split(";")];
429
+ for (const directory of directories) {
430
+ for (const extension of extensions) {
431
+ const candidate = directory ? win32.resolve(
432
+ cwd,
433
+ directory.replace(/^"|"$/g, ""),
434
+ command + extension
435
+ ) : win32.resolve(cwd, command + extension);
436
+ try {
437
+ if (statSync(candidate).isFile()) return candidate;
438
+ } catch {
439
+ }
440
+ }
441
+ }
442
+ return void 0;
443
+ }
412
444
 
413
445
  // src/cli/failure-reporting.ts
414
446
  import { hostname, platform, release } from "os";
@@ -894,9 +926,13 @@ function claimOneInProgressSkillsSync(baseUrl, remoteVersion, agent, owner) {
894
926
  };
895
927
  try {
896
928
  mkdirSync2(dirname2(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 ${sdkCliStateDirPath(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) {
@@ -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(
@@ -1155,6 +1214,7 @@ function clearFailedSkillsSync(baseUrl, agents) {
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(
@@ -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),
@@ -1391,17 +1451,22 @@ function noInstallerProbePath(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(readFileSync2(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 && (cached.probes?.bunx === "missing" || cached.probes?.bunx === "failed") && (cached.probes?.npx === "missing" || cached.probes?.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 && (cached.probes?.bunx === "missing" || cached.probes?.bunx === "failed") && (cached.probes?.npx === "missing" || cached.probes?.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
1463
  } catch {
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
  mkdirSync2(dirname2(path), { recursive: true });
1407
1472
  writeFileSync2(
@@ -1409,6 +1474,7 @@ 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"
@@ -1416,6 +1482,23 @@ function dueUnknownInstallerProbes(baseUrl, remoteVersion) {
1416
1482
  } catch {
1417
1483
  }
1418
1484
  }
1485
+ }
1486
+ function clearUnavailableInstallerProbes(baseUrl) {
1487
+ try {
1488
+ unlinkSync(noInstallerProbePath(baseUrl));
1489
+ } catch {
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 = DEFAULT_SKILL_AGENTS) {
1529
+ function resolveSkillsInstallCommands(baseUrl, skillNames = DEFAULT_SDK_SKILL_NAMES, agents = DEFAULT_SKILL_AGENTS, knownProbes) {
1447
1530
  const commands = [];
1448
- if (hasCommand("bunx")) {
1531
+ const probes = 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",
@@ -1613,12 +1697,16 @@ 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
  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 {
@@ -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
+ 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
- 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
  }
@@ -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
 
@@ -1936,7 +2036,13 @@ function readSkillsInstallState(path) {
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 = spawn2(plan.command, plan.args, {
1941
2047
  cwd,
1942
2048
  env: process.env,
@@ -2046,13 +2152,32 @@ async function runSkillsCommand(options, dependencies = {}) {
2046
2152
  )
2047
2153
  ]);
2048
2154
  }
2049
- const lease = scope === "global" ? await acquireSkillsInstallLease(baseUrl, agents, plan.version, {
2050
- waitMs: 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: 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
+ printCommandEnvelope(
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
2182
  printCommandEnvelope(
2058
2183
  {
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkYEJMVAD3js = require('./chunk-YEJMVAD3.js');
4
+ var _chunkRYO6353Ojs = require('./chunk-RYO6353O.js');
5
5
 
6
6
  // src/cli/commands/sessions.ts
7
7
 
@@ -420,7 +420,7 @@ function buildSessionUploadContent(raw) {
420
420
  return { encodedContent: encoded, needsChunking: true };
421
421
  }
422
422
  async function uploadPayload(path, payload) {
423
- const { http } = _chunkYEJMVAD3js.getAuthedHttpClient.call(void 0, );
423
+ const { http } = _chunkRYO6353Ojs.getAuthedHttpClient.call(void 0, );
424
424
  return await http.post(path, payload);
425
425
  }
426
426
  async function uploadChunkedSessions(sessions, options) {
@@ -452,7 +452,7 @@ async function uploadChunkedSessions(sessions, options) {
452
452
  environments: sessions.map(() => detectShellContext()),
453
453
  ...options.rating ? { rating: options.rating } : {}
454
454
  });
455
- _chunkYEJMVAD3js.printCommandEnvelope.call(void 0,
455
+ _chunkRYO6353Ojs.printCommandEnvelope.call(void 0,
456
456
  {
457
457
  ...response,
458
458
  ok: true,
@@ -481,7 +481,7 @@ async function handleSessionsSend(options) {
481
481
  filename: _path.basename.call(void 0, filePath),
482
482
  ...rating ? { rating } : {}
483
483
  });
484
- _chunkYEJMVAD3js.printCommandEnvelope.call(void 0,
484
+ _chunkRYO6353Ojs.printCommandEnvelope.call(void 0,
485
485
  {
486
486
  ...response2,
487
487
  ok: true,
@@ -530,7 +530,7 @@ async function handleSessionsSend(options) {
530
530
  environment: detectShellContext(),
531
531
  ...rating ? { rating } : {}
532
532
  });
533
- _chunkYEJMVAD3js.printCommandEnvelope.call(void 0,
533
+ _chunkRYO6353Ojs.printCommandEnvelope.call(void 0,
534
534
  {
535
535
  ...response,
536
536
  ok: true,
@@ -635,7 +635,7 @@ ${refreshMeta}
635
635
  </body>
636
636
  </html>`;
637
637
  _fs.writeFileSync.call(void 0, outputPath, html, "utf8");
638
- _chunkYEJMVAD3js.printCommandEnvelope.call(void 0,
638
+ _chunkRYO6353Ojs.printCommandEnvelope.call(void 0,
639
639
  {
640
640
  ok: true,
641
641
  file: outputPath,