omnius 1.0.953 → 1.0.955

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.
Files changed (45) hide show
  1. package/dist/_types/execution/native-file-write-observation.d.ts +19 -0
  2. package/dist/_types/execution/native-memory-view-provider.d.ts +84 -0
  3. package/dist/_types/execution/shell-runs.d.ts +4 -0
  4. package/dist/_types/execution/tool-output-spool.d.ts +61 -0
  5. package/dist/_types/execution/tools/file-write.d.ts +53 -0
  6. package/dist/_types/execution/types.d.ts +34 -0
  7. package/dist/_types/execution/work-mode-capability.d.ts +23 -0
  8. package/dist/_types/memory/candidateCoverage.d.ts +23 -0
  9. package/dist/_types/memory/embeddings.d.ts +1 -1
  10. package/dist/_types/memory/memoryCapability.d.ts +259 -0
  11. package/dist/_types/memory/memorySourceResolver.d.ts +131 -0
  12. package/dist/_types/memory/memoryTypes.d.ts +16 -0
  13. package/dist/_types/memory/structuredMemoryStore.d.ts +63 -6
  14. package/dist/_types/memory/unifiedMemoryStore.d.ts +12 -1
  15. package/dist/_types/orchestrator/agenticRunner.d.ts +236 -48
  16. package/dist/_types/orchestrator/authored-instruction-context.d.ts +59 -0
  17. package/dist/_types/orchestrator/authored-instruction-revisions.d.ts +56 -0
  18. package/dist/_types/orchestrator/authored-instruction-sources.d.ts +60 -0
  19. package/dist/_types/orchestrator/auxiliary-context-operation.d.ts +196 -0
  20. package/dist/_types/orchestrator/brokered-tool-composition.d.ts +141 -0
  21. package/dist/_types/orchestrator/completionReadiness.d.ts +2 -2
  22. package/dist/_types/orchestrator/confined-composition-worker.d.ts +45 -0
  23. package/dist/_types/orchestrator/contentAddressedArtifactStore.d.ts +173 -0
  24. package/dist/_types/orchestrator/contextWindowDump.d.ts +4 -0
  25. package/dist/_types/orchestrator/explicit-work-mode.d.ts +92 -0
  26. package/dist/_types/orchestrator/interruption-lifecycle.d.ts +3 -0
  27. package/dist/_types/orchestrator/memory-capability-context.d.ts +49 -0
  28. package/dist/_types/orchestrator/owned-inference-wait.d.ts +123 -0
  29. package/dist/_types/orchestrator/owned-model-wait.d.ts +26 -0
  30. package/dist/_types/orchestrator/provider-context-contract.d.ts +78 -0
  31. package/dist/_types/orchestrator/request-tool-capabilities.d.ts +52 -0
  32. package/dist/_types/orchestrator/structured-memory-extraction-worker.d.ts +20 -0
  33. package/dist/_types/orchestrator/structuredMemoryInference.d.ts +12 -0
  34. package/dist/_types/orchestrator/successful-procedure-memory.d.ts +35 -0
  35. package/dist/api/py-embed.js +70 -17
  36. package/dist/index.js +2 -2
  37. package/dist/library.js +115267 -108004
  38. package/dist/memory-maintenance-worker.js +486 -81
  39. package/dist/omni-setup-worker.js +83 -30
  40. package/dist/tui/native/worker.js +3 -1
  41. package/dist/update-worker-runtime.js +270 -126
  42. package/docs/DISCOVERY.json +63 -0
  43. package/docs/DISCOVERY.md +1 -0
  44. package/npm-shrinkwrap.json +2 -2
  45. package/package.json +1 -1
