/** * The `cotal_orientation` card — a structured, versioned self/context snapshot an agent reads to * orient: who it is, what it may read/post, what it can do, and what's around it. * * Built from the SAME {@link AgentConfig} (+ the gated tool list the connector exposes) that gates the * tools, so it can never drift from what's actually enforced. Connector-local introspection — an agent * reading its own minted grants — NOT a wire/SPEC capability handshake. * * The typed {@link Orientation} object is the source of truth; {@link renderOrientation} is one view of * it (the text the model reads). A future MCP resource can JSON-stringify the object directly. */ import { type AttentionMode, type PresenceStatus } from "@cotal-ai/core"; import { type MeshAgent, type RosterRead } from "./agent.js"; import { type AgentConfig } from "./config.js"; /** One-line connector bootstrap that points a joining agent at `cotal_orientation`. Folded into each * connector's system prompt / MCP instructions so every agent — Claude Code, OpenCode, Hermes — is * told to orient first, from a single source of truth. */ export declare const ORIENTATION_BOOTSTRAP: string; /** Mesh-first steer, folded in alongside {@link ORIENTATION_BOOTSTRAP} for every connector. Keeps * multi-agent work on the mesh instead of inside the harness's own hidden subagents, so it stays * visible to the user and addressable by peers. Unconditional (a read-only agent still delegates via * DM/anycast rather than a private subagent); the spawn-specific detail lives on the cotal_spawn tool. */ export declare const MESH_FIRST_STEER: string; /** Workflow-run steer, folded in beside {@link MESH_FIRST_STEER} for every connector. Points agents * at durable cotal-lang runs for coordination that must outlive their own session, so the reflex is * a journalled `cotal run` rather than an improvised loop held in one agent's context. */ export declare const WORKFLOW_STEER: string; /** Where to talk, folded in beside {@link ORIENTATION_BOOTSTRAP} for every connector. Leads with * the model (information moves through channels), then the rule (channel for work, a mention to * make one peer act, a DM for what one peer alone needs), then the mechanics. A fresh seat may * start on no channel, so it is told how to find and join one, and how a helper it spawns gets * one. Guidance only: it grants nothing and changes no subscription. */ export declare const CHANNEL_GUIDANCE: string; /** A tool the agent can actually call (already gated), as it appears in the card. */ export interface OrientationTool { name: string; title: string; } export interface Orientation { /** Schema version — bump on a breaking shape change so future renderers/resources can adapt. */ v: 1; /** Snapshot stamp. The live fields below (peers / status / attention / unread) are as of this time; * the identity/access/capabilities/tools fields are static for the session. */ generatedAt: number; identity: { /** Whether this endpoint has completed its mesh bind. Configured labels are not a bound identity. */ state: "bound" | "unbound"; /** Human-facing label. It is deliberately separate from the wire principal. */ display: { name: string; role: string; }; /** Broker-routed owner+actor identity, or explicit unknowns when no principal can be established. */ principal: { owner: string; actor: string; }; /** This incarnation's lifecycle identity. Open/legacy callers that do not expose it report unknown. */ lifecycleUid: string; /** Replacement evidence available to this connector. A predecessor UID is never inferred. */ replacement: { state: "replacement" | "unknown"; predecessorLifecycleUid: string; }; /** Existing compatibility fields retained for renderers and callers. */ name: string; role?: string; space: string; id: string; cotalVersion: string; model?: string; }; access: { /** auth mode → these grants are broker-enforced; open mode → advisory (host-trusted) only. */ authMode: boolean; /** Active read set — channels you currently receive. */ read: string[]; /** Read ACL — channels you MAY join (equals `read` when no creds). */ readAcl: string[]; /** Post ACL — channels you may broadcast to. Empty ⇒ read-only (default-deny). */ post: string[]; /** Concrete channels in the read ACL you are NOT on yet, each with its registry note when the * registry has one: where to look before the first send, without a second call. */ joinable: { channel: string; note?: string; }[]; }; /** Control-plane capabilities (e.g. `spawn`). Empty ⇒ none beyond the defaults granted to all. */ capabilities: string[]; /** The tools available to you, grouped so the surface reads small: `core` is the everyday loop. */ tools: { core: OrientationTool[]; more: OrientationTool[]; }; peers: { present: number; summary: string; }; /** Whether the roster can be trusted, from {@link presenceLiveness}. */ presence: { live: boolean; detail?: string; }; status: PresenceStatus; attention: AttentionMode; unread: { total: number; }; /** A factual map from intent → tool. Not a prescribed sequence. */ actions: { read: string; replyChannel: string; replyPrivate: string; askRole: string; }; } /** Whether this observer's roster can be trusted, and why not. `cotal_roster` and this card both * print `detail`, so the two surfaces cannot explain one condition differently. A stuck writer * takes precedence over the read (#1356); otherwise a failed read (#1229) keeps the roster * last-known. */ export declare function presenceLiveness(agent: MeshAgent, read: RosterRead): Orientation["presence"]; /** Assemble the card. `visibleTools` is the already-gated tool list the connector exposes (pass the * result of `cotalToolSpecs(config)` mapped to name/title) — the orientation tool itself is dropped. * Pure: `generatedAt` and the roster `read` ({@link MeshAgent.readRoster}) are supplied by the * caller so it's testable and deterministic. */ export declare function buildOrientation(agent: MeshAgent, config: AgentConfig, visibleTools: OrientationTool[], generatedAt: number, read: RosterRead): Orientation; /** Render the card as compact, glanceable text — the view the model reads. */ export declare function renderOrientation(o: Orientation): string; //# sourceMappingURL=orientation.d.ts.map