omnius 1.0.957 → 1.0.959

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,121 @@
1
+ /**
2
+ * mcp/client.ts — MCP Client (Model Context Protocol)
3
+ *
4
+ * Full MCP client implementing:
5
+ * - initialize handshake (protocol version negotiation)
6
+ * - tools/list (discover server-provided tools)
7
+ * - tools/call (invoke a tool with arguments)
8
+ * - resources/list (discover server-provided resources)
9
+ * - resources/read (read a specific resource)
10
+ * - prompts/list (discover server-provided prompts)
11
+ *
12
+ * Protocol version: MCP 2025-06-18
13
+ * Transport: stdio (subprocess) or Streamable HTTP
14
+ *
15
+ * Reference: Hannover src/services/mcp/client.ts
16
+ * Protocol: https://modelcontextprotocol.io/specification/2025-06-18/
17
+ */
18
+ import type { McpServerConfig, McpToolDefinition, McpResource, McpPrompt, McpToolCallResult, McpInitializeResult, McpConnection, McpContent } from "./types.js";
19
+ import type { McpReturnedHttpReadPolicy } from "./types.js";
20
+ export interface McpReturnedHttpReadBinding {
21
+ readonly serverName: string;
22
+ readonly origin: string;
23
+ readonly policy: Readonly<Required<McpReturnedHttpReadPolicy>>;
24
+ readonly policyRevision: string;
25
+ }
26
+ export declare class McpClient {
27
+ #private;
28
+ private transport;
29
+ private serverName;
30
+ private config;
31
+ private initResult;
32
+ private cachedTools;
33
+ private cachedResources;
34
+ private notificationHandlers;
35
+ /** Config reported by getConnection(); keeps ${MCP_SECRET_*} references instead of resolved credentials. */
36
+ private readonly displayConfig;
37
+ constructor(serverName: string, config: McpServerConfig, displayConfig?: McpServerConfig);
38
+ /**
39
+ * Register a callback for server-sent JSON-RPC notifications.
40
+ * Called for progress updates, log messages, list_changed events, etc.
41
+ * Multiple handlers can be registered.
42
+ */
43
+ onNotification(handler: (method: string, params: any) => void): void;
44
+ /** Server name */
45
+ get name(): string;
46
+ /** Whether the client is connected and initialized */
47
+ get connected(): boolean;
48
+ /** Server capabilities (after initialize) */
49
+ get capabilities(): McpInitializeResult | null;
50
+ /**
51
+ * Connect to the MCP server and perform protocol handshake.
52
+ */
53
+ connect(): Promise<McpInitializeResult>;
54
+ /**
55
+ * Disconnect from the MCP server.
56
+ */
57
+ disconnect(): Promise<void>;
58
+ /**
59
+ * List all tools provided by this MCP server.
60
+ * Results are cached until disconnect.
61
+ */
62
+ listTools(): Promise<McpToolDefinition[]>;
63
+ /**
64
+ * Call a tool on the MCP server.
65
+ *
66
+ * @param toolName The tool name (as returned by listTools)
67
+ * @param args Tool arguments matching the tool's inputSchema
68
+ * @param timeoutMs Request timeout (default: 60s for tool calls)
69
+ * @param options Optional: progressToken to opt-in to progress notifications,
70
+ * onProgress callback receives every notifications/progress
71
+ * event whose progressToken matches.
72
+ */
73
+ callTool(toolName: string, args: Record<string, unknown>, timeoutMs?: number, options?: {
74
+ progressToken?: string | number;
75
+ onProgress?: (progress: {
76
+ progress: number;
77
+ total?: number;
78
+ message?: string;
79
+ }) => void;
80
+ }): Promise<McpToolCallResult>;
81
+ /**
82
+ * List all resources provided by this MCP server.
83
+ * Results are cached until disconnect.
84
+ */
85
+ listResources(): Promise<McpResource[]>;
86
+ /**
87
+ * Read a specific resource by URI.
88
+ */
89
+ readResource(uri: string): Promise<McpContent[]>;
90
+ /** Original successful RPC object on this live connection; JSON copies never qualify. */
91
+ isOriginalReturnedHttpResult(result: unknown): boolean;
92
+ getReturnedHttpReadBinding(): Readonly<McpReturnedHttpReadBinding> | undefined;
93
+ isReturnedHttpUrlAllowed(url: string, binding: Readonly<McpReturnedHttpReadBinding>): boolean;
94
+ /** Credential-bearing GET is available only through a current original binding. */
95
+ fetchReturnedHttpSource(url: string, binding: Readonly<McpReturnedHttpReadBinding>, signal: AbortSignal): Promise<Response>;
96
+ /**
97
+ * List all prompts provided by this MCP server.
98
+ */
99
+ listPrompts(): Promise<McpPrompt[]>;
100
+ /**
101
+ * Get the full connection state for this server.
102
+ */
103
+ getConnection(): McpConnection;
104
+ private ensureConnected;
105
+ }
106
+ /**
107
+ * Normalize a string for use as an MCP tool name component.
108
+ * Replaces invalid chars with underscores, collapses multiples.
109
+ */
110
+ export declare function normalizeMcpName(name: string): string;
111
+ /**
112
+ * Build a namespaced tool name: mcp__{server}__{tool}
113
+ */
114
+ export declare function buildMcpToolName(serverName: string, toolName: string): string;
115
+ /**
116
+ * Parse a namespaced tool name back to server + tool.
117
+ */
118
+ export declare function parseMcpToolName(fullName: string): {
119
+ server: string;
120
+ tool: string;
121
+ } | null;
@@ -0,0 +1,65 @@
1
+ import type { McpClient } from "./client.js";
2
+ import type { McpReturnedHttpReadPolicy, McpToolCallResult } from "./types.js";
3
+ import type { ToolInvocationContext } from "../types.js";
4
+ /** Fixed codes only: provider/guard exceptions cannot smuggle a credential into display errors. */
5
+ export declare function returnedHttpReadFailureCode(error: unknown): string;
6
+ export interface ReturnedHttpSourceInvocation {
7
+ workspaceRoot: string;
8
+ sessionId: string;
9
+ runId: string;
10
+ taskEpoch: number;
11
+ ownerId: string;
12
+ ownerGeneration: number;
13
+ toolCallId: string;
14
+ toolName: string;
15
+ assertCurrent: () => void;
16
+ signal?: AbortSignal;
17
+ }
18
+ export interface ReturnedHttpOriginalOperation {
19
+ result: McpToolCallResult;
20
+ invocation: Readonly<ReturnedHttpSourceInvocation>;
21
+ }
22
+ export interface ReturnedHttpSourceReference {
23
+ sourceRef: string;
24
+ url: string;
25
+ consumption: 'not_read';
26
+ }
27
+ export interface ReturnedHttpSourceResolution {
28
+ readonly sourceRef: string;
29
+ readonly url: string;
30
+ readonly serverName: string;
31
+ readonly assertCurrent: () => void;
32
+ readonly fetch: (signal: AbortSignal) => Promise<Response>;
33
+ }
34
+ /** Original host resolution only; copied JSON/functions are not a credential grant. */
35
+ export declare function readReturnedHttpSourceResolution(value: unknown): Readonly<ReturnedHttpSourceResolution> | undefined;
36
+ /** Attenuation only: this cannot create a resolution from a copied/plain object. */
37
+ export declare function withReturnedHttpSourceGuard(value: unknown, guard: () => void): Readonly<ReturnedHttpSourceResolution> | undefined;
38
+ export declare function normalizeReturnedHttpReadPolicy(value: McpReturnedHttpReadPolicy): Readonly<Required<McpReturnedHttpReadPolicy>>;
39
+ export declare function returnedHttpUrlAllowed(raw: string, origin: string, policy: Readonly<McpReturnedHttpReadPolicy>): boolean;
40
+ export interface ReturnedHttpSourceCaptureStatus {
41
+ status: 'captured' | 'partial' | 'unavailable' | 'unconfigured';
42
+ reasonCode?: string;
43
+ omittedCandidates?: 'unknown';
44
+ observedCandidates?: number;
45
+ issuedReferences?: number;
46
+ rejectedCandidates?: number;
47
+ limits: {
48
+ maxResultBytes: number;
49
+ maxTraversalNodes: number;
50
+ maxDepth: number;
51
+ maxCandidates: number;
52
+ maxSources: number;
53
+ };
54
+ }
55
+ /** Hot, bounded original-result registry. No persistence/JSON restoration grants authority. */
56
+ export declare class ReturnedHttpSourceRegistry {
57
+ #private;
58
+ readCaptureStatus(observation: unknown): Readonly<ReturnedHttpSourceCaptureStatus> | undefined;
59
+ constructor(options: {
60
+ readInvocation: (context?: ToolInvocationContext) => Readonly<ReturnedHttpSourceInvocation> | undefined;
61
+ readOriginalOperation: (observation: unknown) => ReturnedHttpOriginalOperation | undefined;
62
+ });
63
+ capture(client: McpClient, observation: unknown): ReadonlyArray<Readonly<ReturnedHttpSourceReference>>;
64
+ resolve(sourceRef: string, context?: ToolInvocationContext): Readonly<ReturnedHttpSourceResolution> | undefined;
65
+ }
@@ -35,10 +35,17 @@ export interface McpStdioConfig {
35
35
  args?: string[];
36
36
  env?: Record<string, string>;
37
37
  }
