agents-inc 0.159.0 → 0.161.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 +23 -0
- package/README.md +1 -1
- package/dist/{chunk-PEHYVSJG.js → chunk-264XDRU7.js} +2 -2
- package/dist/{chunk-WVKGO3Y5.js → chunk-2MPXMJ2O.js} +7 -7
- package/dist/{chunk-IO2DPRDS.js → chunk-3H42U56X.js} +2 -2
- package/dist/{chunk-FBRLHNUT.js → chunk-3M75HVIM.js} +3 -3
- package/dist/{chunk-YKRPWZ3G.js → chunk-3TM4FHTG.js} +2 -2
- package/dist/{chunk-5YOSLSQJ.js → chunk-5DWDT6GM.js} +115 -96
- package/dist/chunk-5DWDT6GM.js.map +1 -0
- package/dist/{chunk-4APXK7ZY.js → chunk-5MML3K36.js} +2 -2
- package/dist/{chunk-F35G42TF.js → chunk-6PVWDTEM.js} +12 -12
- package/dist/{chunk-VCUXNKOY.js → chunk-A2NA377T.js} +6 -6
- package/dist/{chunk-4RYWFQK7.js → chunk-ADDYIMWN.js} +3 -3
- package/dist/{chunk-V625APR6.js → chunk-AMZO4YJK.js} +10789 -18786
- package/dist/chunk-AMZO4YJK.js.map +1 -0
- package/dist/{chunk-4VMLCWLD.js → chunk-AO6DXJUK.js} +3 -3
- package/dist/{chunk-G7TYOPON.js → chunk-B3YSTZZC.js} +3 -3
- package/dist/{chunk-THLQS2AW.js → chunk-B7YTQVAF.js} +4 -4
- package/dist/{chunk-7Z4N4JWQ.js → chunk-BLGETWYI.js} +6 -113
- package/dist/chunk-BLGETWYI.js.map +1 -0
- package/dist/{chunk-ITEJARWI.js → chunk-BRHU6J3C.js} +3 -3
- package/dist/{chunk-AU5FS3QK.js → chunk-DGXW2ZFY.js} +3 -3
- package/dist/{chunk-LSSGS2QS.js → chunk-DHRW3MDM.js} +3 -3
- package/dist/{chunk-OJIQOVWB.js → chunk-DTCUZL7S.js} +2 -2
- package/dist/{chunk-SKDTGHCD.js → chunk-EEFTUZHZ.js} +5 -5
- package/dist/{chunk-BQJVHD6Y.js → chunk-EERGAAGE.js} +5 -10
- package/dist/chunk-EERGAAGE.js.map +1 -0
- package/dist/{chunk-Z6G24ROK.js → chunk-EQSMVZGS.js} +10 -10
- package/dist/{chunk-2Q65K6E3.js → chunk-EY7Z34Y4.js} +15 -15
- package/dist/{chunk-BNHD2GIB.js → chunk-F6LS2BQD.js} +11 -11
- package/dist/{chunk-SITF5EZM.js → chunk-HB3YIAFD.js} +2 -2
- package/dist/{chunk-GPZQCLZJ.js → chunk-LZPRLHUE.js} +9 -9
- package/dist/{chunk-YAHTF4NO.js → chunk-MED6GNV3.js} +288 -203
- package/dist/chunk-MED6GNV3.js.map +1 -0
- package/dist/chunk-N6CILY5A.js +35 -0
- package/dist/chunk-N6CILY5A.js.map +1 -0
- package/dist/{chunk-42PQKBVU.js → chunk-ODUACQLV.js} +6 -6
- package/dist/{chunk-VZRO7RYT.js → chunk-OI2H6M5I.js} +1 -103
- package/dist/chunk-OI2H6M5I.js.map +1 -0
- package/dist/{chunk-MPLWPWL4.js → chunk-QKMT6OOP.js} +2 -2
- package/dist/{chunk-WVBJRFFM.js → chunk-SX57ZIGM.js} +4 -4
- package/dist/{chunk-62XKTOUI.js → chunk-T4RVCFWN.js} +5 -15
- package/dist/chunk-T4RVCFWN.js.map +1 -0
- package/dist/{chunk-4VVKVOOP.js → chunk-UMYEY6BA.js} +2 -2
- package/dist/{chunk-X5PLVOJS.js → chunk-W2RXRWDB.js} +2 -2
- package/dist/{chunk-JV4P7BL4.js → chunk-WVCF7KFV.js} +5 -5
- package/dist/chunk-XA4SWA2Z.js +591 -0
- package/dist/chunk-XA4SWA2Z.js.map +1 -0
- package/dist/{chunk-LVA6XJGR.js → chunk-YOVUXONB.js} +9 -43
- package/dist/chunk-YOVUXONB.js.map +1 -0
- package/dist/chunk-YSQ76LWG.js +8734 -0
- package/dist/chunk-YSQ76LWG.js.map +1 -0
- package/dist/{chunk-Z6KROWH4.js → chunk-ZQZHDYHQ.js} +7 -7
- package/dist/commands/build/marketplace.js +8 -8
- package/dist/commands/build/plugins.js +8 -8
- package/dist/commands/compile.js +14 -14
- package/dist/commands/doctor.js +13 -13
- package/dist/commands/edit.js +45 -45
- package/dist/commands/eject.js +11 -11
- package/dist/commands/init.js +37 -37
- package/dist/commands/list.js +9 -9
- package/dist/commands/new/marketplace.js +8 -9
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/search.js +11 -11
- package/dist/commands/share.js +11 -10
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/uninstall.js +12 -12
- package/dist/commands/update.js +7 -7
- package/dist/components/common/removal-plan-confirm.js +2 -2
- package/dist/components/common/select-list.js +2 -2
- package/dist/components/wizard/category-grid.js +4 -4
- package/dist/components/wizard/checkbox-grid.js +4 -4
- package/dist/components/wizard/domain-selection.js +10 -10
- package/dist/components/wizard/run-wizard-session.js +27 -27
- package/dist/components/wizard/scroll-affordance.js +2 -2
- package/dist/components/wizard/skill-agent-summary.js +6 -6
- package/dist/components/wizard/source-grid.js +5 -5
- package/dist/components/wizard/stack-selection.js +8 -8
- package/dist/components/wizard/step-agents.js +9 -9
- package/dist/components/wizard/step-build.js +8 -8
- package/dist/components/wizard/step-confirm.js +10 -10
- package/dist/components/wizard/step-sources.js +9 -9
- package/dist/components/wizard/step-stack.js +9 -9
- package/dist/components/wizard/summary-panel.js +9 -9
- package/dist/components/wizard/toast.js +2 -2
- package/dist/components/wizard/wizard-layout.js +13 -13
- package/dist/components/wizard/wizard-tabs.js +2 -2
- package/dist/components/wizard/wizard.js +26 -26
- package/dist/config-exports.js +1 -1
- package/dist/hooks/init.js +37 -37
- package/dist/load-agent-defs-LDSND43G.js +13 -0
- package/dist/recompile-project-agents-GQLODH24.js +17 -0
- package/dist/{source-loader-CC6ZWKTI.js → source-loader-TSF5VS6V.js} +5 -5
- package/dist/src/agents/_templates/methodologies/anti-over-engineering.liquid +14 -0
- package/dist/src/agents/_templates/methodologies/context-management.liquid +7 -154
- package/dist/src/agents/_templates/methodologies/investigation-requirements.liquid +12 -0
- package/dist/src/agents/_templates/methodologies/success-criteria.liquid +10 -0
- package/dist/stores/wizard-store.js +5 -5
- package/package.json +9 -4
- package/src/agents/_templates/methodologies/anti-over-engineering.liquid +14 -0
- package/src/agents/_templates/methodologies/context-management.liquid +7 -154
- package/src/agents/_templates/methodologies/investigation-requirements.liquid +12 -0
- package/src/agents/_templates/methodologies/success-criteria.liquid +10 -0
- package/dist/chunk-5KB4I5J7.js +0 -262
- package/dist/chunk-5KB4I5J7.js.map +0 -1
- package/dist/chunk-5YOSLSQJ.js.map +0 -1
- package/dist/chunk-62XKTOUI.js.map +0 -1
- package/dist/chunk-7Z4N4JWQ.js.map +0 -1
- package/dist/chunk-BQJVHD6Y.js.map +0 -1
- package/dist/chunk-LVA6XJGR.js.map +0 -1
- package/dist/chunk-NS5COBTT.js +0 -254
- package/dist/chunk-NS5COBTT.js.map +0 -1
- package/dist/chunk-V625APR6.js.map +0 -1
- package/dist/chunk-VZRO7RYT.js.map +0 -1
- package/dist/chunk-YAHTF4NO.js.map +0 -1
- package/dist/chunk-YVQSDBTK.js +0 -169
- package/dist/chunk-YVQSDBTK.js.map +0 -1
- package/dist/load-agent-defs-2H42B2OO.js +0 -13
- package/dist/recompile-project-agents-QIAMBCM4.js +0 -17
- /package/dist/{chunk-PEHYVSJG.js.map → chunk-264XDRU7.js.map} +0 -0
- /package/dist/{chunk-WVKGO3Y5.js.map → chunk-2MPXMJ2O.js.map} +0 -0
- /package/dist/{chunk-IO2DPRDS.js.map → chunk-3H42U56X.js.map} +0 -0
- /package/dist/{chunk-FBRLHNUT.js.map → chunk-3M75HVIM.js.map} +0 -0
- /package/dist/{chunk-YKRPWZ3G.js.map → chunk-3TM4FHTG.js.map} +0 -0
- /package/dist/{chunk-4APXK7ZY.js.map → chunk-5MML3K36.js.map} +0 -0
- /package/dist/{chunk-F35G42TF.js.map → chunk-6PVWDTEM.js.map} +0 -0
- /package/dist/{chunk-VCUXNKOY.js.map → chunk-A2NA377T.js.map} +0 -0
- /package/dist/{chunk-4RYWFQK7.js.map → chunk-ADDYIMWN.js.map} +0 -0
- /package/dist/{chunk-4VMLCWLD.js.map → chunk-AO6DXJUK.js.map} +0 -0
- /package/dist/{chunk-G7TYOPON.js.map → chunk-B3YSTZZC.js.map} +0 -0
- /package/dist/{chunk-THLQS2AW.js.map → chunk-B7YTQVAF.js.map} +0 -0
- /package/dist/{chunk-ITEJARWI.js.map → chunk-BRHU6J3C.js.map} +0 -0
- /package/dist/{chunk-AU5FS3QK.js.map → chunk-DGXW2ZFY.js.map} +0 -0
- /package/dist/{chunk-LSSGS2QS.js.map → chunk-DHRW3MDM.js.map} +0 -0
- /package/dist/{chunk-OJIQOVWB.js.map → chunk-DTCUZL7S.js.map} +0 -0
- /package/dist/{chunk-SKDTGHCD.js.map → chunk-EEFTUZHZ.js.map} +0 -0
- /package/dist/{chunk-Z6G24ROK.js.map → chunk-EQSMVZGS.js.map} +0 -0
- /package/dist/{chunk-2Q65K6E3.js.map → chunk-EY7Z34Y4.js.map} +0 -0
- /package/dist/{chunk-BNHD2GIB.js.map → chunk-F6LS2BQD.js.map} +0 -0
- /package/dist/{chunk-SITF5EZM.js.map → chunk-HB3YIAFD.js.map} +0 -0
- /package/dist/{chunk-GPZQCLZJ.js.map → chunk-LZPRLHUE.js.map} +0 -0
- /package/dist/{chunk-42PQKBVU.js.map → chunk-ODUACQLV.js.map} +0 -0
- /package/dist/{chunk-MPLWPWL4.js.map → chunk-QKMT6OOP.js.map} +0 -0
- /package/dist/{chunk-WVBJRFFM.js.map → chunk-SX57ZIGM.js.map} +0 -0
- /package/dist/{chunk-4VVKVOOP.js.map → chunk-UMYEY6BA.js.map} +0 -0
- /package/dist/{chunk-X5PLVOJS.js.map → chunk-W2RXRWDB.js.map} +0 -0
- /package/dist/{chunk-JV4P7BL4.js.map → chunk-WVCF7KFV.js.map} +0 -0
- /package/dist/{chunk-Z6KROWH4.js.map → chunk-ZQZHDYHQ.js.map} +0 -0
- /package/dist/{load-agent-defs-2H42B2OO.js.map → load-agent-defs-LDSND43G.js.map} +0 -0
- /package/dist/{recompile-project-agents-QIAMBCM4.js.map → recompile-project-agents-GQLODH24.js.map} +0 -0
- /package/dist/{source-loader-CC6ZWKTI.js.map → source-loader-TSF5VS6V.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,29 @@ Each release has detailed notes in its own file under [`changelogs/`](./changelo
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
+
## [0.161.0] - 2026-08-30
|
|
11
|
+
|
|
12
|
+
**The renderers leave the CLI for a package both front doors call, an install's config arrives already formatted, and the worker gets one typed client**
|
|
13
|
+
|
|
14
|
+
- The pure config-pair and compiled-agent renderers leave `packages/cli` for `@workspace/compile`, and the CLI's own writers call it — which was the acceptance criterion, not a follow-up, because a shared package the editor imports and the CLI does not is client-side reconstruction with a `package.json`. `config-writer.ts` is a re-export facade now, and `preview-matches-install.e2e.test.ts` byte-compares a real PTY-driven `init` against the package's renderers (EDITOR-52)
|
|
15
|
+
- The emitted `config.ts` and `config-types.ts` arrive already formatted — a prettier fixed point under settings matching neither repository config, because these bytes land in a user's project. `"origin":"eject"` is `origin: 'eject'` from this release on; both parse. One printer replaced three serialisation styles that had coexisted in one file, and the spec was a fixed-point test rather than a literal, so it could not be satisfied by pasting what the emitter already did
|
|
16
|
+
- One typed client for both front doors: `packages/api` holds the `hc<AppType>` client and `fetch-seed.ts` stops hand-writing its fetch. The bundle cost was measured rather than estimated before the ruling was taken — 1,755,475 → 1,765,345 bytes, +9,870, +0.562% (SERVER-02)
|
|
17
|
+
- `generate:compile` is a fourth generator with its own CI drift step, writing the 90 markdown partials and 7 Liquid templates the editor's preview draws with — so a template edit landing without a regeneration turns the commit red instead of leaving the preview drawing bytes no install writes
|
|
18
|
+
- The CLI's network mocks resolve one shared description of the worker: `msw/node` for the unit suite, a real `node:http` server for the e2e suite that spawns the binary. Injecting `NODE_OPTIONS` into the child was ruled out rather than overlooked. The migration's own defect is the lesson — a filter made `stubSignedOut` a total no-op with five call sites passing on the fixture default, and a guard whose failure mode is silence needs a test that the guard fired
|
|
19
|
+
|
|
20
|
+
## [0.160.0] - 2026-08-25
|
|
21
|
+
|
|
22
|
+
**A category is no longer required, a mixed installation counts what it declares, and two rows close by being refuted rather than fixed**
|
|
23
|
+
|
|
24
|
+
- The required-category concept leaves the product entirely — the advisory toast, the `*` header marker, the exclusive-and-required deselect guard and the `required` field on the category types and their three Zod schemas. The reported symptom was never a block: `handleContinue` always called `onContinue()`, so the toast only read as a refusal (CLI-822)
|
|
25
|
+
- A mixed installation counts the skills its configuration declares. `countInstalledSkills` branched on `mode === "plugin"` and otherwise counted directories, so `"mixed"` fell to the eject-only arm and plugin skills were never counted — the published binary printed `Skills: 2` over a config declaring eleven, while `list`'s interactive branch had always held the right answer eleven lines above (CLI-823)
|
|
26
|
+
- An assertion binds to the constant that governs its own data, and a rendering assertion keeps its literal. Eight proposed conversions were stopped by the second half, each of which would have introduced the defect the pass was removing (CLI-829)
|
|
27
|
+
- The positives beside the bound negatives: 8 of 246 converted, and the pass caught that the one before it had broken its own rule at nine sites — the assertion bound while the fixture kept a hardcoded id (CLI-828)
|
|
28
|
+
- Two E2E specs describe behaviour that exists: a comment claiming a Framework skill must be selected before advancing, disproved by a sibling asserting `(0 of 1)`, and a spec named for a deleted guard renamed for what it still proves (CLI-824)
|
|
29
|
+
- A fixture generator's dead return member and a silent no-op option are gone — **zero** call sites ever passed `matrix:`, so a future test using it would have been ignored without a word (CLI-826)
|
|
30
|
+
- `CLI-827` closes **refuted**: the factory was already correct, and the row's evidence had been measured against one TypeScript project where two exist — 6 errors against 83 (CLI-827)
|
|
31
|
+
- `CLI-830` closes as a **documented refusal**, proved in both directions: four plausible-but-wrong values draw complete `tsc` silence under `string` and all four error under the narrowing (CLI-830)
|
|
32
|
+
|
|
10
33
|
## [0.159.0] - 2026-08-24
|
|
11
34
|
|
|
12
35
|
**A configuration can be piped in and a shared id can be opened, the E2E harness takes ownership of the dist guards, and three rows close by disproving their own premise**
|
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ npx agents-inc init
|
|
|
63
63
|
| [Writing custom skills and subagents](https://github.com/agents-inc/agents-inc/blob/main/apps/www/src/content/docs/docs/guides/writing-custom-skills.md) | Author skills and subagents from scratch or iterate on existing ones |
|
|
64
64
|
| [Importing third-party skills](https://github.com/agents-inc/agents-inc/blob/main/apps/www/src/content/docs/docs/guides/importing-skills.md) | Install skills from external repositories |
|
|
65
65
|
| [Creating a marketplace](https://github.com/agents-inc/agents-inc/blob/main/apps/www/src/content/docs/docs/guides/creating-a-marketplace.md) | Build a personal or org-level marketplace with curated skills |
|
|
66
|
-
| [
|
|
66
|
+
| [Documenting your codebase](https://github.com/agents-inc/agents-inc/blob/main/apps/www/src/content/docs/docs/guides/documenting-your-codebase.md) | Generate and maintain AI-focused reference documentation |
|
|
67
67
|
|
|
68
68
|
## Skills
|
|
69
69
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
SCROLL_VIEWPORT
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AMZO4YJK.js";
|
|
5
5
|
|
|
6
6
|
// src/cli/components/hooks/use-section-scroll.ts
|
|
7
7
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
@@ -118,4 +118,4 @@ export {
|
|
|
118
118
|
useSectionScroll,
|
|
119
119
|
computeRowScrollTop
|
|
120
120
|
};
|
|
121
|
-
//# sourceMappingURL=chunk-
|
|
121
|
+
//# sourceMappingURL=chunk-264XDRU7.js.map
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
pluginInstallFailureError,
|
|
5
5
|
unbackedPluginInstallError,
|
|
6
6
|
unbackedPluginSkillIds
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ADDYIMWN.js";
|
|
8
8
|
import {
|
|
9
9
|
clearTerminalScreen,
|
|
10
10
|
formatTerminalTooSmallMessage,
|
|
11
11
|
isTerminalLargeEnough
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UMYEY6BA.js";
|
|
13
13
|
import {
|
|
14
14
|
STATUS_MESSAGES,
|
|
15
15
|
claudePluginMarketplaceAdd,
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
findUnusableSavedSkillMetadata,
|
|
23
23
|
getErrorMessage,
|
|
24
24
|
getStackSkillIds,
|
|
25
|
-
isActiveAt,
|
|
26
25
|
isHomeDirectory,
|
|
27
26
|
pluginsInstalled,
|
|
28
27
|
propagatedRecompileSummary,
|
|
@@ -34,12 +33,13 @@ import {
|
|
|
34
33
|
skillMetadataUnusableDetail,
|
|
35
34
|
verbose,
|
|
36
35
|
warn
|
|
37
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-YSQ76LWG.js";
|
|
38
37
|
import {
|
|
39
38
|
CLI_COLORS,
|
|
40
39
|
DEFAULT_BRANDING,
|
|
41
|
-
MIN_TERMINAL_SIZE
|
|
42
|
-
|
|
40
|
+
MIN_TERMINAL_SIZE,
|
|
41
|
+
isActiveAt
|
|
42
|
+
} from "./chunk-AMZO4YJK.js";
|
|
43
43
|
|
|
44
44
|
// src/cli/lib/exit-codes.ts
|
|
45
45
|
var EXIT_CODES = {
|
|
@@ -477,4 +477,4 @@ export {
|
|
|
477
477
|
EXIT_CODES,
|
|
478
478
|
BaseCommand
|
|
479
479
|
};
|
|
480
|
-
//# sourceMappingURL=chunk-
|
|
480
|
+
//# sourceMappingURL=chunk-2MPXMJ2O.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
StackSelection
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WVCF7KFV.js";
|
|
5
5
|
|
|
6
6
|
// src/cli/components/wizard/step-stack.tsx
|
|
7
7
|
import { Box } from "ink";
|
|
@@ -14,4 +14,4 @@ var StepStack = ({ onCancel }) => {
|
|
|
14
14
|
export {
|
|
15
15
|
StepStack
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-3H42U56X.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
isDomain
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YSQ76LWG.js";
|
|
5
5
|
import {
|
|
6
6
|
findStack
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BLGETWYI.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/components/wizard/utils.ts
|
|
10
10
|
var DOMAIN_DISPLAY_NAMES = {
|
|
@@ -32,4 +32,4 @@ export {
|
|
|
32
32
|
getDomainDisplayName,
|
|
33
33
|
getStackName
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-3M75HVIM.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-OZXAJNLA.js";
|
|
5
5
|
import {
|
|
6
6
|
CLI_COLORS
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AMZO4YJK.js";
|
|
8
8
|
|
|
9
9
|
// src/cli/components/common/removal-plan-confirm.tsx
|
|
10
10
|
import "react";
|
|
@@ -58,4 +58,4 @@ var RemovalPlanConfirm = ({
|
|
|
58
58
|
export {
|
|
59
59
|
RemovalPlanConfirm
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-3TM4FHTG.js.map
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
determinePluginVersion,
|
|
8
8
|
directoryExists,
|
|
9
9
|
discoverAllPluginSkills,
|
|
10
|
-
effectivelyExcludedSkillIds,
|
|
11
10
|
ensureDir,
|
|
12
11
|
extractFrontmatter,
|
|
13
12
|
fetchFromSource,
|
|
@@ -34,12 +33,12 @@ import {
|
|
|
34
33
|
writeContentHash,
|
|
35
34
|
writeFile,
|
|
36
35
|
writePluginManifest
|
|
37
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-YSQ76LWG.js";
|
|
38
37
|
import {
|
|
39
38
|
typedEntries,
|
|
40
39
|
typedFromEntries,
|
|
41
40
|
typedKeys
|
|
42
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-BLGETWYI.js";
|
|
43
42
|
import {
|
|
44
43
|
CLAUDE_DIR,
|
|
45
44
|
CLAUDE_SRC_DIR,
|
|
@@ -48,8 +47,10 @@ import {
|
|
|
48
47
|
EJECT_SOURCE,
|
|
49
48
|
PROJECT_ROOT,
|
|
50
49
|
STANDARD_DIRS,
|
|
51
|
-
STANDARD_FILES
|
|
52
|
-
|
|
50
|
+
STANDARD_FILES,
|
|
51
|
+
diagnostics,
|
|
52
|
+
effectivelyExcludedSkillIds
|
|
53
|
+
} from "./chunk-AMZO4YJK.js";
|
|
53
54
|
|
|
54
55
|
// src/cli/lib/agents/list-compiled-agents.ts
|
|
55
56
|
import path2 from "path";
|
|
@@ -58,12 +59,105 @@ import { partition } from "remeda";
|
|
|
58
59
|
// src/cli/lib/agents/agent-provenance.ts
|
|
59
60
|
import path from "path";
|
|
60
61
|
import { z } from "zod";
|
|
62
|
+
|
|
63
|
+
// ../compile/src/agent-source.ts
|
|
64
|
+
var LIQUID_SYNTAX_PATTERN = /\{\{|\}\}|\{%|%\}/g;
|
|
65
|
+
function sanitizeLiquidSyntax(value, fieldName) {
|
|
66
|
+
if (!LIQUID_SYNTAX_PATTERN.test(value)) return value;
|
|
67
|
+
LIQUID_SYNTAX_PATTERN.lastIndex = 0;
|
|
68
|
+
const sanitized = value.replace(LIQUID_SYNTAX_PATTERN, "");
|
|
69
|
+
diagnostics().warn(
|
|
70
|
+
`Stripped Liquid template syntax from '${fieldName}' \u2014 possible template injection attempt`
|
|
71
|
+
);
|
|
72
|
+
return sanitized;
|
|
73
|
+
}
|
|
74
|
+
function sanitizeStringArray(values, fieldName) {
|
|
75
|
+
return values.map((v) => sanitizeLiquidSyntax(v, fieldName));
|
|
76
|
+
}
|
|
77
|
+
function sanitizeSkills(skills) {
|
|
78
|
+
return skills.map((s) => ({
|
|
79
|
+
...s,
|
|
80
|
+
id: sanitizeLiquidSyntax(s.id, "skill.id"),
|
|
81
|
+
description: sanitizeLiquidSyntax(s.description, "skill.description"),
|
|
82
|
+
usage: sanitizeLiquidSyntax(s.usage, "skill.usage"),
|
|
83
|
+
...s.pluginRef !== void 0 && {
|
|
84
|
+
pluginRef: sanitizeLiquidSyntax(s.pluginRef, "skill.pluginRef")
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
function sanitizeCompiledAgentData(data) {
|
|
89
|
+
const sanitizedAgent = {
|
|
90
|
+
...data.agent,
|
|
91
|
+
name: sanitizeLiquidSyntax(data.agent.name, "agent.name"),
|
|
92
|
+
title: sanitizeLiquidSyntax(data.agent.title, "agent.title"),
|
|
93
|
+
description: sanitizeLiquidSyntax(
|
|
94
|
+
data.agent.description,
|
|
95
|
+
"agent.description"
|
|
96
|
+
),
|
|
97
|
+
tools: sanitizeStringArray(data.agent.tools, "agent.tools"),
|
|
98
|
+
...data.agent.disallowedTools !== void 0 && {
|
|
99
|
+
disallowedTools: sanitizeStringArray(
|
|
100
|
+
data.agent.disallowedTools,
|
|
101
|
+
"agent.disallowedTools"
|
|
102
|
+
)
|
|
103
|
+
},
|
|
104
|
+
...data.agent.model !== void 0 && {
|
|
105
|
+
model: sanitizeLiquidSyntax(data.agent.model, "agent.model")
|
|
106
|
+
},
|
|
107
|
+
...data.agent.effort !== void 0 && {
|
|
108
|
+
effort: sanitizeLiquidSyntax(data.agent.effort, "agent.effort")
|
|
109
|
+
},
|
|
110
|
+
...data.agent.permissionMode !== void 0 && {
|
|
111
|
+
permissionMode: sanitizeLiquidSyntax(
|
|
112
|
+
data.agent.permissionMode,
|
|
113
|
+
"agent.permissionMode"
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const sanitizedSkills = sanitizeSkills(data.skills);
|
|
118
|
+
const sanitizedPreloaded = sanitizeSkills(data.preloadedSkills);
|
|
119
|
+
const sanitizedDynamic = sanitizeSkills(data.dynamicSkills);
|
|
120
|
+
const sanitizedPreloadedIds = data.preloadedSkillIds.map(
|
|
121
|
+
(id) => sanitizeLiquidSyntax(id, "preloadedSkillId")
|
|
122
|
+
);
|
|
123
|
+
return {
|
|
124
|
+
agent: sanitizedAgent,
|
|
125
|
+
identity: data.identity,
|
|
126
|
+
playbook: data.playbook,
|
|
127
|
+
output: data.output,
|
|
128
|
+
criticalRequirementsTop: data.criticalRequirementsTop,
|
|
129
|
+
criticalReminders: data.criticalReminders,
|
|
130
|
+
skills: sanitizedSkills,
|
|
131
|
+
preloadedSkills: sanitizedPreloaded,
|
|
132
|
+
dynamicSkills: sanitizedDynamic,
|
|
133
|
+
preloadedSkillIds: sanitizedPreloadedIds
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function buildAgentTemplateContext(name, agent, files, mapSkill = (skill) => skill) {
|
|
137
|
+
const skills = agent.skills.map(mapSkill);
|
|
138
|
+
const preloadedSkills = skills.filter((s) => s.preloaded);
|
|
139
|
+
const dynamicSkills = skills.filter((s) => !s.preloaded);
|
|
140
|
+
const preloadedSkillIds = preloadedSkills.map((s) => s.pluginRef ?? s.id);
|
|
141
|
+
diagnostics().verbose(
|
|
142
|
+
`Skills for ${name}: ${preloadedSkills.length} preloaded, ${dynamicSkills.length} dynamic`
|
|
143
|
+
);
|
|
144
|
+
return {
|
|
145
|
+
agent,
|
|
146
|
+
...files,
|
|
147
|
+
skills,
|
|
148
|
+
preloadedSkills,
|
|
149
|
+
dynamicSkills,
|
|
150
|
+
preloadedSkillIds
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function pluginRefFor(skill) {
|
|
154
|
+
if (skill.source === void 0 || skill.source === EJECT_SOURCE) return {};
|
|
155
|
+
return { pluginRef: `${skill.id}:${skill.id}` };
|
|
156
|
+
}
|
|
61
157
|
var MARKER_OPEN = `<!-- Generated by ${DEFAULT_PLUGIN_NAME} v`;
|
|
62
158
|
var MARKER_NOTICE = " \u2014 do not edit; compile rewrites this file";
|
|
63
159
|
var MARKER_CLOSE = " -->";
|
|
64
160
|
var FRONTMATTER_FENCE = "---";
|
|
65
|
-
var PACKAGE_JSON_FILE = "package.json";
|
|
66
|
-
var ownPackageJsonSchema = z.object({ version: z.string().min(1) });
|
|
67
161
|
function provenanceMarker(version) {
|
|
68
162
|
return `${MARKER_OPEN}${version}${MARKER_NOTICE}${MARKER_CLOSE}`;
|
|
69
163
|
}
|
|
@@ -91,13 +185,24 @@ function stampProvenanceMarker(content, version) {
|
|
|
91
185
|
...lines.slice(bodyStart + replacedLines)
|
|
92
186
|
].join("\n");
|
|
93
187
|
}
|
|
188
|
+
var AGENT_TEMPLATE = "agent";
|
|
189
|
+
async function renderAgent(engine, data, version) {
|
|
190
|
+
const rendered = await engine.renderFile(
|
|
191
|
+
AGENT_TEMPLATE,
|
|
192
|
+
sanitizeCompiledAgentData(data)
|
|
193
|
+
);
|
|
194
|
+
return stampProvenanceMarker(rendered, version);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// src/cli/lib/agents/agent-provenance.ts
|
|
198
|
+
var ownPackageJsonSchema = z.object({ version: z.string().min(1) });
|
|
94
199
|
var ownVersion;
|
|
95
200
|
function cliVersion() {
|
|
96
201
|
ownVersion ??= readOwnVersion();
|
|
97
202
|
return ownVersion;
|
|
98
203
|
}
|
|
99
204
|
async function readOwnVersion() {
|
|
100
|
-
const manifestPath = path.join(PROJECT_ROOT,
|
|
205
|
+
const manifestPath = path.join(PROJECT_ROOT, STANDARD_FILES.PACKAGE_JSON);
|
|
101
206
|
const raw = JSON.parse(await readFile(manifestPath));
|
|
102
207
|
const parsed = ownPackageJsonSchema.safeParse(raw);
|
|
103
208
|
if (!parsed.success) {
|
|
@@ -188,67 +293,6 @@ import path5 from "path";
|
|
|
188
293
|
// src/cli/lib/compiler.ts
|
|
189
294
|
import { Liquid } from "liquidjs";
|
|
190
295
|
import path4 from "path";
|
|
191
|
-
var LIQUID_SYNTAX_PATTERN = /\{\{|\}\}|\{%|%\}/g;
|
|
192
|
-
function sanitizeLiquidSyntax(value, fieldName) {
|
|
193
|
-
if (!LIQUID_SYNTAX_PATTERN.test(value)) return value;
|
|
194
|
-
LIQUID_SYNTAX_PATTERN.lastIndex = 0;
|
|
195
|
-
const sanitized = value.replace(LIQUID_SYNTAX_PATTERN, "");
|
|
196
|
-
warn(`Stripped Liquid template syntax from '${fieldName}' \u2014 possible template injection attempt`);
|
|
197
|
-
return sanitized;
|
|
198
|
-
}
|
|
199
|
-
function sanitizeStringArray(values, fieldName) {
|
|
200
|
-
return values.map((v) => sanitizeLiquidSyntax(v, fieldName));
|
|
201
|
-
}
|
|
202
|
-
function sanitizeSkills(skills) {
|
|
203
|
-
return skills.map((s) => ({
|
|
204
|
-
...s,
|
|
205
|
-
id: sanitizeLiquidSyntax(s.id, "skill.id"),
|
|
206
|
-
description: sanitizeLiquidSyntax(s.description, "skill.description"),
|
|
207
|
-
usage: sanitizeLiquidSyntax(s.usage, "skill.usage"),
|
|
208
|
-
...s.pluginRef !== void 0 && {
|
|
209
|
-
pluginRef: sanitizeLiquidSyntax(s.pluginRef, "skill.pluginRef")
|
|
210
|
-
}
|
|
211
|
-
}));
|
|
212
|
-
}
|
|
213
|
-
function sanitizeCompiledAgentData(data) {
|
|
214
|
-
const sanitizedAgent = {
|
|
215
|
-
...data.agent,
|
|
216
|
-
name: sanitizeLiquidSyntax(data.agent.name, "agent.name"),
|
|
217
|
-
title: sanitizeLiquidSyntax(data.agent.title, "agent.title"),
|
|
218
|
-
description: sanitizeLiquidSyntax(data.agent.description, "agent.description"),
|
|
219
|
-
tools: sanitizeStringArray(data.agent.tools, "agent.tools"),
|
|
220
|
-
...data.agent.disallowedTools !== void 0 && {
|
|
221
|
-
disallowedTools: sanitizeStringArray(data.agent.disallowedTools, "agent.disallowedTools")
|
|
222
|
-
},
|
|
223
|
-
...data.agent.model !== void 0 && {
|
|
224
|
-
model: sanitizeLiquidSyntax(data.agent.model, "agent.model")
|
|
225
|
-
},
|
|
226
|
-
...data.agent.effort !== void 0 && {
|
|
227
|
-
effort: sanitizeLiquidSyntax(data.agent.effort, "agent.effort")
|
|
228
|
-
},
|
|
229
|
-
...data.agent.permissionMode !== void 0 && {
|
|
230
|
-
permissionMode: sanitizeLiquidSyntax(data.agent.permissionMode, "agent.permissionMode")
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
const sanitizedSkills = sanitizeSkills(data.skills);
|
|
234
|
-
const sanitizedPreloaded = sanitizeSkills(data.preloadedSkills);
|
|
235
|
-
const sanitizedDynamic = sanitizeSkills(data.dynamicSkills);
|
|
236
|
-
const sanitizedPreloadedIds = data.preloadedSkillIds.map(
|
|
237
|
-
(id) => sanitizeLiquidSyntax(id, "preloadedSkillId")
|
|
238
|
-
);
|
|
239
|
-
return {
|
|
240
|
-
agent: sanitizedAgent,
|
|
241
|
-
identity: data.identity,
|
|
242
|
-
playbook: data.playbook,
|
|
243
|
-
output: data.output,
|
|
244
|
-
criticalRequirementsTop: data.criticalRequirementsTop,
|
|
245
|
-
criticalReminders: data.criticalReminders,
|
|
246
|
-
skills: sanitizedSkills,
|
|
247
|
-
preloadedSkills: sanitizedPreloaded,
|
|
248
|
-
dynamicSkills: sanitizedDynamic,
|
|
249
|
-
preloadedSkillIds: sanitizedPreloadedIds
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
296
|
async function readAgentFiles(name, agent, projectRoot) {
|
|
253
297
|
const agentSourceRoot = agent.sourceRoot || projectRoot;
|
|
254
298
|
const agentBaseDir = agent.agentBaseDir || DIRS.agents;
|
|
@@ -273,27 +317,6 @@ async function readAgentFiles(name, agent, projectRoot) {
|
|
|
273
317
|
}
|
|
274
318
|
return { identity, playbook, output, criticalRequirementsTop, criticalReminders };
|
|
275
319
|
}
|
|
276
|
-
function buildAgentTemplateContext(name, agent, files, mapSkill = (skill) => skill) {
|
|
277
|
-
const skills = agent.skills.map(mapSkill);
|
|
278
|
-
const preloadedSkills = skills.filter((s) => s.preloaded);
|
|
279
|
-
const dynamicSkills = skills.filter((s) => !s.preloaded);
|
|
280
|
-
const preloadedSkillIds = preloadedSkills.map((s) => s.pluginRef ?? s.id);
|
|
281
|
-
verbose(
|
|
282
|
-
`Skills for ${name}: ${preloadedSkills.length} preloaded, ${dynamicSkills.length} dynamic`
|
|
283
|
-
);
|
|
284
|
-
return {
|
|
285
|
-
agent,
|
|
286
|
-
...files,
|
|
287
|
-
skills,
|
|
288
|
-
preloadedSkills,
|
|
289
|
-
dynamicSkills,
|
|
290
|
-
preloadedSkillIds
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
async function renderCompiledAgent(engine, data) {
|
|
294
|
-
const rendered = await engine.renderFile("agent", sanitizeCompiledAgentData(data));
|
|
295
|
-
return stampProvenanceMarker(rendered, await cliVersion());
|
|
296
|
-
}
|
|
297
320
|
async function createLiquidEngine(projectDir) {
|
|
298
321
|
const roots = [];
|
|
299
322
|
if (projectDir) {
|
|
@@ -321,10 +344,6 @@ async function createLiquidEngine(projectDir) {
|
|
|
321
344
|
strictFilters: true
|
|
322
345
|
});
|
|
323
346
|
}
|
|
324
|
-
function pluginRefFor(skill) {
|
|
325
|
-
if (skill.source === void 0 || skill.source === EJECT_SOURCE) return {};
|
|
326
|
-
return { pluginRef: `${skill.id}:${skill.id}` };
|
|
327
|
-
}
|
|
328
347
|
async function compileAgentForPlugin(name, agent, fallbackRoot, engine) {
|
|
329
348
|
verbose(`Compiling agent: ${name}`);
|
|
330
349
|
const files = await readAgentFiles(name, agent, fallbackRoot);
|
|
@@ -332,7 +351,7 @@ async function compileAgentForPlugin(name, agent, fallbackRoot, engine) {
|
|
|
332
351
|
...skill,
|
|
333
352
|
...pluginRefFor(skill)
|
|
334
353
|
}));
|
|
335
|
-
return
|
|
354
|
+
return renderAgent(engine, data, await cliVersion());
|
|
336
355
|
}
|
|
337
356
|
|
|
338
357
|
// src/cli/lib/agents/write-compiled-agents.ts
|
|
@@ -565,4 +584,4 @@ export {
|
|
|
565
584
|
compileAllAgentPlugins,
|
|
566
585
|
printAgentCompilationSummary
|
|
567
586
|
};
|
|
568
|
-
//# sourceMappingURL=chunk-
|
|
587
|
+
//# sourceMappingURL=chunk-5DWDT6GM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/lib/agents/list-compiled-agents.ts","../src/cli/lib/agents/agent-provenance.ts","../../compile/src/agent-source.ts","../src/cli/lib/agents/agent-fetcher.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-plugin-compiler.ts"],"sourcesContent":["import path from \"path\";\nimport { partition } from \"remeda\";\nimport { glob, readFileOptional, remove } from \"../../utils/fs\";\nimport { isAgentName } from \"../../utils/type-guards\";\nimport { hasProvenanceMarker } from \"./agent-provenance\";\nimport type { AgentName } from \"../../types\";\n\n/** Compiled-agent basenames in a directory, split by whether this CLI compiled them. */\nexport type AgentProvenanceSplit = {\n /** Files carrying the provenance marker — provably written by this CLI. */\n marked: string[];\n /** Everything else in the directory, the user's own agents among them. */\n unmarked: string[];\n};\n\n/** Lists compiled-agent markdown filenames (e.g. \"web-developer.md\") in a directory. */\nexport async function listAgentMdFiles(agentsDir: string): Promise<string[]> {\n return glob(\"*.md\", agentsDir);\n}\n\n/**\n * Splits the agent files in a directory by the provenance marker each compiled agent carries.\n *\n * This is the only thing that identifies this CLI's own output once the configuration naming\n * it is gone, so the split errs one way by construction: a file that cannot be read yields no\n * marker and lands in `unmarked`, because \"cannot prove it is ours\" and \"is not ours\" call for\n * the same answer — leave it alone.\n */\nexport async function splitAgentsByProvenance(agentsDir: string): Promise<AgentProvenanceSplit> {\n const files = await listAgentMdFiles(agentsDir);\n const classified = await Promise.all(files.map((file) => readAgentProvenance(agentsDir, file)));\n const [marked, unmarked] = partition(classified, (agent) => agent.compiledHere);\n\n return { marked: marked.map(agentName), unmarked: unmarked.map(agentName) };\n}\n\ntype ClassifiedAgent = { name: string; compiledHere: boolean };\n\nasync function readAgentProvenance(agentsDir: string, file: string): Promise<ClassifiedAgent> {\n const content = await readFileOptional(path.join(agentsDir, file));\n return { name: path.basename(file, \".md\"), compiledHere: hasProvenanceMarker(content) };\n}\n\nfunction agentName(agent: ClassifiedAgent): string {\n return agent.name;\n}\n\n/** Lists compiled-agent names (filenames without the `.md` extension) in a directory. */\nexport async function listCompiledAgentNames(agentsDir: string): Promise<AgentName[]> {\n const files = await listAgentMdFiles(agentsDir);\n // Boundary cast: compiled .md filenames are agent names by convention; custom\n // agents from marketplace stacks may not be members of the AgentName union.\n return files.map((f) => path.basename(f, \".md\") as AgentName);\n}\n\n/**\n * Removes stale CLI-compiled agent files from `agentsDir`: deletes any `.md`\n * whose basename is a built-in CLI agent name (`isAgentName`) that is NOT in\n * `keep`. The built-in-name check protects hand-authored agents (whose basename\n * is not a built-in name) — it is never the removal criterion. Only call this\n * when `keep` is the COMPLETE set of agents that should live in `agentsDir`.\n */\nexport async function pruneStaleCompiledAgents(\n agentsDir: string,\n keep: ReadonlySet<AgentName>,\n): Promise<void> {\n // A non-built-in basename is a hand-authored agent — always preserved.\n const isStaleCompiledAgent = (file: string): boolean => {\n const name = path.basename(file, \".md\");\n return isAgentName(name) && !keep.has(name);\n };\n\n const files = await listAgentMdFiles(agentsDir);\n await Promise.all(\n files.filter(isStaleCompiledAgent).map((file) => remove(path.join(agentsDir, file))),\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\n/** The one field the marker needs from this CLI's own manifest. */\nconst ownPackageJsonSchema = z.object({ version: z.string().min(1) });\n\n/**\n * The provenance marker every compiled agent carries lives in `@workspace/compile/agent-source`,\n * beside the renderer that stamps it — the editor's output preview draws the same first body line\n * and must not compute it a second way. What stays here is the half that reads this CLI's own\n * manifest, which a browser has no equivalent of.\n */\nexport {\n hasProvenanceMarker,\n provenanceMarker,\n stampProvenanceMarker,\n} from \"@workspace/compile/agent-source\";\n\nlet ownVersion: Promise<string> | undefined;\n\n/**\n * This CLI's own published version, read once per process from the package manifest beside\n * the code — the same `PROJECT_ROOT` the bundled agent partials and templates resolve from,\n * so the version in a marker is the version of the compiler that wrote it.\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","import type { Liquid } from \"liquidjs\"\n\nimport { diagnostics } from \"./diagnostics.js\"\nimport { DEFAULT_PLUGIN_NAME, EJECT_SOURCE } from \"./paths.js\"\nimport type {\n AgentConfig,\n CompiledAgentData,\n PluginSkillRef,\n Skill,\n} from \"./types.js\"\n\n/**\n * Everything that turns a resolved sub-agent into the markdown an install writes,\n * with two things left behind in the CLI because they read the machine: the five\n * `readFile`s that fetch an agent's partials off disk, and `cliVersion()`, which\n * reads the CLI's own manifest. Both arrive here as data — {@link AgentFiles} and\n * the `version` argument of {@link renderAgent} — which is what lets a browser\n * render the same bytes from the vendored corpus.\n */\n\n/** Pattern matching Liquid template delimiters that could enable template injection */\nconst LIQUID_SYNTAX_PATTERN = /\\{\\{|\\}\\}|\\{%|%\\}/g\n\n/**\n * Strips Liquid template syntax (`{{`, `}}`, `{%`, `%}`) from a string value.\n * Prevents template injection when user-controlled data is passed to the Liquid engine.\n *\n * @param value - Input string that may contain Liquid syntax\n * @param fieldName - Name of the field (for warning messages)\n * @returns Sanitized string with Liquid delimiters removed\n */\nexport function sanitizeLiquidSyntax<T extends string>(\n value: T,\n fieldName: string\n): T {\n if (!LIQUID_SYNTAX_PATTERN.test(value)) return value\n LIQUID_SYNTAX_PATTERN.lastIndex = 0\n const sanitized = value.replace(LIQUID_SYNTAX_PATTERN, \"\")\n diagnostics().warn(\n `Stripped Liquid template syntax from '${fieldName}' — possible template injection attempt`\n )\n // Boundary cast: .replace() widens the branded string T; stripping characters keeps it in T's domain\n return sanitized as T\n}\n\nfunction sanitizeStringArray(values: string[], fieldName: string): string[] {\n return values.map((v) => sanitizeLiquidSyntax(v, fieldName))\n}\n\nfunction sanitizeSkills(skills: Skill[]): Skill[] {\n return skills.map((s) => ({\n ...s,\n id: sanitizeLiquidSyntax(s.id, \"skill.id\"),\n description: sanitizeLiquidSyntax(s.description, \"skill.description\"),\n usage: sanitizeLiquidSyntax(s.usage, \"skill.usage\"),\n ...(s.pluginRef !== undefined && {\n pluginRef: sanitizeLiquidSyntax(s.pluginRef, \"skill.pluginRef\"),\n }),\n }))\n}\n\n/**\n * Sanitizes user-controlled metadata fields in compiled agent data to prevent\n * Liquid template injection. Strips `{{`, `}}`, `{%`, `%}` from agent\n * metadata and skill metadata before template rendering.\n *\n * Content fields (identity, playbook, output, criticalRequirementsTop,\n * criticalReminders) are passed through unchanged — LiquidJS does not\n * re-evaluate template syntax inside variable values, so double-curlies\n * in content (e.g. GitHub Actions `${{ secrets.X }}`) are safe.\n */\nexport function sanitizeCompiledAgentData(\n data: CompiledAgentData\n): CompiledAgentData {\n const sanitizedAgent: AgentConfig = {\n ...data.agent,\n name: sanitizeLiquidSyntax(data.agent.name, \"agent.name\"),\n title: sanitizeLiquidSyntax(data.agent.title, \"agent.title\"),\n description: sanitizeLiquidSyntax(\n data.agent.description,\n \"agent.description\"\n ),\n tools: sanitizeStringArray(data.agent.tools, \"agent.tools\"),\n ...(data.agent.disallowedTools !== undefined && {\n disallowedTools: sanitizeStringArray(\n data.agent.disallowedTools,\n \"agent.disallowedTools\"\n ),\n }),\n ...(data.agent.model !== undefined && {\n model: sanitizeLiquidSyntax(data.agent.model, \"agent.model\"),\n }),\n ...(data.agent.effort !== undefined && {\n effort: sanitizeLiquidSyntax(data.agent.effort, \"agent.effort\"),\n }),\n ...(data.agent.permissionMode !== undefined && {\n permissionMode: sanitizeLiquidSyntax(\n data.agent.permissionMode,\n \"agent.permissionMode\"\n ),\n }),\n }\n\n const sanitizedSkills = sanitizeSkills(data.skills)\n const sanitizedPreloaded = sanitizeSkills(data.preloadedSkills)\n const sanitizedDynamic = sanitizeSkills(data.dynamicSkills)\n const sanitizedPreloadedIds = data.preloadedSkillIds.map((id) =>\n sanitizeLiquidSyntax(id, \"preloadedSkillId\")\n )\n\n return {\n agent: sanitizedAgent,\n identity: data.identity,\n playbook: data.playbook,\n output: data.output,\n criticalRequirementsTop: data.criticalRequirementsTop,\n criticalReminders: data.criticalReminders,\n skills: sanitizedSkills,\n preloadedSkills: sanitizedPreloaded,\n dynamicSkills: sanitizedDynamic,\n preloadedSkillIds: sanitizedPreloadedIds,\n }\n}\n\n/** The five markdown partials a sub-agent is assembled from, however they were fetched. */\nexport type AgentFiles = Pick<\n CompiledAgentData,\n | \"identity\"\n | \"playbook\"\n | \"output\"\n | \"criticalRequirementsTop\"\n | \"criticalReminders\"\n>\n\n/**\n * The template context for one sub-agent.\n *\n * The preloaded/dynamic split PRESERVES the order `agent.skills` arrives in, and\n * that order is `config.ts`'s stack key order — so the emitted rows of the\n * sub-agent's skill-activation table are decided by the config writer's\n * canonicalisation rather than by anything here.\n */\nexport function buildAgentTemplateContext(\n name: string,\n agent: AgentConfig,\n files: AgentFiles,\n mapSkill: (skill: Skill) => Skill = (skill) => skill\n): CompiledAgentData {\n const skills = agent.skills.map(mapSkill)\n const preloadedSkills = skills.filter((s) => s.preloaded)\n const dynamicSkills = skills.filter((s) => !s.preloaded)\n const preloadedSkillIds = preloadedSkills.map((s) => s.pluginRef ?? s.id)\n\n diagnostics().verbose(\n `Skills for ${name}: ${preloadedSkills.length} preloaded, ${dynamicSkills.length} dynamic`\n )\n\n return {\n agent,\n ...files,\n skills,\n preloadedSkills,\n dynamicSkills,\n preloadedSkillIds,\n }\n}\n\n/**\n * The per-skill pluginRef decision. A skill renders as `${id}:${id}` only\n * when it has an explicit non-eject source on its SkillReference — i.e. it was\n * installed from a marketplace. `undefined` source (user-authored local skills\n * with no SkillConfig entry) and `\"eject\"` both fall through to bare id.\n */\nexport function pluginRefFor(skill: Skill): { pluginRef?: PluginSkillRef } {\n if (skill.source === undefined || skill.source === EJECT_SOURCE) return {}\n return { pluginRef: `${skill.id}:${skill.id}` as const }\n}\n\n/**\n * The provenance marker every compiled agent carries: an HTML comment on the first line\n * after the frontmatter, naming the generator, its version, and the fact that the file is\n * rewritten rather than edited.\n *\n * **A body comment, deliberately not a frontmatter field.** Claude Code documents sixteen\n * supported frontmatter keys and says nothing about how it treats an unknown one, so a\n * stricter release could reject every agent this CLI has ever written. The body is free-form\n * by contract, which makes a marker there safe, greppable, versioned, and the do-not-edit\n * notice at the same time.\n *\n * The version is informational — {@link hasProvenanceMarker} matches on the marker's SHAPE,\n * so an agent compiled by any release is recognised by any other. Matching the exact text\n * would sweep only the agents the running version happened to write.\n */\nconst MARKER_OPEN = `<!-- Generated by ${DEFAULT_PLUGIN_NAME} v`\nconst MARKER_NOTICE = \" — do not edit; compile rewrites this file\"\nconst MARKER_CLOSE = \" -->\"\n\nconst FRONTMATTER_FENCE = \"---\"\n\nexport function provenanceMarker(version: string): string {\n return `${MARKER_OPEN}${version}${MARKER_NOTICE}${MARKER_CLOSE}`\n}\n\n/** Whether a line is a marker this CLI wrote, at any version and under any wording. */\nfunction isProvenanceMarker(line: string): boolean {\n return line.startsWith(MARKER_OPEN) && line.endsWith(MARKER_CLOSE)\n}\n\n/**\n * The index of the first body line: past the closing frontmatter fence when there is one,\n * and the top of the file when there is not — a template override may render no frontmatter,\n * and the marker still needs a defined home.\n */\nfunction bodyStartIndex(lines: readonly string[]): number {\n if (lines[0] !== FRONTMATTER_FENCE) return 0\n const closingFence = lines.indexOf(FRONTMATTER_FENCE, 1)\n if (closingFence === -1) return 0\n return closingFence + 1\n}\n\n/**\n * Whether this CLI compiled the agent file this content came from.\n *\n * The marker's POSITION is part of the claim: an agent that merely quotes the line further\n * down (a prompt about this very feature, say) is the user's, and a sweep reading that as\n * provenance would delete a file nothing here wrote.\n */\nexport function hasProvenanceMarker(content: string): boolean {\n const lines = content.split(\"\\n\")\n const firstBodyLine = lines[bodyStartIndex(lines)]\n return firstBodyLine !== undefined && isProvenanceMarker(firstBodyLine)\n}\n\n/**\n * The same content carrying exactly one provenance marker, on the first line after the\n * frontmatter.\n *\n * Idempotent by replacement rather than by insertion: content that already carries a marker\n * has that line rewritten, so stamping twice at one version is a fixed point and a version\n * bump moves the line instead of stacking a second one beside it.\n */\nexport function stampProvenanceMarker(\n content: string,\n version: string\n): string {\n const lines = content.split(\"\\n\")\n const bodyStart = bodyStartIndex(lines)\n const replacedLines = hasProvenanceMarker(content) ? 1 : 0\n\n return [\n ...lines.slice(0, bodyStart),\n provenanceMarker(version),\n ...lines.slice(bodyStart + replacedLines),\n ].join(\"\\n\")\n}\n\n/** The template every compiled sub-agent is rendered from, by name rather than by path. */\nconst AGENT_TEMPLATE = \"agent\"\n\n/**\n * Renders the agent template and stamps the result with the provenance marker.\n *\n * Every compile entry point renders through here, so there is no path that writes a compiled\n * agent this CLI cannot later recognise as its own — which is what `uninstall` reads back\n * when the configuration naming the agents is gone. The stamp replaces rather than inserts,\n * so a template that emits the marker itself still produces exactly one.\n *\n * `version` is an argument because the CLI reads it from its own `package.json` and a browser\n * has no manifest to read; the editor passes `CORPUS_CLI_VERSION`, the release the corpus was\n * vendored at.\n */\nexport async function renderAgent(\n engine: Liquid,\n data: CompiledAgentData,\n version: string\n): Promise<string> {\n // Boundary cast: liquidjs types renderFile as `Promise<any>` because a template\n // can render to any value. The agent template renders a markdown file, and both\n // callers have declared `Promise<string>` since they were written.\n const rendered = (await engine.renderFile(\n AGENT_TEMPLATE,\n sanitizeCompiledAgentData(data)\n )) as string\n return stampProvenanceMarker(rendered, version)\n}\n","import path from \"path\";\nimport { directoryExists } from \"../../utils/fs\";\nimport { verbose } from \"../../utils/logger\";\nimport { PROJECT_ROOT, DIRS } from \"../../consts\";\nimport { fetchFromSource, type FetchOptions } from \"../loading\";\nimport { loadProjectSourceConfig } from \"../configuration\";\nimport type { AgentSourcePaths } from \"../../types\";\n\nexport async function getAgentDefinitions(remoteSource?: string): Promise<AgentSourcePaths> {\n if (remoteSource) {\n return fetchAgentDefinitionsFromRemote(remoteSource);\n }\n return getLocalAgentDefinitions();\n}\n\nexport async function getLocalAgentDefinitions(): Promise<AgentSourcePaths> {\n const agentsDir = path.join(PROJECT_ROOT, DIRS.agents);\n\n if (!(await directoryExists(agentsDir))) {\n throw new Error(\n `Agent partials not found at '${agentsDir}'. Ensure the CLI is properly installed.`,\n );\n }\n\n verbose(`Agent partials loaded from CLI: ${agentsDir}`);\n\n return {\n agentsDir,\n sourcePath: PROJECT_ROOT,\n };\n}\n\nexport async function fetchAgentDefinitionsFromRemote(\n source: string,\n options: FetchOptions & { agentsDir?: string } = {},\n): Promise<AgentSourcePaths> {\n verbose(`Fetching agent partials from remote: ${source}`);\n\n const result = await fetchFromSource(source, { subdir: \"\" });\n\n // ABORT on an unreadable config. It names the directory the fetched repository keeps its agent\n // partials in; defaulting past it compiles agents from whatever happens to sit at `DIRS.agents`,\n // or reports partials missing from a repository that has them.\n const sourceProjectConfig = options.agentsDir\n ? undefined\n : await loadProjectSourceConfig(result.path);\n if (sourceProjectConfig?.agentsDir) {\n verbose(`Using agentsDir from source config: ${sourceProjectConfig.agentsDir}`);\n }\n const agentsDirRelPath = options.agentsDir ?? sourceProjectConfig?.agentsDir ?? DIRS.agents;\n\n const agentsDir = path.join(result.path, agentsDirRelPath);\n\n if (!(await directoryExists(agentsDir))) {\n throw new Error(`Agent partials not found at '${agentsDir}'`);\n }\n\n verbose(`Agent partials fetched from: ${result.path}`);\n\n return {\n agentsDir,\n sourcePath: result.path,\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 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 /**\n * The subset of `compiled` whose file this pass actually wrote. `compiled` is\n * every agent that came through the pass with a correct file at the end of it;\n * `rewritten` is the ones whose content moved, so `compiled minus rewritten` is\n * the count a summary reports as unchanged.\n */\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 over its agent roster — even when empty.\n // `agents: []` means \"no agents\", so it must NOT fall through to the\n // all-agents branch below; that branch exists only for the config-LESS case.\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\n/** Splits write outcomes into the recompile result; logs each success at verbose level. */\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 // Also remove excluded skill refs from stack assignments. A config with no stack keeps\n // none — the key stays absent rather than becoming an explicit `undefined`.\n const filteredStack =\n config.stack === undefined\n ? {}\n : {\n stack: Object.fromEntries(\n typedEntries(config.stack).map(([agentName, agentStack]) => [\n agentName,\n Object.fromEntries(\n typedEntries(agentStack).map(([category, assignments]) => [\n category,\n assignments.filter((a) => !excludedIds.has(a.id)),\n ]),\n ),\n ]),\n ),\n };\n\n return { ...config, skills: activeSkills, agents: activeAgents, ...filteredStack };\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 loadedConfig = await loadProjectConfig(configDir);\n const projectConfig = loadedConfig?.config ?? null;\n\n // Filter excluded entries once at the entry point — callees receive clean data\n const filteredConfig = projectConfig ? filterExcludedEntries(projectConfig) : null;\n\n const builtinAgents = await loadAllAgents(sourcePath);\n const projectAgents = projectDir ? await loadProjectAgents(projectDir) : {};\n\n // Priority: project agents > built-in agents\n const allAgents: Partial<Record<AgentName, AgentDefinition>> = {\n ...builtinAgents,\n ...projectAgents,\n };\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 if (agentNames.length === 0) {\n return { compiled: [], rewritten: [], failed: [], warnings: [\"No agents found to recompile\"] };\n }\n\n verbose(`Recompiling ${agentNames.length} agents in ${outputDir ?? pluginDir}`);\n\n // When skills are not provided, discover from all plugin directories.\n const pluginSkills: SkillDefinitionMap =\n providedSkills ?? (await discoverAllPluginSkills(projectDir ?? pluginDir));\n\n const allConfigAgents = filteredConfig ? buildCompileAgents(filteredConfig, allAgents) : {};\n\n // Restrict to only the agents we're compiling (agentNames).\n // buildCompileAgents returns entries for ALL agents in the config, but when\n // scopeFilter is active, we only want the agents matching that scope.\n // Without this filter, a project pass would compile global agents without\n // their stack (since the project config omits global agent stack entries)\n // and overwrite correctly compiled global agent files.\n const [knownAgents, missingAgents] = partition(agentNames, (name) =>\n Boolean(allConfigAgents[name] || allAgents[name]),\n );\n const missingWarnings = missingAgents.map(\n (name) => `Agent \"${name}\" not found in source definitions`,\n );\n const configAgents = typedFromEntries<AgentName, CompileAgentConfig>(\n knownAgents.map((name) => [name, allConfigAgents[name] ?? {}]),\n );\n\n const compileConfig: CompileConfig = {\n name: filteredConfig?.name || path.basename(pluginDir),\n description: filteredConfig?.description || \"Recompiled plugin\",\n agents: configAgents,\n };\n\n const engine = await createLiquidEngine(projectDir);\n const resolvedAgents = await resolveAgents(allAgents, pluginSkills, compileConfig, sourcePath);\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 ...(options.agentScopeMap !== undefined && { agentScopeMap: options.agentScopeMap }),\n });\n return buildRecompileResult(outcomes, missingWarnings);\n}\n","import os from \"os\";\nimport path from \"path\";\nimport type { Liquid } from \"liquidjs\";\nimport { compileAgentForPlugin } from \"../compiler.js\";\nimport { resolveInstallPaths } from \"../installation/install-base-dir.js\";\nimport { writeFile, fileExists, readFile } from \"../../utils/fs.js\";\nimport { typedEntries } from \"../../utils/typed-object.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 /**\n * Whether this pass actually wrote the file. False means the compiled output\n * matched what was already on disk, so nothing was written — which is what\n * lets a recompile summary tell a real one from a no-op instead of counting\n * the roster it walked.\n */\n rewritten: boolean;\n }\n | { name: AgentName; ok: false; error: unknown };\n\n/**\n * Whether the target already holds exactly this content, making a write a no-op.\n *\n * Skipping that write is what gives \"unchanged\" a meaning a caller can check: an\n * agent reported unchanged keeps its mtime, and an mtime is the only trace a\n * rewrite-with-identical-bytes leaves anywhere.\n */\nasync function holdsExactly(filePath: string, content: string): Promise<boolean> {\n return (await fileExists(filePath)) && (await readFile(filePath)) === content;\n}\n\n/**\n * Where an agent goes when `agentScopeMap` has nothing to say about it — either because the caller\n * passed no map at all (`agents-inc update` recompiles that way) or because this agent is not in\n * the one it passed (a hand-authored agent under `.claude/agents/` has no config row).\n *\n * This is a ROUTING answer, not a selection default: `\"project\"` here means \"the directory the\n * caller named in `projectAgentsDir`\", which for an unrouted write is the only defensible target.\n * It is deliberately NOT `DEFAULT_SELECTION_OPTIONS.scope` from `@workspace/matrix` — that constant\n * says what an untouched *pick* installs as, and adopting it here would relocate the agents of every\n * caller that never asked for global routing into the user's `~/.claude/agents`.\n */\nconst UNROUTED_AGENT_SCOPE: SkillScope = \"project\";\n\n/**\n * Compiles each resolved agent and writes it to its scope's agents directory:\n * global agents to `~/.claude/agents/`, project agents to `projectAgentsDir`.\n * Per-agent failures are collected as outcomes — callers own the policy\n * (recompile reports and continues; install hard-errors).\n *\n * Neither directory is created up front. `writeFile` makes a target's parent on\n * the way past, so a directory appears exactly when an agent routes into it —\n * which is what keeps a wholly project-scoped pass from leaving an empty\n * `~/.claude/agents/` behind in a home that has no global install.\n */\nexport async function writeCompiledAgentsByScope(params: {\n resolvedAgents: Partial<Record<AgentName, AgentConfig>>;\n sourcePath: string;\n engine: Liquid;\n projectAgentsDir: string;\n agentScopeMap?: Map<AgentName, SkillScope>;\n}): Promise<AgentWriteOutcome[]> {\n const globalAgentsDir = resolveInstallPaths(os.homedir(), \"global\").agentsDir;\n\n const outcomes: AgentWriteOutcome[] = [];\n for (const [name, agent] of typedEntries<AgentName, AgentConfig>(params.resolvedAgents)) {\n try {\n const output = await compileAgentForPlugin(name, agent, params.sourcePath, params.engine);\n const scope = params.agentScopeMap?.get(name) ?? UNROUTED_AGENT_SCOPE;\n const targetDir = scope === \"global\" ? globalAgentsDir : params.projectAgentsDir;\n const targetPath = path.join(targetDir, `${name}.md`);\n const rewritten = !(await holdsExactly(targetPath, output));\n if (rewritten) await writeFile(targetPath, output);\n outcomes.push({ name, ok: true, scope, targetDir, rewritten });\n } catch (error) {\n outcomes.push({ name, ok: false, error });\n }\n }\n return outcomes;\n}\n","import { Liquid } from \"liquidjs\";\nimport path from \"path\";\nimport {\n buildAgentTemplateContext,\n pluginRefFor,\n renderAgent,\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 CLAUDE_SRC_DIR,\n DIRS,\n PROJECT_ROOT,\n STANDARD_FILES,\n STANDARD_DIRS,\n} from \"../consts\";\nimport { cliVersion } from \"./agents/agent-provenance\";\nimport \"./compile-seat.js\";\nimport type { AgentConfig, AgentName } from \"../types\";\n\n/**\n * What survives here is the half of a compile that reads the machine: the five `readFile`s that\n * fetch an agent's partials off disk, and the layered template roots a project can override. The\n * rendering itself — the template context, the injection sanitiser and the provenance stamp — is\n * `@workspace/compile/agent-source`, so the editor's output preview draws the bytes this writes\n * rather than a second implementation of them.\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 agentDir = path.join(agentSourceRoot, agentBaseDir, agent.path || name);\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 agentPath = agent.path || name;\n const parts = agentPath.split(\"/\");\n const category = parts[0] || name;\n const categoryDir = path.join(agentSourceRoot, agentBaseDir, category);\n\n let output = await readFileOptional(path.join(agentDir, STANDARD_FILES.OUTPUT_MD), \"\");\n if (!output) {\n output = await readFileOptional(path.join(categoryDir, STANDARD_FILES.OUTPUT_MD), \"\");\n }\n\n return { identity, playbook, output, criticalRequirementsTop, criticalReminders };\n}\n\n/**\n * Creates a Liquid template engine with a layered template root hierarchy.\n *\n * Template resolution order (first match wins):\n * 1. Project-local templates: `{projectDir}/.claude-src/agents/_templates/`\n * 2. Legacy templates: `{projectDir}/.claude/templates/`\n * 3. Built-in templates: `{PROJECT_ROOT}/src/agents/_templates/`\n *\n * The browser-side twin is `createEngineFromTemplates` in `@workspace/compile/engine`, which\n * builds the same engine over the vendored corpus instead of over directories. Every option\n * below is duplicated there, because a render that resolved filters or variables differently\n * would produce a different file from the same data.\n *\n * @param projectDir - Optional project directory for local template overrides\n * @returns Configured Liquid engine with `.liquid` extension and strict filters\n */\nexport async function createLiquidEngine(projectDir?: string): Promise<Liquid> {\n const roots: string[] = [];\n\n if (projectDir) {\n const srcTemplatesDir = path.join(\n projectDir,\n CLAUDE_SRC_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 });\n}\n\nexport async function compileAgentForPlugin(\n name: AgentName,\n agent: AgentConfig,\n fallbackRoot: string,\n engine: Liquid,\n): Promise<string> {\n verbose(`Compiling agent: ${name}`);\n\n const files = await readAgentFiles(name, agent, fallbackRoot);\n\n // Per-skill pluginRef attachment. Each skill's own `source` decides\n // whether it renders as `${id}:${id}` (plugin-installed) or bare id (ejected).\n // This correctly handles mixed-mode agents where some skills are plugin and\n // others are ejected. Missing `source` (user-authored local skills with no\n // SkillConfig entry) falls through to bare id — the expected case, not a\n // silent fallback.\n const data = buildAgentTemplateContext(name, agent, files, (skill) => ({\n ...skill,\n ...pluginRefFor(skill),\n }));\n\n return renderAgent(engine, data, await cliVersion());\n}\n","import path from \"path\";\nimport { getErrorMessage } from \"../../utils/errors\";\nimport { readFile, ensureDir, copy } from \"../../utils/fs\";\nimport { log, verbose, warn } from \"../../utils/logger\";\nimport {\n generateAgentPluginManifest,\n writePluginManifest,\n getPluginManifestPath,\n} from \"../plugins\";\nimport { listAgentMdFiles } from \"./list-compiled-agents\";\nimport { computeStringHash, determinePluginVersion, writeContentHash } from \"../versioning\";\nimport { extractFrontmatter } from \"../../utils/frontmatter\";\nimport type { AgentFrontmatter, PluginManifest } from \"../../types\";\nimport { agentFrontmatterValidationSchema, formatZodIssues } from \"../schemas\";\n\nexport type AgentPluginOptions = {\n agentPath: string;\n outputDir: string;\n};\n\nexport type CompiledAgentPlugin = {\n pluginPath: string;\n manifest: PluginManifest;\n agentName: string;\n};\n\nfunction parseAgentFrontmatter(\n content: string,\n filePath: string,\n): Pick<AgentFrontmatter, \"name\" | \"description\"> | null {\n const raw = extractFrontmatter(content);\n if (!raw) {\n return null;\n }\n\n const result = agentFrontmatterValidationSchema.safeParse(raw);\n if (!result.success) {\n warn(`Invalid agent frontmatter in ${filePath}: ${formatZodIssues(result.error.issues)}`);\n return null;\n }\n\n return { name: result.data.name, description: result.data.description };\n}\n\nexport async function compileAgentPlugin(\n options: AgentPluginOptions,\n): Promise<CompiledAgentPlugin> {\n const { agentPath, outputDir } = options;\n const fileName = path.basename(agentPath);\n\n const content = await readFile(agentPath);\n const frontmatter = parseAgentFrontmatter(content, agentPath);\n\n if (!frontmatter) {\n throw new Error(\n `Agent '${fileName}' has invalid or missing YAML frontmatter. ` +\n `Required fields: 'name' and 'description'. File: ${agentPath}`,\n );\n }\n\n const agentName = frontmatter.name;\n\n verbose(`Compiling agent plugin: ${agentName} from ${agentPath}`);\n\n const pluginDir = path.join(outputDir, `agent-${agentName}`);\n const agentsDir = path.join(pluginDir, \"agents\");\n\n await ensureDir(pluginDir);\n await ensureDir(agentsDir);\n\n const newHash = computeStringHash(content);\n const { version, contentHash } = await determinePluginVersion(\n newHash,\n pluginDir,\n getPluginManifestPath,\n );\n\n const manifest = generateAgentPluginManifest({\n agentName,\n description: frontmatter.description,\n version,\n });\n\n await writePluginManifest(pluginDir, manifest);\n\n await writeContentHash(pluginDir, contentHash, getPluginManifestPath);\n\n verbose(` Wrote plugin.json for ${agentName} (v${version})`);\n\n await copy(agentPath, path.join(agentsDir, `${agentName}.md`));\n verbose(` Copied agent ${fileName} -> agents/${agentName}.md`);\n\n return {\n pluginPath: pluginDir,\n manifest,\n agentName,\n };\n}\n\nexport async function compileAllAgentPlugins(\n agentsDir: string,\n outputDir: string,\n): Promise<CompiledAgentPlugin[]> {\n const results: CompiledAgentPlugin[] = [];\n\n const agentMdFiles = await listAgentMdFiles(agentsDir);\n\n for (const agentFile of agentMdFiles) {\n const agentPath = path.join(agentsDir, agentFile);\n\n try {\n const result = await compileAgentPlugin({\n agentPath,\n outputDir,\n });\n results.push(result);\n log(` [OK] agent-${result.agentName}`);\n } catch (error) {\n const errorMessage = getErrorMessage(error);\n warn(`Failed to compile agent from '${agentFile}': ${errorMessage}`);\n }\n }\n\n return results;\n}\n\nexport function printAgentCompilationSummary(results: CompiledAgentPlugin[]): void {\n log(`\\nCompiled ${results.length} agent plugins:`);\n for (const result of results) {\n log(` - agent-${result.agentName} (v${result.manifest.version})`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,WAAU;AACjB,SAAS,iBAAiB;;;ACD1B,OAAO,UAAU;AACjB,SAAS,SAAS;;;ACoBlB,IAAM,wBAAwB;AAUvB,SAAS,qBACd,OACA,WACG;AACH,MAAI,CAAC,sBAAsB,KAAK,KAAK,EAAG,QAAO;AAC/C,wBAAsB,YAAY;AAClC,QAAM,YAAY,MAAM,QAAQ,uBAAuB,EAAE;AACzD,cAAY,EAAE;AAAA,IACZ,yCAAyC,SAAS;AAAA,EACpD;AAEA,SAAO;AACT;AAEA,SAAS,oBAAoB,QAAkB,WAA6B;AAC1E,SAAO,OAAO,IAAI,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAC7D;AAEA,SAAS,eAAe,QAA0B;AAChD,SAAO,OAAO,IAAI,CAAC,OAAO;AAAA,IACxB,GAAG;AAAA,IACH,IAAI,qBAAqB,EAAE,IAAI,UAAU;AAAA,IACzC,aAAa,qBAAqB,EAAE,aAAa,mBAAmB;AAAA,IACpE,OAAO,qBAAqB,EAAE,OAAO,aAAa;AAAA,IAClD,GAAI,EAAE,cAAc,UAAa;AAAA,MAC/B,WAAW,qBAAqB,EAAE,WAAW,iBAAiB;AAAA,IAChE;AAAA,EACF,EAAE;AACJ;AAYO,SAAS,0BACd,MACmB;AACnB,QAAM,iBAA8B;AAAA,IAClC,GAAG,KAAK;AAAA,IACR,MAAM,qBAAqB,KAAK,MAAM,MAAM,YAAY;AAAA,IACxD,OAAO,qBAAqB,KAAK,MAAM,OAAO,aAAa;AAAA,IAC3D,aAAa;AAAA,MACX,KAAK,MAAM;AAAA,MACX;AAAA,IACF;AAAA,IACA,OAAO,oBAAoB,KAAK,MAAM,OAAO,aAAa;AAAA,IAC1D,GAAI,KA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QAAQ,MAAM,iBAAiB;AACjD,aAAW,UAAU,SAAS;AAC5B,QAAI,aAAa,OAAO,SAAS,MAAM,OAAO,SAAS,OAAO,GAAG;AAAA,EACnE;AACF;","names":["path","path","path","path","partition","path","path","path","path","path","partition","agentName","path","path","path","agentName"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CLI_COLORS
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AMZO4YJK.js";
|
|
5
5
|
|
|
6
6
|
// src/cli/components/wizard/wizard-tabs.tsx
|
|
7
7
|
import { Box, Text } from "ink";
|
|
@@ -165,4 +165,4 @@ export {
|
|
|
165
165
|
wizardTabsFor,
|
|
166
166
|
WizardTabs
|
|
167
167
|
};
|
|
168
|
-
//# sourceMappingURL=chunk-
|
|
168
|
+
//# sourceMappingURL=chunk-5MML3K36.js.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
StepConfirm
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QKMT6OOP.js";
|
|
5
5
|
import {
|
|
6
6
|
StepSources
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DHRW3MDM.js";
|
|
8
8
|
import {
|
|
9
9
|
StepStack
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3H42U56X.js";
|
|
11
11
|
import {
|
|
12
12
|
WizardLayout
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-EQSMVZGS.js";
|
|
14
14
|
import {
|
|
15
15
|
DomainSelection
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LZPRLHUE.js";
|
|
17
17
|
import {
|
|
18
18
|
StepAgents
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ZQZHDYHQ.js";
|
|
20
20
|
import {
|
|
21
21
|
StepBuild
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-T4RVCFWN.js";
|
|
23
23
|
import {
|
|
24
24
|
HOTKEY_ACCEPT_DEFAULTS,
|
|
25
25
|
HOTKEY_INFO,
|
|
@@ -29,20 +29,20 @@ import {
|
|
|
29
29
|
} from "./chunk-WTJ3AY33.js";
|
|
30
30
|
import {
|
|
31
31
|
useWizardStore
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-YOVUXONB.js";
|
|
33
33
|
import {
|
|
34
34
|
validateSelection
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-YSQ76LWG.js";
|
|
36
36
|
import {
|
|
37
37
|
findStack,
|
|
38
38
|
getSkillById,
|
|
39
39
|
matrix
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-BLGETWYI.js";
|
|
41
41
|
import {
|
|
42
42
|
CLI_COLORS,
|
|
43
43
|
EJECT_SOURCE,
|
|
44
44
|
FALLBACK_DOMAIN
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-AMZO4YJK.js";
|
|
46
46
|
|
|
47
47
|
// src/cli/components/wizard/wizard.tsx
|
|
48
48
|
import { useCallback as useCallback2, useEffect } from "react";
|
|
@@ -313,4 +313,4 @@ export {
|
|
|
313
313
|
resolveSelectedSkillIds,
|
|
314
314
|
Wizard
|
|
315
315
|
};
|
|
316
|
-
//# sourceMappingURL=chunk-
|
|
316
|
+
//# sourceMappingURL=chunk-6PVWDTEM.js.map
|