@codeworksh/harness 0.0.1-dev.20260824142157

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sanchit Kudari <0xsanchit@gmail.com> & Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # @codeworksh/harness
2
+
3
+ > **Beta:** This package is an early release. Expect breaking changes.
4
+
5
+ `@codeworksh/harness` is an agent harness built with [Effect v4 beta](https://github.com/Effect-TS/effect) and powered by [`@codeworksh/aikit`](https://www.npmjs.com/package/@codeworksh/aikit).
6
+ It leverages Effect's typed services, layers, scopes, streams, and structured errors to agent loops, durable sessions, tool execution, and local or remote sandboxes.
7
+
8
+ The initial public surface is the Effect SDK at `@codeworksh/harness/effect`.
9
+
10
+ ## Features
11
+
12
+ - **Durable Sessions:** create, attach, resume, interrupt, and inspect agent sessions without rebuilding orchestration around every turn.
13
+ - **Streaming Agent Loop:** consume durable session events while the loop coordinates model output, tool calls, and continuations.
14
+ - **Tool Execution:** use the built-in Bash tool or register typed tools with sequential or parallel execution.
15
+ - **Model Flexibility:** select any provider and model available in Aikit's generated catalog, including its supported thinking levels.
16
+ - **Pluggable Sandboxes:** run the same workflow against the host machine, a virtual filesystem, or a remote sandbox.
17
+
18
+ ## Pluggable Sandboxes
19
+
20
+ Harness uses a driver-based sandbox architecture. Drivers share a common lifecycle and I/O surface, keeping provider details out of session and agent-loop code.
21
+
22
+ | Backend | Environment | Good for |
23
+ | -------------- | ------------------------------------------- | ----------------------------------------------------- |
24
+ | Local host | Real filesystem and processes | Working directly in the current machine or repository |
25
+ | In-memory VFS | Ephemeral virtual filesystem | Fast tests and isolated experiments |
26
+ | SQLite VFS | In-memory or file-backed virtual filesystem | Reproducible sandboxes with optional persistence |
27
+ | Vercel Sandbox | Remote sandbox | Isolated cloud execution on Vercel |
28
+ | Daytona | Remote sandbox | Managed development environments on Daytona |
29
+
30
+ The SDK exposes sandbox creation, registration, discovery, refresh, wake, stop, and destroy operations. Built-in drivers can be selected when constructing the Harness layer:
31
+
32
+ ```ts
33
+ import { Effect } from "effect";
34
+ import { Harness, Sandbox, Session } from "@codeworksh/harness/effect";
35
+
36
+ const program = Effect.gen(function* () {
37
+ const sandbox = yield* Sandbox.create({ driver: "memory", cwd: "/workspace" });
38
+ const session = yield* Session.create({ sandbox });
39
+ const info = yield* session.info;
40
+ console.log(`${sandbox.driver}:${info.directory}`);
41
+ });
42
+
43
+ await program.pipe(
44
+ Effect.provide(
45
+ Harness.layer({
46
+ database: ":memory:",
47
+ home: ".codework-readme",
48
+ sandboxes: [Sandbox.Drivers.memory],
49
+ }),
50
+ ),
51
+ Effect.scoped,
52
+ Effect.runPromise,
53
+ );
54
+ ```
55
+
56
+ Vercel and Daytona are the first remote drivers. More providers can be added behind the same lifecycle and I/O contracts without changing session or agent-loop code.
57
+
58
+ ## Requirements
59
+
60
+ - Node.js 24.14.1 or newer
61
+ - An API key for the model provider you select
62
+ - A generated Aikit model catalog; run `codework modelgen` from the project you want to use
63
+
64
+ ## CLI
65
+
66
+ Run the current development release without installing it globally:
67
+
68
+ ```sh
69
+ export OPENAI_API_KEY="..."
70
+
71
+ pnpm dlx @codeworksh/harness@dev modelgen
72
+
73
+ pnpm dlx @codeworksh/harness@dev \
74
+ --home .codework-beta \
75
+ run --cwd "$PWD" --provider openai --model gpt-5.5 --thinking high \
76
+ "Inspect this repository"
77
+ ```
78
+
79
+ `modelgen [path]` uses Aikit's model generator and writes `./models.gen.json` by default. Set `CODEWORK_MODELS_FILE` or pass a path when you keep the catalog elsewhere.
80
+
81
+ The CLI prints the session ID to stderr. Provider, model, and thinking settings are stored with a new session, so use the same home directory and session ID to continue it:
82
+
83
+ ```sh
84
+ pnpm dlx @codeworksh/harness@dev \
85
+ --home .codework-beta \
86
+ run --session <session-id> \
87
+ "Continue with the implementation"
88
+ ```
89
+
90
+ Use `codework --help` or `pnpm dlx @codeworksh/harness@dev --help` for all options.
91
+
92
+ ## Effect SDK
93
+
94
+ ```sh
95
+ pnpm add @codeworksh/harness@dev effect
96
+ ```
97
+
98
+ ```ts
99
+ import { Effect } from "effect";
100
+ import { Harness, Session } from "@codeworksh/harness/effect";
101
+
102
+ const program = Effect.gen(function* () {
103
+ const session = yield* Session.create({
104
+ title: "Review Harness",
105
+ directory: process.cwd(),
106
+ model: { provider: "openai", id: "gpt-5.5" },
107
+ thinkingLevel: "high",
108
+ });
109
+ const info = yield* session.info;
110
+
111
+ console.log(`session ${info.id} in ${info.directory}`);
112
+ });
113
+
114
+ await program.pipe(
115
+ Effect.provide(Harness.layer({ database: ":memory:", home: ".codework-readme" })),
116
+ Effect.scoped,
117
+ Effect.runPromise,
118
+ );
119
+ ```
120
+
121
+ Creating a session does not contact the provider. Call `session.run(prompt)` to execute a turn, and call `session.events()` directly to obtain its Effect `Stream`.
122
+
123
+ The Effect SDK currently includes:
124
+
125
+ - `Harness.layer` for process configuration and service wiring
126
+ - `Session` handles for create, attach, prompt, run, resume, interrupt, events, and history
127
+ - `Sandbox` drivers and lifecycle operations for in-memory, SQLite, Vercel, and Daytona environments
128
+ - Local host execution for sessions without a configured sandbox
129
+ - Effect-native errors, layers, streams, and resource scopes
130
+
131
+ ## Status
132
+
133
+ This release is intended for quick iteration and feedback. It is not yet a stable production API. Please report issues through the [Codework repository](https://github.com/codeworksh/codework/issues).
@@ -0,0 +1,23 @@
1
+ import { $ as SandboxUnavailError, G as SandboxDriverRegistrationError, J as SandboxProviderError, T as SessionNotFoundError, W as SandboxDriverNotRegisteredError, Z as SandboxRemovedError, c as LLMStreamError, f as SandboxDirectoryNotFoundError, g as SnapshotError, l as ModelNotFoundError, n as PromptConflictError, nt as ContextDecodeError, p as TurnError, q as SandboxNotFoundError, rt as ContextEncodeError, tt as FileSystemError, u as ProviderTurnError } from "../control-DyVTL25_.mjs";
2
+ import { Effect, Option, Schema } from "effect";
3
+ import { CliError, Command } from "effect/unstable/cli";
4
+ //#region src/cli/index.d.ts
5
+ declare const InvalidInputError_base: Schema.Class<InvalidInputError, Schema.TaggedStruct<"CLI.InvalidInputError", {
6
+ readonly message: Schema.String;
7
+ }>, import("effect/Cause").YieldableError>;
8
+ declare class InvalidInputError extends InvalidInputError_base {}
9
+ declare const ModelgenError_base: Schema.Class<ModelgenError, Schema.TaggedStruct<"CLI.ModelgenError", {
10
+ readonly cause: Schema.Defect;
11
+ }>, import("effect/Cause").YieldableError>;
12
+ declare class ModelgenError extends ModelgenError_base {}
13
+ declare const command: Command.Command<"codework", {
14
+ readonly home: Option.Option<string>;
15
+ readonly database: Option.Option<string>;
16
+ }, {
17
+ readonly home: Option.Option<string>;
18
+ readonly database: Option.Option<string>;
19
+ }, import("effect/Config").ConfigError | ContextDecodeError | ContextEncodeError | FileSystemError | InvalidInputError | LLMStreamError | ModelNotFoundError | ModelgenError | PromptConflictError | ProviderTurnError | SandboxDirectoryNotFoundError | SandboxDriverNotRegisteredError | SandboxDriverRegistrationError | SandboxNotFoundError | SandboxProviderError | SandboxRemovedError | SandboxUnavailError | SessionNotFoundError | SnapshotError | TurnError, never>;
20
+ declare const main: Effect.Effect<void, Command.Error<typeof command> | CliError.CliError>;
21
+ //#endregion
22
+ export { command, main };
23
+ //# sourceMappingURL=index.d.mts.map
package/cli/index.mjs ADDED
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env node
2
+ import { _ as ID, a as layer, g as posix, n as create, t as attach } from "../session-jgwp2MT6.mjs";
3
+ import { Effect, Fiber, Option, Queue, Schema, Stream } from "effect";
4
+ import { generateModels } from "@codeworksh/aikit/modelgen";
5
+ import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
6
+ import * as NodeServices from "@effect/platform-node/NodeServices";
7
+ import { Argument, Command, Flag } from "effect/unstable/cli";
8
+ //#region src/cli/index.ts
9
+ const thinkingLevels = [
10
+ "off",
11
+ "minimal",
12
+ "low",
13
+ "medium",
14
+ "high",
15
+ "xhigh",
16
+ "max"
17
+ ];
18
+ const writeOut = (value) => Effect.sync(() => void process.stdout.write(value));
19
+ const writeError = (value) => Effect.sync(() => void process.stderr.write(value));
20
+ var InvalidInputError = class extends Schema.TaggedError()("CLI.InvalidInputError", { message: Schema.String }) {};
21
+ var ModelgenError = class extends Schema.TaggedError()("CLI.ModelgenError", { cause: Schema.Defect() }) {};
22
+ const render = (ended) => Effect.fn("CLI.render")(function* (event) {
23
+ if (event.type === "session.llm.text.delta") {
24
+ yield* writeOut(event.data.delta);
25
+ return;
26
+ }
27
+ if (event.type === "session.turn.ended") yield* Queue.offer(ended, event.data.messageId);
28
+ });
29
+ const awaitMessage = Effect.fn("CLI.awaitMessage")(function* (ended, messageId) {
30
+ while ((yield* Queue.take(ended)) !== messageId);
31
+ });
32
+ const root = Command.make("codework").pipe(Command.withSharedFlags({
33
+ home: Flag.string("home").pipe(Flag.withDescription("Harness data directory"), Flag.optional),
34
+ database: Flag.string("database").pipe(Flag.withDescription("SQLite path or :memory:"), Flag.optional)
35
+ }), Command.withDescription("Run Codework agent sessions"));
36
+ const run = Command.make("run", {
37
+ prompt: Argument.string("prompt").pipe(Argument.withDescription("Prompt for the agent")),
38
+ session: Flag.string("session").pipe(Flag.withAlias("s"), Flag.withDescription("Continue an existing session ID"), Flag.optional),
39
+ cwd: Flag.string("cwd").pipe(Flag.withAlias("C"), Flag.withDescription("Working directory for a new local session"), Flag.optional),
40
+ provider: Flag.string("provider").pipe(Flag.withDescription("Model catalog provider ID for a new session"), Flag.optional),
41
+ model: Flag.string("model").pipe(Flag.withDescription("Model ID for a new session"), Flag.optional),
42
+ thinking: Flag.choice("thinking", thinkingLevels).pipe(Flag.withDescription("Thinking level for a new session"), Flag.optional)
43
+ }, Effect.fn("CLI.run")(function* ({ prompt, session, cwd, provider, model, thinking }) {
44
+ const shared = yield* root;
45
+ if (Option.isSome(session) && Option.isSome(cwd)) return yield* new InvalidInputError({ message: "--cwd can only be used when creating a new session" });
46
+ if (Option.isSome(provider) !== Option.isSome(model)) return yield* new InvalidInputError({ message: "--provider and --model must be provided together" });
47
+ if (Option.isSome(session) && (Option.isSome(provider) || Option.isSome(thinking))) return yield* new InvalidInputError({ message: "--provider, --model, and --thinking can only be used when creating a new session" });
48
+ return yield* Effect.gen(function* () {
49
+ const handle = Option.isSome(session) ? yield* attach({ sessionId: ID.make(session.value) }) : yield* create({
50
+ title: "CLI",
51
+ ...Option.isNone(cwd) ? {} : { directory: posix.resolve(cwd.value) },
52
+ ...Option.isNone(provider) || Option.isNone(model) ? {} : { model: {
53
+ provider: provider.value,
54
+ id: model.value
55
+ } },
56
+ ...Option.isNone(thinking) ? {} : { thinkingLevel: thinking.value }
57
+ });
58
+ const ended = yield* Queue.unbounded();
59
+ const printer = yield* handle.events().pipe(Stream.runForEach(render(ended)), Effect.forkScoped({ startImmediately: true }));
60
+ yield* writeError(`session ${handle.id}\n`);
61
+ yield* handle.run(prompt);
62
+ const leaf = (yield* handle.path()).at(-1);
63
+ if (leaf !== void 0) yield* awaitMessage(ended, leaf.entry.id);
64
+ yield* Fiber.interrupt(printer);
65
+ yield* writeOut("\n");
66
+ }).pipe(Effect.provide(layer({
67
+ ...Option.isNone(shared.home) ? {} : { home: shared.home.value },
68
+ ...Option.isNone(shared.database) ? {} : { database: shared.database.value }
69
+ })), Effect.scoped);
70
+ })).pipe(Command.withDescription("Start or continue a local agent session"), Command.withExamples([
71
+ {
72
+ command: "codework run \"Inspect the failing tests\"",
73
+ description: "Create a session"
74
+ },
75
+ {
76
+ command: "codework run --provider openai --model gpt-5.5 --thinking high \"Inspect the failing tests\"",
77
+ description: "Create a session with an explicit model"
78
+ },
79
+ {
80
+ command: "codework run --session <id> \"Now fix them\"",
81
+ description: "Continue a session"
82
+ }
83
+ ]));
84
+ const modelgen = Command.make("modelgen", { path: Argument.string("path").pipe(Argument.withDescription("Output path; defaults to CODEWORK_MODELS_FILE or ./models.gen.json"), Argument.optional) }, Effect.fn("CLI.modelgen")(function* ({ path }) {
85
+ const generated = yield* Effect.tryPromise({
86
+ try: () => generateModels(Option.isNone(path) ? {} : { path: path.value }),
87
+ catch: (cause) => new ModelgenError({ cause })
88
+ });
89
+ yield* writeOut(`Generated model catalog at ${generated}\n`);
90
+ })).pipe(Command.withDescription("Generate the Aikit model catalog"), Command.withExamples([{
91
+ command: "codework modelgen",
92
+ description: "Generate models.gen.json"
93
+ }]));
94
+ const command = root.pipe(Command.withSubcommands([run, modelgen]));
95
+ const main = Command.run(command, { version: "0.0.1" }).pipe(Effect.provide(NodeServices.layer));
96
+ NodeRuntime.runMain(main);
97
+ //#endregion
98
+ export { command, main };
99
+
100
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["Session.attach","Session.create","Harness.layer"],"sources":["../../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { generateModels } from \"@codeworksh/aikit/modelgen\";\nimport * as NodeRuntime from \"@effect/platform-node/NodeRuntime\";\nimport * as NodeServices from \"@effect/platform-node/NodeServices\";\nimport { Effect, Fiber, Option, Queue, Schema, Stream } from \"effect\";\nimport { Argument, CliError, Command, Flag } from \"effect/unstable/cli\";\nimport { Harness } from \"../effect/harness.ts\";\nimport { Session } from \"../effect/session.ts\";\nimport type { EventSchema } from \"../event/schema.ts\";\nimport { posix } from \"../posix.ts\";\n\nconst thinkingLevels = [\"off\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] as const;\n\nconst writeOut = (value: string) => Effect.sync(() => void process.stdout.write(value));\nconst writeError = (value: string) => Effect.sync(() => void process.stderr.write(value));\n\nclass InvalidInputError extends Schema.TaggedError<InvalidInputError>()(\"CLI.InvalidInputError\", {\n\tmessage: Schema.String,\n}) {}\n\nclass ModelgenError extends Schema.TaggedError<ModelgenError>()(\"CLI.ModelgenError\", {\n\tcause: Schema.Defect(),\n}) {}\n\nconst render = (ended: Queue.Queue<string>) =>\n\tEffect.fn(\"CLI.render\")(function* (event: EventSchema.Payload) {\n\t\tif (event.type === \"session.llm.text.delta\") {\n\t\t\tyield* writeOut((event.data as { readonly delta: string }).delta);\n\t\t\treturn;\n\t\t}\n\t\tif (event.type === \"session.turn.ended\") {\n\t\t\tyield* Queue.offer(ended, (event.data as { readonly messageId: string }).messageId);\n\t\t}\n\t});\n\nconst awaitMessage = Effect.fn(\"CLI.awaitMessage\")(function* (ended: Queue.Queue<string>, messageId: string) {\n\twhile ((yield* Queue.take(ended)) !== messageId) {\n\t\t// Earlier turns in the same drain are expected when a tool call continues.\n\t}\n});\n\nconst root = Command.make(\"codework\").pipe(\n\tCommand.withSharedFlags({\n\t\thome: Flag.string(\"home\").pipe(Flag.withDescription(\"Harness data directory\"), Flag.optional),\n\t\tdatabase: Flag.string(\"database\").pipe(Flag.withDescription(\"SQLite path or :memory:\"), Flag.optional),\n\t}),\n\tCommand.withDescription(\"Run Codework agent sessions\"),\n);\n\nconst run = Command.make(\n\t\"run\",\n\t{\n\t\tprompt: Argument.string(\"prompt\").pipe(Argument.withDescription(\"Prompt for the agent\")),\n\t\tsession: Flag.string(\"session\").pipe(\n\t\t\tFlag.withAlias(\"s\"),\n\t\t\tFlag.withDescription(\"Continue an existing session ID\"),\n\t\t\tFlag.optional,\n\t\t),\n\t\tcwd: Flag.string(\"cwd\").pipe(\n\t\t\tFlag.withAlias(\"C\"),\n\t\t\tFlag.withDescription(\"Working directory for a new local session\"),\n\t\t\tFlag.optional,\n\t\t),\n\t\tprovider: Flag.string(\"provider\").pipe(\n\t\t\tFlag.withDescription(\"Model catalog provider ID for a new session\"),\n\t\t\tFlag.optional,\n\t\t),\n\t\tmodel: Flag.string(\"model\").pipe(Flag.withDescription(\"Model ID for a new session\"), Flag.optional),\n\t\tthinking: Flag.choice(\"thinking\", thinkingLevels).pipe(\n\t\t\tFlag.withDescription(\"Thinking level for a new session\"),\n\t\t\tFlag.optional,\n\t\t),\n\t},\n\tEffect.fn(\"CLI.run\")(function* ({ prompt, session, cwd, provider, model, thinking }) {\n\t\tconst shared = yield* root;\n\t\tif (Option.isSome(session) && Option.isSome(cwd)) {\n\t\t\treturn yield* new InvalidInputError({ message: \"--cwd can only be used when creating a new session\" });\n\t\t}\n\t\tif (Option.isSome(provider) !== Option.isSome(model)) {\n\t\t\treturn yield* new InvalidInputError({ message: \"--provider and --model must be provided together\" });\n\t\t}\n\t\tif (Option.isSome(session) && (Option.isSome(provider) || Option.isSome(thinking))) {\n\t\t\treturn yield* new InvalidInputError({\n\t\t\t\tmessage: \"--provider, --model, and --thinking can only be used when creating a new session\",\n\t\t\t});\n\t\t}\n\t\tconst program = Effect.gen(function* () {\n\t\t\tconst handle = Option.isSome(session)\n\t\t\t\t? yield* Session.attach({ sessionId: Session.SessionSchema.ID.make(session.value) })\n\t\t\t\t: yield* Session.create({\n\t\t\t\t\t\ttitle: \"CLI\",\n\t\t\t\t\t\t...(Option.isNone(cwd) ? {} : { directory: posix.resolve(cwd.value) }),\n\t\t\t\t\t\t...(Option.isNone(provider) || Option.isNone(model)\n\t\t\t\t\t\t\t? {}\n\t\t\t\t\t\t\t: { model: { provider: provider.value, id: model.value } }),\n\t\t\t\t\t\t...(Option.isNone(thinking) ? {} : { thinkingLevel: thinking.value }),\n\t\t\t\t\t});\n\t\t\tconst ended = yield* Queue.unbounded<string>();\n\t\t\tconst printer = yield* handle\n\t\t\t\t.events()\n\t\t\t\t.pipe(Stream.runForEach(render(ended)), Effect.forkScoped({ startImmediately: true }));\n\n\t\t\tyield* writeError(`session ${handle.id}\\n`);\n\t\t\tyield* handle.run(prompt);\n\t\t\tconst path = yield* handle.path();\n\t\t\tconst leaf = path.at(-1);\n\t\t\tif (leaf !== undefined) yield* awaitMessage(ended, leaf.entry.id);\n\t\t\tyield* Fiber.interrupt(printer);\n\t\t\tyield* writeOut(\"\\n\");\n\t\t});\n\n\t\treturn yield* program.pipe(\n\t\t\tEffect.provide(\n\t\t\t\tHarness.layer({\n\t\t\t\t\t...(Option.isNone(shared.home) ? {} : { home: shared.home.value }),\n\t\t\t\t\t...(Option.isNone(shared.database) ? {} : { database: shared.database.value }),\n\t\t\t\t}),\n\t\t\t),\n\t\t\tEffect.scoped,\n\t\t);\n\t}),\n).pipe(\n\tCommand.withDescription(\"Start or continue a local agent session\"),\n\tCommand.withExamples([\n\t\t{ command: 'codework run \"Inspect the failing tests\"', description: \"Create a session\" },\n\t\t{\n\t\t\tcommand: 'codework run --provider openai --model gpt-5.5 --thinking high \"Inspect the failing tests\"',\n\t\t\tdescription: \"Create a session with an explicit model\",\n\t\t},\n\t\t{ command: 'codework run --session <id> \"Now fix them\"', description: \"Continue a session\" },\n\t]),\n);\n\nconst modelgen = Command.make(\n\t\"modelgen\",\n\t{\n\t\tpath: Argument.string(\"path\").pipe(\n\t\t\tArgument.withDescription(\"Output path; defaults to CODEWORK_MODELS_FILE or ./models.gen.json\"),\n\t\t\tArgument.optional,\n\t\t),\n\t},\n\tEffect.fn(\"CLI.modelgen\")(function* ({ path }) {\n\t\tconst generated = yield* Effect.tryPromise({\n\t\t\ttry: () => generateModels(Option.isNone(path) ? {} : { path: path.value }),\n\t\t\tcatch: (cause) => new ModelgenError({ cause }),\n\t\t});\n\t\tyield* writeOut(`Generated model catalog at ${generated}\\n`);\n\t}),\n).pipe(\n\tCommand.withDescription(\"Generate the Aikit model catalog\"),\n\tCommand.withExamples([{ command: \"codework modelgen\", description: \"Generate models.gen.json\" }]),\n);\n\nexport const command = root.pipe(Command.withSubcommands([run, modelgen]));\n\nexport const main: Effect.Effect<void, Command.Error<typeof command> | CliError.CliError> = Command.run(command, {\n\tversion: \"0.0.1\",\n}).pipe(Effect.provide(NodeServices.layer));\n\nNodeRuntime.runMain(main);\n"],"mappings":";;;;;;;;AAYA,MAAM,iBAAiB;CAAC;CAAO;CAAW;CAAO;CAAU;CAAQ;CAAS;AAAK;AAEjF,MAAM,YAAY,UAAkB,OAAO,WAAW,KAAK,QAAQ,OAAO,MAAM,KAAK,CAAC;AACtF,MAAM,cAAc,UAAkB,OAAO,WAAW,KAAK,QAAQ,OAAO,MAAM,KAAK,CAAC;AAExF,IAAM,oBAAN,cAAgC,OAAO,YAA+B,CAAC,CAAC,yBAAyB,EAChG,SAAS,OAAO,OACjB,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAM,gBAAN,cAA4B,OAAO,YAA2B,CAAC,CAAC,qBAAqB,EACpF,OAAO,OAAO,OAAO,EACtB,CAAC,CAAC,CAAC,CAAC;AAEJ,MAAM,UAAU,UACf,OAAO,GAAG,YAAY,CAAC,CAAC,WAAW,OAA4B;CAC9D,IAAI,MAAM,SAAS,0BAA0B;EAC5C,OAAO,SAAU,MAAM,KAAoC,KAAK;EAChE;CACD;CACA,IAAI,MAAM,SAAS,sBAClB,OAAO,MAAM,MAAM,OAAQ,MAAM,KAAwC,SAAS;AAEpF,CAAC;AAEF,MAAM,eAAe,OAAO,GAAG,kBAAkB,CAAC,CAAC,WAAW,OAA4B,WAAmB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