pi-advisor-flow 0.5.6 → 0.6.0

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 (75) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/index.js +1371 -1128
  3. package/extensions/index.ts +9 -9
  4. package/package.json +3 -1
  5. package/src/{untracked.ts → attachments.ts} +2 -5
  6. package/src/commands/activation-preparation.ts +6 -6
  7. package/src/commands/activation.ts +7 -7
  8. package/src/commands/lifecycle.ts +5 -5
  9. package/src/commands/manual-command.ts +13 -9
  10. package/src/commands/manual-consultation.ts +8 -8
  11. package/src/commands/manual-progress.ts +3 -3
  12. package/src/commands/model-commands.ts +6 -6
  13. package/src/commands/model-options.ts +4 -4
  14. package/src/commands/model-picker.ts +2 -2
  15. package/src/commands/registration.ts +8 -8
  16. package/src/commands/renderers.ts +5 -5
  17. package/src/commands/runtime.ts +8 -8
  18. package/src/commands/settings-commands.ts +8 -8
  19. package/src/commands/settings-persistence.ts +4 -4
  20. package/src/commands/types.ts +5 -13
  21. package/src/commands.ts +2 -2
  22. package/src/config/args.ts +3 -3
  23. package/src/config/defaults.ts +3 -3
  24. package/src/config/schema.ts +322 -0
  25. package/src/config/state.ts +2 -2
  26. package/src/config/storage.ts +20 -117
  27. package/src/config/types.ts +1 -1
  28. package/src/config/validation.ts +61 -181
  29. package/src/config.ts +7 -7
  30. package/src/content-utils.ts +30 -0
  31. package/src/conversation.ts +13 -168
  32. package/src/git.ts +4 -18
  33. package/src/herdr.ts +6 -8
  34. package/src/model-stream.ts +5 -8
  35. package/src/outcomes.ts +2 -5
  36. package/src/pi-settings.ts +59 -0
  37. package/src/preferences.ts +2 -2
  38. package/src/redaction.ts +50 -0
  39. package/src/scout-context.ts +121 -485
  40. package/src/scout-curation.ts +84 -0
  41. package/src/scout-groups.ts +485 -0
  42. package/src/scout-protocol.ts +122 -0
  43. package/src/scout-reconstruct.ts +44 -0
  44. package/src/scout-types.ts +66 -0
  45. package/src/scout.ts +53 -63
  46. package/src/session-state.ts +119 -76
  47. package/src/tool-result-cap.ts +88 -0
  48. package/src/tools/consult-context.ts +155 -0
  49. package/src/tools/consultation.ts +71 -220
  50. package/src/tools/gate-policy.ts +5 -5
  51. package/src/tools/gate-protocol.ts +2 -2
  52. package/src/tools/loop-gate.ts +70 -61
  53. package/src/tools/prompts.ts +4 -7
  54. package/src/tools/register-ask-advisor.ts +9 -14
  55. package/src/tools/register-lifecycle.ts +7 -7
  56. package/src/tools/register-outcome.ts +5 -5
  57. package/src/tools/register-renderers.ts +5 -5
  58. package/src/tools/registration.ts +10 -10
  59. package/src/tools/render-advisor-result.ts +11 -8
  60. package/src/tools/render-common.ts +25 -13
  61. package/src/tools/scout-status.ts +5 -5
  62. package/src/tools/session.ts +1 -1
  63. package/src/tools/types.ts +7 -7
  64. package/src/tools.ts +9 -9
  65. package/src/ui/manual-dialog-render.ts +2 -2
  66. package/src/ui/manual-dialog.ts +4 -9
  67. package/src/ui/model-selector.ts +1 -1
  68. package/src/ui/settings-formatting.ts +2 -2
  69. package/src/ui/settings-items.ts +4 -4
  70. package/src/ui/settings-mutations.ts +2 -2
  71. package/src/ui/settings-selector.ts +5 -5
  72. package/src/ui/text-setting-submenu.ts +1 -1
  73. package/src/ui/types.ts +2 -2
  74. package/src/ui.ts +4 -4
  75. package/src/usage.ts +1 -6
