@astrosheep/keiyaku 4.6.30 → 4.6.31
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/README.md +5 -5
- package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/build/plugins/claude/skills/keiyaku/SKILL.md +12 -12
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +16 -16
- package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +10 -10
- package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +15 -15
- package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +16 -16
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +21 -21
- package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
- package/build/plugins/codex/skills/keiyaku/SKILL.md +12 -12
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +16 -16
- package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +10 -10
- package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +15 -15
- package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +16 -16
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +21 -21
- package/build/plugins/opencode/package.json +1 -1
- package/build/plugins/opencode/skills/keiyaku/SKILL.md +12 -12
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +16 -16
- package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +10 -10
- package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +15 -15
- package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +16 -16
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +21 -21
- package/build/plugins/pi/README.md +5 -5
- package/build/plugins/pi/akuma-tools.ts +17 -23
- package/build/skills/keiyaku/SKILL.md +12 -12
- package/build/skills/keiyaku-akuma/SKILL.md +16 -16
- package/build/skills/keiyaku-akuma/references/automation.md +14 -14
- package/build/skills/keiyaku-babysit/SKILL.md +10 -10
- package/build/skills/keiyaku-bind/SKILL.md +15 -15
- package/build/skills/keiyaku-debt/SKILL.md +16 -16
- package/build/skills/keiyaku-workflow/SKILL.md +21 -21
- package/build/src/akuma/akuma-call.d.ts +1 -1
- package/build/src/akuma/akuma-call.js +9 -9
- package/build/src/akuma/akuma-errors.d.ts +5 -5
- package/build/src/akuma/akuma-instance.d.ts +355 -12
- package/build/src/akuma/akuma-instance.js +20 -20
- package/build/src/akuma/akuma-observe.d.ts +11 -12
- package/build/src/akuma/akuma-observe.js +34 -26
- package/build/src/akuma/akuma-owner.d.ts +32 -11
- package/build/src/akuma/akuma-owner.js +35 -16
- package/build/src/akuma/akuma-probe.d.ts +3 -3
- package/build/src/akuma/akuma-probe.js +2 -2
- package/build/src/akuma/akuma-selection-execution.d.ts +985 -1
- package/build/src/akuma/akuma-selection-execution.js +42 -18
- package/build/src/akuma/akuma-stream.d.ts +2 -2
- package/build/src/akuma/akuma-stream.js +1 -1
- package/build/src/akuma/akuma-wait.d.ts +5 -5
- package/build/src/akuma/akuma-wait.js +52 -14
- package/build/src/akuma/akuma.d.ts +245 -271
- package/build/src/akuma/akuma.js +98 -46
- package/build/src/akuma/archetype.d.ts +19 -6
- package/build/src/akuma/archetype.js +25 -9
- package/build/src/akuma/body-launch.d.ts +2 -2
- package/build/src/akuma/body.js +4 -4
- package/build/src/akuma/call-initial-tell.d.ts +60 -44
- package/build/src/akuma/call-initial-tell.js +41 -2
- package/build/src/akuma/caller.d.ts +26 -17
- package/build/src/akuma/caller.js +22 -9
- package/build/src/akuma/coordinate.d.ts +9 -0
- package/build/src/akuma/coordinate.js +13 -0
- package/build/src/akuma/detached-body.js +2 -2
- package/build/src/akuma/dispatch-association.d.ts +4 -4
- package/build/src/akuma/dispatch-association.js +12 -3
- package/build/src/akuma/execution-instructions.js +2 -2
- package/build/src/akuma/heart/facts.d.ts +29 -7
- package/build/src/akuma/heart/facts.js +13 -0
- package/build/src/akuma/heart/index.d.ts +0 -3
- package/build/src/akuma/heart/index.js +3 -6
- package/build/src/akuma/heart/rows.js +2 -2
- package/build/src/akuma/heart/soul.js +5 -5
- package/build/src/akuma/identity.d.ts +17 -16
- package/build/src/akuma/identity.js +20 -19
- package/build/src/akuma/index.d.ts +1 -2
- package/build/src/akuma/lineage-cache.d.ts +4 -4
- package/build/src/akuma/lineage-cache.js +10 -10
- package/build/src/akuma/projection-read.d.ts +2 -5
- package/build/src/akuma/projection-read.js +34 -47
- package/build/src/akuma/projection.d.ts +659 -569
- package/build/src/akuma/projection.js +203 -94
- package/build/src/akuma/providers/acp/index.js +1 -1
- package/build/src/akuma/providers/execution-environment.d.ts +1 -3
- package/build/src/akuma/providers/execution-environment.js +0 -4
- package/build/src/akuma/publication.d.ts +2 -2
- package/build/src/akuma/publication.js +3 -3
- package/build/src/akuma/retention.js +2 -2
- package/build/src/akuma/selection-observation.d.ts +507 -43
- package/build/src/akuma/selection-observation.js +153 -1
- package/build/src/akuma/status-projection.d.ts +288 -0
- package/build/src/akuma/status-projection.js +154 -0
- package/build/src/akuma/turn-drive.js +0 -3
- package/build/src/alias/index.d.ts +9 -4
- package/build/src/alias/index.js +11 -9
- package/build/src/bounded-list.d.ts +8 -0
- package/build/src/bounded-list.js +9 -0
- package/build/src/cli/commands/akuma-grammar.d.ts +2 -2
- package/build/src/cli/commands/akuma-grammar.js +21 -21
- package/build/src/cli/commands/akuma.d.ts +1 -2
- package/build/src/cli/commands/akuma.js +115 -251
- package/build/src/cli/commands/contract-grammar.d.ts +4 -3
- package/build/src/cli/commands/contract-grammar.js +39 -22
- package/build/src/cli/commands/contract-help.d.ts +3 -1
- package/build/src/cli/commands/contract-help.js +4 -3
- package/build/src/cli/commands/contract.d.ts +6 -3
- package/build/src/cli/commands/contract.js +203 -434
- package/build/src/cli/commands/debt.d.ts +2 -3
- package/build/src/cli/commands/debt.js +101 -317
- package/build/src/cli/commands/report.js +11 -28
- package/build/src/cli/commands/whoami.d.ts +3 -43
- package/build/src/cli/commands/whoami.js +8 -121
- package/build/src/cli/coordinates.d.ts +4 -35
- package/build/src/cli/coordinates.js +13 -129
- package/build/src/cli/parse.d.ts +0 -6
- package/build/src/cli/parse.js +5 -48
- package/build/src/cli/render/akuma-activity.d.ts +31 -16
- package/build/src/cli/render/akuma-activity.js +157 -149
- package/build/src/cli/render/akuma-tool.d.ts +3 -6
- package/build/src/cli/render/akuma-tool.js +20 -14
- package/build/src/cli/render/akuma.d.ts +25 -26
- package/build/src/cli/render/akuma.js +100 -129
- package/build/src/cli/render/catalog.d.ts +4 -7
- package/build/src/cli/render/catalog.js +52 -99
- package/build/src/cli/render/contract-history.d.ts +3 -1
- package/build/src/cli/render/contract-history.js +140 -215
- package/build/src/cli/render/contract-observation.d.ts +43 -30
- package/build/src/cli/render/contract-observation.js +64 -31
- package/build/src/cli/render/contract-wait.js +6 -6
- package/build/src/cli/render/contract.d.ts +41 -6
- package/build/src/cli/render/contract.js +274 -370
- package/build/src/cli/render/debt.d.ts +9 -19
- package/build/src/cli/render/debt.js +120 -185
- package/build/src/cli/render/delivery-preview.d.ts +4 -3
- package/build/src/cli/render/delivery-preview.js +68 -96
- package/build/src/cli/render/kanshi-akuma.d.ts +4 -4
- package/build/src/cli/render/kanshi-akuma.js +70 -59
- package/build/src/cli/render/kanshi.d.ts +4 -4
- package/build/src/cli/render/kanshi.js +205 -221
- package/build/src/cli/render/marks.d.ts +11 -2
- package/build/src/cli/render/marks.js +13 -3
- package/build/src/cli/render/nuke.d.ts +3 -3
- package/build/src/cli/render/nuke.js +13 -16
- package/build/src/cli/render/receipt.d.ts +37 -43
- package/build/src/cli/render/receipt.js +313 -236
- package/build/src/cli/render/reconcile.d.ts +6 -4
- package/build/src/cli/render/reconcile.js +53 -137
- package/build/src/cli/render/refusal.d.ts +3 -2
- package/build/src/cli/render/refusal.js +73 -54
- package/build/src/cli/render/region.d.ts +11 -2
- package/build/src/cli/render/region.js +17 -23
- package/build/src/cli/render/settings.d.ts +0 -1
- package/build/src/cli/render/settings.js +8 -17
- package/build/src/cli/render/terminal.d.ts +2 -0
- package/build/src/cli/render/verbs.d.ts +4 -0
- package/build/src/cli/render/verbs.js +312 -0
- package/build/src/cli/render/whoami.d.ts +1 -1
- package/build/src/cli/render/whoami.js +24 -31
- package/build/src/cli/runtime.d.ts +3 -11
- package/build/src/cli/runtime.js +96 -79
- package/build/src/cli/scan.d.ts +1 -1
- package/build/src/cli/streams.js +1 -0
- package/build/src/contract-guidance.js +2 -2
- package/build/src/contract-worktree.d.ts +2 -15
- package/build/src/contract-worktree.js +19 -35
- package/build/src/core/facts/observation.d.ts +4 -5
- package/build/src/core/facts/observation.js +7 -9
- package/build/src/core/verbs/amend.d.ts +0 -1
- package/build/src/core/verbs/amend.js +3 -3
- package/build/src/core/verbs/bind.d.ts +0 -1
- package/build/src/core/verbs/bind.js +5 -5
- package/build/src/core/verbs/deliver.d.ts +3 -2
- package/build/src/core/verbs/deliver.js +2 -2
- package/build/src/core/verbs/placement.d.ts +0 -5
- package/build/src/core/verbs/placement.js +4 -6
- package/build/src/core/verbs/reintegrate.d.ts +0 -1
- package/build/src/core/verbs/reintegrate.js +2 -2
- package/build/src/debt/board.d.ts +132 -116
- package/build/src/debt/board.js +138 -94
- package/build/src/debt/catalog.d.ts +4 -4
- package/build/src/debt/catalog.js +2 -18
- package/build/src/debt/context.d.ts +15 -3
- package/build/src/debt/context.js +12 -1
- package/build/src/debt/created-observation.d.ts +5 -17
- package/build/src/debt/created-observation.js +14 -6
- package/build/src/debt/document.d.ts +20 -15
- package/build/src/debt/document.js +18 -1
- package/build/src/debt/index.d.ts +346 -23
- package/build/src/debt/index.js +68 -22
- package/build/src/debt/input.d.ts +2 -1
- package/build/src/debt/input.js +14 -0
- package/build/src/debt/lifecycle-operations.d.ts +2 -2
- package/build/src/debt/lifecycle-operations.js +14 -22
- package/build/src/debt/operation-types.d.ts +188 -66
- package/build/src/debt/operation-types.js +113 -1
- package/build/src/debt/operations.d.ts +11 -10
- package/build/src/debt/operations.js +46 -71
- package/build/src/debt/query.d.ts +14 -10
- package/build/src/debt/query.js +3 -12
- package/build/src/debt/store.d.ts +4 -2
- package/build/src/debt/store.js +8 -8
- package/build/src/debt/view.d.ts +0 -3
- package/build/src/debt/view.js +0 -4
- package/build/src/dispatch/index.d.ts +22 -5
- package/build/src/dispatch/index.js +46 -37
- package/build/src/git/admission.d.ts +2 -2
- package/build/src/git/admission.js +2 -1
- package/build/src/git/hooks.d.ts +14 -35
- package/build/src/git/hooks.js +45 -25
- package/build/src/git/integration.d.ts +6 -24
- package/build/src/git/integration.js +10 -16
- package/build/src/git/private-state-seat.d.ts +2 -2
- package/build/src/git/private-state-seat.js +2 -1
- package/build/src/git/reconcile.d.ts +17 -79
- package/build/src/git/reconcile.js +37 -52
- package/build/src/git/scratch.d.ts +3 -3
- package/build/src/git/scratch.js +4 -1
- package/build/src/git/target-placement.d.ts +23 -31
- package/build/src/git/target-placement.js +42 -27
- package/build/src/git/target.d.ts +2 -2
- package/build/src/git/target.js +2 -1
- package/build/src/git/tender.d.ts +7 -39
- package/build/src/git/tender.js +21 -54
- package/build/src/git/terminal-reconcile.js +15 -18
- package/build/src/git/terminal-seal.d.ts +2 -4
- package/build/src/git/terminal-seal.js +7 -33
- package/build/src/git/workspace.d.ts +65 -41
- package/build/src/git/workspace.js +45 -14
- package/build/src/identity/selector.d.ts +2 -0
- package/build/src/identity/selector.js +13 -3
- package/build/src/index.d.ts +48 -54
- package/build/src/index.js +31 -43
- package/build/src/kanshi/counts.d.ts +42 -8
- package/build/src/kanshi/counts.js +13 -2
- package/build/src/kanshi/index.d.ts +5 -5
- package/build/src/kanshi/index.js +4 -3
- package/build/src/kanshi/read.d.ts +489 -6
- package/build/src/kanshi/read.js +334 -483
- package/build/src/kanshi/report.d.ts +2504 -103
- package/build/src/kanshi/report.js +165 -1
- package/build/src/kanshi/select.d.ts +0 -8
- package/build/src/kanshi/select.js +20 -59
- package/build/src/library/address.d.ts +8 -8
- package/build/src/library/address.js +7 -7
- package/build/src/library/akuma-creation.d.ts +690 -84
- package/build/src/library/akuma-creation.js +202 -142
- package/build/src/library/akuma-retention.d.ts +2 -2
- package/build/src/library/akuma-retention.js +2 -2
- package/build/src/library/akumas.d.ts +10 -6
- package/build/src/library/akumas.js +24 -7
- package/build/src/library/bind.d.ts +28 -54
- package/build/src/library/bind.js +6 -4
- package/build/src/library/continuation.d.ts +197 -479
- package/build/src/library/continuation.js +40 -23
- package/build/src/library/contract-address.d.ts +6 -5
- package/build/src/library/contract-address.js +5 -7
- package/build/src/library/contract-composition.d.ts +18 -12
- package/build/src/library/contract-composition.js +55 -47
- package/build/src/library/contract-creation.d.ts +3 -2
- package/build/src/library/contract-creation.js +38 -32
- package/build/src/library/contract-execution.js +77 -38
- package/build/src/library/contract-outcomes.d.ts +1877 -27
- package/build/src/library/contract-outcomes.js +93 -10
- package/build/src/library/contract-settings.d.ts +2 -2
- package/build/src/library/contract-settings.js +18 -14
- package/build/src/library/contract-types.d.ts +238 -61
- package/build/src/library/contract-types.js +131 -1
- package/build/src/library/contract-wait.d.ts +38 -17
- package/build/src/library/contract-wait.js +40 -10
- package/build/src/library/delivery.d.ts +588 -36
- package/build/src/library/delivery.js +35 -27
- package/build/src/library/input.d.ts +1 -1
- package/build/src/library/input.js +1 -2
- package/build/src/library/invocation.d.ts +11 -7
- package/build/src/library/invocation.js +42 -51
- package/build/src/library/kei.d.ts +48 -0
- package/build/src/library/kei.js +256 -0
- package/build/src/library/keiyaku-attribution.d.ts +11 -0
- package/build/src/{cli/delivery-identity.js → library/keiyaku-attribution.js} +12 -1
- package/build/src/library/keiyaku-classify.d.ts +11 -0
- package/build/src/library/keiyaku-classify.js +146 -0
- package/build/src/library/keiyaku-coordinates.d.ts +31 -0
- package/build/src/library/keiyaku-coordinates.js +103 -0
- package/build/src/library/keiyaku-debt.d.ts +142 -0
- package/build/src/library/keiyaku-debt.js +188 -0
- package/build/src/library/keiyaku-identity.d.ts +58 -0
- package/build/src/library/keiyaku-identity.js +176 -0
- package/build/src/library/keiyaku-policy.d.ts +27 -0
- package/build/src/library/keiyaku-policy.js +44 -0
- package/build/src/library/keiyaku-status.d.ts +1487 -0
- package/build/src/library/keiyaku-status.js +92 -0
- package/build/src/library/keiyaku-verbs.d.ts +6774 -0
- package/build/src/library/keiyaku-verbs.js +458 -0
- package/build/src/library/keiyaku.d.ts +871 -38
- package/build/src/library/keiyaku.js +677 -127
- package/build/src/library/nuke.d.ts +22 -0
- package/build/src/library/nuke.js +4 -1
- package/build/src/library/outcome.d.ts +706 -692
- package/build/src/library/outcome.js +582 -167
- package/build/src/library/reconcile.d.ts +464 -116
- package/build/src/library/reconcile.js +174 -102
- package/build/src/library/refusal.d.ts +113 -577
- package/build/src/library/refusal.js +64 -51
- package/build/src/library/region.d.ts +5 -24
- package/build/src/library/region.js +6 -21
- package/build/src/library/selection.d.ts +181 -32
- package/build/src/library/selection.js +99 -64
- package/build/src/mcp/adapter.d.ts +11 -0
- package/build/src/mcp/adapter.js +106 -0
- package/build/src/mcp/help.d.ts +1 -0
- package/build/src/mcp/help.js +26 -0
- package/build/src/mcp/index.d.ts +2 -0
- package/build/src/mcp/index.js +37 -0
- package/build/src/plugin/public.d.ts +1 -1
- package/build/src/plugin/runtime.js +17 -14
- package/build/src/protocol/arc.d.ts +4 -1
- package/build/src/protocol/arc.js +7 -1
- package/build/src/protocol/attempt.d.ts +2 -3
- package/build/src/protocol/attempt.js +1 -10
- package/build/src/protocol/bind.d.ts +6 -7
- package/build/src/protocol/bind.js +9 -5
- package/build/src/protocol/completion.d.ts +448 -12
- package/build/src/protocol/completion.js +164 -26
- package/build/src/protocol/deliver.d.ts +26 -24
- package/build/src/protocol/deliver.js +24 -52
- package/build/src/protocol/delivery-preview.d.ts +97 -247
- package/build/src/protocol/delivery-preview.js +132 -128
- package/build/src/protocol/execution-observation.d.ts +146 -123
- package/build/src/protocol/execution-observation.js +9 -6
- package/build/src/protocol/intent.d.ts +9 -48
- package/build/src/protocol/intent.js +32 -46
- package/build/src/protocol/operations.d.ts +207 -505
- package/build/src/protocol/operations.js +81 -134
- package/build/src/protocol/placement.d.ts +0 -1
- package/build/src/protocol/placement.js +5 -2
- package/build/src/protocol/progress.d.ts +7 -97
- package/build/src/protocol/progress.js +7 -55
- package/build/src/protocol/read/observation.d.ts +13 -6
- package/build/src/protocol/read/observation.js +10 -9
- package/build/src/protocol/read/status.d.ts +464 -93
- package/build/src/protocol/read/status.js +372 -85
- package/build/src/protocol/reconcile.d.ts +2 -0
- package/build/src/protocol/reconcile.js +12 -11
- package/build/src/protocol/reintegrate.d.ts +0 -1
- package/build/src/protocol/reintegrate.js +4 -4
- package/build/src/protocol/result-leaves.d.ts +528 -0
- package/build/src/protocol/result-leaves.js +195 -0
- package/build/src/protocol/result-reasons.d.ts +129 -0
- package/build/src/protocol/result-reasons.js +87 -0
- package/build/src/protocol/review.d.ts +14 -11
- package/build/src/protocol/review.js +30 -14
- package/build/src/protocol/run.d.ts +4 -4
- package/build/src/protocol/run.js +4 -1
- package/build/src/protocol/verify.d.ts +359 -30
- package/build/src/protocol/verify.js +118 -28
- package/build/src/region.d.ts +26 -0
- package/build/src/region.js +28 -0
- package/build/src/runtime/proc/diagnostic.d.ts +11 -0
- package/build/src/runtime/proc/diagnostic.js +20 -0
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settings.d.ts +126 -32
- package/build/src/settings.js +107 -34
- package/build/src/settlement/settle.d.ts +29 -12
- package/build/src/settlement/settle.js +22 -15
- package/build/src/verification/declaration.d.ts +1 -3
- package/build/src/verification/declaration.js +2 -5
- package/build/src/verification/execution.d.ts +7 -19
- package/build/src/verification/execution.js +37 -16
- package/build/src/verification/observation.d.ts +13 -13
- package/build/src/verification/observation.js +9 -7
- package/build/src/world.d.ts +8 -0
- package/build/src/world.js +7 -0
- package/package.json +6 -5
- package/plugins/paseo/plugin/server/keiyaku.ts +13 -46
- package/plugins/paseo/plugin/server/message.ts +8 -30
- package/plugins/paseo/plugin/server/mirror.ts +16 -20
- package/plugins/paseo/plugin/server/provider.ts +1 -1
- package/plugins/paseo/plugin/server/sdk.ts +14 -6
- package/plugins/pi/README.md +5 -5
- package/plugins/pi/akuma-tools.ts +17 -23
- package/skills/keiyaku/SKILL.md +12 -12
- package/skills/keiyaku-akuma/SKILL.md +16 -16
- package/skills/keiyaku-akuma/references/automation.md +14 -14
- package/skills/keiyaku-babysit/SKILL.md +10 -10
- package/skills/keiyaku-bind/SKILL.md +15 -15
- package/skills/keiyaku-debt/SKILL.md +16 -16
- package/skills/keiyaku-workflow/SKILL.md +21 -21
- package/build/src/cli/actor.d.ts +0 -10
- package/build/src/cli/actor.js +0 -24
- package/build/src/cli/akuma-caller.d.ts +0 -3
- package/build/src/cli/akuma-caller.js +0 -31
- package/build/src/cli/delivery-identity.d.ts +0 -3
- package/build/src/cli/render/effects.d.ts +0 -26
- package/build/src/cli/render/effects.js +0 -41
- package/build/src/cli/selectors.d.ts +0 -10
- package/build/src/cli/selectors.js +0 -42
- package/build/src/markdown/diff.d.ts +0 -1
- package/build/src/markdown/diff.js +0 -4
|
@@ -1,44 +1,367 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { debtRefSchema, blockedDebtRowSchema, readyDebtRowSchema, debtTreeRootSchema, debtTreeNodeSchema, debtDoctorIssueSchema, debtSummarySchema, debtDispositionSchema, debtDetailSchema, type BlockedDebtRow, type DebtDetail, type DebtDoctorIssue, type DebtRef, type DebtSummary, type DebtTreeNode, type DebtTreeRoot, type ReadyDebtRow } from "./board.js";
|
|
3
|
+
import { debtWarningSchema, debtRefusalSchema, debtRetrySchema, debtReadRefusalSchema, debtReadPageSchema, debtParentReadRefusalSchema, debtLifecycleResultSchema, debtMutationResultSchema, debtUpdateResultSchema, debtBatchResultSchema, debtChangeSchema, type DebtWarning, type DebtRefusal, type DebtRetry, type DebtReadRefusal, type DebtReadPage, type DebtMutationResult, type DebtLifecycleResult, type DebtParentReadRefusal, type DebtUpdateResult, type DebtBatchResult, type DebtBatchItem, type DebtChange } from "./operation-types.js";
|
|
4
|
+
import { debtQueryRowSchema, type DebtQueryRow } from "./query.js";
|
|
1
5
|
import type { WorldRoot } from "../world.js";
|
|
2
|
-
import type
|
|
6
|
+
import { resolvedNamespaceContextSchema, type NamespaceContextSource, type ResolvedNamespaceContext } from "./context.js";
|
|
3
7
|
export type { WorldRoot } from "../world.js";
|
|
4
|
-
import { type BlockedDebtRow, type DebtDetailFacts, type DebtDoctorIssue, type DebtRef, type DebtRow, type DebtTreeNode } from "./board.js";
|
|
5
8
|
import { DebtAuthorityCorruptionError, type DebtPriority, type DebtState } from "./document.js";
|
|
6
|
-
import type
|
|
7
|
-
import { type AddDebtDocumentInput, type AddDebtInput, type
|
|
8
|
-
import { DEBT_RELATION_PREDICATE_FIELDS, type
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
export type
|
|
13
|
-
export
|
|
14
|
-
|
|
9
|
+
import { type DebtId } from "./identity.js";
|
|
10
|
+
import { type AddDebtDocumentInput, type AddDebtInput, type UpdateDebtInput } from "./operations.js";
|
|
11
|
+
import { DEBT_RELATION_PREDICATE_FIELDS, type DebtQueryExpression, type DebtQueryPredicate, type DebtQuerySort, type DebtRelationPredicateField } from "./query.js";
|
|
12
|
+
export declare const debtAbsentSchema: z.ZodReadonly<z.ZodObject<{
|
|
13
|
+
kind: z.ZodLiteral<"absent">;
|
|
14
|
+
}, z.core.$strict>>;
|
|
15
|
+
export type DebtAbsent = z.output<typeof debtAbsentSchema>;
|
|
16
|
+
export declare const debtReadResultSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
17
|
+
title: z.ZodString;
|
|
18
|
+
state: z.ZodEnum<{
|
|
19
|
+
open: "open";
|
|
20
|
+
drop: "drop";
|
|
21
|
+
done: "done";
|
|
22
|
+
}>;
|
|
23
|
+
priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
24
|
+
createdAt: z.ZodString;
|
|
25
|
+
updatedAt: z.ZodString;
|
|
26
|
+
body: z.ZodExactOptional<z.ZodString>;
|
|
27
|
+
note: z.ZodExactOptional<z.ZodString>;
|
|
28
|
+
createdBy: z.ZodExactOptional<z.ZodString>;
|
|
29
|
+
needs: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
30
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
31
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
32
|
+
open: "open";
|
|
33
|
+
drop: "drop";
|
|
34
|
+
done: "done";
|
|
35
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
36
|
+
}, z.core.$strict>>>>>;
|
|
37
|
+
parent: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
|
|
38
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
39
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
40
|
+
open: "open";
|
|
41
|
+
drop: "drop";
|
|
42
|
+
done: "done";
|
|
43
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
44
|
+
}, z.core.$strict>>>;
|
|
45
|
+
supersedes: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
46
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
47
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
48
|
+
open: "open";
|
|
49
|
+
drop: "drop";
|
|
50
|
+
done: "done";
|
|
51
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
52
|
+
}, z.core.$strict>>>>>;
|
|
53
|
+
relates: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
54
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
55
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
56
|
+
open: "open";
|
|
57
|
+
drop: "drop";
|
|
58
|
+
done: "done";
|
|
59
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
60
|
+
}, z.core.$strict>>>>>;
|
|
61
|
+
kind: z.ZodLiteral<"present">;
|
|
62
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
63
|
+
kind: z.ZodLiteral<"missing">;
|
|
64
|
+
}, z.core.$strict>>]>;
|
|
65
|
+
export type DebtReadResult = z.output<typeof debtReadResultSchema>;
|
|
66
|
+
export declare const debtShowItemSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
67
|
+
title: z.ZodString;
|
|
68
|
+
state: z.ZodEnum<{
|
|
69
|
+
open: "open";
|
|
70
|
+
drop: "drop";
|
|
71
|
+
done: "done";
|
|
72
|
+
}>;
|
|
73
|
+
priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
74
|
+
createdAt: z.ZodString;
|
|
75
|
+
updatedAt: z.ZodString;
|
|
76
|
+
body: z.ZodExactOptional<z.ZodString>;
|
|
77
|
+
note: z.ZodExactOptional<z.ZodString>;
|
|
78
|
+
createdBy: z.ZodExactOptional<z.ZodString>;
|
|
79
|
+
needs: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
80
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
81
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
82
|
+
open: "open";
|
|
83
|
+
drop: "drop";
|
|
84
|
+
done: "done";
|
|
85
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
86
|
+
}, z.core.$strict>>>>>;
|
|
87
|
+
parent: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
|
|
88
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
89
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
90
|
+
open: "open";
|
|
91
|
+
drop: "drop";
|
|
92
|
+
done: "done";
|
|
93
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
94
|
+
}, z.core.$strict>>>;
|
|
95
|
+
supersedes: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
96
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
97
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
98
|
+
open: "open";
|
|
99
|
+
drop: "drop";
|
|
100
|
+
done: "done";
|
|
101
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
102
|
+
}, z.core.$strict>>>>>;
|
|
103
|
+
relates: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
104
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
105
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
106
|
+
open: "open";
|
|
107
|
+
drop: "drop";
|
|
108
|
+
done: "done";
|
|
109
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
110
|
+
}, z.core.$strict>>>>>;
|
|
111
|
+
kind: z.ZodLiteral<"found">;
|
|
112
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
113
|
+
kind: z.ZodLiteral<"missing">;
|
|
114
|
+
}, z.core.$strict>>]>;
|
|
115
|
+
export type DebtShowItem = z.output<typeof debtShowItemSchema>;
|
|
116
|
+
export declare const debtShowResultSchema: z.ZodReadonly<z.ZodObject<{
|
|
117
|
+
kind: z.ZodLiteral<"present">;
|
|
118
|
+
items: z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
119
|
+
title: z.ZodString;
|
|
120
|
+
state: z.ZodEnum<{
|
|
121
|
+
open: "open";
|
|
122
|
+
drop: "drop";
|
|
123
|
+
done: "done";
|
|
124
|
+
}>;
|
|
125
|
+
priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
126
|
+
createdAt: z.ZodString;
|
|
127
|
+
updatedAt: z.ZodString;
|
|
128
|
+
body: z.ZodExactOptional<z.ZodString>;
|
|
129
|
+
note: z.ZodExactOptional<z.ZodString>;
|
|
130
|
+
createdBy: z.ZodExactOptional<z.ZodString>;
|
|
131
|
+
needs: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
132
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
133
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
134
|
+
open: "open";
|
|
135
|
+
drop: "drop";
|
|
136
|
+
done: "done";
|
|
137
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
138
|
+
}, z.core.$strict>>>>>;
|
|
139
|
+
parent: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
|
|
140
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
141
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
142
|
+
open: "open";
|
|
143
|
+
drop: "drop";
|
|
144
|
+
done: "done";
|
|
145
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
146
|
+
}, z.core.$strict>>>;
|
|
147
|
+
supersedes: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
148
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
149
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
150
|
+
open: "open";
|
|
151
|
+
drop: "drop";
|
|
152
|
+
done: "done";
|
|
153
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
154
|
+
}, z.core.$strict>>>>>;
|
|
155
|
+
relates: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
156
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
157
|
+
state: z.ZodUnion<readonly [z.ZodEnum<{
|
|
158
|
+
open: "open";
|
|
159
|
+
drop: "drop";
|
|
160
|
+
done: "done";
|
|
161
|
+
}>, z.ZodLiteral<"missing">]>;
|
|
162
|
+
}, z.core.$strict>>>>>;
|
|
163
|
+
kind: z.ZodLiteral<"found">;
|
|
164
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
165
|
+
kind: z.ZodLiteral<"missing">;
|
|
166
|
+
}, z.core.$strict>>]>>>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
export type DebtShowResult = z.output<typeof debtShowResultSchema>;
|
|
169
|
+
export declare const debtTreeResultSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
170
|
+
children: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodType<DebtTreeNode, unknown, z.core.$ZodTypeInternals<DebtTreeNode, unknown>>>>>;
|
|
171
|
+
title: z.ZodString;
|
|
172
|
+
state: z.ZodEnum<{
|
|
173
|
+
open: "open";
|
|
174
|
+
drop: "drop";
|
|
175
|
+
done: "done";
|
|
176
|
+
}>;
|
|
177
|
+
priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
178
|
+
kind: z.ZodLiteral<"present">;
|
|
179
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
180
|
+
kind: z.ZodLiteral<"missing">;
|
|
181
|
+
}, z.core.$strict>>]>;
|
|
182
|
+
export type DebtTreeResult = z.output<typeof debtTreeResultSchema>;
|
|
183
|
+
export declare const debtDoctorReportSchema: z.ZodReadonly<z.ZodObject<{
|
|
184
|
+
kind: z.ZodLiteral<"present">;
|
|
185
|
+
issues: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
186
|
+
kind: z.ZodLiteral<"missing-target">;
|
|
187
|
+
debtId: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
188
|
+
relation: z.ZodEnum<{
|
|
189
|
+
parent: "parent";
|
|
190
|
+
needs: "needs";
|
|
191
|
+
supersedes: "supersedes";
|
|
192
|
+
relates: "relates";
|
|
193
|
+
}>;
|
|
194
|
+
target: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
195
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
196
|
+
kind: z.ZodLiteral<"self-relation">;
|
|
197
|
+
debtId: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
198
|
+
relation: z.ZodEnum<{
|
|
199
|
+
parent: "parent";
|
|
200
|
+
needs: "needs";
|
|
201
|
+
supersedes: "supersedes";
|
|
202
|
+
relates: "relates";
|
|
203
|
+
}>;
|
|
204
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
205
|
+
kind: z.ZodLiteral<"cycle">;
|
|
206
|
+
relation: z.ZodEnum<{
|
|
207
|
+
parent: "parent";
|
|
208
|
+
needs: "needs";
|
|
209
|
+
supersedes: "supersedes";
|
|
210
|
+
}>;
|
|
211
|
+
debts: z.ZodReadonly<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>>>;
|
|
212
|
+
}, z.core.$strict>>]>>>>;
|
|
213
|
+
}, z.core.$strict>>;
|
|
214
|
+
export type DebtDoctorReport = z.output<typeof debtDoctorReportSchema>;
|
|
215
|
+
export declare const debtContextRefusalSchema: z.ZodReadonly<z.ZodObject<{
|
|
216
|
+
kind: z.ZodLiteral<"refused">;
|
|
217
|
+
path: z.ZodString;
|
|
218
|
+
}, z.core.$strict>>;
|
|
219
|
+
export type DebtContextRefusal = z.output<typeof debtContextRefusalSchema>;
|
|
220
|
+
export declare const debtContextResultSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
221
|
+
kind: z.ZodLiteral<"present">;
|
|
222
|
+
source: z.ZodLiteral<"default-root">;
|
|
223
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
224
|
+
kind: z.ZodLiteral<"present">;
|
|
225
|
+
source: z.ZodEnum<{
|
|
226
|
+
"contract-installed": "contract-installed";
|
|
227
|
+
"local-override": "local-override";
|
|
228
|
+
}>;
|
|
229
|
+
namespace: z.ZodExactOptional<z.ZodString>;
|
|
230
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
231
|
+
kind: z.ZodLiteral<"refused">;
|
|
232
|
+
path: z.ZodString;
|
|
233
|
+
}, z.core.$strict>>]>;
|
|
234
|
+
export type DebtContextResult = z.output<typeof debtContextResultSchema>;
|
|
235
|
+
export declare const debtListSchema: z.ZodReadonly<z.ZodObject<{
|
|
236
|
+
kind: z.ZodLiteral<"present">;
|
|
237
|
+
rows: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
238
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
239
|
+
title: z.ZodString;
|
|
240
|
+
priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
241
|
+
disposition: z.ZodEnum<{
|
|
242
|
+
drop: "drop";
|
|
243
|
+
blocked: "blocked";
|
|
244
|
+
ready: "ready";
|
|
245
|
+
done: "done";
|
|
246
|
+
}>;
|
|
247
|
+
}, z.core.$strict>>>>>;
|
|
248
|
+
more: z.ZodExactOptional<z.ZodLiteral<true>>;
|
|
249
|
+
}, z.core.$strict>>;
|
|
250
|
+
export declare const debtReadyListSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
251
|
+
kind: z.ZodLiteral<"present">;
|
|
252
|
+
rows: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
253
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
254
|
+
title: z.ZodString;
|
|
255
|
+
priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
256
|
+
}, z.core.$strict>>>>>;
|
|
257
|
+
more: z.ZodExactOptional<z.ZodLiteral<true>>;
|
|
258
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
259
|
+
kind: z.ZodLiteral<"absent">;
|
|
260
|
+
}, z.core.$strict>>, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
261
|
+
kind: z.ZodLiteral<"refused">;
|
|
262
|
+
reason: z.ZodLiteral<"debt-missing">;
|
|
263
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
264
|
+
kind: z.ZodLiteral<"refused">;
|
|
265
|
+
reason: z.ZodLiteral<"invalid-namespace-context">;
|
|
266
|
+
path: z.ZodString;
|
|
267
|
+
}, z.core.$strict>>]>]>;
|
|
268
|
+
export declare const blockedDebtListSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
269
|
+
kind: z.ZodLiteral<"present">;
|
|
270
|
+
rows: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
271
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
272
|
+
title: z.ZodString;
|
|
273
|
+
priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
274
|
+
blockers: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
275
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
276
|
+
missing: z.ZodExactOptional<z.ZodLiteral<true>>;
|
|
277
|
+
}, z.core.$strict>>>>;
|
|
278
|
+
}, z.core.$strict>>>>>;
|
|
279
|
+
more: z.ZodExactOptional<z.ZodLiteral<true>>;
|
|
280
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
281
|
+
kind: z.ZodLiteral<"absent">;
|
|
282
|
+
}, z.core.$strict>>, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
283
|
+
kind: z.ZodLiteral<"refused">;
|
|
284
|
+
reason: z.ZodLiteral<"debt-missing">;
|
|
285
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
286
|
+
kind: z.ZodLiteral<"refused">;
|
|
287
|
+
reason: z.ZodLiteral<"invalid-namespace-context">;
|
|
288
|
+
path: z.ZodString;
|
|
289
|
+
}, z.core.$strict>>]>]>;
|
|
290
|
+
export declare const debtQueryResultSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
291
|
+
kind: z.ZodLiteral<"present">;
|
|
292
|
+
rows: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
293
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
294
|
+
title: z.ZodString;
|
|
295
|
+
priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
296
|
+
disposition: z.ZodEnum<{
|
|
297
|
+
drop: "drop";
|
|
298
|
+
blocked: "blocked";
|
|
299
|
+
ready: "ready";
|
|
300
|
+
done: "done";
|
|
301
|
+
}>;
|
|
302
|
+
}, z.core.$strict>>>>>;
|
|
303
|
+
more: z.ZodExactOptional<z.ZodLiteral<true>>;
|
|
304
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
305
|
+
kind: z.ZodLiteral<"absent">;
|
|
306
|
+
}, z.core.$strict>>, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
307
|
+
kind: z.ZodLiteral<"refused">;
|
|
308
|
+
reason: z.ZodLiteral<"debt-missing">;
|
|
309
|
+
debtId: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
310
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
311
|
+
kind: z.ZodLiteral<"refused">;
|
|
312
|
+
reason: z.ZodLiteral<"invalid-namespace-context">;
|
|
313
|
+
path: z.ZodString;
|
|
314
|
+
}, z.core.$strict>>]>]>;
|
|
315
|
+
export declare const debtCatalogueSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
316
|
+
kind: z.ZodLiteral<"present">;
|
|
317
|
+
rows: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
318
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<`debt/${string}`, string>>;
|
|
319
|
+
title: z.ZodString;
|
|
320
|
+
priority: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>;
|
|
321
|
+
disposition: z.ZodEnum<{
|
|
322
|
+
drop: "drop";
|
|
323
|
+
blocked: "blocked";
|
|
324
|
+
ready: "ready";
|
|
325
|
+
done: "done";
|
|
326
|
+
}>;
|
|
327
|
+
}, z.core.$strict>>>>>;
|
|
328
|
+
more: z.ZodExactOptional<z.ZodLiteral<true>>;
|
|
329
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
330
|
+
kind: z.ZodLiteral<"absent">;
|
|
331
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
332
|
+
kind: z.ZodLiteral<"invalid-namespace-context">;
|
|
333
|
+
path: z.ZodString;
|
|
334
|
+
}, z.core.$strict>>]>;
|
|
335
|
+
export type DebtCatalogue = z.output<typeof debtCatalogueSchema>;
|
|
336
|
+
export type DebtList = z.output<typeof debtListSchema>;
|
|
337
|
+
export type DebtReadyList = DebtReadPage<ReadyDebtRow, DebtParentReadRefusal>;
|
|
338
|
+
export type BlockedDebtList = DebtReadPage<BlockedDebtRow, DebtParentReadRefusal>;
|
|
339
|
+
export type DebtQueryResult = DebtReadPage<DebtQueryRow>;
|
|
15
340
|
export type DebtContextSource = NamespaceContextSource;
|
|
16
341
|
export type { ResolvedNamespaceContext };
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
export type DebtDecompositionTree = DebtOutcome<DebtTreeNode>;
|
|
22
|
-
export type { AddDebtDocumentInput, AddDebtInput, BlockedDebtRow, DebtBatchResult, DebtCleanupFailure, DebtDoctorIssue, DebtId, DebtMutationResult, DebtOutcome, DebtPriority, DebtRef, DebtRefusal, DebtRetry, DebtRow, DebtState, DebtTreeNode, DebtUpdateResult, DebtView, UpdateDebtInput, DebtPage, DebtQueryExpression, DebtQueryPredicate, DebtQueryRow, DebtQuerySort, DebtRelationPredicateField, };
|
|
342
|
+
export { resolvedNamespaceContextSchema };
|
|
343
|
+
export { debtWarningSchema, debtRefusalSchema, debtRetrySchema, debtReadRefusalSchema, debtReadPageSchema };
|
|
344
|
+
export { debtLifecycleResultSchema, debtParentReadRefusalSchema, readyDebtRowSchema, debtTreeRootSchema, debtMutationResultSchema, debtUpdateResultSchema, debtBatchResultSchema, debtChangeSchema, debtDetailSchema, debtSummarySchema, debtDispositionSchema, blockedDebtRowSchema, debtRefSchema, debtQueryRowSchema, debtTreeNodeSchema, debtDoctorIssueSchema, };
|
|
345
|
+
export type { AddDebtDocumentInput, AddDebtInput, BlockedDebtRow, DebtBatchItem, DebtBatchResult, DebtChange, DebtDetail, DebtDoctorIssue, DebtId, DebtMutationResult, DebtPriority, DebtReadPage, DebtReadRefusal, DebtRef, DebtRefusal, DebtRetry, DebtState, DebtSummary, DebtTreeNode, DebtTreeRoot, ReadyDebtRow, DebtLifecycleResult, DebtParentReadRefusal, DebtUpdateResult, DebtWarning, UpdateDebtInput, DebtQueryExpression, DebtQueryPredicate, DebtQueryRow, DebtQuerySort, DebtRelationPredicateField, };
|
|
23
346
|
export { DebtAuthorityCorruptionError, DEBT_RELATION_PREDICATE_FIELDS };
|
|
24
|
-
export { observeRecentDebtStatus, type
|
|
347
|
+
export { observeRecentDebtStatus, type RecentDebtSummary } from "./catalog.js";
|
|
25
348
|
export { boundedListLimit as debtRowViewLimit } from "../bounded-list.js";
|
|
26
349
|
declare class DebtHandle {
|
|
27
350
|
readonly id: DebtId;
|
|
28
351
|
private readonly world;
|
|
29
352
|
constructor(id: DebtId, world: WorldRoot);
|
|
30
|
-
read(): Promise<
|
|
31
|
-
tree(): Promise<
|
|
353
|
+
read(): Promise<DebtReadResult>;
|
|
354
|
+
tree(): Promise<DebtTreeResult>;
|
|
32
355
|
update(input: UpdateDebtInput): Promise<DebtUpdateResult>;
|
|
33
356
|
private lifecycle;
|
|
34
357
|
done(input?: {
|
|
35
358
|
note?: string;
|
|
36
359
|
signal?: AbortSignal;
|
|
37
|
-
}): Promise<
|
|
360
|
+
}): Promise<DebtLifecycleResult>;
|
|
38
361
|
drop(input?: {
|
|
39
362
|
note?: string;
|
|
40
363
|
signal?: AbortSignal;
|
|
41
|
-
}): Promise<
|
|
364
|
+
}): Promise<DebtLifecycleResult>;
|
|
42
365
|
}
|
|
43
366
|
export type Debt = DebtHandle;
|
|
44
367
|
declare class DebtsHandle {
|
|
@@ -61,7 +384,7 @@ declare class DebtsHandle {
|
|
|
61
384
|
namespace?: readonly string[];
|
|
62
385
|
parent?: string;
|
|
63
386
|
limit?: number;
|
|
64
|
-
}>): Promise<
|
|
387
|
+
}>): Promise<DebtReadyList>;
|
|
65
388
|
blocked(input?: Readonly<{
|
|
66
389
|
scope?: "namespace" | "world";
|
|
67
390
|
namespace?: readonly string[];
|
package/build/src/debt/index.js
CHANGED
|
@@ -1,10 +1,68 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { debtRefSchema, blockedDebtRowSchema, readyDebtRowSchema, debtTreeRootSchema, debtTreeNodeSchema, debtDoctorIssueSchema, debtSummarySchema, debtDispositionSchema, debtDetailSchema, buildTree, createDebtRelations, diagnoseBoard, } from "./board.js";
|
|
3
|
+
import { debtWarningSchema, debtRefusalSchema, debtRetrySchema, debtReadRefusalSchema, debtReadPageSchema, debtParentReadRefusalSchema, nonEmptyDebtValues, nonEmptyDebtArraySchema, debtLifecycleResultSchema, debtMutationResultSchema, debtUpdateResultSchema, debtBatchResultSchema, debtChangeSchema, } from "./operation-types.js";
|
|
4
|
+
import { debtQueryRowSchema } from "./query.js";
|
|
5
|
+
import { resolvedNamespaceContextSchema, } from "./context.js";
|
|
2
6
|
import { DebtAuthorityCorruptionError } from "./document.js";
|
|
3
|
-
import { addDebt, addDebtDocument, batchDebts, blockedDebts, lifecycleDebt, listDebts, queryDebts, readDebtDetail, readyDebts,
|
|
7
|
+
import { addDebt, addDebtDocument, batchDebts, blockedDebts, lifecycleDebt, listDebts, queryDebts, readDebtDetail, readyDebts, updateDebt, } from "./operations.js";
|
|
4
8
|
import { boundedListLimit } from "../bounded-list.js";
|
|
5
9
|
import { readBoard } from "./store.js";
|
|
6
|
-
import {
|
|
10
|
+
import { addDocumentInput, addInput, closed, namespace, record, signal, sort, debtId as id, debtIds, text, updateInput, } from "./input.js";
|
|
7
11
|
import { normalizeDebtQuery, debtQuerySelection, DEBT_RELATION_PREDICATE_FIELDS, } from "./query.js";
|
|
12
|
+
export const debtAbsentSchema = z.strictObject({ kind: z.literal("absent") }).readonly();
|
|
13
|
+
export const debtReadResultSchema = z.union([
|
|
14
|
+
z.strictObject({ kind: z.literal("present"), ...debtDetailSchema.unwrap().shape }).readonly(),
|
|
15
|
+
z.strictObject({ kind: z.literal("missing") }).readonly(),
|
|
16
|
+
]);
|
|
17
|
+
export const debtShowItemSchema = z.union([
|
|
18
|
+
z.strictObject({ kind: z.literal("found"), ...debtDetailSchema.unwrap().shape }).readonly(),
|
|
19
|
+
z.strictObject({ kind: z.literal("missing") }).readonly(),
|
|
20
|
+
]);
|
|
21
|
+
export const debtShowResultSchema = z
|
|
22
|
+
.strictObject({ kind: z.literal("present"), items: nonEmptyDebtArraySchema(debtShowItemSchema) })
|
|
23
|
+
.readonly();
|
|
24
|
+
export const debtTreeResultSchema = z.union([
|
|
25
|
+
z.strictObject({ kind: z.literal("present"), ...debtTreeRootSchema.unwrap().shape }).readonly(),
|
|
26
|
+
z.strictObject({ kind: z.literal("missing") }).readonly(),
|
|
27
|
+
]);
|
|
28
|
+
export const debtDoctorReportSchema = z
|
|
29
|
+
.strictObject({
|
|
30
|
+
kind: z.literal("present"),
|
|
31
|
+
issues: nonEmptyDebtArraySchema(debtDoctorIssueSchema).exactOptional(),
|
|
32
|
+
})
|
|
33
|
+
.readonly();
|
|
34
|
+
export const debtContextRefusalSchema = z.strictObject({ kind: z.literal("refused"), path: z.string() }).readonly();
|
|
35
|
+
export const debtContextResultSchema = z.union([
|
|
36
|
+
z.strictObject({ kind: z.literal("present"), source: z.literal("default-root") }).readonly(),
|
|
37
|
+
z
|
|
38
|
+
.strictObject({
|
|
39
|
+
kind: z.literal("present"),
|
|
40
|
+
source: z.enum(["contract-installed", "local-override"]),
|
|
41
|
+
namespace: z.string().min(1).exactOptional(),
|
|
42
|
+
})
|
|
43
|
+
.readonly(),
|
|
44
|
+
debtContextRefusalSchema,
|
|
45
|
+
]);
|
|
46
|
+
export const debtListSchema = debtReadPageSchema(debtSummarySchema).options[0];
|
|
47
|
+
export const debtReadyListSchema = z.union([
|
|
48
|
+
debtReadPageSchema(readyDebtRowSchema).options[0],
|
|
49
|
+
debtAbsentSchema,
|
|
50
|
+
debtParentReadRefusalSchema,
|
|
51
|
+
]);
|
|
52
|
+
export const blockedDebtListSchema = z.union([
|
|
53
|
+
debtReadPageSchema(blockedDebtRowSchema).options[0],
|
|
54
|
+
debtAbsentSchema,
|
|
55
|
+
debtParentReadRefusalSchema,
|
|
56
|
+
]);
|
|
57
|
+
export const debtQueryResultSchema = debtReadPageSchema(debtQueryRowSchema);
|
|
58
|
+
export const debtCatalogueSchema = z.union([
|
|
59
|
+
debtListSchema,
|
|
60
|
+
debtAbsentSchema,
|
|
61
|
+
z.strictObject({ kind: z.literal("invalid-namespace-context"), path: z.string() }).readonly(),
|
|
62
|
+
]);
|
|
63
|
+
export { resolvedNamespaceContextSchema };
|
|
64
|
+
export { debtWarningSchema, debtRefusalSchema, debtRetrySchema, debtReadRefusalSchema, debtReadPageSchema };
|
|
65
|
+
export { debtLifecycleResultSchema, debtParentReadRefusalSchema, readyDebtRowSchema, debtTreeRootSchema, debtMutationResultSchema, debtUpdateResultSchema, debtBatchResultSchema, debtChangeSchema, debtDetailSchema, debtSummarySchema, debtDispositionSchema, blockedDebtRowSchema, debtRefSchema, debtQueryRowSchema, debtTreeNodeSchema, debtDoctorIssueSchema, };
|
|
8
66
|
export { DebtAuthorityCorruptionError, DEBT_RELATION_PREDICATE_FIELDS };
|
|
9
67
|
export { observeRecentDebtStatus } from "./catalog.js";
|
|
10
68
|
export { boundedListLimit as debtRowViewLimit } from "../bounded-list.js";
|
|
@@ -16,17 +74,15 @@ class DebtHandle {
|
|
|
16
74
|
this.world = world;
|
|
17
75
|
}
|
|
18
76
|
async read() {
|
|
19
|
-
const
|
|
20
|
-
return
|
|
77
|
+
const debt = await readDebtDetail(this.world, this.id);
|
|
78
|
+
return debt === null ? { kind: "missing" } : { kind: "present", ...debt };
|
|
21
79
|
}
|
|
22
80
|
async tree() {
|
|
23
81
|
if (arguments.length > 0)
|
|
24
82
|
throw new TypeError("tree accepts no input");
|
|
25
83
|
const board = (await readBoard(this.world)).board;
|
|
26
|
-
const
|
|
27
|
-
return
|
|
28
|
-
? { kind: "refused", refusal: { kind: "debt-missing", debtId: this.id } }
|
|
29
|
-
: { kind: "accepted", value: node };
|
|
84
|
+
const tree = buildTree(board, this.id, createDebtRelations(board));
|
|
85
|
+
return tree === null ? { kind: "missing" } : { kind: "present", ...tree };
|
|
30
86
|
}
|
|
31
87
|
update(input) {
|
|
32
88
|
return updateDebt(this.world, this.id, updateInput(input));
|
|
@@ -60,18 +116,7 @@ class DebtsHandle {
|
|
|
60
116
|
return addDebt(this.world, addInput(input));
|
|
61
117
|
}
|
|
62
118
|
addDocument(input) {
|
|
63
|
-
|
|
64
|
-
closed(v, ["markdown", "namespace", "actor", "signal"], "addDocument input");
|
|
65
|
-
const markdown = text(v.markdown, "markdown");
|
|
66
|
-
if (markdown === undefined)
|
|
67
|
-
throw new TypeError("markdown is required");
|
|
68
|
-
const ns = namespace(v.namespace), createdBy = actor(v.actor), abort = signal(v.signal);
|
|
69
|
-
return addDebtDocument(this.world, {
|
|
70
|
-
markdown,
|
|
71
|
-
...(ns === undefined ? {} : { namespace: ns }),
|
|
72
|
-
...(createdBy === undefined ? {} : { actor: createdBy }),
|
|
73
|
-
...(abort === undefined ? {} : { signal: abort }),
|
|
74
|
-
});
|
|
119
|
+
return addDebtDocument(this.world, addDocumentInput(input));
|
|
75
120
|
}
|
|
76
121
|
async list(input = {}) {
|
|
77
122
|
const v = record(input, "list input");
|
|
@@ -119,7 +164,8 @@ class DebtsHandle {
|
|
|
119
164
|
});
|
|
120
165
|
}
|
|
121
166
|
async doctor() {
|
|
122
|
-
|
|
167
|
+
const issues = nonEmptyDebtValues(diagnoseBoard((await readBoard(this.world)).board));
|
|
168
|
+
return { kind: "present", ...(issues === undefined ? {} : { issues }) };
|
|
123
169
|
}
|
|
124
170
|
batch(input) {
|
|
125
171
|
const v = record(input, "batch input");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DebtId } from "./identity.js";
|
|
2
|
-
import type { AddDebtInput, UpdateDebtInput } from "./operations.js";
|
|
2
|
+
import type { AddDebtDocumentInput, AddDebtInput, UpdateDebtInput } from "./operations.js";
|
|
3
3
|
import type { DebtQuerySort } from "./query.js";
|
|
4
4
|
export declare function record(value: unknown, label: string): Record<string, unknown>;
|
|
5
5
|
export declare function closed(value: Record<string, unknown>, allowed: readonly string[], label: string): void;
|
|
@@ -11,4 +11,5 @@ export declare function text(value: unknown, label: string): string | undefined;
|
|
|
11
11
|
export declare function actor(value: unknown): string | undefined;
|
|
12
12
|
export declare function sort(value: unknown): DebtQuerySort | undefined;
|
|
13
13
|
export declare function addInput(input: unknown): AddDebtInput;
|
|
14
|
+
export declare function addDocumentInput(input: unknown): AddDebtDocumentInput;
|
|
14
15
|
export declare function updateInput(input: unknown): UpdateDebtInput;
|
package/build/src/debt/input.js
CHANGED
|
@@ -134,6 +134,20 @@ export function addInput(input) {
|
|
|
134
134
|
...(abort === undefined ? {} : { signal: abort }),
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
+
export function addDocumentInput(input) {
|
|
138
|
+
const v = record(input, "addDocument input");
|
|
139
|
+
closed(v, ["markdown", "namespace", "actor", "signal"], "addDocument input");
|
|
140
|
+
const markdown = text(v.markdown, "markdown");
|
|
141
|
+
if (markdown === undefined)
|
|
142
|
+
throw new TypeError("markdown is required");
|
|
143
|
+
const ns = namespace(v.namespace), createdBy = actor(v.actor), abort = signal(v.signal);
|
|
144
|
+
return {
|
|
145
|
+
markdown,
|
|
146
|
+
...(ns === undefined ? {} : { namespace: ns }),
|
|
147
|
+
...(createdBy === undefined ? {} : { actor: createdBy }),
|
|
148
|
+
...(abort === undefined ? {} : { signal: abort }),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
137
151
|
export function updateInput(input) {
|
|
138
152
|
const value = record(input, "update input");
|
|
139
153
|
closed(value, [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type SettledDebtResult, type DebtBatchResult, type DebtLifecycleVerb, type
|
|
1
|
+
import { type SettledDebtResult, type DebtBatchResult, type DebtLifecycleVerb, type DebtLifecycleResult } from "./operation-types.js";
|
|
2
2
|
import type { DebtId } from "./identity.js";
|
|
3
3
|
import type { WorldRoot } from "../world.js";
|
|
4
|
-
export declare function lifecycleDebt(world: WorldRoot, id: DebtId, verb: DebtLifecycleVerb, signal?: AbortSignal, note?: string): Promise<
|
|
4
|
+
export declare function lifecycleDebt(world: WorldRoot, id: DebtId, verb: DebtLifecycleVerb, signal?: AbortSignal, note?: string): Promise<DebtLifecycleResult>;
|
|
5
5
|
export declare function batchDebts(world: WorldRoot, verb: DebtLifecycleVerb, ids: readonly DebtId[], signal?: AbortSignal, note?: string): Promise<DebtBatchResult>;
|
|
6
6
|
export declare function settleDebt(world: WorldRoot, id: DebtId): Promise<SettledDebtResult>;
|