@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
|
@@ -33,7 +33,7 @@ const setTitleTool: Tool = {
|
|
|
33
33
|
title: {
|
|
34
34
|
type: "string",
|
|
35
35
|
description:
|
|
36
|
-
'
|
|
36
|
+
'The generated session title, or exactly "none" when the message carries no concrete task yet.',
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
required: ["title"],
|
|
@@ -137,6 +137,7 @@ export async function raceFirstNonNull<T>(
|
|
|
137
137
|
* to produce request metadata (e.g. user_id for session attribution). Using a
|
|
138
138
|
* resolver instead of a pre-evaluated value ensures the metadata's account_uuid
|
|
139
139
|
* reflects the credential actually selected for this request.
|
|
140
|
+
* @param customSystemPrompt Optional title-specific system prompt override
|
|
140
141
|
*/
|
|
141
142
|
export async function generateSessionTitle(
|
|
142
143
|
firstMessage: string,
|
|
@@ -145,6 +146,7 @@ export async function generateSessionTitle(
|
|
|
145
146
|
sessionId?: string,
|
|
146
147
|
currentModel?: Model<Api>,
|
|
147
148
|
metadataResolver?: (provider: string) => Record<string, unknown> | undefined,
|
|
149
|
+
customSystemPrompt?: string,
|
|
148
150
|
): Promise<string | null> {
|
|
149
151
|
// Defer titling for greetings / acknowledgements / empty input. The default
|
|
150
152
|
// tiny title model can't reliably decline trivial input, so this happens
|
|
@@ -155,13 +157,26 @@ export async function generateSessionTitle(
|
|
|
155
157
|
return null;
|
|
156
158
|
}
|
|
157
159
|
|
|
160
|
+
const titleSystemPrompt = customSystemPrompt?.trim() || undefined;
|
|
158
161
|
const tinyModel = settings.get("providers.tinyModel");
|
|
159
162
|
if (tinyModel === ONLINE_TINY_TITLE_MODEL_KEY) {
|
|
160
|
-
return generateTitleOnline(
|
|
163
|
+
return generateTitleOnline(
|
|
164
|
+
firstMessage,
|
|
165
|
+
registry,
|
|
166
|
+
settings,
|
|
167
|
+
sessionId,
|
|
168
|
+
currentModel,
|
|
169
|
+
metadataResolver,
|
|
170
|
+
undefined,
|
|
171
|
+
titleSystemPrompt,
|
|
172
|
+
);
|
|
161
173
|
}
|
|
162
174
|
|
|
163
175
|
const onlineAbortController = new AbortController();
|
|
164
|
-
const
|
|
176
|
+
const localTitlePromise = titleSystemPrompt
|
|
177
|
+
? tinyTitleClient.generate(tinyModel, firstMessage, { systemPrompt: titleSystemPrompt })
|
|
178
|
+
: tinyTitleClient.generate(tinyModel, firstMessage);
|
|
179
|
+
const localTitle = localTitlePromise.then(
|
|
165
180
|
title => title || null,
|
|
166
181
|
err => {
|
|
167
182
|
logger.warn("title-generator: local model error", {
|
|
@@ -181,6 +196,7 @@ export async function generateSessionTitle(
|
|
|
181
196
|
currentModel,
|
|
182
197
|
metadataResolver,
|
|
183
198
|
onlineAbortController.signal,
|
|
199
|
+
titleSystemPrompt,
|
|
184
200
|
);
|
|
185
201
|
|
|
186
202
|
return raceFirstNonNull(localTitle, startOnline, TITLE_LOCAL_FALLBACK_DELAY_MS, () => {
|
|
@@ -196,6 +212,7 @@ export async function generateTitleOnline(
|
|
|
196
212
|
currentModel?: Model<Api>,
|
|
197
213
|
metadataResolver?: (provider: string) => Record<string, unknown> | undefined,
|
|
198
214
|
signal?: AbortSignal,
|
|
215
|
+
customSystemPrompt?: string,
|
|
199
216
|
): Promise<string | null> {
|
|
200
217
|
const model = getTitleModel(registry, settings, currentModel);
|
|
201
218
|
if (!model) {
|
|
@@ -203,6 +220,8 @@ export async function generateTitleOnline(
|
|
|
203
220
|
return null;
|
|
204
221
|
}
|
|
205
222
|
|
|
223
|
+
const titleSystemPrompt = customSystemPrompt?.trim() || undefined;
|
|
224
|
+
const systemPrompt = titleSystemPrompt ?? TITLE_SYSTEM_PROMPT;
|
|
206
225
|
const userMessage = formatTitleUserMessage(firstMessage);
|
|
207
226
|
const modelName = `${model.provider}/${model.id}`;
|
|
208
227
|
const modelContext = {
|
|
@@ -234,12 +253,12 @@ export async function generateTitleOnline(
|
|
|
234
253
|
const response = await completeSimple(
|
|
235
254
|
model,
|
|
236
255
|
{
|
|
237
|
-
systemPrompt: [
|
|
256
|
+
systemPrompt: [systemPrompt],
|
|
238
257
|
messages: [{ role: "user", content: userMessage, timestamp: Date.now() }],
|
|
239
258
|
tools: [setTitleTool],
|
|
240
259
|
},
|
|
241
260
|
{
|
|
242
|
-
apiKey: registry.resolver(model.provider, { sessionId, baseUrl: model.baseUrl }),
|
|
261
|
+
apiKey: registry.resolver(model.provider, { sessionId, baseUrl: model.baseUrl, modelId: model.id }),
|
|
243
262
|
maxTokens,
|
|
244
263
|
disableReasoning: true,
|
|
245
264
|
toolChoice: { type: "tool", name: SET_TITLE_TOOL_NAME },
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Container } from "@oh-my-pi/pi-tui";
|
|
2
|
-
import type { KeyId } from "../../config/keybindings";
|
|
3
|
-
import type { SessionObserverRegistry } from "../session-observer-registry";
|
|
4
|
-
export declare class SessionObserverOverlayComponent extends Container {
|
|
5
|
-
#private;
|
|
6
|
-
constructor(registry: SessionObserverRegistry, onDone: () => void, observeKeys: KeyId[]);
|
|
7
|
-
render(width: number): readonly string[];
|
|
8
|
-
/** Rebuild content from live registry data */
|
|
9
|
-
refreshFromRegistry(): void;
|
|
10
|
-
handleInput(keyData: string): void;
|
|
11
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const TASK_SIMPLE_MODES: readonly ["default", "schema-free", "independent"];
|
|
2
|
-
export type TaskSimpleMode = (typeof TASK_SIMPLE_MODES)[number];
|
|
3
|
-
interface TaskSimpleModeCapabilities {
|
|
4
|
-
contextEnabled: boolean;
|
|
5
|
-
customSchemaEnabled: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare function getTaskSimpleModeCapabilities(mode: TaskSimpleMode): TaskSimpleModeCapabilities;
|
|
8
|
-
export {};
|
package/src/async/support.ts
DELETED
package/src/task/simple-mode.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export const TASK_SIMPLE_MODES = ["default", "schema-free", "independent"] as const;
|
|
2
|
-
|
|
3
|
-
export type TaskSimpleMode = (typeof TASK_SIMPLE_MODES)[number];
|
|
4
|
-
|
|
5
|
-
interface TaskSimpleModeCapabilities {
|
|
6
|
-
contextEnabled: boolean;
|
|
7
|
-
customSchemaEnabled: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const TASK_SIMPLE_MODE_CAPABILITIES: Record<TaskSimpleMode, TaskSimpleModeCapabilities> = {
|
|
11
|
-
default: {
|
|
12
|
-
contextEnabled: true,
|
|
13
|
-
customSchemaEnabled: true,
|
|
14
|
-
},
|
|
15
|
-
"schema-free": {
|
|
16
|
-
contextEnabled: true,
|
|
17
|
-
customSchemaEnabled: false,
|
|
18
|
-
},
|
|
19
|
-
independent: {
|
|
20
|
-
contextEnabled: false,
|
|
21
|
-
customSchemaEnabled: false,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export function getTaskSimpleModeCapabilities(mode: TaskSimpleMode): TaskSimpleModeCapabilities {
|
|
26
|
-
return TASK_SIMPLE_MODE_CAPABILITIES[mode];
|
|
27
|
-
}
|