wicked-crew 0.7.25 → 0.7.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/endpoint-manifest-live.d.ts.map +1 -1
- package/dist/api/endpoint-manifest-live.js +5 -0
- package/dist/api/endpoint-manifest-live.js.map +1 -1
- package/dist/api/eval-compare.d.ts +306 -0
- package/dist/api/eval-compare.d.ts.map +1 -0
- package/dist/api/eval-compare.js +610 -0
- package/dist/api/eval-compare.js.map +1 -0
- package/dist/api/eval-sample.d.ts +158 -0
- package/dist/api/eval-sample.d.ts.map +1 -0
- package/dist/api/eval-sample.js +88 -0
- package/dist/api/eval-sample.js.map +1 -0
- package/dist/api/routes.d.ts +5 -0
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +31 -0
- package/dist/api/routes.js.map +1 -1
- package/dist/api/run-files.d.ts +12 -2
- package/dist/api/run-files.d.ts.map +1 -1
- package/dist/api/run-files.js +17 -5
- package/dist/api/run-files.js.map +1 -1
- package/dist/api/server.d.ts +20 -0
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +62 -9
- package/dist/api/server.js.map +1 -1
- package/dist/api/skills.d.ts +88 -0
- package/dist/api/skills.d.ts.map +1 -0
- package/dist/api/skills.js +264 -0
- package/dist/api/skills.js.map +1 -0
- package/dist/api/testing.d.ts +2 -75
- package/dist/api/testing.d.ts.map +1 -1
- package/dist/api/testing.js +14 -28
- package/dist/api/testing.js.map +1 -1
- package/dist/core/adapter.d.ts +42 -0
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +83 -12
- package/dist/core/adapter.js.map +1 -1
- package/dist/interactive/bridge-root.d.ts +117 -7
- package/dist/interactive/bridge-root.d.ts.map +1 -1
- package/dist/interactive/bridge-root.js +229 -9
- package/dist/interactive/bridge-root.js.map +1 -1
- package/dist/interactive/doc-delete-routes.d.ts +2 -0
- package/dist/interactive/doc-delete-routes.d.ts.map +1 -1
- package/dist/interactive/doc-delete-routes.js +3 -19
- package/dist/interactive/doc-delete-routes.js.map +1 -1
- package/dist/interactive/doc-list-routes.d.ts +42 -0
- package/dist/interactive/doc-list-routes.d.ts.map +1 -0
- package/dist/interactive/doc-list-routes.js +165 -0
- package/dist/interactive/doc-list-routes.js.map +1 -0
- package/dist/interactive/project-root.d.ts +36 -0
- package/dist/interactive/project-root.d.ts.map +1 -0
- package/dist/interactive/project-root.js +45 -0
- package/dist/interactive/project-root.js.map +1 -0
- package/dist/interactive/proxy-routes.d.ts +4 -1
- package/dist/interactive/proxy-routes.d.ts.map +1 -1
- package/dist/interactive/proxy-routes.js +4 -22
- package/dist/interactive/proxy-routes.js.map +1 -1
- package/dist/projects/default-project.d.ts +10 -0
- package/dist/projects/default-project.d.ts.map +1 -0
- package/dist/projects/default-project.js +10 -0
- package/dist/projects/default-project.js.map +1 -0
- package/dist/projects/routes.d.ts +0 -2
- package/dist/projects/routes.d.ts.map +1 -1
- package/dist/projects/routes.js +1 -2
- package/dist/projects/routes.js.map +1 -1
- package/dist/skills/bundle.d.ts +94 -0
- package/dist/skills/bundle.d.ts.map +1 -0
- package/dist/skills/bundle.js +187 -0
- package/dist/skills/bundle.js.map +1 -0
- package/dist/skills/contain.d.ts +57 -0
- package/dist/skills/contain.d.ts.map +1 -0
- package/dist/skills/contain.js +90 -0
- package/dist/skills/contain.js.map +1 -0
- package/dist/skills/core-closure.d.ts +83 -0
- package/dist/skills/core-closure.d.ts.map +1 -0
- package/dist/skills/core-closure.js +130 -0
- package/dist/skills/core-closure.js.map +1 -0
- package/dist/skills/engine-env.d.ts +48 -0
- package/dist/skills/engine-env.d.ts.map +1 -0
- package/dist/skills/engine-env.js +69 -0
- package/dist/skills/engine-env.js.map +1 -0
- package/dist/skills/frontmatter.d.ts +77 -0
- package/dist/skills/frontmatter.d.ts.map +1 -0
- package/dist/skills/frontmatter.js +190 -0
- package/dist/skills/frontmatter.js.map +1 -0
- package/dist/skills/guards.d.ts +72 -0
- package/dist/skills/guards.d.ts.map +1 -0
- package/dist/skills/guards.js +147 -0
- package/dist/skills/guards.js.map +1 -0
- package/dist/skills/live-generations.d.ts +80 -0
- package/dist/skills/live-generations.d.ts.map +1 -0
- package/dist/skills/live-generations.js +163 -0
- package/dist/skills/live-generations.js.map +1 -0
- package/dist/skills/plugin-source.d.ts +109 -0
- package/dist/skills/plugin-source.d.ts.map +1 -0
- package/dist/skills/plugin-source.js +272 -0
- package/dist/skills/plugin-source.js.map +1 -0
- package/dist/skills/refs.d.ts +58 -0
- package/dist/skills/refs.d.ts.map +1 -0
- package/dist/skills/refs.js +133 -0
- package/dist/skills/refs.js.map +1 -0
- package/dist/skills/root-fence.d.ts +53 -0
- package/dist/skills/root-fence.d.ts.map +1 -0
- package/dist/skills/root-fence.js +109 -0
- package/dist/skills/root-fence.js.map +1 -0
- package/dist/skills/root-names.d.ts +42 -0
- package/dist/skills/root-names.d.ts.map +1 -0
- package/dist/skills/root-names.js +44 -0
- package/dist/skills/root-names.js.map +1 -0
- package/dist/skills/runtime.d.ts +130 -0
- package/dist/skills/runtime.d.ts.map +1 -0
- package/dist/skills/runtime.js +246 -0
- package/dist/skills/runtime.js.map +1 -0
- package/dist/skills/store.d.ts +895 -0
- package/dist/skills/store.d.ts.map +1 -0
- package/dist/skills/store.js +3575 -0
- package/dist/skills/store.js.map +1 -0
- package/dist/skills/tree.d.ts +292 -0
- package/dist/skills/tree.d.ts.map +1 -0
- package/dist/skills/tree.js +645 -0
- package/dist/skills/tree.js.map +1 -0
- package/dist/skills/venv.d.ts +52 -0
- package/dist/skills/venv.d.ts.map +1 -0
- package/dist/skills/venv.js +80 -0
- package/dist/skills/venv.js.map +1 -0
- package/dist/studio/assets/index-CK1uJWs2.css +32 -0
- package/dist/studio/assets/index-FcZg3WDR.js +539 -0
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +605 -7
- package/endpoint-manifest.json +183 -1
- package/package.json +4 -3
- package/dist/studio/assets/index-C4iz4uAw.js +0 -537
- package/dist/studio/assets/index-DEEQcRQ_.css +0 -32
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-source.js","sourceRoot":"","sources":["../../src/skills/plugin-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,kGAAkG;AAClG,MAAM,CAAC,MAAM,iBAAiB,GAAG,2BAA2B,CAAC;AAE7D,6EAA6E;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;AAUzE,sGAAsG;AACtG,MAAM,UAAU,eAAe,CAAC,MAAyB,OAAO,CAAC,GAAG,EAAE,OAAe,OAAO,EAAE;IAC5F,MAAM,UAAU,GAAG,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAC5C,OAAO,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAC5F,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IAEtC;IACA;IACA;IAHX,YACW,IAAY,EACZ,KAAa,EACb,MAAc;QAEvB,KAAK,CACH,iBAAiB,IAAI,KAAK,KAAK,qBAAqB,MAAM,oEAAoE;YAC5H,8GAA8G;YAC9G,0GAA0G,C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C,MAAM,CAAC,GAAG,CAAC;SACxD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference extraction over skill text (design v3 §4/§5): the two link shapes garden skills use
|
|
3
|
+
* to reach files outside their own directory, plus the cwd-relative script invocation that makes a
|
|
4
|
+
* skill Claude-only.
|
|
5
|
+
*
|
|
6
|
+
* - `${CLAUDE_PLUGIN_ROOT}/<p>` — the plugin-root form (461 literals across 102 files in the
|
|
7
|
+
* live 12.32.0 plugin): resolved against the SNAPSHOT root at publish, so a reference into a
|
|
8
|
+
* disabled skill or a file the bundle does not carry is a blocking finding naming file:line.
|
|
9
|
+
* - `../<p>` — sibling links (`repo-learn/SKILL.md` → `../search/refs/hotspots.md`): resolved
|
|
10
|
+
* from the referencing file's directory, must land inside the snapshot.
|
|
11
|
+
* - `python3 scripts/…` / `python3 -u scripts/x/run.py` / `bash scripts/x` / `./scripts/x` — a
|
|
12
|
+
* script invoked relative to the WORKTREE cwd (`domain-extractor/SKILL.md:42`): not a reference
|
|
13
|
+
* to resolve, but a portability marker. ANY interpreter followed by a cwd-relative path (after
|
|
14
|
+
* optional flags) counts, not only one literally followed by `scripts/` (codex round 2).
|
|
15
|
+
*
|
|
16
|
+
* `portable` (v3 §5) is `false` when a skill's files carry any of the three: non-Claude CLIs have
|
|
17
|
+
* no plugin root, no snapshot cwd, and only a flat `<name>/SKILL.md` layout — a skill that needs
|
|
18
|
+
* any of them is Claude-only: excluded from every non-Claude delivery view the snapshot carries
|
|
19
|
+
* (`views/copilot/`, design v3.2 §4) and from the per-launch `--skill` lists core builds.
|
|
20
|
+
*
|
|
21
|
+
* Path tokens keep every ORDINARY filename character (`+`, `@`, `~`, `%`, `=`, `,`, `:` …): a
|
|
22
|
+
* reference truncated at the first unusual character would validate a PREFIX of the file it names
|
|
23
|
+
* (`scripts/a+b.py` → `scripts/a`), so the token runs until whitespace, a quote/backtick, a
|
|
24
|
+
* bracket/paren/brace, a shell separator (`|;&<>`) or a glob metacharacter (`*`, `?` — `foo*` is a
|
|
25
|
+
* pattern, not a file the snapshot can carry; `PATH_CHARS` is the one stop set) — trailing sentence
|
|
26
|
+
* punctuation is then trimmed.
|
|
27
|
+
*/
|
|
28
|
+
/** The literal every plugin-root reference starts with. */
|
|
29
|
+
export declare const PLUGIN_ROOT_MARKER = "${CLAUDE_PLUGIN_ROOT}";
|
|
30
|
+
/** One reference found in a text: the 1-based `line` it sits on and the path it names. */
|
|
31
|
+
export interface TextRef {
|
|
32
|
+
line: number;
|
|
33
|
+
/** For `plugin-root`: plugin-relative (`scripts/_python.sh`; `''` for the bare root). For
|
|
34
|
+
* `relative`: as written (`../search/refs/hotspots.md`). */
|
|
35
|
+
path: string;
|
|
36
|
+
kind: 'plugin-root' | 'relative';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Resolve a `${CLAUDE_PLUGIN_ROOT}/<p>` reference to a normalized plugin-relative path: a trailing
|
|
40
|
+
* `/` (a directory reference) is dropped, `.` segments folded, and any path that climbs OUT of the
|
|
41
|
+
* plugin root (`..`, `scripts/../../x`) answers `null` — never the root, never a sibling of it.
|
|
42
|
+
* `''` is the bare root.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolvePluginRootRef(p: string): string | null;
|
|
45
|
+
/** Every `${CLAUDE_PLUGIN_ROOT}/<p>` reference in `text`, in order. */
|
|
46
|
+
export declare function extractPluginRootRefs(text: string): TextRef[];
|
|
47
|
+
/** Every `../<p>` reference in `text`, in order (as written; the caller resolves it). */
|
|
48
|
+
export declare function extractRelativeRefs(text: string): TextRef[];
|
|
49
|
+
/**
|
|
50
|
+
* Resolve a `../<p>` reference written in the file at plugin-relative `fileRel` to a
|
|
51
|
+
* plugin-relative path, or `null` when it climbs out of the plugin root.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveRelativeRef(fileRel: string, ref: string): string | null;
|
|
54
|
+
export type PortabilityIssue = 'plugin-root' | 'relative-link' | 'cwd-script';
|
|
55
|
+
/** The first reason `text` is not portable to a non-Claude CLI, or `null` when it is. */
|
|
56
|
+
export declare function portabilityIssueOf(text: string): PortabilityIssue | null;
|
|
57
|
+
export declare function looksBinary(buf: Buffer): boolean;
|
|
58
|
+
//# sourceMappingURL=refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../src/skills/refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,0FAA0F;AAC1F,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb;iEAC6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,GAAG,UAAU,CAAC;CAClC;AA4CD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7D;AAED,uEAAuE;AACvE,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CAW7D;AAED,yFAAyF;AACzF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CAU3D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI9E;AAED,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,eAAe,GAAG,YAAY,CAAC;AAE9E,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAKxE;AAID,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEhD"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reference extraction over skill text (design v3 §4/§5): the two link shapes garden skills use
|
|
3
|
+
* to reach files outside their own directory, plus the cwd-relative script invocation that makes a
|
|
4
|
+
* skill Claude-only.
|
|
5
|
+
*
|
|
6
|
+
* - `${CLAUDE_PLUGIN_ROOT}/<p>` — the plugin-root form (461 literals across 102 files in the
|
|
7
|
+
* live 12.32.0 plugin): resolved against the SNAPSHOT root at publish, so a reference into a
|
|
8
|
+
* disabled skill or a file the bundle does not carry is a blocking finding naming file:line.
|
|
9
|
+
* - `../<p>` — sibling links (`repo-learn/SKILL.md` → `../search/refs/hotspots.md`): resolved
|
|
10
|
+
* from the referencing file's directory, must land inside the snapshot.
|
|
11
|
+
* - `python3 scripts/…` / `python3 -u scripts/x/run.py` / `bash scripts/x` / `./scripts/x` — a
|
|
12
|
+
* script invoked relative to the WORKTREE cwd (`domain-extractor/SKILL.md:42`): not a reference
|
|
13
|
+
* to resolve, but a portability marker. ANY interpreter followed by a cwd-relative path (after
|
|
14
|
+
* optional flags) counts, not only one literally followed by `scripts/` (codex round 2).
|
|
15
|
+
*
|
|
16
|
+
* `portable` (v3 §5) is `false` when a skill's files carry any of the three: non-Claude CLIs have
|
|
17
|
+
* no plugin root, no snapshot cwd, and only a flat `<name>/SKILL.md` layout — a skill that needs
|
|
18
|
+
* any of them is Claude-only: excluded from every non-Claude delivery view the snapshot carries
|
|
19
|
+
* (`views/copilot/`, design v3.2 §4) and from the per-launch `--skill` lists core builds.
|
|
20
|
+
*
|
|
21
|
+
* Path tokens keep every ORDINARY filename character (`+`, `@`, `~`, `%`, `=`, `,`, `:` …): a
|
|
22
|
+
* reference truncated at the first unusual character would validate a PREFIX of the file it names
|
|
23
|
+
* (`scripts/a+b.py` → `scripts/a`), so the token runs until whitespace, a quote/backtick, a
|
|
24
|
+
* bracket/paren/brace, a shell separator (`|;&<>`) or a glob metacharacter (`*`, `?` — `foo*` is a
|
|
25
|
+
* pattern, not a file the snapshot can carry; `PATH_CHARS` is the one stop set) — trailing sentence
|
|
26
|
+
* punctuation is then trimmed.
|
|
27
|
+
*/
|
|
28
|
+
import { posix } from 'node:path';
|
|
29
|
+
/** The literal every plugin-root reference starts with. */
|
|
30
|
+
export const PLUGIN_ROOT_MARKER = '${CLAUDE_PLUGIN_ROOT}';
|
|
31
|
+
/** A path token: everything up to whitespace, a quote/backtick, a bracket/paren/brace, a shell separator, or a glob metacharacter (`*`, `?`). */
|
|
32
|
+
const PATH_CHARS = '[^\\s"\'`()\\[\\]{}<>|;&*?]';
|
|
33
|
+
const PLUGIN_ROOT_RE = new RegExp(`\\$\\{CLAUDE_PLUGIN_ROOT\\}(\\/${PATH_CHARS}*)?`, 'g');
|
|
34
|
+
// A `../`-prefixed path token not glued to a preceding path character (so `a/../b` inside a
|
|
35
|
+
// longer path is not re-read as a reference of its own).
|
|
36
|
+
const RELATIVE_RE = new RegExp(`(?<![A-Za-z0-9_./-])((?:\\.\\.\\/)+${PATH_CHARS}*)`, 'g');
|
|
37
|
+
// A shell invocation of a plugin script by a cwd-relative path: an interpreter, optional options,
|
|
38
|
+
// then a path token that is relative — not absolute, not `$`-expanded, not `~` — and looks like a
|
|
39
|
+
// script (carries a `/`, or a script extension). Options come in two shapes (codex round 5): a
|
|
40
|
+
// bare flag (`-u`, `--frozen`, `--require=x`), and an option whose VALUE is the NEXT token —
|
|
41
|
+
// python `-W ignore` / `-X dev` / `-m mod` / `-c code`, node `--require x` / `-r x` / `--loader x`
|
|
42
|
+
// / `--import x` / `-e code`, uv `--python x` / `--with x` / `--directory x`, bash `-c cmd` … —
|
|
43
|
+
// which is consumed WITH its value so the script path after it is still seen (`python3 -W ignore
|
|
44
|
+
// scripts/foo.py`, `node --require foo scripts/x.js` used to read as portable). A value-taking
|
|
45
|
+
// option with no path after it (`python3 -m pytest`, `python3 -c "print(1)"`) is not an invocation.
|
|
46
|
+
const INTERPRETER = '(?:python3?|uv\\s+run|bash|sh|zsh|node|npx|tsx|deno\\s+run)';
|
|
47
|
+
const VALUED_OPTION = '(?:-[WXmcQrepCo]|--(?:require|loader|experimental-loader|import|eval|print|env-file|conditions|input-type|python|with|directory|project|config|import-map))';
|
|
48
|
+
// The bare-flag alternative must NOT be able to match a value-taking option that has a value (the
|
|
49
|
+
// negative lookahead): otherwise backtracking would read `-W` as a bare flag and its value
|
|
50
|
+
// `scripts/foo.py` as the script (`python3 -W scripts/foo.py` is NOT an invocation of that file).
|
|
51
|
+
const FLAG = `(?:\\s+(?:${VALUED_OPTION}\\s+\\S+|(?!${VALUED_OPTION}\\s)-{1,2}[A-Za-z0-9_-]+(?:=\\S+)?))*`;
|
|
52
|
+
const SEG = '[A-Za-z0-9_.+@%=,:~-]+';
|
|
53
|
+
const RELATIVE_SCRIPT = `(?:\\.{1,2}\\/)?(?:${SEG}\\/)*${SEG}(?:\\/|\\.(?:py|sh|bash|zsh|mjs|cjs|js|ts))`;
|
|
54
|
+
const CWD_SCRIPT_RE = new RegExp(`(?<![A-Za-z0-9_./-])${INTERPRETER}${FLAG}\\s+(?![/$~])(?:${RELATIVE_SCRIPT}|(?:${SEG}\\/)+${SEG})(?![A-Za-z0-9_])` +
|
|
55
|
+
`|(?<![A-Za-z0-9_./$-])\\.\\/${SEG}(?:\\/${SEG})*`);
|
|
56
|
+
/**
|
|
57
|
+
* Trailing sentence punctuation a prose reference picks up (`…/foo.` at the end of a sentence,
|
|
58
|
+
* `…/foo,` before a clause). A dot-DOT segment is never punctuation: `${CLAUDE_PLUGIN_ROOT}/..`
|
|
59
|
+
* must survive as `..` so the resolver refuses it — stripping it would turn a plugin-root ESCAPE
|
|
60
|
+
* into the plugin root itself (codex review of #480). A lone trailing `.` after a slash (`dir/.`)
|
|
61
|
+
* is the sentence's full stop. Only TRAILING punctuation is trimmed — `a,b.py` keeps its comma.
|
|
62
|
+
*/
|
|
63
|
+
function trimPunctuation(p) {
|
|
64
|
+
const noSeparators = p.replace(/[,:]+$/, '');
|
|
65
|
+
if (/(^|\/)\.\.$/.test(noSeparators))
|
|
66
|
+
return noSeparators;
|
|
67
|
+
return noSeparators.replace(/\.+$/, '');
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Resolve a `${CLAUDE_PLUGIN_ROOT}/<p>` reference to a normalized plugin-relative path: a trailing
|
|
71
|
+
* `/` (a directory reference) is dropped, `.` segments folded, and any path that climbs OUT of the
|
|
72
|
+
* plugin root (`..`, `scripts/../../x`) answers `null` — never the root, never a sibling of it.
|
|
73
|
+
* `''` is the bare root.
|
|
74
|
+
*/
|
|
75
|
+
export function resolvePluginRootRef(p) {
|
|
76
|
+
if (p === '' || p === '.')
|
|
77
|
+
return '';
|
|
78
|
+
const normalized = posix.normalize(p).replace(/\/+$/, '');
|
|
79
|
+
if (normalized === '..' || normalized.startsWith('../'))
|
|
80
|
+
return null;
|
|
81
|
+
return normalized === '.' ? '' : normalized;
|
|
82
|
+
}
|
|
83
|
+
/** Every `${CLAUDE_PLUGIN_ROOT}/<p>` reference in `text`, in order. */
|
|
84
|
+
export function extractPluginRootRefs(text) {
|
|
85
|
+
const out = [];
|
|
86
|
+
const lines = text.split('\n');
|
|
87
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
88
|
+
const line = lines[i] ?? '';
|
|
89
|
+
for (const m of line.matchAll(PLUGIN_ROOT_RE)) {
|
|
90
|
+
const tail = m[1] ?? '';
|
|
91
|
+
out.push({ line: i + 1, path: trimPunctuation(tail.replace(/^\//, '')), kind: 'plugin-root' });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
/** Every `../<p>` reference in `text`, in order (as written; the caller resolves it). */
|
|
97
|
+
export function extractRelativeRefs(text) {
|
|
98
|
+
const out = [];
|
|
99
|
+
const lines = text.split('\n');
|
|
100
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
101
|
+
const line = lines[i] ?? '';
|
|
102
|
+
for (const m of line.matchAll(RELATIVE_RE)) {
|
|
103
|
+
out.push({ line: i + 1, path: trimPunctuation(m[1] ?? ''), kind: 'relative' });
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Resolve a `../<p>` reference written in the file at plugin-relative `fileRel` to a
|
|
110
|
+
* plugin-relative path, or `null` when it climbs out of the plugin root.
|
|
111
|
+
*/
|
|
112
|
+
export function resolveRelativeRef(fileRel, ref) {
|
|
113
|
+
const resolved = posix.normalize(posix.join(posix.dirname(fileRel), ref));
|
|
114
|
+
if (resolved === '..' || resolved.startsWith('../'))
|
|
115
|
+
return null;
|
|
116
|
+
return resolved === '.' ? '' : resolved.replace(/\/$/, '');
|
|
117
|
+
}
|
|
118
|
+
/** The first reason `text` is not portable to a non-Claude CLI, or `null` when it is. */
|
|
119
|
+
export function portabilityIssueOf(text) {
|
|
120
|
+
if (text.includes(PLUGIN_ROOT_MARKER))
|
|
121
|
+
return 'plugin-root';
|
|
122
|
+
if (CWD_SCRIPT_RE.test(text))
|
|
123
|
+
return 'cwd-script';
|
|
124
|
+
if (extractRelativeRefs(text).length > 0)
|
|
125
|
+
return 'relative-link';
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
/** Binary sniff for reference scanning: a NUL in the first 8 KB means "not text, do not scan". */
|
|
129
|
+
const SNIFF_BYTES = 8 * 1024;
|
|
130
|
+
export function looksBinary(buf) {
|
|
131
|
+
return buf.subarray(0, Math.min(buf.length, SNIFF_BYTES)).includes(0);
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=refs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refs.js","sourceRoot":"","sources":["../../src/skills/refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;AAW1D,iJAAiJ;AACjJ,MAAM,UAAU,GAAG,6B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AM,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC;AAC7B,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The skills root is `<state home>/skills` — full stop. Not a setting, not an env override.
|
|
3
|
+
*
|
|
4
|
+
* Design v3.1 §1 (ONE storage root: every crew store hangs off `crewStateHome()`) and v3.2 §1 (wicked
|
|
5
|
+
* never writes into the user's own CLI directories) leave no room for a configurable root: codex
|
|
6
|
+
* round 5 on #480 showed that a `skills_root` setting (or `WICKED_CREW_SKILLS_ROOT`) accepting any
|
|
7
|
+
* absolute path let `PUT /settings {skills_root: "~/.codex/skills"}` make the SEED write into the
|
|
8
|
+
* user's codex skills before the runtime got around to reporting the location as incompatible. Both
|
|
9
|
+
* are retired (coordinator decision). What remains is this BOOT ASSERTION, evaluated by
|
|
10
|
+
* `createServer` before the store is constructed: the root's CANONICAL path must lie inside the
|
|
11
|
+
* daemon state home and outside every known user-level CLI directory, and the root entry itself
|
|
12
|
+
* must not be a symlink. A violation is `SkillsRootUnfencedError` — a daemon start error, never a
|
|
13
|
+
* warning after the first write.
|
|
14
|
+
*
|
|
15
|
+
* This is the one skills module beside plugin-source.ts that reads `homedir()` — to REFUSE roots,
|
|
16
|
+
* never to write: it imports nothing that writes (tests/skills-no-user-cli-writes.test.ts pins
|
|
17
|
+
* both facts).
|
|
18
|
+
*/
|
|
19
|
+
/** The skills root would lie outside the state home or inside a user CLI directory — the daemon does not start. */
|
|
20
|
+
export declare class SkillsRootUnfencedError extends Error {
|
|
21
|
+
readonly root: string;
|
|
22
|
+
constructor(root: string, detail: string);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The user-level CLI configuration directories wicked must never write (design v3.2 §1), for `home`:
|
|
26
|
+
* codex, pi, copilot, opencode, Claude Code — the literal `~/.claude` AND the daemon's own
|
|
27
|
+
* `CLAUDE_CONFIG_DIR` when it points elsewhere (that is the config dir the user's Claude reads).
|
|
28
|
+
*/
|
|
29
|
+
export declare function userCliDirs(home?: string, env?: NodeJS.ProcessEnv): string[];
|
|
30
|
+
/**
|
|
31
|
+
* The canonical spelling of `p`: the realpath of its deepest EXISTING ancestor with the missing tail
|
|
32
|
+
* re-joined — so a root that does not exist yet is judged by where it WOULD land, links in its
|
|
33
|
+
* ancestry resolved. Errors other than "does not exist" propagate (an unreadable ancestor is not
|
|
34
|
+
* judged lexically).
|
|
35
|
+
*/
|
|
36
|
+
export declare function canonicalPath(p: string): string;
|
|
37
|
+
export interface RootFenceOptions {
|
|
38
|
+
/** The daemon state home (`crewStateHome()`) the root must lie inside. */
|
|
39
|
+
stateHome: string;
|
|
40
|
+
/** The user's home (tests inject a fake one). */
|
|
41
|
+
home?: string;
|
|
42
|
+
env?: NodeJS.ProcessEnv;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Refuse a skills root that (1) is a symlink itself, (2) canonically lies outside the state home, or
|
|
46
|
+
* (3) canonically lies inside a user CLI directory. Answers the canonical root. Throws
|
|
47
|
+
* `SkillsRootUnfencedError`. A root that does not exist yet is judged by its would-be canonical path.
|
|
48
|
+
*/
|
|
49
|
+
export declare function assertSkillsRootFenced(root: string, opts: RootFenceOptions): {
|
|
50
|
+
root: string;
|
|
51
|
+
canonical: string;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=root-fence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-fence.d.ts","sourceRoot":"","sources":["../../src/skills/root-fence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAQH,mHAAmH;AACnH,qBAAa,uBAAwB,SAAQ,KAAK;IAE9C,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM;CAQjB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,GAAE,MAAkB,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,EAAE,CAUpG;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAgB/C;AAOD,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAsBhH"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The skills root is `<state home>/skills` — full stop. Not a setting, not an env override.
|
|
3
|
+
*
|
|
4
|
+
* Design v3.1 §1 (ONE storage root: every crew store hangs off `crewStateHome()`) and v3.2 §1 (wicked
|
|
5
|
+
* never writes into the user's own CLI directories) leave no room for a configurable root: codex
|
|
6
|
+
* round 5 on #480 showed that a `skills_root` setting (or `WICKED_CREW_SKILLS_ROOT`) accepting any
|
|
7
|
+
* absolute path let `PUT /settings {skills_root: "~/.codex/skills"}` make the SEED write into the
|
|
8
|
+
* user's codex skills before the runtime got around to reporting the location as incompatible. Both
|
|
9
|
+
* are retired (coordinator decision). What remains is this BOOT ASSERTION, evaluated by
|
|
10
|
+
* `createServer` before the store is constructed: the root's CANONICAL path must lie inside the
|
|
11
|
+
* daemon state home and outside every known user-level CLI directory, and the root entry itself
|
|
12
|
+
* must not be a symlink. A violation is `SkillsRootUnfencedError` — a daemon start error, never a
|
|
13
|
+
* warning after the first write.
|
|
14
|
+
*
|
|
15
|
+
* This is the one skills module beside plugin-source.ts that reads `homedir()` — to REFUSE roots,
|
|
16
|
+
* never to write: it imports nothing that writes (tests/skills-no-user-cli-writes.test.ts pins
|
|
17
|
+
* both facts).
|
|
18
|
+
*/
|
|
19
|
+
import { lstatSync, realpathSync } from 'node:fs';
|
|
20
|
+
import { homedir } from 'node:os';
|
|
21
|
+
import { basename, dirname, join, resolve, sep } from 'node:path';
|
|
22
|
+
import { claudeConfigDir } from './plugin-source.js';
|
|
23
|
+
/** The skills root would lie outside the state home or inside a user CLI directory — the daemon does not start. */
|
|
24
|
+
export class SkillsRootUnfencedError extends Error {
|
|
25
|
+
root;
|
|
26
|
+
constructor(root, detail) {
|
|
27
|
+
super(`skills root ${root} refused: ${detail} — the skills root is <state home>/skills (not a setting) and must never lie inside a user CLI directory; ` +
|
|
28
|
+
'move the daemon state home (--db) out of the user CLI directory and restart');
|
|
29
|
+
this.root = root;
|
|
30
|
+
this.name = 'SkillsRootUnfencedError';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The user-level CLI configuration directories wicked must never write (design v3.2 §1), for `home`:
|
|
35
|
+
* codex, pi, copilot, opencode, Claude Code — the literal `~/.claude` AND the daemon's own
|
|
36
|
+
* `CLAUDE_CONFIG_DIR` when it points elsewhere (that is the config dir the user's Claude reads).
|
|
37
|
+
*/
|
|
38
|
+
export function userCliDirs(home = homedir(), env = process.env) {
|
|
39
|
+
const dirs = [
|
|
40
|
+
join(home, '.codex'),
|
|
41
|
+
join(home, '.pi'),
|
|
42
|
+
join(home, '.copilot'),
|
|
43
|
+
join(home, '.config', 'opencode'),
|
|
44
|
+
join(home, '.claude'),
|
|
45
|
+
claudeConfigDir(env, home),
|
|
46
|
+
];
|
|
47
|
+
return [...new Set(dirs.map((d) => resolve(d)))];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The canonical spelling of `p`: the realpath of its deepest EXISTING ancestor with the missing tail
|
|
51
|
+
* re-joined — so a root that does not exist yet is judged by where it WOULD land, links in its
|
|
52
|
+
* ancestry resolved. Errors other than "does not exist" propagate (an unreadable ancestor is not
|
|
53
|
+
* judged lexically).
|
|
54
|
+
*/
|
|
55
|
+
export function canonicalPath(p) {
|
|
56
|
+
const abs = resolve(p);
|
|
57
|
+
const tail = [];
|
|
58
|
+
let cur = abs;
|
|
59
|
+
for (;;) {
|
|
60
|
+
try {
|
|
61
|
+
return join(realpathSync(cur), ...tail.reverse());
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
const code = err.code;
|
|
65
|
+
if (code !== 'ENOENT' && code !== 'ENOTDIR')
|
|
66
|
+
throw err;
|
|
67
|
+
}
|
|
68
|
+
const parent = dirname(cur);
|
|
69
|
+
if (parent === cur)
|
|
70
|
+
return abs;
|
|
71
|
+
tail.push(basename(cur));
|
|
72
|
+
cur = parent;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** Whether `path` is `dir` or lies beneath it (both already canonical). */
|
|
76
|
+
function isInside(path, dir) {
|
|
77
|
+
return path === dir || path.startsWith(dir.endsWith(sep) ? dir : `${dir}${sep}`);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Refuse a skills root that (1) is a symlink itself, (2) canonically lies outside the state home, or
|
|
81
|
+
* (3) canonically lies inside a user CLI directory. Answers the canonical root. Throws
|
|
82
|
+
* `SkillsRootUnfencedError`. A root that does not exist yet is judged by its would-be canonical path.
|
|
83
|
+
*/
|
|
84
|
+
export function assertSkillsRootFenced(root, opts) {
|
|
85
|
+
let st;
|
|
86
|
+
try {
|
|
87
|
+
st = lstatSync(root);
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
if (err.code !== 'ENOENT' && err.code !== 'ENOTDIR')
|
|
91
|
+
throw err;
|
|
92
|
+
}
|
|
93
|
+
if (st?.isSymbolicLink() === true) {
|
|
94
|
+
throw new SkillsRootUnfencedError(root, 'a symlink stands in for the skills root (the store never follows links, the root included)');
|
|
95
|
+
}
|
|
96
|
+
const canonical = canonicalPath(root);
|
|
97
|
+
const stateHome = canonicalPath(opts.stateHome);
|
|
98
|
+
if (!isInside(canonical, stateHome) || canonical === stateHome) {
|
|
99
|
+
throw new SkillsRootUnfencedError(root, `its canonical path ${canonical} is not inside the daemon state home ${stateHome}`);
|
|
100
|
+
}
|
|
101
|
+
for (const dir of userCliDirs(opts.home, opts.env)) {
|
|
102
|
+
const canonicalDir = canonicalPath(dir);
|
|
103
|
+
if (isInside(canonical, canonicalDir)) {
|
|
104
|
+
throw new SkillsRootUnfencedError(root, `its canonical path ${canonical} lies inside the user CLI directory ${canonicalDir}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return { root, canonical };
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=root-fence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-fence.js","sourceRoot":"","sources":["../../src/skills/root-fence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,mHAAmH;AACnH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAErC;IADX,YACW,IAAY,EACrB,MAAc;QAEd,KAAK,CACH,eAAe,IAAI,aAAa,MAAM,4GAA4G;YAChJ,6EAA6E,CAChF,CAAC;QANO,SAAI,GAAJ,IAAI,CAAQ;QAOrB,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAED;;;;GAIG;AACH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,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,uBAAuB,CAAC,IAAI,EAAE,sBAAsB,SAAS,uCAAuC,YAAY,EAAE,CAAC,CAAC;QAChI,CAAC;IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EVERY name the daemon can ever create directly under `<state home>/skills/` and under its
|
|
3
|
+
* `snapshots/` slot — settled AND transient — in one table (design v3.5 §2; codex round 8 on #480).
|
|
4
|
+
*
|
|
5
|
+
* The worker Read fence (wicked-core) classifies the children of `skills/` and of `snapshots/` from
|
|
6
|
+
* the shared fixture `tests/fixtures/state-home-subtrees.json` (byte-identical in core and crew) and
|
|
7
|
+
* REFUSES a launch naming a child it does not know — so a transient name the store creates during a
|
|
8
|
+
* mutation (a `.staging-*` park-and-place directory, the `manifest.json.tmp-*` of a commit, a
|
|
9
|
+
* generation being written under `snapshots/.staging-*`, the `snapshots/.tmp-current-*` link before
|
|
10
|
+
* its rename) that is missing from the fixture is a live race between a mutation and a worker launch.
|
|
11
|
+
*
|
|
12
|
+
* This table is the store's side of that contract: the store binds its own constants to it
|
|
13
|
+
* (`store.ts`, `tree.ts`), `tests/skills-fence-names.test.ts` asserts the fixture's `skills` entry
|
|
14
|
+
* lists EXACTLY these patterns with these kinds (a static audit over the store's source backs it —
|
|
15
|
+
* every `join(this.rootDir, …)` / `join(this.snapshotsDir(), …)` the store writes must resolve to a
|
|
16
|
+
* row here), and a paused-operation test observes the transient names at the moment they exist.
|
|
17
|
+
* Adding a name the store writes means adding it HERE first; the tests then demand the fixture (and,
|
|
18
|
+
* through the coordinator, core) follow.
|
|
19
|
+
*
|
|
20
|
+
* Not listed: `baseline/.staging-*` (a capture being written) — `baseline/` is denied WHOLE, so its
|
|
21
|
+
* children are never classified individually.
|
|
22
|
+
*/
|
|
23
|
+
export type SkillsRootNameKind = 'dir' | 'file' | 'link';
|
|
24
|
+
export interface SkillsRootName {
|
|
25
|
+
/** Exact name, or a `prefix-*` glob; `snapshots/…` for a child of the slot. */
|
|
26
|
+
pattern: string;
|
|
27
|
+
kind: SkillsRootNameKind;
|
|
28
|
+
/** Exists only for the width of one mutation (created, then renamed away or removed). */
|
|
29
|
+
transient: boolean;
|
|
30
|
+
/** Where the store creates it — prose for the reader and the audit. */
|
|
31
|
+
created_by: string;
|
|
32
|
+
}
|
|
33
|
+
/** The park-and-place staging prefix (`.staging-<op>-<hex>` under the root; `.staging-<hex>` under `baseline/` and `snapshots/`). */
|
|
34
|
+
export declare const STAGING_PREFIX = ".staging-";
|
|
35
|
+
/** The transient `current` link's prefix inside `snapshots/` (created there, renamed over `skills/current`). */
|
|
36
|
+
export declare const CURRENT_TMP_PREFIX = ".tmp-current-";
|
|
37
|
+
/** `writeFileAtomic`'s temp-file infix: `<file>.tmp-<hex>`, renamed over `<file>` — `manifest.json.tmp-*` at the root. */
|
|
38
|
+
export declare const ATOMIC_TMP_INFIX = ".tmp-";
|
|
39
|
+
/** The refusal sentinel directory name (`<root>/refused/skills.{blocked,config}`) — NAMED, never created. */
|
|
40
|
+
export declare const REFUSED_DIRNAME = "refused";
|
|
41
|
+
export declare const SKILLS_ROOT_NAMES: ReadonlyArray<SkillsRootName>;
|
|
42
|
+
//# sourceMappingURL=root-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-names.d.ts","sourceRoot":"","sources":["../../src/skills/root-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzD,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,kBAAkB,CAAC;IACzB,yFAAyF;IACzF,SAAS,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qIAAqI;AACrI,eAAO,MAAM,cAAc,cAAc,CAAC;AAC1C,gHAAgH;AAChH,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAClD,0HAA0H;AAC1H,eAAO,MAAM,gBAAgB,UAAU,CAAC;AACxC,6GAA6G;AAC7G,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,cAAc,CAY3D,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EVERY name the daemon can ever create directly under `<state home>/skills/` and under its
|
|
3
|
+
* `snapshots/` slot — settled AND transient — in one table (design v3.5 §2; codex round 8 on #480).
|
|
4
|
+
*
|
|
5
|
+
* The worker Read fence (wicked-core) classifies the children of `skills/` and of `snapshots/` from
|
|
6
|
+
* the shared fixture `tests/fixtures/state-home-subtrees.json` (byte-identical in core and crew) and
|
|
7
|
+
* REFUSES a launch naming a child it does not know — so a transient name the store creates during a
|
|
8
|
+
* mutation (a `.staging-*` park-and-place directory, the `manifest.json.tmp-*` of a commit, a
|
|
9
|
+
* generation being written under `snapshots/.staging-*`, the `snapshots/.tmp-current-*` link before
|
|
10
|
+
* its rename) that is missing from the fixture is a live race between a mutation and a worker launch.
|
|
11
|
+
*
|
|
12
|
+
* This table is the store's side of that contract: the store binds its own constants to it
|
|
13
|
+
* (`store.ts`, `tree.ts`), `tests/skills-fence-names.test.ts` asserts the fixture's `skills` entry
|
|
14
|
+
* lists EXACTLY these patterns with these kinds (a static audit over the store's source backs it —
|
|
15
|
+
* every `join(this.rootDir, …)` / `join(this.snapshotsDir(), …)` the store writes must resolve to a
|
|
16
|
+
* row here), and a paused-operation test observes the transient names at the moment they exist.
|
|
17
|
+
* Adding a name the store writes means adding it HERE first; the tests then demand the fixture (and,
|
|
18
|
+
* through the coordinator, core) follow.
|
|
19
|
+
*
|
|
20
|
+
* Not listed: `baseline/.staging-*` (a capture being written) — `baseline/` is denied WHOLE, so its
|
|
21
|
+
* children are never classified individually.
|
|
22
|
+
*/
|
|
23
|
+
/** The park-and-place staging prefix (`.staging-<op>-<hex>` under the root; `.staging-<hex>` under `baseline/` and `snapshots/`). */
|
|
24
|
+
export const STAGING_PREFIX = '.staging-';
|
|
25
|
+
/** The transient `current` link's prefix inside `snapshots/` (created there, renamed over `skills/current`). */
|
|
26
|
+
export const CURRENT_TMP_PREFIX = '.tmp-current-';
|
|
27
|
+
/** `writeFileAtomic`'s temp-file infix: `<file>.tmp-<hex>`, renamed over `<file>` — `manifest.json.tmp-*` at the root. */
|
|
28
|
+
export const ATOMIC_TMP_INFIX = '.tmp-';
|
|
29
|
+
/** The refusal sentinel directory name (`<root>/refused/skills.{blocked,config}`) — NAMED, never created. */
|
|
30
|
+
export const REFUSED_DIRNAME = 'refused';
|
|
31
|
+
export const SKILLS_ROOT_NAMES = [
|
|
32
|
+
{ pattern: 'baseline', kind: 'dir', transient: false, created_by: 'store.ts captureBaseline — baseline/<hash>/ per captured bundle' },
|
|
33
|
+
{ pattern: 'effective', kind: 'dir', transient: false, created_by: 'store.ts seed — the operator-edited plugin root' },
|
|
34
|
+
{ pattern: 'manifest.json', kind: 'file', transient: false, created_by: 'store.ts writeManifest' },
|
|
35
|
+
{ pattern: `manifest.json${ATOMIC_TMP_INFIX}*`, kind: 'file', transient: true, created_by: 'tree.ts writeFileAtomic — the manifest commit writes manifest.json.tmp-<hex> and renames it over manifest.json' },
|
|
36
|
+
{ pattern: 'snapshots', kind: 'dir', transient: false, created_by: 'store.ts publishSerialized — the read slot; <gen>/ children are what a worker reads' },
|
|
37
|
+
{ pattern: 'current', kind: 'link', transient: false, created_by: 'store.ts flipCurrent — current -> snapshots/<gen>' },
|
|
38
|
+
{ pattern: '.uv-cache', kind: 'dir', transient: false, created_by: "venv.ts UV_CACHE_DIRNAME — the daemon's own uv cache (UV_CACHE_DIR)" },
|
|
39
|
+
{ pattern: `${STAGING_PREFIX}*`, kind: 'dir', transient: true, created_by: 'store.ts swapOwnFiles / stageSingleFile / reset / refreshBaseline — the park-and-place staging (new/ + old/) of one mutation' },
|
|
40
|
+
{ pattern: REFUSED_DIRNAME, kind: 'dir', transient: false, created_by: 'runtime.ts refusalPath — NAMED as the non-existent engine input <root>/refused/skills.{blocked,config}; never created' },
|
|
41
|
+
{ pattern: `snapshots/${STAGING_PREFIX}*`, kind: 'dir', transient: true, created_by: 'store.ts publishSerialized — a generation being written, renamed to snapshots/<gen>' },
|
|
42
|
+
{ pattern: `snapshots/${CURRENT_TMP_PREFIX}*`, kind: 'link', transient: true, created_by: 'store.ts flipCurrent — the transient current link, renamed over skills/current' },
|
|
43
|
+
];
|
|
44
|
+
//# sourceMappingURL=root-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-names.js","sourceRoot":"","sources":["../../src/skills/root-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAcH,qIAAqI;AACrI,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAC1C,gHAAgH;AAChH,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAClD,0HAA0H;AAC1H,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,6GAA6G;AAC7G,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AAEzC,MAAM,CAAC,MAAM,iBAAiB,GAAkC;IAC9D,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,iEAAiE,EAAE;IACrI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,iDAAiD,EAAE;IACtH,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,wBAAwB,EAAE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