@outerlayer/cli 0.35.0-next.20261030105600 → 0.35.0-next.20261030155846
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-G445QZEM.js → agent-setup-346QMQY6.js} +5 -5
- package/dist/{build-MXJK46WR.js → build-HHBTSTE4.js} +6 -6
- package/dist/{build-disk-7VCUIOYV.js → build-disk-R6OH6JL5.js} +5 -5
- package/dist/build-info.json +1 -1
- package/dist/{builder-R4IJR7FU.js → builder-DL6NSVAU.js} +4 -4
- package/dist/{caller-D5IPBPRD.js → caller-Q44OIVRR.js} +7 -7
- package/dist/{check-QDYMMOSL.js → check-W4LSRCMV.js} +35 -34
- package/dist/{chunk-PPZ47OB6.js → chunk-3L7OHRDV.js} +1 -1
- package/dist/{chunk-XU5BNWX7.js → chunk-4DJZSNVT.js} +1 -1
- package/dist/{chunk-WXUG6UAF.js → chunk-4PW2DKHE.js} +315 -27
- package/dist/{chunk-VNHBDHX7.js → chunk-7J7HRYZ3.js} +1 -1
- package/dist/{chunk-7KMTCVXQ.js → chunk-7KAWBQ7V.js} +8 -4
- package/dist/{chunk-PILW3YP4.js → chunk-7TTYUY2V.js} +1 -1
- package/dist/{chunk-ZI7JENTB.js → chunk-7Y5VW4JG.js} +1 -1
- package/dist/{chunk-RO2XIOEN.js → chunk-ABGJ67PH.js} +10 -6
- package/dist/{chunk-7R655ODT.js → chunk-AF6DQJ5W.js} +1 -1
- package/dist/{chunk-SQGD4LYW.js → chunk-ALEUIS35.js} +1 -1
- package/dist/{chunk-DFGQM24P.js → chunk-AZJCSBRV.js} +87 -28
- package/dist/{chunk-QV3QP37Q.js → chunk-BNFFQC3M.js} +7 -7
- package/dist/{chunk-CANPD2V3.js → chunk-CPIYKBQ2.js} +4 -4
- package/dist/{chunk-PBAGWT2M.js → chunk-DH6BDQM4.js} +257 -95
- package/dist/{chunk-LNFQ5NOF.js → chunk-DOYLWBJJ.js} +3 -3
- package/dist/{chunk-ZH22PFZM.js → chunk-EK2FNOCD.js} +2 -2
- package/dist/{chunk-SHPCVBT3.js → chunk-EZRAR5YG.js} +1 -1
- package/dist/{chunk-PAGH2XKJ.js → chunk-FKLGX72N.js} +6 -6
- package/dist/{chunk-EDBLOBUB.js → chunk-FW3ZQKPY.js} +4 -4
- package/dist/{chunk-VAP56OP7.js → chunk-G2HRULTO.js} +2 -2
- package/dist/{chunk-LBYP6CPV.js → chunk-GGI3J7WS.js} +103 -22
- package/dist/{chunk-TYRKGKMX.js → chunk-HTQBIXE7.js} +2 -2
- package/dist/{chunk-CPWSPEP5.js → chunk-K3Z4Y6VU.js} +3 -3
- package/dist/{chunk-QI3AZT5E.js → chunk-K5EOLRGJ.js} +3 -3
- package/dist/{chunk-LW2A24IA.js → chunk-LGV5N5DG.js} +1 -1
- package/dist/{chunk-GC4U7WQV.js → chunk-LXAYOMSX.js} +6 -6
- package/dist/{chunk-EBFU4YCI.js → chunk-MCMDEEXB.js} +3 -3
- package/dist/{receive-files-T2BIUBQL.js → chunk-NN33FYXG.js} +0 -1
- package/dist/{chunk-Z7JFM5LP.js → chunk-ODX2XCL3.js} +3 -3
- package/dist/{chunk-SOBWIJDO.js → chunk-OS73XDJ7.js} +5 -5
- package/dist/{chunk-3JMDMXJO.js → chunk-P24VR4H3.js} +2 -2
- package/dist/{chunk-6IIP4KMY.js → chunk-P4PVRDVY.js} +3 -3
- package/dist/{chunk-L5GF2A43.js → chunk-P5CXB7ZT.js} +3 -3
- package/dist/{chunk-2F43WNKI.js → chunk-RIHB3HA2.js} +3 -3
- package/dist/{chunk-FTBBADQG.js → chunk-RKDOKIIK.js} +2 -2
- package/dist/{chunk-B5HTR43X.js → chunk-RLFVKOEI.js} +3 -3
- package/dist/{chunk-TMIJHMEN.js → chunk-RS2RFWIK.js} +1 -1
- package/dist/{chunk-FQVTJ4B3.js → chunk-SEY2HTZO.js} +7 -7
- package/dist/{chunk-HXCUMPPY.js → chunk-SUVWQPOG.js} +3 -3
- package/dist/{chunk-POZ65DAI.js → chunk-USR45QSV.js} +1 -1
- package/dist/{chunk-3AYPAQNQ.js → chunk-UVQ5C3UP.js} +1 -1
- package/dist/{chunk-NQ7R5AW5.js → chunk-VQCUADLI.js} +3 -3
- package/dist/{chunk-LKUDG3CH.js → chunk-VRNAM7WM.js} +10 -10
- package/dist/{chunk-AUVJMR3P.js → chunk-WAZJPDR2.js} +1 -1
- package/dist/{chunk-YQHUCOUL.js → chunk-WT7J2627.js} +4 -1
- package/dist/{chunk-EK7MQ56V.js → chunk-WYGAQVBU.js} +1 -1
- package/dist/{chunk-BITJMQJ2.js → chunk-WYJUQGCB.js} +3 -3
- package/dist/{chunk-GBMTKV5B.js → chunk-YQHEJ5SV.js} +1 -1
- package/dist/{claude-launcher-VA3OAA5V.js → claude-launcher-HREPADCN.js} +97 -9
- package/dist/{cli-IEJWJDVU.js → cli-KQUVZRRG.js} +114 -113
- package/dist/{command-HSI2RX4D.js → command-OHJUJ2WX.js} +24 -23
- package/dist/{config-ZHLG4LA4.js → config-EYFLM4WT.js} +6 -6
- package/dist/{connect-cmd-NDWWTEHW.js → connect-cmd-REJ5FEC6.js} +5 -5
- package/dist/{container-start-Z7C67PBJ.js → container-start-KG3ZLJWU.js} +27 -26
- package/dist/{context-show-cmd-HLEHQJTV.js → context-show-cmd-XT3QP5OR.js} +6 -6
- package/dist/{control-plane-launch-X2QXGPFW.js → control-plane-launch-PCGH76P5.js} +4 -4
- package/dist/{demo-voice-cmd-NZR2MAUZ.js → demo-voice-cmd-2QE7SQRC.js} +11 -11
- package/dist/{dist-RR6YVPSF.js → dist-BARPQSHD.js} +1 -1
- package/dist/{docker-GVIT4XAC.js → docker-3UKTW4GR.js} +4 -4
- package/dist/{doctor-33W5WXME.js → doctor-5HY3JA5Y.js} +24 -23
- package/dist/{emit-artifact-cmd-72V5FRE3.js → emit-artifact-cmd-26PJDTFU.js} +10 -10
- package/dist/{emit-criteria-cmd-HIE6JLCO.js → emit-criteria-cmd-6YTFXO3L.js} +7 -7
- package/dist/{emit-demo-cmd-JL4MAXVC.js → emit-demo-cmd-OQ7UDDRG.js} +11 -11
- package/dist/{emit-finding-cmd-3HZBWWP7.js → emit-finding-cmd-NO3FSRHT.js} +7 -7
- package/dist/{emit-result-cmd-YIPXXWII.js → emit-result-cmd-7MSUTXG6.js} +9 -9
- package/dist/{emit-step-cmd-QQYPX7EF.js → emit-step-cmd-7PFO7XVA.js} +7 -7
- package/dist/{find-unit-L6IH3X2U.js → find-unit-3MED6CPQ.js} +8 -8
- package/dist/{findings-cmd-CPNMM5CJ.js → findings-cmd-SWAPQUFT.js} +7 -7
- package/dist/{fleet-readiness-ZQOFJZ5B.js → fleet-readiness-5RMWZH4V.js} +4 -4
- package/dist/{governing-source-AXTXU5ZB.js → governing-source-INXQEK24.js} +9 -9
- package/dist/{hook-fast-OPHM3MRK.js → hook-fast-2KVZZRJN.js} +1 -1
- package/dist/{host-checks-PDTWZ637.js → host-checks-RCWXCCW2.js} +25 -24
- package/dist/{pending-2VIIFAP4.js → host-key-O4DFMOSV.js} +2 -2
- package/dist/{image-tag-JWATDMIZ.js → image-tag-WBD57QBN.js} +2 -2
- package/dist/index.js +4 -4
- package/dist/{init-Y5A6PZDX.js → init-52F2M54W.js} +20 -19
- package/dist/{init-EUQHMZQX.js → init-U5XUDKE7.js} +20 -19
- package/dist/{init-cmd-HLBC4DOD.js → init-cmd-WYLANAD5.js} +10 -10
- package/dist/{init-update-GFXITSTA.js → init-update-Z2T5J3Z2.js} +9 -9
- package/dist/{install-cmd-ZEFBJH24.js → install-cmd-JKPXIOEY.js} +4 -4
- package/dist/{logs-3YRC7HRA.js → logs-FEITSC2V.js} +1 -1
- package/dist/{loop-GR24EEVA.js → loop-WJBFH6XU.js} +34 -33
- package/dist/{machine-B333YLJH.js → machine-KUUTBDAT.js} +20 -19
- package/dist/{mcp-serve-cmd-PKXIHUOX.js → mcp-serve-cmd-ZINYSLY6.js} +3 -3
- package/dist/{paths-7PC3K7C3.js → paths-XEYE7OZ2.js} +1 -1
- package/dist/{host-key-Q5DEAP3Q.js → pending-D2NNV54J.js} +2 -2
- package/dist/{pidfile-KQ2EJABZ.js → pidfile-FLFVRKVW.js} +2 -2
- package/dist/receive-files-5MBUXAE5.js +6 -0
- package/dist/{record-IHEF6C33.js → record-JMZOXD4R.js} +2 -2
- package/dist/{runner-env-KGX7NFHP.js → runner-env-2NVOHTRC.js} +8 -8
- package/dist/{runner-identity-UOKEHVQQ.js → runner-identity-T6YPTHOH.js} +4 -4
- package/dist/{runner-key-QR6OQ7YJ.js → runner-key-WPQGF2L7.js} +20 -19
- package/dist/{session-sender-5DTNDRJY.js → session-sender-ADHV7WZ6.js} +10 -10
- package/dist/{spec-cmd-PUZD5BBF.js → spec-cmd-OUEKA6X3.js} +8 -8
- package/dist/{state-FJPSFOID.js → state-UWIM42JH.js} +2 -2
- package/dist/{status-5KWZOEOI.js → status-2JRATV66.js} +25 -24
- package/dist/{sync-cmd-45QEXKDM.js → sync-cmd-IEPWMYWY.js} +9 -9
- package/dist/{update-steps-EP5LFXAG.js → update-steps-3SRL32IV.js} +26 -25
- package/dist/{watch-L5MUTCM2.js → watch-3K3IB443.js} +9 -9
- package/dist/{work-claim-cmd-GJ2LSVOI.js → work-claim-cmd-5ACB2ZWP.js} +13 -13
- package/dist/{work-cmd-DGRY7K5A.js → work-cmd-B6HZW26B.js} +7 -7
- package/dist/{work-comment-cmd-CLHJKFBW.js → work-comment-cmd-MBGBBR7V.js} +8 -8
- package/dist/{work-demo-cmd-6BM56RVQ.js → work-demo-cmd-RLOS55MP.js} +7 -7
- package/dist/{work-logs-cmd-GXCMJFFO.js → work-logs-cmd-VUICWCEO.js} +7 -7
- package/dist/{work-open-pr-cmd-IGUKSZGC.js → work-open-pr-cmd-CYXICEJE.js} +8 -8
- package/dist/{work-pr-cmd-BQBQORGW.js → work-pr-cmd-3HSFJO65.js} +7 -7
- package/dist/{work-proofs-cmd-PVNHUJPC.js → work-proofs-cmd-NJ4YYQ2V.js} +8 -8
- package/dist/{work-proofs-record-BYRHHFK2.js → work-proofs-record-NN7XB2QC.js} +14 -14
- package/dist/{work-stop-cmd-EEETWUSK.js → work-stop-cmd-QXZSZLEY.js} +7 -7
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-amend/SKILL.md +18 -16
- package/skill-pack/maintained/outerlayer-amend/references/check-items.md +34 -0
- package/skill-pack/maintained/outerlayer-amend/references/earlier-run.md +18 -0
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { sha256OfFile, downloadPinned, VoiceDownloadError } from './chunk-2PGI6RDE.js';
|
|
4
|
-
import {
|
|
4
|
+
import { hasStoredCredential, AGENT_COMMANDS, storeClaudeCredential, credentialFromStdin, isAgentName } from './chunk-G2HRULTO.js';
|
|
5
|
+
import { receiveFiles } from './chunk-NN33FYXG.js';
|
|
6
|
+
import { readDefaultBranchFiles, readDefaultBranchHead, cloneRepository, buildRepositoryImage, prepareImageBuild, KEY_PREFIX, TAG_HOST, SHARED_OWNER, SHARED_NAME, universalBase, metadataFromLabels, writeRecord } from './chunk-VQCUADLI.js';
|
|
5
7
|
import { FETCHED_DIR, toolsDockerfile, FETCHED_FFMPEG, FETCHED_GH, FETCHED_TINI, FETCHED_HEADLESS_SHELL, FETCHED_PLAYWRIGHT_FFMPEG, FETCHED_VOICE_DIR } from './chunk-H3MLZ4EA.js';
|
|
6
8
|
import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
|
|
7
9
|
import { currentCliBuild } from './chunk-OGFGZQA3.js';
|
|
8
10
|
import { runExec, execCapture, waitForAgent } from './chunk-4PH4DVV4.js';
|
|
9
11
|
import { GUEST_CID, linkVsockSockets } from './chunk-UZGQT6OF.js';
|
|
10
|
-
import {
|
|
11
|
-
import { runnerImageVersion } from './chunk-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { parseSize, NETWORK_HELPER_MEMORY, createDockerHost, builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, networkHelperName, containerRunArgs, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, mountableHome, homeCopyRunArgs, containerExecArgs, childEnvironment, readDu, JUDGE_DIR, MAX_ITEMS_BYTES, JUDGE_ITEMS, MAX_REPORT_BYTES, JUDGE_REPORT, NETWORK_READY_FILE, spawnRun, identityRunArgs, parseIdentity, networkHelperRunArgs, SAVED_STATE_LABEL } from './chunk-LNFQ5NOF.js';
|
|
12
|
+
import { describeCallFailure, shortClaim, retrySend, formatDuration, keepStagedContext, controlPlaneTokenFailure, refusalCode, resolveGoverningSource, prefetchGovernedContext, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, shimScript, WORKFLOW_PERMISSION_REASON } from './chunk-OS73XDJ7.js';
|
|
13
|
+
import { runnerImageVersion } from './chunk-ALEUIS35.js';
|
|
14
|
+
import { claimCalls } from './chunk-P24VR4H3.js';
|
|
15
|
+
import { optionalEgress, runnerCredentialProblem, builtinKind, keyRunnerFactory, DEFAULT_SETUP_MINUTES, allowHostProblem, DEFAULT_SAVED_STATE_MAX_BYTES, systemClock, emptyEgressCounts, hostAllowed } from './chunk-RKDOKIIK.js';
|
|
16
|
+
import { DEFAULT_BUILD_DISK, formatBytes, allocatedBytes } from './chunk-EK2FNOCD.js';
|
|
17
|
+
import { parseSize, NETWORK_HELPER_MEMORY, createDockerHost, builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, networkHelperName, containerRunArgs, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, mountableHome, homeCopyRunArgs, containerExecArgs, childEnvironment, readDu, JUDGE_DIR, MAX_ITEMS_BYTES, JUDGE_ITEMS, MAX_REPORT_BYTES, JUDGE_REPORT, NETWORK_READY_FILE, spawnRun, identityRunArgs, parseIdentity, networkHelperRunArgs, SAVED_STATE_LABEL } from './chunk-DOYLWBJJ.js';
|
|
17
18
|
import { RecipeError, DOCKER_FEATURE, universalImagePending, writeSanitizedRecipe, classifyProperties } from './chunk-TV5ITSVY.js';
|
|
18
19
|
import { firecrackerArch, MICROVM_ARCHES, FIRECRACKER_VERSION, hostHelperPinned, CLAUDE_CODE_VERSION, builderDiskPinned, guestAssetsPinned, GUEST_HELPER_SHA256, GUEST_ASSETS_BASE_URL, GUEST_KERNEL_SHA256, JAILER_BINARY_SHA256, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, GUEST_ASSETS_VERSION, BUILDER_DISK_VERSION, networkHelperPinned, NETWORK_HELPER_SHA256, universalImagePinned, UNIVERSAL_IMAGE, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, GH_VERSION, TINI_SHA256, TINI_VERSION, HEADLESS_SHELL, HEADLESS_SHELL_BASE_URL, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_FFMPEG_BASE_URL, VOICE_PACK_FILES, BUILDER_DISK_SHA256, BUILDER_DISK_BASE_URL, DEFAULT_BASE_IMAGE } from './chunk-7SO2VHTQ.js';
|
|
19
|
-
import { postJson, WorkCommandError, getJson } from './chunk-
|
|
20
|
+
import { postJson, WorkCommandError, getJson } from './chunk-FKLGX72N.js';
|
|
20
21
|
import { sanitizeTerminal } from './chunk-XSX42Q2H.js';
|
|
21
|
-
import { signerFor } from './chunk-
|
|
22
|
+
import { signerFor } from './chunk-4DJZSNVT.js';
|
|
22
23
|
import { sharedSkillNames, skillConflictMessage } from './chunk-FGF52V4V.js';
|
|
23
24
|
import { versionAtLeast, MINIMUM_CLAUDE_VERSION } from './chunk-HCVLP7XA.js';
|
|
24
|
-
import { MIN_SCRUBBED_LITERAL, setCustomScrubbers, setLocalIdentity, setRepoRoot, parseTranscript, scrubDeep, scrubText } from './chunk-
|
|
25
|
+
import { MIN_SCRUBBED_LITERAL, setCustomScrubbers, setLocalIdentity, setRepoRoot, forkFor, parseTranscript, scrubDeep, scrubText } from './chunk-DH6BDQM4.js';
|
|
25
26
|
import { orderSessions, extractFacts, sessionsToTimeline } from './chunk-2PMJ7TQR.js';
|
|
26
27
|
import { downconvertSession } from './chunk-N2XW4NYY.js';
|
|
27
|
-
import { vmAssetsDir, RUNNER_DIR_MODE, rootfsPathFor, diskTemplatesDir, RUNNER_FILE_MODE, buildsDir, buildDir, runnerDir, deliveryDir, ghConfigDir, orgStoreIn, runnerDirOfBuild, spoolDir, mirrorDir, SHIM_DIR, vsockPath, builderCacheDiskPath, builderConsolePath } from './chunk-
|
|
28
|
-
import { claudeCredential, parseIsolation, proxyEnvironment, withProxyWarningHidden, containerLocalAddress, destinationEnvironment, CLAUDE_CREDENTIAL_VARIABLES, builtInEnvironment, withHooksPath, startBuildServices, BUILT_IN_NAMES, checkoutPath, repositoriesOf, primaryOf, RELAY_PORT, repositoryPath,
|
|
28
|
+
import { sessionsDir, vmAssetsDir, RUNNER_DIR_MODE, rootfsPathFor, diskTemplatesDir, RUNNER_FILE_MODE, buildsDir, buildDir, runnerDir, deliveryDir, ghConfigDir, orgStoreIn, runnerDirOfBuild, spoolDir, mirrorDir, SHIM_DIR, vsockPath, builderCacheDiskPath, builderConsolePath } from './chunk-WT7J2627.js';
|
|
29
|
+
import { CHECKOUT_DIR, claudeCredential, parseIsolation, proxyEnvironment, withProxyWarningHidden, containerLocalAddress, destinationEnvironment, CLAUDE_CREDENTIAL_VARIABLES, builtInEnvironment, withHooksPath, startBuildServices, BUILT_IN_NAMES, checkoutPath, repositoriesOf, primaryOf, RELAY_PORT, repositoryPath, lifecycleWorkdir, buildEnvironment, checkEnvironment, withMiseVariables, isMiseVariableAllowed, JOB_MOUNT, realFdStorePort, AGENT_CREDENTIAL_MISSING } from './chunk-GANAOCHR.js';
|
|
29
30
|
import { RELAY_USER, RELAY_ID, UNKNOWN_TRANSPORT_REASON, DOCKER_DESKTOP_REASON, MAX_MALFORMED_SESSIONS, MALFORMED_REASON, JOIN_WAIT_MS, MAX_OPEN_STREAMS, STREAM_RESET_RATE, STREAM_RESET_BURST, STREAM_WINDOW, SESSION_WINDOW, targetOfPath } from './chunk-MESOOLF4.js';
|
|
30
31
|
import { spawn, spawnSync } from 'child_process';
|
|
31
|
-
import { mkdirSync, existsSync, readFileSync, mkdtempSync,
|
|
32
|
-
import { randomBytes, createHash } from 'crypto';
|
|
33
|
-
import { join, dirname, isAbsolute, relative, resolve
|
|
32
|
+
import { mkdirSync, lstatSync, writeFileSync, renameSync, rmSync, openSync, writeSync, closeSync, existsSync, readFileSync, mkdtempSync, chmodSync, truncateSync, statSync, accessSync, constants, readdirSync, copyFileSync, createReadStream, rmdirSync, unlinkSync, linkSync, cpSync, appendFileSync, createWriteStream } from 'fs';
|
|
33
|
+
import { randomBytes, randomUUID, createHash } from 'crypto';
|
|
34
|
+
import { join, dirname, basename, isAbsolute, relative, resolve } from 'path';
|
|
35
|
+
import { Readable, Transform, Duplex, PassThrough } from 'stream';
|
|
34
36
|
import { createConnection, connect, createServer as createServer$1, isIP } from 'net';
|
|
35
37
|
import { availableParallelism, networkInterfaces, tmpdir } from 'os';
|
|
36
|
-
import { Transform, Duplex, PassThrough } from 'stream';
|
|
37
38
|
import { createServer, request } from 'http';
|
|
38
39
|
import { lookup } from 'dns/promises';
|
|
39
40
|
import http2 from 'http2';
|
|
@@ -53,6 +54,245 @@ function itemTag(job) {
|
|
|
53
54
|
const scope = itemScope(job);
|
|
54
55
|
return scope === void 0 ? `#${job.item}` : `#${job.item}@${scope}`;
|
|
55
56
|
}
|
|
57
|
+
var RESUME_DIR = "/build/home/.outerlayer/resume";
|
|
58
|
+
var SESSION_PROJECT_DIR = `/build/home/.claude/projects/${CHECKOUT_DIR.replace(/[^A-Za-z0-9]/g, "-")}`;
|
|
59
|
+
var META_FILE = "meta.json";
|
|
60
|
+
var SESSION_ID_VARIABLE = "OUTERLAYER_SESSION_ID";
|
|
61
|
+
var RESUME_SESSION_VARIABLE = "OUTERLAYER_RESUME_SESSION";
|
|
62
|
+
var WORK_ITEM_ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
63
|
+
var SESSION_ID = /^[A-Za-z0-9-]{1,64}$/;
|
|
64
|
+
var REASON_TEXT = {
|
|
65
|
+
no_saved_session: "no session is saved on this host",
|
|
66
|
+
session_not_loaded: "the saved session could not be loaded",
|
|
67
|
+
build_type_cannot_resume: "this build type cannot resume"
|
|
68
|
+
};
|
|
69
|
+
function keptSessionDir(configPath, organizationId, workItemId) {
|
|
70
|
+
if (!WORK_ITEM_ID.test(workItemId)) throw new Error(`cannot keep a session for the work item ${JSON.stringify(workItemId)}`);
|
|
71
|
+
return join(sessionsDir(configPath, organizationId), workItemId);
|
|
72
|
+
}
|
|
73
|
+
async function keepSession(input) {
|
|
74
|
+
const { dir, meta } = input;
|
|
75
|
+
if (!SESSION_ID.test(meta.sessionId)) throw new Error(`cannot keep the session ${JSON.stringify(meta.sessionId)}`);
|
|
76
|
+
const parent = dirname(dir);
|
|
77
|
+
mkdirSync(parent, { recursive: true, mode: 448 });
|
|
78
|
+
const tag = randomBytes(4).toString("hex");
|
|
79
|
+
const incoming = join(parent, `.${basename(dir)}.${tag}.partial`);
|
|
80
|
+
const outgoing = join(parent, `.${basename(dir)}.${tag}.old`);
|
|
81
|
+
try {
|
|
82
|
+
await receiveFiles(input.tar, { into: incoming, roots: [parent] });
|
|
83
|
+
let transcript;
|
|
84
|
+
try {
|
|
85
|
+
transcript = lstatSync(join(incoming, `${meta.sessionId}.jsonl`));
|
|
86
|
+
} catch {
|
|
87
|
+
transcript = void 0;
|
|
88
|
+
}
|
|
89
|
+
if (transcript === void 0 || !transcript.isFile()) throw new Error(`the stream holds no transcript of session ${meta.sessionId}`);
|
|
90
|
+
writeFileSync(join(incoming, META_FILE), JSON.stringify(meta), { mode: 384 });
|
|
91
|
+
let hadOlder = true;
|
|
92
|
+
try {
|
|
93
|
+
renameSync(dir, outgoing);
|
|
94
|
+
} catch (err) {
|
|
95
|
+
if (err.code !== "ENOENT") throw err;
|
|
96
|
+
hadOlder = false;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
renameSync(incoming, dir);
|
|
100
|
+
} catch (err) {
|
|
101
|
+
if (hadOlder) renameSync(outgoing, dir);
|
|
102
|
+
throw err;
|
|
103
|
+
}
|
|
104
|
+
rmSync(outgoing, { recursive: true, force: true });
|
|
105
|
+
} finally {
|
|
106
|
+
rmSync(incoming, { recursive: true, force: true });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function readKeptSession(dir) {
|
|
110
|
+
let parsed;
|
|
111
|
+
try {
|
|
112
|
+
parsed = JSON.parse(readFileSync(join(dir, META_FILE), "utf8"));
|
|
113
|
+
} catch {
|
|
114
|
+
return void 0;
|
|
115
|
+
}
|
|
116
|
+
if (typeof parsed.sessionId !== "string" || !SESSION_ID.test(parsed.sessionId) || typeof parsed.claimId !== "string" || typeof parsed.queue !== "string" || typeof parsed.keptAt !== "string") return void 0;
|
|
117
|
+
const transcript = join(dir, `${parsed.sessionId}.jsonl`);
|
|
118
|
+
try {
|
|
119
|
+
if (!statSync(transcript).isFile()) return void 0;
|
|
120
|
+
} catch {
|
|
121
|
+
return void 0;
|
|
122
|
+
}
|
|
123
|
+
return { meta: { sessionId: parsed.sessionId, claimId: parsed.claimId, queue: parsed.queue, keptAt: parsed.keptAt }, transcript };
|
|
124
|
+
}
|
|
125
|
+
var BLOCK = 512;
|
|
126
|
+
function tarHeader(path, size, type, mtimeMs) {
|
|
127
|
+
let name = path;
|
|
128
|
+
let prefix = "";
|
|
129
|
+
if (Buffer.byteLength(name) > 100) {
|
|
130
|
+
const cut = [...name.matchAll(/\//g)].map((m) => m.index).find((at) => Buffer.byteLength(name.slice(at + 1)) <= 100 && Buffer.byteLength(name.slice(0, at)) <= 155);
|
|
131
|
+
if (cut === void 0) return void 0;
|
|
132
|
+
prefix = name.slice(0, cut);
|
|
133
|
+
name = name.slice(cut + 1);
|
|
134
|
+
}
|
|
135
|
+
const block = Buffer.alloc(BLOCK);
|
|
136
|
+
block.write(name, 0, 100, "utf8");
|
|
137
|
+
block.write(type === "5" ? "0000755\0" : "0000644\0", 100, 8, "ascii");
|
|
138
|
+
block.write("0000000\0", 108, 8, "ascii");
|
|
139
|
+
block.write("0000000\0", 116, 8, "ascii");
|
|
140
|
+
block.write(`${size.toString(8).padStart(11, "0")}\0`, 124, 12, "ascii");
|
|
141
|
+
block.write(`${Math.floor(mtimeMs / 1e3).toString(8).padStart(11, "0")}\0`, 136, 12, "ascii");
|
|
142
|
+
block.write(" ", 148, 8, "ascii");
|
|
143
|
+
block.write(type, 156, 1, "ascii");
|
|
144
|
+
block.write("ustar\0", 257, 6, "ascii");
|
|
145
|
+
block.write("00", 263, 2, "ascii");
|
|
146
|
+
block.write(prefix, 345, 155, "utf8");
|
|
147
|
+
let sum = 0;
|
|
148
|
+
for (const byte of block) sum += byte;
|
|
149
|
+
block.write(`${sum.toString(8).padStart(6, "0")}\0 `, 148, 8, "ascii");
|
|
150
|
+
return block;
|
|
151
|
+
}
|
|
152
|
+
function filesUnder(root, relative2) {
|
|
153
|
+
const stat = lstatSync(join(root, relative2));
|
|
154
|
+
if (stat.isDirectory()) {
|
|
155
|
+
const own = { path: `${relative2}/`, type: "5", size: 0, mtimeMs: stat.mtimeMs };
|
|
156
|
+
return [own, ...readdirSync(join(root, relative2)).sort().flatMap((name) => filesUnder(root, `${relative2}/${name}`))];
|
|
157
|
+
}
|
|
158
|
+
return stat.isFile() ? [{ path: relative2, type: "0", size: stat.size, mtimeMs: stat.mtimeMs }] : [];
|
|
159
|
+
}
|
|
160
|
+
function packKeptSession(dir, meta) {
|
|
161
|
+
const names = [`${meta.sessionId}.jsonl`, meta.sessionId];
|
|
162
|
+
async function* pack() {
|
|
163
|
+
for (const name of names) {
|
|
164
|
+
let entries;
|
|
165
|
+
try {
|
|
166
|
+
entries = filesUnder(dir, name);
|
|
167
|
+
} catch {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
for (const entry of entries) {
|
|
171
|
+
const header = tarHeader(entry.path, entry.size, entry.type, entry.mtimeMs);
|
|
172
|
+
if (header === void 0) continue;
|
|
173
|
+
yield header;
|
|
174
|
+
if (entry.type === "0") {
|
|
175
|
+
let sent = 0;
|
|
176
|
+
for await (const chunk of createReadStream(join(dir, entry.path.replace(/\/$/, "")))) {
|
|
177
|
+
sent += chunk.length;
|
|
178
|
+
yield chunk;
|
|
179
|
+
}
|
|
180
|
+
if (sent !== entry.size) throw new Error(`${entry.path} changed while it was packed`);
|
|
181
|
+
const padding = (BLOCK - entry.size % BLOCK) % BLOCK;
|
|
182
|
+
if (padding > 0) yield Buffer.alloc(padding);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
yield Buffer.alloc(BLOCK * 2);
|
|
187
|
+
}
|
|
188
|
+
return Readable.from(pack());
|
|
189
|
+
}
|
|
190
|
+
function resumeDecision(input) {
|
|
191
|
+
if (input.queue !== "amend") return void 0;
|
|
192
|
+
if (!input.builtin) return { resumed: false, reason: "build_type_cannot_resume" };
|
|
193
|
+
if (input.kept === void 0) return { resumed: false, reason: "no_saved_session" };
|
|
194
|
+
return { resumed: true, fromSessionId: input.kept.sessionId, fromClaimId: input.kept.claimId };
|
|
195
|
+
}
|
|
196
|
+
async function prepareResume(input) {
|
|
197
|
+
const sessionId = (input.newSessionId ?? randomUUID)();
|
|
198
|
+
const fresh = (resume) => ({ sessionId, resume, env: { [SESSION_ID_VARIABLE]: sessionId } });
|
|
199
|
+
if (input.queue !== "amend") return fresh(void 0);
|
|
200
|
+
const dir = keptSessionDir(input.configPath, input.organizationId, input.workItemId);
|
|
201
|
+
const kept = readKeptSession(dir);
|
|
202
|
+
const decision = resumeDecision({ queue: input.queue, builtin: input.builtin, kept: kept?.meta });
|
|
203
|
+
if (!decision.resumed) {
|
|
204
|
+
input.log(`agent job starts fresh because ${REASON_TEXT[decision.reason]}`);
|
|
205
|
+
return fresh(decision);
|
|
206
|
+
}
|
|
207
|
+
const meta = kept.meta;
|
|
208
|
+
try {
|
|
209
|
+
await input.restore({ dir, meta });
|
|
210
|
+
} catch (err) {
|
|
211
|
+
input.log(`agent job starts fresh because ${REASON_TEXT.session_not_loaded}: ${describeCallFailure(err)}`);
|
|
212
|
+
return fresh({ resumed: false, reason: "session_not_loaded" });
|
|
213
|
+
}
|
|
214
|
+
input.log(`agent job continues session ${meta.sessionId.slice(0, 8)} of claim ${shortClaim(meta.claimId)}`);
|
|
215
|
+
return { sessionId, resume: decision, env: { [SESSION_ID_VARIABLE]: sessionId, [RESUME_SESSION_VARIABLE]: `${RESUME_DIR}/${meta.sessionId}.jsonl` } };
|
|
216
|
+
}
|
|
217
|
+
var COPY_OUT_SCRIPT = 'cd "$1" 2>/dev/null && [ -f "$2.jsonl" ] || exit 3; if [ -d "$2" ]; then exec tar -cf - "$2.jsonl" "$2"; else exec tar -cf - "$2.jsonl"; fi';
|
|
218
|
+
var SESSION_COPY_MS = 15 * 6e4;
|
|
219
|
+
var MAX_SESSION_COPY_BYTES = 512 * 1024 * 1024;
|
|
220
|
+
async function copyOutSession(input) {
|
|
221
|
+
if (!SESSION_ID.test(input.sessionId)) return { ok: false, reason: `${JSON.stringify(input.sessionId)} is not a session id` };
|
|
222
|
+
let fd;
|
|
223
|
+
let stderr = "";
|
|
224
|
+
try {
|
|
225
|
+
mkdirSync(dirname(input.tarPath), { recursive: true, mode: 448 });
|
|
226
|
+
fd = openSync(input.tarPath, "w", 384);
|
|
227
|
+
const out = fd;
|
|
228
|
+
const maxBytes = input.maxBytes ?? MAX_SESSION_COPY_BYTES;
|
|
229
|
+
const stop = new AbortController();
|
|
230
|
+
let written = 0;
|
|
231
|
+
let overCap = false;
|
|
232
|
+
const result = await input.guest.stream(["/bin/sh", "-c", COPY_OUT_SCRIPT, "sh", SESSION_PROJECT_DIR, input.sessionId], {
|
|
233
|
+
onStdout: (chunk) => {
|
|
234
|
+
if (overCap) return;
|
|
235
|
+
if (written + chunk.length > maxBytes) {
|
|
236
|
+
overCap = true;
|
|
237
|
+
stop.abort();
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
written += chunk.length;
|
|
241
|
+
writeSync(out, chunk);
|
|
242
|
+
},
|
|
243
|
+
onStderr: (chunk) => void (stderr = (stderr + chunk.toString()).slice(-400)),
|
|
244
|
+
signal: AbortSignal.any([stop.signal, AbortSignal.timeout(SESSION_COPY_MS)])
|
|
245
|
+
});
|
|
246
|
+
if (overCap) return { ok: false, reason: `the session is larger than the ${Math.floor(maxBytes / (1024 * 1024))} MiB the runner keeps` };
|
|
247
|
+
if (result.status === 3) return { ok: false, reason: "the build wrote no transcript of its session" };
|
|
248
|
+
if (result.status !== 0) return { ok: false, reason: `tar exited ${result.status}${stderr.trim() === "" ? "" : `: ${stderr.trim().split("\n").at(-1)}`}` };
|
|
249
|
+
return { ok: true };
|
|
250
|
+
} catch (err) {
|
|
251
|
+
return { ok: false, reason: describeCallFailure(err) };
|
|
252
|
+
} finally {
|
|
253
|
+
if (fd !== void 0) closeSync(fd);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
async function readResumeRecords(guest) {
|
|
257
|
+
let unread2;
|
|
258
|
+
let failed = false;
|
|
259
|
+
let launchedAt;
|
|
260
|
+
let timer;
|
|
261
|
+
const timedOut = new Promise((_, reject) => {
|
|
262
|
+
timer = setTimeout(() => reject(new Error(`the guest did not answer within ${SESSION_COPY_MS / 6e4} minutes`)), SESSION_COPY_MS);
|
|
263
|
+
});
|
|
264
|
+
try {
|
|
265
|
+
await Promise.race([
|
|
266
|
+
(async () => {
|
|
267
|
+
failed = (await guest.run(["test", "-e", `${RESUME_DIR}/failed`])).status === 0;
|
|
268
|
+
const launch = await guest.run(["cat", `${RESUME_DIR}/launch.json`]);
|
|
269
|
+
if (launch.status === 0) {
|
|
270
|
+
const at = JSON.parse(launch.stdout).launchedAt;
|
|
271
|
+
if (typeof at === "string" && Number.isFinite(Date.parse(at))) launchedAt = at;
|
|
272
|
+
}
|
|
273
|
+
})(),
|
|
274
|
+
timedOut
|
|
275
|
+
]);
|
|
276
|
+
} catch (err) {
|
|
277
|
+
unread2 = describeCallFailure(err);
|
|
278
|
+
} finally {
|
|
279
|
+
clearTimeout(timer);
|
|
280
|
+
}
|
|
281
|
+
return { failed, ...launchedAt === void 0 ? {} : { launchedAt }, ...unread2 === void 0 ? {} : { unread: unread2 } };
|
|
282
|
+
}
|
|
283
|
+
async function restoreSession(input) {
|
|
284
|
+
let stderr = "";
|
|
285
|
+
try {
|
|
286
|
+
const result = await input.guest.stream(["/bin/sh", "-c", `mkdir -p ${RESUME_DIR} && tar -x -C ${RESUME_DIR}`], {
|
|
287
|
+
stdin: input.tar,
|
|
288
|
+
onStderr: (chunk) => void (stderr = (stderr + chunk.toString()).slice(-400)),
|
|
289
|
+
signal: AbortSignal.timeout(SESSION_COPY_MS)
|
|
290
|
+
});
|
|
291
|
+
return result.status === 0 ? { ok: true } : { ok: false, reason: `tar exited ${result.status}${stderr.trim() === "" ? "" : `: ${stderr.trim().split("\n").at(-1)}`}` };
|
|
292
|
+
} catch (err) {
|
|
293
|
+
return { ok: false, reason: describeCallFailure(err) };
|
|
294
|
+
}
|
|
295
|
+
}
|
|
56
296
|
|
|
57
297
|
// src/runner/managed-claude-key.ts
|
|
58
298
|
var FETCH_RETRY_WINDOW_MS = 3e4;
|
|
@@ -3947,6 +4187,9 @@ function sessionOptionsOf(path) {
|
|
|
3947
4187
|
...segments[at + 1] === "workflows" && segments[at + 2] ? { workflowRunId: segments[at + 2] } : {}
|
|
3948
4188
|
};
|
|
3949
4189
|
}
|
|
4190
|
+
function forkRecordOf(job) {
|
|
4191
|
+
return job.sessionId !== void 0 && job.sessionLaunchedAt !== void 0 ? { sessionId: job.sessionId, launchedAt: job.sessionLaunchedAt } : void 0;
|
|
4192
|
+
}
|
|
3950
4193
|
function scrubbing(scrub, author, work) {
|
|
3951
4194
|
setCustomScrubbers(scrub, () => void 0);
|
|
3952
4195
|
setLocalIdentity({ home: BUILD_HOME, ...author?.name === void 0 ? {} : { name: author.name }, ...author?.email === void 0 ? {} : { email: author.email } });
|
|
@@ -4017,6 +4260,8 @@ async function writeEvalInput(request) {
|
|
|
4017
4260
|
scrubbing(request.scrub, request.job.commitIdentity?.author, () => {
|
|
4018
4261
|
for (const transcript of copied) {
|
|
4019
4262
|
const options = sessionOptionsOf(transcript.path);
|
|
4263
|
+
const fork = forkFor(forkRecordOf(request.job), { sessionId: options.fallbackId ?? "", parentSessionId: options.parentSessionId });
|
|
4264
|
+
if (fork !== void 0) options.fork = fork;
|
|
4020
4265
|
const subagent = options.isSubagent === true;
|
|
4021
4266
|
const stem = options.fallbackId ?? transcript.path;
|
|
4022
4267
|
let session = null;
|
|
@@ -4368,7 +4613,7 @@ function writeGhConfig(dir, token) {
|
|
|
4368
4613
|
}
|
|
4369
4614
|
var DeliveryFailure = class extends Error {
|
|
4370
4615
|
};
|
|
4371
|
-
var
|
|
4616
|
+
var BLOCK2 = 512;
|
|
4372
4617
|
var DELIVERY_TIMEOUT_MS = 5 * 6e4;
|
|
4373
4618
|
var RECEIVE_ARGV = ["/opt/outerlayer/bin/node", "/opt/outerlayer/cli/dist/index.js", "receive-files"];
|
|
4374
4619
|
var REASON_LINE_MAX = 240;
|
|
@@ -4384,8 +4629,8 @@ function field(header, at, length, text) {
|
|
|
4384
4629
|
function octalField(header, at, length, value) {
|
|
4385
4630
|
field(header, at, length, `${value.toString(8).padStart(length - 1, "0")}\0`);
|
|
4386
4631
|
}
|
|
4387
|
-
function
|
|
4388
|
-
const header = Buffer.alloc(
|
|
4632
|
+
function tarHeader2(name, type, mode, size) {
|
|
4633
|
+
const header = Buffer.alloc(BLOCK2);
|
|
4389
4634
|
header.write(name, 0, 100, "utf8");
|
|
4390
4635
|
octalField(header, 100, 8, mode);
|
|
4391
4636
|
octalField(header, 108, 8, 0);
|
|
@@ -4402,8 +4647,8 @@ function tarHeader(name, type, mode, size) {
|
|
|
4402
4647
|
return header;
|
|
4403
4648
|
}
|
|
4404
4649
|
function padded(data) {
|
|
4405
|
-
const rest = data.length %
|
|
4406
|
-
return rest === 0 ? data : Buffer.concat([data, Buffer.alloc(
|
|
4650
|
+
const rest = data.length % BLOCK2;
|
|
4651
|
+
return rest === 0 ? data : Buffer.concat([data, Buffer.alloc(BLOCK2 - rest)]);
|
|
4407
4652
|
}
|
|
4408
4653
|
function paxRecord(key, value) {
|
|
4409
4654
|
const body = Buffer.from(` ${key}=${value}
|
|
@@ -4419,11 +4664,11 @@ function packTar(entries) {
|
|
|
4419
4664
|
const name = entry.type === "dir" && !entry.path.endsWith("/") ? `${entry.path}/` : entry.path;
|
|
4420
4665
|
if (Buffer.byteLength(name, "utf8") > 100) {
|
|
4421
4666
|
const record = paxRecord("path", name);
|
|
4422
|
-
blocks.push(
|
|
4667
|
+
blocks.push(tarHeader2("PaxHeader", "x", 420, record.length), padded(record));
|
|
4423
4668
|
}
|
|
4424
|
-
blocks.push(
|
|
4669
|
+
blocks.push(tarHeader2(name, entry.type === "dir" ? "5" : "0", entry.mode, data.length), padded(data));
|
|
4425
4670
|
}
|
|
4426
|
-
blocks.push(Buffer.alloc(
|
|
4671
|
+
blocks.push(Buffer.alloc(BLOCK2 * 2));
|
|
4427
4672
|
return Buffer.concat(blocks);
|
|
4428
4673
|
}
|
|
4429
4674
|
function fileMode(hostMode) {
|
|
@@ -5678,7 +5923,7 @@ function shellQuote(word) {
|
|
|
5678
5923
|
}
|
|
5679
5924
|
function containerCommandExec(input) {
|
|
5680
5925
|
const state = input.job.container;
|
|
5681
|
-
const
|
|
5926
|
+
const built = buildEnvironment({
|
|
5682
5927
|
config: claimCalls(input.config, input.job),
|
|
5683
5928
|
item: input.job.item,
|
|
5684
5929
|
itemKey: input.job.itemKey,
|
|
@@ -5693,6 +5938,7 @@ function containerCommandExec(input) {
|
|
|
5693
5938
|
builtIns: state.builtIns === true,
|
|
5694
5939
|
identity: input.job.commitIdentity
|
|
5695
5940
|
});
|
|
5941
|
+
const env = { ...built, literals: { ...built.literals, ...input.extraEnv } };
|
|
5696
5942
|
return {
|
|
5697
5943
|
container: state.container,
|
|
5698
5944
|
user: state.agentUser ?? ADDED_USER,
|
|
@@ -5883,6 +6129,48 @@ async function copyTranscriptsFromContainer(runtime, state) {
|
|
|
5883
6129
|
}
|
|
5884
6130
|
return copyTranscripts((argv) => runtime.host.exec({ container: state.container, user: state.agentUser ?? ADDED_USER, env: NO_ENV, argv }));
|
|
5885
6131
|
}
|
|
6132
|
+
async function ensureContainerRunning(runtime, state) {
|
|
6133
|
+
try {
|
|
6134
|
+
if (!state.stopped) return void 0;
|
|
6135
|
+
const network = await ensureNetworkReady(runtime, state);
|
|
6136
|
+
if (network !== void 0) return network;
|
|
6137
|
+
const started = await runtime.host.start(state.container);
|
|
6138
|
+
if (started.status !== 0) return `the build's container could not be started again (exit ${started.status})`;
|
|
6139
|
+
return void 0;
|
|
6140
|
+
} catch (err) {
|
|
6141
|
+
return describeCallFailure(err);
|
|
6142
|
+
}
|
|
6143
|
+
}
|
|
6144
|
+
function sessionGuestOfContainer(runtime, state) {
|
|
6145
|
+
const input = (argv) => ({ container: state.container, user: state.agentUser ?? ADDED_USER, env: NO_ENV, argv });
|
|
6146
|
+
return {
|
|
6147
|
+
run: (argv) => runtime.host.exec(input(argv)),
|
|
6148
|
+
stream: (argv, io) => new Promise((resolve2, reject) => {
|
|
6149
|
+
const process2 = runtime.host.execStream({ ...input(argv), interactive: true });
|
|
6150
|
+
process2.stdout.on("data", (chunk) => io.onStdout?.(chunk));
|
|
6151
|
+
io.signal?.addEventListener("abort", () => process2.kill(), { once: true });
|
|
6152
|
+
const stdin = io.stdin;
|
|
6153
|
+
if (stdin === void 0) process2.stdin.end();
|
|
6154
|
+
else if (typeof stdin === "string" || Buffer.isBuffer(stdin)) process2.stdin.end(stdin);
|
|
6155
|
+
else {
|
|
6156
|
+
stdin.on("error", (err) => {
|
|
6157
|
+
process2.kill();
|
|
6158
|
+
reject(err);
|
|
6159
|
+
});
|
|
6160
|
+
stdin.pipe(process2.stdin);
|
|
6161
|
+
}
|
|
6162
|
+
void process2.exited.then((status) => {
|
|
6163
|
+
const said2 = process2.stderrTail?.() ?? "";
|
|
6164
|
+
if (said2 !== "") io.onStderr?.(Buffer.from(said2));
|
|
6165
|
+
resolve2({ status });
|
|
6166
|
+
}, reject);
|
|
6167
|
+
})
|
|
6168
|
+
};
|
|
6169
|
+
}
|
|
6170
|
+
async function restoreSessionIntoContainer(runtime, state, keptDir, meta) {
|
|
6171
|
+
const restored = await restoreSession({ guest: sessionGuestOfContainer(runtime, state), tar: packKeptSession(keptDir, meta) });
|
|
6172
|
+
if (!restored.ok) throw new Error(restored.reason);
|
|
6173
|
+
}
|
|
5886
6174
|
var HOOK_ERRORS_IN_CONTAINER = "/build/home/.outerlayer/spool/hook-errors.log";
|
|
5887
6175
|
async function copyHookErrors(runtime, state, jobDir) {
|
|
5888
6176
|
try {
|
|
@@ -6247,4 +6535,4 @@ function describeMachineDocker(machine) {
|
|
|
6247
6535
|
return `Docker Engine ${version ?? "of no known version"}, older than the ${MIN_ENGINE_MAJOR} that container builds need`;
|
|
6248
6536
|
}
|
|
6249
6537
|
|
|
6250
|
-
export { ADDED_USER, ADOPTED_FETCH_RETRY_WINDOW_MS, AgentUserError, AssetError, DeliveryFailure, EVAL_INPUT_NAME, GH_CONFIG_YML, HELPER_ENV, LEASE_SECONDS, MANAGED_UNJAILED_REASON, MIN_ENGINE_MAJOR, PLACEHOLDER_MARKER, PROOFS_LOG, RECORD_PROOFS_ARGV, ROOT_DISK_ID_PREFIX, RunnerInitError, agentUidOf, attemptNote, claimPermissionProblem, claudeCredentialCheck, cleanupContainer, clockOf, closeHostBuild, containerCommandExec, containerJudgeEnvironment, containerSenderCommand, copyJudgeTree, copyTranscripts, copyTranscriptsFromContainer, createBuildDisk, createContainerRuntime, createLeaseChannel, currentSkillCommand, decideHostBuildSkill, deleteBuildDisk, deleteRecord, deliverContainerHooks, deliverExecMaven, describeMachineDocker, detectMachine, discardUnusableState, dropManagedBuildSettings, dropManagedClaudeKey, ensureFirecrackerAndJailer, ensureNetworkReady, ensureRootfs, ensureTunnel, execArgv, execCommandLine, fetchManagedBuildSettings, fetchManagedClaudeKey, filesAreCopied, firstLine4 as firstLine, formerSkillProblem, formerSkillQueues, ghHostsYml, gitRemoteFor, hasClaudeCredential, helperFirecrackerNote, helperSocketPath, holdManagedBuildSettings, holdManagedClaudeKey, hostCommandEnvironment, hostEnvironment, isPlaceholderCommand, itemScope, itemTag, keepGhConfigCurrent, keepMissingSetupScripts, keepRuntimeStep, leaseExpiresAtMs, leaseTimeLeftMs, lifecycleFailureReason, lifecycleSteps, listenOnBroker, machineConfig, makeBuildsDirPrivate, managedBuildSettingValues, managedBuildSettingValuesFor, managedBuildSettingsFor, managedClaudeKeyFor, managedClaudeKeyValues, managedClaudeKeyValuesFor, managedMachineLimits, measureDisk, microVmArchSupported, microVmAssetsPinned, missingPermissionFix, missingPermissionOf, needsBuildSkill, needsClaudeCredential, obtainImage, outOfMemoryReason, parseCpuList, permissionModeProblem, permissionModeProblems, placeholderProblem, placeholderQueues, planSavedState, prepareBranch, prepareRunnerInit, probeHelper, provisionContainer, provisionEnvironment, provisionRuntimes, provisionWithFreshFallback, ranRuntimeStep, reachDockerStep, readConfigObject, readRecords, recordProofsInContainer, removeOldestUntil, removeSavedState, resolveAgentUser, resolveHostBuild, runBuildSteps, runRunnerInit, runSetupScripts, runWithSpawn, runtimeStepInput, said, saveAndPrune, savedStateBase, savedStatesDir, selectExpired, selectStaleIncomplete, selectToFit, senderAliveScript, senderSignalScript, setUpRunnerCgroup, settleFailedSteps, setupInputFor, shellQuote, signalInContainer, startCheckContainer, startHostServices, startJailedInto, startServicesFor, stopContainer, stopJailed, stoppedHelperReason, supportsContainerBuilds, supportsMicroVmBuilds, sweepImageBuilders, syncInContainer, taggedLog, uidFromProbe, usableCpus, userIdChangedReason, withFactoryHosts, withTunnelLog, writeEvalInput, writeRecord2 as writeRecord, writeRunnerInit };
|
|
6538
|
+
export { ADDED_USER, ADOPTED_FETCH_RETRY_WINDOW_MS, AgentUserError, AssetError, DeliveryFailure, EVAL_INPUT_NAME, GH_CONFIG_YML, HELPER_ENV, LEASE_SECONDS, MANAGED_UNJAILED_REASON, MIN_ENGINE_MAJOR, PLACEHOLDER_MARKER, PROOFS_LOG, RECORD_PROOFS_ARGV, ROOT_DISK_ID_PREFIX, RunnerInitError, agentUidOf, attemptNote, claimPermissionProblem, claudeCredentialCheck, cleanupContainer, clockOf, closeHostBuild, containerCommandExec, containerJudgeEnvironment, containerSenderCommand, copyJudgeTree, copyOutSession, copyTranscripts, copyTranscriptsFromContainer, createBuildDisk, createContainerRuntime, createLeaseChannel, currentSkillCommand, decideHostBuildSkill, deleteBuildDisk, deleteRecord, deliverContainerHooks, deliverExecMaven, describeMachineDocker, detectMachine, discardUnusableState, dropManagedBuildSettings, dropManagedClaudeKey, ensureContainerRunning, ensureFirecrackerAndJailer, ensureNetworkReady, ensureRootfs, ensureTunnel, execArgv, execCommandLine, fetchManagedBuildSettings, fetchManagedClaudeKey, filesAreCopied, firstLine4 as firstLine, formerSkillProblem, formerSkillQueues, ghHostsYml, gitRemoteFor, hasClaudeCredential, helperFirecrackerNote, helperSocketPath, holdManagedBuildSettings, holdManagedClaudeKey, hostCommandEnvironment, hostEnvironment, isPlaceholderCommand, itemScope, itemTag, keepGhConfigCurrent, keepMissingSetupScripts, keepRuntimeStep, keepSession, keptSessionDir, leaseExpiresAtMs, leaseTimeLeftMs, lifecycleFailureReason, lifecycleSteps, listenOnBroker, machineConfig, makeBuildsDirPrivate, managedBuildSettingValues, managedBuildSettingValuesFor, managedBuildSettingsFor, managedClaudeKeyFor, managedClaudeKeyValues, managedClaudeKeyValuesFor, managedMachineLimits, measureDisk, microVmArchSupported, microVmAssetsPinned, missingPermissionFix, missingPermissionOf, needsBuildSkill, needsClaudeCredential, obtainImage, outOfMemoryReason, packKeptSession, parseCpuList, permissionModeProblem, permissionModeProblems, placeholderProblem, placeholderQueues, planSavedState, prepareBranch, prepareResume, prepareRunnerInit, probeHelper, provisionContainer, provisionEnvironment, provisionRuntimes, provisionWithFreshFallback, ranRuntimeStep, reachDockerStep, readConfigObject, readRecords, readResumeRecords, recordProofsInContainer, removeOldestUntil, removeSavedState, resolveAgentUser, resolveHostBuild, restoreSession, restoreSessionIntoContainer, runBuildSteps, runRunnerInit, runSetupScripts, runWithSpawn, runtimeStepInput, said, saveAndPrune, savedStateBase, savedStatesDir, selectExpired, selectStaleIncomplete, selectToFit, senderAliveScript, senderSignalScript, sessionGuestOfContainer, setUpRunnerCgroup, settleFailedSteps, setupInputFor, shellQuote, signalInContainer, startCheckContainer, startHostServices, startJailedInto, startServicesFor, stopContainer, stopJailed, stoppedHelperReason, supportsContainerBuilds, supportsMicroVmBuilds, sweepImageBuilders, syncInContainer, taggedLog, uidFromProbe, usableCpus, userIdChangedReason, withFactoryHosts, withTunnelLog, writeEvalInput, writeRecord2 as writeRecord, writeRunnerInit };
|
|
@@ -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-AF6DQJ5W.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,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { resolveCredentials, postJson, getJson } from './chunk-
|
|
3
|
+
import { resolveCredentials, postJson, getJson } from './chunk-FKLGX72N.js';
|
|
4
4
|
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
5
5
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
6
6
|
import { sanitizeTerminal } from './chunk-XSX42Q2H.js';
|
|
7
|
-
import { defaultFetch } from './chunk-
|
|
8
|
-
import { resolveRepoIdentity } from './chunk-
|
|
7
|
+
import { defaultFetch } from './chunk-YQHEJ5SV.js';
|
|
8
|
+
import { resolveRepoIdentity } from './chunk-DH6BDQM4.js';
|
|
9
9
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
10
10
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
11
11
|
import { randomUUID } from 'crypto';
|
|
@@ -103,10 +103,14 @@ function renderSourceThread(thread) {
|
|
|
103
103
|
}
|
|
104
104
|
function renderThread(label, thread) {
|
|
105
105
|
const header = `${C.dim}${label === "general" ? "general" : `criterion ${label}`} \xB7 waiting on ${thread.waitingOn ?? "no one"}${C.reset}`;
|
|
106
|
+
const checks = (thread.checkItems ?? []).flatMap((item) => [
|
|
107
|
+
` check ${sanitizeTerminal(item.check)}${item.id === thread.criterion ? "" : ` \xB7 ${sanitizeTerminal(item.id)}`} \xB7 ${sanitizeTerminal(item.result)}${item.reason ? `: ${sanitizeTerminal(item.reason)}` : ""}`,
|
|
108
|
+
...(item.refs ?? []).map((ref) => ` ${sanitizeTerminal(ref.path)}${ref.line === void 0 ? "" : `:${ref.line}`}`)
|
|
109
|
+
]);
|
|
106
110
|
const comments = thread.comments.map(
|
|
107
111
|
(c) => ` ${c.author.kind === "person" ? "person" : "agent"} ${sanitizeTerminal(c.author.name)}: ${sanitizeTerminal(c.body)}${c.action ? ` (${c.action})` : ""}`
|
|
108
112
|
);
|
|
109
|
-
return [header, ...comments].join("\n");
|
|
113
|
+
return [header, ...checks, ...comments].join("\n");
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
export { WorkCommentCommandError, runWorkComment, runWorkThreads };
|
|
@@ -5,7 +5,7 @@ import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME
|
|
|
5
5
|
import { installStarterPack } from './chunk-VQCAJUDV.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
7
|
import { AGENTS_MD_LAYOUT, declareAgentsMdLayout, linkClaudeSkills, SKILLS_LINK_PATH, describeSkillsLink, isAgentsMdLayout, holdsTodaysLayoutSources, discoverOuterlayerPaths } from './chunk-TMFKZBOW.js';
|
|
8
|
-
import { resolveGitCommonDir, defaultGitRunner } from './chunk-
|
|
8
|
+
import { resolveGitCommonDir, defaultGitRunner } from './chunk-WYGAQVBU.js';
|
|
9
9
|
import { loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE } from './chunk-MGF4254K.js';
|
|
10
10
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
11
11
|
import { linkedAgentsPath } from './chunk-GWXHRG2N.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-WT7J2627.js';
|
|
4
4
|
import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { uploadSpooledSteps } from './chunk-
|
|
3
|
+
import { uploadSpooledSteps } from './chunk-MCMDEEXB.js';
|
|
4
4
|
import { LaunchFilter } from './chunk-AAGU5FJF.js';
|
|
5
5
|
import { RepoFilter } from './chunk-TBT347UY.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
7
|
import { migrateLegacyArtifactSidecars, planArtifactUpload, artifactsStatePath, sanitizeTerminal, acquireArtifactSpoolLock, artifactBlobsDir, resolveArtifactTurnIndex, isArtifactTombstoned, ARTIFACT_RETRY_MAX_AGE_MS, writeArtifactSpoolState, reclaimUnneededArtifactBlobs, neededArtifactShas } from './chunk-XSX42Q2H.js';
|
|
8
|
-
import { cliFetch, resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-
|
|
8
|
+
import { cliFetch, resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-YQHEJ5SV.js';
|
|
9
9
|
import { readCloudConfig, cloudConfigPath, writeCloudConfig } from './chunk-HWVMRETT.js';
|
|
10
|
-
import { signerFor, signRunnerRequest } from './chunk-
|
|
11
|
-
import { writeSyncStatus, spoolDir } from './chunk-
|
|
10
|
+
import { signerFor, signRunnerRequest } from './chunk-4DJZSNVT.js';
|
|
11
|
+
import { writeSyncStatus, spoolDir } from './chunk-3L7OHRDV.js';
|
|
12
12
|
import { readLatestProvenanceForSession, readContextProvenance } from './chunk-545P7JY7.js';
|
|
13
13
|
import { hookExecSpoolPath } from './chunk-FUJUFLDC.js';
|
|
14
14
|
import { applyReportedCost } from './chunk-BKO6JEZI.js';
|
|
15
15
|
import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
16
|
-
import { setCustomScrubbers, setLocalIdentity, tailTranscript, enrichSessionRepo, scanAll, setRepoRoot, resolveRepoIdentity,
|
|
16
|
+
import { setCustomScrubbers, setLocalIdentity, forkFor, readForkRecord, sessionIdFromPath, tailTranscript, enrichSessionRepo, scanAll, setRepoRoot, resolveRepoIdentity, scrubDeep, SOURCE_ADAPTERS } from './chunk-DH6BDQM4.js';
|
|
17
17
|
import { readLaunchSpoolState, launchStatusIsDecisive, launchedItemsBySession, launchesPath } from './chunk-5WYT3PPE.js';
|
|
18
18
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
19
19
|
import { removeJournalHooks } from './chunk-CJPTUU2E.js';
|
|
@@ -683,10 +683,12 @@ var LiveUploader = class {
|
|
|
683
683
|
destination = { ok: true, url, credential, appId, kind: "key" };
|
|
684
684
|
}
|
|
685
685
|
const info = subagentInfo(mirrorPath);
|
|
686
|
+
const fork = forkFor(readForkRecord(this.home), { sessionId: sessionIdFromPath(mirrorPath), parentSessionId: info.parentSessionId });
|
|
686
687
|
const tail = tailTranscript(mirrorPath, void 0, {
|
|
687
688
|
isSubagent: info.isSubagent,
|
|
688
689
|
parentSessionId: info.parentSessionId,
|
|
689
|
-
ownId: info.ownId
|
|
690
|
+
ownId: info.ownId,
|
|
691
|
+
...fork === void 0 ? {} : { fork }
|
|
690
692
|
});
|
|
691
693
|
if (!tail.session) return false;
|
|
692
694
|
const session = tail.session;
|
|
@@ -1220,6 +1222,8 @@ async function runSyncInner(opts, stats) {
|
|
|
1220
1222
|
cursorProjectsRoot: opts.cursorProjectsRoot,
|
|
1221
1223
|
limit: opts.limit,
|
|
1222
1224
|
captureTier: tier,
|
|
1225
|
+
// An agent job that continued an earlier session left a record of when it started; its transcript opens with a copy of the earlier one.
|
|
1226
|
+
fork: readForkRecord(home),
|
|
1223
1227
|
adapters: sinceAdapters(sinceMs, hookRedeliverySessionIds),
|
|
1224
1228
|
onSession: (session, entry, blobs) => {
|
|
1225
1229
|
enrichSessionRepo(session);
|
|
@@ -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-WT7J2627.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,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { isVersion, compareVersions } from './chunk-TQMI335S.js';
|
|
4
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
4
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-WT7J2627.js';
|
|
5
5
|
import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
6
6
|
import { join } from 'path';
|
|
7
7
|
|