38
+ export interface McpReturnedHttpReadPolicy {
39
+ pathPrefixes: string[];
40
+ credentialHeaderNames: string[];
41
+ maxResponseBytes?: number;
42
+ }
38
43
  export interface McpHttpConfig {
39
44
  type: "http" | "sse";
40
45
  url: string;
41
46
  headers?: Record<string, string>;
47
+ /** Explicit host policy for reading URLs returned by this exact connector. */
48
+ returnedHttpRead?: McpReturnedHttpReadPolicy;
42
49
  }
43
50
  export type McpServerConfig = McpStdioConfig | McpHttpConfig;
44
51
  export interface McpConfig {
@@ -0,0 +1,44 @@
1
+ import type { MemorySearchResultV1 } from "../memory/memoryCapability.js";
2
+ import type { ToolInvocationContext } from "./types.js";
3
+ import { type NativeToolOperationObservationV1 } from "./native-operation-observation.js";
4
+ /** Facts about returned records, not proof of reading their complete bodies or authoring a note. */
5
+ export interface NativeMemoryReadFacts {
6
+ readonly status: MemorySearchResultV1['status'];
7
+ readonly outcome: MemorySearchResultV1['outcome'];
8
+ readonly reasonCode?: string;
9
+ readonly returnedMatchCount: number;
10
+ readonly executedRoutes: readonly string[];
11
+ readonly sourceNamespaceCounts: Readonly<Record<string, number>>;
12
+ readonly declaredSourceKindCounts: Readonly<Record<string, number>>;
13
+ readonly sourceManifestSha256: string;
14
+ readonly authoringProof: 'none_from_read';
15
+ }
16
+ interface Carrier {
17
+ success: boolean;
18
+ output?: string;
19
+ error?: string;
20
+ llmContent?: string;
21
+ data?: unknown;
22
+ partial?: boolean;
23
+ noop?: boolean;
24
+ dryRun?: boolean;
25
+ }
26
+ /** Only observations issued from a live original memory-result reader qualify. */
27
+ export declare function readIssuedNativeMemoryOperationObservation(value: unknown): Readonly<NativeToolOperationObservationV1> | undefined;
28
+ /** Host adapter for an existing producer. No query, source access, or authority is created here. */
29
+ export declare class NativeMemoryOperationObserver {
30
+ private readonly producer;
31
+ private readonly producerRef;
32
+ private readonly carrierKey;
33
+ private readonly issued;
34
+ private readonly tickets;
35
+ constructor(producer: {
36
+ toolName: string;
37
+ readParameters: () => unknown;
38
+ readIssuedResult: (data: unknown) => MemorySearchResultV1 | undefined;
39
+ });
40
+ begin(args: Record<string, unknown>, context?: ToolInvocationContext): object | undefined;
41
+ observe(ticket: object | undefined, args: Record<string, unknown>, result: Carrier, context?: ToolInvocationContext): void;
42
+ read(args: Record<string, unknown>, result: Carrier): Readonly<NativeToolOperationObservationV1> | undefined;
43
+ }
44
+ export {};
@@ -0,0 +1,34 @@
1
+ import { type NativeMemoryReadFacts } from "./native-memory-operation-observation.js";
2
+ export interface NativeToolOperationInvocation {
3
+ readonly workspaceRoot: string;
4
+ readonly sessionId: string;
5
+ readonly runId: string;
6
+ readonly taskEpoch: number;
7
+ readonly ownerId: string;
8
+ readonly ownerGeneration: number;
9
+ readonly toolCallId: string;
10
+ readonly toolName: string;
11
+ readonly assertCurrent: () => void;
12
+ readonly signal?: AbortSignal;
13
+ readonly returnedSourceConsumer?: Readonly<{
14
+ toolName: string;
15
+ selector: 'source_ref';
16
+ }>;
17
+ }
18
+ export interface NativeToolOperationObservationV1 {
19
+ readonly schema: 'omnius.native-operation-observation.v1';
20
+ readonly scope: Readonly<Omit<NativeToolOperationInvocation, 'assertCurrent' | 'signal'>>;
21
+ readonly producerRef: string;
22
+ readonly toolSchemaSha256: string;
23
+ readonly argumentsSha256: string;
24
+ readonly nativeResultSha256?: string;
25
+ readonly coverage: 'complete' | 'partial' | 'unavailable';
26
+ /** Native producer return status, not business success, body consumption or task readiness. */
27
+ readonly returnedStatus: 'success' | 'error';
28
+ readonly observedAt: string;
29
+ readonly memoryRead?: Readonly<NativeMemoryReadFacts>;
30
+ }
31
+ /** Pure identity helper. This function cannot issue an observation or permission. */
32
+ export declare function nativeOperationDigest(value: unknown): string;
33
+ /** Reader only. Fixed native producers keep their issuance maps private. */
34
+ export declare function readIssuedNativeOperationObservation(value: unknown): Readonly<NativeToolOperationObservationV1> | undefined;
@@ -110,9 +110,9 @@ export declare const NolGgufControlInventorySchema: z.ZodObject<{
110
110
  path: z.ZodString;
111
111
  role: z.ZodEnum<{
112
112
  other: "other";
113
+ config: "config";
113
114
  tokenizer: "tokenizer";
114
115
  weights: "weights";
115
- config: "config";
116
116
  chat_template: "chat_template";
117
117
  adapter: "adapter";
118
118
  }>;
@@ -56,9 +56,9 @@ export declare const NolPytorchControlInventorySchema: z.ZodObject<{
56
56
  path: z.ZodString;
57
57
  role: z.ZodEnum<{
58
58
  other: "other";
59
+ config: "config";
59
60
  tokenizer: "tokenizer";
60
61
  weights: "weights";
61
- config: "config";
62
62
  chat_template: "chat_template";
63
63
  adapter: "adapter";
64
64
  }>;
@@ -1,5 +1,6 @@
1
1
  import type { Tool, ToolResult, ToolInvocationContext } from "../types.js";
2
2
  import { type BrowserPageReader } from "./browser-page-fallback.js";
3
+ import { type ReturnedHttpSourceResolution } from "../mcp/returned-http-source.js";
3
4
  export interface WebFetchReceipt {
4
5
  schema: "omnius.web-fetch-receipt.v1";
5
6
  requestedUrl: string;
@@ -10,11 +11,20 @@ export interface WebFetchReceipt {
10
11
  responseSha256: string;
11
12
  fetchedAt: string;
12
13
  linkStatus: "retrieved";
14
+ returnedSource?: {
15
+ sourceRef: string;
16
+ serverName: string;
17
+ consumption: 'body_read';
18
+ };
13
19
  }
14
20
  export declare class WebFetchTool implements Tool {
15
21
  #private;
16
22
  name: string;
17
23
  private readonly eagerSourceMaxBytes;
24
+ readonly returnedHttpSourceConsumer?: Readonly<{
25
+ selector: 'source_ref';
26
+ }>;
27
+ private readonly returnedSourceResolver?;
18
28
  private readonly browserFallback;
19
29
  /** Companion tools registered beside this one; unfed hosts keep the full guidance. */
20
30
  private browserAvailable;
@@ -25,6 +35,7 @@ export declare class WebFetchTool implements Tool {
25
35
  constructor(options?: {
26
36
  eagerSourceMaxBytes?: number;
27
37
  browserFallback?: BrowserPageReader;
38
+ returnedSourceResolver?: (sourceRef: string, context?: ToolInvocationContext) => Readonly<ReturnedHttpSourceResolution> | undefined;
28
39
  });
29
40
  isReadOnly(): boolean;
30
41
  acceptsInvocationContext: boolean;
@@ -229,6 +229,7 @@ export interface AuxiliaryOperationBinding {
229
229
  export interface ToolInvocationContext {
230
230
  /** Original host child-dispatch identity; preserve by reference through adapters. */
231
231
  nativeChildInvocation?: Readonly<import("./native-child-evidence.js").NativeChildInvocation>;
232
+ nativeOperationInvocation?: Readonly<import("./native-operation-observation.js").NativeToolOperationInvocation>;
232
233
  /** Native FileWrite result correlation only; never supplied by model arguments. */
233
234
  nativeFileWriteInvocation?: Readonly<import("./native-file-write-observation.js").NativeFileWriteInvocationScope>;
234
235
  /** Preserve this exact host identity while composing cell-local guards. JSON copies grant nothing. */
@@ -467,6 +468,10 @@ export interface Tool {
467
468
  getHistoryObservationIdentity?: (args: Record<string, unknown>, result: ToolResult) => string | null;
468
469
  /** Exact native command result custody, including failures; model JSON cannot issue it. */
469
470
  getCommandExecutionObservation?: (args: Record<string, unknown>, result: ToolResult) => unknown;
471
+ readIssuedOperationObservation?: (args: Record<string, unknown>, result: ToolResult) => unknown;
472
+ returnedHttpSourceConsumer?: Readonly<{
473
+ selector: 'source_ref';
474
+ }>;
470
475
  /** Original native FileWrite result proof; JSON/copies cannot issue it. */
471
476
  getNativeFileWriteObservation?: (args: Record<string, unknown>, result: ToolResult) => unknown;
472
477
  /** Original producer result custody; returned JSON never grants child evidence. */
@@ -19,7 +19,8 @@ import type { CompletionEvidenceRole, CompletionLedger, CompletionVerificationIm
19
19
  import { type ExternalEffectIntentV1, type ExternalEffectReceiptV1, type NeedsInputContractV1, type ObjectiveExternalBlockerV1, type ObjectiveFrontierDeltaV1, type ObjectiveFrontierSnapshotV1, type TaskObjectiveContractV1, type VerificationReceiptV1 } from "./taskObjective.js";
20
20
  import { PROMPT_CONTEXT_SELECTION, PROVIDER_RESPONSE_PARSER, REQUIRED_PROVIDER_SOURCES, type RequiredProviderSource, type PromptContextSelection, type ProviderContextAudit } from "./provider-context-contract.js";
21
21
  import { type TerminalTaskReport } from "./terminalTaskReport.js";
22
- import { type TerminalRuntimeFailure } from "./completionFinalization.js";
22
+ import { type NativePendingProviderDeliveryV1, type NativeProviderDeliveryAckV1 } from "./native-provider-delivery.js";
23
+ import { type CompletionFinalizationRecord, type TerminalRuntimeFailure } from "./completionFinalization.js";
23
24
  import { type CompletionReadinessSnapshot } from "./completionReadiness.js";
24
25
  import { type CompletionDeliveryReceipt, type ExpectedOutcomeAssessmentV1, type ExpectedOutcomeContractV1, type ExpectedOutcomeRequiredEffectV1 } from "./expectedOutcomeContract.js";
25
26
  import { type TodoSnapshot } from "./todoObservability.js";
@@ -190,6 +191,10 @@ export interface AgenticTool {
190
191
  /** Private execution-time identity; never permission, progress or effect authority. */
191
192
  getHistoryObservationIdentity?: (args: Record<string, unknown>, result: AgenticToolResult) => string | null;
192
193
  getCommandExecutionObservation?: (args: Record<string, unknown>, result: AgenticToolResult) => unknown;
194
+ readIssuedOperationObservation?: (args: Record<string, unknown>, result: AgenticToolResult) => unknown;
195
+ returnedHttpSourceConsumer?: Readonly<{
196
+ selector: 'source_ref';
197
+ }>;
193
198
  readIssuedChildEvidence?: (result: AgenticToolResult) => readonly import("../execution/native-child-evidence.js").NativeChildEvidenceV1[];
194
199
  getNativeFileWriteObservation?: (args: Record<string, unknown>, result: AgenticToolResult) => unknown;
195
200
  getDesktopVerificationScope?: () => DesktopVerificationScope | undefined;
@@ -415,7 +420,23 @@ export type NativeToolAttemptObservation = Readonly<{
415
420
  ownerId: string;
416
421
  ownerGeneration: number;
417
422
  }>;
423
+ /** Documented core generation limit; frontends resolve an absent setting once. */
424
+ export declare const DEFAULT_AGENTIC_MAX_TOKENS = 16384;
425
+ /** Facts read only from an original decision issued by the native frontend. */
426
+ export interface NativeInteractiveDecisionV1 {
427
+ readonly inputId: string;
428
+ readonly inputSha256: string;
429
+ readonly sessionId: string;
430
+ readonly runId: string;
431
+ readonly taskEpoch: number;
432
+ readonly ownerGeneration: number;
433
+ readonly disposition: 'independent_reply' | 'steer' | 'pause' | 'resume' | 'replace' | 'stop' | 'unresolved';
434
+ }
418
435
  export interface AgenticRunnerOptions {
436
+ /** Pinned native issuer reader. Copied decisions and checkpoint JSON grant nothing. */
437
+ readNativeInteractiveDecision?: (original: unknown) => Readonly<NativeInteractiveDecisionV1> | undefined;
438
+ /** Pinned original host ACK reader; JSON or a surface flag never supplies delivery authority. */
439
+ readNativeProviderDeliveryAck?: (original: unknown, pending: Readonly<NativePendingProviderDeliveryV1>) => Readonly<NativeProviderDeliveryAckV1> | undefined;
419
440
  /** Experimental native composition. Only an opaque host-issued fixed child policy enables it. */
420
441
  toolComposition?: HostToolCompositionPolicy;
421
442
  /** Opt-in operator audit data before context/display clipping. Never model input or completion evidence. */
@@ -1256,6 +1277,7 @@ export interface StreamChunk {
1256
1277
  promptTokens: number;
1257
1278
  completionTokens: number;
1258
1279
  totalTokens: number;
1280
+ cacheReadInputTokens?: number;
1259
1281
  costUsd?: number;
1260
1282
  };
1261
1283
  }
@@ -1367,6 +1389,8 @@ export interface RequirementReviewExhaustionV1 {
1367
1389
  workPlanSha256?: string;
1368
1390
  }
1369
1391
  export interface AgenticResult {
1392
+ /** Original nonterminal delivery ticket. Decoding/copying it grants nothing. */
1393
+ pendingProviderDelivery?: Readonly<NativePendingProviderDeliveryV1>;
1370
1394
  status: "completed" | "incomplete_verification" | "incomplete" | "awaiting_input";
1371
1395
  completed: boolean;
1372
1396
  turns: number;
@@ -1684,6 +1708,14 @@ export interface TodoReminderResult {
1684
1708
  */
1685
1709
  export declare function computeTodoReminder(input: TodoReminderInput): TodoReminderResult;
1686
1710
  export declare class AgenticRunner {
1711
+ #private;
1712
+ private readonly _readNativeInteractiveDecision?;
1713
+ private readonly _readNativeProviderDeliveryAck?;
1714
+ private readonly _nativeInteractiveDecisions;
1715
+ private readonly _issuedSteeringReplyPackets;
1716
+ private readonly _appendOnlySteeringChains;
1717
+ private _appendOnlySteeringSequence;
1718
+ private readonly _appendOnlySteeringCarriers;
1687
1719
  private backend;
1688
1720
  private tools;
1689
1721
  private options;
@@ -3867,6 +3899,10 @@ export declare class AgenticRunner {
3867
3899
  * active turn, which closes the old bridge-to-runner message-loss race.
3868
3900
  */
3869
3901
  injectSteeringInput(input: SteeringInput): SteeringIntakeReceipt;
3902
+ /** Stage a native model decision against its already admitted exact input.
3903
+ * It becomes effective only after the ordinary safe-boundary durable commit. */
3904
+ acceptNativeInteractiveDecision(original: unknown): boolean;
3905
+ private _applyNativeInteractiveDecisionsAtBoundary;
3870
3906
  /** A small communication snapshot, independent of atomic tool completion.
3871
3907
  * The full input remains in the ordinary steering and reconciliation path. */
3872
3908
  captureSteeringReply(inputId: string): {
@@ -3994,6 +4030,8 @@ export declare class AgenticRunner {
3994
4030
  /** Retract the last pending user message (Esc cancel).
3995
4031
  * Returns the retracted text, or null if queue is empty or already consumed. */
3996
4032
  retractLastPendingMessage(): string | null;
4033
+ /** Retain source/goal/effect history, revoke only this owner's live controls. */
4034
+ private _revokeInteractiveControlForStop;
3997
4035
  /** Abort the current task run through the generation-bound stop lineage. */
3998
4036
  abort(): InterruptionTransitionReceipt | null;
3999
4037
  /** Get the current abort signal for passing to fetch/spawn */
@@ -4008,6 +4046,12 @@ export declare class AgenticRunner {
4008
4046
  /** Current run identity and epoch, exposed for frontends that persist intake. */
4009
4047
  get taskEpoch(): number;
4010
4048
  get activeRunId(): string;
4049
+ private _nativeProviderDeliveryScope;
4050
+ private _stageNativeProviderDelivery;
4051
+ /** Original hot custody only. A cold/JSON ticket cannot reissue delivery or completion. */
4052
+ isCurrentPendingProviderDelivery(original: unknown): boolean;
4053
+ /** No model/tool invocation. The pinned native host issuer proves the whole delivered presentation. */
4054
+ acknowledgePendingProviderDelivery(pendingOriginal: unknown, ackOriginal: unknown): Promise<CompletionFinalizationRecord | null>;
4011
4055
  /** Detached current-owner evidence for frontend preparation decisions. */
4012
4056
  getCurrentCompletionLedgerSnapshot(): CompletionLedger | null;
4013
4057
  /** Exact admitted intake, including reconciled records and human replies;
@@ -4157,6 +4201,7 @@ export declare class AgenticRunner {
4157
4201
  private _renderSteeringResolutionNotice;
4158
4202
  /** Parse the registered control region, never a semantic textual mention. */
4159
4203
  private _reconcileActiveSteeringFromModel;
4204
+ private _commitSteeringReconciliation;
4160
4205
  /** Change only the privately owned live intake decoration after commit.
4161
4206
  * Original user turns and source/tool history remain unchanged. */
4162
4207
  private _projectResolvedSteeringIntake;
@@ -4667,6 +4712,7 @@ export declare class AgenticRunner {
4667
4712
  * not depend on raw tool messages surviving compaction. */
4668
4713
  private _recentToolOutcomes;
4669
4714
  private readonly _nativeShellProgressProofs;
4715
+ private readonly _nativeOperationProgressProofs;
4670
4716
  /** Recent successful user-work mutations suppress generic "create again" nudges. */
4671
4717
  private _groundTruthSuccessPaths;
4672
4718
  /** Monotonic counter for observed local state changes.
@@ -4730,6 +4776,8 @@ export declare class AgenticRunner {
4730
4776
  */
4731
4777
  private _buildRecentActionGroundTruth;
4732
4778
  private _nativeShellProgressIsCurrent;
4779
+ private _nativeOperationProgressIsCurrent;
4780
+ private _nativeOperationRepetitions;
4733
4781
  private _equivalentNativeObservations;
4734
4782
  /** Legacy REG/recovery prose is retained in telemetry only, never in model history. */
4735
4783
  private _isLegacyControlMessage;
@@ -251,6 +251,8 @@ export interface CompletionLedger {
251
251
  }>;
252
252
  };
253
253
  status: CompletionLedgerStatus;
254
+ /** Durable pending custody only. Cold JSON does not restore the native ticket or ACK authority. */
255
+ pendingProviderDelivery?: import("./native-provider-delivery.js").NativeProviderDeliveryStageV1;
254
256
  /** Immutable terminal authority record used to reconcile all projections. */
255
257
  terminal?: {
256
258
  receiptId: string;
@@ -1,4 +1,5 @@
1
1
  import { type CanonicalEvidenceReceiptInput, type CanonicalTaskFrameProjection } from "./canonical-context-projection.js";
2
+ import type { NativeMemoryReadFacts } from "../execution/native-memory-operation-observation.js";
2
3
  export interface ModelFacingCanonicalMetadataProjection {
3
4
  content: string | null;
4
5
  audit: {
@@ -91,11 +92,32 @@ export interface ModelFacingChildFacts {
91
92
  completionBoundary?: string;
92
93
  terminalProof?: string;
93
94
  }
95
+ export interface ModelFacingOperationRepetitionFacts {
96
+ tool: string;
97
+ producerRef: string;
98
+ toolSchemaSha256: string;
99
+ argumentsSha256: string;
100
+ callIds: string[];
101
+ occurrences: {
102
+ count: number;
103
+ firstTurn: number;
104
+ lastTurn: number;
105
+ };
106
+ returnedSuccessCount: number;
107
+ returnedErrorCount: number;
108
+ distinctNativeResultCount: number;
109
+ partialOrUnavailableCount: number;
110
+ latestMemoryRead?: Readonly<NativeMemoryReadFacts>;
111
+ distinctMemorySourceManifestCount?: number;
112
+ }
94
113
  export interface ModelFacingChildCoverage {
95
114
  status: 'available' | 'partial';
96
115
  maxWorkers: number;
97
116
  omittedObservations: number;
98
117
  }
118
+ /** Full exact accepted source, separate from changing execution observations. */
119
+ export declare const MODEL_FACING_ACCEPTED_GOAL_MARKER = "[ACCEPTED NATIVE GOAL v1]";
120
+ export declare function renderModelFacingAcceptedGoal(acceptedGoal: string): string;
99
121
  /** Explicit producer fields only; no recursive key/text stripping of source data. */
100
122
  export declare function renderModelFacingRunObservations(input: {
101
123
  acceptedGoal?: string;
@@ -104,10 +126,18 @@ export declare function renderModelFacingRunObservations(input: {
104
126
  text: string;
105
127
  }[];
106
128
  equivalentObservations?: readonly ModelFacingEquivalentObservationFacts[];
129
+ operationRepetitions?: readonly ModelFacingOperationRepetitionFacts[];
130
+ operationObservationCoverage?: {
131
+ window: string;
132
+ qualifiedReturns: number;
133
+ unavailableReturns: number;
134
+ };
107
135
  childEvidence?: readonly ModelFacingChildFacts[];
108
136
  childEvidenceCoverage?: ModelFacingChildCoverage;
109
137
  modifiedFiles?: readonly string[];
110
138
  todos?: readonly ModelFacingTodoFacts[];
111
139
  verification?: ModelFacingVerificationFacts | null;
112
140
  requirements?: readonly ModelFacingRequirementFacts[];
141
+ }, options?: {
142
+ onAcceptedGoal?: (acceptedGoal: string) => void;
113
143
  }): string | null;
@@ -0,0 +1,45 @@
1
+ import type { CompletionDeliveryReceipt } from "./expectedOutcomeContract.js";
2
+ /** Historical metadata alone never restores the original native ticket. */
3
+ export interface NativePendingProviderDeliveryV1 {
4
+ readonly schema: 'omnius.native-pending-provider-delivery.v1';
5
+ readonly id: string;
6
+ readonly sessionId: string;
7
+ readonly runId: string;
8
+ readonly taskEpoch: number;
9
+ readonly ownerId: string;
10
+ readonly ownerGeneration: number;
11
+ readonly toolCallId: string;
12
+ readonly candidateSha256: string;
13
+ readonly scopeSha256: string;
14
+ }
15
+ /** Only the constructor-pinned host reader may attest an original whole ACK. */
16
+ export interface NativeProviderDeliveryAckV1 {
17
+ readonly pending: Readonly<NativePendingProviderDeliveryV1>;
18
+ readonly candidateSha256: string;
19
+ readonly presentationSha256: string;
20
+ readonly receipts: readonly CompletionDeliveryReceipt[];
21
+ readonly assertCurrent: () => void;
22
+ }
23
+ /** Durable custody, not an issuer or a cold execution/completion grant. */
24
+ export interface NativeProviderDeliveryStageV1 {
25
+ readonly ticket: Readonly<NativePendingProviderDeliveryV1>;
26
+ readonly candidate: string;
27
+ readonly evidenceSnapshotSha256: string;
28
+ readonly effectStateSha256: string;
29
+ readonly readinessHash: string;
30
+ readonly acknowledged?: {
31
+ readonly presentationSha256: string;
32
+ readonly receipts: readonly CompletionDeliveryReceipt[];
33
+ };
34
+ }
35
+ /** A native restriction: no automatic inference/tool replay of undelivered completion custody. */
36
+ export declare class NativeProviderDeliveryHoldError extends Error {
37
+ readonly reason: 'cold_pending_delivery_unavailable' | 'pending_delivery_storage_unavailable';
38
+ readonly workspaceRoot: string;
39
+ readonly sessionId: string;
40
+ readonly runId: string;
41
+ readonly taskEpoch: number;
42
+ readonly ledgerPath?: string | undefined;
43
+ readonly code = "native_pending_provider_delivery_hold";
44
+ constructor(reason: 'cold_pending_delivery_unavailable' | 'pending_delivery_storage_unavailable', workspaceRoot: string, sessionId: string, runId: string, taskEpoch: number, ledgerPath?: string | undefined);
45
+ }