/** The whitelisted projection of core's `prompt.assembled` trace event ([ref]② web observability slice A: * the manifest reaches the durable run event log + turns/stream). Built FIELD-BY-FIELD at record time * (never a spread — the 1.72 task_progress lesson: a future core field must not ride the durable wire raw). * Carries ONLY ids/digests/counts by core's manifest contract (no prompt bodies; hashes are core-salted) — * so the projection legs have zero redact burden. */ export interface PromptManifestRecord { constitution: string; blocks: Array<{ id: string; chars: number; hash: string; }>; /** `contentHash`(core 1.315 [ref]①):operator 声明 section 的**非盐化**对账锚(core 已对 text 校验 * 后透传)——盐化 `hash` 恒在旁;端到端对账链(center 发布→manifest)经本投影,必须透传不可吞。 */ sections?: Array<{ id: string; slot: string; carrier: string; cadence: string; cacheClass: string; chars: number; hash: string; contentHash?: string; }>; tools?: Array<{ wireName: string; aliases: string[]; contractId: string; implementationRevision: string; cardId: string; shapeDigest: string; wireSchemaDigest: string; }>; /** core 5.15.0([ref]):deferred 披露策略自证三键(诊断值,零内容)。缺席=core <5.15 或无 deferred。 */ toolDisclosure?: { deferredTools: number; strategy: string; source: string; }; totalChars: number; } /** Whitelist one `prompt.assembled` trace event into a {@link PromptManifestRecord} (v1 face required, * v2 `sections`/`tools` additive — absent stays absent). */ export declare function promptManifestRecordOf(e: { constitution: string; blocks: Array<{ id: string; chars: number; hash: string; }>; sections?: Array<{ id: string; slot: string; carrier: string; cadence: string; cacheClass: string; chars: number; hash: string; contentHash?: string; }>; tools?: Array<{ wireName: string; aliases: string[]; contractId: string; implementationRevision: string; cardId: string; shapeDigest: string; wireSchemaDigest: string; }>; /** core 5.15.0([ref],[ref] 提货②):deferred 工具的披露策略自证——{deferredTools(数), strategy * ("static"|"swap"), source(四值:`spec` / `env` / `default` / `degraded_no_direct_lane`)}。 * 诊断三键(数 + 两闭集词,零内容)。词表属主是 core(`core/trace.d.ts` 的 `source` 联合),本仓宽收 * ⇒ 词错不会红,所以照抄时务必对表:`degraded_no_direct_lane` = 直呼车道联锁把 `static` 请求收窄成 * `swap` 的那一格,正是运维最需要认出来的一格(本注上一版把它写成了不存在的 `api-default`,下游看板 * 照抄就会把真实的 degraded 读成未知词)。 */ toolDisclosure?: { deferredTools: number; strategy: string; source: string; }; totalChars: number; }): PromptManifestRecord; /** * [ref]② per-task prompt-manifest accumulator — the `ModelUsageTracker`(budget.ts)pattern: the * `prompt.assembled` tracer hook is SYNC/no-IO, so it cannot persist; it RECORDS here (registered * top-level runs only — the same leak fence: sub-task manifests are never registered, never leak), and * the durable run lifecycle DRAINS the pending records into `prompt_assembled` events. Two departures * from the ModelUsage shape (release-review findings): * - The pending value is an ordered QUEUE, not a single slot: a cascade/verify leg re-prepares under * ONE taskId (core's runCascade passes the same spec taskId to every rung), and each prepare's * manifest must persist — latest-wins would hide the prompt actually used by earlier billed rungs. * - {@link register} returns a per-leg LEASE and {@link clear} requires it: after setSuspended makes * the row claimable, a fast sibling resume can re-register the same taskId before the parked leg's * finally runs (the codebase's documented B-3 window) — an unconditional clear there would silently * delete the NEW leg's registration/pending manifest. Identity-guarded like the sibling * inflight/steerable teardowns. */ /** [ref]③ — `config.assembled` 的白名单投影(core 1.346 trace:catalogVersion/fields[来源标注]/ * overrideReasons)。fields 已是 core 精选的观测形(digest-free、有界);32KiB 罩防未来膨胀。 */ export declare function configAssembledRecordOf(e: { catalogVersion?: unknown; fields?: unknown; overrideReasons?: unknown; ts?: unknown; }): Record | undefined; export declare class PromptManifestTracker { private readonly byTask; /** [ref]③:config.assembled 的同生命周期伴随记录(register 同门、drainConfig 同拍)。队列形 * (codex F2):cascade 每 rung 独立解析配置,后到覆盖会把先前已计费 rung 的生效配置抹掉——与 * prompt manifests 同姿势逐条保序。 */ private readonly configByTask; private readonly active; private leaseCounter; /** Mark a TOP-LEVEL run active (same fence as `ModelUsageTracker.register`, budget.ts). Returns this leg's * lease — pass it to {@link clear} so only the CURRENT owner can tear the slot down. */ register(taskId: string): number; /** Queue this prepare's manifest — ONLY for a registered top-level run (else a no-op). Sync, never throws. */ record(taskId: string, m: PromptManifestRecord): void; /** [ref]③:队一条 config.assembled 投影(同 register 门;逐条保序——cascade 每 rung 各留其形)。 */ recordConfig(taskId: string, rec: Record): void; /** Return-and-clear ALL pending config records in emission order; `undefined` when none. */ drainConfig(taskId: string): Array> | undefined; /** Return-and-clear ALL pending manifests in emission order; `undefined` when none. */ drain(taskId: string): PromptManifestRecord[] | undefined; /** Drop pending + unregister (run end / abandoned leg) — but ONLY while `lease` still owns the slot; * a stale leg's teardown after a fast re-register is a no-op (the new leg owns it now). */ clear(taskId: string, lease: number): void; } //# sourceMappingURL=prompt-manifest.d.ts.map