refactor: organize workflow/src into 6 module folders
Move 34 flat modules into cas/, registry/, bundle/, extract/, engine/, util/. Move gc.ts to engine/ (was in cas/) to avoid cas→engine reverse dependency. Dependency direction: util ← cas ← extract ← engine, util ← registry ← bundle. No logic changes — only file locations and import paths. Refs #102
This commit is contained in:
@@ -1,48 +1,21 @@
|
||||
export { buildDescriptor } from "./bundle/build-descriptor.js";
|
||||
export {
|
||||
CROCKFORD_BASE32_ALPHABET,
|
||||
decodeCrockfordBase32Bits,
|
||||
decodeCrockfordToUint64,
|
||||
encodeCrockfordBase32Bits,
|
||||
encodeUint64AsCrockford,
|
||||
} from "./base32.js";
|
||||
export { buildDescriptor } from "./build-descriptor.js";
|
||||
export { validateWorkflowBundle, type WorkflowBundleValidationInput } from "./bundle-validator.js";
|
||||
export { type CasStore, createCasStore, createThreadCas } from "./cas.js";
|
||||
export { createWorkflow } from "./create-workflow.js";
|
||||
validateWorkflowBundle,
|
||||
type WorkflowBundleValidationInput,
|
||||
} from "./bundle/bundle-validator.js";
|
||||
export {
|
||||
type ExecuteThreadIo,
|
||||
type ExecuteThreadOptions,
|
||||
executeThread,
|
||||
type PrefilledDiskStep,
|
||||
} from "./engine.js";
|
||||
export { type ExtractedBundleExports, extractBundleExports } from "./extract-bundle-exports.js";
|
||||
export { createExtract, type ExtractFn } from "./extract-fn.js";
|
||||
export { getExtractProvider } from "./extract-provider.js";
|
||||
type ExtractedBundleExports,
|
||||
extractBundleExports,
|
||||
} from "./bundle/extract-bundle-exports.js";
|
||||
export { stringifyWorkflowDescriptor } from "./bundle/generate-descriptor.js";
|
||||
export {
|
||||
buildForkPlan,
|
||||
type ForkHistoricalStep,
|
||||
type ForkPlan,
|
||||
type ParsedThreadStartRecord,
|
||||
parseThreadDataJsonl,
|
||||
selectForkHistoricalSteps,
|
||||
tryParseRoleStepRecord,
|
||||
tryParseWorkflowResultRecord,
|
||||
} from "./fork-thread.js";
|
||||
export { type GcResult, garbageCollectCas } from "./gc.js";
|
||||
export { stringifyWorkflowDescriptor } from "./generate-descriptor.js";
|
||||
export { hashString, hashWorkflowBundleBytes } from "./hash.js";
|
||||
export {
|
||||
type LlmError,
|
||||
llmErrorToCause,
|
||||
llmExtract,
|
||||
llmExtractWithRetry,
|
||||
} from "./llm-extract.js";
|
||||
export {
|
||||
type CreateLoggerOptions,
|
||||
createLogger,
|
||||
type LogFn,
|
||||
type LoggerSink,
|
||||
} from "./logger.js";
|
||||
validateWorkflowDescriptor,
|
||||
type WorkflowDescriptor,
|
||||
type WorkflowRoleDescriptor,
|
||||
type WorkflowRoleSchema,
|
||||
} from "./bundle/workflow-descriptor.js";
|
||||
export { type CasStore, createCasStore, createThreadCas } from "./cas/cas.js";
|
||||
export { hashString, hashWorkflowBundleBytes } from "./cas/hash.js";
|
||||
export {
|
||||
createContentMerkleNode,
|
||||
getContentMerklePayload,
|
||||
@@ -55,8 +28,36 @@ export {
|
||||
type StepMerklePayload,
|
||||
serializeMerkleNode,
|
||||
type ThreadMerklePayload,
|
||||
} from "./merkle.js";
|
||||
export { type ReactExtractArgs, reactExtract } from "./react-extract.js";
|
||||
} from "./cas/merkle.js";
|
||||
export { createWorkflow } from "./engine/create-workflow.js";
|
||||
export {
|
||||
type ExecuteThreadIo,
|
||||
type ExecuteThreadOptions,
|
||||
executeThread,
|
||||
type PrefilledDiskStep,
|
||||
} from "./engine/engine.js";
|
||||
export {
|
||||
buildForkPlan,
|
||||
type ForkHistoricalStep,
|
||||
type ForkPlan,
|
||||
type ParsedThreadStartRecord,
|
||||
parseThreadDataJsonl,
|
||||
selectForkHistoricalSteps,
|
||||
tryParseRoleStepRecord,
|
||||
tryParseWorkflowResultRecord,
|
||||
} from "./engine/fork-thread.js";
|
||||
export { type GcResult, garbageCollectCas } from "./engine/gc.js";
|
||||
export { createThreadPauseGate, type ThreadPauseGate } from "./engine/thread-pause-gate.js";
|
||||
export { getWorkerHostScriptPath } from "./engine/worker-entry-path.js";
|
||||
export { createExtract, type ExtractFn } from "./extract/extract-fn.js";
|
||||
export {
|
||||
type LlmError,
|
||||
llmErrorToCause,
|
||||
llmExtract,
|
||||
llmExtractWithRetry,
|
||||
} from "./extract/llm-extract.js";
|
||||
export { type ReactExtractArgs, reactExtract } from "./extract/react-extract.js";
|
||||
export { getExtractProvider } from "./extract-provider.js";
|
||||
export {
|
||||
type ExtractProviderConfig,
|
||||
getRegisteredWorkflow,
|
||||
@@ -73,10 +74,7 @@ export {
|
||||
type WorkflowRegistryFile,
|
||||
workflowRegistryPath,
|
||||
writeWorkflowRegistry,
|
||||
} from "./registry.js";
|
||||
export { err, ok, type Result } from "./result.js";
|
||||
export { getDefaultWorkflowStorageRoot, getGlobalCasDir } from "./storage-root.js";
|
||||
export { createThreadPauseGate, type ThreadPauseGate } from "./thread-pause-gate.js";
|
||||
} from "./registry/registry.js";
|
||||
export {
|
||||
type AgentBinding,
|
||||
type AgentContext,
|
||||
@@ -101,12 +99,20 @@ export {
|
||||
type WorkflowFnOptions,
|
||||
type WorkflowResult,
|
||||
} from "./types.js";
|
||||
export { generateUlid } from "./ulid.js";
|
||||
export { getWorkerHostScriptPath } from "./worker-entry-path.js";
|
||||
export { type WorkflowAsAgentOptions, workflowAsAgent } from "./workflow-as-agent.js";
|
||||
export {
|
||||
validateWorkflowDescriptor,
|
||||
type WorkflowDescriptor,
|
||||
type WorkflowRoleDescriptor,
|
||||
type WorkflowRoleSchema,
|
||||
} from "./workflow-descriptor.js";
|
||||
CROCKFORD_BASE32_ALPHABET,
|
||||
decodeCrockfordBase32Bits,
|
||||
decodeCrockfordToUint64,
|
||||
encodeCrockfordBase32Bits,
|
||||
encodeUint64AsCrockford,
|
||||
} from "./util/base32.js";
|
||||
export {
|
||||
type CreateLoggerOptions,
|
||||
createLogger,
|
||||
type LogFn,
|
||||
type LoggerSink,
|
||||
} from "./util/logger.js";
|
||||
export { err, ok, type Result } from "./util/result.js";
|
||||
export { getDefaultWorkflowStorageRoot, getGlobalCasDir } from "./util/storage-root.js";
|
||||
export { generateUlid } from "./util/ulid.js";
|
||||
export { type WorkflowAsAgentOptions, workflowAsAgent } from "./workflow-as-agent.js";
|
||||
|
||||
Reference in New Issue
Block a user