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,92 @@
1
+ import { type WorkModeFileGuard } from "../execution/work-mode-capability.js";
2
+ import type { ChatMessage, AgenticTool } from "./agenticRunner.js";
3
+ export declare class ExplicitWorkModeStorageError extends Error {
4
+ readonly conversationId: string;
5
+ readonly surface: "terminal" | "telegram_private";
6
+ readonly code = "explicit_work_mode_storage_unavailable";
7
+ readonly workspaceRoot: string;
8
+ constructor(workspace: string, conversationId: string, surface: "terminal" | "telegram_private", cause: unknown);
9
+ }
10
+ export declare const EXPLICIT_WORK_MODE_MARKER = "[EXPLICIT WORK MODE v1]";
11
+ export type ExplicitWorkMode = "plan" | "implement" | "default";
12
+ export interface ExplicitWorkModeRequest {
13
+ mode: ExplicitWorkMode;
14
+ artifactPaths: string[];
15
+ }
16
+ export interface ExplicitWorkModeSelection {
17
+ schema: "omnius.explicit-work-mode-selection.v1";
18
+ workspaceRoot: string;
19
+ sessionId: string;
20
+ selectionRef: string;
21
+ revision: number;
22
+ mode: ExplicitWorkMode;
23
+ artifactPaths: readonly string[];
24
+ source: {
25
+ surface: "terminal" | "telegram_private";
26
+ inputRef: string;
27
+ inputSha256: string;
28
+ };
29
+ }
30
+ export interface ExplicitWorkModeOwner {
31
+ workspaceRoot: string;
32
+ sessionId: string;
33
+ runId: string;
34
+ taskEpoch: number;
35
+ ownerId: string;
36
+ controlRoots: string[];
37
+ }
38
+ export interface ExplicitWorkModeCustody {
39
+ schema: "omnius.explicit-work-mode-custody.v1";
40
+ selectionRef: string;
41
+ mode: ExplicitWorkMode;
42
+ revision: number;
43
+ workspaceRoot: string;
44
+ sessionId: string;
45
+ }
46
+ export interface ExplicitWorkModeAudit {
47
+ schema: "omnius.explicit-work-mode-admission.v1";
48
+ selectionRef: string;
49
+ mode: ExplicitWorkMode;
50
+ revision: number;
51
+ runId: string;
52
+ taskEpoch: number;
53
+ ownerId: string;
54
+ status: "projected" | "admitted" | "overflow";
55
+ requestFingerprint?: string;
56
+ }
57
+ /** This host is created by an authenticated frontend, never a callable tool. */
58
+ export declare class ExplicitWorkModeHost {
59
+ readonly sessionId: string;
60
+ private revision;
61
+ private selected?;
62
+ readonly workspaceRoot: string;
63
+ constructor(workspaceRoot: string, sessionId: string);
64
+ select(request: ExplicitWorkModeRequest, source: ExplicitWorkModeSelection["source"], assertNative: () => void): ExplicitWorkModeSelection;
65
+ current(): ExplicitWorkModeSelection | undefined;
66
+ restoreCurrent(value: ExplicitWorkModeSelection | undefined): void;
67
+ }
68
+ export declare function readIssuedExplicitWorkMode(value: unknown, workspace: string, sessionId: string): ExplicitWorkModeSelection | undefined;
69
+ export declare class ExplicitWorkModeContext {
70
+ private current?;
71
+ private requiresFresh;
72
+ private owner?;
73
+ private readonly owned;
74
+ private readonly waiters;
75
+ private lastAudit;
76
+ private ownerInput;
77
+ configure(value: unknown, owner: ExplicitWorkModeOwner): void;
78
+ fingerprint(): string;
79
+ needsSelection(): boolean;
80
+ rollbackNativeSelection(value: ExplicitWorkModeSelection | undefined, owner: ExplicitWorkModeOwner, requiresFresh: boolean): void;
81
+ wait(signal: AbortSignal): Promise<void>;
82
+ toolProblem(tool: AgenticTool | undefined, nativeControl?: boolean): string | null;
83
+ fileGuard(assertCurrent: () => void): WorkModeFileGuard;
84
+ private scope;
85
+ private content;
86
+ project(messages: ChatMessage[]): ChatMessage[];
87
+ admit(messages: ChatMessage[], fingerprint: string, rejected?: boolean): ExplicitWorkModeAudit | null;
88
+ audit(): ExplicitWorkModeAudit | null;
89
+ checkpoint(): ExplicitWorkModeCustody | undefined;
90
+ private historical?;
91
+ restore(value: ExplicitWorkModeCustody, owner: ExplicitWorkModeOwner): void;
92
+ }
@@ -137,6 +137,9 @@ export declare class InterruptionLifecycle {
137
137
  ownerId: string;
138
138
  }): InterruptionOperationTicket | null;
