@openlines/opl-pi-sht 0.2.12 → 0.3.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.
Files changed (81) hide show
  1. package/README.md +92 -84
  2. package/configs/opl-browser.json.sample +3 -2
  3. package/configs/opl-footer.json.sample +3 -2
  4. package/configs/opl-guardian.json.sample +8 -2
  5. package/configs/opl-modes.json.sample +5 -0
  6. package/configs/opl-webaccess.json.sample +7 -1
  7. package/extensions/opl-browser/README.md +81 -55
  8. package/extensions/opl-browser/browser.ts +244 -50
  9. package/extensions/opl-browser/config.ts +15 -7
  10. package/extensions/opl-browser/index.ts +5 -4
  11. package/extensions/opl-browser/package.json +4 -4
  12. package/extensions/opl-browser/validate.ts +313 -60
  13. package/extensions/opl-configurator/README.md +40 -0
  14. package/extensions/opl-configurator/configurator.ts +148 -0
  15. package/extensions/opl-configurator/index.ts +12 -0
  16. package/extensions/opl-ctxtrim/README.md +45 -14
  17. package/extensions/opl-ctxtrim/index.ts +33 -13
  18. package/extensions/opl-footer/README.md +31 -6
  19. package/extensions/opl-footer/config.ts +11 -10
  20. package/extensions/opl-footer/configure.ts +157 -115
  21. package/extensions/opl-footer/git-status.ts +58 -1
  22. package/extensions/opl-footer/icons.ts +3 -0
  23. package/extensions/opl-footer/index.ts +209 -105
  24. package/extensions/opl-footer/segments/caveman.ts +9 -1
  25. package/extensions/opl-footer/segments/chat-mode.ts +8 -1
  26. package/extensions/opl-footer/segments/compactions.ts +13 -0
  27. package/extensions/opl-footer/segments/context.ts +6 -5
  28. package/extensions/opl-footer/segments/index.ts +2 -0
  29. package/extensions/opl-footer/segments/mode-switcher.ts +14 -1
  30. package/extensions/opl-footer/segments/path.ts +1 -1
  31. package/extensions/opl-footer/segments/plan-mode.ts +8 -1
  32. package/extensions/opl-footer/theme.ts +5 -2
  33. package/extensions/opl-footer/types.ts +4 -0
  34. package/extensions/opl-guardian/README.md +17 -5
  35. package/extensions/opl-guardian/config.ts +72 -6
  36. package/extensions/opl-guardian/guardian.ts +42 -10
  37. package/extensions/opl-guardian/index.ts +52 -17
  38. package/extensions/opl-guardian/policies.ts +52 -16
  39. package/extensions/opl-init/README.md +12 -4
  40. package/extensions/opl-init/index.ts +228 -27
  41. package/extensions/opl-input/README.md +17 -3
  42. package/extensions/opl-input/config.ts +59 -5
  43. package/extensions/opl-input/configure.ts +144 -0
  44. package/extensions/opl-input/index.ts +38 -30
  45. package/extensions/opl-input/mode-style.ts +6 -2
  46. package/extensions/opl-modes/README.md +16 -4
  47. package/extensions/opl-modes/config.ts +62 -8
  48. package/extensions/opl-modes/index.ts +48 -17
  49. package/extensions/opl-modes/state.ts +50 -2
  50. package/extensions/opl-modes/types.ts +6 -0
  51. package/extensions/opl-modes/utils.ts +18 -8
  52. package/extensions/opl-questionnaire/index.ts +10 -4
  53. package/extensions/opl-questionnaire/types.ts +4 -0
  54. package/extensions/opl-simplebench/README.md +21 -15
  55. package/extensions/opl-simplebench/artifact.ts +7 -4
  56. package/extensions/opl-simplebench/benchmark.ts +96 -35
  57. package/extensions/opl-simplebench/coding.ts +9 -4
  58. package/extensions/opl-simplebench/index.ts +19 -19
  59. package/extensions/opl-simplebench/llama-server.ts +3 -2
  60. package/extensions/opl-simplebench/report.ts +0 -6
  61. package/extensions/opl-simplebench/research.ts +5 -4
  62. package/extensions/opl-simplebench/scoring.ts +4 -2
  63. package/extensions/opl-simplebench/util/config.ts +15 -8
  64. package/extensions/opl-simplebench/util/exec-env.ts +36 -0
  65. package/extensions/opl-simplebench/util/format.ts +2 -2
  66. package/extensions/opl-simplebench/util/providers.ts +23 -194
  67. package/extensions/opl-todo/README.md +5 -5
  68. package/extensions/opl-todo/config.ts +7 -2
  69. package/extensions/opl-todo/index.ts +50 -9
  70. package/extensions/opl-webaccess/README.md +31 -5
  71. package/extensions/opl-webaccess/config.ts +36 -7
  72. package/extensions/opl-webaccess/extract.ts +37 -47
  73. package/extensions/opl-webaccess/http.ts +259 -0
  74. package/extensions/opl-webaccess/index.ts +12 -6
  75. package/extensions/opl-webaccess/package.json +4 -9
  76. package/extensions/opl-webaccess/pdf.ts +4 -4
  77. package/extensions/opl-webaccess/search.ts +19 -8
  78. package/extensions/opl-webaccess/storage.ts +134 -2
  79. package/extensions/opl-webaccess/types.ts +4 -0
  80. package/extensions/opl-webaccess/utils.ts +221 -33
  81. package/package.json +19 -12
package/README.md CHANGED
@@ -10,26 +10,30 @@
10
10
 
11
11
  </div>
12
12
 
13
- **Cut token cost, run the agent safely, and drop your MCP servers.**
13
+ **Cut token cost, run the agent safely, and drop your MCP servers (probably).**
14
14
 
15
15
  A portable collection of various Pi coding agent extensions. Repository directories and config files use `opl-`; established Pi-facing commands and tool names stay compatible.
16
16
 
17
+ > ### BIG A👀️ UPDATE
17
18
  >
