@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.
Files changed (108) hide show
  1. package/LICENSE +2 -0
  2. package/README.md +17 -12
  3. package/extensions/agent-workflow-audit/README.md +1 -1
  4. package/extensions/agent-workflow-audit/index.ts +1631 -1009
  5. package/extensions/agent-workflow-audit/package.json +1 -1
  6. package/extensions/annotate-git-diff/README.md +3 -1
  7. package/extensions/annotate-git-diff/clipboard.ts +109 -100
  8. package/extensions/annotate-git-diff/git.ts +846 -768
  9. package/extensions/annotate-git-diff/glimpseui.d.ts +87 -78
  10. package/extensions/annotate-git-diff/index.ts +712 -671
  11. package/extensions/annotate-git-diff/package.json +1 -1
  12. package/extensions/annotate-git-diff/prompt.ts +45 -45
  13. package/extensions/annotate-git-diff/quiet-glimpse.ts +161 -155
  14. package/extensions/annotate-git-diff/review-server.ts +337 -311
  15. package/extensions/annotate-git-diff/types.ts +132 -132
  16. package/extensions/annotate-git-diff/ui.ts +27 -27
  17. package/extensions/annotate-git-diff/watch.ts +74 -74
  18. package/extensions/annotate-git-diff/web/app.js +1947 -1884
  19. package/extensions/annotate-git-diff/web/index.html +5 -6
  20. package/extensions/annotate-last-message/README.md +1 -1
  21. package/extensions/annotate-last-message/glimpseui.d.ts +87 -78
  22. package/extensions/annotate-last-message/index.ts +210 -206
  23. package/extensions/annotate-last-message/package.json +1 -1
  24. package/extensions/annotate-last-message/prompt.ts +87 -66
  25. package/extensions/annotate-last-message/quiet-glimpse.ts +161 -155
  26. package/extensions/annotate-last-message/session.ts +94 -89
  27. package/extensions/annotate-last-message/theme.ts +199 -193
  28. package/extensions/annotate-last-message/types.ts +23 -23
  29. package/extensions/annotate-last-message/ui.ts +27 -25
  30. package/extensions/annotate-last-message/web/app.js +4 -7
  31. package/extensions/annotate-last-message/web/index.html +3 -3
  32. package/extensions/annotate-last-message/web/md-renderer.js +1 -1
  33. package/extensions/brrr/README.md +1 -1
  34. package/extensions/brrr/index.ts +213 -191
  35. package/extensions/brrr/package.json +1 -1
  36. package/extensions/claude-fast/README.md +5 -79
  37. package/extensions/claude-fast/index.ts +31 -289
  38. package/extensions/claude-fast/package.json +2 -3
  39. package/extensions/code-reviewer/README.md +6 -6
  40. package/extensions/code-reviewer/index.ts +1825 -1373
  41. package/extensions/code-reviewer/package.json +1 -1
  42. package/extensions/confirm-destructive/README.md +1 -1
  43. package/extensions/confirm-destructive/index.ts +50 -52
  44. package/extensions/confirm-destructive/package.json +1 -1
  45. package/extensions/context-cap/README.md +9 -9
  46. package/extensions/context-cap/index.ts +313 -305
  47. package/extensions/context-cap/package.json +2 -2
  48. package/extensions/context-inspector/index.ts +1211 -1064
  49. package/extensions/context-inspector/package.json +1 -1
  50. package/extensions/contrarian/README.md +4 -3
  51. package/extensions/contrarian/index.ts +1863 -1737
  52. package/extensions/contrarian/package.json +1 -1
  53. package/extensions/dirty-repo-guard/index.ts +37 -41
  54. package/extensions/dirty-repo-guard/package.json +1 -1
  55. package/extensions/dynamic-context-pruning/README.md +11 -43
  56. package/extensions/dynamic-context-pruning/index.ts +2131 -2105
  57. package/extensions/dynamic-context-pruning/package.json +1 -1
  58. package/extensions/fast/README.md +52 -14
  59. package/extensions/fast/index.ts +513 -317
  60. package/extensions/fast/package.json +1 -1
  61. package/extensions/git-footer/README.md +1 -1
  62. package/extensions/git-footer/index.ts +458 -411
  63. package/extensions/git-footer/package.json +2 -3
  64. package/extensions/gnosis/index.ts +180 -130
  65. package/extensions/gnosis/package.json +1 -1
  66. package/extensions/inline-bash/index.ts +87 -103
  67. package/extensions/inline-bash/package.json +1 -1
  68. package/extensions/librarian/README.md +1 -1
  69. package/extensions/librarian/index.ts +1877 -1419
  70. package/extensions/librarian/package.json +1 -1
  71. package/extensions/minimal-footer/README.md +5 -5
  72. package/extensions/minimal-footer/index.ts +987 -1012
  73. package/extensions/minimal-footer/minimal-footer.example.json +1 -1
  74. package/extensions/minimal-footer/openai-usage.ts +195 -190
  75. package/extensions/minimal-footer/package.json +1 -1
  76. package/extensions/notify/index.ts +222 -230
  77. package/extensions/notify/package.json +1 -1
  78. package/extensions/openai-fast/README.md +5 -73
  79. package/extensions/openai-fast/index.ts +32 -272
  80. package/extensions/openai-fast/package.json +2 -3
  81. package/extensions/oracle/README.md +4 -3
  82. package/extensions/oracle/index.ts +1740 -1627
  83. package/extensions/oracle/package.json +1 -1
  84. package/extensions/permission-gate/README.md +3 -0
  85. package/extensions/permission-gate/index.ts +785 -612
  86. package/extensions/permission-gate/package.json +1 -1
  87. package/extensions/permission-gate/powershell-safety.ts +840 -793
  88. package/extensions/project-mcp-json/.pi-fleet-tested-version +1 -0
  89. package/extensions/project-mcp-json/README.md +199 -0
  90. package/extensions/project-mcp-json/config.ts +564 -0
  91. package/extensions/project-mcp-json/index.ts +119 -0
  92. package/extensions/project-mcp-json/package.json +38 -0
  93. package/extensions/quiet-tools/.pi-fleet-tested-version +1 -1
  94. package/extensions/quiet-tools/README.md +30 -19
  95. package/extensions/quiet-tools/index.ts +376 -291
  96. package/extensions/quiet-tools/package.json +2 -2
  97. package/extensions/review/README.md +2 -2
  98. package/extensions/review/index.ts +1745 -1872
  99. package/extensions/review/package.json +1 -1
  100. package/extensions/todo/index.ts +280 -280
  101. package/extensions/todo/package.json +1 -1
  102. package/extensions/triage-comments/README.md +6 -4
  103. package/extensions/triage-comments/index.ts +2620 -1888
  104. package/extensions/triage-comments/package.json +1 -1
  105. package/package.json +9 -6
  106. package/assets/social-preview.png +0 -0
  107. package/extensions/claude-fast/claude-fast.example.json +0 -4
  108. package/extensions/openai-fast/openai-fast.example.json +0 -4
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-agent-workflow-audit",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "A pi extension that runs an isolated repo workflow audit and returns only the final report to the main session.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -20,7 +20,7 @@ Then reload pi:
20
20
 
