@oh-my-pi/pi-coding-agent 16.1.6 → 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 +52 -0
- package/dist/cli.js +3160 -3139
- 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/models-config-schema.d.ts +10 -0
- package/dist/types/config/models-config.d.ts +6 -0
- 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/models-config-schema.ts +1 -0
- 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/prompts/system/system-prompt.md +164 -156
- 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
package/src/sdk.ts
CHANGED
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
type MCPToolsLoadResult,
|
|
88
88
|
parseMCPToolName,
|
|
89
89
|
} from "./mcp";
|
|
90
|
-
import {
|
|
90
|
+
import { MCP_CONNECTION_STATUS_EVENT_CHANNEL, type McpConnectionStatusEvent } from "./mcp/startup-events";
|
|
91
91
|
import { createSessionMemoryRuntimeContext, resolveMemoryBackend } from "./memory-backend";
|
|
92
92
|
import type { MnemopiSessionState } from "./mnemopi/state";
|
|
93
93
|
import asyncResultTemplate from "./prompts/tools/async-result.md" with { type: "text" };
|
|
@@ -805,6 +805,7 @@ export interface BuildSystemPromptOptions {
|
|
|
805
805
|
* as separate entries so providers can cache prompt prefixes without concatenating blocks.
|
|
806
806
|
*/
|
|
807
807
|
export async function buildSystemPrompt(options: BuildSystemPromptOptions = {}): Promise<BuildSystemPromptResult> {
|
|
808
|
+
const toolMap = options.tools ? new Map(options.tools.map(tool => [tool.name, tool])) : undefined;
|
|
808
809
|
return await buildSystemPromptInternal({
|
|
809
810
|
cwd: options.cwd,
|
|
810
811
|
customPrompt: options.customPrompt,
|
|
@@ -812,6 +813,8 @@ export async function buildSystemPrompt(options: BuildSystemPromptOptions = {}):
|
|
|
812
813
|
contextFiles: options.contextFiles,
|
|
813
814
|
appendSystemPrompt: options.appendPrompt,
|
|
814
815
|
inlineToolDescriptors: options.inlineToolDescriptors,
|
|
816
|
+
toolNames: options.tools?.map(tool => tool.name),
|
|
817
|
+
tools: toolMap ? buildSystemPromptToolMetadata(toolMap) : undefined,
|
|
815
818
|
});
|
|
816
819
|
}
|
|
817
820
|
|
|
@@ -1617,12 +1620,13 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
1617
1620
|
| ((liveSession: AgentSession, activation: DeferredMCPActivation) => void)
|
|
1618
1621
|
| undefined;
|
|
1619
1622
|
const startupQuiet = settings.get("startup.quiet");
|
|
1620
|
-
const
|
|
1621
|
-
if (!options.hasUI || startupQuiet
|
|
1622
|
-
|
|
1623
|
+
const onMCPStatus = (event: McpConnectionStatusEvent) => {
|
|
1624
|
+
if (!options.hasUI || startupQuiet) return;
|
|
1625
|
+
if (event.type === "connecting" && event.serverNames.length === 0) return;
|
|
1626
|
+
eventBus.emit(MCP_CONNECTION_STATUS_EVENT_CHANNEL, event);
|
|
1623
1627
|
};
|
|
1624
1628
|
const mcpDiscoverOptions = {
|
|
1625
|
-
|
|
1629
|
+
onStatus: onMCPStatus,
|
|
1626
1630
|
enableProjectConfig: settings.get("mcp.enableProjectConfig") ?? true,
|
|
1627
1631
|
// Always filter Exa - we have native integration
|
|
1628
1632
|
filterExa: true,
|
|
@@ -2412,9 +2416,9 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
2412
2416
|
: undefined;
|
|
2413
2417
|
const transformProviderContext =
|
|
2414
2418
|
obfuscator || snapcompactInline
|
|
2415
|
-
? (context: Context, transformModel: Model): Context => {
|
|
2419
|
+
? async (context: Context, transformModel: Model): Promise<Context> => {
|
|
2416
2420
|
let transformed = obfuscator ? obfuscateProviderContext(obfuscator, context) : context;
|
|
2417
|
-
if (snapcompactInline) transformed = snapcompactInline.transform(transformed, transformModel);
|
|
2421
|
+
if (snapcompactInline) transformed = await snapcompactInline.transform(transformed, transformModel);
|
|
2418
2422
|
return transformed;
|
|
2419
2423
|
}
|
|
2420
2424
|
: undefined;
|
|
@@ -2474,7 +2478,7 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|
|
2474
2478
|
presencePenalty: settings.get("presencePenalty") >= 0 ? settings.get("presencePenalty") : undefined,
|
|
2475
2479
|
repetitionPenalty: settings.get("repetitionPenalty") >= 0 ? settings.get("repetitionPenalty") : undefined,
|
|
2476
2480
|
serviceTier: initialServiceTier,
|
|
2477
|
-
hideThinkingSummary: settings.get("
|
|
2481
|
+
hideThinkingSummary: settings.get("omitThinking"),
|
|
2478
2482
|
kimiApiFormat: settings.get("providers.kimiApiFormat") ?? "anthropic",
|
|
2479
2483
|
preferWebsockets: preferOpenAICodexWebsockets,
|
|
2480
2484
|
getToolContext: tc => toolContextStore.getContext(tc),
|