@oh-my-pi/pi-coding-agent 14.1.0 → 14.1.1
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 +79 -0
- package/package.json +8 -8
- package/src/async/job-manager.ts +43 -10
- package/src/commit/agentic/tools/analyze-file.ts +1 -2
- package/src/config/mcp-schema.json +1 -1
- package/src/config/model-equivalence.ts +1 -0
- package/src/config/model-registry.ts +63 -34
- package/src/config/model-resolver.ts +111 -15
- package/src/config/settings-schema.ts +4 -3
- package/src/config/settings.ts +1 -1
- package/src/cursor.ts +64 -23
- package/src/edit/index.ts +254 -89
- package/src/edit/modes/chunk.ts +336 -57
- package/src/edit/modes/hashline.ts +51 -26
- package/src/edit/modes/patch.ts +16 -10
- package/src/edit/modes/replace.ts +15 -7
- package/src/edit/renderer.ts +248 -94
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +6 -4
- package/src/extensibility/custom-tools/types.ts +0 -3
- package/src/extensibility/extensions/loader.ts +16 -0
- package/src/extensibility/extensions/runner.ts +2 -7
- package/src/extensibility/extensions/types.ts +8 -4
- package/src/internal-urls/docs-index.generated.ts +3 -3
- package/src/ipy/executor.ts +447 -52
- package/src/ipy/kernel.ts +39 -13
- package/src/lsp/client.ts +54 -0
- package/src/lsp/index.ts +8 -0
- package/src/lsp/types.ts +6 -0
- package/src/main.ts +0 -1
- package/src/modes/acp/acp-agent.ts +4 -1
- package/src/modes/components/bash-execution.ts +16 -4
- package/src/modes/components/status-line/presets.ts +17 -6
- package/src/modes/components/status-line/segments.ts +15 -0
- package/src/modes/components/status-line-segment-editor.ts +1 -0
- package/src/modes/components/status-line.ts +7 -1
- package/src/modes/components/tool-execution.ts +145 -75
- package/src/modes/controllers/command-controller.ts +24 -1
- package/src/modes/controllers/event-controller.ts +4 -1
- package/src/modes/controllers/extension-ui-controller.ts +28 -5
- package/src/modes/controllers/input-controller.ts +9 -3
- package/src/modes/controllers/selector-controller.ts +4 -1
- package/src/modes/interactive-mode.ts +19 -3
- package/src/modes/print-mode.ts +13 -4
- package/src/modes/prompt-action-autocomplete.ts +3 -5
- package/src/modes/rpc/rpc-mode.ts +8 -2
- package/src/modes/shared.ts +2 -2
- package/src/modes/types.ts +1 -0
- package/src/modes/utils/ui-helpers.ts +1 -0
- package/src/prompts/tools/bash.md +2 -2
- package/src/prompts/tools/chunk-edit.md +191 -163
- package/src/prompts/tools/hashline.md +11 -11
- package/src/prompts/tools/patch.md +10 -5
- package/src/prompts/tools/{await.md → poll.md} +1 -1
- package/src/prompts/tools/read-chunk.md +3 -3
- package/src/prompts/tools/task.md +2 -2
- package/src/prompts/tools/vim.md +98 -0
- package/src/sdk.ts +754 -724
- package/src/session/agent-session.ts +164 -34
- package/src/session/session-manager.ts +50 -4
- package/src/slash-commands/builtin-registry.ts +17 -0
- package/src/task/executor.ts +4 -4
- package/src/task/index.ts +3 -5
- package/src/task/types.ts +2 -2
- package/src/tools/bash.ts +26 -8
- package/src/tools/find.ts +5 -2
- package/src/tools/grep.ts +77 -8
- package/src/tools/index.ts +48 -19
- package/src/tools/{await-tool.ts → poll-tool.ts} +36 -30
- package/src/tools/python.ts +293 -278
- package/src/tools/submit-result.ts +5 -2
- package/src/tools/todo-write.ts +8 -2
- package/src/tools/vim.ts +966 -0
- package/src/utils/edit-mode.ts +2 -1
- package/src/utils/session-color.ts +55 -0
- package/src/utils/title-generator.ts +15 -6
- package/src/vim/buffer.ts +309 -0
- package/src/vim/commands.ts +382 -0
- package/src/vim/engine.ts +2426 -0
- package/src/vim/parser.ts +151 -0
- package/src/vim/render.ts +252 -0
- package/src/vim/types.ts +197 -0
|
@@ -91,6 +91,14 @@ export class ExtensionRuntime implements IExtensionRuntime {
|
|
|
91
91
|
setThinkingLevel(): void {
|
|
92
92
|
throw new ExtensionRuntimeNotInitializedError();
|
|
93
93
|
}
|
|
94
|
+
|
|
95
|
+
getSessionName(): string | undefined {
|
|
96
|
+
throw new ExtensionRuntimeNotInitializedError();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
setSessionName(): Promise<void> {
|
|
100
|
+
throw new ExtensionRuntimeNotInitializedError();
|
|
101
|
+
}
|
|
94
102
|
}
|
|
95
103
|
|
|
96
104
|
/**
|
|
@@ -223,6 +231,14 @@ class ConcreteExtensionAPI implements ExtensionAPI, IExtensionRuntime {
|
|
|
223
231
|
this.runtime.setThinkingLevel(level, persist);
|
|
224
232
|
}
|
|
225
233
|
|
|
234
|
+
getSessionName(): string | undefined {
|
|
235
|
+
return this.runtime.getSessionName();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
setSessionName(name: string): Promise<void> {
|
|
239
|
+
return this.runtime.setSessionName(name);
|
|
240
|
+
}
|
|
241
|
+
|
|
226
242
|
registerProvider(name: string, config: import("./types").ProviderConfig): void {
|
|
227
243
|
this.runtime.pendingProviderRegistrations.push({ name, config, sourceId: this.extension.path });
|
|
228
244
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
5
5
|
import type { ImageContent, Model } from "@oh-my-pi/pi-ai";
|
|
6
|
-
import type { SearchDb } from "@oh-my-pi/pi-natives";
|
|
7
6
|
import type { KeyId } from "@oh-my-pi/pi-tui";
|
|
8
7
|
import { logger } from "@oh-my-pi/pi-utils";
|
|
9
8
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
@@ -161,7 +160,6 @@ export class ExtensionRunner {
|
|
|
161
160
|
#uiContext: ExtensionUIContext;
|
|
162
161
|
#errorListeners: Set<ExtensionErrorListener> = new Set();
|
|
163
162
|
#getModel: () => Model | undefined = () => undefined;
|
|
164
|
-
#getSearchDbFn: () => SearchDb | undefined = () => undefined;
|
|
165
163
|
#isIdleFn: () => boolean = () => true;
|
|
166
164
|
#waitForIdleFn: () => Promise<void> = async () => {};
|
|
167
165
|
#abortFn: () => void = () => {};
|
|
@@ -204,10 +202,11 @@ export class ExtensionRunner {
|
|
|
204
202
|
this.runtime.setModel = actions.setModel;
|
|
205
203
|
this.runtime.getThinkingLevel = actions.getThinkingLevel;
|
|
206
204
|
this.runtime.setThinkingLevel = actions.setThinkingLevel;
|
|
205
|
+
this.runtime.getSessionName = actions.getSessionName;
|
|
206
|
+
this.runtime.setSessionName = actions.setSessionName;
|
|
207
207
|
|
|
208
208
|
// Context actions (required)
|
|
209
209
|
this.#getModel = contextActions.getModel;
|
|
210
|
-
this.#getSearchDbFn = contextActions.getSearchDb ?? (() => undefined);
|
|
211
210
|
this.#isIdleFn = contextActions.isIdle;
|
|
212
211
|
this.#abortFn = contextActions.abort;
|
|
213
212
|
this.#hasPendingMessagesFn = contextActions.hasPendingMessages;
|
|
@@ -383,7 +382,6 @@ export class ExtensionRunner {
|
|
|
383
382
|
|
|
384
383
|
createContext(): ExtensionContext {
|
|
385
384
|
const getModel = this.#getModel;
|
|
386
|
-
const getSearchDb = this.#getSearchDbFn;
|
|
387
385
|
return {
|
|
388
386
|
ui: this.#uiContext,
|
|
389
387
|
getContextUsage: () => this.#getContextUsageFn(),
|
|
@@ -395,9 +393,6 @@ export class ExtensionRunner {
|
|
|
395
393
|
get model() {
|
|
396
394
|
return getModel();
|
|
397
395
|
},
|
|
398
|
-
get searchDb() {
|
|
399
|
-
return getSearchDb();
|
|
400
|
-
},
|
|
401
396
|
isIdle: () => this.#isIdleFn(),
|
|
402
397
|
abort: () => this.#abortFn(),
|
|
403
398
|
hasPendingMessages: () => this.#hasPendingMessagesFn(),
|
|
@@ -22,7 +22,6 @@ import type {
|
|
|
22
22
|
ToolResultMessage,
|
|
23
23
|
} from "@oh-my-pi/pi-ai";
|
|
24
24
|
import type * as piCodingAgent from "@oh-my-pi/pi-coding-agent";
|
|
25
|
-
import type { SearchDb } from "@oh-my-pi/pi-natives";
|
|
26
25
|
import type { AutocompleteItem, Component, EditorComponent, EditorTheme, KeyId, TUI } from "@oh-my-pi/pi-tui";
|
|
27
26
|
import type { Static, TSchema } from "@sinclair/typebox";
|
|
28
27
|
import type { Rule } from "../../capability/rule";
|
|
@@ -232,8 +231,6 @@ export interface ExtensionContext {
|
|
|
232
231
|
modelRegistry: ModelRegistry;
|
|
233
232
|
/** Current model (may be undefined) */
|
|
234
233
|
model: Model | undefined;
|
|
235
|
-
/** Shared native search DB for grep/glob/fuzzyFind-backed workflows. */
|
|
236
|
-
searchDb?: SearchDb;
|
|
237
234
|
/** Whether the agent is idle (not streaming) */
|
|
238
235
|
isIdle(): boolean;
|
|
239
236
|
/** Abort the current agent operation */
|
|
@@ -1109,6 +1106,12 @@ export interface ExtensionAPI {
|
|
|
1109
1106
|
/** Set thinking level for the current session. */
|
|
1110
1107
|
setThinkingLevel(level: ThinkingLevel): void;
|
|
1111
1108
|
|
|
1109
|
+
/** Get the current session name. */
|
|
1110
|
+
getSessionName(): string | undefined;
|
|
1111
|
+
|
|
1112
|
+
/** Set the session name. Persists to the session file. */
|
|
1113
|
+
setSessionName(name: string): Promise<void>;
|
|
1114
|
+
|
|
1112
1115
|
// =========================================================================
|
|
1113
1116
|
// Provider Registration
|
|
1114
1117
|
// =========================================================================
|
|
@@ -1295,12 +1298,13 @@ export interface ExtensionActions {
|
|
|
1295
1298
|
setModel: SetModelHandler;
|
|
1296
1299
|
getThinkingLevel: GetThinkingLevelHandler;
|
|
1297
1300
|
setThinkingLevel: SetThinkingLevelHandler;
|
|
1301
|
+
getSessionName: () => string | undefined;
|
|
1302
|
+
setSessionName: (name: string) => Promise<void>;
|
|
1298
1303
|
}
|
|
1299
1304
|
|
|
1300
1305
|
/** Actions for ExtensionContext (ctx.* in event handlers). */
|
|
1301
1306
|
export interface ExtensionContextActions {
|
|
1302
1307
|
getModel: () => Model | undefined;
|
|
1303
|
-
getSearchDb?: () => SearchDb | undefined;
|
|
1304
1308
|
isIdle: () => boolean;
|
|
1305
1309
|
abort: () => void;
|
|
1306
1310
|
hasPendingMessages: () => boolean;
|