@outerlayer/cli 0.34.0-next.20261028152714 → 0.34.0-next.20261028164329
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/dist/{agent-setup-MO7DHLV4.js → agent-setup-IVXRBFVV.js} +6 -6
- package/dist/{bridge-4DFOWIY2.js → bridge-4GRZFXJU.js} +2 -2
- package/dist/{build-D5OIIY7B.js → build-SEJJWGTO.js} +7 -7
- package/dist/{build-disk-TEITBQKE.js → build-disk-EYRR3PBT.js} +5 -5
- package/dist/build-info.json +1 -1
- package/dist/{builder-S42B4STV.js → builder-T7B46P7T.js} +4 -4
- package/dist/{check-AMTV6RTN.js → check-SPMUN5C4.js} +36 -36
- package/dist/{chunk-4CNUGDNU.js → chunk-2EHDLYSL.js} +9 -9
- package/dist/{chunk-IZKUPAXF.js → chunk-3KGXXTMN.js} +1 -1
- package/dist/{chunk-NYMDS542.js → chunk-4YD7N6V3.js} +4 -4
- package/dist/{chunk-VJQQVTCS.js → chunk-5TXQFZHY.js} +1 -1
- package/dist/{chunk-NPTEYMBW.js → chunk-5W2YSWIW.js} +9 -4
- package/dist/{chunk-LBEYOL5K.js → chunk-7JSWRF5O.js} +2 -2
- package/dist/{chunk-BUVDDPOM.js → chunk-BBJ6BM5U.js} +1 -1
- package/dist/{chunk-QELQ6Y4I.js → chunk-CUAB7FAZ.js} +1 -1
- package/dist/{chunk-ZXQEBRCB.js → chunk-DCBFUUDL.js} +5 -5
- package/dist/{chunk-4557WV4R.js → chunk-EA2PQRCU.js} +2 -2
- package/dist/{chunk-3PFR2WXH.js → chunk-FUOKDHRB.js} +6 -6
- package/dist/{chunk-GHQW2BBX.js → chunk-GG5OE6MY.js} +2 -2
- package/dist/{chunk-6G3BG2GI.js → chunk-H7MGR2GN.js} +2 -2
- package/dist/{chunk-26WUFKYZ.js → chunk-HFOZTCTN.js} +1 -1
- package/dist/{chunk-FG564H3C.js → chunk-I2MFIT6X.js} +5 -5
- package/dist/{chunk-AJZWVXXA.js → chunk-IPWKT5J7.js} +146 -28
- package/dist/{chunk-E3GX4WVJ.js → chunk-KH4774QT.js} +1 -1
- package/dist/{chunk-UAINHP2C.js → chunk-KPEMNHVF.js} +3 -3
- package/dist/{chunk-SH5JFBPO.js → chunk-KQDK4Q6A.js} +1 -1
- package/dist/{chunk-7XDF7PNF.js → chunk-MCPCOKHN.js} +2 -2
- package/dist/{chunk-JDQBJUXQ.js → chunk-MEIDQLXQ.js} +1 -1
- package/dist/{chunk-BRBZKIZG.js → chunk-MRLJK4GZ.js} +2 -2
- package/dist/{chunk-QGTJ5IJN.js → chunk-NCOL5RYI.js} +1 -1
- package/dist/{chunk-KY6H5L5O.js → chunk-OYQVLQP3.js} +37 -8
- package/dist/{chunk-HA46L5FG.js → chunk-P2PNBDUT.js} +5 -4
- package/dist/{chunk-XDCD4GD5.js → chunk-POND2SMT.js} +3 -3
- package/dist/{chunk-265SXBQ5.js → chunk-QGDGGLSD.js} +3 -3
- package/dist/{chunk-RIKXE3T5.js → chunk-QGEGLZSY.js} +6 -6
- package/dist/{chunk-4L46A2RR.js → chunk-QI7JB2GU.js} +87 -23
- package/dist/{chunk-DKIZDYUX.js → chunk-ROQPDCRU.js} +1 -1
- package/dist/{chunk-47SFTQA5.js → chunk-RRXS4CWE.js} +2 -2
- package/dist/{chunk-2CW2QMSG.js → chunk-S6UM3N4R.js} +1 -1
- package/dist/{chunk-64LLUVJR.js → chunk-SAAVZ2BX.js} +1 -1
- package/dist/{chunk-V64BEF6E.js → chunk-T3XPLCJG.js} +1 -1
- package/dist/{chunk-6MLX26T4.js → chunk-TDCHUEKY.js} +2 -2
- package/dist/{chunk-ORENXMHA.js → chunk-UXC3RQLF.js} +1 -1
- package/dist/{chunk-X2ZJL7GA.js → chunk-UZEIBWTP.js} +2 -2
- package/dist/{chunk-WHONZ53R.js → chunk-V2S2WRGD.js} +1 -1
- package/dist/{chunk-BEILLR5Q.js → chunk-W7E6IMEW.js} +3 -3
- package/dist/{chunk-HUS6X5BJ.js → chunk-WA3HIJVK.js} +3 -3
- package/dist/{chunk-I4V2YBMA.js → chunk-WH3FPBPO.js} +598 -40
- package/dist/{chunk-T664NDNT.js → chunk-XDAMLX2L.js} +5 -5
- package/dist/{chunk-JDYBPAPP.js → chunk-YF7W7B7Y.js} +24 -8
- package/dist/{chunk-43BV4MP5.js → chunk-YIK5SGEN.js} +5 -5
- package/dist/{chunk-4N7BQBO4.js → chunk-YLPJOUVF.js} +5 -3
- package/dist/{chunk-TVDKDXW6.js → chunk-ZCA34T7R.js} +3 -3
- package/dist/{chunk-TZXJSNN4.js → chunk-ZCZY3Q55.js} +1 -1
- package/dist/{chunk-BTA5QOKD.js → chunk-ZTOJIRJH.js} +2 -2
- package/dist/{claude-launcher-TG7CHE3N.js → claude-launcher-7IC6QWR5.js} +1 -1
- package/dist/{cli-DQXFGH6X.js → cli-GKROH23V.js} +110 -110
- package/dist/{command-JLHJ2TOH.js → command-XA6DOFL4.js} +24 -24
- package/dist/config-RSOCVUKC.js +17 -0
- package/dist/{connect-cmd-VBEYNPAK.js → connect-cmd-JFGDHFLA.js} +5 -5
- package/dist/{container-start-L5FDIAD7.js → container-start-ZDSVXSAL.js} +30 -30
- package/dist/{context-show-cmd-GMF7YMSN.js → context-show-cmd-XWLTP6R4.js} +6 -6
- package/dist/{control-plane-launch-4WRFVYNP.js → control-plane-launch-3MBWPYWZ.js} +5 -5
- package/dist/{demo-record-cmd-EGBXUDYP.js → demo-record-cmd-SIKNTSGI.js} +2 -2
- package/dist/{demo-voice-cmd-KFNEU2GR.js → demo-voice-cmd-SAB3QU4F.js} +11 -11
- package/dist/{docker-UP7EFFLL.js → docker-YMRPMDOW.js} +4 -4
- package/dist/{doctor-UIQ22QZC.js → doctor-NVHAE4LS.js} +24 -24
- package/dist/{emit-artifact-cmd-NLCKM5TU.js → emit-artifact-cmd-TZTVQCFT.js} +10 -10
- package/dist/{emit-criteria-cmd-GO3TDUCG.js → emit-criteria-cmd-WH7JB4RQ.js} +7 -7
- package/dist/{emit-demo-cmd-EJBQHFR2.js → emit-demo-cmd-DNUVG5N7.js} +11 -11
- package/dist/{emit-finding-cmd-PHUHZLQ3.js → emit-finding-cmd-X5CBH4ZA.js} +7 -7
- package/dist/{emit-result-cmd-UJSWTGDG.js → emit-result-cmd-VCKNZ4RZ.js} +9 -9
- package/dist/{emit-step-cmd-M2JEWJ4Q.js → emit-step-cmd-IUXZZYKO.js} +7 -7
- package/dist/{exec-client-BQIZRROT.js → exec-client-U4544U2S.js} +3 -3
- package/dist/{find-unit-H5DKNRBG.js → find-unit-QYD2FMCP.js} +8 -8
- package/dist/{findings-cmd-O3VCFA55.js → findings-cmd-PLHBAQW4.js} +7 -7
- package/dist/{fleet-readiness-SXIYBEWC.js → fleet-readiness-F65CKZY5.js} +5 -5
- package/dist/{governing-source-QEXH6MIZ.js → governing-source-JFCTQXYK.js} +9 -9
- package/dist/{guest-init-DXXSPKHY.js → guest-init-MI4SEME4.js} +4 -4
- package/dist/{hook-fast-DPC75LFQ.js → hook-fast-GOH4T6SN.js} +1 -1
- package/dist/{host-checks-BOLFMWX2.js → host-checks-LEVAIIN4.js} +28 -28
- package/dist/{pending-V5FBWIJ4.js → host-key-OMLDWLNG.js} +3 -3
- package/dist/{image-tag-3KPTSRB4.js → image-tag-YJJONB64.js} +3 -3
- package/dist/index.js +4 -4
- package/dist/{init-7G3UO6J3.js → init-JVKJTJNM.js} +21 -21
- package/dist/{init-N6UZ5WCL.js → init-W3ATJYLX.js} +24 -22
- package/dist/{init-cmd-4LYUGPB3.js → init-cmd-XJOEU2PB.js} +10 -10
- package/dist/{init-update-4GUGHNS5.js → init-update-KX3FFQ5H.js} +8 -8
- package/dist/{install-cmd-6HGNO2HF.js → install-cmd-QTIIMO6B.js} +5 -5
- package/dist/{logs-HUENB7U4.js → logs-YVXVAYTD.js} +2 -2
- package/dist/{loop-GRDMQM2J.js → loop-NNJN2XOW.js} +35 -35
- package/dist/{machine-QSGONNDX.js → machine-OQOHEMJB.js} +21 -21
- package/dist/{mcp-serve-cmd-OFK3CS2T.js → mcp-serve-cmd-ECTAPDB3.js} +4 -4
- package/dist/{paths-VQ3ALYZ3.js → paths-M66LPPUF.js} +2 -2
- package/dist/{host-key-5P3ZL5XW.js → pending-7LC6XDRO.js} +3 -3
- package/dist/{pidfile-AVJFRZZT.js → pidfile-DSQOOAZV.js} +3 -3
- package/dist/{record-XE7Z3QGF.js → record-3KKIJ3XL.js} +3 -3
- package/dist/{runner-env-K4DOSDUV.js → runner-env-EX7YUIUH.js} +8 -8
- package/dist/{runner-identity-4RVY2MHX.js → runner-identity-LJWBXNM5.js} +4 -4
- package/dist/{runner-key-DIGTV3G5.js → runner-key-CAUO4RKG.js} +21 -21
- package/dist/{session-sender-N6QHL35T.js → session-sender-U2CTD7EX.js} +10 -10
- package/dist/{spec-cmd-EZGRJPUQ.js → spec-cmd-SAWQYHKM.js} +8 -8
- package/dist/{status-NA5DLUXD.js → status-IPIMYTG5.js} +28 -28
- package/dist/{sync-cmd-NEAZMEIL.js → sync-cmd-EBJQ5LMH.js} +9 -9
- package/dist/{update-steps-7HZZPWZE.js → update-steps-E2PP5DPR.js} +29 -29
- package/dist/{watch-FOY5LSSS.js → watch-6NRBX6VE.js} +9 -9
- package/dist/{work-claim-cmd-EJT55FZY.js → work-claim-cmd-SLVX2N4L.js} +12 -12
- package/dist/{work-cmd-KLPPJG4U.js → work-cmd-VSHZCXHQ.js} +7 -7
- package/dist/{work-comment-cmd-TT6TFF6Q.js → work-comment-cmd-3DCL7VHN.js} +8 -8
- package/dist/{work-demo-cmd-22PLEX4X.js → work-demo-cmd-SZJIKB5J.js} +7 -7
- package/dist/{work-logs-cmd-DWK5AYLK.js → work-logs-cmd-MRFSBMJM.js} +7 -7
- package/dist/{work-open-pr-cmd-MKHZBGA6.js → work-open-pr-cmd-N7GK7FUQ.js} +8 -8
- package/dist/{work-pr-cmd-P7PRHAJD.js → work-pr-cmd-HD5OIHUU.js} +7 -7
- package/dist/{work-proofs-cmd-CNQR7RCD.js → work-proofs-cmd-H2GGE5HK.js} +8 -8
- package/dist/{work-proofs-record-GICELEJQ.js → work-proofs-record-CJAFFWXG.js} +14 -14
- package/dist/{work-stop-cmd-U42TFT7X.js → work-stop-cmd-M6RIGF7S.js} +7 -7
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-build/SKILL.md +22 -0
- package/dist/config-2EADRNJB.js +0 -17
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { itemsSentence, criteriaOf, hostItemsOf, loadCitationFinder, MAX_TEST_FILE_BYTES, MAX_TEST_FILES, testFileMatcher, criterionInputs, planCriteria, parseJudgeAnswer, inCriteriaOrder, oneLineReason, judgedItems } from './chunk-UE2C4STC.js';
|
|
4
4
|
import { readsJobState, READ_JOB_STATE_FORMATS, jobStateFormatOf } from './chunk-ZVB57WI6.js';
|
|
5
|
-
import { HELPER_PATH, DOCKERD_LOG, HELPER_RECORD } from './chunk-
|
|
5
|
+
import { HELPER_PATH, DOCKERD_LOG, HELPER_RECORD } from './chunk-POND2SMT.js';
|
|
6
6
|
import { zodProblem } from './chunk-I3LTIAOR.js';
|
|
7
|
-
import { senderPidfile } from './chunk-
|
|
8
|
-
import { installScrubContext } from './chunk-
|
|
9
|
-
import { writeDockerClientConfig } from './chunk-
|
|
7
|
+
import { senderPidfile } from './chunk-TDCHUEKY.js';
|
|
8
|
+
import { installScrubContext } from './chunk-I2MFIT6X.js';
|
|
9
|
+
import { writeDockerClientConfig } from './chunk-BBJ6BM5U.js';
|
|
10
10
|
import { upgradedStarterText } from './chunk-IAVT7R6O.js';
|
|
11
|
-
import { ADDED_USER, shellQuote, GH_CONFIG_YML, ghHostsYml, firstLine, hasClaudeCredential, AssetError, obtainImage, ensureRootfs, makeBuildsDirPrivate, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, startJailedInto, resolveAgentUser, AgentUserError, runBuildSteps, runtimeStepInput, keepRuntimeStep, createContainerRuntime, containerSenderCommand, hostCommandEnvironment, execArgv, signalInContainer, startHostServices, LEASE_SECONDS, managedBuildSettingsFor, stopContainer, cleanupContainer, recordProofsInContainer, PROOFS_LOG, outOfMemoryReason, closeHostBuild, dropManagedClaudeKey, dropManagedBuildSettings, startCheckContainer, ranRuntimeStep, provisionRuntimes, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, syncInContainer, copyTranscriptsFromContainer, MANAGED_UNJAILED_REASON,
|
|
12
|
-
import { fetchCommit, readBranchHead, diffBetween } from './chunk-
|
|
13
|
-
import { waitForAgent, vmExecArgs } from './chunk-
|
|
14
|
-
import { socketPathProblem, vsockLinks, LEASE_LINK, linkVsockSockets } from './chunk-
|
|
15
|
-
import { describeCallFailure, resolveGoverningSource, prefetchGovernedContext, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, formatDuration, removeKeptContext, retrySend, formatClock, keptContextTree, WORKFLOW_PERMISSION_REASON } from './chunk-
|
|
16
|
-
import { imageBuildOf, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, egressSummary, DEFAULT_CHECK_TIME_LIMIT_MINUTES, optionalEgress } from './chunk-
|
|
17
|
-
import { formatBytes, DEFAULT_CACHE_DISK, allocatedBytes } from './chunk-
|
|
18
|
-
import { HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, parseSize, identityScript, identityArgs, parseIdentity, mountableHome, homeCopyScript, homeCopyArgs, childEnvironment, withAnswerProtocol, judgeCommand, MAX_REPORT_BYTES, JUDGE_MAX_TURNS, JUDGE_DIR, COMMAND_DIR, MAX_ITEMS_BYTES } from './chunk-
|
|
11
|
+
import { ADDED_USER, shellQuote, GH_CONFIG_YML, ghHostsYml, firstLine, provisionWithFreshFallback, hasClaudeCredential, AssetError, obtainImage, taggedLog, planSavedState, clockOf, savedStateBase, savedStatesDir, ensureRootfs, makeBuildsDirPrivate, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, startJailedInto, resolveAgentUser, AgentUserError, agentUidOf, userIdChangedReason, runBuildSteps, setupInputFor, runtimeStepInput, settleFailedSteps, keepRuntimeStep, keepMissingSetupScripts, createContainerRuntime, containerSenderCommand, hostCommandEnvironment, execArgv, signalInContainer, startHostServices, LEASE_SECONDS, managedBuildSettingsFor, stopContainer, cleanupContainer, recordProofsInContainer, PROOFS_LOG, outOfMemoryReason, closeHostBuild, dropManagedClaudeKey, dropManagedBuildSettings, startCheckContainer, ranRuntimeStep, provisionRuntimes, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, syncInContainer, copyTranscriptsFromContainer, senderAliveScript, discardUnusableState, MANAGED_UNJAILED_REASON, uidFromProbe, saveAndPrune, managedMachineLimits, withFactoryHosts, helperFirecrackerNote, said, managedClaudeKeyValues, managedBuildSettingValues, stopJailed, deleteBuildDisk, RECORD_PROOFS_ARGV, managedClaudeKeyFor, ROOT_DISK_ID_PREFIX, copyTranscripts, writeRecord, containerJudgeEnvironment, deleteRecord, senderSignalScript, copyJudgeTree } from './chunk-WH3FPBPO.js';
|
|
12
|
+
import { fetchCommit, readBranchHead, diffBetween } from './chunk-OYQVLQP3.js';
|
|
13
|
+
import { waitForAgent, vmExecArgs } from './chunk-5W2YSWIW.js';
|
|
14
|
+
import { socketPathProblem, vsockLinks, LEASE_LINK, linkVsockSockets } from './chunk-ROQPDCRU.js';
|
|
15
|
+
import { describeCallFailure, resolveGoverningSource, prefetchGovernedContext, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, formatDuration, removeKeptContext, retrySend, formatClock, keptContextTree, WORKFLOW_PERMISSION_REASON } from './chunk-DCBFUUDL.js';
|
|
16
|
+
import { imageBuildOf, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, egressSummary, DEFAULT_CHECK_TIME_LIMIT_MINUTES, optionalEgress } from './chunk-YF7W7B7Y.js';
|
|
17
|
+
import { formatBytes, DEFAULT_CACHE_DISK, allocatedBytes } from './chunk-RRXS4CWE.js';
|
|
18
|
+
import { HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, parseSize, identityScript, identityArgs, parseIdentity, mountableHome, homeCopyScript, homeCopyArgs, childEnvironment, withAnswerProtocol, judgeCommand, MAX_REPORT_BYTES, JUDGE_MAX_TURNS, JUDGE_DIR, COMMAND_DIR, MAX_ITEMS_BYTES } from './chunk-P2PNBDUT.js';
|
|
19
19
|
import { CLAUDE_CODE_VERSION, FIRECRACKER_VERSION } from './chunk-D3CT6XQ4.js';
|
|
20
20
|
import { isSameProcess, startTimeOf } from './chunk-JBJTC3UU.js';
|
|
21
|
-
import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-
|
|
21
|
+
import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-XDAMLX2L.js';
|
|
22
22
|
import { planArtifactUpload } from './chunk-VEVNGDTP.js';
|
|
23
23
|
import { readCloudConfig } from './chunk-PJDQPF5N.js';
|
|
24
|
-
import { signerFor } from './chunk-
|
|
24
|
+
import { signerFor } from './chunk-5TXQFZHY.js';
|
|
25
25
|
import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, resolvePackRoot } from './chunk-HH3BQG65.js';
|
|
26
26
|
import { scrubText } from './chunk-GH2HEEOH.js';
|
|
27
27
|
import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
|
|
@@ -29,17 +29,84 @@ import { resolveVersion } from './chunk-RA3O54FC.js';
|
|
|
29
29
|
import { parsePolicy } from './chunk-2EEW6FJN.js';
|
|
30
30
|
import { CheckItemsSchema } from './chunk-IXRUVR25.js';
|
|
31
31
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
32
|
-
import { RUNNER_FILE_MODE, runnerDir, buildDir, vsockPath, jobConsolePath } from './chunk-
|
|
33
|
-
import { JOB_MOUNT, repositoriesOf, primaryOf, buildEnvironment, CHECKOUT_DIR, claudeCredential, AGENT_CREDENTIAL_MISSING, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, RELAY_PORT, repositoryPath, lifecycleWorkdir, CHECK_ITEMS_FILE,
|
|
32
|
+
import { RUNNER_FILE_MODE, runnerDir, buildDir, vsockPath, jobConsolePath } from './chunk-S6UM3N4R.js';
|
|
33
|
+
import { JOB_MOUNT, repositoriesOf, primaryOf, buildEnvironment, CHECKOUT_DIR, claudeCredential, AGENT_CREDENTIAL_MISSING, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, RELAY_PORT, repositoryPath, lifecycleWorkdir, CHECK_ITEMS_FILE, fdName, BUILD_HOME, CLAUDE_CREDENTIAL_VARIABLES, currentClaudeCredential, removedClaudeCredentialValues, managedClaudeCredential, checkEnvironment, withMiseVariables, EVAL_INPUT_DIR } from './chunk-YLPJOUVF.js';
|
|
34
34
|
import { RUNNER_WORDED_REASONS, UNKNOWN_TRACKING_REASON } from './chunk-MESOOLF4.js';
|
|
35
35
|
import { randomBytes, createHash } from 'crypto';
|
|
36
|
-
import { rmSync, existsSync, statSync, appendFileSync, mkdirSync, chmodSync, writeFileSync, openSync, closeSync, readFileSync, readdirSync, lstatSync, realpathSync, fstatSync, readSync } from 'fs';
|
|
36
|
+
import { rmSync, existsSync, statSync, appendFileSync, mkdirSync, chmodSync, writeFileSync, openSync, closeSync, readFileSync, readdirSync, createReadStream, lstatSync, realpathSync, writeSync, renameSync, fstatSync, readSync } from 'fs';
|
|
37
37
|
import { join, dirname, delimiter, sep } from 'path';
|
|
38
38
|
import { spawn, spawnSync } from 'child_process';
|
|
39
39
|
import { once } from 'events';
|
|
40
40
|
import { createServer } from 'net';
|
|
41
41
|
|
|
42
42
|
createRequire(import.meta.url);
|
|
43
|
+
var failureText = (status, stderr) => {
|
|
44
|
+
const line = stderr.trim().split("\n").at(-1) ?? "";
|
|
45
|
+
return `exit ${status}${line === "" ? "" : `: ${line}`}`;
|
|
46
|
+
};
|
|
47
|
+
async function saveMicroVmState(input) {
|
|
48
|
+
const id = randomBytes(6).toString("hex");
|
|
49
|
+
const path = join(input.dir, `${id}.tar`);
|
|
50
|
+
const partial = `${path}.partial`;
|
|
51
|
+
const record = {
|
|
52
|
+
id,
|
|
53
|
+
kind: "tar",
|
|
54
|
+
path,
|
|
55
|
+
savedAt: input.now.toISOString(),
|
|
56
|
+
bytes: 0,
|
|
57
|
+
baseKey: input.key.baseKey,
|
|
58
|
+
key: input.key.key,
|
|
59
|
+
fileHashes: input.key.fileHashes,
|
|
60
|
+
...input.agentUid === void 0 ? {} : { agentUid: input.agentUid },
|
|
61
|
+
complete: false
|
|
62
|
+
};
|
|
63
|
+
const discard = (reason) => {
|
|
64
|
+
rmSync(partial, { force: true });
|
|
65
|
+
rmSync(path, { force: true });
|
|
66
|
+
deleteRecord(input.dir, id);
|
|
67
|
+
return { ok: false, reason };
|
|
68
|
+
};
|
|
69
|
+
try {
|
|
70
|
+
const stopped = await input.guest.run(["/bin/sh", "-c", guestStopScript()]);
|
|
71
|
+
if (stopped.status !== 0) return { ok: false, reason: `the guest's processes could not be stopped (${failureText(stopped.status, stopped.stderr)})` };
|
|
72
|
+
const flushed = await input.guest.run(["sync", "-f", "/build"]);
|
|
73
|
+
if (flushed.status !== 0) return { ok: false, reason: `the build disk could not be flushed (${failureText(flushed.status, flushed.stderr)})` };
|
|
74
|
+
mkdirSync(input.dir, { recursive: true, mode: 448 });
|
|
75
|
+
writeRecord(input.dir, record);
|
|
76
|
+
const fd = openSync(partial, "w", 384);
|
|
77
|
+
let stderr = "";
|
|
78
|
+
let result;
|
|
79
|
+
try {
|
|
80
|
+
result = await input.guest.stream(["tar", "--numeric-owner", "-C", "/build", "-cf", "-", "home", "work"], {
|
|
81
|
+
onStdout: (chunk) => void writeSync(fd, chunk),
|
|
82
|
+
onStderr: (chunk) => void (stderr = (stderr + chunk.toString()).slice(-400))
|
|
83
|
+
});
|
|
84
|
+
} finally {
|
|
85
|
+
closeSync(fd);
|
|
86
|
+
}
|
|
87
|
+
if (result.status !== 0) return discard(`the guest's tar failed (${failureText(result.status, stderr)})`);
|
|
88
|
+
renameSync(partial, path);
|
|
89
|
+
const done = { ...record, bytes: statSync(path).size, complete: true };
|
|
90
|
+
writeRecord(input.dir, done);
|
|
91
|
+
return { ok: true, record: done };
|
|
92
|
+
} catch (err) {
|
|
93
|
+
return discard(`the state could not be saved: ${describeCallFailure(err)}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function restoreMicroVmState(input) {
|
|
97
|
+
const { path } = input.record;
|
|
98
|
+
if (path === void 0 || !existsSync(path)) return { ok: false, reason: "the saved tar file is gone" };
|
|
99
|
+
try {
|
|
100
|
+
let stderr = "";
|
|
101
|
+
const result = await input.guest.stream(["tar", "-x", "--numeric-owner", "-C", "/build"], {
|
|
102
|
+
stdin: createReadStream(path),
|
|
103
|
+
onStderr: (chunk) => void (stderr = (stderr + chunk.toString()).slice(-400))
|
|
104
|
+
});
|
|
105
|
+
return result.status === 0 ? { ok: true } : { ok: false, reason: `tar could not unpack the saved state (${failureText(result.status, stderr)})` };
|
|
106
|
+
} catch (err) {
|
|
107
|
+
return { ok: false, reason: `the saved state could not be unpacked: ${describeCallFailure(err)}` };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
43
110
|
async function serveLease(socketPath, channel, makeServer = createServer, listenOn) {
|
|
44
111
|
const server = makeServer((socket) => channel.accept(socket));
|
|
45
112
|
if (listenOn === void 0) {
|
|
@@ -237,8 +304,23 @@ function tarOf(dir) {
|
|
|
237
304
|
if (packed.status !== 0) throw new Error(`tar could not pack ${dir}: ${packed.stderr.toString("utf8").trim()}`);
|
|
238
305
|
return packed.stdout;
|
|
239
306
|
}
|
|
307
|
+
var ROOT_PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
|
|
308
|
+
function guestPortFor(runtime, state) {
|
|
309
|
+
return {
|
|
310
|
+
run: (argv) => asRoot(runtime, state, argv),
|
|
311
|
+
stream: (argv, io) => runtime.vm.execStream(state.vsockPath, { argv, user: "root", cwd: "/", env: { PATH: ROOT_PATH } }, io)
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
function stepExecFor(input) {
|
|
315
|
+
return async (argv, workdir, opts) => {
|
|
316
|
+
const signal = opts?.timeoutMs === void 0 ? void 0 : AbortSignal.timeout(opts.timeoutMs);
|
|
317
|
+
const ran = await input.vm.exec(input.vsockPath, input.request(argv, workdir, opts?.variables), signal === void 0 ? void 0 : { signal });
|
|
318
|
+
if (opts?.quiet !== true) appendFileSync(input.logPath, ran.stdout + ran.stderr);
|
|
319
|
+
return signal?.aborted === true ? { ...ran, timedOut: true } : ran;
|
|
320
|
+
};
|
|
321
|
+
}
|
|
240
322
|
function asRoot(runtime, state, argv, stdin) {
|
|
241
|
-
return runtime.vm.exec(state.vsockPath, { argv, user: "root", cwd: "/", env: { PATH:
|
|
323
|
+
return runtime.vm.exec(state.vsockPath, { argv, user: "root", cwd: "/", env: { PATH: ROOT_PATH } }, stdin === void 0 ? void 0 : { stdin });
|
|
242
324
|
}
|
|
243
325
|
async function writeGuestGhConfig(runtime, state, token) {
|
|
244
326
|
const script = [
|
|
@@ -338,6 +420,12 @@ async function keepSockets(runtime, buildId, listeners, leaseServer, line, error
|
|
|
338
420
|
return stored;
|
|
339
421
|
}
|
|
340
422
|
async function provisionMicroVm(input) {
|
|
423
|
+
return provisionWithFreshFallback({
|
|
424
|
+
attempt: (allowRestore) => provisionMicroVmOnce(input, allowRestore),
|
|
425
|
+
log: (line) => input.log.line(`#${input.item.number} ${line}`)
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
async function provisionMicroVmOnce(input, allowRestore) {
|
|
341
429
|
const { config, runtime, item, itemKey, jobDir, log, tokens } = input;
|
|
342
430
|
const { vm } = runtime;
|
|
343
431
|
const tag = `#${item.number}`;
|
|
@@ -398,6 +486,18 @@ async function provisionMicroVm(input) {
|
|
|
398
486
|
});
|
|
399
487
|
if (!obtained.ok) return obtained.aborted === true ? { ok: false, reason: obtained.reason, aborted: true } : fail(obtained.reason);
|
|
400
488
|
const { report } = obtained.built;
|
|
489
|
+
const tagged = taggedLog(log, tag);
|
|
490
|
+
const plan = await planSavedState({
|
|
491
|
+
config,
|
|
492
|
+
repositories,
|
|
493
|
+
base: savedStateBase(report),
|
|
494
|
+
runtime,
|
|
495
|
+
tokens,
|
|
496
|
+
now: clockOf(input.now)(),
|
|
497
|
+
allowRestore,
|
|
498
|
+
log: tagged
|
|
499
|
+
});
|
|
500
|
+
const savedStatesPath = savedStatesDir(runnerDirPath);
|
|
401
501
|
const madeInBuilder = "rootfs" in obtained.built ? obtained.built.rootfs : void 0;
|
|
402
502
|
const buildId = randomBytes(6).toString("hex");
|
|
403
503
|
const buildDir2 = buildDir(config.configPath, buildId);
|
|
@@ -453,6 +553,10 @@ async function provisionMicroVm(input) {
|
|
|
453
553
|
}
|
|
454
554
|
return aborted ? { ok: false, reason: "ended before provision finished", aborted: true } : fail(why);
|
|
455
555
|
};
|
|
556
|
+
const giveUpState = async (reason) => {
|
|
557
|
+
await bail(reason);
|
|
558
|
+
return discardUnusableState({ record: plan.restore.record, reason, dir: savedStatesPath, removeVolume: async () => void 0, onError: (line) => log.error(`${tag} ${line}`) });
|
|
559
|
+
};
|
|
456
560
|
if (input.aborted()) return bail("", true);
|
|
457
561
|
let imageConfig;
|
|
458
562
|
if (madeInBuilder !== void 0) {
|
|
@@ -595,8 +699,7 @@ async function provisionMicroVm(input) {
|
|
|
595
699
|
environment.credentials = tokens.used();
|
|
596
700
|
const uidOf = async (user) => {
|
|
597
701
|
const probe = await asRoot(runtime, state, ["id", "-u", user]);
|
|
598
|
-
|
|
599
|
-
return probe.status === 0 && Number.isInteger(uid) ? uid : null;
|
|
702
|
+
return uidFromProbe(probe);
|
|
600
703
|
};
|
|
601
704
|
let agentUser;
|
|
602
705
|
try {
|
|
@@ -612,6 +715,14 @@ async function provisionMicroVm(input) {
|
|
|
612
715
|
} catch (err) {
|
|
613
716
|
return bail(describeCallFailure(err));
|
|
614
717
|
}
|
|
718
|
+
const agentUid = agentUidOf(await asRoot(runtime, state, ["id", "-u", agentUser]));
|
|
719
|
+
const guest = guestPortFor(runtime, state);
|
|
720
|
+
if (plan.restore !== void 0) {
|
|
721
|
+
const changed = userIdChangedReason(plan.restore.record.agentUid, agentUid);
|
|
722
|
+
if (changed !== void 0) return giveUpState(changed);
|
|
723
|
+
const restored = await restoreMicroVmState({ guest, record: plan.restore.record });
|
|
724
|
+
if (!restored.ok) return giveUpState(restored.reason);
|
|
725
|
+
}
|
|
615
726
|
const tools = await asRoot(runtime, state, ["cat", "/opt/outerlayer/tools.json"]);
|
|
616
727
|
const agentVersion = agentVersionOf(tools.status === 0 ? tools.stdout : "");
|
|
617
728
|
environment.agentVersion = agentVersion;
|
|
@@ -623,6 +734,12 @@ async function provisionMicroVm(input) {
|
|
|
623
734
|
const failure = await waitForDocker(runtime, state, agentUser, input.now ?? (() => /* @__PURE__ */ new Date()));
|
|
624
735
|
if (failure !== void 0) return bail(failure);
|
|
625
736
|
}
|
|
737
|
+
const saveState = () => saveAndPrune({
|
|
738
|
+
save: () => saveMicroVmState({ guest, dir: savedStatesPath, key: plan.key, agentUid, now: clockOf(input.now)(), log: tagged }),
|
|
739
|
+
dir: savedStatesPath,
|
|
740
|
+
removeVolume: async () => void 0,
|
|
741
|
+
log: tagged
|
|
742
|
+
});
|
|
626
743
|
const request = (argv, workdir, variables) => ({
|
|
627
744
|
argv,
|
|
628
745
|
user: agentUser,
|
|
@@ -636,11 +753,7 @@ async function provisionMicroVm(input) {
|
|
|
636
753
|
...governingSource.kind === "governed" ? { governing: { repository: governingSource.repository } } : {},
|
|
637
754
|
agentVersion,
|
|
638
755
|
lifecycle: report.apply.lifecycle,
|
|
639
|
-
exec:
|
|
640
|
-
const ran = await vm.exec(state.vsockPath, request(argv, workdir, opts?.variables));
|
|
641
|
-
if (opts?.quiet !== true) appendFileSync(logPath, ran.stdout + ran.stderr);
|
|
642
|
-
return ran;
|
|
643
|
-
},
|
|
756
|
+
exec: stepExecFor({ vm, vsockPath: state.vsockPath, request, logPath }),
|
|
644
757
|
log,
|
|
645
758
|
tag,
|
|
646
759
|
aborted: input.aborted,
|
|
@@ -669,17 +782,19 @@ async function provisionMicroVm(input) {
|
|
|
669
782
|
keepIn: jobDir,
|
|
670
783
|
...input.requireBuildSkill === true ? { requireBuildSkill: true } : {},
|
|
671
784
|
// A build on the universal image, or on an image built from it, chooses and installs its runtimes.
|
|
672
|
-
...runtimeStepInput(report, services)
|
|
785
|
+
...runtimeStepInput(report, services),
|
|
786
|
+
setup: setupInputFor({ setupMinutes: config.build?.setupMinutes, plan, saveState })
|
|
673
787
|
});
|
|
674
|
-
if (!steps.ok) return
|
|
788
|
+
if (!steps.ok) return settleFailedSteps(steps, { giveUp: giveUpState, bail });
|
|
675
789
|
state.startCommit = steps.startCommit;
|
|
676
790
|
keepRuntimeStep(state, steps);
|
|
791
|
+
keepMissingSetupScripts(state, steps);
|
|
677
792
|
if (steps.controlPlane !== void 0) environment.controlPlane = steps.controlPlane;
|
|
678
793
|
return { ok: true, workdir: CHECKOUT_DIR, state, environment };
|
|
679
794
|
}
|
|
680
795
|
async function waitForDocker(runtime, state, agentUser, now) {
|
|
681
796
|
const grant = `[ -S ${DOCKER_SOCKET} ] && chgrp "$(id -g ${shellQuote(agentUser)})" ${DOCKER_SOCKET} && chmod 660 ${DOCKER_SOCKET}`;
|
|
682
|
-
const request = { argv: ["timeout", "5", "docker", "info"], user: agentUser, cwd: "/", env: { PATH:
|
|
797
|
+
const request = { argv: ["timeout", "5", "docker", "info"], user: agentUser, cwd: "/", env: { PATH: ROOT_PATH } };
|
|
683
798
|
const deadline = now().getTime() + DOCKER_WAIT_SECONDS * 1e3;
|
|
684
799
|
let lastError = "";
|
|
685
800
|
for (; ; ) {
|
|
@@ -719,6 +834,7 @@ function vmExecFor(input, argv) {
|
|
|
719
834
|
hostEnv: input.runtime.hostEnv,
|
|
720
835
|
containerEnv: state.containerEnv ?? {},
|
|
721
836
|
unpinnedRuntimes: state.unpinnedRuntimes,
|
|
837
|
+
missingSetupScripts: state.missingSetupScripts,
|
|
722
838
|
miseVariables: state.miseVariables,
|
|
723
839
|
builtIns: state.builtIns === true,
|
|
724
840
|
identity: input.job.commitIdentity,
|
|
@@ -750,6 +866,7 @@ async function startMicroVmCommand(input) {
|
|
|
750
866
|
hostEnv: input.runtime.hostEnv,
|
|
751
867
|
containerEnv: state.containerEnv ?? {},
|
|
752
868
|
unpinnedRuntimes: state.unpinnedRuntimes,
|
|
869
|
+
missingSetupScripts: state.missingSetupScripts,
|
|
753
870
|
miseVariables: state.miseVariables,
|
|
754
871
|
builtIns: state.builtIns === true,
|
|
755
872
|
identity: input.job.commitIdentity,
|
|
@@ -800,6 +917,7 @@ async function runCliInMicroVm(input, argv, logName, goneReason) {
|
|
|
800
917
|
hostEnv: runtime.hostEnv,
|
|
801
918
|
containerEnv: state.containerEnv ?? {},
|
|
802
919
|
unpinnedRuntimes: state.unpinnedRuntimes,
|
|
920
|
+
missingSetupScripts: state.missingSetupScripts,
|
|
803
921
|
miseVariables: state.miseVariables,
|
|
804
922
|
builtIns: state.builtIns === true,
|
|
805
923
|
identity: job.commitIdentity,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-S6UM3N4R.js';
|
|
4
4
|
import { readlinkSync, realpathSync, mkdirSync, unlinkSync, symlinkSync, renameSync, readFileSync, writeFileSync, rmSync, existsSync, readdirSync } from 'fs';
|
|
5
5
|
import { join, basename, sep, resolve } from 'path';
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { DEFAULT_UNIT_NAME } from './chunk-
|
|
4
|
-
import { RUNNER_FILE_MODE } from './chunk-
|
|
5
|
-
import { claudeEnvPath, withoutCredentialLines, parseRunnerEnv } from './chunk-
|
|
3
|
+
import { DEFAULT_UNIT_NAME } from './chunk-4YD7N6V3.js';
|
|
4
|
+
import { RUNNER_FILE_MODE } from './chunk-S6UM3N4R.js';
|
|
5
|
+
import { claudeEnvPath, withoutCredentialLines, parseRunnerEnv } from './chunk-YLPJOUVF.js';
|
|
6
6
|
import { existsSync, readFileSync, writeFileSync, renameSync, rmSync } from 'fs';
|
|
7
7
|
import { join, dirname } from 'path';
|
|
8
8
|
|
|
@@ -5,7 +5,7 @@ import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME
|
|
|
5
5
|
import { installStarterPack } from './chunk-54LIUIZL.js';
|
|
6
6
|
import { C } from './chunk-ANPNT6PM.js';
|
|
7
7
|
import { AGENTS_MD_LAYOUT, declareAgentsMdLayout, linkClaudeSkills, SKILLS_LINK_PATH, describeSkillsLink, isAgentsMdLayout, holdsTodaysLayoutSources, discoverOuterlayerPaths } from './chunk-ARL6X6Y4.js';
|
|
8
|
-
import { resolveGitCommonDir, defaultGitRunner } from './chunk-
|
|
8
|
+
import { resolveGitCommonDir, defaultGitRunner } from './chunk-UZEIBWTP.js';
|
|
9
9
|
import { loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE } from './chunk-HH3BQG65.js';
|
|
10
10
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
11
11
|
import { linkedAgentsPath } from './chunk-RQ3GCCHH.js';
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
|
|
4
4
|
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
5
|
-
import { autoConnect } from './chunk-
|
|
5
|
+
import { autoConnect } from './chunk-MRLJK4GZ.js';
|
|
6
6
|
import { C } from './chunk-ANPNT6PM.js';
|
|
7
7
|
import { acquireSpoolLockAt } from './chunk-VEVNGDTP.js';
|
|
8
|
-
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-
|
|
8
|
+
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-3KGXXTMN.js';
|
|
9
9
|
import { resolveRepoIdentity } from './chunk-GH2HEEOH.js';
|
|
10
10
|
import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
|
|
11
11
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-S6UM3N4R.js';
|
|
4
4
|
import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
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-HFOZTCTN.js';
|
|
4
|
+
import { resolveGatewayCredentials } from './chunk-3KGXXTMN.js';
|
|
5
5
|
import { readCloudConfig } from './chunk-PJDQPF5N.js';
|
|
6
6
|
import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
7
7
|
import { resolveRepoIdentity } from './chunk-GH2HEEOH.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { currentLink } from './chunk-
|
|
3
|
+
import { currentLink } from './chunk-KH4774QT.js';
|
|
4
4
|
import { readFileSync, statSync, chmodSync, mkdirSync, writeFileSync, renameSync, rmSync, existsSync, lstatSync, accessSync, constants, realpathSync } from 'fs';
|
|
5
5
|
import { randomBytes } from 'crypto';
|
|
6
6
|
import { join, dirname, delimiter, resolve } from 'path';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { toolsDockerfile } from './chunk-
|
|
4
|
-
import { runnerLabelValue } from './chunk-
|
|
3
|
+
import { toolsDockerfile } from './chunk-T3XPLCJG.js';
|
|
4
|
+
import { runnerLabelValue } from './chunk-P2PNBDUT.js';
|
|
5
5
|
import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-CM4J53WZ.js';
|
|
6
6
|
import { UNIVERSAL_IMAGE_DIGEST, UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_SOURCE, CLAUDE_CODE_VERSION, NODE_IMAGE, UNIVERSAL_IMAGE, MEDIA_PINS, TINI_VERSION, GH_VERSION } from './chunk-D3CT6XQ4.js';
|
|
7
|
-
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-
|
|
7
|
+
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-SAAVZ2BX.js';
|
|
8
8
|
import { startTimeOf } from './chunk-JBJTC3UU.js';
|
|
9
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, runnerDir, rootfsPathFor } from './chunk-
|
|
10
|
-
import { withGitConfig, tokenHeader } from './chunk-
|
|
9
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, runnerDir, rootfsPathFor } from './chunk-S6UM3N4R.js';
|
|
10
|
+
import { withGitConfig, tokenHeader } from './chunk-YLPJOUVF.js';
|
|
11
11
|
import { mkdirSync, rmSync, writeFileSync, existsSync, mkdtempSync, cpSync, readFileSync, readdirSync, lstatSync, readlinkSync } from 'fs';
|
|
12
12
|
import { tmpdir } from 'os';
|
|
13
13
|
import { dirname, join } from 'path';
|
|
@@ -24,7 +24,7 @@ function gitEnvironment(base) {
|
|
|
24
24
|
function tokenSettings(remote, token) {
|
|
25
25
|
return (env) => withGitConfig(env, `http.${remote}.extraHeader`, tokenHeader(token));
|
|
26
26
|
}
|
|
27
|
-
function git(cwd, args, timeoutMs, extend = (env) => env) {
|
|
27
|
+
function git(cwd, args, timeoutMs, extend = (env) => env, raw = false) {
|
|
28
28
|
const env = extend(gitEnvironment(process.env));
|
|
29
29
|
return new Promise((resolve, reject) => {
|
|
30
30
|
execFile(
|
|
@@ -34,7 +34,7 @@ function git(cwd, args, timeoutMs, extend = (env) => env) {
|
|
|
34
34
|
(error, stdout, stderr) => {
|
|
35
35
|
if (error && error.killed && timeoutMs !== void 0) reject(new Error(`git ${args[0]} failed: no answer within ${timeoutMs / 1e3}s`));
|
|
36
36
|
else if (error) reject(new Error(`git ${args[0]} failed: ${stderr.trim() || error.message}`));
|
|
37
|
-
else resolve(stdout.trim());
|
|
37
|
+
else resolve(raw ? stdout : stdout.trim());
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
});
|
|
@@ -146,6 +146,35 @@ async function cloneRepository(remote, dest, timeoutMs = CLONE_TIMEOUT_MS) {
|
|
|
146
146
|
return { ok: false, reason: `the clone of ${remote} failed: ${detail}` };
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
+
async function readDefaultBranchFiles(input) {
|
|
150
|
+
const credential = input.token === void 0 ? void 0 : tokenSettings(input.remote, input.token);
|
|
151
|
+
const over = (args, timeoutMs = CLONE_TIMEOUT_MS, raw = false) => git(input.dir, args, timeoutMs, credential, raw);
|
|
152
|
+
try {
|
|
153
|
+
mkdirSync(input.dir, { recursive: true, mode: RUNNER_DIR_MODE });
|
|
154
|
+
const defaultBranch = defaultBranchOf(await over(["ls-remote", "--symref", input.remote, "HEAD"], HEAD_TIMEOUT_MS));
|
|
155
|
+
if (defaultBranch === null) return { ok: false, reason: `${input.remote} does not say which branch is its default; the runner will not guess one` };
|
|
156
|
+
await git(input.dir, ["init", "--quiet"]);
|
|
157
|
+
await git(input.dir, ["config", "remote.origin.url", input.remote]);
|
|
158
|
+
await git(input.dir, ["config", "remote.origin.promisor", "true"]);
|
|
159
|
+
await git(input.dir, ["config", "remote.origin.partialclonefilter", "blob:none"]);
|
|
160
|
+
await over(["fetch", "--quiet", "--depth", "1", "--no-tags", "--filter=blob:none", "--force", "origin", `refs/heads/${defaultBranch}`]);
|
|
161
|
+
const commit = await git(input.dir, ["rev-parse", "FETCH_HEAD"]);
|
|
162
|
+
const listed = input.paths.length === 0 ? "" : await git(input.dir, ["ls-tree", "-z", commit, "--", ...input.paths], void 0, void 0, true);
|
|
163
|
+
const blobs = /* @__PURE__ */ new Map();
|
|
164
|
+
for (const entry of listed.split("\0")) {
|
|
165
|
+
const match = /^\d+ blob ([0-9a-f]+)\t(.+)$/s.exec(entry);
|
|
166
|
+
if (match !== null) blobs.set(match[2], match[1]);
|
|
167
|
+
}
|
|
168
|
+
const files = {};
|
|
169
|
+
for (const path of input.paths) {
|
|
170
|
+
const blob = blobs.get(path);
|
|
171
|
+
files[path] = blob === void 0 ? null : await over(["cat-file", "blob", blob], CLONE_TIMEOUT_MS, true);
|
|
172
|
+
}
|
|
173
|
+
return { ok: true, defaultBranch, commit, files };
|
|
174
|
+
} catch (err) {
|
|
175
|
+
return { ok: false, reason: `the default branch of ${input.remote} could not be read: ${gitFailureLine(err)}` };
|
|
176
|
+
}
|
|
177
|
+
}
|
|
149
178
|
function sha256(...chunks) {
|
|
150
179
|
const hash = createHash("sha256");
|
|
151
180
|
for (const chunk of chunks) hash.update(chunk);
|
|
@@ -503,4 +532,4 @@ async function prune(host, repository, repoRecords, keep, runnerDirPath, runnerL
|
|
|
503
532
|
return removed;
|
|
504
533
|
}
|
|
505
534
|
|
|
506
|
-
export { KEY_PREFIX, SHARED_NAME, SHARED_OWNER, SHARED_REPOSITORY, TAG_HOST, UNIVERSAL_SOURCE_LABEL, baseLines, buildRepositoryImage, cloneRepository, diffBetween, fetchCommit, metadataFromLabels, prepareImageBuild, readBranchHead, readDefaultBranchHead, universalBase, writeRecord };
|
|
535
|
+
export { KEY_PREFIX, SHARED_NAME, SHARED_OWNER, SHARED_REPOSITORY, TAG_HOST, UNIVERSAL_SOURCE_LABEL, baseLines, buildRepositoryImage, cloneRepository, diffBetween, fetchCommit, metadataFromLabels, prepareImageBuild, readBranchHead, readDefaultBranchFiles, readDefaultBranchHead, universalBase, writeRecord };
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { resolveDevcontainerCli, devcontainerBuildInvocation, universalImagePending, RecipeError } from './chunk-CM4J53WZ.js';
|
|
4
4
|
import { universalImagePinned, UNIVERSAL_IMAGE, BUILDKIT_IMAGE } from './chunk-D3CT6XQ4.js';
|
|
5
|
-
import { ensureHostKey } from './chunk-
|
|
5
|
+
import { ensureHostKey } from './chunk-5TXQFZHY.js';
|
|
6
6
|
import { compareVersions } from './chunk-GH2HEEOH.js';
|
|
7
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-
|
|
8
|
-
import { CLAUDE_PORT, BUILD_HOME, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-
|
|
7
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-S6UM3N4R.js';
|
|
8
|
+
import { CLAUDE_PORT, BUILD_HOME, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-YLPJOUVF.js';
|
|
9
9
|
import { JOIN_DIR, RELAY_ID, JOIN_SOCKET, TARGET_GATEWAY, TARGET_CLAUDE, destinationTarget, RELAY_USER } from './chunk-MESOOLF4.js';
|
|
10
10
|
import { createHash } from 'crypto';
|
|
11
11
|
import { mkdirSync, createWriteStream, rmSync, existsSync, readFileSync, chmodSync, writeFileSync, realpathSync, readdirSync, renameSync } from 'fs';
|
|
@@ -517,6 +517,7 @@ function homeCopyArgs(home) {
|
|
|
517
517
|
// src/runner/container/run-args.ts
|
|
518
518
|
var COMMAND_DIR = "/build/.command";
|
|
519
519
|
var BUILD_LABEL = "ai.outerlayer.build";
|
|
520
|
+
var SAVED_STATE_LABEL = "ai.outerlayer.saved-state";
|
|
520
521
|
function runnerLabelValue(configPath) {
|
|
521
522
|
return readRunnerIdentity(configPath)?.label ?? pathLabelValue(configPath);
|
|
522
523
|
}
|
|
@@ -862,4 +863,4 @@ function ensureBuilder(rawRun, spec, options = {}) {
|
|
|
862
863
|
);
|
|
863
864
|
}
|
|
864
865
|
|
|
865
|
-
export { BUILD_LABEL, COMMAND_DIR, HASH_ARGV, JUDGE_DIR, JUDGE_ITEMS, JUDGE_MAX_TURNS, JUDGE_PROGRAM, JUDGE_REPORT, MAX_ITEMS_BYTES, MAX_REPORT_BYTES, MIN_BUILDX_VERSION, NETWORK_HELPER_MEMORY, NETWORK_READY_FILE, RUNNER_LABEL, builderName, builderNameFor, builderSpec, buildxState, childEnvironment, containerExecArgs, containerRunArgs, createDockerHost, dockerIdentity, ensureBuilder, ensureFailureCount, ensureRunnerIdentity, exceedsDisk, homeCopyArgs, homeCopyRunArgs, homeCopyScript, identityArgs, identityDockerFor, identityRunArgs, identityScript, isOutOfMemory, judgeCommand, mountableHome, networkHelperName, networkHelperRunArgs, parseIdentity, parseProgramHash, parseSize, pathLabelValue, prepareRunArgs, proxyEnvironment, readDu, readJobFile, readJobFileChecked, readRunnerIdentity, runnerLabelValue, spawnRun, trackImageBuild, withAnswerProtocol, writeJobFile };
|
|
866
|
+
export { BUILD_LABEL, COMMAND_DIR, HASH_ARGV, JUDGE_DIR, JUDGE_ITEMS, JUDGE_MAX_TURNS, JUDGE_PROGRAM, JUDGE_REPORT, MAX_ITEMS_BYTES, MAX_REPORT_BYTES, MIN_BUILDX_VERSION, NETWORK_HELPER_MEMORY, NETWORK_READY_FILE, RUNNER_LABEL, SAVED_STATE_LABEL, builderName, builderNameFor, builderSpec, buildxState, childEnvironment, containerExecArgs, containerRunArgs, createDockerHost, dockerIdentity, ensureBuilder, ensureFailureCount, ensureRunnerIdentity, exceedsDisk, homeCopyArgs, homeCopyRunArgs, homeCopyScript, identityArgs, identityDockerFor, identityRunArgs, identityScript, isOutOfMemory, judgeCommand, mountableHome, networkHelperName, networkHelperRunArgs, parseIdentity, parseProgramHash, parseSize, pathLabelValue, prepareRunArgs, proxyEnvironment, readDu, readJobFile, readJobFileChecked, readRunnerIdentity, runnerLabelValue, spawnRun, trackImageBuild, withAnswerProtocol, writeJobFile };
|
|
@@ -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-
|
|
4
|
-
import { EXEC_PORT } from './chunk-
|
|
3
|
+
import { TUNNEL_PORT, BRIDGE_ADDRESS, BRIDGE_CIDR } from './chunk-BBJ6BM5U.js';
|
|
4
|
+
import { EXEC_PORT } from './chunk-ROQPDCRU.js';
|
|
5
5
|
import { startTimeOf } from './chunk-JBJTC3UU.js';
|
|
6
|
-
import { RELAY_PORT } from './chunk-
|
|
6
|
+
import { RELAY_PORT } from './chunk-YLPJOUVF.js';
|
|
7
7
|
import { spawn, spawnSync } from 'child_process';
|
|
8
8
|
import { symlinkSync, lstatSync, writeFileSync, chmodSync, mkdirSync, existsSync } from 'fs';
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { launcherPath, pathNotes, writeLauncher, LauncherWriteError } from './chunk-
|
|
4
|
-
import { currentVersion, currentLink, versionDir, execStartLine, isInLayout, packageRootIn, switchCurrent } from './chunk-
|
|
3
|
+
import { launcherPath, pathNotes, writeLauncher, LauncherWriteError } from './chunk-NCOL5RYI.js';
|
|
4
|
+
import { currentVersion, currentLink, versionDir, execStartLine, isInLayout, packageRootIn, switchCurrent } from './chunk-KH4774QT.js';
|
|
5
5
|
import { compareVersions } from './chunk-TQMI335S.js';
|
|
6
|
-
import { runnerDir, RUNNER_DIR_MODE } from './chunk-
|
|
6
|
+
import { runnerDir, RUNNER_DIR_MODE } from './chunk-S6UM3N4R.js';
|
|
7
7
|
import { lchownSync, lstatSync, realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync, readdirSync } from 'fs';
|
|
8
8
|
import { dirname, sep, join } from 'path';
|
|
9
9
|
import { spawnSync } from 'child_process';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { placeholderQueues, placeholderProblem } from './chunk-
|
|
4
|
-
import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-
|
|
5
|
-
import { builtinKind, EGRESS_SWITCHABLE_KEYS, imageBuildOf, keepsHostBuilder } from './chunk-
|
|
6
|
-
import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK, volumeBytes } from './chunk-
|
|
7
|
-
import { spawnRun, RUNNER_LABEL, BUILD_LABEL } from './chunk-
|
|
3
|
+
import { placeholderQueues, placeholderProblem } from './chunk-WH3FPBPO.js';
|
|
4
|
+
import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-4YD7N6V3.js';
|
|
5
|
+
import { builtinKind, EGRESS_SWITCHABLE_KEYS, imageBuildOf, keepsHostBuilder } from './chunk-YF7W7B7Y.js';
|
|
6
|
+
import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK, volumeBytes } from './chunk-RRXS4CWE.js';
|
|
7
|
+
import { spawnRun, RUNNER_LABEL, BUILD_LABEL } from './chunk-P2PNBDUT.js';
|
|
8
8
|
import { builderDiskPinned } from './chunk-D3CT6XQ4.js';
|
|
9
|
-
import { BUILD_SLICE_MEMORY_ENV, FORWARDED_CLAUDE_CREDENTIAL_VARIABLES, claudeCredentialVariablesSet, claudeCredential, claudeEnvPath, parseRunnerEnv } from './chunk-
|
|
9
|
+
import { BUILD_SLICE_MEMORY_ENV, FORWARDED_CLAUDE_CREDENTIAL_VARIABLES, claudeCredentialVariablesSet, claudeCredential, claudeEnvPath, parseRunnerEnv } from './chunk-YLPJOUVF.js';
|
|
10
10
|
import { closeSync, openSync, constants, readFileSync } from 'fs';
|
|
11
11
|
import { join, dirname } from 'path';
|
|
12
12
|
import { totalmem } from 'os';
|