@@ -1,16 +1,16 @@
1
1
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
- import { registerCommands } from "../src/commands/registration.js";
3
- import { setHerdrBlockedEmitter } from "../src/herdr.js";
4
- import { AdvisorSessionState } from "../src/session-state.js";
2
+ import { registerCommands } from "../src/commands/registration.ts";
3
+ import { setHerdrBlockedEmitter } from "../src/herdr.ts";
4
+ import { AdvisorSessionState } from "../src/session-state.ts";
5
5
  import {
6
6
  consultAdvisor as consultAdvisorImplementation,
7
7
  runAdvisorGate as runAdvisorGateImplementation,
8
- } from "../src/tools/consultation.js";
9
- import { parseAutomaticDecision as parseAutomaticDecisionImplementation } from "../src/tools/gate-protocol.js";
10
- import { registerAdvisorTool } from "../src/tools/registration.js";
11
- import { ScoutStatusManager } from "../src/tools/scout-status.js";
8
+ } from "../src/tools/consultation.ts";
9
+ import { parseAutomaticDecision as parseAutomaticDecisionImplementation } from "../src/tools/gate-protocol.ts";
10
+ import { registerAdvisorTool } from "../src/tools/registration.ts";
11
+ import { ScoutStatusManager } from "../src/tools/scout-status.ts";
12
12
 
13
- export type { AdvisorConfig, GateFailureMode } from "../src/config/types.js";
13
+ export type { AdvisorConfig, GateFailureMode } from "../src/config/types.ts";
14
14
  export type {
15
15
  AdvisorConsultationResult,
16
16
  AdvisorGateFailure,
@@ -19,7 +19,7 @@ export type {
19
19
  ConsultationTrigger,
20
20
  GateDecision,
21
21
  GateTrigger,
22
- } from "../src/tools/types.js";
22
+ } from "../src/tools/types.ts";
23
23
  export const consultAdvisor = (
24
24
  ...args: Parameters<typeof consultAdvisorImplementation>
25
25
  ) => consultAdvisorImplementation(...args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-advisor-flow",
3
- "version": "0.5.6",
3
+ "version": "0.6.0",
4
4
  "description": "Advanced Executor/Advisor flow for Pi, fully configurable and extendable.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -36,6 +36,7 @@
36
36
  "build": "bun build ./extensions/index.ts --outfile dist/index.js --target node --format esm --external @earendil-works/pi-ai --external @earendil-works/pi-coding-agent --external @earendil-works/pi-tui --external typebox",
37
37
  "check:boundaries": "node scripts/check-module-boundaries.mjs",
38
38
  "format": "bunx ultracite fix --linter-enabled=false",
39
+ "knip": "knip",
39
40
  "lint": "bunx ultracite check",
40
41
  "lint:fix": "bunx ultracite fix",
41
42
  "prepack": "bun run build >/dev/null",
@@ -68,6 +69,7 @@
68
69
  "@types/node": "^26.4.1",
69
70
  "bun-types": "1.4.1",
70
71
  "husky": "^9.1.7",
72
+ "knip": "^6.35.1",
71
73
  "lint-staged": "^17.4.1",
72
74
  "typebox": "^1.3.25",
73
75
  "typescript": "^7.0.2",
@@ -2,18 +2,15 @@ import { execFileSync } from "node:child_process";
2
2
  import { constants } from "node:fs";
3
3
  import { lstat, open, realpath } from "node:fs/promises";
4
4
  import { isAbsolute, relative, resolve } from "node:path";
5
- import { redactAndCapText } from "./conversation.js";
5
+ import { redactAndCapText } from "./redaction.ts";
6
6
 
7
7
  export const ADVISOR_FILE_MAX_BYTES = 8 * 1024;
8
- export const ADVISOR_FILES_TOTAL_MAX_BYTES = 24 * 1024;
9
- export const UNTRACKED_FILE_MAX_BYTES = ADVISOR_FILE_MAX_BYTES;
10
- export const UNTRACKED_TOTAL_MAX_BYTES = ADVISOR_FILES_TOTAL_MAX_BYTES;
8
+ const ADVISOR_FILES_TOTAL_MAX_BYTES = 24 * 1024;
11
9
  export interface UntrackedAttachment {
12
10
  bytes: number;
13
11
  path: string;
14
12
  text: string;
15
13
  }
16
- export type TrackedAttachment = UntrackedAttachment;
17
14
 
18
15
  const PATH_SEGMENTS = /[\\/]/;
19
16
 
@@ -9,16 +9,16 @@ import {
9
9
  setAdvisorRef,
10
10
  setExecutorEffortRef,
11
11
  setExecutorRef,
12
- } from "../config/state.js";
13
- import { loadConfig } from "../config/storage.js";
12
+ } from "../config/state.ts";
13
+ import { loadConfig } from "../config/storage.ts";
14
14
  import {
15
15
  getAvailableModelRefs,
16
16
  getExplicitModelError,
17
17
  planActivationModels,
18
- } from "./model-options.js";
19
- import { selectAdvisorModels } from "./model-picker.js";
20
- import { notify } from "./runtime.js";
21
- import type { CommandRuntime } from "./types.js";
18
+ } from "./model-options.ts";
19
+ import { selectAdvisorModels } from "./model-picker.ts";
20
+ import { notify } from "./runtime.ts";
21
+ import type { CommandRuntime } from "./types.ts";
22
22
 
