chore: enforce folder module discipline in @uncaged/workflow

Each folder now has:
- types.ts for all type definitions
- index.ts with pure re-exports only
- Cross-folder imports go through index.ts

Closes #106
This commit is contained in:
2026-05-08 01:37:23 +00:00
parent a4237c0462
commit 2bbe5a3d0e
38 changed files with 389 additions and 262 deletions
+3 -23
View File
@@ -1,18 +1,7 @@
import type { RoleOutput, WorkflowCompletion } from "../types.js";
import { normalizeRefsField } from "../util/refs-field.js";
import { err, ok, type Result } from "../util/result.js";
import type { WorkflowCompletion } from "../types.js";
import { err, normalizeRefsField, ok, type Result } from "../util/index.js";
/** Role steps replayed from `.data.jsonl`, including persisted timestamps. */
export type ForkHistoricalStep = RoleOutput & { timestamp: number };
export type ParsedThreadStartRecord = {
workflowName: string;
hash: string;
threadId: string;
prompt: string;
maxRounds: number;
depth: number;
};
import type { ForkHistoricalStep, ForkPlan, ParsedThreadStartRecord } from "./types.js";
/** Recognizes a persisted workflow completion line (no `role`; has numeric `returnCode` and string `summary`). Omits `rootHash` when absent. */
export function tryParseWorkflowResultRecord(
@@ -228,15 +217,6 @@ export function selectForkHistoricalSteps(
return ok(roleSteps.slice(0, idx + 1));
}
export type ForkPlan = {
workflowName: string;
hash: string;
sourceThreadId: string;
prompt: string;
runOptions: { maxRounds: number; depth: number };
historicalSteps: ForkHistoricalStep[];
};
/**
* Read `.data.jsonl` text and compute fork payload for the worker `run` command.
*/