@astrosheep/keiyaku 4.6.6 → 4.6.8

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.
Files changed (217) hide show
  1. package/README.md +11 -0
  2. package/build/{integrations/marketplace → plugins}/.agents/plugins/marketplace.json +1 -1
  3. package/build/plugins/.claude-plugin/marketplace.json +5 -0
  4. package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/.claude-plugin/plugin.json +1 -1
  5. package/build/{integrations/marketplace/plugins/keiyaku → plugins/codex}/.codex-plugin/plugin.json +1 -1
  6. package/build/plugins/codex/skills/keiyaku/SKILL.md +44 -0
  7. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +130 -0
  8. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +269 -0
  9. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +65 -0
  10. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +216 -0
  11. package/build/plugins/codex/skills/keiyaku-bind/agents/openai.yaml +4 -0
  12. package/build/plugins/codex/skills/keiyaku-task/SKILL.md +104 -0
  13. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +129 -0
  14. package/build/plugins/opencode/package.json +6 -0
  15. package/build/plugins/opencode/skills/keiyaku/SKILL.md +44 -0
  16. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +130 -0
  17. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +269 -0
  18. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +65 -0
  19. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +216 -0
  20. package/build/plugins/opencode/skills/keiyaku-bind/agents/openai.yaml +4 -0
  21. package/build/plugins/opencode/skills/keiyaku-task/SKILL.md +104 -0
  22. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +129 -0
  23. package/build/{integrations → plugins}/pi/keiyaku.ts +0 -5
  24. package/build/skills/keiyaku/SKILL.md +44 -0
  25. package/build/skills/keiyaku-akuma/SKILL.md +130 -0
  26. package/build/skills/keiyaku-akuma/references/automation.md +269 -0
  27. package/build/skills/keiyaku-babysit/SKILL.md +65 -0
  28. package/build/skills/keiyaku-bind/SKILL.md +216 -0
  29. package/build/skills/keiyaku-bind/agents/openai.yaml +4 -0
  30. package/build/skills/keiyaku-task/SKILL.md +104 -0
  31. package/build/skills/keiyaku-workflow/SKILL.md +129 -0
  32. package/build/src/akuma/akuma-call.d.ts +2 -0
  33. package/build/src/akuma/akuma-call.js +8 -2
  34. package/build/src/akuma/akuma-instance.d.ts +12 -1
  35. package/build/src/akuma/akuma-instance.js +31 -9
  36. package/build/src/akuma/akuma-observe.d.ts +4 -0
  37. package/build/src/akuma/akuma-observe.js +14 -0
  38. package/build/src/akuma/akuma-owner.d.ts +6 -2
  39. package/build/src/akuma/akuma-owner.js +32 -10
  40. package/build/src/akuma/akuma-selection-execution.d.ts +3 -1
  41. package/build/src/akuma/akuma-selection-execution.js +2 -1
  42. package/build/src/akuma/akuma-wait.d.ts +2 -1
  43. package/build/src/akuma/akuma-wait.js +4 -1
  44. package/build/src/akuma/akuma.d.ts +35 -5
  45. package/build/src/akuma/akuma.js +8 -10
  46. package/build/src/akuma/archetype.d.ts +7 -15
  47. package/build/src/akuma/archetype.js +36 -35
  48. package/build/src/akuma/body.d.ts +6 -3
  49. package/build/src/akuma/body.js +41 -30
  50. package/build/src/akuma/call-request.d.ts +18 -10
  51. package/build/src/akuma/call-request.js +10 -3
  52. package/build/src/akuma/caller.d.ts +39 -0
  53. package/build/src/akuma/caller.js +36 -0
  54. package/build/src/akuma/dispatch-association.d.ts +0 -1
  55. package/build/src/akuma/dispatch-association.js +0 -3
  56. package/build/src/akuma/heart/facts.d.ts +16 -12
  57. package/build/src/akuma/heart/facts.js +8 -0
  58. package/build/src/akuma/heart/index.d.ts +2 -7
  59. package/build/src/akuma/heart/index.js +3 -17
  60. package/build/src/akuma/heart/rows.d.ts +3 -3
  61. package/build/src/akuma/heart/soul.d.ts +1 -1
  62. package/build/src/akuma/heart/soul.js +5 -24
  63. package/build/src/akuma/heart/storage.d.ts +5 -0
  64. package/build/src/akuma/heart/storage.js +7 -3
  65. package/build/src/akuma/identity.d.ts +0 -1
  66. package/build/src/akuma/identity.js +2 -5
  67. package/build/src/akuma/index.d.ts +5 -2
  68. package/build/src/akuma/index.js +1 -0
  69. package/build/src/akuma/nuke.js +6 -28
  70. package/build/src/akuma/projection.d.ts +0 -11
  71. package/build/src/akuma/provider-recipe.d.ts +7 -6
  72. package/build/src/akuma/provider-recipe.js +1 -1
  73. package/build/src/akuma/provider.d.ts +6 -10
  74. package/build/src/akuma/provider.js +6 -7
  75. package/build/src/akuma/providers/acp/events.js +5 -18
  76. package/build/src/akuma/providers/acp/index.js +2 -3
  77. package/build/src/akuma/providers/claude/events.js +35 -60
  78. package/build/src/akuma/providers/claude/index.d.ts +2 -2
  79. package/build/src/akuma/providers/claude/index.js +2 -3
  80. package/build/src/akuma/providers/codex-app-server/index.js +2 -2
  81. package/build/src/akuma/providers/decode.d.ts +25 -0
  82. package/build/src/akuma/providers/decode.js +44 -0
  83. package/build/src/akuma/providers/execution-environment.d.ts +2 -1
  84. package/build/src/akuma/providers/execution-environment.js +3 -0
  85. package/build/src/akuma/providers/grok-build/index.js +6 -22
  86. package/build/src/akuma/providers/index.js +2 -0
  87. package/build/src/akuma/providers/lifecycle.d.ts +9 -0
  88. package/build/src/akuma/providers/lifecycle.js +10 -0
  89. package/build/src/akuma/providers/opencode-sdk/events.js +1 -14
  90. package/build/src/akuma/providers/opencode-sdk/index.js +10 -17
  91. package/build/src/akuma/providers/opencode-sdk/session.js +1 -3
  92. package/build/src/akuma/providers/paseo/events.d.ts +25 -0
  93. package/build/src/akuma/providers/paseo/events.js +157 -0
  94. package/build/src/akuma/providers/paseo/index.d.ts +9 -0
  95. package/build/src/akuma/providers/paseo/index.js +353 -0
  96. package/build/src/akuma/providers/pi/events.js +5 -15
  97. package/build/src/akuma/publication.d.ts +2 -0
  98. package/build/src/akuma/publication.js +5 -0
  99. package/build/src/akuma/request-lifecycle.d.ts +3 -0
  100. package/build/src/akuma/request-lifecycle.js +25 -4
  101. package/build/src/akuma/requests.d.ts +3 -1
  102. package/build/src/akuma/requests.js +32 -0
  103. package/build/src/akuma/selection-observation.d.ts +72 -2
  104. package/build/src/akuma/selection-observation.js +0 -6
  105. package/build/src/akuma/selection-owner-port.d.ts +1 -1
  106. package/build/src/akuma/selection-owner-port.js +16 -5
  107. package/build/src/akuma/selection-request.d.ts +2 -0
  108. package/build/src/akuma/selection-request.js +2 -1
  109. package/build/src/akuma/turn-drive.js +2 -5
  110. package/build/src/akuma-body.js +4 -2
  111. package/build/src/cli/akuma-caller.d.ts +3 -0
  112. package/build/src/cli/akuma-caller.js +21 -0
  113. package/build/src/cli/commands/akuma-grammar.js +7 -12
  114. package/build/src/cli/commands/akuma.js +18 -16
  115. package/build/src/cli/commands/contract-grammar.d.ts +2 -1
  116. package/build/src/cli/commands/contract-grammar.js +13 -15
  117. package/build/src/cli/commands/contract-help.d.ts +2 -1
  118. package/build/src/cli/commands/contract-help.js +31 -1
  119. package/build/src/cli/commands/contract.js +24 -53
  120. package/build/src/cli/commands/install.js +3 -3
  121. package/build/src/cli/commands/task.js +18 -35
  122. package/build/src/cli/parse.d.ts +2 -2
  123. package/build/src/cli/render/catalog.d.ts +2 -5
  124. package/build/src/cli/render/contract-history.js +3 -6
  125. package/build/src/cli/render/contract.js +15 -50
  126. package/build/src/cli/render/receipt.js +3 -10
  127. package/build/src/cli/render/task.d.ts +4 -6
  128. package/build/src/cli/render/task.js +9 -26
  129. package/build/src/cli/runtime.d.ts +1 -1
  130. package/build/src/cli/runtime.js +11 -17
  131. package/build/src/cli/selectors.d.ts +3 -6
  132. package/build/src/cli/selectors.js +22 -53
  133. package/build/src/dispatch/index.d.ts +3 -3
  134. package/build/src/dispatch/index.js +1 -2
  135. package/build/src/git/observe.d.ts +6 -2
  136. package/build/src/git/observe.js +6 -2
  137. package/build/src/index.d.ts +6 -6
  138. package/build/src/index.js +2 -2
  139. package/build/src/kanshi/index.d.ts +1 -1
  140. package/build/src/kanshi/read.js +21 -6
  141. package/build/src/library/address.js +2 -4
  142. package/build/src/library/akuma-creation.d.ts +5 -1
  143. package/build/src/library/akuma-creation.js +33 -51
  144. package/build/src/library/akumas.d.ts +5 -4
  145. package/build/src/library/akumas.js +13 -9
  146. package/build/src/library/bind.d.ts +14 -14
  147. package/build/src/library/bind.js +11 -7
  148. package/build/src/library/contract-address.d.ts +9 -0
  149. package/build/src/library/contract-address.js +71 -0
  150. package/build/src/library/contract-composition.d.ts +4 -7
  151. package/build/src/library/contract-composition.js +6 -18
  152. package/build/src/library/contract-creation.d.ts +3 -5
  153. package/build/src/library/contract-creation.js +19 -17
  154. package/build/src/library/contract-execution.js +18 -23
  155. package/build/src/library/contract-outcomes.d.ts +2 -14
  156. package/build/src/library/contract-outcomes.js +2 -13
  157. package/build/src/library/contract-types.d.ts +36 -2
  158. package/build/src/library/delivery.d.ts +0 -2
  159. package/build/src/library/delivery.js +2 -5
  160. package/build/src/library/keiyaku.d.ts +0 -5
  161. package/build/src/library/keiyaku.js +6 -12
  162. package/build/src/library/outcome.d.ts +500 -499
  163. package/build/src/library/outcome.js +10 -0
  164. package/build/src/library/reconcile.js +8 -16
  165. package/build/src/library/refusal.d.ts +2 -2
  166. package/build/src/library/repo.d.ts +3 -2
  167. package/build/src/library/repo.js +10 -5
  168. package/build/src/library/selection.d.ts +4 -4
  169. package/build/src/library/selection.js +12 -9
  170. package/build/src/plugin/akuma-signals.d.ts +12 -11
  171. package/build/src/plugin/akuma-signals.js +40 -20
  172. package/build/src/plugin/public.d.ts +32 -2
  173. package/build/src/plugin/runtime.d.ts +1 -0
  174. package/build/src/plugin/runtime.js +35 -24
  175. package/build/src/protocol/amend.js +3 -2
  176. package/build/src/protocol/attempt.js +3 -8
  177. package/build/src/protocol/bind.d.ts +2 -2
  178. package/build/src/protocol/bind.js +1 -1
  179. package/build/src/protocol/deliver.js +3 -3
  180. package/build/src/protocol/operations.d.ts +1 -3
  181. package/build/src/protocol/operations.js +0 -8
  182. package/build/src/protocol/outcome.d.ts +1 -2
  183. package/build/src/protocol/outcome.js +1 -13
  184. package/build/src/protocol/placement.js +3 -10
  185. package/build/src/protocol/read/status.js +31 -70
  186. package/build/src/protocol/reintegrate.js +3 -10
  187. package/build/src/protocol/review.js +3 -3
  188. package/build/src/protocol/run.d.ts +5 -1
  189. package/build/src/protocol/run.js +3 -3
  190. package/build/src/runtime/proc/windows-launch.exe +0 -0
  191. package/package.json +12 -8
  192. package/plugins/pi/keiyaku.ts +57 -0
  193. package/skills/keiyaku/SKILL.md +44 -0
  194. package/skills/keiyaku-akuma/SKILL.md +130 -0
  195. package/skills/keiyaku-akuma/references/automation.md +269 -0
  196. package/skills/keiyaku-babysit/SKILL.md +65 -0
  197. package/skills/keiyaku-bind/SKILL.md +216 -0
  198. package/skills/keiyaku-bind/agents/openai.yaml +4 -0
  199. package/skills/keiyaku-task/SKILL.md +104 -0
  200. package/skills/keiyaku-workflow/SKILL.md +129 -0
  201. package/build/integrations/marketplace/.claude-plugin/marketplace.json +0 -5
  202. package/build/integrations/marketplace/plugins/keiyaku/package.json +0 -17
  203. package/build/src/cli/commands/amend.d.ts +0 -12
  204. package/build/src/cli/commands/amend.js +0 -10
  205. package/build/src/cli/commands/bind.d.ts +0 -11
  206. package/build/src/cli/commands/bind.js +0 -23
  207. package/build/src/dispatch/association.d.ts +0 -1
  208. package/build/src/dispatch/association.js +0 -1
  209. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku/SKILL.md +0 -0
  210. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-akuma/SKILL.md +0 -0
  211. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-akuma/references/automation.md +0 -0
  212. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-babysit/SKILL.md +0 -0
  213. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-bind/SKILL.md +0 -0
  214. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-bind/agents/openai.yaml +0 -0
  215. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-task/SKILL.md +0 -0
  216. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-workflow/SKILL.md +0 -0
  217. /package/build/{integrations/marketplace/plugins/keiyaku/opencode.js → plugins/opencode/index.js} +0 -0
