@outerlayer/cli 0.18.0 → 0.19.1
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/CHANGELOG.md +33 -0
- package/README.md +21 -2
- package/dist/{agent-setup-RBTEACYU.js → agent-setup-AM42SA2D.js} +15 -16
- package/dist/{artifact-link-cmd-AVM2EKTV.js → artifact-link-cmd-OWRI5AJX.js} +2 -2
- package/dist/build-info.json +1 -1
- package/dist/{builder-DUI2ZH2H.js → builder-C4QNTYMS.js} +3 -3
- package/dist/{check-5C4YDZYV.js → check-W2JGXN3B.js} +44 -43
- package/dist/{chunk-S26M3YBJ.js → chunk-3UZTIRLF.js} +1 -1
- package/dist/{chunk-Y5MXET4M.js → chunk-3ZR7Y23Y.js} +11 -10
- package/dist/{chunk-47TTLEDX.js → chunk-5VML45HH.js} +35 -13
- package/dist/{chunk-F4XSVQJ4.js → chunk-6X4SQ5MY.js} +2 -2
- package/dist/{chunk-T4Y6SCG3.js → chunk-7UWVLZXD.js} +2 -2
- package/dist/{chunk-N3CUDFCW.js → chunk-7VUK5RFS.js} +15 -2
- package/dist/{chunk-SWCTGCSC.js → chunk-7YP7T6GV.js} +1 -1
- package/dist/{chunk-3OFZM4X6.js → chunk-B6SCN5NY.js} +151 -20
- package/dist/{chunk-KDVIU23F.js → chunk-BWSUPRDK.js} +1 -1
- package/dist/{chunk-S76AYB4M.js → chunk-CG36IONK.js} +5 -5
- package/dist/{chunk-RAZTWYZN.js → chunk-CGGPS7SI.js} +7 -8
- package/dist/chunk-CJJDJ7AT.js +56 -0
- package/dist/{chunk-W5VPCONO.js → chunk-EAEELQVQ.js} +33 -227
- package/dist/{chunk-QQM2UJ6T.js → chunk-F2KXHIFI.js} +182 -28
- package/dist/{chunk-KK4VBOH6.js → chunk-FBTGMSQF.js} +10 -11
- package/dist/{chunk-MQJSXHV7.js → chunk-G3IJ3N6F.js} +5 -3
- package/dist/{chunk-FUB7LRUE.js → chunk-GEMQLBMW.js} +5 -5
- package/dist/{chunk-Y5GE76XC.js → chunk-HOKXGFDR.js} +33 -81
- package/dist/{chunk-IP7BIBXJ.js → chunk-IF2OSI5T.js} +35 -1
- package/dist/{chunk-UYOYTKE2.js → chunk-JHGEBPLE.js} +3 -3
- package/dist/chunk-KYS3TQAG.js +296 -0
- package/dist/chunk-LLM3I5YU.js +89 -0
- package/dist/{chunk-B3UKB46N.js → chunk-LRG3ZMZD.js} +4 -5
- package/dist/{chunk-NL4XPC7W.js → chunk-LW7G5TJB.js} +1 -1
- package/dist/{chunk-MNTSH4CL.js → chunk-NNLA7LLQ.js} +1 -1
- package/dist/{chunk-GOBOJMOJ.js → chunk-PIZRPNKR.js} +4 -4
- package/dist/{chunk-ULSIJGLS.js → chunk-PSN33ERW.js} +56 -14
- package/dist/{chunk-WGAUY5LE.js → chunk-QEFKA2QD.js} +1 -1
- package/dist/{chunk-BMYGAGBJ.js → chunk-QNLX477Q.js} +155 -23
- package/dist/{chunk-JF42URPU.js → chunk-R22NZSGA.js} +33 -9
- package/dist/chunk-TUSYOL2O.js +113 -0
- package/dist/{chunk-ESC6UR76.js → chunk-TWF3RICI.js} +6 -6
- package/dist/{chunk-L2USZT6T.js → chunk-VMJPFQNE.js} +1 -1
- package/dist/{chunk-X5N6KC6V.js → chunk-WFSUUUAN.js} +2 -3
- package/dist/{chunk-6CHIYEZZ.js → chunk-XZ4H4X5F.js} +9 -83
- package/dist/{chunk-LXAY4A2G.js → chunk-YQR6E6OV.js} +34 -49
- package/dist/chunk-Z7K3L4FC.js +174 -0
- package/dist/{claude-launcher-YVXI76NX.js → claude-launcher-J5M44PFS.js} +20 -7
- package/dist/{cli-C77H54BV.js → cli-EXX2R73G.js} +206 -230
- package/dist/{command-H5CILO4S.js → command-ZQNEPDS6.js} +29 -30
- package/dist/{config-FXDG4NPJ.js → config-CLSGABD5.js} +2 -2
- package/dist/{connect-cmd-ZW5FV3ZW.js → connect-cmd-UNYKGDAL.js} +7 -7
- package/dist/context-cleanup-CHEWNYU6.js +11 -0
- package/dist/control-plane-launch-34LNRJWR.js +216 -0
- package/dist/{dist-QTX4RSCL.js → dist-WO7NOJNG.js} +2 -2
- package/dist/{docker-RC3PRX3Q.js → docker-BFU3AQGY.js} +4 -4
- package/dist/{doctor-2NQQML6P.js → doctor-DHUM5DBB.js} +32 -33
- package/dist/{emit-artifact-cmd-7MP63KXU.js → emit-artifact-cmd-XBHM647X.js} +17 -17
- package/dist/{emit-cmd-PPN4QQF2.js → emit-cmd-W55AEBCA.js} +6 -6
- package/dist/{emit-criteria-cmd-3RXPDLNK.js → emit-criteria-cmd-CRTYEF7D.js} +11 -12
- package/dist/{emit-finding-cmd-OL7JB6H3.js → emit-finding-cmd-7JHVRYOP.js} +12 -13
- package/dist/{emit-result-cmd-UZVMOCF4.js → emit-result-cmd-5NZMLCJK.js} +17 -17
- package/dist/emit-step-cmd-347XNGPQ.js +26 -0
- package/dist/{governing-source-BUU4IABS.js → governing-source-HAA4OW57.js} +21 -22
- package/dist/{hook-fast-W5MKHMJT.js → hook-fast-RL5E5OXE.js} +3 -3
- package/dist/{import-capture-cmd-ZO6KGHI2.js → import-capture-cmd-TK4XY7RD.js} +4 -4
- package/dist/{import-ruler-cmd-KJMWL5V6.js → import-ruler-cmd-T6LLO6Q7.js} +2 -2
- package/dist/index.js +4 -4
- package/dist/{init-WNXXYMO7.js → init-V6FOMD2V.js} +30 -31
- package/dist/{init-VWXIZEAN.js → init-XG47KCI4.js} +30 -31
- package/dist/{init-cmd-WS6TIRYT.js → init-cmd-Z4O4PPLZ.js} +70 -27
- package/dist/{init-update-E3J6TVIN.js → init-update-7DVAKWW3.js} +21 -22
- package/dist/{install-CBWIEF3R.js → install-4SEFIIW2.js} +3 -3
- package/dist/{login-browser-O63QZN7D.js → login-browser-DX35MARZ.js} +2 -2
- package/dist/{loop-UGI2BJOT.js → loop-TPUYUMSY.js} +44 -43
- package/dist/{machine-JOW4RNZ7.js → machine-TRHBT5NE.js} +26 -27
- package/dist/{mcp-serve-cmd-DOTY5FKY.js → mcp-serve-cmd-N3UTY6EE.js} +5 -5
- package/dist/{runner-env-4NB2GA7O.js → runner-env-FRZFFHDF.js} +4 -4
- package/dist/{runner-key-TC3NFWFV.js → runner-key-5FOWCW7J.js} +30 -31
- package/dist/{session-sender-NNVPSPY7.js → session-sender-U2BBUWNO.js} +19 -15
- package/dist/shell-function-NRD4KVUK.js +6 -0
- package/dist/{spec-cmd-OWVTBB4J.js → spec-cmd-FVLJOFGC.js} +12 -13
- package/dist/{starter-pack-OPWUDOWX.js → starter-pack-6LQVLBIA.js} +5 -5
- package/dist/{status-TKCLLKFG.js → status-BINH7MBG.js} +33 -32
- package/dist/{sync-cmd-Q6VYNPWG.js → sync-cmd-VXOUFS4I.js} +18 -14
- package/dist/{watch-ARAGADTF.js → watch-OH645CV2.js} +18 -14
- package/dist/{work-claim-cmd-34FERLYX.js → work-claim-cmd-ZRPSHMPT.js} +16 -17
- package/dist/{work-cmd-7S5B2H2P.js → work-cmd-5I3J2XQQ.js} +12 -13
- package/dist/{work-comment-cmd-SZJSPM5S.js → work-comment-cmd-UCCPWUSR.js} +12 -13
- package/dist/work-logs-cmd-7352CJPG.js +60 -0
- package/dist/{work-open-pr-cmd-RPXKCBWS.js → work-open-pr-cmd-LSH4VHJM.js} +13 -14
- package/dist/{work-pr-cmd-5LGANL32.js → work-pr-cmd-H4OQR26N.js} +12 -13
- package/package.json +2 -2
- package/skill-pack/maintained/outerlayer-cli/SKILL.md +9 -2
- package/skill-pack/maintained/outerlayer-cli/references/find-out-why-a-build-ended.md +76 -0
- package/skill-pack/shipped.json +1 -0
- package/skill-pack/template/build/references/release.md +3 -1
- package/dist/chunk-WBT5X3NH.js +0 -40
- package/dist/chunk-XCCLFVXM.js +0 -401
- package/dist/context-adopt-O5OFXMKI.js +0 -109
- package/dist/context-materialize-Y5IJ4MQT.js +0 -23
- package/dist/{chunk-NACDBXUG.js → chunk-BM63HB2M.js} +1 -1
- package/dist/{chunk-ZRL6HKBY.js → chunk-FVMYKL6L.js} +1 -1
- package/dist/{chunk-52NC2FIU.js → chunk-NTRCK4NH.js} +1 -1
- package/dist/{chunk-XGP3VYOG.js → chunk-P53VEAOF.js} +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
+
import { LEASE_SECONDS, releaseLease, isUnfinished, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, hostCommandEnvironment, execArgv, microVmCommandLine, runCommand, execCommandLine, startSender, startHostServices, finishJob, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, hookLimitsFor, AttemptLogBook, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, ALREADY_RELEASED } from './chunk-B6SCN5NY.js';
|
|
4
|
+
import { writePendingUpdate } from './chunk-MTP2QEVO.js';
|
|
5
|
+
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-S5PCA3SN.js';
|
|
3
6
|
import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
|
|
4
|
-
import { compareVersions, satisfiesRange } from './chunk-I2UOAV7X.js';
|
|
5
7
|
import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-YETTWTAY.js';
|
|
6
|
-
import { LEASE_SECONDS, releaseLease, isUnfinished, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, hostCommandEnvironment, execArgv, microVmCommandLine, runCommand, execCommandLine, startSender, startHostServices, finishJob, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, hookLimitsFor, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, ALREADY_RELEASED } from './chunk-3OFZM4X6.js';
|
|
7
8
|
import { writeJobFile, readJobFile, readJobFileChecked } from './chunk-SADUQSO4.js';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { currentSkillCommand, formerSkillProblem, placeholderQueues, placeholderProblem } from './chunk-FUB7LRUE.js';
|
|
12
|
-
import { writeMarker, readMarker, currentVersion, removeMarker, entryIn, versionDir, startedThroughCurrent, switchCurrent, cleanVersions, isInLayout, stagingDir } from './chunk-AMFWYESY.js';
|
|
9
|
+
import { compareVersions, satisfiesRange } from './chunk-I2UOAV7X.js';
|
|
10
|
+
import { RUNNER_PROTOCOL } from './chunk-BWSUPRDK.js';
|
|
11
|
+
import { currentSkillCommand, formerSkillProblem, placeholderQueues, placeholderProblem } from './chunk-GEMQLBMW.js';
|
|
13
12
|
import { freeBytes, formatBytes } from './chunk-YYYRBYWG.js';
|
|
13
|
+
import { writeMarker, readMarker, currentVersion, removeMarker, entryIn, versionDir, startedThroughCurrent, switchCurrent, cleanVersions, isInLayout, stagingDir } from './chunk-AMFWYESY.js';
|
|
14
14
|
import { RepoFilter } from './chunk-TBT347UY.js';
|
|
15
|
-
import { provisionContainer, lifecycleSteps, lifecycleFailureReason, prepareBranch, containerCommandLine, measureDisk, setUpRunnerCgroup, parseCpuList, ensureTunnel, keepGhConfigCurrent, createContainerRuntime } from './chunk-
|
|
16
|
-
import { spawnRun } from './chunk-
|
|
17
|
-
import { builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, BUILD_LABEL, RUNNER_LABEL } from './chunk-
|
|
18
|
-
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-
|
|
19
|
-
import { checkFit } from './chunk-
|
|
20
|
-
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-
|
|
21
|
-
import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-
|
|
15
|
+
import { provisionContainer, lifecycleSteps, lifecycleFailureReason, prepareBranch, containerCommandLine, measureDisk, setUpRunnerCgroup, parseCpuList, ensureTunnel, keepGhConfigCurrent, createContainerRuntime } from './chunk-3ZR7Y23Y.js';
|
|
16
|
+
import { spawnRun } from './chunk-VMJPFQNE.js';
|
|
17
|
+
import { builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, BUILD_LABEL, RUNNER_LABEL } from './chunk-3UZTIRLF.js';
|
|
18
|
+
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-XZ4H4X5F.js';
|
|
19
|
+
import { checkFit } from './chunk-QEFKA2QD.js';
|
|
20
|
+
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-FBTGMSQF.js';
|
|
21
|
+
import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-P53VEAOF.js';
|
|
22
22
|
import { exceedsDisk } from './chunk-7RQ73DLO.js';
|
|
23
23
|
import { claimPidFile, readPidFile, releasePidFile } from './chunk-ECODQ7II.js';
|
|
24
24
|
import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
|
|
@@ -26,11 +26,10 @@ import { resolveVersion } from './chunk-RA3O54FC.js';
|
|
|
26
26
|
import { loadHostKey, ensureHostKey, signerFor } from './chunk-M2ZWWTWZ.js';
|
|
27
27
|
import { RUNNER_DIR_MODE, runnerDir, buildDir, attemptStamp, jobDir, jobsDir, pidFilePath, spoolDir, RUNNER_FILE_MODE, rootfsDir } from './chunk-N2PXGQRL.js';
|
|
28
28
|
import { parseClaimIdentity, parseClaimedRepositories, repositoriesOf, primaryOf, sharedUserEnvironment, JOB_MOUNT, claudeCredential } from './chunk-BQXFBI7T.js';
|
|
29
|
-
import { HOOKS_DIR_NAME, writeCommitHooks } from './chunk-XCCLFVXM.js';
|
|
30
29
|
import { randomBytes } from 'crypto';
|
|
31
|
-
import { mkdirSync, existsSync, chmodSync, statSync, readdirSync, readFileSync, rmSync, renameSync,
|
|
30
|
+
import { mkdirSync, existsSync, chmodSync, statSync, readdirSync, writeFileSync, readFileSync, rmSync, renameSync, closeSync, openSync, constants, lstatSync } from 'fs';
|
|
32
31
|
import { join, dirname } from 'path';
|
|
33
|
-
import { totalmem } from 'os';
|
|
32
|
+
import { totalmem, constants as constants$1 } from 'os';
|
|
34
33
|
|
|
35
34
|
createRequire(import.meta.url);
|
|
36
35
|
function openKvm() {
|
|
@@ -786,6 +785,145 @@ async function removeStaleRootDisks(root, unfinished, options) {
|
|
|
786
785
|
}
|
|
787
786
|
return freed;
|
|
788
787
|
}
|
|
788
|
+
var HOOKS_DIR_NAME = "git-hooks";
|
|
789
|
+
var CO_AUTHOR_FILE = "co-author";
|
|
790
|
+
var HOOKS = [
|
|
791
|
+
"applypatch-msg",
|
|
792
|
+
"pre-applypatch",
|
|
793
|
+
"post-applypatch",
|
|
794
|
+
"pre-commit",
|
|
795
|
+
"pre-merge-commit",
|
|
796
|
+
"prepare-commit-msg",
|
|
797
|
+
"commit-msg",
|
|
798
|
+
"post-commit",
|
|
799
|
+
"pre-rebase",
|
|
800
|
+
"post-checkout",
|
|
801
|
+
"post-merge",
|
|
802
|
+
"pre-push",
|
|
803
|
+
"pre-receive",
|
|
804
|
+
"update",
|
|
805
|
+
"post-receive",
|
|
806
|
+
"post-update",
|
|
807
|
+
"reference-transaction",
|
|
808
|
+
"pre-auto-gc",
|
|
809
|
+
"post-rewrite",
|
|
810
|
+
"sendemail-validate",
|
|
811
|
+
"post-index-change"
|
|
812
|
+
];
|
|
813
|
+
var READS_STDIN = /* @__PURE__ */ new Set(["pre-push", "pre-receive", "post-receive", "reference-transaction", "post-rewrite"]);
|
|
814
|
+
var ADD_TRAILER = `
|
|
815
|
+
# Every commit of the build names the requester once: a trailer already there is left alone.
|
|
816
|
+
file=\${1-}
|
|
817
|
+
if [ -n "$file" ] && [ -f "$file" ]; then
|
|
818
|
+
git interpret-trailers --in-place --if-exists addIfDifferent --trailer "Co-authored-by: $(cat "$here/${CO_AUTHOR_FILE}")" "$file" ||
|
|
819
|
+
echo "outerlayer: could not add the co-author line to the commit message" >&2
|
|
820
|
+
fi
|
|
821
|
+
`;
|
|
822
|
+
var HOOK_WRAPPER_MARKER = "# Written by the OuterLayer runner.";
|
|
823
|
+
function script(name) {
|
|
824
|
+
const adds = name === "prepare-commit-msg";
|
|
825
|
+
return `#!/bin/sh
|
|
826
|
+
${HOOK_WRAPPER_MARKER} Runs the repository's own ${name} hook, then
|
|
827
|
+
# ${adds ? "adds the co-author line to the commit message" : "hands its status on"}.
|
|
828
|
+
here=$(dirname "$0")
|
|
829
|
+
|
|
830
|
+
# The hooks path git would use without this directory: cut the list of configuration
|
|
831
|
+
# entries the runner passes just before its own core.hooksPath entry, then ask git.
|
|
832
|
+
n=\${GIT_CONFIG_COUNT-0}
|
|
833
|
+
case $n in '' | *[!0-9]*) n=0 ;; esac
|
|
834
|
+
cut=$n
|
|
835
|
+
i=$n
|
|
836
|
+
while [ "$i" -gt 0 ]; do
|
|
837
|
+
i=$((i - 1))
|
|
838
|
+
eval "key=\\\${GIT_CONFIG_KEY_$i-}"
|
|
839
|
+
eval "value=\\\${GIT_CONFIG_VALUE_$i-}"
|
|
840
|
+
if [ "$key" = core.hooksPath ] && { [ "$value" = "$here" ] || [ "$value" -ef "$here" ]; }; then
|
|
841
|
+
cut=$i
|
|
842
|
+
break
|
|
843
|
+
fi
|
|
844
|
+
done
|
|
845
|
+
path=$(GIT_CONFIG_COUNT=$cut git config --type=path core.hooksPath 2>/dev/null) || path=
|
|
846
|
+
if [ -z "$path" ]; then
|
|
847
|
+
path=$(git rev-parse --git-common-dir 2>/dev/null)/hooks
|
|
848
|
+
fi
|
|
849
|
+
|
|
850
|
+
hook=$path/${name}
|
|
851
|
+
status=0
|
|
852
|
+
if [ "$path" -ef "$here" ] || [ ! -f "$hook" ] || [ ! -x "$hook" ]; then
|
|
853
|
+
${READS_STDIN.has(name) ? " cat >/dev/null\n" : ""} :
|
|
854
|
+
else
|
|
855
|
+
${adds ? ` "$hook" "$@" || status=$?` : ` exec "$hook" "$@"`}
|
|
856
|
+
fi
|
|
857
|
+
${adds ? `[ "$status" -eq 0 ] || exit "$status"
|
|
858
|
+
${ADD_TRAILER}` : ""}exit 0
|
|
859
|
+
`;
|
|
860
|
+
}
|
|
861
|
+
function writeCommitHooks(buildDir2, coAuthor) {
|
|
862
|
+
const dir = join(buildDir2, HOOKS_DIR_NAME);
|
|
863
|
+
mkdirSync(dir, { recursive: true });
|
|
864
|
+
chmodSync(dir, 493);
|
|
865
|
+
for (const name of HOOKS) {
|
|
866
|
+
const path = join(dir, name);
|
|
867
|
+
writeFileSync(path, script(name));
|
|
868
|
+
chmodSync(path, 493);
|
|
869
|
+
}
|
|
870
|
+
const data = join(dir, CO_AUTHOR_FILE);
|
|
871
|
+
writeFileSync(data, `${coAuthor.name} <${coAuthor.email}>
|
|
872
|
+
`);
|
|
873
|
+
chmodSync(data, 420);
|
|
874
|
+
return dir;
|
|
875
|
+
}
|
|
876
|
+
function linuxSignalName(number) {
|
|
877
|
+
const names = {
|
|
878
|
+
1: "SIGHUP",
|
|
879
|
+
2: "SIGINT",
|
|
880
|
+
3: "SIGQUIT",
|
|
881
|
+
4: "SIGILL",
|
|
882
|
+
5: "SIGTRAP",
|
|
883
|
+
6: "SIGABRT",
|
|
884
|
+
7: "SIGBUS",
|
|
885
|
+
8: "SIGFPE",
|
|
886
|
+
9: "SIGKILL",
|
|
887
|
+
10: "SIGUSR1",
|
|
888
|
+
11: "SIGSEGV",
|
|
889
|
+
12: "SIGUSR2",
|
|
890
|
+
13: "SIGPIPE",
|
|
891
|
+
14: "SIGALRM",
|
|
892
|
+
15: "SIGTERM",
|
|
893
|
+
16: "SIGSTKFLT",
|
|
894
|
+
17: "SIGCHLD",
|
|
895
|
+
18: "SIGCONT",
|
|
896
|
+
19: "SIGSTOP",
|
|
897
|
+
20: "SIGTSTP",
|
|
898
|
+
21: "SIGTTIN",
|
|
899
|
+
22: "SIGTTOU",
|
|
900
|
+
23: "SIGURG",
|
|
901
|
+
24: "SIGXCPU",
|
|
902
|
+
25: "SIGXFSZ",
|
|
903
|
+
26: "SIGVTALRM",
|
|
904
|
+
27: "SIGPROF",
|
|
905
|
+
28: "SIGWINCH",
|
|
906
|
+
29: "SIGIO",
|
|
907
|
+
30: "SIGPWR",
|
|
908
|
+
31: "SIGSYS"
|
|
909
|
+
};
|
|
910
|
+
return names[number];
|
|
911
|
+
}
|
|
912
|
+
function hostSignalName(number) {
|
|
913
|
+
return Object.entries(constants$1.signals).find(([, value]) => value === number)?.[0];
|
|
914
|
+
}
|
|
915
|
+
function notEndedByRunnerReason(exit, isolated) {
|
|
916
|
+
if (exit.signal !== null) {
|
|
917
|
+
return `the command was killed by ${exit.signal} on the host; the runner did not end it`;
|
|
918
|
+
}
|
|
919
|
+
const number = exit.code - 128;
|
|
920
|
+
const name = isolated ? linuxSignalName(number) : hostSignalName(number);
|
|
921
|
+
if (name === void 0) return void 0;
|
|
922
|
+
return `the command exited ${exit.code}, the status of a process killed by ${name}; the runner did not end it`;
|
|
923
|
+
}
|
|
924
|
+
function jobNotEndedByRunnerReason(exit, job) {
|
|
925
|
+
return notEndedByRunnerReason(exit, job.container !== void 0 || job.microvm !== void 0);
|
|
926
|
+
}
|
|
789
927
|
|
|
790
928
|
// src/runner/loop.ts
|
|
791
929
|
var QUEUE_ORDER = ["amend", "implement"];
|
|
@@ -795,7 +933,12 @@ var TRACKER_REPOSITORY_HOSTS = {
|
|
|
795
933
|
var HOUSEKEEPING_INTERVAL_MS = 36e5;
|
|
796
934
|
function logOf(state) {
|
|
797
935
|
state.deps.log ??= createRunnerLog(state.deps.now ?? (() => /* @__PURE__ */ new Date()));
|
|
798
|
-
|
|
936
|
+
state.attemptLog ??= attemptLogsOf(state).wrap(state.deps.log);
|
|
937
|
+
return state.attemptLog;
|
|
938
|
+
}
|
|
939
|
+
function attemptLogsOf(state) {
|
|
940
|
+
state.attemptLogs ??= new AttemptLogBook(state.deps.now);
|
|
941
|
+
return state.attemptLogs;
|
|
799
942
|
}
|
|
800
943
|
function nowOf(state) {
|
|
801
944
|
return (state.deps.now ?? (() => /* @__PURE__ */ new Date()))();
|
|
@@ -811,6 +954,7 @@ function finishDepsOf(state) {
|
|
|
811
954
|
now: state.deps.now,
|
|
812
955
|
sleep: state.deps.sleep,
|
|
813
956
|
log: logOf(state),
|
|
957
|
+
attemptLogs: attemptLogsOf(state),
|
|
814
958
|
cliVersion: state.deps.cliVersion,
|
|
815
959
|
// Any job that has a container needs the runtime to stop and remove it, including one a config change left behind.
|
|
816
960
|
container: runtimeOf(state)
|
|
@@ -1319,7 +1463,7 @@ var CLAIM_REFUSAL_CODES = new Set(
|
|
|
1319
1463
|
"pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected branch_claimed_elsewhere".split(" ")
|
|
1320
1464
|
);
|
|
1321
1465
|
async function tryClaimAndStart(state, item, queue) {
|
|
1322
|
-
const { postJson: postJson2 } = await import('./work-cmd-
|
|
1466
|
+
const { postJson: postJson2 } = await import('./work-cmd-5I3J2XQQ.js');
|
|
1323
1467
|
const log = logOf(state);
|
|
1324
1468
|
const hostKey = await loadHostKey(state.config.configPath);
|
|
1325
1469
|
const claim = await retrySend(
|
|
@@ -1478,9 +1622,10 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
|
|
|
1478
1622
|
ending: false
|
|
1479
1623
|
};
|
|
1480
1624
|
state.jobs.set(dirPath, active);
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
);
|
|
1625
|
+
attemptLogsOf(state).open(item.number, dirPath);
|
|
1626
|
+
const claimLine = `claimed ${queue} #${item.number} ${item.trackerKey} (claim ${shortClaim(claimId)}) \u2192 ${relativeToRunner(runnerRoot, dirPath)}`;
|
|
1627
|
+
log.line(claimLine);
|
|
1628
|
+
attemptLogsOf(state).note(item.number, claimLine);
|
|
1484
1629
|
const hookLimits = () => hookLimitsFor(state.config, startedAt.getTime(), state.deps.now);
|
|
1485
1630
|
const tag = `#${item.number}`;
|
|
1486
1631
|
const containerMode = isBuiltinContainer(state.config.hooks.provision);
|
|
@@ -1841,11 +1986,13 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
|
|
|
1841
1986
|
const took = formatDuration(nowOf(state).getTime() - commandStartedMs);
|
|
1842
1987
|
if (signal !== null) {
|
|
1843
1988
|
log.error(`${tag} command killed by ${signal} (${took})`);
|
|
1989
|
+
active.job.commandEndReason = jobNotEndedByRunnerReason({ code: null, signal }, active.job);
|
|
1844
1990
|
void endJob(state, active, "failed");
|
|
1845
1991
|
return;
|
|
1846
1992
|
}
|
|
1847
1993
|
log.line(`${tag} command exited ${code ?? 0} (${took})`);
|
|
1848
1994
|
if (code !== null) active.job.exitCode = code;
|
|
1995
|
+
active.job.commandEndReason = jobNotEndedByRunnerReason({ code, signal }, active.job);
|
|
1849
1996
|
void endJob(state, active, code === 0 ? "ok" : "failed");
|
|
1850
1997
|
});
|
|
1851
1998
|
}
|
|
@@ -2079,7 +2226,7 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
|
|
|
2079
2226
|
const outcome = await onStartUnderMarker({
|
|
2080
2227
|
configPath,
|
|
2081
2228
|
own: ownVersionOf(deps),
|
|
2082
|
-
check: update.check ? () => update.check(configPath) : async () => (await import('./check-
|
|
2229
|
+
check: update.check ? () => update.check(configPath) : async () => (await import('./check-W2JGXN3B.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl }),
|
|
2083
2230
|
now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
|
|
2084
2231
|
log
|
|
2085
2232
|
});
|
|
@@ -2117,9 +2264,11 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
|
|
|
2117
2264
|
return [];
|
|
2118
2265
|
});
|
|
2119
2266
|
for (const buildId of runningMicroVms) log.line(`stopped microVM build ${buildId}, left running by an earlier runner`);
|
|
2267
|
+
const attemptLogs = attemptLogsOf(state);
|
|
2120
2268
|
for (const { dirPath, job } of listAdoptableJobs(jobsDir(configPath))) {
|
|
2121
2269
|
const adopted = { job, dirPath, lastRenewAtMs: nowMs(), cmd: null, cpuSample: null, ending: false };
|
|
2122
2270
|
state.jobs.set(dirPath, adopted);
|
|
2271
|
+
attemptLogs.open(job.item, dirPath);
|
|
2123
2272
|
if (job.container !== void 0) {
|
|
2124
2273
|
const cores = job.container.cpuset === void 0 ? void 0 : parseCpuList(job.container.cpuset);
|
|
2125
2274
|
if (cores !== void 0) runtimeOf(state).cpus.hold(job.container.buildId, cores);
|
|
@@ -2131,18 +2280,20 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
|
|
|
2131
2280
|
keepGhConfigCurrent(
|
|
2132
2281
|
tokens,
|
|
2133
2282
|
job.container.buildDir,
|
|
2134
|
-
(err) =>
|
|
2283
|
+
(err) => logOf(state).error(`#${job.item} the read token could not be written for gh: ${describeCallFailure(err)}`)
|
|
2135
2284
|
);
|
|
2136
2285
|
} catch (err) {
|
|
2137
|
-
|
|
2286
|
+
logOf(state).error(`#${job.item} could not give the adopted build a read token: ${describeCallFailure(err)}`);
|
|
2138
2287
|
}
|
|
2139
2288
|
}
|
|
2140
2289
|
if (job.build !== void 0 && !runtimeOf(state).tunnels.has(job.build.buildId)) {
|
|
2141
2290
|
await startHostServices({ runtime: runtimeOf(state), config, build: job.build, jobDir: dirPath, itemKey: job.itemKey, process: job.build.workDir !== void 0 }).catch((err) => {
|
|
2142
|
-
|
|
2291
|
+
logOf(state).error(`the tunnel of #${job.item} could not start again: ${describeCallFailure(err)}`);
|
|
2143
2292
|
});
|
|
2144
2293
|
}
|
|
2145
|
-
|
|
2294
|
+
const adoptedLine = `adopted job ${job.queue} #${job.item} (claim ${shortClaim(job.claimId)}) \xB7 pid ${job.pid} still running`;
|
|
2295
|
+
log.line(adoptedLine);
|
|
2296
|
+
attemptLogs.note(job.item, adoptedLine);
|
|
2146
2297
|
}
|
|
2147
2298
|
for (const { job, released } of await retryFailedReleases(jobsDir(configPath), config, {
|
|
2148
2299
|
fetchImpl: deps.fetchImpl,
|
|
@@ -2182,7 +2333,7 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
|
|
|
2182
2333
|
} catch {
|
|
2183
2334
|
}
|
|
2184
2335
|
void watchTick(state, active, now, mtime).catch((err) => {
|
|
2185
|
-
|
|
2336
|
+
logOf(state).error(`#${active.job.item} health check failed: ${describeCallFailure(err)}`);
|
|
2186
2337
|
});
|
|
2187
2338
|
}
|
|
2188
2339
|
}, deps.watchIntervalMs ?? 3e4);
|
|
@@ -2229,6 +2380,9 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
|
|
|
2229
2380
|
let passes = 0;
|
|
2230
2381
|
while (state.jobs.size > 0 && !exited) {
|
|
2231
2382
|
onWaiting?.([...state.jobs.keys()]);
|
|
2383
|
+
for (const active of state.jobs.values()) {
|
|
2384
|
+
attemptLogs.noteChanged(active.job.item, "drain", `stopping: draining, waiting on #${active.job.item} (${active.job.stage ?? "starting"})`);
|
|
2385
|
+
}
|
|
2232
2386
|
if (passes % DRAIN_LOG_EVERY_PASSES === 0) {
|
|
2233
2387
|
log.line(
|
|
2234
2388
|
`stopping: draining, waiting on ${[...state.jobs.values()].map((a) => describeWaiting(a, nowMs())).join(", ")}`
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { autoConnect } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { resolveRepoIdentity } from './chunk-BMYGAGBJ.js';
|
|
3
|
+
import { detectActiveSession, autoConnect } from './chunk-IF2OSI5T.js';
|
|
4
|
+
import { workPageUrl } from './chunk-CG36IONK.js';
|
|
5
|
+
import { sanitizeTerminal } from './chunk-G3IJ3N6F.js';
|
|
6
|
+
import { resolveRepoIdentity } from './chunk-QNLX477Q.js';
|
|
8
7
|
import { C } from './chunk-ANPNT6PM.js';
|
|
9
8
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
10
|
-
import { defaultFetch } from './chunk-
|
|
11
|
-
import { resolveGatewayCredentials, unauthorizedMessage } from './chunk-
|
|
12
|
-
import { signRunnerRequest } from './chunk-M2ZWWTWZ.js';
|
|
9
|
+
import { defaultFetch } from './chunk-FVMYKL6L.js';
|
|
10
|
+
import { resolveGatewayCredentials, unauthorizedMessage } from './chunk-NTRCK4NH.js';
|
|
13
11
|
import { readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
14
12
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
13
|
+
import { signRunnerRequest } from './chunk-M2ZWWTWZ.js';
|
|
15
14
|
|
|
16
15
|
createRequire(import.meta.url);
|
|
17
16
|
|
|
@@ -44,8 +43,8 @@ var TRACKERS = {
|
|
|
44
43
|
scopeNoun: "project",
|
|
45
44
|
connect: {
|
|
46
45
|
kind: "form",
|
|
47
|
-
summary: "Read the projects you pick on a site, with a service account. One webhook is created in Jira by an admin.",
|
|
48
|
-
intro: "Uses a service account's OAuth client credential. Create one under Atlassian administration, then paste it here.
|
|
46
|
+
summary: "Read the projects you pick on a site, and file specs as issues, with a service account. One webhook is created in Jira by an admin.",
|
|
47
|
+
intro: "Uses a service account's OAuth client credential. Create one under Atlassian administration, then paste it here. Give it read:jira-work, and write:jira-work to file specs. A credential's scopes are fixed when it is created.",
|
|
49
48
|
notice: "After connecting, you get a webhook URL and secret to put on one webhook in Jira. That is the only manual step, and the only time the secret is shown.",
|
|
50
49
|
fields: [
|
|
51
50
|
{ name: "siteUrl", label: "Site URL", placeholder: "https://your-team.atlassian.net" },
|
|
@@ -422,7 +421,7 @@ async function runWorkLinkSession(opts) {
|
|
|
422
421
|
return await linkSession(opts);
|
|
423
422
|
} catch (err) {
|
|
424
423
|
if (opts.logFailures) {
|
|
425
|
-
const { logHookError } = await import('./hook-fast-
|
|
424
|
+
const { logHookError } = await import('./hook-fast-RL5E5OXE.js');
|
|
426
425
|
const reason = err instanceof Error ? err.message : String(err);
|
|
427
426
|
logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
|
|
428
427
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { ArtifactTombstoneRecordSchema, ArtifactSpoolRecordSchema } from './chunk-
|
|
3
|
+
import { ArtifactTombstoneRecordSchema, ArtifactSpoolRecordSchema } from './chunk-7VUK5RFS.js';
|
|
4
4
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
5
5
|
import { mkdirSync, appendFileSync, writeFileSync, renameSync, unlinkSync, existsSync, readdirSync, readFileSync, statSync } from 'fs';
|
|
6
6
|
import { join, dirname } from 'path';
|
|
@@ -273,7 +273,9 @@ function artifactLockIsStale(path, nowMs, isAlive) {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
async function acquireArtifactSpoolLock(home = homeFromEnv(), opts = {}) {
|
|
276
|
-
|
|
276
|
+
return acquireSpoolLockAt(artifactsLockPath(home), opts);
|
|
277
|
+
}
|
|
278
|
+
async function acquireSpoolLockAt(path, opts = {}) {
|
|
277
279
|
const waitMs = opts.waitMs ?? ARTIFACT_LOCK_WAIT_MS;
|
|
278
280
|
const sleep = opts.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
279
281
|
const isAlive = opts.isAlive ?? processIsAlive;
|
|
@@ -460,4 +462,4 @@ function resolveArtifactTurnIndex(turns, filename) {
|
|
|
460
462
|
return found;
|
|
461
463
|
}
|
|
462
464
|
|
|
463
|
-
export { ARTIFACT_RETRY_MAX_AGE_MS, acquireArtifactSpoolLock, appendArtifactRecord, appendArtifactTombstone, artifactBlobsDir, artifactsSpoolPath, artifactsStatePath, findPendingArtifactRecord, isArtifactTombstoned, localArtifactIds, migrateLegacyArtifactSidecars, neededArtifactShas, planArtifactUpload, readEffectiveArtifactSpoolState, reclaimUnneededArtifactBlobs, resolveArtifactTurnIndex, sanitizeTerminal, writeArtifactSpoolState };
|
|
465
|
+
export { ARTIFACT_RETRY_MAX_AGE_MS, acquireArtifactSpoolLock, acquireSpoolLockAt, appendArtifactRecord, appendArtifactTombstone, artifactBlobsDir, artifactsSpoolPath, artifactsStatePath, findPendingArtifactRecord, isArtifactTombstoned, localArtifactIds, migrateLegacyArtifactSidecars, neededArtifactShas, planArtifactUpload, readEffectiveArtifactSpoolState, reclaimUnneededArtifactBlobs, resolveArtifactTurnIndex, sanitizeTerminal, writeArtifactSpoolState };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { isPlaceholderCommand } from './chunk-
|
|
4
|
-
import { describeCallFailure } from './chunk-
|
|
5
|
-
import { WorkCommandError, getJson } from './chunk-
|
|
6
|
-
import { sanitizeTerminal } from './chunk-
|
|
7
|
-
import { builtinKind } from './chunk-
|
|
3
|
+
import { isPlaceholderCommand } from './chunk-PIZRPNKR.js';
|
|
4
|
+
import { describeCallFailure } from './chunk-XZ4H4X5F.js';
|
|
5
|
+
import { WorkCommandError, getJson } from './chunk-FBTGMSQF.js';
|
|
6
|
+
import { sanitizeTerminal } from './chunk-G3IJ3N6F.js';
|
|
7
|
+
import { builtinKind } from './chunk-P53VEAOF.js';
|
|
8
8
|
import { signerFor } from './chunk-M2ZWWTWZ.js';
|
|
9
9
|
import { CLAUDE_CREDENTIAL_VARIABLES, claudeCredential } from './chunk-BQXFBI7T.js';
|
|
10
10
|
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { checkStarterFiles, contextIsGoverned } from './chunk-
|
|
4
|
-
import { resolveCredentials, getJson, WorkCommandError } from './chunk-
|
|
5
|
-
import { isLinkedRepository } from './chunk-
|
|
6
|
-
import { sanitizeTerminal } from './chunk-
|
|
3
|
+
import { checkStarterFiles, contextIsGoverned } from './chunk-TWF3RICI.js';
|
|
4
|
+
import { resolveCredentials, getJson, WorkCommandError } from './chunk-FBTGMSQF.js';
|
|
5
|
+
import { isLinkedRepository } from './chunk-CG36IONK.js';
|
|
6
|
+
import { sanitizeTerminal } from './chunk-G3IJ3N6F.js';
|
|
7
|
+
import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-PSN33ERW.js';
|
|
7
8
|
import { readStatuslineState, STATE_FRESH_MS } from './chunk-DSF2FWAZ.js';
|
|
8
|
-
import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-
|
|
9
|
+
import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-QNLX477Q.js';
|
|
9
10
|
import { C } from './chunk-ANPNT6PM.js';
|
|
10
11
|
import { readSettings, settingsPath, isOurStatuslineSlot, statuslineWrappedOriginal, REGISTERED_EVENTS, isOurHookCommand, ourCommandBins, cliBinResolvable, ourDirectScriptBins, wrappedOriginalCommand } from './chunk-5QRP3MVS.js';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { resolveGatewayCredentials } from './chunk-52NC2FIU.js';
|
|
15
|
-
import { readCloudConfig } from './chunk-EABW6AJQ.js';
|
|
16
|
-
import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-ULSIJGLS.js';
|
|
17
|
-
import { hookCommandEscapesControlPlane, CONTROL_PLANE_DIR_VARIABLE } from './chunk-G2YNJIGF.js';
|
|
18
|
-
import { deadHooksState, preparePackageManagerCommand, contextExcludesPresent } from './chunk-XCCLFVXM.js';
|
|
12
|
+
import { checkFormerSkillNames } from './chunk-7UWVLZXD.js';
|
|
13
|
+
import { defaultFetch } from './chunk-FVMYKL6L.js';
|
|
14
|
+
import { resolveGatewayCredentials } from './chunk-NTRCK4NH.js';
|
|
19
15
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
16
|
+
import { hookCommandEscapesControlPlane, CONTROL_PLANE_DIR_VARIABLE } from './chunk-G2YNJIGF.js';
|
|
20
17
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
18
|
+
import { readDeliveryRecord, readDegraded, readSourceCache } from './chunk-YQR6E6OV.js';
|
|
19
|
+
import { deadHooksState, preparePackageManagerCommand } from './chunk-TUSYOL2O.js';
|
|
21
20
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
22
21
|
import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, accessSync, constants, statSync, readdirSync, realpathSync } from 'fs';
|
|
23
22
|
import { join, dirname, resolve, delimiter } from 'path';
|
|
@@ -194,7 +193,7 @@ function runDoctor(env = {}) {
|
|
|
194
193
|
...starter?.checks ?? [],
|
|
195
194
|
...laptop ? checkRenamedSkills(env.cwd) : [],
|
|
196
195
|
...starter !== void 0 && !starter.mcpOutdated ? checkMcpCommand(env.cwd, env.processEnv) : [],
|
|
197
|
-
...checkContextSource(
|
|
196
|
+
...checkContextSource(env.cwd),
|
|
198
197
|
...checkGovernsList(env.cwd),
|
|
199
198
|
...checkControlPlaneHooks(env.cwd),
|
|
200
199
|
...checkInstalledCli(home, env.cwd ?? process.cwd())
|
|
@@ -202,7 +201,7 @@ function runDoctor(env = {}) {
|
|
|
202
201
|
}
|
|
203
202
|
function checkRenamedSkills(cwd) {
|
|
204
203
|
const dirs = findGitDirs(cwd ?? process.cwd());
|
|
205
|
-
if (dirs === void 0 || contextIsGoverned(dirs.
|
|
204
|
+
if (dirs === void 0 || contextIsGoverned(dirs.gitCommonDir)) return [];
|
|
206
205
|
return checkFormerSkillNames(dirs.repoRoot);
|
|
207
206
|
}
|
|
208
207
|
function checkInstalledCli(home, cwd) {
|
|
@@ -670,17 +669,17 @@ function defaultClaudeInstalls() {
|
|
|
670
669
|
function contextDegradedFix(kind) {
|
|
671
670
|
switch (kind) {
|
|
672
671
|
case "unreachable":
|
|
673
|
-
return `Check network/VPN access to the control plane, then
|
|
672
|
+
return `Check network/VPN access to the control plane, then start Claude Code with \`${cliInvocation()} claude\`.`;
|
|
674
673
|
case "no-access":
|
|
675
674
|
return "Check your git credentials (SSH key or token) and org/SSO access to the control plane, then retry.";
|
|
676
675
|
case "designation-unverified":
|
|
677
|
-
return `Check OuterLayer cloud connectivity/config (~/.outerlayer/config.json), then
|
|
676
|
+
return `Check OuterLayer cloud connectivity/config (~/.outerlayer/config.json), then start Claude Code with \`${cliInvocation()} claude\`.`;
|
|
678
677
|
case "not-governed":
|
|
679
|
-
return "
|
|
678
|
+
return "A record from an earlier CLI. It is cleared the next time `outerlayer claude` asks which control plane governs this repository.";
|
|
680
679
|
case "adoption-conflict":
|
|
681
|
-
return
|
|
680
|
+
return "A record from an earlier CLI. Committed AGENTS.md or .claude files no longer block the control plane, and the record is cleared the next time `outerlayer claude` asks which control plane governs this repository.";
|
|
682
681
|
case "conflict":
|
|
683
|
-
return `This record is stale: a gateway that stores the control plane never reports two.
|
|
682
|
+
return `This record is stale: a gateway that stores the control plane never reports two. Start Claude Code with \`${cliInvocation()} claude\` to clear it.`;
|
|
684
683
|
}
|
|
685
684
|
}
|
|
686
685
|
function checkGovernsList(cwd) {
|
|
@@ -756,16 +755,10 @@ function checkControlPlaneHooks(cwd) {
|
|
|
756
755
|
}
|
|
757
756
|
];
|
|
758
757
|
}
|
|
759
|
-
function checkContextSource(
|
|
758
|
+
function checkContextSource(cwd) {
|
|
760
759
|
const dir = cwd ?? process.cwd();
|
|
761
|
-
let repoRoot;
|
|
762
760
|
let gitCommonDir;
|
|
763
761
|
try {
|
|
764
|
-
repoRoot = execFileSync("git", ["-C", dir, "rev-parse", "--show-toplevel"], {
|
|
765
|
-
encoding: "utf8",
|
|
766
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
767
|
-
timeout: 2e3
|
|
768
|
-
}).trim();
|
|
769
762
|
gitCommonDir = execFileSync("git", ["-C", dir, "rev-parse", "--path-format=absolute", "--git-common-dir"], {
|
|
770
763
|
encoding: "utf8",
|
|
771
764
|
stdio: ["ignore", "pipe", "ignore"],
|
|
@@ -774,72 +767,31 @@ function checkContextSource(home, cwd) {
|
|
|
774
767
|
} catch {
|
|
775
768
|
return [];
|
|
776
769
|
}
|
|
777
|
-
if (!
|
|
778
|
-
const
|
|
779
|
-
const manifest = readContextManifest(gitCommonDir);
|
|
770
|
+
if (!gitCommonDir) return [];
|
|
771
|
+
const delivery = readDeliveryRecord(gitCommonDir);
|
|
780
772
|
const degraded = readDegraded(gitCommonDir);
|
|
781
|
-
const
|
|
782
|
-
|
|
783
|
-
if (!pin && !manifest && !degraded && !looksGoverned) return [];
|
|
773
|
+
const governed = readSourceCache(gitCommonDir)?.status === "governed";
|
|
774
|
+
if (!governed && delivery === void 0 && !degraded) return [];
|
|
784
775
|
const checks = [];
|
|
785
776
|
const name = "Context source";
|
|
786
|
-
if (
|
|
777
|
+
if (delivery !== void 0 && existsSync(delivery.dir)) {
|
|
778
|
+
checks.push({ name, status: degraded ? "warn" : "pass", detail: `control plane delivered at ${delivery.sha.slice(0, 7)}` });
|
|
779
|
+
} else if (governed) {
|
|
787
780
|
checks.push({
|
|
788
781
|
name,
|
|
789
782
|
status: "warn",
|
|
790
|
-
detail:
|
|
791
|
-
fix: `
|
|
783
|
+
detail: delivery === void 0 ? "a control plane governs this repository, and no copy of it has been delivered to this machine" : `the delivered control plane is no longer at ${delivery.dir}`,
|
|
784
|
+
fix: `Start Claude Code with \`${cliInvocation()} claude\`.`
|
|
792
785
|
});
|
|
793
|
-
} else if (pin ?? manifest) {
|
|
794
|
-
const sha = (pin ?? manifest).sha;
|
|
795
|
-
checks.push({ name, status: degraded ? "warn" : "pass", detail: `materialized at ${sha.slice(0, 7)}` });
|
|
796
786
|
}
|
|
797
787
|
if (degraded) {
|
|
798
788
|
checks.push({
|
|
799
789
|
name: "Context source degradation",
|
|
800
|
-
status: degraded.kind === "
|
|
790
|
+
status: degraded.kind === "conflict" ? "fail" : "warn",
|
|
801
791
|
detail: degraded.message,
|
|
802
792
|
fix: contextDegradedFix(degraded.kind)
|
|
803
793
|
});
|
|
804
794
|
}
|
|
805
|
-
if ((pin || manifest) && !contextExcludesPresent(gitCommonDir)) {
|
|
806
|
-
checks.push({
|
|
807
|
-
name: "Context exclude block",
|
|
808
|
-
status: "warn",
|
|
809
|
-
detail: "materialized paths are not excluded in .git/info/exclude",
|
|
810
|
-
fix: `Run \`${cliInvocation()} context materialize\` to repair it.`
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
if (pin && !readCloudConfig(home).url) {
|
|
814
|
-
checks.push({
|
|
815
|
-
name,
|
|
816
|
-
status: "warn",
|
|
817
|
-
detail: "a pin exists but OuterLayer cloud sync isn't configured \u2014 the designation cannot be confirmed",
|
|
818
|
-
fix: `Run \`${cliInvocation()} login\` to connect.`
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
if (looksGoverned) {
|
|
822
|
-
let tracked = "";
|
|
823
|
-
try {
|
|
824
|
-
tracked = execFileSync("git", ["-C", repoRoot, "ls-files", "--", "AGENTS.md", ".claude", ".outerlayer"], {
|
|
825
|
-
encoding: "utf8",
|
|
826
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
827
|
-
timeout: 2e3
|
|
828
|
-
}).trim();
|
|
829
|
-
} catch {
|
|
830
|
-
tracked = "";
|
|
831
|
-
}
|
|
832
|
-
if (tracked) {
|
|
833
|
-
const paths = tracked.split("\n");
|
|
834
|
-
const sample = paths.slice(0, 3).join(", ") + (paths.length > 3 ? ", \u2026" : "");
|
|
835
|
-
checks.push({
|
|
836
|
-
name,
|
|
837
|
-
status: "fail",
|
|
838
|
-
detail: `committed context files shadow the control plane: ${sample}`,
|
|
839
|
-
fix: `Remove the committed AGENTS.md/.claude/.outerlayer files in a commit, then run \`${cliInvocation()} context materialize\`.`
|
|
840
|
-
});
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
795
|
return checks;
|
|
844
796
|
}
|
|
845
797
|
var PROTECT_DEFAULT_BRANCH_DOCS = "https://docs.outerlayer.ai/github-app-and-build-tokens#protect-the-default-branch";
|
|
@@ -1217,7 +1169,7 @@ function doctorExitCode(checks) {
|
|
|
1217
1169
|
|
|
1218
1170
|
// src/doctor-report.ts
|
|
1219
1171
|
async function gatherDoctorChecks() {
|
|
1220
|
-
const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-
|
|
1172
|
+
const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-CLSGABD5.js');
|
|
1221
1173
|
const configPath = defaultRunnerConfigPath();
|
|
1222
1174
|
const checks = runDoctor({ runnerHost: hasRunnerBlock(configPath) });
|
|
1223
1175
|
const credential = await credentialChecks();
|
|
@@ -1229,7 +1181,7 @@ async function gatherDoctorChecks() {
|
|
|
1229
1181
|
const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
|
|
1230
1182
|
checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
|
|
1231
1183
|
} else if (hasRunnerBlock(configPath)) {
|
|
1232
|
-
const { runnerHostChecks } = await import('./doctor-
|
|
1184
|
+
const { runnerHostChecks } = await import('./doctor-DHUM5DBB.js');
|
|
1233
1185
|
const hooks = (() => {
|
|
1234
1186
|
try {
|
|
1235
1187
|
return loadRunnerConfig(configPath).hooks;
|
|
@@ -1264,7 +1216,7 @@ async function gatherDoctorChecks() {
|
|
|
1264
1216
|
const { existsSync: existsSync3 } = await import('fs');
|
|
1265
1217
|
if (process.platform !== "linux" || !existsSync3("/run/systemd/system")) return void 0;
|
|
1266
1218
|
const { inspectService, realInspectProbes } = await import('./inspect-6UYAAXH7.js');
|
|
1267
|
-
const { DEFAULT_UNIT_NAME } = await import('./install-
|
|
1219
|
+
const { DEFAULT_UNIT_NAME } = await import('./install-4SEFIIW2.js');
|
|
1268
1220
|
const { dirname: dirname2 } = await import('path');
|
|
1269
1221
|
return inspectService(DEFAULT_UNIT_NAME, dirname2(configPath), realInspectProbes());
|
|
1270
1222
|
})();
|