23
23
  export interface PreparedActivationModels {
24
24
  pendingExecutor?: string;
@@ -1,5 +1,5 @@
1
1
  import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
- import { parseArgs } from "../config/args.js";
2
+ import { parseArgs } from "../config/args.ts";
3
3
  import {
4
4
  advisorEffortRef,
5
5
  advisorRef,
@@ -11,20 +11,20 @@ import {
11
11
  setContextMaxCharsRef,
12
12
  setExecutorEffortRef,
13
13
  setExecutorRef,
14
- } from "../config/state.js";
15
- import { saveConfig } from "../config/storage.js";
14
+ } from "../config/state.ts";
15
+ import { saveConfig } from "../config/storage.ts";
16
16
  import {
17
17
  loadCommandConfig,
18
18
  prepareActivationModels,
19
- } from "./activation-preparation.js";
19
+ } from "./activation-preparation.ts";
20
20
  import {
21
21
  ADVISOR_ACTIVATION_EXPLANATION,
22
22
  findConfiguredModel,
23
23
  hasAdvisorOverride,
24
24
  hasExecutorOverride,
25
- } from "./model-options.js";
26
- import { notify } from "./runtime.js";
27
- import type { CommandRuntime, ThinkingLevel } from "./types.js";
25
+ } from "./model-options.ts";
26
+ import { notify } from "./runtime.ts";
27
+ import type { CommandRuntime, ThinkingLevel } from "./types.ts";
28
28
 
29
29
  const resolveActivationModels = async (
30
30
  runtime: CommandRuntime,
@@ -4,11 +4,11 @@ import {
4
4
  executorRef,
5
5
  getPersistedModelRefs,
6
6
  setExecutorRef,
7
- } from "../config/state.js";
8
- import { loadConfig, saveConfig } from "../config/storage.js";
9
- import { herdrAdvisorActivity } from "../herdr.js";
10
- import { notify } from "./runtime.js";
11
- import type { CommandRuntime } from "./types.js";
7
+ } from "../config/state.ts";
8
+ import { loadConfig, saveConfig } from "../config/storage.ts";
9
+ import { herdrAdvisorActivity } from "../herdr.ts";
10
+ import { notify } from "./runtime.ts";
11
+ import type { CommandRuntime } from "./types.ts";
12
12
 
13
13
  export type ActivateAdvisor = (
14
14
  args: string,
@@ -2,14 +2,14 @@ import {
2
2
  getAdvisorMaxCallsPerSession,
3
3
  getAdvisorSettings,
4
4
  isSimpleMode,
5
- } from "../config/state.js";
6
- import type { GitContextLevel } from "../git.js";
7
- import { resolveAdvisorRequest } from "../tools/render-common.js";
8
- import { ManualAdvisorDialog } from "../ui/manual-dialog.js";
9
- import type { ManualAdvisorRequest } from "../ui/types.js";
10
- import { loadCommandConfig } from "./activation-preparation.js";
11
- import { startManualConsultation } from "./manual-consultation.js";
12
- import type { CommandRuntime, ManualAdvisorProgressState } from "./types.js";
5
+ } from "../config/state.ts";
6
+ import type { GitContextLevel } from "../git.ts";
7
+ import { resolveAdvisorRequest } from "../tools/render-common.ts";
8
+ import { ManualAdvisorDialog } from "../ui/manual-dialog.ts";
9
+ import type { ManualAdvisorRequest } from "../ui/types.ts";
10
+ import { loadCommandConfig } from "./activation-preparation.ts";
11
+ import { startManualConsultation } from "./manual-consultation.ts";
12
+ import type { CommandRuntime, ManualAdvisorProgressState } from "./types.ts";
13
13
 
