mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-01 09:29:38 +02:00
Migrate strict Effect runtime surfaces
This commit is contained in:
parent
f6878d4dd7
commit
b4ee2b691f
35 changed files with 1717 additions and 1410 deletions
|
|
@ -11,7 +11,7 @@
|
|||
* Python reference: trustgraph-flow/trustgraph/config/service/service.py
|
||||
*/
|
||||
|
||||
import { Duration, Effect } from "effect";
|
||||
import { Context, Duration, Effect } from "effect";
|
||||
import * as S from "effect/Schema";
|
||||
import {
|
||||
makeAsyncProcessor,
|
||||
|
|
@ -148,7 +148,7 @@ export type ConfigService = AsyncProcessorRuntime & Record<string, any>;
|
|||
|
||||
export function makeConfigService(config: ConfigServiceConfig): ConfigService {
|
||||
const service = makeAsyncProcessor(config, {
|
||||
run: () => service.run(),
|
||||
run: () => service.run(Context.empty()),
|
||||
}) as ConfigService;
|
||||
const baseStop = service.stop;
|
||||
service.store = new Map<string, WorkspaceStore>();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import {
|
|||
errorMessage,
|
||||
} from "@trustgraph/base";
|
||||
import type { Message } from "@trustgraph/base";
|
||||
import { Config, Duration, Effect } from "effect";
|
||||
import { Config, Context, Duration, Effect } from "effect";
|
||||
import * as S from "effect/Schema";
|
||||
import { ensureDirectory, joinPath, readTextFile, writeTextFile } from "../runtime/effect-files.js";
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ const closeResource = (
|
|||
|
||||
export function makeKnowledgeCoreService(config: KnowledgeCoreServiceConfig): KnowledgeCoreService {
|
||||
const service = makeAsyncProcessor(config, {
|
||||
run: () => service.run(),
|
||||
run: () => service.run(Context.empty()),
|
||||
}) as KnowledgeCoreService;
|
||||
const baseStop = service.stop;
|
||||
service.cores = new Map<string, KnowledgeCore>();
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import {
|
|||
} from "@trustgraph/base";
|
||||
import { makeProcessorProgram } from "@trustgraph/base";
|
||||
import type { Message } from "@trustgraph/base";
|
||||
import { Duration, Effect, Option } from "effect";
|
||||
import { Context, Duration, Effect, Option } from "effect";
|
||||
import * as S from "effect/Schema";
|
||||
|
||||
// ---------- Internal state types ----------
|
||||
|
|
@ -158,7 +158,7 @@ export type FlowManagerService = AsyncProcessorRuntime & Record<string, any>;
|
|||
|
||||
export function makeFlowManagerService(config: ProcessorConfig): FlowManagerService {
|
||||
const service = makeAsyncProcessor(config, {
|
||||
run: () => service.run(),
|
||||
run: () => service.run(Context.empty()),
|
||||
}) as FlowManagerService;
|
||||
const baseStop = service.stop;
|
||||
service.flows = new Map<string, FlowInstance>();
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import {
|
|||
type ProcessingMetadata,
|
||||
} from "@trustgraph/base";
|
||||
import type { Message } from "@trustgraph/base";
|
||||
import { Clock, Config, DateTime, Duration, Effect, Random } from "effect";
|
||||
import { Clock, Config, Context, DateTime, Duration, Effect, Random } from "effect";
|
||||
import * as S from "effect/Schema";
|
||||
import { makeCollectionManager } from "./collection-manager.js";
|
||||
import {
|
||||
|
|
@ -139,7 +139,7 @@ export type LibrarianService = AsyncProcessorRuntime & Record<string, any>;
|
|||
|
||||
export function makeLibrarianService(config: LibrarianServiceConfig): LibrarianService {
|
||||
const service = makeAsyncProcessor(config, {
|
||||
run: () => service.run(),
|
||||
run: () => service.run(Context.empty()),
|
||||
}) as LibrarianService;
|
||||
const baseStop = service.stop;
|
||||
service.documents = new Map<string, DocumentMetadata>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue