@outerlayer/cli 0.16.1 → 0.18.0
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 +64 -0
- package/README.md +26 -11
- package/dist/agent-setup-RBTEACYU.js +28 -0
- package/dist/artifact-link-cmd-AVM2EKTV.js +25 -0
- package/dist/{build-BG2YENGK.js → build-TQ6X5PYN.js} +5 -4
- package/dist/build-info.json +1 -1
- package/dist/{builder-2D3WSOOY.js → builder-DUI2ZH2H.js} +5 -6
- package/dist/{check-CNTMSGOG.js → check-5C4YDZYV.js} +53 -50
- package/dist/{chunk-R7PF5OOU.js → chunk-3CWUOFV6.js} +21 -14
- package/dist/{chunk-R4ZQQ7U2.js → chunk-3OFZM4X6.js} +551 -72
- package/dist/{chunk-2MNPHL23.js → chunk-47TTLEDX.js} +6 -5
- package/dist/{chunk-PLMTLGYH.js → chunk-52NC2FIU.js} +4 -3
- package/dist/chunk-6CHIYEZZ.js +564 -0
- package/dist/{chunk-TI7B7UEO.js → chunk-AMFWYESY.js} +1 -1
- package/dist/{chunk-YRYMNBGQ.js → chunk-ANPNT6PM.js} +2 -1
- package/dist/{chunk-JJEGKEFV.js → chunk-B3UKB46N.js} +6 -6
- package/dist/{chunk-JXYVA45C.js → chunk-BMYGAGBJ.js} +1050 -304
- package/dist/{chunk-4Q7OMKAT.js → chunk-BQXFBI7T.js} +81 -5
- package/dist/chunk-CRB3POP4.js +34 -0
- package/dist/{chunk-F47JBIAW.js → chunk-DSF2FWAZ.js} +2 -1
- package/dist/{chunk-N5FOE5PS.js → chunk-ECODQ7II.js} +4 -33
- package/dist/{chunk-NBGDBTO2.js → chunk-ESC6UR76.js} +6 -5
- package/dist/{chunk-HHJDN6AU.js → chunk-ESVW4MJY.js} +1 -1
- package/dist/{chunk-42ZI52JW.js → chunk-F4XSVQJ4.js} +4 -3
- package/dist/{chunk-FWX735W7.js → chunk-FUB7LRUE.js} +7 -7
- package/dist/chunk-G2YNJIGF.js +44 -0
- package/dist/{chunk-QKFB4K7X.js → chunk-GGOMT6KF.js} +1 -1
- package/dist/{chunk-CA3XMYFN.js → chunk-GOBOJMOJ.js} +6 -6
- package/dist/{chunk-N6LURUEF.js → chunk-GOSFARMS.js} +1 -1
- package/dist/chunk-JBJTC3UU.js +35 -0
- package/dist/{chunk-U3HXXRTY.js → chunk-JF42URPU.js} +16 -15
- package/dist/{chunk-ADJRGVZC.js → chunk-KDVIU23F.js} +1 -1
- package/dist/{chunk-6QRMLNH3.js → chunk-KK4VBOH6.js} +93 -37
- package/dist/{chunk-KMDLFI4P.js → chunk-L2USZT6T.js} +1 -1
- package/dist/{chunk-WTE3MQML.js → chunk-LXAY4A2G.js} +3 -12
- package/dist/{chunk-V7NIVOFD.js → chunk-M2ZWWTWZ.js} +1 -1
- package/dist/{chunk-ERI5GBNI.js → chunk-MLAAT4S6.js} +3 -3
- package/dist/{chunk-POJMEEJJ.js → chunk-MNTSH4CL.js} +1 -1
- package/dist/{chunk-WUYTWNMA.js → chunk-MQJSXHV7.js} +1 -1
- package/dist/{chunk-O765JR4W.js → chunk-MTP2QEVO.js} +1 -1
- package/dist/{chunk-ZM2IMMYN.js → chunk-N2PXGQRL.js} +9 -1
- package/dist/{chunk-J5M7BSJQ.js → chunk-N3CUDFCW.js} +9 -3
- package/dist/{chunk-4KSQKQXE.js → chunk-NACDBXUG.js} +19 -15
- package/dist/{chunk-RSPXEVDX.js → chunk-NL4XPC7W.js} +1 -1
- package/dist/{chunk-EHAAPRWY.js → chunk-QQM2UJ6T.js} +31 -26
- package/dist/{chunk-5FEK6PNE.js → chunk-RAZTWYZN.js} +10 -9
- package/dist/{chunk-4NPZVMJU.js → chunk-S26M3YBJ.js} +60 -4
- package/dist/{chunk-UGP76IZ5.js → chunk-S5PCA3SN.js} +1 -1
- package/dist/{chunk-YDSMROTB.js → chunk-S76AYB4M.js} +25 -20
- package/dist/{chunk-RMWLBUCJ.js → chunk-SADUQSO4.js} +1 -1
- package/dist/{chunk-OZGHL5Y5.js → chunk-SWCTGCSC.js} +2 -2
- package/dist/{chunk-GQD22KKN.js → chunk-T2Q7ISPE.js} +2 -1
- package/dist/{chunk-C5Y5ZJJZ.js → chunk-T4Y6SCG3.js} +5 -4
- package/dist/{chunk-6JNURGOA.js → chunk-ULSIJGLS.js} +45 -13
- package/dist/{chunk-ONRCEE6D.js → chunk-UYOYTKE2.js} +4 -4
- package/dist/{chunk-PTW6W5NR.js → chunk-VYAL7PUE.js} +1 -1
- package/dist/{chunk-JEHRUE3F.js → chunk-W5VPCONO.js} +166 -196
- package/dist/{chunk-NPQWKGUA.js → chunk-WBT5X3NH.js} +5 -4
- package/dist/{chunk-RLYZLUQ7.js → chunk-WGAUY5LE.js} +2 -2
- package/dist/{chunk-RSNSZ2LJ.js → chunk-X5H2WYMB.js} +1 -1
- package/dist/{chunk-OHVJA253.js → chunk-X5N6KC6V.js} +47 -29
- package/dist/{chunk-22RMZBGW.js → chunk-XGP3VYOG.js} +1 -1
- package/dist/{chunk-HYZRY4KZ.js → chunk-XNGMQ27R.js} +16 -6
- package/dist/{chunk-W3EKCZSQ.js → chunk-Y5GE76XC.js} +180 -53
- package/dist/{chunk-EWORLJMO.js → chunk-Y5MXET4M.js} +277 -526
- package/dist/{chunk-XCK2YAY5.js → chunk-YVZJ6GKF.js} +3 -2
- package/dist/{chunk-YO4PSLVB.js → chunk-ZRL6HKBY.js} +1 -1
- package/dist/claude-launcher-YVXI76NX.js +102 -0
- package/dist/{cli-AEWH62UE.js → cli-C77H54BV.js} +489 -174
- package/dist/{command-HHPBR6CS.js → command-H5CILO4S.js} +40 -37
- package/dist/{config-N3C6DFQA.js → config-FXDG4NPJ.js} +2 -3
- package/dist/connect-cmd-ZW5FV3ZW.js +17 -0
- package/dist/{context-adopt-VMMGFRUZ.js → context-adopt-O5OFXMKI.js} +13 -12
- package/dist/context-materialize-Y5IJ4MQT.js +23 -0
- package/dist/{dist-LKDWQWZ7.js → dist-QTX4RSCL.js} +2 -2
- package/dist/{docker-4J77Q2BF.js → docker-RC3PRX3Q.js} +7 -8
- package/dist/{doctor-N6Y7HKK3.js → doctor-2NQQML6P.js} +47 -39
- package/dist/{emit-artifact-cmd-H5MH3AOP.js → emit-artifact-cmd-7MP63KXU.js} +25 -22
- package/dist/emit-cmd-PPN4QQF2.js +14 -0
- package/dist/{emit-criteria-cmd-HBP6XS5C.js → emit-criteria-cmd-3RXPDLNK.js} +16 -14
- package/dist/{emit-finding-cmd-ZXDRL6PG.js → emit-finding-cmd-OL7JB6H3.js} +18 -16
- package/dist/{emit-result-cmd-RFKALS5Z.js → emit-result-cmd-UZVMOCF4.js} +20 -17
- package/dist/{exec-client-CQV746UF.js → exec-client-7UMESIE2.js} +3 -4
- package/dist/governing-source-BUU4IABS.js +35 -0
- package/dist/guest-init-KPBQOFE5.js +9 -0
- package/dist/hidden-prompt-UXBFMQC5.js +68 -0
- package/dist/{hook-fast-D7HV4IXG.js → hook-fast-W5MKHMJT.js} +4 -1
- package/dist/host-key-U4B5QETR.js +8 -0
- package/dist/{import-capture-cmd-EQ35EARA.js → import-capture-cmd-ZO6KGHI2.js} +7 -5
- package/dist/{import-ruler-cmd-BGAZXCQM.js → import-ruler-cmd-KJMWL5V6.js} +5 -3
- package/dist/index.js +8 -4
- package/dist/init-VWXIZEAN.js +54 -0
- package/dist/{init-FBCA4DRA.js → init-WNXXYMO7.js} +80 -53
- package/dist/{init-cmd-CAG572UE.js → init-cmd-WS6TIRYT.js} +28 -24
- package/dist/{init-update-VDFF4K3B.js → init-update-E3J6TVIN.js} +27 -26
- package/dist/{install-HDBIPHTX.js → install-CBWIEF3R.js} +4 -5
- package/dist/{install-cmd-5HYMXLEW.js → install-cmd-QDOTR4OM.js} +5 -4
- package/dist/{login-browser-QZCS3WW6.js → login-browser-O63QZN7D.js} +4 -3
- package/dist/{logout-cmd-QAUFDJ6J.js → logout-cmd-5V5MMBSY.js} +3 -2
- package/dist/{logs-H55NWW4H.js → logs-AMLKC3VP.js} +3 -1
- package/dist/loop-UGI2BJOT.js +76 -0
- package/dist/machine-JOW4RNZ7.js +49 -0
- package/dist/{mcp-install-cmd-FDTPQQS6.js → mcp-install-cmd-GGWB3JJ2.js} +3 -2
- package/dist/{mcp-serve-cmd-3KVYEUXG.js → mcp-serve-cmd-DOTY5FKY.js} +10 -8
- package/dist/paths-7XP63OAX.js +7 -0
- package/dist/pending-532ABZYC.js +8 -0
- package/dist/{pidfile-UZRH774M.js → pidfile-3DM4OBKO.js} +4 -2
- package/dist/{record-C43U4PKS.js → record-3WP6V2K5.js} +3 -2
- package/dist/{runner-env-EN7YE7QX.js → runner-env-4NB2GA7O.js} +5 -6
- package/dist/runner-key-TC3NFWFV.js +177 -0
- package/dist/{session-sender-24L5EW25.js → session-sender-NNVPSPY7.js} +17 -14
- package/dist/spec-cmd-OWVTBB4J.js +116 -0
- package/dist/{starter-pack-KF66HGZR.js → starter-pack-OPWUDOWX.js} +7 -5
- package/dist/{status-XHSGEYO5.js → status-TKCLLKFG.js} +42 -39
- package/dist/{statusline-fast-SVTMBMD7.js → statusline-fast-KN3BX67H.js} +2 -1
- package/dist/{sync-cmd-5G5EIEHD.js → sync-cmd-Q6VYNPWG.js} +16 -13
- package/dist/{watch-UTOXO4SE.js → watch-ARAGADTF.js} +16 -13
- package/dist/{work-claim-cmd-RKHYFE5Y.js → work-claim-cmd-34FERLYX.js} +25 -27
- package/dist/work-cmd-7S5B2H2P.js +25 -0
- package/dist/{work-comment-cmd-A55CUSYE.js → work-comment-cmd-SZJSPM5S.js} +15 -13
- package/dist/{work-launch-R5HTAP6X.js → work-launch-LEQ2MPM3.js} +3 -1
- package/dist/{work-open-pr-cmd-E6O53IJD.js → work-open-pr-cmd-RPXKCBWS.js} +17 -15
- package/dist/work-pr-cmd-5LGANL32.js +26 -0
- package/package.json +3 -2
- package/skill-pack/maintained/outerlayer-amend/SKILL.md +6 -2
- package/skill-pack/maintained/outerlayer-cli/SKILL.md +2 -0
- package/skill-pack/maintained/outerlayer-evidence/SKILL.md +4 -2
- package/skill-pack/maintained/outerlayer-findings/SKILL.md +2 -0
- package/skill-pack/shipped.json +27 -5
- package/skill-pack/template/build/SKILL.md +25 -10
- package/skill-pack/template/build/references/agent-briefs.md +3 -1
- package/skill-pack/template/build/references/criteria-judge.md +27 -0
- package/skill-pack/template/build/references/release.md +27 -34
- package/skill-pack/template/build/scripts/criterion-citations.mjs +8 -3
- package/skill-pack/template/build/scripts/record-criteria.mjs +8 -2
- package/skill-pack/template/spec/SKILL.md +37 -10
- package/skill-pack/validators/acceptance-criteria.yaml +25 -25
- package/skill-pack/validators/code-review.yaml +6 -5
- package/dist/agent-setup-K3ABU5NL.js +0 -27
- package/dist/chunk-BYT5O5RV.js +0 -61
- package/dist/connect-cmd-JUAW6MU4.js +0 -16
- package/dist/context-materialize-2WXTS4CW.js +0 -22
- package/dist/emit-cmd-IJ3GVRFD.js +0 -12
- package/dist/guest-init-LJP5GPZF.js +0 -9
- package/dist/host-key-YMLXY6QB.js +0 -7
- package/dist/init-MYX7YMIH.js +0 -51
- package/dist/loop-75J4YXLZ.js +0 -73
- package/dist/machine-A6ZCTUGS.js +0 -46
- package/dist/paths-OYKMVYJP.js +0 -6
- package/dist/pending-MXLSRYMO.js +0 -7
- package/dist/runner-key-W25ISHI3.js +0 -155
- package/dist/work-cmd-DJQJEZVB.js +0 -23
- package/dist/work-pr-cmd-L77K32WK.js +0 -24
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { readPin, pinExists, readBuildHold, readContextManifest, manifestFilesPresent, writeDegraded, writeSourceCache, SOURCE_CACHE_TTL_RETRY_MS,
|
|
4
|
-
import { removeRetiredSkills } from './chunk-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { resolveGatewayCredentials } from './chunk-PLMTLGYH.js';
|
|
3
|
+
import { readPin, pinExists, readBuildHold, readContextManifest, manifestFilesPresent, writeDegraded, writeSourceCache, SOURCE_CACHE_TTL_RETRY_MS, touchLastCheck, SOURCE_CACHE_TTL_SUCCESS_MS, readDegraded, writeContextManifest, writePinIfChanged, readSourceCache, isSourceCacheFresh, clearDegraded } from './chunk-LXAY4A2G.js';
|
|
4
|
+
import { removeRetiredSkills } from './chunk-T4Y6SCG3.js';
|
|
5
|
+
import { defaultFetch } from './chunk-ZRL6HKBY.js';
|
|
6
|
+
import { resolveGatewayCredentials } from './chunk-52NC2FIU.js';
|
|
7
|
+
import { loadMaintainedFiles, writeMaintainedFiles } from './chunk-MNTSH4CL.js';
|
|
8
|
+
import { normalizeRepoName, parseOuterlayerConfig, classifyTree, emitTree } from './chunk-X5N6KC6V.js';
|
|
9
|
+
import { withTokenHeader } from './chunk-BQXFBI7T.js';
|
|
11
10
|
import { ensureContextExcludes, ensurePreCommitGuardHook } from './chunk-XCCLFVXM.js';
|
|
11
|
+
import { appendContextProvenance } from './chunk-ZJSNLVCE.js';
|
|
12
|
+
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
12
13
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
13
14
|
import { execFileSync } from 'child_process';
|
|
14
15
|
import { lstatSync, existsSync, mkdirSync, writeFileSync, chmodSync, unlinkSync, readdirSync, rmSync, readFileSync, copyFileSync } from 'fs';
|
|
@@ -91,16 +92,20 @@ function gitText(git, cwd, args, timeoutMs) {
|
|
|
91
92
|
const result = git(args, { cwd, timeoutMs });
|
|
92
93
|
return result.ok ? result.stdout.toString("utf8").trim() : void 0;
|
|
93
94
|
}
|
|
95
|
+
var GATEWAY_TOO_OLD_MESSAGE = "the OuterLayer this machine talks to is too old to name the control plane \u2014 ask whoever runs it to upgrade; context written earlier is kept";
|
|
94
96
|
var NOT_GOVERNED_MESSAGE = "this repository's control plane no longer governs it";
|
|
95
97
|
var ADOPTION_MESSAGE = "committed context files shadow the control plane \u2014 remove them in a commit";
|
|
96
98
|
var CANNOT_IDENTIFY_MESSAGE = "this repository is governed, but the control plane cannot be identified \u2014 check OuterLayer connectivity/config";
|
|
97
99
|
function designationAuthRejectedMessage(credential) {
|
|
98
|
-
return credential.startsWith("olu_") ?
|
|
100
|
+
return credential.startsWith("olu_") ? `the OuterLayer login was rejected (401/403) \u2014 run \`${cliInvocation()} login\` to sign in again` : "the OuterLayer API key was rejected (401/403) \u2014 check apiKey in ~/.outerlayer/config.json";
|
|
99
101
|
}
|
|
100
102
|
var PARTIAL_WRITE_MESSAGE = "control-plane content could not be fully written \u2014 running on previous context";
|
|
101
103
|
var OVERLAY_FAILED_MESSAGE = "control-plane content was written but the maintained skills could not be refreshed \u2014 retrying next session";
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
function isStagingWriteFault(message) {
|
|
105
|
+
return message === PARTIAL_WRITE_MESSAGE || message === OVERLAY_FAILED_MESSAGE;
|
|
106
|
+
}
|
|
107
|
+
var COMMIT_GUARD_FOREIGN_NOT_INSTALLED_MESSAGE = `the materialized-context commit guard is NOT installed \u2014 a pre-commit hook this clone did not write occupies that slot \u2014 resolve the conflict or run \`${cliInvocation()} hooks install-git\``;
|
|
108
|
+
var COMMIT_GUARD_HOOKSPATH_NOT_INSTALLED_MESSAGE = `the materialized-context commit guard is NOT installed \u2014 hooks are managed via core.hooksPath, which this clone never writes to automatically \u2014 adopt it yourself: \`${cliInvocation()} hooks install-git --print\``;
|
|
104
109
|
function guardNotInstalledMessage(guard) {
|
|
105
110
|
if (guard.adopted) return void 0;
|
|
106
111
|
if (guard.status === "skipped-foreign") return COMMIT_GUARD_FOREIGN_NOT_INSTALLED_MESSAGE;
|
|
@@ -188,100 +193,67 @@ async function materializeContext(deps) {
|
|
|
188
193
|
if (ownRepoName === void 0) {
|
|
189
194
|
return selfOutcome();
|
|
190
195
|
}
|
|
191
|
-
const designation = await resolveDesignation({ git, fetchImpl, home, cloud: deps.cloud, now, gitCommonDir, ownRepoName, repoRoot, lookup: deps.designationLookup ?? { timeoutMs: 2e3, attempts: 1 } });
|
|
196
|
+
const designation = deps.pinnedSource === void 0 ? await resolveDesignation({ git, fetchImpl, home, cloud: deps.cloud, now, gitCommonDir, ownRepoName, repoRoot, lookup: deps.designationLookup ?? { timeoutMs: 2e3, attempts: 1 } }) : deps.pinnedSource === null ? { status: "self" } : { status: "governed", ...deps.pinnedSource };
|
|
192
197
|
const answered = { designation: "answered" };
|
|
193
198
|
if (designation.status === "self") {
|
|
199
|
+
if (designation.unanswered !== void 0 && !hasPin) {
|
|
200
|
+
const { authRejected, gatewayTooOld } = designation.unanswered;
|
|
201
|
+
const message = authRejected ?? (gatewayTooOld ? GATEWAY_TOO_OLD_MESSAGE : void 0);
|
|
202
|
+
if (message !== void 0) {
|
|
203
|
+
writeDegraded(gitCommonDir, { at: new Date(now()).toISOString(), kind: "designation-unverified", message });
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
status: "self",
|
|
207
|
+
sha: null,
|
|
208
|
+
verification: "none",
|
|
209
|
+
designation: "unknown",
|
|
210
|
+
...authRejected ? { authRejected: true } : {},
|
|
211
|
+
...message !== void 0 && !authRejected ? { message } : {}
|
|
212
|
+
};
|
|
213
|
+
}
|
|
194
214
|
return { ...selfOutcome(), ...answered };
|
|
195
215
|
}
|
|
196
216
|
if (designation.status === "unknown") {
|
|
197
|
-
const message = designation.authRejected ?? CANNOT_IDENTIFY_MESSAGE;
|
|
217
|
+
const message = designation.authRejected ?? (designation.gatewayTooOld ? GATEWAY_TOO_OLD_MESSAGE : CANNOT_IDENTIFY_MESSAGE);
|
|
198
218
|
if (hasPin) {
|
|
199
219
|
writeDegraded(gitCommonDir, { at: new Date(now()).toISOString(), kind: "designation-unverified", message });
|
|
200
220
|
record(null, "none");
|
|
201
221
|
return { status: "designation-unverified", message, sha: null, verification: "none", designation: "unknown" };
|
|
202
222
|
}
|
|
203
|
-
if (designation.authRejected) {
|
|
223
|
+
if (designation.authRejected || designation.gatewayTooOld) {
|
|
204
224
|
writeDegraded(gitCommonDir, { at: new Date(now()).toISOString(), kind: "designation-unverified", message });
|
|
205
225
|
}
|
|
206
|
-
writeSourceCache(gitCommonDir, { checkedAt: new Date(now()).toISOString(), status: "self", ttlMs: SOURCE_CACHE_TTL_RETRY_MS });
|
|
207
|
-
return { status: "self", sha: null, verification: "none", designation: "unknown", ...designation.authRejected ? { authRejected: true } : {}, lookupFailure: designation.lookupFailure };
|
|
208
|
-
}
|
|
209
|
-
let repository;
|
|
210
|
-
let ref;
|
|
211
|
-
let unverifiedIdentity;
|
|
212
|
-
let preFetched;
|
|
213
|
-
let unreadableCandidates = [];
|
|
214
|
-
if (designation.status === "candidates") {
|
|
215
|
-
const sortedCandidates = [...designation.candidates].sort((a, b) => a.repository.localeCompare(b.repository));
|
|
216
|
-
const claimants = [];
|
|
217
|
-
const unfetched = [];
|
|
218
|
-
const access = await deps.controlPlaneAccess?.(sortedCandidates);
|
|
219
|
-
for (const candidate of sortedCandidates) {
|
|
220
|
-
const candidateUrl = deps.resolveControlPlaneUrl ? deps.resolveControlPlaneUrl(candidate.repository, candidate.ref, repoRoot) : buildControlPlaneUrl(git, repoRoot, candidate.repository);
|
|
221
|
-
const candidateHost = parseRemoteHost(candidateUrl).host || "unknown-host";
|
|
222
|
-
const candidateCacheDir = ensureBareCache(git, home, candidate.repository, candidateHost);
|
|
223
|
-
const candidateLocalRef = `refs/outerlayer/${sanitizeRefName(candidate.ref)}`;
|
|
224
|
-
const token = access !== void 0 && normalizeRepoName(access.repository) === normalizeRepoName(candidate.repository) ? access.token : void 0;
|
|
225
|
-
const candidateFetch = git(["fetch", "--depth", "1", candidateUrl, `+${candidate.ref}:${candidateLocalRef}`], {
|
|
226
|
-
cwd: candidateCacheDir,
|
|
227
|
-
timeoutMs: 1e4,
|
|
228
|
-
...token === void 0 ? {} : { env: (base) => withTokenHeader(base, candidateUrl, token) }
|
|
229
|
-
});
|
|
230
|
-
if (!candidateFetch.ok) {
|
|
231
|
-
unfetched.push(candidate.repository);
|
|
232
|
-
continue;
|
|
233
|
-
}
|
|
234
|
-
const candidateSha = gitText(git, candidateCacheDir, ["rev-parse", candidateLocalRef], 2e3);
|
|
235
|
-
if (candidateSha === void 0) {
|
|
236
|
-
unfetched.push(candidate.repository);
|
|
237
|
-
continue;
|
|
238
|
-
}
|
|
239
|
-
const candidateConfig = readBlobAtPath(git, candidateCacheDir, candidateSha, CONTEXT_SOURCE_CONFIG_PATH);
|
|
240
|
-
const candidateGoverns = candidateConfig === void 0 ? { governs: [] } : parseGoverns(candidateConfig);
|
|
241
|
-
const candidateGovernsList = "error" in candidateGoverns ? [] : candidateGoverns.governs;
|
|
242
|
-
if (candidateGovernsList.some((r) => normalizeRepoName(r) === normalizeRepoName(ownRepoName))) {
|
|
243
|
-
claimants.push({ repository: candidate.repository, ref: candidate.ref, sha: candidateSha, cacheRepoDir: candidateCacheDir });
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
if (claimants.length === 0) {
|
|
247
|
-
writeSourceCache(gitCommonDir, { checkedAt: new Date(now()).toISOString(), status: "self", ttlMs: SOURCE_CACHE_TTL_SUCCESS_MS });
|
|
248
|
-
return { ...selfOutcome(), ...answered, ...unfetched.length > 0 ? { unfetched } : {} };
|
|
249
|
-
}
|
|
250
|
-
if (claimants.length > 1) {
|
|
251
|
-
const names = claimants.map((c) => c.repository).sort();
|
|
252
|
-
const message = `${names.join(" and ")} both claim to govern this repository \u2014 resolve the designation before context can materialize`;
|
|
253
|
-
writeDegraded(gitCommonDir, { at: new Date(now()).toISOString(), kind: "conflict", message });
|
|
254
|
-
const manifestForConflict = readContextManifest(gitCommonDir);
|
|
255
|
-
const lastGood = manifestForConflict?.sha ?? null;
|
|
256
|
-
const verification = manifestForConflict ? "unverified" : "none";
|
|
257
|
-
record(lastGood, verification);
|
|
258
|
-
return { status: "conflict", message, sha: lastGood, verification };
|
|
259
|
-
}
|
|
260
|
-
unreadableCandidates = unfetched;
|
|
261
|
-
const winner = claimants[0];
|
|
262
226
|
writeSourceCache(gitCommonDir, {
|
|
263
227
|
checkedAt: new Date(now()).toISOString(),
|
|
264
|
-
status: "
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
228
|
+
status: "self",
|
|
229
|
+
ttlMs: SOURCE_CACHE_TTL_RETRY_MS,
|
|
230
|
+
unanswered: {
|
|
231
|
+
...designation.authRejected ? { authRejected: designation.authRejected } : {},
|
|
232
|
+
...designation.gatewayTooOld ? { gatewayTooOld: true } : {}
|
|
233
|
+
}
|
|
268
234
|
});
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
235
|
+
return {
|
|
236
|
+
status: "self",
|
|
237
|
+
sha: null,
|
|
238
|
+
verification: "none",
|
|
239
|
+
designation: "unknown",
|
|
240
|
+
...designation.authRejected ? { authRejected: true } : {},
|
|
241
|
+
...designation.gatewayTooOld ? { message } : {},
|
|
242
|
+
lookupFailure: designation.lookupFailure
|
|
243
|
+
};
|
|
276
244
|
}
|
|
245
|
+
const repository = designation.repository;
|
|
246
|
+
const ref = designation.ref;
|
|
247
|
+
const unverifiedIdentity = designation.unverifiedIdentity;
|
|
248
|
+
const storedSha = designation.sha;
|
|
277
249
|
const manifest = readContextManifest(gitCommonDir);
|
|
278
|
-
const evidenced = hasGovernedEvidence(hasPin, manifest);
|
|
250
|
+
const evidenced = hasGovernedEvidence(hasPin, manifest) || !unverifiedIdentity;
|
|
279
251
|
const clearOrFlagIdentity = () => {
|
|
280
252
|
if (unverifiedIdentity) {
|
|
281
253
|
writeDegraded(gitCommonDir, {
|
|
282
254
|
at: new Date(now()).toISOString(),
|
|
283
255
|
kind: "designation-unverified",
|
|
284
|
-
message: CANNOT_IDENTIFY_MESSAGE,
|
|
256
|
+
message: designation.gatewayTooOld ? GATEWAY_TOO_OLD_MESSAGE : CANNOT_IDENTIFY_MESSAGE,
|
|
285
257
|
repository,
|
|
286
258
|
ref
|
|
287
259
|
});
|
|
@@ -289,99 +261,77 @@ async function materializeContext(deps) {
|
|
|
289
261
|
clearDegraded(gitCommonDir);
|
|
290
262
|
}
|
|
291
263
|
};
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
const remoteUrl = deps.resolveControlPlaneUrl ? deps.resolveControlPlaneUrl(repository, ref, repoRoot) : buildControlPlaneUrl(git, repoRoot, repository);
|
|
323
|
-
const cacheHost = parseRemoteHost(remoteUrl).host || "unknown-host";
|
|
324
|
-
const lsRemote = git(["ls-remote", remoteUrl, ref], { cwd: repoRoot, timeoutMs: 2e3 });
|
|
325
|
-
if (lsRemote.ok) {
|
|
326
|
-
const remoteSha = parseLsRemoteSha(lsRemote.stdout.toString("utf8"));
|
|
327
|
-
if (remoteSha && manifest !== void 0 && manifest.sha === remoteSha && pin?.sha === remoteSha && manifestFilesPresent(repoRoot, manifest)) {
|
|
328
|
-
touchLastCheck(gitCommonDir, now());
|
|
329
|
-
clearOrFlagIdentity();
|
|
330
|
-
ensureContextExcludes(gitCommonDir);
|
|
331
|
-
recordMaintainedOverlay(repoRoot, gitCommonDir, manifest);
|
|
332
|
-
const guardMessage2 = guardNotInstalledMessage(ensurePreCommitGuardHook(repoRoot, gitCommonDir));
|
|
333
|
-
writeSourceCache(gitCommonDir, { checkedAt: new Date(now()).toISOString(), status: "governed", repository, ref, ttlMs: SOURCE_CACHE_TTL_SUCCESS_MS });
|
|
334
|
-
record(remoteSha, "verified", repository, ref);
|
|
335
|
-
return {
|
|
336
|
-
status: "debounced",
|
|
337
|
-
sha: remoteSha,
|
|
338
|
-
verification: "verified",
|
|
339
|
-
...guardMessage2 ? { message: guardMessage2 } : {}
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
cacheRepoDir = ensureBareCache(git, home, repository, cacheHost);
|
|
344
|
-
const localRef = `refs/outerlayer/${sanitizeRefName(ref)}`;
|
|
345
|
-
const fetchResult = git(["fetch", "--depth", "1", remoteUrl, `+${ref}:${localRef}`], { cwd: cacheRepoDir, timeoutMs: 1e4 });
|
|
346
|
-
if (!fetchResult.ok) {
|
|
347
|
-
const kind = classifyGitFailure(fetchResult.stderr);
|
|
348
|
-
const lastGood = manifest?.sha ?? null;
|
|
349
|
-
const verification = lastGood ? "unverified" : "none";
|
|
350
|
-
const doctorMessage = kind === "no-access" ? noAccessMessage(lastGood) : unreachableMessage(lastGood);
|
|
351
|
-
writeDegraded(gitCommonDir, { at: new Date(now()).toISOString(), kind, message: doctorMessage, repository, ref, lastGoodSha: lastGood ?? void 0 });
|
|
352
|
-
if (evidenced) {
|
|
353
|
-
record(lastGood, verification, repository, ref);
|
|
354
|
-
return { status: kind, message: doctorMessage, sha: lastGood, verification };
|
|
355
|
-
}
|
|
356
|
-
return { status: kind, sha: null, verification: "none" };
|
|
264
|
+
if (manifest !== void 0 && manifest.sha === storedSha && pin?.sha === storedSha && manifestFilesPresent(repoRoot, manifest)) {
|
|
265
|
+
touchLastCheck(gitCommonDir, now());
|
|
266
|
+
clearOrFlagIdentity();
|
|
267
|
+
ensureContextExcludes(gitCommonDir);
|
|
268
|
+
recordMaintainedOverlay(repoRoot, gitCommonDir, manifest);
|
|
269
|
+
const guardMessage2 = guardNotInstalledMessage(ensurePreCommitGuardHook(repoRoot, gitCommonDir));
|
|
270
|
+
writeSourceCache(gitCommonDir, {
|
|
271
|
+
checkedAt: new Date(now()).toISOString(),
|
|
272
|
+
status: "governed",
|
|
273
|
+
repository,
|
|
274
|
+
ref,
|
|
275
|
+
sha: storedSha,
|
|
276
|
+
ttlMs: SOURCE_CACHE_TTL_SUCCESS_MS
|
|
277
|
+
});
|
|
278
|
+
const verification = unverifiedIdentity ? "unverified" : "verified";
|
|
279
|
+
record(storedSha, verification, repository, ref);
|
|
280
|
+
return {
|
|
281
|
+
status: "debounced",
|
|
282
|
+
sha: storedSha,
|
|
283
|
+
verification,
|
|
284
|
+
...guardMessage2 ? { message: guardMessage2 } : {}
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
const recentFailure = readDegraded(gitCommonDir);
|
|
288
|
+
if (recentFailure && (recentFailure.kind === "unreachable" || recentFailure.kind === "no-access") && recentFailure.repository === repository && recentFailure.ref === ref && now() - Date.parse(recentFailure.at) < FAILURE_DEBOUNCE_MS) {
|
|
289
|
+
const lastGood = manifest?.sha ?? null;
|
|
290
|
+
const verification = lastGood ? "unverified" : "none";
|
|
291
|
+
if (evidenced) {
|
|
292
|
+
record(lastGood, verification, repository, ref);
|
|
293
|
+
return { status: recentFailure.kind, message: recentFailure.message, sha: lastGood, verification };
|
|
357
294
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
295
|
+
return { status: recentFailure.kind, sha: null, verification: "none" };
|
|
296
|
+
}
|
|
297
|
+
const remoteUrl = deps.resolveControlPlaneUrl ? deps.resolveControlPlaneUrl(repository, ref, repoRoot) : buildControlPlaneUrl(git, repoRoot, repository);
|
|
298
|
+
const cacheHost = parseRemoteHost(remoteUrl).host || "unknown-host";
|
|
299
|
+
const cacheRepoDir = ensureBareCache(git, home, repository, cacheHost);
|
|
300
|
+
const localRef = `refs/outerlayer/sha-${sanitizeRefName(storedSha)}`;
|
|
301
|
+
const wanted = `+${storedSha}:${localRef}`;
|
|
302
|
+
const access = await deps.controlPlaneAccess?.([{ repository, ref }]);
|
|
303
|
+
const token = access !== void 0 && normalizeRepoName(access.repository) === normalizeRepoName(repository) ? access.token : void 0;
|
|
304
|
+
const fetchResult = git(["fetch", "--depth", "1", remoteUrl, wanted], {
|
|
305
|
+
cwd: cacheRepoDir,
|
|
306
|
+
timeoutMs: 1e4,
|
|
307
|
+
...token === void 0 ? {} : { env: (base) => withTokenHeader(base, remoteUrl, token) }
|
|
308
|
+
});
|
|
309
|
+
const commitNote = (message) => `could not fetch commit \`${storedSha.slice(0, 7)}\` of ${repository}; ${message}`;
|
|
310
|
+
if (!fetchResult.ok) {
|
|
311
|
+
const kind = classifyGitFailure(fetchResult.stderr);
|
|
312
|
+
const lastGood = manifest?.sha ?? null;
|
|
313
|
+
const verification = lastGood ? "unverified" : "none";
|
|
314
|
+
const doctorMessage = commitNote(kind === "no-access" ? noAccessMessage(lastGood) : unreachableMessage(lastGood));
|
|
315
|
+
writeDegraded(gitCommonDir, { at: new Date(now()).toISOString(), kind, message: doctorMessage, repository, ref, lastGoodSha: lastGood ?? void 0 });
|
|
316
|
+
if (evidenced) {
|
|
317
|
+
record(lastGood, verification, repository, ref);
|
|
318
|
+
return { status: kind, message: doctorMessage, sha: lastGood, verification };
|
|
369
319
|
}
|
|
370
|
-
sha
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
clearDegraded(gitCommonDir);
|
|
382
|
-
return { status: "self", sha: null, verification: "none" };
|
|
320
|
+
return { status: kind, sha: null, verification: "none" };
|
|
321
|
+
}
|
|
322
|
+
const fetchedSha = gitText(git, cacheRepoDir, ["rev-parse", localRef], 2e3);
|
|
323
|
+
if (fetchedSha !== storedSha) {
|
|
324
|
+
const lastGood = manifest?.sha ?? null;
|
|
325
|
+
const verification = lastGood ? "unverified" : "none";
|
|
326
|
+
const doctorMessage = commitNote(unreachableMessage(lastGood));
|
|
327
|
+
writeDegraded(gitCommonDir, { at: new Date(now()).toISOString(), kind: "unreachable", message: doctorMessage, repository, ref, lastGoodSha: lastGood ?? void 0 });
|
|
328
|
+
if (evidenced) {
|
|
329
|
+
record(lastGood, verification, repository, ref);
|
|
330
|
+
return { status: "unreachable", message: doctorMessage, sha: lastGood, verification };
|
|
383
331
|
}
|
|
332
|
+
return { status: "unreachable", sha: null, verification: "none" };
|
|
384
333
|
}
|
|
334
|
+
const sha = fetchedSha;
|
|
385
335
|
const tracked = git(["ls-files", "-z", "--", "AGENTS.md", ".claude", ".outerlayer"], { cwd: repoRoot, timeoutMs: 2e3 });
|
|
386
336
|
if (tracked.ok && tracked.stdout.length > 0) {
|
|
387
337
|
writeDegraded(gitCommonDir, { at: new Date(now()).toISOString(), kind: "adoption-conflict", message: ADOPTION_MESSAGE, repository, ref });
|
|
@@ -449,14 +399,20 @@ async function materializeContext(deps) {
|
|
|
449
399
|
writePinIfChanged(repoRoot, sha);
|
|
450
400
|
touchLastCheck(gitCommonDir, now());
|
|
451
401
|
clearOrFlagIdentity();
|
|
452
|
-
writeSourceCache(gitCommonDir, {
|
|
402
|
+
writeSourceCache(gitCommonDir, {
|
|
403
|
+
checkedAt: new Date(now()).toISOString(),
|
|
404
|
+
status: "governed",
|
|
405
|
+
repository,
|
|
406
|
+
ref,
|
|
407
|
+
sha: storedSha,
|
|
408
|
+
ttlMs: SOURCE_CACHE_TTL_SUCCESS_MS
|
|
409
|
+
});
|
|
453
410
|
record(sha, "verified", repository, ref);
|
|
454
411
|
return {
|
|
455
412
|
status: "materialized",
|
|
456
413
|
sha,
|
|
457
414
|
verification: "verified",
|
|
458
|
-
...guardMessage ? { message: guardMessage } : {}
|
|
459
|
-
...unreadableCandidates.length > 0 ? { unfetched: unreadableCandidates } : {}
|
|
415
|
+
...guardMessage ? { message: guardMessage } : {}
|
|
460
416
|
};
|
|
461
417
|
}
|
|
462
418
|
function recordMaintainedOverlay(repoRoot, gitCommonDir, manifest) {
|
|
@@ -476,11 +432,12 @@ function recordMaintainedOverlay(repoRoot, gitCommonDir, manifest) {
|
|
|
476
432
|
}
|
|
477
433
|
async function resolveDesignation(ctx) {
|
|
478
434
|
const cache = readSourceCache(ctx.gitCommonDir);
|
|
479
|
-
if (cache && isSourceCacheFresh(cache, ctx.now())) {
|
|
480
|
-
return
|
|
435
|
+
if (cache && cache.status === "self" && isSourceCacheFresh(cache, ctx.now())) {
|
|
436
|
+
return { status: "self", unanswered: cache.unanswered };
|
|
481
437
|
}
|
|
482
438
|
let authRejected;
|
|
483
439
|
let lookupFailure;
|
|
440
|
+
let gatewayTooOld = false;
|
|
484
441
|
const destination = resolveGatewayCredentials({
|
|
485
442
|
home: ctx.home,
|
|
486
443
|
env: {},
|
|
@@ -497,8 +454,7 @@ async function resolveDesignation(ctx) {
|
|
|
497
454
|
if (lookup.kind === "rejected") authRejected = designationAuthRejectedMessage(destination.credential);
|
|
498
455
|
if (lookup.kind === "failed") lookupFailure = lookup.failure;
|
|
499
456
|
if (lookup.kind === "answered") {
|
|
500
|
-
|
|
501
|
-
if (sources.length === 0) {
|
|
457
|
+
if (lookup.source === null) {
|
|
502
458
|
writeSourceCache(ctx.gitCommonDir, {
|
|
503
459
|
checkedAt: new Date(ctx.now()).toISOString(),
|
|
504
460
|
status: "self",
|
|
@@ -506,13 +462,25 @@ async function resolveDesignation(ctx) {
|
|
|
506
462
|
});
|
|
507
463
|
return { status: "self" };
|
|
508
464
|
}
|
|
509
|
-
|
|
465
|
+
if (lookup.source !== void 0) {
|
|
466
|
+
return { status: "governed", repository: lookup.source.repository, ref: lookup.source.ref, sha: lookup.source.sha };
|
|
467
|
+
}
|
|
468
|
+
gatewayTooOld = true;
|
|
510
469
|
}
|
|
511
470
|
}
|
|
512
|
-
if (cache) {
|
|
513
|
-
return cache.
|
|
471
|
+
if (cache?.status === "self") {
|
|
472
|
+
return cache.unanswered !== void 0 || authRejected !== void 0 || gatewayTooOld ? {
|
|
473
|
+
status: "self",
|
|
474
|
+
unanswered: { ...cache.unanswered, ...authRejected ? { authRejected } : {}, ...gatewayTooOld ? { gatewayTooOld } : {} }
|
|
475
|
+
} : { status: "self" };
|
|
476
|
+
}
|
|
477
|
+
if (cache?.repository && cache.ref && cache.sha !== void 0) {
|
|
478
|
+
return { status: "governed", repository: cache.repository, ref: cache.ref, sha: cache.sha, unverifiedIdentity: true, ...gatewayTooOld ? { gatewayTooOld } : {} };
|
|
514
479
|
}
|
|
515
|
-
return { status: "unknown", authRejected, lookupFailure };
|
|
480
|
+
return { status: "unknown", authRejected, gatewayTooOld, lookupFailure };
|
|
481
|
+
}
|
|
482
|
+
async function lookupGoverningSource(config, repository, fetchImpl, lookup) {
|
|
483
|
+
return fetchContextSource(config, repository, fetchImpl, lookup);
|
|
516
484
|
}
|
|
517
485
|
async function fetchContextSource(config, ownRepoName, fetchImpl, lookup) {
|
|
518
486
|
const url = `${config.url.replace(/\/$/, "")}/v1/context/source?repo=${encodeURIComponent(ownRepoName)}`;
|
|
@@ -541,8 +509,12 @@ async function askContextSource(url, config, fetchImpl, timeoutMs) {
|
|
|
541
509
|
}
|
|
542
510
|
if (!res.ok) return { kind: "failed", failure: { kind: "status", status: res.status } };
|
|
543
511
|
const body = await res.json();
|
|
544
|
-
|
|
545
|
-
|
|
512
|
+
const data = body.data;
|
|
513
|
+
const source = validSource(data?.source);
|
|
514
|
+
if (typeof data !== "object" || data === null) {
|
|
515
|
+
return { kind: "failed", failure: { kind: "network", message: "the answer held no data" } };
|
|
516
|
+
}
|
|
517
|
+
return { kind: "answered", source };
|
|
546
518
|
} catch (err) {
|
|
547
519
|
return {
|
|
548
520
|
kind: "failed",
|
|
@@ -552,6 +524,14 @@ async function askContextSource(url, config, fetchImpl, timeoutMs) {
|
|
|
552
524
|
clearTimeout(timer);
|
|
553
525
|
}
|
|
554
526
|
}
|
|
527
|
+
function validSource(source) {
|
|
528
|
+
if (source === null) return null;
|
|
529
|
+
const candidate = source;
|
|
530
|
+
if (typeof candidate?.repository === "string" && typeof candidate.ref === "string" && typeof candidate.sha === "string") {
|
|
531
|
+
return { repository: candidate.repository, ref: candidate.ref, sha: candidate.sha };
|
|
532
|
+
}
|
|
533
|
+
return void 0;
|
|
534
|
+
}
|
|
555
535
|
function resolveGitCommonDir(git, repoRoot) {
|
|
556
536
|
const abs = gitText(git, repoRoot, ["rev-parse", "--path-format=absolute", "--git-common-dir"], 2e3);
|
|
557
537
|
if (abs !== void 0) return abs;
|
|
@@ -605,12 +585,6 @@ function ensureBareCache(git, home, repository, host) {
|
|
|
605
585
|
}
|
|
606
586
|
return dir;
|
|
607
587
|
}
|
|
608
|
-
function parseLsRemoteSha(output) {
|
|
609
|
-
const lines = output.split("\n").filter((l) => l.trim().length > 0);
|
|
610
|
-
const peeled = lines.find((l) => l.split(/\s+/)[1]?.endsWith("^{}"));
|
|
611
|
-
const line = peeled ?? lines[0];
|
|
612
|
-
return line?.split(/\s+/)[0];
|
|
613
|
-
}
|
|
614
588
|
var MATERIALIZED_ROOTS = ["AGENTS.md", ".claude", ".outerlayer"];
|
|
615
589
|
function listMaterializedFiles(git, cacheRepoDir, sha) {
|
|
616
590
|
const result = git(["ls-tree", "-r", "-z", sha, "--", ...MATERIALIZED_ROOTS], { cwd: cacheRepoDir, timeoutMs: 1e4 });
|
|
@@ -631,10 +605,6 @@ function listMaterializedFiles(git, cacheRepoDir, sha) {
|
|
|
631
605
|
}
|
|
632
606
|
return entries;
|
|
633
607
|
}
|
|
634
|
-
function readBlobAtPath(git, cacheRepoDir, sha, path) {
|
|
635
|
-
const result = git(["show", `${sha}:${path}`], { cwd: cacheRepoDir, timeoutMs: 5e3 });
|
|
636
|
-
return result.ok ? result.stdout.toString("utf8") : void 0;
|
|
637
|
-
}
|
|
638
608
|
function parseBatchReply(files, stdout) {
|
|
639
609
|
const parsed = [];
|
|
640
610
|
let pos = 0;
|
|
@@ -723,4 +693,4 @@ function pruneEmptyDirs(dir, stopAt) {
|
|
|
723
693
|
}
|
|
724
694
|
}
|
|
725
695
|
|
|
726
|
-
export { defaultGitRunner, hasSymlinkComponent, materializeContext, parseOwnerRepo, parseRemoteHost, resolveGitCommonDir };
|
|
696
|
+
export { defaultGitRunner, hasSymlinkComponent, isStagingWriteFault, lookupGoverningSource, materializeContext, parseOwnerRepo, parseRemoteHost, resolveGitCommonDir };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-
|
|
4
|
-
import { resolveRepoIdentity } from './chunk-
|
|
5
|
-
import { resolveGatewayCredentials } from './chunk-
|
|
3
|
+
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-S76AYB4M.js';
|
|
4
|
+
import { resolveRepoIdentity } from './chunk-BMYGAGBJ.js';
|
|
5
|
+
import { resolveGatewayCredentials } from './chunk-52NC2FIU.js';
|
|
6
6
|
import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
7
|
+
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
7
8
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
8
9
|
|
|
9
10
|
createRequire(import.meta.url);
|
|
@@ -22,7 +23,7 @@ async function autoConnect(opts) {
|
|
|
22
23
|
if (!listed.ok || listed.factories.length === 0) return void 0;
|
|
23
24
|
const chosen = selectFactory(listed.factories, readRepoConnection(cwd), repository);
|
|
24
25
|
if (chosen.factory === void 0) {
|
|
25
|
-
return `you are logged in, but no factory is chosen for this repository, and more than one fits. Run
|
|
26
|
+
return `you are logged in, but no factory is chosen for this repository, and more than one fits. Run \`${cliInvocation()} connect --factory <org>/<factory>\` with one of:
|
|
26
27
|
${chosen.text}
|
|
27
28
|
Or pass --app-id / set OUTERLAYER_APP_ID.`;
|
|
28
29
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { builtinKind } from './chunk-
|
|
3
|
+
import { builtinKind } from './chunk-XGP3VYOG.js';
|
|
4
4
|
import { parseSize } from './chunk-7RQ73DLO.js';
|
|
5
|
-
import { runnerDir } from './chunk-
|
|
5
|
+
import { runnerDir } from './chunk-N2PXGQRL.js';
|
|
6
6
|
import { dirname } from 'path';
|
|
7
7
|
import { spawnSync } from 'child_process';
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RELAY_PORT, GATEWAY_SOCKET, GATEWAY_PORT, CLAUDE_SOCKET, CLAUDE_PORT, DESTINATION_BASE_PORT } from './chunk-
|
|
3
|
+
import { RELAY_PORT, GATEWAY_SOCKET, GATEWAY_PORT, CLAUDE_SOCKET, CLAUDE_PORT, DESTINATION_BASE_PORT } from './chunk-BQXFBI7T.js';
|
|
4
4
|
import { symlinkSync, unlinkSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
|