import * as Context from "effect/Context"; import type * as Effect from "effect/Effect"; import type { Execution, ExecutionInteraction, ExecutionStep, SecretMaterial, SecretStore, } from "#schema"; type SecretMaterialSummary = { id: string; storeId: string; name: string | null; purpose: string; createdAt: number; updatedAt: number; }; export type SecretMaterialStoredDataRecord = { secretId: string; data: unknown; }; type SecretStoreSummary = { id: string; scopeId: string; kind: string; name: string; status: string; enabled: boolean; createdAt: number; updatedAt: number; }; export type ExecutorStateStoreShape = { secretStores: { getById: ( id: SecretStore["id"], ) => Effect.Effect, Error, never>; listAll: () => Effect.Effect; upsert: (store: SecretStore) => Effect.Effect; updateById: ( id: SecretStore["id"], update: Partial< Pick >, ) => Effect.Effect< import("effect/Option").Option, Error, never >; removeById: (id: SecretStore["id"]) => Effect.Effect; }; secretMaterials: { getById: ( id: SecretMaterial["id"], ) => Effect.Effect, Error, never>; listAll: () => Effect.Effect; upsert: (material: SecretMaterial) => Effect.Effect; updateById: ( id: SecretMaterial["id"], update: { name?: string | null }, ) => Effect.Effect< import("effect/Option").Option, Error, never >; removeById: (id: SecretMaterial["id"]) => Effect.Effect; }; secretMaterialStoredData: { getBySecretId: ( secretId: SecretMaterial["id"], ) => Effect.Effect< import("effect/Option").Option, Error, never >; upsert: ( record: SecretMaterialStoredDataRecord, ) => Effect.Effect; removeBySecretId: ( secretId: SecretMaterial["id"], ) => Effect.Effect; }; executions: { listByScope: ( scopeId: Execution["scopeId"], ) => Effect.Effect; getById: ( executionId: Execution["id"], ) => Effect.Effect, Error, never>; getByScopeAndId: ( scopeId: Execution["scopeId"], executionId: Execution["id"], ) => Effect.Effect, Error, never>; insert: (execution: Execution) => Effect.Effect; update: ( executionId: Execution["id"], patch: Partial< Omit >, ) => Effect.Effect, Error, never>; }; executionInteractions: { getById: ( interactionId: ExecutionInteraction["id"], ) => Effect.Effect< import("effect/Option").Option, Error, never >; listByExecutionId: ( executionId: ExecutionInteraction["executionId"], ) => Effect.Effect; getPendingByExecutionId: ( executionId: ExecutionInteraction["executionId"], ) => Effect.Effect< import("effect/Option").Option, Error, never >; insert: ( interaction: ExecutionInteraction, ) => Effect.Effect; update: ( interactionId: ExecutionInteraction["id"], patch: Partial< Omit >, ) => Effect.Effect< import("effect/Option").Option, Error, never >; }; executionSteps: { getByExecutionAndSequence: ( executionId: ExecutionStep["executionId"], sequence: ExecutionStep["sequence"], ) => Effect.Effect, Error, never>; listByExecutionId: ( executionId: ExecutionStep["executionId"], ) => Effect.Effect; insert: (step: ExecutionStep) => Effect.Effect; deleteByExecutionId: ( executionId: ExecutionStep["executionId"], ) => Effect.Effect; updateByExecutionAndSequence: ( executionId: ExecutionStep["executionId"], sequence: ExecutionStep["sequence"], patch: Partial< Omit >, ) => Effect.Effect, Error, never>; }; }; export class ExecutorStateStore extends Context.Tag( "#runtime/ExecutorStateStore", )() {}