@oh-my-pi/pi-coding-agent 16.1.7 → 16.1.9

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 (120) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/cli.js +4266 -3446
  3. package/dist/types/cli/flag-tables.d.ts +17 -0
  4. package/dist/types/cli/session-picker.d.ts +0 -1
  5. package/dist/types/cli/tiny-models-cli.d.ts +2 -0
  6. package/dist/types/cli-commands.d.ts +4 -2
  7. package/dist/types/collab/protocol.d.ts +20 -1
  8. package/dist/types/config/settings-schema.d.ts +57 -6
  9. package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +5 -1
  10. package/dist/types/internal-urls/filesystem-resource.d.ts +9 -0
  11. package/dist/types/mcp/loader.d.ts +3 -2
  12. package/dist/types/mcp/manager.d.ts +4 -3
  13. package/dist/types/mcp/startup-events.d.ts +21 -4
  14. package/dist/types/mnemopi/config.d.ts +1 -0
  15. package/dist/types/modes/components/agent-hub.d.ts +1 -0
  16. package/dist/types/modes/components/agent-transcript-viewer.d.ts +1 -0
  17. package/dist/types/modes/components/assistant-message.d.ts +5 -1
  18. package/dist/types/modes/components/btw-panel.d.ts +2 -0
  19. package/dist/types/modes/components/chat-transcript-builder.d.ts +1 -0
  20. package/dist/types/modes/components/session-selector.d.ts +0 -2
  21. package/dist/types/modes/controllers/btw-controller.d.ts +2 -0
  22. package/dist/types/modes/controllers/command-controller.d.ts +1 -1
  23. package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
  24. package/dist/types/modes/controllers/streaming-reveal.d.ts +3 -2
  25. package/dist/types/modes/interactive-mode.d.ts +4 -1
  26. package/dist/types/modes/types.d.ts +4 -1
  27. package/dist/types/session/agent-session.d.ts +18 -3
  28. package/dist/types/session/session-history-format.d.ts +25 -0
  29. package/dist/types/session/snapcompact-inline.d.ts +1 -1
  30. package/dist/types/slash-commands/builtin-registry.d.ts +7 -4
  31. package/dist/types/slash-commands/types.d.ts +2 -0
  32. package/dist/types/system-prompt.d.ts +1 -0
  33. package/dist/types/tiny/models.d.ts +11 -7
  34. package/dist/types/tools/browser/launch.d.ts +5 -0
  35. package/dist/types/tools/todo.d.ts +1 -0
  36. package/dist/types/utils/thinking-display.d.ts +2 -0
  37. package/package.json +12 -12
  38. package/src/advisor/__tests__/advisor.test.ts +104 -0
  39. package/src/advisor/runtime.ts +38 -2
  40. package/src/cli/args.ts +0 -1
  41. package/src/cli/flag-tables.ts +42 -0
  42. package/src/cli/profile-bootstrap.ts +1 -11
  43. package/src/cli/session-picker.ts +1 -2
  44. package/src/cli/tiny-models-cli.ts +7 -2
  45. package/src/cli-commands.ts +48 -3
  46. package/src/collab/guest.ts +172 -20
  47. package/src/collab/host.ts +47 -5
  48. package/src/collab/protocol.ts +16 -1
  49. package/src/config/model-registry.ts +6 -7
  50. package/src/config/settings-schema.ts +59 -5
  51. package/src/edit/renderer.ts +8 -12
  52. package/src/extensibility/legacy-pi-ai-shim.ts +16 -4
  53. package/src/internal-urls/docs-index.generated.txt +1 -1
  54. package/src/internal-urls/filesystem-resource.ts +34 -0
  55. package/src/internal-urls/local-protocol.ts +7 -1
  56. package/src/internal-urls/memory-protocol.ts +5 -1
  57. package/src/internal-urls/skill-protocol.ts +20 -4
  58. package/src/internal-urls/vault-protocol.ts +5 -2
  59. package/src/lsp/client.ts +39 -25
  60. package/src/main.ts +8 -8
  61. package/src/mcp/loader.ts +4 -3
  62. package/src/mcp/manager.ts +35 -15
  63. package/src/mcp/startup-events.ts +106 -11
  64. package/src/mnemopi/config.ts +2 -0
  65. package/src/mnemopi/state.ts +3 -1
  66. package/src/modes/components/agent-hub.ts +4 -0
  67. package/src/modes/components/agent-transcript-viewer.ts +2 -0
  68. package/src/modes/components/assistant-message.ts +217 -18
  69. package/src/modes/components/btw-panel.ts +15 -3
  70. package/src/modes/components/chat-transcript-builder.ts +8 -2
  71. package/src/modes/components/model-selector.ts +72 -9
  72. package/src/modes/components/omfg-panel.ts +1 -1
  73. package/src/modes/components/session-selector.ts +4 -9
  74. package/src/modes/components/snapcompact-shape-preview.ts +1 -1
  75. package/src/modes/components/tool-execution.ts +10 -2
  76. package/src/modes/controllers/btw-controller.ts +32 -7
  77. package/src/modes/controllers/command-controller.ts +18 -3
  78. package/src/modes/controllers/event-controller.ts +24 -4
  79. package/src/modes/controllers/input-controller.ts +43 -21
  80. package/src/modes/controllers/mcp-command-controller.ts +40 -12
  81. package/src/modes/controllers/selector-controller.ts +23 -13
  82. package/src/modes/controllers/streaming-reveal.ts +78 -20
  83. package/src/modes/controllers/todo-command-controller.ts +9 -10
  84. package/src/modes/interactive-mode.ts +84 -9
  85. package/src/modes/types.ts +4 -1
  86. package/src/modes/utils/ui-helpers.ts +1 -0
  87. package/src/prompts/advisor/system.md +1 -1
  88. package/src/prompts/system/side-channel-no-tools.md +3 -0
  89. package/src/sdk.ts +12 -8
  90. package/src/session/agent-session.ts +385 -85
  91. package/src/session/history-storage.ts +15 -16
  92. package/src/session/session-history-format.ts +41 -1
  93. package/src/session/snapcompact-inline.ts +9 -6
  94. package/src/slash-commands/builtin-registry.ts +171 -87
  95. package/src/slash-commands/helpers/todo.ts +12 -6
  96. package/src/slash-commands/types.ts +2 -0
  97. package/src/system-prompt.ts +6 -11
  98. package/src/tiny/models.ts +7 -3
  99. package/src/tiny/title-client.ts +8 -2
  100. package/src/tiny/worker.ts +1 -0
  101. package/src/tools/browser/launch.ts +107 -31
  102. package/src/tools/puppeteer/00_stealth_tampering.txt +16 -35
  103. package/src/tools/puppeteer/01_stealth_activity.txt +79 -19
  104. package/src/tools/puppeteer/02_stealth_hairline.txt +57 -11
  105. package/src/tools/puppeteer/03_stealth_botd.txt +10 -14
  106. package/src/tools/puppeteer/04_stealth_iframe.txt +156 -63
  107. package/src/tools/puppeteer/05_stealth_webgl.txt +222 -64
  108. package/src/tools/puppeteer/06_stealth_screen.txt +255 -67
  109. package/src/tools/puppeteer/07_stealth_fonts.txt +17 -15
  110. package/src/tools/puppeteer/08_stealth_audio.txt +32 -20
  111. package/src/tools/puppeteer/09_stealth_locale.txt +45 -40
  112. package/src/tools/puppeteer/10_stealth_plugins.txt +12 -8
  113. package/src/tools/puppeteer/11_stealth_hardware.txt +57 -6
  114. package/src/tools/puppeteer/12_stealth_codecs.txt +20 -18
  115. package/src/tools/puppeteer/13_stealth_worker.txt +206 -45
  116. package/src/tools/search.ts +10 -1
  117. package/src/tools/sqlite-reader.ts +59 -3
  118. package/src/tools/todo.ts +6 -0
  119. package/src/tools/write.ts +4 -6
  120. package/src/utils/thinking-display.ts +78 -0
