@outerlayer/cli 0.22.2 → 0.24.0

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 (136) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +4 -0
  3. package/dist/agent-setup-QQYRBPK2.js +30 -0
  4. package/dist/{artifact-link-cmd-OWRI5AJX.js → artifact-link-cmd-LEI6EOZE.js} +2 -2
  5. package/dist/{bridge-QFN3KJP6.js → bridge-4ZARDVGS.js} +2 -2
  6. package/dist/{build-6WRNZPVR.js → build-OVZIT2G2.js} +5 -5
  7. package/dist/build-info.json +1 -1
  8. package/dist/{builder-G3MLDMTI.js → builder-MECDEKXX.js} +6 -6
  9. package/dist/{check-N6WLZCER.js → check-YYKNYFNI.js} +46 -44
  10. package/dist/{chunk-IPS2JCHK.js → chunk-5ECUMU53.js} +7 -7
  11. package/dist/{chunk-XR56WEA5.js → chunk-5XCAPBE2.js} +4 -4
  12. package/dist/{chunk-KOIMUHIS.js → chunk-6GSA2SKT.js} +20 -20
  13. package/dist/{chunk-HWZCE745.js → chunk-755WXDBI.js} +2 -2
  14. package/dist/{chunk-SFHR45FA.js → chunk-A62QFN2M.js} +3 -3
  15. package/dist/{chunk-URWYRAIC.js → chunk-BN3CSI7S.js} +0 -2
  16. package/dist/{chunk-ZCXP35T3.js → chunk-BOQY756V.js} +9 -8
  17. package/dist/{chunk-BVR6MQLS.js → chunk-BUBCPP3F.js} +3 -3
  18. package/dist/{chunk-G3IJ3N6F.js → chunk-BUP5N3X6.js} +1 -1
  19. package/dist/{chunk-WXJXHZVB.js → chunk-CZUH2SLQ.js} +1 -1
  20. package/dist/{chunk-AEKSX4EY.js → chunk-D4AMAEZ7.js} +13 -12
  21. package/dist/{chunk-U6RKHNC7.js → chunk-D7K446H6.js} +8 -8
  22. package/dist/{chunk-V5CG75NX.js → chunk-D7X5ITVT.js} +1 -1
  23. package/dist/{chunk-OBCFK4QD.js → chunk-DG2ULWM6.js} +2 -2
  24. package/dist/{chunk-SNVXHNU7.js → chunk-E4OUL7ZP.js} +5 -5
  25. package/dist/{chunk-B42BIYC6.js → chunk-F2W2IYNP.js} +3 -3
  26. package/dist/{chunk-JD6GWYY7.js → chunk-F7Y2USIM.js} +5 -5
  27. package/dist/{chunk-QS43O4DR.js → chunk-FKXGQOF5.js} +1 -1
  28. package/dist/{chunk-JV4YGAAW.js → chunk-FQPN5S4Q.js} +4 -4
  29. package/dist/{chunk-XACXXKQ5.js → chunk-FWEWFW3F.js} +1 -1
  30. package/dist/{chunk-WKSBSEWT.js → chunk-GU4PKXN7.js} +13 -13
  31. package/dist/{chunk-2CPOAPU4.js → chunk-H6IUKXXI.js} +90 -24
  32. package/dist/{chunk-5OCIHFGE.js → chunk-HBISTTG3.js} +32 -23
  33. package/dist/{chunk-EFB3FGLC.js → chunk-HHXBOTRO.js} +1 -1
  34. package/dist/chunk-IDSHLKQA.js +66 -0
  35. package/dist/chunk-JKNYTNYD.js +151 -0
  36. package/dist/{chunk-IHNQWF6F.js → chunk-KF37SUDM.js} +1 -1
  37. package/dist/{chunk-4AVDD7VX.js → chunk-LBCZXXOX.js} +2 -2
  38. package/dist/{chunk-NYTZ7HVN.js → chunk-LY2L3O2O.js} +1 -1
  39. package/dist/{chunk-USWVXQIH.js → chunk-MQ743JX3.js} +3 -3
  40. package/dist/{chunk-CQAEV3Z5.js → chunk-NGZID7UI.js} +1 -1
  41. package/dist/{chunk-UF5L4BAI.js → chunk-NTQTDCYR.js} +1 -1
  42. package/dist/{chunk-2Q3PZ42G.js → chunk-PDIM5T65.js} +1 -1
  43. package/dist/{chunk-OW52QLK3.js → chunk-PVRBE7S4.js} +1 -1
  44. package/dist/{chunk-7VUK5RFS.js → chunk-QZBXLLTV.js} +36 -1
  45. package/dist/{chunk-WFSUUUAN.js → chunk-RKOTJQVG.js} +1 -1
  46. package/dist/{chunk-FQE5RDHI.js → chunk-RVYOOYOA.js} +7 -7
  47. package/dist/{chunk-IMCVQF5F.js → chunk-TQ6Y7YV6.js} +6 -6
  48. package/dist/{chunk-I2UOAV7X.js → chunk-TQMI335S.js} +4 -1
  49. package/dist/{chunk-3AZYLAJC.js → chunk-TTLVQZSH.js} +4 -4
  50. package/dist/{chunk-EMUNEAQK.js → chunk-V5Q3S4NM.js} +19 -7
  51. package/dist/{chunk-FVDVC2GF.js → chunk-VBEXKEBV.js} +1 -1
  52. package/dist/{chunk-V7SAQ645.js → chunk-VJBFQP3H.js} +21 -12
  53. package/dist/{chunk-ZNPE7FW5.js → chunk-VPEGE3QZ.js} +1 -1
  54. package/dist/{chunk-276D7BJ7.js → chunk-VV7ZD5LR.js} +1 -1
  55. package/dist/{chunk-W3SWJ2TD.js → chunk-VWFOKRYS.js} +5 -2
  56. package/dist/{chunk-4542B3RR.js → chunk-W7O4LA4E.js} +3 -3
  57. package/dist/{chunk-4OYKJJ2V.js → chunk-WH2QV3UL.js} +86 -6
  58. package/dist/{chunk-XCRZTXRL.js → chunk-WX2WEERU.js} +63 -43
  59. package/dist/{chunk-VSUXCMMH.js → chunk-XFGL53GU.js} +51 -33
  60. package/dist/{chunk-EAQSOE62.js → chunk-XSPA5ODY.js} +21 -19
  61. package/dist/{chunk-QZX6DAAW.js → chunk-ZFLOFAUG.js} +11 -11
  62. package/dist/{claude-launcher-QD3C427Y.js → claude-launcher-JCPSHDZQ.js} +5 -5
  63. package/dist/{cli-A2Y67WAB.js → cli-ZTBH3FBG.js} +173 -137
  64. package/dist/{command-Q5Q2EIO4.js → command-DO4TERRT.js} +34 -33
  65. package/dist/{config-H4QS332G.js → config-7Z5DHSGY.js} +2 -2
  66. package/dist/connect-cmd-NY5LIKVC.js +25 -0
  67. package/dist/container-start-OHBUZEJJ.js +170 -0
  68. package/dist/{context-cleanup-DSA3HGQU.js → context-cleanup-LTH77FC3.js} +3 -3
  69. package/dist/{control-plane-launch-HE6OSWKO.js → control-plane-launch-GKGI6HJA.js} +11 -11
  70. package/dist/{dist-7IH56ELA.js → dist-2APO44JG.js} +2 -2
  71. package/dist/{docker-JU422JL7.js → docker-RKGBJESN.js} +6 -6
  72. package/dist/{doctor-BRN4BGMA.js → doctor-DOAFZV4O.js} +47 -34
  73. package/dist/{emit-artifact-cmd-GPAJCCUC.js → emit-artifact-cmd-VZHIDPXQ.js} +18 -15
  74. package/dist/emit-cmd-WQH2NK7H.js +15 -0
  75. package/dist/{emit-criteria-cmd-R3FKHSQG.js → emit-criteria-cmd-SYLBCWHW.js} +15 -12
  76. package/dist/{emit-finding-cmd-IK7RAVP5.js → emit-finding-cmd-52M43NPC.js} +15 -12
  77. package/dist/{emit-result-cmd-5FJTF7YD.js → emit-result-cmd-BTMTGDAV.js} +18 -15
  78. package/dist/{emit-step-cmd-VRTD5YPP.js → emit-step-cmd-6XTJITZT.js} +16 -13
  79. package/dist/{exec-client-ATPF2DDB.js → exec-client-CKPK62K2.js} +3 -3
  80. package/dist/governing-source-GWN7GVEN.js +35 -0
  81. package/dist/{guest-init-2OZ4YC7R.js → guest-init-ZBL5CN7Y.js} +4 -4
  82. package/dist/{hook-fast-QUGEI2IT.js → hook-fast-3JL4PXLG.js} +1 -1
  83. package/dist/{host-key-ATB23GI3.js → host-key-W2DLZGZ7.js} +3 -3
  84. package/dist/image-tag-AO4RBAKW.js +10 -0
  85. package/dist/{import-capture-cmd-Q56DDZVO.js → import-capture-cmd-TCOKNVBM.js} +12 -7
  86. package/dist/{import-ruler-cmd-T6LLO6Q7.js → import-ruler-cmd-VJOHOJQ7.js} +2 -2
  87. package/dist/index.js +4 -4
  88. package/dist/{init-X7FCQDFX.js → init-EQTR7AEF.js} +32 -31
  89. package/dist/init-TSQ3EOQW.js +52 -0
  90. package/dist/{init-cmd-VCKH2DUQ.js → init-cmd-AF2MH36A.js} +24 -23
  91. package/dist/init-update-SHISHMXV.js +555 -0
  92. package/dist/{install-SFACZU7E.js → install-ORQC26ZE.js} +4 -4
  93. package/dist/{install-cmd-6HTP7I43.js → install-cmd-4LA3UJZ4.js} +6 -6
  94. package/dist/layout-UOJQGEPW.js +10 -0
  95. package/dist/{login-browser-BN5UKPHS.js → login-browser-4OMZFP3U.js} +4 -3
  96. package/dist/{logout-cmd-RZFWTNYD.js → logout-cmd-5V5MMBSY.js} +2 -2
  97. package/dist/{logs-N3ZX7HFV.js → logs-5EPHIPZB.js} +2 -2
  98. package/dist/loop-4WUCS5JP.js +77 -0
  99. package/dist/machine-6UNLIPLE.js +47 -0
  100. package/dist/{mcp-install-cmd-GD4QUP7Z.js → mcp-install-cmd-GGWB3JJ2.js} +2 -2
  101. package/dist/{mcp-serve-cmd-TQSPFRC7.js → mcp-serve-cmd-KMWEKM7C.js} +5 -5
  102. package/dist/{paths-AKX2OOLF.js → paths-XY5ADO32.js} +2 -2
  103. package/dist/{pending-7SGWZCEH.js → pending-35J3ZPLR.js} +3 -3
  104. package/dist/{pidfile-G2J5WBQS.js → pidfile-OJ7RP4Q2.js} +3 -3
  105. package/dist/{record-Q4IEYIVV.js → record-BEJB4J7N.js} +3 -3
  106. package/dist/{runner-env-GZHXM27A.js → runner-env-ZJWJOJKQ.js} +5 -5
  107. package/dist/{runner-identity-FTHZFMGY.js → runner-identity-2OOUJSFJ.js} +6 -6
  108. package/dist/{runner-key-O42EUXQU.js → runner-key-WDFBSJRX.js} +32 -31
  109. package/dist/{session-sender-HF6DXFA2.js → session-sender-X3BBQZMF.js} +19 -16
  110. package/dist/{spec-cmd-ADPH236D.js → spec-cmd-QRF5YXKK.js} +16 -13
  111. package/dist/{starter-pack-5EQYGSJF.js → starter-pack-55EFILC5.js} +7 -4
  112. package/dist/{status-LXFIVGP3.js → status-ZCAAF6MD.js} +43 -34
  113. package/dist/{sync-cmd-5XS3CUV5.js → sync-cmd-UQK3RYAC.js} +18 -15
  114. package/dist/{watch-FBZHZV56.js → watch-MOQ3GQTE.js} +18 -15
  115. package/dist/{work-claim-cmd-LIIINECF.js → work-claim-cmd-RT343CLA.js} +19 -16
  116. package/dist/{work-cmd-SM6DY2WK.js → work-cmd-APXSER2D.js} +16 -13
  117. package/dist/{work-comment-cmd-VYVXGT4W.js → work-comment-cmd-AT5NUYUU.js} +16 -13
  118. package/dist/{work-logs-cmd-XZSCWWMW.js → work-logs-cmd-Z5DMNEJP.js} +16 -13
  119. package/dist/{work-open-pr-cmd-YZNC3P3R.js → work-open-pr-cmd-ZTS6MJHL.js} +17 -14
  120. package/dist/{work-pr-cmd-AMN23KFJ.js → work-pr-cmd-IWZCC3WH.js} +16 -13
  121. package/dist/{work-stop-cmd-HSR2GOJJ.js → work-stop-cmd-DCAWFDZC.js} +16 -13
  122. package/package.json +1 -1
  123. package/skill-pack/maintained/outerlayer-build/references/agent-briefs.md +7 -1
  124. package/skill-pack/maintained/outerlayer-build/references/criteria-judge.md +10 -0
  125. package/skill-pack/maintained/outerlayer-build/references/review-briefs.md +4 -0
  126. package/skill-pack/maintained/outerlayer-cli/SKILL.md +5 -3
  127. package/dist/agent-setup-KXPDPTAJ.js +0 -27
  128. package/dist/connect-cmd-TNGEIWCA.js +0 -22
  129. package/dist/emit-cmd-3W5IO5ET.js +0 -14
  130. package/dist/governing-source-WM736XR4.js +0 -34
  131. package/dist/init-U3I43XCP.js +0 -51
  132. package/dist/init-update-TCMH7M3Q.js +0 -210
  133. package/dist/loop-P3QDQOE5.js +0 -75
  134. package/dist/machine-EEFOW32K.js +0 -46
  135. package/dist/{chunk-F35VMF5M.js → chunk-GOSFARMS.js} +1 -1
  136. package/dist/{chunk-DIB2WLBL.js → chunk-YVZJ6GKF.js} +1 -1
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-EMUNEAQK.js';
4
- import { resolveGatewayCredentials } from './chunk-QS43O4DR.js';
3
+ import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-V5Q3S4NM.js';
4
+ import { resolveGatewayCredentials } from './chunk-FKXGQOF5.js';
5
5
  import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
