@diegopetrucci/pi-extensions 0.1.57 → 0.1.59

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.
Files changed (102) hide show
  1. package/.pi-fleet-tested-version +1 -1
  2. package/extensions/agent-workflow-audit/.pi-fleet-tested-version +1 -1
  3. package/extensions/agent-workflow-audit/index.ts +8 -1
  4. package/extensions/agent-workflow-audit/package.json +5 -1
  5. package/extensions/annotate-git-diff/.pi-fleet-tested-version +1 -1
  6. package/extensions/annotate-git-diff/package.json +5 -2
  7. package/extensions/annotate-last-message/.pi-fleet-tested-version +1 -1
  8. package/extensions/annotate-last-message/package.json +5 -2
  9. package/extensions/brrr/.pi-fleet-tested-version +1 -1
  10. package/extensions/brrr/README.md +2 -2
  11. package/extensions/brrr/package.json +5 -1
  12. package/extensions/claude-fast/.pi-fleet-tested-version +1 -1
  13. package/extensions/claude-fast/package.json +5 -1
  14. package/extensions/code-reviewer/.pi-fleet-tested-version +1 -1
  15. package/extensions/code-reviewer/index.ts +129 -39
  16. package/extensions/code-reviewer/package.json +5 -1
  17. package/extensions/confirm-destructive/.pi-fleet-tested-version +1 -1
  18. package/extensions/confirm-destructive/README.md +1 -1
  19. package/extensions/confirm-destructive/index.ts +20 -5
  20. package/extensions/confirm-destructive/package.json +5 -1
  21. package/extensions/context-cap/.pi-fleet-tested-version +1 -1
  22. package/extensions/context-cap/package.json +5 -1
  23. package/extensions/context-inspector/.pi-fleet-tested-version +1 -1
  24. package/extensions/context-inspector/package.json +5 -1
  25. package/extensions/contrarian/.pi-fleet-tested-version +1 -1
  26. package/extensions/contrarian/README.md +1 -1
  27. package/extensions/contrarian/index.ts +199 -40
  28. package/extensions/contrarian/package.json +5 -1
  29. package/extensions/dirty-repo-guard/.pi-fleet-tested-version +1 -1
  30. package/extensions/dirty-repo-guard/README.md +1 -1
  31. package/extensions/dirty-repo-guard/package.json +5 -1
  32. package/extensions/dynamic-context-pruning/.pi-fleet-tested-version +1 -1
  33. package/extensions/dynamic-context-pruning/package.json +4 -1
  34. package/extensions/git-footer/.pi-fleet-tested-version +1 -1
  35. package/extensions/git-footer/package.json +5 -1
  36. package/extensions/gnosis/.pi-fleet-tested-version +1 -1
  37. package/extensions/gnosis/package.json +5 -1
  38. package/extensions/illustrations-to-explain-things/.pi-fleet-tested-version +1 -1
  39. package/extensions/illustrations-to-explain-things/package.json +4 -1
  40. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/01-two-breakpoints.webp +0 -0
  41. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/02-minimum-loop.webp +0 -0
  42. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/03-sort-by-purpose.webp +0 -0
  43. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/04-one-fish-many-uses.webp +0 -0
  44. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/05-handoff-path.webp +0 -0
  45. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/06-three-sources.webp +0 -0
  46. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/07-three-content-jobs.webp +0 -0
  47. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/08-handoff-copy-toolbox.webp +0 -0
  48. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/09-common-pits-no-title.webp +0 -0
  49. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/10-information-well.webp +0 -0
  50. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/11-idea-press.webp +0 -0
  51. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/12-content-fermentation.webp +0 -0
  52. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/13-system-bearing.webp +0 -0
  53. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/14-trust-bridge.webp +0 -0
  54. package/extensions/inline-bash/.pi-fleet-tested-version +1 -1
  55. package/extensions/inline-bash/README.md +1 -1
  56. package/extensions/inline-bash/package.json +5 -1
  57. package/extensions/librarian/.pi-fleet-tested-version +1 -1
  58. package/extensions/librarian/index.ts +393 -107
  59. package/extensions/librarian/package.json +5 -1
  60. package/extensions/minimal-footer/.pi-fleet-tested-version +1 -1
  61. package/extensions/minimal-footer/index.ts +2 -5
  62. package/extensions/minimal-footer/openai-usage.ts +58 -11
  63. package/extensions/minimal-footer/package.json +5 -1
  64. package/extensions/notify/.pi-fleet-tested-version +1 -1
  65. package/extensions/notify/README.md +3 -3
  66. package/extensions/notify/package.json +5 -1
  67. package/extensions/openai-fast/.pi-fleet-tested-version +1 -1
  68. package/extensions/openai-fast/package.json +5 -1
  69. package/extensions/oracle/.pi-fleet-tested-version +1 -1
  70. package/extensions/oracle/README.md +1 -1
  71. package/extensions/oracle/index.ts +200 -41
  72. package/extensions/oracle/package.json +5 -1
  73. package/extensions/permission-gate/.pi-fleet-tested-version +1 -1
  74. package/extensions/permission-gate/README.md +1 -1
  75. package/extensions/permission-gate/index.ts +453 -2
  76. package/extensions/permission-gate/package.json +5 -1
  77. package/extensions/quiet-tools/.pi-fleet-tested-version +1 -1
  78. package/extensions/quiet-tools/package.json +5 -1
  79. package/extensions/review/.pi-fleet-tested-version +1 -1
  80. package/extensions/review/index.ts +53 -19
  81. package/extensions/review/package.json +5 -1
  82. package/extensions/todo/.pi-fleet-tested-version +1 -1
  83. package/extensions/todo/README.md +1 -1
  84. package/extensions/todo/package.json +5 -1
  85. package/extensions/triage-comments/.pi-fleet-tested-version +1 -1
  86. package/extensions/triage-comments/index.ts +115 -34
  87. package/extensions/triage-comments/package.json +5 -1
  88. package/package.json +10 -6
  89. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/01-two-breakpoints.png +0 -0
  90. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/02-minimum-loop.png +0 -0
  91. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/03-sort-by-purpose.png +0 -0
  92. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/04-one-fish-many-uses.png +0 -0
  93. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/05-handoff-path.png +0 -0
  94. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/06-three-sources.png +0 -0
  95. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/07-three-content-jobs.png +0 -0
  96. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/08-handoff-copy-toolbox.png +0 -0
  97. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/09-common-pits-no-title.png +0 -0
  98. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/10-information-well.png +0 -0
  99. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/11-idea-press.png +0 -0
  100. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/12-content-fermentation.png +0 -0
  101. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/13-system-bearing.png +0 -0
  102. package/extensions/illustrations-to-explain-things/skills/illustrations-to-explain-things/assets/examples/14-trust-bridge.png +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-librarian",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "A pi GitHub research scout with a toggleable local repo checkout cache under the user's OS cache directory.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -33,5 +33,9 @@