@@ -124,3 +124,20 @@ export declare const PROFILE_BOOTSTRAP_BOUNDARY_ARG = "--omp-profile-boundary";
124
124
  * fires for `--`-prefixed tokens.
125
125
  */
126
126
  export declare const VALUELESS_FLAGS: ReadonlySet<string>;
127
+ /**
128
+ * Whether a bare long option (`--xxx`, no `=`) is unclassified — not a known
129
+ * string-, optional-, or value-less flag. The bootstrap and subcommand
130
+ * resolver treat these as possible extension string flags that may consume a
131
+ * value-like successor (the extension flag table is not yet loaded). Shared so
132
+ * both call sites classify identically.
133
+ */
134
+ export declare function isUnknownLongValueCandidate(arg: string): boolean;
135
+ /**
136
+ * Whether a leading option `flag` consumes the following argv token `next` as
137
+ * its value, applying the same contract as `extractProfileFlags` / `parseArgs`.
138
+ * Single source of truth so subcommand detection ({@link resolveCliArgv}) skips
139
+ * a flag's value instead of mistaking it for the subcommand — `omp --model acp`
140
+ * means model `acp`, not the `acp` subcommand, exactly as the launch parser
141
+ * reads it.
142
+ */
143
+ export declare function flagConsumesValue(flag: string, next: string | undefined): boolean;
@@ -6,5 +6,4 @@ import type { SessionInfo } from "../session/session-listing";
6
6
  */
7
7
  export declare function selectSession(sessions: SessionInfo[], options?: {
8
8
  allSessions?: SessionInfo[];
9
- startInAllScope?: boolean;
10
9
  }): Promise<SessionInfo | null>;
@@ -1,3 +1,4 @@
1
+ import { type TinyLocalModelKey } from "../tiny/models";
1
2
  export type TinyModelsAction = "download" | "list";
2
3
  export interface TinyModelsCommandArgs {
3
4
  action: TinyModelsAction;
@@ -6,4 +7,5 @@ export interface TinyModelsCommandArgs {
6
7
  json?: boolean;
7
8
  };
8
9
  }
10
+ export declare function resolveModels(model: string | undefined): TinyLocalModelKey[];
9
11
  export declare function runTinyModelsCommand(command: TinyModelsCommandArgs): Promise<void>;
@@ -25,7 +25,9 @@ export type ResolvedCliArgv = {
25
25
  };
26
26
  /**
27
27
  * Decide what the CLI runner should do with raw argv: reject bare reserved
28
- * management words, pass help/version through untouched, and route everything
29
- * that is not a known subcommand to `launch`.
28
+ * management words, pass help/version through untouched, route a recognized
29
+ * subcommand (even behind leading global flags like `--approval-mode=yolo`) to
30
+ * that command with the flags preserved, and forward everything else to
31
+ * `launch` (#2970).
30
32
  */
