wicked-crew 0.7.28 → 0.7.30

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.
Files changed (146) hide show
  1. package/README.md +12 -1
  2. package/dist/api/chat-scope.d.ts +210 -0
  3. package/dist/api/chat-scope.d.ts.map +1 -0
  4. package/dist/api/chat-scope.js +728 -0
  5. package/dist/api/chat-scope.js.map +1 -0
  6. package/dist/api/diagnostics.d.ts +30 -2
  7. package/dist/api/diagnostics.d.ts.map +1 -1
  8. package/dist/api/diagnostics.js +73 -5
  9. package/dist/api/diagnostics.js.map +1 -1
  10. package/dist/api/governance-health.d.ts +171 -0
  11. package/dist/api/governance-health.d.ts.map +1 -0
  12. package/dist/api/governance-health.js +379 -0
  13. package/dist/api/governance-health.js.map +1 -0
  14. package/dist/api/open-path.d.ts.map +1 -1
  15. package/dist/api/open-path.js +2 -1
  16. package/dist/api/open-path.js.map +1 -1
  17. package/dist/api/post-hoc-deliver.d.ts +9 -5
  18. package/dist/api/post-hoc-deliver.d.ts.map +1 -1
  19. package/dist/api/post-hoc-deliver.js +21 -7
  20. package/dist/api/post-hoc-deliver.js.map +1 -1
  21. package/dist/api/routes.d.ts +70 -12
  22. package/dist/api/routes.d.ts.map +1 -1
  23. package/dist/api/routes.js +375 -60
  24. package/dist/api/routes.js.map +1 -1
  25. package/dist/api/seat-health.d.ts +38 -0
  26. package/dist/api/seat-health.d.ts.map +1 -1
  27. package/dist/api/seat-health.js +88 -5
  28. package/dist/api/seat-health.js.map +1 -1
  29. package/dist/api/seat-signin.d.ts.map +1 -1
  30. package/dist/api/seat-signin.js +49 -23
  31. package/dist/api/seat-signin.js.map +1 -1
  32. package/dist/api/seat-standing.d.ts +101 -0
  33. package/dist/api/seat-standing.d.ts.map +1 -0
  34. package/dist/api/seat-standing.js +138 -0
  35. package/dist/api/seat-standing.js.map +1 -0
  36. package/dist/api/server.d.ts.map +1 -1
  37. package/dist/api/server.js +37 -0
  38. package/dist/api/server.js.map +1 -1
  39. package/dist/campaigns/routes.d.ts +4 -4
  40. package/dist/cli/governance.d.ts +131 -0
  41. package/dist/cli/governance.d.ts.map +1 -0
  42. package/dist/cli/governance.js +354 -0
  43. package/dist/cli/governance.js.map +1 -0
  44. package/dist/cli/index.js +102 -3
  45. package/dist/cli/index.js.map +1 -1
  46. package/dist/core/adapter.d.ts +99 -1
  47. package/dist/core/adapter.d.ts.map +1 -1
  48. package/dist/core/adapter.js +149 -8
  49. package/dist/core/adapter.js.map +1 -1
  50. package/dist/core/bridge-path.d.ts +21 -0
  51. package/dist/core/bridge-path.d.ts.map +1 -1
  52. package/dist/core/bridge-path.js +37 -0
  53. package/dist/core/bridge-path.js.map +1 -1
  54. package/dist/core/bridge-reaper.d.ts.map +1 -1
  55. package/dist/core/bridge-reaper.js +11 -4
  56. package/dist/core/bridge-reaper.js.map +1 -1
  57. package/dist/core/deliver-text.d.ts +184 -0
  58. package/dist/core/deliver-text.d.ts.map +1 -0
  59. package/dist/core/deliver-text.js +434 -0
  60. package/dist/core/deliver-text.js.map +1 -0
  61. package/dist/core/deliver-triage.d.ts +90 -0
  62. package/dist/core/deliver-triage.d.ts.map +1 -0
  63. package/dist/core/deliver-triage.js +106 -0
  64. package/dist/core/deliver-triage.js.map +1 -0
  65. package/dist/core/deliver.d.ts +103 -9
  66. package/dist/core/deliver.d.ts.map +1 -1
  67. package/dist/core/deliver.js +244 -46
  68. package/dist/core/deliver.js.map +1 -1
  69. package/dist/core/estate-mcp-client.d.ts.map +1 -1
  70. package/dist/core/estate-mcp-client.js +7 -2
  71. package/dist/core/estate-mcp-client.js.map +1 -1
  72. package/dist/core/exec.d.ts.map +1 -1
  73. package/dist/core/exec.js +11 -1
  74. package/dist/core/exec.js.map +1 -1
  75. package/dist/core/governance-store.d.ts +219 -0
  76. package/dist/core/governance-store.d.ts.map +1 -0
  77. package/dist/core/governance-store.js +290 -0
  78. package/dist/core/governance-store.js.map +1 -0
  79. package/dist/core/repoPaths.d.ts +36 -5
  80. package/dist/core/repoPaths.d.ts.map +1 -1
  81. package/dist/core/repoPaths.js +46 -4
  82. package/dist/core/repoPaths.js.map +1 -1
  83. package/dist/interactive/bridge-pool.d.ts +29 -24
  84. package/dist/interactive/bridge-pool.d.ts.map +1 -1
  85. package/dist/interactive/bridge-pool.js +74 -7
  86. package/dist/interactive/bridge-pool.js.map +1 -1
  87. package/dist/interactive/chat-events.d.ts.map +1 -1
  88. package/dist/interactive/chat-events.js +5 -2
  89. package/dist/interactive/chat-events.js.map +1 -1
  90. package/dist/interactive/council-outcome.d.ts +28 -0
  91. package/dist/interactive/council-outcome.d.ts.map +1 -0
  92. package/dist/interactive/council-outcome.js +57 -0
  93. package/dist/interactive/council-outcome.js.map +1 -0
  94. package/dist/interactive/demo-events.d.ts.map +1 -1
  95. package/dist/interactive/demo-events.js +5 -2
  96. package/dist/interactive/demo-events.js.map +1 -1
  97. package/dist/interactive/doc-delete-routes.d.ts.map +1 -1
  98. package/dist/interactive/doc-delete-routes.js +3 -2
  99. package/dist/interactive/doc-delete-routes.js.map +1 -1
  100. package/dist/interactive/draft-events.d.ts.map +1 -1
  101. package/dist/interactive/draft-events.js +5 -2
  102. package/dist/interactive/draft-events.js.map +1 -1
  103. package/dist/interactive/edit-events.d.ts.map +1 -1
  104. package/dist/interactive/edit-events.js +5 -2
  105. package/dist/interactive/edit-events.js.map +1 -1
  106. package/dist/projects/auto-refresh.d.ts +54 -0
  107. package/dist/projects/auto-refresh.d.ts.map +1 -0
  108. package/dist/projects/auto-refresh.js +76 -0
  109. package/dist/projects/auto-refresh.js.map +1 -0
  110. package/dist/projects/graph-paths.d.ts +4 -2
  111. package/dist/projects/graph-paths.d.ts.map +1 -1
  112. package/dist/projects/graph-paths.js +4 -2
  113. package/dist/projects/graph-paths.js.map +1 -1
  114. package/dist/projects/graph.d.ts +20 -6
  115. package/dist/projects/graph.d.ts.map +1 -1
  116. package/dist/projects/graph.js +40 -13
  117. package/dist/projects/graph.js.map +1 -1
  118. package/dist/projects/routes.d.ts.map +1 -1
  119. package/dist/projects/routes.js +30 -11
  120. package/dist/projects/routes.js.map +1 -1
  121. package/dist/projects/state-home.d.ts +6 -0
  122. package/dist/projects/state-home.d.ts.map +1 -1
  123. package/dist/projects/state-home.js +9 -1
  124. package/dist/projects/state-home.js.map +1 -1
  125. package/dist/skills/guards.d.ts +17 -6
  126. package/dist/skills/guards.d.ts.map +1 -1
  127. package/dist/skills/guards.js +42 -15
  128. package/dist/skills/guards.js.map +1 -1
  129. package/dist/skills/plugin-source.d.ts.map +1 -1
  130. package/dist/skills/plugin-source.js +3 -0
  131. package/dist/skills/plugin-source.js.map +1 -1
  132. package/dist/skills/refs.d.ts +181 -17
  133. package/dist/skills/refs.d.ts.map +1 -1
  134. package/dist/skills/refs.js +345 -26
  135. package/dist/skills/refs.js.map +1 -1
  136. package/dist/skills/store.d.ts +22 -1
  137. package/dist/skills/store.d.ts.map +1 -1
  138. package/dist/skills/store.js +161 -23
  139. package/dist/skills/store.js.map +1 -1
  140. package/dist/studio/assets/index-CWUS9Ump.js +542 -0
  141. package/dist/studio/assets/{index-CK1uJWs2.css → index-_ydd-jKd.css} +1 -1
  142. package/dist/studio/index.html +2 -2
  143. package/dist/studio/testid-inventory.json +567 -6
  144. package/endpoint-manifest.json +67 -14
  145. package/package.json +4 -4
  146. package/dist/studio/assets/index-CdmCMh2f.js +0 -539
