/** * Platform ("agent") resolution for session events. * * Every `sessions.ndjson` event carries an `agent` field naming the platform * the session ran on. `aidlc cost sync` resolves a CostProvider by that name, * so a wrong or absent value costs the session its attribution permanently. * * The four write sites used to read `process.env.AIDLC_AGENT ?? 'unknown'` * directly, and nothing in the framework ever set that variable — so every * real claim recorded `unknown` and every session's usage went unattributed * (cost-claim-attribution: 8 instances, 484 unattributed entries). Resolution * order here, strongest evidence first: * * 1. AIDLC_AGENT — an explicit declaration by an agent that knows its own * platform always wins (AC-3). * 2. Stash agreement — the SessionStart stash records the platform directly. * When several entries match this repo but all agree on `agent`, that * agreement is usable even though the *session id* stays ambiguous (AC-4). * Agent resolution and session-id resolution are independent questions. * 3. Provider detection — exactly one detected provider names the platform * (AC-1). Several or none is genuinely undetermined (AC-5). * * `unknown` remains a legal value: it means "nobody could tell", not "nobody * looked". Resolution is fail-soft throughout — it must never fail a claim * (AC-6, NFR-2). */ /** The value recorded when the platform cannot be determined. */ export declare const UNKNOWN_AGENT = "unknown"; /** Why resolution fell back to `unknown` — drives the caller's warning (AC-5). */ export type AgentMissReason = 'no-provider-detected' | 'multiple-providers-detected' | 'stash-disagreement'; export interface AgentResolution { agent: string; /** How the value was determined; `null` when `agent` is UNKNOWN_AGENT. */ via: 'env' | 'stash' | 'detect' | null; /** Set only when `agent` is UNKNOWN_AGENT. */ reason: AgentMissReason | null; } /** * The platform every matching stash entry agrees on, or null when there are * none or they disagree (AC-4). */ export declare function agentFromStash(projectRoot: string): string | null; export declare function resolveAgent(projectRoot: string, home?: string): AgentResolution; /** Human-readable warning for an unresolved platform (AC-5). */ export declare function agentMissWarning(reason: AgentMissReason): string; /** Test seam: drop the memoized resolution. */ export declare function resetAgentCache(): void; //# sourceMappingURL=agent.d.ts.map