omnius 1.0.954 → 1.0.956
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_types/execution/native-file-write-observation.d.ts +19 -0
- package/dist/_types/execution/native-memory-view-provider.d.ts +84 -0
- package/dist/_types/execution/shell-runs.d.ts +4 -0
- package/dist/_types/execution/tool-output-spool.d.ts +61 -0
- package/dist/_types/execution/tools/file-write.d.ts +53 -0
- package/dist/_types/execution/types.d.ts +34 -0
- package/dist/_types/execution/work-mode-capability.d.ts +23 -0
- package/dist/_types/memory/candidateCoverage.d.ts +23 -0
- package/dist/_types/memory/embeddings.d.ts +1 -1
- package/dist/_types/memory/memoryCapability.d.ts +259 -0
- package/dist/_types/memory/memorySourceResolver.d.ts +133 -0
- package/dist/_types/memory/memoryTypes.d.ts +16 -0
- package/dist/_types/memory/structuredMemoryStore.d.ts +63 -6
- package/dist/_types/memory/unifiedMemoryStore.d.ts +12 -1
- package/dist/_types/orchestrator/agenticRunner.d.ts +241 -46
- package/dist/_types/orchestrator/authored-instruction-context.d.ts +59 -0
- package/dist/_types/orchestrator/authored-instruction-revisions.d.ts +56 -0
- package/dist/_types/orchestrator/authored-instruction-sources.d.ts +60 -0
- package/dist/_types/orchestrator/auxiliary-context-operation.d.ts +196 -0
- package/dist/_types/orchestrator/brokered-tool-composition.d.ts +141 -0
- package/dist/_types/orchestrator/completionReadiness.d.ts +2 -2
- package/dist/_types/orchestrator/confined-composition-worker.d.ts +45 -0
- package/dist/_types/orchestrator/contentAddressedArtifactStore.d.ts +173 -0
- package/dist/_types/orchestrator/contextWindowDump.d.ts +4 -0
- package/dist/_types/orchestrator/explicit-work-mode.d.ts +92 -0
- package/dist/_types/orchestrator/interruption-lifecycle.d.ts +3 -0
- package/dist/_types/orchestrator/memory-capability-context.d.ts +49 -0
- package/dist/_types/orchestrator/owned-inference-wait.d.ts +123 -0
- package/dist/_types/orchestrator/owned-model-wait.d.ts +26 -0
- package/dist/_types/orchestrator/provider-context-contract.d.ts +78 -0
- package/dist/_types/orchestrator/request-tool-capabilities.d.ts +52 -0
- package/dist/_types/orchestrator/structured-memory-extraction-worker.d.ts +20 -0
- package/dist/_types/orchestrator/structuredMemoryInference.d.ts +12 -0
- package/dist/_types/orchestrator/successful-procedure-memory.d.ts +35 -0
- package/dist/api/py-embed.js +70 -17
- package/dist/index.js +2 -2
- package/dist/library.js +115248 -107892
- package/dist/memory-maintenance-worker.js +486 -81
- package/dist/omni-setup-worker.js +83 -30
- package/dist/tui/native/worker.js +3 -1
- package/dist/update-worker-runtime.js +280 -126
- package/docs/DISCOVERY.json +63 -0
- package/docs/DISCOVERY.md +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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) */
|
|
@@ -431,6 +445,12 @@ export interface AgenticRunnerOptions {
|
|
|
431
445
|
admitted: false;
|
|
432
446
|
feedback: string;
|
|
433
447
|
}>;
|
|
448
|
+
/** Host-only negative readiness from an original current native review.
|
|
449
|
+
* Absence grants nothing; this callback never starts inference or work. */
|
|
450
|
+
readCurrentNativeCompletionDeficit?: () => Readonly<{
|
|
451
|
+
revision: string;
|
|
452
|
+
reason: string;
|
|
453
|
+
}> | undefined;
|
|
434
454
|
/**
|
|
435
455
|
* Typed host decision describing which runtime effects must exist before a
|
|
436
456
|
* declared successful outcome is authoritative. The runner never derives
|
|
@@ -513,6 +533,16 @@ export interface AgenticRunnerOptions {
|
|
|
513
533
|
* This mirrors how Claude Code loads CLAUDE.md and project context.
|
|
514
534
|
*/
|
|
515
535
|
dynamicContext?: string;
|
|
536
|
+
/** Current frontend-issued authored sources; ordinary dynamic/retrieved text cannot mint this authority. */
|
|
537
|
+
authoredInstructionSources?: AuthoredInstructionSourcesV1;
|
|
538
|
+
explicitWorkMode?: ExplicitWorkModeSelection;
|
|
539
|
+
explicitWorkModeCustody?: ExplicitWorkModeCustody;
|
|
540
|
+
/** Explicit host runtime/registry pin for cold provider-wait observation; never model arguments. */
|
|
541
|
+
ownedInferenceWaitRuntimeFingerprint?: string;
|
|
542
|
+
/** Optional operational polling budget. Zero keeps ownership until Stop or authoritative completion. */
|
|
543
|
+
ownedInferenceWaitObservationBudgetMs?: number;
|
|
544
|
+
/** Bound each body-free status request without renewing the original generation. */
|
|
545
|
+
ownedInferenceWaitObservationTimeoutMs?: number;
|
|
516
546
|
/** Exact host-owned passive Telegram spans; quoted source text cannot grant this ownership. */
|
|
517
547
|
telegramPassiveHistory?: TelegramPassiveHistoryManifest;
|
|
518
548
|
/** Independently bound current native message owner for passive history. */
|
|
@@ -551,6 +581,8 @@ export interface AgenticRunnerOptions {
|
|
|
551
581
|
memoryPrefix?: string;
|
|
552
582
|
/** Hash of memoryPrefix, used for prefix-aware routing/telemetry. */
|
|
553
583
|
memoryPrefixHash?: string;
|
|
584
|
+
/** Optional bounded observational sink. Failure cannot change retrieval or task execution. */
|
|
585
|
+
memoryTraceSink?: (trace: MemoryQueryTraceV1) => void | Promise<void>;
|
|
554
586
|
/**
|
|
555
587
|
* Enable Anthropic prompt caching (system_and_3 strategy).
|
|
556
588
|
* Places up to 4 cache_control breakpoints: system + last 3 non-system messages.
|
|
@@ -832,7 +864,9 @@ export interface AgenticRunnerOptions {
|
|
|
832
864
|
* When the model outputs FINAL_VAR(varname), this callback retrieves the value.
|
|
833
865
|
* Reference: "Recursive Language Models" (arxiv:2512.24601, Principle 2).
|
|
834
866
|
*/
|
|
835
|
-
finalVarResolver?: (varName: string
|
|
867
|
+
finalVarResolver?: (varName: string, context?: {
|
|
868
|
+
readonly originalResponse: object;
|
|
869
|
+
}) => Promise<string | null>;
|
|
836
870
|
/**
|
|
837
871
|
* Identity kernel context injection — the agent's evolved self-model.
|
|
838
872
|
* When set, injected as `c_identity` section in assembleContext().
|
|
@@ -1465,6 +1499,9 @@ export interface TaskObjectiveResumeInputV1 {
|
|
|
1465
1499
|
*/
|
|
1466
1500
|
export interface AgenticReusableRunConfiguration {
|
|
1467
1501
|
dynamicContext: string;
|
|
1502
|
+
authoredInstructionSources?: AuthoredInstructionSourcesV1;
|
|
1503
|
+
explicitWorkMode?: ExplicitWorkModeSelection;
|
|
1504
|
+
explicitWorkModeCustody?: ExplicitWorkModeCustody;
|
|
1468
1505
|
taskObjectiveContinuationInput?: TaskObjectiveContinuationInputV1;
|
|
1469
1506
|
taskObjectiveContinuationScope?: TaskObjectiveContinuationScopeV1;
|
|
1470
1507
|
telegramPassiveHistory?: TelegramPassiveHistoryManifest;
|
|
@@ -1686,6 +1723,7 @@ export declare class AgenticRunner {
|
|
|
1686
1723
|
private _pendingSteeringPreemption;
|
|
1687
1724
|
/** One authoritative, request-protected steering state; never reconstructed from transcript. */
|
|
1688
1725
|
private _activeSteering;
|
|
1726
|
+
private readonly _steeringIntakeSignals;
|
|
1689
1727
|
/** Only typed activation or identity-validated recovery can bind steering to a run. */
|
|
1690
1728
|
private _steeringAuthorityRuns;
|
|
1691
1729
|
/**
|
|
@@ -1965,11 +2003,6 @@ export declare class AgenticRunner {
|
|
|
1965
2003
|
private _reg44FireCount;
|
|
1966
2004
|
private _stickyEscalationsSurfacedThisTurn;
|
|
1967
2005
|
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
2006
|
private readonly _loopDiagnosticObservations;
|
|
1974
2007
|
private readonly _loopReviewedDiagnosticOperations;
|
|
1975
2008
|
private readonly _loopDiagnosticArchiveRefs;
|
|
@@ -2008,6 +2041,10 @@ export declare class AgenticRunner {
|
|
|
2008
2041
|
/** Frontier feedback is a live snapshot, never terminal summary text. */
|
|
2009
2042
|
private _completionFrontierFeedbackCount;
|
|
2010
2043
|
private _completionLedger;
|
|
2044
|
+
private _nativeShellVerificationEvidence;
|
|
2045
|
+
private readonly _nativeFileWriteCallProofs;
|
|
2046
|
+
private readonly _consumedFileWriteObservations;
|
|
2047
|
+
private _consumedShellVerificationObservations;
|
|
2011
2048
|
private _taskObjectiveContract;
|
|
2012
2049
|
private _objectiveFrontier;
|
|
2013
2050
|
private _objectiveConvergence;
|
|
@@ -2053,6 +2090,15 @@ export declare class AgenticRunner {
|
|
|
2053
2090
|
/** Bounded, body-free receipt for the exact request most recently compiled. */
|
|
2054
2091
|
private _lastMemoryCompilationPlanAudit;
|
|
2055
2092
|
private _memoryInitialized;
|
|
2093
|
+
private _authoredInstructionContext;
|
|
2094
|
+
private readonly _explicitWorkMode;
|
|
2095
|
+
private _initializingNativeTools;
|
|
2096
|
+
private _workModeWaiting;
|
|
2097
|
+
private _workModeStartupCustodyRestored;
|
|
2098
|
+
private _memoryCapabilityContext;
|
|
2099
|
+
private _memoryCapabilityTaskInitializationFailed;
|
|
2100
|
+
private _memoryCapabilityAssociativeInitializationFailed;
|
|
2101
|
+
private _memoryCapabilityWorkspaceCache;
|
|
2056
2102
|
private _embeddingAvailable;
|
|
2057
2103
|
private _pendingEmbeddings;
|
|
2058
2104
|
private _embeddingTimer;
|
|
@@ -2068,6 +2114,12 @@ export declare class AgenticRunner {
|
|
|
2068
2114
|
private _toolSequence;
|
|
2069
2115
|
private _toolSequenceEntries;
|
|
2070
2116
|
private _runStartTime;
|
|
2117
|
+
private _ownedInferenceWaitCheckpoint?;
|
|
2118
|
+
private _restoredOwnedInferenceWait;
|
|
2119
|
+
private _retiredOwnedInferenceWaits;
|
|
2120
|
+
private _ownedInferenceWaitReceipt?;
|
|
2121
|
+
private _ownedInferenceWaitController?;
|
|
2122
|
+
private readonly _ownedInferenceObservedResponses;
|
|
2071
2123
|
private _runErrorCount;
|
|
2072
2124
|
private _runErrorPatterns;
|
|
2073
2125
|
private _runWhatWorked;
|
|
@@ -2118,6 +2170,8 @@ export declare class AgenticRunner {
|
|
|
2118
2170
|
private _unreadWebSourceCompletionBlocked;
|
|
2119
2171
|
/** Model-driven folds of finished conversation spans; originals stay exact in the artifact store. */
|
|
2120
2172
|
private readonly _contextFolds;
|
|
2173
|
+
private _checkpointOrientation?;
|
|
2174
|
+
private _checkpointContextAdoption;
|
|
2121
2175
|
private _contextFoldConversation;
|
|
2122
2176
|
private _sourceWideWebProcessing;
|
|
2123
2177
|
private _streamedSourceCustody;
|
|
@@ -2340,8 +2394,11 @@ export declare class AgenticRunner {
|
|
|
2340
2394
|
private _completionReadinessWorkboardSnapshot;
|
|
2341
2395
|
private _completionReadinessConstraints;
|
|
2342
2396
|
private _completionReadinessAuthorityLedger;
|
|
2397
|
+
private _lastVerificationInvalidatingMutation;
|
|
2343
2398
|
private _completionReadinessVerificationAuthority;
|
|
2344
2399
|
private _completionReadinessDeliveryAuthority;
|
|
2400
|
+
private _readCurrentNativeCompletionDeficit;
|
|
2401
|
+
private _currentFactualCompletionDeficit;
|
|
2345
2402
|
private _completionReadinessSnapshot;
|
|
2346
2403
|
/**
|
|
2347
2404
|
* Commit one authoritative terminal receipt before emitting a result to the
|
|
@@ -2505,6 +2562,19 @@ export declare class AgenticRunner {
|
|
|
2505
2562
|
* passes. Callers provide a runtime-authored owner label. User text and
|
|
2506
2563
|
* model output never select the ownership class.
|
|
2507
2564
|
*/
|
|
2565
|
+
/** A host status view, never a provider admission or model execution grant. */
|
|
2566
|
+
getOwnedInferenceWaitState(): Readonly<OwnedModelWaitCheckpointV1> | undefined;
|
|
2567
|
+
/** Historical observation pointers; these never reopen current dispatch. */
|
|
2568
|
+
getRetiredOwnedInferenceWaits(): readonly Readonly<OwnedModelWaitCheckpointV1>[];
|
|
2569
|
+
private _ownedModelPolicySha256;
|
|
2570
|
+
/** This is a private live-object proof, not a serialized steering field. */
|
|
2571
|
+
private _pendingNativeControlCustodyIsCurrent;
|
|
2572
|
+
private _persistOwnedModelWait;
|
|
2573
|
+
private _ownedModelWaitTicket;
|
|
2574
|
+
private _observeOwnedModelWait;
|
|
2575
|
+
private readonly _pendingAuxiliaryModelDispatches;
|
|
2576
|
+
/** Host observation of this exact current native backend argument, never an execution grant. */
|
|
2577
|
+
readCurrentAuxiliaryModelDispatch(backend: AgenticBackend, originalRequest: unknown): Readonly<PendingAuxiliaryDispatchObservationV1> | undefined;
|
|
2508
2578
|
private _dispatchInterruptionOwnedModelRequest;
|
|
2509
2579
|
/**
|
|
2510
2580
|
* Mark a main-loop request as a reasoning checkpoint when run state says the
|
|
@@ -2540,6 +2610,37 @@ export declare class AgenticRunner {
|
|
|
2540
2610
|
/** Private host identity survives sanitation only while this exact prepared
|
|
2541
2611
|
* carrier still belongs to its current registered tool/run/epoch. */
|
|
2542
2612
|
private _markCurrentCorpusReadCarriers;
|
|
2613
|
+
private _toolComposition?;
|
|
2614
|
+
getToolCompositionAudit(): import("./brokered-tool-composition.js").CompositionAudit | {
|
|
2615
|
+
enabled: false;
|
|
2616
|
+
invocations: never[];
|
|
2617
|
+
};
|
|
2618
|
+
private _registerToolComposition;
|
|
2619
|
+
private readonly _responseToolCapabilities;
|
|
2620
|
+
private readonly _unfilteredResponseBodies;
|
|
2621
|
+
private _lastBuiltToolCapabilities;
|
|
2622
|
+
private _lastBuiltTextToolDefinitions;
|
|
2623
|
+
private _textToolModeProviderSource?;
|
|
2624
|
+
private readonly _textToolModeRequestFailures;
|
|
2625
|
+
private _currentTextToolRequestFailure;
|
|
2626
|
+
private _lastRequestToolCapabilityAudit?;
|
|
2627
|
+
/** Selection telemetry only; copying this view never issues execution authority. */
|
|
2628
|
+
getRequestToolCapabilityAudit(): {
|
|
2629
|
+
schema: "omnius.request-tool-capability-audit.v1";
|
|
2630
|
+
stage: "bound_to_logical_request";
|
|
2631
|
+
logicalRequestId?: string;
|
|
2632
|
+
requestFingerprint: string;
|
|
2633
|
+
snapshotRevision: string;
|
|
2634
|
+
catalogueSha256: string;
|
|
2635
|
+
registeredNames: readonly string[];
|
|
2636
|
+
} | undefined;
|
|
2637
|
+
private _requestToolBinding;
|
|
2638
|
+
private _captureRequestToolCapabilities;
|
|
2639
|
+
private _requestToolCapabilityProblem;
|
|
2640
|
+
private _selectedPromptContext?;
|
|
2641
|
+
private _providerContextLogicalId?;
|
|
2642
|
+
/** Physical provider evidence stays distinct from logical compiler accounting. */
|
|
2643
|
+
getProviderContextAudit(): ProviderContextAudit | undefined;
|
|
2543
2644
|
private _dispatchCanonicalRequest;
|
|
2544
2645
|
private interruptionToolKind;
|
|
2545
2646
|
/** Advisory compatibility criteria must not become dispatch or prompt
|
|
@@ -2614,6 +2715,15 @@ export declare class AgenticRunner {
|
|
|
2614
2715
|
private _featureWorkflowTool;
|
|
2615
2716
|
private _injectFeatureWorkflowAuthority;
|
|
2616
2717
|
private _initializeFeatureWorkflow;
|
|
2718
|
+
private _contextFoldOwner;
|
|
2719
|
+
private _contextFoldAuthorized;
|
|
2720
|
+
getCheckpointContextAudit(): {
|
|
2721
|
+
adopted: number;
|
|
2722
|
+
unavailable: number;
|
|
2723
|
+
orientation: "absent" | "historical" | "invalid";
|
|
2724
|
+
};
|
|
2725
|
+
private _ownedHistorySourcesHost;
|
|
2726
|
+
private _checkpointIssuedHistoryHandles;
|
|
2617
2727
|
private _registerContextFoldTools;
|
|
2618
2728
|
private _artifactReadTool;
|
|
2619
2729
|
private _emitFocusSupervisorEvent;
|
|
@@ -2844,7 +2954,14 @@ export declare class AgenticRunner {
|
|
|
2844
2954
|
* the backend's own chatCompletion (empty-recovery → native /api/chat
|
|
2845
2955
|
* fallback), so no caller here is Ollama-aware.
|
|
2846
2956
|
*/
|
|
2957
|
+
private _auxiliaryNativeBindings;
|
|
2958
|
+
private _auxiliaryOperationAudit;
|
|
2959
|
+
private _auxiliaryTransportScopeRefs;
|
|
2960
|
+
getAuxiliaryContextOperationAudit(): readonly AuxiliaryContextOperationReceiptV1[];
|
|
2961
|
+
private _captureAuxiliaryOperationHost;
|
|
2962
|
+
getTaskAuxiliaryContextGateway(invocation: ToolInvocationContext, policy: HostAuxiliaryOperationPolicyV1): TaskAuxiliaryContextGateway;
|
|
2847
2963
|
private _auxInferenceBackend;
|
|
2964
|
+
private _performAuxiliaryContextRequest;
|
|
2848
2965
|
/** Cross-session resolution-memory stores: global (machine-wide) + local. */
|
|
2849
2966
|
private _resolutionMemoryPaths;
|
|
2850
2967
|
private _loadResolutionMemory;
|
|
@@ -3084,6 +3201,7 @@ export declare class AgenticRunner {
|
|
|
3084
3201
|
private _autoDeriveDelegationMutationScope;
|
|
3085
3202
|
private _mutationPreflightBlock;
|
|
3086
3203
|
private _extractToolTargetPaths;
|
|
3204
|
+
private _nativeFileWriteScopeIsCurrent;
|
|
3087
3205
|
private _isRealProjectMutation;
|
|
3088
3206
|
/**
|
|
3089
3207
|
* Promote every structured, successful mutation into the canonical task
|
|
@@ -3577,6 +3695,29 @@ export declare class AgenticRunner {
|
|
|
3577
3695
|
private _feedAvailableTools;
|
|
3578
3696
|
/** Scope-bound tool notes/state follow the admitted run and every new epoch. */
|
|
3579
3697
|
private _rebindToolExecutionScopes;
|
|
3698
|
+
private _nativeMemoryViews?;
|
|
3699
|
+
private _nativeStructuredStateCustody?;
|
|
3700
|
+
private nativeStructuredStateCustody;
|
|
3701
|
+
private nativeMemoryViews;
|
|
3702
|
+
/** Current host authorization, separate from historical three-field execution receipts. */
|
|
3703
|
+
getMemoryExecutionBinding(): Readonly<HostMemoryBindingV1> | undefined;
|
|
3704
|
+
private memoryCapabilityContext;
|
|
3705
|
+
/** Read existing activation facts only: no database construction or model probes. */
|
|
3706
|
+
getMemoryCapabilitiesSnapshot(): MemoryCapabilityV1[];
|
|
3707
|
+
private authoredInstructionContext;
|
|
3708
|
+
getAuthoredInstructionAudit(): AuthoredInstructionAdmissionAudit | null;
|
|
3709
|
+
private explicitWorkModeOwner;
|
|
3710
|
+
private explicitWorkModeContext;
|
|
3711
|
+
private awaitExplicitWorkModeAuthority;
|
|
3712
|
+
getExplicitWorkModeAudit(): import("./explicit-work-mode.js").ExplicitWorkModeAudit | null;
|
|
3713
|
+
/** Only an exact native frontend-issued selection can change current work permissions. */
|
|
3714
|
+
setExplicitWorkMode(selection: ExplicitWorkModeSelection, commitCustody?: () => void): void;
|
|
3715
|
+
private retireOwnedModelRequestForNativeControl;
|
|
3716
|
+
/** Commit a freshly host-issued source selection before accepting new human input. */
|
|
3717
|
+
refreshAuthoredInstructionSources(sources: AuthoredInstructionSourcesV1 | undefined): void;
|
|
3718
|
+
/** Reopen only a captured current/historical source already owned by this runner. */
|
|
3719
|
+
getAuthoredInstructionSourceSnapshot(sourcePath: string, manifestRef?: string): import("./authored-instruction-sources.js").AuthoredInstructionSnapshot | undefined;
|
|
3720
|
+
getMemoryCapabilityAudit(): MemoryCapabilityContextAudit | null;
|
|
3580
3721
|
private toolNameVariants;
|
|
3581
3722
|
private isToolAllowedByProfile;
|
|
3582
3723
|
/** A tool may be documented globally but unavailable in this concrete run. */
|
|
@@ -3668,21 +3809,34 @@ export declare class AgenticRunner {
|
|
|
3668
3809
|
/**
|
|
3669
3810
|
* Get a static catalog of registered tools for discovery/minified prompts.
|
|
3670
3811
|
* Only exposes name, description, and parameters schema (JSON shape).
|
|
3812
|
+
* The optional availability view follows current profile/mode restrictions;
|
|
3813
|
+
* neither view grants execution permission.
|
|
3671
3814
|
*/
|
|
3672
|
-
getToolCatalog(
|
|
3815
|
+
getToolCatalog(options?: {
|
|
3816
|
+
allowedOnly?: boolean;
|
|
3817
|
+
}): Array<{
|
|
3673
3818
|
name: string;
|
|
3674
3819
|
aliases?: string[];
|
|
3675
3820
|
description: string;
|
|
3676
3821
|
parameters: Record<string, unknown>;
|
|
3677
3822
|
}>;
|
|
3823
|
+
/** Install a host result-candidate resolver; model text cannot issue one. */
|
|
3824
|
+
setFinalVarResolver(resolver: NonNullable<AgenticRunnerOptions["finalVarResolver"]>): void;
|
|
3678
3825
|
/**
|
|
3679
3826
|
* Execute a registered tool by name with provided args.
|
|
3680
3827
|
* Validates against inputSchema if present and returns the tool result.
|
|
3681
3828
|
*/
|
|
3682
|
-
runToolByName(name: string, args: Record<string, unknown>, origin?: "model_text" | "voice_relay" | "api"): Promise<AgenticToolResult>;
|
|
3829
|
+
runToolByName(name: string, args: Record<string, unknown>, origin?: "model_text" | "voice_relay" | "api", originalModelResponse?: object): Promise<AgenticToolResult>;
|
|
3683
3830
|
private _runDirectToolByName;
|
|
3684
3831
|
/** Tool executors accept argument objects, including after schema transforms. */
|
|
3685
3832
|
private _parsedToolArgumentRecord;
|
|
3833
|
+
private readonly _nativeToolAttemptObservers;
|
|
3834
|
+
private readonly _nativeToolAttemptObservations;
|
|
3835
|
+
/** Host observation only. A return value never grants tool execution. */
|
|
3836
|
+
onNativeToolAttempt(observer: (original: object) => unknown): () => void;
|
|
3837
|
+
/** Only the exact current callback token is readable; JSON has no authority. */
|
|
3838
|
+
readCurrentNativeToolAttempt(original: unknown): NativeToolAttemptObservation | undefined;
|
|
3839
|
+
private _notifyNativeToolAttempt;
|
|
3686
3840
|
/** Subscribe to agent events */
|
|
3687
3841
|
onEvent(handler: AgenticEventHandler): void;
|
|
3688
3842
|
/**
|
|
@@ -3963,6 +4117,7 @@ export declare class AgenticRunner {
|
|
|
3963
4117
|
private _readTaskScopeBoundary;
|
|
3964
4118
|
private _steeringCheckpointPath;
|
|
3965
4119
|
private _checkpointSteeringState;
|
|
4120
|
+
private _steeringGoalCustodyOwner;
|
|
3966
4121
|
private _readSteeringCheckpoint;
|
|
3967
4122
|
private _restoreSteeringState;
|
|
3968
4123
|
private _steeringEvidenceToolAllowed;
|
|
@@ -3981,10 +4136,20 @@ export declare class AgenticRunner {
|
|
|
3981
4136
|
* prior refusal belongs to settled history. This cannot resolve a gate.
|
|
3982
4137
|
*/
|
|
3983
4138
|
private _steeringResolutionNotice;
|
|
4139
|
+
private _steeringResolutionState;
|
|
4140
|
+
/** Same-process exposure witness; the durable checkpoint is still pending. */
|
|
4141
|
+
private _steeringResolutionObservedNotDurable;
|
|
4142
|
+
/** Persist factual consumption using raw task history, never a packed request.
|
|
4143
|
+
* A storage failure suppresses repeated display only in this process. Cold
|
|
4144
|
+
* recovery may repeat the pending fact, without repeating a protocol or effect. */
|
|
4145
|
+
private _consumeSteeringResolutionNotice;
|
|
3984
4146
|
/** Peek at the pending notice; cleared only after confirmed delivery. */
|
|
3985
4147
|
private _renderSteeringResolutionNotice;
|
|
3986
4148
|
/** Parse the registered control region, never a semantic textual mention. */
|
|
3987
4149
|
private _reconcileActiveSteeringFromModel;
|
|
4150
|
+
/** Change only the privately owned live intake decoration after commit.
|
|
4151
|
+
* Original user turns and source/tool history remain unchanged. */
|
|
4152
|
+
private _projectResolvedSteeringIntake;
|
|
3988
4153
|
private _steeringToolGate;
|
|
3989
4154
|
private _boundedSteeringToolRefusal;
|
|
3990
4155
|
private _markFirstSteeringAffectedAction;
|
|
@@ -4535,13 +4700,6 @@ export declare class AgenticRunner {
|
|
|
4535
4700
|
/** Bind loop feedback to semantic progress, never receipt count or prose. */
|
|
4536
4701
|
private _loopRecoveryAdvisoryKey;
|
|
4537
4702
|
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
4703
|
private _recordLoopRecoveryAdvisory;
|
|
4546
4704
|
/** Exact migration signature of the old host producer, not a quoted heading. */
|
|
4547
4705
|
private _isLegacyLoopRecoveryMessage;
|
|
@@ -4656,6 +4814,10 @@ export declare class AgenticRunner {
|
|
|
4656
4814
|
* result. User-message wording never selects a schema.
|
|
4657
4815
|
*/
|
|
4658
4816
|
private _refreshSelectedWorkToolExposureRevision;
|
|
4817
|
+
private _requestToolCatalogueContextProblem;
|
|
4818
|
+
/** Rebuild schemas and their private snapshot together before compiling a new
|
|
4819
|
+
* request. Previous responses keep the original snapshot and cannot borrow it. */
|
|
4820
|
+
private _currentRequestToolDefinitions;
|
|
4659
4821
|
private buildToolDefinitions;
|
|
4660
4822
|
/**
|
|
4661
4823
|
* Detect max_completion_tokens rejection (HTTP 400) and auto-reduce to the server's limit.
|
|
@@ -4674,14 +4836,8 @@ export declare class AgenticRunner {
|
|
|
4674
4836
|
private isRecoverableAuthError;
|
|
4675
4837
|
/** Detect 402 payment-required errors that should trigger key rotation */
|
|
4676
4838
|
private isPaymentRequiredError;
|
|
4677
|
-
/**
|
|
4678
|
-
|
|
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
|
-
*/
|
|
4839
|
+
/** A rejected native image is deterministic feedback, never a grant to replace its model/source. */
|
|
4840
|
+
private isRejectedImageInputError;
|
|
4685
4841
|
private _recoverFromImageError;
|
|
4686
4842
|
/**
|
|
4687
4843
|
* Retry a failed model request. Network outages and GPU slot saturation wait
|
|
@@ -4826,6 +4982,8 @@ export declare function collapseDegenerateAssistantRepetition(content: string):
|
|
|
4826
4982
|
*/
|
|
4827
4983
|
export declare function classifyThinkOutcome(raw: string): null | "unclosed_think" | "empty_after_strip" | "runaway_think";
|
|
4828
4984
|
export interface AgenticBackend {
|
|
4985
|
+
/** Trusted selected-profile metadata; no probing, loading, tag heuristic or fallback. Absent is unknown. */
|
|
4986
|
+
supportsNativeImageInput?: () => boolean;
|
|
4829
4987
|
/**
|
|
4830
4988
|
* The transport's prompt renderer gathers system messages at the top and its server reuses a KV
|
|
4831
4989
|
* cache only for an exact prompt prefix (hybrid/recurrent models), so primary turns must be sent
|
|
@@ -4836,6 +4994,19 @@ export interface AgenticBackend {
|
|
|
4836
4994
|
usesManagedBrokerAdmission?: () => boolean;
|
|
4837
4995
|
/** Selected loopback transport, independent of any managed-broker authority. */
|
|
4838
4996
|
usesLocalInferenceReadiness?: () => boolean;
|
|
4997
|
+
supportsOwnedInferenceWait?: () => boolean;
|
|
4998
|
+
readOwnedInferenceDispatchFailure?(error: unknown): OwnedInferenceDispatchFailureV1 | undefined;
|
|
4999
|
+
readOwnedInferenceWait?(error: unknown): OwnedInferenceWaitReceiptV1 | undefined;
|
|
5000
|
+
observeOwnedInferenceWait?(receipt: OwnedInferenceWaitReceiptV1, options: OwnedInferenceWaitObserveOptions): Promise<{
|
|
5001
|
+
status: "completed";
|
|
5002
|
+
receipt: OwnedInferenceWaitReceiptV1;
|
|
5003
|
+
result: Awaited<ReturnType<AgenticBackend["chatCompletion"]>>;
|
|
5004
|
+
} | {
|
|
5005
|
+
status: "waiting";
|
|
5006
|
+
receipt: OwnedInferenceWaitReceiptV1;
|
|
5007
|
+
}>;
|
|
5008
|
+
/** Evidence only; a logical request or an audit copy never grants execution authority. */
|
|
5009
|
+
getProviderContextAudit?(logicalRequestId?: string): ProviderContextAudit | undefined;
|
|
4839
5010
|
/** Host capability: this transport may discover remote routes after admission. */
|
|
4840
5011
|
canUseRemoteFallback?: (request: Parameters<AgenticBackend["chatCompletion"]>[0]) => boolean;
|
|
4841
5012
|
/** Read-only catalog routing before final context admission; never a model probe. */
|
|
@@ -4861,6 +5032,12 @@ export interface AgenticBackend {
|
|
|
4861
5032
|
};
|
|
4862
5033
|
};
|
|
4863
5034
|
maxTokens: number;
|
|
5035
|
+
/** Native host selection; symbol metadata is omitted from JSON/wire budgets. */
|
|
5036
|
+
[PROMPT_CONTEXT_SELECTION]?: PromptContextSelection;
|
|
5037
|
+
[REQUIRED_PROVIDER_SOURCES]?: readonly RequiredProviderSource[];
|
|
5038
|
+
[PROVIDER_RESPONSE_PARSER]?: ProviderContextAudit["responseParser"];
|
|
5039
|
+
/** Explicit host-owned exact-request custody; never serialized to the provider. */
|
|
5040
|
+
ownedInferenceWait?: OwnedInferenceWaitContext;
|
|
4864
5041
|
/** Host-only phase minimum; remote routes must fit it without clipping input. Never serialized. */
|
|
4865
5042
|
minimumOutputReservation?: number;
|
|
4866
5043
|
/** Issuer-bound host route/capacity plan. Never serialized to an inference provider. */
|
|
@@ -5082,6 +5259,9 @@ export interface AgenticBackend {
|
|
|
5082
5259
|
refreshTransportContextCapability?(): Promise<OllamaTransportContextCapability | undefined>;
|
|
5083
5260
|
}
|
|
5084
5261
|
export declare class OllamaAgenticBackend implements AgenticBackend {
|
|
5262
|
+
private readonly _providerContextAudits;
|
|
5263
|
+
private _lastProviderContextAudit?;
|
|
5264
|
+
getProviderContextAudit(logicalRequestId?: string): ProviderContextAudit | undefined;
|
|
5085
5265
|
private baseUrl;
|
|
5086
5266
|
private model;
|
|
5087
5267
|
private apiKey;
|
|
@@ -5104,6 +5284,19 @@ export declare class OllamaAgenticBackend implements AgenticBackend {
|
|
|
5104
5284
|
/** Exact host discovery, without probing/loading a model or inferring from a port alone. */
|
|
5105
5285
|
usesManagedBrokerAdmission(): boolean;
|
|
5106
5286
|
usesLocalInferenceReadiness(): boolean;
|
|
5287
|
+
supportsOwnedInferenceWait(): boolean;
|
|
5288
|
+
readOwnedInferenceDispatchFailure(error: unknown): OwnedInferenceDispatchFailureV1 | undefined;
|
|
5289
|
+
readOwnedInferenceWait(error: unknown): OwnedInferenceWaitReceiptV1 | undefined;
|
|
5290
|
+
private updateOwnedInferenceWait;
|
|
5291
|
+
/** Observe only the original broker job. Missing/expired custody never resubmits its body. */
|
|
5292
|
+
observeOwnedInferenceWait(receipt: OwnedInferenceWaitReceiptV1, options: OwnedInferenceWaitObserveOptions): Promise<{
|
|
5293
|
+
status: "completed";
|
|
5294
|
+
receipt: OwnedInferenceWaitReceiptV1;
|
|
5295
|
+
result: Awaited<ReturnType<AgenticBackend["chatCompletion"]>>;
|
|
5296
|
+
} | {
|
|
5297
|
+
status: "waiting";
|
|
5298
|
+
receipt: OwnedInferenceWaitReceiptV1;
|
|
5299
|
+
}>;
|
|
5107
5300
|
canUseRemoteFallback(request: Parameters<AgenticBackend["chatCompletion"]>[0]): boolean;
|
|
5108
5301
|
prepareContextCapacity(request: Parameters<AgenticBackend["chatCompletion"]>[0], options?: {
|
|
5109
5302
|
maxContextTokens?: number;
|
|
@@ -5141,6 +5334,8 @@ export declare class OllamaAgenticBackend implements AgenticBackend {
|
|
|
5141
5334
|
/** Logical requests whose accepted body is retained by ollama-unify. */
|
|
5142
5335
|
private readonly _retainedBrokerAdmissions;
|
|
5143
5336
|
/** Weak dispatch custody: failed requests retain their identity, not their body. */
|
|
5337
|
+
private readonly _ownedInferenceWaits;
|
|
5338
|
+
private readonly _ownedInferenceWaitObservers;
|
|
5144
5339
|
private readonly _brokerDispatchIdentities;
|
|
5145
5340
|
/** Fail-closed provider protocol, authentication, and path selection. */
|
|
5146
5341
|
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
|
+
}
|