@pipemd-core/pipemd 1.0.0 → 1.0.1
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/CONTRIBUTING.md +73 -0
- package/README.md +174 -419
- package/dist/index.js +3 -3
- package/package.json +6 -2
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Contributing to PipeMD
|
|
2
|
+
|
|
3
|
+
PipeMD is strict TypeScript, **ESM-only** (imports use `.js` extensions, `NodeNext` resolution), built with `tsup`, and targets Node.js 18+.
|
|
4
|
+
|
|
5
|
+
## Build & Test
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install
|
|
9
|
+
pnpm build # Production build → dist/
|
|
10
|
+
pnpm dev # Watch mode — rebuilds on change
|
|
11
|
+
tsc --noEmit # Type-check only
|
|
12
|
+
|
|
13
|
+
pnpm test # Full suite: unit → e2e → bidir → scripts → arch → compose → crew
|
|
14
|
+
pnpm test:unit # reverseInject logic (pure Node, no build needed)
|
|
15
|
+
pnpm test:crew # Crew coordination lifecycle (needs build)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
There is no test framework: unit tests use `node:assert`, e2e tests are Bash scripts with custom assertion helpers in `tests/`.
|
|
19
|
+
|
|
20
|
+
## Source Layout
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
src/
|
|
24
|
+
├── index.ts # CLI entry — Commander program, registers all commands
|
|
25
|
+
├── config.ts # PipeConfig type + DEFAULT_CONFIG
|
|
26
|
+
├── commands/ # One file per command: init, start, stop, restart,
|
|
27
|
+
│ # status, run, refresh, doctor, uninstall, crew
|
|
28
|
+
└── core/
|
|
29
|
+
├── daemon.ts # Daemon loop — pipe mode (mkfifo) + legacy mode (chokidar)
|
|
30
|
+
├── injector.ts # Renders <!-- pmd: --> blocks; reverseInject write-back
|
|
31
|
+
├── cache.ts # Per-source render cache with TTL + invalidation
|
|
32
|
+
├── injection-types.ts # Injection config schema, types, defaults
|
|
33
|
+
├── injection-engine.ts # Rules engine — resolves sources, dedup, truncation
|
|
34
|
+
├── dedup.ts # Per-session dedup — skips unchanged content
|
|
35
|
+
├── detect.ts # Ecosystem auto-detection (Node, Python, Rust, …)
|
|
36
|
+
├── detectHarness.ts # AI-harness detection (Claude Code, OpenCode, …)
|
|
37
|
+
├── crew.ts # Crew ledger, conflict detection, block rendering
|
|
38
|
+
├── hooks.ts # Per-harness hook installers (crew + injection)
|
|
39
|
+
├── actions.ts # start/stop/cleanup logic
|
|
40
|
+
└── logger.ts # File logger → .pipemd/daemon.log
|
|
41
|
+
|
|
42
|
+
scripts/ # Bundled Bash library, by ecosystem & category
|
|
43
|
+
templates/ # Per-ecosystem Markdown templates
|
|
44
|
+
tests/ # e2e-*.sh suites + test-reverse-inject.mjs + fixtures/
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## The Render Pipeline
|
|
48
|
+
|
|
49
|
+
1. `daemon.ts` reads `.pipemd/template.md` and finds `<!-- pmd: name -->` tags.
|
|
50
|
+
2. `injector.ts` runs each tag's command (from `config.commands`) concurrently via `Promise.allSettled`, with a 10s timeout per command.
|
|
51
|
+
3. Rendered blocks replace the tags; `base.md` is prepended with the `<!-- pmd-context -->` separator.
|
|
52
|
+
4. The composed Markdown is served on the named pipe (or written in legacy mode) to every harness's context file.
|
|
53
|
+
5. AI edits flow back: `reverseInject` de-renders `pmd` blocks and persists edits to `base.md` / `template.md`.
|
|
54
|
+
|
|
55
|
+
## Smart Injection Pipeline (Active/Expert Mode)
|
|
56
|
+
|
|
57
|
+
1. Harness hook fires (e.g., Claude Code `PreToolUse:Edit` on `src/foo.ts`)
|
|
58
|
+
2. Hook calls `pmd inject --trigger before-edit --file src/foo.ts`
|
|
59
|
+
3. Injection engine loads rules from `injection.yml`
|
|
60
|
+
4. For each matching rule, runs the source resolver (crew-locks, file-errors, git-context…)
|
|
61
|
+
5. Each resolver reads from the render cache (sub-5ms)
|
|
62
|
+
6. Dedup layer checks: skip if content unchanged since last injection
|
|
63
|
+
7. Payloads printed to stdout → agent sees them as hook output
|
|
64
|
+
8. For after-edit triggers: async validation (eslint + tsc) runs in background, cached for next call
|
|
65
|
+
|
|
66
|
+
## Safety & Edge Cases
|
|
67
|
+
|
|
68
|
+
- **10-Second Timeouts:** No runaway commands hanging the AI. Stalled scripts get killed.
|
|
69
|
+
- **Isolated Rendering:** Built on `Promise.allSettled`. A failing script renders an error in-place; the rest of the document loads fine.
|
|
70
|
+
- **EPIPE Catching:** If an agent closes the stream mid-read, PipeMD catches the disconnect without crashing.
|
|
71
|
+
- **Stale PID Recovery:** `pmd start` detects dead processes, cleans up old pipes, and starts fresh.
|
|
72
|
+
|
|
73
|
+
PRs welcome. See `CLAUDE.md` for conventions and gotchas.
|
package/README.md
CHANGED
|
@@ -1,535 +1,290 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<
|
|
3
|
-
<img src="PipeMD.jpg" alt="PipeMD Banner" width="100%" style="border-radius: 8px; max-width: 800px;" />
|
|
4
|
-
</picture>
|
|
2
|
+
<img src="PipeMD.jpg" alt="PipeMD" width="100%" style="border-radius: 8px; max-width: 800px;" />
|
|
5
3
|
</p>
|
|
6
4
|
|
|
7
5
|
<h1 align="center">PipeMD</h1>
|
|
8
6
|
|
|
9
7
|
<p align="center">
|
|
10
|
-
<strong>
|
|
11
|
-
|
|
8
|
+
<strong>Real-time project context for AI coding agents.</strong><br>
|
|
9
|
+
Zero git churn. Always fresh. Works with any agent.
|
|
12
10
|
</p>
|
|
13
11
|
|
|
14
12
|
<p align="center">
|
|
15
|
-
<a href="
|
|
16
|
-
<a href="
|
|
17
|
-
<
|
|
18
|
-
<
|
|
13
|
+
<a href="https://www.npmjs.com/package/@pipemd-core/pipemd"><img src="https://img.shields.io/npm/v/@pipemd-core/pipemd?style=flat-square" alt="npm"></a>
|
|
14
|
+
<a href="https://opensource.org/licenses/ISC"><img src="https://img.shields.io/badge/license-ISC-purple?style=flat-square" alt="License"></a>
|
|
15
|
+
<img src="https://img.shields.io/badge/node-%3E%3D18-339933?style=flat-square" alt="Node">
|
|
16
|
+
<img src="https://img.shields.io/badge/works_with-Claude%20%7C%20Gemini%20%7C%20OpenCode%20%7C%20Cursor%20%7C%20Aider-orange?style=flat-square" alt="Compatibility">
|
|
19
17
|
</p>
|
|
20
18
|
|
|
21
19
|
---
|
|
22
20
|
|
|
23
|
-
##
|
|
24
|
-
|
|
25
|
-
AI coding agents need to know your current project state (git status, lint errors, TODOs) to be effective.
|
|
26
|
-
Currently, you have two bad options:
|
|
27
|
-
1. **Static Files:** You give the AI a `README.md` or `CONTEXT.md`. It goes stale after your first commit. The AI hallucinates.
|
|
28
|
-
2. **Automated Scripts:** You run a script to update `CONTEXT.md` continuously. Your `git status` is ruined, merge conflicts run rampant, and your file history is a mess.
|
|
29
|
-
|
|
30
|
-
## ⚡ The Solution: PipeMD
|
|
31
|
-
|
|
32
|
-
PipeMD uses a brilliantly simple OS-level trick: **Named Pipes**.
|
|
33
|
-
|
|
34
|
-
It creates an `AGENTS.md` file in your root directory that is actually a `mkfifo` pipe. When your AI agent attempts to read it, PipeMD intercepts the read, executes your bash scripts concurrently, injects real-time project state into a clean template, and streams it straight to the AI.
|
|
35
|
-
|
|
36
|
-
* **Zero Git Churn:** The template is clean. The live output is completely ephemeral.
|
|
37
|
-
* **Always Fresh:** The AI gets up-to-the-millisecond data *only* exactly when it reads.
|
|
38
|
-
* **Secure:** Commands run from your own `config.yml` — no need to grant the AI unsafe terminal execution permissions.
|
|
39
|
-
|
|
40
|
-
But named pipes only solve half the problem: most AI agents read their context file only once at session start, then cache it. PipeMD's **Smart Context Injection** solves this by installing lightweight hooks that inject fresh, scoped context directly into the agent's working memory on every tool call — crew locks before edits, file errors before edits, validation results after edits, and status updates during idle time.
|
|
41
|
-
|
|
42
|
-
PipeMD is a render-on-read daemon that uses OS-level named pipes (mkfifo) to serve real-time project context to
|
|
43
|
-
AI coding agents. The key innovation: the file the AI reads (AGENTS.md or AI_CONTEXT.md) is itself a named pipe --
|
|
44
|
-
when the AI opens it, the daemon intercepts the read, executes all configured shell commands concurrently,
|
|
45
|
-
assembles the output into a Markdown template, prepends any base instructions (from `.pipemd/base.md`), and streams it back.
|
|
46
|
-
|
|
47
|
-
Data flow:
|
|
48
|
-
|
|
49
|
-
The Full Data Flow
|
|
50
|
-
Agent tool call
|
|
51
|
-
→ Harness hook fires (Claude: settings.json entry, OpenCode: plugin handler, Gemini: settings.json entry)
|
|
52
|
-
→ `pmd inject --trigger <X> --file <Y> --session <Z> --format <F>`
|
|
53
|
-
→ `resolveInjections()` in injection-engine.ts
|
|
54
|
-
→ Loads injection.yml config
|
|
55
|
-
→ Gets rules for trigger
|
|
56
|
-
→ For each rule, runs the resolver (crew-status, file-errors, git-context, etc.)
|
|
57
|
-
→ `checkInjectionStatus()` in dedup.ts -- checks `.pipemd/cache/injected/<session>.json`
|
|
58
|
-
→ If "unchanged": skip (no payload returned)
|
|
59
|
-
→ If "new"/"changed": `recordInjection()` -- writes hash to `.pipemd/cache/injected/<session>.json`
|
|
60
|
-
→ Returns `InjectionPayload[]`
|
|
61
|
-
→ `bumpInjectStats()` in statusline-data.ts -- writes `.pipemd/.inject-stats.json`
|
|
62
|
-
→ Output in requested format (plain, claude-hook JSON, gemini JSON)
|
|
63
|
-
→ OpenCode only (plugin side):
|
|
64
|
-
→ Also calls `pushEvent()` which writes `.pipemd/.tui-stats.json`
|
|
65
|
-
→ TUI panel reads `.pipemd/.tui-stats.json` every 2s
|
|
66
|
-
→ `pmd statusline` (called by Claude Code automatically, or Gemini AfterAgent):
|
|
67
|
-
→ Reads `.pipemd/.inject-stats.json`, `.pipemd/.status.json`, `.pipemd/.crew-status.json`
|
|
68
|
-
→ Renders status line to developer
|
|
69
|
-
|
|
70
|
-
.pipemd/base.md (committed, agent's own instructions)
|
|
71
|
-
─────────────────────────────────────────────────────┐
|
|
72
|
-
│
|
|
73
|
-
.pipemd/template.md (committed, static) │
|
|
74
|
-
→ daemon reads tags like <!-- pmd: git-status --> │
|
|
75
|
-
→ runs commands concurrently via Promise.allSettled │
|
|
76
|
-
→ assembles rendered Markdown │
|
|
77
|
-
→ composes: base + "---\n\n<!-- pmd-context -->\n" + rendered template
|
|
78
|
-
→ serves via named pipe (AGENTS.md) on read │
|
|
21
|
+
## TL;DR
|
|
79
22
|
|
|
80
|
-
|
|
23
|
+
AI coding agents need to know your project state — git status, lint errors, TODOs, who else is editing. Static context files go stale. Auto-updated files pollute your git history.
|
|
81
24
|
|
|
82
|
-
|
|
83
|
-
churn. Supports bidirectional write-back — edits above `<!-- pmd-context -->` are saved to `base.md`,
|
|
84
|
-
edits outside `<!-- pmd: -->` blocks in the template section are de-rendered and saved back to `template.md`.
|
|
25
|
+
**PipeMD makes `AGENTS.md` a named pipe.** When your AI reads it, PipeMD intercepts the read, runs your scripts concurrently, and streams live context straight to the agent. Zero files change on disk. The output is completely ephemeral.
|
|
85
26
|
|
|
86
|
-
|
|
87
|
-
file marked read-only (0o444). This causes git churn. Also supports write-back via file watcher.
|
|
27
|
+
---
|
|
88
28
|
|
|
29
|
+
## Quick Start
|
|
89
30
|
|
|
90
|
-
|
|
31
|
+
```bash
|
|
32
|
+
npm install -g @pipemd-core/pipemd
|
|
33
|
+
pmd init # Interactive setup — detects your ecosystem and harness
|
|
34
|
+
pmd start # Spawns the daemon — your AI now gets live context
|
|
35
|
+
```
|
|
91
36
|
|
|
92
|
-
|
|
37
|
+
Or run without installing:
|
|
93
38
|
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
- **🏎️ Concurrent & Fail-Safe:** Data-gathering scripts run concurrently so your AI isn't left waiting. Built-in 10-second timeouts and isolated failures mean one broken script won't crash your entire context stream.
|
|
101
|
-
- **🤖 Smart Scaffolding:** Run `pmd init` and watch it automatically detect your ecosystem (Node, Python, TS, etc.) to scaffold the exact bash scripts you need to hit flow state immediately.
|
|
102
|
-
- **🎯 Smart Context Injection:** Goes beyond render-on-read. Hooks inject fresh, scoped context into your agent's working memory on every tool call — crew locks, file errors, validation results — so the agent always knows the current state even mid-session.
|
|
39
|
+
```bash
|
|
40
|
+
npx @pipemd-core/pipemd init
|
|
41
|
+
npx @pipemd-core/pipemd start
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
> **Bash required.** Windows users: use WSL or Git Bash.
|
|
103
45
|
|
|
104
46
|
---
|
|
105
47
|
|
|
106
|
-
##
|
|
48
|
+
## What Your AI Sees
|
|
107
49
|
|
|
108
|
-
|
|
50
|
+
When your agent reads `AGENTS.md`, it gets a live-rendered Markdown document — not a static file. Here's what that looks like:
|
|
109
51
|
|
|
110
|
-
```
|
|
111
|
-
#
|
|
112
|
-
npm install -g pipemd
|
|
113
|
-
pmd init
|
|
114
|
-
pmd start
|
|
115
|
-
|
|
116
|
-
# Option 2: Run via NPX (No global install required)
|
|
117
|
-
npx pipemd init
|
|
118
|
-
npx pipemd start
|
|
119
|
-
```
|
|
52
|
+
```markdown
|
|
53
|
+
# AI Context — powered by PipeMD
|
|
120
54
|
|
|
121
|
-
>
|
|
55
|
+
> This file refreshes automatically. Content inside `<!-- pmd: -->` blocks
|
|
56
|
+
> is read-only — everything else is yours to edit.
|
|
122
57
|
|
|
123
|
-
|
|
58
|
+
## Architecture
|
|
59
|
+
<!-- pmd: arch -->
|
|
60
|
+
graph TD
|
|
61
|
+
src/index --> chalk
|
|
62
|
+
src/index --> commander
|
|
63
|
+
<!-- /pmd -->
|
|
124
64
|
|
|
125
|
-
|
|
65
|
+
## Project Structure
|
|
66
|
+
<!-- pmd: tree -->
|
|
67
|
+
.
|
|
68
|
+
├── src/
|
|
69
|
+
│ ├── commands/
|
|
70
|
+
│ ├── core/
|
|
71
|
+
│ └── index.ts
|
|
72
|
+
├── tests/
|
|
73
|
+
└── package.json
|
|
74
|
+
<!-- /pmd -->
|
|
126
75
|
|
|
127
|
-
|
|
76
|
+
## Git Status
|
|
77
|
+
<!-- pmd: git-status -->
|
|
78
|
+
## main...origin/main
|
|
79
|
+
M src/index.ts
|
|
80
|
+
?? CONTRIBUTING.md
|
|
81
|
+
<!-- /pmd -->
|
|
128
82
|
|
|
129
|
-
##
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
```text
|
|
134
|
-
┌────────────────────────────────────────────────────────┐
|
|
135
|
-
│ 1. You edit: .pipemd/template.md │
|
|
136
|
-
│ (Clean, committed to Git, your source of truth) │
|
|
137
|
-
│ │
|
|
138
|
-
│ ## Rules │
|
|
139
|
-
│ Never use `any` in TypeScript. │
|
|
140
|
-
│ │
|
|
141
|
-
│ ## Live Diff │
|
|
142
|
-
│ <!-- pmd: diff --> <── PipeMD placeholder │
|
|
143
|
-
└────────────────────────┬───────────────────────────────┘
|
|
144
|
-
│
|
|
145
|
-
(Agent reads AGENTS.md from root)
|
|
146
|
-
│
|
|
147
|
-
┌────────────────────────▼───────────────────────────────┐
|
|
148
|
-
│ 2. PipeMD Daemon (Intercepts read) │
|
|
149
|
-
│ Prepends base.md + separator, renders template... │
|
|
150
|
-
└────────────────────────┬───────────────────────────────┘
|
|
151
|
-
│
|
|
152
|
-
┌────────────────────────▼───────────────────────────────┐
|
|
153
|
-
│ 3. The AI receives: (Streamed instantly) │
|
|
154
|
-
│ │
|
|
155
|
-
│ [Base instructions from .pipemd/base.md] │
|
|
156
|
-
│ │
|
|
157
|
-
│ --- │
|
|
158
|
-
│ │
|
|
159
|
-
│ <!-- pmd-context --> │
|
|
160
|
-
│ │
|
|
161
|
-
│ ## Rules │
|
|
162
|
-
│ Never use `any` in TypeScript. │
|
|
163
|
-
│ │
|
|
164
|
-
│ ## Live Diff │
|
|
165
|
-
│ + const daemon = new PipeMD(); │
|
|
166
|
-
│ - const daemon = null; │
|
|
167
|
-
└────────────────────────────────────────────────────────┘
|
|
83
|
+
## Type Errors
|
|
84
|
+
<!-- pmd: type-check -->
|
|
85
|
+
No type errors
|
|
86
|
+
<!-- /pmd -->
|
|
168
87
|
```
|
|
169
88
|
|
|
170
|
-
|
|
89
|
+
Every block is live. The AI reads up-to-the-millisecond data — no stale context, no hallucinations.
|
|
171
90
|
|
|
172
91
|
---
|
|
173
92
|
|
|
174
|
-
##
|
|
93
|
+
## How It Works
|
|
175
94
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
95
|
+
```
|
|
96
|
+
┌─────────────────────────────────────────────┐
|
|
97
|
+
│ .pipemd/template.md │
|
|
98
|
+
│ Your committed template with pmd: tags │
|
|
99
|
+
│ │
|
|
100
|
+
│ ## Live Diff │
|
|
101
|
+
│ <!-- pmd: diff-stat --> ← placeholder │
|
|
102
|
+
└──────────────────────┬──────────────────────┘
|
|
103
|
+
│
|
|
104
|
+
AI agent reads AGENTS.md from root
|
|
105
|
+
│
|
|
106
|
+
┌──────────────────────▼──────────────────────┐
|
|
107
|
+
│ PipeMD Daemon intercepts the read │
|
|
108
|
+
│ 1. Reads template.md │
|
|
109
|
+
│ 2. Runs all scripts concurrently │
|
|
110
|
+
│ 3. Injects results into pmd: blocks │
|
|
111
|
+
│ 4. Prepends base.md (your custom rules) │
|
|
112
|
+
│ 5. Streams the result to the agent │
|
|
113
|
+
└──────────────────────┬──────────────────────┘
|
|
114
|
+
│
|
|
115
|
+
┌──────────────────────▼──────────────────────┐
|
|
116
|
+
│ The AI receives a complete, live document │
|
|
117
|
+
│ No file written to disk. Zero git churn. │
|
|
118
|
+
└─────────────────────────────────────────────┘
|
|
119
|
+
```
|
|
183
120
|
|
|
184
|
-
|
|
185
|
-
→ Hook fires → "File src/foo.ts: claimed by OpenCode (cr_abc123) 45s ago
|
|
186
|
-
Type-check: 2 errors in this file
|
|
187
|
-
Last edit: you, 2 minutes ago"
|
|
121
|
+
Two operational modes:
|
|
188
122
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
123
|
+
| Mode | Platform | Mechanism |
|
|
124
|
+
|------|----------|-----------|
|
|
125
|
+
| **Pipe Mode** | macOS, Linux, WSL | `mkfifo` named pipes — zero disk writes |
|
|
126
|
+
| **Legacy Mode** | Native Windows | File watcher + read-only output |
|
|
192
127
|
|
|
193
|
-
|
|
194
|
-
→ "Crew: Gemini session joined. Git: 1 new uncommitted file."
|
|
195
|
-
```
|
|
128
|
+
---
|
|
196
129
|
|
|
197
|
-
|
|
130
|
+
## Delivery Modes
|
|
198
131
|
|
|
199
|
-
|
|
132
|
+
PipeMD can deliver context two ways: passively (the AI reads the pipe at session start) or actively (hooks inject scoped context on every tool call).
|
|
200
133
|
|
|
201
134
|
| Mode | How it works | Best for |
|
|
202
135
|
|------|-------------|----------|
|
|
203
|
-
| **
|
|
204
|
-
| **
|
|
136
|
+
| **Passive** | Context rendered to pipe/file. Agent reads at session start. | Cursor, Aider, CI/CD |
|
|
137
|
+
| **Active** | Hooks inject fresh context on every tool call. Zero config. | Claude Code, OpenCode, Gemini CLI |
|
|
205
138
|
| **Expert** | Full control over injection rules via `.pipemd/injection.yml`. | Teams with custom workflows |
|
|
206
139
|
|
|
207
|
-
### What gets injected
|
|
208
|
-
|
|
209
140
|
Active mode injects context at four moments:
|
|
210
141
|
|
|
211
|
-
| Trigger |
|
|
212
|
-
|
|
213
|
-
|
|
|
214
|
-
|
|
|
215
|
-
|
|
|
216
|
-
|
|
|
217
|
-
|
|
218
|
-
All injection is **deduplicated** — unchanged data is skipped, saving tokens. Results are cached with per-source TTL for sub-5ms hook latency.
|
|
142
|
+
| Trigger | What the AI gets |
|
|
143
|
+
|---------|-----------------|
|
|
144
|
+
| Before Read | Crew status — who's working, any conflicts |
|
|
145
|
+
| Before Edit | File-specific: crew locks, lint/type errors, git context |
|
|
146
|
+
| After Edit | Async validation results (lint + type-check on edited file) |
|
|
147
|
+
| On Idle | Crew changes, git delta since last check |
|
|
219
148
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
```yaml
|
|
223
|
-
# .pipemd/injection.yml — customize injection rules
|
|
224
|
-
delivery: expert
|
|
225
|
-
rules:
|
|
226
|
-
before-edit:
|
|
227
|
-
- source: crew-locks
|
|
228
|
-
scope: target-file
|
|
229
|
-
- source: file-errors
|
|
230
|
-
scope: target-file
|
|
231
|
-
max-lines: 5
|
|
232
|
-
after-edit:
|
|
233
|
-
- source: validate-file
|
|
234
|
-
scope: target-file
|
|
235
|
-
async: true
|
|
236
|
-
```
|
|
149
|
+
All injection is deduplicated — unchanged data is skipped, saving tokens.
|
|
237
150
|
|
|
238
151
|
---
|
|
239
152
|
|
|
240
|
-
##
|
|
241
|
-
|
|
242
|
-
PipeMD is designed to stay out of your way.
|
|
153
|
+
## Features
|
|
243
154
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
| `pmd refresh` | **Sync scripts:** Pulls newer bundled scripts into `.pipemd/scripts/`, offers newly added ones (e.g. **Crew Activity**), and rewrites `config.yml`. |
|
|
253
|
-
| `pmd doctor` | **Diagnose:** Checks for `mkfifo`, stale PIDs, missing scripts, and config drift. |
|
|
254
|
-
| `pmd crew` | **Multi-harness coordination:** Register agents, claim files, surface conflicts (see below). |
|
|
255
|
-
| `pmd uninstall` | **Clean removal:** Restores the original context file and strips PipeMD artifacts. |
|
|
155
|
+
- **Universal compatibility** — Claude Code, Gemini CLI, OpenCode, Cursor, Aider. If it can read Markdown, it works.
|
|
156
|
+
- **Architecture maps** — Live Mermaid dependency graphs for 7 ecosystems. The AI gets an instant mental model of your project.
|
|
157
|
+
- **Smart Context Injection** — Hooks deliver scoped, file-specific context on every tool call, not just at session start.
|
|
158
|
+
- **Crew coordination** — Multiple agents working the same repo see each other's file claims and get conflict warnings in real time.
|
|
159
|
+
- **Bidirectional write-back** — AI edits outside `<!-- pmd: -->` blocks persist to disk. The agent can tune its own context.
|
|
160
|
+
- **Prompt cache optimized** — Static rules at the top, volatile data at the bottom. Your LLM prefix cache stays warm.
|
|
161
|
+
- **Non-destructive setup** — Existing `AGENTS.md` content is preserved to `.pipemd/base.md`. Nothing gets overwritten.
|
|
162
|
+
- **Self-improving** — Scripts and templates are plain text in `.pipemd/`. Ask your AI to edit its own context harness.
|
|
256
163
|
|
|
257
164
|
---
|
|
258
165
|
|
|
259
|
-
##
|
|
260
|
-
|
|
261
|
-
When several AI harnesses work the same repo at once (e.g. OpenCode with 8
|
|
262
|
-
sub-agents plus a Claude CLI session), they edit blind to each other. PipeMD
|
|
263
|
-
Crew turns the live context file into a shared awareness layer.
|
|
264
|
-
|
|
265
|
-
The model is **Harness → Coordinator → sub-agents**: one coordinator per
|
|
266
|
-
harness, with PipeMD as the neutral meta-coordinator that renders the union.
|
|
166
|
+
## Commands
|
|
267
167
|
|
|
268
168
|
| Command | Description |
|
|
269
169
|
|---------|-------------|
|
|
270
|
-
| `pmd
|
|
271
|
-
| `pmd
|
|
272
|
-
| `pmd
|
|
273
|
-
| `pmd
|
|
274
|
-
| `pmd
|
|
275
|
-
| `pmd
|
|
276
|
-
| `pmd
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
fired automatically by `pmd crew install-hooks`:
|
|
281
|
-
|
|
282
|
-
| Harness | Events | Wired into |
|
|
283
|
-
|---------|---------|------------|
|
|
284
|
-
| Claude Code | `SessionStart` → join, `PreToolUse` → heartbeat, `PostToolUse` → claim, `SubagentStart/Stop` → worker lifecycle, `SessionEnd` → leave, `statusLine` → live PipeMD statusline | `.claude/settings.json` |
|
|
285
|
-
| OpenCode | `tool.execute.before` → heartbeat, `tool.execute.after` → claim, `session.idle` → keep-alive | `.opencode/plugin/pmd-crew.js` |
|
|
286
|
-
| Gemini CLI | `BeforeTool` → heartbeat, `AfterTool` → claim, `SessionStart`/`AfterAgent` → live PipeMD statusline via hook `systemMessage` (v0.26+) | `.gemini/settings.json` |
|
|
287
|
-
| Cursor / Aider / others | no edit-event API | injected Coordination Protocol text |
|
|
288
|
-
|
|
289
|
-
The crew block (`<!-- pmd: crew -->`) is rendered into every harness's context
|
|
290
|
-
file, so a `⚠️ CONFLICT` — two agents claiming the same file — appears for
|
|
291
|
-
everyone within one broadcast cycle. Add it via `pmd refresh` (select **Crew
|
|
292
|
-
Activity**) or pick it during `pmd init`.
|
|
293
|
-
|
|
294
|
-
**Claude Code statusline.** OpenCode gets a live TUI sidebar panel; Claude Code
|
|
295
|
-
has no pluggable panel, so `install-hooks` instead registers a `statusLine` that
|
|
296
|
-
renders the same dev-side state — daemon up/down, crew session count, passive
|
|
297
|
-
agents, file conflicts, context size, injection counts — on a single line at the
|
|
298
|
-
bottom of the Claude Code UI. It is invoked automatically by the harness on every
|
|
299
|
-
update; a pre-existing custom `statusLine` is never overwritten. Preview it any
|
|
300
|
-
time with `pmd statusline --plain`.
|
|
170
|
+
| `pmd init` | Interactive setup. Detects ecosystem + harnesses, scaffolds everything. Use `--headless` for CI. |
|
|
171
|
+
| `pmd start` | Spawn the daemon. Creates named pipes and serves context on read. |
|
|
172
|
+
| `pmd stop` | Kill the daemon. Removes pipes and cleans up. |
|
|
173
|
+
| `pmd restart` | Stop + start. Reloads config after edits. |
|
|
174
|
+
| `pmd status` | Daemon health: PID, active pipes, recent log lines. |
|
|
175
|
+
| `pmd run` | One-shot render to stdout or file (`-o`). No daemon needed — ideal for CI. |
|
|
176
|
+
| `pmd refresh` | Pull newer bundled scripts. Add newly available blocks without re-init. |
|
|
177
|
+
| `pmd doctor` | Diagnose: `mkfifo`, stale PIDs, missing scripts, config drift. |
|
|
178
|
+
| `pmd crew` | Multi-agent coordination: join, claim files, surface conflicts. See below. |
|
|
179
|
+
| `pmd uninstall` | Clean removal. Restores original context file. |
|
|
301
180
|
|
|
302
181
|
---
|
|
303
182
|
|
|
304
|
-
##
|
|
183
|
+
## What Gets Generated
|
|
305
184
|
|
|
306
|
-
|
|
185
|
+
Everything lives in `.pipemd/`. Your root directory stays clean.
|
|
307
186
|
|
|
308
|
-
```
|
|
187
|
+
```
|
|
309
188
|
your-project/
|
|
310
189
|
├── .pipemd/
|
|
311
|
-
│ ├── config.yml #
|
|
312
|
-
│ ├── base.md #
|
|
313
|
-
│ ├── template.md #
|
|
314
|
-
│ ├──
|
|
315
|
-
│
|
|
316
|
-
│ │ ├──
|
|
317
|
-
│ │ ├──
|
|
190
|
+
│ ├── config.yml # Committed — script definitions + pipe routing
|
|
191
|
+
│ ├── base.md # Committed — your custom AI instructions
|
|
192
|
+
│ ├── template.md # Committed — edit this! Tags + static content
|
|
193
|
+
│ ├── injection.yml # Committed — injection rules (active/expert mode)
|
|
194
|
+
│ ├── scripts/ # Committed — data-gathering scripts by category
|
|
195
|
+
│ │ ├── architecture/ # Mermaid dependency graphs
|
|
196
|
+
│ │ ├── project/ # Tree, deps, TODOs
|
|
197
|
+
│ │ ├── git/ # Git state
|
|
318
198
|
│ │ ├── quality/ # Type checking, linting, tests
|
|
319
|
-
│ │ └── crew/ # Crew coordination
|
|
320
|
-
│ ├──
|
|
321
|
-
│ ├──
|
|
322
|
-
│
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
│ ├── live/ # (Gitignored) Ephemeral named pipes
|
|
326
|
-
│ ├── crew/ # (Gitignored) Per-agent coordination ledger (JSON)
|
|
327
|
-
│ ├── daemon.log # (Gitignored) Daemon activity log
|
|
328
|
-
│ └── .daemon.pid # (Gitignored) Running daemon's PID
|
|
329
|
-
├── AGENTS.md # (Gitignored) 🏴☠️ The Named Pipe. The AI reads this.
|
|
330
|
-
└── .gitignore # Updated automatically by `pmd init`
|
|
199
|
+
│ │ └── crew/ # Crew coordination
|
|
200
|
+
│ ├── cache/ # Gitignored — render cache for injection
|
|
201
|
+
│ ├── live/ # Gitignored — ephemeral named pipes
|
|
202
|
+
│ └── crew/ # Gitignored — per-agent coordination ledger
|
|
203
|
+
├── AGENTS.md # Gitignored — the named pipe your AI reads
|
|
204
|
+
└── .gitignore # Updated automatically by pmd init
|
|
331
205
|
```
|
|
332
206
|
|
|
333
|
-
|
|
334
|
-
> everything your team needs to reproduce the harness, and nothing ephemeral.
|
|
207
|
+
Only `config.yml`, `base.md`, `template.md`, `injection.yml`, and `scripts/` are committed — everything your team needs, nothing ephemeral.
|
|
335
208
|
|
|
336
209
|
---
|
|
337
210
|
|
|
338
|
-
##
|
|
211
|
+
## Configuration
|
|
339
212
|
|
|
340
|
-
|
|
213
|
+
### The Template (`.pipemd/template.md`)
|
|
341
214
|
|
|
342
|
-
|
|
215
|
+
Your source of truth. Use `<!-- pmd: command_name -->` tags where you want live data injected.
|
|
343
216
|
|
|
344
217
|
```markdown
|
|
345
|
-
#
|
|
346
|
-
|
|
347
|
-
> **🤖 PipeMD Context File**
|
|
348
|
-
>
|
|
349
|
-
> This file is maintained by PipeMD. It refreshes automatically.
|
|
350
|
-
>
|
|
351
|
-
> - Content inside `<!-- pmd: -->` blocks is **read-only** — the daemon overwrites it every cycle.
|
|
352
|
-
> - Everything else is **yours to edit**. Edits persist via bidirectional write-back.
|
|
353
|
-
> - Edits above `<!-- pmd-context -->` route to `.pipemd/base.md`. Edits below it route to `.pipemd/template.md`.
|
|
354
|
-
> - For full details, read `.pipemd/AI_SETUP_PIPEMD.md`.
|
|
355
|
-
|
|
356
|
-
## 🏗️ Architecture
|
|
357
|
-
<!-- pmd: arch -->
|
|
358
|
-
```
|
|
218
|
+
# AI Context — powered by PipeMD
|
|
359
219
|
|
|
360
|
-
|
|
220
|
+
## Architecture
|
|
221
|
+
<!-- pmd: arch -->
|
|
361
222
|
<!-- /pmd -->
|
|
362
223
|
|
|
363
|
-
##
|
|
224
|
+
## Project Structure
|
|
364
225
|
<!-- pmd: tree -->
|
|
365
226
|
<!-- /pmd -->
|
|
366
227
|
|
|
367
|
-
## 📝 TODOs
|
|
368
|
-
<!-- pmd: todos -->
|
|
369
|
-
<!-- /pmd -->
|
|
370
|
-
|
|
371
228
|
---
|
|
372
|
-
##
|
|
229
|
+
## Volatile State
|
|
373
230
|
<!-- pmd: diff-stat -->
|
|
374
231
|
<!-- /pmd -->
|
|
375
232
|
```
|
|
376
233
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
---
|
|
234
|
+
Volatile data at the bottom keeps your LLM prompt cache warm.
|
|
380
235
|
|
|
381
|
-
|
|
236
|
+
### Config (`config.yml`)
|
|
382
237
|
|
|
383
|
-
|
|
238
|
+
Connects template tags to the scripts that fetch the data.
|
|
384
239
|
|
|
385
240
|
```yaml
|
|
386
241
|
version: "1.0"
|
|
387
|
-
|
|
388
|
-
# ⚠️ Security Warning: PipeMD executes the commands below exactly as written.
|
|
389
|
-
# Do not run PipeMD in an untrusted repository.
|
|
390
|
-
|
|
391
|
-
# Optional: Base instructions file, prepended to the served context.
|
|
392
|
-
# AI edits to the base section are written back here.
|
|
393
242
|
base: ".pipemd/base.md"
|
|
394
243
|
|
|
395
244
|
commands:
|
|
396
245
|
arch: "bash .pipemd/scripts/architecture/arch.sh"
|
|
397
246
|
tree: "bash .pipemd/scripts/project/tree.sh"
|
|
398
247
|
diff-stat: "bash .pipemd/scripts/git/diff-stat.sh"
|
|
399
|
-
todos: "bash .pipemd/scripts/project/find-todos.sh"
|
|
400
248
|
|
|
401
249
|
pipes:
|
|
402
|
-
- file: "AGENTS.md"
|
|
403
|
-
render: ".pipemd/template.md"
|
|
250
|
+
- file: "AGENTS.md"
|
|
251
|
+
render: ".pipemd/template.md"
|
|
404
252
|
```
|
|
405
253
|
|
|
406
|
-
|
|
407
|
-
Because `.pipemd/scripts/` is committed to git, your whole team gets the exact same context harness. Drop any language script in there (`.sh`, `.py`, `.js`) to pull test results, type-check errors, or database schemas.
|
|
408
|
-
|
|
409
|
-
---
|
|
410
|
-
|
|
411
|
-
## 🤖 For AI Agents
|
|
412
|
-
|
|
413
|
-
If you are an AI agent reading a PipeMD context file, here is the contract:
|
|
414
|
-
|
|
415
|
-
**Reading.** The file you read (`CLAUDE.md`, `AGENTS.md`, …) is a *live render*.
|
|
416
|
-
Prefer the data inside `<!-- pmd: -->` blocks over running your own shell
|
|
417
|
-
commands — it is current as of the moment you opened the file.
|
|
418
|
-
|
|
419
|
-
**Editing.** The file is split by a `<!-- pmd-context -->` separator:
|
|
420
|
-
|
|
421
|
-
| Where you edit | Where it persists | Notes |
|
|
422
|
-
|---|---|---|
|
|
423
|
-
| Above the separator | `.pipemd/base.md` | Your own rules and instructions. |
|
|
424
|
-
| Below it, *outside* `<!-- pmd: -->` blocks | `.pipemd/template.md` | Section headers, notes, checkboxes. |
|
|
425
|
-
| *Inside* a `<!-- pmd: -->` block | **nowhere** | Overwritten every refresh cycle — never edit here. |
|
|
426
|
-
|
|
427
|
-
**Self-improvement.** Because the harness is plain text, you can tune your own
|
|
428
|
-
context: add/remove `<!-- pmd: -->` blocks in `.pipemd/template.md`, change
|
|
429
|
-
which scripts run in `.pipemd/config.yml`, or adjust the token profile. See
|
|
430
|
-
`.pipemd/AI_SETUP_PIPEMD.md` (scaffolded into every project) for the full guide.
|
|
431
|
-
|
|
432
|
-
**Working alongside other agents.** If a **Crew Activity** block is present,
|
|
433
|
-
read it before editing — it lists which files other agents hold. A
|
|
434
|
-
`⚠️ CONFLICT` line means another agent claimed a file you are about to touch;
|
|
435
|
-
treat it as blocking. Announce your own work with `pmd crew claim <file>` and
|
|
436
|
-
`pmd crew note "<task>"` (or let the installed hooks do it automatically).
|
|
437
|
-
|
|
438
|
-
**Smart Injection.** If the project uses Active or Expert delivery mode, PipeMD hooks inject fresh context into your working memory on every tool call. You'll see messages like `[pmd:crew-locks → src/foo.ts]` before edits and `[pmd:validate-file → src/foo.ts]` after edits. This data is:
|
|
439
|
-
|
|
440
|
-
- **Scoped**: you only see context relevant to the file you're about to touch
|
|
441
|
-
- **Deduplicated**: repeated unchanged data is silently skipped
|
|
442
|
-
- **Cache-backed**: hook latency is under 5ms
|
|
254
|
+
> **Security:** PipeMD executes commands from `config.yml` as-is. Do not run in untrusted repositories.
|
|
443
255
|
|
|
444
256
|
---
|
|
445
257
|
|
|
446
|
-
##
|
|
258
|
+
## Crew: Multi-Agent Coordination
|
|
447
259
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
Building a background daemon that streams live data into AI systems requires aggressive safety guardrails. PipeMD includes:
|
|
451
|
-
|
|
452
|
-
* **10-Second Timeouts:** No runaway `grep` commands hanging your AI. If a script stalls, it gets killed.
|
|
453
|
-
* **Isolated Rendering:** Built on `Promise.allSettled`. If your `test-summary.sh` fails, the error is rendered *in-place* inside the markdown file, and the rest of the document loads perfectly.
|
|
454
|
-
* **EPIPE Catching:** If Claude Code closes the stream mid-read to save tokens, PipeMD safely catches the `EPIPE` disconnect without crashing the daemon.
|
|
455
|
-
* **Stale PID Recovery:** If your machine forcefully reboots, `pmd start` instantly detects the dead process, cleans up the old pipes, and starts fresh.
|
|
456
|
-
|
|
457
|
-
---
|
|
458
|
-
|
|
459
|
-
## 🧑💻 For Developers
|
|
460
|
-
|
|
461
|
-
PipeMD is strict TypeScript, **ESM-only** (imports use `.js` extensions,
|
|
462
|
-
`NodeNext` resolution), built with `tsup`, and targets Node.js 18+.
|
|
463
|
-
|
|
464
|
-
### Build & test
|
|
260
|
+
When multiple AI agents work the same repo, PipeMD Crew gives them shared awareness — file claims, conflict detection, and status broadcasts — rendered into every agent's context file.
|
|
465
261
|
|
|
466
262
|
```bash
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
pnpm test # Full suite: unit → e2e → bidir → scripts → arch → compose → crew
|
|
473
|
-
pnpm test:unit # reverseInject logic (pure Node, no build needed)
|
|
474
|
-
pnpm test:crew # Crew coordination lifecycle (needs build)
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
There is no test framework: unit tests use `node:assert`, e2e tests are Bash
|
|
478
|
-
scripts with custom assertion helpers in `tests/`.
|
|
479
|
-
|
|
480
|
-
### Source layout
|
|
481
|
-
|
|
482
|
-
```text
|
|
483
|
-
src/
|
|
484
|
-
├── index.ts # CLI entry — Commander program, registers all commands
|
|
485
|
-
├── config.ts # PipeConfig type + DEFAULT_CONFIG
|
|
486
|
-
├── commands/ # One file per command: init, start, stop, restart,
|
|
487
|
-
│ # status, run, refresh, doctor, uninstall, crew
|
|
488
|
-
└── core/
|
|
489
|
-
├── daemon.ts # Daemon loop — pipe mode (mkfifo) + legacy mode (chokidar)
|
|
490
|
-
├── injector.ts # Renders <!-- pmd: --> blocks; reverseInject write-back
|
|
491
|
-
├── cache.ts # Per-source render cache with TTL + invalidation
|
|
492
|
-
├── injection-types.ts # Injection config schema, types, defaults
|
|
493
|
-
├── injection-engine.ts # Rules engine — resolves sources, dedup, truncation
|
|
494
|
-
├── dedup.ts # Per-session dedup — skips unchanged content
|
|
495
|
-
├── detect.ts # Ecosystem auto-detection (Node, Python, Rust, …)
|
|
496
|
-
├── detectHarness.ts # AI-harness detection (Claude Code, OpenCode, …)
|
|
497
|
-
├── crew.ts # Crew ledger, conflict detection, block rendering
|
|
498
|
-
├── hooks.ts # Per-harness hook installers (crew + injection)
|
|
499
|
-
├── actions.ts # start/stop/cleanup logic
|
|
500
|
-
└── logger.ts # File logger → .pipemd/daemon.log
|
|
501
|
-
|
|
502
|
-
scripts/ # Bundled Bash library, by ecosystem & category
|
|
503
|
-
templates/ # Per-ecosystem Markdown templates
|
|
504
|
-
tests/ # e2e-*.sh suites + test-reverse-inject.mjs + fixtures/
|
|
263
|
+
pmd crew join --role coordinator --label "Claude"
|
|
264
|
+
pmd crew claim src/auth.ts --note "refactoring login"
|
|
265
|
+
pmd crew note "rewriting the auth middleware"
|
|
266
|
+
pmd crew release src/auth.ts
|
|
267
|
+
pmd crew leave
|
|
505
268
|
```
|
|
506
269
|
|
|
507
|
-
|
|
270
|
+
| Command | Description |
|
|
271
|
+
|---------|-------------|
|
|
272
|
+
| `pmd crew join` | Register this agent (`--role`, `--label`) |
|
|
273
|
+
| `pmd crew claim <file>` | Mark files as being worked on |
|
|
274
|
+
| `pmd crew release <file>` | Release claims (`--all` for everything) |
|
|
275
|
+
| `pmd crew note "<text>"` | Post current task/status |
|
|
276
|
+
| `pmd crew status` | Show live crew tree |
|
|
277
|
+
| `pmd crew leave` | Deregister this agent |
|
|
278
|
+
| `pmd crew install-hooks` | Auto-wire harness hooks for self-reporting |
|
|
508
279
|
|
|
509
|
-
|
|
510
|
-
2. `injector.ts` runs each tag's command (from `config.commands`) concurrently
|
|
511
|
-
via `Promise.allSettled`, with a 10 s timeout per command.
|
|
512
|
-
3. Rendered blocks replace the tags; `base.md` is prepended with the
|
|
513
|
-
`<!-- pmd-context -->` separator.
|
|
514
|
-
4. The composed Markdown is served on the named pipe (or written in legacy mode)
|
|
515
|
-
to every harness's context file.
|
|
516
|
-
5. AI edits flow back: `reverseInject` de-renders `pmd` blocks and persists
|
|
517
|
-
edits to `base.md` / `template.md`.
|
|
280
|
+
Crew hooks are available for Claude Code, OpenCode, and Gemini CLI — agents automatically report their activity without manual commands.
|
|
518
281
|
|
|
519
|
-
|
|
282
|
+
---
|
|
520
283
|
|
|
521
|
-
|
|
522
|
-
2. Hook calls `pmd inject --trigger before-edit --file src/foo.ts`
|
|
523
|
-
3. Injection engine loads rules from `injection.yml`
|
|
524
|
-
4. For each matching rule, runs the source resolver (crew-locks, file-errors, git-context...)
|
|
525
|
-
5. Each resolver reads from the render cache (sub-5ms)
|
|
526
|
-
6. Dedup layer checks: skip if content unchanged since last injection
|
|
527
|
-
7. Payloads printed to stdout → agent sees them as hook output
|
|
528
|
-
8. For after-edit triggers: async validation (eslint + tsc) runs in background, cached for next call
|
|
284
|
+
## Contributing
|
|
529
285
|
|
|
530
|
-
|
|
531
|
-
full specification.
|
|
286
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for build instructions, source layout, and architecture details.
|
|
532
287
|
|
|
533
|
-
##
|
|
288
|
+
## License
|
|
534
289
|
|
|
535
|
-
|
|
290
|
+
ISC License — see [LICENSE](./LICENSE).
|
package/dist/index.js
CHANGED
|
@@ -1828,7 +1828,6 @@ function generateConfigYml(config) {
|
|
|
1828
1828
|
return lines.join("\n");
|
|
1829
1829
|
}
|
|
1830
1830
|
function generateTemplate(agent, selectedScripts) {
|
|
1831
|
-
const agentLabel = agent === "Generic" ? "AI assistant" : agent;
|
|
1832
1831
|
const sorted = [...selectedScripts].sort((a, b) => a.volatile - b.volatile);
|
|
1833
1832
|
const stableScripts = sorted.filter((s) => s.volatile <= 2);
|
|
1834
1833
|
const volatileScripts = sorted.filter((s) => s.volatile > 2);
|
|
@@ -1838,7 +1837,7 @@ function generateTemplate(agent, selectedScripts) {
|
|
|
1838
1837
|
\`\`\`
|
|
1839
1838
|
<!-- /pmd -->`;
|
|
1840
1839
|
const sections = [];
|
|
1841
|
-
sections.push(`# \u{1F3F4}\u200D\u2620\uFE0F
|
|
1840
|
+
sections.push(`# \u{1F3F4}\u200D\u2620\uFE0F Context \u2014 powered by PipeMD
|
|
1842
1841
|
|
|
1843
1842
|
> **\u{1F916} PipeMD Context File**
|
|
1844
1843
|
>
|
|
@@ -1946,6 +1945,7 @@ function scaffoldProject(ecosystem, selectedIds, profile) {
|
|
|
1946
1945
|
mkdirp(path11.join(SCRIPTS_DIR, "api"));
|
|
1947
1946
|
mkdirp(path11.join(SCRIPTS_DIR, "frontend"));
|
|
1948
1947
|
mkdirp(path11.join(SCRIPTS_DIR, "devops"));
|
|
1948
|
+
mkdirp(path11.join(SCRIPTS_DIR, "crew"));
|
|
1949
1949
|
const ecoEnv = `PMD_ECOSYSTEM=${ecosystem.replace(/\//g, "-")}`;
|
|
1950
1950
|
const profileEnv = `PMD_TOKEN_PROFILE=${profile}`;
|
|
1951
1951
|
const commands = {};
|
|
@@ -6627,7 +6627,7 @@ function formatHelp() {
|
|
|
6627
6627
|
}
|
|
6628
6628
|
program.name("pmd").description(
|
|
6629
6629
|
"PipeMD \u2014 The Dynamic Context Harness for AI Coding Agents"
|
|
6630
|
-
).version("1.0.
|
|
6630
|
+
).version("1.0.1").configureHelp({ visibleCommands: () => [] }).addHelpText("after", formatHelp());
|
|
6631
6631
|
program.addCommand(initCommand);
|
|
6632
6632
|
program.addCommand(startCommand);
|
|
6633
6633
|
program.addCommand(stopCommand);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipemd-core/pipemd",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "The Dynamic Context Harness for AI Coding Agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"AI_SETUP_PIPEMD.md",
|
|
31
31
|
"README.md",
|
|
32
32
|
"LICENSE",
|
|
33
|
-
"CHANGELOG.md"
|
|
33
|
+
"CHANGELOG.md",
|
|
34
|
+
"CONTRIBUTING.md"
|
|
34
35
|
],
|
|
35
36
|
"author": "PipeMD Contributors",
|
|
36
37
|
"license": "ISC",
|
|
@@ -64,5 +65,8 @@
|
|
|
64
65
|
"@types/prompts": "^2.4.9",
|
|
65
66
|
"tsup": "^8.5.1",
|
|
66
67
|
"typescript": "^6.0.3"
|
|
68
|
+
},
|
|
69
|
+
"pnpm": {
|
|
70
|
+
"onlyBuiltDependencies": ["esbuild"]
|
|
67
71
|
}
|
|
68
72
|
}
|