@diegopetrucci/pi-extensions 0.1.74 → 0.1.78
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 +2 -0
- package/README.md +17 -12
- package/extensions/agent-workflow-audit/README.md +1 -1
- package/extensions/agent-workflow-audit/index.ts +1631 -1009
- package/extensions/agent-workflow-audit/package.json +1 -1
- package/extensions/annotate-git-diff/README.md +3 -1
- package/extensions/annotate-git-diff/clipboard.ts +109 -100
- package/extensions/annotate-git-diff/git.ts +846 -768
- package/extensions/annotate-git-diff/glimpseui.d.ts +87 -78
- package/extensions/annotate-git-diff/index.ts +712 -671
- package/extensions/annotate-git-diff/package.json +1 -1
- package/extensions/annotate-git-diff/prompt.ts +45 -45
- package/extensions/annotate-git-diff/quiet-glimpse.ts +161 -155
- package/extensions/annotate-git-diff/review-server.ts +337 -311
- package/extensions/annotate-git-diff/types.ts +132 -132
- package/extensions/annotate-git-diff/ui.ts +27 -27
- package/extensions/annotate-git-diff/watch.ts +74 -74
- package/extensions/annotate-git-diff/web/app.js +1947 -1884
- package/extensions/annotate-git-diff/web/index.html +5 -6
- package/extensions/annotate-last-message/README.md +1 -1
- package/extensions/annotate-last-message/glimpseui.d.ts +87 -78
- package/extensions/annotate-last-message/index.ts +210 -206
- package/extensions/annotate-last-message/package.json +1 -1
- package/extensions/annotate-last-message/prompt.ts +87 -66
- package/extensions/annotate-last-message/quiet-glimpse.ts +161 -155
- package/extensions/annotate-last-message/session.ts +94 -89
- package/extensions/annotate-last-message/theme.ts +199 -193
- package/extensions/annotate-last-message/types.ts +23 -23
- package/extensions/annotate-last-message/ui.ts +27 -25
- package/extensions/annotate-last-message/web/app.js +4 -7
- package/extensions/annotate-last-message/web/index.html +3 -3
- package/extensions/annotate-last-message/web/md-renderer.js +1 -1
- package/extensions/brrr/README.md +1 -1
- package/extensions/brrr/index.ts +213 -191
- package/extensions/brrr/package.json +1 -1
- package/extensions/claude-fast/README.md +5 -79
- package/extensions/claude-fast/index.ts +31 -289
- package/extensions/claude-fast/package.json +2 -3
- package/extensions/code-reviewer/README.md +6 -6
- package/extensions/code-reviewer/index.ts +1825 -1373
- package/extensions/code-reviewer/package.json +1 -1
- package/extensions/confirm-destructive/README.md +1 -1
- package/extensions/confirm-destructive/index.ts +50 -52
- package/extensions/confirm-destructive/package.json +1 -1
- package/extensions/context-cap/README.md +9 -9
- package/extensions/context-cap/index.ts +313 -305
- package/extensions/context-cap/package.json +2 -2
- package/extensions/context-inspector/index.ts +1211 -1064
- package/extensions/context-inspector/package.json +1 -1
- package/extensions/contrarian/README.md +4 -3
- package/extensions/contrarian/index.ts +1863 -1737
- package/extensions/contrarian/package.json +1 -1
- package/extensions/dirty-repo-guard/index.ts +37 -41
- package/extensions/dirty-repo-guard/package.json +1 -1
- package/extensions/dynamic-context-pruning/README.md +11 -43
- package/extensions/dynamic-context-pruning/index.ts +2131 -2105
- package/extensions/dynamic-context-pruning/package.json +1 -1
- package/extensions/fast/README.md +52 -14
- package/extensions/fast/index.ts +513 -317
- package/extensions/fast/package.json +1 -1
- package/extensions/git-footer/README.md +1 -1
- package/extensions/git-footer/index.ts +458 -411
- package/extensions/git-footer/package.json +2 -3
- package/extensions/gnosis/index.ts +180 -130
- package/extensions/gnosis/package.json +1 -1
- package/extensions/inline-bash/index.ts +87 -103
- package/extensions/inline-bash/package.json +1 -1
- package/extensions/librarian/README.md +1 -1
- package/extensions/librarian/index.ts +1877 -1419
- package/extensions/librarian/package.json +1 -1
- package/extensions/minimal-footer/README.md +5 -5
- package/extensions/minimal-footer/index.ts +987 -1012
- package/extensions/minimal-footer/minimal-footer.example.json +1 -1
- package/extensions/minimal-footer/openai-usage.ts +195 -190
- package/extensions/minimal-footer/package.json +1 -1
- package/extensions/notify/index.ts +222 -230
- package/extensions/notify/package.json +1 -1
- package/extensions/openai-fast/README.md +5 -73
- package/extensions/openai-fast/index.ts +32 -272
- package/extensions/openai-fast/package.json +2 -3
- package/extensions/oracle/README.md +4 -3
- package/extensions/oracle/index.ts +1740 -1627
- package/extensions/oracle/package.json +1 -1
- package/extensions/permission-gate/README.md +3 -0
- package/extensions/permission-gate/index.ts +785 -612
- package/extensions/permission-gate/package.json +1 -1
- package/extensions/permission-gate/powershell-safety.ts +840 -793
- package/extensions/project-mcp-json/.pi-fleet-tested-version +1 -0
- package/extensions/project-mcp-json/README.md +199 -0
- package/extensions/project-mcp-json/config.ts +564 -0
- package/extensions/project-mcp-json/index.ts +119 -0
- package/extensions/project-mcp-json/package.json +38 -0
- package/extensions/quiet-tools/.pi-fleet-tested-version +1 -1
- package/extensions/quiet-tools/README.md +30 -19
- package/extensions/quiet-tools/index.ts +376 -291
- package/extensions/quiet-tools/package.json +2 -2
- package/extensions/review/README.md +2 -2
- package/extensions/review/index.ts +1745 -1872
- package/extensions/review/package.json +1 -1
- package/extensions/todo/index.ts +280 -280
- package/extensions/todo/package.json +1 -1
- package/extensions/triage-comments/README.md +6 -4
- package/extensions/triage-comments/index.ts +2620 -1888
- package/extensions/triage-comments/package.json +1 -1
- package/package.json +9 -6
- package/assets/social-preview.png +0 -0
- package/extensions/claude-fast/claude-fast.example.json +0 -4
- package/extensions/openai-fast/openai-fast.example.json +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.0
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# project-mcp-json
|
|
2
|
+
|
|
3
|
+
A pi extension that reads a Claude Code-style `.mcp.json` from the project
|
|
4
|
+
working directory and registers the configured MCP servers with pi via
|
|
5
|
+
`pi.registerMcpServer`.
|
|
6
|
+
|
|
7
|
+
> **Requires Pi 1.0 or later.** The `pi.registerMcpServer` API used by this
|
|
8
|
+
> extension was introduced in Pi 1.0. On older Pi versions the extension loads
|
|
9
|
+
> silently and emits a one-time notice instead of registering any servers.
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
Different AI coding environments use different files to configure MCP servers:
|
|
14
|
+
|
|
15
|
+
| Environment | Config file |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Pi | `~/.pi/agent/mcp.json` (user) and `.pi/mcp.json` (project, trusted) |
|
|
18
|
+
| Claude Code | `.mcp.json` (project root) |
|
|
19
|
+
| Codex | `~/.codex/config.toml` (user) and `.codex/config.toml` (project, trusted) |
|
|
20
|
+
|
|
21
|
+
If your project already has a `.mcp.json` for Claude Code, this extension
|
|
22
|
+
lets Pi use it directly — no duplication required.
|
|
23
|
+
|
|
24
|
+
> **Pi's own `mcp.json` takes precedence by name.** If a server name defined
|
|
25
|
+
> in Pi's own `mcp.json` (`~/.pi/agent/mcp.json` or `.pi/mcp.json`) matches
|
|
26
|
+
> one this extension registers from `.mcp.json`, Pi's own entry wins — the
|
|
27
|
+
> existing server is not replaced and no collision error is raised. This
|
|
28
|
+
> extension is most useful when Pi has no `mcp.json` of its own, or when the
|
|
29
|
+
> server names do not overlap.
|
|
30
|
+
|
|
31
|
+
## Discovery
|
|
32
|
+
|
|
33
|
+
The extension reads **only** `<cwd>/.mcp.json` — it does not walk parent
|
|
34
|
+
directories. If the file is absent the extension is a no-op for that session.
|
|
35
|
+
|
|
36
|
+
## Trust model
|
|
37
|
+
|
|
38
|
+
The extension follows **Pi's project trust semantics** for deciding whether to
|
|
39
|
+
load `.mcp.json`. It treats `.mcp.json` as a trust-requiring project resource,
|
|
40
|
+
mirroring the logic Pi uses for its own `.pi/` config resources.
|
|
41
|
+
|
|
42
|
+
### Decision order (evaluated each session)
|
|
43
|
+
|
|
44
|
+
1. **Project not trusted** (`/trust` has not been granted) → skip silently.
|
|
45
|
+
2. **Project has Pi resources** (e.g. `.pi/mcp.json`, `.pi/extensions/`,
|
|
46
|
+
`.agents/skills/` in the project or an ancestor) → Pi already made a
|
|
47
|
+
genuine trust decision for this project; load `.mcp.json` as well.
|
|
48
|
+
3. **Saved trust decision** — check `~/.pi/agent/trust.json` for the nearest
|
|
49
|
+
ancestor of the project directory:
|
|
50
|
+
- `true` → load.
|
|
51
|
+
- `false` → skip silently.
|
|
52
|
+
4. **`defaultProjectTrust` global setting** (from `~/.pi/agent/settings.json`):
|
|
53
|
+
- `"always"` → load.
|
|
54
|
+
- `"never"` → skip silently.
|
|
55
|
+
- `"ask"` *(default)* → skip; if interactive UI is available, emit one info
|
|
56
|
+
notification: *"Found .mcp.json — run /trust to enable its MCP servers."*
|
|
57
|
+
|
|
58
|
+
### Enabling `.mcp.json` loading
|
|
59
|
+
|
|
60
|
+
The standard way is to run `/trust` inside a Pi session in the project
|
|
61
|
+
directory. This saves `true` for the project path in `trust.json` (step 3
|
|
62
|
+
above) and causes future sessions to load `.mcp.json` automatically.
|
|
63
|
+
|
|
64
|
+
Alternatively, set `defaultProjectTrust` to `"always"` in Pi's global
|
|
65
|
+
settings (step 4) to enable `.mcp.json` loading for all trusted projects.
|
|
66
|
+
|
|
67
|
+
> **Note on `--approve` / one-shot trust flags:** Pi's `--approve` flag is
|
|
68
|
+
> not detectable from within an extension. It grants a one-shot project-trust
|
|
69
|
+
> session but does not write to `trust.json`, so this extension behaves as if
|
|
70
|
+
> no saved decision exists and falls through to step 4. Run `/trust` inside
|
|
71
|
+
> the session to persist the decision.
|
|
72
|
+
|
|
73
|
+
### Parent-directory trust and nearest-ancestor semantics
|
|
74
|
+
|
|
75
|
+
Saved trust decisions in `trust.json` use **nearest-ancestor matching**:
|
|
76
|
+
the extension walks up the directory tree from `cwd` and uses the first
|
|
77
|
+
decision it finds. If you trust a parent directory (via `/trust` →
|
|
78
|
+
*"Trust parent folder"*), all projects under it — including their
|
|
79
|
+
`.mcp.json` files — are loaded by this extension.
|
|
80
|
+
|
|
81
|
+
### Undo / revoke
|
|
82
|
+
|
|
83
|
+
**Reliable persistent denial** means saving an explicit `false` for the
|
|
84
|
+
project path. The most direct way is to run `/trust` inside the project
|
|
85
|
+
and choose *"Do not trust"* — Pi writes `false` for the exact project path
|
|
86
|
+
to `~/.pi/agent/trust.json` and the extension will skip `.mcp.json` even
|
|
87
|
+
if a parent directory is trusted.
|
|
88
|
+
|
|
89
|
+
Other approaches and their limitations:
|
|
90
|
+
|
|
91
|
+
- **Delete the entry (or set it to `null`)** in `trust.json`: this resumes
|
|
92
|
+
nearest-ancestor lookup (step 3), *not* a direct fallback to
|
|
93
|
+
`defaultProjectTrust`. If any ancestor directory has a saved `true`, that
|
|
94
|
+
decision is found first and loading is re-enabled. `defaultProjectTrust`
|
|
95
|
+
(step 4) only applies when the nearest-ancestor walk finds no decision at
|
|
96
|
+
all. Deleting/nulling an entry is therefore *not* a reliable denial when
|
|
97
|
+
any ancestor path is trusted.
|
|
98
|
+
- **Set `defaultProjectTrust` to `"never"`** in `~/.pi/agent/settings.json`:
|
|
99
|
+
this prevents loading only when the nearest-ancestor walk finds no saved
|
|
100
|
+
decision (neither `true` nor `false`). A saved `true` for the project or
|
|
101
|
+
any ancestor takes precedence; use an explicit saved `false` for the
|
|
102
|
+
project path if both coexist.
|
|
103
|
+
- **Manually edit `trust.json`**: `~/.pi/agent/trust.json` is a plain JSON
|
|
104
|
+
object mapping absolute paths to `true`/`false`/`null`. Set the project
|
|
105
|
+
path to `false` to permanently deny; set it to `null` or delete the key
|
|
106
|
+
to resume nearest-ancestor lookup (a trusted parent may then re-enable
|
|
107
|
+
loading). For reliable denial, always save `false` explicitly.
|
|
108
|
+
|
|
109
|
+
## Supported subset
|
|
110
|
+
|
|
111
|
+
The extension maps a subset of Claude Code's `.mcp.json` schema to Pi's
|
|
112
|
+
`McpServerConfig`. Fields and features that are accepted:
|
|
113
|
+
|
|
114
|
+
- **stdio** servers: `command`, `args`, `env`, `cwd`, `timeout`, `description`
|
|
115
|
+
- **http / streamable-http** servers: `url`, `headers`, `oauth`
|
|
116
|
+
(`clientId`, `clientSecret`, `callbackPort`, `callbackUrl`, `scope`),
|
|
117
|
+
`timeout`, `description`
|
|
118
|
+
- `${VAR}` and `${VAR:-default}` environment variable expansion in `command`,
|
|
119
|
+
`args`, `env` values, `cwd`, `url`, `headers` values, and `oauth.clientSecret`
|
|
120
|
+
|
|
121
|
+
Features and fields that are **not** imported:
|
|
122
|
+
|
|
123
|
+
| Skipped feature | Reason |
|
|
124
|
+
|---|---|
|
|
125
|
+
| `sse` server type | Not part of Pi's `McpServerConfig` |
|
|
126
|
+
| `ws` / `websocket` server type | Not part of Pi's `McpServerConfig` |
|
|
127
|
+
| `headersHelper` field | Rejected by strict field allowlist |
|
|
128
|
+
| `auth` field | Rejected by strict field allowlist |
|
|
129
|
+
| Claude Code approvals (`.claude/settings.json`) | Not read; Pi manages its own trust |
|
|
130
|
+
| Claude Code OAuth tokens | Not imported; Pi manages its own OAuth state |
|
|
131
|
+
|
|
132
|
+
Unknown top-level fields cause the individual server entry to be skipped with a
|
|
133
|
+
warning (not the whole file). `sse` and `ws` type strings and `auth`/`headersHelper`
|
|
134
|
+
fields always produce a skip warning.
|
|
135
|
+
|
|
136
|
+
## Secrets caveat
|
|
137
|
+
|
|
138
|
+
Environment variable values in `env` and `headers` are expanded at session
|
|
139
|
+
start and then encoded as literals before being passed to `pi.registerMcpServer`.
|
|
140
|
+
After registration, expanded values may be visible in Pi's `/mcp` panel or
|
|
141
|
+
wherever Pi surfaces server configuration. To reduce secret exposure:
|
|
142
|
+
|
|
143
|
+
- **Prefer environment variables** over literal values in `.mcp.json`.
|
|
144
|
+
The extension expands `${VAR}` at startup but the raw variable name is what
|
|
145
|
+
appears in `.mcp.json` (which is often checked into source control), not
|
|
146
|
+
the value.
|
|
147
|
+
- **Use `headers` for auth tokens** on HTTP servers rather than embedding
|
|
148
|
+
secrets in the URL.
|
|
149
|
+
- Add `.mcp.json` to `.gitignore` if it contains any literal secrets.
|
|
150
|
+
|
|
151
|
+
## Install
|
|
152
|
+
|
|
153
|
+
### Standalone npm package
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
pi install npm:@diegopetrucci/pi-project-mcp-json
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Collection package
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
pi install npm:@diegopetrucci/pi-extensions
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### GitHub package
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
pi install git:github.com/diegopetrucci/pi-extensions
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Then reload pi:
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
/reload
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Example `.mcp.json`
|
|
178
|
+
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"mcpServers": {
|
|
182
|
+
"my-local-tool": {
|
|
183
|
+
"type": "stdio",
|
|
184
|
+
"command": "npx",
|
|
185
|
+
"args": ["-y", "@my-org/my-mcp-server"],
|
|
186
|
+
"env": {
|
|
187
|
+
"API_KEY": "${MY_API_KEY}"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"my-remote-tool": {
|
|
191
|
+
"type": "http",
|
|
192
|
+
"url": "${TOOL_SERVER_URL}",
|
|
193
|
+
"headers": {
|
|
194
|
+
"Authorization": "Bearer ${TOOL_TOKEN}"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
```
|