agents-inc 0.173.0 → 0.175.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 +102 -0
- package/dist/{chunk-LJQXQTFC.js → chunk-37QFHJUW.js} +142 -13
- package/dist/chunk-37QFHJUW.js.map +1 -0
- package/dist/chunk-6HJVH27C.js +114 -0
- package/dist/chunk-6HJVH27C.js.map +1 -0
- package/dist/{chunk-ITQF35UQ.js → chunk-DQB3E2SX.js} +3 -3
- package/dist/{chunk-AARQBW5L.js → chunk-EGC7PNDI.js} +46 -32
- package/dist/chunk-EGC7PNDI.js.map +1 -0
- package/dist/{chunk-3N4FSTVX.js → chunk-EHEBN4NB.js} +2 -2
- package/dist/{chunk-EHJIQDXR.js → chunk-GNMRXXRY.js} +39 -40
- package/dist/chunk-GNMRXXRY.js.map +1 -0
- package/dist/{chunk-G7NUK3BF.js → chunk-ICHWAFAC.js} +29 -19
- package/dist/chunk-ICHWAFAC.js.map +1 -0
- package/dist/{chunk-Q4UNHVPX.js → chunk-MFCZARV2.js} +9 -9
- package/dist/chunk-MFCZARV2.js.map +1 -0
- package/dist/{chunk-SPQSNZMM.js → chunk-P5XEK7HC.js} +2 -2
- package/dist/{chunk-VR6QTK5Z.js → chunk-Q4NWATGH.js} +31 -27
- package/dist/chunk-Q4NWATGH.js.map +1 -0
- package/dist/{chunk-BRZA7ZCX.js → chunk-SI2LLEIR.js} +5 -5
- package/dist/{chunk-VSPC74SS.js → chunk-SNXEYAFP.js} +45 -30
- package/dist/chunk-SNXEYAFP.js.map +1 -0
- package/dist/{chunk-A3ZAXL5T.js → chunk-SRII2GMF.js} +3 -3
- package/dist/{chunk-7OG635DK.js → chunk-TG3SPPZY.js} +6 -2
- package/dist/{chunk-7OG635DK.js.map → chunk-TG3SPPZY.js.map} +1 -1
- package/dist/{chunk-MHAQWMNJ.js → chunk-U46LYYRA.js} +3 -6
- package/dist/{chunk-MHAQWMNJ.js.map → chunk-U46LYYRA.js.map} +1 -1
- package/dist/{chunk-3R3LHA4Q.js → chunk-XYBHH3M5.js} +2 -2
- package/dist/{chunk-F437ICEG.js → chunk-YLFKFVQP.js} +11 -11
- package/dist/chunk-YLFKFVQP.js.map +1 -0
- package/dist/{chunk-WVFBBZEP.js → chunk-YM3VEDAP.js} +698 -325
- package/dist/chunk-YM3VEDAP.js.map +1 -0
- package/dist/commands/build/marketplace.js +4 -4
- package/dist/commands/build/plugins.js +6 -6
- package/dist/commands/compile.js +16 -16
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.js +73 -78
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +84 -80
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +27 -18
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/init.js +16 -18
- package/dist/commands/list.js +42 -18
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +4 -4
- package/dist/commands/search.js +9 -9
- package/dist/commands/share.js +13 -13
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/uninstall.js +29 -27
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +17 -18
- package/dist/commands/update.js.map +1 -1
- package/dist/components/common/select-list.js +2 -2
- package/dist/components/common/skill-agent-summary.js +3 -3
- package/dist/components/common/summary-panel.js +4 -7
- package/dist/hooks/init.js +39 -26
- package/dist/hooks/init.js.map +1 -1
- package/dist/load-agent-defs-BJ4KBKBA.js +14 -0
- package/dist/{recompile-project-agents-6G6M2RS6.js → recompile-project-agents-2QTFMYDC.js} +8 -8
- package/dist/{source-loader-W7XCNKNA.js → source-loader-I6SWWDUF.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-2RTBSLSR.js +0 -82
- package/dist/chunk-2RTBSLSR.js.map +0 -1
- package/dist/chunk-AARQBW5L.js.map +0 -1
- package/dist/chunk-EHJIQDXR.js.map +0 -1
- package/dist/chunk-F437ICEG.js.map +0 -1
- package/dist/chunk-G7NUK3BF.js.map +0 -1
- package/dist/chunk-LJQXQTFC.js.map +0 -1
- package/dist/chunk-N33AKFLR.js +0 -24
- package/dist/chunk-N33AKFLR.js.map +0 -1
- package/dist/chunk-Q4UNHVPX.js.map +0 -1
- package/dist/chunk-Q6WRR4BN.js +0 -195
- package/dist/chunk-Q6WRR4BN.js.map +0 -1
- package/dist/chunk-VR6QTK5Z.js.map +0 -1
- package/dist/chunk-VSPC74SS.js.map +0 -1
- package/dist/chunk-WVFBBZEP.js.map +0 -1
- package/dist/components/common/scroll-affordance.js +0 -9
- package/dist/load-agent-defs-E67DSYTN.js +0 -14
- package/dist/source-loader-W7XCNKNA.js.map +0 -1
- /package/dist/{chunk-ITQF35UQ.js.map → chunk-DQB3E2SX.js.map} +0 -0
- /package/dist/{chunk-3N4FSTVX.js.map → chunk-EHEBN4NB.js.map} +0 -0
- /package/dist/{chunk-SPQSNZMM.js.map → chunk-P5XEK7HC.js.map} +0 -0
- /package/dist/{chunk-BRZA7ZCX.js.map → chunk-SI2LLEIR.js.map} +0 -0
- /package/dist/{chunk-A3ZAXL5T.js.map → chunk-SRII2GMF.js.map} +0 -0
- /package/dist/{chunk-3R3LHA4Q.js.map → chunk-XYBHH3M5.js.map} +0 -0
- /package/dist/{components/common/scroll-affordance.js.map → load-agent-defs-BJ4KBKBA.js.map} +0 -0
- /package/dist/{recompile-project-agents-6G6M2RS6.js.map → recompile-project-agents-2QTFMYDC.js.map} +0 -0
- /package/dist/{load-agent-defs-E67DSYTN.js.map → source-loader-I6SWWDUF.js.map} +0 -0
package/dist/hooks/init.js
CHANGED
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runDashboardFlow
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-EGC7PNDI.js";
|
|
5
|
+
import "../chunk-XYBHH3M5.js";
|
|
6
|
+
import "../chunk-P5XEK7HC.js";
|
|
7
|
+
import "../chunk-SRII2GMF.js";
|
|
8
8
|
import "../chunk-OZXAJNLA.js";
|
|
9
9
|
import "../chunk-P6CYS4JK.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-EHJIQDXR.js";
|
|
10
|
+
import "../chunk-6HJVH27C.js";
|
|
11
|
+
import "../chunk-EHEBN4NB.js";
|
|
12
|
+
import "../chunk-SNXEYAFP.js";
|
|
13
|
+
import "../chunk-Q4NWATGH.js";
|
|
14
|
+
import "../chunk-DQB3E2SX.js";
|
|
15
|
+
import "../chunk-SI2LLEIR.js";
|
|
16
|
+
import "../chunk-GNMRXXRY.js";
|
|
18
17
|
import "../chunk-KIK5EZYD.js";
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-2RTBSLSR.js";
|
|
18
|
+
import "../chunk-ICHWAFAC.js";
|
|
21
19
|
import {
|
|
22
|
-
EXIT_CODES
|
|
23
|
-
|
|
20
|
+
EXIT_CODES,
|
|
21
|
+
providerNamedIn
|
|
22
|
+
} from "../chunk-37QFHJUW.js";
|
|
24
23
|
import {
|
|
24
|
+
detectInstallations,
|
|
25
25
|
findConfigLoadFailures,
|
|
26
|
+
forgetTheProviderChosenForThisRun,
|
|
26
27
|
installationConfigsUnreadable,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
isHomeDirectory,
|
|
29
|
+
providerInUse,
|
|
30
|
+
retiredSourceFolderIgnored,
|
|
31
|
+
rootsHoldingTheRetiredSourceFolder
|
|
32
|
+
} from "../chunk-YM3VEDAP.js";
|
|
33
|
+
import "../chunk-TG3SPPZY.js";
|
|
34
|
+
import "../chunk-U46LYYRA.js";
|
|
32
35
|
import "../chunk-GHHJYNAN.js";
|
|
33
36
|
|
|
34
37
|
// src/cli/hooks/init.ts
|
|
35
|
-
import os from "os";
|
|
36
38
|
import { flush } from "@oclif/core";
|
|
37
39
|
var hook = async function(options) {
|
|
38
|
-
|
|
40
|
+
forgetTheProviderChosenForThisRun();
|
|
41
|
+
const projectHoldsOne = await projectHoldsAnInstallation(process.cwd());
|
|
42
|
+
sayTheRetiredSourceFolderIsIgnored(process.cwd(), providerNamedIn(options.argv), projectHoldsOne);
|
|
39
43
|
if (options.id !== void 0) return;
|
|
40
44
|
const projectDir = process.cwd();
|
|
41
45
|
const unreadable = await findConfigLoadFailures(projectDir);
|
|
@@ -56,12 +60,21 @@ var hook = async function(options) {
|
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
62
|
};
|
|
59
|
-
function
|
|
60
|
-
for (const root of
|
|
61
|
-
|
|
63
|
+
function sayTheRetiredSourceFolderIsIgnored(cwd, named, projectHoldsOne) {
|
|
64
|
+
for (const root of rootsHoldingTheRetiredSourceFolder(cwd)) {
|
|
65
|
+
const provider = named ?? providerReadIn(root, cwd, projectHoldsOne);
|
|
66
|
+
process.stderr.write(`${retiredSourceFolderIgnored(root, provider)}
|
|
62
67
|
`);
|
|
63
68
|
}
|
|
64
69
|
}
|
|
70
|
+
function providerReadIn(root, cwd, projectHoldsOne) {
|
|
71
|
+
if (!isHomeDirectory(root)) return providerInUse(root);
|
|
72
|
+
return providerInUse(projectHoldsOne ? cwd : root);
|
|
73
|
+
}
|
|
74
|
+
async function projectHoldsAnInstallation(cwd) {
|
|
75
|
+
const found = await detectInstallations(cwd);
|
|
76
|
+
return found.some((installation) => installation.scope === "project");
|
|
77
|
+
}
|
|
65
78
|
async function endRun(code) {
|
|
66
79
|
await flush();
|
|
67
80
|
process.exit(code);
|
package/dist/hooks/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/hooks/init.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/cli/hooks/init.ts"],"sourcesContent":["import { flush, type Hook } from \"@oclif/core\";\nimport { runDashboardFlow } from \"../commands/init.js\";\nimport type { Provider } from \"../consts.js\";\nimport { findConfigLoadFailures } from \"../lib/configuration/project-config.js\";\nimport { detectInstallations } from \"../lib/installation/detect-installations.js\";\nimport {\n forgetTheProviderChosenForThisRun,\n providerInUse,\n rootsHoldingTheRetiredSourceFolder,\n} from \"../lib/installation/install-layout.js\";\nimport { isHomeDirectory } from \"../lib/installation/is-home-directory.js\";\nimport { providerNamedIn } from \"../lib/installation/provider-flag.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { installationConfigsUnreadable, retiredSourceFolderIgnored } from \"../utils/messages.js\";\n\nconst hook: Hook<\"init\"> = async function (options) {\n forgetTheProviderChosenForThisRun();\n // Before any path is read: `providerInUse` cannot load a config, so the roster records which\n // of the project's declare nothing.\n const projectHoldsOne = await projectHoldsAnInstallation(process.cwd());\n sayTheRetiredSourceFolderIsIgnored(process.cwd(), providerNamedIn(options.argv), projectHoldsOne);\n\n // A named command runs as named; no command is the dashboard.\n if (options.id !== undefined) return;\n\n const projectDir = process.cwd();\n // Checked here: oclif's hook runner swallows a load error thrown inside the dashboard.\n const unreadable = await findConfigLoadFailures(projectDir);\n if (unreadable.length > 0) {\n this.error(installationConfigsUnreadable(unreadable), { exit: EXIT_CODES.ERROR });\n }\n\n const dashboard = await runDashboardFlow(projectDir, options.config);\n switch (dashboard) {\n case \"cancelled\":\n return this.error(\"Cancelled\", { exit: EXIT_CODES.CANCELLED });\n case \"shown\":\n return endRun(EXIT_CODES.SUCCESS);\n case \"not-installed\":\n // oclif goes on to print the root help.\n return;\n default: {\n const _exhaustive: never = dashboard;\n return _exhaustive;\n }\n }\n};\n\n/**\n * Before any command's output, on stderr so piped output is unchanged; nothing reads the folder.\n * Flags are not parsed yet, so the provider a run names is read off its arguments: that run reads\n * the named provider's folder in every root.\n */\nfunction sayTheRetiredSourceFolderIsIgnored(\n cwd: string,\n named: Provider | undefined,\n projectHoldsOne: boolean,\n): void {\n for (const root of rootsHoldingTheRetiredSourceFolder(cwd)) {\n const provider = named ?? providerReadIn(root, cwd, projectHoldsOne);\n process.stderr.write(`${retiredSourceFolderIgnored(root, provider)}\\n`);\n }\n}\n\n/**\n * A run naming no provider reads a project with its own tool, and HOME with the project's, as it\n * reads HOME's config; a project holding no installation leaves the run on HOME's own.\n */\nfunction providerReadIn(root: string, cwd: string, projectHoldsOne: boolean): Provider {\n if (!isHomeDirectory(root)) return providerInUse(root);\n return providerInUse(projectHoldsOne ? cwd : root);\n}\n\n/** A project config declaring nothing is not an installation, so it is not counted here. */\nasync function projectHoldsAnInstallation(cwd: string): Promise<boolean> {\n const found = await detectInstallations(cwd);\n return found.some((installation) => installation.scope === \"project\");\n}\n\n/** Not `this.exit(0)`: oclif swallows an exit 0 from a hook and goes on to print the root help. */\nasync function endRun(code: number): Promise<never> {\n await flush();\n process.exit(code);\n}\n\nexport default hook;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAwB;AAejC,IAAM,OAAqB,eAAgB,SAAS;AAClD,oCAAkC;AAGlC,QAAM,kBAAkB,MAAM,2BAA2B,QAAQ,IAAI,CAAC;AACtE,qCAAmC,QAAQ,IAAI,GAAG,gBAAgB,QAAQ,IAAI,GAAG,eAAe;AAGhG,MAAI,QAAQ,OAAO,OAAW;AAE9B,QAAM,aAAa,QAAQ,IAAI;AAE/B,QAAM,aAAa,MAAM,uBAAuB,UAAU;AAC1D,MAAI,WAAW,SAAS,GAAG;AACzB,SAAK,MAAM,8BAA8B,UAAU,GAAG,EAAE,MAAM,WAAW,MAAM,CAAC;AAAA,EAClF;AAEA,QAAM,YAAY,MAAM,iBAAiB,YAAY,QAAQ,MAAM;AACnE,UAAQ,WAAW;AAAA,IACjB,KAAK;AACH,aAAO,KAAK,MAAM,aAAa,EAAE,MAAM,WAAW,UAAU,CAAC;AAAA,IAC/D,KAAK;AACH,aAAO,OAAO,WAAW,OAAO;AAAA,IAClC,KAAK;AAEH;AAAA,IACF,SAAS;AACP,YAAM,cAAqB;AAC3B,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAOA,SAAS,mCACP,KACA,OACA,iBACM;AACN,aAAW,QAAQ,mCAAmC,GAAG,GAAG;AAC1D,UAAM,WAAW,SAAS,eAAe,MAAM,KAAK,eAAe;AACnE,YAAQ,OAAO,MAAM,GAAG,2BAA2B,MAAM,QAAQ,CAAC;AAAA,CAAI;AAAA,EACxE;AACF;AAMA,SAAS,eAAe,MAAc,KAAa,iBAAoC;AACrF,MAAI,CAAC,gBAAgB,IAAI,EAAG,QAAO,cAAc,IAAI;AACrD,SAAO,cAAc,kBAAkB,MAAM,IAAI;AACnD;AAGA,eAAe,2BAA2B,KAA+B;AACvE,QAAM,QAAQ,MAAM,oBAAoB,GAAG;AAC3C,SAAO,MAAM,KAAK,CAAC,iBAAiB,aAAa,UAAU,SAAS;AACtE;AAGA,eAAe,OAAO,MAA8B;AAClD,QAAM,MAAM;AACZ,UAAQ,KAAK,IAAI;AACnB;AAEA,IAAO,eAAQ;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
loadAgentDefs
|
|
4
|
+
} from "./chunk-DQB3E2SX.js";
|
|
5
|
+
import "./chunk-SI2LLEIR.js";
|
|
6
|
+
import "./chunk-GNMRXXRY.js";
|
|
7
|
+
import "./chunk-YM3VEDAP.js";
|
|
8
|
+
import "./chunk-TG3SPPZY.js";
|
|
9
|
+
import "./chunk-U46LYYRA.js";
|
|
10
|
+
import "./chunk-GHHJYNAN.js";
|
|
11
|
+
export {
|
|
12
|
+
loadAgentDefs
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=load-agent-defs-BJ4KBKBA.js.map
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
compileAgents,
|
|
4
4
|
discoverInstalledSkills,
|
|
5
5
|
withCatalogueSeatedFor
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Q4NWATGH.js";
|
|
7
7
|
import {
|
|
8
8
|
loadAgentDefs
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-DQB3E2SX.js";
|
|
10
|
+
import "./chunk-SI2LLEIR.js";
|
|
11
|
+
import "./chunk-GNMRXXRY.js";
|
|
12
12
|
import {
|
|
13
13
|
getErrorMessage,
|
|
14
14
|
resolveInstallPaths
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-YM3VEDAP.js";
|
|
16
|
+
import "./chunk-TG3SPPZY.js";
|
|
17
|
+
import "./chunk-U46LYYRA.js";
|
|
18
18
|
import "./chunk-GHHJYNAN.js";
|
|
19
19
|
|
|
20
20
|
// src/cli/lib/operations/project/recompile-project-agents.ts
|
|
@@ -62,4 +62,4 @@ function summarizeRecompiles(outcomes) {
|
|
|
62
62
|
export {
|
|
63
63
|
recompilePropagatedProjectAgents
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=recompile-project-agents-
|
|
65
|
+
//# sourceMappingURL=recompile-project-agents-2QTFMYDC.js.map
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
loadMarketplaceMatrix,
|
|
6
6
|
loadSkillsMatrixFromSource,
|
|
7
7
|
mergeLocalSkillsIntoMatrix
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-YM3VEDAP.js";
|
|
9
|
+
import "./chunk-TG3SPPZY.js";
|
|
10
|
+
import "./chunk-U46LYYRA.js";
|
|
11
11
|
import "./chunk-GHHJYNAN.js";
|
|
12
12
|
export {
|
|
13
13
|
MarketplaceManifestRequiredError,
|
|
@@ -16,4 +16,4 @@ export {
|
|
|
16
16
|
loadSkillsMatrixFromSource,
|
|
17
17
|
mergeLocalSkillsIntoMatrix
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=source-loader-
|
|
19
|
+
//# sourceMappingURL=source-loader-I6SWWDUF.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agents-inc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.175.0",
|
|
4
4
|
"description": "CLI for managing Agents Inc. skills, stacks, and agents for Claude Code",
|
|
5
5
|
"//generate": "Runs all four generators in dependency order; the :check variants stay separate because CI runs different subsets.",
|
|
6
6
|
"//no-shared-vitest-config": "A three-project suite with globals on and its own setup and timeouts; the shared single-project, globals-off config would contradict it.",
|
package/dist/chunk-2RTBSLSR.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
chooseProviderForThisRun,
|
|
4
|
-
detectInstallations
|
|
5
|
-
} from "./chunk-WVFBBZEP.js";
|
|
6
|
-
import {
|
|
7
|
-
CLI_INVOKE_COMMAND,
|
|
8
|
-
EDITOR_URL,
|
|
9
|
-
PROVIDERS
|
|
10
|
-
} from "./chunk-MHAQWMNJ.js";
|
|
11
|
-
|
|
12
|
-
// src/cli/lib/installation/provider-flag.ts
|
|
13
|
-
import os from "os";
|
|
14
|
-
import { Flags } from "@oclif/core";
|
|
15
|
-
function providerFlag() {
|
|
16
|
-
return Flags.string({
|
|
17
|
-
description: "Which provider's installation this run is about",
|
|
18
|
-
helpValue: `<${PROVIDERS.join("|")}>`,
|
|
19
|
-
options: [...PROVIDERS]
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function providerNamedBy(flagValue) {
|
|
23
|
-
if (flagValue === void 0) return void 0;
|
|
24
|
-
return PROVIDERS.find((provider) => provider === flagValue);
|
|
25
|
-
}
|
|
26
|
-
function providerNeedsAConfigurationToInstall() {
|
|
27
|
-
return `--provider names which installation to create and needs the configuration to create it from, so it is only meaningful beside --from. Build one at ${EDITOR_URL}, then run '${CLI_INVOKE_COMMAND} init --from <id> --provider <provider>'.`;
|
|
28
|
-
}
|
|
29
|
-
function ambiguousInstallation(subject, providers, scopeRoot) {
|
|
30
|
-
return `${scopeRoot} holds ${providers.length} installations \u2014 ${providers.join(" and ")} \u2014 so ${subject} cannot tell which one you mean. Name it with --provider <${providers.join("|")}>. Nothing has been changed.`;
|
|
31
|
-
}
|
|
32
|
-
async function installationsInPlay(cwd) {
|
|
33
|
-
const found = await detectInstallations(cwd);
|
|
34
|
-
const inTheProject = atScope(found, "project");
|
|
35
|
-
if (inTheProject.length > 0) return { scopeRoot: cwd, providers: providersOf(inTheProject) };
|
|
36
|
-
return { scopeRoot: os.homedir(), providers: providersOf(atScope(found, "global")) };
|
|
37
|
-
}
|
|
38
|
-
function atScope(found, scope) {
|
|
39
|
-
return found.filter((installation) => installation.scope === scope);
|
|
40
|
-
}
|
|
41
|
-
function providersOf(installations) {
|
|
42
|
-
return installations.map((installation) => installation.provider);
|
|
43
|
-
}
|
|
44
|
-
async function refuseAnAmbiguousInstallation(cwd, subject, named, onAmbiguous) {
|
|
45
|
-
if (named !== void 0) {
|
|
46
|
-
chooseProviderForThisRun(named);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const { scopeRoot, providers } = await installationsInPlay(cwd);
|
|
50
|
-
if (providers.length <= 1) return;
|
|
51
|
-
onAmbiguous(ambiguousInstallation(subject, providers, scopeRoot));
|
|
52
|
-
}
|
|
53
|
-
async function providersInPlay(cwd) {
|
|
54
|
-
return (await installationsInPlay(cwd)).providers;
|
|
55
|
-
}
|
|
56
|
-
async function installationToName(cwd, named) {
|
|
57
|
-
if (named !== void 0) return named;
|
|
58
|
-
const providers = await providersInPlay(cwd);
|
|
59
|
-
return providers.length > 1 ? providers : void 0;
|
|
60
|
-
}
|
|
61
|
-
async function ambiguityFinding(cwd) {
|
|
62
|
-
const { scopeRoot, providers } = await installationsInPlay(cwd);
|
|
63
|
-
if (providers.length <= 1) return null;
|
|
64
|
-
return ambiguousInstallation("every command that acts on one", providers, scopeRoot);
|
|
65
|
-
}
|
|
66
|
-
async function otherInstallationsInThisScope(cwd, showing) {
|
|
67
|
-
const { scopeRoot, providers } = await installationsInPlay(cwd);
|
|
68
|
-
const others = providers.filter((provider) => provider !== showing);
|
|
69
|
-
if (others.length === 0) return null;
|
|
70
|
-
return `${scopeRoot} holds ${providers.length} installations \u2014 ${providers.join(" and ")} \u2014 and this is the ${showing} one. Show another with --provider <${providers.join("|")}>.`;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export {
|
|
74
|
-
providerFlag,
|
|
75
|
-
providerNamedBy,
|
|
76
|
-
providerNeedsAConfigurationToInstall,
|
|
77
|
-
refuseAnAmbiguousInstallation,
|
|
78
|
-
installationToName,
|
|
79
|
-
ambiguityFinding,
|
|
80
|
-
otherInstallationsInThisScope
|
|
81
|
-
};
|
|
82
|
-
//# sourceMappingURL=chunk-2RTBSLSR.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/installation/provider-flag.ts"],"sourcesContent":["/**\n * `--provider`: names the installation where the folder cannot — a greenfield `init --from`, or a\n * scope holding both providers, where acting commands refuse until it is given.\n */\n\nimport os from \"os\";\n\nimport { Flags } from \"@oclif/core\";\n\nimport { PROVIDERS, EDITOR_URL, CLI_INVOKE_COMMAND, type Provider } from \"../../consts.js\";\nimport { detectInstallations, type DetectedInstallation } from \"./detect-installations.js\";\nimport { chooseProviderForThisRun } from \"./install-layout.js\";\n\n/** A factory because oclif mutates flag definitions, so commands must not share one. */\nexport function providerFlag() {\n return Flags.string({\n description: \"Which provider's installation this run is about\",\n helpValue: `<${PROVIDERS.join(\"|\")}>`,\n options: [...PROVIDERS],\n });\n}\n\n/** oclif has already rejected unlisted values; this only narrows. */\nexport function providerNamedBy(flagValue: string | undefined): Provider | undefined {\n if (flagValue === undefined) return undefined;\n return PROVIDERS.find((provider) => provider === flagValue);\n}\n\nexport function providerNeedsAConfigurationToInstall(): string {\n return (\n `--provider names which installation to create and needs the configuration to create it ` +\n `from, so it is only meaningful beside --from. Build one at ${EDITOR_URL}, then run ` +\n `'${CLI_INVOKE_COMMAND} init --from <id> --provider <provider>'.`\n );\n}\n\nfunction ambiguousInstallation(\n subject: string,\n providers: readonly Provider[],\n scopeRoot: string,\n): string {\n return (\n `${scopeRoot} holds ${providers.length} installations — ${providers.join(\" and \")} — so ` +\n `${subject} cannot tell which one you mean. Name it with --provider <${providers.join(\"|\")}>. ` +\n `Nothing has been changed.`\n );\n}\n\ntype InstallationsInPlay = {\n scopeRoot: string;\n providers: Provider[];\n};\n\n/** The project's installations, or the global ones only when the project has none. */\nasync function installationsInPlay(cwd: string): Promise<InstallationsInPlay> {\n const found = await detectInstallations(cwd);\n const inTheProject = atScope(found, \"project\");\n\n if (inTheProject.length > 0) return { scopeRoot: cwd, providers: providersOf(inTheProject) };\n return { scopeRoot: os.homedir(), providers: providersOf(atScope(found, \"global\")) };\n}\n\nfunction atScope(\n found: readonly DetectedInstallation[],\n scope: DetectedInstallation[\"scope\"],\n): DetectedInstallation[] {\n return found.filter((installation) => installation.scope === scope);\n}\n\nfunction providersOf(installations: readonly DetectedInstallation[]): Provider[] {\n return installations.map((installation) => installation.provider);\n}\n\n/**\n * A named provider is committed for the run; two installations and no flag call `onAmbiguous`\n * (the command's `this.error`); otherwise nothing happens.\n */\nexport async function refuseAnAmbiguousInstallation(\n cwd: string,\n subject: string,\n named: Provider | undefined,\n onAmbiguous: (message: string) => never,\n): Promise<void> {\n if (named !== undefined) {\n chooseProviderForThisRun(named);\n return;\n }\n\n const { scopeRoot, providers } = await installationsInPlay(cwd);\n if (providers.length <= 1) return;\n\n onAmbiguous(ambiguousInstallation(subject, providers, scopeRoot));\n}\n\n/** The non-refusing read the remedies hand a command out from, so they and the refusal agree. */\nexport async function providersInPlay(cwd: string): Promise<Provider[]> {\n return (await installationsInPlay(cwd)).providers;\n}\n\n/**\n * Which installation a handed-out acting command must name: the one the run named, else the choice\n * where two are in play, since a bare one refuses there.\n */\nexport async function installationToName(\n cwd: string,\n named: Provider | undefined,\n): Promise<Provider | Provider[] | undefined> {\n if (named !== undefined) return named;\n\n const providers = await providersInPlay(cwd);\n return providers.length > 1 ? providers : undefined;\n}\n\n/** The non-refusing form, for `doctor`. */\nexport async function ambiguityFinding(cwd: string): Promise<string | null> {\n const { scopeRoot, providers } = await installationsInPlay(cwd);\n if (providers.length <= 1) return null;\n\n return ambiguousInstallation(\"every command that acts on one\", providers, scopeRoot);\n}\n\n/** For `list`: names the other installation in the scope, or `null` when there is none. */\nexport async function otherInstallationsInThisScope(\n cwd: string,\n showing: Provider,\n): Promise<string | null> {\n const { scopeRoot, providers } = await installationsInPlay(cwd);\n const others = providers.filter((provider) => provider !== showing);\n if (others.length === 0) return null;\n\n return (\n `${scopeRoot} holds ${providers.length} installations — ${providers.join(\" and \")} — and this ` +\n `is the ${showing} one. Show another with --provider <${providers.join(\"|\")}>.`\n );\n}\n"],"mappings":";;;;;;;;;;;;AAKA,OAAO,QAAQ;AAEf,SAAS,aAAa;AAOf,SAAS,eAAe;AAC7B,SAAO,MAAM,OAAO;AAAA,IAClB,aAAa;AAAA,IACb,WAAW,IAAI,UAAU,KAAK,GAAG,CAAC;AAAA,IAClC,SAAS,CAAC,GAAG,SAAS;AAAA,EACxB,CAAC;AACH;AAGO,SAAS,gBAAgB,WAAqD;AACnF,MAAI,cAAc,OAAW,QAAO;AACpC,SAAO,UAAU,KAAK,CAAC,aAAa,aAAa,SAAS;AAC5D;AAEO,SAAS,uCAA+C;AAC7D,SACE,qJAC8D,UAAU,eACpE,kBAAkB;AAE1B;AAEA,SAAS,sBACP,SACA,WACA,WACQ;AACR,SACE,GAAG,SAAS,UAAU,UAAU,MAAM,yBAAoB,UAAU,KAAK,OAAO,CAAC,cAC9E,OAAO,6DAA6D,UAAU,KAAK,G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C,aAAa,aAAa,OAAO;AAClE,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,SACE,GAAG,SAAS,UAAU,UAAU,MAAM,yBAAoB,UAAU,KAAK,OAAO,CAAC,2BACvE,OAAO,uCAAuC,UAAU,KAAK,GAAG,CAAC;AAE/E;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/init.tsx","../src/cli/lib/permission-checker.tsx"],"sourcesContent":["import os from \"os\";\nimport React from \"react\";\n\nimport { Flags, type Interfaces } from \"@oclif/core\";\nimport { Box, Text, useApp } from \"ink\";\nimport { partition } from \"remeda\";\nimport { render } from \"../components/render.js\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport type { InstallSelection } from \"@workspace/compile/seed-to-config\";\nimport { useTerminalDimensions } from \"../components/hooks/use-terminal-dimensions.js\";\nimport { type SourceLoadResult } from \"../lib/loading/index.js\";\nimport {\n loadSource,\n sayCapturedWarnings,\n loadAgentDefs,\n copyLocalSkills,\n writeProjectConfig,\n compileAgentsAllScopes,\n compileProjectScope,\n type CompilationResult,\n type ConfigWriteResult,\n type SkillCopyResult,\n discoverInstalledSkills,\n} from \"../lib/operations/index.js\";\nimport { movedGlobalAgentInputs, type GateReport } from \"../lib/config-gate/index.js\";\nimport { fetchSeedConfig } from \"../lib/seed/fetch-seed.js\";\nimport {\n registerExternalSkills,\n writeExternalSkills,\n type ExternalSkillInstall,\n} from \"../lib/seed/external-skills.js\";\nimport { seedToInstallSelection, type SeedMapping } from \"../lib/seed/seed-to-selection.js\";\nimport {\n holdInstalledGlobal,\n installsAtHome,\n joinedStatement,\n notInstalledGlobally,\n readInstalledGlobal,\n type HeldGlobal,\n type InstalledGlobal,\n} from \"../lib/seed/seed-apply.js\";\nimport { agentChangesAmong, type AgentChange } from \"../lib/configuration/scope-diff.js\";\nimport { isActiveAt } from \"../lib/configuration/scope-predicates.js\";\nimport { summaryPanelBlock, type SummaryPanelProps } from \"../components/common/summary-panel.js\";\nimport {\n getInstallationsByProvider,\n type ProviderInstallation,\n} from \"../lib/plugins/plugin-info.js\";\nimport {\n assertNamedSourceUsable,\n isLocalSource,\n resolveBranding,\n} from \"../lib/configuration/config.js\";\nimport {\n type InstallMode,\n detectInstallation,\n detectProjectInstallation,\n deriveInstallMode,\n holdsItsOwnInstallation,\n installBaseDir,\n resolveInstallPaths,\n buildAgentScopeMap,\n isHomeDirectory,\n INSTALL_MODE_LABELS,\n INSTALL_MODE_DESCRIPTIONS,\n} from \"../lib/installation/index.js\";\nimport { hostAt } from \"../lib/hosts/host-for.js\";\nimport {\n agentCodec,\n chooseProviderForThisRun,\n providerInUse,\n relativeConfigPath,\n} from \"../lib/installation/install-layout.js\";\nimport { providerToNameAt } from \"../lib/installation/provider-to-name.js\";\nimport { hostCompileNotices } from \"../lib/hosts/host-compile-notices.js\";\nimport {\n installationToName,\n providerFlag,\n providerNamedBy,\n providerNeedsAConfigurationToInstall,\n} from \"../lib/installation/provider-flag.js\";\nimport { checkPermissions } from \"../lib/permission-checker.js\";\nimport {\n ASCII_LOGO,\n CLI_INVOKE_COMMAND,\n DEFAULT_BRANDING,\n EDITOR_ADDRESS,\n EDITOR_URL,\n EJECT_SOURCE,\n editorConfigUrl,\n type Provider,\n} from \"../consts.js\";\nimport { clearTerminalScreen } from \"../utils/terminal.js\";\nimport { SelectList, type SelectListItem } from \"../components/common/select-list.js\";\nimport { promptConfirm, promptValue } from \"../components/common/prompt-confirm.js\";\nimport { Confirm } from \"../components/common/confirm.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { openUrl } from \"../utils/open-url.js\";\nimport { plural } from \"../utils/string.js\";\nimport type {\n AgentName,\n AgentScopeConfig,\n MergedSkillsMatrix,\n SkillConfig,\n SkillId,\n SkillScope,\n} from \"../types/index.js\";\nimport { type StartupMessage } from \"../utils/logger.js\";\nimport {\n ERROR_MESSAGES,\n INCOMPLETE_WORK_RECOVERY,\n SHARED_CONFIG_ARRIVALS,\n STATUS_MESSAGES,\n addMarketplaceInTheEditor,\n agentsNotCompiled,\n applySharedConfigHere,\n carriedSkillsWritten,\n globalScopedAgentsHint,\n initSucceeded,\n keptAsInstalledGlobally,\n sharedConfigExistingInstall,\n subAgentChanged,\n} from \"../utils/messages.js\";\nimport type { SeedPayload } from \"@workspace/matrix/seed\";\n\nconst DASHBOARD_OPTIONS = [\n { label: \"Edit in the web editor\", value: \"edit\" },\n { label: \"Compile\", value: \"compile\" },\n { label: \"Doctor\", value: \"doctor\" },\n { label: \"List\", value: \"list\" },\n] as const satisfies readonly SelectListItem<string>[];\n\nconst DASHBOARD_OPTIONS_LINE = ` ${DASHBOARD_OPTIONS.map(({ label }) => `[${label}]`).join(\" \")}`;\n\ntype DashboardCommand = (typeof DASHBOARD_OPTIONS)[number][\"value\"];\n\n/** A white-labelled name replaces the logo, because the logo spells the shipped name. */\nconst DashboardTitle: React.FC<{ name: string }> = ({ name }) =>\n name === DEFAULT_BRANDING.NAME ? <Text>{ASCII_LOGO}</Text> : <Text bold>{name}</Text>;\n\ntype DashboardProps = {\n data: DashboardData;\n onSelect: (command: DashboardCommand) => void;\n onCancel: () => void;\n};\n\nexport const Dashboard: React.FC<DashboardProps> = ({ data, onSelect, onCancel }) => {\n const { exit } = useApp();\n const { rows: terminalHeight } = useTerminalDimensions();\n\n return (\n <Box flexDirection=\"column\" height={terminalHeight}>\n <Box marginBottom={1}>\n <DashboardTitle name={data.name} />\n </Box>\n <Box marginBottom={1}>\n <Text>{dashboardCountLines(data).join(\"\\n\")}</Text>\n </Box>\n <SelectList\n items={DASHBOARD_OPTIONS}\n onSelect={(command) => {\n onSelect(command);\n exit();\n }}\n onCancel={() => {\n onCancel();\n exit();\n }}\n />\n </Box>\n );\n};\n\n/**\n * Shared by the TTY and piped dashboards so the two cannot drift apart. A scope holding two\n * installations gets a named block for each, a blank line apart.\n */\nfunction dashboardCountLines({ installations }: DashboardData): string[] {\n const named = installations.length > 1;\n const blocks = installations.map((installation) => [\n ...(named ? [` Provider: ${installation.provider}`] : []),\n ...installationCountLines(installation),\n ]);\n return blankLineBetween(blocks);\n}\n\nfunction blankLineBetween(blocks: string[][]): string[] {\n return blocks.flatMap((block, index) => (index === 0 ? block : [\"\", ...block]));\n}\n\nfunction installationCountLines(installation: ProviderInstallation): string[] {\n return [\n ` Skills: ${installation.skillCount} installed`,\n ` Agents: ${installation.agentCount} compiled`,\n ` Mode: ${INSTALL_MODE_LABELS[installation.mode]}`,\n ...(installation.marketplace ? [` Marketplace: ${installation.marketplace}`] : []),\n ];\n}\n\nexport function formatDashboardText(data: DashboardData): string {\n return [data.name, \"\", ...dashboardCountLines(data), \"\", DASHBOARD_OPTIONS_LINE].join(\"\\n\");\n}\n\n/** Ctrl+C cancels the run; Escape (null) only leaves the dashboard. */\nconst DASHBOARD_INTERRUPTED = \"interrupted\";\n\ntype DashboardAnswer = DashboardCommand | typeof DASHBOARD_INTERRUPTED | null;\n\nasync function showDashboard(\n projectDir: string,\n log?: (message: string) => void,\n): Promise<DashboardAnswer> {\n const data = await getDashboardData(projectDir);\n\n if (!process.stdin.isTTY) {\n const output = log ?? console.log;\n output(formatDashboardText(data));\n return null;\n }\n\n // clearOnResolve repaints a clean terminal before unmount: the dashboard fills the height.\n const selectedCommand = await promptValue<DashboardAnswer>(\n (resolve) => (\n <Dashboard\n data={data}\n onSelect={(command) => resolve(command)}\n onCancel={() => resolve(null)}\n />\n ),\n { onExit: DASHBOARD_INTERRUPTED, clearOnResolve: true },\n );\n\n clearTerminalScreen();\n\n return selectedCommand;\n}\n\nfunction dashboardCommandArgv(command: DashboardCommand): string[] {\n return command === \"edit\" ? [\"--ui\"] : [];\n}\n\nexport type DashboardFlow = \"not-installed\" | \"shown\" | \"cancelled\";\n\n/** Never exits the process: callers decide from the {@link DashboardFlow} it answers. */\nexport async function runDashboardFlow(\n projectDir: string,\n config: Interfaces.Config,\n log?: (message: string) => void,\n): Promise<DashboardFlow> {\n const installation = await detectInstallation(projectDir);\n if (!installation) return \"not-installed\";\n\n const selectedCommand = await showDashboard(projectDir, log);\n if (selectedCommand === DASHBOARD_INTERRUPTED) return \"cancelled\";\n if (selectedCommand) {\n await config.runCommand(selectedCommand, dashboardCommandArgv(selectedCommand));\n }\n return \"shown\";\n}\n\n/** A required key, not `?`: oclif writes the key as `undefined` when the flag is not passed. */\ntype SourceFlags = { marketplace: string | undefined };\n\ntype Selection = {\n result: InstallSelection;\n sourceResult: SourceLoadResult;\n /** Where the selection was actually loaded from; a shared id may name a marketplace. */\n sourceFlags: SourceFlags;\n /** A global install's own skills, recorded as they are and never installed over. */\n installedAlready: ReadonlySet<SkillId>;\n};\n\n/** The payload names the marketplace because a skill id never says where its repository lives. */\nfunction sharedConfigSourceFlags(flags: SourceFlags, payload: SeedPayload): SourceFlags {\n return { marketplace: flags.marketplace ?? payload.marketplace };\n}\n\nexport default class Init extends BaseCommand {\n /** Resolved once in {@link install}; the closing line is printed several calls below. */\n private brandingName: string = DEFAULT_BRANDING.NAME;\n\n static summary = `Initialize ${DEFAULT_BRANDING.NAME} in this project`;\n static description = `Build a configuration in ${EDITOR_ADDRESS}, or install one by id with --from. Over an existing installation, shows its dashboard.`;\n\n static examples = [\n {\n description: \"Open the editor to build a configuration\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Install a configuration built in the editor\",\n command: \"<%= config.bin %> <%= command.id %> --from <id>\",\n },\n {\n description: \"Test local marketplace changes against a configuration built in the editor\",\n command: \"<%= config.bin %> <%= command.id %> --from <id> --marketplace ./my-marketplace\",\n },\n ];\n\n static flags = {\n marketplace: Flags.string({\n char: \"m\",\n description:\n \"With --from, install from this marketplace instead of the one the configuration names. Without --from, open the editor and say how to add it there\",\n required: false,\n }),\n from: Flags.string({\n description: \"Install a configuration shared from agentsinc.sh by its id\",\n helpValue: \"<id>\",\n }),\n ui: Flags.boolean({\n description: `Open ${EDITOR_ADDRESS} on the id --from names, or on the catalogue — what a bare init does where nothing is installed`,\n default: false,\n }),\n provider: providerFlag(),\n };\n\n /** The exit code is decided once, after every path through {@link install} has ended. */\n async run(): Promise<void> {\n await this.install();\n this.exitIfWorkIncomplete();\n }\n\n /** The link is printed before it is opened, so it still works where no browser can open. */\n private async openEditor(\n projectDir: string,\n provider: Provider | undefined,\n id?: string,\n marketplace?: string,\n ): Promise<void> {\n const url = id === undefined ? EDITOR_URL : editorConfigUrl(id);\n // Above the first line, so a ref the install route would refuse is refused before any output.\n const marketplaceLine =\n marketplace === undefined ? undefined : this.addMarketplaceLineOrFail(marketplace);\n\n const installedHere = await holdsItsOwnInstallation(projectDir);\n const toName = installedHere ? await installationToName(projectDir, provider) : provider;\n\n this.log(id === undefined ? `Build it at ${url}` : `Open it at ${url}`);\n if (marketplaceLine !== undefined) this.log(marketplaceLine);\n this.log(applySharedConfigHere(id, installedHere, toName));\n\n if (!process.stdin.isTTY) return;\n\n const opened = await openUrl(url);\n if (!opened.ok) this.warn(opened.error);\n }\n\n private async install(): Promise<void> {\n const { flags } = await this.parse(Init);\n const projectDir = process.cwd();\n\n // First, so a refused `--provider` leaves the filesystem untouched at both scopes.\n this.settleTheProviderForThisRun(flags);\n\n // Before `ensureConfigReadable`: a broken config must not block the editor route.\n if (opensTheEditor(flags)) {\n return this.openEditor(\n projectDir,\n providerNamedBy(flags.provider),\n flags.from,\n flags.marketplace,\n );\n }\n\n // ABORT: an unreadable config is refused here, before any route reads it.\n await this.ensureConfigReadable(projectDir);\n\n if (flags.from === undefined) return this.showDashboardOrOpenEditor(projectDir);\n\n // Its degrade arm cannot fire: `ensureConfigReadable` already refused every unreadable config.\n this.brandingName = await this.resolveBrandingName(projectDir);\n\n const selection = await this.selectionFromSharedConfig(flags.from, flags, projectDir);\n if (!selection) this.exit(EXIT_CODES.CANCELLED);\n\n this.reportValidationErrors(selection.result.validation);\n\n await this.handleInstallation(selection, projectDir);\n }\n\n private async showDashboardOrOpenEditor(projectDir: string): Promise<void> {\n const dashboard = await runDashboardFlow(projectDir, this.config, (msg) => this.log(msg));\n switch (dashboard) {\n case \"cancelled\":\n return this.error(\"Cancelled\", { exit: EXIT_CODES.CANCELLED });\n case \"not-installed\":\n return this.openEditor(projectDir, undefined);\n case \"shown\":\n return;\n default: {\n const _exhaustive: never = dashboard;\n return _exhaustive;\n }\n }\n }\n\n /** Refused as the install route refuses it, since the line echoes the ref it was given. */\n private addMarketplaceLineOrFail(ref: string): string {\n try {\n assertNamedSourceUsable(ref);\n return addMarketplaceInTheEditor(ref, isLocalSource(ref));\n } catch (error) {\n this.handleError(error);\n }\n }\n\n /** `--provider` only picks which folder an install creates, so it needs `--from`. */\n private settleTheProviderForThisRun(flags: Interfaces.InferredFlags<typeof Init.flags>): void {\n const named = providerNamedBy(flags.provider);\n if (named === undefined) return;\n\n if (flags.from === undefined) {\n this.error(providerNeedsAConfigurationToInstall(), { exit: EXIT_CODES.INVALID_ARGS });\n }\n\n chooseProviderForThisRun(named);\n }\n\n /** Every refusal fires before anything is written. */\n private async selectionFromSharedConfig(\n id: string,\n flags: SourceFlags,\n projectDir: string,\n ): Promise<Selection | null> {\n await this.refuseInstalledProject(projectDir, id);\n\n const payload = await this.fetchSharedConfigOrFail(id);\n const sourceFlags = sharedConfigSourceFlags(flags, payload);\n const { sourceResult, startupMessages } = await this.loadSourceOrFail(sourceFlags, projectDir);\n // Before the decode, which would otherwise skip carried skills as unknown ids.\n const carriedSkills = this.registerExternalSkillsOrFail(\n payload,\n sourceResult.matrix,\n projectDir,\n );\n const mapping = this.decodeSeedOrFail(payload, sourceResult.matrix);\n const { result } = mapping;\n\n // Nothing is installed here: `refuseInstalledProject` has already refused a home that holds one.\n this.refuseProjectScopedContentAtHome(result, projectDir, false);\n\n const installedGlobal = await installedGlobalToHold(projectDir);\n const held = holdInstalledGlobal(result, installedGlobal);\n const arrivingCarried = notInstalledGlobally(carriedSkills, held);\n\n // Above the lists: a yes installs what was listed, so nothing listed may then be refused.\n await this.refuseSharedConfigBeforeAsking(\n held.result,\n arrivingCarried,\n projectDir,\n sourceResult,\n );\n\n // Above the skips: an \"unknown\" skill is often one whose file failed to parse.\n sayCapturedWarnings(startupMessages);\n this.warnOfSkippedEntries(mapping);\n this.refuseAnEmptySelection(held.result, id);\n\n const stackName = await this.stackNameOf(result.selectedStackId, sourceResult);\n this.logWhatGoesWhere(held, installedGlobal, stackName, {\n id: installsAtHome(result) ? id : undefined,\n provider: providerToNameAt(os.homedir(), providerInUse(projectDir)),\n });\n if (process.stdin.isTTY && !(await this.confirmInstall())) {\n this.log(\"Setup cancelled\");\n return null;\n }\n\n // After the question, so a refusal or a no leaves nothing written.\n await this.writeCarriedSkills(arrivingCarried);\n this.announceArrivingSkills(held, result.selectedAgents.length);\n\n return {\n result: held.result,\n sourceResult,\n sourceFlags,\n installedAlready: new Set(held.installed.skillIds),\n };\n }\n\n /**\n * The panel where the question is asked, or where it would be: the project against the whole\n * global install it inherits. `runFromHome.id` is the id only where home would take it.\n */\n private logWhatGoesWhere(\n held: HeldGlobal,\n installedGlobal: InstalledGlobal | null,\n stackName: string | undefined,\n runFromHome: RunFromHome,\n ): void {\n const joined = joinedGlobalAgents(held, installedGlobal);\n const lines = summaryPanelBlock(\n installPanel(held, installedGlobal, joined, stackName),\n joined.map(subAgentChanged),\n [...joinedStatement(held), ...keptAsInstalledStatement(held, runFromHome)],\n );\n for (const line of lines) {\n this.log(line);\n }\n }\n\n private refuseAnEmptySelection(result: InstallSelection, id: string): void {\n if (!selectsNothing(result)) return;\n\n this.error(`Configuration '${id}' contains no skills this catalog can install.`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n private announceArrivingSkills(held: HeldGlobal, agentCount: number): void {\n const arriving = notInstalledGlobally(held.result.skills, held);\n if (arriving.length === 0) return;\n\n this.log(`Installing ${arriving.length} skill(s) across ${agentCount} sub-agent(s)\\n`);\n }\n\n private async confirmInstall(): Promise<boolean> {\n const outcome = await promptConfirm(({ onConfirm, onCancel }) => (\n <Confirm\n message={SHARED_CONFIG_ARRIVALS.INSTALL_CONFIRM}\n onConfirm={onConfirm}\n onCancel={onCancel}\n />\n ));\n return outcome === \"confirmed\";\n }\n\n /** Project-scoped: `detectInstallation`'s global fallback would refuse every clean project. */\n private async refuseInstalledProject(projectDir: string, id: string): Promise<void> {\n const installation = await detectProjectInstallation(projectDir);\n if (!installation) return;\n\n const provider = providerToNameAt(projectDir, providerInUse(projectDir));\n this.error(sharedConfigExistingInstall(installation.configPath, id, provider), {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n private async fetchSharedConfigOrFail(id: string): Promise<SeedPayload> {\n this.log(`Fetching configuration ${id}...`);\n const fetched = await fetchSeedConfig(id);\n if (!fetched.ok) {\n this.error(fetched.error, { exit: EXIT_CODES.ERROR });\n }\n return fetched.payload;\n }\n\n private decodeSeedOrFail(payload: SeedPayload, matrix: MergedSkillsMatrix): SeedMapping {\n try {\n return seedToInstallSelection(payload, matrix);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n private registerExternalSkillsOrFail(\n payload: SeedPayload,\n matrix: MergedSkillsMatrix,\n projectDir: string,\n ): ExternalSkillInstall[] {\n try {\n return registerExternalSkills(payload, matrix, projectDir);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n private async writeCarriedSkills(carried: ExternalSkillInstall[]): Promise<void> {\n if (carried.length === 0) return;\n\n await writeExternalSkills(carried);\n this.log(carriedSkillsWritten(carried.map((skill) => skill.id)));\n }\n\n private async loadSourceOrFail(\n flags: SourceFlags,\n projectDir: string,\n ): Promise<{ sourceResult: SourceLoadResult; startupMessages: StartupMessage[] }> {\n try {\n const loaded = await loadSource({\n // The one load that may choose a marketplace rather than read the stored one.\n caller: \"init\",\n ...(flags.marketplace !== undefined && { sourceFlag: flags.marketplace }),\n projectDir,\n captureStartupMessages: true,\n });\n return { sourceResult: loaded.sourceResult, startupMessages: loaded.startupMessages };\n } catch (error) {\n this.error(getErrorMessage(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n\n private async handleInstallation(\n { result, sourceResult, sourceFlags, installedAlready }: Selection,\n projectDir: string,\n ): Promise<void> {\n const plan = planInstall(result, installedAlready);\n this.logInstallPlan(plan);\n\n // Before any copy, so a failed resolution cannot leave a half-install with no config.ts.\n const resolvedMarketplace = await this.marketplaceForPluginSkills(\n plan.pluginSkills,\n sourceResult,\n projectDir,\n );\n\n const copyResult = await this.copyEjectedSkills(plan, projectDir, sourceResult);\n\n if (resolvedMarketplace !== null) {\n await this.installPluginSkillsReported(\n plan.pluginSkills,\n resolvedMarketplace,\n projectDir,\n sourceResult.matrix,\n );\n }\n\n try {\n const written = await this.writeConfigAndCompile(\n result,\n sourceResult,\n sourceFlags,\n projectDir,\n );\n this.reportSuccess(written, copyResult, projectDir);\n\n await this.showPermissionNotice(projectDir);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n private async marketplaceForPluginSkills(\n pluginSkills: InstallSelection[\"skills\"],\n sourceResult: SourceLoadResult,\n projectDir: string,\n ): Promise<string | null> {\n if (pluginSkills.length === 0) return null;\n\n return this.requireMarketplaceOrExit(\n sourceResult,\n \"install plugin skills\",\n hostAt(projectDir),\n (marketplace) => this.log(`Registering marketplace \"${marketplace}\"...`),\n );\n }\n\n /** One frame, then unmount: the notice has no exit of its own and `--from` must run headless. */\n private async showPermissionNotice(projectDir: string): Promise<void> {\n const permissionWarning = await checkPermissions(projectDir);\n if (!permissionWarning) return;\n\n const { unmount } = render(permissionWarning);\n unmount();\n }\n\n private logInstallPlan(plan: InstallPlan): void {\n this.log(\"\\n\");\n this.log(`Selected ${plural(plan.ejectedSkills.length + plan.pluginSkills.length, \"skill\")}`);\n this.log(`Install mode: ${installModeDescription(plan)}`);\n }\n\n private async copyEjectedSkills(\n { ejectedSkills, installMode }: InstallPlan,\n projectDir: string,\n sourceResult: SourceLoadResult,\n ): Promise<SkillCopyResult | null> {\n if (ejectedSkills.length === 0) return null;\n\n this.log(\"Copying skills to local directory...\");\n const copyResult = await copyLocalSkills(ejectedSkills, projectDir, sourceResult);\n this.log(skillsCopiedLine(copyResult, installMode, projectDir));\n return copyResult;\n }\n\n private async writeConfigAndCompile(\n result: InstallSelection,\n sourceResult: SourceLoadResult,\n flags: SourceFlags,\n projectDir: string,\n ): Promise<WrittenInstall> {\n const configResult = await this.writeConfigReported(result, sourceResult, flags, projectDir);\n const agentScopeMap = buildAgentScopeMap(configResult.config);\n const compileResult = await this.compileInstalledAgents(\n configResult.propagation,\n agentScopeMap,\n projectDir,\n );\n this.reportCompilation(compileResult);\n await this.reportWhatThisHostCannotCarry(projectDir);\n\n this.reportFanOut(configResult.propagation);\n\n return { configResult, compileResult, agentScopeMap };\n }\n\n private async writeConfigReported(\n result: InstallSelection,\n sourceResult: SourceLoadResult,\n flags: SourceFlags,\n projectDir: string,\n ): Promise<ConfigWriteResult> {\n this.log(\"Generating configuration...\");\n const configResult = await writeProjectConfig({\n selection: result,\n sourceResult,\n projectDir,\n ...(flags.marketplace !== undefined && { sourceFlag: flags.marketplace }),\n });\n\n if (configResult.wasMerged) {\n this.log(`Merged with existing config at ${configResult.existingConfigPath}`);\n }\n\n this.log(`Configuration saved (${plural(configResult.config.agents.length, \"agent\")})\\n`);\n this.reportUnassignedSkills(configResult.config, result.skills);\n return configResult;\n }\n\n private async compileInstalledAgents(\n written: GateReport,\n agentScopeMap: Map<AgentName, SkillScope>,\n projectDir: string,\n ): Promise<CompilationResult> {\n this.log(STATUS_MESSAGES.COMPILING_AGENTS);\n // Sequential: both can reject and discovery warns, so the order decides what the user reads.\n const agentDefs = await loadAgentDefs();\n const { allSkills } = await discoverInstalledSkills(projectDir);\n const compile = compilesGlobalScope(projectDir, written)\n ? compileAgentsAllScopes\n : compileProjectScope;\n return compile({\n projectDir,\n sourcePath: agentDefs.sourcePath,\n skills: allSkills,\n agentScopeMap,\n });\n }\n\n private async reportWhatThisHostCannotCarry(projectDir: string): Promise<void> {\n for (const notice of await hostCompileNotices(providerInUse(projectDir), projectDir)) {\n this.log(notice);\n }\n }\n\n /**\n * Failures are recorded rather than aborted on: the skills and config are already written, and\n * {@link BaseCommand.exitIfWorkIncomplete} answers for them.\n */\n private reportCompilation(compileResult: CompilationResult): void {\n const { compiled, failed, warnings } = compileResult;\n const summary = `Compiled ${plural(compiled.length, \"agent\")}`;\n\n if (failed.length === 0) {\n this.log(`${summary}\\n`);\n return;\n }\n\n this.log(`${summary} (${failed.length} failed)\\n`);\n for (const warning of warnings) {\n this.warn(warning);\n }\n // Off `failed`, not `warnings`: warnings also carry entries that are not failures.\n this.recordIncompleteWork(agentsNotCompiled(failed), INCOMPLETE_WORK_RECOVERY.RECOMPILE);\n }\n\n private reportSuccess(\n { configResult, compileResult, agentScopeMap }: WrittenInstall,\n copyResult: SkillCopyResult | null,\n projectDir: string,\n ): void {\n // A run with work owed ends on the failure account instead of claiming success.\n if (!this.hasIncompleteWork) this.log(`${initSucceeded(this.brandingName)}\\n`);\n\n if (copyResult !== null && copyResult.totalCopied > 0) {\n this.logDirectoryBlocks(\"Skills copied to:\", skillsCopiedBlocks(projectDir, copyResult));\n }\n this.logDirectoryBlocks(\n \"Agents compiled to:\",\n agentsCompiledBlocks(projectDir, compileResult.compiled, agentScopeMap),\n );\n this.reportConfiguration(configResult, agentScopeMap, projectDir);\n }\n\n private reportConfiguration(\n { configPath, propagation }: ConfigWriteResult,\n agentScopeMap: Map<AgentName, SkillScope>,\n projectDir: string,\n ): void {\n const paths = {\n global: resolveInstallPaths(projectDir, \"global\").configPath,\n project: configPath,\n };\n const split = splitAgentScopes(projectDir, agentScopeMap);\n\n this.log(\"Configuration:\");\n for (const written of configsWritten(projectDir, paths, propagation.globalWritten)) {\n this.log(` ${written}`);\n }\n this.log(\"\");\n\n this.log(\"To customize agent-skill assignments:\");\n for (const [index, step] of customizationSteps(split, paths.global, projectDir).entries()) {\n this.log(` ${index + 1}. ${step}`);\n }\n this.log(\"\");\n }\n\n private logDirectoryBlocks(heading: string, blocks: DirectoryBlock[]): void {\n for (const { dir, entries } of blocks) {\n this.log(heading);\n this.log(` ${dir}`);\n for (const entry of entries) {\n this.log(` ${entry}`);\n }\n this.log(\"\");\n }\n }\n}\n\n/** The editor is where a marketplace is added, so `--marketplace` without `--from` opens it. */\nfunction opensTheEditor(\n flags: Pick<Interfaces.InferredFlags<typeof Init.flags>, \"ui\" | \"from\" | \"marketplace\">,\n): boolean {\n return flags.ui || (flags.from === undefined && flags.marketplace !== undefined);\n}\n\n/** A sub-agent is installable without skills, so only a selection with neither is empty. */\nfunction selectsNothing(result: InstallSelection): boolean {\n return result.skills.length === 0 && result.selectedAgents.length === 0;\n}\n\n/** At the home root the global config is the project's own, so there is no global install apart. */\nasync function installedGlobalToHold(projectDir: string): Promise<InstalledGlobal | null> {\n if (isHomeDirectory(projectDir)) return null;\n return await readInstalledGlobal(projectDir);\n}\n\n/** The run from home that changes what a project run keeps, where home would take it. */\ntype RunFromHome = { id: string | undefined; provider: Provider | undefined };\n\nfunction keptAsInstalledStatement(held: HeldGlobal, runFromHome: RunFromHome): string[] {\n const { skillIds, agentNames } = held.keptAsInstalled;\n if (skillIds.length === 0 && agentNames.length === 0) return [];\n return [keptAsInstalledGlobally(skillIds, agentNames, runFromHome.id, runFromHome.provider)];\n}\n\ntype GlobalEntries = { skills: SkillConfig[]; agents: AgentScopeConfig[] };\n\n/** What the project inherits that the configuration leaves unnamed: a project config copies it all. */\nfunction inheritedGlobal(held: HeldGlobal, installedGlobal: InstalledGlobal | null): GlobalEntries {\n if (installedGlobal === null) return { skills: [], agents: [] };\n\n const namedSkills = new Set(held.result.skills.filter(isGlobal).map(({ id }) => id));\n const namedAgents = new Set(held.result.agentConfigs.filter(isGlobal).map(({ name }) => name));\n return {\n skills: installedGlobal.skills.filter((skill) => isGlobal(skill) && !namedSkills.has(skill.id)),\n agents: installedGlobal.agents.filter(\n (agent) => isGlobal(agent) && !namedAgents.has(agent.name),\n ),\n };\n}\n\nfunction isGlobal(entry: SkillConfig | AgentScopeConfig): boolean {\n return isActiveAt(entry, \"global\");\n}\n\n/** Measured against the global install: the project changes nothing else of it. */\nfunction installPanel(\n held: HeldGlobal,\n installedGlobal: InstalledGlobal | null,\n joined: AgentChange[],\n stackName: string | undefined,\n): SummaryPanelProps {\n const inherited = inheritedGlobal(held, installedGlobal);\n return {\n skillConfigs: [...held.result.skills, ...inherited.skills],\n agentConfigs: [...held.result.agentConfigs, ...inherited.agents],\n installedSkillConfigs: installedGlobal?.skills ?? null,\n installedAgentConfigs: installedGlobal?.agents ?? null,\n isInitMode: true,\n changedAgentNames: new Set(joined.map(({ name }) => name)),\n stackName,\n };\n}\n\n/** The held global sub-agents an arriving skill's row joins, against their installed rows. */\nfunction joinedGlobalAgents(\n held: HeldGlobal,\n installedGlobal: InstalledGlobal | null,\n): AgentChange[] {\n if (installedGlobal === null) return [];\n\n return agentChangesAmong(\n held.joined.map(({ agentName }) => agentName),\n installedGlobal,\n { agents: held.result.agentConfigs, stack: held.result.assignedStack },\n );\n}\n\ntype InstallPlan = {\n installMode: InstallMode;\n ejectedSkills: InstallSelection[\"skills\"];\n pluginSkills: InstallSelection[\"skills\"];\n};\n\nfunction planInstall(\n result: InstallSelection,\n installedAlready: ReadonlySet<SkillId>,\n): InstallPlan {\n const toInstall = result.skills.filter(\n (skill) => !skill.excluded && !installedAlready.has(skill.id),\n );\n const [ejectedSkills, pluginSkills] = partition(\n toInstall,\n (skill) => skill.origin === EJECT_SOURCE,\n );\n return { installMode: deriveInstallMode(toInstall), ejectedSkills, pluginSkills };\n}\n\nfunction installModeDescription({ installMode, ejectedSkills, pluginSkills }: InstallPlan): string {\n if (installMode !== \"mixed\") return INSTALL_MODE_DESCRIPTIONS[installMode];\n return `${INSTALL_MODE_LABELS.mixed} (${ejectedSkills.length} eject, ${pluginSkills.length} plugin)`;\n}\n\ntype WrittenInstall = {\n configResult: ConfigWriteResult;\n compileResult: CompilationResult;\n agentScopeMap: Map<AgentName, SkillScope>;\n};\n\n/**\n * From a project, global sub-agents recompile only when the write changed their inputs;\n * otherwise they would be rebuilt from this run's catalogue, not the one they were made from.\n */\nfunction compilesGlobalScope(cwd: string, written: GateReport): boolean {\n return isHomeDirectory(cwd) || movedGlobalAgentInputs(written);\n}\n\n/** Names the directory only when every skill landed at one scope; the block beneath lists both. */\nfunction skillsCopiedLine(\n copyResult: SkillCopyResult,\n installMode: InstallMode,\n projectDir: string,\n): string {\n const isMixed = installMode === \"mixed\";\n const copied = plural(copyResult.totalCopied, isMixed ? \"local skill\" : \"skill\");\n const lineEnd = isMixed ? \"\" : \"\\n\";\n const projectCount = copyResult.projectCopied.length;\n const globalCount = copyResult.globalCopied.length;\n const landedAtBothScopes = projectCount > 0 && globalCount > 0;\n\n if (landedAtBothScopes) {\n return `Copied ${copied} (${projectCount} project, ${globalCount} global)${lineEnd}`;\n }\n const landedAt: SkillScope = globalCount > 0 ? \"global\" : \"project\";\n return `Copied ${copied} to ${resolveInstallPaths(projectDir, landedAt).skillsDir}/${lineEnd}`;\n}\n\n/** Entries are on-disk names, so ids, never display names. */\ntype DirectoryBlock = { dir: string; entries: string[] };\n\nfunction hasEntries(block: DirectoryBlock): boolean {\n return block.entries.length > 0;\n}\n\n/** At home a Claude install's two scopes are one folder, which is named once. */\nfunction oneBlockPerDir(blocks: DirectoryBlock[]): DirectoryBlock[] {\n const dirs = [...new Set(blocks.map((block) => block.dir))];\n return dirs.map((dir) => ({\n dir,\n entries: blocks.filter((block) => block.dir === dir).flatMap((block) => block.entries),\n }));\n}\n\nfunction skillsCopiedBlocks(projectDir: string, copyResult: SkillCopyResult): DirectoryBlock[] {\n return oneBlockPerDir(\n [\n copiedSkillsBlock(projectDir, \"global\", copyResult.globalCopied),\n copiedSkillsBlock(projectDir, \"project\", copyResult.projectCopied),\n ].filter(hasEntries),\n );\n}\n\nfunction copiedSkillsBlock(\n projectDir: string,\n scope: SkillScope,\n copied: SkillCopyResult[\"projectCopied\"],\n): DirectoryBlock {\n return {\n dir: resolveInstallPaths(projectDir, scope).skillsDir,\n entries: copied.map(({ skillId }) => `${skillId}/`),\n };\n}\n\n/** Mirrors `writeCompiledAgentsByScope`' routing. */\nfunction agentsCompiledBlocks(\n projectDir: string,\n compiled: AgentName[],\n agentScopeMap: Map<AgentName, SkillScope>,\n): DirectoryBlock[] {\n const [globalAgents, projectAgents] = partition(\n compiled,\n (name) => agentScopeMap.get(name) === \"global\",\n );\n return oneBlockPerDir(\n [\n compiledAgentsBlock(projectDir, \"global\", globalAgents),\n compiledAgentsBlock(projectDir, \"project\", projectAgents),\n ].filter(hasEntries),\n );\n}\n\n/** Per scope, because the project and global installs can be on different hosts. */\nfunction compiledAgentsBlock(\n projectDir: string,\n scope: SkillScope,\n agents: AgentName[],\n): DirectoryBlock {\n const { extension } = agentCodec(providerInUse(installBaseDir(projectDir, scope)));\n return {\n dir: resolveInstallPaths(projectDir, scope).agentsDir,\n entries: agents.map((name) => `${name}${extension}`),\n };\n}\n\ntype ConfigPaths = { global: string; project: string };\n\ntype AgentScopeSplit = { globalAgentCount: number; isGlobalOnly: boolean };\n\n/** At the home root both scopes are one config and one pass, so there is no split. */\nfunction splitAgentScopes(cwd: string, agentScopeMap: Map<AgentName, SkillScope>): AgentScopeSplit {\n if (isHomeDirectory(cwd)) return { globalAgentCount: 0, isGlobalOnly: false };\n\n const scopes = [...agentScopeMap.values()];\n const globalAgentCount = scopes.filter((scope) => scope === \"global\").length;\n return {\n globalAgentCount,\n isGlobalOnly: globalAgentCount > 0 && globalAgentCount === scopes.length,\n };\n}\n\n/**\n * From a project its own config is always written, and the global one whenever the run changed it,\n * if only to register the project. At home the two are one file.\n */\nfunction configsWritten(projectDir: string, paths: ConfigPaths, globalWritten: boolean): string[] {\n if (isHomeDirectory(projectDir)) return [paths.project];\n return globalWritten ? [paths.global, paths.project] : [paths.project];\n}\n\n/** `compile` in a project recompiles no global agent, hence the global hint. */\nfunction customizationSteps(\n split: AgentScopeSplit,\n globalConfigPath: string,\n projectDir: string,\n): string[] {\n if (split.isGlobalOnly) {\n return [`Edit ${globalConfigPath}`, globalScopedAgentsHint(split.globalAgentCount)];\n }\n\n return [\n `Edit ${relativeConfigPath(projectDir, providerInUse(projectDir))}`,\n `Run '${CLI_INVOKE_COMMAND} compile' to regenerate agents`,\n ...(split.globalAgentCount > 0 ? [globalScopedAgentsHint(split.globalAgentCount)] : []),\n ];\n}\n\nexport type DashboardData = {\n name: string;\n installations: ProviderInstallation[];\n};\n\n/** Each installation's counts come from its own scope-aware read, so project and global never mix. */\nasync function getDashboardData(projectDir: string): Promise<DashboardData> {\n // ABORT: an unloadable config throws here, as the installation check before it already would.\n const [installations, branding] = await Promise.all([\n getInstallationsByProvider(projectDir),\n resolveBranding(projectDir),\n ]);\n // Every caller found an installation before drawing the dashboard.\n if (installations.length === 0) throw new Error(ERROR_MESSAGES.NO_INSTALLATION);\n\n return { name: branding.name, installations };\n}\n","import React from \"react\";\nimport { z } from \"zod\";\n\nimport { Text, Box } from \"ink\";\nimport path from \"path\";\n\nimport { CLI_COLORS, MAX_CONFIG_FILE_SIZE } from \"../consts\";\nimport {\n advisesOnPermissions,\n permissionFiles,\n providerInUse,\n} from \"./installation/install-layout.js\";\nimport { fileExists, readFileSafe } from \"../utils/fs\";\nimport { warn } from \"../utils/logger\";\nimport { settingsFileSchema } from \"./schemas\";\n\ntype SettingsFile = z.infer<typeof settingsFileSchema>;\ntype PermissionConfig = NonNullable<SettingsFile[\"permissions\"]>;\n\n/** Undefined when absent, malformed or empty; silent about every other field (Claude Code's). */\nasync function readSettingsPermissions(filePath: string): Promise<PermissionConfig | undefined> {\n if (!(await fileExists(filePath))) return undefined;\n try {\n const content = await readFileSafe(filePath, MAX_CONFIG_FILE_SIZE);\n const raw: unknown = JSON.parse(content);\n const result = settingsFileSchema.safeParse(raw);\n const parsed: SettingsFile = result.success ? result.data : {};\n return parsed.permissions;\n } catch {\n warn(`Malformed settings file at '${filePath}' — skipping`);\n return undefined;\n }\n}\n\nfunction settingsFilesFor(projectRoot: string): string[] {\n return permissionFiles(providerInUse(projectRoot), \"project\", projectRoot);\n}\n\n/** Permissions from the highest-precedence settings file that defines them — the overlay wins. */\nasync function loadPermissions(files: readonly string[]): Promise<PermissionConfig | undefined> {\n for (const filePath of [...files].reverse()) {\n const permissions = await readSettingsPermissions(filePath);\n if (permissions) return permissions;\n }\n return undefined;\n}\n\n/** Relative to the project and POSIX-separated: a name shown to a person, not a path to open. */\nfunction asUserWritesIt(projectRoot: string, file: string): string {\n return path.relative(projectRoot, file).split(path.sep).join(\"/\");\n}\n\n/** `null` for a host whose permission model this release cannot advise on. */\nexport async function checkPermissions(projectRoot: string): Promise<React.ReactElement | null> {\n if (!advisesOnPermissions(providerInUse(projectRoot))) return null;\n\n const files = settingsFilesFor(projectRoot);\n // The base file: the one this CLI writes and a user with neither is asked to create.\n const [base] = files;\n if (base === undefined) return null;\n\n const permissions = await loadPermissions(files);\n const settingsFile = asUserWritesIt(projectRoot, base);\n\n if (!permissions) {\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={CLI_COLORS.WARNING} padding={1}>\n <Text bold color={CLI_COLORS.WARNING}>\n Permission Notice\n </Text>\n <Text>No permissions configured in {settingsFile}</Text>\n <Text>Agents will prompt for approval on each tool use.</Text>\n <Text> </Text>\n <Text>For autonomous operation, add to {settingsFile}:</Text>\n <Text> </Text>\n <Text color={CLI_COLORS.DIM}>{\"{\"}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"permissions\": {'}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"allow\": ['}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"Read(*)\",'}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"Bash(git *)\",'}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"Bash(bun *)\"'}</Text>\n <Text color={CLI_COLORS.DIM}>{\" ]\"}</Text>\n <Text color={CLI_COLORS.DIM}>{\" }\"}</Text>\n <Text color={CLI_COLORS.DIM}>{\"}\"}</Text>\n </Box>\n );\n }\n\n const hasRestrictiveBash = permissions.deny?.some(\n (rule) => rule === \"Bash(*)\" || rule === \"Bash\",\n );\n const hasNoAllows = !permissions.allow || permissions.allow.length === 0;\n\n if (hasRestrictiveBash || hasNoAllows) {\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={CLI_COLORS.WARNING} padding={1}>\n <Text bold color={CLI_COLORS.WARNING}>\n Permission Warnings\n </Text>\n {hasRestrictiveBash && (\n <Text>\n ⚠ Bash is denied in permissions. Some agents require Bash for git, testing, and build\n commands.\n </Text>\n )}\n {hasNoAllows && (\n <Text>⚠ No allow rules configured. Agents will prompt for each tool use.</Text>\n )}\n </Box>\n );\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAkB;AAElB,SAAS,aAA8B;AACvC,SAAS,OAAAA,MAAK,QAAAC,OAAM,cAAc;AAClC,SAAS,iBAAiB;;;ACL1B,OAAkB;AAClB,OAAkB;AAElB,SAAS,MAAM,WAAW;AAC1B,OAAO,UAAU;AA+DT,cAGA,YAHA;AA/CR,eAAe,wBAAwB,UAAyD;AAC9F,MAAI,CAAE,MAAM,WAAW,QAAQ,EAAI,QAAO;AAC1C,MAAI;AACF,UAAM,UAAU,MAAM,aAAa,UAAU,oBAAoB;AACjE,UAAM,MAAe,KAAK,MAAM,OAAO;AACvC,UAAM,SAAS,mBAAmB,UAAU,GAAG;AAC/C,UAAM,SAAuB,OAAO,UAAU,OAAO,OAAO,CAAC;AAC7D,WAAO,OAAO;AAAA,EAChB,QAAQ;AACN,SAAK,+BAA+B,QAAQ,mBAAc;AAC1D,WAAO;AAAA,EACT;AACF;AAEA,SAAS,iBAAiB,aAA+B;AACvD,SAAO,gBAAgB,cAAc,WAAW,GAAG,WAAW,WAAW;AAC3E;AAGA,eAAe,gBAAgB,OAAiE;AAC9F,aAAW,YAAY,CAAC,GAAG,K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;AACzC,QAAM,mBAAmB,OAAO,OAAO,CAAC,UAAU,UAAU,QAAQ,EAAE;AACtE,SAAO;AAAA,IACL;AAAA,IACA,cAAc,mBAAmB,KAAK,qBAAqB,OAAO;AAAA,EACpE;AACF;AAMA,SAAS,eAAe,YAAoB,OAAoB,eAAkC;AAChG,MAAI,gBAAgB,UAAU,EAAG,QAAO,CAAC,MAAM,OAAO;AACtD,SAAO,gBAAgB,CAAC,MAAM,QAAQ,MAAM,OAAO,IAAI,CAAC,MAAM,OAAO;AACvE;AAGA,SAAS,mBACP,OACA,kBACA,YACU;AACV,MAAI,MAAM,cAAc;AACtB,WAAO,CAAC,QAAQ,gBAAgB,IAAI,uBAAuB,MAAM,gBAAgB,CAAC;AAAA,EACpF;AAEA,SAAO;AAAA,IACL,QAAQ,mBAAmB,YAAY,cAAc,UAAU,CAAC,CAAC;AAAA,IACjE,QAAQ,kBAAkB;AAAA,IAC1B,GAAI,MAAM,mBAAmB,IAAI,CAAC,uBAAuB,MAAM,gBAAgB,CAAC,IAAI,CAAC;AAAA,EACvF;AACF;AAQA,eAAe,iBAAiB,YAA4C;AAE1E,QAAM,CAAC,eAAe,QAAQ,IAAI,MAAM,QAAQ,IAAI;AAAA,IAClD,2BAA2B,UAAU;AAAA,IACrC,gBAAgB,UAAU;AAAA,EAC5B,CAAC;AAED,MAAI,cAAc,WAAW,EAAG,OAAM,IAAI,MAAM,eAAe,eAAe;AAE9E,SAAO,EAAE,MAAM,SAAS,MAAM,cAAc;AAC9C;","names":["Box","Text","jsx","jsxs","Text","Box"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/agents/list-compiled-agents.ts","../src/cli/lib/agents/agent-recompiler.ts","../src/cli/lib/agents/write-compiled-agents.ts","../src/cli/lib/compiler.ts","../src/cli/lib/agents/agent-provenance.ts"],"sourcesContent":["import path from \"path\";\nimport { partition } from \"remeda\";\nimport { glob, readFileOptional, remove } from \"../../utils/fs\";\nimport { isAgentName } from \"../../utils/type-guards\";\nimport { type AgentCodec, agentCodec } from \"../installation/install-layout\";\nimport type { AgentName } from \"../../types\";\n\n/**\n * The default codec; a caller on another host passes that host's\n * (`agentCodec(providerInUse(dir))`).\n */\nconst CLAUDE_AGENTS = agentCodec(\"claude\");\n\ntype AgentProvenanceSplit = {\n marked: string[];\n unmarked: string[];\n};\n\nexport async function listAgentMdFiles(agentsDir: string): Promise<string[]> {\n return listAgentFilesOf(agentsDir, CLAUDE_AGENTS);\n}\n\nexport async function listAgentFilesOf(agentsDir: string, codec: AgentCodec): Promise<string[]> {\n return glob(codec.listGlob, agentsDir);\n}\n\n/** An unreadable file lands in `unmarked`: \"cannot prove it is ours\" means leave it alone. */\nexport async function splitAgentsByProvenance(\n agentsDir: string,\n codec: AgentCodec = CLAUDE_AGENTS,\n): Promise<AgentProvenanceSplit> {\n const files = await listAgentFilesOf(agentsDir, codec);\n const classified = await Promise.all(\n files.map((file) => readAgentProvenance(agentsDir, file, codec)),\n );\n const [marked, unmarked] = partition(classified, (agent) => agent.compiledHere);\n\n return {\n marked: marked.map((agent) => agent.name),\n unmarked: unmarked.map((agent) => agent.name),\n };\n}\n\ntype ClassifiedAgent = { name: string; compiledHere: boolean };\n\nasync function readAgentProvenance(\n agentsDir: string,\n file: string,\n codec: AgentCodec,\n): Promise<ClassifiedAgent> {\n const content = await readFileOptional(path.join(agentsDir, file));\n return { name: path.basename(file, codec.extension), compiledHere: codec.hasMarker(content) };\n}\n\nexport async function listCompiledAgentNames(agentsDir: string): Promise<AgentName[]> {\n const files = await listAgentMdFiles(agentsDir);\n // Boundary cast: custom marketplace agents may fall outside the AgentName union.\n return files.map((f) => path.basename(f, CLAUDE_AGENTS.extension) as AgentName);\n}\n\n/**\n * Deletes built-in-named agent files not in `keep`, which must be the complete set for `agentsDir`.\n */\nexport async function pruneStaleCompiledAgents(\n agentsDir: string,\n keep: ReadonlySet<AgentName>,\n codec: AgentCodec = CLAUDE_AGENTS,\n): Promise<void> {\n const isStaleCompiledAgent = (file: string): boolean => {\n const name = path.basename(file, codec.extension);\n return isAgentName(name) && !keep.has(name);\n };\n\n const files = await listAgentFilesOf(agentsDir, codec);\n await Promise.all(\n files.filter(isStaleCompiledAgent).map((file) => remove(path.join(agentsDir, file))),\n );\n}\n","import { partition } from \"remeda\";\nimport { writeCompiledAgentsByScope, type AgentWriteOutcome } from \"./write-compiled-agents\";\nimport { listCompiledAgentNames } from \"./list-compiled-agents\";\nimport path from \"path\";\n\nimport { getErrorMessage } from \"../../utils/errors\";\nimport type {\n AgentDefinition,\n AgentName,\n CompileAgentConfig,\n CompileConfig,\n ProjectConfig,\n SkillDefinitionMap,\n SkillId,\n SkillScope,\n} from \"../../types\";\n\nimport { buildCompileAgents } from \"../installation/local-installer\";\nimport { ensureDir } from \"../../utils/fs\";\nimport { verbose } from \"../../utils/logger\";\nimport { typedEntries, typedFromEntries, typedKeys } from \"../../utils/typed-object\";\nimport { createLiquidEngine } from \"../compiler\";\nimport { loadProjectConfig, effectivelyExcludedSkillIds } from \"../configuration\";\nimport { loadAllAgents, loadProjectAgents } from \"../loading\";\nimport { getPluginAgentsDir } from \"../plugins\";\nimport { discoverAllPluginSkills } from \"../plugins/plugin-discovery\";\nimport { resolveAgents } from \"../resolver\";\n\nexport type RecompileAgentsOptions = {\n pluginDir: string;\n sourcePath: string;\n agents?: AgentName[];\n skills?: SkillDefinitionMap;\n projectDir?: string;\n outputDir?: string;\n /** When provided, routes agents by scope: global agents to ~/.claude/agents/, project agents to outputDir */\n agentScopeMap?: Map<AgentName, SkillScope>;\n};\n\nexport type RecompileAgentsResult = {\n compiled: AgentName[];\n /** The subset of `compiled` whose file content moved; the rest count as unchanged. */\n rewritten: AgentName[];\n failed: AgentName[];\n warnings: string[];\n};\n\nasync function getExistingAgentNames(pluginDir: string): Promise<AgentName[]> {\n return listCompiledAgentNames(getPluginAgentsDir(pluginDir));\n}\n\ntype ResolveAgentNamesParams = {\n specifiedAgents?: AgentName[];\n projectConfig: ProjectConfig | null;\n allAgents: Partial<Record<AgentName, AgentDefinition>>;\n outputDir?: string;\n pluginDir: string;\n};\n\nasync function resolveAgentNames(params: ResolveAgentNamesParams): Promise<AgentName[]> {\n const { specifiedAgents, projectConfig, allAgents, outputDir, pluginDir } = params;\n\n if (specifiedAgents) {\n return specifiedAgents;\n }\n\n // A present config is authoritative even when its roster is empty.\n if (projectConfig) {\n const agentNames = projectConfig.agents.map((a) => a.name);\n verbose(`Using agents from config: ${agentNames.join(\", \")}`);\n return agentNames;\n }\n\n if (outputDir) {\n const names = typedKeys<AgentName>(allAgents);\n verbose(`Using all available agents from source: ${names.join(\", \")}`);\n return names;\n }\n\n return getExistingAgentNames(pluginDir);\n}\n\nfunction buildRecompileResult(\n outcomes: AgentWriteOutcome[],\n priorWarnings: string[],\n): RecompileAgentsResult {\n const [succeeded, failedOutcomes] = partition(\n outcomes,\n (outcome): outcome is Extract<AgentWriteOutcome, { ok: true }> => outcome.ok,\n );\n succeeded.forEach((outcome) =>\n verbose(\n ` ${outcome.rewritten ? \"Rewrote\" : \"Unchanged\"}: ${outcome.name} (${outcome.scope} -> ${outcome.targetDir})`,\n ),\n );\n return {\n compiled: succeeded.map((outcome) => outcome.name),\n rewritten: succeeded.filter((outcome) => outcome.rewritten).map((outcome) => outcome.name),\n failed: failedOutcomes.map((outcome) => outcome.name),\n warnings: [\n ...priorWarnings,\n ...failedOutcomes.map(\n (outcome) => `Failed to compile ${outcome.name}: ${getErrorMessage(outcome.error)}`,\n ),\n ],\n };\n}\n\nexport function filterExcludedEntries(config: ProjectConfig): ProjectConfig {\n const excludedIds = effectivelyExcludedSkillIds(config.skills);\n const activeSkills = config.skills.filter((s) => !s.excluded);\n const activeAgents = config.agents.filter((a) => !a.excluded);\n\n // No stack stays absent rather than an explicit `undefined`.\n const filteredStack =\n config.stack === undefined\n ? {}\n : { stack: withoutExcludedAssignments(config.stack, excludedIds) };\n\n return { ...config, skills: activeSkills, agents: activeAgents, ...filteredStack };\n}\n\n/** Each agent and category keeps its key, even when left with no assignments. */\nexport function withoutExcludedAssignments(\n stack: NonNullable<ProjectConfig[\"stack\"]>,\n excludedIds: ReadonlySet<SkillId>,\n): NonNullable<ProjectConfig[\"stack\"]> {\n return Object.fromEntries(\n typedEntries(stack).map(([agentName, agentStack]) => [\n agentName,\n Object.fromEntries(\n typedEntries(agentStack).map(([category, assignments]) => [\n category,\n assignments.filter((assignment) => !excludedIds.has(assignment.id)),\n ]),\n ),\n ]),\n );\n}\n\nexport async function recompileAgents(\n options: RecompileAgentsOptions,\n): Promise<RecompileAgentsResult> {\n const { pluginDir, sourcePath, skills: providedSkills, projectDir, outputDir } = options;\n\n const configDir = projectDir ?? pluginDir;\n const filteredConfig = await loadConfigWithoutExclusions(configDir);\n const allAgents = await loadAgentDefinitions(sourcePath, projectDir);\n\n const agentNames = await resolveAgentNames({\n ...(options.agents !== undefined && { specifiedAgents: options.agents }),\n projectConfig: filteredConfig,\n allAgents,\n ...(outputDir !== undefined && { outputDir }),\n pluginDir,\n });\n\n // An empty pass is not a warning: callers report it off `compiled`.\n if (agentNames.length === 0) {\n return { compiled: [], rewritten: [], failed: [], warnings: [] };\n }\n\n verbose(`Recompiling ${agentNames.length} agents in ${outputDir ?? pluginDir}`);\n\n const pluginSkills: SkillDefinitionMap =\n providedSkills ?? (await discoverAllPluginSkills(projectDir ?? pluginDir));\n\n const { configAgents, missingWarnings } = compileEntriesFor(\n agentNames,\n filteredConfig,\n allAgents,\n );\n const compileConfig = compileConfigFor(filteredConfig, configAgents, pluginDir);\n\n const engine = await createLiquidEngine(projectDir);\n const resolvedAgents = await resolveAgents(allAgents, pluginSkills, compileConfig);\n\n const agentsDir = outputDir ?? getPluginAgentsDir(pluginDir);\n await ensureDir(agentsDir);\n\n const outcomes = await writeCompiledAgentsByScope({\n resolvedAgents,\n sourcePath,\n engine,\n projectAgentsDir: agentsDir,\n // Same root as the config, so format and configuration come from one installation.\n projectDir: configDir,\n ...(options.agentScopeMap !== undefined && { agentScopeMap: options.agentScopeMap }),\n });\n return buildRecompileResult(outcomes, missingWarnings);\n}\n\nasync function loadConfigWithoutExclusions(configDir: string): Promise<ProjectConfig | null> {\n const loaded = await loadProjectConfig(configDir);\n return loaded ? filterExcludedEntries(loaded.config) : null;\n}\n\n/** A project agent wins over a built-in one of the same name. */\nasync function loadAgentDefinitions(\n sourcePath: string,\n projectDir: string | undefined,\n): Promise<Partial<Record<AgentName, AgentDefinition>>> {\n const builtinAgents = await loadAllAgents(sourcePath);\n const projectAgents = projectDir ? await loadProjectAgents(projectDir) : {};\n\n return { ...builtinAgents, ...projectAgents };\n}\n\nfunction compileConfigFor(\n config: ProjectConfig | null,\n agents: Partial<Record<AgentName, CompileAgentConfig>>,\n pluginDir: string,\n): CompileConfig {\n return {\n name: config?.name || path.basename(pluginDir),\n description: config?.description || \"Recompiled plugin\",\n agents,\n };\n}\n\n/** Only agents the scope filter matches: a project pass must not overwrite stackless globals. */\nfunction compileEntriesFor(\n agentNames: AgentName[],\n config: ProjectConfig | null,\n allAgents: Partial<Record<AgentName, AgentDefinition>>,\n): { configAgents: Partial<Record<AgentName, CompileAgentConfig>>; missingWarnings: string[] } {\n const allConfigAgents = config ? buildCompileAgents(config, allAgents) : {};\n\n const [knownAgents, missingAgents] = partition(agentNames, (name) =>\n Boolean(allConfigAgents[name] || allAgents[name]),\n );\n\n return {\n configAgents: typedFromEntries<AgentName, CompileAgentConfig>(\n knownAgents.map((name) => [name, allConfigAgents[name] ?? {}]),\n ),\n missingWarnings: missingAgents.map((name) => `Agent \"${name}\" not found in source definitions`),\n };\n}\n","import os from \"os\";\nimport path from \"path\";\nimport type { Liquid } from \"liquidjs\";\nimport { compileAgentForHost } from \"../compiler.js\";\nimport { resolveInstallPaths } from \"../installation/install-base-dir.js\";\nimport { agentCodec, hostCompilesAgent, providerInUse } from \"../installation/install-layout.js\";\nimport { writeFile, fileExists, readFile } from \"../../utils/fs.js\";\nimport { typedEntries } from \"../../utils/typed-object.js\";\nimport type { Provider } from \"../../consts.js\";\nimport type { AgentConfig, AgentName, SkillScope } from \"../../types/index.js\";\n\nexport type AgentWriteOutcome =\n | {\n name: AgentName;\n ok: true;\n scope: SkillScope;\n targetDir: string;\n /** False when the output matched the file on disk, so nothing was written. */\n rewritten: boolean;\n }\n | { name: AgentName; ok: false; error: unknown };\n\n/** Skipping an identical write keeps the mtime, the only trace telling unchanged from rewritten. */\nasync function holdsExactly(filePath: string, content: string): Promise<boolean> {\n return (await fileExists(filePath)) && (await readFile(filePath)) === content;\n}\n\n/**\n * Routing for an agent the scope map does not name: the caller's `projectAgentsDir`. Deliberately\n * not the selection default, which would move unrouted agents into `~/.claude/agents`.\n */\nconst UNROUTED_AGENT_SCOPE: SkillScope = \"project\";\n\n/**\n * Per-agent failures come back as outcomes; a directory appears only when an agent routes into it.\n */\nexport async function writeCompiledAgentsByScope(params: {\n resolvedAgents: Partial<Record<AgentName, AgentConfig>>;\n sourcePath: string;\n engine: Liquid;\n projectAgentsDir: string;\n /** The root whose folder says which host the PROJECT scope's sub-agents are written for. */\n projectDir: string;\n agentScopeMap?: Map<AgentName, SkillScope>;\n}): Promise<AgentWriteOutcome[]> {\n const hosts: Record<SkillScope, AgentHost> = {\n // Each scope reads its own root: a Codex project under a Claude global is allowed.\n global: {\n provider: providerInUse(os.homedir()),\n agentsDir: resolveInstallPaths(os.homedir(), \"global\").agentsDir,\n },\n project: { provider: providerInUse(params.projectDir), agentsDir: params.projectAgentsDir },\n };\n\n const outcomes: AgentWriteOutcome[] = [];\n for (const [name, agent] of typedEntries<AgentName, AgentConfig>(params.resolvedAgents)) {\n const scope = params.agentScopeMap?.get(name) ?? UNROUTED_AGENT_SCOPE;\n const host = hosts[scope];\n\n // No outcome for a sub-agent this host does not carry: it was neither compiled nor failed.\n if (!hostCompilesAgent(host.provider, name)) continue;\n\n outcomes.push(await writeOneAgent({ ...params, name, agent, scope, host }));\n }\n return outcomes;\n}\n\n/** Returns the failure rather than throwing: the policy is the caller's. */\nasync function writeOneAgent(params: {\n name: AgentName;\n agent: AgentConfig;\n scope: SkillScope;\n host: AgentHost;\n sourcePath: string;\n engine: Liquid;\n}): Promise<AgentWriteOutcome> {\n const { name, scope, host } = params;\n\n try {\n const output = await compileAgentForHost(\n host.provider,\n name,\n params.agent,\n params.sourcePath,\n params.engine,\n );\n const targetPath = path.join(host.agentsDir, fileNameFor(name, host.provider));\n const rewritten = !(await holdsExactly(targetPath, output));\n if (rewritten) await writeFile(targetPath, output);\n\n return { name, ok: true, scope, targetDir: host.agentsDir, rewritten };\n } catch (error) {\n return { name, ok: false, error };\n }\n}\n\ntype AgentHost = { provider: Provider; agentsDir: string };\n\n/** The extension comes from `agentCodec`, so a `.md` never lands where Codex reads `.toml`. */\nfunction fileNameFor(name: AgentName, provider: Provider): string {\n return `${name}${agentCodec(provider).extension}`;\n}\n","import { Liquid } from \"liquidjs\";\nimport path from \"path\";\nimport {\n buildAgentTemplateContext,\n pluginRefFor,\n renderAgent,\n renderAgentBody,\n renderAgentRoleToml,\n type AgentFiles,\n} from \"@workspace/compile/agent-source\";\nimport { readFile, readFileOptional, directoryExists } from \"../utils/fs\";\nimport { verbose } from \"../utils/logger\";\nimport {\n CLAUDE_DIR,\n DIRS,\n PROJECT_ROOT,\n STANDARD_FILES,\n STANDARD_DIRS,\n type Provider,\n} from \"../consts\";\nimport { providerInUse, sourceFolderInUse, sourceFolderName } from \"./installation/install-layout\";\nimport { cliVersion } from \"./agents/agent-provenance\";\nimport \"./compile-seat.js\";\nimport type { AgentConfig, AgentName } from \"../types\";\n\nexport {\n buildAgentTemplateContext,\n sanitizeCompiledAgentData,\n sanitizeLiquidSyntax,\n} from \"@workspace/compile/agent-source\";\n\nasync function readAgentFiles(\n name: AgentName,\n agent: AgentConfig,\n projectRoot: string,\n): Promise<AgentFiles> {\n const agentSourceRoot = agent.sourceRoot || projectRoot;\n const agentBaseDir = agent.agentBaseDir || DIRS.agents;\n const agentPath = agent.path || name;\n const agentDir = path.join(agentSourceRoot, agentBaseDir, agentPath);\n\n const identity = await readFile(path.join(agentDir, STANDARD_FILES.IDENTITY_MD));\n const playbook = await readFile(path.join(agentDir, STANDARD_FILES.PLAYBOOK_MD));\n const criticalRequirementsTop = await readFileOptional(\n path.join(agentDir, STANDARD_FILES.CRITICAL_REQUIREMENTS_MD),\n \"\",\n );\n const criticalReminders = await readFileOptional(\n path.join(agentDir, STANDARD_FILES.CRITICAL_REMINDERS_MD),\n \"\",\n );\n\n const category = agentPath.split(\"/\")[0] || name;\n const categoryDir = path.join(agentSourceRoot, agentBaseDir, category);\n const output = await readOutputPartial(agentDir, categoryDir);\n\n return { identity, playbook, output, criticalRequirementsTop, criticalReminders };\n}\n\n/** The agent's own `output.md`, or its category's where the agent's is absent or empty. */\nasync function readOutputPartial(agentDir: string, categoryDir: string): Promise<string> {\n const own = await readFileOptional(path.join(agentDir, STANDARD_FILES.OUTPUT_MD), \"\");\n if (own) return own;\n return readFileOptional(path.join(categoryDir, STANDARD_FILES.OUTPUT_MD), \"\");\n}\n\n/**\n * Template roots, first match wins: the project source folder's `agents/_templates/`, legacy\n * `.claude/templates/`, then the built-ins. The options mirror `createEngineFromTemplates` in\n * `@workspace/compile/engine`; keep the two in sync.\n */\nexport async function createLiquidEngine(projectDir?: string): Promise<Liquid> {\n const roots: string[] = [];\n // One read for both: template overrides and source folder must name one installation.\n const provider = providerInUse(projectDir);\n\n if (projectDir) {\n const srcTemplatesDir = path.join(\n sourceFolderInUse(projectDir, provider).dir,\n STANDARD_DIRS.AGENTS,\n path.basename(DIRS.templates),\n );\n if (await directoryExists(srcTemplatesDir)) {\n roots.push(srcTemplatesDir);\n verbose(`Using local templates from: ${srcTemplatesDir}`);\n }\n\n const legacyTemplatesDir = path.join(projectDir, CLAUDE_DIR, STANDARD_DIRS.TEMPLATES);\n if (await directoryExists(legacyTemplatesDir)) {\n roots.push(legacyTemplatesDir);\n verbose(`Using legacy templates from: ${legacyTemplatesDir}`);\n }\n }\n\n roots.push(path.join(PROJECT_ROOT, DIRS.templates));\n\n return new Liquid({\n root: roots,\n extname: \".liquid\",\n strictVariables: false,\n strictFilters: true,\n globals: { sourceFolder: sourceFolderName(projectDir, provider) },\n });\n}\n\n/** Both hosts render from one template context; only the wrapper differs (markdown or TOML). */\nexport async function compileAgentForHost(\n provider: Provider,\n name: AgentName,\n agent: AgentConfig,\n fallbackRoot: string,\n engine: Liquid,\n): Promise<string> {\n verbose(`Compiling agent: ${name} (${provider})`);\n\n const files = await readAgentFiles(name, agent, fallbackRoot);\n\n // Each skill's own `source` decides `${id}:${id}` versus a bare id; no `source` means bare.\n const data = buildAgentTemplateContext(name, agent, files, (skill) => ({\n ...skill,\n ...pluginRefFor(skill),\n }));\n const version = await cliVersion();\n\n switch (provider) {\n case \"claude\":\n return renderAgent(engine, data, version);\n case \"codex\":\n return renderAgentRoleToml(agent, await renderAgentBody(engine, data, version));\n default: {\n const _exhaustive: never = provider;\n return _exhaustive;\n }\n }\n}\n","import path from \"path\";\nimport { z } from \"zod\";\n\nimport { PROJECT_ROOT, STANDARD_FILES } from \"../../consts\";\nimport { readFile } from \"../../utils/fs\";\n\nconst ownPackageJsonSchema = z.object({ version: z.string().min(1) });\n\nexport {\n hasProvenanceMarker,\n provenanceMarker,\n stampProvenanceMarker,\n} from \"@workspace/compile/agent-source\";\n\nlet ownVersion: Promise<string> | undefined;\n\n/**\n * Rendered in the trailing `<system-reminder>`, not the provenance marker, so a version bump leaves\n * the first cacheable bytes of every compiled agent unchanged.\n */\nexport function cliVersion(): Promise<string> {\n ownVersion ??= readOwnVersion();\n return ownVersion;\n}\n\nasync function readOwnVersion(): Promise<string> {\n const manifestPath = path.join(PROJECT_ROOT, STANDARD_FILES.PACKAGE_JSON);\n const raw: unknown = JSON.parse(await readFile(manifestPath));\n\n const parsed = ownPackageJsonSchema.safeParse(raw);\n if (!parsed.success) {\n throw new Error(`Could not read this CLI's own version from ${manifestPath}`);\n }\n return parsed.data.version;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;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O,qBAAqB,UAAU,eAAe;AACvD;AAEA,eAAe,4BAA4B,WAAkD;AAC3F,QAAM,SAAS,MAAM,kBAAkB,SAAS;AAChD,SAAO,SAAS,sBAAsB,OAAO,MAAM,IAAI;AACzD;AAGA,eAAe,qBACb,YACA,YACsD;AACtD,QAAM,gBAAgB,MAAM,cAAc,UAAU;AACpD,QAAM,gBAAgB,aAAa,MAAM,kBAAkB,UAAU,IAAI,CAAC;AAE1E,SAAO,EAAE,GAAG,eAAe,GAAG,cAAc;AAC9C;AAEA,SAAS,iBACP,QACA,QACA,WACe;AACf,SAAO;AAAA,IACL,MAAM,QAAQ,QAAQC,MAAK,SAAS,SAAS;AAAA,IAC7C,aAAa,QAAQ,eAAe;AAAA,IACpC;AAAA,EACF;AACF;AAGA,SAAS,kBACP,YACA,QACA,WAC6F;AAC7F,QAAM,kBAAkB,SAAS,mBAAmB,QAAQ,SAAS,IAAI,CAAC;AAE1E,QAAM,CAAC,aAAa,aAAa,IAAID;AAAA,IAAU;AAAA,IAAY,CAAC,SAC1D,QAAQ,gBAAgB,IAAI,KAAK,UAAU,IAAI,CAAC;AAAA,EAClD;AAEA,SAAO;AAAA,IACL,cAAc;AAAA,MACZ,YAAY,IAAI,CAAC,SAAS,CAAC,MAAM,gBAAgB,IAAI,KAAK,CAAC,CAAC,CAAC;AAAA,IAC/D;AAAA,IACA,iBAAiB,cAAc,IAAI,CAAC,SAAS,UAAU,IAAI,mCAAmC;AAAA,EAChG;AACF;","names":["partition","path","path","path","path","path","path","path","partition","path"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/hosts/configured-placements.ts"],"sourcesContent":["/**\n * The placement refusal on the read path: `config.ts` carries no provider, so a config copied into\n * another provider's folder never met that host's pre-flight. Not run by `uninstall`, which must\n * still be able to remove such an installation.\n */\n\nimport {\n ConfigLoadError,\n configDirsInPlay,\n loadInstalledConfig,\n} from \"../configuration/project-config.js\";\nimport { getErrorMessage } from \"../../utils/errors.js\";\nimport type { SkillConfig } from \"../../types/config.js\";\nimport { hostAt } from \"./host-for.js\";\nimport { refuseUnofferedPlacements } from \"./offered-placements.js\";\n\n/** Both scopes, each asked of its OWN host: the two scopes can be on different providers. */\nexport async function unofferablePlacementsFound(cwd: string): Promise<string[]> {\n const findings = await Promise.all(configDirsInPlay(cwd).map(unofferablePlacementIn));\n return findings.filter((finding): finding is string => finding !== null);\n}\n\nasync function unofferablePlacementIn(root: string): Promise<string | null> {\n const skills = await configuredSkillsAt(root);\n if (skills === null) return null;\n\n try {\n refuseUnofferedPlacements(skills, hostAt(root));\n return null;\n } catch (error) {\n return getErrorMessage(error);\n }\n}\n\n/** Degrades on `ConfigLoadError` only, which `ensureConfigReadable` and doctor report by name. */\nasync function configuredSkillsAt(root: string): Promise<SkillConfig[] | null> {\n try {\n const loaded = await loadInstalledConfig(root);\n return loaded?.config.skills ?? null;\n } catch (error) {\n if (error instanceof ConfigLoadError) return null;\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;;;AAiBA,eAAsB,2BAA2B,KAAgC;AAC/E,QAAM,WAAW,MAAM,QAAQ,IAAI,iBAAiB,GAAG,EAAE,IAAI,sBAAsB,CAAC;AACpF,SAAO,SAAS,OAAO,CAAC,YAA+B,YAAY,IAAI;AACzE;AAEA,eAAe,uBAAuB,MAAsC;AAC1E,QAAM,SAAS,MAAM,mBAAmB,IAAI;AAC5C,MAAI,WAAW,KAAM,QAAO;AAE5B,MAAI;AACF,8BAA0B,QAAQ,OAAO,IAAI,CAAC;AAC9C,WAAO;AAAA,EACT,SAAS,OAAO;AACd,WAAO,gBAAgB,KAAK;AAAA,EAC9B;AACF;AAGA,eAAe,mBAAmB,MAA6C;AAC7E,MAAI;AACF,UAAM,SAAS,MAAM,oBAAoB,IAAI;AAC7C,WAAO,QAAQ,OAAO,UAAU;AAAA,EAClC,SAAS,OAAO;AACd,QAAI,iBAAiB,gBAAiB,QAAO;AAC7C,UAAM;AAAA,EACR;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/common/skill-agent-summary.tsx","../src/cli/lib/configuration/scope-diff.ts"],"sourcesContent":["import { Box, Text } from \"ink\";\nimport React from \"react\";\nimport { CLI_COLORS, EJECT_SOURCE, UI_SYMBOLS } from \"../../consts.js\";\nimport { computeScopeDiff } from \"../../lib/configuration/scope-diff.js\";\nimport type {\n AgentDiffRow,\n DiffRowStatus,\n ScopeDiffInput,\n SkillDiffRow,\n} from \"../../lib/configuration/scope-diff.js\";\nimport { getSkillDisplayName } from \"../../lib/matrix/matrix-provider.js\";\nimport type { AgentScopeConfig, SkillConfig } from \"../../types/config.js\";\nimport type { SkillId } from \"../../types/skills.js\";\nimport { inertLine } from \"../../utils/string.js\";\n\nexport type SkillAgentSummaryProps = Pick<\n ScopeDiffInput,\n | \"installedSkillConfigs\"\n | \"installedAgentConfigs\"\n | \"isInitMode\"\n | \"overwrittenSkillIds\"\n | \"changedAgentNames\"\n> & {\n skillConfigs: SkillConfig[];\n agentConfigs: AgentScopeConfig[];\n /** Read off each copy's metadata.yaml by a run that loads no marketplace to name them from. */\n skillNames?: ReadonlyMap<SkillId, string>;\n};\n\nconst NO_NAMES: ReadonlyMap<SkillId, string> = new Map();\n\n/** A name the run read stands over the catalogue's: it is what that copy says it is. */\nfunction skillNameOf(id: SkillId, names: ReadonlyMap<SkillId, string>): string {\n const recorded = names.get(id);\n return recorded === undefined ? getSkillDisplayName(id) : inertLine(recorded);\n}\n\nconst TableHeader: React.FC<{ children: React.ReactNode }> = ({ children }) => (\n <Text bold color={CLI_COLORS.WARNING}>\n {children}\n </Text>\n);\n\nconst ScopeLabel: React.FC<{ children: string }> = ({ children }) => (\n <Text color={CLI_COLORS.WHITE} backgroundColor={CLI_COLORS.LABEL_BG}>\n {` ${children} `}\n </Text>\n);\n\nconst EjectIcon: React.FC = () => <Text color={CLI_COLORS.WARNING}> {UI_SYMBOLS.EJECT}</Text>;\n\nconst DIFF_PREFIX: Record<DiffRowStatus, string> = {\n added: `${UI_SYMBOLS.ADDED} `,\n \"mode-changed\": `${UI_SYMBOLS.CHANGED} `,\n overwritten: `${UI_SYMBOLS.OVERWRITTEN} `,\n changed: `${UI_SYMBOLS.CHANGED} `,\n removed: `${UI_SYMBOLS.REMOVED} `,\n unchanged: `${UI_SYMBOLS.BULLET} `,\n};\n\nconst DIFF_COLOR: Record<DiffRowStatus, string> = {\n added: CLI_COLORS.SUCCESS,\n \"mode-changed\": CLI_COLORS.WARNING,\n overwritten: CLI_COLORS.WARNING,\n changed: CLI_COLORS.WARNING,\n removed: CLI_COLORS.ERROR,\n unchanged: CLI_COLORS.NEUTRAL,\n};\n\n/**\n * Yoga widens a text to whole columns on both sides and Ink draws it from its rounded left, so a\n * name in a half that starts or ends mid-column draws up to two columns past the half: over the\n * next name, or over the table's border. The third column stays blank.\n */\nconst NAME_GUTTER_COLUMNS = 3;\n\n/**\n * A long name wraps under itself, beside a prefix that never shrinks, and carries its mark in its\n * own text: drawn beside the name, the mark covered its last letters.\n */\nconst SkillRow: React.FC<{ row: SkillDiffRow; name: string }> = ({ row, name }) => (\n <Box width=\"50%\" paddingRight={NAME_GUTTER_COLUMNS}>\n <Box flexShrink={0}>\n <Text color={DIFF_COLOR[row.status]}>{DIFF_PREFIX[row.status]}</Text>\n </Box>\n <Text color={DIFF_COLOR[row.status]}>\n {name}\n {row.source === EJECT_SOURCE && <EjectIcon />}\n </Text>\n </Box>\n);\n\nconst AgentRow: React.FC<{ row: AgentDiffRow }> = ({ row }) => (\n <Text color={DIFF_COLOR[row.status]}>\n {DIFF_PREFIX[row.status]}\n {row.name}\n </Text>\n);\n\nconst skillRowKey = (row: SkillDiffRow): string =>\n row.status === \"removed\" ? `removed-${row.id}` : row.id;\n\nconst agentRowKey = (row: AgentDiffRow): string =>\n row.status === \"removed\" ? `removed-${row.name}` : row.name;\n\nexport const SkillAgentSummary: React.FC<SkillAgentSummaryProps> = ({\n skillConfigs,\n agentConfigs,\n skillNames = NO_NAMES,\n ...baseline\n}) => {\n const diff = computeScopeDiff({\n currentSkills: skillConfigs,\n currentAgents: agentConfigs,\n ...baseline,\n });\n\n if (!diff.hasContent) return null;\n\n return (\n <Box flexDirection=\"row\" width=\"100%\">\n <Box\n flexDirection=\"column\"\n borderStyle=\"single\"\n flexGrow={2}\n flexBasis={0}\n borderRight={true}\n borderTop={false}\n borderBottom={false}\n borderLeft={false}\n borderColor={CLI_COLORS.NEUTRAL}\n borderRightDimColor\n >\n <TableHeader>Skills</TableHeader>\n {diff.projectSkillRows.length > 0 && (\n <Box flexDirection=\"column\" marginTop={1}>\n <ScopeLabel>Project</ScopeLabel>\n <Box flexWrap=\"wrap\">\n {diff.projectSkillRows.map((row) => (\n <SkillRow key={skillRowKey(row)} row={row} name={skillNameOf(row.id, skillNames)} />\n ))}\n </Box>\n </Box>\n )}\n {diff.globalSkillRows.length > 0 && (\n <Box flexDirection=\"column\" marginTop={1}>\n <ScopeLabel>Global</ScopeLabel>\n <Box flexWrap=\"wrap\">\n {diff.globalSkillRows.map((row) => (\n <SkillRow key={skillRowKey(row)} row={row} name={skillNameOf(row.id, skillNames)} />\n ))}\n </Box>\n </Box>\n )}\n </Box>\n <Box flexDirection=\"column\" flexGrow={1} flexBasis={0} marginLeft={1} paddingLeft={1}>\n <TableHeader>Agents</TableHeader>\n {diff.projectAgentRows.length > 0 && (\n <Box flexDirection=\"column\" marginTop={1}>\n <ScopeLabel>Project</ScopeLabel>\n <Box flexDirection=\"column\">\n {diff.projectAgentRows.map((row) => (\n <AgentRow key={agentRowKey(row)} row={row} />\n ))}\n </Box>\n </Box>\n )}\n {diff.globalAgentRows.length > 0 && (\n <Box flexDirection=\"column\" marginTop={1}>\n <ScopeLabel>Global</ScopeLabel>\n <Box flexDirection=\"column\">\n {diff.globalAgentRows.map((row) => (\n <AgentRow key={agentRowKey(row)} row={row} />\n ))}\n </Box>\n </Box>\n )}\n </Box>\n </Box>\n );\n};\n","import { difference, partition, unique } from \"remeda\";\nimport type { AgentScopeConfig, SkillConfig, SkillScope } from \"../../types/config\";\nimport type { AgentName, SkillId, StackAgentConfig } from \"../../types/index\";\nimport { typedValues } from \"../../utils/typed-object\";\nimport { isActiveAt, isGlobalTombstone, type ScopedEntry } from \"./scope-predicates\";\n\nexport type ScopeDiffInput = {\n currentSkills: SkillConfig[];\n currentAgents: AgentScopeConfig[];\n installedSkillConfigs: SkillConfig[] | null;\n installedAgentConfigs: AgentScopeConfig[] | null;\n isInitMode: boolean;\n /** Skills whose files the run writes over where they stand. */\n overwrittenSkillIds?: ReadonlySet<SkillId>;\n /** Sub-agents that keep their slot and still change. */\n changedAgentNames?: ReadonlySet<AgentName>;\n};\n\nexport type DiffRowStatus =\n \"added\" | \"mode-changed\" | \"overwritten\" | \"changed\" | \"removed\" | \"unchanged\";\n\nexport type SkillDiffRow = {\n id: SkillId;\n source: string;\n status: Exclude<DiffRowStatus, \"changed\">;\n};\n\nexport type AgentDiffRow = {\n name: AgentName;\n status: Exclude<DiffRowStatus, \"mode-changed\" | \"overwritten\">;\n};\n\nexport type ScopeDiff = {\n projectSkillRows: SkillDiffRow[];\n globalSkillRows: SkillDiffRow[];\n projectAgentRows: AgentDiffRow[];\n globalAgentRows: AgentDiffRow[];\n hasContent: boolean;\n};\n\nconst NOTHING: ReadonlySet<never> = new Set();\n\n/** One scope's share of a roster's diff: the entries listed with a status, then the removals. */\ntype ScopeEntries<Entry> = { listed: Entry[]; removed: Entry[] };\n\ntype RosterDiff<Entry> = Record<SkillScope, ScopeEntries<Entry>>;\n\n/**\n * A tombstone occupies its (id, scope) slot without filling it: it silences a global install at\n * project scope. Slot checks count tombstones; removal and `~` read the active baseline only.\n */\nexport function computeScopeDiff(input: ScopeDiffInput): ScopeDiff {\n const { currentSkills, currentAgents, installedSkillConfigs, installedAgentConfigs, isInitMode } =\n input;\n const overwritten = input.overwrittenSkillIds ?? NOTHING;\n const changed = input.changedAgentNames ?? NOTHING;\n\n const skills = diffRoster(currentSkills, installedSkillConfigs, (skill) => skill.id, isInitMode);\n const agents = diffRoster(\n currentAgents,\n installedAgentConfigs,\n (agent) => agent.name,\n isInitMode,\n );\n const skillRow = skillRowClassifier(installedSkillConfigs, overwritten);\n const agentRow = agentRowClassifier(installedAgentConfigs, changed);\n\n const projectSkillRows = rowsOf(skills.project, skillRow, toRemovedSkillRow);\n const globalSkillRows = rowsOf(skills.global, skillRow, toRemovedSkillRow);\n const projectAgentRows = rowsOf(agents.project, agentRow, toRemovedAgentRow);\n const globalAgentRows = rowsOf(agents.global, agentRow, toRemovedAgentRow);\n\n const hasContent = [projectSkillRows, globalSkillRows, projectAgentRows, globalAgentRows].some(\n (rows) => rows.length > 0,\n );\n\n return { projectSkillRows, globalSkillRows, projectAgentRows, globalAgentRows, hasContent };\n}\n\nfunction diffRoster<Entry extends ScopedEntry>(\n current: Entry[],\n installed: Entry[] | null,\n identityOf: (entry: Entry) => string,\n isInitMode: boolean,\n): RosterDiff<Entry> {\n // The installs the baseline actually records; tombstones are not installs.\n const activeBaseline = (installed ?? []).filter((entry) => !entry.excluded);\n const vacated = vacatedInstalls(activeBaseline, current, identityOf);\n const projectEntries = current.filter((entry) => isActiveAt(entry, \"project\"));\n const claimedByProject = new Set(projectEntries.map(identityOf));\n // A vacated global the project claims is inherited: listed once under Global, never removed.\n const [inheritedGlobals, removedGlobals] = partition(\n vacated.filter((entry) => entry.scope === \"global\"),\n (entry) => claimedByProject.has(identityOf(entry)),\n );\n\n return {\n project: {\n listed: projectEntries,\n removed: vacated.filter((entry) => entry.scope === \"project\"),\n },\n global: {\n listed: [\n ...current.filter((entry) => isActiveAt(entry, \"global\")),\n ...inheritedGlobals,\n ...current.filter(isGlobalTombstone),\n ],\n removed: isInitMode ? [] : removedGlobals,\n },\n };\n}\n\n/** Baseline installs whose slot nothing in current, active or tombstone, occupies. */\nfunction vacatedInstalls<Entry extends ScopedEntry>(\n activeBaseline: Entry[],\n current: Entry[],\n identityOf: (entry: Entry) => string,\n): Entry[] {\n const slotOf = (entry: Entry) => slotKey(identityOf(entry), entry.scope);\n const occupiedSlots = new Set(current.map(slotOf));\n return activeBaseline.filter((install) => !occupiedSlots.has(slotOf(install)));\n}\n\nfunction rowsOf<Entry, Row>(\n entries: ScopeEntries<Entry>,\n toRow: (entry: Entry) => Row,\n toRemovedRow: (entry: Entry) => Row,\n): Row[] {\n return [...entries.listed.map(toRow), ...entries.removed.map(toRemovedRow)];\n}\n\n/** The `(id, scope)` SLOT key this module diffs on, rather than the id alone. */\nfunction slotKey(identity: string, scope: SkillScope | undefined): string {\n return `${identity}:${scope}`;\n}\n\nexport function formatScopeTag(scope: SkillScope): \"[G]\" | \"[P]\" {\n return scope === \"global\" ? \"[G]\" : \"[P]\";\n}\n\nfunction skillRowClassifier(\n installed: SkillConfig[] | null,\n overwritten: ReadonlySet<SkillId>,\n): (skill: SkillConfig) => SkillDiffRow {\n const installedSlots = installed\n ? new Set(installed.map((skill) => slotKey(skill.id, skill.scope)))\n : null;\n const installedOriginBySlot = installed\n ? new Map(\n installed\n .filter((skill) => !skill.excluded)\n .map((skill) => [slotKey(skill.id, skill.scope), skill.origin]),\n )\n : null;\n return (skill) => ({\n id: skill.id,\n source: skill.origin,\n status: skillStatus(skill, installedSlots, installedOriginBySlot, overwritten),\n });\n}\n\nfunction agentRowClassifier(\n installed: AgentScopeConfig[] | null,\n changed: ReadonlySet<AgentName>,\n): (agent: AgentScopeConfig) => AgentDiffRow {\n const installedSlots = installed\n ? new Set(installed.map((agent) => slotKey(agent.name, agent.scope)))\n : null;\n return (agent) => ({ name: agent.name, status: agentStatus(agent, installedSlots, changed) });\n}\n\n/**\n * Compares `origin`, which is where a skill's install mode is recorded. An overwrite outranks a\n * mode change: a copy its plugin replaces is deleted, not merely switched. A mask is never written.\n */\nfunction skillStatus(\n skill: SkillConfig,\n installedSlots: Set<string> | null,\n installedOriginBySlot: Map<string, string> | null,\n overwritten: ReadonlySet<SkillId>,\n): SkillDiffRow[\"status\"] {\n const slot = slotKey(skill.id, skill.scope);\n if (installedSlots === null || !installedSlots.has(slot)) return \"added\";\n if (!skill.excluded && overwritten.has(skill.id)) return \"overwritten\";\n\n const installedOrigin = installedOriginBySlot?.get(slot);\n const modeChanged = installedOrigin != null && installedOrigin !== skill.origin;\n return modeChanged ? \"mode-changed\" : \"unchanged\";\n}\n\n/** A mask is never the sub-agent that changes: its active half is. */\nfunction agentStatus(\n agent: AgentScopeConfig,\n installedSlots: Set<string> | null,\n changed: ReadonlySet<AgentName>,\n): AgentDiffRow[\"status\"] {\n const isNew = installedSlots === null || !installedSlots.has(slotKey(agent.name, agent.scope));\n if (isNew) return \"added\";\n return !agent.excluded && changed.has(agent.name) ? \"changed\" : \"unchanged\";\n}\n\nfunction toRemovedSkillRow(skill: SkillConfig): SkillDiffRow {\n return { id: skill.id, source: skill.origin, status: \"removed\" };\n}\n\nfunction toRemovedAgentRow(agent: AgentScopeConfig): AgentDiffRow {\n return { name: agent.name, status: \"removed\" };\n}\n\n/** A sub-agent that keeps its slot and still changes: the skills its rows gain and lose, and its retunes. */\nexport type AgentChange = {\n name: AgentName;\n scope: SkillScope;\n gains: SkillId[];\n loses: SkillId[];\n settings: SettingChange[];\n};\n\n/** `undefined` where the setting is left to its default. */\nexport type SettingChange = {\n setting: AgentSetting;\n from: string | undefined;\n to: string | undefined;\n};\n\ntype AgentSetting = \"model\" | \"codex model\" | \"effort\";\n\nconst AGENT_SETTINGS: ReadonlyArray<\n [AgentSetting, (agent: AgentScopeConfig) => string | undefined]\n> = [\n [\"model\", (agent) => agent.model],\n [\"codex model\", (agent) => agent.codexModel],\n [\"effort\", (agent) => agent.effort],\n];\n\n/** One sub-agent as a config records it: its entry and its skill rows. */\nexport type AgentState = { agent: AgentScopeConfig; rows: StackAgentConfig | undefined };\n\ntype AgentsAndRows = {\n agents: AgentScopeConfig[];\n stack?: Partial<Record<string, StackAgentConfig>>;\n};\n\n/** How each named sub-agent moves between two configs; one either config lacks is not named. */\nexport function agentChangesAmong(\n names: readonly AgentName[],\n before: AgentsAndRows,\n after: AgentsAndRows,\n): AgentChange[] {\n return names.flatMap((name) => {\n const was = agentStateIn(before, name);\n const is = agentStateIn(after, name);\n return was === undefined || is === undefined ? [] : [agentChange(was, is)];\n });\n}\n\n/** Its active entry, never the mask a project's own copy leaves; `undefined` where none is. */\nfunction agentStateIn(config: AgentsAndRows, name: AgentName): AgentState | undefined {\n const agent = config.agents.find((entry) => entry.name === name && !entry.excluded);\n return agent === undefined ? undefined : { agent, rows: config.stack?.[name] };\n}\n\nexport function agentChange(before: AgentState, after: AgentState): AgentChange {\n const beforeIds = assignedSkillIds(before.rows);\n const afterIds = assignedSkillIds(after.rows);\n\n return {\n name: after.agent.name,\n scope: after.agent.scope,\n gains: difference(afterIds, beforeIds),\n loses: difference(beforeIds, afterIds),\n settings: settingChanges(before.agent, after.agent),\n };\n}\n\nfunction settingChanges(before: AgentScopeConfig, after: AgentScopeConfig): SettingChange[] {\n return AGENT_SETTINGS.filter(([, read]) => read(before) !== read(after)).map(\n ([setting, read]) => ({ setting, from: read(before), to: read(after) }),\n );\n}\n\nfunction assignedSkillIds(rows: StackAgentConfig | undefined): SkillId[] {\n return unique(typedValues(rows ?? {}).flatMap((assignments) => assignments.map(({ id }) => id)));\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,OAAkB;;;ACDlB,SAAS,YAAY,WAAW,cAAc;AAwC9C,IAAM,UAA8B,oBAAI,IAAI;AAWrC,SAAS,iBAAiB,OAAkC;AACjE,QAAM,EAAE,eAAe,eAAe,uBAAuB,uBAAuB,WAAW,IAC7F;AACF,QAAM,cAAc,MAAM,uBAAuB;AACjD,QAAM,UAAU,MAAM,qBAAqB;AAE3C,QAAM,SAAS,WAAW,eAAe,uBAAuB,CAAC,UAAU,MAAM,IAAI,UAAU;AAC/F,QAAM,SAAS;AAAA,IACb;AAAA,IACA;AAAA,IACA,CAAC,UAAU,MAAM;AAAA,IACjB;AAAA,EACF;AACA,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