vigiles 39.1.0 → 40.0.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.
Files changed (61) hide show
  1. package/dist/adapter.d.ts +3 -2
  2. package/dist/adapters/claude-code/dialect.js +9 -0
  3. package/dist/adapters/claude-code/output-style.js +15 -0
  4. package/dist/adapters/claude-code/skill-listing.d.ts +48 -0
  5. package/dist/adapters/claude-code/skill-listing.js +54 -0
  6. package/dist/adapters/codex/dialect.js +4 -0
  7. package/dist/adapters/codex/layout.js +5 -0
  8. package/dist/adapters/codex/mock-model.d.ts +7 -0
  9. package/dist/adapters/codex/mock-model.js +1 -0
  10. package/dist/adapters/codex/skill-listing.d.ts +42 -0
  11. package/dist/adapters/codex/skill-listing.js +40 -0
  12. package/dist/audit-html.js +7 -2
  13. package/dist/audit-report.d.ts +51 -0
  14. package/dist/audit-report.js +54 -8
  15. package/dist/audit-report.template.html +38 -33
  16. package/dist/cli-flag-check.d.ts +1 -1
  17. package/dist/cli-flag-check.js +1 -1
  18. package/dist/cli-main.d.ts +9 -3
  19. package/dist/cli-main.js +33 -18
  20. package/dist/{instruction-weight-ratchet.d.ts → context-creep-ratchet.d.ts} +34 -12
  21. package/dist/context-creep-ratchet.js +270 -0
  22. package/dist/core/adopt.js +32 -8
  23. package/dist/core/always-loaded.d.ts +128 -0
  24. package/dist/core/always-loaded.js +134 -0
  25. package/dist/core/compile.d.ts +1 -1
  26. package/dist/core/compile.js +48 -15
  27. package/dist/core/dialect.d.ts +10 -1
  28. package/dist/core/dialect.js +2 -0
  29. package/dist/core/harness-unit.d.ts +20 -0
  30. package/dist/core/harness-unit.js +24 -0
  31. package/dist/core/instruction-baseline.d.ts +179 -11
  32. package/dist/core/instruction-baseline.js +349 -47
  33. package/dist/core/instruction-weight.d.ts +2 -11
  34. package/dist/core/instruction-weight.js +6 -16
  35. package/dist/core/layout.d.ts +40 -0
  36. package/dist/core/layout.js +25 -1
  37. package/dist/core/output-style.d.ts +20 -0
  38. package/dist/core/skill-listing.d.ts +49 -0
  39. package/dist/core/skill-listing.js +23 -0
  40. package/dist/core/spec.d.ts +17 -0
  41. package/dist/core/types.d.ts +2 -2
  42. package/dist/deprecated-key-files.d.ts +1 -1
  43. package/dist/deprecated-key-files.js +1 -1
  44. package/dist/doc-commands.d.ts +2 -2
  45. package/dist/fs-walk.d.ts +31 -0
  46. package/dist/fs-walk.js +49 -0
  47. package/dist/local-files.js +2 -1
  48. package/dist/plugin-loader.js +40 -19
  49. package/dist/rules/index.d.ts +4 -4
  50. package/dist/rules/index.js +7 -7
  51. package/dist/scan-files.js +24 -3
  52. package/dist/scan.d.ts +30 -1
  53. package/dist/scan.js +69 -3
  54. package/dist/skill-harness.d.ts +3 -1
  55. package/dist/skill-harness.js +5 -2
  56. package/dist/surface-discovery-fs.d.ts +15 -0
  57. package/dist/surface-discovery-fs.js +55 -0
  58. package/dist/vigilesrc.schema.json +2 -2
  59. package/hooks/session-start.sh +3 -1
  60. package/package.json +1 -1
  61. package/dist/instruction-weight-ratchet.js +0 -181
