@oh-my-pi/pi-coding-agent 13.3.14 → 13.4.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 +69 -9
- package/examples/sdk/README.md +22 -0
- package/package.json +7 -7
- package/src/capability/index.ts +1 -11
- package/src/commit/analysis/index.ts +4 -4
- package/src/config/settings-schema.ts +18 -15
- package/src/config/settings.ts +2 -20
- package/src/discovery/index.ts +1 -11
- package/src/exa/index.ts +1 -10
- package/src/extensibility/custom-commands/index.ts +2 -15
- package/src/extensibility/custom-tools/index.ts +3 -18
- package/src/extensibility/custom-tools/loader.ts +28 -5
- package/src/extensibility/custom-tools/types.ts +18 -1
- package/src/extensibility/extensions/index.ts +9 -130
- package/src/extensibility/extensions/types.ts +2 -1
- package/src/extensibility/hooks/index.ts +3 -14
- package/src/extensibility/plugins/index.ts +6 -31
- package/src/index.ts +28 -220
- package/src/internal-urls/docs-index.generated.ts +3 -2
- package/src/internal-urls/index.ts +11 -16
- package/src/mcp/index.ts +11 -37
- package/src/mcp/transports/index.ts +2 -2
- package/src/modes/components/extensions/index.ts +3 -3
- package/src/modes/components/index.ts +35 -40
- package/src/modes/rpc/rpc-mode.ts +1 -7
- package/src/patch/index.ts +4 -20
- package/src/prompts/system/system-prompt.md +3 -3
- package/src/prompts/tools/ast-edit.md +30 -0
- package/src/prompts/tools/{ast-find.md → ast-grep.md} +10 -12
- package/src/prompts/tools/bash.md +2 -2
- package/src/prompts/tools/hashline.md +2 -0
- package/src/prompts/tools/resolve.md +8 -0
- package/src/sdk.ts +27 -7
- package/src/session/agent-session.ts +24 -33
- package/src/session/session-manager.ts +0 -30
- package/src/stt/index.ts +3 -3
- package/src/task/types.ts +2 -2
- package/src/tools/ast-edit.ts +480 -0
- package/src/tools/{ast-find.ts → ast-grep.ts} +195 -86
- package/src/tools/bash.ts +3 -2
- package/src/tools/gemini-image.ts +3 -3
- package/src/tools/index.ts +55 -57
- package/src/tools/pending-action.ts +49 -0
- package/src/tools/render-utils.ts +10 -0
- package/src/tools/renderers.ts +6 -4
- package/src/tools/resolve.ts +156 -0
- package/src/web/search/index.ts +6 -4
- package/src/web/search/providers/anthropic.ts +2 -2
- package/src/web/search/providers/base.ts +3 -0
- package/src/web/search/providers/exa.ts +11 -5
- package/src/web/search/providers/gemini.ts +112 -24
- package/src/patch/normative.ts +0 -72
- package/src/prompts/tools/ast-replace.md +0 -37
- package/src/tools/ast-replace.ts +0 -300
|
@@ -1,33 +1,8 @@
|
|
|
1
1
|
// Plugin system exports
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
getEnabledPlugins,
|
|
10
|
-
getPluginSettings,
|
|
11
|
-
resolvePluginCommandPaths,
|
|
12
|
-
resolvePluginHookPaths,
|
|
13
|
-
resolvePluginToolPaths,
|
|
14
|
-
} from "./loader";
|
|
15
|
-
export { PluginManager, parseSettingValue, validateSetting } from "./manager";
|
|
16
|
-
export { extractPackageName, formatPluginSpec, parsePluginSpec } from "./parser";
|
|
17
|
-
export type {
|
|
18
|
-
BooleanSetting,
|
|
19
|
-
DoctorCheck,
|
|
20
|
-
DoctorOptions,
|
|
21
|
-
EnumSetting,
|
|
22
|
-
InstalledPlugin,
|
|
23
|
-
InstallOptions,
|
|
24
|
-
NumberSetting,
|
|
25
|
-
PluginFeature,
|
|
26
|
-
PluginManifest,
|
|
27
|
-
PluginRuntimeConfig,
|
|
28
|
-
PluginRuntimeState,
|
|
29
|
-
PluginSettingSchema,
|
|
30
|
-
PluginSettingType,
|
|
31
|
-
ProjectPluginOverrides,
|
|
32
|
-
StringSetting,
|
|
33
|
-
} from "./types";
|
|
3
|
+
export * from "./doctor";
|
|
4
|
+
export * from "./git-url";
|
|
5
|
+
export * from "./loader";
|
|
6
|
+
export * from "./manager";
|
|
7
|
+
export * from "./parser";
|
|
8
|
+
export type * from "./types";
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { HookEditorComponent, HookInputComponent, HookSelectorComponent } from "./modes/components";
|
|
2
|
+
|
|
1
3
|
// Core session management
|
|
2
4
|
|
|
3
5
|
// TypeBox helper for string enums (convenience for custom tools)
|
|
@@ -7,245 +9,51 @@ export { StringEnum } from "@oh-my-pi/pi-ai";
|
|
|
7
9
|
export { Container, Markdown, Spacer, Text } from "@oh-my-pi/pi-tui";
|
|
8
10
|
// Logging
|
|
9
11
|
export { getAgentDir, logger, VERSION } from "@oh-my-pi/pi-utils";
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
+
export * from "./config/keybindings";
|
|
13
|
+
export * from "./config/model-registry";
|
|
12
14
|
// Prompt templates
|
|
13
|
-
export type
|
|
14
|
-
export
|
|
15
|
-
export type {
|
|
15
|
+
export type * from "./config/prompt-templates";
|
|
16
|
+
export * from "./config/prompt-templates";
|
|
17
|
+
export type { RetrySettings, SkillsSettings } from "./config/settings";
|
|
16
18
|
export { Settings, settings } from "./config/settings";
|
|
17
19
|
// Custom commands
|
|
18
|
-
export type
|
|
19
|
-
|
|
20
|
-
CustomCommandAPI,
|
|
21
|
-
CustomCommandFactory,
|
|
22
|
-
CustomCommandSource,
|
|
23
|
-
CustomCommandsLoadResult,
|
|
24
|
-
LoadedCustomCommand,
|
|
25
|
-
} from "./extensibility/custom-commands/types";
|
|
26
|
-
export type {
|
|
27
|
-
AgentToolUpdateCallback,
|
|
28
|
-
CustomTool,
|
|
29
|
-
CustomToolAPI,
|
|
30
|
-
CustomToolContext,
|
|
31
|
-
CustomToolFactory,
|
|
32
|
-
CustomToolSessionEvent,
|
|
33
|
-
CustomToolsLoadResult,
|
|
34
|
-
CustomToolUIContext,
|
|
35
|
-
ExecResult,
|
|
36
|
-
LoadedCustomTool,
|
|
37
|
-
RenderResultOptions,
|
|
38
|
-
} from "./extensibility/custom-tools";
|
|
20
|
+
export type * from "./extensibility/custom-commands/types";
|
|
21
|
+
export type * from "./extensibility/custom-tools";
|
|
39
22
|
// Custom tools
|
|
40
|
-
export
|
|
41
|
-
export type
|
|
42
|
-
AppAction,
|
|
43
|
-
Extension,
|
|
44
|
-
ExtensionActions,
|
|
45
|
-
ExtensionAPI,
|
|
46
|
-
ExtensionCommandContext,
|
|
47
|
-
ExtensionCommandContextActions,
|
|
48
|
-
ExtensionContext,
|
|
49
|
-
ExtensionContextActions,
|
|
50
|
-
ExtensionError,
|
|
51
|
-
ExtensionEvent,
|
|
52
|
-
ExtensionFactory,
|
|
53
|
-
ExtensionFlag,
|
|
54
|
-
ExtensionHandler,
|
|
55
|
-
ExtensionShortcut,
|
|
56
|
-
ExtensionUIContext,
|
|
57
|
-
ExtensionUIDialogOptions,
|
|
58
|
-
InputEvent,
|
|
59
|
-
InputEventResult,
|
|
60
|
-
KeybindingsManager,
|
|
61
|
-
LoadExtensionsResult,
|
|
62
|
-
MessageRenderer,
|
|
63
|
-
MessageRenderOptions,
|
|
64
|
-
ProviderConfig,
|
|
65
|
-
ProviderModelConfig,
|
|
66
|
-
RegisteredCommand,
|
|
67
|
-
ToolCallEvent,
|
|
68
|
-
ToolResultEvent,
|
|
69
|
-
TurnEndEvent,
|
|
70
|
-
TurnStartEvent,
|
|
71
|
-
UserBashEvent,
|
|
72
|
-
UserBashEventResult,
|
|
73
|
-
UserPythonEvent,
|
|
74
|
-
UserPythonEventResult,
|
|
75
|
-
} from "./extensibility/extensions";
|
|
23
|
+
export * from "./extensibility/custom-tools";
|
|
24
|
+
export type * from "./extensibility/extensions";
|
|
76
25
|
// Extension types and utilities
|
|
77
|
-
export
|
|
78
|
-
discoverAndLoadExtensions,
|
|
79
|
-
ExtensionRunner,
|
|
80
|
-
ExtensionRuntime,
|
|
81
|
-
} from "./extensibility/extensions";
|
|
26
|
+
export * from "./extensibility/extensions";
|
|
82
27
|
// Hook system types (legacy re-export)
|
|
83
|
-
export type * from "./extensibility/hooks";
|
|
84
28
|
// Skills
|
|
85
|
-
export
|
|
86
|
-
type LoadSkillsFromDirOptions,
|
|
87
|
-
type LoadSkillsResult,
|
|
88
|
-
loadSkills,
|
|
89
|
-
loadSkillsFromDir,
|
|
90
|
-
type Skill,
|
|
91
|
-
type SkillWarning,
|
|
92
|
-
} from "./extensibility/skills";
|
|
29
|
+
export * from "./extensibility/skills";
|
|
93
30
|
// Slash commands
|
|
94
31
|
export { type FileSlashCommand, loadSlashCommands as discoverSlashCommands } from "./extensibility/slash-commands";
|
|
95
|
-
export type
|
|
32
|
+
export type * from "./lsp";
|
|
96
33
|
// Main entry point
|
|
97
|
-
export
|
|
34
|
+
export * from "./main";
|
|
98
35
|
// Run modes for programmatic SDK usage
|
|
99
|
-
export
|
|
100
|
-
InteractiveMode,
|
|
101
|
-
type InteractiveModeOptions,
|
|
102
|
-
type PrintModeOptions,
|
|
103
|
-
RpcClient,
|
|
104
|
-
type RpcClientOptions,
|
|
105
|
-
type RpcEventListener,
|
|
106
|
-
runPrintMode,
|
|
107
|
-
runRpcMode,
|
|
108
|
-
} from "./modes";
|
|
36
|
+
export * from "./modes";
|
|
109
37
|
// UI components for extensions
|
|
110
38
|
export {
|
|
111
|
-
AssistantMessageComponent,
|
|
112
|
-
BashExecutionComponent,
|
|
113
|
-
BorderedLoader,
|
|
114
|
-
BranchSummaryMessageComponent,
|
|
115
|
-
CompactionSummaryMessageComponent,
|
|
116
|
-
CustomEditor,
|
|
117
|
-
CustomMessageComponent,
|
|
118
|
-
DynamicBorder,
|
|
119
|
-
FooterComponent,
|
|
120
39
|
HookEditorComponent as ExtensionEditorComponent,
|
|
121
40
|
HookInputComponent as ExtensionInputComponent,
|
|
122
41
|
HookSelectorComponent as ExtensionSelectorComponent,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
OAuthSelectorComponent,
|
|
126
|
-
type RenderDiffOptions,
|
|
127
|
-
renderDiff,
|
|
128
|
-
SessionSelectorComponent,
|
|
129
|
-
type SettingsCallbacks,
|
|
130
|
-
SettingsSelectorComponent,
|
|
131
|
-
ShowImagesSelectorComponent,
|
|
132
|
-
ThemeSelectorComponent,
|
|
133
|
-
ThinkingSelectorComponent,
|
|
134
|
-
ToolExecutionComponent,
|
|
135
|
-
type ToolExecutionOptions,
|
|
136
|
-
TreeSelectorComponent,
|
|
137
|
-
truncateToVisualLines,
|
|
138
|
-
UserMessageComponent,
|
|
139
|
-
UserMessageSelectorComponent,
|
|
140
|
-
type VisualTruncateResult,
|
|
141
|
-
} from "./modes/components";
|
|
42
|
+
};
|
|
43
|
+
export * from "./modes/components";
|
|
142
44
|
// Theme utilities for custom tools
|
|
143
|
-
export
|
|
144
|
-
|
|
145
|
-
getMarkdownTheme,
|
|
146
|
-
getSelectListTheme,
|
|
147
|
-
getSettingsListTheme,
|
|
148
|
-
highlightCode,
|
|
149
|
-
initTheme,
|
|
150
|
-
Theme,
|
|
151
|
-
type ThemeColor,
|
|
152
|
-
} from "./modes/theme/theme";
|
|
153
|
-
export { computeLineHash } from "./patch/hashline";
|
|
45
|
+
export * from "./modes/theme/theme";
|
|
46
|
+
export * from "./patch/hashline";
|
|
154
47
|
// SDK for programmatic usage
|
|
155
|
-
export
|
|
156
|
-
|
|
157
|
-
BashTool,
|
|
158
|
-
// Tool factories
|
|
159
|
-
BUILTIN_TOOLS,
|
|
160
|
-
type BuildSystemPromptOptions,
|
|
161
|
-
buildSystemPrompt,
|
|
162
|
-
type CreateAgentSessionOptions,
|
|
163
|
-
type CreateAgentSessionResult,
|
|
164
|
-
createAgentSession,
|
|
165
|
-
createTools,
|
|
166
|
-
// Discovery
|
|
167
|
-
discoverAuthStorage,
|
|
168
|
-
discoverContextFiles,
|
|
169
|
-
discoverCustomTSCommands,
|
|
170
|
-
discoverExtensions,
|
|
171
|
-
discoverMCPServers,
|
|
172
|
-
discoverPromptTemplates,
|
|
173
|
-
discoverSkills,
|
|
174
|
-
EditTool,
|
|
175
|
-
FindTool,
|
|
176
|
-
GrepTool,
|
|
177
|
-
loadSshTool,
|
|
178
|
-
PythonTool,
|
|
179
|
-
ReadTool,
|
|
180
|
-
type ToolSession,
|
|
181
|
-
WriteTool,
|
|
182
|
-
} from "./sdk";
|
|
183
|
-
export {
|
|
184
|
-
AgentSession,
|
|
185
|
-
type AgentSessionConfig,
|
|
186
|
-
type AgentSessionEvent,
|
|
187
|
-
type AgentSessionEventListener,
|
|
188
|
-
type ModelCycleResult,
|
|
189
|
-
type PromptOptions,
|
|
190
|
-
type SessionStats,
|
|
191
|
-
} from "./session/agent-session";
|
|
48
|
+
export * from "./sdk";
|
|
49
|
+
export * from "./session/agent-session";
|
|
192
50
|
// Auth and model registry
|
|
193
|
-
export
|
|
194
|
-
type ApiKeyCredential,
|
|
195
|
-
type AuthCredential,
|
|
196
|
-
type AuthCredentialStore,
|
|
197
|
-
AuthStorage,
|
|
198
|
-
type OAuthCredential,
|
|
199
|
-
type StoredAuthCredential,
|
|
200
|
-
} from "./session/auth-storage";
|
|
51
|
+
export * from "./session/auth-storage";
|
|
201
52
|
// Compaction
|
|
202
|
-
export
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
type CutPointResult,
|
|
208
|
-
calculateContextTokens,
|
|
209
|
-
collectEntriesForBranchSummary,
|
|
210
|
-
compact,
|
|
211
|
-
DEFAULT_COMPACTION_SETTINGS,
|
|
212
|
-
estimateTokens,
|
|
213
|
-
type FileOperations,
|
|
214
|
-
findCutPoint,
|
|
215
|
-
findTurnStartIndex,
|
|
216
|
-
type GenerateBranchSummaryOptions,
|
|
217
|
-
generateBranchSummary,
|
|
218
|
-
generateSummary,
|
|
219
|
-
getLastAssistantUsage,
|
|
220
|
-
prepareBranchEntries,
|
|
221
|
-
serializeConversation,
|
|
222
|
-
shouldCompact,
|
|
223
|
-
} from "./session/compaction";
|
|
224
|
-
export { convertToLlm } from "./session/messages";
|
|
225
|
-
export {
|
|
226
|
-
type BranchSummaryEntry,
|
|
227
|
-
buildSessionContext,
|
|
228
|
-
type CompactionEntry,
|
|
229
|
-
CURRENT_SESSION_VERSION,
|
|
230
|
-
type CustomEntry,
|
|
231
|
-
type CustomMessageEntry,
|
|
232
|
-
type FileEntry,
|
|
233
|
-
getLatestCompactionEntry,
|
|
234
|
-
type ModeChangeEntry,
|
|
235
|
-
type ModelChangeEntry,
|
|
236
|
-
migrateSessionEntries,
|
|
237
|
-
type NewSessionOptions,
|
|
238
|
-
parseSessionEntries,
|
|
239
|
-
type SessionContext,
|
|
240
|
-
type SessionEntry,
|
|
241
|
-
type SessionEntryBase,
|
|
242
|
-
type SessionHeader,
|
|
243
|
-
type SessionInfo,
|
|
244
|
-
SessionManager,
|
|
245
|
-
type SessionMessageEntry,
|
|
246
|
-
type ThinkingLevelChangeEntry,
|
|
247
|
-
} from "./session/session-manager";
|
|
248
|
-
export { runSubprocess } from "./task/executor";
|
|
249
|
-
export type { AgentDefinition, AgentProgress, AgentSource, SingleResult, TaskParams } from "./task/types";
|
|
53
|
+
export * from "./session/compaction";
|
|
54
|
+
export * from "./session/messages";
|
|
55
|
+
export * from "./session/session-manager";
|
|
56
|
+
export * from "./task/executor";
|
|
57
|
+
export type * from "./task/types";
|
|
250
58
|
// Tools (detail types and utilities)
|
|
251
59
|
export * from "./tools";
|