@astrosheep/keiyaku 4.6.32 → 4.6.33
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 +8 -6
- package/build/plugins/claude/skills/keiyaku-akuma/SKILL.md +13 -9
- package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +13 -9
- package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +13 -9
- package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/pi/README.md +55 -97
- package/build/plugins/pi/keiyaku.ts +2 -9
- package/build/skills/keiyaku-akuma/SKILL.md +13 -9
- package/build/skills/keiyaku-babysit/SKILL.md +8 -6
- package/build/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/src/akuma/akuma-instance.d.ts +11 -0
- package/build/src/akuma/akuma-instance.js +1 -2
- package/build/src/akuma/akuma-observe.js +73 -14
- package/build/src/akuma/akuma-selection-execution.d.ts +82 -7
- package/build/src/akuma/akuma-selection-execution.js +26 -27
- package/build/src/akuma/akuma-wait.d.ts +40 -1
- package/build/src/akuma/akuma-wait.js +58 -29
- package/build/src/akuma/akuma.d.ts +11 -0
- package/build/src/akuma/body.js +13 -18
- package/build/src/akuma/call-initial-tell.d.ts +0 -1
- package/build/src/akuma/call-initial-tell.js +0 -1
- package/build/src/akuma/heart/activity-schema.d.ts +16 -0
- package/build/src/akuma/heart/activity-schema.js +7 -0
- package/build/src/akuma/heart/index.d.ts +1 -1
- package/build/src/akuma/heart/index.js +9 -1
- package/build/src/akuma/heart/timeline.js +4 -4
- package/build/src/akuma/projection-read.d.ts +4 -2
- package/build/src/akuma/projection-read.js +21 -14
- package/build/src/akuma/projection.d.ts +94 -2
- package/build/src/akuma/projection.js +47 -47
- package/build/src/akuma/provider.d.ts +2 -2
- package/build/src/akuma/provider.js +27 -20
- package/build/src/akuma/providers/acp/core.js +2 -5
- package/build/src/akuma/providers/opencode-sdk/events.d.ts +2 -1
- package/build/src/akuma/providers/opencode-sdk/events.js +31 -1
- package/build/src/akuma/publication.js +3 -2
- package/build/src/akuma/selection-observation.d.ts +23 -0
- package/build/src/akuma/selection-observation.js +15 -4
- package/build/src/akuma/status-projection.d.ts +14 -1
- package/build/src/akuma/status-projection.js +40 -2
- package/build/src/akuma/turn-drive.js +21 -15
- package/build/src/body/amend.js +5 -17
- package/build/src/body/decode.js +11 -1
- package/build/src/body/envelope.d.ts +5 -1
- package/build/src/body/envelope.js +4 -2
- package/build/src/body/render.js +4 -6
- package/build/src/cli/commands/akuma-grammar.d.ts +3 -5
- package/build/src/cli/commands/akuma-grammar.js +22 -40
- package/build/src/cli/commands/akuma.d.ts +1 -2
- package/build/src/cli/commands/akuma.js +6 -58
- package/build/src/cli/commands/contract-grammar.d.ts +1 -0
- package/build/src/cli/commands/contract-grammar.js +7 -11
- package/build/src/cli/commands/contract-help.d.ts +3 -2
- package/build/src/cli/commands/contract-help.js +11 -5
- package/build/src/cli/commands/contract.js +3 -0
- package/build/src/cli/commands/debt-grammar.js +2 -4
- package/build/src/cli/parse.js +1 -4
- package/build/src/cli/render/akuma-activity.d.ts +3 -15
- package/build/src/cli/render/akuma-activity.js +19 -73
- package/build/src/cli/render/akuma.d.ts +5 -11
- package/build/src/cli/render/akuma.js +22 -30
- package/build/src/cli/render/catalog.js +1 -4
- package/build/src/cli/render/contract-history.js +2 -0
- package/build/src/cli/render/contract-observation.d.ts +2 -1
- package/build/src/cli/render/contract-observation.js +25 -1
- package/build/src/cli/render/contract-wait.d.ts +2 -2
- package/build/src/cli/render/contract-wait.js +13 -17
- package/build/src/cli/render/contract.js +12 -9
- package/build/src/cli/render/debt.js +1 -2
- package/build/src/cli/render/execution-progress.js +1 -3
- package/build/src/cli/render/kanshi-akuma.js +1 -2
- package/build/src/cli/render/kanshi.js +11 -17
- package/build/src/cli/render/receipt.d.ts +1 -1
- package/build/src/cli/render/receipt.js +33 -28
- package/build/src/cli/render/reconcile.js +2 -5
- package/build/src/cli/render/refusal.js +3 -6
- package/build/src/cli/render/terminal.d.ts +2 -4
- package/build/src/cli/render/terminal.js +10 -17
- package/build/src/cli/render/verbs.d.ts +1 -0
- package/build/src/cli/render/verbs.js +19 -17
- package/build/src/cli/runtime.js +3 -9
- package/build/src/core/facts/codec.js +7 -2
- package/build/src/core/facts/eligibility.d.ts +4 -4
- package/build/src/core/facts/eligibility.js +11 -0
- package/build/src/core/facts/fold.js +9 -5
- package/build/src/core/facts/gate.d.ts +5 -1
- package/build/src/core/facts/gate.js +14 -10
- package/build/src/core/facts/types.d.ts +5 -1
- package/build/src/core/facts/types.js +7 -0
- package/build/src/core/subject.d.ts +4 -1
- package/build/src/core/subject.js +10 -2
- package/build/src/core/verbs/amend.d.ts +15 -4
- package/build/src/core/verbs/amend.js +19 -9
- package/build/src/debt/index.d.ts +0 -1
- package/build/src/debt/index.js +6 -11
- package/build/src/debt/input.d.ts +2 -1
- package/build/src/debt/input.js +6 -4
- package/build/src/dispatch/index.d.ts +0 -17
- package/build/src/dispatch/index.js +1 -10
- package/build/src/git/identity.js +16 -45
- package/build/src/git/nuke.js +13 -23
- package/build/src/git/observe.d.ts +3 -0
- package/build/src/git/observe.js +25 -23
- package/build/src/git/process.js +11 -18
- package/build/src/git/read-observation.d.ts +5 -4
- package/build/src/git/repository.d.ts +2 -0
- package/build/src/git/repository.js +13 -1
- package/build/src/git/scratch.js +2 -14
- package/build/src/git/terminal-reconcile.js +1 -13
- package/build/src/index.d.ts +2 -0
- package/build/src/kanshi/index.d.ts +0 -1
- package/build/src/kanshi/index.js +0 -1
- package/build/src/kanshi/read.d.ts +21 -0
- package/build/src/kanshi/read.js +2 -1
- package/build/src/kanshi/report.d.ts +94 -0
- package/build/src/library/address.d.ts +12 -5
- package/build/src/library/address.js +18 -32
- package/build/src/library/akuma-creation.d.ts +39 -0
- package/build/src/library/akuma-creation.js +3 -9
- package/build/src/library/continuation.d.ts +10 -0
- package/build/src/library/contract-creation.js +10 -11
- package/build/src/library/contract-outcomes.d.ts +72 -1
- package/build/src/library/contract-outcomes.js +1 -0
- package/build/src/library/contract-types.d.ts +18 -0
- package/build/src/library/contract-types.js +2 -0
- package/build/src/library/contract-wait.d.ts +7 -0
- package/build/src/library/contract-wait.js +53 -49
- package/build/src/library/delivery.d.ts +25 -0
- package/build/src/library/input.d.ts +5 -23
- package/build/src/library/input.js +12 -7
- package/build/src/library/kei.js +39 -20
- package/build/src/library/keiyaku-classify.js +3 -3
- package/build/src/library/keiyaku-debt.js +1 -2
- package/build/src/library/keiyaku-identity.d.ts +3 -3
- package/build/src/library/keiyaku-identity.js +11 -6
- package/build/src/library/keiyaku-verbs.d.ts +456 -1362
- package/build/src/library/keiyaku-verbs.js +80 -92
- package/build/src/library/keiyaku-wait.d.ts +183 -0
- package/build/src/library/keiyaku-wait.js +213 -0
- package/build/src/library/keiyaku.d.ts +3 -1
- package/build/src/library/keiyaku.js +49 -73
- package/build/src/{mcp/output.d.ts → library/model-tools.d.ts} +227 -56
- package/build/src/library/model-tools.js +347 -0
- package/build/src/library/outcome.js +5 -6
- package/build/src/library/refusal.d.ts +25 -1
- package/build/src/library/refusal.js +4 -5
- package/build/src/library/selection.d.ts +12 -0
- package/build/src/library/selection.js +1 -2
- package/build/src/mcp/adapter.d.ts +0 -6
- package/build/src/mcp/adapter.js +10 -159
- package/build/src/mcp/description.d.ts +2 -0
- package/build/src/mcp/description.js +2 -0
- package/build/src/mcp/help.d.ts +1 -1
- package/build/src/mcp/help.js +6 -4
- package/build/src/pi/index.d.ts +3 -0
- package/build/src/pi/index.js +83 -0
- package/build/src/protocol/amend.d.ts +14 -3
- package/build/src/protocol/amend.js +113 -46
- package/build/src/protocol/bind.d.ts +1 -1
- package/build/src/protocol/bind.js +5 -16
- package/build/src/protocol/completion.d.ts +30 -0
- package/build/src/protocol/completion.js +8 -5
- package/build/src/protocol/deliver.js +7 -20
- package/build/src/protocol/delivery-preview.d.ts +5 -0
- package/build/src/protocol/execution-observation.d.ts +8 -0
- package/build/src/protocol/intent.d.ts +1 -0
- package/build/src/protocol/intent.js +4 -1
- package/build/src/protocol/operations.d.ts +54 -16
- package/build/src/protocol/operations.js +17 -31
- package/build/src/protocol/placement.js +7 -1
- package/build/src/protocol/progress.js +0 -6
- package/build/src/protocol/read/status.d.ts +40 -0
- package/build/src/protocol/read/status.js +7 -10
- package/build/src/protocol/reintegrate.js +2 -2
- package/build/src/protocol/result-leaves.d.ts +56 -8
- package/build/src/protocol/result-leaves.js +11 -2
- package/build/src/protocol/run.js +1 -4
- package/build/src/protocol/verify.d.ts +10 -0
- package/build/src/protocol/verify.js +1 -0
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/build/src/settlement/settle.js +19 -68
- package/package.json +7 -3
- package/plugins/pi/README.md +55 -97
- package/plugins/pi/keiyaku.ts +2 -9
- package/skills/keiyaku-akuma/SKILL.md +13 -9
- package/skills/keiyaku-babysit/SKILL.md +8 -6
- package/skills/keiyaku-workflow/SKILL.md +2 -1
- package/build/plugins/pi/akuma-tools.ts +0 -283
- package/build/src/body/keys.d.ts +0 -4
- package/build/src/body/keys.js +0 -11
- package/build/src/kanshi/roster.d.ts +0 -2
- package/build/src/kanshi/roster.js +0 -2
- package/build/src/mcp/output.js +0 -193
- package/plugins/pi/akuma-tools.ts +0 -283
package/build/src/debt/input.js
CHANGED
|
@@ -8,11 +8,14 @@ export function record(value, label) {
|
|
|
8
8
|
}
|
|
9
9
|
return value;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/** One closed caller object: an object with only the fields its surface names. */
|
|
12
|
+
export function fields(value, allowed, label) {
|
|
13
|
+
const recordValue = record(value, label);
|
|
14
|
+
for (const key of Object.keys(recordValue)) {
|
|
13
15
|
if (!allowed.includes(key))
|
|
14
16
|
throw new KeiyakuError("invalid-input", `${label} has unknown field: ${key}`);
|
|
15
17
|
}
|
|
18
|
+
return recordValue;
|
|
16
19
|
}
|
|
17
20
|
export function debtId(value) {
|
|
18
21
|
if (typeof value !== "string")
|
|
@@ -74,8 +77,7 @@ export function addInput(input) {
|
|
|
74
77
|
return parseDebtInput(addDebtInputSchema.extend({ signal: signalSchema }), input);
|
|
75
78
|
}
|
|
76
79
|
export function addDocumentInput(input) {
|
|
77
|
-
const v =
|
|
78
|
-
closed(v, ["markdown", "signal"], "addDocument input");
|
|
80
|
+
const v = fields(input, ["markdown", "signal"], "addDocument input");
|
|
79
81
|
const markdown = text(v.markdown, "markdown");
|
|
80
82
|
if (markdown === undefined)
|
|
81
83
|
throw new KeiyakuError("invalid-input", "markdown is required");
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import { type ContractId } from "../core/facts/types.js";
|
|
3
2
|
import { type AkumaId } from "../akuma/identity.js";
|
|
4
3
|
import { type PrivateStateSeatCloseLag } from "../git/private-state-seat.js";
|
|
5
4
|
import type { GitRepository } from "../git/process.js";
|
|
6
5
|
import { type GitReadObservation } from "../git/read-observation.js";
|
|
7
6
|
import { type DispatchAssociation } from "../akuma/dispatch-association.js";
|
|
8
|
-
export declare const dispatchSchema: z.ZodReadonly<z.ZodObject<{
|
|
9
|
-
akumaId: z.ZodPipe<z.ZodString, z.ZodTransform<AkumaId, string>>;
|
|
10
|
-
contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
11
|
-
dispatchedAt: z.ZodString;
|
|
12
|
-
}, z.core.$strict>>;
|
|
13
|
-
export declare const dispatchFailureSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
14
|
-
kind: z.ZodLiteral<"conflict">;
|
|
15
|
-
current: z.ZodReadonly<z.ZodObject<{
|
|
16
|
-
akumaId: z.ZodPipe<z.ZodString, z.ZodTransform<AkumaId, string>>;
|
|
17
|
-
contractId: z.ZodPipe<z.ZodString, z.ZodTransform<ContractId, string>>;
|
|
18
|
-
dispatchedAt: z.ZodString;
|
|
19
|
-
}, z.core.$strict>>;
|
|
20
|
-
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
21
|
-
kind: z.ZodLiteral<"publication-failed">;
|
|
22
|
-
diagnostic: z.ZodString;
|
|
23
|
-
}, z.core.$strict>>]>;
|
|
24
7
|
export type Dispatch = Readonly<{
|
|
25
8
|
akumaId: AkumaId;
|
|
26
9
|
contractId: ContractId;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { contractIdSchema } from "../git/identity.js";
|
|
4
2
|
import { AuthorityCorruptionError } from "../core/facts/errors.js";
|
|
5
3
|
import { contractId } from "../core/facts/types.js";
|
|
6
|
-
import {
|
|
4
|
+
import { parseAkumaId } from "../akuma/identity.js";
|
|
7
5
|
import { appendPrivateStateSeatClose, confirmPrivateStatePublication, mergePrivateStateSeatClose, withPrivateStatePublicationSeat, } from "../git/private-state-seat.js";
|
|
8
6
|
import { GIT_FORMAT_BYTES, GIT_FORMAT_PATH, GIT_REF, readBlob, readGitPaths, updateGitTree, updateRefsAtomically, writeBlob, writeStateCommit, } from "../git/repository.js";
|
|
9
7
|
import { withGitDecodeChannel, withGitReadObservation, withGitTargetedReadObservation, } from "../git/read-observation.js";
|
|
@@ -11,13 +9,6 @@ import { NO_DISPATCH_ASSOCIATION } from "../akuma/dispatch-association.js";
|
|
|
11
9
|
const DISPATCH_ROOT = "dispatch";
|
|
12
10
|
const DISPATCH_PREFIX = `${DISPATCH_ROOT}/`;
|
|
13
11
|
const DISPATCH_SUFFIX = ".json";
|
|
14
|
-
export const dispatchSchema = z
|
|
15
|
-
.strictObject({ akumaId: akumaIdSchema, contractId: contractIdSchema, dispatchedAt: z.string() })
|
|
16
|
-
.readonly();
|
|
17
|
-
export const dispatchFailureSchema = z.union([
|
|
18
|
-
z.strictObject({ kind: z.literal("conflict"), current: dispatchSchema }).readonly(),
|
|
19
|
-
z.strictObject({ kind: z.literal("publication-failed"), diagnostic: z.string() }).readonly(),
|
|
20
|
-
]);
|
|
21
12
|
function pathFor(akumaId) {
|
|
22
13
|
return `${DISPATCH_PREFIX}${createHash("sha256").update(akumaId).digest("hex")}${DISPATCH_SUFFIX}`;
|
|
23
14
|
}
|
|
@@ -1,52 +1,23 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { changeId, contractHead, contractId, snapshotId, } from "../core/facts/types.js";
|
|
4
|
+
function validatedString(validate, message) {
|
|
5
|
+
return z.string().transform((value, context) => {
|
|
6
|
+
try {
|
|
7
|
+
return validate(value);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
context.addIssue({ code: "custom", message });
|
|
11
|
+
return z.NEVER;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
4
15
|
// Structural admission reuses the pure identity constructors; physical minting remains distinct.
|
|
5
|
-
export const contractIdSchema =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
context.addIssue({ code: "custom", message: "invalid contractId" });
|
|
11
|
-
return z.NEVER;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
export const snapshotIdSchema = z.string().transform((value, context) => {
|
|
15
|
-
try {
|
|
16
|
-
return snapshotId(value);
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
context.addIssue({ code: "custom", message: "invalid snapshotId" });
|
|
20
|
-
return z.NEVER;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
export const contractHeadSchema = z.string().transform((value, context) => {
|
|
24
|
-
try {
|
|
25
|
-
return contractHead(value);
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
context.addIssue({ code: "custom", message: "invalid ContractHead" });
|
|
29
|
-
return z.NEVER;
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
export const changeIdSchema = z.string().transform((value, context) => {
|
|
33
|
-
try {
|
|
34
|
-
return changeId(value);
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
context.addIssue({ code: "custom", message: "invalid changeId" });
|
|
38
|
-
return z.NEVER;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
export const mintedSnapshotInputSchema = z.string().transform((value, context) => {
|
|
42
|
-
try {
|
|
43
|
-
return mintSnapshotId(value);
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
context.addIssue({ code: "custom", message: "invalid mintSnapshotId" });
|
|
47
|
-
return z.NEVER;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
16
|
+
export const contractIdSchema = validatedString(contractId, "invalid contractId");
|
|
17
|
+
export const snapshotIdSchema = validatedString(snapshotId, "invalid snapshotId");
|
|
18
|
+
export const contractHeadSchema = validatedString(contractHead, "invalid ContractHead");
|
|
19
|
+
export const changeIdSchema = validatedString(changeId, "invalid changeId");
|
|
20
|
+
export const mintedSnapshotInputSchema = validatedString(mintSnapshotId, "invalid mintSnapshotId");
|
|
50
21
|
const GIT_OBJECT_ID = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;
|
|
51
22
|
function locator(value) {
|
|
52
23
|
return createHash("sha256").update(value, "utf8").digest("hex");
|
package/build/src/git/nuke.js
CHANGED
|
@@ -56,31 +56,27 @@ async function unregisteredResidueBelongsToRepository(repository, path) {
|
|
|
56
56
|
throw error;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
/** Residue presence follows access: a path whose target is gone is already removed. */
|
|
60
|
+
async function residuePresent(path) {
|
|
61
61
|
try {
|
|
62
|
-
await access(
|
|
62
|
+
await access(path);
|
|
63
|
+
return true;
|
|
63
64
|
}
|
|
64
65
|
catch (error) {
|
|
65
66
|
if (error.code === "ENOENT")
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
throw error;
|
|
67
|
+
return false;
|
|
68
|
+
throw error;
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
}
|
|
71
|
+
async function removeUnregisteredResidue(repository, entry) {
|
|
72
|
+
if (!(await residuePresent(entry.path)))
|
|
71
73
|
return true;
|
|
72
74
|
if (!(await unregisteredResidueBelongsToRepository(repository, entry.path))) {
|
|
73
75
|
throw new GitResetStopError(`managed Place path has foreign custody: ${entry.path}`);
|
|
74
76
|
}
|
|
75
77
|
await rm(entry.path, { recursive: true, force: true });
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
if (error.code === "ENOENT")
|
|
81
|
-
return true;
|
|
82
|
-
throw error;
|
|
83
|
-
}
|
|
78
|
+
if (!(await residuePresent(entry.path)))
|
|
79
|
+
return true;
|
|
84
80
|
throw new GitResetStopError(`managed Place worktree remains present: ${entry.path}`);
|
|
85
81
|
}
|
|
86
82
|
async function removeManagedWorktree(repository, entry) {
|
|
@@ -93,14 +89,8 @@ async function removeManagedWorktree(repository, entry) {
|
|
|
93
89
|
if ((await registeredWorktrees(repository)).some((candidate) => candidate.path === entry.path)) {
|
|
94
90
|
throw new GitResetStopError(`managed Place worktree remains registered: ${entry.path}`);
|
|
95
91
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
if (error.code === "ENOENT")
|
|
101
|
-
return true;
|
|
102
|
-
throw error;
|
|
103
|
-
}
|
|
92
|
+
if (!(await residuePresent(entry.path)))
|
|
93
|
+
return true;
|
|
104
94
|
throw new GitResetStopError(`managed Place worktree remains present: ${entry.path}`);
|
|
105
95
|
}
|
|
106
96
|
async function deleteRefAt(repository, ref, expectedOid) {
|
|
@@ -51,6 +51,9 @@ export type BindTargetSelection = Readonly<{
|
|
|
51
51
|
}> | Readonly<{
|
|
52
52
|
kind: "targetless";
|
|
53
53
|
}>;
|
|
54
|
+
export declare function selectExplicitTarget(repository: GitRepository, input: string): Promise<Extract<BindTargetSelection, {
|
|
55
|
+
kind: "explicit" | "contract";
|
|
56
|
+
}> | null>;
|
|
54
57
|
export declare function normalizeTargetBranch(repository: GitRepository, input: string): Promise<string | null>;
|
|
55
58
|
/**
|
|
56
59
|
* Observe bind's tender start and optional reward target without creating persistent state.
|
package/build/src/git/observe.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { decodeJournal } from "../core/facts/codec.js";
|
|
2
2
|
import { AuthorityCorruptionError } from "../core/facts/errors.js";
|
|
3
3
|
import { foldJournal } from "../core/facts/fold.js";
|
|
4
|
+
import { contractId, } from "../core/facts/types.js";
|
|
4
5
|
import { resolveContractTarget } from "./target.js";
|
|
5
6
|
import { contractJournalPath, contractJournalPaths, mintContractHead, mintSnapshotId, } from "./identity.js";
|
|
6
7
|
import { currentBranch, isKeiyakuOwnedRef } from "./repository.js";
|
|
@@ -34,6 +35,18 @@ export function deliveryTargetObserver(observation) {
|
|
|
34
35
|
return { head, drift: unavailable || (integration !== null && head !== expected) };
|
|
35
36
|
};
|
|
36
37
|
}
|
|
38
|
+
export async function selectExplicitTarget(repository, input) {
|
|
39
|
+
if (input.startsWith("kei/")) {
|
|
40
|
+
try {
|
|
41
|
+
return { kind: "contract", contractId: contractId(input) };
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const target = await normalizeTargetBranch(repository, input);
|
|
48
|
+
return target === null ? null : { kind: "explicit", target };
|
|
49
|
+
}
|
|
37
50
|
const TARGET_COORDINATES_FORMAT = "%(refname)%00%(objectname)%00";
|
|
38
51
|
export async function normalizeTargetBranch(repository, input) {
|
|
39
52
|
if (input.includes("\0"))
|
|
@@ -201,19 +214,22 @@ export function activeContractJournalPaths(observation) {
|
|
|
201
214
|
return [path];
|
|
202
215
|
});
|
|
203
216
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
const git = observation.snapshot;
|
|
207
|
-
const journals = activeContractJournalPaths(observation).map((path) => [path, git.paths.get(path)]);
|
|
208
|
-
const results = await observation.readBlobs(journals.map(([, entry]) => entry.oid));
|
|
217
|
+
async function readJournalBlobs(entries, readBlobsAt) {
|
|
218
|
+
const results = await readBlobsAt(entries.map(([, entry]) => entry.oid));
|
|
209
219
|
const blobs = new Map();
|
|
210
|
-
for (const [path, entry] of
|
|
220
|
+
for (const [path, entry] of entries) {
|
|
211
221
|
const result = results.get(entry.oid);
|
|
212
222
|
if (result?.kind !== "present")
|
|
213
223
|
throw new AuthorityCorruptionError(`missing Git journal object: ${path}`);
|
|
214
224
|
blobs.set(entry.oid, result.bytes);
|
|
215
225
|
}
|
|
216
|
-
return
|
|
226
|
+
return blobs;
|
|
227
|
+
}
|
|
228
|
+
/** Observe active journals without following their prerequisite edges. */
|
|
229
|
+
export async function observeActiveContractJournals(observation) {
|
|
230
|
+
const git = observation.snapshot;
|
|
231
|
+
const journals = activeContractJournalPaths(observation).map((path) => [path, git.paths.get(path)]);
|
|
232
|
+
return enumerateContractObservations(git, await readJournalBlobs(journals, observation.readBlobs), "active");
|
|
217
233
|
}
|
|
218
234
|
export async function observeActiveContractWorld(observation) {
|
|
219
235
|
const contracts = await observeActiveContractJournals(observation);
|
|
@@ -230,14 +246,7 @@ export async function observeActiveContractWorld(observation) {
|
|
|
230
246
|
export async function observeContractWorld(observation, requested = []) {
|
|
231
247
|
const git = observation.snapshot;
|
|
232
248
|
const journals = [...git.paths].filter(([path, entry]) => /^contracts\/(?:active|terminal)\//u.test(path) && path.endsWith(".jsonl") && entry.type === "blob");
|
|
233
|
-
const
|
|
234
|
-
const blobs = new Map();
|
|
235
|
-
for (const [path, entry] of journals) {
|
|
236
|
-
const result = results.get(entry.oid);
|
|
237
|
-
if (result?.kind !== "present")
|
|
238
|
-
throw new AuthorityCorruptionError(`missing Git journal object: ${path}`);
|
|
239
|
-
blobs.set(entry.oid, result.bytes);
|
|
240
|
-
}
|
|
249
|
+
const blobs = await readJournalBlobs(journals, observation.readBlobs);
|
|
241
250
|
const contracts = new Map(enumerateContractObservations(git, blobs));
|
|
242
251
|
for (const id of requested) {
|
|
243
252
|
if (!contracts.has(id))
|
|
@@ -257,14 +266,7 @@ async function observeTargetedContractsFromSnapshotAt(snapshot, readBlobsAt, ids
|
|
|
257
266
|
const journal = snapshot.paths.get(path);
|
|
258
267
|
return journal?.type === "blob" ? [[path, journal]] : [];
|
|
259
268
|
});
|
|
260
|
-
const
|
|
261
|
-
const blobs = new Map();
|
|
262
|
-
for (const [path, entry] of entries) {
|
|
263
|
-
const result = results.get(entry.oid);
|
|
264
|
-
if (result?.kind !== "present")
|
|
265
|
-
throw new AuthorityCorruptionError(`missing Git journal object: ${path}`);
|
|
266
|
-
blobs.set(entry.oid, result.bytes);
|
|
267
|
-
}
|
|
269
|
+
const blobs = await readJournalBlobs(entries, readBlobsAt);
|
|
268
270
|
const contracts = new Map();
|
|
269
271
|
for (const id of ids)
|
|
270
272
|
contracts.set(id, observeFromGit(snapshot, id, blobs));
|
package/build/src/git/process.js
CHANGED
|
@@ -30,6 +30,14 @@ export function gitChildEnvironment(environment) {
|
|
|
30
30
|
}
|
|
31
31
|
return { ...inherited, ...environment };
|
|
32
32
|
}
|
|
33
|
+
function gitProcessOptions(repository, args, environment) {
|
|
34
|
+
return {
|
|
35
|
+
argv: [repository.gitPath, ...args],
|
|
36
|
+
cwd: repository.effectiveCwd,
|
|
37
|
+
env: gitChildEnvironment(environment),
|
|
38
|
+
...(repository.signal === undefined ? {} : { signal: repository.signal }),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
33
41
|
function commandError(command, error) {
|
|
34
42
|
const candidate = error;
|
|
35
43
|
const stderr = candidate.stderr === undefined ? Buffer.alloc(0) : Buffer.from(candidate.stderr);
|
|
@@ -51,12 +59,7 @@ export async function executeGit(repository, args, input, environment) {
|
|
|
51
59
|
const stderr = [];
|
|
52
60
|
let stderrBytes = 0;
|
|
53
61
|
let inputError;
|
|
54
|
-
const owned = spawnCancellableProcess(
|
|
55
|
-
argv: [repository.gitPath, ...args],
|
|
56
|
-
cwd: repository.effectiveCwd,
|
|
57
|
-
env: gitChildEnvironment(environment),
|
|
58
|
-
...(repository.signal === undefined ? {} : { signal: repository.signal }),
|
|
59
|
-
});
|
|
62
|
+
const owned = spawnCancellableProcess(gitProcessOptions(repository, args, environment));
|
|
60
63
|
const child = owned.child;
|
|
61
64
|
child.stdout.on("data", (chunk) => stdout.push(chunk));
|
|
62
65
|
child.stderr.on("data", (chunk) => {
|
|
@@ -127,12 +130,7 @@ export async function runGitPipe(repository, sourceArgs, sinkArgs) {
|
|
|
127
130
|
const processes = [];
|
|
128
131
|
const pending = [];
|
|
129
132
|
const start = (args) => {
|
|
130
|
-
const owned = spawnCancellableProcess(
|
|
131
|
-
argv: [repository.gitPath, ...args],
|
|
132
|
-
cwd: repository.effectiveCwd,
|
|
133
|
-
env: gitChildEnvironment(),
|
|
134
|
-
...(repository.signal === undefined ? {} : { signal: repository.signal }),
|
|
135
|
-
});
|
|
133
|
+
const owned = spawnCancellableProcess(gitProcessOptions(repository, args));
|
|
136
134
|
processes.push(owned);
|
|
137
135
|
const { child } = owned;
|
|
138
136
|
const stderr = [];
|
|
@@ -199,12 +197,7 @@ export async function runGitPipe(repository, sourceArgs, sinkArgs) {
|
|
|
199
197
|
}
|
|
200
198
|
}
|
|
201
199
|
export async function consumeGitStdout(repository, args, consume) {
|
|
202
|
-
const result = await consumeProcessStdout(
|
|
203
|
-
argv: [repository.gitPath, ...args],
|
|
204
|
-
cwd: repository.effectiveCwd,
|
|
205
|
-
env: gitChildEnvironment(),
|
|
206
|
-
...(repository.signal === undefined ? {} : { signal: repository.signal }),
|
|
207
|
-
}, consume);
|
|
200
|
+
const result = await consumeProcessStdout(gitProcessOptions(repository, args), consume);
|
|
208
201
|
const { outcome } = result;
|
|
209
202
|
if (outcome.kind === "terminal" && outcome.code === 0)
|
|
210
203
|
return;
|
|
@@ -28,14 +28,15 @@ export type GitDecodeChannel = Readonly<{
|
|
|
28
28
|
readonly [gitDecodeChannelBrand]: true;
|
|
29
29
|
readObjects(oids: readonly GitOid[]): Promise<ReadonlyMap<GitOid, GitObjectResult>>;
|
|
30
30
|
}>;
|
|
31
|
+
type TreeObservation = Readonly<{
|
|
32
|
+
paths: ReadonlyMap<string, TreeEntry>;
|
|
33
|
+
directories: ReadonlyMap<string, ReadonlyMap<string, TreeEntry>>;
|
|
34
|
+
}>;
|
|
31
35
|
export type GitTreeSelection = Readonly<{
|
|
32
36
|
paths?: readonly string[];
|
|
33
37
|
subtrees?: readonly string[];
|
|
34
38
|
}>;
|
|
35
|
-
export declare function readGitTreeSelection(channel: GitDecodeChannel, root: GitOid, selection: GitTreeSelection): Promise<
|
|
36
|
-
paths: ReadonlyMap<string, TreeEntry>;
|
|
37
|
-
directories: ReadonlyMap<string, ReadonlyMap<string, TreeEntry>>;
|
|
38
|
-
}>>;
|
|
39
|
+
export declare function readGitTreeSelection(channel: GitDecodeChannel, root: GitOid, selection: GitTreeSelection): Promise<TreeObservation>;
|
|
39
40
|
export declare function withGitDecodeChannel<Value>(repository: GitRepository, consume: (channel: GitDecodeChannel) => Value | PromiseLike<Value>, onRetirementFailure?: (error: unknown) => void): Promise<Value>;
|
|
40
41
|
/**
|
|
41
42
|
* Blob-only reads over a decode channel: a missing object stays missing, and a present
|
|
@@ -37,6 +37,8 @@ type RegisteredWorktree = Readonly<{
|
|
|
37
37
|
}>;
|
|
38
38
|
export declare function registeredWorktrees(repository: GitRepository): Promise<readonly RegisteredWorktree[]>;
|
|
39
39
|
export declare function registeredWorktreePaths(repository: GitRepository): Promise<readonly string[]>;
|
|
40
|
+
/** Absence is ENOENT on the path entry itself: a dangling symlink is present residue, not a missing path. */
|
|
41
|
+
export declare function pathExists(path: string): Promise<boolean>;
|
|
40
42
|
export declare function repositoryAt(cwd: string, gitPath?: string): Promise<GitRepository>;
|
|
41
43
|
export declare function commonGitDirectory(repository: GitRepository): string;
|
|
42
44
|
/** Read one worktree's attached branch, or null for detached HEAD. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KeiyakuError } from "../errors.js";
|
|
2
2
|
import { isAbsolute, resolve } from "node:path";
|
|
3
|
-
import { realpath } from "node:fs/promises";
|
|
3
|
+
import { lstat, realpath } from "node:fs/promises";
|
|
4
4
|
import { AuthorityCorruptionError } from "../core/facts/errors.js";
|
|
5
5
|
import { gitObjectId } from "./identity.js";
|
|
6
6
|
import { executeGit, GitPlumbingError } from "./process.js";
|
|
@@ -82,6 +82,18 @@ export async function registeredWorktrees(repository) {
|
|
|
82
82
|
export async function registeredWorktreePaths(repository) {
|
|
83
83
|
return (await registeredWorktrees(repository)).map((worktree) => worktree.path);
|
|
84
84
|
}
|
|
85
|
+
/** Absence is ENOENT on the path entry itself: a dangling symlink is present residue, not a missing path. */
|
|
86
|
+
export async function pathExists(path) {
|
|
87
|
+
try {
|
|
88
|
+
await lstat(path);
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
if (error.code === "ENOENT")
|
|
93
|
+
return false;
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
85
97
|
export async function repositoryAt(cwd, gitPath = "git") {
|
|
86
98
|
if (typeof cwd !== "string" || cwd.length === 0) {
|
|
87
99
|
throw new Error("repository path must be a nonempty string");
|
package/build/src/git/scratch.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { createHash, randomBytes } from "node:crypto";
|
|
3
|
-
import {
|
|
3
|
+
import { realpath, unlink } from "node:fs/promises";
|
|
4
4
|
import { tmpdir } from "node:os";
|
|
5
5
|
import { basename, dirname, join } from "node:path";
|
|
6
6
|
import { acquireSqliteTransactionLock, tryAcquireSqliteTransactionLock, } from "../coordination/sqlite-transaction-lock.js";
|
|
7
7
|
import { contractLocator, gitRefLocator, gitObjectIdForSnapshot } from "./identity.js";
|
|
8
8
|
import { executeGit } from "./process.js";
|
|
9
|
-
import { registeredWorktreePaths } from "./repository.js";
|
|
9
|
+
import { pathExists, registeredWorktreePaths } from "./repository.js";
|
|
10
10
|
const SCRATCH_PREFIX = "keiyaku-v4-verify-";
|
|
11
11
|
const SCRATCH_ROOT = await realpath(tmpdir());
|
|
12
12
|
const SCRATCH_PATTERN = /^keiyaku-v4-verify-([0-9a-f]{24}|[0-9a-f]{64}-[0-9a-f]{64}-[0-9a-f]{64})$/;
|
|
@@ -59,18 +59,6 @@ async function* collectableScratchWorktrees(paths, terminalPrefix) {
|
|
|
59
59
|
yield { path, lockPath, release: () => lock.close() };
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
/** Absence is ENOENT on the path entry itself: a dangling symlink is present residue, not a missing path. */
|
|
63
|
-
async function pathExists(path) {
|
|
64
|
-
try {
|
|
65
|
-
await lstat(path);
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
if (error.code === "ENOENT")
|
|
70
|
-
return false;
|
|
71
|
-
throw error;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
62
|
async function removeScratch(repository, path) {
|
|
75
63
|
const removal = AbortSignal.timeout(SCRATCH_REMOVAL_TIMEOUT_MS);
|
|
76
64
|
const retirementRepository = { ...repository, signal: removal };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CANDIDATE_PIN_REF_NAMESPACE, isKeiyakuOwnedRef, readRef, writeCommit } from "./repository.js";
|
|
1
|
+
import { CANDIDATE_PIN_REF_NAMESPACE, isKeiyakuOwnedRef, pathExists, readRef, writeCommit, } from "./repository.js";
|
|
3
2
|
import { contractPhysicalName, gitObjectIdForSnapshot, mintSnapshotId } from "./identity.js";
|
|
4
3
|
import { withGitReadObservation } from "./read-observation.js";
|
|
5
4
|
import { observeContractWorld } from "./observe.js";
|
|
@@ -8,17 +7,6 @@ import { runDestroyHooks } from "./hooks.js";
|
|
|
8
7
|
import { terminalSealExpectations as decodeTerminalSealExpectations, terminalSealSnapshots, observeTerminalWorkspace, } from "./terminal-seal.js";
|
|
9
8
|
import { GitPlumbingError, executeGit } from "./process.js";
|
|
10
9
|
import { worktreePath } from "./workspace.js";
|
|
11
|
-
async function pathExists(path) {
|
|
12
|
-
try {
|
|
13
|
-
await lstat(path);
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
if (error.code === "ENOENT")
|
|
18
|
-
return false;
|
|
19
|
-
throw error;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
10
|
/** Attempt removal once. Retention is a lag carrying its reason; no effect claims the worktree state after it. */
|
|
23
11
|
async function removeTerminalWorktree(repository, topology, path) {
|
|
24
12
|
const registered = topology.paths.has(path);
|
package/build/src/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type { Guidance } from "./library/kei.js";
|
|
|
10
10
|
export type { Delivery } from "./library/delivery.js";
|
|
11
11
|
export { Keiyaku, KeiyakuArcDocumentError, KeiyakuUsageError } from "./library/keiyaku.js";
|
|
12
12
|
export type { KeiyakuAt } from "./library/keiyaku.js";
|
|
13
|
+
export type { InvocationWaitMember, InvocationWaitResult } from "./library/keiyaku-wait.js";
|
|
13
14
|
export type { KeiyakuRunOptions, VerbEntry, VerbName, VerbInput, VerbOutput, VerbProgress, VerbRun, VerbRunFor, VerbDisposition, VerbCompletion, } from "./library/keiyaku-verbs.js";
|
|
14
15
|
export { Keis } from "./library/contract-composition.js";
|
|
15
16
|
export type { KeisReconcile, ReconcileInput } from "./library/contract-composition.js";
|
|
@@ -26,6 +27,7 @@ export type { AkumaAddressRefusal, AkumaSetAddressInput } from "./library/addres
|
|
|
26
27
|
export type { SpawnProgress, SpawnWaitObserver } from "./library/akuma-creation.js";
|
|
27
28
|
export type { WhoamiFacts } from "./library/keiyaku-identity.js";
|
|
28
29
|
export type { ChangeId, ContractHead, ContractId, ContractState, ContractTarget, JournalEntry as Fact, FactKind, SnapshotId, } from "./core/facts/types.js";
|
|
30
|
+
export type { GateStaleReason } from "./core/facts/gate.js";
|
|
29
31
|
export { Kanshi } from "./kanshi/index.js";
|
|
30
32
|
export type { KanshiScopeInput, KanshiBoardOptions, KanshiCountsReport, AkumaKanshiRow, AkumaKanshiWorld, ContractEndpointObservation, ContractHolderObservation, ContractKanshiBoard, ContractKanshiDetail, KanshiContractReport, KanshiResult, KanshiRegionSelection, KanshiReport, RegionDeclaration, RegionRead, Section, DebtKanshiRow, DebtKanshiWorld, } from "./kanshi/index.js";
|
|
31
33
|
export { AkumaAddressError, AkumaWorldScopeError, Akumas } from "./library/akumas.js";
|
|
@@ -15,7 +15,6 @@ export declare const Kanshi: Readonly<{
|
|
|
15
15
|
of(scope: KanshiScopeInput): Kanshi;
|
|
16
16
|
}>;
|
|
17
17
|
export { kanshiObservationSchema } from "./read.js";
|
|
18
|
-
export { kanshiCountsReportSchema } from "./counts.js";
|
|
19
18
|
export type { KanshiCountsReport } from "./counts.js";
|
|
20
19
|
export { regionReadSchema, kanshiReportSchema, kanshiContractReportSchema, kanshiResultSchema } from "./report.js";
|
|
21
20
|
export type { KanshiBoardOptions, KanshiScopeInput } from "./read.js";
|
|
@@ -26,5 +26,4 @@ export const Kanshi = Object.freeze({
|
|
|
26
26
|
},
|
|
27
27
|
});
|
|
28
28
|
export { kanshiObservationSchema } from "./read.js";
|
|
29
|
-
export { kanshiCountsReportSchema } from "./counts.js";
|
|
30
29
|
export { regionReadSchema, kanshiReportSchema, kanshiContractReportSchema, kanshiResultSchema } from "./report.js";
|
|
@@ -159,6 +159,17 @@ export declare const kanshiObservationSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
159
159
|
toolId: z.ZodString;
|
|
160
160
|
}, z.core.$strict>>>>>;
|
|
161
161
|
latestActivity: z.ZodExactOptional<z.ZodNumber>;
|
|
162
|
+
awaiting: z.ZodExactOptional<z.ZodReadonly<z.ZodObject<{
|
|
163
|
+
kind: z.ZodLiteral<"permission">;
|
|
164
|
+
id: z.ZodNumber;
|
|
165
|
+
requests: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
166
|
+
id: z.ZodString;
|
|
167
|
+
action: z.ZodString;
|
|
168
|
+
resources: z.ZodReadonly<z.ZodArray<z.ZodString>>;
|
|
169
|
+
tool: z.ZodExactOptional<z.ZodString>;
|
|
170
|
+
}, z.core.$strict>>>>;
|
|
171
|
+
clipped: z.ZodExactOptional<z.ZodLiteral<true>>;
|
|
172
|
+
}, z.core.$strict>>>;
|
|
162
173
|
pending: z.ZodExactOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
163
174
|
id: z.ZodNumber;
|
|
164
175
|
tellId: z.ZodString;
|
|
@@ -239,6 +250,16 @@ export declare const kanshiObservationSchema: z.ZodReadonly<z.ZodObject<{
|
|
|
239
250
|
kind: z.ZodLiteral<"missing">;
|
|
240
251
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
241
252
|
kind: z.ZodLiteral<"stale">;
|
|
253
|
+
reason: z.ZodExactOptional<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
|
|
254
|
+
kind: z.ZodLiteral<"candidate-content-changed">;
|
|
255
|
+
target: z.ZodExactOptional<z.ZodString>;
|
|
256
|
+
previousChange: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").ChangeId, string>>;
|
|
257
|
+
currentChange: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").ChangeId, string>>;
|
|
258
|
+
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
259
|
+
kind: z.ZodLiteral<"snapshot-changed">;
|
|
260
|
+
previousSnapshot: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
261
|
+
currentSnapshot: z.ZodPipe<z.ZodString, z.ZodTransform<import("../core/facts/types.js").SnapshotId, string>>;
|
|
262
|
+
}, z.core.$strict>>]>>;
|
|
242
263
|
}, z.core.$strict>>, z.ZodReadonly<z.ZodObject<{
|
|
243
264
|
kind: z.ZodLiteral<"attested">;
|
|
244
265
|
verdict: z.ZodEnum<{
|
package/build/src/kanshi/read.js
CHANGED
|
@@ -13,8 +13,9 @@ import { readContractCatalogue, readContractObservation, readContractPhase, } fr
|
|
|
13
13
|
import { readDebtHolderProjectionAt } from "../settlement/holder.js";
|
|
14
14
|
import { observeRecentDebtStatus, DebtAuthorityCorruptionError } from "../debt/index.js";
|
|
15
15
|
import { kanshiReportSchema, kanshiContractReportSchema, sectionSchema } from "./report.js";
|
|
16
|
-
import { ROSTER_SNAPSHOT_ROWS, ROSTER_VISIBLE_ROWS } from "./roster.js";
|
|
17
16
|
import { selectRegion } from "./select.js";
|
|
17
|
+
const ROSTER_VISIBLE_ROWS = 10;
|
|
18
|
+
const ROSTER_SNAPSHOT_ROWS = 3;
|
|
18
19
|
export const kanshiObservationSchema = z
|
|
19
20
|
.strictObject({
|
|
20
21
|
report: z.union([kanshiReportSchema, kanshiContractReportSchema]),
|