6
- import { resolveRepoIdentity } from './chunk-AEKSX4EY.js';
6
+ import { resolveRepoIdentity } from './chunk-D4AMAEZ7.js';
7
7
  import { cliInvocation } from './chunk-CRB3POP4.js';
8
8
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
9
9
  import { openSync, fstatSync, readSync, closeSync } from 'fs';
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
4
- import { autoConnect, detectActiveSession } from './chunk-B42BIYC6.js';
5
- import { acquireSpoolLockAt } from './chunk-G3IJ3N6F.js';
6
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-QS43O4DR.js';
7
- import { resolveRepoIdentity } from './chunk-AEKSX4EY.js';
4
+ import { autoConnect, detectActiveSession } from './chunk-F2W2IYNP.js';
5
+ import { acquireSpoolLockAt } from './chunk-BUP5N3X6.js';
6
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-FKXGQOF5.js';
7
+ import { resolveRepoIdentity } from './chunk-D4AMAEZ7.js';
8
8
  import { C } from './chunk-ANPNT6PM.js';
9
9
  import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
10
10
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
11
- import { StepNameSchema, StepBodySchema } from './chunk-7VUK5RFS.js';
11
+ import { StepNameSchema, StepBodySchema } from './chunk-QZBXLLTV.js';
12
12
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
13
13
  import { randomUUID } from 'crypto';
