workplane 0.3.0 → 0.4.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.
- package/README.md +148 -61
- package/dist/cli.js +5 -2
- package/dist/cli.js.map +1 -1
- package/dist/migrate.js +260 -41
- package/dist/migrate.js.map +1 -1
- package/dist/migrations/pg/0000_majestic_norman_osborn.sql +75 -0
- package/dist/migrations/pg/meta/0000_snapshot.json +583 -0
- package/dist/migrations/pg/meta/_journal.json +13 -0
- package/dist/migrations/sqlite/0000_dry_zarek.sql +75 -0
- package/dist/migrations/sqlite/meta/0000_snapshot.json +535 -0
- package/dist/migrations/sqlite/meta/_journal.json +13 -0
- package/dist/node.js +20 -17
- package/dist/node.js.map +1 -1
- package/dist/schema.sqlite.sql +74 -0
- package/dist/server.js +743 -335
- package/dist/server.js.map +1 -1
- package/dist/setup.js +410 -0
- package/dist/setup.js.map +1 -0
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://mindstaq.github.io/workplane/)
|
|
4
4
|
[](https://www.npmjs.com/package/workplane)
|
|
5
|
-
[](https://github.com/MindStaq/workplane)
|
|
6
6
|
[](https://github.com/MindStaq/workplane/blob/main/packages/workplane/LICENSE)
|
|
7
7
|
|
|
8
|
-
> **
|
|
8
|
+
> **Alpha software.** APIs and data models are unstable and will change between releases. Not recommended for production use.
|
|
9
9
|
|
|
10
|
-
Route durable work
|
|
10
|
+
Route durable work to capable nodes on your private network. Compose multi-step AI workplans that mix local Ollama with frontier APIs. Supports shell commands, local inference, and AI coding agents (Codex, Claude Code, Aider) — both **batch** (one-shot) and **interactive** (multi-turn PTY/stdin sessions mediated through the control plane with no direct client-to-node connection).
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
**Requires Node.js 20+** and **Postgres**.
|
|
12
|
+
**Requires Node.js 20+.**
|
|
15
13
|
|
|
16
14
|
## Install
|
|
17
15
|
|
|
@@ -19,117 +17,206 @@ Workplane is a control plane + polling node runtime backed by Postgres and [DBOS
|
|
|
19
17
|
npm install -g workplane
|
|
20
18
|
```
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
|
25
|
-
|
|
26
|
-
| `workplane` | CLI — submit and inspect tasks |
|
|
20
|
+
| Binary | Purpose |
|
|
21
|
+
|--------|---------|
|
|
22
|
+
| `workplane-setup` | First-run wizard — configure and migrate in one step |
|
|
23
|
+
| `workplane` | CLI — skills, workplans, fleet task submit/inspect |
|
|
27
24
|
| `workplane-server` | Control plane API |
|
|
28
25
|
| `workplane-node` | Worker that polls and executes tasks |
|
|
29
|
-
| `workplane-db-migrate` | Apply
|
|
26
|
+
| `workplane-db-migrate` | Apply schema (called automatically by `workplane-setup`) |
|
|
30
27
|
|
|
31
|
-
## Quick start (
|
|
28
|
+
## Quick start — skills (no server needed)
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
**2. Environment** — create a `.env` file or export:
|
|
30
|
+
Run built-in AI skills directly on your machine. No server, no database, no configuration required.
|
|
36
31
|
|
|
37
32
|
```bash
|
|
38
|
-
export
|
|
39
|
-
export
|
|
33
|
+
export ANTHROPIC_API_KEY=... # for frontier model steps
|
|
34
|
+
export OLLAMA_HOST=http://localhost:11434 # optional; shown is the default
|
|
40
35
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
workplane skill list
|
|
37
|
+
workplane skill run summarize-file --file ./README.md
|
|
38
|
+
workplane skill run code-review --repo . --model claude-haiku-4-5-20251001
|
|
44
39
|
```
|
|
45
40
|
|
|
46
|
-
|
|
41
|
+
## Quick start — fleet (single machine)
|
|
47
42
|
|
|
48
43
|
```bash
|
|
49
|
-
|
|
44
|
+
# 1. Run setup — interactive wizard, press Enter to accept smart defaults
|
|
45
|
+
workplane-setup
|
|
46
|
+
|
|
47
|
+
# 2. Start the control plane and a worker (two terminals)
|
|
50
48
|
workplane-server
|
|
51
49
|
workplane-node
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
**4. Submit a task** (fourth terminal):
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
export WORKPLANE_OPERATOR_TOKEN=your-operator-secret # if auth enabled on server
|
|
58
50
|
|
|
51
|
+
# 3. Submit work (third terminal)
|
|
59
52
|
workplane task submit shell --command "echo hello"
|
|
60
53
|
workplane tasks
|
|
61
|
-
workplane runs
|
|
62
54
|
workplane logs <runId>
|
|
63
55
|
```
|
|
64
56
|
|
|
57
|
+
`workplane-setup` configures tokens, picks a database, and runs migrations. The default database is SQLite at `~/.workplane/workplane.db` — no Postgres required for a single-machine fleet. Run `workplane-setup` again at any time to reconfigure.
|
|
58
|
+
|
|
59
|
+
### Switching to Postgres
|
|
60
|
+
|
|
61
|
+
Re-run setup and enter a Postgres URL when prompted:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
workplane-setup
|
|
65
|
+
# DATABASE_URL [sqlite://~/.workplane/workplane.db]: postgres://user:pass@host:5432/workplane
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Postgres is recommended when running multiple server instances or when you need managed backups.
|
|
69
|
+
|
|
65
70
|
## Authentication
|
|
66
71
|
|
|
67
|
-
|
|
72
|
+
`workplane-setup` generates tokens automatically. To set them manually:
|
|
68
73
|
|
|
69
74
|
| Variable | Used by |
|
|
70
75
|
|----------|---------|
|
|
71
|
-
| `WORKPLANE_NODE_TOKEN` | `workplane-node` |
|
|
72
|
-
| `WORKPLANE_OPERATOR_TOKEN` | `workplane` CLI
|
|
76
|
+
| `WORKPLANE_NODE_TOKEN` | `workplane-node` (must match the server's value) |
|
|
77
|
+
| `WORKPLANE_OPERATOR_TOKEN` | `workplane` CLI — task submit, retry, cancel |
|
|
73
78
|
|
|
74
|
-
Read-only
|
|
79
|
+
Read-only commands (`tasks`, `logs`, `runs`, …) work without the operator token.
|
|
75
80
|
|
|
76
|
-
## CLI
|
|
81
|
+
## CLI reference
|
|
77
82
|
|
|
78
83
|
```bash
|
|
79
|
-
#
|
|
84
|
+
export WORKPLANE_OPERATOR_TOKEN=... # set once; stored in ~/.workplane/.env by setup
|
|
85
|
+
|
|
86
|
+
# Shell task
|
|
80
87
|
workplane task submit shell --command "npm test" \
|
|
81
|
-
--repo https://github.com/you/
|
|
88
|
+
--repo https://github.com/you/repo.git --requires shell,git
|
|
82
89
|
|
|
83
90
|
# Local inference (node must advertise ollama capability)
|
|
84
|
-
workplane task submit inference --model llama3.2 --prompt "
|
|
91
|
+
workplane task submit inference --model llama3.2 --prompt "Summarise this"
|
|
85
92
|
|
|
86
|
-
#
|
|
87
|
-
workplane task submit harness --harness
|
|
93
|
+
# Batch agent (one-shot)
|
|
94
|
+
workplane task submit harness --harness claude-code \
|
|
88
95
|
--repo git@github.com:you/app.git \
|
|
89
|
-
--prompt "
|
|
96
|
+
--prompt "Refactor auth middleware" --requires claude-code,git
|
|
90
97
|
|
|
91
|
-
|
|
98
|
+
# Interactive agent (multi-turn PTY/stdin session)
|
|
99
|
+
workplane task submit harness --harness claude-code \
|
|
92
100
|
--repo git@github.com:you/app.git \
|
|
93
|
-
--prompt "
|
|
94
|
-
--
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
workplane
|
|
101
|
+
--prompt "Start exploring the codebase" \
|
|
102
|
+
--interactive --requires claude-code,git
|
|
103
|
+
|
|
104
|
+
# Send input to a running interactive session
|
|
105
|
+
workplane run input <runId> --stdin "Focus on the auth module"
|
|
106
|
+
workplane run input <runId> --signal SIGINT
|
|
107
|
+
workplane run input <runId> --resize 220x50
|
|
108
|
+
|
|
109
|
+
# Skills
|
|
110
|
+
workplane skill list
|
|
111
|
+
workplane skill run code-review --repo . --model claude-haiku-4-5-20251001
|
|
112
|
+
|
|
113
|
+
# Inspect
|
|
114
|
+
workplane tasks [--status running]
|
|
115
|
+
workplane runs --task-id <taskId>
|
|
116
|
+
workplane run show <runId>
|
|
117
|
+
workplane logs <runId>
|
|
98
118
|
workplane artifacts <runId>
|
|
119
|
+
workplane task cancel <taskId>
|
|
120
|
+
workplane task retry <taskId>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Workplans
|
|
124
|
+
|
|
125
|
+
Compose multi-step AI pipelines with the `@workplane/workplans` DSL:
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
import { SequentialWorkplanRunner, LocalWorkplanContext } from "@workplane/workplans";
|
|
129
|
+
|
|
130
|
+
const plan = {
|
|
131
|
+
id: "review", name: "Code Review",
|
|
132
|
+
steps: [
|
|
133
|
+
{
|
|
134
|
+
id: "diff", adapter: "shell", provider: "shell",
|
|
135
|
+
payload: { command: "git diff HEAD~1", cwd: "./my-repo" },
|
|
136
|
+
output: { dest: "next" },
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: "summarize", adapter: "ollama", provider: "ollama", model: "llama3",
|
|
140
|
+
payload: { prompt: "Summarize these changes:\n{{prevOutput}}" },
|
|
141
|
+
output: { dest: "next" },
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
id: "critique", adapter: "anthropic", provider: "anthropic",
|
|
145
|
+
model: "claude-haiku-4-5-20251001",
|
|
146
|
+
payload: { prompt: "Review for correctness and security:\n{{prevOutput}}" },
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
await new SequentialWorkplanRunner().run(plan, new LocalWorkplanContext());
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Inline providers (`anthropic`, `openai`, `ollama`, `shell`, `file`) run without dispatching to a fleet node.
|
|
155
|
+
|
|
156
|
+
## Agent skills
|
|
157
|
+
|
|
158
|
+
Pre-built workplans via `@workplane/agent-skills`:
|
|
159
|
+
|
|
160
|
+
```ts
|
|
161
|
+
import { createDefaultRegistry } from "@workplane/agent-skills";
|
|
162
|
+
import { SequentialWorkplanRunner, LocalWorkplanContext } from "@workplane/workplans";
|
|
163
|
+
|
|
164
|
+
const skill = createDefaultRegistry().get("code-review");
|
|
165
|
+
const plan = skill.buildPlan({ repo: ".", model: "claude-haiku-4-5-20251001" });
|
|
166
|
+
await new SequentialWorkplanRunner().run(plan, new LocalWorkplanContext());
|
|
99
167
|
```
|
|
100
168
|
|
|
169
|
+
Or via CLI: `workplane skill run code-review --repo . --model claude-haiku-4-5-20251001`
|
|
170
|
+
|
|
101
171
|
## Node capabilities
|
|
102
172
|
|
|
103
|
-
|
|
173
|
+
Nodes advertise what they can run. Tasks declare what they need.
|
|
104
174
|
|
|
105
175
|
```bash
|
|
106
176
|
export WORKPLANE_NODE_CAPABILITIES=shell,git,ollama,aider,codex,claude-code
|
|
107
177
|
workplane-node
|
|
108
178
|
```
|
|
109
179
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
|
113
|
-
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
| Codex | `git`, `codex` |
|
|
118
|
-
| Claude Code | `git`, `claude-code` |
|
|
180
|
+
| Adapter | Capability tags | Modes |
|
|
181
|
+
|---------|----------------|-------|
|
|
182
|
+
| Shell | `shell` | batch |
|
|
183
|
+
| Ollama | `ollama` | batch |
|
|
184
|
+
| Aider | `aider`, `git` | batch |
|
|
185
|
+
| Codex | `codex`, `git` | batch, interactive (stdio) |
|
|
186
|
+
| Claude Code | `claude-code`, `git` | batch, interactive (PTY) |
|
|
119
187
|
|
|
120
188
|
Override harness binaries: `WORKPLANE_CODEX_BIN`, `WORKPLANE_CLAUDE_CODE_BIN`.
|
|
121
189
|
|
|
122
190
|
## Personal fleet (home + office)
|
|
123
191
|
|
|
124
|
-
Run the control plane on an always-on host (VPS, NAS, or home server). Run nodes on each machine where tools or GPUs live.
|
|
192
|
+
Run the control plane on an always-on host (VPS, NAS, or home server). Run nodes on each machine where tools or GPUs live. Nodes poll outbound — no inbound ports required on workers. Use Tailscale, WireGuard, or a trusted LAN.
|
|
125
193
|
|
|
126
|
-
|
|
194
|
+
On each machine, run `workplane-setup` and set `WORKPLANE_SERVER_URL` to the control plane's reachable address.
|
|
127
195
|
|
|
128
|
-
Full deployment guide: [
|
|
196
|
+
Full deployment guide: [docs/deployment/FLEET.md](https://github.com/MindStaq/workplane/blob/main/docs/deployment/FLEET.md)
|
|
197
|
+
|
|
198
|
+
## Library packages
|
|
199
|
+
|
|
200
|
+
All packages are published under `@workplane/` and can be imported independently:
|
|
201
|
+
|
|
202
|
+
| Package | Purpose |
|
|
203
|
+
|---------|---------|
|
|
204
|
+
| `@workplane/workplans` | Workplan DSL, sequential runner, inline providers |
|
|
205
|
+
| `@workplane/agent-skills` | Pre-built skills, SkillRegistry, CanonicalSkillWorkflow |
|
|
206
|
+
| `@workplane/adapter-sdk` | Build custom adapters — WorkAdapter, WorkContext, cancellable exec |
|
|
207
|
+
| `@workplane/types` | Shared TypeScript types |
|
|
208
|
+
| `@workplane/core` | Config, HTTP client, auth, git utilities |
|
|
209
|
+
| `@workplane/adapter-shell` | Shell command adapter |
|
|
210
|
+
| `@workplane/adapter-ollama` | Ollama inference adapter |
|
|
211
|
+
| `@workplane/adapter-aider` | Aider coding agent adapter |
|
|
212
|
+
| `@workplane/adapter-harness` | Base harness adapter |
|
|
213
|
+
| `@workplane/adapter-claude-code` | Claude Code adapter (PTY interactive) |
|
|
214
|
+
| `@workplane/adapter-codex` | Codex adapter (stdio interactive) |
|
|
215
|
+
| `@workplane/dbos` | Optional DBOS durability layer (step checkpointing + replay) |
|
|
129
216
|
|
|
130
217
|
## Documentation
|
|
131
218
|
|
|
132
|
-
- [v0.
|
|
219
|
+
- [v0.3.0 specification](https://github.com/MindStaq/workplane/blob/main/docs/specs/v0.3.0/WORKPLANE_SPEC.md)
|
|
133
220
|
- [Source repository](https://github.com/MindStaq/workplane)
|
|
134
221
|
- [Issues](https://github.com/MindStaq/workplane/issues)
|
|
135
222
|
|
package/dist/cli.js
CHANGED
|
@@ -108,13 +108,16 @@ var init_file = __esm({
|
|
|
108
108
|
|
|
109
109
|
// ../core/src/env.ts
|
|
110
110
|
import { config as dotenvConfig } from "dotenv";
|
|
111
|
+
import { homedir } from "os";
|
|
112
|
+
import { join } from "path";
|
|
111
113
|
var envLoaded = false;
|
|
112
114
|
function loadLocalEnv() {
|
|
113
115
|
if (envLoaded) {
|
|
114
116
|
return;
|
|
115
117
|
}
|
|
118
|
+
dotenvConfig({ path: ".env.local" });
|
|
119
|
+
dotenvConfig({ path: join(homedir(), ".workplane", ".env") });
|
|
116
120
|
dotenvConfig({ path: ".env" });
|
|
117
|
-
dotenvConfig({ path: ".env.local", override: true });
|
|
118
121
|
envLoaded = true;
|
|
119
122
|
}
|
|
120
123
|
|
|
@@ -122,7 +125,7 @@ function loadLocalEnv() {
|
|
|
122
125
|
import { z } from "zod";
|
|
123
126
|
loadLocalEnv();
|
|
124
127
|
var serverEnvSchema = z.object({
|
|
125
|
-
DATABASE_URL: z.string().
|
|
128
|
+
DATABASE_URL: z.string().optional().default("sqlite://~/.workplane/workplane.db"),
|
|
126
129
|
WORKPLANE_SERVER_PORT: z.string().optional().default("8787").transform((value) => Number.parseInt(value, 10)),
|
|
127
130
|
WORKPLANE_NODE_TOKEN: z.string().optional(),
|
|
128
131
|
WORKPLANE_OPERATOR_TOKEN: z.string().optional(),
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../workplans/src/providers/anthropic.ts","../../workplans/src/providers/openai.ts","../../workplans/src/providers/ollama.ts","../../workplans/src/providers/shell.ts","../../workplans/src/providers/file.ts","../../core/src/env.ts","../../core/src/config.ts","../../core/src/auth.ts","../../core/src/http-client.ts","../../agent-skills/src/skills/code-review.ts","../../agent-skills/src/skills/summarize-file.ts","../../agent-skills/src/skills/index.ts","../../workplans/src/template.ts","../../workplans/src/runner.ts","../../workplans/src/sinks/stdout.ts","../../workplans/src/context.ts","../../cli/src/index.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\n\nexport interface AnthropicStepOptions {\n model: string;\n prompt: string;\n apiKey?: string;\n}\n\nexport async function runAnthropicStep(opts: AnthropicStepOptions): Promise<string> {\n const client = new Anthropic({ apiKey: opts.apiKey ?? process.env.ANTHROPIC_API_KEY });\n const message = await client.messages.create({\n model: opts.model,\n max_tokens: 4096,\n messages: [{ role: \"user\", content: opts.prompt }],\n });\n const block = message.content[0];\n return block.type === \"text\" ? block.text : \"\";\n}\n","import OpenAI from \"openai\";\n\nexport interface OpenAIStepOptions {\n model: string;\n prompt: string;\n apiKey?: string;\n}\n\nexport async function runOpenAIStep(opts: OpenAIStepOptions): Promise<string> {\n const client = new OpenAI({ apiKey: opts.apiKey ?? process.env.OPENAI_API_KEY });\n const completion = await client.chat.completions.create({\n model: opts.model,\n messages: [{ role: \"user\", content: opts.prompt }],\n });\n return completion.choices[0]?.message.content ?? \"\";\n}\n","import { Ollama } from \"ollama\";\n\nexport interface OllamaStepOptions {\n model: string;\n prompt: string;\n host?: string;\n}\n\nexport async function runOllamaStep(opts: OllamaStepOptions): Promise<string> {\n const host = opts.host ?? process.env.OLLAMA_HOST ?? \"http://localhost:11434\";\n const client = new Ollama({ host });\n const response = await client.generate({ model: opts.model, prompt: opts.prompt });\n return response.response;\n}\n","import { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\nconst execAsync = promisify(exec);\n\nexport interface ShellStepOptions {\n command: string;\n cwd?: string;\n}\n\nexport async function runShellStep(opts: ShellStepOptions): Promise<string> {\n const { stdout } = await execAsync(opts.command, {\n cwd: opts.cwd,\n maxBuffer: 10 * 1024 * 1024,\n });\n return stdout;\n}\n","import { readFile } from \"node:fs/promises\";\n\nexport interface FileStepOptions {\n path: string;\n encoding?: BufferEncoding;\n}\n\nexport async function runFileStep(opts: FileStepOptions): Promise<string> {\n return readFile(opts.path, opts.encoding ?? \"utf8\");\n}\n","import { config as dotenvConfig } from \"dotenv\";\n\nlet envLoaded = false;\n\nexport function loadLocalEnv(): void {\n if (envLoaded) {\n return;\n }\n\n dotenvConfig({ path: \".env\" });\n dotenvConfig({ path: \".env.local\", override: true });\n\n envLoaded = true;\n}\n\n","import { z } from \"zod\";\nimport { loadLocalEnv } from \"./env.js\";\n\nloadLocalEnv();\n\nconst serverEnvSchema = z.object({\n DATABASE_URL: z.string().min(1),\n WORKPLANE_SERVER_PORT: z\n .string()\n .optional()\n .default(\"8787\")\n .transform((value) => Number.parseInt(value, 10)),\n WORKPLANE_NODE_TOKEN: z.string().optional(),\n WORKPLANE_OPERATOR_TOKEN: z.string().optional(),\n WORKPLANE_ENV_ALLOWLIST: z.string().optional(),\n});\n\nconst nodeEnvSchema = z.object({\n WORKPLANE_SERVER_URL: z.string().url().optional().default(\"http://localhost:8787\"),\n WORKPLANE_NODE_NAME: z.string().optional().default(\"local-node-1\"),\n WORKPLANE_NODE_ID: z.string().optional(),\n WORKPLANE_NODE_CAPABILITIES: z\n .string()\n .optional()\n .default(\"shell,git,node,typescript,aider,ollama,codex,claude-code\"),\n WORKPLANE_NODE_TOKEN: z.string().optional(),\n WORKPLANE_POLL_INTERVAL_MS: z\n .string()\n .optional()\n .default(\"3000\")\n .transform((value) => Number.parseInt(value, 10)),\n WORKPLANE_ENV_ALLOWLIST: z.string().optional(),\n});\n\nexport interface ServerConfig {\n databaseUrl: string;\n port: number;\n nodeToken?: string;\n operatorToken?: string;\n envAllowlist: string[];\n}\n\nexport interface NodeConfig {\n serverUrl: string;\n nodeName: string;\n nodeId?: string;\n nodeCapabilities: string[];\n nodeToken?: string;\n pollIntervalMs: number;\n envAllowlist: string[];\n}\n\nexport function loadServerConfig(env: NodeJS.ProcessEnv = process.env): ServerConfig {\n const parsed = serverEnvSchema.parse(env);\n\n return {\n databaseUrl: parsed.DATABASE_URL,\n port: parsed.WORKPLANE_SERVER_PORT,\n nodeToken: parsed.WORKPLANE_NODE_TOKEN,\n operatorToken: parsed.WORKPLANE_OPERATOR_TOKEN,\n envAllowlist: parseCsv(parsed.WORKPLANE_ENV_ALLOWLIST ?? \"\"),\n };\n}\n\nexport function loadNodeConfig(env: NodeJS.ProcessEnv = process.env): NodeConfig {\n const parsed = nodeEnvSchema.parse(env);\n\n return {\n serverUrl: parsed.WORKPLANE_SERVER_URL,\n nodeName: parsed.WORKPLANE_NODE_NAME,\n nodeId: parsed.WORKPLANE_NODE_ID,\n nodeCapabilities: parseCsv(parsed.WORKPLANE_NODE_CAPABILITIES),\n nodeToken: parsed.WORKPLANE_NODE_TOKEN,\n pollIntervalMs: parsed.WORKPLANE_POLL_INTERVAL_MS,\n envAllowlist: parseCsv(parsed.WORKPLANE_ENV_ALLOWLIST ?? \"\"),\n };\n}\n\nexport function parseCsv(value: string): string[] {\n return value\n .split(\",\")\n .map((entry) => entry.trim())\n .filter(Boolean);\n}\n","import type { IncomingMessage } from \"node:http\";\n\nexport function parseBearerToken(authorizationHeader: string | undefined): string | undefined {\n if (!authorizationHeader) {\n return undefined;\n }\n const match = /^Bearer\\s+(.+)$/i.exec(authorizationHeader.trim());\n return match?.[1];\n}\n\nexport function isAuthorizedBearer(provided: string | undefined, expected: string | undefined): boolean {\n if (!expected) {\n return true;\n }\n if (!provided) {\n return false;\n }\n return provided === expected;\n}\n\nexport function getRequestBearer(req: IncomingMessage): string | undefined {\n const header = req.headers.authorization;\n const value = Array.isArray(header) ? header[0] : header;\n return parseBearerToken(value);\n}\n\nexport function authHeaders(token: string | undefined): Record<string, string> {\n if (!token) {\n return {};\n }\n return { authorization: `Bearer ${token}` };\n}\n","import { authHeaders } from \"./auth.js\";\n\nexport interface WorkplaneHttpOptions {\n method?: string;\n body?: unknown;\n nodeToken?: string;\n operatorToken?: string;\n}\n\nexport function buildWorkplaneHeaders(options: WorkplaneHttpOptions = {}): Record<string, string> {\n const token = options.nodeToken ?? options.operatorToken;\n return {\n \"content-type\": \"application/json\",\n ...authHeaders(token),\n };\n}\n\nexport async function workplaneFetch<T>(\n serverUrl: string,\n path: string,\n options: WorkplaneHttpOptions = {},\n): Promise<T> {\n const response = await fetch(`${serverUrl}${path}`, {\n method: options.method ?? \"GET\",\n headers: buildWorkplaneHeaders(options),\n body: options.body ? JSON.stringify(options.body) : undefined,\n });\n\n if (!response.ok) {\n const text = await response.text();\n throw new Error(`${response.status} ${response.statusText} from ${path}: ${text}`);\n }\n\n return (await response.json()) as T;\n}\n","import type { Workplan } from \"@workplane/workplans\";\n\nexport interface CodeReviewOptions {\n repoPath?: string;\n model?: string;\n branch?: string;\n}\n\nexport function codeReviewPlan(opts: CodeReviewOptions = {}): Workplan {\n const { repoPath = \".\", model = \"claude-haiku-4-5-20251001\", branch } = opts;\n const diffCmd = branch ? `git diff ${branch}..HEAD` : \"git diff HEAD~1\";\n\n return {\n id: \"code-review\",\n name: \"Code Review\",\n steps: [\n {\n id: \"diff\",\n name: \"Git Diff\",\n adapter: \"shell\",\n provider: \"shell\",\n payload: { command: diffCmd, cwd: repoPath },\n output: { dest: \"next\" },\n },\n {\n id: \"summarize\",\n name: \"Summarize\",\n adapter: \"ollama\",\n provider: \"ollama\",\n model: \"llama3\",\n payload: { prompt: \"Summarize these code changes concisely:\\n{{prevOutput}}\" },\n output: { dest: \"next\" },\n },\n {\n id: \"critique\",\n name: \"Critique\",\n adapter: \"anthropic\",\n provider: \"anthropic\",\n model,\n payload: { prompt: \"Review this summary for correctness, security issues, and code quality:\\n{{prevOutput}}\" },\n },\n ],\n };\n}\n","import type { Workplan } from \"@workplane/workplans\";\n\nexport interface SummarizeFileOptions {\n filePath: string;\n provider?: string;\n model?: string;\n}\n\nexport function summarizeFilePlan(opts: SummarizeFileOptions): Workplan {\n const { filePath, provider = \"ollama\", model = \"llama3\" } = opts;\n\n return {\n id: \"summarize-file\",\n name: \"Summarize File\",\n steps: [\n {\n id: \"read\",\n name: \"Read File\",\n adapter: \"file\",\n provider: \"file\",\n payload: { path: filePath },\n output: { dest: \"next\" },\n },\n {\n id: \"summarize\",\n name: \"Summarize\",\n adapter: provider,\n provider,\n model,\n payload: { prompt: \"Summarize the following file content concisely:\\n{{prevOutput}}\" },\n },\n ],\n };\n}\n","import type { SkillEntry } from \"../types.js\";\nimport { codeReviewPlan } from \"./code-review.js\";\nimport { summarizeFilePlan } from \"./summarize-file.js\";\n\nexport class SkillRegistry {\n private readonly skills = new Map<string, SkillEntry>();\n\n register(entry: SkillEntry): void {\n this.skills.set(entry.name, entry);\n }\n\n get(name: string): SkillEntry | undefined {\n return this.skills.get(name);\n }\n\n list(): SkillEntry[] {\n return Array.from(this.skills.values());\n }\n}\n\nexport function createDefaultRegistry(): SkillRegistry {\n const registry = new SkillRegistry();\n\n registry.register({\n name: \"code-review\",\n description: \"Git diff → local summarize (ollama) → frontier critique (anthropic)\",\n buildPlan: (opts) =>\n codeReviewPlan({\n repoPath: typeof opts.repo === \"string\" ? opts.repo : undefined,\n model: typeof opts.model === \"string\" ? opts.model : undefined,\n branch: typeof opts.branch === \"string\" ? opts.branch : undefined,\n }),\n });\n\n registry.register({\n name: \"summarize-file\",\n description: \"Read file → summarize with configurable provider (default: ollama)\",\n buildPlan: (opts) => {\n const filePath = typeof opts.file === \"string\" ? opts.file : \"\";\n if (!filePath) throw new Error(\"--file is required for summarize-file\");\n return summarizeFilePlan({\n filePath,\n provider: typeof opts.provider === \"string\" ? opts.provider : undefined,\n model: typeof opts.model === \"string\" ? opts.model : undefined,\n });\n },\n });\n\n return registry;\n}\n\nexport function listSkills(registry: SkillRegistry): void {\n for (const skill of registry.list()) {\n process.stdout.write(` ${skill.name.padEnd(20)} ${skill.description}\\n`);\n }\n}\n","export function applyTemplate(payload: Record<string, unknown>, prevOutput: string): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(payload).map(([k, v]) => [\n k,\n typeof v === \"string\" ? v.replaceAll(\"{{prevOutput}}\", prevOutput) : v,\n ]),\n );\n}\n","import type { Workplan, WorkplanResult, WorkplanRunner, WorkplanRunContext, StepResult, WorkplanStep } from \"./types.js\";\nimport { applyTemplate } from \"./template.js\";\n\nconst INLINE_PROVIDERS = new Set([\"anthropic\", \"openai\", \"ollama\", \"shell\", \"file\"]);\n\nasync function runInlineStep(step: WorkplanStep, prompt: string): Promise<string> {\n const provider = step.provider!;\n if (provider === \"anthropic\") {\n const { runAnthropicStep } = await import(\"./providers/anthropic.js\");\n return runAnthropicStep({ model: step.model ?? \"claude-haiku-4-5-20251001\", prompt });\n }\n if (provider === \"openai\") {\n const { runOpenAIStep } = await import(\"./providers/openai.js\");\n return runOpenAIStep({ model: step.model ?? \"gpt-4o-mini\", prompt });\n }\n if (provider === \"ollama\") {\n const { runOllamaStep } = await import(\"./providers/ollama.js\");\n return runOllamaStep({ model: step.model ?? \"llama3\", prompt });\n }\n if (provider === \"shell\") {\n const { runShellStep } = await import(\"./providers/shell.js\");\n return runShellStep({\n command: String(step.payload.command ?? \"\"),\n cwd: typeof step.payload.cwd === \"string\" ? step.payload.cwd : undefined,\n });\n }\n if (provider === \"file\") {\n const { runFileStep } = await import(\"./providers/file.js\");\n return runFileStep({ path: String(step.payload.path ?? \"\") });\n }\n throw new Error(`unknown inline provider: ${provider}`);\n}\n\nexport class SequentialWorkplanRunner implements WorkplanRunner {\n async run(plan: Workplan, ctx: WorkplanRunContext): Promise<WorkplanResult> {\n const results: StepResult[] = [];\n let prevOutput = \"\";\n let planSucceeded = true;\n\n for (const step of plan.steps) {\n const payload = prevOutput ? applyTemplate(step.payload, prevOutput) : step.payload;\n const prompt = typeof payload.prompt === \"string\" ? payload.prompt : \"\";\n const start = Date.now();\n let output = \"\";\n let exitCode = 0;\n\n try {\n if (step.provider && INLINE_PROVIDERS.has(step.provider)) {\n output = await runInlineStep({ ...step, payload }, prompt);\n } else {\n const node = await ctx.resolveNode(step.requires ?? [], step.provider);\n const result = await node.execute({ ...step, payload });\n output = result.output;\n exitCode = result.exitCode;\n }\n } catch (err) {\n exitCode = 1;\n output = err instanceof Error ? err.message : String(err);\n planSucceeded = false;\n\n const stepResult: StepResult = {\n stepId: step.id,\n output,\n exitCode,\n durationMs: Date.now() - start,\n };\n results.push(stepResult);\n ctx.emitResult(step.id, step.name, output);\n\n if (!step.continueOnError) {\n return {\n planId: plan.id,\n status: \"step_failed\",\n steps: results,\n succeeded: false,\n };\n }\n prevOutput = \"\";\n continue;\n }\n\n const dest = step.output?.dest ?? \"stdout\";\n const stepResult: StepResult = {\n stepId: step.id,\n output,\n exitCode,\n durationMs: Date.now() - start,\n };\n results.push(stepResult);\n\n if (dest === \"stdout\" || dest === \"artifact\") {\n ctx.emitResult(step.id, step.name, output);\n prevOutput = \"\";\n } else if (dest === \"next\") {\n prevOutput = output;\n }\n }\n\n return {\n planId: plan.id,\n status: planSucceeded ? \"completed\" : \"failed\",\n steps: results,\n succeeded: planSucceeded,\n };\n }\n}\n","export function printStepResult(stepName: string, output: string): void {\n process.stdout.write(`=== step: ${stepName} ===\\n${output}\\n\\n`);\n}\n","import type { NodeHandle, WorkplanRunContext, WorkplanStep, StepResult } from \"./types.js\";\nimport { printStepResult } from \"./sinks/stdout.js\";\n\nexport interface LocalWorkplanContextOptions {\n serverUrl?: string;\n nodeToken?: string;\n}\n\nclass WorkplaneNodeHandle implements NodeHandle {\n constructor(\n private readonly serverUrl: string,\n private readonly nodeToken: string,\n ) {}\n\n async execute(step: WorkplanStep): Promise<StepResult> {\n const start = Date.now();\n const taskRes = await fetch(`${this.serverUrl}/tasks`, {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n authorization: `Bearer ${this.nodeToken}`,\n },\n body: JSON.stringify({\n kind: \"workplan.step\",\n adapter: step.adapter,\n payload: step.payload,\n requires: step.requires ?? [],\n }),\n });\n\n if (!taskRes.ok) {\n throw new Error(`failed to submit step ${step.id}: ${taskRes.status}`);\n }\n\n const task = (await taskRes.json()) as { id: string };\n const output = await this.pollUntilDone(task.id);\n return { stepId: step.id, output, exitCode: 0, durationMs: Date.now() - start };\n }\n\n private async pollUntilDone(taskId: string): Promise<string> {\n const terminalStatuses = new Set([\"succeeded\", \"failed\", \"cancelled\"]);\n for (;;) {\n await new Promise((r) => setTimeout(r, 1000));\n const res = await fetch(`${this.serverUrl}/tasks/${taskId}`, {\n headers: { authorization: `Bearer ${this.nodeToken}` },\n });\n const task = (await res.json()) as { status: string; payload?: Record<string, unknown> };\n if (terminalStatuses.has(task.status)) {\n if (task.status !== \"succeeded\") {\n throw new Error(`step task ${taskId} ended with status: ${task.status}`);\n }\n return typeof task.payload?.output === \"string\" ? task.payload.output : \"\";\n }\n }\n }\n}\n\nexport class LocalWorkplanContext implements WorkplanRunContext {\n private readonly serverUrl: string;\n private readonly nodeToken: string;\n\n constructor(opts: LocalWorkplanContextOptions = {}) {\n this.serverUrl = opts.serverUrl ?? process.env.WORKPLANE_SERVER_URL ?? \"http://localhost:8787\";\n this.nodeToken = opts.nodeToken ?? process.env.WORKPLANE_NODE_TOKEN ?? \"\";\n }\n\n async resolveNode(_requires: string[], _provider?: string): Promise<NodeHandle> {\n return new WorkplaneNodeHandle(this.serverUrl, this.nodeToken);\n }\n\n emitResult(_stepId: string, stepName: string, output: string): void {\n printStepResult(stepName, output);\n }\n}\n","import { loadLocalEnv } from \"../../core/src/env.js\";\nimport { parseCsv } from \"../../core/src/config.js\";\nimport { workplaneFetch } from \"../../core/src/http-client.js\";\nimport { createDefaultRegistry, listSkills } from \"../../agent-skills/src/skills/index.js\";\nimport { SequentialWorkplanRunner } from \"../../workplans/src/runner.js\";\nimport { LocalWorkplanContext } from \"../../workplans/src/context.js\";\n\nloadLocalEnv();\n\nconst serverUrl = process.env.WORKPLANE_SERVER_URL ?? \"http://localhost:8787\";\nconst operatorToken = process.env.WORKPLANE_OPERATOR_TOKEN;\n\nasync function httpJson<T>(\n path: string,\n options?: { method?: string; body?: Record<string, unknown>; operator?: boolean },\n): Promise<T> {\n return workplaneFetch<T>(serverUrl, path, {\n method: options?.method,\n body: options?.body,\n operatorToken: options?.operator ? operatorToken : undefined,\n });\n}\n\ninterface RunListResponse {\n runs: Array<{ id: string }>;\n}\n\nfunction valueArg(args: string[], flag: string): string | undefined {\n const index = args.indexOf(flag);\n if (index === -1) {\n return undefined;\n }\n return args[index + 1];\n}\n\nfunction printJson(payload: unknown): void {\n process.stdout.write(`${JSON.stringify(payload, null, 2)}\\n`);\n}\n\nasync function resolveRunIdFromTaskId(taskId: string): Promise<string> {\n const runs = await httpJson<RunListResponse>(`/runs?taskId=${encodeURIComponent(taskId)}`);\n const runId = runs.runs[0]?.id;\n if (!runId) {\n throw new Error(`no runs found for task ${taskId}`);\n }\n return runId;\n}\n\nasync function showLogsById(id: string): Promise<void> {\n const runId = id.startsWith(\"task_\") ? await resolveRunIdFromTaskId(id) : id;\n const logs = await httpJson(`/runs/${runId}/logs`);\n printJson(logs);\n}\n\nfunction usage(): void {\n process.stdout.write(\n [\n \"workplane CLI\",\n \"\",\n \"Env: WORKPLANE_SERVER_URL, WORKPLANE_OPERATOR_TOKEN (for task submit/retry/cancel)\",\n \"\",\n \"Commands:\",\n \" server start / node start # use pnpm dev:server / dev:node\",\n \" task submit shell --command <cmd> [--repo <url>] [--branch <b>] [--cwd <path>]\",\n \" task submit aider --prompt <text> --repo <url> [--model <m>] [--test-command <cmd>]\",\n \" task submit inference --model <m> --prompt <text> [--requires ollama]\",\n \" task submit harness --harness <codex|claude-code> --repo <url> --prompt <text> [--interactive]\",\n \" tasks [--status <status>]\",\n \" task show|logs|retry|cancel <taskId>\",\n \" runs [--task-id <id>] [--status <status>]\",\n \" run show <runId>\",\n \" run input <runId> --stdin <text>\",\n \" run input <runId> --signal <SIGTERM|SIGKILL|SIGINT>\",\n \" run input <runId> --resize <COLSxROWS>\",\n \" logs <runId|taskId>\",\n \" artifacts <runId>\",\n \" skill list\",\n \" skill run <name> [--key value ...]\",\n ].join(\"\\n\"),\n );\n}\n\nasync function submitShell(args: string[]): Promise<void> {\n const command = valueArg(args, \"--command\");\n if (!command) {\n throw new Error(\"--command is required\");\n }\n\n const requires = parseCsv(valueArg(args, \"--requires\") ?? \"shell\");\n const repo = valueArg(args, \"--repo\");\n const branch = valueArg(args, \"--branch\");\n const cwd = valueArg(args, \"--cwd\");\n const task = await httpJson(\"/tasks\", {\n method: \"POST\",\n operator: true,\n body: {\n kind: \"shell.exec\",\n adapter: \"shell\",\n requires,\n payload: { command, repo, branch, cwd },\n },\n });\n\n printJson(task);\n}\n\nasync function submitAider(args: string[]): Promise<void> {\n const prompt = valueArg(args, \"--prompt\");\n if (!prompt) {\n throw new Error(\"--prompt is required\");\n }\n\n const model = valueArg(args, \"--model\");\n const repo = valueArg(args, \"--repo\");\n if (!repo) {\n throw new Error(\"--repo is required\");\n }\n const branch = valueArg(args, \"--branch\");\n const testCommand = valueArg(args, \"--test-command\");\n const requires = parseCsv(valueArg(args, \"--requires\") ?? \"git,aider\");\n const task = await httpJson(\"/tasks\", {\n method: \"POST\",\n operator: true,\n body: {\n kind: \"agent.run\",\n adapter: \"aider\",\n requires,\n payload: { prompt, model, repo, branch, testCommand },\n },\n });\n\n printJson(task);\n}\n\nasync function submitInference(args: string[]): Promise<void> {\n const model = valueArg(args, \"--model\");\n const prompt = valueArg(args, \"--prompt\");\n if (!model || !prompt) {\n throw new Error(\"--model and --prompt are required\");\n }\n\n const adapter = valueArg(args, \"--adapter\") ?? \"ollama\";\n const requires = parseCsv(valueArg(args, \"--requires\") ?? adapter);\n const inputFile = valueArg(args, \"--input-file\");\n\n const task = await httpJson(\"/tasks\", {\n method: \"POST\",\n operator: true,\n body: {\n kind: \"inference.batch\",\n adapter,\n requires,\n payload: { model, prompt, inputFile },\n },\n });\n\n printJson(task);\n}\n\nasync function submitHarness(args: string[]): Promise<void> {\n const harness = valueArg(args, \"--harness\");\n const prompt = valueArg(args, \"--prompt\");\n const repo = valueArg(args, \"--repo\");\n if (!harness || !prompt || !repo) {\n throw new Error(\"--harness, --prompt, and --repo are required\");\n }\n\n if (harness !== \"codex\" && harness !== \"claude-code\") {\n throw new Error(\"--harness must be codex or claude-code\");\n }\n\n const model = valueArg(args, \"--model\");\n const branch = valueArg(args, \"--branch\");\n const testCommand = valueArg(args, \"--test-command\");\n const interactive = args.includes(\"--interactive\") || undefined;\n const requires = parseCsv(valueArg(args, \"--requires\") ?? `${harness},git`);\n\n const task = await httpJson(\"/tasks\", {\n method: \"POST\",\n operator: true,\n body: {\n kind: \"agent.run\",\n adapter: harness,\n requires,\n payload: { prompt, repo, model, branch, testCommand, interactive },\n },\n });\n\n printJson(task);\n}\n\nasync function main(): Promise<void> {\n const [command, subcommand, ...rest] = process.argv.slice(2);\n\n if (!command) {\n usage();\n return;\n }\n\n if (command === \"server\" && subcommand === \"start\") {\n process.stdout.write(\"Use: pnpm dev:server\\n\");\n return;\n }\n\n if (command === \"node\" && subcommand === \"start\") {\n process.stdout.write(\"Use: pnpm dev:node\\n\");\n return;\n }\n\n if (command === \"task\" && subcommand === \"submit\") {\n const adapter = rest[0];\n const adapterArgs = rest.slice(1);\n if (adapter === \"shell\") {\n await submitShell(adapterArgs);\n return;\n }\n if (adapter === \"aider\") {\n await submitAider(adapterArgs);\n return;\n }\n if (adapter === \"inference\") {\n await submitInference(adapterArgs);\n return;\n }\n if (adapter === \"harness\") {\n await submitHarness(adapterArgs);\n return;\n }\n throw new Error(`unsupported adapter submit: ${adapter}`);\n }\n\n if (command === \"tasks\") {\n const status = valueArg([subcommand, ...rest].filter(Boolean) as string[], \"--status\");\n const tasks = await httpJson(status ? `/tasks?status=${encodeURIComponent(status)}` : \"/tasks\");\n printJson(tasks);\n return;\n }\n\n if (command === \"task\" && subcommand === \"show\") {\n const taskId = rest[0];\n if (!taskId) {\n throw new Error(\"task id is required\");\n }\n const task = await httpJson(`/tasks/${taskId}`);\n printJson(task);\n return;\n }\n\n if (command === \"task\" && subcommand === \"retry\") {\n const taskId = rest[0];\n if (!taskId) {\n throw new Error(\"task id is required\");\n }\n const task = await httpJson(`/tasks/${taskId}/retry`, { method: \"POST\", operator: true });\n printJson(task);\n return;\n }\n\n if (command === \"task\" && subcommand === \"logs\") {\n const taskId = rest[0];\n if (!taskId) {\n throw new Error(\"task id is required\");\n }\n await showLogsById(taskId);\n return;\n }\n\n if (command === \"task\" && subcommand === \"cancel\") {\n const taskId = rest[0];\n if (!taskId) {\n throw new Error(\"task id is required\");\n }\n const task = await httpJson(`/tasks/${taskId}/cancel`, { method: \"POST\", operator: true });\n printJson(task);\n return;\n }\n\n if (command === \"runs\") {\n const taskId = valueArg(rest, \"--task-id\");\n const status = valueArg(rest, \"--status\");\n const query = new URLSearchParams();\n if (taskId) {\n query.set(\"taskId\", taskId);\n }\n if (status) {\n query.set(\"status\", status);\n }\n const runs = await httpJson(query.size > 0 ? `/runs?${query.toString()}` : \"/runs\");\n printJson(runs);\n return;\n }\n\n if (command === \"run\" && subcommand === \"input\") {\n const runId = rest[0];\n if (!runId) {\n throw new Error(\"run id is required\");\n }\n const inputArgs = rest.slice(1);\n const stdinData = valueArg(inputArgs, \"--stdin\");\n const signal = valueArg(inputArgs, \"--signal\");\n const resize = valueArg(inputArgs, \"--resize\");\n\n let body: Record<string, unknown>;\n if (stdinData !== undefined) {\n body = { kind: \"stdin\", payload: { data: stdinData } };\n } else if (signal !== undefined) {\n if (signal !== \"SIGTERM\" && signal !== \"SIGKILL\" && signal !== \"SIGINT\") {\n throw new Error(\"--signal must be SIGTERM, SIGKILL, or SIGINT\");\n }\n body = { kind: \"signal\", payload: { signal } };\n } else if (resize !== undefined) {\n const match = /^(\\d+)x(\\d+)$/.exec(resize);\n if (!match) {\n throw new Error(\"--resize must be in COLSxROWS format, e.g. 220x50\");\n }\n body = { kind: \"resize\", payload: { cols: Number(match[1]), rows: Number(match[2]) } };\n } else {\n throw new Error(\"one of --stdin, --signal, or --resize is required\");\n }\n\n const result = await httpJson(`/runs/${runId}/input`, { method: \"POST\", operator: true, body });\n printJson(result);\n return;\n }\n\n if (command === \"run\" && subcommand === \"show\") {\n const runId = rest[0];\n if (!runId) {\n throw new Error(\"run id is required\");\n }\n const run = await httpJson(`/runs/${runId}`);\n printJson(run);\n return;\n }\n\n if (command === \"logs\") {\n const id = subcommand;\n if (!id) {\n throw new Error(\"run id or task id is required\");\n }\n await showLogsById(id);\n return;\n }\n\n if (command === \"artifacts\") {\n const runId = subcommand;\n if (!runId) {\n throw new Error(\"run id is required\");\n }\n const artifacts = await httpJson(`/runs/${runId}/artifacts`);\n printJson(artifacts);\n return;\n }\n\n if (command === \"skill\" && subcommand === \"list\") {\n const registry = createDefaultRegistry();\n process.stdout.write(\"Available skills:\\n\");\n listSkills(registry);\n return;\n }\n\n if (command === \"skill\" && subcommand === \"run\") {\n const skillName = rest[0];\n if (!skillName) {\n throw new Error(\"skill name is required\");\n }\n const registry = createDefaultRegistry();\n const skill = registry.get(skillName);\n if (!skill) {\n throw new Error(`unknown skill: ${skillName}. Run 'workplane skill list' to see available skills.`);\n }\n\n const optArgs = rest.slice(1);\n const options: Record<string, unknown> = {};\n for (let i = 0; i < optArgs.length - 1; i++) {\n if (optArgs[i].startsWith(\"--\")) {\n options[optArgs[i].slice(2)] = optArgs[i + 1];\n i++;\n }\n }\n\n const plan = skill.buildPlan(options);\n const runner = new SequentialWorkplanRunner();\n const ctx = new LocalWorkplanContext();\n const result = await runner.run(plan, ctx);\n\n if (!result.succeeded) {\n process.stderr.write(`skill '${skillName}' failed at step '${result.steps.at(-1)?.stepId ?? \"unknown\"}'\\n`);\n process.exit(1);\n }\n return;\n }\n\n usage();\n}\n\nmain().catch((error) => {\n process.stderr.write(`${String(error)}\\n`);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,OAAO,eAAe;AAQtB,eAAsB,iBAAiB,MAA6C;AAClF,QAAM,SAAS,IAAI,UAAU,EAAE,QAAQ,KAAK,UAAU,QAAQ,IAAI,kBAAkB,CAAC;AACrF,QAAM,UAAU,MAAM,OAAO,SAAS,OAAO;AAAA,IAC3C,OAAO,KAAK;AAAA,IACZ,YAAY;AAAA,IACZ,UAAU,CAAC,EAAE,MAAM,QAAQ,SAAS,KAAK,OAAO,CAAC;AAAA,EACnD,CAAC;AACD,QAAM,QAAQ,QAAQ,QAAQ,CAAC;AAC/B,SAAO,MAAM,SAAS,SAAS,MAAM,OAAO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,EAAE,WAAW,IAAI,GAAG;AAC/B,gBAAQ,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,QAAQ,IAAI,CAAC;AAC5C;AAAA,MACF;AAAA,IACF;AAEA,UAAM,OAAO,MAAM,UAAU,OAAO;AACpC,UAAM,SAAS,IAAI,yBAAyB;AAC5C,UAAM,MAAM,IAAI,qBAAqB;AACrC,UAAM,SAAS,MAAM,OAAO,IAAI,MAAM,GAAG;AAEzC,QAAI,CAAC,OAAO,WAAW;AACrB,cAAQ,OAAO,MAAM,UAAU,SAAS,qBAAqB,OAAO,MAAM,GAAG,EAAE,GAAG,UAAU,SAAS;AAAA,CAAK;AAC1G,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA;AAAA,EACF;AAEA,QAAM;AACR;AAEA,KAAK,EAAE,MAAM,CAAC,UAAU;AACtB,UAAQ,OAAO,MAAM,GAAG,OAAO,KAAK,CAAC;AAAA,CAAI;AACzC,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["serverUrl","runAnthropicStep","runOpenAIStep","runOllamaStep","runShellStep","runFileStep","stepResult","serverUrl"]}
|
|
1
|
+
{"version":3,"sources":["../../workplans/src/providers/anthropic.ts","../../workplans/src/providers/openai.ts","../../workplans/src/providers/ollama.ts","../../workplans/src/providers/shell.ts","../../workplans/src/providers/file.ts","../../core/src/env.ts","../../core/src/config.ts","../../core/src/auth.ts","../../core/src/http-client.ts","../../agent-skills/src/skills/code-review.ts","../../agent-skills/src/skills/summarize-file.ts","../../agent-skills/src/skills/index.ts","../../workplans/src/template.ts","../../workplans/src/runner.ts","../../workplans/src/sinks/stdout.ts","../../workplans/src/context.ts","../../cli/src/index.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\n\nexport interface AnthropicStepOptions {\n model: string;\n prompt: string;\n apiKey?: string;\n}\n\nexport async function runAnthropicStep(opts: AnthropicStepOptions): Promise<string> {\n const client = new Anthropic({ apiKey: opts.apiKey ?? process.env.ANTHROPIC_API_KEY });\n const message = await client.messages.create({\n model: opts.model,\n max_tokens: 4096,\n messages: [{ role: \"user\", content: opts.prompt }],\n });\n const block = message.content[0];\n return block.type === \"text\" ? block.text : \"\";\n}\n","import OpenAI from \"openai\";\n\nexport interface OpenAIStepOptions {\n model: string;\n prompt: string;\n apiKey?: string;\n}\n\nexport async function runOpenAIStep(opts: OpenAIStepOptions): Promise<string> {\n const client = new OpenAI({ apiKey: opts.apiKey ?? process.env.OPENAI_API_KEY });\n const completion = await client.chat.completions.create({\n model: opts.model,\n messages: [{ role: \"user\", content: opts.prompt }],\n });\n return completion.choices[0]?.message.content ?? \"\";\n}\n","import { Ollama } from \"ollama\";\n\nexport interface OllamaStepOptions {\n model: string;\n prompt: string;\n host?: string;\n}\n\nexport async function runOllamaStep(opts: OllamaStepOptions): Promise<string> {\n const host = opts.host ?? process.env.OLLAMA_HOST ?? \"http://localhost:11434\";\n const client = new Ollama({ host });\n const response = await client.generate({ model: opts.model, prompt: opts.prompt });\n return response.response;\n}\n","import { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\n\nconst execAsync = promisify(exec);\n\nexport interface ShellStepOptions {\n command: string;\n cwd?: string;\n}\n\nexport async function runShellStep(opts: ShellStepOptions): Promise<string> {\n const { stdout } = await execAsync(opts.command, {\n cwd: opts.cwd,\n maxBuffer: 10 * 1024 * 1024,\n });\n return stdout;\n}\n","import { readFile } from \"node:fs/promises\";\n\nexport interface FileStepOptions {\n path: string;\n encoding?: BufferEncoding;\n}\n\nexport async function runFileStep(opts: FileStepOptions): Promise<string> {\n return readFile(opts.path, opts.encoding ?? \"utf8\");\n}\n","import { config as dotenvConfig } from \"dotenv\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nlet envLoaded = false;\n\n// Load order (highest priority first, all with override:false so shell env vars win):\n// 1. .env.local — project-local overrides (gitignored)\n// 2. ~/.workplane/.env — user global config written by workplane-setup\n// 3. .env — project defaults (committed)\nexport function loadLocalEnv(): void {\n if (envLoaded) {\n return;\n }\n\n dotenvConfig({ path: \".env.local\" });\n dotenvConfig({ path: join(homedir(), \".workplane\", \".env\") });\n dotenvConfig({ path: \".env\" });\n\n envLoaded = true;\n}\n","import { z } from \"zod\";\nimport { loadLocalEnv } from \"./env.js\";\n\nloadLocalEnv();\n\nconst serverEnvSchema = z.object({\n DATABASE_URL: z.string().optional().default(\"sqlite://~/.workplane/workplane.db\"),\n WORKPLANE_SERVER_PORT: z\n .string()\n .optional()\n .default(\"8787\")\n .transform((value) => Number.parseInt(value, 10)),\n WORKPLANE_NODE_TOKEN: z.string().optional(),\n WORKPLANE_OPERATOR_TOKEN: z.string().optional(),\n WORKPLANE_ENV_ALLOWLIST: z.string().optional(),\n});\n\nconst nodeEnvSchema = z.object({\n WORKPLANE_SERVER_URL: z.string().url().optional().default(\"http://localhost:8787\"),\n WORKPLANE_NODE_NAME: z.string().optional().default(\"local-node-1\"),\n WORKPLANE_NODE_ID: z.string().optional(),\n WORKPLANE_NODE_CAPABILITIES: z\n .string()\n .optional()\n .default(\"shell,git,node,typescript,aider,ollama,codex,claude-code\"),\n WORKPLANE_NODE_TOKEN: z.string().optional(),\n WORKPLANE_POLL_INTERVAL_MS: z\n .string()\n .optional()\n .default(\"3000\")\n .transform((value) => Number.parseInt(value, 10)),\n WORKPLANE_ENV_ALLOWLIST: z.string().optional(),\n});\n\nexport interface ServerConfig {\n databaseUrl: string;\n port: number;\n nodeToken?: string;\n operatorToken?: string;\n envAllowlist: string[];\n}\n\nexport interface NodeConfig {\n serverUrl: string;\n nodeName: string;\n nodeId?: string;\n nodeCapabilities: string[];\n nodeToken?: string;\n pollIntervalMs: number;\n envAllowlist: string[];\n}\n\nexport function loadServerConfig(env: NodeJS.ProcessEnv = process.env): ServerConfig {\n const parsed = serverEnvSchema.parse(env);\n\n return {\n databaseUrl: parsed.DATABASE_URL,\n port: parsed.WORKPLANE_SERVER_PORT,\n nodeToken: parsed.WORKPLANE_NODE_TOKEN,\n operatorToken: parsed.WORKPLANE_OPERATOR_TOKEN,\n envAllowlist: parseCsv(parsed.WORKPLANE_ENV_ALLOWLIST ?? \"\"),\n };\n}\n\nexport function loadNodeConfig(env: NodeJS.ProcessEnv = process.env): NodeConfig {\n const parsed = nodeEnvSchema.parse(env);\n\n return {\n serverUrl: parsed.WORKPLANE_SERVER_URL,\n nodeName: parsed.WORKPLANE_NODE_NAME,\n nodeId: parsed.WORKPLANE_NODE_ID,\n nodeCapabilities: parseCsv(parsed.WORKPLANE_NODE_CAPABILITIES),\n nodeToken: parsed.WORKPLANE_NODE_TOKEN,\n pollIntervalMs: parsed.WORKPLANE_POLL_INTERVAL_MS,\n envAllowlist: parseCsv(parsed.WORKPLANE_ENV_ALLOWLIST ?? \"\"),\n };\n}\n\nexport function parseCsv(value: string): string[] {\n return value\n .split(\",\")\n .map((entry) => entry.trim())\n .filter(Boolean);\n}\n","import type { IncomingMessage } from \"node:http\";\n\nexport function parseBearerToken(authorizationHeader: string | undefined): string | undefined {\n if (!authorizationHeader) {\n return undefined;\n }\n const match = /^Bearer\\s+(.+)$/i.exec(authorizationHeader.trim());\n return match?.[1];\n}\n\nexport function isAuthorizedBearer(provided: string | undefined, expected: string | undefined): boolean {\n if (!expected) {\n return true;\n }\n if (!provided) {\n return false;\n }\n return provided === expected;\n}\n\nexport function getRequestBearer(req: IncomingMessage): string | undefined {\n const header = req.headers.authorization;\n const value = Array.isArray(header) ? header[0] : header;\n return parseBearerToken(value);\n}\n\nexport function authHeaders(token: string | undefined): Record<string, string> {\n if (!token) {\n return {};\n }\n return { authorization: `Bearer ${token}` };\n}\n","import { authHeaders } from \"./auth.js\";\n\nexport interface WorkplaneHttpOptions {\n method?: string;\n body?: unknown;\n nodeToken?: string;\n operatorToken?: string;\n}\n\nexport function buildWorkplaneHeaders(options: WorkplaneHttpOptions = {}): Record<string, string> {\n const token = options.nodeToken ?? options.operatorToken;\n return {\n \"content-type\": \"application/json\",\n ...authHeaders(token),\n };\n}\n\nexport async function workplaneFetch<T>(\n serverUrl: string,\n path: string,\n options: WorkplaneHttpOptions = {},\n): Promise<T> {\n const response = await fetch(`${serverUrl}${path}`, {\n method: options.method ?? \"GET\",\n headers: buildWorkplaneHeaders(options),\n body: options.body ? JSON.stringify(options.body) : undefined,\n });\n\n if (!response.ok) {\n const text = await response.text();\n throw new Error(`${response.status} ${response.statusText} from ${path}: ${text}`);\n }\n\n return (await response.json()) as T;\n}\n","import type { Workplan } from \"@workplane/workplans\";\n\nexport interface CodeReviewOptions {\n repoPath?: string;\n model?: string;\n branch?: string;\n}\n\nexport function codeReviewPlan(opts: CodeReviewOptions = {}): Workplan {\n const { repoPath = \".\", model = \"claude-haiku-4-5-20251001\", branch } = opts;\n const diffCmd = branch ? `git diff ${branch}..HEAD` : \"git diff HEAD~1\";\n\n return {\n id: \"code-review\",\n name: \"Code Review\",\n steps: [\n {\n id: \"diff\",\n name: \"Git Diff\",\n adapter: \"shell\",\n provider: \"shell\",\n payload: { command: diffCmd, cwd: repoPath },\n output: { dest: \"next\" },\n },\n {\n id: \"summarize\",\n name: \"Summarize\",\n adapter: \"ollama\",\n provider: \"ollama\",\n model: \"llama3\",\n payload: { prompt: \"Summarize these code changes concisely:\\n{{prevOutput}}\" },\n output: { dest: \"next\" },\n },\n {\n id: \"critique\",\n name: \"Critique\",\n adapter: \"anthropic\",\n provider: \"anthropic\",\n model,\n payload: { prompt: \"Review this summary for correctness, security issues, and code quality:\\n{{prevOutput}}\" },\n },\n ],\n };\n}\n","import type { Workplan } from \"@workplane/workplans\";\n\nexport interface SummarizeFileOptions {\n filePath: string;\n provider?: string;\n model?: string;\n}\n\nexport function summarizeFilePlan(opts: SummarizeFileOptions): Workplan {\n const { filePath, provider = \"ollama\", model = \"llama3\" } = opts;\n\n return {\n id: \"summarize-file\",\n name: \"Summarize File\",\n steps: [\n {\n id: \"read\",\n name: \"Read File\",\n adapter: \"file\",\n provider: \"file\",\n payload: { path: filePath },\n output: { dest: \"next\" },\n },\n {\n id: \"summarize\",\n name: \"Summarize\",\n adapter: provider,\n provider,\n model,\n payload: { prompt: \"Summarize the following file content concisely:\\n{{prevOutput}}\" },\n },\n ],\n };\n}\n","import type { SkillEntry } from \"../types.js\";\nimport { codeReviewPlan } from \"./code-review.js\";\nimport { summarizeFilePlan } from \"./summarize-file.js\";\n\nexport class SkillRegistry {\n private readonly skills = new Map<string, SkillEntry>();\n\n register(entry: SkillEntry): void {\n this.skills.set(entry.name, entry);\n }\n\n get(name: string): SkillEntry | undefined {\n return this.skills.get(name);\n }\n\n list(): SkillEntry[] {\n return Array.from(this.skills.values());\n }\n}\n\nexport function createDefaultRegistry(): SkillRegistry {\n const registry = new SkillRegistry();\n\n registry.register({\n name: \"code-review\",\n description: \"Git diff → local summarize (ollama) → frontier critique (anthropic)\",\n buildPlan: (opts) =>\n codeReviewPlan({\n repoPath: typeof opts.repo === \"string\" ? opts.repo : undefined,\n model: typeof opts.model === \"string\" ? opts.model : undefined,\n branch: typeof opts.branch === \"string\" ? opts.branch : undefined,\n }),\n });\n\n registry.register({\n name: \"summarize-file\",\n description: \"Read file → summarize with configurable provider (default: ollama)\",\n buildPlan: (opts) => {\n const filePath = typeof opts.file === \"string\" ? opts.file : \"\";\n if (!filePath) throw new Error(\"--file is required for summarize-file\");\n return summarizeFilePlan({\n filePath,\n provider: typeof opts.provider === \"string\" ? opts.provider : undefined,\n model: typeof opts.model === \"string\" ? opts.model : undefined,\n });\n },\n });\n\n return registry;\n}\n\nexport function listSkills(registry: SkillRegistry): void {\n for (const skill of registry.list()) {\n process.stdout.write(` ${skill.name.padEnd(20)} ${skill.description}\\n`);\n }\n}\n","export function applyTemplate(payload: Record<string, unknown>, prevOutput: string): Record<string, unknown> {\n return Object.fromEntries(\n Object.entries(payload).map(([k, v]) => [\n k,\n typeof v === \"string\" ? v.replaceAll(\"{{prevOutput}}\", prevOutput) : v,\n ]),\n );\n}\n","import type { Workplan, WorkplanResult, WorkplanRunner, WorkplanRunContext, StepResult, WorkplanStep } from \"./types.js\";\nimport { applyTemplate } from \"./template.js\";\n\nconst INLINE_PROVIDERS = new Set([\"anthropic\", \"openai\", \"ollama\", \"shell\", \"file\"]);\n\nasync function runInlineStep(step: WorkplanStep, prompt: string): Promise<string> {\n const provider = step.provider!;\n if (provider === \"anthropic\") {\n const { runAnthropicStep } = await import(\"./providers/anthropic.js\");\n return runAnthropicStep({ model: step.model ?? \"claude-haiku-4-5-20251001\", prompt });\n }\n if (provider === \"openai\") {\n const { runOpenAIStep } = await import(\"./providers/openai.js\");\n return runOpenAIStep({ model: step.model ?? \"gpt-4o-mini\", prompt });\n }\n if (provider === \"ollama\") {\n const { runOllamaStep } = await import(\"./providers/ollama.js\");\n return runOllamaStep({ model: step.model ?? \"llama3\", prompt });\n }\n if (provider === \"shell\") {\n const { runShellStep } = await import(\"./providers/shell.js\");\n return runShellStep({\n command: String(step.payload.command ?? \"\"),\n cwd: typeof step.payload.cwd === \"string\" ? step.payload.cwd : undefined,\n });\n }\n if (provider === \"file\") {\n const { runFileStep } = await import(\"./providers/file.js\");\n return runFileStep({ path: String(step.payload.path ?? \"\") });\n }\n throw new Error(`unknown inline provider: ${provider}`);\n}\n\nexport class SequentialWorkplanRunner implements WorkplanRunner {\n async run(plan: Workplan, ctx: WorkplanRunContext): Promise<WorkplanResult> {\n const results: StepResult[] = [];\n let prevOutput = \"\";\n let planSucceeded = true;\n\n for (const step of plan.steps) {\n const payload = prevOutput ? applyTemplate(step.payload, prevOutput) : step.payload;\n const prompt = typeof payload.prompt === \"string\" ? payload.prompt : \"\";\n const start = Date.now();\n let output = \"\";\n let exitCode = 0;\n\n try {\n if (step.provider && INLINE_PROVIDERS.has(step.provider)) {\n output = await runInlineStep({ ...step, payload }, prompt);\n } else {\n const node = await ctx.resolveNode(step.requires ?? [], step.provider);\n const result = await node.execute({ ...step, payload });\n output = result.output;\n exitCode = result.exitCode;\n }\n } catch (err) {\n exitCode = 1;\n output = err instanceof Error ? err.message : String(err);\n planSucceeded = false;\n\n const stepResult: StepResult = {\n stepId: step.id,\n output,\n exitCode,\n durationMs: Date.now() - start,\n };\n results.push(stepResult);\n ctx.emitResult(step.id, step.name, output);\n\n if (!step.continueOnError) {\n return {\n planId: plan.id,\n status: \"step_failed\",\n steps: results,\n succeeded: false,\n };\n }\n prevOutput = \"\";\n continue;\n }\n\n const dest = step.output?.dest ?? \"stdout\";\n const stepResult: StepResult = {\n stepId: step.id,\n output,\n exitCode,\n durationMs: Date.now() - start,\n };\n results.push(stepResult);\n\n if (dest === \"stdout\" || dest === \"artifact\") {\n ctx.emitResult(step.id, step.name, output);\n prevOutput = \"\";\n } else if (dest === \"next\") {\n prevOutput = output;\n }\n }\n\n return {\n planId: plan.id,\n status: planSucceeded ? \"completed\" : \"failed\",\n steps: results,\n succeeded: planSucceeded,\n };\n }\n}\n","export function printStepResult(stepName: string, output: string): void {\n process.stdout.write(`=== step: ${stepName} ===\\n${output}\\n\\n`);\n}\n","import type { NodeHandle, WorkplanRunContext, WorkplanStep, StepResult } from \"./types.js\";\nimport { printStepResult } from \"./sinks/stdout.js\";\n\nexport interface LocalWorkplanContextOptions {\n serverUrl?: string;\n nodeToken?: string;\n}\n\nclass WorkplaneNodeHandle implements NodeHandle {\n constructor(\n private readonly serverUrl: string,\n private readonly nodeToken: string,\n ) {}\n\n async execute(step: WorkplanStep): Promise<StepResult> {\n const start = Date.now();\n const taskRes = await fetch(`${this.serverUrl}/tasks`, {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n authorization: `Bearer ${this.nodeToken}`,\n },\n body: JSON.stringify({\n kind: \"workplan.step\",\n adapter: step.adapter,\n payload: step.payload,\n requires: step.requires ?? [],\n }),\n });\n\n if (!taskRes.ok) {\n throw new Error(`failed to submit step ${step.id}: ${taskRes.status}`);\n }\n\n const task = (await taskRes.json()) as { id: string };\n const output = await this.pollUntilDone(task.id);\n return { stepId: step.id, output, exitCode: 0, durationMs: Date.now() - start };\n }\n\n private async pollUntilDone(taskId: string): Promise<string> {\n const terminalStatuses = new Set([\"succeeded\", \"failed\", \"cancelled\"]);\n for (;;) {\n await new Promise((r) => setTimeout(r, 1000));\n const res = await fetch(`${this.serverUrl}/tasks/${taskId}`, {\n headers: { authorization: `Bearer ${this.nodeToken}` },\n });\n const task = (await res.json()) as { status: string; payload?: Record<string, unknown> };\n if (terminalStatuses.has(task.status)) {\n if (task.status !== \"succeeded\") {\n throw new Error(`step task ${taskId} ended with status: ${task.status}`);\n }\n return typeof task.payload?.output === \"string\" ? task.payload.output : \"\";\n }\n }\n }\n}\n\nexport class LocalWorkplanContext implements WorkplanRunContext {\n private readonly serverUrl: string;\n private readonly nodeToken: string;\n\n constructor(opts: LocalWorkplanContextOptions = {}) {\n this.serverUrl = opts.serverUrl ?? process.env.WORKPLANE_SERVER_URL ?? \"http://localhost:8787\";\n this.nodeToken = opts.nodeToken ?? process.env.WORKPLANE_NODE_TOKEN ?? \"\";\n }\n\n async resolveNode(_requires: string[], _provider?: string): Promise<NodeHandle> {\n return new WorkplaneNodeHandle(this.serverUrl, this.nodeToken);\n }\n\n emitResult(_stepId: string, stepName: string, output: string): void {\n printStepResult(stepName, output);\n }\n}\n","import { loadLocalEnv } from \"../../core/src/env.js\";\nimport { parseCsv } from \"../../core/src/config.js\";\nimport { workplaneFetch } from \"../../core/src/http-client.js\";\nimport { createDefaultRegistry, listSkills } from \"../../agent-skills/src/skills/index.js\";\nimport { SequentialWorkplanRunner } from \"../../workplans/src/runner.js\";\nimport { LocalWorkplanContext } from \"../../workplans/src/context.js\";\n\nloadLocalEnv();\n\nconst serverUrl = process.env.WORKPLANE_SERVER_URL ?? \"http://localhost:8787\";\nconst operatorToken = process.env.WORKPLANE_OPERATOR_TOKEN;\n\nasync function httpJson<T>(\n path: string,\n options?: { method?: string; body?: Record<string, unknown>; operator?: boolean },\n): Promise<T> {\n return workplaneFetch<T>(serverUrl, path, {\n method: options?.method,\n body: options?.body,\n operatorToken: options?.operator ? operatorToken : undefined,\n });\n}\n\ninterface RunListResponse {\n runs: Array<{ id: string }>;\n}\n\nfunction valueArg(args: string[], flag: string): string | undefined {\n const index = args.indexOf(flag);\n if (index === -1) {\n return undefined;\n }\n return args[index + 1];\n}\n\nfunction printJson(payload: unknown): void {\n process.stdout.write(`${JSON.stringify(payload, null, 2)}\\n`);\n}\n\nasync function resolveRunIdFromTaskId(taskId: string): Promise<string> {\n const runs = await httpJson<RunListResponse>(`/runs?taskId=${encodeURIComponent(taskId)}`);\n const runId = runs.runs[0]?.id;\n if (!runId) {\n throw new Error(`no runs found for task ${taskId}`);\n }\n return runId;\n}\n\nasync function showLogsById(id: string): Promise<void> {\n const runId = id.startsWith(\"task_\") ? await resolveRunIdFromTaskId(id) : id;\n const logs = await httpJson(`/runs/${runId}/logs`);\n printJson(logs);\n}\n\nfunction usage(): void {\n process.stdout.write(\n [\n \"workplane CLI\",\n \"\",\n \"Env: WORKPLANE_SERVER_URL, WORKPLANE_OPERATOR_TOKEN (for task submit/retry/cancel)\",\n \"\",\n \"Commands:\",\n \" server start / node start # use pnpm dev:server / dev:node\",\n \" task submit shell --command <cmd> [--repo <url>] [--branch <b>] [--cwd <path>]\",\n \" task submit aider --prompt <text> --repo <url> [--model <m>] [--test-command <cmd>]\",\n \" task submit inference --model <m> --prompt <text> [--requires ollama]\",\n \" task submit harness --harness <codex|claude-code> --repo <url> --prompt <text> [--interactive]\",\n \" tasks [--status <status>]\",\n \" task show|logs|retry|cancel <taskId>\",\n \" runs [--task-id <id>] [--status <status>]\",\n \" run show <runId>\",\n \" run input <runId> --stdin <text>\",\n \" run input <runId> --signal <SIGTERM|SIGKILL|SIGINT>\",\n \" run input <runId> --resize <COLSxROWS>\",\n \" logs <runId|taskId>\",\n \" artifacts <runId>\",\n \" skill list\",\n \" skill run <name> [--key value ...]\",\n ].join(\"\\n\"),\n );\n}\n\nasync function submitShell(args: string[]): Promise<void> {\n const command = valueArg(args, \"--command\");\n if (!command) {\n throw new Error(\"--command is required\");\n }\n\n const requires = parseCsv(valueArg(args, \"--requires\") ?? \"shell\");\n const repo = valueArg(args, \"--repo\");\n const branch = valueArg(args, \"--branch\");\n const cwd = valueArg(args, \"--cwd\");\n const task = await httpJson(\"/tasks\", {\n method: \"POST\",\n operator: true,\n body: {\n kind: \"shell.exec\",\n adapter: \"shell\",\n requires,\n payload: { command, repo, branch, cwd },\n },\n });\n\n printJson(task);\n}\n\nasync function submitAider(args: string[]): Promise<void> {\n const prompt = valueArg(args, \"--prompt\");\n if (!prompt) {\n throw new Error(\"--prompt is required\");\n }\n\n const model = valueArg(args, \"--model\");\n const repo = valueArg(args, \"--repo\");\n if (!repo) {\n throw new Error(\"--repo is required\");\n }\n const branch = valueArg(args, \"--branch\");\n const testCommand = valueArg(args, \"--test-command\");\n const requires = parseCsv(valueArg(args, \"--requires\") ?? \"git,aider\");\n const task = await httpJson(\"/tasks\", {\n method: \"POST\",\n operator: true,\n body: {\n kind: \"agent.run\",\n adapter: \"aider\",\n requires,\n payload: { prompt, model, repo, branch, testCommand },\n },\n });\n\n printJson(task);\n}\n\nasync function submitInference(args: string[]): Promise<void> {\n const model = valueArg(args, \"--model\");\n const prompt = valueArg(args, \"--prompt\");\n if (!model || !prompt) {\n throw new Error(\"--model and --prompt are required\");\n }\n\n const adapter = valueArg(args, \"--adapter\") ?? \"ollama\";\n const requires = parseCsv(valueArg(args, \"--requires\") ?? adapter);\n const inputFile = valueArg(args, \"--input-file\");\n\n const task = await httpJson(\"/tasks\", {\n method: \"POST\",\n operator: true,\n body: {\n kind: \"inference.batch\",\n adapter,\n requires,\n payload: { model, prompt, inputFile },\n },\n });\n\n printJson(task);\n}\n\nasync function submitHarness(args: string[]): Promise<void> {\n const harness = valueArg(args, \"--harness\");\n const prompt = valueArg(args, \"--prompt\");\n const repo = valueArg(args, \"--repo\");\n if (!harness || !prompt || !repo) {\n throw new Error(\"--harness, --prompt, and --repo are required\");\n }\n\n if (harness !== \"codex\" && harness !== \"claude-code\") {\n throw new Error(\"--harness must be codex or claude-code\");\n }\n\n const model = valueArg(args, \"--model\");\n const branch = valueArg(args, \"--branch\");\n const testCommand = valueArg(args, \"--test-command\");\n const interactive = args.includes(\"--interactive\") || undefined;\n const requires = parseCsv(valueArg(args, \"--requires\") ?? `${harness},git`);\n\n const task = await httpJson(\"/tasks\", {\n method: \"POST\",\n operator: true,\n body: {\n kind: \"agent.run\",\n adapter: harness,\n requires,\n payload: { prompt, repo, model, branch, testCommand, interactive },\n },\n });\n\n printJson(task);\n}\n\nasync function main(): Promise<void> {\n const [command, subcommand, ...rest] = process.argv.slice(2);\n\n if (!command) {\n usage();\n return;\n }\n\n if (command === \"server\" && subcommand === \"start\") {\n process.stdout.write(\"Use: pnpm dev:server\\n\");\n return;\n }\n\n if (command === \"node\" && subcommand === \"start\") {\n process.stdout.write(\"Use: pnpm dev:node\\n\");\n return;\n }\n\n if (command === \"task\" && subcommand === \"submit\") {\n const adapter = rest[0];\n const adapterArgs = rest.slice(1);\n if (adapter === \"shell\") {\n await submitShell(adapterArgs);\n return;\n }\n if (adapter === \"aider\") {\n await submitAider(adapterArgs);\n return;\n }\n if (adapter === \"inference\") {\n await submitInference(adapterArgs);\n return;\n }\n if (adapter === \"harness\") {\n await submitHarness(adapterArgs);\n return;\n }\n throw new Error(`unsupported adapter submit: ${adapter}`);\n }\n\n if (command === \"tasks\") {\n const status = valueArg([subcommand, ...rest].filter(Boolean) as string[], \"--status\");\n const tasks = await httpJson(status ? `/tasks?status=${encodeURIComponent(status)}` : \"/tasks\");\n printJson(tasks);\n return;\n }\n\n if (command === \"task\" && subcommand === \"show\") {\n const taskId = rest[0];\n if (!taskId) {\n throw new Error(\"task id is required\");\n }\n const task = await httpJson(`/tasks/${taskId}`);\n printJson(task);\n return;\n }\n\n if (command === \"task\" && subcommand === \"retry\") {\n const taskId = rest[0];\n if (!taskId) {\n throw new Error(\"task id is required\");\n }\n const task = await httpJson(`/tasks/${taskId}/retry`, { method: \"POST\", operator: true });\n printJson(task);\n return;\n }\n\n if (command === \"task\" && subcommand === \"logs\") {\n const taskId = rest[0];\n if (!taskId) {\n throw new Error(\"task id is required\");\n }\n await showLogsById(taskId);\n return;\n }\n\n if (command === \"task\" && subcommand === \"cancel\") {\n const taskId = rest[0];\n if (!taskId) {\n throw new Error(\"task id is required\");\n }\n const task = await httpJson(`/tasks/${taskId}/cancel`, { method: \"POST\", operator: true });\n printJson(task);\n return;\n }\n\n if (command === \"runs\") {\n const taskId = valueArg(rest, \"--task-id\");\n const status = valueArg(rest, \"--status\");\n const query = new URLSearchParams();\n if (taskId) {\n query.set(\"taskId\", taskId);\n }\n if (status) {\n query.set(\"status\", status);\n }\n const runs = await httpJson(query.size > 0 ? `/runs?${query.toString()}` : \"/runs\");\n printJson(runs);\n return;\n }\n\n if (command === \"run\" && subcommand === \"input\") {\n const runId = rest[0];\n if (!runId) {\n throw new Error(\"run id is required\");\n }\n const inputArgs = rest.slice(1);\n const stdinData = valueArg(inputArgs, \"--stdin\");\n const signal = valueArg(inputArgs, \"--signal\");\n const resize = valueArg(inputArgs, \"--resize\");\n\n let body: Record<string, unknown>;\n if (stdinData !== undefined) {\n body = { kind: \"stdin\", payload: { data: stdinData } };\n } else if (signal !== undefined) {\n if (signal !== \"SIGTERM\" && signal !== \"SIGKILL\" && signal !== \"SIGINT\") {\n throw new Error(\"--signal must be SIGTERM, SIGKILL, or SIGINT\");\n }\n body = { kind: \"signal\", payload: { signal } };\n } else if (resize !== undefined) {\n const match = /^(\\d+)x(\\d+)$/.exec(resize);\n if (!match) {\n throw new Error(\"--resize must be in COLSxROWS format, e.g. 220x50\");\n }\n body = { kind: \"resize\", payload: { cols: Number(match[1]), rows: Number(match[2]) } };\n } else {\n throw new Error(\"one of --stdin, --signal, or --resize is required\");\n }\n\n const result = await httpJson(`/runs/${runId}/input`, { method: \"POST\", operator: true, body });\n printJson(result);\n return;\n }\n\n if (command === \"run\" && subcommand === \"show\") {\n const runId = rest[0];\n if (!runId) {\n throw new Error(\"run id is required\");\n }\n const run = await httpJson(`/runs/${runId}`);\n printJson(run);\n return;\n }\n\n if (command === \"logs\") {\n const id = subcommand;\n if (!id) {\n throw new Error(\"run id or task id is required\");\n }\n await showLogsById(id);\n return;\n }\n\n if (command === \"artifacts\") {\n const runId = subcommand;\n if (!runId) {\n throw new Error(\"run id is required\");\n }\n const artifacts = await httpJson(`/runs/${runId}/artifacts`);\n printJson(artifacts);\n return;\n }\n\n if (command === \"skill\" && subcommand === \"list\") {\n const registry = createDefaultRegistry();\n process.stdout.write(\"Available skills:\\n\");\n listSkills(registry);\n return;\n }\n\n if (command === \"skill\" && subcommand === \"run\") {\n const skillName = rest[0];\n if (!skillName) {\n throw new Error(\"skill name is required\");\n }\n const registry = createDefaultRegistry();\n const skill = registry.get(skillName);\n if (!skill) {\n throw new Error(`unknown skill: ${skillName}. Run 'workplane skill list' to see available skills.`);\n }\n\n const optArgs = rest.slice(1);\n const options: Record<string, unknown> = {};\n for (let i = 0; i < optArgs.length - 1; i++) {\n if (optArgs[i].startsWith(\"--\")) {\n options[optArgs[i].slice(2)] = optArgs[i + 1];\n i++;\n }\n }\n\n const plan = skill.buildPlan(options);\n const runner = new SequentialWorkplanRunner();\n const ctx = new LocalWorkplanContext();\n const result = await runner.run(plan, ctx);\n\n if (!result.succeeded) {\n process.stderr.write(`skill '${skillName}' failed at step '${result.steps.at(-1)?.stepId ?? \"unknown\"}'\\n`);\n process.exit(1);\n }\n return;\n }\n\n usage();\n}\n\nmain().catch((error) => {\n process.stderr.write(`${String(error)}\\n`);\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,OAAO,eAAe;AAQtB,eAAsB,iBAAiB,MAA6C;AAClF,QAAM,SAAS,IAAI,UAAU,EAAE,QAAQ,KAAK,UAAU,QAAQ,IAAI,kBAAkB,CAAC;AACrF,QAAM,UAAU,MAAM,OAAO,SAAS,OAAO;AAAA,IAC3C,OAAO,KAAK;AAAA,IACZ,YAAY;AAAA,IACZ,UAAU,CAAC,EAAE,MAAM,QAAQ,SAAS,KAAK,O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