@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,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The proof that was already true before anything changed.
|
|
3
|
+
*
|
|
4
|
+
* **This control is not wired into `CellTurn`. Nothing in a production run
|
|
5
|
+
* reads it, and no run is told anything by it.** The module, this suite and
|
|
6
|
+
* `AgentEvent.VacuousVerificationObserved` are kept intact so it can be
|
|
7
|
+
* measured on its own, in its own wave, against the contract text r92
|
|
8
|
+
* measured. Everything below describes what it does when an arm turns it on.
|
|
9
|
+
*
|
|
10
|
+
* **Its input no longer exists.** {@link stored} reads the reserved
|
|
11
|
+
* `verification` key out of the durable state a cell filed by hand, and the
|
|
12
|
+
* filing surface was deleted on 2026-08-24: `Cell.Continue.state` decodes and
|
|
13
|
+
* is populated by nothing. An arm that re-wires this module reads nothing until
|
|
14
|
+
* it first decides where a realm run declares its verification — a name bound
|
|
15
|
+
* in the realm, a print, or a new field — so the wave that turns this back on
|
|
16
|
+
* carries that decision with it. {@link stored} is left reading `Schema.Json`
|
|
17
|
+
* because that decision has not been made and the r90–r96 journals it can be
|
|
18
|
+
* replayed against are still filing journals.
|
|
19
|
+
*
|
|
20
|
+
* It was live for exactly one wave. the r93 wave report reads
|
|
21
|
+
* the result off the 45 journals, and the reason it is off is that the wave
|
|
22
|
+
* cannot price it:
|
|
23
|
+
*
|
|
24
|
+
* - It fired **twice in 45 journals**, and on neither of the instances the
|
|
25
|
+
* diagnosis or the replay predicted. `django__django-14351`, the run it was
|
|
26
|
+
* written for, resolved that wave with **no observation on its journal at
|
|
27
|
+
* all** — so the row it was built to close was closed by something else, and
|
|
28
|
+
* two prompt rules landed in the same round.
|
|
29
|
+
* - `sympy__sympy-13878` is the firing that worked: told at frame 1 that its
|
|
30
|
+
* stored check was already green, the run replaced it, spent seventeen more
|
|
31
|
+
* frames on a different proof, and resolved — cheaper and in fewer frames
|
|
32
|
+
* than any earlier wave.
|
|
33
|
+
* - `django__django-15732` is the firing that did not. The observation landed
|
|
34
|
+
* on frame 7, which is the frame that made the correct edit. On frame 8 the
|
|
35
|
+
* run made a second edit that rewrote the enclosing block and restored the
|
|
36
|
+
* first edit's text **byte for byte**. Both edits reported `mutated: true`
|
|
37
|
+
* on an `observed` basis, the final tree equalled the base, and the captured
|
|
38
|
+
* diff was zero bytes. The instance had resolved in r90, r91 and r92; it is
|
|
39
|
+
* the wave's only empty patch.
|
|
40
|
+
*
|
|
41
|
+
* Nothing in this module's contract asks a run to revert, and one instance is
|
|
42
|
+
* not a mechanism. But it is the first evidence that a fact delivered on the
|
|
43
|
+
* `invalidProbe` channel can be read by a run as an instruction to retreat,
|
|
44
|
+
* and the one consequential firing in the wave preceded the wave's only
|
|
45
|
+
* revert-to-empty-patch. Two firings is not a rate. Turning this back on is a
|
|
46
|
+
* wave of its own — this control alone, on r92's contract text, with
|
|
47
|
+
* `django__django-15732` and `sympy__sympy-13878` as the rows to read — and
|
|
48
|
+
* not a change that rides along with another.
|
|
49
|
+
*
|
|
50
|
+
* A run is asked to store the check it verified with as
|
|
51
|
+
* `state.verification: { flow, input }` and to re-run that exact check after
|
|
52
|
+
* its edit. Nothing in that rule says the check ever failed. A run may pick a
|
|
53
|
+
* command that was green on the tree it was handed, watch it stay green after
|
|
54
|
+
* the edit, and complete citing a before-and-after that never moved.
|
|
55
|
+
*
|
|
56
|
+
* That is not a hypothetical either. `django__django-14351` lost a baseline
|
|
57
|
+
* verdict across two waves, and its journal says why in two rows: the same
|
|
58
|
+
* verification script — one content digest — ran at sequence 260, before any
|
|
59
|
+
* frame of the run had changed a byte, and exited 0; then again at sequence
|
|
60
|
+
* 582, after the edit, and exited 0. Both readings are true and the pair
|
|
61
|
+
* establishes nothing. The contract already says the words — *a command
|
|
62
|
+
* becomes evidence only once you have SEEN it fail on the unmodified tree* —
|
|
63
|
+
* and the run stored a check it had watched pass there instead.
|
|
64
|
+
*
|
|
65
|
+
* The harness can see this without re-running anything. It already records
|
|
66
|
+
* every check a frame ran, whether that check reported a passing exit status,
|
|
67
|
+
* and how many frames of the run had changed the workspace when it ran. A
|
|
68
|
+
* check that passed while that count was zero, in a frame that itself changed
|
|
69
|
+
* nothing, is a check that passed on the tree the run was handed. If a later
|
|
70
|
+
* cell stores that exact call as its verification, the run is standing on a
|
|
71
|
+
* proof that cannot distinguish its own change from no change at all.
|
|
72
|
+
*
|
|
73
|
+
* One reading takes it back: the same call reported *failing* over that same
|
|
74
|
+
* untouched tree. Then the run has watched the red the contract asks for, and a
|
|
75
|
+
* second, green reading of it before any edit says the command is unsteady
|
|
76
|
+
* rather than that the run never saw it fail. Such a signature is never
|
|
77
|
+
* admitted, so the observation can only ever be made about a check this run has
|
|
78
|
+
* no pre-edit failure for.
|
|
79
|
+
*
|
|
80
|
+
* So the harness says so, and does nothing else. It is delivered on the
|
|
81
|
+
* `invalidProbe` channel — the one place the loop already contradicts a
|
|
82
|
+
* reading of a result the flow itself could see through — because it is the
|
|
83
|
+
* same class of fact: a result that reads identically on a broken tree and on
|
|
84
|
+
* a fixed one. No bounce, no demand, no cap: the run continues on the
|
|
85
|
+
* transition it wrote. A harness that refused the completion would be grading
|
|
86
|
+
* the agent's work with its own, which is the line every control in this
|
|
87
|
+
* package holds, and it would be refusing on a *guess* — a check that was
|
|
88
|
+
* green before an edit is the right check for a task whose bug is a crash the
|
|
89
|
+
* command never reached, and only the run knows which it has.
|
|
90
|
+
*
|
|
91
|
+
* It fires at most once per distinct verification input. The fact is about a
|
|
92
|
+
* call, the record only grows, and a run that has been told and stored the
|
|
93
|
+
* same check again has decided, which is its decision to make.
|
|
94
|
+
*
|
|
95
|
+
* @since 0.1.0
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
import { Schema } from "effect"
|
|
99
|
+
import * as Effect from "effect/Effect"
|
|
100
|
+
import type * as NarrowedCheck from "./NarrowedCheck.ts"
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* How many pristine-tree passes one run carries forward.
|
|
104
|
+
*
|
|
105
|
+
* The ledger is durable controller state, so it is bounded, and it only ever
|
|
106
|
+
* grows while the run has changed nothing: the moment a frame edits, nothing
|
|
107
|
+
* new is admitted. The longest graded run made 43 calls across 24 frames with
|
|
108
|
+
* its first edit at frame 3, so sixteen covers every check a run takes before
|
|
109
|
+
* it commits to a change. A run that outlives the bound forgets its oldest
|
|
110
|
+
* passes first, which can cost the observation and can never invent one.
|
|
111
|
+
*
|
|
112
|
+
* @category constants
|
|
113
|
+
* @since 0.1.0
|
|
114
|
+
*/
|
|
115
|
+
export const retained = 16
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* One check that passed over the tree the run was handed.
|
|
119
|
+
*
|
|
120
|
+
* @category models
|
|
121
|
+
* @since 0.1.0
|
|
122
|
+
*/
|
|
123
|
+
export class Pass extends Schema.Class<Pass>("flows/harness/VacuousVerification/Pass")({
|
|
124
|
+
/** The flow the call named. */
|
|
125
|
+
flow: Schema.String,
|
|
126
|
+
/** The call's identity, as the controller's own signature names it. */
|
|
127
|
+
signature: Schema.String,
|
|
128
|
+
/** The call's input as it was written, clipped, for the observation to quote. */
|
|
129
|
+
label: Schema.String
|
|
130
|
+
}) {}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The pristine-tree passes this run carries, oldest first and bounded.
|
|
134
|
+
*
|
|
135
|
+
* @category schemas
|
|
136
|
+
* @since 0.1.0
|
|
137
|
+
*/
|
|
138
|
+
export const Ledger = Schema.Array(Pass).pipe(
|
|
139
|
+
Schema.withConstructorDefault(Effect.succeed<ReadonlyArray<Pass>>([])),
|
|
140
|
+
Schema.withDecodingDefaultKey(Effect.succeed<ReadonlyArray<Pass>>([]))
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The pristine-tree passes this run carries, oldest first and bounded.
|
|
145
|
+
*
|
|
146
|
+
* @category models
|
|
147
|
+
* @since 0.1.0
|
|
148
|
+
*/
|
|
149
|
+
export type Ledger = typeof Ledger.Type
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Records one frame's passing checks, but only while the tree is untouched.
|
|
153
|
+
*
|
|
154
|
+
* Three conditions, and all of them are refusals rather than readings. `epoch`
|
|
155
|
+
* is the run's own count of frames that changed the workspace *before* this
|
|
156
|
+
* one, so a non-zero epoch means some earlier frame already edited and a pass
|
|
157
|
+
* taken now says nothing about the tree the run was handed. `stable` is the
|
|
158
|
+
* same question inside one frame: a frame's calls are not ordered against its
|
|
159
|
+
* edits in anything the harness records, so a check from a frame that also
|
|
160
|
+
* edited might have run on either side of it. `Sufficiency` refuses the same
|
|
161
|
+
* stamp for the same reason; see `NarrowedCheck` `Check` `stable`.
|
|
162
|
+
*
|
|
163
|
+
* `failed` is the third, and it is the one that keeps the observation from
|
|
164
|
+
* contradicting the record it is read off. A check the run has already watched
|
|
165
|
+
* *fail* over the tree it was handed is a check the run has done the contract's
|
|
166
|
+
* work on, whatever it printed the second time: it is red on the unmodified
|
|
167
|
+
* tree, and a later green reading of it at the same epoch says the command is
|
|
168
|
+
* unsteady, not that the run never saw it fail. Telling such a run its proof
|
|
169
|
+
* was "already green" would be a sentence its own journal refutes, so the
|
|
170
|
+
* signature is refused on the way in and evicted if an earlier pass already put
|
|
171
|
+
* it there. The list is the run's failing-check ledger read at epoch zero —
|
|
172
|
+
* `Sufficiency` already keeps it, stamped with the epoch each failure was
|
|
173
|
+
* watched in — so nothing new is measured or stored for this. That ledger is
|
|
174
|
+
* bounded, so a run with more distinct pre-edit failures than `Sufficiency`
|
|
175
|
+
* retains can forget one; forgetting can cost the refusal and can never invent
|
|
176
|
+
* a pass.
|
|
177
|
+
*
|
|
178
|
+
* A repeated signature keeps its first entry rather than taking a second slot:
|
|
179
|
+
* the entries are all the same tree, so re-running one adds no information and
|
|
180
|
+
* re-stamping it would only cost the ledger its oldest genuinely distinct pass.
|
|
181
|
+
*
|
|
182
|
+
* @category combinators
|
|
183
|
+
* @since 0.1.0
|
|
184
|
+
*/
|
|
185
|
+
export const remember = (
|
|
186
|
+
ledger: Ledger,
|
|
187
|
+
options: {
|
|
188
|
+
/** The checks this frame ran. */
|
|
189
|
+
readonly frame: ReadonlyArray<NarrowedCheck.Check>
|
|
190
|
+
/** Frames that had changed the workspace before this one. */
|
|
191
|
+
readonly epoch: number
|
|
192
|
+
/** Signatures this run has watched fail over the tree it was handed. */
|
|
193
|
+
readonly failed: ReadonlyArray<string>
|
|
194
|
+
}
|
|
195
|
+
): Ledger => {
|
|
196
|
+
const refused = new Set(options.failed)
|
|
197
|
+
const kept = new Map(
|
|
198
|
+
ledger.filter((entry) => !refused.has(entry.signature)).map((entry) => [entry.signature, entry])
|
|
199
|
+
)
|
|
200
|
+
if (options.epoch === 0) {
|
|
201
|
+
for (const check of options.frame) {
|
|
202
|
+
if (!check.passing || !check.stable) continue
|
|
203
|
+
if (refused.has(check.signature)) continue
|
|
204
|
+
if (kept.has(check.signature)) continue
|
|
205
|
+
kept.set(check.signature, new Pass({ flow: check.flow, signature: check.signature, label: check.label }))
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const distinct = [...kept.values()]
|
|
209
|
+
return distinct.slice(Math.max(0, distinct.length - retained))
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The `{ flow, input }` pair a cell stored as its verification, if it stored
|
|
214
|
+
* one this module can read.
|
|
215
|
+
*
|
|
216
|
+
* The reserved key and its two fields are the contract's own words, and this
|
|
217
|
+
* is the only thing the controller ever reads out of `agentState`. Anything
|
|
218
|
+
* else under `verification` — a string, a bare command, a shape the contract
|
|
219
|
+
* does not describe — reads as absent, because a state key the harness cannot
|
|
220
|
+
* parse is the cell's own memory and not a claim about evidence.
|
|
221
|
+
*
|
|
222
|
+
* @category conversions
|
|
223
|
+
* @since 0.1.0
|
|
224
|
+
*/
|
|
225
|
+
export const stored = (
|
|
226
|
+
agentState: Schema.Json
|
|
227
|
+
): { readonly flow: string; readonly input: Schema.Json } | undefined => {
|
|
228
|
+
if (agentState === null || typeof agentState !== "object" || Array.isArray(agentState)) return undefined
|
|
229
|
+
const declared = (agentState as Record<string, Schema.Json>)["verification"]
|
|
230
|
+
if (declared === null || declared === undefined || typeof declared !== "object" || Array.isArray(declared)) {
|
|
231
|
+
return undefined
|
|
232
|
+
}
|
|
233
|
+
const { flow, input } = declared as Record<string, Schema.Json>
|
|
234
|
+
return typeof flow === "string" && input !== undefined ? { flow, input } : undefined
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Finds the pristine-tree pass a stored verification is standing on.
|
|
239
|
+
*
|
|
240
|
+
* The match is on the controller's own call signature, so it is the *exact*
|
|
241
|
+
* `{ flow, input }` the contract asks a run to reuse — a broadened or narrowed
|
|
242
|
+
* command is a different call and is not this failure.
|
|
243
|
+
*
|
|
244
|
+
* `stated` is the run's record of what it has already been told, which is what
|
|
245
|
+
* keeps this to one sentence per distinct input.
|
|
246
|
+
*
|
|
247
|
+
* @category conversions
|
|
248
|
+
* @since 0.1.0
|
|
249
|
+
*/
|
|
250
|
+
export const find = (options: {
|
|
251
|
+
/** Checks that passed over the tree the run was handed, oldest first. */
|
|
252
|
+
readonly ledger: Ledger
|
|
253
|
+
/** The signature of the `{ flow, input }` the cell stored. */
|
|
254
|
+
readonly signature: string
|
|
255
|
+
/** Verification signatures this run has already been told about. */
|
|
256
|
+
readonly stated: ReadonlyArray<string>
|
|
257
|
+
}): Pass | undefined => {
|
|
258
|
+
if (options.stated.includes(options.signature)) return undefined
|
|
259
|
+
return options.ledger.find((entry) => entry.signature === options.signature)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* States that the stored proof was already green before anything changed.
|
|
264
|
+
*
|
|
265
|
+
* It quotes the call, says what the record establishes about it, and names the
|
|
266
|
+
* two things the run may do — keep it, having a reason, or go find a reading
|
|
267
|
+
* that can move. Neither is refused and neither is graded: a check that was
|
|
268
|
+
* green before the edit is the right check for a task whose bug is a crash the
|
|
269
|
+
* command never reached, and only the run knows whether that is this task.
|
|
270
|
+
*
|
|
271
|
+
* @category constructors
|
|
272
|
+
* @since 0.1.0
|
|
273
|
+
*/
|
|
274
|
+
export const observation = (found: Pass): string =>
|
|
275
|
+
`Vacuous verification — the check you stored as \`state.verification\` is a check this run already watched PASS on the unmodified tree, before any frame of it changed a byte.
|
|
276
|
+
|
|
277
|
+
- the stored check: ${found.flow} ${found.label}
|
|
278
|
+
- what this run saw it do on the tree it was handed: exit 0
|
|
279
|
+
|
|
280
|
+
Re-running it after your edit cannot show your change did anything: it reads identically on a broken tree and on a fixed one, so a green result after the edit is the same green result as before it. A proof is a check you have watched FAIL and then watched pass. Nothing is being asked of you and nothing has been refused — if this command is genuinely the only observable the task has, keep it and say in your output that it never failed and why. Otherwise the reading you still need is one that is red right now. This notice is written once per distinct verification.`
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The variables panel: what the realm holds, stated every frame.
|
|
3
|
+
*
|
|
4
|
+
* A run's memory is not a JSON document the cell filed — it is the set of names
|
|
5
|
+
* the realm is holding, and the model can only act on what the prompt says about
|
|
6
|
+
* them. This is what the prompt says.
|
|
7
|
+
*
|
|
8
|
+
* Every line is a name, its type, one *cheap* size, and when it was last bound.
|
|
9
|
+
* Nothing here is serialized whole: a panel that stringified every global would
|
|
10
|
+
* pay the heap for it every frame, and the value the model wants is already
|
|
11
|
+
* under the name the panel prints.
|
|
12
|
+
*
|
|
13
|
+
* Freshness is derived from the cheap size, which is what makes the panel cost
|
|
14
|
+
* nothing. A binding rewritten to a value of the same type and the same size —
|
|
15
|
+
* a 40-character string replaced by a different 40-character string — reads as
|
|
16
|
+
* unchanged and keeps its stamp. That bound is stated rather than hidden: the
|
|
17
|
+
* panel is a roster, and the run's own prints are what say a value moved.
|
|
18
|
+
*
|
|
19
|
+
* @since 0.1.0
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { Effect, Schema } from "effect"
|
|
23
|
+
import * as CallLedger from "./CallLedger.ts"
|
|
24
|
+
import * as elide from "./internal/elide.ts"
|
|
25
|
+
import { NonNegativeSafeInt } from "./internal/nonNegativeSafeInt.ts"
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* How many names the panel prints before it starts counting instead.
|
|
29
|
+
*
|
|
30
|
+
* Sixty-four is the same order as `CallLedger` `bound` and well above what a
|
|
31
|
+
* round near par binds: the five golfed instances hold between 6 and 21 names
|
|
32
|
+
* at their last frame. A run past the bound is shown its most recently bound
|
|
33
|
+
* names and told how many older ones it still holds.
|
|
34
|
+
*
|
|
35
|
+
* @category constants
|
|
36
|
+
* @since 0.1.0
|
|
37
|
+
*/
|
|
38
|
+
export const bound = 64
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* One name the realm holds, with the cheap facts a probe can read off it.
|
|
42
|
+
*
|
|
43
|
+
* `size` is already rendered by the probe — a string's length, an array's
|
|
44
|
+
* length, an object's key count, a function's arity, a number or boolean by
|
|
45
|
+
* value — because the value itself never crosses the realm boundary.
|
|
46
|
+
*
|
|
47
|
+
* @category models
|
|
48
|
+
* @since 0.1.0
|
|
49
|
+
*/
|
|
50
|
+
export class Binding extends Schema.Class<Binding>("flows/harness/VariablesPanel/Binding")({
|
|
51
|
+
name: Schema.String,
|
|
52
|
+
/**
|
|
53
|
+
* The name's JavaScript type, `unset` for a name a throw left unassigned, or
|
|
54
|
+
* `unreadable` for one whose value the probe could not even read — a throwing
|
|
55
|
+
* accessor, a proxy that refuses its own keys. The two are named apart because
|
|
56
|
+
* they say different things: one name holds nothing, the other holds something
|
|
57
|
+
* that will not be looked at.
|
|
58
|
+
*/
|
|
59
|
+
type: Schema.String,
|
|
60
|
+
/** One cheap measure of the value, already rendered; empty when there is none. */
|
|
61
|
+
size: Schema.String
|
|
62
|
+
}) {}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* One name the realm holds, with the frames that first and last bound it.
|
|
66
|
+
*
|
|
67
|
+
* @category models
|
|
68
|
+
* @since 0.1.0
|
|
69
|
+
*/
|
|
70
|
+
export class Stamp extends Schema.Class<Stamp>("flows/harness/VariablesPanel/Stamp")({
|
|
71
|
+
name: Schema.String,
|
|
72
|
+
type: Schema.String,
|
|
73
|
+
size: Schema.String,
|
|
74
|
+
/** The frame whose cell last changed the binding's cheap shape. */
|
|
75
|
+
frame: NonNegativeSafeInt,
|
|
76
|
+
/** The frame whose cell first bound the name. */
|
|
77
|
+
since: NonNegativeSafeInt
|
|
78
|
+
}) {}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Every name the realm holds, with the frames that bound it.
|
|
82
|
+
*
|
|
83
|
+
* @category models
|
|
84
|
+
* @since 0.1.0
|
|
85
|
+
*/
|
|
86
|
+
export const Ledger = Schema.Array(Stamp).pipe(
|
|
87
|
+
Schema.withConstructorDefault(Effect.succeed<ReadonlyArray<Stamp>>([])),
|
|
88
|
+
Schema.withDecodingDefaultKey(Effect.succeed<ReadonlyArray<Stamp>>([]))
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Every name the realm holds, with the frames that bound it.
|
|
93
|
+
*
|
|
94
|
+
* @category models
|
|
95
|
+
* @since 0.1.0
|
|
96
|
+
*/
|
|
97
|
+
export type Ledger = typeof Ledger.Type
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Re-stamps the panel against the bindings a frame closed on.
|
|
101
|
+
*
|
|
102
|
+
* A name whose type and size are unchanged keeps both of its frames, so the
|
|
103
|
+
* panel says when a binding last moved rather than that every name was touched
|
|
104
|
+
* again. A name the realm no longer reports is dropped: a `var` global cannot
|
|
105
|
+
* be deleted, so the only way a name leaves the probe's answer is the realm
|
|
106
|
+
* being rebuilt, and a roster that outlived its realm would be a lie.
|
|
107
|
+
*
|
|
108
|
+
* @category combinators
|
|
109
|
+
* @since 0.1.0
|
|
110
|
+
*/
|
|
111
|
+
export const stamp = (known: Ledger, bindings: ReadonlyArray<Binding>, frame: number): Ledger => {
|
|
112
|
+
const previous = new Map(known.map((entry) => [entry.name, entry] as const))
|
|
113
|
+
return bindings.map((binding) => {
|
|
114
|
+
const before = previous.get(binding.name)
|
|
115
|
+
if (before === undefined) {
|
|
116
|
+
return new Stamp({ name: binding.name, type: binding.type, size: binding.size, frame, since: frame })
|
|
117
|
+
}
|
|
118
|
+
return before.type === binding.type && before.size === binding.size
|
|
119
|
+
? before
|
|
120
|
+
: new Stamp({ name: binding.name, type: binding.type, size: binding.size, frame, since: before.since })
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Names how a binding stands relative to the frame that just ran. */
|
|
125
|
+
const marked = (entry: Stamp, frame: number): string => {
|
|
126
|
+
if (entry.since === frame) return "new this frame"
|
|
127
|
+
if (entry.frame === frame) return "changed this frame"
|
|
128
|
+
const age = frame - entry.frame
|
|
129
|
+
return `bound at frame ${entry.frame}, ${age} frame${age === 1 ? "" : "s"} ago`
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Renders the panel for one frame's prompt.
|
|
134
|
+
*
|
|
135
|
+
* `frame` is the frame whose cell just ran, which is what `new` and `changed`
|
|
136
|
+
* are relative to.
|
|
137
|
+
*
|
|
138
|
+
* @category conversions
|
|
139
|
+
* @since 0.1.0
|
|
140
|
+
*/
|
|
141
|
+
export const render = (options: {
|
|
142
|
+
readonly ledger: Ledger
|
|
143
|
+
readonly frame: number
|
|
144
|
+
}): string => {
|
|
145
|
+
if (options.ledger.length === 0) {
|
|
146
|
+
return "Your realm holds no names yet. Anything a cell declares at the top level is still bound in every later cell of this run."
|
|
147
|
+
}
|
|
148
|
+
const ordered = [...options.ledger].sort((left, right) => left.frame - right.frame)
|
|
149
|
+
const listed = ordered.slice(Math.max(0, ordered.length - bound))
|
|
150
|
+
const uncounted = ordered.length - listed.length
|
|
151
|
+
const lines = listed.map((entry) =>
|
|
152
|
+
elide.head(
|
|
153
|
+
`- ${entry.name} (${entry.type}${entry.size === "" ? "" : `, ${entry.size}`}) — ${marked(entry, options.frame)}`,
|
|
154
|
+
CallLedger.width,
|
|
155
|
+
"the name is what recalls the value"
|
|
156
|
+
)
|
|
157
|
+
)
|
|
158
|
+
return [
|
|
159
|
+
`Names your realm holds (${options.ledger.length}), least recently bound first. Read and compute with these instead of fetching them again:`,
|
|
160
|
+
...lines,
|
|
161
|
+
...(uncounted > 0
|
|
162
|
+
? [`- … and ${uncounted} older name${uncounted === 1 ? "" : "s"} not listed here; they are still bound.`]
|
|
163
|
+
: [])
|
|
164
|
+
].join("\n")
|
|
165
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 0.1.0
|
|
3
|
+
*
|
|
4
|
+
* `/harness` — built-in agent-loop translation contracts and pure
|
|
5
|
+
* turn helpers.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @category errors
|
|
10
|
+
* @since 0.1.0
|
|
11
|
+
*/
|
|
12
|
+
export * as HarnessError from "./HarnessError.ts"
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @category events
|
|
16
|
+
* @since 0.1.0
|
|
17
|
+
*/
|
|
18
|
+
export * as AgentEvent from "./AgentEvent.ts"
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @category controls
|
|
22
|
+
* @since 1.0.0-rc.0
|
|
23
|
+
*/
|
|
24
|
+
export * as CompletionClaim from "./CompletionClaim.ts"
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @category controls
|
|
28
|
+
* @since 1.0.0-rc.0
|
|
29
|
+
*/
|
|
30
|
+
export * as Supervisor from "./Supervisor.ts"
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @category controls
|
|
34
|
+
* @since 1.0.0-rc.0
|
|
35
|
+
*/
|
|
36
|
+
export * as Monitor from "./Monitor.ts"
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @category controls
|
|
40
|
+
* @since 1.0.0-rc.0
|
|
41
|
+
*/
|
|
42
|
+
export * as Judgement from "./Judgement.ts"
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @category controls
|
|
46
|
+
* @since 1.0.0-rc.0
|
|
47
|
+
*/
|
|
48
|
+
export * as Relevance from "./Relevance.ts"
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @category models
|
|
52
|
+
* @since 0.1.0
|
|
53
|
+
*/
|
|
54
|
+
export * as Plan from "./Plan.ts"
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @category services
|
|
58
|
+
* @since 0.1.0
|
|
59
|
+
*/
|
|
60
|
+
export * as EngineLike from "./EngineLike.ts"
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @category utilities
|
|
64
|
+
* @since 0.1.0
|
|
65
|
+
*/
|
|
66
|
+
export * as Tokens from "./Tokens.ts"
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @category models
|
|
70
|
+
* @since 0.1.0
|
|
71
|
+
*/
|
|
72
|
+
export * as ContextWindow from "./ContextWindow.ts"
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @category projections
|
|
76
|
+
* @since 0.1.0
|
|
77
|
+
*/
|
|
78
|
+
export * as Transcript from "./Transcript.ts"
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @category projections
|
|
82
|
+
* @since 1.0.0-rc.1
|
|
83
|
+
*/
|
|
84
|
+
export * as ExternalTranscript from "./ExternalTranscript.ts"
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @category compaction
|
|
88
|
+
* @since 0.1.0
|
|
89
|
+
*/
|
|
90
|
+
export * as Compaction from "./Compaction.ts"
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @category steering
|
|
94
|
+
* @since 0.1.0
|
|
95
|
+
*/
|
|
96
|
+
export * as Steering from "./Steering.ts"
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @category notifications
|
|
100
|
+
* @since 0.1.0
|
|
101
|
+
*/
|
|
102
|
+
export * as Notifications from "./Notifications.ts"
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @category models
|
|
106
|
+
* @since 0.1.0
|
|
107
|
+
*/
|
|
108
|
+
export * as Cell from "./Cell.ts"
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @category services
|
|
112
|
+
* @since 0.1.0
|
|
113
|
+
*/
|
|
114
|
+
export * as Sandbox from "./Sandbox.ts"
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @category streams
|
|
118
|
+
* @since 0.1.0
|
|
119
|
+
*/
|
|
120
|
+
export * as CellTurn from "./CellTurn.ts"
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @category services
|
|
124
|
+
* @since 0.1.0
|
|
125
|
+
*/
|
|
126
|
+
export * as CellHistory from "./CellHistory.ts"
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @category constructors
|
|
130
|
+
* @since 0.1.0
|
|
131
|
+
*/
|
|
132
|
+
export * as CellCalls from "./CellCalls.ts"
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @category constructors
|
|
136
|
+
* @since 0.1.0
|
|
137
|
+
*/
|
|
138
|
+
export * as FlowBinding from "./FlowBinding.ts"
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @category decoding
|
|
142
|
+
* @since 0.1.0
|
|
143
|
+
*/
|
|
144
|
+
export * as StructuredOutput from "./StructuredOutput.ts"
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @category models
|
|
148
|
+
* @since 0.1.0
|
|
149
|
+
*/
|
|
150
|
+
export * as TruncatedOutput from "./TruncatedOutput.ts"
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* @category models
|
|
154
|
+
* @since 0.1.0
|
|
155
|
+
*/
|
|
156
|
+
export * as CallLedger from "./CallLedger.ts"
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @category models
|
|
160
|
+
* @since 0.1.0
|
|
161
|
+
*/
|
|
162
|
+
export * as NarrowedCheck from "./NarrowedCheck.ts"
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @category conversions
|
|
166
|
+
* @since 0.1.0
|
|
167
|
+
*/
|
|
168
|
+
export * as CellValidation from "./CellValidation.ts"
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @category models
|
|
172
|
+
* @since 0.1.0
|
|
173
|
+
*/
|
|
174
|
+
export * as UnmovedTree from "./UnmovedTree.ts"
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @category models
|
|
178
|
+
* @since 0.1.0
|
|
179
|
+
*/
|
|
180
|
+
export * as UnresolvedFailure from "./UnresolvedFailure.ts"
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* @category models
|
|
184
|
+
* @since 1.0.0-rc.1
|
|
185
|
+
*/
|
|
186
|
+
export * as FailedCall from "./FailedCall.ts"
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* @category models
|
|
190
|
+
* @since 0.1.0
|
|
191
|
+
*/
|
|
192
|
+
export * as Sufficiency from "./Sufficiency.ts"
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @category models
|
|
196
|
+
* @since 0.1.0
|
|
197
|
+
*/
|
|
198
|
+
export * as VacuousVerification from "./VacuousVerification.ts"
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @category models
|
|
202
|
+
* @since 0.1.0
|
|
203
|
+
*/
|
|
204
|
+
export * as VariablesPanel from "./VariablesPanel.ts"
|