@smthrs/harness 0.0.0-stage → 1.0.0-rc.3
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/CHANGELOG.md +387 -0
- package/LICENSE +21 -0
- package/README.md +138 -2
- package/dist/cjs/AgentEvent.d.ts +3092 -0
- package/dist/cjs/AgentEvent.d.ts.map +1 -0
- package/dist/cjs/AgentEvent.js +1116 -0
- package/dist/cjs/AgentEvent.js.map +7 -0
- package/dist/cjs/CallLedger.d.ts +378 -0
- package/dist/cjs/CallLedger.d.ts.map +1 -0
- package/dist/cjs/CallLedger.js +240 -0
- package/dist/cjs/CallLedger.js.map +7 -0
- package/dist/cjs/Cell.d.ts +774 -0
- package/dist/cjs/Cell.d.ts.map +1 -0
- package/dist/cjs/Cell.js +431 -0
- package/dist/cjs/Cell.js.map +7 -0
- package/dist/cjs/CellCalls.d.ts +115 -0
- package/dist/cjs/CellCalls.d.ts.map +1 -0
- package/dist/cjs/CellCalls.js +98 -0
- package/dist/cjs/CellCalls.js.map +7 -0
- package/dist/cjs/CellHistory.d.ts +102 -0
- package/dist/cjs/CellHistory.d.ts.map +1 -0
- package/dist/cjs/CellHistory.js +54 -0
- package/dist/cjs/CellHistory.js.map +7 -0
- package/dist/cjs/CellTurn.d.ts +1071 -0
- package/dist/cjs/CellTurn.d.ts.map +1 -0
- package/dist/cjs/CellTurn.js +2618 -0
- package/dist/cjs/CellTurn.js.map +7 -0
- package/dist/cjs/CellValidation.d.ts +94 -0
- package/dist/cjs/CellValidation.d.ts.map +1 -0
- package/dist/cjs/CellValidation.js +218 -0
- package/dist/cjs/CellValidation.js.map +7 -0
- package/dist/cjs/Compaction.d.ts +158 -0
- package/dist/cjs/Compaction.d.ts.map +1 -0
- package/dist/cjs/Compaction.js +189 -0
- package/dist/cjs/Compaction.js.map +7 -0
- package/dist/cjs/CompletionClaim.d.ts +801 -0
- package/dist/cjs/CompletionClaim.d.ts.map +1 -0
- package/dist/cjs/CompletionClaim.js +303 -0
- package/dist/cjs/CompletionClaim.js.map +7 -0
- package/dist/cjs/ContextWindow.d.ts +435 -0
- package/dist/cjs/ContextWindow.d.ts.map +1 -0
- package/dist/cjs/ContextWindow.js +319 -0
- package/dist/cjs/ContextWindow.js.map +7 -0
- package/dist/cjs/EngineLike.d.ts +546 -0
- package/dist/cjs/EngineLike.d.ts.map +1 -0
- package/dist/cjs/EngineLike.js +114 -0
- package/dist/cjs/EngineLike.js.map +7 -0
- package/dist/cjs/ExternalTranscript.d.ts +349 -0
- package/dist/cjs/ExternalTranscript.d.ts.map +1 -0
- package/dist/cjs/ExternalTranscript.js +826 -0
- package/dist/cjs/ExternalTranscript.js.map +7 -0
- package/dist/cjs/FailedCall.d.ts +132 -0
- package/dist/cjs/FailedCall.d.ts.map +1 -0
- package/dist/cjs/FailedCall.js +53 -0
- package/dist/cjs/FailedCall.js.map +7 -0
- package/dist/cjs/FlowBinding.d.ts +289 -0
- package/dist/cjs/FlowBinding.d.ts.map +1 -0
- package/dist/cjs/FlowBinding.js +251 -0
- package/dist/cjs/FlowBinding.js.map +7 -0
- package/dist/cjs/HarnessError.d.ts +57 -0
- package/dist/cjs/HarnessError.d.ts.map +1 -0
- package/dist/cjs/HarnessError.js +75 -0
- package/dist/cjs/HarnessError.js.map +7 -0
- package/dist/cjs/Judgement.d.ts +289 -0
- package/dist/cjs/Judgement.d.ts.map +1 -0
- package/dist/cjs/Judgement.js +240 -0
- package/dist/cjs/Judgement.js.map +7 -0
- package/dist/cjs/Monitor.d.ts +374 -0
- package/dist/cjs/Monitor.d.ts.map +1 -0
- package/dist/cjs/Monitor.js +233 -0
- package/dist/cjs/Monitor.js.map +7 -0
- package/dist/cjs/NarrowedCheck.d.ts +523 -0
- package/dist/cjs/NarrowedCheck.d.ts.map +1 -0
- package/dist/cjs/NarrowedCheck.js +263 -0
- package/dist/cjs/NarrowedCheck.js.map +7 -0
- package/dist/cjs/Notifications.d.ts +42 -0
- package/dist/cjs/Notifications.d.ts.map +1 -0
- package/dist/cjs/Notifications.js +177 -0
- package/dist/cjs/Notifications.js.map +7 -0
- package/dist/cjs/Plan.d.ts +127 -0
- package/dist/cjs/Plan.d.ts.map +1 -0
- package/dist/cjs/Plan.js +77 -0
- package/dist/cjs/Plan.js.map +7 -0
- package/dist/cjs/QuickJSSandbox.d.ts +151 -0
- package/dist/cjs/QuickJSSandbox.d.ts.map +1 -0
- package/dist/cjs/QuickJSSandbox.js +987 -0
- package/dist/cjs/QuickJSSandbox.js.map +7 -0
- package/dist/cjs/Relevance.d.ts +213 -0
- package/dist/cjs/Relevance.d.ts.map +1 -0
- package/dist/cjs/Relevance.js +183 -0
- package/dist/cjs/Relevance.js.map +7 -0
- package/dist/cjs/Sandbox.d.ts +637 -0
- package/dist/cjs/Sandbox.d.ts.map +1 -0
- package/dist/cjs/Sandbox.js +260 -0
- package/dist/cjs/Sandbox.js.map +7 -0
- package/dist/cjs/Steering.d.ts +464 -0
- package/dist/cjs/Steering.d.ts.map +1 -0
- package/dist/cjs/Steering.js +153 -0
- package/dist/cjs/Steering.js.map +7 -0
- package/dist/cjs/StructuredOutput.d.ts +252 -0
- package/dist/cjs/StructuredOutput.d.ts.map +1 -0
- package/dist/cjs/StructuredOutput.js +266 -0
- package/dist/cjs/StructuredOutput.js.map +7 -0
- package/dist/cjs/Sufficiency.d.ts +195 -0
- package/dist/cjs/Sufficiency.d.ts.map +1 -0
- package/dist/cjs/Sufficiency.js +110 -0
- package/dist/cjs/Sufficiency.js.map +7 -0
- package/dist/cjs/Supervisor.d.ts +719 -0
- package/dist/cjs/Supervisor.d.ts.map +1 -0
- package/dist/cjs/Supervisor.js +313 -0
- package/dist/cjs/Supervisor.js.map +7 -0
- package/dist/cjs/Tokens.d.ts +86 -0
- package/dist/cjs/Tokens.d.ts.map +1 -0
- package/dist/cjs/Tokens.js +72 -0
- package/dist/cjs/Tokens.js.map +7 -0
- package/dist/cjs/Transcript.d.ts +171 -0
- package/dist/cjs/Transcript.d.ts.map +1 -0
- package/dist/cjs/Transcript.js +342 -0
- package/dist/cjs/Transcript.js.map +7 -0
- package/dist/cjs/TruncatedOutput.d.ts +186 -0
- package/dist/cjs/TruncatedOutput.d.ts.map +1 -0
- package/dist/cjs/TruncatedOutput.js +143 -0
- package/dist/cjs/TruncatedOutput.js.map +7 -0
- package/dist/cjs/UnmovedTree.d.ts +113 -0
- package/dist/cjs/UnmovedTree.d.ts.map +1 -0
- package/dist/cjs/UnmovedTree.js +38 -0
- package/dist/cjs/UnmovedTree.js.map +7 -0
- package/dist/cjs/UnresolvedFailure.d.ts +196 -0
- package/dist/cjs/UnresolvedFailure.d.ts.map +1 -0
- package/dist/cjs/UnresolvedFailure.js +77 -0
- package/dist/cjs/UnresolvedFailure.js.map +7 -0
- package/dist/cjs/VacuousVerification.d.ts +237 -0
- package/dist/cjs/VacuousVerification.d.ts.map +1 -0
- package/dist/cjs/VacuousVerification.js +91 -0
- package/dist/cjs/VacuousVerification.js.map +7 -0
- package/dist/cjs/VariablesPanel.d.ts +117 -0
- package/dist/cjs/VariablesPanel.d.ts.map +1 -0
- package/dist/cjs/VariablesPanel.js +108 -0
- package/dist/cjs/VariablesPanel.js.map +7 -0
- package/dist/cjs/index.d.ts +172 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +99 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/internal/bytes.d.ts +36 -0
- package/dist/cjs/internal/bytes.d.ts.map +1 -0
- package/dist/cjs/internal/bytes.js +57 -0
- package/dist/cjs/internal/bytes.js.map +7 -0
- package/dist/cjs/internal/cellPrompt.d.ts +122 -0
- package/dist/cjs/internal/cellPrompt.d.ts.map +1 -0
- package/dist/cjs/internal/cellPrompt.js +146 -0
- package/dist/cjs/internal/cellPrompt.js.map +7 -0
- package/dist/cjs/internal/compactable.d.ts +44 -0
- package/dist/cjs/internal/compactable.d.ts.map +1 -0
- package/dist/cjs/internal/compactable.js +56 -0
- package/dist/cjs/internal/compactable.js.map +7 -0
- package/dist/cjs/internal/compactionMarks.d.ts +278 -0
- package/dist/cjs/internal/compactionMarks.d.ts.map +1 -0
- package/dist/cjs/internal/compactionMarks.js +212 -0
- package/dist/cjs/internal/compactionMarks.js.map +7 -0
- package/dist/cjs/internal/demandText.d.ts +95 -0
- package/dist/cjs/internal/demandText.d.ts.map +1 -0
- package/dist/cjs/internal/demandText.js +70 -0
- package/dist/cjs/internal/demandText.js.map +7 -0
- package/dist/cjs/internal/elide.d.ts +109 -0
- package/dist/cjs/internal/elide.d.ts.map +1 -0
- package/dist/cjs/internal/elide.js +59 -0
- package/dist/cjs/internal/elide.js.map +7 -0
- package/dist/cjs/internal/frame.d.ts +463 -0
- package/dist/cjs/internal/frame.d.ts.map +1 -0
- package/dist/cjs/internal/frame.js +514 -0
- package/dist/cjs/internal/frame.js.map +7 -0
- package/dist/cjs/internal/nonNegativeSafeInt.d.ts +20 -0
- package/dist/cjs/internal/nonNegativeSafeInt.d.ts.map +1 -0
- package/dist/cjs/internal/nonNegativeSafeInt.js +29 -0
- package/dist/cjs/internal/nonNegativeSafeInt.js.map +7 -0
- package/dist/cjs/internal/paidUsage.d.ts +52 -0
- package/dist/cjs/internal/paidUsage.d.ts.map +1 -0
- package/dist/cjs/internal/paidUsage.js +70 -0
- package/dist/cjs/internal/paidUsage.js.map +7 -0
- package/dist/cjs/internal/printChannel.d.ts +233 -0
- package/dist/cjs/internal/printChannel.d.ts.map +1 -0
- package/dist/cjs/internal/printChannel.js +165 -0
- package/dist/cjs/internal/printChannel.js.map +7 -0
- package/dist/cjs/internal/printsObservation.d.ts +26 -0
- package/dist/cjs/internal/printsObservation.d.ts.map +1 -0
- package/dist/cjs/internal/printsObservation.js +27 -0
- package/dist/cjs/internal/printsObservation.js.map +7 -0
- package/dist/cjs/internal/refusal.d.ts +40 -0
- package/dist/cjs/internal/refusal.d.ts.map +1 -0
- package/dist/cjs/internal/refusal.js +45 -0
- package/dist/cjs/internal/refusal.js.map +7 -0
- package/dist/cjs/internal/supervision.d.ts +174 -0
- package/dist/cjs/internal/supervision.d.ts.map +1 -0
- package/dist/cjs/internal/supervision.js +402 -0
- package/dist/cjs/internal/supervision.js.map +7 -0
- package/dist/cjs/internal/unfinishedWork.d.ts +99 -0
- package/dist/cjs/internal/unfinishedWork.d.ts.map +1 -0
- package/dist/cjs/internal/unfinishedWork.js +80 -0
- package/dist/cjs/internal/unfinishedWork.js.map +7 -0
- package/dist/cjs/internal/unobservedCall.d.ts +112 -0
- package/dist/cjs/internal/unobservedCall.d.ts.map +1 -0
- package/dist/cjs/internal/unobservedCall.js +345 -0
- package/dist/cjs/internal/unobservedCall.js.map +7 -0
- package/dist/cjs/internal/untrustedData.d.ts +14 -0
- package/dist/cjs/internal/untrustedData.d.ts.map +1 -0
- package/dist/cjs/internal/untrustedData.js +30 -0
- package/dist/cjs/internal/untrustedData.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/AgentEvent.d.ts +3092 -0
- package/dist/esm/AgentEvent.d.ts.map +1 -0
- package/dist/esm/AgentEvent.js +1610 -0
- package/dist/esm/AgentEvent.js.map +1 -0
- package/dist/esm/CallLedger.d.ts +378 -0
- package/dist/esm/CallLedger.d.ts.map +1 -0
- package/dist/esm/CallLedger.js +506 -0
- package/dist/esm/CallLedger.js.map +1 -0
- package/dist/esm/Cell.d.ts +774 -0
- package/dist/esm/Cell.d.ts.map +1 -0
- package/dist/esm/Cell.js +772 -0
- package/dist/esm/Cell.js.map +1 -0
- package/dist/esm/CellCalls.d.ts +115 -0
- package/dist/esm/CellCalls.d.ts.map +1 -0
- package/dist/esm/CellCalls.js +97 -0
- package/dist/esm/CellCalls.js.map +1 -0
- package/dist/esm/CellHistory.d.ts +102 -0
- package/dist/esm/CellHistory.d.ts.map +1 -0
- package/dist/esm/CellHistory.js +91 -0
- package/dist/esm/CellHistory.js.map +1 -0
- package/dist/esm/CellTurn.d.ts +1071 -0
- package/dist/esm/CellTurn.d.ts.map +1 -0
- package/dist/esm/CellTurn.js +3410 -0
- package/dist/esm/CellTurn.js.map +1 -0
- package/dist/esm/CellValidation.d.ts +94 -0
- package/dist/esm/CellValidation.d.ts.map +1 -0
- package/dist/esm/CellValidation.js +335 -0
- package/dist/esm/CellValidation.js.map +1 -0
- package/dist/esm/Compaction.d.ts +158 -0
- package/dist/esm/Compaction.d.ts.map +1 -0
- package/dist/esm/Compaction.js +216 -0
- package/dist/esm/Compaction.js.map +1 -0
- package/dist/esm/CompletionClaim.d.ts +801 -0
- package/dist/esm/CompletionClaim.d.ts.map +1 -0
- package/dist/esm/CompletionClaim.js +833 -0
- package/dist/esm/CompletionClaim.js.map +1 -0
- package/dist/esm/ContextWindow.d.ts +435 -0
- package/dist/esm/ContextWindow.d.ts.map +1 -0
- package/dist/esm/ContextWindow.js +427 -0
- package/dist/esm/ContextWindow.js.map +1 -0
- package/dist/esm/EngineLike.d.ts +546 -0
- package/dist/esm/EngineLike.d.ts.map +1 -0
- package/dist/esm/EngineLike.js +218 -0
- package/dist/esm/EngineLike.js.map +1 -0
- package/dist/esm/ExternalTranscript.d.ts +349 -0
- package/dist/esm/ExternalTranscript.d.ts.map +1 -0
- package/dist/esm/ExternalTranscript.js +987 -0
- package/dist/esm/ExternalTranscript.js.map +1 -0
- package/dist/esm/FailedCall.d.ts +132 -0
- package/dist/esm/FailedCall.d.ts.map +1 -0
- package/dist/esm/FailedCall.js +131 -0
- package/dist/esm/FailedCall.js.map +1 -0
- package/dist/esm/FlowBinding.d.ts +289 -0
- package/dist/esm/FlowBinding.d.ts.map +1 -0
- package/dist/esm/FlowBinding.js +376 -0
- package/dist/esm/FlowBinding.js.map +1 -0
- package/dist/esm/HarnessError.d.ts +57 -0
- package/dist/esm/HarnessError.d.ts.map +1 -0
- package/dist/esm/HarnessError.js +85 -0
- package/dist/esm/HarnessError.js.map +1 -0
- package/dist/esm/Judgement.d.ts +289 -0
- package/dist/esm/Judgement.d.ts.map +1 -0
- package/dist/esm/Judgement.js +305 -0
- package/dist/esm/Judgement.js.map +1 -0
- package/dist/esm/Monitor.d.ts +374 -0
- package/dist/esm/Monitor.d.ts.map +1 -0
- package/dist/esm/Monitor.js +370 -0
- package/dist/esm/Monitor.js.map +1 -0
- package/dist/esm/NarrowedCheck.d.ts +523 -0
- package/dist/esm/NarrowedCheck.d.ts.map +1 -0
- package/dist/esm/NarrowedCheck.js +612 -0
- package/dist/esm/NarrowedCheck.js.map +1 -0
- package/dist/esm/Notifications.d.ts +42 -0
- package/dist/esm/Notifications.d.ts.map +1 -0
- package/dist/esm/Notifications.js +215 -0
- package/dist/esm/Notifications.js.map +1 -0
- package/dist/esm/Plan.d.ts +127 -0
- package/dist/esm/Plan.d.ts.map +1 -0
- package/dist/esm/Plan.js +97 -0
- package/dist/esm/Plan.js.map +1 -0
- package/dist/esm/QuickJSSandbox.d.ts +151 -0
- package/dist/esm/QuickJSSandbox.d.ts.map +1 -0
- package/dist/esm/QuickJSSandbox.js +1364 -0
- package/dist/esm/QuickJSSandbox.js.map +1 -0
- package/dist/esm/Relevance.d.ts +213 -0
- package/dist/esm/Relevance.d.ts.map +1 -0
- package/dist/esm/Relevance.js +254 -0
- package/dist/esm/Relevance.js.map +1 -0
- package/dist/esm/Sandbox.d.ts +637 -0
- package/dist/esm/Sandbox.d.ts.map +1 -0
- package/dist/esm/Sandbox.js +464 -0
- package/dist/esm/Sandbox.js.map +1 -0
- package/dist/esm/Steering.d.ts +464 -0
- package/dist/esm/Steering.d.ts.map +1 -0
- package/dist/esm/Steering.js +193 -0
- package/dist/esm/Steering.js.map +1 -0
- package/dist/esm/StructuredOutput.d.ts +252 -0
- package/dist/esm/StructuredOutput.d.ts.map +1 -0
- package/dist/esm/StructuredOutput.js +430 -0
- package/dist/esm/StructuredOutput.js.map +1 -0
- package/dist/esm/Sufficiency.d.ts +195 -0
- package/dist/esm/Sufficiency.d.ts.map +1 -0
- package/dist/esm/Sufficiency.js +207 -0
- package/dist/esm/Sufficiency.js.map +1 -0
- package/dist/esm/Supervisor.d.ts +719 -0
- package/dist/esm/Supervisor.d.ts.map +1 -0
- package/dist/esm/Supervisor.js +575 -0
- package/dist/esm/Supervisor.js.map +1 -0
- package/dist/esm/Tokens.d.ts +86 -0
- package/dist/esm/Tokens.d.ts.map +1 -0
- package/dist/esm/Tokens.js +92 -0
- package/dist/esm/Tokens.js.map +1 -0
- package/dist/esm/Transcript.d.ts +171 -0
- package/dist/esm/Transcript.d.ts.map +1 -0
- package/dist/esm/Transcript.js +424 -0
- package/dist/esm/Transcript.js.map +1 -0
- package/dist/esm/TruncatedOutput.d.ts +186 -0
- package/dist/esm/TruncatedOutput.d.ts.map +1 -0
- package/dist/esm/TruncatedOutput.js +257 -0
- package/dist/esm/TruncatedOutput.js.map +1 -0
- package/dist/esm/UnmovedTree.d.ts +113 -0
- package/dist/esm/UnmovedTree.d.ts.map +1 -0
- package/dist/esm/UnmovedTree.js +90 -0
- package/dist/esm/UnmovedTree.js.map +1 -0
- package/dist/esm/UnresolvedFailure.d.ts +196 -0
- package/dist/esm/UnresolvedFailure.d.ts.map +1 -0
- package/dist/esm/UnresolvedFailure.js +218 -0
- package/dist/esm/UnresolvedFailure.js.map +1 -0
- package/dist/esm/VacuousVerification.d.ts +237 -0
- package/dist/esm/VacuousVerification.d.ts.map +1 -0
- package/dist/esm/VacuousVerification.js +245 -0
- package/dist/esm/VacuousVerification.js.map +1 -0
- package/dist/esm/VariablesPanel.d.ts +117 -0
- package/dist/esm/VariablesPanel.d.ts.map +1 -0
- package/dist/esm/VariablesPanel.js +142 -0
- package/dist/esm/VariablesPanel.js.map +1 -0
- package/dist/esm/index.d.ts +172 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +172 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/bytes.d.ts +36 -0
- package/dist/esm/internal/bytes.d.ts.map +1 -0
- package/dist/esm/internal/bytes.js +70 -0
- package/dist/esm/internal/bytes.js.map +1 -0
- package/dist/esm/internal/cellPrompt.d.ts +122 -0
- package/dist/esm/internal/cellPrompt.d.ts.map +1 -0
- package/dist/esm/internal/cellPrompt.js +276 -0
- package/dist/esm/internal/cellPrompt.js.map +1 -0
- package/dist/esm/internal/compactable.d.ts +44 -0
- package/dist/esm/internal/compactable.d.ts.map +1 -0
- package/dist/esm/internal/compactable.js +71 -0
- package/dist/esm/internal/compactable.js.map +1 -0
- package/dist/esm/internal/compactionMarks.d.ts +278 -0
- package/dist/esm/internal/compactionMarks.d.ts.map +1 -0
- package/dist/esm/internal/compactionMarks.js +317 -0
- package/dist/esm/internal/compactionMarks.js.map +1 -0
- package/dist/esm/internal/demandText.d.ts +95 -0
- package/dist/esm/internal/demandText.d.ts.map +1 -0
- package/dist/esm/internal/demandText.js +128 -0
- package/dist/esm/internal/demandText.js.map +1 -0
- package/dist/esm/internal/elide.d.ts +109 -0
- package/dist/esm/internal/elide.d.ts.map +1 -0
- package/dist/esm/internal/elide.js +123 -0
- package/dist/esm/internal/elide.js.map +1 -0
- package/dist/esm/internal/frame.d.ts +463 -0
- package/dist/esm/internal/frame.d.ts.map +1 -0
- package/dist/esm/internal/frame.js +861 -0
- package/dist/esm/internal/frame.js.map +1 -0
- package/dist/esm/internal/nonNegativeSafeInt.d.ts +20 -0
- package/dist/esm/internal/nonNegativeSafeInt.d.ts.map +1 -0
- package/dist/esm/internal/nonNegativeSafeInt.js +20 -0
- package/dist/esm/internal/nonNegativeSafeInt.js.map +1 -0
- package/dist/esm/internal/paidUsage.d.ts +52 -0
- package/dist/esm/internal/paidUsage.d.ts.map +1 -0
- package/dist/esm/internal/paidUsage.js +72 -0
- package/dist/esm/internal/paidUsage.js.map +1 -0
- package/dist/esm/internal/printChannel.d.ts +233 -0
- package/dist/esm/internal/printChannel.d.ts.map +1 -0
- package/dist/esm/internal/printChannel.js +376 -0
- package/dist/esm/internal/printChannel.js.map +1 -0
- package/dist/esm/internal/printsObservation.d.ts +26 -0
- package/dist/esm/internal/printsObservation.d.ts.map +1 -0
- package/dist/esm/internal/printsObservation.js +29 -0
- package/dist/esm/internal/printsObservation.js.map +1 -0
- package/dist/esm/internal/refusal.d.ts +40 -0
- package/dist/esm/internal/refusal.d.ts.map +1 -0
- package/dist/esm/internal/refusal.js +47 -0
- package/dist/esm/internal/refusal.js.map +1 -0
- package/dist/esm/internal/supervision.d.ts +174 -0
- package/dist/esm/internal/supervision.d.ts.map +1 -0
- package/dist/esm/internal/supervision.js +485 -0
- package/dist/esm/internal/supervision.js.map +1 -0
- package/dist/esm/internal/unfinishedWork.d.ts +99 -0
- package/dist/esm/internal/unfinishedWork.d.ts.map +1 -0
- package/dist/esm/internal/unfinishedWork.js +85 -0
- package/dist/esm/internal/unfinishedWork.js.map +1 -0
- package/dist/esm/internal/unobservedCall.d.ts +112 -0
- package/dist/esm/internal/unobservedCall.d.ts.map +1 -0
- package/dist/esm/internal/unobservedCall.js +501 -0
- package/dist/esm/internal/unobservedCall.js.map +1 -0
- package/dist/esm/internal/untrustedData.d.ts +14 -0
- package/dist/esm/internal/untrustedData.d.ts.map +1 -0
- package/dist/esm/internal/untrustedData.js +15 -0
- package/dist/esm/internal/untrustedData.js.map +1 -0
- package/docs/README.md +129 -0
- package/docs/api.md +1869 -0
- package/docs/concepts.md +238 -0
- package/docs/external-transcripts.md +245 -0
- package/docs/guides/bind-flows.md +167 -0
- package/docs/guides/drive-the-loop.md +265 -0
- package/docs/guides/run-cells.md +262 -0
- package/docs/guides/workerd.md +144 -0
- package/docs/installation.md +69 -0
- package/docs/quickstart.md +121 -0
- package/docs/reference.md +954 -0
- package/docs/troubleshooting.md +177 -0
- package/package.json +463 -3
- package/src/AgentEvent.ts +1772 -0
- package/src/CallLedger.ts +560 -0
- package/src/Cell.ts +926 -0
- package/src/CellCalls.ts +198 -0
- package/src/CellHistory.ts +128 -0
- package/src/CellTurn.ts +4450 -0
- package/src/CellValidation.ts +382 -0
- package/src/Compaction.ts +330 -0
- package/src/CompletionClaim.ts +1013 -0
- package/src/ContextWindow.ts +669 -0
- package/src/EngineLike.ts +614 -0
- package/src/ExternalTranscript.ts +1143 -0
- package/src/FailedCall.ts +163 -0
- package/src/FlowBinding.ts +603 -0
- package/src/HarnessError.ts +98 -0
- package/src/Judgement.ts +526 -0
- package/src/Monitor.ts +579 -0
- package/src/NarrowedCheck.ts +694 -0
- package/src/Notifications.ts +262 -0
- package/src/Plan.ts +113 -0
- package/src/QuickJSSandbox.ts +1557 -0
- package/src/Relevance.ts +352 -0
- package/src/Sandbox.ts +908 -0
- package/src/Steering.ts +405 -0
- package/src/StructuredOutput.ts +484 -0
- package/src/Sufficiency.ts +247 -0
- package/src/Supervisor.ts +798 -0
- package/src/Tokens.ts +108 -0
- package/src/Transcript.ts +513 -0
- package/src/TruncatedOutput.ts +297 -0
- package/src/UnmovedTree.ts +121 -0
- package/src/UnresolvedFailure.ts +240 -0
- package/src/VacuousVerification.ts +280 -0
- package/src/VariablesPanel.ts +165 -0
- package/src/index.ts +204 -0
- package/src/internal/bytes.ts +70 -0
- package/src/internal/cellPrompt.ts +337 -0
- package/src/internal/compactable.ts +76 -0
- package/src/internal/compactionMarks.ts +454 -0
- package/src/internal/demandText.ts +145 -0
- package/src/internal/elide.ts +130 -0
- package/src/internal/frame.ts +1178 -0
- package/src/internal/nonNegativeSafeInt.ts +24 -0
- package/src/internal/paidUsage.ts +90 -0
- package/src/internal/printChannel.ts +434 -0
- package/src/internal/printsObservation.ts +31 -0
- package/src/internal/refusal.ts +53 -0
- package/src/internal/supervision.ts +652 -0
- package/src/internal/unfinishedWork.ts +123 -0
- package/src/internal/unobservedCall.ts +536 -0
- package/src/internal/untrustedData.ts +19 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/EngineLike.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Narrow engine port consumed by the built-in harness.\n *\n * Governing contracts: `../docs/concepts.md#durable-cell-loop`,\n * `../docs/concepts.md#child-plans-and-the-splice-boundary`, and\n * `../docs/concepts.md#step-keys-and-the-model-layer`.\n *\n * @since 0.1.0\n */\n\nimport type * as KeyMaterial from \"@smthrs/core/KeyMaterial\"\nimport type * as Model from \"@smthrs/model/Model\"\nimport type * as ModelEvent from \"@smthrs/model/ModelEvent\"\nimport type * as ModelRequest from \"@smthrs/model/ModelRequest\"\nimport { Context, Effect, Layer, Option, Schema, Stream } from \"effect\"\nimport type * as AgentEvent from \"./AgentEvent.ts\"\nimport type * as Cell from \"./Cell.ts\"\nimport { HarnessError } from \"./HarnessError.ts\"\nimport type * as Plan from \"./Plan.ts\"\n\n/**\n * Stable reasons for parking a harness turn at a safe boundary.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport const SuspendReasonCode = Schema.Literals([\n \"permission-required\",\n \"waiting-quota\",\n \"waiting-input\",\n \"waiting-event\",\n \"engine\"\n])\n\n/**\n * Stable reasons for parking a harness turn at a safe boundary.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type SuspendReasonCode = typeof SuspendReasonCode.Type\n\n/**\n * A serializable request to park the current engine frame.\n *\n * `details` is a closed JSON value rather than `Schema.Unknown`, for the reason\n * `HarnessError`'s `cause` is a `Schema.Defect`: this value is journaled inside\n * `AgentEvent.Suspended` and served back to whatever resumes the run, so it has\n * to be something the durable exit schema can encode. `Schema.Unknown` accepts\n * a live `Error`, a function, a `BigInt`, a cycle and an accessor, and the\n * controller was in fact attaching a `Permission.PermissionRequired` \u2014 a class\n * that extends `Error` \u2014 to every permission park. What a park carries is now\n * encoded before it is attached, so the journal holds the same value a resumed\n * run decodes.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport class SuspendReason extends Schema.Class<SuspendReason>(\"flows/harness/EngineLike/SuspendReason\")({\n code: SuspendReasonCode,\n message: Schema.String,\n details: Schema.optional(Schema.Json)\n}) {}\n\n/**\n * A sealed model request and the complete digest-free material declared by the\n * harness.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface SealedModelStep {\n readonly request: ModelRequest.ModelRequest\n readonly keyMaterial: KeyMaterial.KeyMaterial\n /**\n * Wall-clock milliseconds one attempt at this step may spend; zero disarms.\n *\n * The budget travels on the step rather than on the engine's construction so\n * the number the controller journals as armed is the number the engine\n * enforces \u2014 one value, read from the controller's own state, and no way for\n * a run's record of its discipline to disagree with the discipline it ran\n * under.\n *\n * It is not key material and must never become key material: it says how\n * long the caller will wait, not what the model was asked, and a step keyed\n * on it would miss its cache the moment a host retuned the budget.\n */\n readonly modelCallMs?: number | undefined\n}\n\n/**\n * The durable identity of one journaled controller boundary.\n *\n * `boundary` is a deterministic label for the boundary within its frame \u2014 a\n * cell digest or a context digest \u2014 so re-executing the frame derives the same\n * identity and replays the recorded value instead of performing the read\n * again.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface BoundaryIdentity {\n /** The durable session or lineage the boundary belongs to, when the loop has one. */\n readonly session?: string | undefined\n readonly frame: number\n readonly boundary: string\n}\n\n/**\n * A schema that decodes without services \u2014 the only kind a durable store can\n * reconstruct a journaled value with.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type DurableSchema<A> = Schema.Schema<A> & { readonly \"DecodingServices\": never }\n\n/**\n * One nondeterministic read the controller must perform exactly once per run.\n *\n * The canonical example is the turn-boundary steering drain: the host queue is\n * the world, and draining it is an effect. Left unjournaled, a resumed run\n * drains an already-drained queue, rebuilds a different context than the\n * original attempt, re-keys every later sealed step, and re-executes\n * irreversible effects. Recorded through {@link EngineLike.record}, the drain\n * replays its recorded value and the resumed run converges on the original\n * attempt.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface RecordBoundary<A> {\n readonly name: string\n readonly identity: BoundaryIdentity\n readonly success: DurableSchema<A>\n readonly execute: Effect.Effect<A, HarnessError>\n /** Exact call whose delivered result this existing cell-call boundary records. */\n readonly call?: Cell.Call | undefined\n /**\n * The model usage the recorded value says this boundary paid for, such as\n * an evaluator reading taken inside `execute`, one share per model.\n *\n * Read off the recorded value, never off the live call, so a replayed frame\n * reports the same spend the original attempt paid. An implementation that\n * keeps a run budget accounts it once under this boundary's key, on the\n * live pass and on replay alike, pricing each share under its model id, so\n * the next paid call is admitted against it. Declaring it declares the\n * boundary paid: unless it is {@link advisory}, such an implementation\n * admits it before `execute` under the budget's evaluator-reading policy,\n * and a refusal fails or parks the run as a primary call's would.\n * `undefined` or an empty list from it is a boundary that paid for nothing\n * this time.\n */\n // A method, so a boundary over a narrower value is still a `RecordBoundary<unknown>`.\n usage?(value: A): ReadonlyArray<Paid> | undefined\n /**\n * A paid boundary whose caller drops its failure, such as the supervisor's\n * reading in its own fiber: it is charged but never admitted, because a\n * refusal there would register a park that no frame honours. The frame's\n * next primary call applies the budget instead.\n */\n readonly advisory?: boolean | undefined\n}\n\n/**\n * One model's share of what a recorded boundary paid.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport interface Paid {\n readonly usage: ModelEvent.Usage\n /** The model that was paid, when the reading named it: what prices the share. */\n readonly modelId?: string | undefined\n}\n\n/**\n * One measurement of the workspace the run is changing.\n *\n * The controller never interprets `digest`; it only asks whether two\n * measurements are equal. That is deliberate \u2014 the host owns what \"the\n * workspace\" means (which paths it covers, and what it reads off each one),\n * and the only thing the loop is entitled to conclude is \"this is the tree I\n * left\" or \"this is not\". `paths` is carried for the journal, so a reader can\n * tell an observation over 7,000 files from one over an empty root.\n *\n * `complete` is the answer to the one question that makes \"this is the tree I\n * left\" meaningful. A measurement that stopped at a bound covers a prefix of\n * the workspace, and a prefix cannot say that the rest of it held still \u2014 a\n * checkout larger than the host's bound would otherwise report every frame as\n * idle, and the read-only cap would fail a run that had been editing the whole\n * time. A host that does not narrow its own measurement leaves it `true`.\n *\n * @category models\n * @since 0.1.0\n */\nexport class Observation extends Schema.Class<Observation>(\"flows/harness/EngineLike/Observation\")({\n /** A content address of everything the measurement covered, taken together. */\n digest: Schema.String,\n /** How many paths the measurement covered. */\n paths: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n /** Whether the measurement covered the whole tree it was asked to measure. */\n complete: Schema.Boolean.pipe(\n Schema.withConstructorDefault(Effect.succeed(true)),\n Schema.withDecodingDefaultKey(Effect.succeed(true))\n ),\n /**\n * How long the measurement took, in milliseconds, so a slow frame can be\n * attributed. Absent from a measurement recorded before it was kept.\n */\n elapsedMs: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))\n}) {}\n\n/**\n * One pinned tree the run can come back to.\n *\n * A checkpoint is a **value**, not a place the run goes: minting one changes\n * nothing about the workspace, and running a call against one leaves the live\n * tree exactly as it stands. That is the whole point. Before this existed, the\n * only way to answer \"did this command fail before my change\" was to undo the\n * change, and `sympy__sympy-13878` shows what that costs \u2014 one byte-identical\n * 4,789-character patch applied five times, four of those applications preceded\n * by `git checkout -- sympy/stats/crv_types.py`, because a clean proof required\n * reverting the very work it was meant to prove.\n *\n * `ref` is the host's own name for what it pinned \u2014 a commit id, a snapshot\n * key, whatever the store speaks. The controller never interprets it, exactly\n * as it never interprets {@link Observation.digest}; it is carried so the\n * journal says which tree a checkpointed call ran against and a grader can\n * reconcile the reading against the store by hand.\n *\n * @category models\n * @since 0.1.0\n */\nexport class Snapshot extends Schema.Class<Snapshot>(\"flows/harness/EngineLike/Snapshot\")({\n /** The id the cell holds, and the id a later call names in `at`. */\n id: Schema.String,\n /** What the host recorded, in the host's own vocabulary. */\n ref: Schema.String\n}) {}\n\n/**\n * The names of the route one model request resolves to.\n *\n * Names and nothing else. A route is an endpoint, a protocol and the\n * credentials it authorizes with, and only the first two have a name a journal\n * may carry: this is read off the credential-free `Route.PreparedRequest` the\n * sealed step is keyed on, which is built before any secret is signed onto the\n * request. So there is no field here a credential could travel in.\n *\n * @category models\n * @since 1.0.0-rc.0\n */\nexport class Binding extends Schema.Class<Binding>(\"flows/harness/EngineLike/Binding\")({\n /** The configured route's id, as `Route.PreparedRequest.routeId` names it. */\n routeId: Schema.String,\n /** The wire protocol that route speaks, as `Route.PreparedRequest.protocolId` names it. */\n protocolId: Schema.String\n}) {}\n\n/**\n * What one model request resolves to on its way out of the host.\n *\n * @category models\n * @since 1.0.0-rc.0\n */\nexport interface Resolved {\n /** The request the provider is sent, after any rewrite the host applies. */\n readonly request: ModelRequest.ModelRequest\n /** The route it goes to, or none where the host names none. */\n readonly binding: Option.Option<Binding>\n}\n\n/**\n * A request to pin the workspace as it stands right now.\n *\n * `identity` travels with it so a store *can* namespace what it writes by the\n * run that wrote it: two runs over one workspace mint `id` values from the same\n * frame-and-ordinal counter, so a store that keys on the id alone hands the\n * second run the first run's tree. `@smthrs/std/Checkpoints`'s git store keys\n * on the id alone and is right to: it also materializes at one path per id, as\n * `TestRun`'s baseline worktree does, so two concurrent runs over one workspace\n * collide on the checkout before they collide on the name. One workspace holds\n * one run \u2014 that is the assumption the whole workspace layer already makes, and\n * this field is what a store that stops making it would namespace by.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface CaptureRequest {\n readonly id: string\n readonly identity: BoundaryIdentity\n}\n\n/**\n * The engine operations required by harness translation.\n *\n * @category services\n * @since 0.1.0\n * @slop\n */\nexport interface EngineLike {\n /**\n * Runs one sealed model step.\n *\n * The harness contributes the assembled-context input, resolved layer set,\n * capability envelope, effect tier, placement, and provider-neutral\n * `ModelRequest` as core key material. The step-key contract\n * (`../docs/concepts.md#step-keys-and-the-model-layer`) requires the exact\n * wire request in the key, so route resolution happens before the key is\n * sealed. An implementation MUST therefore resolve the route, run\n * `Route.prepare` (`/model/Route`), and digest the credential-free\n * `PreparedRequest` \u2014 canonical body bytes included \u2014 together with\n * declared material into the sealed-step key before executing. A provider\n * wire change must produce a new key; credentials are signed on after the\n * digest and never enter it.\n */\n readonly sealStep: (\n step: SealedModelStep\n ) => Stream.Stream<ModelEvent.ModelEvent, Model.ModelFailure | HarnessError>\n /** Optionally emits capacity transitions while sealing the same frame. */\n readonly sealStepWithEvents?: (\n step: SealedModelStep,\n emit: (event: AgentEvent.AgentEvent) => Effect.Effect<void>\n ) => Stream.Stream<ModelEvent.ModelEvent, Model.ModelFailure | HarnessError>\n readonly splice: (\n batch: Plan.Batch\n ) => Stream.Stream<Plan.SpliceEvent, HarnessError>\n /**\n * Runs one flow call issued from inside a running cell.\n *\n * This is the cell path's whole effectful surface, and it is deliberately\n * one call at a time: a cell derives the second call's input from the first\n * call's result, so there is no batch to hand over. The implementation owns\n * durability \u2014 the call is a keyed, journaled activity at the tier the flow\n * declares, keyed by `call.identity` so a settled boundary replays instead of\n * re-running when the cell is re-executed after a crash or a permission park.\n *\n * A flow that fails settles as a `failure` {@link Cell.CallResult}, which the\n * cell observes as a resolved `{ ok: false, error }` envelope, not a throw.\n * It branches on `.ok === false` and `.error.code` to recover; success\n * resolves with the flow's own value, unwrapped. A permission requirement, an\n * abort, or an engine failure travels in the error channel instead, so the\n * cell never sees \u2014 and can never swallow \u2014 a park.\n */\n readonly call: (call: Cell.Call) => Effect.Effect<Cell.CallResult, HarnessError>\n /**\n * Decides a call's authority before the per-call clock starts.\n *\n * A person answering an approval is not the flow running slowly, so the\n * controller asks here first and times only {@link call}. `undefined`\n * admits the call; a result is the refusal the cell reads instead, and the\n * call is never issued. A park or an engine failure travels in the error\n * channel, exactly as it does from `call`. An implementation that admits a\n * call does not ask again when that call is issued.\n */\n readonly admit?: (call: Cell.Call) => Effect.Effect<Cell.CallResult | undefined, HarnessError>\n /**\n * The host's runaway guard for timeouts, when it has one.\n *\n * A tool call or a cell that ran past its time limit is otherwise the cell's\n * to read. A host that guards timeouts parks the run on it instead, for an\n * operator's Continue or Stop, and the controller records nothing for the\n * timed-out operation, so Continue runs it again.\n */\n readonly guard?: Guard\n /**\n * Journals one nondeterministic controller read as a durable boundary.\n *\n * The controller's state is rebuilt by re-execution, so every read of the\n * world it makes between sealed steps must be recorded: the implementation\n * runs `execute` once, journals the outcome under a run-scoped key derived\n * from `name` and `identity` TOGETHER, and serves the recorded value to any\n * later re-execution of the same frame. A read that bypasses this boundary is\n * a replay divergence \u2014 and, downstream of one, duplicate irreversible\n * effects.\n *\n * `(name, identity)` is the key, and both halves are load-bearing: one frame\n * issues several records that share a session, a frame number and a boundary\n * and differ only in what they are for. An implementation that keys on\n * `identity` alone serves one frame's opening workspace measurement as its\n * closing one. The controller also folds each boundary's purpose into\n * `identity.boundary`, so it stays correct under an implementation that reads\n * the contract the other way, but an implementation must key on both.\n */\n readonly record: <A>(boundary: RecordBoundary<A>) => Effect.Effect<A, HarnessError>\n /**\n * Measures the workspace as it stands right now.\n *\n * This is what makes the loop's mutation accounting honest. Every other\n * signal the controller has about \"did this frame change anything\" is a\n * *declaration*: a flow's registry envelope, or the write set an invocation\n * claimed. A shell command declares neither \u2014 spawning a process is the one\n * call whose effects do not travel through any boundary the harness can\n * read \u2014 so a run whose only edits went through `bash` looked, to every\n * control, exactly like a run that did nothing. Comparing two measurements\n * around a frame answers the question from the world instead of from the\n * paperwork.\n *\n * `Option.none()` is the honest answer for a host with no workspace to\n * measure, or none it can measure cheaply. It is not an error and it is not\n * \"nothing changed\": the controller reads it as \"unobserved\" and falls back\n * to declared writes, and says in the journal which basis it used.\n *\n * The result is nondeterministic, so the controller journals it through\n * {@link EngineLike.record} rather than calling this on a replayed frame.\n */\n readonly observe: Effect.Effect<Option.Option<Observation>, HarnessError>\n /**\n * Pins the workspace as it stands right now, under the id the caller gives.\n *\n * This is the sibling of {@link EngineLike.observe} and it is deliberately a\n * different operation: `observe` answers \"is this the tree I left\", which\n * needs only a digest, while this has to be able to hand the tree back later.\n * The pin happens where the call happens \u2014 a cell that mints between two\n * edits gets the tree between those two edits \u2014 which is what makes\n * `ctx.checkpoint()` mean anything at the line it is written on.\n *\n * `Option.none()` is the honest answer for a host with no store to pin into,\n * exactly as it is for `observe`. It is not an error: the controller answers\n * the cell with a resolved `checkpoint_unavailable` failure, and the run\n * carries on taking its readings from the live tree.\n *\n * The result is nondeterministic, so the controller journals it through\n * {@link EngineLike.record} rather than calling this on a replayed frame.\n */\n readonly capture: (request: CaptureRequest) => Effect.Effect<Option.Option<Snapshot>, HarnessError>\n /**\n * Says what one request will actually be asked as, for the record of it.\n *\n * Two things stand between the request the controller builds and the call a\n * provider receives, and both belong to the host: a composition may rewrite\n * the request on its way out, and a route decides where it goes. The record\n * of a model call has to be of the call that was made, so the controller\n * asks here before it seals and journals the answer.\n *\n * Optional, and total where it exists. A host that rewrites nothing and\n * names no route omits it, and the controller records the request it built.\n *\n * `Option.none()` is the honest answer for a request the host cannot say\n * anything true about: its own rewrite failed, or no route accepts what the\n * rewrite produced. The controller then journals no request for that call,\n * because the only request it holds is one no provider would be sent, and a\n * record that presented it as sent would prefill a call that never\n * happened. It is not an error. The resolution that matters is the one\n * {@link EngineLike.sealStep} performs, and that is where the same request\n * fails with its typed error. A host that answers none here MUST fail that\n * sealed step, and with the failure it already met rather than a second run\n * of whatever produced it: a rewrite asked twice may answer twice.\n *\n * Pure in the request and the composition, so it is asked again on a\n * replayed frame rather than journaled: the same request under the same\n * composition resolves the same way, and a composition that has since\n * changed has changed the sealed key too, so the call it describes is a new\n * one.\n */\n readonly resolve?: (request: ModelRequest.ModelRequest) => Effect.Effect<Option.Option<Resolved>>\n readonly suspend: (reason: SuspendReason) => Effect.Effect<never, HarnessError>\n}\n\n/**\n * Context service for the harness engine boundary.\n *\n * @category services\n * @since 0.1.0\n * @slop\n */\nexport const EngineLike: Context.Service<EngineLike, EngineLike> = Context.Service(\n \"@smthrs/harness/EngineLike\"\n)\n\n/**\n * Constructs an engine port from an implementation.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const make = (implementation: EngineLike): EngineLike => EngineLike.of(implementation)\n\n/**\n * The {@link Guard} subject of one cell call: its session, frame and settled\n * boundary. A host keys what the guard decided for a call (how many times the\n * operator chose Continue) by the subject the controller admits it under.\n *\n * @category constructors\n * @since 1.0.0-rc.1\n */\nexport const callSubject = (identity: Pick<Cell.CallIdentity, \"session\" | \"frame\" | \"cell\" | \"ordinal\">): string =>\n JSON.stringify({\n session: identity.session,\n frame: identity.frame,\n boundary: `cell-call:${identity.cell}:${identity.ordinal}`\n })\n\n/**\n * One operation that ran past its time limit, as the controller reports it to\n * {@link Guard.trip}.\n *\n * `subject` is the operation's replay-stable identity. `limitMillis` is\n * absent when the operation reported its own timeout without its limit.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport interface TimedOut {\n readonly source: \"tool-call\" | \"cell\"\n readonly subject: string\n readonly limitMillis?: number | undefined\n readonly message: string\n}\n\n/**\n * A host's runaway guard for tool-call and cell timeouts; see\n * {@link EngineLike.guard}.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport interface Guard {\n /**\n * Admits an operation before it runs. A park whose question is still open,\n * or the failure a Stop settles the run with, travels in the error channel.\n * A host re-issues a cell call the operator continued under a key of its\n * own, since the timed-out attempt may have settled durably under the old\n * one (a command's own timeout does).\n */\n readonly admit: (subject: string) => Effect.Effect<void, HarnessError>\n /**\n * Reports a timeout. Succeeds when this run's timeouts are not guarded, so\n * the caller keeps its timeout; otherwise fails with the park.\n */\n readonly trip: (timeout: TimedOut) => Effect.Effect<void, HarnessError>\n}\n\n/**\n * Provides an engine port implementation.\n *\n * @category layers\n * @since 0.1.0\n * @slop\n */\nexport const layer = (implementation: EngineLike): Layer.Layer<EngineLike> =>\n Layer.succeed(EngineLike)(make(implementation))\n\n/**\n * What one request resolves to on this engine.\n *\n * The answer of {@link EngineLike.resolve} where the host gives one, and\n * otherwise the honest default: the request as it was built, going to no route\n * anybody named. Written once, here, because a port that wraps another port\n * needs the same default the controller does. None is the host's own answer\n * and never the default: a port with no `resolve` sends what it was handed.\n *\n * @category conversions\n * @since 1.0.0-rc.0\n */\nexport const resolve = (\n engine: EngineLike,\n request: ModelRequest.ModelRequest\n): Effect.Effect<Option.Option<Resolved>> =>\n engine.resolve === undefined\n ? Effect.succeed(Option.some({ request, binding: Option.none() }))\n : engine.resolve(request)\n\nconst unavailable = (operation: string, code: \"engine_failed\" | \"suspended\" = \"engine_failed\"): HarnessError =>\n new HarnessError({\n code,\n message: `${operation} is unavailable`\n })\n\n/**\n * Constructs an unavailable engine stub, optionally overriding operations.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const makeNoop = (overrides: Partial<EngineLike> = {}): EngineLike =>\n EngineLike.of({\n sealStep: () =>\n Stream.unwrap(Effect.fn(\"EngineLike.sealStep\")(() => Effect.succeed(Stream.fail(unavailable(\"sealStep\"))))()),\n splice: () => Stream.fail(unavailable(\"splice\")),\n call: Effect.fn(\"EngineLike.call\")(() => Effect.fail(unavailable(\"call\"))),\n record: Effect.fn(\"EngineLike.record\")(() => Effect.fail(unavailable(\"record\"))),\n // Unobservable rather than unavailable. A stub engine has no workspace, and\n // the honest report of that is \"I measured nothing\" \u2014 which the controller\n // already knows how to read. Failing here instead would turn a host that\n // simply has no tree into a failed run.\n observe: Effect.succeed(Option.none()),\n // Unpinnable for the same reason, and reported the same way: a stub engine\n // has no store to pin a tree into, and the controller reads the absence as\n // a resolved refusal the cell can route around.\n capture: () => Effect.succeed(Option.none()),\n suspend: Effect.fn(\"EngineLike.suspend\")(() => Effect.fail(unavailable(\"suspend\", \"suspended\"))),\n ...overrides\n })\n\n/**\n * Provides an unavailable engine stub.\n *\n * @category layers\n * @since 0.1.0\n * @slop\n */\nexport const layerNoop = (overrides: Partial<EngineLike> = {}): Layer.Layer<EngineLike> =>\n Layer.succeed(EngineLike)(makeNoop(overrides))\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The conversations of agents a person runs beside Smithers, decoded from the agent's own transcript file
|
|
3
|
+
* into ordered, read-only entries (mvp.md M-38, ui-components.md T-UI-07 S2).
|
|
4
|
+
*
|
|
5
|
+
* Every entry carries its origin, agent kind, format version, session, source record identity and
|
|
6
|
+
* `read_only: true`; who the owner and the agent participant are is the caller's to say, never the
|
|
7
|
+
* transcript's. Decoding is pure: the caller supplies bytes in any chunking and keeps the returned state,
|
|
8
|
+
* so a growing file is tailed by decoding only what was appended. An incomplete last line waits for more
|
|
9
|
+
* bytes. A complete line that is not a record, a transcript without a version, a version this module does
|
|
10
|
+
* not support, and a record, event, item or content block this module does not name are tagged errors,
|
|
11
|
+
* never a guess: every skipped kind is listed below by name.
|
|
12
|
+
*
|
|
13
|
+
* Codex: `rollout-*.jsonl` files under `$CODEX_HOME/sessions`, profile `codex-rollout/<major.minor>` from
|
|
14
|
+
* the CLI release in `session_meta`. Items come from `event_msg` `item_completed` rows. `response_item` rows
|
|
15
|
+
* repeat them for the model and are skipped, except three the items leave out: a message between agents
|
|
16
|
+
* (`agent_message`), whose encrypted body is one placeholder; a code-mode script that failed
|
|
17
|
+
* (`custom_tool_call_output`), with the request that started it; and nothing else.
|
|
18
|
+
*
|
|
19
|
+
* Claude Code: `<session>.jsonl` files under `~/.claude/projects/<project>`, profile `claude-code/<major.minor>`
|
|
20
|
+
* from the `version` every conversation record carries. A tool call becomes one entry when its result arrives;
|
|
21
|
+
* the named bookkeeping rows outside the conversation chain (no `uuid`) are skipped.
|
|
22
|
+
*
|
|
23
|
+
* @since 1.0.0-rc.1
|
|
24
|
+
*/
|
|
25
|
+
import { Result, Schema } from "effect";
|
|
26
|
+
/**
|
|
27
|
+
* The agents whose transcripts decode here.
|
|
28
|
+
*
|
|
29
|
+
* @category models
|
|
30
|
+
* @since 1.0.0-rc.1
|
|
31
|
+
*/
|
|
32
|
+
export declare const AgentKind: Schema.Literals<readonly ["codex", "claude-code"]>;
|
|
33
|
+
/**
|
|
34
|
+
* The value decoded by {@link AgentKind}.
|
|
35
|
+
*
|
|
36
|
+
* @category models
|
|
37
|
+
* @since 1.0.0-rc.1
|
|
38
|
+
*/
|
|
39
|
+
export type AgentKind = typeof AgentKind.Type;
|
|
40
|
+
/**
|
|
41
|
+
* One edited file as the agent reported it: its path, the kind of change and the unified diff.
|
|
42
|
+
*
|
|
43
|
+
* @category models
|
|
44
|
+
* @since 1.0.0-rc.1
|
|
45
|
+
*/
|
|
46
|
+
export declare const EditedFile: Schema.Struct<{
|
|
47
|
+
readonly path: Schema.String;
|
|
48
|
+
readonly change: Schema.Literals<readonly ["added", "modified", "deleted", "renamed"]>;
|
|
49
|
+
readonly renamed_to: Schema.optional<Schema.String>;
|
|
50
|
+
readonly diff: Schema.String;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* What one entry says. Tool parts keep the agent's correlation id; edits keep the path and the reported
|
|
54
|
+
* outcome; a body the agent encrypted is a placeholder in its place, never dropped.
|
|
55
|
+
*
|
|
56
|
+
* @category models
|
|
57
|
+
* @since 1.0.0-rc.1
|
|
58
|
+
*/
|
|
59
|
+
export declare const Part: Schema.Union<readonly [Schema.Struct<{
|
|
60
|
+
readonly type: Schema.Literal<"prompt">;
|
|
61
|
+
readonly text: Schema.String;
|
|
62
|
+
}>, Schema.Struct<{
|
|
63
|
+
readonly type: Schema.Literal<"goal">;
|
|
64
|
+
readonly objective: Schema.String;
|
|
65
|
+
readonly status: Schema.String;
|
|
66
|
+
}>, Schema.Struct<{
|
|
67
|
+
readonly type: Schema.Literal<"text">;
|
|
68
|
+
readonly text: Schema.String;
|
|
69
|
+
readonly final: Schema.Boolean;
|
|
70
|
+
}>, Schema.Struct<{
|
|
71
|
+
readonly type: Schema.Literal<"reasoning">;
|
|
72
|
+
readonly text: Schema.String;
|
|
73
|
+
}>, Schema.Struct<{
|
|
74
|
+
readonly type: Schema.Literal<"encrypted">;
|
|
75
|
+
}>, Schema.Struct<{
|
|
76
|
+
readonly type: Schema.Literal<"tool">;
|
|
77
|
+
readonly call_id: Schema.String;
|
|
78
|
+
readonly command: Schema.String;
|
|
79
|
+
/** Set when every part of the command only reads, searches or lists: "Read mvp.md". */
|
|
80
|
+
readonly reads: Schema.$Array<Schema.String>;
|
|
81
|
+
readonly status: Schema.Literals<readonly ["ok", "error", "running"]>;
|
|
82
|
+
readonly exit_code: Schema.optional<Schema.Number>;
|
|
83
|
+
readonly output: Schema.String;
|
|
84
|
+
readonly duration_ms: Schema.Number;
|
|
85
|
+
}>, Schema.Struct<{
|
|
86
|
+
readonly type: Schema.Literal<"edit">;
|
|
87
|
+
readonly call_id: Schema.String;
|
|
88
|
+
readonly files: Schema.$Array<Schema.Struct<{
|
|
89
|
+
readonly path: Schema.String;
|
|
90
|
+
readonly change: Schema.Literals<readonly ["added", "modified", "deleted", "renamed"]>;
|
|
91
|
+
readonly renamed_to: Schema.optional<Schema.String>;
|
|
92
|
+
readonly diff: Schema.String;
|
|
93
|
+
}>>;
|
|
94
|
+
readonly outcome: Schema.Literals<readonly ["applied", "failed"]>;
|
|
95
|
+
}>, Schema.Struct<{
|
|
96
|
+
readonly type: Schema.Literal<"search">;
|
|
97
|
+
readonly call_id: Schema.String;
|
|
98
|
+
readonly query: Schema.String;
|
|
99
|
+
}>, Schema.Struct<{
|
|
100
|
+
readonly type: Schema.Literal<"helper">;
|
|
101
|
+
readonly call_id: Schema.String;
|
|
102
|
+
readonly agent: Schema.String;
|
|
103
|
+
readonly activity: Schema.String;
|
|
104
|
+
}>, Schema.Struct<{
|
|
105
|
+
readonly type: Schema.Literal<"compaction">;
|
|
106
|
+
}>, Schema.Struct<{
|
|
107
|
+
readonly type: Schema.Literal<"error">;
|
|
108
|
+
readonly message: Schema.String;
|
|
109
|
+
}>]>;
|
|
110
|
+
/**
|
|
111
|
+
* The value decoded by {@link Part}.
|
|
112
|
+
*
|
|
113
|
+
* @category models
|
|
114
|
+
* @since 1.0.0-rc.1
|
|
115
|
+
*/
|
|
116
|
+
export type Part = typeof Part.Type;
|
|
117
|
+
/**
|
|
118
|
+
* One read-only entry of an external conversation, in source order.
|
|
119
|
+
*
|
|
120
|
+
* @category models
|
|
121
|
+
* @since 1.0.0-rc.1
|
|
122
|
+
*/
|
|
123
|
+
export declare const Entry: Schema.Struct<{
|
|
124
|
+
readonly origin: Schema.Literal<"external">;
|
|
125
|
+
readonly agent_kind: Schema.Literals<readonly ["codex", "claude-code"]>;
|
|
126
|
+
readonly format_version: Schema.String;
|
|
127
|
+
readonly session_id: Schema.String;
|
|
128
|
+
/**
|
|
129
|
+
* The record this entry came from: `<session>:<line>`. A record that yields several entries numbers the later
|
|
130
|
+
* ones `<session>:<line>#<n>`.
|
|
131
|
+
*/
|
|
132
|
+
readonly source_id: Schema.String;
|
|
133
|
+
readonly read_only: Schema.Literal<true>;
|
|
134
|
+
readonly seq: Schema.Number;
|
|
135
|
+
/** Milliseconds since the epoch, from the record. */
|
|
136
|
+
readonly at: Schema.Number;
|
|
137
|
+
readonly turn_id: Schema.optional<Schema.String>;
|
|
138
|
+
/** `user` entries are the owner's; `assistant` entries are the agent's. */
|
|
139
|
+
readonly role: Schema.Literals<readonly ["user", "assistant"]>;
|
|
140
|
+
readonly part: Schema.Union<readonly [Schema.Struct<{
|
|
141
|
+
readonly type: Schema.Literal<"prompt">;
|
|
142
|
+
readonly text: Schema.String;
|
|
143
|
+
}>, Schema.Struct<{
|
|
144
|
+
readonly type: Schema.Literal<"goal">;
|
|
145
|
+
readonly objective: Schema.String;
|
|
146
|
+
readonly status: Schema.String;
|
|
147
|
+
}>, Schema.Struct<{
|
|
148
|
+
readonly type: Schema.Literal<"text">;
|
|
149
|
+
readonly text: Schema.String;
|
|
150
|
+
readonly final: Schema.Boolean;
|
|
151
|
+
}>, Schema.Struct<{
|
|
152
|
+
readonly type: Schema.Literal<"reasoning">;
|
|
153
|
+
readonly text: Schema.String;
|
|
154
|
+
}>, Schema.Struct<{
|
|
155
|
+
readonly type: Schema.Literal<"encrypted">;
|
|
156
|
+
}>, Schema.Struct<{
|
|
157
|
+
readonly type: Schema.Literal<"tool">;
|
|
158
|
+
readonly call_id: Schema.String;
|
|
159
|
+
readonly command: Schema.String;
|
|
160
|
+
/** Set when every part of the command only reads, searches or lists: "Read mvp.md". */
|
|
161
|
+
readonly reads: Schema.$Array<Schema.String>;
|
|
162
|
+
readonly status: Schema.Literals<readonly ["ok", "error", "running"]>;
|
|
163
|
+
readonly exit_code: Schema.optional<Schema.Number>;
|
|
164
|
+
readonly output: Schema.String;
|
|
165
|
+
readonly duration_ms: Schema.Number;
|
|
166
|
+
}>, Schema.Struct<{
|
|
167
|
+
readonly type: Schema.Literal<"edit">;
|
|
168
|
+
readonly call_id: Schema.String;
|
|
169
|
+
readonly files: Schema.$Array<Schema.Struct<{
|
|
170
|
+
readonly path: Schema.String;
|
|
171
|
+
readonly change: Schema.Literals<readonly ["added", "modified", "deleted", "renamed"]>;
|
|
172
|
+
readonly renamed_to: Schema.optional<Schema.String>;
|
|
173
|
+
readonly diff: Schema.String;
|
|
174
|
+
}>>;
|
|
175
|
+
readonly outcome: Schema.Literals<readonly ["applied", "failed"]>;
|
|
176
|
+
}>, Schema.Struct<{
|
|
177
|
+
readonly type: Schema.Literal<"search">;
|
|
178
|
+
readonly call_id: Schema.String;
|
|
179
|
+
readonly query: Schema.String;
|
|
180
|
+
}>, Schema.Struct<{
|
|
181
|
+
readonly type: Schema.Literal<"helper">;
|
|
182
|
+
readonly call_id: Schema.String;
|
|
183
|
+
readonly agent: Schema.String;
|
|
184
|
+
readonly activity: Schema.String;
|
|
185
|
+
}>, Schema.Struct<{
|
|
186
|
+
readonly type: Schema.Literal<"compaction">;
|
|
187
|
+
}>, Schema.Struct<{
|
|
188
|
+
readonly type: Schema.Literal<"error">;
|
|
189
|
+
readonly message: Schema.String;
|
|
190
|
+
}>]>;
|
|
191
|
+
}>;
|
|
192
|
+
/**
|
|
193
|
+
* The value decoded by {@link Entry}.
|
|
194
|
+
*
|
|
195
|
+
* @category models
|
|
196
|
+
* @since 1.0.0-rc.1
|
|
197
|
+
*/
|
|
198
|
+
export type Entry = typeof Entry.Type;
|
|
199
|
+
/**
|
|
200
|
+
* Why a transcript did not decode.
|
|
201
|
+
*
|
|
202
|
+
* @category errors
|
|
203
|
+
* @since 1.0.0-rc.1
|
|
204
|
+
*/
|
|
205
|
+
export declare const ExternalTranscriptErrorCode: Schema.Literals<readonly ["missing_version", "unsupported_version", "unsupported_record", "malformed_record"]>;
|
|
206
|
+
/**
|
|
207
|
+
* The value decoded by {@link ExternalTranscriptErrorCode}.
|
|
208
|
+
*
|
|
209
|
+
* @category errors
|
|
210
|
+
* @since 1.0.0-rc.1
|
|
211
|
+
*/
|
|
212
|
+
export type ExternalTranscriptErrorCode = typeof ExternalTranscriptErrorCode.Type;
|
|
213
|
+
declare const ExternalTranscriptError_base: Schema.Class<ExternalTranscriptError, Schema.TaggedStruct<"harness/ExternalTranscriptError", {
|
|
214
|
+
readonly code: Schema.Literals<readonly ["missing_version", "unsupported_version", "unsupported_record", "malformed_record"]>;
|
|
215
|
+
readonly message: Schema.String;
|
|
216
|
+
readonly line: Schema.Number;
|
|
217
|
+
}>, import("effect/Cause").YieldableError>;
|
|
218
|
+
/**
|
|
219
|
+
* A transcript this module refuses to read, with the line it stopped at.
|
|
220
|
+
*
|
|
221
|
+
* @category errors
|
|
222
|
+
* @since 1.0.0-rc.1
|
|
223
|
+
*/
|
|
224
|
+
export declare class ExternalTranscriptError extends ExternalTranscriptError_base {
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The Codex CLI releases whose rollout shape this module reads, by `major.minor`.
|
|
228
|
+
*
|
|
229
|
+
* @category constants
|
|
230
|
+
* @since 1.0.0-rc.1
|
|
231
|
+
*/
|
|
232
|
+
export declare const codexReleases: ReadonlyArray<string>;
|
|
233
|
+
/**
|
|
234
|
+
* What a Codex decode remembers between chunks.
|
|
235
|
+
*
|
|
236
|
+
* @category models
|
|
237
|
+
* @since 1.0.0-rc.1
|
|
238
|
+
*/
|
|
239
|
+
export interface CodexState {
|
|
240
|
+
/** Bytes after the last newline: a line the agent is still writing. */
|
|
241
|
+
readonly pending: string;
|
|
242
|
+
/** Complete lines read so far. */
|
|
243
|
+
readonly line: number;
|
|
244
|
+
/** Entries emitted so far. */
|
|
245
|
+
readonly seq: number;
|
|
246
|
+
readonly session?: {
|
|
247
|
+
readonly id: string;
|
|
248
|
+
readonly format_version: string;
|
|
249
|
+
readonly cwd: string;
|
|
250
|
+
} | undefined;
|
|
251
|
+
readonly goal?: string | undefined;
|
|
252
|
+
/** Code-mode scripts whose output has not arrived, by `call_id`: text the decoder keeps and never runs. */
|
|
253
|
+
readonly calls?: Readonly<Record<string, CodexCall>> | undefined;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* A Codex code-mode request waiting for its output: the tool's name and the script it was given.
|
|
257
|
+
*
|
|
258
|
+
* @category models
|
|
259
|
+
* @since 1.0.0-rc.1
|
|
260
|
+
*/
|
|
261
|
+
export interface CodexCall {
|
|
262
|
+
readonly name: string;
|
|
263
|
+
readonly input: string;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* The state before the first byte.
|
|
267
|
+
*
|
|
268
|
+
* @category constructors
|
|
269
|
+
* @since 1.0.0-rc.1
|
|
270
|
+
*/
|
|
271
|
+
export declare const codexStart: CodexState;
|
|
272
|
+
/**
|
|
273
|
+
* A decoded chunk: the entries it completed and the state to pass with the next chunk.
|
|
274
|
+
*
|
|
275
|
+
* @category models
|
|
276
|
+
* @since 1.0.0-rc.1
|
|
277
|
+
*/
|
|
278
|
+
export interface Decoded<State = CodexState> {
|
|
279
|
+
readonly state: State;
|
|
280
|
+
readonly entries: ReadonlyArray<Entry>;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Decode the next chunk of a Codex rollout. Pass `codexStart` with the first chunk and the returned state
|
|
284
|
+
* with each following one; any partition of the same bytes yields the same entries.
|
|
285
|
+
*
|
|
286
|
+
* @category decoding
|
|
287
|
+
* @since 1.0.0-rc.1
|
|
288
|
+
*/
|
|
289
|
+
export declare const decodeCodex: (state: CodexState, chunk: string) => Result.Result<Decoded, ExternalTranscriptError>;
|
|
290
|
+
/**
|
|
291
|
+
* The Claude Code release lines whose transcript shape this module reads, by `major.minor`.
|
|
292
|
+
*
|
|
293
|
+
* @category constants
|
|
294
|
+
* @since 1.0.0-rc.1
|
|
295
|
+
*/
|
|
296
|
+
export declare const claudeReleases: ReadonlyArray<string>;
|
|
297
|
+
/**
|
|
298
|
+
* A Claude Code tool call waiting for its result: the tool's name, its input and when the agent asked.
|
|
299
|
+
*
|
|
300
|
+
* @category models
|
|
301
|
+
* @since 1.0.0-rc.1
|
|
302
|
+
*/
|
|
303
|
+
export interface ClaudeCall {
|
|
304
|
+
readonly name: string;
|
|
305
|
+
readonly input: unknown;
|
|
306
|
+
/** Milliseconds since the epoch, from the `tool_use` record. */
|
|
307
|
+
readonly at: number;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* What a Claude Code decode remembers between chunks.
|
|
311
|
+
*
|
|
312
|
+
* @category models
|
|
313
|
+
* @since 1.0.0-rc.1
|
|
314
|
+
*/
|
|
315
|
+
export interface ClaudeState {
|
|
316
|
+
/** Bytes after the last newline: a line the agent is still writing. */
|
|
317
|
+
readonly pending: string;
|
|
318
|
+
/** Complete lines read so far. */
|
|
319
|
+
readonly line: number;
|
|
320
|
+
/** Entries emitted so far. */
|
|
321
|
+
readonly seq: number;
|
|
322
|
+
/** The session the first conversation record named. */
|
|
323
|
+
readonly session?: string | undefined;
|
|
324
|
+
/** The `promptId` of the latest user record: the turn later entries belong to. */
|
|
325
|
+
readonly turn?: string | undefined;
|
|
326
|
+
/** Tool calls whose result has not arrived, by `tool_use` id. */
|
|
327
|
+
readonly calls: Readonly<Record<string, ClaudeCall>>;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* The state before the first byte.
|
|
331
|
+
*
|
|
332
|
+
* @category constructors
|
|
333
|
+
* @since 1.0.0-rc.1
|
|
334
|
+
*/
|
|
335
|
+
export declare const claudeStart: ClaudeState;
|
|
336
|
+
/**
|
|
337
|
+
* Decode the next chunk of a Claude Code session transcript. Pass `claudeStart` with the first chunk and the
|
|
338
|
+
* returned state with each following one; any partition of the same bytes yields the same entries.
|
|
339
|
+
*
|
|
340
|
+
* Entries follow the order of the records that complete them. A tool call is held in `state.calls` from its
|
|
341
|
+
* `tool_use` record until the `tool_result` with the same id arrives, and becomes one entry at the result's line;
|
|
342
|
+
* a call whose result never arrives emits nothing.
|
|
343
|
+
*
|
|
344
|
+
* @category decoding
|
|
345
|
+
* @since 1.0.0-rc.1
|
|
346
|
+
*/
|
|
347
|
+
export declare const decodeClaude: (state: ClaudeState, chunk: string) => Result.Result<Decoded<ClaudeState>, ExternalTranscriptError>;
|
|
348
|
+
export {};
|
|
349
|
+
//# sourceMappingURL=ExternalTranscript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalTranscript.d.ts","sourceRoot":"","sources":["../../src/ExternalTranscript.ts"],"names":[],"mappings":"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"}
|