pi-advisor-flow 0.15.1-dev.2 → 0.15.2-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.
Files changed (71) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +16 -1
  3. package/dist/index.js +1157 -502
  4. package/docs/README.md +9 -0
  5. package/docs/benchmark.md +22 -0
  6. package/docs/configuration.md +194 -0
  7. package/docs/development.md +38 -0
  8. package/docs/herdr.md +169 -0
  9. package/docs/privacy.md +102 -0
  10. package/extensions/index.ts +23 -0
  11. package/locales/de.json +330 -0
  12. package/locales/en.json +331 -0
  13. package/locales/es.json +3 -0
  14. package/locales/fr.json +330 -0
  15. package/locales/pt-BR.json +3 -0
  16. package/locales/pt.json +3 -0
  17. package/locales/ru.json +3 -0
  18. package/locales/uk.json +3 -0
  19. package/locales/zh.json +3 -0
  20. package/package.json +15 -2
  21. package/skills/pi-advisor-flow/SKILL.md +62 -0
  22. package/src/commands/activation-preparation.ts +9 -2
  23. package/src/commands/activation.ts +28 -8
  24. package/src/commands/configuration-tool-models.ts +143 -0
  25. package/src/commands/configuration-tool-policy.ts +177 -0
  26. package/src/commands/configuration-tool-preview.ts +228 -0
  27. package/src/commands/configuration-tool-runtime.ts +40 -0
  28. package/src/commands/configuration-tool-transaction.ts +120 -0
  29. package/src/commands/configuration-tool-update.ts +230 -0
  30. package/src/commands/configuration-tool.ts +89 -0
  31. package/src/commands/lifecycle.ts +6 -1
  32. package/src/commands/manual-consultation.ts +6 -1
  33. package/src/commands/manual-progress.ts +4 -3
  34. package/src/commands/model-commands.ts +2 -1
  35. package/src/commands/model-options.ts +4 -6
  36. package/src/commands/model-picker.ts +16 -6
  37. package/src/commands/registration.ts +2 -0
  38. package/src/commands/runtime.ts +17 -4
  39. package/src/commands/settings-commands.ts +30 -7
  40. package/src/config/schema-validators.ts +104 -0
  41. package/src/config/schema.ts +35 -102
  42. package/src/config/storage.ts +160 -7
  43. package/src/i18n.ts +31 -0
  44. package/src/scout-group-serialization.ts +66 -0
  45. package/src/scout-groups.ts +3 -66
  46. package/src/scout-selection.ts +99 -0
  47. package/src/scout.ts +6 -93
  48. package/src/session-state.ts +27 -137
  49. package/src/tool-input-normalization.ts +119 -0
  50. package/src/tools/gate-policy.ts +13 -5
  51. package/src/tools/jev-filter.ts +2 -1
  52. package/src/tools/jev-turn-gate.ts +2 -1
  53. package/src/tools/register-lifecycle.ts +5 -1
  54. package/src/tools/register-outcome.ts +5 -1
  55. package/src/tools/register-renderers.ts +5 -2
  56. package/src/tools/render-advisor-result.ts +20 -8
  57. package/src/tools/render-common.ts +16 -4
  58. package/src/tools/scout-status.ts +10 -2
  59. package/src/ui/jev-classifier-submenu.ts +143 -38
  60. package/src/ui/jev-filter-submenu.ts +52 -14
  61. package/src/ui/jev-provider-submenu-view.ts +72 -20
  62. package/src/ui/jev-provider-submenu.ts +40 -12
  63. package/src/ui/jev-setup-support.ts +48 -19
  64. package/src/ui/manual-dialog-render.ts +71 -25
  65. package/src/ui/searchable-model-list.ts +18 -4
  66. package/src/ui/settings-formatting.ts +5 -2
  67. package/src/ui/settings-items-jev.ts +216 -0
  68. package/src/ui/settings-items.ts +216 -259
  69. package/src/ui/settings-selector.ts +9 -2
  70. package/src/ui/text-setting-submenu.ts +8 -1
  71. package/src/usage.ts +9 -3
@@ -1,5 +1,6 @@
1
1
  import { truncateToWidth } from "@earendil-works/pi-tui";
2
2
 
