pi-advisor-flow 0.3.0 → 0.3.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.
- package/CHANGELOG.md +10 -0
- package/README.md +3 -3
- package/package.json +7 -7
- package/src/commands.ts +24 -11
- package/src/ui.ts +12 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to this project are documented here.
|
|
|
4
4
|
|
|
5
5
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## 0.3.1
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Updated the supported runtime baseline to Pi 0.84.1 and verified Herdr reporting against Herdr 0.8.0 while retaining the same request compatibility with Herdr 0.7.5.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Show configured models and thinking levels first and ticked in `/advisor-models`, allowing Enter to keep each current selection.
|
|
16
|
+
|
|
7
17
|
## 0.3.0
|
|
8
18
|
|
|
9
19
|
### Added
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ The idea is simple: keep implementation on a fast model and borrow frontier reas
|
|
|
23
23
|
|
|
24
24
|
## Install
|
|
25
25
|
|
|
26
|
-
Current release: **0.3.
|
|
26
|
+
Current release: **0.3.1**. Requires Pi 0.84.1 or later and is compatible with Herdr 0.8.0. The extension installs no dependencies of its own; Pi supplies its runtime modules.
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
# npm
|
|
@@ -41,7 +41,7 @@ Restart or reload Pi after installation.
|
|
|
41
41
|
## Quick start
|
|
42
42
|
|
|
43
43
|
1. Run `/advisor` to enable the flow and register `ask_advisor`.
|
|
44
|
-
2. Run `/advisor-models` to choose the Executor and Advisor models.
|
|
44
|
+
2. Run `/advisor-models` to choose the Executor and Advisor models. Current model and thinking-level selections appear first and ticked, so pressing Enter keeps them.
|
|
45
45
|
3. Run `/advisor-settings` to configure review gates, context, privacy, and limits.
|
|
46
46
|
|
|
47
47
|
Unknown fields in `advisor.json` are preserved for forward compatibility and reported as non-blocking warnings. Invalid recognized values remain errors, and Advisor commands show the configuration problem without crashing their handlers.
|
|
@@ -69,7 +69,7 @@ Successful calls return an opaque `adviceId`. If global outcome logging is enabl
|
|
|
69
69
|
| --- | --- |
|
|
70
70
|
| `/advisor` | Enable the flow and optionally override the Executor, Advisor, or context limit. |
|
|
71
71
|
| `/advisor-manual [focus]` | Start a parallel consultation without interrupting the current Executor turn. |
|
|
72
|
-
| `/advisor-models` | Choose both models and their reasoning effort. |
|
|
72
|
+
| `/advisor-models` | Choose both models and their reasoning effort; current models are preselected. |
|
|
73
73
|
| `/advisor-settings` | Configure behavior, context, gates, privacy, and output limits. |
|
|
74
74
|
| `/advisor-off` | Disable the flow and turn off persistent activation. |
|
|
75
75
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-advisor-flow",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"author": "Philip Brembeck",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"main": "extensions/index.ts",
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@biomejs/biome": "2.5.3",
|
|
12
|
-
"@earendil-works/pi-ai": "^0.
|
|
13
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
14
|
-
"@earendil-works/pi-tui": "^0.
|
|
12
|
+
"@earendil-works/pi-ai": "^0.84.1",
|
|
13
|
+
"@earendil-works/pi-coding-agent": "^0.84.1",
|
|
14
|
+
"@earendil-works/pi-tui": "^0.84.1",
|
|
15
15
|
"@types/node": "^20.11.0",
|
|
16
16
|
"bun-types": "^1.0.0",
|
|
17
17
|
"husky": "^9.1.7",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"ultracite": "7.9.4"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@earendil-works/pi-ai": "^0.
|
|
25
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
26
|
-
"@earendil-works/pi-tui": "^0.
|
|
24
|
+
"@earendil-works/pi-ai": "^0.84.1",
|
|
25
|
+
"@earendil-works/pi-coding-agent": "^0.84.1",
|
|
26
|
+
"@earendil-works/pi-tui": "^0.84.1",
|
|
27
27
|
"typebox": "^1.1.38"
|
|
28
28
|
},
|
|
29
29
|
"peerDependenciesMeta": {
|
package/src/commands.ts
CHANGED
|
@@ -66,8 +66,10 @@ import {
|
|
|
66
66
|
SearchableModelSelector,
|
|
67
67
|
} from "./ui.js";
|
|
68
68
|
|
|
69
|
+
const DEFAULT_EFFORT_LEVEL = "Default (Model Default)";
|
|
70
|
+
const SELECTED_PREFIX = "✓ ";
|
|
69
71
|
const EFFORT_LEVELS = [
|
|
70
|
-
|
|
72
|
+
DEFAULT_EFFORT_LEVEL,
|
|
71
73
|
"off",
|
|
72
74
|
"minimal",
|
|
73
75
|
"low",
|
|
@@ -77,6 +79,21 @@ const EFFORT_LEVELS = [
|
|
|
77
79
|
"max",
|
|
78
80
|
];
|
|
79
81
|
|
|
82
|
+
const effortChoices = (configured: string | undefined): string[] => {
|
|
83
|
+
const current = configured ?? DEFAULT_EFFORT_LEVEL;
|
|
84
|
+
return [
|
|
85
|
+
`${SELECTED_PREFIX}${current}`,
|
|
86
|
+
...EFFORT_LEVELS.filter((level) => level !== current),
|
|
87
|
+
];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const selectedEffort = (choice: string): string | undefined => {
|
|
91
|
+
const effort = choice.startsWith(SELECTED_PREFIX)
|
|
92
|
+
? choice.slice(SELECTED_PREFIX.length)
|
|
93
|
+
: choice;
|
|
94
|
+
return effort === DEFAULT_EFFORT_LEVEL ? undefined : effort;
|
|
95
|
+
};
|
|
96
|
+
|
|
80
97
|
const CONTEXT_PRESETS: ContextPreset[] = [
|
|
81
98
|
{
|
|
82
99
|
description:
|
|
@@ -446,6 +463,7 @@ export const registerCommands = (
|
|
|
446
463
|
(tui, theme, keybindings, done) =>
|
|
447
464
|
new SearchableModelSelector({
|
|
448
465
|
allOptions: refs,
|
|
466
|
+
currentOption: executorRef,
|
|
449
467
|
keybindings,
|
|
450
468
|
onCancel: () => done(undefined),
|
|
451
469
|
onSelect: done,
|
|
@@ -460,7 +478,7 @@ export const registerCommands = (
|
|
|
460
478
|
|
|
461
479
|
const executorEffort = await ctx.ui.select(
|
|
462
480
|
"Select Executor Reasoning/Thinking Level",
|
|
463
|
-
|
|
481
|
+
effortChoices(executorEffortRef)
|
|
464
482
|
);
|
|
465
483
|
if (!executorEffort) {
|
|
466
484
|
return;
|
|
@@ -470,6 +488,7 @@ export const registerCommands = (
|
|
|
470
488
|
(tui, theme, keybindings, done) =>
|
|
471
489
|
new SearchableModelSelector({
|
|
472
490
|
allOptions: refs,
|
|
491
|
+
currentOption: advisorRef,
|
|
473
492
|
keybindings,
|
|
474
493
|
onCancel: () => done(undefined),
|
|
475
494
|
onSelect: done,
|
|
@@ -484,7 +503,7 @@ export const registerCommands = (
|
|
|
484
503
|
|
|
485
504
|
const advisorEffort = await ctx.ui.select(
|
|
486
505
|
"Select Advisor Reasoning/Thinking Level",
|
|
487
|
-
|
|
506
|
+
effortChoices(advisorEffortRef)
|
|
488
507
|
);
|
|
489
508
|
if (!advisorEffort) {
|
|
490
509
|
return;
|
|
@@ -492,14 +511,8 @@ export const registerCommands = (
|
|
|
492
511
|
|
|
493
512
|
setExecutorRef(executor);
|
|
494
513
|
setAdvisorRef(advisor);
|
|
495
|
-
setExecutorEffortRef(
|
|
496
|
-
|
|
497
|
-
? undefined
|
|
498
|
-
: executorEffort
|
|
499
|
-
);
|
|
500
|
-
setAdvisorEffortRef(
|
|
501
|
-
advisorEffort === "Default (Model Default)" ? undefined : advisorEffort
|
|
502
|
-
);
|
|
514
|
+
setExecutorEffortRef(selectedEffort(executorEffort));
|
|
515
|
+
setAdvisorEffortRef(selectedEffort(advisorEffort));
|
|
503
516
|
|
|
504
517
|
const path = saveConfig(ctx);
|
|
505
518
|
ctx.ui.notify(
|
package/src/ui.ts
CHANGED
|
@@ -17,6 +17,7 @@ interface RenderRequester {
|
|
|
17
17
|
}
|
|
18
18
|
interface SearchableModelSelectorOptions {
|
|
19
19
|
allOptions: string[];
|
|
20
|
+
currentOption?: string;
|
|
20
21
|
keybindings: KeybindingsManager;
|
|
21
22
|
onCancel: () => void;
|
|
22
23
|
onSelect: (value: string) => void;
|
|
@@ -50,6 +51,7 @@ export class SearchableModelSelector implements Component, Focusable {
|
|
|
50
51
|
private readonly tui: RenderRequester;
|
|
51
52
|
private readonly searchInput: Input;
|
|
52
53
|
private readonly allOptions: string[];
|
|
54
|
+
private readonly currentOption: string | undefined;
|
|
53
55
|
private filteredOptions: string[];
|
|
54
56
|
private selectedIndex = 0;
|
|
55
57
|
private readonly title: string;
|
|
@@ -70,7 +72,13 @@ export class SearchableModelSelector implements Component, Focusable {
|
|
|
70
72
|
constructor(options: SearchableModelSelectorOptions) {
|
|
71
73
|
this.tui = options.tui;
|
|
72
74
|
this.title = options.title;
|
|
73
|
-
this.
|
|
75
|
+
this.currentOption = options.currentOption || undefined;
|
|
76
|
+
this.allOptions = this.currentOption
|
|
77
|
+
? [
|
|
78
|
+
this.currentOption,
|
|
79
|
+
...options.allOptions.filter((item) => item !== this.currentOption),
|
|
80
|
+
]
|
|
81
|
+
: options.allOptions;
|
|
74
82
|
this.theme = options.theme;
|
|
75
83
|
this.keybindings = options.keybindings;
|
|
76
84
|
this.onSelect = options.onSelect;
|
|
@@ -116,12 +124,13 @@ export class SearchableModelSelector implements Component, Focusable {
|
|
|
116
124
|
const endIndex = Math.min(startIndex + maxVisible, total);
|
|
117
125
|
for (let i = startIndex; i < endIndex; i += 1) {
|
|
118
126
|
const item = this.filteredOptions[i];
|
|
127
|
+
const tick = item === this.currentOption ? "✓ " : " ";
|
|
119
128
|
if (i === this.selectedIndex) {
|
|
120
129
|
lines.push(
|
|
121
|
-
` ${this.theme.fg("accent", "→ ")}${this.theme.fg("accent", item)}`
|
|
130
|
+
` ${this.theme.fg("accent", "→ ")}${this.theme.fg("accent", `${tick}${item}`)}`
|
|
122
131
|
);
|
|
123
132
|
} else {
|
|
124
|
-
lines.push(` ${this.theme.fg("text", item)}`);
|
|
133
|
+
lines.push(` ${this.theme.fg("text", `${tick}${item}`)}`);
|
|
125
134
|
}
|
|
126
135
|
}
|
|
127
136
|
if (total > maxVisible) {
|