14
14
  import { readFileSync, existsSync, mkdirSync, writeFileSync, renameSync, appendFileSync } from 'fs';
@@ -5,7 +5,7 @@ import { readCloudConfig, cloudConfigPath } from './chunk-EABW6AJQ.js';
5
5
  import { cliInvocation } from './chunk-CRB3POP4.js';
6
6
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
7
7
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
8
- import { signRunnerRequest, signerFor } from './chunk-OW52QLK3.js';
8
+ import { signRunnerRequest, signerFor } from './chunk-PVRBE7S4.js';
9
9
 
10
10
  createRequire(import.meta.url);
11
11
 
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { compareVersions } from './chunk-I2UOAV7X.js';
4
- import { launcherPath, writeLauncher, LauncherWriteError, pathNotes } from './chunk-EFB3FGLC.js';
5
- import { currentVersion, currentLink, isInLayout, packageRootIn, versionDir, switchCurrent, execStartLine } from './chunk-276D7BJ7.js';
6
- import { RUNNER_DIR_MODE } from './chunk-IHNQWF6F.js';
3
+ import { launcherPath, writeLauncher, LauncherWriteError, pathNotes } from './chunk-HHXBOTRO.js';
4
+ import { currentVersion, currentLink, isInLayout, packageRootIn, versionDir, switchCurrent, execStartLine } from './chunk-VV7ZD5LR.js';
5
+ import { compareVersions } from './chunk-TQMI335S.js';
6
+ import { RUNNER_DIR_MODE } from './chunk-KF37SUDM.js';
7
7
  import { realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync } from 'fs';
8
8
  import { dirname, sep, join } from 'path';
9
9
 
@@ -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-IHNQWF6F.js';
4
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-KF37SUDM.js';
5
5
  import { existsSync, readFileSync, rmSync, mkdirSync, writeFileSync } from 'fs';
6
6
  import { dirname } from 'path';
7
7
 
@@ -1,23 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { readDefaultBranchHead, cloneRepository, buildRepositoryImage } from './chunk-3AZYLAJC.js';
3
+ import { readDefaultBranchHead, cloneRepository, buildRepositoryImage } from './chunk-TTLVQZSH.js';
4
+ import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
4
5
  import { currentCliBuild } from './chunk-OGFGZQA3.js';
5
- import { createDockerHost, builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, containerRunArgs, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, containerExecArgs, childEnvironment, JUDGE_DIR, JUDGE_REPORT, MAX_REPORT_BYTES, spawnRun } from './chunk-XR56WEA5.js';
6
+ import { createDockerHost, builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, containerRunArgs, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, containerExecArgs, childEnvironment, JUDGE_DIR, JUDGE_REPORT, MAX_REPORT_BYTES, spawnRun } from './chunk-5XCAPBE2.js';
6
7
  import { RecipeError, CLAUDE_CODE_VERSION, firecrackerArch, MICROVM_ARCHES, DEFAULT_BASE_IMAGE, GUEST_HELPER_SHA256, GUEST_ASSETS_BASE_URL, GUEST_KERNEL_SHA256, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, FIRECRACKER_VERSION, GUEST_ASSETS_VERSION } from './chunk-3W333NFO.js';
