@diegopetrucci/pi-extensions 0.1.76 → 0.1.79
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 +8 -8
- package/extensions/agent-workflow-audit/README.md +1 -1
- package/extensions/agent-workflow-audit/index.ts +275 -59
- package/extensions/agent-workflow-audit/package.json +1 -1
- package/extensions/annotate-git-diff/git.ts +0 -8
- package/extensions/annotate-git-diff/glimpseui.d.ts +5 -65
- package/extensions/annotate-git-diff/package.json +1 -1
- package/extensions/annotate-last-message/glimpseui.d.ts +5 -65
- package/extensions/annotate-last-message/package.json +1 -1
- package/extensions/annotate-last-message/web/index.html +3 -30
- package/extensions/code-reviewer/README.md +5 -5
- package/extensions/code-reviewer/index.ts +252 -82
- package/extensions/code-reviewer/package.json +1 -1
- package/extensions/confirm-destructive/index.ts +2 -8
- package/extensions/confirm-destructive/package.json +1 -1
- package/extensions/context-cap/README.md +9 -9
- package/extensions/context-cap/index.ts +3 -3
- package/extensions/context-cap/package.json +2 -2
- package/extensions/context-inspector/index.ts +2 -46
- package/extensions/context-inspector/package.json +1 -1
- package/extensions/contrarian/README.md +4 -3
- package/extensions/contrarian/index.ts +48 -67
- package/extensions/contrarian/package.json +1 -1
- package/extensions/dirty-repo-guard/index.ts +0 -4
- package/extensions/dirty-repo-guard/package.json +1 -1
- package/extensions/dynamic-context-pruning/README.md +20 -11
- package/extensions/dynamic-context-pruning/index.ts +118 -341
- package/extensions/dynamic-context-pruning/package.json +1 -1
- package/extensions/fast/README.md +18 -11
- package/extensions/fast/index.ts +9 -5
- package/extensions/fast/package.json +1 -1
- package/extensions/git-footer/index.ts +2 -16
- package/extensions/git-footer/package.json +1 -1
- package/extensions/inline-bash/index.ts +0 -16
- package/extensions/inline-bash/package.json +1 -1
- package/extensions/librarian/README.md +1 -1
- package/extensions/librarian/index.ts +246 -70
- package/extensions/librarian/package.json +1 -1
- package/extensions/minimal-footer/README.md +5 -5
- package/extensions/minimal-footer/index.ts +5 -26
- package/extensions/minimal-footer/minimal-footer.example.json +1 -1
- package/extensions/minimal-footer/openai-usage.ts +2 -11
- package/extensions/minimal-footer/package.json +1 -1
- package/extensions/oracle/README.md +4 -3
- package/extensions/oracle/index.ts +46 -65
- package/extensions/oracle/package.json +1 -1
- package/extensions/permission-gate/README.md +3 -0
- package/extensions/permission-gate/index.ts +127 -36
- package/extensions/permission-gate/package.json +1 -1
- package/extensions/project-mcp-json/README.md +2 -2
- package/extensions/project-mcp-json/package.json +1 -1
- package/extensions/quiet-tools/.pi-fleet-tested-version +1 -1
- package/extensions/quiet-tools/README.md +30 -19
- package/extensions/quiet-tools/index.ts +233 -166
- package/extensions/quiet-tools/package.json +2 -2
- package/extensions/review/README.md +2 -0
- package/extensions/review/package.json +1 -1
- package/extensions/todo/index.ts +0 -19
- package/extensions/todo/package.json +1 -1
- package/extensions/triage-comments/README.md +4 -2
- package/extensions/triage-comments/index.ts +344 -39
- package/extensions/triage-comments/package.json +1 -1
- package/package.json +4 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A pi extension that provides `/fast` and `/ultrafast` toggles for supported direct OpenAI API, OpenAI Codex, and Anthropic Claude models. It selects the provider-specific Fast-mode request shape from the currently selected model.
|
|
4
4
|
|
|
5
|
-
For eligible direct OpenAI API models it injects:
|
|
5
|
+
For eligible direct OpenAI API-key models it injects:
|
|
6
6
|
|
|
7
7
|
```json
|
|
8
8
|
{
|
|
@@ -10,6 +10,14 @@ For eligible direct OpenAI API models it injects:
|
|
|
10
10
|
}
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
For eligible direct OpenAI ChatGPT OAuth models it injects:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"service_tier": "priority"
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
13
21
|
For eligible OpenAI Codex OAuth models it injects:
|
|
14
22
|
|
|
15
23
|
```json
|
|
@@ -39,16 +47,15 @@ Direct OpenAI API Fast mode requires all of the following:
|
|
|
39
47
|
- Provider `openai`.
|
|
40
48
|
- API `openai-responses` or `openai-completions`.
|
|
41
49
|
- Model `gpt-6.1-sol`, `gpt-6-astra`, `gpt-6-sol`, or `gpt-6-luna`.
|
|
42
|
-
- API-key auth
|
|
50
|
+
- API-key auth sets `service_tier: "fast"`; Pi's `openai` ChatGPT OAuth sets `priority`.
|
|
43
51
|
- No existing `service_tier` field in the request payload.
|
|
44
52
|
|
|
45
|
-
The direct OpenAI route stays on OpenAI's direct API contract
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
and request payloads, not live or paid provider calls.
|
|
53
|
+
The direct OpenAI route stays on OpenAI's direct API contract but selects the tier by auth
|
|
54
|
+
type. OAuth uses `priority` because its endpoint rejected `fast`; acceptance or application
|
|
55
|
+
of `priority` on Pi's OAuth endpoint has not been live-verified. This direct route is never
|
|
56
|
+
forwarded to legacy `openai-codex` or its subscription-usage endpoint. The request shape is
|
|
57
|
+
support evidence, not certification; tests use mocked eligibility and payloads only, with
|
|
58
|
+
no live or paid provider calls.
|
|
52
59
|
|
|
53
60
|
### Ultrafast support (initial, fail-closed)
|
|
54
61
|
|
|
@@ -143,13 +150,13 @@ Optional global config:
|
|
|
143
150
|
~/<pi-config-dir>/agent/extensions/fast.json
|
|
144
151
|
```
|
|
145
152
|
|
|
146
|
-
Optional project config:
|
|
153
|
+
Optional project config, from the nearest ancestor of the working directory (the working directory itself counts):
|
|
147
154
|
|
|
148
155
|
```text
|
|
149
156
|
<project>/<pi-config-dir>/fast.json
|
|
150
157
|
```
|
|
151
158
|
|
|
152
|
-
Here `<pi-config-dir>` is Pi's runtime config directory name (`CONFIG_DIR_NAME`; `.pi` by default).
|
|
159
|
+
Here `<pi-config-dir>` is Pi's runtime config directory name (`CONFIG_DIR_NAME`; `.pi` by default). The loader uses that nearest ancestor `fast.json`, which overrides global config after Pi reports that the project is trusted.
|
|
153
160
|
|
|
154
161
|
```json
|
|
155
162
|
{
|
package/extensions/fast/index.ts
CHANGED
|
@@ -155,7 +155,7 @@ function describeMode(state: SessionState): string {
|
|
|
155
155
|
return state.config.enabled ? "on (config default)" : "off (config default)";
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
function getEligibility(ctx: ExtensionContext): Eligibility {
|
|
158
|
+
function getEligibility(ctx: ExtensionContext, includeServiceTier = true): Eligibility {
|
|
159
159
|
const model = ctx.model;
|
|
160
160
|
if (!model) {
|
|
161
161
|
return { eligible: false, modelKey: "no-model", reason: "no model is selected" };
|
|
@@ -237,7 +237,11 @@ function getEligibility(ctx: ExtensionContext): Eligibility {
|
|
|
237
237
|
eligible: true,
|
|
238
238
|
modelKey: key,
|
|
239
239
|
provider: "openai",
|
|
240
|
-
serviceTier:
|
|
240
|
+
serviceTier: includeServiceTier
|
|
241
|
+
? ctx.modelRegistry.isUsingOAuth(model)
|
|
242
|
+
? OPENAI_FAST_SERVICE_TIER
|
|
243
|
+
: OPENAI_API_FAST_SERVICE_TIER
|
|
244
|
+
: undefined,
|
|
241
245
|
};
|
|
242
246
|
}
|
|
243
247
|
|
|
@@ -328,7 +332,7 @@ function updateStatus(ctx: ExtensionContext, state: SessionState): void {
|
|
|
328
332
|
return;
|
|
329
333
|
}
|
|
330
334
|
|
|
331
|
-
const eligibility = getEligibility(ctx);
|
|
335
|
+
const eligibility = getEligibility(ctx, false);
|
|
332
336
|
ctx.ui.setStatus(EXTENSION_ID, isFastEnabled(state) && eligibility.eligible ? "fast" : undefined);
|
|
333
337
|
}
|
|
334
338
|
|
|
@@ -346,7 +350,7 @@ function getStatusMessage(ctx: ExtensionContext, state: SessionState): string {
|
|
|
346
350
|
}
|
|
347
351
|
|
|
348
352
|
const enabled = isFastEnabled(state);
|
|
349
|
-
const eligibility = getEligibility(ctx);
|
|
353
|
+
const eligibility = getEligibility(ctx, enabled);
|
|
350
354
|
const active = enabled && eligibility.eligible;
|
|
351
355
|
|
|
352
356
|
if (active) {
|
|
@@ -405,7 +409,7 @@ async function injectAnthropicFastHeader(
|
|
|
405
409
|
hasActiveTools: boolean,
|
|
406
410
|
): Promise<void> {
|
|
407
411
|
if (state.ultrafast || !isFastEnabled(state)) return;
|
|
408
|
-
const eligibility = getEligibility(ctx);
|
|
412
|
+
const eligibility = getEligibility(ctx, false);
|
|
409
413
|
if (!eligibility.eligible || eligibility.provider !== "anthropic") return;
|
|
410
414
|
|
|
411
415
|
const matchingKeys = Object.keys(headers).filter(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diegopetrucci/pi-fast",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "A pi extension that enables Fast mode for supported direct OpenAI API, OpenAI Codex, and Anthropic Claude models based on the currently selected model.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -13,10 +13,6 @@ type GitStatusSnapshot = {
|
|
|
13
13
|
|
|
14
14
|
type PullRequestSnapshot = {
|
|
15
15
|
number?: number | string;
|
|
16
|
-
state?: string;
|
|
17
|
-
isDraft?: boolean;
|
|
18
|
-
url?: string;
|
|
19
|
-
title?: string;
|
|
20
16
|
};
|
|
21
17
|
|
|
22
18
|
type CommandResult = {
|
|
@@ -74,7 +70,7 @@ const GIT_STATUS_ARGS = [
|
|
|
74
70
|
"--porcelain=v2",
|
|
75
71
|
"--branch",
|
|
76
72
|
] as const;
|
|
77
|
-
const GH_PR_VIEW_ARGS = ["pr", "view", "--json", "number
|
|
73
|
+
const GH_PR_VIEW_ARGS = ["pr", "view", "--json", "number"] as const;
|
|
78
74
|
|
|
79
75
|
function createEmptyGitStatus(): GitStatusSnapshot {
|
|
80
76
|
return {
|
|
@@ -202,10 +198,6 @@ function parsePullRequestJson(stdout: string): PullRequestSnapshot | undefined {
|
|
|
202
198
|
if (typeof record.number === "number" || typeof record.number === "string") {
|
|
203
199
|
snapshot.number = record.number;
|
|
204
200
|
}
|
|
205
|
-
if (typeof record.state === "string") snapshot.state = record.state;
|
|
206
|
-
if (typeof record.isDraft === "boolean") snapshot.isDraft = record.isDraft;
|
|
207
|
-
if (typeof record.url === "string") snapshot.url = record.url;
|
|
208
|
-
if (typeof record.title === "string") snapshot.title = record.title;
|
|
209
201
|
return snapshot;
|
|
210
202
|
}
|
|
211
203
|
|
|
@@ -228,13 +220,7 @@ function pullRequestSnapshotsEqual(
|
|
|
228
220
|
left: PullRequestSnapshot | undefined,
|
|
229
221
|
right: PullRequestSnapshot | undefined,
|
|
230
222
|
): boolean {
|
|
231
|
-
return
|
|
232
|
-
left?.number === right?.number &&
|
|
233
|
-
left?.state === right?.state &&
|
|
234
|
-
left?.isDraft === right?.isDraft &&
|
|
235
|
-
left?.url === right?.url &&
|
|
236
|
-
left?.title === right?.title
|
|
237
|
-
);
|
|
223
|
+
return left?.number === right?.number;
|
|
238
224
|
}
|
|
239
225
|
|
|
240
226
|
function defaultRunner(
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inline Bash Extension - expands inline bash commands in user prompts.
|
|
3
|
-
*
|
|
4
|
-
* Start pi with this extension:
|
|
5
|
-
* pi -e ./extensions/inline-bash/index.ts
|
|
6
|
-
*
|
|
7
|
-
* Then type prompts with inline bash:
|
|
8
|
-
* What's in !{pwd}?
|
|
9
|
-
* The current branch is !{git branch --show-current} and status: !{git status --short}
|
|
10
|
-
* My node version is !{node --version}
|
|
11
|
-
*
|
|
12
|
-
* The !{command} patterns are executed and replaced with their trimmed output
|
|
13
|
-
* before the prompt is sent to the agent. Very large expansions are truncated.
|
|
14
|
-
*
|
|
15
|
-
* Note: Regular !command syntax (whole-line bash) is preserved and works as before.
|
|
16
|
-
*/
|
|
17
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
18
2
|
|
|
19
3
|
export default function (pi: ExtensionAPI) {
|
|
@@ -35,7 +35,7 @@ Then reload pi:
|
|
|
35
35
|
## Behavior
|
|
36
36
|
|
|
37
37
|
- Tool name: `librarian`
|
|
38
|
-
- Uses a restricted subagent with `bash` and `
|
|
38
|
+
- Uses a restricted subagent with `bash`, `read`, and any configured MCP tools (MCP tools run without confirmation; may have side effects; use for evidence gathering only; requires host Pi >=1.0.4; older hosts degrade to no MCP, no error); the global `mcp.json` always applies; a project `.pi/mcp.json` is never loaded (the librarian subagent runs in a separate temp workspace)
|
|
39
39
|
- Uses `gh` for GitHub search/API access
|
|
40
40
|
- Uses cached local checkouts only when enabled
|
|
41
41
|
- Toggle cache behavior for future calls with `/librarian-cache on | off | toggle | status`
|