@@ -1,22 +1,45 @@
1
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.
2
+ * Reference extraction over skill text (design v3 §4/§5) and the PORTABILITY VALIDATOR (F-079,
3
+ * wicked-crew#531): the shapes garden skills use to reach files outside their own directory, and
4
+ * the reasons a skill's text cannot be followed on a non-Claude CLI.
5
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.
6
+ * - `${CLAUDE_PLUGIN_ROOT}/<p>` — the plugin-root form: resolved against the SNAPSHOT root at
7
+ * publish, so a reference into a disabled skill or a file the bundle does not carry is a
8
+ * finding naming file:line. Only Claude Code substitutes the variable; every other CLI passes
9
+ * it through literally.
9
10
  * - `../<p>` — sibling links (`repo-learn/SKILL.md` → `../search/refs/hotspots.md`): resolved
10
11
  * 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).
12
+ * - `python3 scripts/…` / `node scripts/x/run.mjs` / `uv run scripts/x.py` — a plugin script
13
+ * invoked relative to the WORKTREE cwd (`domain-extractor/SKILL.md:44`): a portability marker.
15
14
  *
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.
15
+ * `portabilityIssuesOf` reports EVERY reason (not the first) with the 1-based line of each hit —
16
+ * the manifest's `portability {portable, reasons[], evidence[]}` and the per-reason `non-portable`
17
+ * findings are derived from it (design W4 §5.1). The tokens:
18
+ *
19
+ * plugin-root text contains `${CLAUDE_PLUGIN_ROOT}`
20
+ * skill-dir-var text contains `${CLAUDE_SKILL_DIR}` (a Claude-only substitution)
21
+ * cwd-script an interpreter followed by a relative path that EXISTS at the plugin
22
+ * root (`scripts/**`) — the worktree-cwd reading — and is not written
23
+ * through the `wicked-garden run|python|path` launcher. A relative path
24
+ * that exists only inside the skill's OWN directory is the base-directory
25
+ * idiom every CLI shares and is portable; one that exists nowhere in the
26
+ * bundle (`go test ./...`, `npx @axe-core/cli`, `python3 tests/x.py`) is
27
+ * not a plugin file. Matches inside fenced code blocks whose language is
28
+ * not a shell (`ts`, `js`, `python`, `yaml`, …) are ignored.
29
+ * relative-link a `../` token whose resolved target EXISTS in the bundle (an
30
+ * unresolvable `../requirements.md` inside a template is not a link the
31
+ * flat layout could break)
32
+ * cross-skill-path a plugin-root or resolved `../` target that lands in ANOTHER skill's
33
+ * directory — the installer lays skills out flat by name, so a
34
+ * filesystem relation between two skills never survives; the portable
35
+ * form names the other skill (`wicked-garden-<x>`)
36
+ * requires-harness:claude frontmatter `metadata.requires-harness: claude`, declared by the author
37
+ *
38
+ * The rule table (markers, regex sources, fence languages) is exported as `PORTABILITY_RULES` and
39
+ * vendored VERBATIM by wicked-garden's own lint (`tests/portability_rules.json` there,
40
+ * `packages/crew/tests/fixtures/portability_rules.json` here) — `tests/skills-refs.test.ts` fails
41
+ * when the two drift. Every regex is spelled so Python's `re` accepts it too: fixed-width
42
+ * lookbehinds only, no named groups.
20
43
  *
