@oh-my-pi/pi-coding-agent 16.5.0 → 16.5.2
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 +91 -0
- package/dist/cli.js +3556 -3504
- package/dist/types/advisor/advise-tool.d.ts +12 -1
- package/dist/types/advisor/runtime.d.ts +41 -1
- package/dist/types/cli/args.d.ts +2 -0
- package/dist/types/cli/update-cli.d.ts +4 -1
- package/dist/types/cli/usage-cli.d.ts +3 -0
- package/dist/types/cli/usage-error.d.ts +4 -0
- package/dist/types/config/api-key-resolver.d.ts +2 -2
- package/dist/types/config/model-registry.d.ts +3 -3
- package/dist/types/config/model-resolver.d.ts +8 -1
- package/dist/types/config/models-config.d.ts +1 -1
- package/dist/types/config/settings-schema.d.ts +10 -0
- package/dist/types/discovery/substitute-plugin-root.d.ts +22 -0
- package/dist/types/eval/__tests__/process-entry-import.test.d.ts +1 -0
- package/dist/types/eval/backend.d.ts +3 -3
- package/dist/types/eval/bridge-timeout.d.ts +9 -1
- package/dist/types/eval/js/context-manager.d.ts +5 -3
- package/dist/types/eval/js/process-entry.d.ts +6 -0
- package/dist/types/eval/js/worker-core.d.ts +15 -1
- package/dist/types/eval/py/spawn-options.d.ts +10 -0
- package/dist/types/eval/py/tool-bridge.d.ts +1 -0
- package/dist/types/extensibility/custom-tools/types.d.ts +3 -0
- package/dist/types/extensibility/extensions/runner.d.ts +3 -1
- package/dist/types/extensibility/extensions/types.d.ts +3 -0
- package/dist/types/extensibility/extensions/wrapper.d.ts +3 -6
- package/dist/types/extensibility/plugins/bun-git-cache.d.ts +3 -0
- package/dist/types/goals/guided-setup.d.ts +12 -0
- package/dist/types/internal-urls/history-protocol.d.ts +3 -2
- package/dist/types/internal-urls/memory-protocol.d.ts +6 -7
- package/dist/types/internal-urls/registry-helpers.d.ts +19 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/mcp/oauth-discovery.d.ts +2 -0
- package/dist/types/mcp/oauth-flow.d.ts +2 -0
- package/dist/types/modes/components/__tests__/dynamic-border.test.d.ts +1 -0
- package/dist/types/modes/components/agent-hub.d.ts +10 -0
- package/dist/types/modes/components/dynamic-border.d.ts +5 -3
- package/dist/types/modes/components/login-dialog.d.ts +2 -0
- package/dist/types/modes/components/mcp-add-wizard.d.ts +1 -0
- package/dist/types/modes/components/read-tool-group.d.ts +0 -2
- package/dist/types/modes/components/transcript-container.d.ts +3 -2
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +1 -0
- package/dist/types/modes/magic-keyword-boundary.d.ts +9 -0
- package/dist/types/modes/orchestrate.d.ts +1 -1
- package/dist/types/modes/rpc/host-tools.d.ts +2 -0
- package/dist/types/modes/rpc/rpc-mode.d.ts +26 -6
- package/dist/types/modes/types.d.ts +1 -0
- package/dist/types/modes/ultrathink.d.ts +1 -1
- package/dist/types/modes/utils/transcript-render-helpers.d.ts +12 -0
- package/dist/types/modes/workflow.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +6 -0
- package/dist/types/session/exit-diagnostics.d.ts +11 -0
- package/dist/types/session/messages.d.ts +15 -0
- package/dist/types/slash-commands/helpers/active-oauth-account.d.ts +11 -0
- package/dist/types/subprocess/worker-client.d.ts +6 -0
- package/dist/types/tools/bash-skill-urls.d.ts +1 -0
- package/dist/types/tools/grep.d.ts +0 -2
- package/dist/types/tools/read.d.ts +0 -4
- package/dist/types/web/search/provider.d.ts +10 -3
- package/dist/types/web/search/providers/codex.d.ts +5 -4
- package/package.json +12 -12
- package/src/advisor/__tests__/advisor.test.ts +917 -42
- package/src/advisor/advise-tool.ts +17 -1
- package/src/advisor/runtime.ts +270 -67
- package/src/autolearn/controller.ts +15 -3
- package/src/autoresearch/dashboard.ts +2 -2
- package/src/cli/args.ts +12 -0
- package/src/cli/auth-broker-cli.ts +30 -11
- package/src/cli/auth-gateway-cli.ts +5 -1
- package/src/cli/config-cli.ts +15 -3
- package/src/cli/dry-balance-cli.ts +14 -4
- package/src/cli/flag-tables.ts +21 -7
- package/src/cli/update-cli.ts +62 -11
- package/src/cli/usage-cli.ts +58 -5
- package/src/cli/usage-error.ts +7 -0
- package/src/cli.ts +23 -1
- package/src/commands/acp.ts +11 -2
- package/src/commands/launch.ts +12 -3
- package/src/commands/token.ts +3 -1
- package/src/config/api-key-resolver.ts +12 -3
- package/src/config/config-file.ts +30 -12
- package/src/config/model-registry.ts +7 -7
- package/src/config/model-resolver.ts +21 -7
- package/src/config/models-config.ts +1 -1
- package/src/config/settings-schema.ts +10 -0
- package/src/cursor.ts +2 -0
- package/src/discovery/claude-plugins.ts +9 -3
- package/src/discovery/omp-plugins.ts +6 -2
- package/src/discovery/substitute-plugin-root.ts +32 -0
- package/src/eval/__tests__/agent-bridge.test.ts +19 -14
- package/src/eval/__tests__/bridge-timeout.test.ts +106 -0
- package/src/eval/__tests__/js-context-manager.test.ts +158 -1
- package/src/eval/__tests__/kernel-spawn.test.ts +12 -0
- package/src/eval/__tests__/prelude-agent.test.ts +20 -0
- package/src/eval/__tests__/process-entry-import.test.ts +27 -0
- package/src/eval/agent-bridge.ts +121 -116
- package/src/eval/backend.ts +3 -3
- package/src/eval/bridge-timeout.ts +20 -2
- package/src/eval/executor-base.ts +85 -7
- package/src/eval/jl/kernel.ts +2 -1
- package/src/eval/js/context-manager.ts +109 -32
- package/src/eval/js/process-entry.ts +27 -0
- package/src/eval/js/shared/runtime.ts +1 -1
- package/src/eval/js/worker-core.ts +70 -9
- package/src/eval/js/worker-entry.ts +1 -1
- package/src/eval/py/__tests__/prelude.test.ts +72 -0
- package/src/eval/py/kernel.ts +2 -1
- package/src/eval/py/prelude.py +28 -1
- package/src/eval/py/spawn-options.ts +13 -0
- package/src/eval/py/tool-bridge.ts +13 -14
- package/src/eval/rb/kernel.ts +2 -1
- package/src/exec/bash-executor.ts +30 -43
- package/src/extensibility/custom-tools/types.ts +3 -0
- package/src/extensibility/extensions/runner.ts +3 -0
- package/src/extensibility/extensions/types.ts +3 -0
- package/src/extensibility/extensions/wrapper.ts +18 -18
- package/src/extensibility/plugins/bun-git-cache.ts +91 -0
- package/src/extensibility/plugins/legacy-pi-compat.ts +32 -16
- package/src/extensibility/plugins/manager.ts +28 -7
- package/src/goals/guided-setup.ts +29 -1
- package/src/internal-urls/history-protocol.ts +95 -15
- package/src/internal-urls/memory-protocol.ts +13 -9
- package/src/internal-urls/registry-helpers.ts +50 -1
- package/src/launch/broker.ts +38 -25
- package/src/lsp/client.ts +7 -1
- package/src/main.ts +29 -0
- package/src/mcp/oauth-discovery.ts +20 -1
- package/src/mcp/oauth-flow.ts +3 -1
- package/src/mcp/tool-bridge.ts +57 -6
- package/src/modes/components/__tests__/dynamic-border.test.ts +55 -0
- package/src/modes/components/agent-dashboard.ts +2 -2
- package/src/modes/components/agent-hub.ts +15 -2
- package/src/modes/components/agent-transcript-viewer.ts +2 -2
- package/src/modes/components/chat-transcript-builder.ts +26 -4
- package/src/modes/components/dynamic-border.ts +9 -6
- package/src/modes/components/extensions/extension-list.ts +2 -2
- package/src/modes/components/hook-selector.ts +10 -4
- package/src/modes/components/login-dialog.ts +5 -0
- package/src/modes/components/mcp-add-wizard.ts +5 -0
- package/src/modes/components/plan-review-overlay.ts +11 -11
- package/src/modes/components/read-tool-group.ts +1 -8
- package/src/modes/components/status-line/component.ts +10 -1
- package/src/modes/components/transcript-container.ts +110 -7
- package/src/modes/controllers/command-controller.ts +12 -4
- package/src/modes/controllers/event-controller.ts +80 -15
- package/src/modes/controllers/input-controller.ts +4 -2
- package/src/modes/controllers/mcp-command-controller.ts +6 -7
- package/src/modes/controllers/selector-controller.ts +24 -5
- package/src/modes/controllers/todo-command-controller.ts +18 -14
- package/src/modes/interactive-mode.ts +7 -3
- package/src/modes/magic-keyword-boundary.ts +23 -0
- package/src/modes/orchestrate.ts +6 -5
- package/src/modes/print-mode.ts +9 -0
- package/src/modes/prompt-action-autocomplete.ts +6 -1
- package/src/modes/rpc/host-tools.ts +15 -0
- package/src/modes/rpc/rpc-mode.ts +123 -48
- package/src/modes/types.ts +1 -1
- package/src/modes/ultrathink.ts +6 -5
- package/src/modes/utils/transcript-render-helpers.ts +54 -0
- package/src/modes/utils/ui-helpers.ts +27 -1
- package/src/modes/workflow.ts +6 -5
- package/src/prompts/advisor/system.md +1 -0
- package/src/prompts/system/system-prompt.md +1 -0
- package/src/prompts/tools/eval.md +2 -2
- package/src/prompts/tools/grep.md +1 -2
- package/src/prompts/tools/read.md +2 -4
- package/src/sdk.ts +61 -34
- package/src/session/agent-session.ts +283 -39
- package/src/session/exit-diagnostics.ts +108 -0
- package/src/session/messages.test.ts +66 -0
- package/src/session/messages.ts +37 -0
- package/src/session/streaming-output.ts +40 -12
- package/src/slash-commands/helpers/active-oauth-account.ts +22 -2
- package/src/slash-commands/helpers/logout.ts +23 -3
- package/src/slash-commands/helpers/usage-report.ts +14 -2
- package/src/subprocess/worker-client.ts +9 -2
- package/src/system-prompt.test.ts +36 -0
- package/src/system-prompt.ts +1 -1
- package/src/task/executor.ts +8 -0
- package/src/task/render.test.ts +36 -0
- package/src/task/render.ts +55 -43
- package/src/tools/bash-skill-urls.ts +4 -1
- package/src/tools/bash.ts +1 -0
- package/src/tools/browser/registry.ts +17 -3
- package/src/tools/eval.ts +14 -9
- package/src/tools/gh.ts +3 -1
- package/src/tools/grep.ts +5 -45
- package/src/tools/path-utils.ts +7 -1
- package/src/tools/read.ts +23 -74
- package/src/tools/write.ts +82 -9
- package/src/tools/yield.ts +29 -1
- package/src/utils/title-generator.ts +10 -6
- package/src/web/search/index.ts +39 -22
- package/src/web/search/provider.ts +33 -16
- package/src/web/search/providers/codex.ts +68 -21
- package/src/web/search/providers/perplexity-auth.ts +20 -11
- package/src/web/search/providers/perplexity.ts +14 -2
|
@@ -2,9 +2,11 @@ import type { Component } from "@oh-my-pi/pi-tui";
|
|
|
2
2
|
/**
|
|
3
3
|
* Dynamic border component that adjusts to viewport width.
|
|
4
4
|
*
|
|
5
|
-
* Note:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Note: the module-level `theme` may be `undefined` — when loaded through jiti
|
|
6
|
+
* (separate module cache) or from a second `src` module graph in npm-package
|
|
7
|
+
* installs, where the host bundle assigns `theme` but this copy never sees it
|
|
8
|
+
* (issue #5366). Both the default color and `render()` degrade to plain,
|
|
9
|
+
* unstyled output instead of crashing the TUI.
|
|
8
10
|
*/
|
|
9
11
|
export declare class DynamicBorder implements Component {
|
|
10
12
|
#private;
|
|
@@ -36,5 +36,7 @@ export declare class LoginDialogComponent extends Container {
|
|
|
36
36
|
* Called by onProgress callback
|
|
37
37
|
*/
|
|
38
38
|
showProgress(message: string): void;
|
|
39
|
+
/** Route non-bracketed paste transports into the active login input. */
|
|
40
|
+
pasteText(text: string): void;
|
|
39
41
|
handleInput(data: string): void;
|
|
40
42
|
}
|
|
@@ -21,6 +21,7 @@ export interface MCPAddWizardOAuthResult {
|
|
|
21
21
|
interface MCPAddWizardOAuthOptions {
|
|
22
22
|
serverUrl?: string;
|
|
23
23
|
resource?: string;
|
|
24
|
+
registrationUrl?: string;
|
|
24
25
|
/**
|
|
25
26
|
* External cancellation source. Aborting it tears down the in-flight OAuth
|
|
26
27
|
* flow and surfaces a neutral cancellation error. The wizard wires its own
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Component, Container, type NativeScrollbackCommittedRows, type NativeScrollbackLiveRegion, type RenderStablePrefix, type ViewportTailProvider } from "@oh-my-pi/pi-tui";
|
|
1
|
+
import { type Component, Container, type NativeScrollbackCommittedRows, type NativeScrollbackLiveRegion, type NativeScrollbackReplay, type RenderStablePrefix, type ViewportTailProvider } from "@oh-my-pi/pi-tui";
|
|
2
2
|
/**
|
|
3
3
|
* Transcript container that renders every block's current content each frame
|
|
4
4
|
* and reports the native-scrollback exactness boundary
|
|
@@ -24,11 +24,12 @@ import { type Component, Container, type NativeScrollbackCommittedRows, type Nat
|
|
|
24
24
|
* through {@link RenderStablePrefix} so the engine can skip marker scanning,
|
|
25
25
|
* line preparation, and the committed-prefix audit for those rows.
|
|
26
26
|
*/
|
|
27
|
-
export declare class TranscriptContainer extends Container implements NativeScrollbackLiveRegion, NativeScrollbackCommittedRows, RenderStablePrefix, ViewportTailProvider {
|
|
27
|
+
export declare class TranscriptContainer extends Container implements NativeScrollbackLiveRegion, NativeScrollbackCommittedRows, NativeScrollbackReplay, RenderStablePrefix, ViewportTailProvider {
|
|
28
28
|
#private;
|
|
29
29
|
invalidate(): void;
|
|
30
30
|
clear(): void;
|
|
31
31
|
setNativeScrollbackCommittedRows(rows: number): void;
|
|
32
|
+
prepareNativeScrollbackReplay(): void;
|
|
32
33
|
getRenderStablePrefixRows(): number;
|
|
33
34
|
getNativeScrollbackLiveRegionStart(): number | undefined;
|
|
34
35
|
/**
|
|
@@ -330,6 +330,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
330
330
|
showDebugSelector(): Promise<void>;
|
|
331
331
|
showAgentHub(options?: {
|
|
332
332
|
requireContent?: boolean;
|
|
333
|
+
armCloseTap?: boolean;
|
|
333
334
|
}): void;
|
|
334
335
|
resetObserverRegistry(): void;
|
|
335
336
|
handleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a case-sensitive magic-keyword matcher for prose punctuation boundaries.
|
|
3
|
+
*
|
|
4
|
+
* Sentence punctuation and quotes may touch the keyword, but letters, digits,
|
|
5
|
+
* underscores, slashes, backslashes, hyphens, file-extension dots, symbol
|
|
6
|
+
* references (`foo::keyword`), and immediate call parentheses (`keyword()`)
|
|
7
|
+
* keep the occurrence embedded in code rather than prose.
|
|
8
|
+
*/
|
|
9
|
+
export declare function magicKeywordRegex(keyword: string, flags?: string): RegExp;
|
|
@@ -3,7 +3,7 @@ import { type KeywordHighlighter } from "./gradient-highlight.js";
|
|
|
3
3
|
export declare const ORCHESTRATE_NOTICE: string;
|
|
4
4
|
/**
|
|
5
5
|
* Whether `text` contains the standalone keyword "orchestrate" (lowercase,
|
|
6
|
-
*
|
|
6
|
+
* prose-delimited) in prose — never inside a code block, inline code span,
|
|
7
7
|
* or XML/HTML section.
|
|
8
8
|
*/
|
|
9
9
|
export declare function containsOrchestrate(text: string): boolean;
|
|
@@ -12,5 +12,7 @@ export declare class RpcHostToolBridge {
|
|
|
12
12
|
handleUpdate(frame: RpcHostToolUpdate): boolean;
|
|
13
13
|
requestExecution(definition: RpcHostToolDefinition, toolCallId: string, args: Record<string, unknown>, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<unknown>): Promise<AgentToolResult<unknown>>;
|
|
14
14
|
rejectAllPending(message: string): void;
|
|
15
|
+
/** Reject active and future host tool requests after the RPC client disconnects. */
|
|
16
|
+
close(message: string): void;
|
|
15
17
|
}
|
|
16
18
|
export {};
|
|
@@ -8,6 +8,13 @@ export type PendingExtensionRequest = {
|
|
|
8
8
|
resolve: (response: RpcExtensionUIResponse) => void;
|
|
9
9
|
reject: (error: Error) => void;
|
|
10
10
|
};
|
|
11
|
+
/** Pending extension UI request map that can fail closed when the RPC client disconnects. */
|
|
12
|
+
export declare class RpcPendingExtensionRequests extends Map<string, PendingExtensionRequest> {
|
|
13
|
+
#private;
|
|
14
|
+
set(id: string, request: PendingExtensionRequest): this;
|
|
15
|
+
/** Reject every active and future extension UI request. */
|
|
16
|
+
rejectAll(message: string): void;
|
|
17
|
+
}
|
|
11
18
|
type RpcOutput = (obj: RpcResponse | RpcExtensionUIRequest | RpcHostToolCallRequest | RpcHostToolCancelRequest | RpcHostUriRequest | RpcHostUriCancelRequest | object) => void;
|
|
12
19
|
export type RpcSessionChangeCommand = Extract<RpcCommand, {
|
|
13
20
|
type: "new_session";
|
|
@@ -84,15 +91,16 @@ export interface RpcInputFrameDeps {
|
|
|
84
91
|
onHostToolUpdate: (frame: RpcHostToolUpdate) => void;
|
|
85
92
|
onHostUriResult: (frame: RpcHostUriResult) => void;
|
|
86
93
|
}
|
|
94
|
+
/** Dispatch side-channel frames that must overtake the serialized command queue. */
|
|
95
|
+
export declare function dispatchRpcControlFrame(parsed: unknown, deps: RpcInputFrameDeps): boolean;
|
|
87
96
|
/**
|
|
88
97
|
* Dispatch a single parsed frame from the RPC input stream.
|
|
89
98
|
*
|
|
90
|
-
* Bash commands are dispatched in the background so the caller
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* not guaranteed and clients MUST match on `id`.
|
|
99
|
+
* Bash commands are dispatched in the background so the caller can keep reading
|
|
100
|
+
* subsequent frames while a shell command is still running. This lets a client
|
|
101
|
+
* send `abort_bash` while a long-running `bash` is in flight. Response
|
|
102
|
+
* correlation is preserved via each command's `id`; ordering across concurrent
|
|
103
|
+
* commands is not guaranteed and clients MUST match on `id`.
|
|
96
104
|
*
|
|
97
105
|
* @returns `undefined` when the frame was routed to a side-channel handler
|
|
98
106
|
* (extension UI response, host tool/URI frames) or dispatched in the
|
|
@@ -101,6 +109,18 @@ export interface RpcInputFrameDeps {
|
|
|
101
109
|
* on non-`bash` commands propagate; the caller is expected to wrap them.
|
|
102
110
|
*/
|
|
103
111
|
export declare function dispatchRpcInputFrame(parsed: unknown, deps: RpcInputFrameDeps): Promise<void> | undefined;
|
|
112
|
+
/** Serializes ordinary RPC commands while allowing control frames to dispatch immediately. */
|
|
113
|
+
export declare class RpcInputDispatcher {
|
|
114
|
+
#private;
|
|
115
|
+
constructor(options: {
|
|
116
|
+
deps: RpcInputFrameDeps;
|
|
117
|
+
afterSerialCommand?: () => Promise<void>;
|
|
118
|
+
});
|
|
119
|
+
/** Accept a parsed input frame without blocking the stdin reader. */
|
|
120
|
+
dispatch(parsed: unknown): void;
|
|
121
|
+
/** Await every accepted serial command, including commands queued before EOF. */
|
|
122
|
+
drain(): Promise<void>;
|
|
123
|
+
}
|
|
104
124
|
/**
|
|
105
125
|
* Coordinates deferred shutdown with in-flight background input tasks.
|
|
106
126
|
*
|
|
@@ -3,7 +3,7 @@ import { type KeywordHighlighter } from "./gradient-highlight.js";
|
|
|
3
3
|
export declare const ULTRATHINK_NOTICE: string;
|
|
4
4
|
/**
|
|
5
5
|
* Whether `text` contains the standalone keyword "ultrathink" (lowercase,
|
|
6
|
-
*
|
|
6
|
+
* prose-delimited) in prose — never inside a code block, inline code span,
|
|
7
7
|
* or XML/HTML section.
|
|
8
8
|
*/
|
|
9
9
|
export declare function containsUltrathink(text: string): boolean;
|
|
@@ -38,6 +38,18 @@ export declare function buildFileMentionBlock(files: FileMentionMessage["files"]
|
|
|
38
38
|
* canonicalization) — i.e. content that closes the current read-tool run.
|
|
39
39
|
*/
|
|
40
40
|
export declare function assistantHasVisibleContent(message: AssistantAgentMessage): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Split mixed assistant turns into visible text before tool execution and
|
|
43
|
+
* visible text segments that must render immediately after the preceding tool.
|
|
44
|
+
* Cursor can return intro text, tool calls, progress text, and the final answer
|
|
45
|
+
* in one assistant message; keeping every text block in the leading assistant
|
|
46
|
+
* block buries post-tool text above tool results in the transcript.
|
|
47
|
+
*/
|
|
48
|
+
export declare function splitAssistantMessageToolTimeline(message: AssistantAgentMessage): {
|
|
49
|
+
beforeTools: AssistantAgentMessage;
|
|
50
|
+
afterToolCalls: ReadonlyMap<string, AssistantAgentMessage>;
|
|
51
|
+
hasToolCalls: boolean;
|
|
52
|
+
};
|
|
41
53
|
/**
|
|
42
54
|
* Normalize raw tool-call arguments to a plain record, collapsing non-object or
|
|
43
55
|
* array values to an empty object.
|
|
@@ -7,7 +7,7 @@ export declare function renderWorkflowNotice({ taskBatch }: {
|
|
|
7
7
|
}): string;
|
|
8
8
|
/**
|
|
9
9
|
* Whether `text` contains the standalone keyword "workflowz"
|
|
10
|
-
* (lowercase,
|
|
10
|
+
* (lowercase, prose-delimited) in prose — never inside a code block, inline
|
|
11
11
|
* code span, or XML/HTML section.
|
|
12
12
|
*/
|
|
13
13
|
export declare function containsWorkflow(text: string): boolean;
|
|
@@ -811,6 +811,11 @@ export declare class AgentSession {
|
|
|
811
811
|
* from role configuration (e.g., "anthropic/claude-sonnet-4-5:xhigh").
|
|
812
812
|
*/
|
|
813
813
|
resolveRoleModelWithThinking(role: string): ResolvedModelRoleValue;
|
|
814
|
+
/**
|
|
815
|
+
* Resolve the explicit thinking suffix that should apply when a temporary
|
|
816
|
+
* picker selects a model already assigned to a configured role.
|
|
817
|
+
*/
|
|
818
|
+
resolveTemporaryModelThinkingLevel(model: Model): ConfiguredThinkingLevel | undefined;
|
|
814
819
|
get promptTemplates(): ReadonlyArray<PromptTemplate>;
|
|
815
820
|
/** Replace file-based slash commands used for prompt expansion. */
|
|
816
821
|
setSlashCommands(slashCommands: FileSlashCommand[]): void;
|
|
@@ -872,6 +877,7 @@ export declare class AgentSession {
|
|
|
872
877
|
triggerTurn?: boolean;
|
|
873
878
|
deliverAs?: "steer" | "followUp" | "nextTurn";
|
|
874
879
|
queueChipText?: string;
|
|
880
|
+
acceptTerminalEmptyStop?: boolean;
|
|
875
881
|
}): Promise<boolean>;
|
|
876
882
|
/**
|
|
877
883
|
* Send a user message through the prompt flow.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AssistantMessage } from "@oh-my-pi/pi-ai";
|
|
1
2
|
import type { SessionEntry } from "./session-entries.js";
|
|
2
3
|
export declare const TOOL_EXECUTION_START_CUSTOM_TYPE = "tool_execution_start";
|
|
3
4
|
export declare const SESSION_EXIT_CUSTOM_TYPE = "session_exit";
|
|
@@ -35,6 +36,16 @@ export interface SessionExitData {
|
|
|
35
36
|
recordedAt: string;
|
|
36
37
|
pendingToolCalls?: PendingToolCallDiagnostic[];
|
|
37
38
|
}
|
|
39
|
+
export interface AssistantModelMetadata {
|
|
40
|
+
api: AssistantMessage["api"];
|
|
41
|
+
provider: string;
|
|
42
|
+
model: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* createInterruptedTurnAbortMessage returns a terminal assistant record when
|
|
46
|
+
* the latest persisted process exit follows a non-terminal conversation tail.
|
|
47
|
+
*/
|
|
48
|
+
export declare function createInterruptedTurnAbortMessage(entries: readonly SessionEntry[], fallbackModel?: AssistantModelMetadata): AssistantMessage | undefined;
|
|
38
49
|
/**
|
|
39
50
|
* Project full tool-call arguments down to the fields the pending-tool-call
|
|
40
51
|
* resume warning actually renders (`command`/`path`), truncated. Returns
|
|
@@ -134,6 +134,21 @@ export declare function wrapSteeringForModel(messages: AgentMessage[]): AgentMes
|
|
|
134
134
|
* pure local mutation and intentionally does neither.
|
|
135
135
|
*/
|
|
136
136
|
export declare function stripImagesFromMessage(message: AgentMessage): number;
|
|
137
|
+
/**
|
|
138
|
+
* Replace every `ImageContent` block in already-converted LLM {@link Message}s
|
|
139
|
+
* with a text placeholder, returning a new array only when something changed.
|
|
140
|
+
*
|
|
141
|
+
* Unlike {@link stripImagesFromMessage} (which mutates persisted `AgentMessage`s
|
|
142
|
+
* in place), this operates on the ephemeral provider-request view produced by
|
|
143
|
+
* {@link convertToLlm}, so history on disk keeps its images while the outbound
|
|
144
|
+
* request is scrubbed. Used to keep image blocks off the wire when the active
|
|
145
|
+
* model has no vision support (or `images.blockImages` is set) — e.g. after
|
|
146
|
+
* switching from a vision model to a text-only one mid-session (#5400).
|
|
147
|
+
*
|
|
148
|
+
* Consecutive placeholder texts collapse into one so a message that was nothing
|
|
149
|
+
* but images does not balloon into a run of identical notes.
|
|
150
|
+
*/
|
|
151
|
+
export declare function replaceLlmImagesWithText(messages: Message[], placeholder: string): Message[];
|
|
137
152
|
/**
|
|
138
153
|
* Message type for bash executions via the ! command.
|
|
139
154
|
*/
|
|
@@ -4,6 +4,17 @@ import type { OAuthAccountIdentity } from "../../session/auth-storage.js";
|
|
|
4
4
|
* True when a single usage-limit column belongs to the given OAuth identity.
|
|
5
5
|
*
|
|
6
6
|
* Single definition of the matching rules for both `/usage` renderers:
|
|
7
|
+
* - `orgId` ↔ report metadata `orgId` — a GATE that QUALIFIES the base
|
|
8
|
+
* identity, never a replacement for it. Mismatched org presence or
|
|
9
|
+
* different orgs never match: two subscriptions (orgs) can share one
|
|
10
|
+
* email, so an org-scoped identity matches only its own org's reports and
|
|
11
|
+
* an org-less legacy identity never claims an org-attributed report via
|
|
12
|
+
* the shared email. A SHARED org still requires the base-identity match
|
|
13
|
+
* below — Anthropic Team seats have per-user pools yet share the org id
|
|
14
|
+
* in report metadata. Only an org-only identity (no base identifiers
|
|
15
|
+
* recovered at all) matches on the org alone. When neither side carries
|
|
16
|
+
* an org, the base fallback applies unchanged (providers without orgs
|
|
17
|
+
* keep their former behavior).
|
|
7
18
|
* - `accountId` ↔ report metadata `accountId`/`account_id` or `limit.scope.accountId`
|
|
8
19
|
* - `email` ↔ report metadata `email`
|
|
9
20
|
* - `projectId` ↔ report metadata `projectId` or `limit.scope.projectId`
|
|
@@ -118,6 +118,12 @@ export declare function createWorkerSubprocess<Outbound>(options: {
|
|
|
118
118
|
spawnCommand: WorkerSpawnCommand;
|
|
119
119
|
env: Record<string, string>;
|
|
120
120
|
exitLabel: string;
|
|
121
|
+
/** Start the child as a new process-group/session leader where Bun supports it. */
|
|
122
|
+
detached?: boolean;
|
|
123
|
+
/** Treat exit code 0 as unexpected; eval cells can call process.exit(0). */
|
|
124
|
+
reportCleanExit?: boolean;
|
|
125
|
+
/** Whether an idle worker should stop keeping the parent event loop alive. */
|
|
126
|
+
unref?: boolean;
|
|
121
127
|
}): SpawnedSubprocess<Outbound>;
|
|
122
128
|
/**
|
|
123
129
|
* Wrap a {@link SpawnedSubprocess} as a {@link WorkerHandle}. The `send`
|
|
@@ -8,7 +8,6 @@ import type { OutputMeta } from "./output-meta.js";
|
|
|
8
8
|
declare const searchSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
9
9
|
pattern: string;
|
|
10
10
|
path?: string | undefined;
|
|
11
|
-
selector?: string | undefined;
|
|
12
11
|
case?: boolean | undefined;
|
|
13
12
|
gitignore?: boolean | undefined;
|
|
14
13
|
skip?: number | null | undefined;
|
|
@@ -67,7 +66,6 @@ export declare class GrepTool implements AgentTool<typeof searchSchema, GrepTool
|
|
|
67
66
|
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
68
67
|
pattern: string;
|
|
69
68
|
path?: string | undefined;
|
|
70
|
-
selector?: string | undefined;
|
|
71
69
|
case?: boolean | undefined;
|
|
72
70
|
gitignore?: boolean | undefined;
|
|
73
71
|
skip?: number | null | undefined;
|
|
@@ -7,7 +7,6 @@ import { type TruncationResult } from "../session/streaming-output.js";
|
|
|
7
7
|
import { type OutputMeta } from "./output-meta.js";
|
|
8
8
|
declare const readSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
9
9
|
path: string;
|
|
10
|
-
selector?: string | undefined;
|
|
11
10
|
}, {}>;
|
|
12
11
|
export type ReadToolInput = typeof readSchema.infer;
|
|
13
12
|
export interface ReadToolDetails {
|
|
@@ -60,7 +59,6 @@ export declare class ReadTool implements AgentTool<typeof readSchema, ReadToolDe
|
|
|
60
59
|
readonly description: string;
|
|
61
60
|
readonly parameters: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
62
61
|
path: string;
|
|
63
|
-
selector?: string | undefined;
|
|
64
62
|
}, {}>;
|
|
65
63
|
readonly strict = true;
|
|
66
64
|
constructor(session: ToolSession);
|
|
@@ -69,8 +67,6 @@ export declare class ReadTool implements AgentTool<typeof readSchema, ReadToolDe
|
|
|
69
67
|
interface ReadRenderArgs {
|
|
70
68
|
path?: unknown;
|
|
71
69
|
file_path?: unknown;
|
|
72
|
-
selector?: unknown;
|
|
73
|
-
sel?: string;
|
|
74
70
|
offset?: number;
|
|
75
71
|
limit?: number;
|
|
76
72
|
raw?: boolean;
|
|
@@ -24,9 +24,16 @@ export declare function setPreferredSearchProvider(provider: SearchProviderId |
|
|
|
24
24
|
export declare function setExcludedSearchProviders(providers: readonly SearchProviderId[]): void;
|
|
25
25
|
/** `true` when settings exclude `id` from web search (auto chain and the Public Web fan-out). */
|
|
26
26
|
export declare function isSearchProviderExcluded(id: SearchProviderId): boolean;
|
|
27
|
+
export interface SearchProviderCandidate {
|
|
28
|
+
id: SearchProviderId;
|
|
29
|
+
explicit: boolean;
|
|
30
|
+
}
|
|
31
|
+
/** Return provider candidates in fallback order without loading their modules. */
|
|
32
|
+
export declare function resolveProviderCandidates(preferredProvider?: SearchProviderId | "auto"): SearchProviderCandidate[];
|
|
27
33
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
34
|
+
* Resolve the complete available provider chain.
|
|
35
|
+
*
|
|
36
|
+
* This compatibility helper loads every candidate. Search execution should use
|
|
37
|
+
* {@link resolveProviderCandidates} so fallback modules load only when reached.
|
|
31
38
|
*/
|
|
32
39
|
export declare function resolveProviderChain(authStorage: AuthStorage, preferredProvider?: SearchProviderId | "auto"): Promise<SearchProvider[]>;
|
|
@@ -17,10 +17,11 @@ export interface CodexSearchParams {
|
|
|
17
17
|
* Default-model behavior:
|
|
18
18
|
* - If `PI_CODEX_WEB_SEARCH_MODEL` is set, use it exactly once and surface any
|
|
19
19
|
* upstream error verbatim.
|
|
20
|
-
* - Otherwise prefer ChatGPT-account-safe bundled defaults (GPT-5.
|
|
21
|
-
*
|
|
22
|
-
* known 400 "model is not supported" family. This avoids
|
|
23
|
-
* `gpt-5-codex-mini` first on ChatGPT accounts, which OpenAI
|
|
20
|
+
* - Otherwise prefer ChatGPT-account-safe bundled defaults (GPT-5.6 Luna,
|
|
21
|
+
* Terra, Sol, GPT-5.5, …) and retry the next candidate only when Codex
|
|
22
|
+
* returns the known 400 "model is not supported" family. This avoids
|
|
23
|
+
* selecting `gpt-5-codex-mini` first on ChatGPT accounts, which OpenAI
|
|
24
|
+
* rejects.
|
|
24
25
|
*/
|
|
25
26
|
export declare function searchCodex(params: SearchParams): Promise<SearchResponse>;
|
|
26
27
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-coding-agent",
|
|
4
|
-
"version": "16.5.
|
|
4
|
+
"version": "16.5.2",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
"@agentclientprotocol/sdk": "1.2.1",
|
|
53
53
|
"@babel/parser": "^7.29.7",
|
|
54
54
|
"@mozilla/readability": "^0.6.0",
|
|
55
|
-
"@oh-my-pi/hashline": "16.5.
|
|
56
|
-
"@oh-my-pi/omp-stats": "16.5.
|
|
57
|
-
"@oh-my-pi/pi-agent-core": "16.5.
|
|
58
|
-
"@oh-my-pi/pi-ai": "16.5.
|
|
59
|
-
"@oh-my-pi/pi-catalog": "16.5.
|
|
60
|
-
"@oh-my-pi/pi-mnemopi": "16.5.
|
|
61
|
-
"@oh-my-pi/pi-natives": "16.5.
|
|
62
|
-
"@oh-my-pi/pi-tui": "16.5.
|
|
63
|
-
"@oh-my-pi/pi-utils": "16.5.
|
|
64
|
-
"@oh-my-pi/pi-wire": "16.5.
|
|
65
|
-
"@oh-my-pi/snapcompact": "16.5.
|
|
55
|
+
"@oh-my-pi/hashline": "16.5.2",
|
|
56
|
+
"@oh-my-pi/omp-stats": "16.5.2",
|
|
57
|
+
"@oh-my-pi/pi-agent-core": "16.5.2",
|
|
58
|
+
"@oh-my-pi/pi-ai": "16.5.2",
|
|
59
|
+
"@oh-my-pi/pi-catalog": "16.5.2",
|
|
60
|
+
"@oh-my-pi/pi-mnemopi": "16.5.2",
|
|
61
|
+
"@oh-my-pi/pi-natives": "16.5.2",
|
|
62
|
+
"@oh-my-pi/pi-tui": "16.5.2",
|
|
63
|
+
"@oh-my-pi/pi-utils": "16.5.2",
|
|
64
|
+
"@oh-my-pi/pi-wire": "16.5.2",
|
|
65
|
+
"@oh-my-pi/snapcompact": "16.5.2",
|
|
66
66
|
"@opentelemetry/api": "^1.9.1",
|
|
67
67
|
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
68
68
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.220.0",
|