31
33
  export declare function resolveCliArgv(argv: string[]): ResolvedCliArgv;
@@ -42,11 +42,30 @@ export type CollabFrame = Exclude<GuestFrame, {
42
42
  t: "welcome";
43
43
  proto: number;
44
44
  header: SessionHeader;
45
- entries: SessionEntry[];
46
45
  state: CollabSessionState;
47
46
  agents: AgentSnapshot[];
47
+ /**
48
+ * Total number of `SessionEntry` items the host will deliver in the
49
+ * `snapshot-chunk` frames that follow. The guest stays in the
50
+ * snapshot-loading phase until it has accumulated that many entries
51
+ * (or a chunk arrives with `final: true`).
52
+ */
53
+ entryCount: number;
48
54
  /** True when this peer joined through a read-only (view) link. */
49
55
  readOnly?: boolean;
56
+ }
57
+ /**
58
+ * Targeted snapshot fragment delivered after `welcome`. Splits a large
59
+ * transcript across many small frames so the guest's per-chunk progress
60
+ * timeout resets each time the relay delivers another batch; without
61
+ * chunking, a multi-MB session has to fit one giant frame inside the
62
+ * 30 s first-welcome budget. The last chunk carries `final: true` so the
63
+ * guest can finalize the replica session.
64
+ */
65
+ | {
66
+ t: "snapshot-chunk";
67
+ entries: SessionEntry[];
68
+ final: boolean;
50
69
  } | {
51
70
  t: "entry";
52
71
  entry: SessionEntry;
@@ -201,7 +201,7 @@ export declare const SETTINGS_SCHEMA: {
201
201
  };
202
202
  readonly "advisor.immuneTurns": {
203
203
  readonly type: "number";
204
- readonly default: 1;
204
+ readonly default: 3;
205
205
  readonly ui: {
206
206
  readonly tab: "model";
207
207
  readonly group: "Advisor";
@@ -214,13 +214,13 @@ export declare const SETTINGS_SCHEMA: {
214
214
  }, {
215
215
  readonly value: "1";
216
216
  readonly label: "1 turn";
217
- readonly description: "Default.";
218
217
  }, {
219
218
  readonly value: "2";
220
219
  readonly label: "2 turns";
221
220
  }, {
222
221
  readonly value: "3";
223
222
  readonly label: "3 turns";
223
+ readonly description: "Default.";
224
224
  }, {
225
225
  readonly value: "4";
226
226
  readonly label: "4 turns";
@@ -852,6 +852,26 @@ export declare const SETTINGS_SCHEMA: {
852
852
  readonly description: "Hide thinking blocks in assistant responses";
853
853
  };
854
854
  };
855
+ readonly proseOnlyThinking: {
856
+ readonly type: "boolean";
857
+ readonly default: true;
858
+ readonly ui: {
859
+ readonly tab: "model";
860
+ readonly group: "Thinking";
861
+ readonly label: "Prose Only Thinking";
862
+ readonly description: "Omit code blocks from thinking summaries and replace them with an ellipsis";
863
+ };
864
+ };
865
+ readonly omitThinking: {
866
+ readonly type: "boolean";
867
+ readonly default: false;
868
+ readonly ui: {
869
+ readonly tab: "model";
870
+ readonly group: "Thinking";
871
+ readonly label: "Omit Thinking summaries";
872
+ readonly description: "Instruct upstream providers to completely omit thinking summaries from responses (where supported)";
873
+ };
874
+ };
855
875
  readonly "model.loopGuard.enabled": {
856
876
  readonly type: "boolean";
857
877
  readonly default: true;
@@ -1669,7 +1689,7 @@ export declare const SETTINGS_SCHEMA: {
1669
1689
  readonly "compaction.strategy": {
1670
1690
  readonly type: "enum";
1671
1691
  readonly values: readonly ["context-full", "handoff", "shake", "snapcompact", "off"];
1672
- readonly default: "context-full";
1692
+ readonly default: "snapcompact";
1673
1693
  readonly ui: {
1674
1694
  readonly tab: "context";
1675
1695
  readonly group: "Compaction";
@@ -2362,6 +2382,17 @@ export declare const SETTINGS_SCHEMA: {
2362
2382
  readonly condition: "mnemopiActive";
2363
2383
  };
2364
2384
  };
2385
+ readonly "mnemopi.proactiveLinking": {
2386
+ readonly type: "boolean";
2387
+ readonly default: false;
2388
+ readonly ui: {
2389
+ readonly tab: "memory";
2390
+ readonly group: "Mnemopi";
2391
+ readonly label: "Mnemopi Proactive Linking";
2392
+ readonly description: "Ingest new memories into the episodic graph as they are stored, linking them to related entities and memories";
2393
+ readonly condition: "mnemopiActive";
2394
+ };
2395
+ };
2365
2396
  readonly "mnemopi.noEmbeddings": {
2366
2397
  readonly type: "boolean";
2367
2398
  readonly default: false;
@@ -4294,6 +4325,26 @@ export declare const SETTINGS_SCHEMA: {
4294
4325
  }];
4295
4326
  };
4296
4327
  };
4328
+ readonly "providers.fireworksTier": {
4329
+ readonly type: "enum";
4330
+ readonly values: readonly ["standard", "priority"];
4331
+ readonly default: "standard";
4332
+ readonly ui: {
4333
+ readonly tab: "providers";
4334
+ readonly group: "Fireworks";
4335
+ readonly label: "Fireworks Tier";
4336
+ readonly description: 'Serving path for Fireworks requests. Priority sends `service_tier: "priority"` for higher reliability during peak traffic at a higher price; Standard omits it. Fast (`-fast`) models ignore this — Fast is its own serving path.';
4337
+ readonly options: readonly [{
4338
+ readonly value: "standard";
4339
+ readonly label: "Standard";
4340
+ readonly description: "Default serving path (no service_tier)";
4341
+ }, {
4342
+ readonly value: "priority";
4343
+ readonly label: "Priority";
4344
+ readonly description: "Priority serving path: higher reliability, premium per-token pricing";
4345
+ }];
4346
+ };
4347
+ };
4297
4348
  readonly "providers.tts": {
4298
4349
  readonly type: "enum";
4299
4350
  readonly values: readonly ["auto", "local", "xai"];
@@ -4568,7 +4619,7 @@ export declare const SETTINGS_SCHEMA: {
4568
4619
  } | {
4569
4620
  value: "gemma-3-1b" | "lfm2-1.2b" | "qwen2.5-1.5b" | "qwen3-1.7b";
4570
4621
  label: "Gemma 3 1B" | "LFM2 1.2B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
4571
- description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Fastest load; solid all-rounder, slightly noisier extraction labels." | "Recommended; most disciplined extraction (ignores chit-chat), good consolidation, about 1.1 GB cached.";
4622
+ description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels.";
4572
4623
  })[];
4573
4624
  };
4574
4625
  };
@@ -4589,7 +4640,7 @@ export declare const SETTINGS_SCHEMA: {
4589
4640
  } | {
4590
4641
  value: "gemma-3-1b" | "lfm2-1.2b" | "qwen2.5-1.5b" | "qwen3-1.7b";
4591
4642
  label: "Gemma 3 1B" | "LFM2 1.2B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
4592
- description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Fastest load; solid all-rounder, slightly noisier extraction labels." | "Recommended; most disciplined extraction (ignores chit-chat), good consolidation, about 1.1 GB cached.";
4643
+ description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels.";
4593
4644
  })[];
4594
4645
  };