@@ -0,0 +1,128 @@
1
+ /**
2
+ * The ALWAYS-LOADED CONTEXT: everything the harness loads at session start without a
3
+ * decision — the always-loaded instructions, the output style the committed
4
+ * settings select, and the skill listing — summed in the harness's own unit.
5
+ *
6
+ * WHY THE SUM, AND NOT THE INSTRUCTIONS ALONE. `./instruction-weight.ts`
7
+ * explains why a per-FILE weight invites the evasion it is meant to catch: text
8
+ * moved into an always-loaded sibling is still loaded. The output style and the
9
+ * skill listing are always-loaded siblings of the same kind. A section cut
10
+ * from `CLAUDE.md` into the selected style, or into a skill's description,
11
+ * still reaches the model on every request; a weight that counts only the
12
+ * instruction file reads that move as a shrink. The parts are reported one by
13
+ * one so a reader can see WHERE the weight is, and summed so a move between
14
+ * them nets out.
15
+ *
16
+ * WHAT IT IS NOT. It is the part of every request THE REPOSITORY decides, not
17
+ * the size of a request: the harness's own system prompt and tool definitions,
18
+ * user- and plugin-level skills, and the conversation history are added in a
19
+ * real session and are not repository facts. Units are the harness's own
20
+ * (characters for Claude Code, bytes for Codex) and never tokens, for the
21
+ * reason `InstructionBudget.unit` gives.
22
+ *
23
+ * WHAT IS COUNTED, PER PART.
24
+ *
25
+ * - output style: only a style the COMMITTED settings select and the
26
+ * repository holds as a file in the session's own style folder. A style
27
+ * selected in a per-machine settings file is not a property of the commit;
28
+ * a name no repository file declares (a built-in style, or a typo the
29
+ * harness silently resolves to its default) has no size vigiles can read,
30
+ * and is reported by name rather than counted as zero.
31
+ * - skill listing: every skill in the folder a session at the repository
32
+ * root loads (`skillsHome`), at the depths the harness reads there
33
+ * (`SkillDiscovery`: one folder per skill on Claude Code, a recursive walk
34
+ * on Codex), rendered by the harness's own entry format with its
35
+ * per-entry cap. A plugin's `skills/` folder is what the plugin's
36
+ * USERS load, not a session here.
37
+ *
38
+ * Pure: the caller hands in a file map (repo-relative path → text) holding the
39
+ * committed settings, the style files and the SKILL.md files. The CLI reads
40
+ * them from disk; the browser engine passes the tree it fetched.
41
+ */
42
+ import type { HarnessDialect } from "./dialect.js";
43
+ import { type HarnessUnit } from "./harness-unit.js";
44
+ import { type PluginLayout } from "./layout.js";
45
+ import type { ListedSkill } from "./skill-listing.js";
46
+ /** The parts that join the instructions in the always-loaded context. */
47
+ export type LoadedPartName = "output-style" | "skill-listing";
48
+ /** One file's share of a part, in the harness's unit. */
49
+ export interface LoadedPartFile {
50
+ readonly path: string;
51
+ readonly size: number;
52
+ }
53
+ /**
54
+ * One part of the always-loaded context. Each absence is its own fact, because each
55
+ * calls for a different reading:
56
+ *
57
+ * - `counted` — the part loads, and this is its size;
58
+ * - `none` — the harness has this part and the repository loads nothing of
59
+ * it (no style selected, no listed skill);
60
+ * - `not-supported` — the harness has no such thing (Codex has no output
61
+ * styles);
62
+ * - `not-modelled` — the adapter does not say how the harness does it, so
63
+ * vigiles cannot measure it; NOT the same as zero;
64
+ * - `unresolved` — a style is selected by a name no repository file
65
+ * declares: a built-in style, or a typo that loads the default.
66
+ */
67
+ export type LoadedPart = {
68
+ readonly kind: "counted";
69
+ readonly total: number;
70
+ readonly files: readonly LoadedPartFile[];
71
+ } | {
72
+ readonly kind: "none";
73
+ } | {
74
+ readonly kind: "not-supported";
75
+ } | {
76
+ readonly kind: "not-modelled";
77
+ } | {
78
+ readonly kind: "unresolved";
79
+ readonly name: string;
80
+ };
81
+ export interface AlwaysLoadedContext {
82
+ readonly unit: HarnessUnit;
83
+ /** The instructions' committed total — the same number the weight scores. */
84
+ readonly instructions: number;
85
+ readonly outputStyle: LoadedPart;
86
+ readonly skillListing: LoadedPart;
87
+ /** Instructions plus every `counted` part. */
88
+ readonly total: number;
89
+ }
90
+ type AlwaysLoadedLayout = Pick<PluginLayout, "outputStyles" | "userSurfaceRoot" | "surfaces" | "skillDiscovery" | "settings" | "settingsPath">;
91
+ /** The instructions' weight, as `weighInstructions` measured it. */
92
+ export interface WeighedInstructions {
93
+ readonly unit: HarnessUnit;
94
+ /** The SCORED total — what a teammate on the same commit also loads. */
95
+ readonly committedTotal: number;
96
+ }
97
+ export interface AlwaysLoadedInput {
98
+ readonly weight: WeighedInstructions;
99
+ readonly files: Readonly<Record<string, string>>;
100
+ readonly layout: AlwaysLoadedLayout;
101
+ readonly dialect: Pick<HarnessDialect, "skillListing">;
102
+ }
103
+ /** What one part is measured from: the input, in the weight's unit. */
104
+ export interface LoadedPartInput {
105
+ readonly files: Readonly<Record<string, string>>;
106
+ readonly layout: AlwaysLoadedLayout;
107
+ readonly dialect: Pick<HarnessDialect, "skillListing">;
108
+ readonly unit: HarnessUnit;
109
+ }
110
+ /** The selected output style's part. */
111
+ export declare function outputStylePart(input: LoadedPartInput, settings: Readonly<Record<string, unknown>>): LoadedPart;
112
+ /**
113
+ * Every SKILL.md the session's skills folder holds at a depth the harness
114
+ * reads ({@link skillDiscoveryOf}), read once.
115
+ */
116
+ export declare function sessionSkills(layout: AlwaysLoadedLayout, files: Readonly<Record<string, string>>): readonly ListedSkill[];
117
+ /** The skill listing's part: each listed skill's entry, sized. */
118
+ export declare function skillListingPart(input: LoadedPartInput, settings: Readonly<Record<string, unknown>>): LoadedPart;
119
+ /** The size a part adds to the sum: its total when counted, else nothing. */
120
+ export declare const partTotal: (part: LoadedPart) => number;
121
+ /**
122
+ * Weigh the always-loaded context: the instructions' committed total (already
123
+ * measured by the instruction weight) plus the selected output style and the
124
+ * skill listing, each in the same unit by the same `sizeIn`.
125
+ */
126
+ export declare function weighAlwaysLoaded(input: AlwaysLoadedInput): AlwaysLoadedContext;
127
+ export {};
128
+ //# sourceMappingURL=always-loaded.d.ts.map
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.partTotal = void 0;
4
+ exports.outputStylePart = outputStylePart;
5
+ exports.sessionSkills = sessionSkills;
6
+ exports.skillListingPart = skillListingPart;
7
+ exports.weighAlwaysLoaded = weighAlwaysLoaded;
8
+ const frontmatter_read_js_1 = require("./frontmatter-read.js");
9
+ const harness_unit_js_1 = require("./harness-unit.js");
10
+ const layout_js_1 = require("./layout.js");
11
+ const output_style_js_1 = require("./output-style.js");
12
+ /** The committed settings object; `{}` when absent or not parseable. */
13
+ function committedSettings(layout, files) {
14
+ const text = files[layout.settingsPath];
15
+ if (text === undefined)
16
+ return {};
17
+ try {
18
+ return layout.settings.parse(text);
19
+ }
20
+ catch {
21
+ return {};
22
+ }
23
+ }
24
+ const counted = (files) => files.length === 0
25
+ ? { kind: "none" }
26
+ : {
27
+ kind: "counted",
28
+ total: files.reduce((sum, f) => sum + f.size, 0),
29
+ files,
30
+ };
31
+ /** The style files in the folder a session at the repository root reads. */
32
+ function sessionStyles(layout, files) {
33
+ const rules = layout.outputStyles;
34
+ const home = (0, output_style_js_1.outputStyleHomes)(layout).at(-1);
35
+ if (rules === undefined || home === undefined)
36
+ return [];
37
+ // Direct children only — the folder the disk reader lists, one level.
38
+ const nameIn = (path) => {
39
+ const rest = path.startsWith(`${home}/`) ? path.slice(home.length + 1) : "";
40
+ return rest === "" || rest.includes("/") ? null : rest;
41
+ };
42
+ return Object.entries(files)
43
+ .filter(([path]) => {
44
+ const name = nameIn(path);
45
+ return name !== null && rules.isStyleFile(name);
46
+ })
47
+ .map(([path, text]) => rules.read(path, text));
48
+ }
49
+ /** The selected output style's part. */
50
+ function outputStylePart(input, settings) {
51
+ const rules = input.layout.outputStyles;
52
+ if (rules === undefined)
53
+ return { kind: "not-supported" };
54
+ if (rules.selected === undefined)
55
+ return { kind: "not-modelled" };
56
+ const selection = rules.selected(settings);
57
+ if (selection.kind !== "named")
58
+ return { kind: "none" };
59
+ const style = sessionStyles(input.layout, input.files).find((s) => s.name === selection.name);
60
+ return style === undefined
61
+ ? { kind: "unresolved", name: selection.name }
62
+ : counted([{ path: style.path, size: (0, harness_unit_js_1.sizeIn)(style.body, input.unit) }]);
63
+ }
64
+ /**
65
+ * Every SKILL.md the session's skills folder holds at a depth the harness
66
+ * reads ({@link skillDiscoveryOf}), read once.
67
+ */
68
+ function sessionSkills(layout, files) {
69
+ const home = (0, layout_js_1.skillsHome)(layout);
70
+ if (home === null)
71
+ return [];
72
+ const discovery = (0, layout_js_1.skillDiscoveryOf)(layout);
73
+ // A SKILL.md directly in the folder takes the folder's own name.
74
+ const homeName = home.split("/").at(-1) ?? home;
75
+ const found = Object.entries(files).flatMap(([path, text]) => {
76
+ if (!path.startsWith(`${home}/`))
77
+ return [];
78
+ const dirs = (0, layout_js_1.sessionSkillDirs)(path.slice(home.length + 1), discovery);
79
+ return dirs === null
80
+ ? []
81
+ : [{ path, dirName: dirs.at(-1) ?? homeName, text }];
82
+ });
83
+ return [...found]
84
+ .sort((a, b) => a.path.localeCompare(b.path))
85
+ .map(({ path, dirName, text }) => {
86
+ const fm = (0, frontmatter_read_js_1.readFrontmatter)(text);
87
+ return {
88
+ path,
89
+ dirName,
90
+ frontmatter: fm.malformed ? null : (fm.data ?? {}),
91
+ body: (0, frontmatter_read_js_1.frontmatterBody)(text),
92
+ };
93
+ });
94
+ }
95
+ /** The skill listing's part: each listed skill's entry, sized. */
96
+ function skillListingPart(input, settings) {
97
+ const rules = input.dialect.skillListing;
98
+ if (rules === undefined)
99
+ return { kind: "not-modelled" };
100
+ return counted(sessionSkills(input.layout, input.files).flatMap((skill) => {
101
+ const line = rules.entry(skill, settings);
102
+ return line === null
103
+ ? []
104
+ : [{ path: skill.path, size: (0, harness_unit_js_1.sizeIn)(line, input.unit) }];
105
+ }));
106
+ }
107
+ /** The size a part adds to the sum: its total when counted, else nothing. */
108
+ const partTotal = (part) => part.kind === "counted" ? part.total : 0;
109
+ exports.partTotal = partTotal;
110
+ /**
111
+ * Weigh the always-loaded context: the instructions' committed total (already
112
+ * measured by the instruction weight) plus the selected output style and the
113
+ * skill listing, each in the same unit by the same `sizeIn`.
114
+ */
115
+ function weighAlwaysLoaded(input) {
116
+ const part = {
117
+ files: input.files,
118
+ layout: input.layout,
119
+ dialect: input.dialect,
120
+ unit: input.weight.unit,
121
+ };
122
+ const settings = committedSettings(input.layout, input.files);
123
+ const outputStyle = outputStylePart(part, settings);
124
+ const skillListing = skillListingPart(part, settings);
125
+ const instructions = input.weight.committedTotal;
126
+ return {
127
+ unit: part.unit,
128
+ instructions,
129
+ outputStyle,
130
+ skillListing,
131
+ total: instructions + (0, exports.partTotal)(outputStyle) + (0, exports.partTotal)(skillListing),
132
+ };
133
+ }
134
+ //# sourceMappingURL=always-loaded.js.map
@@ -56,7 +56,7 @@ export declare function verifyHash(content: string): {
56
56
  */
57
57
  /** @internal */ export declare function estimateTokens(text: string): number;
58
58
  export interface CompileError {
59
- type: "stale-file" | "stale-command" | "stale-ref" | "invalid-rule" | "budget-exceeded" | "section-too-long" | "section-has-header" | "reserved-section-key" | "spec-name-mismatch" | "unknown-tool" | "invalid-railway" | "purity-violation" | "output-without-fork" | "effect-in-skill" | "inline-code-too-long" | "entry-too-long" | "section-too-large" | "rules-too-large";
59
+ type: "stale-file" | "stale-command" | "stale-ref" | "invalid-rule" | "budget-exceeded" | "section-too-long" | "section-has-header" | "reserved-section-key" | "spec-name-mismatch" | "unknown-tool" | "invalid-railway" | "purity-violation" | "output-without-fork" | "agent-without-fork" | "effect-in-skill" | "inline-code-too-long" | "entry-too-long" | "section-too-large" | "rules-too-large";
60
60
  message: string;
61
61
  path?: string;
62
62
  }
@@ -482,7 +482,7 @@ exports.DEFAULT_MAX_RULES_CHARS = 20000;
482
482
  *
483
483
  * 🔴 WHAT THIS RULE DOES NOT MEASURE, ON PURPOSE — each has one owner already:
484
484
  * - the whole always-loaded size, in the harness's unit (Claude Code chars,
485
- * Codex bytes) — `instruction-weight` and its `max`, which sums the whole
485
+ * Codex bytes) — `context-creep` and its `max`, which sums the whole
486
486
  * chain, so moving text into a rules file does not fool it;
