@outerlayer/cli 0.40.0 → 0.41.0-next.20261117195646
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.
- package/README.md +8 -5
- package/dist/agent-credential-JN5VDRUX.js +16 -0
- package/dist/agent-setup-7A66WE3X.js +43 -0
- package/dist/{agent-subcommand-U7TXKOF4.js → agent-subcommand-AE42NSHC.js} +6 -6
- package/dist/{artifact-link-cmd-HYEM4X5U.js → artifact-link-cmd-YMMRVRQD.js} +2 -2
- package/dist/bridge-PJTQ3XHE.js +19 -0
- package/dist/build-75I2U74U.js +28 -0
- package/dist/build-disk-Z5YFT47Z.js +23 -0
- package/dist/build-info.json +1 -1
- package/dist/builder-NNNVIN4P.js +22 -0
- package/dist/caller-H3KRGMJH.js +25 -0
- package/dist/{check-U5P5FFFB.js → check-KFQCKXHZ.js} +108 -90
- package/dist/{chunk-4KCWAP5L.js → chunk-23YVVYQC.js} +1 -1
- package/dist/{chunk-J3P4WLJA.js → chunk-26RXLXEX.js} +1 -1
- package/dist/{chunk-YYHSGZHO.js → chunk-2RUTYYYA.js} +1 -1
- package/dist/{chunk-6IGOHB3O.js → chunk-37WA2LQC.js} +6 -1
- package/dist/{chunk-WNX2RR5P.js → chunk-3HH2AQKF.js} +1 -1
- package/dist/{chunk-ZHRXINEW.js → chunk-3RXLDGWE.js} +7 -7
- package/dist/{chunk-ZCBKVSBK.js → chunk-4I3SN7WG.js} +3 -3
- package/dist/{chunk-TWKW3BL3.js → chunk-4RPDWURG.js} +1 -1
- package/dist/{chunk-Y34AHK7R.js → chunk-4SMKP5QI.js} +2 -2
- package/dist/{chunk-XC2ZN7UA.js → chunk-6SYVSIGA.js} +1 -1
- package/dist/{chunk-CQIJVNUB.js → chunk-A2AFTKMN.js} +7 -7
- package/dist/{chunk-PKBW4RL7.js → chunk-APVMCKLK.js} +1 -1
- package/dist/{chunk-4JUAJVOW.js → chunk-ATXTGXGK.js} +2 -2
- package/dist/{chunk-24K3CV6P.js → chunk-B2WCKRMW.js} +6 -6
- package/dist/{chunk-LA66NWUO.js → chunk-B3ZKYFBI.js} +1 -1
- package/dist/{chunk-HS45JMDJ.js → chunk-B6W2LW7E.js} +1 -1
- package/dist/{chunk-3UFBSPHM.js → chunk-BO5TMIRG.js} +4 -4
- package/dist/{chunk-5VANIC7Z.js → chunk-BPZ23EMS.js} +7 -7
- package/dist/{chunk-CDMNKUFT.js → chunk-CUMLCXFI.js} +2 -2
- package/dist/{chunk-YZQDTL3T.js → chunk-D47Z2Z7F.js} +190 -173
- package/dist/{chunk-VXL7SLO3.js → chunk-D5TZYUGZ.js} +1 -1
- package/dist/{chunk-AE6A5DVR.js → chunk-D5YKSWK3.js} +8 -8
- package/dist/{chunk-5GJWIATY.js → chunk-DJCSAWBV.js} +4 -4
- package/dist/{chunk-F3J4UKBF.js → chunk-DJK3IK6K.js} +1 -1
- package/dist/{chunk-CHIKNMWU.js → chunk-DXZ6QBUJ.js} +1 -1
- package/dist/{chunk-7N6MB6NR.js → chunk-EVAK6FAS.js} +6 -6
- package/dist/{chunk-WGWIB5JH.js → chunk-EYD5HOQ7.js} +1 -1
- package/dist/{chunk-AOAXRPXC.js → chunk-FD42O5SH.js} +13 -4
- package/dist/{chunk-FIH3QA4E.js → chunk-FMOGX7RR.js} +5 -5
- package/dist/{chunk-EOKIUWXY.js → chunk-FRLGVHJP.js} +1 -1
- package/dist/{chunk-7RIWXHSY.js → chunk-G4B473J5.js} +3 -3
- package/dist/chunk-GAHP2AI3.js +163 -0
- package/dist/{chunk-3KT24F2C.js → chunk-GVGHEQCU.js} +9 -9
- package/dist/{chunk-WNPLSKH6.js → chunk-H2NTP6OM.js} +1 -1
- package/dist/{chunk-F3P7DP7R.js → chunk-I6G5CO3K.js} +1 -1
- package/dist/{chunk-D6CU6N5S.js → chunk-IOSONR7N.js} +2 -2
- package/dist/{chunk-SKVA4VMG.js → chunk-J2ADYASG.js} +1 -1
- package/dist/{chunk-CVDB3ILT.js → chunk-JMSMNKCK.js} +1 -1
- package/dist/{chunk-TTPOEZFE.js → chunk-KTZOD7A3.js} +1 -1
- package/dist/{chunk-SGVMC66D.js → chunk-LOWZZ4QA.js} +1 -1
- package/dist/{chunk-DCY6QUS6.js → chunk-M4YTSRJI.js} +1 -1
- package/dist/chunk-MQ6SKVLA.js +9 -0
- package/dist/{chunk-ZZN2TUHE.js → chunk-MYFC3HKP.js} +9 -9
- package/dist/{chunk-Q5A5WWZI.js → chunk-NCZNYMTB.js} +23 -21
- package/dist/{chunk-R2VUU5TC.js → chunk-NEOM73RW.js} +1 -1
- package/dist/{chunk-AQNL3XHS.js → chunk-NPVIEJX6.js} +1 -1
- package/dist/{chunk-K5J7AKRL.js → chunk-P7WAAN35.js} +1 -1
- package/dist/{chunk-SQIFPWGN.js → chunk-PLVLC7SU.js} +2 -2
- package/dist/{chunk-A6DFTKQF.js → chunk-PMJGT7SQ.js} +25 -19
- package/dist/{chunk-WVEN3DDJ.js → chunk-PTZF6MC5.js} +6 -6
- package/dist/{chunk-OLWDENJZ.js → chunk-Q3QJG2P6.js} +3 -3
- package/dist/{chunk-JIMISJV2.js → chunk-Q7Z6ELTL.js} +28 -7
- package/dist/{chunk-HHOFP647.js → chunk-QDJBEQCE.js} +1 -1
- package/dist/{chunk-BV4I6IIT.js → chunk-QFGKTIPS.js} +3 -3
- package/dist/{chunk-2SS737DI.js → chunk-QHGVLLOJ.js} +1 -1
- package/dist/{chunk-EOO274OK.js → chunk-QKVOUI56.js} +3 -3
- package/dist/{chunk-MUDXPJT6.js → chunk-QPC6OKD2.js} +11 -11
- package/dist/{chunk-MRM7CQJ3.js → chunk-QS2O5G64.js} +116 -14
- package/dist/{chunk-WKO72EYV.js → chunk-R6ME6MWL.js} +3 -3
- package/dist/{chunk-H7IY5B2M.js → chunk-RVUOSR2D.js} +526 -107
- package/dist/{chunk-L6UD5LKU.js → chunk-SDCECDBS.js} +5 -5
- package/dist/{chunk-P6GTJQMA.js → chunk-SE5ZVVDJ.js} +3 -3
- package/dist/{chunk-2ZF62BAK.js → chunk-TLCTOEU5.js} +1 -1
- package/dist/{chunk-PG4KH7G6.js → chunk-TVU7AL2Z.js} +6 -6
- package/dist/{chunk-XEVGUSP6.js → chunk-UTZULAN6.js} +10 -10
- package/dist/{chunk-VIIJAM2R.js → chunk-UYIWLYLX.js} +5 -5
- package/dist/{chunk-IGYRJWB4.js → chunk-V5MR6BWR.js} +226 -143
- package/dist/{chunk-BEPP2C3U.js → chunk-VATN55FQ.js} +8 -8
- package/dist/{chunk-ZCFGRVGX.js → chunk-VYF5BILX.js} +34 -7
- package/dist/{chunk-U74YD3WB.js → chunk-W7P5QFRN.js} +7 -7
- package/dist/{chunk-QMC2MM2S.js → chunk-WNFITHNX.js} +1 -1
- package/dist/{chunk-XMUNNJMO.js → chunk-WOQOZCZZ.js} +4 -4
- package/dist/{chunk-UHGU2EAK.js → chunk-WRIQGJKT.js} +225 -17
- package/dist/{chunk-DAAZIWK2.js → chunk-X7YMKZ7A.js} +23 -21
- package/dist/{chunk-WQRFIWYB.js → chunk-XCAPYFJ3.js} +5 -5
- package/dist/{chunk-VUSPSY6N.js → chunk-XDAMSCJG.js} +1 -1
- package/dist/{chunk-LAO7LRIR.js → chunk-XMJNIIPM.js} +411 -92
- package/dist/{chunk-Q7OOS23E.js → chunk-XNB2VFZI.js} +4 -4
- package/dist/{chunk-GBCTYHZ4.js → chunk-YLDCYJRP.js} +15 -13
- package/dist/{chunk-YKVFVP4A.js → chunk-YLDHHHBJ.js} +43 -13
- package/dist/{chunk-2GAQRL4S.js → chunk-YNZVC7XT.js} +4 -4
- package/dist/{chunk-HMW3UCME.js → chunk-YXKZGVUL.js} +36 -8
- package/dist/{chunk-YVBJ74GP.js → chunk-YXUSSZAE.js} +23 -21
- package/dist/{claude-launcher-ZLZ4UMHJ.js → claude-launcher-HNE36BKE.js} +68 -18
- package/dist/{cli-EFLEZPHB.js → cli-NEZV54LS.js} +220 -179
- package/dist/{command-22NUIO7Z.js → command-H2R6EFUH.js} +68 -61
- package/dist/{config-HZEVAUDO.js → config-DIUO2GQY.js} +16 -14
- package/dist/{connect-cmd-IUDF62SX.js → connect-cmd-SXSWOHVT.js} +17 -15
- package/dist/{container-start-PQAEL5ZS.js → container-start-B7BACAFN.js} +61 -57
- package/dist/{context-cleanup-OT7BL2NG.js → context-cleanup-BUZVQNKC.js} +6 -6
- package/dist/{context-show-cmd-JDO6DBBU.js → context-show-cmd-ZWOTXOXV.js} +18 -16
- package/dist/{control-plane-launch-M545J63D.js → control-plane-launch-BPJQYN6J.js} +19 -17
- package/dist/{demo-record-cmd-DGP3CW3A.js → demo-record-cmd-4H2J2N3X.js} +12 -10
- package/dist/{demo-voice-cmd-23BV7L6V.js → demo-voice-cmd-VIOM4SF5.js} +26 -24
- package/dist/{dist-AKLRKVET.js → dist-FKOMD5MC.js} +2 -2
- package/dist/docker-QQEZWBI3.js +22 -0
- package/dist/{doctor-5VN6Q4ZU.js → doctor-Y7CIJZX5.js} +115 -64
- package/dist/emit-artifact-cmd-HUAKLOH4.js +46 -0
- package/dist/{emit-cmd-RM6FHATP.js → emit-cmd-UDTT7ENT.js} +9 -9
- package/dist/emit-criteria-cmd-7LKPQRFE.js +37 -0
- package/dist/emit-demo-cmd-7TW5Y3MN.js +49 -0
- package/dist/{emit-finding-cmd-E7WKK2A4.js → emit-finding-cmd-T3JBAGS2.js} +20 -18
- package/dist/{emit-result-cmd-5LKEMUOD.js → emit-result-cmd-ILRQ6OIL.js} +24 -22
- package/dist/emit-step-cmd-4ISFOYRC.js +37 -0
- package/dist/exec-client-UJKPJRNK.js +20 -0
- package/dist/{find-unit-XKWFS4BL.js → find-unit-OAJKRZI2.js} +17 -15
- package/dist/{findings-cmd-5BNDO3YM.js → findings-cmd-37RCXQK2.js} +20 -18
- package/dist/fleet-readiness-IVFQSHPL.js +33 -0
- package/dist/governing-source-RXJBJHN7.js +45 -0
- package/dist/guest-init-EXKSBS7A.js +22 -0
- package/dist/{hook-fast-CQ2YCZLB.js → hook-fast-BSH6IHRN.js} +4 -4
- package/dist/{hook-install-VWF5C6EL.js → hook-install-NOWMUPSI.js} +6 -6
- package/dist/{hook-wrap-fast-Y5KKK67C.js → hook-wrap-fast-7E5LAYEU.js} +3 -3
- package/dist/host-checks-GWUYRJXA.js +84 -0
- package/dist/host-key-7WPFECOD.js +20 -0
- package/dist/{image-tag-VZTFHG6T.js → image-tag-GLR3OAO3.js} +12 -10
- package/dist/index.js +6 -6
- package/dist/init-4MF5M74X.js +84 -0
- package/dist/{init-IXQBYUOM.js → init-BEMNWKES.js} +55 -53
- package/dist/{init-agent-BWLBRVNP.js → init-agent-6E3FAOEZ.js} +55 -53
- package/dist/init-cmd-R5ICA2LP.js +55 -0
- package/dist/{init-update-35IRDVWQ.js → init-update-FAFXM2YE.js} +29 -27
- package/dist/install-cmd-HI5OQW5J.js +28 -0
- package/dist/launch-agent-JLANNHFC.js +28 -0
- package/dist/{layout-F6FDPUC2.js → layout-U2ZTNGVB.js} +6 -6
- package/dist/{login-browser-G3NBTYT6.js → login-browser-QAPMBSQA.js} +2 -2
- package/dist/{logs-NWVFDJS3.js → logs-RVPQEAYN.js} +11 -9
- package/dist/loop-PP7QFT3F.js +94 -0
- package/dist/machine-JHWQCYS3.js +84 -0
- package/dist/{machine-skills-U7RNJTPH.js → machine-skills-2QFBY2II.js} +6 -6
- package/dist/{mcp-install-cmd-QDYJB3RW.js → mcp-install-cmd-KRZJVOND.js} +6 -6
- package/dist/{mcp-serve-cmd-JEYAQJPY.js → mcp-serve-cmd-UT3YCM5P.js} +13 -11
- package/dist/{paths-DWVALEBM.js → paths-72CWJPND.js} +11 -9
- package/dist/pending-ES4EF46B.js +20 -0
- package/dist/pidfile-WI6SE35U.js +21 -0
- package/dist/record-KX763L6R.js +20 -0
- package/dist/{relay-SKBUV4HQ.js → relay-ZZWAUA6P.js} +9 -7
- package/dist/{relay-protocol-YSGHT7C4.js → relay-protocol-4GCTOIT4.js} +9 -7
- package/dist/{run-cmd-S7IQ6OVY.js → run-cmd-SCXMROKB.js} +20 -18
- package/dist/runner-agents-QS3IX55G.js +15 -0
- package/dist/runner-env-FU6EWMWW.js +26 -0
- package/dist/runner-identity-PUW27LAT.js +22 -0
- package/dist/{runner-key-OM2HCEVM.js → runner-key-5G2AJD57.js} +55 -53
- package/dist/session-sender-A46R3S66.js +46 -0
- package/dist/{setup-cmd-S4ZIVRRF.js → setup-cmd-OZS4QOPI.js} +18 -16
- package/dist/{setup-wiring-FRY6CKZ7.js → setup-wiring-G2RLSBQ6.js} +64 -62
- package/dist/{shell-function-7N3ILFLG.js → shell-function-6ZFAVOSM.js} +2 -2
- package/dist/{spec-cmd-PRGEIOJ7.js → spec-cmd-C4KSLTAD.js} +21 -19
- package/dist/{starter-pack-YVBD7AKE.js → starter-pack-G5TQVPMW.js} +7 -7
- package/dist/state-TCZAKBBZ.js +20 -0
- package/dist/{status-JORNKH3T.js → status-T6WDUAI4.js} +65 -53
- package/dist/{statusline-fast-ZWMTN36K.js → statusline-fast-VVJF5W7X.js} +3 -3
- package/dist/{sync-cmd-QVSAP72U.js → sync-cmd-ZYTJMWET.js} +24 -22
- package/dist/update-steps-PU34FN7N.js +85 -0
- package/dist/{watch-F2ELGBST.js → watch-VCKWAILU.js} +24 -22
- package/dist/{work-claim-cmd-LEM7P2ME.js → work-claim-cmd-7TR6LNIY.js} +27 -25
- package/dist/{work-cmd-M2RCHHKE.js → work-cmd-7KOXRPOJ.js} +20 -18
- package/dist/work-comment-cmd-EDXP3K7B.js +41 -0
- package/dist/{work-demo-cmd-FQMFCLZ6.js → work-demo-cmd-OYZTKNCG.js} +20 -18
- package/dist/{work-logs-cmd-KLPX4TYX.js → work-logs-cmd-P3QS5AFY.js} +20 -18
- package/dist/{work-mock-cmd-XJEG6AAT.js → work-mock-cmd-3QEXWV43.js} +20 -18
- package/dist/{work-needs-attention-cmd-BOINZLEQ.js → work-needs-attention-cmd-ZTQB2DXB.js} +20 -18
- package/dist/{work-no-change-cmd-IINJFYBD.js → work-no-change-cmd-FGHOOPLY.js} +20 -18
- package/dist/{work-open-pr-cmd-S2XL6OZV.js → work-open-pr-cmd-WFIPFVQR.js} +21 -19
- package/dist/work-pr-cmd-262GWNKI.js +36 -0
- package/dist/work-proofs-cmd-PAJSCMJ2.js +39 -0
- package/dist/{work-proofs-record-34VAOVND.js → work-proofs-record-A4NZTAME.js} +30 -28
- package/dist/{work-stop-cmd-HWG6IUFS.js → work-stop-cmd-CBRWKR4Q.js} +20 -18
- package/package.json +1 -1
- package/dist/agent-setup-KJVEDAHY.js +0 -41
- package/dist/bridge-UIT7F5DZ.js +0 -17
- package/dist/build-W2Z43HX5.js +0 -26
- package/dist/build-disk-AOY6DOEK.js +0 -21
- package/dist/builder-PHD5WM6J.js +0 -20
- package/dist/caller-WJVESIHQ.js +0 -23
- package/dist/docker-S6XFE42W.js +0 -20
- package/dist/emit-artifact-cmd-H3HULADF.js +0 -44
- package/dist/emit-criteria-cmd-UM3DXOOD.js +0 -35
- package/dist/emit-demo-cmd-BMAXX7M2.js +0 -47
- package/dist/emit-step-cmd-6TX7FGWI.js +0 -35
- package/dist/exec-client-H2AOUP6U.js +0 -18
- package/dist/fleet-readiness-YDRQPUI5.js +0 -31
- package/dist/governing-source-CLLOKTZF.js +0 -43
- package/dist/guest-init-PDLZDDB4.js +0 -20
- package/dist/host-checks-43WBI5JE.js +0 -82
- package/dist/host-key-AOUOQNV5.js +0 -18
- package/dist/init-IZJENDA6.js +0 -82
- package/dist/init-cmd-AL3ODKU6.js +0 -53
- package/dist/install-cmd-DMAMD7BD.js +0 -26
- package/dist/launch-agent-XAPO3FGT.js +0 -26
- package/dist/loop-Q5CTVY7B.js +0 -92
- package/dist/machine-55WUTHG3.js +0 -82
- package/dist/pending-PA5UWRHN.js +0 -18
- package/dist/pidfile-KOM3XD4E.js +0 -19
- package/dist/record-S2WGEUIM.js +0 -18
- package/dist/runner-agents-ZVIM6XVC.js +0 -14
- package/dist/runner-env-WD6CPYTN.js +0 -24
- package/dist/runner-identity-LDFFB6YB.js +0 -20
- package/dist/session-sender-IZP4E562.js +0 -44
- package/dist/state-LAKZKWCJ.js +0 -18
- package/dist/update-steps-LM3C7MG6.js +0 -83
- package/dist/work-comment-cmd-QGAY3QUN.js +0 -39
- package/dist/work-pr-cmd-6YTJRHVC.js +0 -34
- package/dist/work-proofs-cmd-OC3O264U.js +0 -37
- package/dist/{real-deps-B7NMEDXM.js → real-deps-HNNHF3UN.js} +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { launcherPath, pathNotes, writeLauncher, LauncherWriteError } from './chunk-
|
|
4
|
-
import { currentVersion, entryIn, currentLink, versionDir, execStartLine, isInLayout, packageRootIn, switchCurrent } from './chunk-
|
|
3
|
+
import { launcherPath, pathNotes, writeLauncher, LauncherWriteError } from './chunk-QHGVLLOJ.js';
|
|
4
|
+
import { currentVersion, entryIn, currentLink, versionDir, execStartLine, isInLayout, packageRootIn, switchCurrent } from './chunk-M4YTSRJI.js';
|
|
5
5
|
import { compareVersions } from './chunk-TQMI335S.js';
|
|
6
|
-
import { defaultRunnerConfigPath } from './chunk-
|
|
7
|
-
import { runnerDir, RUNNER_DIR_MODE } from './chunk-
|
|
6
|
+
import { defaultRunnerConfigPath } from './chunk-VYF5BILX.js';
|
|
7
|
+
import { runnerDir, RUNNER_DIR_MODE } from './chunk-D5TZYUGZ.js';
|
|
8
8
|
import { lchownSync, lstatSync, realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync, readdirSync } from 'fs';
|
|
9
9
|
import { dirname, sep, join, resolve } from 'path';
|
|
10
10
|
import { spawnSync } from 'child_process';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { placeholderQueues, placeholderProblem } from './chunk-
|
|
4
|
-
import { checkFit } from './chunk-
|
|
5
|
-
import { getJson, WorkCommandError } from './chunk-
|
|
6
|
-
import { isBuiltinSandbox, builtinKind, EGRESS_SWITCHABLE_KEYS, keepsHostBuilder } from './chunk-
|
|
7
|
-
import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-
|
|
8
|
-
import { ensureHostKey } from './chunk-
|
|
9
|
-
import { sandboxSettingsFrom } from './chunk-
|
|
10
|
-
import { agentCredentialVariablesSet,
|
|
11
|
-
import { forwardedVariables, credentialAgent, credentialForms, managedKeyName, storeVariables, credentialEnvPath } from './chunk-
|
|
12
|
-
import { defaultAgents } from './chunk-
|
|
3
|
+
import { placeholderQueues, placeholderProblem } from './chunk-RVUOSR2D.js';
|
|
4
|
+
import { checkFit } from './chunk-NCZNYMTB.js';
|
|
5
|
+
import { getJson, WorkCommandError } from './chunk-YLDHHHBJ.js';
|
|
6
|
+
import { isBuiltinSandbox, builtinKind, EGRESS_SWITCHABLE_KEYS, keepsHostBuilder } from './chunk-VYF5BILX.js';
|
|
7
|
+
import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-IOSONR7N.js';
|
|
8
|
+
import { ensureHostKey } from './chunk-I6G5CO3K.js';
|
|
9
|
+
import { sandboxSettingsFrom } from './chunk-WRIQGJKT.js';
|
|
10
|
+
import { agentCredentialVariablesSet, reportedAgents, parseRunnerEnv, BUILD_SLICE_MEMORY_ENV } from './chunk-D47Z2Z7F.js';
|
|
11
|
+
import { forwardedVariables, credentialAgent, credentialForms, managedKeyName, agentsNeedingCredential, storeVariables, credentialEnvPath } from './chunk-QS2O5G64.js';
|
|
12
|
+
import { defaultAgents, agentById } from './chunk-XMJNIIPM.js';
|
|
13
13
|
import { closeSync, openSync, constants, readFileSync } from 'fs';
|
|
14
14
|
import { join, dirname } from 'path';
|
|
15
15
|
import { totalmem } from 'os';
|
|
@@ -83,9 +83,10 @@ function managedProblems(facts, agents = defaultAgents()) {
|
|
|
83
83
|
const owner = credentialAgent(agents);
|
|
84
84
|
if (held.length > 0 && owner !== void 0) {
|
|
85
85
|
const { label, envFile } = credentialForms(owner.descriptor);
|
|
86
|
+
const ownerOnly = held.every((variable) => owner.descriptor.credentials.forwarded.includes(variable));
|
|
86
87
|
problems.push({
|
|
87
88
|
condition: "credential",
|
|
88
|
-
reason: `a managed runner holds no ${label} credential of its own: it gets the factory's ${managedKeyName(agents)} from each claim. ${held.join(" and ")} ${held.length === 1 ? "is" : "are"} set in the runner's environment, runner.env or ${envFile}. Remove ${held.length === 1 ? "it" : "them"} from the environment and from the runner.env and ${envFile} beside the config, then restart the service`
|
|
89
|
+
reason: `a managed runner holds no ${ownerOnly ? `${label} credential` : "model credential"} of its own: it gets the factory's ${ownerOnly ? managedKeyName(agents) : "model keys"} from each claim. ${held.join(" and ")} ${held.length === 1 ? "is" : "are"} set in the runner's environment, runner.env or ${envFile}. Remove ${held.length === 1 ? "it" : "them"} from the environment and from the runner.env and ${envFile} beside the config, then restart the service`
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
92
|
if (facts.allowHosts === void 0) {
|
|
@@ -183,8 +184,9 @@ function checkBlockedWithSlots(config, probes, agents = defaultAgents()) {
|
|
|
183
184
|
if (builder !== "usable") return { blocked: { reason: `${builder.problem}. The runner takes work again once its image builder works` }, slots };
|
|
184
185
|
}
|
|
185
186
|
const owner = credentialAgent(agents);
|
|
186
|
-
if (kind !== "own" && config.fleet !== true && owner !== void 0 &&
|
|
187
|
-
const
|
|
187
|
+
if (kind !== "own" && config.fleet !== true && owner !== void 0 && reportedAgents(config, probes.env, agents).length === 0) {
|
|
188
|
+
const listed = agentById(agentsNeedingCredential(config, agents)[0], agents)?.descriptor ?? owner.descriptor;
|
|
189
|
+
const forms = credentialForms(listed, agents);
|
|
188
190
|
return {
|
|
189
191
|
slots,
|
|
190
192
|
blocked: {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { detectActiveSession } from './chunk-
|
|
4
|
-
import { autoConnect } from './chunk-
|
|
5
|
-
import { workPageUrl } from './chunk-
|
|
6
|
-
import { sanitizeTerminal } from './chunk-
|
|
3
|
+
import { detectActiveSession } from './chunk-26RXLXEX.js';
|
|
4
|
+
import { autoConnect } from './chunk-4I3SN7WG.js';
|
|
5
|
+
import { workPageUrl } from './chunk-B2WCKRMW.js';
|
|
6
|
+
import { sanitizeTerminal } from './chunk-WNFITHNX.js';
|
|
7
7
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
8
|
-
import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-
|
|
9
|
-
import { signRunnerRequest } from './chunk-
|
|
8
|
+
import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-FRLGVHJP.js';
|
|
9
|
+
import { signRunnerRequest } from './chunk-I6G5CO3K.js';
|
|
10
10
|
import { readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
11
11
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
12
|
-
import { NATIVE_AGENTS, LEGACY_AGENT } from './chunk-
|
|
12
|
+
import { NATIVE_AGENTS, LEGACY_AGENT, isRunnerAgent, runnerAgentIds, isModelId, MODEL_ID_RULE, agentLabel } from './chunk-Q7Z6ELTL.js';
|
|
13
13
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
14
|
-
import { resolveRepoIdentity } from './chunk-
|
|
14
|
+
import { resolveRepoIdentity } from './chunk-KTZOD7A3.js';
|
|
15
15
|
|
|
16
16
|
createRequire(import.meta.url);
|
|
17
17
|
|
|
@@ -465,7 +465,27 @@ function tokenWarning(data) {
|
|
|
465
465
|
${C.yellow}!${C.reset} a container host will fail this build: ${why}`;
|
|
466
466
|
}
|
|
467
467
|
function isManagedRefusal(code) {
|
|
468
|
-
return code === "managed_builds_off" || code === "managed_credential_missing";
|
|
468
|
+
return code === "managed_builds_off" || code === "managed_credential_missing" || code === "agent_not_managed";
|
|
469
|
+
}
|
|
470
|
+
function parseAgentOption(raw) {
|
|
471
|
+
if (raw === void 0) return void 0;
|
|
472
|
+
if (!isRunnerAgent(raw)) throw new WorkCommandError(`--agent takes ${runnerAgentIds().join(" or ")}, not "${sanitizeTerminal(raw)}"`);
|
|
473
|
+
return raw;
|
|
474
|
+
}
|
|
475
|
+
function parseModelOption(raw) {
|
|
476
|
+
if (raw === void 0) return void 0;
|
|
477
|
+
if (!isModelId(raw)) throw new WorkCommandError(`--model "${sanitizeTerminal(raw)}" is not a model id. ${MODEL_ID_RULE}`);
|
|
478
|
+
return raw;
|
|
479
|
+
}
|
|
480
|
+
function agentLabelOf(data) {
|
|
481
|
+
const agent = typeof data.agent === "string" ? data.agent : void 0;
|
|
482
|
+
const model = typeof data.model === "string" ? data.model : void 0;
|
|
483
|
+
if (agent === void 0 && model === void 0) return "";
|
|
484
|
+
const who = agent === void 0 ? "the runner's agent" : agentLabel(agent) ?? agent;
|
|
485
|
+
return ` ${C.dim}\xB7${C.reset} with ${sanitizeTerminal(who)}${model === void 0 ? "" : ` on ${sanitizeTerminal(model)}`}`;
|
|
486
|
+
}
|
|
487
|
+
function isChoiceRefusal(code) {
|
|
488
|
+
return code === "repository_config_invalid" || code === "repository_config_unreadable" || code === "model_not_supported";
|
|
469
489
|
}
|
|
470
490
|
function runnerLabel(data) {
|
|
471
491
|
if (data.runner !== "managed" && data.runner !== "self-hosted") return "";
|
|
@@ -502,6 +522,11 @@ async function runWorkBuild(opts) {
|
|
|
502
522
|
if (opts.continue === true && opts.fresh === true) {
|
|
503
523
|
throw new WorkCommandError("--continue and --fresh cannot both be given: a continued session needs the disk it worked on");
|
|
504
524
|
}
|
|
525
|
+
const agent = parseAgentOption(opts.agent);
|
|
526
|
+
const model = parseModelOption(opts.model);
|
|
527
|
+
if (opts.local && (agent !== void 0 || model !== void 0)) {
|
|
528
|
+
throw new WorkCommandError(`${agent !== void 0 ? "--agent" : "--model"} applies to host builds: with --local you build the item yourself, so no runner takes it`);
|
|
529
|
+
}
|
|
505
530
|
await connectIfOneFits(opts);
|
|
506
531
|
const { url, apiKey, appId } = resolveCredentials(opts);
|
|
507
532
|
const fetchImpl = opts.fetchImpl ?? defaultFetch;
|
|
@@ -531,22 +556,27 @@ async function runWorkBuild(opts) {
|
|
|
531
556
|
const instructions = opts.instructions !== void 0 ? { instructions: opts.instructions } : {};
|
|
532
557
|
const fresh = opts.fresh === true ? { fresh: true } : {};
|
|
533
558
|
const continued = opts.continue === true ? { continueSession: true } : {};
|
|
534
|
-
const
|
|
559
|
+
const chosen = { ...agent === void 0 ? {} : { agent }, ...model === void 0 ? {} : { model } };
|
|
560
|
+
const body = itemNumber !== void 0 ? { workItemId: String(itemNumber), note: opts.note, ...instructions, ...fresh, ...continued, ...chosen, ...facts } : {
|
|
535
561
|
subject: resolveWorkSubject({ issue: opts.issue, tracker: opts.tracker, repo: opts.repo, cwd }),
|
|
536
562
|
note: opts.note,
|
|
537
563
|
...instructions,
|
|
538
564
|
...fresh,
|
|
539
565
|
...continued,
|
|
566
|
+
...chosen,
|
|
540
567
|
...facts
|
|
541
568
|
};
|
|
542
569
|
const { data } = await postJsonWithRetry(url, "/v1/work-items/build", apiKey, appId, body, fetchImpl, retries, sleep).catch((err) => {
|
|
543
|
-
if (err instanceof WorkCommandError && isManagedRefusal(err.code)) {
|
|
570
|
+
if (err instanceof WorkCommandError && (isManagedRefusal(err.code) || isChoiceRefusal(err.code))) {
|
|
544
571
|
throw new WorkCommandError(`${err.message} (${err.code})`, false, err.status, err.code);
|
|
545
572
|
}
|
|
573
|
+
if (err instanceof WorkCommandError && err.code === "session_agent_mismatch") {
|
|
574
|
+
throw new WorkCommandError(`${err.message} To start a new session, run the command again without --continue. (${err.code})`, false, err.status, err.code);
|
|
575
|
+
}
|
|
546
576
|
throw err;
|
|
547
577
|
});
|
|
548
578
|
const page = itemPageUrl(home, cwd, appId, data.workItemId, data.number);
|
|
549
|
-
const output = opts.json ? JSON.stringify(data) : `${C.green}\u2713${C.reset} build requested ${C.dim}\xB7${C.reset} ${itemLabel(data)}${"subject" in body ? ` (${issueLabel(body.subject)})` : ""}${runnerLabel(data)} ${C.dim}\xB7${C.reset} by ${data.attestor}` + (page !== void 0 ? `
|
|
579
|
+
const output = opts.json ? JSON.stringify(data) : `${C.green}\u2713${C.reset} build requested ${C.dim}\xB7${C.reset} ${itemLabel(data)}${"subject" in body ? ` (${issueLabel(body.subject)})` : ""}${runnerLabel(data)}${agentLabelOf(data)} ${C.dim}\xB7${C.reset} by ${data.attestor}` + (page !== void 0 ? `
|
|
550
580
|
${page}` : "") + freshDiskLine(opts.fresh === true, data) + continueLine(opts.continue === true, data) + tokenWarning(data);
|
|
551
581
|
if (!opts.quiet) process.stdout.write(output + "\n");
|
|
552
582
|
return { data, output };
|
|
@@ -556,7 +586,7 @@ async function runWorkLinkSession(opts) {
|
|
|
556
586
|
return await linkSession(opts);
|
|
557
587
|
} catch (err) {
|
|
558
588
|
if (opts.logFailures) {
|
|
559
|
-
const { logHookError } = await import('./hook-fast-
|
|
589
|
+
const { logHookError } = await import('./hook-fast-BSH6IHRN.js');
|
|
560
590
|
const reason = err instanceof Error ? err.message : String(err);
|
|
561
591
|
logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
|
|
562
592
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { LiveUploader } from './chunk-
|
|
4
|
-
import { spoolDir } from './chunk-
|
|
3
|
+
import { LiveUploader } from './chunk-QPC6OKD2.js';
|
|
4
|
+
import { spoolDir } from './chunk-EVAK6FAS.js';
|
|
5
5
|
import { parseRunEnv, parseWorkItemEnv } from './chunk-LGJ56FCM.js';
|
|
6
|
-
import { sessionFolderIn, legacyAgent } from './chunk-
|
|
6
|
+
import { sessionFolderIn, legacyAgent } from './chunk-XMJNIIPM.js';
|
|
7
7
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
8
|
-
import { CaptureDaemon } from './chunk-
|
|
8
|
+
import { CaptureDaemon } from './chunk-KTZOD7A3.js';
|
|
9
9
|
import { mkdirSync, writeFileSync, rmSync } from 'fs';
|
|
10
10
|
import { join } from 'path';
|
|
11
11
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { sanitizeTerminal } from './chunk-
|
|
4
|
-
import { resolvePackRoot, parseProofsConfig } from './chunk-
|
|
5
|
-
import { CHECK_ITEM_REF_PATH_MAX_LENGTH, CHECK_ITEM_REASON_MAX_LENGTH, CHECK_ITEMS_MAX, CheckItemsSchema, problemKind, CHECK_ITEM_REFS_MAX, CHECK_ITEM_ID_MAX_LENGTH, JUDGE_NOT_RUN_ITEM_ID, REVIEWED_COMMIT_ITEM_ID, TEAM_RULES_ITEM_ID } from './chunk-
|
|
3
|
+
import { sanitizeTerminal } from './chunk-WNFITHNX.js';
|
|
4
|
+
import { resolvePackRoot, parseProofsConfig } from './chunk-XMJNIIPM.js';
|
|
5
|
+
import { CHECK_ITEM_REF_PATH_MAX_LENGTH, CHECK_ITEM_REASON_MAX_LENGTH, CHECK_ITEMS_MAX, CheckItemsSchema, problemKind, CHECK_ITEM_REFS_MAX, CHECK_ITEM_ID_MAX_LENGTH, JUDGE_NOT_RUN_ITEM_ID, REVIEWED_COMMIT_ITEM_ID, TEAM_RULES_ITEM_ID } from './chunk-37WA2LQC.js';
|
|
6
6
|
import { createHash } from 'crypto';
|
|
7
7
|
import { join } from 'path';
|
|
8
8
|
import { pathToFileURL } from 'url';
|
|
@@ -2369,8 +2369,7 @@ function runnerMatcher(runners) {
|
|
|
2369
2369
|
// src/runner/diff-lines.ts
|
|
2370
2370
|
var HUNK = /^@@ -\d+(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;
|
|
2371
2371
|
var NEW_FILE = /^\+\+\+ b\/([^\t"].*?)\t?$/;
|
|
2372
|
-
function
|
|
2373
|
-
const files = /* @__PURE__ */ new Map();
|
|
2372
|
+
function walkHunks(patch, onHunk, onAdded) {
|
|
2374
2373
|
const lines = patch.split("\n");
|
|
2375
2374
|
let path2;
|
|
2376
2375
|
for (let at = 0; at < lines.length; at += 1) {
|
|
@@ -2388,20 +2387,44 @@ function diffLines(patch) {
|
|
|
2388
2387
|
let oldLeft = Number(hunk[1] ?? 1);
|
|
2389
2388
|
let newLeft = Number(hunk[3] ?? 1);
|
|
2390
2389
|
const start = Number(hunk[2]);
|
|
2391
|
-
if (path2 !== void 0 && newLeft > 0)
|
|
2390
|
+
if (path2 !== void 0 && newLeft > 0) onHunk(path2, start, start + newLeft - 1);
|
|
2391
|
+
let next = start;
|
|
2392
2392
|
while ((oldLeft > 0 || newLeft > 0) && at + 1 < lines.length) {
|
|
2393
2393
|
at += 1;
|
|
2394
2394
|
const mark = lines[at][0];
|
|
2395
2395
|
if (mark === "\\") continue;
|
|
2396
2396
|
if (mark !== "+") oldLeft -= 1;
|
|
2397
|
-
if (mark
|
|
2397
|
+
if (mark === "-") continue;
|
|
2398
|
+
if (mark === "+" && path2 !== void 0) onAdded(path2, next);
|
|
2399
|
+
newLeft -= 1;
|
|
2400
|
+
next += 1;
|
|
2398
2401
|
}
|
|
2399
2402
|
}
|
|
2403
|
+
}
|
|
2404
|
+
function diffLines(patch) {
|
|
2405
|
+
const files = /* @__PURE__ */ new Map();
|
|
2406
|
+
walkHunks(
|
|
2407
|
+
patch,
|
|
2408
|
+
(path2, first, last) => files.set(path2, [...files.get(path2) ?? [], [first, last]]),
|
|
2409
|
+
() => void 0
|
|
2410
|
+
);
|
|
2411
|
+
return files;
|
|
2412
|
+
}
|
|
2413
|
+
function addedLines(patch) {
|
|
2414
|
+
const files = /* @__PURE__ */ new Map();
|
|
2415
|
+
walkHunks(
|
|
2416
|
+
patch,
|
|
2417
|
+
() => void 0,
|
|
2418
|
+
(path2, line) => files.set(path2, (files.get(path2) ?? /* @__PURE__ */ new Set()).add(line))
|
|
2419
|
+
);
|
|
2400
2420
|
return files;
|
|
2401
2421
|
}
|
|
2402
2422
|
function lineInDiff(lines, path2, line) {
|
|
2403
2423
|
return (lines.get(path2) ?? []).some(([first, last]) => line >= first && line <= last);
|
|
2404
2424
|
}
|
|
2425
|
+
function lineAdded(lines, path2, line) {
|
|
2426
|
+
return lines.get(path2)?.has(line) === true;
|
|
2427
|
+
}
|
|
2405
2428
|
|
|
2406
2429
|
// src/runner/judge-items.ts
|
|
2407
2430
|
var ARTIFACT_PROOF_REASON = "Its declared artifact proves it; the judge does not judge artifacts.";
|
|
@@ -2587,6 +2610,11 @@ function wholeEntries(answer) {
|
|
|
2587
2610
|
}
|
|
2588
2611
|
function wholeItems(input) {
|
|
2589
2612
|
const lines = diffLines(input.patch);
|
|
2613
|
+
const added = addedLines(input.patch);
|
|
2614
|
+
const placeOf = (path2, line) => {
|
|
2615
|
+
const inDiff = lineInDiff(lines, path2, line);
|
|
2616
|
+
return inDiff ? { inDiff, changed: lineAdded(added, path2, line) } : { inDiff };
|
|
2617
|
+
};
|
|
2590
2618
|
const entries = wholeEntries(input.answer);
|
|
2591
2619
|
const ids = itemIds(entries.map((entry) => entry.id), input.clean);
|
|
2592
2620
|
const of = input.reviewers === void 0 ? 0 : Math.min(input.reviewers, 20);
|
|
@@ -2594,7 +2622,7 @@ function wholeItems(input) {
|
|
|
2594
2622
|
const reason = oneLineReason(entry.reason === void 0 ? void 0 : input.clean(entry.reason));
|
|
2595
2623
|
const { refs } = namedTests(entry.refs, { treeRoot: input.treeRoot, check: input.place, ownTree: input.ownTree });
|
|
2596
2624
|
const failing = entry.result === "fail";
|
|
2597
|
-
const placed = failing ? refs.map((ref) => ref.line === void 0 ? ref : { ...ref,
|
|
2625
|
+
const placed = failing ? refs.map((ref) => ref.line === void 0 ? ref : { ...ref, ...placeOf(ref.path, ref.line) }) : refs;
|
|
2598
2626
|
const finders = entry.foundBy?.length ?? (entry.reviewer === void 0 ? 0 : 1);
|
|
2599
2627
|
const found = failing && of > 1 && finders > 0 ? { foundBy: { count: Math.min(finders, of), of } } : {};
|
|
2600
2628
|
const severity = failing && entry.severity !== void 0 ? { severity: entry.severity } : {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { resolveDevcontainerCli, devcontainerBuildInvocation, universalImagePending, RecipeError } from './chunk-
|
|
4
|
-
import { ensureHostKey } from './chunk-
|
|
5
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-
|
|
6
|
-
import { BUILD_HOME, JOB_MOUNT, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-
|
|
7
|
-
import { primaryDestination, JOIN_DIR, RELAY_ID, JOIN_SOCKET, GATEWAY_PORT, TARGET_GATEWAY, GATEWAY_SOCKET, destinationTarget, providerDestinations, RELAY_USER } from './chunk-
|
|
8
|
-
import { judgeAgent, universalImagePinned, UNIVERSAL_IMAGE, BUILDKIT_IMAGE } from './chunk-
|
|
9
|
-
import { defaultAgents } from './chunk-
|
|
10
|
-
import { PROVIDERS } from './chunk-
|
|
11
|
-
import { compareVersions } from './chunk-
|
|
3
|
+
import { resolveDevcontainerCli, devcontainerBuildInvocation, universalImagePending, RecipeError } from './chunk-EYD5HOQ7.js';
|
|
4
|
+
import { ensureHostKey } from './chunk-I6G5CO3K.js';
|
|
5
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-D5TZYUGZ.js';
|
|
6
|
+
import { BUILD_HOME, JOB_MOUNT, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-WRIQGJKT.js';
|
|
7
|
+
import { primaryDestination, JOIN_DIR, RELAY_ID, JOIN_SOCKET, GATEWAY_PORT, TARGET_GATEWAY, GATEWAY_SOCKET, destinationTarget, providerDestinations, RELAY_USER } from './chunk-GAHP2AI3.js';
|
|
8
|
+
import { judgeAgent, universalImagePinned, UNIVERSAL_IMAGE, BUILDKIT_IMAGE } from './chunk-QS2O5G64.js';
|
|
9
|
+
import { defaultAgents } from './chunk-XMJNIIPM.js';
|
|
10
|
+
import { PROVIDERS } from './chunk-Q7Z6ELTL.js';
|
|
11
|
+
import { compareVersions } from './chunk-KTZOD7A3.js';
|
|
12
12
|
import { createHash } from 'crypto';
|
|
13
13
|
import { mkdirSync, createWriteStream, rmSync, existsSync, readFileSync, chmodSync, writeFileSync, realpathSync, readdirSync, renameSync } from 'fs';
|
|
14
14
|
import { dirname, join, posix, resolve } from 'path';
|
|
@@ -417,8 +417,8 @@ var JUDGE_HOME = `${JUDGE_DIR}/home`;
|
|
|
417
417
|
var JUDGE_TREE = `${JUDGE_DIR}/tree`;
|
|
418
418
|
var JUDGE_REPORT = `${JUDGE_DIR}/report.html`;
|
|
419
419
|
var JUDGE_ITEMS = `${JUDGE_DIR}/items.json`;
|
|
420
|
-
function judgeProgram(agents = defaultAgents()) {
|
|
421
|
-
return judgeAgent(agents)?.adapter.image?.program;
|
|
420
|
+
function judgeProgram(agents = defaultAgents(), job) {
|
|
421
|
+
return judgeAgent(agents, job)?.adapter.image?.program;
|
|
422
422
|
}
|
|
423
423
|
judgeProgram() ?? "";
|
|
424
424
|
function answerFileName(name) {
|
|
@@ -430,9 +430,10 @@ var MAX_ITEMS_BYTES = 1024 * 1024;
|
|
|
430
430
|
var JUDGE_MAX_TURNS = 60;
|
|
431
431
|
var JUDGE_PATH = "/opt/outerlayer/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
|
|
432
432
|
function judgeCommand(input, agents = defaultAgents()) {
|
|
433
|
-
const agent = judgeAgent(agents);
|
|
433
|
+
const agent = judgeAgent(agents, input.job);
|
|
434
434
|
if (agent?.adapter.headless === void 0) throw new Error(`${agent?.descriptor.label ?? "the agent list"} has no headless part, so it cannot run the judge`);
|
|
435
435
|
const headless = agent.adapter.headless;
|
|
436
|
+
if (headless.judge === void 0) throw new Error(`${agent.descriptor.label} cannot run the judge`);
|
|
436
437
|
const providers = PROVIDERS;
|
|
437
438
|
const fallback = primaryDestination(agents)?.port;
|
|
438
439
|
const spec = headless.judge({
|
|
@@ -447,7 +448,7 @@ function judgeCommand(input, agents = defaultAgents()) {
|
|
|
447
448
|
providerUrl: (provider) => `http://127.0.0.1:${providers[provider]?.destination.port ?? fallback}`,
|
|
448
449
|
credential: input.credential
|
|
449
450
|
});
|
|
450
|
-
if (spec.program !== judgeProgram(agents)) throw new Error(`${agent.descriptor.label} runs the judge as ${spec.program}, and not as its image program that the runner hashes`);
|
|
451
|
+
if (spec.program !== judgeProgram(agents, input.job)) throw new Error(`${agent.descriptor.label} runs the judge as ${spec.program}, and not as its image program that the runner hashes`);
|
|
451
452
|
return { argv: [spec.program, ...spec.args], env: spec.env, cwd: JUDGE_DIR };
|
|
452
453
|
}
|
|
453
454
|
function withAnswerProtocol(brief, subjects, options = {}) {
|
|
@@ -464,20 +465,21 @@ Write your answer as JSON to \`${options.answer ?? JUDGE_ITEMS}\`: ${items} A re
|
|
|
464
465
|
Then end your reply with one line \`unmet: <id>\` for each failing ${subjects === "criteria" ? "criterion" : "part"}, and a final line that is exactly \`result: pass\` or \`result: fail\`.
|
|
465
466
|
`;
|
|
466
467
|
}
|
|
468
|
+
var NODE = "/opt/outerlayer/bin/node";
|
|
467
469
|
var HASH_SCRIPT = 'const fs=require("fs"),c=require("crypto");const p=fs.realpathSync(process.argv[1]);process.stdout.write(c.createHash("sha256").update(fs.readFileSync(p)).digest("hex")+" "+p+"\\n")';
|
|
468
|
-
function hashArgv(agents = defaultAgents()) {
|
|
469
|
-
return [
|
|
470
|
+
function hashArgv(agents = defaultAgents(), job) {
|
|
471
|
+
return [NODE, "-e", HASH_SCRIPT, judgeProgram(agents, job) ?? ""];
|
|
470
472
|
}
|
|
471
473
|
hashArgv();
|
|
472
|
-
async function hashJudgeProgram(run, agents = defaultAgents()) {
|
|
473
|
-
const ran = await run([...hashArgv(agents)]);
|
|
474
|
+
async function hashJudgeProgram(run, agents = defaultAgents(), job) {
|
|
475
|
+
const ran = await run([...hashArgv(agents, job)]);
|
|
474
476
|
const sha256 = ran.status === 0 ? parseProgramHash(ran.stdout) : void 0;
|
|
475
477
|
return sha256 === void 0 ? { ok: false, reason: firstLine(ran.stderr) || `the hash could not be taken (exit ${ran.status})` } : { ok: true, sha256 };
|
|
476
478
|
}
|
|
477
|
-
async function judgeProgramRecord(run, agents = defaultAgents()) {
|
|
478
|
-
const path = judgeProgram(agents);
|
|
479
|
+
async function judgeProgramRecord(run, agents = defaultAgents(), job) {
|
|
480
|
+
const path = judgeProgram(agents, job);
|
|
479
481
|
if (path === void 0) return void 0;
|
|
480
|
-
const hashed = await hashJudgeProgram(run, agents);
|
|
482
|
+
const hashed = await hashJudgeProgram(run, agents, job);
|
|
481
483
|
return hashed.ok ? { path, sha256: hashed.sha256 } : void 0;
|
|
482
484
|
}
|
|
483
485
|
function parseProgramHash(stdout) {
|
|
@@ -928,4 +930,4 @@ function ensureBuilder(rawRun, spec, options = {}) {
|
|
|
928
930
|
);
|
|
929
931
|
}
|
|
930
932
|
|
|
931
|
-
export { BUILD_LABEL, COMMAND_DIR, JUDGE_DIR, JUDGE_ITEMS, JUDGE_MAX_TURNS, JUDGE_REPORT, JUDGE_TREE, MAX_ITEMS_BYTES, MAX_REPORT_BYTES, MIN_BUILDX_VERSION, NETWORK_HELPER_MEMORY, NETWORK_READY_FILE, RUNNER_LABEL, SAVED_STATE_LABEL, WORKSPACE_LABEL, answerFileName, builderName, builderNameFor, builderSpec, buildxState, childEnvironment, containerExecArgs, containerRunArgs, createDockerHost, dockerIdentity, ensureBuilder, ensureFailureCount, ensureRunnerIdentity, exceedsDisk, firstLine, hashJudgeProgram, homeCopyArgs, homeCopyRunArgs, homeCopyScript, identityArgs, identityDockerFor, identityRunArgs, identityScript, isOutOfDisk, isOutOfMemory, judgeCommand, judgeProgramRecord, mountableHome, networkHelperName, networkHelperRunArgs, parseIdentity, parseSize, pathLabelValue, prepareRunArgs, proxyEnvironment, readDu, readJobFile, readJobFileChecked, readRunnerIdentity, runnerLabelValue, said, spawnRun, trackImageBuild, withAnswerProtocol, writeJobFile };
|
|
933
|
+
export { BUILD_LABEL, COMMAND_DIR, JUDGE_DIR, JUDGE_HOME, JUDGE_ITEMS, JUDGE_MAX_TURNS, JUDGE_REPORT, JUDGE_TREE, MAX_ITEMS_BYTES, MAX_REPORT_BYTES, MIN_BUILDX_VERSION, NETWORK_HELPER_MEMORY, NETWORK_READY_FILE, NODE, RUNNER_LABEL, SAVED_STATE_LABEL, WORKSPACE_LABEL, answerFileName, builderName, builderNameFor, builderSpec, buildxState, childEnvironment, containerExecArgs, containerRunArgs, createDockerHost, dockerIdentity, ensureBuilder, ensureFailureCount, ensureRunnerIdentity, exceedsDisk, firstLine, hashJudgeProgram, homeCopyArgs, homeCopyRunArgs, homeCopyScript, identityArgs, identityDockerFor, identityRunArgs, identityScript, isOutOfDisk, isOutOfMemory, judgeCommand, judgeProgram, judgeProgramRecord, mountableHome, networkHelperName, networkHelperRunArgs, parseIdentity, parseSize, pathLabelValue, prepareRunArgs, proxyEnvironment, readDu, readJobFile, readJobFileChecked, readRunnerIdentity, runnerLabelValue, said, spawnRun, trackImageBuild, withAnswerProtocol, writeJobFile };
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { withInjectedPrograms } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { withInjectedPrograms } from './chunk-2RUTYYYA.js';
|
|
4
|
+
import { setupMachineSkills } from './chunk-LOWZZ4QA.js';
|
|
5
|
+
import { sharedSkillNames } from './chunk-QKVOUI56.js';
|
|
6
|
+
import { versionAtLeast, GOVERNANCE_VARIABLE, CONTROL_PLANE_DIR_VARIABLE } from './chunk-DJK3IK6K.js';
|
|
6
7
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import './chunk-
|
|
10
|
-
import
|
|
8
|
+
import { STALL_EXIT } from './chunk-MQ6SKVLA.js';
|
|
9
|
+
export { STALL_EXIT } from './chunk-MQ6SKVLA.js';
|
|
10
|
+
import { defaultAgents, agentById, legacyAgent } from './chunk-XMJNIIPM.js';
|
|
11
|
+
import './chunk-B6W2LW7E.js';
|
|
12
|
+
import { LEGACY_AGENT } from './chunk-Q7Z6ELTL.js';
|
|
11
13
|
import './chunk-VSBG7MMU.js';
|
|
12
14
|
import './chunk-RA3O54FC.js';
|
|
13
15
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
16
|
+
import './chunk-KTZOD7A3.js';
|
|
17
|
+
import './chunk-37WA2LQC.js';
|
|
16
18
|
import './chunk-Z5GEFMRW.js';
|
|
17
19
|
import { spawn, execFileSync } from 'child_process';
|
|
18
20
|
import { existsSync, readdirSync, lstatSync, readFileSync, writeFileSync, rmSync, mkdirSync, realpathSync, symlinkSync, renameSync, readlinkSync, statSync } from 'fs';
|
|
@@ -167,6 +169,27 @@ function runClaudeLauncher(args, deps = {}) {
|
|
|
167
169
|
}
|
|
168
170
|
|
|
169
171
|
// src/claude-launcher.ts
|
|
172
|
+
var STALL_RECENT_MS = 6e4;
|
|
173
|
+
function stallWatcher(input) {
|
|
174
|
+
const error = new RegExp(input.pattern);
|
|
175
|
+
let since;
|
|
176
|
+
let latest = 0;
|
|
177
|
+
return {
|
|
178
|
+
line(text) {
|
|
179
|
+
if (text.trim() === "") return;
|
|
180
|
+
if (error.test(text)) {
|
|
181
|
+
const at = input.now();
|
|
182
|
+
since ??= at;
|
|
183
|
+
latest = at;
|
|
184
|
+
} else since = void 0;
|
|
185
|
+
},
|
|
186
|
+
stalled: () => since !== void 0 && input.now() - since >= input.afterMs && input.now() - latest <= Math.min(input.afterMs, STALL_RECENT_MS)
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function windowText(ms) {
|
|
190
|
+
if (ms % 6e4 === 0) return ms === 6e4 ? "1 minute" : `${ms / 6e4} minutes`;
|
|
191
|
+
return `${ms / 1e3} seconds`;
|
|
192
|
+
}
|
|
170
193
|
function readDeliveryRecord(cwd) {
|
|
171
194
|
let common;
|
|
172
195
|
try {
|
|
@@ -187,24 +210,51 @@ function readDeliveryRecord(cwd) {
|
|
|
187
210
|
}
|
|
188
211
|
var SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
189
212
|
var SIGNAL_NUMBERS = { SIGHUP: 1, SIGINT: 2, SIGTERM: 15 };
|
|
213
|
+
var KILL_AFTER_MS = 1e4;
|
|
190
214
|
function runWith(prefix) {
|
|
191
|
-
return (program, argv, env, cwd, stderr) => new Promise((done) => {
|
|
192
|
-
const
|
|
215
|
+
return (program, argv, env, cwd, stderr, options = {}) => new Promise((done) => {
|
|
216
|
+
const watched = options.stall !== void 0;
|
|
217
|
+
const closed = options.stdin === "";
|
|
218
|
+
const child = spawn(program, argv, { cwd, env, stdio: !watched && !closed ? "inherit" : [closed ? "ignore" : "inherit", watched ? "pipe" : "inherit", "inherit"] });
|
|
193
219
|
const forward = (signal) => () => {
|
|
194
220
|
child.kill(signal);
|
|
195
221
|
};
|
|
196
222
|
const handlers = SIGNALS.map((signal) => [signal, forward(signal)]);
|
|
197
223
|
for (const [signal, handler] of handlers) process.on(signal, handler);
|
|
224
|
+
let stopped = false;
|
|
225
|
+
let timer;
|
|
226
|
+
let killer;
|
|
198
227
|
const finish = (code) => {
|
|
199
228
|
for (const [signal, handler] of handlers) process.off(signal, handler);
|
|
200
|
-
|
|
229
|
+
if (timer !== void 0) clearInterval(timer);
|
|
230
|
+
if (killer !== void 0) clearTimeout(killer);
|
|
231
|
+
done(stopped ? STALL_EXIT : code);
|
|
201
232
|
};
|
|
233
|
+
if (options.stall !== void 0) {
|
|
234
|
+
const { afterMs } = options.stall;
|
|
235
|
+
const watcher = stallWatcher({ pattern: options.stall.pattern, afterMs, now: Date.now });
|
|
236
|
+
let pending = "";
|
|
237
|
+
child.stdout.on("data", (chunk) => {
|
|
238
|
+
process.stdout.write(chunk);
|
|
239
|
+
const lines = (pending + chunk.toString("utf8")).split("\n");
|
|
240
|
+
pending = lines.pop() ?? "";
|
|
241
|
+
for (const text of lines) watcher.line(text);
|
|
242
|
+
});
|
|
243
|
+
timer = setInterval(() => {
|
|
244
|
+
if (stopped || !watcher.stalled()) return;
|
|
245
|
+
stopped = true;
|
|
246
|
+
stderr(`${prefix} stopped ${program}: its output held only errors for ${windowText(afterMs)}
|
|
247
|
+
`);
|
|
248
|
+
child.kill("SIGTERM");
|
|
249
|
+
killer = setTimeout(() => child.kill("SIGKILL"), KILL_AFTER_MS);
|
|
250
|
+
}, Math.min(1e3, Math.max(50, afterMs / 4)));
|
|
251
|
+
}
|
|
202
252
|
child.on("error", (err) => {
|
|
203
253
|
stderr(`${prefix} could not start ${program}: ${err.message}
|
|
204
254
|
`);
|
|
205
255
|
finish(127);
|
|
206
256
|
});
|
|
207
|
-
child.on("exit", (code, signal) => finish(code ?? 128 + (signal === null ? 0 : SIGNAL_NUMBERS[signal] ?? 0)));
|
|
257
|
+
child.on(watched ? "close" : "exit", (code, signal) => finish(code ?? 128 + (signal === null ? 0 : SIGNAL_NUMBERS[signal] ?? 0)));
|
|
208
258
|
});
|
|
209
259
|
}
|
|
210
260
|
function ownSkillsDirFor(prefix, cwd, home, shared, stderr) {
|
|
@@ -227,7 +277,7 @@ function withoutSessionVariables(env) {
|
|
|
227
277
|
var SIGNAL_EXIT = 128;
|
|
228
278
|
async function runWithResumeFallback(input) {
|
|
229
279
|
const code = await input.run(input.resumeArgs);
|
|
230
|
-
if (!input.resumes || code === 0 || code >= SIGNAL_EXIT || input.hasReply()) return code;
|
|
280
|
+
if (!input.resumes || code === 0 || code >= SIGNAL_EXIT || code === STALL_EXIT || input.hasReply()) return code;
|
|
231
281
|
input.removeTranscript();
|
|
232
282
|
input.writeMarker();
|
|
233
283
|
return input.run(input.freshArgs);
|
|
@@ -241,13 +291,13 @@ async function start(context, args, env) {
|
|
|
241
291
|
const sessionId = flagged && env[SESSION_ID_VARIABLE] ? env[SESSION_ID_VARIABLE] : void 0;
|
|
242
292
|
const resumePath = flagged && env[RESUME_SESSION_VARIABLE] ? env[RESUME_SESSION_VARIABLE] : void 0;
|
|
243
293
|
const specFor = (flags) => {
|
|
244
|
-
const spec = launch.interactive({ cwd: context.cwd, program: context.program, callerArgs: [...flags, ...args], env: sessionEnv, controlPlane: context.controlPlane, ownSkills: context.ownSkills });
|
|
294
|
+
const spec = launch.interactive({ cwd: context.cwd, program: context.program, callerArgs: session?.place?.(flags, args) ?? [...flags, ...args], env: sessionEnv, controlPlane: context.controlPlane, ownSkills: context.ownSkills });
|
|
245
295
|
return context.controlPlane === void 0 ? spec : { ...spec, env: { ...spec.env, [CONTROL_PLANE_DIR_VARIABLE]: context.controlPlane } };
|
|
246
296
|
};
|
|
247
297
|
const run = async (flags) => {
|
|
248
298
|
const spec = specFor(flags);
|
|
249
299
|
try {
|
|
250
|
-
return await context.runProgram(spec.program, [...spec.args], spec.env, context.cwd, stderr);
|
|
300
|
+
return await context.runProgram(spec.program, [...spec.args], spec.env, context.cwd, stderr, { ...spec.stdin === void 0 ? {} : { stdin: spec.stdin }, ...spec.stall === void 0 ? {} : { stall: spec.stall } });
|
|
251
301
|
} finally {
|
|
252
302
|
try {
|
|
253
303
|
launch.finish?.(spec);
|
|
@@ -342,7 +392,7 @@ async function runAgentLauncher(agentId, args, deps = {}) {
|
|
|
342
392
|
return 1;
|
|
343
393
|
}
|
|
344
394
|
} else {
|
|
345
|
-
const { resolveLaunchPlane } = await import('./control-plane-launch-
|
|
395
|
+
const { resolveLaunchPlane } = await import('./control-plane-launch-BPJQYN6J.js');
|
|
346
396
|
const plane = env[GOVERNANCE_VARIABLE] === "self" ? { kind: "none" } : await resolveLaunchPlane({ cwd, env, home, fetchImpl: deps.fetchImpl, stderr });
|
|
347
397
|
if (plane.kind === "none") {
|
|
348
398
|
const own2 = ownSkillsDirFor(prefix, cwd, home, /* @__PURE__ */ new Set(), stderr);
|
|
@@ -365,4 +415,4 @@ async function runAgentLauncher(agentId, args, deps = {}) {
|
|
|
365
415
|
return start({ prefix, launch, program, controlPlane: dir, ownSkills: own, runProgram, cwd, stderr }, args, env);
|
|
366
416
|
}
|
|
367
417
|
|
|
368
|
-
export { runAgentLauncher, runClaudeLauncher, runWith, runWithResumeFallback };
|
|
418
|
+
export { runAgentLauncher, runClaudeLauncher, runWith, runWithResumeFallback, stallWatcher };
|