hermes-taskflow 0.2.9

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 heggria
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,447 @@
1
+ <div align="center">
2
+
3
+ <img src="https://raw.githubusercontent.com/heggria/taskflow/main/assets/hero.png" alt="taskflow: compile, verify, and run multi-agent DAGs across six coding-agent hosts" width="100%">
4
+
5
+ <br />
6
+
7
+ [![npm](https://img.shields.io/npm/v/pi-taskflow?style=flat-square&color=7775FF&label=npm)](https://www.npmjs.com/package/pi-taskflow)
8
+ [![CI](https://img.shields.io/github/actions/workflow/status/heggria/taskflow/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/heggria/taskflow/actions/workflows/ci.yml)
9
+ [![Node](https://img.shields.io/badge/node-%E2%89%A522.19-35C99A?style=flat-square)](https://nodejs.org)
10
+ [![License](https://img.shields.io/badge/license-MIT-35C99A?style=flat-square)](https://github.com/heggria/taskflow/blob/main/LICENSE)
11
+ [![Hosts](https://img.shields.io/badge/hosts-6-7775FF?style=flat-square)](#install-on-your-host)
12
+ [![Tests](https://img.shields.io/badge/tests-1%2C500%2B-7775FF?style=flat-square)](#built-to-survive-real-work)
13
+
14
+ **English** · [简体中文](https://github.com/heggria/taskflow/blob/main/README.zh-CN.md)
15
+
16
+ [Install](#install-on-your-host) · [Quickstart](#60-second-start) · [What's new in 0.2.9](#029-hermes-agent--verify-parity) · [0.2 compiler turn](#02-is-the-compiler-turn) · [Docs](https://heggria.github.io/taskflow/en/docs) · [Examples](https://github.com/heggria/taskflow/blob/main/examples)
17
+
18
+ </div>
19
+
20
+ ---
21
+
22
+ # Build multi-agent systems you can inspect before they run.
23
+
24
+ **taskflow turns agent plans into compiled task graphs**: declared once, verified before model spend, executed in isolated subagents, resumed across sessions, replayed without tokens, and recomputed from the smallest stale frontier.
25
+
26
+ It runs on the coding agent you already use:
27
+
28
+ **Pi · Codex · Claude Code · OpenCode · Grok Build · Hermes Agent**
29
+
30
+ ```text
31
+ JSON or .tf.ts
32
+ │
33
+ ▼
34
+ validate ──► Taskflow JSON ──► FlowIR + content hash
35
+ │
36
+ ▼
37
+ isolated DAG runtime
38
+ │
39
+ ┌────────────┼────────────┐
40
+ ▼ ▼ ▼
41
+ resume replay recompute
42
+ ```
43
+
44
+ > Your host receives the final result. Intermediate transcripts stay inside the runtime unless you explicitly inspect them.
45
+
46
+ ## Why taskflow?
47
+
48
+ Built-in subagent tools are excellent for one turn. The moment the work branches, retries, crosses sessions, or needs a quality gate, the plan becomes infrastructure.
49
+
50
+ | | Ad-hoc agents / scripts | **taskflow** |
51
+ |---|---|---|
52
+ | **Plan** | Re-derived from prose or hidden in a script | **An explicit, versionable DAG** |
53
+ | **Before execution** | Discover mistakes while spending | **Verify structure at zero model calls** |
54
+ | **Intermediate output** | Floods the host context | **Stays isolated in the runtime** |
55
+ | **Failure** | Start over or reconstruct state | **Resume from persisted phase state** |
56
+ | **Changed input** | Re-run broadly | **Explain staleness and re-run the affected frontier** |
57
+ | **Portability** | Coupled to one agent | **One JSON contract across six hosts** |
58
+
59
+ The trade is deliberate: less arbitrary orchestration code, more **verifiability, observability, recovery, and reuse**.
60
+
61
+ ## 60-second start
62
+
63
+ Install taskflow on [Pi](https://pi.dev):
64
+
65
+ ```bash
66
+ pi install npm:pi-taskflow
67
+ ```
68
+
69
+ Then ask naturally:
70
+
71
+ > Use taskflow to audit `src/api` in parallel and return one prioritized report.
72
+
73
+ The routing skill uses the same familiar `task` / `tasks` / `chain` shape:
74
+
75
+ ```json
76
+ {
77
+ "chain": [
78
+ { "agent": "scout", "task": "Map the public API under src/api." },
79
+ {
80
+ "agent": "security-reviewer",
81
+ "task": "Audit this surface for missing auth and unsafe input boundaries:\n{previous.output}"
82
+ },
83
+ {
84
+ "agent": "reviewer",
85
+ "task": "Turn these findings into one prioritized report:\n{previous.output}"
86
+ }
87
+ ]
88
+ }
89
+ ```
90
+
91
+ That already gives you an isolated, tracked run. When the job needs real topology, declare the graph:
92
+
93
+ ```json
94
+ {
95
+ "name": "audit-api",
96
+ "args": { "dir": { "default": "src/api" } },
97
+ "concurrency": 4,
98
+ "phases": [
99
+ {
100
+ "id": "discover",
101
+ "type": "agent",
102
+ "agent": "scout",
103
+ "task": "List source files under {args.dir}. Output ONLY a JSON array of {\"path\":\"...\"} objects.",
104
+ "output": "json"
105
+ },
106
+ {
107
+ "id": "audit-each",
108
+ "type": "map",
109
+ "over": "{steps.discover.json}",
110
+ "as": "file",
111
+ "agent": "security-reviewer",
112
+ "task": "Audit {file.path}. Cite evidence and assign severity.",
113
+ "dependsOn": ["discover"]
114
+ },
115
+ {
116
+ "id": "report",
117
+ "type": "reduce",
118
+ "from": ["audit-each"],
119
+ "agent": "reviewer",
120
+ "task": "Synthesize one prioritized report:\n{steps.audit-each.output}",
121
+ "dependsOn": ["audit-each"],
122
+ "final": true
123
+ }
124
+ ]
125
+ }
126
+ ```
127
+
128
+ Save it as `.pi/taskflows/audit-api.json`, then run:
129
+
130
+ ```text
131
+ /tf:audit-api dir=src/api
132
+ ```
133
+
134
+ On Codex, Claude Code, OpenCode, Grok Build, and Hermes Agent, run the same saved definition by name through `taskflow_run`. For long DAGs, use `mode: "background"`, then manage the durable run with `taskflow_runs` (`list` / `status` / `wait` / `cancel`); list output reports active concurrency and can filter `running` or `terminal` runs.
135
+
136
+ [Follow the full quickstart →](https://heggria.github.io/taskflow/en/docs/getting-started)
137
+
138
+ ## See the graph run
139
+
140
+ This is real output from a Pi run—not a mock dashboard:
141
+
142
+ ```text
143
+ ⊗ taskflow self-improve 6/7 · blocked · $0.095
144
+ ✓ discover agent deepseek-v4-flash 10t ↑38k ↓6.7k $0.011
145
+ ┌ ✓ write-runner-tests agent claude-sonnet-4-6 10t ↑13 ↓6.6k $0.020
146
+ ├ ✓ write-store-tests agent claude-sonnet-4-6 10t ↑11 ↓10k $0.018
147
+ ├ ✓ write-agents-tests agent claude-sonnet-4-6 10t ↑28 ↓13k $0.030
148
+ └ ✓ fix-stability agent claude-sonnet-4-6 10t ↑13 ↓3.9k $0.012
149
+ ✓ verify gate BLOCK 3 type errors in test files
150
+ ⊘ report reduce skipped · Gate blocked ↳ fix-stability
151
+ ```
152
+
153
+ The layout **is** the DAG. Parallel rails expose concurrency; long edges expose dependencies; the gate explains why downstream work stopped. No separate control plane is required to understand the run.
154
+
155
+ ## 0.2.9: Hermes Agent + verify parity
156
+
157
+ Taskflow now ships on **Hermes Agent** as `hermes-taskflow`, bringing the same MCP control plane to a sixth host. Hermes children run with an ephemeral home, explicit toolsets, cwd-confined local reads, provider-only credential material, and an explicit opt-in for mutating `--yolo` phases.
158
+
159
+ Pi's advertised `/tf verify <name>` command now matches the tool surface, including saved flow names containing spaces. Project discovery also stops at canonical home/temp boundaries, so ambient `/tmp/.pi` state cannot become a project by accident. [Full 0.2.9 notes →](https://github.com/heggria/taskflow/blob/main/CHANGELOG.md#029--2026-08-11)
160
+
161
+ ## 0.2.8: review, then confirm
162
+
163
+ Pi approvals now separate **selection** from **commit**. Choose Reject, Edit guidance, or Approve with `R` / `E` / `A`, arrows, or Tab; press Enter to confirm. The safe default is Reject, and Escape or Ctrl-C still rejects immediately.
164
+
165
+ Long proposals start collapsed. Press `V` to open an inline scrollable preview while the decision footer stays visible; short proposals remain open by default. Full notes: [CHANGELOG 0.2.8](https://github.com/heggria/taskflow/blob/main/CHANGELOG.md#028--2026-08-10).
166
+
167
+ ## 0.2.7: plan before spend · close the loop
168
+
169
+ The 0.2 line made graphs **compiled and inspectable**. **0.2.7** makes the day-to-day loop feel finished: you can see the plan *before* any model call, and you can hear about the run *after* it finishes — without stuffing transcripts into the host.
170
+
171
+ | Before spend | After spend |
172
+ |---|---|
173
+ | **`taskflow_plan` / `/tf plan`** — bind typed args, project phase order, mark dynamic refs, worst-case agent-call bound | **`hooks.onComplete` / `onFail` / `onBlocked`** — webhook, file, or argv-only command; summary payload only (`taskflow.hook.v1`) |
174
+ | **`verify` / `lint`** still free | **`approval.timeoutMs` + `onExpire`** — HITL no longer waits forever |
175
+ | **`recompute` savings line** — `reused N · rerun M · cutoff K · saved ~P%` | **`taskflow_analytics`** — last-N status, duration, fail/cache rates (read-only) |
176
+
177
+ ```bash
178
+ # Zero tokens: see what would run and how expensive the worst case looks
179
+ # MCP: taskflow_plan · Pi: /tf plan my-flow '{"dir":"src"}'
180
+ ```
181
+
182
+ ```jsonc
183
+ // Optional: fire-and-forget when a background run finishes
184
+ {
185
+ "hooks": {
186
+ "onComplete": [{ "type": "file", "path": ".taskflow/hooks/last-complete.json" }]
187
+ }
188
+ }
189
+ ```
190
+
191
+ MCP hosts now expose **19 tools** (added `taskflow_plan` and `taskflow_analytics`). Starter templates: [`examples/templates/`](https://github.com/heggria/taskflow/blob/main/examples/templates/). Full notes: [CHANGELOG 0.2.7](https://github.com/heggria/taskflow/blob/main/CHANGELOG.md#027--2026-08-06).
192
+
193
+ ## 0.2 is the compiler turn
194
+
195
+ Before 0.2, taskflow executed declarative graphs. Now the graph also has a compile-time frontend, a canonical intermediate representation, an append-only decision trace, offline replay, and incremental recompute.
196
+
197
+ ### Author in JSON or TypeScript
198
+
199
+ JSON remains the portable runtime contract. For larger flows, `taskflow-dsl` adds a compile-time TypeScript authoring layer:
200
+
201
+ ```ts
202
+ import { agent, flow, json, map, reduce } from "taskflow-dsl";
203
+
204
+ export default flow("audit", (ctx) => {
205
+ ctx.budget({ maxUSD: 2 });
206
+
207
+ const files = agent("List files under {args.dir}", {
208
+ agent: "scout",
209
+ output: json<{ path: string }[]>(),
210
+ });
211
+
212
+ const audits = map(files, (file) =>
213
+ agent(`Audit ${file.path}`, { agent: "security-reviewer" }),
214
+ );
215
+
216
+ return reduce(
217
+ [audits],
218
+ (parts) => agent(`Write one report:\n${parts.audits.output}`),
219
+ { final: true },
220
+ );
221
+ });
222
+ ```
223
+
224
+ ```bash
225
+ pnpm add -D taskflow-dsl
226
+ taskflow-dsl check audit.tf.ts
227
+ taskflow-dsl build audit.tf.ts --emit both
228
+ # → audit.taskflow.json + audit.flowir.json
229
+ ```
230
+
231
+ `.tf.ts` is **compile-time only**. Hosts execute the emitted Taskflow JSON; they never interpret TypeScript.
232
+
233
+ ### Compile to a contract you can reason about
234
+
235
+ FlowIR canonicalizes the graph and gives it a content hash. That compiled identity makes provenance and stale analysis inspectable, while the runtime adds content-addressed caching and deterministic tools:
236
+
237
+ | Operation | What it answers | Model calls |
238
+ |---|---|---:|
239
+ | **`plan`** | What will run, which args bind, worst-case agent calls? | **0** |
240
+ | `verify` / `compile` / `lint` | Is the graph structurally safe / lint-clean? | **0** |
241
+ | `ir` | What is the canonical graph and content hash? | **0** |
242
+ | `resume` | What unfinished work remains? (forks a new run; original untouched) | Only unfinished phases |
243
+ | `trace` | What calls and runtime decisions actually happened? | **0** to inspect |
244
+ | `replay` | What if thresholds or budgets had been different? | **0** |
245
+ | `why-stale` | What changed, and what depends on it? | **0** |
246
+ | `recompute` | What is the smallest observable affected frontier? (+ savings line) | Only affected phases |
247
+ | `analytics` | How have recent runs of this flow behaved? | **0** |
248
+
249
+ [Explore the compiler and runtime →](https://heggria.github.io/taskflow/en/docs/compiler-runtime/)
250
+
251
+ ## One runtime, 12 phase types
252
+
253
+ | Family | Phases | Use them for |
254
+ |---|---|---|
255
+ | **Work** | `agent` · `parallel` · `map` · `reduce` · `script` | Single tasks, static fan-out, dynamic fan-out, aggregation, zero-token shell steps |
256
+ | **Control** | `gate` · `approval` · `flow` · `loop` | Quality decisions, human checkpoints, composition, iterative refinement |
257
+ | **Selection** | `tournament` · `race` | Best-of-N quality or first-success latency |
258
+ | **Dynamic graph** | `expand` | Validate and execute a runtime-produced fragment, nested or grafted |
259
+
260
+ Across those phase types, the DSL provides dependencies, conditions, retries, timeouts, output contracts, budgets, workspace isolation, and explicit final-output selection. Each kind accepts only the fields that are safe and meaningful for it; freshness-sensitive phases are excluded from cross-run caching.
261
+
262
+ [Read the phase reference →](https://heggria.github.io/taskflow/en/docs/syntax/phase-types)
263
+
264
+ ## Runtime guarantees, not prompt conventions
265
+
266
+ ### Verify before spend
267
+
268
+ Cycles, dangling dependencies, invalid references, impossible joins, unsafe dynamic fragments, and configuration hazards are rejected or surfaced before the expensive work starts.
269
+
270
+ ### Keep intermediate work out of the host context
271
+
272
+ Agent-running phases execute in isolated subagent processes; control and script phases stay inside the runtime. Upstream outputs are wired into downstream inputs internally. Only `finalOutput` returns to the host unless you explicitly use `peek` or `trace`.
273
+
274
+ ### Survive sessions and failures
275
+
276
+ Phase state is persisted atomically. Resume skips unchanged completed work; detached Pi runs can outlive the initiating session; an idle watchdog terminates stalled subagents.
277
+
278
+ ### Reuse work honestly
279
+
280
+ Within-run resume is content-addressed. Cross-run caching is opt-in and can fingerprint Git commits, files, globs, environment variables, and TTLs. Change one declared input and only its dependents become stale.
281
+
282
+ ### Bound the blast radius
283
+
284
+ Budgets, concurrency caps, retries, timeouts, nesting limits, dynamic-graph breadth caps, path containment, non-idempotent phase classification, and fail-closed approval behavior are runtime semantics—not suggestions in a prompt.
285
+
286
+ ### 0.2.1: safe dynamic cwd and Pi terminal reaping
287
+
288
+ An invocation argument declared as `type: "relative-path"` may select a phase
289
+ working directory with the exact form `cwd: "{args.package}"`. The bridge is
290
+ default-off, requires host `resolve-only` authorization, and confines the
291
+ canonical directory to the invocation root. Absolute paths, concatenation, and
292
+ `{steps.*}` remain rejected; this compatibility bridge is not an OS sandbox.
293
+ Resolve-only writer phases within one invocation are serialized before durable
294
+ lease acquisition, so fan-out cannot self-timeout while separate processes
295
+ remain protected by cross-process leases.
296
+
297
+ Pi child agents no longer inherit ambient extensions by default. Trusted host
298
+ settings can use an explicit extension allowlist or opt back into legacy
299
+ inheritance. If a Pi child produces a validated final answer and terminal event
300
+ but an extension keeps the process alive, Taskflow waits a bounded grace window,
301
+ reaps the process group, and records `completionSource: "terminal-reap"` instead
302
+ of reporting a false timeout.
303
+
304
+ ```json
305
+ {
306
+ "taskflow": {
307
+ "piChild": {
308
+ "resourceProfile": "isolated",
309
+ "extensions": [],
310
+ "terminalGraceMs": 1500
311
+ }
312
+ }
313
+ }
314
+ ```
315
+
316
+ `allowlist` accepts explicit trusted extension files; `inherit` restores ambient
317
+ Pi extension discovery as a compatibility mode. Flows cannot widen this host
318
+ authority.
319
+
320
+ [Read the core concepts →](https://heggria.github.io/taskflow/en/docs/concepts/)
321
+
322
+ ## Install on your host
323
+
324
+ All packages require **Node.js ≥ 22.19.0**.
325
+
326
+ ### Pi
327
+
328
+ ```bash
329
+ pi install npm:pi-taskflow
330
+ ```
331
+
332
+ Pi provides the richest local experience: the `taskflow` tool, `/tf` commands, live DAG rendering, interactive approvals, background runs, and model-role setup.
333
+
334
+ [Pi guide →](https://heggria.github.io/taskflow/en/docs/guides/pi)
335
+
336
+ ### OpenAI Codex
337
+
338
+ ```bash
339
+ codex plugin marketplace add heggria/taskflow
340
+ codex plugin add taskflow@taskflow
341
+ ```
342
+
343
+ [Codex guide →](https://heggria.github.io/taskflow/en/docs/guides/codex)
344
+
345
+ ### Claude Code
346
+
347
+ ```bash
348
+ claude plugin marketplace add heggria/taskflow
349
+ claude plugin install claude-taskflow@taskflow
350
+ ```
351
+
352
+ [Claude Code guide →](https://heggria.github.io/taskflow/en/docs/guides/claude-code)
353
+
354
+ ### OpenCode
355
+
356
+ ```bash
357
+ opencode mcp add taskflow -- \
358
+ npx -y -p opencode-taskflow@0.2.9 opencode-taskflow-mcp
359
+ ```
360
+
361
+ [OpenCode guide →](https://heggria.github.io/taskflow/en/docs/guides/opencode)
362
+
363
+ ### Grok Build
364
+
365
+ ```bash
366
+ grok mcp add taskflow -- \
367
+ npx -y -p grok-taskflow@0.2.9 grok-taskflow-mcp
368
+ ```
369
+
370
+ Grok Build support is new in 0.2. Its CLI stream does not report token/cost usage, so budget-declaring flows are rejected rather than silently running without enforcement.
371
+
372
+ [Grok Build guide →](https://heggria.github.io/taskflow/en/docs/guides/grok-build)
373
+
374
+ ### Hermes Agent
375
+
376
+ ```bash
377
+ hermes mcp add taskflow --command npx --args -y -p hermes-taskflow@0.2.9 hermes-taskflow-mcp
378
+ # Prefer env in config.yaml (not CLI --env after args — can be stuffed into argv):
379
+ # mcp_servers.taskflow.env.PI_TASKFLOW_HERMES_UNSAFE_YOLO: "1" # mutating only
380
+ ```
381
+
382
+ Hermes quiet mode does not report token/cost usage, so budget-declaring flows are rejected rather than silently running without enforcement. Child agents use an ephemeral HERMES_HOME with only non-secret model/fallback routing, a routed-provider-only inference `auth.json`, and provider-allowlisted dotenv keys; parent MCP, skills, memory, sessions, and rules are not inherited. RO local-read → `taskflow_readonly_files`; else `taskflow_model_only` (never omit `-t`).
383
+
384
+ [Hermes guide →](https://github.com/heggria/taskflow/blob/main/docs/hermes-mcp.md)
385
+
386
+
387
+ ## Built to survive real work
388
+
389
+ <div align="center">
390
+
391
+ **10 packages** · **6 hosts** · **12 phase types** · **18 built-in agents** · **1,500+ tests** · **MIT**
392
+
393
+ </div>
394
+
395
+ ```text
396
+ taskflow-core
397
+ ┌──────────────┼───────────────┐
398
+ │ │ │
399
+ taskflow-dsl pi-taskflow taskflow-mcp-core ─┐
400
+ taskflow-hosts ─────┼─ codex-taskflow
401
+ ├─ claude-taskflow
402
+ ├─ opencode-taskflow
403
+ └─ grok-taskflow / hermes-taskflow
404
+ ```
405
+
406
+ `taskflow-core` is host-neutral and imports no host SDK. `taskflow-mcp-core` implements stdio JSON-RPC without an MCP SDK dependency; `taskflow-hosts` owns the shared host process runners. The five MCP delivery packages bind both layers (and core), while Pi keeps its native adapter.
407
+
408
+ The test suite covers orchestration semantics, persistence and file-lock races, cache freshness, path traversal, dynamic graph hardening, cancellation, budgets, all 12 phase kinds, FlowIR/replay/recompute, TypeScript DSL erasure, host argv contracts, MCP servers, and packed consumer imports.
409
+
410
+ ## Documentation
411
+
412
+ | Start here | When you need |
413
+ |---|---|
414
+ | [Getting Started](https://heggria.github.io/taskflow/en/docs/getting-started) | Your first successful run |
415
+ | [Concepts](https://heggria.github.io/taskflow/en/docs/concepts/) | DAGs, isolation, verification, resume, shared context |
416
+ | [Syntax](https://heggria.github.io/taskflow/en/docs/syntax/) | Phase fields, control flow, budgets, caching, scorers |
417
+ | [Compiler & Runtime](https://heggria.github.io/taskflow/en/docs/compiler-runtime/) | TypeScript DSL, FlowIR, replay, recompute, background runs |
418
+ | [Host Guides](https://heggria.github.io/taskflow/en/docs/guides/) | Pi, Codex, Claude Code, OpenCode, Grok, and Hermes setup |
419
+ | [Reference](https://heggria.github.io/taskflow/en/docs/reference/) | Commands, shorthand, and exact tool surfaces |
420
+ | [Showcase](https://heggria.github.io/taskflow/en/docs/showcase/) | Real flows and case studies |
421
+ | [0.2.0 Frontier Assessment](https://github.com/heggria/taskflow/blob/main/docs/taskflow-0.2.0-frontier-assessment.zh-CN.md) | Independent, evidence-based technical assessment (Chinese) |
422
+
423
+ Also see [`examples/`](https://github.com/heggria/taskflow/blob/main/examples), the [changelog](https://github.com/heggria/taskflow/blob/main/CHANGELOG.md), and the [release guide](https://github.com/heggria/taskflow/blob/main/RELEASE.md).
424
+
425
+ ## Contributing
426
+
427
+ ```bash
428
+ pnpm install
429
+ pnpm run typecheck
430
+ pnpm test
431
+ pnpm run build
432
+ pnpm run test:pack
433
+ ```
434
+
435
+ Contributions are welcome. Start with [`CONTRIBUTING.md`](https://github.com/heggria/taskflow/blob/main/CONTRIBUTING.md) for the workflow and [`AGENTS.md`](https://github.com/heggria/taskflow/blob/main/AGENTS.md) for architecture and coding conventions.
436
+
437
+ ## License
438
+
439
+ [MIT](https://github.com/heggria/taskflow/blob/main/LICENSE) © [heggria](https://github.com/heggria)
440
+
441
+ <div align="center">
442
+
443
+ **Declare once. Verify first. Recompute only what changed.**
444
+
445
+ [Read the docs](https://heggria.github.io/taskflow/en/docs) · [Try an example](https://github.com/heggria/taskflow/blob/main/examples) · [View releases](https://github.com/heggria/taskflow/releases)
446
+
447
+ </div>
@@ -0,0 +1,13 @@
1
+ /**
2
+ * hermes-taskflow public entry.
3
+ *
4
+ * The Hermes runner lives in `taskflow-hosts`. This package re-exports it so
5
+ * `import { hermesSubagentRunner, buildHermesArgs, ... } from "hermes-taskflow"`
6
+ * works. New code should import directly from `taskflow-hosts`; this re-export
7
+ * exists for a stable delivery surface.
8
+ *
9
+ * The delivery surface (MCP server + bin + Hermes config scaffold) is shipped
10
+ * from this package — see `./mcp/server.ts` and `./mcp/bin.ts`.
11
+ */
12
+ export * from "taskflow-hosts/hermes";
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,uBAAuB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * hermes-taskflow public entry.
3
+ *
4
+ * The Hermes runner lives in `taskflow-hosts`. This package re-exports it so
5
+ * `import { hermesSubagentRunner, buildHermesArgs, ... } from "hermes-taskflow"`
6
+ * works. New code should import directly from `taskflow-hosts`; this re-export
7
+ * exists for a stable delivery surface.
8
+ *
9
+ * The delivery surface (MCP server + bin + Hermes config scaffold) is shipped
10
+ * from this package — see `./mcp/server.ts` and `./mcp/bin.ts`.
11
+ */
12
+ export * from "taskflow-hosts/hermes";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Executable entry for the taskflow MCP server, hermes-bound (the
4
+ * `hermes-taskflow-mcp` bin).
5
+ *
6
+ * Register with Hermes (~/.hermes/config.yaml):
7
+ * mcp_servers:
8
+ * taskflow:
9
+ * command: "npx"
10
+ * args: ["-y", "-p", "hermes-taskflow", "hermes-taskflow-mcp"]
11
+ * env:
12
+ * # PI_TASKFLOW_HERMES_UNSAFE_YOLO: "1" # only if you need mutating agents
13
+ * # PI_TASKFLOW_HERMES_READONLY_WEB: "1" # RO phases may web_extract
14
+ *
15
+ * Prefer writing `env:` in config.yaml. Do not rely on `hermes mcp add … --env`
16
+ * stuffing flags into the node argv list.
17
+ *
18
+ * Or via CLI (no env):
19
+ * hermes mcp add taskflow -- npx -y -p hermes-taskflow hermes-taskflow-mcp
20
+ *
21
+ * From a checkout of this repo (after `pnpm run build`):
22
+ * command: "node"
23
+ * args: ["/abs/path/to/packages/hermes-taskflow/dist/mcp/bin.js"]
24
+ *
25
+ * Hermes then launches this as a stdio MCP server and the taskflow_* tools
26
+ * become available (prefixed mcp_taskflow_*). Each subagent runs as an
27
+ * isolated `hermes chat -q -Q --ignore-rules` session. This file ships compiled to
28
+ * dist/mcp/bin.js, so no `--experimental-strip-types` flag is needed.
29
+ */
30
+ export {};
31
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/mcp/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG"}
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Executable entry for the taskflow MCP server, hermes-bound (the
4
+ * `hermes-taskflow-mcp` bin).
5
+ *
6
+ * Register with Hermes (~/.hermes/config.yaml):
7
+ * mcp_servers:
8
+ * taskflow:
9
+ * command: "npx"
10
+ * args: ["-y", "-p", "hermes-taskflow", "hermes-taskflow-mcp"]
11
+ * env:
12
+ * # PI_TASKFLOW_HERMES_UNSAFE_YOLO: "1" # only if you need mutating agents
13
+ * # PI_TASKFLOW_HERMES_READONLY_WEB: "1" # RO phases may web_extract
14
+ *
15
+ * Prefer writing `env:` in config.yaml. Do not rely on `hermes mcp add … --env`
16
+ * stuffing flags into the node argv list.
17
+ *
18
+ * Or via CLI (no env):
19
+ * hermes mcp add taskflow -- npx -y -p hermes-taskflow hermes-taskflow-mcp
20
+ *
21
+ * From a checkout of this repo (after `pnpm run build`):
22
+ * command: "node"
23
+ * args: ["/abs/path/to/packages/hermes-taskflow/dist/mcp/bin.js"]
24
+ *
25
+ * Hermes then launches this as a stdio MCP server and the taskflow_* tools
26
+ * become available (prefixed mcp_taskflow_*). Each subagent runs as an
27
+ * isolated `hermes chat -q -Q --ignore-rules` session. This file ships compiled to
28
+ * dist/mcp/bin.js, so no `--experimental-strip-types` flag is needed.
29
+ */
30
+ import { startMcpServer } from "./server.js";
31
+ startMcpServer(process.cwd())
32
+ .then(() => process.exit(0))
33
+ .catch((e) => {
34
+ // Never write non-JSON to stdout (it would corrupt the MCP stream); log to
35
+ // stderr and exit non-zero so the client sees the transport drop.
36
+ process.stderr.write(`taskflow mcp server fatal: ${e instanceof Error ? e.stack ?? e.message : String(e)}\n`);
37
+ process.exit(1);
38
+ });
39
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/mcp/bin.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;KAC3B,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KAC3B,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACZ,2EAA2E;IAC3E,kEAAkE;IAClE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The Hermes Agent binding of the host-neutral MCP server (taskflow-mcp-core/server).
3
+ *
4
+ * The protocol layer, tool schemas, and handlers all live in core; this shim
5
+ * only closes the loop for Hermes: every subagent a flow spawns is itself a
6
+ * `hermes chat -q -Q` process (via hermesSubagentRunner). Kept as a module (not
7
+ * just bin.ts) so tests and embedders get the same pre-bound surface the bin runs.
8
+ */
9
+ import type { RpcContext, RpcHandler } from "taskflow-mcp-core/jsonrpc";
10
+ /** Per-call tool handlers with hermes subagent execution bound in. */
11
+ export declare function makeToolHandlers(cwd: string): Record<string, (args: Record<string, unknown>, context?: RpcContext) => Promise<unknown>>;
12
+ /** Full MCP method dispatch table (protocol + tools), hermes-bound. */
13
+ export declare function makeMcpHandlers(cwd: string): Record<string, RpcHandler>;
14
+ /** Start the stdio MCP server. Resolves when the client disconnects. */
15
+ export declare function startMcpServer(cwd?: string): Promise<void>;
16
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAWxE,sEAAsE;AACtE,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,GACT,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAE3F;AAED,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAEvE;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The Hermes Agent binding of the host-neutral MCP server (taskflow-mcp-core/server).
3
+ *
4
+ * The protocol layer, tool schemas, and handlers all live in core; this shim
5
+ * only closes the loop for Hermes: every subagent a flow spawns is itself a
6
+ * `hermes chat -q -Q` process (via hermesSubagentRunner). Kept as a module (not
7
+ * just bin.ts) so tests and embedders get the same pre-bound surface the bin runs.
8
+ */
9
+ import { makeMcpHandlers as coreMakeMcpHandlers, makeToolHandlers as coreMakeToolHandlers, startMcpServer as coreStartMcpServer, } from "taskflow-mcp-core/server";
10
+ import { hermesSubagentRunner } from "taskflow-hosts";
11
+ const HOST_OPTIONS = {
12
+ host: "hermes",
13
+ detachedRunner: {
14
+ module: import.meta.resolve("taskflow-hosts/hermes"),
15
+ exportName: "hermesSubagentRunner",
16
+ },
17
+ };
18
+ /** Per-call tool handlers with hermes subagent execution bound in. */
19
+ export function makeToolHandlers(cwd) {
20
+ return coreMakeToolHandlers(cwd, hermesSubagentRunner, HOST_OPTIONS);
21
+ }
22
+ /** Full MCP method dispatch table (protocol + tools), hermes-bound. */
23
+ export function makeMcpHandlers(cwd) {
24
+ return coreMakeMcpHandlers(cwd, hermesSubagentRunner, HOST_OPTIONS);
25
+ }
26
+ /** Start the stdio MCP server. Resolves when the client disconnects. */
27
+ export function startMcpServer(cwd = process.cwd()) {
28
+ return coreStartMcpServer(hermesSubagentRunner, cwd, HOST_OPTIONS);
29
+ }
30
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACN,eAAe,IAAI,mBAAmB,EACtC,gBAAgB,IAAI,oBAAoB,EACxC,cAAc,IAAI,kBAAkB,GACpC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,YAAY,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,cAAc,EAAE;QACf,MAAM,EAAE,OAAO,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC;QACpD,UAAU,EAAE,sBAAsB;KAClC;CACQ,CAAC;AAEX,sEAAsE;AACtE,MAAM,UAAU,gBAAgB,CAC/B,GAAW;IAEX,OAAO,oBAAoB,CAAC,GAAG,EAAE,oBAAoB,EAAE,YAAY,CAAC,CAAC;AACtE,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,eAAe,CAAC,GAAW;IAC1C,OAAO,mBAAmB,CAAC,GAAG,EAAE,oBAAoB,EAAE,YAAY,CAAC,CAAC;AACrE,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,cAAc,CAAC,GAAG,GAAW,OAAO,CAAC,GAAG,EAAE;IACzD,OAAO,kBAAkB,CAAC,oBAAoB,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;AACpE,CAAC"}