139
139
  acknowledgeOperation(ticket: InterruptionOperationTicket, outcome?: "completed" | "cancelled" | "unknown"): boolean;
140
+ /** Reopen client observation of the same retained read-only model operation.
141
+ * This is not provider admission, cancellation acknowledgement, or a new job. */
142
+ resumeModelObservation(ticket: InterruptionOperationTicket): boolean;
140
143
  canCommit(ticket: InterruptionOperationTicket): boolean;
141
144
  resolveAmbiguousEffect(operationId: string, state: "confirmed_applied" | "confirmed_absent", evidenceId: string): boolean;
142
145
  /** Repair the old ASR classification, without supplying a transcription
@@ -0,0 +1,49 @@
1
+ import { type HostMemoryBindingV1, type MemoryAvailability, type MemoryCapabilityV1, type MemoryQueryTraceV1, type MemorySearchResultV1 } from "../memory/memoryCapability.js";
2
+ import type { ChatMessage } from "./agenticRunner.js";
3
+ export interface RuntimeMemoryAvailability {
4
+ storeKind: string;
5
+ status: MemoryAvailability;
6
+ reasonCode?: string;
7
+ operations: Array<"search" | "read_exact" | "expand" | "enumerate_sources">;
8
+ toolNames: string[];
9
+ routeIds: string[];
10
+ }
11
+ export interface MemoryCapabilityContextAudit {
12
+ schema: "omnius.memory-context-audit.v1";
13
+ bindingRevision: string;
14
+ descriptorSha256: string;
15
+ capabilityCount: number;
16
+ renderedCapabilityRevisions: string[];
17
+ admittedCapabilityRevisions: string[];
18
+ omittedCapabilities: number;
19
+ descriptorRendered: boolean;
20
+ descriptorAdmitted: boolean;
21
+ requestFingerprint: string;
22
+ queries: MemoryQueryTraceV1[];
23
+ droppedQueries: number;
24
+ droppedTelemetry: number;
25
+ }
26
+ /** Observational request projection. It never opens a store or selects an action. */
27
+ export declare class MemoryCapabilityContext {
28
+ private readonly sink?;
29
+ private binding?;
30
+ private readonly issuer;
31
+ private readonly carriers;
32
+ private readonly queries;
33
+ private content;
34
+ private capabilityCount;
35
+ private renderedCapabilityRevisions;
36
+ private droppedQueries;
37
+ private droppedTelemetry;
38
+ private pendingSinks;
39
+ private lastAudit;
40
+ constructor(sink?: ((trace: MemoryQueryTraceV1) => void | Promise<void>) | undefined);
41
+ bind(binding: HostMemoryBindingV1): void;
42
+ capabilities(runtime: RuntimeMemoryAvailability[], adapters: readonly MemoryCapabilityV1[]): MemoryCapabilityV1[];
43
+ project(messages: ChatMessage[], capabilities: readonly MemoryCapabilityV1[], maxChars?: number): ChatMessage[];
44
+ /** Caller must obtain result from the registered adapter's identity-checking hook. */
45
+ observe(result: MemorySearchResultV1, callId: string, output: string): void;
46
+ admit(messages: ChatMessage[], requestFingerprint: string): MemoryCapabilityContextAudit | null;
47
+ audit(): MemoryCapabilityContextAudit | null;
48
+ private sendTrace;
49
+ }
@@ -0,0 +1,123 @@
1
+ /** Host ownership, never inferred from a model-authored object or provider prose. */
2
+ export interface OwnedInferenceWaitOwnerV1 {
3
+ sessionId: string;
4
+ runId: string;
5
+ taskEpoch: number;
6
+ ownerId: string;
7
+ ownerGeneration: number;
8
+ operationId: string;
9
+ }
10
+ export type OwnedInferenceWaitState = "ambiguous" | "retained_queue" | "in_progress" | "completed" | "completed_unavailable" | "unresolved";
11
+ export interface OwnedInferenceWaitReceiptV1 {
12
+ readonly schema: "omnius.owned-inference-wait.v1";
13
+ readonly custodyRef: string;
14
+ readonly owner: Readonly<OwnedInferenceWaitOwnerV1>;
15
+ readonly endpoint: string;
16
+ readonly model: string;
17
+ readonly url: string;
18
+ readonly logicalRequestId: string;
19
+ readonly bodySha256: string;
20
+ readonly scopeSha256: string;
21
+ readonly capturedAt: string;
22
+ readonly observedAt: string;
23
+ readonly state: OwnedInferenceWaitState;
24
+ readonly reason: string;
25
+ readonly semanticProgress: boolean;
26
+ readonly initialResponseBudgetMs: number;
27
+ readonly brokerRequestId?: string;
28
+ readonly retryAfterMs?: number;
29
+ }
30
+ export interface OwnedInferenceWaitContext {
31
+ owner: OwnedInferenceWaitOwnerV1;
32
+ stateDir: string;
33
+ onObservation?: (receipt: OwnedInferenceWaitReceiptV1) => void;
34
+ /** Host may narrow resource limits; the implementation's hard caps cannot be raised. */
35
+ storageLimits?: {
36
+ maxBytes?: number;
37
+ maxCaptures?: number;
38
+ };
39
+ }
40
+ export interface OwnedInferenceDispatchFailureV1 {
41
+ readonly schema: "omnius.owned-inference-dispatch-failure.v1";
42
+ readonly code: "owned_inference_dispatch_blocked";
43
+ readonly dispatchAttempted: false;
44
+ readonly owner: Readonly<OwnedInferenceWaitOwnerV1>;
45
+ readonly endpoint: string;
46
+ readonly model: string;
47
+ readonly logicalRequestId: string;
48
+ readonly reason: "storage_quota" | "storage_unavailable" | "custody_invalid";
49
+ readonly observedAt: string;
50
+ readonly storageCode?: string;
51
+ }
52
+ export declare class OwnedInferenceDispatchBlockedError extends Error {
53
+ readonly code = "owned_inference_dispatch_blocked";
54
+ readonly dispatchAttempted = false;
55
+ readonly fatal = true;
56
+ readonly retryable = false;
57
+ constructor(input: {
58
+ context: OwnedInferenceWaitContext;
59
+ endpoint: string;
60
+ model: string;
61
+ logicalRequestId: string;
62
+ }, reason: OwnedInferenceDispatchFailureV1["reason"], cause: unknown);
63
+ }
64
+ export declare function readOwnedInferenceDispatchFailure(error: unknown): OwnedInferenceDispatchFailureV1 | undefined;
65
+ export interface OwnedInferenceWaitObserveOptions {
66
+ owner: OwnedInferenceWaitOwnerV1;
67
+ signal?: AbortSignal;
68
+ timeoutMs: number;
69
+ assertCurrent?: () => void;
70
+ onObservation?: (receipt: OwnedInferenceWaitReceiptV1) => void;
71
+ }
72
+ interface Custody {
73
+ schema: "omnius.owned-inference-custody.v1";
74
+ owner: OwnedInferenceWaitOwnerV1;
75
+ endpoint: string;
76
+ model: string;
77
+ url: string;
78
+ logicalRequestId: string;
79
+ body: string;
80
+ bodySha256: string;
81
+ scopeSha256: string;
82
+ request: Record<string, unknown>;
83
+ capturedAt: string;
84
+ captureNonce: string;
85
+ }
86
+ export declare const OWNED_INFERENCE_STORE_MAX_BYTES: number;
87
+ export declare const OWNED_INFERENCE_STORE_MAX_CAPTURES = 2048;
88
+ /** Credential material is hashed, never persisted. Scope includes client/GPU/queue constraints. */
89
+ export declare function ownedInferenceScopeSha256(url: string, headers: ConstructorParameters<typeof Headers>[0] | undefined): string;
90
+ /** Called only after the backend identifies its selected managed-broker protocol. */
91
+ declare function captureOwnedInferenceWaitInternal(input: {
92
+ context: OwnedInferenceWaitContext;
93
+ endpoint: string;
94
+ model: string;
95
+ url: string;
96
+ logicalRequestId: string;
97
+ body: string;
98
+ scopeSha256: string;
99
+ request: Record<string, unknown>;
100
+ }): OwnedInferenceWaitReceiptV1;
101
+ /** Only this pre-fetch capture boundary can issue confirmed non-dispatch failure. */
102
+ export declare function captureOwnedInferenceWait(input: Parameters<typeof captureOwnedInferenceWaitInternal>[0]): OwnedInferenceWaitReceiptV1;
103
+ /** A checkpoint carries only the reference. Explicit current host ownership reopens private custody. */
104
+ export declare function restoreOwnedInferenceWait(input: {
105
+ stateDir: string;
106
+ reference: string;
107
+ owner: OwnedInferenceWaitOwnerV1;
108
+ endpoint: string;
109
+ model: string;
110
+ }): OwnedInferenceWaitReceiptV1;
111
+ export declare function readIssuedOwnedInferenceWait(value: unknown): OwnedInferenceWaitReceiptV1 | undefined;
112
+ export declare function readOwnedInferenceWait(error: unknown): OwnedInferenceWaitReceiptV1 | undefined;
113
+ export declare function attachOwnedInferenceWait(error: unknown, receipt: OwnedInferenceWaitReceiptV1): void;
114
+ export declare function inspectOwnedInferenceWait(receipt: OwnedInferenceWaitReceiptV1, owner: OwnedInferenceWaitOwnerV1): {
115
+ custody: Custody;
116
+ observation: OwnedInferenceWaitReceiptV1;
117
+ stateDir: string;
118
+ };
119
+ export declare function observeOwnedInferenceWaitReceipt(receipt: OwnedInferenceWaitReceiptV1, observation: Pick<OwnedInferenceWaitReceiptV1, "state" | "reason"> & Partial<Pick<OwnedInferenceWaitReceiptV1, "semanticProgress" | "brokerRequestId" | "retryAfterMs">>): OwnedInferenceWaitReceiptV1;
120
+ export declare function notifyOwnedInferenceWait(handler: OwnedInferenceWaitContext["onObservation"], receipt: OwnedInferenceWaitReceiptV1): void;
121
+ /** Managed-port identity alone does not prove support for the body-free resume protocol. */
122
+ export declare function supportsOwnedInferenceWaitProtocol(document: unknown, endpoint: string): boolean;
123
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { OwnedInferenceWaitOwnerV1 } from "./owned-inference-wait.js";
2
+ /** Host attempt custody. This is not a provider admission or observer grant. */
3
+ export interface OwnedModelWaitCheckpointV1 {
4
+ schema: "omnius.owned-model-wait-checkpoint.v1";
5
+ owner: OwnedInferenceWaitOwnerV1;
6
+ operationOwnerId: string;
7
+ logicalRequestId: string;
8
+ turn: number;
9
+ requestFingerprint: string;
10
+ endpoint: string;
11
+ model: string;
12
+ workspaceRoot: string;
13
+ policySha256: string;
14
+ toolCatalogueSha256: string;
15
+ taskBindingSha256: string;
16
+ runtimeFingerprint: string;
17
+ authoredManifestRef?: string;
18
+ custodyRef?: string;
19
+ state: "pending" | "waiting" | "unsupported" | "unresolved" | "semantic_progress" | "response_received";
20
+ reason: string;
21
+ semanticProgress: boolean;
22
+ retiredByInputId?: string;
23
+ startedAtMs: number;
24
+ observationBudgetMs: number;
25
+ }
26
+ export declare function isOwnedModelWaitCheckpointV1(value: unknown): value is OwnedModelWaitCheckpointV1;
@@ -0,0 +1,78 @@
1
+ export declare const PROMPT_CONTEXT_SELECTION: unique symbol;
2
+ export declare const PROVIDER_RESPONSE_PARSER: unique symbol;
3
+ export declare const REQUIRED_PROVIDER_SOURCES: unique symbol;
4
+ export interface RequiredProviderSource {
5
+ readonly id: string;
6
+ readonly version: string;
7
+ readonly sha256: string;
8
+ readonly bytes: number;
9
+ }
10
+ /** Host-issued visibility requirement only. A visible source never grants execution authority. */
11
+ export declare function issueRequiredProviderSource(input: {
12
+ id: string;
13
+ version: string;
14
+ text: string;
15
+ }): RequiredProviderSource;
16
+ export interface PromptContextSelection {
17
+ schema: "omnius.prompt-selection.v1";
18
+ source: "model_led_core" | "custom_system";
19
+ version: string;
20
+ sha256: string;
21
+ bytes: number;
22
+ }
23
+ /** Host evidence only. This selection grants no tool, source or task authority. */
24
+ export declare function issuePromptContext(input: {
25
+ source: PromptContextSelection["source"];
26
+ version: string;
27
+ text: string;
28
+ }): PromptContextSelection;
29
+ export interface ProviderContextAudit {
30
+ schema: "omnius.provider-context-audit.v1";
31
+ stage: "before_fetch";
32
+ logicalRequestId?: string;
33
+ hostRequestFingerprint?: string;
34
+ protocol: string;
35
+ path: string;
36
+ wireModel?: string;
37
+ payloadKind: "generation" | "body_free_observation";
38
+ wireBodySha256?: string;
39
+ wireBytes: number;
40
+ streaming?: boolean;
41
+ prompt: {
42
+ status: "observed" | "unattributed" | "not_observed" | "unavailable";
43
+ selection?: PromptContextSelection;
44
+ };
45
+ reasonCode?: string;
46
+ systemContentSha256?: string;
47
+ requiredSources?: Array<RequiredProviderSource & {
48
+ status: "observed" | "not_observed";
49
+ }>;
50
+ toolProtocol: "ollama_native" | "openai_native" | "anthropic_native" | "none" | "unobserved";
51
+ responseParser: "native" | "json" | "hermes-xml";
52
+ toolCatalogueSha256?: string;
53
+ toolCount?: number;
54
+ think?: boolean;
55
+ contextTokens?: number;
56
+ outputLimitTokens?: number;
57
+ tokenAccounting: "not_measured";
58
+ weightedPrefill: "not_requested" | "requested_unqualified";
59
+ }
60
+ export declare class ProviderContextContractError extends Error {
61
+ readonly reasonCode: "selected_prompt_missing" | "required_source_missing" | "required_source_invalid" | "wire_audit_limit" | "wire_body_invalid";
62
+ readonly logicalRequestId?: string | undefined;
63
+ readonly dispatchAttempted = false;
64
+ constructor(reasonCode: "selected_prompt_missing" | "required_source_missing" | "required_source_invalid" | "wire_audit_limit" | "wire_body_invalid", logicalRequestId?: string | undefined);
65
+ }
66
+ /** Observe the final serialized body, after provider adaptation. Never retain prompt bodies or credentials. */
67
+ export declare function observeProviderContext(input: {
68
+ request: {
69
+ logicalRequestId?: string;
70
+ [PROMPT_CONTEXT_SELECTION]?: PromptContextSelection;
71
+ [PROVIDER_RESPONSE_PARSER]?: ProviderContextAudit["responseParser"];
72
+ [REQUIRED_PROVIDER_SOURCES]?: readonly RequiredProviderSource[];
73
+ weightedMemoryPrefill?: unknown;
74
+ };
75
+ protocol: string;
76
+ url: string;
77
+ body: unknown;
78
+ }): ProviderContextAudit;
@@ -0,0 +1,52 @@
1
+ /** Host invocation identity. Schema exposure and execution permission remain separate. */
2
+ export interface RequestToolIdentity {
3
+ name: string;
4
+ aliases?: readonly string[];
5
+ parameters: Record<string, unknown>;
6
+ modelFacingParameters?: Record<string, unknown>;
7
+ executionScope?: string;
8
+ purpose?: string;
9
+ schemaExposure?: string;
10
+ acceptsInvocationContext?: boolean;
11
+ interruptionKind?: string;
12
+ interruptionEffect?: string;
13
+ inputSchema?: unknown;
14
+ execute: unknown;
15
+ executeStream?: unknown;
16
+ normalizeInput?: unknown;
17
+ validateInput?: unknown;
18
+ isReadOnly?: unknown;
19
+ isConcurrencySafe?: unknown;
20
+ isObservationOnly?: unknown;
21
+ objectiveEffectIntent?: unknown;
22
+ }
23
+ export interface RequestToolCapabilitySnapshot {
24
+ readonly schema: "omnius.request-tool-capabilities.v1";
25
+ readonly fingerprint: string;
26
+ readonly names: readonly string[];
27
+ }
28
+ /** Capture trusted registry state before the provider can yield. Never hydrate this from JSON. */
29
+ export declare function captureRequestToolCapabilities(input: {
30
+ binding: string;
31
+ identities?: readonly unknown[];
32
+ tools: Iterable<readonly [
33
+ string,
34
+ RequestToolIdentity
35
+ ]>;
36
+ allowedNames: ReadonlySet<string>;
37
+ }): RequestToolCapabilitySnapshot;
38
+ /** Read-only construction custody. This does not issue a snapshot or grant
39
+ * any tool; callers must rebuild actual definitions when this context drifts. */
40
+ export declare function requestToolCapabilityContextProblem(snapshot: unknown, input: {
41
+ binding: string;
42
+ identities?: readonly unknown[];
43
+ }): string | null;
44
+ /** Every acceptance also intersects current permission and the exact current resolver result. */
45
+ export declare function requestToolCapabilityProblem(snapshot: unknown, input: {
46
+ binding: string;
47
+ identities?: readonly unknown[];
48
+ requestedName: string;
49
+ canonicalName: string;
50
+ tool: RequestToolIdentity;
51
+ allowedNow: boolean;
52
+ }): string | null;
@@ -64,6 +64,20 @@ export declare class StructuredMemoryExtractionQueue {
64
64
  constructor(db: ReturnType<typeof initDb>, options?: {
65
65
  now?: () => Date;
66
66
  });
67
+ /** Side-effect-free status of this already-open store; counts do not attest worker activation. */
68
+ getJobSnapshot(context: StructuredMemoryExtractionContext): {
69
+ schema: "omnius.structured-memory-extraction-status.v1";
70
+ state: "stored_queue" | "not_initialized";
71
+ scopeId: string | null;
72
+ profileSha256: string;
73
+ counts: {
74
+ pending: number;
75
+ running: number;
76
+ completed: number;
77
+ failed: number;
78
+ };
79
+ executionReadiness: "not_established_from_storage";
80
+ };
67
81
  private ownerScope;
68
82
  private assertSources;
69
83
  enqueue(input: StructuredMemoryExtractionJobInput): string[];
@@ -83,6 +97,12 @@ export declare function openStructuredMemoryExtractionWorker(options: Structured
83
97
  databasePath: string;
84
98
  intervalMs?: number;
85
99
  }): {
100
+ getStatus(): {
101
+ state: "open";
102
+ queue: ReturnType<StructuredMemoryExtractionQueue["getJobSnapshot"]>;
103
+ } | {
104
+ state: "closed";
105
+ };
86
106
  runOnce(): Promise<StructuredMemoryExtractionRunResult>;
87
107
  releaseRun(input: StructuredMemoryExtractionReleaseInput): void;
88
108
  stopAndWait(): Promise<void>;
@@ -43,6 +43,7 @@ export declare function assertStructuredMemoryExtractionBatchCurrent(input: {
43
43
  scopeId: string;
44
44
  batch: StructuredMemoryExtractionBatch;
45
45
  }): void;
46
+ export declare const STRUCTURED_MEMORY_EXTRACTOR_VERSION = "source-backed-structured-memory-v2";
46
47
  /**
47
48
  * Run bounded model-authored extraction batches and commit only schema-valid,
48
49
  * source-resolvable memories. The host never infers a semantic class from
@@ -58,5 +59,16 @@ export declare function extractStructuredMemoriesWithInference(input: {
58
59
  assertCurrent?: () => void;
59
60
  recordIdPrefix?: string;
60
61
  validFrom?: string;
62
+ /** Host-supplied admission metadata, never inferred from model output. */
63
+ derivationContext?: {
64
+ jobId?: string;
65
+ profile?: {
66
+ endpoint: string;
67
+ model: string;
68
+ protocol: string;
69
+ revision: string;
70
+ };
71
+ owner?: Record<string, unknown>;
72
+ };
61
73
  commitBatch?: (records: StructuredMemoryInput[], rejected: string[]) => StructuredMemoryRecord[];
62
74
  }): Promise<InferenceMemoryExtractionResult>;
