@jx-grxf/patchpilot 0.3.1-beta → 1.0.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/.env.example +17 -1
- package/README.md +80 -22
- package/SECURITY.md +10 -2
- package/dist/cli.js +59 -13
- package/dist/cli.js.map +1 -1
- package/dist/core/agent.d.ts +3 -0
- package/dist/core/agent.js +56 -12
- package/dist/core/agent.js.map +1 -1
- package/dist/core/cleanup.d.ts +3 -0
- package/dist/core/cleanup.js +29 -0
- package/dist/core/cleanup.js.map +1 -0
- package/dist/core/doctor.d.ts +4 -1
- package/dist/core/doctor.js +119 -1
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/gemini.js +27 -14
- package/dist/core/gemini.js.map +1 -1
- package/dist/core/geminiWrapper.d.ts +51 -0
- package/dist/core/geminiWrapper.js +718 -0
- package/dist/core/geminiWrapper.js.map +1 -0
- package/dist/core/json.js +65 -1
- package/dist/core/json.js.map +1 -1
- package/dist/core/memory.d.ts +16 -0
- package/dist/core/memory.js +108 -0
- package/dist/core/memory.js.map +1 -0
- package/dist/core/modelClient.js +7 -0
- package/dist/core/modelClient.js.map +1 -1
- package/dist/core/nvidia.js +20 -2
- package/dist/core/nvidia.js.map +1 -1
- package/dist/core/openrouter.d.ts +2 -0
- package/dist/core/openrouter.js +51 -7
- package/dist/core/openrouter.js.map +1 -1
- package/dist/core/projectInit.d.ts +6 -0
- package/dist/core/projectInit.js +44 -0
- package/dist/core/projectInit.js.map +1 -0
- package/dist/core/reasoning.js +3 -0
- package/dist/core/reasoning.js.map +1 -1
- package/dist/core/session.d.ts +1 -0
- package/dist/core/session.js +46 -0
- package/dist/core/session.js.map +1 -1
- package/dist/core/types.d.ts +9 -4
- package/dist/core/workspace.d.ts +8 -0
- package/dist/core/workspace.js +314 -21
- package/dist/core/workspace.js.map +1 -1
- package/dist/tui/App.js +571 -81
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/commands.js +35 -6
- package/dist/tui/commands.js.map +1 -1
- package/dist/tui/components/ApprovalPanel.d.ts +6 -0
- package/dist/tui/components/ApprovalPanel.js +16 -0
- package/dist/tui/components/ApprovalPanel.js.map +1 -0
- package/dist/tui/components/CommandSuggestions.js +8 -3
- package/dist/tui/components/CommandSuggestions.js.map +1 -1
- package/dist/tui/components/Composer.d.ts +1 -0
- package/dist/tui/components/Composer.js +1 -1
- package/dist/tui/components/Composer.js.map +1 -1
- package/dist/tui/components/ExperimentalPanel.d.ts +10 -0
- package/dist/tui/components/ExperimentalPanel.js +33 -0
- package/dist/tui/components/ExperimentalPanel.js.map +1 -0
- package/dist/tui/components/Header.js +3 -3
- package/dist/tui/components/Header.js.map +1 -1
- package/dist/tui/components/OnboardingPanel.d.ts +13 -1
- package/dist/tui/components/OnboardingPanel.js +23 -9
- package/dist/tui/components/OnboardingPanel.js.map +1 -1
- package/dist/tui/components/Sidebar.js +32 -26
- package/dist/tui/components/Sidebar.js.map +1 -1
- package/dist/tui/components/Transcript.js +4 -3
- package/dist/tui/components/Transcript.js.map +1 -1
- package/dist/tui/format.js +7 -7
- package/dist/tui/format.js.map +1 -1
- package/dist/tui/modes.d.ts +1 -1
- package/dist/tui/modes.js +8 -2
- package/dist/tui/modes.js.map +1 -1
- package/docs/gemini-wrapper.md +87 -0
- package/docs/releases/v0.1.1-beta.md +18 -0
- package/docs/releases/v0.2.1.md +1 -1
- package/docs/releases/v0.3.1-beta.md +4 -0
- package/docs/releases/v0.4.0.md +27 -0
- package/docs/releases/v1.0.0.md +28 -0
- package/docs/showcase/patchpilot-banner.png +0 -0
- package/docs/showcase/patchpilot-logo.png +0 -0
- package/package.json +5 -2
package/.env.example
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Provider options: ollama, gemini, openrouter, nvidia, codex.
|
|
1
|
+
# Provider options: ollama, gemini, gemini-wrapper, openrouter, nvidia, codex.
|
|
2
2
|
# codex uses your Codex CLI ChatGPT login. Run: codex login
|
|
3
3
|
PATCHPILOT_PROVIDER=codex
|
|
4
4
|
PATCHPILOT_MODEL=gpt-5.5
|
|
@@ -8,6 +8,22 @@ GEMINI_API_KEY=your_gemini_api_key_here
|
|
|
8
8
|
OPENROUTER_API_KEY=your_openrouter_api_key_here
|
|
9
9
|
NVIDIA_API_KEY=your_nvidia_api_key_here
|
|
10
10
|
|
|
11
|
+
# Optional: Gemini-Wrapper provider.
|
|
12
|
+
# Default mode uses PatchPilot's managed Python venv for `gemini_webapi`.
|
|
13
|
+
# PatchPilot creates ~/.patchpilot/gemini-wrapper-venv automatically.
|
|
14
|
+
# Onboarding can create ~/.patchpilot/gemini-cookies.json from masked pasted values.
|
|
15
|
+
# PatchPilot never scans browser cookies or web login sessions.
|
|
16
|
+
PATCHPILOT_GEMINI_WRAPPER_MODE=python
|
|
17
|
+
PATCHPILOT_GEMINI_WRAPPER_BOOTSTRAP_PYTHON=python3
|
|
18
|
+
PATCHPILOT_GEMINI_WRAPPER_COOKIES_JSON=/Users/you/.patchpilot/gemini-cookies.json
|
|
19
|
+
PATCHPILOT_GEMINI_WRAPPER_MIN_INTERVAL_MS=1500
|
|
20
|
+
PATCHPILOT_GEMINI_WRAPPER_TIMEOUT_MS=180000
|
|
21
|
+
# Alternative HTTP mode for an explicit OpenAI-compatible wrapper endpoint.
|
|
22
|
+
PATCHPILOT_GEMINI_WRAPPER_BASE_URL=http://localhost:8787/v1
|
|
23
|
+
PATCHPILOT_GEMINI_WRAPPER_API_KEY=your_wrapper_api_key_here
|
|
24
|
+
|
|
11
25
|
# Optional tuning shared by local and API providers.
|
|
12
26
|
PATCHPILOT_NUM_PREDICT=1024
|
|
13
27
|
PATCHPILOT_TEMPERATURE=0.1
|
|
28
|
+
PATCHPILOT_THINKING_MODE=adaptive
|
|
29
|
+
PATCHPILOT_SUBAGENTS=off
|
package/README.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
+
<img src="https://raw.githubusercontent.com/jx-grxf/PatchPilot/main/docs/showcase/patchpilot-logo.png" alt="PatchPilot logo" width="112">
|
|
4
|
+
|
|
3
5
|
# PatchPilot
|
|
4
6
|
|
|
5
7
|
**A local-first coding-agent TUI that makes repo changes visible, permissioned, and easy to review across local, remote, and cloud model routes.**
|
|
6
8
|
|
|
7
9
|
[](https://github.com/jx-grxf/PatchPilot/actions/workflows/ci.yml)
|
|
8
|
-
](https://www.npmjs.com/package/@jx-grxf/patchpilot)
|
|
11
|
+
[](https://www.npmjs.com/package/@jx-grxf/patchpilot)
|
|
12
|
+

|
|
9
13
|

|
|
10
14
|

|
|
11
15
|

|
|
@@ -13,20 +17,29 @@
|
|
|
13
17
|
[](LICENSE)
|
|
14
18
|
|
|
15
19
|
<p>
|
|
16
|
-
<strong>Visible tools.</strong> Explicit permissions. Local Ollama. Remote Ollama. Gemini. OpenRouter. NVIDIA. Codex.
|
|
20
|
+
<strong>Visible tools.</strong> Explicit permissions. Local Ollama. Remote Ollama. Gemini. Gemini-Wrapper. OpenRouter. NVIDIA. Codex.
|
|
17
21
|
</p>
|
|
18
22
|
|
|
19
23
|
</div>
|
|
20
24
|
|
|
21
25
|
---
|
|
22
26
|
|
|
23
|
-
##
|
|
27
|
+
## Product Visual
|
|
28
|
+
|
|
29
|
+
<p align="center">
|
|
30
|
+
<img src="https://raw.githubusercontent.com/jx-grxf/PatchPilot/main/docs/showcase/patchpilot-banner.png" alt="PatchPilot product visual" width="920">
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
## Current TUI Screenshot
|
|
24
34
|
|
|
25
35
|
<p align="center">
|
|
26
36
|
<img src="docs/showcase/patchpilot-showcase.svg" alt="PatchPilot terminal interface overview" width="920">
|
|
27
37
|
</p>
|
|
28
38
|
|
|
29
|
-
PatchPilot is a terminal interface for running coding-agent tasks inside a repository. It shows what the agent is doing, keeps risky actions behind explicit permissions, and supports local Ollama, remote Ollama, Google Gemini, OpenRouter, NVIDIA NIM-compatible endpoints, and Codex CLI OAuth.
|
|
39
|
+
PatchPilot is a terminal interface for running coding-agent tasks inside a repository. It shows what the agent is doing, keeps risky actions behind explicit permissions, and supports local Ollama, remote Ollama, Google Gemini, experimental Gemini Web wrapper routing, OpenRouter, NVIDIA NIM-compatible endpoints, and Codex CLI OAuth.
|
|
40
|
+
|
|
41
|
+
> [!IMPORTANT]
|
|
42
|
+
> PatchPilot v1.0.0 is the first stable CLI release for visible, permissioned coding-agent runs. Experimental provider and memory/file-analysis features remain opt-in.
|
|
30
43
|
|
|
31
44
|
---
|
|
32
45
|
|
|
@@ -34,6 +47,7 @@ PatchPilot is a terminal interface for running coding-agent tasks inside a repos
|
|
|
34
47
|
|
|
35
48
|
- [Highlights](#highlights)
|
|
36
49
|
- [Why This Exists](#why-this-exists)
|
|
50
|
+
- [Current Workflow](#current-workflow)
|
|
37
51
|
- [Requirements](#requirements)
|
|
38
52
|
- [Quick Start](#quick-start)
|
|
39
53
|
- [Usage](#usage)
|
|
@@ -53,10 +67,10 @@ PatchPilot is a terminal interface for running coding-agent tasks inside a repos
|
|
|
53
67
|
|---|---|
|
|
54
68
|
| Local-first by default | Uses Ollama on your own machine unless you choose another route. |
|
|
55
69
|
| Remote GPU workflow | Connect your laptop TUI to an Ollama host on a desktop, LAN, or Tailscale machine. |
|
|
56
|
-
| Cloud provider routes | Gemini, OpenRouter, NVIDIA, and Codex CLI OAuth are available from one TUI. |
|
|
70
|
+
| Cloud provider routes | Gemini, Gemini-Wrapper, OpenRouter, NVIDIA, and Codex CLI OAuth are available from one TUI. |
|
|
57
71
|
| Guided onboarding | First-run setup walks through local/remote mode, provider auth, host discovery, and model choice. |
|
|
58
72
|
| Observable agent loop | Transcript, tool calls, telemetry, token counts, provider cache hits, latency, and cost estimates are visible. |
|
|
59
|
-
| Explicit permissions | Risky tools
|
|
73
|
+
| Explicit permissions | Risky tools show a sticky approval box unless trusted bypass is explicitly accepted. |
|
|
60
74
|
| Workspace boundary | File tools are constrained to the selected project root and block common secret files. |
|
|
61
75
|
| Slash-command palette | Type `/` for browsable commands, provider switching, modes, models, diagnostics, and host selection. |
|
|
62
76
|
| Advisor subagents | Explorer, planner, and reviewer advisor calls can brief the main agent before it edits. |
|
|
@@ -67,6 +81,8 @@ PatchPilot is a terminal interface for running coding-agent tasks inside a repos
|
|
|
67
81
|
|
|
68
82
|
Most local coding-agent experiments fall into one of two traps: they are either raw scripts that feel painful to use, or polished tools that hide too much of what is happening. PatchPilot aims for the middle: a practical TUI where every file read, search, proposed write, command, model route, and token/cost signal stays visible.
|
|
69
83
|
|
|
84
|
+
## Current Workflow
|
|
85
|
+
|
|
70
86
|
The core workflow is intentionally simple:
|
|
71
87
|
|
|
72
88
|
1. Open a repository.
|
|
@@ -84,7 +100,7 @@ Mode behavior is intentionally explicit: `plan` is read-only, `build` keeps writ
|
|
|
84
100
|
| Node.js 22 or newer | Required for the published CLI and source builds. |
|
|
85
101
|
| Git | Required for repository context and normal development workflows. |
|
|
86
102
|
| Ollama | Optional, only needed for local or remote Ollama inference. |
|
|
87
|
-
| Provider API key | Optional, only needed for Gemini, OpenRouter, or NVIDIA routes. |
|
|
103
|
+
| Provider API key | Optional, only needed for Gemini, Gemini-Wrapper remote URLs, OpenRouter, or NVIDIA routes. |
|
|
88
104
|
| Codex CLI login | Optional, only needed for the Codex provider route. |
|
|
89
105
|
|
|
90
106
|
## Quick Start
|
|
@@ -132,7 +148,10 @@ cd /path/to/your/project
|
|
|
132
148
|
patchpilot "find likely test gaps in this repo"
|
|
133
149
|
```
|
|
134
150
|
|
|
135
|
-
Use
|
|
151
|
+
Use bypass permissions only when you intentionally want PatchPilot to modify files or run commands without per-tool approval:
|
|
152
|
+
|
|
153
|
+
> [!WARNING]
|
|
154
|
+
> `--apply --allow-shell` bypasses per-tool approval. Use it only in trusted workspaces and review `/diff` before committing.
|
|
136
155
|
|
|
137
156
|
```bash
|
|
138
157
|
patchpilot "add tests for the parser" --apply --allow-shell
|
|
@@ -154,15 +173,16 @@ patchpilot resume [session-id] [--workspace <path>]
|
|
|
154
173
|
| Option | Description |
|
|
155
174
|
|---|---|
|
|
156
175
|
| `--workspace <path>` | Project root the agent may inspect. Defaults to the current directory. |
|
|
157
|
-
| `--provider <name>` | Model provider route. Supports `ollama`, `gemini`/`google`, `openrouter`/`open-router`, `nvidia`/`nim`, and `codex`/`openai`/`openai-codex`. |
|
|
176
|
+
| `--provider <name>` | Model provider route. Supports `ollama`, `gemini`/`google`, `gemini-wrapper`/`geminiwrapper`, `openrouter`/`open-router`, `nvidia`/`nim`, and `codex`/`openai`/`openai-codex`. |
|
|
158
177
|
| `--model <name>` | Model name for the selected provider. |
|
|
159
178
|
| `--ollama-url <url>` | Ollama base URL. Defaults to `http://127.0.0.1:11434`. |
|
|
160
179
|
| `--steps <count>` | Maximum agent loop steps before stopping. |
|
|
161
|
-
| `--thinking <mode>` | Step-budget mode: `fixed` or `adaptive`. |
|
|
180
|
+
| `--thinking <mode>` | Step-budget mode: `fixed` or `adaptive`. Defaults to `adaptive`. |
|
|
162
181
|
| `--reasoning <effort>` | Provider reasoning effort: `none`, `low`, `medium`, `high`, `xhigh`, or `adaptive`. Unsupported provider/model combinations fall back to provider defaults. |
|
|
163
182
|
| `--apply` | Allows file writes inside the workspace. |
|
|
164
183
|
| `--allow-shell` | Allows shell commands inside the workspace. |
|
|
165
|
-
| `--
|
|
184
|
+
| `--subagents` | Enables explorer/planner/reviewer advisor calls. Defaults to off. |
|
|
185
|
+
| `--no-subagents` | Disables explorer/planner/reviewer advisor calls. |
|
|
166
186
|
|
|
167
187
|
Useful slash commands inside the TUI:
|
|
168
188
|
|
|
@@ -172,13 +192,13 @@ Useful slash commands inside the TUI:
|
|
|
172
192
|
| `/help <command>` | Explain one command, for example `/help think` or `/help model`. |
|
|
173
193
|
| `/onboarding` | Open guided provider/auth/model setup. |
|
|
174
194
|
| `/mode plan` | Read-only planning mode. |
|
|
175
|
-
| `/mode build` | Implementation mode; writes and shell
|
|
195
|
+
| `/mode build` | Implementation mode; writes, scripts, tests, and shell require per-tool approval. |
|
|
176
196
|
| `/think fixed\|adaptive` | Switch between fixed and adaptive step budgets. |
|
|
177
197
|
| `/reasoning none\|low\|medium\|high\|xhigh\|adaptive` | Set provider reasoning effort where supported. |
|
|
178
|
-
| `/write on\|off` |
|
|
179
|
-
| `/shell on\|off` |
|
|
198
|
+
| `/write on\|off` | Requests trusted bypass for direct writes, or returns to approval-gated build mode. |
|
|
199
|
+
| `/shell on\|off` | Requests trusted bypass for direct shell commands, or returns to approval-gated build mode. |
|
|
180
200
|
| `/agents on\|off` | Enable or disable advisor subagents. |
|
|
181
|
-
| `/provider ollama\|gemini\|openrouter\|nvidia\|codex` | Switch inference provider. |
|
|
201
|
+
| `/provider ollama\|gemini\|gemini-wrapper\|openrouter\|nvidia\|codex` | Switch inference provider. |
|
|
182
202
|
| `/model <query>` | Search and switch the model for the current provider. |
|
|
183
203
|
| `/models [query\|number]` | Refresh, search, browse, or select provider models. |
|
|
184
204
|
| `/connect` | Scan LAN/Tailscale for reachable Ollama hosts. |
|
|
@@ -186,8 +206,13 @@ Useful slash commands inside the TUI:
|
|
|
186
206
|
| `/eject [model\|all]` | Unload Ollama model(s) from the active host. |
|
|
187
207
|
| `/hosts` | Re-scan reachable Ollama hosts. |
|
|
188
208
|
| `/doctor` | Run provider diagnostics from inside the TUI. |
|
|
209
|
+
| `/doctor fix` | Apply safe doctor repairs, such as installing the managed Gemini-API bridge. |
|
|
210
|
+
| `/cleanup cache\|sessions\|temp\|all` | Clean PatchPilot workspace state. |
|
|
211
|
+
| `/experimental` | Open the experimental checkbox menu; use Space to toggle file-analysis, memory, and subagents. |
|
|
212
|
+
| `/init` | Ask the selected model to inspect the repository and create or update `PATCHPILOT.md`. |
|
|
213
|
+
| `/new` | Start a fresh session and clear current context. |
|
|
189
214
|
| `/sessions` | List recent sessions for the current workspace. |
|
|
190
|
-
| `/resume [session-id]` |
|
|
215
|
+
| `/resume [session-id]` | Resume a previous session and inject its compact summary into the next run. |
|
|
191
216
|
| `/diff` | Show the current Git diff. |
|
|
192
217
|
| `/approve once\|session` | Approve a pending risky tool request. |
|
|
193
218
|
| `/deny` | Deny a pending risky tool request. |
|
|
@@ -196,6 +221,8 @@ Useful slash commands inside the TUI:
|
|
|
196
221
|
|
|
197
222
|
The transcript and sidebar have internal scroll areas. With an empty prompt, use left/right to choose the sidebar or transcript, then Page Up/Page Down and Home/End to navigate long sessions.
|
|
198
223
|
|
|
224
|
+
Experimental file analysis allows `inspect_document` to read supported files outside the workspace after per-path approval when the user provides an absolute path, including PNG/JPEG/WebP/GIF metadata, PDFs, DOCX, Markdown, and text/code files. Experimental memory stores durable workspace notes in `~/.patchpilot/memory.sqlite`; `memory_remember` requires write approval and `memory_search` is read-only.
|
|
225
|
+
|
|
199
226
|
## Providers
|
|
200
227
|
|
|
201
228
|
| Provider route | Accepted values | Default model | Best for | Setup |
|
|
@@ -203,6 +230,7 @@ The transcript and sidebar have internal scroll areas. With an empty prompt, use
|
|
|
203
230
|
| Ollama local | `ollama` | `qwen2.5-coder:7b` | Private local coding work and offline experiments. | Install Ollama, pull a model, run `patchpilot`. |
|
|
204
231
|
| Ollama remote | `ollama` with `--ollama-url` or `/connect` | Host model inventory | Laptop editing with a stronger desktop/server GPU. | Expose Ollama on the host, then use `/connect` or `--ollama-url`. |
|
|
205
232
|
| Google Gemini | `gemini`, `google` | `gemini-2.5-flash` | Fast cloud inference through a Gemini API key. | Store `GEMINI_API_KEY` in `~/.patchpilot/.env` or use onboarding. |
|
|
233
|
+
| Gemini-Wrapper | `gemini-wrapper`, `geminiwrapper` | `auto` | Experimental advanced bridge to the pinned `gemini_webapi` Python wrapper, with optional HTTP-wrapper mode. | Use onboarding to paste `__Secure-1PSID`, then run `/doctor fix` to approve the pinned managed bridge install. PatchPilot creates `~/.patchpilot/gemini-cookies.json`, asks the WebAPI for real available models, and never scans browser cookies. |
|
|
206
234
|
| OpenRouter | `openrouter`, `open-router` | `openrouter/auto` | Broad model routing, auto model selection, and free variants. | Store `OPENROUTER_API_KEY` in `~/.patchpilot/.env` or use onboarding. |
|
|
207
235
|
| NVIDIA | `nvidia`, `nim` | `meta/llama-3.1-70b-instruct` | NVIDIA NIM OpenAI-compatible endpoints. | Store `NVIDIA_API_KEY` in `~/.patchpilot/.env` or use onboarding. |
|
|
208
236
|
| Codex CLI | `codex`, `openai`, `openai-codex` | `gpt-5.5` | Using an existing Codex CLI OAuth login. | Run `codex login`, then `patchpilot --provider codex`. |
|
|
@@ -212,6 +240,7 @@ Examples:
|
|
|
212
240
|
```bash
|
|
213
241
|
patchpilot --provider ollama --model qwen2.5-coder:7b
|
|
214
242
|
patchpilot --provider gemini --model gemini-2.5-flash
|
|
243
|
+
patchpilot --provider gemini-wrapper --model auto
|
|
215
244
|
patchpilot --provider openrouter --model openrouter/auto
|
|
216
245
|
patchpilot --provider nvidia --model meta/llama-3.1-70b-instruct
|
|
217
246
|
patchpilot --provider codex --model gpt-5.5
|
|
@@ -225,6 +254,7 @@ Provider diagnostics:
|
|
|
225
254
|
```bash
|
|
226
255
|
patchpilot doctor --provider ollama
|
|
227
256
|
patchpilot doctor --provider gemini
|
|
257
|
+
patchpilot doctor --provider gemini-wrapper
|
|
228
258
|
patchpilot doctor --provider openrouter
|
|
229
259
|
patchpilot doctor --provider nvidia
|
|
230
260
|
patchpilot doctor --provider codex
|
|
@@ -234,9 +264,35 @@ PatchPilot caches model discovery for a short TTL inside the running TUI, so nor
|
|
|
234
264
|
|
|
235
265
|
PatchPilot reads provider cache telemetry when the provider reports it, for example Codex cached input tokens or OpenRouter `prompt_tokens_details.cached_tokens`, then displays cache hit rate as `cached / input`.
|
|
236
266
|
|
|
237
|
-
Reasoning support is provider and model dependent. Codex accepts fixed reasoning levels. OpenRouter receives
|
|
267
|
+
Reasoning support is provider and model dependent. Codex accepts fixed reasoning levels. OpenRouter receives `reasoning.effort` only for models whose metadata advertises reasoning support. Gemini uses Thinking configuration where the selected model exposes it; some Gemini models cannot disable thinking. Gemini-Wrapper stays on wrapper defaults because wrapper compatibility varies. Ollama only receives native `think` values for known thinking model families. NVIDIA reasoning effort is limited to supported GPT-OSS NIM routes.
|
|
268
|
+
|
|
269
|
+
Gemini-Wrapper is intentionally explicit and unofficial. In default `python` bridge mode, PatchPilot creates a managed Python venv and installs the pinned wrapper there only after `/doctor fix` or `patchpilot doctor --fix` approval:
|
|
270
|
+
|
|
271
|
+
> [!CAUTION]
|
|
272
|
+
> `__Secure-1PSID` acts like a Google session token. Never paste it into issues, logs, chats, or commits.
|
|
273
|
+
|
|
274
|
+
```sh
|
|
275
|
+
~/.patchpilot/gemini-wrapper-venv
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
This avoids Homebrew Python's externally-managed-environment / PEP 668 block. Then PatchPilot runs the bridge command itself for model discovery and chat requests. Use `/onboarding`, choose Gemini-Wrapper, paste `__Secure-1PSID`, and optionally paste `__Secure-1PSIDTS`. PatchPilot writes `~/.patchpilot/gemini-cookies.json` with owner-only permissions and stores the file path in `~/.patchpilot/.env`.
|
|
279
|
+
|
|
280
|
+
```sh
|
|
281
|
+
PATCHPILOT_PROVIDER=gemini-wrapper
|
|
282
|
+
PATCHPILOT_MODEL=auto
|
|
283
|
+
PATCHPILOT_GEMINI_WRAPPER_MODE=python
|
|
284
|
+
PATCHPILOT_GEMINI_WRAPPER_COOKIES_JSON=/Users/you/.patchpilot/gemini-cookies.json
|
|
285
|
+
PATCHPILOT_GEMINI_WRAPPER_MIN_INTERVAL_MS=1500
|
|
286
|
+
PATCHPILOT_GEMINI_WRAPPER_TIMEOUT_MS=180000
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
The cookie JSON must contain `__Secure-1PSID`; `__Secure-1PSIDTS` is optional for some accounts. If the optional timestamp expires, PatchPilot retries once without it. Transient WebAPI network timeouts are retried inside the bridge. `auto` lets Gemini Web pick its default model and avoids relying on brittle Web model headers. Env alternatives are `GEMINI_SECURE_1PSID` and `GEMINI_SECURE_1PSIDTS`. See [docs/gemini-wrapper.md](docs/gemini-wrapper.md) for the exact setup steps.
|
|
290
|
+
|
|
291
|
+
PatchPilot also sets `GEMINI_COOKIE_PATH` to `~/.patchpilot/gemini-webapi-cache` for the Python process so refreshed wrapper cookies stay in a local owner-only cache instead of a temporary directory.
|
|
292
|
+
|
|
293
|
+
PatchPilot does not inspect Chrome, Safari, Firefox, Arc, Edge, Brave, Keychain, or browser cookie stores, and it does not reuse Google web-login sessions automatically. Advanced users can still set `PATCHPILOT_GEMINI_WRAPPER_MODE=http` plus `PATCHPILOT_GEMINI_WRAPPER_BASE_URL` for an explicit OpenAI-compatible `/v1` endpoint.
|
|
238
294
|
|
|
239
|
-
OpenRouter `:free` models are rate-limited by OpenRouter. PatchPilot warns when a selected model ID ends in `:free
|
|
295
|
+
OpenRouter `:free` models are rate-limited by OpenRouter. PatchPilot warns when a selected model ID ends in `:free`, and OpenRouter credit or rate-limit failures are surfaced as explicit provider errors.
|
|
240
296
|
|
|
241
297
|
## Remote Ollama
|
|
242
298
|
|
|
@@ -277,9 +333,9 @@ PATCHPILOT_NUM_CTX=4096 PATCHPILOT_NUM_PREDICT=768 patchpilot
|
|
|
277
333
|
PatchPilot is designed to keep powerful actions boring and reviewable:
|
|
278
334
|
|
|
279
335
|
- File access is constrained to one workspace root.
|
|
280
|
-
- Secret-like files such as `.env`, `.npmrc`, SSH keys, and
|
|
336
|
+
- Secret-like files such as `.env`, `.envrc`, `.npmrc`, `.netrc`, SSH keys, PEM/key/cert bundles, and credential files are blocked from normal file tools.
|
|
281
337
|
- Writes are blocked by default; in the TUI, risky write tools request approval, and `--apply` keeps the legacy always-allow write path.
|
|
282
|
-
- Shell commands are blocked by default; dedicated script/test tools request approval
|
|
338
|
+
- Shell commands are blocked by default; dedicated script/test tools request approval and show the package script body before running. `--allow-shell` keeps the legacy always-allow shell path.
|
|
283
339
|
- Shell execution uses a restricted single-command runner.
|
|
284
340
|
- Provider config is stored in `~/.patchpilot/.env`, not in the current repository by default.
|
|
285
341
|
- Session logs are stored as append-only JSONL in `.patchpilot/sessions/`; that folder is gitignored. A global index in `~/.patchpilot/session-index.json` powers `patchpilot sessions` and `/resume`.
|
|
@@ -300,7 +356,7 @@ run tests
|
|
|
300
356
|
commit manually with git
|
|
301
357
|
```
|
|
302
358
|
|
|
303
|
-
PatchPilot now has approval prompts and a Git diff command, but it still does not replace human review. Inline rich diff review and commit/PR automation remain future work.
|
|
359
|
+
PatchPilot now has sticky approval prompts and a Git diff command, but it still does not replace human review. Inline rich diff review, real context resume, and commit/PR automation remain future work.
|
|
304
360
|
|
|
305
361
|
## Tech Stack
|
|
306
362
|
|
|
@@ -311,7 +367,7 @@ PatchPilot now has approval prompts and a Git diff command, but it still does no
|
|
|
311
367
|
| TUI | Ink, React, ink-text-input |
|
|
312
368
|
| Agent protocol | JSON command envelope validated with Zod |
|
|
313
369
|
| Sessions | Append-only JSONL in `.patchpilot/sessions` plus global index in `~/.patchpilot` |
|
|
314
|
-
| Providers | Ollama chat API, Gemini generateContent API, OpenRouter OpenAI-compatible API, NVIDIA OpenAI-compatible API, Codex CLI OAuth backend |
|
|
370
|
+
| Providers | Ollama chat API, Gemini generateContent API, Gemini-Wrapper OpenAI-compatible API, OpenRouter OpenAI-compatible API, NVIDIA OpenAI-compatible API, Codex CLI OAuth backend |
|
|
315
371
|
| Tests | Vitest |
|
|
316
372
|
| CI | GitHub Actions |
|
|
317
373
|
|
|
@@ -353,6 +409,8 @@ Release notes are kept in [docs/releases](docs/releases).
|
|
|
353
409
|
|
|
354
410
|
| Version | Notes |
|
|
355
411
|
|---|---|
|
|
412
|
+
| `v1.0.0` | [Release notes](docs/releases/v1.0.0.md) |
|
|
413
|
+
| `v0.4.0` | [Release notes](docs/releases/v0.4.0.md) |
|
|
356
414
|
| `v0.3.1-beta` | [Release notes](docs/releases/v0.3.1-beta.md) |
|
|
357
415
|
| `v0.3.0` | [Release notes](docs/releases/v0.3.0.md) |
|
|
358
416
|
| `v0.2.1` | [Release notes](docs/releases/v0.2.1.md) |
|
package/SECURITY.md
CHANGED
|
@@ -6,7 +6,11 @@ PatchPilot is public preview software. Security fixes target the latest publishe
|
|
|
6
6
|
|
|
7
7
|
## Reporting a Vulnerability
|
|
8
8
|
|
|
9
|
-
Please report security issues through GitHub Security Advisories
|
|
9
|
+
Please report security issues through GitHub Security Advisories:
|
|
10
|
+
|
|
11
|
+
https://github.com/jx-grxf/PatchPilot/security/advisories/new
|
|
12
|
+
|
|
13
|
+
Include:
|
|
10
14
|
|
|
11
15
|
- affected version or commit
|
|
12
16
|
- reproduction steps
|
|
@@ -17,4 +21,8 @@ Do not open a public issue for a vulnerability before the maintainer has had tim
|
|
|
17
21
|
|
|
18
22
|
## Security Model
|
|
19
23
|
|
|
20
|
-
PatchPilot keeps file tools inside one workspace root, blocks common secret files, and requires explicit
|
|
24
|
+
PatchPilot keeps file tools inside one workspace root, blocks common secret files and credential-like extensions, and requires approval or explicit trusted bypass for writes and shell commands. Package-script approvals include the resolved script body because scripts can hide publish, push, or destructive commands.
|
|
25
|
+
|
|
26
|
+
Session logs are stored in `.patchpilot/sessions/` under the workspace and summarized in `~/.patchpilot/session-index.json`. Treat those logs as local project metadata: they may contain prompts, tool names, summaries, and clipped command output. Do not use cloud providers or trusted bypass in repositories containing secrets you do not want processed by external model providers.
|
|
27
|
+
|
|
28
|
+
Gemini-Wrapper support runs either the installed `gemini_webapi` Python package with an explicit cookie source or an explicit OpenAI-compatible URL from `PATCHPILOT_GEMINI_WRAPPER_BASE_URL`. PatchPilot must not scan browser profiles, cookies, Keychain items, or Google web-login sessions for provider auth.
|
package/dist/cli.js
CHANGED
|
@@ -5,11 +5,14 @@ import { readFileSync } from "node:fs";
|
|
|
5
5
|
import { render } from "ink";
|
|
6
6
|
import { Command } from "commander";
|
|
7
7
|
import { defaultCodexModel } from "./core/codex.js";
|
|
8
|
+
import { cleanupPatchPilot, readCleanupTarget } from "./core/cleanup.js";
|
|
8
9
|
import { loadPatchPilotEnv } from "./core/env.js";
|
|
9
10
|
import { defaultGeminiModel } from "./core/gemini.js";
|
|
11
|
+
import { defaultGeminiWrapperModel } from "./core/geminiWrapper.js";
|
|
10
12
|
import { normalizeModelProvider, readModelProvider } from "./core/modelClient.js";
|
|
11
13
|
import { defaultNvidiaModel } from "./core/nvidia.js";
|
|
12
14
|
import { runDoctor } from "./core/doctor.js";
|
|
15
|
+
import { ensurePatchPilotInstructions } from "./core/projectInit.js";
|
|
13
16
|
import { defaultOllamaModel, resolveOllamaBaseUrl } from "./core/ollama.js";
|
|
14
17
|
import { defaultOpenRouterModel } from "./core/openrouter.js";
|
|
15
18
|
import { listIndexedSessions, listWorkspaceSessions, loadSessionSummary } from "./core/session.js";
|
|
@@ -20,32 +23,61 @@ const defaultProvider = readModelProvider();
|
|
|
20
23
|
const defaultModel = process.env.PATCHPILOT_MODEL ??
|
|
21
24
|
(defaultProvider === "gemini"
|
|
22
25
|
? defaultGeminiModel
|
|
23
|
-
: defaultProvider === "
|
|
24
|
-
?
|
|
25
|
-
: defaultProvider === "
|
|
26
|
-
?
|
|
27
|
-
: defaultProvider === "
|
|
28
|
-
?
|
|
29
|
-
:
|
|
26
|
+
: defaultProvider === "gemini-wrapper"
|
|
27
|
+
? defaultGeminiWrapperModel
|
|
28
|
+
: defaultProvider === "openrouter"
|
|
29
|
+
? defaultOpenRouterModel
|
|
30
|
+
: defaultProvider === "nvidia"
|
|
31
|
+
? defaultNvidiaModel
|
|
32
|
+
: defaultProvider === "codex"
|
|
33
|
+
? defaultCodexModel
|
|
34
|
+
: defaultOllamaModel);
|
|
30
35
|
const program = new Command();
|
|
31
36
|
program.enablePositionalOptions();
|
|
32
37
|
program
|
|
33
38
|
.name("patchpilot")
|
|
34
39
|
.description("Local-first coding agent TUI powered by Ollama and OpenAI-compatible providers.")
|
|
35
40
|
.version(readPackageVersion());
|
|
41
|
+
program
|
|
42
|
+
.command("init")
|
|
43
|
+
.description("Create PATCHPILOT.md workspace instructions.")
|
|
44
|
+
.option("--workspace <path>", "Workspace root", process.cwd())
|
|
45
|
+
.action(async (options) => {
|
|
46
|
+
const result = await ensurePatchPilotInstructions(path.resolve(options.workspace));
|
|
47
|
+
console.log(`${result.created ? "created" : "exists"} ${result.path}`);
|
|
48
|
+
});
|
|
49
|
+
program
|
|
50
|
+
.command("cleanup")
|
|
51
|
+
.description("Clean PatchPilot workspace cache, sessions, temp files, or all.")
|
|
52
|
+
.argument("[target]", "cache, sessions, temp, or all", "cache")
|
|
53
|
+
.option("--workspace <path>", "Workspace root", process.cwd())
|
|
54
|
+
.action(async (target, options) => {
|
|
55
|
+
const cleanupTarget = readCleanupTarget(target);
|
|
56
|
+
if (!cleanupTarget) {
|
|
57
|
+
console.error("Use one of: cache, sessions, temp, all");
|
|
58
|
+
process.exitCode = 1;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const removed = await cleanupPatchPilot(path.resolve(options.workspace), cleanupTarget);
|
|
62
|
+
console.log(`cleaned ${removed.join(", ") || cleanupTarget}`);
|
|
63
|
+
});
|
|
36
64
|
program
|
|
37
65
|
.command("doctor")
|
|
38
66
|
.description("Check local PatchPilot requirements.")
|
|
39
|
-
.option("--provider <name>", "Model provider: ollama, gemini, openrouter, nvidia, or codex.", defaultProvider)
|
|
67
|
+
.option("--provider <name>", "Model provider: ollama, gemini, gemini-wrapper, openrouter, nvidia, or codex.", defaultProvider)
|
|
40
68
|
.option("--check-url <url>", "Ollama base URL to verify", defaultOllamaUrl)
|
|
41
69
|
.option("--ollama-url <url>", "Alias for --check-url.")
|
|
42
70
|
.option("--check-model <name>", "Model name to verify", defaultModel)
|
|
43
71
|
.option("--model <name>", "Alias for --check-model.")
|
|
72
|
+
.option("--fix", "Apply safe doctor fixes, such as installing the managed Gemini-API bridge.", false)
|
|
44
73
|
.action(async (options) => {
|
|
45
|
-
const results = await runDoctor(normalizeModelProvider(options.provider), options.ollamaUrl ?? options.checkUrl, options.model ?? options.checkModel
|
|
74
|
+
const results = await runDoctor(normalizeModelProvider(options.provider), options.ollamaUrl ?? options.checkUrl, options.model ?? options.checkModel, {
|
|
75
|
+
fix: Boolean(options.fix)
|
|
76
|
+
});
|
|
46
77
|
for (const result of results) {
|
|
47
78
|
const marker = result.ok ? "ok" : "fail";
|
|
48
|
-
|
|
79
|
+
const action = result.action ? ` ${result.action}` : "";
|
|
80
|
+
console.log(`${marker.padEnd(5)} ${result.name}${action}: ${result.details}`);
|
|
49
81
|
}
|
|
50
82
|
process.exitCode = results.every((result) => result.ok) ? 0 : 1;
|
|
51
83
|
});
|
|
@@ -86,19 +118,20 @@ program
|
|
|
86
118
|
program
|
|
87
119
|
.argument("[task...]", "Task for the local coding agent.")
|
|
88
120
|
.option("--workspace <path>", "Workspace root", process.cwd())
|
|
89
|
-
.option("--provider <name>", "Model provider: ollama, gemini, openrouter, nvidia, or codex.", defaultProvider)
|
|
121
|
+
.option("--provider <name>", "Model provider: ollama, gemini, gemini-wrapper, openrouter, nvidia, or codex.", defaultProvider)
|
|
90
122
|
.option("--model <name>", "Model name", defaultModel)
|
|
91
123
|
.option("--ollama-url <url>", "Ollama base URL", defaultOllamaUrl)
|
|
92
124
|
.option("--steps <count>", "Maximum agent steps", "8")
|
|
93
|
-
.option("--thinking <mode>", "Thinking budget mode: fixed or adaptive.", process.env.PATCHPILOT_THINKING_MODE ?? "
|
|
125
|
+
.option("--thinking <mode>", "Thinking budget mode: fixed or adaptive.", process.env.PATCHPILOT_THINKING_MODE ?? "adaptive")
|
|
94
126
|
.option("--reasoning <effort>", "Provider reasoning effort: none, low, medium, high, xhigh, or adaptive.", process.env.PATCHPILOT_REASONING_EFFORT ?? "medium")
|
|
95
127
|
.option("--apply", "Allow file writes inside the workspace.", false)
|
|
96
128
|
.option("--allow-shell", "Allow shell commands inside the workspace.", false)
|
|
129
|
+
.option("--subagents", "Enable planner and reviewer subagents.", readBooleanEnv(process.env.PATCHPILOT_SUBAGENTS, false))
|
|
97
130
|
.option("--no-subagents", "Disable planner and reviewer subagents for faster local runs.")
|
|
98
131
|
.action((taskParts, options) => {
|
|
99
132
|
const workspace = path.resolve(String(options.workspace));
|
|
100
133
|
const maxSteps = Number.parseInt(String(options.steps), 10);
|
|
101
|
-
render(_jsx(App, { initialTask: taskParts.join(" ").trim() || undefined, provider: readModelProvider({ PATCHPILOT_PROVIDER: String(options.provider) }), model: String(options.model), ollamaUrl: String(options.ollamaUrl), workspace: workspace, allowWrite: Boolean(options.apply), allowShell: Boolean(options.allowShell), maxSteps: Number.isFinite(maxSteps) ? maxSteps : 8, thinkingMode: String(options.thinking) === "adaptive" ? "adaptive" : "fixed", reasoningEffort: readReasoningEffort(String(options.reasoning)), subagents: options.subagents
|
|
134
|
+
render(_jsx(App, { initialTask: taskParts.join(" ").trim() || undefined, provider: readModelProvider({ PATCHPILOT_PROVIDER: String(options.provider) }), model: String(options.model), ollamaUrl: String(options.ollamaUrl), workspace: workspace, allowWrite: Boolean(options.apply), allowShell: Boolean(options.allowShell), maxSteps: Number.isFinite(maxSteps) ? maxSteps : 8, thinkingMode: String(options.thinking) === "adaptive" ? "adaptive" : "fixed", reasoningEffort: readReasoningEffort(String(options.reasoning)), subagents: Boolean(options.subagents) }));
|
|
102
135
|
});
|
|
103
136
|
await program.parseAsync(process.argv);
|
|
104
137
|
function readReasoningEffort(value) {
|
|
@@ -108,6 +141,19 @@ function readReasoningEffort(value) {
|
|
|
108
141
|
? value
|
|
109
142
|
: "medium";
|
|
110
143
|
}
|
|
144
|
+
function readBooleanEnv(value, fallback) {
|
|
145
|
+
if (!value) {
|
|
146
|
+
return fallback;
|
|
147
|
+
}
|
|
148
|
+
const normalized = value.trim().toLowerCase();
|
|
149
|
+
if (["1", "true", "yes", "on"].includes(normalized)) {
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
if (["0", "false", "no", "off"].includes(normalized)) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
return fallback;
|
|
156
|
+
}
|
|
111
157
|
function readPackageVersion() {
|
|
112
158
|
try {
|
|
113
159
|
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.tsx"],"names":[],"mappings":";;AACA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,iBAAiB,EAAE,CAAC;AAEpB,MAAM,gBAAgB,GAAG,oBAAoB,EAAE,CAAC;AAChD,MAAM,eAAe,GAAG,iBAAiB,EAAE,CAAC;AAC5C,MAAM,YAAY,GAChB,OAAO,CAAC,GAAG,CAAC,gBAAgB;IAC5B,CAAC,eAAe,KAAK,QAAQ;QAC3B,CAAC,CAAC,kBAAkB;QACpB,CAAC,CAAC,eAAe,KAAK,YAAY;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.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,KAAyB,EAAE,QAAiB;IAClE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACrD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,kBAAkB;IACzB,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAA0B,CAAC;QAC3H,OAAO,OAAO,WAAW,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IACjF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC"}
|
package/dist/core/agent.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ export type AgentRunnerOptions = {
|
|
|
12
12
|
thinkingMode: "fixed" | "adaptive";
|
|
13
13
|
reasoningEffort: ProviderReasoningEffort | "adaptive";
|
|
14
14
|
subagents: boolean;
|
|
15
|
+
resumeContext?: string;
|
|
16
|
+
allowExternalFileAnalysis?: boolean;
|
|
17
|
+
memoryEnabled?: boolean;
|
|
15
18
|
signal?: AbortSignal;
|
|
16
19
|
sessionStore?: SessionStore;
|
|
17
20
|
approvalHandler?: (request: ApprovalRequest) => Promise<PermissionDecision>;
|