@oh-my-pi/pi-coding-agent 16.3.0 → 16.3.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/CHANGELOG.md +91 -0
- package/dist/cli.js +3855 -3798
- package/dist/types/cli/update-cli.d.ts +1 -0
- package/dist/types/cli/update-cli.test.d.ts +1 -0
- package/dist/types/commands/update.d.ts +5 -0
- package/dist/types/config/config-file.d.ts +1 -1
- package/dist/types/config/settings-schema.d.ts +20 -0
- package/dist/types/dap/client.d.ts +9 -1
- package/dist/types/discovery/helpers.d.ts +2 -0
- package/dist/types/edit/file-snapshot-store.d.ts +9 -1
- package/dist/types/edit/hashline/execute.d.ts +1 -1
- package/dist/types/edit/hashline/params.d.ts +3 -6
- package/dist/types/edit/renderer.d.ts +1 -0
- package/dist/types/extensibility/plugins/parser.d.ts +2 -1
- package/dist/types/hindsight/client.d.ts +15 -11
- package/dist/types/hindsight/client.test.d.ts +1 -0
- package/dist/types/irc/bus.d.ts +5 -4
- package/dist/types/mcp/smithery-registry.d.ts +1 -0
- package/dist/types/mcp/smithery-registry.test.d.ts +1 -0
- package/dist/types/modes/components/advisor-message.d.ts +4 -2
- package/dist/types/modes/components/tool-execution.d.ts +9 -6
- package/dist/types/modes/components/transcript-container.d.ts +1 -0
- package/dist/types/modes/theme/theme.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +13 -13
- package/dist/types/session/indexed-session-storage.d.ts +2 -2
- package/dist/types/session/session-storage.d.ts +31 -3
- package/dist/types/ssh/__tests__/connection-manager-timeout.test.d.ts +1 -0
- package/dist/types/ssh/__tests__/sshfs-mount.test.d.ts +1 -0
- package/dist/types/ssh/connection-manager.d.ts +19 -0
- package/dist/types/ssh/sshfs-mount.d.ts +10 -1
- package/dist/types/subprocess/worker-client.d.ts +20 -6
- package/dist/types/task/discovery.d.ts +5 -2
- package/dist/types/task/renderer.d.ts +1 -0
- package/dist/types/tools/ast-grep.d.ts +4 -2
- package/dist/types/tools/bash.d.ts +27 -0
- package/dist/types/tools/browser/render.d.ts +2 -0
- package/dist/types/tools/debug.d.ts +1 -0
- package/dist/types/tools/eval-render.d.ts +2 -0
- package/dist/types/tools/glob.d.ts +4 -2
- package/dist/types/tools/grep.d.ts +4 -3
- package/dist/types/tools/path-utils.d.ts +7 -0
- package/dist/types/tools/renderers.d.ts +24 -0
- package/dist/types/tools/ssh.d.ts +4 -1
- package/dist/types/tts/index.d.ts +2 -0
- package/dist/types/tts/speakable.d.ts +47 -0
- package/dist/types/tts/speech-enhancer.d.ts +46 -0
- package/dist/types/tts/streaming-player.d.ts +1 -2
- package/dist/types/tts/tts-client.d.ts +11 -10
- package/dist/types/tts/tts-protocol.d.ts +7 -0
- package/dist/types/tts/vocalizer.d.ts +15 -8
- package/dist/types/utils/fetch-timeout.d.ts +4 -0
- package/dist/types/utils/git.d.ts +2 -0
- package/dist/types/web/search/providers/base.d.ts +1 -0
- package/dist/types/web/search/providers/gemini.d.ts +1 -0
- package/package.json +12 -12
- package/scripts/generate-legacy-pi-bundled-registry.ts +8 -2
- package/src/advisor/__tests__/advisor.test.ts +1 -1
- package/src/cli/gallery-fixtures/fs.ts +2 -2
- package/src/cli/gallery-fixtures/search.ts +2 -2
- package/src/cli/models-cli.ts +19 -0
- package/src/cli/update-cli.test.ts +28 -0
- package/src/cli/update-cli.ts +35 -8
- package/src/cli.ts +27 -5
- package/src/commands/update.ts +8 -2
- package/src/config/config-file.ts +6 -6
- package/src/config/model-resolver.ts +31 -10
- package/src/config/settings-schema.ts +21 -0
- package/src/cursor.ts +1 -1
- package/src/dap/client.ts +134 -36
- package/src/discovery/helpers.ts +8 -0
- package/src/edit/file-snapshot-store.ts +12 -1
- package/src/edit/hashline/diff.ts +4 -13
- package/src/edit/hashline/execute.ts +1 -1
- package/src/edit/hashline/params.ts +5 -12
- package/src/edit/renderer.ts +4 -2
- package/src/edit/streaming.ts +15 -5
- package/src/export/html/tool-views.generated.js +34 -34
- package/src/extensibility/custom-tools/loader.ts +3 -3
- package/src/extensibility/extensions/loader.ts +10 -3
- package/src/extensibility/legacy-pi-coding-agent-shim.ts +2 -2
- package/src/extensibility/plugins/installer.ts +12 -3
- package/src/extensibility/plugins/legacy-pi-compat.ts +87 -11
- package/src/extensibility/plugins/loader.ts +30 -1
- package/src/extensibility/plugins/manager.ts +32 -8
- package/src/extensibility/plugins/parser.ts +7 -5
- package/src/extensibility/tool-event-input.ts +1 -1
- package/src/hindsight/client.test.ts +33 -0
- package/src/hindsight/client.ts +42 -22
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/irc/bus.ts +5 -4
- package/src/main.ts +7 -1
- package/src/mcp/oauth-flow.ts +93 -4
- package/src/mcp/smithery-auth.ts +3 -0
- package/src/mcp/smithery-connect.ts +9 -0
- package/src/mcp/smithery-registry.test.ts +51 -0
- package/src/mcp/smithery-registry.ts +27 -4
- package/src/modes/components/__tests__/move-overlay.test.ts +72 -1
- package/src/modes/components/advisor-message.ts +13 -10
- package/src/modes/components/assistant-message.ts +1 -1
- package/src/modes/components/move-overlay.ts +35 -23
- package/src/modes/components/status-line/component.ts +11 -4
- package/src/modes/components/tool-execution.ts +119 -20
- package/src/modes/components/transcript-container.ts +26 -0
- package/src/modes/components/tree-selector.ts +10 -3
- package/src/modes/controllers/event-controller.ts +23 -3
- package/src/modes/controllers/tool-args-reveal.ts +1 -1
- package/src/modes/interactive-mode.ts +1 -0
- package/src/modes/rpc/rpc-client.ts +29 -16
- package/src/modes/theme/shimmer.ts +49 -15
- package/src/modes/theme/theme.ts +7 -0
- package/src/prompts/goals/goal-mode-context.md +4 -0
- package/src/prompts/goals/goal-todo-context.md +10 -2
- package/src/prompts/system/speech-rewrite.md +15 -0
- package/src/prompts/system/tiny-title-system.md +1 -1
- package/src/prompts/system/title-system-marker.md +2 -1
- package/src/prompts/system/title-system.md +2 -1
- package/src/prompts/tools/ast-grep.md +3 -3
- package/src/prompts/tools/glob.md +1 -1
- package/src/prompts/tools/grep.md +1 -1
- package/src/sdk.ts +8 -5
- package/src/session/agent-session.ts +329 -79
- package/src/session/indexed-session-storage.ts +40 -3
- package/src/session/session-history-format.ts +6 -2
- package/src/session/session-manager.ts +83 -14
- package/src/session/session-storage.ts +112 -26
- package/src/slash-commands/helpers/usage-report.ts +6 -1
- package/src/ssh/__tests__/connection-manager-timeout.test.ts +61 -0
- package/src/ssh/__tests__/sshfs-mount.test.ts +13 -0
- package/src/ssh/connection-manager.ts +44 -11
- package/src/ssh/sshfs-mount.ts +27 -4
- package/src/subprocess/worker-client.ts +161 -10
- package/src/task/discovery.ts +25 -2
- package/src/task/executor.ts +24 -4
- package/src/task/render.ts +26 -12
- package/src/task/renderer.ts +1 -0
- package/src/task/worktree.ts +144 -16
- package/src/tiny/text.ts +109 -17
- package/src/tools/ast-grep.ts +20 -17
- package/src/tools/bash.ts +46 -9
- package/src/tools/browser/render.ts +2 -0
- package/src/tools/debug.ts +1 -0
- package/src/tools/eval-render.ts +5 -2
- package/src/tools/gh-renderer.ts +3 -0
- package/src/tools/glob.ts +24 -20
- package/src/tools/grep.ts +39 -37
- package/src/tools/path-utils.ts +55 -10
- package/src/tools/read.ts +23 -6
- package/src/tools/renderers.ts +24 -0
- package/src/tools/ssh.ts +25 -7
- package/src/tts/index.ts +2 -0
- package/src/tts/speakable.ts +382 -0
- package/src/tts/speech-enhancer.ts +204 -0
- package/src/tts/streaming-player.ts +71 -16
- package/src/tts/tts-client.ts +11 -10
- package/src/tts/tts-protocol.ts +14 -5
- package/src/tts/tts-worker.ts +52 -49
- package/src/tts/vocalizer.ts +277 -46
- package/src/utils/clipboard.ts +49 -12
- package/src/utils/fetch-timeout.ts +10 -0
- package/src/utils/git.ts +8 -0
- package/src/web/search/index.ts +8 -0
- package/src/web/search/providers/base.ts +1 -0
- package/src/web/search/providers/gemini.ts +23 -6
|
@@ -33,6 +33,13 @@ const MAX_RETRIES = 3;
|
|
|
33
33
|
const BASE_DELAY_MS = 1000;
|
|
34
34
|
const RATE_LIMIT_BUDGET_MS = 5 * 60 * 1000;
|
|
35
35
|
|
|
36
|
+
function resolveGeminiSearchModel(configuredModel: string | undefined): string {
|
|
37
|
+
const envModel = Bun.env.GEMINI_SEARCH_MODEL?.trim();
|
|
38
|
+
if (envModel) return envModel;
|
|
39
|
+
const model = configuredModel?.trim();
|
|
40
|
+
return model || DEFAULT_MODEL;
|
|
41
|
+
}
|
|
42
|
+
|
|
36
43
|
const GEMINI_PROVIDERS = ["google-gemini-cli", "google-antigravity"] as const;
|
|
37
44
|
type GeminiProviderId = (typeof GEMINI_PROVIDERS)[number];
|
|
38
45
|
|
|
@@ -55,6 +62,7 @@ export interface GeminiSearchParams extends GeminiToolParams {
|
|
|
55
62
|
sessionId?: string;
|
|
56
63
|
fetch?: FetchImpl;
|
|
57
64
|
antigravityEndpointMode?: "auto" | "production" | "sandbox";
|
|
65
|
+
geminiModel?: string;
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
export function buildGeminiRequestTools(params: GeminiToolParams): Array<Record<string, Record<string, unknown>>> {
|
|
@@ -160,13 +168,16 @@ interface CloudCodeResponseChunk {
|
|
|
160
168
|
response?: GeminiModelResponse;
|
|
161
169
|
}
|
|
162
170
|
|
|
163
|
-
async function parseGeminiSearchStream(
|
|
171
|
+
async function parseGeminiSearchStream(
|
|
172
|
+
body: ReadableStream<Uint8Array>,
|
|
173
|
+
fallbackModel: string,
|
|
174
|
+
): Promise<GeminiSearchResult> {
|
|
164
175
|
const answerParts: string[] = [];
|
|
165
176
|
const sources: SearchSource[] = [];
|
|
166
177
|
const citations: SearchCitation[] = [];
|
|
167
178
|
const searchQueries: string[] = [];
|
|
168
179
|
const seenUrls = new Set<string>();
|
|
169
|
-
let model =
|
|
180
|
+
let model = fallbackModel;
|
|
170
181
|
let usage: { inputTokens: number; outputTokens: number; totalTokens: number } | undefined;
|
|
171
182
|
|
|
172
183
|
const reader = body.getReader();
|
|
@@ -287,6 +298,7 @@ async function parseGeminiSearchStream(body: ReadableStream<Uint8Array>): Promis
|
|
|
287
298
|
*/
|
|
288
299
|
async function callGeminiSearch(
|
|
289
300
|
auth: GeminiAuth,
|
|
301
|
+
model: string,
|
|
290
302
|
query: string,
|
|
291
303
|
systemPrompt: string | undefined,
|
|
292
304
|
maxOutputTokens: number | undefined,
|
|
@@ -330,7 +342,7 @@ async function callGeminiSearch(
|
|
|
330
342
|
|
|
331
343
|
const requestBody: Record<string, unknown> = {
|
|
332
344
|
project: auth.projectId,
|
|
333
|
-
model
|
|
345
|
+
model,
|
|
334
346
|
request: {
|
|
335
347
|
contents: [
|
|
336
348
|
{
|
|
@@ -414,11 +426,12 @@ async function callGeminiSearch(
|
|
|
414
426
|
throw new SearchProviderError("gemini", "Gemini API returned no response body", 500);
|
|
415
427
|
}
|
|
416
428
|
|
|
417
|
-
return parseGeminiSearchStream(response.body);
|
|
429
|
+
return parseGeminiSearchStream(response.body, model);
|
|
418
430
|
}
|
|
419
431
|
|
|
420
432
|
async function callGeminiDeveloperSearch(
|
|
421
433
|
apiKey: string,
|
|
434
|
+
model: string,
|
|
422
435
|
query: string,
|
|
423
436
|
systemPrompt: string | undefined,
|
|
424
437
|
maxOutputTokens: number | undefined,
|
|
@@ -455,7 +468,7 @@ async function callGeminiDeveloperSearch(
|
|
|
455
468
|
}
|
|
456
469
|
|
|
457
470
|
const response = await fetchWithRetry(
|
|
458
|
-
() => `${DEVELOPER_API_ENDPOINT}/models/${
|
|
471
|
+
() => `${DEVELOPER_API_ENDPOINT}/models/${model}:streamGenerateContent?alt=sse`,
|
|
459
472
|
{
|
|
460
473
|
method: "POST",
|
|
461
474
|
headers: {
|
|
@@ -487,13 +500,14 @@ async function callGeminiDeveloperSearch(
|
|
|
487
500
|
throw new SearchProviderError("gemini", "Gemini API returned no response body", 500);
|
|
488
501
|
}
|
|
489
502
|
|
|
490
|
-
return parseGeminiSearchStream(response.body);
|
|
503
|
+
return parseGeminiSearchStream(response.body, model);
|
|
491
504
|
}
|
|
492
505
|
|
|
493
506
|
/**
|
|
494
507
|
* Executes a web search using Google Gemini with Google Search grounding.
|
|
495
508
|
*/
|
|
496
509
|
export async function searchGemini(params: GeminiSearchParams): Promise<SearchResponse> {
|
|
510
|
+
const selectedModel = resolveGeminiSearchModel(params.geminiModel);
|
|
497
511
|
const seed = await findGeminiAuth(params.authStorage, params.sessionId, params.signal);
|
|
498
512
|
let result: GeminiSearchResult;
|
|
499
513
|
|
|
@@ -513,6 +527,7 @@ export async function searchGemini(params: GeminiSearchParams): Promise<SearchRe
|
|
|
513
527
|
projectId: access.projectId ?? seed.projectId,
|
|
514
528
|
isAntigravity,
|
|
515
529
|
},
|
|
530
|
+
selectedModel,
|
|
516
531
|
params.query,
|
|
517
532
|
params.system_prompt,
|
|
518
533
|
params.max_output_tokens,
|
|
@@ -539,6 +554,7 @@ export async function searchGemini(params: GeminiSearchParams): Promise<SearchRe
|
|
|
539
554
|
}
|
|
540
555
|
result = await callGeminiDeveloperSearch(
|
|
541
556
|
apiKey,
|
|
557
|
+
selectedModel,
|
|
542
558
|
params.query,
|
|
543
559
|
params.system_prompt,
|
|
544
560
|
params.max_output_tokens,
|
|
@@ -596,6 +612,7 @@ export class GeminiProvider extends SearchProvider {
|
|
|
596
612
|
authStorage: params.authStorage,
|
|
597
613
|
sessionId: params.sessionId,
|
|
598
614
|
fetch: params.fetch,
|
|
615
|
+
geminiModel: params.geminiModel,
|
|
599
616
|
});
|
|
600
617
|
}
|
|
601
618
|
}
|