@@ -0,0 +1,56 @@
1
+ import { ContentAddressedArtifactStore } from "./contentAddressedArtifactStore.js";
2
+ import { type AuthoredInstructionSourceV1, type AuthoredInstructionSourcesV1 } from "./authored-instruction-sources.js";
3
+ export declare const AUTHORED_INSTRUCTION_REVISION_MARKER = "[AUTHORED INSTRUCTION REVISION v1]";
4
+ export interface AuthoredInstructionRevisionSelectionV1 {
5
+ schema: "omnius.authored-instruction-revision-selection.v1";
6
+ epoch: string;
7
+ sequence: number;
8
+ transactionRef: string;
9
+ baselineRef: string;
10
+ }
11
+ export interface AuthoredInstructionRevisionSourceV1 {
12
+ key: string;
13
+ path: string;
14
+ kind: AuthoredInstructionSourceV1["kind"];
15
+ order: number;
16
+ status: AuthoredInstructionSourceV1["status"];
17
+ reasonCode?: string;
18
+ reference?: string;
19
+ sha256?: string;
20
+ version?: string;
21
+ bytes?: number;
22
+ }
23
+ export interface AuthoredInstructionRevisionChangeV1 {
24
+ key: string;
25
+ before?: AuthoredInstructionRevisionSourceV1;
26
+ after: AuthoredInstructionRevisionSourceV1;
27
+ }
28
+ export interface AuthoredInstructionRevisionTransactionV1 {
29
+ schema: "omnius.authored-instruction-revision-transaction.v1";
30
+ workspaceRoot: string;
31
+ epoch: string;
32
+ sequence: number;
33
+ sourceSetRef: string;
34
+ previousRef?: string;
35
+ mode: "baseline" | "delta";
36
+ sources: AuthoredInstructionRevisionSourceV1[];
37
+ changes: AuthoredInstructionRevisionChangeV1[];
38
+ }
39
+ export interface AuthoredInstructionRevisionHeadV1 extends AuthoredInstructionRevisionSelectionV1 {
40
+ workspaceRoot: string;
41
+ sourceSetRef: string;
42
+ }
43
+ type Head = AuthoredInstructionRevisionHeadV1;
44
+ export declare function authoredInstructionSourceKey(source: Pick<AuthoredInstructionSourceV1, "path" | "kind">): string;
45
+ export declare function authoredInstructionRevisionSource(source: AuthoredInstructionSourceV1): AuthoredInstructionRevisionSourceV1;
46
+ export declare function authoredInstructionSourceRevision(source: AuthoredInstructionSourceV1): string;
47
+ export declare function isAuthoredInstructionRevisionSelectionV1(value: unknown): value is AuthoredInstructionRevisionSelectionV1;
48
+ export declare function isAuthoredInstructionRevisionTransactionV1(value: unknown): value is AuthoredInstructionRevisionTransactionV1;
49
+ export declare function readAuthoredInstructionRevisionTransaction(selection: AuthoredInstructionRevisionSelectionV1, workspaceRoot: string, store: ContentAddressedArtifactStore): AuthoredInstructionRevisionTransactionV1;
50
+ /** Custody lookup only. A fresh native capture must still issue current authority. */
51
+ export declare function readAuthoredInstructionRevisionHead(workspaceRoot: string, artifactStoreRoot: string): Head | undefined;
52
+ /** Called only by the native issuer after immutable source/manifest custody exists. */
53
+ export declare function commitAuthoredInstructionRevision(collection: AuthoredInstructionSourcesV1, store: ContentAddressedArtifactStore): AuthoredInstructionRevisionSelectionV1;
54
+ /** Full current bodies are separate protected carriers; this bounded fact adds no historical directives. */
55
+ export declare function renderAuthoredInstructionRevision(selection: AuthoredInstructionRevisionSelectionV1, transaction: AuthoredInstructionRevisionTransactionV1): string;
56
+ export {};
@@ -0,0 +1,60 @@
1
+ import { type AuthoredInstructionRevisionSelectionV1 } from "./authored-instruction-revisions.js";
2
+ export declare const AUTHORED_INSTRUCTION_SOURCES_SCHEMA: "omnius.authored-instruction-sources.v1";
3
+ export declare const AUTHORED_INSTRUCTION_MARKER = "[AUTHORED PROJECT INSTRUCTIONS v1]";
4
+ export type AuthoredInstructionKind = "agents" | "omnius" | "claude";
5
+ export type AuthoredInstructionStatus = "captured" | "unavailable" | "removed" | "absent";
6
+ export interface AuthoredInstructionSnapshot {
7
+ reference: string;
8
+ sha256: string;
9
+ version: string;
10
+ bytes: number;
11
+ spans: Array<{
12
+ unit: "utf8_bytes";
13
+ start: number;
14
+ end: number;
15
+ }>;
16
+ content: string;
17
+ }
18
+ export interface AuthoredInstructionSourceV1 {
19
+ path: string;
20
+ displayPath: string;
21
+ kind: AuthoredInstructionKind;
22
+ order: number;
23
+ status: AuthoredInstructionStatus;
24
+ snapshot?: AuthoredInstructionSnapshot;
25
+ reasonCode?: string;
26
+ }
27
+ export interface AuthoredInstructionSourcesV1 {
28
+ schema: typeof AUTHORED_INSTRUCTION_SOURCES_SCHEMA;
29
+ workspaceRoot: string;
30
+ /** Host-only canonical storage under workspace/.omnius, never a model-selected path or permission. */
31
+ artifactStoreRoot: string;
32
+ manifestRef: string;
33
+ sources: AuthoredInstructionSourceV1[];
34
+ /** Durable native-capture lineage; this metadata alone never authorizes a selection. */
35
+ revision?: AuthoredInstructionRevisionSelectionV1;
36
+ }
37
+ export declare function canonicalInstructionWorkspace(root: string): string;
38
+ /** Issued only at a native source-capture/archive boundary, never decoded from model text. */
39
+ export declare class AuthoredInstructionSourceAdmissionError extends Error {
40
+ readonly reasonCode: "source_capture_failed" | "source_archive_failed";
41
+ readonly workspaceRoot: string;
42
+ constructor(workspaceRoot: string, cause: unknown, reasonCode?: "source_capture_failed" | "source_archive_failed");
43
+ }
44
+ export declare function captureAuthoredInstructionSnapshot(content: string): AuthoredInstructionSnapshot;
45
+ export declare function isAuthoredInstructionSnapshot(value: unknown): value is AuthoredInstructionSnapshot;
46
+ export declare function isAuthoredInstructionSourcesV1(value: unknown): value is AuthoredInstructionSourcesV1;
47
+ /** Only a trusted frontend's discovery/capture boundary may issue this current selection. */
48
+ export declare function issueAuthoredInstructionSources(input: {
49
+ workspaceRoot: string;
50
+ artifactStoreRoot?: string;
51
+ sources: AuthoredInstructionSourceV1[];
52
+ }): AuthoredInstructionSourcesV1;
53
+ export declare function readIssuedAuthoredInstructionSources(value: unknown, expectedWorkspaceRoot: string): AuthoredInstructionSourcesV1 | undefined;
54
+ /** Restore custody only. The returned value is deliberately NOT a current host-issued selection. */
55
+ export declare function readHistoricalAuthoredInstructionSources(input: {
56
+ workspaceRoot: string;
57
+ artifactStoreRoot: string;
58
+ manifestRef: string;
59
+ }): AuthoredInstructionSourcesV1;
60
+ export declare function reopenAuthoredInstructionSource(collection: AuthoredInstructionSourcesV1, sourcePath: string, expectedWorkspaceRoot: string): AuthoredInstructionSnapshot | undefined;
@@ -0,0 +1,196 @@
1
+ export type AuxiliaryOperationKind = "repl_query" | "source_extraction" | "source_reduction" | "context_compaction" | "memory_compilation" | "phase_summary" | "todo_summary" | "vision_description" | "orientation" | "internal_context";
2
+ export type AuxiliaryOperationStatus = "completed" | "deferred" | "unavailable" | "error" | "cancelled" | "late_discarded";
3
+ export interface AuxiliaryOperationBudgetV1 {
4
+ maxInputBytes: number;
5
+ maxOutputTokens: number;
6
+ maxOutputBytes: number;
7
+ maxCalls: number;
8
+ maxConcurrency: number;
9
+ timeoutMs: number;
10
+ maxTotalInputBytes: number;
11
+ maxTotalOutputTokens: number;
12
+ maxTotalOutputBytes: number;
13
+ }
14
+ export interface HostAuxiliaryOperationPolicyV1 {
15
+ kind: AuxiliaryOperationKind;
16
+ requirement?: "optional" | "required_context";
17
+ output?: "text" | "json";
18
+ sourceCoverage?: "partial" | "not_attested";
19
+ budget?: Partial<AuxiliaryOperationBudgetV1>;
20
+ }
21
+ export interface AuxiliaryOperationOwnerV1 {
22
+ sessionId: string;
23
+ runId: string;
24
+ taskEpoch: number;
25
+ ownerId: string;
26
+ operationRef: string;
27
+ ownerGeneration: number;
28
+ bindingSha256: string;
29
+ }
30
+ export interface AuxiliaryOperationProfileV1 {
31
+ model: string;
32
+ backend: string;
33
+ scopeSha256: string;
34
+ }
35
+ export interface AuxiliarySourceSnapshotV1 {
36
+ reference: string;
37
+ version: string;
38
+ sha256: string;
39
+ bytes: number;
40
+ coverage: "full" | "partial";
41
+ }
42
+ /** Opaque host reader binding. Neither this shape nor a copied source claim is authority. */
43
+ export interface AuxiliaryContextSourceBindingV1 {
44
+ readonly __auxiliarySourceBinding?: never;
45
+ }
46
+ export interface AuxiliaryContextInputV1 {
47
+ prompt: string;
48
+ context?: string;
49
+ sources?: readonly AuxiliaryContextSourceBindingV1[];
50
+ }
51
+ export interface AuxiliaryContextOperationReceiptV1 {
52
+ schema: "omnius.auxiliary-context-operation.v1";
53
+ operationId: string;
54
+ logicalRequestId: string;
55
+ kind: AuxiliaryOperationKind;
56
+ requirement: "optional" | "required_context";
57
+ owner: AuxiliaryOperationOwnerV1;
58
+ profile: AuxiliaryOperationProfileV1;
59
+ status: AuxiliaryOperationStatus;
60
+ reasonCode?: string;
61
+ inputSha256: string;
62
+ inputBytes: number;
63
+ inputRepresentation: "host_chat_request";
64
+ sourceCoverage: "partial" | "not_attested";
65
+ sourceSetSha256: string;
66
+ sources: readonly AuxiliarySourceSnapshotV1[];
67
+ sourceRelationship: "current_dependencies_not_body_admission";
68
+ /** A backend method invocation, not proof of an HTTP request, model execution or cancellation. */
69
+ backendDispatchAttempted: boolean;
70
+ providerCancellation: "not_established";
71
+ budget: AuxiliaryOperationBudgetV1;
72
+ outputBytes?: number;
73
+ observedOutputTokens?: number;
74
+ chargedOutputTokens: number;
75
+ durationMs: number;
76
+ aggregate: {
77
+ calls: number;
78
+ inputBytes: number;
79
+ chargedOutputTokens: number;
80
+ chargedOutputBytes: number;
81
+ inFlight: number;
82
+ };
83
+ routes: readonly {
84
+ phase: string;
85
+ model?: string;
86
+ providerId?: string;
87
+ location?: string;
88
+ }[];
89
+ }
90
+ /** Pending host observation only; this is neither a model dispatch nor execution grant. */
91
+ export interface PendingAuxiliaryOperationObservationV1 {
92
+ schema: "omnius.pending-auxiliary-operation.v1";
93
+ operationId: string;
94
+ logicalRequestId: string;
95
+ kind: AuxiliaryOperationKind;
96
+ requirement: "optional" | "required_context";
97
+ owner: Readonly<AuxiliaryOperationOwnerV1>;
98
+ profile: Readonly<AuxiliaryOperationProfileV1>;
99
+ budget: Readonly<AuxiliaryOperationBudgetV1>;
100
+ inputSha256: string;
101
+ inputBytes: number;
102
+ sourceSetSha256: string;
103
+ sourceCoverage: "partial" | "not_attested";
104
+ sourceRelationship: "current_dependencies_not_body_admission";
105
+ transportObservation: "not_established";
106
+ }
107
+ export interface PendingAuxiliaryDispatchObservationV1 extends Omit<PendingAuxiliaryOperationObservationV1, "schema"> {
108
+ schema: "omnius.pending-auxiliary-dispatch.v1";
109
+ stage: "native_backend_entry";
110
+ controllerLogicalRequestId: string;
111
+ nativeLogicalRequestId: string;
112
+ nativeOperationId?: string;
113
+ nativeOwnerGeneration?: number;
114
+ operationOwnerId: string;
115
+ nativeRequestFingerprint: string;
116
+ backendBinding: "exact_receiver";
117
+ }
118
+ /** Internal observation of the original controller callback; copies/prefixes are not issuance. */
119
+ export declare function readIssuedPendingAuxiliaryOperation(marker: unknown): Readonly<PendingAuxiliaryOperationObservationV1> | undefined;
120
+ export type AuxiliaryContextOperationResultV1 = {
121
+ status: "completed";
122
+ text: string;
123
+ receipt: AuxiliaryContextOperationReceiptV1;
124
+ } | {
125
+ status: Exclude<AuxiliaryOperationStatus, "completed">;
126
+ reasonCode: string;
127
+ receipt: AuxiliaryContextOperationReceiptV1;
128
+ };
129
+ export interface TaskAuxiliaryContextGateway {
130
+ execute(input: AuxiliaryContextInputV1): Promise<AuxiliaryContextOperationResultV1>;
131
+ }
132
+ export declare function readIssuedAuxiliaryContextOperationReceipt(value: unknown): AuxiliaryContextOperationReceiptV1 | undefined;
133
+ /** Runtime fences must finish synchronously; a Promise cannot attest current ownership. */
134
+ export declare function assertSynchronousAuxiliaryGuard(check: () => void): void;
135
+ /** Host code supplies the already authorized native reader fence. Text/JSON alone issues no binding. */
136
+ export declare function bindHostAuxiliaryContextSource(input: AuxiliarySourceSnapshotV1 & {
137
+ text: string;
138
+ assertCurrent: () => void;
139
+ }): AuxiliaryContextSourceBindingV1;
140
+ /** Native binary source custody: hash the exact bytes, never a base64/text surrogate. */
141
+ export declare function bindHostAuxiliaryBinarySource(input: Omit<AuxiliarySourceSnapshotV1, "sha256" | "bytes"> & {
142
+ data: Uint8Array;
143
+ assertCurrent: () => void;
144
+ }): AuxiliaryContextSourceBindingV1;
145
+ export declare function normalizeHostAuxiliaryPolicy(input: HostAuxiliaryOperationPolicyV1): Readonly<Required<HostAuxiliaryOperationPolicyV1> & {
146
+ budget: Readonly<AuxiliaryOperationBudgetV1>;
147
+ }>;
148
+ /** Host wiring issues policy once; decoded/copy-shaped policy data is never a grant. */
149
+ export declare function issueHostAuxiliaryOperationPolicy(input: HostAuxiliaryOperationPolicyV1): Readonly<HostAuxiliaryOperationPolicyV1>;
150
+ export declare function readIssuedHostAuxiliaryOperationPolicy(value: unknown): Readonly<HostAuxiliaryOperationPolicyV1> | undefined;
151
+ export declare function auxiliaryContextInput(input: AuxiliaryContextInputV1): {
152
+ messages: Array<{
153
+ role: "user";
154
+ content: string;
155
+ }>;
156
+ sourceBindings: readonly AuxiliaryContextSourceBindingV1[];
157
+ };
158
+ export interface AuxiliaryOperationHost {
159
+ owner: AuxiliaryOperationOwnerV1;
160
+ profile: AuxiliaryOperationProfileV1;
161
+ signal: AbortSignal;
162
+ assertCurrent: () => void;
163
+ observe?: (receipt: AuxiliaryContextOperationReceiptV1) => void;
164
+ }
165
+ /** One controller per actual invocation/wrapper; repeated lookups cannot reset its counters. */
166
+ export declare class AuxiliaryContextOperationController {
167
+ readonly host: AuxiliaryOperationHost;
168
+ readonly policy: ReturnType<typeof normalizeHostAuxiliaryPolicy>;
169
+ private calls;
170
+ private inputBytes;
171
+ private outputTokens;
172
+ private outputBytes;
173
+ private active;
174
+ constructor(host: AuxiliaryOperationHost, policy: HostAuxiliaryOperationPolicyV1);
175
+ run<T>(input: {
176
+ payload: string;
177
+ logicalRequestId?: string;
178
+ sourceBindings?: readonly AuxiliaryContextSourceBindingV1[];
179
+ signal?: AbortSignal;
180
+ invoke: (context: {
181
+ logicalRequestId: string;
182
+ signal: AbortSignal;
183
+ assertCurrent: () => void;
184
+ markBackendDispatch: () => void;
185
+ trackBackend: (promise: Promise<unknown>) => void;
186
+ route: (value: unknown) => void;
187
+ }) => Promise<T>;
188
+ output: (value: T) => {
189
+ text: string;
190
+ tokens?: number;
191
+ };
192
+ }): Promise<{
193
+ value: T;
194
+ receipt: AuxiliaryContextOperationReceiptV1;
195
+ }>;
196
+ }
@@ -0,0 +1,141 @@
1
+ import { type HostMemoryBindingV1, type MemorySearchResultV1 } from "../memory/memoryCapability.js";
2
+ import type { AgenticTool, AgenticToolResult, ChatMessage } from "./agenticRunner.js";
3
+ import type { ToolInvocationContext } from "../execution/types.js";
4
+ import type { RequestToolCapabilitySnapshot } from "./request-tool-capabilities.js";
5
+ import { type RequiredProviderSource, type ProviderContextAudit } from "./provider-context-contract.js";
6
+ import { type ConfinedCompositionLimits } from "./confined-composition-worker.js";
7
+ export interface HostToolCompositionPolicy {
8
+ readonly schema: "omnius.host-tool-composition-policy.v1";
9
+ readonly revision: string;
10
+ readonly childToolNames: readonly string[];
11
+ readonly limits: Readonly<ConfinedCompositionLimits>;
12
+ }
13
+ export declare function issueHostToolCompositionPolicy(input: {
14
+ childToolNames: readonly string[];
15
+ limits?: Partial<ConfinedCompositionLimits>;
16
+ }): HostToolCompositionPolicy;
17
+ export interface CompositionChildDefinition {
18
+ name: string;
19
+ parameters: Record<string, unknown>;
20
+ }
21
+ export interface CompositionObservedChild {
22
+ nativeCallId: string;
23
+ name: string;
24
+ result: AgenticToolResult;
25
+ source?: MemorySearchResultV1;
26
+ }
27
+ export interface CompositionHost {
28
+ binding(): string;
29
+ memoryBinding(): Readonly<HostMemoryBindingV1> | undefined;
30
+ definitions(): CompositionChildDefinition[];
31
+ canonicalName(name: string): string | undefined;
32
+ check(snapshot: RequestToolCapabilitySnapshot, name: string): void;
33
+ invoke(snapshot: RequestToolCapabilitySnapshot, name: string, args: Record<string, unknown>, context: {
34
+ nativeCallId: string;
35
+ signal: AbortSignal;
36
+ assertCurrent: () => void;
37
+ reserve: (serial: boolean) => Promise<() => void>;
38
+ observed: (child: CompositionObservedChild) => void;
39
+ }): Promise<AgenticToolResult>;
40
+ }
41
+ interface Catalogue {
42
+ schema: "omnius.tool-composition-catalogue.v1";
43
+ policyRevision: string;
44
+ bindingRevision: string;
45
+ snapshotRevision: string;
46
+ children: Array<CompositionChildDefinition & {
47
+ definitionSha256: string;
48
+ }>;
49
+ catalogueSha256: string;
50
+ returnView: {
51
+ success: "native_boolean";
52
+ output: "quoted_native_model_view";
53
+ error: "native_error_if_any";
54
+ };
55
+ coverage: {
56
+ requestedChildCount: number;
57
+ advertisedChildCount: number;
58
+ omitted: Array<{
59
+ name: string;
60
+ reason: string;
61
+ }>;
62
+ schemaCoverage: "complete_for_advertised_children";
63
+ qualification: "experimental_cpu_invariants_only_real_profile_benefit_unqualified";
64
+ };
65
+ }
66
+ interface Slot {
67
+ catalogue: Catalogue;
68
+ text: string;
69
+ scope: string;
70
+ snapshot: RequestToolCapabilitySnapshot;
71
+ providerSource: RequiredProviderSource;
72
+ }
73
+ interface ResponseProof {
74
+ slot: Slot;
75
+ snapshot: RequestToolCapabilitySnapshot;
76
+ requestFingerprint: string;
77
+ admissionStage: "logical_request" | "serialized_before_fetch";
78
+ wireBodySha256?: string;
79
+ }
80
+ export interface CompositionAudit {
81
+ enabled: boolean;
82
+ policyRevision: string;
83
+ catalogue?: {
84
+ admitted: boolean;
85
+ admissionStage: "logical_request" | "serialized_before_fetch";
86
+ catalogueSha256: string;
87
+ snapshotRevision: string;
88
+ requestFingerprint: string;
89
+ childNames: string[];
90
+ };
91
+ invocations: Array<{
92
+ id: string;
93
+ parentCallId: string;
94
+ status: string;
95
+ requestFingerprint: string;
96
+ snapshotRevision: string;
97
+ catalogueSha256: string;
98
+ admissionStage: "logical_request" | "serialized_before_fetch";
99
+ wireBodySha256?: string;
100
+ codeSha256: string;
101
+ attemptedChildCalls?: number;
102
+ nativeOutputBytes?: number;
103
+ pidsPeak?: number;
104
+ exitCode?: number | null;
105
+ exitSignal?: string | null;
106
+ children: Array<{
107
+ ordinal: number;
108
+ nativeCallId: string;
109
+ name: string;
110
+ success?: boolean;
111
+ delivery: string;
112
+ effectState?: string;
113
+ }>;
114
+ profileSha256?: string;
115
+ placementBeforeExec?: boolean;
116
+ memoryPeakBytes?: number;
117
+ cleanupPending?: boolean;
118
+ }>;
119
+ }
120
+ /** Optional native adapter: guest data never supplies snapshots, source objects,
121
+ * current authority, effect settlement or a completion/delivery receipt. */
122
+ export declare class BrokeredToolComposition {
123
+ readonly policy: HostToolCompositionPolicy;
124
+ private readonly host;
125
+ readonly tool: AgenticTool;
126
+ private readonly slots;
127
+ private readonly responses;
128
+ private readonly invocations;
129
+ private readonly memoryEnvelopes;
130
+ private readonly issuer;
131
+ private readonly auditState;
132
+ constructor(policy: HostToolCompositionPolicy, host: CompositionHost);
133
+ audit(): CompositionAudit;
134
+ project(messages: ChatMessage[], snapshot: RequestToolCapabilitySnapshot): ChatMessage[];
135
+ admit(messages: readonly ChatMessage[], snapshot: RequestToolCapabilitySnapshot, requestFingerprint: string): ResponseProof | undefined;
136
+ requiredProviderSource(proof: ResponseProof | undefined): RequiredProviderSource | undefined;
137
+ bindResponse(response: object, proof: ResponseProof | undefined, audit?: ProviderContextAudit): void;
138
+ bindInvocation(context: ToolInvocationContext, response: object | undefined, parentId: string | undefined, args: Record<string, unknown>, assertCurrent: () => void): () => void;
139
+ private execute;
140
+ }
141
+ export {};
@@ -156,8 +156,8 @@ export interface CompletionReadinessSnapshot {
156
156
  unresolvedIds: string[];
157
157
  failedEvidenceIds: string[];
158
158
  /**
159
- * Failed attempts not followed by a later successful observation from the
160
- * same tool. A dead-end fetch that the run recovered from is history, not a
159
+ * Failed attempts not recovered by a later same-tool observation, or for
160
+ * verifiers a passing verification in the same family. A recovered fetch is history, not a
161
161
  * defect in the answer; a source that was never successfully read, or a
162
162
  * failed mutation (which needs canonical review proof), still blocks.
163
163
  */
@@ -0,0 +1,45 @@
1
+ export interface ConfinedCompositionLimits {
2
+ wallMs: number;
3
+ startupMs: number;
4
+ childCalls: number;
5
+ parallelCalls: number;
6
+ codeBytes: number;
7
+ catalogueBytes: number;
8
+ frameBytes: number;
9
+ stdoutBytes: number;
10
+ stderrBytes: number;
11
+ nativeOutputBytes: number;
12
+ modelOutputBytes: number;
13
+ memoryBytes: number;
14
+ addressSpaceBytes: number;
15
+ heapMiB: number;
16
+ pids: number;
17
+ cpuSeconds: number;
18
+ }
19
+ export declare const EXPERIMENTAL_COMPOSITION_LIMITS: Readonly<ConfinedCompositionLimits>;
20
+ export interface ConfinedWorkerResult {
21
+ status: string;
22
+ guestValue: unknown;
23
+ guestLogs: string[];
24
+ guestError?: string;
25
+ calls: number;
26
+ nativeOutputBytes: number;
27
+ profileSha256: string;
28
+ placementBeforeExec: boolean;
29
+ memoryPeakBytes?: number;
30
+ pidsPeak?: number;
31
+ exitCode: number | null;
32
+ exitSignal: string | null;
33
+ cleanupPending: boolean;
34
+ }
35
+ /** The OS boundary is independent of the broker's native authority. Every RPC
36
+ * remains untrusted data; only the supplied current native closure can act. */
37
+ export declare function runConfinedComposition(input: {
38
+ code: string;
39
+ catalogue: unknown;
40
+ limits: Readonly<ConfinedCompositionLimits>;
41
+ signal?: AbortSignal;
42
+ assertCurrent: () => void;
43
+ invoke: (name: string, args: Record<string, unknown>, signal: AbortSignal) => Promise<unknown>;
44
+ onState?: (state: string) => void;
45
+ }): Promise<ConfinedWorkerResult>;