487
487
  * - `keyFiles` — deprecated (`deprecated-key-files`); budgeting a section the
488
488
  * reader is told to delete would be a second, contradicting instruction.
@@ -1062,6 +1062,19 @@ function yamlScalar(value) {
1062
1062
  * exactly what a key set says. A harness that reads four of the seven now gets
1063
1063
  * four, instead of falling into whichever of two buckets someone picked for it.
1064
1064
  */
1065
+ /**
1066
+ * The frontmatter lines that say WHERE a skill runs, in render order: `context`,
1067
+ * then the subagent type and the model a fork starts (`agent`, `model`, #401).
1068
+ * Only keys the dialect reads (`emits`) and the spec sets.
1069
+ */
1070
+ function executionFrontmatter(spec, emits) {
1071
+ const set = [
1072
+ ["context", spec.context],
1073
+ ["agent", spec.agent === undefined ? undefined : yamlScalar(spec.agent)],
1074
+ ["model", spec.model === undefined ? undefined : yamlScalar(spec.model)],
1075
+ ];
1076
+ return set.flatMap(([key, value]) => emits(key) && value !== undefined ? [`${key}: ${value}`] : []);
1077
+ }
1065
1078
  function renderSkillFrontmatter(spec, keys = dialect_js_1.RENDERABLE_SKILL_FRONTMATTER_KEYS) {
1066
1079
  const emits = (key) => keys.includes(key);
1067
1080
  const fm = ["---"];
@@ -1074,9 +1087,7 @@ function renderSkillFrontmatter(spec, keys = dialect_js_1.RENDERABLE_SKILL_FRONT
1074
1087
  spec.disableModelInvocation !== undefined) {
1075
1088
  fm.push(`disable-model-invocation: ${String(spec.disableModelInvocation)}`);
1076
1089
  }
1077
- if (emits("context") && spec.context !== undefined) {
1078
- fm.push(`context: ${spec.context}`);
1079
- }
1090
+ fm.push(...executionFrontmatter(spec, emits));
1080
1091
  const argHint = spec.inputs && spec.inputs.length > 0
1081
1092
  ? renderArgumentHint(spec.inputs)
1082
1093
  : spec.argumentHint;
@@ -1164,6 +1175,38 @@ function checkInlineCode(markdown, max) {
1164
1175
  }
1165
1176
  return warns;
1166
1177
  }
1178
+ /**
1179
+ * Fields that mean something only for a FORKED skill, reported when the skill is
1180
+ * inline. `output`: an inline skill has no call→return boundary, so a typed
1181
+ * outcome there is a category error (see research/spec-syntax-and-railway-scope.md).
1182
+ * `agent`: the subagent type a fork starts — inline, no subagent starts (#401).
1183
+ * `model` is NOT here: inline it sets the turn's model, which is a real meaning.
1184
+ */
1185
+ function forkOnlyErrors(spec) {
1186
+ if (spec.context === "fork")
1187
+ return [];
1188
+ const output = spec.output
1189
+ ? [
1190
+ {
1191
+ type: "output-without-fork",
1192
+ message: 'A skill `output` (result() contract) requires `context: "fork"` — an ' +
1193
+ "inline skill has no return value to type. Add context:'fork' to run it " +
1194
+ "as a subagent, or drop `output`.",
1195
+ },
1196
+ ]
1197
+ : [];
1198
+ const agent = spec.agent === undefined
1199
+ ? []
1200
+ : [
1201
+ {
1202
+ type: "agent-without-fork",
1203
+ message: `A skill \`agent\` ("${spec.agent}") requires \`context: "fork"\` — it ` +
1204
+ "names the subagent a forked skill starts, and an inline skill starts " +
1205
+ "none. Add context:'fork', or drop `agent`.",
1206
+ },
1207
+ ];
1208
+ return [...output, ...agent];
1209
+ }
1167
1210
  /**
1168
1211
  * Compile a SkillSpec into SKILL.md markdown with YAML frontmatter.
1169
1212
  */
@@ -1197,17 +1240,7 @@ async function compileSkill(spec, options) {
1197
1240
  }
1198
1241
  }
