@outerlayer/cli 0.36.0-next.20261101174803 → 0.36.0-next.20261102124202
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/dist/agent-setup-AOB76EDJ.js +37 -0
- package/dist/bridge-DFG2GTXQ.js +13 -0
- package/dist/build-THAD3B4Q.js +21 -0
- package/dist/build-disk-HO2VPIBJ.js +18 -0
- package/dist/build-info.json +1 -1
- package/dist/builder-AXJNIF4S.js +17 -0
- package/dist/caller-GOY2X6QT.js +20 -0
- package/dist/{check-K4RVAP4L.js → check-SF2OVZXB.js} +68 -66
- package/dist/{chunk-KB5B6ZT5.js → chunk-3FSKTGM6.js} +20 -20
- package/dist/{chunk-HL7UNTXO.js → chunk-4CTVN3C5.js} +15 -8
- package/dist/{chunk-QIOTIQWD.js → chunk-4TNUQLXH.js} +5 -5
- package/dist/{chunk-LGV5N5DG.js → chunk-564Q2STF.js} +1 -1
- package/dist/{chunk-F2LPX2HS.js → chunk-5FIOUQGC.js} +8 -8
- package/dist/{chunk-TSYHUUAT.js → chunk-5FND4PIU.js} +2 -2
- package/dist/{chunk-4DJZSNVT.js → chunk-6JJITHBI.js} +1 -1
- package/dist/{chunk-KLXECBIE.js → chunk-6LO62EQ5.js} +149 -106
- package/dist/{chunk-RIHB3HA2.js → chunk-772ILTCK.js} +3 -3
- package/dist/{chunk-CIUD3436.js → chunk-A5Y2HBVU.js} +1 -1
- package/dist/{chunk-KDK6AF7B.js → chunk-AYLYAOHH.js} +5 -5
- package/dist/{chunk-OEBFKPHK.js → chunk-C3JWWPLC.js} +9 -10
- package/dist/{chunk-24FEVLX7.js → chunk-CKPQOQFC.js} +643 -73
- package/dist/{chunk-ALEUIS35.js → chunk-CVGQ3BNF.js} +1 -1
- package/dist/{chunk-DJMR4YPG.js → chunk-EBIYRRJW.js} +5 -5
- package/dist/{chunk-MXIFRYLA.js → chunk-ESSJPSJ2.js} +2 -2
- package/dist/{chunk-D2OTBS47.js → chunk-EUDG754F.js} +2 -2
- package/dist/{chunk-55PYF6S2.js → chunk-FIO6PIZ6.js} +3 -3
- package/dist/{chunk-WT7J2627.js → chunk-GD6KIHOS.js} +1 -1
- package/dist/{chunk-DJDTL6AY.js → chunk-GDZTL6BI.js} +40 -31
- package/dist/{chunk-AF6DQJ5W.js → chunk-GSXGA6KF.js} +1 -1
- package/dist/{chunk-LEHBDEUG.js → chunk-GZ75FRLB.js} +4 -5
- package/dist/chunk-H2FFONRY.js +136 -0
- package/dist/{chunk-DHFNBNC3.js → chunk-HIN4BMRW.js} +2 -2
- package/dist/{chunk-ABAVN4RT.js → chunk-I626B72C.js} +29 -26
- package/dist/{chunk-VJYSPH2J.js → chunk-I6FRCBMU.js} +26 -21
- package/dist/{chunk-X2XTCGUS.js → chunk-J7TCTARR.js} +11 -12
- package/dist/chunk-J7Y3PCO2.js +653 -0
- package/dist/{chunk-YQHEJ5SV.js → chunk-JVCQZDQ6.js} +3 -3
- package/dist/{chunk-JW5BENE6.js → chunk-JXXHLQQR.js} +3 -3
- package/dist/{chunk-GLUQVET2.js → chunk-K3X3L5YW.js} +2 -2
- package/dist/{chunk-MKSZHT6S.js → chunk-KN4VIK53.js} +1 -1
- package/dist/chunk-L3JXQDVH.js +78 -0
- package/dist/{chunk-6A2GEFN3.js → chunk-LCOQN6NR.js} +2 -2
- package/dist/{chunk-R3252UTU.js → chunk-LSXHTBAM.js} +2 -2
- package/dist/{chunk-ZP7F3OHV.js → chunk-LVXR37OG.js} +47 -38
- package/dist/{chunk-W7I65BKE.js → chunk-LYFLUNWK.js} +12 -12
- package/dist/{chunk-GANAOCHR.js → chunk-M2NIHHQI.js} +24 -374
- package/dist/chunk-NC3QAHOS.js +26 -0
- package/dist/{chunk-RIIPBJK6.js → chunk-NTMRMBLM.js} +4 -4
- package/dist/{chunk-NFZJ5XHP.js → chunk-NWBB2SQ4.js} +33 -32
- package/dist/{chunk-H7SKHAUE.js → chunk-OYKAOHX5.js} +3 -3
- package/dist/{chunk-EBOQU6QC.js → chunk-OZOATEK3.js} +2 -2
- package/dist/{chunk-BRUDBWLO.js → chunk-PKO5IDW4.js} +7 -7
- package/dist/{chunk-7J7HRYZ3.js → chunk-PQDFW422.js} +1 -1
- package/dist/{chunk-EZRAR5YG.js → chunk-PT34C6SU.js} +1 -1
- package/dist/{chunk-HAWPG7QW.js → chunk-PTPF36Q7.js} +3 -3
- package/dist/{chunk-7Y5VW4JG.js → chunk-Q42K6XZ6.js} +1 -1
- package/dist/{chunk-SPXVFFQV.js → chunk-QJDX6VJS.js} +5 -5
- package/dist/{chunk-ULBVE7MP.js → chunk-RK4JQRVT.js} +6 -6
- package/dist/{chunk-JU3VU42K.js → chunk-RPZIHELI.js} +5 -5
- package/dist/{chunk-XNBUZGRO.js → chunk-RSRZDF3K.js} +3 -3
- package/dist/{chunk-46OBCATR.js → chunk-T5Z22NA6.js} +1 -1
- package/dist/chunk-TWYHSMHM.js +67 -0
- package/dist/{chunk-AGKQEOFS.js → chunk-TYCZVJTB.js} +54 -31
- package/dist/{chunk-B7PYT2BY.js → chunk-VRQM4A64.js} +6 -3
- package/dist/{chunk-KFUDKFEH.js → chunk-WDQPBAFV.js} +44 -19
- package/dist/{chunk-UZGQT6OF.js → chunk-WLMAGMTU.js} +5 -3
- package/dist/{chunk-RDWKRG4K.js → chunk-WNYH42PF.js} +4 -4
- package/dist/{chunk-MOOZJRKM.js → chunk-WQB3XOEP.js} +27 -30
- package/dist/{chunk-O36YAH2G.js → chunk-XABJMU5A.js} +4 -4
- package/dist/{chunk-2SRQSGPR.js → chunk-XAOIHYPS.js} +29 -24
- package/dist/{chunk-WAZJPDR2.js → chunk-XE3DIJJT.js} +1 -1
- package/dist/{chunk-B62TYDP2.js → chunk-XHFSBSIA.js} +4 -4
- package/dist/{chunk-AH6634HC.js → chunk-XLOM2BNL.js} +1 -2
- package/dist/{claude-launcher-L77BKZOC.js → claude-launcher-LXZPTDNC.js} +23 -18
- package/dist/{cli-QQY5UECM.js → cli-QFUT3UQS.js} +137 -138
- package/dist/{cli-update-notice-T3CXRWNB.js → cli-update-notice-AWYJ4A7R.js} +2 -2
- package/dist/{command-QLHQZ32L.js → command-45RZT4CK.js} +55 -56
- package/dist/{config-5GY7FL35.js → config-WYQPXLOP.js} +11 -9
- package/dist/connect-cmd-LUCQ7FSV.js +26 -0
- package/dist/{container-start-OCJODSMB.js → container-start-T776VI3M.js} +55 -54
- package/dist/{context-cleanup-A7KBEBIO.js → context-cleanup-QE2MIO2Q.js} +4 -2
- package/dist/{context-show-cmd-MZ74ZIVO.js → context-show-cmd-7QEHUOEL.js} +14 -14
- package/dist/{control-plane-launch-3TZFOSCX.js → control-plane-launch-THUH6YU5.js} +18 -18
- package/dist/{demo-record-cmd-Y57UWBCX.js → demo-record-cmd-SBERRQNW.js} +8 -5
- package/dist/{demo-voice-cmd-4INIOVTC.js → demo-voice-cmd-VM3FITZU.js} +18 -20
- package/dist/docker-MQNLK4OO.js +17 -0
- package/dist/{doctor-DB2AJUAO.js → doctor-NQOSPJGS.js} +71 -68
- package/dist/{emit-artifact-cmd-H27MFSKH.js → emit-artifact-cmd-6E365VBQ.js} +17 -18
- package/dist/{emit-cmd-IOWTTZSA.js → emit-cmd-ZPFCPVSR.js} +7 -8
- package/dist/{emit-criteria-cmd-IOUVMB2Q.js → emit-criteria-cmd-HWQOYZZ4.js} +13 -14
- package/dist/{emit-demo-cmd-WJSS7KU2.js → emit-demo-cmd-PMQGNNVX.js} +18 -20
- package/dist/{emit-finding-cmd-KQIGM5IF.js → emit-finding-cmd-MYWQN5WW.js} +13 -14
- package/dist/{emit-result-cmd-6Q7OU2NY.js → emit-result-cmd-GXK3KMAP.js} +16 -17
- package/dist/{emit-step-cmd-GZU5O2FR.js → emit-step-cmd-ZV2XTUVT.js} +13 -14
- package/dist/exec-client-P7RFRUCK.js +14 -0
- package/dist/find-unit-63SXQ7IM.js +21 -0
- package/dist/{findings-cmd-T7PQAVJG.js → findings-cmd-OGMBVVSM.js} +13 -14
- package/dist/{fleet-readiness-PTMOEX6L.js → fleet-readiness-4RBKLXBQ.js} +14 -15
- package/dist/{governing-source-CND5ZZC3.js → governing-source-XJMXFSAR.js} +19 -20
- package/dist/guest-init-XZHRPIMG.js +16 -0
- package/dist/{hook-fast-RW7RU3O6.js → hook-fast-ZOWGWCPO.js} +5 -5
- package/dist/host-checks-WHW24PJR.js +76 -0
- package/dist/host-key-MWLXB5U5.js +14 -0
- package/dist/{image-tag-WBD57QBN.js → image-tag-E4JK2APF.js} +9 -4
- package/dist/index.js +4 -4
- package/dist/init-EZIAHBMH.js +76 -0
- package/dist/{init-HUQLVUPO.js → init-LO6U7YTW.js} +52 -51
- package/dist/{init-cmd-6NQGBVAJ.js → init-cmd-2JANO5EN.js} +23 -24
- package/dist/{init-update-MA6QKX46.js → init-update-D6PRTGNE.js} +51 -44
- package/dist/install-cmd-SJMBNQEH.js +17 -0
- package/dist/{layout-2ZMCT2D3.js → layout-AQHIMJMO.js} +4 -4
- package/dist/{logs-FEITSC2V.js → logs-NE55HOET.js} +8 -3
- package/dist/loop-2E34CGCX.js +87 -0
- package/dist/machine-6ALGG4IO.js +76 -0
- package/dist/{machine-skills-237PQFRC.js → machine-skills-KK2HXYMR.js} +3 -4
- package/dist/{mcp-install-cmd-23ZY4IBK.js → mcp-install-cmd-2QAS3AQZ.js} +5 -1
- package/dist/{mcp-serve-cmd-ZINYSLY6.js → mcp-serve-cmd-U6USKHYR.js} +9 -7
- package/dist/{paths-XEYE7OZ2.js → paths-O7LCWY33.js} +8 -3
- package/dist/pending-YU2GE2UV.js +14 -0
- package/dist/pidfile-5GDCQ5HA.js +15 -0
- package/dist/record-NETSDAO6.js +14 -0
- package/dist/{relay-IEYNSKAZ.js → relay-VZ733BVJ.js} +6 -1
- package/dist/{relay-protocol-5LSWUJCW.js → relay-protocol-24GEUGCO.js} +6 -1
- package/dist/runner-env-KHCONH2R.js +21 -0
- package/dist/{runner-identity-IIY5UJL3.js → runner-identity-PSCZBILD.js} +10 -7
- package/dist/{runner-key-CFZ47PR3.js → runner-key-VM2LYVRK.js} +44 -46
- package/dist/{session-sender-NO4F2IQ5.js → session-sender-P2RHDM6U.js} +17 -18
- package/dist/{spec-cmd-CNASSB6L.js → spec-cmd-LGKP6MT7.js} +14 -15
- package/dist/{starter-pack-CCVIEY72.js → starter-pack-SMK6UPRL.js} +5 -6
- package/dist/state-RJR4PMMX.js +14 -0
- package/dist/{status-VNHIHQ57.js → status-HEHCNIDS.js} +44 -46
- package/dist/{sync-cmd-5JLJBODH.js → sync-cmd-HKN45HXL.js} +16 -17
- package/dist/update-steps-7E4RD47J.js +77 -0
- package/dist/{watch-AEWWTUEK.js → watch-RGZCUCR3.js} +16 -17
- package/dist/{work-claim-cmd-GUYOJYH7.js → work-claim-cmd-6DSPGCZE.js} +19 -21
- package/dist/{work-cmd-YRPYMGII.js → work-cmd-GPLYLWY7.js} +13 -14
- package/dist/{work-comment-cmd-U5Z6FKEU.js → work-comment-cmd-V5WM7LAW.js} +16 -17
- package/dist/{work-demo-cmd-OLCWTVWM.js → work-demo-cmd-SWWI6AGD.js} +13 -14
- package/dist/{work-logs-cmd-2OA7ENDU.js → work-logs-cmd-CTFBOPCI.js} +13 -14
- package/dist/{work-open-pr-cmd-6GUCDYVM.js → work-open-pr-cmd-HX2U3YBR.js} +14 -15
- package/dist/{work-pr-cmd-KK3VQUQI.js → work-pr-cmd-EI2R4FQG.js} +13 -14
- package/dist/{work-proofs-cmd-BUOS5OJC.js → work-proofs-cmd-QXNPHLYC.js} +15 -16
- package/dist/{work-proofs-record-6WLMOK53.js → work-proofs-record-72OKWEES.js} +22 -24
- package/dist/{work-stop-cmd-VZJX5X4L.js → work-stop-cmd-7M7ZYUN2.js} +13 -14
- package/package.json +1 -1
- package/dist/agent-setup-DJRQFPDU.js +0 -33
- package/dist/bridge-XM4QLKIX.js +0 -8
- package/dist/build-ZE5IG3V6.js +0 -18
- package/dist/build-disk-GMXDIZU4.js +0 -15
- package/dist/builder-LJ3FSB36.js +0 -14
- package/dist/caller-YLNJJPFU.js +0 -18
- package/dist/chunk-CXFJOX2C.js +0 -144
- package/dist/chunk-FGF52V4V.js +0 -137
- package/dist/chunk-HCVLP7XA.js +0 -53
- package/dist/chunk-MESOOLF4.js +0 -45
- package/dist/chunk-OHQMGLJP.js +0 -113
- package/dist/chunk-OUPQTA7N.js +0 -145
- package/dist/chunk-VRMXYQWR.js +0 -74
- package/dist/connect-cmd-THV7XBVP.js +0 -27
- package/dist/docker-5YVUZ3J2.js +0 -14
- package/dist/exec-client-FGGPQSYQ.js +0 -9
- package/dist/find-unit-PRZIFBIK.js +0 -19
- package/dist/guest-init-WPUS45IN.js +0 -11
- package/dist/host-checks-S3B7Z4SY.js +0 -78
- package/dist/host-key-O4DFMOSV.js +0 -9
- package/dist/init-ILTX4V56.js +0 -78
- package/dist/install-cmd-JKPXIOEY.js +0 -12
- package/dist/loop-KDWDOSMQ.js +0 -89
- package/dist/machine-Z6K5XXI6.js +0 -78
- package/dist/pending-D2NNV54J.js +0 -9
- package/dist/pidfile-FLFVRKVW.js +0 -10
- package/dist/record-JMZOXD4R.js +0 -9
- package/dist/runner-env-W2UMHY7P.js +0 -19
- package/dist/state-UWIM42JH.js +0 -9
- package/dist/update-steps-XGOXDCOS.js +0 -79
- package/dist/{chunk-OLM2TIOW.js → chunk-NFZMENCY.js} +1 -1
|
@@ -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-CJPTUU2E.js';
|
|
5
|
-
import { CONTEXT_PIN_FILENAME } from './chunk-
|
|
5
|
+
import { CONTEXT_PIN_FILENAME, agentRootFolders } from './chunk-CKPQOQFC.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';
|
|
@@ -64,9 +64,12 @@ function contextExcludesPresent(gitCommonDir) {
|
|
|
64
64
|
function hasEarlierCopies(gitCommonDir) {
|
|
65
65
|
return readContextManifest(gitCommonDir) !== void 0 || contextExcludesPresent(gitCommonDir);
|
|
66
66
|
}
|
|
67
|
+
function copiedRoots() {
|
|
68
|
+
return ["AGENTS.md", ...agentRootFolders(), ".outerlayer"];
|
|
69
|
+
}
|
|
67
70
|
function isCopiedPath(rel) {
|
|
68
71
|
if (isAbsolute(rel) || rel.split("/").includes("..")) return false;
|
|
69
|
-
return
|
|
72
|
+
return copiedRoots().some((root) => root === "AGENTS.md" ? rel === root : rel.startsWith(`${root}/`));
|
|
70
73
|
}
|
|
71
74
|
function hasSymlinkComponent(root, rel) {
|
|
72
75
|
let current = root;
|
|
@@ -85,7 +88,7 @@ function linkedAgentsPath(root) {
|
|
|
85
88
|
}
|
|
86
89
|
function trackedPaths(repoRoot) {
|
|
87
90
|
try {
|
|
88
|
-
const out = execFileSync("git", ["ls-files", "-z", "--",
|
|
91
|
+
const out = execFileSync("git", ["ls-files", "-z", "--", ...copiedRoots()], {
|
|
89
92
|
cwd: repoRoot,
|
|
90
93
|
encoding: "utf8",
|
|
91
94
|
stdio: ["ignore", "pipe", "ignore"],
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE } from './chunk-
|
|
4
|
-
import { normalizePath, CONTEXT_PIN_FILENAME } from './chunk-24FEVLX7.js';
|
|
3
|
+
import { normalizePath, CONTEXT_PIN_FILENAME, contextAgents, defaultAgents, AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, LEGACY_AGENT, legacyAgent, legacySubcommand } from './chunk-CKPQOQFC.js';
|
|
5
4
|
import { existsSync, readdirSync, readFileSync, mkdirSync, writeFileSync, lstatSync, readlinkSync, symlinkSync, rmdirSync } from 'fs';
|
|
6
|
-
import { relative, sep, join } from 'path';
|
|
5
|
+
import { relative, sep, join, posix } from 'path';
|
|
7
6
|
|
|
8
7
|
createRequire(import.meta.url);
|
|
9
8
|
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git"]);
|
|
@@ -41,8 +40,15 @@ function walk(dir, repoRoot, insideOuterlayer, out) {
|
|
|
41
40
|
// src/layout.ts
|
|
42
41
|
var AGENTS_MD_LAYOUT = 2;
|
|
43
42
|
var FIRST_VERSION_READING_AGENTS_SKILLS = "0.21.0";
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
function linkTargetFor(folder) {
|
|
44
|
+
return posix.relative(posix.dirname(folder), AGENTS_SKILLS_BASE);
|
|
45
|
+
}
|
|
46
|
+
function mcpFiles(agents = defaultAgents()) {
|
|
47
|
+
return [...new Set(contextAgents(agents).map((agent) => agent.context.mcp.file))];
|
|
48
|
+
}
|
|
49
|
+
function skillLinkFolders(agents = defaultAgents()) {
|
|
50
|
+
return contextAgents(agents).flatMap((agent) => agent.descriptor.context.repoSkillFolders);
|
|
51
|
+
}
|
|
46
52
|
var CONFIG_PATH = ".outerlayer/config.json";
|
|
47
53
|
function readConfigObject(repoRoot) {
|
|
48
54
|
try {
|
|
@@ -97,8 +103,9 @@ function filesBelow(repoRoot, rel) {
|
|
|
97
103
|
}
|
|
98
104
|
return out.sort();
|
|
99
105
|
}
|
|
100
|
-
function
|
|
101
|
-
const abs = join(repoRoot,
|
|
106
|
+
function linkFolder(repoRoot, folder) {
|
|
107
|
+
const abs = join(repoRoot, folder);
|
|
108
|
+
const target = linkTargetFor(folder);
|
|
102
109
|
let stat;
|
|
103
110
|
try {
|
|
104
111
|
stat = lstatSync(abs);
|
|
@@ -107,45 +114,63 @@ function linkClaudeSkills(repoRoot) {
|
|
|
107
114
|
}
|
|
108
115
|
if (stat?.isSymbolicLink()) {
|
|
109
116
|
try {
|
|
110
|
-
return readlinkSync(abs) ===
|
|
117
|
+
return readlinkSync(abs) === target ? { status: "present" } : { status: "elsewhere" };
|
|
111
118
|
} catch {
|
|
112
119
|
return { status: "elsewhere" };
|
|
113
120
|
}
|
|
114
121
|
}
|
|
115
122
|
if (stat !== void 0) {
|
|
116
|
-
if (!stat.isDirectory()) return { status: "blocked", blocking: [
|
|
117
|
-
const files = filesBelow(repoRoot,
|
|
123
|
+
if (!stat.isDirectory()) return { status: "blocked", blocking: [folder] };
|
|
124
|
+
const files = filesBelow(repoRoot, folder);
|
|
118
125
|
if (files.length > 0) return { status: "blocked", blocking: files };
|
|
119
126
|
removeEmptyTree(abs);
|
|
120
127
|
}
|
|
121
128
|
try {
|
|
122
|
-
mkdirSync(join(repoRoot,
|
|
123
|
-
symlinkSync(
|
|
129
|
+
mkdirSync(join(repoRoot, posix.dirname(folder)), { recursive: true });
|
|
130
|
+
symlinkSync(target, abs, "dir");
|
|
124
131
|
return { status: "linked" };
|
|
125
132
|
} catch (err) {
|
|
126
133
|
return { status: "failed", reason: err instanceof Error ? err.message : String(err) };
|
|
127
134
|
}
|
|
128
135
|
}
|
|
136
|
+
var URGENCY = { failed: 4, blocked: 3, elsewhere: 2, linked: 1, present: 0 };
|
|
137
|
+
function linkAgentSkills(repoRoot, agents = defaultAgents()) {
|
|
138
|
+
const outcomes = contextAgents(agents).flatMap(
|
|
139
|
+
(agent) => agent.descriptor.context.repoSkillFolders.map((folder) => {
|
|
140
|
+
const outcome = linkFolder(repoRoot, folder);
|
|
141
|
+
return agent.descriptor.id === LEGACY_AGENT ? outcome : { ...outcome, folder, agent: agent.descriptor.label };
|
|
142
|
+
})
|
|
143
|
+
);
|
|
144
|
+
const first = outcomes.reduce((pick, outcome) => pick === void 0 || URGENCY[outcome.status] > URGENCY[pick.status] ? outcome : pick, void 0);
|
|
145
|
+
if (first === void 0) return { status: "present" };
|
|
146
|
+
const linkedFolders = contextAgents(agents).flatMap((agent) => agent.descriptor.context.repoSkillFolders.map((folder) => ({ folder, id: agent.descriptor.id })));
|
|
147
|
+
if (first.status !== "linked" || linkedFolders.every((entry) => entry.id === LEGACY_AGENT)) return first;
|
|
148
|
+
return { ...first, folders: outcomes.flatMap((outcome, index) => outcome.status === "linked" ? [linkedFolders[index].folder] : []) };
|
|
149
|
+
}
|
|
129
150
|
function removeEmptyTree(abs) {
|
|
130
151
|
for (const entry of readdirSync(abs, { withFileTypes: true })) {
|
|
131
152
|
if (entry.isDirectory()) removeEmptyTree(join(abs, entry.name));
|
|
132
153
|
}
|
|
133
154
|
rmdirSync(abs);
|
|
134
155
|
}
|
|
135
|
-
var
|
|
136
|
-
function describeSkillsLink(outcome) {
|
|
156
|
+
var windowsLinkNote = (agent) => `On Windows, git commits a link only when core.symlinks is true. Without it, git writes a text file and ${agent} finds no skills.`;
|
|
157
|
+
function describeSkillsLink(outcome, agents = defaultAgents()) {
|
|
158
|
+
const fallback = legacyAgent(agents);
|
|
159
|
+
const folder = outcome.folder ?? fallback.descriptor.context.repoSkillFolders[0];
|
|
160
|
+
const agent = outcome.agent ?? fallback.descriptor.label;
|
|
161
|
+
const target = linkTargetFor(folder);
|
|
137
162
|
switch (outcome.status) {
|
|
138
163
|
case "linked":
|
|
139
|
-
return `Linked ${
|
|
164
|
+
return `Linked ${folder} to ${target}, so ${agent} finds the skills. ${windowsLinkNote(agent)}`;
|
|
140
165
|
case "present":
|
|
141
166
|
return "";
|
|
142
167
|
case "blocked":
|
|
143
|
-
return `Left ${
|
|
168
|
+
return `Left ${folder}/ as it is and made no link, because it still holds ${outcome.blocking.join(", ")}.`;
|
|
144
169
|
case "elsewhere":
|
|
145
|
-
return `Left ${
|
|
170
|
+
return `Left ${folder} as it is: it is a link to somewhere other than ${target}.`;
|
|
146
171
|
case "failed":
|
|
147
|
-
return `Could not link ${
|
|
172
|
+
return `Could not link ${folder} to ${target}: ${outcome.reason}. On Windows, git needs core.symlinks and a permission to create links. The launcher, \`outerlayer ${legacySubcommand(agents)}\`, does not need the link.`;
|
|
148
173
|
}
|
|
149
174
|
}
|
|
150
175
|
|
|
151
|
-
export { AGENTS_MD_LAYOUT, FIRST_VERSION_READING_AGENTS_SKILLS,
|
|
176
|
+
export { AGENTS_MD_LAYOUT, FIRST_VERSION_READING_AGENTS_SKILLS, declareAgentsMdLayout, describeSkillsLink, discoverOuterlayerPaths, filesBelow, holdsTodaysLayoutSources, isAgentsMdLayout, isForeignTree, linkAgentSkills, mcpFiles, readConfigObject, skillLinkFolders, skillsBaseFor, toRepoRelative };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RELAY_PORT,
|
|
3
|
+
import { RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-M2NIHHQI.js';
|
|
4
|
+
import { GATEWAY_SOCKET, GATEWAY_PORT, providerDestinations } from './chunk-J7Y3PCO2.js';
|
|
5
|
+
import { PROVIDERS, defaultAgents } from './chunk-CKPQOQFC.js';
|
|
4
6
|
import { symlinkSync, unlinkSync } from 'fs';
|
|
5
7
|
import { join } from 'path';
|
|
6
8
|
|
|
@@ -10,13 +12,13 @@ var LEASE_PORT = 3125;
|
|
|
10
12
|
var GUEST_CID = 3;
|
|
11
13
|
var MAX_SOCKET_PATH = 107;
|
|
12
14
|
var LEASE_LINK = { port: LEASE_PORT, socket: "lease.sock" };
|
|
13
|
-
function vsockLinks(input) {
|
|
15
|
+
function vsockLinks(input, agents = defaultAgents(), providers = PROVIDERS) {
|
|
14
16
|
return [
|
|
15
17
|
{ port: RELAY_PORT, socket: "tunnel.sock" },
|
|
16
18
|
...Array.from({ length: input.destinations }, (_unused, index) => ({ port: DESTINATION_BASE_PORT + index, socket: `dest-${index}.sock` })),
|
|
17
19
|
...input.builtIns ? [
|
|
18
20
|
{ port: GATEWAY_PORT, socket: GATEWAY_SOCKET },
|
|
19
|
-
{ port:
|
|
21
|
+
...providerDestinations(agents, providers).map((destination) => ({ port: destination.port, socket: destination.socket }))
|
|
20
22
|
] : []
|
|
21
23
|
];
|
|
22
24
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { readNewestDemo } from './chunk-ER6KQCVJ.js';
|
|
4
|
-
import { runEmitArtifact } from './chunk-
|
|
4
|
+
import { runEmitArtifact } from './chunk-RSRZDF3K.js';
|
|
5
5
|
import { VoiceDownloadError, downloadPinned, sha256OfFile } from './chunk-2PGI6RDE.js';
|
|
6
|
-
import { VOICE_PACK_FILES, VOICE_PACK_VERSION } from './chunk-OUPQTA7N.js';
|
|
7
6
|
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
8
|
-
import { autoConnect } from './chunk-
|
|
7
|
+
import { autoConnect } from './chunk-5FND4PIU.js';
|
|
9
8
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
10
|
-
import { defaultFetch, resolveGatewayCredentials } from './chunk-
|
|
9
|
+
import { defaultFetch, resolveGatewayCredentials } from './chunk-JVCQZDQ6.js';
|
|
11
10
|
import { resolveRepoIdentity } from './chunk-5GHJFETA.js';
|
|
12
11
|
import { launchedItemForSession } from './chunk-5WYT3PPE.js';
|
|
12
|
+
import { VOICE_PACK_FILES, VOICE_PACK_VERSION } from './chunk-J7Y3PCO2.js';
|
|
13
13
|
import { ARTIFACT_MAX_BYTES, ARTIFACT_MAX_CAPTION_LENGTH, DEMO_RECORD_MEDIA_TYPE, ARTIFACT_MAX_REPLACES_TARGETS, DEMO_MANIFEST_LATEST_VERSION, DemoManifestSchema, ARTIFACT_KINDS } from './chunk-WUKLQWGY.js';
|
|
14
14
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
15
15
|
import { __commonJS, __require, __toESM } from './chunk-Z5GEFMRW.js';
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { sanitizeTerminal } from './chunk-P6PHY33P.js';
|
|
4
|
-
import { isAgentsMdLayout } from './chunk-
|
|
5
|
-
import { resolveGatewayCredentials, defaultFetch } from './chunk-
|
|
6
|
-
import { versionAtLeast } from './chunk-
|
|
4
|
+
import { isAgentsMdLayout } from './chunk-WDQPBAFV.js';
|
|
5
|
+
import { resolveGatewayCredentials, defaultFetch } from './chunk-JVCQZDQ6.js';
|
|
6
|
+
import { versionAtLeast } from './chunk-NC3QAHOS.js';
|
|
7
7
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
8
|
-
import { machineSkillsState,
|
|
9
|
-
import { AGENTS_SKILLS_BASE, skillDir, namesCore, MACHINE_SKILL_PATH, isMaintainedCopy, loadTemplateFiles } from './chunk-CXFJOX2C.js';
|
|
10
|
-
import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
|
|
8
|
+
import { machineSkillsState, staleAgentSkills } from './chunk-I626B72C.js';
|
|
11
9
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
12
|
-
import { hasSymlinkComponent } from './chunk-
|
|
13
|
-
import { emitTree,
|
|
10
|
+
import { hasSymlinkComponent } from './chunk-VRQM4A64.js';
|
|
11
|
+
import { skillDir, emitTree, targetIds, classifyTree, emitBuilders, AGENTS_SKILLS_BASE, defaultAgents, namesCore, MACHINE_SKILL_PATH, skillBases, isMaintainedCopy, contextAgents, loadTemplateFiles, splitRawFile } from './chunk-CKPQOQFC.js';
|
|
12
|
+
import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
|
|
14
13
|
import { execFileSync } from 'child_process';
|
|
15
14
|
import { existsSync, readFileSync, writeFileSync, realpathSync, readdirSync } from 'fs';
|
|
16
15
|
import { join, dirname, posix, basename, isAbsolute, relative } from 'path';
|
|
17
16
|
|
|
18
17
|
createRequire(import.meta.url);
|
|
19
18
|
var PROSE_FILE = /\.mdc?$/;
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var SKILL_BASES = [AGENTS_SKILLS_BASE, ".claude/skills"];
|
|
19
|
+
var rootFiles = () => ["AGENTS.md", ...contextAgents().flatMap((agent) => agent.descriptor.context.instructionFiles)];
|
|
20
|
+
var skillFolders = () => skillBases();
|
|
23
21
|
var RELATIVE_NOTE = ", relative to this skill's folder";
|
|
24
22
|
var escape = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
25
23
|
function withMachinePaths(text, fileDir, skills) {
|
|
@@ -27,7 +25,7 @@ function withMachinePaths(text, fileDir, skills) {
|
|
|
27
25
|
const named2 = [];
|
|
28
26
|
for (const skill of skills) {
|
|
29
27
|
const spellings = /* @__PURE__ */ new Set();
|
|
30
|
-
for (const base of
|
|
28
|
+
for (const base of skillFolders()) {
|
|
31
29
|
const folder = skillDir(skill, base);
|
|
32
30
|
spellings.add(folder);
|
|
33
31
|
spellings.add(`./${folder}`);
|
|
@@ -53,9 +51,9 @@ function filesUnder(root, rel) {
|
|
|
53
51
|
function maintainedReferenceRewrites(root, removing) {
|
|
54
52
|
const removed = (folder) => removing.includes(folder);
|
|
55
53
|
const holds = (folder) => !removed(folder) && !hasSymlinkComponent(root, folder) && existsSync(join(root, folder));
|
|
56
|
-
const absent = MAINTAINED_SKILLS.filter((skill) => !
|
|
57
|
-
const folders =
|
|
58
|
-
const candidates = /* @__PURE__ */ new Set([...
|
|
54
|
+
const absent = MAINTAINED_SKILLS.filter((skill) => !skillFolders().some((base) => holds(skillDir(skill, base))));
|
|
55
|
+
const folders = skillFolders().filter((folder) => !hasSymlinkComponent(root, folder) && existsSync(join(root, folder)));
|
|
56
|
+
const candidates = /* @__PURE__ */ new Set([...rootFiles(), ...folders.flatMap((folder) => filesUnder(root, folder))]);
|
|
59
57
|
const rewrites = [];
|
|
60
58
|
for (const path of [...candidates].sort()) {
|
|
61
59
|
if (removing.some((folder) => path.startsWith(`${folder}/`)) || hasSymlinkComponent(root, path)) continue;
|
|
@@ -91,14 +89,14 @@ function changeHeadings(text) {
|
|
|
91
89
|
}
|
|
92
90
|
return headings;
|
|
93
91
|
}
|
|
94
|
-
function skillsFolders() {
|
|
92
|
+
function skillsFolders(agents = defaultAgents()) {
|
|
95
93
|
const probe = `${skillDir("probe")}/SKILL.md`;
|
|
96
94
|
const compiled = emitTree({
|
|
97
95
|
entries: classifyTree([probe]).entries,
|
|
98
96
|
contents: /* @__PURE__ */ new Map([[probe, "---\nname: probe\ndescription: probe\n---\n"]]),
|
|
99
97
|
assetPaths: [],
|
|
100
|
-
targets:
|
|
101
|
-
});
|
|
98
|
+
targets: targetIds(agents)
|
|
99
|
+
}, emitBuilders(agents));
|
|
102
100
|
return [.../* @__PURE__ */ new Set([AGENTS_SKILLS_BASE, ...compiled.files.map((file) => dirname(dirname(file.path)))])];
|
|
103
101
|
}
|
|
104
102
|
function shortBuild() {
|
|
@@ -166,9 +164,9 @@ ${shortBuild()}`
|
|
|
166
164
|
}
|
|
167
165
|
return checks;
|
|
168
166
|
}
|
|
169
|
-
function committedMaintainedFolders(repoRoot) {
|
|
167
|
+
function committedMaintainedFolders(repoRoot, agents = defaultAgents()) {
|
|
170
168
|
const found = [];
|
|
171
|
-
for (const base of
|
|
169
|
+
for (const base of skillBases(agents)) {
|
|
172
170
|
for (const name of MAINTAINED_SKILLS) {
|
|
173
171
|
const folder = skillDir(name, base);
|
|
174
172
|
if (!hasSymlinkComponent(repoRoot, folder) && isMaintainedCopy(repoRoot, name, base)) found.push(folder);
|
|
@@ -203,14 +201,14 @@ function checkMaintainedReferences(repoRoot) {
|
|
|
203
201
|
];
|
|
204
202
|
}
|
|
205
203
|
function checkMachineSkills(opts) {
|
|
206
|
-
const build = buildsOf(opts.repoRoot, [".outerlayer/skills", ...skillsFolders()]).find((b) => b.text.includes(MACHINE_CORE));
|
|
204
|
+
const build = buildsOf(opts.repoRoot, [".outerlayer/skills", ...skillsFolders(opts.agents)]).find((b) => b.text.includes(MACHINE_CORE));
|
|
207
205
|
if (build === void 0) return [];
|
|
208
206
|
const problems = machineSkillsState(opts.home, opts.version).filter((s) => s.state !== "current");
|
|
209
|
-
const
|
|
210
|
-
if (problems.length === 0 &&
|
|
207
|
+
const agentStale = staleAgentSkills(opts.home, opts.version, opts.agents);
|
|
208
|
+
if (problems.length === 0 && agentStale.length === 0) return [];
|
|
211
209
|
const parts = [
|
|
212
210
|
...problems.map((s) => `${MACHINE_SKILL_PATH}/${s.name} ${s.state === "missing" ? "is missing" : "is from another CLI version"}`),
|
|
213
|
-
...
|
|
211
|
+
...agentStale.map(({ folder, name }) => `${folder}/${name} is not this CLI version's copy`)
|
|
214
212
|
];
|
|
215
213
|
return [
|
|
216
214
|
{
|
|
@@ -221,7 +219,6 @@ function checkMachineSkills(opts) {
|
|
|
221
219
|
}
|
|
222
220
|
];
|
|
223
221
|
}
|
|
224
|
-
var SKILL_BASES2 = [".agents/skills", ".claude/skills"];
|
|
225
222
|
function ignoreRuleFor(repoRoot, path) {
|
|
226
223
|
let out;
|
|
227
224
|
try {
|
|
@@ -233,11 +230,11 @@ function ignoreRuleFor(repoRoot, path) {
|
|
|
233
230
|
if (match === null || match[3].startsWith("!")) return void 0;
|
|
234
231
|
return { source: match[1], line: match[2], pattern: match[3] };
|
|
235
232
|
}
|
|
236
|
-
function ignoredSkillFolders(repoRoot) {
|
|
233
|
+
function ignoredSkillFolders(repoRoot, agents) {
|
|
237
234
|
const found = [];
|
|
238
235
|
let any = false;
|
|
239
236
|
const ruleFor = (path) => ignoreRuleFor(repoRoot, path);
|
|
240
|
-
for (const base of
|
|
237
|
+
for (const base of skillBases(agents)) {
|
|
241
238
|
let names;
|
|
242
239
|
try {
|
|
243
240
|
names = readdirSync(join(repoRoot, base), { withFileTypes: true }).filter((entry) => entry.isDirectory() || entry.isSymbolicLink()).map((entry) => entry.name).sort();
|
|
@@ -266,10 +263,10 @@ function ignoredSkillFix({ folder, ignored, source, line }) {
|
|
|
266
263
|
const anchored = path.slice(0, -1).includes("/") ? path : `/${path}`;
|
|
267
264
|
return `Add the line \`!${anchored}\` to ${source} below line ${line}, then commit the folder.`;
|
|
268
265
|
}
|
|
269
|
-
function checkIgnoredSkillFolders(repoRoot) {
|
|
270
|
-
const { found, any } = ignoredSkillFolders(repoRoot);
|
|
266
|
+
function checkIgnoredSkillFolders(repoRoot, agents = defaultAgents()) {
|
|
267
|
+
const { found, any } = ignoredSkillFolders(repoRoot, agents);
|
|
271
268
|
if (found.length === 0) {
|
|
272
|
-
return !any ? [] : [{ name: "Skills", status: "pass", detail: `no folder under ${
|
|
269
|
+
return !any ? [] : [{ name: "Skills", status: "pass", detail: `no folder under ${skillBases(agents).join(" or ")} is ignored by git` }];
|
|
273
270
|
}
|
|
274
271
|
return found.map((ignored) => ({
|
|
275
272
|
name: "Skills",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { escapeUnitPath, UNIT_MARKER, DEFAULT_UNIT_NAME } from './chunk-
|
|
4
|
-
import { inspectService, realInspectProbes } from './chunk-
|
|
3
|
+
import { escapeUnitPath, UNIT_MARKER, DEFAULT_UNIT_NAME } from './chunk-TYCZVJTB.js';
|
|
4
|
+
import { inspectService, realInspectProbes } from './chunk-J7Y3PCO2.js';
|
|
5
5
|
import { realpathSync, readFileSync, readdirSync } from 'fs';
|
|
6
6
|
import { resolve, dirname, join } from 'path';
|
|
7
7
|
|
|
@@ -43,9 +43,9 @@ function resolvedOr(path) {
|
|
|
43
43
|
return path;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function inspectRunnerService(configPath, probes = realInspectProbes(), units = realUnitFiles()) {
|
|
46
|
+
function inspectRunnerService(configPath, probes = realInspectProbes(), units = realUnitFiles(), agents) {
|
|
47
47
|
const configDir = dirname(configPath);
|
|
48
|
-
return inspectService(findServiceUnit(configDir, units), configDir, probes);
|
|
48
|
+
return inspectService(findServiceUnit(configDir, units), configDir, probes, ...agents === void 0 ? [] : [agents]);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export { findServiceUnit, inspectRunnerService };
|
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
4
|
-
import { isAgentsMdLayout, discoverOuterlayerPaths, isForeignTree, toRepoRelative } from './chunk-
|
|
5
|
-
import { invalidConfigMessage } from './chunk-
|
|
6
|
-
import { retiredSkillPaths, removeRetiredSkills } from './chunk-
|
|
7
|
-
import { maintainedFilesForExistingSkills, loadMaintainedFiles, writeMaintainedFiles } from './chunk-CXFJOX2C.js';
|
|
4
|
+
import { isAgentsMdLayout, discoverOuterlayerPaths, isForeignTree, toRepoRelative } from './chunk-WDQPBAFV.js';
|
|
5
|
+
import { invalidConfigMessage } from './chunk-AYLYAOHH.js';
|
|
6
|
+
import { retiredSkillPaths, removeRetiredSkills } from './chunk-GZ75FRLB.js';
|
|
8
7
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
9
|
-
import { emitTree, generatedHeaderSource, parseOuterlayerConfig, classifyTree } from './chunk-
|
|
8
|
+
import { maintainedFilesForExistingSkills, loadMaintainedFiles, emitTree, emitBuilders, defaultAgents, targetIds, generatedHeaderSource, parseOuterlayerConfig, classifyTree, writeMaintainedFiles, LEGACY_AGENT, agentById } from './chunk-CKPQOQFC.js';
|
|
10
9
|
import { existsSync, readFileSync, mkdirSync, writeFileSync, copyFileSync, unlinkSync, rmdirSync, readdirSync } from 'fs';
|
|
11
10
|
import { join, dirname } from 'path';
|
|
12
11
|
|
|
13
12
|
createRequire(import.meta.url);
|
|
14
13
|
var CONTENT_KINDS = /* @__PURE__ */ new Set(["instructions", "skill", "skill-reference", "command", "mcp"]);
|
|
15
14
|
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git"]);
|
|
16
|
-
var
|
|
15
|
+
var noConfigMessage = () => `no .outerlayer/config.json with a non-empty targets array \u2014 create one, e.g. {"targets": ["${LEGACY_AGENT}"]}`;
|
|
17
16
|
var EmitError = class extends Error {
|
|
18
17
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
function emitNotNeededNotice(targets, agents = defaultAgents()) {
|
|
19
|
+
const labels = targets.map((target) => agentById(target, agents)?.descriptor.label ?? target);
|
|
20
|
+
return `${labels.join(", ")} and Codex read AGENTS.md and .agents/skills/ without a generated copy. Run \`${cliInvocation()} init --update\` to move this repository there and stop committing generated files.`;
|
|
21
|
+
}
|
|
22
|
+
function readsSharedFiles(id, agents) {
|
|
23
|
+
const native = agentById(id, agents)?.descriptor.context.native ?? [];
|
|
24
|
+
return native.includes("agents-md") && native.includes("skills");
|
|
25
|
+
}
|
|
26
|
+
function noticeFor(repoRoot, targets, agents) {
|
|
27
|
+
if (targets.length === 0 || !targets.every((t) => readsSharedFiles(t, agents))) return void 0;
|
|
28
|
+
return isAgentsMdLayout(repoRoot) ? void 0 : emitNotNeededNotice(targets, agents);
|
|
24
29
|
}
|
|
25
30
|
var HAND_OWNED_OUTPUT = /(^|\/)(CLAUDE\.md|AGENTS\.md|\.claude\/skills\/|\.agents\/skills\/)/;
|
|
26
|
-
function resolveTargetsFromConfig(repoRoot) {
|
|
31
|
+
function resolveTargetsFromConfig(repoRoot, agents) {
|
|
27
32
|
const configPath = join(repoRoot, ".outerlayer", "config.json");
|
|
28
|
-
if (!existsSync(configPath)) throw new EmitError(
|
|
33
|
+
if (!existsSync(configPath)) throw new EmitError(noConfigMessage());
|
|
29
34
|
const raw = readFileSync(configPath, "utf8");
|
|
30
|
-
const result = parseOuterlayerConfig(raw);
|
|
35
|
+
const result = parseOuterlayerConfig(raw, targetIds(agents));
|
|
31
36
|
if (result.ok) return result.config.targets;
|
|
32
|
-
if (result.errors.some((e) => e.code === "no_targets")) throw new EmitError(
|
|
37
|
+
if (result.errors.some((e) => e.code === "no_targets")) throw new EmitError(noConfigMessage());
|
|
33
38
|
throw new EmitError(invalidConfigMessage(result.errors));
|
|
34
39
|
}
|
|
35
40
|
function buildEmitInput(repoRoot, targets, maintained, excluded = /* @__PURE__ */ new Set()) {
|
|
@@ -174,17 +179,17 @@ function withholdKept(repoRoot, result, keep) {
|
|
|
174
179
|
});
|
|
175
180
|
return { result: { ...result, files, copies }, kept: kept.sort() };
|
|
176
181
|
}
|
|
177
|
-
function runEmit(opts = {}) {
|
|
182
|
+
function runEmit(opts = {}, agents = defaultAgents()) {
|
|
178
183
|
const cwd = opts.cwd ?? process.cwd();
|
|
179
184
|
if (!existsSync(cwd)) throw new EmitError(`no such directory: ${cwd}`);
|
|
180
|
-
const targets = resolveTargetsFromConfig(cwd);
|
|
185
|
+
const targets = resolveTargetsFromConfig(cwd, agents);
|
|
181
186
|
const agentsMd = isAgentsMdLayout(cwd);
|
|
182
187
|
const ignoreOrphan = agentsMd ? (path) => HAND_OWNED_OUTPUT.test(path) : void 0;
|
|
183
188
|
const maintained = agentsMd ? [] : maintainedFilesForExistingSkills(cwd, loadMaintainedFiles());
|
|
184
|
-
const notice = noticeFor(cwd, targets);
|
|
189
|
+
const notice = noticeFor(cwd, targets, agents);
|
|
185
190
|
const retired = retiredSkillPaths(cwd);
|
|
186
191
|
const built = buildEmitInput(cwd, targets, maintained, new Set(retired));
|
|
187
|
-
const emitted = emitTree(built.input);
|
|
192
|
+
const emitted = emitTree(built.input, emitBuilders(agents));
|
|
188
193
|
const { result, kept } = withholdKept(cwd, emitted, opts.keep);
|
|
189
194
|
const hasErrors = result.errors.length > 0;
|
|
190
195
|
const outputs = new Set(emitted.files.map((f) => f.path));
|
|
@@ -269,17 +274,17 @@ function runCheck(cwd, opts, targets, result, hasErrors, outputs, sourcePaths, m
|
|
|
269
274
|
return { ...notice === void 0 ? {} : { notice }, targets, files: [], copies: [], maintained: [], kept, retired: [], orphaned: [], warnings: result.warnings, errors: result.errors, drift, output, exitCode };
|
|
270
275
|
}
|
|
271
276
|
var REPLACED_OUTPUT = /^(?:(?:.*\/)?(?:CLAUDE|AGENTS)\.md|(?:.*\/)?\.(?:claude|agents)\/skills\/.+)$/;
|
|
272
|
-
function inspectReplacedOutputs(repoRoot) {
|
|
277
|
+
function inspectReplacedOutputs(repoRoot, agents = defaultAgents()) {
|
|
273
278
|
let configured = [];
|
|
274
279
|
try {
|
|
275
|
-
configured = resolveTargetsFromConfig(repoRoot);
|
|
280
|
+
configured = resolveTargetsFromConfig(repoRoot, agents);
|
|
276
281
|
} catch {
|
|
277
282
|
}
|
|
278
|
-
const targets = [.../* @__PURE__ */ new Set([...configured,
|
|
283
|
+
const targets = [.../* @__PURE__ */ new Set([...configured, ...targetIds(agents)])];
|
|
279
284
|
const maintained = maintainedFilesForExistingSkills(repoRoot, loadMaintainedFiles());
|
|
280
285
|
const maintainedPaths = new Set(maintained.map((f) => f.path));
|
|
281
286
|
const built = buildEmitInput(repoRoot, targets, maintained, new Set(retiredSkillPaths(repoRoot)));
|
|
282
|
-
const emitted = emitTree(built.input);
|
|
287
|
+
const emitted = emitTree(built.input, emitBuilders(agents));
|
|
283
288
|
const generated = [];
|
|
284
289
|
const edited = [];
|
|
285
290
|
const replacedDiffering = [];
|
|
@@ -303,4 +308,4 @@ function inspectReplacedOutputs(repoRoot) {
|
|
|
303
308
|
return { generated: generated.sort(), edited: edited.sort(), replacedDiffering: replacedDiffering.sort() };
|
|
304
309
|
}
|
|
305
310
|
|
|
306
|
-
export {
|
|
311
|
+
export { EmitError, inspectReplacedOutputs, runEmit };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { isSameProcess } from './chunk-JBJTC3UU.js';
|
|
4
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
4
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-GD6KIHOS.js';
|
|
5
5
|
import { existsSync, readFileSync, mkdirSync, writeFileSync, rmSync } from 'fs';
|
|
6
6
|
import { dirname } from 'path';
|
|
7
7
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
4
|
-
import {
|
|
4
|
+
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
5
|
+
import { linkedAgentsPath } from './chunk-VRQM4A64.js';
|
|
6
|
+
import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, AGENTS_SKILLS_BASE, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, LEGACY_AGENT, MACHINE_SKILL_PATH } from './chunk-CKPQOQFC.js';
|
|
5
7
|
import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
|
|
6
8
|
import { resolvePackageVersion } from './chunk-RA3O54FC.js';
|
|
7
|
-
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
8
|
-
import { linkedAgentsPath } from './chunk-B7PYT2BY.js';
|
|
9
9
|
import { readFileSync, existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
10
10
|
import { join, dirname } from 'path';
|
|
11
11
|
|
|
@@ -111,7 +111,7 @@ function formatStarterPackOutput(result) {
|
|
|
111
111
|
...result.validatorsKept.map((path) => `${C.dim}${path} already exists \u2014 left as it is${C.reset}`),
|
|
112
112
|
"",
|
|
113
113
|
...base === OUTERLAYER_SKILLS_BASE ? [
|
|
114
|
-
`Next: create .outerlayer/config.json naming your agent tools, for example {"targets": ["
|
|
114
|
+
`Next: create .outerlayer/config.json naming your agent tools, for example {"targets": ["${LEGACY_AGENT}"]},`,
|
|
115
115
|
`then run ${C.yellow}${cliInvocation()} context emit${C.reset} to compile the skills into their native files.`
|
|
116
116
|
] : [`Agents read these skills from ${base}/ as they are. Nothing needs compiling.`]
|
|
117
117
|
);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { sanitizeTerminal } from './chunk-P6PHY33P.js';
|
|
4
|
-
import { resolvePackRoot } from './chunk-
|
|
5
|
-
import { parseProofsConfig } from './chunk-24FEVLX7.js';
|
|
4
|
+
import { resolvePackRoot, parseProofsConfig } from './chunk-CKPQOQFC.js';
|
|
6
5
|
import { CHECK_ITEM_REASON_MAX_LENGTH, CheckItemsSchema } from './chunk-WUKLQWGY.js';
|
|
7
6
|
import { createHash } from 'crypto';
|
|
8
7
|
import { join } from 'path';
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { sharedSkillNames } from './chunk-
|
|
4
|
-
import { GOVERNANCE_VARIABLE, versionAtLeast, MINIMUM_CLAUDE_VERSION, SHIM_SCRIPT, CONTROL_PLANE_DIR_VARIABLE } from './chunk-
|
|
5
|
-
export { MINIMUM_CLAUDE_VERSION } from './chunk-
|
|
3
|
+
import { sharedSkillNames } from './chunk-TWYHSMHM.js';
|
|
4
|
+
import { GOVERNANCE_VARIABLE, versionAtLeast, MINIMUM_CLAUDE_VERSION, SHIM_SCRIPT, CONTROL_PLANE_DIR_VARIABLE } from './chunk-NC3QAHOS.js';
|
|
5
|
+
export { MINIMUM_CLAUDE_VERSION } from './chunk-NC3QAHOS.js';
|
|
6
6
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
7
|
-
import { setupMachineSkills } from './chunk-
|
|
8
|
-
import './chunk-
|
|
7
|
+
import { setupMachineSkills } from './chunk-I626B72C.js';
|
|
8
|
+
import { defaultAgents, legacyAgent } from './chunk-CKPQOQFC.js';
|
|
9
|
+
import './chunk-WUKLQWGY.js';
|
|
9
10
|
import './chunk-CDDED64E.js';
|
|
10
11
|
import './chunk-RA3O54FC.js';
|
|
11
|
-
import './chunk-24FEVLX7.js';
|
|
12
|
-
import './chunk-WUKLQWGY.js';
|
|
13
12
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
14
13
|
import './chunk-Z5GEFMRW.js';
|
|
15
14
|
import { spawn, execFileSync, spawnSync } from 'child_process';
|
|
@@ -18,6 +17,12 @@ import { join, delimiter, isAbsolute, resolve, dirname, basename } from 'path';
|
|
|
18
17
|
import { createHash, randomBytes } from 'crypto';
|
|
19
18
|
|
|
20
19
|
createRequire(import.meta.url);
|
|
20
|
+
function under(base, folder) {
|
|
21
|
+
return join(base, ...folder.split("/"));
|
|
22
|
+
}
|
|
23
|
+
function skillFolderOf(agents) {
|
|
24
|
+
return legacyAgent(agents).descriptor.context.repoSkillFolders[0];
|
|
25
|
+
}
|
|
21
26
|
function ownSkillsRoot(home) {
|
|
22
27
|
return join(home, ".outerlayer", "context", "own");
|
|
23
28
|
}
|
|
@@ -34,8 +39,8 @@ function folderNames(dir) {
|
|
|
34
39
|
return [];
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
|
-
function wantedLinks(repoRoot, shared) {
|
|
38
|
-
const provided = new Set(folderNames(
|
|
42
|
+
function wantedLinks(repoRoot, shared, agents) {
|
|
43
|
+
const provided = new Set(folderNames(under(repoRoot, skillFolderOf(agents))));
|
|
39
44
|
const wanted = /* @__PURE__ */ new Map();
|
|
40
45
|
for (const name of folderNames(join(repoRoot, ".agents", "skills")).sort()) {
|
|
41
46
|
if (provided.has(name) || shared.has(name)) continue;
|
|
@@ -43,8 +48,8 @@ function wantedLinks(repoRoot, shared) {
|
|
|
43
48
|
}
|
|
44
49
|
return wanted;
|
|
45
50
|
}
|
|
46
|
-
function holdsLinks(dir, wanted) {
|
|
47
|
-
const skills =
|
|
51
|
+
function holdsLinks(dir, wanted, agents) {
|
|
52
|
+
const skills = under(dir, skillFolderOf(agents));
|
|
48
53
|
let names;
|
|
49
54
|
try {
|
|
50
55
|
names = readdirSync(skills);
|
|
@@ -74,8 +79,8 @@ function removeMovedAside(path) {
|
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
}
|
|
77
|
-
function ensureOwnSkillsDir(input) {
|
|
78
|
-
const wanted = wantedLinks(input.repoRoot, new Set(input.shared));
|
|
82
|
+
function ensureOwnSkillsDir(input, agents = defaultAgents()) {
|
|
83
|
+
const wanted = wantedLinks(input.repoRoot, new Set(input.shared), agents);
|
|
79
84
|
if (wanted.size === 0) return void 0;
|
|
80
85
|
const root = ownSkillsRoot(input.home);
|
|
81
86
|
mkdirSync(root, { recursive: true });
|
|
@@ -89,13 +94,13 @@ function ensureOwnSkillsDir(input) {
|
|
|
89
94
|
`);
|
|
90
95
|
renameSync(temporary2, record);
|
|
91
96
|
};
|
|
92
|
-
if (holdsLinks(final, wanted)) {
|
|
97
|
+
if (holdsLinks(final, wanted, agents)) {
|
|
93
98
|
if (!existsSync(record)) writeRecord();
|
|
94
99
|
return final;
|
|
95
100
|
}
|
|
96
101
|
const temporary = join(root, `.tmp-${randomBytes(6).toString("hex")}`);
|
|
97
|
-
mkdirSync(
|
|
98
|
-
for (const [name, target] of wanted) symlinkSync(target, join(temporary,
|
|
102
|
+
mkdirSync(under(temporary, skillFolderOf(agents)), { recursive: true });
|
|
103
|
+
for (const [name, target] of wanted) symlinkSync(target, join(under(temporary, skillFolderOf(agents)), name));
|
|
99
104
|
try {
|
|
100
105
|
for (let attempt = 0; attempt < REPLACE_ATTEMPTS; attempt += 1) {
|
|
101
106
|
try {
|
|
@@ -103,7 +108,7 @@ function ensureOwnSkillsDir(input) {
|
|
|
103
108
|
writeRecord();
|
|
104
109
|
return final;
|
|
105
110
|
} catch {
|
|
106
|
-
if (holdsLinks(final, wanted)) {
|
|
111
|
+
if (holdsLinks(final, wanted, agents)) {
|
|
107
112
|
writeRecord();
|
|
108
113
|
return final;
|
|
109
114
|
}
|
|
@@ -338,7 +343,7 @@ async function runClaudeLauncher(args, deps = {}) {
|
|
|
338
343
|
return 1;
|
|
339
344
|
}
|
|
340
345
|
} else {
|
|
341
|
-
const { resolveLaunchPlane } = await import('./control-plane-launch-
|
|
346
|
+
const { resolveLaunchPlane } = await import('./control-plane-launch-THUH6YU5.js');
|
|
342
347
|
const plane = env[GOVERNANCE_VARIABLE] === "self" ? { kind: "none" } : await resolveLaunchPlane({ cwd, env, home, fetchImpl: deps.fetchImpl, stderr });
|
|
343
348
|
if (plane.kind === "none") {
|
|
344
349
|
const own2 = ownSkillsDirFor(cwd, home, [], stderr);
|