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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Input, Key, matchesKey } from "@earendil-works/pi-tui";
|
|
2
2
|
import type { Component, Focusable } from "@earendil-works/pi-tui";
|
|
3
3
|
|
|
4
|
+
import { t } from "../i18n.ts";
|
|
4
5
|
import { normalizeJevBaseUrl } from "../jev/base-url.ts";
|
|
5
6
|
import type { JevCredentials, JevTransportKind } from "../jev/transport.ts";
|
|
6
7
|
import {
|
|
@@ -196,7 +197,9 @@ export class JevProviderSubmenu implements Component, Focusable {
|
|
|
196
197
|
|
|
197
198
|
private reportBackgroundError = (message: string): void => {
|
|
198
199
|
this.mode = "menu";
|
|
199
|
-
this.notice =
|
|
200
|
+
this.notice = `${t("jevSetup.setupFailedPrefix", "Setup failed:")} ${
|
|
201
|
+
message
|
|
202
|
+
}`;
|
|
200
203
|
this.options.tui.requestRender();
|
|
201
204
|
};
|
|
202
205
|
|
|
@@ -324,15 +327,17 @@ export class JevProviderSubmenu implements Component, Focusable {
|
|
|
324
327
|
const providerId = value.trim();
|
|
325
328
|
|
|
326
329
|
if (!providerId || /\s/u.test(providerId)) {
|
|
327
|
-
this.inputError =
|
|
328
|
-
"
|
|
330
|
+
this.inputError = t(
|
|
331
|
+
"jevSetup.providerIdInvalid",
|
|
332
|
+
"Enter a single Pi provider id, for example openrouter."
|
|
333
|
+
);
|
|
329
334
|
this.options.tui.requestRender();
|
|
330
335
|
|
|
331
336
|
return;
|
|
332
337
|
}
|
|
333
338
|
|
|
334
339
|
if (!this.baseUrl) {
|
|
335
|
-
this.inputError = "Enter the Base URL first.";
|
|
340
|
+
this.inputError = t("jevSetup.baseUrlFirst", "Enter the Base URL first.");
|
|
336
341
|
this.options.tui.requestRender();
|
|
337
342
|
|
|
338
343
|
return;
|
|
@@ -351,7 +356,13 @@ export class JevProviderSubmenu implements Component, Focusable {
|
|
|
351
356
|
|
|
352
357
|
if (!credentials) {
|
|
353
358
|
this.mode = "menu";
|
|
354
|
-
this.notice =
|
|
359
|
+
this.notice = `${t(
|
|
360
|
+
"jevSetup.noStoredLoginPrefix",
|
|
361
|
+
"No stored login for Pi provider"
|
|
362
|
+
)} "${providerId}"${t(
|
|
363
|
+
"jevSetup.noStoredLoginSuffix",
|
|
364
|
+
". Add one in Pi and retry."
|
|
365
|
+
)}`;
|
|
355
366
|
this.options.tui.requestRender();
|
|
356
367
|
|
|
357
368
|
return;
|
|
@@ -372,7 +383,10 @@ export class JevProviderSubmenu implements Component, Focusable {
|
|
|
372
383
|
credentials = await this.deps.resolveTransport(transport);
|
|
373
384
|
} catch (error) {
|
|
374
385
|
this.mode = "menu";
|
|
375
|
-
this.notice =
|
|
386
|
+
this.notice = `${t(
|
|
387
|
+
"jevSetup.credentialLookupFailedPrefix",
|
|
388
|
+
"Credential lookup failed:"
|
|
389
|
+
)} ${error instanceof Error ? error.message : String(error)}`;
|
|
376
390
|
this.options.tui.requestRender();
|
|
377
391
|
|
|
378
392
|
return;
|
|
@@ -386,7 +400,10 @@ export class JevProviderSubmenu implements Component, Focusable {
|
|
|
386
400
|
this.notice = undefined;
|
|
387
401
|
this.openKeyEntry(transport);
|
|
388
402
|
} else {
|
|
389
|
-
this.notice =
|
|
403
|
+
this.notice = t(
|
|
404
|
+
"jevSetup.noOpenRouterLogin",
|
|
405
|
+
"No OpenRouter Pi login found. Add one in Pi and retry."
|
|
406
|
+
);
|
|
390
407
|
}
|
|
391
408
|
|
|
392
409
|
this.options.tui.requestRender();
|
|
@@ -395,8 +412,10 @@ export class JevProviderSubmenu implements Component, Focusable {
|
|
|
395
412
|
}
|
|
396
413
|
|
|
397
414
|
if (credentials.transport !== transport) {
|
|
398
|
-
this.notice =
|
|
399
|
-
"
|
|
415
|
+
this.notice = t(
|
|
416
|
+
"jevSetup.transportMismatch",
|
|
417
|
+
"The selected provider did not resolve matching credentials."
|
|
418
|
+
);
|
|
400
419
|
this.options.tui.requestRender();
|
|
401
420
|
|
|
402
421
|
return;
|
|
@@ -433,7 +452,10 @@ export class JevProviderSubmenu implements Component, Focusable {
|
|
|
433
452
|
const outcome = await this.deps.verify(credentials);
|
|
434
453
|
|
|
435
454
|
if (!outcome.ok) {
|
|
436
|
-
this.notice =
|
|
455
|
+
this.notice = `${t(
|
|
456
|
+
"jevSetup.verificationFailedPrefix",
|
|
457
|
+
"Verification failed:"
|
|
458
|
+
)} ${outcome.message ?? t("jevSetup.unknownError", "unknown error")}`;
|
|
437
459
|
this.mode = enteredKey ? "key-entry" : "menu";
|
|
438
460
|
this.canEnterKey = !enteredKey && canReplaceWithEnteredKey(credentials);
|
|
439
461
|
this.options.tui.requestRender();
|
|
@@ -456,7 +478,10 @@ export class JevProviderSubmenu implements Component, Focusable {
|
|
|
456
478
|
return;
|
|
457
479
|
}
|
|
458
480
|
|
|
459
|
-
this.notice = `${stored.message}
|
|
481
|
+
this.notice = `${stored.message} ${t(
|
|
482
|
+
"jevSetup.verificationSucceeded",
|
|
483
|
+
"Verification succeeded."
|
|
484
|
+
)}`;
|
|
460
485
|
|
|
461
486
|
// An entered key is the more explicit choice, so it clears a reused login.
|
|
462
487
|
if (credentials.transport === "typesafe-compatible") {
|
|
@@ -474,7 +499,10 @@ export class JevProviderSubmenu implements Component, Focusable {
|
|
|
474
499
|
|
|
475
500
|
this.mode = "menu";
|
|
476
501
|
this.canEnterKey = false;
|
|
477
|
-
this.notice =
|
|
502
|
+
this.notice = t(
|
|
503
|
+
"jevSetup.providerVerifiedNotSaved",
|
|
504
|
+
"Provider verified, but settings could not be saved."
|
|
505
|
+
);
|
|
478
506
|
this.options.tui.requestRender();
|
|
479
507
|
}
|
|
480
508
|
|
|
@@ -2,6 +2,7 @@ import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
|
2
2
|
import { noul } from "@typesafe-ai/sdk";
|
|
3
3
|
|
|
4
4
|
import type { JevTransport } from "../config/types.ts";
|
|
5
|
+
import { t } from "../i18n.ts";
|
|
5
6
|
import { jevClientFromCredentials } from "../jev/client.ts";
|
|
6
7
|
import { OPENAI_DECISIONS_MODEL } from "../jev/decisions-client.ts";
|
|
7
8
|
import {
|
|
@@ -86,24 +87,29 @@ export const fireAndForget = async (
|
|
|
86
87
|
|
|
87
88
|
export const providerName = (transport: JevTransportKind): string => {
|
|
88
89
|
if (transport === "typesafe") {
|
|
89
|
-
return "TypeSafe Jev";
|
|
90
|
+
return t("jevSetup.provider.typesafe", "TypeSafe Jev");
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
if (transport === "openrouter") {
|
|
93
|
-
return "OpenRouter (Pi login)";
|
|
94
|
+
return t("jevSetup.provider.openrouter", "OpenRouter (Pi login)");
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
if (transport === "typesafe-compatible") {
|
|
97
|
-
return
|
|
98
|
+
return t(
|
|
99
|
+
"jevSetup.provider.typesafeCompatible",
|
|
100
|
+
"System One–compatible endpoint"
|
|
101
|
+
);
|
|
98
102
|
}
|
|
99
103
|
|
|
100
|
-
return
|
|
104
|
+
return `${t("jevSetup.provider.openaiDecisions", "OpenAI Decisions")} (${
|
|
105
|
+
OPENAI_DECISIONS_MODEL
|
|
106
|
+
})`;
|
|
101
107
|
};
|
|
102
108
|
|
|
103
109
|
const endpointSourceLabel = (source: JevCredentials["source"]): string => {
|
|
104
110
|
switch (source) {
|
|
105
111
|
case "provider-credential": {
|
|
106
|
-
return "Pi provider login";
|
|
112
|
+
return t("jevSetup.source.providerLogin", "Pi provider login");
|
|
107
113
|
}
|
|
108
114
|
|
|
109
115
|
case "jev-bun-secrets": {
|
|
@@ -111,7 +117,7 @@ const endpointSourceLabel = (source: JevCredentials["source"]): string => {
|
|
|
111
117
|
}
|
|
112
118
|
|
|
113
119
|
case "jev-file": {
|
|
114
|
-
return "stored file, mode 0600";
|
|
120
|
+
return t("jevSetup.source.storedFile", "stored file, mode 0600");
|
|
115
121
|
}
|
|
116
122
|
|
|
117
123
|
default: {
|
|
@@ -122,15 +128,24 @@ const endpointSourceLabel = (source: JevCredentials["source"]): string => {
|
|
|
122
128
|
|
|
123
129
|
export const transportLabel = (credentials: JevCredentials): string => {
|
|
124
130
|
if (credentials.transport === "openrouter") {
|
|
125
|
-
return
|
|
131
|
+
return t(
|
|
132
|
+
"jevSetup.credential.openrouterReused",
|
|
133
|
+
"OpenRouter (reusing Pi login)"
|
|
134
|
+
);
|
|
126
135
|
}
|
|
127
136
|
|
|
128
137
|
if (credentials.transport === "typesafe-compatible") {
|
|
129
|
-
return
|
|
138
|
+
return `${t(
|
|
139
|
+
"jevSetup.credential.systemOneCompatible",
|
|
140
|
+
"System One–compatible"
|
|
141
|
+
)} (${credentials.baseUrl ?? t("jevSetup.noBaseUrl", "no Base URL")}; ${t(
|
|
142
|
+
"jevSetup.keyLabel",
|
|
143
|
+
"key:"
|
|
144
|
+
)} ${endpointSourceLabel(credentials.source)})`;
|
|
130
145
|
}
|
|
131
146
|
|
|
132
147
|
if (credentials.transport === "openai-decisions") {
|
|
133
|
-
let source = "verified API key";
|
|
148
|
+
let source = t("jevSetup.source.verifiedApiKey", "verified API key");
|
|
134
149
|
|
|
135
150
|
switch (credentials.source) {
|
|
136
151
|
case "openai-bun-secrets": {
|
|
@@ -144,12 +159,12 @@ export const transportLabel = (credentials: JevCredentials): string => {
|
|
|
144
159
|
}
|
|
145
160
|
|
|
146
161
|
case "openai-file": {
|
|
147
|
-
source = "stored file, mode 0600";
|
|
162
|
+
source = t("jevSetup.source.storedFile", "stored file, mode 0600");
|
|
148
163
|
break;
|
|
149
164
|
}
|
|
150
165
|
|
|
151
166
|
case "openai-provider-credential": {
|
|
152
|
-
source = "Pi stored API key";
|
|
167
|
+
source = t("jevSetup.source.piStoredKey", "Pi stored API key");
|
|
153
168
|
break;
|
|
154
169
|
}
|
|
155
170
|
|
|
@@ -158,24 +173,38 @@ export const transportLabel = (credentials: JevCredentials): string => {
|
|
|
158
173
|
}
|
|
159
174
|
}
|
|
160
175
|
|
|
161
|
-
return
|
|
176
|
+
return `${t("jevSetup.provider.openaiDecisions", "OpenAI Decisions")} (${
|
|
177
|
+
OPENAI_DECISIONS_MODEL
|
|
178
|
+
}; ${t("jevSetup.keyLabel", "key:")} ${source})`;
|
|
162
179
|
}
|
|
163
180
|
|
|
164
181
|
switch (credentials.source) {
|
|
165
182
|
case "advisor-json": {
|
|
166
|
-
return
|
|
183
|
+
return t(
|
|
184
|
+
"jevSetup.credential.typesafeAdvisorJson",
|
|
185
|
+
"TypeSafe (key: advisor.json — plaintext, not recommended)"
|
|
186
|
+
);
|
|
167
187
|
}
|
|
168
188
|
|
|
169
189
|
case "bun-secrets": {
|
|
170
|
-
return
|
|
190
|
+
return t(
|
|
191
|
+
"jevSetup.credential.typesafeBunSecrets",
|
|
192
|
+
"TypeSafe (key: Bun.secrets)"
|
|
193
|
+
);
|
|
171
194
|
}
|
|
172
195
|
|
|
173
196
|
case "file": {
|
|
174
|
-
return
|
|
197
|
+
return t(
|
|
198
|
+
"jevSetup.credential.typesafeFile",
|
|
199
|
+
"TypeSafe (key: stored file, mode 0600)"
|
|
200
|
+
);
|
|
175
201
|
}
|
|
176
202
|
|
|
177
203
|
default: {
|
|
178
|
-
return
|
|
204
|
+
return t(
|
|
205
|
+
"jevSetup.credential.typesafeEnv",
|
|
206
|
+
"TypeSafe (key: TYPESAFE_API_KEY)"
|
|
207
|
+
);
|
|
179
208
|
}
|
|
180
209
|
}
|
|
181
210
|
};
|
|
@@ -197,14 +226,14 @@ export const canReplaceWithEnteredKey = (credentials: JevCredentials) =>
|
|
|
197
226
|
|
|
198
227
|
export const keyEntryPrompt = (transport: JevTransportKind): string => {
|
|
199
228
|
if (transport === "openai-decisions") {
|
|
200
|
-
return "Paste an OpenAI Platform API key";
|
|
229
|
+
return t("jevSetup.keyPrompt.openai", "Paste an OpenAI Platform API key");
|
|
201
230
|
}
|
|
202
231
|
|
|
203
232
|
if (transport === "typesafe-compatible") {
|
|
204
|
-
return "Paste the endpoint API key";
|
|
233
|
+
return t("jevSetup.keyPrompt.endpoint", "Paste the endpoint API key");
|
|
205
234
|
}
|
|
206
235
|
|
|
207
|
-
return "Paste a TypeSafe API key";
|
|
236
|
+
return t("jevSetup.keyPrompt.typesafe", "Paste a TypeSafe API key");
|
|
208
237
|
};
|
|
209
238
|
|
|
210
239
|
const defaultVerify = async (credentials: JevCredentials) => {
|
|
@@ -5,15 +5,40 @@ import {
|
|
|
5
5
|
} from "@earendil-works/pi-tui";
|
|
6
6
|
|
|
7
7
|
import type { GitContextLevel } from "../git.ts";
|
|
8
|
+
import { t } from "../i18n.ts";
|
|
8
9
|
import type { ManualAdvisorDialogView } from "./types.ts";
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
interface GitContextCopy {
|
|
12
|
+
description: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const gitContextCopy = (level: GitContextLevel): GitContextCopy => {
|
|
17
|
+
switch (level) {
|
|
18
|
+
case "full": {
|
|
19
|
+
return {
|
|
20
|
+
description: t("manualDialog.git.full.desc", "summary plus patch"),
|
|
21
|
+
label: t("manualDialog.git.full.label", "Full"),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
case "off": {
|
|
26
|
+
return {
|
|
27
|
+
description: t("manualDialog.git.off.desc", "no Git data"),
|
|
28
|
+
label: t("manualDialog.git.off.label", "None"),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
default: {
|
|
33
|
+
return {
|
|
34
|
+
description: t(
|
|
35
|
+
"manualDialog.git.summary.desc",
|
|
36
|
+
"changed paths and status"
|
|
37
|
+
),
|
|
38
|
+
label: t("manualDialog.git.summary.label", "Summary"),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
17
42
|
};
|
|
18
43
|
|
|
19
44
|
export const renderManualAdvisorDialog = (
|
|
@@ -68,7 +93,7 @@ export const renderManualAdvisorDialog = (
|
|
|
68
93
|
|
|
69
94
|
if (renderWidth >= 2) {
|
|
70
95
|
const title = truncateToWidth(
|
|
71
|
-
" Ask Advisor
|
|
96
|
+
` ${t("manualDialog.title", "Ask Advisor")} `,
|
|
72
97
|
Math.max(0, innerWidth),
|
|
73
98
|
"",
|
|
74
99
|
false
|
|
@@ -87,7 +112,9 @@ export const renderManualAdvisorDialog = (
|
|
|
87
112
|
}
|
|
88
113
|
|
|
89
114
|
addLine(
|
|
90
|
-
`${focusMarker("editor")}${theme.bold(
|
|
115
|
+
`${focusMarker("editor")}${theme.bold(
|
|
116
|
+
t("manualDialog.messageLabel", "Message for Advisor (optional)")
|
|
117
|
+
)}`
|
|
91
118
|
);
|
|
92
119
|
|
|
93
120
|
for (const editorLine of editorLines) {
|
|
@@ -96,28 +123,41 @@ export const renderManualAdvisorDialog = (
|
|
|
96
123
|
|
|
97
124
|
addLine("");
|
|
98
125
|
addWrapped(
|
|
99
|
-
|
|
126
|
+
t(
|
|
127
|
+
"manualDialog.contextNote",
|
|
128
|
+
"Automatic context follows your settings: conversation history, tool disclosure, project preferences, redaction, and configured limits remain unchanged."
|
|
129
|
+
),
|
|
100
130
|
"muted"
|
|
101
131
|
);
|
|
102
132
|
addWrapped(
|
|
103
|
-
|
|
133
|
+
t(
|
|
134
|
+
"manualDialog.noDraftsNote",
|
|
135
|
+
"This dialog does not expose drafts or explicit file handoff controls."
|
|
136
|
+
),
|
|
104
137
|
"dim"
|
|
105
138
|
);
|
|
106
139
|
addWrapped(
|
|
107
|
-
|
|
140
|
+
t(
|
|
141
|
+
"manualDialog.gitNoneNote",
|
|
142
|
+
"Git None only withholds repository data; it does not remove configured conversation history."
|
|
143
|
+
),
|
|
108
144
|
"dim"
|
|
109
145
|
);
|
|
110
146
|
addLine("");
|
|
111
|
-
|
|
147
|
+
|
|
148
|
+
const gitCeiling = gitContextCopy(gitContext).label;
|
|
149
|
+
|
|
112
150
|
addLine(
|
|
113
151
|
`${focusMarker("git")}${theme.bold(
|
|
114
|
-
|
|
152
|
+
`${t("manualDialog.gitTitle", "Git repository context (max:")} ${
|
|
153
|
+
gitCeiling
|
|
154
|
+
}; ${t("manualDialog.gitChoose", "↑/↓ or Space to choose)")}`
|
|
115
155
|
)}`
|
|
116
156
|
);
|
|
117
157
|
|
|
118
158
|
for (let index = 0; index < gitLevels.length; index += 1) {
|
|
119
159
|
const level = gitLevels[index];
|
|
120
|
-
const copy =
|
|
160
|
+
const copy = gitContextCopy(level);
|
|
121
161
|
const selected = index === gitIndex;
|
|
122
162
|
const marker = selected ? "●" : "○";
|
|
123
163
|
const optionFocus = focusTarget === "git" && selected ? "▸ " : " ";
|
|
@@ -130,28 +170,34 @@ export const renderManualAdvisorDialog = (
|
|
|
130
170
|
|
|
131
171
|
addLine("");
|
|
132
172
|
|
|
133
|
-
let interactionHint =
|
|
134
|
-
"
|
|
173
|
+
let interactionHint = t(
|
|
174
|
+
"manualDialog.hint.editor",
|
|
175
|
+
"Enter submit · Shift+Enter newline · Tab/Shift+Tab focus · Esc cancel"
|
|
176
|
+
);
|
|
135
177
|
|
|
136
178
|
if (focusTarget === "git") {
|
|
137
|
-
interactionHint =
|
|
138
|
-
"
|
|
179
|
+
interactionHint = t(
|
|
180
|
+
"manualDialog.hint.git",
|
|
181
|
+
"↑/↓ or Space choose · Enter next · Tab/Shift+Tab focus · Esc cancel"
|
|
182
|
+
);
|
|
139
183
|
} else if (focusTarget === "actions") {
|
|
140
|
-
interactionHint =
|
|
141
|
-
"
|
|
184
|
+
interactionHint = t(
|
|
185
|
+
"manualDialog.hint.actions",
|
|
186
|
+
"←/→ choose · Enter/Space activate · Tab/Shift+Tab focus · Esc cancel"
|
|
187
|
+
);
|
|
142
188
|
}
|
|
143
189
|
|
|
144
190
|
const submit = focusTarget === "actions" && actionIndex === 0;
|
|
145
191
|
|
|
146
192
|
const submitLabel = submit
|
|
147
|
-
? theme.fg("accent", "[Submit]")
|
|
148
|
-
: theme.fg("text", "[Submit]");
|
|
193
|
+
? theme.fg("accent", t("manualDialog.submit", "[Submit]"))
|
|
194
|
+
: theme.fg("text", t("manualDialog.submit", "[Submit]"));
|
|
149
195
|
|
|
150
196
|
const cancel = focusTarget === "actions" && actionIndex === 1;
|
|
151
197
|
|
|
152
198
|
const cancelLabel = cancel
|
|
153
|
-
? theme.fg("accent", "[Cancel]")
|
|
154
|
-
: theme.fg("text", "[Cancel]");
|
|
199
|
+
? theme.fg("accent", t("manualDialog.cancel", "[Cancel]"))
|
|
200
|
+
: theme.fg("text", t("manualDialog.cancel", "[Cancel]"));
|
|
155
201
|
|
|
156
202
|
const actionButtons = `${submitLabel} ${cancelLabel}`;
|
|
157
203
|
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
KeybindingsManager,
|
|
8
8
|
} from "@earendil-works/pi-tui";
|
|
9
9
|
|
|
10
|
+
import { t } from "../i18n.ts";
|
|
10
11
|
import type { RenderRequester } from "./types.ts";
|
|
11
12
|
|
|
12
13
|
interface SearchableModelListOptions {
|
|
@@ -98,7 +99,9 @@ export class SearchableModelList implements Component, Focusable {
|
|
|
98
99
|
lines.push(` ${this.theme.fg("accent", this.theme.bold(this.title))}`);
|
|
99
100
|
const inputLines = this.searchInput.render(Math.max(1, width - 10));
|
|
100
101
|
lines.push(
|
|
101
|
-
` ${this.theme.fg("accent", "Search:
|
|
102
|
+
` ${this.theme.fg("accent", t("modelPicker.searchLabel", "Search:"))} ${
|
|
103
|
+
inputLines[0] || ""
|
|
104
|
+
}`,
|
|
102
105
|
""
|
|
103
106
|
);
|
|
104
107
|
|
|
@@ -115,7 +118,12 @@ export class SearchableModelList implements Component, Focusable {
|
|
|
115
118
|
const total = this.filteredOptions.length;
|
|
116
119
|
|
|
117
120
|
if (total === 0) {
|
|
118
|
-
lines.push(
|
|
121
|
+
lines.push(
|
|
122
|
+
` ${this.theme.fg(
|
|
123
|
+
"muted",
|
|
124
|
+
t("modelPicker.noMatches", "No matching models found.")
|
|
125
|
+
)}`
|
|
126
|
+
);
|
|
119
127
|
} else {
|
|
120
128
|
const startIndex = Math.max(
|
|
121
129
|
0,
|
|
@@ -211,8 +219,14 @@ export class SearchableModelList implements Component, Focusable {
|
|
|
211
219
|
|
|
212
220
|
private interactionHint(): string {
|
|
213
221
|
return this.multiSelect
|
|
214
|
-
?
|
|
215
|
-
|
|
222
|
+
? t(
|
|
223
|
+
"modelPicker.hintMulti",
|
|
224
|
+
"Type to search · ↑↓: navigate · Space: toggle · Enter: apply · Esc: cancel"
|
|
225
|
+
)
|
|
226
|
+
: t(
|
|
227
|
+
"modelPicker.hintSingle",
|
|
228
|
+
"Type to search · ↑↓: navigate · Enter: select · Esc: cancel"
|
|
229
|
+
);
|
|
216
230
|
}
|
|
217
231
|
|
|
218
232
|
private renderOption(item: string, index: number): string {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { visibleWidth } from "@earendil-works/pi-tui";
|
|
2
2
|
|
|
3
3
|
import { DEFAULT_EFFORT_LEVEL } from "../commands/model-options.ts";
|
|
4
|
+
import { t } from "../i18n.ts";
|
|
4
5
|
import type { ContextPreset } from "./types.ts";
|
|
5
6
|
|
|
6
7
|
export const TOGGLE_VALUES = ["On", "Off"];
|
|
@@ -129,9 +130,11 @@ export const contextDescription = (
|
|
|
129
130
|
const markerLabel = `${" ".repeat(labelStart)}${label}`;
|
|
130
131
|
|
|
131
132
|
const description =
|
|
132
|
-
exactIndex === -1
|
|
133
|
+
exactIndex === -1
|
|
134
|
+
? t("settings.context.customLimit", "Custom context limit.")
|
|
135
|
+
: selectedPreset?.description;
|
|
133
136
|
|
|
134
|
-
return `${description ?? "Custom context limit."}\n${meterPrefix}${meter} full\n${markerLabel}`;
|
|
137
|
+
return `${description ?? t("settings.context.customLimit", "Custom context limit.")}\n${meterPrefix}${meter} full\n${markerLabel}`;
|
|
135
138
|
};
|
|
136
139
|
|
|
137
140
|
export const currentEffort = (effort: string | undefined): string =>
|