@oh-my-pi/pi-coding-agent 14.5.11 → 14.5.13
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 +58 -0
- package/package.json +18 -10
- package/src/cli/jupyter-cli.ts +1 -1
- package/src/config/model-equivalence.ts +49 -16
- package/src/config/model-registry.ts +100 -25
- package/src/config/model-resolver.ts +29 -15
- package/src/config/settings-schema.ts +20 -6
- package/src/config/settings.ts +9 -8
- package/src/config.ts +9 -0
- package/src/eval/backend.ts +43 -0
- package/src/eval/eval.lark +43 -0
- package/src/eval/index.ts +5 -0
- package/src/eval/js/context-manager.ts +717 -0
- package/src/eval/js/executor.ts +131 -0
- package/src/eval/js/index.ts +46 -0
- package/src/eval/js/prelude.ts +2 -0
- package/src/eval/js/prelude.txt +84 -0
- package/src/eval/js/tool-bridge.ts +124 -0
- package/src/eval/parse.ts +337 -0
- package/src/{ipy → eval/py}/executor.ts +2 -180
- package/src/{ipy → eval/py}/gateway-coordinator.ts +4 -3
- package/src/eval/py/index.ts +58 -0
- package/src/{ipy → eval/py}/kernel.ts +5 -41
- package/src/{ipy → eval/py}/prelude.py +39 -227
- package/src/eval/types.ts +48 -0
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +23 -17
- package/src/extensibility/extensions/types.ts +2 -3
- package/src/internal-urls/docs-index.generated.ts +5 -5
- package/src/lsp/client.ts +9 -0
- package/src/lsp/index.ts +395 -0
- package/src/lsp/types.ts +15 -4
- package/src/main.ts +25 -14
- package/src/mcp/oauth-flow.ts +1 -1
- package/src/memories/index.ts +1 -1
- package/src/modes/acp/acp-event-mapper.ts +1 -1
- package/src/modes/components/{python-execution.ts → eval-execution.ts} +11 -4
- package/src/modes/components/login-dialog.ts +1 -1
- package/src/modes/components/oauth-selector.ts +2 -1
- package/src/modes/components/tool-execution.ts +3 -4
- package/src/modes/controllers/command-controller.ts +28 -8
- package/src/modes/controllers/input-controller.ts +4 -4
- package/src/modes/controllers/selector-controller.ts +2 -1
- package/src/modes/interactive-mode.ts +4 -5
- package/src/modes/types.ts +3 -3
- package/src/modes/utils/ui-helpers.ts +2 -2
- package/src/prompts/system/system-prompt.md +3 -3
- package/src/prompts/tools/atom.md +3 -2
- package/src/prompts/tools/browser.md +61 -16
- package/src/prompts/tools/eval.md +92 -0
- package/src/prompts/tools/lsp.md +7 -3
- package/src/sdk.ts +45 -31
- package/src/session/agent-session.ts +44 -54
- package/src/session/messages.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +1 -1
- package/src/system-prompt.ts +34 -66
- package/src/task/executor.ts +5 -9
- package/src/tools/browser/attach.ts +175 -0
- package/src/tools/browser/launch.ts +576 -0
- package/src/tools/browser/readable.ts +90 -0
- package/src/tools/browser/registry.ts +198 -0
- package/src/tools/browser/render.ts +212 -0
- package/src/tools/browser/tab-protocol.ts +101 -0
- package/src/tools/browser/tab-supervisor.ts +429 -0
- package/src/tools/browser/tab-worker-entry.ts +21 -0
- package/src/tools/browser/tab-worker.ts +1006 -0
- package/src/tools/browser.ts +231 -1567
- package/src/tools/checkpoint.ts +2 -2
- package/src/tools/{python.ts → eval.ts} +324 -315
- package/src/tools/exit-plan-mode.ts +1 -1
- package/src/tools/index.ts +62 -100
- package/src/tools/plan-mode-guard.ts +27 -1
- package/src/tools/read.ts +0 -6
- package/src/tools/recipe/runners/pkg.ts +34 -32
- package/src/tools/renderers.ts +4 -2
- package/src/tools/resolve.ts +7 -2
- package/src/tools/todo-write.ts +0 -1
- package/src/tools/tool-timeouts.ts +2 -2
- package/src/utils/markit.ts +15 -7
- package/src/utils/tools-manager.ts +5 -5
- package/src/web/search/index.ts +5 -5
- package/src/web/search/provider.ts +121 -39
- package/src/web/search/providers/gemini.ts +2 -2
- package/src/web/search/render.ts +2 -2
- package/src/ipy/modules.ts +0 -144
- package/src/prompts/tools/python.md +0 -57
- /package/src/{ipy → eval/py}/cancellation.ts +0 -0
- /package/src/{ipy → eval/py}/prelude.ts +0 -0
- /package/src/{ipy → eval/py}/runtime.ts +0 -0
|
@@ -779,23 +779,21 @@
|
|
|
779
779
|
}
|
|
780
780
|
|
|
781
781
|
function renderJsLike(name, args, result, ctx) {
|
|
782
|
-
|
|
783
|
-
const
|
|
784
|
-
if (
|
|
785
|
-
if (args.timeout) badges.push('timeout=' + args.timeout + 's');
|
|
786
|
-
if (args.reset) badges.push('reset');
|
|
787
|
-
let html = toolHead(name, '', badges);
|
|
788
|
-
const cells = Array.isArray(args.cells) ? args.cells : null;
|
|
789
|
-
if (!cells) {
|
|
790
|
-
html += '<div class="tool-error">[missing cells]</div>';
|
|
791
|
-
} else {
|
|
782
|
+
let html = toolHead(name, '');
|
|
783
|
+
const cells = result && result.details && Array.isArray(result.details.cells) ? result.details.cells : null;
|
|
784
|
+
if (cells) {
|
|
792
785
|
for (const cell of cells) {
|
|
793
786
|
html += '<div class="tool-cell">';
|
|
794
787
|
if (cell && cell.title) html += '<div class="tool-cell-title">' + escapeHtml(String(cell.title)) + '</div>';
|
|
795
788
|
const code = cell && typeof cell.code === 'string' ? cell.code : '';
|
|
789
|
+
const lang = cell && cell.language === 'js' ? 'javascript' : 'python';
|
|
796
790
|
html += codeBlock(code, lang);
|
|
797
791
|
html += '</div>';
|
|
798
792
|
}
|
|
793
|
+
} else if (typeof args.input === 'string') {
|
|
794
|
+
html += codeBlock(args.input, null);
|
|
795
|
+
} else {
|
|
796
|
+
html += '<div class="tool-error">[missing input]</div>';
|
|
799
797
|
}
|
|
800
798
|
if (result) {
|
|
801
799
|
html += ctx.renderResultImages();
|
|
@@ -1078,17 +1076,24 @@
|
|
|
1078
1076
|
return html;
|
|
1079
1077
|
}
|
|
1080
1078
|
|
|
1081
|
-
function
|
|
1079
|
+
function renderBrowser(name, args, result, ctx) {
|
|
1082
1080
|
const action = str(args.action) || '?';
|
|
1081
|
+
const tabName = str(args.name);
|
|
1083
1082
|
const badges = [];
|
|
1083
|
+
if (tabName) badges.push('name=' + tabName);
|
|
1084
1084
|
if (args.url) badges.push(String(args.url));
|
|
1085
|
-
if (args.
|
|
1086
|
-
|
|
1087
|
-
|
|
1085
|
+
if (args.app && typeof args.app === 'object') {
|
|
1086
|
+
if (args.app.path) badges.push('app=' + shortenPath(String(args.app.path)));
|
|
1087
|
+
else if (args.app.cdp_url) badges.push('cdp=' + String(args.app.cdp_url));
|
|
1088
|
+
}
|
|
1089
|
+
if (args.all) badges.push('all');
|
|
1090
|
+
if (args.kill) badges.push('kill');
|
|
1091
|
+
let head = '<span class="tool-name">browser</span> <span class="tool-badge">' + escapeHtml(action) + '</span>';
|
|
1088
1092
|
for (const b of badges) head += ' <span class="tool-badge">' + escapeHtml(String(b)) + '</span>';
|
|
1089
1093
|
let html = '<div class="tool-header">' + head + '</div>';
|
|
1090
|
-
if (
|
|
1091
|
-
|
|
1094
|
+
if (action === 'run' && args.code) {
|
|
1095
|
+
html += codeBlock(String(args.code), 'javascript');
|
|
1096
|
+
}
|
|
1092
1097
|
if (result) {
|
|
1093
1098
|
html += ctx.renderResultImages();
|
|
1094
1099
|
const output = ctx.getResultText();
|
|
@@ -1277,7 +1282,8 @@
|
|
|
1277
1282
|
web_search: renderWebSearch,
|
|
1278
1283
|
fetch: renderFetch,
|
|
1279
1284
|
debug: renderDebug,
|
|
1280
|
-
puppeteer:
|
|
1285
|
+
puppeteer: renderBrowser,
|
|
1286
|
+
browser: renderBrowser,
|
|
1281
1287
|
inspect_image: renderInspectImage,
|
|
1282
1288
|
generate_image: renderGenerateImage,
|
|
1283
1289
|
ask: renderAsk,
|
|
@@ -15,13 +15,12 @@ import type {
|
|
|
15
15
|
Context,
|
|
16
16
|
ImageContent,
|
|
17
17
|
Model,
|
|
18
|
-
OAuthCredentials,
|
|
19
|
-
OAuthLoginCallbacks,
|
|
20
18
|
ProviderResponseMetadata,
|
|
21
19
|
SimpleStreamOptions,
|
|
22
20
|
TextContent,
|
|
23
21
|
ToolResultMessage,
|
|
24
22
|
} from "@oh-my-pi/pi-ai";
|
|
23
|
+
import type { OAuthCredentials, OAuthLoginCallbacks } from "@oh-my-pi/pi-ai/utils/oauth/types";
|
|
25
24
|
import type * as piCodingAgent from "@oh-my-pi/pi-coding-agent";
|
|
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";
|
|
@@ -29,9 +28,9 @@ import type { Rule } from "../../capability/rule";
|
|
|
29
28
|
import type { KeybindingsManager } from "../../config/keybindings";
|
|
30
29
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
31
30
|
import type { EditToolDetails } from "../../edit";
|
|
31
|
+
import type { PythonResult } from "../../eval/py/executor";
|
|
32
32
|
import type { BashResult } from "../../exec/bash-executor";
|
|
33
33
|
import type { ExecOptions, ExecResult } from "../../exec/exec";
|
|
34
|
-
import type { PythonResult } from "../../ipy/executor";
|
|
35
34
|
import type { Theme } from "../../modes/theme/theme";
|
|
36
35
|
import type { CompactionPreparation, CompactionResult } from "../../session/compaction";
|
|
37
36
|
import type { CustomMessage } from "../../session/messages";
|