@agentworkforce/workload-router 0.19.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.0.1] - 2026-05-11
11
+
12
+ ### Changed
13
+
14
+ - Move persona-shape code from harness-kit + workload-router into persona-kit (#65)
15
+ - Delete @agentworkforce/harness-kit from the monorepo (#65)
16
+ - Shrink workload-router: drop persona-domain re-exports (1.0.0) (#68)
17
+
18
+ ## [1.0.0] - 2026-05-11
19
+
20
+ ### Changed (BREAKING)
21
+
22
+ - Drop all persona-domain re-exports that used to be forwarded from
23
+ `@agentworkforce/persona-kit`. Consumers must now import persona constants,
24
+ types, and functions (e.g. `HARNESS_VALUES`, `PERSONA_TIERS`,
25
+ `PERSONA_TAGS`, `PERMISSION_MODES`, `Harness`, `PersonaSpec`,
26
+ `PersonaSelection`, `PersonaSkill`, `materializeSkills`,
27
+ `parsePersonaSpec`, …) directly from `@agentworkforce/persona-kit`.
28
+ - The remaining public surface is routing-only: `RoutingProfile`,
29
+ `RoutingProfileRule`, `RoutingProfileId`, `personaCatalog`,
30
+ `listBuiltInPersonas`, `routingProfiles`, `resolvePersona`,
31
+ `resolvePersonaByTier`, `usePersona`, `useSelection`, and the evidence /
32
+ owner-decision exports from `./eval`.
33
+
10
34
  ## [0.19.0] - 2026-05-08
11
35
 
12
36
  ### Changed
package/README.md CHANGED
@@ -94,13 +94,13 @@ Personas may declare prompt-visible runtime inputs:
94
94
 
95
95
  Input keys must be env-style uppercase names. The router validates and carries
96
96
  the declarations through `PersonaSpec` and `PersonaSelection`; launchers decide
97
- how to resolve and render them. The standard harness-kit policy is explicit
97
+ how to resolve and render them. The standard persona-kit policy is explicit
98
98
  value, env var, default, then fail.
99
99
 
100
100
  Codex runtimes may also set `harnessSettings.sandboxMode`,
101
101
  `harnessSettings.approvalPolicy`,
102
102
  `harnessSettings.workspaceWriteNetworkAccess`, and
103
- `harnessSettings.webSearch`; harness-kit maps those to Codex launch flags.
103
+ `harnessSettings.webSearch`; persona-kit maps those to Codex launch flags.
104
104
 
105
105
  ## Development
106
106
 
package/dist/eval.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PersonaIntent, PersonaTier } from './index.js';
1
+ import type { PersonaIntent, PersonaTier } from '@agentworkforce/persona-kit';
2
2
  export interface EvalCase {
3
3
  id: string;
4
4
  intent: PersonaIntent;
@@ -1 +1 @@
1
- {"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../src/eval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAYA"}
1
+ {"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../src/eval.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE9E,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB,CAYA"}
package/dist/index.d.ts CHANGED
@@ -1,225 +1,4 @@
1
- export declare const HARNESS_VALUES: readonly ["opencode", "codex", "claude"];
2
- export declare const PERSONA_TIERS: readonly ["best", "best-value", "minimum"];
3
- export declare const PERSONA_TAGS: readonly ["planning", "implementation", "review", "testing", "debugging", "documentation", "release", "discovery", "analytics"];
4
- export declare const PERSONA_INTENTS: readonly ["implement-frontend", "review", "architecture-plan", "requirements-analysis", "debugging", "security-review", "documentation", "verification", "test-strategy", "tdd-enforcement", "flake-investigation", "opencode-workflow-correctness", "npm-provenance", "cloud-sandbox-infra", "sage-slack-egress-migration", "sage-proactive-rewire", "cloud-slack-proxy-guard", "sage-cloud-e2e-conduction", "capability-discovery", "npm-package-compat", "posthog", "persona-authoring", "persona-improvement", "agent-relay-workflow", "slop-audit", "api-contract-review", "local-stack-orchestration", "e2e-validation", "write-integration-tests", "relay-orchestrator"];
5
- export declare const BUILT_IN_PERSONA_INTENTS: readonly ["persona-authoring", "persona-improvement"];
6
- export type Harness = (typeof HARNESS_VALUES)[number];
7
- export type PersonaTier = (typeof PERSONA_TIERS)[number];
8
- export type PersonaIntent = (typeof PERSONA_INTENTS)[number];
9
- export type PersonaTag = (typeof PERSONA_TAGS)[number];
10
- export interface HarnessSettings {
11
- reasoning: 'low' | 'medium' | 'high';
12
- timeoutSeconds: number;
13
- /**
14
- * Codex CLI sandbox mode for model-generated shell commands. Prefer
15
- * `workspace-write` with `workspaceWriteNetworkAccess` when network is the only
16
- * missing capability; `danger-full-access` is the fully unsandboxed fallback.
17
- */
18
- sandboxMode?: CodexSandboxMode;
19
- /** Codex CLI approval policy (`--ask-for-approval`). */
20
- approvalPolicy?: CodexApprovalPolicy;
21
- /**
22
- * Allow outbound network access inside Codex's workspace-write sandbox
23
- * (`sandbox_workspace_write.network_access`).
24
- */
25
- workspaceWriteNetworkAccess?: boolean;
26
- /** Enable the Codex live web-search tool for this runtime. */
27
- webSearch?: boolean;
28
- }
29
- export declare const CODEX_SANDBOX_MODES: readonly ["read-only", "workspace-write", "danger-full-access"];
30
- export type CodexSandboxMode = (typeof CODEX_SANDBOX_MODES)[number];
31
- export declare const CODEX_APPROVAL_POLICIES: readonly ["untrusted", "on-failure", "on-request", "never"];
32
- export type CodexApprovalPolicy = (typeof CODEX_APPROVAL_POLICIES)[number];
33
- /**
34
- * Sidecar markdown delivery mode. `overwrite` writes only the persona's
35
- * resolved markdown into the harness's mount file. `extend` reads the
36
- * caller's real-cwd file (if any) and prepends it to the persona content,
37
- * separated by `\n\n---\n\n`. With no real-cwd file `extend` degrades to
38
- * `overwrite` semantics — the persona content lands alone.
39
- */
40
- export declare const SIDECAR_MD_MODES: readonly ["overwrite", "extend"];
41
- export type SidecarMdMode = (typeof SIDECAR_MD_MODES)[number];
42
- export interface PersonaRuntime {
43
- harness: Harness;
44
- model: string;
45
- systemPrompt: string;
46
- harnessSettings: HarnessSettings;
47
- /**
48
- * Per-tier override of the persona's `claudeMd` path. Resolves to an
49
- * absolute filesystem path on the parsed spec — for built-ins, the value
50
- * comes from `claudeMdContent` instead of a path. Materialized into the
51
- * sandbox mount as `/CLAUDE.md` when running under the claude harness.
52
- */
53
- claudeMd?: string;
54
- /** Per-tier override of {@link PersonaSpec.claudeMdMode}. */
55
- claudeMdMode?: SidecarMdMode;
56
- /** Per-tier override of the persona's `agentsMd` path. */
57
- agentsMd?: string;
58
- /** Per-tier override of {@link PersonaSpec.agentsMdMode}. */
59
- agentsMdMode?: SidecarMdMode;
60
- /**
61
- * Inlined sidecar content for built-in personas. The catalog generator
62
- * reads the sibling `.md` at build time and emits its body here so the
63
- * installed package does not need to ship the file separately. Runtime
64
- * code prefers this over `claudeMd` when both are set.
65
- */
66
- claudeMdContent?: string;
67
- /** Inlined `AGENTS.md` content for built-in personas (see {@link claudeMdContent}). */
68
- agentsMdContent?: string;
69
- }
70
- /**
71
- * A skill is a named, reusable capability attached to a persona.
72
- * `source` points to canonical guidance the persona should apply
73
- * (e.g. a prpm.dev package URL, an internal runbook, a docs page).
74
- */
75
- export interface PersonaSkill {
76
- id: string;
77
- source: string;
78
- description: string;
79
- }
80
- /**
81
- * Prompt-visible runtime input declared by a persona. Inputs are for
82
- * non-secret run configuration such as output paths, target package names, or
83
- * mode switches. Launchers resolve each input from explicit values, the
84
- * process environment, or `default`, then substitute `$NAME` / `${NAME}` in
85
- * the system prompt before spawning the harness.
86
- */
87
- export interface PersonaInputSpec {
88
- /** Human-readable explanation shown in docs/catalog UIs. */
89
- description?: string;
90
- /**
91
- * Environment variable to read when the launcher did not provide an
92
- * explicit value. Defaults to the input key itself.
93
- */
94
- env?: string;
95
- /** Literal fallback used when neither an explicit value nor env var exists. */
96
- default?: string;
97
- /**
98
- * When true, the input is allowed to resolve to an empty string. The
99
- * launcher substitutes `$NAME` with `''` rather than throwing
100
- * `MissingPersonaInputError`. Use for inputs whose absence is meaningful
101
- * — e.g. an upstream task description that may or may not be forwarded —
102
- * and prefer non-optional inputs with a `default` for everything else so
103
- * misconfigured launches surface loudly.
104
- */
105
- optional?: boolean;
106
- }
107
- export declare const PERMISSION_MODES: readonly ["default", "acceptEdits", "bypassPermissions", "plan"];
108
- export type PermissionMode = (typeof PERMISSION_MODES)[number];
109
- /**
110
- * Persona-level permission policy for the harness session. Translates to the
111
- * harness's native allow/deny/mode flags at spawn time. Tool-pattern syntax is
112
- * passed through verbatim — `"mcp__posthog"` to allow every posthog MCP tool,
113
- * `"mcp__posthog__projects-get"` for a specific one, `"Bash(git *)"` for a
114
- * shell pattern. See the target harness's docs for the exact grammar.
115
- */
116
- export interface PersonaPermissions {
117
- /** Tool names/patterns to auto-approve. */
118
- allow?: string[];
119
- /** Tool names/patterns to always block. */
120
- deny?: string[];
121
- /** Permission mode for the session. */
122
- mode?: PermissionMode;
123
- }
124
- /**
125
- * Relayfile mount policy for interactive sessions. Patterns use gitignore
126
- * syntax. `ignoredPatterns` are omitted from the mount entirely;
127
- * `readonlyPatterns` are copied into the mount but edits do not sync back.
128
- * Launchers may merge these with project-level `.agentignore` /
129
- * `.agentreadonly` dotfiles.
130
- */
131
- export interface PersonaMount {
132
- ignoredPatterns?: string[];
133
- readonlyPatterns?: string[];
134
- }
135
- /**
136
- * MCP server config, structured to match Claude Code's `--mcp-config` JSON
137
- * verbatim so the whole object can be passed through untouched. Values inside
138
- * `headers` / `env` / `args` / `url` / `command` may be literal strings or
139
- * `$VAR` / `${VAR}` references. Resolution happens in the runner/CLI at spawn
140
- * time — this package only defines the shape, not the interpolation policy.
141
- */
142
- export type McpServerSpec = {
143
- type: 'http' | 'sse';
144
- url: string;
145
- headers?: Record<string, string>;
146
- } | {
147
- type: 'stdio';
148
- command: string;
149
- args?: string[];
150
- env?: Record<string, string>;
151
- };
152
- export interface PersonaSpec {
153
- id: string;
154
- intent: string;
155
- /**
156
- * Free-form classification labels (from {@link PERSONA_TAGS}). Every persona
157
- * has at least one; a persona may carry multiple tags when it spans concerns
158
- * (e.g. `['testing', 'implementation']`).
159
- */
160
- tags: PersonaTag[];
161
- description: string;
162
- skills: PersonaSkill[];
163
- /**
164
- * Prompt-visible runtime inputs. Keys must be env-style names
165
- * (`OUTPUT_PATH`, `TARGET_DIR`, etc.). Never put secrets here; resolved
166
- * values are substituted into the persona's system prompt.
167
- */
168
- inputs?: Record<string, PersonaInputSpec>;
169
- tiers: Record<PersonaTier, PersonaRuntime>;
170
- /**
171
- * Persona-author's preferred tier when a caller does not request one
172
- * explicitly. Selectors like `agentworkforce agent <persona>` (no `@<tier>`
173
- * suffix) resolve to this value before falling back to `'best-value'`.
174
- * Routing-profile rules continue to override this for built-in personas
175
- * resolved through {@link resolvePersona}.
176
- */
177
- defaultTier?: PersonaTier;
178
- /**
179
- * Environment variables injected into the harness child process.
180
- * Values may be literal strings or `$VAR` references resolved from the
181
- * caller's environment at spawn time.
182
- */
183
- env?: Record<string, string>;
184
- /**
185
- * MCP servers to attach to the harness session. Only wired for `claude`
186
- * today (via `--mcp-config`); other harnesses warn and skip.
187
- */
188
- mcpServers?: Record<string, McpServerSpec>;
189
- /**
190
- * Permission policy (allow/deny lists, mode) for the harness session.
191
- * Only wired for `claude` today (via `--allowedTools`, `--disallowedTools`,
192
- * `--permission-mode`); other harnesses warn and skip.
193
- */
194
- permissions?: PersonaPermissions;
195
- /**
196
- * Relayfile mount policy for file visibility and writability. Applied by
197
- * launchers that run the harness inside `@relayfile/local-mount`.
198
- */
199
- mount?: PersonaMount;
200
- /**
201
- * Author-supplied path to a `CLAUDE.md` sidecar that should be applied
202
- * when the persona runs under the claude harness. The path is relative
203
- * to the JSON file that declared the field; the loader resolves it to
204
- * an already-absolute path on the parsed spec. Built-in personas inline
205
- * the content into {@link PersonaRuntime.claudeMdContent} at build time.
206
- */
207
- claudeMd?: string;
208
- /** Defaults to `overwrite`. See {@link SidecarMdMode}. */
209
- claudeMdMode?: SidecarMdMode;
210
- /**
211
- * Author-supplied path to an `AGENTS.md` sidecar that should be applied
212
- * when the persona runs under the opencode harness. Same resolution
213
- * rules as {@link claudeMd}.
214
- */
215
- agentsMd?: string;
216
- /** Defaults to `overwrite`. See {@link SidecarMdMode}. */
217
- agentsMdMode?: SidecarMdMode;
218
- /** Inlined `CLAUDE.md` content for built-in personas (see {@link PersonaRuntime.claudeMdContent}). */
219
- claudeMdContent?: string;
220
- /** Inlined `AGENTS.md` content for built-in personas. */
221
- agentsMdContent?: string;
222
- }
1
+ import { type Harness, type PersonaContext, type PersonaIntent, type PersonaSelection, type PersonaSpec, type PersonaTier } from '@agentworkforce/persona-kit';
223
2
  export interface RoutingProfileRule {
224
3
  tier: PersonaTier;
225
4
  rationale: string;
@@ -229,164 +8,12 @@ export interface RoutingProfile {
229
8
  description: string;
230
9
  intents: Record<PersonaIntent, RoutingProfileRule>;
231
10
  }
232
- export interface PersonaSelection {
233
- personaId: string;
234
- tier: PersonaTier;
235
- runtime: PersonaRuntime;
236
- skills: PersonaSkill[];
237
- rationale: string;
238
- inputs?: Record<string, PersonaInputSpec>;
239
- inputValues?: Record<string, string>;
240
- env?: Record<string, string>;
241
- mcpServers?: Record<string, McpServerSpec>;
242
- permissions?: PersonaPermissions;
243
- mount?: PersonaMount;
244
- /**
245
- * Effective sidecar config for the selected (tier, harness). Already-
246
- * cascaded across top-level/per-tier so launchers don't have to re-walk
247
- * the spec. Modes default to `overwrite`.
248
- */
249
- claudeMd?: string;
250
- claudeMdContent?: string;
251
- claudeMdMode?: SidecarMdMode;
252
- agentsMd?: string;
253
- agentsMdContent?: string;
254
- agentsMdMode?: SidecarMdMode;
255
- }
256
- export declare const SKILL_SOURCE_KINDS: readonly ["prpm", "skill.sh"];
257
- export type SkillSourceKind = (typeof SKILL_SOURCE_KINDS)[number];
258
- /** Per-harness rules for where skills land on disk and how to ask prpm for them. */
259
- export interface HarnessSkillTarget {
260
- /** Value passed to `prpm install --as <flag>`. */
261
- asFlag: string;
262
- /** Directory (relative to repo root) where prpm drops the skill package. */
263
- dir: string;
264
- }
265
- export declare const HARNESS_SKILL_TARGETS: Record<Harness, HarnessSkillTarget>;
266
- /**
267
- * Options for {@link materializeSkills} / {@link materializeSkillsFor}.
268
- *
269
- * `installRoot` stages skills under an out-of-repo directory (typically
270
- * `~/.agentworkforce/workforce/sessions/<id>/claude/plugin`) that doubles as a Claude
271
- * Code plugin root. The SDK generates the scaffold (`.claude-plugin/plugin.json`
272
- * and a `skills` symlink pointing at `.claude/skills/`), prpm installs into
273
- * `<installRoot>/.claude/skills/<name>/`, and post-run cleanup removes the
274
- * entire `installRoot` in one `rm -rf` — no files ever touch the repo.
275
- *
276
- * Only honored for `harness === 'claude'`. Passing `installRoot` with another
277
- * harness throws. The caller must supply an absolute path; when the generated
278
- * install command runs, it `mkdir -p`s `installRoot` and any missing parents
279
- * needed for the scaffold (`.claude-plugin/`, `.claude/skills/`).
280
- */
281
- export interface SkillMaterializationOptions {
282
- installRoot?: string;
283
- }
284
- export interface SkillInstall {
285
- skillId: string;
286
- /** Original `source` string from the persona JSON. */
287
- source: string;
288
- sourceKind: SkillSourceKind;
289
- /** Normalized package reference (e.g. `@prpm/npm-trusted-publishing`, `vercel-labs/skills#find-skills`). */
290
- packageRef: string;
291
- harness: Harness;
292
- /** argv-style command — safer than a shell string for execFile/spawn callers. */
293
- installCommand: readonly string[];
294
- /** Directory the skill is expected to land in after install. */
295
- installedDir: string;
296
- /** Path to the installed SKILL.md manifest (for prompt injection fallback). */
297
- installedManifest: string;
298
- /**
299
- * Paths the installer scatters outside of a durable lockfile — safe to
300
- * `rm -rf` once the persona run has read what it needs from them. The
301
- * provider's lockfile (`prpm.lock`, `skills-lock.json`, etc.) is deliberately
302
- * omitted so repeat runs can stay fast and reproducible.
303
- */
304
- cleanupPaths: readonly string[];
305
- }
306
- export interface SkillMaterializationPlan {
307
- harness: Harness;
308
- installs: SkillInstall[];
309
- /**
310
- * Absolute path to the out-of-repo stage directory, when the plan was
311
- * produced with {@link SkillMaterializationOptions.installRoot}. When set,
312
- * the install artifacts emit plugin scaffolding at this root and cleanup
313
- * removes the whole directory instead of individual skill paths.
314
- */
315
- sessionInstallRoot?: string;
316
- }
317
- export interface PersonaInstallContext {
318
- /** Pure install plan for the persona's skills. Describes what would be installed and where, with no side effects. */
319
- readonly plan: SkillMaterializationPlan;
320
- /** Full install command in argv form, suitable for `execFile`/`spawn` without shell escaping concerns. */
321
- readonly command: readonly string[];
322
- /** Shell-escaped form of the full install command, convenient for `spawn(..., { shell: true })`. */
323
- readonly commandString: string;
324
- /**
325
- * Post-run cleanup command (argv form) that removes the ephemeral artifact
326
- * paths the provider scatters during install, leaving the provider lockfile
327
- * in place. Callers running the install themselves should run this **after**
328
- * the agent step consumes the skills, never before. For empty plans this is
329
- * a shell no-op (`:`).
330
- */
331
- readonly cleanupCommand: readonly string[];
332
- /** Shell-escaped form of {@link cleanupCommand}. */
333
- readonly cleanupCommandString: string;
334
- }
335
- /**
336
- * Return value of {@link usePersona}. A side-effect-free bundle of "what this
337
- * persona is" plus grouped install metadata. Nothing is installed, spawned, or
338
- * written to disk by constructing this object — run `install.commandString`
339
- * yourself when you are ready to materialize the persona's skills.
340
- */
341
- export interface PersonaContext {
342
- /** Resolved persona choice for this intent/profile: identity, tier, runtime, skills, and routing rationale. */
343
- readonly selection: PersonaSelection;
344
- /** Grouped install metadata for the resolved persona's skills. */
345
- readonly install: PersonaInstallContext;
346
- }
347
- /**
348
- * Given a set of persona skills and the harness the persona will run under,
349
- * produce the concrete install plan: which install invocations to run, where
350
- * the skill will land on disk, and which artifact paths should be cleaned up
351
- * after the persona run to keep the workspace tidy.
352
- *
353
- * Pure function — does not execute commands or touch the filesystem.
354
- */
355
- export declare function materializeSkills(skills: readonly PersonaSkill[], harness: Harness, options?: SkillMaterializationOptions): SkillMaterializationPlan;
356
- /**
357
- * Convenience wrapper: derive the install plan directly from a resolved
358
- * persona selection, using its tier's harness automatically.
359
- */
360
- export declare function materializeSkillsFor(selection: PersonaSelection, options?: SkillMaterializationOptions): SkillMaterializationPlan;
361
11
  export declare const personaCatalog: Partial<Record<PersonaIntent, PersonaSpec>>;
362
12
  export declare function listBuiltInPersonas(): PersonaSpec[];
363
13
  export declare const routingProfiles: {
364
14
  readonly default: RoutingProfile;
365
15
  };
366
16
  export type RoutingProfileId = keyof typeof routingProfiles;
367
- /**
368
- * Resolve the effective sidecar config for a (spec, tier) pair.
369
- *
370
- * Path-or-content resolution: each sidecar (`claude*`, `agents*`) is a
371
- * single "channel" — its `*Md` and `*MdContent` fields are tied together
372
- * and travel as a unit through the cascade. If the tier-level runtime
373
- * declares EITHER `claudeMd` or `claudeMdContent`, the tier owns the
374
- * channel and the top-level path/content is ignored (otherwise a tier
375
- * path override would silently lose to inherited inlined content, since
376
- * downstream consumers prefer Content over a path).
377
- *
378
- * Mode resolution: independent — a tier can set just `claudeMdMode` and
379
- * inherit the top-level path. Defaults to `overwrite` if neither layer
380
- * sets a mode. Modes are only meaningful when a path/content is present.
381
- */
382
- export declare function resolveSidecar(spec: PersonaSpec, tier: PersonaTier): {
383
- claudeMd?: string;
384
- claudeMdContent?: string;
385
- claudeMdMode: SidecarMdMode;
386
- agentsMd?: string;
387
- agentsMdContent?: string;
388
- agentsMdMode: SidecarMdMode;
389
- };
390
17
  export declare function resolvePersona(intent: PersonaIntent, profile?: RoutingProfile | RoutingProfileId): PersonaSelection;
391
18
  /**
392
19
  * Backward-compatible helper for callers that already selected a tier directly.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,0CAA2C,CAAC;AACvE,eAAO,MAAM,aAAa,4CAA6C,CAAC;AACxE,eAAO,MAAM,YAAY,iIAUf,CAAC;AACX,eAAO,MAAM,eAAe,ipBA+BlB,CAAC;AAEX,eAAO,MAAM,wBAAwB,uDAAwD,CAAC;AAE9F,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AACtD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AACzD,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;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