pi-advisor-flow 0.16.1-dev.2 → 0.17.1-dev.1

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 (41) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +17 -9
  3. package/dist/index.js +396 -106
  4. package/docs/configuration.md +21 -10
  5. package/docs/privacy.md +2 -2
  6. package/locales/de.json +8 -1
  7. package/locales/en.json +8 -1
  8. package/locales/fr.json +8 -1
  9. package/package.json +11 -11
  10. package/src/commands/activation-preparation.ts +30 -3
  11. package/src/commands/activation-settings.ts +73 -0
  12. package/src/commands/activation.ts +75 -56
  13. package/src/commands/advisor-tools.ts +27 -6
  14. package/src/commands/configuration-tool-preview.ts +107 -15
  15. package/src/commands/configuration-tool-runtime.ts +3 -20
  16. package/src/commands/configuration-tool-update.ts +23 -1
  17. package/src/commands/lifecycle.ts +30 -1
  18. package/src/commands/manual-progress.ts +5 -5
  19. package/src/commands/model-commands.ts +17 -0
  20. package/src/commands/model-picker.ts +14 -6
  21. package/src/commands/settings-commands.ts +36 -20
  22. package/src/commands/settings-persistence.ts +37 -1
  23. package/src/config/defaults.ts +10 -0
  24. package/src/config/schema-validators.ts +10 -0
  25. package/src/config/schema.ts +24 -1
  26. package/src/config/session-overrides.ts +109 -0
  27. package/src/config/state.ts +19 -0
  28. package/src/config/storage.ts +15 -1
  29. package/src/config/types.ts +11 -0
  30. package/src/session-state.ts +2 -0
  31. package/src/tools/budget-feedback.ts +2 -2
  32. package/src/tools/prompts.ts +18 -0
  33. package/src/tools/register-ask-advisor.ts +10 -4
  34. package/src/tools/register-lifecycle.ts +12 -6
  35. package/src/tools/registration.ts +8 -1
  36. package/src/tools/session-availability.ts +10 -0
  37. package/src/ui/settings-items.ts +43 -6
  38. package/src/ui/settings-list-adapter.ts +1 -1
  39. package/src/ui/settings-mutations.ts +14 -0
  40. package/src/ui/settings-selector.ts +1 -0
  41. package/src/ui/types.ts +8 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,20 @@ 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
+ - Added **Tracked file handoff** (`advisorTrackedFileHandoff`) in `/advisor-settings`. The default `advisor-named` keeps the current rule: `includeTrackedFiles` works only for files the latest Advisor answer names. `executor` lets the Executor attach tracked files on any consultation, without that extra round trip. Tracked file content consent, exact path checks, size limits, redaction, and untrusted-data labelling still apply.
12
+
13
+ ### Changed
14
+
15
+ - Updated development dependencies: Pi packages (`pi-ai`, `pi-coding-agent`, and `pi-tui`) to 1.6.0, Oxlint and plugins to 1.94.0, Bun types to 1.4.5, Knip to 6.47.0, lint-staged to 17.6.1, TypeBox to 1.4.7, and Ultracite to 8.3.1. Existing peer dependency ranges remain unchanged.
16
+
17
+ ## 0.17.0 - 2026-11-20
18
+
19
+ ### Added
20
+
21
+ - Added `advisorActivation: "session"` and an **Advisor activation** setting. Each session start, including `/reload`, leaves all three Advisor tools inactive; `/advisor` and `/advisor-off` toggle them without writing `advisor.json`. The default persistent behavior is unchanged.
22
+
9
23
  ### Fixed
10
24
 
11
25
  - Prevent `/model` and model cycling from changing the persisted Executor; update it only through `/advisor-models` or an explicit `/advisor executor=...` override.
package/README.md CHANGED
@@ -92,6 +92,14 @@ In the Settings, enable Simple Mode for a quick start.
92
92
 
93
93
  Unknown fields in `advisor.json` are preserved for forward compatibility and reported as non-blocking warnings. Invalid recognized values fail their own Advisor call with a clear message instead of blocking every tool call.
94
94
 
95
+ ### Session-only activation
96
+
97
+ Set **Advisor activation** to `session` in `/advisor-settings`, or add `"advisorActivation": "session"` to the global `advisor.json`. Each session start, including `/reload`, starts with `ask_advisor`, `record_advisor_outcome`, and `advisor_config` inactive. `/advisor` enables them for the current session; `/advisor-off` disables them again. Neither command writes `advisor.json` in this mode.
98
+
99
+ Session mode starts inactive even if `alwaysOn` was saved as `true`; it does not change that saved setting. Model choices and arguments supplied to `/advisor` stay in memory for the session. Use `/advisor-models` to save model choices explicitly. `/advisor-manual` and `/advisor-settings` remain available while the tools are off. This mode also frees Codemode's tool-declaration budget until Advisor is enabled.
100
+
101
+ The default, `"advisorActivation": "persistent"`, keeps the existing cross-session behavior. Switching to session mode keeps the current Advisor on/off state until the next session start. Switching back to persistent mode immediately applies the saved tool preference.
102
+
95
103
  ## Pi Codemode
96
104
 
97
105
  With Pi Codemode enabled and the Advisor flow active, call the existing tool through `tools.ask_advisor`; no separate review tool or workflow is needed:
@@ -141,14 +149,14 @@ Successful calls return an opaque `adviceId`. If global outcome logging is enabl
141
149
 
142
150
  ## Commands
143
151
 
144
- | Command | What it does |
145
- | ------------------------- | -------------------------------------------------------------------------------------- |
146
- | `/advisor` | Enable the flow; choose available models when needed. |
147
- | `/advisor-manual [focus]` | Ask for an immediate second opinion. |
148
- | `/advisor-models` | Choose the Executor, Advisor, and optional fallback models. |
149
- | `/advisor-settings` | Configure behavior, models, context, privacy, and limits. |
150
- | `/advisor-stats` | Show retained outcome adoption and validation stats. |
151
- | `/advisor-off` | Disable model-facing Advisor tools across sessions and turn off persistent activation. |
152
+ | Command | What it does |
153
+ | ------------------------- | ------------------------------------------------------------------------------------------- |
154
+ | `/advisor` | Enable the flow; choose available models when needed. |
155
+ | `/advisor-manual [focus]` | Ask for an immediate second opinion. |
156
+ | `/advisor-models` | Choose the Executor, Advisor, and optional fallback models. |
157
+ | `/advisor-settings` | Configure behavior, models, context, privacy, and limits. |
158
+ | `/advisor-stats` | Show retained outcome adoption and validation stats. |
159
+ | `/advisor-off` | Disable Advisor tools across sessions by default, or only for this session in session mode. |
152
160
 
153
161
  In the interactive TUI, `/advisor-manual [focus]` opens a centered overlay with the focus text prefilled, a choice of permitted Git-context level, and live progress in the transcript. Canceling has no side effects.
154
162
 
@@ -172,7 +180,7 @@ Contributing or improving a locale: mirror the exact keys from [`locales/en.json
172
180
 
173
181
  ## Privacy
174
182
 
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.
183
+ 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. By default, the Executor may attach tracked files only after the Advisor names them; set **Tracked file handoff** in `/advisor-settings` (or `"advisorTrackedFileHandoff": "executor"`) to let it attach them on any consultation. 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.
176
184
 
177
185
  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.
178
186