@llm4ts/runner 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.
Files changed (98) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -0
  3. package/dist/Cli.d.ts +5 -0
  4. package/dist/Cli.d.ts.map +1 -0
  5. package/dist/Cli.js +36 -0
  6. package/dist/Cli.js.map +1 -0
  7. package/dist/CoderPolicy.d.ts +12 -0
  8. package/dist/CoderPolicy.d.ts.map +1 -0
  9. package/dist/CoderPolicy.js +59 -0
  10. package/dist/CoderPolicy.js.map +1 -0
  11. package/dist/Connectors.d.ts +28 -0
  12. package/dist/Connectors.d.ts.map +1 -0
  13. package/dist/Connectors.js +165 -0
  14. package/dist/Connectors.js.map +1 -0
  15. package/dist/Doctor.d.ts +4 -0
  16. package/dist/Doctor.d.ts.map +1 -0
  17. package/dist/Doctor.js +33 -0
  18. package/dist/Doctor.js.map +1 -0
  19. package/dist/FlowArgs.d.ts +34 -0
  20. package/dist/FlowArgs.d.ts.map +1 -0
  21. package/dist/FlowArgs.js +136 -0
  22. package/dist/FlowArgs.js.map +1 -0
  23. package/dist/FlowRunner.d.ts +48 -0
  24. package/dist/FlowRunner.d.ts.map +1 -0
  25. package/dist/FlowRunner.js +97 -0
  26. package/dist/FlowRunner.js.map +1 -0
  27. package/dist/McpStdio.d.ts +7 -0
  28. package/dist/McpStdio.d.ts.map +1 -0
  29. package/dist/McpStdio.js +19 -0
  30. package/dist/McpStdio.js.map +1 -0
  31. package/dist/NodeGeminiCliExecutor.d.ts +7 -0
  32. package/dist/NodeGeminiCliExecutor.d.ts.map +1 -0
  33. package/dist/NodeGeminiCliExecutor.js +26 -0
  34. package/dist/NodeGeminiCliExecutor.js.map +1 -0
  35. package/dist/NodeHttpClient.d.ts +5 -0
  36. package/dist/NodeHttpClient.d.ts.map +1 -0
  37. package/dist/NodeHttpClient.js +109 -0
  38. package/dist/NodeHttpClient.js.map +1 -0
  39. package/dist/NodePlainFileStore.d.ts +5 -0
  40. package/dist/NodePlainFileStore.d.ts.map +1 -0
  41. package/dist/NodePlainFileStore.js +64 -0
  42. package/dist/NodePlainFileStore.js.map +1 -0
  43. package/dist/NodeProcessExecutor.d.ts +5 -0
  44. package/dist/NodeProcessExecutor.d.ts.map +1 -0
  45. package/dist/NodeProcessExecutor.js +212 -0
  46. package/dist/NodeProcessExecutor.js.map +1 -0
  47. package/dist/NodeRuntime.d.ts +4 -0
  48. package/dist/NodeRuntime.d.ts.map +1 -0
  49. package/dist/NodeRuntime.js +11 -0
  50. package/dist/NodeRuntime.js.map +1 -0
  51. package/dist/NodeTemporaryFiles.d.ts +5 -0
  52. package/dist/NodeTemporaryFiles.d.ts.map +1 -0
  53. package/dist/NodeTemporaryFiles.js +30 -0
  54. package/dist/NodeTemporaryFiles.js.map +1 -0
  55. package/dist/NodeWorkspace.d.ts +6 -0
  56. package/dist/NodeWorkspace.d.ts.map +1 -0
  57. package/dist/NodeWorkspace.js +231 -0
  58. package/dist/NodeWorkspace.js.map +1 -0
  59. package/dist/Package.d.ts +2 -0
  60. package/dist/Package.d.ts.map +1 -0
  61. package/dist/Package.js +2 -0
  62. package/dist/Package.js.map +1 -0
  63. package/dist/ReviewFingerprint.d.ts +2 -0
  64. package/dist/ReviewFingerprint.d.ts.map +1 -0
  65. package/dist/ReviewFingerprint.js +13 -0
  66. package/dist/ReviewFingerprint.js.map +1 -0
  67. package/dist/Terminal.d.ts +46 -0
  68. package/dist/Terminal.d.ts.map +1 -0
  69. package/dist/Terminal.js +226 -0
  70. package/dist/Terminal.js.map +1 -0
  71. package/dist/TerminalInteraction.d.ts +4 -0
  72. package/dist/TerminalInteraction.d.ts.map +1 -0
  73. package/dist/TerminalInteraction.js +25 -0
  74. package/dist/TerminalInteraction.js.map +1 -0
  75. package/dist/cli-main.d.ts +3 -0
  76. package/dist/cli-main.d.ts.map +1 -0
  77. package/dist/cli-main.js +39 -0
  78. package/dist/cli-main.js.map +1 -0
  79. package/package.json +74 -0
  80. package/src/Cli.ts +51 -0
  81. package/src/CoderPolicy.ts +82 -0
  82. package/src/Connectors.ts +225 -0
  83. package/src/Doctor.ts +44 -0
  84. package/src/FlowArgs.ts +167 -0
  85. package/src/FlowRunner.ts +220 -0
  86. package/src/McpStdio.ts +41 -0
  87. package/src/NodeGeminiCliExecutor.ts +56 -0
  88. package/src/NodeHttpClient.ts +224 -0
  89. package/src/NodePlainFileStore.ts +75 -0
  90. package/src/NodeProcessExecutor.ts +331 -0
  91. package/src/NodeRuntime.ts +19 -0
  92. package/src/NodeTemporaryFiles.ts +46 -0
  93. package/src/NodeWorkspace.ts +282 -0
  94. package/src/Package.ts +1 -0
  95. package/src/ReviewFingerprint.ts +13 -0
  96. package/src/Terminal.ts +329 -0
  97. package/src/TerminalInteraction.ts +43 -0
  98. package/src/cli-main.ts +53 -0