1199
1242
  errors.push(...(await validateRefs(collectSkillRefs(spec), basePath)));
1200
- // A typed `output` Result contract is valid ONLY for a forked skill: an inline
1201
- // skill has no call→return boundary, so a typed outcome there is a category
1202
- // error (see research/spec-syntax-and-railway-scope.md). Enforce it at compile.
1203
- if (spec.output && spec.context !== "fork") {
1204
- errors.push({
1205
- type: "output-without-fork",
1206
- message: 'A skill `output` (result() contract) requires `context: "fork"` — an ' +
1207
- "inline skill has no return value to type. Add context:'fork' to run it " +
1208
- "as a subagent, or drop `output`.",
1209
- });
1210
- }
1243
+ errors.push(...forkOnlyErrors(spec));
1211
1244
  // effect() is a SUBAGENT primitive. A deterministic effect REGION needs a
1212
1245
  // structural call→return bracket to scope it; a default skill is spliced into
1213
1246
  // the main conversation and has none (the dogfood that proved the model-emitted
@@ -21,6 +21,7 @@
21
21
  import type { HarnessVocabulary } from "./vocabulary.js";
22
22
  import type { EventCapabilityTable } from "./event-capability.js";
23
23
  import type { InstructionBudget } from "./instruction-weight.js";