18
- > ### v0.2.12 - refresh OpenRouter/Codex usage during agent runs
19
- > - `opl-footer` fixed usage refresh from agent_settled to after every turn/toolcall
20
- > ### v0.2.11 - OpenRouter key-limit usage in opl-footer
21
- > - `opl-footer` added an OpenRouter API key's used amount, cap, and percentage.
22
- > ### v0.2.10 - Codex subscription usage in opl-footer
23
- > - `opl-footer` added ChatGPT Codex subs 5-hour/weekly quota segment with reset countdowns and stale-snapshot fallback.
24
- > ### v0.2.9 - pi dependencies patch, updated test scripts
25
- > - `devDependencies` updated to `>=0.87.0`, conforming to latest pi release `v0.99.x`; TUI and tests updates
26
- > ### v0.2.8 - SSRF and tool-safety hardening
27
- > - `opl-webaccess` and `opl-browser` block private/link-local hosts by default and cloud metadata always (localhost stays available for dev), fetch redirects are re-checked per hop, screenshots refuse to overwrite existing files, and `evaluate` no longer crashes on `undefined`.
19
+ > ### v0.3.0 - security hardening, fixes, and extension enhancements
20
+ >
21
+ > - **Stronger network protection**: [`opl-browser`](extensions/opl-browser/README.md#network-policy) and [`opl-webaccess`](extensions/opl-webaccess/README.md#network-policy) check resolved addresses and redirect destinations, closing hostname and IPv6 policy bypasses. Browser guards also cover page requests, WebSockets and redirected frames. `opl-webaccess` pins each connection to an approved address, closing DNS rebinding on its fetch path; Chromium's internal DNS resolution remains a documented browser limitation.
22
+ > - **Safer execution and file access**: [`opl-simplebench`](extensions/opl-simplebench/README.md#coding-lite) limits the environment inherited by model-authored verifier code and uses [argv-based AWS credential lookup](extensions/opl-simplebench/README.md#amazon-bedrock). Guarded git probes in [`opl-init`](extensions/opl-init/README.md#extension-features) and [`opl-footer`](extensions/opl-footer/README.md#git-probing) disable hooks, filesystem monitors and external diff/textconv helpers. Browser screenshots stay within the session project, refuse overwrites and clean up failed captures. Malformed Bash calls are blocked instead of coerced. [Screenshot safety](extensions/opl-browser/README.md#extension-features), [Bash safeguards](extensions/opl-modes/README.md#mode-behavior).
23
+ > - **More useful protection and diagnostics**: [`opl-guardian`](extensions/opl-guardian/README.md#forensic-jsonl) matches protected paths without blocking harmless text searches, and its malformed-call logs record argument names rather than values, rotate on a byte limit and live in the agent directory. [Protected paths](extensions/opl-guardian/README.md#protected-paths).
24
+ > - **Priority runtime fixes**: PDF extraction accepts HTTP response buffers; URL fetches decode compressed responses within received and decoded byte limits, follow redirects without buffering their bodies, and clean up sockets on cancellation or timeout. [Browser selection](extensions/opl-browser/README.md#extension-features) follows page identity, so a closed tab cannot silently redirect an action to another document. [URL/PDF retrieval](extensions/opl-webaccess/README.md#extension-features).
25
+ > - **Lower token cost and better rendering**: [`opl-modes`](extensions/opl-modes/README.md#configuration) enforces UTF-8 plan caps including truncation notices; [`opl-ctxtrim`](extensions/opl-ctxtrim/README.md#scope) trims known context-mode `ctx_*` descriptions in Google/Gemini and OpenAI tool formats; [`opl-webaccess`](extensions/opl-webaccess/README.md#extension-features) stores full results outside the session and returns bounded previews. Footer rows render only when populated, and branch switches or compaction refresh cached counts, cost and context estimates. [Footer behavior](extensions/opl-footer/README.md#features).
26
+ > - **More reliable repository context**: [`/init`](extensions/opl-init/README.md#extension-features) handles special characters in workspace globs, bounds fingerprinting work and requests the supported `"minimal"` thinking level. Cross-extension state is validated and cleaned up between sessions. [Cross-extension seams](extensions/opl-footer/README.md#cross-extension-seams).
27
+ > - **Organization and convenience**: configs consistently resolve from Pi's agent directory, and plans, screenshots and benchmark artifacts use the session directory. The installer supplies sample configs, preserves existing settings and tracks stale extensions for cleanup or retry. npm packages ship sample configs without checkout live configs; obsolete `models.json` write helpers were removed. [Configuration](#configuration), [Checkout installer](#checkout-installer).
28
+ > - **Stronger release checks**: clean installs use a repaired lockfile, release validation runs strict typechecking and the full test suite, and floor CI verifies compatibility against Pi `0.87.0`. `noUncheckedIndexedAccess` remains enabled to catch unsafe array access. [Tests](#tests).
29
+ > - **Breaking behavior changes**: loopback access is now opt-in (`allowLoopback: false`), and the entire `64:ff9b:1::/48` local-use translation prefix is blocked even with network opt-ins enabled. The well-known `64:ff9b::/96` prefix still follows embedded-IPv4 policy. Stale browser selections now return an error requiring explicit recovery. [Network policy](extensions/opl-browser/README.md#network-policy), [Page selection](extensions/opl-browser/README.md#extension-features).
30
+ > - **Added**: separate, extensible [`opl-configurator`](extensions/opl-configurator/README.md#extension-features), and [`compactions`](extensions/opl-footer/README.md#available-segments) segment in `opl-footer`.
28
31
  >
29
32
  > See [CHANGELOG](CHANGELOG.md) for more details.
30
33
  >
31
- > `Current project state also marked 'SAFE' for pi v1.0.0 release`
34
+ > Having issues? [Opl a ticket](https://github.com/linellazatin/opl-pi-sht/issues/new).
32
35
  >
36
+ > **Validation**: all 12 extensions pass loader checks with Pi `1.1.0`, locked Pi `1.0.0` and the declared `0.87.0` floor.
33
37
 
34
38
  ## Installation
35
39
 
@@ -61,7 +65,7 @@ npx playwright install chromium
61
65
  {
62
66
  "packages": [
63
67
  {
64
- "source": "npm:@openlines/opl-pi-sht@0.1.18",
68
+ "source": "npm:@openlines/opl-pi-sht@0.3.0",
65
69
  "extensions": ["extensions/opl-init/index.ts", "extensions/opl-todo/index.ts"]
66
70
  }
67
71
  ]
@@ -77,39 +81,40 @@ chmod +x install.sh
77
81
  ./install.sh # copy all extensions and configs
78
82
  ./install.sh --link # non-destructive symlinks
79
83
  ./install.sh --only opl-init opl-todo
80
- ./install.sh --link --only opl-input # installs the complete UI bundle
81
- PI_AGENT_DIR=/path/to/.pi/agent ./install.sh --link
84
+ ./install.sh --link --only opl-input # installs the UI + /configurator bundle
85
+ PI_CODING_AGENT_DIR=/path/to/.pi/agent ./install.sh --link # PI_AGENT_DIR is a legacy alias
82
86
  ```
83
87
 
84
- Copy mode overwrites matching destinations. Link mode skips existing destinations. `--only`/`-o` accepts one or more extension names; selecting `opl-footer`, `opl-input`, or `opl-modes` installs all three because they share active-mode state. Use `./install.sh --help` for flags. The repository uses standard `.json` only.
88
+ Copy mode refreshes extension directories but keeps a config that already exists in the target; pass `--force-configs` to replace it. A config comes from `configs/<name>.json` when the repo carries one, otherwise from the shipped `configs/<name>.json.sample`, so a fresh clone installs defaults instead of silently installing none. What was installed is recorded in `<agent-dir>/extensions/.opl-pi-sht.installed`, and a recorded directory that this release no longer ships is pruned on the next run (`--no-prune` keeps it recorded for later cleanup, and nothing outside the record is ever touched). Failed pruning retains ownership and exits nonzero so the next run can retry; invalid manifest names are ignored. Link mode skips existing destinations without claiming ownership. `--only`/`-o` accepts one or more extension names; selecting `opl-configurator`, `opl-footer`, `opl-input`, or `opl-modes` installs all four: `/configurator` plus the three extensions that share active-mode state. Use `./install.sh --help` for flags. The repository uses standard `.json` only.
85
89
 
86
90
  ## Extensions
87
91
 
88
92
 
89
- | Extension | Summary | Commands, tools, and configuration |
90
- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
91
- | [`opl-init`](extensions/opl-init/README.md) | Fingerprinted repository-guide generator with out-of-band model refinement. | `/init`; no config. |
92
- | [`opl-simplebench`](extensions/opl-simplebench/README.md) | Auditable provider-aware model benchmark with JSON artifacts and metrics. | `/simplebench`, `simplebench`; supports Ollama, OpenAI-compatible providers, and Bedrock; optional `opl-simplebench.json`. |
93
- | [`opl-webaccess`](extensions/opl-webaccess/README.md) | Search plus readable URL/PDF retrieval with session recovery. | `web_search`, `fetch_content`, `get_search_content`; `opl-webaccess.json`. |
94
- | [`opl-browser`](extensions/opl-browser/README.md) | Chromium automation via Playwright with structured extraction of rendered pages; single dispatcher tool replacing the chrome-devtools MCP. | `browser` (action-based); `opl-browser.json`. |
95
- | [`opl-ctxtrim`](extensions/opl-ctxtrim/README.md) | Trims verbose`ctx_*` tool-schema descriptions on outbound provider requests (~67% smaller schema, ~4,700-6,300 tokens/request). Built specifically for the [context-mode](https://github.com/mksglu/context-mode) extension. | No commands/tools; no config. |
96
- | [`opl-guardian`](extensions/opl-guardian/README.md) | Configurable tool and session safety: dangerous-Bash confirmation, protected paths, destructive-session confirmation, and malformed-call filtering. | No commands/tools; `opl-guardian.json`. |
97
- | [`opl-todo`](extensions/opl-todo/README.md) | Branch-aware task tool, overlay, and task list. | `todo`, `/todos`; `opl-todo.json`. |
98
- | [`opl-questionnaire`](extensions/opl-questionnaire/README.md) | Interactive structured-choice tool. | `questionnaire`; no config. |
99
- | [`opl-input`](extensions/opl-input/README.md) | Configurable replacement editor - enhanced [pikit chat-input](https://github.com/adrianapan/pikit) (because pet is life, and configurable). ![pet](images/ss-input-pet.png) | No commands/tools;`opl-input.json`. |
100
- | [`opl-modes`](extensions/opl-modes/README.md) | Mode, plan, tool-safety, lazy-tool-loading, and active-appearance manager - highly-modified, configrable and enhanced mode-switcher. | `/mode`, `/chat`, `/plan`, `/execute`, `plan_complete`, `load_tools`; `opl-modes.json`. |
101
- | [`opl-footer`](extensions/opl-footer/README.md) | Configurable multi-row status footer - highly-specialized, and enhanced [pikit footer](https://github.com/adrianapan/pikit). | `/configure-opl`; `opl-footer.json`. |
93
+ | Extension | Summary | Commands, tools, and configuration |
94
+ | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
95
+ | [`opl-init`](extensions/opl-init/README.md) | Fingerprinted repository-guide generator with out-of-band model refinement. | `/init`; no config. |
96
+ | [`opl-simplebench`](extensions/opl-simplebench/README.md) | Auditable provider-aware model benchmark with JSON artifacts and metrics. | `/simplebench`, `simplebench`; supports Ollama, OpenAI-compatible providers, and Bedrock; optional `opl-simplebench.json`. |
97
+ | [`opl-webaccess`](extensions/opl-webaccess/README.md) | Search plus readable URL/PDF retrieval with session recovery. | `web_search`, `fetch_content`, `get_search_content`; `opl-webaccess.json`. |
98
+ | [`opl-browser`](extensions/opl-browser/README.md) | Chromium automation via Playwright with structured extraction of rendered pages; single dispatcher tool replacing the chrome-devtools MCP. | `browser` (action-based); `opl-browser.json`. |
99
+ | [`opl-ctxtrim`](extensions/opl-ctxtrim/README.md) | Description trimmer specifically for known context-mode`ctx_*` tools in Pi outbound requests, across OpenAI, Anthropic, Mistral, Bedrock and Google/Gemini formats. Its allowlist supplies concise replacements for the [context-mode](https://github.com/mksglu/context-mode) bridge's verbose `ctx_*` descriptions and leaves every other tool byte-for-byte alone (~67-74% smaller tool payloads per measured shape, ~4,700-6,300 tokens/request). | No commands/tools; no config. |
100
+ | [`opl-guardian`](extensions/opl-guardian/README.md) | Configurable tool and session safety: dangerous-Bash confirmation, protected paths, destructive-session confirmation, and malformed-call filtering. | No commands/tools;`opl-guardian.json`. |
101
+ | [`opl-todo`](extensions/opl-todo/README.md) | Branch-aware task tool, overlay, and task list. | `todo`, `/todos`; `opl-todo.json`. |
102
+ | [`opl-questionnaire`](extensions/opl-questionnaire/README.md) | Interactive structured-choice tool. | `questionnaire`; no config. |
103
+ | [`opl-input`](extensions/opl-input/README.md) | Configurable replacement editor - enhanced[pikit chat-input](https://github.com/adrianapan/pikit) (because pet is life, and configurable). ![pet](images/ss-input-pet.png) | `/configurator` (Input tab); `opl-input.json`. |
104
+ | [`opl-modes`](extensions/opl-modes/README.md) | Mode, plan, tool-safety, lazy-tool-loading, and active-appearance manager - highly-modified, configrable and enhanced mode-switcher. | `/mode`, `/chat`, `/plan`, `/execute`, `plan_complete`, `load_tools`; `opl-modes.json`. |
105
+ | [`opl-footer`](extensions/opl-footer/README.md) | Configurable multi-row status footer - highly-specialized, and enhanced[pikit footer](https://github.com/adrianapan/pikit). | `/configurator`; `opl-footer.json`. |
106
+ | [`opl-configurator`](extensions/opl-configurator/README.md) | Generic extensible configuration shell with hotkey-selected tabs; each instrumented extension publishes one tab. | `/configurator`; no config. |
102
107
 
103
108
  ## What you'll gain
104
109
 
105
- Install one, some, or all. The value is grouped by outcome below, not by extension, so you can pick what matters to you.
110
+ Choose one, some, or all extensions by the outcomes below.
106
111
 
107
112
  ### Spend less every session
108
113
 
109
- Two extensions shrink the cached prompt prefix that Pi writes once and re-reads on every turn, so the savings compound across a whole conversation:
114
+ Trim tool descriptions or withhold unused schemas to reduce the prompt prefix Pi caches across turns:
110
115
 
111
- - **`opl-ctxtrim`** trims verbose `ctx_*` tool-schema descriptions on outbound requests. It is built specifically for the [context-mode](https://github.com/mksglu/context-mode) extension: ~67% smaller schemas, roughly **4,700-6,300 tokens saved per request**, on every request.
112
- - **`opl-modes` lazy tools** withhold heavy tool schemas (`subagent`, `browser`, `simplebench`, ...) from the resting prefix until the model calls `load_tools`. In a measured `/init` session this removed **~5,000 tokens from the cold cache write (17.6K to 12.6K)** and it repeats every session.
116
+ - **`opl-ctxtrim`** shortens descriptions for eleven known context-mode `ctx_*` tools across Pi provider formats, preserving other tools, conversation content and schema rules. Measured schemas shrink ~67-74%; the Responses saving is roughly **4,700-6,300 tokens/request**, estimated from bytes. [Scope and provider formats](extensions/opl-ctxtrim/README.md#scope), [Measurements](extensions/opl-ctxtrim/README.md#token-savings).
117
+ - **`opl-modes` lazy tools** withhold heavy schemas such as `subagent`, `browser` and `simplebench` until `load_tools` activates them within the current mode's permissions. One measured setup with lazy tools and its MCP adapter disabled saved **~5,000 cold-cache tokens (17.6K to 12.6K)**. [Lazy loading](extensions/opl-modes/README.md#lazy-tool-loading).
113
118
 
114
119
  ```text
115
120
  Cold prompt-cache write, measured /init session (opl-modes lazy tools + MCP adapter off)
@@ -122,93 +127,94 @@ Cold prompt-cache write, measured /init session (opl-modes lazy tools + MCP adap
122
127
 
123
128
  ### Run the agent without babysitting it
124
129
 
125
- - **`opl-modes`** chat and plan modes swap the active toolset for read-only lists and gate Bash to safe inspection patterns **per shell segment**, so `cat f && node -e '...'`, `cat x & rm -rf /tmp/x`, and `echo "$(node -e ...)"` can no longer ride the first command's allowance. Destructive checks still fire inside otherwise-safe commands (anchored to command position, so `du -sh` and `find . -name '*.sh'` stay allowed; `find -delete`, `find -fprint`, `git log --output`, `sort -o`, `npm audit fix`, `git clean`, `sudo`, and quote-obfuscated `r"m"`/`-del"ete"` are blocked; `env`/`printenv` are not safe-listed). The plan to execute lifecycle keeps exploration and mutation cleanly separated. Add custom modes (like below) for your workflow needs. Execute-mode auto-exit needs pi >= 0.87.0 (the `agent_before_settle` boundary).
126
- ![custom mode sample](images/ss-mode-custom.png)
127
- - `load_tools` activation is bounded by the current mode, so a read-only mode cannot be tricked into enabling a write-capable tool.
128
- - **`opl-guardian`** combines configurable safety checks in one extension: it confirms dangerous Bash commands in the terminal or over RPC, blocks configured protected paths for file tools (including symlink targets), and confirms session clear/switch-with-pending-work/fork actions. Without a UI, configured dangerous commands and session actions block by default. It also removes malformed provider tool calls before persistence or replay and records incidents in `err/guardian.jsonl`. Protected-path Bash matching is literal best-effort, not shell sandboxing.
129
-
130
+ - **`opl-modes`** provides read-only chat/plan toolsets, checks each Bash command segment including quoted substitutions, and blocks destructive operations. Custom modes support exploration-to-execution workflows; `load_tools` cannot exceed their permissions. Plan copies stay within UTF-8 caps including truncation notices: **24 KB** in prompts and **4 KB** in session entries, with the full file retained. Execute auto-exit requires Pi >=0.87.0. [Mode behavior](extensions/opl-modes/README.md#mode-behavior), [Plan configuration](extensions/opl-modes/README.md#configuration).
131
+ ![custom mode sample](images/ss-mode-custom.png)
132
+ - **`opl-guardian`** confirms dangerous Bash commands and destructive session actions, and protects configured file paths through symlink resolution. Without a UI, confirmation-required actions block. Bash path matching avoids harmless text-search matches but remains advisory, not a shell sandbox. Malformed calls are removed before persistence/replay; byte-rotated logs in `<agent dir>/guardian-incidents.jsonl` record argument names, never values. [Guards](extensions/opl-guardian/README.md#what-it-guards), [Forensics](extensions/opl-guardian/README.md#forensic-jsonl).
130
133
 
131
134
  ### Move through work faster
132
135
 
133
- - **`opl-init`** deterministically crawls and refines `AGENTS.md` with a single out-of-band model call (never a synthetic user message), writes it, and reloads context so the session runs on the new guide. A current fingerprint means zero model calls; mid-session invocations wait for the agent to settle instead of interrupting it. Needs pi >= 0.86.0.
134
- ![init](images/ss-init.png)
135
- - **`opl-browser`** gives full Chromium automation (navigate, snapshot, extract rendered-page markdown, interact, screenshot, console/network capture, evaluate) through a single tool, with handle+preview output for large results — navigation is http(s)-only, blocks private/link-local hosts by default and cloud metadata always (SSRF guard; localhost is allowed for dev), and screenshots must use `.png`/`.jpg`, stay in the project directory, and never overwrite an existing file.
136
- - **`opl-webaccess`** adds provider-backed search plus readable URL and PDF extraction, with session recovery of earlier results, an http(s)-only fetch that blocks private/link-local hosts by default and cloud metadata always, re-checks every redirect hop (SSRF guard; localhost is allowed for dev), a 10 MB response cap, and a 30s timeout.
137
- - **`opl-simplebench`** benchmarks models on deterministic closed-answer contracts, instruction-following, and tool-call generation so you pick a model on evidence, not vibes.
138
- ![simplebench](images/ss-simplebench.png)
139
- - **`opl-todo`** tracks branch-aware tasks that persist across a session and reconstruct from history.
140
- ![todo](images/ss-todo.png)
141
- - **`opl-questionnaire`** turns an ambiguous fork into a structured choice instead of a guess-and-redo cycle.
142
- ![questionnaire0](images/ss-questionnaire0.png) ![questionnaire1](images/ss-questionnaire1.png)
136
+ - **`opl-init`** crawls, writes and reloads `AGENTS.md` using one out-of-band refinement call. An unchanged fingerprint skips the model; mid-session requests wait for the agent to settle. No synthetic user messages. Requires Pi >=0.86.0. [Workflow](extensions/opl-init/README.md#extension-features).
137
+ ![init](images/ss-init.png)
138
+ - **`opl-browser`** exposes Chromium navigation, snapshots, rendered Markdown, interaction, screenshots, diagnostics and evaluation through one tool, with paged previews for large results. Address-based guards cover navigation, page requests, WebSockets and redirected frames; private/link-local access is blocked by default, loopback is opt-in, metadata is always blocked and service workers are disabled. PNG/JPG screenshots are contained within the session project and reserved against overwrites. Page actions support `index`, preserve selection identity and reject stale targets. [Features](extensions/opl-browser/README.md#extension-features), [Network policy and limits](extensions/opl-browser/README.md#network-policy).
139
+ - **`opl-webaccess`** provides search, readable URL/PDF extraction and result recovery. HTTP(S) fetches validate and pin approved addresses at every redirect, block private/link-local hosts by default, make loopback opt-in and always block metadata/unspecified addresses. Compressed responses are decoded within **10 MB** received/decoded caps and a **30 s** deadline across hops. Sessions keep bounded previews; full results live in a **1 h / 32 MB** disk cache. [Retrieval and storage](extensions/opl-webaccess/README.md#extension-features), [Configuration](extensions/opl-webaccess/README.md#configuration).
140
+ - **`opl-simplebench`** compares models using deterministic answers, instruction-following, tool calls and coding tasks. Model-authored verifier code and its children receive an allowlisted environment without provider credentials, tokens or agent paths; this is not filesystem/network isolation. [Methodology](extensions/opl-simplebench/README.md#benchmark-methodology), [Coding safety](extensions/opl-simplebench/README.md#coding-lite).
141
+ ![simplebench](images/ss-simplebench.png)
142
+ - **`opl-todo`** persists branch-aware tasks, reconstructs them from session history and sizes its overlay to the renderer's terminal. [Features](extensions/opl-todo/README.md#extension-features).
143
+ ![todo](images/ss-todo.png)
144
+ - **`opl-questionnaire`** resolves ambiguous choices through an interactive structured questionnaire. [Features](extensions/opl-questionnaire/README.md#extension-features).
145
+ ![questionnaire0](images/ss-questionnaire0.png) ![questionnaire1](images/ss-questionnaire1.png)
143
146
 
144
147
  ### See what the agent is doing
145
148
 
146
- - **`opl-footer`** surfaces model, cost, token and cache activity, git state, agent status, per-turn timing, optional exact remaining ChatGPT Codex subscription quota and OpenRouter API-key cap usage. Both usage segments refresh during agent runs after assistant responses and tool completions (30-second floor, coalesced trailing refresh). The OpenRouter segment resolves Pi's active key locally and calls only OpenRouter's key endpoint; keys and response bodies are neither persisted nor logged. `/configure-opl` edits and reorders its layout interactively.
147
- - **`opl-input`** is a configurable editor that reflects the active mode's identity, so you always know which mode you are typing into.
148
- ![input-footer](images/ss-input-footer.png)
149
+ - **`opl-footer`** shows model, cost, tokens/cache, git state, agent activity and timing, plus optional Codex subscription quota and OpenRouter key usage. Empty rows disappear; failed segments show `[?]` without blanking the footer. Branch switches and compaction refresh cached facts, and canonical context usage replaces estimates. Quotas refresh during runs with a 30 s minimum interval; OpenRouter keys/responses are never logged or persisted. Configure the layout with `/configurator`. [Features](extensions/opl-footer/README.md#features), [Usage segments](extensions/opl-footer/README.md#available-segments).
150
+ - **`opl-input`** provides a configurable editor that reflects the active mode. Configure it through `/configurator` (Input tab); changes apply after `/reload`. [Editor features](extensions/opl-input/README.md#extension-features).
151
+ ![input-footer](images/ss-input-footer.png)
149
152
 
150
153
  ### Fewer moving parts
151
154
 
152
- - **`opl-browser`** replaces the chrome-devtools MCP server. Together these tools let you drop external MCP servers and the idle schema overhead they add to every prompt.
155
+ - **`opl-browser`** provides browser automation without a separate chrome-devtools MCP server, reducing server setup and idle schema overhead. [Architecture](extensions/opl-browser/README.md#architecture).
153
156
 
154
157
  ### Pick your footprint
155
158
 
156
- | If you want to... | Install |
157
- | ---------------------------------- | --------------------------------------------------------------- |
158
- | Cut token cost with minimal change | `opl-ctxtrim`, `opl-modes` |
159
- | Run the agent safely on real repos | `opl-modes` (pulls in the `opl-input` + `opl-footer` UI bundle), `opl-guardian` |
160
- | Research and drive the web | `opl-webaccess`, `opl-browser` |
161
- | Choose models with data | `opl-simplebench` |
162
- | The full, coordinated experience | all eleven |
163
159
 
164
- Selecting `opl-footer`, `opl-input`, or `opl-modes` installs all three, because they share active-mode state.
160
+ | If you want to... | Install |
161
+ | ---------------------------------- | --------------------------------------------------------------------------------------------------- |
162
+ | Cut token cost with minimal change | `opl-ctxtrim`, `opl-modes` |
163
+ | Run the agent safely on real repos | `opl-modes` (pulls in the `opl-input` + `opl-footer` UI and `/configurator` bundle), `opl-guardian` |
164
+ | Research and drive the web | `opl-webaccess`, `opl-browser` |
165
+ | Choose models with data | `opl-simplebench` |
166
+ | The full, coordinated experience | all twelve |
167
+
168
+ Selecting `opl-configurator`, `opl-footer`, `opl-input`, or `opl-modes` installs all four. The configurator carries the `/configurator` command, and the other three share active-mode state.
165
169
 
166
170
  ## Token overhead
167
171
 
168
- Installing extensions adds tool schemas (name + description + JSON parameters) to the resting prompt prefix, which Pi writes once per session and then re-reads cheaply from cache on warm turns. Commands and UI-only extensions add little to nothing. The figures below are calibrated against one tool measured directly in a real session (`load_tools` = 139 tokens); treat them as ±15%.
172
+ Installing extensions adds tool schemas (name + description + JSON parameters) to the resting prompt prefix, which Pi writes once per session and then re-reads cheaply from cache on warm turns. Commands and UI-only extensions add little to nothing. The figures below are calibrated against one tool measured directly in a real session (`load_tools` = 139 tokens); treat them as ±15%. Per-row estimates sum a little above the measured whole (~2,020 against ~1,916 of tool-schema tokens), so the collective figures below use the measured value.
169
173
 
170
174
  ### Per extension (resting prompt prefix)
171
175
 
172
- | Extension | Adds to resting prompt | Est. tokens |
173
- |---|---|---|
174
- | `opl-browser` | `browser` tool schema | ~575 |
175
- | `opl-questionnaire` | `questionnaire` schema + prompt guidelines | ~532 |
176
- | `opl-webaccess` | `web_search`, `fetch_content`, `get_search_content` | ~394 |
177
- | `opl-simplebench` | `simplebench` schema | ~230 |
178
- | `opl-modes` | `plan_complete` + `load_tools` schemas | ~215 |
179
- | `opl-todo` | `todo` schema | ~92 |
180
- | `opl-init` | command only (no tool) | ~0 |
181
- | `opl-input` | UI only | ~0 |
182
- | `opl-footer` | UI only | ~0 |
183
- | `opl-guardian` | none (tool/session safety; no added tool schemas) | ~0 |
184
- | `opl-ctxtrim` | none (payload transformer) | net negative |
176
+
177
+ | Extension | Adds to resting prompt | Est. tokens |
178
+ | ------------------- | --------------------------------------------------- | ------------ |
179
+ | `opl-browser` | `browser` tool schema | ~596 |
180
+ | `opl-questionnaire` | `questionnaire` schema + prompt guidelines | ~532 |
181
+ | `opl-webaccess` | `web_search`, `fetch_content`, `get_search_content` | ~394 |
182
+ | `opl-simplebench` | `simplebench` schema | ~230 |
183
+ | `opl-modes` | `plan_complete` + `load_tools` schemas | ~215 |
184
+ | `opl-todo` | `todo` schema | ~92 |
185
+ | `opl-init` | command only (no tool) | ~0 |
186
+ | `opl-configurator` | command only (no tool) | ~0 |
187
+ | `opl-input` | UI only | ~0 |
188
+ | `opl-footer` | UI only | ~0 |
189
+ | `opl-guardian` | none (tool/session safety; no added tool schemas) | ~0 |
190
+ | `opl-ctxtrim` | none (payload transformer) | net negative |
185
191
 
186
192
  Command descriptions add roughly another ~120 tokens collectively, and only if your build surfaces them in the prompt or help block.
187
193
 
188
194
  ### Collective (full install)
189
195
 
190
- - **All tools active (no `lazyTools`):** ~1,916 tool-schema tokens + ~101 guidelines + ~120 commands = **~2,140 tokens** on every cold prompt-cache write.
191
- - **With the recommended `lazyTools` config** (withholds `browser` + `simplebench`, keeps `load_tools`): removing browser (554) and simplebench (230) drops the resting overhead to **~1,356 tokens (-37%)**.
196
+ - **All tools active (no `lazyTools`):** ~1,958 tool-schema tokens (the ~1,916 counted in a real session, plus the ~42 tokens Phase 6 added to the `browser` schema for page targeting) + ~101 guidelines + ~120 commands = **~2,180 tokens** on every cold prompt-cache write. The per-extension rows above are ±15% estimates of the same set and sum slightly over it.
197
+ - **With the recommended `lazyTools` config** (withholds `browser` + `simplebench`, keeps `load_tools`): removing browser (~596) and simplebench (~230) drops the resting overhead to **~1,354 tokens (-38%)**.
192
198
 
193
199
  ```text
194
200
  Full install, cold prompt prefix impact
195
201
 
196
- all tools resting ████████████████████████ ~2,140 tokens
197
- with lazyTools ███████████████ ~1,356 tokens (-37%)
198
- + opl-ctxtrim (context-mode) saves 4,700-6,300 tokens/request
202
+ all tools resting ████████████████████████ ~2,180 tokens
203
+ with lazyTools ███████████████ ~1,354 tokens (-38%)
204
+ + opl-ctxtrim (curated ctx_*) saves 4,700-6,300 tokens/request
199
205
  ```
200
206
 
201
- The fixed cost of a full install is small and paid once per session, then cached. Two extensions pay it back many times over: `opl-ctxtrim` removes 4,700-6,300 tokens **per request** for context-mode users, and `opl-modes` lazy loading keeps the resting number at ~1,356 instead of ~2,140 while also withholding the heavy `subagent` family (~5K tokens) when present. For a full install, the overhead is modest and one-time-per-session; with context-mode or heavy tools in play, the collection is strongly token-positive.
207
+ The fixed cost of a full install is small and paid once per session, then cached. Two extensions pay it back many times over: `opl-ctxtrim` removes 4,700-6,300 tokens **per request** for context-mode users, and `opl-modes` lazy loading keeps the resting number at ~1,354 instead of ~2,180 while also withholding the heavy `subagent` family (~5K tokens) when present. For a full install, the overhead is modest and one-time-per-session; with context-mode or heavy tools in play, the collection is strongly token-positive.
202
208
 
203
209
  ## Configuration
204
210
 
205
- Copy applicable files from [`configs/`](configs/) to `~/.pi/agent/configs/`. For a Pi package installation, the source directory is `~/.pi/agent/npm/node_modules/@openlines/opl-pi-sht/configs/` (npm) or `~/.pi/agent/git/github.com/linellazatin/opl-pi-sht/configs/` (Git):
211
+ Copy applicable files from [`configs/`](configs/) to `~/.pi/agent/configs/` - or to `$PI_CODING_AGENT_DIR/configs/` if you relocated the agent directory, which is where every extension in this collection looks, per call. npm packages include only shipped `.json.sample` configs, never operator `.json` files from a checkout. For a Pi package installation, the source directory is `~/.pi/agent/npm/node_modules/@openlines/opl-pi-sht/configs/` (npm) or `~/.pi/agent/git/github.com/linellazatin/opl-pi-sht/configs/` (Git):
206
212
 
207
213
  - `opl-footer.json`, `opl-input.json`, `opl-modes.json`, `opl-todo.json`, `opl-webaccess.json`, `opl-guardian.json`
208
214
  - `opl-browser` has optional configuration (`opl-browser.json`); all fields default, so it works without any config file.
209
215
  - `opl-simplebench` has optional `opl-simplebench.json`; copy `configs/opl-simplebench.json.sample` to configure DDGS/SearXNG research and llama metadata endpoints.
210
216
  - `opl-guardian` has an optional `opl-guardian.json`; copy `configs/opl-guardian.json.sample` and manually migrate any old permission-gate or protected-path settings. It does not load legacy files. Configured `permissionGate.patterns` replace the defaults, so copied live patterns do not automatically inherit later default-rule updates.
211
- - `opl-init` and `opl-questionnaire` have no external configuration.
217
+ - `opl-init`, `opl-questionnaire` and `opl-configurator` have no external configuration.
212
218
  - Config files must be valid JSON, with no comments or trailing commas beyond deliberate `_comment` keys.
213
219
  - `opl-modes` owns active-mode appearance. Each mode's `appearance.prefix`, `prefixColor`, and `borderColor` style `opl-input`; `appearance.modeColor` styles `opl-footer`'s unified mode label. Renderers retain hardcoded fallbacks.
214
220
  - `opl-modes.bashPatterns` is the shared read-only Bash policy now applied to every mode by default; a mode overrides it with its own valid `safePatterns`/`destructivePatterns` array, an empty array explicitly removes that policy, or `unrestrictedBash: true` disables both gates. Malformed per-mode arrays retain the existing policy.
@@ -231,7 +237,7 @@ npx playwright install chromium
231
237
 
232
238
  A Pi package (npm or Git) still needs the one-time `npx playwright install chromium` command shown above.
233
239
 
234
- `opl-simplebench` writes a full JSON benchmark artifact in Pi's current working directory by default. `--test-all` additionally writes `research.md` and `page.html` beside `result.json` in a result bundle. `/simplebench --sequence[=<name>]` runs a named templated multi-run protocol (for example a model warm-up curve) defined in the `runSequence.sequences` block, with per-iteration tags, optional llama-server/llamagputop metrics, and a configurable pause between iterations; block-level `llamaMetrics`/`pauseMs` are defaults a profile can override. Copy `configs/opl-simplebench.json.sample` to `~/.pi/agent/configs/opl-simplebench.json` to configure DDGS/SearXNG research, optional llama-server/llamagputop metadata endpoints, and the run sequence. Use `/simplebench --no-artifact` or `simplebench({ no_artifact: true })` when responses must not be written to disk. Provider credentials remain outside tracked configuration; configure them through Pi provider settings, environment variables, or Pi authentication.
240
+ `opl-simplebench` writes a full JSON benchmark artifact in the current Pi session directory (`ExtensionContext.cwd`). `--test-all` additionally writes `research.md` and `page.html` beside `result.json` in a result bundle. Without an active session context, artifacts fall back to the harness working directory. `/simplebench --sequence[=<name>]` runs a named templated multi-run protocol (for example a model warm-up curve) defined in the `runSequence.sequences` block, with per-iteration tags, optional llama-server/llamagputop metrics, and a configurable pause between iterations; block-level `llamaMetrics`/`pauseMs` are defaults a profile can override. Copy `configs/opl-simplebench.json.sample` to `~/.pi/agent/configs/opl-simplebench.json` to configure DDGS/SearXNG research, optional llama-server/llamagputop metadata endpoints, and the run sequence. Use `/simplebench --no-artifact` or `simplebench({ no_artifact: true })` when responses must not be written to disk. Provider credentials remain outside tracked configuration; configure them through Pi provider settings, environment variables, or Pi authentication.
235
241
 
236
242
  ## Tests
237
243
 
@@ -239,4 +245,6 @@ A Pi package (npm or Git) still needs the one-time `npx playwright install chrom
239
245
  npm test
240
246
  ```
241
247
 
242
- Run one extension suite with `npm run test:opl-<name>` for `browser`, `footer`, `guardian`, `init`, `input`, `modes`, `questionnaire`, `todo`, `webaccess`, `simplebench`, or `ctxtrim`. `npm run test:pi-host` uses Pi 0.87.0's real extension loader to load every entrypoint and assert no loader errors. Every helper, functional, and selected-entrypoint smoke check uses Bun's named-test reporter; output includes per-test status, timings, and pass/fail totals. Functional tests cover deterministic helpers where practical; smoke tests bundle entrypoints and parse config. They do not test live TUI behavior, provider credentials, network access, or PDF extraction.
248
+ `npm run test:shared` runs the cross-extension checks: agent-directory resolution, parity of the duplicated host and git guards, installer, package metadata, and the `globalThis` seams between `opl-modes`, `opl-footer`, `opl-input` and `opl-configurator`. `npm run typecheck` runs `tsc` in strict mode over all 90 extension sources and is separate from `npm test`. Release validation uses `npm ci`, strict typechecking and the full suite; package tests exercise npm packing to exclude live configs. Run one extension suite with `npm run test:opl-<name>` for `browser`, `configurator`, `footer`, `guardian`, `init`, `input`, `modes`, `questionnaire`, `todo`, `webaccess`, `simplebench`, or `ctxtrim`. `npm run test:pi-host` uses the Pi build this machine actually runs (the installed managed release, falling back to the `>=0.87.0` devDependency when none is present) and its real extension loader to load every entrypoint and assert no loader errors. Every helper, functional, and selected-entrypoint smoke check uses Bun's named-test reporter; output includes per-test status, timings, and pass/fail totals. Functional tests cover deterministic helpers where practical; smoke tests bundle entrypoints and parse config. They do not test live TUI behavior, provider credentials, network access, or PDF extraction.
249
+
250
+ For agents/models testing extensions in a running Pi session, follow the [live-test instructions](tests/support/opl-live-test.md): one extension per phase, safe tool probes, operator-assisted UI checks, and separate reporting of live observations, automated coverage, and unverified behavior.
@@ -1,10 +1,11 @@
1
1
  {
2
- "_comment": "Optional. Copy to ~/.pi/agent/configs/opl-browser.json. All fields optional; defaults shown. allowPrivateNetwork (default false) blocks navigate/new_page from reaching private/link-local ranges; loopback (localhost) is always allowed for local development, and cloud-metadata endpoints are always blocked.",
2
+ "_comment": "Optional. Copy to ~/.pi/agent/configs/opl-browser.json. All fields optional; defaults shown. Model-supplied URLs are resolved before use: allowPrivateNetwork (default false) blocks navigation and page-initiated requests to hosts that are or resolve to private/link-local/reserved ranges, allowLoopback (default false) governs localhost/127.0.0.0/8/::1 — set it to true to let the browser reach local dev servers, and cloud-metadata addresses are always rejected. A context route guards every page-initiated request and every page WebSocket, service workers are blocked, and a page or frame that a redirect lands on a blocked host is cleared before it can be read. A hostname the system resolver does not know is refused.",
3
3
  "headless": true,
4
4
  "width": 1280,
5
5
  "height": 800,
6
6
  "navigationTimeoutMs": 30000,
7
7
  "previewChars": 4000,
8
8
  "getChars": 30000,
9
- "allowPrivateNetwork": false
9
+ "allowPrivateNetwork": false,
10
+ "allowLoopback": false
10
11
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "_comment": "Available segment IDs: pi, model, path, git, thinking, caveman, plan_mode, chat_mode, mode_switcher, separator, token_in, token_out, token_total, cache_read, cache_write, cost, context_pct, context_total, session_stats, perf_stats, status, codex_usage, openrouter_usage, text:<literal>. codex_usage and openrouter_usage are hidden by default; add codex_usage to show ChatGPT Codex subscription windows, or openrouter_usage to show the active OpenRouter API-key limit usage.",
2
+ "_comment": "Available segment IDs: pi, model, path, git, thinking, caveman, plan_mode, chat_mode, mode_switcher, separator, token_in, token_out, token_total, cache_read, cache_write, cost, context_pct, context_total, session_stats, compactions, perf_stats, status, codex_usage, openrouter_usage, text:<literal>. codex_usage and openrouter_usage are hidden by default; add codex_usage to show ChatGPT Codex subscription windows, or openrouter_usage to show the active OpenRouter API-key limit usage.",
3
3
  "row1LeftSegments": [
4
4
  "pi",
5
5
  "separator",
@@ -34,10 +34,11 @@
34
34
  "folder": "",
35
35
  "branch": "",
36
36
  "git": "",
37
+ "compress": "󰪶",
37
38
  "separator": "|"
38
39
  },
39
40
  "colors": {
40
- "model": "#c07898",
41
+ "model": "accent",
41
42
  "thinkingHigh": "#afb9fe",
42
43
  "thinkingXhigh": "#9575cd",
43
44
  "thinkingMax": "#ce93d8",
@@ -6,7 +6,7 @@
6
6
  "\\bsudo\\b",
7
7
  "\\b(chmod|chown)\\s+(?:-[a-z]+\\s+)*777(?:\\b|$)",
8
8
  "\\bprintenv\\b",
9
- "(^|\\s)env(\\s|$)"
9
+ "(?:^|[;&|()\\n])\\s*env(?:[\\s)|]|$)"
10
10
  ],
11
11
  "blockWithoutUI": true
12
12
  },
@@ -24,5 +24,11 @@
24
24
  "forkSession": true,
25
25
  "blockWithoutUI": true
26
26
  },
27
- "dropMalformedToolCalls": true
27
+ "dropMalformedToolCalls": true,
28
+ "logging": {
29
+ "incidentFile": null,
30
+ "maxBytes": 262144,
31
+ "_comment_incident_file": "Malformed-call forensics never go inside the open repository. null writes to <agent dir>/guardian-incidents.jsonl; a relative path also resolves under the agent dir; an absolute or ~/ path is used as given; false stops writing.",
32
+ "_comment_max_bytes": "Before an append that would pass this many bytes, the current log moves to guardian-incidents.jsonl.1 and a fresh one starts. One generation of history is kept."
33
+ }
28
34
  }
@@ -12,6 +12,11 @@
12
12
  "_comment": "Set to true to delete the plan file automatically after plan_complete is called.",
13
13
  "cleanupOnComplete": false
14
14
  },
15
+ "plan": {
16
+ "_comment": "UTF-8 byte ceilings include the truncation marker. maxInjectBytes bounds the plan body injected by plan-refine and execute modes; maxEntryBytes bounds the TUI-only session copy. Only complete lines are retained. If the source path cannot fit, the marker uses a generic reference or shortened notice; session entries retain the full path separately. Plan files remain unchanged. Both settings require positive integers; invalid values use the defaults.",
17
+ "maxInjectBytes": 24000,
18
+ "maxEntryBytes": 4096
19
+ },
15
20
  "defaultNotifyTemplate": "✓ {Name} mode ON",
16
21
  "_comment_defaultNotifyTemplate": "Default notify text for any custom mode that doesn't set its own labels.notify. {Name} is replaced with the mode name, capitalized.",
17
22
  "_comment_lazyTools": "Tool names withheld from the active set at rest and enabled on demand via the load_tools tool. Only affects modes that would otherwise include them (off/execute and custom modes that list them). Core built-ins, plan_complete, and load_tools are protected and ignored. Omit or leave empty to keep all tools always active.",
@@ -1,7 +1,13 @@
1
1
  {
2
2
  "_comment_limits": "Optional top-level caps: maxContentChars caps the initial web_search/fetch_content body (default 30000); maxRetrievalChars caps one get_search_content page (default 30000). Pass offset=N to get_search_content to continue a truncated retrieval. maxSearchQueries caps how many queries one web_search call runs (default 10); maxFetchUrls caps how many URLs one fetch_content call fetches (default 20). Excess inputs are skipped and reported in the tool output.",
3
- "_comment_network": "allowPrivateNetwork defaults to false: fetch_content rejects private-range and link-local hosts. Loopback (localhost/127.0.0.1/::1) is always allowed for local development, and cloud-metadata endpoints are always blocked. Set allowPrivateNetwork true to reach private ranges (LAN servers). This does NOT affect provider API endpoints (ddgs.apiUrl / searxng.instanceUrl), which remain configurable.",
3
+ "_comment_result_cache": "Retrieved bodies are spilled to <agent dir>/web-access-cache/<responseId>.json for 1 hour (32 MB ceiling, oldest dropped past it). The session file keeps only a bounded preview plus the path, so sessions no longer accumulate page bodies; get_search_content hydrates the full body from disk while the cache lives, and says so when it cannot.",
4
+ "_comment_timeout": "timeoutMs is the deadline for one provider search request or one fetched URL (default 30000). It is combined with the agent's own abort signal, so whichever is shorter wins.",
5
+ "timeoutMs": 30000,
6
+ "_comment_fetch_cap": "maxResponseBytes is the ceiling on one fetched response body (bytes, default 10485760). The transport stops reading and drops the socket past it, so an oversized page cannot cost memory before content truncation applies. Endpoints you configure yourself are unaffected.",
7
+ "maxResponseBytes": 10485760,
8
+ "_comment_network": "Network policy for fetch_content. Model-supplied URLs are resolved before use: allowPrivateNetwork (default false) rejects hosts that are or resolve to private/link-local/reserved addresses, allowLoopback (default false) governs localhost/127.0.0.0/8/::1 — set it to true to fetch from local dev servers, and cloud-metadata addresses are always rejected. Every redirect hop is re-validated and re-resolved. Set allowPrivateNetwork true to reach private ranges (LAN servers). This does NOT affect provider API endpoints (ddgs.apiUrl / searxng.instanceUrl), which are operator-configured and remain reachable on private or loopback hosts.",
4
9
  "allowPrivateNetwork": false,
10
+ "allowLoopback": false,
5
11
  "maxContentChars": 30000,
6
12
  "maxRetrievalChars": 30000,
7
13
  "maxSearchQueries": 10,