33
33
  "@earendil-works/pi-coding-agent": "*",
34
34
  "@earendil-works/pi-tui": "*",
35
35
  "typebox": "*"
36
+ },
37
+ "type": "module",
38
+ "engines": {
39
+ "node": ">=22.19.0"
36
40
  }
37
41
  }
@@ -1 +1 @@
1
- 0.80.6
1
+ 0.81.1
@@ -2,7 +2,6 @@ import { existsSync, readFileSync } from "node:fs";
2
2
  import { spawn } from "node:child_process";
3
3
  import { basename, dirname, join } from "node:path";
4
4
  import {
5
- AuthStorage,
6
5
  CONFIG_DIR_NAME,
7
6
  getAgentDir,
8
7
  type ExtensionAPI,
@@ -14,7 +13,7 @@ import {
14
13
  formatUsageSummary,
15
14
  isOpenAICodexProvider,
16
15
  type UsageSnapshot,
17
- } from "./openai-usage";
16
+ } from "./openai-usage.ts";
18
17
 
19
18
 
20
19
  const DEFAULT_CONFIG: MinimalFooterConfig = {
@@ -108,7 +107,6 @@ interface MinimalFooterConfig {
108
107
  }
109
108
 
110
109
  type UsageSessionState = {
111
- authStorage: AuthStorage;
112
110
  config: MinimalFooterConfig;
113
111
  snapshot?: UsageSnapshot;
114
112
  lastFetchedAt?: number;
@@ -857,7 +855,7 @@ async function refreshUsageIfNeeded(
857
855
  state.requestRender?.();
858
856
  state.inflight = (async () => {
859
857
  try {
860
- const snapshot = await fetchOpenAICodexUsage(state.authStorage, {
858
+ const snapshot = await fetchOpenAICodexUsage(ctx.modelRegistry, {
861
859
  timeoutMs: config.codexUsage.requestTimeoutMs,
862
860
  });
863
861
  if (snapshot) {
@@ -908,7 +906,6 @@ export default function (pi: ExtensionAPI) {
908
906
 
909
907
  pi.on("session_start", (_event, ctx) => {
910
908
  const state: UsageSessionState = {
911
- authStorage: AuthStorage.create(),
912
909
  config: loadConfig(ctx),
913
910
  loading: false,
914
911
  };
@@ -1,4 +1,6 @@
1
- import { AuthStorage } from "@earendil-works/pi-coding-agent";
1
+ import { readFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { getAgentDir } from "@earendil-works/pi-coding-agent";
2
4
 
3
5
  const PROVIDER_ID = "openai-codex";
4
6
 
@@ -61,10 +63,58 @@ function parseUsageSnapshot(data: WhamUsageResponse): Omit<UsageSnapshot, "fetch
61
63
  };
62
64
  }
63
65
 
64
- function getOAuthAccountId(authStorage: AuthStorage): string | undefined {
65
- const credential = authStorage.get(PROVIDER_ID);
66
- if (!credential || credential.type !== "oauth") return undefined;
67
- const accountId = (credential as { accountId?: unknown }).accountId;
66
+ function isRecord(value: unknown): value is Record<string, unknown> {
67
+ return typeof value === "object" && value !== null;
68
+ }
69
+
70
+ function readStoredProviderCredential(providerId: string): unknown {
71
+ try {
72
+ const data = JSON.parse(readFileSync(join(getAgentDir(), "auth.json"), "utf-8")) as unknown;
73
+ if (!isRecord(data)) return undefined;
74
+ return data[providerId];
75
+ } catch {
76
+ return undefined;
77
+ }
78
+ }
79
+
80
+ async function getAccessToken(authSource: unknown): Promise<string | undefined> {
81
+ if (isRecord(authSource) && typeof authSource.getProviderAuth === "function") {
82
+ const result = await (authSource as {
83
+ getProviderAuth(providerId: string): Promise<unknown>;
84
+ }).getProviderAuth(PROVIDER_ID);
85
+ if (isRecord(result) && isRecord(result.auth) && typeof result.auth.apiKey === "string") {
86
+ return result.auth.apiKey;
87
+ }
88
+ }
89
+
90
+ if (isRecord(authSource) && typeof authSource.getApiKey === "function") {
91
+ const token = await (authSource as {
92
+ getApiKey(providerId: string, options: { includeFallback: boolean }): Promise<unknown>;
93
+ }).getApiKey(PROVIDER_ID, { includeFallback: false });
94
+ return typeof token === "string" ? token : undefined;
95
+ }
96
+
97
+ const credential = readStoredProviderCredential(PROVIDER_ID);
98
+ if (!isRecord(credential) || credential.type !== "oauth") return undefined;
99
+ return typeof credential.access === "string" ? credential.access : undefined;
100
+ }
101
+
102
+ function getOAuthAccountId(authSource: unknown): string | undefined {
103
+ let credential: unknown;
104
+
105
+ if (
106
+ isRecord(authSource) &&
107
+ typeof authSource.getApiKey === "function" &&
108
+ typeof authSource.get === "function"
109
+ ) {
110
+ if (typeof authSource.reload === "function") authSource.reload();
111
+ credential = (authSource as { get(providerId: string): unknown }).get(PROVIDER_ID);
112
+ } else {
113
+ credential = readStoredProviderCredential(PROVIDER_ID);
114
+ }
115
+
116
+ if (!isRecord(credential) || credential.type !== "oauth") return undefined;
117
+ const accountId = credential.accountId;
68
118
  return typeof accountId === "string" && accountId.trim()
69
119
  ? accountId.trim()
70
120
  : undefined;
@@ -96,16 +146,13 @@ export function formatUsageSummary(
96
146
  }
97
147
 
98
148
  export async function fetchOpenAICodexUsage(
99
- authStorage: AuthStorage,
149
+ authSource: unknown,
100
150
  options?: { timeoutMs?: number },
101
151
  ): Promise<UsageSnapshot | undefined> {
102
- const accessToken = await authStorage.getApiKey(PROVIDER_ID, {
103
- includeFallback: false,
104
- });
152
+ const accessToken = await getAccessToken(authSource);
105
153
  if (!accessToken) return undefined;
106
154
 
107
- authStorage.reload();
108
- const accountId = getOAuthAccountId(authStorage);
155
+ const accountId = getOAuthAccountId(authSource);
109
156
  const controller = new AbortController();
110
157
  const timeoutMs = options?.timeoutMs ?? 10_000;
111
158
  const timeout = setTimeout(() => controller.abort(), timeoutMs);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-minimal-footer",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "A minimal custom footer for pi.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -33,5 +33,9 @@
33
33
  "peerDependencies": {
34
34
  "@earendil-works/pi-coding-agent": "*",
35
35
  "@earendil-works/pi-tui": "*"
36
+ },
37
+ "type": "module",
38
+ "engines": {
39
+ "node": ">=22.19.0"
36
40
  }
37
41
  }
@@ -1 +1 @@
1
- 0.80.6
1
+ 0.81.1
@@ -1,8 +1,8 @@
1
1
  # notify
2
2
 
3
- A pi extension that sends notifications when the agent finishes and is waiting for input.
3
+ A pi extension that sends notifications when the agent has fully settled and is waiting for input.
4
4
 
5
- This started from the original `notify.ts` example in [`earendil-works/pi-mono`](https://github.com/earendil-works/pi-mono/blob/main/packages/coding-agent/examples/extensions/notify.ts), but now supports multiple notification channels and JSON configuration.
5
+ This started from the original `notify.ts` example in [`earendil-works/pi`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/examples/extensions/notify.ts), but now supports multiple notification channels and JSON configuration.
6
6
 
7
7
  ## Supported notification channels
8
8
 
@@ -137,7 +137,7 @@ You can also customize the sound backend and options if needed.
137
137
 
138
138
  ## Notes
139
139
 
140
- - Hooks the `agent_end` event.
140
+ - Hooks the `agent_settled` event so automatic retries, compaction retries, and queued follow-ups do not trigger intermediate notifications.
141
141
  - Default message is `Pi` / `Ready for input`.
142
142
  - Terminal, desktop, bell, and sound channels can be enabled independently.
143
143
  - To opt into sound playback, set `channels.sound` to `true`.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-notify",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "A pi extension that sends a notification when the agent is ready for input.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -30,5 +30,9 @@
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@earendil-works/pi-coding-agent": "*"
33
+ },
34
+ "type": "module",
35
+ "engines": {
36
+ "node": ">=22.19.0"
33
37
  }
34
38
  }
@@ -1 +1 @@
1
- 0.80.6
1
+ 0.81.1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-openai-fast",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "A pi extension that enables OpenAI Codex Fast mode for ChatGPT-auth GPT-5.4, GPT-5.5, and GPT-5.6 Codex variants by injecting the priority service tier.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -31,5 +31,9 @@
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@earendil-works/pi-coding-agent": "*"
34
+ },
35
+ "type": "module",
36
+ "engines": {
37
+ "node": ">=22.19.0"
34
38
  }
35
39
  }
@@ -1 +1 @@
1
- 0.80.6
1
+ 0.81.1
@@ -2,7 +2,7 @@
2
2
 
3
3
  ![oracle preview](https://raw.githubusercontent.com/diegopetrucci/pi-extensions/main/assets/oracle-preview.svg)
4
4
 
5
- An Amp-style oracle for [pi](https://github.com/earendil-works/pi-mono).
5
+ An Amp-style oracle for [pi](https://github.com/earendil-works/pi).
6
6
 
7
7
  It adds an `oracle` tool that spins up a separate read-only pi subprocess and sends it to the strongest reasoning model available on the **same provider/subscription** the user is currently using.
8
8