24
+ import type { SkillListingRules } from "./skill-listing.js";
24
25
  /**
25
26
  * Every SKILL.md frontmatter key the COMPILER knows how to render, in the order
26
27
  * it renders them. A property of `renderSkillFrontmatter`, not of any harness:
@@ -35,7 +36,7 @@ import type { InstructionBudget } from "./instruction-weight.js";
35
36
  * membership test over key names, which are facts about a FILE FORMAT and carry
36
37
  * no harness in them.
37
38
  */
38
- export declare const RENDERABLE_SKILL_FRONTMATTER_KEYS: readonly ["name", "description", "disable-model-invocation", "context", "argument-hint", "allowed-tools", "disallowed-tools"];
39
+ export declare const RENDERABLE_SKILL_FRONTMATTER_KEYS: readonly ["name", "description", "disable-model-invocation", "context", "agent", "model", "argument-hint", "allowed-tools", "disallowed-tools"];
39
40
  /**
40
41
  * The instruction filenames vigiles recognizes when NO dialect is injected, in
41
42
  * precedence order — `[0]` is what a spec compiles into when it names no target.
@@ -167,6 +168,14 @@ export interface HarnessDialect {
167
168
  * answer for a harness whose limits nobody has read.
168
169
  */
169
170
  readonly instructionBudget?: InstructionBudget;
