@astrosheep/keiyaku 4.6.8 → 4.6.9
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 +40 -14
- package/build/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/build/plugins/claude/skills/keiyaku/SKILL.md +5 -6
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/plugins/claude/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/plugins/claude/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/plugins/codex/.codex-plugin/plugin.json +1 -1
- package/build/plugins/codex/skills/keiyaku/SKILL.md +5 -6
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/plugins/codex/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/plugins/opencode/index.js +1 -1
- package/build/plugins/opencode/skills/keiyaku/SKILL.md +5 -6
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/plugins/opencode/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/skills/keiyaku/SKILL.md +5 -6
- package/build/skills/keiyaku-akuma/SKILL.md +1 -1
- package/build/skills/keiyaku-akuma/references/automation.md +8 -8
- package/build/skills/keiyaku-babysit/SKILL.md +1 -1
- package/build/skills/keiyaku-bind/SKILL.md +9 -9
- package/build/skills/keiyaku-debt/SKILL.md +91 -0
- package/build/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/src/akuma/akuma-instance.d.ts +2 -0
- package/build/src/akuma/akuma-instance.js +10 -0
- package/build/src/akuma/akuma-observe.d.ts +33 -8
- package/build/src/akuma/akuma-observe.js +88 -64
- package/build/src/akuma/akuma-owner.d.ts +11 -2
- package/build/src/akuma/akuma-owner.js +45 -35
- package/build/src/akuma/akuma-selection-execution.js +9 -1
- package/build/src/akuma/akuma-stream.d.ts +22 -0
- package/build/src/akuma/akuma-stream.js +116 -0
- package/build/src/akuma/akuma-wait.d.ts +1 -40
- package/build/src/akuma/akuma-wait.js +23 -84
- package/build/src/akuma/akuma.d.ts +17 -11
- package/build/src/akuma/akuma.js +2 -0
- package/build/src/akuma/allowed.d.ts +7 -12
- package/build/src/akuma/allowed.js +13 -4
- package/build/src/akuma/body-supervisor.d.ts +5 -5
- package/build/src/akuma/body-supervisor.js +22 -20
- package/build/src/akuma/body.js +28 -1
- package/build/src/akuma/call-request.d.ts +12 -22
- package/build/src/akuma/heart/activity-schema.d.ts +12 -0
- package/build/src/akuma/heart/activity-schema.js +6 -0
- package/build/src/akuma/heart/index.d.ts +59 -2
- package/build/src/akuma/heart/index.js +87 -8
- package/build/src/akuma/heart/rows.js +5 -3
- package/build/src/akuma/heart/soul.d.ts +9 -0
- package/build/src/akuma/heart/soul.js +29 -0
- package/build/src/akuma/heart/storage.d.ts +15 -0
- package/build/src/akuma/heart/storage.js +55 -0
- package/build/src/akuma/heart/timeline.d.ts +7 -0
- package/build/src/akuma/heart/timeline.js +10 -0
- package/build/src/akuma/index.d.ts +1 -0
- package/build/src/akuma/projection.d.ts +25 -0
- package/build/src/akuma/projection.js +24 -7
- package/build/src/akuma/provider-recipe.d.ts +11 -0
- package/build/src/akuma/provider-recipe.js +23 -0
- package/build/src/akuma/provider.d.ts +25 -0
- package/build/src/akuma/provider.js +99 -7
- package/build/src/akuma/providers/acp/events.js +25 -2
- package/build/src/akuma/providers/claude/events.js +76 -10
- package/build/src/akuma/providers/claude/index.js +2 -5
- package/build/src/akuma/providers/codex-app-server/events.js +17 -2
- package/build/src/akuma/providers/codex-app-server/index.js +15 -9
- package/build/src/akuma/providers/decode.d.ts +8 -0
- package/build/src/akuma/providers/decode.js +21 -0
- package/build/src/akuma/providers/grok-build/index.js +10 -26
- package/build/src/akuma/providers/opencode-sdk/event-stream.d.ts +3 -3
- package/build/src/akuma/providers/opencode-sdk/event-stream.js +2 -25
- package/build/src/akuma/providers/opencode-sdk/events.d.ts +7 -43
- package/build/src/akuma/providers/opencode-sdk/events.js +147 -284
- package/build/src/akuma/providers/opencode-sdk/index.js +267 -421
- package/build/src/akuma/providers/opencode-sdk/native-http.d.ts +9 -0
- package/build/src/akuma/providers/opencode-sdk/native-http.js +69 -0
- package/build/src/akuma/providers/opencode-sdk/session.d.ts +42 -36
- package/build/src/akuma/providers/opencode-sdk/session.js +75 -82
- package/build/src/akuma/providers/paseo/events.d.ts +8 -0
- package/build/src/akuma/providers/paseo/events.js +58 -11
- package/build/src/akuma/providers/paseo/index.js +11 -7
- package/build/src/akuma/providers/pi/events.d.ts +2 -0
- package/build/src/akuma/providers/pi/events.js +32 -24
- package/build/src/akuma/providers/pi/index.js +21 -35
- package/build/src/akuma/request-lifecycle.d.ts +1 -2
- package/build/src/akuma/request-lifecycle.js +2 -8
- package/build/src/akuma/request-rendezvous.js +38 -55
- package/build/src/akuma/request-serve.d.ts +1 -1
- package/build/src/akuma/request-serve.js +77 -113
- package/build/src/akuma/selection-observation.d.ts +57 -51
- package/build/src/akuma/selection-observation.js +3 -3
- package/build/src/akuma/turn-drive.d.ts +3 -0
- package/build/src/akuma/turn-drive.js +26 -5
- package/build/src/akuma-body.js +12 -22
- package/build/src/cli/akuma-caller.js +10 -0
- package/build/src/cli/commands/akuma-grammar.js +3 -4
- package/build/src/cli/commands/akuma.js +13 -51
- package/build/src/cli/commands/contract-grammar.d.ts +7 -6
- package/build/src/cli/commands/contract-grammar.js +27 -32
- package/build/src/cli/commands/contract-help.d.ts +16 -7
- package/build/src/cli/commands/contract-help.js +20 -11
- package/build/src/cli/commands/contract.js +11 -11
- package/build/src/cli/commands/debt-grammar.d.ts +19 -0
- package/build/src/cli/commands/debt-grammar.js +323 -0
- package/build/src/cli/commands/debt-query.d.ts +5 -0
- package/build/src/cli/commands/{task-query.js → debt-query.js} +9 -9
- package/build/src/cli/commands/{task.d.ts → debt.d.ts} +2 -2
- package/build/src/cli/commands/{task.js → debt.js} +83 -143
- package/build/src/cli/coordinates.d.ts +1 -1
- package/build/src/cli/coordinates.js +1 -1
- package/build/src/cli/parse.d.ts +4 -4
- package/build/src/cli/parse.js +17 -16
- package/build/src/cli/render/akuma-activity.d.ts +11 -83
- package/build/src/cli/render/akuma-activity.js +20 -382
- package/build/src/cli/render/catalog.d.ts +2 -2
- package/build/src/cli/render/catalog.js +5 -5
- package/build/src/cli/render/contract.js +2 -2
- package/build/src/cli/render/debt.d.ts +28 -0
- package/build/src/cli/render/{task.js → debt.js} +51 -112
- package/build/src/cli/render/kanshi.js +28 -28
- package/build/src/cli/render/marks.d.ts +5 -5
- package/build/src/cli/render/marks.js +4 -10
- package/build/src/cli/render/nuke.js +1 -1
- package/build/src/cli/runtime.js +3 -3
- package/build/src/cli/scan.d.ts +1 -1
- package/build/src/cli/usage.d.ts +1 -1
- package/build/src/cli/usage.js +4 -4
- package/build/src/contract-worktree.js +3 -3
- package/build/src/debt/board.d.ts +160 -0
- package/build/src/{task → debt}/board.js +89 -89
- package/build/src/debt/catalog.d.ts +11 -0
- package/build/src/debt/catalog.js +59 -0
- package/build/src/{task → debt}/context.d.ts +1 -1
- package/build/src/{task → debt}/context.js +1 -1
- package/build/src/{task → debt}/created-observation.d.ts +6 -10
- package/build/src/{task → debt}/created-observation.js +7 -7
- package/build/src/debt/document.d.ts +37 -0
- package/build/src/{task → debt}/document.js +37 -37
- package/build/src/debt/identity.d.ts +21 -0
- package/build/src/{task → debt}/identity.js +35 -35
- package/build/src/debt/index.d.ts +111 -0
- package/build/src/debt/index.js +203 -0
- package/build/src/{task → debt}/input.d.ts +8 -8
- package/build/src/{task → debt}/input.js +21 -21
- package/build/src/debt/lifecycle-operations.d.ts +6 -0
- package/build/src/{task → debt}/lifecycle-operations.js +27 -31
- package/build/src/debt/mutation-result.d.ts +981 -0
- package/build/src/debt/mutation-result.js +109 -0
- package/build/src/debt/mutation.d.ts +424 -0
- package/build/src/debt/mutation.js +223 -0
- package/build/src/debt/operation-types.d.ts +71 -0
- package/build/src/debt/operations.d.ts +28 -0
- package/build/src/{task → debt}/operations.js +59 -60
- package/build/src/debt/query.d.ts +76 -0
- package/build/src/{task → debt}/query.js +55 -55
- package/build/src/{task → debt}/store.d.ts +13 -13
- package/build/src/{task → debt}/store.js +58 -49
- package/build/src/debt/view.d.ts +4 -0
- package/build/src/debt/view.js +7 -0
- package/build/src/identity/coordinates.d.ts +1 -1
- package/build/src/index.d.ts +13 -13
- package/build/src/index.js +9 -9
- package/build/src/kanshi/index.d.ts +1 -1
- package/build/src/kanshi/read.js +33 -33
- package/build/src/kanshi/report.d.ts +7 -7
- package/build/src/kanshi/select.js +4 -4
- package/build/src/library/akumas.d.ts +2 -3
- package/build/src/library/bind.d.ts +3 -3
- package/build/src/library/bind.js +5 -5
- package/build/src/library/contract-creation.js +5 -5
- package/build/src/library/contract-execution.js +4 -4
- package/build/src/library/contract-types.d.ts +2 -2
- package/build/src/library/input.d.ts +2 -2
- package/build/src/library/input.js +5 -5
- package/build/src/library/invocation.js +2 -2
- package/build/src/library/nuke.js +3 -3
- package/build/src/library/outcome.d.ts +126 -126
- package/build/src/library/outcome.js +3 -3
- package/build/src/library/selection.d.ts +1 -4
- package/build/src/library/selection.js +11 -62
- package/build/src/plugin/public.d.ts +5 -0
- package/build/src/plugin/runtime.js +3 -1
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settlement/fence.d.ts +3 -3
- package/build/src/settlement/fence.js +4 -4
- package/build/src/settlement/holder.d.ts +16 -16
- package/build/src/settlement/holder.js +69 -63
- package/build/src/settlement/settle.d.ts +5 -5
- package/build/src/settlement/settle.js +53 -53
- package/package.json +12 -6
- package/plugins/paseo/plugin/index.server.ts +17 -0
- package/plugins/paseo/plugin/paseo-plugin.json +4 -0
- package/plugins/paseo/plugin/server/attach.ts +52 -0
- package/plugins/paseo/plugin/server/keiyaku.ts +44 -0
- package/plugins/paseo/plugin/server/message.ts +60 -0
- package/plugins/paseo/plugin/server/mirror.ts +193 -0
- package/plugins/paseo/plugin/server/model.ts +14 -0
- package/plugins/paseo/plugin/server/provider.ts +276 -0
- package/plugins/paseo/plugin/server/sdk-worker.ts +237 -0
- package/plugins/paseo/plugin/server/sdk.ts +289 -0
- package/plugins/paseo/plugin/server/stop.ts +26 -0
- package/plugins/paseo/plugin/server/transport.ts +35 -0
- package/plugins/paseo/plugin/shared/attach-rpc.ts +10 -0
- package/plugins/paseo/plugin/shared/refresh-rpc.ts +6 -0
- package/plugins/paseo/plugin/tsconfig.json +6 -0
- package/skills/keiyaku/SKILL.md +5 -6
- package/skills/keiyaku-akuma/SKILL.md +1 -1
- package/skills/keiyaku-akuma/references/automation.md +8 -8
- package/skills/keiyaku-babysit/SKILL.md +1 -1
- package/skills/keiyaku-bind/SKILL.md +9 -9
- package/skills/keiyaku-debt/SKILL.md +91 -0
- package/skills/keiyaku-workflow/SKILL.md +2 -2
- package/build/plugins/claude/skills/keiyaku-task/SKILL.md +0 -104
- package/build/plugins/codex/skills/keiyaku-task/SKILL.md +0 -104
- package/build/plugins/opencode/skills/keiyaku-task/SKILL.md +0 -104
- package/build/skills/keiyaku-task/SKILL.md +0 -104
- package/build/src/cli/commands/task-grammar.d.ts +0 -19
- package/build/src/cli/commands/task-grammar.js +0 -384
- package/build/src/cli/commands/task-query.d.ts +0 -5
- package/build/src/cli/render/task.d.ts +0 -39
- package/build/src/task/board.d.ts +0 -168
- package/build/src/task/catalog.d.ts +0 -11
- package/build/src/task/catalog.js +0 -59
- package/build/src/task/compose-language.d.ts +0 -57
- package/build/src/task/compose-language.js +0 -364
- package/build/src/task/compose-parser.d.ts +0 -32
- package/build/src/task/compose-parser.js +0 -180
- package/build/src/task/compose.d.ts +0 -16
- package/build/src/task/compose.js +0 -189
- package/build/src/task/document.d.ts +0 -39
- package/build/src/task/identity.d.ts +0 -21
- package/build/src/task/index.d.ts +0 -138
- package/build/src/task/index.js +0 -269
- package/build/src/task/lifecycle-operations.d.ts +0 -6
- package/build/src/task/mutation-result.d.ts +0 -1726
- package/build/src/task/mutation-result.js +0 -198
- package/build/src/task/mutation.d.ts +0 -590
- package/build/src/task/mutation.js +0 -262
- package/build/src/task/operation-types.d.ts +0 -71
- package/build/src/task/operations.d.ts +0 -28
- package/build/src/task/query.d.ts +0 -76
- package/build/src/task/view.d.ts +0 -4
- package/build/src/task/view.js +0 -7
- package/skills/keiyaku-task/SKILL.md +0 -104
- /package/build/src/{task → debt}/operation-types.js +0 -0
package/build/src/index.d.ts
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
2
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
3
3
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
4
4
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
7
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
8
8
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
9
9
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
10
10
|
*/
|
|
11
11
|
export { AuthorityCorruptionError } from "./core/facts/errors.js";
|
|
12
12
|
/**
|
|
13
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
13
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
14
14
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
15
15
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
16
16
|
*/
|
|
17
17
|
export { Delivery } from "./library/delivery.js";
|
|
18
18
|
/**
|
|
19
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
19
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
20
20
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
21
21
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
22
22
|
*/
|
|
23
23
|
export { Keiyaku } from "./library/keiyaku.js";
|
|
24
24
|
/**
|
|
25
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
25
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
26
26
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
27
27
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
28
28
|
*/
|
|
29
29
|
export { KeiyakuError } from "./library/outcome.js";
|
|
30
30
|
/**
|
|
31
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
31
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
32
32
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
33
33
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
34
34
|
*/
|
|
35
35
|
export { NoGitWorldError, Repo } from "./library/repo.js";
|
|
36
36
|
/**
|
|
37
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
37
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
38
38
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
39
39
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
40
40
|
*/
|
|
41
41
|
export { actorId } from "./core/facts/types.js";
|
|
42
42
|
/**
|
|
43
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
43
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
44
44
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
45
45
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
46
46
|
*/
|
|
47
47
|
export { z } from "zod";
|
|
48
48
|
export { ALLOWED_ACTIONS, Akuma, AkumaArchetypeError, AkumaBusyError, AkumaDecodeError, AkumaNotBornError, AkumaProviderError, Schema, listArchetypeDefinitions, } from "./akuma/index.js";
|
|
49
|
-
export type { AkumaCaller, AkumaOrigin, ActivityHistory, ActivityRow, AkuId, AkumaAskObservation, AkumaAskOptions, AkumaAskResult, AkumaBirthInput, AkumaHistoryOptions, AkumaHostOptions, AkumaIdleOptions, AkumaIdleResult, AkumaSignalOptions, AkumaStatus, AkumaTellOptions, AkumaTellResult, AllowedAction, AllowedActions, ArchetypeCatalog, ArchetypeCatalogInput, ArchetypeCatalogRow, InterruptReceipt, JsonSchema, JsonSchemaDocument, KillEvidence, SchemaLike, StandardSchemaV1, } from "./akuma/index.js";
|
|
49
|
+
export type { AkumaCaller, AkumaOrigin, ActivityHistory, ActivityRow, AkuId, AkumaAskObservation, AkumaAskOptions, AkumaAskResult, AkumaBirthInput, AkumaHistoryOptions, AkumaHostOptions, AkumaIdleOptions, AkumaIdleResult, AkumaSignalOptions, AkumaStatus, AkumaStreamSnapshot, AkumaTellOptions, AkumaTellResult, AllowedAction, AllowedActions, ArchetypeCatalog, ArchetypeCatalogInput, ArchetypeCatalogRow, InterruptReceipt, JsonSchema, JsonSchemaDocument, KillEvidence, SchemaLike, StandardSchemaV1, } from "./akuma/index.js";
|
|
50
50
|
export type { ActorId, ChangeId, ContractHead, ContractId, ContractState, JournalEntry as Fact, FactKind, SnapshotId, } from "./core/facts/types.js";
|
|
51
51
|
export { kanshi, kanshiCategory, observeKanshi, selectKanshi, selectRegion } from "./kanshi/index.js";
|
|
52
|
-
export type { AkumaKanshiRow, AkumaKanshiWorld, ContractEndpointObservation, ContractHolderObservation, ContractKanshiBoard, ContractKanshiRow, KanshiCategoryInput, KanshiCategoryReport, KanshiInput, KanshiRegionSelection, KanshiReport, KanshiSelection, RegionDeclaration, RegionRead, Section,
|
|
52
|
+
export type { AkumaKanshiRow, AkumaKanshiWorld, ContractEndpointObservation, ContractHolderObservation, ContractKanshiBoard, ContractKanshiRow, KanshiCategoryInput, KanshiCategoryReport, KanshiInput, KanshiRegionSelection, KanshiReport, KanshiSelection, RegionDeclaration, RegionRead, Section, DebtKanshiRow, DebtKanshiWorld, } from "./kanshi/index.js";
|
|
53
53
|
export { AkumaAddressError, AkumaWorldScopeError, Akumas } from "./library/akumas.js";
|
|
54
|
-
export type { AkumaAddressInput, AkumaAskInput, AkumaHistoryInput, AkumaHistoryResult, AkumaKillInput, AkumaKillResult, AkumaList, AkumaListInput, AkumaObservation, AkumaObservationStage, AkumaTellInput, AkumaWaitInput, AkumaWaitResult, AkumaWorldScopeRefusal, CallInput, CallResult, CallWaitHead,
|
|
54
|
+
export type { AkumaAddressInput, AkumaAskInput, AkumaHistoryInput, AkumaHistoryResult, AkumaKillInput, AkumaKillResult, AkumaList, AkumaListInput, AkumaObservation, AkumaObservationStage, AkumaTellInput, AkumaWaitInput, AkumaWaitResult, AkumaWorldScopeRefusal, CallInput, CallResult, CallWaitHead, CreatedDebtObservation, DispatchAssociation, DispatchStage, ForkInput, ForkResult, TellResult, TellWake, } from "./library/akumas.js";
|
|
55
55
|
export type { ContinuationReport } from "./library/continuation.js";
|
|
56
56
|
export type { KeiyakuLibrary, ReconcileInput } from "./library/contract-composition.js";
|
|
57
57
|
export type { AbandonOutcome, AmendOutcome, ArcOutcome, AuditOutcome, BindOutcome, BindResult, DeliverOutcome, ReviewOutcome, } from "./library/contract-outcomes.js";
|
|
@@ -74,8 +74,8 @@ export { SettingsError, settings } from "./settings.js";
|
|
|
74
74
|
export type { Gate } from "./library/contract-types.js";
|
|
75
75
|
export type { Settings, SettingsEntry, SettingsInput, SettingsNamespaceFailure, SettingsNamespaceView, SettingsScope, SettingsScopeState, } from "./settings.js";
|
|
76
76
|
export type { SettlementAction, SettlementLag, SettlementReport } from "./settlement/settle.js";
|
|
77
|
-
export type * from "./
|
|
78
|
-
export {
|
|
77
|
+
export type * from "./debt/index.js";
|
|
78
|
+
export { DEBT_RELATION_PREDICATE_FIELDS, DebtAuthorityCorruptionError, Debts } from "./debt/index.js";
|
|
79
79
|
export { World, WorldError } from "./world.js";
|
|
80
80
|
export type { WorldResolution, WorldResolutionInput, WorldRoot } from "./world.js";
|
|
81
81
|
export type { ReconcileReport, TopologyEffect } from "./library/reconcile.js";
|
package/build/src/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
2
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
3
3
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
4
4
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
7
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
8
8
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
9
9
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
10
10
|
*/
|
|
11
11
|
export { AuthorityCorruptionError } from "./core/facts/errors.js";
|
|
12
12
|
/**
|
|
13
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
13
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
14
14
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
15
15
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
16
16
|
*/
|
|
17
17
|
export { Delivery } from "./library/delivery.js";
|
|
18
18
|
/**
|
|
19
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
19
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
20
20
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
21
21
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
22
22
|
*/
|
|
23
23
|
export { Keiyaku } from "./library/keiyaku.js";
|
|
24
24
|
/**
|
|
25
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
25
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
26
26
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
27
27
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
28
28
|
*/
|
|
29
29
|
export { KeiyakuError } from "./library/outcome.js";
|
|
30
30
|
/**
|
|
31
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
31
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
32
32
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
33
33
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
34
34
|
*/
|
|
35
35
|
export { NoGitWorldError, Repo } from "./library/repo.js";
|
|
36
36
|
/**
|
|
37
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
37
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
38
38
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
39
39
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
40
40
|
*/
|
|
41
41
|
export { actorId } from "./core/facts/types.js";
|
|
42
42
|
/**
|
|
43
|
-
* The package root: the curated Contract, Akuma, Akumas,
|
|
43
|
+
* The package root: the curated Contract, Akuma, Akumas, Debt, Kanshi, World,
|
|
44
44
|
* Settings, and Plugin surfaces. Internal composition, execution, and
|
|
45
45
|
* configuration helpers stay off this entry; only CLI and Body import them.
|
|
46
46
|
*/
|
|
@@ -50,5 +50,5 @@ export { kanshi, kanshiCategory, observeKanshi, selectKanshi, selectRegion } fro
|
|
|
50
50
|
export { AkumaAddressError, AkumaWorldScopeError, Akumas } from "./library/akumas.js";
|
|
51
51
|
export { nukeKeiyaku as nuke } from "./library/nuke.js";
|
|
52
52
|
export { SettingsError, settings } from "./settings.js";
|
|
53
|
-
export {
|
|
53
|
+
export { DEBT_RELATION_PREDICATE_FIELDS, DebtAuthorityCorruptionError, Debts } from "./debt/index.js";
|
|
54
54
|
export { World, WorldError } from "./world.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { kanshi, kanshiCategory, observeKanshi } from "./read.js";
|
|
2
2
|
export { selectKanshi, selectRegion } from "./select.js";
|
|
3
3
|
export type { KanshiCategoryInput, KanshiInput } from "./read.js";
|
|
4
|
-
export type { AkumaKanshiRow, AkumaKanshiWorld, ContractEndpointObservation, ContractHolderObservation, ContractKanshiBoard, ContractKanshiRow, KanshiCategoryReport, KanshiReport, Section,
|
|
4
|
+
export type { AkumaKanshiRow, AkumaKanshiWorld, ContractEndpointObservation, ContractHolderObservation, ContractKanshiBoard, ContractKanshiRow, KanshiCategoryReport, KanshiReport, Section, DebtKanshiRow, DebtKanshiWorld, KanshiRegionSelection, RegionDeclaration, RegionOverlap, RegionRead, } from "./report.js";
|
|
5
5
|
export type { KanshiSelection } from "./select.js";
|
package/build/src/kanshi/read.js
CHANGED
|
@@ -10,10 +10,10 @@ import { Repo, scopeForRepo } from "../library/repo.js";
|
|
|
10
10
|
import { readDocuments } from "../protocol/read/documents.js";
|
|
11
11
|
import { observeCurrentPhysicalIssue } from "../protocol/read/observation.js";
|
|
12
12
|
import { readContractBoard, readContractCatalogue, readContractPhase } from "../protocol/read/status.js";
|
|
13
|
-
import {
|
|
14
|
-
import { contractNamespace } from "../
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
13
|
+
import { readDebtHolderProjectionAt } from "../settlement/holder.js";
|
|
14
|
+
import { contractNamespace } from "../debt/identity.js";
|
|
15
|
+
import { observeRecentDebtStatus, DebtAuthorityCorruptionError } from "../debt/index.js";
|
|
16
|
+
import { observeDebtBoard } from "../debt/operations.js";
|
|
17
17
|
import { ROSTER_SNAPSHOT_ROWS, ROSTER_VISIBLE_ROWS } from "./roster.js";
|
|
18
18
|
import { selectKanshi, selectRegion } from "./select.js";
|
|
19
19
|
const WORLD_CONTRACT_ROWS = 10;
|
|
@@ -146,7 +146,7 @@ async function readContracts(observation, include, limit = WORLD_CONTRACT_ROWS)
|
|
|
146
146
|
}
|
|
147
147
|
async function readHolders(observation) {
|
|
148
148
|
try {
|
|
149
|
-
return { kind: "present", value: await
|
|
149
|
+
return { kind: "present", value: await readDebtHolderProjectionAt(observation) };
|
|
150
150
|
}
|
|
151
151
|
catch (error) {
|
|
152
152
|
return { kind: "failed", failure: { message: diagnostic(error) } };
|
|
@@ -173,7 +173,7 @@ function attachRoster(contracts, akuma) {
|
|
|
173
173
|
},
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
function decorateContracts(contracts, holders,
|
|
176
|
+
function decorateContracts(contracts, holders, namespaceDebts) {
|
|
177
177
|
if (contracts.kind !== "present")
|
|
178
178
|
return contracts;
|
|
179
179
|
return {
|
|
@@ -181,22 +181,22 @@ function decorateContracts(contracts, holders, namespaceTasks) {
|
|
|
181
181
|
value: {
|
|
182
182
|
...contracts.value,
|
|
183
183
|
rows: contracts.value.rows.map((row) => {
|
|
184
|
-
const selected =
|
|
184
|
+
const selected = namespaceDebts?.(row.id);
|
|
185
185
|
if (holders.kind === "failed") {
|
|
186
186
|
return {
|
|
187
187
|
...row,
|
|
188
188
|
holder: { kind: "unavailable" },
|
|
189
189
|
roster: [],
|
|
190
|
-
...(selected === undefined ? {} : {
|
|
190
|
+
...(selected === undefined ? {} : { namespaceDebts: selected }),
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
193
|
const holder = holders.kind === "present" ? holders.value.get(row.id) : undefined;
|
|
194
194
|
return {
|
|
195
195
|
...row,
|
|
196
196
|
roster: [],
|
|
197
|
-
...(selected === undefined ? {} : {
|
|
197
|
+
...(selected === undefined ? {} : { namespaceDebts: selected }),
|
|
198
198
|
holder: holder?.disposition === "held"
|
|
199
|
-
? { kind: "held",
|
|
199
|
+
? { kind: "held", debtId: holder.debtId }
|
|
200
200
|
: { kind: "none" },
|
|
201
201
|
};
|
|
202
202
|
}),
|
|
@@ -214,11 +214,11 @@ function contractEndpointObserver(contracts) {
|
|
|
214
214
|
return "hasMore" in contracts.value ? "unavailable" : "missing";
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function joinDebts(rows, holders, observeContract) {
|
|
218
218
|
const associations = new Map(holders.kind === "present"
|
|
219
219
|
? [...holders.value.values()]
|
|
220
220
|
.filter((holder) => holder.disposition === "held")
|
|
221
|
-
.map((holder) => [holder.
|
|
221
|
+
.map((holder) => [holder.debtId, holder.contractId])
|
|
222
222
|
: []);
|
|
223
223
|
return rows.map((row) => {
|
|
224
224
|
const contractId = associations.get(row.id);
|
|
@@ -227,43 +227,43 @@ function joinTasks(rows, holders, observeContract) {
|
|
|
227
227
|
return { ...row, contract: { id: contractId, observed: observeContract(contractId) } };
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
/** Attribute a
|
|
231
|
-
function
|
|
230
|
+
/** Attribute a Debt board failure to the malformed document that caused it, when one is known. */
|
|
231
|
+
function debtFailure(error) {
|
|
232
232
|
return {
|
|
233
233
|
message: diagnostic(error),
|
|
234
|
-
...(error instanceof
|
|
234
|
+
...(error instanceof DebtAuthorityCorruptionError && error.coordinate !== undefined
|
|
235
235
|
? { coordinate: error.coordinate }
|
|
236
236
|
: {}),
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
|
-
async function
|
|
239
|
+
async function readDebtWorld(path) {
|
|
240
240
|
if (path === null)
|
|
241
241
|
return { kind: "absent" };
|
|
242
242
|
try {
|
|
243
|
-
return { kind: "present", observation: await
|
|
243
|
+
return { kind: "present", observation: await observeDebtBoard(path) };
|
|
244
244
|
}
|
|
245
245
|
catch (error) {
|
|
246
|
-
return { kind: "failed", failure:
|
|
246
|
+
return { kind: "failed", failure: debtFailure(error) };
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
/**
|
|
250
|
-
* A selected Contract's own
|
|
251
|
-
* board's
|
|
250
|
+
* A selected Contract's own Debt namespace view. A failed Debt board is reported once by the
|
|
251
|
+
* board's Debt section, so the entity block omits it rather than repeating the same row.
|
|
252
252
|
*/
|
|
253
|
-
function
|
|
253
|
+
function namespaceDebtSection(board, id) {
|
|
254
254
|
if (board.kind === "absent")
|
|
255
255
|
return { kind: "absent" };
|
|
256
256
|
if (board.kind === "failed")
|
|
257
257
|
return undefined;
|
|
258
258
|
return { kind: "present", value: board.observation.selectNamespace(contractNamespace(id)) };
|
|
259
259
|
}
|
|
260
|
-
async function
|
|
260
|
+
async function readDebts(path, holders, observeContract) {
|
|
261
261
|
if (holders.kind === "failed")
|
|
262
262
|
return { kind: "failed", failure: holders.failure };
|
|
263
|
-
return
|
|
263
|
+
return observeRecentDebtStatus(path, { limit: 10 }).then((recent) => ({
|
|
264
264
|
kind: "present",
|
|
265
|
-
value: { root: path, hasMore: recent.hasMore, rows:
|
|
266
|
-
}), (error) => ({ kind: "failed", failure:
|
|
265
|
+
value: { root: path, hasMore: recent.hasMore, rows: joinDebts(recent.rows, holders, observeContract) },
|
|
266
|
+
}), (error) => ({ kind: "failed", failure: debtFailure(error) }));
|
|
267
267
|
}
|
|
268
268
|
/**
|
|
269
269
|
* Placement discharge for the observed roster snapshots: an associated Contract
|
|
@@ -357,7 +357,7 @@ async function observeWithoutRepo(world, region, observedAt, branch) {
|
|
|
357
357
|
const contracts = { kind: "absent" };
|
|
358
358
|
const holders = { kind: "absent" };
|
|
359
359
|
const observeContract = contractEndpointObserver(contracts);
|
|
360
|
-
const
|
|
360
|
+
const debts = world === null ? { kind: "absent" } : await readDebts(world, holders, observeContract);
|
|
361
361
|
const aliases = world === null ? { kind: "absent" } : await readAliasBindings(world);
|
|
362
362
|
const akuma = world === null
|
|
363
363
|
? { kind: "absent" }
|
|
@@ -368,7 +368,7 @@ async function observeWithoutRepo(world, region, observedAt, branch) {
|
|
|
368
368
|
observedAt,
|
|
369
369
|
branch,
|
|
370
370
|
contracts,
|
|
371
|
-
|
|
371
|
+
debts,
|
|
372
372
|
akuma,
|
|
373
373
|
...(region === undefined ? {} : { region: { kind: "absent" } }),
|
|
374
374
|
},
|
|
@@ -388,11 +388,11 @@ async function observeRepo(input) {
|
|
|
388
388
|
const selectedContract = contract !== undefined &&
|
|
389
389
|
contractSection.kind === "present" &&
|
|
390
390
|
contractSection.value.rows.some((row) => row.id === contract);
|
|
391
|
-
const board = selectedContract ? await
|
|
392
|
-
const contracts = decorateContracts(contractSection, holders, selectedContract ? (id) => (id === contract ?
|
|
391
|
+
const board = selectedContract ? await readDebtWorld(world) : undefined;
|
|
392
|
+
const contracts = decorateContracts(contractSection, holders, selectedContract ? (id) => (id === contract ? namespaceDebtSection(board, id) : undefined) : undefined);
|
|
393
393
|
const observeContract = contractEndpointObserver(contracts);
|
|
394
394
|
const aliases = world === null ? { kind: "absent" } : await readAliasBindings(world);
|
|
395
|
-
const
|
|
395
|
+
const debts = world === null ? { kind: "absent" } : await readDebts(world, holders, observeContract);
|
|
396
396
|
const claimed = dispatches.kind === "present"
|
|
397
397
|
? await claimedAssociatedContracts(observation, dispatches.value)
|
|
398
398
|
: new Set();
|
|
@@ -406,7 +406,7 @@ async function observeRepo(input) {
|
|
|
406
406
|
observedAt,
|
|
407
407
|
branch,
|
|
408
408
|
contracts: attachRoster(contracts, akuma),
|
|
409
|
-
|
|
409
|
+
debts,
|
|
410
410
|
akuma,
|
|
411
411
|
...(regionSection === undefined ? {} : { region: regionSection }),
|
|
412
412
|
};
|
|
@@ -430,7 +430,7 @@ async function observeRepo(input) {
|
|
|
430
430
|
observedAt,
|
|
431
431
|
branch,
|
|
432
432
|
contracts: failure,
|
|
433
|
-
|
|
433
|
+
debts: world === null ? { kind: "absent" } : failure,
|
|
434
434
|
akuma: world === null ? { kind: "absent" } : failure,
|
|
435
435
|
...(region === undefined ? {} : { region: failure }),
|
|
436
436
|
},
|
|
@@ -449,7 +449,7 @@ export async function observeKanshi(input) {
|
|
|
449
449
|
export async function kanshi(input) {
|
|
450
450
|
return (await observeKanshi(input)).report;
|
|
451
451
|
}
|
|
452
|
-
/** Category observations reuse owner rows without reading the
|
|
452
|
+
/** Category observations reuse owner rows without reading the Debt board. */
|
|
453
453
|
async function observeAkumaCategory(world, repo, limit, observedAt) {
|
|
454
454
|
const report = (akuma) => ({
|
|
455
455
|
category: "akuma",
|
|
@@ -6,7 +6,7 @@ import type { ContractId } from "../index.js";
|
|
|
6
6
|
import type { RegionOverlap } from "../library/region.js";
|
|
7
7
|
import type { CurrentPhysicalIssue } from "../protocol/read/observation.js";
|
|
8
8
|
import type { ContractBoard, ContractDisposition, ContractPhase } from "../protocol/read/status.js";
|
|
9
|
-
import type {
|
|
9
|
+
import type { DebtId, DebtRef, DebtRow } from "../debt/index.js";
|
|
10
10
|
import type { WorldRoot } from "../world.js";
|
|
11
11
|
export type { RegionOverlap };
|
|
12
12
|
export type Section<Value> = Readonly<{
|
|
@@ -24,7 +24,7 @@ export type Section<Value> = Readonly<{
|
|
|
24
24
|
export type ContractEndpointObservation = ContractDisposition | "missing" | "unavailable";
|
|
25
25
|
export type ContractHolderObservation = Readonly<{
|
|
26
26
|
kind: "held";
|
|
27
|
-
|
|
27
|
+
debtId: DebtId;
|
|
28
28
|
}> | Readonly<{
|
|
29
29
|
kind: "none";
|
|
30
30
|
}> | Readonly<{
|
|
@@ -38,21 +38,21 @@ export type ContractKanshiRow = ContractBoard["rows"][number] & Readonly<{
|
|
|
38
38
|
phase: ContractPhase;
|
|
39
39
|
holder: ContractHolderObservation;
|
|
40
40
|
roster: readonly ContractRosterAttachment[];
|
|
41
|
-
|
|
41
|
+
namespaceDebts?: Section<readonly DebtRow[]>;
|
|
42
42
|
issue?: CurrentPhysicalIssue;
|
|
43
43
|
}>;
|
|
44
44
|
export type ContractKanshiBoard = Omit<ContractBoard, "rows"> & Readonly<{
|
|
45
45
|
rows: readonly ContractKanshiRow[];
|
|
46
46
|
hasMore?: boolean;
|
|
47
47
|
}>;
|
|
48
|
-
export type
|
|
48
|
+
export type DebtKanshiRow = DebtRow & Readonly<{
|
|
49
49
|
contract?: Readonly<{
|
|
50
50
|
id: string;
|
|
51
51
|
observed: ContractEndpointObservation;
|
|
52
52
|
}>;
|
|
53
|
-
blockers?: readonly
|
|
53
|
+
blockers?: readonly DebtRef[];
|
|
54
54
|
}>;
|
|
55
|
-
export type
|
|
55
|
+
export type DebtKanshiWorld = BoundedList<DebtKanshiRow> & Readonly<{
|
|
56
56
|
root: WorldRoot;
|
|
57
57
|
}>;
|
|
58
58
|
export type AkumaKanshiRow = (AkumaListRow | UnbornAkumaListRow) & Readonly<{
|
|
@@ -96,7 +96,7 @@ export type KanshiReport = Readonly<{
|
|
|
96
96
|
observedAt: string;
|
|
97
97
|
branch: string | null;
|
|
98
98
|
contracts: Section<ContractKanshiBoard>;
|
|
99
|
-
|
|
99
|
+
debts: Section<DebtKanshiWorld>;
|
|
100
100
|
akuma: Section<AkumaKanshiWorld>;
|
|
101
101
|
region?: Section<RegionRead>;
|
|
102
102
|
}>;
|
|
@@ -29,15 +29,15 @@ export function selectKanshi(input) {
|
|
|
29
29
|
},
|
|
30
30
|
}
|
|
31
31
|
: report.contracts,
|
|
32
|
-
|
|
32
|
+
debts: report.debts.kind === "present"
|
|
33
33
|
? {
|
|
34
34
|
kind: "present",
|
|
35
35
|
value: {
|
|
36
|
-
...report.
|
|
37
|
-
rows: report.
|
|
36
|
+
...report.debts.value,
|
|
37
|
+
rows: report.debts.value.rows.filter((row) => row.contract?.id === contract),
|
|
38
38
|
},
|
|
39
39
|
}
|
|
40
|
-
: report.
|
|
40
|
+
: report.debts,
|
|
41
41
|
akuma: report.akuma.kind === "present"
|
|
42
42
|
? {
|
|
43
43
|
kind: "present",
|
|
@@ -4,7 +4,7 @@ import type { AkumaList, AkumaListInput } from "../akuma/akuma.js";
|
|
|
4
4
|
import type { TellResult, TellWake } from "../akuma/body.js";
|
|
5
5
|
import { type ExecutionContext } from "../akuma/requests.js";
|
|
6
6
|
import type { DispatchAssociation } from "../akuma/dispatch-association.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type { CreatedDebtObservation } from "../debt/created-observation.js";
|
|
8
8
|
import { type WorldRoot } from "../world.js";
|
|
9
9
|
import type { AkumaAddressInput, AkumaWorldScopeRefusal } from "./address.js";
|
|
10
10
|
import type { CallInput, CallResult, CallWaitHead, DispatchStage, ForkInput, ForkResult } from "./akuma-creation.js";
|
|
@@ -13,9 +13,8 @@ export { AkumaAddressError, AkumaWorldScopeError } from "./address.js";
|
|
|
13
13
|
export type { AkumaAddressInput } from "./address.js";
|
|
14
14
|
export type { CallInput, ForkInput } from "./akuma-creation.js";
|
|
15
15
|
export type { AkumaAskInput, AkumaHistoryInput, AkumaKillInput, AkumaTellInput, AkumaWaitInput } from "./selection.js";
|
|
16
|
-
export type { AkumaAskResult, AkumaHistoryResult, AkumaKillResult, AkumaList, AkumaListInput, AkumaObservation, AkumaObservationStage, AkumaTellResult, AkumaWaitResult, AkumaWorldScopeRefusal, CallResult, CallWaitHead,
|
|
16
|
+
export type { AkumaAskResult, AkumaHistoryResult, AkumaKillResult, AkumaList, AkumaListInput, AkumaObservation, AkumaObservationStage, AkumaTellResult, AkumaWaitResult, AkumaWorldScopeRefusal, CallResult, CallWaitHead, CreatedDebtObservation, DispatchAssociation, DispatchStage, ForkResult, TellResult, TellWake, };
|
|
17
17
|
/** The existing native wait-observation seam, exposed type-only for CLI composition. */
|
|
18
|
-
export type { WaitObservedAkuma, WaitObserver, WaitSelectedAkuma } from "../akuma/akuma-wait.js";
|
|
19
18
|
export type Akumas = AkumasHandle;
|
|
20
19
|
declare class AkumasHandle {
|
|
21
20
|
#private;
|
|
@@ -4,7 +4,7 @@ import type { GitDecodeChannel } from "../git/read-observation.js";
|
|
|
4
4
|
import { type BindTargetSelection } from "../protocol/bind.js";
|
|
5
5
|
import { type IntentOutcome, type RepositoryScope } from "../protocol/operations.js";
|
|
6
6
|
import type { ProtocolProgress } from "../protocol/progress.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type { DebtId } from "../debt/identity.js";
|
|
8
8
|
import type { ForkSourceRefusal, OperationRefusals } from "./refusal.js";
|
|
9
9
|
type ForkBindAdmission = Readonly<{
|
|
10
10
|
kind: "document";
|
|
@@ -36,7 +36,7 @@ export declare function prepareMarkdownBind(input: Readonly<{
|
|
|
36
36
|
after: readonly ContractId[];
|
|
37
37
|
workspace: "worktree";
|
|
38
38
|
targetSelection: BindTargetSelection;
|
|
39
|
-
|
|
39
|
+
debt?: DebtId;
|
|
40
40
|
progress?: ProtocolProgress;
|
|
41
41
|
actor?: ActorId;
|
|
42
42
|
}>): Promise<{
|
|
@@ -78,7 +78,7 @@ export declare function prepareMarkdownBind(input: Readonly<{
|
|
|
78
78
|
kind: "fork-source-missing" | "fork-source-unavailable";
|
|
79
79
|
contractId: ContractId;
|
|
80
80
|
}>;
|
|
81
|
-
|
|
81
|
+
debtId: DebtId;
|
|
82
82
|
diagnostic: string;
|
|
83
83
|
}>) | null;
|
|
84
84
|
result: IntentOutcome<Readonly<{
|
|
@@ -7,7 +7,7 @@ import { mintIdentitySegment } from "../identity/mint.js";
|
|
|
7
7
|
import { fitIdentityStemWords, normalizeIdentityStem } from "../identity/normalize.js";
|
|
8
8
|
import { bindOperation } from "../protocol/bind.js";
|
|
9
9
|
import { stateOperation } from "../protocol/operations.js";
|
|
10
|
-
import {
|
|
10
|
+
import { admitWithDebtHolderFence, claimDebtHolder } from "../settlement/holder.js";
|
|
11
11
|
import { KeiyakuError } from "./outcome.js";
|
|
12
12
|
import { contractTerms, documentDerivation } from "./input.js";
|
|
13
13
|
const CONTRACT_ID_CODE_POINTS = 32;
|
|
@@ -34,10 +34,10 @@ async function attempt(input, id) {
|
|
|
34
34
|
...(input.coordinates === undefined ? {} : { coordinates: input.coordinates }),
|
|
35
35
|
...(input.source === undefined ? {} : { source: input.source }),
|
|
36
36
|
contractId: id,
|
|
37
|
-
...(input.
|
|
37
|
+
...(input.debt === undefined
|
|
38
38
|
? {}
|
|
39
39
|
: {
|
|
40
|
-
decorateOffer: ({ contractId: owner }) => [
|
|
40
|
+
decorateOffer: ({ contractId: owner }) => [claimDebtHolder(input.debt, owner)],
|
|
41
41
|
}),
|
|
42
42
|
...(input.actor === undefined ? {} : { actor: input.actor }),
|
|
43
43
|
...(input.progress === undefined ? {} : { progress: input.progress }),
|
|
@@ -130,10 +130,10 @@ export async function prepareMarkdownBind(input) {
|
|
|
130
130
|
verification: documentDerivation(input.document, terms.gates).verification,
|
|
131
131
|
workspace: input.workspace,
|
|
132
132
|
targetSelection: input.targetSelection,
|
|
133
|
-
...(input.
|
|
133
|
+
...(input.debt === undefined ? {} : { debt: input.debt }),
|
|
134
134
|
...(input.actor === undefined ? {} : { actor: input.actor }),
|
|
135
135
|
...(input.progress === undefined ? {} : { progress: input.progress }),
|
|
136
136
|
});
|
|
137
|
-
const admission = input.
|
|
137
|
+
const admission = input.debt === undefined ? null : await admitWithDebtHolderFence(input.scope, input.debt, admitCandidate);
|
|
138
138
|
return { admission, result: admission === null ? await admitCandidate() : admission.result };
|
|
139
139
|
}
|
|
@@ -9,7 +9,7 @@ import { readManagedWorktreeAppointment } from "../workspace-place.js";
|
|
|
9
9
|
import { admitForkBindWithAppointment, prepareMarkdownBind } from "./bind.js";
|
|
10
10
|
import { acceptedOutcome, expected, retainAdmission } from "./contract-outcomes.js";
|
|
11
11
|
import { captureLocalContractComposition, derivedGates, derivedHooks, gateNames, } from "./contract-settings.js";
|
|
12
|
-
import { actorOption, normalizedList, requireInput, requireMarkdown,
|
|
12
|
+
import { actorOption, normalizedList, requireInput, requireMarkdown, debtOption } from "./input.js";
|
|
13
13
|
import { InvocationAccumulator } from "./invocation.js";
|
|
14
14
|
import { project, validated } from "./outcome.js";
|
|
15
15
|
import { reconcileAffectedContracts } from "./reconcile.js";
|
|
@@ -26,7 +26,7 @@ function bindInput(input, composition) {
|
|
|
26
26
|
const values = requireInput(input, "Keiyaku.bind input");
|
|
27
27
|
const forkOf = values.forkOf;
|
|
28
28
|
const allowed = forkOf === undefined
|
|
29
|
-
? ["repo", "markdown", "
|
|
29
|
+
? ["repo", "markdown", "debt", "target", "workspace", "actor", "after", "gates"]
|
|
30
30
|
: ["repo", "forkOf", "target", "workspace", "actor"];
|
|
31
31
|
requireInput(input, "Keiyaku.bind input", allowed);
|
|
32
32
|
if ((values.workspace ?? "worktree") !== "worktree")
|
|
@@ -46,7 +46,7 @@ function bindInput(input, composition) {
|
|
|
46
46
|
document,
|
|
47
47
|
actor,
|
|
48
48
|
target: values.target,
|
|
49
|
-
|
|
49
|
+
debt: forkOf === undefined ? debtOption(values.debt) : undefined,
|
|
50
50
|
gates: derived,
|
|
51
51
|
after: forkOf === undefined ? normalizedList(values.after, "after", contractId) : undefined,
|
|
52
52
|
};
|
|
@@ -143,7 +143,7 @@ async function bindComplete(accumulator, id, scope, channel, leading, hooks, val
|
|
|
143
143
|
}
|
|
144
144
|
// eslint-disable-next-line max-params -- Keep this local operation's custody, admission, and policy witnesses explicit.
|
|
145
145
|
async function markdownBind(prepared, document, hooks, scope, channel, accumulator, handle) {
|
|
146
|
-
const {
|
|
146
|
+
const { debt, target, actor, gates, after } = prepared;
|
|
147
147
|
if (gates === undefined || after === undefined)
|
|
148
148
|
throw new Error("Markdown bind requires prepared terms");
|
|
149
149
|
const targetSelection = bindTargetSelection(target);
|
|
@@ -156,7 +156,7 @@ async function markdownBind(prepared, document, hooks, scope, channel, accumulat
|
|
|
156
156
|
after,
|
|
157
157
|
workspace: "worktree",
|
|
158
158
|
targetSelection,
|
|
159
|
-
...(
|
|
159
|
+
...(debt === undefined ? {} : { debt }),
|
|
160
160
|
...actor,
|
|
161
161
|
});
|
|
162
162
|
const leading = admission.admission === null ? admission.result : admission.admission.result;
|
|
@@ -16,7 +16,7 @@ import { admitDeliveryOperation } from "../protocol/deliver.js";
|
|
|
16
16
|
import { withScopeAbortSignal, } from "../protocol/operations.js";
|
|
17
17
|
import { executionStop, isOperationalFailure, isOperationalStop, } from "../protocol/progress.js";
|
|
18
18
|
import { admitReviewOperation } from "../protocol/review.js";
|
|
19
|
-
import {
|
|
19
|
+
import { releaseDebtHolder, releaseDebtHolderWithFence, debtHolderObservationSelection } from "../settlement/holder.js";
|
|
20
20
|
import { continueDeliveredDependents } from "./continuation.js";
|
|
21
21
|
import { requestForwardedContractLive } from "./contract-operations.js";
|
|
22
22
|
import { acceptedOutcome, expected, retainAdmission } from "./contract-outcomes.js";
|
|
@@ -245,16 +245,16 @@ export class ContractExecution {
|
|
|
245
245
|
});
|
|
246
246
|
const hooks = derivedHooks(this.composition);
|
|
247
247
|
return await this.local("abandon", async (accumulator, channel, scope) => {
|
|
248
|
-
const admission = (await
|
|
248
|
+
const admission = (await releaseDebtHolderWithFence(scope, channel, this.id, () => abandonOperation({
|
|
249
249
|
scope,
|
|
250
250
|
channel,
|
|
251
251
|
contractId: this.id,
|
|
252
252
|
...actor,
|
|
253
253
|
...(note === undefined ? {} : { note }),
|
|
254
|
-
observationSelection:
|
|
254
|
+
observationSelection: debtHolderObservationSelection(),
|
|
255
255
|
progress: accumulator,
|
|
256
256
|
decorateOffer: async ({ observation, contractId: owner }) => {
|
|
257
|
-
const companion = await
|
|
257
|
+
const companion = await releaseDebtHolder(channel, observation, owner);
|
|
258
258
|
return companion === null ? [] : [companion];
|
|
259
259
|
},
|
|
260
260
|
}))).result;
|
|
@@ -2,7 +2,7 @@ import type { AttestationData, ContractId, JournalEntry, SnapshotId } from "../c
|
|
|
2
2
|
import type { Dispatch } from "../dispatch/index.js";
|
|
3
3
|
import type { ContractBoard, ContractRow } from "../protocol/read/status.js";
|
|
4
4
|
import type { Settings } from "../settings.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { DebtId } from "../debt/identity.js";
|
|
6
6
|
import type { Repo } from "./repo.js";
|
|
7
7
|
/** Public gate words remain ordinary strings; private policy interprets them. */
|
|
8
8
|
export type Gate = string;
|
|
@@ -25,7 +25,7 @@ export type ContractHistory = Readonly<{
|
|
|
25
25
|
type MarkdownBindInput = Readonly<{
|
|
26
26
|
repo: Repo;
|
|
27
27
|
markdown: string;
|
|
28
|
-
|
|
28
|
+
debt?: DebtId;
|
|
29
29
|
/** A literal target branch; `null` is deliberately targetless; omitted is the Repo worktree's current branch. */
|
|
30
30
|
target?: string | null;
|
|
31
31
|
workspace?: "worktree";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { DecodedContractDocument } from "../body/types.js";
|
|
2
2
|
import { type ActorId, type ContractId, type ContractTerms, type Gate } from "../core/facts/types.js";
|
|
3
|
-
import { type
|
|
3
|
+
import { type DebtId } from "../debt/identity.js";
|
|
4
4
|
import type { DocumentDerivation } from "../protocol/operations.js";
|
|
5
5
|
export declare function actorOption(actor: unknown): Readonly<{
|
|
6
6
|
actor?: ActorId;
|
|
7
7
|
}>;
|
|
8
8
|
export declare function requireMarkdown(value: unknown, label?: string): string;
|
|
9
9
|
export declare function requireInput(value: unknown, label: string, allowed?: readonly string[]): Record<string, unknown>;
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function debtOption(value: unknown): DebtId | undefined;
|
|
11
11
|
export declare function optionalNonblank(value: unknown, label: string): string | undefined;
|
|
12
12
|
export declare function optionalBoolean(value: unknown, label: string): boolean | undefined;
|
|
13
13
|
export declare function optionalSignal(value: unknown): AbortSignal | undefined;
|