@dungle-scrubs/harness-cli-normalizer 0.3.1 → 0.4.1

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 (112) hide show
  1. package/README.md +64 -86
  2. package/dist/cli/args.d.ts +12 -0
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +44 -5
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/config.d.ts +25 -0
  7. package/dist/cli/config.d.ts.map +1 -0
  8. package/dist/cli/config.js +147 -0
  9. package/dist/cli/config.js.map +1 -0
  10. package/dist/cli/help.d.ts +1 -1
  11. package/dist/cli/help.d.ts.map +1 -1
  12. package/dist/cli/help.js +17 -1
  13. package/dist/cli/help.js.map +1 -1
  14. package/dist/cli/inspect.d.ts.map +1 -1
  15. package/dist/cli/inspect.js +35 -1
  16. package/dist/cli/inspect.js.map +1 -1
  17. package/dist/cli/render.d.ts.map +1 -1
  18. package/dist/cli/render.js +10 -1
  19. package/dist/cli/render.js.map +1 -1
  20. package/dist/cli/run.d.ts.map +1 -1
  21. package/dist/cli/run.js +175 -5
  22. package/dist/cli/run.js.map +1 -1
  23. package/dist/cli/skills-root.d.ts +4 -0
  24. package/dist/cli/skills-root.d.ts.map +1 -0
  25. package/dist/cli/skills-root.js +45 -0
  26. package/dist/cli/skills-root.js.map +1 -0
  27. package/dist/execution/failure.d.ts +24 -4
  28. package/dist/execution/failure.d.ts.map +1 -1
  29. package/dist/execution/failure.js +39 -3
  30. package/dist/execution/failure.js.map +1 -1
  31. package/dist/execution/stream-turn.d.ts +4 -0
  32. package/dist/execution/stream-turn.d.ts.map +1 -1
  33. package/dist/execution/stream-turn.js +43 -6
  34. package/dist/execution/stream-turn.js.map +1 -1
  35. package/dist/interpretation/argv.d.ts +6 -0
  36. package/dist/interpretation/argv.d.ts.map +1 -1
  37. package/dist/interpretation/argv.js +17 -19
  38. package/dist/interpretation/argv.js.map +1 -1
  39. package/dist/interpretation/hints.d.ts +22 -0
  40. package/dist/interpretation/hints.d.ts.map +1 -0
  41. package/dist/interpretation/hints.js +59 -0
  42. package/dist/interpretation/hints.js.map +1 -0
  43. package/dist/interpretation/refusal.d.ts +25 -4
  44. package/dist/interpretation/refusal.d.ts.map +1 -1
  45. package/dist/interpretation/refusal.js +16 -0
  46. package/dist/interpretation/refusal.js.map +1 -1
  47. package/dist/interpretation/resolve-options.d.ts +42 -0
  48. package/dist/interpretation/resolve-options.d.ts.map +1 -0
  49. package/dist/interpretation/resolve-options.js +162 -0
  50. package/dist/interpretation/resolve-options.js.map +1 -0
  51. package/dist/interpretation/skills-selection.d.ts +22 -0
  52. package/dist/interpretation/skills-selection.d.ts.map +1 -0
  53. package/dist/interpretation/skills-selection.js +49 -0
  54. package/dist/interpretation/skills-selection.js.map +1 -0
  55. package/dist/interpretation/support.d.ts +32 -0
  56. package/dist/interpretation/support.d.ts.map +1 -0
  57. package/dist/interpretation/support.js +107 -0
  58. package/dist/interpretation/support.js.map +1 -0
  59. package/dist/interpretation/tool-selection.d.ts +29 -0
  60. package/dist/interpretation/tool-selection.d.ts.map +1 -0
  61. package/dist/interpretation/tool-selection.js +122 -0
  62. package/dist/interpretation/tool-selection.js.map +1 -0
  63. package/dist/interpretation/turn-options.d.ts.map +1 -1
  64. package/dist/interpretation/turn-options.js +4 -0
  65. package/dist/interpretation/turn-options.js.map +1 -1
  66. package/dist/knowledge/claude-code.d.ts.map +1 -1
  67. package/dist/knowledge/claude-code.js +35 -1
  68. package/dist/knowledge/claude-code.js.map +1 -1
  69. package/dist/knowledge/codex.d.ts.map +1 -1
  70. package/dist/knowledge/codex.js +20 -0
  71. package/dist/knowledge/codex.js.map +1 -1
  72. package/dist/knowledge/descriptor.d.ts +39 -0
  73. package/dist/knowledge/descriptor.d.ts.map +1 -1
  74. package/dist/knowledge/muse.d.ts.map +1 -1
  75. package/dist/knowledge/muse.js +20 -0
  76. package/dist/knowledge/muse.js.map +1 -1
  77. package/dist/knowledge/pi.d.ts.map +1 -1
  78. package/dist/knowledge/pi.js +22 -0
  79. package/dist/knowledge/pi.js.map +1 -1
  80. package/dist/knowledge/profile.d.ts +16 -0
  81. package/dist/knowledge/profile.d.ts.map +1 -0
  82. package/dist/knowledge/profile.js +51 -0
  83. package/dist/knowledge/profile.js.map +1 -0
  84. package/package.json +2 -23
  85. package/src/cli/args.ts +64 -3
  86. package/src/cli/config.ts +176 -0
  87. package/src/cli/help.ts +17 -1
  88. package/src/cli/inspect.ts +34 -1
  89. package/src/cli/render.ts +10 -1
  90. package/src/cli/run.ts +203 -6
  91. package/src/cli/skills-root.ts +47 -0
  92. package/src/execution/failure.ts +58 -5
  93. package/src/execution/stream-turn.ts +50 -5
  94. package/src/interpretation/argv.ts +23 -19
  95. package/src/interpretation/hints.ts +99 -0
  96. package/src/interpretation/refusal.ts +33 -3
  97. package/src/interpretation/resolve-options.ts +214 -0
  98. package/src/interpretation/skills-selection.ts +73 -0
  99. package/src/interpretation/support.ts +119 -0
  100. package/src/interpretation/tool-selection.ts +161 -0
  101. package/src/interpretation/turn-options.ts +4 -0
  102. package/src/knowledge/claude-code.ts +35 -1
  103. package/src/knowledge/codex.ts +20 -0
  104. package/src/knowledge/descriptor.ts +39 -0
  105. package/src/knowledge/muse.ts +20 -0
  106. package/src/knowledge/pi.ts +22 -0
  107. package/src/knowledge/profile.ts +53 -0
  108. package/dist/index.d.ts +0 -8
  109. package/dist/index.d.ts.map +0 -1
  110. package/dist/index.js +0 -8
  111. package/dist/index.js.map +0 -1
  112. package/src/index.ts +0 -7