171
+ /**
172
+ * How this harness renders a skill into the listing it loads at session
173
+ * start — {@link SkillListingRules}. Beside `instructionBudget` for the same
174
+ * two reasons: it is a FORMAT fact, and the browser engine is handed a
175
+ * dialect. Optional: absent ⇒ the always-loaded report says the listing is
176
+ * not modelled for this harness, never that it is empty.
177
+ */
178
+ readonly skillListing?: SkillListingRules;
170
179
  /**
171
180
  * What each hook event CARRIES and HONOURS — {@link EventCapabilityTable}.
172
181
  *
@@ -20,6 +20,8 @@ exports.RENDERABLE_SKILL_FRONTMATTER_KEYS = [
20
20
  "description",
21
21
  "disable-model-invocation",
22
22
  "context",
23
+ "agent",
24
+ "model",
23
25
  "argument-hint",
24
26
  "allowed-tools",
25
27
  "disallowed-tools",
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Text sized in a harness's OWN unit — characters for Claude Code, bytes for
3
+ * Codex, never tokens (`InstructionBudget.unit` says why). One function, so
4
+ * every part of an always-loaded sum is sized the same way and the sum is one
5
+ * number in one unit, reproducible from a commit.
6
+ */
7
+ /** The units harnesses count always-loaded text in. */
8
+ export type HarnessUnit = "chars" | "bytes";
9
+ /**
10
+ * Size in the harness's own unit. Bytes and chars differ on any non-ASCII text.
11
+ *
12
+ * Line endings are counted as `\n`. A checkout with `core.autocrlf` holds the
13
+ * same commit with one more character per line, and a number that differs
14
+ * between two clones of one commit cannot be committed and compared — a
15
+ * 1 000-line file read +1 000 on Windows with no content change. The harness
16
+ * may count the CR itself; reproducibility is worth more here than that
17
+ * fidelity.
18
+ */
19
+ export declare function sizeIn(text: string, unit: HarnessUnit): number;
20
+ //# sourceMappingURL=harness-unit.d.ts.map
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * Text sized in a harness's OWN unit — characters for Claude Code, bytes for
4
+ * Codex, never tokens (`InstructionBudget.unit` says why). One function, so
5
+ * every part of an always-loaded sum is sized the same way and the sum is one
6
+ * number in one unit, reproducible from a commit.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.sizeIn = sizeIn;
10
+ /**
11
+ * Size in the harness's own unit. Bytes and chars differ on any non-ASCII text.
12
+ *
13
+ * Line endings are counted as `\n`. A checkout with `core.autocrlf` holds the
14
+ * same commit with one more character per line, and a number that differs
15
+ * between two clones of one commit cannot be committed and compared — a
16
+ * 1 000-line file read +1 000 on Windows with no content change. The harness
17
+ * may count the CR itself; reproducibility is worth more here than that
18
+ * fidelity.
19
+ */
20
+ function sizeIn(text, unit) {
21
+ const lf = text.replaceAll("\r\n", "\n");
22
+ return unit === "chars" ? lf.length : Buffer.byteLength(lf, "utf8");
23
+ }
24
+ //# sourceMappingURL=harness-unit.js.map