@shivaedev/work-fleet 0.0.0 → 0.1.1
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 +164 -0
- package/LICENSE +21 -0
- package/README.md +362 -1
- package/dist/DecisionCode.d.ts +4 -0
- package/dist/DecisionCode.d.ts.map +1 -0
- package/dist/DecisionCode.js +49 -0
- package/dist/DecisionCode.js.map +1 -0
- package/dist/admit.d.ts +494 -0
- package/dist/admit.d.ts.map +1 -0
- package/dist/admit.js +28 -0
- package/dist/admit.js.map +1 -0
- package/dist/attention.d.ts +18 -0
- package/dist/attention.d.ts.map +1 -0
- package/dist/attention.js +15 -0
- package/dist/attention.js.map +1 -0
- package/dist/board/acknowledgeDecision.d.ts +20 -0
- package/dist/board/acknowledgeDecision.d.ts.map +1 -0
- package/dist/board/acknowledgeDecision.js +44 -0
- package/dist/board/acknowledgeDecision.js.map +1 -0
- package/dist/board/briefRevision.d.ts +3 -0
- package/dist/board/briefRevision.d.ts.map +1 -0
- package/dist/board/briefRevision.js +13 -0
- package/dist/board/briefRevision.js.map +1 -0
- package/dist/board/completionFields.d.ts +8 -0
- package/dist/board/completionFields.d.ts.map +1 -0
- package/dist/board/completionFields.js +56 -0
- package/dist/board/completionFields.js.map +1 -0
- package/dist/board/completionMarkdown.d.ts +2 -0
- package/dist/board/completionMarkdown.d.ts.map +1 -0
- package/dist/board/completionMarkdown.js +24 -0
- package/dist/board/completionMarkdown.js.map +1 -0
- package/dist/board/decisionAnswer.d.ts +3 -0
- package/dist/board/decisionAnswer.d.ts.map +1 -0
- package/dist/board/decisionAnswer.js +11 -0
- package/dist/board/decisionAnswer.js.map +1 -0
- package/dist/board/decisionReading.d.ts +41 -0
- package/dist/board/decisionReading.d.ts.map +1 -0
- package/dist/board/decisionReading.js +43 -0
- package/dist/board/decisionReading.js.map +1 -0
- package/dist/board/documents.d.ts +14 -0
- package/dist/board/documents.d.ts.map +1 -0
- package/dist/board/documents.js +62 -0
- package/dist/board/documents.js.map +1 -0
- package/dist/board/fleetField.d.ts +5 -0
- package/dist/board/fleetField.d.ts.map +1 -0
- package/dist/board/fleetField.js +30 -0
- package/dist/board/fleetField.js.map +1 -0
- package/dist/board/markdown.d.ts +4 -0
- package/dist/board/markdown.d.ts.map +1 -0
- package/dist/board/markdown.js +92 -0
- package/dist/board/markdown.js.map +1 -0
- package/dist/board/publish.d.ts +57 -0
- package/dist/board/publish.d.ts.map +1 -0
- package/dist/board/publish.js +89 -0
- package/dist/board/publish.js.map +1 -0
- package/dist/board/publishReport.d.ts +39 -0
- package/dist/board/publishReport.d.ts.map +1 -0
- package/dist/board/publishReport.js +36 -0
- package/dist/board/publishReport.js.map +1 -0
- package/dist/board/readDocument.d.ts +14 -0
- package/dist/board/readDocument.d.ts.map +1 -0
- package/dist/board/readDocument.js +28 -0
- package/dist/board/readDocument.js.map +1 -0
- package/dist/board/readPass.d.ts +29 -0
- package/dist/board/readPass.d.ts.map +1 -0
- package/dist/board/readPass.js +84 -0
- package/dist/board/readPass.js.map +1 -0
- package/dist/board/reportContent.d.ts +5 -0
- package/dist/board/reportContent.d.ts.map +1 -0
- package/dist/board/reportContent.js +15 -0
- package/dist/board/reportContent.js.map +1 -0
- package/dist/board/reportFiles.d.ts +5 -0
- package/dist/board/reportFiles.d.ts.map +1 -0
- package/dist/board/reportFiles.js +64 -0
- package/dist/board/reportFiles.js.map +1 -0
- package/dist/board/reportIdentity.d.ts +11 -0
- package/dist/board/reportIdentity.d.ts.map +1 -0
- package/dist/board/reportIdentity.js +7 -0
- package/dist/board/reportIdentity.js.map +1 -0
- package/dist/board/reportLinks.d.ts +4 -0
- package/dist/board/reportLinks.d.ts.map +1 -0
- package/dist/board/reportLinks.js +16 -0
- package/dist/board/reportLinks.js.map +1 -0
- package/dist/board/reportPayload.d.ts +26 -0
- package/dist/board/reportPayload.d.ts.map +1 -0
- package/dist/board/reportPayload.js +53 -0
- package/dist/board/reportPayload.js.map +1 -0
- package/dist/board/reportPayloadFile.d.ts +4 -0
- package/dist/board/reportPayloadFile.d.ts.map +1 -0
- package/dist/board/reportPayloadFile.js +69 -0
- package/dist/board/reportPayloadFile.js.map +1 -0
- package/dist/board/schema.d.ts +75 -0
- package/dist/board/schema.d.ts.map +1 -0
- package/dist/board/schema.js +40 -0
- package/dist/board/schema.js.map +1 -0
- package/dist/board/statusMarkdown.d.ts +4 -0
- package/dist/board/statusMarkdown.d.ts.map +1 -0
- package/dist/board/statusMarkdown.js +34 -0
- package/dist/board/statusMarkdown.js.map +1 -0
- package/dist/board/workRevision.d.ts +2 -0
- package/dist/board/workRevision.d.ts.map +1 -0
- package/dist/board/workRevision.js +8 -0
- package/dist/board/workRevision.js.map +1 -0
- package/dist/board/writeCompletion.d.ts +3 -0
- package/dist/board/writeCompletion.d.ts.map +1 -0
- package/dist/board/writeCompletion.js +45 -0
- package/dist/board/writeCompletion.js.map +1 -0
- package/dist/board/writeHealth.d.ts +5 -0
- package/dist/board/writeHealth.d.ts.map +1 -0
- package/dist/board/writeHealth.js +20 -0
- package/dist/board/writeHealth.js.map +1 -0
- package/dist/board/writePublished.d.ts +4 -0
- package/dist/board/writePublished.d.ts.map +1 -0
- package/dist/board/writePublished.js +42 -0
- package/dist/board/writePublished.js.map +1 -0
- package/dist/board/writeStatus.d.ts +5 -0
- package/dist/board/writeStatus.d.ts.map +1 -0
- package/dist/board/writeStatus.js +8 -0
- package/dist/board/writeStatus.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +59 -0
- package/dist/cli.js.map +1 -0
- package/dist/completion.d.ts +8 -0
- package/dist/completion.d.ts.map +1 -0
- package/dist/completion.js +23 -0
- package/dist/completion.js.map +1 -0
- package/dist/engine/ReportInspection.d.ts +10 -0
- package/dist/engine/ReportInspection.d.ts.map +1 -0
- package/dist/engine/ReportInspection.js +4 -0
- package/dist/engine/ReportInspection.js.map +1 -0
- package/dist/engine/applyResolution.d.ts +983 -0
- package/dist/engine/applyResolution.d.ts.map +1 -0
- package/dist/engine/applyResolution.js +97 -0
- package/dist/engine/applyResolution.js.map +1 -0
- package/dist/engine/approveBrief.d.ts +1475 -0
- package/dist/engine/approveBrief.d.ts.map +1 -0
- package/dist/engine/approveBrief.js +82 -0
- package/dist/engine/approveBrief.js.map +1 -0
- package/dist/engine/authorizeResolution.d.ts +8355 -0
- package/dist/engine/authorizeResolution.d.ts.map +1 -0
- package/dist/engine/authorizeResolution.js +18 -0
- package/dist/engine/authorizeResolution.js.map +1 -0
- package/dist/engine/boardBrief.d.ts +1470 -0
- package/dist/engine/boardBrief.d.ts.map +1 -0
- package/dist/engine/boardBrief.js +57 -0
- package/dist/engine/boardBrief.js.map +1 -0
- package/dist/engine/capacityRetry.d.ts +25539 -0
- package/dist/engine/capacityRetry.d.ts.map +1 -0
- package/dist/engine/capacityRetry.js +55 -0
- package/dist/engine/capacityRetry.js.map +1 -0
- package/dist/engine/closeDecisions.d.ts +963 -0
- package/dist/engine/closeDecisions.d.ts.map +1 -0
- package/dist/engine/closeDecisions.js +74 -0
- package/dist/engine/closeDecisions.js.map +1 -0
- package/dist/engine/completeBoardWork.d.ts +965 -0
- package/dist/engine/completeBoardWork.d.ts.map +1 -0
- package/dist/engine/completeBoardWork.js +29 -0
- package/dist/engine/completeBoardWork.js.map +1 -0
- package/dist/engine/completeReport.d.ts +977 -0
- package/dist/engine/completeReport.d.ts.map +1 -0
- package/dist/engine/completeReport.js +20 -0
- package/dist/engine/completeReport.js.map +1 -0
- package/dist/engine/continueCommand.d.ts +485 -0
- package/dist/engine/continueCommand.d.ts.map +1 -0
- package/dist/engine/continueCommand.js +28 -0
- package/dist/engine/continueCommand.js.map +1 -0
- package/dist/engine/continueWorker.d.ts +984 -0
- package/dist/engine/continueWorker.d.ts.map +1 -0
- package/dist/engine/continueWorker.js +20 -0
- package/dist/engine/continueWorker.js.map +1 -0
- package/dist/engine/continuedRecord.d.ts +3 -0
- package/dist/engine/continuedRecord.d.ts.map +1 -0
- package/dist/engine/continuedRecord.js +23 -0
- package/dist/engine/continuedRecord.js.map +1 -0
- package/dist/engine/deliverPendingAnswers.d.ts +9797 -0
- package/dist/engine/deliverPendingAnswers.d.ts.map +1 -0
- package/dist/engine/deliverPendingAnswers.js +22 -0
- package/dist/engine/deliverPendingAnswers.js.map +1 -0
- package/dist/engine/deliveryFailure.d.ts +6 -0
- package/dist/engine/deliveryFailure.d.ts.map +1 -0
- package/dist/engine/deliveryFailure.js +11 -0
- package/dist/engine/deliveryFailure.js.map +1 -0
- package/dist/engine/dispatchCommand.d.ts +485 -0
- package/dist/engine/dispatchCommand.d.ts.map +1 -0
- package/dist/engine/dispatchCommand.js +69 -0
- package/dist/engine/dispatchCommand.js.map +1 -0
- package/dist/engine/ensureDecisionOwner.d.ts +963 -0
- package/dist/engine/ensureDecisionOwner.d.ts.map +1 -0
- package/dist/engine/ensureDecisionOwner.js +13 -0
- package/dist/engine/ensureDecisionOwner.js.map +1 -0
- package/dist/engine/ensurePublication.d.ts +964 -0
- package/dist/engine/ensurePublication.d.ts.map +1 -0
- package/dist/engine/ensurePublication.js +25 -0
- package/dist/engine/ensurePublication.js.map +1 -0
- package/dist/engine/exhaustedCheckRepairs.d.ts +3 -0
- package/dist/engine/exhaustedCheckRepairs.d.ts.map +1 -0
- package/dist/engine/exhaustedCheckRepairs.js +10 -0
- package/dist/engine/exhaustedCheckRepairs.js.map +1 -0
- package/dist/engine/failureCode.d.ts +3 -0
- package/dist/engine/failureCode.d.ts.map +1 -0
- package/dist/engine/failureCode.js +28 -0
- package/dist/engine/failureCode.js.map +1 -0
- package/dist/engine/failureContext.d.ts +14 -0
- package/dist/engine/failureContext.d.ts.map +1 -0
- package/dist/engine/failureContext.js +9 -0
- package/dist/engine/failureContext.js.map +1 -0
- package/dist/engine/failureMessage.d.ts +2 -0
- package/dist/engine/failureMessage.d.ts.map +1 -0
- package/dist/engine/failureMessage.js +20 -0
- package/dist/engine/failureMessage.js.map +1 -0
- package/dist/engine/failureOwner.d.ts +3 -0
- package/dist/engine/failureOwner.d.ts.map +1 -0
- package/dist/engine/failureOwner.js +9 -0
- package/dist/engine/failureOwner.js.map +1 -0
- package/dist/engine/health.d.ts +36 -0
- package/dist/engine/health.d.ts.map +1 -0
- package/dist/engine/health.js +26 -0
- package/dist/engine/health.js.map +1 -0
- package/dist/engine/inspectRenewal.d.ts +974 -0
- package/dist/engine/inspectRenewal.d.ts.map +1 -0
- package/dist/engine/inspectRenewal.js +53 -0
- package/dist/engine/inspectRenewal.js.map +1 -0
- package/dist/engine/launchInput.d.ts +492 -0
- package/dist/engine/launchInput.d.ts.map +1 -0
- package/dist/engine/launchInput.js +24 -0
- package/dist/engine/launchInput.js.map +1 -0
- package/dist/engine/launchObservationRetries.d.ts +3 -0
- package/dist/engine/launchObservationRetries.d.ts.map +1 -0
- package/dist/engine/launchObservationRetries.js +4 -0
- package/dist/engine/launchObservationRetries.js.map +1 -0
- package/dist/engine/launchReceipt.d.ts +486 -0
- package/dist/engine/launchReceipt.d.ts.map +1 -0
- package/dist/engine/launchReceipt.js +14 -0
- package/dist/engine/launchReceipt.js.map +1 -0
- package/dist/engine/launchRecord.d.ts +4 -0
- package/dist/engine/launchRecord.d.ts.map +1 -0
- package/dist/engine/launchRecord.js +8 -0
- package/dist/engine/launchRecord.js.map +1 -0
- package/dist/engine/localOnlyCriteria.d.ts +13 -0
- package/dist/engine/localOnlyCriteria.d.ts.map +1 -0
- package/dist/engine/localOnlyCriteria.js +13 -0
- package/dist/engine/localOnlyCriteria.js.map +1 -0
- package/dist/engine/makeAdopt.d.ts +974 -0
- package/dist/engine/makeAdopt.d.ts.map +1 -0
- package/dist/engine/makeAdopt.js +52 -0
- package/dist/engine/makeAdopt.js.map +1 -0
- package/dist/engine/makeAdvance.d.ts +485 -0
- package/dist/engine/makeAdvance.d.ts.map +1 -0
- package/dist/engine/makeAdvance.js +79 -0
- package/dist/engine/makeAdvance.js.map +1 -0
- package/dist/engine/makeDeliver.d.ts +963 -0
- package/dist/engine/makeDeliver.d.ts.map +1 -0
- package/dist/engine/makeDeliver.js +85 -0
- package/dist/engine/makeDeliver.js.map +1 -0
- package/dist/engine/makeHuman.d.ts +965 -0
- package/dist/engine/makeHuman.d.ts.map +1 -0
- package/dist/engine/makeHuman.js +39 -0
- package/dist/engine/makeHuman.js.map +1 -0
- package/dist/engine/makeLaunch.d.ts +971 -0
- package/dist/engine/makeLaunch.d.ts.map +1 -0
- package/dist/engine/makeLaunch.js +75 -0
- package/dist/engine/makeLaunch.js.map +1 -0
- package/dist/engine/makeObserve.d.ts +964 -0
- package/dist/engine/makeObserve.d.ts.map +1 -0
- package/dist/engine/makeObserve.js +89 -0
- package/dist/engine/makeObserve.js.map +1 -0
- package/dist/engine/makeReview.d.ts +973 -0
- package/dist/engine/makeReview.d.ts.map +1 -0
- package/dist/engine/makeReview.js +84 -0
- package/dist/engine/makeReview.js.map +1 -0
- package/dist/engine/makeState.d.ts +7880 -0
- package/dist/engine/makeState.d.ts.map +1 -0
- package/dist/engine/makeState.js +61 -0
- package/dist/engine/makeState.js.map +1 -0
- package/dist/engine/makeValidate.d.ts +973 -0
- package/dist/engine/makeValidate.d.ts.map +1 -0
- package/dist/engine/makeValidate.js +34 -0
- package/dist/engine/makeValidate.js.map +1 -0
- package/dist/engine/mergeReadiness.d.ts +10759 -0
- package/dist/engine/mergeReadiness.d.ts.map +1 -0
- package/dist/engine/mergeReadiness.js +25 -0
- package/dist/engine/mergeReadiness.js.map +1 -0
- package/dist/engine/observeDeliveryFailure.d.ts +8836 -0
- package/dist/engine/observeDeliveryFailure.d.ts.map +1 -0
- package/dist/engine/observeDeliveryFailure.js +40 -0
- package/dist/engine/observeDeliveryFailure.js.map +1 -0
- package/dist/engine/observeRenewal.d.ts +1535 -0
- package/dist/engine/observeRenewal.d.ts.map +1 -0
- package/dist/engine/observeRenewal.js +27 -0
- package/dist/engine/observeRenewal.js.map +1 -0
- package/dist/engine/observedAttempt.d.ts +4 -0
- package/dist/engine/observedAttempt.d.ts.map +1 -0
- package/dist/engine/observedAttempt.js +15 -0
- package/dist/engine/observedAttempt.js.map +1 -0
- package/dist/engine/obtainReview.d.ts +515 -0
- package/dist/engine/obtainReview.d.ts.map +1 -0
- package/dist/engine/obtainReview.js +100 -0
- package/dist/engine/obtainReview.js.map +1 -0
- package/dist/engine/operationRecord.d.ts +6299 -0
- package/dist/engine/operationRecord.d.ts.map +1 -0
- package/dist/engine/operationRecord.js +19 -0
- package/dist/engine/operationRecord.js.map +1 -0
- package/dist/engine/originalWork.d.ts +4 -0
- package/dist/engine/originalWork.d.ts.map +1 -0
- package/dist/engine/originalWork.js +14 -0
- package/dist/engine/originalWork.js.map +1 -0
- package/dist/engine/pendingAcknowledgements.d.ts +9 -0
- package/dist/engine/pendingAcknowledgements.d.ts.map +1 -0
- package/dist/engine/pendingAcknowledgements.js +38 -0
- package/dist/engine/pendingAcknowledgements.js.map +1 -0
- package/dist/engine/persistTerminalReceipts.d.ts +968 -0
- package/dist/engine/persistTerminalReceipts.d.ts.map +1 -0
- package/dist/engine/persistTerminalReceipts.js +12 -0
- package/dist/engine/persistTerminalReceipts.js.map +1 -0
- package/dist/engine/prepareCommand.d.ts +488 -0
- package/dist/engine/prepareCommand.d.ts.map +1 -0
- package/dist/engine/prepareCommand.js +69 -0
- package/dist/engine/prepareCommand.js.map +1 -0
- package/dist/engine/queueAnswerCommand.d.ts +487 -0
- package/dist/engine/queueAnswerCommand.d.ts.map +1 -0
- package/dist/engine/queueAnswerCommand.js +15 -0
- package/dist/engine/queueAnswerCommand.js.map +1 -0
- package/dist/engine/readOrContinueReview.d.ts +517 -0
- package/dist/engine/readOrContinueReview.d.ts.map +1 -0
- package/dist/engine/readOrContinueReview.js +54 -0
- package/dist/engine/readOrContinueReview.js.map +1 -0
- package/dist/engine/readResolution.d.ts +134 -0
- package/dist/engine/readResolution.d.ts.map +1 -0
- package/dist/engine/readResolution.js +45 -0
- package/dist/engine/readResolution.js.map +1 -0
- package/dist/engine/readRetry.d.ts +17668 -0
- package/dist/engine/readRetry.d.ts.map +1 -0
- package/dist/engine/readRetry.js +80 -0
- package/dist/engine/readRetry.js.map +1 -0
- package/dist/engine/reassignCommand.d.ts +484 -0
- package/dist/engine/reassignCommand.d.ts.map +1 -0
- package/dist/engine/reassignCommand.js +40 -0
- package/dist/engine/reassignCommand.js.map +1 -0
- package/dist/engine/reconcileAttempt.d.ts +534 -0
- package/dist/engine/reconcileAttempt.d.ts.map +1 -0
- package/dist/engine/reconcileAttempt.js +26 -0
- package/dist/engine/reconcileAttempt.js.map +1 -0
- package/dist/engine/reconcileCommand.d.ts +486 -0
- package/dist/engine/reconcileCommand.d.ts.map +1 -0
- package/dist/engine/reconcileCommand.js +52 -0
- package/dist/engine/reconcileCommand.js.map +1 -0
- package/dist/engine/recoverStall.d.ts +8881 -0
- package/dist/engine/recoverStall.d.ts.map +1 -0
- package/dist/engine/recoverStall.js +62 -0
- package/dist/engine/recoverStall.js.map +1 -0
- package/dist/engine/recoverUnobservable.d.ts +8881 -0
- package/dist/engine/recoverUnobservable.d.ts.map +1 -0
- package/dist/engine/recoverUnobservable.js +26 -0
- package/dist/engine/recoverUnobservable.js.map +1 -0
- package/dist/engine/refreshBrief.d.ts +17675 -0
- package/dist/engine/refreshBrief.d.ts.map +1 -0
- package/dist/engine/refreshBrief.js +48 -0
- package/dist/engine/refreshBrief.js.map +1 -0
- package/dist/engine/refreshReviewResult.d.ts +984 -0
- package/dist/engine/refreshReviewResult.d.ts.map +1 -0
- package/dist/engine/refreshReviewResult.js +69 -0
- package/dist/engine/refreshReviewResult.js.map +1 -0
- package/dist/engine/releaseClosedPreparation.d.ts +8845 -0
- package/dist/engine/releaseClosedPreparation.d.ts.map +1 -0
- package/dist/engine/releaseClosedPreparation.js +17 -0
- package/dist/engine/releaseClosedPreparation.js.map +1 -0
- package/dist/engine/releaseExecution.d.ts +8836 -0
- package/dist/engine/releaseExecution.d.ts.map +1 -0
- package/dist/engine/releaseExecution.js +54 -0
- package/dist/engine/releaseExecution.js.map +1 -0
- package/dist/engine/releaseFinishedWork.d.ts +485 -0
- package/dist/engine/releaseFinishedWork.d.ts.map +1 -0
- package/dist/engine/releaseFinishedWork.js +27 -0
- package/dist/engine/releaseFinishedWork.js.map +1 -0
- package/dist/engine/releaseOnly.d.ts +3 -0
- package/dist/engine/releaseOnly.d.ts.map +1 -0
- package/dist/engine/releaseOnly.js +19 -0
- package/dist/engine/releaseOnly.js.map +1 -0
- package/dist/engine/releaseReceipts.d.ts +12 -0
- package/dist/engine/releaseReceipts.d.ts.map +1 -0
- package/dist/engine/releaseReceipts.js +20 -0
- package/dist/engine/releaseReceipts.js.map +1 -0
- package/dist/engine/repository.d.ts +5824 -0
- package/dist/engine/repository.d.ts.map +1 -0
- package/dist/engine/repository.js +112 -0
- package/dist/engine/repository.js.map +1 -0
- package/dist/engine/requestConflictRepair.d.ts +8835 -0
- package/dist/engine/requestConflictRepair.d.ts.map +1 -0
- package/dist/engine/requestConflictRepair.js +26 -0
- package/dist/engine/requestConflictRepair.js.map +1 -0
- package/dist/engine/requestRework.d.ts +983 -0
- package/dist/engine/requestRework.d.ts.map +1 -0
- package/dist/engine/requestRework.js +35 -0
- package/dist/engine/requestRework.js.map +1 -0
- package/dist/engine/reserveRenewal.d.ts +25 -0
- package/dist/engine/reserveRenewal.d.ts.map +1 -0
- package/dist/engine/reserveRenewal.js +15 -0
- package/dist/engine/reserveRenewal.js.map +1 -0
- package/dist/engine/resolveCommand.d.ts +484 -0
- package/dist/engine/resolveCommand.d.ts.map +1 -0
- package/dist/engine/resolveCommand.js +36 -0
- package/dist/engine/resolveCommand.js.map +1 -0
- package/dist/engine/resolveExecution.d.ts +8834 -0
- package/dist/engine/resolveExecution.d.ts.map +1 -0
- package/dist/engine/resolveExecution.js +32 -0
- package/dist/engine/resolveExecution.js.map +1 -0
- package/dist/engine/restartableReview.d.ts +4 -0
- package/dist/engine/restartableReview.d.ts.map +1 -0
- package/dist/engine/restartableReview.js +14 -0
- package/dist/engine/restartableReview.js.map +1 -0
- package/dist/engine/resumeAttempt.d.ts +8884 -0
- package/dist/engine/resumeAttempt.d.ts.map +1 -0
- package/dist/engine/resumeAttempt.js +21 -0
- package/dist/engine/resumeAttempt.js.map +1 -0
- package/dist/engine/retireUnacknowledged.d.ts +967 -0
- package/dist/engine/retireUnacknowledged.d.ts.map +1 -0
- package/dist/engine/retireUnacknowledged.js +14 -0
- package/dist/engine/retireUnacknowledged.js.map +1 -0
- package/dist/engine/retryPrompt.d.ts +3 -0
- package/dist/engine/retryPrompt.d.ts.map +1 -0
- package/dist/engine/retryPrompt.js +13 -0
- package/dist/engine/retryPrompt.js.map +1 -0
- package/dist/engine/retryTerminal.d.ts +8370 -0
- package/dist/engine/retryTerminal.d.ts.map +1 -0
- package/dist/engine/retryTerminal.js +15 -0
- package/dist/engine/retryTerminal.js.map +1 -0
- package/dist/engine/scheduler.d.ts +966 -0
- package/dist/engine/scheduler.d.ts.map +1 -0
- package/dist/engine/scheduler.js +68 -0
- package/dist/engine/scheduler.js.map +1 -0
- package/dist/engine/sessionCleanup.d.ts +965 -0
- package/dist/engine/sessionCleanup.d.ts.map +1 -0
- package/dist/engine/sessionCleanup.js +42 -0
- package/dist/engine/sessionCleanup.js.map +1 -0
- package/dist/engine/sessionStatus.d.ts +3 -0
- package/dist/engine/sessionStatus.d.ts.map +1 -0
- package/dist/engine/sessionStatus.js +13 -0
- package/dist/engine/sessionStatus.js.map +1 -0
- package/dist/engine/settleMergedDelivery.d.ts +8839 -0
- package/dist/engine/settleMergedDelivery.d.ts.map +1 -0
- package/dist/engine/settleMergedDelivery.js +16 -0
- package/dist/engine/settleMergedDelivery.js.map +1 -0
- package/dist/engine/submissionFailure.d.ts +7875 -0
- package/dist/engine/submissionFailure.d.ts.map +1 -0
- package/dist/engine/submissionFailure.js +32 -0
- package/dist/engine/submissionFailure.js.map +1 -0
- package/dist/engine/submitLaunch.d.ts +8358 -0
- package/dist/engine/submitLaunch.d.ts.map +1 -0
- package/dist/engine/submitLaunch.js +17 -0
- package/dist/engine/submitLaunch.js.map +1 -0
- package/dist/engine/threadNames.d.ts +4 -0
- package/dist/engine/threadNames.d.ts.map +1 -0
- package/dist/engine/threadNames.js +53 -0
- package/dist/engine/threadNames.js.map +1 -0
- package/dist/engine/views.d.ts +3 -0
- package/dist/engine/views.d.ts.map +1 -0
- package/dist/engine/views.js +40 -0
- package/dist/engine/views.js.map +1 -0
- package/dist/engine/workerReport.d.ts +1464 -0
- package/dist/engine/workerReport.d.ts.map +1 -0
- package/dist/engine/workerReport.js +43 -0
- package/dist/engine/workerReport.js.map +1 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +6 -0
- package/dist/errors.js.map +1 -0
- package/dist/exposeFailure.d.ts +4 -0
- package/dist/exposeFailure.d.ts.map +1 -0
- package/dist/exposeFailure.js +26 -0
- package/dist/exposeFailure.js.map +1 -0
- package/dist/fleet.d.ts +4827 -0
- package/dist/fleet.d.ts.map +1 -0
- package/dist/fleet.js +41 -0
- package/dist/fleet.js.map +1 -0
- package/dist/fleetRecords.d.ts +2 -0
- package/dist/fleetRecords.d.ts.map +1 -0
- package/dist/fleetRecords.js +4 -0
- package/dist/fleetRecords.js.map +1 -0
- package/dist/host/actionCommands.d.ts +35 -0
- package/dist/host/actionCommands.d.ts.map +1 -0
- package/dist/host/actionCommands.js +49 -0
- package/dist/host/actionCommands.js.map +1 -0
- package/dist/host/admission.d.ts +979 -0
- package/dist/host/admission.d.ts.map +1 -0
- package/dist/host/admission.js +105 -0
- package/dist/host/admission.js.map +1 -0
- package/dist/host/answerText.d.ts +4 -0
- package/dist/host/answerText.d.ts.map +1 -0
- package/dist/host/answerText.js +11 -0
- package/dist/host/answerText.js.map +1 -0
- package/dist/host/answerWork.d.ts +483 -0
- package/dist/host/answerWork.d.ts.map +1 -0
- package/dist/host/answerWork.js +70 -0
- package/dist/host/answerWork.js.map +1 -0
- package/dist/host/applyReportPatch.d.ts +4 -0
- package/dist/host/applyReportPatch.d.ts.map +1 -0
- package/dist/host/applyReportPatch.js +107 -0
- package/dist/host/applyReportPatch.js.map +1 -0
- package/dist/host/cliOptions.d.ts +7 -0
- package/dist/host/cliOptions.d.ts.map +1 -0
- package/dist/host/cliOptions.js +12 -0
- package/dist/host/cliOptions.js.map +1 -0
- package/dist/host/commands.d.ts +979 -0
- package/dist/host/commands.d.ts.map +1 -0
- package/dist/host/commands.js +39 -0
- package/dist/host/commands.js.map +1 -0
- package/dist/host/config.d.ts +86 -0
- package/dist/host/config.d.ts.map +1 -0
- package/dist/host/config.js +81 -0
- package/dist/host/config.js.map +1 -0
- package/dist/host/continuationMessage.d.ts +5 -0
- package/dist/host/continuationMessage.d.ts.map +1 -0
- package/dist/host/continuationMessage.js +13 -0
- package/dist/host/continuationMessage.js.map +1 -0
- package/dist/host/daemon.d.ts +5537 -0
- package/dist/host/daemon.d.ts.map +1 -0
- package/dist/host/daemon.js +37 -0
- package/dist/host/daemon.js.map +1 -0
- package/dist/host/daemonClient.d.ts +5520 -0
- package/dist/host/daemonClient.d.ts.map +1 -0
- package/dist/host/daemonClient.js +27 -0
- package/dist/host/daemonClient.js.map +1 -0
- package/dist/host/daemonContract.d.ts +9040 -0
- package/dist/host/daemonContract.d.ts.map +1 -0
- package/dist/host/daemonContract.js +63 -0
- package/dist/host/daemonContract.js.map +1 -0
- package/dist/host/daemonDiagnostics.d.ts +4 -0
- package/dist/host/daemonDiagnostics.d.ts.map +1 -0
- package/dist/host/daemonDiagnostics.js +17 -0
- package/dist/host/daemonDiagnostics.js.map +1 -0
- package/dist/host/daemonHandlers.d.ts +4 -0
- package/dist/host/daemonHandlers.d.ts.map +1 -0
- package/dist/host/daemonHandlers.js +23 -0
- package/dist/host/daemonHandlers.js.map +1 -0
- package/dist/host/daemonSnapshots.d.ts +25 -0
- package/dist/host/daemonSnapshots.d.ts.map +1 -0
- package/dist/host/daemonSnapshots.js +15 -0
- package/dist/host/daemonSnapshots.js.map +1 -0
- package/dist/host/defaults.d.ts +5 -0
- package/dist/host/defaults.d.ts.map +1 -0
- package/dist/host/defaults.js +5 -0
- package/dist/host/defaults.js.map +1 -0
- package/dist/host/fleetItems.d.ts +22 -0
- package/dist/host/fleetItems.d.ts.map +1 -0
- package/dist/host/fleetItems.js +30 -0
- package/dist/host/fleetItems.js.map +1 -0
- package/dist/host/follow.d.ts +10 -0
- package/dist/host/follow.d.ts.map +1 -0
- package/dist/host/follow.js +30 -0
- package/dist/host/follow.js.map +1 -0
- package/dist/host/followCommands.d.ts +20 -0
- package/dist/host/followCommands.d.ts.map +1 -0
- package/dist/host/followCommands.js +45 -0
- package/dist/host/followCommands.js.map +1 -0
- package/dist/host/followState.d.ts +9 -0
- package/dist/host/followState.d.ts.map +1 -0
- package/dist/host/followState.js +30 -0
- package/dist/host/followState.js.map +1 -0
- package/dist/host/github.d.ts +32 -0
- package/dist/host/github.d.ts.map +1 -0
- package/dist/host/github.js +19 -0
- package/dist/host/github.js.map +1 -0
- package/dist/host/githubCheckState.d.ts +34 -0
- package/dist/host/githubCheckState.d.ts.map +1 -0
- package/dist/host/githubCheckState.js +74 -0
- package/dist/host/githubCheckState.js.map +1 -0
- package/dist/host/githubChecks.d.ts +31 -0
- package/dist/host/githubChecks.d.ts.map +1 -0
- package/dist/host/githubChecks.js +38 -0
- package/dist/host/githubChecks.js.map +1 -0
- package/dist/host/githubDelivery.d.ts +15 -0
- package/dist/host/githubDelivery.d.ts.map +1 -0
- package/dist/host/githubDelivery.js +53 -0
- package/dist/host/githubDelivery.js.map +1 -0
- package/dist/host/githubRead.d.ts +5 -0
- package/dist/host/githubRead.d.ts.map +1 -0
- package/dist/host/githubRead.js +15 -0
- package/dist/host/githubRead.js.map +1 -0
- package/dist/host/githubRequiredChecks.d.ts +5 -0
- package/dist/host/githubRequiredChecks.d.ts.map +1 -0
- package/dist/host/githubRequiredChecks.js +13 -0
- package/dist/host/githubRequiredChecks.js.map +1 -0
- package/dist/host/githubResult.d.ts +42 -0
- package/dist/host/githubResult.d.ts.map +1 -0
- package/dist/host/githubResult.js +60 -0
- package/dist/host/githubResult.js.map +1 -0
- package/dist/host/guidance.d.ts +4 -0
- package/dist/host/guidance.d.ts.map +1 -0
- package/dist/host/guidance.js +28 -0
- package/dist/host/guidance.js.map +1 -0
- package/dist/host/healthLayer.d.ts +4 -0
- package/dist/host/healthLayer.d.ts.map +1 -0
- package/dist/host/healthLayer.js +16 -0
- package/dist/host/healthLayer.js.map +1 -0
- package/dist/host/localOnlyBoardPath.d.ts +4 -0
- package/dist/host/localOnlyBoardPath.d.ts.map +1 -0
- package/dist/host/localOnlyBoardPath.js +24 -0
- package/dist/host/localOnlyBoardPath.js.map +1 -0
- package/dist/host/mainSource.d.ts +21 -0
- package/dist/host/mainSource.d.ts.map +1 -0
- package/dist/host/mainSource.js +71 -0
- package/dist/host/mainSource.js.map +1 -0
- package/dist/host/nameThreads.d.ts +10 -0
- package/dist/host/nameThreads.d.ts.map +1 -0
- package/dist/host/nameThreads.js +46 -0
- package/dist/host/nameThreads.js.map +1 -0
- package/dist/host/providerHealth.d.ts +4 -0
- package/dist/host/providerHealth.d.ts.map +1 -0
- package/dist/host/providerHealth.js +46 -0
- package/dist/host/providerHealth.js.map +1 -0
- package/dist/host/providers.d.ts +6 -0
- package/dist/host/providers.d.ts.map +1 -0
- package/dist/host/providers.js +27 -0
- package/dist/host/providers.js.map +1 -0
- package/dist/host/quota.d.ts +10 -0
- package/dist/host/quota.d.ts.map +1 -0
- package/dist/host/quota.js +30 -0
- package/dist/host/quota.js.map +1 -0
- package/dist/host/readCommand.d.ts +5 -0
- package/dist/host/readCommand.d.ts.map +1 -0
- package/dist/host/readCommand.js +18 -0
- package/dist/host/readCommand.js.map +1 -0
- package/dist/host/readWaitStates.d.ts +25 -0
- package/dist/host/readWaitStates.d.ts.map +1 -0
- package/dist/host/readWaitStates.js +26 -0
- package/dist/host/readWaitStates.js.map +1 -0
- package/dist/host/reassignWork.d.ts +485 -0
- package/dist/host/reassignWork.d.ts.map +1 -0
- package/dist/host/reassignWork.js +9 -0
- package/dist/host/reassignWork.js.map +1 -0
- package/dist/host/recordDecisionResponse.d.ts +40 -0
- package/dist/host/recordDecisionResponse.d.ts.map +1 -0
- package/dist/host/recordDecisionResponse.js +37 -0
- package/dist/host/recordDecisionResponse.js.map +1 -0
- package/dist/host/recordPayloads.d.ts +4 -0
- package/dist/host/recordPayloads.d.ts.map +1 -0
- package/dist/host/recordPayloads.js +16 -0
- package/dist/host/recordPayloads.js.map +1 -0
- package/dist/host/releaseWork.d.ts +965 -0
- package/dist/host/releaseWork.d.ts.map +1 -0
- package/dist/host/releaseWork.js +47 -0
- package/dist/host/releaseWork.js.map +1 -0
- package/dist/host/renderStatus.d.ts +3 -0
- package/dist/host/renderStatus.d.ts.map +1 -0
- package/dist/host/renderStatus.js +26 -0
- package/dist/host/renderStatus.js.map +1 -0
- package/dist/host/reportAttachmentFiles.d.ts +5 -0
- package/dist/host/reportAttachmentFiles.d.ts.map +1 -0
- package/dist/host/reportAttachmentFiles.js +71 -0
- package/dist/host/reportAttachmentFiles.js.map +1 -0
- package/dist/host/reportBoard.d.ts +11 -0
- package/dist/host/reportBoard.d.ts.map +1 -0
- package/dist/host/reportBoard.js +103 -0
- package/dist/host/reportBoard.js.map +1 -0
- package/dist/host/reportFileChanges.d.ts +19 -0
- package/dist/host/reportFileChanges.d.ts.map +1 -0
- package/dist/host/reportFileChanges.js +31 -0
- package/dist/host/reportFileChanges.js.map +1 -0
- package/dist/host/reportFileReplay.d.ts +19 -0
- package/dist/host/reportFileReplay.d.ts.map +1 -0
- package/dist/host/reportFileReplay.js +102 -0
- package/dist/host/reportFileReplay.js.map +1 -0
- package/dist/host/reportPublication.d.ts +7 -0
- package/dist/host/reportPublication.d.ts.map +1 -0
- package/dist/host/reportPublication.js +23 -0
- package/dist/host/reportPublication.js.map +1 -0
- package/dist/host/resultReport.d.ts +13 -0
- package/dist/host/resultReport.d.ts.map +1 -0
- package/dist/host/resultReport.js +29 -0
- package/dist/host/resultReport.js.map +1 -0
- package/dist/host/runtime.d.ts +18 -0
- package/dist/host/runtime.d.ts.map +1 -0
- package/dist/host/runtime.js +91 -0
- package/dist/host/runtime.js.map +1 -0
- package/dist/host/snapshotStream.d.ts +7 -0
- package/dist/host/snapshotStream.d.ts.map +1 -0
- package/dist/host/snapshotStream.js +15 -0
- package/dist/host/snapshotStream.js.map +1 -0
- package/dist/host/status.d.ts +294 -0
- package/dist/host/status.d.ts.map +1 -0
- package/dist/host/status.js +14 -0
- package/dist/host/status.js.map +1 -0
- package/dist/host/statusLayer.d.ts +7 -0
- package/dist/host/statusLayer.d.ts.map +1 -0
- package/dist/host/statusLayer.js +76 -0
- package/dist/host/statusLayer.js.map +1 -0
- package/dist/host/wait.d.ts +36 -0
- package/dist/host/wait.d.ts.map +1 -0
- package/dist/host/wait.js +23 -0
- package/dist/host/wait.js.map +1 -0
- package/dist/host/waitOutcome.d.ts +52 -0
- package/dist/host/waitOutcome.d.ts.map +1 -0
- package/dist/host/waitOutcome.js +36 -0
- package/dist/host/waitOutcome.js.map +1 -0
- package/dist/host/watch.d.ts +7 -0
- package/dist/host/watch.d.ts.map +1 -0
- package/dist/host/watch.js +54 -0
- package/dist/host/watch.js.map +1 -0
- package/dist/model.d.ts +1122 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +114 -0
- package/dist/model.js.map +1 -0
- package/dist/operations.d.ts +11167 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +72 -0
- package/dist/operations.js.map +1 -0
- package/dist/packageInfo.d.ts +4 -0
- package/dist/packageInfo.d.ts.map +1 -0
- package/dist/packageInfo.js +4 -0
- package/dist/packageInfo.js.map +1 -0
- package/dist/policy.d.ts +196 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +85 -0
- package/dist/policy.js.map +1 -0
- package/dist/policyGuidance.d.ts +4 -0
- package/dist/policyGuidance.d.ts.map +1 -0
- package/dist/policyGuidance.js +5 -0
- package/dist/policyGuidance.js.map +1 -0
- package/dist/preparation/compatibility.d.ts +60 -0
- package/dist/preparation/compatibility.d.ts.map +1 -0
- package/dist/preparation/compatibility.js +41 -0
- package/dist/preparation/compatibility.js.map +1 -0
- package/dist/preparation/schema.d.ts +78 -0
- package/dist/preparation/schema.d.ts.map +1 -0
- package/dist/preparation/schema.js +43 -0
- package/dist/preparation/schema.js.map +1 -0
- package/dist/prompt/reviewer.d.ts +31 -0
- package/dist/prompt/reviewer.d.ts.map +1 -0
- package/dist/prompt/reviewer.js +49 -0
- package/dist/prompt/reviewer.js.map +1 -0
- package/dist/prompt/worker.d.ts +28 -0
- package/dist/prompt/worker.d.ts.map +1 -0
- package/dist/prompt/worker.js +116 -0
- package/dist/prompt/worker.js.map +1 -0
- package/dist/providers/capacity.d.ts +2 -0
- package/dist/providers/capacity.d.ts.map +1 -0
- package/dist/providers/capacity.js +8 -0
- package/dist/providers/capacity.js.map +1 -0
- package/dist/providers/codexAdapter.d.ts +13 -0
- package/dist/providers/codexAdapter.d.ts.map +1 -0
- package/dist/providers/codexAdapter.js +55 -0
- package/dist/providers/codexAdapter.js.map +1 -0
- package/dist/providers/codexCloud.d.ts +40 -0
- package/dist/providers/codexCloud.d.ts.map +1 -0
- package/dist/providers/codexCloud.js +92 -0
- package/dist/providers/codexCloud.js.map +1 -0
- package/dist/providers/codexCloudConnection.d.ts +5 -0
- package/dist/providers/codexCloudConnection.d.ts.map +1 -0
- package/dist/providers/codexCloudConnection.js +34 -0
- package/dist/providers/codexCloudConnection.js.map +1 -0
- package/dist/providers/codexLocal.d.ts +16 -0
- package/dist/providers/codexLocal.d.ts.map +1 -0
- package/dist/providers/codexLocal.js +49 -0
- package/dist/providers/codexLocal.js.map +1 -0
- package/dist/providers/codexLogin.d.ts +16 -0
- package/dist/providers/codexLogin.d.ts.map +1 -0
- package/dist/providers/codexLogin.js +63 -0
- package/dist/providers/codexLogin.js.map +1 -0
- package/dist/providers/codexProtocol.d.ts +81 -0
- package/dist/providers/codexProtocol.d.ts.map +1 -0
- package/dist/providers/codexProtocol.js +33 -0
- package/dist/providers/codexProtocol.js.map +1 -0
- package/dist/providers/codexReportAttachments.d.ts +21 -0
- package/dist/providers/codexReportAttachments.d.ts.map +1 -0
- package/dist/providers/codexReportAttachments.js +17 -0
- package/dist/providers/codexReportAttachments.js.map +1 -0
- package/dist/providers/codexRpc.d.ts +24 -0
- package/dist/providers/codexRpc.d.ts.map +1 -0
- package/dist/providers/codexRpc.js +109 -0
- package/dist/providers/codexRpc.js.map +1 -0
- package/dist/providers/codexSettings.d.ts +20 -0
- package/dist/providers/codexSettings.d.ts.map +1 -0
- package/dist/providers/codexSettings.js +24 -0
- package/dist/providers/codexSettings.js.map +1 -0
- package/dist/providers/codexTurns.d.ts +72 -0
- package/dist/providers/codexTurns.d.ts.map +1 -0
- package/dist/providers/codexTurns.js +128 -0
- package/dist/providers/codexTurns.js.map +1 -0
- package/dist/providers/genericRejection.d.ts +3 -0
- package/dist/providers/genericRejection.d.ts.map +1 -0
- package/dist/providers/genericRejection.js +7 -0
- package/dist/providers/genericRejection.js.map +1 -0
- package/dist/providers/makeWaitUntilIdle.d.ts +4 -0
- package/dist/providers/makeWaitUntilIdle.d.ts.map +1 -0
- package/dist/providers/makeWaitUntilIdle.js +27 -0
- package/dist/providers/makeWaitUntilIdle.js.map +1 -0
- package/dist/providers/observeCodexTurn.d.ts +23 -0
- package/dist/providers/observeCodexTurn.d.ts.map +1 -0
- package/dist/providers/observeCodexTurn.js +39 -0
- package/dist/providers/observeCodexTurn.js.map +1 -0
- package/dist/providers/readActiveTurn.d.ts +6 -0
- package/dist/providers/readActiveTurn.d.ts.map +1 -0
- package/dist/providers/readActiveTurn.js +22 -0
- package/dist/providers/readActiveTurn.js.map +1 -0
- package/dist/providers/recoverTurn.d.ts +10 -0
- package/dist/providers/recoverTurn.d.ts.map +1 -0
- package/dist/providers/recoverTurn.js +54 -0
- package/dist/providers/recoverTurn.js.map +1 -0
- package/dist/providers/startCodexTurn.d.ts +9 -0
- package/dist/providers/startCodexTurn.d.ts.map +1 -0
- package/dist/providers/startCodexTurn.js +59 -0
- package/dist/providers/startCodexTurn.js.map +1 -0
- package/dist/qualifyDependencies.d.ts +484 -0
- package/dist/qualifyDependencies.d.ts.map +1 -0
- package/dist/qualifyDependencies.js +36 -0
- package/dist/qualifyDependencies.js.map +1 -0
- package/dist/reportAttachments.d.ts +16 -0
- package/dist/reportAttachments.d.ts.map +1 -0
- package/dist/reportAttachments.js +11 -0
- package/dist/reportAttachments.js.map +1 -0
- package/dist/reportFileDirectory.d.ts +10 -0
- package/dist/reportFileDirectory.d.ts.map +1 -0
- package/dist/reportFileDirectory.js +16 -0
- package/dist/reportFileDirectory.js.map +1 -0
- package/dist/reportFileFailure.d.ts +15 -0
- package/dist/reportFileFailure.d.ts.map +1 -0
- package/dist/reportFileFailure.js +23 -0
- package/dist/reportFileFailure.js.map +1 -0
- package/dist/reportLimits.d.ts +9 -0
- package/dist/reportLimits.d.ts.map +1 -0
- package/dist/reportLimits.js +17 -0
- package/dist/reportLimits.js.map +1 -0
- package/dist/scheduling/areas.d.ts +1447 -0
- package/dist/scheduling/areas.d.ts.map +1 -0
- package/dist/scheduling/areas.js +59 -0
- package/dist/scheduling/areas.js.map +1 -0
- package/dist/session/schema.d.ts +84 -0
- package/dist/session/schema.d.ts.map +1 -0
- package/dist/session/schema.js +55 -0
- package/dist/session/schema.js.map +1 -0
- package/dist/session/service.d.ts +105 -0
- package/dist/session/service.d.ts.map +1 -0
- package/dist/session/service.js +61 -0
- package/dist/session/service.js.map +1 -0
- package/dist/session/transientFailure.d.ts +5 -0
- package/dist/session/transientFailure.d.ts.map +1 -0
- package/dist/session/transientFailure.js +22 -0
- package/dist/session/transientFailure.js.map +1 -0
- package/dist/session/validateReceipt.d.ts +4 -0
- package/dist/session/validateReceipt.d.ts.map +1 -0
- package/dist/session/validateReceipt.js +8 -0
- package/dist/session/validateReceipt.js.map +1 -0
- package/dist/storage/FleetStoreOptions.d.ts +13 -0
- package/dist/storage/FleetStoreOptions.d.ts.map +1 -0
- package/dist/storage/FleetStoreOptions.js +2 -0
- package/dist/storage/FleetStoreOptions.js.map +1 -0
- package/dist/storage/admission.d.ts +18 -0
- package/dist/storage/admission.d.ts.map +1 -0
- package/dist/storage/admission.js +39 -0
- package/dist/storage/admission.js.map +1 -0
- package/dist/storage/admissionReads.d.ts +7 -0
- package/dist/storage/admissionReads.d.ts.map +1 -0
- package/dist/storage/admissionReads.js +12 -0
- package/dist/storage/admissionReads.js.map +1 -0
- package/dist/storage/backfillDecisionCodes.d.ts +4 -0
- package/dist/storage/backfillDecisionCodes.d.ts.map +1 -0
- package/dist/storage/backfillDecisionCodes.js +81 -0
- package/dist/storage/backfillDecisionCodes.js.map +1 -0
- package/dist/storage/errors.d.ts +31 -0
- package/dist/storage/errors.d.ts.map +1 -0
- package/dist/storage/errors.js +22 -0
- package/dist/storage/errors.js.map +1 -0
- package/dist/storage/fleetMigrations.d.ts +43 -0
- package/dist/storage/fleetMigrations.d.ts.map +1 -0
- package/dist/storage/fleetMigrations.js +58 -0
- package/dist/storage/fleetMigrations.js.map +1 -0
- package/dist/storage/makeFleetTransaction.d.ts +6 -0
- package/dist/storage/makeFleetTransaction.d.ts.map +1 -0
- package/dist/storage/makeFleetTransaction.js +12 -0
- package/dist/storage/makeFleetTransaction.js.map +1 -0
- package/dist/storage/makePostgresFleetStore.d.ts +46 -0
- package/dist/storage/makePostgresFleetStore.d.ts.map +1 -0
- package/dist/storage/makePostgresFleetStore.js +109 -0
- package/dist/storage/makePostgresFleetStore.js.map +1 -0
- package/dist/storage/migrateFleet.d.ts +3 -0
- package/dist/storage/migrateFleet.d.ts.map +1 -0
- package/dist/storage/migrateFleet.js +11 -0
- package/dist/storage/migrateFleet.js.map +1 -0
- package/dist/storage/model.d.ts +197 -0
- package/dist/storage/model.d.ts.map +1 -0
- package/dist/storage/model.js +91 -0
- package/dist/storage/model.js.map +1 -0
- package/dist/storage/modelTables.d.ts +37 -0
- package/dist/storage/modelTables.d.ts.map +1 -0
- package/dist/storage/modelTables.js +54 -0
- package/dist/storage/modelTables.js.map +1 -0
- package/dist/storage/nextAdmissionOrder.d.ts +4 -0
- package/dist/storage/nextAdmissionOrder.d.ts.map +1 -0
- package/dist/storage/nextAdmissionOrder.js +7 -0
- package/dist/storage/nextAdmissionOrder.js.map +1 -0
- package/dist/storage/operationEntries.d.ts +6 -0
- package/dist/storage/operationEntries.d.ts.map +1 -0
- package/dist/storage/operationEntries.js +17 -0
- package/dist/storage/operationEntries.js.map +1 -0
- package/dist/storage/pruneEmptyCycles.d.ts +4 -0
- package/dist/storage/pruneEmptyCycles.d.ts.map +1 -0
- package/dist/storage/pruneEmptyCycles.js +20 -0
- package/dist/storage/pruneEmptyCycles.js.map +1 -0
- package/dist/storage/recordTimes.d.ts +23 -0
- package/dist/storage/recordTimes.d.ts.map +1 -0
- package/dist/storage/recordTimes.js +24 -0
- package/dist/storage/recordTimes.js.map +1 -0
- package/dist/storage/recordValue.d.ts +7 -0
- package/dist/storage/recordValue.d.ts.map +1 -0
- package/dist/storage/recordValue.js +39 -0
- package/dist/storage/recordValue.js.map +1 -0
- package/package.json +78 -3
- package/src/DecisionCode.ts +50 -0
- package/src/admit.ts +39 -0
- package/src/attention.ts +24 -0
- package/src/board/acknowledgeDecision.ts +51 -0
- package/src/board/briefRevision.ts +17 -0
- package/src/board/completionFields.ts +65 -0
- package/src/board/completionMarkdown.ts +24 -0
- package/src/board/decisionAnswer.ts +12 -0
- package/src/board/decisionReading.ts +54 -0
- package/src/board/documents.ts +89 -0
- package/src/board/fleetField.ts +35 -0
- package/src/board/markdown.ts +103 -0
- package/src/board/publish.ts +99 -0
- package/src/board/publishReport.ts +43 -0
- package/src/board/readDocument.ts +33 -0
- package/src/board/readPass.ts +115 -0
- package/src/board/reportContent.ts +18 -0
- package/src/board/reportFiles.ts +93 -0
- package/src/board/reportIdentity.ts +10 -0
- package/src/board/reportLinks.ts +24 -0
- package/src/board/reportPayload.ts +73 -0
- package/src/board/reportPayloadFile.ts +93 -0
- package/src/board/schema.ts +48 -0
- package/src/board/statusMarkdown.ts +40 -0
- package/src/board/workRevision.ts +9 -0
- package/src/board/writeCompletion.ts +69 -0
- package/src/board/writeHealth.ts +30 -0
- package/src/board/writePublished.ts +72 -0
- package/src/board/writeStatus.ts +11 -0
- package/src/cli.ts +97 -0
- package/src/completion.ts +27 -0
- package/src/engine/ReportInspection.ts +10 -0
- package/src/engine/applyResolution.ts +117 -0
- package/src/engine/approveBrief.ts +97 -0
- package/src/engine/authorizeResolution.ts +23 -0
- package/src/engine/boardBrief.ts +84 -0
- package/src/engine/capacityRetry.ts +72 -0
- package/src/engine/closeDecisions.ts +92 -0
- package/src/engine/completeBoardWork.ts +33 -0
- package/src/engine/completeReport.ts +24 -0
- package/src/engine/continueCommand.ts +30 -0
- package/src/engine/continueWorker.ts +25 -0
- package/src/engine/continuedRecord.ts +24 -0
- package/src/engine/deliverPendingAnswers.ts +30 -0
- package/src/engine/deliveryFailure.ts +13 -0
- package/src/engine/dispatchCommand.ts +88 -0
- package/src/engine/ensureDecisionOwner.ts +16 -0
- package/src/engine/ensurePublication.ts +32 -0
- package/src/engine/exhaustedCheckRepairs.ts +11 -0
- package/src/engine/failureCode.ts +30 -0
- package/src/engine/failureContext.ts +22 -0
- package/src/engine/failureMessage.ts +19 -0
- package/src/engine/failureOwner.ts +10 -0
- package/src/engine/health.ts +31 -0
- package/src/engine/inspectRenewal.ts +64 -0
- package/src/engine/launchInput.ts +30 -0
- package/src/engine/launchObservationRetries.ts +5 -0
- package/src/engine/launchReceipt.ts +14 -0
- package/src/engine/launchRecord.ts +10 -0
- package/src/engine/localOnlyCriteria.ts +14 -0
- package/src/engine/makeAdopt.ts +57 -0
- package/src/engine/makeAdvance.ts +84 -0
- package/src/engine/makeDeliver.ts +114 -0
- package/src/engine/makeHuman.ts +46 -0
- package/src/engine/makeLaunch.ts +111 -0
- package/src/engine/makeObserve.ts +113 -0
- package/src/engine/makeReview.ts +104 -0
- package/src/engine/makeState.ts +89 -0
- package/src/engine/makeValidate.ts +43 -0
- package/src/engine/mergeReadiness.ts +44 -0
- package/src/engine/observeDeliveryFailure.ts +67 -0
- package/src/engine/observeRenewal.ts +36 -0
- package/src/engine/observedAttempt.ts +17 -0
- package/src/engine/obtainReview.ts +148 -0
- package/src/engine/operationRecord.ts +22 -0
- package/src/engine/originalWork.ts +16 -0
- package/src/engine/pendingAcknowledgements.ts +52 -0
- package/src/engine/persistTerminalReceipts.ts +16 -0
- package/src/engine/prepareCommand.ts +80 -0
- package/src/engine/queueAnswerCommand.ts +16 -0
- package/src/engine/readOrContinueReview.ts +77 -0
- package/src/engine/readResolution.ts +53 -0
- package/src/engine/readRetry.ts +104 -0
- package/src/engine/reassignCommand.ts +45 -0
- package/src/engine/reconcileAttempt.ts +29 -0
- package/src/engine/reconcileCommand.ts +74 -0
- package/src/engine/recoverStall.ts +83 -0
- package/src/engine/recoverUnobservable.ts +39 -0
- package/src/engine/refreshBrief.ts +59 -0
- package/src/engine/refreshReviewResult.ts +85 -0
- package/src/engine/releaseClosedPreparation.ts +31 -0
- package/src/engine/releaseExecution.ts +66 -0
- package/src/engine/releaseFinishedWork.ts +31 -0
- package/src/engine/releaseOnly.ts +24 -0
- package/src/engine/releaseReceipts.ts +25 -0
- package/src/engine/repository.ts +143 -0
- package/src/engine/requestConflictRepair.ts +40 -0
- package/src/engine/requestRework.ts +45 -0
- package/src/engine/reserveRenewal.ts +19 -0
- package/src/engine/resolveCommand.ts +42 -0
- package/src/engine/resolveExecution.ts +42 -0
- package/src/engine/restartableReview.ts +17 -0
- package/src/engine/resumeAttempt.ts +29 -0
- package/src/engine/retireUnacknowledged.ts +19 -0
- package/src/engine/retryPrompt.ts +14 -0
- package/src/engine/retryTerminal.ts +22 -0
- package/src/engine/scheduler.ts +87 -0
- package/src/engine/sessionCleanup.ts +51 -0
- package/src/engine/sessionStatus.ts +14 -0
- package/src/engine/settleMergedDelivery.ts +31 -0
- package/src/engine/submissionFailure.ts +47 -0
- package/src/engine/submitLaunch.ts +43 -0
- package/src/engine/threadNames.ts +56 -0
- package/src/engine/views.ts +42 -0
- package/src/engine/workerReport.ts +54 -0
- package/src/errors.ts +7 -0
- package/src/exposeFailure.ts +30 -0
- package/src/fleet.ts +50 -0
- package/src/fleetRecords.ts +4 -0
- package/src/host/actionCommands.ts +77 -0
- package/src/host/admission.ts +130 -0
- package/src/host/answerText.ts +11 -0
- package/src/host/answerWork.ts +104 -0
- package/src/host/applyReportPatch.ts +111 -0
- package/src/host/cliOptions.ts +15 -0
- package/src/host/commands.ts +63 -0
- package/src/host/config.ts +111 -0
- package/src/host/continuationMessage.ts +19 -0
- package/src/host/daemon.ts +45 -0
- package/src/host/daemonClient.ts +36 -0
- package/src/host/daemonContract.ts +64 -0
- package/src/host/daemonDiagnostics.ts +20 -0
- package/src/host/daemonHandlers.ts +33 -0
- package/src/host/daemonSnapshots.ts +24 -0
- package/src/host/defaults.ts +4 -0
- package/src/host/fleetItems.ts +33 -0
- package/src/host/follow.ts +44 -0
- package/src/host/followCommands.ts +54 -0
- package/src/host/followState.ts +41 -0
- package/src/host/github.ts +32 -0
- package/src/host/githubCheckState.ts +95 -0
- package/src/host/githubChecks.ts +53 -0
- package/src/host/githubDelivery.ts +65 -0
- package/src/host/githubRead.ts +20 -0
- package/src/host/githubRequiredChecks.ts +19 -0
- package/src/host/githubResult.ts +76 -0
- package/src/host/guidance.ts +28 -0
- package/src/host/healthLayer.ts +19 -0
- package/src/host/localOnlyBoardPath.ts +23 -0
- package/src/host/mainSource.ts +97 -0
- package/src/host/nameThreads.ts +61 -0
- package/src/host/providerHealth.ts +57 -0
- package/src/host/providers.ts +34 -0
- package/src/host/quota.ts +46 -0
- package/src/host/readCommand.ts +25 -0
- package/src/host/readWaitStates.ts +39 -0
- package/src/host/reassignWork.ts +17 -0
- package/src/host/recordDecisionResponse.ts +44 -0
- package/src/host/recordPayloads.ts +16 -0
- package/src/host/releaseWork.ts +56 -0
- package/src/host/renderStatus.ts +33 -0
- package/src/host/reportAttachmentFiles.ts +91 -0
- package/src/host/reportBoard.ts +143 -0
- package/src/host/reportFileChanges.ts +32 -0
- package/src/host/reportFileReplay.ts +118 -0
- package/src/host/reportPublication.ts +36 -0
- package/src/host/resultReport.ts +32 -0
- package/src/host/runtime.ts +129 -0
- package/src/host/snapshotStream.ts +21 -0
- package/src/host/status.ts +16 -0
- package/src/host/statusLayer.ts +101 -0
- package/src/host/wait.ts +38 -0
- package/src/host/waitOutcome.ts +47 -0
- package/src/host/watch.ts +68 -0
- package/src/model.ts +123 -0
- package/src/operations.ts +76 -0
- package/src/packageInfo.ts +3 -0
- package/src/policy.ts +131 -0
- package/src/policyGuidance.ts +6 -0
- package/src/preparation/compatibility.ts +49 -0
- package/src/preparation/schema.ts +55 -0
- package/src/prompt/reviewer.ts +64 -0
- package/src/prompt/worker.ts +132 -0
- package/src/providers/capacity.ts +8 -0
- package/src/providers/codexAdapter.ts +73 -0
- package/src/providers/codexCloud.ts +112 -0
- package/src/providers/codexCloudConnection.ts +49 -0
- package/src/providers/codexLocal.ts +67 -0
- package/src/providers/codexLogin.ts +87 -0
- package/src/providers/codexProtocol.ts +33 -0
- package/src/providers/codexReportAttachments.ts +23 -0
- package/src/providers/codexRpc.ts +140 -0
- package/src/providers/codexSettings.ts +31 -0
- package/src/providers/codexTurns.ts +133 -0
- package/src/providers/genericRejection.ts +12 -0
- package/src/providers/makeWaitUntilIdle.ts +30 -0
- package/src/providers/observeCodexTurn.ts +40 -0
- package/src/providers/readActiveTurn.ts +26 -0
- package/src/providers/recoverTurn.ts +69 -0
- package/src/providers/startCodexTurn.ts +78 -0
- package/src/qualifyDependencies.ts +54 -0
- package/src/reportAttachments.ts +26 -0
- package/src/reportFileDirectory.ts +33 -0
- package/src/reportFileFailure.ts +27 -0
- package/src/reportLimits.ts +19 -0
- package/src/scheduling/areas.ts +81 -0
- package/src/session/schema.ts +66 -0
- package/src/session/service.ts +103 -0
- package/src/session/transientFailure.ts +32 -0
- package/src/session/validateReceipt.ts +9 -0
- package/src/storage/FleetStoreOptions.ts +13 -0
- package/src/storage/admission.ts +82 -0
- package/src/storage/admissionReads.ts +16 -0
- package/src/storage/backfillDecisionCodes.ts +89 -0
- package/src/storage/errors.ts +23 -0
- package/src/storage/fleetMigrations.ts +60 -0
- package/src/storage/makeFleetTransaction.ts +16 -0
- package/src/storage/makePostgresFleetStore.ts +147 -0
- package/src/storage/migrateFleet.ts +11 -0
- package/src/storage/model.ts +115 -0
- package/src/storage/modelTables.ts +57 -0
- package/src/storage/nextAdmissionOrder.ts +8 -0
- package/src/storage/operationEntries.ts +24 -0
- package/src/storage/pruneEmptyCycles.ts +20 -0
- package/src/storage/recordTimes.ts +28 -0
- package/src/storage/recordValue.ts +42 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Effect, Exit, type FileSystem, Redacted, Scope, Semaphore } from "effect";
|
|
2
|
+
import type { ChildProcessSpawner } from "effect/process";
|
|
3
|
+
import { type CodexLogin, codexAccessToken } from "#providers/codexLogin.ts";
|
|
4
|
+
import { type CodexConnection, connect, failure, initialize, request } from "#providers/codexRpc.ts";
|
|
5
|
+
|
|
6
|
+
function cloudUrl(endpoint: string) {
|
|
7
|
+
return Effect.try({ catch: () => failure("unavailable", "Invalid Codex Cloud endpoint"), try: () => new URL(endpoint) }).pipe(
|
|
8
|
+
Effect.filterOrFail(
|
|
9
|
+
(url) => url.protocol === "wss:" || (url.protocol === "ws:" && ["127.0.0.1", "localhost", "[::1]"].includes(url.hostname)),
|
|
10
|
+
() => failure("unavailable", "Codex Cloud bearer authentication requires a wss endpoint"),
|
|
11
|
+
),
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
// Connections reopen with a fresh login; a dropped socket fails in-flight mutations as ambiguous.
|
|
15
|
+
export const codexCloudConnection = Effect.fn("CodexCloud.codexCloudConnection")(function* (endpoint: string, login: CodexLogin, timeoutMs: number) {
|
|
16
|
+
const url = yield* cloudUrl(endpoint);
|
|
17
|
+
const services = yield* Effect.context<FileSystem.FileSystem | ChildProcessSpawner.ChildProcessSpawner>();
|
|
18
|
+
const layerScope = yield* Effect.scope;
|
|
19
|
+
const lock = yield* Semaphore.make(1);
|
|
20
|
+
let current: { readonly connection: CodexConnection; readonly scope: Scope.Closeable } | undefined;
|
|
21
|
+
const open = Effect.gen(function* () {
|
|
22
|
+
if (current !== undefined) {
|
|
23
|
+
yield* Scope.close(current.scope, Exit.void);
|
|
24
|
+
current = undefined;
|
|
25
|
+
}
|
|
26
|
+
const token = yield* codexAccessToken(login, timeoutMs).pipe(Effect.provide(services));
|
|
27
|
+
const scope = yield* Scope.fork(layerScope);
|
|
28
|
+
const connection = yield* Effect.gen(function* () {
|
|
29
|
+
const opened = yield* connect(
|
|
30
|
+
{ protocols: ["codex-app-server", `codex-client.${crypto.randomUUID()}`, `openai-bearer.${Redacted.value(token)}`], url },
|
|
31
|
+
timeoutMs,
|
|
32
|
+
);
|
|
33
|
+
yield* initialize(opened, timeoutMs, true);
|
|
34
|
+
return opened;
|
|
35
|
+
}).pipe(
|
|
36
|
+
Scope.provide(scope),
|
|
37
|
+
Effect.onError(() => Scope.close(scope, Exit.void)),
|
|
38
|
+
);
|
|
39
|
+
current = { connection, scope };
|
|
40
|
+
return connection;
|
|
41
|
+
});
|
|
42
|
+
const connection = Semaphore.withPermits(
|
|
43
|
+
lock,
|
|
44
|
+
1,
|
|
45
|
+
)(Effect.suspend(() => (current !== undefined && !current.connection.closed.value ? Effect.succeed(current.connection) : open)));
|
|
46
|
+
return function rpc(method: string, params: unknown, mutation = false) {
|
|
47
|
+
return connection.pipe(Effect.flatMap((opened) => request(opened, timeoutMs, method, params, mutation)));
|
|
48
|
+
};
|
|
49
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
2
|
+
import { defineService } from "@shivaedev/effect-service/define-service.ts";
|
|
3
|
+
import { codexAdapter } from "#providers/codexAdapter.ts";
|
|
4
|
+
import { connect, failure, initialize, request } from "#providers/codexRpc.ts";
|
|
5
|
+
import { SessionTransport } from "#session/service.ts";
|
|
6
|
+
|
|
7
|
+
// The runtime owns execution; observer teardown only disconnects.
|
|
8
|
+
export const CodexLocalConfiguration = Schema.Struct({ endpoint: Schema.String, requestTimeoutMs: Schema.Finite.check(Schema.isGreaterThan(0)) });
|
|
9
|
+
export type CodexLocalConfiguration = typeof CodexLocalConfiguration.Type;
|
|
10
|
+
|
|
11
|
+
function loopback(endpoint: string) {
|
|
12
|
+
return Effect.try({
|
|
13
|
+
catch: () => failure("unavailable", "Invalid local Codex endpoint"),
|
|
14
|
+
try: () => new URL(endpoint),
|
|
15
|
+
}).pipe(
|
|
16
|
+
Effect.filterOrFail(
|
|
17
|
+
(url) => url.protocol === "ws:" && ["127.0.0.1", "localhost", "[::1]"].includes(url.hostname) && url.username === "" && url.password === "",
|
|
18
|
+
() => failure("unavailable", "Local Codex requires an explicitly configured loopback WebSocket endpoint"),
|
|
19
|
+
),
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export class CodexLocalConfig extends Context.Service<CodexLocalConfig, CodexLocalConfiguration>()("@shivaedev/work-fleet/CodexLocalConfig") {}
|
|
23
|
+
|
|
24
|
+
// The installed CLI schema verifies these local methods; it provides no hosted transport contract.
|
|
25
|
+
const CodexLocal = defineService({
|
|
26
|
+
id: "Fleet/CodexLocal",
|
|
27
|
+
initialize: Effect.gen(function* () {
|
|
28
|
+
const config = yield* Schema.decodeUnknownEffect(CodexLocalConfiguration)(yield* CodexLocalConfig).pipe(
|
|
29
|
+
Effect.mapError(() => failure("unavailable", "Local Codex configuration requires a finite positive request timeout")),
|
|
30
|
+
);
|
|
31
|
+
const url = yield* loopback(config.endpoint);
|
|
32
|
+
const connection = yield* connect({ url }, config.requestTimeoutMs);
|
|
33
|
+
yield* initialize(connection, config.requestTimeoutMs, false);
|
|
34
|
+
function rpc(method: string, params: unknown, mutation = false) {
|
|
35
|
+
return request(connection, config.requestTimeoutMs, method, params, mutation);
|
|
36
|
+
}
|
|
37
|
+
const resumed = new Set<string>();
|
|
38
|
+
return codexAdapter(rpc, {
|
|
39
|
+
beforeTurn: (input) =>
|
|
40
|
+
(resumed.has(input.sessionId)
|
|
41
|
+
? Effect.succeed({})
|
|
42
|
+
: rpc("thread/resume", { excludeTurns: true, threadId: input.sessionId }).pipe(
|
|
43
|
+
Effect.tap(() => Effect.sync(() => resumed.add(input.sessionId))),
|
|
44
|
+
Effect.as({}),
|
|
45
|
+
)
|
|
46
|
+
).pipe(
|
|
47
|
+
Effect.map((params) =>
|
|
48
|
+
input.access === "read-only" ? { ...params, approvalPolicy: "never", sandboxPolicy: { networkAccess: true, type: "readOnly" } } : params,
|
|
49
|
+
),
|
|
50
|
+
),
|
|
51
|
+
provisioning: "ready",
|
|
52
|
+
sessionStarted: (sessionId) => resumed.add(sessionId),
|
|
53
|
+
threadStart: (input) => ({
|
|
54
|
+
...(input.access === "read-only"
|
|
55
|
+
? { approvalPolicy: "never", config: { "sandbox_read_only.network_access": true }, sandbox: "read-only" }
|
|
56
|
+
: {}),
|
|
57
|
+
cwd: input.cwd,
|
|
58
|
+
ephemeral: false,
|
|
59
|
+
...(input.settings?.model === undefined ? {} : { model: input.settings.model }),
|
|
60
|
+
...(input.settings?.serviceTier === undefined ? {} : { serviceTier: input.settings.serviceTier }),
|
|
61
|
+
}),
|
|
62
|
+
});
|
|
63
|
+
}),
|
|
64
|
+
methods: (adapter) => adapter,
|
|
65
|
+
requires: [CodexLocalConfig],
|
|
66
|
+
});
|
|
67
|
+
export const codexLocalLayer = Layer.effect(SessionTransport)(CodexLocal).pipe(Layer.provide(CodexLocal.layer));
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { homedir } from "node:os";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { Clock, Config, Effect, FileSystem, Option, Redacted, Schema, Stream } from "effect";
|
|
4
|
+
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
5
|
+
import { NAME, TITLE, VERSION } from "#packageInfo.ts";
|
|
6
|
+
import { failure } from "#providers/codexRpc.ts";
|
|
7
|
+
|
|
8
|
+
export interface CodexLogin {
|
|
9
|
+
readonly authFile?: string | undefined;
|
|
10
|
+
readonly refreshCommand?: { readonly command: string; readonly args: readonly string[] } | undefined;
|
|
11
|
+
}
|
|
12
|
+
const AuthFile = Schema.Struct({
|
|
13
|
+
tokens: Schema.Struct({ accessToken: Schema.String, accountId: Schema.optional(Schema.NullOr(Schema.String)) }).pipe(
|
|
14
|
+
Schema.encodeKeys({ accessToken: "access_token", accountId: "account_id" }),
|
|
15
|
+
),
|
|
16
|
+
});
|
|
17
|
+
const Claims = Schema.Struct({ exp: Schema.Finite });
|
|
18
|
+
const RefreshReply = Schema.Struct({ error: Schema.optional(Schema.Unknown), id: Schema.Literal(2) });
|
|
19
|
+
// A token that expires within this window could lapse during the handshake.
|
|
20
|
+
const EXPIRY_SKEW_MS = 5 * 60 * 1000;
|
|
21
|
+
function unreadable() {
|
|
22
|
+
return failure("unavailable", "Codex login token is unreadable; sign in with the Codex CLI");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const authFilePath = Effect.fn("CodexLogin.authFilePath")(function* (login: CodexLogin) {
|
|
26
|
+
if (login.authFile !== undefined) {
|
|
27
|
+
return login.authFile;
|
|
28
|
+
}
|
|
29
|
+
const home = yield* Config.option(Config.String("CODEX_HOME")).pipe(Effect.orElseSucceed(() => Option.none<string>()));
|
|
30
|
+
return join(
|
|
31
|
+
Option.getOrElse(home, () => join(homedir(), ".codex")),
|
|
32
|
+
"auth.json",
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
const readToken = Effect.fn("CodexLogin.readToken")(function* (authFile: string) {
|
|
36
|
+
const fs = yield* FileSystem.FileSystem;
|
|
37
|
+
const content = yield* fs.readFileString(authFile).pipe(Effect.mapError(() => failure("unavailable", "Codex login file is unavailable")));
|
|
38
|
+
const auth = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(AuthFile))(content).pipe(
|
|
39
|
+
Effect.mapError(() => failure("unavailable", "Codex login file has no ChatGPT access token; sign in with the Codex CLI")),
|
|
40
|
+
);
|
|
41
|
+
const payload = yield* Effect.try({
|
|
42
|
+
catch: unreadable,
|
|
43
|
+
try: () => Buffer.from(auth.tokens.accessToken.split(".")[1] ?? "", "base64url").toString("utf8"),
|
|
44
|
+
});
|
|
45
|
+
const claims = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(Claims))(payload).pipe(Effect.mapError(unreadable));
|
|
46
|
+
return { accountId: auth.tokens.accountId ?? undefined, expiresAt: claims.exp * 1000, token: Redacted.make(auth.tokens.accessToken) };
|
|
47
|
+
});
|
|
48
|
+
// The Codex CLI owns the login file and its refresh-token rotation; Fleet only asks it to refresh.
|
|
49
|
+
const refreshLogin = Effect.fn("CodexLogin.refreshLogin")(function* (command: NonNullable<CodexLogin["refreshCommand"]>) {
|
|
50
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
51
|
+
const messages = [
|
|
52
|
+
{ id: 1, method: "initialize", params: { capabilities: null, clientInfo: { name: NAME, title: TITLE, version: VERSION } } },
|
|
53
|
+
{ method: "initialized" },
|
|
54
|
+
{ id: 2, method: "account/read", params: { refreshToken: true } },
|
|
55
|
+
];
|
|
56
|
+
const stdin = Stream.make(new TextEncoder().encode(messages.map((message) => `${JSON.stringify(message)}\n`).join(""))).pipe(
|
|
57
|
+
Stream.concat(Stream.never),
|
|
58
|
+
);
|
|
59
|
+
const reply = yield* spawner.streamLines(ChildProcess.make(command.command, [...command.args], { stdin })).pipe(
|
|
60
|
+
Stream.filterMap((line) => Schema.decodeUnknownResult(Schema.fromJsonString(RefreshReply))(line)),
|
|
61
|
+
Stream.runHead,
|
|
62
|
+
Effect.mapError(() => failure("unavailable", "Codex CLI could not refresh the login")),
|
|
63
|
+
);
|
|
64
|
+
if (Option.isNone(reply) || reply.value.error !== undefined) {
|
|
65
|
+
return yield* Effect.fail(failure("unavailable", "Codex CLI could not refresh the login; sign in with the Codex CLI"));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
export const codexCredentials = Effect.fn("CodexLogin.codexCredentials")(function* (login: CodexLogin, timeoutMs: number) {
|
|
69
|
+
const authFile = yield* authFilePath(login);
|
|
70
|
+
const current = yield* readToken(authFile);
|
|
71
|
+
if (current.expiresAt - EXPIRY_SKEW_MS > (yield* Clock.currentTimeMillis)) {
|
|
72
|
+
return current;
|
|
73
|
+
}
|
|
74
|
+
yield* refreshLogin(login.refreshCommand ?? { args: ["app-server", "--listen", "stdio://"], command: "codex" }).pipe(
|
|
75
|
+
Effect.timeout(`${timeoutMs} millis`),
|
|
76
|
+
Effect.catchTag("TimeoutError", () => Effect.fail(failure("unavailable", "Codex CLI login refresh timed out"))),
|
|
77
|
+
);
|
|
78
|
+
const refreshed = yield* readToken(authFile);
|
|
79
|
+
if (refreshed.expiresAt - EXPIRY_SKEW_MS <= (yield* Clock.currentTimeMillis)) {
|
|
80
|
+
return yield* Effect.fail(failure("unavailable", "Codex login is expired; sign in with the Codex CLI"));
|
|
81
|
+
}
|
|
82
|
+
return refreshed;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const codexAccessToken = Effect.fn("CodexLogin.codexAccessToken")((login: CodexLogin, timeoutMs: number) =>
|
|
86
|
+
codexCredentials(login, timeoutMs).pipe(Effect.map((credentials) => credentials.token)),
|
|
87
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
|
|
3
|
+
const Echo = Schema.optional(Schema.NullOr(Schema.String));
|
|
4
|
+
export const ThreadResponse = Schema.Struct({
|
|
5
|
+
model: Echo,
|
|
6
|
+
reasoningEffort: Echo,
|
|
7
|
+
serviceTier: Echo,
|
|
8
|
+
thread: Schema.Struct({ id: Schema.String }),
|
|
9
|
+
});
|
|
10
|
+
export const TurnResponse = Schema.Struct({ turn: Schema.Struct({ id: Schema.String }) });
|
|
11
|
+
export const Item = Schema.Struct({
|
|
12
|
+
changes: Schema.optional(Schema.Unknown),
|
|
13
|
+
clientId: Schema.optional(Schema.NullOr(Schema.String)),
|
|
14
|
+
id: Schema.String,
|
|
15
|
+
phase: Schema.optional(Schema.NullOr(Schema.String)),
|
|
16
|
+
status: Schema.optional(Schema.String),
|
|
17
|
+
text: Schema.optional(Schema.String),
|
|
18
|
+
type: Schema.String,
|
|
19
|
+
});
|
|
20
|
+
export const Turn = Schema.Struct({
|
|
21
|
+
error: Schema.optional(Schema.NullOr(Schema.Struct({ codexErrorInfo: Schema.optional(Schema.Unknown), message: Schema.String }))),
|
|
22
|
+
id: Schema.String,
|
|
23
|
+
items: Schema.Array(Item),
|
|
24
|
+
status: Schema.Literals(["inProgress", "completed", "interrupted", "failed"]),
|
|
25
|
+
});
|
|
26
|
+
export const TurnsResponse = Schema.Struct({ data: Schema.Array(Turn), nextCursor: Schema.NullOr(Schema.String) });
|
|
27
|
+
export const ItemsResponse = Schema.Struct({ data: Schema.Array(Schema.Struct({ item: Item })), nextCursor: Schema.NullOr(Schema.String) });
|
|
28
|
+
export const Envelope = Schema.Struct({
|
|
29
|
+
error: Schema.optional(Schema.Unknown),
|
|
30
|
+
id: Schema.optional(Schema.Union([Schema.String, Schema.Number])),
|
|
31
|
+
method: Schema.optional(Schema.String),
|
|
32
|
+
result: Schema.optional(Schema.Unknown),
|
|
33
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { reportFileChanges } from "#host/reportFileChanges.ts";
|
|
3
|
+
import { CODEX_CLOUD_ENDPOINT } from "#providers/codexCloud.ts";
|
|
4
|
+
import { codexCloudConnection } from "#providers/codexCloudConnection.ts";
|
|
5
|
+
import type { CodexLogin } from "#providers/codexLogin.ts";
|
|
6
|
+
import { type CodexRequest, codexTurns } from "#providers/codexTurns.ts";
|
|
7
|
+
import { REPORT_LIMITS } from "#reportLimits.ts";
|
|
8
|
+
import type { SessionObservation } from "#session/schema.ts";
|
|
9
|
+
|
|
10
|
+
export function makeCodexReportAttachments(rpc: CodexRequest) {
|
|
11
|
+
const { readItems } = codexTurns(rpc);
|
|
12
|
+
return (observation: SessionObservation) =>
|
|
13
|
+
readItems(observation.receipt, REPORT_LIMITS.downloadBytes).pipe(Effect.flatMap((items) => reportFileChanges(items, observation.output)));
|
|
14
|
+
}
|
|
15
|
+
export function codexReportAttachments(login: CodexLogin & { readonly endpoint?: string | undefined }, timeoutMs: number) {
|
|
16
|
+
return (observation: SessionObservation) =>
|
|
17
|
+
Effect.scoped(
|
|
18
|
+
Effect.gen(function* () {
|
|
19
|
+
const rpc = yield* codexCloudConnection(login.endpoint ?? CODEX_CLOUD_ENDPOINT, login, timeoutMs);
|
|
20
|
+
return yield* makeCodexReportAttachments(rpc)(observation);
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Effect, Schedule, Schema } from "effect";
|
|
2
|
+
import { NAME, TITLE, VERSION } from "#packageInfo.ts";
|
|
3
|
+
import { capacity } from "#providers/capacity.ts";
|
|
4
|
+
import { Envelope } from "#providers/codexProtocol.ts";
|
|
5
|
+
import { genericRejection } from "#providers/genericRejection.ts";
|
|
6
|
+
import { SessionFailure } from "#session/schema.ts";
|
|
7
|
+
|
|
8
|
+
type Resume = (result: Effect.Effect<unknown, SessionFailure>) => void;
|
|
9
|
+
const RpcError = Schema.Struct({ code: Schema.optional(Schema.Number), message: Schema.String });
|
|
10
|
+
function rejection(error: unknown) {
|
|
11
|
+
const decoded = Schema.decodeUnknownOption(RpcError)(error);
|
|
12
|
+
return new SessionFailure({
|
|
13
|
+
capacity: capacity(error),
|
|
14
|
+
code: decoded._tag === "Some" && decoded.value.code === -32_001 ? "session-queue-full" : "session-rejected",
|
|
15
|
+
message:
|
|
16
|
+
decoded._tag === "Some" ? `Codex rejected the protocol request: ${decoded.value.message.slice(0, 500)}` : "Codex rejected the protocol request",
|
|
17
|
+
reason: "rejected",
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export interface CodexConnection {
|
|
21
|
+
readonly closed: {
|
|
22
|
+
value: boolean;
|
|
23
|
+
};
|
|
24
|
+
readonly nextId: {
|
|
25
|
+
value: number;
|
|
26
|
+
};
|
|
27
|
+
readonly pending: Map<number, Resume>;
|
|
28
|
+
readonly socket: WebSocket;
|
|
29
|
+
}
|
|
30
|
+
export function failure(reason: SessionFailure["reason"], message: string) {
|
|
31
|
+
return new SessionFailure({ message, reason });
|
|
32
|
+
}
|
|
33
|
+
function failPending(connection: CodexConnection, error: SessionFailure) {
|
|
34
|
+
for (const pending of connection.pending.values()) {
|
|
35
|
+
pending(Effect.fail(error));
|
|
36
|
+
}
|
|
37
|
+
connection.pending.clear();
|
|
38
|
+
}
|
|
39
|
+
export interface CodexEndpoint {
|
|
40
|
+
readonly protocols?: readonly string[];
|
|
41
|
+
readonly url: URL;
|
|
42
|
+
}
|
|
43
|
+
function openSocket(endpoint: CodexEndpoint) {
|
|
44
|
+
return Effect.callback<CodexConnection, SessionFailure>((resume) => {
|
|
45
|
+
let socket: WebSocket;
|
|
46
|
+
try {
|
|
47
|
+
socket = new WebSocket(endpoint.url, endpoint.protocols === undefined ? undefined : [...endpoint.protocols]);
|
|
48
|
+
} catch {
|
|
49
|
+
resume(Effect.fail(failure("unavailable", "Invalid Codex endpoint")));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const connection: CodexConnection = { closed: { value: false }, nextId: { value: 0 }, pending: new Map(), socket };
|
|
53
|
+
function disconnected() {
|
|
54
|
+
connection.closed.value = true;
|
|
55
|
+
for (const pending of connection.pending.values()) {
|
|
56
|
+
pending(
|
|
57
|
+
Effect.fail(
|
|
58
|
+
new SessionFailure({
|
|
59
|
+
code: "session-unavailable",
|
|
60
|
+
message: "Codex disconnected; reconcile persisted submission before retrying",
|
|
61
|
+
reason: "ambiguous",
|
|
62
|
+
}),
|
|
63
|
+
),
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
connection.pending.clear();
|
|
67
|
+
}
|
|
68
|
+
socket.addEventListener("close", disconnected);
|
|
69
|
+
socket.addEventListener("error", () => {
|
|
70
|
+
disconnected();
|
|
71
|
+
resume(Effect.fail(failure("unavailable", "Could not connect to the configured Codex endpoint")));
|
|
72
|
+
});
|
|
73
|
+
socket.addEventListener("open", () => resume(Effect.succeed(connection)), { once: true });
|
|
74
|
+
socket.addEventListener("message", (event) => {
|
|
75
|
+
try {
|
|
76
|
+
const envelope = Schema.decodeUnknownSync(Envelope)(JSON.parse(String(event.data)));
|
|
77
|
+
if (envelope.method !== undefined && envelope.id !== undefined) {
|
|
78
|
+
// A provider request cannot grant itself execution or delivery authority.
|
|
79
|
+
socket.send(JSON.stringify({ error: { code: -32_601, message: "Fleet transport has no approval handler" }, id: envelope.id }));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (typeof envelope.id !== "number") {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const pending = connection.pending.get(envelope.id);
|
|
86
|
+
connection.pending.delete(envelope.id);
|
|
87
|
+
pending?.(envelope.error === undefined ? Effect.succeed(envelope.result) : Effect.fail(rejection(envelope.error)));
|
|
88
|
+
} catch {
|
|
89
|
+
failPending(connection, failure("protocol", "Codex returned an invalid protocol envelope"));
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return Effect.sync(() => socket.close());
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
export function connect(endpoint: CodexEndpoint, timeoutMs: number) {
|
|
96
|
+
return Effect.acquireRelease(
|
|
97
|
+
openSocket(endpoint).pipe(
|
|
98
|
+
Effect.timeout(`${timeoutMs} millis`),
|
|
99
|
+
Effect.catchTag("TimeoutError", () => Effect.fail(failure("unavailable", "Codex connection timed out"))),
|
|
100
|
+
),
|
|
101
|
+
(connection) => Effect.sync(() => connection.socket.close()),
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
export function initialize(connection: CodexConnection, timeoutMs: number, experimentalApi: boolean) {
|
|
105
|
+
return request(connection, timeoutMs, "initialize", {
|
|
106
|
+
capabilities: experimentalApi ? { experimentalApi } : null,
|
|
107
|
+
clientInfo: { name: NAME, title: TITLE, version: VERSION },
|
|
108
|
+
}).pipe(Effect.andThen(Effect.sync(() => connection.socket.send(JSON.stringify({ method: "initialized" })))));
|
|
109
|
+
}
|
|
110
|
+
export function request(connection: CodexConnection, timeoutMs: number, method: string, params: unknown, mutation = false) {
|
|
111
|
+
return Effect.callback<unknown, SessionFailure>((resume) => {
|
|
112
|
+
if (connection.closed.value) {
|
|
113
|
+
resume(Effect.fail(failure("unavailable", "Codex connection is closed")));
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
connection.nextId.value += 1;
|
|
117
|
+
const id = connection.nextId.value;
|
|
118
|
+
connection.pending.set(id, resume);
|
|
119
|
+
try {
|
|
120
|
+
connection.socket.send(JSON.stringify({ id, method, params }));
|
|
121
|
+
} catch {
|
|
122
|
+
connection.pending.delete(id);
|
|
123
|
+
resume(Effect.fail(failure(mutation ? "ambiguous" : "unavailable", "Codex write failed")));
|
|
124
|
+
}
|
|
125
|
+
return Effect.sync(() => {
|
|
126
|
+
connection.pending.delete(id);
|
|
127
|
+
});
|
|
128
|
+
}).pipe(
|
|
129
|
+
Effect.timeout(`${timeoutMs} millis`),
|
|
130
|
+
Effect.catchTag("TimeoutError", () =>
|
|
131
|
+
Effect.fail(failure(mutation ? "ambiguous" : "unavailable", "Codex request timed out; preserve submission ownership")),
|
|
132
|
+
),
|
|
133
|
+
Effect.retry({ schedule: Schedule.exponential("30 seconds"), times: 2, while: genericRejection }),
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
export function decode<A, TEncoded>(schema: Schema.Codec<A, TEncoded>, value: unknown) {
|
|
137
|
+
return Schema.decodeUnknownEffect(schema)(value).pipe(
|
|
138
|
+
Effect.mapError(() => failure("protocol", "Codex returned an incompatible protocol response")),
|
|
139
|
+
);
|
|
140
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { ThreadResponse } from "#providers/codexProtocol.ts";
|
|
3
|
+
import { failure } from "#providers/codexRpc.ts";
|
|
4
|
+
import type { LaunchSettings } from "#session/schema.ts";
|
|
5
|
+
|
|
6
|
+
export function settingsParams(settings: LaunchSettings | undefined) {
|
|
7
|
+
return {
|
|
8
|
+
...(settings?.model === undefined ? {} : { model: settings.model }),
|
|
9
|
+
...(settings?.effort === undefined ? {} : { effort: settings.effort }),
|
|
10
|
+
...(settings?.serviceTier === undefined ? {} : { serviceTier: settings.serviceTier }),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
// A provider that normalizes or ignores a requested setting must not run work with its own default.
|
|
14
|
+
export const echoedSettings = Effect.fn("Codex.echoedSettings")(function* (
|
|
15
|
+
requested: LaunchSettings | undefined,
|
|
16
|
+
response: typeof ThreadResponse.Type,
|
|
17
|
+
) {
|
|
18
|
+
const pairs = [
|
|
19
|
+
["model", requested?.model, response.model],
|
|
20
|
+
["reasoning effort", requested?.effort, response.reasoningEffort],
|
|
21
|
+
["service tier", requested?.serviceTier, response.serviceTier],
|
|
22
|
+
] as const;
|
|
23
|
+
for (const [name, wanted, actual] of pairs) {
|
|
24
|
+
if (wanted !== undefined && actual !== undefined && actual !== wanted) {
|
|
25
|
+
return yield* Effect.fail(failure("rejected", `Codex started the thread with ${name} ${actual ?? "unset"} instead of ${wanted}`));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
yield* Effect.logInfo("Codex thread started").pipe(
|
|
29
|
+
Effect.annotateLogs({ model: response.model, reasoningEffort: response.reasoningEffort, serviceTier: response.serviceTier }),
|
|
30
|
+
);
|
|
31
|
+
});
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { type Item, ItemsResponse, type Turn, TurnsResponse } from "#providers/codexProtocol.ts";
|
|
3
|
+
import { decode, failure } from "#providers/codexRpc.ts";
|
|
4
|
+
import { makeWaitUntilIdle } from "#providers/makeWaitUntilIdle.ts";
|
|
5
|
+
import { readActiveTurn } from "#providers/readActiveTurn.ts";
|
|
6
|
+
import { reportLimit } from "#reportLimits.ts";
|
|
7
|
+
import { SessionFailure, type SessionReceipt } from "#session/schema.ts";
|
|
8
|
+
|
|
9
|
+
export type CodexRequest = (method: string, params: unknown, mutation?: boolean) => Effect.Effect<unknown, SessionFailure>;
|
|
10
|
+
function finalOutput(items: readonly (typeof Item.Type)[]) {
|
|
11
|
+
const messages = items.filter((item) => item.type === "agentMessage" && item.text !== undefined);
|
|
12
|
+
const final = messages.filter((item) => item.phase === "final_answer");
|
|
13
|
+
return (final.length > 0 ? final : messages).map((item) => item.text).join("\n");
|
|
14
|
+
}
|
|
15
|
+
function rememberCursor(cursors: Set<string>, cursor: string | null, message = "Codex repeated an item pagination cursor") {
|
|
16
|
+
if (cursor === null) {
|
|
17
|
+
return Effect.void;
|
|
18
|
+
}
|
|
19
|
+
if (cursors.has(cursor)) {
|
|
20
|
+
return Effect.fail(failure("protocol", message));
|
|
21
|
+
}
|
|
22
|
+
cursors.add(cursor);
|
|
23
|
+
return Effect.void;
|
|
24
|
+
}
|
|
25
|
+
export function codexTurns(rpc: CodexRequest) {
|
|
26
|
+
function turns(sessionId: string, cursor: string | null, full: boolean) {
|
|
27
|
+
return rpc("thread/turns/list", {
|
|
28
|
+
cursor,
|
|
29
|
+
itemsView: full ? "full" : "notLoaded",
|
|
30
|
+
limit: 100,
|
|
31
|
+
sortDirection: "desc",
|
|
32
|
+
threadId: sessionId,
|
|
33
|
+
}).pipe(Effect.flatMap((value) => decode(TurnsResponse, value)));
|
|
34
|
+
}
|
|
35
|
+
const readTurn = Effect.fn("Codex.readTurn")(function* (sessionId: string, turnId: string, full = false) {
|
|
36
|
+
let cursor: string | null = null;
|
|
37
|
+
const cursors = new Set<string>();
|
|
38
|
+
const progress: { id: string; status?: string | undefined }[] = [];
|
|
39
|
+
do {
|
|
40
|
+
const page: typeof TurnsResponse.Type = yield* turns(sessionId, cursor, full);
|
|
41
|
+
const found = page.data.find((turn) => turn.id === turnId);
|
|
42
|
+
if (found !== undefined) {
|
|
43
|
+
return { progress, turn: found };
|
|
44
|
+
}
|
|
45
|
+
for (const turn of page.data.filter((entry) => entry.status === "inProgress")) {
|
|
46
|
+
progress.push({ id: turn.id, status: turn.status });
|
|
47
|
+
progress.push(...turn.items.map(({ id, status }) => ({ id: `${turn.id}/${id}`, status })));
|
|
48
|
+
}
|
|
49
|
+
cursor = page.nextCursor;
|
|
50
|
+
yield* rememberCursor(cursors, cursor, "Codex repeated a turn pagination cursor");
|
|
51
|
+
} while (cursor !== null);
|
|
52
|
+
return { progress, turn: undefined };
|
|
53
|
+
});
|
|
54
|
+
const findTurn = Effect.fn("Codex.findTurn")(function* (sessionId: string, turnId: string, full = false) {
|
|
55
|
+
const { turn } = yield* readTurn(sessionId, turnId, full);
|
|
56
|
+
return (
|
|
57
|
+
turn
|
|
58
|
+
?? (yield* new SessionFailure({
|
|
59
|
+
code: "session-turn-missing",
|
|
60
|
+
message: "The acknowledged Codex turn is not observable",
|
|
61
|
+
reason: "ambiguous",
|
|
62
|
+
}))
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
const waitUntilIdle = makeWaitUntilIdle((sessionId, cursor) => turns(sessionId, cursor, false));
|
|
66
|
+
const operationTurn = Effect.fn("Codex.operationTurn")(function* (sessionId: string, operationId: string) {
|
|
67
|
+
let cursor: string | null = null;
|
|
68
|
+
const matching: (typeof Turn.Type)[] = [];
|
|
69
|
+
const cursors = new Set<string>();
|
|
70
|
+
let empty = true;
|
|
71
|
+
let idle = true;
|
|
72
|
+
do {
|
|
73
|
+
const page: typeof TurnsResponse.Type = yield* turns(sessionId, cursor, true);
|
|
74
|
+
empty = empty && page.data.length === 0;
|
|
75
|
+
idle = idle && page.data.every((turn) => turn.status === "completed" || turn.status === "failed" || turn.status === "interrupted");
|
|
76
|
+
matching.push(...page.data.filter((turn) => turn.items.some((item) => item.type === "userMessage" && item.clientId === operationId)));
|
|
77
|
+
cursor = page.nextCursor;
|
|
78
|
+
yield* rememberCursor(cursors, cursor, "Codex repeated a turn pagination cursor");
|
|
79
|
+
} while (cursor !== null);
|
|
80
|
+
if (matching.length > 1) {
|
|
81
|
+
return yield* Effect.fail(
|
|
82
|
+
new SessionFailure({
|
|
83
|
+
code: "duplicate-turns",
|
|
84
|
+
message: "Multiple Codex turns match one operation; retain reservation",
|
|
85
|
+
reason: "ambiguous",
|
|
86
|
+
...(matching.every((turn) => turn.status !== "inProgress")
|
|
87
|
+
? { terminalReceipts: matching.map((turn) => ({ sessionId, turnId: turn.id })) }
|
|
88
|
+
: {}),
|
|
89
|
+
}),
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
const turnId = matching[0]?.id;
|
|
93
|
+
return { empty, idle, turnId };
|
|
94
|
+
});
|
|
95
|
+
const readItems = Effect.fn("Codex.readItems")(function* (receipt: SessionReceipt, byteLimit?: number) {
|
|
96
|
+
let cursor: string | null = null;
|
|
97
|
+
const items: (typeof Item.Type)[] = [];
|
|
98
|
+
const cursors = new Set<string>();
|
|
99
|
+
let bytes = 0;
|
|
100
|
+
do {
|
|
101
|
+
const response: unknown = yield* rpc("thread/items/list", {
|
|
102
|
+
cursor,
|
|
103
|
+
limit: 100,
|
|
104
|
+
sortDirection: "asc",
|
|
105
|
+
threadId: receipt.sessionId,
|
|
106
|
+
turnId: receipt.turnId,
|
|
107
|
+
});
|
|
108
|
+
bytes += Buffer.byteLength(JSON.stringify(response) ?? "null", "utf8");
|
|
109
|
+
if (byteLimit !== undefined && bytes > byteLimit) {
|
|
110
|
+
return yield* Effect.fail(failure("protocol", reportLimit("downloadBytes").message));
|
|
111
|
+
}
|
|
112
|
+
const page: typeof ItemsResponse.Type = yield* decode(ItemsResponse, response);
|
|
113
|
+
for (const { item } of page.data) {
|
|
114
|
+
items.push(item);
|
|
115
|
+
}
|
|
116
|
+
cursor = page.nextCursor;
|
|
117
|
+
yield* rememberCursor(cursors, cursor);
|
|
118
|
+
} while (cursor !== null);
|
|
119
|
+
return items;
|
|
120
|
+
});
|
|
121
|
+
function readOutput(receipt: SessionReceipt) {
|
|
122
|
+
return readItems(receipt).pipe(Effect.map(finalOutput));
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
findTurn,
|
|
126
|
+
hasActiveTurn: readActiveTurn((sessionId, cursor) => turns(sessionId, cursor, false)),
|
|
127
|
+
operationTurn,
|
|
128
|
+
readItems,
|
|
129
|
+
readOutput,
|
|
130
|
+
readTurn,
|
|
131
|
+
waitUntilIdle,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SessionFailure } from "#session/schema.ts";
|
|
2
|
+
|
|
3
|
+
export function genericRejection(error: SessionFailure) {
|
|
4
|
+
return (
|
|
5
|
+
error.reason === "rejected"
|
|
6
|
+
&& error.code === "session-rejected"
|
|
7
|
+
&& error.capacity === undefined
|
|
8
|
+
&& /^Codex rejected the protocol request(?::\s*(?:(?:Something went wrong|Internal (?:server )?error)\.?)?(?:\s+Request ID:\s*\S+)?)?$/iu.test(
|
|
9
|
+
error.message,
|
|
10
|
+
)
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Clock, Effect } from "effect";
|
|
2
|
+
import { type ReadTurnPage, readActiveTurn } from "#providers/readActiveTurn.ts";
|
|
3
|
+
|
|
4
|
+
export function makeWaitUntilIdle(readPage: ReadTurnPage) {
|
|
5
|
+
const hasActiveTurn = readActiveTurn(readPage);
|
|
6
|
+
const poll = Effect.fn("Codex.poll")(function* (sessionId: string, deadline: number) {
|
|
7
|
+
let delay = 2000;
|
|
8
|
+
while ((yield* Clock.currentTimeMillis) < deadline) {
|
|
9
|
+
if (!(yield* hasActiveTurn(sessionId))) {
|
|
10
|
+
return (yield* Clock.currentTimeMillis) < deadline;
|
|
11
|
+
}
|
|
12
|
+
const remaining = deadline - (yield* Clock.currentTimeMillis);
|
|
13
|
+
if (remaining <= 0) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
yield* Effect.sleep(Math.min(delay, remaining));
|
|
17
|
+
delay = Math.min(30_000, delay * 2);
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
});
|
|
21
|
+
return Effect.fn("Codex.waitUntilIdle")(function* (sessionId: string, deadline: number) {
|
|
22
|
+
const remaining = deadline - (yield* Clock.currentTimeMillis);
|
|
23
|
+
return remaining <= 0
|
|
24
|
+
? false
|
|
25
|
+
: yield* poll(sessionId, deadline).pipe(
|
|
26
|
+
Effect.timeout(`${remaining} millis`),
|
|
27
|
+
Effect.catchTag("TimeoutError", () => Effect.succeed(false)),
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import type { codexTurns } from "#providers/codexTurns.ts";
|
|
3
|
+
import { ProviderCapacity, type SessionObservation, type SessionReceipt } from "#session/schema.ts";
|
|
4
|
+
|
|
5
|
+
export function observeCodexTurn(turns: ReturnType<typeof codexTurns>, provisioning: SessionObservation["provisioning"]) {
|
|
6
|
+
const terminal = new Map<string, SessionObservation>();
|
|
7
|
+
return Effect.fn("Codex.observe")(function* (receipt: SessionReceipt) {
|
|
8
|
+
const key = `${receipt.sessionId}/${receipt.turnId}`;
|
|
9
|
+
const cached = terminal.get(key);
|
|
10
|
+
if (cached !== undefined) {
|
|
11
|
+
return cached;
|
|
12
|
+
}
|
|
13
|
+
const { turn, progress } = yield* turns.readTurn(receipt.sessionId, receipt.turnId, true);
|
|
14
|
+
if (turn === undefined) {
|
|
15
|
+
return {
|
|
16
|
+
execution: "accepted" as const,
|
|
17
|
+
output: "",
|
|
18
|
+
progress: progress.sort((left, right) => left.id.localeCompare(right.id)),
|
|
19
|
+
provisioning,
|
|
20
|
+
receipt,
|
|
21
|
+
turnMissing: true,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const output = turn.status === "inProgress" ? "" : yield* turns.readOutput(receipt);
|
|
25
|
+
const capacity = Schema.decodeUnknownOption(ProviderCapacity)(turn.error?.codexErrorInfo);
|
|
26
|
+
const observation: SessionObservation = {
|
|
27
|
+
capacity: capacity._tag === "Some" && turn.status === "failed" ? capacity.value : undefined,
|
|
28
|
+
error: turn.error?.message,
|
|
29
|
+
execution: turn.status === "inProgress" ? "running" : turn.status,
|
|
30
|
+
output,
|
|
31
|
+
progress: turn.items.map(({ id, status }) => ({ id, status })).sort((left, right) => left.id.localeCompare(right.id)),
|
|
32
|
+
provisioning,
|
|
33
|
+
receipt,
|
|
34
|
+
};
|
|
35
|
+
if (observation.execution !== "running") {
|
|
36
|
+
terminal.set(key, observation);
|
|
37
|
+
}
|
|
38
|
+
return observation;
|
|
39
|
+
});
|
|
40
|
+
}
|