@oh-my-pi/pi-coding-agent 15.10.11 → 15.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -2
- package/dist/cli.js +5790 -5731
- package/dist/types/async/index.d.ts +0 -1
- package/dist/types/cli/args.d.ts +1 -0
- package/dist/types/cli/gallery-fixtures/types.d.ts +5 -0
- package/dist/types/cli-commands.d.ts +12 -0
- package/dist/types/commands/launch.d.ts +4 -0
- package/dist/types/config/api-key-resolver.d.ts +3 -0
- package/dist/types/config/keybindings.d.ts +6 -1
- package/dist/types/config/model-registry.d.ts +1 -0
- package/dist/types/config/model-resolver.d.ts +18 -0
- package/dist/types/config/settings-schema.d.ts +85 -34
- package/dist/types/config/settings.d.ts +7 -0
- package/dist/types/edit/hashline/noop-loop-guard.d.ts +72 -0
- package/dist/types/eval/py/executor.d.ts +5 -0
- package/dist/types/eval/py/kernel.d.ts +6 -1
- package/dist/types/eval/py/runtime.d.ts +9 -0
- package/dist/types/exec/bash-executor.d.ts +2 -0
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/extensibility/custom-tools/types.d.ts +2 -2
- package/dist/types/extensibility/extensions/runner.d.ts +3 -2
- package/dist/types/extensibility/extensions/types.d.ts +3 -0
- package/dist/types/extensibility/shared-events.d.ts +2 -2
- package/dist/types/internal-urls/history-protocol.d.ts +14 -0
- package/dist/types/internal-urls/index.d.ts +1 -0
- package/dist/types/internal-urls/types.d.ts +1 -1
- package/dist/types/irc/bus.d.ts +66 -0
- package/dist/types/memory-backend/index.d.ts +1 -0
- package/dist/types/memory-backend/runtime.d.ts +4 -0
- package/dist/types/memory-backend/types.d.ts +66 -1
- package/dist/types/modes/components/agent-hub.d.ts +30 -0
- package/dist/types/modes/components/compaction-summary-message.d.ts +10 -4
- package/dist/types/modes/components/custom-editor.d.ts +2 -0
- package/dist/types/modes/components/tool-execution.d.ts +8 -0
- package/dist/types/modes/components/ttsr-notification.d.ts +5 -1
- package/dist/types/modes/components/welcome.d.ts +3 -9
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -1
- package/dist/types/modes/index.d.ts +3 -3
- package/dist/types/modes/interactive-mode.d.ts +10 -4
- package/dist/types/modes/oauth-manual-input.d.ts +7 -0
- package/dist/types/modes/rpc/rpc-client.d.ts +39 -2
- package/dist/types/modes/rpc/rpc-mode.d.ts +31 -2
- package/dist/types/modes/rpc/rpc-subagents.d.ts +24 -0
- package/dist/types/modes/rpc/rpc-types.d.ts +75 -1
- package/dist/types/modes/setup-wizard/index.d.ts +5 -1
- package/dist/types/modes/setup-wizard/lazy.d.ts +2 -0
- package/dist/types/modes/theme/theme.d.ts +2 -1
- package/dist/types/modes/types.d.ts +5 -2
- package/dist/types/modes/utils/ui-helpers.d.ts +1 -1
- package/dist/types/registry/agent-lifecycle.d.ts +51 -0
- package/dist/types/registry/agent-registry.d.ts +16 -5
- package/dist/types/secrets/index.d.ts +1 -1
- package/dist/types/secrets/obfuscator.d.ts +8 -2
- package/dist/types/session/agent-session.d.ts +49 -32
- package/dist/types/session/messages.d.ts +2 -4
- package/dist/types/session/session-history-format.d.ts +12 -0
- package/dist/types/session/session-manager.d.ts +21 -3
- package/dist/types/session/streaming-output.d.ts +46 -0
- package/dist/types/slash-commands/acp-builtins.d.ts +16 -0
- package/dist/types/slash-commands/builtin-registry.d.ts +1 -0
- package/dist/types/slash-commands/types.d.ts +1 -1
- package/dist/types/system-prompt.d.ts +2 -0
- package/dist/types/task/executor.d.ts +12 -2
- package/dist/types/task/index.d.ts +13 -6
- package/dist/types/task/output-manager.d.ts +0 -7
- package/dist/types/task/repair-args.d.ts +8 -7
- package/dist/types/task/types.d.ts +63 -51
- package/dist/types/thinking.d.ts +4 -0
- package/dist/types/tiny/title-client.d.ts +11 -0
- package/dist/types/tiny/title-protocol.d.ts +1 -0
- package/dist/types/tools/browser/tab-worker.d.ts +3 -1
- package/dist/types/tools/find.d.ts +0 -11
- package/dist/types/tools/grouped-file-output.d.ts +0 -49
- package/dist/types/tools/index.d.ts +7 -3
- package/dist/types/tools/irc.d.ts +76 -38
- package/dist/types/tools/job.d.ts +7 -1
- package/dist/types/utils/git.d.ts +15 -2
- package/dist/types/utils/title-generator.d.ts +3 -2
- package/examples/extensions/with-deps/package.json +1 -0
- package/package.json +11 -10
- package/scripts/bundle-dist.ts +28 -19
- package/src/async/index.ts +0 -1
- package/src/auto-thinking/classifier.ts +1 -0
- package/src/cli/args.ts +3 -0
- package/src/cli/gallery-cli.ts +1 -1
- package/src/cli/gallery-fixtures/agentic.ts +230 -115
- package/src/cli/gallery-fixtures/types.ts +5 -0
- package/src/cli-commands.ts +29 -0
- package/src/cli.ts +28 -15
- package/src/commands/launch.ts +4 -0
- package/src/commit/agentic/tools/analyze-file.ts +38 -19
- package/src/commit/model-selection.ts +3 -2
- package/src/config/api-key-resolver.ts +8 -6
- package/src/config/keybindings.ts +6 -1
- package/src/config/model-registry.ts +97 -30
- package/src/config/model-resolver.ts +60 -0
- package/src/config/settings-schema.ts +99 -55
- package/src/config/settings.ts +68 -3
- package/src/edit/hashline/execute.ts +39 -2
- package/src/edit/hashline/noop-loop-guard.ts +99 -0
- package/src/eval/__tests__/agent-bridge.test.ts +5 -3
- package/src/eval/agent-bridge.ts +3 -16
- package/src/eval/completion-bridge.ts +1 -0
- package/src/eval/js/shared/prelude.txt +1 -1
- package/src/eval/py/executor.ts +29 -7
- package/src/eval/py/index.ts +6 -1
- package/src/eval/py/kernel.ts +31 -11
- package/src/eval/py/prelude.py +5 -6
- package/src/eval/py/runtime.ts +37 -0
- package/src/exec/bash-executor.ts +82 -3
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +38 -13
- package/src/extensibility/custom-tools/types.ts +2 -2
- package/src/extensibility/extensions/get-commands-handler.ts +2 -1
- package/src/extensibility/extensions/runner.ts +6 -1
- package/src/extensibility/extensions/types.ts +3 -0
- package/src/extensibility/shared-events.ts +2 -2
- package/src/hindsight/bank.ts +17 -2
- package/src/internal-urls/docs-index.generated.ts +11 -11
- package/src/internal-urls/history-protocol.ts +113 -0
- package/src/internal-urls/index.ts +1 -0
- package/src/internal-urls/router.ts +3 -1
- package/src/internal-urls/types.ts +1 -1
- package/src/irc/bus.ts +292 -0
- package/src/main.ts +26 -66
- package/src/memories/index.ts +2 -0
- package/src/memory-backend/index.ts +1 -0
- package/src/memory-backend/local-backend.ts +9 -0
- package/src/memory-backend/off-backend.ts +9 -0
- package/src/memory-backend/runtime.ts +66 -0
- package/src/memory-backend/types.ts +81 -1
- package/src/mnemopi/backend.ts +151 -4
- package/src/modes/acp/acp-agent.ts +119 -11
- package/src/modes/components/{session-observer-overlay.ts → agent-hub.ts} +586 -367
- package/src/modes/components/assistant-message.ts +19 -21
- package/src/modes/components/compaction-summary-message.ts +68 -32
- package/src/modes/components/custom-editor.ts +10 -0
- package/src/modes/components/footer.ts +3 -1
- package/src/modes/components/status-line/component.ts +118 -34
- package/src/modes/components/tool-execution.ts +31 -1
- package/src/modes/components/ttsr-notification.ts +72 -30
- package/src/modes/components/welcome.ts +9 -33
- package/src/modes/controllers/command-controller.ts +1 -1
- package/src/modes/controllers/event-controller.ts +65 -0
- package/src/modes/controllers/extension-ui-controller.ts +8 -8
- package/src/modes/controllers/input-controller.ts +19 -2
- package/src/modes/controllers/mcp-command-controller.ts +38 -3
- package/src/modes/controllers/selector-controller.ts +21 -17
- package/src/modes/index.ts +3 -21
- package/src/modes/interactive-mode.ts +47 -22
- package/src/modes/oauth-manual-input.ts +30 -3
- package/src/modes/rpc/rpc-client.ts +154 -3
- package/src/modes/rpc/rpc-mode.ts +97 -12
- package/src/modes/rpc/rpc-subagents.ts +265 -0
- package/src/modes/rpc/rpc-types.ts +81 -1
- package/src/modes/setup-wizard/index.ts +12 -2
- package/src/modes/setup-wizard/lazy.ts +16 -0
- package/src/modes/theme/theme.ts +18 -5
- package/src/modes/types.ts +5 -5
- package/src/modes/utils/hotkeys-markdown.ts +1 -0
- package/src/modes/utils/ui-helpers.ts +51 -49
- package/src/prompts/system/irc-incoming.md +3 -4
- package/src/prompts/system/orchestrate-notice.md +2 -2
- package/src/prompts/system/subagent-system-prompt.md +0 -5
- package/src/prompts/system/system-prompt.md +1 -0
- package/src/prompts/system/workflow-notice.md +2 -2
- package/src/prompts/tools/eval.md +3 -3
- package/src/prompts/tools/irc.md +29 -19
- package/src/prompts/tools/read.md +2 -2
- package/src/prompts/tools/task-summary.md +5 -16
- package/src/prompts/tools/task.md +38 -29
- package/src/registry/agent-lifecycle.ts +218 -0
- package/src/registry/agent-registry.ts +16 -5
- package/src/sdk.ts +37 -10
- package/src/secrets/index.ts +8 -1
- package/src/secrets/obfuscator.ts +39 -18
- package/src/session/agent-session.ts +422 -291
- package/src/session/messages.ts +11 -78
- package/src/session/session-history-format.ts +246 -0
- package/src/session/session-manager.ts +59 -5
- package/src/session/streaming-output.ts +226 -10
- package/src/slash-commands/acp-builtins.ts +24 -0
- package/src/slash-commands/builtin-registry.ts +20 -0
- package/src/slash-commands/types.ts +1 -1
- package/src/system-prompt.ts +14 -0
- package/src/task/executor.ts +851 -461
- package/src/task/index.ts +721 -796
- package/src/task/output-manager.ts +0 -11
- package/src/task/render.ts +148 -63
- package/src/task/repair-args.ts +21 -9
- package/src/task/types.ts +82 -66
- package/src/thinking.ts +7 -0
- package/src/tiny/title-client.ts +34 -5
- package/src/tiny/title-protocol.ts +1 -1
- package/src/tiny/worker.ts +6 -4
- package/src/tools/ask.ts +4 -2
- package/src/tools/bash.ts +61 -10
- package/src/tools/browser/tab-worker.ts +26 -7
- package/src/tools/browser.ts +28 -1
- package/src/tools/find.ts +2 -27
- package/src/tools/grouped-file-output.ts +1 -118
- package/src/tools/image-gen.ts +11 -4
- package/src/tools/index.ts +17 -13
- package/src/tools/inspect-image.ts +1 -0
- package/src/tools/irc.ts +596 -171
- package/src/tools/job.ts +41 -7
- package/src/tools/read.ts +57 -1
- package/src/tools/renderers.ts +2 -0
- package/src/tools/resolve.ts +4 -1
- package/src/utils/commit-message-generator.ts +1 -0
- package/src/utils/git.ts +267 -13
- package/src/utils/title-generator.ts +24 -5
- package/dist/types/async/support.d.ts +0 -2
- package/dist/types/modes/components/session-observer-overlay.d.ts +0 -11
- package/dist/types/task/simple-mode.d.ts +0 -8
- package/src/async/support.ts +0 -5
- package/src/task/simple-mode.ts +0 -27
|
@@ -1,58 +1,62 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* IRC tool — agent-to-agent messaging.
|
|
2
|
+
* IRC tool — agent-to-agent messaging over the process-global IrcBus.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* history are used to compute a reply without persisting it through the
|
|
11
|
-
* normal stream path. After the reply is generated, both the incoming
|
|
12
|
-
* message and the auto-reply are queued for injection into the recipient's
|
|
13
|
-
* persisted history (deferred until the recipient is idle), so the model
|
|
14
|
-
* sees the exchange on its next turn.
|
|
15
|
-
*
|
|
16
|
-
* This avoids the deadlock that arises when the recipient is blocked on a
|
|
17
|
-
* long-running tool call: the side-channel call does not depend on the
|
|
18
|
-
* recipient's main agent loop being free.
|
|
4
|
+
* `send` is fire-and-forget: the bus routes the message to the recipient
|
|
5
|
+
* (waking idle agents with a real turn, reviving parked ones via the
|
|
6
|
+
* lifecycle manager, injecting a non-interrupting aside into busy ones) and
|
|
7
|
+
* returns delivery receipts immediately. Replies are real turns by the
|
|
8
|
+
* recipient, observed with `wait` (or the `await: true` send sugar). `inbox`
|
|
9
|
+
* drains pending messages; `list` shows every addressable peer.
|
|
19
10
|
*/
|
|
20
11
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
12
|
+
import { type Component } from "@oh-my-pi/pi-tui";
|
|
21
13
|
import * as z from "zod/v4";
|
|
14
|
+
import type { Settings } from "../config/settings";
|
|
15
|
+
import type { RenderResultOptions } from "../extensibility/custom-tools/types";
|
|
16
|
+
import { type IrcDeliveryReceipt, type IrcMessage } from "../irc/bus";
|
|
17
|
+
import type { Theme } from "../modes/theme/theme";
|
|
22
18
|
import type { ToolSession } from ".";
|
|
19
|
+
/**
|
|
20
|
+
* IRC availability: there must be someone to chat with. True for every
|
|
21
|
+
* subagent (it always has a parent, and possibly siblings) and for any
|
|
22
|
+
* session that can still spawn subagents through the task tool. Only a
|
|
23
|
+
* top-level session with task spawning unavailable has no peers — no irc.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isIrcEnabled(settings: Settings, taskDepth: number): boolean;
|
|
23
26
|
declare const ircSchema: z.ZodObject<{
|
|
24
27
|
op: z.ZodEnum<{
|
|
28
|
+
inbox: "inbox";
|
|
25
29
|
list: "list";
|
|
26
30
|
send: "send";
|
|
31
|
+
wait: "wait";
|
|
27
32
|
}>;
|
|
28
33
|
to: z.ZodOptional<z.ZodString>;
|
|
29
34
|
message: z.ZodOptional<z.ZodString>;
|
|
30
|
-
|
|
35
|
+
replyTo: z.ZodOptional<z.ZodString>;
|
|
36
|
+
await: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
from: z.ZodOptional<z.ZodString>;
|
|
38
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
peek: z.ZodOptional<z.ZodBoolean>;
|
|
31
40
|
}, z.core.$strip>;
|
|
32
41
|
type IrcParams = z.infer<typeof ircSchema>;
|
|
33
|
-
interface
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
interface IrcPeerInfo {
|
|
43
|
+
id: string;
|
|
44
|
+
displayName: string;
|
|
45
|
+
kind: string;
|
|
46
|
+
status: string;
|
|
47
|
+
parentId?: string;
|
|
48
|
+
unread: number;
|
|
49
|
+
lastActivity: number;
|
|
36
50
|
}
|
|
37
51
|
export interface IrcDetails {
|
|
38
|
-
op: "send" | "list";
|
|
52
|
+
op: "send" | "wait" | "inbox" | "list";
|
|
39
53
|
from?: string;
|
|
40
54
|
to?: string;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}>;
|
|
47
|
-
notFound?: string[];
|
|
48
|
-
peers?: Array<{
|
|
49
|
-
id: string;
|
|
50
|
-
displayName: string;
|
|
51
|
-
kind: string;
|
|
52
|
-
status: string;
|
|
53
|
-
parentId?: string;
|
|
54
|
-
}>;
|
|
55
|
-
channels?: string[];
|
|
55
|
+
receipts?: IrcDeliveryReceipt[];
|
|
56
|
+
/** Message consumed by `wait` / `send await:true`; null when the wait timed out. */
|
|
57
|
+
waited?: IrcMessage | null;
|
|
58
|
+
inbox?: IrcMessage[];
|
|
59
|
+
peers?: IrcPeerInfo[];
|
|
56
60
|
}
|
|
57
61
|
export declare class IrcTool implements AgentTool<typeof ircSchema, IrcDetails> {
|
|
58
62
|
#private;
|
|
@@ -60,16 +64,22 @@ export declare class IrcTool implements AgentTool<typeof ircSchema, IrcDetails>
|
|
|
60
64
|
readonly name = "irc";
|
|
61
65
|
readonly approval: "read";
|
|
62
66
|
readonly label = "IRC";
|
|
63
|
-
readonly summary = "Send and receive messages between agents
|
|
67
|
+
readonly summary = "Send and receive messages between agents";
|
|
64
68
|
readonly description: string;
|
|
65
69
|
readonly parameters: z.ZodObject<{
|
|
66
70
|
op: z.ZodEnum<{
|
|
71
|
+
inbox: "inbox";
|
|
67
72
|
list: "list";
|
|
68
73
|
send: "send";
|
|
74
|
+
wait: "wait";
|
|
69
75
|
}>;
|
|
70
76
|
to: z.ZodOptional<z.ZodString>;
|
|
71
77
|
message: z.ZodOptional<z.ZodString>;
|
|
72
|
-
|
|
78
|
+
replyTo: z.ZodOptional<z.ZodString>;
|
|
79
|
+
await: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
from: z.ZodOptional<z.ZodString>;
|
|
81
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
peek: z.ZodOptional<z.ZodBoolean>;
|
|
73
83
|
}, z.core.$strip>;
|
|
74
84
|
readonly strict = true;
|
|
75
85
|
readonly loadMode = "discoverable";
|
|
@@ -77,4 +87,32 @@ export declare class IrcTool implements AgentTool<typeof ircSchema, IrcDetails>
|
|
|
77
87
|
static createIf(session: ToolSession): IrcTool | null;
|
|
78
88
|
execute(_toolCallId: string, params: IrcParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<IrcDetails>, _context?: AgentToolContext): Promise<AgentToolResult<IrcDetails>>;
|
|
79
89
|
}
|
|
90
|
+
type IrcRenderArgs = Partial<IrcParams>;
|
|
91
|
+
/**
|
|
92
|
+
* Display-only transcript card for live IRC traffic: `irc:incoming` DMs
|
|
93
|
+
* delivered to this session and `irc:relay` observations of agent↔agent
|
|
94
|
+
* traffic. Shares the tool renderer's glyph + quote-border conventions so
|
|
95
|
+
* cards and `irc` tool output look identical in the transcript.
|
|
96
|
+
*/
|
|
97
|
+
export declare function createIrcMessageCard(card: {
|
|
98
|
+
kind: "incoming" | "relay";
|
|
99
|
+
from?: string;
|
|
100
|
+
to?: string;
|
|
101
|
+
body?: string;
|
|
102
|
+
replyTo?: string;
|
|
103
|
+
timestamp?: number;
|
|
104
|
+
}, getExpanded: () => boolean, uiTheme: Theme): Component;
|
|
105
|
+
export declare const ircToolRenderer: {
|
|
106
|
+
inline: boolean;
|
|
107
|
+
mergeCallAndResult: boolean;
|
|
108
|
+
renderCall(args: IrcRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component;
|
|
109
|
+
renderResult(result: {
|
|
110
|
+
content: Array<{
|
|
111
|
+
type: string;
|
|
112
|
+
text?: string;
|
|
113
|
+
}>;
|
|
114
|
+
details?: IrcDetails;
|
|
115
|
+
isError?: boolean;
|
|
116
|
+
}, options: RenderResultOptions, uiTheme: Theme, args?: IrcRenderArgs): Component;
|
|
117
|
+
};
|
|
80
118
|
export {};
|
|
@@ -27,6 +27,13 @@ export interface JobToolDetails {
|
|
|
27
27
|
status: CancelStatus;
|
|
28
28
|
}[];
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* A poll snapshot where every watched job is still running and nothing was
|
|
32
|
+
* cancelled — pure "still waiting" noise once a newer poll exists. The TUI
|
|
33
|
+
* keeps such a block un-finalized (displaceable) so a follow-up `job` call
|
|
34
|
+
* replaces it instead of stacking another waiting frame in the transcript.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isWaitingPollDetails(details: unknown): boolean;
|
|
30
37
|
export declare class JobTool implements AgentTool<typeof jobSchema, JobToolDetails> {
|
|
31
38
|
#private;
|
|
32
39
|
private readonly session;
|
|
@@ -43,7 +50,6 @@ export declare class JobTool implements AgentTool<typeof jobSchema, JobToolDetai
|
|
|
43
50
|
readonly strict = true;
|
|
44
51
|
readonly loadMode = "discoverable";
|
|
45
52
|
constructor(session: ToolSession);
|
|
46
|
-
static createIf(session: ToolSession): JobTool | null;
|
|
47
53
|
execute(_toolCallId: string, params: JobParams, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<JobToolDetails>, _context?: AgentToolContext): Promise<AgentToolResult<JobToolDetails>>;
|
|
48
54
|
}
|
|
49
55
|
interface JobRenderArgs {
|
|
@@ -10,6 +10,7 @@ export interface GitRepository {
|
|
|
10
10
|
gitEntryPath: string;
|
|
11
11
|
headPath: string;
|
|
12
12
|
repoRoot: string;
|
|
13
|
+
isReftable?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export interface GitStatusSummary {
|
|
15
16
|
staged: number;
|
|
@@ -327,7 +328,7 @@ export declare const ls: {
|
|
|
327
328
|
};
|
|
328
329
|
export declare const head: {
|
|
329
330
|
/** Full HEAD state (branch, commit, repo info). */
|
|
330
|
-
resolve(cwd: string): Promise<GitHeadState | null>;
|
|
331
|
+
resolve(cwd: string, signal?: AbortSignal): Promise<GitHeadState | null>;
|
|
331
332
|
/** Full HEAD state (synchronous). */
|
|
332
333
|
resolveSync(cwd: string): GitHeadState | null;
|
|
333
334
|
/** Current HEAD commit SHA. */
|
|
@@ -338,12 +339,24 @@ export declare const head: {
|
|
|
338
339
|
export declare const repo: {
|
|
339
340
|
/** Resolve the repository root (may be a worktree root). */
|
|
340
341
|
root(cwd: string, signal?: AbortSignal): Promise<string | null>;
|
|
341
|
-
/** Resolve the primary
|
|
342
|
+
/** Resolve the primary checkout root, or the shared common dir for bare-repo worktrees. */
|
|
342
343
|
primaryRoot(cwd: string, signal?: AbortSignal): Promise<string | null>;
|
|
344
|
+
/**
|
|
345
|
+
* Sync sibling of {@link primaryRoot}. Resolves only via on-disk `.git`/
|
|
346
|
+
* `commondir` walking — no subprocess fallback — so it stays usable from
|
|
347
|
+
* paths where async I/O is impractical (e.g. `computeBankScope`). Returns
|
|
348
|
+
* `null` when `cwd` is outside a repository. Bare-repo worktrees resolve to
|
|
349
|
+
* the shared common dir (`foo.git`) because they have no primary checkout.
|
|
350
|
+
*/
|
|
351
|
+
primaryRootSync(cwd: string): string | null;
|
|
343
352
|
/** Full GitRepository metadata (sync). */
|
|
344
353
|
resolveSync(cwd: string): GitRepository | null;
|
|
345
354
|
/** Full GitRepository metadata. */
|
|
346
355
|
resolve(cwd: string): Promise<GitRepository | null>;
|
|
356
|
+
/** Check if the repository uses the reftable reference storage format (sync). */
|
|
357
|
+
isReftableSync(repository: GitRepository): boolean;
|
|
358
|
+
/** Check if the repository uses the reftable reference storage format. */
|
|
359
|
+
isReftable(repository: GitRepository): Promise<boolean>;
|
|
347
360
|
};
|
|
348
361
|
export interface GhCommandResult {
|
|
349
362
|
exitCode: number;
|
|
@@ -15,9 +15,10 @@ export declare function raceFirstNonNull<T>(primary: Promise<T | null>, startFal
|
|
|
15
15
|
* to produce request metadata (e.g. user_id for session attribution). Using a
|
|
16
16
|
* resolver instead of a pre-evaluated value ensures the metadata's account_uuid
|
|
17
17
|
* reflects the credential actually selected for this request.
|
|
18
|
+
* @param customSystemPrompt Optional title-specific system prompt override
|
|
18
19
|
*/
|
|
19
|
-
export declare function generateSessionTitle(firstMessage: string, registry: ModelRegistry, settings: Settings, sessionId?: string, currentModel?: Model<Api>, metadataResolver?: (provider: string) => Record<string, unknown> | undefined): Promise<string | null>;
|
|
20
|
-
export declare function generateTitleOnline(firstMessage: string, registry: ModelRegistry, settings: Settings, sessionId?: string, currentModel?: Model<Api>, metadataResolver?: (provider: string) => Record<string, unknown> | undefined, signal?: AbortSignal): Promise<string | null>;
|
|
20
|
+
export declare function generateSessionTitle(firstMessage: string, registry: ModelRegistry, settings: Settings, sessionId?: string, currentModel?: Model<Api>, metadataResolver?: (provider: string) => Record<string, unknown> | undefined, customSystemPrompt?: string): Promise<string | null>;
|
|
21
|
+
export declare function generateTitleOnline(firstMessage: string, registry: ModelRegistry, settings: Settings, sessionId?: string, currentModel?: Model<Api>, metadataResolver?: (provider: string) => Record<string, unknown> | undefined, signal?: AbortSignal, customSystemPrompt?: string): Promise<string | null>;
|
|
21
22
|
export declare function formatSessionTerminalTitle(sessionName: string | undefined, cwd?: string): string;
|
|
22
23
|
/**
|
|
23
24
|
* Set the terminal title using OSC 0 (sets both tab and window title). Unsupported terminals ignore it.
|
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": "15.
|
|
4
|
+
"version": "15.11.0",
|
|
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",
|
|
@@ -47,15 +47,16 @@
|
|
|
47
47
|
"@agentclientprotocol/sdk": "0.22.1",
|
|
48
48
|
"@babel/parser": "^7.29.7",
|
|
49
49
|
"@mozilla/readability": "^0.6.0",
|
|
50
|
-
"@oh-my-pi/hashline": "15.
|
|
51
|
-
"@oh-my-pi/omp-stats": "15.
|
|
52
|
-
"@oh-my-pi/pi-agent-core": "15.
|
|
53
|
-
"@oh-my-pi/pi-ai": "15.
|
|
54
|
-
"@oh-my-pi/pi-catalog": "15.
|
|
55
|
-
"@oh-my-pi/pi-mnemopi": "15.
|
|
56
|
-
"@oh-my-pi/pi-natives": "15.
|
|
57
|
-
"@oh-my-pi/pi-tui": "15.
|
|
58
|
-
"@oh-my-pi/pi-utils": "15.
|
|
50
|
+
"@oh-my-pi/hashline": "15.11.0",
|
|
51
|
+
"@oh-my-pi/omp-stats": "15.11.0",
|
|
52
|
+
"@oh-my-pi/pi-agent-core": "15.11.0",
|
|
53
|
+
"@oh-my-pi/pi-ai": "15.11.0",
|
|
54
|
+
"@oh-my-pi/pi-catalog": "15.11.0",
|
|
55
|
+
"@oh-my-pi/pi-mnemopi": "15.11.0",
|
|
56
|
+
"@oh-my-pi/pi-natives": "15.11.0",
|
|
57
|
+
"@oh-my-pi/pi-tui": "15.11.0",
|
|
58
|
+
"@oh-my-pi/pi-utils": "15.11.0",
|
|
59
|
+
"@oh-my-pi/snapcompact": "15.11.0",
|
|
59
60
|
"@opentelemetry/api": "^1.9.1",
|
|
60
61
|
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
61
62
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
|
package/scripts/bundle-dist.ts
CHANGED
|
@@ -51,25 +51,34 @@ async function cleanBundleOutputs(): Promise<void> {
|
|
|
51
51
|
async function main(): Promise<void> {
|
|
52
52
|
const start = Bun.nanoseconds();
|
|
53
53
|
await cleanBundleOutputs();
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
54
|
+
// The npm bundle ships no stats dashboard sources or prebuilt dist/client,
|
|
55
|
+
// so embed the dashboard archive the same way compiled binaries do
|
|
56
|
+
// (scripts/build-binary.ts). Reset afterwards to keep the checked-in
|
|
57
|
+
// placeholder empty.
|
|
58
|
+
await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--generate"]);
|
|
59
|
+
try {
|
|
60
|
+
await runCommand([
|
|
61
|
+
"bun",
|
|
62
|
+
"build",
|
|
63
|
+
"--target=bun",
|
|
64
|
+
"--outdir",
|
|
65
|
+
"dist",
|
|
66
|
+
"--minify-whitespace",
|
|
67
|
+
"--minify-syntax",
|
|
68
|
+
"--keep-names",
|
|
69
|
+
"--external",
|
|
70
|
+
"mupdf",
|
|
71
|
+
"--external",
|
|
72
|
+
"@oh-my-pi/pi-natives",
|
|
73
|
+
"--external",
|
|
74
|
+
"@huggingface/transformers",
|
|
75
|
+
"--define",
|
|
76
|
+
'process.env.PI_BUNDLED="true"',
|
|
77
|
+
"./src/cli.ts",
|
|
78
|
+
]);
|
|
79
|
+
} finally {
|
|
80
|
+
await runCommand(["bun", "--cwd=../stats", "scripts/generate-client-bundle.ts", "--reset"]);
|
|
81
|
+
}
|
|
73
82
|
await ensureShebang();
|
|
74
83
|
const stat = await fs.stat(cliPath);
|
|
75
84
|
const elapsedMs = (Bun.nanoseconds() - start) / 1_000_000;
|
package/src/async/index.ts
CHANGED
package/src/cli/args.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface Args {
|
|
|
14
14
|
allowHome?: boolean;
|
|
15
15
|
provider?: string;
|
|
16
16
|
model?: string;
|
|
17
|
+
config?: string[];
|
|
17
18
|
smol?: string;
|
|
18
19
|
slow?: string;
|
|
19
20
|
plan?: string;
|
|
@@ -111,6 +112,8 @@ export function parseArgs(inputArgs: string[], extensionFlags?: Map<string, { ty
|
|
|
111
112
|
result.allowHome = true;
|
|
112
113
|
} else if (arg === "--cwd" && i + 1 < args.length) {
|
|
113
114
|
result.cwd = args[++i];
|
|
115
|
+
} else if (arg === "--config" && i + 1 < args.length) {
|
|
116
|
+
result.config = [...(result.config ?? []), args[++i]];
|
|
114
117
|
} else if (arg === "--mode" && i + 1 < args.length) {
|
|
115
118
|
const mode = args[++i];
|
|
116
119
|
if (mode === "text" || mode === "json" || mode === "rpc" || mode === "acp" || mode === "rpc-ui") {
|
package/src/cli/gallery-cli.ts
CHANGED
|
@@ -69,7 +69,7 @@ function fakeToolFor(name: string, fixture: GalleryFixture | undefined): AgentTo
|
|
|
69
69
|
if (!fixture?.label && !fixture?.editMode && !fixture?.customRendered) return undefined;
|
|
70
70
|
const tool: Record<string, unknown> = { name, label: fixture.label ?? name, mode: fixture.editMode };
|
|
71
71
|
if (fixture.customRendered) {
|
|
72
|
-
const renderer = toolRenderers[name] as
|
|
72
|
+
const renderer = toolRenderers[fixture.renderer ?? name] as
|
|
73
73
|
| { renderCall?: unknown; renderResult?: unknown; mergeCallAndResult?: unknown; inline?: unknown }
|
|
74
74
|
| undefined;
|
|
75
75
|
if (renderer) {
|