@@ -14,6 +14,8 @@ export const REFUSAL_ISSUES = deepFreeze([
14
14
  "unknown-model",
15
15
  "invalid-env",
16
16
  "invalid-tool-grant",
17
+ "unknown-tool-name",
18
+ "mutually-exclusive-options",
17
19
  "prompt-flag-injection",
18
20
  "no-autonomy-mode",
19
21
  "no-session-mode",
@@ -53,6 +55,10 @@ export const buildRefusalMessage = (issue, harness, option, facet, supported = [
53
55
  return `invalid env key or value for ${harness}${detailSuffix}; ${supportedStr} - keys must match ^[A-Za-z_][A-Za-z0-9_]*$ and contain no NUL`;
54
56
  case "invalid-tool-grant":
55
57
  return `tool grant for ${harness} contains an empty entry or a comma; a blank tool flag value grants nothing detectable, and a comma inside one name silently splits the grant; ${supportedStr} - provide comma-free, non-empty tool names as separate entries`;
58
+ case "unknown-tool-name":
59
+ return `${harness} cannot compute a tool complement around an unknown name${detailSuffix}; ${supportedStr} - exclude only curated names, or pass the unknown name through an include list instead`;
60
+ case "mutually-exclusive-options":
61
+ return `${harness} cannot combine${optionPart}${detailSuffix}; ${supportedStr} - pass exactly one of them`;
56
62
  case "prompt-flag-injection":
57
63
  return `positional prompt may not start with '-'; it would be parsed as a flag by ${harness}${detailSuffix}; ${supportedStr} - remove leading '-' or prefix with a space`;
58
64
  case "no-autonomy-mode":
@@ -72,6 +78,14 @@ export class ArgvRefusalError extends Error {
72
78
  option;
73
79
  facet;
74
80
  supported;
81
+ /** D7: which harnesses DO express the refused option, native spellings
82
+ * included. Derived by the raise site from descriptors - absent when the
83
+ * refusing layer has no descriptor set in scope. */
84
+ supportedBy;
85
+ /** D8: nearest-alternative suggestion for the CURRENT harness - keeps a
86
+ * scanning agent on its chosen harness instead of switching. Curatorial
87
+ * data set at the raise site; absent when no hint exists. */
88
+ hint;
75
89
  constructor(args) {
76
90
  const message = args.message ??
77
91
  buildRefusalMessage(args.issue, args.harness, args.option, args.facet, args.supported ?? [], args.detail);
@@ -82,6 +96,8 @@ export class ArgvRefusalError extends Error {
82
96
  this.option = args.option;
83
97
  this.facet = args.facet;
84
98
  this.supported = args.supported ?? [];
99
+ this.supportedBy = args.supportedBy;
100
+ this.hint = args.hint;
85
101
  }
86
102
  }
87
103
  //# sourceMappingURL=refusal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"refusal.js","sourceRoot":"","sources":["../../src/interpretation/refusal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA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ence chain args > user config > built-in
3
+ * profile, plus provenance. Pure - the config FILE is read by the CLI layer
4
+ * and passed in as data; this layer only decides what wins.
5
+ *
6
+ * Launch-only: callers apply resolved options on launch, never resume (a
7
+ * resumed session keeps its session's settings - same rule the codex
8
+ * sandbox default already follows).
9
+ */
10
+ import type { HarnessDescriptor } from "../knowledge/descriptor.js";
11
+ import type { TurnOptions } from "./argv.js";
12
+ export type ProvenanceTier = "arg" | "project-config" | "user-config" | "profile" | "harness";
13
+ export interface ProvenanceEntry {
14
+ readonly key: string;
15
+ readonly value: unknown;
16
+ readonly tier: ProvenanceTier;
17
+ }
18
+ /** D5: the project floor caps arg grants; exceeding it refuses naming both
19
+ * sets. Structured-first: fields, not prose parsing. */
20
+ export declare class FloorExceededError extends Error {
21
+ readonly harness: string;
22
+ readonly excess: readonly string[];
23
+ readonly floor: readonly string[];
24
+ constructor(harness: string, excess: readonly string[], floor: readonly string[]);
25
+ }
26
+ export interface ResolvedOptions {
27
+ readonly options: TurnOptions;
28
+ readonly provenance: readonly ProvenanceEntry[];
29
+ /** Profile dimensions this harness cannot express (skip-and-report,
30
+ * never refuse): rendered as divergence, not failure. */
31
+ readonly unrenderable: readonly string[];
32
+ }
33
+ export interface ConfigTiers {
34
+ /** ~/.config/hcn/config.json (XDG) - machine-wide defaults. */
35
+ readonly user?: Readonly<Partial<TurnOptions>>;
36
+ /** <git-root>/.hcn/config.json - auto-discovered (ratified A), the ALL-
37
+ * OFF tier; its `tools` key is both the default grant and the FLOOR: an
38
+ * arg grant exceeding it refuses, naming both sets (D5). */
39
+ readonly project?: Readonly<Partial<TurnOptions>>;
40
+ }
41
+ export declare const resolveEffectiveOptions: (h: HarnessDescriptor, args: TurnOptions, tiers?: ConfigTiers) => ResolvedOptions;
42
+ //# sourceMappingURL=resolve-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options.d.ts","sourceRoot":"","sources":["../../src/interpretation/resolve-options.ts"],"names":[],"mappings":"AAAA;;;;;;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+1,162 @@
1
+ import { DEFAULT_TURN_PROFILE } from "../knowledge/profile.js";
2
+ /** D5: the project floor caps arg grants; exceeding it refuses naming both
3
+ * sets. Structured-first: fields, not prose parsing. */
4
+ export class FloorExceededError extends Error {
5
+ harness;
6
+ excess;
7
+ floor;
8
+ constructor(harness, excess, floor) {
9
+ super(`tool grant exceeds the project floor: ${JSON.stringify(excess)} not in floor ${JSON.stringify(floor)} - request a grant within the floor or raise the floor in the project config`);
10
+ this.name = "FloorExceededError";
11
+ this.harness = harness;
12
+ this.excess = excess;
13
+ this.floor = floor;
14
+ }
15
+ }
16
+ /** Expressibility per profile dimension. Dimensions whose "on" state is
17
+ * the harness's own default (discovery all-on) or whose "off" state emits
18
+ * nothing (autonomy false) are expressible EVERYWHERE - the profile value
19
+ * resolves to "emit nothing," which every harness can do. Divergence is
20
+ * reserved for dimensions that would emit a flag the harness lacks. */
21
+ const EXPRESSIBLE = {
22
+ effort: (h) => h.turnOptions.effort !== undefined,
23
+ sandbox: (h) => h.turnOptions.sandbox !== undefined,
24
+ discovery: () => true,
25
+ autonomy: () => true,
26
+ write: () => true,
27
+ shell: () => true,
28
+ tools: (h) => h.tools.includeFlag !== null || h.tools.excludeFlag !== null,
29
+ };
30
+ /** Merge semantics (gap 1, resolved): config keys are scalars and lists in
31
+ * schema v1 - there is nothing to deep-merge INTO - so precedence is whole-
32
+ * key replacement: arg > project > user > profile. A future nested key
33
+ * (per-harness sections) ships with schema v2 and its own merge rule. */
34
+ const effectiveConfig = (tiers) => ({
35
+ ...(tiers.user ?? {}),
36
+ ...(tiers.project ?? {}),
37
+ });
38
+ /** Resolve the effective options for a LAUNCH. `args` is what the caller
39
+ * passed explicitly (highest tier); `userConfig` the parsed config file;
40
+ * the profile is the floor. Keys absent everywhere defer to the harness
41
+ * and are reported with tier "harness" only when something (config or
42
+ * profile) attempted them - a truly untouched dimension is nobody's
43
+ * business and appears in provenance as tier "harness" with no value. */
44
+ /** A discovery value emits nothing when every facet is true (on). */
45
+ const emitsNothing = (value) => typeof value === "object" &&
46
+ value !== null &&
47
+ Object.values(value).every((v) => v === true);
48
+ export const resolveEffectiveOptions = (h, args, tiers = {}) => {
49
+ const provenance = [];
50
+ const unrenderable = [];
51
+ const config = effectiveConfig(tiers);
52
+ const sourceTier = (key) => {
53
+ if (tiers.project?.[key] !== undefined)
54
+ return "project-config";
55
+ if (tiers.user?.[key] !== undefined)
56
+ return "user-config";
57
+ return undefined;
58
+ };
59
+ // D5 toolset expansion: a bare --tools name matching a configured
60
+ // toolset resolves to its list BEFORE the floor check, so a named set
61
+ // within the floor passes and one exceeding it refuses naming the set's
62
+ // members. Project toolsets win name collisions over user toolsets.
63
+ const toolsets = {
64
+ ...(tiers.user?.toolsets ?? {}),
65
+ ...(tiers.project?.toolsets ?? {}),
66
+ };
67
+ let effectiveArgs = args;
68
+ if (args.tools !== undefined &&
69
+ args.tools.length === 1 &&
70
+ toolsets[args.tools[0]] !== undefined) {
71
+ effectiveArgs = { ...args, tools: toolsets[args.tools[0]] };
72
+ provenance.push({
73
+ key: "tools",
74
+ value: effectiveArgs.tools,
75
+ tier: "arg",
76
+ });
77
+ }
78
+ const resolved = { ...effectiveArgs };
79
+ // D5 floor: a project toolset floor caps any arg grant; exceeding it is
80
+ // a structured refusal naming both sets - never a silent clamp.
81
+ const floor = tiers.project?.tools;
82
+ if (floor !== undefined && effectiveArgs.tools !== undefined) {
83
+ const floorSet = new Set(floor);
84
+ const excess = effectiveArgs.tools.filter((t) => !floorSet.has(t));
85
+ if (excess.length > 0) {
86
+ throw new FloorExceededError(h.name, excess, [...floor]);
87
+ }
88
+ }
89
+ // Profile is the floor: apply only where nothing above it set the key.
90
+ for (const [key, value] of Object.entries(DEFAULT_TURN_PROFILE)) {
91
+ const argsSet = effectiveArgs[key] !== undefined;
92
+ const tier = sourceTier(key);
93
+ if (argsSet) {
94
+ provenance.push({ key, value: effectiveArgs[key], tier: "arg" });
95
+ continue;
96
+ }
97
+ if (tier !== undefined) {
98
+ provenance.push({ key, value: config[key], tier });
99
+ resolved[key] = config[key];
100
+ continue;
101
+ }
102
+ const expressible = EXPRESSIBLE[key]?.(h) ?? false;
103
+ if (!expressible) {
104
+ // Skip-and-report: a profile default this harness cannot express is
105
+ // reported divergence, never a refusal and never silence.
106
+ unrenderable.push(key);
107
+ provenance.push({ key, value, tier: "harness" });
108
+ continue;
109
+ }
110
+ // D13: the tools marker expands per descriptor. On a harness whose
111
+ // default is already everything (claude), expansion emits nothing -
112
+ // the emit-nothing rule, recorded in provenance. On a harness with
113
+ // dormant built-ins (pi), it becomes the enabling include list.
114
+ if (key === "tools" && value === "all-known") {
115
+ const enabled = h.tools.builtins.filter((t) => t.defaultEnabled).length;
116
+ const all = h.tools.builtins.length;
117
+ if (enabled === all) {
118
+ provenance.push({ key, value: "all known (already default)", tier: "profile" });
119
+ continue;
120
+ }
121
+ const expanded = h.tools.builtins.map((t) => t.name);
122
+ resolved[key] = expanded;
123
+ provenance.push({ key, value: expanded, tier: "profile" });
124
+ continue;
125
+ }
126
+ // Dimensions whose value reduces to "emit nothing" (autonomy false,
127
+ // discovery all-on, write/shell true) stay ABSENT from the resolved
128
+ // options - the harness's default already satisfies the profile, and
129
+ // emitting explicit on-flags would change resume grammar and add
130
+ // breakage surface for no semantic gain. Provenance still records
131
+ // the tier.
132
+ if ((key === "autonomy" && value === false) ||
133
+ (key === "discovery" && emitsNothing(value)) ||
134
+ ((key === "write" || key === "shell") && value === true)) {
135
+ provenance.push({ key, value, tier: "profile" });
136
+ continue;
137
+ }
138
+ resolved[key] = value;
139
+ provenance.push({ key, value, tier: "profile" });
140
+ }
141
+ // Config keys outside the profile surface pass through at their own tier
142
+ // (validated later by the same renderers as args).
143
+ for (const [key, value] of Object.entries(config)) {
144
+ if (key === "toolsets")
145
+ continue; // expanded into args above, never a turn option
146
+ if (key in DEFAULT_TURN_PROFILE)
147
+ continue;
148
+ if (effectiveArgs[key] !== undefined) {
149
+ provenance.push({ key, value: effectiveArgs[key], tier: "arg" });
150
+ continue;
151
+ }
152
+ resolved[key] = value;
153
+ const tier = sourceTier(key) ?? "user-config";
154
+ provenance.push({ key, value, tier });
155
+ }
156
+ return {
157
+ options: resolved,
158
+ provenance,
159
+ unrenderable,
160
+ };
161
+ };
162
+ //# sourceMappingURL=resolve-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options.js","sourceRoot":"","sources":["../../src/interpretation/resolve-options.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,oBAAoB,EAAmB,MAAM,yBAAyB,CAAC;AAWhF;wDACwD;AACxD,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,OAAO,CAAS;IAChB,MAAM,CAAoB;IAC1B,KAAK,CAAoB;IAClC,YAAY,OAAe,EAAE,MAAyB,EAAE,KAAwB;QAC9E,KAAK,CACH,yCAAyC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,8EAA8E,CACpL,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAUD;;;;uEAIuE;AACvE,MAAM,WAAW,GAAoE;IACnF,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,KAAK,SAAS;IACjD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,KAAK,SAAS;IACnD,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI;IACrB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI;IACpB,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI;IACjB,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI;IACjB,KAAK,EAAE,CAAC,CAAC,E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AAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,IAAI,GAAG,KAAK,UAAU;YAAE,SAAS,CAAC,gDAAgD;QAClF,IAAI,GAAG,IAAI,oBAAoB;YAAE,SAAS;QAC1C,IAAI,aAAa,CAAC,GAAwB,CAAC,KAAK,SAAS,EAAE,CAAC;YAC1D,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,CAAC,GAAwB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YACtF,SAAS;QACX,CAAC;QACD,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACtB,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC;QAC9C,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,OAAO;QACL,OAAO,EAAE,QAAkC;QAC3C,UAAU;QACV,YAAY;KACb,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Caller-directed skills allowlist rendering (issue #38). The delegating
3
+ * agent picks the subset from its own registry; this module turns the
4
+ * resolved paths into per-harness argv tokens.
5
+ *
6
+ * - pi: `-ns` (discovery off) + one `--skill <path>` per entry - the
7
+ * allowlist is exact: only the caller's picks load.
8
+ * - claude: no per-skill load flag; the registry is already present via
9
+ * the personal skills dir, so the allowlist renders as the complement
10
+ * OFF - `--settings '{"skillOverrides":{"<name>":"off",...}}'` for every
11
+ * known skill except the picks. Known set comes from the caller's root
12
+ * listing (same source that resolved the names).
13
+ * - codex/muse: refuse (structural) with the standard hint shape.
14
+ */
15
+ import type { HarnessDescriptor } from "../knowledge/descriptor.js";
16
+ export declare const basenameOf: (p: string) => string;
17
+ export declare const renderSkillsSelection: (h: HarnessDescriptor, skills: readonly string[]) => readonly string[];
18
+ /** The claude complement form, given the full known registry: every known
19
+ * name except the picks gets "off". Exported for the CLI layer, which owns
20
+ * the registry listing (an fs read - never in interpretation). */
21
+ export declare const claudeSkillOverridesArg: (knownSkills: readonly string[], pickedPaths: readonly string[]) => string[];
22
+ //# sourceMappingURL=skills-selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills-selection.d.ts","sourceRoot":"","sources":["../../src/interpretation/skills-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,eAAO,MAAM,UAAU,MAAO,MAAM,KAAG,MAGtC,CAAC;AAEF,eAAO,MAAM,qBAAqB,MAC7B,iBAAiB,UACZ,SAAS,MAAM,EAAE,KACxB,SAAS,MAAM,EA+BjB,CAAC;AAEF;;kEAEkE;AAClE,eAAO,MAAM,uBAAuB,gBACrB,SAAS,MAAM,EAAE,eACjB,SAAS,MAAM,EAAE,KAC7B,MAAM,EAQR,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { ArgvRefusalError } from "./refusal.js";
2
+ export const basenameOf = (p) => {
3
+ const i = p.lastIndexOf("/");
4
+ return i === -1 ? p : p.slice(i + 1);
5
+ };
6
+ export const renderSkillsSelection = (h, skills) => {
7
+ if (skills.length === 0)
8
+ return [];
9
+ if (h.skills === null) {
10
+ throw new ArgvRefusalError({
11
+ issue: "unsupported-option",
12
+ harness: h.name,
13
+ option: "skills",
14
+ supported: ["caller-directed skill sets"],
15
+ supportedBy: [
16
+ { harness: "pi", spelling: "--skill" },
17
+ { harness: "claude", spelling: "skillOverrides" },
18
+ ],
19
+ hint: h.name === "codex"
20
+ ? "codex discovers skills from its own directory with no call-time surface - stage the skills into $CODEX_HOME/skills or pass their content in the prompt"
21
+ : "muse scopes skills by workspace trust with no per-skill surface - include the skill content in the prompt or use --trust-workspace for the whole registry",
22
+ });
23
+ }
24
+ if (h.skills.loadFlag !== null) {
25
+ // pi: discovery off so ONLY the picks load.
26
+ const tokens = ["-ns"];
27
+ for (const path of skills)
28
+ tokens.push(h.skills.loadFlag, path);
29
+ return tokens;
30
+ }
31
+ // claude: complement-off via settings JSON. Names are the skill dir
32
+ // basenames; unknown names in knownSkills would be turned off
33
+ // pointlessly, so the caller passes exactly the known set.
34
+ return [];
35
+ };
36
+ /** The claude complement form, given the full known registry: every known
37
+ * name except the picks gets "off". Exported for the CLI layer, which owns
38
+ * the registry listing (an fs read - never in interpretation). */
39
+ export const claudeSkillOverridesArg = (knownSkills, pickedPaths) => {
40
+ const picks = new Set(pickedPaths.map(basenameOf));
41
+ const offs = {};
42
+ for (const name of knownSkills) {
43
+ if (!picks.has(name))
44
+ offs[name] = "off";
45
+ }
46
+ const json = JSON.stringify({ skillOverrides: offs });
47
+ return ["--settings", json];
48
+ };
49
+ //# sourceMappingURL=skills-selection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills-selection.js","sourceRoot":"","sources":["../../src/interpretation/skills-selection.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAS,EAAU,EAAE;IAC9C,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,CAAoB,EACpB,MAAyB,EACN,EAAE;IACrB,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,IAAI,CAAC,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,gBAAgB,CAAC;YACzB,KAAK,EAAE,oBAAoB;YAC3B,OAAO,EAAE,CAAC,CAAC,IAAI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I,CAAC,CAAC;AAC9B,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Cross-harness support derivation: pure functions that answer "which
3
+ * harnesses express this option, and under what native spelling" from the
4
+ * descriptor set. Phase 3 (D7): refusal diagnostics derive support lists at
5
+ * runtime instead of hardcoding them, so a descriptor edit can never leave
6
+ * a refusal message stale. The autonomy refusal in argv.ts was the
7
+ * counter-pattern - a hardcoded flag array that drifts on descriptor
8
+ * change.
9
+ *
10
+ * Interpretation-layer pure function; takes the descriptor set as an
11
+ * argument rather than importing the defaults, so override sets work.
12
+ */
13
+ import type { DescriptorSet } from "../knowledge/overrides.js";
14
+ import type { RefusalOption } from "./refusal.js";
15
+ export interface SupportEntry {
16
+ readonly harness: string;
17
+ /** The native spelling a caller would use directly on that harness. */
18
+ readonly spelling: string;
19
+ }
20
+ /** Every harness in the set that can express `option`, with its native
21
+ * spelling. Ordered by the set's insertion order (defaults: claude, codex,
22
+ * pi, muse) so output is stable across calls. */
23
+ export declare const supportedBy: (set: DescriptorSet, option: RefusalOption) => readonly SupportEntry[];
24
+ /** Reverse lookup for native-spelling recognition (D7 part B): given a raw
25
+ * flag token a caller typed, find the option it belongs to and which
26
+ * harnesses spell it that way. Returns null for tokens no descriptor
27
+ * knows - those keep the plain unknown-flag error. */
28
+ export declare const recognizeNativeSpelling: (set: DescriptorSet, flag: string) => {
29
+ readonly option: RefusalOption;
30
+ readonly entries: readonly SupportEntry[];
31
+ } | null;
32
+ //# sourceMappingURL=support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support.d.ts","sourceRoot":"","sources":["../../src/interpretation/support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAqCD;;iDAEiD;AACjD,eAAO,MAAM,WAAW,QAAS,aAAa,UAAU,aAAa,KAAG,SAAS,YAAY,EAQ5F,CAAC;AAEF;;;sDAGsD;AACtD,eAAO,MAAM,uBAAuB,QAC7B,aAAa,QACZ,MAAM,KACX;IAAE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;CAAE,GAAG,IAwClF,CAAC"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Cross-harness support derivation: pure functions that answer "which
3
+ * harnesses express this option, and under what native spelling" from the
4
+ * descriptor set. Phase 3 (D7): refusal diagnostics derive support lists at
5
+ * runtime instead of hardcoding them, so a descriptor edit can never leave
6
+ * a refusal message stale. The autonomy refusal in argv.ts was the
7
+ * counter-pattern - a hardcoded flag array that drifts on descriptor
8
+ * change.
9
+ *
10
+ * Interpretation-layer pure function; takes the descriptor set as an
11
+ * argument rather than importing the defaults, so override sets work.
12
+ */
13
+ const spellingOf = (h, option) => {
14
+ switch (option) {
15
+ case "tools":
16
+ return h.tools.includeFlag;
17
+ case "excludeTools":
18
+ return h.tools.excludeFlag;
19
+ case "autonomy":
20
+ return h.autonomy?.flag ?? null;
21
+ case "effort":
22
+ case "sandbox":
23
+ case "provider":
24
+ case "write":
25
+ case "shell":
26
+ case "maxSteps":
27
+ case "discovery": {
28
+ const spec = h.turnOptions[option];
29
+ if (spec === undefined)
30
+ return null;
31
+ const rawRender = spec.kind === "discovery"
32
+ ? Object.values(spec.facets)[0]?.render
33
+ : spec.render;
34
+ if (rawRender === undefined)
35
+ return null;
36
+ // flag-value/config-kv carry `flag`; flag-list carries `flags` - the
37
+ // first entry is the spelling a caller would type.
38
+ return rawRender.flag ?? rawRender.flags?.[0] ?? null;
39
+ }
40
+ default:
41
+ return null;
42
+ }
43
+ };
44
+ /** Every harness in the set that can express `option`, with its native
45
+ * spelling. Ordered by the set's insertion order (defaults: claude, codex,
46
+ * pi, muse) so output is stable across calls. */
47
+ export const supportedBy = (set, option) => {
48
+ const out = [];
49
+ for (const h of Object.values(set)) {
50
+ if (h === undefined)
51
+ continue;
52
+ const spelling = spellingOf(h, option);
53
+ if (spelling !== null)
54
+ out.push({ harness: h.name, spelling });
55
+ }
56
+ return out;
57
+ };
58
+ /** Reverse lookup for native-spelling recognition (D7 part B): given a raw
59
+ * flag token a caller typed, find the option it belongs to and which
60
+ * harnesses spell it that way. Returns null for tokens no descriptor
61
+ * knows - those keep the plain unknown-flag error. */
62
+ export const recognizeNativeSpelling = (set, flag) => {
63
+ const normalized = flag.toLowerCase();
64
+ const candidates = [
65
+ "tools",
66
+ "excludeTools",
67
+ "autonomy",
68
+ "effort",
69
+ "sandbox",
70
+ "provider",
71
+ "write",
72
+ "shell",
73
+ "maxSteps",
74
+ ];
75
+ for (const option of candidates) {
76
+ const entries = supportedBy(set, option).filter((e) => e.spelling.toLowerCase() === normalized);
77
+ if (entries.length > 0)
78
+ return { option, entries };
79
+ }
80
+ // Discovery facets: single-dash spellings (pi -nt/-nc/-ne/-ns) and
81
+ // claude's --setting-sources. Facet spellings map to the facet name so
82
+ // the redirect can name the normalized spelling.
83
+ const FACET_KEYS = ["tools", "instructionFiles", "extensions", "skills"];
84
+ for (const facet of FACET_KEYS) {
85
+ const entries = [];
86
+ for (const h of Object.values(set)) {
87
+ if (h === undefined)
88
+ continue;
89
+ const spec = h.turnOptions.discovery;
90
+ if (spec === undefined || spec.kind !== "discovery")
91
+ continue;
92
+ const facetSpec = spec.facets[facet];
93
+ if (facetSpec === undefined)
94
+ continue;
95
+ const render = facetSpec.render;
96
+ const spelling = render.flag ?? render.flags?.[0];
97
+ if (spelling !== undefined && spelling.toLowerCase() === normalized) {
98
+ entries.push({ harness: h.name, spelling });
99
+ }
100
+ }
101
+ if (entries.length > 0) {
102
+ return { option: `discovery.${facet}`, entries };
103
+ }
104
+ }
105
+ return null;
106
+ };
107
+ //# sourceMappingURL=support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"support.js","sourceRoot":"","sources":["../../src/interpretation/support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH,MAAM,UAAU,GAAG,CAAC,CAAoB,EAAE,MAAqB,EAAiB,EAAE;IAChF,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO;YACV,OAAO,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;QAC7B,KAAK,cAAc;YACjB,OAAO,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;QAC7B,KAAK,UAAU;YACb,OAAO,CAAC,CAAC,QAAQ,EAAE,IAAI,IAAI,IAAI,CAAC;QAClC,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS,CAAC;QACf,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,UAAU,CAAC;QAChB,KAAK,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACnC,IAAI,IAAI,KAAK,SAAS;gBAAE,OAAO,IAAI,CAAC;YACpC,MAAM,SAAS,GACb,IAAI,CAAC,IAAI,KAAK,WAAW;gBACvB,CAAC,CACG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAG7B,EAAE,MAAM;gBACX,CAAC,CAAE,IAAyD,CAAC,MAAM,CAAC;YACxE,IAAI,SAAS,KAAK,SAAS;gBAAE,OAAO,IAAI,CAAC;YACzC,qEAAqE;YACrE,mDAAmD;YACnD,OAAO,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;QACxD,CAAC;QACD;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC,CAAC;AAEF;;iDAEiD;AACjD,MAAM,CAA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AAU,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAmB,EAAE,CAAC;QACnC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,KAAK,SAAS;gBAAE,SAAS;YAC9B,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC;YACrC,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW;gBAAE,SAAS;YAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACrC,IAAI,SAAS,KAAK,SAAS;gBAAE,SAAS;YACtC,MAAM,MAAM,GAAG,SAAS,CAAC,MAA6C,CAAC;YACvE,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;YAClD,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,UAAU,EAAE,CAAC;gBACpE,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,EAAE,MAAM,EAAE,aAAa,KAAK,EAAmB,EAAE,OAAO,EAAE,CAAC;QACpE,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Tool-selection rendering: turns normalized include/exclude lists into the
3
+ * per-harness argv tokens, per decisions D1-D3 and the Phase 0 evidence.
4
+ *
5
+ * Semantics:
6
+ * - include: exact allowlist over the descriptor's curated names. pi's flag
7
+ * is strict over built-ins, rendered directly. claude's include flag only
8
+ * pre-approves without restricting the visible set, so an exact allowlist
9
+ * on claude renders as a deny-complement (all known minus included).
10
+ * - exclude: the complement of the named tools over all descriptor-known
11
+ * names (D2). pi's native exclude subtracts from its default set (4
12
+ * tools), so a D2 exclude renders as a computed include list there.
13
+ * - mutual exclusion (D1): both flags in one call refuse.
14
+ * - extensible rule (D3): curated names validate and map; unknown
15
+ * clean-selector names pass through and are reported as unmapped so
16
+ * provenance can surface them.
17
+ */
18
+ import type { HarnessDescriptor } from "../knowledge/descriptor.js";
19
+ export declare const TOOL_SELECTOR: RegExp;
20
+ export interface ToolSelection {
21
+ readonly include?: readonly string[];
22
+ readonly exclude?: readonly string[];
23
+ }
24
+ export interface RenderedToolSelection {
25
+ readonly tokens: readonly string[];
26
+ readonly unmapped: readonly string[];
27
+ }
28
+ export declare const renderToolSelection: (h: HarnessDescriptor, selection: ToolSelection) => RenderedToolSelection;
29
+ //# sourceMappingURL=tool-selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-selection.d.ts","sourceRoot":"","sources":["../../src/interpretation/tool-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAKpE,eAAO,MAAM,aAAa,QAA0C,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAwCD,eAAO,MAAM,mBAAmB,MAC3B,iBAAiB,aACT,aAAa,KACvB,qBAqFF,CAAC"}