@rulvar/core 1.91.0 → 1.93.0
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/index.d.ts +73 -4
- package/dist/index.js +178 -65
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4110,6 +4110,24 @@ interface UsageLimits {
|
|
|
4110
4110
|
costs?: Record<string, number>;
|
|
4111
4111
|
};
|
|
4112
4112
|
/**
|
|
4113
|
+
* The mid-batch checkpoint boundary (RV408, the eighth-experiment
|
|
4114
|
+
* review): checkpoints normally write once per COMPLETED tool turn,
|
|
4115
|
+
* so a kill inside one large parallel batch re-pays every executed
|
|
4116
|
+
* call of that batch on resume; with the whole executed-call budget
|
|
4117
|
+
* fitting into a single batch (the `tool-cap-before-checkpoint`
|
|
4118
|
+
* preflight warning), the re-paid window is the entire budget. Set to
|
|
4119
|
+
* K to bound it: after every K EXECUTED calls within a batch the loop
|
|
4120
|
+
* durably writes the same pending state the ask suspension already
|
|
4121
|
+
* checkpoints (the executed prefix verbatim, the next call, the
|
|
4122
|
+
* remaining tail), so a resume reuses the prefix and re-runs at most
|
|
4123
|
+
* the calls since the last boundary. Denied and skipped calls do not
|
|
4124
|
+
* advance the cadence, and the batch tail writes no extra boundary
|
|
4125
|
+
* (the turn checkpoint follows immediately). Off by default: the
|
|
4126
|
+
* boundary writes extra transcript blobs, and enabling it changes no
|
|
4127
|
+
* journal bytes and no model requests, only the checkpoint cadence.
|
|
4128
|
+
*/
|
|
4129
|
+
checkpointEveryToolCalls?: number;
|
|
4130
|
+
/**
|
|
4113
4131
|
* The guaranteed finalization turn (the experiment-review P1.1): when
|
|
4114
4132
|
* a TOOL budget limiter (maxToolCalls or toolUnits) expires, the
|
|
4115
4133
|
* runtime closes the current batch's remaining calls with explicit
|
|
@@ -4191,6 +4209,8 @@ interface EffectiveUsageLimits {
|
|
|
4191
4209
|
max: number;
|
|
4192
4210
|
costs?: Record<string, number>;
|
|
4193
4211
|
};
|
|
4212
|
+
/** RV408 mid-batch checkpoint cadence; absent = per-turn only. */
|
|
4213
|
+
checkpointEveryToolCalls?: number;
|
|
4194
4214
|
finalizationReserve?: {
|
|
4195
4215
|
maxOutputTokens?: number;
|
|
4196
4216
|
};
|
|
@@ -9193,6 +9213,34 @@ declare class FileTranscriptStore implements TranscriptStore {
|
|
|
9193
9213
|
delete(ref: string): Promise<void>;
|
|
9194
9214
|
}
|
|
9195
9215
|
//#endregion
|
|
9216
|
+
//#region src/engine/pricing-snapshot.d.ts
|
|
9217
|
+
/** One pinned row: the pricing that was APPLIED to this model's usage. */
|
|
9218
|
+
interface AppliedPricingRow {
|
|
9219
|
+
model: ModelRef;
|
|
9220
|
+
rates: Pricing;
|
|
9221
|
+
}
|
|
9222
|
+
/** What `journalPricingSnapshot` rebuilds from a pinned run settle. */
|
|
9223
|
+
interface JournalPricingSnapshot {
|
|
9224
|
+
/** The PriceTable version the settle recorded; absent for caps-only rows. */
|
|
9225
|
+
pricingVersion?: string;
|
|
9226
|
+
rows: AppliedPricingRow[];
|
|
9227
|
+
/**
|
|
9228
|
+
* Prices usage with the PINNED rows only: a model absent from the
|
|
9229
|
+
* snapshot folds as unpriced (surfaced, never a silent zero), exactly
|
|
9230
|
+
* the honesty contract of the live fold.
|
|
9231
|
+
*/
|
|
9232
|
+
priceUsd: (servedBy: ModelRef, usage: Usage) => number | undefined;
|
|
9233
|
+
}
|
|
9234
|
+
/**
|
|
9235
|
+
* The read side: the LAST run-settle decision carrying a pricing pin
|
|
9236
|
+
* wins (each settling segment re-pins the union it applied, so the last
|
|
9237
|
+
* one covers every model of the journal it settled). Journals settled
|
|
9238
|
+
* before the pin shipped, or without any priced model, return
|
|
9239
|
+
* undefined: the caller keeps its current-table fold and its export
|
|
9240
|
+
* says so.
|
|
9241
|
+
*/
|
|
9242
|
+
declare function journalPricingSnapshot(entries: readonly JournalEntry[]): JournalPricingSnapshot | undefined;
|
|
9243
|
+
//#endregion
|
|
9196
9244
|
//#region src/engine/invoice.d.ts
|
|
9197
9245
|
/**
|
|
9198
9246
|
* How far a row's identity goes toward provider-side reconciliation.
|
|
@@ -9247,6 +9295,19 @@ interface InvoiceRow {
|
|
|
9247
9295
|
abandoned?: true;
|
|
9248
9296
|
reconciliation: InvoiceReconciliation;
|
|
9249
9297
|
}
|
|
9298
|
+
/**
|
|
9299
|
+
* Where the fold's rates came from (RV407): `snapshot` says the caller
|
|
9300
|
+
* priced with the run-settle pin (`journalPricingSnapshot`), so these
|
|
9301
|
+
* numbers are stable against later table updates; `current-table` says
|
|
9302
|
+
* the live table priced it, the historical behavior. Attached by the
|
|
9303
|
+
* caller, who is the one that chose.
|
|
9304
|
+
*/
|
|
9305
|
+
interface InvoicePricingProvenance {
|
|
9306
|
+
source: "snapshot" | "current-table";
|
|
9307
|
+
pricingVersion?: string | undefined;
|
|
9308
|
+
/** The pinned rows the fold used; present on snapshot-priced exports. */
|
|
9309
|
+
rows?: AppliedPricingRow[] | undefined;
|
|
9310
|
+
}
|
|
9250
9311
|
/** The machine-readable invoice: rows plus the ledger totals. */
|
|
9251
9312
|
interface InvoiceExport {
|
|
9252
9313
|
rows: InvoiceRow[];
|
|
@@ -9280,13 +9341,21 @@ interface InvoiceExport {
|
|
|
9280
9341
|
usageUnknownRows?: number;
|
|
9281
9342
|
/** Present and true when any contributing entry carried approximate usage. */
|
|
9282
9343
|
usageApprox?: boolean;
|
|
9344
|
+
/** The rates provenance (RV407); present when the caller declared it. */
|
|
9345
|
+
pricing?: InvoicePricingProvenance;
|
|
9283
9346
|
}
|
|
9284
9347
|
/**
|
|
9285
9348
|
* The pure invoice fold. Pass the same entries and price table you
|
|
9286
9349
|
* would pass `costReportFromJournal`; the totals are that report's
|
|
9287
|
-
* gross/net split verbatim.
|
|
9288
|
-
|
|
9289
|
-
|
|
9350
|
+
* gross/net split verbatim. To make the export historically stable
|
|
9351
|
+
* against price-table updates, pass the priceUsd rebuilt by
|
|
9352
|
+
* `journalPricingSnapshot` and declare it via `options.pricing` (RV407);
|
|
9353
|
+
* without a snapshot the fold prices at the current table's rates,
|
|
9354
|
+
* exactly as before.
|
|
9355
|
+
*/
|
|
9356
|
+
declare function invoiceFromJournal(entries: readonly JournalEntry[], priceUsd: (servedBy: ModelRef, usage: Usage) => number | undefined, options?: {
|
|
9357
|
+
pricing?: InvoicePricingProvenance;
|
|
9358
|
+
}): InvoiceExport;
|
|
9290
9359
|
//#endregion
|
|
9291
9360
|
//#region src/engine/preflight.d.ts
|
|
9292
9361
|
/**
|
|
@@ -10137,4 +10206,4 @@ interface SandboxBridge {
|
|
|
10137
10206
|
declare const SANDBOX_AGENT_OPT_KEYS: readonly string[];
|
|
10138
10207
|
declare function createSandboxBridge(ctx: Ctx<never>, options: SandboxBridgeOptions): SandboxBridge;
|
|
10139
10208
|
//#endregion
|
|
10140
|
-
export { AWAIT_SCHEMA, AbandonAttempt, AbandonFold, AbandonPayload, AbandonedSpendView, AbortClass, type AdaptiveEvents, AdmissionController, AdmissionDecision, AdmissionRejectedError, AdmissionStatsBefore, AdmitLineage, AdmitRejectReason, AdmitSpec, AdmitVerdict, AgentCallError, AgentError, type AgentEvents, AgentIdentityInput, type AgentInvocationRow, AgentOpts, AgentProfile, AgentProfilePermissions, AgentProfileTemplateOptions, AgentResult, AgentResultMeta, AgentStatus, ApproachSignatureInputs, ApprovalDecision, ApprovalIdentityInput, Artifact, AttemptOutcomeClass, AuditCategory, AuditRecord, AuditRunsOptions, BUDGET_ABORT_REASON, BaseAppend, BriefOpts, BudgetAccountView, BudgetDefaults, BudgetExhaustedError, BudgetExhaustionDiagnostics, BudgetHooks, BudgetReserve, type Bytes, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, CacheHint, CacheTtl, CanUseTool, CanonicalId, CanonicalIdentity, CanonicalLadderSpec, CanonicalModelSpec, ChatEvent, ChatRequest, CheckpointState, ChildArtifactPage, ChildIdentityInput, ChildResultPage, type ClaimClass, type ClaimOp, type ClaimStatus, ClaimValidationOptions, CollectOpts, CollectedTurn, CompactionConfig, CompiledPermissionChain, CompiledWorkflow, ConfigError, type CoreEvents, CostAttribution, CostAttributionFacts, CostReport, CreateEngineOptions, type CriticalPath, Ctx, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_CALLS_PER_ENTRY, DEFAULT_EVIDENCE_MIN_SHARE, DEFAULT_EVIDENCE_OVERHEAD_CALLS, DEFAULT_FINISH_MAX_REPAIRS, DEFAULT_FLAT_RESERVE_USD, DEFAULT_MAX_CHILDREN_PER_NODE, DEFAULT_MAX_DEPTH, DEFAULT_MAX_OSCILLATIONS_PER_KEY, DEFAULT_MAX_PINNED_WORKTREES, DEFAULT_MAX_REVISIONS_PER_RUN, DEFAULT_MAX_TOTAL_SPAWNS, DEFAULT_MAX_TURNS, DEFAULT_MODEL_RETRY_ATTEMPTS, DEFAULT_NO_PROGRESS_TURNS, DEFAULT_PER_RUN_CONCURRENCY, DEFAULT_RETRY_POLICY, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_SYNTHESIS_MAX_TURNS, DEFAULT_SYNTHESIS_NOTE_MAX_TURNS, DataKeyProvider, DebitResult, DeclaredLadder, DedupIndex, DedupNote, DedupedClaims, DerivedKey, DeriverRegistry, type DeterminismConfig, DeterminismError, type DeterminismEvents, type DeterminismMode, DispositionRule, DispositionTable, DonorCandidate, DonorRef, DroppedItem, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EffectiveUsageLimits, Effort, Engine, EngineDefaults, EngineQuotaConfig, EngineQuotaRuntime, EntryKind, EntryRef, EntryStatus, EnvelopeEncryption, EnvelopeEncryptionOptions, ErrorClass, ErrorCode, ErrorPolicy, EscalatedResult, EscalationDecision, EscalationDecisionAbortedError, EscalationDigest, EscalationKind, EscalationLimits, EscalationOptions, EscalationReport, EscalationRequest, EventBus, EvidenceContract, type EvidenceRef, type ExecKeyDerivation, type ExecutorRegistry, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_TOOL_NAME, FailRunError, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FencedCodeMode, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, FinishContract, FinishContractCitations, FinishContractGoldenReject, FinishContractManifest, FinishInfo, FinishSelfTestFailure, FinishSelfTestFixtures, FinishSelfTestReport, FinishValidationChild, FinishValidationInput, FinishValidationSpec, FinishValidationVerdict, FinishValidator, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, Gate, GateAudit, type GateRecord, GitWorktreeProvider, GitWorktreeProviderOptions, GraftBoot, HashVersion, HookVerdict, IMPLEMENTATION_PROFILE_LIMITS, INBOX_PROPOSAL_TTL_DAYS, IdentityInput, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, IncrementalSynthesisResult, InvalidResolutionError, InvocationRole, type InvocationTable, InvoiceExport, InvoiceReconciliation, InvoiceRow, type IsolatedExecContext, type IsolatedExecRequest, type IsolatedExecutorTag, type IsolationProvider, type IsolationSpec, Issue$1 as Issue, JOURNAL_ENVELOPE_MARKER, JournalCompatSubCode, JournalCompatibilityError, JournalEntry, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, JournalSerializationContext, JournalSerializationHook, type JournalStore, type Json, JsonSchema, JsonlFileStore, KB_ACTIVE_CLAIMS_CAP, KB_CARD_RENDER_BUDGET_CHARS, type KbProposal, type KbProposalTrigger, KeyDeriver, KeyRing, KeyedLimiter, KnowledgeCasError, type KnowledgeSnapshot, LARGE_VALUE_WARN_BYTES, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LINEAGE_SIG_VERSION, LadderSpec, type LeasableStore, type Lease, LeaseHeldError, Ledger, LineageCounters, LineageIndex, LineageRef, LineageRelation, LineageStats, LogicalTaskId, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_DEPTH_CEILING, MatchResult, McpConfig, McpToolSource, MechanicalGateProfile, MechanicalGateVerdict, MemoryQuotaLimiter, type MetaLookupStore, type ModelCaps, ModelChoice, type ModelClaim, ModelEpochInputs, type ModelKnowledgeHandle, type ModelKnowledgeStore, ModelListConstraint, ModelRef, ModelRetry, ModelSpec, Msg, NoProgressDetector, NodeId, NodeLinkValue, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OnEscalation, OperationDisposition, OrchestrateAcceptance, OrchestrateOptions, OrchestrateSynthesis, OrchestrateSynthesisSkipReason, OrchestratorBudgetSpec, OrchestratorCapConfigError, OrchestratorExtension, OrchestratorExtensionIO, OrchestratorRuntime, Out, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, Part, PendingExternal, PendingToolTurn, PermissionConfig, PermissionGate, PermissionHook, PermissionPreset, PermissionRule, PermissionVerdict, type PhaseRow, PhaseTarget, PipelineCollected, PipelineOpts, PlanInvariantError, PreflightAdmissionRow, PreflightFinding, PreflightInput, PreflightOrchestratorSpec, PreflightReport, PreflightSpawnReport, PreflightSpawnSpec, PreflightToolCeiling, PriceTable, PricedUsage, type Pricing, type PricingTier, ProgressReport, type ProviderAdapter, ProviderCallRecord, QUOTA_WINDOW_MS, QualityFloors, QuotaCounters, type QuotaDecision, type QuotaEstimate, type QuotaLimiter, type QuotaReservationRequest, QuotaRule, QuotaWindowSnapshot, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, RESEARCH_PROFILE_LIMITS, REVIEW_PROFILE_LIMITS, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_PROFILES, RUN_SETTLE_DECISION_TYPE, RandIdentityInput, RandPayload, RateLimitObservation, ReconcileOptions, ReconcileResult, RefEntryAppender, RefEntryClassification, RefusalInfo, RepeatedClaim, ReplayDisposition, ReplayMode, ReplayPlanHashMismatch, Replayer, RepositoryResearchToolset, RepositoryResearchToolsetOptions, ResearchAgentProfileOptions, ResearchAgentProfileResult, ResearchEvidenceEntry, ResolutionArbiter, ResolutionAttempt, ResolutionBy, ResolutionFold, ResolutionLayer, ResolutionOutcome, ResolutionPayload, ResolvedInvocation, ResolvedToolset, ResumeHandle, ResumeOptions, ResumePreview, ResumeReport, RetryClass, RetryPolicy, ReuseConfig, RiskRuleValue, Role, RulvarError, RulvarErrorCode, RunAgentOptions, RunAuditVerdict, RunBudget, RunEventSink, RunExport, type RunFilter, RunHandle, RunInternals, type RunMeta, RunOptions, RunOutcome, RunProfile, RunStateAudit, RunStatus, RuntimeEventSink, SANDBOX_AGENT_OPT_KEYS, SPAWN_AGENT_SCHEMA, SandboxBridge, SandboxBridgeOptions, SandboxError, SandboxHostToWorker, SandboxMethod, SandboxWorkerToHost, SchemaPair, SchemaSpec, SchemaValidationResult, ScopeSegment, ScriptRejected, ScriptRunner, ScrubNote, SecretMasker, SectionMatchMode, Semaphore, SerializationHook, Settled, SettlementError, ShellPatternRules, ShellSegment, ShellVerdict, SinglePhaseAppend, SpanMinter, SpanRegistry, SpawnAdmissionValue, SpawnAgentParams, SpawnKey, SpawnLineage, SpawnLineageOpt, SpawnOrigin, SpawnRecord, Spend, Stage, type StandardJSONSchemaV1, type StandardSchemaV1, StepIdentityInput, StructuredOutputTier, SuspendedAppend, SuspensionState, TOOL_NAME_PATTERN, type TaskClass, TaskDigest, TaskSpec, TerminalPatch, TerminationAccount, TerminationAccountSnapshot, TerminationDeniedValue, TerminationDeniedWriter, TerminationInitValue, TerminationLimits, TerminationResource, type ToolBudgetSummary, ToolCallRequest, ToolChoice, type ToolContext, ToolContextSeed, ToolContract, type ToolDef, type ToolEvents, type ToolExecutor, type ToolExecutorProvider, ToolInit, type ToolRisk, ToolRuntime, type ToolSource, type ToolSourceSession, ToolsOption, TranscriptSerializationHook, type TranscriptStore, TriggerClass, TtlState, Usage, UsageLimits, UsageSlice, VerifiedRecommendation, WAIT_FOR_EVENTS_SCHEMA, WAIT_FOR_EVENTS_TOOL_NAME, WAKE_SUMMARY_RENDER_BUDGET_CHARS, WakeBudgetBlock, WakeDigest, WakeTrigger, WireError, Workflow, WorkflowCallOpts, type WorkflowEvent, type WorkflowEventBody, WorkflowRegistry, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, atCompactionThreshold, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, claimExpired, claimExpiry, claimIssues, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compilePermissionChain, compilePermissionPreset, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidencePreservedValidator, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, finishContract, foldTermination, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, invoiceFromJournal, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, orchestratorAdmissionEstCostUsd, parallelScope, parseModelRef, parseScopePath, phiInitialOf, pipelineScope, planNodeScope, preflightEstimate, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reduceAuditTrail, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotUsage, spawnDepthOf, stripFencedBlocks, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, usageViolations, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateUsageLimits, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
|
|
10209
|
+
export { AWAIT_SCHEMA, AbandonAttempt, AbandonFold, AbandonPayload, AbandonedSpendView, AbortClass, type AdaptiveEvents, AdmissionController, AdmissionDecision, AdmissionRejectedError, AdmissionStatsBefore, AdmitLineage, AdmitRejectReason, AdmitSpec, AdmitVerdict, AgentCallError, AgentError, type AgentEvents, AgentIdentityInput, type AgentInvocationRow, AgentOpts, AgentProfile, AgentProfilePermissions, AgentProfileTemplateOptions, AgentResult, AgentResultMeta, AgentStatus, type AppliedPricingRow, ApproachSignatureInputs, ApprovalDecision, ApprovalIdentityInput, Artifact, AttemptOutcomeClass, AuditCategory, AuditRecord, AuditRunsOptions, BUDGET_ABORT_REASON, BaseAppend, BriefOpts, BudgetAccountView, BudgetDefaults, BudgetExhaustedError, BudgetExhaustionDiagnostics, BudgetHooks, BudgetReserve, type Bytes, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, CacheHint, CacheTtl, CanUseTool, CanonicalId, CanonicalIdentity, CanonicalLadderSpec, CanonicalModelSpec, ChatEvent, ChatRequest, CheckpointState, ChildArtifactPage, ChildIdentityInput, ChildResultPage, type ClaimClass, type ClaimOp, type ClaimStatus, ClaimValidationOptions, CollectOpts, CollectedTurn, CompactionConfig, CompiledPermissionChain, CompiledWorkflow, ConfigError, type CoreEvents, CostAttribution, CostAttributionFacts, CostReport, CreateEngineOptions, type CriticalPath, Ctx, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_CALLS_PER_ENTRY, DEFAULT_EVIDENCE_MIN_SHARE, DEFAULT_EVIDENCE_OVERHEAD_CALLS, DEFAULT_FINISH_MAX_REPAIRS, DEFAULT_FLAT_RESERVE_USD, DEFAULT_MAX_CHILDREN_PER_NODE, DEFAULT_MAX_DEPTH, DEFAULT_MAX_OSCILLATIONS_PER_KEY, DEFAULT_MAX_PINNED_WORKTREES, DEFAULT_MAX_REVISIONS_PER_RUN, DEFAULT_MAX_TOTAL_SPAWNS, DEFAULT_MAX_TURNS, DEFAULT_MODEL_RETRY_ATTEMPTS, DEFAULT_NO_PROGRESS_TURNS, DEFAULT_PER_RUN_CONCURRENCY, DEFAULT_RETRY_POLICY, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_SYNTHESIS_MAX_TURNS, DEFAULT_SYNTHESIS_NOTE_MAX_TURNS, DataKeyProvider, DebitResult, DeclaredLadder, DedupIndex, DedupNote, DedupedClaims, DerivedKey, DeriverRegistry, type DeterminismConfig, DeterminismError, type DeterminismEvents, type DeterminismMode, DispositionRule, DispositionTable, DonorCandidate, DonorRef, DroppedItem, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EffectiveUsageLimits, Effort, Engine, EngineDefaults, EngineQuotaConfig, EngineQuotaRuntime, EntryKind, EntryRef, EntryStatus, EnvelopeEncryption, EnvelopeEncryptionOptions, ErrorClass, ErrorCode, ErrorPolicy, EscalatedResult, EscalationDecision, EscalationDecisionAbortedError, EscalationDigest, EscalationKind, EscalationLimits, EscalationOptions, EscalationReport, EscalationRequest, EventBus, EvidenceContract, type EvidenceRef, type ExecKeyDerivation, type ExecutorRegistry, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_TOOL_NAME, FailRunError, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FencedCodeMode, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, FinishContract, FinishContractCitations, FinishContractGoldenReject, FinishContractManifest, FinishInfo, FinishSelfTestFailure, FinishSelfTestFixtures, FinishSelfTestReport, FinishValidationChild, FinishValidationInput, FinishValidationSpec, FinishValidationVerdict, FinishValidator, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, Gate, GateAudit, type GateRecord, GitWorktreeProvider, GitWorktreeProviderOptions, GraftBoot, HashVersion, HookVerdict, IMPLEMENTATION_PROFILE_LIMITS, INBOX_PROPOSAL_TTL_DAYS, IdentityInput, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, IncrementalSynthesisResult, InvalidResolutionError, InvocationRole, type InvocationTable, InvoiceExport, InvoicePricingProvenance, InvoiceReconciliation, InvoiceRow, type IsolatedExecContext, type IsolatedExecRequest, type IsolatedExecutorTag, type IsolationProvider, type IsolationSpec, Issue$1 as Issue, JOURNAL_ENVELOPE_MARKER, JournalCompatSubCode, JournalCompatibilityError, JournalEntry, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, type JournalPricingSnapshot, JournalSerializationContext, JournalSerializationHook, type JournalStore, type Json, JsonSchema, JsonlFileStore, KB_ACTIVE_CLAIMS_CAP, KB_CARD_RENDER_BUDGET_CHARS, type KbProposal, type KbProposalTrigger, KeyDeriver, KeyRing, KeyedLimiter, KnowledgeCasError, type KnowledgeSnapshot, LARGE_VALUE_WARN_BYTES, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LINEAGE_SIG_VERSION, LadderSpec, type LeasableStore, type Lease, LeaseHeldError, Ledger, LineageCounters, LineageIndex, LineageRef, LineageRelation, LineageStats, LogicalTaskId, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_DEPTH_CEILING, MatchResult, McpConfig, McpToolSource, MechanicalGateProfile, MechanicalGateVerdict, MemoryQuotaLimiter, type MetaLookupStore, type ModelCaps, ModelChoice, type ModelClaim, ModelEpochInputs, type ModelKnowledgeHandle, type ModelKnowledgeStore, ModelListConstraint, ModelRef, ModelRetry, ModelSpec, Msg, NoProgressDetector, NodeId, NodeLinkValue, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OnEscalation, OperationDisposition, OrchestrateAcceptance, OrchestrateOptions, OrchestrateSynthesis, OrchestrateSynthesisSkipReason, OrchestratorBudgetSpec, OrchestratorCapConfigError, OrchestratorExtension, OrchestratorExtensionIO, OrchestratorRuntime, Out, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, Part, PendingExternal, PendingToolTurn, PermissionConfig, PermissionGate, PermissionHook, PermissionPreset, PermissionRule, PermissionVerdict, type PhaseRow, PhaseTarget, PipelineCollected, PipelineOpts, PlanInvariantError, PreflightAdmissionRow, PreflightFinding, PreflightInput, PreflightOrchestratorSpec, PreflightReport, PreflightSpawnReport, PreflightSpawnSpec, PreflightToolCeiling, PriceTable, PricedUsage, type Pricing, type PricingTier, ProgressReport, type ProviderAdapter, ProviderCallRecord, QUOTA_WINDOW_MS, QualityFloors, QuotaCounters, type QuotaDecision, type QuotaEstimate, type QuotaLimiter, type QuotaReservationRequest, QuotaRule, QuotaWindowSnapshot, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, RESEARCH_PROFILE_LIMITS, REVIEW_PROFILE_LIMITS, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_PROFILES, RUN_SETTLE_DECISION_TYPE, RandIdentityInput, RandPayload, RateLimitObservation, ReconcileOptions, ReconcileResult, RefEntryAppender, RefEntryClassification, RefusalInfo, RepeatedClaim, ReplayDisposition, ReplayMode, ReplayPlanHashMismatch, Replayer, RepositoryResearchToolset, RepositoryResearchToolsetOptions, ResearchAgentProfileOptions, ResearchAgentProfileResult, ResearchEvidenceEntry, ResolutionArbiter, ResolutionAttempt, ResolutionBy, ResolutionFold, ResolutionLayer, ResolutionOutcome, ResolutionPayload, ResolvedInvocation, ResolvedToolset, ResumeHandle, ResumeOptions, ResumePreview, ResumeReport, RetryClass, RetryPolicy, ReuseConfig, RiskRuleValue, Role, RulvarError, RulvarErrorCode, RunAgentOptions, RunAuditVerdict, RunBudget, RunEventSink, RunExport, type RunFilter, RunHandle, RunInternals, type RunMeta, RunOptions, RunOutcome, RunProfile, RunStateAudit, RunStatus, RuntimeEventSink, SANDBOX_AGENT_OPT_KEYS, SPAWN_AGENT_SCHEMA, SandboxBridge, SandboxBridgeOptions, SandboxError, SandboxHostToWorker, SandboxMethod, SandboxWorkerToHost, SchemaPair, SchemaSpec, SchemaValidationResult, ScopeSegment, ScriptRejected, ScriptRunner, ScrubNote, SecretMasker, SectionMatchMode, Semaphore, SerializationHook, Settled, SettlementError, ShellPatternRules, ShellSegment, ShellVerdict, SinglePhaseAppend, SpanMinter, SpanRegistry, SpawnAdmissionValue, SpawnAgentParams, SpawnKey, SpawnLineage, SpawnLineageOpt, SpawnOrigin, SpawnRecord, Spend, Stage, type StandardJSONSchemaV1, type StandardSchemaV1, StepIdentityInput, StructuredOutputTier, SuspendedAppend, SuspensionState, TOOL_NAME_PATTERN, type TaskClass, TaskDigest, TaskSpec, TerminalPatch, TerminationAccount, TerminationAccountSnapshot, TerminationDeniedValue, TerminationDeniedWriter, TerminationInitValue, TerminationLimits, TerminationResource, type ToolBudgetSummary, ToolCallRequest, ToolChoice, type ToolContext, ToolContextSeed, ToolContract, type ToolDef, type ToolEvents, type ToolExecutor, type ToolExecutorProvider, ToolInit, type ToolRisk, ToolRuntime, type ToolSource, type ToolSourceSession, ToolsOption, TranscriptSerializationHook, type TranscriptStore, TriggerClass, TtlState, Usage, UsageLimits, UsageSlice, VerifiedRecommendation, WAIT_FOR_EVENTS_SCHEMA, WAIT_FOR_EVENTS_TOOL_NAME, WAKE_SUMMARY_RENDER_BUDGET_CHARS, WakeBudgetBlock, WakeDigest, WakeTrigger, WireError, Workflow, WorkflowCallOpts, type WorkflowEvent, type WorkflowEventBody, WorkflowRegistry, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, atCompactionThreshold, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, claimExpired, claimExpiry, claimIssues, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compilePermissionChain, compilePermissionPreset, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidencePreservedValidator, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, finishContract, foldTermination, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, invoiceFromJournal, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, journalPricingSnapshot, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, orchestratorAdmissionEstCostUsd, parallelScope, parseModelRef, parseScopePath, phiInitialOf, pipelineScope, planNodeScope, preflightEstimate, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reduceAuditTrail, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotUsage, spawnDepthOf, stripFencedBlocks, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, usageViolations, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateUsageLimits, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
|
package/dist/index.js
CHANGED
|
@@ -8280,8 +8280,11 @@ function costReportFromJournal(entries, priceUsd) {
|
|
|
8280
8280
|
* no id to match).
|
|
8281
8281
|
*
|
|
8282
8282
|
* Pricing happens at fold time from the table you pass, exactly like
|
|
8283
|
-
* CostReport
|
|
8284
|
-
*
|
|
8283
|
+
* CostReport. For historical stability against price-table updates,
|
|
8284
|
+
* pass the priceUsd rebuilt by `journalPricingSnapshot` (RV407): the
|
|
8285
|
+
* settling segment pins the rates it applied into the run-settle
|
|
8286
|
+
* decision value, and a fold over the pinned rows reproduces the
|
|
8287
|
+
* settled numbers whatever the live table says today.
|
|
8285
8288
|
*/
|
|
8286
8289
|
const USAGE_FIELDS = [
|
|
8287
8290
|
"inputTokens",
|
|
@@ -8371,9 +8374,13 @@ function rowUsd(priceUsd, servedBy, usage) {
|
|
|
8371
8374
|
/**
|
|
8372
8375
|
* The pure invoice fold. Pass the same entries and price table you
|
|
8373
8376
|
* would pass `costReportFromJournal`; the totals are that report's
|
|
8374
|
-
* gross/net split verbatim.
|
|
8377
|
+
* gross/net split verbatim. To make the export historically stable
|
|
8378
|
+
* against price-table updates, pass the priceUsd rebuilt by
|
|
8379
|
+
* `journalPricingSnapshot` and declare it via `options.pricing` (RV407);
|
|
8380
|
+
* without a snapshot the fold prices at the current table's rates,
|
|
8381
|
+
* exactly as before.
|
|
8375
8382
|
*/
|
|
8376
|
-
function invoiceFromJournal(entries, priceUsd) {
|
|
8383
|
+
function invoiceFromJournal(entries, priceUsd, options) {
|
|
8377
8384
|
const report = costReportFromJournal(entries, priceUsd);
|
|
8378
8385
|
const abandonFold = buildAbandonFold(entries);
|
|
8379
8386
|
const rows = [];
|
|
@@ -8459,10 +8466,148 @@ function invoiceFromJournal(entries, priceUsd) {
|
|
|
8459
8466
|
const count = rows.filter((row) => row.usageUnknown === true).length;
|
|
8460
8467
|
return count === 0 ? {} : { usageUnknownRows: count };
|
|
8461
8468
|
})(),
|
|
8462
|
-
...usageApprox ? { usageApprox: true } : {}
|
|
8469
|
+
...usageApprox ? { usageApprox: true } : {},
|
|
8470
|
+
...options?.pricing === void 0 ? {} : { pricing: options.pricing }
|
|
8463
8471
|
};
|
|
8464
8472
|
}
|
|
8465
8473
|
//#endregion
|
|
8474
|
+
//#region src/model/pricing.ts
|
|
8475
|
+
/**
|
|
8476
|
+
* Resolves the pricing for a model: the versioned table wins; the
|
|
8477
|
+
* adapter-reported caps.pricing is the fallback; undefined means
|
|
8478
|
+
* unpriced (the CostReport surfaces it, never a silent zero).
|
|
8479
|
+
*/
|
|
8480
|
+
function resolvePricing(ref, table, capsPricing) {
|
|
8481
|
+
return table?.models[ref] ?? capsPricing;
|
|
8482
|
+
}
|
|
8483
|
+
/** The tier a full prompt lands in: the highest threshold strictly below it. */
|
|
8484
|
+
function tierFor(pricing, inputTokens) {
|
|
8485
|
+
let tier;
|
|
8486
|
+
for (const candidate of pricing.tiers ?? []) if (inputTokens > candidate.aboveInputTokens && (tier === void 0 || candidate.aboveInputTokens > tier.aboveInputTokens)) tier = candidate;
|
|
8487
|
+
return tier;
|
|
8488
|
+
}
|
|
8489
|
+
/**
|
|
8490
|
+
* Dollars from normalized usage against one pricing row. Under the Usage
|
|
8491
|
+
* invariant inputTokens is the FULL prompt including cache reads and
|
|
8492
|
+
* writes, so the input rate bills only the uncached remainder and cache
|
|
8493
|
+
* tokens bill at their own rates, never twice; a row that omits a cache
|
|
8494
|
+
* rate bills those tokens at the plain input rate rather than silently
|
|
8495
|
+
* for free. A row may carry long-context tiers: the highest threshold
|
|
8496
|
+
* strictly below the full prompt re-prices the ENTIRE request
|
|
8497
|
+
* (input-side rates scale by inputMultiplier, the output rate by
|
|
8498
|
+
* outputMultiplier). Cache writes price at the 5m premium rate; the 1h
|
|
8499
|
+
* rate applies where a provider distinguishes it in usage, which the
|
|
8500
|
+
* canonical Usage does not yet carry.
|
|
8501
|
+
*/
|
|
8502
|
+
function priceUsdOf(pricing, usage) {
|
|
8503
|
+
const tier = tierFor(pricing, usage.inputTokens);
|
|
8504
|
+
const inputMul = tier?.inputMultiplier ?? 1;
|
|
8505
|
+
const outputMul = tier?.outputMultiplier ?? 1;
|
|
8506
|
+
return Math.max(0, usage.inputTokens - usage.cacheReadTokens - usage.cacheWriteTokens) / 1e6 * pricing.inputUsdPerMTok * inputMul + usage.outputTokens / 1e6 * pricing.outputUsdPerMTok * outputMul + usage.cacheReadTokens / 1e6 * (pricing.cacheReadUsdPerMTok ?? pricing.inputUsdPerMTok) * inputMul + usage.cacheWriteTokens / 1e6 * (pricing.cacheWriteUsdPerMTok ?? pricing.inputUsdPerMTok) * inputMul;
|
|
8507
|
+
}
|
|
8508
|
+
/**
|
|
8509
|
+
* The output tokens `remainingUsd` still buys from one pricing row after
|
|
8510
|
+
* paying for an estimated prompt of `estimatedInputTokens`, priced with
|
|
8511
|
+
* the same tier rules as settlement (the tier is selected by the
|
|
8512
|
+
* estimated prompt). Floored to whole tokens; zero or negative means not
|
|
8513
|
+
* even one output token fits, so the turn must not be dispatched.
|
|
8514
|
+
* Undefined when the row prices output at zero (a free model needs no
|
|
8515
|
+
* output bound).
|
|
8516
|
+
*/
|
|
8517
|
+
function affordableOutputTokens(pricing, remainingUsd, estimatedInputTokens) {
|
|
8518
|
+
const tier = tierFor(pricing, estimatedInputTokens);
|
|
8519
|
+
const outputRate = pricing.outputUsdPerMTok * (tier?.outputMultiplier ?? 1);
|
|
8520
|
+
if (outputRate <= 0) return;
|
|
8521
|
+
const inputUsd = priceUsdOf(pricing, {
|
|
8522
|
+
inputTokens: estimatedInputTokens,
|
|
8523
|
+
outputTokens: 0,
|
|
8524
|
+
cacheReadTokens: 0,
|
|
8525
|
+
cacheWriteTokens: 0
|
|
8526
|
+
});
|
|
8527
|
+
return Math.floor((remainingUsd - inputUsd) / outputRate * 1e6);
|
|
8528
|
+
}
|
|
8529
|
+
//#endregion
|
|
8530
|
+
//#region src/engine/pricing-snapshot.ts
|
|
8531
|
+
/**
|
|
8532
|
+
* A pinnable row: every present rate is a finite non-negative number.
|
|
8533
|
+
* The fold already treats a broken rate as unpriced (a NaN or negative
|
|
8534
|
+
* price never poisons the CostReport), so the pin mirrors exactly that
|
|
8535
|
+
* and, just as importantly, never feeds a non-finite number to the
|
|
8536
|
+
* journal's serialization gate.
|
|
8537
|
+
*/
|
|
8538
|
+
function pinnable(rates) {
|
|
8539
|
+
const sane = (value) => value === void 0 || Number.isFinite(value) && value >= 0;
|
|
8540
|
+
return sane(rates.inputUsdPerMTok) && sane(rates.outputUsdPerMTok) && sane(rates.cacheReadUsdPerMTok) && sane(rates.cacheWriteUsdPerMTok) && sane(rates.cacheWrite1hUsdPerMTok) && (rates.tiers ?? []).every((tier) => sane(tier.aboveInputTokens) && sane(tier.inputMultiplier) && sane(tier.outputMultiplier));
|
|
8541
|
+
}
|
|
8542
|
+
/**
|
|
8543
|
+
* The write-side collection: the resolved pricing row for every model
|
|
8544
|
+
* the journal's usage names (terminal slices, per-dispatch records, and
|
|
8545
|
+
* plain servedBy alike). Models that resolve no pricing, and rows the
|
|
8546
|
+
* fold would refuse anyway (a non-finite or negative rate), are
|
|
8547
|
+
* omitted, exactly as the fold surfaces them as `unpriced`; an empty
|
|
8548
|
+
* collection returns undefined so an unpriced run's settle stays
|
|
8549
|
+
* byte-identical.
|
|
8550
|
+
*/
|
|
8551
|
+
function snapshotJournalPricing(entries, pricingOf) {
|
|
8552
|
+
const models = /* @__PURE__ */ new Set();
|
|
8553
|
+
for (const entry of entries) {
|
|
8554
|
+
if (entry.status === "running" || entry.usage === void 0) continue;
|
|
8555
|
+
if (entry.servedBy !== void 0) models.add(entry.servedBy);
|
|
8556
|
+
for (const slice of entryUsageSlices(entry)) models.add(slice.servedBy);
|
|
8557
|
+
for (const record of entry.providerCalls ?? []) models.add(record.servedBy);
|
|
8558
|
+
}
|
|
8559
|
+
const rows = [];
|
|
8560
|
+
for (const model of [...models].sort()) {
|
|
8561
|
+
const rates = pricingOf(model);
|
|
8562
|
+
if (rates !== void 0 && pinnable(rates)) rows.push({
|
|
8563
|
+
model,
|
|
8564
|
+
rates
|
|
8565
|
+
});
|
|
8566
|
+
}
|
|
8567
|
+
return rows.length === 0 ? void 0 : rows;
|
|
8568
|
+
}
|
|
8569
|
+
function pinnedRows(value) {
|
|
8570
|
+
const candidate = value?.pricing;
|
|
8571
|
+
if (!Array.isArray(candidate) || candidate.length === 0) return;
|
|
8572
|
+
const rows = [];
|
|
8573
|
+
for (const item of candidate) {
|
|
8574
|
+
const row = item;
|
|
8575
|
+
if (typeof row.model !== "string" || !row.model.includes(":") || row.rates === null || typeof row.rates !== "object") return;
|
|
8576
|
+
rows.push({
|
|
8577
|
+
model: row.model,
|
|
8578
|
+
rates: row.rates
|
|
8579
|
+
});
|
|
8580
|
+
}
|
|
8581
|
+
return rows;
|
|
8582
|
+
}
|
|
8583
|
+
/**
|
|
8584
|
+
* The read side: the LAST run-settle decision carrying a pricing pin
|
|
8585
|
+
* wins (each settling segment re-pins the union it applied, so the last
|
|
8586
|
+
* one covers every model of the journal it settled). Journals settled
|
|
8587
|
+
* before the pin shipped, or without any priced model, return
|
|
8588
|
+
* undefined: the caller keeps its current-table fold and its export
|
|
8589
|
+
* says so.
|
|
8590
|
+
*/
|
|
8591
|
+
function journalPricingSnapshot(entries) {
|
|
8592
|
+
for (let i = entries.length - 1; i >= 0; i -= 1) {
|
|
8593
|
+
const entry = entries[i];
|
|
8594
|
+
if (entry?.kind !== "decision") continue;
|
|
8595
|
+
const value = entry.value;
|
|
8596
|
+
if (value?.decisionType !== "run_settle") continue;
|
|
8597
|
+
const rows = pinnedRows(value);
|
|
8598
|
+
if (rows === void 0) continue;
|
|
8599
|
+
const byModel = new Map(rows.map((row) => [row.model, row.rates]));
|
|
8600
|
+
return {
|
|
8601
|
+
...typeof value.pricingVersion === "string" ? { pricingVersion: value.pricingVersion } : {},
|
|
8602
|
+
rows,
|
|
8603
|
+
priceUsd: (servedBy, usage) => {
|
|
8604
|
+
const rates = byModel.get(servedBy);
|
|
8605
|
+
return rates === void 0 ? void 0 : priceUsdOf(rates, usage);
|
|
8606
|
+
}
|
|
8607
|
+
};
|
|
8608
|
+
}
|
|
8609
|
+
}
|
|
8610
|
+
//#endregion
|
|
8466
8611
|
//#region src/model/router.ts
|
|
8467
8612
|
/**
|
|
8468
8613
|
* Model router core (M1-T05): the per-engine adapter registry, ModelRef
|
|
@@ -8718,62 +8863,6 @@ function ladderRungChoice(ladder, index) {
|
|
|
8718
8863
|
};
|
|
8719
8864
|
}
|
|
8720
8865
|
//#endregion
|
|
8721
|
-
//#region src/model/pricing.ts
|
|
8722
|
-
/**
|
|
8723
|
-
* Resolves the pricing for a model: the versioned table wins; the
|
|
8724
|
-
* adapter-reported caps.pricing is the fallback; undefined means
|
|
8725
|
-
* unpriced (the CostReport surfaces it, never a silent zero).
|
|
8726
|
-
*/
|
|
8727
|
-
function resolvePricing(ref, table, capsPricing) {
|
|
8728
|
-
return table?.models[ref] ?? capsPricing;
|
|
8729
|
-
}
|
|
8730
|
-
/** The tier a full prompt lands in: the highest threshold strictly below it. */
|
|
8731
|
-
function tierFor(pricing, inputTokens) {
|
|
8732
|
-
let tier;
|
|
8733
|
-
for (const candidate of pricing.tiers ?? []) if (inputTokens > candidate.aboveInputTokens && (tier === void 0 || candidate.aboveInputTokens > tier.aboveInputTokens)) tier = candidate;
|
|
8734
|
-
return tier;
|
|
8735
|
-
}
|
|
8736
|
-
/**
|
|
8737
|
-
* Dollars from normalized usage against one pricing row. Under the Usage
|
|
8738
|
-
* invariant inputTokens is the FULL prompt including cache reads and
|
|
8739
|
-
* writes, so the input rate bills only the uncached remainder and cache
|
|
8740
|
-
* tokens bill at their own rates, never twice; a row that omits a cache
|
|
8741
|
-
* rate bills those tokens at the plain input rate rather than silently
|
|
8742
|
-
* for free. A row may carry long-context tiers: the highest threshold
|
|
8743
|
-
* strictly below the full prompt re-prices the ENTIRE request
|
|
8744
|
-
* (input-side rates scale by inputMultiplier, the output rate by
|
|
8745
|
-
* outputMultiplier). Cache writes price at the 5m premium rate; the 1h
|
|
8746
|
-
* rate applies where a provider distinguishes it in usage, which the
|
|
8747
|
-
* canonical Usage does not yet carry.
|
|
8748
|
-
*/
|
|
8749
|
-
function priceUsdOf(pricing, usage) {
|
|
8750
|
-
const tier = tierFor(pricing, usage.inputTokens);
|
|
8751
|
-
const inputMul = tier?.inputMultiplier ?? 1;
|
|
8752
|
-
const outputMul = tier?.outputMultiplier ?? 1;
|
|
8753
|
-
return Math.max(0, usage.inputTokens - usage.cacheReadTokens - usage.cacheWriteTokens) / 1e6 * pricing.inputUsdPerMTok * inputMul + usage.outputTokens / 1e6 * pricing.outputUsdPerMTok * outputMul + usage.cacheReadTokens / 1e6 * (pricing.cacheReadUsdPerMTok ?? pricing.inputUsdPerMTok) * inputMul + usage.cacheWriteTokens / 1e6 * (pricing.cacheWriteUsdPerMTok ?? pricing.inputUsdPerMTok) * inputMul;
|
|
8754
|
-
}
|
|
8755
|
-
/**
|
|
8756
|
-
* The output tokens `remainingUsd` still buys from one pricing row after
|
|
8757
|
-
* paying for an estimated prompt of `estimatedInputTokens`, priced with
|
|
8758
|
-
* the same tier rules as settlement (the tier is selected by the
|
|
8759
|
-
* estimated prompt). Floored to whole tokens; zero or negative means not
|
|
8760
|
-
* even one output token fits, so the turn must not be dispatched.
|
|
8761
|
-
* Undefined when the row prices output at zero (a free model needs no
|
|
8762
|
-
* output bound).
|
|
8763
|
-
*/
|
|
8764
|
-
function affordableOutputTokens(pricing, remainingUsd, estimatedInputTokens) {
|
|
8765
|
-
const tier = tierFor(pricing, estimatedInputTokens);
|
|
8766
|
-
const outputRate = pricing.outputUsdPerMTok * (tier?.outputMultiplier ?? 1);
|
|
8767
|
-
if (outputRate <= 0) return;
|
|
8768
|
-
const inputUsd = priceUsdOf(pricing, {
|
|
8769
|
-
inputTokens: estimatedInputTokens,
|
|
8770
|
-
outputTokens: 0,
|
|
8771
|
-
cacheReadTokens: 0,
|
|
8772
|
-
cacheWriteTokens: 0
|
|
8773
|
-
});
|
|
8774
|
-
return Math.floor((remainingUsd - inputUsd) / outputRate * 1e6);
|
|
8775
|
-
}
|
|
8776
|
-
//#endregion
|
|
8777
8866
|
//#region src/model/quota.ts
|
|
8778
8867
|
/**
|
|
8779
8868
|
* Quota rules and the in-process reference QuotaLimiter (RV-215).
|
|
@@ -9033,6 +9122,8 @@ function mergeUsageLimits(call, profile, engine) {
|
|
|
9033
9122
|
if (maxCallsPerTool !== void 0) merged.maxCallsPerTool = maxCallsPerTool;
|
|
9034
9123
|
const toolUnits = pick("toolUnits");
|
|
9035
9124
|
if (toolUnits !== void 0) merged.toolUnits = toolUnits;
|
|
9125
|
+
const checkpointEveryToolCalls = pick("checkpointEveryToolCalls");
|
|
9126
|
+
if (checkpointEveryToolCalls !== void 0) merged.checkpointEveryToolCalls = checkpointEveryToolCalls;
|
|
9036
9127
|
const finalizationReserve = pick("finalizationReserve");
|
|
9037
9128
|
if (finalizationReserve !== void 0) merged.finalizationReserve = finalizationReserve;
|
|
9038
9129
|
const toolBudgetExtension = pick("toolBudgetExtension");
|
|
@@ -9078,6 +9169,7 @@ function validateUsageLimits(limits, site) {
|
|
|
9078
9169
|
for (const [name, cost] of Object.entries(costs)) requireNonNegativeInteger(cost, `${site}.toolUnits.costs['${name}']`);
|
|
9079
9170
|
}
|
|
9080
9171
|
}
|
|
9172
|
+
if (limits.checkpointEveryToolCalls !== void 0) requirePositiveInteger(limits.checkpointEveryToolCalls, `${site}.checkpointEveryToolCalls`);
|
|
9081
9173
|
if (limits.finalizationReserve !== void 0) {
|
|
9082
9174
|
const reserve = limits.finalizationReserve;
|
|
9083
9175
|
if (typeof reserve !== "object" || reserve === null || Array.isArray(reserve)) throw new ConfigError(`${site}.finalizationReserve must be { maxOutputTokens? }`);
|
|
@@ -10979,6 +11071,7 @@ async function runAgent(options) {
|
|
|
10979
11071
|
}));
|
|
10980
11072
|
};
|
|
10981
11073
|
let terminalAdmitted = false;
|
|
11074
|
+
let executedSinceBoundary = 0;
|
|
10982
11075
|
for (const [index, call] of calls.entries()) {
|
|
10983
11076
|
const expiryOf = () => {
|
|
10984
11077
|
const cap = effectiveMaxToolCalls();
|
|
@@ -11230,6 +11323,21 @@ async function runAgent(options) {
|
|
|
11230
11323
|
guardTrip: true
|
|
11231
11324
|
};
|
|
11232
11325
|
}
|
|
11326
|
+
executedSinceBoundary += 1;
|
|
11327
|
+
const boundaryCadence = limits.checkpointEveryToolCalls;
|
|
11328
|
+
const next = calls[index + 1];
|
|
11329
|
+
if (boundaryCadence !== void 0 && executedSinceBoundary >= boundaryCadence && next !== void 0) {
|
|
11330
|
+
executedSinceBoundary = 0;
|
|
11331
|
+
await saveBoundary({
|
|
11332
|
+
executed: toPendingRecords(parts),
|
|
11333
|
+
awaiting: {
|
|
11334
|
+
id: next.id,
|
|
11335
|
+
name: next.name,
|
|
11336
|
+
args: next.args
|
|
11337
|
+
},
|
|
11338
|
+
remaining: calls.slice(index + 2)
|
|
11339
|
+
});
|
|
11340
|
+
}
|
|
11233
11341
|
}
|
|
11234
11342
|
maybeMarkWindowEntry();
|
|
11235
11343
|
return {
|
|
@@ -18678,10 +18786,10 @@ function preflightEstimate(input) {
|
|
|
18678
18786
|
spawn: label
|
|
18679
18787
|
});
|
|
18680
18788
|
}
|
|
18681
|
-
if (executedToolCallCeiling !== null && executedToolCallCeiling > 0 && caps?.supportsParallelTools === true) say({
|
|
18789
|
+
if (executedToolCallCeiling !== null && executedToolCallCeiling > 0 && caps?.supportsParallelTools === true && (limits.checkpointEveryToolCalls === void 0 || limits.checkpointEveryToolCalls >= executedToolCallCeiling)) say({
|
|
18682
18790
|
severity: "warning",
|
|
18683
18791
|
code: "tool-cap-before-checkpoint",
|
|
18684
|
-
message: `spawn '${label}': the whole executed-call budget (${String(executedToolCallCeiling)} calls) fits into one parallel tool batch, and checkpoints write once per completed tool turn: the cap can be reached before any checkpoint exists, and a kill mid-batch re-pays every executed call on resume`,
|
|
18792
|
+
message: `spawn '${label}': the whole executed-call budget (${String(executedToolCallCeiling)} calls) fits into one parallel tool batch, and checkpoints write once per completed tool turn: the cap can be reached before any checkpoint exists, and a kill mid-batch re-pays every executed call on resume; bound the window with limits.checkpointEveryToolCalls (RV408)`,
|
|
18685
18793
|
spawn: label
|
|
18686
18794
|
});
|
|
18687
18795
|
if (limits.toolBudgetExtension !== void 0) if (limits.maxToolCalls === void 0) say({
|
|
@@ -20492,6 +20600,7 @@ function createEngine(options) {
|
|
|
20492
20600
|
const recorded = lastRunSettle(replayer.snapshot());
|
|
20493
20601
|
if (appendedHere > 0 || recorded !== void 0 && recorded.runStatus !== status || recorded === void 0 && snapshotLength > 0) {
|
|
20494
20602
|
const outputHash = hashRunOutput(outcome.value);
|
|
20603
|
+
const appliedPricing = options.pricing === void 0 ? void 0 : snapshotJournalPricing(replayer.snapshot(), pricingOf);
|
|
20495
20604
|
try {
|
|
20496
20605
|
await replayer.appendSinglePhase({
|
|
20497
20606
|
scope: "",
|
|
@@ -20504,7 +20613,11 @@ function createEngine(options) {
|
|
|
20504
20613
|
decisionType: RUN_SETTLE_DECISION_TYPE,
|
|
20505
20614
|
runStatus: status,
|
|
20506
20615
|
segment: segmentsBefore + 1,
|
|
20507
|
-
...outputHash === void 0 ? {} : { outputHash }
|
|
20616
|
+
...outputHash === void 0 ? {} : { outputHash },
|
|
20617
|
+
...appliedPricing === void 0 || options.pricing === void 0 ? {} : {
|
|
20618
|
+
pricing: appliedPricing,
|
|
20619
|
+
pricingVersion: options.pricing.pricingVersion
|
|
20620
|
+
}
|
|
20508
20621
|
}
|
|
20509
20622
|
});
|
|
20510
20623
|
} catch (settleErr) {
|
|
@@ -21055,4 +21168,4 @@ function createSandboxBridge(ctx, options) {
|
|
|
21055
21168
|
};
|
|
21056
21169
|
}
|
|
21057
21170
|
//#endregion
|
|
21058
|
-
export { AWAIT_SCHEMA, AdmissionController, AdmissionRejectedError, AgentCallError, BUDGET_ABORT_REASON, BudgetExhaustedError, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, ConfigError, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_CALLS_PER_ENTRY, DEFAULT_EVIDENCE_MIN_SHARE, DEFAULT_EVIDENCE_OVERHEAD_CALLS, DEFAULT_FINISH_MAX_REPAIRS, DEFAULT_FLAT_RESERVE_USD, DEFAULT_MAX_CHILDREN_PER_NODE, DEFAULT_MAX_DEPTH, DEFAULT_MAX_OSCILLATIONS_PER_KEY, DEFAULT_MAX_PINNED_WORKTREES, DEFAULT_MAX_REVISIONS_PER_RUN, DEFAULT_MAX_TOTAL_SPAWNS, DEFAULT_MAX_TURNS, DEFAULT_MODEL_RETRY_ATTEMPTS, DEFAULT_NO_PROGRESS_TURNS, DEFAULT_PER_RUN_CONCURRENCY, DEFAULT_RETRY_POLICY, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_SYNTHESIS_MAX_TURNS, DEFAULT_SYNTHESIS_NOTE_MAX_TURNS, DedupIndex, DeterminismError, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EscalationDecisionAbortedError, EventBus, ExternalRegistry, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_TOOL_NAME, FailRunError, FileModelKnowledgeStore, FileTranscriptStore, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, GitWorktreeProvider, IMPLEMENTATION_PROFILE_LIMITS, INBOX_PROPOSAL_TTL_DAYS, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, InvalidResolutionError, JOURNAL_ENVELOPE_MARKER, JournalCompatibilityError, JournalMatcher, JournalMissError, JournalOrderViolation, JsonlFileStore, KB_ACTIVE_CLAIMS_CAP, KB_CARD_RENDER_BUDGET_CHARS, KeyedLimiter, KnowledgeCasError, LARGE_VALUE_WARN_BYTES, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LINEAGE_SIG_VERSION, LeaseHeldError, LineageIndex, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_DEPTH_CEILING, ModelRetry, NoProgressDetector, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OrchestratorCapConfigError, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, PlanInvariantError, QUOTA_WINDOW_MS, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, RESEARCH_PROFILE_LIMITS, REVIEW_PROFILE_LIMITS, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_PROFILES, RUN_SETTLE_DECISION_TYPE, ReplayPlanHashMismatch, Replayer, ResolutionArbiter, ResolutionFold, RulvarError, RunBudget, SANDBOX_AGENT_OPT_KEYS, SPAWN_AGENT_SCHEMA, SandboxError, ScriptRejected, Semaphore, SettlementError, SpanRegistry, TOOL_NAME_PATTERN, TerminationAccount, WAIT_FOR_EVENTS_SCHEMA, WAIT_FOR_EVENTS_TOOL_NAME, WAKE_SUMMARY_RENDER_BUDGET_CHARS, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, atCompactionThreshold, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, claimExpired, claimExpiry, claimIssues, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compilePermissionChain, compilePermissionPreset, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidencePreservedValidator, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, finishContract, foldTermination, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, invoiceFromJournal, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, orchestratorAdmissionEstCostUsd, parallelScope, parseModelRef, parseScopePath, phiInitialOf, pipelineScope, planNodeScope, preflightEstimate, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reduceAuditTrail, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotUsage, spawnDepthOf, stripFencedBlocks, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, usageViolations, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateUsageLimits, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
|
|
21171
|
+
export { AWAIT_SCHEMA, AdmissionController, AdmissionRejectedError, AgentCallError, BUDGET_ABORT_REASON, BudgetExhaustedError, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, ConfigError, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_CALLS_PER_ENTRY, DEFAULT_EVIDENCE_MIN_SHARE, DEFAULT_EVIDENCE_OVERHEAD_CALLS, DEFAULT_FINISH_MAX_REPAIRS, DEFAULT_FLAT_RESERVE_USD, DEFAULT_MAX_CHILDREN_PER_NODE, DEFAULT_MAX_DEPTH, DEFAULT_MAX_OSCILLATIONS_PER_KEY, DEFAULT_MAX_PINNED_WORKTREES, DEFAULT_MAX_REVISIONS_PER_RUN, DEFAULT_MAX_TOTAL_SPAWNS, DEFAULT_MAX_TURNS, DEFAULT_MODEL_RETRY_ATTEMPTS, DEFAULT_NO_PROGRESS_TURNS, DEFAULT_PER_RUN_CONCURRENCY, DEFAULT_RETRY_POLICY, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_SYNTHESIS_MAX_TURNS, DEFAULT_SYNTHESIS_NOTE_MAX_TURNS, DedupIndex, DeterminismError, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EscalationDecisionAbortedError, EventBus, ExternalRegistry, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_TOOL_NAME, FailRunError, FileModelKnowledgeStore, FileTranscriptStore, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, GitWorktreeProvider, IMPLEMENTATION_PROFILE_LIMITS, INBOX_PROPOSAL_TTL_DAYS, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, InvalidResolutionError, JOURNAL_ENVELOPE_MARKER, JournalCompatibilityError, JournalMatcher, JournalMissError, JournalOrderViolation, JsonlFileStore, KB_ACTIVE_CLAIMS_CAP, KB_CARD_RENDER_BUDGET_CHARS, KeyedLimiter, KnowledgeCasError, LARGE_VALUE_WARN_BYTES, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LINEAGE_SIG_VERSION, LeaseHeldError, LineageIndex, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_DEPTH_CEILING, ModelRetry, NoProgressDetector, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OrchestratorCapConfigError, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, PlanInvariantError, QUOTA_WINDOW_MS, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, RESEARCH_PROFILE_LIMITS, REVIEW_PROFILE_LIMITS, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_PROFILES, RUN_SETTLE_DECISION_TYPE, ReplayPlanHashMismatch, Replayer, ResolutionArbiter, ResolutionFold, RulvarError, RunBudget, SANDBOX_AGENT_OPT_KEYS, SPAWN_AGENT_SCHEMA, SandboxError, ScriptRejected, Semaphore, SettlementError, SpanRegistry, TOOL_NAME_PATTERN, TerminationAccount, WAIT_FOR_EVENTS_SCHEMA, WAIT_FOR_EVENTS_TOOL_NAME, WAKE_SUMMARY_RENDER_BUDGET_CHARS, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, atCompactionThreshold, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, claimExpired, claimExpiry, claimIssues, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compilePermissionChain, compilePermissionPreset, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidencePreservedValidator, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, finishContract, foldTermination, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, invoiceFromJournal, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, journalPricingSnapshot, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, orchestratorAdmissionEstCostUsd, parallelScope, parseModelRef, parseScopePath, phiInitialOf, pipelineScope, planNodeScope, preflightEstimate, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reduceAuditTrail, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotUsage, spawnDepthOf, stripFencedBlocks, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, usageViolations, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateUsageLimits, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulvar/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.93.0",
|
|
4
4
|
"description": "Rulvar core: L0 contracts, journal kernel, ctx primitives, agent runtime, model router, tool system, dynamic orchestrator, InMemory and JSONL stores, event stream.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|