@outerlayer/cli 0.34.0-next.20261028183303 → 0.34.0-next.20261029014930

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 (182) hide show
  1. package/README.md +7 -0
  2. package/dist/agent-setup-J2WZHYN5.js +32 -0
  3. package/dist/{artifact-link-cmd-CSVFEM5O.js → artifact-link-cmd-6LFCTDBD.js} +5 -5
  4. package/dist/{build-SEJJWGTO.js → build-2JBISOVR.js} +8 -8
  5. package/dist/{build-disk-EYRR3PBT.js → build-disk-ECEVCK35.js} +6 -6
  6. package/dist/build-info.json +1 -1
  7. package/dist/{builder-T7B46P7T.js → builder-OMDEUDO3.js} +5 -5
  8. package/dist/caller-P5ZHKVD5.js +18 -0
  9. package/dist/{check-VKSOYRNI.js → check-6ZGMF7VF.js} +84 -66
  10. package/dist/{chunk-ANPNT6PM.js → chunk-2AM6Z5BP.js} +1 -1
  11. package/dist/{chunk-3UIXIGYT.js → chunk-2B6EKUBD.js} +4 -4
  12. package/dist/{chunk-GG5OE6MY.js → chunk-2RTGZ6AE.js} +1 -1
  13. package/dist/{chunk-QGEGLZSY.js → chunk-32QKEHC7.js} +46 -6
  14. package/dist/{chunk-VNVZDWO3.js → chunk-352DHUTP.js} +4 -1
  15. package/dist/{chunk-VX7WZK7J.js → chunk-3MKCUCG7.js} +187 -119
  16. package/dist/{chunk-ZJSNLVCE.js → chunk-545P7JY7.js} +1 -1
  17. package/dist/{chunk-2EEW6FJN.js → chunk-5FWBAM6O.js} +1 -1
  18. package/dist/{chunk-MCPCOKHN.js → chunk-5VGVYEFT.js} +9 -9
  19. package/dist/{chunk-T2Q7ISPE.js → chunk-5WYT3PPE.js} +1 -1
  20. package/dist/{chunk-ARL6X6Y4.js → chunk-62TMOXQN.js} +2 -2
  21. package/dist/{chunk-RRXS4CWE.js → chunk-6JDEP42Z.js} +9 -7
  22. package/dist/{chunk-AF4E4I4T.js → chunk-6OAOOAJO.js} +11 -11
  23. package/dist/{chunk-64O2NUVA.js → chunk-76VJKVM5.js} +8 -7
  24. package/dist/{chunk-4YD7N6V3.js → chunk-7B6CKPNZ.js} +3 -3
  25. package/dist/{chunk-I2MFIT6X.js → chunk-7T5MUKW6.js} +28 -27
  26. package/dist/{chunk-2EHDLYSL.js → chunk-7TIFAOUG.js} +30 -22
  27. package/dist/{chunk-G2JWZDFA.js → chunk-A2LHHKTT.js} +3 -3
  28. package/dist/{chunk-ESVW4MJY.js → chunk-AAGU5FJF.js} +1 -1
  29. package/dist/{chunk-NXUZFHMX.js → chunk-B7ZC2HKE.js} +3 -3
  30. package/dist/{chunk-YF7W7B7Y.js → chunk-BWJRNMZZ.js} +37 -10
  31. package/dist/{chunk-TUSYOL2O.js → chunk-CJPTUU2E.js} +1 -1
  32. package/dist/{chunk-MEIDQLXQ.js → chunk-D7BEGG7T.js} +1 -1
  33. package/dist/{chunk-V2S2WRGD.js → chunk-DG25T7AY.js} +11 -11
  34. package/dist/chunk-DUV33KMD.js +31 -0
  35. package/dist/{chunk-NCOL5RYI.js → chunk-E4R3M6XJ.js} +1 -1
  36. package/dist/{chunk-DCBFUUDL.js → chunk-EFZM7UOP.js} +7 -7
  37. package/dist/{chunk-KH4774QT.js → chunk-F57NE5AO.js} +1 -1
  38. package/dist/{chunk-MH6QLXUO.js → chunk-FJ7KTNMD.js} +1 -1
  39. package/dist/{chunk-3KGXXTMN.js → chunk-FNS2RJ5T.js} +5 -5
  40. package/dist/{chunk-2O5KA67H.js → chunk-FUJUFLDC.js} +2 -2
  41. package/dist/{chunk-CRB3POP4.js → chunk-FZKNTIOJ.js} +1 -1
  42. package/dist/{chunk-KPEMNHVF.js → chunk-G7OVITGQ.js} +2 -2
  43. package/dist/{chunk-7JSWRF5O.js → chunk-GD4AXYK3.js} +10 -10
  44. package/dist/{chunk-SAAVZ2BX.js → chunk-GOSOKVBF.js} +1 -1
  45. package/dist/{chunk-ZTOJIRJH.js → chunk-HFHRTVXN.js} +8 -8
  46. package/dist/{chunk-S6UM3N4R.js → chunk-HSE2LOWO.js} +36 -11
  47. package/dist/{chunk-XDAMLX2L.js → chunk-HUS3GYCX.js} +9 -9
  48. package/dist/{chunk-PJDQPF5N.js → chunk-HWVMRETT.js} +1 -1
  49. package/dist/{chunk-WH3FPBPO.js → chunk-I35CNSPC.js} +60 -29
  50. package/dist/{chunk-ZCA34T7R.js → chunk-JEOBBOZY.js} +8 -8
  51. package/dist/{chunk-RQ3GCCHH.js → chunk-JXXMOAJG.js} +2 -2
  52. package/dist/{chunk-EA2PQRCU.js → chunk-K6LLZONM.js} +6 -6
  53. package/dist/{chunk-LJEZGHCH.js → chunk-KWFJF4CX.js} +646 -210
  54. package/dist/{chunk-URIZRCRY.js → chunk-KYDEBGJG.js} +1 -1
  55. package/dist/{chunk-P2PNBDUT.js → chunk-LLQGVGFO.js} +3 -3
  56. package/dist/{chunk-HFOZTCTN.js → chunk-N2OG4RN6.js} +7 -7
  57. package/dist/{chunk-KT4CN6OU.js → chunk-OHQMGLJP.js} +3 -3
  58. package/dist/{chunk-5BHIBJDA.js → chunk-OLM2TIOW.js} +1 -1
  59. package/dist/{chunk-VEVNGDTP.js → chunk-PDK35AR4.js} +2 -2
  60. package/dist/{chunk-UZEIBWTP.js → chunk-PGJY7XTY.js} +7 -7
  61. package/dist/{chunk-TDCHUEKY.js → chunk-PNAVR5OD.js} +5 -5
  62. package/dist/{chunk-RPST2GNG.js → chunk-PQ5YDDDE.js} +3 -3
  63. package/dist/{chunk-OKJXZXYH.js → chunk-PUSCE544.js} +6 -6
  64. package/dist/{chunk-ZEFNJCN3.js → chunk-QM3HMXMU.js} +2 -2
  65. package/dist/{chunk-CUAB7FAZ.js → chunk-QNISFH47.js} +8 -8
  66. package/dist/{chunk-5TXQFZHY.js → chunk-QOVUDIUI.js} +1 -1
  67. package/dist/{chunk-OYQVLQP3.js → chunk-QTNWAV23.js} +14 -12
  68. package/dist/{chunk-ZCZY3Q55.js → chunk-RZ22SWMA.js} +1 -1
  69. package/dist/{chunk-KQDK4Q6A.js → chunk-SMYOFJHK.js} +10 -10
  70. package/dist/{chunk-GH2HEEOH.js → chunk-TV2OQUWE.js} +1 -1
  71. package/dist/{chunk-HH3BQG65.js → chunk-UPRZREBO.js} +1 -1
  72. package/dist/{chunk-W7E6IMEW.js → chunk-UTIRCHI5.js} +22 -21
  73. package/dist/{chunk-H7MGR2GN.js → chunk-UZDWCSLS.js} +6 -6
  74. package/dist/{chunk-IAVT7R6O.js → chunk-WJTIU2A5.js} +6 -6
  75. package/dist/{chunk-QGDGGLSD.js → chunk-X4PYXWBY.js} +3 -3
  76. package/dist/{chunk-54LIUIZL.js → chunk-XGSJNXH2.js} +4 -4
  77. package/dist/chunk-XKV6HXKD.js +39 -0
  78. package/dist/{chunk-I7RZHMXW.js → chunk-YBAVN6WS.js} +3 -3
  79. package/dist/{chunk-IXRUVR25.js → chunk-YTTESG7K.js} +46 -7
  80. package/dist/{chunk-MRLJK4GZ.js → chunk-YZSE7EYM.js} +6 -6
  81. package/dist/{chunk-CKDSPW35.js → chunk-ZI2E4YMY.js} +6 -6
  82. package/dist/{chunk-UXC3RQLF.js → chunk-ZQQNWDPE.js} +1 -1
  83. package/dist/{claude-launcher-7IC6QWR5.js → claude-launcher-GACOES7Z.js} +6 -6
  84. package/dist/{cli-HBS2PXSS.js → cli-A3IUMZHY.js} +162 -152
  85. package/dist/{cli-update-notice-4DLZ3655.js → cli-update-notice-T3CXRWNB.js} +3 -3
  86. package/dist/{command-XA6DOFL4.js → command-XPDD3473.js} +39 -38
  87. package/dist/{config-RSOCVUKC.js → config-7DT7UVUI.js} +8 -8
  88. package/dist/connect-cmd-TWSO7YKC.js +27 -0
  89. package/dist/{container-start-PYW7W2N2.js → container-start-2AQWC275.js} +53 -52
  90. package/dist/{context-cleanup-CEZSKNVL.js → context-cleanup-PASDUBGW.js} +5 -5
  91. package/dist/{context-show-cmd-XWLTP6R4.js → context-show-cmd-6MEUB3HU.js} +18 -18
  92. package/dist/{control-plane-launch-3MBWPYWZ.js → control-plane-launch-6NN5ZSP3.js} +15 -15
  93. package/dist/{demo-record-cmd-SIKNTSGI.js → demo-record-cmd-2FY7VCIL.js} +3 -3
  94. package/dist/{demo-voice-cmd-SAB3QU4F.js → demo-voice-cmd-GJNJNEAI.js} +29 -29
  95. package/dist/{dist-VPXROEZO.js → dist-Z6WP743R.js} +2 -2
  96. package/dist/{docker-YMRPMDOW.js → docker-DLJTPUC5.js} +5 -5
  97. package/dist/{doctor-NVHAE4LS.js → doctor-HYDAFWR2.js} +49 -38
  98. package/dist/emit-artifact-cmd-TTLDSPP3.js +43 -0
  99. package/dist/emit-cmd-UOPHEUW5.js +16 -0
  100. package/dist/emit-criteria-cmd-MZSFNXTL.js +33 -0
  101. package/dist/emit-demo-cmd-CPC6OR6A.js +47 -0
  102. package/dist/emit-finding-cmd-6ABNXD5P.js +34 -0
  103. package/dist/{emit-result-cmd-VCKNZ4RZ.js → emit-result-cmd-7STD6BH3.js} +27 -27
  104. package/dist/emit-step-cmd-A35LWNWB.js +33 -0
  105. package/dist/find-unit-ZMUTRE46.js +19 -0
  106. package/dist/{findings-cmd-PLHBAQW4.js → findings-cmd-JNLW5T2Q.js} +22 -22
  107. package/dist/fleet-readiness-7WASGVPR.js +28 -0
  108. package/dist/governing-source-SQE47DKU.js +38 -0
  109. package/dist/{guest-init-MI4SEME4.js → guest-init-73ZCYECM.js} +2 -2
  110. package/dist/{hook-fast-GOH4T6SN.js → hook-fast-AELCXUNA.js} +6 -6
  111. package/dist/{hook-wrap-fast-7VYYAAH4.js → hook-wrap-fast-545QJSBJ.js} +3 -3
  112. package/dist/host-checks-EM7CVCO6.js +78 -0
  113. package/dist/{host-key-OMLDWLNG.js → host-key-ZRXO2BXZ.js} +2 -2
  114. package/dist/{image-tag-YJJONB64.js → image-tag-6KN2SKDZ.js} +2 -2
  115. package/dist/index.js +6 -6
  116. package/dist/init-4U2IAN5U.js +57 -0
  117. package/dist/{init-W3ATJYLX.js → init-NEOWYRSR.js} +35 -34
  118. package/dist/{init-cmd-XJOEU2PB.js → init-cmd-WRNXDUM7.js} +32 -32
  119. package/dist/{init-update-KX3FFQ5H.js → init-update-ATXYAAAD.js} +29 -29
  120. package/dist/{install-cmd-QTIIMO6B.js → install-cmd-WF2N2SKL.js} +4 -4
  121. package/dist/{layout-7UOBWNYO.js → layout-ZE6F2Z7W.js} +4 -4
  122. package/dist/login-browser-YB7AMKHR.js +13 -0
  123. package/dist/{logout-cmd-5WE2N5B5.js → logout-cmd-Z2PYV5LF.js} +5 -5
  124. package/dist/{logs-YVXVAYTD.js → logs-WEJHWBLM.js} +22 -2
  125. package/dist/loop-IHQ4UMRY.js +89 -0
  126. package/dist/machine-VNDSSHQA.js +57 -0
  127. package/dist/{machine-skills-KYN7XJEJ.js → machine-skills-DMHU7OLO.js} +5 -5
  128. package/dist/{mcp-install-cmd-LD7KYAOP.js → mcp-install-cmd-23ZY4IBK.js} +5 -5
  129. package/dist/{mcp-serve-cmd-ECTAPDB3.js → mcp-serve-cmd-YT63QC7W.js} +8 -8
  130. package/dist/{paths-M66LPPUF.js → paths-IGFAJFPN.js} +1 -1
  131. package/dist/{pending-7LC6XDRO.js → pending-GBIXDPY7.js} +2 -2
  132. package/dist/{pidfile-DSQOOAZV.js → pidfile-BDQMJPLA.js} +2 -2
  133. package/dist/{record-3KKIJ3XL.js → record-KLNLIQVR.js} +2 -2
  134. package/dist/{runner-env-EX7YUIUH.js → runner-env-PBTT2CNL.js} +10 -10
  135. package/dist/{runner-identity-LJWBXNM5.js → runner-identity-JVG53E73.js} +5 -5
  136. package/dist/{runner-key-CAUO4RKG.js → runner-key-YKHIRBO4.js} +34 -33
  137. package/dist/session-sender-SNBEWETV.js +43 -0
  138. package/dist/{settings-3DBYKYQD.js → settings-XB2HYBKO.js} +2 -2
  139. package/dist/{spec-cmd-SAWQYHKM.js → spec-cmd-VPP66GMQ.js} +22 -22
  140. package/dist/{starter-pack-KB3YH4KX.js → starter-pack-WUNNS6G7.js} +9 -9
  141. package/dist/state-VIWYAWVB.js +9 -0
  142. package/dist/{status-VMFS7N6A.js → status-HY5FJPJV.js} +74 -52
  143. package/dist/{statusline-fast-YVHG6ZLX.js → statusline-fast-E7RWVREA.js} +4 -4
  144. package/dist/sync-cmd-7BG47GNA.js +42 -0
  145. package/dist/update-steps-NI25AAQM.js +79 -0
  146. package/dist/{watch-6NRBX6VE.js → watch-QMKKCF2B.js} +27 -27
  147. package/dist/{work-claim-cmd-SLVX2N4L.js → work-claim-cmd-UUMDPIZG.js} +25 -25
  148. package/dist/work-cmd-5QGKKDFY.js +31 -0
  149. package/dist/work-comment-cmd-YJ3JTQ5B.js +32 -0
  150. package/dist/{work-demo-cmd-SZJIKB5J.js → work-demo-cmd-AQ4JVDCK.js} +19 -19
  151. package/dist/{work-launch-LEQ2MPM3.js → work-launch-TTGSHLY4.js} +3 -3
  152. package/dist/{work-logs-cmd-MRFSBMJM.js → work-logs-cmd-TQTA7KQK.js} +19 -19
  153. package/dist/{work-open-pr-cmd-N7GK7FUQ.js → work-open-pr-cmd-2NFF3RYJ.js} +21 -21
  154. package/dist/work-pr-cmd-R5VRWQJD.js +32 -0
  155. package/dist/work-proofs-cmd-UYGYDIYY.js +35 -0
  156. package/dist/{work-proofs-record-JD4DNZUW.js → work-proofs-record-U3KQOM5Z.js} +33 -33
  157. package/dist/{work-stop-cmd-M6RIGF7S.js → work-stop-cmd-SIAX4XAA.js} +19 -19
  158. package/package.json +1 -1
  159. package/dist/agent-setup-IVXRBFVV.js +0 -32
  160. package/dist/connect-cmd-JFGDHFLA.js +0 -27
  161. package/dist/emit-artifact-cmd-TZTVQCFT.js +0 -43
  162. package/dist/emit-cmd-4G3443OJ.js +0 -16
  163. package/dist/emit-criteria-cmd-WH7JB4RQ.js +0 -33
  164. package/dist/emit-demo-cmd-DNUVG5N7.js +0 -47
  165. package/dist/emit-finding-cmd-X5CBH4ZA.js +0 -34
  166. package/dist/emit-step-cmd-IUXZZYKO.js +0 -33
  167. package/dist/find-unit-QYD2FMCP.js +0 -19
  168. package/dist/fleet-readiness-F65CKZY5.js +0 -28
  169. package/dist/governing-source-JFCTQXYK.js +0 -38
  170. package/dist/host-checks-HC4XXGAD.js +0 -77
  171. package/dist/init-JVKJTJNM.js +0 -56
  172. package/dist/login-browser-Q25ZNSQ3.js +0 -13
  173. package/dist/loop-GBTANKUW.js +0 -87
  174. package/dist/machine-OQOHEMJB.js +0 -56
  175. package/dist/session-sender-U2CTD7EX.js +0 -43
  176. package/dist/sync-cmd-EBJQ5LMH.js +0 -42
  177. package/dist/update-steps-HMSVBDKH.js +0 -78
  178. package/dist/work-cmd-VSHZCXHQ.js +0 -31
  179. package/dist/work-comment-cmd-3DCL7VHN.js +0 -32
  180. package/dist/work-pr-cmd-HD5OIHUU.js +0 -32
  181. package/dist/work-proofs-cmd-GFGENBGN.js +0 -35
  182. package/dist/{chunk-POND2SMT.js → chunk-RC2WZQK6.js} +1 -1
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { appendContextProvenance } from './chunk-ZJSNLVCE.js';
3
+ import { appendContextProvenance } from './chunk-545P7JY7.js';
4
4
  import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-HCVLP7XA.js';