7
- import { execCapture } from './chunk-NYTZ7HVN.js';
8
- import { GUEST_CID } from './chunk-2Q3PZ42G.js';
9
- import { describeCallFailure, controlPlaneTokenFailure, refusalCode, resolveGoverningSource, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, shimScript } from './chunk-IMCVQF5F.js';
10
- import { WorkCommandError } from './chunk-FQE5RDHI.js';
8
+ import { execCapture } from './chunk-LY2L3O2O.js';
9
+ import { GUEST_CID } from './chunk-PDIM5T65.js';
10
+ import { describeCallFailure, controlPlaneTokenFailure, refusalCode, resolveGoverningSource, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, shimScript } from './chunk-TQ6Y7YV6.js';
11
+ import { WorkCommandError } from './chunk-RVYOOYOA.js';
11
12
  import { hostAllowed } from './chunk-UXYLWVTQ.js';
12
13
  import { parseDuKilobytes } from './chunk-7RQ73DLO.js';
13
- import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
14
- import { sharedSkillNames, skillConflictMessage } from './chunk-ZNPE7FW5.js';
14
+ import { sharedSkillNames, skillConflictMessage } from './chunk-VPEGE3QZ.js';
15
15
  import { versionAtLeast, MINIMUM_CLAUDE_VERSION } from './chunk-HCVLP7XA.js';
16
- import { setCustomScrubbers, setLocalIdentity, setRepoRoot, parseTranscript, scrubDeep, scrubText } from './chunk-AEKSX4EY.js';
17
- import { orderSessions, extractFacts, sessionsToTimeline } from './chunk-WFSUUUAN.js';
18
- import { downconvertSession } from './chunk-7VUK5RFS.js';
19
- import { rootfsPathFor, diskTemplatesDir, RUNNER_FILE_MODE, deliveryDir, ghConfigDir, runnerDirOfBuild, spoolDir, mirrorDir, buildDir, RUNNER_DIR_MODE, SHIM_DIR, vmAssetsDir } from './chunk-IHNQWF6F.js';
20
- import { repositoriesOf, primaryOf, RELAY_PORT, repositoryPath, CHECKOUT_DIR, lifecycleWorkdir, claudeCredential, buildEnvironment, startBuildServices, checkEnvironment, AGENT_CREDENTIAL_MISSING, checkoutPath, JOB_MOUNT } from './chunk-URWYRAIC.js';
16
+ import { setCustomScrubbers, setLocalIdentity, setRepoRoot, parseTranscript, scrubDeep, scrubText } from './chunk-D4AMAEZ7.js';
17
+ import { orderSessions, extractFacts, sessionsToTimeline } from './chunk-RKOTJQVG.js';
18
+ import { downconvertSession } from './chunk-QZBXLLTV.js';
19
+ import { rootfsPathFor, diskTemplatesDir, RUNNER_FILE_MODE, deliveryDir, ghConfigDir, runnerDirOfBuild, spoolDir, mirrorDir, buildDir, RUNNER_DIR_MODE, SHIM_DIR, vmAssetsDir } from './chunk-KF37SUDM.js';
20
+ import { repositoriesOf, primaryOf, RELAY_PORT, repositoryPath, CHECKOUT_DIR, lifecycleWorkdir, claudeCredential, buildEnvironment, startBuildServices, checkEnvironment, AGENT_CREDENTIAL_MISSING, checkoutPath, JOB_MOUNT } from './chunk-BN3CSI7S.js';
21
21
  import { RELAY_USER, RELAY_ID, UNKNOWN_TRANSPORT_REASON, MAX_MALFORMED_SESSIONS, MALFORMED_REASON, MAX_OPEN_STREAMS, STREAM_WINDOW, SESSION_WINDOW, targetOfPath } from './chunk-GISNHSYL.js';
22
22
  import { readFileSync, existsSync, mkdirSync, chmodSync, truncateSync, rmSync, writeFileSync, readdirSync, lstatSync, copyFileSync, accessSync, constants, statSync, rmdirSync, renameSync, unlinkSync, openSync, closeSync, mkdtempSync, createWriteStream, createReadStream } from 'fs';
23
23
  import { join, dirname, basename } from 'path';
@@ -1,29 +1,30 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { releaseLease, isUnfinished, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, hostCommandEnvironment, execArgv, microVmCommandLine, runCommand, commandLogOffset, execCommandLine, startSender, startHostServices, finishJob, isContainerTracked, probeCommand, appendCommandLog, judgeProbe, EXIT_CODE_FILE, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, hookLimitsFor, AttemptLogBook, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, listTrackedJobs, restartSender, ALREADY_RELEASED } from './chunk-KOIMUHIS.js';
4
- import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-UF5L4BAI.js';
3
+ import { releaseLease, isUnfinished, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, hostCommandEnvironment, execArgv, microVmCommandLine, runCommand, commandLogOffset, execCommandLine, startSender, startHostServices, finishJob, isContainerTracked, probeCommand, appendCommandLog, judgeProbe, EXIT_CODE_FILE, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, hookLimitsFor, AttemptLogBook, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, listTrackedJobs, restartSender, ALREADY_RELEASED } from './chunk-6GSA2SKT.js';
4
+ import { writePendingUpdate } from './chunk-NGZID7UI.js';
5
+ import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-NTQTDCYR.js';
5
6
  import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
6
- import { compareVersions, satisfiesRange } from './chunk-I2UOAV7X.js';
7
7
  import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-YETTWTAY.js';
8
8
  import { RUNNER_PROTOCOL } from './chunk-TPKYTORP.js';
9
- import { writePendingUpdate } from './chunk-CQAEV3Z5.js';
10
- import { currentSkillCommand, formerSkillProblem, placeholderQueues, placeholderProblem } from './chunk-IPS2JCHK.js';
9
+ import { currentSkillCommand, formerSkillProblem, placeholderQueues, placeholderProblem } from './chunk-5ECUMU53.js';
11
10
  import { freeBytes, formatBytes } from './chunk-YYYRBYWG.js';
12
- import { writeMarker, readMarker, currentVersion, removeMarker, entryIn, versionDir, startedThroughCurrent, switchCurrent, cleanVersions, isInLayout, stagingDir } from './chunk-276D7BJ7.js';
11
+ import { writeMarker, readMarker, currentVersion, removeMarker, entryIn, versionDir, startedThroughCurrent, switchCurrent, cleanVersions, isInLayout, stagingDir } from './chunk-VV7ZD5LR.js';
13
12
  import { RepoFilter } from './chunk-TBT347UY.js';