@@ -33,6 +33,30 @@ export interface SuccessfulProcedureDeliveryFile extends SuccessfulProcedureFile
33
33
  /** Exact operation payload hash, including the actual rendered chunk. */
34
34
  expectedTextSha256: string;
35
35
  }
36
+ export interface HistoricalProcedureContextV1 {
37
+ schema: "omnius.procedure-history-context.v1";
38
+ runtimeFingerprint?: string;
39
+ /** Only the last request catalogue, never a version attestation for prior actions. */
40
+ lastRequest?: {
41
+ logicalRequestId: string;
42
+ catalogueSha256: string;
43
+ };
44
+ usedTools: Array<{
45
+ tool: string;
46
+ revisionStatus: "unknown";
47
+ }>;
48
+ exceptions: string[];
49
+ exceptionCoverage: "not_recorded" | "recorded_only";
50
+ }
51
+ export declare function buildHistoricalProcedureContext(input: {
52
+ runtimeFingerprint?: string;
53
+ lastRequest?: {
54
+ logicalRequestId?: string;
55
+ catalogueSha256?: string;
56
+ } | null;
57
+ usedTools: string[];
58
+ exceptions?: string[];
59
+ }): HistoricalProcedureContextV1;
36
60
  export interface SuccessfulProcedureInput {
37
61
  scope: UserTaskNoteScope;
38
62
  runId: string;
@@ -42,6 +66,7 @@ export interface SuccessfulProcedureInput {
42
66
  preconditions: string[];
43
67
  actions: SuccessfulProcedureAction[];
44
68
  trace: SuccessfulProcedureFile;
69
+ historicalContext?: HistoricalProcedureContextV1;
45
70
  completion: {
46
71
  terminalReceipt: SuccessfulProcedureFile;
47
72
  providerDelivery?: {
@@ -97,6 +122,16 @@ export declare class SuccessfulProcedureMemory {
97
122
  runOnce(signal?: AbortSignal): Promise<MemoryWorkerRunResult>;
98
123
  };
99
124
  record(input: SuccessfulProcedureInput): Promise<boolean>;
125
+ /** Explicit native view: existing records only, no embedding, access writes or workers. */
126
+ nativeCases(input: {
127
+ scope: UserTaskNoteScope;
128
+ query: string;
129
+ limit?: number;
130
+ }): Array<{
131
+ id: string;
132
+ version: string;
133
+ text: string;
134
+ }>;
100
135
  recall(input: {
101
136
  scope: UserTaskNoteScope;
102
137
  query: string;