5
5
  import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
6
- import { updateNoticeContext, staleMachineCopiesContext } from './chunk-5BHIBJDA.js';
6
+ import { updateNoticeContext, staleMachineCopiesContext } from './chunk-OLM2TIOW.js';
7
7
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
8
- import { cliInvocation } from './chunk-CRB3POP4.js';
9
- import { deadHooksState, huskyPrepareScript, preparePackageManagerCommand } from './chunk-TUSYOL2O.js';
10
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
8
+ import { cliInvocation } from './chunk-FZKNTIOJ.js';
9
+ import { deadHooksState, huskyPrepareScript, preparePackageManagerCommand } from './chunk-CJPTUU2E.js';
10
+ import { homeFromEnv } from './chunk-352DHUTP.js';
11
11
  import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, readdirSync, unlinkSync, statSync, appendFileSync, opendirSync } from 'fs';
12
12
  import { spawn, execFileSync } from 'child_process';
13
13
  import { createHash } from 'crypto';
@@ -429,7 +429,7 @@ function hookErrorsContext(home, writtenBytes, seenBytes) {
429
429
  }
430
430
  async function handleWorkLaunch(sessionId, home, env, spawnImpl = spawnDetached, cwd = process.cwd()) {
431
431
  if (!sessionId || env.OUTERLAYER_WORK === void 0) return void 0;
432
- const { parseWorkItemEnv, appendLaunchRecord } = await import('./work-launch-LEQ2MPM3.js');
432
+ const { parseWorkItemEnv, appendLaunchRecord } = await import('./work-launch-TTGSHLY4.js');
433
433
  const parsed = parseWorkItemEnv(env.OUTERLAYER_WORK);
434
434
  if ("reason" in parsed) {
435
435
  logHookError(home, new Error(`OUTERLAYER_WORK ignored: ${parsed.reason}`));
@@ -467,7 +467,7 @@ async function handleWorkLaunch(sessionId, home, env, spawnImpl = spawnDetached,
467
467
  }
468
468
  async function missingRenewalHookContext(home, cwd) {
469
469
  try {
470
- const { settingsPath, readSettings, isOurHookCommand } = await import('./settings-3DBYKYQD.js');
470
+ const { settingsPath, readSettings, isOurHookCommand } = await import('./settings-XB2HYBKO.js');
471
471
  const userSettings = readSettings(settingsPath("user", { home }));
472
472
  const projectSettings = readSettings(settingsPath("project", { cwd }));
473
473
  if (userSettings === null && projectSettings === null) return void 0;
@@ -495,7 +495,7 @@ async function maybeRenewWorkLease(event, sessionId, home = homeFromEnv(), env =
495
495
  if (now - statSync(marker).mtimeMs < WORK_LEASE_RENEW_DEBOUNCE_MS) return;
496
496
  } catch {
497
497
  }
498
- const { parseWorkItemEnv } = await import('./work-launch-LEQ2MPM3.js');
498
+ const { parseWorkItemEnv } = await import('./work-launch-TTGSHLY4.js');
499
499
  const parsed = parseWorkItemEnv(env.OUTERLAYER_WORK);
500
500
  if ("reason" in parsed) return;
501
501
  writeFileSync(marker, String(now));
@@ -511,7 +511,7 @@ async function handleWorkSessionEnd(event, sessionId, _home = homeFromEnv(), env
511
511
  try {
512
512
  if (event !== "SessionEnd") return;
513
513
  if (!sessionId || env.OUTERLAYER_WORK === void 0) return;
514
- const { parseWorkItemEnv } = await import('./work-launch-LEQ2MPM3.js');
514
+ const { parseWorkItemEnv } = await import('./work-launch-TTGSHLY4.js');
515
515
  const parsed = parseWorkItemEnv(env.OUTERLAYER_WORK);
516
516
  if ("reason" in parsed) return;
517
517
  spawnImpl(
@@ -680,11 +680,11 @@ async function missingControlPlane(cwd, sessionId, home, env) {
680
680
  const dirs = findGitDirs(cwd);
681
681
  if (dirs === void 0) return void 0;
682
682
  if (existsSync(join(dirs.gitCommonDir, "outerlayer", "materialized.json")) || hasExcludeBlock(dirs.gitCommonDir)) {
683
- const { cleanupEarlierCopies } = await import('./context-cleanup-CEZSKNVL.js');
683
+ const { cleanupEarlierCopies } = await import('./context-cleanup-PASDUBGW.js');
684
684
  cleanupEarlierCopies(dirs);
685
685
  }
686
686
  if (!contextPossiblyGoverned(cwd, home)) return void 0;
687
- const { governanceOf } = await import('./control-plane-launch-3MBWPYWZ.js');
687
+ const { governanceOf } = await import('./control-plane-launch-6NN5ZSP3.js');
688
688
  if (await governanceOf({ cwd, env, home }) !== "governed") return void 0;
689
689
  recordMissingContext(dirs, sessionId, home);
690
690
  const launcher = `${cliInvocation()} claude`;
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir } from './chunk-HSE2LOWO.js';
4
+ import { mkdirSync, writeFileSync, renameSync, existsSync, readFileSync } from 'fs';
5
+ import { dirname, join } from 'path';
6
+
7
+ createRequire(import.meta.url);
8
+ function fleetStatePath(configPath) {
9
+ return join(runnerDir(configPath), "fleet-state.json");
10
+ }
11
+ function writeFleetState(configPath, state) {
12
+ const path = fleetStatePath(configPath);
13
+ mkdirSync(dirname(path), { recursive: true, mode: RUNNER_DIR_MODE });
14
+ const partial = `${path}.partial`;
15
+ writeFileSync(partial, `${JSON.stringify(state, null, 2)}
16
+ `, { mode: RUNNER_FILE_MODE });
17
+ renameSync(partial, path);
18
+ }
19
+ function readFleetState(configPath) {
20
+ const path = fleetStatePath(configPath);
21
+ if (!existsSync(path)) return void 0;
22
+ try {
23
+ const parsed = JSON.parse(readFileSync(path, "utf8"));
24
+ if (typeof parsed !== "object" || parsed === null || !("calledAt" in parsed)) return void 0;
25
+ return parsed;
26
+ } catch {
27
+ return void 0;
28
+ }
29
+ }
30
+
31
+ export { readFleetState, writeFleetState };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { currentLink } from './chunk-KH4774QT.js';
3
+ import { currentLink } from './chunk-F57NE5AO.js';
4
4
  import { readFileSync, statSync, chmodSync, mkdirSync, writeFileSync, renameSync, rmSync, existsSync, lstatSync, accessSync, constants, realpathSync } from 'fs';
5
5
  import { randomBytes } from 'crypto';
6
6
  import { join, dirname, delimiter, resolve } from 'path';
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { WorkCommandError, postJson } from './chunk-XDAMLX2L.js';
4
- import { defaultGitRunner, materializeContext, fetchControlPlaneCommit, lookupGoverningSource } from './chunk-UZEIBWTP.js';
5
- import { signingFetchFor } from './chunk-3KGXXTMN.js';
6
- import { signerFor } from './chunk-5TXQFZHY.js';
3
+ import { WorkCommandError, postJson } from './chunk-HUS3GYCX.js';
4
+ import { defaultGitRunner, materializeContext, fetchControlPlaneCommit, lookupGoverningSource } from './chunk-PGJY7XTY.js';
5
+ import { signingFetchFor } from './chunk-FNS2RJ5T.js';
6
+ import { signerFor } from './chunk-QOVUDIUI.js';
7
7
  import { unsupportedLayout, layoutRefusalReason, composeDelivery } from './chunk-FGF52V4V.js';
8
8
  import { SHIM_SCRIPT, GOVERNANCE_VARIABLE } from './chunk-HCVLP7XA.js';
9
9
  import { readDegraded, readContextManifest, readSourceCache } from './chunk-YQR6E6OV.js';
10
- import { SHIM_DIR, stagedContextDir, contextHomeDir, deliveryDir, keptContextDir } from './chunk-S6UM3N4R.js';
10
+ import { SHIM_DIR, stagedContextDir, contextHomeDir, deliveryDir, keptContextDir } from './chunk-HSE2LOWO.js';
11
11
  import { fstatSync, mkdirSync, writeFileSync, chmodSync, rmSync, cpSync, readFileSync, existsSync, lstatSync } from 'fs';
12
12
  import { relative, join, dirname } from 'path';
13
13
 
@@ -391,7 +391,7 @@ async function stageGovernedContext(input) {
391
391
  const result = await materializeContext({
392
392
  cwd: tree,
393
393
  sessionId: `build-${input.buildId}`,
394
- home: contextHomeDir(configPath),
394
+ home: contextHomeDir(configPath, input.organizationId),
395
395
  cloud: { url, apiKey, appId },
396
396
  fetchImpl: signingFetchFor(input.fetchImpl, configPath, apiKey),
397
397
  designationLookup: DESIGNATION_LOOKUP,
@@ -473,7 +473,7 @@ async function prefetchGovernedContext(input) {
473
473
  try {
474
474
  const fetched = await fetchControlPlaneCommit({
475
475
  git: input.git ?? defaultGitRunner,
476
- home: contextHomeDir(input.configPath),
476
+ home: contextHomeDir(input.configPath, input.organizationId),
477
477
  repository: source.repository,
478
478
  sha: source.sha,
479
479
  remoteUrl: input.controlPlaneUrl(source.repository),
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-S6UM3N4R.js';
3
+ import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-HSE2LOWO.js';
4
4
  import { readlinkSync, realpathSync, mkdirSync, unlinkSync, symlinkSync, renameSync, readFileSync, writeFileSync, rmSync, existsSync, readdirSync } from 'fs';
5
5
  import { join, basename, sep, resolve } from 'path';
6
6
 
@@ -4,6 +4,6 @@ import { createRequire } from 'node:module';
4
4
  createRequire(import.meta.url);
5
5
 
6
6
  // src/runner/protocol.ts
7
- var RUNNER_PROTOCOL = 33;
7
+ var RUNNER_PROTOCOL = 35;
8
8
 
9
9
  export { RUNNER_PROTOCOL };
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { readCloudConfigStrict, readCloudConfig, cloudConfigPath } from './chunk-PJDQPF5N.js';
4
- import { signRunnerRequest, signerFor } from './chunk-5TXQFZHY.js';
3
+ import { readCloudConfigStrict, readCloudConfig, cloudConfigPath } from './chunk-HWVMRETT.js';
4
+ import { signRunnerRequest, signerFor } from './chunk-QOVUDIUI.js';
5
5
  import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
6
- import { PLAIN_VERSION, recordCliVersion, removeRecordedVersion } from './chunk-5BHIBJDA.js';
6
+ import { PLAIN_VERSION, recordCliVersion, removeRecordedVersion } from './chunk-OLM2TIOW.js';
7
7
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
8
- import { cliInvocation } from './chunk-CRB3POP4.js';
9
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
8
+ import { cliInvocation } from './chunk-FZKNTIOJ.js';
9
+ import { homeFromEnv } from './chunk-352DHUTP.js';
10
10
 
11
11
  createRequire(import.meta.url);
12
12
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { decodeWrappedCommand } from './chunk-URIZRCRY.js';
4
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
3
+ import { decodeWrappedCommand } from './chunk-KYDEBGJG.js';
4
+ import { homeFromEnv } from './chunk-352DHUTP.js';
5
5
  import { readFileSync, mkdirSync, appendFileSync, writeFileSync } from 'fs';
6
6
  import { spawn } from 'child_process';
7
7
  import { randomUUID, createHash } from 'crypto';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
3
+ import { homeFromEnv } from './chunk-352DHUTP.js';
4
4
  import { join, sep } from 'path';
5
5
  import { fileURLToPath } from 'url';
6
6
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { DEFAULT_UNIT_NAME } from './chunk-4YD7N6V3.js';
4
- import { RUNNER_FILE_MODE } from './chunk-S6UM3N4R.js';
3
+ import { DEFAULT_UNIT_NAME } from './chunk-7B6CKPNZ.js';
4
+ import { RUNNER_FILE_MODE } from './chunk-HSE2LOWO.js';
5
5
  import { claudeEnvPath, withoutCredentialLines, parseRunnerEnv } from './chunk-YLPJOUVF.js';
6
6
  import { existsSync, readFileSync, writeFileSync, renameSync, rmSync } from 'fs';
7
7
  import { join, dirname } from 'path';
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
3
+ import { launchRefusalForSession } from './chunk-AAGU5FJF.js';
4
4
  import { detectActiveSession, transcriptPathForSession } from './chunk-IP7BIBXJ.js';
5
- import { autoConnect } from './chunk-MRLJK4GZ.js';
6
- import { C } from './chunk-ANPNT6PM.js';
7
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-3KGXXTMN.js';
8
- import { readLatestProvenanceForSession } from './chunk-ZJSNLVCE.js';
9
- import { resolveRepoIdentity, defaultProjectsDir, findTranscripts, sessionIdFromPath, scrubText } from './chunk-GH2HEEOH.js';
10
- import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
5
+ import { autoConnect } from './chunk-YZSE7EYM.js';
6
+ import { C } from './chunk-2AM6Z5BP.js';
7
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-FNS2RJ5T.js';
8
+ import { readLatestProvenanceForSession } from './chunk-545P7JY7.js';
9
+ import { resolveRepoIdentity, defaultProjectsDir, findTranscripts, sessionIdFromPath, scrubText } from './chunk-TV2OQUWE.js';
10
+ import { launchedItemForSession } from './chunk-5WYT3PPE.js';
11
11
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
12
- import { cliInvocation } from './chunk-CRB3POP4.js';
13
- import { FindingBatchSchema, FindingsResponseSchema, SAME_PROBLEM_RULES } from './chunk-IXRUVR25.js';
14
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
12
+ import { cliInvocation } from './chunk-FZKNTIOJ.js';
13
+ import { FindingBatchSchema, FindingsResponseSchema, SAME_PROBLEM_RULES } from './chunk-YTTESG7K.js';
14
+ import { homeFromEnv } from './chunk-352DHUTP.js';
15
15
  import { readFileSync, existsSync } from 'fs';
16
16
  import { join, dirname, basename } from 'path';
17
17
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { isSameProcess } from './chunk-JBJTC3UU.js';
4
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-S6UM3N4R.js';
4
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-HSE2LOWO.js';
5
5
  import { existsSync, readFileSync, mkdirSync, writeFileSync, rmSync } from 'fs';
6
6
  import { dirname } from 'path';
7
7
 
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
3
+ import { launchRefusalForSession } from './chunk-AAGU5FJF.js';
4
4
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
5
- import { autoConnect } from './chunk-MRLJK4GZ.js';
6
- import { C } from './chunk-ANPNT6PM.js';
7
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-3KGXXTMN.js';
8
- import { resolveRepoIdentity } from './chunk-GH2HEEOH.js';
9
- import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
5
+ import { autoConnect } from './chunk-YZSE7EYM.js';
6
+ import { C } from './chunk-2AM6Z5BP.js';
7
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-FNS2RJ5T.js';
8
+ import { resolveRepoIdentity } from './chunk-TV2OQUWE.js';
9
+ import { launchedItemForSession } from './chunk-5WYT3PPE.js';
10
10
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
11
- import { CriteriaListSchema } from './chunk-IXRUVR25.js';
12
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
11
+ import { CriteriaListSchema } from './chunk-YTTESG7K.js';
12
+ import { homeFromEnv } from './chunk-352DHUTP.js';
13
13
  import { readFileSync } from 'fs';
14
14
 
15
15
  createRequire(import.meta.url);
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { BUILD_HOME } from './chunk-YLPJOUVF.js';
4
+ import { readdirSync } from 'fs';
4
5
  import { join, dirname } from 'path';
5
6
 
6
7
  createRequire(import.meta.url);
@@ -25,14 +26,35 @@ function jobDir(configPath, queue, item, claimId, attempt) {
25
26
  function attemptStamp(at) {
26
27
  return at.toISOString().replace(/[-:]/g, "").replace(/\.\d{3}Z$/, "Z");
27
28
  }
28
- function imagesDir(configPath) {
29
- return join(runnerDir(configPath), "images");
29
+ var ORGS_DIR = "orgs";
30
+ function orgStore(configPath, organizationId) {
31
+ return orgStoreIn(runnerDir(configPath), organizationId);
30
32
  }
31
- function repoCacheDir(configPath, owner, name) {
32
- return join(runnerDir(configPath), "repos", owner, name);
33
+ var ORGANIZATION_FOLDER = /^[A-Za-z0-9_-]{1,64}$/;
34
+ function orgStoreIn(runnerDirPath, organizationId) {
35
+ if (organizationId === void 0) return runnerDirPath;
36
+ if (!ORGANIZATION_FOLDER.test(organizationId)) throw new Error(`cannot keep files for the organization ${JSON.stringify(organizationId)}`);
37
+ return join(runnerDirPath, ORGS_DIR, organizationId);
33
38
  }
34
- function builderCacheDiskPath(configPath, owner, name) {
35
- return join(imagesDir(configPath), owner, name, "builder-cache.ext4");
39
+ function orgsDir(configPath) {
40
+ return join(runnerDir(configPath), ORGS_DIR);
41
+ }
42
+ function storeScopes(configPath) {
43
+ let organizations = [];
44
+ try {
45
+ organizations = readdirSync(orgsDir(configPath), { withFileTypes: true }).filter((entry) => entry.isDirectory() && ORGANIZATION_FOLDER.test(entry.name)).map((entry) => entry.name);
46
+ } catch {
47
+ }
48
+ return [void 0, ...organizations.sort()];
49
+ }
50
+ function imagesDir(configPath, organizationId) {
51
+ return join(orgStore(configPath, organizationId), "images");
52
+ }
53
+ function repoCacheDir(configPath, owner, name, organizationId) {
54
+ return join(orgStore(configPath, organizationId), "repos", owner, name);
55
+ }
56
+ function builderCacheDiskPath(configPath, owner, name, organizationId) {
57
+ return join(imagesDir(configPath, organizationId), owner, name, "builder-cache.ext4");
36
58
  }
37
59
  function buildsDir(configPath) {
38
60
  return join(runnerDir(configPath), "builds");
@@ -49,8 +71,11 @@ function mirrorDir(runnerDirPath, owner, name) {
49
71
  function spoolDir(runnerDirPath) {
50
72
  return join(runnerDirPath, "spool");
51
73
  }
52
- function contextHomeDir(configPath) {
53
- return join(runnerDir(configPath), "context-home");
74
+ function contextHomeDir(configPath, organizationId) {
75
+ return join(orgStore(configPath, organizationId), "context-home");
76
+ }
77
+ function orgHomeDir(configPath, organizationId) {
78
+ return join(orgStore(configPath, organizationId), "home");
54
79
  }
55
80
  function stagedContextDir(buildDirPath) {
56
81
  return join(buildDirPath, "context");
@@ -92,8 +117,8 @@ function jobConsolePath(jobDirPath) {
92
117
  function builderConsolePath(buildDirPath) {
93
118
  return join(buildDirPath, "console.log");
94
119
  }
95
- function imageBuildLogsDir(configPath, owner, name) {
96
- return join(imagesDir(configPath), owner, name, "builds");
120
+ function imageBuildLogsDir(configPath, owner, name, organizationId) {
121
+ return join(imagesDir(configPath, organizationId), owner, name, "builds");
97
122
  }
98
123
 
99
- export { RUNNER_DIR_MODE, RUNNER_FILE_MODE, SHIM_DIR, attemptStamp, buildDir, builderCacheDiskPath, builderConsolePath, buildsDir, contextHomeDir, deliveryDir, diskTemplatesDir, ghConfigDir, hostKeyPath, imageBuildLogsDir, imagesDir, jobConsolePath, jobDir, jobsDir, keptContextDir, mirrorDir, pidFilePath, repoCacheDir, rootfsDir, rootfsPathFor, runnerDir, runnerDirOfBuild, spoolDir, stagedContextDir, vmAssetsDir, vsockPath };
124
+ export { RUNNER_DIR_MODE, RUNNER_FILE_MODE, SHIM_DIR, attemptStamp, buildDir, builderCacheDiskPath, builderConsolePath, buildsDir, contextHomeDir, deliveryDir, diskTemplatesDir, ghConfigDir, hostKeyPath, imageBuildLogsDir, imagesDir, jobConsolePath, jobDir, jobsDir, keptContextDir, mirrorDir, orgHomeDir, orgStore, orgStoreIn, pidFilePath, repoCacheDir, rootfsDir, rootfsPathFor, runnerDir, runnerDirOfBuild, spoolDir, stagedContextDir, storeScopes, vmAssetsDir, vsockPath };
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
4
- import { autoConnect } from './chunk-MRLJK4GZ.js';
5
- import { workPageUrl } from './chunk-HFOZTCTN.js';
6
- import { C } from './chunk-ANPNT6PM.js';
7
- import { sanitizeTerminal } from './chunk-VEVNGDTP.js';
8
- import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-3KGXXTMN.js';
9
- import { signRunnerRequest } from './chunk-5TXQFZHY.js';
4
+ import { autoConnect } from './chunk-YZSE7EYM.js';
5
+ import { workPageUrl } from './chunk-N2OG4RN6.js';
6
+ import { C } from './chunk-2AM6Z5BP.js';
7
+ import { sanitizeTerminal } from './chunk-PDK35AR4.js';
8
+ import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-FNS2RJ5T.js';
9
+ import { signRunnerRequest } from './chunk-QOVUDIUI.js';
10
10
  import { readRepoConnection } from './chunk-BJ3KTMDH.js';
11
- import { resolveRepoIdentity } from './chunk-GH2HEEOH.js';
11
+ import { resolveRepoIdentity } from './chunk-TV2OQUWE.js';
12
12
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
13
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
13
+ import { homeFromEnv } from './chunk-352DHUTP.js';
14
14
 
15
15
  createRequire(import.meta.url);
16
16
 
@@ -471,7 +471,7 @@ async function runWorkLinkSession(opts) {
471
471
  return await linkSession(opts);
472
472
  } catch (err) {
473
473
  if (opts.logFailures) {
474
- const { logHookError } = await import('./hook-fast-GOH4T6SN.js');
474
+ const { logHookError } = await import('./hook-fast-AELCXUNA.js');
475
475
  const reason = err instanceof Error ? err.message : String(err);
476
476
  logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
477
477
  }
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { homeFromEnv } from './chunk-VNVZDWO3.js';
3
+ import { homeFromEnv } from './chunk-352DHUTP.js';
4
4
  import { existsSync, readFileSync, mkdirSync, writeFileSync, chmodSync } from 'fs';
5
5
  import { join } from 'path';
6
6