3
+ import { t } from "../i18n.ts";
3
4
  import {
4
5
  canClearCredential,
5
6
  providerName,
@@ -47,19 +48,21 @@ export const setupActions = (
47
48
  const setupLabels = (state: JevProviderViewState): string[] =>
48
49
  setupActions(state).map((action) => {
49
50
  if (action === "clear-stored-key") {
50
- return "Clear stored key";
51
+ return t("jevSetup.clearStoredKey", "Clear stored key");
51
52
  }
52
53
 
53
54
  if (action === "done") {
54
- return "Done";
55
+ return t("jevSetup.done", "Done");
55
56
  }
56
57
 
57
58
  if (action === "enter-key") {
58
- return `Enter an API key for ${providerName(state.selectedTransport ?? "typesafe")}`;
59
+ return `${t("jevSetup.enterKeyFor", "Enter an API key for")} ${providerName(
60
+ state.selectedTransport ?? "typesafe"
61
+ )}`;
59
62
  }
60
63
 
61
64
  if (action === "reuse-provider-login") {
62
- return "Reuse a Pi provider login";
65
+ return t("jevSetup.reuseProviderLogin", "Reuse a Pi provider login");
63
66
  }
64
67
 
65
68
  if (action === "typesafe-compatible") {
@@ -79,18 +82,32 @@ const inputLines = (
79
82
 
80
83
  const titles = {
81
84
  "base-url": [
82
- "Base URL of a System One–compatible endpoint",
83
- "Origin, for example https://api.codiv.ai. /v1/systemone is appended; plain http works on localhost.",
85
+ t(
86
+ "jevSetup.baseUrlTitle",
87
+ "Base URL of a System One–compatible endpoint"
88
+ ),
89
+ t(
90
+ "jevSetup.baseUrlDesc",
91
+ "Origin, for example https://api.codiv.ai. /v1/systemone is appended; plain http works on localhost."
92
+ ),
84
93
  ],
85
94
  "key-entry": [
86
95
  providerName(state.selectedTransport ?? "typesafe"),
87
96
  state.selectedTransport === "openai-decisions"
88
- ? "No OpenAI Platform API key found. ChatGPT subscription OAuth is not accepted."
89
- : `No API key found for ${providerName(state.selectedTransport ?? "typesafe")}.`,
97
+ ? t(
98
+ "jevSetup.keyEntryNoOpenAiKey",
99
+ "No OpenAI Platform API key found. ChatGPT subscription OAuth is not accepted."
100
+ )
101
+ : `${t("jevSetup.keyEntryNoApiKeyFor", "No API key found for")} ${providerName(
102
+ state.selectedTransport ?? "typesafe"
103
+ )}.`,
90
104
  ],
91
105
  "provider-id": [
92
- "Pi provider id",
93
- "The Pi provider whose stored login supplies this endpoint's key, for example openrouter.",
106
+ t("jevSetup.providerIdTitle", "Pi provider id"),
107
+ t(
108
+ "jevSetup.providerIdDesc",
109
+ "The Pi provider whose stored login supplies this endpoint's key, for example openrouter."
110
+ ),
94
111
  ],
95
112
  } as const;
96
113
 
@@ -106,22 +123,40 @@ export const renderJevProvider = (
106
123
  width: number
107
124
  ): string[] => {
108
125
  const { theme } = options;
109
- const lines = [theme.fg("accent", theme.bold(" Jev provider")), ""];
126
+
127
+ const lines = [
128
+ theme.fg("accent", theme.bold(` ${t("jevSetup.title", "Jev provider")}`)),
129
+ "",
130
+ ];
110
131
 
111
132
  if (state.credentials) {
112
- lines.push(` Credential: ${transportLabel(state.credentials)}`);
133
+ lines.push(
134
+ ` ${t("jevSetup.credentialLabel", "Credential:")} ${transportLabel(
135
+ state.credentials
136
+ )}`
137
+ );
113
138
  } else if (state.selectedTransport) {
114
- lines.push(` Selected provider: ${providerName(state.selectedTransport)}`);
139
+ lines.push(
140
+ ` ${t("jevSetup.selectedProviderLabel", "Selected provider:")} ${providerName(
141
+ state.selectedTransport
142
+ )}`
143
+ );
115
144
  } else {
116
- lines.push(` Saved transport: ${options.currentTransport}`);
145
+ lines.push(
146
+ ` ${t("jevSetup.savedTransportLabel", "Saved transport:")} ${
147
+ options.currentTransport
148
+ }`
149
+ );
117
150
  }
118
151
 
119
152
  if (state.baseUrl) {
120
- lines.push(` Base URL: ${state.baseUrl}`);
153
+ lines.push(` ${t("jevSetup.baseUrlLabel", "Base URL:")} ${state.baseUrl}`);
121
154
  }
122
155
 
123
156
  if (state.providerId) {
124
- lines.push(` Pi provider: ${state.providerId}`);
157
+ lines.push(
158
+ ` ${t("jevSetup.piProviderLabel", "Pi provider:")} ${state.providerId}`
159
+ );
125
160
  }
126
161
 
127
162
  if (state.notice) {
@@ -131,11 +166,23 @@ export const renderJevProvider = (
131
166
  lines.push("");
132
167
 
133
168
  if (state.mode === "resolving") {
134
- lines.push(" Checking the selected provider credentials…");
169
+ lines.push(
170
+ ` ${t(
171
+ "jevSetup.checkingCredentials",
172
+ "Checking the selected provider credentials…"
173
+ )}`
174
+ );
135
175
  } else if (state.mode === "verifying") {
136
- lines.push(" Verifying with a live Jev call…");
176
+ lines.push(
177
+ ` ${t("jevSetup.verifyingLiveCall", "Verifying with a live Jev call…")}`
178
+ );
137
179
  } else if (state.mode === "clearing") {
138
- lines.push(" Clearing the selected provider's stored key…");
180
+ lines.push(
181
+ ` ${t(
182
+ "jevSetup.clearingKey",
183
+ "Clearing the selected provider's stored key…"
184
+ )}`
185
+ );
139
186
  } else if (
140
187
  state.mode === "base-url" ||
141
188
  state.mode === "key-entry" ||
@@ -147,7 +194,12 @@ export const renderJevProvider = (
147
194
  lines.push(theme.fg("error", ` ${state.inputError}`));
148
195
  }
149
196
 
150
- lines.push(theme.fg("dim", " Enter: continue · Esc: return"));
197
+ lines.push(
198
+ theme.fg(
199
+ "dim",
200
+ ` ${t("jevSetup.inputHint", "Enter: continue · Esc: return")}`
201
+ )
202
+ );
151
203
  } else {
152
204
  for (const [index, label] of setupLabels(state).entries()) {
153
205
  const prefix = index === state.selectedIndex ? "→ " : " ";
@@ -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 = `Setup failed: ${message}`;
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
- "Enter a single Pi provider id, for example openrouter.";
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 = `No stored login for Pi provider "${providerId}". Add one in Pi and retry.`;
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 = `Credential lookup failed: ${error instanceof Error ? error.message : String(error)}`;
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 = "No OpenRouter Pi login found. Add one in Pi and retry.";
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
- "The selected provider did not resolve matching credentials.";
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 = `Verification failed: ${outcome.message ?? "unknown error"}`;
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} Verification succeeded.`;
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 = "Provider verified, but settings could not be saved.";
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 "System One–compatible endpoint";
98
+ return t(
99
+ "jevSetup.provider.typesafeCompatible",
100
+ "System One–compatible endpoint"
101
+ );
98
102
  }
99
103
 
100
- return `OpenAI Decisions (${OPENAI_DECISIONS_MODEL})`;
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 "OpenRouter (reusing Pi login)";
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 `System One–compatible (${credentials.baseUrl ?? "no Base URL"}; key: ${endpointSourceLabel(credentials.source)})`;
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 `OpenAI Decisions (${OPENAI_DECISIONS_MODEL}; key: ${source})`;
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 "TypeSafe (key: advisor.json — plaintext, not recommended)";
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 "TypeSafe (key: Bun.secrets)";
190
+ return t(
191
+ "jevSetup.credential.typesafeBunSecrets",
192
+ "TypeSafe (key: Bun.secrets)"
193
+ );
171
194
  }
172
195
 
173
196
  case "file": {
174
- return "TypeSafe (key: stored file, mode 0600)";
197
+ return t(
198
+ "jevSetup.credential.typesafeFile",
199
+ "TypeSafe (key: stored file, mode 0600)"
200
+ );
175
201
  }
176
202
 
177
203
  default: {
178
- return "TypeSafe (key: TYPESAFE_API_KEY)";
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
- const MANUAL_GIT_CONTEXT_COPY: Record<
11
- GitContextLevel,
12
- { description: string; label: string }
13
- > = {
14
- full: { description: "summary plus patch", label: "Full" },
15
- off: { description: "no Git data", label: "None" },
16
- summary: { description: "changed paths and status", label: "Summary" },
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("Message for Advisor (optional)")}`
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
- "Automatic context follows your settings: conversation history, tool disclosure, project preferences, redaction, and configured limits remain unchanged.",
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
- "This dialog does not expose drafts or explicit file handoff controls.",
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
- "Git None only withholds repository data; it does not remove configured conversation history.",
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
- const gitCeiling = MANUAL_GIT_CONTEXT_COPY[gitContext].label;
147
+
148
+ const gitCeiling = gitContextCopy(gitContext).label;
149
+
112
150
  addLine(
113
151
  `${focusMarker("git")}${theme.bold(
114
- `Git repository context (max: ${gitCeiling}; ↑/↓ or Space to choose)`
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 = MANUAL_GIT_CONTEXT_COPY[level];
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
- "Enter submit · Shift+Enter newline · Tab/Shift+Tab focus · Esc cancel";
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
- "↑/↓ or Space choose · Enter next · Tab/Shift+Tab focus · Esc cancel";
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
- "←/→ choose · Enter/Space activate · Tab/Shift+Tab focus · Esc cancel";
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: ")}${inputLines[0] || ""}`,
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(` ${this.theme.fg("muted", "No matching models found.")}`);
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
- ? "Type to search · ↑↓: navigate · Space: toggle · Enter: apply · Esc: cancel"
215
- : "Type to search · ↑↓: navigate · Enter: select · Esc: cancel";
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 ? "Custom context limit." : selectedPreset?.description;
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 =>