@oh-my-pi/pi-coding-agent 16.1.7 → 16.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/dist/cli.js +3390 -3377
- package/dist/types/cli/session-picker.d.ts +0 -1
- package/dist/types/cli/tiny-models-cli.d.ts +2 -0
- package/dist/types/collab/protocol.d.ts +20 -1
- package/dist/types/config/settings-schema.d.ts +57 -6
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +5 -1
- package/dist/types/internal-urls/filesystem-resource.d.ts +9 -0
- package/dist/types/mcp/loader.d.ts +3 -2
- package/dist/types/mcp/manager.d.ts +4 -3
- package/dist/types/mcp/startup-events.d.ts +21 -4
- package/dist/types/mnemopi/config.d.ts +1 -0
- package/dist/types/modes/components/agent-hub.d.ts +1 -0
- package/dist/types/modes/components/agent-transcript-viewer.d.ts +1 -0
- package/dist/types/modes/components/assistant-message.d.ts +5 -1
- package/dist/types/modes/components/btw-panel.d.ts +2 -0
- package/dist/types/modes/components/chat-transcript-builder.d.ts +1 -0
- package/dist/types/modes/components/session-selector.d.ts +0 -2
- package/dist/types/modes/controllers/btw-controller.d.ts +2 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
- package/dist/types/modes/controllers/streaming-reveal.d.ts +3 -2
- package/dist/types/modes/interactive-mode.d.ts +3 -0
- package/dist/types/modes/types.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +5 -3
- package/dist/types/session/session-history-format.d.ts +25 -0
- package/dist/types/session/snapcompact-inline.d.ts +1 -1
- package/dist/types/slash-commands/builtin-registry.d.ts +7 -4
- package/dist/types/slash-commands/types.d.ts +2 -0
- package/dist/types/system-prompt.d.ts +1 -0
- package/dist/types/tiny/models.d.ts +11 -7
- package/dist/types/tools/todo.d.ts +1 -0
- package/dist/types/utils/thinking-display.d.ts +2 -0
- package/package.json +12 -12
- package/src/advisor/__tests__/advisor.test.ts +104 -0
- package/src/advisor/runtime.ts +38 -2
- package/src/cli/session-picker.ts +1 -2
- package/src/cli/tiny-models-cli.ts +7 -2
- package/src/collab/guest.ts +172 -20
- package/src/collab/host.ts +47 -5
- package/src/collab/protocol.ts +16 -1
- package/src/config/settings-schema.ts +59 -5
- package/src/edit/renderer.ts +8 -12
- package/src/extensibility/legacy-pi-ai-shim.ts +16 -4
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/internal-urls/filesystem-resource.ts +34 -0
- package/src/internal-urls/local-protocol.ts +7 -1
- package/src/internal-urls/memory-protocol.ts +5 -1
- package/src/internal-urls/skill-protocol.ts +20 -4
- package/src/internal-urls/vault-protocol.ts +5 -2
- package/src/main.ts +8 -8
- package/src/mcp/loader.ts +4 -3
- package/src/mcp/manager.ts +35 -15
- package/src/mcp/startup-events.ts +106 -11
- package/src/mnemopi/config.ts +2 -0
- package/src/mnemopi/state.ts +3 -1
- package/src/modes/components/agent-hub.ts +4 -0
- package/src/modes/components/agent-transcript-viewer.ts +2 -0
- package/src/modes/components/assistant-message.ts +217 -18
- package/src/modes/components/btw-panel.ts +15 -3
- package/src/modes/components/chat-transcript-builder.ts +8 -2
- package/src/modes/components/model-selector.ts +72 -9
- package/src/modes/components/omfg-panel.ts +1 -1
- package/src/modes/components/session-selector.ts +4 -9
- package/src/modes/components/snapcompact-shape-preview.ts +1 -1
- package/src/modes/components/tool-execution.ts +10 -2
- package/src/modes/controllers/btw-controller.ts +32 -7
- package/src/modes/controllers/event-controller.ts +24 -4
- package/src/modes/controllers/input-controller.ts +43 -21
- package/src/modes/controllers/selector-controller.ts +23 -13
- package/src/modes/controllers/streaming-reveal.ts +78 -20
- package/src/modes/controllers/todo-command-controller.ts +9 -10
- package/src/modes/interactive-mode.ts +83 -8
- package/src/modes/types.ts +3 -0
- package/src/modes/utils/ui-helpers.ts +1 -0
- package/src/prompts/advisor/system.md +1 -1
- package/src/prompts/system/side-channel-no-tools.md +3 -0
- package/src/sdk.ts +12 -8
- package/src/session/agent-session.ts +349 -84
- package/src/session/history-storage.ts +15 -16
- package/src/session/session-history-format.ts +41 -1
- package/src/session/snapcompact-inline.ts +9 -6
- package/src/slash-commands/builtin-registry.ts +147 -21
- package/src/slash-commands/helpers/todo.ts +12 -6
- package/src/slash-commands/types.ts +2 -0
- package/src/system-prompt.ts +6 -11
- package/src/tiny/models.ts +7 -3
- package/src/tiny/title-client.ts +8 -2
- package/src/tiny/worker.ts +1 -0
- package/src/tools/search.ts +10 -1
- package/src/tools/sqlite-reader.ts +59 -3
- package/src/tools/todo.ts +6 -0
- package/src/tools/write.ts +4 -6
- package/src/utils/thinking-display.ts +78 -0
|
@@ -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>;
|
|
@@ -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:
|
|
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: "
|
|
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." | "
|
|
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." | "
|
|
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." | "
|
|
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<
|
|
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
|
|
24
|
-
|
|
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
|
|
42
|
-
|
|
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>,
|
|
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
|
|
2
|
-
export type
|
|
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
|
|
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
|
|
28
|
+
export declare function isMcpConnectionStatusEvent(data: unknown): data is McpConnectionStatusEvent;
|
|
@@ -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
|
-
|
|
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
|
|
@@ -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;
|
|
@@ -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[];
|
|
@@ -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[];
|
|
@@ -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.
|
|
1066
|
-
*
|
|
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.
|
|
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
|
*/
|
|
@@ -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<
|
|
14
|
-
|
|
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 {
|
|
@@ -34,6 +34,7 @@ export declare function loadProjectContextFiles(options?: LoadContextFilesOption
|
|
|
34
34
|
* Project-level SYSTEM.md overrides user-level SYSTEM.md.
|
|
35
35
|
*/
|
|
36
36
|
export declare function loadSystemPromptFiles(options?: LoadContextFilesOptions): Promise<string | null>;
|
|
37
|
+
export declare const DEFAULT_SYSTEM_PROMPT_TOOL_NAMES: readonly ["read", "bash", "eval", "edit", "write"];
|
|
37
38
|
export interface SystemPromptToolMetadata {
|
|
38
39
|
label: string;
|
|
39
40
|
description: string;
|
|
@@ -11,6 +11,8 @@ export interface TinyTitleLocalModelSpec {
|
|
|
11
11
|
contextNote: string;
|
|
12
12
|
/** Model family emits hidden reasoning unless the chat template disables it. */
|
|
13
13
|
reasoning?: boolean;
|
|
14
|
+
/** Reason this model is blocked before loading the ONNX runtime. */
|
|
15
|
+
unsupportedReason?: string;
|
|
14
16
|
}
|
|
15
17
|
export declare const TINY_TITLE_LOCAL_MODELS: readonly [{
|
|
16
18
|
readonly key: "lfm2-350m";
|
|
@@ -66,7 +68,7 @@ export declare function getTinyTitleModelSpec(key: TinyTitleLocalModelKey): (typ
|
|
|
66
68
|
/** Default memory model: the online path (the configured smol / remote LLM; no local download). */
|
|
67
69
|
export declare const ONLINE_MEMORY_MODEL_KEY = "online";
|
|
68
70
|
/** Recommended local model for memory tasks when none is named. */
|
|
69
|
-
export declare const DEFAULT_MEMORY_LOCAL_MODEL_KEY = "
|
|
71
|
+
export declare const DEFAULT_MEMORY_LOCAL_MODEL_KEY = "lfm2-1.2b";
|
|
70
72
|
/**
|
|
71
73
|
* Local models for Mnemopi memory tasks (fact extraction + consolidation).
|
|
72
74
|
* These are larger (1B-1.7B) than the title models: structured extraction and
|
|
@@ -78,9 +80,10 @@ export declare const TINY_MEMORY_LOCAL_MODELS: readonly [{
|
|
|
78
80
|
readonly repo: "onnx-community/Qwen3-1.7B-ONNX";
|
|
79
81
|
readonly dtype: "q4";
|
|
80
82
|
readonly label: "Qwen3 1.7B";
|
|
81
|
-
readonly description: "
|
|
82
|
-
readonly contextNote: "
|
|
83
|
+
readonly description: "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates.";
|
|
84
|
+
readonly contextNote: "Blocked before load to avoid the unsupported RotaryEmbedding runtime path.";
|
|
83
85
|
readonly reasoning: true;
|
|
86
|
+
readonly unsupportedReason: "onnxruntime-node does not support Qwen3 RotaryEmbedding cache updates in onnx-community/Qwen3-1.7B-ONNX";
|
|
84
87
|
}, {
|
|
85
88
|
readonly key: "gemma-3-1b";
|
|
86
89
|
readonly repo: "onnx-community/gemma-3-1b-it-ONNX";
|
|
@@ -113,7 +116,7 @@ export declare const TINY_MEMORY_MODEL_OPTIONS: ({
|
|
|
113
116
|
} | {
|
|
114
117
|
value: "gemma-3-1b" | "lfm2-1.2b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
115
118
|
label: "Gemma 3 1B" | "LFM2 1.2B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
116
|
-
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "
|
|
119
|
+
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.";
|
|
117
120
|
})[];
|
|
118
121
|
export declare function isTinyMemoryLocalModelKey(value: string): value is TinyMemoryLocalModelKey;
|
|
119
122
|
export declare function getTinyMemoryModelSpec(key: TinyMemoryLocalModelKey): (typeof TINY_MEMORY_LOCAL_MODELS)[number];
|
|
@@ -166,9 +169,10 @@ export declare const TINY_LOCAL_MODELS: readonly [{
|
|
|
166
169
|
readonly repo: "onnx-community/Qwen3-1.7B-ONNX";
|
|
167
170
|
readonly dtype: "q4";
|
|
168
171
|
readonly label: "Qwen3 1.7B";
|
|
169
|
-
readonly description: "
|
|
170
|
-
readonly contextNote: "
|
|
172
|
+
readonly description: "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates.";
|
|
173
|
+
readonly contextNote: "Blocked before load to avoid the unsupported RotaryEmbedding runtime path.";
|
|
171
174
|
readonly reasoning: true;
|
|
175
|
+
readonly unsupportedReason: "onnxruntime-node does not support Qwen3 RotaryEmbedding cache updates in onnx-community/Qwen3-1.7B-ONNX";
|
|
172
176
|
}, {
|
|
173
177
|
readonly key: "gemma-3-1b";
|
|
174
178
|
readonly repo: "onnx-community/gemma-3-1b-it-ONNX";
|
|
@@ -208,5 +212,5 @@ export declare const AUTO_THINKING_MODEL_OPTIONS: ({
|
|
|
208
212
|
} | {
|
|
209
213
|
value: "gemma-3-1b" | "lfm2-1.2b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
210
214
|
label: "Gemma 3 1B" | "LFM2 1.2B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
211
|
-
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "
|
|
215
|
+
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.";
|
|
212
216
|
})[];
|
|
@@ -74,6 +74,7 @@ export declare function applyOpsToPhases(currentPhases: TodoPhase[], ops: TodoPa
|
|
|
74
74
|
phases: TodoPhase[];
|
|
75
75
|
errors: string[];
|
|
76
76
|
};
|
|
77
|
+
export declare function resolveTodoMarkdownPath(input: string, cwd: string): string;
|
|
77
78
|
/** Render todo phases as a Markdown checklist suitable for editing/copying. */
|
|
78
79
|
export declare function phasesToMarkdown(phases: TodoPhase[]): string;
|
|
79
80
|
/** Parse a Markdown checklist back into todo phases. */
|