@outerlayer/cli 0.26.4 → 0.27.1
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 +23 -0
- package/README.md +12 -9
- package/dist/{agent-setup-5DXPEO64.js → agent-setup-UW36TAQM.js} +11 -11
- package/dist/{bridge-5KZ36YDG.js → bridge-B5VJVECY.js} +2 -2
- package/dist/build-HRLACBOZ.js +12 -0
- package/dist/build-info.json +1 -1
- package/dist/{builder-KDUXCHTY.js → builder-6Y6ZWGNH.js} +6 -6
- package/dist/{check-ZSYCR5WG.js → check-YTXFVWK7.js} +41 -40
- package/dist/{chunk-B6K7R5UY.js → chunk-2BTFKNTR.js} +2 -2
- package/dist/{chunk-H57M3HC7.js → chunk-2F762IXY.js} +2 -2
- package/dist/{chunk-2K3TCQHW.js → chunk-2I3LIRZP.js} +26 -8
- package/dist/{chunk-6CGXSMKX.js → chunk-55GNQPO6.js} +17 -6
- package/dist/{chunk-V3YJFEZA.js → chunk-5VMDGJGH.js} +274 -45
- package/dist/{chunk-OQUD3UYF.js → chunk-64GMBWAK.js} +5 -5
- package/dist/{chunk-MWPBF2XG.js → chunk-6KKM7VGZ.js} +32 -4
- package/dist/{chunk-VPEGE3QZ.js → chunk-6TRNCUM4.js} +1 -1
- package/dist/{chunk-27RDUTQH.js → chunk-6VFH52MP.js} +195 -39
- package/dist/{chunk-6SPXKRQR.js → chunk-7AQ5AM7U.js} +12 -5
- package/dist/{chunk-HBISTTG3.js → chunk-7OUOLGUV.js} +20 -5
- package/dist/{chunk-NWPRNKZ5.js → chunk-ABXQBEYK.js} +1 -1
- package/dist/{chunk-EHBDYLM6.js → chunk-B7DJVG25.js} +3 -3
- package/dist/{chunk-4UFSTKE5.js → chunk-BPKO76QR.js} +4 -4
- package/dist/{chunk-MCSINUVC.js → chunk-BWH36FOC.js} +1 -1
- package/dist/{chunk-IZAOO5AR.js → chunk-D7ECMB7B.js} +4 -4
- package/dist/{chunk-UZEQVPKF.js → chunk-DJHNEGNM.js} +27 -3
- package/dist/{chunk-O4362FPA.js → chunk-E5IJ5533.js} +2 -2
- package/dist/{chunk-JWRX5ZTT.js → chunk-EPPIISRD.js} +2 -2
- package/dist/{chunk-QUP6CVBQ.js → chunk-EX5MQYEF.js} +5 -5
- package/dist/{chunk-KNBWOL2B.js → chunk-FP23SVDD.js} +5 -5
- package/dist/{chunk-VGHKTSHU.js → chunk-GFUE5TKO.js} +3 -3
- package/dist/{chunk-XLC7KEUV.js → chunk-GLUKDQS4.js} +1 -1
- package/dist/{chunk-GFHLEVUE.js → chunk-HWDYLXHH.js} +7 -4
- package/dist/chunk-IMOB4IOI.js +181 -0
- package/dist/{chunk-JKNYTNYD.js → chunk-LOKSLO25.js} +1 -1
- package/dist/{chunk-ZMZGWLYD.js → chunk-LPFOWUHG.js} +13 -13
- package/dist/{chunk-2J46BQ5Y.js → chunk-M3MHHIUW.js} +1 -1
- package/dist/{chunk-7Z2WMXM5.js → chunk-MATUHHN4.js} +1 -1
- package/dist/{chunk-MQ743JX3.js → chunk-MHX7YX7Y.js} +1 -1
- package/dist/{chunk-PZA6ZFYW.js → chunk-N4D5TMVU.js} +2 -2
- package/dist/{chunk-WK35HB56.js → chunk-O2IJTY7L.js} +2 -2
- package/dist/{chunk-6WTAYEKJ.js → chunk-P33PZIWS.js} +55 -7
- package/dist/{chunk-K4FXNMV5.js → chunk-QHH4OSD4.js} +1 -1
- package/dist/{chunk-Y4BXRVDI.js → chunk-QKIQ2R7F.js} +3 -3
- package/dist/{chunk-SBW4K3XZ.js → chunk-R7SGBXUD.js} +76 -30
- package/dist/{chunk-F3BBEBPL.js → chunk-RHAGBUL5.js} +1 -1
- package/dist/{chunk-OFTFW7TH.js → chunk-RHGF73IU.js} +1 -1
- package/dist/{chunk-6MZSX4M7.js → chunk-STSLH5EJ.js} +3 -1
- package/dist/{chunk-VQ7OAG6H.js → chunk-VS27BP3E.js} +4 -4
- package/dist/{chunk-OZKEEXVH.js → chunk-WSYXLLA5.js} +6 -6
- package/dist/{chunk-WX2WEERU.js → chunk-WUL2OP5A.js} +3 -3
- package/dist/{chunk-MXTN35XN.js → chunk-XBPUTQ7E.js} +1 -1
- package/dist/{chunk-UNF7MWEL.js → chunk-XS3FDWSZ.js} +1 -1
- package/dist/{chunk-VJBFQP3H.js → chunk-XZ6Q6ZNR.js} +9 -5
- package/dist/{chunk-GWRDL75D.js → chunk-Y4OKEFAX.js} +1 -1
- package/dist/{chunk-Q2SVLBMI.js → chunk-Y7ZCHBYB.js} +2 -2
- package/dist/chunk-YB3CSYXX.js +95 -0
- package/dist/chunk-YJLHUKYS.js +38 -0
- package/dist/{chunk-UOGQZQXN.js → chunk-ZFBJUOYT.js} +6 -6
- package/dist/{claude-launcher-TTLTS4N6.js → claude-launcher-NQSZBTQ5.js} +8 -4
- package/dist/{cli-SKF3AMZ5.js → cli-GHEOBXC7.js} +133 -127
- package/dist/{command-E5OG5NCH.js → command-V7B7GTPZ.js} +30 -29
- package/dist/{config-JJ3EO7SB.js → config-TWS5VZEN.js} +3 -3
- package/dist/{connect-cmd-SL4S5HJM.js → connect-cmd-HGS7YPA2.js} +7 -7
- package/dist/{container-start-IA2HK4QI.js → container-start-FHB2VDC4.js} +29 -28
- package/dist/{control-plane-launch-JIQOE6BP.js → control-plane-launch-DBQA3KLJ.js} +8 -8
- package/dist/{docker-KKE5Q5S2.js → docker-YT6Z3LXI.js} +6 -6
- package/dist/{doctor-U2N7AF3N.js → doctor-Y4NCNSJM.js} +181 -34
- package/dist/{emit-artifact-cmd-SDG5H6D7.js → emit-artifact-cmd-ALDK55Y2.js} +11 -11
- package/dist/{emit-cmd-WQH2NK7H.js → emit-cmd-VAQHRWJR.js} +4 -4
- package/dist/{emit-criteria-cmd-QGSP77AG.js → emit-criteria-cmd-Q7SM6VP2.js} +8 -8
- package/dist/{emit-finding-cmd-6FGMTEFM.js → emit-finding-cmd-2NBAPDSV.js} +8 -8
- package/dist/{emit-result-cmd-AUPIXPEU.js → emit-result-cmd-KUSL56RI.js} +11 -11
- package/dist/{emit-step-cmd-PORHEKHN.js → emit-step-cmd-KD4AKEAT.js} +9 -9
- package/dist/{exec-client-J6L5FDRR.js → exec-client-6WVS7DRZ.js} +3 -3
- package/dist/{governing-source-YPBK4H5H.js → governing-source-VVUA5TKB.js} +13 -13
- package/dist/{guest-init-CXIHA5VI.js → guest-init-H5K2RW3P.js} +4 -4
- package/dist/{hook-fast-XMZFMBKC.js → hook-fast-3SUJM765.js} +1 -1
- package/dist/{host-key-GQFBRX3J.js → host-key-XNKZCWTS.js} +3 -3
- package/dist/{image-tag-W4JKVNP4.js → image-tag-R34J4O3F.js} +3 -3
- package/dist/index.js +4 -4
- package/dist/{init-Y64OAKKQ.js → init-3DAGX7UY.js} +30 -29
- package/dist/{init-GEFKJNJU.js → init-SWKYV6CL.js} +29 -28
- package/dist/{init-cmd-YR4LLIRU.js → init-cmd-RIDBVSE4.js} +15 -14
- package/dist/{init-update-46G6QJHB.js → init-update-ECWNG47R.js} +55 -26
- package/dist/{inspect-6UYAAXH7.js → inspect-IPFA7AAT.js} +1 -1
- package/dist/{install-AFMXH25X.js → install-6OIY3KHZ.js} +6 -5
- package/dist/{install-cmd-X5XCUTSX.js → install-cmd-JMT67P35.js} +5 -5
- package/dist/{layout-UOJQGEPW.js → layout-XNFDTOET.js} +2 -2
- package/dist/{logs-PKNQOJN6.js → logs-XHAS6LMZ.js} +2 -2
- package/dist/loop-AIJZVUNA.js +79 -0
- package/dist/{machine-3W4LKTEW.js → machine-OOQ2NXC3.js} +24 -23
- package/dist/machine-skills-FLIRJYP7.js +11 -0
- package/dist/{mcp-serve-cmd-MJIJHSQ6.js → mcp-serve-cmd-LY5A3CE7.js} +4 -4
- package/dist/{paths-6V7572NN.js → paths-LHSPNORF.js} +2 -2
- package/dist/{pending-GUHHKO42.js → pending-3YZCSKON.js} +3 -3
- package/dist/{pidfile-ZQOFDY7T.js → pidfile-DKMYYXLH.js} +3 -3
- package/dist/{record-C4ZVSLKV.js → record-3LPTY3G5.js} +3 -3
- package/dist/{runner-env-6Q2RMENH.js → runner-env-YRRNRKF4.js} +8 -7
- package/dist/{runner-identity-DP577A7S.js → runner-identity-YS2BZXZV.js} +6 -6
- package/dist/{runner-key-LR5P2EJ5.js → runner-key-EFNTZWNX.js} +29 -28
- package/dist/{session-sender-ZTPWIU5L.js → session-sender-SC5PSU2G.js} +12 -12
- package/dist/{spec-cmd-RLZMX67G.js → spec-cmd-JGYHHJ4P.js} +9 -9
- package/dist/{starter-pack-55EFILC5.js → starter-pack-GPU4X6B7.js} +2 -2
- package/dist/{status-GNUOTHRH.js → status-7WM7S7JX.js} +31 -30
- package/dist/{sync-cmd-GLWEAULP.js → sync-cmd-ATXJVS7S.js} +11 -11
- package/dist/{watch-F47NPUDX.js → watch-M7NR3DOW.js} +11 -11
- package/dist/{work-claim-cmd-GXPIRRBG.js → work-claim-cmd-DNUDZKJA.js} +13 -13
- package/dist/{work-cmd-S2FHIFJA.js → work-cmd-VECTYST6.js} +9 -9
- package/dist/{work-comment-cmd-UJRKULO6.js → work-comment-cmd-F3NRWKPZ.js} +9 -9
- package/dist/{work-logs-cmd-SCAHJXSP.js → work-logs-cmd-QF6P32FE.js} +9 -9
- package/dist/{work-open-pr-cmd-BGMHUQGD.js → work-open-pr-cmd-XE23JA3R.js} +10 -10
- package/dist/{work-pr-cmd-EDDRP5DK.js → work-pr-cmd-BH56GUKN.js} +9 -9
- package/dist/{work-stop-cmd-ADE5K6UX.js → work-stop-cmd-C3F5HNUO.js} +9 -9
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-cli/SKILL.md +6 -5
- package/skill-pack/shipped.json +1 -0
- package/skill-pack/template/build/SKILL.md +1 -1
- package/dist/build-F5QWH7G5.js +0 -12
- package/dist/chunk-7RQ73DLO.js +0 -23
- package/dist/loop-3TJKFRN7.js +0 -78
|
@@ -554,6 +554,24 @@ function writeSessionStartContext(event, home, cwd, write, systemMessage, extraP
|
|
|
554
554
|
} catch {
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
+
var MACHINE_CORE = "~/.agents/skills/outerlayer-build/SKILL.md";
|
|
558
|
+
var BUILD_SKILL_FILES = [".agents/skills/build/SKILL.md", ".outerlayer/skills/build/SKILL.md", ".claude/skills/build/SKILL.md"];
|
|
559
|
+
function machineSkillsContext(home, cwd) {
|
|
560
|
+
for (let dir = cwd; ; dir = join(dir, "..")) {
|
|
561
|
+
for (const file of BUILD_SKILL_FILES) {
|
|
562
|
+
let text;
|
|
563
|
+
try {
|
|
564
|
+
text = readFileSync(join(dir, file), "utf8");
|
|
565
|
+
} catch {
|
|
566
|
+
continue;
|
|
567
|
+
}
|
|
568
|
+
if (!text.includes(MACHINE_CORE)) return null;
|
|
569
|
+
if (existsSync(join(home, ".agents", "skills", "outerlayer-build", "SKILL.md"))) return null;
|
|
570
|
+
return `This repository's build skill reads ${MACHINE_CORE}, and that file does not exist. Tell the person that the maintained skills are not installed on this machine, and ask them to run \`${cliInvocation()} init --local\`.`;
|
|
571
|
+
}
|
|
572
|
+
if (join(dir, "..") === dir) return null;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
557
575
|
var HEAL_RETRY_INTERVAL_MS = 6 * 60 * 60 * 1e3;
|
|
558
576
|
function healFailureMarkerPath(home, repoRoot) {
|
|
559
577
|
const key = createHash("sha256").update(repoRoot).digest("hex").slice(0, 16);
|
|
@@ -664,7 +682,7 @@ async function missingControlPlane(cwd, sessionId, home, env) {
|
|
|
664
682
|
cleanupEarlierCopies(dirs);
|
|
665
683
|
}
|
|
666
684
|
if (!contextPossiblyGoverned(cwd, home)) return void 0;
|
|
667
|
-
const { governanceOf } = await import('./control-plane-launch-
|
|
685
|
+
const { governanceOf } = await import('./control-plane-launch-DBQA3KLJ.js');
|
|
668
686
|
if (await governanceOf({ cwd, env, home }) !== "governed") return void 0;
|
|
669
687
|
recordMissingContext(dirs, sessionId, home);
|
|
670
688
|
const launcher = `${cliInvocation()} claude`;
|
|
@@ -735,6 +753,7 @@ async function runHookFast(event, home = homeFromEnv(), read = readStdin, env =
|
|
|
735
753
|
let workLaunchMessage;
|
|
736
754
|
let hookErrorsMessage;
|
|
737
755
|
let renewalHookMessage;
|
|
756
|
+
let machineSkillsMessage;
|
|
738
757
|
if (resolvedEvent === "SessionStart") {
|
|
739
758
|
const hookErrorsBytes = fileSizeBytes(join(dir, "hook-errors.log"));
|
|
740
759
|
const hookErrorsSeen = hookErrorsSeenBytes(home);
|
|
@@ -752,6 +771,11 @@ async function runHookFast(event, home = homeFromEnv(), read = readStdin, env =
|
|
|
752
771
|
logHookError(home, err);
|
|
753
772
|
}
|
|
754
773
|
}
|
|
774
|
+
try {
|
|
775
|
+
machineSkillsMessage = machineSkillsContext(home, sessionCwd) ?? void 0;
|
|
776
|
+
} catch (err) {
|
|
777
|
+
logHookError(home, err);
|
|
778
|
+
}
|
|
755
779
|
try {
|
|
756
780
|
deadHooksMessage = deadHooksAutoHealContext(sessionCwd, home) ?? void 0;
|
|
757
781
|
} catch (err) {
|
|
@@ -776,7 +800,7 @@ async function runHookFast(event, home = homeFromEnv(), read = readStdin, env =
|
|
|
776
800
|
sessionCwd,
|
|
777
801
|
(out) => process.stdout.write(out),
|
|
778
802
|
missingPlane?.person,
|
|
779
|
-
[missingPlane?.agent, deadHooksMessage, workLaunchMessage, hookErrorsMessage, renewalHookMessage].filter(
|
|
803
|
+
[missingPlane?.agent, machineSkillsMessage, deadHooksMessage, workLaunchMessage, hookErrorsMessage, renewalHookMessage].filter(
|
|
780
804
|
(s) => s !== void 0
|
|
781
805
|
)
|
|
782
806
|
);
|
|
@@ -810,4 +834,4 @@ function recordLinkExitFailure(argv, home = homeFromEnv(), target = process) {
|
|
|
810
834
|
});
|
|
811
835
|
}
|
|
812
836
|
|
|
813
|
-
export { AUTO_SYNC_DEBOUNCE_MS, DUPLICATE_RUN_WINDOW_MS, SYNC_STALE_AFTER_MS, WORK_LEASE_RENEW_DEBOUNCE_MS, WORK_LINK_RETRIES, assessSyncHealth, checkInstalledCliStaleness, contextPossiblyGoverned, formatAgo, handleWorkLaunch, handleWorkSessionEnd, hookFiredMarkerPath, installedCliDistDir, isDuplicateRun, logHookError, markWorkLeaseRenewed, maybeAutoSync, maybeRenewWorkLease, readSyncStatus, recordLinkExitFailure, refreshCommand, runHookFast, sanitizeForContext, spoolDir, workspaceRootOf, writeSyncStatus };
|
|
837
|
+
export { AUTO_SYNC_DEBOUNCE_MS, DUPLICATE_RUN_WINDOW_MS, SYNC_STALE_AFTER_MS, WORK_LEASE_RENEW_DEBOUNCE_MS, WORK_LINK_RETRIES, assessSyncHealth, checkInstalledCliStaleness, contextPossiblyGoverned, formatAgo, handleWorkLaunch, handleWorkSessionEnd, hookFiredMarkerPath, installedCliDistDir, isDuplicateRun, logHookError, machineSkillsContext, markWorkLeaseRenewed, maybeAutoSync, maybeRenewWorkLease, readSyncStatus, recordLinkExitFailure, refreshCommand, runHookFast, sanitizeForContext, spoolDir, workspaceRootOf, writeSyncStatus };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { autoConnect, detectActiveSession } from './chunk-
|
|
4
|
-
import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-
|
|
3
|
+
import { autoConnect, detectActiveSession } from './chunk-2F762IXY.js';
|
|
4
|
+
import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-BWH36FOC.js';
|
|
5
5
|
import { resolveRepoIdentity } from './chunk-QE3UQAHK.js';
|
|
6
6
|
import { C } from './chunk-ANPNT6PM.js';
|
|
7
7
|
import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { MAX_ALLOW_HOSTS, allowHostProblem } from './chunk-UXYLWVTQ.js';
|
|
4
|
-
import { parseSize } from './chunk-
|
|
4
|
+
import { parseSize } from './chunk-YJLHUKYS.js';
|
|
5
5
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
6
|
-
import { isRefusedInConfig, resolveDestinations, isReservedVariable } from './chunk-
|
|
6
|
+
import { isRefusedInConfig, resolveDestinations, isReservedVariable } from './chunk-2I3LIRZP.js';
|
|
7
7
|
import { existsSync, statSync, accessSync, constants, readFileSync } from 'fs';
|
|
8
8
|
import { hostname } from 'os';
|
|
9
9
|
import { join } from 'path';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RecipeError, BUILDKIT_IMAGE } from './chunk-
|
|
4
|
-
import { parseSize } from './chunk-
|
|
3
|
+
import { RecipeError, BUILDKIT_IMAGE } from './chunk-2BTFKNTR.js';
|
|
4
|
+
import { parseSize } from './chunk-YJLHUKYS.js';
|
|
5
5
|
import { compareVersions } from './chunk-QE3UQAHK.js';
|
|
6
|
-
import { ensureHostKey } from './chunk-
|
|
7
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-
|
|
8
|
-
import { CLAUDE_PORT, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-
|
|
6
|
+
import { ensureHostKey } from './chunk-Y4OKEFAX.js';
|
|
7
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-RHAGBUL5.js';
|
|
8
|
+
import { CLAUDE_PORT, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-2I3LIRZP.js';
|
|
9
9
|
import { JOIN_DIR, RELAY_ID, JOIN_SOCKET, TARGET_GATEWAY, TARGET_CLAUDE, destinationTarget, RELAY_USER } from './chunk-JGD5TWQ2.js';
|
|
10
10
|
import { StringDecoder } from 'string_decoder';
|
|
11
11
|
import { spawn } from 'child_process';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { runEmit } from './chunk-
|
|
4
|
-
import { installStarterPack } from './chunk-
|
|
5
|
-
import {
|
|
3
|
+
import { runEmit } from './chunk-WUL2OP5A.js';
|
|
4
|
+
import { installStarterPack } from './chunk-XZ6Q6ZNR.js';
|
|
5
|
+
import { AGENTS_MD_LAYOUT, declareAgentsMdLayout, linkClaudeSkills, SKILLS_LINK_PATH, describeSkillsLink, isAgentsMdLayout, holdsTodaysLayoutSources, discoverOuterlayerPaths } from './chunk-LOKSLO25.js';
|
|
6
|
+
import { resolveGitCommonDir, defaultGitRunner } from './chunk-BPKO76QR.js';
|
|
7
|
+
import { loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE } from './chunk-7OUOLGUV.js';
|
|
6
8
|
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-KT4CN6OU.js';
|
|
7
9
|
import { C } from './chunk-ANPNT6PM.js';
|
|
8
|
-
import { AGENTS_MD_LAYOUT, declareAgentsMdLayout, linkClaudeSkills, SKILLS_LINK_PATH, describeSkillsLink, isAgentsMdLayout, holdsTodaysLayoutSources, discoverOuterlayerPaths } from './chunk-JKNYTNYD.js';
|
|
9
|
-
import { loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE } from './chunk-HBISTTG3.js';
|
|
10
10
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
11
11
|
import { linkedAgentsPath } from './chunk-VWFOKRYS.js';
|
|
12
12
|
import { cloneIsGoverned } from './chunk-YQR6E6OV.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { DEFAULT_UNIT_NAME } from './chunk-
|
|
4
|
-
import { parseRunnerEnv } from './chunk-
|
|
5
|
-
import { RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { DEFAULT_UNIT_NAME } from './chunk-7AQ5AM7U.js';
|
|
4
|
+
import { parseRunnerEnv } from './chunk-STSLH5EJ.js';
|
|
5
|
+
import { RUNNER_FILE_MODE } from './chunk-RHAGBUL5.js';
|
|
6
6
|
import { existsSync, readFileSync, writeFileSync, renameSync, rmSync } from 'fs';
|
|
7
7
|
import { join, dirname } from 'path';
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RELAY_PORT, GATEWAY_SOCKET, GATEWAY_PORT, CLAUDE_SOCKET, CLAUDE_PORT, DESTINATION_BASE_PORT } from './chunk-
|
|
3
|
+
import { RELAY_PORT, GATEWAY_SOCKET, GATEWAY_PORT, CLAUDE_SOCKET, CLAUDE_PORT, DESTINATION_BASE_PORT } from './chunk-2I3LIRZP.js';
|
|
4
4
|
import { symlinkSync, unlinkSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-
|
|
3
|
+
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-D7ECMB7B.js';
|
|
4
4
|
import { startTimeOf } from './chunk-JBJTC3UU.js';
|
|
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-
|
|
6
|
-
import { RUNNER_DIR_MODE, repoCacheDir, imagesDir, attemptStamp, runnerDir, rootfsPathFor, RUNNER_FILE_MODE } from './chunk-
|
|
7
|
-
import { withGitConfig, tokenHeader, PROXY_WARNING_FLAG } from './chunk-
|
|
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-2BTFKNTR.js';
|
|
6
|
+
import { RUNNER_DIR_MODE, repoCacheDir, imagesDir, attemptStamp, runnerDir, rootfsPathFor, RUNNER_FILE_MODE } from './chunk-RHAGBUL5.js';
|
|
7
|
+
import { withGitConfig, tokenHeader, PROXY_WARNING_FLAG } from './chunk-2I3LIRZP.js';
|
|
8
8
|
import { RELAY_ID, RELAY_USER } from './chunk-JGD5TWQ2.js';
|
|
9
9
|
import { mkdirSync, rmSync, existsSync, mkdtempSync, cpSync, readFileSync, writeFileSync, readdirSync, lstatSync, readlinkSync } from 'fs';
|
|
10
10
|
import { tmpdir } from 'os';
|
|
@@ -184,6 +184,8 @@ function toolsDockerfile(parts) {
|
|
|
184
184
|
`RUN npm install --global --prefix /out/opt/outerlayer/claude @anthropic-ai/claude-code@${version}`,
|
|
185
185
|
"COPY dist /out/opt/outerlayer/cli/dist",
|
|
186
186
|
"COPY package.json /out/opt/outerlayer/cli/package.json",
|
|
187
|
+
// `outerlayer claude` installs the maintained skills from this pack into the build's home folder before the agent starts.
|
|
188
|
+
"COPY skill-pack /out/opt/outerlayer/cli/skill-pack",
|
|
187
189
|
"RUN mkdir -p /out/opt/outerlayer/bin /out/usr/local/bin /out/etc/claude-code /out/build \\",
|
|
188
190
|
" && cp /usr/local/bin/node /out/opt/outerlayer/bin/node \\",
|
|
189
191
|
` && printf '%s\\n' '#!/bin/sh' 'exec /opt/outerlayer/bin/node /opt/outerlayer/cli/dist/index.js "$@"' > /out/usr/local/bin/outerlayer \\`,
|
|
@@ -443,6 +445,7 @@ async function buildRepositoryImage(opts, ports) {
|
|
|
443
445
|
try {
|
|
444
446
|
cpSync(opts.cli.distDir, join(context, "dist"), { recursive: true });
|
|
445
447
|
cpSync(join(opts.cli.distDir, "..", "package.json"), join(context, "package.json"));
|
|
448
|
+
cpSync(join(opts.cli.distDir, "..", "skill-pack"), join(context, "skill-pack"), { recursive: true });
|
|
446
449
|
if (opts.guestHelper !== void 0) {
|
|
447
450
|
mkdirSync(join(context, "guest"));
|
|
448
451
|
cpSync(opts.guestHelper.path, join(context, "guest", "outerlayer-guest"));
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { MAINTAINED_SKILLS, loadMachineSkillFiles, resolvePackRoot, maintainedLineVersion } from './chunk-7OUOLGUV.js';
|
|
4
|
+
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
5
|
+
import { resolvePackageVersion } from './chunk-RA3O54FC.js';
|
|
6
|
+
import { randomBytes } from 'crypto';
|
|
7
|
+
import { existsSync, symlinkSync, realpathSync, lstatSync, readFileSync, mkdirSync, rmSync, renameSync, writeFileSync, cpSync } from 'fs';
|
|
8
|
+
import { join, resolve, dirname, relative } from 'path';
|
|
9
|
+
|
|
10
|
+
createRequire(import.meta.url);
|
|
11
|
+
var machineSkillsBase = (home) => join(home, ".agents", "skills");
|
|
12
|
+
var claudeSkillsBase = (home) => join(home, ".claude", "skills");
|
|
13
|
+
var errorMessage = (err) => err instanceof Error ? err.message : String(err);
|
|
14
|
+
var defaultLink = (target, path) => {
|
|
15
|
+
if (process.platform === "win32") symlinkSync(resolve(realpathSync(dirname(path)), target), path, "junction");
|
|
16
|
+
else symlinkSync(target, path, "dir");
|
|
17
|
+
};
|
|
18
|
+
function installedVersion(folder) {
|
|
19
|
+
try {
|
|
20
|
+
return maintainedLineVersion(readFileSync(join(folder, "SKILL.md"), "utf8"));
|
|
21
|
+
} catch {
|
|
22
|
+
return void 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function entryExists(path) {
|
|
26
|
+
try {
|
|
27
|
+
lstatSync(path);
|
|
28
|
+
return true;
|
|
29
|
+
} catch {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function folderExists(path) {
|
|
34
|
+
try {
|
|
35
|
+
return lstatSync(path).isDirectory();
|
|
36
|
+
} catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function tempName(base, label) {
|
|
41
|
+
return join(base, `.${label}-${process.pid}-${randomBytes(4).toString("hex")}`);
|
|
42
|
+
}
|
|
43
|
+
var REPLACE_ATTEMPTS = 3;
|
|
44
|
+
function replaceWith(final, build) {
|
|
45
|
+
const base = dirname(final);
|
|
46
|
+
mkdirSync(base, { recursive: true });
|
|
47
|
+
const temporary = tempName(base, "tmp");
|
|
48
|
+
try {
|
|
49
|
+
build(temporary);
|
|
50
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
51
|
+
try {
|
|
52
|
+
renameSync(temporary, final);
|
|
53
|
+
return;
|
|
54
|
+
} catch (err) {
|
|
55
|
+
if (attempt >= REPLACE_ATTEMPTS - 1) throw err;
|
|
56
|
+
const old = tempName(base, "old");
|
|
57
|
+
try {
|
|
58
|
+
renameSync(final, old);
|
|
59
|
+
rmSync(old, { recursive: true, force: true });
|
|
60
|
+
} catch {
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
} finally {
|
|
65
|
+
rmSync(temporary, { recursive: true, force: true });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function writeSkill(final, files) {
|
|
69
|
+
replaceWith(final, (temporary) => {
|
|
70
|
+
for (const file of files) {
|
|
71
|
+
const abs = join(temporary, file.path);
|
|
72
|
+
mkdirSync(dirname(abs), { recursive: true });
|
|
73
|
+
writeFileSync(abs, file.content);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function sameFolder(a, b) {
|
|
78
|
+
try {
|
|
79
|
+
return realpathSync(a) === realpathSync(b);
|
|
80
|
+
} catch {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function linksTo(entry, target) {
|
|
85
|
+
try {
|
|
86
|
+
return lstatSync(entry).isSymbolicLink() && sameFolder(entry, target);
|
|
87
|
+
} catch {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function reachFromClaude(home, name, version, link, mode) {
|
|
92
|
+
const claude = claudeSkillsBase(home);
|
|
93
|
+
const folder = join(machineSkillsBase(home), name);
|
|
94
|
+
if (sameFolder(claude, machineSkillsBase(home))) return;
|
|
95
|
+
const entry = join(claude, name);
|
|
96
|
+
if (mode === "refresh" && !entryExists(entry)) return;
|
|
97
|
+
if (linksTo(entry, folder)) return;
|
|
98
|
+
if (folderExists(entry) && installedVersion(entry) === version) return;
|
|
99
|
+
mkdirSync(claude, { recursive: true });
|
|
100
|
+
try {
|
|
101
|
+
const temporary = tempName(claude, "tmp");
|
|
102
|
+
try {
|
|
103
|
+
link(relative(realpathSync(claude), realpathSync(folder)), temporary);
|
|
104
|
+
rmSync(entry, { recursive: true, force: true });
|
|
105
|
+
renameSync(temporary, entry);
|
|
106
|
+
} finally {
|
|
107
|
+
rmSync(temporary, { recursive: true, force: true });
|
|
108
|
+
}
|
|
109
|
+
} catch {
|
|
110
|
+
replaceWith(entry, (temporary) => cpSync(folder, temporary, { recursive: true }));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function installMachineSkills(opts) {
|
|
114
|
+
const result = { written: [], failures: [] };
|
|
115
|
+
const version = opts.version ?? resolvePackageVersion();
|
|
116
|
+
const base = machineSkillsBase(opts.home);
|
|
117
|
+
const link = opts.link ?? defaultLink;
|
|
118
|
+
let files;
|
|
119
|
+
const filesOf = (name) => {
|
|
120
|
+
files ??= loadMachineSkillFiles(opts.packRoot ?? resolvePackRoot(), version);
|
|
121
|
+
return files.filter((file) => file.skill === name);
|
|
122
|
+
};
|
|
123
|
+
for (const name of MAINTAINED_SKILLS) {
|
|
124
|
+
const folder = join(base, name);
|
|
125
|
+
try {
|
|
126
|
+
if (opts.mode === "refresh" && !folderExists(folder)) continue;
|
|
127
|
+
if (installedVersion(folder) !== version) {
|
|
128
|
+
writeSkill(folder, filesOf(name));
|
|
129
|
+
result.written.push(name);
|
|
130
|
+
}
|
|
131
|
+
} catch (err) {
|
|
132
|
+
result.failures.push(`${folder}: ${errorMessage(err)}`);
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
try {
|
|
136
|
+
reachFromClaude(opts.home, name, version, link, opts.mode);
|
|
137
|
+
} catch (err) {
|
|
138
|
+
result.failures.push(`${join(claudeSkillsBase(opts.home), name)}: ${errorMessage(err)}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
function machineSkillsState(home, version = resolvePackageVersion()) {
|
|
144
|
+
return MAINTAINED_SKILLS.map((name) => {
|
|
145
|
+
const folder = join(machineSkillsBase(home), name);
|
|
146
|
+
if (!existsSync(join(folder, "SKILL.md"))) return { name, state: "missing" };
|
|
147
|
+
return { name, state: installedVersion(folder) === version ? "current" : "stale" };
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function staleClaudeSkills(home, version = resolvePackageVersion()) {
|
|
151
|
+
const claude = claudeSkillsBase(home);
|
|
152
|
+
if (sameFolder(claude, machineSkillsBase(home))) return [];
|
|
153
|
+
return MAINTAINED_SKILLS.filter((name) => {
|
|
154
|
+
const entry = join(claude, name);
|
|
155
|
+
if (!entryExists(entry)) return false;
|
|
156
|
+
if (linksTo(entry, join(machineSkillsBase(home), name))) return false;
|
|
157
|
+
return installedVersion(entry) !== version;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function setupMachineSkills(home = homeFromEnv()) {
|
|
161
|
+
try {
|
|
162
|
+
return installMachineSkills({ home, mode: "setup" });
|
|
163
|
+
} catch (err) {
|
|
164
|
+
return { written: [], failures: [errorMessage(err)] };
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function refreshMachineSkills(home = homeFromEnv()) {
|
|
168
|
+
try {
|
|
169
|
+
installMachineSkills({ home, mode: "refresh" });
|
|
170
|
+
} catch {
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function machineRefreshSkipped(commandNames, hidden, argv) {
|
|
174
|
+
const top = commandNames.at(-1);
|
|
175
|
+
if (top === "daemon" || top === "watch" || commandNames[0] === "daemon" || commandNames[0] === "watch") return true;
|
|
176
|
+
if (hidden) return true;
|
|
177
|
+
if (argv.includes("--log-failures")) return true;
|
|
178
|
+
return top === "sync" && argv.includes("--quiet");
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export { installMachineSkills, machineRefreshSkipped, machineSkillsState, refreshMachineSkills, setupMachineSkills, staleClaudeSkills };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE } from './chunk-
|
|
3
|
+
import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE } from './chunk-7OUOLGUV.js';
|
|
4
4
|
import { normalizePath, CONTEXT_PIN_FILENAME } from './chunk-RKOTJQVG.js';
|
|
5
5
|
import { existsSync, readdirSync, readFileSync, mkdirSync, writeFileSync, lstatSync, readlinkSync, symlinkSync, rmdirSync } from 'fs';
|
|
6
6
|
import { relative, sep, join } from 'path';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { checkStarterFiles, contextIsGoverned, checkBuildSkill } from './chunk-
|
|
4
|
-
import { resolveCredentials, getJson, WorkCommandError } from './chunk-
|
|
5
|
-
import { isLinkedRepository } from './chunk-
|
|
3
|
+
import { checkStarterFiles, contextIsGoverned, checkBuildSkill, checkMachineSkills, checkCommittedMaintainedSkills } from './chunk-P33PZIWS.js';
|
|
4
|
+
import { resolveCredentials, getJson, WorkCommandError } from './chunk-55GNQPO6.js';
|
|
5
|
+
import { isLinkedRepository } from './chunk-N4D5TMVU.js';
|
|
6
6
|
import { sanitizeTerminal } from './chunk-BUP5N3X6.js';
|
|
7
|
-
import { checkFormerSkillNames } from './chunk-
|
|
8
|
-
import { resolveGatewayCredentials, defaultFetch } from './chunk-
|
|
9
|
-
import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-
|
|
7
|
+
import { checkFormerSkillNames } from './chunk-MHX7YX7Y.js';
|
|
8
|
+
import { resolveGatewayCredentials, defaultFetch } from './chunk-BWH36FOC.js';
|
|
9
|
+
import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-DJHNEGNM.js';
|
|
10
10
|
import { readStatuslineState, STATE_FRESH_MS } from './chunk-I7RZHMXW.js';
|
|
11
11
|
import { hookCommandEscapesControlPlane, CONTROL_PLANE_DIR_VARIABLE } from './chunk-HCVLP7XA.js';
|
|
12
12
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
@@ -191,7 +191,7 @@ function runDoctor(env = {}) {
|
|
|
191
191
|
...checkInstalls(env),
|
|
192
192
|
...starter?.checks ?? [],
|
|
193
193
|
...laptop ? checkRenamedSkills(env.cwd) : [],
|
|
194
|
-
...checkBuildSkillState(env.cwd),
|
|
194
|
+
...checkBuildSkillState(env.cwd, home),
|
|
195
195
|
...starter !== void 0 && !starter.mcpOutdated ? checkMcpCommand(env.cwd, env.processEnv) : [],
|
|
196
196
|
...checkContextSource(env.cwd),
|
|
197
197
|
...checkGovernsList(env.cwd),
|
|
@@ -204,10 +204,10 @@ function checkRenamedSkills(cwd) {
|
|
|
204
204
|
if (dirs === void 0 || contextIsGoverned(dirs.gitCommonDir)) return [];
|
|
205
205
|
return checkFormerSkillNames(dirs.repoRoot);
|
|
206
206
|
}
|
|
207
|
-
function checkBuildSkillState(cwd) {
|
|
207
|
+
function checkBuildSkillState(cwd, home) {
|
|
208
208
|
const dirs = findGitDirs(cwd ?? process.cwd());
|
|
209
209
|
if (dirs === void 0 || contextIsGoverned(dirs.gitCommonDir)) return [];
|
|
210
|
-
return checkBuildSkill(dirs.repoRoot);
|
|
210
|
+
return [...checkBuildSkill(dirs.repoRoot), ...checkMachineSkills({ repoRoot: dirs.repoRoot, home }), ...checkCommittedMaintainedSkills(dirs.repoRoot)];
|
|
211
211
|
}
|
|
212
212
|
function checkInstalledCli(home, cwd) {
|
|
213
213
|
const name = "Installed CLI";
|
|
@@ -1174,7 +1174,7 @@ function doctorExitCode(checks) {
|
|
|
1174
1174
|
|
|
1175
1175
|
// src/doctor-report.ts
|
|
1176
1176
|
async function gatherDoctorChecks() {
|
|
1177
|
-
const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-
|
|
1177
|
+
const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-TWS5VZEN.js');
|
|
1178
1178
|
const configPath = defaultRunnerConfigPath();
|
|
1179
1179
|
const checks = runDoctor({ runnerHost: hasRunnerBlock(configPath) });
|
|
1180
1180
|
const credential = await credentialChecks();
|
|
@@ -1186,7 +1186,7 @@ async function gatherDoctorChecks() {
|
|
|
1186
1186
|
const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
|
|
1187
1187
|
checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
|
|
1188
1188
|
} else if (hasRunnerBlock(configPath)) {
|
|
1189
|
-
const { runnerHostChecks } = await import('./doctor-
|
|
1189
|
+
const { runnerHostChecks } = await import('./doctor-Y4NCNSJM.js');
|
|
1190
1190
|
const hooks = (() => {
|
|
1191
1191
|
try {
|
|
1192
1192
|
return loadRunnerConfig(configPath).hooks;
|
|
@@ -1220,8 +1220,8 @@ async function gatherDoctorChecks() {
|
|
|
1220
1220
|
const service = await (async () => {
|
|
1221
1221
|
const { existsSync: existsSync3 } = await import('fs');
|
|
1222
1222
|
if (process.platform !== "linux" || !existsSync3("/run/systemd/system")) return void 0;
|
|
1223
|
-
const { inspectService, realInspectProbes } = await import('./inspect-
|
|
1224
|
-
const { DEFAULT_UNIT_NAME } = await import('./install-
|
|
1223
|
+
const { inspectService, realInspectProbes } = await import('./inspect-IPFA7AAT.js');
|
|
1224
|
+
const { DEFAULT_UNIT_NAME } = await import('./install-6OIY3KHZ.js');
|
|
1225
1225
|
const { dirname: dirname2 } = await import('path');
|
|
1226
1226
|
return inspectService(DEFAULT_UNIT_NAME, dirname2(configPath), realInspectProbes());
|
|
1227
1227
|
})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { isVersion, compareVersions } from './chunk-TQMI335S.js';
|
|
4
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
4
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-RHAGBUL5.js';
|
|
5
5
|
import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
6
6
|
import { join } 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-RHAGBUL5.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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
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-7OUOLGUV.js';
|
|
4
4
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
5
5
|
import { emitTree, ALL_TARGET_IDS, classifyTree } from './chunk-RKOTJQVG.js';
|
|
6
6
|
import { readFileSync, existsSync, unlinkSync, rmdirSync, readdirSync } from 'fs';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { sanitizeTerminal } from './chunk-BUP5N3X6.js';
|
|
4
|
+
import { isAgentsMdLayout } from './chunk-LOKSLO25.js';
|
|
4
5
|
import { DEFAULT_DASHBOARD } from './chunk-6BLXUD56.js';
|
|
5
|
-
import { cliFetch, resolveGatewayCredentials } from './chunk-
|
|
6
|
+
import { cliFetch, resolveGatewayCredentials } from './chunk-BWH36FOC.js';
|
|
6
7
|
import { writeRepoConnection, findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
7
8
|
import { remoteLookupFailed } from './chunk-QE3UQAHK.js';
|
|
8
9
|
import { readCloudConfig } from './chunk-PJDQPF5N.js';
|
|
9
|
-
import { isAgentsMdLayout } from './chunk-JKNYTNYD.js';
|
|
10
10
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
11
11
|
import { execFileSync } from 'child_process';
|
|
12
12
|
import { createInterface } from 'readline/promises';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
|
|
4
|
-
import { autoConnect, detectActiveSession } from './chunk-
|
|
4
|
+
import { autoConnect, detectActiveSession } from './chunk-2F762IXY.js';
|
|
5
5
|
import { acquireSpoolLockAt } from './chunk-BUP5N3X6.js';
|
|
6
|
-
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-
|
|
6
|
+
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-BWH36FOC.js';
|
|
7
7
|
import { resolveRepoIdentity } from './chunk-QE3UQAHK.js';
|
|
8
8
|
import { C } from './chunk-ANPNT6PM.js';
|
|
9
9
|
import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { POLICY_CONTENT, VALIDATOR_FILES, VALIDATORS_DIR, POLICY_PATH } from './chunk-
|
|
3
|
+
import { POLICY_CONTENT, VALIDATOR_FILES, VALIDATORS_DIR, POLICY_PATH } from './chunk-XZ6Q6ZNR.js';
|
|
4
|
+
import { skillsBaseFor, isAgentsMdLayout } from './chunk-LOKSLO25.js';
|
|
4
5
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
6
|
+
import { machineSkillsState, staleClaudeSkills } from './chunk-IMOB4IOI.js';
|
|
7
|
+
import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, skillDir, namesCore, MACHINE_SKILL_PATH, AGENTS_SKILLS_BASE, MAINTAINED_SKILLS, isMaintainedCopy, loadTemplateFiles, rewriteSkillPaths, restoreSkillPaths, TEMPLATE_SKILLS } from './chunk-7OUOLGUV.js';
|
|
5
8
|
import { mcpTargetPath, INIT_STDIO_ENTRY, INIT_DOCS_ENTRY, DOCS_MCP_SERVER_NAME } from './chunk-KT4CN6OU.js';
|
|
6
|
-
import { skillsBaseFor, isAgentsMdLayout } from './chunk-JKNYTNYD.js';
|
|
7
|
-
import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, skillDir, namesCore, loadTemplateFiles, rewriteSkillPaths, restoreSkillPaths, TEMPLATE_SKILLS } from './chunk-HBISTTG3.js';
|
|
8
9
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
9
10
|
import { hasSymlinkComponent } from './chunk-VWFOKRYS.js';
|
|
10
11
|
import { cloneIsGoverned } from './chunk-YQR6E6OV.js';
|
|
@@ -190,6 +191,7 @@ function checkStarterFiles(cwd, opts = {}) {
|
|
|
190
191
|
return { checks: [{ name: NAME, status: "warn", detail: parts.join("; "), fix }], mcpOutdated };
|
|
191
192
|
}
|
|
192
193
|
var BUILD_PHASES = ["Intake", "Criteria", "Implement", "Review", "Pull request", "Evidence"];
|
|
194
|
+
var MACHINE_CORE = `${MACHINE_SKILL_PATH}/outerlayer-build/SKILL.md`;
|
|
193
195
|
var CHANGES_HEADING = "## Changes for this repository";
|
|
194
196
|
var NAME2 = "Build skill";
|
|
195
197
|
function changeHeadings(text) {
|
|
@@ -226,10 +228,13 @@ var read = (abs) => {
|
|
|
226
228
|
return void 0;
|
|
227
229
|
}
|
|
228
230
|
};
|
|
231
|
+
function buildsOf(repoRoot, folders) {
|
|
232
|
+
const source = `${folders[0]}/build/SKILL.md`;
|
|
233
|
+
return (existsSync(join(repoRoot, source)) ? [source] : folders.slice(1).map((f) => `${f}/build/SKILL.md`)).map((path) => ({ path, text: read(join(repoRoot, path)) })).filter((b) => b.text !== void 0);
|
|
234
|
+
}
|
|
229
235
|
function checkBuildSkill(repoRoot) {
|
|
230
236
|
const folders = [".outerlayer/skills", ...skillsFolders()];
|
|
231
|
-
const
|
|
232
|
-
const builds = (existsSync(join(repoRoot, source)) ? [source] : folders.slice(1).map((f) => `${f}/build/SKILL.md`)).map((path) => ({ path, text: read(join(repoRoot, path)) })).filter((b) => b.text !== void 0);
|
|
237
|
+
const builds = buildsOf(repoRoot, folders);
|
|
233
238
|
const checks = [];
|
|
234
239
|
const detached = builds.filter((b) => !namesCore(b.text));
|
|
235
240
|
if (detached.length > 0) {
|
|
@@ -255,7 +260,8 @@ ${shortBuild()}`
|
|
|
255
260
|
const agentsMd = isAgentsMdLayout(repoRoot);
|
|
256
261
|
const seen = /* @__PURE__ */ new Set();
|
|
257
262
|
const lacking = folders.filter((folder) => {
|
|
258
|
-
|
|
263
|
+
const text = read(join(repoRoot, folder, "build", "SKILL.md")) ?? "";
|
|
264
|
+
if (!namesCore(text) || text.includes(MACHINE_CORE) || existsSync(join(repoRoot, folder, "outerlayer-build", "SKILL.md"))) return false;
|
|
259
265
|
let key = folder;
|
|
260
266
|
try {
|
|
261
267
|
key = realpathSync(join(repoRoot, folder));
|
|
@@ -275,5 +281,47 @@ ${shortBuild()}`
|
|
|
275
281
|
}
|
|
276
282
|
return checks;
|
|
277
283
|
}
|
|
284
|
+
function committedMaintainedFolders(repoRoot) {
|
|
285
|
+
const found = [];
|
|
286
|
+
for (const base of [AGENTS_SKILLS_BASE, ".claude/skills"]) {
|
|
287
|
+
for (const name of MAINTAINED_SKILLS) {
|
|
288
|
+
const folder = skillDir(name, base);
|
|
289
|
+
if (!hasSymlinkComponent(repoRoot, folder) && isMaintainedCopy(repoRoot, name, base)) found.push(folder);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return found;
|
|
293
|
+
}
|
|
294
|
+
function checkCommittedMaintainedSkills(repoRoot) {
|
|
295
|
+
if (!isAgentsMdLayout(repoRoot)) return [];
|
|
296
|
+
const folders = committedMaintainedFolders(repoRoot);
|
|
297
|
+
if (folders.length === 0) return [];
|
|
298
|
+
return [
|
|
299
|
+
{
|
|
300
|
+
name: "Committed maintained skills",
|
|
301
|
+
status: "warn",
|
|
302
|
+
detail: `${folders.join(", ")} ${folders.length === 1 ? "is a maintained skill" : "are maintained skills"} that every machine keeps in ${MACHINE_SKILL_PATH}/ now`,
|
|
303
|
+
fix: `Run \`${cliInvocation()} init --update\` to remove ${folders.length === 1 ? "it" : "them"}, then commit. Before you commit, every machine and runner host must run this CLI version or later, and each machine a person works on must run \`${cliInvocation()} init --local\`.`
|
|
304
|
+
}
|
|
305
|
+
];
|
|
306
|
+
}
|
|
307
|
+
function checkMachineSkills(opts) {
|
|
308
|
+
const build = buildsOf(opts.repoRoot, [".outerlayer/skills", ...skillsFolders()]).find((b) => b.text.includes(MACHINE_CORE));
|
|
309
|
+
if (build === void 0) return [];
|
|
310
|
+
const problems = machineSkillsState(opts.home, opts.version).filter((s) => s.state !== "current");
|
|
311
|
+
const claudeStale = staleClaudeSkills(opts.home, opts.version);
|
|
312
|
+
if (problems.length === 0 && claudeStale.length === 0) return [];
|
|
313
|
+
const parts = [
|
|
314
|
+
...problems.map((s) => `${MACHINE_SKILL_PATH}/${s.name} ${s.state === "missing" ? "is missing" : "is from another CLI version"}`),
|
|
315
|
+
...claudeStale.map((name) => `~/.claude/skills/${name} is not this CLI version's copy`)
|
|
316
|
+
];
|
|
317
|
+
return [
|
|
318
|
+
{
|
|
319
|
+
name: "Maintained skills on this machine",
|
|
320
|
+
status: "warn",
|
|
321
|
+
detail: `${build.path} reads ${MACHINE_CORE}, but ${parts.join(", ")}`,
|
|
322
|
+
fix: `Run \`${cliInvocation()} init --local\` on this machine. If it reports a failed write, fix the permissions on the folder it names first.`
|
|
323
|
+
}
|
|
324
|
+
];
|
|
325
|
+
}
|
|
278
326
|
|
|
279
|
-
export { canonical, checkBuildSkill, checkStarterFiles, contentHash, contextIsGoverned, inspectStarterFiles, readShippedManifest, skillsFolders };
|
|
327
|
+
export { canonical, checkBuildSkill, checkCommittedMaintainedSkills, checkMachineSkills, checkStarterFiles, committedMaintainedFolders, contentHash, contextIsGoverned, inspectStarterFiles, readShippedManifest, skillsFolders };
|
|
@@ -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-MATUHHN4.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';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { launcherPath, writeLauncher, LauncherWriteError, pathNotes } from './chunk-
|
|
4
|
-
import { currentVersion, currentLink, isInLayout, packageRootIn, versionDir, switchCurrent, execStartLine } from './chunk-
|
|
3
|
+
import { launcherPath, writeLauncher, LauncherWriteError, pathNotes } from './chunk-QHH4OSD4.js';
|
|
4
|
+
import { currentVersion, currentLink, isInLayout, packageRootIn, versionDir, switchCurrent, execStartLine } from './chunk-MATUHHN4.js';
|
|
5
5
|
import { compareVersions } from './chunk-TQMI335S.js';
|
|
6
|
-
import { RUNNER_DIR_MODE } from './chunk-
|
|
6
|
+
import { RUNNER_DIR_MODE } from './chunk-RHAGBUL5.js';
|
|
7
7
|
import { realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync } from 'fs';
|
|
8
8
|
import { dirname, sep, join } from 'path';
|
|
9
9
|
|