/** * Write-outcome transparency helpers — the glass-box for WRITES. * * Reads route through one verb (`ask`, which says how it routed). Writes route by * KIND into one of three lanes — and every write must report, honestly and in one * line, WHAT happened so the AI is GUIDED by the response, not guessing: * * | Lane | Destination | Governance | * |----------|--------------------------------------|-----------------| * | user | pod-wide user_observation | gate inference | * | global | pod-wide procedural (knowledge_keys) | reviewed | * | work | the active product workspace | proposal-gated | * * The cardinal signal is **stored vs proposed**: `stored` = live, recallable now; * `proposed` = gated/refrained — queued for human approval, NOT yet live. Every * write command routes its hub response through `reportWrite` so this signal is * consistent across `capture`, `observe`, `create entity`, `create relation`, `doc`. */ import { type HubConfig } from "./hub-client.js"; export type CaptureLane = "ai-self" | "user" | "global" | "work"; export type Governance = "auto" | "proposed"; export interface LaneReport { /** One-line lane label. */ lane: CaptureLane; /** Resolved destination workspace id (undefined if none could be resolved). */ workspaceId?: string; /** Human-friendly workspace name, best-effort resolved from the pod. */ workspaceName?: string; /** Whether the write was auto-approved (`auto`) or queued for review (`proposed`). */ governance: Governance; } /** * Derive the lane from the workspace-routing `source` returned by * `resolveKnowledgeWorkspace`. A domain capture always lands in a real product * workspace → the Work lane. (The backend routing endpoint P7b is the SSoT for * resolving user/global lanes; the CLI's lane detection is a best-effort hint.) * * source → lane * "explicit" / "team" / "active …" → work */ export declare function laneFromSource(_source: string): CaptureLane; /** Best-effort resolve a workspace name from the pod. Never throws. */ export declare function resolveWorkspaceName(workspaceId: string, cfg: HubConfig): Promise; /** * Build the `→ stored in … / proposed to …` destination line for human output. * Returns a dim, single-line string (no trailing newline). */ export declare function formatLaneLine(report: LaneReport): string; /** The additive JSON fields that declare lane + destination + governance. */ export declare function laneJsonFields(report: LaneReport): Record; /** Detect the governance outcome from a hub write response (entity / proposal). */ export declare function writeGovernance(res: Record): Governance; /** * The ONE honest write reporter. Every write command routes its hub response * through this so the AI gets a consistent, guiding signal: * • stored → live now, recallable via `ask` * • proposed → gated/refrained, awaiting human approval, NOT yet live * One human line + lane line; `--json` adds an `outcome` field while preserving * the original response fields (backward-compatible). */ export declare function reportWrite(res: Record, o: { label: string; lane: CaptureLane; workspaceId?: string; cfg: HubConfig; json?: boolean; }): Promise;