@@ -1,3 +1,5 @@
1
+ /** @architectureCompositionRoot */
2
+ import { captureAkumaHostDiagnostic } from "../akuma/akuma-instance.js";
1
3
  import { readAkumaRoster } from "../akuma/akuma.js";
2
4
  import { localExecutionContext } from "../akuma/requests.js";
3
5
  import { readAliases } from "../alias/index.js";
@@ -10,11 +12,13 @@ class AkumasHandle {
10
12
  #world;
11
13
  #execution;
12
14
  #selection;
13
- constructor(world, execution) {
15
+ #reportDiagnostic;
16
+ constructor(world, execution, host) {
14
17
  this.#world = world;
15
18
  this.#execution = execution;
16
19
  // One typed route seam captured at construction: no operation re-derives it.
17
- this.#selection = selectionSeam(execution);
20
+ this.#reportDiagnostic = captureAkumaHostDiagnostic(host);
21
+ this.#selection = selectionSeam(execution, this.#reportDiagnostic);
18
22
  Object.freeze(this);
19
23
  }
20
24
  async list(input) {
@@ -25,13 +29,13 @@ class AkumasHandle {
25
29
  return withRosterAliases(roster, await readAliases(path));
26
30
  }
27
31
  call(input) {
28
- return callAkumas(this.withWorld(input, "Akumas.call input"), this.#execution);
32
+ return callAkumas(this.withWorld(input, "Akumas.call input"), this.#execution, this.#reportDiagnostic);
29
33
  }
30
34
  fork(input) {
31
35
  return forkAkumas(this.withWorld(input, "Akumas.fork input"));
32
36
  }
33
37
  status(input) {
34
- return statusAkuma(this.withWorld(input, "Akumas.status input"));
38
+ return statusAkuma(this.withWorld(input, "Akumas.status input"), this.#reportDiagnostic);
35
39
  }
36
40
  tell(input) {
37
41
  return tellAkumaOn(this.#selection, this.withWorld(input, "Akumas.tell input"));
@@ -46,7 +50,7 @@ class AkumasHandle {
46
50
  return killAkumaOn(this.#selection, this.withWorld(input, "Akumas.kill input"));
47
51
  }
48
52
  history(input) {
49
- return historyAkuma(this.withWorld(input, "Akumas.history input"));
53
+ return historyAkuma(this.withWorld(input, "Akumas.history input"), this.#reportDiagnostic);
50
54
  }
51
55
  withWorld(input, label) {
52
56
  const values = requireInput(input, label);
@@ -72,13 +76,13 @@ function withRosterAliases(roster, bindings) {
72
76
  * The one Akumas composition. Public `of` fixes local execution; CLI and Body pass their captured
73
77
  * internal channel through `akumasWithExecution` instead of a second constructor.
74
78
  */
75
- export function akumasWithExecution(world, execution) {
79
+ export function akumasWithExecution(world, execution, host) {
76
80
  if (typeof world !== "string")
77
81
  throw new TypeError("Akumas.of world must be a WorldRoot");
78
- return new AkumasHandle(world, execution);
82
+ return new AkumasHandle(world, execution, host);
79
83
  }
80
84
  export const Akumas = Object.freeze({
81
- of(world) {
82
- return akumasWithExecution(world, localExecutionContext());
85
+ of(world, host) {
86
+ return akumasWithExecution(world, localExecutionContext(), host);
83
87
  },
84
88
  });
@@ -21,7 +21,7 @@ export declare function admitForkBindWithAppointment(input: Readonly<{
21
21
  scope: RepositoryScope;
22
22
  channel: GitDecodeChannel;
23
23
  sourceId: ContractId;
24
- target?: string;
24
+ target?: string | null;
25
25
  progress?: ProtocolProgress;
26
26
  actor?: ActorId;
27
27
  }>): Promise<Readonly<{
@@ -35,7 +35,7 @@ export declare function prepareMarkdownBind(input: Readonly<{
35
35
  gates: readonly import("../core/facts/types.js").Gate[];
36
36
  after: readonly ContractId[];
37
37
  workspace: "worktree";
38
- targetSelection?: BindTargetSelection;
38
+ targetSelection: BindTargetSelection;
39
39
  task?: TaskId;
40
40
  progress?: ProtocolProgress;
41
41
  actor?: ActorId;
@@ -45,16 +45,16 @@ export declare function prepareMarkdownBind(input: Readonly<{
45
45
  result: IntentOutcome<Readonly<{
46
46
  contractId: ContractId;
47
47
  }>, {
48
- kind: "contract-exists" | "invalid-after" | "unknown-prerequisite";
49
- contractId: ContractId;
50
- } | {
51
48
  kind: "verification-declaration-invalid";
52
49
  contractId?: ContractId | undefined;
50
+ } | {
51
+ kind: "target-missing" | "unborn-head" | "invalid-target";
53
52
  } | {
54
53
  kind: "fork-source-moved";
55
54
  contractId: ContractId;
56
55
  } | {
57
- kind: "unborn-head" | "target-missing" | "invalid-target";
56
+ kind: "contract-exists" | "invalid-after" | "unknown-prerequisite";
57
+ contractId: ContractId;
58
58
  } | {
59
59
  kind: "fork-source-missing" | "fork-source-unavailable";
60
60
  contractId: ContractId;
@@ -64,16 +64,16 @@ export declare function prepareMarkdownBind(input: Readonly<{
64
64
  result: IntentOutcome<Readonly<{
65
65
  contractId: ContractId;
66
66
  }>, {
67
- kind: "contract-exists" | "invalid-after" | "unknown-prerequisite";
68
- contractId: ContractId;
69
- } | {
70
67
  kind: "verification-declaration-invalid";
71
68
  contractId?: ContractId | undefined;
69
+ } | {
70
+ kind: "target-missing" | "unborn-head" | "invalid-target";
72
71
  } | {
73
72
  kind: "fork-source-moved";
74
73
  contractId: ContractId;
75
74
  } | {
76
- kind: "unborn-head" | "target-missing" | "invalid-target";
75
+ kind: "contract-exists" | "invalid-after" | "unknown-prerequisite";
76
+ contractId: ContractId;
77
77
  } | {
78
78
  kind: "fork-source-missing" | "fork-source-unavailable";
79
79
  contractId: ContractId;
@@ -84,16 +84,16 @@ export declare function prepareMarkdownBind(input: Readonly<{
84
84
  result: IntentOutcome<Readonly<{
85
85
  contractId: ContractId;
86
86
  }>, {
87
- kind: "contract-exists" | "invalid-after" | "unknown-prerequisite";
88
- contractId: ContractId;
89
- } | {
90
87
  kind: "verification-declaration-invalid";
91
88
  contractId?: ContractId | undefined;
89
+ } | {
90
+ kind: "target-missing" | "unborn-head" | "invalid-target";
92
91
  } | {
93
92
  kind: "fork-source-moved";
94
93
  contractId: ContractId;
95
94
  } | {
96
- kind: "unborn-head" | "target-missing" | "invalid-target";
95
+ kind: "contract-exists" | "invalid-after" | "unknown-prerequisite";
96
+ contractId: ContractId;
97
97
  } | {
98
98
  kind: "fork-source-missing" | "fork-source-unavailable";
99
99
  contractId: ContractId;
@@ -12,6 +12,14 @@ import { KeiyakuError } from "./outcome.js";
12
12
  import { contractTerms, documentDerivation } from "./input.js";
13
13
  const CONTRACT_ID_CODE_POINTS = 32;
14
14
  const CONTRACT_ID_ATTEMPTS = 4;
15
+ /** A fork with no target copies its source; `null` clears it and a string overrides it. */
16
+ function forkTargetSelection(target, sourceTarget) {
17
+ if (target === null)
18
+ return { kind: "targetless" };
19
+ if (target !== undefined)
20
+ return { kind: "explicit", target };
21
+ return sourceTarget === undefined ? { kind: "targetless" } : { kind: "explicit", target: sourceTarget };
22
+ }
15
23
  function drawContractSuffix() {
16
24
  return randomBytes(2).toString("hex");
17
25
  }
@@ -22,10 +30,10 @@ async function attempt(input, id) {
22
30
  terms: input.terms,
23
31
  verification: input.verification,
24
32
  workspace: input.workspace,
33
+ targetSelection: input.targetSelection,
25
34
  ...(input.coordinates === undefined ? {} : { coordinates: input.coordinates }),
26
35
  ...(input.source === undefined ? {} : { source: input.source }),
27
36
  contractId: id,
28
- ...(input.targetSelection === undefined ? {} : { targetSelection: input.targetSelection }),
29
37
  ...(input.task === undefined
30
38
  ? {}
31
39
  : {
@@ -99,11 +107,7 @@ export async function admitForkBindWithAppointment(input) {
99
107
  terms,
100
108
  verification: documentDerivation(document, terms.gates).verification,
101
109
  workspace: "worktree",
102
- targetSelection: input.target === undefined
103
- ? source.coordinates.target === undefined
104
- ? { kind: "targetless" }
105
- : { kind: "explicit", target: source.coordinates.target }
106
- : { kind: "explicit", target: input.target },
110
+ targetSelection: forkTargetSelection(input.target, source.coordinates.target),
107
111
  coordinates: { start: source.coordinates.start },
108
112
  source: {
109
113
  contractId: input.sourceId,
@@ -125,7 +129,7 @@ export async function prepareMarkdownBind(input) {
125
129
  terms,
126
130
  verification: documentDerivation(input.document, terms.gates).verification,
127
131
  workspace: input.workspace,
128
- ...(input.targetSelection === undefined ? {} : { targetSelection: input.targetSelection }),
132
+ targetSelection: input.targetSelection,
129
133
  ...(input.task === undefined ? {} : { task: input.task }),
130
134
  ...(input.actor === undefined ? {} : { actor: input.actor }),
131
135
  ...(input.progress === undefined ? {} : { progress: input.progress }),
@@ -0,0 +1,9 @@
1
+ import type { ContractRow } from "../protocol/read/status.js";
2
+ import type { ContractResolution, ContractResolveInput } from "./contract-types.js";
3
+ /** Pure Contract membership shared with mixed Address; no cross-family judgment. */
4
+ export declare function matchContractCandidates(rows: readonly ContractRow[], selection: Readonly<{
5
+ selector: string;
6
+ }> | Readonly<{
7
+ cwd: string;
8
+ }>): readonly ContractRow[];
9
+ export declare function resolveContract(input: ContractResolveInput): Promise<ContractResolution>;
@@ -0,0 +1,71 @@
1
+ import { realpath, stat } from "node:fs/promises";
2
+ import { isAbsolute, normalize } from "node:path";
3
+ import { contractId } from "../core/facts/types.js";
4
+ import { withGitDecodeChannel } from "../git/read-observation.js";
5
+ import { contractsOperation } from "../protocol/operations.js";
6
+ import { requireInput } from "./input.js";
7
+ import { readContractValue } from "./outcome.js";
8
+ import { scopeForRepo } from "./repo.js";
9
+ /** Pure Contract membership shared with mixed Address; no cross-family judgment. */
10
+ export function matchContractCandidates(rows, selection) {
11
+ return rows.filter((row) => row.disposition === "active" &&
12
+ row.workspace === "worktree" &&
13
+ row.worktreePath !== null &&
14
+ ("selector" in selection
15
+ ? `@${row.id.slice("kei/".length)}` === selection.selector
16
+ : normalize(row.worktreePath) === selection.cwd));
17
+ }
18
+ export async function resolveContract(input) {
19
+ const values = requireInput(input, "Keiyaku.with().resolve input", ["repo", "selector", "cwd"]);
20
+ const scope = scopeForRepo(values.repo);
21
+ const selector = values.selector;
22
+ if (selector !== undefined && typeof selector !== "string")
23
+ throw new TypeError("selector must be a string");
24
+ const suppliedCwd = values.cwd;
25
+ if (suppliedCwd !== undefined && (typeof suppliedCwd !== "string" || !isAbsolute(suppliedCwd)))
26
+ throw new TypeError("cwd must be an absolute directory coordinate");
27
+ let cwd = scope.invocationWorktree;
28
+ if (typeof suppliedCwd === "string") {
29
+ try {
30
+ cwd = await realpath(suppliedCwd);
31
+ if (!(await stat(cwd)).isDirectory())
32
+ throw new TypeError("cwd must be a directory");
33
+ }
34
+ catch (cause) {
35
+ throw new TypeError("cwd must be an absolute directory coordinate", { cause });
36
+ }
37
+ }
38
+ if (selector !== undefined) {
39
+ if (selector.startsWith("@kei/"))
40
+ return { kind: "refused", refusal: { kind: "redundant-short-selector", selector } };
41
+ try {
42
+ const id = contractId(selector.startsWith("@") ? `kei/${selector.slice(1)}` : selector);
43
+ if (!selector.startsWith("@"))
44
+ return { kind: "resolved", id };
45
+ }
46
+ catch (error) {
47
+ return {
48
+ kind: "refused",
49
+ refusal: {
50
+ kind: "invalid-selector",
51
+ selector,
52
+ diagnostic: error instanceof Error ? error.message : String(error),
53
+ },
54
+ };
55
+ }
56
+ }
57
+ const board = await readContractValue(() => withGitDecodeChannel(scope, (channel) => contractsOperation({ scope, channel })));
58
+ const candidates = matchContractCandidates(board.rows, selector === undefined ? { cwd } : { selector });
59
+ if (candidates.length === 1)
60
+ return { kind: "resolved", id: candidates[0].id };
61
+ if (selector === undefined) {
62
+ return {
63
+ kind: "refused",
64
+ refusal: candidates.length === 0 ? { kind: "no-contextual-match", cwd } : { kind: "ambiguous-selector", cwd },
65
+ };
66
+ }
67
+ return {
68
+ kind: "refused",
69
+ refusal: candidates.length === 0 ? { kind: "unknown-short-selector", selector } : { kind: "ambiguous-selector", selector },
70
+ };
71
+ }
@@ -1,9 +1,8 @@
1
1
  /** @architectureCompositionRoot */
2
2
  import { type LibraryExecution } from "../akuma/requests.js";
3
- import type { BindTargetSelection } from "../protocol/bind.js";
4
3
  import type { ContractObservation } from "../protocol/read/status.js";
5
4
  import type { BindOutcome } from "./contract-outcomes.js";
6
- import type { BindInput, ContractList, ContractListInput, ContractObservationInput, KeiyakuSelectInput, LocalContractComposition } from "./contract-types.js";
5
+ import type { BindInput, ContractList, ContractListInput, ContractObservationInput, ContractResolveInput, ContractResolution, KeiyakuSelectInput, LocalContractComposition } from "./contract-types.js";
7
6
  import type { Keiyaku, createKeiyakuHandle } from "./keiyaku.js";
8
7
  import { type ReconcileCompletion, type RepoReconcileReport } from "./reconcile.js";
9
8
  import { type Repo } from "./repo.js";
@@ -24,6 +23,7 @@ interface KeiyakuLibraryReconcile {
24
23
  export type KeiyakuLibrary = Readonly<{
25
24
  bind(input: BindInput): Promise<BindOutcome>;
26
25
  select(input: KeiyakuSelectInput): Keiyaku;
26
+ resolve(input: ContractResolveInput): Promise<ContractResolution>;
27
27
  list(input: ContractListInput): Promise<ContractList>;
28
28
  observe(input: ContractObservationInput): Promise<ContractObservation>;
29
29
  reconcile: KeiyakuLibraryReconcile;
@@ -32,12 +32,9 @@ export type KeiyakuLibrary = Readonly<{
32
32
  * The one private Contract composition constructor. `Keiyaku.with` fixes local execution; CLI and
33
33
  * Body pass their captured internal channel explicitly here instead of a second constructor. The
34
34
  * carrier is a positional argument, never a field of the public construction input, so no runtime
35
- * value reaching the public surface can select a private channel. `omittedMarkdownTarget` is the
36
- * internal bind intent an edge supplies for a Markdown bind whose caller omitted the target; the
37
- * public package-root composition leaves it targetless.
35
+ * value reaching the public surface can select a private channel.
38
36
  */
39
- export declare function composeContractLibrary(execution: LibraryExecution, createHandle: typeof createKeiyakuHandle, input?: LocalContractComposition, omittedMarkdownTarget?: BindTargetSelection): KeiyakuLibrary;
37
+ export declare function composeContractLibrary(execution: LibraryExecution, createHandle: typeof createKeiyakuHandle, input?: LocalContractComposition): KeiyakuLibrary;
40
38
  export declare function listKeiyaku(input: ContractListInput): Promise<ContractList>;
41
39
  export declare function observeKeiyaku(input: ContractObservationInput): Promise<ContractObservation>;
42
- export declare function readContractValue<Value>(operation: () => Promise<Value>): Promise<Value>;
43
40
  export {};
@@ -3,25 +3,25 @@ import { localExecutionContext } from "../akuma/requests.js";
3
3
  import { contractId } from "../core/facts/types.js";
4
4
  import { withGitDecodeChannel } from "../git/read-observation.js";
5
5
  import { contractCatalogueOperation, contractObservationOperation, contractsOperation, } from "../protocol/operations.js";
6
+ import { resolveContract } from "./contract-address.js";
6
7
  import { bindKeiyaku } from "./contract-creation.js";
7
8
  import { captureLocalContractComposition, derivedHooks, } from "./contract-settings.js";
8
9
  import { requireInput } from "./input.js";
9
- import { KeiyakuError, errorCategory } from "./outcome.js";
10
+ import { readContractValue } from "./outcome.js";
10
11
  import { completeReconcile, completeRepoReconcile, } from "./reconcile.js";
11
12
  import { scopeForRepo } from "./repo.js";
12
13
  /**
13
14
  * The one private Contract composition constructor. `Keiyaku.with` fixes local execution; CLI and
14
15
  * Body pass their captured internal channel explicitly here instead of a second constructor. The
15
16
  * carrier is a positional argument, never a field of the public construction input, so no runtime
16
- * value reaching the public surface can select a private channel. `omittedMarkdownTarget` is the
17
- * internal bind intent an edge supplies for a Markdown bind whose caller omitted the target; the
18
- * public package-root composition leaves it targetless.
17
+ * value reaching the public surface can select a private channel.
19
18
  */
20
- export function composeContractLibrary(execution, createHandle, input, omittedMarkdownTarget = { kind: "targetless" }) {
19
+ export function composeContractLibrary(execution, createHandle, input) {
21
20
  const composition = captureLocalContractComposition(input);
22
21
  return Object.freeze({
23
- bind: (operation) => bindKeiyaku(operation, createHandle, execution, composition, omittedMarkdownTarget),
22
+ bind: (operation) => bindKeiyaku(operation, createHandle, execution, composition),
24
23
  select: (operation) => selectKeiyaku(operation, createHandle, execution, composition),
24
+ resolve: resolveContract,
25
25
  list: (operation) => listKeiyaku(operation),
26
26
  observe: (operation) => observeKeiyaku(operation),
27
27
  reconcile: reconcileOperation(composition),
@@ -93,15 +93,3 @@ export async function observeKeiyaku(input) {
93
93
  }
94
94
  return readContractValue(() => withGitDecodeChannel(scope, (channel) => contractObservationOperation({ scope, channel, contractId: id })));
95
95
  }
96
- export async function readContractValue(operation) {
97
- try {
98
- return await operation();
99
- }
100
- catch (error) {
101
- if (error instanceof KeiyakuError)
102
- throw error;
103
- throw new KeiyakuError(errorCategory(error), error instanceof Error ? error.message : String(error), {
104
- cause: error,
105
- });
106
- }
107
- }
@@ -1,13 +1,11 @@
1
1
  /** @architectureCompositionRoot */
2
2
  import { type ExecutionContext } from "../akuma/requests.js";
3
- import type { BindTargetSelection } from "../protocol/bind.js";
4
3
  import type { BindOutcome } from "./contract-outcomes.js";
5
4
  import { type LocalContractCompositionCapture } from "./contract-settings.js";
6
5
  import type { BindInput } from "./contract-types.js";
7
6
  import type { createKeiyakuHandle } from "./keiyaku.js";
8
7
  /**
9
- * One Contract bind. `omittedMarkdownTarget` is the internal composition input an edge
10
- * supplies for a Markdown bind whose caller omitted the target: the public package-root
11
- * composition leaves it targetless, while the CLI names the invocation branch.
8
+ * One Contract bind. An omitted Markdown target names the current branch of the caller's explicit
9
+ * Repo worktree coordinate, `null` is deliberately targetless, and a string is that literal target.
12
10
  */
13
- export declare function bindKeiyaku(input: BindInput, createHandle: typeof createKeiyakuHandle, execution?: ExecutionContext, composition?: LocalContractCompositionCapture, omittedMarkdownTarget?: BindTargetSelection): Promise<BindOutcome>;
11
+ export declare function bindKeiyaku(input: BindInput, createHandle: typeof createKeiyakuHandle, execution?: ExecutionContext, composition?: LocalContractCompositionCapture): Promise<BindOutcome>;
@@ -7,7 +7,7 @@ import { withGitDecodeChannel } from "../git/read-observation.js";
7
7
  import { executionStop, isOperationalFailure, isOperationalStop } from "../protocol/progress.js";
8
8
  import { readManagedWorktreeAppointment } from "../workspace-place.js";
9
9
  import { admitForkBindWithAppointment, prepareMarkdownBind } from "./bind.js";
10
- import { acceptedOutcome, conclusions, expected, retainAdmission } from "./contract-outcomes.js";
10
+ import { acceptedOutcome, expected, retainAdmission } from "./contract-outcomes.js";
11
11
  import { captureLocalContractComposition, derivedGates, derivedHooks, gateNames, } from "./contract-settings.js";
12
12
  import { actorOption, normalizedList, requireInput, requireMarkdown, taskOption } from "./input.js";
13
13
  import { InvocationAccumulator } from "./invocation.js";
@@ -15,6 +15,12 @@ import { project, validated } from "./outcome.js";
15
15
  import { reconcileAffectedContracts } from "./reconcile.js";
16
16
  import { observeRegion } from "./region.js";
17
17
  import { scopeForRepo } from "./repo.js";
18
+ /** The one place a caller's omitted target becomes product behavior. */
19
+ function bindTargetSelection(target) {
20
+ if (target === undefined)
21
+ return { kind: "current-branch" };
22
+ return target === null ? { kind: "targetless" } : { kind: "explicit", target };
23
+ }
18
24
  function bindInput(input, composition) {
19
25
  return validated(() => {
20
26
  const values = requireInput(input, "Keiyaku.bind input");
@@ -25,8 +31,8 @@ function bindInput(input, composition) {
25
31
  requireInput(input, "Keiyaku.bind input", allowed);
26
32
  if ((values.workspace ?? "worktree") !== "worktree")
27
33
  throw new TypeError("workspace must be worktree");
28
- if (values.target !== undefined && typeof values.target !== "string")
29
- throw new TypeError("target must be a string");
34
+ if (values.target !== undefined && values.target !== null && typeof values.target !== "string")
35
+ throw new TypeError("target must be a string or null");
30
36
  const actor = actorOption(values.actor);
31
37
  const document = forkOf === undefined ? parseMarkdown(requireMarkdown(values.markdown)) : undefined;
32
38
  if (forkOf !== undefined) {
@@ -47,11 +53,10 @@ function bindInput(input, composition) {
47
53
  });
48
54
  }
49
55
  /**
50
- * One Contract bind. `omittedMarkdownTarget` is the internal composition input an edge
51
- * supplies for a Markdown bind whose caller omitted the target: the public package-root
52
- * composition leaves it targetless, while the CLI names the invocation branch.
56
+ * One Contract bind. An omitted Markdown target names the current branch of the caller's explicit
57
+ * Repo worktree coordinate, `null` is deliberately targetless, and a string is that literal target.
53
58
  */
54
- export async function bindKeiyaku(input, createHandle, execution = localExecutionContext(), composition = captureLocalContractComposition(), omittedMarkdownTarget = { kind: "targetless" }) {
59
+ export async function bindKeiyaku(input, createHandle, execution = localExecutionContext(), composition = captureLocalContractComposition()) {
55
60
  const prepared = bindInput(input, composition);
56
61
  const hooks = derivedHooks(composition);
57
62
  const { forkOf, scope, document, target, actor } = prepared;
@@ -84,7 +89,7 @@ export async function bindKeiyaku(input, createHandle, execution = localExecutio
84
89
  }
85
90
  if (document === undefined)
86
91
  throw new Error("Markdown bind requires its prepared document");
87
- return await markdownBind(prepared, document, hooks, scope, channel, accumulator, handle, omittedMarkdownTarget);
92
+ return await markdownBind(prepared, document, hooks, scope, channel, accumulator, handle);
88
93
  })();
89
94
  return completed;
90
95
  }, (error) => {
@@ -109,19 +114,16 @@ export async function bindKeiyaku(input, createHandle, execution = localExecutio
109
114
  throw projected.error;
110
115
  return projected.outcome;
111
116
  }
112
- function bindValue(keiyaku, region, warnings, workspace, appointmentLag) {
113
- const base = {
117
+ function bindValue(keiyaku, region, warnings) {
118
+ return {
114
119
  keiyaku,
115
- ...(workspace === undefined ? {} : { workspace }),
116
120
  ...(warnings.length === 0 ? {} : { warnings }),
117
121
  ...region,
118
122
  };
119
- void appointmentLag;
120
- return base;
121
123
  }
122
124
  // eslint-disable-next-line max-params -- Keep this local operation's custody, admission, and policy witnesses explicit.
123
125
  async function bindComplete(accumulator, id, scope, channel, leading, hooks, value) {
124
- retainAdmission(accumulator, id, leading, false);
126
+ retainAdmission(accumulator, id, leading);
125
127
  await reconcileAffectedContracts(accumulator, id, scope, channel, hooks);
126
128
  try {
127
129
  const appointment = await readManagedWorktreeAppointment(scope, id);
@@ -136,15 +138,15 @@ async function bindComplete(accumulator, id, scope, channel, leading, hooks, val
136
138
  accumulator.recordStop(executionStop(id, "reconciliation", error, scope.signal));
137
139
  }
138
140
  const built = { ...(await value()), ...accumulator.conclusions(id) };
139
- accumulator.extendConclusions(id, conclusions(built));
141
+ accumulator.extendConclusions(id, built);
140
142
  return built;
141
143
  }
142
144
  // eslint-disable-next-line max-params -- Keep this local operation's custody, admission, and policy witnesses explicit.
143
- async function markdownBind(prepared, document, hooks, scope, channel, accumulator, handle, omittedMarkdownTarget) {
145
+ async function markdownBind(prepared, document, hooks, scope, channel, accumulator, handle) {
144
146
  const { task, target, actor, gates, after } = prepared;
145
147
  if (gates === undefined || after === undefined)
146
148
  throw new Error("Markdown bind requires prepared terms");
147
- const targetSelection = target !== undefined ? { kind: "explicit", target } : omittedMarkdownTarget;
149
+ const targetSelection = bindTargetSelection(target);
148
150
  const admission = await prepareMarkdownBind({
149
151
  scope,
150
152
  channel,
@@ -19,7 +19,7 @@ import { admitReviewOperation } from "../protocol/review.js";
19
19
  import { releaseTaskHolder, releaseTaskHolderWithFence, taskHolderObservationSelection } from "../settlement/holder.js";
20
20
  import { continueDeliveredDependents } from "./continuation.js";
21
21
  import { requestForwardedContractLive } from "./contract-operations.js";
22
- import { acceptedOutcome, admissionOf, conclusions, expected, retainAdmission } from "./contract-outcomes.js";
22
+ import { acceptedOutcome, expected, retainAdmission } from "./contract-outcomes.js";
23
23
  import { derivedContractPolicy, derivedGates, derivedHooks, gateNames, } from "./contract-settings.js";
24
24
  import { deliveryForContract } from "./delivery.js";
25
25
  import { actorOption, contractTerms, documentDerivation, normalizedList, optionalBoolean, optionalNonblank, optionalSignal, requireInput, requireMarkdown, } from "./input.js";
@@ -66,7 +66,7 @@ export class ContractExecution {
66
66
  });
67
67
  let changedSections;
68
68
  return await this.local("amend", async (accumulator, channel, scope) => {
69
- const admission = admissionOf(await amendOperation({
69
+ const admission = await amendOperation({
70
70
  scope,
71
71
  channel,
72
72
  contractId: this.id,
@@ -87,20 +87,18 @@ export class ContractExecution {
87
87
  : contractTerms(amended, gates ?? source.gates, prerequisites ?? source.after);
88
88
  return { terms, verification: documentDerivation(amended, terms.gates, this.id).verification };
89
89
  },
90
- }));
90
+ });
91
91
  if (admission.kind !== "accepted")
92
92
  return expected(this.id, admission);
93
- const accepted = admission.accepted;
94
- const changes = changedAmendTerms(accepted.value.source, accepted.value.terms);
95
- const diff = documentDiff("before", "after", accepted.value.source.document.bytes, accepted.value.terms.document.bytes);
93
+ const changes = changedAmendTerms(admission.value.source, admission.value.terms);
94
+ const diff = documentDiff("before", "after", admission.value.source.document.bytes, admission.value.terms.document.bytes);
96
95
  accumulator.extendConclusions(this.id, { documentDiff: diff, changes });
97
- const region = await observeChangedRegion(scope, this.id, changedSections, decodeContractDocument(accepted.value.terms.document.bytes).region);
96
+ const region = await observeChangedRegion(scope, this.id, changedSections, decodeContractDocument(admission.value.terms.document.bytes).region);
98
97
  const value = await this.conclude(accumulator, {
99
98
  scope,
100
99
  channel,
101
- leading: accepted,
100
+ leading: admission,
102
101
  hooks,
103
- verificationResidueRecorded: false,
104
102
  value: () => ({
105
103
  documentDiff: diff,
106
104
  changes,
@@ -247,7 +245,7 @@ export class ContractExecution {
247
245
  });
248
246
  const hooks = derivedHooks(this.composition);
249
247
  return await this.local("abandon", async (accumulator, channel, scope) => {
250
- const admission = admissionOf((await releaseTaskHolderWithFence(scope, channel, this.id, () => abandonOperation({
248
+ const admission = (await releaseTaskHolderWithFence(scope, channel, this.id, () => abandonOperation({
251
249
  scope,
252
250
  channel,
253
251
  contractId: this.id,
@@ -259,15 +257,14 @@ export class ContractExecution {
259
257
  const companion = await releaseTaskHolder(channel, observation, owner);
260
258
  return companion === null ? [] : [companion];
261
259
  },
262
- }))).result);
260
+ }))).result;
263
261
  if (admission.kind !== "accepted")
264
262
  return expected(this.id, admission);
265
263
  await this.conclude(accumulator, {
266
264
  scope,
267
265
  channel,
268
- leading: admission.accepted,
266
+ leading: admission,
269
267
  hooks,
270
- verificationResidueRecorded: false,
271
268
  value: () => ({}),
272
269
  });
273
270
  return acceptedOutcome("abandon", this.id, accumulator, undefined);
@@ -283,22 +280,21 @@ export class ContractExecution {
283
280
  });
284
281
  const hooks = derivedHooks(this.composition);
285
282
  return await this.local("arc", async (accumulator, channel, scope) => {
286
- const admission = admissionOf(await arcOperation({
283
+ const admission = await arcOperation({
287
284
  scope,
288
285
  channel,
289
286
  contractId: this.id,
290
287
  ...actor,
291
288
  chapter,
292
289
  progress: accumulator,
293
- }));
290
+ });
294
291
  if (admission.kind !== "accepted")
295
292
  return expected(this.id, admission);
296
293
  await this.conclude(accumulator, {
297
294
  scope,
298
295
  channel,
299
- leading: admission.accepted,
296
+ leading: admission,
300
297
  hooks,
301
- verificationResidueRecorded: false,
302
298
  value: () => ({}),
303
299
  });
304
300
  return acceptedOutcome("arc", this.id, accumulator, undefined);
@@ -327,7 +323,7 @@ export class ContractExecution {
327
323
  });
328
324
  const { hooks, requireBranchesToBeUpToDate } = derivedContractPolicy(this.composition);
329
325
  return await this.local("audit", async (accumulator, localChannel, scope) => {
330
- const admission = admissionOf(await auditOperation({
326
+ const admission = await auditOperation({
331
327
  scope,
332
328
  channel: localChannel,
333
329
  progress: accumulator,
@@ -338,15 +334,14 @@ export class ContractExecution {
338
334
  requireBranchesToBeUpToDate,
339
335
  ...(signal === undefined ? {} : { signal }),
340
336
  ...(this.composition.actor === undefined ? {} : { actor: this.composition.actor }),
341
- }));
337
+ });
342
338
  if (admission.kind !== "accepted")
343
339
  return expected(this.id, admission);
344
340
  const report = await this.conclude(accumulator, {
345
341
  scope,
346
342
  channel: localChannel,
347
- leading: admission.accepted,
343
+ leading: admission,
348
344
  hooks,
349
- verificationResidueRecorded: false,
350
345
  value: (value) => value,
351
346
  });
352
347
  return acceptedOutcome("audit", this.id, accumulator, report);
@@ -380,9 +375,9 @@ export class ContractExecution {
380
375
  return projected.outcome;
381
376
  }
382
377
  async conclude(accumulator, input) {
383
- retainAdmission(accumulator, this.id, input.leading, input.verificationResidueRecorded);
378
+ retainAdmission(accumulator, this.id, input.leading);
384
379
  const value = input.value(input.leading.value);
385
- accumulator.extendConclusions(this.id, conclusions(value));
380
+ accumulator.extendConclusions(this.id, value);
386
381
  await reconcileAffectedContracts(accumulator, this.id, input.scope, input.channel, input.hooks);
387
382
  return value;
388
383
  }
@@ -41,17 +41,6 @@ export type BindResult = BindOutcome;
41
41
  type AcceptedIntent<Value> = Extract<IntentOutcome<Value>, {
42
42
  kind: "accepted";
43
43
  }>;
44
- type Admission<Value, Refusal> = Readonly<{
45
- kind: "accepted";
46
- accepted: AcceptedIntent<Value>;
47
- }> | Readonly<{
48
- kind: "refused";
49
- refusal: Refusal;
50
- }> | Readonly<{
51
- kind: "retry";
52
- reason: IntentRetry;
53
- }>;
54
- export declare function admissionOf<Value, Refusal>(outcome: IntentOutcome<Value, Refusal>): Admission<Value, Refusal>;
55
44
  /** The refused/retry arms are value-agnostic, so every operation can return them unchanged. */
56
45
  type ExpectedProjection<Refusal> = Readonly<{
57
46
  kind: "refused";
@@ -62,10 +51,9 @@ type ExpectedProjection<Refusal> = Readonly<{
62
51
  contract?: ContractId;
63
52
  reason: IntentRetry;
64
53
  }>;
65
- export declare function expected<Refusal>(contract: ContractId | undefined, admission: Exclude<Admission<unknown, Refusal>, {
54
+ export declare function expected<Refusal>(contract: ContractId | undefined, admission: Exclude<IntentOutcome<unknown, Refusal>, {
66
55
  kind: "accepted";
67
56
  }>): ExpectedProjection<Refusal>;
68
57
  export declare function acceptedOutcome<Operation extends ContractVerb, Value>(operation: Operation, contract: ContractId, accumulator: InvocationAccumulator, value: Value): OutcomeProjection<Operation, Value, never>;
69
- export declare function conclusions(value: object): Readonly<Record<string, unknown>>;
70
- export declare function retainAdmission<Value>(accumulator: InvocationAccumulator, contract: ContractId, leading: AcceptedIntent<Value>, verificationResidueRecorded: boolean): void;
58
+ export declare function retainAdmission<Value>(accumulator: InvocationAccumulator, contract: ContractId, leading: AcceptedIntent<Value>): void;
71
59
  export {};