@fiale-plus/pi-rogue-advisor 0.1.4 → 0.1.6
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 +43 -7
- package/package.json +2 -2
- package/skills/advisor/SKILL.md +36 -38
- package/src/extension.test.ts +6 -6
- package/src/extension.ts +4 -4
package/README.md
CHANGED
|
@@ -1,14 +1,50 @@
|
|
|
1
1
|
# @fiale-plus/pi-rogue-advisor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## What this package is
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Strategic advisor for Pi sessions with low-overhead preflight/post-review routing, model auto-detection, session memory, and optional mid-session check-ins.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- SOTA-first model fallback: `gpt-5.5`/`claude-opus-4-6`/`claude-sonnet-4-6` where available.
|
|
8
|
+
- Keeps command-level behavior simple and explicit.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## Install
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
```bash
|
|
13
|
+
# Published package (recommended)
|
|
14
|
+
pi install npm:@fiale-plus/pi-rogue-advisor
|
|
15
|
+
|
|
16
|
+
# Local package development
|
|
17
|
+
npm install --workspace packages/advisor
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Commands
|
|
21
|
+
|
|
22
|
+
| Command | What it does |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `/pi-rogue` | Show the Pi-Rogue cockpit + command pointers |
|
|
25
|
+
| `/advisor` | Show status (`/advisor status`) and quick hint |
|
|
26
|
+
| `/advisor status` | Show mode, review policy, check-in status, model selection, counters |
|
|
27
|
+
| `/advisor on` | Enable advisor (auto mode) |
|
|
28
|
+
| `/advisor off` | Disable advisor |
|
|
29
|
+
| `/advisor mode auto\|manual\|off` | Change routing behavior |
|
|
30
|
+
| `/advisor review light\|strict\|off` | Change review strictness |
|
|
31
|
+
| `/advisor checkins on\|off\|<minutes>` | Enable/disable low-cost mid-hour check-ins |
|
|
32
|
+
| `/advisor config` | Show current config |
|
|
33
|
+
| `/advisor model <provider>/<model>` | Set explicit model override |
|
|
34
|
+
| `/advisor <question>` | Get one-shot advisory response |
|
|
35
|
+
|
|
36
|
+
## Notes on defaults
|
|
37
|
+
|
|
38
|
+
- `mode`: `auto`
|
|
39
|
+
- `review`: `light`
|
|
40
|
+
- `checkins`: `off` (orchestration turns them on while a goal/autoresearch flow is active)
|
|
41
|
+
- `checkinIntervalMinutes`: `30`
|
|
42
|
+
- `model`: not set (auto-detected)
|
|
43
|
+
|
|
44
|
+
Check-ins gate on session activity, are bounded, and avoid overlapping calls. They can still be controlled explicitly with `/advisor checkins on|off|<minutes>`.
|
|
45
|
+
|
|
46
|
+
## Stability guarantees
|
|
47
|
+
|
|
48
|
+
- No flattening: the advisor remains its own surface and does not hide orchestration commands.
|
|
49
|
+
- Cockpit is simple and explicit: `/pi-rogue` is the top-level status view.
|
|
12
50
|
|
|
13
|
-
- `/pi-rogue` — cockpit/status entry point
|
|
14
|
-
- `/advisor checkins on|off|<minutes>` — configure low-power mid-session check-ins
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiale-plus/pi-rogue-advisor",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"description": "Pi-Rogue advisor extension for Pi — multi-model support, SOTA model suggestion, cache-aware session advisory.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
package/skills/advisor/SKILL.md
CHANGED
|
@@ -3,48 +3,46 @@ name: advisor
|
|
|
3
3
|
description: Zero-config strategic advisor for Pi. Auto-detects best model, phase-aware routing, preflight + post-review + cache. Use for architecture, tradeoffs, planning.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Pi-Rogue Advisor
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
> 96 strategic calls saved ~$53 on GPT-5.5 over 3,071 turns — see [`docs/savings.md`](../../docs/savings.md)
|
|
8
|
+
Use this skill for non-trivial decisions before/after significant edits.
|
|
11
9
|
|
|
12
10
|
## Quick start
|
|
13
11
|
|
|
14
|
-
- `/pi-rogue` — cockpit
|
|
15
|
-
- `/advisor` —
|
|
16
|
-
- `/advisor <question>` —
|
|
17
|
-
- `/advisor on|off
|
|
18
|
-
- `/advisor checkins on|off|<minutes>` — configure low-power mid-hour check-ins
|
|
19
|
-
|
|
20
|
-
Zero config needed. Falls back through SOTA models (gpt-5.5 → claude-opus-4-6 → sonnet-4-6) automatically.
|
|
21
|
-
|
|
22
|
-
The router is phase-aware: it keeps tiny edits cheap, escalates complex/high-risk work to SOTA, and writes compact routing logs for future classifier training.
|
|
23
|
-
|
|
24
|
-
## When to call
|
|
25
|
-
|
|
26
|
-
Agent should call `advisor` tool before: new frameworks, refactoring, API design, concurrency, security, tradeoffs.
|
|
27
|
-
Skip: reads, small edits, one-liners.
|
|
12
|
+
- `/pi-rogue` — open cockpit and command pointers
|
|
13
|
+
- `/advisor status` — show current advisor settings and model route
|
|
14
|
+
- `/advisor <question>` — ask immediate advice
|
|
15
|
+
- `/advisor checkins on|off|<minutes>` — control low-power check-ins
|
|
28
16
|
|
|
29
|
-
##
|
|
17
|
+
## Command surface
|
|
30
18
|
|
|
31
19
|
| Command | What it does |
|
|
32
|
-
|
|
33
|
-
| `/advisor` | Show status
|
|
34
|
-
| `/advisor
|
|
35
|
-
| `/advisor on` | Enable auto mode
|
|
36
|
-
| `/advisor off` | Disable |
|
|
37
|
-
| `/advisor mode auto\|manual\|off` |
|
|
38
|
-
| `/advisor
|
|
39
|
-
| `/advisor
|
|
40
|
-
| `/advisor config` |
|
|
41
|
-
| `/advisor
|
|
42
|
-
| `/advisor
|
|
43
|
-
|
|
44
|
-
##
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
20
|
+
|---|---|
|
|
21
|
+
| `/advisor` | Show status + config summary |
|
|
22
|
+
| `/advisor status` | Same as `/advisor` |
|
|
23
|
+
| `/advisor on` | Enable auto mode |
|
|
24
|
+
| `/advisor off` | Disable advisor |
|
|
25
|
+
| `/advisor mode auto\|manual\|off` | Control when advisor auto-runs |
|
|
26
|
+
| `/advisor review light\|strict\|off` | Set review threshold |
|
|
27
|
+
| `/advisor checkins on\|off\|<minutes>` | Configure interval check-ins |
|
|
28
|
+
| `/advisor config` | Dump full config |
|
|
29
|
+
| `/advisor model <provider/model>` | Pin model explicitly |
|
|
30
|
+
| `/advisor <question>` | Run one advisory response |
|
|
31
|
+
|
|
32
|
+
## Routing and safety
|
|
33
|
+
|
|
34
|
+
- Preflight is heuristics + quick local gate first.
|
|
35
|
+
- Review runs after edits and/or at completion points by policy.
|
|
36
|
+
- No hidden long-running background daemon: check-ins are interval-gated and lightweight.
|
|
37
|
+
|
|
38
|
+
## Keep scope clear
|
|
39
|
+
|
|
40
|
+
The advisor surface is separate from orchestration (`goal`/`loop`/`autoresearch`) and intentionally stays a small command set with explicit entries above.
|
|
41
|
+
|
|
42
|
+
## Defaults
|
|
43
|
+
|
|
44
|
+
- `mode: auto`
|
|
45
|
+
- `review: light`
|
|
46
|
+
- `checkins: off` by default; orchestration enables them while a goal/autoresearch flow is active
|
|
47
|
+
- `checkinIntervalMinutes: 30`
|
|
48
|
+
- `model: auto`
|
package/src/extension.test.ts
CHANGED
|
@@ -18,11 +18,11 @@ function state(overrides: Record<string, unknown> = {}) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
describe("AdvisorConfig", () => {
|
|
21
|
-
it("defaults to auto mode, light review, and
|
|
21
|
+
it("defaults to auto mode, light review, and goal-scoped check-ins off", () => {
|
|
22
22
|
const cfg = normalizeAdvisorConfig({});
|
|
23
23
|
expect(cfg.mode).toBe("auto");
|
|
24
24
|
expect(cfg.review).toBe("light");
|
|
25
|
-
expect(cfg.checkins).toBe("
|
|
25
|
+
expect(cfg.checkins).toBe("off");
|
|
26
26
|
expect(cfg.checkinIntervalMinutes).toBe(30);
|
|
27
27
|
expect(cfg.model).toBeUndefined();
|
|
28
28
|
});
|
|
@@ -57,7 +57,7 @@ describe("AdvisorConfig", () => {
|
|
|
57
57
|
const parsed = normalizeAdvisorConfig(JSON.parse(json) as AdvisorConfig);
|
|
58
58
|
expect(parsed.mode).toBe("auto");
|
|
59
59
|
expect(parsed.review).toBe("light");
|
|
60
|
-
expect(parsed.checkins).toBe("
|
|
60
|
+
expect(parsed.checkins).toBe("off");
|
|
61
61
|
expect(parsed.checkinIntervalMinutes).toBe(30);
|
|
62
62
|
expect(parsed.model).toBe("claude-opus-4-6");
|
|
63
63
|
});
|
|
@@ -65,21 +65,21 @@ describe("AdvisorConfig", () => {
|
|
|
65
65
|
|
|
66
66
|
describe("mid-hour check-ins", () => {
|
|
67
67
|
it("does not run immediately after session start", () => {
|
|
68
|
-
const cfg = normalizeAdvisorConfig({ checkinIntervalMinutes: 30 });
|
|
68
|
+
const cfg = normalizeAdvisorConfig({ checkins: "mid-hour", checkinIntervalMinutes: 30 });
|
|
69
69
|
const startedAt = 1_000;
|
|
70
70
|
const now = startedAt + 5 * 60_000;
|
|
71
71
|
expect(shouldRunCheckin(cfg, state(), now, startedAt)).toBeNull();
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
it("runs after interval when there was new activity", () => {
|
|
75
|
-
const cfg = normalizeAdvisorConfig({ checkinIntervalMinutes: 30 });
|
|
75
|
+
const cfg = normalizeAdvisorConfig({ checkins: "mid-hour", checkinIntervalMinutes: 30 });
|
|
76
76
|
const startedAt = 1_000;
|
|
77
77
|
const now = startedAt + 31 * 60_000;
|
|
78
78
|
expect(shouldRunCheckin(cfg, state(), now, startedAt)).toMatch(/mid-hour check-in/);
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
it("does not run without activity since the last check-in", () => {
|
|
82
|
-
const cfg = normalizeAdvisorConfig({ checkinIntervalMinutes: 30 });
|
|
82
|
+
const cfg = normalizeAdvisorConfig({ checkins: "mid-hour", checkinIntervalMinutes: 30 });
|
|
83
83
|
const lastAt = new Date(1_000).toISOString();
|
|
84
84
|
const now = 1_000 + 60 * 60_000;
|
|
85
85
|
expect(shouldRunCheckin(cfg, state({ turns: 5, checkin: { lastAt, lastTurn: 5 } }), now, 1_000)).toBeNull();
|
package/src/extension.ts
CHANGED
|
@@ -38,7 +38,7 @@ export interface AdvisorConfig {
|
|
|
38
38
|
const DEFAULT_CONFIG: AdvisorConfig = {
|
|
39
39
|
mode: "auto",
|
|
40
40
|
review: "light",
|
|
41
|
-
checkins: "
|
|
41
|
+
checkins: "off",
|
|
42
42
|
checkinIntervalMinutes: 30,
|
|
43
43
|
};
|
|
44
44
|
|
|
@@ -121,7 +121,7 @@ export function normalizeAdvisorConfig(raw: Partial<AdvisorConfig> = {}): Adviso
|
|
|
121
121
|
return {
|
|
122
122
|
mode: (raw.mode === "manual" || raw.mode === "off") ? raw.mode : "auto",
|
|
123
123
|
review: (raw.review === "strict" || raw.review === "off") ? raw.review : "light",
|
|
124
|
-
checkins: raw.checkins === "
|
|
124
|
+
checkins: raw.checkins === "mid-hour" ? "mid-hour" : DEFAULT_CONFIG.checkins,
|
|
125
125
|
checkinIntervalMinutes: Math.min(MAX_CHECKIN_INTERVAL_MINUTES, Math.max(MIN_CHECKIN_INTERVAL_MINUTES, Number.isFinite(interval) ? Math.round(interval) : DEFAULT_CONFIG.checkinIntervalMinutes)),
|
|
126
126
|
model: raw.model || undefined,
|
|
127
127
|
};
|
|
@@ -374,7 +374,7 @@ function syncCheckinTimer(pi: ExtensionAPI, ctx: any): void {
|
|
|
374
374
|
function piRogueCockpitText(config: AdvisorConfig, state: SessionState, currentNote: string): string {
|
|
375
375
|
const normalized = normalizeAdvisorConfig(config);
|
|
376
376
|
return [
|
|
377
|
-
"☠︎
|
|
377
|
+
"☠︎ Pi-Rogue cockpit",
|
|
378
378
|
currentNote ? `Advisor: ${truncate(currentNote, 220)}` : "Advisor: no current note",
|
|
379
379
|
`Mode: ${normalized.mode} | Review: ${normalized.review} | Check-ins: ${normalized.checkins === "off" ? "off" : `${normalized.checkinIntervalMinutes}m`}`,
|
|
380
380
|
`Turns: ${state.turns} | Advisor calls: ${state.advisorCalls} | Cache hits: ${state.cacheHits}`,
|
|
@@ -666,7 +666,7 @@ export function registerAdvisor(pi: ExtensionAPI): void {
|
|
|
666
666
|
|
|
667
667
|
// ── /pi-rogue cockpit ──────────────────────────────────────────────────
|
|
668
668
|
pi.registerCommand("pi-rogue", {
|
|
669
|
-
description: "Show
|
|
669
|
+
description: "Show Pi-Rogue cockpit: advisor, check-ins, and orchestration command pointers",
|
|
670
670
|
getArgumentCompletions: (prefix: string) => piRogueArgumentCompletions(prefix),
|
|
671
671
|
handler: async (args, ctx) => {
|
|
672
672
|
const cfg = loadConfig();
|