@outerlayer/cli 0.36.0-next.20261101174803 → 0.36.0-next.20261102135508
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-Q3HDN23U.js +39 -0
- package/dist/agent-subcommand-Z6SOLWZW.js +25 -0
- package/dist/bridge-4KPODDN7.js +15 -0
- package/dist/build-KYXFZQ33.js +23 -0
- package/dist/build-disk-W6AL5WHI.js +20 -0
- package/dist/build-info.json +1 -1
- package/dist/builder-IMNOEYV7.js +19 -0
- package/dist/caller-NLRE272L.js +22 -0
- package/dist/{check-K4RVAP4L.js → check-WWX32IGY.js} +78 -74
- package/dist/{chunk-MKSZHT6S.js → chunk-2YC3TXWX.js} +1 -1
- package/dist/{chunk-QIOTIQWD.js → chunk-3UFX6KH2.js} +12 -11
- package/dist/{chunk-F2LPX2HS.js → chunk-3YEPLVNW.js} +8 -8
- package/dist/chunk-4DLJ343I.js +38 -0
- package/dist/{chunk-5WYT3PPE.js → chunk-4OD45RBP.js} +4 -1
- package/dist/{chunk-H7SKHAUE.js → chunk-4XXBV37R.js} +6 -6
- package/dist/{chunk-XNBUZGRO.js → chunk-6B3V6EGQ.js} +11 -9
- package/dist/{chunk-O36YAH2G.js → chunk-6HDXRDC5.js} +4 -4
- package/dist/chunk-6JLYU322.js +68 -0
- package/dist/{chunk-5GHJFETA.js → chunk-6KH3NMIT.js} +3010 -1196
- package/dist/{chunk-SPXVFFQV.js → chunk-AQE6E54X.js} +10 -9
- package/dist/{chunk-LGV5N5DG.js → chunk-ATKCHMFD.js} +1 -1
- package/dist/{chunk-7J7HRYZ3.js → chunk-B2P72DAE.js} +1 -1
- package/dist/{chunk-LEHBDEUG.js → chunk-B36NSEUM.js} +4 -5
- package/dist/{chunk-B62TYDP2.js → chunk-B5SWBFVE.js} +5 -4
- package/dist/chunk-BSPJI5T7.js +28 -0
- package/dist/{chunk-VJYSPH2J.js → chunk-BUYXEU7J.js} +26 -21
- package/dist/{chunk-CIUD3436.js → chunk-BZSJ77MO.js} +1 -1
- package/dist/{chunk-OEBFKPHK.js → chunk-CDG475ZP.js} +11 -11
- package/dist/{chunk-AGKQEOFS.js → chunk-CSBW4LGL.js} +54 -31
- package/dist/{chunk-D2OTBS47.js → chunk-CSVJGW3I.js} +2 -2
- package/dist/{chunk-GANAOCHR.js → chunk-CXJC3JLN.js} +25 -374
- package/dist/{chunk-WAZJPDR2.js → chunk-D4VGJQY7.js} +1 -1
- package/dist/{chunk-BRUDBWLO.js → chunk-D5I5SSPU.js} +7 -7
- package/dist/{chunk-KFUDKFEH.js → chunk-D6EXW4EB.js} +45 -19
- package/dist/{chunk-AF6DQJ5W.js → chunk-DG3M5DZU.js} +1 -1
- package/dist/{chunk-WT7J2627.js → chunk-DTCTXDJP.js} +1 -1
- package/dist/chunk-DTQPDMHG.js +654 -0
- package/dist/{chunk-EZRAR5YG.js → chunk-E3TP4QTM.js} +1 -1
- package/dist/{chunk-NFZJ5XHP.js → chunk-ENBOAE2W.js} +33 -32
- package/dist/{chunk-R3252UTU.js → chunk-ENMX3VQ7.js} +7 -7
- package/dist/{chunk-AH6634HC.js → chunk-FOSYM7TQ.js} +1 -2
- package/dist/{chunk-HL7UNTXO.js → chunk-FRMAQ3C4.js} +17 -10
- package/dist/{chunk-HAWPG7QW.js → chunk-FTP7SE6Y.js} +3 -3
- package/dist/{chunk-IP7BIBXJ.js → chunk-FWSVWPMS.js} +16 -7
- package/dist/{chunk-GLUQVET2.js → chunk-GFZ7PELR.js} +6 -6
- package/dist/{chunk-UZGQT6OF.js → chunk-H2NJG3TE.js} +6 -3
- package/dist/{chunk-46OBCATR.js → chunk-HRHWA6TZ.js} +1 -1
- package/dist/chunk-HTRDL42C.js +45 -0
- package/dist/{chunk-YBAVN6WS.js → chunk-I4DM7SNX.js} +7 -7
- package/dist/{chunk-24FEVLX7.js → chunk-I6U6QPN6.js} +1311 -73
- package/dist/{chunk-4DJZSNVT.js → chunk-IKFAJTLZ.js} +1 -1
- package/dist/{chunk-55PYF6S2.js → chunk-J2OMKFYB.js} +3 -3
- package/dist/{chunk-7Y5VW4JG.js → chunk-K2G3VB7W.js} +1 -1
- package/dist/chunk-K7N6LAPC.js +78 -0
- package/dist/{chunk-ULBVE7MP.js → chunk-KRCU66AM.js} +9 -9
- package/dist/{chunk-JU3VU42K.js → chunk-LHHDX7FB.js} +5 -5
- package/dist/{chunk-FUJUFLDC.js → chunk-LO4CK734.js} +8 -14
- package/dist/chunk-LSLK4RS4.js +82 -0
- package/dist/{chunk-ABAVN4RT.js → chunk-LSZUTI6O.js} +29 -26
- package/dist/chunk-MVPOYQQY.js +136 -0
- package/dist/{chunk-YQHEJ5SV.js → chunk-NXQK2I3G.js} +3 -3
- package/dist/{chunk-DJMR4YPG.js → chunk-O3MJAHLI.js} +82 -96
- package/dist/{chunk-B7PYT2BY.js → chunk-PBGNX3PS.js} +6 -3
- package/dist/{chunk-CJJDJ7AT.js → chunk-PIZA7OG2.js} +5 -3
- package/dist/{chunk-RIHB3HA2.js → chunk-PMA67TIN.js} +3 -3
- package/dist/{chunk-DJDTL6AY.js → chunk-QKOJ22OV.js} +148 -293
- package/dist/{chunk-RDWKRG4K.js → chunk-RF4JHGGB.js} +7 -7
- package/dist/{chunk-MOOZJRKM.js → chunk-SJJXDU2J.js} +27 -30
- package/dist/chunk-T5QBWM6M.js +113 -0
- package/dist/{chunk-W7I65BKE.js → chunk-TJIFYV2Z.js} +12 -12
- package/dist/{chunk-EBOQU6QC.js → chunk-TKY3SDXH.js} +6 -6
- package/dist/{chunk-ALEUIS35.js → chunk-ULBYRPAP.js} +1 -1
- package/dist/{chunk-ZP7F3OHV.js → chunk-URHS76GV.js} +48 -38
- package/dist/{chunk-X2XTCGUS.js → chunk-VAYVTUU4.js} +11 -12
- package/dist/{chunk-TSYHUUAT.js → chunk-VUH7KKVD.js} +3 -3
- package/dist/{chunk-RIIPBJK6.js → chunk-WACPWYMH.js} +4 -4
- package/dist/{chunk-AAGU5FJF.js → chunk-WGC7UFRM.js} +1 -1
- package/dist/{chunk-2SRQSGPR.js → chunk-WVAXJOWG.js} +30 -24
- package/dist/{chunk-KLXECBIE.js → chunk-XEWG4AB2.js} +151 -108
- package/dist/{chunk-KDK6AF7B.js → chunk-XIDDJSQU.js} +7 -6
- package/dist/{chunk-MXIFRYLA.js → chunk-Y4E7IS7H.js} +2 -2
- package/dist/{chunk-DHFNBNC3.js → chunk-YJQ7YA7J.js} +5 -5
- package/dist/{chunk-6A2GEFN3.js → chunk-YMVRCSKD.js} +4 -4
- package/dist/{chunk-JW5BENE6.js → chunk-YYQ5NOT5.js} +3 -3
- package/dist/chunk-ZHQC43NH.js +130 -0
- package/dist/{chunk-KB5B6ZT5.js → chunk-ZSRMJOAK.js} +20 -20
- package/dist/{claude-launcher-L77BKZOC.js → claude-launcher-LGKJZH33.js} +99 -120
- package/dist/{cli-QQY5UECM.js → cli-Q5L64EEG.js} +327 -298
- package/dist/{cli-update-notice-T3CXRWNB.js → cli-update-notice-AWYJ4A7R.js} +2 -2
- package/dist/{command-QLHQZ32L.js → command-CGEFJZNC.js} +65 -64
- package/dist/{config-5GY7FL35.js → config-T22KVOOT.js} +14 -10
- package/dist/connect-cmd-RUBP466E.js +28 -0
- package/dist/{container-start-OCJODSMB.js → container-start-JRF3SBUA.js} +65 -62
- package/dist/{context-cleanup-A7KBEBIO.js → context-cleanup-3K2AOECJ.js} +6 -2
- package/dist/{context-show-cmd-MZ74ZIVO.js → context-show-cmd-4UXO5WQJ.js} +18 -16
- package/dist/{control-plane-launch-3TZFOSCX.js → control-plane-launch-AAH4YH56.js} +31 -27
- package/dist/{demo-record-cmd-Y57UWBCX.js → demo-record-cmd-2OKCGST7.js} +10 -5
- package/dist/{demo-voice-cmd-4INIOVTC.js → demo-voice-cmd-GEPX7GIG.js} +27 -27
- package/dist/{dist-6KGTCWKR.js → dist-VVZIGSAF.js} +1 -1
- package/dist/docker-5VWK335X.js +19 -0
- package/dist/{doctor-DB2AJUAO.js → doctor-EQM3JRZI.js} +81 -76
- package/dist/emit-artifact-cmd-TA3MPHLU.js +43 -0
- package/dist/{emit-cmd-IOWTTZSA.js → emit-cmd-RO4L4PFZ.js} +9 -8
- package/dist/emit-criteria-cmd-NMTUV2KM.js +34 -0
- package/dist/emit-demo-cmd-Y2Y6LEL7.js +46 -0
- package/dist/{emit-finding-cmd-KQIGM5IF.js → emit-finding-cmd-VECM64UR.js} +20 -19
- package/dist/{emit-result-cmd-6Q7OU2NY.js → emit-result-cmd-2ERWFDUN.js} +25 -24
- package/dist/{emit-step-cmd-GZU5O2FR.js → emit-step-cmd-V2ET66N4.js} +20 -19
- package/dist/exec-client-54XKNPTI.js +16 -0
- package/dist/find-unit-CNAPU7XQ.js +23 -0
- package/dist/{findings-cmd-T7PQAVJG.js → findings-cmd-QJPPF6BY.js} +20 -19
- package/dist/{fleet-readiness-PTMOEX6L.js → fleet-readiness-DKAPHAZN.js} +16 -15
- package/dist/governing-source-7PZ6DAJU.js +40 -0
- package/dist/guest-init-5QZRGP62.js +18 -0
- package/dist/{hook-fast-RW7RU3O6.js → hook-fast-VXROB4KF.js} +7 -5
- package/dist/hook-install-GDNRMML4.js +14 -0
- package/dist/{hook-wrap-fast-545QJSBJ.js → hook-wrap-fast-LWWKKPGK.js} +4 -2
- package/dist/host-checks-WAPO5X7X.js +78 -0
- package/dist/host-key-HLLV37NV.js +16 -0
- package/dist/image-tag-PBWQBATH.js +17 -0
- package/dist/index.js +8 -9
- package/dist/init-EK3PUU6W.js +78 -0
- package/dist/{init-HUQLVUPO.js → init-Y2URPVVY.js} +62 -59
- package/dist/{init-cmd-6NQGBVAJ.js → init-cmd-XNANUDIW.js} +38 -33
- package/dist/{init-update-MA6QKX46.js → init-update-EFCTKF6D.js} +55 -46
- package/dist/install-cmd-RHFUZFV4.js +19 -0
- package/dist/layout-7XMC7S6K.js +13 -0
- package/dist/{logs-FEITSC2V.js → logs-E7MGQINH.js} +10 -3
- package/dist/loop-L6TX6OR4.js +89 -0
- package/dist/machine-VJKAY2GX.js +78 -0
- package/dist/{machine-skills-237PQFRC.js → machine-skills-HR4RNRNR.js} +5 -4
- package/dist/{mcp-install-cmd-23ZY4IBK.js → mcp-install-cmd-SMPLT43Q.js} +7 -1
- package/dist/{mcp-serve-cmd-ZINYSLY6.js → mcp-serve-cmd-XXERT673.js} +11 -7
- package/dist/{paths-XEYE7OZ2.js → paths-F2ZR2EKC.js} +10 -3
- package/dist/pending-VOFQRXP4.js +16 -0
- package/dist/pidfile-7M7O2M7T.js +17 -0
- package/dist/record-YCJ6DZOY.js +16 -0
- package/dist/{relay-IEYNSKAZ.js → relay-I2T43PPB.js} +8 -1
- package/dist/relay-protocol-GI2GC2AM.js +13 -0
- package/dist/runner-env-YW55JVU7.js +23 -0
- package/dist/runner-identity-Y5ZFCC7V.js +19 -0
- package/dist/{runner-key-CFZ47PR3.js → runner-key-R47C6374.js} +54 -54
- package/dist/session-sender-UPACLRGG.js +43 -0
- package/dist/{shell-function-NRD4KVUK.js → shell-function-GYD2ZQQG.js} +2 -1
- package/dist/{spec-cmd-CNASSB6L.js → spec-cmd-7QRE2SZK.js} +21 -20
- package/dist/{starter-pack-CCVIEY72.js → starter-pack-IMKIUA56.js} +7 -6
- package/dist/state-VAHBIMS5.js +16 -0
- package/dist/{status-VNHIHQ57.js → status-BQEYEG2V.js} +54 -54
- package/dist/{statusline-fast-E7RWVREA.js → statusline-fast-NUVHCNRX.js} +4 -2
- package/dist/{sync-cmd-5JLJBODH.js → sync-cmd-NBLYEPQG.js} +25 -24
- package/dist/update-steps-VGKNGWTZ.js +79 -0
- package/dist/{watch-AEWWTUEK.js → watch-IHV4V3HZ.js} +25 -24
- package/dist/{work-claim-cmd-GUYOJYH7.js → work-claim-cmd-WGTSU5IT.js} +24 -24
- package/dist/{work-cmd-YRPYMGII.js → work-cmd-HKOJU5FJ.js} +18 -17
- package/dist/{work-comment-cmd-U5Z6FKEU.js → work-comment-cmd-H3JCWQ2J.js} +21 -20
- package/dist/{work-demo-cmd-OLCWTVWM.js → work-demo-cmd-J4AZAIVP.js} +18 -17
- package/dist/{work-launch-TTGSHLY4.js → work-launch-LWDQXLGI.js} +1 -1
- package/dist/{work-logs-cmd-2OA7ENDU.js → work-logs-cmd-UOO4JVLG.js} +18 -17
- package/dist/{work-open-pr-cmd-6GUCDYVM.js → work-open-pr-cmd-QFRDDBAM.js} +20 -19
- package/dist/{work-pr-cmd-KK3VQUQI.js → work-pr-cmd-3Q2D5RQT.js} +19 -18
- package/dist/{work-proofs-cmd-BUOS5OJC.js → work-proofs-cmd-7Y3HGT7C.js} +21 -20
- package/dist/{work-proofs-record-6WLMOK53.js → work-proofs-record-QPUM6DY4.js} +31 -31
- package/dist/{work-stop-cmd-VZJX5X4L.js → work-stop-cmd-SD2ZRMSY.js} +18 -17
- 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-KYDEBGJG.js +0 -402
- 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/emit-artifact-cmd-H27MFSKH.js +0 -42
- package/dist/emit-criteria-cmd-IOUVMB2Q.js +0 -33
- package/dist/emit-demo-cmd-WJSS7KU2.js +0 -46
- package/dist/exec-client-FGGPQSYQ.js +0 -9
- package/dist/find-unit-PRZIFBIK.js +0 -19
- package/dist/governing-source-CND5ZZC3.js +0 -39
- 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/image-tag-WBD57QBN.js +0 -10
- package/dist/init-ILTX4V56.js +0 -78
- package/dist/install-cmd-JKPXIOEY.js +0 -12
- package/dist/layout-2ZMCT2D3.js +0 -11
- 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/relay-protocol-5LSWUJCW.js +0 -6
- package/dist/runner-env-W2UMHY7P.js +0 -19
- package/dist/runner-identity-IIY5UJL3.js +0 -14
- package/dist/session-sender-NO4F2IQ5.js +0 -42
- package/dist/settings-XB2HYBKO.js +0 -7
- 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
|
@@ -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-6B3V6EGQ.js';
|
|
5
5
|
import { VoiceDownloadError, downloadPinned, sha256OfFile } from './chunk-2PGI6RDE.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { detectActiveSession } from './chunk-FWSVWPMS.js';
|
|
7
|
+
import { autoConnect } from './chunk-VUH7KKVD.js';
|
|
8
|
+
import { resolveRepoIdentity } from './chunk-6KH3NMIT.js';
|
|
9
9
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
10
|
-
import { defaultFetch, resolveGatewayCredentials } from './chunk-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
10
|
+
import { defaultFetch, resolveGatewayCredentials } from './chunk-NXQK2I3G.js';
|
|
11
|
+
import { launchedItemForSession } from './chunk-4OD45RBP.js';
|
|
12
|
+
import { VOICE_PACK_FILES, VOICE_PACK_VERSION } from './chunk-DTQPDMHG.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-D6EXW4EB.js';
|
|
5
|
+
import { resolveGatewayCredentials, defaultFetch } from './chunk-NXQK2I3G.js';
|
|
6
|
+
import { versionAtLeast } from './chunk-BSPJI5T7.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-LSZUTI6O.js';
|
|
11
9
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
12
|
-
import { hasSymlinkComponent } from './chunk-
|
|
13
|
-
import { emitTree,
|
|
10
|
+
import { hasSymlinkComponent } from './chunk-PBGNX3PS.js';
|
|
11
|
+
import { skillDir, emitTree, targetIds, classifyTree, emitBuilders, AGENTS_SKILLS_BASE, defaultAgents, namesCore, MACHINE_SKILL_PATH, skillBases, isMaintainedCopy, contextAgents, loadTemplateFiles, splitRawFile } from './chunk-I6U6QPN6.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",
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { LEGACY_AGENT } from './chunk-LSLK4RS4.js';
|
|
4
|
+
|
|
5
|
+
createRequire(import.meta.url);
|
|
6
|
+
|
|
7
|
+
// ../agents/src/claude-code/hooks.ts
|
|
8
|
+
var REGISTERED = [
|
|
9
|
+
["SessionStart", "session-start"],
|
|
10
|
+
["SessionEnd", "session-ended"],
|
|
11
|
+
["Stop", "turn-ended"],
|
|
12
|
+
["PostToolUse", "tool-used"]
|
|
13
|
+
];
|
|
14
|
+
var KIND_BY_NAME = new Map(REGISTERED);
|
|
15
|
+
var TOOL_KINDS = {
|
|
16
|
+
Bash: "shell",
|
|
17
|
+
Read: "read",
|
|
18
|
+
Edit: "edit",
|
|
19
|
+
MultiEdit: "edit",
|
|
20
|
+
Write: "edit",
|
|
21
|
+
NotebookEdit: "edit",
|
|
22
|
+
Grep: "search",
|
|
23
|
+
Glob: "search",
|
|
24
|
+
Agent: "spawn",
|
|
25
|
+
Task: "spawn"
|
|
26
|
+
};
|
|
27
|
+
function toolKind(name) {
|
|
28
|
+
if (name === void 0) return void 0;
|
|
29
|
+
if (name.startsWith("mcp__")) return "mcp";
|
|
30
|
+
return TOOL_KINDS[name] ?? "other";
|
|
31
|
+
}
|
|
32
|
+
function parsePayload(stdin) {
|
|
33
|
+
try {
|
|
34
|
+
const parsed = stdin === "" ? {} : JSON.parse(stdin);
|
|
35
|
+
return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) ? parsed : {};
|
|
36
|
+
} catch {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
var text = (value) => typeof value === "string" ? value : void 0;
|
|
41
|
+
function decode(name, stdin) {
|
|
42
|
+
const payload = parsePayload(stdin);
|
|
43
|
+
const nativeName = String(name ?? payload.hook_event_name ?? "unknown");
|
|
44
|
+
const kind = KIND_BY_NAME.get(nativeName);
|
|
45
|
+
const sessionId = text(payload.session_id);
|
|
46
|
+
const cwd = text(payload.cwd);
|
|
47
|
+
const transcript = text(payload.transcript_path);
|
|
48
|
+
const toolName = text(payload.tool_name);
|
|
49
|
+
const toolUseId = text(payload.tool_use_id);
|
|
50
|
+
const tool = toolKind(toolName);
|
|
51
|
+
return {
|
|
52
|
+
nativeName,
|
|
53
|
+
...kind === void 0 ? {} : { kind },
|
|
54
|
+
...kind !== void 0 && sessionId !== void 0 && cwd !== void 0 && transcript !== void 0 ? {
|
|
55
|
+
event: {
|
|
56
|
+
kind,
|
|
57
|
+
sessionId,
|
|
58
|
+
cwd,
|
|
59
|
+
session: { agent: "claude-code", id: sessionId, locator: { kind: "file", path: transcript } },
|
|
60
|
+
...kind === "tool-used" && tool !== void 0 ? { tool } : {}
|
|
61
|
+
}
|
|
62
|
+
} : {},
|
|
63
|
+
spool: {
|
|
64
|
+
sessionId: payload.session_id ?? null,
|
|
65
|
+
transcriptPath: payload.transcript_path ?? null,
|
|
66
|
+
cwd: payload.cwd ?? null,
|
|
67
|
+
payloadEvent: payload.hook_event_name ?? null
|
|
68
|
+
},
|
|
69
|
+
// A tool call a subagent makes carries the subagent's id.
|
|
70
|
+
fromSubagent: payload.agent_id !== void 0,
|
|
71
|
+
...toolName === void 0 && toolUseId === void 0 ? {} : { tool: { ...toolUseId === void 0 ? {} : { useId: toolUseId }, ...toolName === void 0 ? {} : { name: toolName } } }
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function reply(value) {
|
|
75
|
+
switch (value.kind) {
|
|
76
|
+
case "session-start":
|
|
77
|
+
return JSON.stringify({
|
|
78
|
+
...value.notice === void 0 ? {} : { systemMessage: value.notice },
|
|
79
|
+
hookSpecificOutput: { hookEventName: "SessionStart", additionalContext: value.context }
|
|
80
|
+
});
|
|
81
|
+
case "tool-used":
|
|
82
|
+
return JSON.stringify({ hookSpecificOutput: { hookEventName: "PostToolUse", additionalContext: value.context } });
|
|
83
|
+
case "turn-ended":
|
|
84
|
+
return JSON.stringify({ decision: "block", reason: value.continueWith });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function statusLine(stdin) {
|
|
88
|
+
const payload = parsePayload(stdin);
|
|
89
|
+
const cost = payload.cost?.total_cost_usd;
|
|
90
|
+
const sessionId = text(payload.session_id);
|
|
91
|
+
return {
|
|
92
|
+
...sessionId === void 0 ? {} : { sessionId },
|
|
93
|
+
...typeof cost === "number" ? { costUsd: cost } : {}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
var CLAUDE_CODE_HOOKS = {
|
|
97
|
+
events: REGISTERED.map(([name]) => name),
|
|
98
|
+
decode,
|
|
99
|
+
reply,
|
|
100
|
+
statusLine
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// ../agents/src/native/hook-codecs.ts
|
|
104
|
+
var HOOK_CODECS = {
|
|
105
|
+
"claude-code": CLAUDE_CODE_HOOKS
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// ../agents/src/lifecycle.ts
|
|
109
|
+
function hookCodec(agentId) {
|
|
110
|
+
return HOOK_CODECS[agentId ?? LEGACY_AGENT];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { CLAUDE_CODE_HOOKS, hookCodec };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { toolsDockerfile } from './chunk-
|
|
4
|
-
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-
|
|
3
|
+
import { toolsDockerfile } from './chunk-ZSRMJOAK.js';
|
|
4
|
+
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-D4VGJQY7.js';
|
|
5
5
|
import { startTimeOf } from './chunk-JBJTC3UU.js';
|
|
6
|
-
import { runnerLabelValue } from './chunk-
|
|
7
|
-
import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { runnerLabelValue } from './chunk-CDG475ZP.js';
|
|
7
|
+
import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-BZSJ77MO.js';
|
|
8
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, orgStore, rootfsPathFor } from './chunk-DTCTXDJP.js';
|
|
9
|
+
import { withGitConfig, tokenHeader } from './chunk-CXJC3JLN.js';
|
|
10
|
+
import { UNIVERSAL_IMAGE_DIGEST, UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_SOURCE, buildAgentPin, NODE_IMAGE, UNIVERSAL_IMAGE, MEDIA_PINS, TINI_VERSION, GH_VERSION } from './chunk-DTQPDMHG.js';
|
|
11
11
|
import { mkdirSync, rmSync, writeFileSync, existsSync, mkdtempSync, cpSync, readFileSync, readdirSync, lstatSync, readlinkSync } from 'fs';
|
|
12
12
|
import { tmpdir } from 'os';
|
|
13
13
|
import { dirname, join } from 'path';
|
|
@@ -308,7 +308,7 @@ async function prepareImageBuild(opts) {
|
|
|
308
308
|
throw new Error(`${opts.cli.distDir} holds no index.js: the tools layer copies the built CLI, so run this from a build (yarn workspace @outerlayer/cli build)`);
|
|
309
309
|
}
|
|
310
310
|
const now = opts.now ?? (() => /* @__PURE__ */ new Date());
|
|
311
|
-
const
|
|
311
|
+
const agentVersion = opts.claudeCodeVersion ?? buildAgentPin();
|
|
312
312
|
const nodeImage = opts.nodeImage ?? NODE_IMAGE;
|
|
313
313
|
const organizationId = opts.organizationId;
|
|
314
314
|
const cacheDir = repoCacheDir(opts.configPath, owner, name, organizationId);
|
|
@@ -354,7 +354,7 @@ async function prepareImageBuild(opts) {
|
|
|
354
354
|
releaseShared = () => releasePidFile(sharedLock, self);
|
|
355
355
|
}
|
|
356
356
|
const rKey = recipeKey(checkout.dir, location, UNIVERSAL_IMAGE);
|
|
357
|
-
const tKey = toolsKey({ buildId: opts.cli.buildId, claudeCodeVersion, nodeImage, ghVersion: GH_VERSION, tiniVersion: TINI_VERSION, guestHelperSha256: opts.guestHelper?.sha256, mediaPins: MEDIA_PINS });
|
|
357
|
+
const tKey = toolsKey({ buildId: opts.cli.buildId, claudeCodeVersion: agentVersion, nodeImage, ghVersion: GH_VERSION, tiniVersion: TINI_VERSION, guestHelperSha256: opts.guestHelper?.sha256, mediaPins: MEDIA_PINS });
|
|
358
358
|
const recordDir = join(records, `${rKey.slice(0, KEY_PREFIX)}-${tKey.slice(0, KEY_PREFIX)}`);
|
|
359
359
|
return {
|
|
360
360
|
repository,
|
|
@@ -369,7 +369,7 @@ async function prepareImageBuild(opts) {
|
|
|
369
369
|
recipe,
|
|
370
370
|
recipeKey: rKey,
|
|
371
371
|
toolsKey: tKey,
|
|
372
|
-
|
|
372
|
+
agentVersion,
|
|
373
373
|
nodeImage,
|
|
374
374
|
logPath,
|
|
375
375
|
release
|
|
@@ -384,7 +384,7 @@ async function buildRepositoryImage(opts, ports) {
|
|
|
384
384
|
const now = opts.now ?? (() => /* @__PURE__ */ new Date());
|
|
385
385
|
const scratchRoot = opts.tmpDir ?? tmpdir();
|
|
386
386
|
const prepared = await prepareImageBuild(opts);
|
|
387
|
-
const { repository, repoRecords, imageRepository, tagName, checkout, location, recipe, recipeKey: rKey, toolsKey: tKey,
|
|
387
|
+
const { repository, repoRecords, imageRepository, tagName, checkout, location, recipe, recipeKey: rKey, toolsKey: tKey, agentVersion, nodeImage, recordDir, logPath } = prepared;
|
|
388
388
|
const universal = location.kind === "default";
|
|
389
389
|
const runnerLabel = runnerLabelValue(opts.configPath);
|
|
390
390
|
const buildTag = `${TAG_HOST}/build/${tagName}:${rKey.slice(0, KEY_PREFIX)}-${tKey.slice(0, KEY_PREFIX)}`;
|
|
@@ -459,7 +459,7 @@ async function buildRepositoryImage(opts, ports) {
|
|
|
459
459
|
const dockerfile = toolsDockerfile({
|
|
460
460
|
recipeImage: universal ? UNIVERSAL_IMAGE : recipeTag,
|
|
461
461
|
nodeImage,
|
|
462
|
-
claudeCodeVersion,
|
|
462
|
+
claudeCodeVersion: agentVersion,
|
|
463
463
|
buildId: opts.cli.buildId,
|
|
464
464
|
guestHelper: opts.guestHelper !== void 0
|
|
465
465
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { launchRefusalForSession } from './chunk-
|
|
4
|
-
import { detectActiveSession, transcriptPathForSession } from './chunk-
|
|
5
|
-
import { autoConnect } from './chunk-
|
|
3
|
+
import { launchRefusalForSession } from './chunk-WGC7UFRM.js';
|
|
4
|
+
import { detectActiveSession, transcriptPathForSession } from './chunk-FWSVWPMS.js';
|
|
5
|
+
import { autoConnect } from './chunk-VUH7KKVD.js';
|
|
6
|
+
import { resolveRepoIdentity, defaultProjectsDir, findTranscripts, sessionIdFromPath, scrubText } from './chunk-6KH3NMIT.js';
|
|
6
7
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
|
-
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-
|
|
8
|
+
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-NXQK2I3G.js';
|
|
8
9
|
import { readLatestProvenanceForSession } from './chunk-545P7JY7.js';
|
|
9
|
-
import {
|
|
10
|
-
import { launchedItemForSession } from './chunk-5WYT3PPE.js';
|
|
10
|
+
import { launchedItemForSession } from './chunk-4OD45RBP.js';
|
|
11
11
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
12
12
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
13
13
|
import { FindingBatchSchema, FindingsResponseSchema, SAME_PROBLEM_RULES } from './chunk-WUKLQWGY.js';
|
|
@@ -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-DTCTXDJP.js';
|
|
5
5
|
import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
6
6
|
import { join } from 'path';
|
|
7
7
|
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { runEmit } from './chunk-
|
|
4
|
-
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-
|
|
5
|
-
import { installStarterPack } from './chunk-
|
|
3
|
+
import { runEmit } from './chunk-WVAXJOWG.js';
|
|
4
|
+
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-MVPOYQQY.js';
|
|
5
|
+
import { installStarterPack } from './chunk-B5SWBFVE.js';
|
|
6
|
+
import { listWithAnd } from './chunk-FRMAQ3C4.js';
|
|
7
|
+
import { AGENTS_MD_LAYOUT, mcpFiles, declareAgentsMdLayout, linkAgentSkills, describeSkillsLink, isAgentsMdLayout, holdsTodaysLayoutSources, discoverOuterlayerPaths } from './chunk-D6EXW4EB.js';
|
|
6
8
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
|
-
import {
|
|
8
|
-
import { resolveGitCommonDir, defaultGitRunner } from './chunk-X2XTCGUS.js';
|
|
9
|
-
import { loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE } from './chunk-CXFJOX2C.js';
|
|
9
|
+
import { resolveGitCommonDir, defaultGitRunner } from './chunk-VAYVTUU4.js';
|
|
10
10
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
11
|
-
import { linkedAgentsPath } from './chunk-
|
|
11
|
+
import { linkedAgentsPath } from './chunk-PBGNX3PS.js';
|
|
12
12
|
import { cloneIsGoverned } from './chunk-YQR6E6OV.js';
|
|
13
|
-
import { generatedHeaderSource } from './chunk-
|
|
13
|
+
import { generatedHeaderSource, defaultAgents, loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE, legacyAgent, contextAgents } from './chunk-I6U6QPN6.js';
|
|
14
|
+
import { LEGACY_AGENT } from './chunk-LSLK4RS4.js';
|
|
14
15
|
import { execFileSync } from 'child_process';
|
|
15
16
|
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
16
17
|
import { join, dirname } from 'path';
|
|
17
18
|
|
|
18
19
|
createRequire(import.meta.url);
|
|
19
20
|
var CONFIG_PATH = ".outerlayer/config.json";
|
|
20
|
-
var MCP_OUTPUT_PATH = ".mcp.json";
|
|
21
21
|
var POLICY_PATH = ".outerlayer/policy.yaml";
|
|
22
|
-
var DEFAULT_CONFIG = `${JSON.stringify({ targets: [
|
|
22
|
+
var DEFAULT_CONFIG = `${JSON.stringify({ targets: [LEGACY_AGENT] }, null, 2)}
|
|
23
23
|
`;
|
|
24
|
-
var AGENTS_MD_CONFIG = `${JSON.stringify({ targets: [
|
|
24
|
+
var AGENTS_MD_CONFIG = `${JSON.stringify({ targets: [LEGACY_AGENT], layout: AGENTS_MD_LAYOUT }, null, 2)}
|
|
25
25
|
`;
|
|
26
|
-
var
|
|
26
|
+
var starterAgentsMd = (agents) => `# Agent instructions
|
|
27
27
|
|
|
28
28
|
Write here what an agent needs to work in this repository: how to build and test it, the rules it follows, and what to check before it opens a pull request.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
${legacyAgent(agents).descriptor.label} and Codex read this file as it is. Skills are in \`.agents/skills/\`.
|
|
31
31
|
`;
|
|
32
|
+
var agentLabels = (agents) => contextAgents(agents).map((agent) => agent.descriptor.label).join(" and ");
|
|
32
33
|
function inTodaysLayout(repoRoot) {
|
|
33
34
|
if (isAgentsMdLayout(repoRoot)) return false;
|
|
34
35
|
return existsSync(join(repoRoot, CONFIG_PATH)) || holdsTodaysLayoutSources(discoverOuterlayerPaths(repoRoot));
|
|
@@ -79,6 +80,7 @@ function keepHandWritten(createdSources) {
|
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
function runAgentSetup(opts) {
|
|
83
|
+
const agents = opts.agents ?? defaultAgents();
|
|
82
84
|
let repoRoot;
|
|
83
85
|
try {
|
|
84
86
|
repoRoot = gitTopLevel(opts.cwd);
|
|
@@ -89,7 +91,7 @@ function runAgentSetup(opts) {
|
|
|
89
91
|
} catch (err) {
|
|
90
92
|
return failed(errorMessage(err), /* @__PURE__ */ new Set(), []);
|
|
91
93
|
}
|
|
92
|
-
if (!inTodaysLayout(repoRoot)) return runAgentsMdSetup(repoRoot, opts.skillsLink !== false);
|
|
94
|
+
if (!inTodaysLayout(repoRoot)) return runAgentsMdSetup(repoRoot, opts.skillsLink !== false, agents);
|
|
93
95
|
const written = /* @__PURE__ */ new Set();
|
|
94
96
|
const kept = [];
|
|
95
97
|
const problems = [];
|
|
@@ -118,20 +120,22 @@ function runAgentSetup(opts) {
|
|
|
118
120
|
return failed(`could not install the skills: ${errorMessage(err)}`, written, kept);
|
|
119
121
|
}
|
|
120
122
|
try {
|
|
121
|
-
const mcp
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
for (const mcp of withOthers(addStdioMcpEntryIfAbsent(repoRoot, "outerlayer", agents))) {
|
|
124
|
+
if (mcp.added) written.add(mcp.path);
|
|
125
|
+
else kept.push(`${mcp.path} (already has an outerlayer server)`);
|
|
126
|
+
}
|
|
127
|
+
for (const docs of withOthers(addDocsMcpEntryIfAbsent(repoRoot, agents))) {
|
|
128
|
+
if (docs.added) written.add(docs.path);
|
|
129
|
+
else kept.push(`${docs.path} (already has an ${DOCS_MCP_SERVER_NAME} server)`);
|
|
130
|
+
}
|
|
127
131
|
} catch (err) {
|
|
128
132
|
problems.push(errorMessage(err));
|
|
129
133
|
}
|
|
130
134
|
let pending;
|
|
131
135
|
try {
|
|
132
|
-
const check = runEmit({ cwd: repoRoot, check: true, quiet: true, keep });
|
|
136
|
+
const check = runEmit({ cwd: repoRoot, check: true, quiet: true, keep }, agents);
|
|
133
137
|
pending = check.drift ?? [];
|
|
134
|
-
const emitted = runEmit({ cwd: repoRoot, quiet: true, keep });
|
|
138
|
+
const emitted = runEmit({ cwd: repoRoot, quiet: true, keep }, agents);
|
|
135
139
|
for (const path of emitted.kept) keptOutputs.add(path);
|
|
136
140
|
if (emitted.exitCode !== 0) {
|
|
137
141
|
const detail = emitted.errors.map((e) => `${e.path}: ${e.message}`).join("; ");
|
|
@@ -152,12 +156,12 @@ function runAgentSetup(opts) {
|
|
|
152
156
|
return {
|
|
153
157
|
outcome: "done",
|
|
154
158
|
reason: paths.length === 0 ? "already set up" : `${paths.length} files written`,
|
|
155
|
-
text: renderDone(paths, kept, keptOutputs.has(
|
|
159
|
+
text: renderDone(paths, kept, mcpFiles(agents).some((file) => keptOutputs.has(file)), agents),
|
|
156
160
|
paths,
|
|
157
161
|
kept: keptPaths
|
|
158
162
|
};
|
|
159
163
|
}
|
|
160
|
-
function runAgentsMdSetup(repoRoot, skillsLink) {
|
|
164
|
+
function runAgentsMdSetup(repoRoot, skillsLink, agents) {
|
|
161
165
|
const written = /* @__PURE__ */ new Set();
|
|
162
166
|
const kept = [];
|
|
163
167
|
const problems = [];
|
|
@@ -175,7 +179,7 @@ function runAgentsMdSetup(repoRoot, skillsLink) {
|
|
|
175
179
|
if (existsSync(join(repoRoot, "AGENTS.md")) || existsSync(join(repoRoot, "CLAUDE.md"))) {
|
|
176
180
|
kept.push(existsSync(join(repoRoot, "AGENTS.md")) ? "AGENTS.md" : "CLAUDE.md");
|
|
177
181
|
} else {
|
|
178
|
-
writeFileSync(join(repoRoot, "AGENTS.md"),
|
|
182
|
+
writeFileSync(join(repoRoot, "AGENTS.md"), starterAgentsMd(agents));
|
|
179
183
|
written.add("AGENTS.md");
|
|
180
184
|
}
|
|
181
185
|
if (existsSync(join(repoRoot, CONFIG_PATH))) {
|
|
@@ -190,20 +194,22 @@ function runAgentsMdSetup(repoRoot, skillsLink) {
|
|
|
190
194
|
return failed(`could not install the skills: ${errorMessage(err)}`, written, kept);
|
|
191
195
|
}
|
|
192
196
|
try {
|
|
193
|
-
const mcp
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
for (const mcp of withOthers(addStdioMcpEntryIfAbsent(repoRoot, "outerlayer", agents))) {
|
|
198
|
+
if (mcp.added) written.add(mcp.path);
|
|
199
|
+
else kept.push(`${mcp.path} (already has an outerlayer server)`);
|
|
200
|
+
}
|
|
201
|
+
for (const docs of withOthers(addDocsMcpEntryIfAbsent(repoRoot, agents))) {
|
|
202
|
+
if (docs.added) written.add(docs.path);
|
|
203
|
+
else kept.push(`${docs.path} (already has an ${DOCS_MCP_SERVER_NAME} server)`);
|
|
204
|
+
}
|
|
199
205
|
} catch (err) {
|
|
200
206
|
problems.push(errorMessage(err));
|
|
201
207
|
}
|
|
202
208
|
let linkNote = "";
|
|
203
209
|
if (skillsLink) {
|
|
204
|
-
const link =
|
|
205
|
-
if (link.status === "linked") written.add(
|
|
206
|
-
linkNote = describeSkillsLink(link);
|
|
210
|
+
const link = linkAgentSkills(repoRoot, agents);
|
|
211
|
+
if (link.status === "linked") for (const folder of link.folders ?? [link.folder ?? legacyAgent(agents).descriptor.context.repoSkillFolders[0]]) written.add(folder);
|
|
212
|
+
linkNote = describeSkillsLink(link, agents);
|
|
207
213
|
}
|
|
208
214
|
if (problems.length > 0) return failed(problems.join("; "), written, kept);
|
|
209
215
|
const paths = [...written].sort();
|
|
@@ -212,7 +218,7 @@ function runAgentsMdSetup(repoRoot, skillsLink) {
|
|
|
212
218
|
renderPaths(paths, kept).trimEnd()
|
|
213
219
|
];
|
|
214
220
|
if (linkNote !== "") lines.push(` ${linkNote}`);
|
|
215
|
-
if (paths.length > 0) lines.push(` ${C.dim}Commit AGENTS.md, .agents/
|
|
221
|
+
if (paths.length > 0) lines.push(` ${C.dim}Commit ${listWithAnd(["AGENTS.md", ".agents/", ...mcpFiles(agents)])} with .outerlayer/. Nothing is generated, so there is no emit step.${C.reset}`);
|
|
216
222
|
return {
|
|
217
223
|
outcome: "done",
|
|
218
224
|
reason: paths.length === 0 ? "already set up" : `${paths.length} files written`,
|
|
@@ -231,6 +237,9 @@ function writtenBeforeFailure(repoRoot, pending, keep) {
|
|
|
231
237
|
return [];
|
|
232
238
|
}
|
|
233
239
|
}
|
|
240
|
+
function withOthers(result) {
|
|
241
|
+
return [result, ...result.others ?? []];
|
|
242
|
+
}
|
|
234
243
|
function failed(reason, written, kept, keptPaths = []) {
|
|
235
244
|
const paths = [...written].sort();
|
|
236
245
|
return {
|
|
@@ -255,15 +264,16 @@ function renderPaths(paths, kept) {
|
|
|
255
264
|
return `${lines.join("\n")}
|
|
256
265
|
`;
|
|
257
266
|
}
|
|
258
|
-
function renderDone(paths, kept, mcpKept) {
|
|
259
|
-
const
|
|
267
|
+
function renderDone(paths, kept, mcpKept, agents) {
|
|
268
|
+
const files = mcpFiles(agents).join(", ");
|
|
269
|
+
const mcpNote = mcpKept ? ` ${C.yellow}!${C.reset} The outerlayer and ${DOCS_MCP_SERVER_NAME} entries were not added to ${files}, so their MCP servers are not set up. Add them to ${files} by hand, or move the servers you wrote into .outerlayer/mcp.json and run \`${cliInvocation()} context emit\`.
|
|
260
270
|
` : "";
|
|
261
271
|
const what = mcpKept ? "the OuterLayer skills" : "the OuterLayer skills and MCP servers";
|
|
262
272
|
if (paths.length === 0) {
|
|
263
273
|
return `${C.green}\u2713${C.reset} Agent setup: already in place, nothing changed
|
|
264
274
|
${renderPaths(paths, kept)}${mcpNote}`;
|
|
265
275
|
}
|
|
266
|
-
return `${C.green}\u2713${C.reset} Agent setup:
|
|
276
|
+
return `${C.green}\u2713${C.reset} Agent setup: ${agentLabels(agents)} has ${what}
|
|
267
277
|
` + renderPaths(paths, kept) + mcpNote + ` ${C.dim}\`context emit\` compiled every source under .outerlayer/ for the targets in ${CONFIG_PATH}, not only the skills.${C.reset}
|
|
268
278
|
`;
|
|
269
279
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RemovedTargetError, removedTargetError } from './chunk-
|
|
4
|
-
import { removeRetiredSkills } from './chunk-
|
|
5
|
-
import { defaultFetch, resolveGatewayCredentials } from './chunk-
|
|
3
|
+
import { RemovedTargetError, removedTargetError } from './chunk-XIDDJSQU.js';
|
|
4
|
+
import { removeRetiredSkills } from './chunk-B36NSEUM.js';
|
|
5
|
+
import { defaultFetch, resolveGatewayCredentials } from './chunk-NXQK2I3G.js';
|
|
6
6
|
import { appendContextProvenance } from './chunk-545P7JY7.js';
|
|
7
|
-
import { loadMaintainedFiles, writeMaintainedFiles } from './chunk-CXFJOX2C.js';
|
|
8
7
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
9
8
|
import { writeDegraded, writeSourceCache, SOURCE_CACHE_TTL_RETRY_MS, writeContextManifest, SOURCE_CACHE_TTL_SUCCESS_MS, readSourceCache, isSourceCacheFresh, clearDegraded } from './chunk-YQR6E6OV.js';
|
|
10
|
-
import {
|
|
9
|
+
import { withTokenHeader } from './chunk-CXJC3JLN.js';
|
|
10
|
+
import { normalizeRepoName, loadMaintainedFiles, writeMaintainedFiles, parseOuterlayerConfig, targetIds, classifyTree, emitTree, emitBuilders, defaultAgents, agentRootFolders } from './chunk-I6U6QPN6.js';
|
|
11
11
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
12
|
-
import { withTokenHeader } from './chunk-GANAOCHR.js';
|
|
13
12
|
import { execFileSync } from 'child_process';
|
|
14
13
|
import { existsSync, mkdirSync, writeFileSync, chmodSync, lstatSync, readFileSync, copyFileSync } from 'fs';
|
|
15
14
|
import { isAbsolute, join, dirname } from 'path';
|
|
@@ -17,16 +16,16 @@ import { isAbsolute, join, dirname } from 'path';
|
|
|
17
16
|
createRequire(import.meta.url);
|
|
18
17
|
var CONFIG_PATH = ".outerlayer/config.json";
|
|
19
18
|
var CONTENT_KINDS = /* @__PURE__ */ new Set(["skill", "skill-reference"]);
|
|
20
|
-
function overlayMaintainedSkills(repoRoot, unsafe) {
|
|
19
|
+
function overlayMaintainedSkills(repoRoot, unsafe, agents = defaultAgents()) {
|
|
21
20
|
const sources = loadMaintainedFiles().filter((file) => !unsafe(file.path));
|
|
22
21
|
writeMaintainedFiles(repoRoot, sources);
|
|
23
22
|
const paths = sources.map((file) => file.path);
|
|
24
23
|
const configAbs = join(repoRoot, CONFIG_PATH);
|
|
25
24
|
if (!existsSync(configAbs)) return paths;
|
|
26
25
|
const configText = readFileSync(configAbs, "utf8");
|
|
27
|
-
const removed = removedTargetError(configText);
|
|
26
|
+
const removed = removedTargetError(configText, agents);
|
|
28
27
|
if (removed !== void 0) throw new RemovedTargetError(removed);
|
|
29
|
-
const config = parseOuterlayerConfig(configText);
|
|
28
|
+
const config = parseOuterlayerConfig(configText, targetIds(agents));
|
|
30
29
|
if (!config.ok || !config.config) return paths;
|
|
31
30
|
const { entries } = classifyTree(sources.map((file) => file.path));
|
|
32
31
|
const input = {
|
|
@@ -35,7 +34,7 @@ function overlayMaintainedSkills(repoRoot, unsafe) {
|
|
|
35
34
|
assetPaths: [],
|
|
36
35
|
targets: config.config.targets
|
|
37
36
|
};
|
|
38
|
-
const compiled = emitTree(input);
|
|
37
|
+
const compiled = emitTree(input, emitBuilders(agents));
|
|
39
38
|
if (compiled.errors.length > 0) return paths;
|
|
40
39
|
for (const file of compiled.files) {
|
|
41
40
|
if (unsafe(file.path)) continue;
|
|
@@ -475,9 +474,9 @@ function ensureBareCache(git, home, repository, host) {
|
|
|
475
474
|
}
|
|
476
475
|
return dir;
|
|
477
476
|
}
|
|
478
|
-
var
|
|
477
|
+
var materializedRoots = () => ["AGENTS.md", ...agentRootFolders(), ".outerlayer", ".agents"];
|
|
479
478
|
function listMaterializedFiles(git, cacheRepoDir, sha) {
|
|
480
|
-
const result = git(["ls-tree", "-r", "-z", sha, "--", ...
|
|
479
|
+
const result = git(["ls-tree", "-r", "-z", sha, "--", ...materializedRoots()], { cwd: cacheRepoDir, timeoutMs: 1e4 });
|
|
481
480
|
if (!result.ok) return [];
|
|
482
481
|
const entries = [];
|
|
483
482
|
for (const raw of result.stdout.toString("utf8").split("\0")) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-
|
|
4
|
-
import {
|
|
3
|
+
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-FRMAQ3C4.js';
|
|
4
|
+
import { resolveRepoIdentity } from './chunk-6KH3NMIT.js';
|
|
5
|
+
import { resolveGatewayCredentials } from './chunk-NXQK2I3G.js';
|
|
5
6
|
import { readCloudConfig } from './chunk-HWVMRETT.js';
|
|
6
7
|
import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
7
|
-
import { resolveRepoIdentity } from './chunk-5GHJFETA.js';
|
|
8
8
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
9
9
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
10
10
|
|