@rulvar/core 1.54.0 → 1.55.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 CHANGED
@@ -3033,6 +3033,10 @@ interface ExplorationSummary {
3033
3033
  deniedRepeats: number;
3034
3034
  /** Executions per tool name. */
3035
3035
  byTool: Record<string, number>;
3036
+ /** Calls denied by maxCallsPerTool; present when that limit is configured. */
3037
+ deniedToolCap?: number;
3038
+ /** Weighted tool units spent; present when toolUnits is configured. */
3039
+ toolUnitsUsed?: number;
3036
3040
  }
3037
3041
  /**
3038
3042
  * Agent lifecycle. One logical agent dispatch emits EXACTLY ONE
@@ -3407,6 +3411,45 @@ declare class NoProgressDetector {
3407
3411
  describe(): string;
3408
3412
  }
3409
3413
  //#endregion
3414
+ //#region src/tools/progress.d.ts
3415
+ /** The stock progress tool name the engine scans terminals for. */
3416
+ declare const PROGRESS_REPORT_TOOL_NAME = "report_progress";
3417
+ /**
3418
+ * One progress report: what the agent has established so far. Captured
3419
+ * as {@link AgentResult.partial} (normalized: absent arrays become
3420
+ * empty) when the invocation terminates with status 'limit'.
3421
+ */
3422
+ interface ProgressReport {
3423
+ /** New facts established, each a standalone claim line. */
3424
+ facts: string[];
3425
+ /** Evidence references backing the facts (file:line or recorded ids). */
3426
+ evidence: string[];
3427
+ /** Remaining unresolved questions. */
3428
+ questions: string[];
3429
+ /** Optional short status note. */
3430
+ note?: string;
3431
+ }
3432
+ /**
3433
+ * The stock progress-report tool. Stateless and deterministic: the
3434
+ * result echoes the counts, so a verbatim repeated report is a
3435
+ * duplicate result digest to the exploration guards. The value is the
3436
+ * side contract: the engine captures the LAST successful call of this
3437
+ * tool as the structured terminal partial of a 'limit' invocation, so
3438
+ * an agent that reports after every batch never loses its collected
3439
+ * work to a budget expiry.
3440
+ */
3441
+ declare function progressReportTool(): ToolDef;
3442
+ /**
3443
+ * The deterministic terminal scan: pairs `report_progress` tool calls
3444
+ * with their SUCCESSFUL results by id (a denied or failed call never
3445
+ * counts, mirroring the exploration guard's restore) and normalizes the
3446
+ * last one into a {@link ProgressReport}. Pure over the message window
3447
+ * it is given: the live loop hands its own history, the replay path
3448
+ * hands the terminal checkpoint's messages, and a compaction naturally
3449
+ * narrows the window to what the model itself still sees.
3450
+ */
3451
+ declare function latestProgressReport(messages: readonly Msg[]): ProgressReport | undefined;
3452
+ //#endregion
3410
3453
  //#region src/runtime/usage-limits.d.ts
3411
3454
  interface UsageLimits {
3412
3455
  /** Default 32. */
@@ -3449,6 +3492,29 @@ interface UsageLimits {
3449
3492
  * default.
3450
3493
  */
3451
3494
  maxNoNewEvidenceCalls?: number;
3495
+ /**
3496
+ * Per-tool execution caps by tool NAME (RV-210 close-out): the call
3497
+ * that would exceed its tool's cap is denied with a typed error tool
3498
+ * result instead of dispatched (visible to the model, never terminal),
3499
+ * and the denial does not consume maxToolCalls or tool units. A cap of
3500
+ * 0 bans the tool for the invocation; names absent from the record are
3501
+ * unlimited. Per layer the whole record replaces (no per-key merge),
3502
+ * like every other UsageLimits field.
3503
+ */
3504
+ maxCallsPerTool?: Record<string, number>;
3505
+ /**
3506
+ * The weighted tool budget (RV-210 close-out): every EXECUTED call of
3507
+ * tool T costs `costs[T] ?? 1` units (a cost of 0 makes bookkeeping
3508
+ * tools free), and once the spent units reach `max` the invocation
3509
+ * terminates as status 'limit' exactly like maxToolCalls (paid partial
3510
+ * work; executed results stand). Denied calls cost nothing. On resume
3511
+ * the spent units rebuild from the restored transcript's successful
3512
+ * executions, the same conservative window the exploration guards use.
3513
+ */
3514
+ toolUnits?: {
3515
+ max: number;
3516
+ costs?: Record<string, number>;
3517
+ };
3452
3518
  }
3453
3519
  declare const DEFAULT_MAX_TURNS = 32;
3454
3520
  declare const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 12e4;
@@ -3464,6 +3530,11 @@ interface EffectiveUsageLimits {
3464
3530
  toolBudgetNotices?: boolean;
3465
3531
  maxRepeatedToolSignature?: number;
3466
3532
  maxNoNewEvidenceCalls?: number;
3533
+ maxCallsPerTool?: Record<string, number>;
3534
+ toolUnits?: {
3535
+ max: number;
3536
+ costs?: Record<string, number>;
3537
+ };
3467
3538
  }
3468
3539
  /**
3469
3540
  * Limits merge per spawn: AgentOpts.limits over profile limits over engine
@@ -3574,6 +3645,18 @@ interface AgentResult<T> {
3574
3645
  * transportRetries.
3575
3646
  */
3576
3647
  exploration?: ExplorationSummary;
3648
+ /**
3649
+ * The structured terminal partial (RV-210 close-out): the LAST
3650
+ * successful `report_progress` call of the invocation, present only on
3651
+ * a 'limit' terminal (cap expiry or an engine-decided abort) whose
3652
+ * transcript recorded at least one report. Derived deterministically
3653
+ * from the message window: live from the loop's own history (a final
3654
+ * boundary checkpoint is written so the window is durable), on replay
3655
+ * from the terminal checkpoint, so both read the same bytes. This is
3656
+ * what lets a caller salvage a limit child's collected work instead of
3657
+ * seeing a bare 'terminal status limit'.
3658
+ */
3659
+ partial?: ProgressReport;
3577
3660
  }