@@ -0,0 +1,136 @@
1
+ import { readFile, stat } from "node:fs/promises";
2
+ import { resolve } from "node:path";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Schema from "effect/Schema";
5
+ export const FlowUsage = 'usage: llm4ts ["<prompt>" | --prompt-file <path> | @<path>] [--repo <path>] | llm4ts doctor';
6
+ export const FlowHelp = `${FlowUsage}
7
+
8
+ Stream one prompt to your configured coding agent and print the response.
9
+
10
+ arguments:
11
+ "<prompt>" prompt text
12
+ @<path> read the prompt from a file
13
+ --prompt-file <path> read the prompt from a file
14
+ --repo, -C <path> run against this repository (default: current directory)
15
+ -h, --help show this help
16
+ --version print the version
17
+
18
+ commands:
19
+ doctor check connector availability and credentials
20
+
21
+ environment:
22
+ LLM4TS_CODER coding agent: claude|codex|gemini|pi|agy|grok|cursor|opencode (default: claude)
23
+ LLM4TS_VERBOSITY terminal verbosity: quiet|normal|verbose
24
+ OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY
25
+ credentials for API providers
26
+
27
+ A trace of each run is written under .llm4ts/ in the target repository.
28
+ `;
29
+ export class ScriptUsage extends Schema.TaggedErrorClass()("ScriptUsage", {
30
+ message: Schema.String
31
+ }) {
32
+ }
33
+ export const parseFlowArgs = (args) => {
34
+ let parsed = {};
35
+ for (let index = 0; index < args.length; index += 1) {
36
+ const argument = args[index] ?? "";
37
+ if (argument === "--") {
38
+ continue;
39
+ }
40
+ else if (argument === "--help" || argument === "-h") {
41
+ parsed = { ...parsed, help: true };
42
+ }
43
+ else if (argument === "--version") {
44
+ parsed = { ...parsed, version: true };
45
+ }
46
+ else if (argument === "--prompt-file") {
47
+ const value = args[index + 1];
48
+ if (value === undefined) {
49
+ return {
50
+ ok: false,
51
+ error: ScriptUsage.make({
52
+ message: `--prompt-file requires a path\n${FlowUsage}`
53
+ })
54
+ };
55
+ }
56
+ parsed = { ...parsed, promptFile: value };
57
+ index += 1;
58
+ }
59
+ else if (argument.startsWith("--prompt-file=")) {
60
+ parsed = {
61
+ ...parsed,
62
+ promptFile: argument.slice("--prompt-file=".length)
63
+ };
64
+ }
65
+ else if (argument === "--repo" || argument === "-C") {
66
+ const value = args[index + 1];
67
+ if (value === undefined) {
68
+ return {
69
+ ok: false,
70
+ error: ScriptUsage.make({
71
+ message: `${argument} requires a path\n${FlowUsage}`
72
+ })
73
+ };
74
+ }
75
+ parsed = { ...parsed, repo: value };
76
+ index += 1;
77
+ }
78
+ else if (argument.startsWith("--repo=")) {
79
+ parsed = { ...parsed, repo: argument.slice("--repo=".length) };
80
+ }
81
+ else if (argument.startsWith("--")) {
82
+ return {
83
+ ok: false,
84
+ error: ScriptUsage.make({
85
+ message: `unknown flag: ${argument}\n${FlowUsage}`
86
+ })
87
+ };
88
+ }
89
+ else if (argument.startsWith("@") && argument.length > 1 && parsed.promptFile === undefined) {
90
+ parsed = { ...parsed, promptFile: argument.slice(1) };
91
+ }
92
+ else if (parsed.promptText === undefined && argument.trim().length > 0) {
93
+ parsed = { ...parsed, promptText: argument.trim() };
94
+ }
95
+ }
96
+ return { ok: true, value: parsed };
97
+ };
98
+ export const readFlowPrompt = (args, defaultPrompt) => {
99
+ if (args.promptFile !== undefined) {
100
+ return Effect.tryPromise({
101
+ try: () => readFile(args.promptFile ?? "", "utf8"),
102
+ catch: (error) => ScriptUsage.make({
103
+ message: `could not read prompt file ${args.promptFile}: ${error instanceof Error ? error.message : String(error)}`
104
+ })
105
+ });
106
+ }
107
+ const prompt = args.promptText ?? defaultPrompt;
108
+ return prompt === undefined
109
+ ? Effect.fail(ScriptUsage.make({ message: FlowUsage }))
110
+ : Effect.succeed(prompt);
111
+ };
112
+ export const resolveFlowRepo = (args, workspace) => {
113
+ const path = resolve(workspace, args.repo ?? ".");
114
+ return Effect.tryPromise({
115
+ try: async () => {
116
+ const information = await stat(path);
117
+ if (!information.isDirectory()) {
118
+ throw new Error("not a directory");
119
+ }
120
+ return path;
121
+ },
122
+ catch: (error) => ScriptUsage.make({
123
+ message: `--repo is not a directory: ${path}${error instanceof Error ? ` (${error.message})` : ""}`
124
+ })
125
+ });
126
+ };
127
+ export const resolveFlowInput = Effect.fn("@llm4ts/runner/FlowArgs.resolveFlowInput")(function* (defaultPrompt, argv = process.argv.slice(2), workspace = process.cwd()) {
128
+ const parsed = parseFlowArgs(argv);
129
+ if (!parsed.ok) {
130
+ return yield* parsed.error;
131
+ }
132
+ const prompt = yield* readFlowPrompt(parsed.value, defaultPrompt);
133
+ const workDir = yield* resolveFlowRepo(parsed.value, workspace);
134
+ return { prompt, workDir, workspace };
135
+ });
136
+ //# sourceMappingURL=FlowArgs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowArgs.js","sourceRoot":"","sources":["../src/FlowArgs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAUvC,MAAM,CAAC,MAAM,SAAS,GACpB,6FAA6F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AAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IAC/D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,CAAA;AACvC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,48 @@
1
+ import * as Effect from "effect/Effect";
2
+ import type * as Scope from "effect/Scope";
3
+ import type { ConnectorConfig } from "@llm4ts/core/ConnectorConfig";
4
+ import type { ConnectorRegistryShape } from "@llm4ts/core/ConnectorRegistry";
5
+ import type { HttpClientShape } from "@llm4ts/core/HttpClient";
6
+ import type { ProcessExecutorShape } from "@llm4ts/core/ProcessExecutor";
7
+ import type { TemporaryFilesShape } from "@llm4ts/core/TemporaryFiles";
8
+ import type { GeminiCliExecutorShape } from "@llm4ts/core/providers/GeminiCliProvider";
9
+ import { FlowLlmError, type FlowError } from "@llm4ts/flow/FlowError";
10
+ import { type FlowEventHub } from "@llm4ts/flow/FlowEvents";
11
+ import { type FlowContextShape } from "@llm4ts/flow/FlowContext";
12
+ import type { PlainFileStoreShape } from "@llm4ts/flow/Persistence";
13
+ import { type TerminalSurface, type Verbosity } from "./Terminal.ts";
14
+ export interface FlowRunnerDependencies {
15
+ readonly registry: ConnectorRegistryShape;
16
+ readonly process: ProcessExecutorShape;
17
+ readonly files: PlainFileStoreShape;
18
+ }
19
+ export interface NodeConnectorDependencies {
20
+ readonly http: HttpClientShape;
21
+ readonly process: ProcessExecutorShape;
22
+ readonly temporaryFiles: TemporaryFilesShape;
23
+ readonly geminiCli: GeminiCliExecutorShape;
24
+ }
25
+ export declare const nodeFlowRunnerDependencies: () => FlowRunnerDependencies;
26
+ export interface FlowRunnerOptions {
27
+ readonly workDir: string;
28
+ readonly workspace: string;
29
+ readonly userPrompt: string;
30
+ readonly coder: ConnectorConfig;
31
+ readonly reasoning?: ConnectorConfig;
32
+ readonly reviewers?: ReadonlyArray<ConnectorConfig>;
33
+ readonly tracePath?: string;
34
+ readonly runId?: string;
35
+ readonly verbosity?: Verbosity;
36
+ readonly surface?: TerminalSurface;
37
+ readonly environment?: Readonly<Record<string, string | undefined>>;
38
+ }
39
+ export interface FlowRunnerBundle {
40
+ readonly context: FlowContextShape;
41
+ readonly events: FlowEventHub;
42
+ }
43
+ export declare const makeFlowRunnerContext: (options: FlowRunnerOptions, dependencies: FlowRunnerDependencies) => Effect.Effect<FlowRunnerBundle, import("@llm4ts/flow/FlowError").PersistenceError | import("@llm4ts/flow/FlowError").PlanParseError | import("@llm4ts/flow/FlowError").UnsupportedSchemaVersion | import("@llm4ts/flow/FlowError").WorkspacePathError | import("@llm4ts/flow/FlowError").WorkspaceLimitError | import("@llm4ts/flow/FlowError").WorkspaceIoError | import("@llm4ts/flow/FlowError").FlowAborted | import("@llm4ts/flow/FlowError").ProcessError | FlowLlmError | import("@llm4ts/flow/FlowError").FlowCapabilityDenied | import("@llm4ts/flow/FlowError").BudgetExceeded, never>;
44
+ export declare const runWithBundle: <A, E, R>(bundle: FlowRunnerBundle, options: FlowRunnerOptions, body: (context: FlowContextShape) => Effect.Effect<A, E, R>, dependencies?: FlowRunnerDependencies | undefined) => Effect.Effect<A, import("@llm4ts/flow/FlowError").PersistenceError | import("@llm4ts/flow/FlowError").PlanParseError | import("@llm4ts/flow/FlowError").UnsupportedSchemaVersion | import("@llm4ts/flow/FlowError").WorkspacePathError | import("@llm4ts/flow/FlowError").WorkspaceLimitError | import("@llm4ts/flow/FlowError").WorkspaceIoError | import("@llm4ts/flow/FlowError").FlowAborted | import("@llm4ts/flow/FlowError").ProcessError | FlowLlmError | import("@llm4ts/flow/FlowError").FlowCapabilityDenied | import("@llm4ts/flow/FlowError").BudgetExceeded | E, Scope.Scope | R>;
45
+ export declare const runEmbedded: <A, E, R>(options: FlowRunnerOptions, body: (context: FlowContextShape) => Effect.Effect<A, E, R>, dependencies?: FlowRunnerDependencies | undefined) => Effect.Effect<A, import("@llm4ts/flow/FlowError").PersistenceError | import("@llm4ts/flow/FlowError").PlanParseError | import("@llm4ts/flow/FlowError").UnsupportedSchemaVersion | import("@llm4ts/flow/FlowError").WorkspacePathError | import("@llm4ts/flow/FlowError").WorkspaceLimitError | import("@llm4ts/flow/FlowError").WorkspaceIoError | import("@llm4ts/flow/FlowError").FlowAborted | import("@llm4ts/flow/FlowError").ProcessError | FlowLlmError | import("@llm4ts/flow/FlowError").FlowCapabilityDenied | import("@llm4ts/flow/FlowError").BudgetExceeded | E, Scope.Scope | R>;
46
+ export declare const runNode: <A, E, R>(options: FlowRunnerOptions, body: (context: FlowContextShape) => Effect.Effect<A, E, R>) => Effect.Effect<A, E | FlowError, R>;
47
+ export declare const runFlowMain: <E>(program: Effect.Effect<void, E>) => void;
48
+ //# sourceMappingURL=FlowRunner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowRunner.d.ts","sourceRoot":"","sources":["../src/FlowRunner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAEnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAA;AAGtF,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC7E,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAI7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAOnE,OAAO,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YAAY,CAAA;CAC9B;AAED,eAAO,MAAM,qBAAqB,woBA0ChC,CAAA;AAEF,eAAO,MAAM,aAAa,GACxB,CAAC,EACD,CAAC,EACD,CAAC,wEAIe,gBAAgB,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,unBA4D3D,CAAA;AAEF,eAAO,MAAM,WAAW,GAAiE,CAAC,EAAE,CAAC,EAAE,CAAC,8CAE9E,gBAAgB,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,unBAK3D,CAAA;AAEF,eAAO,MAAM,OAAO,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAC7B,SAAS,iBAAiB,EAC1B,MAAM,CAAC,OAAO,EAAE,gBAAgB,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC1D,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,CAA8C,CAAA;AAKlF,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,KAAG,IAchE,CAAA"}
@@ -0,0 +1,97 @@
1
+ import * as Clock from "effect/Clock";
2
+ import * as Effect from "effect/Effect";
3
+ import { defaultReasoningConfig } from "@llm4ts/core/ConnectorConfig";
4
+ import { createConnectorRegistry } from "@llm4ts/core/providers/ConnectorFactories";
5
+ import { makeCostTracker } from "@llm4ts/flow/CostTracker";
6
+ import { FlowLlmError } from "@llm4ts/flow/FlowError";
7
+ import { makeFlowEventHub } from "@llm4ts/flow/FlowEvents";
8
+ import { FlowContext } from "@llm4ts/flow/FlowContext";
9
+ import { makeFlowRecorder } from "@llm4ts/flow/FlowRecorder";
10
+ import { makeGitHubTool } from "@llm4ts/flow/GitHubTool";
11
+ import { makeGitTool } from "@llm4ts/flow/GitTool";
12
+ import { nodeHttpClient } from "./NodeHttpClient.js";
13
+ import { nodeGeminiCliExecutor } from "./NodeGeminiCliExecutor.js";
14
+ import { nodePlainFileStore } from "./NodePlainFileStore.js";
15
+ import { nodeProcessExecutor } from "./NodeProcessExecutor.js";
16
+ import { nodeTemporaryFiles } from "./NodeTemporaryFiles.js";
17
+ import { prepareConnector } from "./Connectors.js";
18
+ import { consumeTerminalEvents, makeTerminalSurface } from "./Terminal.js";
19
+ export const nodeFlowRunnerDependencies = () => ({
20
+ process: nodeProcessExecutor,
21
+ files: nodePlainFileStore,
22
+ registry: createConnectorRegistry({
23
+ http: nodeHttpClient,
24
+ process: nodeProcessExecutor,
25
+ temporaryFiles: nodeTemporaryFiles,
26
+ geminiCli: nodeGeminiCliExecutor
27
+ })
28
+ });
29
+ export const makeFlowRunnerContext = Effect.fn("@llm4ts/runner/FlowRunner.makeContext")(function* (options, dependencies) {
30
+ const events = yield* makeFlowEventHub();
31
+ const coderConfig = prepareConnector(options.coder, options.workDir, options.environment ?? process.env);
32
+ const reasoning = defaultReasoningConfig(options.coder, options.reasoning);
33
+ const reasoningPrepared = prepareConnector(reasoning, options.workDir, options.environment ?? process.env);
34
+ const coder = yield* dependencies.registry
35
+ .resolve(coderConfig)
36
+ .pipe(Effect.mapError(FlowLlmError.from));
37
+ const reasoningService = yield* dependencies.registry
38
+ .resolve(reasoningPrepared)
39
+ .pipe(Effect.mapError(FlowLlmError.from));
40
+ const reviewers = yield* Effect.forEach(options.reviewers ?? [], (configuration) => dependencies.registry
41
+ .resolve(prepareConnector(configuration, options.workDir, options.environment ?? process.env))
42
+ .pipe(Effect.mapError(FlowLlmError.from)));
43
+ return {
44
+ events,
45
+ context: FlowContext.of({
46
+ reasoning: reasoningService,
47
+ coder,
48
+ git: makeGitTool(dependencies.process, options.workDir, events),
49
+ hosting: makeGitHubTool(dependencies.process, options.workDir, events),
50
+ events,
51
+ reviewers,
52
+ coderCapabilities: coder.capabilities,
53
+ userPrompt: options.userPrompt,
54
+ workDir: options.workDir,
55
+ workspace: options.workspace
56
+ })
57
+ };
58
+ });
59
+ export const runWithBundle = Effect.fn("@llm4ts/runner/FlowRunner.runWithBundle")(function* (bundle, options, body, dependencies = nodeFlowRunnerDependencies()) {
60
+ const tracker = yield* makeCostTracker();
61
+ const surface = options.surface ?? (yield* makeTerminalSurface(options.environment ?? process.env));
62
+ const palette = surface.palette;
63
+ const terminal = yield* consumeTerminalEvents(bundle.events, surface, options.verbosity ?? "Normal");
64
+ yield* tracker.consume(bundle.events);
65
+ const recorder = options.tracePath === undefined
66
+ ? undefined
67
+ : yield* makeFlowRecorder(dependencies.files, options.tracePath, options.runId ?? `run-${(yield* Clock.currentTimeMillis).toString()}`);
68
+ if (recorder !== undefined) {
69
+ yield* recorder.consume(bundle.events);
70
+ }
71
+ yield* surface.setStatus("preparing flow");
72
+ return yield* body(bundle.context).pipe(Effect.provideService(FlowContext, bundle.context), Effect.ensuring(Effect.all([
73
+ terminal.awaitDrained(),
74
+ tracker.awaitDrained(bundle.events),
75
+ recorder === undefined ? Effect.void : recorder.awaitDrained(bundle.events)
76
+ ], { concurrency: "unbounded" }).pipe(Effect.andThen(surface.setStatus(undefined)), Effect.andThen(tracker.summary), Effect.flatMap((summary) => surface.log(`\n${summary}`)))), Effect.tapError((error) => surface
77
+ .setStatus(undefined)
78
+ .pipe(Effect.andThen(surface.log(`\n${palette.fail(`flow failed: ${error instanceof Error ? error.message : String(error)}`)}`)))), Effect.tap(() => surface
79
+ .setStatus(undefined)
80
+ .pipe(Effect.andThen(surface.log(`\n${palette.stageDone("flow completed")}`)))));
81
+ });
82
+ export const runEmbedded = Effect.fn("@llm4ts/runner/FlowRunner.runEmbedded")(function* (options, body, dependencies = nodeFlowRunnerDependencies()) {
83
+ const bundle = yield* makeFlowRunnerContext(options, dependencies);
84
+ return yield* runWithBundle(bundle, options, body, dependencies);
85
+ });
86
+ export const runNode = (options, body) => Effect.scoped(runEmbedded(options, body));
87
+ const mainErrorMessage = (error) => error instanceof Error && error.message.length > 0 ? error.message : String(error);
88
+ export const runFlowMain = (program) => {
89
+ Effect.runFork(program.pipe(Effect.match({
90
+ onFailure: (error) => Effect.sync(() => {
91
+ process.stderr.write(`${mainErrorMessage(error)}\n`);
92
+ process.exitCode = 1;
93
+ }),
94
+ onSuccess: () => Effect.void
95
+ }), Effect.flatten));
96
+ };
97
+ //# sourceMappingURL=FlowRunner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowRunner.js","sourceRoot":"","sources":["../src/FlowRunner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAMrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAA;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAkB,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAqB,MAAM,yBAAyB,CAAA;AAC7E,OAAO,EAAE,WAAW,EAAyB,MAAM,0BAA0B,CAAA;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EACL,qBAAqB,EAC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ACrB,OAA0B,EAC1B,IAA2D,EACvB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;AAElF,MAAM,gBAAgB,GAAG,CAAC,KAAc,EAAU,EAAE,CAClD,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAEpF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAI,OAA+B,EAAQ,EAAE;IACtE,MAAM,CAAC,OAAO,CACZ,OAAO,CAAC,IAAI,CACV,MAAM,CAAC,KAAK,CAAC;QACX,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CACnB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;YACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACpD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;QACtB,CAAC,CAAC;QACJ,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI;KAC7B,CAAC,EACF,MAAM,CAAC,OAAO,CACf,CACF,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Stream from "effect/Stream";
3
+ import { type FlowError } from "@llm4ts/flow/FlowError";
4
+ import { type McpTool } from "@llm4ts/flow/McpServer";
5
+ export declare const mcpStdioResponses: <R>(lines: Stream.Stream<string, FlowError, R>, tools: ReadonlyArray<McpTool>) => Stream.Stream<string, FlowError, R>;
6
+ export declare const runMcpStdio: (tools: ReadonlyArray<McpTool>, write?: (line: string) => void) => Effect.Effect<void, FlowError>;
7
+ //# sourceMappingURL=McpStdio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"McpStdio.d.ts","sourceRoot":"","sources":["../src/McpStdio.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAEpE,eAAO,MAAM,iBAAiB,GAAI,CAAC,EACjC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,EAC1C,OAAO,aAAa,CAAC,OAAO,CAAC,KAC5B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAIlC,CAAA;AAEH,eAAO,MAAM,WAAW,GACtB,OAAO,aAAa,CAAC,OAAO,CAAC,EAC7B,QAAO,CAAC,IAAI,EAAE,MAAM,KAAK,IAA0C,KAClE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAqB7B,CAAA"}
@@ -0,0 +1,19 @@
1
+ import { createInterface } from "node:readline";
2
+ import { stdin, stdout } from "node:process";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Stream from "effect/Stream";
5
+ import { ProcessError } from "@llm4ts/flow/FlowError";
6
+ import { handleMcpLine } from "@llm4ts/flow/McpServer";
7
+ export const mcpStdioResponses = (lines, tools) => lines.pipe(Stream.mapEffect((line) => handleMcpLine(line, tools)), Stream.filter((response) => response !== undefined));
8
+ export const runMcpStdio = (tools, write = (line) => stdout.write(`${line}\n`)) => Effect.acquireUseRelease(Effect.sync(() => createInterface({
9
+ input: stdin,
10
+ crlfDelay: Infinity,
11
+ terminal: false
12
+ })), (input) => {
13
+ const lines = Stream.fromAsyncIterable(input, (error) => ProcessError.make({
14
+ message: "MCP stdio input",
15
+ detail: error instanceof Error ? error.message : String(error)
16
+ }));
17
+ return mcpStdioResponses(lines, tools).pipe(Stream.runForEach((line) => Effect.sync(() => write(line))));
18
+ }, (input) => Effect.sync(() => input.close()));
19
+ //# sourceMappingURL=McpStdio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"McpStdio.js","sourceRoot":"","sources":["../src/McpStdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,YAAY,EAAkB,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAE,aAAa,EAAgB,MAAM,wBAAwB,CAAA;AAEpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,KAA0C,EAC1C,KAA6B,EACQ,EAAE,CACvC,KAAK,CAAC,IAAI,CACR,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EACtD,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAsB,EAAE,CAAC,QAAQ,KAAK,SAAS,CAAC,CACxE,CAAA;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,KAA6B,EAC7B,QAAgC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC,EACnC,EAAE,CAClC,MAAM,CAAC,iBAAiB,CACtB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CACf,eAAe,CAAC;IACd,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,QAAQ;IACnB,QAAQ,EAAE,KAAK;CAChB,CAAC,CACH,EACD,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,KAAK,GAAG,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CACtD,YAAY,CAAC,IAAI,CAAC;QAChB,OAAO,EAAE,iBAAiB;QAC1B,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KAC/D,CAAC,CACH,CAAA;IACD,OAAO,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,CACzC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5D,CAAA;AACH,CAAC,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAC5C,CAAA"}
@@ -0,0 +1,7 @@
1
+ import * as Layer from "effect/Layer";
2
+ import type { ProcessExecutorShape } from "@llm4ts/core/ProcessExecutor";
3
+ import { GeminiCliExecutor, type GeminiCliExecutorShape } from "@llm4ts/core/providers/GeminiCliProvider";
4
+ export declare const makeNodeGeminiCliExecutor: (executor: ProcessExecutorShape) => GeminiCliExecutorShape;
5
+ export declare const nodeGeminiCliExecutor: GeminiCliExecutorShape;
6
+ export declare const NodeGeminiCliExecutorLive: Layer.Layer<GeminiCliExecutor, never, never>;
7
+ //# sourceMappingURL=NodeGeminiCliExecutor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeGeminiCliExecutor.d.ts","sourceRoot":"","sources":["../src/NodeGeminiCliExecutor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,EACL,iBAAiB,EAMjB,KAAK,sBAAsB,EAC5B,MAAM,0CAA0C,CAAA;AAKjD,eAAO,MAAM,yBAAyB,GACpC,UAAU,oBAAoB,KAC7B,sBA+BD,CAAA;AAEF,eAAO,MAAM,qBAAqB,wBAAiD,CAAA;AAEnF,eAAO,MAAM,yBAAyB,8CAA0D,CAAA"}
@@ -0,0 +1,26 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Layer from "effect/Layer";
3
+ import * as Stream from "effect/Stream";
4
+ import { ProviderError } from "@llm4ts/core/Errors";
5
+ import { GeminiCliExecutor, buildGeminiArgs, extractGeminiCliResponse, geminiProcessEnv, parseGeminiCliStreamEvent, validateGeminiExitCode } from "@llm4ts/core/providers/GeminiCliProvider";
6
+ import { nodeProcessExecutor } from "./NodeProcessExecutor.js";
7
+ const failure = (message) => ProviderError.make({ message });
8
+ export const makeNodeGeminiCliExecutor = (executor) => ({
9
+ checkGeminiInstalled: executor
10
+ .run(["gemini", "--version"], process.cwd(), {})
11
+ .pipe(Effect.flatMap((result) => result.exitCode === 0
12
+ ? Effect.void
13
+ : Effect.fail(failure(`Gemini CLI is unavailable: ${result.stderr.join("\n")}`)))),
14
+ runGeminiProcess: (prompt, config, context) => Effect.gen(function* () {
15
+ const result = yield* executor.runWithStdin(["gemini", ...buildGeminiArgs(config, context, "json")], context.cwd ?? process.cwd(), geminiProcessEnv(context), prompt);
16
+ yield* validateGeminiExitCode(result.exitCode, result.stderr.join("\n"), context.turnLimit);
17
+ const extracted = extractGeminiCliResponse(result.stdout.join("\n"));
18
+ return extracted.ok ? extracted.value : yield* failure(extracted.error);
19
+ }),
20
+ runGeminiProcessStream: (prompt, config, context) => executor
21
+ .runStreamingWithStdin(["gemini", ...buildGeminiArgs(config, context, "stream-json")], context.cwd ?? process.cwd(), geminiProcessEnv(context), prompt)
22
+ .pipe(Stream.map(parseGeminiCliStreamEvent))
23
+ });
24
+ export const nodeGeminiCliExecutor = makeNodeGeminiCliExecutor(nodeProcessExecutor);
25
+ export const NodeGeminiCliExecutorLive = Layer.succeed(GeminiCliExecutor, nodeGeminiCliExecutor);
26
+ //# sourceMappingURL=NodeGeminiCliExecutor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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AC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,EACvD,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,EAC5B,gBAAgB,CAAC,OAAO,CAAC,EACzB,MAAM,CACP,CAAA;QACD,KAAK,CAAC,CAAC,sBAAsB,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;QAC3F,MAAM,SAAS,GAAG,wBAAwB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QACpE,OAAO,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IACzE,CAAC,CAAC;IACJ,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAClD,QAAQ;SACL,qBAAqB,CACpB,CAAC,QAAQ,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,EAC9D,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,EAC5B,gBAAgB,CAAC,OAAO,CAAC,EACzB,MAAM,CACP;SACA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;CACjD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,yBAAyB,CAAC,mBAAmB,CAAC,CAAA;AAEnF,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,qBAAqB,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import * as Layer from "effect/Layer";
2
+ import { HttpClient, type HttpClientShape } from "@llm4ts/core/HttpClient";
3
+ export declare const nodeHttpClient: HttpClientShape;
4
+ export declare const NodeHttpClientLive: Layer.Layer<HttpClient, never, never>;
5
+ //# sourceMappingURL=NodeHttpClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeHttpClient.d.ts","sourceRoot":"","sources":["../src/NodeHttpClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,EAAE,UAAU,EAAkB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAiM1F,eAAO,MAAM,cAAc,EAAE,eAwB3B,CAAA;AAEF,eAAO,MAAM,kBAAkB,uCAA4C,CAAA"}
@@ -0,0 +1,109 @@
1
+ import * as Duration from "effect/Duration";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Layer from "effect/Layer";
4
+ import * as Stream from "effect/Stream";
5
+ import { HttpClient, makeHttpClient } from "@llm4ts/core/HttpClient";
6
+ import { AuthenticationError, InvalidRequestError, ParseError, ProviderError, RateLimitError, TimeoutError } from "@llm4ts/core/Errors";
7
+ const errorMessage = (error) => error instanceof Error ? error.message : String(error);
8
+ const checkedUrl = (raw) => Effect.try({
9
+ try: () => new URL(raw).toString(),
10
+ catch: (error) => InvalidRequestError.make({
11
+ message: `Invalid URL '${raw}': ${errorMessage(error)}`
12
+ })
13
+ });
14
+ const fetchResponse = (rawUrl, init, timeout) => Effect.flatMap(checkedUrl(rawUrl), (url) => Effect.tryPromise({
15
+ try: (signal) => fetch(url, {
16
+ ...init,
17
+ signal
18
+ }),
19
+ catch: (error) => ProviderError.make({
20
+ message: `Provider unavailable: ${rawUrl}`,
21
+ cause: error
22
+ })
23
+ }).pipe(Effect.timeoutOrElse({
24
+ duration: timeout,
25
+ orElse: () => Effect.fail(TimeoutError.make({
26
+ duration: timeout
27
+ }))
28
+ })));
29
+ const responseText = (response) => Effect.tryPromise({
30
+ try: () => response.text(),
31
+ catch: (error) => ParseError.make({
32
+ message: errorMessage(error),
33
+ raw: ""
34
+ })
35
+ });
36
+ const retryAfter = (response, fallback) => {
37
+ const value = response.headers.get("Retry-After")?.trim();
38
+ return value !== undefined && /^\d+$/.test(value) ? Duration.seconds(Number(value)) : fallback;
39
+ };
40
+ const classifyBodyResponse = (response, url, timeout, accepts) => Effect.flatMap(responseText(response), (body) => {
41
+ const status = response.status;
42
+ if (accepts(status)) {
43
+ return Effect.succeed(body);
44
+ }
45
+ if (status === 401 || status === 403) {
46
+ return Effect.fail(AuthenticationError.make({ message: url }));
47
+ }
48
+ if (status === 429) {
49
+ return Effect.fail(RateLimitError.make({
50
+ retryAfter: retryAfter(response, timeout)
51
+ }));
52
+ }
53
+ if (status >= 400 && status < 500) {
54
+ return Effect.fail(InvalidRequestError.make({
55
+ message: `HTTP ${status}: ${body}`
56
+ }));
57
+ }
58
+ return Effect.fail(ProviderError.make({
59
+ message: `HTTP ${status}: ${body}`
60
+ }));
61
+ });
62
+ const requestHeaders = (headers, contentType) => {
63
+ const result = new Headers(headers);
64
+ if (contentType !== undefined && !result.has("Content-Type")) {
65
+ result.set("Content-Type", contentType);
66
+ }
67
+ return result;
68
+ };
69
+ const requestBody = (method, url, body, headers, contentType, timeout, accepts) => Effect.flatMap(fetchResponse(url, {
70
+ method,
71
+ headers: requestHeaders(headers, contentType),
72
+ ...(body === undefined ? {} : { body })
73
+ }, timeout), (response) => classifyBodyResponse(response, url, timeout, accepts));
74
+ const streamBody = (response, url, timeout) => {
75
+ if (response.status !== 200) {
76
+ return Stream.fromEffect(classifyBodyResponse(response, url, timeout, (status) => status === 200));
77
+ }
78
+ const body = response.body;
79
+ if (body === null) {
80
+ return Stream.fail(ProviderError.make({
81
+ message: `Provider returned no streaming body: ${url}`
82
+ }));
83
+ }
84
+ return Stream.fromReadableStream({
85
+ evaluate: () => body,
86
+ onError: (error) => ProviderError.make({
87
+ message: `Failed to read streaming response from ${url}`,
88
+ cause: error
89
+ })
90
+ }).pipe(Stream.decodeText, Stream.splitLines, Stream.timeoutOrElse({
91
+ duration: timeout,
92
+ orElse: () => Stream.fail(TimeoutError.make({
93
+ duration: timeout
94
+ }))
95
+ }));
96
+ };
97
+ const postJsonStream = (url, body, headers, timeout) => Stream.unwrap(Effect.map(fetchResponse(url, {
98
+ method: "POST",
99
+ headers: requestHeaders(headers, "application/json"),
100
+ body
101
+ }, timeout), (response) => streamBody(response, url, timeout)));
102
+ export const nodeHttpClient = makeHttpClient({
103
+ get: (url, headers, timeout) => requestBody("GET", url, undefined, headers, undefined, timeout, (status) => status === 200),
104
+ postJson: (url, body, headers, timeout) => requestBody("POST", url, body, headers, "application/json", timeout, (status) => status === 200),
105
+ send: (method, url, body, headers, contentType, timeout) => requestBody(method, url, body, headers, contentType, timeout, (status) => status >= 200 && status < 300),
106
+ postJsonStream
107
+ });
108
+ export const NodeHttpClientLive = Layer.succeed(HttpClient)(nodeHttpClient);
109
+ //# sourceMappingURL=NodeHttpClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeHttpClient.js","sourceRoot":"","sources":["../src/NodeHttpClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAwB,MAAM,yBAAyB,CAAA;AAC1F,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,cAAc,EACd,YAAY,EAEb,MAAM,qBAAqB,CAAA;AAE5B,MAAM,YAAY,GAAG,CAAC,KAAc,EAAU,EAAE,CAC9C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAExD,MAAM,UAAU,GAAG,CAAC,GAAW,EAA8C,EAAE,CAC7E,MAAM,CAAC,GAAG,CAAC;IACT,GAAG,EAAE,GAAG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AAE,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CAC7B,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,GAAG,CAAC;IAC7F,QAAQ,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CACxC,WAAW,CACT,MAAM,EACN,GAAG,EACH,IAAI,EACJ,OAAO,EACP,kBAAkB,EAClB,OAAO,EACP,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,GAAG,CAC3B;IACH,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,CACzD,WAAW,CACT,MAAM,EACN,GAAG,EACH,IAAI,EACJ,OAAO,EACP,WAAW,EACX,OAAO,EACP,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,IAAI,GAAG,IAAI,MAAM,GAAG,GAAG,CAC1C;IACH,cAAc;CACf,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import * as Layer from "effect/Layer";
2
+ import { PlainFileStore, type PlainFileStoreShape } from "@llm4ts/flow/Persistence";
3
+ export declare const nodePlainFileStore: PlainFileStoreShape;
4
+ export declare const NodePlainFileStoreLive: Layer.Layer<PlainFileStore, never, never>;
5
+ //# sourceMappingURL=NodePlainFileStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodePlainFileStore.d.ts","sourceRoot":"","sources":["../src/NodePlainFileStore.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAiBnF,eAAO,MAAM,kBAAkB,EAAE,mBAkDhC,CAAA;AAED,eAAO,MAAM,sBAAsB,2CAAoD,CAAA"}
@@ -0,0 +1,64 @@
1
+ import { createHash, randomUUID } from "node:crypto";
2
+ import { appendFile, mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
3
+ import { dirname, join } from "node:path";
4
+ import * as Effect from "effect/Effect";
5
+ import * as Layer from "effect/Layer";
6
+ import { PlainFileStore } from "@llm4ts/flow/Persistence";
7
+ import { PersistenceError } from "@llm4ts/flow/FlowError";
8
+ const message = (error) => (error instanceof Error ? error.message : String(error));
9
+ const persistenceFailure = (operation, path) => (error) => PersistenceError.make({
10
+ message: `failed to ${operation} ${path}: ${message(error)}`,
11
+ cause: error
12
+ });
13
+ const ensureParent = async (path) => {
14
+ await mkdir(dirname(path), { recursive: true });
15
+ };
16
+ export const nodePlainFileStore = {
17
+ read: (path) => Effect.tryPromise({
18
+ try: async () => {
19
+ try {
20
+ return await readFile(path, "utf8");
21
+ }
22
+ catch (error) {
23
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") {
24
+ return undefined;
25
+ }
26
+ throw error;
27
+ }
28
+ },
29
+ catch: persistenceFailure("read", path)
30
+ }),
31
+ writeAtomic: (path, contents) => Effect.tryPromise({
32
+ try: async () => {
33
+ await ensureParent(path);
34
+ const temporary = join(dirname(path), `.${randomUUID()}.llm4ts-tmp`);
35
+ try {
36
+ await writeFile(temporary, contents, "utf8");
37
+ await rename(temporary, path);
38
+ }
39
+ finally {
40
+ await rm(temporary, { force: true });
41
+ }
42
+ },
43
+ catch: persistenceFailure("write", path)
44
+ }),
45
+ append: (path, contents) => Effect.tryPromise({
46
+ try: async () => {
47
+ await ensureParent(path);
48
+ await appendFile(path, contents, "utf8");
49
+ },
50
+ catch: persistenceFailure("append", path)
51
+ }),
52
+ remove: (path) => Effect.tryPromise({
53
+ try: () => rm(path, { force: true }),
54
+ catch: persistenceFailure("remove", path)
55
+ }),
56
+ hashSha256: (path) => Effect.tryPromise({
57
+ try: async () => createHash("sha256")
58
+ .update(await readFile(path))
59
+ .digest("hex"),
60
+ catch: persistenceFailure("hash", path)
61
+ })
62
+ };
63
+ export const NodePlainFileStoreLive = Layer.succeed(PlainFileStore)(nodePlainFileStore);
64
+ //# sourceMappingURL=NodePlainFileStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodePlainFileStore.js","sourceRoot":"","sources":["../src/NodePlainFileStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACrF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,cAAc,EAA4B,MAAM,0BAA0B,CAAA;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAEzD,MAAM,OAAO,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;AAEpG,MAAM,kBAAkB,GACtB,CAAC,SAAiB,EAAE,IAAY,EAAE,EAAE,CACpC,CAAC,KAAc,EAAoB,EAAE,CACnC,gBAAgB,CAAC,IAAI,CAAC;IACpB,OAAO,EAAE,aAAa,SAAS,IAAI,IAAI,KAAK,OAAO,CAAC,KAAK,CAAC,EAAE;IAC5D,KAAK,EAAE,KAAK;CACb,CAAC,CAAA;AAEN,MAAM,YAAY,GAAG,KAAK,EAAE,IAAY,EAAiB,EAAE;IACzD,MAAM,KAAK,CA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AE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CACzB,MAAM,CAAC,UAAU,CAAC;QAChB,GAAG,EAAE,KAAK,IAAI,EAAE;YACd,MAAM,YAAY,CAAC,IAAI,CAAC,CAAA;YACxB,MAAM,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;QAC1C,CAAC;QACD,KAAK,EAAE,kBAAkB,CAAC,QAAQ,EAAE,IAAI,CAAC;KAC1C,CAAC;IACJ,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,MAAM,CAAC,UAAU,CAAC;QAChB,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACpC,KAAK,EAAE,kBAAkB,CAAC,QAAQ,EAAE,IAAI,CAAC;KAC1C,CAAC;IACJ,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CACnB,MAAM,CAAC,UAAU,CAAC;QAChB,GAAG,EAAE,KAAK,IAAI,EAAE,CACd,UAAU,CAAC,QAAQ,CAAC;aACjB,MAAM,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;aAC5B,MAAM,CAAC,KAAK,CAAC;QAClB,KAAK,EAAE,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC;KACxC,CAAC;CACL,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,kBAAkB,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import * as Layer from "effect/Layer";
2
+ import { ProcessExecutor, type ProcessExecutorShape } from "@llm4ts/core/ProcessExecutor";
3
+ export declare const nodeProcessExecutor: ProcessExecutorShape;
4
+ export declare const NodeProcessExecutorLive: Layer.Layer<ProcessExecutor, never, never>;
5
+ //# sourceMappingURL=NodeProcessExecutor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeProcessExecutor.d.ts","sourceRoot":"","sources":["../src/NodeProcessExecutor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC,OAAO,EACL,eAAe,EAIf,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAA;AAqTrC,eAAO,MAAM,mBAAmB,EAAE,oBAMhC,CAAA;AAEF,eAAO,MAAM,uBAAuB,4CAAsD,CAAA"}