@oh-my-pi/pi-coding-agent 8.0.2 → 8.0.3
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/package.json +5 -1
- package/src/cli/args.ts +2 -2
- package/src/cli/config-cli.ts +4 -4
- package/src/cli/file-processor.ts +3 -3
- package/src/cli/list-models.ts +2 -2
- package/src/cli/plugin-cli.ts +7 -3
- package/src/cli/session-picker.ts +2 -2
- package/src/cli/setup-cli.ts +2 -2
- package/src/cli/stats-cli.ts +1 -1
- package/src/cli/update-cli.ts +2 -2
- package/src/config/keybindings.ts +1 -1
- package/src/config/model-registry.ts +1 -1
- package/src/config/model-resolver.ts +1 -1
- package/src/config/prompt-templates.ts +2 -2
- package/src/config/settings-manager.ts +5 -5
- package/src/cursor.ts +1 -1
- package/src/discovery/agents-md.ts +4 -4
- package/src/discovery/builtin.ts +21 -17
- package/src/discovery/claude.ts +12 -12
- package/src/discovery/cline.ts +6 -6
- package/src/discovery/codex.ts +21 -21
- package/src/discovery/cursor.ts +9 -9
- package/src/discovery/gemini.ts +13 -9
- package/src/discovery/github.ts +6 -6
- package/src/discovery/helpers.ts +4 -4
- package/src/discovery/index.ts +16 -16
- package/src/discovery/mcp-json.ts +4 -4
- package/src/discovery/ssh.ts +4 -4
- package/src/discovery/vscode.ts +4 -4
- package/src/discovery/windsurf.ts +6 -6
- package/src/exa/company.ts +1 -1
- package/src/exa/index.ts +2 -2
- package/src/exa/linkedin.ts +1 -1
- package/src/exa/mcp-client.ts +2 -2
- package/src/exa/render.ts +6 -6
- package/src/exa/researcher.ts +1 -1
- package/src/exa/search.ts +1 -1
- package/src/exa/websets.ts +1 -1
- package/src/exec/bash-executor.ts +3 -3
- package/src/export/custom-share.ts +1 -1
- package/src/export/html/index.ts +3 -3
- package/src/export/ttsr.ts +2 -2
- package/src/extensibility/custom-commands/bundled/review/index.ts +4 -4
- package/src/extensibility/custom-commands/loader.ts +3 -3
- package/src/extensibility/custom-commands/types.ts +1 -1
- package/src/extensibility/custom-tools/loader.ts +9 -9
- package/src/extensibility/custom-tools/types.ts +6 -6
- package/src/extensibility/custom-tools/wrapper.ts +1 -1
- package/src/extensibility/extensions/loader.ts +8 -8
- package/src/extensibility/extensions/runner.ts +3 -3
- package/src/extensibility/extensions/types.ts +23 -17
- package/src/extensibility/extensions/wrapper.ts +1 -1
- package/src/extensibility/hooks/index.ts +1 -1
- package/src/extensibility/hooks/loader.ts +7 -7
- package/src/extensibility/hooks/runner.ts +4 -4
- package/src/extensibility/hooks/types.ts +16 -10
- package/src/extensibility/plugins/doctor.ts +1 -1
- package/src/extensibility/plugins/installer.ts +1 -1
- package/src/extensibility/plugins/paths.ts +1 -1
- package/src/extensibility/skills.ts +9 -6
- package/src/extensibility/slash-commands.ts +6 -6
- package/src/index.ts +7 -7
- package/src/internal-urls/rule-protocol.ts +1 -1
- package/src/internal-urls/skill-protocol.ts +1 -1
- package/src/ipy/executor.ts +3 -3
- package/src/ipy/gateway-coordinator.ts +3 -3
- package/src/ipy/kernel.ts +3 -3
- package/src/lsp/client.ts +1 -1
- package/src/lsp/clients/biome-client.ts +1 -1
- package/src/lsp/clients/index.ts +1 -1
- package/src/lsp/clients/lsp-linter-client.ts +4 -4
- package/src/lsp/config.ts +1 -1
- package/src/lsp/index.ts +6 -6
- package/src/lsp/render.ts +7 -2
- package/src/lsp/utils.ts +1 -1
- package/src/main.ts +1 -1
- package/src/mcp/config.ts +3 -3
- package/src/mcp/loader.ts +2 -2
- package/src/mcp/manager.ts +1 -1
- package/src/mcp/tool-bridge.ts +6 -2
- package/src/mcp/tool-cache.ts +1 -1
- package/src/mcp/transports/http.ts +1 -1
- package/src/mcp/transports/stdio.ts +1 -1
- package/src/migrations.ts +2 -2
- package/src/modes/components/armin.ts +1 -1
- package/src/modes/components/assistant-message.ts +1 -1
- package/src/modes/components/bash-execution.ts +3 -3
- package/src/modes/components/bordered-loader.ts +1 -1
- package/src/modes/components/branch-summary-message.ts +2 -2
- package/src/modes/components/compaction-summary-message.ts +2 -2
- package/src/modes/components/custom-message.ts +3 -3
- package/src/modes/components/diff.ts +1 -1
- package/src/modes/components/dynamic-border.ts +1 -1
- package/src/modes/components/extensions/extension-dashboard.ts +3 -3
- package/src/modes/components/extensions/extension-list.ts +2 -2
- package/src/modes/components/extensions/inspector-panel.ts +1 -1
- package/src/modes/components/extensions/state-manager.ts +17 -11
- package/src/modes/components/extensions/types.ts +1 -1
- package/src/modes/components/footer.ts +3 -3
- package/src/modes/components/history-search.ts +2 -2
- package/src/modes/components/hook-editor.ts +1 -1
- package/src/modes/components/hook-input.ts +1 -1
- package/src/modes/components/hook-message.ts +3 -3
- package/src/modes/components/hook-selector.ts +1 -1
- package/src/modes/components/keybinding-hints.ts +2 -2
- package/src/modes/components/login-dialog.ts +1 -1
- package/src/modes/components/model-selector.ts +5 -5
- package/src/modes/components/oauth-selector.ts +2 -2
- package/src/modes/components/plugin-settings.ts +3 -3
- package/src/modes/components/python-execution.ts +3 -3
- package/src/modes/components/queue-mode-selector.ts +1 -1
- package/src/modes/components/read-tool-group.ts +2 -2
- package/src/modes/components/session-selector.ts +3 -3
- package/src/modes/components/settings-defs.ts +2 -2
- package/src/modes/components/settings-selector.ts +2 -2
- package/src/modes/components/show-images-selector.ts +1 -1
- package/src/modes/components/status-line/segments.ts +2 -2
- package/src/modes/components/status-line/separators.ts +1 -1
- package/src/modes/components/status-line/types.ts +2 -2
- package/src/modes/components/status-line-segment-editor.ts +2 -2
- package/src/modes/components/status-line.ts +3 -3
- package/src/modes/components/theme-selector.ts +1 -1
- package/src/modes/components/thinking-selector.ts +1 -1
- package/src/modes/components/todo-display.ts +2 -2
- package/src/modes/components/todo-reminder.ts +2 -2
- package/src/modes/components/tool-execution.ts +11 -6
- package/src/modes/components/tree-selector.ts +3 -3
- package/src/modes/components/ttsr-notification.ts +2 -2
- package/src/modes/components/user-message-selector.ts +1 -1
- package/src/modes/components/user-message.ts +1 -1
- package/src/modes/components/welcome.ts +2 -2
- package/src/modes/controllers/command-controller.ts +15 -15
- package/src/modes/controllers/event-controller.ts +13 -9
- package/src/modes/controllers/extension-ui-controller.ts +17 -11
- package/src/modes/controllers/input-controller.ts +6 -6
- package/src/modes/controllers/selector-controller.ts +22 -16
- package/src/modes/interactive-mode.ts +12 -12
- package/src/modes/print-mode.ts +1 -1
- package/src/modes/rpc/rpc-client.ts +3 -3
- package/src/modes/rpc/rpc-mode.ts +6 -3
- package/src/modes/rpc/rpc-types.ts +3 -3
- package/src/modes/theme/theme.ts +1 -1
- package/src/modes/types.ts +8 -8
- package/src/modes/utils/ui-helpers.ts +14 -14
- package/src/patch/applicator.ts +1 -1
- package/src/patch/diff.ts +1 -1
- package/src/patch/index.ts +8 -8
- package/src/patch/shared.ts +9 -9
- package/src/sdk.ts +19 -16
- package/src/session/agent-session.ts +27 -27
- package/src/session/agent-storage.ts +2 -2
- package/src/session/auth-storage.ts +1 -1
- package/src/session/compaction/branch-summarization.ts +7 -5
- package/src/session/compaction/compaction.ts +16 -6
- package/src/session/compaction/utils.ts +5 -3
- package/src/session/history-storage.ts +1 -1
- package/src/session/messages.ts +2 -2
- package/src/session/session-manager.ts +2 -2
- package/src/session/storage-migration.ts +2 -2
- package/src/session/streaming-output.ts +1 -1
- package/src/ssh/connection-manager.ts +1 -1
- package/src/ssh/ssh-executor.ts +1 -1
- package/src/ssh/sshfs-mount.ts +1 -1
- package/src/system-prompt.ts +14 -8
- package/src/task/agents.ts +8 -8
- package/src/task/commands.ts +5 -5
- package/src/task/discovery.ts +3 -3
- package/src/task/executor.ts +11 -11
- package/src/task/index.ts +4 -4
- package/src/task/render.ts +6 -6
- package/src/task/subprocess-tool-registry.ts +1 -1
- package/src/task/worker-protocol.ts +3 -3
- package/src/task/worker.ts +18 -13
- package/src/tools/ask.ts +4 -4
- package/src/tools/bash-interceptor.ts +4 -1
- package/src/tools/bash.ts +8 -8
- package/src/tools/calculator.ts +4 -4
- package/src/tools/complete.ts +1 -1
- package/src/tools/context.ts +2 -2
- package/src/tools/fetch.ts +11 -11
- package/src/tools/find.ts +7 -7
- package/src/tools/gemini-image.ts +6 -6
- package/src/tools/grep.ts +8 -8
- package/src/tools/index.ts +19 -19
- package/src/tools/list-limit.ts +1 -1
- package/src/tools/ls.ts +4 -4
- package/src/tools/notebook.ts +3 -3
- package/src/tools/output-meta.ts +3 -3
- package/src/tools/output-utils.ts +1 -1
- package/src/tools/python.ts +10 -10
- package/src/tools/read.ts +11 -11
- package/src/tools/render-utils.ts +1 -1
- package/src/tools/renderers.ts +6 -6
- package/src/tools/review.ts +2 -2
- package/src/tools/ssh.ts +12 -12
- package/src/tools/todo-write.ts +5 -5
- package/src/tools/tool-result.ts +3 -3
- package/src/tools/write.ts +11 -11
- package/src/utils/changelog.ts +1 -1
- package/src/utils/file-mentions.ts +9 -4
- package/src/utils/image-convert.ts +1 -1
- package/src/utils/image-resize.ts +1 -1
- package/src/utils/shell.ts +1 -1
- package/src/utils/title-generator.ts +4 -4
- package/src/utils/tools-manager.ts +1 -1
- package/src/web/scrapers/choosealicense.ts +1 -1
- package/src/web/scrapers/twitter.ts +1 -1
- package/src/web/scrapers/types.ts +1 -1
- package/src/web/scrapers/utils.ts +1 -1
- package/src/web/scrapers/youtube.ts +2 -2
- package/src/web/search/auth.ts +8 -4
- package/src/web/search/index.ts +19 -10
- package/src/web/search/providers/anthropic.ts +8 -3
- package/src/web/search/providers/exa.ts +2 -2
- package/src/web/search/providers/perplexity.ts +2 -2
- package/src/web/search/render.ts +5 -5
package/src/patch/applicator.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { mkdirSync, unlinkSync } from "node:fs";
|
|
9
9
|
import { dirname } from "node:path";
|
|
10
|
-
import { resolveToCwd } from "
|
|
10
|
+
import { resolveToCwd } from "@oh-my-pi/pi-coding-agent/tools/path-utils";
|
|
11
11
|
import { DEFAULT_FUZZY_THRESHOLD, findContextLine, findMatch, seekSequence } from "./fuzzy";
|
|
12
12
|
import {
|
|
13
13
|
adjustIndentation,
|
package/src/patch/diff.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* used when not in patch mode.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { resolveToCwd } from "@oh-my-pi/pi-coding-agent/tools/path-utils";
|
|
8
9
|
import * as Diff from "diff";
|
|
9
|
-
import { resolveToCwd } from "$c/tools/path-utils";
|
|
10
10
|
import { previewPatch } from "./applicator";
|
|
11
11
|
import { DEFAULT_FUZZY_THRESHOLD, findMatch } from "./fuzzy";
|
|
12
12
|
import { adjustIndentation, normalizeToLF, stripBom } from "./normalize";
|
package/src/patch/index.ts
CHANGED
|
@@ -11,20 +11,20 @@
|
|
|
11
11
|
import { mkdir } from "node:fs/promises";
|
|
12
12
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
13
13
|
import { StringEnum } from "@oh-my-pi/pi-ai";
|
|
14
|
-
import {
|
|
15
|
-
import { renderPromptTemplate } from "$c/config/prompt-templates";
|
|
14
|
+
import { renderPromptTemplate } from "@oh-my-pi/pi-coding-agent/config/prompt-templates";
|
|
16
15
|
import {
|
|
17
16
|
createLspWritethrough,
|
|
18
17
|
type FileDiagnosticsResult,
|
|
19
18
|
flushLspWritethroughBatch,
|
|
20
19
|
type WritethroughCallback,
|
|
21
20
|
writethroughNoop,
|
|
22
|
-
} from "
|
|
23
|
-
import patchDescription from "
|
|
24
|
-
import replaceDescription from "
|
|
25
|
-
import type { ToolSession } from "
|
|
26
|
-
import { outputMeta } from "
|
|
27
|
-
import { resolveToCwd } from "
|
|
21
|
+
} from "@oh-my-pi/pi-coding-agent/lsp/index";
|
|
22
|
+
import patchDescription from "@oh-my-pi/pi-coding-agent/prompts/tools/patch.md" with { type: "text" };
|
|
23
|
+
import replaceDescription from "@oh-my-pi/pi-coding-agent/prompts/tools/replace.md" with { type: "text" };
|
|
24
|
+
import type { ToolSession } from "@oh-my-pi/pi-coding-agent/tools/index";
|
|
25
|
+
import { outputMeta } from "@oh-my-pi/pi-coding-agent/tools/output-meta";
|
|
26
|
+
import { resolveToCwd } from "@oh-my-pi/pi-coding-agent/tools/path-utils";
|
|
27
|
+
import { Type } from "@sinclair/typebox";
|
|
28
28
|
import { applyPatch } from "./applicator";
|
|
29
29
|
import { generateDiffString, generateUnifiedDiffString, replaceText } from "./diff";
|
|
30
30
|
import { DEFAULT_FUZZY_THRESHOLD, findMatch } from "./fuzzy";
|
package/src/patch/shared.ts
CHANGED
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import type { ToolCallContext } from "@oh-my-pi/pi-agent-core";
|
|
6
|
-
import type {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import type
|
|
10
|
-
import {
|
|
11
|
-
import { getLanguageFromPath, type Theme } from "$c/modes/theme/theme";
|
|
12
|
-
import type { OutputMeta } from "$c/tools/output-meta";
|
|
6
|
+
import type { RenderResultOptions } from "@oh-my-pi/pi-coding-agent/extensibility/custom-tools/types";
|
|
7
|
+
import type { FileDiagnosticsResult } from "@oh-my-pi/pi-coding-agent/lsp/index";
|
|
8
|
+
import { renderDiff as renderDiffColored } from "@oh-my-pi/pi-coding-agent/modes/components/diff";
|
|
9
|
+
import { getLanguageFromPath, type Theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
|
|
10
|
+
import type { OutputMeta } from "@oh-my-pi/pi-coding-agent/tools/output-meta";
|
|
13
11
|
import {
|
|
14
12
|
formatExpandHint,
|
|
15
13
|
formatStatusIcon,
|
|
@@ -17,8 +15,10 @@ import {
|
|
|
17
15
|
shortenPath,
|
|
18
16
|
ToolUIKit,
|
|
19
17
|
truncateDiffByHunk,
|
|
20
|
-
} from "
|
|
21
|
-
import type { RenderCallOptions } from "
|
|
18
|
+
} from "@oh-my-pi/pi-coding-agent/tools/render-utils";
|
|
19
|
+
import type { RenderCallOptions } from "@oh-my-pi/pi-coding-agent/tools/renderers";
|
|
20
|
+
import type { Component } from "@oh-my-pi/pi-tui";
|
|
21
|
+
import { Text } from "@oh-my-pi/pi-tui";
|
|
22
22
|
import type { DiffError, DiffResult, Operation } from "./types";
|
|
23
23
|
|
|
24
24
|
// ═══════════════════════════════════════════════════════════════════════════
|
package/src/sdk.ts
CHANGED
|
@@ -29,20 +29,20 @@
|
|
|
29
29
|
import { join } from "node:path";
|
|
30
30
|
import { Agent, type AgentEvent, type AgentMessage, type AgentTool, type ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
31
31
|
import { type Message, type Model, supportsXhigh } from "@oh-my-pi/pi-ai";
|
|
32
|
+
import { loadCapability } from "@oh-my-pi/pi-coding-agent/capability/index";
|
|
33
|
+
import { type Rule, ruleCapability } from "@oh-my-pi/pi-coding-agent/capability/rule";
|
|
34
|
+
import { getAgentDir, getConfigDirPaths } from "@oh-my-pi/pi-coding-agent/config";
|
|
32
35
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
33
36
|
// Import discovery to register all providers on startup
|
|
34
37
|
import { logger, postmortem } from "@oh-my-pi/pi-utils";
|
|
35
38
|
import chalk from "chalk";
|
|
36
|
-
import { loadCapability } from "$c/capability/index";
|
|
37
|
-
import { type Rule, ruleCapability } from "$c/capability/rule";
|
|
38
|
-
import { getAgentDir, getConfigDirPaths } from "$c/config";
|
|
39
39
|
import "./discovery";
|
|
40
|
-
import { CursorExecHandlers } from "
|
|
41
|
-
import { initializeWithSettings } from "
|
|
42
|
-
import { TtsrManager } from "
|
|
43
|
-
import { disposeAllKernelSessions } from "
|
|
44
|
-
import { closeAllConnections } from "
|
|
45
|
-
import { unmountAll } from "
|
|
40
|
+
import { CursorExecHandlers } from "@oh-my-pi/pi-coding-agent/cursor";
|
|
41
|
+
import { initializeWithSettings } from "@oh-my-pi/pi-coding-agent/discovery";
|
|
42
|
+
import { TtsrManager } from "@oh-my-pi/pi-coding-agent/export/ttsr";
|
|
43
|
+
import { disposeAllKernelSessions } from "@oh-my-pi/pi-coding-agent/ipy/executor";
|
|
44
|
+
import { closeAllConnections } from "@oh-my-pi/pi-coding-agent/ssh/connection-manager";
|
|
45
|
+
import { unmountAll } from "@oh-my-pi/pi-coding-agent/ssh/sshfs-mount";
|
|
46
46
|
import { ModelRegistry } from "./config/model-registry";
|
|
47
47
|
import { formatModelString, parseModelString } from "./config/model-resolver";
|
|
48
48
|
import { loadPromptTemplates as loadPromptTemplatesInternal, type PromptTemplate } from "./config/prompt-templates";
|
|
@@ -201,19 +201,22 @@ export interface CreateAgentSessionResult {
|
|
|
201
201
|
|
|
202
202
|
// Re-exports
|
|
203
203
|
|
|
204
|
-
export type { PromptTemplate } from "
|
|
205
|
-
export type { Settings, SkillsSettings } from "
|
|
206
|
-
export type {
|
|
207
|
-
|
|
204
|
+
export type { PromptTemplate } from "@oh-my-pi/pi-coding-agent/config/prompt-templates";
|
|
205
|
+
export type { Settings, SkillsSettings } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
|
|
206
|
+
export type {
|
|
207
|
+
CustomCommand,
|
|
208
|
+
CustomCommandFactory,
|
|
209
|
+
} from "@oh-my-pi/pi-coding-agent/extensibility/custom-commands/types";
|
|
210
|
+
export type { CustomTool, CustomToolFactory } from "@oh-my-pi/pi-coding-agent/extensibility/custom-tools/types";
|
|
208
211
|
export type {
|
|
209
212
|
ExtensionAPI,
|
|
210
213
|
ExtensionCommandContext,
|
|
211
214
|
ExtensionContext,
|
|
212
215
|
ExtensionFactory,
|
|
213
216
|
ToolDefinition,
|
|
214
|
-
} from "
|
|
215
|
-
export type { Skill } from "
|
|
216
|
-
export type { FileSlashCommand } from "
|
|
217
|
+
} from "@oh-my-pi/pi-coding-agent/extensibility/extensions/index";
|
|
218
|
+
export type { Skill } from "@oh-my-pi/pi-coding-agent/extensibility/skills";
|
|
219
|
+
export type { FileSlashCommand } from "@oh-my-pi/pi-coding-agent/extensibility/slash-commands";
|
|
217
220
|
export type { MCPManager, MCPServerConfig, MCPServerConnection, MCPToolsLoadResult } from "./mcp/index";
|
|
218
221
|
export type { Tool } from "./tools/index";
|
|
219
222
|
|
|
@@ -26,23 +26,21 @@ import type {
|
|
|
26
26
|
UsageReport,
|
|
27
27
|
} from "@oh-my-pi/pi-ai";
|
|
28
28
|
import { isContextOverflow, modelsAreEqual, supportsXhigh } from "@oh-my-pi/pi-ai";
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import type {
|
|
32
|
-
import {
|
|
33
|
-
import type { ModelRegistry } from "$c/config/model-registry";
|
|
34
|
-
import { parseModelString } from "$c/config/model-resolver";
|
|
29
|
+
import type { Rule } from "@oh-my-pi/pi-coding-agent/capability/rule";
|
|
30
|
+
import { getAgentDbPath } from "@oh-my-pi/pi-coding-agent/config";
|
|
31
|
+
import type { ModelRegistry } from "@oh-my-pi/pi-coding-agent/config/model-registry";
|
|
32
|
+
import { parseModelString } from "@oh-my-pi/pi-coding-agent/config/model-resolver";
|
|
35
33
|
import {
|
|
36
34
|
expandPromptTemplate,
|
|
37
35
|
type PromptTemplate,
|
|
38
36
|
parseCommandArgs,
|
|
39
37
|
renderPromptTemplate,
|
|
40
|
-
} from "
|
|
41
|
-
import type { SettingsManager, SkillsSettings } from "
|
|
42
|
-
import { type BashResult, executeBash as executeBashCommand } from "
|
|
43
|
-
import { exportSessionToHtml } from "
|
|
44
|
-
import type { TtsrManager } from "
|
|
45
|
-
import type { LoadedCustomCommand } from "
|
|
38
|
+
} from "@oh-my-pi/pi-coding-agent/config/prompt-templates";
|
|
39
|
+
import type { SettingsManager, SkillsSettings } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
|
|
40
|
+
import { type BashResult, executeBash as executeBashCommand } from "@oh-my-pi/pi-coding-agent/exec/bash-executor";
|
|
41
|
+
import { exportSessionToHtml } from "@oh-my-pi/pi-coding-agent/export/html/index";
|
|
42
|
+
import type { TtsrManager } from "@oh-my-pi/pi-coding-agent/export/ttsr";
|
|
43
|
+
import type { LoadedCustomCommand } from "@oh-my-pi/pi-coding-agent/extensibility/custom-commands/index";
|
|
46
44
|
import type {
|
|
47
45
|
ExtensionCommandContext,
|
|
48
46
|
ExtensionRunner,
|
|
@@ -54,21 +52,23 @@ import type {
|
|
|
54
52
|
TreePreparation,
|
|
55
53
|
TurnEndEvent,
|
|
56
54
|
TurnStartEvent,
|
|
57
|
-
} from "
|
|
58
|
-
import type { CompactOptions, ContextUsage } from "
|
|
59
|
-
import type { HookCommandContext } from "
|
|
60
|
-
import type { Skill, SkillWarning } from "
|
|
61
|
-
import { expandSlashCommand, type FileSlashCommand } from "
|
|
62
|
-
import { executePython as executePythonCommand, type PythonResult } from "
|
|
63
|
-
import { theme } from "
|
|
64
|
-
import { normalizeDiff, normalizeToLF, ParseError, previewPatch, stripBom } from "
|
|
65
|
-
import ttsrInterruptTemplate from "
|
|
66
|
-
import { closeAllConnections } from "
|
|
67
|
-
import { unmountAll } from "
|
|
68
|
-
import { outputMeta } from "
|
|
69
|
-
import { resolveToCwd } from "
|
|
70
|
-
import type { TodoItem } from "
|
|
71
|
-
import { extractFileMentions, generateFileMentionMessages } from "
|
|
55
|
+
} from "@oh-my-pi/pi-coding-agent/extensibility/extensions";
|
|
56
|
+
import type { CompactOptions, ContextUsage } from "@oh-my-pi/pi-coding-agent/extensibility/extensions/types";
|
|
57
|
+
import type { HookCommandContext } from "@oh-my-pi/pi-coding-agent/extensibility/hooks/types";
|
|
58
|
+
import type { Skill, SkillWarning } from "@oh-my-pi/pi-coding-agent/extensibility/skills";
|
|
59
|
+
import { expandSlashCommand, type FileSlashCommand } from "@oh-my-pi/pi-coding-agent/extensibility/slash-commands";
|
|
60
|
+
import { executePython as executePythonCommand, type PythonResult } from "@oh-my-pi/pi-coding-agent/ipy/executor";
|
|
61
|
+
import { theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
|
|
62
|
+
import { normalizeDiff, normalizeToLF, ParseError, previewPatch, stripBom } from "@oh-my-pi/pi-coding-agent/patch";
|
|
63
|
+
import ttsrInterruptTemplate from "@oh-my-pi/pi-coding-agent/prompts/system/ttsr-interrupt.md" with { type: "text" };
|
|
64
|
+
import { closeAllConnections } from "@oh-my-pi/pi-coding-agent/ssh/connection-manager";
|
|
65
|
+
import { unmountAll } from "@oh-my-pi/pi-coding-agent/ssh/sshfs-mount";
|
|
66
|
+
import { outputMeta } from "@oh-my-pi/pi-coding-agent/tools/output-meta";
|
|
67
|
+
import { resolveToCwd } from "@oh-my-pi/pi-coding-agent/tools/path-utils";
|
|
68
|
+
import type { TodoItem } from "@oh-my-pi/pi-coding-agent/tools/todo-write";
|
|
69
|
+
import { extractFileMentions, generateFileMentionMessages } from "@oh-my-pi/pi-coding-agent/utils/file-mentions";
|
|
70
|
+
import { abortableSleep, logger } from "@oh-my-pi/pi-utils";
|
|
71
|
+
import { YAML } from "bun";
|
|
72
72
|
import {
|
|
73
73
|
type CompactionResult,
|
|
74
74
|
calculateContextTokens,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Database } from "bun:sqlite";
|
|
2
2
|
import { chmodSync, existsSync, mkdirSync } from "node:fs";
|
|
3
3
|
import { dirname } from "node:path";
|
|
4
|
+
import { getAgentDbPath } from "@oh-my-pi/pi-coding-agent/config";
|
|
5
|
+
import type { Settings } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
|
|
4
6
|
import { logger } from "@oh-my-pi/pi-utils";
|
|
5
|
-
import { getAgentDbPath } from "$c/config";
|
|
6
|
-
import type { Settings } from "$c/config/settings-manager";
|
|
7
7
|
import type { AuthCredential } from "./auth-storage";
|
|
8
8
|
|
|
9
9
|
/** Prepared SQLite statement type from bun:sqlite */
|
|
@@ -32,8 +32,8 @@ import {
|
|
|
32
32
|
type UsageReport,
|
|
33
33
|
zaiUsageProvider,
|
|
34
34
|
} from "@oh-my-pi/pi-ai";
|
|
35
|
+
import { getAgentDbPath, getAuthPath } from "@oh-my-pi/pi-coding-agent/config";
|
|
35
36
|
import { logger } from "@oh-my-pi/pi-utils";
|
|
36
|
-
import { getAgentDbPath, getAuthPath } from "$c/config";
|
|
37
37
|
import { AgentStorage } from "./agent-storage";
|
|
38
38
|
import { migrateJsonStorage } from "./storage-migration";
|
|
39
39
|
|
|
@@ -8,16 +8,18 @@
|
|
|
8
8
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
9
9
|
import type { Model } from "@oh-my-pi/pi-ai";
|
|
10
10
|
import { completeSimple } from "@oh-my-pi/pi-ai";
|
|
11
|
-
import { renderPromptTemplate } from "
|
|
12
|
-
import branchSummaryPrompt from "
|
|
13
|
-
import branchSummaryPreamble from "
|
|
11
|
+
import { renderPromptTemplate } from "@oh-my-pi/pi-coding-agent/config/prompt-templates";
|
|
12
|
+
import branchSummaryPrompt from "@oh-my-pi/pi-coding-agent/prompts/compaction/branch-summary.md" with { type: "text" };
|
|
13
|
+
import branchSummaryPreamble from "@oh-my-pi/pi-coding-agent/prompts/compaction/branch-summary-preamble.md" with {
|
|
14
|
+
type: "text",
|
|
15
|
+
};
|
|
14
16
|
import {
|
|
15
17
|
convertToLlm,
|
|
16
18
|
createBranchSummaryMessage,
|
|
17
19
|
createCompactionSummaryMessage,
|
|
18
20
|
createCustomMessage,
|
|
19
|
-
} from "
|
|
20
|
-
import type { ReadonlySessionManager, SessionEntry } from "
|
|
21
|
+
} from "@oh-my-pi/pi-coding-agent/session/messages";
|
|
22
|
+
import type { ReadonlySessionManager, SessionEntry } from "@oh-my-pi/pi-coding-agent/session/session-manager";
|
|
21
23
|
import { estimateTokens } from "./compaction";
|
|
22
24
|
import {
|
|
23
25
|
computeFileLists,
|
|
@@ -8,12 +8,22 @@
|
|
|
8
8
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
9
9
|
import type { AssistantMessage, Model, Usage } from "@oh-my-pi/pi-ai";
|
|
10
10
|
import { completeSimple } from "@oh-my-pi/pi-ai";
|
|
11
|
-
import { renderPromptTemplate } from "
|
|
12
|
-
import compactionSummaryPrompt from "
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
|
|
11
|
+
import { renderPromptTemplate } from "@oh-my-pi/pi-coding-agent/config/prompt-templates";
|
|
12
|
+
import compactionSummaryPrompt from "@oh-my-pi/pi-coding-agent/prompts/compaction/compaction-summary.md" with {
|
|
13
|
+
type: "text",
|
|
14
|
+
};
|
|
15
|
+
import compactionTurnPrefixPrompt from "@oh-my-pi/pi-coding-agent/prompts/compaction/compaction-turn-prefix.md" with {
|
|
16
|
+
type: "text",
|
|
17
|
+
};
|
|
18
|
+
import compactionUpdateSummaryPrompt from "@oh-my-pi/pi-coding-agent/prompts/compaction/compaction-update-summary.md" with {
|
|
19
|
+
type: "text",
|
|
20
|
+
};
|
|
21
|
+
import {
|
|
22
|
+
convertToLlm,
|
|
23
|
+
createBranchSummaryMessage,
|
|
24
|
+
createCustomMessage,
|
|
25
|
+
} from "@oh-my-pi/pi-coding-agent/session/messages";
|
|
26
|
+
import type { CompactionEntry, SessionEntry } from "@oh-my-pi/pi-coding-agent/session/session-manager";
|
|
17
27
|
import {
|
|
18
28
|
computeFileLists,
|
|
19
29
|
createFileOps,
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
6
6
|
import type { Message } from "@oh-my-pi/pi-ai";
|
|
7
|
-
import { renderPromptTemplate } from "
|
|
8
|
-
import fileOperationsTemplate from "
|
|
9
|
-
import summarizationSystemPrompt from "
|
|
7
|
+
import { renderPromptTemplate } from "@oh-my-pi/pi-coding-agent/config/prompt-templates";
|
|
8
|
+
import fileOperationsTemplate from "@oh-my-pi/pi-coding-agent/prompts/system/file-operations.md" with { type: "text" };
|
|
9
|
+
import summarizationSystemPrompt from "@oh-my-pi/pi-coding-agent/prompts/system/summarization-system.md" with {
|
|
10
|
+
type: "text",
|
|
11
|
+
};
|
|
10
12
|
|
|
11
13
|
// ============================================================================
|
|
12
14
|
// File Operation Tracking
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Database } from "bun:sqlite";
|
|
2
2
|
import { mkdirSync } from "node:fs";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
|
+
import { getAgentDir } from "@oh-my-pi/pi-coding-agent/config";
|
|
4
5
|
import { logger } from "@oh-my-pi/pi-utils";
|
|
5
|
-
import { getAgentDir } from "$c/config";
|
|
6
6
|
|
|
7
7
|
export interface HistoryEntry {
|
|
8
8
|
id: number;
|
package/src/session/messages.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
9
9
|
import type { ImageContent, Message, TextContent } from "@oh-my-pi/pi-ai";
|
|
10
|
-
import type { OutputMeta } from "
|
|
11
|
-
import { formatOutputNotice } from "
|
|
10
|
+
import type { OutputMeta } from "@oh-my-pi/pi-coding-agent/tools/output-meta";
|
|
11
|
+
import { formatOutputNotice } from "@oh-my-pi/pi-coding-agent/tools/output-meta";
|
|
12
12
|
|
|
13
13
|
export const COMPACTION_SUMMARY_PREFIX = `The conversation history before this point was compacted into the following summary:
|
|
14
14
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { basename, join, resolve } from "node:path";
|
|
2
2
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
3
3
|
import type { ImageContent, Message, TextContent, Usage } from "@oh-my-pi/pi-ai";
|
|
4
|
+
import { getAgentDir as getDefaultAgentDir } from "@oh-my-pi/pi-coding-agent/config";
|
|
5
|
+
import { resizeImage } from "@oh-my-pi/pi-coding-agent/utils/image-resize";
|
|
4
6
|
import { logger } from "@oh-my-pi/pi-utils";
|
|
5
7
|
import { nanoid } from "nanoid";
|
|
6
|
-
import { getAgentDir as getDefaultAgentDir } from "$c/config";
|
|
7
|
-
import { resizeImage } from "$c/utils/image-resize";
|
|
8
8
|
import {
|
|
9
9
|
type BashExecutionMessage,
|
|
10
10
|
type CustomMessage,
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Original JSON files are backed up to .bak and removed after successful migration.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { getAgentDbPath } from "@oh-my-pi/pi-coding-agent/config";
|
|
8
|
+
import type { Settings } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
|
|
7
9
|
import { logger } from "@oh-my-pi/pi-utils";
|
|
8
|
-
import { getAgentDbPath } from "$c/config";
|
|
9
|
-
import type { Settings } from "$c/config/settings-manager";
|
|
10
10
|
import { AgentStorage } from "./agent-storage";
|
|
11
11
|
import type { AuthCredential, AuthCredentialEntry, AuthStorageData } from "./auth-storage";
|
|
12
12
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { chmodSync, existsSync, mkdirSync, readFileSync, statSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { CONFIG_DIR_NAME } from "@oh-my-pi/pi-coding-agent/config";
|
|
4
5
|
import { logger } from "@oh-my-pi/pi-utils";
|
|
5
6
|
import { $ } from "bun";
|
|
6
|
-
import { CONFIG_DIR_NAME } from "$c/config";
|
|
7
7
|
|
|
8
8
|
export interface SSHConnectionTarget {
|
|
9
9
|
name: string;
|
package/src/ssh/ssh-executor.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { OutputSink } from "@oh-my-pi/pi-coding-agent/session/streaming-output";
|
|
1
2
|
import { cspawn, logger, ptree } from "@oh-my-pi/pi-utils";
|
|
2
|
-
import { OutputSink } from "$c/session/streaming-output";
|
|
3
3
|
import { buildRemoteCommand, ensureConnection, ensureHostInfo, type SSHConnectionTarget } from "./connection-manager";
|
|
4
4
|
import { hasSshfs, mountRemote } from "./sshfs-mount";
|
|
5
5
|
|
package/src/ssh/sshfs-mount.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { chmodSync, existsSync, mkdirSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { CONFIG_DIR_NAME } from "@oh-my-pi/pi-coding-agent/config";
|
|
4
5
|
import { logger } from "@oh-my-pi/pi-utils";
|
|
5
6
|
import { $ } from "bun";
|
|
6
|
-
import { CONFIG_DIR_NAME } from "$c/config";
|
|
7
7
|
import { getControlDir, getControlPathTemplate, type SSHConnectionTarget } from "./connection-manager";
|
|
8
8
|
|
|
9
9
|
const REMOTE_DIR = join(homedir(), CONFIG_DIR_NAME, "remote");
|
package/src/system-prompt.ts
CHANGED
|
@@ -5,16 +5,22 @@
|
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
import { join } from "node:path";
|
|
8
|
+
import { contextFileCapability } from "@oh-my-pi/pi-coding-agent/capability/context-file";
|
|
9
|
+
import { systemPromptCapability } from "@oh-my-pi/pi-coding-agent/capability/system-prompt";
|
|
10
|
+
import { renderPromptTemplate } from "@oh-my-pi/pi-coding-agent/config/prompt-templates";
|
|
11
|
+
import type { SkillsSettings } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
|
|
12
|
+
import {
|
|
13
|
+
type ContextFile,
|
|
14
|
+
loadCapability,
|
|
15
|
+
type SystemPrompt as SystemPromptFile,
|
|
16
|
+
} from "@oh-my-pi/pi-coding-agent/discovery/index";
|
|
17
|
+
import { loadSkills, type Skill } from "@oh-my-pi/pi-coding-agent/extensibility/skills";
|
|
18
|
+
import customSystemPromptTemplate from "@oh-my-pi/pi-coding-agent/prompts/system/custom-system-prompt.md" with {
|
|
19
|
+
type: "text",
|
|
20
|
+
};
|
|
21
|
+
import systemPromptTemplate from "@oh-my-pi/pi-coding-agent/prompts/system/system-prompt.md" with { type: "text" };
|
|
8
22
|
import { $ } from "bun";
|
|
9
23
|
import chalk from "chalk";
|
|
10
|
-
import { contextFileCapability } from "$c/capability/context-file";
|
|
11
|
-
import { systemPromptCapability } from "$c/capability/system-prompt";
|
|
12
|
-
import { renderPromptTemplate } from "$c/config/prompt-templates";
|
|
13
|
-
import type { SkillsSettings } from "$c/config/settings-manager";
|
|
14
|
-
import { type ContextFile, loadCapability, type SystemPrompt as SystemPromptFile } from "$c/discovery/index";
|
|
15
|
-
import { loadSkills, type Skill } from "$c/extensibility/skills";
|
|
16
|
-
import customSystemPromptTemplate from "$c/prompts/system/custom-system-prompt.md" with { type: "text" };
|
|
17
|
-
import systemPromptTemplate from "$c/prompts/system/system-prompt.md" with { type: "text" };
|
|
18
24
|
import type { ToolName } from "./tools/index";
|
|
19
25
|
|
|
20
26
|
interface GitContext {
|
package/src/task/agents.ts
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
* Agents are embedded at build time via Bun's import with { type: "text" }.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { renderPromptTemplate } from "
|
|
8
|
-
import { parseAgentFields } from "
|
|
9
|
-
import exploreMd from "
|
|
7
|
+
import { renderPromptTemplate } from "@oh-my-pi/pi-coding-agent/config/prompt-templates";
|
|
8
|
+
import { parseAgentFields } from "@oh-my-pi/pi-coding-agent/discovery/helpers";
|
|
9
|
+
import exploreMd from "@oh-my-pi/pi-coding-agent/prompts/agents/explore.md" with { type: "text" };
|
|
10
10
|
// Embed agent markdown files at build time
|
|
11
|
-
import agentFrontmatterTemplate from "
|
|
12
|
-
import planMd from "
|
|
13
|
-
import reviewerMd from "
|
|
14
|
-
import taskMd from "
|
|
15
|
-
import { parseFrontmatter } from "
|
|
11
|
+
import agentFrontmatterTemplate from "@oh-my-pi/pi-coding-agent/prompts/agents/frontmatter.md" with { type: "text" };
|
|
12
|
+
import planMd from "@oh-my-pi/pi-coding-agent/prompts/agents/plan.md" with { type: "text" };
|
|
13
|
+
import reviewerMd from "@oh-my-pi/pi-coding-agent/prompts/agents/reviewer.md" with { type: "text" };
|
|
14
|
+
import taskMd from "@oh-my-pi/pi-coding-agent/prompts/agents/task.md" with { type: "text" };
|
|
15
|
+
import { parseFrontmatter } from "@oh-my-pi/pi-coding-agent/utils/frontmatter";
|
|
16
16
|
import type { AgentDefinition, AgentSource } from "./types";
|
|
17
17
|
|
|
18
18
|
interface AgentFrontmatter {
|
package/src/task/commands.ts
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as path from "node:path";
|
|
8
|
-
import { type SlashCommand, slashCommandCapability } from "
|
|
9
|
-
import { renderPromptTemplate } from "
|
|
10
|
-
import { loadCapability } from "
|
|
8
|
+
import { type SlashCommand, slashCommandCapability } from "@oh-my-pi/pi-coding-agent/capability/slash-command";
|
|
9
|
+
import { renderPromptTemplate } from "@oh-my-pi/pi-coding-agent/config/prompt-templates";
|
|
10
|
+
import { loadCapability } from "@oh-my-pi/pi-coding-agent/discovery";
|
|
11
11
|
// Embed command markdown files at build time
|
|
12
|
-
import initMd from "
|
|
13
|
-
import { parseFrontmatter } from "
|
|
12
|
+
import initMd from "@oh-my-pi/pi-coding-agent/prompts/agents/init.md" with { type: "text" };
|
|
13
|
+
import { parseFrontmatter } from "@oh-my-pi/pi-coding-agent/utils/frontmatter";
|
|
14
14
|
|
|
15
15
|
const EMBEDDED_COMMANDS: { name: string; content: string }[] = [
|
|
16
16
|
{ name: "init.md", content: renderPromptTemplate(initMd) },
|
package/src/task/discovery.ts
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
import * as fs from "node:fs";
|
|
16
16
|
import * as path from "node:path";
|
|
17
|
-
import { findAllNearestProjectConfigDirs, getConfigDirs } from "
|
|
18
|
-
import { parseAgentFields } from "
|
|
19
|
-
import { parseFrontmatter } from "
|
|
17
|
+
import { findAllNearestProjectConfigDirs, getConfigDirs } from "@oh-my-pi/pi-coding-agent/config";
|
|
18
|
+
import { parseAgentFields } from "@oh-my-pi/pi-coding-agent/discovery/helpers";
|
|
19
|
+
import { parseFrontmatter } from "@oh-my-pi/pi-coding-agent/utils/frontmatter";
|
|
20
20
|
import { loadBundledAgents } from "./agents";
|
|
21
21
|
import type { AgentDefinition, AgentSource } from "./types";
|
|
22
22
|
|
package/src/task/executor.ts
CHANGED
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import type { AgentEvent, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
9
|
-
import type { ModelRegistry } from "
|
|
10
|
-
import { formatModelString, parseModelPattern } from "
|
|
11
|
-
import { checkPythonKernelAvailability } from "
|
|
12
|
-
import { LspTool } from "
|
|
13
|
-
import type { LspParams } from "
|
|
14
|
-
import { callTool } from "
|
|
15
|
-
import type { MCPManager } from "
|
|
16
|
-
import type { AuthStorage } from "
|
|
17
|
-
import { PythonTool, type PythonToolParams } from "
|
|
18
|
-
import type { EventBus } from "
|
|
9
|
+
import type { ModelRegistry } from "@oh-my-pi/pi-coding-agent/config/model-registry";
|
|
10
|
+
import { formatModelString, parseModelPattern } from "@oh-my-pi/pi-coding-agent/config/model-resolver";
|
|
11
|
+
import { checkPythonKernelAvailability } from "@oh-my-pi/pi-coding-agent/ipy/kernel";
|
|
12
|
+
import { LspTool } from "@oh-my-pi/pi-coding-agent/lsp/index";
|
|
13
|
+
import type { LspParams } from "@oh-my-pi/pi-coding-agent/lsp/types";
|
|
14
|
+
import { callTool } from "@oh-my-pi/pi-coding-agent/mcp/client";
|
|
15
|
+
import type { MCPManager } from "@oh-my-pi/pi-coding-agent/mcp/manager";
|
|
16
|
+
import type { AuthStorage } from "@oh-my-pi/pi-coding-agent/session/auth-storage";
|
|
17
|
+
import { PythonTool, type PythonToolParams } from "@oh-my-pi/pi-coding-agent/tools/python";
|
|
18
|
+
import type { EventBus } from "@oh-my-pi/pi-coding-agent/utils/event-bus";
|
|
19
19
|
import type { ToolSession } from "..";
|
|
20
20
|
import { subprocessToolRegistry } from "./subprocess-tool-registry";
|
|
21
21
|
import {
|
|
@@ -62,7 +62,7 @@ export interface ExecutorOptions {
|
|
|
62
62
|
authStorage?: AuthStorage;
|
|
63
63
|
modelRegistry?: ModelRegistry;
|
|
64
64
|
settingsManager?: {
|
|
65
|
-
serialize: () => import("
|
|
65
|
+
serialize: () => import("@oh-my-pi/pi-coding-agent/config/settings-manager").Settings;
|
|
66
66
|
getPythonToolMode?: () => "ipy-only" | "bash-only" | "both";
|
|
67
67
|
getPythonKernelMode?: () => "session" | "per-call";
|
|
68
68
|
getPythonSharedGateway?: () => boolean;
|
package/src/task/index.ts
CHANGED
|
@@ -18,12 +18,12 @@ import { tmpdir } from "node:os";
|
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import type { AgentTool, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
20
20
|
import type { Usage } from "@oh-my-pi/pi-ai";
|
|
21
|
+
import { renderPromptTemplate } from "@oh-my-pi/pi-coding-agent/config/prompt-templates";
|
|
22
|
+
import type { Theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
|
|
23
|
+
import taskDescriptionTemplate from "@oh-my-pi/pi-coding-agent/prompts/tools/task.md" with { type: "text" };
|
|
24
|
+
import { formatDuration } from "@oh-my-pi/pi-coding-agent/tools/render-utils";
|
|
21
25
|
import { $ } from "bun";
|
|
22
26
|
import { nanoid } from "nanoid";
|
|
23
|
-
import { renderPromptTemplate } from "$c/config/prompt-templates";
|
|
24
|
-
import type { Theme } from "$c/modes/theme/theme";
|
|
25
|
-
import taskDescriptionTemplate from "$c/prompts/tools/task.md" with { type: "text" };
|
|
26
|
-
import { formatDuration } from "$c/tools/render-utils";
|
|
27
27
|
import type { ToolSession } from "..";
|
|
28
28
|
import { discoverAgents, getAgent } from "./discovery";
|
|
29
29
|
import { runSubprocess } from "./executor";
|
package/src/task/render.ts
CHANGED
|
@@ -6,10 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
import type {
|
|
10
|
-
import {
|
|
11
|
-
import type { RenderResultOptions } from "$c/extensibility/custom-tools/types";
|
|
12
|
-
import type { Theme } from "$c/modes/theme/theme";
|
|
9
|
+
import type { RenderResultOptions } from "@oh-my-pi/pi-coding-agent/extensibility/custom-tools/types";
|
|
10
|
+
import type { Theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
|
|
13
11
|
import {
|
|
14
12
|
formatBadge,
|
|
15
13
|
formatDuration,
|
|
@@ -17,14 +15,16 @@ import {
|
|
|
17
15
|
formatStatusIcon,
|
|
18
16
|
formatTokens,
|
|
19
17
|
truncate,
|
|
20
|
-
} from "
|
|
18
|
+
} from "@oh-my-pi/pi-coding-agent/tools/render-utils";
|
|
21
19
|
import {
|
|
22
20
|
type FindingPriority,
|
|
23
21
|
getPriorityInfo,
|
|
24
22
|
PRIORITY_LABELS,
|
|
25
23
|
type ReportFindingDetails,
|
|
26
24
|
type SubmitReviewDetails,
|
|
27
|
-
} from "
|
|
25
|
+
} from "@oh-my-pi/pi-coding-agent/tools/review";
|
|
26
|
+
import type { Component } from "@oh-my-pi/pi-tui";
|
|
27
|
+
import { Container, Text } from "@oh-my-pi/pi-tui";
|
|
28
28
|
import { subprocessToolRegistry } from "./subprocess-tool-registry";
|
|
29
29
|
import type { AgentProgress, SingleResult, TaskParams, TaskToolDetails } from "./types";
|
|
30
30
|
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* - Provide custom rendering for realtime/final display
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
import type { Theme } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
|
|
10
11
|
import type { Component } from "@oh-my-pi/pi-tui";
|
|
11
|
-
import type { Theme } from "$c/modes/theme/theme";
|
|
12
12
|
|
|
13
13
|
/** Event from subprocess tool execution (parsed from JSONL) */
|
|
14
14
|
export interface SubprocessToolEvent {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AgentEvent, ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
2
|
-
import type { SerializedModelRegistry } from "
|
|
3
|
-
import type { Settings } from "
|
|
4
|
-
import type { SerializedAuthStorage } from "
|
|
2
|
+
import type { SerializedModelRegistry } from "@oh-my-pi/pi-coding-agent/config/model-registry";
|
|
3
|
+
import type { Settings } from "@oh-my-pi/pi-coding-agent/config/settings-manager";
|
|
4
|
+
import type { SerializedAuthStorage } from "@oh-my-pi/pi-coding-agent/session/auth-storage";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* MCP tool metadata passed from parent to worker for proxy tool creation.
|