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
@@ -1,26 +1,5 @@
1
- /**
2
- * agenticRunner.ts — Multi-turn agentic coding loop with tool calling.
3
- *
4
- * This is the production agent loop, modeled after how Claude Code operates:
5
- * the model receives tools (file_read, file_write, shell, grep, etc.) and
6
- * iterates by reading code, making changes, running tests, and fixing failures
7
- * until the task is complete.
8
- *
9
- * Key design decisions (from meta-analysis of Claude Code's approach):
10
- *
11
- * 1. TOOL-FIRST: The model explores via tools rather than relying on
12
- * pre-stuffed context. This keeps each turn focused and efficient.
13
- *
14
- * 2. ITERATIVE: The model runs tests, sees failures, and fixes them.
15
- * This eliminates the need for "perfect" one-shot outputs.
16
- *
17
- * 3. CONTEXT COMPACTION: Long conversations are compressed by summarizing
18
- * older tool interactions, preserving only recent context.
19
- *
20
- * 4. BOUNDED: Maximum turns, timeout, and output limits prevent runaway loops.
21
- *
22
- * 5. OBSERVABLE: Every tool call and result is emitted as an event.
23
- */
1
+ import type { NativeMemoryViewBinding } from "../execution/native-memory-view-provider.js";
2
+ import { type HostToolCompositionPolicy } from "./brokered-tool-composition.js";
24
3
  import { type InferenceRouteLifecycleReceipt, type InferenceFallbackApprovalReceipt, type PreparedInferenceContextCapacity } from "./remote-inference-fallback.js";
25
4
  import { type ForcedUpdateRequirementRecovery, type ForcedUpdateRequirementRecoveryResult, type ForcedUpdateRequirementRecoveryHandler } from "./forced-update-requirement-recovery.js";
26
5
  export type { ForcedUpdateRequirementRecovery, ForcedUpdateRequirementRecoveryReceipt, ForcedUpdateRequirementRecoveryResult, ForcedUpdateRequirementRecoveryHandler } from "./forced-update-requirement-recovery.js";
@@ -28,14 +7,17 @@ import { DurableDocumentWorkerCoordinator, type DocumentWorkersHostV1, type Dura
28
7
  import { type CompletionReviewPendingV1, type CompletionRestoredPayloadV1 } from "./completion-review-pending.js";
29
8
  import { type DocumentPersistenceReviewEvidenceV1 } from "./document-persistence-goal-binding.js";
30
9
  import { type TaskWorkDelegationV1, type TaskWorkDelegationParentV1, type TaskDocumentSourceV1, type TaskDocumentWorkerResultV1, type TaskWorkDelegationReceiptV1 } from "./taskWorkDelegation.js";
10
+ import { type OwnedInferenceDispatchFailureV1, type OwnedInferenceWaitContext, type OwnedInferenceWaitObserveOptions, type OwnedInferenceWaitReceiptV1 } from "./owned-inference-wait.js";
31
11
  import type { SpanMeta } from "./types.js";
32
12
  import { type InferencePressureCoordinator } from "./inference-pressure.js";
33
13
  import { type InterruptionLifecycleMode, type InterruptionOperationKind, type InterruptionEffectClass, type InterruptionSnapshot, type InterruptionTransitionReceipt } from "./interruption-lifecycle.js";
14
+ import { type OwnedModelWaitCheckpointV1 } from "./owned-model-wait.js";
34
15
  import type { AgentRunEvent } from "./runEvents.js";
35
16
  import { type ProgressiveToolDescriptor, type TrustedToolExecutionProfile } from "./tool-exposure-policy.js";
36
17
  import { type SteeringInput, type SteeringIntakeReceipt } from "./steeringIntake.js";
37
18
  import type { CompletionEvidenceRole, CompletionLedger, CompletionVerificationImpact } from "./completionLedger.js";
38
19
  import { type ExternalEffectIntentV1, type ExternalEffectReceiptV1, type NeedsInputContractV1, type ObjectiveExternalBlockerV1, type ObjectiveFrontierDeltaV1, type ObjectiveFrontierSnapshotV1, type TaskObjectiveContractV1, type VerificationReceiptV1 } from "./taskObjective.js";
20
+ import { PROMPT_CONTEXT_SELECTION, PROVIDER_RESPONSE_PARSER, REQUIRED_PROVIDER_SOURCES, type RequiredProviderSource, type PromptContextSelection, type ProviderContextAudit } from "./provider-context-contract.js";
39
21
  import { type TerminalTaskReport } from "./terminalTaskReport.js";
40
22
  import { type TerminalRuntimeFailure } from "./completionFinalization.js";
41
23
  import { type CompletionReadinessSnapshot } from "./completionReadiness.js";
@@ -75,11 +57,17 @@ import { type IssuedAgenticWebFetchReceiptV1 } from "./agentic-web-fetch-receipt
75
57
  import { type IssuedAgenticPageContentReceiptV1 } from "./agentic-page-content-receipt.js";
76
58
  import { type TaskObjectiveContinuationInputV1, type TaskObjectiveContinuationScopeV1 } from "./taskObjectiveContinuation.js";
77
59
  import type { ArtifactReviewSourceEvidenceV1 } from "./artifactSemanticIntegrity.js";
60
+ import { type PendingAuxiliaryDispatchObservationV1, type HostAuxiliaryOperationPolicyV1, type TaskAuxiliaryContextGateway, type AuxiliaryContextOperationReceiptV1 } from "./auxiliary-context-operation.js";
78
61
  import { type SourceWideProgressEvent } from "./source-wide-extraction.js";
79
62
  import { type ContextEngineInput, type ContextEngineOutput } from "./contextEngine.js";
80
63
  import { type PromptCacheTtlSetting } from "./prompt-cache.js";
81
64
  import { type TaskExecutionSnapshotV1 } from "./taskExecutionSnapshot.js";
82
65
  import { type TaskEffectStateEvidenceV1, type TaskMutationArtifactByteReader } from "./taskEffectEvidence.js";
66
+ import { type HostMemoryBindingV1, type MemoryCapabilityV1, type MemoryQueryTraceV1, type MemorySearchResultV1 } from "../memory/memoryCapability.js";
67
+ import { type AuthoredInstructionAdmissionAudit } from "./authored-instruction-context.js";
68
+ import type { AuthoredInstructionSourcesV1 } from "./authored-instruction-sources.js";
69
+ import { type ExplicitWorkModeSelection, type ExplicitWorkModeCustody } from "./explicit-work-mode.js";
70
+ import { type MemoryCapabilityContextAudit } from "./memory-capability-context.js";
83
71
  import { type NativeTaskRequirementAmendmentV1 } from "./nativeRequirementAmendment.js";
84
72
  import { type TaskWorkPlanV1 } from "./taskWorkPlan.js";
85
73
  import { type TaskSemanticAdmissionV1, type TaskSemanticContinuationV1, type TaskSemanticAdmissionReviewInput, type TaskSemanticAdmissionReviewResult } from "./taskSemanticAdmission.js";
@@ -110,7 +98,13 @@ export interface AgenticTool {
110
98
  sessionId: string;
111
99
  taskEpoch?: number;
112
100
  ownerId?: string;
101
+ memory?: HostMemoryBindingV1;
102
+ nativeMemoryViews?: NativeMemoryViewBinding;
113
103
  }) => void;
