pi-advisor-flow 0.14.2-dev.3 → 0.14.3-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.
- package/CHANGELOG.md +6 -0
- package/README.md +8 -8
- package/extensions/index.ts +1 -1
- package/package.json +17 -18
- package/scripts/check-bun-version.mjs +1 -1
- package/src/commands/manual-command.ts +8 -14
- package/src/commands/settings-persistence.ts +3 -3
- package/src/commands/types.ts +1 -5
- package/src/config/defaults.ts +3 -3
- package/src/config/schema.ts +2 -2
- package/src/config/types.ts +1 -3
- package/src/content-utils.ts +1 -6
- package/src/git.ts +1 -5
- package/src/jev/decisions-client.ts +1 -2
- package/src/jev/failure.ts +1 -5
- package/src/jev/transport.ts +1 -4
- package/src/outcome-stats.ts +1 -1
- package/src/outcomes.ts +1 -4
- package/src/scout-types.ts +1 -5
- package/src/session-state.ts +1 -3
- package/src/tools/consultation.ts +6 -9
- package/src/tools/register-ask-advisor.ts +1 -2
- package/src/ui/jev-filter-submenu.ts +1 -2
- package/src/ui/jev-provider-submenu.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,12 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
|
8
8
|
|
|
9
9
|
### Changed
|
|
10
10
|
|
|
11
|
+
- Updated the required Bun version to 1.4.4, Pi development dependencies to 1.4.0, and TypeBox to 1.4.3; replaced Oxfmt with Bun's native formatter and kept lint-staged for safe staged-file handling.
|
|
12
|
+
|
|
13
|
+
## 0.14.2 - 2026-10-21
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
11
17
|
- Updated Oxfmt to 0.74.0, Oxlint and plugins to 1.89.0, and Knip to 6.42.1; adjusted tests for the updated Oxlint rules.
|
|
12
18
|
|
|
13
19
|
### Fixed
|
package/README.md
CHANGED
|
@@ -140,14 +140,14 @@ Successful calls return an opaque `adviceId`. If global outcome logging is enabl
|
|
|
140
140
|
|
|
141
141
|
## Commands
|
|
142
142
|
|
|
143
|
-
| Command
|
|
144
|
-
|
|
|
145
|
-
| `/advisor`
|
|
146
|
-
| `/advisor-manual [focus]` | Ask for an immediate second opinion.
|
|
147
|
-
| `/advisor-models`
|
|
148
|
-
| `/advisor-settings`
|
|
149
|
-
| `/advisor-stats`
|
|
150
|
-
| `/advisor-off`
|
|
143
|
+
| Command | What it does |
|
|
144
|
+
| ------------------------- | -------------------------------------------------------------------------------------- |
|
|
145
|
+
| `/advisor` | Enable the flow; choose available models when needed. |
|
|
146
|
+
| `/advisor-manual [focus]` | Ask for an immediate second opinion. |
|
|
147
|
+
| `/advisor-models` | Choose the Executor, Advisor, and optional fallback models. |
|
|
148
|
+
| `/advisor-settings` | Configure behavior, models, context, privacy, and limits. |
|
|
149
|
+
| `/advisor-stats` | Show retained outcome adoption and validation stats. |
|
|
150
|
+
| `/advisor-off` | Disable model-facing Advisor tools across sessions and turn off persistent activation. |
|
|
151
151
|
|
|
152
152
|
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.
|
|
153
153
|
|
package/extensions/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
|
2
2
|
|
|
3
3
|
import { registerCommands } from "../src/commands/registration.ts";
|
|
4
4
|
import { getAdvisorSettings } from "../src/config/state.ts";
|
|
5
|
-
import {
|
|
5
|
+
import { herdrAdvisorActivity, HerdrAdvisorBlock } from "../src/herdr.ts";
|
|
6
6
|
import { AdvisorSessionState } from "../src/session-state.ts";
|
|
7
7
|
import {
|
|
8
8
|
consultAdvisor as consultAdvisorImplementation,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-advisor-flow",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.3-dev.1",
|
|
4
4
|
"description": "Advanced Executor/Advisor flow for Pi, fully configurable and extendable.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"advisor",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"bench:screen": "bun bench/src/cli.ts screen",
|
|
39
39
|
"build": "bun build ./extensions/index.ts --outfile dist/index.js --target node --format esm --external @earendil-works/pi-ai --external @earendil-works/pi-coding-agent --external @earendil-works/pi-tui --external typebox",
|
|
40
40
|
"check:boundaries": "node scripts/check-module-boundaries.mjs",
|
|
41
|
-
"format": "
|
|
41
|
+
"format": "bun fmt --no-script --print-width 80 --trailing-comma es5 --sort-imports --bracket-same-line --ignore-pattern 'bench/tasks/**/traps.toml' --ignore-pattern 'dist/**'",
|
|
42
42
|
"knip": "knip",
|
|
43
43
|
"lint": "oxlint",
|
|
44
44
|
"lint:fix": "oxlint --fix",
|
|
@@ -51,22 +51,21 @@
|
|
|
51
51
|
"test:bench": "bun --config=./bunfig.bench.toml test ./bench/test/",
|
|
52
52
|
"test:node-loader": "node --test test/default-resource-loader.node.mjs",
|
|
53
53
|
"typecheck": "bun check",
|
|
54
|
-
"format:check": "
|
|
54
|
+
"format:check": "bun fmt --no-script --print-width 80 --trailing-comma es5 --sort-imports --bracket-same-line --ignore-pattern 'bench/tasks/**/traps.toml' --ignore-pattern 'dist/**' --check"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@earendil-works/pi-ai": "1.
|
|
58
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
59
|
-
"@earendil-works/pi-tui": "1.
|
|
57
|
+
"@earendil-works/pi-ai": "1.4.0",
|
|
58
|
+
"@earendil-works/pi-coding-agent": "1.4.0",
|
|
59
|
+
"@earendil-works/pi-tui": "1.4.0",
|
|
60
60
|
"@oxlint/plugins": "1.89.0",
|
|
61
61
|
"@types/node": "^26.6.5",
|
|
62
62
|
"@typesafe-ai/sdk": "^0.7.0",
|
|
63
|
-
"bun-types": "1.4.
|
|
63
|
+
"bun-types": "1.4.4",
|
|
64
64
|
"husky": "^9.1.7",
|
|
65
65
|
"knip": "6.42.1",
|
|
66
66
|
"lint-staged": "^17.6.0",
|
|
67
|
-
"oxfmt": "0.74.0",
|
|
68
67
|
"oxlint": "1.89.0",
|
|
69
|
-
"typebox": "
|
|
68
|
+
"typebox": "1.4.3",
|
|
70
69
|
"typescript": "^7.0.2",
|
|
71
70
|
"ultracite": "8.0.1"
|
|
72
71
|
},
|
|
@@ -101,20 +100,20 @@
|
|
|
101
100
|
"safe-buffer": "npm:@socketregistry/safe-buffer@1.0.9",
|
|
102
101
|
"undici": "8.11.2"
|
|
103
102
|
},
|
|
103
|
+
"packageManager": "bun@1.4.4",
|
|
104
|
+
"pi": {
|
|
105
|
+
"extensions": [
|
|
106
|
+
"./dist/index.js"
|
|
107
|
+
],
|
|
108
|
+
"image": "https://raw.githubusercontent.com/philipbrembeck/pi-advisor/refs/heads/main/assets/hero.png"
|
|
109
|
+
},
|
|
104
110
|
"lint-staged": {
|
|
105
111
|
"*.{ts,tsx}": [
|
|
106
|
-
"
|
|
112
|
+
"bun fmt --no-script --print-width 80 --trailing-comma es5 --sort-imports --bracket-same-line --ignore-pattern 'bench/tasks/**/traps.toml' --ignore-pattern 'dist/**'",
|
|
107
113
|
"oxlint --fix --no-error-on-unmatched-pattern"
|
|
108
114
|
],
|
|
109
115
|
"*.{json,jsonc}": [
|
|
110
|
-
"
|
|
116
|
+
"bun fmt --no-script --print-width 80 --trailing-comma es5 --ignore-pattern 'bench/tasks/**/traps.toml' --ignore-pattern 'dist/**'"
|
|
111
117
|
]
|
|
112
|
-
},
|
|
113
|
-
"packageManager": "bun@1.4.3",
|
|
114
|
-
"pi": {
|
|
115
|
-
"extensions": [
|
|
116
|
-
"./dist/index.js"
|
|
117
|
-
],
|
|
118
|
-
"image": "https://raw.githubusercontent.com/philipbrembeck/pi-advisor/refs/heads/main/assets/hero.png"
|
|
119
118
|
}
|
|
120
119
|
}
|
|
@@ -66,7 +66,7 @@ if (
|
|
|
66
66
|
!isAtLeast(currentVersion, minimumVersion)
|
|
67
67
|
) {
|
|
68
68
|
console.error(
|
|
69
|
-
`This repository requires Bun ${minimumVersion ?? "1.4.
|
|
69
|
+
`This repository requires Bun ${minimumVersion ?? "1.4.4"} or newer; found ${currentVersion ?? "a non-Bun package manager"}.`
|
|
70
70
|
);
|
|
71
71
|
process.exitCode = 1;
|
|
72
72
|
} else {
|
|
@@ -40,12 +40,10 @@ export const registerManualCommand = (runtime: CommandRuntime) => {
|
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
)
|
|
48
|
-
) {
|
|
43
|
+
if (!(
|
|
44
|
+
isSimpleMode() ||
|
|
45
|
+
runtime.advisorSessionState.canConsult(getAdvisorMaxCallsPerSession())
|
|
46
|
+
)) {
|
|
49
47
|
runtime.reportManualBudgetExhausted(ctx);
|
|
50
48
|
|
|
51
49
|
return;
|
|
@@ -82,14 +80,10 @@ export const registerManualCommand = (runtime: CommandRuntime) => {
|
|
|
82
80
|
return;
|
|
83
81
|
}
|
|
84
82
|
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
getAdvisorMaxCallsPerSession()
|
|
90
|
-
)
|
|
91
|
-
)
|
|
92
|
-
) {
|
|
83
|
+
if (!(
|
|
84
|
+
isSimpleMode() ||
|
|
85
|
+
runtime.advisorSessionState.canConsult(getAdvisorMaxCallsPerSession())
|
|
86
|
+
)) {
|
|
93
87
|
runtime.reportManualBudgetExhausted(ctx);
|
|
94
88
|
|
|
95
89
|
return;
|
|
@@ -11,14 +11,14 @@ import {
|
|
|
11
11
|
setAdvisorCustomInvocationRef,
|
|
12
12
|
setAdvisorDisableSameModelRef,
|
|
13
13
|
setAdvisorEffortRef,
|
|
14
|
-
setAdvisorFallbackModelRef,
|
|
15
14
|
setAdvisorFailureGateRef,
|
|
16
15
|
setAdvisorFailureModeRef,
|
|
16
|
+
setAdvisorFallbackModelRef,
|
|
17
17
|
setAdvisorGitContextMaxCharsRef,
|
|
18
18
|
setAdvisorGitContextRef,
|
|
19
19
|
setAdvisorHerdrIntegrationRef,
|
|
20
|
-
setAdvisorJevDigestMaxCharsRef,
|
|
21
20
|
setAdvisorJevClassifierRef,
|
|
21
|
+
setAdvisorJevDigestMaxCharsRef,
|
|
22
22
|
setAdvisorJevFilterEnabledRef,
|
|
23
23
|
setAdvisorJevFilterNoulMarginRef,
|
|
24
24
|
setAdvisorJevFilterOverrideWindowRef,
|
|
@@ -38,9 +38,9 @@ import {
|
|
|
38
38
|
setAdvisorToolPoliciesRef,
|
|
39
39
|
setAdvisorToolResultMaxBytesRef,
|
|
40
40
|
setAdvisorToolResultMaxLinesRef,
|
|
41
|
+
setAdvisorToolsEnabledRef,
|
|
41
42
|
setAdvisorTrackedFileContentRef,
|
|
42
43
|
setAdvisorUntrackedContentRef,
|
|
43
|
-
setAdvisorToolsEnabledRef,
|
|
44
44
|
setAlwaysOnRef,
|
|
45
45
|
setContextMaxCharsRef,
|
|
46
46
|
setShowUsageDetailsRef,
|
package/src/commands/types.ts
CHANGED
|
@@ -32,11 +32,7 @@ export type ManualConsult = (
|
|
|
32
32
|
export type ThinkingLevel = Parameters<ExtensionAPI["setThinkingLevel"]>[0];
|
|
33
33
|
|
|
34
34
|
export type ManualAdvisorProgressPhase =
|
|
35
|
-
| "
|
|
36
|
-
| "active"
|
|
37
|
-
| "complete"
|
|
38
|
-
| "cancelled"
|
|
39
|
-
| "error";
|
|
35
|
+
"preparing" | "active" | "complete" | "cancelled" | "error";
|
|
40
36
|
|
|
41
37
|
export interface ManualAdvisorProgressState {
|
|
42
38
|
phase: ManualAdvisorProgressPhase;
|
package/src/config/defaults.ts
CHANGED
|
@@ -9,12 +9,13 @@ import {
|
|
|
9
9
|
setAdvisorEffortRef,
|
|
10
10
|
setAdvisorFailureGateRef,
|
|
11
11
|
setAdvisorFailureModeRef,
|
|
12
|
+
setAdvisorFallbackModelRef,
|
|
12
13
|
setAdvisorGitContextMaxCharsRef,
|
|
13
14
|
setAdvisorGitContextRef,
|
|
14
15
|
setAdvisorHerdrIntegrationRef,
|
|
15
|
-
setAdvisorJevDigestMaxCharsRef,
|
|
16
16
|
setAdvisorJevBaseUrlRef,
|
|
17
17
|
setAdvisorJevClassifierRef,
|
|
18
|
+
setAdvisorJevDigestMaxCharsRef,
|
|
18
19
|
setAdvisorJevFilterEnabledRef,
|
|
19
20
|
setAdvisorJevFilterNoulMarginRef,
|
|
20
21
|
setAdvisorJevFilterOverrideWindowRef,
|
|
@@ -33,13 +34,13 @@ import {
|
|
|
33
34
|
setAdvisorPlanGateRef,
|
|
34
35
|
setAdvisorRedactSecretsRef,
|
|
35
36
|
setAdvisorRef,
|
|
36
|
-
setAdvisorFallbackModelRef,
|
|
37
37
|
setAdvisorScoutEnabledRef,
|
|
38
38
|
setAdvisorScoutTimeoutMsRef,
|
|
39
39
|
setAdvisorSessionSummaryRef,
|
|
40
40
|
setAdvisorToolPoliciesRef,
|
|
41
41
|
setAdvisorToolResultMaxBytesRef,
|
|
42
42
|
setAdvisorToolResultMaxLinesRef,
|
|
43
|
+
setAdvisorToolsEnabledRef,
|
|
43
44
|
setAdvisorTrackedFileContentRef,
|
|
44
45
|
setAdvisorUntrackedContentRef,
|
|
45
46
|
setAlwaysOnRef,
|
|
@@ -50,7 +51,6 @@ import {
|
|
|
50
51
|
setShowUsageDetailsRef,
|
|
51
52
|
setShowUsageFooterRef,
|
|
52
53
|
setSimpleModeRef,
|
|
53
|
-
setAdvisorToolsEnabledRef,
|
|
54
54
|
} from "./state.ts";
|
|
55
55
|
import type { AdvisorConfig } from "./types.ts";
|
|
56
56
|
import {
|
package/src/config/schema.ts
CHANGED
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
advisorCustomInvocationRef,
|
|
12
12
|
advisorDisableSameModelRef,
|
|
13
13
|
advisorEffortRef,
|
|
14
|
-
advisorFallbackModelRef,
|
|
15
14
|
advisorFailureGateRef,
|
|
16
15
|
advisorFailureModeRef,
|
|
16
|
+
advisorFallbackModelRef,
|
|
17
17
|
advisorGitContextMaxCharsRef,
|
|
18
18
|
advisorGitContextRef,
|
|
19
19
|
advisorHerdrIntegrationRef,
|
|
@@ -44,8 +44,8 @@ import {
|
|
|
44
44
|
advisorToolPoliciesRef,
|
|
45
45
|
advisorToolResultMaxBytesRef,
|
|
46
46
|
advisorToolResultMaxLinesRef,
|
|
47
|
-
advisorTrackedFileContentRef,
|
|
48
47
|
advisorToolsEnabledRef,
|
|
48
|
+
advisorTrackedFileContentRef,
|
|
49
49
|
advisorUntrackedContentRef,
|
|
50
50
|
alwaysOnRef,
|
|
51
51
|
contextMaxCharsRef,
|
package/src/config/types.ts
CHANGED
|
@@ -60,9 +60,7 @@ export const ADVISOR_TOOL_POLICIES: AdvisorToolPolicy[] = [
|
|
|
60
60
|
];
|
|
61
61
|
|
|
62
62
|
export type GateFailureMode =
|
|
63
|
-
| "block-
|
|
64
|
-
| "block-tool"
|
|
65
|
-
| "warn-and-continue";
|
|
63
|
+
"block-session" | "block-tool" | "warn-and-continue";
|
|
66
64
|
|
|
67
65
|
export const GATE_FAILURE_MODES: GateFailureMode[] = [
|
|
68
66
|
"block-session",
|
package/src/content-utils.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
/** Shared untyped-content inspection helpers. */
|
|
2
2
|
|
|
3
3
|
export type JsonValue =
|
|
4
|
-
|
|
|
5
|
-
| boolean
|
|
6
|
-
| number
|
|
7
|
-
| string
|
|
8
|
-
| JsonValue[]
|
|
9
|
-
| { [key: string]: JsonValue };
|
|
4
|
+
null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
|
|
10
5
|
|
|
11
6
|
export type RecordValue = Record<string, JsonValue>;
|
|
12
7
|
|
package/src/git.ts
CHANGED
|
@@ -28,11 +28,7 @@ export const clampGitContextLevel = (
|
|
|
28
28
|
LEVEL_RANK[requested] <= LEVEL_RANK[allowed] ? requested : allowed;
|
|
29
29
|
|
|
30
30
|
type GitContextStatus =
|
|
31
|
-
| "
|
|
32
|
-
| "no-changes"
|
|
33
|
-
| "collected"
|
|
34
|
-
| "not-a-repository"
|
|
35
|
-
| "failed";
|
|
31
|
+
"disabled" | "no-changes" | "collected" | "not-a-repository" | "failed";
|
|
36
32
|
|
|
37
33
|
export interface GitContextResult {
|
|
38
34
|
/** Why collection produced nothing, for diagnostics. Never sent verbatim. */
|
|
@@ -25,8 +25,7 @@ export interface DecisionsScoreQuestion {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export type DecisionsQuestion =
|
|
28
|
-
|
|
|
29
|
-
| DecisionsScoreQuestion;
|
|
28
|
+
DecisionsPredicateQuestion | DecisionsScoreQuestion;
|
|
30
29
|
|
|
31
30
|
export interface DecisionsRequest {
|
|
32
31
|
input: string;
|
package/src/jev/failure.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
export type JevErrorCategory =
|
|
2
|
-
| "
|
|
3
|
-
| "timeout"
|
|
4
|
-
| "network"
|
|
5
|
-
| "malformed"
|
|
6
|
-
| "error";
|
|
2
|
+
"auth" | "timeout" | "network" | "malformed" | "error";
|
|
7
3
|
|
|
8
4
|
/** A classified, redacted Jev failure; never carries key material. */
|
|
9
5
|
export class JevFailureError extends Error {
|
package/src/jev/transport.ts
CHANGED
|
@@ -14,10 +14,7 @@ import { resolveOpenAIDecisionsKey } from "./openai-key-store.ts";
|
|
|
14
14
|
import type { OpenAIDecisionsKeyResolution } from "./openai-key-store.ts";
|
|
15
15
|
|
|
16
16
|
export type JevTransportKind =
|
|
17
|
-
| "typesafe"
|
|
18
|
-
| "openrouter"
|
|
19
|
-
| "openai-decisions"
|
|
20
|
-
| "typesafe-compatible";
|
|
17
|
+
"typesafe" | "openrouter" | "openai-decisions" | "typesafe-compatible";
|
|
21
18
|
|
|
22
19
|
type JevCredentialSource =
|
|
23
20
|
| JevKeySource
|
package/src/outcome-stats.ts
CHANGED
package/src/outcomes.ts
CHANGED
|
@@ -20,10 +20,7 @@ export type OutcomeAdoption = "followed" | "not-followed" | "unknown";
|
|
|
20
20
|
export type OutcomeValidation = "passed" | "failed" | "not-run" | "unknown";
|
|
21
21
|
|
|
22
22
|
export type OutcomeTrigger =
|
|
23
|
-
| "
|
|
24
|
-
| "executor-requested"
|
|
25
|
-
| "turn-gate"
|
|
26
|
-
| "repeated-tool-call";
|
|
23
|
+
"manual" | "executor-requested" | "turn-gate" | "repeated-tool-call";
|
|
27
24
|
|
|
28
25
|
export const ADOPTIONS: OutcomeAdoption[] = [
|
|
29
26
|
"followed",
|
package/src/scout-types.ts
CHANGED
|
@@ -10,11 +10,7 @@ export const SCOUT_SELECTION_MAX_IDS = 32;
|
|
|
10
10
|
export const SCOUT_SYNTHESIS_MAX_BYTES = 4 * 1024;
|
|
11
11
|
|
|
12
12
|
export type ScoutGroupKind =
|
|
13
|
-
| "
|
|
14
|
-
| "user"
|
|
15
|
-
| "assistant"
|
|
16
|
-
| "tool-exchange"
|
|
17
|
-
| "pending-invocation";
|
|
13
|
+
"compaction" | "user" | "assistant" | "tool-exchange" | "pending-invocation";
|
|
18
14
|
|
|
19
15
|
export interface ScoutContextGroup {
|
|
20
16
|
bytes: number;
|
package/src/session-state.ts
CHANGED
|
@@ -20,9 +20,7 @@ export type GateDecision = "proceed" | "revise" | "blocked";
|
|
|
20
20
|
export type ConsultationTrigger = "manual" | "executor-requested" | "turn-gate";
|
|
21
21
|
|
|
22
22
|
export type GateTrigger =
|
|
23
|
-
|
|
24
|
-
| "completion-review"
|
|
25
|
-
| "custom-rule";
|
|
23
|
+
"repeated-tool-call" | "completion-review" | "custom-rule";
|
|
26
24
|
|
|
27
25
|
type AdvisorTrigger = ConsultationTrigger | GateTrigger;
|
|
28
26
|
|
|
@@ -100,13 +100,11 @@ const advisorProjectRules = (rules: ConsultationContext["projectRules"]) =>
|
|
|
100
100
|
: undefined;
|
|
101
101
|
|
|
102
102
|
const advisorImageNotice = (context: ConsultationContext) => {
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
)
|
|
109
|
-
) {
|
|
103
|
+
if (!(
|
|
104
|
+
context.imageOmissions ||
|
|
105
|
+
context.images.length ||
|
|
106
|
+
/\[Image[ :]/u.test(context.conversation)
|
|
107
|
+
)) {
|
|
110
108
|
return "";
|
|
111
109
|
}
|
|
112
110
|
|
|
@@ -434,8 +432,7 @@ const collectAdvisorResponse = async (
|
|
|
434
432
|
let prepared: PreparedAdvisorRequest | undefined;
|
|
435
433
|
|
|
436
434
|
let resolvedPrimary:
|
|
437
|
-
|
|
438
|
-
| undefined;
|
|
435
|
+
Awaited<ReturnType<typeof resolveConfiguredModel>> | undefined;
|
|
439
436
|
|
|
440
437
|
try {
|
|
441
438
|
resolvedPrimary = await resolveConfiguredModel(
|
|
@@ -154,8 +154,7 @@ export const registerAskAdvisorTool = ({
|
|
|
154
154
|
"Consult the on-demand Advisor model for strategic guidance. Call with an empty object for a contextual review; attach an optional draft for concrete plan or completion review. Use followUpTo with a new question to continue one cached consultation without rebuilding its redacted context. If the Advisor explicitly names a missing file, you may make a sequential fresh consultation with includeTrackedFiles when enabled and relevant. In Pi Codemode, gather and filter deterministic tool results first, then call tools.ask_advisor. Nested results are not automatically reconstructed: pass only permitted, concise summaries in draft (untrusted, capped at 8 KiB, not independently verified). Draft does not inherit source-tool disclosure policies; use gitContext for patches within the user's allowance.",
|
|
155
155
|
async execute(_id, params, signal, onUpdate, ctx) {
|
|
156
156
|
let followUp:
|
|
157
|
-
|
|
158
|
-
| undefined;
|
|
157
|
+
{ adviceId: string; payload: AdvisorFollowUpPayload } | undefined;
|
|
159
158
|
|
|
160
159
|
try {
|
|
161
160
|
loadConfig(ctx);
|
|
@@ -46,8 +46,7 @@ export class JevFilterSubmenu implements Component, Focusable {
|
|
|
46
46
|
private classifierAvailable = false;
|
|
47
47
|
private readonly modelRegistry: JevClassifierRegistryAccess | undefined;
|
|
48
48
|
private readonly resolveClassifierKey:
|
|
49
|
-
|
|
50
|
-
| undefined;
|
|
49
|
+
(() => Promise<JevClassifierKeySnapshot>) | undefined;
|
|
51
50
|
private _focused = true;
|
|
52
51
|
|
|
53
52
|
constructor(options: JevFilterSubmenuOptions) {
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
keyEntryPrompt,
|
|
16
16
|
} from "./jev-setup-support.ts";
|
|
17
17
|
import type {
|
|
18
|
+
JevProviderAction,
|
|
18
19
|
JevProviderMode,
|
|
19
20
|
JevProviderSubmenuOptions,
|
|
20
21
|
JevProviderViewState,
|
|
21
|
-
JevProviderAction,
|
|
22
22
|
} from "./jev-setup-support.ts";
|
|
23
23
|
import { MaskedInput } from "./masked-input.ts";
|
|
24
24
|
import type { JevProviderSelection, JevSetupDeps } from "./types.ts";
|