@smthrs/harness 0.0.0-stage → 1.0.0-rc.4
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 +985 -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 +1142 -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 @@
|
|
|
1
|
+
{"version":3,"file":"CellCalls.d.ts","sourceRoot":"","sources":["../../src/CellCalls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,KAAK,KAAK,QAAQ,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAkB,MAAM,QAAQ,CAAA;AAC/C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,KAAK,WAAW,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,cAAc,GAAG,CAC3B,IAAI,EAAE,IAAI,CAAC,IAAI,KACZ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAA;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,MAAM,EAAE,MAAM,KACX,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAA;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAA;IACpC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,GAAG,SAAS,CAAA;IAClD,wEAAwE;IACxE,QAAQ,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,SAAS,CAAA;IAC1E,gGAAgG;IAChG,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;CAC3C;AAED;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAA;CAChF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,GAAI,SAAS,OAAO,KAAG,QAuEtC,CAAA"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var CellCalls_exports = {};
|
|
30
|
+
__export(CellCalls_exports, {
|
|
31
|
+
make: () => make
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(CellCalls_exports);
|
|
34
|
+
var MarkdownFlow = __toESM(require("@smthrs/registry/MarkdownFlow"), 1);
|
|
35
|
+
var import_effect = require("effect");
|
|
36
|
+
var Cell = __toESM(require("./Cell.js"), 1);
|
|
37
|
+
var import_HarnessError = require("./HarnessError.js");
|
|
38
|
+
var import_refusal = require("./internal/refusal.js");
|
|
39
|
+
const make = (options) => ({
|
|
40
|
+
run: (call) => import_effect.Effect.gen(function* () {
|
|
41
|
+
const found = yield* options.registry.getOption(call.flowName);
|
|
42
|
+
if (import_effect.Option.isNone(found)) {
|
|
43
|
+
return (0, import_refusal.refusal)(
|
|
44
|
+
"unknown_flow",
|
|
45
|
+
`Flow ${call.flowName} is not in the registry. Only the flows in ctx.flows are callable.`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
const descriptor = found.value;
|
|
49
|
+
if (!descriptor.modelInvocable) {
|
|
50
|
+
return (0, import_refusal.refusal)("capability_refused", `Flow ${call.flowName} is not model-invocable.`);
|
|
51
|
+
}
|
|
52
|
+
if (Cell.declarationDigest(descriptor) !== call.identity.declaration) {
|
|
53
|
+
return (0, import_refusal.refusal)(
|
|
54
|
+
"declaration_changed",
|
|
55
|
+
`The registry entry for ${call.flowName} changed after this cell was written. Read ctx.flows again and reissue the call.`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
const binding = options.catalog?.bindings.get(call.flowName);
|
|
59
|
+
if (binding !== void 0) {
|
|
60
|
+
if (Cell.declarationDigest(binding.descriptor) !== Cell.declarationDigest(descriptor)) {
|
|
61
|
+
return (0, import_refusal.refusal)(
|
|
62
|
+
"declaration_changed",
|
|
63
|
+
`Flow ${call.flowName} is disclosed by a declaration that does not match the bound implementation. The host must not bind two different declarations to one name.`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
return yield* binding.run(call);
|
|
67
|
+
}
|
|
68
|
+
if (descriptor.body._tag === "Markdown") {
|
|
69
|
+
const prompt = options.prompt;
|
|
70
|
+
if (prompt === void 0) {
|
|
71
|
+
return (0, import_refusal.refusal)("unimplemented", `Flow ${call.flowName} is a markdown flow and this host runs none.`);
|
|
72
|
+
}
|
|
73
|
+
const decoded = import_effect.Schema.decodeUnknownResult(MarkdownFlow.Input)(call.input);
|
|
74
|
+
if (decoded._tag === "Failure") {
|
|
75
|
+
return (0, import_refusal.refusal)("invalid_input", `Flow ${call.flowName} takes { args: string }.`);
|
|
76
|
+
}
|
|
77
|
+
const text = yield* options.registry.runPrompt(call.flowName, decoded.success).pipe(
|
|
78
|
+
import_effect.Effect.mapError(
|
|
79
|
+
(cause) => new import_HarnessError.HarnessError({
|
|
80
|
+
code: "engine_failed",
|
|
81
|
+
message: `The body of markdown flow ${call.flowName} could not be loaded`,
|
|
82
|
+
cause
|
|
83
|
+
})
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
return yield* prompt({ call, text });
|
|
87
|
+
}
|
|
88
|
+
const implementation = options.implementations?.get(call.flowName);
|
|
89
|
+
if (implementation === void 0) {
|
|
90
|
+
return (0, import_refusal.refusal)(
|
|
91
|
+
"unimplemented",
|
|
92
|
+
`Flow ${call.flowName} is discovered but this host has no implementation bound for it.`
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
return yield* implementation(call);
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=CellCalls.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/CellCalls.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Registry-backed resolution for the flow calls a cell makes.\n *\n * A cell's only authority is `ctx.call(flow, input)`, so every effect an agent\n * can reach is a registered flow. This module is where a call name becomes a\n * flow: it resolves the name against `@smthrs/registry` \u2014 the same registry\n * that discovered `flow.ts`, `flow.mdx`, and `SKILL.md` under the documented\n * precedence \u2014 and dispatches to the body the descriptor declares.\n *\n * It is deliberately not a second registry. Discovery, precedence, first-found\n * collision handling, and progressive disclosure all stay in\n * `@smthrs/registry`; this module only decides which body runs and turns\n * every resolution problem into a {@link Cell.CallResult} the cell can inspect.\n *\n * The split between a failed result and a failed effect is the contract\n * `EngineLike.call` declares. A refusal the agent could plausibly correct \u2014 an\n * unknown flow, a badly shaped input, a flow this host does not implement \u2014 is\n * a `failure` result, so the cell observes a resolved `{ ok: false, error }`\n * envelope and may recover by branching on `.ok === false` and `.error.code`.\n * Ordinary call failures do not throw. Anything the cell must never swallow,\n * such as a permission park or an abort, stays in the error channel of the\n * implementation that raised it.\n *\n * The resolver's shape is exactly `FlowEngineLike.CallRunner[\"run\"]`, so a\n * durable host wires it in without this browser-safe package depending on the\n * engine binding.\n *\n * Governing design: `../docs/concepts.md#durable-cell-loop` and\n * `../docs/concepts.md#flow-registry`.\n *\n * @since 0.1.0\n */\n\nimport * as MarkdownFlow from \"@smthrs/registry/MarkdownFlow\"\nimport type * as Registry from \"@smthrs/registry/Registry\"\nimport { Effect, Option, Schema } from \"effect\"\nimport * as Cell from \"./Cell.ts\"\nimport type * as FlowBinding from \"./FlowBinding.ts\"\nimport { HarnessError } from \"./HarnessError.ts\"\nimport { refusal } from \"./internal/refusal.ts\"\n\n/**\n * One module-backed flow, implemented by the host that discovered it.\n *\n * Discovery reads a module's metadata without evaluating it, so a descriptor\n * never carries a callable body. The host binds the implementation it loaded\n * for the flow, which keeps module evaluation out of both discovery and this\n * package.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type Implementation = (\n call: Cell.Call\n) => Effect.Effect<Cell.CallResult, HarnessError>\n\n/**\n * One discovered markdown flow, rendered against the call's arguments.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface Prompt {\n readonly call: Cell.Call\n readonly text: string\n}\n\n/**\n * Runs a rendered markdown flow.\n *\n * A markdown flow is a prompt, so running one is a nested agent run rather than\n * a function call. The host supplies that runner; this module only resolves and\n * renders. A runner whose child declares the `auto` model routes that child\n * through `SeatRouter.durable` from `@smthrs/agent`, keyed by the child run.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport type PromptRunner = (\n prompt: Prompt\n) => Effect.Effect<Cell.CallResult, HarnessError>\n\n/**\n * The collaborators registry-backed resolution needs.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface Options {\n readonly registry: Registry.Registry\n /**\n * The composed executable bindings this host resolved.\n *\n * Standard capabilities, plugin-contributed flows, incoming MCP tools, and\n * durable children all arrive here, and all of them resolve through the one\n * snapshot the registry disclosed.\n */\n readonly catalog?: FlowBinding.Catalog | undefined\n /** Host implementations for module-backed flows, keyed by flow name. */\n readonly implementations?: ReadonlyMap<string, Implementation> | undefined\n /** Runs a rendered markdown flow. A host with none answers with a resolved failure envelope. */\n readonly prompt?: PromptRunner | undefined\n}\n\n/**\n * Resolves one cell call to the registered flow that answers it.\n *\n * @category models\n * @since 0.1.0\n * @slop\n */\nexport interface Resolver {\n readonly run: (call: Cell.Call) => Effect.Effect<Cell.CallResult, HarnessError>\n}\n\n/**\n * Constructs registry-backed call resolution.\n *\n * @category constructors\n * @since 0.1.0\n * @slop\n */\nexport const make = (options: Options): Resolver => ({\n run: (call) =>\n Effect.gen(function*() {\n const found = yield* options.registry.getOption(call.flowName)\n if (Option.isNone(found)) {\n return refusal(\n \"unknown_flow\",\n `Flow ${call.flowName} is not in the registry. Only the flows in ctx.flows are callable.`\n )\n }\n const descriptor = found.value\n if (!descriptor.modelInvocable) {\n return refusal(\"capability_refused\", `Flow ${call.flowName} is not model-invocable.`)\n }\n // The registry is refreshable, so the entry could have moved between the\n // frame that showed the model this catalog and the boundary that runs the\n // call. Re-deriving the digest here is what keeps a call bound to the\n // declaration the agent actually chose.\n if (Cell.declarationDigest(descriptor) !== call.identity.declaration) {\n return refusal(\n \"declaration_changed\",\n `The registry entry for ${call.flowName} changed after this cell was written. Read ctx.flows again and reissue the call.`\n )\n }\n\n // An executable binding answers first, because a binding *is* the\n // implementation of the declaration it projected. The identity check is\n // what keeps that honest: if the name resolved to some other declaration\n // \u2014 a discovered flow shadowing the binding, or two compositions crossed\n // \u2014 the call is refused rather than dispatched to the wrong body.\n const binding = options.catalog?.bindings.get(call.flowName)\n if (binding !== undefined) {\n if (Cell.declarationDigest(binding.descriptor) !== Cell.declarationDigest(descriptor)) {\n return refusal(\n \"declaration_changed\",\n `Flow ${call.flowName} is disclosed by a declaration that does not match the bound implementation. The host must not bind two different declarations to one name.`\n )\n }\n return yield* binding.run(call)\n }\n\n if (descriptor.body._tag === \"Markdown\") {\n const prompt = options.prompt\n if (prompt === undefined) {\n return refusal(\"unimplemented\", `Flow ${call.flowName} is a markdown flow and this host runs none.`)\n }\n const decoded = Schema.decodeUnknownResult(MarkdownFlow.Input)(call.input)\n if (decoded._tag === \"Failure\") {\n return refusal(\"invalid_input\", `Flow ${call.flowName} takes { args: string }.`)\n }\n const text = yield* options.registry.runPrompt(call.flowName, decoded.success).pipe(\n Effect.mapError((cause) =>\n new HarnessError({\n code: \"engine_failed\",\n message: `The body of markdown flow ${call.flowName} could not be loaded`,\n cause\n })\n )\n )\n return yield* prompt({ call, text })\n }\n\n const implementation = options.implementations?.get(call.flowName)\n if (implementation === undefined) {\n return refusal(\n \"unimplemented\",\n `Flow ${call.flowName} is discovered but this host has no implementation bound for it.`\n )\n }\n return yield* implementation(call)\n })\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiCA,mBAA8B;AAE9B,oBAAuC;AACvC,WAAsB;AAEtB,0BAA6B;AAC7B,qBAAwB;AAuFjB,MAAM,OAAO,CAAC,aAAgC;AAAA,EACnD,KAAK,CAAC,SACJ,qBAAO,IAAI,aAAY;AACrB,UAAM,QAAQ,OAAO,QAAQ,SAAS,UAAU,KAAK,QAAQ;AAC7D,QAAI,qBAAO,OAAO,KAAK,GAAG;AACxB,iBAAO;AAAA,QACL;AAAA,QACA,QAAQ,KAAK,QAAQ;AAAA,MACvB;AAAA,IACF;AACA,UAAM,aAAa,MAAM;AACzB,QAAI,CAAC,WAAW,gBAAgB;AAC9B,iBAAO,wBAAQ,sBAAsB,QAAQ,KAAK,QAAQ,0BAA0B;AAAA,IACtF;AAKA,QAAI,KAAK,kBAAkB,UAAU,MAAM,KAAK,SAAS,aAAa;AACpE,iBAAO;AAAA,QACL;AAAA,QACA,0BAA0B,KAAK,QAAQ;AAAA,MACzC;AAAA,IACF;AAOA,UAAM,UAAU,QAAQ,SAAS,SAAS,IAAI,KAAK,QAAQ;AAC3D,QAAI,YAAY,QAAW;AACzB,UAAI,KAAK,kBAAkB,QAAQ,UAAU,MAAM,KAAK,kBAAkB,UAAU,GAAG;AACrF,mBAAO;AAAA,UACL;AAAA,UACA,QAAQ,KAAK,QAAQ;AAAA,QACvB;AAAA,MACF;AACA,aAAO,OAAO,QAAQ,IAAI,IAAI;AAAA,IAChC;AAEA,QAAI,WAAW,KAAK,SAAS,YAAY;AACvC,YAAM,SAAS,QAAQ;AACvB,UAAI,WAAW,QAAW;AACxB,mBAAO,wBAAQ,iBAAiB,QAAQ,KAAK,QAAQ,8CAA8C;AAAA,MACrG;AACA,YAAM,UAAU,qBAAO,oBAAoB,aAAa,KAAK,EAAE,KAAK,KAAK;AACzE,UAAI,QAAQ,SAAS,WAAW;AAC9B,mBAAO,wBAAQ,iBAAiB,QAAQ,KAAK,QAAQ,0BAA0B;AAAA,MACjF;AACA,YAAM,OAAO,OAAO,QAAQ,SAAS,UAAU,KAAK,UAAU,QAAQ,OAAO,EAAE;AAAA,QAC7E,qBAAO;AAAA,UAAS,CAAC,UACf,IAAI,iCAAa;AAAA,YACf,MAAM;AAAA,YACN,SAAS,6BAA6B,KAAK,QAAQ;AAAA,YACnD;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AACA,aAAO,OAAO,OAAO,EAAE,MAAM,KAAK,CAAC;AAAA,IACrC;AAEA,UAAM,iBAAiB,QAAQ,iBAAiB,IAAI,KAAK,QAAQ;AACjE,QAAI,mBAAmB,QAAW;AAChC,iBAAO;AAAA,QACL;AAAA,QACA,QAAQ,KAAK,QAAQ;AAAA,MACvB;AAAA,IACF;AACA,WAAO,OAAO,eAAe,IAAI;AAAA,EACnC,CAAC;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The source of every cell the current turn executed.
|
|
3
|
+
*
|
|
4
|
+
* The controller runs one cell per frame and, once the realm has evaluated it,
|
|
5
|
+
* keeps only what the cell printed. A model that wants to turn the script it
|
|
6
|
+
* just ran into a saved flow needs the script itself back, so this is the one
|
|
7
|
+
* place the run keeps it: the controller appends each cell as it executes, and
|
|
8
|
+
* `flows/show-script` reads the list.
|
|
9
|
+
*
|
|
10
|
+
* The service is optional. A host that offers no way to save a flow binds
|
|
11
|
+
* nothing and the controller records nothing; {@link layerNoop} states the same
|
|
12
|
+
* answer explicitly.
|
|
13
|
+
*
|
|
14
|
+
* @since 0.1.0
|
|
15
|
+
*/
|
|
16
|
+
import { Context, Effect, Layer } from "effect";
|
|
17
|
+
/**
|
|
18
|
+
* One cell the current turn executed.
|
|
19
|
+
*
|
|
20
|
+
* @category models
|
|
21
|
+
* @since 0.1.0
|
|
22
|
+
*/
|
|
23
|
+
export interface ExecutedCell {
|
|
24
|
+
/** Zero-based execution order within this turn. */
|
|
25
|
+
readonly ordinal: number;
|
|
26
|
+
/** The cell's JavaScript, as it ran. */
|
|
27
|
+
readonly source: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Records and reports the current turn's executed cells.
|
|
31
|
+
*
|
|
32
|
+
* @category models
|
|
33
|
+
* @since 0.1.0
|
|
34
|
+
*/
|
|
35
|
+
export interface Service {
|
|
36
|
+
/** Records the source of one cell the controller is executing. */
|
|
37
|
+
readonly record: (source: string) => Effect.Effect<void>;
|
|
38
|
+
/** Every cell this turn executed, oldest first. */
|
|
39
|
+
readonly cells: () => Effect.Effect<ReadonlyArray<ExecutedCell>>;
|
|
40
|
+
}
|
|
41
|
+
declare const CellHistory_base: Context.ServiceClass<CellHistory, "@smthrs/harness/CellHistory", Service>;
|
|
42
|
+
/**
|
|
43
|
+
* Service tag for the current turn's executed cells.
|
|
44
|
+
*
|
|
45
|
+
* @category services
|
|
46
|
+
* @since 0.1.0
|
|
47
|
+
*/
|
|
48
|
+
export declare class CellHistory extends CellHistory_base {
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Constructs a history that records what the controller executes.
|
|
52
|
+
*
|
|
53
|
+
* Ordinals are the append order rather than the frame number: a frame that
|
|
54
|
+
* produced no usable cell executed nothing, and a gap in the script would tell
|
|
55
|
+
* the model a cell ran that never did. `cells` answers with a copy, so a list
|
|
56
|
+
* a caller is already reading does not grow underneath it.
|
|
57
|
+
*
|
|
58
|
+
* @category constructors
|
|
59
|
+
* @since 0.1.0
|
|
60
|
+
*/
|
|
61
|
+
export declare const make: Effect.Effect<Service>;
|
|
62
|
+
/**
|
|
63
|
+
* Constructs a history over a fixed cell list.
|
|
64
|
+
*
|
|
65
|
+
* For a host that recorded the turn its own way and reports it rather than
|
|
66
|
+
* replaying it into {@link make}. What it is told is dropped: the list it was
|
|
67
|
+
* built over is the whole history.
|
|
68
|
+
*
|
|
69
|
+
* @category constructors
|
|
70
|
+
* @since 0.1.0
|
|
71
|
+
*/
|
|
72
|
+
export declare const makeCells: (cells: ReadonlyArray<ExecutedCell>) => Service;
|
|
73
|
+
/**
|
|
74
|
+
* Constructs a history that records nothing, optionally overriding operations.
|
|
75
|
+
*
|
|
76
|
+
* @category constructors
|
|
77
|
+
* @since 0.1.0
|
|
78
|
+
*/
|
|
79
|
+
export declare const makeNoop: (overrides?: Partial<Service>) => Service;
|
|
80
|
+
/**
|
|
81
|
+
* Provides a history that records what the controller executes.
|
|
82
|
+
*
|
|
83
|
+
* @category layers
|
|
84
|
+
* @since 0.1.0
|
|
85
|
+
*/
|
|
86
|
+
export declare const layer: Layer.Layer<CellHistory>;
|
|
87
|
+
/**
|
|
88
|
+
* Provides a history over a fixed cell list.
|
|
89
|
+
*
|
|
90
|
+
* @category layers
|
|
91
|
+
* @since 0.1.0
|
|
92
|
+
*/
|
|
93
|
+
export declare const layerCells: (cells: ReadonlyArray<ExecutedCell>) => Layer.Layer<CellHistory>;
|
|
94
|
+
/**
|
|
95
|
+
* Provides a history that records nothing.
|
|
96
|
+
*
|
|
97
|
+
* @category layers
|
|
98
|
+
* @since 0.1.0
|
|
99
|
+
*/
|
|
100
|
+
export declare const layerNoop: (overrides?: Partial<Service>) => Layer.Layer<CellHistory>;
|
|
101
|
+
export {};
|
|
102
|
+
//# sourceMappingURL=CellHistory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellHistory.d.ts","sourceRoot":"","sources":["../../src/CellHistory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE/C;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,wCAAwC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACxD,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAA;CACjE;;AAED;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,gBAAsE;CAAG;AAE1G;;;;;;;;;;GAUG;AACH,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAStC,CAAA;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,aAAa,CAAC,YAAY,CAAC,KAAG,OAI3D,CAAA;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,YAAW,OAAO,CAAC,OAAO,CAAM,KAAG,OAKxD,CAAA;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAmC,CAAA;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,aAAa,CAAC,YAAY,CAAC,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CACzC,CAAA;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,YAAW,OAAO,CAAC,OAAO,CAAM,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CACnC,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var CellHistory_exports = {};
|
|
20
|
+
__export(CellHistory_exports, {
|
|
21
|
+
CellHistory: () => CellHistory,
|
|
22
|
+
layer: () => layer,
|
|
23
|
+
layerCells: () => layerCells,
|
|
24
|
+
layerNoop: () => layerNoop,
|
|
25
|
+
make: () => make,
|
|
26
|
+
makeCells: () => makeCells,
|
|
27
|
+
makeNoop: () => makeNoop
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(CellHistory_exports);
|
|
30
|
+
var import_effect = require("effect");
|
|
31
|
+
class CellHistory extends import_effect.Context.Service()("@smthrs/harness/CellHistory") {
|
|
32
|
+
}
|
|
33
|
+
const make = import_effect.Effect.sync(() => {
|
|
34
|
+
const recorded = [];
|
|
35
|
+
return CellHistory.of({
|
|
36
|
+
record: (source) => import_effect.Effect.sync(() => {
|
|
37
|
+
recorded.push({ ordinal: recorded.length, source });
|
|
38
|
+
}),
|
|
39
|
+
cells: () => import_effect.Effect.sync(() => [...recorded])
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
const makeCells = (cells) => CellHistory.of({
|
|
43
|
+
record: () => import_effect.Effect.void,
|
|
44
|
+
cells: () => import_effect.Effect.succeed(cells)
|
|
45
|
+
});
|
|
46
|
+
const makeNoop = (overrides = {}) => CellHistory.of({
|
|
47
|
+
record: () => import_effect.Effect.void,
|
|
48
|
+
cells: () => import_effect.Effect.succeed([]),
|
|
49
|
+
...overrides
|
|
50
|
+
});
|
|
51
|
+
const layer = import_effect.Layer.effect(CellHistory)(make);
|
|
52
|
+
const layerCells = (cells) => import_effect.Layer.succeed(CellHistory)(makeCells(cells));
|
|
53
|
+
const layerNoop = (overrides = {}) => import_effect.Layer.succeed(CellHistory)(makeNoop(overrides));
|
|
54
|
+
//# sourceMappingURL=CellHistory.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/CellHistory.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * The source of every cell the current turn executed.\n *\n * The controller runs one cell per frame and, once the realm has evaluated it,\n * keeps only what the cell printed. A model that wants to turn the script it\n * just ran into a saved flow needs the script itself back, so this is the one\n * place the run keeps it: the controller appends each cell as it executes, and\n * `flows/show-script` reads the list.\n *\n * The service is optional. A host that offers no way to save a flow binds\n * nothing and the controller records nothing; {@link layerNoop} states the same\n * answer explicitly.\n *\n * @since 0.1.0\n */\n\nimport { Context, Effect, Layer } from \"effect\"\n\n/**\n * One cell the current turn executed.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface ExecutedCell {\n /** Zero-based execution order within this turn. */\n readonly ordinal: number\n /** The cell's JavaScript, as it ran. */\n readonly source: string\n}\n\n/**\n * Records and reports the current turn's executed cells.\n *\n * @category models\n * @since 0.1.0\n */\nexport interface Service {\n /** Records the source of one cell the controller is executing. */\n readonly record: (source: string) => Effect.Effect<void>\n /** Every cell this turn executed, oldest first. */\n readonly cells: () => Effect.Effect<ReadonlyArray<ExecutedCell>>\n}\n\n/**\n * Service tag for the current turn's executed cells.\n *\n * @category services\n * @since 0.1.0\n */\nexport class CellHistory extends Context.Service<CellHistory, Service>()(\"@smthrs/harness/CellHistory\") {}\n\n/**\n * Constructs a history that records what the controller executes.\n *\n * Ordinals are the append order rather than the frame number: a frame that\n * produced no usable cell executed nothing, and a gap in the script would tell\n * the model a cell ran that never did. `cells` answers with a copy, so a list\n * a caller is already reading does not grow underneath it.\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const make: Effect.Effect<Service> = Effect.sync(() => {\n const recorded: Array<ExecutedCell> = []\n return CellHistory.of({\n record: (source) =>\n Effect.sync(() => {\n recorded.push({ ordinal: recorded.length, source })\n }),\n cells: () => Effect.sync(() => [...recorded])\n })\n})\n\n/**\n * Constructs a history over a fixed cell list.\n *\n * For a host that recorded the turn its own way and reports it rather than\n * replaying it into {@link make}. What it is told is dropped: the list it was\n * built over is the whole history.\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const makeCells = (cells: ReadonlyArray<ExecutedCell>): Service =>\n CellHistory.of({\n record: () => Effect.void,\n cells: () => Effect.succeed(cells)\n })\n\n/**\n * Constructs a history that records nothing, optionally overriding operations.\n *\n * @category constructors\n * @since 0.1.0\n */\nexport const makeNoop = (overrides: Partial<Service> = {}): Service =>\n CellHistory.of({\n record: () => Effect.void,\n cells: () => Effect.succeed([]),\n ...overrides\n })\n\n/**\n * Provides a history that records what the controller executes.\n *\n * @category layers\n * @since 0.1.0\n */\nexport const layer: Layer.Layer<CellHistory> = Layer.effect(CellHistory)(make)\n\n/**\n * Provides a history over a fixed cell list.\n *\n * @category layers\n * @since 0.1.0\n */\nexport const layerCells = (cells: ReadonlyArray<ExecutedCell>): Layer.Layer<CellHistory> =>\n Layer.succeed(CellHistory)(makeCells(cells))\n\n/**\n * Provides a history that records nothing.\n *\n * @category layers\n * @since 0.1.0\n */\nexport const layerNoop = (overrides: Partial<Service> = {}): Layer.Layer<CellHistory> =>\n Layer.succeed(CellHistory)(makeNoop(overrides))\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,oBAAuC;AAkChC,MAAM,oBAAoB,sBAAQ,QAA8B,EAAE,6BAA6B,EAAE;AAAC;AAalG,MAAM,OAA+B,qBAAO,KAAK,MAAM;AAC5D,QAAM,WAAgC,CAAC;AACvC,SAAO,YAAY,GAAG;AAAA,IACpB,QAAQ,CAAC,WACP,qBAAO,KAAK,MAAM;AAChB,eAAS,KAAK,EAAE,SAAS,SAAS,QAAQ,OAAO,CAAC;AAAA,IACpD,CAAC;AAAA,IACH,OAAO,MAAM,qBAAO,KAAK,MAAM,CAAC,GAAG,QAAQ,CAAC;AAAA,EAC9C,CAAC;AACH,CAAC;AAYM,MAAM,YAAY,CAAC,UACxB,YAAY,GAAG;AAAA,EACb,QAAQ,MAAM,qBAAO;AAAA,EACrB,OAAO,MAAM,qBAAO,QAAQ,KAAK;AACnC,CAAC;AAQI,MAAM,WAAW,CAAC,YAA8B,CAAC,MACtD,YAAY,GAAG;AAAA,EACb,QAAQ,MAAM,qBAAO;AAAA,EACrB,OAAO,MAAM,qBAAO,QAAQ,CAAC,CAAC;AAAA,EAC9B,GAAG;AACL,CAAC;AAQI,MAAM,QAAkC,oBAAM,OAAO,WAAW,EAAE,IAAI;AAQtE,MAAM,aAAa,CAAC,UACzB,oBAAM,QAAQ,WAAW,EAAE,UAAU,KAAK,CAAC;AAQtC,MAAM,YAAY,CAAC,YAA8B,CAAC,MACvD,oBAAM,QAAQ,WAAW,EAAE,SAAS,SAAS,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|