@restranger/repi-advisor 0.0.0-stage → 0.0.1-44677f3

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/README.md CHANGED
@@ -1,3 +1,89 @@
1
- # Temporary Holding Version
1
+ # @restranger/repi-advisor
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Advisor strategy pattern for Pi Coding Agent (`@earendil-works/pi-coding-agent`).
4
+
5
+ Enables the primary executor model to escalate its entire conversation to a second, stronger reviewer model (the advisor) and receive back a concrete plan, a correction, or a stop signal — then keep going.
6
+
7
+ Includes first-class integration with **model fallback chains** (`@restranger/repi-model-fallback`) and **subagents** (`@restranger/repi-subagents`).
8
+
9
+ ## Features
10
+
11
+ - **Zero-parameter `advisor` tool**: The executor calls `advisor()` with no manual copying. The entire conversation context is serialized and forwarded.
12
+ - **Model Fallback Chain**: If the primary advisor model is unavailable (rate-limited, overloaded, error, quota exhausted), it automatically falls back to secondary advisor models.
13
+ - **Subagents Integration**: The advisor is informed of all declared declarative subagents via `@restranger/repi-lib`'s `re:subagents@1` contract and can instruct the executor to delegate specialized tasks (e.g. `Explore`, `Plan`, `verification`).
14
+ - **Service Seam Integration**: Publishes `re:advisor@1` (`AdvisorService`), allowing `@restranger/repi-model-fallback` to manage and persist advisor fallback models in the unified `/fallback` menu.
15
+ - **Dynamic Policy & Blocklist**: Automatically hides or shows the `advisor` tool based on the executor's active model and reasoning level (`disabledForModels`).
16
+ - **Interactive TUI Picker**: Clean native TUI menu for selecting the advisor model, reasoning effort, and fallback chains.
17
+
18
+ ## Installation
19
+
20
+ ```sh
21
+ pi install npm:@restranger/repi-advisor
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ Run the `/advisor` command to open the interactive setup picker:
27
+
28
+ ```
29
+ /advisor
30
+ ```
31
+
32
+ Pick an advisor model and (if supported) the reasoning effort level. The tool becomes active immediately.
33
+
34
+ ### Slash Commands
35
+
36
+ - `/advisor` — Open interactive configuration menu. It renders like Pi's native pickers (`/models`,
37
+ `/scoped-models`, `ctx.ui.select`): an inline frame in the editor slot, a `→ ` cursor, muted
38
+ descriptions and a key-hint line.
39
+ - **Settings roster**: Lists `Model`, `Reasoning effort`, and `Fallback models`, with a preview of
40
+ the fallback chain below.
41
+ - **Model picker**: Press `Enter` on `Model` to select an advisor model with fuzzy search, or pick
42
+ `No advisor` to disable it.
43
+ - **Effort picker**: Press `Enter` on `Reasoning effort` to pick a reasoning effort level (`model default`,
44
+ `minimal`, `low`, `medium`, `high (recommended)`, `xhigh`, `max`).
45
+ - **Fallback picker**: Press `Enter` on `Fallback models` to open a multi-select picker modelled on
46
+ `/scoped-models`: `Enter` toggles a model, `Ctrl+A`/`Ctrl+X` enable or clear the list, `Ctrl+P`
47
+ toggles provider, and `Alt+↑/↓` reorders the chain (`#n` rank).
48
+ - Press `Ctrl+S` (or `s` in settings) to save. Settings are written to the user config
49
+ (`<agentDir>/extensions/repi-advisor.json`) so they work before trust; a trusted project that already
50
+ owns a config is updated in place.
51
+ - Press `q` or `Esc` to close (or back from a picker).
52
+ - `/advisor status` — Inspect the active advisor model, reasoning effort, fallback chain, and subagents integration status.
53
+ - `/advisor list` — List all available models suitable for acting as advisor.
54
+ - `/advisor off` — Disable the advisor tool.
55
+ - `/advisor model <provider/id>` — Quickly switch the advisor model.
56
+ - `/advisor effort <minimal|low|medium|high|xhigh|max|off>` — Set reasoning effort.
57
+ - `/advisor fallback <model1,model2,...>` — Set the fallback chain for the advisor.
58
+
59
+ ## Fallback Integration
60
+
61
+ When `@restranger/repi-model-fallback` is installed, the unified `/fallback` command automatically detects the advisor through the `re:advisor@1` contract. You can configure fallback chains for the Main Agent, the Advisor, and Subagents in a single interface.
62
+
63
+ ## Subagents Integration
64
+
65
+ When `@restranger/repi-subagents` is installed, the advisor model receives the current roster of available subagents in its prompt context. If a complex multi-step task arises, the advisor will guide the executor to launch relevant subagents.
66
+
67
+ ## Configuration
68
+
69
+ Settings are saved in `.pi/extensions/repi-advisor.json` (or `~/.config/repi/advisor.json`).
70
+
71
+ ```json
72
+ {
73
+ "version": 1,
74
+ "modelKey": "anthropic/claude-3-7-sonnet",
75
+ "effort": "high",
76
+ "fallbackModels": [
77
+ "openai/gpt-4o",
78
+ "google/gemini-2.5-pro"
79
+ ],
80
+ "disabledForModels": [
81
+ "anthropic/claude-3-7-sonnet",
82
+ { "model": "openai/gpt-4.5-preview", "minEffort": "high" }
83
+ ]
84
+ }
85
+ ```
86
+
87
+ ## License
88
+
89
+ MIT
package/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
- "name": "@restranger/repi-advisor",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@restranger/repi-advisor",
3
+ "version": "0.0.1-44677f3",
4
+ "description": "Advisor strategy pattern for pi-coding-agent with model fallback and subagents integration",
5
+ "type": "module",
6
+ "main": "./src/index.ts",
7
+ "types": "./src/index.ts",
8
+ "exports": {
9
+ ".": "./src/index.ts"
10
+ },
11
+ "files": ["src", "README.md", "!src/**/__tests__"],
12
+ "keywords": ["pi-package", "pi-coding-agent", "advisor", "model-fallback", "subagents", "tui"],
13
+ "author": "ReStranger <restranger@disroot.org>",
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/ReStranger/repi-mono.git",
18
+ "directory": "packages/advisor"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/ReStranger/repi-mono/issues"
22
+ },
23
+ "homepage": "https://github.com/ReStranger/repi-mono#readme",
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "pi": {
28
+ "extensions": ["./src/index.ts"]
29
+ },
30
+ "dependencies": {
31
+ "@restranger/repi-lib": "0.0.1-44677f3",
32
+ "@restranger/repi-ui": "0.0.1-44677f3"
33
+ },
34
+ "peerDependencies": {
35
+ "@earendil-works/pi-coding-agent": ">=0.79.0"
36
+ },
37
+ "peerDependenciesMeta": {
38
+ "@earendil-works/pi-coding-agent": {
39
+ "optional": true
40
+ }
41
+ },
42
+ "devDependencies": {
43
+ "@restranger/repi-test-utils": "0.0.1-44677f3"
44
+ }
45
+ }