@outerlayer/cli 0.38.0-next.20261106012958 → 0.38.0-next.20261106232046
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 +19 -3
- package/dist/agent-setup-IJNDJ4XL.js +40 -0
- package/dist/{agent-subcommand-UNSXJUHA.js → agent-subcommand-XECZFIAS.js} +4 -4
- package/dist/{artifact-link-cmd-QP6VO7AJ.js → artifact-link-cmd-F6M2BDT7.js} +2 -2
- package/dist/{bridge-JI4IO7JN.js → bridge-LDKKFAHH.js} +7 -7
- package/dist/{build-2L3L2OJO.js → build-PTFRHSXI.js} +13 -13
- package/dist/{build-disk-CKBEEF4N.js → build-disk-EO2VG3MF.js} +11 -11
- package/dist/build-info.json +1 -1
- package/dist/{builder-PKDA7X2H.js → builder-LCIBBOWQ.js} +10 -10
- package/dist/caller-Y3RGYXHU.js +23 -0
- package/dist/{check-FG32SYJF.js → check-BNDMAAVS.js} +72 -56
- package/dist/{chunk-T524XQKI.js → chunk-2IVRTP6M.js} +1 -1
- package/dist/{chunk-NEEMG462.js → chunk-2KL345FW.js} +1 -1
- package/dist/{chunk-YXXJBHHF.js → chunk-2VNT47DG.js} +10 -2
- package/dist/{chunk-FGVVBYCT.js → chunk-3HEBSWNE.js} +1 -1
- package/dist/{chunk-RUJR3SDB.js → chunk-3UKDQNFF.js} +1 -1
- package/dist/{chunk-O4Z2YVC3.js → chunk-6AKP3FBS.js} +5 -5
- package/dist/{chunk-VWNQRD4I.js → chunk-6IXZHORY.js} +4 -4
- package/dist/{chunk-VNT2IRLM.js → chunk-6Y4ZE74I.js} +70 -11
- package/dist/{chunk-ONOINHY4.js → chunk-7GQE5D72.js} +1 -1
- package/dist/{chunk-EXIZ3G6I.js → chunk-7VVTZNUP.js} +6 -6
- package/dist/{chunk-DXBYNJRM.js → chunk-B7CAUXSV.js} +6 -6
- package/dist/{chunk-TAEDH2SU.js → chunk-BEQYO2VO.js} +1 -1
- package/dist/{chunk-QWDGHEQL.js → chunk-BJYX3PMU.js} +1 -1
- package/dist/{chunk-CGXYPLK3.js → chunk-BU25W7GF.js} +2 -2
- package/dist/{chunk-X2DX3A7H.js → chunk-C3P637LO.js} +1 -1
- package/dist/{chunk-4MSEUIMK.js → chunk-DDPCKTVN.js} +7 -7
- package/dist/{chunk-EERD7VI3.js → chunk-DRUM7NWK.js} +1 -1
- package/dist/{chunk-GMRVWRHD.js → chunk-EOXQCUFJ.js} +2 -2
- package/dist/{chunk-U7L4GBGS.js → chunk-FPPBL7ZC.js} +1 -1
- package/dist/{chunk-EFAOERZH.js → chunk-FSQDS7A6.js} +1 -1
- package/dist/{chunk-YWWW47OY.js → chunk-FSYEDSSA.js} +1 -1
- package/dist/{chunk-3FAJMXBA.js → chunk-FZD6GIW5.js} +9 -9
- package/dist/{chunk-KLQLQQGG.js → chunk-GMLYSAKU.js} +3 -3
- package/dist/{chunk-ABN4UBR5.js → chunk-HCIOUSUX.js} +2 -3
- package/dist/{chunk-QONY6C2B.js → chunk-HI5FSBWD.js} +15 -9
- package/dist/{chunk-3XWZKL2P.js → chunk-ICKFR2DB.js} +7 -7
- package/dist/{chunk-JTDMSQMI.js → chunk-IQHREL5T.js} +8 -8
- package/dist/{chunk-FOUG2R4Q.js → chunk-LPTMKPCD.js} +1 -1
- package/dist/{chunk-HG2ZG6ZU.js → chunk-LQEI4HZF.js} +1 -1
- package/dist/{chunk-ZTJTAKVW.js → chunk-LYBHKNEG.js} +1 -1
- package/dist/{chunk-5VAXNAOD.js → chunk-LYORNXIT.js} +1 -1
- package/dist/{chunk-OVHBDADU.js → chunk-MLM4BYK2.js} +1 -1
- package/dist/{chunk-RSRNZB4T.js → chunk-MXSQINKG.js} +7 -7
- package/dist/{chunk-L4ACBB5R.js → chunk-NDLWXIVK.js} +1 -1
- package/dist/{chunk-S7CE7QCF.js → chunk-NMSWL2N3.js} +3 -3
- package/dist/{chunk-XDRZ3BNA.js → chunk-NOBB3LEO.js} +1 -1
- package/dist/{chunk-256R6O56.js → chunk-O3TOA2KE.js} +8 -5
- package/dist/{chunk-YZRDJOOR.js → chunk-OAOZDJYT.js} +3 -3
- package/dist/{chunk-IXB2IIEW.js → chunk-OCQ5FQZR.js} +1 -1
- package/dist/{chunk-AVEF3T6Y.js → chunk-OO33S4AF.js} +7 -5
- package/dist/{chunk-BO3NOGKE.js → chunk-OSHKKESX.js} +77 -8
- package/dist/{chunk-RZ6WJTUP.js → chunk-PJNOTSB5.js} +1 -1
- package/dist/{chunk-ZLJXMXZP.js → chunk-PVLDVUNJ.js} +2 -2
- package/dist/{chunk-MPE4NOKD.js → chunk-QF6US5YN.js} +2 -2
- package/dist/{chunk-OUHM6U6Z.js → chunk-QHT6PIFP.js} +144 -5
- package/dist/{chunk-45TFVWNT.js → chunk-QQSXVGVH.js} +6 -6
- package/dist/{chunk-DVFGCVTV.js → chunk-QZAZPRDW.js} +5 -5
- package/dist/{chunk-XE2PXGZT.js → chunk-RWNVQSGX.js} +3 -3
- package/dist/{chunk-EHJYXABQ.js → chunk-RZXP427Z.js} +1 -1
- package/dist/{chunk-OGQW7A4G.js → chunk-S35KTDTM.js} +10 -10
- package/dist/{chunk-3DVCPRKE.js → chunk-SDUCKX46.js} +9 -9
- package/dist/{chunk-CCMKLF7K.js → chunk-SEAVWMW2.js} +6 -6
- package/dist/{chunk-BL6CCU26.js → chunk-SOB4KVRZ.js} +6 -6
- package/dist/{chunk-U5EE7PGC.js → chunk-SYENSVOK.js} +3 -3
- package/dist/{chunk-2MQQASWB.js → chunk-SZQKS4QK.js} +6 -6
- package/dist/{chunk-ERQLHUWU.js → chunk-TWWAV67F.js} +5 -5
- package/dist/{chunk-Z4R36YDJ.js → chunk-V26DDAWZ.js} +1367 -548
- package/dist/{chunk-OFWNBTLU.js → chunk-V43NFQE3.js} +1 -1
- package/dist/{chunk-WF2NXBOM.js → chunk-VLAVNWM4.js} +7 -7
- package/dist/{chunk-SMFWLPXC.js → chunk-VW5NG2AR.js} +19 -18
- package/dist/{chunk-PARDL7HH.js → chunk-VYAFSV43.js} +1 -1
- package/dist/{chunk-DL5N6V3D.js → chunk-VZGTPITG.js} +1 -1
- package/dist/{chunk-AJC5Q2NY.js → chunk-WCBLLIPD.js} +5 -5
- package/dist/{chunk-AMG5ICDO.js → chunk-WCQJNDQC.js} +4 -4
- package/dist/{chunk-YKWOVYVN.js → chunk-WDJPGE6K.js} +9 -6
- package/dist/{chunk-MDKLSY43.js → chunk-WX7XACEU.js} +1 -1
- package/dist/{chunk-5R5FEPLH.js → chunk-X25VXXCF.js} +99 -18
- package/dist/{chunk-ZO3RUMUR.js → chunk-X32HZMMA.js} +4 -4
- package/dist/{chunk-K6JOU4CT.js → chunk-XDURUWQP.js} +156 -51
- package/dist/{chunk-FER7JJ3S.js → chunk-XKJZHY4J.js} +1 -1
- package/dist/{chunk-PMJ6IEUM.js → chunk-XSEAGCYW.js} +7 -7
- package/dist/{chunk-ZCEM4GJ5.js → chunk-YFARFA4Y.js} +3 -3
- package/dist/{chunk-DK5YFDYI.js → chunk-YSCRMX2T.js} +8 -8
- package/dist/{claude-launcher-FHQTSQOM.js → claude-launcher-62NZAUKT.js} +7 -7
- package/dist/{cli-GNC4MFMP.js → cli-GJQGNNFM.js} +161 -154
- package/dist/{command-47EYM2FJ.js → command-3QXN5ZTK.js} +59 -52
- package/dist/config-4YPIDOHH.js +22 -0
- package/dist/{connect-cmd-4JO2LBUT.js → connect-cmd-GAWR7QSH.js} +13 -13
- package/dist/{container-start-XR7KANS6.js → container-start-FZCTPBZG.js} +48 -48
- package/dist/{context-cleanup-6CTKLEUT.js → context-cleanup-L3ZKG6EU.js} +4 -4
- package/dist/{context-show-cmd-Z7NQAKNE.js → context-show-cmd-YJ4IJ2WI.js} +14 -14
- package/dist/{control-plane-launch-4PLBJKBS.js → control-plane-launch-GOKEVTPX.js} +14 -14
- package/dist/{demo-record-cmd-3B2ME2ZI.js → demo-record-cmd-AZSEQXO4.js} +8 -8
- package/dist/{demo-voice-cmd-LIXAA3OS.js → demo-voice-cmd-KHEMTR5T.js} +20 -20
- package/dist/{dist-3TV6G4YF.js → dist-RMEOTTVL.js} +2 -2
- package/dist/{docker-FPEQS6HK.js → docker-QMKIWXHF.js} +10 -10
- package/dist/{doctor-AFH6UUX6.js → doctor-5PTO2DN7.js} +56 -50
- package/dist/{emit-artifact-cmd-5XIEUWFX.js → emit-artifact-cmd-72QEOEJH.js} +19 -19
- package/dist/{emit-cmd-IKYF27IK.js → emit-cmd-X5F5HUTQ.js} +7 -7
- package/dist/{emit-criteria-cmd-YS5ZSLCN.js → emit-criteria-cmd-HTHETRH6.js} +16 -16
- package/dist/{emit-demo-cmd-IDC2JC46.js → emit-demo-cmd-LFYJURFC.js} +20 -20
- package/dist/{emit-finding-cmd-C4NRTIZO.js → emit-finding-cmd-GFWCMJFY.js} +16 -16
- package/dist/{emit-result-cmd-GC2I7JQU.js → emit-result-cmd-FTWLKM6G.js} +18 -18
- package/dist/{emit-step-cmd-TTH4FYFW.js → emit-step-cmd-J4L2OAWE.js} +16 -16
- package/dist/{exec-client-DT5EWVQL.js → exec-client-YQH4ZSRM.js} +8 -8
- package/dist/find-unit-F3Q54LLR.js +24 -0
- package/dist/{findings-cmd-MSV52ODM.js → findings-cmd-VFE7VINC.js} +16 -16
- package/dist/{fleet-readiness-O76CSI7M.js → fleet-readiness-FGQPCFSP.js} +14 -14
- package/dist/{governing-source-QEFYVBQF.js → governing-source-NMZSHEHR.js} +21 -21
- package/dist/{guest-init-X7M5AIOI.js → guest-init-DPZAVCWH.js} +9 -9
- package/dist/{hook-fast-T6FOTZHA.js → hook-fast-3VMKCCUO.js} +1 -1
- package/dist/{hook-install-OUSUHQ6C.js → hook-install-TTF6LASI.js} +4 -4
- package/dist/host-checks-ANVIJJZI.js +79 -0
- package/dist/host-key-QZWN6ECO.js +18 -0
- package/dist/{image-tag-AE6EKDPV.js → image-tag-5TZ7MF5H.js} +8 -8
- package/dist/index.js +4 -4
- package/dist/{init-PUN3PKOT.js → init-5ZTKM5KM.js} +46 -46
- package/dist/init-6AAXECDJ.js +79 -0
- package/dist/{init-agent-D3KK24QX.js → init-agent-FOR3XGZ2.js} +46 -46
- package/dist/{init-cmd-LGRN3U7K.js → init-cmd-7X22EFRG.js} +27 -27
- package/dist/{init-update-ZL2J7EQI.js → init-update-JLOPXC5U.js} +24 -24
- package/dist/{install-cmd-4ID4VBH2.js → install-cmd-JDA4CNYW.js} +10 -10
- package/dist/{layout-G6K72TXK.js → layout-AKKICGLZ.js} +4 -4
- package/dist/{login-browser-I6CWBA7K.js → login-browser-VNPN4FVO.js} +2 -2
- package/dist/{logs-DIA3NWC2.js → logs-WPNNAY5E.js} +7 -7
- package/dist/loop-DFDQQC2Q.js +90 -0
- package/dist/machine-W3R5I6EM.js +79 -0
- package/dist/{machine-skills-JLJJDXBS.js → machine-skills-GGLBQANZ.js} +4 -4
- package/dist/{mcp-install-cmd-OTAX7QP2.js → mcp-install-cmd-3NHDPAML.js} +4 -4
- package/dist/{mcp-serve-cmd-63KQEQYS.js → mcp-serve-cmd-CLVZFL37.js} +9 -9
- package/dist/{paths-KVMMJQ7T.js → paths-PSLRVOVY.js} +7 -7
- package/dist/pending-GWDAXQSA.js +18 -0
- package/dist/{pidfile-NCBBWZNH.js → pidfile-5E4YPCTC.js} +8 -8
- package/dist/{record-PQDJVKYV.js → record-7ZMZA5QE.js} +8 -8
- package/dist/relay-UUIHK5TY.js +474 -0
- package/dist/{relay-protocol-PJ2HOP6B.js → relay-protocol-MQVXSFN4.js} +5 -5
- package/dist/{runner-agents-CEW4Z3FR.js → runner-agents-M5CMF2ZA.js} +4 -4
- package/dist/runner-env-3S64BNCU.js +24 -0
- package/dist/{runner-identity-IJKE4SRJ.js → runner-identity-3GMF6FKI.js} +10 -10
- package/dist/{runner-key-4J4MHN3S.js → runner-key-NS5C5TTT.js} +46 -46
- package/dist/{session-sender-HKNACIH5.js → session-sender-M325MH5U.js} +19 -19
- package/dist/{spec-cmd-4R7AYTBU.js → spec-cmd-QIVFOHR4.js} +17 -17
- package/dist/{starter-pack-6C7HPT4O.js → starter-pack-P5BRWSAP.js} +5 -5
- package/dist/state-5H5LGYWN.js +18 -0
- package/dist/{status-GMVC666R.js → status-5YK3LOVJ.js} +46 -46
- package/dist/{sync-cmd-UMAENSGZ.js → sync-cmd-JHFRUMM5.js} +18 -18
- package/dist/update-steps-KFULBARX.js +80 -0
- package/dist/{watch-RAUF223H.js → watch-TVHFOLVK.js} +18 -18
- package/dist/{work-claim-cmd-A3ISXUFA.js → work-claim-cmd-LTIAXIWH.js} +23 -23
- package/dist/{work-cmd-U7YLMDZ7.js → work-cmd-VC353JLU.js} +16 -16
- package/dist/{work-comment-cmd-CMWMOWVG.js → work-comment-cmd-SRQXRRJT.js} +18 -18
- package/dist/{work-demo-cmd-EKTJHIVM.js → work-demo-cmd-INUFIHU4.js} +16 -16
- package/dist/{work-logs-cmd-Z3QOFYTJ.js → work-logs-cmd-TMJC7RRS.js} +16 -16
- package/dist/{work-open-pr-cmd-NJXIX3QZ.js → work-open-pr-cmd-O6XW2YGD.js} +17 -17
- package/dist/{work-pr-cmd-JUV3SN7I.js → work-pr-cmd-QSE3BH3Z.js} +16 -16
- package/dist/{work-proofs-cmd-MIDPIFTH.js → work-proofs-cmd-FXSVPQZC.js} +18 -18
- package/dist/{work-proofs-record-6FTMJDQG.js → work-proofs-record-KPRP3UAQ.js} +24 -24
- package/dist/{work-stop-cmd-Z7MYNR7R.js → work-stop-cmd-J77H7RLL.js} +16 -16
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-build/SKILL.md +6 -7
- package/skill-pack/maintained/outerlayer-build/references/code-review-judge.md +80 -0
- package/skill-pack/maintained/outerlayer-build/references/release.md +0 -15
- package/skill-pack/maintained/outerlayer-build/references/review-loop.md +1 -3
- package/skill-pack/maintained/outerlayer-evidence/SKILL.md +3 -7
- package/dist/agent-setup-CBEPGNFY.js +0 -40
- package/dist/caller-XETCC46J.js +0 -23
- package/dist/config-EA6WVKAS.js +0 -22
- package/dist/find-unit-337Y4QAC.js +0 -24
- package/dist/host-checks-OXB5J3KR.js +0 -79
- package/dist/host-key-UFUIBFBF.js +0 -18
- package/dist/init-V7X3KA7B.js +0 -79
- package/dist/loop-AWBFKDV7.js +0 -90
- package/dist/machine-BZPKYURG.js +0 -79
- package/dist/pending-2IE3VBAN.js +0 -18
- package/dist/relay-QDB526DJ.js +0 -223
- package/dist/runner-env-23OLQBQZ.js +0 -24
- package/dist/state-DPEWDXQN.js +0 -18
- package/dist/update-steps-GTXNCG3Z.js +0 -80
- package/skill-pack/validators/code-review.yaml +0 -30
|
@@ -224,10 +224,12 @@ function assessSyncHealth(status, now = Date.now(), staleAfterMs = SYNC_STALE_AF
|
|
|
224
224
|
const verifiedAt = status.contacted === false ? status.lastOkAt : status.at;
|
|
225
225
|
const verifiedAge = verifiedAt === void 0 ? null : now - Date.parse(verifiedAt);
|
|
226
226
|
if (verifiedAge !== null && verifiedAge > staleAfterMs) {
|
|
227
|
+
const onlyUnlaunched = status.contacted === false && (status.skippedNotLaunched ?? 0) > 0 && !status.pending && !status.held;
|
|
227
228
|
return {
|
|
228
229
|
level: "warn",
|
|
229
230
|
headline: `last successful sync ${formatAgo(verifiedAge)}`,
|
|
230
|
-
details: [`destination ${host}`, "expected continuously while you are coding"]
|
|
231
|
+
details: onlyUnlaunched ? [`destination ${host}`, `${status.skippedNotLaunched} transcript(s) were not launched with OUTERLAYER_WORK, so none may upload`] : [`destination ${host}`, "expected continuously while you are coding"],
|
|
232
|
+
...onlyUnlaunched ? { notLaunched: true } : {}
|
|
231
233
|
};
|
|
232
234
|
}
|
|
233
235
|
if (status.synced === 0 && (status.skippedNotLaunched ?? 0) > 0) {
|
|
@@ -237,7 +239,8 @@ function assessSyncHealth(status, now = Date.now(), staleAfterMs = SYNC_STALE_AF
|
|
|
237
239
|
details: [
|
|
238
240
|
`${status.skippedNotLaunched} transcript(s) were not launched with OUTERLAYER_WORK, so none may upload`,
|
|
239
241
|
"launch a session with OUTERLAYER_WORK naming its issue to upload it"
|
|
240
|
-
]
|
|
242
|
+
],
|
|
243
|
+
notLaunched: true
|
|
241
244
|
};
|
|
242
245
|
}
|
|
243
246
|
if (verifiedAge === null) {
|
|
@@ -609,7 +612,7 @@ async function missingRenewalHookContext(home, cwd, codec) {
|
|
|
609
612
|
try {
|
|
610
613
|
const event = codec.events.find((name) => kindOf(codec, name) === "tool-used");
|
|
611
614
|
if (event === void 0) return void 0;
|
|
612
|
-
const { hookRegistered } = await import('./hook-install-
|
|
615
|
+
const { hookRegistered } = await import('./hook-install-TTF6LASI.js');
|
|
613
616
|
const registered = hookRegistered(event, { home, cwd });
|
|
614
617
|
if (registered !== false) return void 0;
|
|
615
618
|
return `This install has no ${event} hook, so this session's work-item lease will never be renewed while it works and may be lost to another worker mid-session. Run \`${cliInvocation()} init\` to register it.`;
|
|
@@ -809,11 +812,11 @@ async function missingControlPlane(cwd, sessionId, home, env) {
|
|
|
809
812
|
const dirs = findGitDirs(cwd);
|
|
810
813
|
if (dirs === void 0) return void 0;
|
|
811
814
|
if (existsSync(join(dirs.gitCommonDir, "outerlayer", "materialized.json")) || hasExcludeBlock(dirs.gitCommonDir)) {
|
|
812
|
-
const { cleanupEarlierCopies } = await import('./context-cleanup-
|
|
815
|
+
const { cleanupEarlierCopies } = await import('./context-cleanup-L3ZKG6EU.js');
|
|
813
816
|
cleanupEarlierCopies(dirs);
|
|
814
817
|
}
|
|
815
818
|
if (!contextPossiblyGoverned(cwd, home)) return void 0;
|
|
816
|
-
const { governanceOf } = await import('./control-plane-launch-
|
|
819
|
+
const { governanceOf } = await import('./control-plane-launch-GOKEVTPX.js');
|
|
817
820
|
if (await governanceOf({ cwd, env, home }) !== "governed") return void 0;
|
|
818
821
|
recordMissingContext(dirs, sessionId, home);
|
|
819
822
|
const launcher = `${cliInvocation()} ${LEGACY.legacy.subcommand}`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { TUNNEL_PORT, BRIDGE_ADDRESS, BRIDGE_CIDR } from './chunk-
|
|
3
|
+
import { TUNNEL_PORT, BRIDGE_ADDRESS, BRIDGE_CIDR } from './chunk-7GQE5D72.js';
|
|
4
4
|
import { startTimeOf } from './chunk-JBJTC3UU.js';
|
|
5
|
-
import { EXEC_PORT } from './chunk-
|
|
6
|
-
import { RELAY_PORT } from './chunk-
|
|
5
|
+
import { EXEC_PORT } from './chunk-SYENSVOK.js';
|
|
6
|
+
import { RELAY_PORT } from './chunk-QHT6PIFP.js';
|
|
7
7
|
import { spawn, spawnSync } from 'child_process';
|
|
8
8
|
import { symlinkSync, lstatSync, writeFileSync, chmodSync, mkdirSync, existsSync } from 'fs';
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
4
|
-
import { ArtifactTombstoneRecordSchema, ArtifactSpoolRecordSchema } from './chunk-
|
|
4
|
+
import { ArtifactTombstoneRecordSchema, ArtifactSpoolRecordSchema } from './chunk-2VNT47DG.js';
|
|
5
5
|
import { mkdirSync, appendFileSync, writeFileSync, renameSync, unlinkSync, existsSync, readdirSync, readFileSync, statSync } from 'fs';
|
|
6
6
|
import { join, dirname } from 'path';
|
|
7
7
|
|
|
@@ -5,8 +5,8 @@ import { CLAUDE_CODE, OPENCODE, NATIVE_AGENTS, LEGACY_AGENT, homeRelative } from
|
|
|
5
5
|
import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
|
|
6
6
|
import { resolvePackageVersion } from './chunk-RA3O54FC.js';
|
|
7
7
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
8
|
-
import { forkFor, RAW_MIRROR_SEGMENTS, WarningCollector, WARNING_CODES, isNewerThanSupported, bucketsFromTurns, costOfUsage } from './chunk-
|
|
9
|
-
import { RESERVED_EMIT_NAMES, EVENT_TYPES, isHumanUserTurn, INPUT_BAND_BOUNDARIES, parseAgentSession, SCHEMA_VERSION, ARTIFACT_KINDS, ArtifactCriterionIdSchema, SPEED_MAX_LENGTH } from './chunk-
|
|
8
|
+
import { forkFor, RAW_MIRROR_SEGMENTS, WarningCollector, WARNING_CODES, isNewerThanSupported, bucketsFromTurns, costOfUsage } from './chunk-X25VXXCF.js';
|
|
9
|
+
import { CODE_REVIEW_NAME, RESERVED_EMIT_NAMES, EVENT_TYPES, isHumanUserTurn, INPUT_BAND_BOUNDARIES, parseAgentSession, SCHEMA_VERSION, ARTIFACT_KINDS, ArtifactCriterionIdSchema, SPEED_MAX_LENGTH } from './chunk-2VNT47DG.js';
|
|
10
10
|
import { __commonJS, __require, __toESM } from './chunk-Z5GEFMRW.js';
|
|
11
11
|
import { existsSync, readFileSync, mkdirSync, writeFileSync, readdirSync, rmSync, renameSync, realpathSync, readlinkSync, symlinkSync, copyFileSync, statSync, accessSync, constants, lstatSync } from 'fs';
|
|
12
12
|
import { join as join$1, dirname, sep, basename, relative, delimiter } from 'path';
|
|
@@ -7724,7 +7724,7 @@ var CONTEXT_PIN_FILENAME = ".outerlayer-pin.json";
|
|
|
7724
7724
|
var JUDGE_SUBJECTS = ["criteria", "none"];
|
|
7725
7725
|
var MAX_BRIEF_LENGTH = 300;
|
|
7726
7726
|
var MAX_COMMAND_LENGTH = 2e3;
|
|
7727
|
-
var EXTENDS_PROBLEM = '"extends" is not a policy key \u2014 every check is a file in .outerlayer/validators/. Run outerlayer init --template default to write .outerlayer/validators/
|
|
7727
|
+
var EXTENDS_PROBLEM = '"extends" is not a policy key \u2014 every check is a file in .outerlayer/validators/. Run outerlayer init --template default to write .outerlayer/validators/acceptance-criteria.yaml, then delete the extends line';
|
|
7728
7728
|
var FREED_BUILTINS = /* @__PURE__ */ new Set(["ci-passed", "acceptance-criteria", "code-review-ran"]);
|
|
7729
7729
|
var RETIRED_BUILTINS = /* @__PURE__ */ new Set([
|
|
7730
7730
|
"red-then-green",
|
|
@@ -7988,6 +7988,7 @@ function parseCustomFile(file, problems) {
|
|
|
7988
7988
|
return fail(`not valid YAML \u2014 ${error instanceof Error ? error.message : String(error)}`);
|
|
7989
7989
|
}
|
|
7990
7990
|
if (!isRecord(root)) return fail("must be a YAML mapping");
|
|
7991
|
+
if (root["id"] === CODE_REVIEW_NAME) return null;
|
|
7991
7992
|
for (const key of Object.keys(root)) {
|
|
7992
7993
|
if (!CUSTOM_KEYS.has(key)) return fail(`unknown key "${inlineText(key)}"`);
|
|
7993
7994
|
}
|
|
@@ -8190,6 +8191,7 @@ function resolveReferences(parsed, signalIds, problems) {
|
|
|
8190
8191
|
);
|
|
8191
8192
|
const next = surviving.filter((candidate) => {
|
|
8192
8193
|
for (const ref of candidate.validatorRefs) {
|
|
8194
|
+
if (ref === CODE_REVIEW_NAME) continue;
|
|
8193
8195
|
if (ref === candidate.def.id || !ids.has(ref) || signalIds.has(ref)) {
|
|
8194
8196
|
problems.push({
|
|
8195
8197
|
file: candidate.file,
|
|
@@ -8199,7 +8201,7 @@ function resolveReferences(parsed, signalIds, problems) {
|
|
|
8199
8201
|
}
|
|
8200
8202
|
}
|
|
8201
8203
|
for (const name of candidate.emittedRefs) {
|
|
8202
|
-
if (!emits.has(name)) {
|
|
8204
|
+
if (name !== CODE_REVIEW_NAME && !emits.has(name)) {
|
|
8203
8205
|
problems.push({
|
|
8204
8206
|
file: candidate.file,
|
|
8205
8207
|
problem: `"${candidate.def.id}" requires emitted "${name}" but no validator declares emit: ${name}`
|
|
@@ -8292,7 +8294,7 @@ function parsePolicy(policyFile, validatorFiles) {
|
|
|
8292
8294
|
const levels = {};
|
|
8293
8295
|
for (const custom of sorted) levels[custom.id] = custom.level;
|
|
8294
8296
|
for (const [id, level] of Object.entries(policy.overrides)) {
|
|
8295
|
-
if (RETIRED_BUILTINS.has(id)) continue;
|
|
8297
|
+
if (RETIRED_BUILTINS.has(id) || id === CODE_REVIEW_NAME) continue;
|
|
8296
8298
|
if (FREED_BUILTINS.has(id) && !(id in levels)) continue;
|
|
8297
8299
|
if (!(id in levels) && !signalIds.has(id)) {
|
|
8298
8300
|
problems.push({
|
|
@@ -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_REASON_MAX_LENGTH, CheckItemsSchema, CHECK_ITEM_REFS_MAX, CHECK_ITEM_REF_PATH_MAX_LENGTH } from './chunk-
|
|
3
|
+
import { sanitizeTerminal } from './chunk-OCQ5FQZR.js';
|
|
4
|
+
import { resolvePackRoot, parseProofsConfig } from './chunk-OO33S4AF.js';
|
|
5
|
+
import { CHECK_ITEM_REASON_MAX_LENGTH, CHECK_ITEMS_MAX, CheckItemsSchema, CHECK_ITEM_REFS_MAX, CHECK_ITEM_ID_MAX_LENGTH, CHECK_ITEM_REF_PATH_MAX_LENGTH, JUDGE_NOT_RUN_ITEM_ID, REVIEWED_COMMIT_ITEM_ID } from './chunk-2VNT47DG.js';
|
|
6
6
|
import { createHash } from 'crypto';
|
|
7
7
|
import { join } from 'path';
|
|
8
8
|
import { pathToFileURL } from 'url';
|
|
@@ -1908,6 +1908,45 @@ function runnerMatcher(runners) {
|
|
|
1908
1908
|
return index === -1 ? void 0 : index;
|
|
1909
1909
|
};
|
|
1910
1910
|
}
|
|
1911
|
+
|
|
1912
|
+
// src/runner/diff-lines.ts
|
|
1913
|
+
var HUNK = /^@@ -\d+(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;
|
|
1914
|
+
var NEW_FILE = /^\+\+\+ b\/([^\t"].*?)\t?$/;
|
|
1915
|
+
function diffLines(patch) {
|
|
1916
|
+
const files = /* @__PURE__ */ new Map();
|
|
1917
|
+
const lines = patch.split("\n");
|
|
1918
|
+
let path2;
|
|
1919
|
+
for (let at = 0; at < lines.length; at += 1) {
|
|
1920
|
+
const line = lines[at];
|
|
1921
|
+
if (line.startsWith("diff --git ")) {
|
|
1922
|
+
path2 = void 0;
|
|
1923
|
+
continue;
|
|
1924
|
+
}
|
|
1925
|
+
if (line.startsWith("+++ ")) {
|
|
1926
|
+
path2 = NEW_FILE.exec(line)?.[1];
|
|
1927
|
+
continue;
|
|
1928
|
+
}
|
|
1929
|
+
const hunk = HUNK.exec(line);
|
|
1930
|
+
if (hunk === null) continue;
|
|
1931
|
+
let oldLeft = Number(hunk[1] ?? 1);
|
|
1932
|
+
let newLeft = Number(hunk[3] ?? 1);
|
|
1933
|
+
const start = Number(hunk[2]);
|
|
1934
|
+
if (path2 !== void 0 && newLeft > 0) files.set(path2, [...files.get(path2) ?? [], [start, start + newLeft - 1]]);
|
|
1935
|
+
while ((oldLeft > 0 || newLeft > 0) && at + 1 < lines.length) {
|
|
1936
|
+
at += 1;
|
|
1937
|
+
const mark = lines[at][0];
|
|
1938
|
+
if (mark === "\\") continue;
|
|
1939
|
+
if (mark !== "+") oldLeft -= 1;
|
|
1940
|
+
if (mark !== "-") newLeft -= 1;
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
return files;
|
|
1944
|
+
}
|
|
1945
|
+
function lineInDiff(lines, path2, line) {
|
|
1946
|
+
return (lines.get(path2) ?? []).some(([first, last]) => line >= first && line <= last);
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
// src/runner/judge-items.ts
|
|
1911
1950
|
var ARTIFACT_PROOF_REASON = "Its declared artifact proves it; the judge does not judge artifacts.";
|
|
1912
1951
|
var NO_NAMED_TEST_REASON = "The judge named no test file that proves this criterion.";
|
|
1913
1952
|
var NO_VERDICT_REASON = "The judge gave no result for this criterion.";
|
|
@@ -1979,7 +2018,7 @@ function judgeGroups(criteria, size = JUDGE_GROUP_SIZE) {
|
|
|
1979
2018
|
}
|
|
1980
2019
|
var MAX_ANSWER_ENTRIES = 500;
|
|
1981
2020
|
var MAX_NAMED_TESTS = 50;
|
|
1982
|
-
function
|
|
2021
|
+
function readPlaces(raw) {
|
|
1983
2022
|
if (!Array.isArray(raw)) return void 0;
|
|
1984
2023
|
const tests = [];
|
|
1985
2024
|
for (const entry of raw.slice(0, MAX_NAMED_TESTS)) {
|
|
@@ -1998,12 +2037,13 @@ function readAnswer(raw) {
|
|
|
1998
2037
|
if (entries.length > MAX_ANSWER_ENTRIES) return { ok: false, problem: `items: at most ${MAX_ANSWER_ENTRIES} entries` };
|
|
1999
2038
|
const read = [];
|
|
2000
2039
|
for (const [index, entry] of entries.entries()) {
|
|
2001
|
-
const { id, result: itemResult, reason, tests } = typeof entry === "object" && entry !== null ? entry : {};
|
|
2040
|
+
const { id, result: itemResult, reason, tests, refs } = typeof entry === "object" && entry !== null ? entry : {};
|
|
2002
2041
|
if (typeof id !== "string" || id === "" || id.length > 200) return { ok: false, problem: `items.${index}.id: must be text of 1 to 200 characters` };
|
|
2003
2042
|
if (itemResult !== "pass" && itemResult !== "fail") return { ok: false, problem: `items.${index}.result: must be "pass" or "fail"` };
|
|
2004
2043
|
if (reason !== void 0 && typeof reason !== "string") return { ok: false, problem: `items.${index}.reason: must be text` };
|
|
2005
|
-
const named =
|
|
2006
|
-
|
|
2044
|
+
const named = readPlaces(tests);
|
|
2045
|
+
const places = readPlaces(refs);
|
|
2046
|
+
read.push({ id, result: itemResult, ...reason === void 0 ? {} : { reason }, ...named === void 0 ? {} : { tests: named }, ...places === void 0 ? {} : { refs: places } });
|
|
2007
2047
|
}
|
|
2008
2048
|
return { ok: true, answer: { ...result === void 0 ? {} : { result }, items: read } };
|
|
2009
2049
|
}
|
|
@@ -2060,6 +2100,27 @@ function judgedItems(input) {
|
|
|
2060
2100
|
return { ...base, result: said.result, ...reason === void 0 ? {} : { reason }, ...withRefs, ...kept };
|
|
2061
2101
|
});
|
|
2062
2102
|
}
|
|
2103
|
+
function itemIds(ids, clean) {
|
|
2104
|
+
const used = /* @__PURE__ */ new Set([JUDGE_NOT_RUN_ITEM_ID, REVIEWED_COMMIT_ITEM_ID]);
|
|
2105
|
+
return ids.map((id) => {
|
|
2106
|
+
const base = clean(id).replace(/[\u0000-\u001f\u007f]+/g, " ").trim() || "problem";
|
|
2107
|
+
let unique = base.slice(0, CHECK_ITEM_ID_MAX_LENGTH);
|
|
2108
|
+
for (let count = 2; used.has(unique); count += 1) unique = `${base.slice(0, CHECK_ITEM_ID_MAX_LENGTH - `-${count}`.length)}-${count}`;
|
|
2109
|
+
used.add(unique);
|
|
2110
|
+
return unique;
|
|
2111
|
+
});
|
|
2112
|
+
}
|
|
2113
|
+
function wholeItems(input) {
|
|
2114
|
+
const lines = diffLines(input.patch);
|
|
2115
|
+
const entries = [...input.answer.items.filter((entry) => entry.result === "fail"), ...input.answer.items.filter((entry) => entry.result !== "fail")].slice(0, CHECK_ITEMS_MAX - 1);
|
|
2116
|
+
const ids = itemIds(entries.map((entry) => entry.id), input.clean);
|
|
2117
|
+
return entries.map((entry, index) => {
|
|
2118
|
+
const reason = oneLineReason(entry.reason === void 0 ? void 0 : input.clean(entry.reason));
|
|
2119
|
+
const { refs } = namedTests(entry.refs, { treeRoot: input.treeRoot, check: input.place, ownTree: input.ownTree });
|
|
2120
|
+
const placed = entry.result === "fail" ? refs.map((ref) => ref.line === void 0 ? ref : { ...ref, inDiff: lineInDiff(lines, ref.path, ref.line) }) : refs;
|
|
2121
|
+
return { id: ids[index], result: entry.result, commit: input.commit, ...reason === void 0 ? {} : { reason }, ...placed.length === 0 ? {} : { refs: placed } };
|
|
2122
|
+
});
|
|
2123
|
+
}
|
|
2063
2124
|
function failedItems(criteria, reason) {
|
|
2064
2125
|
const said = oneLineReason(reason) ?? NO_VERDICT_REASON;
|
|
2065
2126
|
return criteria.map((criterion) => ({ id: criterion.id, criterion: criterion.id, result: "fail", reason: said }));
|
|
@@ -2103,6 +2164,14 @@ function criteriaOf(workItem) {
|
|
|
2103
2164
|
}
|
|
2104
2165
|
return items.length === 0 ? void 0 : items;
|
|
2105
2166
|
}
|
|
2167
|
+
function openPullRequests(workItem) {
|
|
2168
|
+
const declared = Object(workItem).pullRequests;
|
|
2169
|
+
if (!Array.isArray(declared)) return [];
|
|
2170
|
+
return declared.flatMap((entry) => {
|
|
2171
|
+
const { state, repository } = Object(entry);
|
|
2172
|
+
return (state === "open" || state === null || state === void 0) && typeof repository === "string" ? [repository] : [];
|
|
2173
|
+
});
|
|
2174
|
+
}
|
|
2106
2175
|
function hostItemsOf(workItem, name) {
|
|
2107
2176
|
const checks = Object(workItem).checks;
|
|
2108
2177
|
if (!Array.isArray(checks)) return [];
|
|
@@ -2112,4 +2181,4 @@ function hostItemsOf(workItem, name) {
|
|
|
2112
2181
|
return parsed.success ? parsed.data : [];
|
|
2113
2182
|
}
|
|
2114
2183
|
|
|
2115
|
-
export { MAX_TEST_FILE_BYTES, NO_VERDICT_REASON, criteriaOf, criterionInputs, failedItems, hostItemsOf, inCriteriaOrder, itemsSentence, judgeGroups, judgedItems, loadCitationFinder, oneLineReason, parseJudgeAnswer, planCriteria, runnerMatcher, testFileMatcher, testsByCriterion };
|
|
2184
|
+
export { MAX_TEST_FILE_BYTES, NO_VERDICT_REASON, criteriaOf, criterionInputs, failedItems, hostItemsOf, inCriteriaOrder, itemsSentence, judgeGroups, judgedItems, loadCitationFinder, oneLineReason, openPullRequests, parseJudgeAnswer, planCriteria, runnerMatcher, testFileMatcher, testsByCriterion, wholeItems };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { defaultAgents, agentById } from './chunk-
|
|
3
|
+
import { defaultAgents, agentById } from './chunk-OO33S4AF.js';
|
|
4
4
|
import { PROVIDERS, LEGACY_AGENT } from './chunk-7PZDPISM.js';
|
|
5
5
|
import { join, dirname } from 'path';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { keyRunnerFactory, RunnerConfigError } from './chunk-
|
|
4
|
-
import { orgHomeDir } from './chunk-
|
|
3
|
+
import { keyRunnerFactory, RunnerConfigError } from './chunk-6Y4ZE74I.js';
|
|
4
|
+
import { orgHomeDir } from './chunk-LYORNXIT.js';
|
|
5
5
|
|
|
6
6
|
createRequire(import.meta.url);
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-
|
|
4
|
-
import { buildsDir, storeScopes, rootfsDir, orgStoreIn, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-
|
|
3
|
+
import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-FZD6GIW5.js';
|
|
4
|
+
import { buildsDir, storeScopes, rootfsDir, orgStoreIn, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-LYORNXIT.js';
|
|
5
5
|
import { spawnSync } from 'child_process';
|
|
6
6
|
import { statfsSync, statSync, existsSync, readdirSync } from 'fs';
|
|
7
7
|
import { dirname, join } from 'path';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { builtInEnvironment, managedAgentCredential, agentCredential, builtInNames, TARGET_TUNNEL, TARGET_LEASE, destinationTarget, builtInDestinations, destinationPort } from './chunk-
|
|
4
|
-
import { strippedVariables } from './chunk-
|
|
5
|
-
import { defaultAgents } from './chunk-
|
|
3
|
+
import { builtInEnvironment, managedAgentCredential, agentCredential, builtInNames, TARGET_TUNNEL, TARGET_LEASE, destinationTarget, builtInDestinations, destinationPort } from './chunk-BU25W7GF.js';
|
|
4
|
+
import { strippedVariables } from './chunk-PJNOTSB5.js';
|
|
5
|
+
import { defaultAgents } from './chunk-OO33S4AF.js';
|
|
6
6
|
import { PROVIDERS } from './chunk-7PZDPISM.js';
|
|
7
|
-
import { MIN_SCRUBBED_LITERAL } from './chunk-
|
|
7
|
+
import { MIN_SCRUBBED_LITERAL } from './chunk-X25VXXCF.js';
|
|
8
8
|
import { mkdirSync, writeFileSync, existsSync, unlinkSync, chmodSync } from 'fs';
|
|
9
9
|
import { request as request$1, createServer } from 'http';
|
|
10
10
|
import { request } from 'https';
|
|
@@ -15,6 +15,139 @@ import { rootCertificates } from 'tls';
|
|
|
15
15
|
|
|
16
16
|
createRequire(import.meta.url);
|
|
17
17
|
|
|
18
|
+
// src/runner/sandbox/client.ts
|
|
19
|
+
var SANDBOX_KEY_VARIABLE = "SANDBOX_API_KEY";
|
|
20
|
+
var SANDBOX_VARIABLES = [SANDBOX_KEY_VARIABLE, "SANDBOX_API_URL", "SANDBOX_TOKEN_HEADER"];
|
|
21
|
+
function sandboxSettingsFrom(env) {
|
|
22
|
+
const missing = SANDBOX_VARIABLES.filter((name2) => (env[name2] ?? "").trim() === "");
|
|
23
|
+
if (missing.length > 0) return { ok: false, missing };
|
|
24
|
+
return { ok: true, settings: { apiKey: env[SANDBOX_KEY_VARIABLE], apiUrl: env["SANDBOX_API_URL"].trim(), tokenHeader: env["SANDBOX_TOKEN_HEADER"].trim() } };
|
|
25
|
+
}
|
|
26
|
+
var CALL_TIMEOUT_MS = 3e4;
|
|
27
|
+
var CREATE_ATTEMPTS = 2;
|
|
28
|
+
var LIST_PAGES = 50;
|
|
29
|
+
var SandboxError = class extends Error {
|
|
30
|
+
constructor(message, status, code) {
|
|
31
|
+
super(message);
|
|
32
|
+
this.status = status;
|
|
33
|
+
this.code = code;
|
|
34
|
+
this.name = "SandboxError";
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
function describeSandboxError(err) {
|
|
38
|
+
const detail = err.message === "" ? "" : `: ${err.message}`;
|
|
39
|
+
return err.code === void 0 ? `The provider answered HTTP ${err.status}${detail}` : `${err.code}${detail}`;
|
|
40
|
+
}
|
|
41
|
+
function sandboxOf(raw) {
|
|
42
|
+
if (typeof raw.id !== "string" || typeof raw.dataPlaneUrl !== "string") throw new SandboxError("the answer names no sandbox id or data plane", 0);
|
|
43
|
+
return {
|
|
44
|
+
id: raw.id,
|
|
45
|
+
name: typeof raw.name === "string" ? raw.name : "",
|
|
46
|
+
state: typeof raw.state === "string" ? raw.state : "",
|
|
47
|
+
dataPlaneUrl: raw.dataPlaneUrl.replace(/\/+$/, ""),
|
|
48
|
+
secret: typeof raw.secret === "string" ? raw.secret : "",
|
|
49
|
+
urlToken: typeof raw.urlToken === "string" ? raw.urlToken : "",
|
|
50
|
+
metadata: typeof raw.metadata === "object" && raw.metadata !== null ? raw.metadata : {},
|
|
51
|
+
...typeof raw.endedReason === "string" ? { endedReason: raw.endedReason } : {}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function createSandboxClient(opts) {
|
|
55
|
+
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
56
|
+
const base = opts.apiUrl.replace(/\/+$/, "");
|
|
57
|
+
const authorization = `Bearer ${opts.apiKey}`;
|
|
58
|
+
async function call(url, init) {
|
|
59
|
+
let response;
|
|
60
|
+
try {
|
|
61
|
+
response = await fetchImpl(url, { ...init, signal: AbortSignal.timeout(init.timeoutMs ?? CALL_TIMEOUT_MS) });
|
|
62
|
+
} catch (err) {
|
|
63
|
+
throw new SandboxError(`no answer from the provider: ${err instanceof Error ? err.message : String(err)}`, 0);
|
|
64
|
+
}
|
|
65
|
+
if (response.ok) return response;
|
|
66
|
+
let code;
|
|
67
|
+
let message = "";
|
|
68
|
+
try {
|
|
69
|
+
const body = await response.json();
|
|
70
|
+
if (typeof body.code === "string") code = body.code;
|
|
71
|
+
if (typeof body.message === "string") message = body.message;
|
|
72
|
+
else if (typeof body.detail === "string") message = body.detail;
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
75
|
+
throw new SandboxError(message, response.status, code);
|
|
76
|
+
}
|
|
77
|
+
const control = (path, init = {}) => call(`${base}${path}`, { ...init, headers: { Authorization: authorization, "Content-Type": "application/json", ...init.headers } });
|
|
78
|
+
return {
|
|
79
|
+
async create(input) {
|
|
80
|
+
for (let attempt = 1; ; attempt++) {
|
|
81
|
+
try {
|
|
82
|
+
const response = await control("/api/sandboxes/ephemeral", { method: "POST", body: JSON.stringify(input) });
|
|
83
|
+
return sandboxOf(await response.json());
|
|
84
|
+
} catch (err) {
|
|
85
|
+
const retry = err instanceof SandboxError && err.status >= 500 && attempt < CREATE_ATTEMPTS;
|
|
86
|
+
if (!retry) throw err;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
async get(id) {
|
|
91
|
+
const response = await control(`/v1/sandboxes/${encodeURIComponent(id)}`);
|
|
92
|
+
return sandboxOf(await response.json());
|
|
93
|
+
},
|
|
94
|
+
async list() {
|
|
95
|
+
const found = [];
|
|
96
|
+
let cursor;
|
|
97
|
+
for (let page = 0; page < LIST_PAGES; page++) {
|
|
98
|
+
const response = await control(`/api/sandboxes/ephemeral${cursor === void 0 ? "" : `?cursor=${encodeURIComponent(cursor)}`}`);
|
|
99
|
+
const body = await response.json();
|
|
100
|
+
for (const raw of body.sandboxes ?? []) found.push(sandboxOf(raw));
|
|
101
|
+
if (typeof body.nextCursor !== "string" || body.nextCursor === "") {
|
|
102
|
+
cursor = void 0;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
cursor = body.nextCursor;
|
|
106
|
+
}
|
|
107
|
+
if (cursor !== void 0) throw new SandboxError(`the list of sandboxes has more than ${LIST_PAGES} pages`, 0);
|
|
108
|
+
return found;
|
|
109
|
+
},
|
|
110
|
+
async end(id) {
|
|
111
|
+
try {
|
|
112
|
+
await control(`/api/sandboxes/ephemeral/${encodeURIComponent(id)}`, { method: "DELETE" });
|
|
113
|
+
} catch (err) {
|
|
114
|
+
if (err instanceof SandboxError && err.status === 404) return;
|
|
115
|
+
throw err;
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
async portUrl(sandbox, port) {
|
|
119
|
+
const response = await control(`/v1/sandboxes/${encodeURIComponent(sandbox.id)}/urls`, { method: "POST", body: JSON.stringify({ port }) });
|
|
120
|
+
const body = await response.json();
|
|
121
|
+
if (typeof body.url !== "string") throw new SandboxError("the answer holds no port URL", 0);
|
|
122
|
+
return body.url;
|
|
123
|
+
},
|
|
124
|
+
async command(sandbox, cmd, options = {}) {
|
|
125
|
+
const response = await call(`${sandbox.dataPlaneUrl}/commands`, {
|
|
126
|
+
method: "POST",
|
|
127
|
+
headers: { [opts.tokenHeader]: sandbox.secret, "Content-Type": "application/json" },
|
|
128
|
+
body: JSON.stringify({ cmd, ...options.background === true ? { background: true } : {} }),
|
|
129
|
+
...options.timeoutMs === void 0 ? {} : { timeoutMs: options.timeoutMs }
|
|
130
|
+
});
|
|
131
|
+
const body = await response.json();
|
|
132
|
+
return {
|
|
133
|
+
state: typeof body.state === "string" ? body.state : "",
|
|
134
|
+
exitCode: typeof body.exitCode === "number" ? body.exitCode : null,
|
|
135
|
+
stdout: typeof body.stdout === "string" ? body.stdout : "",
|
|
136
|
+
stderr: typeof body.stderr === "string" ? body.stderr : "",
|
|
137
|
+
truncated: body.truncated === true
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
async upload(sandbox, path, bytes) {
|
|
141
|
+
await call(`${sandbox.dataPlaneUrl}/files?path=${encodeURIComponent(path)}`, {
|
|
142
|
+
method: "PUT",
|
|
143
|
+
headers: { [opts.tokenHeader]: sandbox.secret, "Content-Type": "application/octet-stream" },
|
|
144
|
+
body: new Uint8Array(bytes),
|
|
145
|
+
timeoutMs: 5 * 6e4
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
18
151
|
// src/scrub-env.ts
|
|
19
152
|
var SCRUB_ENV_VARIABLE = "OUTERLAYER_SCRUB_ENV";
|
|
20
153
|
|
|
@@ -439,6 +572,10 @@ function proxyEnvironment(proxyUrl, alsoNoProxy) {
|
|
|
439
572
|
YARN_HTTP_PROXY: proxyUrl
|
|
440
573
|
};
|
|
441
574
|
}
|
|
575
|
+
function toolProxyEnvironment() {
|
|
576
|
+
const all = proxyEnvironment(PROXY_URL);
|
|
577
|
+
return Object.fromEntries(toolProxyVariables().map((name2) => [name2, all[name2]]));
|
|
578
|
+
}
|
|
442
579
|
var PROXY_WARNING_FLAG = "--disable-warning=UNDICI-EHPA";
|
|
443
580
|
function runnerLiterals(repository, repositories = [], unpinnedRuntimes, missingSetupScripts) {
|
|
444
581
|
return {
|
|
@@ -470,6 +607,8 @@ function reservedNames() {
|
|
|
470
607
|
...Object.keys(runnerLiterals("owner/name")),
|
|
471
608
|
...Object.keys(builtInEnvironment(containerBuiltInAddress, void 0)),
|
|
472
609
|
"PATH",
|
|
610
|
+
// The key controls every sandbox its account holds, so a build may never read it.
|
|
611
|
+
SANDBOX_KEY_VARIABLE,
|
|
473
612
|
...tokenVariables(),
|
|
474
613
|
...toolProxyVariables()
|
|
475
614
|
]);
|
|
@@ -1169,4 +1308,4 @@ async function startBuildServices(input) {
|
|
|
1169
1308
|
}
|
|
1170
1309
|
}
|
|
1171
1310
|
|
|
1172
|
-
export { BUILD_HOME, CHECKOUT_DIR, CHECK_ITEMS_FILE, DESTINATION_BASE_PORT, EVAL_INPUT_DIR, IMAGE_BUNDLES, JOB_MOUNT, PROXY_WARNING_FLAG, RELAY_PORT, SCRUB_ENV_VARIABLE, STAND_IN, applyTrust, authorEnvironment, buildAuthorityFor, buildEnvironment, carried6to4, checkEnvironment, checkoutPath, classifyAddress, commitIdentityRecord, containerLocalAddress, destinationEnvironment, dropBuildAuthority, droppedRequestHeaders, hasDotDotSegment, headerVariables, heldBuildAuthority, hostKeyOf, isMiseVariableAllowed, isRefusedInConfig, isReservedVariable, lifecycleWorkdir, parseClaimIdentity, parseClaimedRepositories, parseIsolation, parseProxied, parseUnreachable, primaryOf, proxyEnvironment, readBundleScript, repositoriesOf, repositoryPath, resolveDestinations, routeNameOf, sharedUserEnvironment, startBuildServices, tokenHeader, trustEnvironment, variableForPath, variablesFor, withGitConfig, withHooksPath, withMiseVariables, withTokenHeader, withTunnelRecord, writeTrustFiles };
|
|
1311
|
+
export { BUILD_HOME, CHECKOUT_DIR, CHECK_ITEMS_FILE, DESTINATION_BASE_PORT, EVAL_INPUT_DIR, IMAGE_BUNDLES, JOB_MOUNT, PROXY_WARNING_FLAG, RELAY_PORT, SANDBOX_VARIABLES, SCRUB_ENV_VARIABLE, STAND_IN, SandboxError, applyTrust, authorEnvironment, buildAuthorityFor, buildEnvironment, carried6to4, checkEnvironment, checkoutPath, classifyAddress, commitIdentityRecord, containerLocalAddress, createSandboxClient, describeSandboxError, destinationEnvironment, dropBuildAuthority, droppedRequestHeaders, hasDotDotSegment, headerVariables, heldBuildAuthority, hostKeyOf, isMiseVariableAllowed, isRefusedInConfig, isReservedVariable, lifecycleWorkdir, parseClaimIdentity, parseClaimedRepositories, parseIsolation, parseProxied, parseUnreachable, primaryOf, proxyEnvironment, readBundleScript, repositoriesOf, repositoryPath, resolveDestinations, routeNameOf, sandboxSettingsFrom, sharedUserEnvironment, startBuildServices, tokenHeader, toolProxyEnvironment, trustEnvironment, variableForPath, variablesFor, withGitConfig, withHooksPath, withMiseVariables, withTokenHeader, withTunnelRecord, writeTrustFiles };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { launchRefusalForSession } from './chunk-WGC7UFRM.js';
|
|
4
|
-
import { detectActiveSession, transcriptPathForSession } from './chunk-
|
|
5
|
-
import { autoConnect } from './chunk-
|
|
4
|
+
import { detectActiveSession, transcriptPathForSession } from './chunk-VZGTPITG.js';
|
|
5
|
+
import { autoConnect } from './chunk-RWNVQSGX.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
|
-
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-
|
|
7
|
+
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-NOBB3LEO.js';
|
|
8
8
|
import { readLatestProvenanceForSession } from './chunk-545P7JY7.js';
|
|
9
9
|
import { launchedItemForSession } from './chunk-4OD45RBP.js';
|
|
10
10
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
11
11
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
12
|
-
import { legacyAgent, captureAgents, sessionFolderIn } from './chunk-
|
|
12
|
+
import { legacyAgent, captureAgents, sessionFolderIn } from './chunk-OO33S4AF.js';
|
|
13
13
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
14
|
-
import { resolveRepoIdentity, scrubText } from './chunk-
|
|
15
|
-
import { FindingBatchSchema, FindingsResponseSchema, SAME_PROBLEM_RULES } from './chunk-
|
|
14
|
+
import { resolveRepoIdentity, scrubText } from './chunk-X25VXXCF.js';
|
|
15
|
+
import { FindingBatchSchema, FindingsResponseSchema, SAME_PROBLEM_RULES } from './chunk-2VNT47DG.js';
|
|
16
16
|
import { readFileSync, existsSync } from 'fs';
|
|
17
17
|
import { homedir } from 'os';
|
|
18
18
|
import { join, dirname } from 'path';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RemovedTargetError, removedTargetError } from './chunk-
|
|
4
|
-
import { removeRetiredSkills } from './chunk-
|
|
5
|
-
import { defaultFetch, resolveGatewayCredentials } from './chunk-
|
|
6
|
-
import { withTokenHeader } from './chunk-
|
|
3
|
+
import { RemovedTargetError, removedTargetError } from './chunk-C3P637LO.js';
|
|
4
|
+
import { removeRetiredSkills } from './chunk-2IVRTP6M.js';
|
|
5
|
+
import { defaultFetch, resolveGatewayCredentials } from './chunk-NOBB3LEO.js';
|
|
6
|
+
import { withTokenHeader } from './chunk-QHT6PIFP.js';
|
|
7
7
|
import { appendContextProvenance } from './chunk-545P7JY7.js';
|
|
8
8
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
9
9
|
import { writeDegraded, writeSourceCache, SOURCE_CACHE_TTL_RETRY_MS, writeContextManifest, SOURCE_CACHE_TTL_SUCCESS_MS, readSourceCache, isSourceCacheFresh, clearDegraded } from './chunk-YQR6E6OV.js';
|
|
10
|
-
import { normalizeRepoName, loadMaintainedFiles, writeMaintainedFiles, parseOuterlayerConfig, targetIds, classifyTree, emitTree, emitBuilders, defaultAgents, agentRootFolders } from './chunk-
|
|
10
|
+
import { normalizeRepoName, loadMaintainedFiles, writeMaintainedFiles, parseOuterlayerConfig, targetIds, classifyTree, emitTree, emitBuilders, defaultAgents, agentRootFolders } from './chunk-OO33S4AF.js';
|
|
11
11
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
12
12
|
import { execFileSync } from 'child_process';
|
|
13
13
|
import { existsSync, mkdirSync, writeFileSync, chmodSync, lstatSync, readFileSync, copyFileSync } from 'fs';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-
|
|
4
|
-
import { resolveGatewayCredentials } from './chunk-
|
|
3
|
+
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-7VVTZNUP.js';
|
|
4
|
+
import { resolveGatewayCredentials } from './chunk-NOBB3LEO.js';
|
|
5
5
|
import { readCloudConfig } from './chunk-HWVMRETT.js';
|
|
6
6
|
import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
7
7
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
8
8
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
9
|
-
import { resolveRepoIdentity } from './chunk-
|
|
9
|
+
import { resolveRepoIdentity } from './chunk-X25VXXCF.js';
|
|
10
10
|
|
|
11
11
|
createRequire(import.meta.url);
|
|
12
12
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { readSettingsText, SettingsParseError, cliForInstall } from './chunk-ZHQC43NH.js';
|
|
4
|
-
import { legacyAgent, defaultAgents, HookTextError } from './chunk-
|
|
4
|
+
import { legacyAgent, defaultAgents, HookTextError } from './chunk-OO33S4AF.js';
|
|
5
5
|
|
|
6
6
|
createRequire(import.meta.url);
|
|
7
7
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { criteriaOf, loadCitationFinder, testFileMatcher, hostItemsOf, runnerMatcher, NO_VERDICT_REASON } from './chunk-
|
|
4
|
-
import { WorkCommandError, resolveCredentials, getJson } from './chunk-
|
|
5
|
-
import { sanitizeTerminal } from './chunk-
|
|
3
|
+
import { criteriaOf, loadCitationFinder, testFileMatcher, hostItemsOf, runnerMatcher, NO_VERDICT_REASON } from './chunk-OSHKKESX.js';
|
|
4
|
+
import { WorkCommandError, resolveCredentials, getJson } from './chunk-IQHREL5T.js';
|
|
5
|
+
import { sanitizeTerminal } from './chunk-OCQ5FQZR.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
|
-
import { defaultFetch } from './chunk-
|
|
7
|
+
import { defaultFetch } from './chunk-NOBB3LEO.js';
|
|
8
8
|
import { parseWorkItemEnv } from './chunk-4OD45RBP.js';
|
|
9
9
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
10
10
|
import { readDeliveryRecord } from './chunk-YQR6E6OV.js';
|
|
11
|
-
import { parseProofsConfig } from './chunk-
|
|
12
|
-
import { resolveRepoIdentity } from './chunk-
|
|
13
|
-
import { inferArtifactKind, mediaTypeForArtifactPath, WORK_ITEM_COMMENT_MAX_BODY_LENGTH, parseJunit, isTestSourcePath } from './chunk-
|
|
11
|
+
import { parseProofsConfig } from './chunk-OO33S4AF.js';
|
|
12
|
+
import { resolveRepoIdentity } from './chunk-X25VXXCF.js';
|
|
13
|
+
import { inferArtifactKind, mediaTypeForArtifactPath, WORK_ITEM_COMMENT_MAX_BODY_LENGTH, parseJunit, isTestSourcePath } from './chunk-2VNT47DG.js';
|
|
14
14
|
import { spawnSync } from 'child_process';
|
|
15
15
|
import { createHash } from 'crypto';
|
|
16
16
|
import { readFileSync, readdirSync, lstatSync, statSync, existsSync } from 'fs';
|
|
@@ -129,14 +129,14 @@ function governingDir(cwd) {
|
|
|
129
129
|
async function testProofMode(cwd) {
|
|
130
130
|
const dir = governingDir(cwd);
|
|
131
131
|
if (dir === void 0) return "any";
|
|
132
|
-
const { testProofIn } = await import('./host-checks-
|
|
132
|
+
const { testProofIn } = await import('./host-checks-ANVIJJZI.js');
|
|
133
133
|
return testProofIn(dir);
|
|
134
134
|
}
|
|
135
135
|
async function judgeCheckName(cwd) {
|
|
136
136
|
const dir = governingDir(cwd);
|
|
137
137
|
if (dir === void 0) return {};
|
|
138
138
|
if (!existsSync(dir)) return { note: `the governed context at ${dir} is not readable` };
|
|
139
|
-
const { checksIn, isJudgeCheck } = await import('./host-checks-
|
|
139
|
+
const { checksIn, isJudgeCheck } = await import('./host-checks-ANVIJJZI.js');
|
|
140
140
|
const quiet = { line: () => void 0, error: () => void 0 };
|
|
141
141
|
const check = checksIn(dir, quiet, "").checks.find((c) => isJudgeCheck(c) && c.judge.subjects === "criteria");
|
|
142
142
|
return check === void 0 ? {} : { name: check.name };
|
|
@@ -372,7 +372,7 @@ async function runWorkProofs(opts) {
|
|
|
372
372
|
async function runWorkProofsCommand(opts) {
|
|
373
373
|
try {
|
|
374
374
|
if (opts.record) {
|
|
375
|
-
const { runWorkProofsRecord } = await import('./work-proofs-record-
|
|
375
|
+
const { runWorkProofsRecord } = await import('./work-proofs-record-KPRP3UAQ.js');
|
|
376
376
|
const result2 = await runWorkProofsRecord(opts);
|
|
377
377
|
process.exitCode = result2.exitCode;
|
|
378
378
|
return;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { uploadSpooledSteps } from './chunk-
|
|
3
|
+
import { uploadSpooledSteps } from './chunk-SEAVWMW2.js';
|
|
4
4
|
import { LaunchFilter } from './chunk-WGC7UFRM.js';
|
|
5
|
-
import { migrateLegacyArtifactSidecars, planArtifactUpload, artifactsStatePath, sanitizeTerminal, acquireArtifactSpoolLock, artifactBlobsDir, resolveArtifactTurnIndex, isArtifactTombstoned, ARTIFACT_RETRY_MAX_AGE_MS, writeArtifactSpoolState, reclaimUnneededArtifactBlobs, neededArtifactShas } from './chunk-
|
|
5
|
+
import { migrateLegacyArtifactSidecars, planArtifactUpload, artifactsStatePath, sanitizeTerminal, acquireArtifactSpoolLock, artifactBlobsDir, resolveArtifactTurnIndex, isArtifactTombstoned, ARTIFACT_RETRY_MAX_AGE_MS, writeArtifactSpoolState, reclaimUnneededArtifactBlobs, neededArtifactShas } from './chunk-OCQ5FQZR.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
|
-
import { cliFetch, resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-
|
|
7
|
+
import { cliFetch, resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-NOBB3LEO.js';
|
|
8
8
|
import { readCloudConfig, cloudConfigPath, writeCloudConfig } from './chunk-HWVMRETT.js';
|
|
9
|
-
import { signerFor, signRunnerRequest } from './chunk-
|
|
10
|
-
import { SCRUB_ENV_VARIABLE } from './chunk-
|
|
11
|
-
import { writeSyncStatus, logHookError, spoolDir } from './chunk-
|
|
9
|
+
import { signerFor, signRunnerRequest } from './chunk-FSQDS7A6.js';
|
|
10
|
+
import { SCRUB_ENV_VARIABLE } from './chunk-QHT6PIFP.js';
|
|
11
|
+
import { writeSyncStatus, logHookError, spoolDir } from './chunk-O3TOA2KE.js';
|
|
12
12
|
import { readLatestProvenanceForSession, readContextProvenance } from './chunk-545P7JY7.js';
|
|
13
13
|
import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
14
14
|
import { hookExecSpoolPath } from './chunk-RNCCRUT5.js';
|
|
@@ -16,11 +16,11 @@ import { applyReportedCost } from './chunk-BKO6JEZI.js';
|
|
|
16
16
|
import { readLaunchSpoolState, launchStatusIsDecisive, launchedItemsBySession, launchesPath } from './chunk-4OD45RBP.js';
|
|
17
17
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
18
18
|
import { removeJournalHooks } from './chunk-CJPTUU2E.js';
|
|
19
|
-
import { legacyAgent, captureAgents, captureAdapters } from './chunk-
|
|
19
|
+
import { legacyAgent, captureAgents, captureAdapters } from './chunk-OO33S4AF.js';
|
|
20
20
|
import { NATIVE_AGENTS, LEGACY_AGENT } from './chunk-7PZDPISM.js';
|
|
21
21
|
import { homeFromEnv, spoolHomeFromEnv } from './chunk-352DHUTP.js';
|
|
22
|
-
import { setCustomScrubbers, setLocalIdentity, forkFor, readForkRecord, tailTranscript, enrichSessionRepo, scanAll, setRepoRoot, resolveRepoIdentity, scrubDeep } from './chunk-
|
|
23
|
-
import { CAPTURE_TIERS, inferArtifactKind, bannedPathsForTier, downconvertSession, isHumanUserTurn, turnCountBound, EVENT_TYPES } from './chunk-
|
|
22
|
+
import { setCustomScrubbers, setLocalIdentity, forkFor, readForkRecord, tailTranscript, enrichSessionRepo, scanAll, setRepoRoot, resolveRepoIdentity, scrubDeep } from './chunk-X25VXXCF.js';
|
|
23
|
+
import { CAPTURE_TIERS, inferArtifactKind, bannedPathsForTier, downconvertSession, isHumanUserTurn, turnCountBound, EVENT_TYPES } from './chunk-2VNT47DG.js';
|
|
24
24
|
import { dirname, basename, join, sep } from 'path';
|
|
25
25
|
import { statSync, readFileSync, readdirSync, mkdirSync, writeFileSync, renameSync, existsSync, rmSync } from 'fs';
|
|
26
26
|
import { execFileSync } from 'child_process';
|