14
14
  export const registerManualCommand = (runtime: CommandRuntime) => {
15
15
  runtime.pi.registerCommand("advisor-manual", {
@@ -93,7 +93,11 @@ export const registerManualCommand = (runtime: CommandRuntime) => {
93
93
  runtime.scoutStatus.register(scoutStatusToken);
94
94
  runtime.manualConsultations.set(controller, scoutStatusToken);
95
95
  runtime.pi.appendEntry?.("advisor-manual-call", { progressId, question });
96
- startManualConsultation(
96
+ // Intentional fire-and-forget: the consultation streams after the command
97
+ // handler returns. void satisfies noFloatingPromises; noVoid is ignored here
98
+ // because this Biome version offers no ignoreVoidAsExpression option.
99
+ // biome-ignore lint/complexity/noVoid: marks an intentional fire-and-forget promise
100
+ void startManualConsultation(
97
101
  runtime,
98
102
  ctx,
99
103
  question,
@@ -1,12 +1,12 @@
1
1
  import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
- import { advisorRef } from "../config/state.js";
3
- import type { GitContextLevel } from "../git.js";
4
- import { herdrAdvisorActivity, notifyHerdrAdvisorFailure } from "../herdr.js";
5
- import { appendScoutLifecycleEntry } from "../tools/scout-status.js";
6
- import type { ScoutToolDetails } from "../tools/types.js";
7
- import { advisorUsageCost, snapshotAdvisorUsage } from "../usage.js";
8
- import { notify } from "./runtime.js";
9
- import type { CommandRuntime, ManualAdvisorProgressState } from "./types.js";
2
+ import { advisorRef } from "../config/state.ts";
3
+ import type { GitContextLevel } from "../git.ts";
4
+ import { herdrAdvisorActivity, notifyHerdrAdvisorFailure } from "../herdr.ts";
5
+ import { appendScoutLifecycleEntry } from "../tools/scout-status.ts";
6
+ import type { ScoutToolDetails } from "../tools/types.ts";
7
+ import { advisorUsageCost, snapshotAdvisorUsage } from "../usage.ts";
8
+ import { notify } from "./runtime.ts";
9
+ import type { CommandRuntime, ManualAdvisorProgressState } from "./types.ts";
10
10
 
11
11
  export const startManualConsultation = (
12
12
  runtime: CommandRuntime,
@@ -5,9 +5,9 @@ import {
5
5
  renderAdvisorCallBox,
6
6
  renderThinkingMarkdown,
7
7
  SPINNER_FRAMES,
8
- } from "../tools/render-common.js";
9
- import { renderScoutDetails } from "../tools/scout-status.js";
10
- import type { ManualAdvisorProgressState } from "./types.js";
8
+ } from "../tools/render-common.ts";
9
+ import { renderScoutDetails } from "../tools/scout-status.ts";
10
+ import type { ManualAdvisorProgressState } from "./types.ts";
11
11
 
12
12
  export class ManualAdvisorProgressComponent implements Component {
13
13
  private readonly question: string | undefined;
@@ -8,12 +8,12 @@ import {
8
8
  setAdvisorRef,
9
9
  setExecutorEffortRef,
10
10
  setExecutorRef,
11
- } from "../config/state.js";
12
- import { saveConfig } from "../config/storage.js";
13
- import { activateAdvisor } from "./activation.js";
14
- import { loadCommandConfig } from "./activation-preparation.js";
15
- import { selectAdvisorModels } from "./model-picker.js";
16
- import type { CommandRuntime } from "./types.js";
11
+ } from "../config/state.ts";
12
+ import { saveConfig } from "../config/storage.ts";
13
+ import { activateAdvisor } from "./activation.ts";
14
+ import { loadCommandConfig } from "./activation-preparation.ts";
15
+ import { selectAdvisorModels } from "./model-picker.ts";
16
+ import type { CommandRuntime } from "./types.ts";
17
17
 
18
18
  export const registerModelCommands = (runtime: CommandRuntime) => {
19
19
  runtime.pi.registerCommand("advisor", {
@@ -1,9 +1,9 @@
1
1
  import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
- import { type getPersistedModelRefs, splitRef } from "../config/state.js";
3
- import type { ContextPreset } from "../ui/types.js";
2
+ import { type getPersistedModelRefs, splitRef } from "../config/state.ts";
3
+ import type { ContextPreset } from "../ui/types.ts";
4
4
 
5
5
  export const DEFAULT_EFFORT_LEVEL = "Default (Model Default)";
6
- export const SELECTED_PREFIX = "✓ ";
6
+ const SELECTED_PREFIX = "✓ ";
7
7
  export const EFFORT_LEVELS = [
8
8
  DEFAULT_EFFORT_LEVEL,
9
9
  "off",
@@ -105,7 +105,7 @@ export const getAvailableModelRefs = (
105
105
  .map((model) => `${model.provider}/${model.id}`);
106
106
  };
107
107
 
108
- export const isSelectableModel = (
108
+ const isSelectableModel = (
109
109
  ctx: ExtensionContext,
110
110
  ref: string | undefined,
111
111
  availableRefs: Set<string> | undefined
@@ -1,10 +1,10 @@
1
1
  import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
2
- import { SearchableModelSelector } from "../ui/model-selector.js";
2
+ import { SearchableModelSelector } from "../ui/model-selector.ts";
3
3
  import {
4
4
  effortChoices,
5
5
  getAvailableModelRefs,
6
6
  selectedEffort,
7
- } from "./model-options.js";
7
+ } from "./model-options.ts";
8
8
 
9
9
  export interface AdvisorModelSelection {
10
10
  advisor: string;
@@ -2,14 +2,14 @@ import type {
2
2
  ExtensionAPI,
3
3
  ExtensionContext,
4
4
  } from "@earendil-works/pi-coding-agent";
5
- import { activateAdvisor } from "./activation.js";
6
- import { registerCommandLifecycle } from "./lifecycle.js";
7
- import { registerManualCommand } from "./manual-command.js";
8
- import { registerModelCommands } from "./model-commands.js";
9
- import { registerCommandRenderers } from "./renderers.js";
10
- import { createCommandRuntime } from "./runtime.js";
11
- import { registerSettingsCommands } from "./settings-commands.js";
12
- import type { CommandDependencies } from "./types.js";
5
+ import { activateAdvisor } from "./activation.ts";
6
+ import { registerCommandLifecycle } from "./lifecycle.ts";
7
+ import { registerManualCommand } from "./manual-command.ts";
8
+ import { registerModelCommands } from "./model-commands.ts";
9
+ import { registerCommandRenderers } from "./renderers.ts";
10
+ import { createCommandRuntime } from "./runtime.ts";
11
+ import { registerSettingsCommands } from "./settings-commands.ts";
12
+ import type { CommandDependencies } from "./types.ts";
13
13
 
14
14
  export const registerCommands = (
15
15
  pi: ExtensionAPI,
@@ -1,15 +1,15 @@
1
1
  import { getMarkdownTheme } from "@earendil-works/pi-coding-agent";
2
2
  import { Box, Markdown, Text } from "@earendil-works/pi-tui";
3
- import { getAdvisorSettings } from "../config/state.js";
3
+ import { getAdvisorSettings } from "../config/state.ts";
4
4
  import {
5
5
  adviceForDisplay,
6
6
  hasSoundVerdict,
7
7
  renderAdvisorCallBox,
8
8
  renderAdvisorResponseHeader,
9
- } from "../tools/render-common.js";
10
- import { formatAdvisorUsage } from "../usage.js";
11
- import { ManualAdvisorProgressComponent } from "./manual-progress.js";
12
- import type { CommandRuntime } from "./types.js";
9
+ } from "../tools/render-common.ts";
10
+ import { formatAdvisorUsage } from "../usage.ts";
11
+ import { ManualAdvisorProgressComponent } from "./manual-progress.ts";
12
+ import type { CommandRuntime } from "./types.ts";
13
13
 
14
14
  export const registerCommandRenderers = (runtime: CommandRuntime) => {
15
15
  runtime.pi.registerEntryRenderer?.(
@@ -2,18 +2,18 @@ import type {
2
2
  ExtensionAPI,
3
3
  ExtensionContext,
4
4
  } from "@earendil-works/pi-coding-agent";
5
- import { getAdvisorSettings } from "../config/state.js";
6
- import { notifyHerdrAdvisorFailure } from "../herdr.js";
7
- import type { AdvisorSessionState } from "../session-state.js";
8
- import { consultAdvisor } from "../tools/consultation.js";
9
- import { ScoutStatusManager } from "../tools/scout-status.js";
10
- import { advisorSessionState as defaultAdvisorSessionState } from "../tools/session.js";
5
+ import { getAdvisorSettings } from "../config/state.ts";
6
+ import { notifyHerdrAdvisorFailure } from "../herdr.ts";
7
+ import type { AdvisorSessionState } from "../session-state.ts";
8
+ import { consultAdvisor } from "../tools/consultation.ts";
9
+ import { ScoutStatusManager } from "../tools/scout-status.ts";
10
+ import { advisorSessionState as defaultAdvisorSessionState } from "../tools/session.ts";
11
11
  import type {
12
12
  CommandDependencies,
13
13
  CommandRuntime as CommandRuntimeContract,
14
14
  ManualAdvisorProgressState,
15
15
  ManualConsult,
16
- } from "./types.js";
16
+ } from "./types.ts";
17
17
 
18
18
  export const notify = (
19
19
  ctx: ExtensionContext,
@@ -25,7 +25,7 @@ export const notify = (
25
25
  }
26
26
  };
27
27
 
28
- export class CommandRuntime implements CommandRuntimeContract {
28
+ class CommandRuntime implements CommandRuntimeContract {
29
29
  readonly advisorSessionState: AdvisorSessionState;
30
30
  readonly manualConsultations = new Map<AbortController, symbol>();
31
31
  readonly manualProgress = new Map<string, ManualAdvisorProgressState>();
@@ -3,14 +3,14 @@ import {
3
3
  getAdvisorSettings,
4
4
  getPersistedModelRefs,
5
5
  setAlwaysOnRef,
6
- } from "../config/state.js";
7
- import { saveConfig } from "../config/storage.js";
8
- import { AdvisorSettingsSelector } from "../ui/settings-selector.js";
9
- import { loadCommandConfig } from "./activation-preparation.js";
10
- import { CONTEXT_PRESETS, EFFORT_LEVELS } from "./model-options.js";
11
- import { notify } from "./runtime.js";
12
- import { saveAdvisorSettings } from "./settings-persistence.js";
13
- import type { CommandRuntime } from "./types.js";
6
+ } from "../config/state.ts";
7
+ import { saveConfig } from "../config/storage.ts";
8
+ import { AdvisorSettingsSelector } from "../ui/settings-selector.ts";
9
+ import { loadCommandConfig } from "./activation-preparation.ts";
10
+ import { CONTEXT_PRESETS, EFFORT_LEVELS } from "./model-options.ts";
11
+ import { notify } from "./runtime.ts";
12
+ import { saveAdvisorSettings } from "./settings-persistence.ts";
13
+ import type { CommandRuntime } from "./types.ts";
14
14
 
15
15
  export const registerSettingsCommands = (runtime: CommandRuntime) => {
16
16
  runtime.pi.registerCommand("advisor-settings", {
@@ -29,12 +29,12 @@ import {
29
29
  setShowUsageDetailsRef,
30
30
  setShowUsageFooterRef,
31
31
  setSimpleModeRef,
32
- } from "../config/state.js";
33
- import { saveConfig, saveGlobalOutcomeLogging } from "../config/storage.js";
34
- import type { AdvisorSettings } from "../ui/types.js";
32
+ } from "../config/state.ts";
33
+ import { saveConfig, saveGlobalOutcomeLogging } from "../config/storage.ts";
34
+ import type { AdvisorSettings } from "../ui/types.ts";
35
35
 
36
36
  // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: one settings form maps every persisted control.
37
- export const applyAdvisorSettings = (settings: AdvisorSettings) => {
37
+ const applyAdvisorSettings = (settings: AdvisorSettings) => {
38
38
  setAdvisorEffortRef(
39
39
  settings.effort === "Default (Model Default)" ? undefined : settings.effort
40
40
  );
@@ -1,13 +1,12 @@
1
1
  import type {
2
2
  ExtensionAPI,
3
3
  ExtensionContext,
4
- Theme,
5
4
  } from "@earendil-works/pi-coding-agent";
6
- import type { GitContextLevel } from "../git.js";
7
- import type { ScoutLifecycleEvent } from "../scout.js";
8
- import type { AdvisorSessionState } from "../session-state.js";
9
- import type { ScoutStatusManager } from "../tools/scout-status.js";
10
- import type { ScoutToolDetails } from "../tools/types.js";
5
+ import type { GitContextLevel } from "../git.ts";
6
+ import type { ScoutLifecycleEvent } from "../scout.ts";
7
+ import type { AdvisorSessionState } from "../session-state.ts";
8
+ import type { ScoutStatusManager } from "../tools/scout-status.ts";
9
+ import type { ScoutToolDetails } from "../tools/types.ts";
11
10
 
12
11
  export type ManualConsult = (
13
12
  ctx: ExtensionContext,
@@ -69,10 +68,3 @@ export interface CommandRuntime {
69
68
  suppressModelSelectionSync: boolean;
70
69
  updateAdvisorUsageStatus: (ctx: ExtensionContext) => void;
71
70
  }
72
-
73
- export interface ManualAdvisorProgressView {
74
- expanded: boolean;
75
- question: string | undefined;
76
- state: ManualAdvisorProgressState;
77
- theme: Theme;
78
- }
package/src/commands.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  // biome-ignore lint/performance/noBarrelFile: this facade intentionally preserves the public command module contract.
2
- export { registerCommands } from "./commands/registration.js";
2
+ export { registerCommands } from "./commands/registration.ts";
3
3
  export type {
4
4
  CommandDependencies,
5
5
  ManualAdvisorProgressPhase,
6
6
  ManualAdvisorProgressState,
7
7
  ManualConsult,
8
8
  ThinkingLevel,
9
- } from "./commands/types.js";
9
+ } from "./commands/types.ts";
@@ -5,9 +5,9 @@ import {
5
5
  setAdvisorRef,
6
6
  setContextMaxCharsRef,
7
7
  setExecutorRef,
8
- } from "./state.js";
9
- import { MAX_CONTEXT_MAX_CHARS } from "./types.js";
10
- import { isValidContextMaxChars } from "./validation.js";
8
+ } from "./state.ts";
9
+ import { MAX_CONTEXT_MAX_CHARS } from "./types.ts";
10
+ import { isValidContextMaxChars } from "./validation.ts";
11
11
 
12
12
  const ARGUMENT_WHITESPACE = /\s+/;
13
13
 
@@ -31,14 +31,14 @@ import {
31
31
  setShowUsageDetailsRef,
32
32
  setShowUsageFooterRef,
33
33
  setSimpleModeRef,
34
- } from "./state.js";
35
- import type { AdvisorConfig } from "./types.js";
34
+ } from "./state.ts";
35
+ import type { AdvisorConfig } from "./types.ts";
36
36
  import {
37
37
  DEFAULT_ADVISOR_GIT_CONTEXT_MAX_CHARS,
38
38
  DEFAULT_ADVISOR_TOOL_RESULT_MAX_BYTES,
39
39
  DEFAULT_ADVISOR_TOOL_RESULT_MAX_LINES,
40
40
  DEFAULT_CONTEXT_MAX_CHARS,
41
- } from "./types.js";
41
+ } from "./types.ts";
42
42
 
43
43
  export const resetDefaults = () => {
44
44
  setExecutorRef("");