@outerlayer/cli 0.22.1 → 0.22.2
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 +10 -0
- package/README.md +4 -1
- package/dist/{agent-setup-LTSLXPS3.js → agent-setup-KXPDPTAJ.js} +3 -4
- package/dist/bridge-QFN3KJP6.js +8 -0
- package/dist/build-info.json +1 -1
- package/dist/{check-UYKEMQNR.js → check-N6WLZCER.js} +21 -21
- package/dist/{chunk-7FEY33MY.js → chunk-2CPOAPU4.js} +8 -8
- package/dist/{chunk-BOMRFYTZ.js → chunk-4542B3RR.js} +2 -2
- package/dist/{chunk-O6RJ3QMU.js → chunk-4OYKJJ2V.js} +1 -1
- package/dist/{chunk-QOALB6ZD.js → chunk-B42BIYC6.js} +2 -2
- package/dist/{chunk-3V5C64Y5.js → chunk-BVR6MQLS.js} +2 -3
- package/dist/{chunk-IZSVXRDR.js → chunk-DXDF43YG.js} +1 -1
- package/dist/{chunk-F7CU5ABH.js → chunk-DYEFPYME.js} +1 -1
- package/dist/{chunk-JRCSET55.js → chunk-EMUNEAQK.js} +3 -3
- package/dist/{chunk-BET347JZ.js → chunk-FQE5RDHI.js} +4 -5
- package/dist/{chunk-FRNYCJ4W.js → chunk-FVDVC2GF.js} +1 -1
- package/dist/{chunk-5QRP3MVS.js → chunk-GNPTU4BM.js} +9 -4
- package/dist/{chunk-QC72I5GQ.js → chunk-HWZCE745.js} +2 -2
- package/dist/{chunk-CUFFDEF3.js → chunk-IMCVQF5F.js} +3 -3
- package/dist/{chunk-ENTHEUKT.js → chunk-IPS2JCHK.js} +3 -3
- package/dist/{chunk-56X5TOJY.js → chunk-JD6GWYY7.js} +2 -3
- package/dist/{chunk-FOCML5FI.js → chunk-KOIMUHIS.js} +8 -7
- package/dist/chunk-QS43O4DR.js +113 -0
- package/dist/{chunk-ORNJJ7XN.js → chunk-QZX6DAAW.js} +7 -8
- package/dist/{chunk-JZGFDTNC.js → chunk-SFHR45FA.js} +19 -2
- package/dist/{chunk-6YBLN4TR.js → chunk-SNVXHNU7.js} +1 -2
- package/dist/{chunk-URAKVDSI.js → chunk-U6RKHNC7.js} +5 -6
- package/dist/{chunk-5NJIWKD4.js → chunk-WKSBSEWT.js} +2 -2
- package/dist/chunk-WXJXHZVB.js +73 -0
- package/dist/{chunk-ZPSLJFGL.js → chunk-ZCXP35T3.js} +2 -2
- package/dist/{claude-launcher-TBWV3YL3.js → claude-launcher-QD3C427Y.js} +1 -1
- package/dist/{cli-U253V422.js → cli-A2Y67WAB.js} +69 -62
- package/dist/{command-IQTPFSXY.js → command-Q5Q2EIO4.js} +8 -9
- package/dist/{connect-cmd-ZFOK6HEL.js → connect-cmd-TNGEIWCA.js} +7 -2
- package/dist/{control-plane-launch-OWSNH6YA.js → control-plane-launch-HE6OSWKO.js} +2 -3
- package/dist/{doctor-FZTS57ZO.js → doctor-BRN4BGMA.js} +10 -11
- package/dist/{emit-artifact-cmd-YLZ5WLSF.js → emit-artifact-cmd-GPAJCCUC.js} +9 -9
- package/dist/{emit-criteria-cmd-MF6TVE7C.js → emit-criteria-cmd-R3FKHSQG.js} +4 -4
- package/dist/{emit-finding-cmd-S3YMFTZT.js → emit-finding-cmd-IK7RAVP5.js} +4 -4
- package/dist/{emit-result-cmd-JHEUFTPX.js → emit-result-cmd-5FJTF7YD.js} +9 -9
- package/dist/{emit-step-cmd-TUI2T3DS.js → emit-step-cmd-VRTD5YPP.js} +5 -5
- package/dist/{governing-source-XSEIRSBE.js → governing-source-WM736XR4.js} +6 -7
- package/dist/{guest-init-DF7V5D2R.js → guest-init-2OZ4YC7R.js} +2 -1
- package/dist/{hook-fast-O3UUN6SO.js → hook-fast-QUGEI2IT.js} +1 -1
- package/dist/{hook-wrap-fast-NPLHJXFK.js → hook-wrap-fast-NOOGDNSW.js} +2 -2
- package/dist/index.js +6 -6
- package/dist/{init-VZE72CR4.js → init-U3I43XCP.js} +9 -10
- package/dist/{init-ZZZPYGUH.js → init-X7FCQDFX.js} +9 -10
- package/dist/{init-cmd-W5VV62ZN.js → init-cmd-VCKH2DUQ.js} +10 -11
- package/dist/{init-update-YFPIQS5G.js → init-update-TCMH7M3Q.js} +4 -5
- package/dist/{loop-6WENRS5S.js → loop-P3QDQOE5.js} +21 -21
- package/dist/{machine-M4MQBV5A.js → machine-EEFOW32K.js} +8 -9
- package/dist/{mcp-serve-cmd-SBW7HYKD.js → mcp-serve-cmd-TQSPFRC7.js} +2 -2
- package/dist/{runner-key-QT7GKGEE.js → runner-key-O42EUXQU.js} +9 -10
- package/dist/{session-sender-BK6TGNVO.js → session-sender-HF6DXFA2.js} +10 -10
- package/dist/{settings-J2652U5N.js → settings-AKYEOCC2.js} +1 -1
- package/dist/{spec-cmd-ZNJ3GXWC.js → spec-cmd-ADPH236D.js} +5 -5
- package/dist/{status-JOO7MGIC.js → status-LXFIVGP3.js} +16 -16
- package/dist/{statusline-fast-2OK3DVAA.js → statusline-fast-GVRSBHAF.js} +2 -2
- package/dist/{sync-cmd-W2FPY3T5.js → sync-cmd-5XS3CUV5.js} +9 -9
- package/dist/{watch-WLH5ZUZU.js → watch-FBZHZV56.js} +9 -9
- package/dist/{work-claim-cmd-4PLDTEZR.js → work-claim-cmd-LIIINECF.js} +7 -7
- package/dist/{work-cmd-KWHAYUYB.js → work-cmd-SM6DY2WK.js} +5 -5
- package/dist/{work-comment-cmd-4CUI7ZDE.js → work-comment-cmd-VYVXGT4W.js} +5 -5
- package/dist/{work-logs-cmd-AF253WLM.js → work-logs-cmd-XZSCWWMW.js} +5 -5
- package/dist/{work-open-pr-cmd-JETE6HRL.js → work-open-pr-cmd-YZNC3P3R.js} +6 -6
- package/dist/{work-pr-cmd-V5G4CPMG.js → work-pr-cmd-AMN23KFJ.js} +5 -5
- package/dist/{work-stop-cmd-FIEKUDGE.js → work-stop-cmd-HSR2GOJJ.js} +5 -5
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-amend/SKILL.md +83 -82
- package/skill-pack/maintained/outerlayer-build/SKILL.md +4 -2
- package/skill-pack/maintained/outerlayer-build/references/agent-briefs.md +10 -3
- package/skill-pack/maintained/outerlayer-build/references/release.md +7 -4
- package/skill-pack/maintained/outerlayer-build/references/review-briefs.md +6 -3
- package/skill-pack/maintained/outerlayer-cli/SKILL.md +8 -1
- package/skill-pack/maintained/outerlayer-cli/references/merge-base-branch.md +54 -0
- package/dist/chunk-NTRCK4NH.js +0 -38
- package/dist/chunk-QF7WZUU6.js +0 -56
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @outerlayer/cli
|
|
2
2
|
|
|
3
|
+
## 0.22.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c523c60: The `outerlayer-build` skill tells its agents to wait for a command that runs past the shell's timeout. A build no longer reports a mutation run as over budget while that run is still going.
|
|
8
|
+
- 2d1bbb2: The CLI names itself and its version in the `User-Agent` of every request it sends to OuterLayer, as `outerlayer-cli/<version>`.
|
|
9
|
+
- 3eae44d: `outerlayer init` keeps every other key of a hook it wraps, such as `timeout`. `outerlayer hooks unwrap` gives the hook back as you wrote it. A hook that runs no command, such as a `prompt` hook, stays as you wrote it. Before, such a hook stopped `init` before the agent setup and doctor steps. A second `init` says again to commit and push `.outerlayer/` while its files are not committed.
|
|
10
|
+
- 750d20b: The amend and build skills merge the base branch into a pull request that has a merge conflict. They no longer rebase it.
|
|
11
|
+
- 641eb3c: In a microVM build, containers and `docker build` steps reach public hosts through the runner's tunnel, under the same `allowHosts` list.
|
|
12
|
+
|
|
3
13
|
## 0.22.1
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -221,7 +221,10 @@ content:
|
|
|
221
221
|
helper from github.com, and checks each against a sha256 pinned in the CLI;
|
|
222
222
|
the requests send nothing about the host. The build reaches the network only
|
|
223
223
|
through the same tunnel a container build uses, which the runner serves on
|
|
224
|
-
Unix sockets and the guest reaches over vsock.
|
|
224
|
+
Unix sockets and the guest reaches over vsock. In a build with Docker, the
|
|
225
|
+
guest forwards the proxy connections of containers and `docker build` steps
|
|
226
|
+
from `172.17.0.1:3128` to that tunnel, so the same refusals apply to them.
|
|
227
|
+
The guest's exec agent accepts
|
|
225
228
|
connections from the host only, and the runner runs every step of the build
|
|
226
229
|
through it, including the build's command (`outerlayer vm-exec` on the host).
|
|
227
230
|
- **`outerlayer runner start` with `builtin:container` hooks** runs each
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
export { keepHandWritten, runAgentSetup } from './chunk-
|
|
3
|
+
export { keepHandWritten, runAgentSetup } from './chunk-4OYKJJ2V.js';
|
|
4
4
|
import './chunk-XCRZTXRL.js';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-SNVXHNU7.js';
|
|
6
6
|
import './chunk-USWVXQIH.js';
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-NTRCK4NH.js';
|
|
7
|
+
import './chunk-QS43O4DR.js';
|
|
9
8
|
import './chunk-ZJSNLVCE.js';
|
|
10
9
|
import './chunk-BJ3KTMDH.js';
|
|
11
10
|
import './chunk-DIB2WLBL.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
export { BRIDGE_ADDRESS, BRIDGE_CIDR, CONTAINER_NO_PROXY, CONTAINER_PROXY, TUNNEL_PORT, dockerClientConfig, startBridgeForward, writeDockerClientConfig } from './chunk-WXJXHZVB.js';
|
|
4
|
+
import './chunk-URWYRAIC.js';
|
|
5
|
+
import './chunk-GISNHSYL.js';
|
|
6
|
+
import './chunk-Z5GEFMRW.js';
|
|
7
|
+
|
|
8
|
+
createRequire(import.meta.url);
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"2026-10-
|
|
1
|
+
{"id":"2026-10-15T01:34:44.161Z+28a91ce","root":"/home/runner/_work/outerlayer/outerlayer","pkg":"outerlayer"}
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { probeCredentials } from './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
import { probeCredentials } from './chunk-2CPOAPU4.js';
|
|
4
|
+
import './chunk-KOIMUHIS.js';
|
|
5
|
+
import './chunk-UF5L4BAI.js';
|
|
5
6
|
import './chunk-3JVYMD4G.js';
|
|
6
7
|
import './chunk-I2UOAV7X.js';
|
|
7
8
|
import './chunk-YETTWTAY.js';
|
|
8
9
|
import './chunk-TPKYTORP.js';
|
|
9
10
|
import './chunk-CQAEV3Z5.js';
|
|
10
|
-
import './chunk-
|
|
11
|
-
import './chunk-
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
11
|
+
import './chunk-4542B3RR.js';
|
|
12
|
+
import './chunk-SFHR45FA.js';
|
|
13
|
+
import './chunk-WXJXHZVB.js';
|
|
14
|
+
import './chunk-U6RKHNC7.js';
|
|
15
|
+
import './chunk-JD6GWYY7.js';
|
|
15
16
|
import './chunk-ESVW4MJY.js';
|
|
16
|
-
import { placeholderQueues, placeholderProblem, permissionModeProblems, permissionModeProblem, needsClaudeCredential, claudeCredentialCheck, claimPermissionProblem, formerSkillQueues, formerSkillProblem } from './chunk-
|
|
17
|
+
import { placeholderQueues, placeholderProblem, permissionModeProblems, permissionModeProblem, needsClaudeCredential, claudeCredentialCheck, claimPermissionProblem, formerSkillQueues, formerSkillProblem } from './chunk-IPS2JCHK.js';
|
|
17
18
|
import './chunk-YYYRBYWG.js';
|
|
18
19
|
import './chunk-276D7BJ7.js';
|
|
19
20
|
import './chunk-TBT347UY.js';
|
|
20
|
-
import './chunk-
|
|
21
|
+
import './chunk-ZCXP35T3.js';
|
|
21
22
|
import './chunk-4AVDD7VX.js';
|
|
22
23
|
import './chunk-OBCFK4QD.js';
|
|
23
24
|
import { parseRunnerEnv } from './chunk-6MZSX4M7.js';
|
|
24
|
-
import './chunk-
|
|
25
|
-
import './chunk-
|
|
25
|
+
import './chunk-FVDVC2GF.js';
|
|
26
|
+
import './chunk-WKSBSEWT.js';
|
|
26
27
|
import './chunk-3AZYLAJC.js';
|
|
27
28
|
import './chunk-OGFGZQA3.js';
|
|
28
29
|
import './chunk-XR56WEA5.js';
|
|
29
30
|
import './chunk-3W333NFO.js';
|
|
30
31
|
import './chunk-NYTZ7HVN.js';
|
|
31
32
|
import './chunk-2Q3PZ42G.js';
|
|
32
|
-
import './chunk-
|
|
33
|
-
import './chunk-
|
|
34
|
-
import './chunk-
|
|
35
|
-
import './chunk-
|
|
33
|
+
import './chunk-IMCVQF5F.js';
|
|
34
|
+
import './chunk-FQE5RDHI.js';
|
|
35
|
+
import './chunk-B42BIYC6.js';
|
|
36
|
+
import './chunk-EMUNEAQK.js';
|
|
36
37
|
import './chunk-G3IJ3N6F.js';
|
|
37
38
|
import './chunk-EAQSOE62.js';
|
|
38
39
|
import './chunk-F35VMF5M.js';
|
|
@@ -41,13 +42,12 @@ import './chunk-UXYLWVTQ.js';
|
|
|
41
42
|
import './chunk-7RQ73DLO.js';
|
|
42
43
|
import './chunk-XACXXKQ5.js';
|
|
43
44
|
import './chunk-JBJTC3UU.js';
|
|
44
|
-
import './chunk-
|
|
45
|
+
import './chunk-SNVXHNU7.js';
|
|
45
46
|
import './chunk-USWVXQIH.js';
|
|
46
|
-
import './chunk-
|
|
47
|
-
import './chunk-
|
|
48
|
-
import './chunk-QC72I5GQ.js';
|
|
47
|
+
import './chunk-QS43O4DR.js';
|
|
48
|
+
import './chunk-HWZCE745.js';
|
|
49
49
|
import './chunk-ZJSNLVCE.js';
|
|
50
|
-
import './chunk-
|
|
50
|
+
import './chunk-DYEFPYME.js';
|
|
51
51
|
import './chunk-BKO6JEZI.js';
|
|
52
52
|
import './chunk-ZNPE7FW5.js';
|
|
53
53
|
import './chunk-HCVLP7XA.js';
|
|
@@ -59,7 +59,7 @@ import './chunk-ANPNT6PM.js';
|
|
|
59
59
|
import './chunk-T2Q7ISPE.js';
|
|
60
60
|
import './chunk-WZBHBH3J.js';
|
|
61
61
|
import './chunk-CRB3POP4.js';
|
|
62
|
-
import './chunk-
|
|
62
|
+
import './chunk-GNPTU4BM.js';
|
|
63
63
|
import './chunk-YQR6E6OV.js';
|
|
64
64
|
import './chunk-TUSYOL2O.js';
|
|
65
65
|
import './chunk-WFSUUUAN.js';
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { releaseLease, isUnfinished, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, hostCommandEnvironment, execArgv, microVmCommandLine, runCommand, commandLogOffset, execCommandLine, startSender, startHostServices, finishJob, isContainerTracked, probeCommand, appendCommandLog, judgeProbe, EXIT_CODE_FILE, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, hookLimitsFor, AttemptLogBook, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, listTrackedJobs, restartSender, ALREADY_RELEASED } from './chunk-
|
|
3
|
+
import { releaseLease, isUnfinished, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, hostCommandEnvironment, execArgv, microVmCommandLine, runCommand, commandLogOffset, execCommandLine, startSender, startHostServices, finishJob, isContainerTracked, probeCommand, appendCommandLog, judgeProbe, EXIT_CODE_FILE, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, hookLimitsFor, AttemptLogBook, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, listTrackedJobs, restartSender, ALREADY_RELEASED } from './chunk-KOIMUHIS.js';
|
|
4
|
+
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-UF5L4BAI.js';
|
|
4
5
|
import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
|
|
5
6
|
import { compareVersions, satisfiesRange } from './chunk-I2UOAV7X.js';
|
|
6
7
|
import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-YETTWTAY.js';
|
|
7
8
|
import { RUNNER_PROTOCOL } from './chunk-TPKYTORP.js';
|
|
8
9
|
import { writePendingUpdate } from './chunk-CQAEV3Z5.js';
|
|
9
|
-
import {
|
|
10
|
-
import { currentSkillCommand, formerSkillProblem, placeholderQueues, placeholderProblem } from './chunk-ENTHEUKT.js';
|
|
10
|
+
import { currentSkillCommand, formerSkillProblem, placeholderQueues, placeholderProblem } from './chunk-IPS2JCHK.js';
|
|
11
11
|
import { freeBytes, formatBytes } from './chunk-YYYRBYWG.js';
|
|
12
12
|
import { writeMarker, readMarker, currentVersion, removeMarker, entryIn, versionDir, startedThroughCurrent, switchCurrent, cleanVersions, isInLayout, stagingDir } from './chunk-276D7BJ7.js';
|
|
13
13
|
import { RepoFilter } from './chunk-TBT347UY.js';
|
|
14
14
|
import { checkFit } from './chunk-OBCFK4QD.js';
|
|
15
|
-
import { LEASE_SECONDS, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, lifecycleSteps, lifecycleFailureReason, prepareBranch, containerCommandExec, measureDisk, setUpRunnerCgroup, createContainerRuntime, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied } from './chunk-
|
|
15
|
+
import { LEASE_SECONDS, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, lifecycleSteps, lifecycleFailureReason, prepareBranch, containerCommandExec, measureDisk, setUpRunnerCgroup, createContainerRuntime, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied } from './chunk-WKSBSEWT.js';
|
|
16
16
|
import { writeJobFile, ensureRunnerIdentity, readJobFile, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun, BUILD_LABEL, RUNNER_LABEL, readJobFileChecked } from './chunk-XR56WEA5.js';
|
|
17
|
-
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-
|
|
18
|
-
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-
|
|
17
|
+
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-IMCVQF5F.js';
|
|
18
|
+
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-FQE5RDHI.js';
|
|
19
19
|
import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-V5CG75NX.js';
|
|
20
20
|
import { exceedsDisk } from './chunk-7RQ73DLO.js';
|
|
21
21
|
import { claimPidFile, readPidFile, releasePidFile } from './chunk-XACXXKQ5.js';
|
|
@@ -1552,7 +1552,7 @@ var CLAIM_REFUSAL_CODES = new Set(
|
|
|
1552
1552
|
"pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected repository_not_reachable branch_claimed_elsewhere".split(" ")
|
|
1553
1553
|
);
|
|
1554
1554
|
async function tryClaimAndStart(state, item, queue) {
|
|
1555
|
-
const { postJson: postJson2 } = await import('./work-cmd-
|
|
1555
|
+
const { postJson: postJson2 } = await import('./work-cmd-SM6DY2WK.js');
|
|
1556
1556
|
const log = logOf(state);
|
|
1557
1557
|
const hostKey = await loadHostKey(state.config.configPath);
|
|
1558
1558
|
const claim = await retrySend(
|
|
@@ -2521,7 +2521,7 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
|
|
|
2521
2521
|
const outcome = await onStartUnderMarker({
|
|
2522
2522
|
configPath,
|
|
2523
2523
|
own: ownVersionOf(deps),
|
|
2524
|
-
check: update.check ? () => update.check(configPath) : async () => (await import('./check-
|
|
2524
|
+
check: update.check ? () => update.check(configPath) : async () => (await import('./check-N6WLZCER.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl }),
|
|
2525
2525
|
now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
|
|
2526
2526
|
log
|
|
2527
2527
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { LiveUploader } from './chunk-
|
|
4
|
-
import { spoolDir } from './chunk-
|
|
3
|
+
import { LiveUploader } from './chunk-U6RKHNC7.js';
|
|
4
|
+
import { spoolDir } from './chunk-HWZCE745.js';
|
|
5
5
|
import { CaptureDaemon } from './chunk-AEKSX4EY.js';
|
|
6
6
|
import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
|
|
7
7
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { runEmit } from './chunk-XCRZTXRL.js';
|
|
4
|
-
import { resolveGitCommonDir, defaultGitRunner } from './chunk-
|
|
4
|
+
import { resolveGitCommonDir, defaultGitRunner } from './chunk-SNVXHNU7.js';
|
|
5
5
|
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-DIB2WLBL.js';
|
|
6
6
|
import { installStarterPack } from './chunk-V7SAQ645.js';
|
|
7
7
|
import { loadTemplateFiles, loadMaintainedFiles, skillDir } from './chunk-5OCIHFGE.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-
|
|
4
|
-
import { resolveGatewayCredentials } from './chunk-
|
|
3
|
+
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-EMUNEAQK.js';
|
|
4
|
+
import { resolveGatewayCredentials } from './chunk-QS43O4DR.js';
|
|
5
5
|
import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
6
6
|
import { resolveRepoIdentity } from './chunk-AEKSX4EY.js';
|
|
7
7
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { autoConnect, detectActiveSession } from './chunk-
|
|
4
|
-
import { defaultFetch } from './chunk-
|
|
5
|
-
import { unauthorizedMessage, resolveGatewayCredentials } from './chunk-NTRCK4NH.js';
|
|
3
|
+
import { autoConnect, detectActiveSession } from './chunk-B42BIYC6.js';
|
|
4
|
+
import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-QS43O4DR.js';
|
|
6
5
|
import { resolveRepoIdentity } from './chunk-AEKSX4EY.js';
|
|
7
6
|
import { C } from './chunk-ANPNT6PM.js';
|
|
8
7
|
import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { recordReportedCost } from './chunk-BKO6JEZI.js';
|
|
4
4
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
5
|
-
import { decodeWrappedCommand } from './chunk-
|
|
5
|
+
import { decodeWrappedCommand } from './chunk-GNPTU4BM.js';
|
|
6
6
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
7
7
|
import { readFileSync } from 'fs';
|
|
8
8
|
import { spawn } from 'child_process';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { decodeWrappedCommand } from './chunk-
|
|
3
|
+
import { decodeWrappedCommand } from './chunk-GNPTU4BM.js';
|
|
4
4
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
5
5
|
import { readFileSync, mkdirSync, appendFileSync, writeFileSync } from 'fs';
|
|
6
6
|
import { spawn } from 'child_process';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { sanitizeTerminal } from './chunk-G3IJ3N6F.js';
|
|
4
4
|
import { DEFAULT_DASHBOARD } from './chunk-EAQSOE62.js';
|
|
5
|
-
import { resolveGatewayCredentials } from './chunk-
|
|
5
|
+
import { cliFetch, resolveGatewayCredentials } from './chunk-QS43O4DR.js';
|
|
6
6
|
import { writeRepoConnection, findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
7
7
|
import { remoteLookupFailed } from './chunk-AEKSX4EY.js';
|
|
8
8
|
import { readCloudConfig } from './chunk-EABW6AJQ.js';
|
|
@@ -89,7 +89,7 @@ function result(code, outcome, reason, text) {
|
|
|
89
89
|
` };
|
|
90
90
|
}
|
|
91
91
|
function realConnectDeps() {
|
|
92
|
-
return { fetchImpl:
|
|
92
|
+
return { fetchImpl: cliFetch, env: process.env, prompt: promptOnTerminal, now: () => /* @__PURE__ */ new Date() };
|
|
93
93
|
}
|
|
94
94
|
async function promptOnTerminal(question, io = { input: process.stdin, output: process.stderr }) {
|
|
95
95
|
const rl = createInterface(io);
|
|
@@ -315,4 +315,4 @@ ${COMMIT_LINE}
|
|
|
315
315
|
return r.code;
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
export { COMMIT_LINE, autoConnectedLine, dashboardBase, fetchFactories, isLinkedRepository, listText, promptOnTerminal, realConnectDeps, runConnect, runConnectCommand, saveFactoryConnection, selectFactory, slug, workPageUrl };
|
|
318
|
+
export { COMMIT_LINE, autoConnectedLine, dashboardBase, fetchFactories, hasUncommittedPolicy, isLinkedRepository, listText, promptOnTerminal, realConnectDeps, runConnect, runConnectCommand, saveFactoryConnection, selectFactory, slug, workPageUrl };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { detectActiveSession, autoConnect } from './chunk-
|
|
4
|
-
import { workPageUrl } from './chunk-
|
|
3
|
+
import { detectActiveSession, autoConnect } from './chunk-B42BIYC6.js';
|
|
4
|
+
import { workPageUrl } from './chunk-EMUNEAQK.js';
|
|
5
5
|
import { sanitizeTerminal } from './chunk-G3IJ3N6F.js';
|
|
6
|
-
import { defaultFetch } from './chunk-
|
|
7
|
-
import { resolveGatewayCredentials, unauthorizedMessage } from './chunk-NTRCK4NH.js';
|
|
6
|
+
import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-QS43O4DR.js';
|
|
8
7
|
import { readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
9
8
|
import { resolveRepoIdentity } from './chunk-AEKSX4EY.js';
|
|
10
9
|
import { C } from './chunk-ANPNT6PM.js';
|
|
@@ -428,7 +427,7 @@ async function runWorkLinkSession(opts) {
|
|
|
428
427
|
return await linkSession(opts);
|
|
429
428
|
} catch (err) {
|
|
430
429
|
if (opts.logFailures) {
|
|
431
|
-
const { logHookError } = await import('./hook-fast-
|
|
430
|
+
const { logHookError } = await import('./hook-fast-QUGEI2IT.js');
|
|
432
431
|
const reason = err instanceof Error ? err.message : String(err);
|
|
433
432
|
logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
|
|
434
433
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { MIN_ENGINE_MAJOR } from './chunk-
|
|
3
|
+
import { MIN_ENGINE_MAJOR } from './chunk-WKSBSEWT.js';
|
|
4
4
|
import { firecrackerArch, MICROVM_ARCHES, guestAssetsPinned } from './chunk-3W333NFO.js';
|
|
5
5
|
import { spawnSync } from 'child_process';
|
|
6
6
|
import { existsSync, accessSync, constants, statSync, readFileSync } from 'fs';
|
|
@@ -220,13 +220,16 @@ function encodeWrappedCommand(command) {
|
|
|
220
220
|
function decodeWrappedCommand(id) {
|
|
221
221
|
return Buffer.from(id, "base64").toString("utf8");
|
|
222
222
|
}
|
|
223
|
+
function runsCommand(h) {
|
|
224
|
+
return typeof h.command === "string";
|
|
225
|
+
}
|
|
223
226
|
function listHookCandidates(settings, cliBin) {
|
|
224
227
|
const out = [];
|
|
225
228
|
const hooks = settings?.hooks ?? {};
|
|
226
229
|
for (const event of Object.keys(hooks)) {
|
|
227
230
|
(hooks[event] ?? []).forEach((matcher, matcherIndex) => {
|
|
228
231
|
matcher.hooks.forEach((h, hookIndex) => {
|
|
229
|
-
if (isOurHookCommandFor(h, cliBin)) return;
|
|
232
|
+
if (!runsCommand(h) || isOurHookCommandFor(h, cliBin)) return;
|
|
230
233
|
const original = wrappedOriginalCommand(h, cliBin);
|
|
231
234
|
out.push({
|
|
232
235
|
event,
|
|
@@ -245,12 +248,14 @@ function wrapHookCommand(cliBin, h, opts = {}) {
|
|
|
245
248
|
if (isWrapped(h, cliBin)) return h;
|
|
246
249
|
const id = encodeWrappedCommand(h.command);
|
|
247
250
|
const flag = opts.captureOutput ? " --capture-output" : "";
|
|
248
|
-
return {
|
|
251
|
+
return { ...h, command: `${cliCommand(cliBin)} hook-wrap --id ${id}${flag}`, [WRAP_MARKER]: h.command };
|
|
249
252
|
}
|
|
250
253
|
function unwrapHookCommand(h, cliBin) {
|
|
251
254
|
const original = wrappedOriginalCommand(h, cliBin);
|
|
252
255
|
if (original === null) return h;
|
|
253
|
-
|
|
256
|
+
const restored = { ...h, command: original };
|
|
257
|
+
delete restored[WRAP_MARKER];
|
|
258
|
+
return restored;
|
|
254
259
|
}
|
|
255
260
|
var AUTO_WRAP_EVENTS = ["PreToolUse", "PostToolUse"];
|
|
256
261
|
function wrapHooks(settings, cliBin, opts = {}) {
|
|
@@ -268,7 +273,7 @@ function wrapHooks(settings, cliBin, opts = {}) {
|
|
|
268
273
|
const matcher = matchers[mi];
|
|
269
274
|
for (let hi = 0; hi < matcher.hooks.length; hi++) {
|
|
270
275
|
const h = matcher.hooks[hi];
|
|
271
|
-
if (isOurHookCommandFor(h, cliBin) || isWrapped(h, cliBin)) continue;
|
|
276
|
+
if (!runsCommand(h) || isOurHookCommandFor(h, cliBin) || isWrapped(h, cliBin)) continue;
|
|
272
277
|
const candidate = {
|
|
273
278
|
event,
|
|
274
279
|
matcherIndex: mi,
|
|
@@ -429,7 +429,7 @@ async function handleWorkLaunch(sessionId, home, env, spawnImpl = spawnDetached,
|
|
|
429
429
|
}
|
|
430
430
|
async function missingRenewalHookContext(home, cwd) {
|
|
431
431
|
try {
|
|
432
|
-
const { settingsPath, readSettings, isOurHookCommand } = await import('./settings-
|
|
432
|
+
const { settingsPath, readSettings, isOurHookCommand } = await import('./settings-AKYEOCC2.js');
|
|
433
433
|
const userSettings = readSettings(settingsPath("user", { home }));
|
|
434
434
|
const projectSettings = readSettings(settingsPath("project", { cwd }));
|
|
435
435
|
if (userSettings === null && projectSettings === null) return void 0;
|
|
@@ -628,7 +628,7 @@ async function missingControlPlane(cwd, sessionId, home, env) {
|
|
|
628
628
|
cleanupEarlierCopies(dirs);
|
|
629
629
|
}
|
|
630
630
|
if (!contextPossiblyGoverned(cwd, home)) return void 0;
|
|
631
|
-
const { governanceOf } = await import('./control-plane-launch-
|
|
631
|
+
const { governanceOf } = await import('./control-plane-launch-HE6OSWKO.js');
|
|
632
632
|
if (await governanceOf({ cwd, env, home }) !== "governed") return void 0;
|
|
633
633
|
recordMissingContext(dirs, sessionId, home);
|
|
634
634
|
const launcher = `${cliInvocation()} claude`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { WorkCommandError, postJson } from './chunk-
|
|
4
|
-
import { defaultGitRunner, materializeContext, isStagingWriteFault, lookupGoverningSource } from './chunk-
|
|
5
|
-
import { signingFetchFor } from './chunk-
|
|
3
|
+
import { WorkCommandError, postJson } from './chunk-FQE5RDHI.js';
|
|
4
|
+
import { defaultGitRunner, materializeContext, isStagingWriteFault, lookupGoverningSource } from './chunk-SNVXHNU7.js';
|
|
5
|
+
import { signingFetchFor } from './chunk-QS43O4DR.js';
|
|
6
6
|
import { unsupportedLayout, layoutRefusalReason, composeDelivery } from './chunk-ZNPE7FW5.js';
|
|
7
7
|
import { SHIM_SCRIPT, GOVERNANCE_VARIABLE } from './chunk-HCVLP7XA.js';
|
|
8
8
|
import { readDegraded, readContextManifest, readSourceCache } from './chunk-YQR6E6OV.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
3
|
+
import { isPlaceholderCommand } from './chunk-ZCXP35T3.js';
|
|
4
|
+
import { describeCallFailure } from './chunk-IMCVQF5F.js';
|
|
5
|
+
import { WorkCommandError, getJson } from './chunk-FQE5RDHI.js';
|
|
6
6
|
import { sanitizeTerminal } from './chunk-G3IJ3N6F.js';
|
|
7
7
|
import { builtinKind } from './chunk-V5CG75NX.js';
|
|
8
8
|
import { signerFor } from './chunk-OW52QLK3.js';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
|
|
4
|
-
import { autoConnect, detectActiveSession } from './chunk-
|
|
4
|
+
import { autoConnect, detectActiveSession } from './chunk-B42BIYC6.js';
|
|
5
5
|
import { acquireSpoolLockAt } from './chunk-G3IJ3N6F.js';
|
|
6
|
-
import { defaultFetch } from './chunk-
|
|
7
|
-
import { resolveGatewayCredentials, unauthorizedMessage } from './chunk-NTRCK4NH.js';
|
|
6
|
+
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-QS43O4DR.js';
|
|
8
7
|
import { resolveRepoIdentity } from './chunk-AEKSX4EY.js';
|
|
9
8
|
import { C } from './chunk-ANPNT6PM.js';
|
|
10
9
|
import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { senderPidfile } from './chunk-
|
|
4
|
-
import { DOCKERD_LOG, HELPER_PATH, HELPER_RECORD } from './chunk-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { senderPidfile } from './chunk-4542B3RR.js';
|
|
4
|
+
import { DOCKERD_LOG, HELPER_PATH, HELPER_RECORD } from './chunk-SFHR45FA.js';
|
|
5
|
+
import { writeDockerClientConfig } from './chunk-WXJXHZVB.js';
|
|
6
|
+
import { installScrubContext } from './chunk-U6RKHNC7.js';
|
|
7
|
+
import { ADDED_USER, AssetError, obtainImage, ensureRootfs, gitRemoteFor, startServicesFor, createBuildDisk, machineConfig, resolveAgentUser, AgentUserError, runBuildSteps, shellQuote, LEASE_SECONDS, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, containerSenderCommand, signalInContainer, syncInContainer, copyTranscriptsFromContainer, senderAliveScript, GH_CONFIG_YML, ghHostsYml, isLiteralAddress, deleteBuildDisk, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript, containerJudgeEnvironment, copyJudgeTree } from './chunk-WKSBSEWT.js';
|
|
7
8
|
import { readBranchHead, fetchCommit, diffBetween } from './chunk-3AZYLAJC.js';
|
|
8
9
|
import { HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, COMMAND_DIR, childEnvironment, judgeCommand, JUDGE_MAX_TURNS, MAX_REPORT_BYTES, JUDGE_DIR } from './chunk-XR56WEA5.js';
|
|
9
10
|
import { CLAUDE_CODE_VERSION } from './chunk-3W333NFO.js';
|
|
10
11
|
import { waitForAgent, vmExecArgs } from './chunk-NYTZ7HVN.js';
|
|
11
12
|
import { socketPathProblem, vsockLinks, linkVsockSockets } from './chunk-2Q3PZ42G.js';
|
|
12
|
-
import { describeCallFailure, resolveGoverningSource, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, formatDuration, retrySend, formatClock } from './chunk-
|
|
13
|
-
import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-
|
|
13
|
+
import { describeCallFailure, resolveGoverningSource, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, formatDuration, retrySend, formatClock } from './chunk-IMCVQF5F.js';
|
|
14
|
+
import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-FQE5RDHI.js';
|
|
14
15
|
import { planArtifactUpload } from './chunk-G3IJ3N6F.js';
|
|
15
16
|
import { isBuiltinContainer, isBuiltinProcess, isBuiltinVm, DEFAULT_CHECK_TIME_LIMIT_MINUTES } from './chunk-V5CG75NX.js';
|
|
16
17
|
import { parseSize } from './chunk-7RQ73DLO.js';
|
|
@@ -413,7 +414,7 @@ async function waitForDocker(runtime, state, agentUser, now) {
|
|
|
413
414
|
if (firstLine(granted.stderr) !== "") lastError = `giving the agent's group the Docker socket failed: ${firstLine(granted.stderr)}`;
|
|
414
415
|
} else {
|
|
415
416
|
const answered = await runtime.vm.exec(state.vsockPath, request);
|
|
416
|
-
if (answered.status === 0) return
|
|
417
|
+
if (answered.status === 0) return writeDockerClientConfig(asRoot.bind(null, runtime, state), agentUser);
|
|
417
418
|
lastError = firstLine(answered.stderr) === "" ? "" : `docker info said: ${firstLine(answered.stderr)}`;
|
|
418
419
|
}
|
|
419
420
|
if (now().getTime() >= deadline) break;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
4
|
+
import { readCloudConfig, cloudConfigPath } from './chunk-EABW6AJQ.js';
|
|
5
|
+
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
6
|
+
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
7
|
+
import { resolvePackageVersion } from './chunk-RA3O54FC.js';
|
|
8
|
+
import { signRunnerRequest, signerFor } from './chunk-OW52QLK3.js';
|
|
9
|
+
|
|
10
|
+
createRequire(import.meta.url);
|
|
11
|
+
|
|
12
|
+
// src/credentials.ts
|
|
13
|
+
var MISSING_HELP = `Run \`${cliInvocation()} login\` to sign in, or set OUTERLAYER_URL / OUTERLAYER_API_KEY / OUTERLAYER_APP_ID. Mint a key in the dashboard: Settings \u2192 API keys.`;
|
|
14
|
+
var NO_FACTORY_MESSAGE = `you are logged in, but no factory is chosen for this repository. Run \`${cliInvocation()} connect\` to choose one, or pass --app-id / set OUTERLAYER_APP_ID.`;
|
|
15
|
+
var NO_FACTORY_OUTSIDE_REPOSITORY_MESSAGE = "you are logged in, but this directory is not in a git repository, so no factory is chosen. Pass --app-id / set OUTERLAYER_APP_ID, or run this from inside a connected repository.";
|
|
16
|
+
var LOGIN_TOKEN_PREFIX = "olu_";
|
|
17
|
+
function unauthorizedMessage(credential) {
|
|
18
|
+
return credential.startsWith(LOGIN_TOKEN_PREFIX) ? `not authorized \u2014 the login is expired or was revoked. Run \`${cliInvocation()} login\` to sign in again.` : "not authorized \u2014 the API key is unknown, expired, or bound to a different factory. Mint a fresh key: dashboard \u2192 Settings \u2192 API keys.";
|
|
19
|
+
}
|
|
20
|
+
function resolveGatewayCredentials(sources = {}) {
|
|
21
|
+
const env = sources.env ?? process.env;
|
|
22
|
+
const config = readCloudConfig(sources.home ?? homeFromEnv(env));
|
|
23
|
+
const url = sources.url ?? env.OUTERLAYER_URL ?? config.url;
|
|
24
|
+
const key = sources.apiKey ?? (env.OUTERLAYER_API_KEY || void 0) ?? config.apiKey;
|
|
25
|
+
const kind = key ? "key" : "login";
|
|
26
|
+
const credential = key ?? config.accountToken;
|
|
27
|
+
const cwd = sources.cwd ?? process.cwd();
|
|
28
|
+
const appId = sources.appId ?? (env.OUTERLAYER_APP_ID || void 0) ?? (kind === "key" ? config.appId : readRepoConnection(cwd)?.appId);
|
|
29
|
+
if (credential && url && !appId && kind === "login") {
|
|
30
|
+
const message = findGitDirs(cwd) === void 0 ? NO_FACTORY_OUTSIDE_REPOSITORY_MESSAGE : NO_FACTORY_MESSAGE;
|
|
31
|
+
return { ok: false, message, url, credential, appId, kind };
|
|
32
|
+
}
|
|
33
|
+
if (!url || !credential || !appId) {
|
|
34
|
+
const missing = [!url && "--url", !credential && "a login or OUTERLAYER_API_KEY", !appId && "--app-id"].filter(Boolean).join(", ");
|
|
35
|
+
return { ok: false, message: `missing ${missing}. ${MISSING_HELP}`, url, credential, appId, kind };
|
|
36
|
+
}
|
|
37
|
+
return { ok: true, url, credential, appId, kind };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// src/signing-fetch.ts
|
|
41
|
+
function bodyBytes(body) {
|
|
42
|
+
if (body === void 0 || body === null) return new Uint8Array(0);
|
|
43
|
+
if (typeof body === "string") return new TextEncoder().encode(body);
|
|
44
|
+
if (body instanceof Uint8Array) return body;
|
|
45
|
+
if (body instanceof ArrayBuffer) return new Uint8Array(body);
|
|
46
|
+
return void 0;
|
|
47
|
+
}
|
|
48
|
+
async function savedKeySigner(headers, home) {
|
|
49
|
+
const authorization = headers.get("authorization");
|
|
50
|
+
if (authorization === null || !authorization.startsWith("Bearer ")) return void 0;
|
|
51
|
+
if (headers.has("signature")) return void 0;
|
|
52
|
+
if (readCloudConfig(home).apiKey !== authorization.slice("Bearer ".length)) return void 0;
|
|
53
|
+
try {
|
|
54
|
+
return await signerFor(cloudConfigPath(home));
|
|
55
|
+
} catch {
|
|
56
|
+
return void 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function signedBy(base, signerOf) {
|
|
60
|
+
return (async (input, init) => {
|
|
61
|
+
if (input instanceof Request) return base(input, init);
|
|
62
|
+
const headers = new Headers(init?.headers);
|
|
63
|
+
const signer = await signerOf(headers);
|
|
64
|
+
const body = bodyBytes(init?.body);
|
|
65
|
+
if (signer === void 0 || body === void 0) return base(input, init);
|
|
66
|
+
const signature = await signRunnerRequest({ method: init?.method ?? "GET", url: input.toString(), body, signer });
|
|
67
|
+
for (const [name, value] of Object.entries(signature)) headers.set(name, value);
|
|
68
|
+
return base(input, { ...init, headers });
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function signingFetch(base, home = () => homeFromEnv()) {
|
|
72
|
+
return signedBy(base, (headers) => savedKeySigner(headers, home()));
|
|
73
|
+
}
|
|
74
|
+
function signingFetchFor(base, configPath, apiKey) {
|
|
75
|
+
return signedBy(base, async (headers) => {
|
|
76
|
+
const authorization = headers.get("authorization");
|
|
77
|
+
if (authorization !== `Bearer ${apiKey}` || headers.has("signature")) return void 0;
|
|
78
|
+
try {
|
|
79
|
+
return await signerFor(configPath);
|
|
80
|
+
} catch {
|
|
81
|
+
return void 0;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function cliUserAgent(version = resolvePackageVersion()) {
|
|
86
|
+
return `outerlayer-cli/${version}`;
|
|
87
|
+
}
|
|
88
|
+
function withHeader(headers, name, value) {
|
|
89
|
+
if (headers instanceof Headers) {
|
|
90
|
+
if (headers.has(name)) return headers;
|
|
91
|
+
const copy = new Headers(headers);
|
|
92
|
+
copy.set(name, value);
|
|
93
|
+
return copy;
|
|
94
|
+
}
|
|
95
|
+
if (Array.isArray(headers)) {
|
|
96
|
+
return headers.some(([key]) => key.toLowerCase() === name) ? headers : [...headers, [name, value]];
|
|
97
|
+
}
|
|
98
|
+
const record = headers ?? {};
|
|
99
|
+
return Object.keys(record).some((key) => key.toLowerCase() === name) ? record : { ...record, [name]: value };
|
|
100
|
+
}
|
|
101
|
+
function withCliUserAgent(base, userAgent = () => cliUserAgent()) {
|
|
102
|
+
return ((input, init) => {
|
|
103
|
+
if (input instanceof Request) return base(input, init);
|
|
104
|
+
return base(input, { ...init, headers: withHeader(init?.headers, "user-agent", userAgent()) });
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function globalFetch(input, init) {
|
|
108
|
+
return globalThis.fetch(input, init);
|
|
109
|
+
}
|
|
110
|
+
var cliFetch = withCliUserAgent(globalFetch);
|
|
111
|
+
var defaultFetch = signingFetch(cliFetch);
|
|
112
|
+
|
|
113
|
+
export { cliFetch, defaultFetch, resolveGatewayCredentials, signingFetchFor, unauthorizedMessage };
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { checkStarterFiles, contextIsGoverned, checkBuildSkill } from './chunk-VSUXCMMH.js';
|
|
4
|
-
import { resolveCredentials, getJson, WorkCommandError } from './chunk-
|
|
5
|
-
import { isLinkedRepository } from './chunk-
|
|
4
|
+
import { resolveCredentials, getJson, WorkCommandError } from './chunk-FQE5RDHI.js';
|
|
5
|
+
import { isLinkedRepository } from './chunk-EMUNEAQK.js';
|
|
6
6
|
import { sanitizeTerminal } from './chunk-G3IJ3N6F.js';
|
|
7
7
|
import { checkFormerSkillNames } from './chunk-USWVXQIH.js';
|
|
8
|
-
import { defaultFetch } from './chunk-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { readStatuslineState, STATE_FRESH_MS } from './chunk-IZSVXRDR.js';
|
|
8
|
+
import { resolveGatewayCredentials, defaultFetch } from './chunk-QS43O4DR.js';
|
|
9
|
+
import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-HWZCE745.js';
|
|
10
|
+
import { readStatuslineState, STATE_FRESH_MS } from './chunk-DXDF43YG.js';
|
|
12
11
|
import { hookCommandEscapesControlPlane, CONTROL_PLANE_DIR_VARIABLE } from './chunk-HCVLP7XA.js';
|
|
13
12
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
14
13
|
import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-AEKSX4EY.js';
|
|
15
14
|
import { C } from './chunk-ANPNT6PM.js';
|
|
16
15
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
17
|
-
import { readSettings, settingsPath, isOurStatuslineSlot, statuslineWrappedOriginal, REGISTERED_EVENTS, isOurHookCommand, ourCommandBins, cliBinResolvable, ourDirectScriptBins, wrappedOriginalCommand } from './chunk-
|
|
16
|
+
import { readSettings, settingsPath, isOurStatuslineSlot, statuslineWrappedOriginal, REGISTERED_EVENTS, isOurHookCommand, ourCommandBins, cliBinResolvable, ourDirectScriptBins, wrappedOriginalCommand } from './chunk-GNPTU4BM.js';
|
|
18
17
|
import { readDeliveryRecord, readDegraded, readSourceCache } from './chunk-YQR6E6OV.js';
|
|
19
18
|
import { deadHooksState, preparePackageManagerCommand } from './chunk-TUSYOL2O.js';
|
|
20
19
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
@@ -1187,7 +1186,7 @@ async function gatherDoctorChecks() {
|
|
|
1187
1186
|
const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
|
|
1188
1187
|
checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
|
|
1189
1188
|
} else if (hasRunnerBlock(configPath)) {
|
|
1190
|
-
const { runnerHostChecks } = await import('./doctor-
|
|
1189
|
+
const { runnerHostChecks } = await import('./doctor-BRN4BGMA.js');
|
|
1191
1190
|
const hooks = (() => {
|
|
1192
1191
|
try {
|
|
1193
1192
|
return loadRunnerConfig(configPath).hooks;
|