@oh-my-pi/pi-coding-agent 16.4.2 → 16.4.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 +42 -0
- package/dist/cli.js +17514 -17799
- package/dist/types/advisor/config.d.ts +4 -3
- package/dist/types/commit/agentic/agent.d.ts +1 -0
- package/dist/types/config/settings-schema.d.ts +28 -0
- package/dist/types/extensibility/plugins/legacy-pi-compat.d.ts +10 -22
- package/dist/types/lsp/deferred-diagnostics.d.ts +11 -0
- package/dist/types/modes/components/move-overlay.d.ts +1 -1
- package/dist/types/modes/components/status-line/component.d.ts +3 -0
- package/dist/types/modes/components/status-line/types.d.ts +3 -0
- package/dist/types/modes/interactive-mode.d.ts +8 -0
- package/dist/types/modes/types.d.ts +2 -0
- package/dist/types/session/agent-session.d.ts +16 -0
- package/dist/types/task/executor.d.ts +31 -0
- package/dist/types/tools/__tests__/vibe-render.test.d.ts +1 -0
- package/dist/types/tools/browser/cmux/cmux-tab.d.ts +3 -1
- package/dist/types/tools/browser/cmux/rpc.d.ts +20 -0
- package/dist/types/tools/browser/run-output.d.ts +25 -0
- package/dist/types/tools/browser/tab-worker.d.ts +16 -0
- package/dist/types/tools/index.d.ts +1 -0
- package/dist/types/tools/vibe.d.ts +161 -0
- package/dist/types/utils/changelog.d.ts +35 -1
- package/dist/types/vibe/runtime.d.ts +124 -0
- package/dist/types/vibe/state.d.ts +4 -0
- package/dist/types/web/search/provider.d.ts +2 -0
- package/dist/types/web/search/providers/bing.d.ts +14 -0
- package/dist/types/web/search/providers/browser-headers.d.ts +9 -0
- package/dist/types/web/search/providers/browser-page.d.ts +32 -0
- package/dist/types/web/search/providers/ecosia.d.ts +14 -0
- package/dist/types/web/search/providers/google.d.ts +13 -0
- package/dist/types/web/search/providers/mojeek.d.ts +14 -0
- package/dist/types/web/search/providers/public.d.ts +37 -0
- package/dist/types/web/search/providers/startpage.d.ts +14 -0
- package/dist/types/web/search/providers/yahoo.d.ts +14 -0
- package/dist/types/web/search/types.d.ts +28 -0
- package/package.json +15 -18
- package/scripts/build-binary.ts +56 -73
- package/scripts/bundle-dist.ts +36 -40
- package/scripts/compile-binary.ts +68 -0
- package/scripts/generate-docs-index.ts +3 -93
- package/scripts/legacy-pi-virtual-module.ts +192 -0
- package/src/advisor/__tests__/advisor.test.ts +13 -0
- package/src/advisor/__tests__/config.test.ts +36 -0
- package/src/advisor/config.ts +11 -8
- package/src/commit/agentic/agent.ts +4 -0
- package/src/commit/agentic/index.ts +46 -21
- package/src/edit/index.ts +10 -76
- package/src/exec/non-interactive-env.ts +0 -1
- package/src/extensibility/plugins/legacy-pi-compat.ts +328 -162
- package/src/extensibility/plugins/legacy-pi-virtual-modules.d.ts +4 -0
- package/src/internal-urls/docs-index.ts +2 -1
- package/src/internal-urls/skill-protocol.ts +1 -1
- package/src/lsp/deferred-diagnostics.ts +66 -0
- package/src/main.ts +13 -13
- package/src/mcp/transports/stdio.test.ts +45 -1
- package/src/mcp/transports/stdio.ts +6 -3
- package/src/modes/acp/acp-agent.ts +65 -1
- package/src/modes/acp/acp-event-mapper.ts +5 -0
- package/src/modes/acp/acp-mode.ts +11 -0
- package/src/modes/components/__tests__/move-overlay.test.ts +16 -1
- package/src/modes/components/advisor-config.ts +15 -7
- package/src/modes/components/move-overlay.ts +2 -3
- package/src/modes/components/status-line/component.ts +6 -0
- package/src/modes/components/status-line/segments.ts +6 -0
- package/src/modes/components/status-line/types.ts +3 -0
- package/src/modes/controllers/command-controller.ts +8 -10
- package/src/modes/interactive-mode.ts +117 -1
- package/src/modes/types.ts +2 -0
- package/src/prompts/system/eager-task.md +2 -2
- package/src/prompts/system/system-prompt.md +9 -2
- package/src/prompts/system/vibe-mode-active.md +23 -0
- package/src/prompts/tools/browser.md +3 -3
- package/src/prompts/tools/grep.md +1 -1
- package/src/prompts/tools/vibe-kill.md +3 -0
- package/src/prompts/tools/vibe-list.md +3 -0
- package/src/prompts/tools/vibe-send.md +9 -0
- package/src/prompts/tools/vibe-spawn.md +10 -0
- package/src/prompts/tools/vibe-turn-result.md +19 -0
- package/src/prompts/tools/vibe-wait.md +8 -0
- package/src/sdk.ts +5 -0
- package/src/session/agent-session.ts +103 -13
- package/src/session/snapcompact-inline.ts +3 -19
- package/src/slash-commands/builtin-registry.ts +24 -8
- package/src/task/agents.ts +0 -2
- package/src/task/executor.ts +105 -0
- package/src/tools/__tests__/vibe-render.test.ts +210 -0
- package/src/tools/bash-skill-urls.ts +1 -1
- package/src/tools/browser/cmux/cmux-tab.ts +46 -48
- package/src/tools/browser/cmux/rpc.ts +50 -0
- package/src/tools/browser/run-output.ts +76 -0
- package/src/tools/browser/tab-worker.ts +264 -129
- package/src/tools/glob.ts +20 -6
- package/src/tools/index.ts +1 -0
- package/src/tools/read.ts +17 -9
- package/src/tools/renderers.ts +6 -0
- package/src/tools/vibe.ts +608 -0
- package/src/tools/write.ts +15 -2
- package/src/utils/changelog.ts +106 -9
- package/src/utils/git.ts +0 -1
- package/src/utils/title-generator.ts +70 -7
- package/src/vibe/runtime.ts +710 -0
- package/src/vibe/state.ts +4 -0
- package/src/web/search/index.ts +14 -6
- package/src/web/search/provider.ts +37 -1
- package/src/web/search/providers/bing.ts +197 -0
- package/src/web/search/providers/browser-headers.ts +92 -0
- package/src/web/search/providers/browser-page.ts +123 -0
- package/src/web/search/providers/duckduckgo.ts +13 -34
- package/src/web/search/providers/ecosia.ts +178 -0
- package/src/web/search/providers/google.ts +193 -0
- package/src/web/search/providers/mojeek.ts +206 -0
- package/src/web/search/providers/public.ts +201 -0
- package/src/web/search/providers/startpage.ts +213 -0
- package/src/web/search/providers/yahoo.ts +179 -0
- package/src/web/search/types.ts +35 -0
- package/dist/types/extensibility/plugins/legacy-pi-bundled-keys.d.ts +0 -10
- package/dist/types/extensibility/plugins/legacy-pi-bundled-registry.d.ts +0 -10
- package/scripts/generate-legacy-pi-bundled-registry.ts +0 -420
- package/src/extensibility/plugins/legacy-pi-bundled-keys.ts +0 -1011
- package/src/extensibility/plugins/legacy-pi-bundled-registry.ts +0 -3430
- package/src/internal-urls/docs-index.generated.txt +0 -2
- package/src/prompts/agents/plan.md +0 -47
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ImageContent, TextContent } from "@oh-my-pi/pi-ai";
|
|
2
|
+
import type { JsDisplayOutput } from "../../eval/js/shared/types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Accumulates a browser run's result entries: explicit `display()` payloads,
|
|
6
|
+
* screenshot captions/images, and buffered stream text (`console.*`, `print`,
|
|
7
|
+
* `display()` of strings/primitives — `JsRuntime.displayValue` emits those via
|
|
8
|
+
* `onText`). Stream text is buffered and flushed as one entry before the next
|
|
9
|
+
* display/screenshot (and on `finish()`) so it reaches the tool result in
|
|
10
|
+
* order instead of vanishing into the debug log.
|
|
11
|
+
*/
|
|
12
|
+
export class RunOutput {
|
|
13
|
+
readonly #displays: Array<TextContent | ImageContent> = [];
|
|
14
|
+
#textBuffer = "";
|
|
15
|
+
|
|
16
|
+
/** Buffer a stream-text chunk; it joins the entries at the next push or on finish(). */
|
|
17
|
+
pushText(chunk: string): void {
|
|
18
|
+
this.#textBuffer += chunk;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Append a `display()` payload (image/json/status), flushing buffered text first. */
|
|
22
|
+
pushDisplay(output: JsDisplayOutput): void {
|
|
23
|
+
if (output.type === "image") {
|
|
24
|
+
this.push({ type: "image", data: output.data, mimeType: output.mimeType });
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (output.type === "json") {
|
|
28
|
+
this.push({ type: "text", text: safeJsonStringify(output.data) });
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
// status — surface as compact JSON so helper side effects (read/write/env) appear in
|
|
32
|
+
// the cell result alongside explicit display() output.
|
|
33
|
+
this.push({ type: "text", text: safeJsonStringify(output.event) });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Append a pre-built entry (e.g. a screenshot caption/image), flushing buffered text first. */
|
|
37
|
+
push(entry: TextContent | ImageContent): void {
|
|
38
|
+
this.#flush();
|
|
39
|
+
this.#displays.push(entry);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Flush any remaining stream text and return the ordered entries. */
|
|
43
|
+
finish(): Array<TextContent | ImageContent> {
|
|
44
|
+
this.#flush();
|
|
45
|
+
return this.#displays;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
#flush(): void {
|
|
49
|
+
if (!this.#textBuffer) return;
|
|
50
|
+
// Entries are newline-joined at render; drop the stream's trailing newline.
|
|
51
|
+
this.#displays.push({ type: "text", text: this.#textBuffer.replace(/\n$/, "") });
|
|
52
|
+
this.#textBuffer = "";
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** JSON.stringify that never throws (cycles/BigInt → String(value)). */
|
|
57
|
+
export function safeJsonStringify(value: unknown): string {
|
|
58
|
+
try {
|
|
59
|
+
return JSON.stringify(value, null, 2);
|
|
60
|
+
} catch {
|
|
61
|
+
return String(value);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Pass a return value across the run boundary: structured-cloneable as-is, else JSON round-trip, else String. */
|
|
66
|
+
export function cloneSafe(value: unknown): unknown {
|
|
67
|
+
if (value === undefined) return undefined;
|
|
68
|
+
try {
|
|
69
|
+
structuredClone(value);
|
|
70
|
+
return value;
|
|
71
|
+
} catch {}
|
|
72
|
+
try {
|
|
73
|
+
return JSON.parse(JSON.stringify(value)) as unknown;
|
|
74
|
+
} catch {}
|
|
75
|
+
return String(value);
|
|
76
|
+
}
|