pi-advisor-flow 0.15.1 → 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 +5 -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
@@ -2,6 +2,7 @@ import { getSettingsListTheme } from "@earendil-works/pi-coding-agent";
2
2
  import { SettingsList, truncateToWidth } from "@earendil-works/pi-tui";
3
3
  import type { Component, Focusable } from "@earendil-works/pi-tui";
4
4
 
5
+ import { t } from "../i18n.ts";
5
6
  import {
6
7
  rainbowGradient,
7
8
  SIMPLE_MODE_GRADIENT_INTERVAL_MS,
@@ -50,7 +51,10 @@ export class AdvisorSettingsSelector implements Component, Focusable {
50
51
  : [
51
52
  ...options.presets,
52
53
  {
53
- description: "Current custom context limit",
54
+ description: t(
55
+ "settingsSubmenu.customContextLimit",
56
+ "Current custom context limit"
57
+ ),
54
58
  label: String(configuredContext),
55
59
  value: configuredContext,
56
60
  },
@@ -99,7 +103,10 @@ export class AdvisorSettingsSelector implements Component, Focusable {
99
103
  const defaultLabel = listTheme.label;
100
104
  listTheme.label = (text, selected) => {
101
105
  if (this.settings.simpleMode && text.startsWith("Simple mode")) {
102
- return `${rainbowGradient("Simple mode", this.simpleModeGradientStartedAt ?? 0)}${text.slice("Simple mode".length)}`;
106
+ return `${rainbowGradient(
107
+ t("settings.simpleMode.label", "Simple mode"),
108
+ this.simpleModeGradientStartedAt ?? 0
109
+ )}${text.slice("Simple mode".length)}`;
103
110
  }
104
111
 
105
112
  return defaultLabel(text, selected);
@@ -1,6 +1,7 @@
1
1
  import { Input, truncateToWidth } 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 type { TextSettingSubmenuOptions } from "./types.ts";
5
6
 
6
7
  /** Small inline editor used by SettingsList for the two free-form settings. */
@@ -60,7 +61,13 @@ export class TextSettingSubmenu implements Component, Focusable {
60
61
  lines.push(theme.fg("error", ` ${this.error}`));
61
62
  }
62
63
 
63
- lines.push("", theme.fg("dim", " Enter: apply · Esc: cancel"));
64
+ lines.push(
65
+ "",
66
+ theme.fg(
67
+ "dim",
68
+ ` ${t("textSetting.hint", "Enter: apply · Esc: cancel")}`
69
+ )
70
+ );
64
71
 
65
72
  return lines.map((line) => truncateToWidth(line, width));
66
73
  }
package/src/usage.ts CHANGED
@@ -2,6 +2,7 @@ import type { Usage } from "@earendil-works/pi-ai/compat";
2
2
 
3
3
  import { isNumber, isRecordOf } from "./content-utils.ts";
4
4
  import type { JsonValue, RecordValue } from "./content-utils.ts";
5
+ import { t } from "./i18n.ts";
5
6
 
6
7
  export interface AdvisorUsageSnapshot {
7
8
  cacheRead?: number;
@@ -287,9 +288,14 @@ export const formatAdvisorUsageTotals = (totals: AdvisorUsageTotals) => {
287
288
  const missing = totals.calls - totals.knownCalls;
288
289
 
289
290
  return (
290
- [usage, missing > 0 ? `${missing} without usage data` : undefined]
291
+ [
292
+ usage,
293
+ missing > 0
294
+ ? `${missing} ${t("usage.withoutData", "without usage data")}`
295
+ : undefined,
296
+ ]
291
297
  .filter((value): value is string => value !== undefined)
292
- .join(" · ") || "unavailable"
298
+ .join(" · ") || t("usage.unavailable", "unavailable")
293
299
  );
294
300
  };
295
301
 
@@ -298,5 +304,5 @@ export const formatAdvisorUsageStatus = (totals: AdvisorUsageTotals) => {
298
304
  return undefined;
299
305
  }
300
306
 
301
- return `Advisor: ${totals.calls} call${totals.calls === 1 ? "" : "s"} · ${formatAdvisorUsageTotals(totals)}`;
307
+ return `${t("usage.advisorPrefix", "Advisor:")} ${totals.calls} ${totals.calls === 1 ? t("usage.call", "call") : t("usage.calls", "calls")} · ${formatAdvisorUsageTotals(totals)}`;
302
308
  };