agents-inc 0.168.0 → 0.170.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +18 -15
- package/dist/{chunk-JIBCVXXL.js → chunk-3G7X2WKI.js} +4 -4
- package/dist/{chunk-JOEA52NR.js → chunk-44TE3RKH.js} +46 -2
- package/dist/chunk-44TE3RKH.js.map +1 -0
- package/dist/{chunk-NU2K5G54.js → chunk-52HDHJ7I.js} +11 -19
- package/dist/chunk-52HDHJ7I.js.map +1 -0
- package/dist/{chunk-EH2PGPLP.js → chunk-6HNXYYVF.js} +39 -22
- package/dist/chunk-6HNXYYVF.js.map +1 -0
- package/dist/{chunk-4UKMQUAU.js → chunk-6ZRH5RHC.js} +10 -11
- package/dist/chunk-6ZRH5RHC.js.map +1 -0
- package/dist/{chunk-5JUQKGCP.js → chunk-7RDMTR64.js} +14 -34
- package/dist/chunk-7RDMTR64.js.map +1 -0
- package/dist/{chunk-3LZNY46H.js → chunk-BMRUNMPV.js} +4 -4
- package/dist/{chunk-VVRI35SK.js → chunk-CLPUWOSA.js} +4 -4
- package/dist/{chunk-VVRI35SK.js.map → chunk-CLPUWOSA.js.map} +1 -1
- package/dist/{chunk-TW35AEB4.js → chunk-F2BHT5C4.js} +9 -7
- package/dist/chunk-F2BHT5C4.js.map +1 -0
- package/dist/{chunk-27AVGFXH.js → chunk-F5EBEATU.js} +2 -2
- package/dist/{chunk-GE7NUPMI.js → chunk-HED2DAXZ.js} +3 -3
- package/dist/{chunk-7PYXS2QU.js → chunk-KOLDW6SF.js} +3 -3
- package/dist/{chunk-7PYXS2QU.js.map → chunk-KOLDW6SF.js.map} +1 -1
- package/dist/{chunk-C2UISKIM.js → chunk-MQ6CGZNJ.js} +109 -422
- package/dist/chunk-MQ6CGZNJ.js.map +1 -0
- package/dist/{chunk-P6I72PR3.js → chunk-NCWDK6L7.js} +115 -196
- package/dist/chunk-NCWDK6L7.js.map +1 -0
- package/dist/{chunk-VRXX4D6K.js → chunk-NEZ4OAOL.js} +1 -1
- package/dist/chunk-NEZ4OAOL.js.map +1 -0
- package/dist/chunk-NIHUOWE4.js +106 -0
- package/dist/chunk-NIHUOWE4.js.map +1 -0
- package/dist/{chunk-OI2H6M5I.js → chunk-NQW25DCF.js} +2 -2
- package/dist/chunk-NQW25DCF.js.map +1 -0
- package/dist/{chunk-ZUGH4MQG.js → chunk-OYJQUA3D.js} +3 -3
- package/dist/{chunk-ZUGH4MQG.js.map → chunk-OYJQUA3D.js.map} +1 -1
- package/dist/{chunk-AG3ZVM3B.js → chunk-PJWGTNOX.js} +186 -210
- package/dist/chunk-PJWGTNOX.js.map +1 -0
- package/dist/{chunk-HR7TK2XW.js → chunk-RIPSGNLU.js} +3 -3
- package/dist/chunk-RIPSGNLU.js.map +1 -0
- package/dist/{chunk-4DRFEYCE.js → chunk-SZYQISA2.js} +7 -7
- package/dist/chunk-SZYQISA2.js.map +1 -0
- package/dist/{chunk-W6GO2CYX.js → chunk-USVBYQSQ.js} +2 -2
- package/dist/{chunk-H4ZKGGTE.js → chunk-V3KTSP3Q.js} +50 -42
- package/dist/chunk-V3KTSP3Q.js.map +1 -0
- package/dist/{chunk-KTLKR4YY.js → chunk-WTWMGH2C.js} +2 -2
- package/dist/commands/build/marketplace.js +23 -22
- package/dist/commands/build/marketplace.js.map +1 -1
- package/dist/commands/build/plugins.js +8 -9
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/compile.js +19 -20
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.js +17 -18
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +118 -297
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +21 -33
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/init.js +17 -45
- package/dist/commands/list.js +19 -17
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +11 -11
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/search.js +12 -13
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/share.js +11 -12
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/uninstall.js +18 -20
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +8 -9
- package/dist/commands/update.js.map +1 -1
- package/dist/components/common/removal-plan-confirm.js +2 -2
- package/dist/components/common/scroll-affordance.js +9 -0
- package/dist/components/common/select-list.js +2 -3
- package/dist/components/common/skill-agent-summary.js +11 -0
- package/dist/components/common/spinner.js +1 -1
- package/dist/{chunk-QWFG7Y3R.js → components/common/summary-panel.js} +57 -31
- package/dist/components/common/summary-panel.js.map +1 -0
- package/dist/config-exports.js +1 -1
- package/dist/hooks/init.js +18 -46
- package/dist/hooks/init.js.map +1 -1
- package/dist/load-agent-defs-YMDWBFDP.js +14 -0
- package/dist/recompile-project-agents-SZ76WNTW.js +18 -0
- package/dist/{source-loader-FRJTCSDL.js → source-loader-C5SQXZXI.js} +5 -5
- package/dist/src/agents/meta/codex-keeper/playbook.md +2 -3
- package/package.json +2 -3
- package/src/agents/meta/codex-keeper/playbook.md +2 -3
- package/src/schemas/project-config.schema.json +1 -1
- package/assets/demo.tape +0 -266
- package/dist/chunk-23DNVNFP.js +0 -292
- package/dist/chunk-23DNVNFP.js.map +0 -1
- package/dist/chunk-3DIDV6H3.js +0 -268
- package/dist/chunk-3DIDV6H3.js.map +0 -1
- package/dist/chunk-4DRFEYCE.js.map +0 -1
- package/dist/chunk-4HWOYYY7.js +0 -92
- package/dist/chunk-4HWOYYY7.js.map +0 -1
- package/dist/chunk-4UKMQUAU.js.map +0 -1
- package/dist/chunk-5JUQKGCP.js.map +0 -1
- package/dist/chunk-6WGXTB2L.js +0 -28
- package/dist/chunk-6WGXTB2L.js.map +0 -1
- package/dist/chunk-AG3ZVM3B.js.map +0 -1
- package/dist/chunk-C2UISKIM.js.map +0 -1
- package/dist/chunk-CMJBKQUH.js +0 -23
- package/dist/chunk-CMJBKQUH.js.map +0 -1
- package/dist/chunk-DJEO3F2H.js +0 -230
- package/dist/chunk-DJEO3F2H.js.map +0 -1
- package/dist/chunk-EH2PGPLP.js.map +0 -1
- package/dist/chunk-GRL73YPF.js +0 -197
- package/dist/chunk-GRL73YPF.js.map +0 -1
- package/dist/chunk-H4ZKGGTE.js.map +0 -1
- package/dist/chunk-HI6YB7XP.js +0 -59
- package/dist/chunk-HI6YB7XP.js.map +0 -1
- package/dist/chunk-HL3GYRMR.js +0 -17
- package/dist/chunk-HL3GYRMR.js.map +0 -1
- package/dist/chunk-HR7TK2XW.js.map +0 -1
- package/dist/chunk-JOEA52NR.js.map +0 -1
- package/dist/chunk-JPMV4E4E.js +0 -118
- package/dist/chunk-JPMV4E4E.js.map +0 -1
- package/dist/chunk-JVUN6AOO.js +0 -237
- package/dist/chunk-JVUN6AOO.js.map +0 -1
- package/dist/chunk-KQ3PDARZ.js +0 -25
- package/dist/chunk-KQ3PDARZ.js.map +0 -1
- package/dist/chunk-L3W2JWBA.js +0 -168
- package/dist/chunk-L3W2JWBA.js.map +0 -1
- package/dist/chunk-LFUJCRCT.js +0 -27
- package/dist/chunk-LFUJCRCT.js.map +0 -1
- package/dist/chunk-NU2K5G54.js.map +0 -1
- package/dist/chunk-OI2H6M5I.js.map +0 -1
- package/dist/chunk-P6I72PR3.js.map +0 -1
- package/dist/chunk-PCFUXQJA.js +0 -317
- package/dist/chunk-PCFUXQJA.js.map +0 -1
- package/dist/chunk-PLX2FLEQ.js +0 -48
- package/dist/chunk-PLX2FLEQ.js.map +0 -1
- package/dist/chunk-QWFG7Y3R.js.map +0 -1
- package/dist/chunk-SLBL3WIP.js +0 -121
- package/dist/chunk-SLBL3WIP.js.map +0 -1
- package/dist/chunk-TSIU7DME.js +0 -43
- package/dist/chunk-TSIU7DME.js.map +0 -1
- package/dist/chunk-TW35AEB4.js.map +0 -1
- package/dist/chunk-VRXX4D6K.js.map +0 -1
- package/dist/chunk-W5KEYSOL.js +0 -51
- package/dist/chunk-W5KEYSOL.js.map +0 -1
- package/dist/chunk-WNLF5EDZ.js +0 -1170
- package/dist/chunk-WNLF5EDZ.js.map +0 -1
- package/dist/chunk-WTJ3AY33.js +0 -31
- package/dist/chunk-WTJ3AY33.js.map +0 -1
- package/dist/chunk-X6ZZEYO3.js +0 -53
- package/dist/chunk-X6ZZEYO3.js.map +0 -1
- package/dist/chunk-XQHZPINL.js +0 -89
- package/dist/chunk-XQHZPINL.js.map +0 -1
- package/dist/chunk-YN3SWF53.js +0 -35
- package/dist/chunk-YN3SWF53.js.map +0 -1
- package/dist/components/wizard/category-grid.js +0 -13
- package/dist/components/wizard/checkbox-grid.js +0 -12
- package/dist/components/wizard/domain-selection.js +0 -18
- package/dist/components/wizard/run-wizard-session.js +0 -40
- package/dist/components/wizard/run-wizard-session.js.map +0 -1
- package/dist/components/wizard/scroll-affordance.js +0 -9
- package/dist/components/wizard/skill-agent-summary.js +0 -13
- package/dist/components/wizard/source-grid.js +0 -16
- package/dist/components/wizard/source-grid.js.map +0 -1
- package/dist/components/wizard/stack-selection.js +0 -17
- package/dist/components/wizard/stack-selection.js.map +0 -1
- package/dist/components/wizard/step-agents.js +0 -18
- package/dist/components/wizard/step-agents.js.map +0 -1
- package/dist/components/wizard/step-build.js +0 -18
- package/dist/components/wizard/step-build.js.map +0 -1
- package/dist/components/wizard/step-confirm.js +0 -18
- package/dist/components/wizard/step-confirm.js.map +0 -1
- package/dist/components/wizard/step-sources.js +0 -19
- package/dist/components/wizard/step-sources.js.map +0 -1
- package/dist/components/wizard/step-stack.js +0 -18
- package/dist/components/wizard/step-stack.js.map +0 -1
- package/dist/components/wizard/summary-panel.js +0 -17
- package/dist/components/wizard/summary-panel.js.map +0 -1
- package/dist/components/wizard/toast.js +0 -9
- package/dist/components/wizard/toast.js.map +0 -1
- package/dist/components/wizard/wizard-layout.js +0 -22
- package/dist/components/wizard/wizard-layout.js.map +0 -1
- package/dist/components/wizard/wizard-tabs.js +0 -11
- package/dist/components/wizard/wizard-tabs.js.map +0 -1
- package/dist/components/wizard/wizard.js +0 -39
- package/dist/components/wizard/wizard.js.map +0 -1
- package/dist/load-agent-defs-5XMVB3MU.js +0 -14
- package/dist/load-agent-defs-5XMVB3MU.js.map +0 -1
- package/dist/recompile-project-agents-7PQWYQ6B.js +0 -18
- package/dist/recompile-project-agents-7PQWYQ6B.js.map +0 -1
- package/dist/source-loader-FRJTCSDL.js.map +0 -1
- package/dist/stores/wizard-store.js +0 -24
- package/dist/stores/wizard-store.js.map +0 -1
- /package/assets/{demo.gif → legacy-wizard.gif} +0 -0
- /package/dist/{chunk-JIBCVXXL.js.map → chunk-3G7X2WKI.js.map} +0 -0
- /package/dist/{chunk-3LZNY46H.js.map → chunk-BMRUNMPV.js.map} +0 -0
- /package/dist/{chunk-27AVGFXH.js.map → chunk-F5EBEATU.js.map} +0 -0
- /package/dist/{chunk-GE7NUPMI.js.map → chunk-HED2DAXZ.js.map} +0 -0
- /package/dist/{chunk-W6GO2CYX.js.map → chunk-USVBYQSQ.js.map} +0 -0
- /package/dist/{chunk-KTLKR4YY.js.map → chunk-WTWMGH2C.js.map} +0 -0
- /package/dist/components/{wizard → common}/scroll-affordance.js.map +0 -0
- /package/dist/components/{wizard → common}/skill-agent-summary.js.map +0 -0
- /package/dist/{components/wizard/category-grid.js.map → load-agent-defs-YMDWBFDP.js.map} +0 -0
- /package/dist/{components/wizard/checkbox-grid.js.map → recompile-project-agents-SZ76WNTW.js.map} +0 -0
- /package/dist/{components/wizard/domain-selection.js.map → source-loader-C5SQXZXI.js.map} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
BUILT_IN_MATRIX,
|
|
4
|
-
allSkills,
|
|
5
4
|
getSkillById,
|
|
6
5
|
initializeMatrix,
|
|
7
6
|
matrix,
|
|
@@ -9,7 +8,7 @@ import {
|
|
|
9
8
|
typedFromEntries,
|
|
10
9
|
typedKeys,
|
|
11
10
|
typedValues
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-52HDHJ7I.js";
|
|
13
12
|
import {
|
|
14
13
|
AGENT_NAMES,
|
|
15
14
|
AUTHOR_HANDLE_PATTERN,
|
|
@@ -65,7 +64,6 @@ import {
|
|
|
65
64
|
bytewise,
|
|
66
65
|
cacheRoot,
|
|
67
66
|
categoryDomain,
|
|
68
|
-
createSelectionSemantics,
|
|
69
67
|
diagnostics,
|
|
70
68
|
editorConfigUrl,
|
|
71
69
|
effectivelyExcludedSkillIds,
|
|
@@ -85,12 +83,12 @@ import {
|
|
|
85
83
|
seedAgentScope,
|
|
86
84
|
sourceDirName,
|
|
87
85
|
validateSelection
|
|
88
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-PJWGTNOX.js";
|
|
89
87
|
import {
|
|
90
88
|
defaultCategories,
|
|
91
89
|
defaultRules,
|
|
92
90
|
defaultStacks
|
|
93
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-NQW25DCF.js";
|
|
94
92
|
|
|
95
93
|
// src/cli/lib/loading/source-loader.ts
|
|
96
94
|
import os14 from "os";
|
|
@@ -871,6 +869,7 @@ async function grantOwnerWrite(target) {
|
|
|
871
869
|
}
|
|
872
870
|
|
|
873
871
|
// src/cli/utils/logger.ts
|
|
872
|
+
import { AsyncLocalStorage as AsyncLocalStorage2 } from "async_hooks";
|
|
874
873
|
var verboseMode = false;
|
|
875
874
|
function setVerbose(enabled) {
|
|
876
875
|
verboseMode = enabled;
|
|
@@ -885,6 +884,8 @@ function log(msg) {
|
|
|
885
884
|
}
|
|
886
885
|
var bufferMode = false;
|
|
887
886
|
var messageBuffer = [];
|
|
887
|
+
var alreadySaid = /* @__PURE__ */ new Set();
|
|
888
|
+
var eachWarningOnce = new AsyncLocalStorage2();
|
|
888
889
|
function enableBuffering() {
|
|
889
890
|
bufferMode = true;
|
|
890
891
|
messageBuffer = [];
|
|
@@ -899,17 +900,23 @@ function disableBuffering() {
|
|
|
899
900
|
messageBuffer = [];
|
|
900
901
|
}
|
|
901
902
|
function warn(msg) {
|
|
903
|
+
if (isARepeatToHoldBack(msg)) return;
|
|
902
904
|
if (bufferMode) {
|
|
903
905
|
messageBuffer.push({ level: "warn", text: msg });
|
|
904
906
|
return;
|
|
905
907
|
}
|
|
908
|
+
alreadySaid.add(msg);
|
|
906
909
|
console.warn(` Warning: ${msg}`);
|
|
907
910
|
}
|
|
908
|
-
|
|
911
|
+
function isARepeatToHoldBack(msg) {
|
|
912
|
+
if (eachWarningOnce.getStore() !== true) return false;
|
|
913
|
+
return alreadySaid.has(msg) || messageBuffer.some((message) => message.text === msg);
|
|
914
|
+
}
|
|
915
|
+
function sayingEachWarningOnce(body) {
|
|
916
|
+
return eachWarningOnce.run(true, body);
|
|
917
|
+
}
|
|
909
918
|
function warnOnce(msg) {
|
|
910
|
-
|
|
911
|
-
alreadySaid.add(msg);
|
|
912
|
-
warn(msg);
|
|
919
|
+
sayingEachWarningOnce(() => warn(msg));
|
|
913
920
|
}
|
|
914
921
|
|
|
915
922
|
// src/cli/lib/validate-kebab-name.ts
|
|
@@ -940,7 +947,7 @@ var ERROR_MESSAGES = {
|
|
|
940
947
|
* What `compile` refuses with when every pass discovered zero skills. It is reached only
|
|
941
948
|
* after an installation was detected, so the state it describes is a configuration with
|
|
942
949
|
* nothing installed under it — the same state `doctor` reports as `config-empty` and
|
|
943
|
-
* names `init` for, because `init` on a config that declares nothing opens the
|
|
950
|
+
* names `init` for, because `init` on a config that declares nothing opens the editor
|
|
944
951
|
* rather than the dashboard. `edit` is the wrong half of the pair here: it modifies the
|
|
945
952
|
* currently installed skills, and there are none to modify.
|
|
946
953
|
*/
|
|
@@ -1050,7 +1057,7 @@ function scopeBlockedStackAssignment(agentNames, skillId) {
|
|
|
1050
1057
|
}
|
|
1051
1058
|
function globalScopedAgentsHint(count) {
|
|
1052
1059
|
const [subject, object] = count === 1 ? ["agent is", "it"] : ["agents are", "them"];
|
|
1053
|
-
return `${count} ${subject} global-scoped \u2014 run '${CLI_INVOKE_COMMAND} compile' from your home directory
|
|
1060
|
+
return `${count} ${subject} global-scoped \u2014 run '${CLI_INVOKE_COMMAND} compile' from your home directory to recompile ${object}.`;
|
|
1054
1061
|
}
|
|
1055
1062
|
function marketplacesRefreshed(count) {
|
|
1056
1063
|
return `Refreshed ${plural(count, "marketplace listing")}. Installed plugins were not changed.`;
|
|
@@ -1157,6 +1164,13 @@ function savedSkillMetadataUnusableError(entries) {
|
|
|
1157
1164
|
METADATA_UNUSABLE_WAY_OUT
|
|
1158
1165
|
].join("\n");
|
|
1159
1166
|
}
|
|
1167
|
+
function editorSkillMetadataUnusableError(entries) {
|
|
1168
|
+
return [
|
|
1169
|
+
metadataUnusableOpening(entries),
|
|
1170
|
+
`The editor opens on what these files describe, so no link is made until each one describes its skill.`,
|
|
1171
|
+
METADATA_UNUSABLE_WAY_OUT
|
|
1172
|
+
].join("\n");
|
|
1173
|
+
}
|
|
1160
1174
|
var SHARED_CONFIG_GREENFIELD_HINT = "installing a shared configuration is a fresh setup, not a merge";
|
|
1161
1175
|
function sharedConfigDestinations(id) {
|
|
1162
1176
|
return [
|
|
@@ -1222,27 +1236,14 @@ function sharedConfigNeedsTerminal(id) {
|
|
|
1222
1236
|
function nothingInstalledToApplyTo(id) {
|
|
1223
1237
|
return `No installation found. Run '${CLI_INVOKE_COMMAND} init --from ${id}' to install configuration '${id}' here.`;
|
|
1224
1238
|
}
|
|
1225
|
-
var RUNS_WITHOUT_A_TERMINAL = {
|
|
1226
|
-
init: `'${CLI_INVOKE_COMMAND} init --from <id>' installs a configuration built in the editor without one`,
|
|
1227
|
-
edit: `'${CLI_INVOKE_COMMAND} edit --ui' opens this installation in the editor without one`
|
|
1228
|
-
};
|
|
1229
|
-
function wizardNeedsTerminal(command) {
|
|
1230
|
-
return [
|
|
1231
|
-
`'${CLI_INVOKE_COMMAND} ${command}' opens a wizard, and there is no terminal here to open it in.`,
|
|
1232
|
-
`Run it from a terminal \u2014 ${RUNS_WITHOUT_A_TERMINAL[command]}.`
|
|
1233
|
-
].join("\n");
|
|
1234
|
-
}
|
|
1235
1239
|
function uninstallNeedsTerminal() {
|
|
1236
1240
|
return [
|
|
1237
1241
|
"Uninstalling removes files, so it has to be confirmed \u2014 and there is no terminal here to confirm it at.",
|
|
1238
1242
|
`Run '${CLI_INVOKE_COMMAND} uninstall' from a terminal, or '${CLI_INVOKE_COMMAND} uninstall --yes' to remove it without being asked.`
|
|
1239
1243
|
].join("\n");
|
|
1240
1244
|
}
|
|
1241
|
-
function
|
|
1242
|
-
return
|
|
1243
|
-
}
|
|
1244
|
-
function marketplaceFixedAtInstall(stored, named) {
|
|
1245
|
-
return `This folder's installation was made from the marketplace '${stored}', and an installation's marketplace is chosen once, when it is made \u2014 so --marketplace '${named}' was not used. Run '${CLI_INVOKE_COMMAND} init' without it to open this installation, or '${CLI_INVOKE_COMMAND} uninstall' first to set this folder up from another.`;
|
|
1245
|
+
function addMarketplaceInTheEditor(ref, isFolder) {
|
|
1246
|
+
return isFolder ? `${ref} is a folder on this machine, which the editor cannot read \u2014 push it to GitHub, then add it from the editor's Marketplace button.` : `Add ${ref} from the editor's Marketplace button.`;
|
|
1246
1247
|
}
|
|
1247
1248
|
var SHARED_CONFIG_ARRIVALS = {
|
|
1248
1249
|
PROJECT_HEADING: "Into this project:",
|
|
@@ -1258,11 +1259,18 @@ function keptAsInstalledGlobally(skillIds, agentNames) {
|
|
|
1258
1259
|
`Change them with '${CLI_INVOKE_COMMAND} edit' from your home directory.`
|
|
1259
1260
|
].join("\n");
|
|
1260
1261
|
}
|
|
1262
|
+
function addedToGlobalSubAgents(joined) {
|
|
1263
|
+
return [
|
|
1264
|
+
"Added to sub-agents in the global install \u2014 each keeps everything it already has, since a project run only adds to the global install:",
|
|
1265
|
+
...joined.map(
|
|
1266
|
+
({ agentName, skillIds }) => ` sub-agent ${agentName}: + ${skillIds.join(", ")}`
|
|
1267
|
+
)
|
|
1268
|
+
].join("\n");
|
|
1269
|
+
}
|
|
1261
1270
|
function authoredHereKept(skillIds) {
|
|
1262
1271
|
return [
|
|
1263
1272
|
"Kept \u2014 written here rather than installed, so a shared configuration never carried them:",
|
|
1264
|
-
...skillIds.map((id) => ` skill ${id}`)
|
|
1265
|
-
`Remove them with '${CLI_INVOKE_COMMAND} edit'.`
|
|
1273
|
+
...skillIds.map((id) => ` skill ${id}`)
|
|
1266
1274
|
].join("\n");
|
|
1267
1275
|
}
|
|
1268
1276
|
function unplaceableKept(skillIds) {
|
|
@@ -1275,35 +1283,30 @@ function unplaceableKept(skillIds) {
|
|
|
1275
1283
|
function keptUnassigned(skillId, agentName, category) {
|
|
1276
1284
|
return `${skillId}: kept, no longer assigned to ${agentName}'s ${category}`;
|
|
1277
1285
|
}
|
|
1278
|
-
function
|
|
1279
|
-
return
|
|
1280
|
-
`Or build one at ${EDITOR_URL} and install it with '${CLI_INVOKE_COMMAND} init --from <id>'.`,
|
|
1281
|
-
`'${CLI_INVOKE_COMMAND} doctor' reports the same ${count === 1 ? "file" : "files"}, alongside whatever else is wrong here.`
|
|
1282
|
-
];
|
|
1286
|
+
function doctorReportsTheSame(count) {
|
|
1287
|
+
return `'${CLI_INVOKE_COMMAND} doctor' reports the same ${count === 1 ? "file" : "files"}, alongside whatever else is wrong here.`;
|
|
1283
1288
|
}
|
|
1284
1289
|
function installationConfigsUnreadable(failures) {
|
|
1285
|
-
return [
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
].join("\n");
|
|
1290
|
+
return [...failures.flatMap(whoseConfigAndItsWayOut), doctorReportsTheSame(failures.length)].join(
|
|
1291
|
+
"\n"
|
|
1292
|
+
);
|
|
1289
1293
|
}
|
|
1290
1294
|
function whoseConfigAndItsWayOut(failure) {
|
|
1291
1295
|
return [
|
|
1292
1296
|
`${scopeLabel(failure.scope)}'s config at '${failure.configPath}' could not be loaded: ${failure.reason}`,
|
|
1293
|
-
`There is no automatic repair for this \u2014 recreate the configuration by running ${recreateConfigFrom(failure.scopeRoot)}.`
|
|
1297
|
+
`There is no automatic repair for this \u2014 fix the file, or recreate the configuration by running ${recreateConfigFrom(failure.scopeRoot)}.`
|
|
1294
1298
|
];
|
|
1295
1299
|
}
|
|
1296
1300
|
function uninstallConfigUnreadable(failure) {
|
|
1297
1301
|
return `Could not read the ${failure.scope} config \u2014 plugins and compiled agents it lists may be left behind: ${failure.message}`;
|
|
1298
1302
|
}
|
|
1299
1303
|
function recreateConfigFrom(scopeRoot) {
|
|
1300
|
-
return `'${CLI_INVOKE_COMMAND} uninstall', which still works on a config it cannot read, then '${CLI_INVOKE_COMMAND} init'
|
|
1304
|
+
return `'${CLI_INVOKE_COMMAND} uninstall' from '${scopeRoot}', which still works on a config it cannot read, then '${CLI_INVOKE_COMMAND} init --from <id>' with an id from ${EDITOR_URL}`;
|
|
1301
1305
|
}
|
|
1302
1306
|
function configUnreadableError(configLoadFailure2) {
|
|
1303
1307
|
return [
|
|
1304
1308
|
configLoadFailure2,
|
|
1305
|
-
|
|
1306
|
-
...otherWaysPastUnreadableConfigs(1)
|
|
1309
|
+
"This is the marketplace's own config rather than an installation's, so it is fixed in the marketplace repository it comes from."
|
|
1307
1310
|
].join("\n");
|
|
1308
1311
|
}
|
|
1309
1312
|
function registeredProjectsUpdateFailed(reason) {
|
|
@@ -1927,17 +1930,6 @@ var CATEGORIES = [
|
|
|
1927
1930
|
"web-ui-kit",
|
|
1928
1931
|
"web-utilities"
|
|
1929
1932
|
];
|
|
1930
|
-
var DOMAINS = [
|
|
1931
|
-
"ai",
|
|
1932
|
-
"api",
|
|
1933
|
-
"cli",
|
|
1934
|
-
"desktop",
|
|
1935
|
-
"infra",
|
|
1936
|
-
"meta",
|
|
1937
|
-
"mobile",
|
|
1938
|
-
"shared",
|
|
1939
|
-
"web"
|
|
1940
|
-
];
|
|
1941
1933
|
var AGENT_NAMES2 = [
|
|
1942
1934
|
"agent-summoner",
|
|
1943
1935
|
"ai-developer",
|
|
@@ -1963,9 +1955,6 @@ var AGENT_NAMES2 = [
|
|
|
1963
1955
|
function isRecord(value) {
|
|
1964
1956
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1965
1957
|
}
|
|
1966
|
-
function isDomain(value) {
|
|
1967
|
-
return DOMAINS.includes(value);
|
|
1968
|
-
}
|
|
1969
1958
|
function isAgentName(value) {
|
|
1970
1959
|
return AGENT_NAMES2.includes(value);
|
|
1971
1960
|
}
|
|
@@ -2944,12 +2933,6 @@ function isLocalSource(source) {
|
|
|
2944
2933
|
}
|
|
2945
2934
|
return true;
|
|
2946
2935
|
}
|
|
2947
|
-
function isSameMarketplace(a, b, fromDir) {
|
|
2948
|
-
if (isLocalSource(a) && isLocalSource(b)) {
|
|
2949
|
-
return path5.resolve(fromDir, a) === path5.resolve(fromDir, b);
|
|
2950
|
-
}
|
|
2951
|
-
return a === b;
|
|
2952
|
-
}
|
|
2953
2936
|
|
|
2954
2937
|
// src/cli/lib/compile-seat.ts
|
|
2955
2938
|
seatDiagnostics({ warn, verbose });
|
|
@@ -3915,11 +3898,6 @@ var KNOWN_AGENTS = new Set(AGENT_NAMES);
|
|
|
3915
3898
|
function sourceForSkill(skill) {
|
|
3916
3899
|
return skill.availableSources?.find((s) => s.primary)?.name ?? DEFAULT_PUBLIC_SOURCE_NAME;
|
|
3917
3900
|
}
|
|
3918
|
-
function addToDomainSelections(selections, domain, category, skillId) {
|
|
3919
|
-
const categorySelections = selections[domain] ??= {};
|
|
3920
|
-
const skillList = categorySelections[category] ??= [];
|
|
3921
|
-
if (!skillList.includes(skillId)) skillList.push(skillId);
|
|
3922
|
-
}
|
|
3923
3901
|
function addToAgentStack(stack, agent, category, assignment) {
|
|
3924
3902
|
const agentStack = stack[agent] ??= {};
|
|
3925
3903
|
const assignments = agentStack[category] ??= [];
|
|
@@ -3968,8 +3946,8 @@ function unwritableAssignmentsError(assignments) {
|
|
|
3968
3946
|
"Re-share it with each sub-agent above pinned to the project, or each skill above at global scope."
|
|
3969
3947
|
].join("\n");
|
|
3970
3948
|
}
|
|
3971
|
-
function
|
|
3972
|
-
const
|
|
3949
|
+
function seedToInstallSelection(payload, catalog) {
|
|
3950
|
+
const domains = /* @__PURE__ */ new Set();
|
|
3973
3951
|
const assignedStack = {};
|
|
3974
3952
|
const skills = [];
|
|
3975
3953
|
const skippedSkillIds = [];
|
|
@@ -3986,7 +3964,7 @@ function seedToWizardResult(payload, catalog) {
|
|
|
3986
3964
|
}
|
|
3987
3965
|
const id = skillId;
|
|
3988
3966
|
const category = skill.category;
|
|
3989
|
-
|
|
3967
|
+
domains.add(domain);
|
|
3990
3968
|
skills.push({
|
|
3991
3969
|
id,
|
|
3992
3970
|
scope: entry.scope,
|
|
@@ -4034,11 +4012,7 @@ function seedToWizardResult(payload, catalog) {
|
|
|
4034
4012
|
...payload.description !== void 0 && {
|
|
4035
4013
|
description: payload.description
|
|
4036
4014
|
},
|
|
4037
|
-
|
|
4038
|
-
selectedDomains: orderDomains(typedKeys2(domainSelections)),
|
|
4039
|
-
// The skipped ids came off the wire and are reported directly; no saved entry was removed.
|
|
4040
|
-
unresolvableSkillIds: [],
|
|
4041
|
-
cancelled: false,
|
|
4015
|
+
selectedDomains: orderDomains([...domains]),
|
|
4042
4016
|
// Revalidated: the payload was consistent against the authoring app's catalog, not this one.
|
|
4043
4017
|
validation: validateSelection(
|
|
4044
4018
|
skills.map((skill) => skill.id),
|
|
@@ -4458,7 +4432,7 @@ var PROJECT_CONFIG_INTERFACE_AFTER = `export interface ProjectConfig {
|
|
|
4458
4432
|
/** Agents source path or URL (when agents come from a different source than skills) */
|
|
4459
4433
|
agentsSource?: string
|
|
4460
4434
|
|
|
4461
|
-
/** Selected domains
|
|
4435
|
+
/** Selected domains */
|
|
4462
4436
|
selectedDomains?: Domain[]
|
|
4463
4437
|
|
|
4464
4438
|
/** Branding overrides for white-labeling the CLI */
|
|
@@ -6128,7 +6102,7 @@ function wereScopeCompatible(priorSkillScope, priorAgentScope) {
|
|
|
6128
6102
|
return priorSkillScope !== void 0 && priorAgentScope !== void 0 && isScopePairCompatible(priorSkillScope, priorAgentScope);
|
|
6129
6103
|
}
|
|
6130
6104
|
function resolveStackProperty(generated, assigned) {
|
|
6131
|
-
return generated
|
|
6105
|
+
return generated === void 0 ? void 0 : assigned;
|
|
6132
6106
|
}
|
|
6133
6107
|
function resolveDescription(loadedStack, shared) {
|
|
6134
6108
|
return loadedStack === null ? shared : loadedStack.description;
|
|
@@ -6143,22 +6117,22 @@ async function loadCuratedStack(projectDir, projectStack) {
|
|
|
6143
6117
|
async function loadGlobalStack() {
|
|
6144
6118
|
return (await loadInstalledConfig(os10.homedir()))?.config.stack;
|
|
6145
6119
|
}
|
|
6146
|
-
async function buildInstallConfig(
|
|
6147
|
-
const skillIds = unique4(
|
|
6120
|
+
async function buildInstallConfig(selection, sourceResult, projectDir) {
|
|
6121
|
+
const skillIds = unique4(selection.skills.map((s) => s.id));
|
|
6148
6122
|
verbose(
|
|
6149
|
-
`buildInstallConfig: selectedStackId='${
|
|
6123
|
+
`buildInstallConfig: selectedStackId='${selection.selectedStackId}', skills=[${skillIds.join(", ")}], selectedAgents=[${selection.selectedAgents.join(", ")}]`
|
|
6150
6124
|
);
|
|
6151
|
-
const loadedStack = await loadSelectedStack(
|
|
6125
|
+
const loadedStack = await loadSelectedStack(selection.selectedStackId, sourceResult);
|
|
6152
6126
|
const existing = await loadProjectConfig(projectDir);
|
|
6153
6127
|
const existingStack = await loadCuratedStack(projectDir, existing?.config.stack);
|
|
6154
6128
|
const options = generatorOptionsFor(
|
|
6155
|
-
|
|
6129
|
+
selection,
|
|
6156
6130
|
existing?.config,
|
|
6157
6131
|
stackToPreserve(loadedStack, existingStack)
|
|
6158
6132
|
);
|
|
6159
6133
|
const generated = generateProjectConfigFromSkills(configNameFor(projectDir), skillIds, options);
|
|
6160
|
-
const stack = resolveStackProperty(generated.stack,
|
|
6161
|
-
const description = resolveDescription(loadedStack,
|
|
6134
|
+
const stack = resolveStackProperty(generated.stack, selection.assignedStack);
|
|
6135
|
+
const description = resolveDescription(loadedStack, selection.description);
|
|
6162
6136
|
const localConfig = {
|
|
6163
6137
|
...generated,
|
|
6164
6138
|
...stack && { stack },
|
|
@@ -6186,30 +6160,30 @@ function stackToPreserve(loadedStack, curatedStack) {
|
|
|
6186
6160
|
if (loadedStack === null) return curatedStack;
|
|
6187
6161
|
return { ...buildStackProperty(loadedStack), ...curatedStack };
|
|
6188
6162
|
}
|
|
6189
|
-
function generatorOptionsFor(
|
|
6163
|
+
function generatorOptionsFor(selection, persisted, existingStack) {
|
|
6190
6164
|
return {
|
|
6191
|
-
skillConfigs:
|
|
6192
|
-
agentConfigs:
|
|
6165
|
+
skillConfigs: selection.skills,
|
|
6166
|
+
agentConfigs: selection.agentConfigs,
|
|
6193
6167
|
existingStack,
|
|
6194
|
-
newlyAddedSkillIds: computeNewlyAddedSkillIds(
|
|
6168
|
+
newlyAddedSkillIds: computeNewlyAddedSkillIds(selection.skills, persisted?.skills),
|
|
6195
6169
|
scopeEligibilityGained: computeScopeEligibilityGained(
|
|
6196
|
-
|
|
6197
|
-
|
|
6170
|
+
selection.skills,
|
|
6171
|
+
selection.agentConfigs,
|
|
6198
6172
|
persisted?.skills,
|
|
6199
6173
|
persisted?.agents
|
|
6200
6174
|
),
|
|
6201
|
-
...
|
|
6202
|
-
selectedAgents:
|
|
6175
|
+
...selection.selectedAgents.length > 0 && {
|
|
6176
|
+
selectedAgents: selection.selectedAgents
|
|
6203
6177
|
}
|
|
6204
6178
|
};
|
|
6205
6179
|
}
|
|
6206
6180
|
function stackSizeForLog(stack) {
|
|
6207
6181
|
return stack ? `${Object.keys(stack).length} agents` : "UNDEFINED";
|
|
6208
6182
|
}
|
|
6209
|
-
function setConfigMetadata(config,
|
|
6183
|
+
function setConfigMetadata(config, selection, sourceResult, sourceFlag) {
|
|
6210
6184
|
const result = { ...config };
|
|
6211
|
-
if (
|
|
6212
|
-
result.selectedDomains =
|
|
6185
|
+
if (selection.selectedDomains.length > 0) {
|
|
6186
|
+
result.selectedDomains = selection.selectedDomains;
|
|
6213
6187
|
}
|
|
6214
6188
|
if (sourceFlag) {
|
|
6215
6189
|
result.marketplace = sourceFlag;
|
|
@@ -6221,10 +6195,10 @@ function setConfigMetadata(config, wizardResult, sourceResult, sourceFlag) {
|
|
|
6221
6195
|
}
|
|
6222
6196
|
return result;
|
|
6223
6197
|
}
|
|
6224
|
-
async function buildAndMergeConfig(
|
|
6225
|
-
const { config } = await buildInstallConfig(
|
|
6198
|
+
async function buildAndMergeConfig(selection, sourceResult, projectDir, sourceFlag, authoritativeScope) {
|
|
6199
|
+
const { config } = await buildInstallConfig(selection, sourceResult, projectDir);
|
|
6226
6200
|
verbose(`buildAndMergeConfig: before merge \u2014 stack=${stackSizeForLog(config.stack)}`);
|
|
6227
|
-
const configWithMetadata = setConfigMetadata(config,
|
|
6201
|
+
const configWithMetadata = setConfigMetadata(config, selection, sourceResult, sourceFlag);
|
|
6228
6202
|
const result = await mergeWithExistingConfig(configWithMetadata, {
|
|
6229
6203
|
projectDir,
|
|
6230
6204
|
...authoritativeScope !== void 0 && { authoritativeScope }
|
|
@@ -6958,7 +6932,7 @@ function hostAt(root) {
|
|
|
6958
6932
|
|
|
6959
6933
|
// src/cli/lib/installation/mode-migrator.ts
|
|
6960
6934
|
function ejectCopyFailureError(failedCount) {
|
|
6961
|
-
return `Failed to copy ${failedCount} skill(s) for eject. Eject intent could not be honored. Check that the destination skills directory is writable, then
|
|
6935
|
+
return `Failed to copy ${failedCount} skill(s) for eject. Eject intent could not be honored. Check that the destination skills directory is writable, then apply the same id again with '${CLI_INVOKE_COMMAND} edit --from <id>' \u2014 or switch the affected skills back to plugin mode.`;
|
|
6962
6936
|
}
|
|
6963
6937
|
function detectMigrations(oldSkills, newSkills) {
|
|
6964
6938
|
const oldById = new Map(oldSkills.map((s) => [s.id, s]));
|
|
@@ -7466,13 +7440,13 @@ async function loadSkillsOfPlugin({
|
|
|
7466
7440
|
}
|
|
7467
7441
|
}
|
|
7468
7442
|
function mergeInPluginOrder(perPluginSkills) {
|
|
7469
|
-
const
|
|
7443
|
+
const allSkills = {};
|
|
7470
7444
|
for (const pluginSkills of perPluginSkills) {
|
|
7471
7445
|
for (const [id, skill] of typedEntries(pluginSkills)) {
|
|
7472
|
-
if (skill)
|
|
7446
|
+
if (skill) allSkills[id] = skill;
|
|
7473
7447
|
}
|
|
7474
7448
|
}
|
|
7475
|
-
return
|
|
7449
|
+
return allSkills;
|
|
7476
7450
|
}
|
|
7477
7451
|
async function listPluginNames(projectDir) {
|
|
7478
7452
|
try {
|
|
@@ -7703,66 +7677,25 @@ async function extractLocalSkill(localSkillsPath, skillDirName) {
|
|
|
7703
7677
|
|
|
7704
7678
|
// src/cli/lib/skills/unresolved-skill-entries.ts
|
|
7705
7679
|
import path26 from "path";
|
|
7706
|
-
async function findUnusableSavedSkillMetadata(
|
|
7707
|
-
const
|
|
7708
|
-
|
|
7709
|
-
}
|
|
7710
|
-
async function unresolvedSkillRemovalReasons(unresolvedIds, savedSkills, projectDir, sourceLabel) {
|
|
7711
|
-
const classified = await classifyUnresolvedSkills(unresolvedIds, savedSkills, projectDir);
|
|
7712
|
-
return new Map(
|
|
7713
|
-
classified.flatMap(({ id, fate }) => {
|
|
7714
|
-
const reason = removalReason(id, fate, sourceLabel);
|
|
7715
|
-
return reason === null ? [] : [[id, reason]];
|
|
7716
|
-
})
|
|
7717
|
-
);
|
|
7718
|
-
}
|
|
7719
|
-
async function classifyUnresolvedSkills(unresolvedIds, savedSkills, projectDir) {
|
|
7720
|
-
return Promise.all(
|
|
7721
|
-
unresolvedIds.map(async (id) => {
|
|
7722
|
-
const saved = savedSkills.find((entry) => entry.id === id);
|
|
7723
|
-
return { id, fate: await classifySavedSkill(id, saved, projectDir) };
|
|
7724
|
-
})
|
|
7680
|
+
async function findUnusableSavedSkillMetadata(savedSkills, projectDir) {
|
|
7681
|
+
const verdicts = await Promise.all(
|
|
7682
|
+
savedSkills.map((saved) => unusableMetadataOf(saved, projectDir))
|
|
7725
7683
|
);
|
|
7684
|
+
return verdicts.filter((verdict) => verdict !== null);
|
|
7726
7685
|
}
|
|
7727
|
-
async function
|
|
7728
|
-
if (saved
|
|
7729
|
-
const
|
|
7730
|
-
if (!await
|
|
7731
|
-
const metadataPath = path26.join(skillDir, STANDARD_FILES.METADATA_YAML);
|
|
7732
|
-
if (!await fileExists(metadataPath)) return { kind: "not-installed-there", skillDir };
|
|
7686
|
+
async function unusableMetadataOf(saved, projectDir) {
|
|
7687
|
+
if (!claimsLocalCopy(saved)) return null;
|
|
7688
|
+
const metadataPath = installedMetadataPath(saved, projectDir);
|
|
7689
|
+
if (!await fileExists(metadataPath)) return null;
|
|
7733
7690
|
const read = await readSkillMetadata(metadataPath);
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
return
|
|
7742
|
-
}
|
|
7743
|
-
async function skillMdNames(skillDir, id) {
|
|
7744
|
-
const skillMdPath = path26.join(skillDir, STANDARD_FILES.SKILL_MD);
|
|
7745
|
-
if (!await fileExists(skillMdPath)) return false;
|
|
7746
|
-
const frontmatter = parseFrontmatter(await readFile(skillMdPath), skillMdPath);
|
|
7747
|
-
return frontmatter?.name === id;
|
|
7748
|
-
}
|
|
7749
|
-
function removalReason(id, fate, sourceLabel) {
|
|
7750
|
-
switch (fate.kind) {
|
|
7751
|
-
case "dropped-by-source":
|
|
7752
|
-
return `not present in ${sourceLabel}`;
|
|
7753
|
-
case "files-gone":
|
|
7754
|
-
return `skill files no longer exist at ${fate.skillDir}`;
|
|
7755
|
-
case "not-installed-there":
|
|
7756
|
-
return `no skill named '${id}' is installed at ${fate.skillDir}`;
|
|
7757
|
-
case "unplaceable-category":
|
|
7758
|
-
return `installed at ${fate.skillDir}, but its category '${fate.category}' is not one this source knows`;
|
|
7759
|
-
case "unusable-metadata":
|
|
7760
|
-
return null;
|
|
7761
|
-
default: {
|
|
7762
|
-
const exhaustive = fate;
|
|
7763
|
-
return exhaustive;
|
|
7764
|
-
}
|
|
7765
|
-
}
|
|
7691
|
+
return read.usable ? null : { skillDirName: saved.id, metadataPath, reason: read.reason };
|
|
7692
|
+
}
|
|
7693
|
+
function claimsLocalCopy(saved) {
|
|
7694
|
+
return !saved.excluded && saved.origin === EJECT_SOURCE;
|
|
7695
|
+
}
|
|
7696
|
+
function installedMetadataPath(saved, projectDir) {
|
|
7697
|
+
const { skillsDir: skillsDir2 } = resolveInstallPaths(projectDir, saved.scope);
|
|
7698
|
+
return path26.join(skillsDir2, saved.id, STANDARD_FILES.METADATA_YAML);
|
|
7766
7699
|
}
|
|
7767
7700
|
|
|
7768
7701
|
// src/cli/lib/skills/local-skill-mover.ts
|
|
@@ -7821,10 +7754,6 @@ async function migrateLocalSkillScope(skillId, fromScope, projectDir) {
|
|
|
7821
7754
|
}
|
|
7822
7755
|
verbose(`Migrated skill '${skillId}' from ${fromScope} to ${toScope}`);
|
|
7823
7756
|
}
|
|
7824
|
-
async function foldLocalSkillIntoGlobal(projectDir, skillId) {
|
|
7825
|
-
await deleteLocalSkill(projectDir, skillId, "global");
|
|
7826
|
-
await migrateLocalSkillScope(skillId, "project", projectDir);
|
|
7827
|
-
}
|
|
7828
7757
|
|
|
7829
7758
|
// src/cli/lib/matrix/matrix-loader.ts
|
|
7830
7759
|
import { parse as parseYaml5 } from "yaml";
|
|
@@ -8123,233 +8052,6 @@ function buildResolvedSkill(skill, _categories, relationships, slugMap) {
|
|
|
8123
8052
|
};
|
|
8124
8053
|
}
|
|
8125
8054
|
|
|
8126
|
-
// src/cli/lib/matrix/matrix-resolver.ts
|
|
8127
|
-
import { groupBy as groupBy4 } from "remeda";
|
|
8128
|
-
function getLabel(skill) {
|
|
8129
|
-
return stripTerminalControls(skill.displayName);
|
|
8130
|
-
}
|
|
8131
|
-
function joinWithConjunction(items, conjunction) {
|
|
8132
|
-
if (items.length <= 1) return items[0] ?? "";
|
|
8133
|
-
if (items.length === 2) return `${items[0]} ${conjunction} ${items[1]}`;
|
|
8134
|
-
return `${items.slice(0, -1).join(", ")} ${conjunction} ${items[items.length - 1]}`;
|
|
8135
|
-
}
|
|
8136
|
-
function initializeSelectionContext(currentSelections) {
|
|
8137
|
-
const resolvedSelections = currentSelections.map((s) => getSkillById(s).id);
|
|
8138
|
-
const selectedSet = new Set(resolvedSelections);
|
|
8139
|
-
return { resolvedSelections, selectedSet };
|
|
8140
|
-
}
|
|
8141
|
-
function toSelectionFacts(source) {
|
|
8142
|
-
return {
|
|
8143
|
-
skills: typedValues(source.skills).map((skill) => ({
|
|
8144
|
-
id: skill.id,
|
|
8145
|
-
categoryId: skill.category,
|
|
8146
|
-
conflictsWith: skill.conflictsWith.map((relation) => relation.skillId),
|
|
8147
|
-
discourages: skill.discourages.map((relation) => ({
|
|
8148
|
-
skillId: relation.skillId,
|
|
8149
|
-
// The one author string that leaves this module without being re-rendered: the shared
|
|
8150
|
-
// semantics carry it through and `getCellState` hands the verdict back whole, so a
|
|
8151
|
-
// discouraged cell prints exactly what was put in here. Made inert on the way in, which
|
|
8152
|
-
// is the only point on that route this package owns.
|
|
8153
|
-
reason: stripTerminalControls(relation.reason)
|
|
8154
|
-
})),
|
|
8155
|
-
requires: skill.requires.map((requirement) => ({
|
|
8156
|
-
skillIds: requirement.skillIds,
|
|
8157
|
-
needsAny: requirement.needsAny
|
|
8158
|
-
}))
|
|
8159
|
-
})),
|
|
8160
|
-
exclusiveCategoryIds: new Set(
|
|
8161
|
-
typedValues(source.categories).filter((category) => category.exclusive !== false).map((category) => category.id)
|
|
8162
|
-
)
|
|
8163
|
-
};
|
|
8164
|
-
}
|
|
8165
|
-
var boundSemantics;
|
|
8166
|
-
var boundTo;
|
|
8167
|
-
function judgeSelections(resolvedSelections) {
|
|
8168
|
-
if (!boundSemantics || boundTo !== matrix) {
|
|
8169
|
-
boundSemantics = createSelectionSemantics(toSelectionFacts(matrix));
|
|
8170
|
-
boundTo = matrix;
|
|
8171
|
-
}
|
|
8172
|
-
return boundSemantics(resolvedSelections);
|
|
8173
|
-
}
|
|
8174
|
-
function renderIncompatibility(cause) {
|
|
8175
|
-
switch (cause.kind) {
|
|
8176
|
-
case "conflict":
|
|
8177
|
-
return `conflicts with ${labelOf(cause.skillId)}`;
|
|
8178
|
-
case "unreachableRequirement": {
|
|
8179
|
-
if (cause.requirement.needsAny) {
|
|
8180
|
-
const labels = cause.requirement.skillIds.map(labelOf);
|
|
8181
|
-
return `requires ${joinWithConjunction(labels, "or")} (all conflict with current selection)`;
|
|
8182
|
-
}
|
|
8183
|
-
const lostLabels = cause.lostIds.map(labelOf);
|
|
8184
|
-
return `requires ${joinWithConjunction(lostLabels, "and")} which conflicts with current selection`;
|
|
8185
|
-
}
|
|
8186
|
-
}
|
|
8187
|
-
}
|
|
8188
|
-
function labelOf(skillId) {
|
|
8189
|
-
return getLabel(getSkillById(skillId));
|
|
8190
|
-
}
|
|
8191
|
-
function isRequirementMet(req, selectedSet) {
|
|
8192
|
-
return req.needsAny ? req.skillIds.some((id) => selectedSet.has(id)) : req.skillIds.every((id) => selectedSet.has(id));
|
|
8193
|
-
}
|
|
8194
|
-
function missingRequirementIds(req, selectedSet) {
|
|
8195
|
-
if (isRequirementMet(req, selectedSet)) return [];
|
|
8196
|
-
return req.needsAny ? [...req.skillIds] : req.skillIds.filter((id) => !selectedSet.has(id));
|
|
8197
|
-
}
|
|
8198
|
-
function getUnmetRequiredBy(skillId, currentSelections) {
|
|
8199
|
-
getSkillById(skillId);
|
|
8200
|
-
const { resolvedSelections, selectedSet } = initializeSelectionContext(currentSelections);
|
|
8201
|
-
if (selectedSet.has(skillId)) return void 0;
|
|
8202
|
-
for (const selectedId of resolvedSelections) {
|
|
8203
|
-
const selectedSkill = matrix.skills[selectedId];
|
|
8204
|
-
if (!selectedSkill) continue;
|
|
8205
|
-
for (const req of selectedSkill.requires) {
|
|
8206
|
-
if (!req.skillIds.includes(skillId)) continue;
|
|
8207
|
-
if (req.needsAny) {
|
|
8208
|
-
if (!req.skillIds.some((id) => selectedSet.has(id))) {
|
|
8209
|
-
return getLabel(selectedSkill);
|
|
8210
|
-
}
|
|
8211
|
-
} else {
|
|
8212
|
-
return getLabel(selectedSkill);
|
|
8213
|
-
}
|
|
8214
|
-
}
|
|
8215
|
-
}
|
|
8216
|
-
return void 0;
|
|
8217
|
-
}
|
|
8218
|
-
function hasUnmetRequirements(skillId, currentSelections) {
|
|
8219
|
-
return getUnmetRequirementsReason(skillId, currentSelections) !== void 0;
|
|
8220
|
-
}
|
|
8221
|
-
function getCellState(skillId, currentSelections) {
|
|
8222
|
-
const skill = getSkillById(skillId);
|
|
8223
|
-
const { resolvedSelections } = initializeSelectionContext(currentSelections);
|
|
8224
|
-
const verdict = judgeSelections(resolvedSelections).verdictOf(skill.id);
|
|
8225
|
-
return verdict.status === "incompatible" ? { status: "incompatible", reason: renderIncompatibility(verdict.cause) } : verdict;
|
|
8226
|
-
}
|
|
8227
|
-
function getUnmetRequirementsReason(skillId, currentSelections) {
|
|
8228
|
-
const skill = getSkillById(skillId);
|
|
8229
|
-
const { selectedSet } = initializeSelectionContext(currentSelections);
|
|
8230
|
-
for (const requirement of skill.requires) {
|
|
8231
|
-
const missing = missingRequirementIds(requirement, selectedSet);
|
|
8232
|
-
if (missing.length === 0) continue;
|
|
8233
|
-
const names = missing.map((id) => {
|
|
8234
|
-
const s = matrix.skills[id];
|
|
8235
|
-
return s ? getLabel(s) : stripTerminalControls(id);
|
|
8236
|
-
});
|
|
8237
|
-
return withAuthorsReason(namesTheMissing(names, requirement.needsAny), requirement.reason);
|
|
8238
|
-
}
|
|
8239
|
-
return void 0;
|
|
8240
|
-
}
|
|
8241
|
-
function namesTheMissing(names, needsAny) {
|
|
8242
|
-
return `requires ${joinWithConjunction(names, needsAny ? "or" : "and")}`;
|
|
8243
|
-
}
|
|
8244
|
-
var REASON_BUDGET = 60;
|
|
8245
|
-
function withAuthorsReason(synthesised, reason) {
|
|
8246
|
-
const stated = reason.trim();
|
|
8247
|
-
if (stated === "") return synthesised;
|
|
8248
|
-
return `${synthesised} \u2014 ${truncateText(stated, REASON_BUDGET)}`;
|
|
8249
|
-
}
|
|
8250
|
-
function unmetRequirementsReasonFor(isSelected, skillId, currentSelections) {
|
|
8251
|
-
if (!isSelected) return {};
|
|
8252
|
-
const reason = getUnmetRequirementsReason(skillId, currentSelections);
|
|
8253
|
-
return reason === void 0 ? {} : { unmetRequirementsReason: reason };
|
|
8254
|
-
}
|
|
8255
|
-
function validateConflicts(resolvedSelections) {
|
|
8256
|
-
const errors = [];
|
|
8257
|
-
for (const [index, skillAId] of resolvedSelections.entries()) {
|
|
8258
|
-
const skillA = matrix.skills[skillAId];
|
|
8259
|
-
if (!skillA) continue;
|
|
8260
|
-
for (const skillBId of resolvedSelections.slice(index + 1)) {
|
|
8261
|
-
const conflict = skillA.conflictsWith.find((c) => c.skillId === skillBId);
|
|
8262
|
-
if (conflict) {
|
|
8263
|
-
errors.push({
|
|
8264
|
-
type: "conflict",
|
|
8265
|
-
// The author's own sentence, made inert but not shortened: this message is reported on
|
|
8266
|
-
// its own line rather than into a fixed-height cell, so it needs no budget the way
|
|
8267
|
-
// `withAuthorsReason` does — only the guarantee that a terminal will print it.
|
|
8268
|
-
message: `${getLabel(skillA)} conflicts with ${getLabel(getSkillById(skillBId))}: ${stripTerminalControls(conflict.reason)}`,
|
|
8269
|
-
skills: [skillA.id, skillBId]
|
|
8270
|
-
});
|
|
8271
|
-
}
|
|
8272
|
-
}
|
|
8273
|
-
}
|
|
8274
|
-
return errors;
|
|
8275
|
-
}
|
|
8276
|
-
function validateRequirements(resolvedSelections, selectedSet) {
|
|
8277
|
-
const errors = [];
|
|
8278
|
-
for (const skillId of resolvedSelections) {
|
|
8279
|
-
const skill = matrix.skills[skillId];
|
|
8280
|
-
if (!skill) continue;
|
|
8281
|
-
for (const requirement of skill.requires) {
|
|
8282
|
-
if (requirement.needsAny) {
|
|
8283
|
-
const hasAny = requirement.skillIds.some((reqId) => selectedSet.has(reqId));
|
|
8284
|
-
if (!hasAny) {
|
|
8285
|
-
errors.push({
|
|
8286
|
-
type: "missingRequirement",
|
|
8287
|
-
message: `${getLabel(skill)} requires one of: ${requirement.skillIds.map((id) => getLabel(getSkillById(id))).join(", ")}`,
|
|
8288
|
-
skills: [skillId, ...requirement.skillIds]
|
|
8289
|
-
});
|
|
8290
|
-
}
|
|
8291
|
-
} else {
|
|
8292
|
-
const missingIds = requirement.skillIds.filter((reqId) => !selectedSet.has(reqId));
|
|
8293
|
-
if (missingIds.length > 0) {
|
|
8294
|
-
errors.push({
|
|
8295
|
-
type: "missingRequirement",
|
|
8296
|
-
message: `${getLabel(skill)} requires: ${missingIds.map((id) => getLabel(getSkillById(id))).join(", ")}`,
|
|
8297
|
-
skills: [skillId, ...missingIds]
|
|
8298
|
-
});
|
|
8299
|
-
}
|
|
8300
|
-
}
|
|
8301
|
-
}
|
|
8302
|
-
}
|
|
8303
|
-
return errors;
|
|
8304
|
-
}
|
|
8305
|
-
function validateExclusivity(resolvedSelections) {
|
|
8306
|
-
const errors = [];
|
|
8307
|
-
const validSkills = resolvedSelections.map((skillId) => ({ skillId, skill: matrix.skills[skillId] })).filter((entry) => entry.skill != null);
|
|
8308
|
-
const categorySelections = groupBy4(validSkills, (entry) => entry.skill.category);
|
|
8309
|
-
for (const [categoryId, entries] of typedEntries(categorySelections)) {
|
|
8310
|
-
if (entries.length > 1) {
|
|
8311
|
-
const skillIds = entries.map((e) => e.skillId);
|
|
8312
|
-
if (categoryId === LOCAL_PSEUDO_CATEGORY) continue;
|
|
8313
|
-
const category = matrix.categories[categoryId];
|
|
8314
|
-
if (category?.exclusive) {
|
|
8315
|
-
errors.push({
|
|
8316
|
-
type: "categoryExclusive",
|
|
8317
|
-
message: `Category "${stripTerminalControls(category.displayName)}" only allows one selection, but multiple selected: ${skillIds.map((id) => getLabel(getSkillById(id))).join(", ")}`,
|
|
8318
|
-
skills: skillIds
|
|
8319
|
-
});
|
|
8320
|
-
}
|
|
8321
|
-
}
|
|
8322
|
-
}
|
|
8323
|
-
return errors;
|
|
8324
|
-
}
|
|
8325
|
-
function validateSelection2(selections) {
|
|
8326
|
-
const { resolvedSelections, selectedSet } = initializeSelectionContext(selections);
|
|
8327
|
-
const errors = [
|
|
8328
|
-
...validateConflicts(resolvedSelections),
|
|
8329
|
-
...validateRequirements(resolvedSelections, selectedSet),
|
|
8330
|
-
...validateExclusivity(resolvedSelections)
|
|
8331
|
-
];
|
|
8332
|
-
return {
|
|
8333
|
-
valid: errors.length === 0,
|
|
8334
|
-
errors
|
|
8335
|
-
};
|
|
8336
|
-
}
|
|
8337
|
-
function getAvailableSkills(categoryId, currentSelections) {
|
|
8338
|
-
const { selectedSet } = initializeSelectionContext(currentSelections);
|
|
8339
|
-
return getSkillsByCategory(categoryId).map((skill) => {
|
|
8340
|
-
const isSelected = selectedSet.has(skill.id);
|
|
8341
|
-
return {
|
|
8342
|
-
id: skill.id,
|
|
8343
|
-
selected: isSelected,
|
|
8344
|
-
hasUnmetRequirements: isSelected && hasUnmetRequirements(skill.id, currentSelections),
|
|
8345
|
-
...unmetRequirementsReasonFor(isSelected, skill.id, currentSelections)
|
|
8346
|
-
};
|
|
8347
|
-
});
|
|
8348
|
-
}
|
|
8349
|
-
function getSkillsByCategory(categoryId) {
|
|
8350
|
-
return allSkills().filter((skill) => skill.category === categoryId);
|
|
8351
|
-
}
|
|
8352
|
-
|
|
8353
8055
|
// src/cli/lib/configuration/skill-audit.ts
|
|
8354
8056
|
var skillAudit = {
|
|
8355
8057
|
// ── B1 — web core: frameworks, meta-frameworks, routing, server state (20) ──
|
|
@@ -9892,7 +9594,7 @@ var skillAudit = {
|
|
|
9892
9594
|
batch: "shared-meta",
|
|
9893
9595
|
classification: { class: "B", frameworks: ["react"] },
|
|
9894
9596
|
sources: [
|
|
9895
|
-
'skill body self-scope (description "
|
|
9597
|
+
'skill body self-scope (description "Load when reviewing a diff that adds or changes React components or hooks"; Applies-to "Diffs that add or change React components or custom hooks"; "React PR review" auto-detection) plus a React-keyed majority (4 of 5 critical requirements, 6 of 7 patterns)'
|
|
9896
9598
|
]
|
|
9897
9599
|
},
|
|
9898
9600
|
"meta-reviewing-api-reviewing": {
|
|
@@ -9923,8 +9625,8 @@ var skillAudit = {
|
|
|
9923
9625
|
var auditVerdictsPendingApply = {};
|
|
9924
9626
|
|
|
9925
9627
|
// src/cli/lib/matrix/matrix-health-check.ts
|
|
9926
|
-
function
|
|
9927
|
-
|
|
9628
|
+
function matrixHealthIssues(matrix2) {
|
|
9629
|
+
return [
|
|
9928
9630
|
...checkCategoryDomains(matrix2),
|
|
9929
9631
|
...checkSkillCategories(matrix2),
|
|
9930
9632
|
...checkSkillRelationRefs(matrix2),
|
|
@@ -9932,6 +9634,9 @@ function checkMatrixHealth(matrix2) {
|
|
|
9932
9634
|
...checkAuditVerdictContradictions(matrix2),
|
|
9933
9635
|
...checkUnauditedSkills(matrix2)
|
|
9934
9636
|
];
|
|
9637
|
+
}
|
|
9638
|
+
function checkMatrixHealth(matrix2) {
|
|
9639
|
+
const issues = matrixHealthIssues(matrix2);
|
|
9935
9640
|
for (const issue of issues) {
|
|
9936
9641
|
warn(`[matrix] ${issue.details}`);
|
|
9937
9642
|
}
|
|
@@ -9941,7 +9646,7 @@ function checkCategoryDomains(matrix2) {
|
|
|
9941
9646
|
return typedEntries(matrix2.categories).filter(([, cat]) => cat !== void 0 && !cat.domain).map(([catId]) => ({
|
|
9942
9647
|
severity: "warning",
|
|
9943
9648
|
finding: "category-missing-domain",
|
|
9944
|
-
details: `Category '${catId}' has no domain \u2014 it won't appear
|
|
9649
|
+
details: `Category '${catId}' has no domain \u2014 it won't appear under any domain`
|
|
9945
9650
|
}));
|
|
9946
9651
|
}
|
|
9947
9652
|
function checkSkillCategories(matrix2) {
|
|
@@ -10026,7 +9731,10 @@ function checkUnauditedSkills(matrix2) {
|
|
|
10026
9731
|
}
|
|
10027
9732
|
|
|
10028
9733
|
// src/cli/lib/loading/source-loader.ts
|
|
10029
|
-
|
|
9734
|
+
function loadSkillsMatrixFromSource(options = {}) {
|
|
9735
|
+
return sayingEachWarningOnce(() => loadCatalogue(options));
|
|
9736
|
+
}
|
|
9737
|
+
async function loadCatalogue(options) {
|
|
10030
9738
|
const {
|
|
10031
9739
|
purpose = "fetch",
|
|
10032
9740
|
caller = "stored",
|
|
@@ -10269,12 +9977,6 @@ async function loadAndMergeFromBasePath(basePath, source) {
|
|
|
10269
9977
|
initializeMatrix(mergedMatrix);
|
|
10270
9978
|
const stacks = await resolveOfferedStacks(basePath, stacksRelFile, source);
|
|
10271
9979
|
mergedMatrix.suggestedStacks = stacks.map((stack) => convertStackToResolvedStack(stack));
|
|
10272
|
-
const agentDefinedDomains = domainsDeclaredBy(await loadAllAgents(basePath));
|
|
10273
|
-
const domainCount = typedKeys(agentDefinedDomains).length;
|
|
10274
|
-
if (domainCount > 0) {
|
|
10275
|
-
mergedMatrix.agentDefinedDomains = agentDefinedDomains;
|
|
10276
|
-
verbose(`Loaded ${domainCount} agent domain definition(s)`);
|
|
10277
|
-
}
|
|
10278
9980
|
return mergedMatrix;
|
|
10279
9981
|
}
|
|
10280
9982
|
async function loadSourceTaxonomy(basePath) {
|
|
@@ -10300,13 +10002,6 @@ async function loadSourceTaxonomy(basePath) {
|
|
|
10300
10002
|
}
|
|
10301
10003
|
return { categories, sourceRules };
|
|
10302
10004
|
}
|
|
10303
|
-
function domainsDeclaredBy(agents) {
|
|
10304
|
-
return typedFromEntries(
|
|
10305
|
-
typedEntries(agents).flatMap(
|
|
10306
|
-
([agentId, agentDef]) => agentDef.domain ? [[agentId, agentDef.domain]] : []
|
|
10307
|
-
)
|
|
10308
|
-
);
|
|
10309
|
-
}
|
|
10310
10005
|
var CATALOGUE_SKILL_IDS = new Set(typedKeys(BUILT_IN_MATRIX.skills));
|
|
10311
10006
|
var MAX_REPORTED_COLLISIONS = 10;
|
|
10312
10007
|
async function refuseCatalogueCollisions(basePath, source, skills) {
|
|
@@ -10460,7 +10155,6 @@ export {
|
|
|
10460
10155
|
stripTerminalControls,
|
|
10461
10156
|
truncateText,
|
|
10462
10157
|
plural,
|
|
10463
|
-
toTitleCase,
|
|
10464
10158
|
getErrorMessage,
|
|
10465
10159
|
setVerbose,
|
|
10466
10160
|
verbose,
|
|
@@ -10469,6 +10163,7 @@ export {
|
|
|
10469
10163
|
drainBuffer,
|
|
10470
10164
|
disableBuffering,
|
|
10471
10165
|
warn,
|
|
10166
|
+
sayingEachWarningOnce,
|
|
10472
10167
|
renderAgentRoleToml,
|
|
10473
10168
|
agentsLeftOutOfCodexMessage,
|
|
10474
10169
|
unexpressibleOnCodexMessage,
|
|
@@ -10527,6 +10222,7 @@ export {
|
|
|
10527
10222
|
skillMetadataUnusableDetail,
|
|
10528
10223
|
skillMetadataUnusableError,
|
|
10529
10224
|
savedSkillMetadataUnusableError,
|
|
10225
|
+
editorSkillMetadataUnusableError,
|
|
10530
10226
|
sharedConfigDestinations,
|
|
10531
10227
|
applySharedConfigHere,
|
|
10532
10228
|
shareRefusesEjectedSkills,
|
|
@@ -10541,12 +10237,11 @@ export {
|
|
|
10541
10237
|
projectCopyRemoved,
|
|
10542
10238
|
sharedConfigNeedsTerminal,
|
|
10543
10239
|
nothingInstalledToApplyTo,
|
|
10544
|
-
wizardNeedsTerminal,
|
|
10545
10240
|
uninstallNeedsTerminal,
|
|
10546
|
-
|
|
10547
|
-
marketplaceFixedAtInstall,
|
|
10241
|
+
addMarketplaceInTheEditor,
|
|
10548
10242
|
SHARED_CONFIG_ARRIVALS,
|
|
10549
10243
|
keptAsInstalledGlobally,
|
|
10244
|
+
addedToGlobalSubAgents,
|
|
10550
10245
|
authoredHereKept,
|
|
10551
10246
|
unplaceableKept,
|
|
10552
10247
|
keptUnassigned,
|
|
@@ -10580,7 +10275,6 @@ export {
|
|
|
10580
10275
|
copy,
|
|
10581
10276
|
formatZodErrors,
|
|
10582
10277
|
isRecord,
|
|
10583
|
-
isDomain,
|
|
10584
10278
|
isAgentName,
|
|
10585
10279
|
skillCategoriesFileSchema,
|
|
10586
10280
|
skillRulesFileSchema,
|
|
@@ -10606,7 +10300,6 @@ export {
|
|
|
10606
10300
|
resolveBranding,
|
|
10607
10301
|
resolvePrimarySourceEntry,
|
|
10608
10302
|
isLocalSource,
|
|
10609
|
-
isSameMarketplace,
|
|
10610
10303
|
normalizeStackRecord,
|
|
10611
10304
|
defaultUsageGuidance,
|
|
10612
10305
|
resolveAgentConfigToSkills,
|
|
@@ -10633,7 +10326,7 @@ export {
|
|
|
10633
10326
|
typedEntries2 as typedEntries,
|
|
10634
10327
|
isScopePairCompatible,
|
|
10635
10328
|
splitConfigByScope,
|
|
10636
|
-
|
|
10329
|
+
seedToInstallSelection,
|
|
10637
10330
|
mergeConfigs,
|
|
10638
10331
|
generateConfigTypesSource,
|
|
10639
10332
|
deriveCategories,
|
|
@@ -10689,16 +10382,10 @@ export {
|
|
|
10689
10382
|
printCompilationSummary,
|
|
10690
10383
|
discoverLocalSkills,
|
|
10691
10384
|
findUnusableSavedSkillMetadata,
|
|
10692
|
-
unresolvedSkillRemovalReasons,
|
|
10693
10385
|
deleteLocalSkill,
|
|
10694
10386
|
migrateLocalSkillScope,
|
|
10695
|
-
foldLocalSkillIntoGlobal,
|
|
10696
10387
|
claimSlug,
|
|
10697
|
-
|
|
10698
|
-
getCellState,
|
|
10699
|
-
validateSelection2 as validateSelection,
|
|
10700
|
-
getAvailableSkills,
|
|
10701
|
-
checkMatrixHealth,
|
|
10388
|
+
matrixHealthIssues,
|
|
10702
10389
|
generateMarketplace,
|
|
10703
10390
|
validateMarketplaceName,
|
|
10704
10391
|
validateSkillIdNamespace,
|
|
@@ -10724,4 +10411,4 @@ export {
|
|
|
10724
10411
|
detectMigrations,
|
|
10725
10412
|
executeMigration
|
|
10726
10413
|
};
|
|
10727
|
-
//# sourceMappingURL=chunk-
|
|
10414
|
+
//# sourceMappingURL=chunk-MQ6CGZNJ.js.map
|