omnius 1.0.956 → 1.0.958
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.
- package/dist/_types/execution/mcp/client.d.ts +121 -0
- package/dist/_types/execution/mcp/returned-http-source.d.ts +65 -0
- package/dist/_types/execution/mcp/types.d.ts +7 -0
- package/dist/_types/execution/native-child-evidence.d.ts +44 -0
- package/dist/_types/execution/native-operation-observation.d.ts +32 -0
- package/dist/_types/execution/nol/gguf-control-reader.d.ts +1 -1
- package/dist/_types/execution/nol/pytorch-control-reader.d.ts +1 -1
- package/dist/_types/execution/tools/web-fetch.d.ts +11 -0
- package/dist/_types/execution/types.d.ts +9 -0
- package/dist/_types/orchestrator/agenticRunner.d.ts +20 -0
- package/dist/_types/orchestrator/model-facing-metadata.d.ts +135 -0
- package/dist/api/py-embed.js +65 -39
- package/dist/index.js +2 -2
- package/dist/library.js +3212 -2883
- package/dist/omni-setup-worker.js +65 -39
- package/dist/update-worker-runtime.js +118 -82
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -1
|
@@ -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
|
+
/** Exact host invocation identity. Model arguments and JSON cannot issue it. */
|
|
2
|
+
export interface NativeChildInvocation {
|
|
3
|
+
readonly runId: string;
|
|
4
|
+
readonly taskEpoch: number;
|
|
5
|
+
readonly toolCallId: string;
|
|
6
|
+
readonly toolName: 'agent' | 'full_sub_agent';
|
|
7
|
+
readonly assertCurrent: () => void;
|
|
8
|
+
}
|
|
9
|
+
export type NativeChildParentInvocation = Readonly<Pick<NativeChildInvocation, 'runId' | 'taskEpoch' | 'toolCallId' | 'toolName'>>;
|
|
10
|
+
export interface NativeChildEvidenceV1 {
|
|
11
|
+
readonly schema: 'omnius.native-child-evidence.v1';
|
|
12
|
+
readonly toolName: 'agent' | 'full_sub_agent';
|
|
13
|
+
readonly childId: string;
|
|
14
|
+
readonly state: 'created' | 'started' | 'completed' | 'failed' | 'stopped';
|
|
15
|
+
readonly observedAt: string;
|
|
16
|
+
/** Original spawn identity, including for later status/output observations. */
|
|
17
|
+
readonly parentInvocation: NativeChildParentInvocation;
|
|
18
|
+
readonly observedInvocation: NativeChildParentInvocation;
|
|
19
|
+
readonly completionBoundary: 'native_runner_return' | 'process_exit';
|
|
20
|
+
/** Agent returns require the CLI's independently issued original-return witness. */
|
|
21
|
+
readonly terminalProof: 'unavailable' | 'original_process_return';
|
|
22
|
+
readonly childRunId?: string;
|
|
23
|
+
readonly childTaskEpoch?: number;
|
|
24
|
+
readonly terminalReceiptRef?: string;
|
|
25
|
+
readonly summary?: string;
|
|
26
|
+
readonly modifiedFiles: readonly string[];
|
|
27
|
+
readonly artifactRefs: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
/** Reader only. Minting state stays inside the actual native producer modules. */
|
|
30
|
+
export declare function readIssuedNativeChildEvidence(value: unknown): Readonly<NativeChildEvidenceV1> | undefined;
|
|
31
|
+
/** Original producer return identity, never serialized data or a permission. */
|
|
32
|
+
export declare function readNativeChildTerminalSource(value: unknown): unknown;
|
|
33
|
+
export declare function nativeChildResultIdentity(result: {
|
|
34
|
+
success: boolean;
|
|
35
|
+
output: string;
|
|
36
|
+
error?: string;
|
|
37
|
+
llmContent?: string;
|
|
38
|
+
mutated?: boolean;
|
|
39
|
+
mutatedFiles?: string[];
|
|
40
|
+
partial?: boolean;
|
|
41
|
+
noop?: boolean;
|
|
42
|
+
dryRun?: boolean;
|
|
43
|
+
data?: unknown;
|
|
44
|
+
}): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface NativeToolOperationInvocation {
|
|
2
|
+
readonly workspaceRoot: string;
|
|
3
|
+
readonly sessionId: string;
|
|
4
|
+
readonly runId: string;
|
|
5
|
+
readonly taskEpoch: number;
|
|
6
|
+
readonly ownerId: string;
|
|
7
|
+
readonly ownerGeneration: number;
|
|
8
|
+
readonly toolCallId: string;
|
|
9
|
+
readonly toolName: string;
|
|
10
|
+
readonly assertCurrent: () => void;
|
|
11
|
+
readonly signal?: AbortSignal;
|
|
12
|
+
readonly returnedSourceConsumer?: Readonly<{
|
|
13
|
+
toolName: string;
|
|
14
|
+
selector: 'source_ref';
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
export interface NativeToolOperationObservationV1 {
|
|
18
|
+
readonly schema: 'omnius.native-operation-observation.v1';
|
|
19
|
+
readonly scope: Readonly<Omit<NativeToolOperationInvocation, 'assertCurrent' | 'signal'>>;
|
|
20
|
+
readonly producerRef: string;
|
|
21
|
+
readonly toolSchemaSha256: string;
|
|
22
|
+
readonly argumentsSha256: string;
|
|
23
|
+
readonly nativeResultSha256?: string;
|
|
24
|
+
readonly coverage: 'complete' | 'partial' | 'unavailable';
|
|
25
|
+
/** Native producer return status, not business success, body consumption or task readiness. */
|
|
26
|
+
readonly returnedStatus: 'success' | 'error';
|
|
27
|
+
readonly observedAt: string;
|
|
28
|
+
}
|
|
29
|
+
/** Pure identity helper. This function cannot issue an observation or permission. */
|
|
30
|
+
export declare function nativeOperationDigest(value: unknown): string;
|
|
31
|
+
/** Reader only. Fixed native producers keep their issuance maps private. */
|
|
32
|
+
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;
|
|
@@ -227,6 +227,9 @@ export interface AuxiliaryOperationBinding {
|
|
|
227
227
|
readonly __auxiliaryOperationBinding?: never;
|
|
228
228
|
}
|
|
229
229
|
export interface ToolInvocationContext {
|
|
230
|
+
/** Original host child-dispatch identity; preserve by reference through adapters. */
|
|
231
|
+
nativeChildInvocation?: Readonly<import("./native-child-evidence.js").NativeChildInvocation>;
|
|
232
|
+
nativeOperationInvocation?: Readonly<import("./native-operation-observation.js").NativeToolOperationInvocation>;
|
|
230
233
|
/** Native FileWrite result correlation only; never supplied by model arguments. */
|
|
231
234
|
nativeFileWriteInvocation?: Readonly<import("./native-file-write-observation.js").NativeFileWriteInvocationScope>;
|
|
232
235
|
/** Preserve this exact host identity while composing cell-local guards. JSON copies grant nothing. */
|
|
@@ -465,8 +468,14 @@ export interface Tool {
|
|
|
465
468
|
getHistoryObservationIdentity?: (args: Record<string, unknown>, result: ToolResult) => string | null;
|
|
466
469
|
/** Exact native command result custody, including failures; model JSON cannot issue it. */
|
|
467
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
|
+
}>;
|
|
468
475
|
/** Original native FileWrite result proof; JSON/copies cannot issue it. */
|
|
469
476
|
getNativeFileWriteObservation?: (args: Record<string, unknown>, result: ToolResult) => unknown;
|
|
477
|
+
/** Original producer result custody; returned JSON never grants child evidence. */
|
|
478
|
+
readIssuedChildEvidence?: (result: ToolResult) => readonly import("./native-child-evidence.js").NativeChildEvidenceV1[];
|
|
470
479
|
/** Current provider desktop/session identity. Host-only; unavailable is fail-closed. */
|
|
471
480
|
getDesktopVerificationScope?: () => DesktopVerificationScope | undefined;
|
|
472
481
|
/** Host-owned semantic identity evaluated before external-effect dispatch. */
|
|
@@ -190,6 +190,11 @@ export interface AgenticTool {
|
|
|
190
190
|
/** Private execution-time identity; never permission, progress or effect authority. */
|
|
191
191
|
getHistoryObservationIdentity?: (args: Record<string, unknown>, result: AgenticToolResult) => string | null;
|
|
192
192
|
getCommandExecutionObservation?: (args: Record<string, unknown>, result: AgenticToolResult) => unknown;
|
|
193
|
+
readIssuedOperationObservation?: (args: Record<string, unknown>, result: AgenticToolResult) => unknown;
|
|
194
|
+
returnedHttpSourceConsumer?: Readonly<{
|
|
195
|
+
selector: 'source_ref';
|
|
196
|
+
}>;
|
|
197
|
+
readIssuedChildEvidence?: (result: AgenticToolResult) => readonly import("../execution/native-child-evidence.js").NativeChildEvidenceV1[];
|
|
193
198
|
getNativeFileWriteObservation?: (args: Record<string, unknown>, result: AgenticToolResult) => unknown;
|
|
194
199
|
getDesktopVerificationScope?: () => DesktopVerificationScope | undefined;
|
|
195
200
|
/**
|
|
@@ -788,6 +793,15 @@ export interface AgenticRunnerOptions {
|
|
|
788
793
|
* path must never block tool calls.
|
|
789
794
|
*/
|
|
790
795
|
disableAdversaryCritic?: boolean;
|
|
796
|
+
/** Host-observed native children for factual display; never a permission or completion grant. */
|
|
797
|
+
currentNativeChildFacts?: () => readonly import("./model-facing-metadata.js").ModelFacingChildFacts[] | undefined;
|
|
798
|
+
currentNativeChildCoverage?: () => import("./model-facing-metadata.js").ModelFacingChildCoverage | undefined;
|
|
799
|
+
/** Exact authenticated frontend goal; no parsing of formatted task/history is required. */
|
|
800
|
+
currentAcceptedNativeGoal?: () => string | undefined;
|
|
801
|
+
currentAdoptedNativeHumanInputs?: () => readonly {
|
|
802
|
+
inputId: string;
|
|
803
|
+
text: string;
|
|
804
|
+
}[] | undefined;
|
|
791
805
|
/** @deprecated Use disableAdversaryCritic. */
|
|
792
806
|
disableStepCritic?: boolean;
|
|
793
807
|
/**
|
|
@@ -4656,6 +4670,8 @@ export declare class AgenticRunner {
|
|
|
4656
4670
|
* adversary buffer, this is populated directly after tool execution and does
|
|
4657
4671
|
* not depend on raw tool messages surviving compaction. */
|
|
4658
4672
|
private _recentToolOutcomes;
|
|
4673
|
+
private readonly _nativeShellProgressProofs;
|
|
4674
|
+
private readonly _nativeOperationProgressProofs;
|
|
4659
4675
|
/** Recent successful user-work mutations suppress generic "create again" nudges. */
|
|
4660
4676
|
private _groundTruthSuccessPaths;
|
|
4661
4677
|
/** Monotonic counter for observed local state changes.
|
|
@@ -4718,6 +4734,10 @@ export declare class AgenticRunner {
|
|
|
4718
4734
|
* changing user messages, assistant history, or linked tool results.
|
|
4719
4735
|
*/
|
|
4720
4736
|
private _buildRecentActionGroundTruth;
|
|
4737
|
+
private _nativeShellProgressIsCurrent;
|
|
4738
|
+
private _nativeOperationProgressIsCurrent;
|
|
4739
|
+
private _nativeOperationRepetitions;
|
|
4740
|
+
private _equivalentNativeObservations;
|
|
4721
4741
|
/** Legacy REG/recovery prose is retained in telemetry only, never in model history. */
|
|
4722
4742
|
private _isLegacyControlMessage;
|
|
4723
4743
|
private _stripLegacyControlMessages;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { type CanonicalEvidenceReceiptInput, type CanonicalTaskFrameProjection } from "./canonical-context-projection.js";
|
|
2
|
+
export interface ModelFacingCanonicalMetadataProjection {
|
|
3
|
+
content: string | null;
|
|
4
|
+
audit: {
|
|
5
|
+
reason: "projected" | "unchanged_unmatched_producer_frame" | "empty";
|
|
6
|
+
originalBytes: number;
|
|
7
|
+
modelFacingBytes: number;
|
|
8
|
+
/** Internal identities stay available to custody/trace code, outside the model text. */
|
|
9
|
+
includedSignalIds: string[];
|
|
10
|
+
compactedReceiptSignalIds: string[];
|
|
11
|
+
duplicateReceiptSignalIds: string[];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Takes the authentic producer's structured frame, never arbitrary message text.
|
|
16
|
+
* Re-rendering verifies the descriptor/content binding before any projection.
|
|
17
|
+
* Non-receipt bodies are opaque and byte-exact. Only verified receipt display
|
|
18
|
+
* metadata is reduced; native messages, pending calls and protocol IDs are not
|
|
19
|
+
* inputs to this function and cannot be changed by it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function projectModelFacingCanonicalFrame(input: {
|
|
22
|
+
projection: Readonly<CanonicalTaskFrameProjection>;
|
|
23
|
+
receiptsBySignalId?: ReadonlyMap<string, Readonly<CanonicalEvidenceReceiptInput>>;
|
|
24
|
+
}): ModelFacingCanonicalMetadataProjection;
|
|
25
|
+
export interface ModelFacingTodoFacts {
|
|
26
|
+
id: string;
|
|
27
|
+
content: string;
|
|
28
|
+
status: string;
|
|
29
|
+
parentId?: string;
|
|
30
|
+
blockedBy?: readonly string[];
|
|
31
|
+
owner?: string;
|
|
32
|
+
activeForm?: string;
|
|
33
|
+
blocker?: string;
|
|
34
|
+
completionJustification?: string;
|
|
35
|
+
verifyCommand?: string;
|
|
36
|
+
declaredArtifacts?: readonly string[];
|
|
37
|
+
sourceRefs?: readonly string[];
|
|
38
|
+
targetRefs?: readonly unknown[];
|
|
39
|
+
requirementIds?: readonly string[];
|
|
40
|
+
acceptanceIds?: readonly string[];
|
|
41
|
+
workKind?: string;
|
|
42
|
+
actionContract?: unknown;
|
|
43
|
+
}
|
|
44
|
+
export interface ModelFacingRequirementFacts {
|
|
45
|
+
id: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
status: string;
|
|
48
|
+
mode?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ModelFacingVerificationFacts {
|
|
51
|
+
passed?: boolean;
|
|
52
|
+
summary?: string;
|
|
53
|
+
error?: string;
|
|
54
|
+
exitCode?: number;
|
|
55
|
+
artifact?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ModelFacingEquivalentObservationFacts {
|
|
58
|
+
tool: string;
|
|
59
|
+
argumentSha256: string;
|
|
60
|
+
observationSha256: string;
|
|
61
|
+
callIds: string[];
|
|
62
|
+
occurrences: {
|
|
63
|
+
count: number;
|
|
64
|
+
firstTurn: number;
|
|
65
|
+
lastTurn: number;
|
|
66
|
+
firstObservedAt?: string;
|
|
67
|
+
lastObservedAt?: string;
|
|
68
|
+
};
|
|
69
|
+
outcome: {
|
|
70
|
+
success: boolean;
|
|
71
|
+
exitCode: number | null;
|
|
72
|
+
capture: string;
|
|
73
|
+
stdout: {
|
|
74
|
+
bytes: number;
|
|
75
|
+
sha256?: string;
|
|
76
|
+
};
|
|
77
|
+
stderr: {
|
|
78
|
+
bytes: number;
|
|
79
|
+
sha256?: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface ModelFacingChildFacts {
|
|
84
|
+
childId: string;
|
|
85
|
+
state: string;
|
|
86
|
+
toolCallId?: string;
|
|
87
|
+
summary?: string;
|
|
88
|
+
modifiedFiles: readonly string[];
|
|
89
|
+
artifactRefs: readonly string[];
|
|
90
|
+
nativeCompletionVerified?: boolean;
|
|
91
|
+
completionBoundary?: string;
|
|
92
|
+
terminalProof?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface ModelFacingOperationRepetitionFacts {
|
|
95
|
+
tool: string;
|
|
96
|
+
producerRef: string;
|
|
97
|
+
toolSchemaSha256: string;
|
|
98
|
+
argumentsSha256: string;
|
|
99
|
+
callIds: string[];
|
|
100
|
+
occurrences: {
|
|
101
|
+
count: number;
|
|
102
|
+
firstTurn: number;
|
|
103
|
+
lastTurn: number;
|
|
104
|
+
};
|
|
105
|
+
returnedSuccessCount: number;
|
|
106
|
+
returnedErrorCount: number;
|
|
107
|
+
distinctNativeResultCount: number;
|
|
108
|
+
partialOrUnavailableCount: number;
|
|
109
|
+
}
|
|
110
|
+
export interface ModelFacingChildCoverage {
|
|
111
|
+
status: 'available' | 'partial';
|
|
112
|
+
maxWorkers: number;
|
|
113
|
+
omittedObservations: number;
|
|
114
|
+
}
|
|
115
|
+
/** Explicit producer fields only; no recursive key/text stripping of source data. */
|
|
116
|
+
export declare function renderModelFacingRunObservations(input: {
|
|
117
|
+
acceptedGoal?: string;
|
|
118
|
+
adoptedHumanInputs?: readonly {
|
|
119
|
+
inputId: string;
|
|
120
|
+
text: string;
|
|
121
|
+
}[];
|
|
122
|
+
equivalentObservations?: readonly ModelFacingEquivalentObservationFacts[];
|
|
123
|
+
operationRepetitions?: readonly ModelFacingOperationRepetitionFacts[];
|
|
124
|
+
operationObservationCoverage?: {
|
|
125
|
+
window: string;
|
|
126
|
+
qualifiedReturns: number;
|
|
127
|
+
unavailableReturns: number;
|
|
128
|
+
};
|
|
129
|
+
childEvidence?: readonly ModelFacingChildFacts[];
|
|
130
|
+
childEvidenceCoverage?: ModelFacingChildCoverage;
|
|
131
|
+
modifiedFiles?: readonly string[];
|
|
132
|
+
todos?: readonly ModelFacingTodoFacts[];
|
|
133
|
+
verification?: ModelFacingVerificationFacts | null;
|
|
134
|
+
requirements?: readonly ModelFacingRequirementFacts[];
|
|
135
|
+
}): string | null;
|