104
+ /** Host adapter hooks; arbitrary schema-shaped tool output does not issue receipts. */
105
+ getMemoryCapabilities?: () => readonly MemoryCapabilityV1[];
106
+ readIssuedMemoryResult?: (data: unknown) => MemorySearchResultV1 | undefined;
107
+ readIssuedMemoryModelView?: (data: unknown) => string | undefined;
114
108
  /** Reopen a genuine pending private SQL cursor; intent only, never new progress. */
115
109
  prepareDurableWorkIntent?: (args: Record<string, unknown>, context?: ToolInvocationContext) => Promise<void>;
116
110
  /** Host-only exact private durable cursor; never parsed from model output. */
@@ -195,6 +189,8 @@ export interface AgenticTool {
195
189
  isObservationOnly?: (args: Record<string, unknown>) => boolean;
196
190
  /** Private execution-time identity; never permission, progress or effect authority. */
197
191
  getHistoryObservationIdentity?: (args: Record<string, unknown>, result: AgenticToolResult) => string | null;
192
+ getCommandExecutionObservation?: (args: Record<string, unknown>, result: AgenticToolResult) => unknown;
193
+ getNativeFileWriteObservation?: (args: Record<string, unknown>, result: AgenticToolResult) => unknown;
198
194
  getDesktopVerificationScope?: () => DesktopVerificationScope | undefined;
199
195
  /**
200
196
  * Optional host-owned semantic identity for a non-idempotent external
@@ -402,7 +398,25 @@ export interface AgenticToolResult {
402
398
  /** Runtime-authored typed diagnosis for failed tool calls. */
403
399
  failureDiagnosis?: FailureDiagnosis;
404
400
  }
