@oh-my-pi/pi-coding-agent 14.5.10 → 14.5.12
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/package.json +7 -7
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +29 -9
- package/src/internal-urls/docs-index.generated.ts +54 -54
- package/src/ipy/gateway-coordinator.ts +2 -1
- package/src/modes/controllers/todo-command-controller.ts +22 -74
- package/src/modes/interactive-mode.ts +9 -6
- package/src/modes/types.ts +0 -2
- package/src/prompts/system/eager-todo.md +1 -1
- package/src/prompts/tools/atom.md +3 -2
- package/src/prompts/tools/browser.md +61 -16
- package/src/prompts/tools/todo-write.md +19 -19
- package/src/session/agent-session.ts +23 -29
- package/src/tools/browser/attach.ts +175 -0
- package/src/tools/browser/launch.ts +554 -0
- package/src/tools/browser/readable.ts +90 -0
- package/src/tools/browser/registry.ts +417 -0
- package/src/tools/browser/render.ts +212 -0
- package/src/tools/browser/vm.ts +792 -0
- package/src/tools/browser.ts +249 -1568
- package/src/tools/plan-mode-guard.ts +27 -1
- package/src/tools/renderers.ts +2 -0
- package/src/tools/todo-write.ts +157 -195
- package/examples/custom-tools/todo/index.ts +0 -211
- package/examples/extensions/todo.ts +0 -295
|
@@ -964,6 +964,16 @@
|
|
|
964
964
|
return html;
|
|
965
965
|
}
|
|
966
966
|
|
|
967
|
+
function todoRoman(n) {
|
|
968
|
+
if (n <= 0) return '';
|
|
969
|
+
var pairs = [[1000,'M'],[900,'CM'],[500,'D'],[400,'CD'],[100,'C'],[90,'XC'],[50,'L'],[40,'XL'],[10,'X'],[9,'IX'],[5,'V'],[4,'IV'],[1,'I']];
|
|
970
|
+
var out = '', rem = n;
|
|
971
|
+
for (var i = 0; i < pairs.length; i++) {
|
|
972
|
+
while (rem >= pairs[i][0]) { out += pairs[i][1]; rem -= pairs[i][0]; }
|
|
973
|
+
}
|
|
974
|
+
return out;
|
|
975
|
+
}
|
|
976
|
+
|
|
967
977
|
function renderTodoWrite(name, args, result, ctx) {
|
|
968
978
|
let html = toolHead('todo_write');
|
|
969
979
|
const ops = Array.isArray(args.ops) ? args.ops : null;
|
|
@@ -983,8 +993,10 @@
|
|
|
983
993
|
const phases = result?.details?.phases;
|
|
984
994
|
if (Array.isArray(phases)) {
|
|
985
995
|
html += '<div class="todo-tree">';
|
|
986
|
-
for (
|
|
987
|
-
|
|
996
|
+
for (var __i = 0; __i < phases.length; __i++) {
|
|
997
|
+
var phase = phases[__i];
|
|
998
|
+
var phaseLabel = todoRoman(__i + 1) + '. ' + String(phase.name || '');
|
|
999
|
+
html += '<div class="todo-phase">' + escapeHtml(phaseLabel) + '</div>';
|
|
988
1000
|
if (Array.isArray(phase.tasks)) {
|
|
989
1001
|
for (const task of phase.tasks) {
|
|
990
1002
|
const status = task.status || 'pending';
|
|
@@ -1066,17 +1078,24 @@
|
|
|
1066
1078
|
return html;
|
|
1067
1079
|
}
|
|
1068
1080
|
|
|
1069
|
-
function
|
|
1081
|
+
function renderBrowser(name, args, result, ctx) {
|
|
1070
1082
|
const action = str(args.action) || '?';
|
|
1083
|
+
const tabName = str(args.name);
|
|
1071
1084
|
const badges = [];
|
|
1085
|
+
if (tabName) badges.push('name=' + tabName);
|
|
1072
1086
|
if (args.url) badges.push(String(args.url));
|
|
1073
|
-
if (args.
|
|
1074
|
-
|
|
1075
|
-
|
|
1087
|
+
if (args.app && typeof args.app === 'object') {
|
|
1088
|
+
if (args.app.path) badges.push('app=' + shortenPath(String(args.app.path)));
|
|
1089
|
+
else if (args.app.cdp_url) badges.push('cdp=' + String(args.app.cdp_url));
|
|
1090
|
+
}
|
|
1091
|
+
if (args.all) badges.push('all');
|
|
1092
|
+
if (args.kill) badges.push('kill');
|
|
1093
|
+
let head = '<span class="tool-name">browser</span> <span class="tool-badge">' + escapeHtml(action) + '</span>';
|
|
1076
1094
|
for (const b of badges) head += ' <span class="tool-badge">' + escapeHtml(String(b)) + '</span>';
|
|
1077
1095
|
let html = '<div class="tool-header">' + head + '</div>';
|
|
1078
|
-
if (
|
|
1079
|
-
|
|
1096
|
+
if (action === 'run' && args.code) {
|
|
1097
|
+
html += codeBlock(String(args.code), 'javascript');
|
|
1098
|
+
}
|
|
1080
1099
|
if (result) {
|
|
1081
1100
|
html += ctx.renderResultImages();
|
|
1082
1101
|
const output = ctx.getResultText();
|
|
@@ -1265,7 +1284,8 @@
|
|
|
1265
1284
|
web_search: renderWebSearch,
|
|
1266
1285
|
fetch: renderFetch,
|
|
1267
1286
|
debug: renderDebug,
|
|
1268
|
-
puppeteer:
|
|
1287
|
+
puppeteer: renderBrowser,
|
|
1288
|
+
browser: renderBrowser,
|
|
1269
1289
|
inspect_image: renderInspectImage,
|
|
1270
1290
|
generate_image: renderGenerateImage,
|
|
1271
1291
|
ask: renderAsk,
|