import type { Mode, Lifecycle } from '../canvas/types.js'; /** The gate input: a node's configuration as a structured object. Field names * and shape are the predicate vocabulary's dotted paths (`orchestration.depth`, * `hasManager`, …). There is intentionally NO `tags` field — NodeMeta has none. */ export interface NodeConfigSubject { /** The node's role, free-form (developer | explore | design | …). NodeMeta.kind. */ kind: string; /** base (hands-on worker) | orchestrator (delegating manager). NodeMeta.mode. */ mode: Mode; /** terminal (worker) | resident (manager). NodeMeta.lifecycle. */ lifecycle: Lifecycle; /** Spine position: does this node have a manager? (= parent !== null). */ hasManager: boolean; /** The node's working directory on disk. NodeMeta.cwd. */ cwd: string; /** DERIVED: the scope scope.ts resolves for `cwd` — `project` when a * nearest-ancestor `.crouter/` exists at/above cwd, else `user`. */ scope: 'user' | 'project'; /** DERIVED orchestration metrics. */ orchestration: { /** Spine distance (hops) from this node up to its root orchestrator. The * root itself is 0; a direct child of the root is 1; etc. */ depth: number; }; /** DERIVED: `meta.profile_id` resolved to its manifest's mutable `name` (NOT * the stable directory id — gate authors write `gate: {profile: }`). * null for historical null-profile rows, and null (never throwing) when the * profile has been deleted or its manifest is unreadable — this is a HOT, * every-doc-render path and must never brick boot/on-read gating. */ profile: string | null; } /** The scope a cwd resolves into: `project` when scope.ts finds a * nearest-ancestor `.crouter/` at/above it, else `user`. Reuses the existing * resolver (`projectScopeRoot`). NOTE: `findProjectScopeRoot` is process-cached * on first call, so for a node assembling its OWN subject (cwd === process.cwd) * this is exact; resolving an arbitrary unrelated cwd in the same process would * return the cached root — fine for per-node subject assembly. */ export declare function scopeForCwd(cwd: string): 'user' | 'project'; /** Resolve `profile_id` to the manifest's mutable `name` for the gate subject. * NEVER throws: a missing/deleted profile resolves to `null` silently (the * ordinary lifecycle of a node whose profile was deleted out from under it); * any OTHER failure (e.g. an unreadable/corrupt manifest slipping past * `loadProfileManifest`'s own tolerance) is logged and still resolves to * `null` rather than throwing — this runs on every gated-doc render. */ export declare function profileNameFor(profileId: string | null | undefined): string | null;