4595
4646
  };
@@ -4620,7 +4671,7 @@ export declare const SETTINGS_SCHEMA: {
4620
4671
  } | {
4621
4672
  value: "gemma-3-1b" | "lfm2-1.2b" | "qwen2.5-1.5b" | "qwen3-1.7b";
4622
4673
  label: "Gemma 3 1B" | "LFM2 1.2B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
4623
- description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Fastest load; solid all-rounder, slightly noisier extraction labels." | "Recommended; most disciplined extraction (ignores chit-chat), good consolidation, about 1.1 GB cached.";
4674
+ description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels.";
4624
4675
  })[];
4625
4676
  };
4626
4677
  };
@@ -19,6 +19,7 @@
19
19
  * `types.ts` via the `export *` below — pi-ai still exports both as types,
20
20
  * only the runtime `Type` builder and `StringEnum()` helper were removed.
21
21
  */
22
+ import { getBundledModel, getBundledModels } from "@oh-my-pi/pi-catalog/models";
22
23
  import { type TSchema, Type } from "./typebox";
23
24
  export interface StringEnumOptions<T extends string> {
24
25
  description?: string;
@@ -26,6 +27,9 @@ export interface StringEnumOptions<T extends string> {
26
27
  examples?: T[];
27
28
  [key: string]: unknown;
28
29
  }
29
- export declare function StringEnum<T extends string>(values: readonly T[], options?: StringEnumOptions<T>): TSchema;
30
+ export declare function StringEnum<T extends string | number>(values: readonly T[] | Record<string, T>, options?: StringEnumOptions<any>): TSchema;
30
31
  export * from "@oh-my-pi/pi-ai";
31
32
  export { Type };
33
+ /** Compatibility aliases for renamed catalog functions */
34
+ export declare const getModel: typeof getBundledModel;
35
+ export declare const getModels: typeof getBundledModels;
@@ -0,0 +1,9 @@
1
+ import type { InternalResource } from "./types";
2
+ /**
3
+ * Builds a text resource for a filesystem directory resolved by an internal URL handler.
4
+ *
5
+ * The resource is flagged immutable so the read tool never mints hashline edit
6
+ * anchors against a directory listing — only file resources from the same
7
+ * handler stay editable.
8
+ */
9
+ export declare function buildDirectoryResource(url: string, directoryPath: string, notes?: string[]): Promise<InternalResource>;
@@ -2,6 +2,7 @@ import type { LoadedCustomTool } from "../extensibility/custom-tools/types";
2
2
  import { AgentStorage } from "../session/agent-storage";
3
3
  import type { AuthStorage } from "../session/auth-storage";
4
4
  import { MCPManager } from "./manager";
5
+ import type { McpConnectionStatusEvent } from "./startup-events";
5
6
  /** Result from loading MCP tools */
6
7
  export interface MCPToolsLoadResult {
7
8
  /** MCP manager (for lifecycle management) */
@@ -20,8 +21,8 @@ export interface MCPToolsLoadResult {
20
21
  }
21
22
  /** Options for loading MCP tools */
22
23
  export interface MCPToolsLoadOptions {
23
- /** Called when starting to connect to servers */
24
- onConnecting?: (serverNames: string[]) => void;
24
+ /** Called when MCP server connection state changes. */
25
+ onStatus?: (event: McpConnectionStatusEvent) => void;
25
26
  /** Whether to load project-level config (default: true) */
26
27
  enableProjectConfig?: boolean;
27
28
  /** Whether to filter out Exa MCP servers (default: true) */
@@ -2,6 +2,7 @@ import { type TSchema } from "@oh-my-pi/pi-ai";
2
2
  import type { SourceMeta } from "../capability/types";
3
3
  import type { CustomTool } from "../extensibility/custom-tools/types";
4
4
  import type { AuthStorage } from "../session/auth-storage";
5
+ import type { McpConnectionStatusEvent } from "./startup-events";
5
6
  import type { MCPToolDetails } from "./tool-bridge";
6
7
  import type { MCPToolCache } from "./tool-cache";
7
8
  import type { MCPGetPromptResult, MCPPrompt, MCPRequestOptions, MCPResource, MCPResourceReadResult, MCPResourceTemplate, MCPServerConfig, MCPServerConnection } from "./types";
@@ -38,8 +39,8 @@ export interface MCPDiscoverOptions {
38
39
  filterExa?: boolean;
39
40
  /** Whether to filter out browser MCP servers when builtin browser tool is enabled (default: false) */
40
41
  filterBrowser?: boolean;
41
- /** Called when starting to connect to servers */
42
- onConnecting?: (serverNames: string[]) => void;
42
+ /** Called when MCP server connection state changes. */
43
+ onStatus?: (event: McpConnectionStatusEvent) => void;
43
44
  }
44
45
  /**
45
46
  * MCP Server Manager.
@@ -87,7 +88,7 @@ export declare class MCPManager {
87
88
  * Connect to specific MCP servers.
88
89
  * Connections are made in parallel for faster startup.
89
90
  */
90
- connectServers(configs: Record<string, MCPServerConfig>, sources: Record<string, SourceMeta>, onConnecting?: (serverNames: string[]) => void): Promise<MCPLoadResult>;
91
+ connectServers(configs: Record<string, MCPServerConfig>, sources: Record<string, SourceMeta>, onStatus?: (event: McpConnectionStatusEvent) => void): Promise<MCPLoadResult>;
91
92
  /**
92
93
  * Get all loaded tools.
93
94
  */
@@ -1,11 +1,28 @@
1
- export declare const MCP_CONNECTING_EVENT_CHANNEL = "mcp:connecting";
2
- export type McpConnectingEvent = {
1
+ export declare const MCP_CONNECTION_STATUS_EVENT_CHANNEL = "mcp:connection-status";
2
+ export type McpConnectionStatusEvent = {
3
+ type: "connecting";
3
4
  serverNames: string[];
5
+ } | {
6
+ type: "connected";
7
+ serverName: string;
8
+ } | {
9
+ type: "failed";
10
+ serverName: string;
11
+ error: string;
4
12
  };
5
- export declare function formatMCPConnectingMessage(serverNames: string[]): string;
13
+ export type McpConnectionStatusSnapshot = {
14
+ pendingServers: readonly string[];
15
+ connectedServers: readonly string[];
16
+ failedServers: readonly {
17
+ serverName: string;
18
+ error: string;
19
+ }[];
20
+ };
21
+ export declare function formatMCPConnectingMessage(serverNames: readonly string[]): string;
22
+ export declare function formatMCPConnectionStatusMessage(snapshot: McpConnectionStatusSnapshot): string;
6
23
  /**
7
24
  * Runtime validator for the cross-module event payload. The event bus is
8
25
  * untyped at runtime, so the subscriber verifies the shape before formatting
9
26
  * rather than trusting a cast — a malformed emit is ignored instead of throwing.
10
27
  */
11
- export declare function isMcpConnectingEvent(data: unknown): data is McpConnectingEvent;
28
+ export declare function isMcpConnectionStatusEvent(data: unknown): data is McpConnectionStatusEvent;
@@ -15,6 +15,7 @@ export interface MnemopiBackendConfig {
15
15
  autoRetain: boolean;
16
16
  polyphonicRecall: boolean;
17
17
  enhancedRecall: boolean;
18
+ proactiveLinking: boolean;
18
19
  retainEveryNTurns: number;
19
20
  recallLimit: number;
20
21
  recallContextTurns: number;
@@ -40,6 +40,7 @@ export interface AgentHubDeps {
40
40
  cwd?: string;
41
41
  /** Mirrors the main transcript's thinking-block visibility. */
42
42
  hideThinkingBlock?: () => boolean;
43
+ proseOnlyThinking?: () => boolean;
43
44
  /** Keys toggling tool output expansion (app.tools.expand). */
44
45
  expandKeys?: KeyId[];
45
46
  /** Focus the main view on this agent's live session (ctx.focusAgentSession). When absent (collab guest, tests), Enter opens the in-hub chat view instead. */
@@ -20,6 +20,7 @@ export interface AgentTranscriptViewerDeps {
20
20
  getMessageRenderer?: (customType: string) => MessageRenderer | undefined;
21
21
  cwd: string;
22
22
  hideThinkingBlock?: () => boolean;
23
+ proseOnlyThinking?: () => boolean;
23
24
  expandKeys: KeyId[];
24
25
  /** Keys that toggle the whole hub closed (app.agents.hub + app.session.observe). */
25
26
  hubKeys: KeyId[];
@@ -2,6 +2,8 @@ import type { AssistantMessage, ImageContent } from "@oh-my-pi/pi-ai";
2
2
  import { Container, type ImageBudget } from "@oh-my-pi/pi-tui";
3
3
  import type { AssistantThinkingRenderer } from "../../extensibility/extensions/types";
4
4
  import { type CacheInvalidation } from "./cache-invalidation-marker";
5
+ /** Test-only: clear the shared gauge so observations don't leak across cases. */
6
+ export declare function resetThinkingSpeedTracker(): void;
5
7
  /**
6
8
  * Component that renders a complete assistant message
7
9
  */
@@ -11,7 +13,8 @@ export declare class AssistantMessageComponent extends Container {
11
13
  private readonly onImageUpdate?;
12
14
  private readonly thinkingRenderers;
13
15
  private readonly imageBudget?;
14
- constructor(message?: AssistantMessage, hideThinkingBlock?: boolean, onImageUpdate?: (() => void) | undefined, thinkingRenderers?: readonly AssistantThinkingRenderer[], imageBudget?: ImageBudget | undefined);
16
+ private proseOnlyThinking;
17
+ constructor(message?: AssistantMessage, hideThinkingBlock?: boolean, onImageUpdate?: (() => void) | undefined, thinkingRenderers?: readonly AssistantThinkingRenderer[], imageBudget?: ImageBudget | undefined, proseOnlyThinking?: boolean);
15
18
  /**
16
19
  * Show or clear the slim cache-invalidation divider above this turn. Set at
17
20
  * `message_end` (live) or during rebuild, once the turn's usage is known and
@@ -21,6 +24,7 @@ export declare class AssistantMessageComponent extends Container {
21
24
  setCacheInvalidation(info: CacheInvalidation | undefined): void;
22
25
  invalidate(): void;
23
26
  setHideThinkingBlock(hide: boolean): void;
27
+ setProseOnlyThinking(proseOnly: boolean): void;
24
28
  dispose(): void;
25
29
  /**
26
30
  * Toggle suppression of the inline `Error: …` line while the same error is
@@ -12,6 +12,8 @@ export declare class BtwPanelComponent extends Container {
12
12
  markAborted(): void;
13
13
  markError(message: string): void;
14
14
  isBranchable(): boolean;
15
+ isCopyable(): boolean;
16
+ getCopyText(): string | undefined;
15
17
  close(): void;
16
18
  }
17
19
  export {};
@@ -22,6 +22,7 @@ export interface ChatTranscriptBuilderDeps {
22
22
  getMessageRenderer?: (customType: string) => MessageRenderer | undefined;
23
23
  cwd: string;
24
24
  hideThinkingBlock?: () => boolean;
25
+ proseOnlyThinking?: () => boolean;
25
26
  requestRender: () => void;
26
27
  }
27
28
  export declare class ChatTranscriptBuilder {
@@ -50,8 +50,6 @@ export interface SessionSelectorOptions {
50
50
  loadAllSessions?: () => Promise<SessionInfo[]>;
51
51
  /** Preloaded all-projects list; cached so the first Tab toggle is instant. */
52
52
  allSessions?: SessionInfo[];
53
- /** Open directly in all-projects scope (e.g. the current folder has no sessions). */
54
- startInAllScope?: boolean;
55
53
  /**
56
54
  * Reads the live terminal height so the visible window fits the viewport.
57
55
  * Omitted only in tests; defaults to a conservative 24 rows.
@@ -5,6 +5,8 @@ export declare class BtwController {
5
5
  constructor(ctx: InteractiveModeContext);
6
6
  hasActiveRequest(): boolean;
7
7
  canBranch(): boolean;
8
+ canCopy(): boolean;
9
+ handleCopy(): Promise<boolean>;
8
10
  handleBranch(): Promise<boolean>;
9
11
  handleEscape(): boolean;
10
12
  dispose(): void;
@@ -11,7 +11,7 @@ export declare class CommandController {
11
11
  constructor(ctx: InteractiveModeContext);
12
12
  openInBrowser(urlOrPath: string): void;
13
13
  handleExportCommand(text: string): Promise<void>;
14
- handleDumpCommand(): void;
14
+ handleDumpCommand(): Promise<void>;
15
15
  handleAdvisorDumpCommand(isRaw?: boolean): void;
16
16
  handleDebugTranscriptCommand(): Promise<void>;
17
17
  handleShareCommand(): Promise<void>;
@@ -1,6 +1,7 @@
1
1
  import type { Component } from "@oh-my-pi/pi-tui";
2
2
  import type { InteractiveModeContext } from "../../modes/types";
3
3
  import type { SessionObserverRegistry } from "../session-observer-registry";
4
+ export declare function formatTemporaryModelStatus(modelLabel: string, roleSelectorHint?: string): string;
4
5
  export declare class SelectorController {
5
6
  #private;
6
7
  private ctx;
@@ -7,10 +7,11 @@ type StreamingRevealComponent = Pick<AssistantMessageComponent, "updateContent">
7
7
  type StreamingRevealControllerOptions = {
8
8
  getSmoothStreaming(): boolean;
9
9
  getHideThinkingBlock(): boolean;
10
+ getProseOnlyThinking(): boolean;
10
11
  requestRender(): void;
11
12
  };
12
- export declare function visibleUnits(message: AssistantMessage, hideThinking: boolean): number;
13
- export declare function buildDisplayMessage(target: AssistantMessage, revealed: number, hideThinking: boolean, countOf?: (index: number, text: string) => number): AssistantMessage;
13
+ export declare function visibleUnits(message: AssistantMessage, hideThinking: boolean, proseOnly?: boolean): number;
14
+ export declare function buildDisplayMessage(target: AssistantMessage, revealed: number, hideThinking: boolean, proseOnly?: boolean, countOf?: (index: number, text: string) => number): AssistantMessage;
14
15
  export declare function nextStep(backlog: number): number;
15
16
  export declare class StreamingRevealController {
16
17
  #private;
@@ -108,6 +108,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
108
108
  loopLimit: LoopLimitRuntime | undefined;
109
109
  todoPhases: TodoPhase[];
110
110
  hideThinkingBlock: boolean;
111
+ proseOnlyThinking: boolean;
111
112
  pendingImages: ImageContent[];
112
113
  pendingImageLinks: (string | undefined)[];
113
114
  compactionQueuedMessages: CompactionQueuedMessage[];
@@ -270,7 +271,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
270
271
  findLastAssistantMessage(): AssistantMessage | undefined;
271
272
  extractAssistantText(message: AssistantMessage): string;
272
273
  handleExportCommand(text: string): Promise<void>;
273
- handleDumpCommand(): void;
274
+ handleDumpCommand(): Promise<void>;
274
275
  handleAdvisorDumpCommand(isRaw?: boolean): void;
275
276
  handleDebugTranscriptCommand(): Promise<void>;
276
277
  handleShareCommand(): Promise<void>;
@@ -334,6 +335,8 @@ export declare class InteractiveMode implements InteractiveModeContext {
334
335
  handleBtwEscape(): boolean;
335
336
  canBranchBtw(): boolean;
336
337
  handleBtwBranchKey(): Promise<boolean>;
338
+ canCopyBtw(): boolean;
339
+ handleBtwCopyKey(): Promise<boolean>;
337
340
  handleBtwBranch(question: string, assistantMessage: AssistantMessage): Promise<void>;
338
341
  handleOmfgCommand(complaint: string): Promise<void>;
339
342
  hasActiveOmfg(): boolean;
@@ -129,6 +129,7 @@ export interface InteractiveModeContext {
129
129
  loopLimit?: LoopLimitRuntime;
130
130
  planModePlanFilePath?: string;
131
131
  hideThinkingBlock: boolean;
132
+ proseOnlyThinking: boolean;
132
133
  pendingImages: ImageContent[];
133
134
  pendingImageLinks: (string | undefined)[];
134
135
  compactionQueuedMessages: CompactionQueuedMessage[];
@@ -269,7 +270,7 @@ export interface InteractiveModeContext {
269
270
  handleHotkeysCommand(): void;
270
271
  handleToolsCommand(): void;
271
272
  handleContextCommand(): void;
272
- handleDumpCommand(): void;
273
+ handleDumpCommand(): Promise<void>;
273
274
  handleAdvisorDumpCommand(isRaw?: boolean): void;
274
275
  handleDebugTranscriptCommand(): Promise<void>;
275
276
  handleClearCommand(): Promise<void>;
@@ -325,6 +326,8 @@ export interface InteractiveModeContext {
325
326
  handleBtwEscape(): boolean;
326
327
  handleBtwBranchKey(): Promise<boolean>;
327
328
  canBranchBtw(): boolean;
329
+ canCopyBtw(): boolean;
330
+ handleBtwCopyKey(): Promise<boolean>;
328
331
  handleBtwBranch(question: string, assistantMessage: AssistantMessage): Promise<void>;
329
332
  handleOmfgCommand(complaint: string): Promise<void>;
330
333
  hasActiveOmfg(): boolean;
@@ -1062,12 +1062,14 @@ export declare class AgentSession {
1062
1062
  emitIrcRelayObservation(record: CustomMessage): void;
1063
1063
  /**
1064
1064
  * Run a single ephemeral side-channel turn against this session's current
1065
- * model + system prompt + history. No tools are used; the side request
1066
- * does not block on, or interfere with, any in-flight main turn. The
1065
+ * model + system prompt + history. The main turn's tool catalog is sent
1066
+ * to preserve the prompt cache, but the model is reminded not to call
1067
+ * tools and any tool calls are discarded. The side request
1068
+ * does not block on, or interfere with, any in-flight main turn. The
1067
1069
  * session's history and persisted state are NOT modified by this call.
1068
1070
  *
1069
1071
  * Used by `BtwController` (`/btw`) and `OmfgController` (`/omfg`) to share
1070
- * the snapshot + stream pipeline. The snapshot includes any in-flight
1072
+ * the snapshot + stream pipeline. The snapshot includes any in-flight
1071
1073
  * streaming assistant text so the model sees the half-finished response
1072
1074
  * rather than missing context.
1073
1075
  */
@@ -1201,6 +1203,19 @@ export declare class AgentSession {
1201
1203
  * `### Tool Call`/`### Tool Result`).
1202
1204
  */
1203
1205
  formatSessionAsText(): string;
1206
+ /**
1207
+ * Dump the current session's LLM-facing request context as JSON to a
1208
+ * auto-named file in `os.tmpdir()`. This is the synchronous
1209
+ * `convertToLlm`-boundary snapshot — system prompt, tools (wire schemas),
1210
+ * thinking/service tier, and converted messages — with no network round-trip
1211
+ * and no arming flag, so advisor/side requests cannot intercept it.
1212
+ *
1213
+ * The file persists on disk and may contain the same raw context/secrets
1214
+ * as `/dump`; treat the path accordingly.
1215
+ *
1216
+ * @returns the written file path, or `undefined` when there are no messages.
1217
+ */
1218
+ dumpLlmRequestToTmpDir(): Promise<string | undefined>;
1204
1219
  /**
1205
1220
  * Enable or disable the advisor for this session. The setting is overridden for the session,
1206
1221
  * and the runtime is started or stopped to match.
@@ -7,7 +7,32 @@ export interface HistoryFormatOptions {
7
7
  includeToolIntent?: boolean;
8
8
  /** Render watched-session roles as inline `**agent**:` / `**user**:` labels (collapsing consecutive same-role messages) instead of `## ` headings, so a primary transcript embedded inside an advisor turn stays visually distinct. */
9
9
  watchedRoles?: boolean;
10
+ /**
11
+ * Expand the primary agent's injected constraint context — plan mode's rules
12
+ * (`plan-mode-context`) and the approved plan it implements
13
+ * (`plan-mode-reference`) — verbatim instead of as a truncated one-liner,
14
+ * wrapped in a `<primary-context>` tag so a reviewer reads it as the primary's
15
+ * instructions, not its own. The advisor sets this: a truncated rule (plan
16
+ * mode's "NEVER create files … except the plan file") makes it raise false
17
+ * blockers. See {@link PRIMARY_CONTEXT_CUSTOM_TYPES}. Other custom messages
18
+ * still collapse to a one-liner.
19
+ */
20
+ expandPrimaryContext?: boolean;
10
21
  }
22
+ /**
23
+ * Hidden custom messages that inject the primary agent's operative *constraints*
24
+ * — plan mode's rules and the approved plan it implements. A reviewer (the
25
+ * advisor) must read these verbatim; truncating them hides load-bearing
26
+ * exceptions (e.g. plan mode permits exactly one plan file). Every other custom
27
+ * type stays a one-liner.
28
+ *
29
+ * Deliberately excludes `goal-mode-context`: its body carries live budget
30
+ * counters (tokens/seconds used) that change every turn, so it can neither be
31
+ * deduped against a prior copy nor expanded each turn without flooding the
32
+ * reviewer — and its constraints don't drive the file-write misreads this
33
+ * targets.
34
+ */
35
+ export declare const PRIMARY_CONTEXT_CUSTOM_TYPES: ReadonlySet<string>;
11
36
  /**
12
37
  * Format a session's message array as a concise markdown transcript.
13
38
  *
@@ -141,5 +141,5 @@ export declare class SnapcompactInlineTransformer {
141
141
  private readonly options;
142
142
  private readonly onToolResultSavings?;
143
143
  constructor(options: SnapcompactInlineOptions, onToolResultSavings?: SnapcompactSavingsSink | undefined);
144
- transform(context: Context, model: Model): Context;
144
+ transform(context: Context, model: Model): Promise<Context>;
145
145
  }
@@ -3,6 +3,11 @@ import type { BuiltinSlashCommand, ParsedSlashCommand, SlashCommandResult, Slash
3
3
  export type { BuiltinSlashCommand, SubcommandDef } from "./types";
4
4
  /** TUI-specific runtime accepted by `executeBuiltinSlashCommand`. */
5
5
  export type BuiltinSlashCommandRuntime = TuiSlashCommandRuntime;
6
+ export interface TuiBuiltinSlashCommand extends BuiltinSlashCommand {
7
+ getArgumentCompletions?: (prefix: string) => AutocompleteItem[] | null;
8
+ getInlineHint?: (argumentText: string) => string | null;
9
+ getAutocompleteDescription?: () => string | undefined;
10
+ }
6
11
  export declare const BUILTIN_SLASH_COMMAND_RESERVED_NAMES: ReadonlySet<string>;
7
12
  /** Builtin command metadata used for slash-command autocomplete and help text. */
8
13
  export declare const BUILTIN_SLASH_COMMAND_DEFS: ReadonlyArray<BuiltinSlashCommand>;
@@ -10,10 +15,8 @@ export declare const BUILTIN_SLASH_COMMAND_DEFS: ReadonlyArray<BuiltinSlashComma
10
15
  * Materialized builtin slash commands with completion functions derived from
11
16
  * declarative subcommand/hint definitions.
12
17
  */
13
- export declare const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand & {
14
- getArgumentCompletions?: (prefix: string) => AutocompleteItem[] | null;
15
- getInlineHint?: (argumentText: string) => string | null;
16
- }>;
18
+ export declare const BUILTIN_SLASH_COMMANDS: ReadonlyArray<TuiBuiltinSlashCommand>;
19
+ export declare function buildTuiBuiltinSlashCommands(runtime: TuiSlashCommandRuntime): ReadonlyArray<TuiBuiltinSlashCommand>;
17
20
  /**
18
21
  * Unified registry exposed for cross-mode tooling. Each spec carries at least
19
22
  * one of `handle` / `handleTui`. The TUI dispatcher prefers `handleTui`; the
@@ -18,6 +18,8 @@ export interface BuiltinSlashCommand {
18
18
  subcommands?: SubcommandDef[];
19
19
  /** Static inline hint when command takes a simple argument (no subcommands). */
20
20
  inlineHint?: string;
21
+ /** TUI-only dynamic status text for command-name autocomplete. Static `description` remains canonical for ACP/help. */
22
+ getTuiAutocompleteDescription?: (runtime: TuiSlashCommandRuntime) => string | undefined;
21
23
  }
22
24
  /** Parsed slash-command text after stripping the leading "/". */
23
25
  export interface ParsedSlashCommand {