@outerlayer/cli 0.22.2 → 0.24.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 +21 -0
- package/README.md +4 -0
- package/dist/agent-setup-QQYRBPK2.js +30 -0
- package/dist/{artifact-link-cmd-OWRI5AJX.js → artifact-link-cmd-LEI6EOZE.js} +2 -2
- package/dist/{bridge-QFN3KJP6.js → bridge-4ZARDVGS.js} +2 -2
- package/dist/{build-6WRNZPVR.js → build-OVZIT2G2.js} +5 -5
- package/dist/build-info.json +1 -1
- package/dist/{builder-G3MLDMTI.js → builder-MECDEKXX.js} +6 -6
- package/dist/{check-N6WLZCER.js → check-YYKNYFNI.js} +46 -44
- package/dist/{chunk-IPS2JCHK.js → chunk-5ECUMU53.js} +7 -7
- package/dist/{chunk-XR56WEA5.js → chunk-5XCAPBE2.js} +4 -4
- package/dist/{chunk-KOIMUHIS.js → chunk-6GSA2SKT.js} +20 -20
- package/dist/{chunk-HWZCE745.js → chunk-755WXDBI.js} +2 -2
- package/dist/{chunk-SFHR45FA.js → chunk-A62QFN2M.js} +3 -3
- package/dist/{chunk-URWYRAIC.js → chunk-BN3CSI7S.js} +0 -2
- package/dist/{chunk-ZCXP35T3.js → chunk-BOQY756V.js} +9 -8
- package/dist/{chunk-BVR6MQLS.js → chunk-BUBCPP3F.js} +3 -3
- package/dist/{chunk-G3IJ3N6F.js → chunk-BUP5N3X6.js} +1 -1
- package/dist/{chunk-WXJXHZVB.js → chunk-CZUH2SLQ.js} +1 -1
- package/dist/{chunk-AEKSX4EY.js → chunk-D4AMAEZ7.js} +13 -12
- package/dist/{chunk-U6RKHNC7.js → chunk-D7K446H6.js} +8 -8
- package/dist/{chunk-V5CG75NX.js → chunk-D7X5ITVT.js} +1 -1
- package/dist/{chunk-OBCFK4QD.js → chunk-DG2ULWM6.js} +2 -2
- package/dist/{chunk-SNVXHNU7.js → chunk-E4OUL7ZP.js} +5 -5
- package/dist/{chunk-B42BIYC6.js → chunk-F2W2IYNP.js} +3 -3
- package/dist/{chunk-JD6GWYY7.js → chunk-F7Y2USIM.js} +5 -5
- package/dist/{chunk-QS43O4DR.js → chunk-FKXGQOF5.js} +1 -1
- package/dist/{chunk-JV4YGAAW.js → chunk-FQPN5S4Q.js} +4 -4
- package/dist/{chunk-XACXXKQ5.js → chunk-FWEWFW3F.js} +1 -1
- package/dist/{chunk-WKSBSEWT.js → chunk-GU4PKXN7.js} +13 -13
- package/dist/{chunk-2CPOAPU4.js → chunk-H6IUKXXI.js} +90 -24
- package/dist/{chunk-5OCIHFGE.js → chunk-HBISTTG3.js} +32 -23
- package/dist/{chunk-EFB3FGLC.js → chunk-HHXBOTRO.js} +1 -1
- package/dist/chunk-IDSHLKQA.js +66 -0
- package/dist/chunk-JKNYTNYD.js +151 -0
- package/dist/{chunk-IHNQWF6F.js → chunk-KF37SUDM.js} +1 -1
- package/dist/{chunk-4AVDD7VX.js → chunk-LBCZXXOX.js} +2 -2
- package/dist/{chunk-NYTZ7HVN.js → chunk-LY2L3O2O.js} +1 -1
- package/dist/{chunk-USWVXQIH.js → chunk-MQ743JX3.js} +3 -3
- package/dist/{chunk-CQAEV3Z5.js → chunk-NGZID7UI.js} +1 -1
- package/dist/{chunk-UF5L4BAI.js → chunk-NTQTDCYR.js} +1 -1
- package/dist/{chunk-2Q3PZ42G.js → chunk-PDIM5T65.js} +1 -1
- package/dist/{chunk-OW52QLK3.js → chunk-PVRBE7S4.js} +1 -1
- package/dist/{chunk-7VUK5RFS.js → chunk-QZBXLLTV.js} +36 -1
- package/dist/{chunk-WFSUUUAN.js → chunk-RKOTJQVG.js} +1 -1
- package/dist/{chunk-FQE5RDHI.js → chunk-RVYOOYOA.js} +7 -7
- package/dist/{chunk-IMCVQF5F.js → chunk-TQ6Y7YV6.js} +6 -6
- package/dist/{chunk-I2UOAV7X.js → chunk-TQMI335S.js} +4 -1
- package/dist/{chunk-3AZYLAJC.js → chunk-TTLVQZSH.js} +4 -4
- package/dist/{chunk-EMUNEAQK.js → chunk-V5Q3S4NM.js} +19 -7
- package/dist/{chunk-FVDVC2GF.js → chunk-VBEXKEBV.js} +1 -1
- package/dist/{chunk-V7SAQ645.js → chunk-VJBFQP3H.js} +21 -12
- package/dist/{chunk-ZNPE7FW5.js → chunk-VPEGE3QZ.js} +1 -1
- package/dist/{chunk-276D7BJ7.js → chunk-VV7ZD5LR.js} +1 -1
- package/dist/{chunk-W3SWJ2TD.js → chunk-VWFOKRYS.js} +5 -2
- package/dist/{chunk-4542B3RR.js → chunk-W7O4LA4E.js} +3 -3
- package/dist/{chunk-4OYKJJ2V.js → chunk-WH2QV3UL.js} +86 -6
- package/dist/{chunk-XCRZTXRL.js → chunk-WX2WEERU.js} +63 -43
- package/dist/{chunk-VSUXCMMH.js → chunk-XFGL53GU.js} +51 -33
- package/dist/{chunk-EAQSOE62.js → chunk-XSPA5ODY.js} +21 -19
- package/dist/{chunk-QZX6DAAW.js → chunk-ZFLOFAUG.js} +11 -11
- package/dist/{claude-launcher-QD3C427Y.js → claude-launcher-JCPSHDZQ.js} +5 -5
- package/dist/{cli-A2Y67WAB.js → cli-ZTBH3FBG.js} +173 -137
- package/dist/{command-Q5Q2EIO4.js → command-DO4TERRT.js} +34 -33
- package/dist/{config-H4QS332G.js → config-7Z5DHSGY.js} +2 -2
- package/dist/connect-cmd-NY5LIKVC.js +25 -0
- package/dist/container-start-OHBUZEJJ.js +170 -0
- package/dist/{context-cleanup-DSA3HGQU.js → context-cleanup-LTH77FC3.js} +3 -3
- package/dist/{control-plane-launch-HE6OSWKO.js → control-plane-launch-GKGI6HJA.js} +11 -11
- package/dist/{dist-7IH56ELA.js → dist-2APO44JG.js} +2 -2
- package/dist/{docker-JU422JL7.js → docker-RKGBJESN.js} +6 -6
- package/dist/{doctor-BRN4BGMA.js → doctor-DOAFZV4O.js} +47 -34
- package/dist/{emit-artifact-cmd-GPAJCCUC.js → emit-artifact-cmd-VZHIDPXQ.js} +18 -15
- package/dist/emit-cmd-WQH2NK7H.js +15 -0
- package/dist/{emit-criteria-cmd-R3FKHSQG.js → emit-criteria-cmd-SYLBCWHW.js} +15 -12
- package/dist/{emit-finding-cmd-IK7RAVP5.js → emit-finding-cmd-52M43NPC.js} +15 -12
- package/dist/{emit-result-cmd-5FJTF7YD.js → emit-result-cmd-BTMTGDAV.js} +18 -15
- package/dist/{emit-step-cmd-VRTD5YPP.js → emit-step-cmd-6XTJITZT.js} +16 -13
- package/dist/{exec-client-ATPF2DDB.js → exec-client-CKPK62K2.js} +3 -3
- package/dist/governing-source-GWN7GVEN.js +35 -0
- package/dist/{guest-init-2OZ4YC7R.js → guest-init-ZBL5CN7Y.js} +4 -4
- package/dist/{hook-fast-QUGEI2IT.js → hook-fast-3JL4PXLG.js} +1 -1
- package/dist/{host-key-ATB23GI3.js → host-key-W2DLZGZ7.js} +3 -3
- package/dist/image-tag-AO4RBAKW.js +10 -0
- package/dist/{import-capture-cmd-Q56DDZVO.js → import-capture-cmd-TCOKNVBM.js} +12 -7
- package/dist/{import-ruler-cmd-T6LLO6Q7.js → import-ruler-cmd-VJOHOJQ7.js} +2 -2
- package/dist/index.js +4 -4
- package/dist/{init-X7FCQDFX.js → init-EQTR7AEF.js} +32 -31
- package/dist/init-TSQ3EOQW.js +52 -0
- package/dist/{init-cmd-VCKH2DUQ.js → init-cmd-AF2MH36A.js} +24 -23
- package/dist/init-update-SHISHMXV.js +555 -0
- package/dist/{install-SFACZU7E.js → install-ORQC26ZE.js} +4 -4
- package/dist/{install-cmd-6HTP7I43.js → install-cmd-4LA3UJZ4.js} +6 -6
- package/dist/layout-UOJQGEPW.js +10 -0
- package/dist/{login-browser-BN5UKPHS.js → login-browser-4OMZFP3U.js} +4 -3
- package/dist/{logout-cmd-RZFWTNYD.js → logout-cmd-5V5MMBSY.js} +2 -2
- package/dist/{logs-N3ZX7HFV.js → logs-5EPHIPZB.js} +2 -2
- package/dist/loop-4WUCS5JP.js +77 -0
- package/dist/machine-6UNLIPLE.js +47 -0
- package/dist/{mcp-install-cmd-GD4QUP7Z.js → mcp-install-cmd-GGWB3JJ2.js} +2 -2
- package/dist/{mcp-serve-cmd-TQSPFRC7.js → mcp-serve-cmd-KMWEKM7C.js} +5 -5
- package/dist/{paths-AKX2OOLF.js → paths-XY5ADO32.js} +2 -2
- package/dist/{pending-7SGWZCEH.js → pending-35J3ZPLR.js} +3 -3
- package/dist/{pidfile-G2J5WBQS.js → pidfile-OJ7RP4Q2.js} +3 -3
- package/dist/{record-Q4IEYIVV.js → record-BEJB4J7N.js} +3 -3
- package/dist/{runner-env-GZHXM27A.js → runner-env-ZJWJOJKQ.js} +5 -5
- package/dist/{runner-identity-FTHZFMGY.js → runner-identity-2OOUJSFJ.js} +6 -6
- package/dist/{runner-key-O42EUXQU.js → runner-key-WDFBSJRX.js} +32 -31
- package/dist/{session-sender-HF6DXFA2.js → session-sender-X3BBQZMF.js} +19 -16
- package/dist/{spec-cmd-ADPH236D.js → spec-cmd-QRF5YXKK.js} +16 -13
- package/dist/{starter-pack-5EQYGSJF.js → starter-pack-55EFILC5.js} +7 -4
- package/dist/{status-LXFIVGP3.js → status-ZCAAF6MD.js} +43 -34
- package/dist/{sync-cmd-5XS3CUV5.js → sync-cmd-UQK3RYAC.js} +18 -15
- package/dist/{watch-FBZHZV56.js → watch-MOQ3GQTE.js} +18 -15
- package/dist/{work-claim-cmd-LIIINECF.js → work-claim-cmd-RT343CLA.js} +19 -16
- package/dist/{work-cmd-SM6DY2WK.js → work-cmd-APXSER2D.js} +16 -13
- package/dist/{work-comment-cmd-VYVXGT4W.js → work-comment-cmd-AT5NUYUU.js} +16 -13
- package/dist/{work-logs-cmd-XZSCWWMW.js → work-logs-cmd-Z5DMNEJP.js} +16 -13
- package/dist/{work-open-pr-cmd-YZNC3P3R.js → work-open-pr-cmd-ZTS6MJHL.js} +17 -14
- package/dist/{work-pr-cmd-AMN23KFJ.js → work-pr-cmd-IWZCC3WH.js} +16 -13
- package/dist/{work-stop-cmd-HSR2GOJJ.js → work-stop-cmd-DCAWFDZC.js} +16 -13
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-build/references/agent-briefs.md +7 -1
- package/skill-pack/maintained/outerlayer-build/references/criteria-judge.md +10 -0
- package/skill-pack/maintained/outerlayer-build/references/review-briefs.md +4 -0
- package/skill-pack/maintained/outerlayer-cli/SKILL.md +5 -3
- package/dist/agent-setup-KXPDPTAJ.js +0 -27
- package/dist/connect-cmd-TNGEIWCA.js +0 -22
- package/dist/emit-cmd-3W5IO5ET.js +0 -14
- package/dist/governing-source-WM736XR4.js +0 -34
- package/dist/init-U3I43XCP.js +0 -51
- package/dist/init-update-TCMH7M3Q.js +0 -210
- package/dist/loop-P3QDQOE5.js +0 -75
- package/dist/machine-EEFOW32K.js +0 -46
- package/dist/{chunk-F35VMF5M.js → chunk-GOSFARMS.js} +1 -1
- package/dist/{chunk-DIB2WLBL.js → chunk-YVZJ6GKF.js} +1 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE } from './chunk-HBISTTG3.js';
|
|
4
|
+
import { normalizePath, CONTEXT_PIN_FILENAME } from './chunk-RKOTJQVG.js';
|
|
5
|
+
import { existsSync, readdirSync, readFileSync, mkdirSync, writeFileSync, lstatSync, readlinkSync, symlinkSync, rmdirSync } from 'fs';
|
|
6
|
+
import { relative, sep, join } from 'path';
|
|
7
|
+
|
|
8
|
+
createRequire(import.meta.url);
|
|
9
|
+
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git"]);
|
|
10
|
+
function toRepoRelative(repoRoot, absPath) {
|
|
11
|
+
return normalizePath(relative(repoRoot, absPath).split(sep).join("/"));
|
|
12
|
+
}
|
|
13
|
+
function isForeignTree(dir) {
|
|
14
|
+
return existsSync(join(dir, ".git")) || existsSync(join(dir, CONTEXT_PIN_FILENAME));
|
|
15
|
+
}
|
|
16
|
+
function discoverOuterlayerPaths(repoRoot) {
|
|
17
|
+
const out = [];
|
|
18
|
+
walk(repoRoot, repoRoot, false, out);
|
|
19
|
+
return out.sort();
|
|
20
|
+
}
|
|
21
|
+
function walk(dir, repoRoot, insideOuterlayer, out) {
|
|
22
|
+
let entries;
|
|
23
|
+
try {
|
|
24
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
25
|
+
} catch {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
for (const entry of entries) {
|
|
29
|
+
if (entry.isSymbolicLink()) continue;
|
|
30
|
+
const full = join(dir, entry.name);
|
|
31
|
+
if (entry.isDirectory()) {
|
|
32
|
+
if (!insideOuterlayer && SKIP_DIRS.has(entry.name)) continue;
|
|
33
|
+
if (!insideOuterlayer && isForeignTree(full)) continue;
|
|
34
|
+
walk(full, repoRoot, insideOuterlayer || entry.name === ".outerlayer", out);
|
|
35
|
+
} else if (entry.isFile() && insideOuterlayer) {
|
|
36
|
+
out.push(toRepoRelative(repoRoot, full));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// src/layout.ts
|
|
42
|
+
var AGENTS_MD_LAYOUT = 2;
|
|
43
|
+
var FIRST_VERSION_READING_AGENTS_SKILLS = "0.21.0";
|
|
44
|
+
var SKILLS_LINK_PATH = ".claude/skills";
|
|
45
|
+
var SKILLS_LINK_TARGET = "../.agents/skills";
|
|
46
|
+
var CONFIG_PATH = ".outerlayer/config.json";
|
|
47
|
+
function readConfigObject(repoRoot) {
|
|
48
|
+
try {
|
|
49
|
+
const doc = JSON.parse(readFileSync(join(repoRoot, CONFIG_PATH), "utf8"));
|
|
50
|
+
return doc !== null && typeof doc === "object" && !Array.isArray(doc) ? doc : void 0;
|
|
51
|
+
} catch {
|
|
52
|
+
return void 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function declaredLayout(repoRoot) {
|
|
56
|
+
const layout = readConfigObject(repoRoot)?.layout;
|
|
57
|
+
return typeof layout === "number" ? layout : void 0;
|
|
58
|
+
}
|
|
59
|
+
var MOVED_SOURCE = /(^|\/)\.outerlayer\/(AGENTS\.md|skills\/)/;
|
|
60
|
+
function isAgentsMdLayout(repoRoot) {
|
|
61
|
+
if (declaredLayout(repoRoot) !== AGENTS_MD_LAYOUT) return false;
|
|
62
|
+
return !discoverOuterlayerPaths(repoRoot).some((path) => MOVED_SOURCE.test(path));
|
|
63
|
+
}
|
|
64
|
+
function skillsBaseFor(repoRoot) {
|
|
65
|
+
return isAgentsMdLayout(repoRoot) ? AGENTS_SKILLS_BASE : OUTERLAYER_SKILLS_BASE;
|
|
66
|
+
}
|
|
67
|
+
var TODAYS_LAYOUT_SOURCE = /(^|\/)\.outerlayer\/(AGENTS\.md|mcp\.json|skills\/|commands\/)/;
|
|
68
|
+
function holdsTodaysLayoutSources(outerlayerPaths) {
|
|
69
|
+
return outerlayerPaths.some((path) => TODAYS_LAYOUT_SOURCE.test(path));
|
|
70
|
+
}
|
|
71
|
+
function declareAgentsMdLayout(repoRoot) {
|
|
72
|
+
const abs = join(repoRoot, CONFIG_PATH);
|
|
73
|
+
let doc = {};
|
|
74
|
+
if (existsSync(abs)) {
|
|
75
|
+
const existing = readConfigObject(repoRoot);
|
|
76
|
+
if (existing === void 0) return false;
|
|
77
|
+
if (existing.layout === AGENTS_MD_LAYOUT) return true;
|
|
78
|
+
doc = existing;
|
|
79
|
+
}
|
|
80
|
+
mkdirSync(join(repoRoot, ".outerlayer"), { recursive: true });
|
|
81
|
+
writeFileSync(abs, `${JSON.stringify({ ...doc, layout: AGENTS_MD_LAYOUT }, null, 2)}
|
|
82
|
+
`);
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
function filesBelow(repoRoot, rel) {
|
|
86
|
+
const out = [];
|
|
87
|
+
let entries;
|
|
88
|
+
try {
|
|
89
|
+
entries = readdirSync(join(repoRoot, rel), { withFileTypes: true });
|
|
90
|
+
} catch {
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
for (const entry of entries) {
|
|
94
|
+
const child = `${rel}/${entry.name}`;
|
|
95
|
+
if (entry.isDirectory()) out.push(...filesBelow(repoRoot, child));
|
|
96
|
+
else out.push(child);
|
|
97
|
+
}
|
|
98
|
+
return out.sort();
|
|
99
|
+
}
|
|
100
|
+
function linkClaudeSkills(repoRoot) {
|
|
101
|
+
const abs = join(repoRoot, SKILLS_LINK_PATH);
|
|
102
|
+
let stat;
|
|
103
|
+
try {
|
|
104
|
+
stat = lstatSync(abs);
|
|
105
|
+
} catch {
|
|
106
|
+
stat = void 0;
|
|
107
|
+
}
|
|
108
|
+
if (stat?.isSymbolicLink()) {
|
|
109
|
+
try {
|
|
110
|
+
return readlinkSync(abs) === SKILLS_LINK_TARGET ? { status: "present" } : { status: "elsewhere" };
|
|
111
|
+
} catch {
|
|
112
|
+
return { status: "elsewhere" };
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (stat !== void 0) {
|
|
116
|
+
if (!stat.isDirectory()) return { status: "blocked", blocking: [SKILLS_LINK_PATH] };
|
|
117
|
+
const files = filesBelow(repoRoot, SKILLS_LINK_PATH);
|
|
118
|
+
if (files.length > 0) return { status: "blocked", blocking: files };
|
|
119
|
+
removeEmptyTree(abs);
|
|
120
|
+
}
|
|
121
|
+
try {
|
|
122
|
+
mkdirSync(join(repoRoot, ".claude"), { recursive: true });
|
|
123
|
+
symlinkSync(SKILLS_LINK_TARGET, abs, "dir");
|
|
124
|
+
return { status: "linked" };
|
|
125
|
+
} catch (err) {
|
|
126
|
+
return { status: "failed", reason: err instanceof Error ? err.message : String(err) };
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function removeEmptyTree(abs) {
|
|
130
|
+
for (const entry of readdirSync(abs, { withFileTypes: true })) {
|
|
131
|
+
if (entry.isDirectory()) removeEmptyTree(join(abs, entry.name));
|
|
132
|
+
}
|
|
133
|
+
rmdirSync(abs);
|
|
134
|
+
}
|
|
135
|
+
var WINDOWS_LINK_NOTE = "On Windows, git commits a link only when core.symlinks is true. Without it, git writes a text file and Claude Code finds no skills.";
|
|
136
|
+
function describeSkillsLink(outcome) {
|
|
137
|
+
switch (outcome.status) {
|
|
138
|
+
case "linked":
|
|
139
|
+
return `Linked ${SKILLS_LINK_PATH} to ${SKILLS_LINK_TARGET}, so Claude Code finds the skills. ${WINDOWS_LINK_NOTE}`;
|
|
140
|
+
case "present":
|
|
141
|
+
return "";
|
|
142
|
+
case "blocked":
|
|
143
|
+
return `Left ${SKILLS_LINK_PATH}/ as it is and made no link, because it still holds ${outcome.blocking.join(", ")}.`;
|
|
144
|
+
case "elsewhere":
|
|
145
|
+
return `Left ${SKILLS_LINK_PATH} as it is: it is a link to somewhere other than ${SKILLS_LINK_TARGET}.`;
|
|
146
|
+
case "failed":
|
|
147
|
+
return `Could not link ${SKILLS_LINK_PATH} to ${SKILLS_LINK_TARGET}: ${outcome.reason}. On Windows, git needs core.symlinks and a permission to create links. The launcher, \`outerlayer claude\`, does not need the link.`;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export { AGENTS_MD_LAYOUT, FIRST_VERSION_READING_AGENTS_SKILLS, SKILLS_LINK_PATH, declareAgentsMdLayout, describeSkillsLink, discoverOuterlayerPaths, filesBelow, holdsTodaysLayoutSources, isAgentsMdLayout, isForeignTree, linkClaudeSkills, readConfigObject, skillsBaseFor, toRepoRelative };
|
|
@@ -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-DG2ULWM6.js';
|
|
4
4
|
import { parseRunnerEnv } from './chunk-6MZSX4M7.js';
|
|
5
|
-
import { RUNNER_FILE_MODE } from './chunk-
|
|
5
|
+
import { RUNNER_FILE_MODE } from './chunk-KF37SUDM.js';
|
|
6
6
|
import { existsSync, readFileSync, writeFileSync, renameSync, rmSync } from 'fs';
|
|
7
7
|
import { join, dirname } from 'path';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { skillDir, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-
|
|
3
|
+
import { skillDir, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-HBISTTG3.js';
|
|
4
4
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
5
|
-
import { emitTree, ALL_TARGET_IDS, classifyTree } from './chunk-
|
|
5
|
+
import { emitTree, ALL_TARGET_IDS, classifyTree } from './chunk-RKOTJQVG.js';
|
|
6
6
|
import { readFileSync, existsSync, unlinkSync, rmdirSync, readdirSync } from 'fs';
|
|
7
7
|
import { join, dirname, relative, sep } from 'path';
|
|
8
8
|
|
|
@@ -70,7 +70,7 @@ function checkFormerSkillNames(repoRoot) {
|
|
|
70
70
|
checks.push({
|
|
71
71
|
name: "Renamed skills",
|
|
72
72
|
status: "warn",
|
|
73
|
-
detail: `copies under earlier names: ${retired.map(skillDir).join(", ")}`,
|
|
73
|
+
detail: `copies under earlier names: ${retired.map((former) => skillDir(former)).join(", ")}`,
|
|
74
74
|
fix: `Run \`${cliInvocation()} context emit\` to replace them with the current names, then commit.`
|
|
75
75
|
});
|
|
76
76
|
}
|
|
@@ -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-KF37SUDM.js';
|
|
4
4
|
import { readFileSync, existsSync, rmSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
|
|
@@ -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-KF37SUDM.js';
|
|
4
4
|
import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
|
|
@@ -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-BN3CSI7S.js';
|
|
4
4
|
import { symlinkSync, unlinkSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-KF37SUDM.js';
|
|
4
4
|
import { generateKeyPairSync, createPrivateKey, createPublicKey, sign } from 'crypto';
|
|
5
5
|
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
6
6
|
|
|
@@ -22514,6 +22514,41 @@ external_exports.object({
|
|
|
22514
22514
|
clientSendId: external_exports.string().regex(REVIEW_SEND_ID_PATTERN),
|
|
22515
22515
|
notes: external_exports.array(WorkItemReviewNoteSchema).min(1).max(WORK_ITEM_REVIEW_NOTES_MAX)
|
|
22516
22516
|
});
|
|
22517
|
+
var CLI_LOGIN_KIND = "account";
|
|
22518
|
+
var CLI_LOGIN_MACHINE_NAME_MAX = 255;
|
|
22519
|
+
external_exports.object({
|
|
22520
|
+
public_key: external_exports.string().min(1),
|
|
22521
|
+
// The characters a key name may hold; the CLI cuts its host name to these.
|
|
22522
|
+
machine_name: external_exports.string().trim().min(1).max(CLI_LOGIN_MACHINE_NAME_MAX).regex(/^[\w\s\-().]+$/, "Invalid characters in machine_name"),
|
|
22523
|
+
kind: external_exports.literal(CLI_LOGIN_KIND)
|
|
22524
|
+
});
|
|
22525
|
+
var CliLoginStartResponseSchema = external_exports.object({
|
|
22526
|
+
id: external_exports.string(),
|
|
22527
|
+
code: external_exports.string(),
|
|
22528
|
+
verification_url: external_exports.string(),
|
|
22529
|
+
interval: external_exports.number(),
|
|
22530
|
+
expires_at: external_exports.string()
|
|
22531
|
+
});
|
|
22532
|
+
var CliLoginStartedSchema = CliLoginStartResponseSchema.pick({ id: true, code: true, expires_at: true }).extend({
|
|
22533
|
+
interval: CliLoginStartResponseSchema.shape.interval.positive().optional().catch(void 0)
|
|
22534
|
+
});
|
|
22535
|
+
var CliLoginPollResponseSchema = external_exports.discriminatedUnion("status", [
|
|
22536
|
+
external_exports.object({ status: external_exports.literal("pending") }),
|
|
22537
|
+
external_exports.object({ status: external_exports.literal("denied") }),
|
|
22538
|
+
external_exports.object({
|
|
22539
|
+
status: external_exports.literal("approved"),
|
|
22540
|
+
/** The account token, RSA-OAEP (SHA-256) encrypted to the start's public key, in base64. */
|
|
22541
|
+
encrypted_token: external_exports.string(),
|
|
22542
|
+
/** The gateway the token works against. */
|
|
22543
|
+
gateway_url: external_exports.string(),
|
|
22544
|
+
/** The email of the account the token signs in to. */
|
|
22545
|
+
email: external_exports.string()
|
|
22546
|
+
})
|
|
22547
|
+
]);
|
|
22548
|
+
var CliLoginRefusalSchema = external_exports.object({
|
|
22549
|
+
error: external_exports.string(),
|
|
22550
|
+
message: external_exports.string().optional()
|
|
22551
|
+
});
|
|
22517
22552
|
/*! Bundled license information:
|
|
22518
22553
|
|
|
22519
22554
|
xmlchars/xml/1.0/ed5.js:
|
|
@@ -22544,4 +22579,4 @@ xmlchars/xmlns/1.0/ed3.js:
|
|
|
22544
22579
|
*)
|
|
22545
22580
|
*/
|
|
22546
22581
|
|
|
22547
|
-
export { ARTIFACT_KINDS, ARTIFACT_MAX_CAPTION_LENGTH, ARTIFACT_MAX_FILENAME_LENGTH, ARTIFACT_MAX_REPLACES_TARGETS, ArtifactCriterionIdSchema, ArtifactSpoolRecordSchema, ArtifactTombstoneRecordSchema, BUCKET_MODEL_MAX_LENGTH, CAPTURE_TIERS, CriteriaListSchema, EMITTED_RESULTS, EMITTED_RESULT_MAX_BODY_LENGTH, EMITTED_RESULT_MAX_LINK_LENGTH, EVENT_TYPES, EmittedNameSchema, FindingBatchSchema, FindingsResponseSchema, INPUT_BAND_BOUNDARIES, RESERVED_EMIT_NAMES, SAME_PROBLEM_RULES, SCHEMA_VERSION, SPEED_MAX_LENGTH, StepBodySchema, StepNameSchema, bannedPathsForTier, bindTests, downconvertSession, inferArtifactKind, inputBandOf, isHumanUserTurn, mediaTypeForArtifactPath, parseAgentSession, parseJunit, parseTestSelector, turnCountBound };
|
|
22582
|
+
export { ARTIFACT_KINDS, ARTIFACT_MAX_CAPTION_LENGTH, ARTIFACT_MAX_FILENAME_LENGTH, ARTIFACT_MAX_REPLACES_TARGETS, ArtifactCriterionIdSchema, ArtifactSpoolRecordSchema, ArtifactTombstoneRecordSchema, BUCKET_MODEL_MAX_LENGTH, CAPTURE_TIERS, CLI_LOGIN_KIND, CLI_LOGIN_MACHINE_NAME_MAX, CliLoginPollResponseSchema, CliLoginRefusalSchema, CliLoginStartedSchema, CriteriaListSchema, EMITTED_RESULTS, EMITTED_RESULT_MAX_BODY_LENGTH, EMITTED_RESULT_MAX_LINK_LENGTH, EVENT_TYPES, EmittedNameSchema, FindingBatchSchema, FindingsResponseSchema, INPUT_BAND_BOUNDARIES, RESERVED_EMIT_NAMES, SAME_PROBLEM_RULES, SCHEMA_VERSION, SPEED_MAX_LENGTH, StepBodySchema, StepNameSchema, bannedPathsForTier, bindTests, downconvertSession, inferArtifactKind, inputBandOf, isHumanUserTurn, mediaTypeForArtifactPath, parseAgentSession, parseJunit, parseTestSelector, turnCountBound };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RESERVED_EMIT_NAMES, ARTIFACT_KINDS, ArtifactCriterionIdSchema } from './chunk-
|
|
3
|
+
import { RESERVED_EMIT_NAMES, ARTIFACT_KINDS, ArtifactCriterionIdSchema } from './chunk-QZBXLLTV.js';
|
|
4
4
|
import { __commonJS, __require, __toESM } from './chunk-Z5GEFMRW.js';
|
|
5
5
|
|
|
6
6
|
createRequire(import.meta.url);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { detectActiveSession, autoConnect } from './chunk-
|
|
4
|
-
import { workPageUrl } from './chunk-
|
|
5
|
-
import { sanitizeTerminal } from './chunk-
|
|
6
|
-
import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-
|
|
3
|
+
import { detectActiveSession, autoConnect } from './chunk-F2W2IYNP.js';
|
|
4
|
+
import { workPageUrl } from './chunk-V5Q3S4NM.js';
|
|
5
|
+
import { sanitizeTerminal } from './chunk-BUP5N3X6.js';
|
|
6
|
+
import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-FKXGQOF5.js';
|
|
7
7
|
import { readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
8
|
-
import { resolveRepoIdentity } from './chunk-
|
|
8
|
+
import { resolveRepoIdentity } from './chunk-D4AMAEZ7.js';
|
|
9
9
|
import { C } from './chunk-ANPNT6PM.js';
|
|
10
10
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
11
11
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
12
|
-
import { signRunnerRequest } from './chunk-
|
|
12
|
+
import { signRunnerRequest } from './chunk-PVRBE7S4.js';
|
|
13
13
|
|
|
14
14
|
createRequire(import.meta.url);
|
|
15
15
|
|
|
@@ -427,7 +427,7 @@ async function runWorkLinkSession(opts) {
|
|
|
427
427
|
return await linkSession(opts);
|
|
428
428
|
} catch (err) {
|
|
429
429
|
if (opts.logFailures) {
|
|
430
|
-
const { logHookError } = await import('./hook-fast-
|
|
430
|
+
const { logHookError } = await import('./hook-fast-3JL4PXLG.js');
|
|
431
431
|
const reason = err instanceof Error ? err.message : String(err);
|
|
432
432
|
logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
|
|
433
433
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
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-
|
|
6
|
-
import { unsupportedLayout, layoutRefusalReason, composeDelivery } from './chunk-
|
|
3
|
+
import { WorkCommandError, postJson } from './chunk-RVYOOYOA.js';
|
|
4
|
+
import { defaultGitRunner, materializeContext, isStagingWriteFault, lookupGoverningSource } from './chunk-E4OUL7ZP.js';
|
|
5
|
+
import { signingFetchFor } from './chunk-FKXGQOF5.js';
|
|
6
|
+
import { unsupportedLayout, layoutRefusalReason, composeDelivery } from './chunk-VPEGE3QZ.js';
|
|
7
7
|
import { SHIM_SCRIPT, GOVERNANCE_VARIABLE } from './chunk-HCVLP7XA.js';
|
|
8
8
|
import { readDegraded, readContextManifest, readSourceCache } from './chunk-YQR6E6OV.js';
|
|
9
|
-
import { signerFor } from './chunk-
|
|
10
|
-
import { SHIM_DIR, stagedContextDir, contextHomeDir, deliveryDir } from './chunk-
|
|
9
|
+
import { signerFor } from './chunk-PVRBE7S4.js';
|
|
10
|
+
import { SHIM_DIR, stagedContextDir, contextHomeDir, deliveryDir } from './chunk-KF37SUDM.js';
|
|
11
11
|
import { fstatSync, mkdirSync, writeFileSync, chmodSync, rmSync, lstatSync } from 'fs';
|
|
12
12
|
import { relative, join, dirname } from 'path';
|
|
13
13
|
|
|
@@ -9,6 +9,9 @@ function parse(version) {
|
|
|
9
9
|
if (match === null) return void 0;
|
|
10
10
|
return { core: [Number(match[1]), Number(match[2]), Number(match[3])], pre: match[4] };
|
|
11
11
|
}
|
|
12
|
+
function isVersion(text) {
|
|
13
|
+
return parse(text) !== void 0;
|
|
14
|
+
}
|
|
12
15
|
function comparePre(a, b) {
|
|
13
16
|
const left = a.split(".");
|
|
14
17
|
const right = b.split(".");
|
|
@@ -130,4 +133,4 @@ function satisfiesRange(version, range) {
|
|
|
130
133
|
return anyUnreadable ? void 0 : false;
|
|
131
134
|
}
|
|
132
135
|
|
|
133
|
-
export { compareVersions, satisfiesRange };
|
|
136
|
+
export { compareVersions, isVersion, satisfiesRange };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import {
|
|
4
|
-
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-XACXXKQ5.js';
|
|
3
|
+
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-FWEWFW3F.js';
|
|
5
4
|
import { startTimeOf } from './chunk-JBJTC3UU.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { CLAUDE_CODE_VERSION, NODE_IMAGE, DEFAULT_BASE_IMAGE, RecipeError, locateRecipe, readRecipe, assertBuildable, TINI_VERSION, GH_VERSION, writeSanitizedRecipe, classifyProperties, GH_SHA256, TINI_SHA256, SANITIZED_NAME } from './chunk-3W333NFO.js';
|
|
6
|
+
import { RUNNER_DIR_MODE, repoCacheDir, imagesDir, attemptStamp, runnerDir, rootfsPathFor, RUNNER_FILE_MODE } from './chunk-KF37SUDM.js';
|
|
7
|
+
import { withGitConfig, tokenHeader, PROXY_WARNING_FLAG } from './chunk-BN3CSI7S.js';
|
|
8
8
|
import { RELAY_ID, RELAY_USER } from './chunk-GISNHSYL.js';
|
|
9
9
|
import { mkdirSync, rmSync, existsSync, mkdtempSync, cpSync, readFileSync, writeFileSync, readdirSync, lstatSync, readlinkSync } from 'fs';
|
|
10
10
|
import { tmpdir } from 'os';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { sanitizeTerminal } from './chunk-
|
|
4
|
-
import { DEFAULT_DASHBOARD } from './chunk-
|
|
5
|
-
import { cliFetch, resolveGatewayCredentials } from './chunk-
|
|
3
|
+
import { sanitizeTerminal } from './chunk-BUP5N3X6.js';
|
|
4
|
+
import { DEFAULT_DASHBOARD } from './chunk-XSPA5ODY.js';
|
|
5
|
+
import { cliFetch, resolveGatewayCredentials } from './chunk-FKXGQOF5.js';
|
|
6
6
|
import { writeRepoConnection, findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
7
|
-
import { remoteLookupFailed } from './chunk-
|
|
7
|
+
import { remoteLookupFailed } from './chunk-D4AMAEZ7.js';
|
|
8
8
|
import { readCloudConfig } from './chunk-EABW6AJQ.js';
|
|
9
|
+
import { isAgentsMdLayout } from './chunk-JKNYTNYD.js';
|
|
9
10
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
10
11
|
import { execFileSync } from 'child_process';
|
|
11
12
|
import { createInterface } from 'readline/promises';
|
|
@@ -61,9 +62,20 @@ Then run \`${cliInvocation()} connect\` again.
|
|
|
61
62
|
// src/connect-cmd.ts
|
|
62
63
|
var REQUEST_TIMEOUT_MS = 15e3;
|
|
63
64
|
var COMMIT_LINE = "Commit and push .outerlayer/ so the factory reads your policy and skills. No checks run on your pull requests until the policy is on your default branch.";
|
|
65
|
+
var AGENTS_LAYOUT_COMMIT_LINE = "Commit and push .outerlayer/, AGENTS.md, .agents/, .mcp.json and .claude/skills so the factory reads your policy and skills. No checks run on your pull requests until the policy is on your default branch.";
|
|
66
|
+
var COMMIT_PATHS = [":/.outerlayer"];
|
|
67
|
+
var AGENTS_LAYOUT_COMMIT_PATHS = [":/.outerlayer", ":/AGENTS.md", ":/.agents", ":/.mcp.json", ":/.claude/skills"];
|
|
68
|
+
function inAgentsMdLayout(cwd) {
|
|
69
|
+
const dirs = findGitDirs(cwd);
|
|
70
|
+
return dirs !== void 0 && isAgentsMdLayout(dirs.repoRoot);
|
|
71
|
+
}
|
|
72
|
+
function commitLineFor(cwd) {
|
|
73
|
+
return inAgentsMdLayout(cwd) ? AGENTS_LAYOUT_COMMIT_LINE : COMMIT_LINE;
|
|
74
|
+
}
|
|
64
75
|
function hasUncommittedPolicy(cwd) {
|
|
76
|
+
const paths = inAgentsMdLayout(cwd) ? AGENTS_LAYOUT_COMMIT_PATHS : COMMIT_PATHS;
|
|
65
77
|
try {
|
|
66
|
-
const status = execFileSync("git", ["status", "--porcelain", "--untracked-files=all", "--",
|
|
78
|
+
const status = execFileSync("git", ["status", "--porcelain", "--untracked-files=all", "--", ...paths], {
|
|
67
79
|
cwd,
|
|
68
80
|
encoding: "utf8",
|
|
69
81
|
stdio: "pipe",
|
|
@@ -303,7 +315,7 @@ function connectDocument(r) {
|
|
|
303
315
|
async function runConnectCommand(flags, deps, out) {
|
|
304
316
|
const base = await runConnect(flags, deps);
|
|
305
317
|
const r = base.outcome === "done" && hasUncommittedPolicy(deps.cwd) ? { ...base, text: `${base.text}
|
|
306
|
-
${
|
|
318
|
+
${commitLineFor(deps.cwd)}
|
|
307
319
|
` } : base;
|
|
308
320
|
if (flags.json) {
|
|
309
321
|
out.stdout.write(`${JSON.stringify(connectDocument(r), null, 2)}
|
|
@@ -315,4 +327,4 @@ ${COMMIT_LINE}
|
|
|
315
327
|
return r.code;
|
|
316
328
|
}
|
|
317
329
|
|
|
318
|
-
export { COMMIT_LINE, autoConnectedLine, dashboardBase, fetchFactories, hasUncommittedPolicy, isLinkedRepository, listText, promptOnTerminal, realConnectDeps, runConnect, runConnectCommand, saveFactoryConnection, selectFactory, slug, workPageUrl };
|
|
330
|
+
export { AGENTS_LAYOUT_COMMIT_LINE, COMMIT_LINE, autoConnectedLine, commitLineFor, dashboardBase, fetchFactories, hasUncommittedPolicy, 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 { MIN_ENGINE_MAJOR } from './chunk-
|
|
3
|
+
import { MIN_ENGINE_MAJOR } from './chunk-GU4PKXN7.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';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { resolvePackRoot, loadTemplateFiles, loadMaintainedFiles, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MAINTAINED_SKILLS } from './chunk-5OCIHFGE.js';
|
|
4
3
|
import { C } from './chunk-ANPNT6PM.js';
|
|
4
|
+
import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MAINTAINED_SKILLS } from './chunk-HBISTTG3.js';
|
|
5
5
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
6
|
+
import { linkedAgentsPath } from './chunk-VWFOKRYS.js';
|
|
6
7
|
import { resolvePackageVersion } from './chunk-RA3O54FC.js';
|
|
7
8
|
import { readFileSync, existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
8
9
|
import { join, dirname } from 'path';
|
|
@@ -26,16 +27,19 @@ function assertKnownTemplate(name) {
|
|
|
26
27
|
function installStarterPack(opts) {
|
|
27
28
|
const packRoot = opts.packRoot ?? resolvePackRoot();
|
|
28
29
|
const version = opts.version ?? resolvePackageVersion();
|
|
29
|
-
const
|
|
30
|
-
const
|
|
30
|
+
const base = opts.base ?? OUTERLAYER_SKILLS_BASE;
|
|
31
|
+
const linked = base.startsWith(".agents/") ? linkedAgentsPath(opts.repoRoot) : void 0;
|
|
32
|
+
if (linked !== void 0) throw new StarterPackError(`${linked} is a link, and a write there would land outside the repository; replace it with a folder and run this again`);
|
|
33
|
+
const templateFiles = loadTemplateFiles(packRoot, version, base);
|
|
34
|
+
const maintainedFiles = loadMaintainedFiles(packRoot, version, base);
|
|
31
35
|
const validatorFiles = VALIDATOR_FILES.map(({ name }) => ({
|
|
32
36
|
path: `${VALIDATORS_DIR}/${name}`,
|
|
33
|
-
content: readFileSync(join(packRoot, "validators", name), "utf8")
|
|
37
|
+
content: rewriteSkillPaths(readFileSync(join(packRoot, "validators", name), "utf8"), base)
|
|
34
38
|
}));
|
|
35
39
|
const copied = [];
|
|
36
40
|
const kept = [];
|
|
37
41
|
for (const skill of TEMPLATE_SKILLS) {
|
|
38
|
-
if (existsSync(join(opts.repoRoot, skillDir(skill)))) {
|
|
42
|
+
if (existsSync(join(opts.repoRoot, skillDir(skill, base)))) {
|
|
39
43
|
kept.push(skill);
|
|
40
44
|
continue;
|
|
41
45
|
}
|
|
@@ -67,6 +71,7 @@ function installStarterPack(opts) {
|
|
|
67
71
|
validatorsWritten.push(file.path);
|
|
68
72
|
}
|
|
69
73
|
return {
|
|
74
|
+
base,
|
|
70
75
|
copied,
|
|
71
76
|
kept,
|
|
72
77
|
maintained: [...written.created, ...written.rewritten],
|
|
@@ -75,21 +80,23 @@ function installStarterPack(opts) {
|
|
|
75
80
|
validatorsKept
|
|
76
81
|
};
|
|
77
82
|
}
|
|
78
|
-
var skillFile = (skill) => `${skillDir(skill)}/SKILL.md`;
|
|
83
|
+
var skillFile = (skill, base) => `${skillDir(skill, base)}/SKILL.md`;
|
|
79
84
|
function validatorLabel(path) {
|
|
80
85
|
return VALIDATOR_FILES.find(({ name }) => path === `${VALIDATORS_DIR}/${name}`)?.label ?? "a check";
|
|
81
86
|
}
|
|
82
87
|
function formatStarterPackOutput(result) {
|
|
83
88
|
const lines = [];
|
|
84
|
-
|
|
89
|
+
const { base } = result;
|
|
90
|
+
lines.push(`${C.green}\u2713${C.reset} Installed the starter skills in ${base}/`, "");
|
|
85
91
|
lines.push("Yours to edit \u2014 copied once, never overwritten:");
|
|
86
92
|
for (const skill of TEMPLATE_SKILLS) {
|
|
87
93
|
lines.push(
|
|
88
|
-
result.kept.includes(skill) ? ` ${C.dim}kept${C.reset} ${skillDir(skill)}/ ${C.dim}(already exists, left exactly as it is)${C.reset}` : ` ${skillFile(skill)}`
|
|
94
|
+
result.kept.includes(skill) ? ` ${C.dim}kept${C.reset} ${skillDir(skill, base)}/ ${C.dim}(already exists, left exactly as it is)${C.reset}` : ` ${skillFile(skill, base)}`
|
|
89
95
|
);
|
|
90
96
|
}
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
const rewriter = base === OUTERLAYER_SKILLS_BASE ? "emit" : "`init --update`";
|
|
98
|
+
lines.push("", `Rewritten on every ${rewriter} \u2014 edits are overwritten by the installed CLI:`);
|
|
99
|
+
for (const skill of MAINTAINED_SKILLS) lines.push(` ${skillFile(skill, base)}`);
|
|
93
100
|
lines.push(
|
|
94
101
|
"",
|
|
95
102
|
result.policy === "written" ? `${C.green}\u2713${C.reset} Wrote ${POLICY_PATH} (review required)` : `${C.dim}${POLICY_PATH} already exists \u2014 left as it is${C.reset}`,
|
|
@@ -98,8 +105,10 @@ function formatStarterPackOutput(result) {
|
|
|
98
105
|
),
|
|
99
106
|
...result.validatorsKept.map((path) => `${C.dim}${path} already exists \u2014 left as it is${C.reset}`),
|
|
100
107
|
"",
|
|
101
|
-
|
|
102
|
-
|
|
108
|
+
...base === OUTERLAYER_SKILLS_BASE ? [
|
|
109
|
+
`Next: create .outerlayer/config.json naming your agent tools, for example {"targets": ["claude-code"]},`,
|
|
110
|
+
`then run ${C.yellow}${cliInvocation()} context emit${C.reset} to compile the skills into their native files.`
|
|
111
|
+
] : [`Agents read these skills from ${base}/ as they are. Nothing needs compiling.`]
|
|
103
112
|
);
|
|
104
113
|
return lines.join("\n") + "\n";
|
|
105
114
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { rewriteControlPlanePaths, rewriteAgentsFilePaths, SUPPORTED_CONTROL_PLANE_LAYOUT, rewriteHookCommand } from './chunk-HCVLP7XA.js';
|
|
4
|
-
import { MAINTAINED_SKILLS } from './chunk-
|
|
4
|
+
import { MAINTAINED_SKILLS } from './chunk-HBISTTG3.js';
|
|
5
5
|
import { existsSync, mkdirSync, copyFileSync, lstatSync, readdirSync, writeFileSync, readFileSync } from 'fs';
|
|
6
6
|
import { join, dirname } from 'path';
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-KF37SUDM.js';
|
|
4
4
|
import { readlinkSync, realpathSync, mkdirSync, unlinkSync, symlinkSync, renameSync, readFileSync, writeFileSync, rmSync, existsSync, readdirSync } from 'fs';
|
|
5
5
|
import { join, basename, sep, resolve } from 'path';
|
|
6
6
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { readContextManifest, removeContextManifest } from './chunk-YQR6E6OV.js';
|
|
4
4
|
import { removePreCommitGuardHook } from './chunk-TUSYOL2O.js';
|
|
5
|
-
import { CONTEXT_PIN_FILENAME } from './chunk-
|
|
5
|
+
import { CONTEXT_PIN_FILENAME } from './chunk-RKOTJQVG.js';
|
|
6
6
|
import { execFileSync } from 'child_process';
|
|
7
7
|
import { lstatSync, existsSync, unlinkSync, readdirSync, rmdirSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
8
8
|
import { join, dirname, isAbsolute } from 'path';
|
|
@@ -80,6 +80,9 @@ function hasSymlinkComponent(root, rel) {
|
|
|
80
80
|
}
|
|
81
81
|
return false;
|
|
82
82
|
}
|
|
83
|
+
function linkedAgentsPath(root) {
|
|
84
|
+
return [".agents", ".agents/skills"].find((rel) => hasSymlinkComponent(root, rel));
|
|
85
|
+
}
|
|
83
86
|
function trackedPaths(repoRoot) {
|
|
84
87
|
try {
|
|
85
88
|
const out = execFileSync("git", ["ls-files", "-z", "--", "AGENTS.md", ".claude", ".outerlayer"], {
|
|
@@ -171,4 +174,4 @@ function cleanupEarlierCopies(input) {
|
|
|
171
174
|
return result;
|
|
172
175
|
}
|
|
173
176
|
|
|
174
|
-
export { cleanupEarlierCopies, hasSymlinkComponent };
|
|
177
|
+
export { cleanupEarlierCopies, hasSymlinkComponent, linkedAgentsPath };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { LiveUploader } from './chunk-
|
|
4
|
-
import { spoolDir } from './chunk-
|
|
5
|
-
import { CaptureDaemon } from './chunk-
|
|
3
|
+
import { LiveUploader } from './chunk-D7K446H6.js';
|
|
4
|
+
import { spoolDir } from './chunk-755WXDBI.js';
|
|
5
|
+
import { CaptureDaemon } from './chunk-D4AMAEZ7.js';
|
|
6
6
|
import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
|
|
7
7
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
8
8
|
import { mkdirSync, writeFileSync, rmSync } from 'fs';
|