@aaac/runtime 0.2.7 → 0.2.9

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildNavigationContext,
3
3
  resolveNavigationSources
4
- } from "../../chunk-DEBCJKRX.js";
4
+ } from "../../chunk-CJLKKDKN.js";
5
5
  import "../../chunk-ET6TGQRT.js";
6
6
  import "../../chunk-Y7NORFFM.js";
7
7
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaac/runtime",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Runtime SDK for the AaaC toolchain",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -68,10 +68,10 @@
68
68
  "node": ">=22.0.0"
69
69
  },
70
70
  "dependencies": {
71
- "@aaac/contracts": "^0.2.7",
72
- "@aaac/observability": "^0.2.7",
73
- "@aaac/toolchain": "^0.2.7",
74
- "agent-contracts": "^0.35.1",
71
+ "@aaac/contracts": "^0.2.9",
72
+ "@aaac/observability": "^0.2.9",
73
+ "@aaac/toolchain": "^0.2.9",
74
+ "agent-contracts": "^0.35.9",
75
75
  "commander": "^12.1.0",
76
76
  "dotenv": "^17.4.2",
77
77
  "tsx": "^4.21.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/artifact-resolver.ts","../src/lib/dsl-context.ts","../src/lib/bound-resolver.ts","../src/lib/navigation-context.ts","../src/lib/claude-native/navigation-sources.ts"],"sourcesContent":["/**\n * Project artifact composition — the ONE place where the project manifest's\n * `artifacts:` contract (an artifact-contracts registry) is composed onto a\n * resolved agents DSL. Both the execution path (BoundResolver) and the\n * navigation-index path consume this; neither resolves the registry itself.\n *\n * Composition, not intersection (`docs/governance-layer-spec.md` §2.2: the\n * runtime joins every declared contract into one static DSL, and the\n * navigation-index is built from that join):\n *\n * - DSL artifact whose id the registry declares → the registry's concrete\n * data is merged over the component's default (upstream binding semantics).\n * - DSL artifact the registry does not declare → keeps its component default;\n * upstream reports `unbound-artifact`.\n * - Registry artifact no DSL artifact maps to → STILL a project artifact. It is\n * declared here so the binder merges and path-substitutes it exactly like the\n * mapped ones. Dropping it (the previous behaviour) meant an artifact the\n * project governs — including `authority: generated` ones — was invisible to\n * `@` completion and unprotected by the PreToolUse edit guard. This mirrors\n * `toolchains:`, whose registry entries are all composed in (bound-resolver).\n */\n\nimport { readFile } from \"node:fs/promises\";\nimport YAML from \"yaml\";\n\nexport interface ArtifactResolveOptions {\n dsl: Record<string, unknown>;\n artifactBinding?: {\n source: string;\n mappings?: Record<string, string>;\n };\n paths?: Record<string, string>;\n}\n\nexport interface ArtifactResolveResult {\n dsl: Record<string, unknown>;\n diagnostics: Array<{ path: string; message: string; severity: string }>;\n}\n\n/**\n * Read the `artifacts:` map from an artifact-contracts registry. Read/parse\n * failures are loud: the manifest named this file, so silently continuing would\n * present a component-default index as if it were the project's.\n */\nasync function loadArtifactRegistry(\n source: string,\n): Promise<Record<string, unknown>> {\n let content: string;\n try {\n content = await readFile(source, \"utf8\");\n } catch {\n throw new Error(\n `Failed to read artifact registry: ${source} ` +\n \"(declared by the project manifest's `artifacts:`).\",\n );\n }\n\n let parsed: unknown;\n try {\n parsed = YAML.parse(content);\n } catch (err) {\n throw new Error(\n `Invalid YAML in artifact registry ${source}: ${(err as Error).message}`,\n );\n }\n\n const document =\n typeof parsed === \"object\" && parsed !== null && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : undefined;\n const artifacts = document?.artifacts;\n if (artifacts && typeof artifacts === \"object\" && !Array.isArray(artifacts)) {\n return artifacts as Record<string, unknown>;\n }\n return {};\n}\n\nexport async function resolveArtifacts(\n options: ArtifactResolveOptions,\n): Promise<ArtifactResolveResult> {\n if (!options.artifactBinding) {\n return { dsl: options.dsl, diagnostics: [] };\n }\n\n const { resolveArtifactBinding } = await import(\"agent-contracts\");\n const registry = await loadArtifactRegistry(options.artifactBinding.source);\n const dslArtifacts = (options.dsl.artifacts ?? {}) as Record<string, unknown>;\n const mappings = options.artifactBinding.mappings;\n\n // Registry ids that no DSL artifact resolves to (directly or via `mappings`)\n // are declared as empty artifacts so the binder produces them from the\n // registry — one code path for every artifact, mapped or composed. Ids that ARE\n // claimed by a DSL artifact are left alone, so a mapping collision still\n // surfaces upstream's `orphan-binding` instead of vanishing.\n const claimed = new Set(\n Object.keys(dslArtifacts).map((id) => mappings?.[id] ?? id),\n );\n const composed = Object.keys(registry).filter(\n (id) => !claimed.has(id) && !(id in dslArtifacts),\n );\n\n const bound = resolveArtifactBinding(\n {\n ...Object.fromEntries(composed.map((id) => [id, {}])),\n ...dslArtifacts,\n },\n { artifacts: registry },\n mappings,\n options.paths,\n );\n\n return {\n dsl: { ...options.dsl, artifacts: bound.artifacts },\n diagnostics: bound.diagnostics.map((d) => ({\n path: d.rule,\n message: d.message,\n severity: d.severity,\n })),\n };\n}\n","/**\n * Runtime DSL Context — builds WorkflowRegistries from embedded DSL data,\n * optionally merging with project-level DSL extensions.\n *\n * Default flow:\n * CLI binary embeds resolved DSL data (from code generation) →\n * loadDslContext() builds registries from it.\n *\n * Extended flow:\n * Project provides a DSL that extends/overrides the embedded base →\n * loadDslContext() merges via agent-contracts' mergeDsl() →\n * builds registries from the merged result.\n */\n\nimport { readFile } from \"node:fs/promises\";\nimport type { z } from \"zod\";\nimport YAML from \"yaml\";\nimport {\n expandDslSection,\n readDslExtension,\n type DslSectionLike,\n type ExpandedDslSection,\n} from \"@aaac/contracts\";\nimport type { WorkflowRegistries, WorkflowContractLike, WorkflowStep, DelegateStep } from \"./workflow-runner.js\";\nimport type { AgentContractLike, TaskContractLike } from \"./task-runner.js\";\nimport type { ModelClass } from \"./model-resolver.js\";\nimport { jsonSchemaToZod } from \"./schema-converter.js\";\nimport type { GuardrailRule, GuardrailRuleData } from \"./guardrail-hooks.js\";\n\n// ---------------------------------------------------------------------------\n// Public types\n// ---------------------------------------------------------------------------\n\nexport interface LoadDslOptions {\n /**\n * Pre-resolved DSL data embedded in the CLI binary.\n * Produced by the code generator alongside TypeScript contracts.\n * This is the default DSL — used as-is when no project extension exists.\n */\n embeddedDsl: Record<string, unknown>;\n\n /**\n * Path to a project-level DSL file that extends/overrides the embedded DSL.\n * When provided, the project DSL is resolved (including its own extends chain)\n * and merged with embeddedDsl via mergeDsl().\n */\n projectDslPath?: string;\n\n /** Entities the CLI depends on — validated after merge. */\n requiredEntities?: RequiredEntities;\n}\n\nexport interface RequiredEntities {\n workflows?: string[];\n tasks?: string[];\n}\n\nexport interface DslContext {\n readonly registries: WorkflowRegistries;\n readonly dsl: Record<string, unknown>;\n}\n\n// ---------------------------------------------------------------------------\n// Errors\n// ---------------------------------------------------------------------------\n\nexport class DslValidationError extends Error {\n readonly missing: string[];\n constructor(missing: string[]) {\n super(\n \"Required entities missing after DSL merge:\\n\" +\n missing.map((m) => ` - ${m}`).join(\"\\n\"),\n );\n this.name = \"DslValidationError\";\n this.missing = missing;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Internal: build registries from resolved DSL\n// ---------------------------------------------------------------------------\n\n/**\n * Resolved DSL → the runtime's agent contracts.\n *\n * The single normalization point for a DSL agent, shared by the execution path\n * (`loadDslContext`) and every generator that has to reason about agents:\n * `claude-materialize/workflow-render.ts` (delegate prompts) and\n * `claude-materialize/agent-render.ts` (`.claude/agents/*.md`, #272).\n *\n * Being the single point makes it the single place a declaration can be dropped,\n * and five were: `anti_patterns`, `escalation_criteria`, `x-authority`,\n * `x-audit-checklist` and `sections` were read by nothing here, so every Claude\n * surface — the in-process system prompt, the SDK candidate agents, the\n * `.claude/agents/*.md` files — was structurally unable to carry them however\n * its renderer was written, while the Cursor binding rendered all five (#349).\n *\n * It takes the WHOLE DSL, not the `agents:` map: a `sections[]` entry may name a\n * list the document holds (`list: agents`, `list: workflow`) instead of carrying\n * prose, so expanding one needs the document. Required rather than optional so\n * that expansion cannot be half-done depending on the caller.\n *\n * `mode` normalization is fail-safe on purpose: only the exact string\n * `read-write` yields `read-write`, so an undeclared, unknown or misspelled mode\n * degrades to `read-only` and can never widen an agent's tool grant\n * (see `claude-tool-grants.ts`). `mode` is therefore also independent of\n * `dispatch_only`: an agent declaring only the latter is a `read-only` agent\n * that dispatches, and both facts survive on their own.\n *\n * The two `x-` prefixed declarations go through `readDslExtension`\n * (@aaac/contracts) rather than a subscript, so the unprefixed spelling an author\n * reaches for is read here instead of being dropped in silence — which is how an\n * agent set authored with `audit_checklist` rendered, exit 0 and stderr empty,\n * missing every checklist it declared (#357). That module owns why the prefix is\n * required at all; the contract fields it populates stay plain.\n */\nexport function buildAgentRegistry(\n dsl: Record<string, unknown>,\n): Record<string, AgentContractLike> {\n const agents = (dsl.agents as Record<string, Record<string, unknown>>) ?? {};\n const registry: Record<string, AgentContractLike> = {};\n for (const [id, agent] of Object.entries(agents)) {\n const rawMode = (agent.mode as string) ?? \"read-only\";\n const mode: \"read-write\" | \"read-only\" = rawMode === \"read-write\" ? \"read-write\" : \"read-only\";\n const authority = readDslExtension(agent, \"x-authority\") as\n | { can_decide?: string[]; cannot_decide?: string[] }\n | undefined;\n registry[id] = {\n id,\n role_name: (agent.role_name as string) ?? id,\n purpose: (agent.purpose as string) ?? \"\",\n description: readDslExtension(agent, \"x-description\") as string | undefined,\n mode,\n responsibilities: (agent.responsibilities as string[]) ?? [],\n constraints: (agent.constraints as string[]) ?? [],\n rules: (agent.rules as Array<{ id: string; description: string; severity: string }>) ?? [],\n can_invoke_agents: (agent.can_invoke_agents as string[]) ?? undefined,\n can_execute_tools: (agent.can_execute_tools as string[]) ?? undefined,\n dispatch_only: (agent.dispatch_only as boolean) ?? undefined,\n can_read_artifacts: (agent.can_read_artifacts as string[]) ?? [],\n can_write_artifacts: (agent.can_write_artifacts as string[]) ?? [],\n can_return_handoffs: (agent.can_return_handoffs as string[]) ?? [],\n can_perform_validations: (agent.can_perform_validations as string[]) ?? [],\n anti_patterns: (agent.anti_patterns as string[]) ?? [],\n escalation_criteria:\n (agent.escalation_criteria as Array<{ condition: string; action: string }>) ?? [],\n authority,\n audit_checklist:\n (readDslExtension(agent, \"x-audit-checklist\") as Array<{\n section: string;\n checks: string[];\n }>) ?? [],\n sections: ((agent.sections as DslSectionLike[]) ?? [])\n .map((section) => expandDslSection(section, dsl))\n .filter((section): section is ExpandedDslSection => section !== undefined),\n };\n }\n return registry;\n}\n\nfunction buildTaskRegistry(\n tasks: Record<string, Record<string, unknown>>,\n): Record<string, TaskContractLike> {\n const registry: Record<string, TaskContractLike> = {};\n for (const [id, task] of Object.entries(tasks)) {\n registry[id] = {\n id,\n description: (task.description as string) ?? \"\",\n target_agent: (task.target_agent as string) ?? \"\",\n result_handoff: (task.result_handoff as string) ?? \"\",\n completion_criteria: (task.completion_criteria as string[]) ?? [],\n model_class: task.model_class as ModelClass | undefined,\n };\n }\n return registry;\n}\n\n/**\n * Raw DSL workflow step → the runtime's step types. The single point where a\n * step's DSL spelling is read, so it is also where this runtime's own step\n * vocabulary is named.\n *\n * `x-optional`, `x-instruction` and `x-receives` are that vocabulary: nothing in\n * `agent-contracts`' `WorkflowStepSchema` declares them, and its validator\n * reports every undeclared property that is not `x-` prefixed as a blocking\n * `unknown-property` diagnostic — the mechanism that tells a project's own\n * extension apart from a misspelled schema field. Spelled without the prefix\n * they worked (the schema is passthrough) while making the DSL that used them\n * fail its own validation: the example shipped 14 such diagnostics (#324).\n *\n * The `DelegateStep` fields they populate keep their plain names — the prefix is\n * a fact about the DSL document, not about this runtime's interfaces. Which\n * spellings of a step's declaration reach those fields is `readDslExtension`'s\n * one answer (@aaac/contracts), shared with the agent registry above and with\n * the Cursor binding: #324 named the prefix but left the unprefixed spelling\n * silently discarded rather than read and reported (#357).\n */\nfunction buildWorkflowStep(step: Record<string, unknown>): WorkflowStep {\n if (step.type === \"gate\") {\n return {\n type: \"gate\" as const,\n gate_kind: (step.gate_kind as string) ?? \"\",\n description: (step.description as string) ?? \"\",\n depends_on: step.depends_on as readonly string[] | undefined,\n };\n }\n if (step.type === \"evaluate\") {\n return {\n type: \"evaluate\" as const,\n task: (step.task as string) ?? \"\",\n from_agent: (step.from_agent as string) ?? \"\",\n evaluator_agent: step.evaluator_agent as string | undefined,\n description: step.description as string | undefined,\n loop_to: (step.loop_to as string) ?? \"\",\n max_iterations: (step.max_iterations as number) ?? 1,\n inject_as: step.inject_as as string | undefined,\n on_exhausted: step.on_exhausted as \"abort\" | \"fail_partial\" | \"escalate\" | undefined,\n depends_on: step.depends_on as readonly string[] | undefined,\n };\n }\n return {\n type: \"delegate\" as const,\n task: (step.task as string) ?? \"\",\n from_agent: (step.from_agent as string) ?? \"\",\n description: (step.description as string) ?? \"\",\n optional: (readDslExtension(step, \"x-optional\") as boolean) ?? false,\n max_retries: (step.max_retries as number) ?? 0,\n max_follow_ups: step.max_follow_ups as number | undefined,\n depends_on: step.depends_on as readonly string[] | undefined,\n instruction: readDslExtension(step, \"x-instruction\") as string | undefined,\n receives: readDslExtension(step, \"x-receives\") as DelegateStep[\"receives\"],\n retry: step.retry as { condition: string; fix_task: string; revalidate_task?: string } | undefined,\n };\n}\n\nfunction buildWorkflowRegistry(\n workflows: Record<string, Record<string, unknown>>,\n): Record<string, WorkflowContractLike> {\n const registry: Record<string, WorkflowContractLike> = {};\n for (const [id, wf] of Object.entries(workflows)) {\n const steps = ((wf.steps as Record<string, unknown>[]) ?? []).map(buildWorkflowStep);\n registry[id] = { id, description: (wf.description as string) ?? \"\", steps };\n }\n return registry;\n}\n\nfunction buildHandoffSchemas(\n handoffTypes: Record<string, Record<string, unknown>>,\n): Record<string, z.ZodType> {\n const schemas: Record<string, z.ZodType> = {};\n for (const [id, ht] of Object.entries(handoffTypes)) {\n const schema = ht.schema as Record<string, unknown> | undefined;\n if (schema) {\n schemas[id] = jsonSchemaToZod(schema);\n }\n }\n return schemas;\n}\n\n// ---------------------------------------------------------------------------\n// Build registries from a resolved DSL object\n// ---------------------------------------------------------------------------\n\nexport function buildRegistriesFromDsl(\n dsl: Record<string, unknown>,\n): WorkflowRegistries {\n const tasks = (dsl.tasks as Record<string, Record<string, unknown>>) ?? {};\n const workflows = (dsl.workflow as Record<string, Record<string, unknown>>) ?? {};\n const handoffTypes = (dsl.handoff_types as Record<string, Record<string, unknown>>) ?? {};\n\n return {\n agentRegistry: buildAgentRegistry(dsl),\n taskRegistry: buildTaskRegistry(tasks),\n workflowRegistry: buildWorkflowRegistry(workflows),\n handoffSchemas: buildHandoffSchemas(handoffTypes),\n };\n}\n\n// ---------------------------------------------------------------------------\n// Validation\n// ---------------------------------------------------------------------------\n\nfunction validateRequiredEntities(\n dsl: Record<string, unknown>,\n required: RequiredEntities,\n): void {\n const missing: string[] = [];\n\n const workflows = (dsl.workflow as Record<string, unknown>) ?? {};\n const tasks = (dsl.tasks as Record<string, unknown>) ?? {};\n const handoffTypes = (dsl.handoff_types as Record<string, unknown>) ?? {};\n\n if (required.workflows) {\n for (const wfId of required.workflows) {\n if (!(wfId in workflows)) {\n missing.push(`workflow \"${wfId}\" is required by the CLI but not found in the resolved DSL`);\n }\n }\n }\n\n if (required.tasks) {\n for (const taskId of required.tasks) {\n if (!(taskId in tasks)) {\n missing.push(`task \"${taskId}\" is required by the CLI but not found in the resolved DSL`);\n continue;\n }\n const task = tasks[taskId] as Record<string, unknown>;\n const invHandoff = task.invocation_handoff as string | undefined;\n const resHandoff = task.result_handoff as string | undefined;\n if (invHandoff && !(invHandoff in handoffTypes)) {\n missing.push(`handoff_type \"${invHandoff}\" (invocation_handoff of task \"${taskId}\") not found`);\n }\n if (resHandoff && !(resHandoff in handoffTypes)) {\n missing.push(`handoff_type \"${resHandoff}\" (result_handoff of task \"${taskId}\") not found`);\n }\n }\n }\n\n if (required.workflows) {\n for (const wfId of required.workflows) {\n if (!(wfId in workflows)) continue;\n const wf = workflows[wfId] as Record<string, unknown>;\n const steps = (wf.steps as Array<Record<string, unknown>>) ?? [];\n for (const step of steps) {\n if (step.type !== \"delegate\") continue;\n const taskId = step.task as string;\n if (taskId && taskId in tasks) {\n const task = tasks[taskId] as Record<string, unknown>;\n const resHandoff = task.result_handoff as string | undefined;\n if (resHandoff && !(resHandoff in handoffTypes)) {\n missing.push(`handoff_type \"${resHandoff}\" (result of task \"${taskId}\" in workflow \"${wfId}\") not found`);\n }\n }\n }\n }\n }\n\n if (missing.length > 0) {\n throw new DslValidationError(missing);\n }\n}\n\n// ---------------------------------------------------------------------------\n// Main API\n// ---------------------------------------------------------------------------\n\n/**\n * Build a DslContext from embedded DSL data, optionally merging with\n * a project-level DSL extension.\n *\n * Default (no projectDslPath):\n * Builds registries directly from embeddedDsl — no filesystem access.\n *\n * Extended (with projectDslPath):\n * Resolves the project DSL from filesystem, merges it over embeddedDsl\n * via agent-contracts' mergeDsl(), then builds registries from the result.\n */\nexport async function loadDslContext(\n options: LoadDslOptions,\n): Promise<DslContext> {\n let dsl: Record<string, unknown>;\n\n if (options.projectDslPath) {\n const { resolve: resolveDsl, mergeDsl, expandDefaults } = await import(\"agent-contracts\");\n const raw = await readFile(options.projectDslPath, \"utf8\");\n const document: unknown = YAML.parse(raw);\n if (typeof document !== \"object\" || document === null || Array.isArray(document)) {\n throw new Error(`${options.projectDslPath} is not a DSL document (expected a YAML mapping)`);\n }\n const projectData = document as Record<string, unknown>;\n\n if (projectData.extends === \"/$embedded/\") {\n const { extends: _extends, ...projectOverrides } = projectData;\n const merged = mergeDsl(options.embeddedDsl, projectOverrides);\n dsl = expandDefaults(merged);\n } else {\n const projectResult = await resolveDsl(options.projectDslPath);\n const merged = mergeDsl(options.embeddedDsl, projectResult.data);\n dsl = expandDefaults(merged);\n }\n } else {\n dsl = options.embeddedDsl;\n }\n\n if (options.requiredEntities) {\n validateRequiredEntities(dsl, options.requiredEntities);\n }\n\n const registries = buildRegistriesFromDsl(dsl);\n\n return { registries, dsl };\n}\n","/**\n * BoundResolver — runtime binding + policy resolution with per-agent isolation.\n *\n * Resolves artifact composition and guardrail/policy in one pass at runtime,\n * producing a per-agent scoped ResolvedComponent. Reuses existing\n * resolveArtifacts(), buildGuardrailContext(), and agent scope resolution.\n */\n\nimport { readFile } from \"node:fs/promises\";\nimport { dirname, resolve as resolvePath } from \"node:path\";\nimport { parseComponentFile } from \"@aaac/contracts\";\nimport YAML from \"yaml\";\nimport { buildGuardrailContext, type GuardrailCheckEntry, type GuardrailContext } from \"../generator/context.js\";\nimport { resolveArtifacts } from \"./artifact-resolver.js\";\nimport { buildRegistriesFromDsl } from \"./dsl-context.js\";\nimport type { GuardrailRuleData } from \"./guardrail-hooks.js\";\nimport type { WorkflowRegistries } from \"./workflow-runner.js\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface ArtifactBindingConfig {\n source: string;\n mappings?: Record<string, string>;\n}\n\nexport interface BoundResolveOptions {\n /** Component identifier — used for cache keying. */\n id: string;\n /** Pre-resolved DSL (e.g. embedded from codegen). */\n embeddedDsl?: Record<string, unknown>;\n /** Path to DSL file — resolved via agent-contracts when no embeddedDsl. */\n dslPath?: string;\n /** Paths to software binding YAML files (guardrail_impl, etc.). */\n bindingPaths?: string[];\n /** Active guardrail policy name from DSL guardrail_policies. */\n activeGuardrailPolicy?: string;\n /** Artifact binding config — composed via resolveArtifacts() (lib/artifact-resolver). */\n artifactBinding?: ArtifactBindingConfig;\n /** Path substitutions for artifact binding. */\n paths?: Record<string, string>;\n /** Path to toolchain-contracts.yaml. */\n toolchainContractsPath?: string;\n}\n\nexport interface ResolvedToolchain {\n id: string;\n kind: \"library\" | \"cli\" | \"component\";\n description?: string;\n module?: string;\n command?: string;\n cli_contract?: string;\n component_contract?: string;\n /**\n * `info.id` of the component `component_contract` names, or undefined when\n * the toolchain names no component.\n *\n * `component_contract` is a path relative to the toolchain-contracts file, so\n * this is the only layer that can turn it into an identity — and the identity\n * is what says whose namespace `operations` is written in (see\n * `component-scope.ts`).\n */\n componentId?: string;\n artifacts: { consumes: string[]; produces: string[] };\n operations?: string[];\n source: \"toolchain-contracts\" | \"agent-contracts\" | \"merged\";\n}\n\nexport interface ResolvedComponent {\n id: string;\n dsl: Record<string, unknown>;\n registries: WorkflowRegistries;\n guardrails: {\n perAgent: Map<string, GuardrailRuleData>;\n };\n diagnostics: Array<{ path?: string; message: string; severity?: string }>;\n toolchains?: Record<string, ResolvedToolchain>;\n toolchainsByAgent?: Map<string, ResolvedToolchain[]>;\n}\n\n// ---------------------------------------------------------------------------\n// Guardrail scope helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Effective guardrail IDs for an agent: entity-side bindings ∪ scope-side bindings.\n */\nexport function getEffectiveGuardrailIds(\n dsl: Record<string, unknown>,\n agentId: string,\n): Set<string> {\n const ids = new Set<string>();\n\n const agents = (dsl.agents ?? {}) as Record<string, Record<string, unknown>>;\n const agent = agents[agentId];\n if (agent) {\n for (const ref of (agent.guardrails as string[]) ?? []) {\n ids.add(ref);\n }\n }\n\n const guardrails = (dsl.guardrails ?? {}) as Record<\n string,\n { scope?: { agents?: string[] } }\n >;\n for (const [guardrailId, guardrail] of Object.entries(guardrails)) {\n if (guardrail.scope?.agents?.includes(agentId)) {\n ids.add(guardrailId);\n }\n }\n\n return ids;\n}\n\nfunction guardrailCheckToCommandRule(c: GuardrailCheckEntry) {\n return {\n guardrail_id: c.guardrail_id,\n pattern: c.pattern,\n action: c.action as GuardrailRuleData[\"commandRules\"][number][\"action\"],\n message: c.message,\n };\n}\n\nfunction guardrailCheckToFileRule(c: GuardrailCheckEntry) {\n return {\n guardrail_id: c.guardrail_id,\n pattern: c.pattern,\n action: c.action as GuardrailRuleData[\"fileRules\"][number][\"action\"],\n message: c.message,\n ...(c.exclude_glob ? { exclude_glob: c.exclude_glob } : {}),\n };\n}\n\nfunction guardrailCheckToContentRule(c: GuardrailCheckEntry) {\n return {\n guardrail_id: c.guardrail_id,\n pattern: c.pattern,\n action: c.action as GuardrailRuleData[\"contentRules\"][number][\"action\"],\n message: c.message,\n ...(c.file_glob ? { file_glob: c.file_glob } : {}),\n ...(c.exclude_glob ? { exclude_glob: c.exclude_glob } : {}),\n };\n}\n\nexport function guardrailContextToRuleData(\n ctx: GuardrailContext,\n effectiveIds?: Set<string>,\n): GuardrailRuleData {\n const filter = (checks: GuardrailCheckEntry[]) =>\n effectiveIds ? checks.filter((c) => effectiveIds.has(c.guardrail_id)) : checks;\n\n return {\n commandRules: filter(ctx.commandChecks).map(guardrailCheckToCommandRule),\n fileRules: filter(ctx.fileChecks).map(guardrailCheckToFileRule),\n contentRules: filter(ctx.contentChecks).map(guardrailCheckToContentRule),\n };\n}\n\nexport function buildPerAgentGuardrails(\n dsl: Record<string, unknown>,\n guardrailCtx: GuardrailContext,\n): Map<string, GuardrailRuleData> {\n const perAgent = new Map<string, GuardrailRuleData>();\n const agents = (dsl.agents ?? {}) as Record<string, unknown>;\n\n for (const agentId of Object.keys(agents)) {\n const effectiveIds = getEffectiveGuardrailIds(dsl, agentId);\n const rules = guardrailContextToRuleData(guardrailCtx, effectiveIds);\n if (hasGuardrailRules(rules)) {\n perAgent.set(agentId, rules);\n }\n }\n\n return perAgent;\n}\n\nconst EMPTY_GUARDRAIL_CONTEXT: GuardrailContext = {\n commandChecks: [],\n fileChecks: [],\n contentChecks: [],\n allChecks: [],\n hasGuardrails: false,\n diagnostics: [],\n};\n\n/**\n * Resolve the guardrail context from a DSL + its software bindings — the ONE\n * place `guardrail_impl` matchers become checks. The CLI execution path and the\n * navigation-index/hook path both call this, so the hooks enforce exactly what\n * `dev-team guard list` reports (#267).\n *\n * Checks from EVERY binding file are merged: `bindings.guardrail` is a list, and\n * overwriting per file silently dropped all but the last one (#268).\n */\nexport async function resolveGuardrailContext(\n dsl: Record<string, unknown>,\n bindingPaths?: string[],\n activeGuardrailPolicy?: string,\n options?: {\n /**\n * Ignore binding paths that do not exist. The `guard` CLI commands report on\n * whatever is present (a not-yet-created binding is not a failure); the\n * execution path wants the missing file to surface.\n */\n skipMissing?: boolean;\n },\n): Promise<GuardrailContext> {\n if (!bindingPaths || bindingPaths.length === 0) {\n return EMPTY_GUARDRAIL_CONTEXT;\n }\n\n const merged: GuardrailContext = {\n commandChecks: [],\n fileChecks: [],\n contentChecks: [],\n allChecks: [],\n hasGuardrails: false,\n diagnostics: [],\n };\n\n // Policy findings are project-level, so every binding file reports the same\n // ones; keep one copy of each.\n const seenDiagnostics = new Set<string>();\n\n for (const bindingPath of bindingPaths) {\n let raw: string;\n try {\n raw = await readFile(bindingPath, \"utf8\");\n } catch (err) {\n if (options?.skipMissing && (err as NodeJS.ErrnoException).code === \"ENOENT\") continue;\n throw err;\n }\n const document: unknown = YAML.parse(raw);\n if (typeof document !== \"object\" || document === null || Array.isArray(document)) {\n throw new Error(`${bindingPath} is not a binding document (expected a YAML mapping)`);\n }\n const binding = document as Record<string, unknown>;\n const ctx = buildGuardrailContext(dsl, binding, activeGuardrailPolicy);\n merged.commandChecks.push(...ctx.commandChecks);\n merged.fileChecks.push(...ctx.fileChecks);\n merged.contentChecks.push(...ctx.contentChecks);\n merged.allChecks.push(...ctx.allChecks);\n merged.hasGuardrails = merged.hasGuardrails || ctx.hasGuardrails;\n for (const diagnostic of ctx.diagnostics) {\n const key = `${diagnostic.path} :: ${diagnostic.message}`;\n if (seenDiagnostics.has(key)) continue;\n seenDiagnostics.add(key);\n merged.diagnostics.push(diagnostic);\n }\n }\n\n return merged;\n}\n\nfunction hasGuardrailRules(rules: GuardrailRuleData): boolean {\n return (\n rules.commandRules.length > 0 ||\n rules.fileRules.length > 0 ||\n rules.contentRules.length > 0\n );\n}\n\n// ---------------------------------------------------------------------------\n// Toolchain derivation — types for dynamic import from @aaac/toolchain\n// ---------------------------------------------------------------------------\n\ninterface ToolchainDSLEntry {\n kind: \"library\" | \"cli\" | \"component\";\n description?: string;\n module?: string;\n command?: string;\n cli_contract?: string;\n component_contract?: string;\n artifacts: { consumes: string[]; produces: string[] };\n operations?: string[];\n}\n\ninterface ToolchainContractsDSLShape {\n toolchains: Record<string, ToolchainDSLEntry>;\n}\n\ninterface ToolchainModule {\n loadToolchainContracts(filePath: string): Promise<ToolchainContractsDSLShape>;\n}\n\n/**\n * Identity of the component a toolchain names — read with the contracts\n * package's own reader, so a `component_contract` is parsed here exactly as it\n * is everywhere else.\n *\n * A path that names nothing readable is a broken declaration and says so. The\n * field had no reader at all before #335, which is why one could point anywhere\n * (two fixtures pointed at files that were never written) and stay green.\n */\nasync function readComponentId(\n componentPath: string,\n toolchainId: string,\n): Promise<string> {\n try {\n return (await parseComponentFile(componentPath)).info.id;\n } catch (err) {\n throw new Error(\n `Toolchain \"${toolchainId}\" declares component_contract \"${componentPath}\", ` +\n `which cannot be read as a component contract: ${(err as Error).message}`,\n { cause: err },\n );\n }\n}\n\nfunction mergeDerivedWithAgentTools(\n derivedTools: ResolvedToolchain[],\n agentToolIds: string[],\n allToolchains: Record<string, ResolvedToolchain>,\n): ResolvedToolchain[] {\n const merged = new Map<string, ResolvedToolchain>();\n\n for (const tc of derivedTools) {\n merged.set(tc.id, tc);\n }\n\n for (const toolId of agentToolIds) {\n if (!merged.has(toolId)) {\n if (allToolchains[toolId]) {\n merged.set(toolId, { ...allToolchains[toolId], source: \"merged\" });\n }\n } else {\n const existing = merged.get(toolId)!;\n merged.set(toolId, { ...existing, source: \"merged\" });\n }\n }\n\n return Array.from(merged.values());\n}\n\nexport function deriveToolchainsForAgents(\n dsl: Record<string, unknown>,\n toolchains: Record<string, ResolvedToolchain>,\n): Map<string, ResolvedToolchain[]> {\n const result = new Map<string, ResolvedToolchain[]>();\n const agents = (dsl.agents ?? {}) as Record<string, Record<string, unknown>>;\n\n for (const [agentId, agent] of Object.entries(agents)) {\n const derivedTools: ResolvedToolchain[] = [];\n\n const canReadArtifacts = (agent.can_read_artifacts ?? []) as string[];\n const canWriteArtifacts = (agent.can_write_artifacts ?? []) as string[];\n const agentArtifacts = agent.artifacts as\n | { produces?: string[]; consumes?: string[] }\n | undefined;\n const readArtifacts = new Set([\n ...canReadArtifacts,\n ...(agentArtifacts?.consumes ?? []),\n ]);\n const writeArtifacts = new Set([\n ...canWriteArtifacts,\n ...(agentArtifacts?.produces ?? []),\n ]);\n\n for (const tc of Object.values(toolchains)) {\n let matched = false;\n\n for (const artifactId of tc.artifacts.consumes) {\n if (readArtifacts.has(artifactId) || writeArtifacts.has(artifactId)) {\n matched = true;\n break;\n }\n }\n\n if (!matched) {\n for (const artifactId of tc.artifacts.produces) {\n if (writeArtifacts.has(artifactId)) {\n matched = true;\n break;\n }\n }\n }\n\n if (matched) {\n derivedTools.push(tc);\n }\n }\n\n if (derivedTools.length > 0) {\n const agentTools = (agent.can_execute_tools ?? []) as string[];\n const mergedTools = mergeDerivedWithAgentTools(\n derivedTools,\n agentTools,\n toolchains,\n );\n result.set(agentId, mergedTools);\n }\n }\n\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// BoundResolver\n// ---------------------------------------------------------------------------\n\nexport class BoundResolver {\n private readonly cache = new Map<string, ResolvedComponent>();\n\n /**\n * Resolve binding + policy in one pass. Results are cached by component id.\n */\n async resolve(opts: BoundResolveOptions): Promise<ResolvedComponent> {\n const cached = this.cache.get(opts.id);\n if (cached) return cached;\n\n const diagnostics: ResolvedComponent[\"diagnostics\"] = [];\n let dsl: Record<string, unknown>;\n\n if (opts.embeddedDsl) {\n dsl = opts.embeddedDsl;\n } else if (opts.dslPath) {\n const { resolve: resolveDsl } = await import(\"agent-contracts\");\n const result = await resolveDsl(opts.dslPath);\n dsl = result.data;\n } else {\n throw new Error(\"BoundResolver.resolve requires embeddedDsl or dslPath\");\n }\n\n // Artifact composition (the shared seam — see lib/artifact-resolver.ts)\n if (opts.artifactBinding) {\n const bound = await resolveArtifacts({\n dsl,\n artifactBinding: opts.artifactBinding,\n paths: opts.paths,\n });\n dsl = bound.dsl;\n diagnostics.push(...bound.diagnostics);\n }\n\n // Guardrail + policy from bindings\n let guardrailCtx: GuardrailContext;\n\n guardrailCtx = await resolveGuardrailContext(\n dsl,\n opts.bindingPaths,\n opts.activeGuardrailPolicy,\n );\n diagnostics.push(...guardrailCtx.diagnostics);\n\n const perAgent = guardrailCtx.hasGuardrails\n ? buildPerAgentGuardrails(dsl, guardrailCtx)\n : new Map<string, GuardrailRuleData>();\n\n let toolchains: Record<string, ResolvedToolchain> | undefined;\n let toolchainsByAgent: Map<string, ResolvedToolchain[]> | undefined;\n\n if (opts.toolchainContractsPath) {\n const toolchainPkg = \"@aaac/toolchain\";\n const mod = (await import(/* webpackIgnore: true */ toolchainPkg)) as ToolchainModule;\n const tcDoc = await mod.loadToolchainContracts(opts.toolchainContractsPath);\n const toolchainDir = dirname(resolvePath(opts.toolchainContractsPath));\n\n toolchains = {};\n for (const [id, tc] of Object.entries(tcDoc.toolchains) as Array<[string, ToolchainDSLEntry]>) {\n toolchains[id] = {\n id,\n kind: tc.kind,\n description: tc.description,\n module: tc.module,\n command: tc.command,\n cli_contract: tc.cli_contract,\n component_contract: tc.component_contract,\n ...(tc.component_contract\n ? {\n componentId: await readComponentId(\n resolvePath(toolchainDir, tc.component_contract),\n id,\n ),\n }\n : {}),\n artifacts: {\n consumes: [...tc.artifacts.consumes],\n produces: [...tc.artifacts.produces],\n },\n operations: tc.operations ? [...tc.operations] : undefined,\n source: \"toolchain-contracts\",\n };\n }\n\n toolchainsByAgent = deriveToolchainsForAgents(dsl, toolchains);\n }\n\n const component: ResolvedComponent = {\n id: opts.id,\n dsl,\n registries: buildRegistriesFromDsl(dsl),\n guardrails: { perAgent },\n diagnostics,\n ...(toolchains ? { toolchains } : {}),\n ...(toolchainsByAgent ? { toolchainsByAgent } : {}),\n };\n\n this.cache.set(opts.id, component);\n return component;\n }\n\n /** Clear cached components (e.g. for testing). */\n clearCache(): void {\n this.cache.clear();\n }\n}\n\n/** Get guardrail rules for a specific agent from a ResolvedComponent. */\nexport function getGuardrailRulesForAgent(\n component: ResolvedComponent,\n agentId: string,\n): GuardrailRuleData | undefined {\n const perAgent = component.guardrails.perAgent.get(agentId);\n return perAgent && hasGuardrailRules(perAgent) ? perAgent : undefined;\n}\n","import { findMisspelledDslExtensions } from \"@aaac/contracts\";\nimport { resolveArtifacts } from \"./artifact-resolver.js\";\nimport {\n guardrailContextToRuleData,\n resolveGuardrailContext,\n} from \"./bound-resolver.js\";\nimport { loadDslContext } from \"./dsl-context.js\";\nimport type { GuardrailRuleData } from \"./guardrail-hooks.js\";\n\nexport interface NavigationContextOptions {\n configPath?: string;\n embeddedDsl?: Record<string, unknown>;\n projectDslPath?: string;\n artifactBinding?: {\n source: string;\n mappings?: Record<string, string>;\n };\n paths?: Record<string, string>;\n /**\n * Software binding files (`guardrail_impl`) from the project manifest's\n * `bindings.guardrail`. Without them the hooks enforce NO Bash guardrails\n * while the CLI enforces the project's — the asymmetry behind #267.\n */\n bindingPaths?: string[];\n /** Active guardrail policy name from the manifest. */\n activeGuardrailPolicy?: string;\n}\n\nexport interface NavigationContext {\n dsl: Record<string, unknown>;\n navigationIndex: Record<string, unknown>;\n /**\n * Guardrail rules resolved from the DSL + the project's software bindings.\n *\n * The navigation-index does not carry guardrail rules (it is an\n * artifact/tool graph), so they are surfaced separately here for the\n * PreToolUse Bash guardrail path (#238 / C5). `undefined` when the project\n * declares no guardrail binding.\n */\n guardrailRules?: GuardrailRuleData;\n diagnostics: Array<{ path: string; message: string; severity: string }>;\n}\n\n/**\n * Resolve the navigation sources of ONE project root into its effective DSL:\n * the component's bundled `/$embedded/` DSL overlaid with the project's\n * `agents:` DSL when the manifest declares one.\n *\n * Split out of `buildNavigationContext` because the `.claude/agents/*.md`\n * emitter needs exactly this — per workspace member — without building a\n * navigation index or resolving guardrails (#272). One definition, two callers.\n */\nexport async function resolveNavigationDsl(\n options: Pick<NavigationContextOptions, \"embeddedDsl\" | \"projectDslPath\">,\n): Promise<Record<string, unknown>> {\n if (options.embeddedDsl != null) {\n if (options.projectDslPath) {\n const ctx = await loadDslContext({\n embeddedDsl: options.embeddedDsl,\n projectDslPath: options.projectDslPath,\n });\n return ctx.dsl;\n }\n return options.embeddedDsl;\n }\n if (options.projectDslPath) {\n // No embedded DSL: resolve the project DSL file directly\n const { resolve } = await import(\"agent-contracts\");\n const result = await resolve(options.projectDslPath);\n return result.data;\n }\n throw new Error(\"resolveNavigationDsl requires embeddedDsl or projectDslPath\");\n}\n\nexport async function buildNavigationContext(\n options: NavigationContextOptions,\n): Promise<NavigationContext> {\n const diagnostics: NavigationContext[\"diagnostics\"] = [];\n let dsl = await resolveNavigationDsl(options);\n\n if (options.artifactBinding) {\n const bound = await resolveArtifacts({\n dsl,\n artifactBinding: options.artifactBinding,\n paths: options.paths,\n });\n dsl = bound.dsl;\n diagnostics.push(...bound.diagnostics);\n }\n\n const { validateSchema, buildNavigationIndex } = await import(\"agent-contracts\");\n const validation = validateSchema(dsl);\n const schemaDiagnostics = validation.diagnostics.map((d) => ({\n path: d.path,\n message: d.message,\n severity: d.severity ?? \"error\",\n }));\n diagnostics.push(...schemaDiagnostics);\n\n // Why an extension spelled without its `x-` prefix is reported HERE, on top of\n // the `unknown-property` upstream already returns for the same key: upstream\n // says the prefix is missing, which is true of any undeclared key, while this\n // says WHICH declaration was written and that a reader was looking for the\n // other spelling — the part that was missing when an agent set authored with\n // `audit_checklist` rendered clean and checklist-less (#357).\n //\n // `error`, matching the verdict upstream already reached: every key\n // `findMisspelledDslExtensions` reports is one `checkCustomPropsRecursive`\n // reports as blocking, so this can add a reason to a document that is already\n // failing and can never turn a passing one red — pinned against the real\n // validator in `@aaac/contracts`' `__tests__/dsl-extensions.test.ts`.\n diagnostics.push(\n ...findMisspelledDslExtensions(dsl).map((m) => ({\n path: m.path,\n message: m.message,\n severity: \"error\",\n })),\n );\n\n // `buildNavigationIndex` takes a POST-PARSE `Dsl`: `tools`, `agents`,\n // `artifacts` and `tasks` are schema defaults, so parsing guarantees they are\n // objects and the builder walks them without asking. A DSL the parser\n // rejected carries no such guarantee, and pushing it through anyway crashed\n // with `Cannot convert undefined or null to object` for every project that\n // omitted one of those keys — a message naming nothing about the DSL (#317).\n //\n // `validation.data` is present whenever the parse succeeded, INCLUDING when a\n // later blocking check set `success: false`; those projects still get their\n // index plus the diagnostics above. Only a failed parse lands here, and it has\n // no recovery: `expandDefaults` returns its input untouched when the parse\n // fails, so an index simply cannot be built. Naming the schema errors and\n // stopping is the answer — the hooks turn a throw into `exit 1` + stderr,\n // which is this harness's one failure report (#310).\n if (!validation.data) {\n throw new Error(\n [\n \"DSL schema validation failed — a navigation index cannot be built from it:\",\n ...schemaDiagnostics.map((d) => ` - [${d.severity}] ${d.path}: ${d.message}`),\n ].join(\"\\n\"),\n );\n }\n const navigationIndex = buildNavigationIndex(validation.data) as Record<string, unknown>;\n\n // Same resolver the CLI execution path uses, so `dev-team guard list` and the\n // PreToolUse Bash guard agree (#267).\n const guardrailCtx = await resolveGuardrailContext(\n dsl,\n options.bindingPaths,\n options.activeGuardrailPolicy,\n );\n // Policy-resolution findings ride the same channel the SessionStart hook\n // renders (claude-native/ensure-navigation-index.ts), so a project whose\n // guardrails cannot be given an enforcement action says so out loud (#293).\n diagnostics.push(...guardrailCtx.diagnostics);\n const guardrailRules = guardrailCtx.hasGuardrails\n ? guardrailContextToRuleData(guardrailCtx)\n : undefined;\n\n return { dsl, navigationIndex, guardrailRules, diagnostics };\n}\n","/**\n * Navigation sources — resolve the project manifest into the inputs the\n * navigation-index hooks need (which DSL to overlay, which artifact registry to\n * bind, which files invalidate the cache).\n *\n * The generated `.claude/bin/*` nav hooks bake only what cannot be read from\n * disk at hook time: the component's bundled `/$embedded/` DSL. Everything the\n * project manifest declares (`agents:`, `artifacts:`) is resolved HERE, at hook\n * runtime, through the same `loadProjectConfig` loader the CLI uses — so a\n * manifest edit takes effect without re-running `claude sync`, and the hooks\n * cannot drift from the CLI's view of the project\n * (docs/proposal/workspace-subproject-guardrail.md §3.2).\n */\n\nimport { existsSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport {\n loadProjectConfig,\n PROJECT_CONFIG_FILENAME,\n} from \"../../generator/config.js\";\nimport type { NavigationContextOptions } from \"../navigation-context.js\";\n\nexport interface ResolveNavigationSourcesOptions {\n /**\n * Root of the project whose navigation-index is being built: the directory\n * that owns `project.yaml` (in workspace mode, the member root).\n */\n projectRoot: string;\n /**\n * The component's bundled `/$embedded/` DSL, baked into the hook bin by\n * `claude sync` — the only writer of `.claude/bin/*` (#273). Undefined for a\n * component whose contract declares no embedded DSL, where the bin resolves\n * `dslPath` directly.\n */\n embeddedDsl?: Record<string, unknown>;\n /**\n * Project-root-relative agents DSL path used ONLY when `projectRoot` has no\n * `project.yaml` (a bare component checkout), and only when the file is\n * actually there — it is a convention, not a declaration. With a manifest\n * present the manifest's `agents:` wins.\n */\n dslPath: string;\n}\n\nexport interface NavigationSources {\n navigationOptions: NavigationContextOptions;\n /** Files whose mtime invalidates the navigation-index cache. */\n sourceFiles: string[];\n}\n\n/**\n * Resolve the navigation-index inputs for one project root.\n *\n * With a `project.yaml` present, the manifest is authoritative:\n * - `agents:` → the DSL overlaid on `embeddedDsl` (omitted = embedded as-is),\n * - `artifacts:` → the artifact-contracts registry bound onto the DSL\n * artifacts, so path_patterns / authority / manual_edit reflect the project\n * rather than the component's built-in defaults,\n * - `bindings.guardrail` + `active_guardrail_policy` → the guardrail checks the\n * PreToolUse hook enforces, resolved by the same code as the CLI (#267).\n * All resolved files feed `sourceFiles`, so editing any of them rebuilds the\n * index on the next hook invocation.\n */\nexport async function resolveNavigationSources(\n options: ResolveNavigationSourcesOptions,\n): Promise<NavigationSources> {\n const manifestPath = resolve(options.projectRoot, PROJECT_CONFIG_FILENAME);\n\n if (!existsSync(manifestPath)) {\n const projectDslPath = resolve(options.projectRoot, options.dslPath);\n // With no manifest, `dslPath` is a CONVENTION, not a declaration: nothing in\n // this root asked for it. So it is an overlay only when it is actually\n // there, exactly as an undeclared `agents:` is treated below — otherwise the\n // root simply has no overlay and the embedded DSL stands as-is.\n //\n // Without an embedded DSL (`aaac generate` output) the path is not an\n // overlay but the ONLY source, so it is kept regardless and its absence\n // fails loudly at load with the missing filename.\n const isSource = options.embeddedDsl === undefined || existsSync(projectDslPath);\n return {\n navigationOptions: {\n ...(isSource ? { projectDslPath } : {}),\n embeddedDsl: options.embeddedDsl,\n },\n // Both paths are watched even when neither exists yet: the manifest is the\n // file that DECIDES the rest of this set, and the conventional DSL path\n // becomes an overlay the moment it appears. `computeCurrentHash` records an\n // absent file as `missing:<path>`, so the hash changes when either is\n // created.\n sourceFiles: [manifestPath, projectDslPath],\n };\n }\n\n const config = await loadProjectConfig(manifestPath);\n const sourceFiles = [manifestPath];\n\n // An undeclared `agents:` means \"no overlay\" — `config.dslPath` is then just\n // the schema default and pointing the loader at it would be a hard failure.\n const projectDslPath = config.dslDeclared ? config.dslPath : undefined;\n if (projectDslPath) {\n sourceFiles.push(projectDslPath);\n }\n\n if (config.artifactsPath) {\n sourceFiles.push(config.artifactsPath);\n }\n\n // Guardrail bindings feed the PreToolUse Bash guard, and edits to them must\n // rebuild the index (#267).\n sourceFiles.push(...config.bindingPaths);\n\n return {\n navigationOptions: {\n ...(projectDslPath ? { projectDslPath } : {}),\n embeddedDsl: options.embeddedDsl,\n ...(config.artifactsPath\n ? { artifactBinding: { source: config.artifactsPath } }\n : {}),\n bindingPaths: config.bindingPaths,\n ...(config.active_guardrail_policy\n ? { activeGuardrailPolicy: config.active_guardrail_policy }\n : {}),\n },\n sourceFiles,\n };\n}\n"],"mappings":";;;;;;;;;;AAsBA,SAAS,gBAAgB;AACzB,OAAO,UAAU;AAqBjB,eAAe,qBACb,QACkC;AAClC,MAAI;AACJ,MAAI;AACF,cAAU,MAAM,SAAS,QAAQ,MAAM;AAAA,EACzC,QAAQ;AACN,UAAM,IAAI;AAAA,MACR,qCAAqC,MAAM;AAAA,IAE7C;AAAA,EACF;AAEA,MAAI;AACJ,MAAI;AACF,aAAS,KAAK,MAAM,OAAO;AAAA,EAC7B,SAAS,KAAK;AACZ,UAAM,IAAI;AAAA,MACR,qCAAqC,MAAM,KAAM,IAAc,OAAO;AAAA,IACxE;AAAA,EACF;AAEA,QAAM,WACJ,OAAO,WAAW,YAAY,WAAW,QAAQ,CAAC,MAAM,QAAQ,MA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