@oh-my-pi/pi-coding-agent 14.5.10 → 14.5.11
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 +16 -0
- package/package.json +7 -7
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +14 -2
- package/src/internal-urls/docs-index.generated.ts +54 -54
- 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/todo-write.md +19 -19
- package/src/session/agent-session.ts +21 -17
- 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';
|