401
+ /** Current host observation only; never execution or cancellation authority. */
402
+ export type NativeToolAttemptObservation = Readonly<{
403
+ schema: "omnius.native-tool-attempt.v1";
404
+ stage: "native_attempt_entry";
405
+ attemptId: string;
406
+ sourceCallId?: string;
407
+ parentSourceCallId?: string;
408
+ compositionInvocationId?: string;
409
+ requestedName: string;
410
+ origin: "model" | "model_text" | "voice_relay" | "api" | "composition";
411
+ sessionId: string;
412
+ runId: string;
413
+ taskEpoch: number;
414
+ ownerId: string;
415
+ ownerGeneration: number;
416
+ }>;
405
417
  export interface AgenticRunnerOptions {
418
+ /** Experimental native composition. Only an opaque host-issued fixed child policy enables it. */
419
+ toolComposition?: HostToolCompositionPolicy;
406
420
  /** Opt-in operator audit data before context/display clipping. Never model input or completion evidence. */
407
421
  captureToolResultDetails?: boolean;
408
422
  /** Maximum conversation turns (default: 30) */
@@ -513,6 +527,16 @@ export interface AgenticRunnerOptions {
513
527
  * This mirrors how Claude Code loads CLAUDE.md and project context.
514
528
  */
515
529
  dynamicContext?: string;
530
+ /** Current frontend-issued authored sources; ordinary dynamic/retrieved text cannot mint this authority. */
531
+ authoredInstructionSources?: AuthoredInstructionSourcesV1;
532
+ explicitWorkMode?: ExplicitWorkModeSelection;
533
+ explicitWorkModeCustody?: ExplicitWorkModeCustody;
534
+ /** Explicit host runtime/registry pin for cold provider-wait observation; never model arguments. */
535
+ ownedInferenceWaitRuntimeFingerprint?: string;
536
+ /** Optional operational polling budget. Zero keeps ownership until Stop or authoritative completion. */
537
+ ownedInferenceWaitObservationBudgetMs?: number;
538
+ /** Bound each body-free status request without renewing the original generation. */
539
+ ownedInferenceWaitObservationTimeoutMs?: number;
516
540
  /** Exact host-owned passive Telegram spans; quoted source text cannot grant this ownership. */
517
541
  telegramPassiveHistory?: TelegramPassiveHistoryManifest;
518
542
  /** Independently bound current native message owner for passive history. */
@@ -551,6 +575,8 @@ export interface AgenticRunnerOptions {
551
575
  memoryPrefix?: string;
552
576
  /** Hash of memoryPrefix, used for prefix-aware routing/telemetry. */
553
577
  memoryPrefixHash?: string;
578
+ /** Optional bounded observational sink. Failure cannot change retrieval or task execution. */
579
+ memoryTraceSink?: (trace: MemoryQueryTraceV1) => void | Promise<void>;
554
580
  /**
555
581
  * Enable Anthropic prompt caching (system_and_3 strategy).
556
582
  * Places up to 4 cache_control breakpoints: system + last 3 non-system messages.
@@ -832,7 +858,9 @@ export interface AgenticRunnerOptions {
832
858
  * When the model outputs FINAL_VAR(varname), this callback retrieves the value.
833
859
  * Reference: "Recursive Language Models" (arxiv:2512.24601, Principle 2).
834
860
  */
835
- finalVarResolver?: (varName: string) => Promise<string | null>;
861
+ finalVarResolver?: (varName: string, context?: {
862
+ readonly originalResponse: object;
863
+ }) => Promise<string | null>;
836
864
  /**
837
865
  * Identity kernel context injection — the agent's evolved self-model.
838
866
  * When set, injected as `c_identity` section in assembleContext().
@@ -1465,6 +1493,9 @@ export interface TaskObjectiveResumeInputV1 {
1465
1493
  */
1466
1494
  export interface AgenticReusableRunConfiguration {
1467
1495
  dynamicContext: string;
1496
+ authoredInstructionSources?: AuthoredInstructionSourcesV1;
1497
+ explicitWorkMode?: ExplicitWorkModeSelection;
1498
+ explicitWorkModeCustody?: ExplicitWorkModeCustody;
1468
1499
  taskObjectiveContinuationInput?: TaskObjectiveContinuationInputV1;
1469
1500
  taskObjectiveContinuationScope?: TaskObjectiveContinuationScopeV1;
1470
1501
  telegramPassiveHistory?: TelegramPassiveHistoryManifest;
@@ -1686,6 +1717,7 @@ export declare class AgenticRunner {
1686
1717
  private _pendingSteeringPreemption;
1687
1718
  /** One authoritative, request-protected steering state; never reconstructed from transcript. */
1688
1719
  private _activeSteering;
1720
+ private readonly _steeringIntakeSignals;
1689
1721
  /** Only typed activation or identity-validated recovery can bind steering to a run. */
1690
1722
  private _steeringAuthorityRuns;
1691
1723
  /**
@@ -1965,11 +1997,6 @@ export declare class AgenticRunner {
1965
1997
  private _reg44FireCount;
1966
1998
  private _stickyEscalationsSurfacedThisTurn;
1967
1999
  private _smaFiredThisLoop;
1968
- /** Second opinion for the current identical-call streak; see loop-triage.ts. */
1969
- private _loopTriage;
1970
- private _loopTriageActiveKey;
1971
- private readonly _loopTriageAttempts;
1972
- private readonly _loopTriageReviewHistory;
1973
2000
  private readonly _loopDiagnosticObservations;
1974
2001
  private readonly _loopReviewedDiagnosticOperations;
1975
2002
  private readonly _loopDiagnosticArchiveRefs;
@@ -2008,6 +2035,10 @@ export declare class AgenticRunner {
2008
2035
  /** Frontier feedback is a live snapshot, never terminal summary text. */
2009
2036
  private _completionFrontierFeedbackCount;
2010
2037
  private _completionLedger;
2038
+ private _nativeShellVerificationEvidence;
2039
+ private readonly _nativeFileWriteCallProofs;
2040
+ private readonly _consumedFileWriteObservations;
2041
+ private _consumedShellVerificationObservations;
2011
2042
  private _taskObjectiveContract;
2012
2043
  private _objectiveFrontier;
2013
2044
  private _objectiveConvergence;
@@ -2053,6 +2084,15 @@ export declare class AgenticRunner {
2053
2084
  /** Bounded, body-free receipt for the exact request most recently compiled. */
2054
2085
  private _lastMemoryCompilationPlanAudit;
2055
2086
  private _memoryInitialized;
2087
+ private _authoredInstructionContext;
2088
+ private readonly _explicitWorkMode;
2089
+ private _initializingNativeTools;
2090
+ private _workModeWaiting;
2091
+ private _workModeStartupCustodyRestored;
2092
+ private _memoryCapabilityContext;
2093
+ private _memoryCapabilityTaskInitializationFailed;
2094
+ private _memoryCapabilityAssociativeInitializationFailed;
2095
+ private _memoryCapabilityWorkspaceCache;
2056
2096
  private _embeddingAvailable;
2057
2097
  private _pendingEmbeddings;
2058
2098
  private _embeddingTimer;
@@ -2068,6 +2108,12 @@ export declare class AgenticRunner {
2068
2108
  private _toolSequence;
2069
2109
  private _toolSequenceEntries;
2070
2110
  private _runStartTime;
2111
+ private _ownedInferenceWaitCheckpoint?;
2112
+ private _restoredOwnedInferenceWait;
2113
+ private _retiredOwnedInferenceWaits;
2114
+ private _ownedInferenceWaitReceipt?;
2115
+ private _ownedInferenceWaitController?;
2116
+ private readonly _ownedInferenceObservedResponses;
2071
2117
  private _runErrorCount;
2072
2118
  private _runErrorPatterns;
2073
2119
  private _runWhatWorked;
@@ -2118,6 +2164,8 @@ export declare class AgenticRunner {
2118
2164
  private _unreadWebSourceCompletionBlocked;
2119
2165
  /** Model-driven folds of finished conversation spans; originals stay exact in the artifact store. */
2120
2166
  private readonly _contextFolds;
2167
+ private _checkpointOrientation?;
2168
+ private _checkpointContextAdoption;
2121
2169
  private _contextFoldConversation;
2122
2170
  private _sourceWideWebProcessing;
2123
2171
  private _streamedSourceCustody;
@@ -2340,8 +2388,10 @@ export declare class AgenticRunner {
2340
2388
  private _completionReadinessWorkboardSnapshot;
2341
2389
  private _completionReadinessConstraints;
2342
2390
  private _completionReadinessAuthorityLedger;
2391
+ private _lastVerificationInvalidatingMutation;
2343
2392
  private _completionReadinessVerificationAuthority;
2344
2393
  private _completionReadinessDeliveryAuthority;
2394
+ private _currentFactualCompletionDeficit;
2345
2395
  private _completionReadinessSnapshot;
2346
2396
  /**
2347
2397
  * Commit one authoritative terminal receipt before emitting a result to the
@@ -2505,6 +2555,19 @@ export declare class AgenticRunner {
2505
2555
  * passes. Callers provide a runtime-authored owner label. User text and
2506
2556
  * model output never select the ownership class.
2507
2557
  */
2558
+ /** A host status view, never a provider admission or model execution grant. */
2559
+ getOwnedInferenceWaitState(): Readonly<OwnedModelWaitCheckpointV1> | undefined;
2560
+ /** Historical observation pointers; these never reopen current dispatch. */
2561
+ getRetiredOwnedInferenceWaits(): readonly Readonly<OwnedModelWaitCheckpointV1>[];
2562
+ private _ownedModelPolicySha256;
2563
+ /** This is a private live-object proof, not a serialized steering field. */
2564
+ private _pendingNativeControlCustodyIsCurrent;
2565
+ private _persistOwnedModelWait;
2566
+ private _ownedModelWaitTicket;
2567
+ private _observeOwnedModelWait;
2568
+ private readonly _pendingAuxiliaryModelDispatches;
2569
+ /** Host observation of this exact current native backend argument, never an execution grant. */
2570
+ readCurrentAuxiliaryModelDispatch(backend: AgenticBackend, originalRequest: unknown): Readonly<PendingAuxiliaryDispatchObservationV1> | undefined;
2508
2571
  private _dispatchInterruptionOwnedModelRequest;
2509
2572
  /**
2510
2573
  * Mark a main-loop request as a reasoning checkpoint when run state says the
@@ -2540,6 +2603,37 @@ export declare class AgenticRunner {
2540
2603
  /** Private host identity survives sanitation only while this exact prepared
2541
2604
  * carrier still belongs to its current registered tool/run/epoch. */
2542
2605
  private _markCurrentCorpusReadCarriers;
2606
+ private _toolComposition?;
2607
+ getToolCompositionAudit(): import("./brokered-tool-composition.js").CompositionAudit | {
2608
+ enabled: false;
2609
+ invocations: never[];
2610
+ };
2611
+ private _registerToolComposition;
2612
+ private readonly _responseToolCapabilities;
2613
+ private readonly _unfilteredResponseBodies;
2614
+ private _lastBuiltToolCapabilities;
2615
+ private _lastBuiltTextToolDefinitions;
2616
+ private _textToolModeProviderSource?;
2617
+ private readonly _textToolModeRequestFailures;
2618
+ private _currentTextToolRequestFailure;
2619
+ private _lastRequestToolCapabilityAudit?;
2620
+ /** Selection telemetry only; copying this view never issues execution authority. */
2621
+ getRequestToolCapabilityAudit(): {
2622
+ schema: "omnius.request-tool-capability-audit.v1";
2623
+ stage: "bound_to_logical_request";
2624
+ logicalRequestId?: string;
2625
+ requestFingerprint: string;
2626
+ snapshotRevision: string;
2627
+ catalogueSha256: string;
2628
+ registeredNames: readonly string[];
2629
+ } | undefined;
2630
+ private _requestToolBinding;
2631
+ private _captureRequestToolCapabilities;
2632
+ private _requestToolCapabilityProblem;
2633
+ private _selectedPromptContext?;
2634
+ private _providerContextLogicalId?;
2635
+ /** Physical provider evidence stays distinct from logical compiler accounting. */
2636
+ getProviderContextAudit(): ProviderContextAudit | undefined;
2543
2637
  private _dispatchCanonicalRequest;
2544
2638
  private interruptionToolKind;
2545
2639
  /** Advisory compatibility criteria must not become dispatch or prompt
@@ -2614,6 +2708,15 @@ export declare class AgenticRunner {
2614
2708
  private _featureWorkflowTool;
2615
2709
  private _injectFeatureWorkflowAuthority;
2616
2710
  private _initializeFeatureWorkflow;
2711
+ private _contextFoldOwner;
2712
+ private _contextFoldAuthorized;
2713
+ getCheckpointContextAudit(): {
2714
+ adopted: number;
2715
+ unavailable: number;
2716
+ orientation: "absent" | "historical" | "invalid";
2717
+ };
2718
+ private _ownedHistorySourcesHost;
2719
+ private _checkpointIssuedHistoryHandles;
2617
2720
  private _registerContextFoldTools;
2618
2721
  private _artifactReadTool;
2619
2722
  private _emitFocusSupervisorEvent;
@@ -2844,7 +2947,14 @@ export declare class AgenticRunner {
2844
2947
  * the backend's own chatCompletion (empty-recovery → native /api/chat
2845
2948
  * fallback), so no caller here is Ollama-aware.
2846
2949
  */
2950
+ private _auxiliaryNativeBindings;
2951
+ private _auxiliaryOperationAudit;
2952
+ private _auxiliaryTransportScopeRefs;
2953
+ getAuxiliaryContextOperationAudit(): readonly AuxiliaryContextOperationReceiptV1[];
2954
+ private _captureAuxiliaryOperationHost;
2955
+ getTaskAuxiliaryContextGateway(invocation: ToolInvocationContext, policy: HostAuxiliaryOperationPolicyV1): TaskAuxiliaryContextGateway;
2847
2956
  private _auxInferenceBackend;
2957
+ private _performAuxiliaryContextRequest;
2848
2958
  /** Cross-session resolution-memory stores: global (machine-wide) + local. */
2849
2959
  private _resolutionMemoryPaths;
2850
2960
  private _loadResolutionMemory;
@@ -3084,6 +3194,7 @@ export declare class AgenticRunner {
3084
3194
  private _autoDeriveDelegationMutationScope;
3085
3195
  private _mutationPreflightBlock;
3086
3196
  private _extractToolTargetPaths;
3197
+ private _nativeFileWriteScopeIsCurrent;
3087
3198
  private _isRealProjectMutation;
3088
3199
  /**
3089
3200
  * Promote every structured, successful mutation into the canonical task
@@ -3577,6 +3688,29 @@ export declare class AgenticRunner {
3577
3688
  private _feedAvailableTools;
3578
3689
  /** Scope-bound tool notes/state follow the admitted run and every new epoch. */
3579
3690
  private _rebindToolExecutionScopes;
3691
+ private _nativeMemoryViews?;
3692
+ private _nativeStructuredStateCustody?;
3693
+ private nativeStructuredStateCustody;
3694
+ private nativeMemoryViews;
3695
+ /** Current host authorization, separate from historical three-field execution receipts. */
3696
+ getMemoryExecutionBinding(): Readonly<HostMemoryBindingV1> | undefined;
3697
+ private memoryCapabilityContext;
3698
+ /** Read existing activation facts only: no database construction or model probes. */
3699
+ getMemoryCapabilitiesSnapshot(): MemoryCapabilityV1[];
3700
+ private authoredInstructionContext;
3701
+ getAuthoredInstructionAudit(): AuthoredInstructionAdmissionAudit | null;
3702
+ private explicitWorkModeOwner;
3703
+ private explicitWorkModeContext;
3704
+ private awaitExplicitWorkModeAuthority;
3705
+ getExplicitWorkModeAudit(): import("./explicit-work-mode.js").ExplicitWorkModeAudit | null;
3706
+ /** Only an exact native frontend-issued selection can change current work permissions. */
3707
+ setExplicitWorkMode(selection: ExplicitWorkModeSelection, commitCustody?: () => void): void;
3708
+ private retireOwnedModelRequestForNativeControl;
3709
+ /** Commit a freshly host-issued source selection before accepting new human input. */
3710
+ refreshAuthoredInstructionSources(sources: AuthoredInstructionSourcesV1 | undefined): void;
3711
+ /** Reopen only a captured current/historical source already owned by this runner. */
3712
+ getAuthoredInstructionSourceSnapshot(sourcePath: string, manifestRef?: string): import("./authored-instruction-sources.js").AuthoredInstructionSnapshot | undefined;
3713
+ getMemoryCapabilityAudit(): MemoryCapabilityContextAudit | null;
3580
3714
  private toolNameVariants;
3581
3715
  private isToolAllowedByProfile;
3582
3716
  /** A tool may be documented globally but unavailable in this concrete run. */
@@ -3668,21 +3802,34 @@ export declare class AgenticRunner {
3668
3802
  /**
3669
3803
  * Get a static catalog of registered tools for discovery/minified prompts.
3670
3804
  * Only exposes name, description, and parameters schema (JSON shape).
3805
+ * The optional availability view follows current profile/mode restrictions;
3806
+ * neither view grants execution permission.
3671
3807
  */
3672
- getToolCatalog(): Array<{
3808
+ getToolCatalog(options?: {
3809
+ allowedOnly?: boolean;
3810
+ }): Array<{
3673
3811
  name: string;
3674
3812
  aliases?: string[];
3675
3813
  description: string;
3676
3814
  parameters: Record<string, unknown>;
3677
3815
  }>;
3816
+ /** Install a host result-candidate resolver; model text cannot issue one. */
3817
+ setFinalVarResolver(resolver: NonNullable<AgenticRunnerOptions["finalVarResolver"]>): void;
3678
3818
  /**
3679
3819
  * Execute a registered tool by name with provided args.
3680
3820
  * Validates against inputSchema if present and returns the tool result.
3681
3821
  */
3682
- runToolByName(name: string, args: Record<string, unknown>, origin?: "model_text" | "voice_relay" | "api"): Promise<AgenticToolResult>;
3822
+ runToolByName(name: string, args: Record<string, unknown>, origin?: "model_text" | "voice_relay" | "api", originalModelResponse?: object): Promise<AgenticToolResult>;
3683
3823
  private _runDirectToolByName;
3684
3824
  /** Tool executors accept argument objects, including after schema transforms. */
3685
3825
  private _parsedToolArgumentRecord;
3826
+ private readonly _nativeToolAttemptObservers;
3827
+ private readonly _nativeToolAttemptObservations;
3828
+ /** Host observation only. A return value never grants tool execution. */
3829
+ onNativeToolAttempt(observer: (original: object) => unknown): () => void;
3830
+ /** Only the exact current callback token is readable; JSON has no authority. */
3831
+ readCurrentNativeToolAttempt(original: unknown): NativeToolAttemptObservation | undefined;
3832
+ private _notifyNativeToolAttempt;
3686
3833
  /** Subscribe to agent events */
3687
3834
  onEvent(handler: AgenticEventHandler): void;
3688
3835
  /**
@@ -3963,6 +4110,7 @@ export declare class AgenticRunner {
3963
4110
  private _readTaskScopeBoundary;
3964
4111
  private _steeringCheckpointPath;
3965
4112
  private _checkpointSteeringState;
4113
+ private _steeringGoalCustodyOwner;
3966
4114
  private _readSteeringCheckpoint;
3967
4115
  private _restoreSteeringState;
3968
4116
  private _steeringEvidenceToolAllowed;
@@ -3974,17 +4122,27 @@ export declare class AgenticRunner {
3974
4122
  private _awaitingCarriedSteeringReconciliation;
3975
4123
  private _markActiveSteeringVisible;
3976
4124
  /**
3977
- * A one-shot, model-visible record that a steering scope was force-resolved.
4125
+ * A one-shot, model-visible receipt of a durably acknowledged steering scope.
3978
4126
  *
3979
4127
  * Rendered on the next request only, then cleared once the canonical
3980
4128
  * projection confirms it was carried, so the model is told once that its
3981
- * steering was retained as context and the gate is open.
4129
+ * prior refusal belongs to settled history. This cannot resolve a gate.
3982
4130
  */
3983
4131
  private _steeringResolutionNotice;
4132
+ private _steeringResolutionState;
4133
+ /** Same-process exposure witness; the durable checkpoint is still pending. */
4134
+ private _steeringResolutionObservedNotDurable;
4135
+ /** Persist factual consumption using raw task history, never a packed request.
4136
+ * A storage failure suppresses repeated display only in this process. Cold
4137
+ * recovery may repeat the pending fact, without repeating a protocol or effect. */
4138
+ private _consumeSteeringResolutionNotice;
3984
4139
  /** Peek at the pending notice; cleared only after confirmed delivery. */
3985
4140
  private _renderSteeringResolutionNotice;
3986
4141
  /** Parse the registered control region, never a semantic textual mention. */
3987
4142
  private _reconcileActiveSteeringFromModel;
4143
+ /** Change only the privately owned live intake decoration after commit.
4144
+ * Original user turns and source/tool history remain unchanged. */
4145
+ private _projectResolvedSteeringIntake;
3988
4146
  private _steeringToolGate;
3989
4147
  private _boundedSteeringToolRefusal;
3990
4148
  private _markFirstSteeringAffectedAction;
@@ -4535,13 +4693,6 @@ export declare class AgenticRunner {
4535
4693
  /** Bind loop feedback to semantic progress, never receipt count or prose. */
4536
4694
  private _loopRecoveryAdvisoryKey;
4537
4695
  private _refreshLoopRecoveryAdvisory;
4538
- /**
4539
- * Ask an independent reviewer, with one retry per streak, what appears to have
4540
- * happened when the run keeps issuing the same call. Its diagnosis is the
4541
- * reviewer's own prose about this run, not a host directive; it is shown
4542
- * only while the streak lasts and never changes tools or completion rules.
4543
- */
4544
- private _refreshLoopTriageReview;
4545
4696
  private _recordLoopRecoveryAdvisory;
4546
4697
  /** Exact migration signature of the old host producer, not a quoted heading. */
4547
4698
  private _isLegacyLoopRecoveryMessage;
@@ -4656,6 +4807,10 @@ export declare class AgenticRunner {
4656
4807
  * result. User-message wording never selects a schema.
4657
4808
  */
4658
4809
  private _refreshSelectedWorkToolExposureRevision;
4810
+ private _requestToolCatalogueContextProblem;
4811
+ /** Rebuild schemas and their private snapshot together before compiling a new
4812
+ * request. Previous responses keep the original snapshot and cannot borrow it. */
4813
+ private _currentRequestToolDefinitions;
4659
4814
  private buildToolDefinitions;
4660
4815
  /**
4661
4816
  * Detect max_completion_tokens rejection (HTTP 400) and auto-reduce to the server's limit.
@@ -4674,14 +4829,8 @@ export declare class AgenticRunner {
4674
4829
  private isRecoverableAuthError;
4675
4830
  /** Detect 402 payment-required errors that should trigger key rotation */
4676
4831
  private isPaymentRequiredError;
4677
- /**
4678
- * Graceful image error recovery chain:
4679
- * 1. Downconvert images (resize to ≤512px, JPEG compress) and retry inline
4680
- * 2. Describe images via moondream/Ollama vision → replace image_url with text description
4681
- * 3. Last resort: strip images, keep text context
4682
- *
4683
- * Mutates messages in-place. Returns true if messages were successfully transformed.
4684
- */
4832
+ /** A rejected native image is deterministic feedback, never a grant to replace its model/source. */
4833
+ private isRejectedImageInputError;
4685
4834
  private _recoverFromImageError;
4686
4835
  /**
4687
4836
  * Retry a failed model request. Network outages and GPU slot saturation wait
@@ -4826,6 +4975,8 @@ export declare function collapseDegenerateAssistantRepetition(content: string):
4826
4975
  */
4827
4976
  export declare function classifyThinkOutcome(raw: string): null | "unclosed_think" | "empty_after_strip" | "runaway_think";
4828
4977
  export interface AgenticBackend {
4978
+ /** Trusted selected-profile metadata; no probing, loading, tag heuristic or fallback. Absent is unknown. */
4979
+ supportsNativeImageInput?: () => boolean;
4829
4980
  /**
4830
4981
  * The transport's prompt renderer gathers system messages at the top and its server reuses a KV
4831
4982
  * cache only for an exact prompt prefix (hybrid/recurrent models), so primary turns must be sent
@@ -4836,6 +4987,19 @@ export interface AgenticBackend {
4836
4987
  usesManagedBrokerAdmission?: () => boolean;
4837
4988
  /** Selected loopback transport, independent of any managed-broker authority. */
4838
4989
  usesLocalInferenceReadiness?: () => boolean;
4990
+ supportsOwnedInferenceWait?: () => boolean;
4991
+ readOwnedInferenceDispatchFailure?(error: unknown): OwnedInferenceDispatchFailureV1 | undefined;
4992
+ readOwnedInferenceWait?(error: unknown): OwnedInferenceWaitReceiptV1 | undefined;
4993
+ observeOwnedInferenceWait?(receipt: OwnedInferenceWaitReceiptV1, options: OwnedInferenceWaitObserveOptions): Promise<{
4994
+ status: "completed";
4995
+ receipt: OwnedInferenceWaitReceiptV1;
4996
+ result: Awaited<ReturnType<AgenticBackend["chatCompletion"]>>;
4997
+ } | {
4998
+ status: "waiting";
4999
+ receipt: OwnedInferenceWaitReceiptV1;
5000
+ }>;
5001
+ /** Evidence only; a logical request or an audit copy never grants execution authority. */
5002
+ getProviderContextAudit?(logicalRequestId?: string): ProviderContextAudit | undefined;
4839
5003
  /** Host capability: this transport may discover remote routes after admission. */
4840
5004
  canUseRemoteFallback?: (request: Parameters<AgenticBackend["chatCompletion"]>[0]) => boolean;
4841
5005
  /** Read-only catalog routing before final context admission; never a model probe. */
@@ -4861,6 +5025,12 @@ export interface AgenticBackend {
4861
5025
  };
4862
5026
  };
4863
5027
  maxTokens: number;
5028
+ /** Native host selection; symbol metadata is omitted from JSON/wire budgets. */
5029
+ [PROMPT_CONTEXT_SELECTION]?: PromptContextSelection;
5030
+ [REQUIRED_PROVIDER_SOURCES]?: readonly RequiredProviderSource[];
5031
+ [PROVIDER_RESPONSE_PARSER]?: ProviderContextAudit["responseParser"];
5032
+ /** Explicit host-owned exact-request custody; never serialized to the provider. */
5033
+ ownedInferenceWait?: OwnedInferenceWaitContext;
4864
5034
  /** Host-only phase minimum; remote routes must fit it without clipping input. Never serialized. */
4865
5035
  minimumOutputReservation?: number;
4866
5036
  /** Issuer-bound host route/capacity plan. Never serialized to an inference provider. */
@@ -5082,6 +5252,9 @@ export interface AgenticBackend {
5082
5252
  refreshTransportContextCapability?(): Promise<OllamaTransportContextCapability | undefined>;
5083
5253
  }
5084
5254
  export declare class OllamaAgenticBackend implements AgenticBackend {
5255
+ private readonly _providerContextAudits;
5256
+ private _lastProviderContextAudit?;
5257
+ getProviderContextAudit(logicalRequestId?: string): ProviderContextAudit | undefined;
5085
5258
  private baseUrl;
5086
5259
  private model;
5087
5260
  private apiKey;
@@ -5104,6 +5277,19 @@ export declare class OllamaAgenticBackend implements AgenticBackend {
5104
5277
  /** Exact host discovery, without probing/loading a model or inferring from a port alone. */
5105
5278
  usesManagedBrokerAdmission(): boolean;
5106
5279
  usesLocalInferenceReadiness(): boolean;
5280
+ supportsOwnedInferenceWait(): boolean;
5281
+ readOwnedInferenceDispatchFailure(error: unknown): OwnedInferenceDispatchFailureV1 | undefined;
5282
+ readOwnedInferenceWait(error: unknown): OwnedInferenceWaitReceiptV1 | undefined;
5283
+ private updateOwnedInferenceWait;
5284
+ /** Observe only the original broker job. Missing/expired custody never resubmits its body. */
5285
+ observeOwnedInferenceWait(receipt: OwnedInferenceWaitReceiptV1, options: OwnedInferenceWaitObserveOptions): Promise<{
5286
+ status: "completed";
5287
+ receipt: OwnedInferenceWaitReceiptV1;
5288
+ result: Awaited<ReturnType<AgenticBackend["chatCompletion"]>>;
5289
+ } | {
5290
+ status: "waiting";
5291
+ receipt: OwnedInferenceWaitReceiptV1;
5292
+ }>;
5107
5293
  canUseRemoteFallback(request: Parameters<AgenticBackend["chatCompletion"]>[0]): boolean;
5108
5294
  prepareContextCapacity(request: Parameters<AgenticBackend["chatCompletion"]>[0], options?: {
5109
5295
  maxContextTokens?: number;
@@ -5141,6 +5327,8 @@ export declare class OllamaAgenticBackend implements AgenticBackend {
5141
5327
  /** Logical requests whose accepted body is retained by ollama-unify. */
5142
5328
  private readonly _retainedBrokerAdmissions;
5143
5329
  /** Weak dispatch custody: failed requests retain their identity, not their body. */
5330
+ private readonly _ownedInferenceWaits;
5331
+ private readonly _ownedInferenceWaitObservers;
5144
5332
  private readonly _brokerDispatchIdentities;
5145
5333
  /** Fail-closed provider protocol, authentication, and path selection. */
5146
5334
  private readonly _provider;
@@ -0,0 +1,59 @@
1
+ import type { ChatMessage } from "./agenticRunner.js";
2
+ import { ContentAddressedArtifactStore } from "./contentAddressedArtifactStore.js";
3
+ import { type AuthoredInstructionRevisionSelectionV1 } from "./authored-instruction-revisions.js";
4
+ import { type AuthoredInstructionSnapshot } from "./authored-instruction-sources.js";
5
+ export interface AuthoredInstructionCustody {
6
+ schema: "omnius.authored-instruction-custody.v1";
7
+ manifestRef: string;
8
+ archiveReference: string;
9
+ revision?: AuthoredInstructionRevisionSelectionV1;
10
+ }
11
+ export interface AuthoredInstructionAdmissionAudit {
12
+ schema: "omnius.authored-instruction-admission.v1";
13
+ manifestRef: string;
14
+ archiveReference: string;
15
+ status: "projected" | "admitted" | "coverage_failure" | "overflow";
16
+ requestFingerprint?: string;
17
+ reasonCode?: string;
18
+ revision?: AuthoredInstructionRevisionSelectionV1;
19
+ revisionAdmitted?: boolean;
20
+ sources: Array<{
21
+ path: string;
22
+ kind: string;
23
+ order: number;
24
+ status: string;
25
+ active: boolean;
26
+ reference?: string;
27
+ sha256?: string;
28
+ version?: string;
29
+ bytes?: number;
30
+ statusRequired: boolean;
31
+ contentAdmitted: boolean;
32
+ statusAdmitted: boolean;
33
+ }>;
34
+ }
35
+ /** Current authority is issued by the frontend; checkpoint copies preserve custody only. */
36
+ export declare class AuthoredInstructionContext {
37
+ private workspaceRoot?;
38
+ private current?;
39
+ private currentCustody?;
40
+ private requiresFreshSelection;
41
+ private readonly selections;
42
+ private readonly owned;
43
+ private lastAudit;
44
+ private revisionTransaction?;
45
+ configure(value: unknown, workspaceRoot: string, store: ContentAddressedArtifactStore): void;
46
+ private active;
47
+ private scope;
48
+ private render;
49
+ private remember;
50
+ private revisionScope;
51
+ private revisionContent;
52
+ project(messages: ChatMessage[]): ChatMessage[];
53
+ admit(messages: ChatMessage[], requestFingerprint: string, rejected?: boolean): AuthoredInstructionAdmissionAudit | null;
54
+ fail(status: "coverage_failure" | "overflow", reasonCode: string): void;
55
+ audit(): AuthoredInstructionAdmissionAudit | null;
56
+ checkpoint(): AuthoredInstructionCustody | undefined;
57
+ restore(value: AuthoredInstructionCustody, workspaceRoot: string, store: ContentAddressedArtifactStore): void;
58
+ reopen(sourcePath: string, manifestRef: string | undefined, store: ContentAddressedArtifactStore): AuthoredInstructionSnapshot | undefined;
59
+ }