omnius 1.0.954 → 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 +234 -46
  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 +115253 -108001
  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,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>;
@@ -0,0 +1,173 @@
1
+ /** On-disk JSONL format shared with native streamed web sources. */
2
+ export interface ArtifactStreamSegment {
3
+ index: number;
4
+ byteStart: number;
5
+ byteEndExclusive: number;
6
+ charStart: number;
7
+ charEndExclusive: number;
8
+ lineStart: number;
9
+ lineEnd: number;
10
+ sha256: string;
11
+ }
12
+ export interface ArtifactStreamIndex {
13
+ schema: "omnius.utf8-segment-index.v1";
14
+ utf16Chars: number;
15
+ segmentCount: number;
16
+ indexSha256: string;
17
+ indexBytes: number;
18
+ endsWithNewline: boolean;
19
+ }
20
+ export type ArtifactFidelity = "full";
21
+ /** A one-based, inclusive source location. */
22
+ export interface ArtifactLineRange {
23
+ start: number;
24
+ end: number;
25
+ }
26
+ export interface CanonicalArtifactProvenance {
27
+ /** Logical source path; it is metadata and is never dereferenced by this store. */
28
+ path: string;
29
+ /** Caller-supplied source revision, such as a file hash or write epoch. */
30
+ revision: string;
31
+ /** Source line locations represented by the canonical body. */
32
+ ranges?: readonly ArtifactLineRange[];
33
+ /** Canonical writes are deliberately restricted to exact full source. */
34
+ fidelity?: ArtifactFidelity;
35
+ }
36
+ export interface StoreCanonicalArtifactInput extends CanonicalArtifactProvenance {
37
+ /** Exact UTF-8 body. The store rejects oversize inputs; it never truncates them. */
38
+ content: string;
39
+ }
40
+ /** Host-owned source path. This API must never receive an agent-supplied path. */
41
+ export interface StoreCanonicalArtifactFileInput extends CanonicalArtifactProvenance {
42
+ filePath: string;
43
+ expectedSha256?: string;
44
+ expectedBytes?: number;
45
+ expectedUtf16Chars?: number;
46
+ }
47
+ export interface ArtifactFileOperationOptions {
48
+ signal?: AbortSignal;
49
+ assertCurrent?: () => void;
50
+ }
51
+ /** Zero-based, exclusive-end UTF-16 code-unit or UTF-8 byte range. */
52
+ export interface ArtifactFileRangeOptions extends ArtifactFileOperationOptions {
53
+ start: number;
54
+ end: number;
55
+ /** Internal planning/validation windows only. Public artifact reads keep complete Unicode scalars. */
56
+ allowSplitSurrogates?: true;
57
+ }
58
+ export interface ArtifactFileLineRangeOptions extends ArtifactFileOperationOptions {
59
+ startLine: number;
60
+ endLine: number;
61
+ }
62
+ export interface ArtifactFileRangeReadResult {
63
+ hash: string;
64
+ reference: string;
65
+ content: string;
66
+ manifest: ContentAddressedArtifactManifest;
67
+ range: {
68
+ start: number;
69
+ end: number;
70
+ unit: "utf16" | "utf8";
71
+ };
72
+ }
73
+ export interface ArtifactManifestRecord {
74
+ path: string;
75
+ revision: string;
76
+ ranges: ArtifactLineRange[];
77
+ fidelity: ArtifactFidelity;
78
+ recordedAt: string;
79
+ }
80
+ export interface ContentAddressedArtifactManifest {
81
+ schemaVersion: 1 | 2;
82
+ hash: string;
83
+ bytes: number;
84
+ encoding: "utf-8";
85
+ lineCount: number;
86
+ createdAt: string;
87
+ records: ArtifactManifestRecord[];
88
+ /** Version 2 only. The exact complete object remains addressed by its raw UTF-8 SHA. */
89
+ streamIndex?: ArtifactStreamIndex;
90
+ }
91
+ export interface StoredCanonicalArtifact {
92
+ hash: string;
93
+ reference: string;
94
+ manifest: ContentAddressedArtifactManifest;
95
+ /** True when this call had to write a new immutable object. */
96
+ created: boolean;
97
+ }
98
+ export interface ArtifactReadOptions {
99
+ /** Omit to read the exact complete stored body. */
100
+ range?: ArtifactLineRange;
101
+ }
102
+ export interface ArtifactReadResult {
103
+ hash: string;
104
+ reference: string;
105
+ content: string;
106
+ manifest: ContentAddressedArtifactManifest;
107
+ /** Present only when a line range was requested. */
108
+ range?: ArtifactLineRange;
109
+ }
110
+ export interface ContentAddressedArtifactStoreOptions {
111
+ /** Root containing the objects and manifests directories. Defaults to .omnius/artifact-store. */
112
+ rootDir?: string;
113
+ /** Largest exact body accepted in one store operation. Default: 32 MiB. */
114
+ maxArtifactBytes?: number;
115
+ /** Maximum combined object bytes. Overrides root-local limits.json; otherwise defaults to 512 MiB. */
116
+ maxStoreBytes?: number;
117
+ /** Maximum provenance records attached to one content hash. Default: 64. */
118
+ maxManifestRecords?: number;
119
+ }
120
+ /** Default durable location used by callers that do not need a custom state directory. */
121
+ export declare function contentAddressedArtifactStoreRoot(cwd?: string, stateDir?: string): string;
122
+ /** Construct the only valid opaque artifact reference. */
123
+ export declare function artifactReference(hash: string): string;
124
+ /**
125
+ * Strictly parse references before any path construction. Query strings,
126
+ * fragments, encoded slashes, and traversal are intentionally invalid rather
127
+ * than being normalized into a potentially surprising object path.
128
+ */
129
+ export declare function parseArtifactReference(reference: string): string;
130
+ export declare class ContentAddressedArtifactStore {
131
+ readonly rootDir: string;
132
+ readonly maxArtifactBytes: number;
133
+ readonly maxStoreBytes: number;
134
+ readonly maxManifestRecords: number;
135
+ private fileCommitTail;
136
+ constructor(options?: ContentAddressedArtifactStoreOptions);
137
+ /** Persist an exact canonical UTF-8 body, returning a restart-safe opaque reference. */
138
+ put(input: StoreCanonicalArtifactInput): StoredCanonicalArtifact;
139
+ /**
140
+ * Archive a complete host-owned UTF-8 file using bounded memory. Unlike put,
141
+ * this path has no legacy per-object/store byte ceiling: disk/I/O failures and
142
+ * caller cancellation fail explicitly. Expected producer fixity is checked
143
+ * before any manifest is published. No supplied path enters an artifact URI.
144
+ */
145
+ importFile(input: StoreCanonicalArtifactFileInput, options?: ArtifactFileOperationOptions): Promise<StoredCanonicalArtifact>;
146
+ putFile(input: StoreCanonicalArtifactFileInput, options?: ArtifactFileOperationOptions): Promise<StoredCanonicalArtifact>;
147
+ /** Exact UTF-16 ranges, bounded to 256 Ki code units per call, with segment proof. */
148
+ readUtf16Range(reference: string, options: ArtifactFileRangeOptions): Promise<ArtifactFileRangeReadResult>;
149
+ /** Exact strict UTF-8 byte ranges, bounded to 1 MiB; split scalars are rejected. */
150
+ readUtf8Range(reference: string, options: ArtifactFileRangeOptions): Promise<ArtifactFileRangeReadResult>;
151
+ /** Exact inclusive lines; long minified lines require explicit character ranges. */
152
+ readLineRange(reference: string, options: ArtifactFileLineRangeOptions): Promise<ArtifactReadResult>;
153
+ private readFileRange;
154
+ /** Validate the entire index, retaining only one bounded line at a time. */
155
+ private verifyStreamIndex;
156
+ /** Full streaming fixity/durability validation, without a complete-body allocation. */
157
+ flushFile(reference: string, options?: ArtifactFileOperationOptions): Promise<void>;
158
+ /** Resolve a durable immutable full body or exact inclusive line range. */
159
+ read(reference: string, options?: ArtifactReadOptions): ArtifactReadResult;
160
+ /**
161
+ * Establish disk durability before another durable record depends on this
162
+ * archive. Validate and sync the same open object/manifest descriptors, then
163
+ * sync their directory entries from the leaves through the store root.
164
+ * Any failure propagates so callers cannot retire the source transcript.
165
+ */
166
+ flush(reference: string): void;
167
+ getManifest(reference: string): ContentAddressedArtifactManifest;
168
+ private objectsRoot;
169
+ private objectPath;
170
+ private manifestPath;
171
+ private streamIndexPath;
172
+ private readManifestByHash;
173
+ }
@@ -83,6 +83,10 @@ export interface ContextWindowReferenceContractTrace {
83
83
  * The exact outbound request remains the source of truth for rendered text.
84
84
  */
85
85
  export interface ContextWindowRequestCompilation {
86
+ authoredInstructionSources?: import("./authored-instruction-context.js").AuthoredInstructionAdmissionAudit;
87
+ explicitWorkMode?: import("./explicit-work-mode.js").ExplicitWorkModeAudit;
88
+ /** Observed capability and query/source admission; not model comprehension or use. */
89
+ memoryCapabilityContext?: import("./memory-capability-context.js").MemoryCapabilityContextAudit;
86
90
  schemaVersion: 1;
87
91
  taskEpoch: number;
88
92
  modelTier: string;