21
21
  ## Usage
22
22
 
23
- Run `/annotate-git-diff` inside a git repository. The command opens a native review window with:
23
+ Run `/annotate-git-diff` from an interactive pi TUI session inside a git repository. The command opens a native review window with:
24
24
 
25
25
  - Monaco-based diff viewing,
26
26
  - branch diff, per-commit including working tree, and all-files scopes,
@@ -37,6 +37,7 @@ There is no runtime setting or toggle for submit behavior. To restore the prior
37
37
 
38
38
  ## Requirements
39
39
 
40
+ - Interactive pi TUI session.
40
41
  - Run inside a git repository.
41
42
  - Local desktop support for opening a native [Glimpse](https://github.com/mariozechner/glimpse) window.
42
43
  - Packaged Monaco and Tailwind assets from this npm package.
@@ -44,6 +45,7 @@ There is no runtime setting or toggle for submit behavior. To restore the prior
44
45
 
45
46
  ## Troubleshooting
46
47
 
48
+ - `annotate-git-diff requires interactive mode.` → run it from the pi TUI.
47
49
  - `Review failed: Not inside a git repository.` → change into a git repo and rerun `/annotate-git-diff`.
48
50
  - `No reviewable files found.` → make or fetch reviewable changes, then rerun.
49
51
  - `Review failed: Glimpse host not found ...` → the native window runtime is unavailable; reinstall/update the package and rerun from a machine/session that can open native windows.
@@ -5,139 +5,148 @@ const MAX_CLIPBOARD_BYTES = 16 * 1024 * 1024;
5
5
  type ClipboardPlatform = NodeJS.Platform;
6
6
 
7
7
  interface ClipboardCommand {
8
- command: string;
9
- args: string[];
8
+ command: string;
9
+ args: string[];
10
10
  }
11
11
 
12
12
  export interface ClipboardCommandResult {
13
- status: number | null;
14
- signal?: NodeJS.Signals | null;
15
- stdout?: string | Buffer;
16
- stderr?: string | Buffer;
17
- error?: Error;
13
+ status: number | null;
14
+ signal?: NodeJS.Signals | null;
15
+ stdout?: string | Buffer;
16
+ stderr?: string | Buffer;
17
+ error?: Error;
18
18
  }
19
19
 
20
20
  export type ClipboardCommandRunner = (
21
- command: string,
22
- args: string[],
23
- options: { encoding: "utf8"; maxBuffer: number; input?: string },
21
+ command: string,
22
+ args: string[],
23
+ options: { encoding: "utf8"; maxBuffer: number; input?: string },
24
24
  ) => ClipboardCommandResult;
25
25
 
26
26
  interface ClipboardOptions {
27
- platform?: ClipboardPlatform;
28
- runner?: ClipboardCommandRunner;
27
+ platform?: ClipboardPlatform;
28
+ runner?: ClipboardCommandRunner;
29
29
  }
30
30
 
31
- const defaultRunner: ClipboardCommandRunner = (command, args, options) => spawnSync(command, args, options);
31
+ const defaultRunner: ClipboardCommandRunner = (command, args, options) =>
32
+ spawnSync(command, args, options);
32
33
 
33
34
  function clipboardReadCommands(platform: ClipboardPlatform): ClipboardCommand[] {
34
- switch (platform) {
35
- case "darwin":
36
- return [{ command: "pbpaste", args: [] }];
37
- case "win32":
38
- return [
39
- {
40
- command: "powershell.exe",
41
- args: [
42
- "-NoProfile",
43
- "-NonInteractive",
44
- "-Command",
45
- "[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; Get-Clipboard -Raw",
46
- ],
47
- },
48
- ];
49
- case "linux":
50
- return [
51
- { command: "wl-paste", args: ["--type", "text/plain"] },
52
- { command: "xclip", args: ["-selection", "clipboard", "-out"] },
53
- { command: "xsel", args: ["--clipboard", "--output"] },
54
- ];
55
- default:
56
- return [];
57
- }
35
+ switch (platform) {
36
+ case "darwin":
37
+ return [{ command: "pbpaste", args: [] }];
38
+ case "win32":
39
+ return [
40
+ {
41
+ command: "powershell.exe",
42
+ args: [
43
+ "-NoProfile",
44
+ "-NonInteractive",
45
+ "-Command",
46
+ "[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; Get-Clipboard -Raw",
47
+ ],
48
+ },
49
+ ];
50
+ case "linux":
51
+ return [
52
+ { command: "wl-paste", args: ["--type", "text/plain"] },
53
+ { command: "xclip", args: ["-selection", "clipboard", "-out"] },
54
+ { command: "xsel", args: ["--clipboard", "--output"] },
55
+ ];
56
+ default:
57
+ return [];
58
+ }
58
59
  }
59
60
 
60
61
  function clipboardWriteCommands(platform: ClipboardPlatform): ClipboardCommand[] {
61
- switch (platform) {
62
- case "darwin":
63
- return [{ command: "pbcopy", args: [] }];
64
- case "win32":
65
- return [
66
- {
67
- command: "powershell.exe",
68
- args: [
69
- "-NoProfile",
70
- "-NonInteractive",
71
- "-Command",
72
- "[Console]::InputEncoding = [System.Text.Encoding]::UTF8; $text = [Console]::In.ReadToEnd(); Set-Clipboard -Value $text",
73
- ],
74
- },
75
- ];
76
- case "linux":
77
- return [
78
- { command: "wl-copy", args: ["--type", "text/plain"] },
79
- { command: "xclip", args: ["-selection", "clipboard", "-in"] },
80
- { command: "xsel", args: ["--clipboard", "--input"] },
81
- ];
82
- default:
83
- return [];
84
- }
62
+ switch (platform) {
63
+ case "darwin":
64
+ return [{ command: "pbcopy", args: [] }];
65
+ case "win32":
66
+ return [
67
+ {
68
+ command: "powershell.exe",
69
+ args: [
70
+ "-NoProfile",
71
+ "-NonInteractive",
72
+ "-Command",
73
+ "[Console]::InputEncoding = [System.Text.Encoding]::UTF8; $text = [Console]::In.ReadToEnd(); Set-Clipboard -Value $text",
74
+ ],
75
+ },
76
+ ];
77
+ case "linux":
78
+ return [
79
+ { command: "wl-copy", args: ["--type", "text/plain"] },
80
+ { command: "xclip", args: ["-selection", "clipboard", "-in"] },
81
+ { command: "xsel", args: ["--clipboard", "--input"] },
82
+ ];
83
+ default:
84
+ return [];
85
+ }
85
86
  }
86
87
 
87
88
  function commandLabel(command: ClipboardCommand): string {
88
- return [command.command, ...command.args].join(" ");
89
+ return [command.command, ...command.args].join(" ");
89
90
  }
90
91
 
91
92
  function outputToString(value: string | Buffer | undefined): string {
92
- if (value == null) return "";
93
- return typeof value === "string" ? value : value.toString("utf8");
93
+ if (value == null) return "";
94
+ return typeof value === "string" ? value : value.toString("utf8");
94
95
  }
95
96
 
96
- function runClipboardCommand(command: ClipboardCommand, runner: ClipboardCommandRunner, input?: string): string {
97
- const result = runner(command.command, command.args, {
98
- encoding: "utf8",
99
- maxBuffer: MAX_CLIPBOARD_BYTES,
100
- ...(input == null ? {} : { input }),
101
- });
102
- if (result.error) throw result.error;
103
- if (result.status !== 0) {
104
- const stderr = outputToString(result.stderr).trim();
105
- const status = result.status == null ? result.signal || "unknown" : result.status;
106
- throw new Error(`${commandLabel(command)} exited with ${status}${stderr ? `: ${stderr}` : ""}`);
107
- }
108
- return outputToString(result.stdout);
97
+ function runClipboardCommand(
98
+ command: ClipboardCommand,
99
+ runner: ClipboardCommandRunner,
100
+ input?: string,
101
+ ): string {
102
+ const result = runner(command.command, command.args, {
103
+ encoding: "utf8",
104
+ maxBuffer: MAX_CLIPBOARD_BYTES,
105
+ ...(input == null ? {} : { input }),
106
+ });
107
+ if (result.error) throw result.error;
108
+ if (result.status !== 0) {
109
+ const stderr = outputToString(result.stderr).trim();
110
+ const status = result.status == null ? result.signal || "unknown" : result.status;
111
+ throw new Error(`${commandLabel(command)} exited with ${status}${stderr ? `: ${stderr}` : ""}`);
112
+ }
113
+ return outputToString(result.stdout);
109
114
  }
110
115
 
111
- function runFirstAvailable(commands: ClipboardCommand[], runner: ClipboardCommandRunner, input?: string): string {
112
- if (commands.length === 0) {
113
- throw new Error(`System clipboard is unsupported on ${process.platform}.`);
114
- }
115
-
116
- const errors: string[] = [];
117
- for (const command of commands) {
118
- try {
119
- return runClipboardCommand(command, runner, input);
120
- } catch (error) {
121
- const message = error instanceof Error ? error.message : String(error);
122
- errors.push(`${commandLabel(command)}: ${message}`);
123
- }
124
- }
125
- throw new Error(`No system clipboard command succeeded. ${errors.join("; ")}`);
116
+ function runFirstAvailable(
117
+ commands: ClipboardCommand[],
118
+ runner: ClipboardCommandRunner,
119
+ input?: string,
120
+ ): string {
121
+ if (commands.length === 0) {
122
+ throw new Error(`System clipboard is unsupported on ${process.platform}.`);
123
+ }
124
+
125
+ const errors: string[] = [];
126
+ for (const command of commands) {
127
+ try {
128
+ return runClipboardCommand(command, runner, input);
129
+ } catch (error) {
130
+ const message = error instanceof Error ? error.message : String(error);
131
+ errors.push(`${commandLabel(command)}: ${message}`);
132
+ }
133
+ }
134
+ throw new Error(`No system clipboard command succeeded. ${errors.join("; ")}`);
126
135
  }
127
136
 
128
137
  export function readSystemClipboard(options: ClipboardOptions = {}): string {
129
- const platform = options.platform ?? process.platform;
130
- const runner = options.runner ?? defaultRunner;
131
- return runFirstAvailable(clipboardReadCommands(platform), runner);
138
+ const platform = options.platform ?? process.platform;
139
+ const runner = options.runner ?? defaultRunner;
140
+ return runFirstAvailable(clipboardReadCommands(platform), runner);
132
141
  }
133
142
 
134
143
  export function writeSystemClipboard(text: string, options: ClipboardOptions = {}): void {
135
- const platform = options.platform ?? process.platform;
136
- const runner = options.runner ?? defaultRunner;
137
- runFirstAvailable(clipboardWriteCommands(platform), runner, text);
144
+ const platform = options.platform ?? process.platform;
145
+ const runner = options.runner ?? defaultRunner;
146
+ runFirstAvailable(clipboardWriteCommands(platform), runner, text);
138
147
  }
139
148
 
140
149
  export const __testing = {
141
- clipboardReadCommands,
142
- clipboardWriteCommands,
150
+ clipboardReadCommands,
151
+ clipboardWriteCommands,
143
152
  };