3578
3661
  type EscalatedResult<T> = AgentResult<T> & {
3579
3662
  status: "escalated";
@@ -5519,8 +5602,10 @@ interface TaskDigest {
5519
5602
  * when the output IS a string, else its JCS-independent `JSON.stringify`)
5520
5603
  * for a settled ok child, or the child's `errorMessage` otherwise, so the
5521
5604
  * orchestrator can read WHY a child failed as readily as what it
5522
- * produced. Everything here is a pure read of already durable journal
5523
- * state, so a resume reproduces it with no new spend.
5605
+ * produced; a limit child carrying a structured terminal partial serves
5606
+ * `{ error, partial }` instead (RV-210 close-out), so the collected work
5607
+ * is pageable in full. Everything here is a pure read of already durable
5608
+ * journal state, so a resume reproduces it with no new spend.
5524
5609
  */
5525
5610
  interface ChildResultPage {
5526
5611
  handle: number;
@@ -5998,6 +6083,21 @@ interface OrchestrateAcceptance {
5998
6083
  childPolicy: "all-ok" | {
5999
6084
  minSuccessful: number;
6000
6085
  };
6086
+ /**
6087
+ * The partial-child salvage switch (RV-210 close-out; default false).
6088
+ * When true, a child that settled 'limit' WITH a structured terminal
6089
+ * partial (it recorded progress through the stock `report_progress`
6090
+ * tool before the budget expired) counts as a successful child for the
6091
+ * policy: under 'all-ok' it no longer rejects the run, and under
6092
+ * { minSuccessful: N } it counts toward N. The acceptance verdict then
6093
+ * reports completion 'partial' (never 'complete'), lists the salvaged
6094
+ * children in `salvagedPartialChildren` on the result envelope, and
6095
+ * keeps a per-child note in degradedReasons. A limit child WITHOUT a
6096
+ * partial gave the caller nothing to salvage and still counts against
6097
+ * the policy. The whole fold is journaled in the single acceptance
6098
+ * decision, so a resume rolls the same verdict forward.
6099
+ */
6100
+ acceptPartialChildren?: boolean;
6001
6101
  }
6002
6102
  /** How many rejected finishes are repaired by default: the plan's repair once. */
6003
6103
  declare const DEFAULT_FINISH_MAX_REPAIRS = 1;
@@ -7158,6 +7258,73 @@ interface RepositoryResearchToolset {
7158
7258
  }
7159
7259
  declare function repositoryResearchToolset(options: RepositoryResearchToolsetOptions): RepositoryResearchToolset;
7160
7260
  //#endregion
7261
+ //#region src/engine/profile-templates.d.ts
7262
+ /**
7263
+ * The research template's stop conditions: a weighted unit budget over
7264
+ * the research tools (bookkeeping tools are free), per-tool caps, both
7265
+ * repetition guards, and soft budget notices. Exported so hosts and
7266
+ * tests can read the exact defaults they are overriding.
7267
+ */
7268
+ declare const RESEARCH_PROFILE_LIMITS: UsageLimits;
7269
+ /** The implementation template's stop conditions. */
7270
+ declare const IMPLEMENTATION_PROFILE_LIMITS: UsageLimits;
7271
+ /** The review template's stop conditions. */
7272
+ declare const REVIEW_PROFILE_LIMITS: UsageLimits;
7273
+ /** Options shared by the implementation and review templates. */
7274
+ interface AgentProfileTemplateOptions {
7275
+ /** Advertised profile description; the template provides a default. */
7276
+ description?: string;
7277
+ /** Per-key overrides over the template's limits. */
7278
+ limits?: UsageLimits;
7279
+ /** The task tools; the stock report_progress tool is always prepended. */
7280
+ tools?: ToolDef[];
7281
+ }
7282
+ /** Options of {@link researchAgentProfile}: the toolset knobs plus template overrides. */
7283
+ interface ResearchAgentProfileOptions extends RepositoryResearchToolsetOptions {
7284
+ /** Advertised profile description; the template provides a default. */
7285
+ description?: string;
7286
+ /** Per-key overrides over {@link RESEARCH_PROFILE_LIMITS}. */
7287
+ limits?: UsageLimits;
7288
+ /** Extra tools appended after the research toolset. */
7289
+ extraTools?: ToolDef[];
7290
+ }
7291
+ /** What {@link researchAgentProfile} returns: the profile plus the evidence accessor. */
7292
+ interface ResearchAgentProfileResult {
7293
+ profile: AgentProfile;
7294
+ /**
7295
+ * The research kit's host-side evidence snapshot. One kit instance
7296
+ * backs the profile, so children spawned from the SAME registered
7297
+ * profile pool their verified evidence here (and see each other's
7298
+ * entries through list_evidence); construct one template per fan-out
7299
+ * run, or per child, when isolation matters.
7300
+ */
7301
+ evidence: () => ResearchEvidenceEntry[];
7302
+ }
7303
+ /**
7304
+ * The batteries-included research child: the confined
7305
+ * {@link repositoryResearchToolset} over `root`, the stock
7306
+ * report_progress tool, and {@link RESEARCH_PROFILE_LIMITS} as the stop
7307
+ * conditions. A child spawned from this profile that runs out of budget
7308
+ * settles 'limit' WITH its last progress report as the structured
7309
+ * partial, and the recorded evidence stays readable host-side through
7310
+ * `evidence()`.
7311
+ */
7312
+ declare function researchAgentProfile(options: ResearchAgentProfileOptions): ResearchAgentProfileResult;
7313
+ /**
7314
+ * The implementation child template: the caller's task tools plus the
7315
+ * progress contract, with {@link IMPLEMENTATION_PROFILE_LIMITS} as the
7316
+ * stop conditions (a no-progress detector instead of the research
7317
+ * no-new-evidence guard: implementation legitimately re-reads state).
7318
+ */
7319
+ declare function implementationAgentProfile(options?: AgentProfileTemplateOptions): AgentProfile;
7320
+ /**
7321
+ * The review child template: the caller's task tools plus the progress
7322
+ * contract, with {@link REVIEW_PROFILE_LIMITS} as the stop conditions
7323
+ * (a tighter turn budget and the no-new-evidence guard: a reviewer
7324
+ * circling over the same pages should stop, not spin).
7325
+ */
7326
+ declare function reviewAgentProfile(options?: AgentProfileTemplateOptions): AgentProfile;
7327
+ //#endregion
7161
7328
  //#region src/journal/scope.d.ts
7162
7329
  /**
7163
7330
  * Scope-path grammar (M1-T04): deterministic structural paths, independent
@@ -7924,4 +8091,4 @@ interface SandboxBridge {
7924
8091
  declare const SANDBOX_AGENT_OPT_KEYS: readonly string[];
7925
8092
  declare function createSandboxBridge(ctx: Ctx<never>, options: SandboxBridgeOptions): SandboxBridge;
7926
8093
  //#endregion
7927
- 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, AgentResult, AgentResultMeta, AgentStatus, ApproachSignatureInputs, ApprovalDecision, ApprovalIdentityInput, Artifact, AttemptOutcomeClass, 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_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_MIN_SHARE, 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, 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, EntryKind, EntryRef, EntryStatus, ErrorClass, ErrorCode, ErrorPolicy, EscalatedResult, EscalationDecision, EscalationDecisionAbortedError, EscalationDigest, EscalationKind, EscalationLimits, EscalationOptions, EscalationReport, EscalationRequest, EventBus, type EvidenceRef, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_TOOL_NAME, FailRunError, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, FinishInfo, FinishValidationChild, FinishValidationInput, FinishValidationSpec, FinishValidationVerdict, FinishValidator, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, Gate, GateAudit, type GateRecord, GitWorktreeProvider, GitWorktreeProviderOptions, GraftBoot, HashVersion, HookVerdict, INBOX_PROPOSAL_TTL_DAYS, IdentityInput, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, IncrementalSynthesisResult, InvalidResolutionError, InvocationRole, type InvocationTable, 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_CHILD_RESULT_PAGE_CHARS, MAX_DEPTH_CEILING, MatchResult, McpConfig, McpToolSource, MechanicalGateProfile, MechanicalGateVerdict, 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, OrchestratorBudgetSpec, OrchestratorCapConfigError, OrchestratorExtension, OrchestratorExtensionIO, OrchestratorRuntime, Out, PARALLEL_AGENTS_SCHEMA, ParallelSiteCounter, Part, PendingExternal, PendingToolTurn, PermissionConfig, PermissionGate, PermissionHook, PermissionPreset, PermissionRule, PermissionVerdict, type PhaseRow, PhaseTarget, PipelineCollected, PipelineOpts, PlanInvariantError, PriceTable, PricedUsage, type Pricing, type PricingTier, type ProviderAdapter, QualityFloors, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_PROFILES, RUN_SETTLE_DECISION_TYPE, RandIdentityInput, RandPayload, ReconcileOptions, ReconcileResult, RefEntryAppender, RefEntryClassification, RefusalInfo, RepeatedClaim, ReplayDisposition, ReplayMode, ReplayPlanHashMismatch, Replayer, RepositoryResearchToolset, RepositoryResearchToolsetOptions, 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, 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, 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, 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, compileVerifiedLayer, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidencePreservedValidator, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, foldTermination, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, identityJcs, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, lexShellCommand, liftRetainedParts, lineageWeightOf, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, 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, readRunMeta, readTerminationInit, reconcileRunMeta, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, selectStructuredOutputTier, shouldCompact, snapshotUsage, spawnDepthOf, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, usageViolations, validateEditorialCommit, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateUsageLimits, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
8094
+ 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, 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_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_MIN_SHARE, 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, 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, EntryKind, EntryRef, EntryStatus, ErrorClass, ErrorCode, ErrorPolicy, EscalatedResult, EscalationDecision, EscalationDecisionAbortedError, EscalationDigest, EscalationKind, EscalationLimits, EscalationOptions, EscalationReport, EscalationRequest, EventBus, type EvidenceRef, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_TOOL_NAME, FailRunError, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, FinishInfo, 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, 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_CHILD_RESULT_PAGE_CHARS, MAX_DEPTH_CEILING, MatchResult, McpConfig, McpToolSource, MechanicalGateProfile, MechanicalGateVerdict, 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, 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, PriceTable, PricedUsage, type Pricing, type PricingTier, ProgressReport, type ProviderAdapter, QualityFloors, 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, 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, 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, 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, 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, compileVerifiedLayer, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidencePreservedValidator, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, foldTermination, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, identityJcs, implementationAgentProfile, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, parallelScope, parseModelRef, parseScopePath, phiInitialOf, pipelineScope, planNodeScope, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, readRunMeta, readTerminationInit, reconcileRunMeta, 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, selectStructuredOutputTier, shouldCompact, snapshotUsage, spawnDepthOf, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, usageViolations, validateEditorialCommit, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateUsageLimits, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
package/dist/index.js CHANGED
@@ -3750,6 +3750,197 @@ function repositoryResearchToolset(options) {
3750
3750
  };
3751
3751
  }
3752
3752
  //#endregion
3753
+ //#region src/tools/progress.ts
3754
+ /** The stock progress tool name the engine scans terminals for. */
3755
+ const PROGRESS_REPORT_TOOL_NAME = "report_progress";
3756
+ const PROGRESS_SCHEMA = {
3757
+ type: "object",
3758
+ additionalProperties: false,
3759
+ required: ["facts"],
3760
+ properties: {
3761
+ facts: {
3762
+ type: "array",
3763
+ items: { type: "string" },
3764
+ description: "New facts established since the last report; may be empty early on."
3765
+ },
3766
+ evidence: {
3767
+ type: "array",
3768
+ items: { type: "string" },
3769
+ description: "Evidence references backing the facts (file:line or recorded evidence ids)."
3770
+ },
3771
+ questions: {
3772
+ type: "array",
3773
+ items: { type: "string" },
3774
+ description: "Remaining unresolved questions."
3775
+ },
3776
+ note: {
3777
+ type: "string",
3778
+ description: "Optional short status note."
3779
+ }
3780
+ }
3781
+ };
3782
+ /**
3783
+ * The stock progress-report tool. Stateless and deterministic: the
3784
+ * result echoes the counts, so a verbatim repeated report is a
3785
+ * duplicate result digest to the exploration guards. The value is the
3786
+ * side contract: the engine captures the LAST successful call of this
3787
+ * tool as the structured terminal partial of a 'limit' invocation, so
3788
+ * an agent that reports after every batch never loses its collected
3789
+ * work to a budget expiry.
3790
+ */
3791
+ function progressReportTool() {
3792
+ return tool({
3793
+ name: PROGRESS_REPORT_TOOL_NAME,
3794
+ description: "Report research progress after every batch of tool calls: the new facts you established, the evidence references backing them, and the questions still open. If the invocation ends at a limit, your LAST report is returned to the caller as the structured partial result, so report before the budget runs out.",
3795
+ parameters: PROGRESS_SCHEMA,
3796
+ risk: "read",
3797
+ execute: (input) => {
3798
+ const report = input;
3799
+ return Promise.resolve({
3800
+ recorded: true,
3801
+ facts: report.facts?.length ?? 0,
3802
+ evidence: report.evidence?.length ?? 0,
3803
+ questions: report.questions?.length ?? 0
3804
+ });
3805
+ }
3806
+ });
3807
+ }
3808
+ function stringArray(value) {
3809
+ return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
3810
+ }
3811
+ /**
3812
+ * The deterministic terminal scan: pairs `report_progress` tool calls
3813
+ * with their SUCCESSFUL results by id (a denied or failed call never
3814
+ * counts, mirroring the exploration guard's restore) and normalizes the
3815
+ * last one into a {@link ProgressReport}. Pure over the message window
3816
+ * it is given: the live loop hands its own history, the replay path
3817
+ * hands the terminal checkpoint's messages, and a compaction naturally
3818
+ * narrows the window to what the model itself still sees.
3819
+ */
3820
+ function latestProgressReport(messages) {
3821
+ const callsById = /* @__PURE__ */ new Map();
3822
+ let latest;
3823
+ for (const msg of messages) for (const part of msg.parts) if (part.type === "tool-call" && part.name === "report_progress") callsById.set(part.id, part.args);
3824
+ else if (part.type === "tool-result" && part.name === "report_progress" && part.isError !== true && callsById.has(part.id)) {
3825
+ const args = callsById.get(part.id);
3826
+ if (typeof args === "object" && args !== null && !Array.isArray(args)) {
3827
+ const record = args;
3828
+ const report = {
3829
+ facts: stringArray(record.facts),
3830
+ evidence: stringArray(record.evidence),
3831
+ questions: stringArray(record.questions)
3832
+ };
3833
+ if (typeof record.note === "string") report.note = record.note;
3834
+ latest = report;
3835
+ }
3836
+ }
3837
+ return latest;
3838
+ }
3839
+ //#endregion
3840
+ //#region src/engine/profile-templates.ts
3841
+ /**
3842
+ * The research template's stop conditions: a weighted unit budget over
3843
+ * the research tools (bookkeeping tools are free), per-tool caps, both
3844
+ * repetition guards, and soft budget notices. Exported so hosts and
3845
+ * tests can read the exact defaults they are overriding.
3846
+ */
3847
+ const RESEARCH_PROFILE_LIMITS = {
3848
+ maxTurns: 24,
3849
+ maxToolCalls: 48,
3850
+ toolBudgetNotices: true,
3851
+ maxRepeatedToolSignature: 2,
3852
+ maxNoNewEvidenceCalls: 6,
3853
+ maxCallsPerTool: {
3854
+ list_files: 12,
3855
+ search_files: 20,
3856
+ read_file: 30
3857
+ },
3858
+ toolUnits: {
3859
+ max: 64,
3860
+ costs: {
3861
+ list_files: 1,
3862
+ search_files: 2,
3863
+ read_file: 2,
3864
+ record_evidence: 0,
3865
+ list_evidence: 0,
3866
+ report_progress: 0
3867
+ }
3868
+ }
3869
+ };
3870
+ /** The implementation template's stop conditions. */
3871
+ const IMPLEMENTATION_PROFILE_LIMITS = {
3872
+ maxTurns: 32,
3873
+ maxToolCalls: 64,
3874
+ toolBudgetNotices: true,
3875
+ maxRepeatedToolSignature: 3,
3876
+ noProgressTurns: 3
3877
+ };
3878
+ /** The review template's stop conditions. */
3879
+ const REVIEW_PROFILE_LIMITS = {
3880
+ maxTurns: 16,
3881
+ maxToolCalls: 32,
3882
+ toolBudgetNotices: true,
3883
+ maxRepeatedToolSignature: 2,
3884
+ maxNoNewEvidenceCalls: 8
3885
+ };
3886
+ function mergeLimits(template, overrides) {
3887
+ return {
3888
+ ...template,
3889
+ ...overrides ?? {}
3890
+ };
3891
+ }
3892
+ /**
3893
+ * The batteries-included research child: the confined
3894
+ * {@link repositoryResearchToolset} over `root`, the stock
3895
+ * report_progress tool, and {@link RESEARCH_PROFILE_LIMITS} as the stop
3896
+ * conditions. A child spawned from this profile that runs out of budget
3897
+ * settles 'limit' WITH its last progress report as the structured
3898
+ * partial, and the recorded evidence stays readable host-side through
3899
+ * `evidence()`.
3900
+ */
3901
+ function researchAgentProfile(options) {
3902
+ const { description, limits, extraTools, ...toolsetOptions } = options;
3903
+ const kit = repositoryResearchToolset(toolsetOptions);
3904
+ return {
3905
+ profile: {
3906
+ description: description ?? "Repository research over a confined root: paginated list_files/search_files/read_file with stable cursors, record_evidence verifying every citation, and report_progress after every batch. Stop conditions built in: weighted tool units, per-tool caps, repetition and no-new-evidence guards, budget notices. On limit the last progress report is the structured partial.",
3907
+ tools: [
3908
+ ...kit.tools,
3909
+ progressReportTool(),
3910
+ ...extraTools ?? []
3911
+ ],
3912
+ limits: mergeLimits(RESEARCH_PROFILE_LIMITS, limits)
3913
+ },
3914
+ evidence: () => kit.evidence()
3915
+ };
3916
+ }
3917
+ /**
3918
+ * The implementation child template: the caller's task tools plus the
3919
+ * progress contract, with {@link IMPLEMENTATION_PROFILE_LIMITS} as the
3920
+ * stop conditions (a no-progress detector instead of the research
3921
+ * no-new-evidence guard: implementation legitimately re-reads state).
3922
+ */
3923
+ function implementationAgentProfile(options = {}) {
3924
+ return {
3925
+ description: options.description ?? "Implementation work with built-in stop conditions: tool budget with notices, repeated-call guard, no-progress detector. Report progress with report_progress after every batch; on limit the last report is the structured partial.",
3926
+ tools: [progressReportTool(), ...options.tools ?? []],
3927
+ limits: mergeLimits(IMPLEMENTATION_PROFILE_LIMITS, options.limits)
3928
+ };
3929
+ }
3930
+ /**
3931
+ * The review child template: the caller's task tools plus the progress
3932
+ * contract, with {@link REVIEW_PROFILE_LIMITS} as the stop conditions
3933
+ * (a tighter turn budget and the no-new-evidence guard: a reviewer
3934
+ * circling over the same pages should stop, not spin).
3935
+ */
3936
+ function reviewAgentProfile(options = {}) {
3937
+ return {
3938
+ description: options.description ?? "Focused review with built-in stop conditions: tight turn and tool budgets with notices, repetition and no-new-evidence guards. Report findings with report_progress after every batch; on limit the last report is the structured partial.",
3939
+ tools: [progressReportTool(), ...options.tools ?? []],
3940
+ limits: mergeLimits(REVIEW_PROFILE_LIMITS, options.limits)
3941
+ };
3942
+ }
3943
+ //#endregion
3753
3944
  //#region src/journal/identity.ts
3754
3945
  /**
3755
3946
  * Content-addressed entry identity (M1-T04): IdentityInput records per
@@ -8461,6 +8652,10 @@ function mergeUsageLimits(call, profile, engine) {
8461
8652
  if (maxRepeatedToolSignature !== void 0) merged.maxRepeatedToolSignature = maxRepeatedToolSignature;
8462
8653
  const maxNoNewEvidenceCalls = pick("maxNoNewEvidenceCalls");
8463
8654
  if (maxNoNewEvidenceCalls !== void 0) merged.maxNoNewEvidenceCalls = maxNoNewEvidenceCalls;
8655
+ const maxCallsPerTool = pick("maxCallsPerTool");
8656
+ if (maxCallsPerTool !== void 0) merged.maxCallsPerTool = maxCallsPerTool;
8657
+ const toolUnits = pick("toolUnits");
8658
+ if (toolUnits !== void 0) merged.toolUnits = toolUnits;
8464
8659
  return merged;
8465
8660
  }
8466
8661
  /**
@@ -8485,6 +8680,21 @@ function validateUsageLimits(limits, site) {
8485
8680
  if (limits.toolBudgetNotices !== void 0 && typeof limits.toolBudgetNotices !== "boolean") throw new ConfigError(`${site}.toolBudgetNotices must be a boolean; got ${typeof limits.toolBudgetNotices}`);
8486
8681
  if (limits.maxRepeatedToolSignature !== void 0) requirePositiveInteger(limits.maxRepeatedToolSignature, `${site}.maxRepeatedToolSignature`);
8487
8682
  if (limits.maxNoNewEvidenceCalls !== void 0) requirePositiveInteger(limits.maxNoNewEvidenceCalls, `${site}.maxNoNewEvidenceCalls`);
8683
+ if (limits.maxCallsPerTool !== void 0) {
8684
+ const caps = limits.maxCallsPerTool;
8685
+ if (typeof caps !== "object" || caps === null || Array.isArray(caps)) throw new ConfigError(`${site}.maxCallsPerTool must be a record of per-tool caps`);
8686
+ for (const [name, cap] of Object.entries(caps)) requireNonNegativeInteger(cap, `${site}.maxCallsPerTool['${name}']`);
8687
+ }
8688
+ if (limits.toolUnits !== void 0) {
8689
+ const units = limits.toolUnits;
8690
+ if (typeof units !== "object" || units === null || Array.isArray(units)) throw new ConfigError(`${site}.toolUnits must be { max, costs? }`);
8691
+ const { max, costs } = units;
8692
+ requirePositiveInteger(max, `${site}.toolUnits.max`);
8693
+ if (costs !== void 0) {
8694
+ if (typeof costs !== "object" || costs === null || Array.isArray(costs)) throw new ConfigError(`${site}.toolUnits.costs must be a record of per-tool costs`);
8695
+ for (const [name, cost] of Object.entries(costs)) requireNonNegativeInteger(cost, `${site}.toolUnits.costs['${name}']`);
8696
+ }
8697
+ }
8488
8698
  }
8489
8699
  //#endregion
8490
8700
  //#region src/runtime/model-retry.ts
@@ -9019,7 +9229,7 @@ function formatRePrompt(issues, attempt, maxAttempts) {
9019
9229
  const GUARD_DOCS_URL = "https://docs.rulvar.com/guide/agents#exploration-guards";
9020
9230
  /** True when any exploration guard field asks for tracking. */
9021
9231
  function explorationTrackingEnabled(limits) {
9022
- return limits.maxRepeatedToolSignature !== void 0 || limits.maxNoNewEvidenceCalls !== void 0 || limits.toolBudgetNotices === true;
9232
+ return limits.maxRepeatedToolSignature !== void 0 || limits.maxNoNewEvidenceCalls !== void 0 || limits.toolBudgetNotices === true || limits.maxCallsPerTool !== void 0 || limits.toolUnits !== void 0;
9023
9233
  }
9024
9234
  function digestOf$1(value) {
9025
9235
  try {
@@ -9038,6 +9248,8 @@ var ExplorationGuard = class {
9038
9248
  repeated = 0;
9039
9249
  duplicateResults = 0;
9040
9250
  denied = 0;
9251
+ deniedToolCap = 0;
9252
+ unitsUsed = 0;
9041
9253
  unserializableSeq = 0;
9042
9254
  constructor(config) {
9043
9255
  this.config = config;
@@ -9075,10 +9287,25 @@ var ExplorationGuard = class {
9075
9287
  }
9076
9288
  }
9077
9289
  /**
9078
- * The pre-dispatch verdict: denies the call that would exceed
9079
- * maxRepeatedToolSignature executions of the same signature.
9290
+ * The pre-dispatch verdict: denies the call that would exceed its
9291
+ * tool's maxCallsPerTool cap, then the call that would exceed
9292
+ * maxRepeatedToolSignature executions of the same signature. A denial
9293
+ * never consumes maxToolCalls or tool units.
9080
9294
  */
9081
9295
  beforeExecute(name, args) {
9296
+ const cap = this.config.maxCallsPerTool?.[name];
9297
+ if (cap !== void 0) {
9298
+ const executions = this.byTool.get(name) ?? 0;
9299
+ if (executions >= cap) {
9300
+ this.deniedToolCap += 1;
9301
+ return {
9302
+ deny: true,
9303
+ guard: "per-tool-cap",
9304
+ executions,
9305
+ reason: `exploration guard: '${name}' already executed ${String(executions)} time(s) this invocation (maxCallsPerTool ${String(cap)}). Use what you have or a different tool (${GUARD_DOCS_URL}).`
9306
+ };
9307
+ }
9308
+ }
9082
9309
  const max = this.config.maxRepeatedToolSignature;
9083
9310
  if (max === void 0) return { deny: false };
9084
9311
  const executions = this.signatureExecutions.get(this.signatureOf(name, args)) ?? 0;
@@ -9086,6 +9313,7 @@ var ExplorationGuard = class {
9086
9313
  this.denied += 1;
9087
9314
  return {
9088
9315
  deny: true,
9316
+ guard: "repeated-signature",
9089
9317
  executions,
9090
9318
  reason: `exploration guard: this exact '${name}' call already executed ${String(executions)} time(s) this invocation (maxRepeatedToolSignature ${String(max)}). Reuse the earlier result or change the arguments (${GUARD_DOCS_URL}).`
9091
9319
  };
@@ -9103,6 +9331,7 @@ var ExplorationGuard = class {
9103
9331
  recordExecution(name, args, result, successful) {
9104
9332
  this.executed += 1;
9105
9333
  this.byTool.set(name, (this.byTool.get(name) ?? 0) + 1);
9334
+ if (this.config.toolUnits !== void 0) this.unitsUsed += this.config.toolUnits.costs?.[name] ?? 1;
9106
9335
  const signature = this.signatureOf(name, args);
9107
9336
  const prior = this.signatureExecutions.get(signature) ?? 0;
9108
9337
  if (prior > 0) this.repeated += 1;
@@ -9119,6 +9348,14 @@ var ExplorationGuard = class {
9119
9348
  const max = this.config.maxNoNewEvidenceCalls;
9120
9349
  return max !== void 0 && this.noNewEvidenceStreak >= max;
9121
9350
  }
9351
+ /**
9352
+ * True once the spent tool units reached the weighted budget: the
9353
+ * loop's pre-dispatch check, mirroring maxToolCalls (terminal 'limit',
9354
+ * paid partial work). Never true without toolUnits configured.
9355
+ */
9356
+ unitsExhausted() {
9357
+ return this.config.toolUnits !== void 0 && this.unitsUsed >= this.config.toolUnits.max;
9358
+ }
9122
9359
  /** The abort message for a tripped no-new-evidence guard. */
9123
9360
  describeTrip() {
9124
9361
  return `exploration guard: ${String(this.noNewEvidenceStreak)} consecutive tool calls returned no new evidence (maxNoNewEvidenceCalls ${String(this.config.maxNoNewEvidenceCalls ?? this.noNewEvidenceStreak)}; every result was already seen this invocation). The executed work is kept; narrow the scope, vary the queries, or raise the limit (${GUARD_DOCS_URL}).`;
@@ -9133,7 +9370,9 @@ var ExplorationGuard = class {
9133
9370
  repeatedCalls: this.repeated,
9134
9371
  duplicateResultCalls: this.duplicateResults,
9135
9372
  deniedRepeats: this.denied,
9136
- byTool
9373
+ byTool,
9374
+ ...this.config.maxCallsPerTool === void 0 ? {} : { deniedToolCap: this.deniedToolCap },
9375
+ ...this.config.toolUnits === void 0 ? {} : { toolUnitsUsed: this.unitsUsed }
9137
9376
  };
9138
9377
  }
9139
9378
  };
@@ -9743,6 +9982,10 @@ async function runAgent(options) {
9743
9982
  parts,
9744
9983
  limitHit: true
9745
9984
  };
9985
+ if (guard !== void 0 && guard.unitsExhausted()) return {
9986
+ parts,
9987
+ limitHit: true
9988
+ };
9746
9989
  const def = runtime.defs.find((candidate) => candidate.name === call.name);
9747
9990
  events?.emit({
9748
9991
  type: "tool:start",
@@ -9898,11 +10141,11 @@ async function runAgent(options) {
9898
10141
  toolName: gatedCall.name,
9899
10142
  outcome: "denied",
9900
10143
  durationMs: now() - gateStartedAt,
9901
- guard: "repeated-signature"
10144
+ guard: guardVerdict.guard
9902
10145
  });
9903
10146
  parts.push(errorPart(call, {
9904
10147
  error: guardVerdict.reason,
9905
- guard: "repeated-signature"
10148
+ guard: guardVerdict.guard
9906
10149
  }));
9907
10150
  continue;
9908
10151
  }
@@ -10751,6 +10994,8 @@ async function runAgent(options) {
10751
10994
  }
10752
10995
  endPhase(extractPhase, phaseOutcome(), extractServed);
10753
10996
  }
10997
+ const limitPartial = status === "limit" ? latestProgressReport(messages) : void 0;
10998
+ if (limitPartial !== void 0) await saveBoundary();
10754
10999
  let transcriptRef = "";
10755
11000
  if (options.transcript !== void 0) {
10756
11001
  transcriptRef = options.transcript.mintRef();
@@ -10773,6 +11018,7 @@ async function runAgent(options) {
10773
11018
  if (abortClass !== void 0) result.abortClass = abortClass;
10774
11019
  if (errorMessage !== void 0) result.errorMessage = errorMessage;
10775
11020
  if (guard !== void 0) result.exploration = guard.summary(toolCallsUsed);
11021
+ if (limitPartial !== void 0) result.partial = limitPartial;
10776
11022
  if (usageApprox) result.usageApprox = true;
10777
11023
  if (transportRetries > 0) result.transportRetries = transportRetries;
10778
11024
  return result;
@@ -11744,7 +11990,13 @@ const WAKE_SUMMARY_RENDER_BUDGET_CHARS = 400;
11744
11990
  * spawn ordinal; the LLM distillation upgrade is M7 territory).
11745
11991
  */
11746
11992
  function summarizeOutput(result) {
11747
- return truncateToBudget(result.status === "ok" ? typeof result.output === "string" ? result.output : JSON.stringify(result.output ?? null) : result.errorMessage ?? `terminal status ${result.status}`, 400);
11993
+ let raw;
11994
+ if (result.status === "ok") raw = typeof result.output === "string" ? result.output : JSON.stringify(result.output ?? null);
11995
+ else {
11996
+ raw = result.errorMessage ?? `terminal status ${result.status}`;
11997
+ if (result.partial !== void 0) raw = `${raw}; partial: ${JSON.stringify(result.partial)}`;
11998
+ }
11999
+ return truncateToBudget(raw, 400);
11748
12000
  }
11749
12001
  /** Folds one settled child into its digest (spawn-ordinal ordering is the caller's). */
11750
12002
  function digestOf(record, result) {
@@ -12617,6 +12869,10 @@ function createCtx(internals, rootWorkflow) {
12617
12869
  const checkpoint = blob === null ? void 0 : decodeCheckpoint(blob);
12618
12870
  if (checkpoint !== void 0) {
12619
12871
  result.turns = checkpoint.turns;
12872
+ if (result.status === "limit") {
12873
+ const partialReport = latestProgressReport(checkpoint.messages);
12874
+ if (partialReport !== void 0) result.partial = partialReport;
12875
+ }
12620
12876
  replayedToolResults = checkpoint.messages.filter((msg) => msg.role === "tool").flatMap((msg) => msg.parts).filter((part) => part.type === "tool-result").map((part) => ({
12621
12877
  name: part.name,
12622
12878
  isError: part.isError === true
@@ -13817,7 +14073,14 @@ function pageOf(content, rawOffset, rawMaxChars) {
13817
14073
  }
13818
14074
  /** The serialized full result of a settled child: the raw string, or JSON. */
13819
14075
  function serializeChildOutput(result) {
13820
- if (result.status !== "ok") return result.errorMessage ?? `terminal status ${result.status}`;
14076
+ if (result.status !== "ok") {
14077
+ const base = result.errorMessage ?? `terminal status ${result.status}`;
14078
+ if (result.partial !== void 0) return JSON.stringify({
14079
+ error: base,
14080
+ partial: result.partial
14081
+ });
14082
+ return base;
14083
+ }
13821
14084
  return typeof result.output === "string" ? result.output : JSON.stringify(result.output ?? null);
13822
14085
  }
13823
14086
  /**
@@ -13839,6 +14102,8 @@ function validateOrchestrateOptions(opts) {
13839
14102
  const minSuccessful = typeof policy === "object" && policy !== null && !Array.isArray(policy) ? policy.minSuccessful : void 0;
13840
14103
  if (policy !== "all-ok" && minSuccessful === void 0) throw new ConfigError(`orchestrate acceptance.childPolicy must be 'all-ok' or { minSuccessful: N }; got ${JSON.stringify(policy)}`);
13841
14104
  if (policy !== "all-ok") requirePositiveInteger(minSuccessful, "orchestrate acceptance.childPolicy.minSuccessful");
14105
+ const acceptPartial = opts.acceptance.acceptPartialChildren;
14106
+ if (acceptPartial !== void 0 && typeof acceptPartial !== "boolean") throw new ConfigError(`orchestrate acceptance.acceptPartialChildren must be a boolean; got ${typeof acceptPartial}`);
13842
14107
  }
13843
14108
  if (opts.finishValidation !== void 0) {
13844
14109
  const fv = opts.finishValidation;
@@ -13903,6 +14168,16 @@ function finishValidationPromptLines(spec) {
13903
14168
  return [`The host validates every finish({ result }) with deterministic validators: ${names}.`, "A rejected finish returns the failure reasons as the tool error result; repair the result and call finish again. " + (repairs === 0 ? "No repair attempt is granted: the first rejected finish fails the run." : repairs === 1 ? "At most one repair attempt is granted before the run fails." : `At most ${String(repairs)} repair attempts are granted before the run fails.`)];
13904
14169
  }
13905
14170
  /**
14171
+ * The partial-salvage contract rides the PROMPT exactly like finish
14172
+ * validation (RV-210 close-out): present only when
14173
+ * acceptance.acceptPartialChildren is set, so every other configuration
14174
+ * keeps byte-identical coordination prompts.
14175
+ */
14176
+ function acceptancePromptLines(acceptance) {
14177
+ if (acceptance?.acceptPartialChildren !== true) return [];
14178
+ return ["Partial salvage is on: a child that ends at its limit AFTER recording progress with report_progress counts as a partial success for acceptance; its digest carries the partial and get_child_result (when enabled) pages the full report. When the gap matters, respawn a NARROWED child carrying the partial instead of repeating the task."];
14179
+ }
14180
+ /**
13906
14181
  * Resolves per-spawn dispatch options against the engine registries
13907
14182
  * (registered SchemaSpec and tool profile names; M7-T05). An
13908
14183
  * unknown ref is a typed ConfigError, surfaced as a tool error to the
@@ -15232,7 +15507,11 @@ function makeOrchestratorWorkflow(goal, opts) {
15232
15507
  const priorRejection = validationDecisions().find((decision) => decision.verdict === "rejected");
15233
15508
  if (priorRejection !== void 0) throw finishValidationError(priorRejection);
15234
15509
  }
15235
- const promptLines = [...extension?.promptLines?.() ?? [], ...finishValidationPromptLines(validationSpec)];
15510
+ const promptLines = [
15511
+ ...extension?.promptLines?.() ?? [],
15512
+ ...finishValidationPromptLines(validationSpec),
15513
+ ...acceptancePromptLines(opts?.acceptance)
15514
+ ];
15236
15515
  const result = await runtime.runInScope(orchestratorState, () => ctx.agent(orchestratorPrompt(goal, opts?.maxSpawns, promptLines.length === 0 ? void 0 : promptLines), agentOpts));
15237
15516
  const liveTermination = extensionTermination;
15238
15517
  if (liveTermination !== void 0) throw liveTermination;
@@ -15248,21 +15527,32 @@ function makeOrchestratorWorkflow(goal, opts) {
15248
15527
  else {
15249
15528
  const childStatusCounts = {};
15250
15529
  const degradedReasons = [];
15530
+ const salvaged = [];
15531
+ let hardDegraded = 0;
15532
+ const acceptPartial = opts.acceptance.acceptPartialChildren === true;
15251
15533
  const sortedRecords = [...records.values()].sort((a, b) => a.spawnOrdinal - b.spawnOrdinal);
15252
15534
  for (const record of sortedRecords) {
15253
15535
  const status = record.settled?.status ?? "running";
15254
15536
  childStatusCounts[status] = (childStatusCounts[status] ?? 0) + 1;
15255
- if (status !== "ok") degradedReasons.push(status === "running" ? `child ${record.nodeId} was still running when finish validated` : `child ${record.nodeId} settled '${status}'`);
15537
+ if (status === "ok") continue;
15538
+ if (acceptPartial && status === "limit" && record.settled?.partial !== void 0) {
15539
+ salvaged.push(record.nodeId);
15540
+ degradedReasons.push(`child ${record.nodeId} accepted as partial (settled 'limit' with a structured partial)`);
15541
+ continue;
15542
+ }
15543
+ hardDegraded += 1;
15544
+ degradedReasons.push(status === "running" ? `child ${record.nodeId} was still running when finish validated` : `child ${record.nodeId} settled '${status}'`);
15256
15545
  }
15257
15546
  const childPolicy = opts.acceptance.childPolicy;
15258
- const accepted = childPolicy === "all-ok" ? degradedReasons.length === 0 : (childStatusCounts.ok ?? 0) >= childPolicy.minSuccessful;
15547
+ const accepted = childPolicy === "all-ok" ? hardDegraded === 0 : (childStatusCounts.ok ?? 0) + salvaged.length >= childPolicy.minSuccessful;
15259
15548
  decision = {
15260
15549
  decisionType: "orchestrator_acceptance",
15261
15550
  verdict: accepted ? "accepted" : "rejected",
15262
15551
  completion: !accepted ? "rejected" : degradedReasons.length === 0 ? "complete" : "partial",
15263
15552
  childPolicy,
15264
15553
  childStatusCounts,
15265
- degradedReasons
15554
+ degradedReasons,
15555
+ ...salvaged.length === 0 ? {} : { salvagedPartialChildren: salvaged }
15266
15556
  };
15267
15557
  await internals.replayer.appendSinglePhase({
15268
15558
  scope: callingState.scope,
@@ -15281,14 +15571,16 @@ function makeOrchestratorWorkflow(goal, opts) {
15281
15571
  completion: "rejected",
15282
15572
  childPolicy: decision.childPolicy,
15283
15573
  childStatusCounts: decision.childStatusCounts,
15284
- degradedReasons: decision.degradedReasons
15574
+ degradedReasons: decision.degradedReasons,
15575
+ ...decision.salvagedPartialChildren === void 0 ? {} : { salvagedPartialChildren: decision.salvagedPartialChildren }
15285
15576
  } });
15286
15577
  }
15287
15578
  return {
15288
15579
  result: await runSynthesis(result.output),
15289
15580
  completion: decision.completion,
15290
15581
  childStatusCounts: decision.childStatusCounts,
15291
- degradedReasons: decision.degradedReasons
15582
+ degradedReasons: decision.degradedReasons,
15583
+ ...decision.salvagedPartialChildren === void 0 ? {} : { salvagedPartialChildren: decision.salvagedPartialChildren }
15292
15584
  };
15293
15585
  });
15294
15586
  }
@@ -16810,4 +17102,4 @@ function createSandboxBridge(ctx, options) {
16810
17102
  };
16811
17103
  }
16812
17104
  //#endregion
16813
- 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_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_MIN_SHARE, 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, INBOX_PROPOSAL_TTL_DAYS, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, InvalidResolutionError, 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, ParallelSiteCounter, PlanInvariantError, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, 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, 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, compileVerifiedLayer, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidencePreservedValidator, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, foldTermination, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, identityJcs, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, lexShellCommand, liftRetainedParts, lineageWeightOf, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, 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, readRunMeta, readTerminationInit, reconcileRunMeta, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, selectStructuredOutputTier, shouldCompact, snapshotUsage, spawnDepthOf, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, usageViolations, validateEditorialCommit, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateUsageLimits, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
17105
+ 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_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_MIN_SHARE, 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, 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, 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, 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, compileVerifiedLayer, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidencePreservedValidator, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, foldTermination, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, identityJcs, implementationAgentProfile, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, parallelScope, parseModelRef, parseScopePath, phiInitialOf, pipelineScope, planNodeScope, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, readRunMeta, readTerminationInit, reconcileRunMeta, 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, selectStructuredOutputTier, shouldCompact, snapshotUsage, spawnDepthOf, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, usageViolations, validateEditorialCommit, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateUsageLimits, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/core",
3
- "version": "1.54.0",
3
+ "version": "1.55.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",