14
- import { checkFit } from './chunk-OBCFK4QD.js';
15
- import { LEASE_SECONDS, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, lifecycleSteps, lifecycleFailureReason, prepareBranch, containerCommandExec, measureDisk, setUpRunnerCgroup, createContainerRuntime, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied } from './chunk-WKSBSEWT.js';
16
- import { writeJobFile, ensureRunnerIdentity, readJobFile, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun, BUILD_LABEL, RUNNER_LABEL, readJobFileChecked } from './chunk-XR56WEA5.js';
17
- import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-IMCVQF5F.js';
18
- import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-FQE5RDHI.js';
19
- import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-V5CG75NX.js';
20
- import { exceedsDisk } from './chunk-7RQ73DLO.js';
21
- import { claimPidFile, readPidFile, releasePidFile } from './chunk-XACXXKQ5.js';
13
+ import { LEASE_SECONDS, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, lifecycleSteps, lifecycleFailureReason, prepareBranch, containerCommandExec, measureDisk, setUpRunnerCgroup, createContainerRuntime, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied } from './chunk-GU4PKXN7.js';
14
+ import { checkFit } from './chunk-DG2ULWM6.js';
15
+ import { tagToPull, pullInstruction, imageTag, writeUpdateStatus } from './chunk-IDSHLKQA.js';
16
+ import { isVersion, compareVersions, satisfiesRange } from './chunk-TQMI335S.js';
17
+ import { claimPidFile, readPidFile, releasePidFile } from './chunk-FWEWFW3F.js';
22
18
  import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
19
+ import { writeJobFile, ensureRunnerIdentity, readJobFile, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun, BUILD_LABEL, RUNNER_LABEL, readJobFileChecked } from './chunk-5XCAPBE2.js';
20
+ import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-TQ6Y7YV6.js';
21
+ import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-RVYOOYOA.js';
22
+ import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-D7X5ITVT.js';
23
+ import { exceedsDisk } from './chunk-7RQ73DLO.js';
23
24
  import { resolveVersion } from './chunk-RA3O54FC.js';
24
- import { loadHostKey, ensureHostKey, signerFor } from './chunk-OW52QLK3.js';
25
- import { RUNNER_DIR_MODE, runnerDir, buildDir, attemptStamp, jobDir, RUNNER_FILE_MODE, jobsDir, pidFilePath, spoolDir, rootfsDir } from './chunk-IHNQWF6F.js';
26
- import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, sharedUserEnvironment, JOB_MOUNT, claudeCredential } from './chunk-URWYRAIC.js';
25
+ import { loadHostKey, ensureHostKey, signerFor } from './chunk-PVRBE7S4.js';
26
+ import { RUNNER_DIR_MODE, runnerDir, buildDir, attemptStamp, jobDir, RUNNER_FILE_MODE, jobsDir, pidFilePath, spoolDir, rootfsDir } from './chunk-KF37SUDM.js';
27
+ import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, sharedUserEnvironment, JOB_MOUNT, claudeCredential } from './chunk-BN3CSI7S.js';
27
28
  import { COMMAND_LOST_REASON, CONTAINER_STOPPED_REASON } from './chunk-GISNHSYL.js';
28
29
  import { randomBytes } from 'crypto';
29
30
  import { mkdirSync, existsSync, chmodSync, writeFileSync, renameSync, statSync, readdirSync, readFileSync, rmSync, closeSync, openSync, constants, lstatSync } from 'fs';
@@ -1165,6 +1166,10 @@ function selfUpdateBlocker(configPath, entryPath, own) {
1165
1166
  return void 0;
1166
1167
  }
1167
1168
  function considerNamedVersion(state, named) {
1169
+ if (state.deps.image !== void 0) {
1170
+ considerNamedImage(state, named);
1171
+ return;
1172
+ }
1168
1173
  const update = state.deps.update;
1169
1174
  if (update === void 0 || named === void 0) return;
1170
1175
  const configPath = state.config.configPath;
@@ -1187,6 +1192,34 @@ function considerNamedVersion(state, named) {
1187
1192
  logOf(state).line(`this runner cannot update itself to ${named}: ${blocker}`);
1188
1193
  }
1189
1194
  }
1195
+ function considerNamedImage(state, named) {
1196
+ if (named !== void 0 && !isVersion(named)) named = void 0;
1197
+ if (named !== void 0) state.imageNamed = named;
1198
+ recordImageStatus(state);
1199
+ const own = ownVersionOf(state.deps);
1200
+ if (named === void 0 || state.imageLogged === named || (compareVersions(own, named) ?? 0) >= 0) return;
1201
+ state.imageLogged = named;
1202
+ logOf(state).line(`the factory names ${named}, newer than the ${own} this image runs \xB7 ${pullInstruction(imageTag(named))}`);
1203
+ }
1204
+ function recordImageStatus(state) {
1205
+ if (state.deps.image === void 0) return;
1206
+ const named = state.imageNamed;
1207
+ const record = {
1208
+ own: ownVersionOf(state.deps),
1209
+ ...named === void 0 ? {} : { named, tag: imageTag(named) },
1210
+ upgradeRequired: state.upgradeRefused === true,
1211
+ at: nowOf(state).toISOString()
1212
+ };
1213
+ const key = JSON.stringify({ ...record, at: void 0 });
1214
+ if (state.imageRecord === key) return;
1215
+ try {
1216
+ writeUpdateStatus(runnerDir(state.config.configPath), record);
1217
+ state.imageRecord = key;
1218
+ reportRepeating(state, "the update-status.json record", void 0);
1219
+ } catch (err) {
1220
+ reportRepeating(state, "the update-status.json record", `could not write update-status.json (${describeCallFailure(err)}): \`runner status\` will not name the image to pull`);
1221
+ }
1222
+ }
1190
1223
  function adoptUpdateWait(state, version, nowMs) {
1191
1224
  const previous = state.updateWait;
1192
1225
  const wait = { version, sinceMs: previous?.sinceMs ?? nowMs, holdSinceMs: previous?.holdSinceMs };
@@ -1488,6 +1521,7 @@ async function housekeepingPass(state) {
1488
1521
  async function runTick(state) {
1489
1522
  state.restarting = false;
1490
1523
  state.holdingForUpdate = false;
1524
+ if (state.draining === true) return;
1491
1525
  reloadConfig(state);
1492
1526
  if (restartOntoInstalled(state)) {
1493
1527
  state.restarting = true;
@@ -1552,7 +1586,7 @@ var CLAIM_REFUSAL_CODES = new Set(
1552
1586
  "pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected repository_not_reachable branch_claimed_elsewhere".split(" ")
1553
1587
  );
1554
1588
  async function tryClaimAndStart(state, item, queue) {
1555
- const { postJson: postJson2 } = await import('./work-cmd-SM6DY2WK.js');
1589
+ const { postJson: postJson2 } = await import('./work-cmd-APXSER2D.js');
1556
1590
  const log = logOf(state);
1557
1591
  const hostKey = await loadHostKey(state.config.configPath);
1558
1592
  const claim = await retrySend(
@@ -1589,14 +1623,21 @@ async function tryClaimAndStart(state, item, queue) {
1589
1623
  return { kind: "signature" };
1590
1624
  }
1591
1625
  if (claim.code === "runner_upgrade_required") {
1592
- reportRepeating(state, "the runner protocol", claim.message ?? claim.reason);
1626
+ const tag = tagToPull(state.imageNamed);
1627
+ reportRepeating(
1628
+ state,
1629
+ "the runner protocol",
1630
+ state.deps.image === void 0 ? claim.message ?? claim.reason : `${claim.message ?? claim.reason} \xB7 ${pullInstruction(tag)}`
1631
+ );
1593
1632
  state.upgradeRefused = true;
1633
+ recordImageStatus(state);
1594
1634
  return { kind: "outdated" };
1595
1635
  }
1596
1636
  return { kind: "error", reason: `${claim.reason} (${claim.attempts} attempt(s))` };
1597
1637
  }
1598
1638
  reportRepeating(state, "the runner protocol", void 0);
1599
1639
  state.upgradeRefused = false;
1640
+ recordImageStatus(state);
1600
1641
  reportRepeating(state, "the request signature", void 0);
1601
1642
  const { data } = claim.value;
1602
1643
  const claimId = data.id === void 0 || data.id === null ? "" : String(data.id);
@@ -2521,7 +2562,7 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
2521
2562
  const outcome = await onStartUnderMarker({
2522
2563
  configPath,
2523
2564
  own: ownVersionOf(deps),
2524
- check: update.check ? () => update.check(configPath) : async () => (await import('./check-N6WLZCER.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl }),
2565
+ check: update.check ? () => update.check(configPath) : async () => (await import('./check-YYKNYFNI.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl }),
2525
2566
  now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
2526
2567
  log
2527
2568
  });
@@ -2625,8 +2666,9 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
2625
2666
  const probeTimer = setInterval(() => {
2626
2667
  for (const active of state.jobs.values()) void probeBuild(state, active);
2627
2668
  }, deps.probeIntervalMs ?? PROBE_INTERVAL_MS);
2628
- const onSigterm = () => void drain();
2669
+ const onSigterm = () => deps.image === void 0 ? void drain() : leave();
2629
2670
  const onSigusr1 = () => void stopNow();
2671
+ const onSigusr2 = () => drainKeepingUp();
2630
2672
  const onSigint = () => {
2631
2673
  interrupts++;
2632
2674
  if (interrupts === 1) {
@@ -2639,6 +2681,7 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
2639
2681
  const detachSignals = () => {
2640
2682
  process.off("SIGTERM", onSigterm);
2641
2683
  process.off("SIGUSR1", onSigusr1);
2684
+ process.off("SIGUSR2", onSigusr2);
2642
2685
  process.off("SIGINT", onSigint);
2643
2686
  };
2644
2687
  const stopIntake = () => {
@@ -2685,6 +2728,19 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
2685
2728
  }
2686
2729
  finish2();
2687
2730
  };
2731
+ const drainKeepingUp = () => {
2732
+ if (state.draining === true) return;
2733
+ state.draining = true;
2734
+ stopIntake();
2735
+ log.line(`stopping: taking no more work, ${state.jobs.size} build(s) still managed \xB7 docker stop ends this container`);
2736
+ };
2737
+ const leave = () => {
2738
+ if (exited) return;
2739
+ log.line(`stopping: leaving ${state.jobs.size} running build(s) for the next runner to adopt`);
2740
+ state.draining = true;
2741
+ finish2();
2742
+ deps.image?.exit?.(0);
2743
+ };
2688
2744
  const stopNow = async () => {
2689
2745
  if (stopping) return;
2690
2746
  stopping = true;
@@ -2705,6 +2761,7 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
2705
2761
  const handle = { state, drain, stopNow, close };
2706
2762
  process.on("SIGTERM", onSigterm);
2707
2763
  process.on("SIGUSR1", onSigusr1);
2764
+ if (deps.image !== void 0) process.on("SIGUSR2", onSigusr2);
2708
2765
  process.on("SIGINT", onSigint);
2709
2766
  deps.onReady?.();
2710
2767
  await tick(state);
@@ -2717,7 +2774,8 @@ function describeWaiting(active, nowMs) {
2717
2774
  }
2718
2775
  var RunnerStartError = class extends Error {
2719
2776
  };
2720
- async function requestStop(configPath, stopNow = false, pollMs = 5e3) {
2777
+ async function requestStop(configPath, stopNow = false, pollMs = 5e3, options = {}) {
2778
+ const kill = options.kill ?? ((pid, signal2) => process.kill(pid, signal2));
2721
2779
  const entry = readPidFile(pidFilePath(configPath));
2722
2780
  if (!entry) {
2723
2781
  process.stdout.write("no runner is running on this config\n");
@@ -2729,9 +2787,9 @@ async function requestStop(configPath, stopNow = false, pollMs = 5e3) {
2729
2787
  `);
2730
2788
  return;
2731
2789
  }
2732
- const signal = stopNow ? "SIGUSR1" : "SIGTERM";
2790
+ const signal = stopNow ? "SIGUSR1" : options.image === true ? "SIGUSR2" : "SIGTERM";
2733
2791
  try {
2734
- process.kill(entry.pid, signal);
2792
+ kill(entry.pid, signal);
2735
2793
  } catch (err) {
2736
2794
  const code = err?.code;
2737
2795
  if (code === "EPERM") {
@@ -2744,6 +2802,14 @@ async function requestStop(configPath, stopNow = false, pollMs = 5e3) {
2744
2802
  `);
2745
2803
  return;
2746
2804
  }
2805
+ if (signal === "SIGUSR2") {
2806
+ process.stdout.write(
2807
+ `sent SIGUSR2 to runner pid ${entry.pid}: it takes no more work and keeps managing its builds.
2808
+ The container stays up. Run \`outerlayer runner status\` to see what is left, then \`docker stop\` the container once nothing is.
2809
+ `
2810
+ );
2811
+ return;
2812
+ }
2747
2813
  process.stdout.write(
2748
2814
  stopNow ? `sent SIGUSR1 to runner pid ${entry.pid}, stopping now
2749
2815
  ` : `sent SIGTERM to runner pid ${entry.pid}, draining
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { splitRawFile } from './chunk-WFSUUUAN.js';
3
+ import { splitRawFile } from './chunk-RKOTJQVG.js';
4
4
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
5
5
  import { existsSync, readFileSync, mkdirSync, writeFileSync, readdirSync } from 'fs';
6
6
  import { join, dirname } from 'path';
@@ -12,17 +12,26 @@ var MAINTAINED_SKILLS = ["outerlayer-evidence", "outerlayer-amend", "outerlayer-
12
12
  function templateClassLine(version) {
13
13
  return `<!-- yours to edit. Copied once from the default template by outerlayer init ${version}; never overwritten. -->`;
14
14
  }
15
- function maintainedClassLine(version) {
16
- return `<!-- maintained by OuterLayer ${version}. Edits are overwritten on the next outerlayer context emit. -->`;
15
+ function maintainedClassLine(version, base) {
16
+ const command = base === AGENTS_SKILLS_BASE ? "outerlayer init --update" : "outerlayer context emit";
17
+ return `<!-- maintained by OuterLayer ${version}. Edits are overwritten on the next ${command}. -->`;
18
+ }
19
+ var OUTERLAYER_SKILLS_BASE = ".outerlayer/skills";
20
+ var AGENTS_SKILLS_BASE = ".agents/skills";
21
+ function rewriteSkillPaths(content, base) {
22
+ return base === OUTERLAYER_SKILLS_BASE ? content : content.split(`${OUTERLAYER_SKILLS_BASE}/`).join(`${base}/`);
23
+ }
24
+ function restoreSkillPaths(content, base) {
25
+ return base === OUTERLAYER_SKILLS_BASE ? content : content.split(`${base}/`).join(`${OUTERLAYER_SKILLS_BASE}/`);
17
26
  }
18
27
  function resolvePackRoot(entryPath = fileURLToPath(import.meta.url)) {
19
28
  return join(dirname(dirname(entryPath)), "skill-pack");
20
29
  }
21
- function skillDir(skill) {
22
- return `.outerlayer/skills/${skill}`;
30
+ function skillDir(skill, base = OUTERLAYER_SKILLS_BASE) {
31
+ return `${base}/${skill}`;
23
32
  }
24
- function renderSkillFile(skillClass, content, version) {
25
- const line = skillClass === "maintained" ? maintainedClassLine(version) : templateClassLine(version);
33
+ function renderSkillFile(skillClass, content, version, base) {
34
+ const line = skillClass === "maintained" ? maintainedClassLine(version, base) : templateClassLine(version);
26
35
  const { frontmatterInner, body } = splitRawFile(content);
27
36
  if (frontmatterInner === null) return `${line}
28
37
  ${content}`;
@@ -42,7 +51,7 @@ function filesUnder(dir, base = dir) {
42
51
  function orderSkillFiles(relPaths) {
43
52
  return [...relPaths.filter((p) => p === "SKILL.md"), ...relPaths.filter((p) => p !== "SKILL.md")];
44
53
  }
45
- function loadClass(packRoot, skillClass, names, version) {
54
+ function loadClass(packRoot, skillClass, names, version, base) {
46
55
  const files = [];
47
56
  for (const skill of names) {
48
57
  const dir = join(packRoot, skillClass, skill);
@@ -52,18 +61,18 @@ function loadClass(packRoot, skillClass, names, version) {
52
61
  files.push({
53
62
  skill,
54
63
  skillClass,
55
- path: `${skillDir(skill)}/${rel}`,
56
- content: rel === "SKILL.md" ? renderSkillFile(skillClass, raw, version) : raw
64
+ path: `${skillDir(skill, base)}/${rel}`,
65
+ content: rewriteSkillPaths(rel === "SKILL.md" ? renderSkillFile(skillClass, raw, version, base) : raw, base)
57
66
  });
58
67
  }
59
68
  }
60
69
  return files;
61
70
  }
62
- function loadTemplateFiles(packRoot = resolvePackRoot(), version = resolvePackageVersion()) {
63
- return loadClass(packRoot, "template", TEMPLATE_SKILLS, version);
71
+ function loadTemplateFiles(packRoot = resolvePackRoot(), version = resolvePackageVersion(), base = OUTERLAYER_SKILLS_BASE) {
72
+ return loadClass(packRoot, "template", TEMPLATE_SKILLS, version, base);
64
73
  }
65
- function loadMaintainedFiles(packRoot = resolvePackRoot(), version = resolvePackageVersion()) {
66
- return loadClass(packRoot, "maintained", MAINTAINED_SKILLS, version);
74
+ function loadMaintainedFiles(packRoot = resolvePackRoot(), version = resolvePackageVersion(), base = OUTERLAYER_SKILLS_BASE) {
75
+ return loadClass(packRoot, "maintained", MAINTAINED_SKILLS, version, base);
67
76
  }
68
77
  function writeMaintainedFiles(repoRoot, files) {
69
78
  const created = [];
@@ -78,15 +87,15 @@ function writeMaintainedFiles(repoRoot, files) {
78
87
  }
79
88
  return { created, rewritten };
80
89
  }
81
- function maintainedFilesForExistingSkills(repoRoot, files) {
90
+ function maintainedFilesForExistingSkills(repoRoot, files, base = OUTERLAYER_SKILLS_BASE) {
82
91
  return files.filter(
83
- (file) => existsSync(join(repoRoot, skillDir(file.skill))) || formerNameExists(repoRoot, file.skill) || requiredByBuild(repoRoot, file.skill)
92
+ (file) => existsSync(join(repoRoot, skillDir(file.skill, base))) || formerNameExists(repoRoot, file.skill, base) || requiredByBuild(repoRoot, file.skill, base)
84
93
  );
85
94
  }
86
95
  function namesCore(text) {
87
96
  return text.includes("outerlayer-build");
88
97
  }
89
- function requiredByBuild(repoRoot, skill) {
98
+ function requiredByBuild(repoRoot, skill, base) {
90
99
  if (skill !== "outerlayer-build") return false;
91
100
  const named = (file) => {
92
101
  try {
@@ -95,7 +104,7 @@ function requiredByBuild(repoRoot, skill) {
95
104
  return false;
96
105
  }
97
106
  };
98
- if (named(join(repoRoot, skillDir("build"), "SKILL.md"))) return true;
107
+ if (named(join(repoRoot, skillDir("build", base), "SKILL.md"))) return true;
99
108
  const dir = join(repoRoot, ".outerlayer", "validators");
100
109
  try {
101
110
  return readdirSync(dir).some((name) => name.endsWith(".yaml") && named(join(dir, name)));
@@ -110,15 +119,15 @@ var FORMER_MAINTAINED_NAMES = {
110
119
  outerlayer: "outerlayer-cli"
111
120
  };
112
121
  var MAINTAINED_LINE = /^<!-- maintained by OuterLayer \S+?\. /m;
113
- function isMaintainedCopy(repoRoot, skill) {
122
+ function isMaintainedCopy(repoRoot, skill, base = OUTERLAYER_SKILLS_BASE) {
114
123
  try {
115
- return MAINTAINED_LINE.test(readFileSync(join(repoRoot, skillDir(skill), "SKILL.md"), "utf8"));
124
+ return MAINTAINED_LINE.test(readFileSync(join(repoRoot, skillDir(skill, base), "SKILL.md"), "utf8"));
116
125
  } catch {
117
126
  return false;
118
127
  }
119
128
  }
120
- function formerNameExists(repoRoot, skill) {
121
- return Object.entries(FORMER_MAINTAINED_NAMES).some(([former, current]) => current === skill && isMaintainedCopy(repoRoot, former));
129
+ function formerNameExists(repoRoot, skill, base) {
130
+ return Object.entries(FORMER_MAINTAINED_NAMES).some(([former, current]) => current === skill && isMaintainedCopy(repoRoot, former, base));
122
131
  }
123
132
 
124
- export { FORMER_MAINTAINED_NAMES, MAINTAINED_SKILLS, TEMPLATE_SKILLS, isMaintainedCopy, loadMaintainedFiles, loadTemplateFiles, maintainedFilesForExistingSkills, namesCore, resolvePackRoot, skillDir, writeMaintainedFiles };
133
+ export { AGENTS_SKILLS_BASE, FORMER_MAINTAINED_NAMES, MAINTAINED_SKILLS, OUTERLAYER_SKILLS_BASE, TEMPLATE_SKILLS, isMaintainedCopy, loadMaintainedFiles, loadTemplateFiles, maintainedFilesForExistingSkills, namesCore, resolvePackRoot, restoreSkillPaths, rewriteSkillPaths, skillDir, writeMaintainedFiles };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { currentLink } from './chunk-276D7BJ7.js';
3
+ import { currentLink } from './chunk-VV7ZD5LR.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';
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { isVersion, compareVersions } from './chunk-TQMI335S.js';
4
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-KF37SUDM.js';
5
+ import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
6
+ import { join } from 'path';
7
+
8
+ createRequire(import.meta.url);
9
+ var FILE = "update-status.json";
10
+ var TAG_SHAPE = /^[\w./-]+:[\w.+-]+$/;
11
+ function readUpdateStatus(runnerDirPath) {
12
+ try {
13
+ const raw = JSON.parse(readFileSync(join(runnerDirPath, FILE), "utf8"));
14
+ if (typeof raw.own !== "string" || typeof raw.at !== "string") return void 0;
15
+ const named = typeof raw.named === "string" && isVersion(raw.named) ? raw.named : void 0;
16
+ return {
17
+ own: raw.own,
18
+ ...named === void 0 ? {} : { named },
19
+ ...named !== void 0 && typeof raw.tag === "string" && TAG_SHAPE.test(raw.tag) ? { tag: raw.tag } : {},
20
+ upgradeRequired: raw.upgradeRequired === true,
21
+ at: raw.at
22
+ };
23
+ } catch {
24
+ return void 0;
25
+ }
26
+ }
27
+ function writeUpdateStatus(runnerDirPath, record) {
28
+ mkdirSync(runnerDirPath, { recursive: true, mode: RUNNER_DIR_MODE });
29
+ const path = join(runnerDirPath, FILE);
30
+ const temp = `${path}.partial-${process.pid}`;
31
+ writeFileSync(temp, JSON.stringify(record, null, 2), { mode: RUNNER_FILE_MODE });
32
+ renameSync(temp, path);
33
+ }
34
+
35
+ // src/runner/image-tag.ts
36
+ var IMAGE_REPOSITORY = "ghcr.io/outerlayerai/runner";
37
+ var IMAGE_VERSION_VARIABLE = "OUTERLAYER_RUNNER_IMAGE";
38
+ var UNNAMED_VERSION = "<version>";
39
+ function imageTag(version) {
40
+ return `${IMAGE_REPOSITORY}:${version}`;
41
+ }
42
+ function tagToPull(named) {
43
+ return imageTag(named === void 0 ? UNNAMED_VERSION : named);
44
+ }
45
+ function runnerImageVersion(env = process.env) {
46
+ const value = env[IMAGE_VERSION_VARIABLE]?.trim();
47
+ return value === void 0 || value === "" ? void 0 : value;
48
+ }
49
+ function imageAdvice(ownVersion, record) {
50
+ if (record === void 0 || record.own !== ownVersion) return void 0;
51
+ const tag = tagToPull(record.named);
52
+ if (record.upgradeRequired) return { tag, reason: "refused" };
53
+ if (record.named !== void 0 && (compareVersions(ownVersion, record.named) ?? 0) < 0) return { tag, reason: "newer" };
54
+ return void 0;
55
+ }
56
+ function pullInstruction(tag) {
57
+ return `docker pull ${tag}, then recreate the container with the same volume`;
58
+ }
59
+ function readImageStatus(runnerDirPath, env = process.env) {
60
+ const version = runnerImageVersion(env);
61
+ if (version === void 0) return void 0;
62
+ const update = imageAdvice(version, readUpdateStatus(runnerDirPath));
63
+ return update === void 0 ? { version } : { version, update };
64
+ }
65
+
66
+ export { IMAGE_VERSION_VARIABLE, imageAdvice, imageTag, pullInstruction, readImageStatus, readUpdateStatus, runnerImageVersion, tagToPull, writeUpdateStatus };