pi-advisor-flow 0.15.1 → 0.15.2-dev.2

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 (72) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +17 -2
  3. package/dist/index.js +1194 -506
  4. package/docs/README.md +9 -0
  5. package/docs/benchmark.md +22 -0
  6. package/docs/configuration.md +194 -0
  7. package/docs/development.md +38 -0
  8. package/docs/herdr.md +169 -0
  9. package/docs/privacy.md +102 -0
  10. package/extensions/index.ts +23 -0
  11. package/locales/de.json +330 -0
  12. package/locales/en.json +331 -0
  13. package/locales/es.json +3 -0
  14. package/locales/fr.json +330 -0
  15. package/locales/pt-BR.json +3 -0
  16. package/locales/pt.json +3 -0
  17. package/locales/ru.json +3 -0
  18. package/locales/uk.json +3 -0
  19. package/locales/zh.json +3 -0
  20. package/package.json +15 -2
  21. package/skills/pi-advisor-flow/SKILL.md +62 -0
  22. package/src/commands/activation-preparation.ts +9 -2
  23. package/src/commands/activation.ts +28 -8
  24. package/src/commands/configuration-tool-models.ts +143 -0
  25. package/src/commands/configuration-tool-policy.ts +177 -0
  26. package/src/commands/configuration-tool-preview.ts +228 -0
  27. package/src/commands/configuration-tool-runtime.ts +40 -0
  28. package/src/commands/configuration-tool-transaction.ts +120 -0
  29. package/src/commands/configuration-tool-update.ts +230 -0
  30. package/src/commands/configuration-tool.ts +89 -0
  31. package/src/commands/lifecycle.ts +6 -1
  32. package/src/commands/manual-consultation.ts +6 -1
  33. package/src/commands/manual-progress.ts +4 -3
  34. package/src/commands/model-commands.ts +2 -1
  35. package/src/commands/model-options.ts +4 -6
  36. package/src/commands/model-picker.ts +16 -6
  37. package/src/commands/registration.ts +2 -0
  38. package/src/commands/runtime.ts +17 -4
  39. package/src/commands/settings-commands.ts +30 -7
  40. package/src/config/schema-validators.ts +104 -0
  41. package/src/config/schema.ts +35 -102
  42. package/src/config/storage.ts +160 -7
  43. package/src/i18n.ts +31 -0
  44. package/src/redaction.ts +64 -19
  45. package/src/scout-group-serialization.ts +66 -0
  46. package/src/scout-groups.ts +3 -66
  47. package/src/scout-selection.ts +99 -0
  48. package/src/scout.ts +6 -93
  49. package/src/session-state.ts +27 -137
  50. package/src/tool-input-normalization.ts +119 -0
  51. package/src/tools/gate-policy.ts +13 -5
  52. package/src/tools/jev-filter.ts +2 -1
  53. package/src/tools/jev-turn-gate.ts +2 -1
  54. package/src/tools/register-lifecycle.ts +5 -1
  55. package/src/tools/register-outcome.ts +5 -1
  56. package/src/tools/register-renderers.ts +5 -2
  57. package/src/tools/render-advisor-result.ts +20 -8
  58. package/src/tools/render-common.ts +16 -4
  59. package/src/tools/scout-status.ts +10 -2
  60. package/src/ui/jev-classifier-submenu.ts +143 -38
  61. package/src/ui/jev-filter-submenu.ts +52 -14
  62. package/src/ui/jev-provider-submenu-view.ts +72 -20
  63. package/src/ui/jev-provider-submenu.ts +40 -12
  64. package/src/ui/jev-setup-support.ts +48 -19
  65. package/src/ui/manual-dialog-render.ts +71 -25
  66. package/src/ui/searchable-model-list.ts +18 -4
  67. package/src/ui/settings-formatting.ts +5 -2
  68. package/src/ui/settings-items-jev.ts +216 -0
  69. package/src/ui/settings-items.ts +216 -259
  70. package/src/ui/settings-selector.ts +9 -2
  71. package/src/ui/text-setting-submenu.ts +8 -1
  72. package/src/usage.ts +9 -3
