@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,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { runEmit } from './chunk-
|
|
4
|
-
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-
|
|
5
|
-
import { installStarterPack } from './chunk-
|
|
6
|
-
import { C } from './chunk-
|
|
7
|
-
import { resolveGitCommonDir, defaultGitRunner } from './chunk-
|
|
8
|
-
import { pinExists, readContextManifest } from './chunk-
|
|
9
|
-
import { loadTemplateFiles, loadMaintainedFiles, skillDir } from './chunk-
|
|
10
|
-
import { generatedHeaderSource } from './chunk-
|
|
3
|
+
import { runEmit } from './chunk-47TTLEDX.js';
|
|
4
|
+
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-YVZJ6GKF.js';
|
|
5
|
+
import { installStarterPack } from './chunk-F4XSVQJ4.js';
|
|
6
|
+
import { C } from './chunk-ANPNT6PM.js';
|
|
7
|
+
import { resolveGitCommonDir, defaultGitRunner } from './chunk-W5VPCONO.js';
|
|
8
|
+
import { pinExists, readContextManifest } from './chunk-LXAY4A2G.js';
|
|
9
|
+
import { loadTemplateFiles, loadMaintainedFiles, skillDir } from './chunk-MNTSH4CL.js';
|
|
10
|
+
import { generatedHeaderSource } from './chunk-X5N6KC6V.js';
|
|
11
|
+
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
11
12
|
import { execFileSync } from 'child_process';
|
|
12
13
|
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
13
14
|
import { join, dirname } from 'path';
|
|
@@ -176,7 +177,7 @@ function renderPaths(paths, kept) {
|
|
|
176
177
|
`;
|
|
177
178
|
}
|
|
178
179
|
function renderDone(paths, kept, mcpKept) {
|
|
179
|
-
const mcpNote = mcpKept ? ` ${C.yellow}!${C.reset} The outerlayer and ${DOCS_MCP_SERVER_NAME} entries were not added to .mcp.json, so their MCP servers are not set up. Add them to .mcp.json by hand, or move the servers you wrote into .outerlayer/mcp.json and run
|
|
180
|
+
const mcpNote = mcpKept ? ` ${C.yellow}!${C.reset} The outerlayer and ${DOCS_MCP_SERVER_NAME} entries were not added to .mcp.json, so their MCP servers are not set up. Add them to .mcp.json by hand, or move the servers you wrote into .outerlayer/mcp.json and run \`${cliInvocation()} context emit\`.
|
|
180
181
|
` : "";
|
|
181
182
|
const what = mcpKept ? "the OuterLayer skills" : "the OuterLayer skills and MCP servers";
|
|
182
183
|
if (paths.length === 0) {
|
|
@@ -1,15 +1,70 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { parseSize } from './chunk-7RQ73DLO.js';
|
|
4
|
-
import { JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_PORT, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-4Q7OMKAT.js';
|
|
5
4
|
import { BUILDKIT_IMAGE } from './chunk-CX22S5BA.js';
|
|
6
|
-
import { compareVersions } from './chunk-
|
|
7
|
-
import { runnerDir } from './chunk-
|
|
5
|
+
import { compareVersions } from './chunk-BMYGAGBJ.js';
|
|
6
|
+
import { runnerDir } from './chunk-N2PXGQRL.js';
|
|
7
|
+
import { CLAUDE_PORT, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-BQXFBI7T.js';
|
|
8
8
|
import { createHash } from 'crypto';
|
|
9
9
|
import { realpathSync } from 'fs';
|
|
10
10
|
import { join, dirname, resolve } from 'path';
|
|
11
11
|
|
|
12
12
|
createRequire(import.meta.url);
|
|
13
|
+
|
|
14
|
+
// src/runner/judge-command.ts
|
|
15
|
+
var JUDGE_DIR = "/outerlayer/judge";
|
|
16
|
+
var JUDGE_HOME = `${JUDGE_DIR}/home`;
|
|
17
|
+
var JUDGE_TREE = `${JUDGE_DIR}/tree`;
|
|
18
|
+
var JUDGE_REPORT = `${JUDGE_DIR}/report.html`;
|
|
19
|
+
var JUDGE_PROGRAM = "/opt/outerlayer/claude/bin/claude";
|
|
20
|
+
var MAX_REPORT_BYTES = 5 * 1024 * 1024;
|
|
21
|
+
var JUDGE_MAX_TURNS = 60;
|
|
22
|
+
var JUDGE_PATH = "/opt/outerlayer/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
|
|
23
|
+
var JUDGE_TOOLS = "Read,Grep,Glob,Write";
|
|
24
|
+
function judgeCommand(input) {
|
|
25
|
+
const env = {
|
|
26
|
+
HOME: JUDGE_HOME,
|
|
27
|
+
TMPDIR: `${JUDGE_HOME}/tmp`,
|
|
28
|
+
PATH: JUDGE_PATH,
|
|
29
|
+
ANTHROPIC_BASE_URL: `http://127.0.0.1:${CLAUDE_PORT}`,
|
|
30
|
+
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1",
|
|
31
|
+
DISABLE_AUTOUPDATER: "1",
|
|
32
|
+
...input.credential === void 0 ? {} : { [input.credential.variable]: input.credential.placeholder }
|
|
33
|
+
};
|
|
34
|
+
const argv = [
|
|
35
|
+
JUDGE_PROGRAM,
|
|
36
|
+
"-p",
|
|
37
|
+
"--output-format",
|
|
38
|
+
"json",
|
|
39
|
+
"--setting-sources",
|
|
40
|
+
"user",
|
|
41
|
+
"--strict-mcp-config",
|
|
42
|
+
"--disable-slash-commands",
|
|
43
|
+
"--no-session-persistence",
|
|
44
|
+
"--tools",
|
|
45
|
+
JUDGE_TOOLS,
|
|
46
|
+
"--allowedTools",
|
|
47
|
+
// A path that starts with two slashes is absolute in a permission rule.
|
|
48
|
+
`Read(/${JUDGE_DIR}/**),Edit(/${JUDGE_REPORT})`,
|
|
49
|
+
"--add-dir",
|
|
50
|
+
JUDGE_TREE,
|
|
51
|
+
"--permission-mode",
|
|
52
|
+
"dontAsk",
|
|
53
|
+
"--max-turns",
|
|
54
|
+
String(JUDGE_MAX_TURNS),
|
|
55
|
+
// After the separator, so a brief that starts with a dash is not read as an option.
|
|
56
|
+
"--",
|
|
57
|
+
input.brief
|
|
58
|
+
];
|
|
59
|
+
return { argv, env, cwd: JUDGE_DIR };
|
|
60
|
+
}
|
|
61
|
+
var HASH_SCRIPT = 'const fs=require("fs"),c=require("crypto");const p=fs.realpathSync(process.argv[1]);process.stdout.write(c.createHash("sha256").update(fs.readFileSync(p)).digest("hex")+" "+p+"\\n")';
|
|
62
|
+
var HASH_ARGV = ["/opt/outerlayer/bin/node", "-e", HASH_SCRIPT, JUDGE_PROGRAM];
|
|
63
|
+
function parseProgramHash(stdout) {
|
|
64
|
+
return /^([0-9a-f]{64}) /.exec(stdout.trim())?.[1];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// src/runner/container/run-args.ts
|
|
13
68
|
var BUILD_LABEL = "ai.outerlayer.build";
|
|
14
69
|
var RUNNER_LABEL = "ai.outerlayer.runner";
|
|
15
70
|
function resolvedRunnerDir(configPath) {
|
|
@@ -71,6 +126,7 @@ function containerRunArgs(input) {
|
|
|
71
126
|
`type=volume,src=${input.volume},dst=/tmp,volume-subpath=tmp`,
|
|
72
127
|
"--mount",
|
|
73
128
|
`type=bind,src=${mountPath(input.buildDir)},dst=${JOB_MOUNT},readonly`,
|
|
129
|
+
...input.judgeDir === void 0 ? [] : ["--mount", `type=bind,src=${mountPath(input.judgeDir)},dst=${JUDGE_DIR}`],
|
|
74
130
|
"--entrypoint",
|
|
75
131
|
"/opt/outerlayer/bin/tini",
|
|
76
132
|
input.image,
|
|
@@ -261,4 +317,4 @@ function ensureBuilder(rawRun, spec, options = {}) {
|
|
|
261
317
|
);
|
|
262
318
|
}
|
|
263
319
|
|
|
264
|
-
export { BUILD_LABEL, MIN_BUILDX_VERSION, RUNNER_LABEL, builderName, builderSpec, buildxState, containerExecArgs, containerRunArgs, ensureBuilder, ensureFailureCount, isOutOfMemory, prepareRunArgs, proxyEnvironment, runnerLabelValue, trackImageBuild };
|
|
320
|
+
export { BUILD_LABEL, HASH_ARGV, JUDGE_DIR, JUDGE_MAX_TURNS, JUDGE_PROGRAM, MAX_REPORT_BYTES, MIN_BUILDX_VERSION, RUNNER_LABEL, builderName, builderSpec, buildxState, containerExecArgs, containerRunArgs, ensureBuilder, ensureFailureCount, isOutOfMemory, judgeCommand, parseProgramHash, prepareRunArgs, proxyEnvironment, runnerLabelValue, trackImageBuild };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-N2PXGQRL.js';
|
|
4
4
|
import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { sanitizeTerminal } from './chunk-
|
|
4
|
-
import { remoteLookupFailed } from './chunk-
|
|
5
|
-
import { DEFAULT_DASHBOARD } from './chunk-
|
|
6
|
-
import { resolveGatewayCredentials } from './chunk-
|
|
3
|
+
import { sanitizeTerminal } from './chunk-MQJSXHV7.js';
|
|
4
|
+
import { remoteLookupFailed } from './chunk-BMYGAGBJ.js';
|
|
5
|
+
import { DEFAULT_DASHBOARD } from './chunk-NACDBXUG.js';
|
|
6
|
+
import { resolveGatewayCredentials } from './chunk-52NC2FIU.js';
|
|
7
7
|
import { readCloudConfig } from './chunk-EABW6AJQ.js';
|
|
8
8
|
import { writeRepoConnection, findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
9
|
+
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
9
10
|
import { execFileSync } from 'child_process';
|
|
10
11
|
import { createInterface } from 'readline/promises';
|
|
11
12
|
|
|
@@ -53,7 +54,7 @@ function notLinkedText(factoryName, repository, url) {
|
|
|
53
54
|
Link it on the factory's Work page: ${url}
|
|
54
55
|
1. Connect GitHub repository, and grant the App access to ${name}.
|
|
55
56
|
2. Link repository, and pick ${name} and its default branch.
|
|
56
|
-
Then run
|
|
57
|
+
Then run \`${cliInvocation()} connect\` again.
|
|
57
58
|
`;
|
|
58
59
|
}
|
|
59
60
|
|
|
@@ -78,6 +79,7 @@ var REASON_TEXT = {
|
|
|
78
79
|
flag: "you passed --factory",
|
|
79
80
|
saved: "already connected",
|
|
80
81
|
linked: "the repository is linked to it",
|
|
82
|
+
owner: "it owns this repository",
|
|
81
83
|
only: "the only factory you can use",
|
|
82
84
|
prompt: "you chose it"
|
|
83
85
|
};
|
|
@@ -128,18 +130,19 @@ function parseFactories(body) {
|
|
|
128
130
|
name: sanitizeTerminal(org.name),
|
|
129
131
|
displayName: sanitizeTerminal(typeof org.displayName === "string" ? org.displayName : org.name)
|
|
130
132
|
},
|
|
131
|
-
linked: typeof row.linked === "boolean" ? row.linked : null
|
|
133
|
+
linked: typeof row.linked === "boolean" ? row.linked : null,
|
|
134
|
+
owner: row.owner === true
|
|
132
135
|
});
|
|
133
136
|
}
|
|
134
137
|
return out;
|
|
135
138
|
}
|
|
136
139
|
function listText(factories, repository) {
|
|
137
|
-
return factories.map((f) => ` ${slug(f)} ${f.displayName}${f.linked === true ? ` (linked to ${repository})` : ""}`).join("\n");
|
|
140
|
+
return factories.map((f) => ` ${slug(f)} ${f.displayName}${f.linked === true && repository !== void 0 ? ` (linked to ${repository})` : ""}`).join("\n");
|
|
138
141
|
}
|
|
139
142
|
async function fetchFactories(fetchImpl, url, token, repository) {
|
|
140
143
|
let res;
|
|
141
144
|
try {
|
|
142
|
-
res = await fetchImpl(`${url.replace(/\/+$/, "")}/v1/me/factories
|
|
145
|
+
res = await fetchImpl(`${url.replace(/\/+$/, "")}/v1/me/factories${repository === void 0 ? "" : `?${new URLSearchParams({ repository }).toString()}`}`, {
|
|
143
146
|
method: "GET",
|
|
144
147
|
headers: { authorization: `Bearer ${token}` },
|
|
145
148
|
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
|
|
@@ -149,7 +152,7 @@ async function fetchFactories(fetchImpl, url, token, repository) {
|
|
|
149
152
|
return { ok: false, result: result(1, "failed", message, message) };
|
|
150
153
|
}
|
|
151
154
|
if (res.status === 401) {
|
|
152
|
-
const message =
|
|
155
|
+
const message = `the gateway refused the login. Run \`${cliInvocation()} login\` to sign in again.`;
|
|
153
156
|
return { ok: false, result: result(1, "failed", message, message) };
|
|
154
157
|
}
|
|
155
158
|
if (!res.ok) {
|
|
@@ -158,7 +161,7 @@ async function fetchFactories(fetchImpl, url, token, repository) {
|
|
|
158
161
|
}
|
|
159
162
|
const factories = parseFactories(await res.json().catch(() => null));
|
|
160
163
|
if (factories === void 0) {
|
|
161
|
-
const message = `${url} answered, but the reply is not a list of factories. Check the gateway address with
|
|
164
|
+
const message = `${url} answered, but the reply is not a list of factories. Check the gateway address with \`${cliInvocation()} doctor\`, then run \`${cliInvocation()} connect\` again.`;
|
|
162
165
|
return { ok: false, result: result(1, "failed", `${url} did not answer with a factory list`, message) };
|
|
163
166
|
}
|
|
164
167
|
return { ok: true, factories };
|
|
@@ -168,6 +171,8 @@ function selectFactory(factories, saved, repository) {
|
|
|
168
171
|
if (remembered) return { factory: remembered, reason: "saved" };
|
|
169
172
|
const linked = factories.filter((f) => f.linked === true);
|
|
170
173
|
if (linked.length === 1) return { factory: linked[0], reason: "linked" };
|
|
174
|
+
const owners = factories.filter((f) => f.owner);
|
|
175
|
+
if (owners.length === 1) return { factory: owners[0], reason: "owner" };
|
|
171
176
|
if (factories.length === 1) return { factory: factories[0], reason: "only" };
|
|
172
177
|
return { factory: void 0, values: factories.map(slug), text: listText(factories, repository) };
|
|
173
178
|
}
|
|
@@ -201,7 +206,7 @@ ${listText(factories, repository)}`;
|
|
|
201
206
|
if (!deps.isTerminal) {
|
|
202
207
|
const why = linked.length > 1 ? `${repository} is linked to more than one factory you can use` : `you can use more than one factory, and none is the only one ${repository} is linked to`;
|
|
203
208
|
const message = `${why}, and there is no terminal to ask on.
|
|
204
|
-
Run
|
|
209
|
+
Run \`${cliInvocation()} connect --factory <org>/<factory>\` with one of:
|
|
205
210
|
${listText(factories, repository)}`;
|
|
206
211
|
return result(1, "failed", "more than one factory fits; pass --factory", message);
|
|
207
212
|
}
|
|
@@ -222,18 +227,18 @@ ${listText(factories, repository)}`;
|
|
|
222
227
|
}))
|
|
223
228
|
});
|
|
224
229
|
const factory = pool.find((f) => f.id === picked);
|
|
225
|
-
if (!factory) return result(1, "failed", "no factory was chosen",
|
|
230
|
+
if (!factory) return result(1, "failed", "no factory was chosen", `no factory was chosen. Run \`${cliInvocation()} connect\` again, or pass --factory <org>/<factory>.`);
|
|
226
231
|
return { factory, reason: "prompt" };
|
|
227
232
|
}
|
|
228
233
|
async function runConnect(flags, deps) {
|
|
229
234
|
const creds = resolveGatewayCredentials({ home: deps.home, env: deps.env, cwd: deps.cwd });
|
|
230
235
|
if (creds.credential === void 0) {
|
|
231
|
-
const message =
|
|
232
|
-
return { ...result(1, "skipped",
|
|
236
|
+
const message = `no saved credential. Run \`${cliInvocation()} login\` to sign in, then run \`${cliInvocation()} connect\` again.`;
|
|
237
|
+
return { ...result(1, "skipped", `no credential; run \`${cliInvocation()} login\` first`, message), next: `Run \`${cliInvocation()} login\`, then \`${cliInvocation()} init\` again.` };
|
|
233
238
|
}
|
|
234
239
|
if (creds.kind === "key") {
|
|
235
240
|
if (flags.factory !== void 0 && flags.factory !== creds.appId) {
|
|
236
|
-
const message2 = `a factory key decides the factory${creds.appId ? ` (${creds.appId})` : ""}, so --factory ${flags.factory} cannot apply. Remove --factory, or sign in with
|
|
241
|
+
const message2 = `a factory key decides the factory${creds.appId ? ` (${creds.appId})` : ""}, so --factory ${flags.factory} cannot apply. Remove --factory, or sign in with \`${cliInvocation()} login\` and unset the key.`;
|
|
237
242
|
return result(1, "failed", "--factory names a factory other than the key's", message2);
|
|
238
243
|
}
|
|
239
244
|
const message = `Your factory key decides the factory${creds.appId ? ` (${creds.appId})` : ""}, so there is nothing to connect. No file was changed.`;
|
|
@@ -244,14 +249,14 @@ async function runConnect(flags, deps) {
|
|
|
244
249
|
}
|
|
245
250
|
const repository = deps.resolveRepository(deps.cwd);
|
|
246
251
|
if (repository === void 0 && remoteLookupFailed(deps.cwd)) {
|
|
247
|
-
const message =
|
|
252
|
+
const message = `git did not answer when asked for this repository's remote, so connect cannot tell which repository it is. Run \`git remote -v\` here, then run \`${cliInvocation()} connect\` again.`;
|
|
248
253
|
return result(1, "failed", "git could not read this repository's remote", message);
|
|
249
254
|
}
|
|
250
255
|
if (repository === void 0) {
|
|
251
|
-
return result(1, "skipped", "this repository has no git remote",
|
|
256
|
+
return result(1, "skipped", "this repository has no git remote", `this repository has no git remote, so connect cannot tell which repository it is. Add one (\`git remote add origin <url>\`), then run \`${cliInvocation()} connect\` again.`);
|
|
252
257
|
}
|
|
253
258
|
if (creds.url === void 0) {
|
|
254
|
-
const message =
|
|
259
|
+
const message = `no gateway address is saved. Run \`${cliInvocation()} login\` to sign in.`;
|
|
255
260
|
return result(1, "failed", message, message);
|
|
256
261
|
}
|
|
257
262
|
const listed = await fetchFactories(deps.fetchImpl, creds.url, creds.credential, repository);
|
|
@@ -281,7 +286,7 @@ async function runConnect(flags, deps) {
|
|
|
281
286
|
const linkUrl = workPageUrl(deps.home, factory.organization.name, factory.name);
|
|
282
287
|
return { ...result(EXIT_NOT_LINKED, "done", why, connected + notLinkedText(factory.displayName, repository, linkUrl)), ...chosen, linked, linkUrl };
|
|
283
288
|
}
|
|
284
|
-
const changeIt =
|
|
289
|
+
const changeIt = `Run \`${cliInvocation()} connect --factory <org>/<factory>\` to change it.`;
|
|
285
290
|
const text = linked === null ? `${connected}Could not check whether ${sanitizeTerminal(repository)} is linked to ${factory.displayName}.
|
|
286
291
|
${changeIt}` : connected + changeIt;
|
|
287
292
|
return { ...result(0, "done", why, text), ...chosen, linked };
|
|
@@ -310,4 +315,4 @@ ${COMMIT_LINE}
|
|
|
310
315
|
return r.code;
|
|
311
316
|
}
|
|
312
317
|
|
|
313
|
-
export { COMMIT_LINE, autoConnectedLine, fetchFactories, isLinkedRepository, promptOnTerminal, realConnectDeps, runConnect, runConnectCommand, saveFactoryConnection, selectFactory, workPageUrl };
|
|
318
|
+
export { COMMIT_LINE, autoConnectedLine, dashboardBase, fetchFactories, isLinkedRepository, listText, promptOnTerminal, realConnectDeps, runConnect, runConnectCommand, saveFactoryConnection, selectFactory, slug, workPageUrl };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-N2PXGQRL.js';
|
|
4
4
|
import { existsSync, readFileSync, mkdirSync, chmodSync, writeFileSync } from 'fs';
|
|
5
5
|
import { dirname, join } from 'path';
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { DEFAULT_UNIT_NAME } from './chunk-
|
|
3
|
+
import { DEFAULT_UNIT_NAME } from './chunk-WGAUY5LE.js';
|
|
4
4
|
import { parseRunnerEnv } from './chunk-6MZSX4M7.js';
|
|
5
|
-
import { RUNNER_FILE_MODE } from './chunk-
|
|
5
|
+
import { RUNNER_FILE_MODE } from './chunk-N2PXGQRL.js';
|
|
6
6
|
import { existsSync, readFileSync, writeFileSync, renameSync, rmSync } from 'fs';
|
|
7
7
|
import { join, dirname } from 'path';
|
|
8
8
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { parseTrackerNumber } from './chunk-WZBHBH3J.js';
|
|
4
|
+
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
4
5
|
import { mkdirSync, appendFileSync, readFileSync } from 'fs';
|
|
5
6
|
import { join } from 'path';
|
|
6
7
|
|
|
7
8
|
createRequire(import.meta.url);
|
|
8
|
-
var HOW_TO_CREATE_AN_ITEM =
|
|
9
|
+
var HOW_TO_CREATE_AN_ITEM = `${cliInvocation()} work build --local`;
|
|
9
10
|
function parseWorkItemEnv(raw) {
|
|
10
11
|
if (raw === void 0) return { reason: "OUTERLAYER_WORK is not set" };
|
|
11
12
|
const value = raw.trim();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { skillDir, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-
|
|
4
|
-
import { emitTree, ALL_TARGET_IDS, classifyTree } from './chunk-
|
|
3
|
+
import { skillDir, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-MNTSH4CL.js';
|
|
4
|
+
import { emitTree, ALL_TARGET_IDS, classifyTree } from './chunk-X5N6KC6V.js';
|
|
5
|
+
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
5
6
|
import { readFileSync, existsSync, unlinkSync, rmdirSync, readdirSync } from 'fs';
|
|
6
7
|
import { join, dirname, relative, sep } from 'path';
|
|
7
8
|
|
|
@@ -70,7 +71,7 @@ function checkFormerSkillNames(repoRoot) {
|
|
|
70
71
|
name: "Renamed skills",
|
|
71
72
|
status: "warn",
|
|
72
73
|
detail: `copies under earlier names: ${retired.map(skillDir).join(", ")}`,
|
|
73
|
-
fix:
|
|
74
|
+
fix: `Run \`${cliInvocation()} context emit\` to replace them with the current names, then commit.`
|
|
74
75
|
});
|
|
75
76
|
}
|
|
76
77
|
const hits = filesNamingFormerSkills(repoRoot);
|
|
@@ -79,7 +80,7 @@ function checkFormerSkillNames(repoRoot) {
|
|
|
79
80
|
name: "Skill names",
|
|
80
81
|
status: "warn",
|
|
81
82
|
detail: `${hits.map((h) => `${h.path} (${h.formers.join(", ")})`).join("; ")} still ${hits.length === 1 ? "names" : "name"} a skill by an earlier name`,
|
|
82
|
-
fix: `Replace each earlier name with the current one: ${Object.entries(FORMER_MAINTAINED_NAMES).map(([former, current]) => `${former} \u2192 ${current}`).join(", ")}.
|
|
83
|
+
fix: `Replace each earlier name with the current one: ${Object.entries(FORMER_MAINTAINED_NAMES).map(([former, current]) => `${former} \u2192 ${current}`).join(", ")}. \`${cliInvocation()} init --update\` does this for a file you have not edited.`
|
|
83
84
|
});
|
|
84
85
|
}
|
|
85
86
|
return checks;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
+
import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-G2YNJIGF.js';
|
|
3
4
|
import { deadHooksState, huskyPrepareScript, preparePackageManagerCommand } from './chunk-XCCLFVXM.js';
|
|
5
|
+
import { appendContextProvenance } from './chunk-ZJSNLVCE.js';
|
|
4
6
|
import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
7
|
+
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
5
8
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
6
9
|
import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, statSync, appendFileSync, opendirSync, unlinkSync } from 'fs';
|
|
7
10
|
import { spawn, execFileSync } from 'child_process';
|
|
@@ -56,7 +59,7 @@ function assessSyncHealth(status, now = Date.now(), staleAfterMs = SYNC_STALE_AF
|
|
|
56
59
|
return {
|
|
57
60
|
level: "unknown",
|
|
58
61
|
headline: "no sync has run on this machine yet",
|
|
59
|
-
details: [
|
|
62
|
+
details: [`run \`${cliInvocation()} sync\` once to verify the connection`]
|
|
60
63
|
};
|
|
61
64
|
}
|
|
62
65
|
const host = status.url ? safeHost(status.url) : "the configured endpoint";
|
|
@@ -71,7 +74,7 @@ function assessSyncHealth(status, now = Date.now(), staleAfterMs = SYNC_STALE_AF
|
|
|
71
74
|
);
|
|
72
75
|
if (status.pending) details.push(`${status.pending} session(s) waiting to ship`);
|
|
73
76
|
if (status.held) details.push(`${status.held} transcript(s) held \u2014 their launch could not be determined`);
|
|
74
|
-
details.push(
|
|
77
|
+
details.push(`run \`${cliInvocation()} doctor\` for the full picture`);
|
|
75
78
|
return {
|
|
76
79
|
level: "error",
|
|
77
80
|
headline: `sync is FAILING \u2014 last attempt ${formatAgo(now - Date.parse(status.at))}`,
|
|
@@ -104,7 +107,7 @@ function assessSyncHealth(status, now = Date.now(), staleAfterMs = SYNC_STALE_AF
|
|
|
104
107
|
headline: `sync ran ${formatAgo(age)} but ${host} has never been reached`,
|
|
105
108
|
details: [
|
|
106
109
|
"every run so far had an empty queue, so the connection is unproven",
|
|
107
|
-
|
|
110
|
+
`run \`${cliInvocation()} sync --all\` to verify it`
|
|
108
111
|
]
|
|
109
112
|
};
|
|
110
113
|
}
|
|
@@ -388,7 +391,7 @@ function hookErrorsContext(home, writtenBytes, seenBytes) {
|
|
|
388
391
|
}
|
|
389
392
|
async function handleWorkLaunch(sessionId, home, env, spawnImpl = spawnDetached, cwd = process.cwd()) {
|
|
390
393
|
if (!sessionId || env.OUTERLAYER_WORK === void 0) return void 0;
|
|
391
|
-
const { parseWorkItemEnv, appendLaunchRecord } = await import('./work-launch-
|
|
394
|
+
const { parseWorkItemEnv, appendLaunchRecord } = await import('./work-launch-LEQ2MPM3.js');
|
|
392
395
|
const parsed = parseWorkItemEnv(env.OUTERLAYER_WORK);
|
|
393
396
|
if ("reason" in parsed) {
|
|
394
397
|
logHookError(home, new Error(`OUTERLAYER_WORK ignored: ${parsed.reason}`));
|
|
@@ -433,7 +436,7 @@ async function missingRenewalHookContext(home, cwd) {
|
|
|
433
436
|
const registeredIn = (settings) => (settings.hooks?.PostToolUse ?? []).some((block) => (block.hooks ?? []).some((h) => isOurHookCommand(h)));
|
|
434
437
|
const registered = userSettings !== null && registeredIn(userSettings) || projectSettings !== null && registeredIn(projectSettings);
|
|
435
438
|
if (registered) return void 0;
|
|
436
|
-
return
|
|
439
|
+
return `This install has no PostToolUse hook, so this session's work-item lease will never be renewed while it works and may be lost to another worker mid-session. Run \`${cliInvocation()} init\` to register it.`;
|
|
437
440
|
} catch {
|
|
438
441
|
return void 0;
|
|
439
442
|
}
|
|
@@ -454,7 +457,7 @@ async function maybeRenewWorkLease(event, sessionId, home = homeFromEnv(), env =
|
|
|
454
457
|
if (now - statSync(marker).mtimeMs < WORK_LEASE_RENEW_DEBOUNCE_MS) return;
|
|
455
458
|
} catch {
|
|
456
459
|
}
|
|
457
|
-
const { parseWorkItemEnv } = await import('./work-launch-
|
|
460
|
+
const { parseWorkItemEnv } = await import('./work-launch-LEQ2MPM3.js');
|
|
458
461
|
const parsed = parseWorkItemEnv(env.OUTERLAYER_WORK);
|
|
459
462
|
if ("reason" in parsed) return;
|
|
460
463
|
writeFileSync(marker, String(now));
|
|
@@ -470,7 +473,7 @@ async function handleWorkSessionEnd(event, sessionId, _home = homeFromEnv(), env
|
|
|
470
473
|
try {
|
|
471
474
|
if (event !== "SessionEnd") return;
|
|
472
475
|
if (!sessionId || env.OUTERLAYER_WORK === void 0) return;
|
|
473
|
-
const { parseWorkItemEnv } = await import('./work-launch-
|
|
476
|
+
const { parseWorkItemEnv } = await import('./work-launch-LEQ2MPM3.js');
|
|
474
477
|
const parsed = parseWorkItemEnv(env.OUTERLAYER_WORK);
|
|
475
478
|
if ("reason" in parsed) return;
|
|
476
479
|
spawnImpl(
|
|
@@ -487,7 +490,7 @@ function syncHealthContext(home) {
|
|
|
487
490
|
if (health.level !== "error") return null;
|
|
488
491
|
return [`OuterLayer sync is failing on this machine: ${health.headline}`, ...health.details.map((d) => ` - ${d}`)].join("\n");
|
|
489
492
|
}
|
|
490
|
-
var UNTRUSTED_STALE_CLI_CONTEXT =
|
|
493
|
+
var UNTRUSTED_STALE_CLI_CONTEXT = `The installed OuterLayer CLI appears stale relative to a checkout near your working directory; run \`${cliInvocation()} doctor\` for details.`;
|
|
491
494
|
function installedCliStalenessContext(home, cwd) {
|
|
492
495
|
const result = checkInstalledCliStaleness({ home, cwd });
|
|
493
496
|
if (result === null || !result.stale) return null;
|
|
@@ -547,10 +550,10 @@ function deadHooksAutoHealContext(cwd, home) {
|
|
|
547
550
|
const hooksDirLabel = sanitizeForContext(state.hooksDir);
|
|
548
551
|
const script = huskyPrepareScript(state.repoRoot);
|
|
549
552
|
if (script === null) {
|
|
550
|
-
return `Git hooks are dead in this checkout (${hooksDirLabel} is missing or empty, via core.hooksPath) and package.json declares no husky prepare script to run automatically. Run
|
|
553
|
+
return `Git hooks are dead in this checkout (${hooksDirLabel} is missing or empty, via core.hooksPath) and package.json declares no husky prepare script to run automatically. Run \`${cliInvocation()} doctor\` for the fix.`;
|
|
551
554
|
}
|
|
552
555
|
if (recentHealFailure(home, state.repoRoot)) {
|
|
553
|
-
return `Git hooks are still dead in this checkout (${hooksDirLabel}) \u2014 a previous auto-heal attempt failed recently, so it will not retry yet. Run
|
|
556
|
+
return `Git hooks are still dead in this checkout (${hooksDirLabel}) \u2014 a previous auto-heal attempt failed recently, so it will not retry yet. Run \`${cliInvocation()} doctor\` for the fix.`;
|
|
554
557
|
}
|
|
555
558
|
const command = preparePackageManagerCommand(state.repoRoot);
|
|
556
559
|
const [bin, ...args] = command.split(" ");
|
|
@@ -563,7 +566,7 @@ function deadHooksAutoHealContext(cwd, home) {
|
|
|
563
566
|
const after = deadHooksState(state.repoRoot);
|
|
564
567
|
if (after.dead) {
|
|
565
568
|
markHealFailure(home, state.repoRoot);
|
|
566
|
-
return `OuterLayer ran \`${command}\` to regenerate dead git hooks, but ${hooksDirLabel} is still missing or empty afterward. Run
|
|
569
|
+
return `OuterLayer ran \`${command}\` to regenerate dead git hooks, but ${hooksDirLabel} is still missing or empty afterward. Run \`${cliInvocation()} doctor\` for the fix.`;
|
|
567
570
|
}
|
|
568
571
|
clearHealFailureMarker(home, state.repoRoot);
|
|
569
572
|
return null;
|
|
@@ -594,6 +597,29 @@ function contextPossiblyGoverned(cwd, home = homeFromEnv()) {
|
|
|
594
597
|
return false;
|
|
595
598
|
}
|
|
596
599
|
}
|
|
600
|
+
function recordDeliveredContext(cwd, sessionId, home) {
|
|
601
|
+
const dirs = findGitDirs(cwd);
|
|
602
|
+
if (dirs === void 0) return;
|
|
603
|
+
let record;
|
|
604
|
+
try {
|
|
605
|
+
record = JSON.parse(readFileSync(join(dirs.gitCommonDir, "outerlayer", "delivery.json"), "utf8"));
|
|
606
|
+
} catch {
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
if (typeof record.repository !== "string" || typeof record.sha !== "string") return;
|
|
610
|
+
appendContextProvenance(
|
|
611
|
+
{
|
|
612
|
+
t: (/* @__PURE__ */ new Date()).toISOString(),
|
|
613
|
+
sessionId,
|
|
614
|
+
repoRoot: dirs.repoRoot,
|
|
615
|
+
repository: record.repository,
|
|
616
|
+
...typeof record.ref === "string" ? { ref: record.ref } : {},
|
|
617
|
+
sha: record.sha,
|
|
618
|
+
verification: "verified"
|
|
619
|
+
},
|
|
620
|
+
home
|
|
621
|
+
);
|
|
622
|
+
}
|
|
597
623
|
async function runHookFast(event, home = homeFromEnv(), read = readStdin, env = process.env, spawnImpl = spawnDetached) {
|
|
598
624
|
try {
|
|
599
625
|
const stdin = read();
|
|
@@ -632,9 +658,15 @@ async function runHookFast(event, home = homeFromEnv(), read = readStdin, env =
|
|
|
632
658
|
const hookErrorsBytes = fileSizeBytes(join(dir, "hook-errors.log"));
|
|
633
659
|
const hookErrorsSeen = hookErrorsSeenBytes(home);
|
|
634
660
|
recordHookErrorsSeen(home, hookErrorsBytes);
|
|
635
|
-
if (
|
|
661
|
+
if (env[CONTROL_PLANE_DIR_VARIABLE] !== void 0) {
|
|
662
|
+
try {
|
|
663
|
+
recordDeliveredContext(sessionCwd, typeof payload.session_id === "string" ? payload.session_id : "unknown", home);
|
|
664
|
+
} catch (err) {
|
|
665
|
+
logHookError(home, err);
|
|
666
|
+
}
|
|
667
|
+
} else if (contextPossiblyGoverned(sessionCwd, home)) {
|
|
636
668
|
try {
|
|
637
|
-
const { materializeContext: materialize } = await import('./context-materialize-
|
|
669
|
+
const { materializeContext: materialize } = await import('./context-materialize-Y5IJ4MQT.js');
|
|
638
670
|
const sessionId = typeof payload.session_id === "string" ? payload.session_id : "unknown";
|
|
639
671
|
const result = await materialize({ cwd: sessionCwd, sessionId, home });
|
|
640
672
|
materializeMessage = result.message;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { LiveUploader } from './chunk-
|
|
4
|
-
import { CaptureDaemon } from './chunk-
|
|
5
|
-
import { parseWorkItemEnv } from './chunk-
|
|
6
|
-
import { spoolDir } from './chunk-
|
|
3
|
+
import { LiveUploader } from './chunk-JF42URPU.js';
|
|
4
|
+
import { CaptureDaemon } from './chunk-BMYGAGBJ.js';
|
|
5
|
+
import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
|
|
6
|
+
import { spoolDir } from './chunk-ULSIJGLS.js';
|
|
7
7
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
8
8
|
import { mkdirSync, writeFileSync, rmSync } from 'fs';
|
|
9
9
|
import { join } from 'path';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { currentLink } from './chunk-
|
|
3
|
+
import { currentLink } from './chunk-AMFWYESY.js';
|
|
4
4
|
import { readFileSync, statSync, chmodSync, mkdirSync, writeFileSync, renameSync, rmSync, existsSync, lstatSync, accessSync, constants, realpathSync } from 'fs';
|
|
5
5
|
import { randomBytes } from 'crypto';
|
|
6
6
|
import { join, dirname, delimiter, resolve } from 'path';
|