cloving 0.3.20 → 1.1.0
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/{LICENSE.md → LICENSE} +1 -1
- package/README.md +606 -182
- package/dist/src/authority/budgets.d.ts +12 -0
- package/dist/src/authority/budgets.js +42 -0
- package/dist/src/authority/commands.d.ts +7 -0
- package/dist/src/authority/commands.js +271 -0
- package/dist/src/authority/details.d.ts +28 -0
- package/dist/src/authority/details.js +33 -0
- package/dist/src/authority/dispatch-decision.d.ts +40 -0
- package/dist/src/authority/dispatch-decision.js +47 -0
- package/dist/src/authority/effect-requests.d.ts +2 -0
- package/dist/src/authority/effect-requests.js +139 -0
- package/dist/src/authority/effect-results.d.ts +4 -0
- package/dist/src/authority/effect-results.js +236 -0
- package/dist/src/authority/events.d.ts +2 -0
- package/dist/src/authority/events.js +45 -0
- package/dist/src/authority/gate-reduction.d.ts +8 -0
- package/dist/src/authority/gate-reduction.js +109 -0
- package/dist/src/authority/gates.d.ts +48 -0
- package/dist/src/authority/gates.js +77 -0
- package/dist/src/authority/history-state.d.ts +15 -0
- package/dist/src/authority/history-state.js +61 -0
- package/dist/src/authority/history.d.ts +13 -0
- package/dist/src/authority/history.js +37 -0
- package/dist/src/authority/instants.d.ts +3 -0
- package/dist/src/authority/instants.js +38 -0
- package/dist/src/authority/leases.d.ts +15 -0
- package/dist/src/authority/leases.js +113 -0
- package/dist/src/authority/operations.d.ts +101 -0
- package/dist/src/authority/operations.js +75 -0
- package/dist/src/authority/reconciliation.d.ts +29 -0
- package/dist/src/authority/reconciliation.js +156 -0
- package/dist/src/authority/reducer.d.ts +41 -0
- package/dist/src/authority/reducer.js +139 -0
- package/dist/src/authority/reduction-state.d.ts +36 -0
- package/dist/src/authority/reduction-state.js +68 -0
- package/dist/src/authority/reduction.d.ts +6 -0
- package/dist/src/authority/reduction.js +160 -0
- package/dist/src/authority/status-closure.d.ts +4 -0
- package/dist/src/authority/status-closure.js +57 -0
- package/dist/src/authority/status-effects.d.ts +17 -0
- package/dist/src/authority/status-effects.js +43 -0
- package/dist/src/authority/status-input.d.ts +45 -0
- package/dist/src/authority/status-input.js +9 -0
- package/dist/src/authority/status.d.ts +32 -0
- package/dist/src/authority/status.js +256 -0
- package/dist/src/authority/stop-sequence.d.ts +37 -0
- package/dist/src/authority/stop-sequence.js +91 -0
- package/dist/src/authority/transitions.d.ts +63 -0
- package/dist/src/authority/transitions.js +124 -0
- package/dist/src/broker/actor/adapter-calls.d.ts +13 -0
- package/dist/src/broker/actor/adapter-calls.js +34 -0
- package/dist/src/broker/actor/adapter-outcomes.d.ts +28 -0
- package/dist/src/broker/actor/adapter-outcomes.js +80 -0
- package/dist/src/broker/actor/authority-actor.d.ts +25 -0
- package/dist/src/broker/actor/authority-actor.js +169 -0
- package/dist/src/broker/actor/authority-changes.d.ts +31 -0
- package/dist/src/broker/actor/authority-changes.js +46 -0
- package/dist/src/broker/actor/authority-connection.d.ts +15 -0
- package/dist/src/broker/actor/authority-connection.js +44 -0
- package/dist/src/broker/actor/authority-conversion.d.ts +10 -0
- package/dist/src/broker/actor/authority-conversion.js +72 -0
- package/dist/src/broker/actor/authority-delivery.d.ts +13 -0
- package/dist/src/broker/actor/authority-delivery.js +162 -0
- package/dist/src/broker/actor/authority-logger.d.ts +2 -0
- package/dist/src/broker/actor/authority-logger.js +19 -0
- package/dist/src/broker/actor/authority-policy.d.ts +9 -0
- package/dist/src/broker/actor/authority-policy.js +11 -0
- package/dist/src/broker/actor/authority-queries.d.ts +45 -0
- package/dist/src/broker/actor/authority-queries.js +85 -0
- package/dist/src/broker/actor/authority-receipts.d.ts +28 -0
- package/dist/src/broker/actor/authority-receipts.js +84 -0
- package/dist/src/broker/actor/authority-release.d.ts +13 -0
- package/dist/src/broker/actor/authority-release.js +69 -0
- package/dist/src/broker/actor/authority-runtime.d.ts +60 -0
- package/dist/src/broker/actor/authority-runtime.js +204 -0
- package/dist/src/broker/actor/authority-session.d.ts +67 -0
- package/dist/src/broker/actor/authority-session.js +251 -0
- package/dist/src/broker/actor/authority-settings.d.ts +33 -0
- package/dist/src/broker/actor/authority-settings.js +63 -0
- package/dist/src/broker/actor/authority-upgrades.d.ts +16 -0
- package/dist/src/broker/actor/authority-upgrades.js +12 -0
- package/dist/src/broker/actor/authority-watchdog.d.ts +14 -0
- package/dist/src/broker/actor/authority-watchdog.js +41 -0
- package/dist/src/broker/actor/authority.d.ts +14 -0
- package/dist/src/broker/actor/authority.js +115 -0
- package/dist/src/broker/actor/delivery-intents.d.ts +68 -0
- package/dist/src/broker/actor/delivery-intents.js +77 -0
- package/dist/src/broker/actor/delivery-plan.d.ts +2 -0
- package/dist/src/broker/actor/delivery-plan.js +109 -0
- package/dist/src/broker/actor/delivery-results.d.ts +11 -0
- package/dist/src/broker/actor/delivery-results.js +63 -0
- package/dist/src/broker/actor/effect-delivery.d.ts +19 -0
- package/dist/src/broker/actor/effect-delivery.js +118 -0
- package/dist/src/broker/actor/effect-plan.d.ts +41 -0
- package/dist/src/broker/actor/effect-plan.js +173 -0
- package/dist/src/broker/actor/effect-queries.d.ts +27 -0
- package/dist/src/broker/actor/effect-queries.js +80 -0
- package/dist/src/broker/actor/effect-turn.d.ts +25 -0
- package/dist/src/broker/actor/effect-turn.js +84 -0
- package/dist/src/broker/actor/pin-check.d.ts +6 -0
- package/dist/src/broker/actor/pin-check.js +12 -0
- package/dist/src/broker/actor/runtime-parts.d.ts +23 -0
- package/dist/src/broker/actor/runtime-parts.js +34 -0
- package/dist/src/broker/actor/stop-plan.d.ts +20 -0
- package/dist/src/broker/actor/stop-plan.js +46 -0
- package/dist/src/broker/actor/stop-turn.d.ts +17 -0
- package/dist/src/broker/actor/stop-turn.js +42 -0
- package/dist/src/broker/actor/turn-draft.d.ts +31 -0
- package/dist/src/broker/actor/turn-draft.js +138 -0
- package/dist/src/broker/actor/turn-plan.d.ts +17 -0
- package/dist/src/broker/actor/turn-plan.js +136 -0
- package/dist/src/broker/actor/turn-refusals.d.ts +8 -0
- package/dist/src/broker/actor/turn-refusals.js +35 -0
- package/dist/src/broker/actor/turn-staging.d.ts +78 -0
- package/dist/src/broker/actor/turn-staging.js +34 -0
- package/dist/src/broker/actor/turn-state.d.ts +34 -0
- package/dist/src/broker/actor/turn-state.js +208 -0
- package/dist/src/broker/authority-admission.d.ts +21 -0
- package/dist/src/broker/authority-admission.js +70 -0
- package/dist/src/broker/authority-restore.d.ts +30 -0
- package/dist/src/broker/authority-restore.js +165 -0
- package/dist/src/broker/decision-restore.d.ts +16 -0
- package/dist/src/broker/decision-restore.js +158 -0
- package/dist/src/broker/decision-upgrade.d.ts +3 -0
- package/dist/src/broker/decision-upgrade.js +12 -0
- package/dist/src/broker/effect-restore.d.ts +20 -0
- package/dist/src/broker/effect-restore.js +111 -0
- package/dist/src/broker/effect-upgrade.d.ts +3 -0
- package/dist/src/broker/effect-upgrade.js +9 -0
- package/dist/src/broker/operation-digest.d.ts +1 -0
- package/dist/src/broker/operation-digest.js +4 -0
- package/dist/src/broker/socket-address.d.ts +9 -0
- package/dist/src/broker/socket-address.js +14 -0
- package/dist/src/broker/workflow-pin.d.ts +2 -0
- package/dist/src/broker/workflow-pin.js +5 -0
- package/dist/src/chats/analysis-batches.d.ts +24 -0
- package/dist/src/chats/analysis-batches.js +83 -0
- package/dist/src/chats/analysis-contract.d.ts +80 -0
- package/dist/src/chats/analysis-contract.js +16 -0
- package/dist/src/chats/analysis-data.d.ts +3 -0
- package/dist/src/chats/analysis-data.js +85 -0
- package/dist/src/chats/analysis-input.d.ts +12 -0
- package/dist/src/chats/analysis-input.js +83 -0
- package/dist/src/chats/analysis-links.d.ts +2 -0
- package/dist/src/chats/analysis-links.js +25 -0
- package/dist/src/chats/analysis-prompt.d.ts +10 -0
- package/dist/src/chats/analysis-prompt.js +16 -0
- package/dist/src/chats/analysis-proposal.d.ts +2 -0
- package/dist/src/chats/analysis-proposal.js +32 -0
- package/dist/src/chats/analysis-provenance.d.ts +4 -0
- package/dist/src/chats/analysis-provenance.js +99 -0
- package/dist/src/chats/analysis-shape.d.ts +3 -0
- package/dist/src/chats/analysis-shape.js +228 -0
- package/dist/src/chats/analysis.d.ts +3 -0
- package/dist/src/chats/analysis.js +42 -0
- package/dist/src/chats/corpus-input.d.ts +5 -0
- package/dist/src/chats/corpus-input.js +288 -0
- package/dist/src/chats/destination.d.ts +4 -0
- package/dist/src/chats/destination.js +96 -0
- package/dist/src/chats/import.d.ts +15 -0
- package/dist/src/chats/import.js +243 -0
- package/dist/src/chats/input-file.d.ts +3 -0
- package/dist/src/chats/input-file.js +32 -0
- package/dist/src/chats/normalize.d.ts +29 -0
- package/dist/src/chats/normalize.js +155 -0
- package/dist/src/chats/previous-import.d.ts +5 -0
- package/dist/src/chats/previous-import.js +34 -0
- package/dist/src/chats/reader.d.ts +21 -0
- package/dist/src/chats/reader.js +118 -0
- package/dist/src/chats/redact-import.d.ts +14 -0
- package/dist/src/chats/redact-import.js +141 -0
- package/dist/src/chats/redaction.d.ts +41 -0
- package/dist/src/chats/redaction.js +161 -0
- package/dist/src/chats/revision-input.d.ts +3 -0
- package/dist/src/chats/revision-input.js +180 -0
- package/dist/src/chats/revision.d.ts +48 -0
- package/dist/src/chats/revision.js +94 -0
- package/dist/src/chats/selection.d.ts +25 -0
- package/dist/src/chats/selection.js +109 -0
- package/dist/src/chats/source.d.ts +23 -0
- package/dist/src/chats/source.js +135 -0
- package/dist/src/chats/structure.d.ts +57 -0
- package/dist/src/chats/structure.js +216 -0
- package/dist/src/cli/arguments.d.ts +31 -0
- package/dist/src/cli/arguments.js +235 -0
- package/dist/src/cli/client.d.ts +16 -0
- package/dist/src/cli/client.js +159 -0
- package/dist/src/cli/commands.d.ts +17 -0
- package/dist/src/cli/commands.js +271 -0
- package/dist/src/cli/main.d.ts +2 -0
- package/dist/src/cli/main.js +127 -0
- package/dist/src/cli/render.d.ts +10 -0
- package/dist/src/cli/render.js +254 -0
- package/dist/src/cli/runtime-arguments.d.ts +73 -0
- package/dist/src/cli/runtime-arguments.js +248 -0
- package/dist/src/cli/runtime-directory.d.ts +4 -0
- package/dist/src/cli/runtime-directory.js +25 -0
- package/dist/src/cli/toolchain.d.ts +3 -0
- package/dist/src/cli/toolchain.js +74 -0
- package/dist/src/cli/usage-render.d.ts +3 -0
- package/dist/src/cli/usage-render.js +28 -0
- package/dist/src/cli/usage.d.ts +5 -0
- package/dist/src/cli/usage.js +156 -0
- package/dist/src/cli/validate.d.ts +38 -0
- package/dist/src/cli/validate.js +116 -0
- package/dist/src/cli/watch-actions.d.ts +10 -0
- package/dist/src/cli/watch-actions.js +58 -0
- package/dist/src/cli/watch-board-view.d.ts +54 -0
- package/dist/src/cli/watch-board-view.js +201 -0
- package/dist/src/cli/watch-board.d.ts +15 -0
- package/dist/src/cli/watch-board.js +179 -0
- package/dist/src/cli/watch-card-client.d.ts +1 -0
- package/dist/src/cli/watch-card-client.js +44 -0
- package/dist/src/cli/watch-card-forms.d.ts +2 -0
- package/dist/src/cli/watch-card-forms.js +33 -0
- package/dist/src/cli/watch-card-reply.d.ts +5 -0
- package/dist/src/cli/watch-card-reply.js +34 -0
- package/dist/src/cli/watch-card-view.d.ts +40 -0
- package/dist/src/cli/watch-card-view.js +86 -0
- package/dist/src/cli/watch-client.d.ts +1 -0
- package/dist/src/cli/watch-client.js +118 -0
- package/dist/src/cli/watch-element.d.ts +11 -0
- package/dist/src/cli/watch-element.js +6 -0
- package/dist/src/cli/watch-model.d.ts +29 -0
- package/dist/src/cli/watch-model.js +278 -0
- package/dist/src/cli/watch-navigation.d.ts +9 -0
- package/dist/src/cli/watch-navigation.js +40 -0
- package/dist/src/cli/watch-page.d.ts +1 -0
- package/dist/src/cli/watch-page.js +258 -0
- package/dist/src/cli/watch-paths.d.ts +2 -0
- package/dist/src/cli/watch-paths.js +52 -0
- package/dist/src/cli/watch-phases.d.ts +7 -0
- package/dist/src/cli/watch-phases.js +148 -0
- package/dist/src/cli/watch-pr-board.d.ts +3 -0
- package/dist/src/cli/watch-pr-board.js +26 -0
- package/dist/src/cli/watch-pr-command.d.ts +15 -0
- package/dist/src/cli/watch-pr-command.js +37 -0
- package/dist/src/cli/watch-pr-identity.d.ts +20 -0
- package/dist/src/cli/watch-pr-identity.js +62 -0
- package/dist/src/cli/watch-pr-observer.d.ts +19 -0
- package/dist/src/cli/watch-pr-observer.js +108 -0
- package/dist/src/cli/watch-pr-settings.d.ts +8 -0
- package/dist/src/cli/watch-pr-settings.js +47 -0
- package/dist/src/cli/watch-reads.d.ts +28 -0
- package/dist/src/cli/watch-reads.js +248 -0
- package/dist/src/cli/watch-render.d.ts +153 -0
- package/dist/src/cli/watch-render.js +102 -0
- package/dist/src/cli/watch-run-input.d.ts +14 -0
- package/dist/src/cli/watch-run-input.js +49 -0
- package/dist/src/cli/watch-server.d.ts +13 -0
- package/dist/src/cli/watch-server.js +214 -0
- package/dist/src/cli/watch-start-view.d.ts +18 -0
- package/dist/src/cli/watch-start-view.js +77 -0
- package/dist/src/cli/watch-stream.d.ts +11 -0
- package/dist/src/cli/watch-stream.js +128 -0
- package/dist/src/cli/watch-turn.d.ts +30 -0
- package/dist/src/cli/watch-turn.js +135 -0
- package/dist/src/cli/watch-usage.d.ts +6 -0
- package/dist/src/cli/watch-usage.js +65 -0
- package/dist/src/cli/watch-view.d.ts +54 -0
- package/dist/src/cli/watch-view.js +267 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +104 -0
- package/dist/src/daemon/analysis-launch.d.ts +5 -0
- package/dist/src/daemon/analysis-launch.js +81 -0
- package/dist/src/daemon/analysis-token.d.ts +6 -0
- package/dist/src/daemon/analysis-token.js +88 -0
- package/dist/src/daemon/analysis-worker.d.ts +22 -0
- package/dist/src/daemon/analysis-worker.js +219 -0
- package/dist/src/daemon/chats-files.d.ts +15 -0
- package/dist/src/daemon/chats-files.js +113 -0
- package/dist/src/daemon/chats-worker.d.ts +12 -0
- package/dist/src/daemon/chats-worker.js +200 -0
- package/dist/src/daemon/claude-turn.d.ts +38 -0
- package/dist/src/daemon/claude-turn.js +216 -0
- package/dist/src/daemon/claude-worker.d.ts +29 -0
- package/dist/src/daemon/claude-worker.js +276 -0
- package/dist/src/daemon/codex-stream.d.ts +4 -0
- package/dist/src/daemon/codex-stream.js +129 -0
- package/dist/src/daemon/daemon.d.ts +49 -0
- package/dist/src/daemon/daemon.js +195 -0
- package/dist/src/daemon/delivery-router.d.ts +10 -0
- package/dist/src/daemon/delivery-router.js +34 -0
- package/dist/src/daemon/github-calls.d.ts +29 -0
- package/dist/src/daemon/github-calls.js +127 -0
- package/dist/src/daemon/github-issue-methods.d.ts +3 -0
- package/dist/src/daemon/github-issue-methods.js +99 -0
- package/dist/src/daemon/github-issue-privacy.d.ts +6 -0
- package/dist/src/daemon/github-issue-privacy.js +131 -0
- package/dist/src/daemon/github-merge.d.ts +18 -0
- package/dist/src/daemon/github-merge.js +259 -0
- package/dist/src/daemon/github-methods.d.ts +5 -0
- package/dist/src/daemon/github-methods.js +202 -0
- package/dist/src/daemon/github-operation.d.ts +38 -0
- package/dist/src/daemon/github-operation.js +57 -0
- package/dist/src/daemon/github-ticket-status.d.ts +3 -0
- package/dist/src/daemon/github-ticket-status.js +268 -0
- package/dist/src/daemon/github-worker.d.ts +17 -0
- package/dist/src/daemon/github-worker.js +281 -0
- package/dist/src/daemon/host-environment.d.ts +8 -0
- package/dist/src/daemon/host-environment.js +14 -0
- package/dist/src/daemon/issue-queue.d.ts +10 -0
- package/dist/src/daemon/issue-queue.js +254 -0
- package/dist/src/daemon/notify-message.d.ts +14 -0
- package/dist/src/daemon/notify-message.js +48 -0
- package/dist/src/daemon/notify.d.ts +12 -0
- package/dist/src/daemon/notify.js +161 -0
- package/dist/src/daemon/operation-journal.d.ts +43 -0
- package/dist/src/daemon/operation-journal.js +55 -0
- package/dist/src/daemon/retrying-turn.d.ts +9 -0
- package/dist/src/daemon/retrying-turn.js +185 -0
- package/dist/src/daemon/ticket-registration.d.ts +33 -0
- package/dist/src/daemon/ticket-registration.js +177 -0
- package/dist/src/daemon/ticket-source.d.ts +17 -0
- package/dist/src/daemon/ticket-source.js +36 -0
- package/dist/src/daemon/work-tree.d.ts +26 -0
- package/dist/src/daemon/work-tree.js +206 -0
- package/dist/src/effect-authorization.d.ts +21 -0
- package/dist/src/effect-authorization.js +14 -0
- package/dist/src/execution-pin.d.ts +4 -0
- package/dist/src/execution-pin.js +68 -0
- package/dist/src/host/start-delivery.d.ts +41 -0
- package/dist/src/host/start-delivery.js +68 -0
- package/dist/src/host/step-bridge-host.d.ts +79 -0
- package/dist/src/host/step-bridge-host.js +205 -0
- package/dist/src/host/step-claims.d.ts +31 -0
- package/dist/src/host/step-claims.js +85 -0
- package/dist/src/host/world-host.d.ts +21 -0
- package/dist/src/host/world-host.js +51 -0
- package/dist/src/host/world-reconciliation.d.ts +39 -0
- package/dist/src/host/world-reconciliation.js +81 -0
- package/dist/src/host/world-runs.d.ts +14 -0
- package/dist/src/host/world-runs.js +69 -0
- package/dist/src/operation-identity.d.ts +7 -0
- package/dist/src/operation-identity.js +59 -0
- package/dist/src/protocol.d.ts +35 -0
- package/dist/src/protocol.js +64 -0
- package/dist/src/resource-files.d.ts +1 -0
- package/dist/src/resource-files.js +29 -0
- package/dist/src/service/changes.d.ts +11 -0
- package/dist/src/service/changes.js +32 -0
- package/dist/src/service/decision-handler.d.ts +9 -0
- package/dist/src/service/decision-handler.js +233 -0
- package/dist/src/service/event-handler.d.ts +10 -0
- package/dist/src/service/event-handler.js +70 -0
- package/dist/src/service/expiry.d.ts +13 -0
- package/dist/src/service/expiry.js +53 -0
- package/dist/src/service/gateway.d.ts +21 -0
- package/dist/src/service/gateway.js +120 -0
- package/dist/src/service/registry.d.ts +40 -0
- package/dist/src/service/registry.js +13 -0
- package/dist/src/service/replies.d.ts +26 -0
- package/dist/src/service/replies.js +56 -0
- package/dist/src/service/run-handlers.d.ts +4 -0
- package/dist/src/service/run-handlers.js +263 -0
- package/dist/src/service/service.d.ts +58 -0
- package/dist/src/service/service.js +212 -0
- package/dist/src/service/submission-handler.d.ts +4 -0
- package/dist/src/service/submission-handler.js +206 -0
- package/dist/src/service/transport.d.ts +16 -0
- package/dist/src/service/transport.js +141 -0
- package/dist/src/service/worker-port.d.ts +85 -0
- package/dist/src/service/worker-port.js +126 -0
- package/dist/src/service/worker-totals.d.ts +3 -0
- package/dist/src/service/worker-totals.js +28 -0
- package/dist/src/step-bridge.d.ts +57 -0
- package/dist/src/step-bridge.js +4 -0
- package/dist/src/steps/decision-gate.d.ts +2 -0
- package/dist/src/steps/decision-gate.js +8 -0
- package/dist/src/steps/load-cycle.d.ts +10 -0
- package/dist/src/steps/load-cycle.js +11 -0
- package/dist/src/steps/protected-effect.d.ts +2 -0
- package/dist/src/steps/protected-effect.js +8 -0
- package/dist/src/storage/decision-rows.d.ts +54 -0
- package/dist/src/storage/decision-rows.js +72 -0
- package/dist/src/storage/decision-snapshots.d.ts +17 -0
- package/dist/src/storage/decision-snapshots.js +25 -0
- package/dist/src/storage/domain-changes.d.ts +48 -0
- package/dist/src/storage/domain-changes.js +213 -0
- package/dist/src/storage/domain-rows.d.ts +85 -0
- package/dist/src/storage/domain-rows.js +129 -0
- package/dist/src/storage/domain-schema.d.ts +32 -0
- package/dist/src/storage/domain-schema.js +193 -0
- package/dist/src/storage/effect-changes.d.ts +5 -0
- package/dist/src/storage/effect-changes.js +105 -0
- package/dist/src/storage/effect-rows.d.ts +67 -0
- package/dist/src/storage/effect-rows.js +74 -0
- package/dist/src/storage/effect-schema.d.ts +1 -0
- package/dist/src/storage/effect-schema.js +59 -0
- package/dist/src/storage/statements.d.ts +9 -0
- package/dist/src/storage/statements.js +8 -0
- package/dist/src/submission.d.ts +42 -0
- package/dist/src/submission.js +71 -0
- package/dist/src/ticket-status.d.ts +8 -0
- package/dist/src/ticket-status.js +45 -0
- package/dist/src/token-prices.d.ts +19 -0
- package/dist/src/token-prices.js +76 -0
- package/dist/src/turn-profile.d.ts +13 -0
- package/dist/src/turn-profile.js +100 -0
- package/dist/src/worker-usage.d.ts +22 -0
- package/dist/src/worker-usage.js +44 -0
- package/dist/src/workflow-admission.d.ts +45 -0
- package/dist/src/workflow-admission.js +151 -0
- package/dist/src/workflow-candidate.d.ts +29 -0
- package/dist/src/workflow-candidate.js +59 -0
- package/dist/src/workflow-contracts.d.ts +29 -0
- package/dist/src/workflow-contracts.js +110 -0
- package/dist/src/workflow-declaration.d.ts +11 -0
- package/dist/src/workflow-declaration.js +59 -0
- package/dist/src/workflow-resources.d.ts +8 -0
- package/dist/src/workflow-resources.js +14 -0
- package/dist/src/workflows.d.ts +6 -0
- package/dist/src/workflows.js +4 -0
- package/dist/tools/compile-workflows.d.ts +1 -0
- package/dist/tools/compile-workflows.js +33 -0
- package/dist/tools/self-host-processes.d.ts +10 -0
- package/dist/tools/self-host-processes.js +156 -0
- package/dist/tools/self-host-workflows.d.ts +15 -0
- package/dist/tools/self-host-workflows.js +78 -0
- package/dist/tools/self-host.d.ts +1 -0
- package/dist/tools/self-host.js +261 -0
- package/dist/tools/self-update-host.d.ts +13 -0
- package/dist/tools/self-update-host.js +88 -0
- package/dist/tools/self-update.d.ts +11 -0
- package/dist/tools/self-update.js +177 -0
- package/dist/tools/workflow-manifest.d.ts +3 -0
- package/dist/tools/workflow-manifest.js +34 -0
- package/dist/workflows/analyze-chats.d.ts +10 -0
- package/dist/workflows/analyze-chats.declaration.json +9 -0
- package/dist/workflows/analyze-chats.js +73 -0
- package/dist/workflows/develop-prd.d.ts +7 -0
- package/dist/workflows/develop-prd.js +97 -0
- package/dist/workflows/develop-ticket.d.ts +9 -0
- package/dist/workflows/develop-ticket.js +202 -0
- package/dist/workflows/issue-labels.d.ts +16 -0
- package/dist/workflows/issue-labels.js +70 -0
- package/dist/workflows/ticket-prompts.d.ts +35 -0
- package/dist/workflows/ticket-prompts.js +133 -0
- package/package.json +84 -75
- package/dist/abstract_gpt/index.js +0 -55
- package/dist/cloving_gpt/adapters/Adapter.js +0 -2
- package/dist/cloving_gpt/adapters/azureopenai.js +0 -69
- package/dist/cloving_gpt/adapters/claude.js +0 -128
- package/dist/cloving_gpt/adapters/gemini.js +0 -135
- package/dist/cloving_gpt/adapters/gpt4all.js +0 -29
- package/dist/cloving_gpt/adapters/index.js +0 -2
- package/dist/cloving_gpt/adapters/mistral.js +0 -128
- package/dist/cloving_gpt/adapters/ollama.js +0 -128
- package/dist/cloving_gpt/adapters/openai.js +0 -100
- package/dist/cloving_gpt/index.js +0 -192
- package/dist/commands/analyze.js +0 -47
- package/dist/commands/chat.js +0 -14
- package/dist/commands/check.js +0 -7
- package/dist/commands/commit.js +0 -44
- package/dist/commands/config.js +0 -167
- package/dist/commands/describe.js +0 -235
- package/dist/commands/generate/code.js +0 -21
- package/dist/commands/generate/commit.js +0 -11
- package/dist/commands/generate/context.js +0 -82
- package/dist/commands/generate/docs.js +0 -11
- package/dist/commands/generate/documentation.js +0 -11
- package/dist/commands/generate/fizzbuzz.js +0 -35
- package/dist/commands/generate/init.js +0 -15
- package/dist/commands/generate/review.js +0 -11
- package/dist/commands/generate/sh.js +0 -95
- package/dist/commands/generate/shell.js +0 -11
- package/dist/commands/generate/unit_tests.js +0 -11
- package/dist/commands/init.js +0 -13
- package/dist/commands/models.js +0 -22
- package/dist/commands/project/build.js +0 -88
- package/dist/commands/project/complete.js +0 -12
- package/dist/commands/project/init.js +0 -82
- package/dist/commands/project/plan.js +0 -108
- package/dist/commands/proxy.js +0 -11
- package/dist/commands/review.js +0 -50
- package/dist/commands/tokens.js +0 -75
- package/dist/commands/unit_tests.js +0 -150
- package/dist/commands/update.js +0 -7
- package/dist/file2.js +0 -4
- package/dist/index.js +0 -136
- package/dist/managers/BlockManager.js +0 -120
- package/dist/managers/ChatManager.js +0 -653
- package/dist/managers/ChunkManager.js +0 -32
- package/dist/managers/CodeManager.js +0 -185
- package/dist/managers/CommitManager.js +0 -78
- package/dist/managers/DocsManager.js +0 -88
- package/dist/managers/DocumentationManager.js +0 -114
- package/dist/managers/InitManager.js +0 -230
- package/dist/managers/ProxyManager.js +0 -210
- package/dist/managers/ReviewManager.js +0 -131
- package/dist/managers/ShellManager.js +0 -163
- package/dist/managers/StreamManager.js +0 -308
- package/dist/managers/UnitTestManager.js +0 -243
- package/dist/managers/src/managers/ProxyManager.js +0 -1
- package/dist/newfile.js +0 -2
- package/dist/package.json +0 -86
- package/dist/utils/command_utils.js +0 -384
- package/dist/utils/config_utils.js +0 -249
- package/dist/utils/gitUtils.js +0 -42
- package/dist/utils/git_utils.js +0 -217
- package/dist/utils/modelUtils.js +0 -7
- package/dist/utils/model_utils.js +0 -7
- package/dist/utils/prompt_utils.js +0 -333
- package/dist/utils/prompts/CODEGEN_COULDNT_APPLY.md +0 -5
- package/dist/utils/prompts/CODEGEN_EXAMPLES.md +0 -82
- package/dist/utils/prompts/CODEGEN_INSTRUCTIONS.md +0 -43
- package/dist/utils/prompts/DOCS_INSTRUCTIONS.md +0 -9
- package/dist/utils/prompts/INIT_INSTRUCTIONS.md +0 -132
- package/dist/utils/prompts/REVIEW_INSTRUCTIONS.md +0 -49
- package/dist/utils/prompts/SHELL_INSTRUCTIONS.md +0 -15
- package/dist/utils/prompts/SPECIAL_FILES.md +0 -66
- package/dist/utils/prompts/index.js +0 -27
- package/dist/utils/string_utils.js +0 -505
- package/dist/utils/types.js +0 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { priceOf, usageOf } from "../worker-usage.js";
|
|
2
|
+
export function priceText(value, estimate) {
|
|
3
|
+
const price = priceOf(value);
|
|
4
|
+
if (price === null && priceOf(estimate) !== null)
|
|
5
|
+
return `≈ ${priceText(estimate)} (estimate)`;
|
|
6
|
+
if (price === null)
|
|
7
|
+
return "Price not known";
|
|
8
|
+
return `${price.toLocaleString("en-US", {
|
|
9
|
+
useGrouping: false,
|
|
10
|
+
minimumFractionDigits: 2,
|
|
11
|
+
maximumFractionDigits: 2,
|
|
12
|
+
})} USD`;
|
|
13
|
+
}
|
|
14
|
+
export function usageText(value) {
|
|
15
|
+
const usage = usageOf(value);
|
|
16
|
+
return [
|
|
17
|
+
["Input tokens", usage.input_tokens],
|
|
18
|
+
["Cache read tokens", usage.cache_read_input_tokens],
|
|
19
|
+
["Output tokens", usage.output_tokens],
|
|
20
|
+
]
|
|
21
|
+
.map(([label, count]) => `${String(label)}: ${count === null ? "Token usage not known" : String(count)}`)
|
|
22
|
+
.join(" · ");
|
|
23
|
+
}
|
|
24
|
+
export function totalsSuffix(state) {
|
|
25
|
+
return ["completed", "failed", "cancelled"].includes(String(state))
|
|
26
|
+
? ""
|
|
27
|
+
: " so far";
|
|
28
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const commandUsage: Readonly<Record<string, string>>;
|
|
2
|
+
export declare const usage = "Usage: cloving [--help] [--version]\n cloving workflows validate <manifest-path> [--input <json-file>] [--json]\n cloving <command> [--help]\n\nCommands:\n workflows validate Check a compiled workflow manifest, its artifacts and optional runtime input.\n chats redact Redact one imported chat corpus into private runtime files.\n chats import Import explicitly selected Claude Code transcripts into private runtime files.\n run Submit one run of an admitted workflow.\n status List the runs or show one run.\n questions List the pending decisions.\n answer Answer one design question.\n approve Approve one pending approval.\n deny Deny one pending approval.\n pause Stop new dispatch for a run.\n resume Resume a paused run.\n drop Cancel a run and keep its files.\n events Print the committed events.\n watch Serve a page that shows the runs live.\n start Start the service for a repository.\n\nThe runtime commands need a Cloving service. CLOVING_RUNTIME_DIR names its runtime directory.\nUse npm exec -- cloving ... for a project-local installation.\n";
|
|
3
|
+
export declare const chatsImportUsage = "Usage: cloving chats import [--] <path> [<path> ...]\n cloving chats import --root <projects-folder> [--root <projects-folder> ...] [--exclude-project <name> ...] [-- <path> ...]\n\nImports only the selected Claude Code JSONL files. Relative paths use the current directory.\nThis local command needs no service. It scans only explicitly named roots and does not expand globs or discover configuration.\nPositional files come first, retaining order and repetitions. Roots sort by canonical path, then entries by relative path in JavaScript string order.\nExclusions match direct project folder names exactly and prune their children. Exclusions require a root.\nScans accept lowercase .jsonl filenames, attempt at most 100 eligible files across roots, and stop before entering folders at depth four.\nLater file candidates and depth-limited folders are pending. Select pending files explicitly in a later import.\nLinked components, containment changes and roots in Git repositories are refused. Scan protections require the supported macOS kernel.\nThe file limit is 10 MiB (10,485,760 bytes). Links and nonregular files are refused.\nThe total normalized corpus limit is 50 MiB (52,428,800 UTF-8 bytes), including newlines and repeated selections.\nExceeding that total returns output-failed with exit code 1 and no completed coverage manifest; partial files may remain.\n--previous-import <IMPORT_ID> compares against one explicitly named UUID v4 import before --.\nThe earlier coverage and optional revision must be valid, completed private metadata; otherwise previous-import-refused returns exit 1 with no new import.\nA comparison writes private revision.json with ordered selection evidence and six status counts. Matching uses source path and selected root path; repetitions pair in order.\nByte-verified extensions are extended; shorter sources are truncated. Legacy imports without sizes can establish unchanged digests but cannot prove extension or truncation.\nMissing or truncated evidence makes the import partial. History completeness remains unknown.\nPrivate corpus.jsonl, structure.json and coverage.json files go into a new import directory under the runtime directory's chats directory.\nThe runtime selection is CLOVING_RUNTIME_DIR, XDG_RUNTIME_DIR, XDG_STATE_HOME, then HOME.\nOutput contains only counts, fixed codes and an opaque import ID. Source paths stay in the private manifest.\nStructure preserves branches and marks known copies without removing records. History completeness remains unknown.\nRoot imports write coverage version 2 and add excluded and pending entry counts; positional-only imports retain coverage version 1.\nExit codes: 0 for no refused, pending, missing or truncated entries (exclusions alone permit success without comparison), 1 for partial coverage or processing failure, 2 for invalid usage.\n";
|
|
4
|
+
export declare const validateUsage = "Usage: cloving workflows validate <manifest-path> [--input <json-file>] [--json]\n\nChecks a Cloving workflow manifest, its compiled SDK artifacts, declared resources and toolchain, and an optional runtime input file. Relative paths resolve against the current directory.\n\nOptions:\n --input <json-file> Validate this runtime input file.\n --json Print one versioned JSON result on stdout.\n\nValidation does not admit a run, dispatch effects, import workflow code or call a model.\n\nExample:\n cloving workflows validate cloving.workflow.json --input input.json\n";
|
|
5
|
+
export declare const chatsRedactUsage = "Usage: cloving chats redact <IMPORT_ID>\n\nRedact one existing import selected by its UUID v4 import ID. No service is required.\nWrite redacted.jsonl and redaction.json beside the original corpus with mode 0600.\nHOME supplies the home folder. CLOVING_PRIVATE_TEXTS is an optional JSON list of nonblank strings.\nOriginals and metadata remain private. Redaction does not authorize model use or guarantee removal of every private value.\nExit codes: 0 complete, 1 processing failure, 2 invalid usage.\n";
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
const binding = "--expected-revision <n> --generation <n> --subject-digest <digest>";
|
|
2
|
+
export const commandUsage = {
|
|
3
|
+
run: `Usage: cloving run <workflow-id> (--prompt <text> | --ticket <id> | --next | --input <json-file>) [--command-id <id>] [--json]
|
|
4
|
+
|
|
5
|
+
Submits one run of an admitted workflow. Use exactly one input source.
|
|
6
|
+
With --ticket, the workflow gets the ticket ID and reads the ticket itself.
|
|
7
|
+
With --next (the same as --ticket next), develop-issue and develop-ticket select a ready ticket through CLOVING_NEXT_COMMAND.
|
|
8
|
+
Success means a committed receipt. It does not mean completed work.
|
|
9
|
+
`,
|
|
10
|
+
status: `Usage: cloving status [<run-id>] [--limit <n>] [--after <cursor>] [--json]
|
|
11
|
+
|
|
12
|
+
Lists the runs, or shows one run with its reason, evidence and next action.
|
|
13
|
+
`,
|
|
14
|
+
questions: `Usage: cloving questions [<run-id>] [--json]
|
|
15
|
+
|
|
16
|
+
Lists the pending decisions with the values that a decision command needs.
|
|
17
|
+
`,
|
|
18
|
+
answer: `Usage: cloving answer <decision-ref> --text <answer> ${binding} [--command-id <id>] [--json]
|
|
19
|
+
|
|
20
|
+
Records an answer to one design question.
|
|
21
|
+
`,
|
|
22
|
+
approve: `Usage: cloving approve <decision-ref> ${binding} [--command-id <id>] [--json]
|
|
23
|
+
|
|
24
|
+
Approves one pending approval.
|
|
25
|
+
`,
|
|
26
|
+
deny: `Usage: cloving deny <decision-ref> [--text <feedback>] ${binding} [--command-id <id>] [--json]
|
|
27
|
+
|
|
28
|
+
Denies one pending approval. The workflow continues with the denial.
|
|
29
|
+
A feedback text has at most 8000 bytes. The ticket workflow sends it to the next round.
|
|
30
|
+
`,
|
|
31
|
+
pause: `Usage: cloving pause <run-id> --expected-revision <n> [--command-id <id>] [--json]
|
|
32
|
+
|
|
33
|
+
Stops new dispatch for the run. Work in progress is not stopped at once.
|
|
34
|
+
`,
|
|
35
|
+
resume: `Usage: cloving resume <run-id> --expected-revision <n> [--command-id <id>] [--json]
|
|
36
|
+
|
|
37
|
+
Returns a paused run to the state that it paused from.
|
|
38
|
+
`,
|
|
39
|
+
drop: `Usage: cloving drop <run-id> --expected-revision <n> [--command-id <id>] [--json]
|
|
40
|
+
|
|
41
|
+
Cancels the run and its pending dispatch. It keeps the workspace and the evidence.
|
|
42
|
+
`,
|
|
43
|
+
events: `Usage: cloving events [<run-id>] [--after <sequence>] [--limit <n>] [--follow] [--json]
|
|
44
|
+
|
|
45
|
+
Prints the committed events after a sequence. With --json, each line is one event.
|
|
46
|
+
`,
|
|
47
|
+
watch: `Usage: cloving watch [--port <n>]
|
|
48
|
+
|
|
49
|
+
Serves a page on http://127.0.0.1:<port>/ that shows the runs live: the state,
|
|
50
|
+
the events, the work of the Claude worker and each pending decision.
|
|
51
|
+
The default port is 3663. The page is read only. Stop it with Control-C.
|
|
52
|
+
`,
|
|
53
|
+
start: `Usage: cloving start [--repository <directory>] [--reset-queue]
|
|
54
|
+
|
|
55
|
+
Starts the Cloving service for one git repository, with the workflow host,
|
|
56
|
+
the Claude worker and the watch page. The default repository is the current
|
|
57
|
+
directory. This command works in a development checkout of Cloving.
|
|
58
|
+
Stop it with Control-C.
|
|
59
|
+
|
|
60
|
+
The queue continues after unsuccessful runs and stops after three runs in a row
|
|
61
|
+
without a successful handoff. A successful handoff resets the count; ordinary restarts preserve the count.
|
|
62
|
+
Stop the service, inspect the failures and reconcile affected issues, then start with --reset-queue and the same queue settings to clear the failure streak once. Tracked commands are preserved.
|
|
63
|
+
|
|
64
|
+
The command reads these settings from the environment:
|
|
65
|
+
CLOVING_RUNTIME_DIR The path of the runtime directory. The default is ~/.local/state/cloving/run, if XDG_RUNTIME_DIR and XDG_STATE_HOME are not set.
|
|
66
|
+
CLOVING_TICKET_COMMAND A JSON list of a command and its arguments. The command gets a ticket ID as its last argument and prints the ticket. The setting has no default, and a run with --ticket needs it.
|
|
67
|
+
CLOVING_NOTIFY_COMMAND A JSON list of a command and its arguments. Every 15 seconds, new decisions, blocked runs and failed runs send JSON on standard input with no added argument. The setting has no default.
|
|
68
|
+
CLOVING_NEXT_COMMAND A JSON list of a command and its arguments. The command runs with no added argument and prints one ready ticket ID for --next. The setting has no default.
|
|
69
|
+
CLOVING_QUEUE_SECONDS A whole number from 10 to 3600 seconds between develop-issue queue checks; requires CLOVING_NEXT_COMMAND and CLOVING_TICKET_COMMAND. Unset means no queue. The queue stops after three runs in a row without a successful handoff; manual develop-issue submissions are refused with workflow-active while an issue run is active.
|
|
70
|
+
CLOVING_SELF_UPDATE_SECONDS A whole number from 30 to 3600 seconds between checks of the own checkout; unset means no update. An update stops the daemon and restarts with new code. A change of package-lock.json needs the operator to update and install by hand.
|
|
71
|
+
CLOVING_ANALYSIS_TOKEN_COMMAND A JSON list of a program and its nonempty string arguments, run without a shell just before analysis. It has limits of 10 seconds and 4096 combined stdout/stderr bytes; stdout must be one printable ASCII token without spaces, at most 512 bytes after one final line break. Only analysis receives CLAUDE_CODE_OAUTH_TOKEN; API keys are excluded. There is no default.
|
|
72
|
+
CLOVING_CLAUDE_COMMAND A JSON list of a command and its arguments for the Claude worker. The default is the claude command with a limit of 5 USD for each turn.
|
|
73
|
+
CLOVING_PROFILES The path of a JSON file of operator-defined Claude turn profiles, read once at start. The setting has no default.
|
|
74
|
+
CLOVING_TOKEN_PRICES A JSON object from model names to input, cachedInput and output USD prices per million tokens for estimates; entries override matching built-in prices.
|
|
75
|
+
CLOVING_WORKER The worker for each turn: claude or codex. The default is claude. Other values stop the start with invalid-worker.
|
|
76
|
+
CLOVING_CODEX_COMMAND A JSON list of a command and its arguments, used only when CLOVING_WORKER is codex; CLOVING_CLAUDE_COMMAND is then ignored. The default is codex exec --json --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check -, with no sandbox and no approval prompts.
|
|
77
|
+
CLOVING_WATCH_REPOSITORY The service repository context for the watch board, set by start from --repository. Its local origin supplies the GitHub identity. There is no current-directory default.
|
|
78
|
+
CLOVING_WATCH_ACTIONS The value off removes the board run form and its write endpoint. The default is on.
|
|
79
|
+
CLOVING_WATCH_PORT The port number of the watch page. The value off starts no watch page. The default is 3663.
|
|
80
|
+
CLOVING_OWNERSHIP_LEASE_SECONDS The time in seconds of the ownership lease of a started workflow step. The default is 15.
|
|
81
|
+
CLOVING_HOST_BOUND The largest number of queue messages that the workflow host handles at one time, from 1 to 64. The default is 8.
|
|
82
|
+
CLOVING_GH_COMMAND A JSON list of a command and its arguments for the GitHub CLI, which the workflow develop-issue uses for pull requests and develop-prd uses for issues. The watch board also uses it to read pull request status. The default is gh.
|
|
83
|
+
CLOVING_CHECK_COMMAND A JSON list of a command and its arguments that the workflow develop-issue runs in the work tree before a merge. A merge does not occur if the command fails. The setting has no default, and with no setting the merge occurs with no check.
|
|
84
|
+
CLOVING_PRIVATE_TEXTS A JSON list of texts that the workflow develop-issue does not push in a file or in a commit message. The workflow develop-prd requires the list before posting an issue. The list adds to the path of the home folder, and the case of the letters does not matter. The setting has no default.
|
|
85
|
+
`,
|
|
86
|
+
};
|
|
87
|
+
export const usage = `Usage: cloving [--help] [--version]
|
|
88
|
+
cloving workflows validate <manifest-path> [--input <json-file>] [--json]
|
|
89
|
+
cloving <command> [--help]
|
|
90
|
+
|
|
91
|
+
Commands:
|
|
92
|
+
workflows validate Check a compiled workflow manifest, its artifacts and optional runtime input.
|
|
93
|
+
chats redact Redact one imported chat corpus into private runtime files.
|
|
94
|
+
chats import Import explicitly selected Claude Code transcripts into private runtime files.
|
|
95
|
+
run Submit one run of an admitted workflow.
|
|
96
|
+
status List the runs or show one run.
|
|
97
|
+
questions List the pending decisions.
|
|
98
|
+
answer Answer one design question.
|
|
99
|
+
approve Approve one pending approval.
|
|
100
|
+
deny Deny one pending approval.
|
|
101
|
+
pause Stop new dispatch for a run.
|
|
102
|
+
resume Resume a paused run.
|
|
103
|
+
drop Cancel a run and keep its files.
|
|
104
|
+
events Print the committed events.
|
|
105
|
+
watch Serve a page that shows the runs live.
|
|
106
|
+
start Start the service for a repository.
|
|
107
|
+
|
|
108
|
+
The runtime commands need a Cloving service. CLOVING_RUNTIME_DIR names its runtime directory.
|
|
109
|
+
Use npm exec -- cloving ... for a project-local installation.
|
|
110
|
+
`;
|
|
111
|
+
export const chatsImportUsage = `Usage: cloving chats import [--] <path> [<path> ...]
|
|
112
|
+
cloving chats import --root <projects-folder> [--root <projects-folder> ...] [--exclude-project <name> ...] [-- <path> ...]
|
|
113
|
+
|
|
114
|
+
Imports only the selected Claude Code JSONL files. Relative paths use the current directory.
|
|
115
|
+
This local command needs no service. It scans only explicitly named roots and does not expand globs or discover configuration.
|
|
116
|
+
Positional files come first, retaining order and repetitions. Roots sort by canonical path, then entries by relative path in JavaScript string order.
|
|
117
|
+
Exclusions match direct project folder names exactly and prune their children. Exclusions require a root.
|
|
118
|
+
Scans accept lowercase .jsonl filenames, attempt at most 100 eligible files across roots, and stop before entering folders at depth four.
|
|
119
|
+
Later file candidates and depth-limited folders are pending. Select pending files explicitly in a later import.
|
|
120
|
+
Linked components, containment changes and roots in Git repositories are refused. Scan protections require the supported macOS kernel.
|
|
121
|
+
The file limit is 10 MiB (10,485,760 bytes). Links and nonregular files are refused.
|
|
122
|
+
The total normalized corpus limit is 50 MiB (52,428,800 UTF-8 bytes), including newlines and repeated selections.
|
|
123
|
+
Exceeding that total returns output-failed with exit code 1 and no completed coverage manifest; partial files may remain.
|
|
124
|
+
--previous-import <IMPORT_ID> compares against one explicitly named UUID v4 import before --.
|
|
125
|
+
The earlier coverage and optional revision must be valid, completed private metadata; otherwise previous-import-refused returns exit 1 with no new import.
|
|
126
|
+
A comparison writes private revision.json with ordered selection evidence and six status counts. Matching uses source path and selected root path; repetitions pair in order.
|
|
127
|
+
Byte-verified extensions are extended; shorter sources are truncated. Legacy imports without sizes can establish unchanged digests but cannot prove extension or truncation.
|
|
128
|
+
Missing or truncated evidence makes the import partial. History completeness remains unknown.
|
|
129
|
+
Private corpus.jsonl, structure.json and coverage.json files go into a new import directory under the runtime directory's chats directory.
|
|
130
|
+
The runtime selection is CLOVING_RUNTIME_DIR, XDG_RUNTIME_DIR, XDG_STATE_HOME, then HOME.
|
|
131
|
+
Output contains only counts, fixed codes and an opaque import ID. Source paths stay in the private manifest.
|
|
132
|
+
Structure preserves branches and marks known copies without removing records. History completeness remains unknown.
|
|
133
|
+
Root imports write coverage version 2 and add excluded and pending entry counts; positional-only imports retain coverage version 1.
|
|
134
|
+
Exit codes: 0 for no refused, pending, missing or truncated entries (exclusions alone permit success without comparison), 1 for partial coverage or processing failure, 2 for invalid usage.
|
|
135
|
+
`;
|
|
136
|
+
export const validateUsage = `Usage: cloving workflows validate <manifest-path> [--input <json-file>] [--json]
|
|
137
|
+
|
|
138
|
+
Checks a Cloving workflow manifest, its compiled SDK artifacts, declared resources and toolchain, and an optional runtime input file. Relative paths resolve against the current directory.
|
|
139
|
+
|
|
140
|
+
Options:
|
|
141
|
+
--input <json-file> Validate this runtime input file.
|
|
142
|
+
--json Print one versioned JSON result on stdout.
|
|
143
|
+
|
|
144
|
+
Validation does not admit a run, dispatch effects, import workflow code or call a model.
|
|
145
|
+
|
|
146
|
+
Example:
|
|
147
|
+
cloving workflows validate cloving.workflow.json --input input.json
|
|
148
|
+
`;
|
|
149
|
+
export const chatsRedactUsage = `Usage: cloving chats redact <IMPORT_ID>
|
|
150
|
+
|
|
151
|
+
Redact one existing import selected by its UUID v4 import ID. No service is required.
|
|
152
|
+
Write redacted.jsonl and redaction.json beside the original corpus with mode 0600.
|
|
153
|
+
HOME supplies the home folder. CLOVING_PRIVATE_TEXTS is an optional JSON list of nonblank strings.
|
|
154
|
+
Originals and metadata remain private. Redaction does not authorize model use or guarantee removal of every private value.
|
|
155
|
+
Exit codes: 0 complete, 1 processing failure, 2 invalid usage.
|
|
156
|
+
`;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ExecutionManifest } from "../workflow-admission.ts";
|
|
2
|
+
export interface ValidationError {
|
|
3
|
+
readonly code: string;
|
|
4
|
+
readonly file: string;
|
|
5
|
+
readonly detail: string;
|
|
6
|
+
}
|
|
7
|
+
export type ValidationReport = {
|
|
8
|
+
readonly schemaVersion: 1;
|
|
9
|
+
readonly kind: "workflow-validation";
|
|
10
|
+
readonly status: "valid";
|
|
11
|
+
readonly workflow: {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly workflowId: string;
|
|
14
|
+
};
|
|
15
|
+
readonly pinnedIdentity: string;
|
|
16
|
+
readonly errors: readonly ValidationError[];
|
|
17
|
+
} | {
|
|
18
|
+
readonly schemaVersion: 1;
|
|
19
|
+
readonly kind: "workflow-validation";
|
|
20
|
+
readonly status: "rejected";
|
|
21
|
+
readonly errors: readonly ValidationError[];
|
|
22
|
+
};
|
|
23
|
+
export type CompiledAdmission = {
|
|
24
|
+
readonly kind: "admitted";
|
|
25
|
+
readonly manifest: ExecutionManifest;
|
|
26
|
+
} | {
|
|
27
|
+
readonly kind: "rejected";
|
|
28
|
+
readonly error: ValidationError;
|
|
29
|
+
};
|
|
30
|
+
export interface AdmissionRequest {
|
|
31
|
+
readonly file: string;
|
|
32
|
+
readonly capabilities: readonly string[];
|
|
33
|
+
}
|
|
34
|
+
export declare function validateWorkflow(directory: string, files: {
|
|
35
|
+
readonly manifest: string;
|
|
36
|
+
readonly input: string | null;
|
|
37
|
+
}): Promise<ValidationReport>;
|
|
38
|
+
export declare function admitCompiled(path: string, request: AdmissionRequest): Promise<CompiledAdmission>;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
import { pinnedIdentity } from "../execution-pin.js";
|
|
5
|
+
import { collectResources } from "../resource-files.js";
|
|
6
|
+
import { admitWorkflow, } from "../workflow-admission.js";
|
|
7
|
+
import { validateDevelopmentInput } from "../workflow-contracts.js";
|
|
8
|
+
import { observedToolchain, qualifiedToolchain } from "./toolchain.js";
|
|
9
|
+
const artifactNames = [
|
|
10
|
+
"client.mjs",
|
|
11
|
+
"flow.mjs",
|
|
12
|
+
"flow.mjs.__wf_tmp.js.debug.json",
|
|
13
|
+
"manifest.json",
|
|
14
|
+
"steps.mjs",
|
|
15
|
+
"steps.mjs.debug.json",
|
|
16
|
+
];
|
|
17
|
+
export async function validateWorkflow(directory, files) {
|
|
18
|
+
const { manifest, input } = files;
|
|
19
|
+
const errors = input === null ? [] : await inputErrors(resolve(directory, input), input);
|
|
20
|
+
const admission = await admitCompiled(resolve(directory, manifest), {
|
|
21
|
+
file: manifest,
|
|
22
|
+
capabilities: [],
|
|
23
|
+
});
|
|
24
|
+
if (admission.kind === "rejected")
|
|
25
|
+
errors.push(admission.error);
|
|
26
|
+
if (admission.kind === "rejected" || errors.length > 0)
|
|
27
|
+
return {
|
|
28
|
+
schemaVersion: 1,
|
|
29
|
+
kind: "workflow-validation",
|
|
30
|
+
status: "rejected",
|
|
31
|
+
errors,
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
schemaVersion: 1,
|
|
35
|
+
kind: "workflow-validation",
|
|
36
|
+
status: "valid",
|
|
37
|
+
workflow: {
|
|
38
|
+
name: admission.manifest.name,
|
|
39
|
+
workflowId: admission.manifest.workflowId,
|
|
40
|
+
},
|
|
41
|
+
pinnedIdentity: createHash("sha256")
|
|
42
|
+
.update(pinnedIdentity(admission.manifest))
|
|
43
|
+
.digest("hex"),
|
|
44
|
+
errors: [],
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async function inputErrors(path, file) {
|
|
48
|
+
const value = await readJson(path);
|
|
49
|
+
if (value === null)
|
|
50
|
+
return [{ code: "unreadable-input", file, detail: "json" }];
|
|
51
|
+
if (validateDevelopmentInput(value).kind === "valid")
|
|
52
|
+
return [];
|
|
53
|
+
return [{ code: "invalid-development-input", file, detail: "cycleId" }];
|
|
54
|
+
}
|
|
55
|
+
export async function admitCompiled(path, request) {
|
|
56
|
+
const { file, capabilities } = request;
|
|
57
|
+
const registration = fields(await readJson(path));
|
|
58
|
+
const artifacts = registration["artifacts"];
|
|
59
|
+
if (registration["schemaVersion"] !== 1 || typeof artifacts !== "string")
|
|
60
|
+
return rejected({
|
|
61
|
+
code: "invalid-manifest",
|
|
62
|
+
file,
|
|
63
|
+
detail: "schemaVersion or artifacts",
|
|
64
|
+
});
|
|
65
|
+
const root = dirname(path);
|
|
66
|
+
const directory = resolve(root, artifacts);
|
|
67
|
+
const digests = {};
|
|
68
|
+
const contents = {};
|
|
69
|
+
for (const name of artifactNames) {
|
|
70
|
+
const bytes = await readFile(resolve(directory, name)).catch(() => null);
|
|
71
|
+
if (bytes === null)
|
|
72
|
+
return rejected({ code: "missing-artifact", file, detail: name });
|
|
73
|
+
digests[name] = createHash("sha256").update(bytes).digest("hex");
|
|
74
|
+
contents[name] = bytes;
|
|
75
|
+
}
|
|
76
|
+
const declared = registration["resources"];
|
|
77
|
+
const toolchain = await observedToolchain(directory);
|
|
78
|
+
const result = admitWorkflow(registration, {
|
|
79
|
+
compiled: {
|
|
80
|
+
manifest: parseJson(contents["manifest.json"]?.toString("utf8") ?? ""),
|
|
81
|
+
artifacts: digests,
|
|
82
|
+
resources: await collectResources(root, Array.isArray(declared)
|
|
83
|
+
? declared.filter((item) => typeof item === "string")
|
|
84
|
+
: []),
|
|
85
|
+
toolchain,
|
|
86
|
+
},
|
|
87
|
+
policy: {
|
|
88
|
+
toolchain: await qualifiedToolchain(toolchain, directory),
|
|
89
|
+
capabilities,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
if (result.kind === "rejected")
|
|
93
|
+
return rejected({ code: result.reason, file, detail: result.detail });
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
function rejected(error) {
|
|
97
|
+
return { kind: "rejected", error };
|
|
98
|
+
}
|
|
99
|
+
async function readJson(path) {
|
|
100
|
+
const text = await readFile(path, "utf8").catch(() => null);
|
|
101
|
+
return text === null ? null : parseJson(text);
|
|
102
|
+
}
|
|
103
|
+
function parseJson(text) {
|
|
104
|
+
try {
|
|
105
|
+
const value = JSON.parse(text);
|
|
106
|
+
return value;
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function fields(value) {
|
|
113
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
114
|
+
return {};
|
|
115
|
+
return Object.fromEntries(Object.entries(value));
|
|
116
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IncomingMessage } from "node:http";
|
|
2
|
+
import { type CardForm } from "./watch-run-input.ts";
|
|
3
|
+
export interface WatchActions {
|
|
4
|
+
readonly forms: readonly CardForm[];
|
|
5
|
+
readonly token: string;
|
|
6
|
+
readonly runtimeDirectory: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function watchActions(runtimeDirectory: string): Promise<WatchActions>;
|
|
9
|
+
export declare function watchHost(request: IncomingMessage): boolean;
|
|
10
|
+
export declare function watchAction(actions: WatchActions, request: IncomingMessage): Promise<string | null>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { randomBytes } from "node:crypto";
|
|
2
|
+
import { send } from "./client.js";
|
|
3
|
+
import { watchCardForms } from "./watch-card-forms.js";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { cardRunRequest } from "./watch-run-input.js";
|
|
6
|
+
export async function watchActions(runtimeDirectory) {
|
|
7
|
+
return {
|
|
8
|
+
runtimeDirectory,
|
|
9
|
+
forms: await watchCardForms(join(import.meta.dirname, "../../workflows")),
|
|
10
|
+
token: randomBytes(32).toString("hex"),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export function watchHost(request) {
|
|
14
|
+
const port = request.socket.localPort;
|
|
15
|
+
return [`127.0.0.1:${String(port)}`, `localhost:${String(port)}`].includes(request.headers.host ?? "");
|
|
16
|
+
}
|
|
17
|
+
function authorized(actions, request) {
|
|
18
|
+
return (watchHost(request) &&
|
|
19
|
+
request.headers.origin === `http://${request.headers.host ?? ""}` &&
|
|
20
|
+
request.headers["x-cloving-token"] === actions.token &&
|
|
21
|
+
/^application\/json(?:\s*;\s*charset=utf-8)?$/i.test(request.headers["content-type"] ?? ""));
|
|
22
|
+
}
|
|
23
|
+
async function bodyOf(request) {
|
|
24
|
+
const chunks = [];
|
|
25
|
+
let size = 0;
|
|
26
|
+
for await (const chunk of request) {
|
|
27
|
+
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk));
|
|
28
|
+
size += bytes.length;
|
|
29
|
+
if (size > 16384)
|
|
30
|
+
return null;
|
|
31
|
+
chunks.push(bytes);
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const value = JSON.parse(Buffer.concat(chunks).toString("utf8"));
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export async function watchAction(actions, request) {
|
|
42
|
+
if (!authorized(actions, request))
|
|
43
|
+
return null;
|
|
44
|
+
const given = cardRunRequest(actions.forms, await bodyOf(request));
|
|
45
|
+
if (given === null)
|
|
46
|
+
return null;
|
|
47
|
+
const status = await send(actions.runtimeDirectory, {
|
|
48
|
+
operation: "status",
|
|
49
|
+
parameters: {},
|
|
50
|
+
});
|
|
51
|
+
if (status.kind === "error")
|
|
52
|
+
return JSON.stringify(status);
|
|
53
|
+
const workflows = status.result["workflows"];
|
|
54
|
+
if (!Array.isArray(workflows) ||
|
|
55
|
+
!workflows.includes(given.parameters["workflowId"]))
|
|
56
|
+
return null;
|
|
57
|
+
return JSON.stringify(await send(actions.runtimeDirectory, given));
|
|
58
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type CardControls } from "./watch-card-view.ts";
|
|
2
|
+
import type { CardForm } from "./watch-run-input.ts";
|
|
3
|
+
import { type Shown } from "./watch-element.ts";
|
|
4
|
+
import type { WatchCard, WatchWorkflow } from "./watch-render.ts";
|
|
5
|
+
export declare const boardSizing: {
|
|
6
|
+
minimumColumnWidth: number;
|
|
7
|
+
collapsedColumnWidth: number;
|
|
8
|
+
gap: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function boardLayout(input: {
|
|
11
|
+
readonly contentWidth: number;
|
|
12
|
+
readonly openColumns: number;
|
|
13
|
+
readonly collapsedColumns: number;
|
|
14
|
+
}): {
|
|
15
|
+
readonly columnWidth: number;
|
|
16
|
+
readonly totalWidth: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function cardStep(card: WatchCard, now: string): string;
|
|
19
|
+
export declare function cardReview(card: WatchCard): string;
|
|
20
|
+
export declare function CardReview(props: {
|
|
21
|
+
readonly card: WatchCard;
|
|
22
|
+
readonly workflowId: string;
|
|
23
|
+
}): Shown;
|
|
24
|
+
export declare function completionMark(card: WatchCard, workflowId: string): Shown;
|
|
25
|
+
export declare function Card(props: {
|
|
26
|
+
readonly card: WatchCard;
|
|
27
|
+
readonly workflowId: string;
|
|
28
|
+
readonly now: string;
|
|
29
|
+
}): Shown;
|
|
30
|
+
export declare function WorkflowList(props: {
|
|
31
|
+
readonly workflows: readonly WatchWorkflow[];
|
|
32
|
+
readonly selected: string | null;
|
|
33
|
+
}): Shown;
|
|
34
|
+
export interface ColumnControls {
|
|
35
|
+
readonly choices: Readonly<Record<string, boolean>> | null;
|
|
36
|
+
readonly onToggle: (name: string) => void;
|
|
37
|
+
readonly onHover?: (name: string | null) => void;
|
|
38
|
+
readonly onFocus?: (name: string | null) => void;
|
|
39
|
+
}
|
|
40
|
+
export declare function columnCollapsed(choices: Readonly<Record<string, boolean>> | null, name: string): boolean;
|
|
41
|
+
export declare function Column(props: {
|
|
42
|
+
readonly column: WatchWorkflow["columns"][number];
|
|
43
|
+
readonly addCard?: Shown;
|
|
44
|
+
readonly workflowId: string;
|
|
45
|
+
readonly now: string;
|
|
46
|
+
readonly controls?: ColumnControls | undefined;
|
|
47
|
+
}): Shown;
|
|
48
|
+
export declare function Board(props: {
|
|
49
|
+
readonly workflow: WatchWorkflow;
|
|
50
|
+
readonly cardForm?: CardForm | undefined;
|
|
51
|
+
readonly cards?: CardControls | undefined;
|
|
52
|
+
readonly now: string;
|
|
53
|
+
readonly controls?: ColumnControls | undefined;
|
|
54
|
+
}): Shown;
|