@smthrs/harness 0.0.0-stage → 1.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +387 -0
- package/LICENSE +21 -0
- package/README.md +138 -2
- package/dist/cjs/AgentEvent.d.ts +3092 -0
- package/dist/cjs/AgentEvent.d.ts.map +1 -0
- package/dist/cjs/AgentEvent.js +1116 -0
- package/dist/cjs/AgentEvent.js.map +7 -0
- package/dist/cjs/CallLedger.d.ts +378 -0
- package/dist/cjs/CallLedger.d.ts.map +1 -0
- package/dist/cjs/CallLedger.js +240 -0
- package/dist/cjs/CallLedger.js.map +7 -0
- package/dist/cjs/Cell.d.ts +774 -0
- package/dist/cjs/Cell.d.ts.map +1 -0
- package/dist/cjs/Cell.js +431 -0
- package/dist/cjs/Cell.js.map +7 -0
- package/dist/cjs/CellCalls.d.ts +115 -0
- package/dist/cjs/CellCalls.d.ts.map +1 -0
- package/dist/cjs/CellCalls.js +98 -0
- package/dist/cjs/CellCalls.js.map +7 -0
- package/dist/cjs/CellHistory.d.ts +102 -0
- package/dist/cjs/CellHistory.d.ts.map +1 -0
- package/dist/cjs/CellHistory.js +54 -0
- package/dist/cjs/CellHistory.js.map +7 -0
- package/dist/cjs/CellTurn.d.ts +1071 -0
- package/dist/cjs/CellTurn.d.ts.map +1 -0
- package/dist/cjs/CellTurn.js +2618 -0
- package/dist/cjs/CellTurn.js.map +7 -0
- package/dist/cjs/CellValidation.d.ts +94 -0
- package/dist/cjs/CellValidation.d.ts.map +1 -0
- package/dist/cjs/CellValidation.js +218 -0
- package/dist/cjs/CellValidation.js.map +7 -0
- package/dist/cjs/Compaction.d.ts +158 -0
- package/dist/cjs/Compaction.d.ts.map +1 -0
- package/dist/cjs/Compaction.js +189 -0
- package/dist/cjs/Compaction.js.map +7 -0
- package/dist/cjs/CompletionClaim.d.ts +801 -0
- package/dist/cjs/CompletionClaim.d.ts.map +1 -0
- package/dist/cjs/CompletionClaim.js +303 -0
- package/dist/cjs/CompletionClaim.js.map +7 -0
- package/dist/cjs/ContextWindow.d.ts +435 -0
- package/dist/cjs/ContextWindow.d.ts.map +1 -0
- package/dist/cjs/ContextWindow.js +319 -0
- package/dist/cjs/ContextWindow.js.map +7 -0
- package/dist/cjs/EngineLike.d.ts +546 -0
- package/dist/cjs/EngineLike.d.ts.map +1 -0
- package/dist/cjs/EngineLike.js +114 -0
- package/dist/cjs/EngineLike.js.map +7 -0
- package/dist/cjs/ExternalTranscript.d.ts +349 -0
- package/dist/cjs/ExternalTranscript.d.ts.map +1 -0
- package/dist/cjs/ExternalTranscript.js +826 -0
- package/dist/cjs/ExternalTranscript.js.map +7 -0
- package/dist/cjs/FailedCall.d.ts +132 -0
- package/dist/cjs/FailedCall.d.ts.map +1 -0
- package/dist/cjs/FailedCall.js +53 -0
- package/dist/cjs/FailedCall.js.map +7 -0
- package/dist/cjs/FlowBinding.d.ts +289 -0
- package/dist/cjs/FlowBinding.d.ts.map +1 -0
- package/dist/cjs/FlowBinding.js +251 -0
- package/dist/cjs/FlowBinding.js.map +7 -0
- package/dist/cjs/HarnessError.d.ts +57 -0
- package/dist/cjs/HarnessError.d.ts.map +1 -0
- package/dist/cjs/HarnessError.js +75 -0
- package/dist/cjs/HarnessError.js.map +7 -0
- package/dist/cjs/Judgement.d.ts +289 -0
- package/dist/cjs/Judgement.d.ts.map +1 -0
- package/dist/cjs/Judgement.js +240 -0
- package/dist/cjs/Judgement.js.map +7 -0
- package/dist/cjs/Monitor.d.ts +374 -0
- package/dist/cjs/Monitor.d.ts.map +1 -0
- package/dist/cjs/Monitor.js +233 -0
- package/dist/cjs/Monitor.js.map +7 -0
- package/dist/cjs/NarrowedCheck.d.ts +523 -0
- package/dist/cjs/NarrowedCheck.d.ts.map +1 -0
- package/dist/cjs/NarrowedCheck.js +263 -0
- package/dist/cjs/NarrowedCheck.js.map +7 -0
- package/dist/cjs/Notifications.d.ts +42 -0
- package/dist/cjs/Notifications.d.ts.map +1 -0
- package/dist/cjs/Notifications.js +177 -0
- package/dist/cjs/Notifications.js.map +7 -0
- package/dist/cjs/Plan.d.ts +127 -0
- package/dist/cjs/Plan.d.ts.map +1 -0
- package/dist/cjs/Plan.js +77 -0
- package/dist/cjs/Plan.js.map +7 -0
- package/dist/cjs/QuickJSSandbox.d.ts +151 -0
- package/dist/cjs/QuickJSSandbox.d.ts.map +1 -0
- package/dist/cjs/QuickJSSandbox.js +987 -0
- package/dist/cjs/QuickJSSandbox.js.map +7 -0
- package/dist/cjs/Relevance.d.ts +213 -0
- package/dist/cjs/Relevance.d.ts.map +1 -0
- package/dist/cjs/Relevance.js +183 -0
- package/dist/cjs/Relevance.js.map +7 -0
- package/dist/cjs/Sandbox.d.ts +637 -0
- package/dist/cjs/Sandbox.d.ts.map +1 -0
- package/dist/cjs/Sandbox.js +260 -0
- package/dist/cjs/Sandbox.js.map +7 -0
- package/dist/cjs/Steering.d.ts +464 -0
- package/dist/cjs/Steering.d.ts.map +1 -0
- package/dist/cjs/Steering.js +153 -0
- package/dist/cjs/Steering.js.map +7 -0
- package/dist/cjs/StructuredOutput.d.ts +252 -0
- package/dist/cjs/StructuredOutput.d.ts.map +1 -0
- package/dist/cjs/StructuredOutput.js +266 -0
- package/dist/cjs/StructuredOutput.js.map +7 -0
- package/dist/cjs/Sufficiency.d.ts +195 -0
- package/dist/cjs/Sufficiency.d.ts.map +1 -0
- package/dist/cjs/Sufficiency.js +110 -0
- package/dist/cjs/Sufficiency.js.map +7 -0
- package/dist/cjs/Supervisor.d.ts +719 -0
- package/dist/cjs/Supervisor.d.ts.map +1 -0
- package/dist/cjs/Supervisor.js +313 -0
- package/dist/cjs/Supervisor.js.map +7 -0
- package/dist/cjs/Tokens.d.ts +86 -0
- package/dist/cjs/Tokens.d.ts.map +1 -0
- package/dist/cjs/Tokens.js +72 -0
- package/dist/cjs/Tokens.js.map +7 -0
- package/dist/cjs/Transcript.d.ts +171 -0
- package/dist/cjs/Transcript.d.ts.map +1 -0
- package/dist/cjs/Transcript.js +342 -0
- package/dist/cjs/Transcript.js.map +7 -0
- package/dist/cjs/TruncatedOutput.d.ts +186 -0
- package/dist/cjs/TruncatedOutput.d.ts.map +1 -0
- package/dist/cjs/TruncatedOutput.js +143 -0
- package/dist/cjs/TruncatedOutput.js.map +7 -0
- package/dist/cjs/UnmovedTree.d.ts +113 -0
- package/dist/cjs/UnmovedTree.d.ts.map +1 -0
- package/dist/cjs/UnmovedTree.js +38 -0
- package/dist/cjs/UnmovedTree.js.map +7 -0
- package/dist/cjs/UnresolvedFailure.d.ts +196 -0
- package/dist/cjs/UnresolvedFailure.d.ts.map +1 -0
- package/dist/cjs/UnresolvedFailure.js +77 -0
- package/dist/cjs/UnresolvedFailure.js.map +7 -0
- package/dist/cjs/VacuousVerification.d.ts +237 -0
- package/dist/cjs/VacuousVerification.d.ts.map +1 -0
- package/dist/cjs/VacuousVerification.js +91 -0
- package/dist/cjs/VacuousVerification.js.map +7 -0
- package/dist/cjs/VariablesPanel.d.ts +117 -0
- package/dist/cjs/VariablesPanel.d.ts.map +1 -0
- package/dist/cjs/VariablesPanel.js +108 -0
- package/dist/cjs/VariablesPanel.js.map +7 -0
- package/dist/cjs/index.d.ts +172 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +99 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/internal/bytes.d.ts +36 -0
- package/dist/cjs/internal/bytes.d.ts.map +1 -0
- package/dist/cjs/internal/bytes.js +57 -0
- package/dist/cjs/internal/bytes.js.map +7 -0
- package/dist/cjs/internal/cellPrompt.d.ts +122 -0
- package/dist/cjs/internal/cellPrompt.d.ts.map +1 -0
- package/dist/cjs/internal/cellPrompt.js +146 -0
- package/dist/cjs/internal/cellPrompt.js.map +7 -0
- package/dist/cjs/internal/compactable.d.ts +44 -0
- package/dist/cjs/internal/compactable.d.ts.map +1 -0
- package/dist/cjs/internal/compactable.js +56 -0
- package/dist/cjs/internal/compactable.js.map +7 -0
- package/dist/cjs/internal/compactionMarks.d.ts +278 -0
- package/dist/cjs/internal/compactionMarks.d.ts.map +1 -0
- package/dist/cjs/internal/compactionMarks.js +212 -0
- package/dist/cjs/internal/compactionMarks.js.map +7 -0
- package/dist/cjs/internal/demandText.d.ts +95 -0
- package/dist/cjs/internal/demandText.d.ts.map +1 -0
- package/dist/cjs/internal/demandText.js +70 -0
- package/dist/cjs/internal/demandText.js.map +7 -0
- package/dist/cjs/internal/elide.d.ts +109 -0
- package/dist/cjs/internal/elide.d.ts.map +1 -0
- package/dist/cjs/internal/elide.js +59 -0
- package/dist/cjs/internal/elide.js.map +7 -0
- package/dist/cjs/internal/frame.d.ts +463 -0
- package/dist/cjs/internal/frame.d.ts.map +1 -0
- package/dist/cjs/internal/frame.js +514 -0
- package/dist/cjs/internal/frame.js.map +7 -0
- package/dist/cjs/internal/nonNegativeSafeInt.d.ts +20 -0
- package/dist/cjs/internal/nonNegativeSafeInt.d.ts.map +1 -0
- package/dist/cjs/internal/nonNegativeSafeInt.js +29 -0
- package/dist/cjs/internal/nonNegativeSafeInt.js.map +7 -0
- package/dist/cjs/internal/paidUsage.d.ts +52 -0
- package/dist/cjs/internal/paidUsage.d.ts.map +1 -0
- package/dist/cjs/internal/paidUsage.js +70 -0
- package/dist/cjs/internal/paidUsage.js.map +7 -0
- package/dist/cjs/internal/printChannel.d.ts +233 -0
- package/dist/cjs/internal/printChannel.d.ts.map +1 -0
- package/dist/cjs/internal/printChannel.js +165 -0
- package/dist/cjs/internal/printChannel.js.map +7 -0
- package/dist/cjs/internal/printsObservation.d.ts +26 -0
- package/dist/cjs/internal/printsObservation.d.ts.map +1 -0
- package/dist/cjs/internal/printsObservation.js +27 -0
- package/dist/cjs/internal/printsObservation.js.map +7 -0
- package/dist/cjs/internal/refusal.d.ts +40 -0
- package/dist/cjs/internal/refusal.d.ts.map +1 -0
- package/dist/cjs/internal/refusal.js +45 -0
- package/dist/cjs/internal/refusal.js.map +7 -0
- package/dist/cjs/internal/supervision.d.ts +174 -0
- package/dist/cjs/internal/supervision.d.ts.map +1 -0
- package/dist/cjs/internal/supervision.js +402 -0
- package/dist/cjs/internal/supervision.js.map +7 -0
- package/dist/cjs/internal/unfinishedWork.d.ts +99 -0
- package/dist/cjs/internal/unfinishedWork.d.ts.map +1 -0
- package/dist/cjs/internal/unfinishedWork.js +80 -0
- package/dist/cjs/internal/unfinishedWork.js.map +7 -0
- package/dist/cjs/internal/unobservedCall.d.ts +112 -0
- package/dist/cjs/internal/unobservedCall.d.ts.map +1 -0
- package/dist/cjs/internal/unobservedCall.js +345 -0
- package/dist/cjs/internal/unobservedCall.js.map +7 -0
- package/dist/cjs/internal/untrustedData.d.ts +14 -0
- package/dist/cjs/internal/untrustedData.d.ts.map +1 -0
- package/dist/cjs/internal/untrustedData.js +30 -0
- package/dist/cjs/internal/untrustedData.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/AgentEvent.d.ts +3092 -0
- package/dist/esm/AgentEvent.d.ts.map +1 -0
- package/dist/esm/AgentEvent.js +1610 -0
- package/dist/esm/AgentEvent.js.map +1 -0
- package/dist/esm/CallLedger.d.ts +378 -0
- package/dist/esm/CallLedger.d.ts.map +1 -0
- package/dist/esm/CallLedger.js +506 -0
- package/dist/esm/CallLedger.js.map +1 -0
- package/dist/esm/Cell.d.ts +774 -0
- package/dist/esm/Cell.d.ts.map +1 -0
- package/dist/esm/Cell.js +772 -0
- package/dist/esm/Cell.js.map +1 -0
- package/dist/esm/CellCalls.d.ts +115 -0
- package/dist/esm/CellCalls.d.ts.map +1 -0
- package/dist/esm/CellCalls.js +97 -0
- package/dist/esm/CellCalls.js.map +1 -0
- package/dist/esm/CellHistory.d.ts +102 -0
- package/dist/esm/CellHistory.d.ts.map +1 -0
- package/dist/esm/CellHistory.js +91 -0
- package/dist/esm/CellHistory.js.map +1 -0
- package/dist/esm/CellTurn.d.ts +1071 -0
- package/dist/esm/CellTurn.d.ts.map +1 -0
- package/dist/esm/CellTurn.js +3410 -0
- package/dist/esm/CellTurn.js.map +1 -0
- package/dist/esm/CellValidation.d.ts +94 -0
- package/dist/esm/CellValidation.d.ts.map +1 -0
- package/dist/esm/CellValidation.js +335 -0
- package/dist/esm/CellValidation.js.map +1 -0
- package/dist/esm/Compaction.d.ts +158 -0
- package/dist/esm/Compaction.d.ts.map +1 -0
- package/dist/esm/Compaction.js +216 -0
- package/dist/esm/Compaction.js.map +1 -0
- package/dist/esm/CompletionClaim.d.ts +801 -0
- package/dist/esm/CompletionClaim.d.ts.map +1 -0
- package/dist/esm/CompletionClaim.js +833 -0
- package/dist/esm/CompletionClaim.js.map +1 -0
- package/dist/esm/ContextWindow.d.ts +435 -0
- package/dist/esm/ContextWindow.d.ts.map +1 -0
- package/dist/esm/ContextWindow.js +427 -0
- package/dist/esm/ContextWindow.js.map +1 -0
- package/dist/esm/EngineLike.d.ts +546 -0
- package/dist/esm/EngineLike.d.ts.map +1 -0
- package/dist/esm/EngineLike.js +218 -0
- package/dist/esm/EngineLike.js.map +1 -0
- package/dist/esm/ExternalTranscript.d.ts +349 -0
- package/dist/esm/ExternalTranscript.d.ts.map +1 -0
- package/dist/esm/ExternalTranscript.js +987 -0
- package/dist/esm/ExternalTranscript.js.map +1 -0
- package/dist/esm/FailedCall.d.ts +132 -0
- package/dist/esm/FailedCall.d.ts.map +1 -0
- package/dist/esm/FailedCall.js +131 -0
- package/dist/esm/FailedCall.js.map +1 -0
- package/dist/esm/FlowBinding.d.ts +289 -0
- package/dist/esm/FlowBinding.d.ts.map +1 -0
- package/dist/esm/FlowBinding.js +376 -0
- package/dist/esm/FlowBinding.js.map +1 -0
- package/dist/esm/HarnessError.d.ts +57 -0
- package/dist/esm/HarnessError.d.ts.map +1 -0
- package/dist/esm/HarnessError.js +85 -0
- package/dist/esm/HarnessError.js.map +1 -0
- package/dist/esm/Judgement.d.ts +289 -0
- package/dist/esm/Judgement.d.ts.map +1 -0
- package/dist/esm/Judgement.js +305 -0
- package/dist/esm/Judgement.js.map +1 -0
- package/dist/esm/Monitor.d.ts +374 -0
- package/dist/esm/Monitor.d.ts.map +1 -0
- package/dist/esm/Monitor.js +370 -0
- package/dist/esm/Monitor.js.map +1 -0
- package/dist/esm/NarrowedCheck.d.ts +523 -0
- package/dist/esm/NarrowedCheck.d.ts.map +1 -0
- package/dist/esm/NarrowedCheck.js +612 -0
- package/dist/esm/NarrowedCheck.js.map +1 -0
- package/dist/esm/Notifications.d.ts +42 -0
- package/dist/esm/Notifications.d.ts.map +1 -0
- package/dist/esm/Notifications.js +215 -0
- package/dist/esm/Notifications.js.map +1 -0
- package/dist/esm/Plan.d.ts +127 -0
- package/dist/esm/Plan.d.ts.map +1 -0
- package/dist/esm/Plan.js +97 -0
- package/dist/esm/Plan.js.map +1 -0
- package/dist/esm/QuickJSSandbox.d.ts +151 -0
- package/dist/esm/QuickJSSandbox.d.ts.map +1 -0
- package/dist/esm/QuickJSSandbox.js +1364 -0
- package/dist/esm/QuickJSSandbox.js.map +1 -0
- package/dist/esm/Relevance.d.ts +213 -0
- package/dist/esm/Relevance.d.ts.map +1 -0
- package/dist/esm/Relevance.js +254 -0
- package/dist/esm/Relevance.js.map +1 -0
- package/dist/esm/Sandbox.d.ts +637 -0
- package/dist/esm/Sandbox.d.ts.map +1 -0
- package/dist/esm/Sandbox.js +464 -0
- package/dist/esm/Sandbox.js.map +1 -0
- package/dist/esm/Steering.d.ts +464 -0
- package/dist/esm/Steering.d.ts.map +1 -0
- package/dist/esm/Steering.js +193 -0
- package/dist/esm/Steering.js.map +1 -0
- package/dist/esm/StructuredOutput.d.ts +252 -0
- package/dist/esm/StructuredOutput.d.ts.map +1 -0
- package/dist/esm/StructuredOutput.js +430 -0
- package/dist/esm/StructuredOutput.js.map +1 -0
- package/dist/esm/Sufficiency.d.ts +195 -0
- package/dist/esm/Sufficiency.d.ts.map +1 -0
- package/dist/esm/Sufficiency.js +207 -0
- package/dist/esm/Sufficiency.js.map +1 -0
- package/dist/esm/Supervisor.d.ts +719 -0
- package/dist/esm/Supervisor.d.ts.map +1 -0
- package/dist/esm/Supervisor.js +575 -0
- package/dist/esm/Supervisor.js.map +1 -0
- package/dist/esm/Tokens.d.ts +86 -0
- package/dist/esm/Tokens.d.ts.map +1 -0
- package/dist/esm/Tokens.js +92 -0
- package/dist/esm/Tokens.js.map +1 -0
- package/dist/esm/Transcript.d.ts +171 -0
- package/dist/esm/Transcript.d.ts.map +1 -0
- package/dist/esm/Transcript.js +424 -0
- package/dist/esm/Transcript.js.map +1 -0
- package/dist/esm/TruncatedOutput.d.ts +186 -0
- package/dist/esm/TruncatedOutput.d.ts.map +1 -0
- package/dist/esm/TruncatedOutput.js +257 -0
- package/dist/esm/TruncatedOutput.js.map +1 -0
- package/dist/esm/UnmovedTree.d.ts +113 -0
- package/dist/esm/UnmovedTree.d.ts.map +1 -0
- package/dist/esm/UnmovedTree.js +90 -0
- package/dist/esm/UnmovedTree.js.map +1 -0
- package/dist/esm/UnresolvedFailure.d.ts +196 -0
- package/dist/esm/UnresolvedFailure.d.ts.map +1 -0
- package/dist/esm/UnresolvedFailure.js +218 -0
- package/dist/esm/UnresolvedFailure.js.map +1 -0
- package/dist/esm/VacuousVerification.d.ts +237 -0
- package/dist/esm/VacuousVerification.d.ts.map +1 -0
- package/dist/esm/VacuousVerification.js +245 -0
- package/dist/esm/VacuousVerification.js.map +1 -0
- package/dist/esm/VariablesPanel.d.ts +117 -0
- package/dist/esm/VariablesPanel.d.ts.map +1 -0
- package/dist/esm/VariablesPanel.js +142 -0
- package/dist/esm/VariablesPanel.js.map +1 -0
- package/dist/esm/index.d.ts +172 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +172 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/bytes.d.ts +36 -0
- package/dist/esm/internal/bytes.d.ts.map +1 -0
- package/dist/esm/internal/bytes.js +70 -0
- package/dist/esm/internal/bytes.js.map +1 -0
- package/dist/esm/internal/cellPrompt.d.ts +122 -0
- package/dist/esm/internal/cellPrompt.d.ts.map +1 -0
- package/dist/esm/internal/cellPrompt.js +276 -0
- package/dist/esm/internal/cellPrompt.js.map +1 -0
- package/dist/esm/internal/compactable.d.ts +44 -0
- package/dist/esm/internal/compactable.d.ts.map +1 -0
- package/dist/esm/internal/compactable.js +71 -0
- package/dist/esm/internal/compactable.js.map +1 -0
- package/dist/esm/internal/compactionMarks.d.ts +278 -0
- package/dist/esm/internal/compactionMarks.d.ts.map +1 -0
- package/dist/esm/internal/compactionMarks.js +317 -0
- package/dist/esm/internal/compactionMarks.js.map +1 -0
- package/dist/esm/internal/demandText.d.ts +95 -0
- package/dist/esm/internal/demandText.d.ts.map +1 -0
- package/dist/esm/internal/demandText.js +128 -0
- package/dist/esm/internal/demandText.js.map +1 -0
- package/dist/esm/internal/elide.d.ts +109 -0
- package/dist/esm/internal/elide.d.ts.map +1 -0
- package/dist/esm/internal/elide.js +123 -0
- package/dist/esm/internal/elide.js.map +1 -0
- package/dist/esm/internal/frame.d.ts +463 -0
- package/dist/esm/internal/frame.d.ts.map +1 -0
- package/dist/esm/internal/frame.js +861 -0
- package/dist/esm/internal/frame.js.map +1 -0
- package/dist/esm/internal/nonNegativeSafeInt.d.ts +20 -0
- package/dist/esm/internal/nonNegativeSafeInt.d.ts.map +1 -0
- package/dist/esm/internal/nonNegativeSafeInt.js +20 -0
- package/dist/esm/internal/nonNegativeSafeInt.js.map +1 -0
- package/dist/esm/internal/paidUsage.d.ts +52 -0
- package/dist/esm/internal/paidUsage.d.ts.map +1 -0
- package/dist/esm/internal/paidUsage.js +72 -0
- package/dist/esm/internal/paidUsage.js.map +1 -0
- package/dist/esm/internal/printChannel.d.ts +233 -0
- package/dist/esm/internal/printChannel.d.ts.map +1 -0
- package/dist/esm/internal/printChannel.js +376 -0
- package/dist/esm/internal/printChannel.js.map +1 -0
- package/dist/esm/internal/printsObservation.d.ts +26 -0
- package/dist/esm/internal/printsObservation.d.ts.map +1 -0
- package/dist/esm/internal/printsObservation.js +29 -0
- package/dist/esm/internal/printsObservation.js.map +1 -0
- package/dist/esm/internal/refusal.d.ts +40 -0
- package/dist/esm/internal/refusal.d.ts.map +1 -0
- package/dist/esm/internal/refusal.js +47 -0
- package/dist/esm/internal/refusal.js.map +1 -0
- package/dist/esm/internal/supervision.d.ts +174 -0
- package/dist/esm/internal/supervision.d.ts.map +1 -0
- package/dist/esm/internal/supervision.js +485 -0
- package/dist/esm/internal/supervision.js.map +1 -0
- package/dist/esm/internal/unfinishedWork.d.ts +99 -0
- package/dist/esm/internal/unfinishedWork.d.ts.map +1 -0
- package/dist/esm/internal/unfinishedWork.js +85 -0
- package/dist/esm/internal/unfinishedWork.js.map +1 -0
- package/dist/esm/internal/unobservedCall.d.ts +112 -0
- package/dist/esm/internal/unobservedCall.d.ts.map +1 -0
- package/dist/esm/internal/unobservedCall.js +501 -0
- package/dist/esm/internal/unobservedCall.js.map +1 -0
- package/dist/esm/internal/untrustedData.d.ts +14 -0
- package/dist/esm/internal/untrustedData.d.ts.map +1 -0
- package/dist/esm/internal/untrustedData.js +15 -0
- package/dist/esm/internal/untrustedData.js.map +1 -0
- package/docs/README.md +129 -0
- package/docs/api.md +1869 -0
- package/docs/concepts.md +238 -0
- package/docs/external-transcripts.md +245 -0
- package/docs/guides/bind-flows.md +167 -0
- package/docs/guides/drive-the-loop.md +265 -0
- package/docs/guides/run-cells.md +262 -0
- package/docs/guides/workerd.md +144 -0
- package/docs/installation.md +69 -0
- package/docs/quickstart.md +121 -0
- package/docs/reference.md +954 -0
- package/docs/troubleshooting.md +177 -0
- package/package.json +463 -3
- package/src/AgentEvent.ts +1772 -0
- package/src/CallLedger.ts +560 -0
- package/src/Cell.ts +926 -0
- package/src/CellCalls.ts +198 -0
- package/src/CellHistory.ts +128 -0
- package/src/CellTurn.ts +4450 -0
- package/src/CellValidation.ts +382 -0
- package/src/Compaction.ts +330 -0
- package/src/CompletionClaim.ts +1013 -0
- package/src/ContextWindow.ts +669 -0
- package/src/EngineLike.ts +614 -0
- package/src/ExternalTranscript.ts +1143 -0
- package/src/FailedCall.ts +163 -0
- package/src/FlowBinding.ts +603 -0
- package/src/HarnessError.ts +98 -0
- package/src/Judgement.ts +526 -0
- package/src/Monitor.ts +579 -0
- package/src/NarrowedCheck.ts +694 -0
- package/src/Notifications.ts +262 -0
- package/src/Plan.ts +113 -0
- package/src/QuickJSSandbox.ts +1557 -0
- package/src/Relevance.ts +352 -0
- package/src/Sandbox.ts +908 -0
- package/src/Steering.ts +405 -0
- package/src/StructuredOutput.ts +484 -0
- package/src/Sufficiency.ts +247 -0
- package/src/Supervisor.ts +798 -0
- package/src/Tokens.ts +108 -0
- package/src/Transcript.ts +513 -0
- package/src/TruncatedOutput.ts +297 -0
- package/src/UnmovedTree.ts +121 -0
- package/src/UnresolvedFailure.ts +240 -0
- package/src/VacuousVerification.ts +280 -0
- package/src/VariablesPanel.ts +165 -0
- package/src/index.ts +204 -0
- package/src/internal/bytes.ts +70 -0
- package/src/internal/cellPrompt.ts +337 -0
- package/src/internal/compactable.ts +76 -0
- package/src/internal/compactionMarks.ts +454 -0
- package/src/internal/demandText.ts +145 -0
- package/src/internal/elide.ts +130 -0
- package/src/internal/frame.ts +1178 -0
- package/src/internal/nonNegativeSafeInt.ts +24 -0
- package/src/internal/paidUsage.ts +90 -0
- package/src/internal/printChannel.ts +434 -0
- package/src/internal/printsObservation.ts +31 -0
- package/src/internal/refusal.ts +53 -0
- package/src/internal/supervision.ts +652 -0
- package/src/internal/unfinishedWork.ts +123 -0
- package/src/internal/unobservedCall.ts +536 -0
- package/src/internal/untrustedData.ts +19 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalTranscript.js","sourceRoot":"","sources":["../../src/ExternalTranscript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,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AW,CAAC,KAAK,CAAC,EAAE;QAC9E,OAAO;KACR,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["/**\n * The conversations of agents a person runs beside Smithers, decoded from the agent's own transcript file\n * into ordered, read-only entries (mvp.md M-38, ui-components.md T-UI-07 S2).\n *\n * Every entry carries its origin, agent kind, format version, session, source record identity and\n * `read_only: true`; who the owner and the agent participant are is the caller's to say, never the\n * transcript's. Decoding is pure: the caller supplies bytes in any chunking and keeps the returned state,\n * so a growing file is tailed by decoding only what was appended. An incomplete last line waits for more\n * bytes. A complete line that is not a record, a transcript without a version, a version this module does\n * not support, and a record, event, item or content block this module does not name are tagged errors,\n * never a guess: every skipped kind is listed below by name.\n *\n * Codex: `rollout-*.jsonl` files under `$CODEX_HOME/sessions`, profile `codex-rollout/<major.minor>` from\n * the CLI release in `session_meta`. Items come from `event_msg` `item_completed` rows. `response_item` rows\n * repeat them for the model and are skipped, except three the items leave out: a message between agents\n * (`agent_message`), whose encrypted body is one placeholder; a code-mode script that failed\n * (`custom_tool_call_output`), with the request that started it; and nothing else.\n *\n * Claude Code: `<session>.jsonl` files under `~/.claude/projects/<project>`, profile `claude-code/<major.minor>`\n * from the `version` every conversation record carries. A tool call becomes one entry when its result arrives;\n * the named bookkeeping rows outside the conversation chain (no `uuid`) are skipped.\n *\n * @since 1.0.0-rc.1\n */\n\nimport * as Fault from \"@smthrs/flow/Fault\"\nimport { Result, Schema } from \"effect\"\n\n/**\n * The agents whose transcripts decode here.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport const AgentKind = Schema.Literals([\"codex\", \"claude-code\"])\n\n/**\n * The value decoded by {@link AgentKind}.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport type AgentKind = typeof AgentKind.Type\n\n/**\n * One edited file as the agent reported it: its path, the kind of change and the unified diff.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport const EditedFile = Schema.Struct({\n path: Schema.String,\n change: Schema.Literals([\"added\", \"modified\", \"deleted\", \"renamed\"]),\n renamed_to: Schema.optional(Schema.String),\n diff: Schema.String\n})\n\n/**\n * What one entry says. Tool parts keep the agent's correlation id; edits keep the path and the reported\n * outcome; a body the agent encrypted is a placeholder in its place, never dropped.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport const Part = Schema.Union([\n Schema.Struct({ type: Schema.Literal(\"prompt\"), text: Schema.String }),\n Schema.Struct({ type: Schema.Literal(\"goal\"), objective: Schema.String, status: Schema.String }),\n Schema.Struct({ type: Schema.Literal(\"text\"), text: Schema.String, final: Schema.Boolean }),\n Schema.Struct({ type: Schema.Literal(\"reasoning\"), text: Schema.String }),\n Schema.Struct({ type: Schema.Literal(\"encrypted\") }),\n Schema.Struct({\n type: Schema.Literal(\"tool\"),\n call_id: Schema.String,\n command: Schema.String,\n /** Set when every part of the command only reads, searches or lists: \"Read mvp.md\". */\n reads: Schema.Array(Schema.String),\n status: Schema.Literals([\"ok\", \"error\", \"running\"]),\n exit_code: Schema.optional(Schema.Number),\n output: Schema.String,\n duration_ms: Schema.Number\n }),\n Schema.Struct({\n type: Schema.Literal(\"edit\"),\n call_id: Schema.String,\n files: Schema.Array(EditedFile),\n outcome: Schema.Literals([\"applied\", \"failed\"])\n }),\n Schema.Struct({ type: Schema.Literal(\"search\"), call_id: Schema.String, query: Schema.String }),\n Schema.Struct({\n type: Schema.Literal(\"helper\"),\n call_id: Schema.String,\n agent: Schema.String,\n activity: Schema.String\n }),\n Schema.Struct({ type: Schema.Literal(\"compaction\") }),\n Schema.Struct({ type: Schema.Literal(\"error\"), message: Schema.String })\n])\n\n/**\n * The value decoded by {@link Part}.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport type Part = typeof Part.Type\n\n/**\n * One read-only entry of an external conversation, in source order.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport const Entry = Schema.Struct({\n origin: Schema.Literal(\"external\"),\n agent_kind: AgentKind,\n format_version: Schema.String,\n session_id: Schema.String,\n /**\n * The record this entry came from: `<session>:<line>`. A record that yields several entries numbers the later\n * ones `<session>:<line>#<n>`.\n */\n source_id: Schema.String,\n read_only: Schema.Literal(true),\n seq: Schema.Number,\n /** Milliseconds since the epoch, from the record. */\n at: Schema.Number,\n turn_id: Schema.optional(Schema.String),\n /** `user` entries are the owner's; `assistant` entries are the agent's. */\n role: Schema.Literals([\"user\", \"assistant\"]),\n part: Part\n})\n\n/**\n * The value decoded by {@link Entry}.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport type Entry = typeof Entry.Type\n\n/**\n * Why a transcript did not decode.\n *\n * @category errors\n * @since 1.0.0-rc.1\n */\nexport const ExternalTranscriptErrorCode = Schema.Literals([\n \"missing_version\",\n \"unsupported_version\",\n \"unsupported_record\",\n \"malformed_record\"\n])\n\n/**\n * The value decoded by {@link ExternalTranscriptErrorCode}.\n *\n * @category errors\n * @since 1.0.0-rc.1\n */\nexport type ExternalTranscriptErrorCode = typeof ExternalTranscriptErrorCode.Type\n\n/**\n * A transcript this module refuses to read, with the line it stopped at.\n *\n * @category errors\n * @since 1.0.0-rc.1\n */\nexport class ExternalTranscriptError\n extends Schema.TaggedError<ExternalTranscriptError>()(\"harness/ExternalTranscriptError\", {\n code: ExternalTranscriptErrorCode,\n message: Schema.String,\n line: Schema.Number\n })\n{}\nFault.register(\n \"harness/ExternalTranscriptError\",\n {\n // The agent wrote a transcript this release cannot read: a format change outside Smithers.\n missing_version: \"dependency\",\n unsupported_version: \"dependency\",\n unsupported_record: \"dependency\",\n malformed_record: \"dependency\"\n } satisfies Fault.Rows<ExternalTranscriptErrorCode>\n)\n\n/**\n * The Codex CLI releases whose rollout shape this module reads, by `major.minor`.\n *\n * @category constants\n * @since 1.0.0-rc.1\n */\nexport const codexReleases: ReadonlyArray<string> = [\"0.159\", \"0.160\"]\n\n/**\n * What a Codex decode remembers between chunks.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport interface CodexState {\n /** Bytes after the last newline: a line the agent is still writing. */\n readonly pending: string\n /** Complete lines read so far. */\n readonly line: number\n /** Entries emitted so far. */\n readonly seq: number\n readonly session?: { readonly id: string; readonly format_version: string; readonly cwd: string } | undefined\n readonly goal?: string | undefined\n /** Code-mode scripts whose output has not arrived, by `call_id`: text the decoder keeps and never runs. */\n readonly calls?: Readonly<Record<string, CodexCall>> | undefined\n}\n\n/**\n * A Codex code-mode request waiting for its output: the tool's name and the script it was given.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport interface CodexCall {\n readonly name: string\n readonly input: string\n}\n\n/**\n * The state before the first byte.\n *\n * @category constructors\n * @since 1.0.0-rc.1\n */\nexport const codexStart: CodexState = { pending: \"\", line: 0, seq: 0 }\n\n/**\n * A decoded chunk: the entries it completed and the state to pass with the next chunk.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport interface Decoded<State = CodexState> {\n readonly state: State\n readonly entries: ReadonlyArray<Entry>\n}\n\ntype Json = Record<string, unknown>\nconst record = (value: unknown): Json =>\n typeof value === \"object\" && value !== null && !Array.isArray(value) ? value as Json : {}\nconst text = (value: unknown): string => typeof value === \"string\" ? value : \"\"\nconst list = (value: unknown): ReadonlyArray<unknown> => Array.isArray(value) ? value : []\nconst basename = (path: string): string => path.split(\"/\").filter(Boolean).at(-1) ?? path\n/** One complete line as a JSON record, or `undefined` when it is not one. */\nconst parseRow = (raw: string): Json | undefined => {\n try {\n const parsed: unknown = JSON.parse(raw)\n return typeof parsed === \"object\" && parsed !== null && !Array.isArray(parsed) ? parsed as Json : undefined\n } catch {\n return undefined\n }\n}\nconst helperName = (path: unknown): string => basename(text(path)) || \"helper\"\n\nconst reads = (parsed: unknown): ReadonlyArray<string> => {\n const parts = list(parsed).map(record)\n if (parts.length === 0 || parts.some((part) => ![\"read\", \"search\", \"list_files\"].includes(text(part[\"type\"])))) {\n return []\n }\n return parts.map((part) =>\n part[\"type\"] === \"read\"\n ? `Read ${text(part[\"name\"]) || basename(text(part[\"path\"]))}`\n : part[\"type\"] === \"search\"\n ? `Searched ${JSON.stringify(text(part[\"query\"]))}${part[\"path\"] ? ` in ${basename(text(part[\"path\"]))}` : \"\"}`\n : `Listed ${basename(text(part[\"path\"])) || \"files\"}`\n )\n}\n\n/** Lines of an edit string, without the newline that ends the last one. */\nconst linesOf = (value: string): ReadonlyArray<string> => value === \"\" ? [] : value.replace(/\\n$/, \"\").split(\"\\n\")\n\n/** An added or deleted file reports its content, not a diff: one hunk of the whole file, all `+` or all `-`. */\nconst wholeFile = (content: string, op: \"+\" | \"-\"): string => {\n const lines = linesOf(content)\n if (lines.length === 0) return \"\"\n return `@@ ${op === \"+\" ? `-0,0 +1,${lines.length}` : `-1,${lines.length} +0,0`} @@\\n${\n lines.map((line) => `${op}${line}`).join(\"\\n\")\n }\\n`\n}\n\nconst changeOf = (change: Json): Schema.Schema.Type<typeof EditedFile>[\"change\"] =>\n typeof change[\"move_path\"] === \"string\"\n ? \"renamed\"\n : change[\"type\"] === \"add\"\n ? \"added\"\n : change[\"type\"] === \"delete\"\n ? \"deleted\"\n : \"modified\"\n\n/**\n * The Codex record, event and item kinds this module names. Each list is closed: a kind outside it is a tagged\n * `unsupported_record`, so a new kind stops the import where a person can see it instead of vanishing.\n */\nconst codexSkippedRows = [\n \"turn_context\",\n \"world_state\",\n \"token_usage_record\",\n \"compacted\",\n \"inter_agent_communication_metadata\"\n]\nconst codexResponseItems = [\n \"message\",\n \"reasoning\",\n \"custom_tool_call\",\n \"custom_tool_call_output\",\n \"function_call\",\n \"function_call_output\",\n \"agent_message\"\n]\nconst codexSkippedEvents = [\"task_started\", \"token_count\", \"thread_settings_applied\"]\nconst codexItems = [\n \"UserMessage\",\n \"AgentMessage\",\n \"Reasoning\",\n \"CommandExecution\",\n \"FileChange\",\n \"ContextCompaction\",\n \"SubAgentActivity\",\n \"CollabAgentToolCall\",\n \"Extension\",\n \"McpToolCall\",\n \"FunctionCallOutput\",\n \"ImageView\"\n]\n\n/** The text of a list of `{type, text}` parts, as Codex and MCP servers write tool output. */\nconst partsText = (value: unknown): string =>\n typeof value === \"string\" ? value : list(value).map((each) => text(record(each)[\"text\"])).filter(Boolean).join(\"\\n\")\n\n/**\n * One completed Codex item as the part it reports, or `undefined` for items with nothing to show. `took` is the\n * wall time Codex recorded around the item (`completed_at_ms - started_at_ms`). The caller has checked the item's\n * type against `codexItems`.\n */\nconst itemPart = (item: Json, took: number): { readonly role: Entry[\"role\"]; readonly part: Part } | undefined => {\n switch (item[\"type\"]) {\n case \"UserMessage\":\n return {\n role: \"user\",\n part: { type: \"prompt\", text: list(item[\"content\"]).map((each) => text(record(each)[\"text\"])).join(\"\\n\") }\n }\n case \"AgentMessage\": {\n const content = list(item[\"content\"]).map(record)\n const said = content.map((each) => text(each[\"text\"])).filter(Boolean).join(\"\\n\")\n if (content.some((each) => each[\"type\"] === \"encrypted_content\")) {\n return { role: \"assistant\", part: { type: \"encrypted\" } }\n }\n return { role: \"assistant\", part: { type: \"text\", text: said, final: item[\"phase\"] === \"final_answer\" } }\n }\n case \"Reasoning\": {\n // Codex keeps reasoning encrypted; only a summary it chose to write is readable.\n const summary = list(item[\"summary_text\"]).map(text).filter(Boolean).join(\"\\n\")\n return summary === \"\"\n ? (item[\"encrypted_content\"] ? { role: \"assistant\", part: { type: \"encrypted\" } } : undefined)\n : { role: \"assistant\", part: { type: \"reasoning\", text: summary } }\n }\n case \"CommandExecution\": {\n const exit = typeof item[\"exit_code\"] === \"number\" ? item[\"exit_code\"] : undefined\n // Codex reports in_progress, completed, failed and declined; only a clean completion is ok.\n const status = item[\"status\"] === \"in_progress\"\n ? \"running\"\n : item[\"status\"] === \"completed\" && (exit ?? 0) === 0\n ? \"ok\"\n : \"error\"\n return {\n role: \"assistant\",\n part: {\n type: \"tool\",\n call_id: text(item[\"id\"]),\n command: list(item[\"command\"]).map(text).at(-1) ?? \"\",\n reads: reads(item[\"parsed_cmd\"]),\n status,\n ...(exit === undefined ? {} : { exit_code: exit }),\n output: text(item[\"aggregated_output\"]) || text(item[\"formatted_output\"]),\n duration_ms: took\n }\n }\n }\n case \"FileChange\":\n return {\n role: \"assistant\",\n part: {\n type: \"edit\",\n call_id: text(item[\"id\"]),\n outcome: item[\"status\"] === \"completed\" ? \"applied\" : \"failed\",\n files: Object.entries(record(item[\"changes\"])).map(([path, value]) => {\n const change = record(value)\n return {\n path,\n change: changeOf(change),\n ...(typeof change[\"move_path\"] === \"string\" ? { renamed_to: change[\"move_path\"] } : {}),\n diff: text(change[\"unified_diff\"]) ||\n wholeFile(text(change[\"content\"]), change[\"type\"] === \"delete\" ? \"-\" : \"+\")\n }\n })\n }\n }\n case \"ContextCompaction\":\n return { role: \"assistant\", part: { type: \"compaction\" } }\n case \"SubAgentActivity\":\n return {\n role: \"assistant\",\n part: {\n type: \"helper\",\n call_id: text(item[\"id\"]),\n agent: helperName(item[\"agent_path\"]),\n activity: text(item[\"kind\"])\n }\n }\n case \"CollabAgentToolCall\": {\n const agents = list(item[\"receiver_agents\"]).map((each) => helperName(record(each)[\"agent_path\"] ?? each))\n return {\n role: \"assistant\",\n part: {\n type: \"helper\",\n call_id: text(item[\"id\"]),\n agent: agents.join(\", \") || \"helpers\",\n activity: text(item[\"tool\"])\n }\n }\n }\n case \"Extension\": {\n const action = record(item[\"action\"])\n const query = text(item[\"query\"]) || text(action[\"query\"]) || text(action[\"pattern\"]) || text(action[\"url\"])\n return { role: \"assistant\", part: { type: \"search\", call_id: text(item[\"id\"]), query } }\n }\n case \"McpToolCall\": {\n // A tool another server ran for the agent: its request and the result the server reported.\n const result = record(item[\"result\"])\n const args = record(item[\"arguments\"])\n const name = [text(item[\"server\"]), text(item[\"tool\"])].filter(Boolean).join(\".\")\n const failed = item[\"status\"] !== \"completed\" || result[\"isError\"] === true\n return {\n role: \"assistant\",\n part: {\n type: \"tool\",\n call_id: text(item[\"id\"]),\n command: Object.keys(args).length === 0 ? name : `${name} ${JSON.stringify(args)}`,\n reads: [],\n status: item[\"status\"] === \"in_progress\" ? \"running\" : failed ? \"error\" : \"ok\",\n output: partsText(result[\"content\"]) || text(record(item[\"error\"])[\"message\"]),\n duration_ms: took\n }\n }\n }\n case \"FunctionCallOutput\":\n return {\n role: \"assistant\",\n part: {\n type: \"tool\",\n call_id: text(item[\"id\"]),\n command: [text(item[\"namespace\"]), text(item[\"name\"])].filter(Boolean).join(\".\"),\n reads: [],\n status: \"ok\",\n output: partsText(item[\"output\"]),\n duration_ms: took\n }\n }\n default:\n // ImageView, the one kind of `codexItems` left: an image the agent looked at.\n return {\n role: \"assistant\",\n part: {\n type: \"tool\",\n call_id: text(item[\"id\"]),\n command: `view_image ${text(item[\"path\"])}`,\n reads: [`Read ${basename(text(item[\"path\"]))}`],\n status: \"ok\",\n output: \"\",\n duration_ms: took\n }\n }\n }\n}\n\n/**\n * The first line of a code-mode output says how the script ended. A script that finished, or one still running in\n * a cell, repeats what completed items already report; any other ending is a failure only this row records.\n */\nconst scriptFailed = (output: string): boolean => !/^Script (?:completed|running)\\b/.test(output)\n\n/** The file a failed `apply_patch` names, when the report is that failure. */\nconst failedPatchPath = (output: string): string | undefined =>\n /apply_patch verification failed: Failed to find expected lines in ([^\\n]+):\\n/.exec(output)?.[1]\n\n/** The adapter profile `<profile>/<major.minor>` for a supported release, or `undefined`. */\nconst profileOf = (profile: string, releases: ReadonlyArray<string>, release: string): string | undefined => {\n const minor = /^(\\d+\\.\\d+)\\./.exec(release)?.[1]\n return minor !== undefined && releases.includes(minor) ? `${profile}/${minor}` : undefined\n}\n\n/**\n * Decode the next chunk of a Codex rollout. Pass `codexStart` with the first chunk and the returned state\n * with each following one; any partition of the same bytes yields the same entries.\n *\n * @category decoding\n * @since 1.0.0-rc.1\n */\nexport const decodeCodex = (state: CodexState, chunk: string): Result.Result<Decoded, ExternalTranscriptError> => {\n const lines = (state.pending + chunk).split(\"\\n\")\n const pending = lines.pop()!\n let { line, seq, session, goal } = state\n const calls = new Map(Object.entries(state.calls ?? {}))\n const entries: Array<Entry> = []\n const fail = (code: ExternalTranscriptErrorCode, message: string) =>\n Result.fail(new ExternalTranscriptError({ code, message, line }))\n /** A kind outside the named lists; a kind that is not even a string is a record of another shape. */\n const unread = (what: string, type: unknown) =>\n typeof type === \"string\" && type !== \"\"\n ? fail(\"unsupported_record\", `Codex wrote ${what} this release does not read: ${type}`)\n : fail(\"malformed_record\", `Codex rollout line ${line} names no ${what.replace(/^an? /, \"\")} type.`)\n for (const raw of lines) {\n line++\n if (raw.trim() === \"\") continue\n const row = parseRow(raw)\n if (row === undefined) return fail(\"malformed_record\", `Codex rollout line ${line} is not a JSON record.`)\n const payload = record(row[\"payload\"])\n if (row[\"type\"] === \"session_meta\") {\n const release = text(payload[\"cli_version\"])\n const format_version = profileOf(\"codex-rollout\", codexReleases, release)\n if (format_version === undefined) {\n return fail(\n \"unsupported_version\",\n `Codex ${release || \"(no release)\"} wrote this rollout; supported: ${codexReleases.join(\", \")}.`\n )\n }\n session = { id: text(payload[\"id\"]) || text(payload[\"session_id\"]), format_version, cwd: text(payload[\"cwd\"]) }\n continue\n }\n if (session === undefined) {\n return fail(\"missing_version\", `Codex rollout line ${line} comes before its session record.`)\n }\n const found: Array<{ readonly role: Entry[\"role\"]; readonly part: Part; readonly turn?: string }> = []\n if (row[\"type\"] === \"response_item\") {\n if (!codexResponseItems.includes(text(payload[\"type\"]))) return unread(\"a response item\", payload[\"type\"])\n switch (payload[\"type\"]) {\n case \"custom_tool_call\": {\n const id = payload[\"call_id\"], name = payload[\"name\"], input = payload[\"input\"]\n if (typeof id !== \"string\" || id === \"\" || typeof name !== \"string\" || typeof input !== \"string\") {\n return fail(\"malformed_record\", `Codex tool request on line ${line} names no call, tool or input.`)\n }\n calls.set(id, { name, input })\n break\n }\n case \"custom_tool_call_output\": {\n const id = text(payload[\"call_id\"])\n const call = calls.get(id)\n calls.delete(id)\n const output = partsText(payload[\"output\"])\n // A script that finished repeats its completed items. One that failed has no item: keep its report with\n // the request that started it, so a failed edit is never silently missing.\n if (!scriptFailed(output)) break\n found.push({\n role: \"assistant\",\n part: {\n type: \"tool\",\n call_id: id,\n command: call?.input ?? \"\",\n reads: [],\n status: \"error\",\n output,\n duration_ms: 0\n }\n })\n const path = failedPatchPath(output)\n if (path !== undefined) {\n // The report names the file and no change: the diff is empty because nothing was observed to change.\n found.push({\n role: \"assistant\",\n part: { type: \"edit\", call_id: id, files: [{ path, change: \"modified\", diff: \"\" }], outcome: \"failed\" }\n })\n }\n break\n }\n case \"agent_message\": {\n // A message between this agent and one it works with. Codex encrypts the body; the header beside it\n // names agents, and a name in a transcript confers nothing.\n const content = payload[\"content\"]\n if (!Array.isArray(content)) {\n return fail(\"malformed_record\", `Codex agent message on line ${line} has no content list.`)\n }\n let encrypted = false\n const said: Array<string> = []\n for (const each of content) {\n const block = record(each)\n if (block[\"type\"] === \"encrypted_content\") {\n if (typeof block[\"encrypted_content\"] !== \"string\" || block[\"encrypted_content\"] === \"\") {\n return fail(\"malformed_record\", `Codex encrypted body on line ${line} is empty.`)\n }\n encrypted = true\n } else if (block[\"type\"] === \"input_text\" || block[\"type\"] === \"output_text\") {\n if (typeof block[\"text\"] !== \"string\") {\n return fail(\"malformed_record\", `Codex agent message on line ${line} has a text part without text.`)\n }\n said.push(block[\"text\"])\n } else {\n return unread(\"a message part\", block[\"type\"])\n }\n }\n const turn = text(record(payload[\"internal_chat_message_metadata_passthrough\"])[\"turn_id\"])\n // One placeholder stands for the whole body, header included: nothing readable is shown beside it.\n if (encrypted) found.push({ role: \"assistant\", part: { type: \"encrypted\" }, turn })\n else if (said.join(\"\\n\") !== \"\") {\n found.push({ role: \"assistant\", part: { type: \"text\", text: said.join(\"\\n\"), final: false }, turn })\n }\n break\n }\n // message, reasoning, function_call, function_call_output: the model-facing copy of completed items.\n }\n } else if (row[\"type\"] === \"event_msg\") {\n switch (payload[\"type\"]) {\n case \"item_completed\": {\n const started = payload[\"started_at_ms\"], completed = payload[\"completed_at_ms\"]\n const took = typeof started === \"number\" && typeof completed === \"number\" ? completed - started : 0\n const item = record(payload[\"item\"])\n if (!codexItems.includes(text(item[\"type\"]))) return unread(\"an item\", item[\"type\"])\n if (item[\"type\"] === \"UserMessage\" || item[\"type\"] === \"AgentMessage\") {\n const content = item[\"content\"]\n if (!Array.isArray(content)) {\n return fail(\"malformed_record\", `Codex message on line ${line} has no content list.`)\n }\n // Ciphertext stands for the whole body, so the parts beside it are not read.\n if (!content.some((each) => record(each)[\"type\"] === \"encrypted_content\")) {\n for (const each of content) {\n const block = record(each)\n if (block[\"type\"] !== (item[\"type\"] === \"UserMessage\" ? \"text\" : \"Text\")) {\n return unread(\"a message part\", block[\"type\"])\n }\n if (typeof block[\"text\"] !== \"string\") {\n return fail(\"malformed_record\", `Codex message on line ${line} has a text part without text.`)\n }\n }\n }\n }\n const part = itemPart(item, Number.isFinite(took) && took > 0 ? took : 0)\n if (part !== undefined) found.push({ ...part, turn: text(payload[\"turn_id\"]) })\n break\n }\n case \"thread_goal_updated\": {\n const update = record(payload[\"goal\"])\n const key = `${text(update[\"status\"])}:${text(update[\"objective\"])}`\n // Codex repeats a goal on every usage update; only a new objective or status is news.\n if (key !== goal) {\n found.push({\n role: \"user\",\n part: { type: \"goal\", objective: text(update[\"objective\"]), status: text(update[\"status\"]) }\n })\n }\n goal = key\n break\n }\n case \"task_complete\": {\n // A turn's end repeats its last message, and carries the failure when the turn ended in one: a usage\n // limit, a model at capacity, a refused request.\n if (payload[\"error\"] === undefined || payload[\"error\"] === null) break\n const message = text(record(payload[\"error\"])[\"message\"])\n if (message === \"\") return fail(\"malformed_record\", `Codex failure on line ${line} gives no message.`)\n found.push({ role: \"assistant\", part: { type: \"error\", message }, turn: text(payload[\"turn_id\"]) })\n break\n }\n case \"error\":\n case \"turn_aborted\": {\n // What Codex said went wrong, or why the turn stopped (\"interrupted\").\n const message = text(payload[\"message\"]) || text(payload[\"reason\"])\n if (message === \"\") {\n return fail(\"malformed_record\", `Codex failure on line ${line} gives no message or reason.`)\n }\n found.push({ role: \"assistant\", part: { type: \"error\", message }, turn: text(payload[\"turn_id\"]) })\n break\n }\n default:\n if (!codexSkippedEvents.includes(text(payload[\"type\"]))) return unread(\"an event\", payload[\"type\"])\n }\n } else if (!codexSkippedRows.includes(text(row[\"type\"]))) {\n return unread(\"a record\", row[\"type\"])\n }\n const at = Date.parse(text(row[\"timestamp\"])) || 0\n const sessionId = session.id, format_version = session.format_version\n found.forEach(({ part, role, turn }, index) => {\n entries.push({\n origin: \"external\",\n agent_kind: \"codex\",\n format_version,\n session_id: sessionId,\n source_id: index === 0 ? `${sessionId}:${line}` : `${sessionId}:${line}#${index}`,\n read_only: true,\n seq: seq++,\n at,\n ...(turn ? { turn_id: turn } : {}),\n role,\n part\n })\n })\n }\n return Result.succeed({\n state: { pending, line, seq, session, goal, ...(calls.size === 0 ? {} : { calls: Object.fromEntries(calls) }) },\n entries\n })\n}\n\n/**\n * The Claude Code release lines whose transcript shape this module reads, by `major.minor`.\n *\n * @category constants\n * @since 1.0.0-rc.1\n */\nexport const claudeReleases: ReadonlyArray<string> = [\"2.1\"]\n\n/**\n * A Claude Code tool call waiting for its result: the tool's name, its input and when the agent asked.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport interface ClaudeCall {\n readonly name: string\n readonly input: unknown\n /** Milliseconds since the epoch, from the `tool_use` record. */\n readonly at: number\n}\n\n/**\n * What a Claude Code decode remembers between chunks.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport interface ClaudeState {\n /** Bytes after the last newline: a line the agent is still writing. */\n readonly pending: string\n /** Complete lines read so far. */\n readonly line: number\n /** Entries emitted so far. */\n readonly seq: number\n /** The session the first conversation record named. */\n readonly session?: string | undefined\n /** The `promptId` of the latest user record: the turn later entries belong to. */\n readonly turn?: string | undefined\n /** Tool calls whose result has not arrived, by `tool_use` id. */\n readonly calls: Readonly<Record<string, ClaudeCall>>\n}\n\n/**\n * The state before the first byte.\n *\n * @category constructors\n * @since 1.0.0-rc.1\n */\nexport const claudeStart: ClaudeState = { pending: \"\", line: 0, seq: 0, calls: {} }\n\n/** Content as blocks: Claude Code writes a plain prompt as a string and everything else as a block list. */\nconst blocksOf = (content: unknown): ReadonlyArray<Json> =>\n typeof content === \"string\" ? [{ type: \"text\", text: content }] : list(content).map(record)\n\nconst textOf = (blocks: ReadonlyArray<Json>): string =>\n blocks.filter((block) => block[\"type\"] === \"text\").map((block) => text(block[\"text\"])).join(\"\\n\")\n\n/** A user turn is the owner's when Claude Code classified it human or did not classify it. */\nconst byOwner = (origin: unknown): boolean =>\n origin === undefined || origin === null || record(origin)[\"kind\"] === \"human\"\n\n/**\n * A requested replacement as one hunk. Claude Code reports no position for a replacement it did not apply, so the\n * hunk starts at line 1.\n */\nconst replacement = (before: string, after: string): string => {\n const removed = linesOf(before), added = linesOf(after)\n if (removed.length + added.length === 0) return \"\"\n return `@@ -1,${removed.length} +1,${added.length} @@\\n${\n [...removed.map((line) => `-${line}`), ...added.map((line) => `+${line}`)].join(\"\\n\")\n }\\n`\n}\n\nconst count = (value: unknown): number => typeof value === \"number\" ? value : 0\n\n/** The hunks Claude Code reported for an applied edit (`toolUseResult.structuredPatch`). */\nconst reportedPatch = (patch: unknown): string =>\n list(patch).map(record).map((hunk) =>\n `@@ -${count(hunk[\"oldStart\"])},${count(hunk[\"oldLines\"])} +${count(hunk[\"newStart\"])},${\n count(hunk[\"newLines\"])\n } @@\\n${list(hunk[\"lines\"]).map(text).join(\"\\n\")}\\n`\n ).join(\"\")\n\n/** The edit the agent asked for, from the tool input, when Claude Code reported no hunks. */\nconst requestedPatch = (name: string, input: Json): string => {\n switch (name) {\n case \"Write\":\n return wholeFile(text(input[\"content\"]), \"+\")\n case \"NotebookEdit\":\n return wholeFile(text(input[\"new_source\"]), \"+\")\n case \"MultiEdit\":\n return list(input[\"edits\"]).map(record).map((edit) =>\n replacement(text(edit[\"old_string\"]), text(edit[\"new_string\"]))\n ).join(\"\")\n default:\n return replacement(text(input[\"old_string\"]), text(input[\"new_string\"]))\n }\n}\n\n/** The reads label of a tool that only reads, searches or lists, or none. */\nconst claudeReads = (name: string, input: Json): ReadonlyArray<string> => {\n const path = text(input[\"path\"])\n switch (name) {\n case \"Read\":\n return [`Read ${basename(text(input[\"file_path\"]))}`]\n case \"Grep\":\n case \"Glob\":\n return [`Searched ${JSON.stringify(text(input[\"pattern\"]))}${path ? ` in ${basename(path)}` : \"\"}`]\n case \"LS\":\n return [`Listed ${basename(path) || \"files\"}`]\n default:\n return []\n }\n}\n\n/** One finished tool call: its `tool_use` (when this transcript holds it) and the `tool_result` that ended it. */\nconst claudeToolPart = (\n id: string,\n call: ClaudeCall | undefined,\n result: { readonly failed: boolean; readonly output: string; readonly report: Json; readonly took: number }\n): Part => {\n const name = call?.name ?? \"\"\n const input = record(call?.input)\n switch (name) {\n case \"Edit\":\n case \"Write\":\n case \"MultiEdit\":\n case \"NotebookEdit\":\n return {\n type: \"edit\",\n call_id: id,\n files: [{\n path: text(input[\"file_path\"]) || text(input[\"notebook_path\"]),\n change: name === \"Write\" && result.report[\"type\"] === \"create\" ? \"added\" : \"modified\",\n diff: reportedPatch(result.report[\"structuredPatch\"]) || requestedPatch(name, input)\n }],\n outcome: result.failed ? \"failed\" : \"applied\"\n }\n case \"WebSearch\":\n return { type: \"search\", call_id: id, query: text(input[\"query\"]) }\n case \"WebFetch\":\n return { type: \"search\", call_id: id, query: text(input[\"url\"]) }\n case \"Task\":\n case \"Agent\":\n return {\n type: \"helper\",\n call_id: id,\n agent: text(input[\"subagent_type\"]) || \"general-purpose\",\n activity: text(input[\"description\"])\n }\n }\n const exit = result.failed ? /^Exit code (\\d+)/.exec(result.output)?.[1] : undefined\n return {\n type: \"tool\",\n call_id: id,\n command: name === \"Bash\"\n ? text(input[\"command\"])\n : Object.keys(input).length === 0\n ? name\n : `${name} ${JSON.stringify(input)}`,\n reads: claudeReads(name, input),\n status: result.failed ? \"error\" : \"ok\",\n ...(exit === undefined ? {} : { exit_code: Number(exit) }),\n output: result.output,\n duration_ms: result.took\n }\n}\n\n/**\n * The Claude Code record, status, attachment and block kinds this module names. Each list is closed: a kind\n * outside it is a tagged `unsupported_record`, so a new kind stops the import where a person can see it.\n */\n/** Rows outside the conversation chain: session bookkeeping that names no speaker and says nothing. */\nconst claudeSkippedRows = [\n \"mode\",\n \"permission-mode\",\n \"atis-latch\",\n \"last-prompt\",\n \"ai-title\",\n \"custom-title\",\n \"agent-name\",\n \"queue-operation\",\n \"file-history-snapshot\",\n \"file-history-delta\",\n \"cost-state\",\n \"pr-link\",\n \"bridge-session\"\n]\n/** Status lines: turn timing, hook summaries, retries, model fallback and scheduled-task notices. */\nconst claudeSkippedStatus = [\n \"turn_duration\",\n \"informational\",\n \"stop_hook_summary\",\n \"away_summary\",\n \"api_error\",\n \"local_command\",\n \"scheduled_task_fire\",\n \"agents_killed\",\n \"model_refusal_fallback\"\n]\n/** Context Claude Code attaches for the model; `queued_command` alone can carry the owner's words. */\nconst claudeSkippedAttachments = [\n \"agent_listing_delta\",\n \"auto_mode\",\n \"bash_output_audience_note\",\n \"batching_reminder_sent\",\n \"budget_usd\",\n \"command_permissions\",\n \"compact_file_reference\",\n \"credential_org\",\n \"date\",\n \"deferred_tools_delta\",\n \"deferred_tools_record\",\n \"diagnostics\",\n \"directory\",\n \"edited_text_file\",\n \"environment\",\n \"file\",\n \"goal_status\",\n \"hook_additional_context\",\n \"hook_cancelled\",\n \"hook_non_blocking_error\",\n \"hook_system_message\",\n \"instructions\",\n \"invoked_skills\",\n \"max_turns_reached\",\n \"mcp_instructions_delta\",\n \"model\",\n \"nested_memory\",\n \"plan_mode\",\n \"prompt_snapshot\",\n \"read_truncation_notice\",\n \"remote_session_change\",\n \"sandbox_instructions\",\n \"session_context\",\n \"silent_turn_reminder\",\n \"skill_listing\",\n \"skill_mention\",\n \"task_reminder\",\n \"task_status\",\n \"thinking_drop\",\n \"thinking_stripped\",\n \"total_tokens_reminder\",\n \"ultra_effort_enter\",\n \"ultra_effort_exit\",\n \"workflow_keyword_request\"\n]\n\n/** The owner's words in a user record, or `undefined` for Claude Code's own output of a local command. */\nconst ownerText = (said: string): Part | undefined => {\n if (/^\\[Request interrupted by user[^\\]]*\\]$/.test(said)) return { type: \"error\", message: said }\n if (/^<(?:local-command-std(?:out|err)|bash-std(?:out|err))>/.test(said)) return undefined\n // Claude Code writes a slash command as tags that open the record; a prompt that mentions them stays as typed.\n const command = /^<command-(?:name|message)>/.test(said)\n ? /<command-name>([^<]*)<\\/command-name>/.exec(said)?.[1]\n : undefined\n if (command !== undefined) {\n const args = /<command-args>([\\s\\S]*?)<\\/command-args>/.exec(said)?.[1]?.trim()\n return { type: \"prompt\", text: args ? `${command} ${args}` : command }\n }\n const shell = /^<bash-input>([\\s\\S]*)<\\/bash-input>$/.exec(said)?.[1]\n return { type: \"prompt\", text: shell === undefined ? said : `!${shell.trim()}` }\n}\n\n/**\n * Decode the next chunk of a Claude Code session transcript. Pass `claudeStart` with the first chunk and the\n * returned state with each following one; any partition of the same bytes yields the same entries.\n *\n * Entries follow the order of the records that complete them. A tool call is held in `state.calls` from its\n * `tool_use` record until the `tool_result` with the same id arrives, and becomes one entry at the result's line;\n * a call whose result never arrives emits nothing.\n *\n * @category decoding\n * @since 1.0.0-rc.1\n */\nexport const decodeClaude = (\n state: ClaudeState,\n chunk: string\n): Result.Result<Decoded<ClaudeState>, ExternalTranscriptError> => {\n const lines = (state.pending + chunk).split(\"\\n\")\n const pending = lines.pop()!\n let { line, seq, session, turn } = state\n const calls = new Map(Object.entries(state.calls))\n const entries: Array<Entry> = []\n const fail = (code: ExternalTranscriptErrorCode, message: string) =>\n Result.fail(new ExternalTranscriptError({ code, message, line }))\n /** A kind outside the named lists; a kind that is not even a string is a record of another shape. */\n const unread = (what: string, type: unknown) =>\n typeof type === \"string\" && type !== \"\"\n ? fail(\"unsupported_record\", `Claude Code wrote ${what} this release does not read: ${type}`)\n : fail(\"malformed_record\", `Claude Code transcript line ${line} names no ${what.replace(/^an? /, \"\")} type.`)\n for (const raw of lines) {\n line++\n if (raw.trim() === \"\") continue\n const row = parseRow(raw)\n if (row === undefined) return fail(\"malformed_record\", `Claude Code transcript line ${line} is not a JSON record.`)\n // Bookkeeping rows say nothing in the conversation, whether or not a release gives them a uuid.\n if (claudeSkippedRows.includes(text(row[\"type\"]))) continue\n if (![\"user\", \"assistant\", \"system\", \"attachment\"].includes(text(row[\"type\"]))) {\n return unread(\"a record\", row[\"type\"])\n }\n // Conversation records chain by uuid: one without it is not the shape this profile reads.\n if (typeof row[\"uuid\"] !== \"string\") {\n return fail(\"malformed_record\", `Claude Code transcript line ${line} is a conversation record without a uuid.`)\n }\n const release = text(row[\"version\"])\n if (release === \"\") return fail(\"missing_version\", `Claude Code transcript line ${line} names no release.`)\n const format_version = profileOf(\"claude-code\", claudeReleases, release)\n if (format_version === undefined) {\n return fail(\n \"unsupported_version\",\n `Claude Code ${release} wrote this transcript; supported: ${claudeReleases.join(\", \")}.`\n )\n }\n session ??= text(row[\"sessionId\"]) || undefined\n if (session === undefined) {\n return fail(\"malformed_record\", `Claude Code transcript line ${line} names no session.`)\n }\n const sessionId = session\n // A subagent's records belong to its own transcript; the main one shows the call as a helper.\n if (row[\"isSidechain\"] === true) continue\n const at = Date.parse(text(row[\"timestamp\"])) || 0\n if (row[\"type\"] === \"user\" && typeof row[\"promptId\"] === \"string\" && row[\"promptId\"] !== \"\") {\n turn = row[\"promptId\"]\n }\n const found: Array<{ readonly role: Entry[\"role\"]; readonly part: Part }> = []\n const said = (part: Part) => found.push({ role: \"assistant\", part })\n const message = record(row[\"message\"])\n if (\n (row[\"type\"] === \"user\" || row[\"type\"] === \"assistant\") && typeof message[\"content\"] !== \"string\" &&\n !Array.isArray(message[\"content\"])\n ) {\n return fail(\"malformed_record\", `Claude Code transcript line ${line} has no message content.`)\n }\n switch (row[\"type\"]) {\n case \"user\": {\n const blocks = blocksOf(message[\"content\"])\n for (const block of blocks) {\n if (block[\"type\"] === \"tool_result\") {\n const callId = text(block[\"tool_use_id\"])\n const call = calls.get(callId)\n calls.delete(callId)\n const content = block[\"content\"]\n said(claudeToolPart(callId, call, {\n failed: block[\"is_error\"] === true,\n output: typeof content === \"string\" ? content : textOf(list(content).map(record)),\n report: record(row[\"toolUseResult\"]),\n took: call !== undefined && call.at > 0 && at > call.at ? at - call.at : 0\n }))\n } else if (block[\"type\"] !== \"text\" && block[\"type\"] !== \"image\") {\n return unread(\"a content block\", block[\"type\"])\n }\n }\n const words = textOf(blocks)\n // Skill bodies, caveats and summaries Claude Code injects are not the owner's; nor are task notifications\n // or messages from other sessions.\n if (words === \"\" || row[\"isMeta\"] === true || row[\"isCompactSummary\"] === true || !byOwner(row[\"origin\"])) break\n const part = ownerText(words)\n if (part !== undefined) found.push({ role: part.type === \"prompt\" ? \"user\" : \"assistant\", part })\n break\n }\n case \"assistant\": {\n const blocks = blocksOf(message[\"content\"])\n if (row[\"isApiErrorMessage\"] === true) {\n said({ type: \"error\", message: textOf(blocks) || text(row[\"error\"]) })\n break\n }\n for (const block of blocks) {\n switch (block[\"type\"]) {\n case \"text\":\n if (text(block[\"text\"]) !== \"\") {\n said({ type: \"text\", text: text(block[\"text\"]), final: message[\"stop_reason\"] === \"end_turn\" })\n }\n break\n case \"thinking\":\n // Claude Code keeps only the signature of most thinking; an empty body has nothing to show.\n if (text(block[\"thinking\"]) !== \"\") said({ type: \"reasoning\", text: text(block[\"thinking\"]) })\n break\n case \"redacted_thinking\":\n break\n case \"fallback\":\n // A notice that Claude Code answered with another model: a status line, not something it said.\n break\n case \"tool_use\":\n if (typeof block[\"id\"] !== \"string\" || block[\"id\"] === \"\") {\n return fail(\"malformed_record\", `Claude Code tool request on line ${line} names no call.`)\n }\n calls.set(block[\"id\"], { name: text(block[\"name\"]), input: block[\"input\"] ?? {}, at })\n break\n default:\n return unread(\"a content block\", block[\"type\"])\n }\n }\n break\n }\n case \"system\":\n if (row[\"subtype\"] === \"compact_boundary\") said({ type: \"compaction\" })\n else if (!claudeSkippedStatus.includes(text(row[\"subtype\"]))) return unread(\"a status record\", row[\"subtype\"])\n break\n case \"attachment\": {\n // Context Claude Code attaches for the model, except a prompt the owner queued while the agent worked.\n const attachment = record(row[\"attachment\"])\n if (attachment[\"type\"] !== \"queued_command\") {\n if (!claudeSkippedAttachments.includes(text(attachment[\"type\"]))) {\n return unread(\"an attachment\", attachment[\"type\"])\n }\n break\n }\n if (\n attachment[\"commandMode\"] === \"prompt\" && attachment[\"isMeta\"] !== true && byOwner(attachment[\"origin\"])\n ) {\n const words = textOf(blocksOf(attachment[\"prompt\"]))\n if (words !== \"\") found.push({ role: \"user\", part: { type: \"prompt\", text: words } })\n }\n break\n }\n }\n found.forEach(({ part, role }, index) => {\n entries.push({\n origin: \"external\",\n agent_kind: \"claude-code\",\n format_version,\n session_id: sessionId,\n source_id: index === 0 ? `${sessionId}:${line}` : `${sessionId}:${line}#${index}`,\n read_only: true,\n seq: seq++,\n at,\n ...(turn === undefined ? {} : { turn_id: turn }),\n role,\n part\n })\n })\n }\n return Result.succeed({\n state: { pending, line, seq, session, turn, calls: Object.fromEntries(calls) },\n entries\n })\n}\n"]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The completion its own cell wrote before a call in it failed.
|
|
3
|
+
*
|
|
4
|
+
* A cell is authored blind: the model writes the whole program, `ctx.done`
|
|
5
|
+
* included, before any call in it settles, and a failed call resolves
|
|
6
|
+
* `{ ok: false, error }` rather than throwing, so the rest of the cell runs.
|
|
7
|
+
* A cell that makes a request and completes in the same program therefore
|
|
8
|
+
* reports the request as made whatever the request did. The sentence is not a
|
|
9
|
+
* lie the model told; it is a sentence written about a result that did not
|
|
10
|
+
* exist yet.
|
|
11
|
+
*
|
|
12
|
+
* It is not hypothetical. A TUI coordinator on a small seat ran
|
|
13
|
+
* `ctx.call("agent.delegate", …)` and `ctx.done("Delegated the estimation
|
|
14
|
+
* system design to codex astra.")` in one cell. The delegation failed with
|
|
15
|
+
* "Three workers are active; wait for a completion", the cell ran on, and the
|
|
16
|
+
* user was told work was running that never started.
|
|
17
|
+
*
|
|
18
|
+
* ## What the harness does, and why it reads no prose
|
|
19
|
+
*
|
|
20
|
+
* The rule is structural. A completion whose own frame settled a failed call
|
|
21
|
+
* was written before that failure existed, and no earlier frame showed it to
|
|
22
|
+
* the model. The harness cannot decide from the sentence whether it states
|
|
23
|
+
* the failure, and it does not try: it hands the frame back once with the
|
|
24
|
+
* failure, as a demand, so the next completion is written by a model that has
|
|
25
|
+
* read the result. Two exact tests spare a cell that was written to handle the
|
|
26
|
+
* failure: one whose source reads a call envelope's `ok` or `error`, the
|
|
27
|
+
* branch the cell prompt teaches, and one whose completion already quotes the
|
|
28
|
+
* flow's own failure reason. Neither reads what the claim means; each reads
|
|
29
|
+
* whether the claim could have depended on the result at all.
|
|
30
|
+
*
|
|
31
|
+
* Where no frame is left to hand back, or the demand was already spent, the
|
|
32
|
+
* completion stands with the failure appended to it by {@link state}. The
|
|
33
|
+
* harness never lets a claim written before a failure be the whole answer, and
|
|
34
|
+
* it never asks a model whether the claim is true: a weak seat's honesty is
|
|
35
|
+
* not a control.
|
|
36
|
+
*
|
|
37
|
+
* @since 1.0.0-rc.1
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* How many completions one run may have handed back for a failed call.
|
|
41
|
+
*
|
|
42
|
+
* One, like every measured demand: the answer to it is written by a model
|
|
43
|
+
* that has read the failure, and asking twice would be the loop grading that
|
|
44
|
+
* answer.
|
|
45
|
+
*
|
|
46
|
+
* @category constants
|
|
47
|
+
* @since 1.0.0-rc.1
|
|
48
|
+
*/
|
|
49
|
+
export declare const cap = 1;
|
|
50
|
+
/**
|
|
51
|
+
* The heading of the demand, so a transcript and a test can find it.
|
|
52
|
+
*
|
|
53
|
+
* @category constants
|
|
54
|
+
* @since 1.0.0-rc.1
|
|
55
|
+
*/
|
|
56
|
+
export declare const heading = "Call failed before completion";
|
|
57
|
+
/**
|
|
58
|
+
* The line {@link state} appends a failure under.
|
|
59
|
+
*
|
|
60
|
+
* @category constants
|
|
61
|
+
* @since 1.0.0-rc.1
|
|
62
|
+
*/
|
|
63
|
+
export declare const stated = "Failed before this answer was written:";
|
|
64
|
+
/**
|
|
65
|
+
* One call a completing frame settled as a failure.
|
|
66
|
+
*
|
|
67
|
+
* @category models
|
|
68
|
+
* @since 1.0.0-rc.1
|
|
69
|
+
*/
|
|
70
|
+
export interface Failure {
|
|
71
|
+
/** The flow the call named. */
|
|
72
|
+
readonly flow: string;
|
|
73
|
+
/** What the flow said about its failure, verbatim; empty when it said nothing. */
|
|
74
|
+
readonly message: string;
|
|
75
|
+
}
|
|
76
|
+
/** The frame accounting's view of one settled call. */
|
|
77
|
+
interface Settled {
|
|
78
|
+
readonly flow: string;
|
|
79
|
+
readonly ok: boolean;
|
|
80
|
+
readonly message: string | undefined;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The flow's own words for why a call failed, without the harness's prefix.
|
|
84
|
+
*
|
|
85
|
+
* @category conversions
|
|
86
|
+
* @since 1.0.0-rc.1
|
|
87
|
+
*/
|
|
88
|
+
export declare const reason: (failure: Failure) => string;
|
|
89
|
+
/**
|
|
90
|
+
* Whether a cell's source reads a call envelope's `ok` or `error`.
|
|
91
|
+
*
|
|
92
|
+
* `r.ok`, `r?.error`, `r["ok"]` and `const { ok, error } = r` all count;
|
|
93
|
+
* `console.error` does not. A cell that reads either wrote a branch for a
|
|
94
|
+
* failed call, so its completion is not one written blind.
|
|
95
|
+
*
|
|
96
|
+
* @category predicates
|
|
97
|
+
* @since 1.0.0-rc.1
|
|
98
|
+
*/
|
|
99
|
+
export declare const inspects: (source: string) => boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The failed calls a completion was written before, oldest first.
|
|
102
|
+
*
|
|
103
|
+
* Every call this frame settled with `ok: false`, unless the cell's source
|
|
104
|
+
* inspects call envelopes (see {@link inspects}), and except one whose reason
|
|
105
|
+
* the claim already quotes: that cell read the result and wrote from it. A
|
|
106
|
+
* failure with no message is named by its flow alone and is never quoted, so
|
|
107
|
+
* it is always reported.
|
|
108
|
+
*
|
|
109
|
+
* @category constructors
|
|
110
|
+
* @since 1.0.0-rc.1
|
|
111
|
+
*/
|
|
112
|
+
export declare const find: (calls: ReadonlyArray<Settled>, claim: string, source: string) => ReadonlyArray<Failure>;
|
|
113
|
+
/**
|
|
114
|
+
* The demand a completion over failed calls is handed back with.
|
|
115
|
+
*
|
|
116
|
+
* @category conversions
|
|
117
|
+
* @since 1.0.0-rc.1
|
|
118
|
+
*/
|
|
119
|
+
export declare const demand: (failures: ReadonlyArray<Failure>) => string;
|
|
120
|
+
/**
|
|
121
|
+
* The answer a completion stands on when it could not be handed back.
|
|
122
|
+
*
|
|
123
|
+
* The claim is kept, because the harness cannot tell a claim that states the
|
|
124
|
+
* failure from one that does not, and the failure is appended in the flow's
|
|
125
|
+
* own words, so a reader sees what happened whatever the claim says.
|
|
126
|
+
*
|
|
127
|
+
* @category conversions
|
|
128
|
+
* @since 1.0.0-rc.1
|
|
129
|
+
*/
|
|
130
|
+
export declare const state: (claim: string, failures: ReadonlyArray<Failure>) => string;
|
|
131
|
+
export {};
|
|
132
|
+
//# sourceMappingURL=FailedCall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FailedCall.d.ts","sourceRoot":"","sources":["../../src/FailedCall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,GAAG,IAAI,CAAA;AAEpB;;;;;GAKG;AACH,eAAO,MAAM,OAAO,kCAAkC,CAAA;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,MAAM,2CAA2C,CAAA;AAE9D;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,kFAAkF;IAClF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,uDAAuD;AACvD,UAAU,OAAO;IACf,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CACrC;AAID;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,SAAS,OAAO,KAAG,MAA0D,CAAA;AAEpG;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,GAAI,QAAQ,MAAM,KAAG,OAEzB,CAAA;AAEjB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,aAAa,CAAC,OAAO,CAMrG,CAAA;AAOJ;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,UAAU,aAAa,CAAC,OAAO,CAAC,KAAG,MAK4J,CAAA;AAEtN;;;;;;;;;GASG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,UAAU,aAAa,CAAC,OAAO,CAAC,KAAG,MAGmC,CAAA"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The completion its own cell wrote before a call in it failed.
|
|
3
|
+
*
|
|
4
|
+
* A cell is authored blind: the model writes the whole program, `ctx.done`
|
|
5
|
+
* included, before any call in it settles, and a failed call resolves
|
|
6
|
+
* `{ ok: false, error }` rather than throwing, so the rest of the cell runs.
|
|
7
|
+
* A cell that makes a request and completes in the same program therefore
|
|
8
|
+
* reports the request as made whatever the request did. The sentence is not a
|
|
9
|
+
* lie the model told; it is a sentence written about a result that did not
|
|
10
|
+
* exist yet.
|
|
11
|
+
*
|
|
12
|
+
* It is not hypothetical. A TUI coordinator on a small seat ran
|
|
13
|
+
* `ctx.call("agent.delegate", …)` and `ctx.done("Delegated the estimation
|
|
14
|
+
* system design to codex astra.")` in one cell. The delegation failed with
|
|
15
|
+
* "Three workers are active; wait for a completion", the cell ran on, and the
|
|
16
|
+
* user was told work was running that never started.
|
|
17
|
+
*
|
|
18
|
+
* ## What the harness does, and why it reads no prose
|
|
19
|
+
*
|
|
20
|
+
* The rule is structural. A completion whose own frame settled a failed call
|
|
21
|
+
* was written before that failure existed, and no earlier frame showed it to
|
|
22
|
+
* the model. The harness cannot decide from the sentence whether it states
|
|
23
|
+
* the failure, and it does not try: it hands the frame back once with the
|
|
24
|
+
* failure, as a demand, so the next completion is written by a model that has
|
|
25
|
+
* read the result. Two exact tests spare a cell that was written to handle the
|
|
26
|
+
* failure: one whose source reads a call envelope's `ok` or `error`, the
|
|
27
|
+
* branch the cell prompt teaches, and one whose completion already quotes the
|
|
28
|
+
* flow's own failure reason. Neither reads what the claim means; each reads
|
|
29
|
+
* whether the claim could have depended on the result at all.
|
|
30
|
+
*
|
|
31
|
+
* Where no frame is left to hand back, or the demand was already spent, the
|
|
32
|
+
* completion stands with the failure appended to it by {@link state}. The
|
|
33
|
+
* harness never lets a claim written before a failure be the whole answer, and
|
|
34
|
+
* it never asks a model whether the claim is true: a weak seat's honesty is
|
|
35
|
+
* not a control.
|
|
36
|
+
*
|
|
37
|
+
* @since 1.0.0-rc.1
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* How many completions one run may have handed back for a failed call.
|
|
41
|
+
*
|
|
42
|
+
* One, like every measured demand: the answer to it is written by a model
|
|
43
|
+
* that has read the failure, and asking twice would be the loop grading that
|
|
44
|
+
* answer.
|
|
45
|
+
*
|
|
46
|
+
* @category constants
|
|
47
|
+
* @since 1.0.0-rc.1
|
|
48
|
+
*/
|
|
49
|
+
export const cap = 1;
|
|
50
|
+
/**
|
|
51
|
+
* The heading of the demand, so a transcript and a test can find it.
|
|
52
|
+
*
|
|
53
|
+
* @category constants
|
|
54
|
+
* @since 1.0.0-rc.1
|
|
55
|
+
*/
|
|
56
|
+
export const heading = "Call failed before completion";
|
|
57
|
+
/**
|
|
58
|
+
* The line {@link state} appends a failure under.
|
|
59
|
+
*
|
|
60
|
+
* @category constants
|
|
61
|
+
* @since 1.0.0-rc.1
|
|
62
|
+
*/
|
|
63
|
+
export const stated = "Failed before this answer was written:";
|
|
64
|
+
const reasonPrefix = /^Flow \S+ failed: /;
|
|
65
|
+
/**
|
|
66
|
+
* The flow's own words for why a call failed, without the harness's prefix.
|
|
67
|
+
*
|
|
68
|
+
* @category conversions
|
|
69
|
+
* @since 1.0.0-rc.1
|
|
70
|
+
*/
|
|
71
|
+
export const reason = (failure) => failure.message.replace(reasonPrefix, "").trim();
|
|
72
|
+
/**
|
|
73
|
+
* Whether a cell's source reads a call envelope's `ok` or `error`.
|
|
74
|
+
*
|
|
75
|
+
* `r.ok`, `r?.error`, `r["ok"]` and `const { ok, error } = r` all count;
|
|
76
|
+
* `console.error` does not. A cell that reads either wrote a branch for a
|
|
77
|
+
* failed call, so its completion is not one written blind.
|
|
78
|
+
*
|
|
79
|
+
* @category predicates
|
|
80
|
+
* @since 1.0.0-rc.1
|
|
81
|
+
*/
|
|
82
|
+
export const inspects = (source) => /(?<!\bconsole)\??\.\s*(?:ok|error)\b|\[\s*["'`](?:ok|error)["'`]\s*\]|\{[^{}]*\b(?:ok|error)\b[^{}]*\}\s*=[^=>]/
|
|
83
|
+
.test(source);
|
|
84
|
+
/**
|
|
85
|
+
* The failed calls a completion was written before, oldest first.
|
|
86
|
+
*
|
|
87
|
+
* Every call this frame settled with `ok: false`, unless the cell's source
|
|
88
|
+
* inspects call envelopes (see {@link inspects}), and except one whose reason
|
|
89
|
+
* the claim already quotes: that cell read the result and wrote from it. A
|
|
90
|
+
* failure with no message is named by its flow alone and is never quoted, so
|
|
91
|
+
* it is always reported.
|
|
92
|
+
*
|
|
93
|
+
* @category constructors
|
|
94
|
+
* @since 1.0.0-rc.1
|
|
95
|
+
*/
|
|
96
|
+
export const find = (calls, claim, source) => inspects(source) ? [] : calls.flatMap((call) => {
|
|
97
|
+
if (call.ok)
|
|
98
|
+
return [];
|
|
99
|
+
const failure = { flow: call.flow, message: call.message ?? "" };
|
|
100
|
+
const said = reason(failure);
|
|
101
|
+
return said !== "" && claim.includes(said) ? [] : [failure];
|
|
102
|
+
});
|
|
103
|
+
const line = (failure) => {
|
|
104
|
+
const said = reason(failure);
|
|
105
|
+
return said === "" ? `- ${failure.flow} failed` : `- ${failure.flow} failed: ${said}`;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* The demand a completion over failed calls is handed back with.
|
|
109
|
+
*
|
|
110
|
+
* @category conversions
|
|
111
|
+
* @since 1.0.0-rc.1
|
|
112
|
+
*/
|
|
113
|
+
export const demand = (failures) => `${heading} — this cell completed after a call in it had already failed, so the answer was written before its result existed:
|
|
114
|
+
|
|
115
|
+
${failures.map(line).join("\n")}
|
|
116
|
+
|
|
117
|
+
Your answer is not the answer that stands yet. Retry the call if the failure is one you can fix, or complete again stating plainly what was not done and why. Never report failed work as requested, started or done.`;
|
|
118
|
+
/**
|
|
119
|
+
* The answer a completion stands on when it could not be handed back.
|
|
120
|
+
*
|
|
121
|
+
* The claim is kept, because the harness cannot tell a claim that states the
|
|
122
|
+
* failure from one that does not, and the failure is appended in the flow's
|
|
123
|
+
* own words, so a reader sees what happened whatever the claim says.
|
|
124
|
+
*
|
|
125
|
+
* @category conversions
|
|
126
|
+
* @since 1.0.0-rc.1
|
|
127
|
+
*/
|
|
128
|
+
export const state = (claim, failures) => failures.length === 0
|
|
129
|
+
? claim
|
|
130
|
+
: [claim.trim(), [stated, ...failures.map(line)].join("\n")].filter((part) => part !== "").join("\n\n");
|
|
131
|
+
//# sourceMappingURL=FailedCall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FailedCall.js","sourceRoot":"","sources":["../../src/FailedCall.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAA;AAEpB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,+BAA+B,CAA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CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,YAAY,IAAI,EAAE,CAAA;AACvF,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,QAAgC,EAAU,EAAE,CACjE,GAAG,OAAO;;EAEV,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;sNAEuL,CAAA;AAEtN;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,QAAgC,EAAU,EAAE,CAC/E,QAAQ,CAAC,MAAM,KAAK,CAAC;IACnB,CAAC,CAAC,KAAK;IACP,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA","sourcesContent":["/**\n * The completion its own cell wrote before a call in it failed.\n *\n * A cell is authored blind: the model writes the whole program, `ctx.done`\n * included, before any call in it settles, and a failed call resolves\n * `{ ok: false, error }` rather than throwing, so the rest of the cell runs.\n * A cell that makes a request and completes in the same program therefore\n * reports the request as made whatever the request did. The sentence is not a\n * lie the model told; it is a sentence written about a result that did not\n * exist yet.\n *\n * It is not hypothetical. A TUI coordinator on a small seat ran\n * `ctx.call(\"agent.delegate\", …)` and `ctx.done(\"Delegated the estimation\n * system design to codex astra.\")` in one cell. The delegation failed with\n * \"Three workers are active; wait for a completion\", the cell ran on, and the\n * user was told work was running that never started.\n *\n * ## What the harness does, and why it reads no prose\n *\n * The rule is structural. A completion whose own frame settled a failed call\n * was written before that failure existed, and no earlier frame showed it to\n * the model. The harness cannot decide from the sentence whether it states\n * the failure, and it does not try: it hands the frame back once with the\n * failure, as a demand, so the next completion is written by a model that has\n * read the result. Two exact tests spare a cell that was written to handle the\n * failure: one whose source reads a call envelope's `ok` or `error`, the\n * branch the cell prompt teaches, and one whose completion already quotes the\n * flow's own failure reason. Neither reads what the claim means; each reads\n * whether the claim could have depended on the result at all.\n *\n * Where no frame is left to hand back, or the demand was already spent, the\n * completion stands with the failure appended to it by {@link state}. The\n * harness never lets a claim written before a failure be the whole answer, and\n * it never asks a model whether the claim is true: a weak seat's honesty is\n * not a control.\n *\n * @since 1.0.0-rc.1\n */\n\n/**\n * How many completions one run may have handed back for a failed call.\n *\n * One, like every measured demand: the answer to it is written by a model\n * that has read the failure, and asking twice would be the loop grading that\n * answer.\n *\n * @category constants\n * @since 1.0.0-rc.1\n */\nexport const cap = 1\n\n/**\n * The heading of the demand, so a transcript and a test can find it.\n *\n * @category constants\n * @since 1.0.0-rc.1\n */\nexport const heading = \"Call failed before completion\"\n\n/**\n * The line {@link state} appends a failure under.\n *\n * @category constants\n * @since 1.0.0-rc.1\n */\nexport const stated = \"Failed before this answer was written:\"\n\n/**\n * One call a completing frame settled as a failure.\n *\n * @category models\n * @since 1.0.0-rc.1\n */\nexport interface Failure {\n /** The flow the call named. */\n readonly flow: string\n /** What the flow said about its failure, verbatim; empty when it said nothing. */\n readonly message: string\n}\n\n/** The frame accounting's view of one settled call. */\ninterface Settled {\n readonly flow: string\n readonly ok: boolean\n readonly message: string | undefined\n}\n\nconst reasonPrefix = /^Flow \\S+ failed: /\n\n/**\n * The flow's own words for why a call failed, without the harness's prefix.\n *\n * @category conversions\n * @since 1.0.0-rc.1\n */\nexport const reason = (failure: Failure): string => failure.message.replace(reasonPrefix, \"\").trim()\n\n/**\n * Whether a cell's source reads a call envelope's `ok` or `error`.\n *\n * `r.ok`, `r?.error`, `r[\"ok\"]` and `const { ok, error } = r` all count;\n * `console.error` does not. A cell that reads either wrote a branch for a\n * failed call, so its completion is not one written blind.\n *\n * @category predicates\n * @since 1.0.0-rc.1\n */\nexport const inspects = (source: string): boolean =>\n /(?<!\\bconsole)\\??\\.\\s*(?:ok|error)\\b|\\[\\s*[\"'`](?:ok|error)[\"'`]\\s*\\]|\\{[^{}]*\\b(?:ok|error)\\b[^{}]*\\}\\s*=[^=>]/\n .test(source)\n\n/**\n * The failed calls a completion was written before, oldest first.\n *\n * Every call this frame settled with `ok: false`, unless the cell's source\n * inspects call envelopes (see {@link inspects}), and except one whose reason\n * the claim already quotes: that cell read the result and wrote from it. A\n * failure with no message is named by its flow alone and is never quoted, so\n * it is always reported.\n *\n * @category constructors\n * @since 1.0.0-rc.1\n */\nexport const find = (calls: ReadonlyArray<Settled>, claim: string, source: string): ReadonlyArray<Failure> =>\n inspects(source) ? [] : calls.flatMap((call): ReadonlyArray<Failure> => {\n if (call.ok) return []\n const failure = { flow: call.flow, message: call.message ?? \"\" }\n const said = reason(failure)\n return said !== \"\" && claim.includes(said) ? [] : [failure]\n })\n\nconst line = (failure: Failure): string => {\n const said = reason(failure)\n return said === \"\" ? `- ${failure.flow} failed` : `- ${failure.flow} failed: ${said}`\n}\n\n/**\n * The demand a completion over failed calls is handed back with.\n *\n * @category conversions\n * @since 1.0.0-rc.1\n */\nexport const demand = (failures: ReadonlyArray<Failure>): string =>\n `${heading} — this cell completed after a call in it had already failed, so the answer was written before its result existed:\n\n${failures.map(line).join(\"\\n\")}\n\nYour answer is not the answer that stands yet. Retry the call if the failure is one you can fix, or complete again stating plainly what was not done and why. Never report failed work as requested, started or done.`\n\n/**\n * The answer a completion stands on when it could not be handed back.\n *\n * The claim is kept, because the harness cannot tell a claim that states the\n * failure from one that does not, and the failure is appended in the flow's\n * own words, so a reader sees what happened whatever the claim says.\n *\n * @category conversions\n * @since 1.0.0-rc.1\n */\nexport const state = (claim: string, failures: ReadonlyArray<Failure>): string =>\n failures.length === 0\n ? claim\n : [claim.trim(), [stated, ...failures.map(line)].join(\"\\n\")].filter((part) => part !== \"\").join(\"\\n\\n\")\n"]}
|