@maxmo74/pi-coding-agent 1.4.0-max.3 → 1.5.0-max.0
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/CHANGELOG.md +86 -2
- package/dist/bundle/chunks/{anthropic-messages-KRX3GRGV.js → anthropic-messages-BWGCKOF4.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-YWTDZRIJ.js → azure-openai-responses-FSC6BAW3.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
- package/dist/bundle/chunks/chunk-36QC74V4.js +2 -0
- package/dist/bundle/chunks/{chunk-ZN2R65UF.js → chunk-3TGLJEWK.js} +1 -1
- package/dist/bundle/chunks/{chunk-LAMEVJ4W.js → chunk-4EYXVSA5.js} +9 -12
- package/dist/bundle/chunks/{chunk-AFNTYPTW.js → chunk-62VOPMLK.js} +6 -6
- package/dist/bundle/chunks/{chunk-CPKYLLPC.js → chunk-7O7QKK6A.js} +1 -1
- package/dist/bundle/chunks/{chunk-V4LJ5IY6.js → chunk-B46VJEHW.js} +1 -1
- package/dist/bundle/chunks/{chunk-N6ZHTIEL.js → chunk-BZZAKZGU.js} +1 -1
- package/dist/bundle/chunks/{chunk-M3LEVT3X.js → chunk-C2WU32PX.js} +1 -1
- package/dist/bundle/chunks/{chunk-RFUP4YGP.js → chunk-CHWNPHIS.js} +2 -2
- package/dist/bundle/chunks/{chunk-QTM7S6TH.js → chunk-EOO47QGR.js} +1 -1
- package/dist/bundle/chunks/{chunk-XPUTTZLN.js → chunk-GN3QYODH.js} +1 -1
- package/dist/bundle/chunks/{chunk-4UNN5OGR.js → chunk-NL4X6LBY.js} +1 -1
- package/dist/bundle/chunks/chunk-NZY7EIPA.js +4 -0
- package/dist/bundle/chunks/{chunk-HQBQWHLD.js → chunk-R2EGYMOO.js} +3 -3
- package/dist/bundle/chunks/chunk-TM7G7NOA.js +1239 -0
- package/dist/bundle/chunks/{chunk-BPHHHEET.js → chunk-V6KH5QG4.js} +1 -1
- package/dist/bundle/chunks/{chunk-HQJBN2MC.js → chunk-VOLAXWGI.js} +1 -1
- package/dist/bundle/chunks/{chunk-HODJBMOY.js → chunk-YZKQS34S.js} +1 -1
- package/dist/bundle/chunks/{cli-QUXYJ5RR.js → cli-MCOUW5WS.js} +11 -9
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-QPZQRBK5.js → cloudflare-workers-ai-system-one-WLAFJSP6.js} +1 -1
- package/dist/bundle/chunks/{easter-egg-3d-RD5RBYI2.js → easter-egg-3d-WMBNSJ4M.js} +1 -1
- package/dist/bundle/chunks/{execute-XTJDRV75.js → execute-4CEBORGZ.js} +1 -1
- package/dist/bundle/chunks/{google-generative-ai-J3K3YPN3.js → google-generative-ai-INGKNW72.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-VFXOTBVP.js → google-vertex-IBTX6MBF.js} +1 -1
- package/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-4KFSGAMH.js → llama-cpp-classify-V5U3QKXI.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-C2QQGYVC.js → mistral-conversations-S4OWXIXQ.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-H2UJSVV3.js → openai-codex-responses-QAWLOQSN.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-QPD4B26I.js → openai-completions-EJNYB6IX.js} +1 -1
- package/dist/bundle/chunks/{openai-decisions-O6PHBSCB.js → openai-decisions-IXI34BYG.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-JOYMWKMB.js → openai-responses-MD3562FB.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-4WG6OOLH.js → openrouter-images-PISKSFMS.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-EZXKVRR6.js → pi-messages-NORUKF4E.js} +1 -1
- package/dist/bundle/chunks/{runtime-YKR6KZPS.js → runtime-FQB7RU7U.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-X3JT6ECA.js → typesafe-system-one-CHVC2UUI.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-FBPNWDXK.js +2 -0
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +6 -5
- package/dist/cli/args.js.map +1 -1
- package/dist/config.d.ts +10 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +24 -5
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -3
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/bug-report.d.ts +4 -4
- package/dist/core/compaction/branch-summarization.d.ts +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +12 -3
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +3 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +7 -6
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/pi-ai-extension-view.d.ts +19 -0
- package/dist/core/extensions/pi-ai-extension-view.d.ts.map +1 -0
- package/dist/core/extensions/pi-ai-extension-view.js +22 -0
- package/dist/core/extensions/pi-ai-extension-view.js.map +1 -0
- package/dist/core/extensions/types.d.ts +15 -4
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/virtual-modules.js +8 -7
- package/dist/core/extensions/virtual-modules.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +11 -4
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +15 -5
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/model-config.d.ts +1678 -2029
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +2 -3
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/package-manager.d.ts +5 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +88 -25
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-ai-schemas.d.ts +163 -0
- package/dist/core/pi-ai-schemas.d.ts.map +1 -0
- package/dist/core/pi-ai-schemas.js +21 -0
- package/dist/core/pi-ai-schemas.js.map +1 -0
- package/dist/core/project-trust.js +1 -1
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/resource-loader.d.ts +1 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +19 -20
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/session-manager.d.ts +7 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +12 -10
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +3 -2
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +5 -1
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +6 -14
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.js +2 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +2 -0
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js +5 -0
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +5 -6
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -2
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -3
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +2 -4
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +2 -2
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +2 -2
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/ls.d.ts +2 -2
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +2 -2
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +2 -7
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/renderers/write.d.ts.map +1 -1
- package/dist/core/tools/renderers/write.js +19 -19
- package/dist/core/tools/renderers/write.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +11 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/write.d.ts +2 -2
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +14 -8
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/extensions/codemode/renderer.d.ts.map +1 -1
- package/dist/extensions/codemode/renderer.js +6 -2
- package/dist/extensions/codemode/renderer.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts +2 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts.map +1 -1
- package/dist/extensions/mcp/cli.js +34 -8
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +1 -1
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +36 -13
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/tool-search/tool.d.ts +19 -8
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +87 -42
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +1 -3
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +20 -6
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +4 -17
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +2 -1
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +2 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +2 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +4 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts +2 -1
- package/dist/modes/interactive/components/markdown-transform.d.ts.map +1 -1
- package/dist/modes/interactive/components/markdown-transform.js +2 -1
- package/dist/modes/interactive/components/markdown-transform.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +14 -25
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +3 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +2 -6
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.js +1 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +1 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +16 -4
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +6 -9
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +10 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +31 -23
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +48 -2
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/clipboard-command.d.ts.map +1 -1
- package/dist/utils/clipboard-command.js +4 -0
- package/dist/utils/clipboard-command.js.map +1 -1
- package/dist/utils/git.d.ts +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +5 -3
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/open-browser.d.ts.map +1 -1
- package/dist/utils/open-browser.js +4 -1
- package/dist/utils/open-browser.js.map +1 -1
- package/dist/utils/paths.d.ts +17 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +42 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/syntax-highlight.d.ts +5 -0
- package/dist/utils/syntax-highlight.d.ts.map +1 -1
- package/dist/utils/syntax-highlight.js +7 -0
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/docs/cli.md +18 -8
- package/docs/environment-variables.md +1 -0
- package/docs/extensions.md +24 -10
- package/docs/mcp.md +6 -4
- package/docs/packages.md +2 -0
- package/docs/sessions.md +11 -3
- package/docs/settings.md +1 -0
- package/docs/slash-commands.md +2 -2
- package/docs/terminal-setup.md +3 -1
- package/docs/tmux.md +6 -0
- package/docs/windows.md +27 -0
- package/examples/extensions/README.md +2 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/debug-provider.ts +2 -2
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/tsconfig.json +180 -0
- package/package.json +10 -11
- package/schemas/models.schema.json +36 -36
- package/schemas/settings.schema.json +8 -0
- package/dist/bundle/chunks/chunk-BSS6T6KQ.js +0 -2
- package/dist/bundle/chunks/chunk-KFM2CJ7Q.js +0 -4
- package/dist/bundle/chunks/chunk-UH6VPJL7.js +0 -1237
- package/dist/bundle/chunks/virtual-modules-TW6KBQM5.js +0 -2
- package/examples/extensions/sandbox/index.ts +0 -321
- package/examples/extensions/sandbox/package-lock.json +0 -92
- package/examples/extensions/sandbox/package.json +0 -19
package/docs/tmux.md
CHANGED
|
@@ -53,3 +53,9 @@ set -g extended-keys on
|
|
|
53
53
|
Pi supports the xterm `modifyOtherKeys` format used by these versions. Restart tmux and repeat the verification steps.
|
|
54
54
|
|
|
55
55
|
For older versions, upgrade tmux or use Pi outside tmux rather than relying on modified Enter shortcuts.
|
|
56
|
+
|
|
57
|
+
## Known issues
|
|
58
|
+
|
|
59
|
+
| Issue | Affects | Remedy |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| Text such as `c0c/0c0c/0c0c` appears in the editor at startup ([tmux#4749](https://github.com/tmux/tmux/issues/4749)) | tmux 3.6 | Upgrade tmux. Changing Pi's theme does not help. |
|
package/docs/windows.md
CHANGED
|
@@ -76,6 +76,33 @@ JSON uses backslashes for escape sequences. When you write a Windows path with b
|
|
|
76
76
|
|
|
77
77
|
See [Configure shell commands](shell-aliases.md) for command prefixes, aliases, and the complete shell-resolution behavior.
|
|
78
78
|
|
|
79
|
+
## Choose a terminal
|
|
80
|
+
|
|
81
|
+
Windows terminals run Pi through a console host (conhost). Some bundle an up-to-date copy; others use the older one built into Windows, which has bugs that affect Pi.
|
|
82
|
+
|
|
83
|
+
We recommend [Windows Terminal](https://aka.ms/terminal). It always ships an up-to-date conhost, and Pi is best tested with it.
|
|
84
|
+
|
|
85
|
+
Last updated: October 2026.
|
|
86
|
+
|
|
87
|
+
| Terminal | Conhost | Status |
|
|
88
|
+
|---|---|---|
|
|
89
|
+
| [Windows Terminal](https://aka.ms/terminal) | Bundled, current | Recommended |
|
|
90
|
+
| [VS Code](https://code.visualstudio.com), [Tabby](https://tabby.sh), [WezTerm](https://wezterm.org) nightly | Bundled, current | Works |
|
|
91
|
+
| [Alacritty](https://alacritty.org) | Built-in, unless `conpty.dll` and `OpenConsole.exe` from Windows Terminal are next to `alacritty.exe` | Works only with those files |
|
|
92
|
+
| WezTerm 20240203 and older | Bundled, old | [Known issues](#known-issues) |
|
|
93
|
+
| Classic console (`cmd.exe` or PowerShell without Windows Terminal), mintty (Git Bash), ConEmu, Cmder, [Hyper](https://hyper.is), Windows OpenSSH | Built-in | [Known issues](#known-issues) |
|
|
94
|
+
|
|
79
95
|
## Configure Windows Terminal
|
|
80
96
|
|
|
81
97
|
Windows Terminal reserves or rewrites some modified keys. See [Windows Terminal](terminal-setup.md#windows-terminal) to configure `Shift+Enter` and `Alt+Enter`, and [Keybindings](keybindings.md) for Pi's Windows and WSL shortcut defaults.
|
|
98
|
+
|
|
99
|
+
## Known issues
|
|
100
|
+
|
|
101
|
+
These issues come from conhost. Microsoft has fixed them in its source, but has not said when the built-in conhost will get the fixes.
|
|
102
|
+
|
|
103
|
+
| Issue | Affects | Remedy |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| Switching from fullscreen to regular mode, or `Ctrl+G` from fullscreen, crashes the session ([#9186](https://github.com/earendil-works/pi/issues/9186), [microsoft/terminal#17515](https://github.com/microsoft/terminal/issues/17515)) | Built-in conhost | Use a terminal with a current conhost, or start Pi with `--tui-mode regular` |
|
|
106
|
+
| Text such as `;0;rgb:0000/0000/0000` appears in the prompt, and BEL opens the external editor ([#10256](https://github.com/earendil-works/pi/issues/10256)) | Built-in conhost behind another terminal: mintty, Windows OpenSSH | Use a terminal with a current conhost |
|
|
107
|
+
| Fragments such as `79` or `55` appear in the prompt ([#10717](https://github.com/earendil-works/pi/issues/10717)) | WezTerm 20240203 | Use WezTerm nightly |
|
|
108
|
+
| In regular mode, each keystroke redraws the input line on a new row ([#6300](https://github.com/earendil-works/pi/issues/6300)) | Built-in conhost, classic console | Use fullscreen mode (the default), or a terminal with a current conhost |
|
|
@@ -23,9 +23,10 @@ cp permission-gate.ts ~/.pi/agent/extensions/
|
|
|
23
23
|
| `protected-paths.ts` | Blocks writes to protected paths (.env, .git/, node_modules/) |
|
|
24
24
|
| `confirm-destructive.ts` | Confirms before destructive session actions (clear, switch, fork) |
|
|
25
25
|
| `dirty-repo-guard.ts` | Prevents session changes with uncommitted git changes |
|
|
26
|
-
| `sandbox/` | OS-level sandboxing using `@anthropic-ai/sandbox-runtime` with per-project config |
|
|
27
26
|
| `gondolin/` | Route built-in tools and `!` commands into a Gondolin micro-VM |
|
|
28
27
|
|
|
28
|
+
For isolation setup and limitations, see [Run Pi in an isolated environment](../../docs/containerization.md).
|
|
29
|
+
|
|
29
30
|
### Custom Tools
|
|
30
31
|
|
|
31
32
|
| Extension | Description |
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.5.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* as expandable custom entries.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
10
10
|
import { Box, Text } from "@earendil-works/pi-tui";
|
|
11
11
|
|
|
12
12
|
const ENTRY_TYPE = "debug-provider-events";
|
|
@@ -24,7 +24,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
24
24
|
let activeEvents: unknown[] | undefined;
|
|
25
25
|
let completedEntry: ProviderDebugEntry | undefined;
|
|
26
26
|
|
|
27
|
-
pi.registerEntryRenderer<ProviderDebugEntry>(ENTRY_TYPE, (entry, { expanded }, theme) => {
|
|
27
|
+
pi.registerEntryRenderer<ProviderDebugEntry>(ENTRY_TYPE, (entry, { expanded, keyHint }, theme) => {
|
|
28
28
|
const data = entry.data;
|
|
29
29
|
if (!data) return new Text(theme.fg("warning", "[provider debug] Missing event data"), 0, 0);
|
|
30
30
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.5.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.14.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.5.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// Type-checks the example extensions against the modules extensions see at run time (core/extensions/virtual-modules.ts):
|
|
2
|
+
// "@earendil-works/pi-ai" is the extension view, which adds TypeBox's Type, Static and TSchema to the compat entry (the
|
|
3
|
+
// view imports "@earendil-works/pi-ai/compat", so that path stays the package's own).
|
|
4
|
+
// The other paths repeat the root tsconfig.json; keep them in sync.
|
|
5
|
+
// Also the test that imports the subagent example: it type-checks only against the extension view.
|
|
6
|
+
{
|
|
7
|
+
"extends": "../../../tsconfig.json",
|
|
8
|
+
"compilerOptions": {
|
|
9
|
+
"paths": {
|
|
10
|
+
"@earendil-works/chord": [
|
|
11
|
+
"../../../packages/chord/src/index.ts"
|
|
12
|
+
],
|
|
13
|
+
"@earendil-works/chord/context": [
|
|
14
|
+
"../../../packages/chord/src/context/index.ts"
|
|
15
|
+
],
|
|
16
|
+
"@earendil-works/chord/delta": [
|
|
17
|
+
"../../../packages/chord/src/delta/index.ts"
|
|
18
|
+
],
|
|
19
|
+
"@earendil-works/chord/next": [
|
|
20
|
+
"../../../packages/chord/src/next/index.ts"
|
|
21
|
+
],
|
|
22
|
+
"@earendil-works/chord/next/plugins": [
|
|
23
|
+
"../../../packages/chord/src/next-node/plugins/index.ts"
|
|
24
|
+
],
|
|
25
|
+
"@earendil-works/chord/next/plugins/runtime": [
|
|
26
|
+
"../../../packages/chord/src/next-node/plugins/runtime.ts"
|
|
27
|
+
],
|
|
28
|
+
"@test/contracts/*": [
|
|
29
|
+
"../../../packages/chord/test/next-node/fixtures/plugins/contracts/*.ts"
|
|
30
|
+
],
|
|
31
|
+
"@example/contracts/*": [
|
|
32
|
+
"../../../packages/chord/test/next/examples/35-plugins/plugins/contracts/*.ts"
|
|
33
|
+
],
|
|
34
|
+
"@example/weather/*": [
|
|
35
|
+
"../../../packages/chord/test/next/examples/36-plugin-failures/plugins/weather/*.ts"
|
|
36
|
+
],
|
|
37
|
+
"@example/prices/*": [
|
|
38
|
+
"../../../packages/chord/test/next/examples/36-plugin-failures/plugins/prices/*.ts"
|
|
39
|
+
],
|
|
40
|
+
"@example/shapes/*": [
|
|
41
|
+
"../../../packages/chord/test/next/examples/37-plugin-imports/plugins/shapes/*.ts"
|
|
42
|
+
],
|
|
43
|
+
"@example/shared/*": [
|
|
44
|
+
"../../../packages/chord/test/next/examples/38-watch-and-rollout/plugins/contracts/*.ts"
|
|
45
|
+
],
|
|
46
|
+
"@earendil-works/chord/next/http": [
|
|
47
|
+
"../../../packages/chord/src/next-node/http/index.ts"
|
|
48
|
+
],
|
|
49
|
+
"@earendil-works/chord/next/workers": [
|
|
50
|
+
"../../../packages/chord/src/next-node/workers/index.ts"
|
|
51
|
+
],
|
|
52
|
+
"@earendil-works/chord/node": [
|
|
53
|
+
"../../../packages/chord/src/node.ts"
|
|
54
|
+
],
|
|
55
|
+
"@earendil-works/chord/output": [
|
|
56
|
+
"../../../packages/chord/src/output.ts"
|
|
57
|
+
],
|
|
58
|
+
"@earendil-works/chord/telemetry-sqlite": [
|
|
59
|
+
"../../../packages/chord/src/telemetry-sqlite/index.ts"
|
|
60
|
+
],
|
|
61
|
+
"@earendil-works/chord/sqlite": [
|
|
62
|
+
"../../../packages/chord/src/sqlite/index.ts"
|
|
63
|
+
],
|
|
64
|
+
"@earendil-works/chord/sqlite/node": [
|
|
65
|
+
"../../../packages/chord/src/sqlite/node.ts"
|
|
66
|
+
],
|
|
67
|
+
"@earendil-works/chord/sqlite/cloudflare": [
|
|
68
|
+
"../../../packages/chord/src/sqlite/cloudflare.ts"
|
|
69
|
+
],
|
|
70
|
+
"@earendil-works/pi-telemetry": [
|
|
71
|
+
"../../../packages/telemetry/src/index.ts"
|
|
72
|
+
],
|
|
73
|
+
"@earendil-works/pi-telemetry/testing": [
|
|
74
|
+
"../../../packages/telemetry/src/testing/index.ts"
|
|
75
|
+
],
|
|
76
|
+
"@earendil-works/pi-telemetry/render": [
|
|
77
|
+
"../../../packages/telemetry/src/render.ts"
|
|
78
|
+
],
|
|
79
|
+
"@earendil-works/pi-codemode": [
|
|
80
|
+
"../../../packages/codemode/src/index.ts"
|
|
81
|
+
],
|
|
82
|
+
"@earendil-works/pi-codemode/cloudflare": [
|
|
83
|
+
"../../../packages/codemode/src/cloudflare.ts"
|
|
84
|
+
],
|
|
85
|
+
"@earendil-works/pi-codemode/declarations": [
|
|
86
|
+
"../../../packages/codemode/src/declarations.ts"
|
|
87
|
+
],
|
|
88
|
+
"@earendil-works/pi-codemode/portable": [
|
|
89
|
+
"../../../packages/codemode/src/portable.ts"
|
|
90
|
+
],
|
|
91
|
+
"@earendil-works/pi-codemode/source": [
|
|
92
|
+
"../../../packages/codemode/src/source.ts"
|
|
93
|
+
],
|
|
94
|
+
"@earendil-works/pi-codemode/worker": [
|
|
95
|
+
"../../../packages/codemode/src/runtime/worker.ts"
|
|
96
|
+
],
|
|
97
|
+
"@earendil-works/pi-schema": [
|
|
98
|
+
"../../../packages/schema/src/index.ts"
|
|
99
|
+
],
|
|
100
|
+
"@earendil-works/pi-schema/formats": [
|
|
101
|
+
"../../../packages/schema/src/formats/index.ts"
|
|
102
|
+
],
|
|
103
|
+
"@earendil-works/pi-mcp": [
|
|
104
|
+
"../../../packages/mcp/src/index.ts"
|
|
105
|
+
],
|
|
106
|
+
"@earendil-works/pi-mcp/oauth": [
|
|
107
|
+
"../../../packages/mcp/src/oauth/index.ts"
|
|
108
|
+
],
|
|
109
|
+
"@earendil-works/pi-mcp/testing": [
|
|
110
|
+
"../../../packages/mcp/src/testing/index.ts"
|
|
111
|
+
],
|
|
112
|
+
"@earendil-works/pi-ai": [
|
|
113
|
+
"../../../packages/coding-agent/src/core/extensions/pi-ai-extension-view.ts"
|
|
114
|
+
],
|
|
115
|
+
"@earendil-works/pi-ai/oauth": [
|
|
116
|
+
"../../../packages/ai/src/oauth.ts"
|
|
117
|
+
],
|
|
118
|
+
"@earendil-works/pi-ai/*": [
|
|
119
|
+
"../../../packages/ai/src/*.ts",
|
|
120
|
+
"../../../packages/ai/src/providers/*.ts"
|
|
121
|
+
],
|
|
122
|
+
"@earendil-works/pi-ai/dist/*": [
|
|
123
|
+
"../../../packages/ai/src/*"
|
|
124
|
+
],
|
|
125
|
+
"@earendil-works/pi-durable": [
|
|
126
|
+
"../../../packages/durable/src/index.ts"
|
|
127
|
+
],
|
|
128
|
+
"@earendil-works/pi-durable/testing": [
|
|
129
|
+
"../../../packages/durable/src/testing/index.ts"
|
|
130
|
+
],
|
|
131
|
+
"@earendil-works/pi-durable/*": [
|
|
132
|
+
"../../../packages/durable/src/*.ts",
|
|
133
|
+
"../../../packages/durable/src/*/index.ts",
|
|
134
|
+
"../../../packages/durable/src/*"
|
|
135
|
+
],
|
|
136
|
+
"@earendil-works/pi-env": [
|
|
137
|
+
"../../../packages/env/src/index.ts"
|
|
138
|
+
],
|
|
139
|
+
"@earendil-works/pi-agent-core": [
|
|
140
|
+
"../../../packages/agent/src/index.ts"
|
|
141
|
+
],
|
|
142
|
+
"@earendil-works/pi-coding-agent": [
|
|
143
|
+
"../../../packages/coding-agent/src/index.ts"
|
|
144
|
+
],
|
|
145
|
+
"@earendil-works/pi-coding-agent/hooks": [
|
|
146
|
+
"../../../packages/coding-agent/src/core/hooks/index.ts"
|
|
147
|
+
],
|
|
148
|
+
"@earendil-works/pi-coding-agent/*": [
|
|
149
|
+
"../../../packages/coding-agent/src/*"
|
|
150
|
+
],
|
|
151
|
+
"typebox": [
|
|
152
|
+
"../../../node_modules/typebox"
|
|
153
|
+
],
|
|
154
|
+
"@earendil-works/pi-tui": [
|
|
155
|
+
"../../../packages/tui/src/index.ts"
|
|
156
|
+
],
|
|
157
|
+
"@earendil-works/pi-tui/*": [
|
|
158
|
+
"../../../packages/tui/src/*"
|
|
159
|
+
],
|
|
160
|
+
"@earendil-works/pi-agent-old": [
|
|
161
|
+
"../../../packages/agent-old/src/index.ts"
|
|
162
|
+
],
|
|
163
|
+
"@earendil-works/pi-agent-old/*": [
|
|
164
|
+
"../../../packages/agent-old/src/*"
|
|
165
|
+
],
|
|
166
|
+
"@mariozechner/pi-ai": [
|
|
167
|
+
"../../../packages/coding-agent/src/core/extensions/pi-ai-extension-view.ts"
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"include": [
|
|
172
|
+
"./extensions/**/*",
|
|
173
|
+
"../../*/src/**/*.d.ts",
|
|
174
|
+
"../test/suite/regressions/8261-subagent-project-trust.test.ts"
|
|
175
|
+
],
|
|
176
|
+
"exclude": [
|
|
177
|
+
"**/node_modules/**",
|
|
178
|
+
"./extensions/gondolin/**"
|
|
179
|
+
]
|
|
180
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxmo74/pi-coding-agent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0-max.0",
|
|
4
4
|
"description": "Unofficial pi fork by maxmo74: session moves in the /resume picker, plus selective fixes. Independent of and not affiliated with pi.dev.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
],
|
|
31
31
|
"scripts": {},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@earendil-works/pi-agent-core": "1.
|
|
34
|
-
"@earendil-works/pi-ai": "1.
|
|
35
|
-
"@earendil-works/pi-codemode": "1.
|
|
36
|
-
"@earendil-works/pi-mcp": "1.
|
|
37
|
-
"@earendil-works/pi-tui": "1.
|
|
33
|
+
"@earendil-works/pi-agent-core": "1.5.0",
|
|
34
|
+
"@earendil-works/pi-ai": "1.5.0",
|
|
35
|
+
"@earendil-works/pi-codemode": "1.5.0",
|
|
36
|
+
"@earendil-works/pi-mcp": "1.5.0",
|
|
37
|
+
"@earendil-works/pi-tui": "1.5.0",
|
|
38
38
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
39
39
|
"brace-expansion": "5.0.12",
|
|
40
40
|
"chalk": "6.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"hosted-git-info": "9.0.3",
|
|
46
46
|
"ignore": "7.0.8",
|
|
47
47
|
"jiti": "2.7.0",
|
|
48
|
-
"minimatch": "
|
|
48
|
+
"minimatch": "11.0.3",
|
|
49
49
|
"proper-lockfile": "4.1.2",
|
|
50
50
|
"quickjs-wasi": "3.6.2",
|
|
51
51
|
"semver": "7.8.5",
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
"@types/proper-lockfile": "4.1.4",
|
|
64
64
|
"@types/semver": "7.7.1",
|
|
65
65
|
"marked": "18.0.11",
|
|
66
|
-
"shx": "0.3.4",
|
|
67
66
|
"vitest": "4.1.12"
|
|
68
67
|
},
|
|
69
68
|
"keywords": [
|
|
@@ -88,8 +87,8 @@
|
|
|
88
87
|
"access": "public"
|
|
89
88
|
},
|
|
90
89
|
"piFork": {
|
|
91
|
-
"upstreamVersion": "1.
|
|
92
|
-
"sourceCommit": "
|
|
93
|
-
"builtAt": "2026-11-
|
|
90
|
+
"upstreamVersion": "1.5.0",
|
|
91
|
+
"sourceCommit": "6eb12bc0489be89d2df9285d7cdb827f6151a967",
|
|
92
|
+
"builtAt": "2026-11-02T12:11:53.363Z"
|
|
94
93
|
}
|
|
95
94
|
}
|
|
@@ -255,13 +255,6 @@
|
|
|
255
255
|
"type": "array",
|
|
256
256
|
"items": {
|
|
257
257
|
"type": "object",
|
|
258
|
-
"required": [
|
|
259
|
-
"inputTokensAbove",
|
|
260
|
-
"input",
|
|
261
|
-
"output",
|
|
262
|
-
"cacheRead",
|
|
263
|
-
"cacheWrite"
|
|
264
|
-
],
|
|
265
258
|
"properties": {
|
|
266
259
|
"inputTokensAbove": {
|
|
267
260
|
"type": "number",
|
|
@@ -283,7 +276,14 @@
|
|
|
283
276
|
"type": "number",
|
|
284
277
|
"description": "Cache-write cost in USD per million tokens."
|
|
285
278
|
}
|
|
286
|
-
}
|
|
279
|
+
},
|
|
280
|
+
"required": [
|
|
281
|
+
"inputTokensAbove",
|
|
282
|
+
"input",
|
|
283
|
+
"output",
|
|
284
|
+
"cacheRead",
|
|
285
|
+
"cacheWrite"
|
|
286
|
+
]
|
|
287
287
|
},
|
|
288
288
|
"description": "Request-wide pricing tiers. The highest matching input threshold applies to the full request."
|
|
289
289
|
}
|
|
@@ -383,12 +383,6 @@
|
|
|
383
383
|
"$defs": {
|
|
384
384
|
"ModelCost": {
|
|
385
385
|
"type": "object",
|
|
386
|
-
"required": [
|
|
387
|
-
"input",
|
|
388
|
-
"output",
|
|
389
|
-
"cacheRead",
|
|
390
|
-
"cacheWrite"
|
|
391
|
-
],
|
|
392
386
|
"properties": {
|
|
393
387
|
"input": {
|
|
394
388
|
"type": "number",
|
|
@@ -410,13 +404,6 @@
|
|
|
410
404
|
"type": "array",
|
|
411
405
|
"items": {
|
|
412
406
|
"type": "object",
|
|
413
|
-
"required": [
|
|
414
|
-
"inputTokensAbove",
|
|
415
|
-
"input",
|
|
416
|
-
"output",
|
|
417
|
-
"cacheRead",
|
|
418
|
-
"cacheWrite"
|
|
419
|
-
],
|
|
420
407
|
"properties": {
|
|
421
408
|
"inputTokensAbove": {
|
|
422
409
|
"type": "number",
|
|
@@ -438,11 +425,24 @@
|
|
|
438
425
|
"type": "number",
|
|
439
426
|
"description": "Cache-write cost in USD per million tokens."
|
|
440
427
|
}
|
|
441
|
-
}
|
|
428
|
+
},
|
|
429
|
+
"required": [
|
|
430
|
+
"inputTokensAbove",
|
|
431
|
+
"input",
|
|
432
|
+
"output",
|
|
433
|
+
"cacheRead",
|
|
434
|
+
"cacheWrite"
|
|
435
|
+
]
|
|
442
436
|
},
|
|
443
437
|
"description": "Request-wide pricing tiers. The highest matching input threshold applies to the full request."
|
|
444
438
|
}
|
|
445
|
-
}
|
|
439
|
+
},
|
|
440
|
+
"required": [
|
|
441
|
+
"input",
|
|
442
|
+
"output",
|
|
443
|
+
"cacheRead",
|
|
444
|
+
"cacheWrite"
|
|
445
|
+
]
|
|
446
446
|
},
|
|
447
447
|
"ModelInputLimits": {
|
|
448
448
|
"type": "object",
|
|
@@ -628,9 +628,6 @@
|
|
|
628
628
|
},
|
|
629
629
|
{
|
|
630
630
|
"type": "object",
|
|
631
|
-
"required": [
|
|
632
|
-
"$var"
|
|
633
|
-
],
|
|
634
631
|
"properties": {
|
|
635
632
|
"$var": {
|
|
636
633
|
"anyOf": [
|
|
@@ -651,7 +648,10 @@
|
|
|
651
648
|
"omitWhenOff": {
|
|
652
649
|
"type": "boolean"
|
|
653
650
|
}
|
|
654
|
-
}
|
|
651
|
+
},
|
|
652
|
+
"required": [
|
|
653
|
+
"$var"
|
|
654
|
+
]
|
|
655
655
|
}
|
|
656
656
|
]
|
|
657
657
|
}
|
|
@@ -677,9 +677,6 @@
|
|
|
677
677
|
},
|
|
678
678
|
{
|
|
679
679
|
"type": "object",
|
|
680
|
-
"required": [
|
|
681
|
-
"$var"
|
|
682
|
-
],
|
|
683
680
|
"properties": {
|
|
684
681
|
"$var": {
|
|
685
682
|
"anyOf": [
|
|
@@ -700,7 +697,10 @@
|
|
|
700
697
|
"omitWhenOff": {
|
|
701
698
|
"type": "boolean"
|
|
702
699
|
}
|
|
703
|
-
}
|
|
700
|
+
},
|
|
701
|
+
"required": [
|
|
702
|
+
"$var"
|
|
703
|
+
]
|
|
704
704
|
}
|
|
705
705
|
]
|
|
706
706
|
}
|
|
@@ -1085,11 +1085,6 @@
|
|
|
1085
1085
|
"type": "array",
|
|
1086
1086
|
"items": {
|
|
1087
1087
|
"type": "object",
|
|
1088
|
-
"required": [
|
|
1089
|
-
"provider",
|
|
1090
|
-
"model",
|
|
1091
|
-
"cost"
|
|
1092
|
-
],
|
|
1093
1088
|
"properties": {
|
|
1094
1089
|
"provider": {
|
|
1095
1090
|
"type": "string",
|
|
@@ -1103,6 +1098,11 @@
|
|
|
1103
1098
|
"$ref": "#/$defs/ModelCost"
|
|
1104
1099
|
}
|
|
1105
1100
|
},
|
|
1101
|
+
"required": [
|
|
1102
|
+
"provider",
|
|
1103
|
+
"model",
|
|
1104
|
+
"cost"
|
|
1105
|
+
],
|
|
1106
1106
|
"description": "An Anthropic server-side refusal fallback model with local pricing metadata."
|
|
1107
1107
|
},
|
|
1108
1108
|
"maxItems": 3,
|
|
@@ -267,6 +267,14 @@
|
|
|
267
267
|
},
|
|
268
268
|
"description": "Command used for npm package lookup and installation, in argv form such as [\"mise\", \"exec\", \"node@20\", \"--\", \"npm\"]."
|
|
269
269
|
},
|
|
270
|
+
"selfUpdateCommand": {
|
|
271
|
+
"type": "array",
|
|
272
|
+
"items": {
|
|
273
|
+
"type": "string"
|
|
274
|
+
},
|
|
275
|
+
"minItems": 1,
|
|
276
|
+
"description": "Command `pi update` runs to update Pi itself, in argv form such as [\"mise\", \"use\", \"-g\", \"npm:{packageName}@{version}\"]. Placeholders: {packageName}, {version}, {installSpec}. PI_SELF_UPDATE_COMMAND takes precedence. Global setting only."
|
|
277
|
+
},
|
|
270
278
|
"collapseChangelog": {
|
|
271
279
|
"type": "boolean",
|
|
272
280
|
"description": "Show the condensed changelog after update; use /changelog for the full changelog.",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
import{__commonJS,__require,__toESM}from"./chunk-JXWJOIH4.js";var require_windows=__commonJS({"node_modules/isexe/windows.js"(exports,module){module.exports=isexe;isexe.sync=sync;var fs=__require("fs");function checkPathExt(path,options){var pathext=options.pathExt!==void 0?options.pathExt:process.env.PATHEXT;if(!pathext||(pathext=pathext.split(";"),pathext.indexOf("")!==-1))return!0;for(var i=0;i<pathext.length;i++){var p=pathext[i].toLowerCase();if(p&&path.substr(-p.length).toLowerCase()===p)return!0}return!1}function checkStat(stat,path,options){return!stat.isSymbolicLink()&&!stat.isFile()?!1:checkPathExt(path,options)}function isexe(path,options,cb){fs.stat(path,function(er,stat){cb(er,er?!1:checkStat(stat,path,options))})}function sync(path,options){return checkStat(fs.statSync(path),path,options)}}});var require_mode=__commonJS({"node_modules/isexe/mode.js"(exports,module){module.exports=isexe;isexe.sync=sync;var fs=__require("fs");function isexe(path,options,cb){fs.stat(path,function(er,stat){cb(er,er?!1:checkStat(stat,options))})}function sync(path,options){return checkStat(fs.statSync(path),options)}function checkStat(stat,options){return stat.isFile()&&checkMode(stat,options)}function checkMode(stat,options){var mod=stat.mode,uid=stat.uid,gid=stat.gid,myUid=options.uid!==void 0?options.uid:process.getuid&&process.getuid(),myGid=options.gid!==void 0?options.gid:process.getgid&&process.getgid(),u=parseInt("100",8),g=parseInt("010",8),o=parseInt("001",8),ug=u|g,ret=mod&o||mod&g&&gid===myGid||mod&u&&uid===myUid||mod&ug&&myUid===0;return ret}}});var require_isexe=__commonJS({"node_modules/isexe/index.js"(exports,module){var fs=__require("fs"),core;process.platform==="win32"||global.TESTING_WINDOWS?core=require_windows():core=require_mode();module.exports=isexe;isexe.sync=sync;function isexe(path,options,cb){if(typeof options=="function"&&(cb=options,options={}),!cb){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(resolve2,reject){isexe(path,options||{},function(er,is){er?reject(er):resolve2(is)})})}core(path,options||{},function(er,is){er&&(er.code==="EACCES"||options&&options.ignoreErrors)&&(er=null,is=!1),cb(er,is)})}function sync(path,options){try{return core.sync(path,options||{})}catch(er){if(options&&options.ignoreErrors||er.code==="EACCES")return!1;throw er}}}});var require_which=__commonJS({"node_modules/which/which.js"(exports,module){var isWindows=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",path=__require("path"),COLON=isWindows?";":":",isexe=require_isexe(),getNotFoundError=cmd=>Object.assign(new Error(`not found: ${cmd}`),{code:"ENOENT"}),getPathInfo=(cmd,opt)=>{let colon=opt.colon||COLON,pathEnv=cmd.match(/\//)||isWindows&&cmd.match(/\\/)?[""]:[...isWindows?[process.cwd()]:[],...(opt.path||process.env.PATH||"").split(colon)],pathExtExe=isWindows?opt.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",pathExt=isWindows?pathExtExe.split(colon):[""];return isWindows&&cmd.indexOf(".")!==-1&&pathExt[0]!==""&&pathExt.unshift(""),{pathEnv,pathExt,pathExtExe}},which=(cmd,opt,cb)=>{typeof opt=="function"&&(cb=opt,opt={}),opt||(opt={});let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[],step=i=>new Promise((resolve2,reject)=>{if(i===pathEnv.length)return opt.all&&found.length?resolve2(found):reject(getNotFoundError(cmd));let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;resolve2(subStep(p,i,0))}),subStep=(p,i,ii)=>new Promise((resolve2,reject)=>{if(ii===pathExt.length)return resolve2(step(i+1));let ext=pathExt[ii];isexe(p+ext,{pathExt:pathExtExe},(er,is)=>{if(!er&&is)if(opt.all)found.push(p+ext);else return resolve2(p+ext);return resolve2(subStep(p,i,ii+1))})});return cb?step(0).then(res=>cb(null,res),cb):step(0)},whichSync=(cmd,opt)=>{opt=opt||{};let{pathEnv,pathExt,pathExtExe}=getPathInfo(cmd,opt),found=[];for(let i=0;i<pathEnv.length;i++){let ppRaw=pathEnv[i],pathPart=/^".*"$/.test(ppRaw)?ppRaw.slice(1,-1):ppRaw,pCmd=path.join(pathPart,cmd),p=!pathPart&&/^\.[\\\/]/.test(cmd)?cmd.slice(0,2)+pCmd:pCmd;for(let j=0;j<pathExt.length;j++){let cur=p+pathExt[j];try{if(isexe.sync(cur,{pathExt:pathExtExe}))if(opt.all)found.push(cur);else return cur}catch{}}}if(opt.all&&found.length)return found;if(opt.nothrow)return null;throw getNotFoundError(cmd)};module.exports=which;which.sync=whichSync}});var require_path_key=__commonJS({"node_modules/path-key/index.js"(exports,module){"use strict";var pathKey=(options={})=>{let environment=options.env||process.env;return(options.platform||process.platform)!=="win32"?"PATH":Object.keys(environment).reverse().find(key=>key.toUpperCase()==="PATH")||"Path"};module.exports=pathKey;module.exports.default=pathKey}});var require_resolveCommand=__commonJS({"node_modules/cross-spawn/lib/util/resolveCommand.js"(exports,module){"use strict";var path=__require("path"),which=require_which(),getPathKey=require_path_key();function resolveCommandAttempt(parsed,withoutPathExt){let env=parsed.options.env||process.env,cwd=process.cwd(),hasCustomCwd=parsed.options.cwd!=null,shouldSwitchCwd=hasCustomCwd&&process.chdir!==void 0&&!process.chdir.disabled;if(shouldSwitchCwd)try{process.chdir(parsed.options.cwd)}catch{}let resolved;try{resolved=which.sync(parsed.command,{path:env[getPathKey({env})],pathExt:withoutPathExt?path.delimiter:void 0})}catch{}finally{shouldSwitchCwd&&process.chdir(cwd)}return resolved&&(resolved=path.resolve(hasCustomCwd?parsed.options.cwd:"",resolved)),resolved}function resolveCommand(parsed){return resolveCommandAttempt(parsed)||resolveCommandAttempt(parsed,!0)}module.exports=resolveCommand}});var require_escape=__commonJS({"node_modules/cross-spawn/lib/util/escape.js"(exports,module){"use strict";var metaCharsRegExp=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(arg){return arg=arg.replace(metaCharsRegExp,"^$1"),arg}function escapeArgument(arg,doubleEscapeMetaChars){return arg=`${arg}`,arg=arg.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),arg=arg.replace(/(?=(\\+?)?)\1$/,"$1$1"),arg=`"${arg}"`,arg=arg.replace(metaCharsRegExp,"^$1"),doubleEscapeMetaChars&&(arg=arg.replace(metaCharsRegExp,"^$1")),arg}module.exports.command=escapeCommand;module.exports.argument=escapeArgument}});var require_shebang_regex=__commonJS({"node_modules/shebang-regex/index.js"(exports,module){"use strict";module.exports=/^#!(.*)/}});var require_shebang_command=__commonJS({"node_modules/shebang-command/index.js"(exports,module){"use strict";var shebangRegex=require_shebang_regex();module.exports=(string="")=>{let match=string.match(shebangRegex);if(!match)return null;let[path,argument]=match[0].replace(/#! ?/,"").split(" "),binary=path.split("/").pop();return binary==="env"?argument:argument?`${binary} ${argument}`:binary}}});var require_readShebang=__commonJS({"node_modules/cross-spawn/lib/util/readShebang.js"(exports,module){"use strict";var fs=__require("fs"),shebangCommand=require_shebang_command();function readShebang(command){let buffer=Buffer.alloc(150),fd;try{fd=fs.openSync(command,"r"),fs.readSync(fd,buffer,0,150,0),fs.closeSync(fd)}catch{}return shebangCommand(buffer.toString())}module.exports=readShebang}});var require_parse=__commonJS({"node_modules/cross-spawn/lib/parse.js"(exports,module){"use strict";var path=__require("path"),resolveCommand=require_resolveCommand(),escape=require_escape(),readShebang=require_readShebang(),isWin=process.platform==="win32",isExecutableRegExp=/\.(?:com|exe)$/i,isCmdShimRegExp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(parsed){parsed.file=resolveCommand(parsed);let shebang=parsed.file&&readShebang(parsed.file);return shebang?(parsed.args.unshift(parsed.file),parsed.command=shebang,resolveCommand(parsed)):parsed.file}function parseNonShell(parsed){if(!isWin)return parsed;let commandFile=detectShebang(parsed),needsShell=!isExecutableRegExp.test(commandFile);if(parsed.options.forceShell||needsShell){let needsDoubleEscapeMetaChars=isCmdShimRegExp.test(commandFile);parsed.command=path.normalize(parsed.command),parsed.command=escape.command(parsed.command),parsed.args=parsed.args.map(arg=>escape.argument(arg,needsDoubleEscapeMetaChars));let shellCommand=[parsed.command].concat(parsed.args).join(" ");parsed.args=["/d","/s","/c",`"${shellCommand}"`],parsed.command=process.env.comspec||"cmd.exe",parsed.options.windowsVerbatimArguments=!0}return parsed}function parse(command,args,options){args&&!Array.isArray(args)&&(options=args,args=null),args=args?args.slice(0):[],options=Object.assign({},options);let parsed={command,args,options,file:void 0,original:{command,args}};return options.shell?parsed:parseNonShell(parsed)}module.exports=parse}});var require_enoent=__commonJS({"node_modules/cross-spawn/lib/enoent.js"(exports,module){"use strict";var isWin=process.platform==="win32";function notFoundError(original,syscall){return Object.assign(new Error(`${syscall} ${original.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${syscall} ${original.command}`,path:original.command,spawnargs:original.args})}function hookChildProcess(cp,parsed){if(!isWin)return;let originalEmit=cp.emit;cp.emit=function(name,arg1){if(name==="exit"){let err=verifyENOENT(arg1,parsed);if(err)return originalEmit.call(cp,"error",err)}return originalEmit.apply(cp,arguments)}}function verifyENOENT(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawn"):null}function verifyENOENTSync(status,parsed){return isWin&&status===1&&!parsed.file?notFoundError(parsed.original,"spawnSync"):null}module.exports={hookChildProcess,verifyENOENT,verifyENOENTSync,notFoundError}}});var require_cross_spawn=__commonJS({"node_modules/cross-spawn/index.js"(exports,module){"use strict";var cp=__require("child_process"),parse=require_parse(),enoent=require_enoent();function spawn(command,args,options){let parsed=parse(command,args,options),spawned=cp.spawn(parsed.command,parsed.args,parsed.options);return enoent.hookChildProcess(spawned,parsed),spawned}function spawnSync(command,args,options){let parsed=parse(command,args,options),result=cp.spawnSync(parsed.command,parsed.args,parsed.options);return result.error=result.error||enoent.verifyENOENTSync(result.status,parsed),result}module.exports=spawn;module.exports.spawn=spawn;module.exports.sync=spawnSync;module.exports._parse=parse;module.exports._enoent=enoent}});import{accessSync,constants,existsSync,readFileSync,realpathSync as realpathSync2}from"fs";import{createRequire}from"module";import{homedir as homedir2}from"os";import{basename,dirname,join as join2,resolve,sep as sep2,win32}from"path";import{fileURLToPath as fileURLToPath2}from"url";var import_cross_spawn=__toESM(require_cross_spawn(),1);import{spawn as nodeSpawn,spawnSync as nodeSpawnSync}from"node:child_process";var EXIT_STDIO_GRACE_MS=100;function spawnProcess(command,args,options){return process.platform==="win32"?(0,import_cross_spawn.default)(command,args,options):nodeSpawn(command,args,options)}function spawnProcessSync(command,args,options){return process.platform==="win32"?import_cross_spawn.default.sync(command,args,options):nodeSpawnSync(command,args,options)}function waitForChildProcess(child){return new Promise((resolve2,reject)=>{let settled=!1,exited=!1,exitCode=null,postExitTimer,stdoutEnded=child.stdout===null,stderrEnded=child.stderr===null,cleanup=()=>{postExitTimer&&(clearTimeout(postExitTimer),postExitTimer=void 0),child.removeListener("error",onError),child.removeListener("exit",onExit),child.removeListener("close",onClose),child.stdout?.removeListener("end",onStdoutEnd),child.stderr?.removeListener("end",onStderrEnd),child.stdout?.removeListener("data",onData),child.stderr?.removeListener("data",onData)},finalize=code=>{settled||(settled=!0,cleanup(),child.stdout?.destroy(),child.stderr?.destroy(),resolve2(code))},maybeFinalizeAfterExit=()=>{!exited||settled||stdoutEnded&&stderrEnded&&finalize(exitCode)},armIdleTimer=()=>{postExitTimer&&clearTimeout(postExitTimer),postExitTimer=setTimeout(()=>finalize(exitCode),EXIT_STDIO_GRACE_MS)},onData=()=>{exited&&!settled&&armIdleTimer()},onStdoutEnd=()=>{stdoutEnded=!0,maybeFinalizeAfterExit()},onStderrEnd=()=>{stderrEnded=!0,maybeFinalizeAfterExit()},onError=err=>{settled||(settled=!0,cleanup(),reject(err))},onExit=code=>{exited=!0,exitCode=code,maybeFinalizeAfterExit(),settled||armIdleTimer()},onClose=code=>{finalize(code)};child.stdout?.once("end",onStdoutEnd),child.stderr?.once("end",onStderrEnd),child.stdout?.on("data",onData),child.stderr?.on("data",onData),child.once("error",onError),child.once("exit",onExit),child.once("close",onClose)})}import{realpathSync,statSync}from"node:fs";import{homedir}from"node:os";import{isAbsolute,join,resolve as nodeResolvePath,relative,sep}from"node:path";import{fileURLToPath}from"node:url";var UNICODE_SPACES=/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g;function canonicalizePath(path){try{return realpathSync(path)}catch{return path}}function getFileRevision(path){try{let stats=statSync(path,{bigint:!0});return`${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeNs}:${stats.ctimeNs}`}catch{return}}function isLocalPath(value){let trimmed=value.trim();return!(trimmed.startsWith("npm:")||trimmed.startsWith("git:")||trimmed.startsWith("github:")||trimmed.startsWith("http:")||trimmed.startsWith("https:")||trimmed.startsWith("ssh:")||trimmed.startsWith("builtin:"))}function normalizeWindowsShellPath(filePath){if(!filePath.startsWith("/")||filePath.startsWith("//")||filePath.includes("\\"))return filePath;let match=filePath.match(/^\/(?:mnt\/|cygdrive\/)?([a-z])(?:\/(.*))?$/i);if(!match)return filePath;let suffix=match[2]?.replaceAll("/","\\");return`${match[1].toUpperCase()}:\\${suffix??""}`}function normalizePath(input,options={}){let normalized=options.trim?input.trim():input;if(options.normalizeUnicodeSpaces&&(normalized=normalized.replace(UNICODE_SPACES," ")),options.stripAtPrefix&&normalized.startsWith("@")&&(normalized=normalized.slice(1)),process.platform==="win32"&&(normalized=normalizeWindowsShellPath(normalized)),options.expandTilde??!0){let home=options.homeDir??homedir();if(normalized==="~")return home;if(normalized.startsWith("~/")||process.platform==="win32"&&normalized.startsWith("~\\"))return join(home,normalized.slice(2))}return/^file:\/\//.test(normalized)?fileURLToPath(normalized):normalized}function resolvePath(input,baseDir=process.cwd(),options={}){let normalized=normalizePath(input,options),normalizedBaseDir=normalizePath(baseDir);return isAbsolute(normalized)?nodeResolvePath(normalized):nodeResolvePath(normalizedBaseDir,normalized)}function getCwdRelativePath(filePath,cwd){let resolvedCwd=resolvePath(cwd),resolvedPath=resolvePath(filePath,resolvedCwd),relativePath=relative(resolvedCwd,resolvedPath);return relativePath===""||relativePath!==".."&&!relativePath.startsWith(`..${sep}`)&&!isAbsolute(relativePath)?relativePath||".":void 0}function formatPathRelativeToCwdOrAbsolute(filePath,cwd){let absolutePath=resolvePath(filePath,cwd);return(getCwdRelativePath(absolutePath,cwd)??absolutePath).split(sep).join("/")}function markPathIgnoredByCloudSync(path){let attrs=process.platform==="darwin"?["com.dropbox.ignored","com.apple.fileprovider.ignore#P"]:process.platform==="linux"?["user.com.dropbox.ignored"]:[];for(let attr of attrs)process.platform==="darwin"?spawnProcessSync("xattr",["-w",attr,"1",path],{encoding:"utf-8",stdio:"ignore"}):spawnProcessSync("setfattr",["-n",attr,"-v","1",path],{encoding:"utf-8",stdio:"ignore"})}function splitBom(content){return content.startsWith("\uFEFF")?{bom:"\uFEFF",text:content.slice(1)}:{bom:"",text:content}}function stripBom(content){return splitBom(content).text}var __filename=fileURLToPath2(import.meta.url),__dirname=dirname(__filename),isBunBinary=import.meta.url.includes("$bunfs")||import.meta.url.includes("~BUN")||import.meta.url.includes("%7EBUN"),isBunRuntime=!!process.versions.bun,isBundledNode=!0;function normalizeSelfUpdatePackageTarget(target){return typeof target=="string"?{packageName:target,installSpec:target}:{packageName:target.packageName,installSpec:target.installSpec??target.packageName}}function makeSelfUpdateCommand(installStep,uninstallStep){return uninstallStep?{...installStep,display:`${uninstallStep.display} && ${installStep.display}`,steps:[uninstallStep,installStep]}:installStep}function makeSelfUpdateCommandStep(command,args){return{command,args,display:[command,...args].map(arg=>/\s/.test(arg)?`"${arg}"`:arg).join(" ")}}function detectInstallMethod(){if(isBunBinary)return"bun-binary";let resolvedPath=`${__dirname}\0${process.execPath||""}`.toLowerCase().replace(/\\/g,"/");return resolvedPath.includes("/pnpm/")||resolvedPath.includes("/.pnpm/")?"pnpm":resolvedPath.includes("/yarn/")||resolvedPath.includes("/.yarn/")?"yarn":isBunRuntime||resolvedPath.includes("/install/global/node_modules/")?"bun":resolvedPath.includes("/npm/")||resolvedPath.includes("/node_modules/")?"npm":"unknown"}function getInferredNpmInstall(){let packageDir=getPackageDir(),path=process.platform==="win32"||packageDir.includes("\\")?win32:{basename,dirname},parent=path.dirname(packageDir),root;if(path.basename(parent).startsWith("@")&&path.basename(path.dirname(parent))==="node_modules"?root=path.dirname(parent):path.basename(parent)==="node_modules"&&(root=parent),!root)return;let rootParent=path.dirname(root);if(path.basename(rootParent)==="lib")return{root,prefix:path.dirname(rootParent)}}function getSelfUpdateCommandForMethod(method,installedPackageName,updatePackageTarget=installedPackageName,npmCommand){let target=normalizeSelfUpdatePackageTarget(updatePackageTarget);switch(method){case"bun-binary":return;case"pnpm":{let match=readCommandOutput("pnpm",["root","-g"])?void 0:/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(getPackageDir()),binDirArgs=match?[`--config.global-bin-dir=${process.env.PNPM_HOME||dirname(dirname(match[1]))}`]:[];return makeSelfUpdateCommand(makeSelfUpdateCommandStep("pnpm",["install","-g","--ignore-scripts","--config.minimumReleaseAge=0",...binDirArgs,target.installSpec]),target.packageName===installedPackageName?void 0:makeSelfUpdateCommandStep("pnpm",["remove","-g",...binDirArgs,installedPackageName]))}case"yarn":return makeSelfUpdateCommand(makeSelfUpdateCommandStep("yarn",["global","add","--ignore-scripts",target.installSpec]),target.packageName===installedPackageName?void 0:makeSelfUpdateCommandStep("yarn",["global","remove",installedPackageName]));case"bun":return makeSelfUpdateCommand(makeSelfUpdateCommandStep("bun",["install","-g","--ignore-scripts","--minimum-release-age=0",target.installSpec]),target.packageName===installedPackageName?void 0:makeSelfUpdateCommandStep("bun",["uninstall","-g",installedPackageName]));case"npm":{let[command="npm",...npmArgs]=npmCommand??[],inferred=npmCommand?.length?void 0:getInferredNpmInstall(),prefixArgs=[...npmArgs,...inferred?["--prefix",inferred.prefix]:[]],installStep=makeSelfUpdateCommandStep(command,[...prefixArgs,"install","-g","--ignore-scripts","--min-release-age=0",target.installSpec]),uninstallStep=target.packageName===installedPackageName?void 0:makeSelfUpdateCommandStep(command,[...prefixArgs,"uninstall","-g",installedPackageName]);return makeSelfUpdateCommand(installStep,uninstallStep)}case"unknown":return}}function readCommandOutput(command,args,options={}){let result=spawnProcessSync(command,args,{encoding:"utf-8",stdio:["ignore","pipe","pipe"]});if(result.status===0)return result.stdout.trim()||void 0;if(options.requireSuccess){let reason=result.error?.message||result.stderr.trim()||`exit code ${result.status??"unknown"}`;throw new Error(`Failed to run ${[command,...args].join(" ")}: ${reason}`)}}function getGlobalPackageRoots(method,_packageName,npmCommand){switch(method){case"npm":{let configured=!!npmCommand?.length,[command="npm",...npmArgs]=npmCommand??[];if(configured&&command==="bun"){let bunBin=readCommandOutput(command,[...npmArgs,"pm","bin","-g"],{requireSuccess:!0}),roots=[join2(homedir2(),".bun","install","global","node_modules")];return bunBin&&roots.push(join2(dirname(bunBin),"install","global","node_modules")),roots}let root=readCommandOutput(command,[...npmArgs,"root","-g"],{requireSuccess:configured}),inferred=configured?void 0:getInferredNpmInstall();return[root,inferred?.root].filter(x=>!!x)}case"pnpm":{let root=readCommandOutput("pnpm",["root","-g"]);if(root)return[root,dirname(root)];let match=/^(.*[\\/]global[\\/][^\\/]+)[\\/]\.pnpm[\\/]/.exec(getPackageDir());return match?[match[1]]:[]}case"yarn":{let dir=readCommandOutput("yarn",["global","dir"]);return dir?[dir,join2(dir,"node_modules")]:[]}case"bun":{let bunBin=readCommandOutput("bun",["pm","bin","-g"]),roots=[join2(homedir2(),".bun","install","global","node_modules")];return bunBin&&roots.push(join2(dirname(bunBin),"install","global","node_modules")),roots}case"bun-binary":case"unknown":return[]}}function normalizeExistingPathForComparison(path,resolveSymlinks){let resolvedPath=resolve(path);if(!existsSync(resolvedPath))return;let normalizedPath=resolvedPath;if(resolveSymlinks)try{normalizedPath=realpathSync2(resolvedPath)}catch{return}return process.platform==="win32"&&(normalizedPath=normalizedPath.toLowerCase()),normalizedPath}function getPathComparisonCandidates(path){return Array.from(new Set([normalizeExistingPathForComparison(path,!1),normalizeExistingPathForComparison(path,!0)].filter(candidate=>!!candidate)))}function getEntrypointPackageDir(){let entrypoint=process.argv[1];if(!entrypoint)return;let dir=dirname(entrypoint);for(;dir!==dirname(dir);){if(existsSync(join2(dir,"package.json")))return dir;dir=dirname(dir)}}function isSelfUpdatePathWritable(){let packageDir=getPackageDir();try{return accessSync(packageDir,constants.W_OK),accessSync(dirname(packageDir),constants.W_OK),!0}catch{return!1}}function isManagedByGlobalPackageManager(method,packageName,npmCommand){let packageDirCandidates=[getPackageDir(),getEntrypointPackageDir()].filter(dir=>!!dir).flatMap(dir=>getPathComparisonCandidates(dir));return getGlobalPackageRoots(method,packageName,npmCommand).some(root=>getPathComparisonCandidates(root).some(normalizedRoot=>{let rootPrefix=normalizedRoot.endsWith(sep2)?normalizedRoot:`${normalizedRoot}${sep2}`;return packageDirCandidates.some(packageDir=>packageDir.startsWith(rootPrefix))}))}function getSelfUpdateCommand(packageName,npmCommand,updatePackageTarget=packageName){let method=detectInstallMethod(),command=getSelfUpdateCommandForMethod(method,packageName,updatePackageTarget,npmCommand);if(!(!command||!isManagedByGlobalPackageManager(method,packageName,npmCommand)||!isSelfUpdatePathWritable()))return command}function getSelfUpdateUnavailableInstruction(packageName,npmCommand,updatePackageTarget=packageName){let method=detectInstallMethod(),target=normalizeSelfUpdatePackageTarget(updatePackageTarget);if(method==="bun-binary")return"Download from: https://github.com/earendil-works/pi/releases/latest";let command=getSelfUpdateCommandForMethod(method,packageName,target,npmCommand);return command?isManagedByGlobalPackageManager(method,packageName,npmCommand)&&!isSelfUpdatePathWritable()?`This installation is managed by a global ${method} install, but the install path is not writable. Update it yourself with: ${command.display}`:`This installation is not managed by a global ${method} install. Update it with the package manager, wrapper, or source checkout that provides it.`:`Update ${target.installSpec} using the package manager, wrapper, or source checkout that provides this installation.`}function findNodePackageDir(startDir){let dir=startDir;for(;dir!==dirname(dir);){if(existsSync(join2(dir,"package.json"))){let parent=dirname(dir);return basename(dir)==="dist"&&existsSync(join2(parent,"package.json"))?parent:dir}dir=dirname(dir)}return startDir}function getPackageDir(){let envDir=process.env.PI_PACKAGE_DIR;return envDir?normalizePath(envDir):isBunBinary?dirname(process.execPath):findNodePackageDir(__dirname)}function getThemesDir(){if(isBunBinary)return join2(getPackageDir(),"theme");let packageDir=getPackageDir(),srcOrDist=existsSync(join2(packageDir,"src"))?"src":"dist";return join2(packageDir,srcOrDist,"modes","interactive","theme")}function getExportTemplateDir(){if(isBunBinary)return join2(getPackageDir(),"export-html");let packageDir=getPackageDir(),srcOrDist=existsSync(join2(packageDir,"src"))?"src":"dist";return join2(packageDir,srcOrDist,"core","export-html")}function getPackageJsonPath(){return join2(getPackageDir(),"package.json")}function getReadmePath(){return resolve(join2(getPackageDir(),"README.md"))}function getDocsPath(){return resolve(join2(getPackageDir(),"docs"))}function getExamplesPath(){return resolve(join2(getPackageDir(),"examples"))}function getChangelogPath(){return resolve(join2(getPackageDir(),"CHANGELOG.md"))}function getInteractiveAssetsDir(){if(isBunBinary)return join2(getPackageDir(),"assets");let packageDir=getPackageDir(),srcOrDist=existsSync(join2(packageDir,"src"))?"src":"dist";return join2(packageDir,srcOrDist,"modes","interactive","assets")}function getBundledInteractiveAssetPath(name){return join2(getInteractiveAssetsDir(),name)}var quickJSWasmPath;function getQuickJSWasmPath(){return quickJSWasmPath??=createRequire(import.meta.url).resolve("quickjs-wasi/quickjs.wasm"),quickJSWasmPath}function resolveCodemodeWorkerSpecifier(runtime,moduleUrl){if(runtime==="bun-binary")return"./src/extensions/codemode/worker.ts";if(runtime==="bundled-node")return new URL("./codemode-worker.js",moduleUrl)}var codemodeWorkerDataUrl;function getCodemodeWorkerSpecifier(){let runtime=isBunBinary?"bun-binary":isBundledNode?"bundled-node":"unbundled",specifier=resolveCodemodeWorkerSpecifier(runtime,import.meta.url);return runtime!=="bundled-node"||!(specifier instanceof URL)?specifier:(codemodeWorkerDataUrl??=new URL(`data:text/javascript;base64,${readFileSync(specifier).toString("base64")}`),codemodeWorkerDataUrl)}function detectInstallChange(packageJsonPath=startupPackageJsonPath){if(isBunBinary||!packageJsonPath)return;let installed;try{installed=JSON.parse(stripBom(readFileSync(packageJsonPath,"utf-8")))}catch(error){return error.code==="ENOENT"?{kind:"removed"}:void 0}return installed.version&&installed.version!==VERSION?{kind:"updated",version:installed.version}:void 0}var pkg={},startupPackageJsonPath;try{let packageJsonPath=getPackageJsonPath();pkg=JSON.parse(stripBom(readFileSync(packageJsonPath,"utf-8"))),startupPackageJsonPath=packageJsonPath}catch(e){if(e.code!=="ENOENT")throw e}var piConfigName=pkg.piConfig?.name,PACKAGE_NAME=pkg.name||"@earendil-works/pi-coding-agent",APP_NAME=piConfigName||"pi",APP_TITLE=piConfigName?APP_NAME:"\u03C0",CONFIG_DIR_NAME=pkg.piConfig?.configDir||".pi",VERSION=pkg.version||"0.0.0",ENV_AGENT_DIR=`${APP_NAME.toUpperCase()}_CODING_AGENT_DIR`,ENV_SESSION_DIR=`${APP_NAME.toUpperCase()}_CODING_AGENT_SESSION_DIR`;function expandTildePath(path){return normalizePath(path)}var DEFAULT_SHARE_VIEWER_URL="https://pi.dev/session/";function getShareViewerUrl(gistId){return`${process.env.PI_SHARE_VIEWER_URL||DEFAULT_SHARE_VIEWER_URL}#${gistId}`}function getAgentDir(){let envDir=process.env[ENV_AGENT_DIR];return envDir?expandTildePath(envDir):join2(homedir2(),CONFIG_DIR_NAME,"agent")}function getCustomThemesDir(){return join2(getAgentDir(),"themes")}function getAuthPath(){return join2(getAgentDir(),"auth.json")}function getSettingsPath(){return join2(getAgentDir(),"settings.json")}function getBinDir(){return join2(getAgentDir(),"bin")}function getSessionsDir(){return join2(getAgentDir(),"sessions")}function getDebugLogPath(){return join2(getAgentDir(),`${APP_NAME}-debug.log`)}export{require_cross_spawn,spawnProcess,spawnProcessSync,waitForChildProcess,canonicalizePath,getFileRevision,isLocalPath,normalizePath,resolvePath,getCwdRelativePath,formatPathRelativeToCwdOrAbsolute,markPathIgnoredByCloudSync,splitBom,stripBom,isBunBinary,isBundledNode,detectInstallMethod,getSelfUpdateCommand,getSelfUpdateUnavailableInstruction,getPackageDir,getThemesDir,getExportTemplateDir,getReadmePath,getDocsPath,getExamplesPath,getChangelogPath,getBundledInteractiveAssetPath,getQuickJSWasmPath,getCodemodeWorkerSpecifier,detectInstallChange,PACKAGE_NAME,APP_NAME,APP_TITLE,CONFIG_DIR_NAME,VERSION,ENV_AGENT_DIR,ENV_SESSION_DIR,expandTildePath,getShareViewerUrl,getAgentDir,getCustomThemesDir,getAuthPath,getSettingsPath,getBinDir,getSessionsDir,getDebugLogPath};
|