package/CHANGELOG.md CHANGED
@@ -6,6 +6,15 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ### Added
10
+
11
+ - Bundled the `pi-advisor-flow` Pi skill and added the `advisor_config` tool so agents can inspect and update settings after confirmation.
12
+ - Localized the human-facing interface via the optional `@juicesharp/rpiv-i18n` peer dependency: settings, dialogs, submenus, notifications, and transcript renderers resolve through `t()` with complete `de` and `fr` locale files; every other locale falls back to English. Model-facing strings (tool descriptions, prompts, tool-result envelopes) intentionally remain English. A key-consistency test guards locale drift and an integration test verifies live locale switching.
13
+
14
+ ### Fixed
15
+
16
+ - Prevented catastrophic backtracking in quoted credential redaction, fail closed on ambiguous assignments and private-key blocks, and omit oversized redaction inputs rather than scanning or truncating them.
17
+
9
18
  ## 0.15.1 - 2026-11-14
10
19
 
11
20
  ### Fixed
package/README.md CHANGED
@@ -31,6 +31,7 @@ Keep implementation on a fast model and borrow frontier reasoning only when deci
31
31
  - **Compact searchable `/advisor-settings`** that matches Pi's settings list and saves changes immediately.
32
32
  - **Experimental Advisor Scout** that uses the configured Executor model to curate conversation evidence before every Advisor call.
33
33
  - **Optional Jev classifier screening and proactive turn gate**: typed Pi classifiers can skip low-stakes, self-answerable consultations or proactively pull in the Advisor. `/advisor-settings` offers available Pi-authenticated classifiers plus an explicit **Jev API Key** option. The API-key option is independently masked, live-verified, and stored only in a Jev-classifier-specific secure store; legacy keys are not migrated. Custom classifiers must be registered by a Pi provider extension. Both features remain off by default.
34
+ - **Bundled `pi-advisor-flow` skill and `advisor_config` tool** so the agent can explain the workflow, inspect settings, and apply requested changes after confirmation.
34
35
 
35
36
  ## How it works
36
37
 
@@ -66,7 +67,7 @@ You can also install from GitHub:
66
67
  pi install git:github.com/philipbrembeck/pi-advisor.git
