@hunsu/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/board.js ADDED
@@ -0,0 +1,223 @@
1
+ import { err, ok } from "@hunsu/protocol";
2
+ import { getTrailer, parseTrailers } from "./trailer.js";
3
+ import { InvalidTrailerError } from "./errors.js";
4
+ import { makeCommitSha, makeGitGoal, makeGitHunsuId, makeGitMoveId, makeGitMoveNumber, makeGitPriority, makeGitRunId, makeGitTrailerActor, makeGitTrailerRole } from "./primitives.js";
5
+ const HUNSU_EVENT_TYPES = ["move", "hunsu"];
6
+ const MOVE_EVENT_STATUSES = ["complete", "failed", "blocked"];
7
+ export function commitToBoardEvent(commit) {
8
+ const trailers = parseCommitTrailers(commit);
9
+ if (!trailers.ok)
10
+ return trailers;
11
+ const eventType = tryParseHunsuEventType(getTrailer(trailers.value, "Hunsu-Event"), commit.sha);
12
+ if (!eventType.ok)
13
+ return eventType;
14
+ if (eventType.value === "move") {
15
+ const runId = parseRequiredTrailer(trailers.value, "Hunsu-Run", commit.sha, makeGitRunId);
16
+ if (!runId.ok)
17
+ return runId;
18
+ const moveNumber = parseRequiredTrailer(trailers.value, "Hunsu-Move", commit.sha, makeGitMoveNumber, "invalid_move_number");
19
+ if (!moveNumber.ok)
20
+ return moveNumber;
21
+ const moveId = parseRequiredTrailer(trailers.value, "Hunsu-Move", commit.sha, makeGitMoveId, "invalid_move_number");
22
+ if (!moveId.ok)
23
+ return moveId;
24
+ const role = parseRequiredTrailer(trailers.value, "Hunsu-Role", commit.sha, makeGitTrailerRole);
25
+ if (!role.ok)
26
+ return role;
27
+ const actor = parseRequiredTrailer(trailers.value, "Hunsu-Actor", commit.sha, makeGitTrailerActor);
28
+ if (!actor.ok)
29
+ return actor;
30
+ const statusValue = requireTrailerResult(trailers.value, "Hunsu-Status", commit.sha);
31
+ if (!statusValue.ok)
32
+ return statusValue;
33
+ const status = makeMoveEventStatus(statusValue.value, commit.sha);
34
+ if (!status.ok)
35
+ return status;
36
+ const goal = parseRequiredTrailer(trailers.value, "Hunsu-Goal", commit.sha, makeGitGoal);
37
+ if (!goal.ok)
38
+ return goal;
39
+ return ok({
40
+ type: "move",
41
+ commit,
42
+ runId: runId.value,
43
+ moveNumber: moveNumber.value,
44
+ moveId: moveId.value,
45
+ goal: goal.value,
46
+ role: role.value,
47
+ actor: actor.value,
48
+ status: status.value,
49
+ trailers: trailers.value
50
+ });
51
+ }
52
+ if (eventType.value === "hunsu") {
53
+ const hunsuId = parseRequiredTrailer(trailers.value, "Hunsu-ID", commit.sha, makeGitHunsuId);
54
+ if (!hunsuId.ok)
55
+ return hunsuId;
56
+ const target = parseRequiredTrailer(trailers.value, "Hunsu-Target", commit.sha, makeCommitSha);
57
+ if (!target.ok)
58
+ return target;
59
+ const sourceRun = parseRequiredTrailer(trailers.value, "Hunsu-Source-Run", commit.sha, makeGitRunId);
60
+ if (!sourceRun.ok)
61
+ return sourceRun;
62
+ const newRun = parseRequiredTrailer(trailers.value, "Hunsu-New-Run", commit.sha, makeGitRunId);
63
+ if (!newRun.ok)
64
+ return newRun;
65
+ const role = parseRequiredTrailer(trailers.value, "Hunsu-Role", commit.sha, makeGitTrailerRole);
66
+ if (!role.ok)
67
+ return role;
68
+ const actor = parseRequiredTrailer(trailers.value, "Hunsu-Actor", commit.sha, makeGitTrailerActor);
69
+ if (!actor.ok)
70
+ return actor;
71
+ const priority = parseOptionalTrailer(trailers.value, "Hunsu-Priority", commit.sha, makeGitPriority);
72
+ if (!priority.ok)
73
+ return priority;
74
+ return ok({
75
+ type: "hunsu",
76
+ commit,
77
+ hunsuId: hunsuId.value,
78
+ target: target.value,
79
+ sourceRun: sourceRun.value,
80
+ newRun: newRun.value,
81
+ role: role.value,
82
+ actor: actor.value,
83
+ priority: priority.value,
84
+ trailers: trailers.value
85
+ });
86
+ }
87
+ return ok(null);
88
+ }
89
+ export function createBoardFromCommits(commits) {
90
+ const events = commits
91
+ .map(commitToBoardEvent)
92
+ .map(unwrapTrailerParseResult)
93
+ .filter((event) => event !== null)
94
+ .sort(compareEvents);
95
+ const runsById = new Map();
96
+ const moves = [];
97
+ const hunsus = [];
98
+ const positions = new Map();
99
+ for (const event of events) {
100
+ if (event.type === "move") {
101
+ moves.push(event);
102
+ const run = getOrCreateRun(runsById, event.runId);
103
+ run.moves.push(event);
104
+ run.events.push(event);
105
+ positions.set(event.commit.sha, event);
106
+ positions.set(event.commit.shortSha, event);
107
+ positions.set(event.moveId, event);
108
+ positions.set(`${event.runId}:${event.moveId}`, event);
109
+ }
110
+ else {
111
+ hunsus.push(event);
112
+ const sourceRun = getOrCreateRun(runsById, event.sourceRun);
113
+ sourceRun.hunsus.push(event);
114
+ sourceRun.events.push(event);
115
+ const newRun = getOrCreateRun(runsById, event.newRun);
116
+ newRun.hunsus.push(event);
117
+ newRun.events.push(event);
118
+ }
119
+ }
120
+ for (const run of runsById.values()) {
121
+ run.moves.sort(compareEvents);
122
+ run.hunsus.sort(compareEvents);
123
+ run.events.sort(compareEvents);
124
+ }
125
+ return {
126
+ runs: [...runsById.values()].sort((left, right) => left.runId.localeCompare(right.runId)),
127
+ moves,
128
+ hunsus,
129
+ positions
130
+ };
131
+ }
132
+ function getOrCreateRun(runsById, runId) {
133
+ const existing = runsById.get(runId);
134
+ if (existing) {
135
+ return existing;
136
+ }
137
+ const run = { runId, moves: [], hunsus: [], events: [] };
138
+ runsById.set(runId, run);
139
+ return run;
140
+ }
141
+ function compareEvents(left, right) {
142
+ const leftTime = Date.parse(left.commit.authoredAt);
143
+ const rightTime = Date.parse(right.commit.authoredAt);
144
+ if (Number.isFinite(leftTime) && Number.isFinite(rightTime) && leftTime !== rightTime) {
145
+ return leftTime - rightTime;
146
+ }
147
+ if (left.type === "move" && right.type === "move") {
148
+ const moveOrder = compareMoveNumbers(left.moveNumber, right.moveNumber);
149
+ if (moveOrder !== 0) {
150
+ return moveOrder;
151
+ }
152
+ }
153
+ return left.commit.sha.localeCompare(right.commit.sha);
154
+ }
155
+ function compareMoveNumbers(left, right) {
156
+ const leftNumber = Number(left);
157
+ const rightNumber = Number(right);
158
+ if (Number.isFinite(leftNumber) && Number.isFinite(rightNumber) && leftNumber !== rightNumber) {
159
+ return leftNumber - rightNumber;
160
+ }
161
+ return left.localeCompare(right);
162
+ }
163
+ export function parseHunsuEventType(value, commitSha) {
164
+ return unwrapTrailerParseResult(tryParseHunsuEventType(value, commitSha));
165
+ }
166
+ export function parseMoveEventStatus(value, commitSha) {
167
+ return unwrapTrailerParseResult(makeMoveEventStatus(value, commitSha));
168
+ }
169
+ function parseCommitTrailers(commit) {
170
+ try {
171
+ return ok(parseTrailers(commit.body));
172
+ }
173
+ catch (error) {
174
+ return trailerParseError("invalid_trailer_block", commit.sha, undefined, undefined, error instanceof Error ? error.message : String(error));
175
+ }
176
+ }
177
+ function tryParseHunsuEventType(value, commitSha) {
178
+ if (value === undefined) {
179
+ return ok(undefined);
180
+ }
181
+ if (HUNSU_EVENT_TYPES.includes(value)) {
182
+ return ok(value);
183
+ }
184
+ return trailerParseError("invalid_hunsu_event_type", commitSha, "Hunsu-Event", value, `Commit ${commitSha} has unsupported Hunsu-Event ${value}`);
185
+ }
186
+ function makeMoveEventStatus(value, commitSha) {
187
+ if (typeof value === "string" && MOVE_EVENT_STATUSES.includes(value)) {
188
+ return ok(value);
189
+ }
190
+ return trailerParseError("invalid_move_status", commitSha, "Hunsu-Status", String(value), `Commit ${commitSha} has unsupported Hunsu-Status ${String(value)}`);
191
+ }
192
+ function requireTrailerResult(trailers, key, commitSha) {
193
+ const value = getTrailer(trailers, key);
194
+ return value ? ok(value) : trailerParseError("missing_trailer", commitSha, key, undefined, `Commit ${commitSha} is missing required trailer ${key}`);
195
+ }
196
+ function parseRequiredTrailer(trailers, key, commitSha, parser, code = "invalid_trailer_value") {
197
+ const value = requireTrailerResult(trailers, key, commitSha);
198
+ if (!value.ok)
199
+ return value;
200
+ const parsed = parser(value.value, key);
201
+ return parsed.ok
202
+ ? ok(parsed.value)
203
+ : trailerParseError(code, commitSha, key, value.value, `Commit ${commitSha} has invalid ${key}: ${parsed.error.message}`);
204
+ }
205
+ function parseOptionalTrailer(trailers, key, commitSha, parser, code = "invalid_trailer_value") {
206
+ const value = getTrailer(trailers, key);
207
+ if (value === undefined) {
208
+ return ok(undefined);
209
+ }
210
+ const parsed = parser(value, key);
211
+ return parsed.ok
212
+ ? ok(parsed.value)
213
+ : trailerParseError(code, commitSha, key, value, `Commit ${commitSha} has invalid ${key}: ${parsed.error.message}`);
214
+ }
215
+ function trailerParseError(code, commitSha, trailer, value, message) {
216
+ return err({ type: "TrailerParseError", code, commitSha, trailer, value, message });
217
+ }
218
+ function unwrapTrailerParseResult(result) {
219
+ if (result.ok) {
220
+ return result.value;
221
+ }
222
+ throw new InvalidTrailerError(result.error.message);
223
+ }
@@ -0,0 +1,268 @@
1
+ import { type Result } from "@hunsu/protocol";
2
+ import type { AgentConversationRef, ArtifactActionDefinition, BoardProjection, Command, Destination, DomainEvent, ExecutorEntity, ExecutorId, GuardrailConfig, HubPackageLock, HunsuOrigin, MoveId, NodeId, ExecutionPlan, PathId, MemberPath, PositiveInteger, ResourceEntity, WorktreeRef } from "@hunsu/protocol";
3
+ import type { CommitSha, RuntimeChecksum } from "./primitives.ts";
4
+ export declare const HUNSU_COMPLETED_DESTINATIONS_PATH = ".hunsu/completed-destinations.hunsu";
5
+ export declare const HUNSU_DESTINATIONS_PATH = ".hunsu/destinations.hunsu";
6
+ export declare const HUNSU_HARNESS_PATH = ".hunsu/harness.hunsu";
7
+ export declare const HUNSU_EXECUTORS_PATH = ".hunsu/executors.hunsu";
8
+ export declare const HUNSU_RESOURCES_PATH = ".hunsu/resources.hunsu";
9
+ export declare const HUNSU_ARTIFACT_ACTIONS_PATH = ".hunsu/artifact-actions.hunsu";
10
+ export declare const HUNSU_CURRENT_EXECUTION_PATH = ".hunsu/current-execution.hunsu";
11
+ export declare const HUNSU_PREVIOUS_EXECUTION_PATH = ".hunsu/previous-execution.hunsu";
12
+ export declare const HUNSU_HUNSU_DRAFT_PATH = ".hunsu/hunsu-draft.hunsu";
13
+ export declare const HUNSU_RUNTIME_PATHS: readonly [".hunsu/completed-destinations.hunsu", ".hunsu/destinations.hunsu", ".hunsu/harness.hunsu", ".hunsu/executors.hunsu", ".hunsu/resources.hunsu", ".hunsu/artifact-actions.hunsu"];
14
+ export declare const HUNSU_LEGACY_STATE_PATH = ".hunsu/state.hunsu";
15
+ export declare const HUNSU_RUNTIME_ENCODING = "gzip+base64url";
16
+ export declare const HUNSU_DRAFT_RUNTIME_FILE_NAMES: readonly ["destinations.json", "harness.json", "executors.json", "resources.json", "artifact-actions.json"];
17
+ export declare const HUNSU_SELF_COMMIT_REF: MoveCommitRef;
18
+ export declare const HUNSU_SELF_COMMIT_SENTINEL = "__HUNSU_SELF_COMMIT__";
19
+ export type DomainStore = {
20
+ root: string;
21
+ eventRefs: DomainEventRef[];
22
+ events: DomainEvent[];
23
+ board: BoardProjection;
24
+ runtimePaths: typeof HUNSU_RUNTIME_PATHS;
25
+ runtime: HunsuRuntimeState;
26
+ source: "worktree-runtime" | "reachable-runtime" | "legacy-state" | "legacy-refs" | "empty";
27
+ checksum: RuntimeChecksum;
28
+ commit?: CommitSha;
29
+ };
30
+ export type DomainEventRef = {
31
+ ref: string;
32
+ object: string;
33
+ objectType: string;
34
+ ordinal: number;
35
+ };
36
+ export type DomainStoreError = {
37
+ type: "DomainStoreError";
38
+ message: string;
39
+ };
40
+ export type CompletedDestinationEntry = {
41
+ destinationId: string;
42
+ title: string;
43
+ completedAt?: string;
44
+ resultCommit: CommitSha | typeof HUNSU_SELF_COMMIT_SENTINEL | MoveCommitRef;
45
+ moveId: MoveId;
46
+ harnessId?: string;
47
+ digest: {
48
+ summary: string;
49
+ evidence: string[];
50
+ changedPaths?: string[];
51
+ checks?: Array<{
52
+ command: string;
53
+ status: "passed" | "failed";
54
+ summary?: string;
55
+ }>;
56
+ risks?: string[];
57
+ transcriptDigest?: string;
58
+ };
59
+ };
60
+ export type HunsuCompletedDestinationsFile = {
61
+ schema: "hunsu.completed-destinations.v1";
62
+ order: "oldest-first-tail-append";
63
+ entries: CompletedDestinationEntry[];
64
+ };
65
+ export type HunsuPendingDestinationsFile = {
66
+ schema: "hunsu.destinations.v1";
67
+ order: "queue-head-is-current";
68
+ destinations: Destination[];
69
+ compatibility: {
70
+ events: DomainEvent[];
71
+ updatedAt?: string;
72
+ };
73
+ };
74
+ export type HunsuHarnessFile = {
75
+ schema: "hunsu.harness.v1";
76
+ origins?: HunsuOrigin[];
77
+ harness: {
78
+ name: string;
79
+ rootTeamId: ExecutorId;
80
+ guardrails?: GuardrailConfig[];
81
+ lock?: HubPackageLock;
82
+ };
83
+ };
84
+ export type HunsuExecutorsFile = {
85
+ schema: "hunsu.executors.v1";
86
+ executors: ExecutorEntity[];
87
+ };
88
+ export type HunsuResourcesFile = {
89
+ schema: "hunsu.resources.v1";
90
+ resources: ResourceEntity[];
91
+ bindings: Array<{
92
+ destinationId: string;
93
+ executorPackageBindings?: BoardProjection["nodes"][number]["executorPackageBindings"];
94
+ resourcePackageBindings?: BoardProjection["nodes"][number]["resourcePackageBindings"];
95
+ }>;
96
+ };
97
+ export type HunsuArtifactActionsFile = {
98
+ schema: "hunsu.artifact-actions.v1";
99
+ order: "display-order";
100
+ actions: ArtifactActionDefinition[];
101
+ };
102
+ export type HunsuRuntimeEventLog = {
103
+ events: DomainEvent[];
104
+ updatedAt?: string;
105
+ };
106
+ export type HunsuCurrentExecutionFile = {
107
+ schema: "hunsu.current-execution.v1";
108
+ execution: ExecutionPlan;
109
+ updatedAt?: string;
110
+ };
111
+ export type MoveCommitRef = {
112
+ type: "self";
113
+ } | {
114
+ type: "external";
115
+ commit: CommitSha;
116
+ };
117
+ export type RouteNodeLifecycle = "Waiting" | "Executing" | "Completed" | "Failed";
118
+ export type PreviousExecutionAgentSessionRef = {
119
+ sessionId: string;
120
+ ownerKind: "TeamPlan" | "ExecutionPlan" | "MoveFinalizer";
121
+ providerThreadId?: string;
122
+ providerTurnId?: string;
123
+ state: "waiting" | "starting" | "executing" | "interactWait" | "completed" | "failed";
124
+ startedAt?: string;
125
+ completedAt?: string;
126
+ error?: string;
127
+ };
128
+ export type PlanNodeExecutionRecord = {
129
+ nodeType: "PlanNode";
130
+ lifecycle: Extract<RouteNodeLifecycle, "Completed" | "Failed">;
131
+ session?: PreviousExecutionAgentSessionRef;
132
+ completedAt?: string;
133
+ error?: string;
134
+ };
135
+ export type PathNodeExecutionRecord = {
136
+ nodeType: "PathNode";
137
+ pathId: PathId;
138
+ executorId: string;
139
+ goal: string;
140
+ requires: MemberPath["requires"];
141
+ lifecycle: RouteNodeLifecycle;
142
+ session?: PreviousExecutionAgentSessionRef;
143
+ commit?: CommitSha;
144
+ parentCommit?: CommitSha;
145
+ treeChanged?: boolean;
146
+ startedAt?: string;
147
+ completedAt?: string;
148
+ error?: string;
149
+ };
150
+ export type RouteNodeExecutionRecord = PlanNodeExecutionRecord | PathNodeExecutionRecord;
151
+ export type HunsuPreviousExecutionFile = {
152
+ schema: "hunsu.previous-execution.v1";
153
+ sourceMoveCommit: CommitSha;
154
+ targetMoveId: MoveId;
155
+ executeId: string;
156
+ runId: string;
157
+ lineId: string;
158
+ sourceNodeId?: NodeId;
159
+ sourceMoveId?: MoveId;
160
+ targetMoveOrdinal?: PositiveInteger;
161
+ selectedDestinationIds: string[];
162
+ worktree?: WorktreeRef;
163
+ conversationRef?: AgentConversationRef;
164
+ plan: PlanNodeExecutionRecord;
165
+ paths: PathNodeExecutionRecord[];
166
+ pathCommits: Record<string, CommitSha>;
167
+ terminalPathId?: PathId;
168
+ terminalPathCommit?: CommitSha;
169
+ finalizerSession?: PreviousExecutionAgentSessionRef;
170
+ moveFinalizerCommit?: MoveCommitRef;
171
+ moveFinalizerMessage?: string;
172
+ startedAt?: string;
173
+ completedAt?: string;
174
+ };
175
+ export type PreviousExecutionState = {
176
+ type: "none";
177
+ } | {
178
+ type: "present";
179
+ value: HunsuPreviousExecutionFile;
180
+ };
181
+ export type CurrentExecutionState = {
182
+ type: "none";
183
+ } | {
184
+ type: "present";
185
+ value: HunsuCurrentExecutionFile;
186
+ };
187
+ export type HunsuRuntimeState = {
188
+ completed: HunsuCompletedDestinationsFile;
189
+ destinations: HunsuPendingDestinationsFile;
190
+ harness: HunsuHarnessFile;
191
+ executors: HunsuExecutorsFile;
192
+ resources: HunsuResourcesFile;
193
+ artifactActions: HunsuArtifactActionsFile;
194
+ currentExecution: CurrentExecutionState;
195
+ previousExecution: PreviousExecutionState;
196
+ eventLog: HunsuRuntimeEventLog;
197
+ };
198
+ export type HunsuDraftRuntimeFileName = (typeof HUNSU_DRAFT_RUNTIME_FILE_NAMES)[number];
199
+ export type HunsuDraftRuntimeBundle = Pick<HunsuRuntimeState, "destinations" | "harness" | "executors" | "resources" | "artifactActions">;
200
+ export type HunsuDraftRuntimeValidation = {
201
+ previous: HunsuDraftRuntimeBundle;
202
+ request: HunsuDraftRuntimeBundle;
203
+ requestRuntime: HunsuRuntimeState;
204
+ };
205
+ export type EncodedHunsuRuntimeFile = {
206
+ text: string;
207
+ checksum: RuntimeChecksum;
208
+ };
209
+ export declare function loadDomainStore(cwd?: string): DomainStore;
210
+ export declare function initializeDomainStore(cwd?: string, options?: {
211
+ commitMessage?: string;
212
+ }): DomainStore;
213
+ export declare function dryRunCommand(command: Command, cwd?: string): {
214
+ store: DomainStore;
215
+ acceptedEvents: DomainEvent[];
216
+ board: BoardProjection;
217
+ };
218
+ export declare function dryRunCommands(commands: Command[], cwd?: string): {
219
+ store: DomainStore;
220
+ acceptedEvents: DomainEvent[];
221
+ board: BoardProjection;
222
+ };
223
+ export declare function writeCommand(command: Command, options?: {
224
+ cwd?: string;
225
+ commitMessage?: string;
226
+ previousExecution?: PreviousExecutionState;
227
+ selfCommitMoveIds?: string[];
228
+ }): {
229
+ acceptedEvents: DomainEvent[];
230
+ board: BoardProjection;
231
+ };
232
+ export declare function writeCommands(commands: Command[], options?: {
233
+ cwd?: string;
234
+ commitMessage?: string;
235
+ previousExecution?: PreviousExecutionState;
236
+ selfCommitMoveIds?: string[];
237
+ }): {
238
+ acceptedEvents: DomainEvent[];
239
+ board: BoardProjection;
240
+ };
241
+ export declare function encodeHunsuRuntimeFile(value: unknown): EncodedHunsuRuntimeFile;
242
+ export declare function decodeHunsuRuntimeFileText<T = unknown>(text: string, source: string): Result<T, DomainStoreError>;
243
+ export declare function decodeRuntimeBundleToDraftFiles(runtime: HunsuRuntimeState): Record<HunsuDraftRuntimeFileName, unknown>;
244
+ export declare function hunsuDraftRuntimeBundleFromRuntime(runtime: HunsuRuntimeState): HunsuDraftRuntimeBundle;
245
+ export declare function readDraftRuntimeBundle(cwd: string, dir: string): Result<HunsuDraftRuntimeBundle, DomainStoreError>;
246
+ export declare function validateDraftRuntimeBundle(previous: HunsuDraftRuntimeBundle, request: HunsuDraftRuntimeBundle, sourceRuntime: HunsuRuntimeState): Result<HunsuDraftRuntimeValidation, DomainStoreError>;
247
+ export declare function encodeDraftRuntimeBundleToHunsuFiles(request: HunsuDraftRuntimeBundle): Record<typeof HUNSU_DESTINATIONS_PATH | typeof HUNSU_HARNESS_PATH | typeof HUNSU_EXECUTORS_PATH | typeof HUNSU_RESOURCES_PATH | typeof HUNSU_ARTIFACT_ACTIONS_PATH, EncodedHunsuRuntimeFile>;
248
+ export declare function readHunsuRuntimeStateFromWorktree(cwd?: string): {
249
+ runtime: HunsuRuntimeState;
250
+ checksum: RuntimeChecksum;
251
+ } | undefined;
252
+ export declare function readHunsuRuntimeStateAtRef(cwd?: string, ref?: string): {
253
+ runtime: HunsuRuntimeState;
254
+ checksum: RuntimeChecksum;
255
+ } | undefined;
256
+ export declare function readReachableHunsuRuntimeStates(cwd?: string): Array<{
257
+ commit: CommitSha;
258
+ runtime: HunsuRuntimeState;
259
+ checksum: RuntimeChecksum;
260
+ }>;
261
+ export declare function readPreviousExecutionChain(cwd?: string, ref?: string): Array<{
262
+ commit: CommitSha;
263
+ execution: HunsuPreviousExecutionFile;
264
+ }>;
265
+ export declare function hasHunsuRuntimeState(cwd?: string): boolean;
266
+ export declare function readDomainEventRefs(cwd?: string): DomainEventRef[];
267
+ export declare function readDomainEventObject(cwd: string, ref: Pick<DomainEventRef, "object" | "ref">): Result<DomainEvent, DomainStoreError>;
268
+ export declare function decodeDomainEventText(text: string, ref: string): Result<DomainEvent, DomainStoreError>;