@juicesharp/rpiv-advisor 2.13.7 → 2.13.9
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/advisor/command.ts +6 -6
- package/advisor/config.ts +1 -1
- package/advisor/context.ts +1 -1
- package/advisor/execute.ts +6 -6
- package/advisor/handlers.ts +3 -3
- package/advisor/index.ts +11 -11
- package/advisor/policy.ts +2 -2
- package/advisor/register.ts +3 -3
- package/advisor/restore.ts +5 -5
- package/advisor/state.ts +1 -1
- package/advisor-ui.ts +1 -1
- package/index.ts +1 -1
- package/package.json +2 -2
package/advisor/command.ts
CHANGED
|
@@ -11,9 +11,9 @@ import { getSupportedThinkingLevels } from "@earendil-works/pi-ai";
|
|
|
11
11
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
12
12
|
import type { SelectItem } from "@earendil-works/pi-tui";
|
|
13
13
|
import { modelKey } from "@juicesharp/rpiv-config";
|
|
14
|
-
import { showAdvisorPicker, showEffortPicker } from "../advisor-ui.
|
|
15
|
-
import { saveAdvisorConfig } from "./config.
|
|
16
|
-
import { reconcileAdvisorTool } from "./handlers.
|
|
14
|
+
import { showAdvisorPicker, showEffortPicker } from "../advisor-ui.ts";
|
|
15
|
+
import { saveAdvisorConfig } from "./config.ts";
|
|
16
|
+
import { reconcileAdvisorTool } from "./handlers.ts";
|
|
17
17
|
import {
|
|
18
18
|
ADVISOR_TOOL_NAME,
|
|
19
19
|
CHECKMARK,
|
|
@@ -30,9 +30,9 @@ import {
|
|
|
30
30
|
NO_ADVISOR_VALUE,
|
|
31
31
|
OFF_VALUE,
|
|
32
32
|
RECOMMENDED_EFFORT_SUFFIX,
|
|
33
|
-
} from "./messages.
|
|
34
|
-
import { isExecutorBlocked } from "./policy.
|
|
35
|
-
import { getAdvisorEffort, getAdvisorModel, setAdvisorEffort, setAdvisorModel } from "./state.
|
|
33
|
+
} from "./messages.ts";
|
|
34
|
+
import { isExecutorBlocked } from "./policy.ts";
|
|
35
|
+
import { getAdvisorEffort, getAdvisorModel, setAdvisorEffort, setAdvisorModel } from "./state.ts";
|
|
36
36
|
|
|
37
37
|
// Mirror: packages/rpiv-pi/extensions/rpiv-core/rpiv-models/items.ts
|
|
38
38
|
// buildModelItems — structural twin kept in a separate package by the
|
package/advisor/config.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import type { GuidanceFields } from "@juicesharp/rpiv-config";
|
|
9
9
|
import { configPath, loadJsonConfigWithLegacyFallback, saveJsonConfig } from "@juicesharp/rpiv-config";
|
|
10
|
-
import { EFFORT_ORDINAL, type GradedEffort } from "./messages.
|
|
10
|
+
import { EFFORT_ORDINAL, type GradedEffort } from "./messages.ts";
|
|
11
11
|
|
|
12
12
|
const ADVISOR_CONFIG_PATH = configPath("rpiv-advisor", "advisor.json");
|
|
13
13
|
|
package/advisor/context.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { Message } from "@earendil-works/pi-ai";
|
|
10
|
-
import { ADVISOR_TOOL_NAME, MSG_ADVISOR_NUDGE } from "./messages.
|
|
10
|
+
import { ADVISOR_TOOL_NAME, MSG_ADVISOR_NUDGE } from "./messages.ts";
|
|
11
11
|
|
|
12
12
|
// Strip the executor's in-flight advisor() toolCall from the tail assistant
|
|
13
13
|
// message. That call is what invoked *us* — there is no matching toolResult
|
package/advisor/execute.ts
CHANGED
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
type ExtensionAPI,
|
|
16
16
|
type ExtensionContext,
|
|
17
17
|
} from "@earendil-works/pi-coding-agent";
|
|
18
|
-
import { ensureUserTailForAdvisor, stripInflightAdvisorCall, stripToolDeclarations } from "./context.
|
|
19
|
-
import { getInventoryMessage } from "./inventory.
|
|
18
|
+
import { ensureUserTailForAdvisor, stripInflightAdvisorCall, stripToolDeclarations } from "./context.ts";
|
|
19
|
+
import { getInventoryMessage } from "./inventory.ts";
|
|
20
20
|
import {
|
|
21
21
|
ERR_ABORTED_DETAIL,
|
|
22
22
|
ERR_CALL_ABORTED,
|
|
@@ -30,10 +30,10 @@ import {
|
|
|
30
30
|
errNoApiKey,
|
|
31
31
|
errNoApiKeyDetail,
|
|
32
32
|
msgConsulting,
|
|
33
|
-
} from "./messages.
|
|
34
|
-
import { getRuntimeCompleteSimple, loadCompleteSimple } from "./pi-compat.
|
|
35
|
-
import { ADVISOR_SYSTEM_PROMPT } from "./prompt.
|
|
36
|
-
import { getAdvisorEffort, getAdvisorModel } from "./state.
|
|
33
|
+
} from "./messages.ts";
|
|
34
|
+
import { getRuntimeCompleteSimple, loadCompleteSimple } from "./pi-compat.ts";
|
|
35
|
+
import { ADVISOR_SYSTEM_PROMPT } from "./prompt.ts";
|
|
36
|
+
import { getAdvisorEffort, getAdvisorModel } from "./state.ts";
|
|
37
37
|
|
|
38
38
|
interface AdvisorDetails {
|
|
39
39
|
advisorModel?: string;
|
package/advisor/handlers.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
9
9
|
import { modelKey } from "@juicesharp/rpiv-config";
|
|
10
|
-
import { ADVISOR_TOOL_NAME, MSG_ADVISOR_DISABLED, msgAdvisorRestored } from "./messages.
|
|
11
|
-
import { isExecutorBlocked, isModelBlocked } from "./policy.
|
|
12
|
-
import { getAdvisorEffort, getAdvisorModel } from "./state.
|
|
10
|
+
import { ADVISOR_TOOL_NAME, MSG_ADVISOR_DISABLED, msgAdvisorRestored } from "./messages.ts";
|
|
11
|
+
import { isExecutorBlocked, isModelBlocked } from "./policy.ts";
|
|
12
|
+
import { getAdvisorEffort, getAdvisorModel } from "./state.ts";
|
|
13
13
|
|
|
14
14
|
interface ReconcileNotify {
|
|
15
15
|
/** Shown when the tool is stripped (executor became blocked). */
|
package/advisor/index.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* The implementation is one concern per file under this directory; this barrel
|
|
8
8
|
* re-exports the package's public surface (consumed by ../index.ts, the repo-
|
|
9
|
-
* root test/setup.ts, and the advisor.*.test.ts suite via "./advisor/index.
|
|
9
|
+
* root test/setup.ts, and the advisor.*.test.ts suite via "./advisor/index.ts").
|
|
10
10
|
*
|
|
11
11
|
* Module map:
|
|
12
12
|
* messages — tool identity, sentinels, effort vocabulary, all strings
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
* command — /advisor slash command
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
export { registerAdvisorCommand } from "./command.
|
|
27
|
-
export { loadAdvisorConfig, saveAdvisorConfig } from "./config.
|
|
28
|
-
export { ensureUserTailForAdvisor, stripInflightAdvisorCall, stripToolDeclarations } from "./context.
|
|
26
|
+
export { registerAdvisorCommand } from "./command.ts";
|
|
27
|
+
export { loadAdvisorConfig, saveAdvisorConfig } from "./config.ts";
|
|
28
|
+
export { ensureUserTailForAdvisor, stripInflightAdvisorCall, stripToolDeclarations } from "./context.ts";
|
|
29
29
|
export {
|
|
30
30
|
registerAdvisorBeforeAgentStart,
|
|
31
31
|
registerModelSelectHandler,
|
|
32
32
|
registerThinkingLevelSelectHandler,
|
|
33
|
-
} from "./handlers.
|
|
34
|
-
export { getInventoryMessage, stableStringify } from "./inventory.
|
|
35
|
-
export { ADVISOR_TOOL_NAME } from "./messages.
|
|
36
|
-
export { setDisabledForModels } from "./policy.
|
|
37
|
-
export { DEFAULT_PROMPT_GUIDELINES, DEFAULT_PROMPT_SNIPPET, registerAdvisorTool } from "./register.
|
|
38
|
-
export { __resetAdvisorAnnounced, registerAdvisorSessionStart, restoreAdvisorState } from "./restore.
|
|
39
|
-
export { getAdvisorEffort, getAdvisorModel, setAdvisorEffort, setAdvisorModel } from "./state.
|
|
33
|
+
} from "./handlers.ts";
|
|
34
|
+
export { getInventoryMessage, stableStringify } from "./inventory.ts";
|
|
35
|
+
export { ADVISOR_TOOL_NAME } from "./messages.ts";
|
|
36
|
+
export { setDisabledForModels } from "./policy.ts";
|
|
37
|
+
export { DEFAULT_PROMPT_GUIDELINES, DEFAULT_PROMPT_SNIPPET, registerAdvisorTool } from "./register.ts";
|
|
38
|
+
export { __resetAdvisorAnnounced, registerAdvisorSessionStart, restoreAdvisorState } from "./restore.ts";
|
|
39
|
+
export { getAdvisorEffort, getAdvisorModel, setAdvisorEffort, setAdvisorModel } from "./state.ts";
|
package/advisor/policy.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
import type { Api, Model } from "@earendil-works/pi-ai";
|
|
7
7
|
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
8
8
|
import { modelKey, parseModelKey } from "@juicesharp/rpiv-config";
|
|
9
|
-
import type { DisabledForModelsEntry } from "./config.
|
|
10
|
-
import { EFFORT_ORDINAL, type GradedEffort } from "./messages.
|
|
9
|
+
import type { DisabledForModelsEntry } from "./config.ts";
|
|
10
|
+
import { EFFORT_ORDINAL, type GradedEffort } from "./messages.ts";
|
|
11
11
|
|
|
12
12
|
let disabledForModelsCache: DisabledForModelsEntry[] = [];
|
|
13
13
|
|
package/advisor/register.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
8
8
|
import { validateGuidanceFields } from "@juicesharp/rpiv-config";
|
|
9
9
|
import { Type } from "typebox";
|
|
10
|
-
import { loadAdvisorConfig } from "./config.
|
|
11
|
-
import { executeAdvisor } from "./execute.
|
|
12
|
-
import { ADVISOR_TOOL_NAME, TOOL_LABEL } from "./messages.
|
|
10
|
+
import { loadAdvisorConfig } from "./config.ts";
|
|
11
|
+
import { executeAdvisor } from "./execute.ts";
|
|
12
|
+
import { ADVISOR_TOOL_NAME, TOOL_LABEL } from "./messages.ts";
|
|
13
13
|
|
|
14
14
|
const AdvisorParams = Type.Object({});
|
|
15
15
|
|
package/advisor/restore.ts
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
|
|
7
7
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
8
8
|
import { modelKey, parseModelKey } from "@juicesharp/rpiv-config";
|
|
9
|
-
import { loadAdvisorConfig, validateDisabledForModels } from "./config.
|
|
10
|
-
import { reconcileAdvisorTool } from "./handlers.
|
|
9
|
+
import { loadAdvisorConfig, validateDisabledForModels } from "./config.ts";
|
|
10
|
+
import { reconcileAdvisorTool } from "./handlers.ts";
|
|
11
11
|
import {
|
|
12
12
|
ADVISOR_TOOL_NAME,
|
|
13
13
|
EFFORT_ORDINAL,
|
|
14
14
|
errModelUnavailable,
|
|
15
15
|
msgAdvisorRestored,
|
|
16
16
|
msgAdvisorRestoredInactive,
|
|
17
|
-
} from "./messages.
|
|
18
|
-
import { isExecutorBlocked, setDisabledForModels } from "./policy.
|
|
19
|
-
import { setAdvisorEffort, setAdvisorModel } from "./state.
|
|
17
|
+
} from "./messages.ts";
|
|
18
|
+
import { isExecutorBlocked, setDisabledForModels } from "./policy.ts";
|
|
19
|
+
import { setAdvisorEffort, setAdvisorModel } from "./state.ts";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Module-local "already announced" latch. Pi fires `session_start` for every
|
package/advisor/state.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { Api, Model } from "@earendil-works/pi-ai";
|
|
7
|
-
import type { GradedEffort } from "./messages.
|
|
7
|
+
import type { GradedEffort } from "./messages.ts";
|
|
8
8
|
|
|
9
9
|
let selectedAdvisor: Model<Api> | undefined;
|
|
10
10
|
let selectedAdvisorEffort: GradedEffort | undefined;
|
package/advisor-ui.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import type { ThinkingLevel } from "@earendil-works/pi-ai";
|
|
10
10
|
import { DynamicBorder, type ExtensionContext, type Theme } from "@earendil-works/pi-coding-agent";
|
|
11
11
|
import { Container, type SelectItem, SelectList, Spacer, Text } from "@earendil-works/pi-tui";
|
|
12
|
-
import { filterItems, isBackspace, isPrintable } from "./fuzzy.
|
|
12
|
+
import { filterItems, isBackspace, isPrintable } from "./fuzzy.ts";
|
|
13
13
|
|
|
14
14
|
const MAX_VISIBLE_ROWS = 10;
|
|
15
15
|
const NAV_HINT = "type to filter • ↑↓ navigate • enter select • esc cancel";
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-advisor",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.9",
|
|
4
4
|
"description": "Pi extension. A second opinion the model can request from a stronger reviewer model before it acts.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@juicesharp/rpiv-config": "^2.13.
|
|
50
|
+
"@juicesharp/rpiv-config": "^2.13.9"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@earendil-works/pi-ai": "*",
|