/** Request-bound task extraction view of the planner's reviewed originals. * Complete state and source events stay intact. This capability is process-local; * serialized/cloned provider data never grants source-selection authority. */ import type { ContextObject } from "../runtime/context-object.js"; import type { Action } from "../types/components.js"; import type { Memory } from "../types/memory.js"; import type { State } from "../types/state.js"; export type RequestOperationClassification = "read_only" | "mutation_requested" | "unresolved"; export type RequestOperationRuntime = { readonly agentId: string; readonly actions?: readonly Action[]; }; /** Called only by the planner action boundary after its existing validators. */ export declare function bindTaskExtractionContext(state: State, message: Memory, original: ContextObject, projected: ContextObject, runtime?: RequestOperationRuntime, issuer?: RequestOperationIssuer): void; /** Current Stage-1 intent evidence from the same unmodified request capability. * Missing, cloned or changed bindings grant no foreground ownership authority. */ export declare function readTaskExtractionRequestIntents(state: State | undefined, message: Memory | undefined): readonly string[] | undefined; /** Routing clones State.values but preserves State.data; copied JSON cannot * inherit this capability. Changed source/actor/request/state falls back to full. */ export declare function readTaskExtractionContext(state: State | undefined, message: Memory | undefined, expectedSystem?: string): { text: string; originalText: string; system?: string; } | undefined; /** Original user sources from the existing request-bound selection capability. * Full/current-only bindings remain valid; cloned or changed state grants none. */ export declare function readTaskExtractionUserSources(state: State | undefined, message: Memory | undefined): readonly { id: string; text: string; }[] | undefined; declare const issuerBrand: unique symbol; declare const attemptBrand: unique symbol; export interface RequestOperationIssuer { readonly [issuerBrand]: true; } export interface BoundRequestOperationAttempt { readonly [attemptBrand]: true; } export declare const NOTES_REQUEST_OPERATIONS: readonly ["create", "list", "get", "update", "patch", "delete"]; export type NotesRequestOperation = (typeof NOTES_REQUEST_OPERATIONS)[number]; export type NotesRequestInterpretation = { readonly status: "explicit" | "unavailable" | "contradictory"; readonly operations: readonly NotesRequestOperation[]; }; type CanonicalDispatch = { child: string; discriminator: string; value: string; }; /** Closed operation interpretation from the existing handled Stage1 field. * This is semantic completion evidence, never mutation permission. */ export declare function normalizeNotesRequestInterpretation(value: unknown): NotesRequestInterpretation | undefined; /** Host entry only: call before the same Stage-1 classification, with its live abort/owner guard. * Re-entry for the same actual request returns the original issuer and cannot reset its latch. */ export declare function beginRequestOperationIssuer(input: { runtime: RequestOperationRuntime; message: Memory; current: () => boolean; }): RequestOperationIssuer | undefined; /** Getter cannot mint authority, reconstruct serialized state, or reset a restriction. */ export declare function getRequestOperationIssuer(runtime: RequestOperationRuntime, message: Memory): RequestOperationIssuer | undefined; /** Same-call validated field producer only, AFTER its active/parsed/handled trace checks. * The source/currentSource port is the owned immutable Stage-1 input, never planner JSON. * A contradictory second commit permanently fails closed for this issuer. */ export declare function commitNotesRequestRestriction(token: RequestOperationIssuer, input: { classification: unknown; source: unknown; currentSource: () => unknown; interpretation?: NotesRequestInterpretation; }): boolean; export declare function readTaskExtractionNotesRestriction(state: State | undefined, message: Memory | undefined, runtime?: RequestOperationRuntime): RequestOperationClassification; /** Mint at the host execution boundary, not from a tool-call ID/arguments. */ export declare function beginRequestOperationAttempt(input: { runtime: RequestOperationRuntime; state: State; message: Memory; action?: Action; }): BoundRequestOperationAttempt | undefined; export type BoundOperationDecision = { readonly allowed: true; readonly addsAuthority: false; } | { readonly allowed: false; readonly addsAuthority: false; readonly code: "REQUEST_OPERATION_RESTRICTED" | "REQUEST_OPERATION_UNRESOLVED"; readonly executionStatus: "not_started"; }; export declare function checkBoundNotesOperation(state: State | undefined, message: Memory | undefined, operation: NotesRequestOperation, token?: BoundRequestOperationAttempt, registeredOperation?: NotesRequestOperation): BoundOperationDecision; export declare class BoundRequestOperationError extends Error { readonly code: "REQUEST_OPERATION_RESTRICTED" | "REQUEST_OPERATION_UNRESOLVED"; readonly executionStatus: "not_started"; constructor(decision: Extract); } /** All owned results are associated with the actual execution attempt before projection. */ export declare function bindRequestOperationResult(result: object, token: BoundRequestOperationAttempt): boolean; /** Actual-source projection only: no positive attempt getter is exposed. A * serialized clone cannot self-brand; the owner must possess the original * association and preserve every completion-relevant outcome/provenance field. */ export declare function bindRequestOperationProjection(source: object, target: object, consumer: RequestOperationIssuer | undefined): boolean; export declare function copyRequestOperationResult(source: object, target: object): boolean; export type NotesMutationCompletion = { rejected: boolean; requested?: boolean; outsideRequestRejection: boolean; ambiguousRejection: boolean; status: "current" | "stale" | "changed"; dispatch?: CanonicalDispatch; }; /** Issued failures survive invalidation as blockers, never as permission or * authority to retry. The consumer supplies the actual host issuer capability. */ export declare function readNotesMutationCompletion(result: object, consumer: RequestOperationIssuer | undefined): NotesMutationCompletion | undefined; export declare function isMatchingNotesMutationCompletion(rejected: object, success: object, consumer: RequestOperationIssuer | undefined): boolean; /** Owned failure projection only. Require BOTH actual expected attempt and target ownership; * raw clones, success/applied/unknown results and other attempts cannot receive denial proof. */ export declare function transferBoundOperationDenial(source: object, target: object, expectedAttempt: BoundRequestOperationAttempt): boolean; /** Owned decision/error catches need the opaque attempt for their first failure projection. * Results additionally require exact failure/zero-effect shape and host attempt ownership. */ export declare function getBoundOperationDenialAttempt(result: object): BoundRequestOperationAttempt | undefined; /** This excludes ONE invented failed attempt, never proves original-request completion. */ export declare function isVerifiedOutsideRequestDenial(result: object, current: { messageId: string; roomId: string; entityId?: string; agentId?: string; attempt: BoundRequestOperationAttempt; operation: NotesRequestOperation; }): boolean; /** Owner-resolved metadata from the same privately associated, current denied result. */ export declare function getBoundOperationDenialOperation(result: object): NotesRequestOperation | undefined; export {};