@obversa/runtime 0.1.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.
Files changed (123) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +192 -0
  3. package/dist/api.d.ts +72 -0
  4. package/dist/api.js +9775 -0
  5. package/dist/api.js.map +1 -0
  6. package/dist/artifacts/conformance.d.ts +1 -0
  7. package/dist/artifacts/file-store.d.ts +8 -0
  8. package/dist/artifacts/store.d.ts +1 -0
  9. package/dist/callback/approval.d.ts +8 -0
  10. package/dist/callback/client.d.ts +38 -0
  11. package/dist/callback/gate.d.ts +1 -0
  12. package/dist/callback/stored-client.d.ts +5 -0
  13. package/dist/chunk-3L6YNPN6.js +3 -0
  14. package/dist/chunk-3L6YNPN6.js.map +1 -0
  15. package/dist/chunk-5GLEABOU.js +3 -0
  16. package/dist/chunk-5GLEABOU.js.map +1 -0
  17. package/dist/chunk-DEW5R23M.js +338 -0
  18. package/dist/chunk-DEW5R23M.js.map +1 -0
  19. package/dist/chunk-DV5P4QLI.js +3056 -0
  20. package/dist/chunk-DV5P4QLI.js.map +1 -0
  21. package/dist/chunk-NIBHM5I5.js +34 -0
  22. package/dist/chunk-NIBHM5I5.js.map +1 -0
  23. package/dist/chunk-RZLMX3IA.js +368 -0
  24. package/dist/chunk-RZLMX3IA.js.map +1 -0
  25. package/dist/core/agent-md.d.ts +36 -0
  26. package/dist/core/agent.d.ts +86 -0
  27. package/dist/core/approval-job.d.ts +43 -0
  28. package/dist/core/assert-graph.d.ts +34 -0
  29. package/dist/core/budget.d.ts +49 -0
  30. package/dist/core/concurrency.d.ts +2 -0
  31. package/dist/core/condition.d.ts +209 -0
  32. package/dist/core/context.d.ts +36 -0
  33. package/dist/core/cost.d.ts +59 -0
  34. package/dist/core/dag.d.ts +20 -0
  35. package/dist/core/decision.d.ts +29 -0
  36. package/dist/core/describe.d.ts +56 -0
  37. package/dist/core/engine-meta.d.ts +5 -0
  38. package/dist/core/env-overlay.d.ts +35 -0
  39. package/dist/core/errors.d.ts +46 -0
  40. package/dist/core/feedback.d.ts +68 -0
  41. package/dist/core/git.d.ts +152 -0
  42. package/dist/core/guards.d.ts +70 -0
  43. package/dist/core/isolated.d.ts +40 -0
  44. package/dist/core/job.d.ts +134 -0
  45. package/dist/core/limits.d.ts +22 -0
  46. package/dist/core/loop.d.ts +24 -0
  47. package/dist/core/merge.d.ts +30 -0
  48. package/dist/core/pipeline.d.ts +35 -0
  49. package/dist/core/process.d.ts +11 -0
  50. package/dist/core/progress.d.ts +82 -0
  51. package/dist/core/redact.d.ts +1 -0
  52. package/dist/core/stats.d.ts +63 -0
  53. package/dist/core/team.d.ts +34 -0
  54. package/dist/core/text.d.ts +8 -0
  55. package/dist/core/tournament.d.ts +25 -0
  56. package/dist/core/types.d.ts +650 -0
  57. package/dist/engines/command-runner.d.ts +1 -0
  58. package/dist/engines/conformance.d.ts +1 -0
  59. package/dist/engines/engine.d.ts +4 -0
  60. package/dist/engines/failure.d.ts +1 -0
  61. package/dist/engines/fallback.d.ts +35 -0
  62. package/dist/engines/message-map.d.ts +1 -0
  63. package/dist/engines/mock.d.ts +1 -0
  64. package/dist/engines/preflight.d.ts +36 -0
  65. package/dist/env/command.d.ts +50 -0
  66. package/dist/env/command.js +65 -0
  67. package/dist/env/command.js.map +1 -0
  68. package/dist/env/environment.d.ts +4 -0
  69. package/dist/env/mock.d.ts +24 -0
  70. package/dist/events/conformance.d.ts +1 -0
  71. package/dist/events/envelope.d.ts +1 -0
  72. package/dist/events/jsonl-store.d.ts +8 -0
  73. package/dist/events/store.d.ts +1 -0
  74. package/dist/graph/commands.d.ts +5 -0
  75. package/dist/graph/conformance.d.ts +32 -0
  76. package/dist/graph/kernel.d.ts +5 -0
  77. package/dist/graph/plan.d.ts +1 -0
  78. package/dist/graph/type.d.ts +7 -0
  79. package/dist/graph/value.d.ts +1 -0
  80. package/dist/graph-types/dag.d.ts +137 -0
  81. package/dist/graph-types/loop.d.ts +194 -0
  82. package/dist/graph-types/team.d.ts +68 -0
  83. package/dist/memory.d.ts +82 -0
  84. package/dist/memory.js +397 -0
  85. package/dist/memory.js.map +1 -0
  86. package/dist/proof/acceptance.d.ts +5 -0
  87. package/dist/proof/artifact.d.ts +6 -0
  88. package/dist/proof/cache.d.ts +4 -0
  89. package/dist/runtime/attempt.d.ts +19 -0
  90. package/dist/runtime/budget.d.ts +4 -0
  91. package/dist/runtime/engine-availability.d.ts +18 -0
  92. package/dist/runtime/graph-executor.d.ts +7 -0
  93. package/dist/runtime/monitor.d.ts +80 -0
  94. package/dist/runtime/node-lifecycle.d.ts +84 -0
  95. package/dist/runtime/paths.d.ts +2 -0
  96. package/dist/runtime/persist.d.ts +31 -0
  97. package/dist/runtime/preflight-record.d.ts +149 -0
  98. package/dist/runtime/process-tree.d.ts +1 -0
  99. package/dist/runtime/result-contract.d.ts +4 -0
  100. package/dist/runtime/result-parts.d.ts +1 -0
  101. package/dist/runtime/run-definition.d.ts +24 -0
  102. package/dist/runtime/run-event.d.ts +9 -0
  103. package/dist/runtime/runner.d.ts +139 -0
  104. package/dist/runtime/supervisor.d.ts +111 -0
  105. package/dist/runtime/team-rooms.d.ts +13 -0
  106. package/dist/runtime/workspace-policy.d.ts +25 -0
  107. package/dist/storage/error.d.ts +1 -0
  108. package/dist/storage/id.d.ts +1 -0
  109. package/dist/storage/local.d.ts +12 -0
  110. package/dist/storage/local.js +1492 -0
  111. package/dist/storage/local.js.map +1 -0
  112. package/dist/testing.d.ts +15 -0
  113. package/dist/testing.js +274 -0
  114. package/dist/testing.js.map +1 -0
  115. package/dist/workflow-agent-response.d.ts +3 -0
  116. package/dist/workflow-support.d.ts +36 -0
  117. package/dist/workflow-support.js +5 -0
  118. package/dist/workflow-support.js.map +1 -0
  119. package/dist/workflow.d.ts +73 -0
  120. package/dist/workspace/conformance.d.ts +1 -0
  121. package/dist/workspace/git-provider.d.ts +26 -0
  122. package/dist/workspace/provider.d.ts +2 -0
  123. package/package.json +91 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jonny Neill
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,192 @@
1
+ # @obversa/runtime
2
+
3
+ `@obversa/runtime` is a standalone TypeScript runtime. Obversa is one consumer;
4
+ any host can use the public package API. The package also defines a pure graph
5
+ contract for graph types outside this package.
6
+
7
+ ## Requirements
8
+
9
+ - Node.js 22.12 or later
10
+
11
+ ## Build from the workspace
12
+
13
+ From the workspace root, run:
14
+
15
+ ```bash
16
+ corepack enable
17
+ pnpm install --frozen-lockfile
18
+ pnpm --filter @obversa/runtime build
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ ```ts
24
+ import { agentJob, run } from '@obversa/runtime';
25
+ import { MockEngine } from '@obversa/runtime/testing';
26
+
27
+ const engine = new MockEngine(() => 'ready');
28
+
29
+ const result = await run(
30
+ agentJob({
31
+ label: 'prepare-item',
32
+ engine: 'offline',
33
+ prompt: 'Prepare the item.',
34
+ }),
35
+ {
36
+ engine: 'offline',
37
+ engines: { offline: engine },
38
+ },
39
+ );
40
+
41
+ console.log(result.outcome.status);
42
+ ```
43
+
44
+ Expected output:
45
+
46
+ ```text
47
+ pass
48
+ ```
49
+
50
+ This package exposes the programmatic API. It does not expose a command.
51
+
52
+ ## Memory
53
+
54
+ Pass a `Memory` instance in the run options when a job uses memory:
55
+
56
+ ```ts
57
+ await run(job, { memory });
58
+ ```
59
+
60
+ The runtime imports the `@obversa/api` memory port. Your program selects the storage
61
+ adapter.
62
+
63
+ With the Agent SDK engine, passing memory makes its one in-process memory tool
64
+ available and automatically approved. Other tool settings do not change.
65
+
66
+ ## Define an outside graph type
67
+
68
+ Use `GraphType` with `compileGraph` to define a pure graph type. The graph type
69
+ validates a graph definition, reduces recorded events, returns graph commands,
70
+ and describes a plan. The contract gives it frozen data and graph lookups, not
71
+ file, model, process, clock, or storage services.
72
+
73
+ An outside graph type is trusted package code. It can import and use effects by
74
+ itself. The public conformance kit checks behavior. It does not stop effects.
75
+
76
+ The host resolves the description with `resolveGraphPlan`. The host admission
77
+ record must admit the package identity and every requested permission. The
78
+ resolved plan records known bounds or an explicit unknown bound. Its frozen
79
+ snapshot and digest identify the fixed package, permissions, lanes, policies,
80
+ and bounds for one run.
81
+
82
+ `validateGraphDescription(unknown)` validates a description without compiling
83
+ a graph. It returns a frozen valid description or throws `GraphValidationError`.
84
+ Each node must appear in one phase, and its `phaseId` must name that phase.
85
+ Description nodes preserve definition node declaration order. The compiler
86
+ supplies description edges in definition edge declaration order.
87
+
88
+ The public conformance kit checks the initial state and command, then every
89
+ event-prefix state and command. It uses separate compiled instances and
90
+ repeated calls. It also checks the declared bounds. The kit counts dispatches
91
+ across the supplied trace and the largest dispatch set in one decision. Known
92
+ dispatch and fan-out maximums cannot be below those observed values. It does
93
+ not infer runtime concurrency from a decision trace.
94
+ Each expected decision contains only new requests. The kit rejects a dispatch
95
+ position reused in a later expected decision. D5 applies the same rule to
96
+ durable dispatch events before execution.
97
+ When the final expected decision is exactly `complete`, the observed total must
98
+ meet a known dispatch minimum; partial, empty, paused, and failed endings do not
99
+ prove a minimum.
100
+
101
+ A graph decision contains zero or more dispatch commands, or exactly one
102
+ pause, complete, or fail command. Dispatches ask the executor to start new
103
+ work. An empty decision starts no work. D5 accepts it only while a recorded
104
+ attempt remains in flight; otherwise the executor fails instead of spinning.
105
+ Each `position` is the stable logical identity and location of one requested
106
+ node occurrence. Positions must be unique within one decision, so the same
107
+ node can appear more than once at different positions. After an occurrence is
108
+ recorded, the graph does not emit it again. A later event can make the same
109
+ node dispatchable as a new occurrence with its own position.
110
+
111
+ `run(job, { params })` accepts a JSON object. If `params` is `undefined`, it
112
+ uses a frozen empty object. `null`, arrays, and other invalid roots fail before
113
+ work or environment setup starts. A valid object is cloned and frozen. Every
114
+ child job receives the same frozen object as `ctx.params`. A later caller
115
+ change cannot change that object. JSON nested more than 256 levels fails with
116
+ `JsonValueError`.
117
+
118
+ Run the checked-in example from the workspace root:
119
+
120
+ ```bash
121
+ pnpm example:graph
122
+ ```
123
+
124
+ The example is `examples/custom-graph.ts`. It uses only public exports
125
+ and runs the public graph conformance kit.
126
+
127
+ This graph contract does not schedule nodes, store runs, provide built-in
128
+ graph forms, or execute work on another machine.
129
+
130
+ ## Store events and artifacts
131
+
132
+ Use `EventStore` for small append-only JSON events. Use `ArtifactStore` for
133
+ larger byte content. An event can carry the returned artifact reference instead
134
+ of copying the content into the event stream.
135
+
136
+ Run the checked-in local-storage example from the workspace root:
137
+
138
+ ```bash
139
+ pnpm example:storage
140
+ ```
141
+
142
+ The example stores a 65 KB synthetic artifact, appends its 194-byte reference,
143
+ reopens the same data through a fresh storage binding, folds the same state,
144
+ and runs both public storage conformance kits. It stays offline and does not
145
+ execute or resume graph work.
146
+
147
+ Read [Events and artifacts](../../docs/public/storage/events-and-artifacts.mdx)
148
+ for the port contracts, limits, secret rules, conflicts, and integrity checks.
149
+
150
+ ## Run safe node attempts
151
+
152
+ `GrokCliEngine` and `OpenCodeCliEngine` each run one fresh CLI process for one
153
+ bounded attempt. The checked-in example uses local scripted executables, so it
154
+ does not call a model or the network.
155
+
156
+ ```bash
157
+ pnpm example:attempt
158
+ ```
159
+
160
+ The example validates a native Grok structured result and an OpenCode result
161
+ parsed by the job. It also proves that missing usage remains `unknown`.
162
+
163
+ Read [Safe node attempts](../../docs/public/runtime/node-attempts.mdx) for the
164
+ public adapter contract and the D5 and D14 boundaries.
165
+
166
+ ## Resume graph attempts
167
+
168
+ The graph executor records a start marker immediately before node code runs.
169
+ A fresh executor returns `waiting` for a dispatch that has no result.
170
+
171
+ Call `resume(position, signal)` after the earlier executor process stops. An
172
+ unstarted attempt runs at the same position without a second dispatch event.
173
+ A started attempt runs again only when its saved `retrySafe` rule permits it.
174
+ The executor records a typed pause for all other started attempts.
175
+
176
+ Read [Graph executor](../../docs/public/graphs/executor.mdx) for the public
177
+ resume contract and the process-lock boundary.
178
+
179
+ ## Documentation
180
+
181
+ The workspace `docs/public` directory contains the first-run guide, graph
182
+ guides, storage guide, and the production-line bank.
183
+
184
+ Run the offline production line from the workspace root:
185
+
186
+ ```bash
187
+ pnpm example:offline
188
+ ```
189
+
190
+ ## License
191
+
192
+ [MIT](LICENSE)
package/dist/api.d.ts ADDED
@@ -0,0 +1,72 @@
1
+ /** Public programmatic API for the Obversa graph runtime. */
2
+ export { briefFromFile, person, stage, workflow, type BriefSource, type NamedStage, type PersonRole, type WorkflowConfig, type WorkflowOptions, type WorkflowPostContext, type WorkflowRecord, type WorkflowRole, type WorkflowStage, } from './workflow.js';
3
+ export type { TeamSeat } from '@obversa/api';
4
+ export type { JsonPrimitive, JsonObject, JsonValue, RunBrief, Sha256Digest, GraphValidationIssue, } from './graph/value.js';
5
+ export { JsonValueError } from './graph/value.js';
6
+ export { GraphValidationError, type GraphId, type NodeId, type EdgeId, type GraphNode, type GraphEdge, type GraphDefinition, type CompiledGraphDefinition, type GraphKernel, } from './graph/kernel.js';
7
+ export type { DispatchGraphCommand, PauseGraphCommand, CompleteGraphCommand, FailGraphCommand, GraphCommand, } from './graph/commands.js';
8
+ export { compileGraph, type GraphEvent, type GraphEngineIdentity, type EngineAttemptRecordedPayload, type GraphBindings, type GraphTypeCompilation, type CompiledGraphType, type GraphType, } from './graph/type.js';
9
+ export { dag as dagGraphType, type DagDefinition, } from './graph-types/dag.js';
10
+ export { teamGraphType, type TeamNodeData, type TeamRoom, type TeamCommunication, type TeamGraphData, type TeamDefinition, type TeamPost, type TeamTurnResult, type TeamMessage, type TeamGraphResult, } from './graph-types/team.js';
11
+ export { convergence, type ConvergenceDefinition, type ConvergenceEvent, type ConvergenceStatus, } from './graph-types/loop.js';
12
+ export { createCallbackGate, callbackRequestDigest, validateCallbackRequest, validateCallbackResponse, type CallbackGateDefinition, type CallbackRequest, } from './callback/gate.js';
13
+ export { createCallbackClient, replayCallbackClient, directRouter, validateCallbackEvent, type CallbackClient, type CallbackEvent, type ClaimResult, type SubmitResult, type ReleaseResult, type Responder, } from './callback/client.js';
14
+ export { createStoredCallbackClient, type NewCallbackHistoryEvent, type StoredCallbackClient, } from './callback/stored-client.js';
15
+ export { ApprovalSubjectError, approvalSubjectDigest, createApprovalCallbackGate, resolveApproval, validateApprovalRecord, type ApprovalBinding, type ApprovalEventPayload, type ApprovalRecord, type ApprovalResolutionInput, type ApprovalSubject, type ApprovalSubjectInput, type NewApprovalEvent, } from './callback/approval.js';
16
+ export { acceptedResultMatches, createAcceptedResultRecord, resolveAcceptedResult, validateAcceptedResultRecord, type AcceptedResultBinding, type AcceptedResultBindingInput, type AcceptedResultEventPayload, type AcceptedResultGraph, type AcceptedResultRecord, type AcceptedResultResolution, type CreateAcceptedResultRecordInput, type NewAcceptedResultEvent, } from './proof/acceptance.js';
17
+ export { writeProofArtifact, type ProofArtifactReference, } from './proof/artifact.js';
18
+ export { createProofCache, type CachedProofPacket, type ProofCache, type ProofCacheCurrentBinding, type ProofCacheOptions, type ProofJob, type ProofPacket, type ProofPacketSource, type ProofSource, } from './proof/cache.js';
19
+ export { createGraphExecutor, GraphExecutionError, type GraphExecutionErrorCode, type GraphNodeBinding, type GraphEngineBinding, type GraphExecutor, type GraphExecutorOptions, type GraphExecutorResult, } from './runtime/graph-executor.js';
20
+ export { projectTeamRooms } from './runtime/team-rooms.js';
21
+ export { resolveGraphPlan, validateGraphDescription, type PermissionDescriptor, type ExecutionTarget, type ExecutionLaneDescription, type GraphPhaseDescription, type GraphNodeDescription, type GraphEdgeDescription, type PlanBound, type GraphBounds, type GraphPolicyDescription, type GraphRequirements, type GraphDescriptionInput, type GraphDescription, type GraphPackageIdentity, type GraphPackageAdmission, type ExecutionLaneResolution, type RunPreflightPolicy, type PlanResolution, type ResolvedExecutionLane, type ResolvedPlan, type ResolvedPlanSnapshot, } from './graph/plan.js';
22
+ export { StorageError, type StorageErrorCode, } from './storage/error.js';
23
+ export { createGitWorktreeProvider, } from './workspace/git-provider.js';
24
+ export type { WorkspaceProvider, WorkspaceAnchor, WorkspaceHeadDrift, WorkspaceFilesDrift, WorkspaceRepositoryDrift, WorkspaceDrift, VerifyResult, ForkOk, ForkChangedAnchor, ForkExists, ForkIncomplete, ForkUnleased, ForkNoRevision, ForkInvalidChild, ForkResult, LeaseClaimed, LeaseHeld, LeaseIncomplete, AcquireResult, WorkspaceReleaseResult, RecoverResult, } from './workspace/provider.js';
25
+ export { validateDomainEventId, validateNewDomainEvent, validateDomainEventEnvelope, type DomainEventId, type EventStreamId, type StorageNamespace, type StreamRevision, type EventStreamRef, type NewDomainEvent, type DomainEventEnvelope, } from './events/envelope.js';
26
+ export { validateDomainEventBatch, validateEventStreamRef, type DomainEventBatch, type EventStore, } from './events/store.js';
27
+ export { validateArtifactReference, validateArtifactScope, validateNewArtifact, type ArtifactBatch, type ArtifactContentMode, type ArtifactScope, type NewArtifact, type ArtifactReference, type ArtifactStore, } from './artifacts/store.js';
28
+ export { loadRunDefinition, persistRunDefinition, validateRunDefinition, validateRunStartRecord, validateRunStoragePolicy, validateRunStorageRecord, type StorageProviderRecord, type SensitiveContentPolicy, type RunStoragePolicy, type RunStorageRecord, type RunDefinition, type RunStartedPayload, type NewRunStartedEvent, type RunStartRecord, type RunStorageBinding, } from './runtime/run-definition.js';
29
+ export { readRunPreflight, interruptRunPreflight, type RunPreflightState, type PreflightPauseResult, type PreflightFailureResult, } from './runtime/preflight-record.js';
30
+ export type { AttemptBudgetPolicy, TokenBudget, } from './runtime/budget.js';
31
+ export type { ActionDecision, AllowActionDecision, WaitActionDecision, DenyActionDecision, NodeDataContext, } from './runtime/node-lifecycle.js';
32
+ export type { ResultContract } from './runtime/result-contract.js';
33
+ export type { NodeWorkspacePolicy } from './runtime/workspace-policy.js';
34
+ export type { Job, JobMeta, JobContext, Outcome, OutcomeStatus, FeedbackActionSeverity, FeedbackDecision, FeedbackFinding, FeedbackSeverity, RevisionRequest, RevisionRerun, GraphPosition, LimitPolicy, Condition, ConditionInput, ConditionResult, RawPredicate, LoopConfig, RetryPolicy, DagConfig, KickbackBudget, DagNode, LoopEvent, LogLevel, Workspace, ProofKind, ProofArtifact, ProofRecord, UsageTotals, } from './core/types.js';
35
+ export { loop } from './core/loop.js';
36
+ export { dag, sequence, parallel } from './core/dag.js';
37
+ export { pipeline, type PipelineStage } from './core/pipeline.js';
38
+ export { tournament, type TournamentConfig } from './core/tournament.js';
39
+ export { team, type TeamAgent, type TeamAgentResult, type TeamConfig, type TeamResult, type TeamReview, } from './core/team.js';
40
+ export { agentJob, fnJob, type FnJobResult, prove, kickback, revisionRequest, type AgentJobConfig, type AgentRoute, type ProofDescriptor, type ProofProducer, RECORDED_ENGINE_USAGE, type RecordedEngineUsage, } from './core/job.js';
41
+ export { reviewPanel, reviewContext, type ReviewPanelConfig, type ReviewContextConfig, type RevisionRequestInput, } from './core/feedback.js';
42
+ export { copyJobMeta, jobMeta, renderPlan, describeConditions } from './core/describe.js';
43
+ export { assertGraph, type GraphShape, type GraphNodeShape, } from './core/assert-graph.js';
44
+ export { defineAgent, defineSkill, fromFile, type AgentContractSummary, type AgentDef, type AgentFailureMode, type AgentOutputContract, type AgentSkillRef, type AgentTier, type Skill, } from './core/agent.js';
45
+ export { defineAgentFromMarkdown } from './core/agent-md.js';
46
+ export { isolated, type IsolatedOptions } from './core/isolated.js';
47
+ export { confidenceCondition, confidenceFromText, lastDecisionLine, lastGateBrief, type ConfidenceConditionOptions, type LastDecisionLineOptions, type LastGateBriefOptions, } from './core/decision.js';
48
+ export { toCondition, predicate, bodyPassed, minConfidence, commandSucceeds, all, any, not, quorum, always, never, agentCheck, gateJob, commandJob, passed, failed, type AgentCheckConfig, } from './core/condition.js';
49
+ export { approval, type ApprovalAnswer, type ApprovalOptions } from './core/approval-job.js';
50
+ export type { RunCallbacks } from './core/types.js';
51
+ export type { RunMonitor, MonitorState, MonitorNodeState, MonitorNodePhase, MonitorKickback } from './runtime/monitor.js';
52
+ export type { NoProgressConfig, NoProgressInput, StallReport, } from './core/progress.js';
53
+ export { LoopError, type LoopErrorCode } from './core/errors.js';
54
+ export type { BudgetConfig } from './core/budget.js';
55
+ export type { Engine, EngineRef, EngineName, AgentRequest, AgentResult, AgentResultPart, EngineIncompleteResultEvidence, EngineSelectionRecord, EngineTransportFailure, EngineStreamEvent, Usage, UsageReceipt, } from './engines/engine.js';
56
+ export { EngineError, EngineIncompleteResultError } from './engines/engine.js';
57
+ export { finalResultPart, finalResultText, validateAgentResult, } from './runtime/result-parts.js';
58
+ export type { Environment, EnvHandle } from './env/environment.js';
59
+ export { withEnv } from './core/env-overlay.js';
60
+ export { run, exitCodeFor, EXIT_PAUSED, type RunOptions, type RunResult, } from './runtime/runner.js';
61
+ export { RESUME_STAGE_OUTCOMES } from './runtime/runner.js';
62
+ export type { RecordedStage, ResumedStageRecords } from './runtime/persist.js';
63
+ export { formatEvent } from './runtime/supervisor.js';
64
+ export type { StatsSnapshot } from './core/stats.js';
65
+ export { classifyEngineFailure, LANE_DEAD_FAILURES, type EngineFailureKind, } from './engines/failure.js';
66
+ export { fallbackEngine, type FallbackOptions, type FallbackInfo, } from './engines/fallback.js';
67
+ export { preflight, preflightEngine, formatPreflight, type PreflightResult, type PreflightOptions, } from './engines/preflight.js';
68
+ export { costReport, formatCostReport, type PriceTable, type ModelPrice, type ModelCost, type CostReport, } from './core/cost.js';
69
+ export { ratchet, writeScope, sampled, type RatchetOptions, type WriteScopeOptions, type SampledOptions, } from './core/guards.js';
70
+ import type { Job } from './core/types.js';
71
+ /** Preserve the exact `Job` type of a default export. */
72
+ export declare function defineJob(job: Job): Job;