@jean.gnc/harness-kit 0.9.1 → 0.11.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/README.md +55 -27
- package/dist/cli.js +6 -6
- package/dist/cli.js.map +1 -1
- package/dist/compile/emit.d.ts +3 -6
- package/dist/compile/emit.d.ts.map +1 -1
- package/dist/compile/emit.js +5 -12
- package/dist/compile/emit.js.map +1 -1
- package/dist/compile/index.d.ts +10 -6
- package/dist/compile/index.d.ts.map +1 -1
- package/dist/compile/index.js +9 -37
- package/dist/compile/index.js.map +1 -1
- package/dist/compile/validators.d.ts +7 -3
- package/dist/compile/validators.d.ts.map +1 -1
- package/dist/compile/validators.js +2 -0
- package/dist/compile/validators.js.map +1 -1
- package/dist/compile.d.ts +10 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/{build.js → compile.js} +22 -11
- package/dist/compile.js.map +1 -0
- package/dist/configs/compile.d.ts +14 -0
- package/dist/configs/compile.d.ts.map +1 -0
- package/dist/configs/compile.js +80 -0
- package/dist/configs/compile.js.map +1 -0
- package/dist/configs/emit.d.ts +2 -2
- package/dist/configs/emit.d.ts.map +1 -1
- package/dist/configs/emit.js +1 -1
- package/dist/configs/manifest.d.ts +5 -4
- package/dist/configs/manifest.d.ts.map +1 -1
- package/dist/configs/manifest.js +8 -23
- package/dist/configs/manifest.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/init/index.d.ts.map +1 -1
- package/dist/init/index.js +1 -2
- package/dist/init/index.js.map +1 -1
- package/dist/install/discovery.js +3 -3
- package/dist/install/discovery.js.map +1 -1
- package/dist/install/links.js +2 -2
- package/dist/install/links.js.map +1 -1
- package/dist/plugin/index.d.ts +2 -2
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +1 -1
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/schema.d.ts +0 -59
- package/dist/plugin/schema.d.ts.map +1 -1
- package/dist/plugin/schema.js +1 -10
- package/dist/plugin/schema.js.map +1 -1
- package/dist/skill/includes.js +2 -1
- package/dist/skill/includes.js.map +1 -1
- package/dist/vendor/schema.d.ts +1 -0
- package/dist/vendor/schema.d.ts.map +1 -1
- package/dist/vendors/claude/index.d.ts.map +1 -1
- package/dist/vendors/claude/index.js +4 -1
- package/dist/vendors/claude/index.js.map +1 -1
- package/dist/vendors/codex/index.d.ts.map +1 -1
- package/dist/vendors/codex/index.js +4 -1
- package/dist/vendors/codex/index.js.map +1 -1
- package/dist/vendors/shared.js +2 -2
- package/dist/vendors/shared.js.map +1 -1
- package/package.json +1 -1
- package/dist/build.d.ts +0 -12
- package/dist/build.d.ts.map +0 -1
- package/dist/build.js.map +0 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
pnpm add @jean.gnc/harness-kit
|
|
9
9
|
harness init --marketplace my-harness --vendors claude,codex
|
|
10
10
|
# author src/plugins/<plugin>/... (see Authoring below)
|
|
11
|
-
harness
|
|
11
|
+
harness compile
|
|
12
12
|
harness install
|
|
13
13
|
```
|
|
14
14
|
|
|
@@ -27,7 +27,7 @@ vendors:
|
|
|
27
27
|
- codex
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
Created by `harness init`. Read automatically by `
|
|
30
|
+
Created by `harness init`. Read automatically by `compile`, `install`, and `uninstall` via `--repo` (default `.`).
|
|
31
31
|
|
|
32
32
|
### Vendors
|
|
33
33
|
|
|
@@ -40,39 +40,39 @@ Writing your own vendor: see [docs/vendors.md](./docs/vendors.md).
|
|
|
40
40
|
|
|
41
41
|
### Source layout
|
|
42
42
|
|
|
43
|
-
Two trees live under `src/`:
|
|
44
|
-
|
|
45
43
|
```text
|
|
46
|
-
src/
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
src/
|
|
45
|
+
<vendor>/configs/ # vendor-specific config files (e.g. AGENTS.md, settings.json)
|
|
46
|
+
.fragments/ # source-only snippets; never emitted to dist (see Fragments vs companions)
|
|
47
|
+
plugins/<plugin>/ # shared across every declared vendor
|
|
48
|
+
.claude-plugin/plugin.json # or PLUGIN.ts
|
|
49
|
+
skills/<name>/SKILL.md # or SKILL.ts + body.md
|
|
50
|
+
agents/<agent>.md # optional
|
|
51
|
+
commands/<command>.md # optional
|
|
52
|
+
hooks/<hook>.json # optional
|
|
53
|
+
.claude-plugin/marketplace.json # lists the plugins to compile
|
|
49
54
|
```
|
|
50
55
|
|
|
51
|
-
```text
|
|
52
|
-
src/plugins/<plugin>/
|
|
53
|
-
.claude-plugin/plugin.json # or PLUGIN.ts
|
|
54
|
-
skills/<name>/SKILL.md # or SKILL.ts + body.md
|
|
55
|
-
agents/<agent>.md # optional
|
|
56
|
-
commands/<command>.md # optional
|
|
57
|
-
hooks/<hook>.json # optional
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Plus `src/.claude-plugin/marketplace.json` at the root, listing the plugins to compile.
|
|
61
|
-
|
|
62
56
|
→ Manifest fields, passthrough behavior, and plugin extensions: [docs/marketplace.md](./docs/marketplace.md).
|
|
63
57
|
|
|
64
58
|
### Compile pipeline
|
|
65
59
|
|
|
66
|
-
`harness
|
|
60
|
+
`harness compile` reads vendors from `harness.yaml`, validates the marketplace manifest, discovers plugins, and validates each `hookRequires` against the local artifact IDs. For each declared vendor it emits everything under a single top-level `dist/<vendor>/` subtree:
|
|
61
|
+
|
|
62
|
+
- `dist/<vendor>/.<vendor>-plugin/marketplace.json` — the per-vendor marketplace manifest.
|
|
63
|
+
- `dist/<vendor>/plugins/<plugin>/` — compiled skills/agents/commands plus the per-vendor plugin manifest.
|
|
64
|
+
- `dist/<vendor>/configs/` — vendor-specific config files (everything under `src/<vendor>/configs/` minus dot-prefixed entries).
|
|
65
|
+
|
|
66
|
+
A top-level `dist/configs.json` link manifest enumerates the symlinks `harness install` will create.
|
|
67
67
|
|
|
68
68
|
### Install pipeline
|
|
69
69
|
|
|
70
70
|
`harness install` reads `harness.yaml`, then:
|
|
71
71
|
|
|
72
72
|
1. Applies links from `dist/configs.json`. Existing symlinks are replaced. Regular files are renamed to `<dest>.backup` (incrementing to `.backup.2`, `.backup.3`, …) before the symlink is created. Orphan symlinks pointing back into the repo are swept before applying.
|
|
73
|
-
2. For each declared vendor, discovers compiled plugins under `dist
|
|
73
|
+
2. For each declared vendor, discovers compiled plugins under `dist/<vendor>/plugins/` and calls the vendor's `install` hook.
|
|
74
74
|
|
|
75
|
-
`--mode` selects where Claude resolves plugins from: `local` (default) registers the freshly compiled `dist/claude
|
|
75
|
+
`--mode` selects where Claude resolves plugins from: `local` (default) registers the freshly compiled `dist/claude/` tree as a local-scoped marketplace, so uncommitted builds install without publishing; `remote` pulls from the published marketplace. Codex is local-only and ignores the flag.
|
|
76
76
|
|
|
77
77
|
`--dry-run` prints the plan without touching the filesystem.
|
|
78
78
|
|
|
@@ -102,7 +102,7 @@ For details, see {{ref:details.md}}.
|
|
|
102
102
|
Compiles to (once per declared vendor):
|
|
103
103
|
|
|
104
104
|
```md
|
|
105
|
-
<!-- dist
|
|
105
|
+
<!-- dist/<vendor>/plugins/<plugin>/skills/my-skill/SKILL.md -->
|
|
106
106
|
---
|
|
107
107
|
name: my-skill
|
|
108
108
|
description: What the skill does — single line.
|
|
@@ -124,15 +124,43 @@ For details, see `details.md`.
|
|
|
124
124
|
|
|
125
125
|
### Composing with includes
|
|
126
126
|
|
|
127
|
-
Use `{{include
|
|
127
|
+
Use `{{include:./.fragments/foo.md}}` to inline another Markdown file verbatim into the body. Includes expand recursively (an included file may itself contain `{{include:...}}`), and any other placeholders inside the inlined content are resolved against the **host skill**, not the include source.
|
|
128
128
|
|
|
129
129
|
Constraints:
|
|
130
130
|
|
|
131
131
|
- Path must be relative and stay inside the skill directory.
|
|
132
132
|
- Target must end in `.md`.
|
|
133
|
-
- Cycles are detected and fail the
|
|
133
|
+
- Cycles are detected and fail the compile.
|
|
134
134
|
- Included files are not copied into `dist/` and are not flagged as undeclared companions.
|
|
135
135
|
|
|
136
|
+
### Fragments vs companions
|
|
137
|
+
|
|
138
|
+
Two kinds of secondary file appear next to skills, plugins, and configs. They have different lifecycles, so harness-kit gives them different conventions.
|
|
139
|
+
|
|
140
|
+
| Kind | Lifecycle | Convention | Ships to `dist/`? |
|
|
141
|
+
| --- | --- | --- | --- |
|
|
142
|
+
| **Fragment** | Compile-time only — inlined via `{{include:...}}` | Leading-dot path (e.g. `.fragments/foo.md`) | No |
|
|
143
|
+
| **Companion** | Runtime — read by the artifact (skill, hook, command, agent) at execution | No leading dot (e.g. `details.md`, `companions/foo.md`) | Yes |
|
|
144
|
+
|
|
145
|
+
**The rule is one sentence: leading dot = source-only.** Any source file or directory whose basename starts with `.` is stripped from dist (the vendor manifest dirs like `.claude-plugin/` are still emitted because each vendor writes them separately). Everything else ships as-is.
|
|
146
|
+
|
|
147
|
+
Example: a skill that inlines a shared snippet at compile time and ships a runtime companion alongside it.
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
src/plugins/foo/skills/bar/
|
|
151
|
+
SKILL.md # uses {{include:./.fragments/snippet.md}} and references details.md
|
|
152
|
+
.fragments/snippet.md # stripped from dist
|
|
153
|
+
details.md # ships; consumed at runtime
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
After `harness compile`:
|
|
157
|
+
|
|
158
|
+
```text
|
|
159
|
+
dist/<vendor>/plugins/foo/skills/bar/
|
|
160
|
+
SKILL.md # snippet content inlined
|
|
161
|
+
details.md # ships unchanged
|
|
162
|
+
```
|
|
163
|
+
|
|
136
164
|
### Authoring with TypeScript (alternative)
|
|
137
165
|
|
|
138
166
|
If you prefer typed metadata, use `SKILL.ts` + sibling `body.md` instead of a single `SKILL.md`:
|
|
@@ -161,7 +189,7 @@ A skill folder must contain exactly one of `SKILL.md` or `SKILL.ts`. Both forms
|
|
|
161
189
|
|
|
162
190
|
Three reference kinds — `skill`, `command`, `agent` — each resolve against the **local marketplace ∪ installed plugins** and render the scoped `<plugin>:<name>` handle. The author never picks a prefix based on where a target lives; a single kind covers both local and cross-plugin references.
|
|
163
191
|
|
|
164
|
-
Resolution is two-tier: `harness
|
|
192
|
+
Resolution is two-tier: `harness compile` resolves strictly against local artifacts and **warns** (without failing) on a reference found in neither the local marketplace nor an installed plugin — so the compile stays green on a machine without those plugins installed. `harness check --mode=all` is the hard gate: the same unresolved reference fails the check. A malformed value (not `<plugin>:<name>` shape) is always a hard error. A local reference into another local plugin must declare that plugin as a dependency.
|
|
165
193
|
|
|
166
194
|
| Placeholder | Renders to | Validation |
|
|
167
195
|
| --- | --- | --- |
|
|
@@ -175,8 +203,8 @@ Resolution is two-tier: `harness build` resolves strictly against local artifact
|
|
|
175
203
|
## CLI
|
|
176
204
|
|
|
177
205
|
```sh
|
|
178
|
-
harness init # scaffold harness.yaml + src
|
|
179
|
-
harness
|
|
206
|
+
harness init # scaffold harness.yaml + src/<vendor>/configs/ + src/plugins/
|
|
207
|
+
harness compile # compile src/ → dist/ per declared vendors
|
|
180
208
|
harness lint # lint compiled markdown under dist/
|
|
181
209
|
harness check # validate plugin references against local + installed sources
|
|
182
210
|
harness install # link configs + register plugins per declared vendor (--mode=local|remote)
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import { readFileSync } from "node:fs";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { defineCommand, runMain } from "citty";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
import {
|
|
6
|
+
import { compile } from "./compile.js";
|
|
7
7
|
import { CHECK_MODES, check } from "./check/index.js";
|
|
8
8
|
import { initHarness } from "./init/index.js";
|
|
9
9
|
import { install, uninstall } from "./install/index.js";
|
|
@@ -22,8 +22,8 @@ function parseCheckMode(value) {
|
|
|
22
22
|
return value;
|
|
23
23
|
throw new Error(`Unknown check mode "${value}". Valid: ${CHECK_MODES.join(", ")}`);
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
meta: { name: "
|
|
25
|
+
const compileCmd = defineCommand({
|
|
26
|
+
meta: { name: "compile", description: "Compile harness sources to dist/" },
|
|
27
27
|
args: {
|
|
28
28
|
src: { type: "string", default: "./src", description: "source root" },
|
|
29
29
|
out: { type: "string", default: "./dist", description: "output root" },
|
|
@@ -31,7 +31,7 @@ const buildCmd = defineCommand({
|
|
|
31
31
|
silent: { type: "boolean", default: false, description: "suppress success log" },
|
|
32
32
|
},
|
|
33
33
|
run: async ({ args }) => {
|
|
34
|
-
await
|
|
34
|
+
await compile({
|
|
35
35
|
srcRoot: args.src,
|
|
36
36
|
outRoot: args.out,
|
|
37
37
|
repoRoot: args.repo,
|
|
@@ -81,7 +81,7 @@ const uninstallCmd = defineCommand({
|
|
|
81
81
|
const initCmd = defineCommand({
|
|
82
82
|
meta: {
|
|
83
83
|
name: "init",
|
|
84
|
-
description: "Scaffold a harness repo (harness.yaml, src
|
|
84
|
+
description: "Scaffold a harness repo (harness.yaml, src/<vendor>/configs, src/plugins)",
|
|
85
85
|
},
|
|
86
86
|
args: {
|
|
87
87
|
repo: { type: "string", default: ".", description: "repo root to scaffold into" },
|
|
@@ -173,8 +173,8 @@ const main = defineCommand({
|
|
|
173
173
|
description: "Build your own multi-agent harness: author plugins once, ship to every declared vendor.",
|
|
174
174
|
},
|
|
175
175
|
subCommands: {
|
|
176
|
-
build: buildCmd,
|
|
177
176
|
check: checkCmd,
|
|
177
|
+
compile: compileCmd,
|
|
178
178
|
init: initCmd,
|
|
179
179
|
install: installCmd,
|
|
180
180
|
lint: lintCmd,
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,C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AE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE;QACtE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,2BAA2B,EAAE;KACtF;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACtE,IAAI,MAAM,CAAC,UAAU,GAAG,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,aAAa,CAAC;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,WAAW,EACT,yFAAyF;KAC5F;IACD,WAAW,EAAE;QACX,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,OAAO;QACb,SAAS,EAAE,YAAY;KACxB;CACF,CAAC,CAAC;AAEH,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/compile/emit.d.ts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReferenceOwner } from "./validators.js";
|
|
2
2
|
import type { LocalIds } from "../layout/index.js";
|
|
3
3
|
import type { InstalledIndex } from "../installed.js";
|
|
4
4
|
export type { LocalIds } from "../layout/index.js";
|
|
5
|
-
export type {
|
|
6
|
-
export type BodyInvariant = (body: string) => string[];
|
|
5
|
+
export type { ReferenceOwner } from "./validators.js";
|
|
7
6
|
export type WarningSink = (filePath: string, warnings: readonly string[]) => void;
|
|
8
7
|
export interface CompileTreeOptions {
|
|
9
8
|
readonly srcRoot: string;
|
|
10
9
|
readonly outRoot: string;
|
|
11
10
|
readonly localIds: LocalIds;
|
|
12
11
|
readonly installedIndex: InstalledIndex;
|
|
13
|
-
readonly
|
|
14
|
-
readonly contextFiles?: ReadonlySet<string>;
|
|
15
|
-
readonly owner: OwningPlugin;
|
|
12
|
+
readonly owner: ReferenceOwner;
|
|
16
13
|
readonly skipRelPaths?: ReadonlySet<string>;
|
|
17
14
|
readonly onWarnings?: WarningSink;
|
|
18
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/compile/emit.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAiB,KAAK,
|
|
1
|
+
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/compile/emit.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAItD,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;AAElF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC;CACnC;AASD,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuC5E"}
|
package/dist/compile/emit.js
CHANGED
|
@@ -7,14 +7,13 @@ import { checkCompanionsTokenParity, precomputeExistingRefs, renderFrontmatter,
|
|
|
7
7
|
import { buildRegistry } from "./validators.js";
|
|
8
8
|
const SKILL_SOURCE_FILENAMES = new Set(["SKILL.ts", "SKILL.md"]);
|
|
9
9
|
export async function compileTree(options) {
|
|
10
|
-
const { srcRoot, outRoot
|
|
10
|
+
const { srcRoot, outRoot } = options;
|
|
11
11
|
const ctx = {
|
|
12
12
|
localIds: options.localIds,
|
|
13
13
|
installedIndex: options.installedIndex,
|
|
14
14
|
owner: options.owner,
|
|
15
15
|
...(options.onWarnings ? { onWarnings: options.onWarnings } : {}),
|
|
16
16
|
};
|
|
17
|
-
const contextFiles = options.contextFiles ?? new Set();
|
|
18
17
|
const skipRelPaths = options.skipRelPaths ?? new Set();
|
|
19
18
|
const skillFolders = await collectSkillFolders(srcRoot);
|
|
20
19
|
const handledAbsPaths = new Set();
|
|
@@ -23,17 +22,12 @@ export async function compileTree(options) {
|
|
|
23
22
|
continue;
|
|
24
23
|
const target = join(outRoot, relative(srcRoot, absPath));
|
|
25
24
|
const companions = skillFolders.get(dirname(absPath)) ?? [];
|
|
26
|
-
const result = await emitSkill(absPath, join(dirname(target), "SKILL.md"), companions,
|
|
25
|
+
const result = await emitSkill(absPath, join(dirname(target), "SKILL.md"), companions, ctx);
|
|
27
26
|
for (const p of result.resolvedIncludes)
|
|
28
27
|
handledAbsPaths.add(p);
|
|
29
28
|
for (const p of result.emittedCompanions)
|
|
30
29
|
handledAbsPaths.add(p);
|
|
31
30
|
}
|
|
32
|
-
for (const absPath of contextFiles) {
|
|
33
|
-
const target = join(outRoot, relative(srcRoot, absPath));
|
|
34
|
-
await emitSubstitutedFile(absPath, target, dirname(absPath), ctx);
|
|
35
|
-
handledAbsPaths.add(absPath);
|
|
36
|
-
}
|
|
37
31
|
for await (const absPath of walk(srcRoot)) {
|
|
38
32
|
const file = basename(absPath);
|
|
39
33
|
const rel = relative(srcRoot, absPath);
|
|
@@ -85,7 +79,7 @@ async function collectSkillFolders(srcRoot) {
|
|
|
85
79
|
}
|
|
86
80
|
return result;
|
|
87
81
|
}
|
|
88
|
-
async function emitSkill(srcPath, outPath, siblings,
|
|
82
|
+
async function emitSkill(srcPath, outPath, siblings, ctx) {
|
|
89
83
|
const skillDir = dirname(srcPath);
|
|
90
84
|
const loaded = await loadSkill(skillDir);
|
|
91
85
|
if (!loaded.ok) {
|
|
@@ -104,9 +98,6 @@ async function emitSkill(srcPath, outPath, siblings, bodyInvariants, ctx) {
|
|
|
104
98
|
if (skill.name !== expectedName) {
|
|
105
99
|
errors.push(`name "${skill.name}" does not match folder "${expectedName}"`);
|
|
106
100
|
}
|
|
107
|
-
for (const check of bodyInvariants) {
|
|
108
|
-
errors.push(...check(expandedBody));
|
|
109
|
-
}
|
|
110
101
|
errors.push(...checkCompanionFiles(skill.companions, filteredSiblings));
|
|
111
102
|
errors.push(...checkCompanionsTokenParity(expandedBody, skill.companions));
|
|
112
103
|
if (errors.length > 0) {
|
|
@@ -160,6 +151,8 @@ function reportWarnings(ctx, filePath, warnings) {
|
|
|
160
151
|
async function* walk(dir) {
|
|
161
152
|
const entries = await readdir(dir, { withFileTypes: true });
|
|
162
153
|
for (const entry of entries) {
|
|
154
|
+
if (entry.name.startsWith("."))
|
|
155
|
+
continue;
|
|
163
156
|
const full = join(dir, entry.name);
|
|
164
157
|
if (entry.isDirectory())
|
|
165
158
|
yield* walk(full);
|
package/dist/compile/emit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit.js","sourceRoot":"","sources":["../../src/compile/emit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,E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} from "./emit.js";
|
|
2
|
+
import { type LayoutAdapter, type LocalIds } from "../layout/index.js";
|
|
3
|
+
import { type InstalledIndex, type PluginSource } from "../installed.js";
|
|
3
4
|
import type { Vendor } from "../vendor/schema.js";
|
|
4
|
-
export type { BodyInvariant } from "./emit.js";
|
|
5
5
|
export type { WarningSink } from "./emit.js";
|
|
6
|
-
export
|
|
6
|
+
export { loadAdapter };
|
|
7
|
+
export interface CompilePluginsOptions {
|
|
7
8
|
readonly srcRoot: string;
|
|
8
9
|
readonly outRoot: string;
|
|
9
10
|
readonly vendors: readonly Vendor[];
|
|
10
|
-
readonly bodyInvariants?: readonly BodyInvariant[];
|
|
11
11
|
readonly onWarnings?: WarningSink;
|
|
12
12
|
readonly sources?: readonly PluginSource[];
|
|
13
|
+
readonly adapter?: LayoutAdapter;
|
|
14
|
+
readonly localIds?: LocalIds;
|
|
15
|
+
readonly installedIndex?: InstalledIndex;
|
|
13
16
|
}
|
|
14
|
-
export declare function
|
|
17
|
+
export declare function compilePlugins(options: CompilePluginsOptions): Promise<void>;
|
|
18
|
+
declare function loadAdapter(srcRoot: string): Promise<LayoutAdapter>;
|
|
15
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoC,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAG/E,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,QAAQ,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;CAC1C;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BlF;AAOD,iBAAe,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA0BlE"}
|
package/dist/compile/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { compileTree } from "./emit.js";
|
|
3
|
-
import { pathExists } from "../fs.js";
|
|
4
3
|
import { throwInvariantViolations } from "./discovery.js";
|
|
5
4
|
import { SOURCE_PLUGIN_MANIFEST_JSON, SOURCE_PLUGIN_MANIFEST_TS } from "../layout/conventions.js";
|
|
6
|
-
import { collectLocalIds,
|
|
5
|
+
import { collectLocalIds, loadLayout, } from "../layout/index.js";
|
|
7
6
|
import { defaultSources, discoverInstalled, indexInstalled, } from "../installed.js";
|
|
8
|
-
export
|
|
7
|
+
export { loadAdapter };
|
|
8
|
+
export async function compilePlugins(options) {
|
|
9
9
|
const { srcRoot, outRoot, vendors } = options;
|
|
10
10
|
if (vendors.length === 0) {
|
|
11
|
-
throw new Error("
|
|
11
|
+
throw new Error("compilePlugins requires at least one vendor");
|
|
12
12
|
}
|
|
13
|
-
const adapter = await loadAdapter(srcRoot);
|
|
14
|
-
const localIds = await collectLocalIds(adapter);
|
|
15
|
-
const installedIndex =
|
|
16
|
-
|
|
13
|
+
const adapter = options.adapter ?? (await loadAdapter(srcRoot));
|
|
14
|
+
const localIds = options.localIds ?? (await collectLocalIds(adapter));
|
|
15
|
+
const installedIndex = options.installedIndex ??
|
|
16
|
+
(await loadInstalledIndex(options.sources ?? defaultSources(vendors)));
|
|
17
17
|
checkHookRequires(adapter, localIds);
|
|
18
18
|
const skipRelPaths = new Set(vendors.map((v) => v.pluginManifestPath));
|
|
19
19
|
for (const vendor of vendors) {
|
|
@@ -26,7 +26,6 @@ export async function compile(options) {
|
|
|
26
26
|
localIds,
|
|
27
27
|
installedIndex,
|
|
28
28
|
skipRelPaths,
|
|
29
|
-
bodyInvariants: options.bodyInvariants ?? [],
|
|
30
29
|
...(options.onWarnings ? { onWarnings: options.onWarnings } : {}),
|
|
31
30
|
});
|
|
32
31
|
}
|
|
@@ -67,8 +66,8 @@ async function loadAdapter(srcRoot) {
|
|
|
67
66
|
async function emitPluginForVendor(plugin, vendor, options) {
|
|
68
67
|
const pluginOutDir = vendor.pluginOutDir(options.outRoot, plugin.name);
|
|
69
68
|
await vendor.emitPluginManifest({ manifest: plugin.manifest, pluginOutDir });
|
|
70
|
-
const contextFiles = await collectSubstitutableFiles(plugin);
|
|
71
69
|
const owner = {
|
|
70
|
+
kind: "plugin",
|
|
72
71
|
name: plugin.name,
|
|
73
72
|
dependencies: new Set((plugin.manifest.dependencies ?? []).map(dependencyName)),
|
|
74
73
|
};
|
|
@@ -77,38 +76,11 @@ async function emitPluginForVendor(plugin, vendor, options) {
|
|
|
77
76
|
outRoot: pluginOutDir,
|
|
78
77
|
localIds: options.localIds,
|
|
79
78
|
installedIndex: options.installedIndex,
|
|
80
|
-
bodyInvariants: options.bodyInvariants,
|
|
81
|
-
contextFiles,
|
|
82
79
|
owner,
|
|
83
80
|
skipRelPaths: options.skipRelPaths,
|
|
84
81
|
...(options.onWarnings ? { onWarnings: options.onWarnings } : {}),
|
|
85
82
|
});
|
|
86
83
|
}
|
|
87
|
-
async function collectSubstitutableFiles(plugin) {
|
|
88
|
-
const result = new Set();
|
|
89
|
-
for (const entry of plugin.manifest.context ?? []) {
|
|
90
|
-
result.add(join(plugin.pluginDir, entry.file));
|
|
91
|
-
}
|
|
92
|
-
for (const dir of [plugin.agentsDir, plugin.commandsDir]) {
|
|
93
|
-
for (const name of await listMarkdownNames(dir)) {
|
|
94
|
-
result.add(join(dir, `${name}.md`));
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return result;
|
|
98
|
-
}
|
|
99
|
-
async function checkContextFiles(adapter) {
|
|
100
|
-
for (const plugin of adapter.plugins) {
|
|
101
|
-
const errors = [];
|
|
102
|
-
for (const entry of plugin.manifest.context ?? []) {
|
|
103
|
-
if (!(await pathExists(join(plugin.pluginDir, entry.file)))) {
|
|
104
|
-
errors.push(`context entry: file not found: ${entry.file}`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if (errors.length > 0) {
|
|
108
|
-
throwInvariantViolations(join(plugin.pluginDir, SOURCE_PLUGIN_MANIFEST_TS), errors);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
84
|
function checkHookRequires(adapter, localIds) {
|
|
113
85
|
for (const plugin of adapter.plugins) {
|
|
114
86
|
const errors = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/compile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/compile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAyC,MAAM,WAAW,CAA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CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,yBAAyB,CAAC;IAC7F,CAAC;IACD,IAAI,GAAG,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,uBAAuB,CAAC;IACrF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -2,9 +2,13 @@ import type { ValidatorRegistry } from "../placeholders/index.js";
|
|
|
2
2
|
import type { Companion } from "../skill/index.js";
|
|
3
3
|
import type { InstalledIndex } from "../installed.js";
|
|
4
4
|
import type { LocalIds } from "../layout/index.js";
|
|
5
|
-
export
|
|
5
|
+
export type ReferenceOwner = {
|
|
6
|
+
readonly kind: "plugin";
|
|
6
7
|
readonly name: string;
|
|
7
8
|
readonly dependencies: ReadonlySet<string>;
|
|
8
|
-
}
|
|
9
|
-
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: "unrestricted";
|
|
11
|
+
readonly label: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function buildRegistry(companions: readonly Companion[] | undefined, localIds: LocalIds, installedIndex: InstalledIndex, existingRefs: ReadonlySet<string>, skillDir: string, owner: ReferenceOwner): ValidatorRegistry;
|
|
10
14
|
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/compile/validators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAKnD,MAAM,
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/compile/validators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAKnD,MAAM,MAAM,cAAc,GACtB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,GAC9F;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAQ9D,wBAAgB,aAAa,CAC3B,UAAU,EAAE,SAAS,SAAS,EAAE,GAAG,SAAS,EAC5C,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,EACjC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,cAAc,GACpB,iBAAiB,CAwBnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/compile/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAKlC,OAAO,EAAE,kBAAkB,EAAwB,MAAM,mBAAmB,CAAC;AAE7E,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../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AG,CAAC,WAAW,CAAC;QAAE,OAAO,IAAI,CAAC;IACrD,OAAO,8BAA8B,WAAW,eAAe,WAAW,QAAQ,KAAK,CAAC,IAAI,iBAAiB,CAAC;AAChH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Vendor } from "./vendor/schema.js";
|
|
2
|
+
export interface CompileOptions {
|
|
3
|
+
readonly srcRoot?: string;
|
|
4
|
+
readonly outRoot?: string;
|
|
5
|
+
readonly silent?: boolean;
|
|
6
|
+
readonly vendors?: readonly Vendor[];
|
|
7
|
+
readonly repoRoot?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function compile(options?: CompileOptions): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=compile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAsB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCzE"}
|