@rulvar/core 1.5.2 → 1.7.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @rulvar/core
2
2
 
3
- The rulvar engine in one dependency-light package: the L0 contracts and
3
+ The Rulvar engine in one dependency-light package: the L0 contracts and
4
4
  SPI interfaces, the journal kernel behind the never-pay-twice invariant,
5
5
  the model router with the capability and price registry, the agent
6
6
  runtime, the tool system and MCP bus, the `ctx` primitives and run
@@ -10,7 +10,7 @@ adapters plug in from their own packages. Key exports: `createEngine`,
10
10
  `defineWorkflow`, `tool`, `mcp`, `orchestrate`, `InMemoryStore`,
11
11
  `JsonlFileStore`.
12
12
 
13
- Part of [rulvar](https://rulvar.com), an embeddable TypeScript engine
13
+ Part of [Rulvar](https://rulvar.com), an embeddable TypeScript engine
14
14
  for durable, budget-bounded multi-agent LLM workflows, where a completed
15
15
  LLM call is never paid for twice. Full documentation:
16
16
  [docs.rulvar.com](https://docs.rulvar.com).
package/dist/index.d.ts CHANGED
@@ -608,6 +608,23 @@ interface UsageSlice {
608
608
  usage: Usage;
609
609
  }
610
610
  /**
611
+ * Cost-attribution facts a live run knows at settlement and a pure
612
+ * journal fold cannot re-derive: the innermost phase name at the call
613
+ * site, the agent profile, the primary invocation role, the budget
614
+ * account the call debited, and whether the dispatch spent the
615
+ * orchestrator finalize reserve. Policy, never identity, exactly like
616
+ * usageByModel: none of it enters the content key, and entries written
617
+ * before the field shipped fold under the documented fallback buckets
618
+ * (empty phase, 'unknown' agent type, role 'loop').
619
+ */
620
+ interface CostAttributionFacts {
621
+ phase?: string;
622
+ agentType?: string;
623
+ role?: InvocationRole;
624
+ budgetAccount?: string;
625
+ finalizeReserve?: boolean;
626
+ }
627
+ /**
611
628
  * The per-model slices of a terminal entry: the recorded split when the
612
629
  * call spanned several models, else the whole usage attributed to
613
630
  * `servedBy`. The fallback is what makes every journal written before the
@@ -669,6 +686,13 @@ type JournalEntry = {
669
686
  * Policy, never identity: it does not enter the content key.
670
687
  */
671
688
  usageByModel?: UsageSlice[];
689
+ /**
690
+ * Terminal usage-bearing entries: the attribution facts behind the
691
+ * CostReport breakdowns, so a pure journal fold reproduces the live
692
+ * report byte for byte on replay. Policy, never identity, exactly
693
+ * like usageByModel.
694
+ */
695
+ costAttribution?: CostAttributionFacts;
672
696
  transcriptRef?: string;
673
697
  checkpointRef?: string;
674
698
  /**
@@ -1029,6 +1053,25 @@ declare function validateSchemaSpec<S extends SchemaSpec>(spec: S, value: unknow
1029
1053
  //#endregion
1030
1054
  //#region src/l0/spi/provider.d.ts
1031
1055
  /**
1056
+ * One long-context price tier. When the full prompt (canonical
1057
+ * inputTokens, cache included) is strictly above `aboveInputTokens`, the
1058
+ * ENTIRE request is re-priced with these multipliers, not only the tokens
1059
+ * past the threshold (how providers state their long-context rules).
1060
+ * `inputMultiplier` scales every input-side rate: input, cache read, and
1061
+ * cache write.
1062
+ * `outputMultiplier` scales the output rate. Provider pricing pages state
1063
+ * multipliers for "input" without saying whether cache rates scale;
1064
+ * scaling them with input is the conservative reading for budget
1065
+ * enforcement (it never underestimates spend). With several tiers, the
1066
+ * highest threshold below the prompt size wins, independent of array
1067
+ * order.
1068
+ */
1069
+ interface PricingTier {
1070
+ aboveInputTokens: number;
1071
+ inputMultiplier: number;
1072
+ outputMultiplier: number;
1073
+ }
1074
+ /**
1032
1075
  * Per-model pricing in USD per million tokens. The registry's
1033
1076
  * versioned price table wins over adapter-
1034
1077
  * reported caps.pricing, which is a fallback only.
@@ -1041,6 +1084,8 @@ interface Pricing {
1041
1084
  cacheWriteUsdPerMTok?: number;
1042
1085
  /** 1h write premium rate where the provider distinguishes. */
1043
1086
  cacheWrite1hUsdPerMTok?: number;
1087
+ /** Long-context tiers; a row without them is one linear price. */
1088
+ tiers?: PricingTier[];
1044
1089
  }
1045
1090
  /** Capability facts the router consumes for tier selection and scrubbing. */
1046
1091
  type ModelCaps = {
@@ -2062,6 +2107,8 @@ interface TerminalPatch {
2062
2107
  servedBy?: ModelRef;
2063
2108
  /** Set only when the call spanned several serving models; see JournalEntry. */
2064
2109
  usageByModel?: UsageSlice[];
2110
+ /** Attribution facts behind the CostReport breakdowns; see JournalEntry. */
2111
+ costAttribution?: CostAttributionFacts;
2065
2112
  transcriptRef?: string;
2066
2113
  checkpointRef?: string;
2067
2114
  /** Terminal agent entries: Artifact list. */
@@ -2740,6 +2787,15 @@ interface RuntimeEventSink {
2740
2787
  interface BudgetHooks {
2741
2788
  /** Layer 2: before every turn; throws BudgetExhaustedError to block dispatch. */
2742
2789
  beforeTurn(): void;
2790
+ /**
2791
+ * Layer 2b, the pre-dispatch output bound: the output tokens the
2792
+ * remaining budget still affords from `servedBy` for a prompt of
2793
+ * `estimatedInputTokens`. The dispatch clamps the request's
2794
+ * maxOutputTokens to it and denies the turn entirely when not even one
2795
+ * output token fits. Undefined = unbounded (no ceiling, no price row,
2796
+ * or free output).
2797
+ */
2798
+ maxAffordableOutputTokens?: (servedBy: ModelRef, estimatedInputTokens: number) => number | undefined;
2743
2799
  /** Live usage accounting; layer 3 may respond by aborting `signal`. */
2744
2800
  onUsage(usage: Usage, servedBy: ModelRef): void;
2745
2801
  /** Layer 3: the ceiling AbortSignal. */
@@ -3292,15 +3348,20 @@ declare const DEFAULT_FLAT_RESERVE_USD = .5;
3292
3348
  /** The run-root account scope. */
3293
3349
  declare const ROOT_ACCOUNT = "run";
3294
3350
  /**
3295
- * The admission reserve for a spawn: opts.estCost, else profile.estCost, else
3296
- * price(countTokens(input) + caps.maxOutputTokens), else the engine flat
3297
- * default.
3351
+ * The admission reserve for a spawn: opts.estCost, else profile.estCost,
3352
+ * else price(countTokens(input) + one turn's worth of output), else the
3353
+ * engine flat default. The output term is caps.maxOutputTokens clamped to
3354
+ * limits.maxOutputTokensPerTurn when the spawn carries one, so a host can
3355
+ * bound reserves without hand-written estimates. The priced path uses the
3356
+ * SAME price function as settlement (priceUsdOf), so long-context tiers
3357
+ * apply to estimates too.
3298
3358
  */
3299
3359
  declare function admissionReserveUsd(options: {
3300
3360
  estCost?: number;
3301
3361
  profileEstCost?: number;
3302
3362
  inputTokens?: number;
3303
3363
  caps?: ModelCaps;
3364
+ maxOutputTokensPerTurn?: number;
3304
3365
  flatReserveUsd?: number;
3305
3366
  }): number;
3306
3367
  /** Read-only projection of one account. */
@@ -3313,6 +3374,26 @@ interface BudgetAccountView {
3313
3374
  parentScope?: string;
3314
3375
  }
3315
3376
  /**
3377
+ * Why a ceiling error ended the work: the first closed account walking
3378
+ * from the debited scope toward the root, plus the root state, so the
3379
+ * outward message can name WHICH ceiling actually crossed instead of
3380
+ * blaming the run ceiling for every crossing.
3381
+ */
3382
+ interface BudgetExhaustionDiagnostics {
3383
+ crossed?: {
3384
+ scope: string;
3385
+ source: "root" | "orchestrator-cap" | "child-account";
3386
+ ceilingUsd: number;
3387
+ spentUsd: number;
3388
+ committedReserveUsd: number;
3389
+ finalizeReserveUsd: number;
3390
+ };
3391
+ root: {
3392
+ ceilingUsd?: number;
3393
+ spentUsd: number;
3394
+ };
3395
+ }
3396
+ /**
3316
3397
  * The per-run budget account tree. All spend accounting is per instance;
3317
3398
  * the journal remains the durable source (the root is seeded by the
3318
3399
  * ledger fold on resume, M2; sub-account reserves are recovered from
@@ -3324,6 +3405,7 @@ declare class RunBudget {
3324
3405
  private readonly lifetimeSpawnCap;
3325
3406
  private readonly events?;
3326
3407
  private readonly priceUsd?;
3408
+ private readonly pricingOf?;
3327
3409
  private readonly accounts;
3328
3410
  private usageInternal;
3329
3411
  private agentsSpawnedInternal;
@@ -3334,7 +3416,8 @@ declare class RunBudget {
3334
3416
  ceilingUsd?: number;
3335
3417
  lifetimeSpawnCap?: number;
3336
3418
  events?: RuntimeEventSink;
3337
- priceUsd?: (servedBy: ModelRef, usage: Usage) => number | undefined;
3419
+ priceUsd?: (servedBy: ModelRef, usage: Usage) => number | undefined; /** Raw price-row resolution for the layer-2b output bound. */
3420
+ pricingOf?: (servedBy: ModelRef) => Pricing | undefined;
3338
3421
  /**
3339
3422
  * The resume ledger fold: spend is never
3340
3423
  * reset and never double-counted; replayed entries are already inside
@@ -3358,7 +3441,20 @@ declare class RunBudget {
3358
3441
  parentScope?: string;
3359
3442
  ceilingUsd?: number;
3360
3443
  finalizeReserveUsd?: number;
3444
+ kind?: "orchestrator-cap";
3361
3445
  }): void;
3446
+ /**
3447
+ * The diagnostic projection behind a ceiling error: the first CLOSED
3448
+ * account (projected commitments included, exactly the layer-1
3449
+ * closure test) walking from `scope` toward the root, plus the root
3450
+ * state. 'run budget ceiling reached' under a healthy root misled the
3451
+ * v1.6.0 follow-up review's live probe when only a 0.18 USD
3452
+ * orchestrator cap had crossed under a 0.90 USD root; the message can
3453
+ * now name the account that actually ended the work. An unknown scope
3454
+ * degrades to root-only diagnostics instead of throwing: this runs on
3455
+ * the error path.
3456
+ */
3457
+ exhaustionDiagnostics(scope: string): BudgetExhaustionDiagnostics;
3362
3458
  accountView(scope: string): BudgetAccountView | undefined;
3363
3459
  /**
3364
3460
  * The admission remainder of one account: ceiling minus spend minus
@@ -3381,9 +3477,15 @@ declare class RunBudget {
3381
3477
  /** Spawn headroom under the engine lifetime cap (embedded in admission verdicts). */
3382
3478
  get spawnHeadroom(): number;
3383
3479
  /**
3384
- * Layer 1: admission before spawn. Blocks when spent + committedReserve
3385
- * has reached the ceiling on ANY account in the ancestor chain of
3386
- * `accountScope`, otherwise commits the reserve along the whole chain.
3480
+ * Layer 1: PROJECTED admission before spawn. A spawn is admitted only
3481
+ * when every account in the ancestor chain of `accountScope` still has
3482
+ * admission headroom AND fits the PROPOSED reserve on top of spent +
3483
+ * committedReserve + finalizeReserve (the finalize reserve is
3484
+ * untouchable by admission, DEF-7). An exact fill is allowed; one
3485
+ * dollar past the ceiling is not: a spawn is never admitted on the
3486
+ * argument that the money it needs is merely not committed yet. The
3487
+ * whole chain is checked before anything commits, so a rejection
3488
+ * mutates no account, increments no counter, and journals nothing.
3387
3489
  * Also enforces the engine lifetime spawn cap.
3388
3490
  */
3389
3491
  admitSpawn(reserveUsd: number, accountScope?: string): void;
@@ -3416,6 +3518,17 @@ declare class RunBudget {
3416
3518
  /** Layer 2: the per-turn guard. A turn that would cross any ceiling in the chain is not dispatched. */
3417
3519
  beforeTurn(accountScope?: string): void;
3418
3520
  /**
3521
+ * Layer 2b, the pre-dispatch output bound: the output tokens the
3522
+ * remaining chain budget (min over capped ancestors of ceiling minus
3523
+ * spend) still affords from `servedBy` for an estimated prompt, priced
3524
+ * by the same function as settlement, long-context tiers included.
3525
+ * Undefined when no account in the chain carries a USD ceiling, when
3526
+ * the model has no price row (the once-per-model unpriced warning in
3527
+ * onUsage covers that hole), or when output is free. Zero or negative
3528
+ * means the turn cannot be dispatched within the budget.
3529
+ */
3530
+ maxAffordableOutputTokens(servedBy: ModelRef, estimatedInputTokens: number, accountScope?: string): number | undefined;
3531
+ /**
3419
3532
  * Live accounting; spend propagates from `accountScope` to every
3420
3533
  * ancestor. Crossing a ceiling severs the crossing account's subtree
3421
3534
  * via its layer-3 AbortSignal (overshoot bounded by one turn per
@@ -4092,9 +4205,14 @@ type WorkflowEvent = {
4092
4205
  /** Folds the per-run attribution buckets into the normative CostReport. */
4093
4206
  declare function buildCostReport(attribution: CostAttribution, totalUsd: number): CostReport;
4094
4207
  /**
4095
- * The pure journal fold: byModel and totals from terminal entries, the
4096
- * same summation the kernel ledger uses (terminal usage exactly once,
4097
- * priced per servedBy, abandoned subtrees contribute zero).
4208
+ * The pure journal fold: the complete CostReport from terminal entries,
4209
+ * the same summation the kernel ledger uses (terminal usage exactly
4210
+ * once, priced per servedBy slice, abandoned subtrees contribute zero).
4211
+ * The orchestrator block folds too: spend attributed to the
4212
+ * orchestrator sub-account, the reserve-funded share of it, the armed
4213
+ * wake count, and the at-cap freeze flag from the journaled cap
4214
+ * decision, so a replay-only resume reproduces the block instead of
4215
+ * reading this process's live accounts (which a replay never charges).
4098
4216
  */
4099
4217
  declare function costReportFromJournal(entries: readonly JournalEntry[], priceUsd: (servedBy: ModelRef, usage: Usage) => number | undefined): CostReport;
4100
4218
  //#endregion
@@ -4117,7 +4235,15 @@ interface CostReport {
4117
4235
  byPhase: Record<string, number>;
4118
4236
  byAgentType: Record<string, number>;
4119
4237
  byRole: Record<InvocationRole, number>;
4120
- /** All-zero with forcedFinish false in runs without a dynamic orchestrator. */
4238
+ /**
4239
+ * All-zero with forcedFinish false in runs without a dynamic
4240
+ * orchestrator (or when no cap resolved, so no sub-account opened).
4241
+ * Folded purely from the journal: spentUsd is the priced usage of
4242
+ * entries debited to the orchestrator sub-account, reserveUsedUsd its
4243
+ * reserve-funded forced-finish share, wakes the ARMED (journaled)
4244
+ * wake suspensions (a wait satisfied synchronously never suspends and
4245
+ * is not counted), and forcedFinish the journaled at-cap decision.
4246
+ */
4121
4247
  orchestrator: {
4122
4248
  spentUsd: number; /** spentUsd / max(totalUsd, 0.01): the epsilon-floored H-OrchShare input. */
4123
4249
  share: number;
@@ -4180,11 +4306,13 @@ type OnEscalation = (result: EscalatedResult<unknown>) => EscalationDecision | P
4180
4306
  /**
4181
4307
  * The mode (a) runner for human-authored closures. Determinism is enforced
4182
4308
  * by convention, lint, and the ctx shims, NOT by a VM: only the sequence
4183
- * of keys must be stable. Dev mode (NODE_ENV !== 'production') patches
4184
- * Date.now and Math.random for the duration of execute to emit one warning
4185
- * per run pointing at ctx.now()/ctx.random(); the patch preserves behavior
4186
- * and restores the prior functions on exit (nesting-safe by capturing the
4187
- * prior value; concurrent runs may lose the warning, never correctness).
4309
+ * of keys must be stable. Dev mode (NODE_ENV !== 'production') detects
4310
+ * bare Date.now and Math.random and emits one warning per run pointing at
4311
+ * ctx.now()/ctx.random(). Detection is attributed by AsyncLocalStorage:
4312
+ * only code inside the workflow body's async context can trigger it, so
4313
+ * host code running concurrently, engine internals outside the body, and
4314
+ * other runs never produce a false warning, and nothing is ever restored,
4315
+ * so concurrent executes cannot race the patch state.
4188
4316
  */
4189
4317
  declare class InProcessRunner implements ScriptRunner {
4190
4318
  private readonly onEscalation?;
@@ -4209,13 +4337,29 @@ interface PriceTable {
4209
4337
  */
4210
4338
  declare function resolvePricing(ref: ModelRef, table: PriceTable | undefined, capsPricing: Pricing | undefined): Pricing | undefined;
4211
4339
  /**
4212
- * Dollars from normalized usage against one pricing row (the adapter
4213
- * normalized the usage; inputTokens is the
4214
- * full prompt). Cache writes price at the 5m premium rate; the 1h rate
4215
- * applies where a provider distinguishes it in usage, which the
4340
+ * Dollars from normalized usage against one pricing row. Under the Usage
4341
+ * invariant inputTokens is the FULL prompt including cache reads and
4342
+ * writes, so the input rate bills only the uncached remainder and cache
4343
+ * tokens bill at their own rates, never twice; a row that omits a cache
4344
+ * rate bills those tokens at the plain input rate rather than silently
4345
+ * for free. A row may carry long-context tiers: the highest threshold
4346
+ * strictly below the full prompt re-prices the ENTIRE request
4347
+ * (input-side rates scale by inputMultiplier, the output rate by
4348
+ * outputMultiplier). Cache writes price at the 5m premium rate; the 1h
4349
+ * rate applies where a provider distinguishes it in usage, which the
4216
4350
  * canonical Usage does not yet carry.
4217
4351
  */
4218
4352
  declare function priceUsdOf(pricing: Pricing, usage: Usage): number;
4353
+ /**
4354
+ * The output tokens `remainingUsd` still buys from one pricing row after
4355
+ * paying for an estimated prompt of `estimatedInputTokens`, priced with
4356
+ * the same tier rules as settlement (the tier is selected by the
4357
+ * estimated prompt). Floored to whole tokens; zero or negative means not
4358
+ * even one output token fits, so the turn must not be dispatched.
4359
+ * Undefined when the row prices output at zero (a free model needs no
4360
+ * output bound).
4361
+ */
4362
+ declare function affordableOutputTokens(pricing: Pricing, remainingUsd: number, estimatedInputTokens: number): number | undefined;
4219
4363
  //#endregion
4220
4364
  //#region src/engine/engine.d.ts
4221
4365
  /**
@@ -4331,7 +4475,14 @@ interface CreateEngineOptions {
4331
4475
  interface RunOptions {
4332
4476
  /** Explicit id; otherwise the engine mints a ULID. */
4333
4477
  runId?: string;
4334
- /** Run ceiling B0; immutable after start. */
4478
+ /**
4479
+ * Run ceiling B0; immutable after start. Enforced by projected
4480
+ * admission (a spawn whose reserve does not fit is denied before any
4481
+ * dispatch), the per-turn guard with a budget-derived maxOutputTokens
4482
+ * clamp, and live stream cuts on crossing; the residual
4483
+ * provider-dependent overshoot is bounded by one in-flight turn per
4484
+ * concurrent agent. Contract: https://docs.rulvar.com/guide/budgets.
4485
+ */
4335
4486
  budgetUsd?: number;
4336
4487
  /** Run-level defaults merged over engine defaults. */
4337
4488
  limits?: UsageLimits;
@@ -4773,6 +4924,13 @@ interface OrchestratorExtension {
4773
4924
  * machinery (reserves, freeze) completes in M7 (DEF-7).
4774
4925
  */
4775
4926
  interface OrchestratorBudgetSpec {
4927
+ /**
4928
+ * Absolute bound in USD. It never REPLACES the fraction bound:
4929
+ * effectiveCap = min(capUsd, (capFraction ?? 0.2) * ceiling), so an
4930
+ * explicit capUsd larger than the default fraction of the run ceiling
4931
+ * is still cut to that fraction (and a warn log says so). Pass
4932
+ * capFraction: 1.0 to make capUsd the sole bound.
4933
+ */
4776
4934
  capUsd?: number;
4777
4935
  /** default 0.2; effectiveCap = min of the given bounds */
4778
4936
  capFraction?: number;
@@ -5306,6 +5464,8 @@ interface RunInternals {
5306
5464
  dropped: DroppedItem[];
5307
5465
  cost: CostAttribution;
5308
5466
  priceUsd: (servedBy: ModelRef, usage: Usage) => number | undefined;
5467
+ /** Raw price-row resolution (table wins, caps fallback); undefined = unpriced. */
5468
+ pricingOf?: (servedBy: ModelRef) => Pricing | undefined;
5309
5469
  runSignal?: AbortSignal;
5310
5470
  /** The worktree lifecycle provider. */
5311
5471
  isolation?: IsolationProvider;
@@ -6100,4 +6260,4 @@ interface SandboxBridge {
6100
6260
  }
6101
6261
  declare function createSandboxBridge(ctx: Ctx<never>, options: SandboxBridgeOptions): SandboxBridge;
6102
6262
  //#endregion
6103
- export { AWAIT_SCHEMA, AbandonAttempt, AbandonFold, AbandonPayload, AbandonedSpendView, AbortClass, type AdaptiveEvents, AdmissionController, AdmissionDecision, AdmissionRejectedError, AdmissionStatsBefore, AdmitLineage, AdmitRejectReason, AdmitSpec, AdmitVerdict, AgentCallError, AgentError, type AgentEvents, AgentIdentityInput, AgentOpts, AgentProfile, AgentProfilePermissions, AgentResult, AgentResultMeta, AgentStatus, ApproachSignatureInputs, ApprovalDecision, ApprovalIdentityInput, Artifact, AttemptOutcomeClass, BUDGET_ABORT_REASON, BriefOpts, BudgetAccountView, BudgetDefaults, BudgetExhaustedError, 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, ChildIdentityInput, type ClaimClass, type ClaimOp, type ClaimStatus, ClaimValidationOptions, CollectOpts, CollectedTurn, CompactionConfig, CompiledPermissionChain, CompiledWorkflow, ConfigError, type CoreEvents, CostAttribution, CostReport, CreateEngineOptions, Ctx, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, 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, DebitResult, DeclaredLadder, DedupIndex, DedupNote, DerivedKey, DeriverRegistry, DispositionRule, DispositionTable, DonorCandidate, DonorRef, DroppedItem, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EffectiveUsageLimits, Effort, Engine, EngineDefaults, EntryKind, EntryRef, EntryStatus, ErrorClass, ErrorCode, ErrorPolicy, EscalatedResult, EscalationDecision, EscalationDigest, EscalationKind, EscalationLimits, EscalationOptions, EscalationReport, EscalationRequest, EventBus, type EvidenceRef, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINISH_SCHEMA, FINISH_TOOL_NAME, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, FinishInfo, Gate, GateAudit, type GateRecord, GitWorktreeProvider, GitWorktreeProviderOptions, GraftBoot, HashVersion, HookVerdict, INBOX_PROPOSAL_TTL_DAYS, IdentityInput, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, InvalidResolutionError, InvocationRole, type IsolationProvider, type IsolationSpec, Issue$1 as Issue, JournalCompatSubCode, JournalCompatibilityError, JournalEntry, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, 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_DEPTH_CEILING, MatchResult, McpConfig, MechanicalGateProfile, MechanicalGateVerdict, type ModelCaps, ModelChoice, type ModelClaim, ModelEpochInputs, type ModelKnowledgeHandle, type ModelKnowledgeStore, ModelListConstraint, ModelRef, ModelRetry, ModelSpec, Msg, NoProgressDetector, NodeId, NodeLinkValue, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OnEscalation, OperationDisposition, OrchestrateOptions, OrchestratorBudgetSpec, OrchestratorCapConfigError, OrchestratorExtension, OrchestratorExtensionIO, OrchestratorRuntime, Out, PARALLEL_AGENTS_SCHEMA, ParallelSiteCounter, Part, PendingExternal, PendingToolTurn, PermissionConfig, PermissionGate, PermissionHook, PermissionPreset, PermissionRule, PermissionVerdict, PhaseTarget, PipelineCollected, PipelineOpts, PlanInvariantError, PriceTable, PricedUsage, type Pricing, type ProviderAdapter, QualityFloors, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_PROFILES, RandIdentityInput, RandPayload, RefEntryAppender, RefEntryClassification, RefusalInfo, ReplayDisposition, ReplayMode, ReplayPlanHashMismatch, Replayer, ResolutionArbiter, ResolutionAttempt, ResolutionBy, ResolutionFold, ResolutionLayer, ResolutionOutcome, ResolutionPayload, ResolvedInvocation, ResolvedToolset, ResumeHandle, ResumeOptions, ResumePreview, ResumeReport, RetryClass, RetryPolicy, ReuseConfig, RiskRuleValue, Role, RulvarError, RulvarErrorCode, RunAgentOptions, RunBudget, RunEventSink, type RunFilter, RunHandle, RunInternals, type RunMeta, RunOptions, RunOutcome, RunProfile, RunStatus, RuntimeEventSink, SPAWN_AGENT_SCHEMA, SandboxBridge, SandboxBridgeOptions, SandboxError, SandboxHostToWorker, SandboxMethod, SandboxWorkerToHost, SchemaPair, SchemaSpec, SchemaValidationResult, ScopeSegment, ScriptRejected, ScriptRunner, ScrubNote, Semaphore, SerializationHook, Settled, 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, ToolCallRequest, ToolChoice, type ToolContext, ToolContextSeed, ToolContract, type ToolDef, type ToolEvents, type ToolExecutor, 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, agentErrorFromWire, agentErrorToWire, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, atCompactionThreshold, 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, compileVerifiedLayer, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, foldTermination, formatRePrompt, formatScopePath, hashWorkflowBody, hashWorkflowSource, identityJcs, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lexShellCommand, liftRetainedParts, lineageWeightOf, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, mergeUsageLimits, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, parallelScope, parseModelRef, parseScopePath, phiInitialOf, pipelineScope, planNodeScope, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, readTerminationInit, registryKeyRing, remeasureQueue, replayDisposition, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, scanJournalCompatibility, schemaHash, schemaHashOfSpec, selectStructuredOutputTier, shouldCompact, spawnDepthOf, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, validateEditorialCommit, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateSchemaSpec, validateTerminationLimits, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
6263
+ export { AWAIT_SCHEMA, AbandonAttempt, AbandonFold, AbandonPayload, AbandonedSpendView, AbortClass, type AdaptiveEvents, AdmissionController, AdmissionDecision, AdmissionRejectedError, AdmissionStatsBefore, AdmitLineage, AdmitRejectReason, AdmitSpec, AdmitVerdict, AgentCallError, AgentError, type AgentEvents, AgentIdentityInput, AgentOpts, AgentProfile, AgentProfilePermissions, AgentResult, AgentResultMeta, AgentStatus, ApproachSignatureInputs, ApprovalDecision, ApprovalIdentityInput, Artifact, AttemptOutcomeClass, BUDGET_ABORT_REASON, 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, ChildIdentityInput, type ClaimClass, type ClaimOp, type ClaimStatus, ClaimValidationOptions, CollectOpts, CollectedTurn, CompactionConfig, CompiledPermissionChain, CompiledWorkflow, ConfigError, type CoreEvents, CostAttribution, CostAttributionFacts, CostReport, CreateEngineOptions, Ctx, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, 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, DebitResult, DeclaredLadder, DedupIndex, DedupNote, DerivedKey, DeriverRegistry, DispositionRule, DispositionTable, DonorCandidate, DonorRef, DroppedItem, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EffectiveUsageLimits, Effort, Engine, EngineDefaults, EntryKind, EntryRef, EntryStatus, ErrorClass, ErrorCode, ErrorPolicy, EscalatedResult, EscalationDecision, EscalationDigest, EscalationKind, EscalationLimits, EscalationOptions, EscalationReport, EscalationRequest, EventBus, type EvidenceRef, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINISH_SCHEMA, FINISH_TOOL_NAME, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, FinishInfo, Gate, GateAudit, type GateRecord, GitWorktreeProvider, GitWorktreeProviderOptions, GraftBoot, HashVersion, HookVerdict, INBOX_PROPOSAL_TTL_DAYS, IdentityInput, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, InvalidResolutionError, InvocationRole, type IsolationProvider, type IsolationSpec, Issue$1 as Issue, JournalCompatSubCode, JournalCompatibilityError, JournalEntry, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, 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_DEPTH_CEILING, MatchResult, McpConfig, MechanicalGateProfile, MechanicalGateVerdict, type ModelCaps, ModelChoice, type ModelClaim, ModelEpochInputs, type ModelKnowledgeHandle, type ModelKnowledgeStore, ModelListConstraint, ModelRef, ModelRetry, ModelSpec, Msg, NoProgressDetector, NodeId, NodeLinkValue, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OnEscalation, OperationDisposition, OrchestrateOptions, OrchestratorBudgetSpec, OrchestratorCapConfigError, OrchestratorExtension, OrchestratorExtensionIO, OrchestratorRuntime, Out, PARALLEL_AGENTS_SCHEMA, ParallelSiteCounter, Part, PendingExternal, PendingToolTurn, PermissionConfig, PermissionGate, PermissionHook, PermissionPreset, PermissionRule, PermissionVerdict, PhaseTarget, PipelineCollected, PipelineOpts, PlanInvariantError, PriceTable, PricedUsage, type Pricing, type PricingTier, type ProviderAdapter, QualityFloors, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_PROFILES, RandIdentityInput, RandPayload, RefEntryAppender, RefEntryClassification, RefusalInfo, ReplayDisposition, ReplayMode, ReplayPlanHashMismatch, Replayer, ResolutionArbiter, ResolutionAttempt, ResolutionBy, ResolutionFold, ResolutionLayer, ResolutionOutcome, ResolutionPayload, ResolvedInvocation, ResolvedToolset, ResumeHandle, ResumeOptions, ResumePreview, ResumeReport, RetryClass, RetryPolicy, ReuseConfig, RiskRuleValue, Role, RulvarError, RulvarErrorCode, RunAgentOptions, RunBudget, RunEventSink, type RunFilter, RunHandle, RunInternals, type RunMeta, RunOptions, RunOutcome, RunProfile, RunStatus, RuntimeEventSink, SPAWN_AGENT_SCHEMA, SandboxBridge, SandboxBridgeOptions, SandboxError, SandboxHostToWorker, SandboxMethod, SandboxWorkerToHost, SchemaPair, SchemaSpec, SchemaValidationResult, ScopeSegment, ScriptRejected, ScriptRunner, ScrubNote, Semaphore, SerializationHook, Settled, 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, ToolCallRequest, ToolChoice, type ToolContext, ToolContextSeed, ToolContract, type ToolDef, type ToolEvents, type ToolExecutor, 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, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, atCompactionThreshold, 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, compileVerifiedLayer, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, foldTermination, formatRePrompt, formatScopePath, hashWorkflowBody, hashWorkflowSource, identityJcs, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lexShellCommand, liftRetainedParts, lineageWeightOf, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, mergeUsageLimits, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, parallelScope, parseModelRef, parseScopePath, phiInitialOf, pipelineScope, planNodeScope, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, readTerminationInit, registryKeyRing, remeasureQueue, replayDisposition, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, scanJournalCompatibility, schemaHash, schemaHashOfSpec, selectStructuredOutputTier, shouldCompact, spawnDepthOf, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, validateEditorialCommit, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateSchemaSpec, validateTerminationLimits, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };