pi-advisor-flow 0.15.1 → 0.15.2-dev.2
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 +9 -0
- package/README.md +17 -2
- package/dist/index.js +1194 -506
- package/docs/README.md +9 -0
- package/docs/benchmark.md +22 -0
- package/docs/configuration.md +194 -0
- package/docs/development.md +38 -0
- package/docs/herdr.md +169 -0
- package/docs/privacy.md +102 -0
- package/extensions/index.ts +23 -0
- package/locales/de.json +330 -0
- package/locales/en.json +331 -0
- package/locales/es.json +3 -0
- package/locales/fr.json +330 -0
- package/locales/pt-BR.json +3 -0
- package/locales/pt.json +3 -0
- package/locales/ru.json +3 -0
- package/locales/uk.json +3 -0
- package/locales/zh.json +3 -0
- package/package.json +15 -2
- package/skills/pi-advisor-flow/SKILL.md +62 -0
- package/src/commands/activation-preparation.ts +9 -2
- package/src/commands/activation.ts +28 -8
- package/src/commands/configuration-tool-models.ts +143 -0
- package/src/commands/configuration-tool-policy.ts +177 -0
- package/src/commands/configuration-tool-preview.ts +228 -0
- package/src/commands/configuration-tool-runtime.ts +40 -0
- package/src/commands/configuration-tool-transaction.ts +120 -0
- package/src/commands/configuration-tool-update.ts +230 -0
- package/src/commands/configuration-tool.ts +89 -0
- package/src/commands/lifecycle.ts +6 -1
- package/src/commands/manual-consultation.ts +6 -1
- package/src/commands/manual-progress.ts +4 -3
- package/src/commands/model-commands.ts +2 -1
- package/src/commands/model-options.ts +4 -6
- package/src/commands/model-picker.ts +16 -6
- package/src/commands/registration.ts +2 -0
- package/src/commands/runtime.ts +17 -4
- package/src/commands/settings-commands.ts +30 -7
- package/src/config/schema-validators.ts +104 -0
- package/src/config/schema.ts +35 -102
- package/src/config/storage.ts +160 -7
- package/src/i18n.ts +31 -0
- package/src/redaction.ts +64 -19
- package/src/scout-group-serialization.ts +66 -0
- package/src/scout-groups.ts +3 -66
- package/src/scout-selection.ts +99 -0
- package/src/scout.ts +6 -93
- package/src/session-state.ts +27 -137
- package/src/tool-input-normalization.ts +119 -0
- package/src/tools/gate-policy.ts +13 -5
- package/src/tools/jev-filter.ts +2 -1
- package/src/tools/jev-turn-gate.ts +2 -1
- package/src/tools/register-lifecycle.ts +5 -1
- package/src/tools/register-outcome.ts +5 -1
- package/src/tools/register-renderers.ts +5 -2
- package/src/tools/render-advisor-result.ts +20 -8
- package/src/tools/render-common.ts +16 -4
- package/src/tools/scout-status.ts +10 -2
- package/src/ui/jev-classifier-submenu.ts +143 -38
- package/src/ui/jev-filter-submenu.ts +52 -14
- package/src/ui/jev-provider-submenu-view.ts +72 -20
- package/src/ui/jev-provider-submenu.ts +40 -12
- package/src/ui/jev-setup-support.ts +48 -19
- package/src/ui/manual-dialog-render.ts +71 -25
- package/src/ui/searchable-model-list.ts +18 -4
- package/src/ui/settings-formatting.ts +5 -2
- package/src/ui/settings-items-jev.ts +216 -0
- package/src/ui/settings-items.ts +216 -259
- package/src/ui/settings-selector.ts +9 -2
- package/src/ui/text-setting-submenu.ts +8 -1
- package/src/usage.ts +9 -3
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { isRecordOf, isString } from "./content-utils.ts";
|
|
2
|
+
import type { JsonValue } from "./content-utils.ts";
|
|
3
|
+
|
|
4
|
+
const WHITESPACE = /\s/u;
|
|
5
|
+
|
|
6
|
+
const TIMESTAMP_KEYS = new Set([
|
|
7
|
+
"createdat",
|
|
8
|
+
"date",
|
|
9
|
+
"datetime",
|
|
10
|
+
"time",
|
|
11
|
+
"timestamp",
|
|
12
|
+
"updatedat",
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
const REQUEST_ID_KEYS = new Set(["correlationid", "requestid", "traceid"]);
|
|
16
|
+
|
|
17
|
+
const normalizedKey = (key: string) =>
|
|
18
|
+
key.replaceAll(/[-_]/gu, "").toLowerCase();
|
|
19
|
+
|
|
20
|
+
const isVolatileKey = (key: string, keys: Set<string>) =>
|
|
21
|
+
keys.has(normalizedKey(key));
|
|
22
|
+
|
|
23
|
+
const normalizeShellWhitespace = (command: string) => {
|
|
24
|
+
let result = "";
|
|
25
|
+
let quote: "'" | '"' | "`" | undefined;
|
|
26
|
+
let pendingSpace = false;
|
|
27
|
+
|
|
28
|
+
for (const char of command.trim()) {
|
|
29
|
+
if (quote) {
|
|
30
|
+
result += char;
|
|
31
|
+
|
|
32
|
+
if (char === quote) {
|
|
33
|
+
quote = undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (char === "'" || char === '"' || char === "`") {
|
|
40
|
+
if (pendingSpace && result) {
|
|
41
|
+
result += " ";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
pendingSpace = false;
|
|
45
|
+
quote = char;
|
|
46
|
+
result += char;
|
|
47
|
+
} else if (WHITESPACE.test(char)) {
|
|
48
|
+
pendingSpace = true;
|
|
49
|
+
} else {
|
|
50
|
+
if (pendingSpace && result) {
|
|
51
|
+
result += " ";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
pendingSpace = false;
|
|
55
|
+
result += char;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return result;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const normalizeString = (value: string) =>
|
|
63
|
+
value
|
|
64
|
+
.replaceAll(/\/(?:private\/)?tmp\/[^\s/]+/gu, "/tmp/<temporary>")
|
|
65
|
+
.replaceAll(/\/var\/folders\/[^\s/]+/gu, "/var/folders/<temporary>");
|
|
66
|
+
|
|
67
|
+
export type NormalizedToolInput =
|
|
68
|
+
| JsonValue
|
|
69
|
+
| undefined
|
|
70
|
+
| NormalizedToolInput[]
|
|
71
|
+
| { [key: string]: NormalizedToolInput };
|
|
72
|
+
|
|
73
|
+
export const normalizeToolInput = <Input>(
|
|
74
|
+
toolName: string,
|
|
75
|
+
input: Input
|
|
76
|
+
): NormalizedToolInput => {
|
|
77
|
+
const visit = (
|
|
78
|
+
value: NormalizedToolInput,
|
|
79
|
+
key?: string
|
|
80
|
+
): NormalizedToolInput => {
|
|
81
|
+
if (isString(value)) {
|
|
82
|
+
if (key && isVolatileKey(key, TIMESTAMP_KEYS)) {
|
|
83
|
+
return "<timestamp>";
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (key && isVolatileKey(key, REQUEST_ID_KEYS)) {
|
|
87
|
+
return "<request-id>";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const normalized = normalizeString(value);
|
|
91
|
+
|
|
92
|
+
return toolName === "bash" && key === "command"
|
|
93
|
+
? normalizeShellWhitespace(normalized)
|
|
94
|
+
: normalized;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (Array.isArray(value)) {
|
|
98
|
+
return value.map((item) => visit(item));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (isRecordOf(value)) {
|
|
102
|
+
return Object.fromEntries(
|
|
103
|
+
Object.keys(value)
|
|
104
|
+
.toSorted()
|
|
105
|
+
.map((childKey) => [childKey, visit(value[childKey], childKey)])
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return value;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
// SAFETY: Pi tool inputs are JSON-decoded tool arguments, so the root value is already NormalizedToolInput-shaped.
|
|
113
|
+
return visit(input as Input & NormalizedToolInput);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export const normalizedToolSignature = <Input>(
|
|
117
|
+
toolName: string,
|
|
118
|
+
input: Input
|
|
119
|
+
) => `${toolName}:${JSON.stringify(normalizeToolInput(toolName, input))}`;
|
package/src/tools/gate-policy.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
import type { GateFailureMode } from "../config/types.ts";
|
|
14
14
|
import type { HerdrAdvisorBlock } from "../herdr-block.ts";
|
|
15
15
|
import { herdrAdvisorBlock, notifyHerdrAdvisorFailure } from "../herdr.ts";
|
|
16
|
+
import { t } from "../i18n.ts";
|
|
16
17
|
import type { AdvisorSessionState } from "../session-state.ts";
|
|
17
18
|
import type { AdvisorGateResult, GateFailureCategory } from "./types.ts";
|
|
18
19
|
|
|
@@ -34,10 +35,14 @@ export const notifyLocalFailure = (
|
|
|
34
35
|
sessionBlocked = false
|
|
35
36
|
) => {
|
|
36
37
|
if (ctx.hasUI) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const prefix = sessionBlocked
|
|
39
|
+
? t(
|
|
40
|
+
"notify.localFailure.blockedPrefix",
|
|
41
|
+
"Advisor gate failure; session blocked:"
|
|
42
|
+
)
|
|
43
|
+
: t("notify.localFailure.failedPrefix", "Advisor consultation failed:");
|
|
44
|
+
|
|
45
|
+
ctx.ui.notify(`${prefix} ${message}`, "error");
|
|
41
46
|
}
|
|
42
47
|
};
|
|
43
48
|
|
|
@@ -104,7 +109,10 @@ export const blockedDecisionEffect = (
|
|
|
104
109
|
if (failureMode === "warn-and-continue") {
|
|
105
110
|
if (ctx.hasUI) {
|
|
106
111
|
ctx.ui.notify(
|
|
107
|
-
|
|
112
|
+
t(
|
|
113
|
+
"notify.gateBlockedContinued.message",
|
|
114
|
+
"Advisor gate returned blocked; continuing by configuration."
|
|
115
|
+
),
|
|
108
116
|
"warning"
|
|
109
117
|
);
|
|
110
118
|
}
|
package/src/tools/jev-filter.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
isSimpleMode,
|
|
12
12
|
} from "../config/state.ts";
|
|
13
13
|
import { capUtf8Bytes } from "../content-utils.ts";
|
|
14
|
+
import { t } from "../i18n.ts";
|
|
14
15
|
import { consumeJevClassifierKey } from "../jev/classifier-key-store.ts";
|
|
15
16
|
import { classifyScreening } from "../jev/classifier.ts";
|
|
16
17
|
import { JevFailure } from "../jev/failure.ts";
|
|
@@ -65,7 +66,7 @@ const repeatSkipText = (advice: string) =>
|
|
|
65
66
|
|
|
66
67
|
const outageNotifier = createOutageNotifier(
|
|
67
68
|
(category, message) =>
|
|
68
|
-
|
|
69
|
+
`${t("notify.jevFilterOutage.prefix", "Advisor Jev classifier failed")} (${category}); ${t("notify.jevFilterOutage.allowing", "allowing consultations.")} ${message}`
|
|
69
70
|
);
|
|
70
71
|
|
|
71
72
|
const notifyOutageOnce = outageNotifier.notify;
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from "../config/state.ts";
|
|
14
14
|
import { herdrAdvisorActivity } from "../herdr.ts";
|
|
15
15
|
import type { HerdrAdvisorActivityScope } from "../herdr.ts";
|
|
16
|
+
import { t } from "../i18n.ts";
|
|
16
17
|
import { consumeJevClassifierKey } from "../jev/classifier-key-store.ts";
|
|
17
18
|
import { classifyTurnGate } from "../jev/classifier.ts";
|
|
18
19
|
import { JevFailure } from "../jev/failure.ts";
|
|
@@ -60,7 +61,7 @@ export interface JevTurnGateRegistration {
|
|
|
60
61
|
|
|
61
62
|
const outageNotifier = createOutageNotifier(
|
|
62
63
|
(category, message) =>
|
|
63
|
-
|
|
64
|
+
`${t("notify.jevTurnGateOutage.prefix", "Advisor Jev classifier turn gate failed")} (${category}); ${t("notify.jevTurnGateOutage.continuing", "continuing without a proactive consultation.")} ${message}`
|
|
64
65
|
);
|
|
65
66
|
|
|
66
67
|
const notifyFailureOnce = outageNotifier.notify;
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
isSimpleMode,
|
|
7
7
|
} from "../config/state.ts";
|
|
8
8
|
import { loadConfig } from "../config/storage.ts";
|
|
9
|
+
import { t } from "../i18n.ts";
|
|
9
10
|
import { advisorBudgetMessage } from "./budget-feedback.ts";
|
|
10
11
|
import { reserveAdvisorCall } from "./gate-policy.ts";
|
|
11
12
|
import { handleAutomaticGate } from "./loop-gate.ts";
|
|
@@ -62,7 +63,10 @@ export const registerToolLifecycle = ({
|
|
|
62
63
|
|
|
63
64
|
if (ctx.hasUI) {
|
|
64
65
|
ctx.ui.notify(
|
|
65
|
-
|
|
66
|
+
`${t(
|
|
67
|
+
"notify.gatingSkipped.prefix",
|
|
68
|
+
"Advisor gating skipped; configuration is invalid."
|
|
69
|
+
)} ${message} ${t("notify.gatingSkipped.suffix", "Fix advisor.json.")}`,
|
|
66
70
|
"error"
|
|
67
71
|
);
|
|
68
72
|
}
|
|
@@ -4,6 +4,7 @@ import { Type } from "typebox";
|
|
|
4
4
|
import { advisorOutcomeLoggingRef } from "../config/state.ts";
|
|
5
5
|
import { loadConfig } from "../config/storage.ts";
|
|
6
6
|
import { textFrom } from "../conversation.ts";
|
|
7
|
+
import { t } from "../i18n.ts";
|
|
7
8
|
import { ADOPTIONS, VALIDATIONS } from "../outcomes.ts";
|
|
8
9
|
import type { ToolRegistrationContext } from "./types.ts";
|
|
9
10
|
|
|
@@ -55,7 +56,10 @@ export const registerOutcomeTool = ({
|
|
|
55
56
|
|
|
56
57
|
if (ctx.hasUI) {
|
|
57
58
|
ctx.ui.notify(
|
|
58
|
-
|
|
59
|
+
t(
|
|
60
|
+
"notify.outcomeRecordFailed.message",
|
|
61
|
+
"Advisor outcome could not be recorded locally."
|
|
62
|
+
),
|
|
59
63
|
"warning"
|
|
60
64
|
);
|
|
61
65
|
}
|
|
@@ -9,6 +9,7 @@ import { Box, Markdown, Text } from "@earendil-works/pi-tui";
|
|
|
9
9
|
|
|
10
10
|
import { getAdvisorSettings } from "../config/state.ts";
|
|
11
11
|
import { isString } from "../content-utils.ts";
|
|
12
|
+
import { t } from "../i18n.ts";
|
|
12
13
|
import { formatAdvisorUsage } from "../usage.ts";
|
|
13
14
|
import type { TurnGateResultDetails as TurnGateResultRecord } from "./jev-turn-gate.ts";
|
|
14
15
|
import { adviceForDisplay, renderAdvisorCallBox } from "./render-common.ts";
|
|
@@ -137,7 +138,7 @@ const turnGateResultRenderer: MessageRenderer<TurnGateResultDetails> = (
|
|
|
137
138
|
"error",
|
|
138
139
|
isString(message.content)
|
|
139
140
|
? message.content
|
|
140
|
-
: "Advisor turn review failed."
|
|
141
|
+
: t("render.turnReviewFailed", "Advisor turn review failed.")
|
|
141
142
|
),
|
|
142
143
|
0,
|
|
143
144
|
0
|
|
@@ -186,7 +187,9 @@ const loopResultRenderer: MessageRenderer<LoopResultDetails> = (
|
|
|
186
187
|
new Text(
|
|
187
188
|
theme.fg(
|
|
188
189
|
"error",
|
|
189
|
-
isString(message.content)
|
|
190
|
+
isString(message.content)
|
|
191
|
+
? message.content
|
|
192
|
+
: t("render.gateFailed", "Advisor gate failed.")
|
|
190
193
|
),
|
|
191
194
|
0,
|
|
192
195
|
0
|
|
@@ -8,6 +8,7 @@ import { Box, Markdown, Spacer, Text } from "@earendil-works/pi-tui";
|
|
|
8
8
|
|
|
9
9
|
import { getAdvisorSettings } from "../config/state.ts";
|
|
10
10
|
import { textFrom } from "../conversation.ts";
|
|
11
|
+
import { t } from "../i18n.ts";
|
|
11
12
|
import { formatAdvisorUsage } from "../usage.ts";
|
|
12
13
|
import {
|
|
13
14
|
adviceForDisplay,
|
|
@@ -77,13 +78,13 @@ const attachmentLabels = (details: AdvisorToolDetails | undefined) =>
|
|
|
77
78
|
? `Project preferences attached · ${formatByteSize(details.preferenceBytes)}`
|
|
78
79
|
: undefined,
|
|
79
80
|
details?.trackedBytes
|
|
80
|
-
?
|
|
81
|
+
? `${t("render.trackedAttached", "Tracked files attached")} · ${formatByteSize(details.trackedBytes)}`
|
|
81
82
|
: undefined,
|
|
82
83
|
details?.untrackedBytes
|
|
83
|
-
?
|
|
84
|
+
? `${t("render.untrackedAttached", "Untracked files attached")} · ${formatByteSize(details.untrackedBytes)}`
|
|
84
85
|
: undefined,
|
|
85
86
|
details?.imageCount
|
|
86
|
-
? `${details.imageCount}
|
|
87
|
+
? `${details.imageCount} ${details.imageCount === 1 ? t("render.image", "image") : t("render.images", "images")} ${t("render.attached", "attached")}${details.imageBytes ? ` · ${formatByteSize(details.imageBytes)}` : ""}${details.imageOmissions ? ` · ${details.imageOmissions} ${t("render.withheld", "withheld")}` : ""}`
|
|
87
88
|
: undefined,
|
|
88
89
|
].filter((label): label is string => label !== undefined);
|
|
89
90
|
|
|
@@ -96,7 +97,10 @@ const renderSkipBox = (
|
|
|
96
97
|
const details = advisorResultDetails(result);
|
|
97
98
|
|
|
98
99
|
const lines = [
|
|
99
|
-
theme.fg(
|
|
100
|
+
theme.fg(
|
|
101
|
+
"dim",
|
|
102
|
+
theme.bold(`◆ ADVISOR · ${t("render.skipped", "SKIPPED")}`)
|
|
103
|
+
),
|
|
100
104
|
theme.fg("dim", ` ${details?.skipReason ?? details?.jev?.reason ?? ""}`),
|
|
101
105
|
];
|
|
102
106
|
|
|
@@ -147,7 +151,7 @@ const renderPartialAdvisorResult = (
|
|
|
147
151
|
SPINNER_FRAMES[Math.floor(Date.now() / 80) % SPINNER_FRAMES.length];
|
|
148
152
|
|
|
149
153
|
const lines = [
|
|
150
|
-
`${theme.fg("warning", theme.bold(`◆ ADVISOR ${frame}`))} ${theme.fg("dim", "
|
|
154
|
+
`${theme.fg("warning", theme.bold(`◆ ADVISOR ${frame}`))} ${theme.fg("dim", `· ${t("render.working", "Working…")}`)}`,
|
|
151
155
|
];
|
|
152
156
|
|
|
153
157
|
box.addChild(new Text(lines.join("\n"), 0, 0));
|
|
@@ -186,7 +190,12 @@ const finalResultLines = (
|
|
|
186
190
|
const lines = [renderAdvisorResponseHeader(hasSoundVerdict(advice), theme)];
|
|
187
191
|
|
|
188
192
|
if (details?.followUp) {
|
|
189
|
-
lines.push(
|
|
193
|
+
lines.push(
|
|
194
|
+
theme.fg(
|
|
195
|
+
"dim",
|
|
196
|
+
` ${t("render.followUpConsultation", "Follow-up consultation")}`
|
|
197
|
+
)
|
|
198
|
+
);
|
|
190
199
|
}
|
|
191
200
|
|
|
192
201
|
if (details?.advisor) {
|
|
@@ -197,7 +206,7 @@ const finalResultLines = (
|
|
|
197
206
|
const usage = formatAdvisorUsage(details?.usage);
|
|
198
207
|
|
|
199
208
|
if (usage) {
|
|
200
|
-
lines.push(theme.fg("dim", ` Usage: ${usage}`));
|
|
209
|
+
lines.push(theme.fg("dim", ` ${t("render.usage", "Usage:")} ${usage}`));
|
|
201
210
|
}
|
|
202
211
|
}
|
|
203
212
|
|
|
@@ -249,7 +258,10 @@ const renderFinalAdvisorResult = (
|
|
|
249
258
|
const advice = details?.text || textFrom(result.content);
|
|
250
259
|
const thinking = thinkingPreview(details);
|
|
251
260
|
const lines = finalResultLines(details, advice, theme);
|
|
252
|
-
|
|
261
|
+
|
|
262
|
+
const displayAdvice =
|
|
263
|
+
advice || t("render.noAdvice", "(Advisor returned no advice.)");
|
|
264
|
+
|
|
253
265
|
box.addChild(new Text(lines.join("\n"), 0, 0));
|
|
254
266
|
|
|
255
267
|
if (thinking) {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import type { Component } from "@earendil-works/pi-tui";
|
|
11
11
|
|
|
12
12
|
import { advisorCollapseResponsesRef } from "../config/state.ts";
|
|
13
|
+
import { t } from "../i18n.ts";
|
|
13
14
|
import { piHideThinkingEnabled } from "../pi-settings.ts";
|
|
14
15
|
|
|
15
16
|
export const SPINNER_FRAMES = [
|
|
@@ -67,7 +68,10 @@ class ThinkingMarkdown implements Component {
|
|
|
67
68
|
|
|
68
69
|
/** Collapsed placeholder shown when Pi's hide_thinking setting is on. */
|
|
69
70
|
const hiddenThinkingLabel = (theme: ThinkingTheme): Component => {
|
|
70
|
-
const label = theme.fg(
|
|
71
|
+
const label = theme.fg(
|
|
72
|
+
"thinkingText",
|
|
73
|
+
`${THINKING_PREFIX}${t("render.thinking", "Thinking…")}`
|
|
74
|
+
);
|
|
71
75
|
|
|
72
76
|
return {
|
|
73
77
|
invalidate: noop,
|
|
@@ -96,7 +100,9 @@ export const renderAdvisorCallBox = (
|
|
|
96
100
|
|
|
97
101
|
const title = theme.fg(
|
|
98
102
|
"customMessageText",
|
|
99
|
-
followUp
|
|
103
|
+
followUp
|
|
104
|
+
? `${t("render.executorToAdvisor", "Executor → Advisor")} · ${t("render.followUp", "Follow-up")}`
|
|
105
|
+
: t("render.executorToAdvisor", "Executor → Advisor")
|
|
100
106
|
);
|
|
101
107
|
|
|
102
108
|
box.addChild(
|
|
@@ -125,8 +131,14 @@ export const hasSoundVerdict = (advice: string) =>
|
|
|
125
131
|
/** The single Advisor response header shared by tool and manual renderers. */
|
|
126
132
|
export const renderAdvisorResponseHeader = (sound: boolean, theme: Theme) =>
|
|
127
133
|
sound
|
|
128
|
-
? theme.fg(
|
|
129
|
-
|
|
134
|
+
? theme.fg(
|
|
135
|
+
"accent",
|
|
136
|
+
theme.bold(`◆ ADVISOR · ${t("render.sound", "SOUND")}`)
|
|
137
|
+
)
|
|
138
|
+
: theme.fg(
|
|
139
|
+
"warning",
|
|
140
|
+
theme.bold(`◆ ADVISOR ${t("render.response", "RESPONSE")}`)
|
|
141
|
+
);
|
|
130
142
|
|
|
131
143
|
export const adviceForDisplay = (advice: string, expanded: boolean) => {
|
|
132
144
|
if (!advisorCollapseResponsesRef || expanded) {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
executorRef,
|
|
12
12
|
getAdvisorSettings,
|
|
13
13
|
} from "../config/state.ts";
|
|
14
|
+
import { t } from "../i18n.ts";
|
|
14
15
|
import type { ScoutLifecycleEvent } from "../scout.ts";
|
|
15
16
|
import { uiAction, uiAvailable } from "../ui-guard.ts";
|
|
16
17
|
import { formatAdvisorUsage, snapshotAdvisorUsage } from "../usage.ts";
|
|
@@ -113,7 +114,12 @@ export class ScoutStatusManager {
|
|
|
113
114
|
this.#active.add(token);
|
|
114
115
|
|
|
115
116
|
if (this.showStatus) {
|
|
116
|
-
uiAction(ctx, (ui) =>
|
|
117
|
+
uiAction(ctx, (ui) =>
|
|
118
|
+
ui.setStatus(
|
|
119
|
+
"advisor-scout",
|
|
120
|
+
t("status.scoutCurating", "Scout curating…")
|
|
121
|
+
)
|
|
122
|
+
);
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
return;
|
|
@@ -134,7 +140,9 @@ export class ScoutStatusManager {
|
|
|
134
140
|
uiAction(ctx, (ui) =>
|
|
135
141
|
ui.setStatus(
|
|
136
142
|
"advisor-scout",
|
|
137
|
-
this.#active.size > 0
|
|
143
|
+
this.#active.size > 0
|
|
144
|
+
? t("status.scoutCurating", "Scout curating…")
|
|
145
|
+
: undefined
|
|
138
146
|
)
|
|
139
147
|
);
|
|
140
148
|
}
|