67
68
  ```
68
69
 
69
- Reload Pi after installing.
70
+ Reload Pi after installing. The package also installs the `pi-advisor-flow` skill; ask the agent how Advisor Flow works or run `/skill:pi-advisor-flow` to load its guide directly. To change settings through chat, ask the agent; it uses `advisor_config` to inspect settings and apply requested changes after an interactive confirmation. Model choices use the existing picker, and Jev classifier/credential setup stays in `/advisor-settings`.
70
71
 
71
72
  ## Quick start
72
73
 
@@ -155,9 +156,23 @@ In the interactive TUI, `/advisor-manual [focus]` opens a centered overlay with
155
156
 
156
157
  Advisor Scout is off by default. When enabled in `/advisor-settings` or via `"advisorScoutEnabled": true`, the Executor model first selects relevant conversation history before the Advisor sees it. Scout runs in a separate model call, which adds cost and latency up front but can shrink the Advisor call. A bounded result shows the model, selection counts, and usage; on any failure it falls back to sending the original conversation unchanged. This experiment adapts the context-boundary idea from Zhang et al., ["FastContext: Training Efficient Repository Explorer for Coding Agents"](https://arxiv.org/html/2606.14066v1) — it curates conversation history only and is not a reproduction of FastContext. See the [configuration guide](https://github.com/philipbrembeck/pi-advisor/blob/main/docs/configuration.md) for details.
157
158
 
159
+ ## Localization
160
+
161
+ pi-advisor localizes its human-facing interface through [`@juicesharp/rpiv-i18n`](https://www.npmjs.com/package/@juicesharp/rpiv-i18n). German and French ship complete (`locales/de.json`, `locales/fr.json`); other Pi locales fall back to English until contributed. Strings sent to the model — tool descriptions, prompts, and validation envelopes — intentionally stay English so behavior is identical in every language.
162
+
163
+ To use a localized interface:
164
+
165
+ ```sh
166
+ pi install npm:@juicesharp/rpiv-i18n
167
+ ```
168
+
169
+ Then pick a language with `/languages` in the session. Without the SDK installed, pi-advisor runs unchanged in English — it is an optional peer dependency, never required.
170
+
171
+ Contributing or improving a locale: mirror the exact keys from [`locales/en.json`](https://github.com/philipbrembeck/pi-advisor/blob/main/locales/en.json) into `locales/<code>.json` (a `test/i18n-locale-consistency.test.ts` guards key drift), and leave reserved labels like toggle values untranslated. The initial `de` and `fr` translations were machine-assisted — native review is welcome.
172
+
158
173
  ## Privacy
159
174
 
160
- Advisor requests can include user messages, tool calls, tool results, targeted questions, trusted project and global `AGENTS.md` rules, and repository information. `advisorAgentsMdContext` is on by default and can be disabled in `/advisor-settings`; rules are sent as origin-labelled, capped, redacted, untrusted review guidance only. Untrusted projects withhold both rule files and tell the Advisor that rules were withheld. Repository context is configurable from no access through changed-file summaries to a capped patch; when it is disabled, the Advisor is told so rather than shown an apparently clean tree. Images from disclosed conversation and full-policy tool results can be sent as pixels only to image-capable Advisor models; Scout sees markers, not pixels. Exact tracked and untracked image files can be attached using `includeTrackedFiles` and `includeUntracked` under their existing separate global consent rules. Images are limited to four and 8 MiB total, with a 4 MiB per-image cap; unsupported, missing, or oversized images are reported as withheld, not reviewed. Explicit tracked and untracked file contents require separate global opt-ins and are sent as untrusted data. Secret redaction is off by default; when enabled, credential-shaped values in targeted questions are redacted before the provider request. Tools without an explicit policy use full context. Settings are global, so a project cannot silently change them.
175
+ Advisor requests can include user messages, tool calls, tool results, targeted questions, trusted project and global `AGENTS.md` rules, and repository information. `advisorAgentsMdContext` is on by default and can be disabled in `/advisor-settings`; rules are sent as origin-labelled, capped, redacted, untrusted review guidance only. Untrusted projects withhold both rule files and tell the Advisor that rules were withheld. Repository context is configurable from no access through changed-file summaries to a capped patch; when it is disabled, the Advisor is told so rather than shown an apparently clean tree. Images from disclosed conversation and full-policy tool results can be sent as pixels only to image-capable Advisor models; Scout sees markers, not pixels. Exact tracked and untracked image files can be attached using `includeTrackedFiles` and `includeUntracked` under their existing separate global consent rules. Images are limited to four and 8 MiB total, with a 4 MiB per-image cap; unsupported, missing, or oversized images are reported as withheld, not reviewed. Explicit tracked and untracked file contents require separate global opt-ins and are sent as untrusted data. Secret redaction is off by default; when enabled, credential-shaped values in targeted questions are redacted before the provider request. Individual text inputs over 65,536 UTF-16 code units are omitted rather than scanned or truncated, and ambiguous secret blocks can cause additional text to be omitted. Tools without an explicit policy use full context. Settings are global, so a project cannot silently change them.
161
176
 
162
177
  When Scout is enabled, the Executor model provider also receives bounded Advisor-eligible conversation history. Pi's `buildContextEntries()` projection is used when available. OMP-compatible session managers without that API are supported through the active branch, with the latest reset boundary and compaction's retained range applied before history or images are disclosed; cleared and compacted-out entries are not forwarded. Read [Privacy and data handling](https://github.com/philipbrembeck/pi-advisor/blob/main/docs/privacy.md) before using pi-advisor with sensitive work.
163
178