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
@@ -14,7 +14,7 @@ var _chunkLA46MMTLjs = require('./chunk-LA46MMTL.js');
14
14
 
15
15
 
16
16
 
17
- var _chunkNZCFZXDPjs = require('./chunk-NZCFZXDP.js');
17
+ var _chunkRNJ74JDHjs = require('./chunk-RNJ74JDH.js');
18
18
 
19
19
 
20
20
 
@@ -2743,8 +2743,8 @@ function runtimeSelectionHeaders(runtime) {
2743
2743
  }
2744
2744
  const receivers = _optionalChain([process, 'access', _102 => _102.env, 'access', _103 => _103.DEEPLINE_RUNTIME_RETAINED_PIPELINE_RECEIVERS, 'optionalAccess', _104 => _104.trim, 'call', _105 => _105()]);
2745
2745
  return {
2746
- [_chunkNZCFZXDPjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2747
- ...receivers ? { [_chunkNZCFZXDPjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2746
+ [_chunkRNJ74JDHjs.RUNTIME_ENVIRONMENT_TOKEN_HEADER]: token,
2747
+ ...receivers ? { [_chunkRNJ74JDHjs.RETAINED_PIPELINE_RECEIVERS_HEADER]: receivers } : {}
2748
2748
  };
2749
2749
  }
2750
2750
  function isolatedCiRuntimeEventReadHeaders() {
@@ -2760,7 +2760,7 @@ function isolatedCiRuntimeEventReadHeaders() {
2760
2760
  "RUNTIME_EVENT_INTERNAL_TOKEN_REQUIRED"
2761
2761
  );
2762
2762
  }
2763
- return { [_chunkNZCFZXDPjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2763
+ return { [_chunkRNJ74JDHjs.COORDINATOR_INTERNAL_TOKEN_HEADER]: token };
2764
2764
  }
2765
2765
  function normalizeTestPolicyOverrides(value, source) {
2766
2766
  if (value && typeof value === "object" && !Array.isArray(value)) {
@@ -3061,8 +3061,8 @@ var DeeplineClient = (_class = class _DeeplineClient {
3061
3061
  * @throws {@link ConfigError} if no API key can be resolved from any source.
3062
3062
  */
3063
3063
  constructor(options) {
3064
- this.config = _chunkNZCFZXDPjs.resolveConfig.call(void 0, options);
3065
- this.http = new (0, _chunkNZCFZXDPjs.HttpClient)(this.config);
3064
+ this.config = _chunkRNJ74JDHjs.resolveConfig.call(void 0, options);
3065
+ this.http = new (0, _chunkRNJ74JDHjs.HttpClient)(this.config);
3066
3066
  this.toolCalls = new ToolCalls(
3067
3067
  this.http,
3068
3068
  this.config.timeout,
@@ -4,7 +4,7 @@
4
4
  var _chunkXNYIZMNQjs = require('./chunk-XNYIZMNQ.js');
5
5
 
6
6
 
7
- var _chunk3SZSFTLQjs = require('./chunk-3SZSFTLQ.js');
7
+ var _chunkFYPZ43Y4js = require('./chunk-FYPZ43Y4.js');
8
8
 
9
9
 
10
10
 
@@ -721,9 +721,9 @@ function resolveCliCommandContext(inputConfig, requestedScope) {
721
721
  }
722
722
 
723
723
  // src/version.ts
724
- var SDK_VERSION = _chunk3SZSFTLQjs.SDK_RELEASE.version;
725
- var SDK_API_MAJOR = _chunk3SZSFTLQjs.SDK_RELEASE.contracts.api.currentMajor;
726
- var SDK_API_CONTRACT = _nullishCoalesce(_chunk3SZSFTLQjs.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
724
+ var SDK_VERSION = _chunkFYPZ43Y4js.SDK_RELEASE.version;
725
+ var SDK_API_MAJOR = _chunkFYPZ43Y4js.SDK_RELEASE.contracts.api.currentMajor;
726
+ var SDK_API_CONTRACT = _nullishCoalesce(_chunkFYPZ43Y4js.SDK_RELEASE.contracts.api.legacyWireIds[0], () => ( `api-v${SDK_API_MAJOR}`));
727
727
 
728
728
  // src/agent-runtime.ts
729
729
 
@@ -49,7 +49,7 @@ var SDK_RELEASE = {
49
49
  // getters keep their established compatibility behavior.
50
50
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
51
51
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
52
- version: "0.3.309",
52
+ version: "0.3.311",
53
53
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
54
54
  packageCapabilities: {
55
55
  updatePreferences: 1
@@ -3,7 +3,7 @@ import {
3
3
  detectAgentRuntime,
4
4
  resolveCliCommandContext,
5
5
  resolveConfig
6
- } from "./chunk-N6P7NBX3.mjs";
6
+ } from "./chunk-Q3LYQTSO.mjs";
7
7
  import {
8
8
  DeeplineError
9
9
  } from "./chunk-NXGCO4JB.mjs";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-GAMFK2ZP.mjs";
4
4
  import {
5
5
  printCommandEnvelope
6
- } from "./chunk-GUUQJJBS.mjs";
6
+ } from "./chunk-SPUTBCUR.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-N6P7NBX3.mjs";
25
+ } from "./chunk-Q3LYQTSO.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,17 +1,17 @@
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 _chunk6QWXPOZMjs = require('./chunk-6QWXPOZM.js');
4
+ var _chunkQO3GH6UPjs = require('./chunk-QO3GH6UP.js');
5
5
 
6
6
 
7
7
 
8
- var _chunkCO5TGXG2js = require('./chunk-CO5TGXG2.js');
8
+ var _chunk7TT4LZIRjs = require('./chunk-7TT4LZIR.js');
9
9
 
10
10
 
11
- var _chunkV5PB43SQjs = require('./chunk-V5PB43SQ.js');
11
+ var _chunkXDUQQTISjs = require('./chunk-XDUQQTIS.js');
12
12
 
13
13
 
14
- var _chunkNZCFZXDPjs = require('./chunk-NZCFZXDP.js');
14
+ var _chunkRNJ74JDHjs = require('./chunk-RNJ74JDH.js');
15
15
 
16
16
  // src/cli/commands/update.ts
17
17
  var _child_process = require('child_process');
@@ -504,7 +504,7 @@ function normalizedNpmPrefix(value) {
504
504
  }
505
505
  function resolveNpmGlobalPrefix(env) {
506
506
  try {
507
- const plan = _chunkCO5TGXG2js.resolveShellSpawn.call(void 0, "npm", ["prefix", "-g"]);
507
+ const plan = _chunk7TT4LZIRjs.resolveShellSpawn.call(void 0, "npm", ["prefix", "-g"], process.platform, env);
508
508
  const result = _child_process.spawnSync.call(void 0, plan.command, plan.args, {
509
509
  encoding: "utf8",
510
510
  env,
@@ -560,8 +560,8 @@ function resolveUpdatePlan(options = {}) {
560
560
  const npmGlobalPrefix = options.npmGlobalPrefix !== void 0 ? options.npmGlobalPrefix : resolveNpmGlobalPrefix(env);
561
561
  const hasVerifiedNpmOwnership = inferredInstallPrefix !== null && normalizedNpmPrefix(inferredInstallPrefix) === normalizedNpmPrefix(npmGlobalPrefix);
562
562
  const installPrefix = options.requireVerifiedNpmOwnership ? hasVerifiedNpmOwnership ? inferredInstallPrefix : null : inferredInstallPrefix;
563
- const npmVersion = options.npmVersion === void 0 ? _chunk6QWXPOZMjs.readNpmVersion.call(void 0, env) : options.npmVersion;
564
- const npmGlobalInstallFlags = _chunk6QWXPOZMjs.npmSupportsAllowScripts.call(void 0, npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
563
+ const npmVersion = options.npmVersion === void 0 ? _chunkQO3GH6UPjs.readNpmVersion.call(void 0, env) : options.npmVersion;
564
+ const npmGlobalInstallFlags = _chunkQO3GH6UPjs.npmSupportsAllowScripts.call(void 0, npmVersion) ? [...NPM_SDK_INSTALL_COMMON_FLAGS, "--allow-scripts=esbuild"] : NPM_SDK_INSTALL_COMMON_FLAGS;
565
565
  const args = installPrefix ? [
566
566
  "install",
567
567
  "-g",
@@ -571,7 +571,7 @@ function resolveUpdatePlan(options = {}) {
571
571
  packageSpec
572
572
  ] : ["install", "-g", ...npmGlobalInstallFlags, packageSpec];
573
573
  const fallbackRegistryUrl = options.npmFallbackRegistryUrl !== void 0 ? options.npmFallbackRegistryUrl : publicNpmFallbackRegistryUrl(
574
- _optionalChain([env, 'access', _18 => _18.DEEPLINE_HOST_URL, 'optionalAccess', _19 => _19.trim, 'call', _20 => _20()]) || _chunkNZCFZXDPjs.autoDetectBaseUrl.call(void 0, )
574
+ _optionalChain([env, 'access', _18 => _18.DEEPLINE_HOST_URL, 'optionalAccess', _19 => _19.trim, 'call', _20 => _20()]) || _chunkRNJ74JDHjs.autoDetectBaseUrl.call(void 0, )
575
575
  );
576
576
  return {
577
577
  kind: "npm-global",
@@ -718,7 +718,7 @@ function sidecarInstallFailure(versionDir) {
718
718
  function runCommand(command, args, env = process.env) {
719
719
  return new Promise((resolveResult) => {
720
720
  let output = "";
721
- const plan = _chunkCO5TGXG2js.resolveShellSpawn.call(void 0, command, args);
721
+ const plan = _chunk7TT4LZIRjs.resolveShellSpawn.call(void 0, command, args, process.platform, env);
722
722
  const child = _child_process.spawn.call(void 0, plan.command, plan.args, {
723
723
  stdio: ["inherit", "pipe", "pipe"],
724
724
  shell: plan.shell,
@@ -1094,14 +1094,14 @@ async function publishedVersionSupportsPin(version, fallbackRegistryUrl) {
1094
1094
  throw _nullishCoalesce(lastError, () => ( new Error("No npm registry was available")));
1095
1095
  }
1096
1096
  async function runUpdateCommand(options, dependencies = {}) {
1097
- const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => ( _chunkNZCFZXDPjs.autoDetectBaseUrl));
1097
+ const detectBaseUrl = _nullishCoalesce(dependencies.detectBaseUrl, () => ( _chunkRNJ74JDHjs.autoDetectBaseUrl));
1098
1098
  const resolvePlan = _nullishCoalesce(dependencies.resolvePlan, () => ( resolveUpdatePlan));
1099
1099
  const runPlan = _nullishCoalesce(dependencies.runPlan, () => ( runUpdatePlan));
1100
1100
  const syncSkills = _nullishCoalesce(dependencies.syncSkillsIfNeeded, () => ( (async () => {
1101
1101
  const originalWrite = process.stdout.write.bind(process.stdout);
1102
1102
  process.stdout.write = (() => true);
1103
1103
  try {
1104
- const exitCode = await _chunkCO5TGXG2js.runSkillsCommand.call(void 0, { json: true });
1104
+ const exitCode = await _chunk7TT4LZIRjs.runSkillsCommand.call(void 0, { json: true });
1105
1105
  if (exitCode !== 0) {
1106
1106
  throw new Error(
1107
1107
  `Deepline skills update failed with exit ${exitCode}.`
@@ -1172,11 +1172,11 @@ async function runUpdateCommand(options, dependencies = {}) {
1172
1172
  ]
1173
1173
  };
1174
1174
  if (options.json && !options.executeWithJson) {
1175
- _chunkV5PB43SQjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: true });
1175
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: true });
1176
1176
  return 0;
1177
1177
  }
1178
1178
  if (options.printCommand) {
1179
- _chunkV5PB43SQjs.printCommandEnvelope.call(void 0,
1179
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0,
1180
1180
  {
1181
1181
  ...plan,
1182
1182
  render: {
@@ -1189,7 +1189,7 @@ async function runUpdateCommand(options, dependencies = {}) {
1189
1189
  return 0;
1190
1190
  }
1191
1191
  if (plan.kind === "source" || plan.kind === "homebrew") {
1192
- _chunkV5PB43SQjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: false });
1192
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0, { ...plan, render }, { json: false });
1193
1193
  return 0;
1194
1194
  }
1195
1195
  stderr.write(`Updating Deepline SDK/CLI with: ${plan.manualCommand}
@@ -1219,7 +1219,7 @@ To retry with full installer output, run: deepline skills --json
1219
1219
  );
1220
1220
  }
1221
1221
  if (options.executeWithJson && options.json) {
1222
- _chunkV5PB43SQjs.printCommandEnvelope.call(void 0,
1222
+ _chunkXDUQQTISjs.printCommandEnvelope.call(void 0,
1223
1223
  {
1224
1224
  ok: true,
1225
1225
  pinnedVersion
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkNZCFZXDPjs = require('./chunk-NZCFZXDP.js');
6
+ var _chunkRNJ74JDHjs = require('./chunk-RNJ74JDH.js');
7
7
 
8
8
 
9
9
  var _chunk7P5AA3SNjs = require('./chunk-7P5AA3SN.js');
@@ -136,8 +136,8 @@ var BROWSER_OPEN_COOLDOWN_MS = 3e4;
136
136
  var SAME_URL_BROWSER_OPEN_COOLDOWN_MS = 5 * 6e4;
137
137
  var defaultBrowserCommandRunner = childProcess;
138
138
  function getAuthedHttpClient() {
139
- const config = _chunkNZCFZXDPjs.resolveConfig.call(void 0, );
140
- return { config, http: new (0, _chunkNZCFZXDPjs.HttpClient)(config) };
139
+ const config = _chunkRNJ74JDHjs.resolveConfig.call(void 0, );
140
+ return { config, http: new (0, _chunkRNJ74JDHjs.HttpClient)(config) };
141
141
  }
142
142
  function stableOsUserId() {
143
143
  try {
@@ -477,7 +477,7 @@ function collectLocalEnvInfo() {
477
477
  os: `${process.platform} ${process.arch}`,
478
478
  node_version: process.version,
479
479
  home_dir: homeDir,
480
- agent_runtime: _chunkNZCFZXDPjs.detectAgentRuntime.call(void 0, )
480
+ agent_runtime: _chunkRNJ74JDHjs.detectAgentRuntime.call(void 0, )
481
481
  };
482
482
  const env = process.env;
483
483
  const optional = {
@@ -725,9 +725,9 @@ function markdownTableFromRows(rows, preferredColumns = []) {
725
725
  }
726
726
  function withAgentCommandContext(value) {
727
727
  const valueRecord = value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
728
- return _chunkNZCFZXDPjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
728
+ return _chunkRNJ74JDHjs.detectAgentRuntime.call(void 0, ) !== "unknown" && valueRecord && !Object.prototype.hasOwnProperty.call(valueRecord, "command_context") ? {
729
729
  ...valueRecord,
730
- command_context: _chunkNZCFZXDPjs.resolveCliCommandContext.call(void 0, )
730
+ command_context: _chunkRNJ74JDHjs.resolveCliCommandContext.call(void 0, )
731
731
  } : value;
732
732
  }
733
733
  function printJson(value, fields) {