21
44
  * Path tokens keep every ORDINARY filename character (`+`, `@`, `~`, `%`, `=`, `,`, `:` …): a
22
45
  * reference truncated at the first unusual character would validate a PREFIX of the file it names
@@ -25,8 +48,11 @@
25
48
  * pattern, not a file the snapshot can carry; `PATH_CHARS` is the one stop set) — trailing sentence
26
49
  * punctuation is then trimmed.
27
50
  */
51
+ import type { SkillPortabilityReason } from '../core/types.js';
28
52
  /** The literal every plugin-root reference starts with. */
29
53
  export declare const PLUGIN_ROOT_MARKER = "${CLAUDE_PLUGIN_ROOT}";
54
+ /** The per-skill directory variable only Claude Code substitutes (W4 §5.1 `skill-dir-var`). */
55
+ export declare const SKILL_DIR_MARKER = "${CLAUDE_SKILL_DIR}";
30
56
  /** One reference found in a text: the 1-based `line` it sits on and the path it names. */
31
57
  export interface TextRef {
32
58
  line: number;
@@ -35,6 +61,101 @@ export interface TextRef {
35
61
  path: string;
36
62
  kind: 'plugin-root' | 'relative';
37
63
  }
64
+ /** Fence languages the cwd-script rule DOES scan — shells and prose; anything else (`ts`, `js`, `python`, `yaml`, …) is code the rule ignores. */
65
+ export declare const SCANNED_FENCE_LANGUAGES: readonly string[];
66
+ /**
67
+ * The NORMATIVE rule table both lints share (design W4 §5.3; review of #532 addendum): every regex
68
+ * SOURCE string, the markers, the interpreter list, the option-skipping rule, the interpreter
69
+ * path-prefix rule, the fence walk, the existence and `../` resolution semantics and the
70
+ * frontmatter key — spelled once here, vendored BYTE-FOR-BYTE by garden as
71
+ * `tests/portability_rules.json` (crew keeps the canonical copy at
72
+ * `packages/crew/tests/fixtures/portability_rules.json`, which adds `cases[]` and a
73
+ * `sha256_of_rules` over exactly this object). `tests/skills-refs.test.ts` asserts the committed
74
+ * fixture equals this object and re-derives every case — a drift between the two lints is a
75
+ * failing test, not a surprise at publish. Every regex is valid in BOTH ECMAScript and Python
76
+ * `re`: fixed-width lookbehinds only, no named groups, no `\h`.
77
+ */
78
+ export declare const PORTABILITY_RULES: {
79
+ readonly markers: {
80
+ readonly 'plugin-root': "${CLAUDE_PLUGIN_ROOT}";
81
+ readonly 'skill-dir-var': "${CLAUDE_SKILL_DIR}";
82
+ };
83
+ readonly path_chars: "[^\\s\"'`()\\[\\]{}<>|;&*?]";
84
+ readonly regex: {
85
+ readonly plugin_root_ref: string;
86
+ readonly relative_ref: string;
87
+ readonly cwd_script: string;
88
+ readonly launcher_call: string;
89
+ readonly fence_line: string;
90
+ };
91
+ /** The rules, one per token: what fires it and which regex source(s) it uses. */
92
+ readonly rules: readonly [{
93
+ readonly token: "plugin-root";
94
+ readonly description: "the text contains the marker `${CLAUDE_PLUGIN_ROOT}` (only Claude Code substitutes it); every occurrence is a hit — fences included; regex.plugin_root_ref extracts the path after it";
95
+ readonly regex: readonly [string];
96
+ }, {
97
+ readonly token: "skill-dir-var";
98
+ readonly description: "the text contains `${CLAUDE_SKILL_DIR}` (a Claude-only substitution); every occurrence is a hit — fences included";
99
+ readonly regex: readonly [];
100
+ }, {
101
+ readonly token: "cwd-script";
102
+ readonly description: "an interpreter (bare, or written as a path — see interpreters + interpreter_path_prefix), then options per the option rule, then a relative path token (regex.cwd_script group 1) that, normalized against the PLUGIN ROOT (the worktree cwd), names a file or directory the bundle carries. NOT a hit: a target that exists nowhere in the bundle; a target that exists only inside the skill's own directory (base-directory relative — portable); any span matched by regex.launcher_call (masked first); a line inside a fenced code block whose language is not in fences.shell_langs";
103
+ readonly regex: readonly [string, string];
104
+ }, {
105
+ readonly token: "relative-link";
106
+ readonly description: "a `../` token (regex.relative_ref) resolved from the referencing file's directory that lands INSIDE the plugin root on a path the bundle carries AND whose deepest owning skill directory is not the referencing skill's own (a link that stays inside the skill's tree survives every layout). An escaping or non-existent target is not a hit";
107
+ readonly regex: readonly [string];
108
+ }, {
109
+ readonly token: "cross-skill-path";
110
+ readonly description: "a plugin-root target (regex.plugin_root_ref, resolved against the plugin root) or a resolved `../` target (regex.relative_ref) that exists in the bundle and whose deepest owning skill directory is ANOTHER skill (a nested module's parent counts). Reported in addition to plugin-root / relative-link";
111
+ readonly regex: readonly [string, string];
112
+ }, {
113
+ readonly token: "requires-harness:claude";
114
+ readonly description: "the skill-root SKILL.md (file == skill_dir + \"/SKILL.md\") has YAML frontmatter with `metadata.requires-harness` whose value, trimmed and lowercased, is `claude`. Only the skill-root SKILL.md counts (a nested skill's own SKILL.md is its skill root)";
115
+ readonly regex: readonly [];
116
+ }];
117
+ readonly interpreters: readonly ["python", "python3", "uv run", "bash", "sh", "zsh", "node", "npx", "tsx", "deno run"];
118
+ readonly interpreter_path_prefix: {
119
+ readonly regex: "(?:\\/|\\.{1,2}\\/)?(?:[A-Za-z0-9_.+@%=,:~-]+\\/)*";
120
+ readonly rule: "the interpreter may be written as a path: an optional leading `/`, `./` or `../`, then any number of `segment/`; the whole token must not be glued to a preceding path character (regex.cwd_script starts with the fixed-width lookbehind)";
121
+ };
122
+ readonly options: {
123
+ readonly valued: readonly ["-W", "-X", "-m", "-c", "-Q", "-r", "-e", "-p", "-C", "-o", "--require", "--loader", "--experimental-loader", "--import", "--eval", "--print", "--env-file", "--conditions", "--input-type", "--python", "--with", "--directory", "--project", "--config", "--import-map"];
124
+ readonly rule: "between the interpreter and the path token any number of options is skipped: a bare flag (`-u`, `--frozen`, `--require=x`), or a VALUED option consumed together with its next token (`-W ignore`, `--loader ts-node/esm`); a valued option with no path after it is not an invocation, and its value is never read as the path";
125
+ };
126
+ readonly fences: {
127
+ readonly open: string;
128
+ readonly open_rule: "a fence opens only at a line start matching fences.open: >= 3 backticks or tildes; the language is the trimmed, lowercased first word of the info string (group 3)";
129
+ readonly inline_span_is_not_fence: true;
130
+ readonly inline_span_rule: "a backtick opener whose remainder contains another backtick (```` ```ts x = 1 ``` ````) is a one-line code span, not a fence — fences.open refuses it with a lookahead; tilde fences have no such restriction";
131
+ readonly close_rule: "the fence closes at the next line-start fence of the SAME character whose run is at least as long as the opener and is followed by nothing but whitespace; a shorter run, or a run followed by text, is content";
132
+ readonly shell_langs: readonly string[];
133
+ readonly skip_non_shell: true;
134
+ readonly boundary_lines_scanned: true;
135
+ readonly unclosed_runs_to_eof: true;
136
+ readonly applies_to: readonly ["cwd-script"];
137
+ };
138
+ readonly existence: {
139
+ readonly exists: "a normalized plugin-relative path exists when it is a file the bundle carries, or a directory some carried file sits under; the empty path (the bare root) exists";
140
+ readonly bundle_universe: "the files the next publish carries: support files inside the bundle closure OUTSIDE skills/ (`.claude-plugin/**`, `scripts/**` minus ci/ and wg/, `schemas/**`, `docs/examples/**`, `pyproject.toml`, `uv.lock`) plus ENABLED skills' own files; an owner-less file under skills/ (a `skills/README.md`) is never in it; the judged skill's own files are always visible to it";
141
+ readonly cwd_script_target: "the path token normalized as if the cwd were the plugin root (`./scripts/x.py` → `scripts/x.py`); one that climbs out (`../x`) is not a plugin file. It is a hit only when it exists AT THE PLUGIN ROOT; existing only inside the skill directory (`<skill_dir>/<token>`) is the base-directory idiom and portable; existing at both is ambiguous and a hit";
142
+ readonly skill_dirs: "every directory holding a SKILL.md under skills/; a path's owner is the DEEPEST such directory that prefixes it (or none)";
143
+ };
144
+ readonly relative_resolution: {
145
+ readonly plugin_root_ref: "the path after `${CLAUDE_PLUGIN_ROOT}/`, trailing sentence punctuation (`.`, `,`, `:`) trimmed, posix-normalized, trailing `/` dropped; `..` at the top escapes (never the root); the bare marker is the root";
146
+ readonly relative_ref: "the `../…` token, trailing sentence punctuation trimmed, joined onto the referencing file's directory and posix-normalized; a result that climbs out of the plugin root escapes (not a link the bundle can carry)";
147
+ };
148
+ readonly frontmatter: {
149
+ readonly requires_harness_key: "metadata.requires-harness";
150
+ readonly requires_harness_value: "claude";
151
+ };
152
+ readonly evidence: {
153
+ readonly reasons_sorted_unique: true;
154
+ readonly anchor_format: "<plugin-relative file>:<line>";
155
+ readonly cap: 5;
156
+ readonly portable: "reasons.length === 0";
157
+ };
158
+ };
38
159
  /**
39
160
  * Resolve a `${CLAUDE_PLUGIN_ROOT}/<p>` reference to a normalized plugin-relative path: a trailing
40
161
  * `/` (a directory reference) is dropped, `.` segments folded, and any path that climbs OUT of the
@@ -51,8 +172,51 @@ export declare function extractRelativeRefs(text: string): TextRef[];
51
172
  * plugin-relative path, or `null` when it climbs out of the plugin root.
52
173
  */
53
174
  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;
175
+ /** The reason tokens — the wire enum (`SkillPortabilityReason`, api-types 0.34.0) is the same set. */
176
+ export type PortabilityIssue = SkillPortabilityReason;
177
+ /** Every reason token, for validating persisted `portability.reasons` (a manifest or snapshot row). */
178
+ export declare const PORTABILITY_REASONS: ReadonlySet<string>;
179
+ /** The cap on `portability.evidence` anchors a row carries (design W4 §5.2). */
180
+ export declare const PORTABILITY_EVIDENCE_CAP = 5;
181
+ /**
182
+ * `file:line` anchors for a skill's hits — sorted by file then line, unique, capped — the
183
+ * `portability.evidence` of its manifest entry and snapshot row.
184
+ */
185
+ export declare function portabilityEvidenceOf(hits: ReadonlyArray<PortabilityHit & {
186
+ fileRel: string;
187
+ }>): string[];
188
+ /** One hit: the reason, the 1-based line, and the token as written (the finding's evidence). */
189
+ export interface PortabilityHit {
190
+ reason: PortabilityIssue;
191
+ line: number;
192
+ evidence: string;
193
+ }
194
+ /**
195
+ * What the validator needs to know about the file beyond its text: where it sits, which skill
196
+ * owns it, which directories are skills, and whether a plugin-relative path exists in the bundle.
197
+ * `exists` answers for FILES and for DIRECTORIES (a prefix of some file) alike.
198
+ */
199
+ export interface PortabilityContext {
200
+ /** Plugin-relative path of the text being judged (`skills/qe/SKILL.md`). */
201
+ fileRel: string;
202
+ /** The skill dir that owns `fileRel` (`skills/qe`). */
203
+ skillDir: string;
204
+ /** Every skill dir of the catalog (nested ones included) — classifies a target's owner. */
205
+ skillDirs: ReadonlySet<string>;
206
+ /** Whether the bundle carries this normalized plugin-relative path (file or directory). */
207
+ exists: (pluginRel: string) => boolean;
208
+ }
209
+ /** A context for text judged WITHOUT a bundle (unit tests, ad-hoc checks): nothing exists, one skill. */
210
+ export declare function bareContext(fileRel?: string, existing?: Iterable<string>): PortabilityContext;
211
+ /** `exists` over a plain set of file paths: the path itself, or a directory some file sits under. */
212
+ export declare function existsIn(files: ReadonlySet<string>, pluginRel: string): boolean;
213
+ /**
214
+ * EVERY reason `text` (the file at `ctx.fileRel`) is not portable to a non-Claude CLI, in file
215
+ * order — empty when it is portable. One hit per token occurrence; the caller folds them into the
216
+ * sorted-unique `reasons` and the `file:line` evidence.
217
+ */
218
+ export declare function portabilityIssuesOf(text: string, ctx: PortabilityContext): PortabilityHit[];
219
+ /** The sorted, unique reason set of a list of hits (the manifest's `portability.reasons`). */
220
+ export declare function portabilityReasonsOf(hits: ReadonlyArray<PortabilityHit>): PortabilityIssue[];
57
221
  export declare function looksBinary(buf: Buffer): boolean;
58
222
  //# sourceMappingURL=refs.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"refs.d.ts","sourceRoot":"","sources":["../../src/skills/refs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAI/D,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