@compilr-dev/cli 0.4.0 → 0.5.0
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/README.md +30 -12
- package/dist/agent.d.ts +74 -1
- package/dist/agent.js +259 -76
- package/dist/anchors/index.d.ts +9 -0
- package/dist/anchors/index.js +9 -0
- package/dist/anchors/project-anchors.d.ts +79 -0
- package/dist/anchors/project-anchors.js +202 -0
- package/dist/commands/handler-types.d.ts +68 -0
- package/dist/commands/handler-types.js +8 -0
- package/dist/commands/handlers/agent-commands.d.ts +13 -0
- package/dist/commands/handlers/agent-commands.js +305 -0
- package/dist/commands/handlers/design-commands.d.ts +15 -0
- package/dist/commands/handlers/design-commands.js +334 -0
- package/dist/commands/handlers/index.d.ts +20 -0
- package/dist/commands/handlers/index.js +43 -0
- package/dist/commands/handlers/overlay-commands.d.ts +21 -0
- package/dist/commands/handlers/overlay-commands.js +287 -0
- package/dist/commands/handlers/project-commands.d.ts +11 -0
- package/dist/commands/handlers/project-commands.js +167 -0
- package/dist/commands/handlers/simple-commands.d.ts +19 -0
- package/dist/commands/handlers/simple-commands.js +144 -0
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/registry.d.ts +50 -0
- package/dist/commands/registry.js +75 -0
- package/dist/commands-v2/handlers/context.d.ts +13 -0
- package/dist/commands-v2/handlers/context.js +348 -0
- package/dist/commands-v2/handlers/core.d.ts +13 -0
- package/dist/commands-v2/handlers/core.js +165 -0
- package/dist/commands-v2/handlers/debug.d.ts +11 -0
- package/dist/commands-v2/handlers/debug.js +159 -0
- package/dist/commands-v2/handlers/index.d.ts +12 -0
- package/dist/commands-v2/handlers/index.js +24 -0
- package/dist/commands-v2/handlers/project.d.ts +22 -0
- package/dist/commands-v2/handlers/project.js +814 -0
- package/dist/commands-v2/handlers/settings.d.ts +15 -0
- package/dist/commands-v2/handlers/settings.js +235 -0
- package/dist/commands-v2/index.d.ts +13 -0
- package/dist/commands-v2/index.js +15 -0
- package/dist/commands-v2/registry.d.ts +37 -0
- package/dist/commands-v2/registry.js +80 -0
- package/dist/commands-v2/types.d.ts +75 -0
- package/dist/commands-v2/types.js +7 -0
- package/dist/commands.js +110 -7
- package/dist/index.js +288 -29
- package/dist/input-handlers/index.d.ts +7 -0
- package/dist/input-handlers/index.js +7 -0
- package/dist/input-handlers/memory-handler.d.ts +26 -0
- package/dist/input-handlers/memory-handler.js +68 -0
- package/dist/repl-helpers.d.ts +63 -0
- package/dist/repl-helpers.js +318 -0
- package/dist/repl-v2.d.ts +155 -0
- package/dist/repl-v2.js +774 -0
- package/dist/repl.d.ts +32 -4
- package/dist/repl.js +250 -977
- package/dist/settings/index.d.ts +23 -0
- package/dist/settings/index.js +48 -0
- package/dist/settings/paths.d.ts +110 -0
- package/dist/settings/paths.js +264 -0
- package/dist/templates/compilr-md.js +7 -4
- package/dist/templates/index.js +3 -4
- package/dist/themes/colors.js +3 -1
- package/dist/themes/registry.d.ts +5 -36
- package/dist/themes/registry.js +11 -95
- package/dist/themes/types.d.ts +3 -38
- package/dist/themes/types.js +2 -2
- package/dist/tools/anchor-tools.d.ts +31 -0
- package/dist/tools/anchor-tools.js +255 -0
- package/dist/tools/backlog-wrappers.d.ts +54 -0
- package/dist/tools/backlog-wrappers.js +338 -0
- package/dist/tools/backlog.js +1 -1
- package/dist/tools/db-tools.d.ts +65 -0
- package/dist/tools/db-tools.js +19 -0
- package/dist/tools/document-db.d.ts +43 -0
- package/dist/tools/document-db.js +220 -0
- package/dist/tools/project-db.d.ts +102 -0
- package/dist/tools/project-db.js +370 -0
- package/dist/tools/workitem-db.d.ts +103 -0
- package/dist/tools/workitem-db.js +549 -0
- package/dist/tools.js +13 -3
- package/dist/ui/agents-overlay-v2.d.ts +43 -0
- package/dist/ui/agents-overlay-v2.js +809 -0
- package/dist/ui/agents-overlay.d.ts +5 -5
- package/dist/ui/agents-overlay.js +782 -420
- package/dist/ui/anchors-overlay.d.ts +12 -0
- package/dist/ui/anchors-overlay.js +775 -0
- package/dist/ui/arch-type-overlay.d.ts +1 -6
- package/dist/ui/arch-type-overlay.js +175 -203
- package/dist/ui/ask-user-overlay-v2.d.ts +26 -0
- package/dist/ui/ask-user-overlay-v2.js +555 -0
- package/dist/ui/ask-user-overlay.d.ts +2 -2
- package/dist/ui/ask-user-overlay.js +443 -535
- package/dist/ui/ask-user-simple-overlay-v2.d.ts +25 -0
- package/dist/ui/ask-user-simple-overlay-v2.js +215 -0
- package/dist/ui/ask-user-simple-overlay.d.ts +2 -2
- package/dist/ui/ask-user-simple-overlay.js +182 -209
- package/dist/ui/backlog-overlay.d.ts +16 -1
- package/dist/ui/backlog-overlay.js +525 -659
- package/dist/ui/base/index.d.ts +26 -0
- package/dist/ui/base/index.js +33 -0
- package/dist/ui/base/inline-overlay-utils.d.ts +217 -0
- package/dist/ui/base/inline-overlay-utils.js +320 -0
- package/dist/ui/base/inline-overlay.d.ts +159 -0
- package/dist/ui/base/inline-overlay.js +257 -0
- package/dist/ui/base/key-utils.d.ts +15 -0
- package/dist/ui/base/key-utils.js +30 -0
- package/dist/ui/base/overlay-base-v2.d.ts +193 -0
- package/dist/ui/base/overlay-base-v2.js +246 -0
- package/dist/ui/base/overlay-base.d.ts +156 -0
- package/dist/ui/base/overlay-base.js +238 -0
- package/dist/ui/base/overlay-lifecycle.d.ts +65 -0
- package/dist/ui/base/overlay-lifecycle.js +159 -0
- package/dist/ui/base/overlay-types.d.ts +185 -0
- package/dist/ui/base/overlay-types.js +7 -0
- package/dist/ui/base/render-utils.d.ts +8 -0
- package/dist/ui/base/render-utils.js +11 -0
- package/dist/ui/base/screen-stack.d.ts +148 -0
- package/dist/ui/base/screen-stack.js +184 -0
- package/dist/ui/base/tabbed-list-overlay-v2.d.ts +103 -0
- package/dist/ui/base/tabbed-list-overlay-v2.js +317 -0
- package/dist/ui/base/tabbed-list-overlay.d.ts +153 -0
- package/dist/ui/base/tabbed-list-overlay.js +369 -0
- package/dist/ui/commands-overlay-v2.d.ts +33 -0
- package/dist/ui/commands-overlay-v2.js +441 -0
- package/dist/ui/commands-overlay.d.ts +7 -2
- package/dist/ui/commands-overlay.js +384 -355
- package/dist/ui/config-overlay.d.ts +5 -4
- package/dist/ui/config-overlay.js +243 -513
- package/dist/ui/conversation.d.ts +75 -4
- package/dist/ui/conversation.js +374 -161
- package/dist/ui/docs-overlay.d.ts +17 -0
- package/dist/ui/docs-overlay.js +303 -0
- package/dist/ui/ephemeral.d.ts +1 -1
- package/dist/ui/ephemeral.js +1 -1
- package/dist/ui/features/index.d.ts +34 -0
- package/dist/ui/features/index.js +34 -0
- package/dist/ui/features/input-feature.d.ts +85 -0
- package/dist/ui/features/input-feature.js +238 -0
- package/dist/ui/features/list-feature.d.ts +155 -0
- package/dist/ui/features/list-feature.js +244 -0
- package/dist/ui/features/pagination-feature.d.ts +154 -0
- package/dist/ui/features/pagination-feature.js +238 -0
- package/dist/ui/features/search-feature.d.ts +148 -0
- package/dist/ui/features/search-feature.js +185 -0
- package/dist/ui/features/tab-feature.d.ts +194 -0
- package/dist/ui/features/tab-feature.js +307 -0
- package/dist/ui/footer-v2.d.ts +222 -0
- package/dist/ui/footer-v2.js +1349 -0
- package/dist/ui/footer.d.ts +107 -0
- package/dist/ui/footer.js +359 -67
- package/dist/ui/guardrail-overlay.d.ts +29 -0
- package/dist/ui/guardrail-overlay.js +145 -0
- package/dist/ui/help-overlay-v2.d.ts +34 -0
- package/dist/ui/help-overlay-v2.js +309 -0
- package/dist/ui/help-overlay.d.ts +16 -0
- package/dist/ui/help-overlay.js +316 -0
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -3
- package/dist/ui/init-overlay-v2.d.ts +34 -0
- package/dist/ui/init-overlay-v2.js +600 -0
- package/dist/ui/init-overlay.d.ts +12 -2
- package/dist/ui/init-overlay.js +349 -270
- package/dist/ui/input-prompt-v2.d.ts +1 -0
- package/dist/ui/input-prompt-v2.js +14 -6
- package/dist/ui/input-prompt.d.ts +116 -33
- package/dist/ui/input-prompt.js +536 -337
- package/dist/ui/iteration-limit-overlay-v2.d.ts +21 -0
- package/dist/ui/iteration-limit-overlay-v2.js +114 -0
- package/dist/ui/iteration-limit-overlay.d.ts +2 -2
- package/dist/ui/iteration-limit-overlay.js +92 -128
- package/dist/ui/keys-overlay-v2.d.ts +41 -0
- package/dist/ui/keys-overlay-v2.js +248 -0
- package/dist/ui/keys-overlay.d.ts +1 -0
- package/dist/ui/keys-overlay.js +203 -141
- package/dist/ui/line-utils.d.ts +88 -0
- package/dist/ui/line-utils.js +150 -0
- package/dist/ui/live-region.d.ts +161 -0
- package/dist/ui/live-region.js +387 -0
- package/dist/ui/mascot/expressions.d.ts +32 -0
- package/dist/ui/mascot/expressions.js +213 -0
- package/dist/ui/mascot/index.d.ts +8 -0
- package/dist/ui/mascot/index.js +8 -0
- package/dist/ui/mascot/renderer.d.ts +19 -0
- package/dist/ui/mascot/renderer.js +97 -0
- package/dist/ui/mascot-overlay-v2.d.ts +41 -0
- package/dist/ui/mascot-overlay-v2.js +138 -0
- package/dist/ui/mascot-overlay.d.ts +21 -0
- package/dist/ui/mascot-overlay.js +146 -0
- package/dist/ui/model-overlay-v2.d.ts +49 -0
- package/dist/ui/model-overlay-v2.js +118 -0
- package/dist/ui/model-overlay.d.ts +27 -0
- package/dist/ui/model-overlay.js +221 -0
- package/dist/ui/model-warning-overlay.js +3 -5
- package/dist/ui/new-overlay.d.ts +34 -0
- package/dist/ui/new-overlay.js +604 -0
- package/dist/ui/overlay/impl/agents-overlay-v2.d.ts +45 -0
- package/dist/ui/overlay/impl/agents-overlay-v2.js +825 -0
- package/dist/ui/overlay/impl/anchors-overlay-v2.d.ts +47 -0
- package/dist/ui/overlay/impl/anchors-overlay-v2.js +783 -0
- package/dist/ui/overlay/impl/arch-type-overlay-v2.d.ts +37 -0
- package/dist/ui/overlay/impl/arch-type-overlay-v2.js +240 -0
- package/dist/ui/overlay/impl/ask-user-overlay-v2.d.ts +72 -0
- package/dist/ui/overlay/impl/ask-user-overlay-v2.js +584 -0
- package/dist/ui/overlay/impl/ask-user-simple-overlay-v2.d.ts +46 -0
- package/dist/ui/overlay/impl/ask-user-simple-overlay-v2.js +204 -0
- package/dist/ui/overlay/impl/backlog-overlay-v2.d.ts +49 -0
- package/dist/ui/overlay/impl/backlog-overlay-v2.js +642 -0
- package/dist/ui/overlay/impl/commands-overlay-v2.d.ts +33 -0
- package/dist/ui/overlay/impl/commands-overlay-v2.js +441 -0
- package/dist/ui/overlay/impl/config-overlay-v2.d.ts +100 -0
- package/dist/ui/overlay/impl/config-overlay-v2.js +654 -0
- package/dist/ui/overlay/impl/dashboard-overlay-v2.d.ts +55 -0
- package/dist/ui/overlay/impl/dashboard-overlay-v2.js +359 -0
- package/dist/ui/overlay/impl/docs-overlay-v2.d.ts +45 -0
- package/dist/ui/overlay/impl/docs-overlay-v2.js +114 -0
- package/dist/ui/overlay/impl/document-detail-overlay-v2.d.ts +77 -0
- package/dist/ui/overlay/impl/document-detail-overlay-v2.js +1071 -0
- package/dist/ui/overlay/impl/guardrail-overlay-v2.d.ts +43 -0
- package/dist/ui/overlay/impl/guardrail-overlay-v2.js +114 -0
- package/dist/ui/overlay/impl/help-overlay-v2.d.ts +34 -0
- package/dist/ui/overlay/impl/help-overlay-v2.js +309 -0
- package/dist/ui/overlay/impl/init-overlay-v2.d.ts +77 -0
- package/dist/ui/overlay/impl/init-overlay-v2.js +593 -0
- package/dist/ui/overlay/impl/init-setup-overlay-v2.d.ts +25 -0
- package/dist/ui/overlay/impl/init-setup-overlay-v2.js +97 -0
- package/dist/ui/overlay/impl/iteration-limit-overlay-v2.d.ts +35 -0
- package/dist/ui/overlay/impl/iteration-limit-overlay-v2.js +105 -0
- package/dist/ui/overlay/impl/keys-overlay-v2.d.ts +41 -0
- package/dist/ui/overlay/impl/keys-overlay-v2.js +248 -0
- package/dist/ui/overlay/impl/mascot-overlay-v2.d.ts +41 -0
- package/dist/ui/overlay/impl/mascot-overlay-v2.js +138 -0
- package/dist/ui/overlay/impl/model-overlay-v2.d.ts +49 -0
- package/dist/ui/overlay/impl/model-overlay-v2.js +118 -0
- package/dist/ui/overlay/impl/model-warning-overlay-v2.d.ts +46 -0
- package/dist/ui/overlay/impl/model-warning-overlay-v2.js +132 -0
- package/dist/ui/overlay/impl/new-overlay-v2.d.ts +77 -0
- package/dist/ui/overlay/impl/new-overlay-v2.js +593 -0
- package/dist/ui/overlay/impl/permission-overlay-v2.d.ts +36 -0
- package/dist/ui/overlay/impl/permission-overlay-v2.js +380 -0
- package/dist/ui/overlay/impl/projects-overlay-v2.d.ts +36 -0
- package/dist/ui/overlay/impl/projects-overlay-v2.js +499 -0
- package/dist/ui/overlay/impl/theme-overlay-v2.d.ts +42 -0
- package/dist/ui/overlay/impl/theme-overlay-v2.js +135 -0
- package/dist/ui/overlay/impl/tools-overlay-v2.d.ts +47 -0
- package/dist/ui/overlay/impl/tools-overlay-v2.js +218 -0
- package/dist/ui/overlay/impl/tutorial-overlay-v2.d.ts +31 -0
- package/dist/ui/overlay/impl/tutorial-overlay-v2.js +1035 -0
- package/dist/ui/overlay/impl/workflow-overlay-v2.d.ts +80 -0
- package/dist/ui/overlay/impl/workflow-overlay-v2.js +637 -0
- package/dist/ui/overlay/index.d.ts +33 -0
- package/dist/ui/overlay/index.js +35 -0
- package/dist/ui/overlay/key-utils.d.ts +6 -0
- package/dist/ui/overlay/key-utils.js +6 -0
- package/dist/ui/overlay/overlay-types.d.ts +128 -0
- package/dist/ui/overlay/overlay-types.js +22 -0
- package/dist/ui/overlay/types.d.ts +135 -0
- package/dist/ui/overlay/types.js +22 -0
- package/dist/ui/overlays/help-overlay-v2.d.ts +28 -0
- package/dist/ui/overlays/help-overlay-v2.js +198 -0
- package/dist/ui/overlays/index.d.ts +11 -0
- package/dist/ui/overlays/index.js +11 -0
- package/dist/ui/overlays.d.ts +0 -4
- package/dist/ui/overlays.js +0 -444
- package/dist/ui/permission-overlay-v2.d.ts +36 -0
- package/dist/ui/permission-overlay-v2.js +380 -0
- package/dist/ui/permission-overlay.d.ts +1 -1
- package/dist/ui/permission-overlay.js +186 -298
- package/dist/ui/projects-overlay.d.ts +19 -0
- package/dist/ui/projects-overlay.js +484 -0
- package/dist/ui/providers/types.d.ts +178 -0
- package/dist/ui/providers/types.js +9 -0
- package/dist/ui/render-modes.d.ts +36 -0
- package/dist/ui/render-modes.js +44 -0
- package/dist/ui/startup-menu.d.ts +36 -0
- package/dist/ui/startup-menu.js +236 -0
- package/dist/ui/subagent-renderer.d.ts +117 -0
- package/dist/ui/subagent-renderer.js +334 -0
- package/dist/ui/terminal-codes.d.ts +94 -0
- package/dist/ui/terminal-codes.js +124 -0
- package/dist/ui/terminal-renderer.d.ts +221 -0
- package/dist/ui/terminal-renderer.js +751 -0
- package/dist/ui/terminal-ui.d.ts +463 -0
- package/dist/ui/terminal-ui.js +2296 -0
- package/dist/ui/terminal.d.ts +20 -0
- package/dist/ui/terminal.js +72 -0
- package/dist/ui/theme-overlay-v2.d.ts +42 -0
- package/dist/ui/theme-overlay-v2.js +135 -0
- package/dist/ui/theme-overlay.d.ts +24 -0
- package/dist/ui/theme-overlay.js +127 -0
- package/dist/ui/todo-zone.js +53 -25
- package/dist/ui/tool-formatters.d.ts +16 -0
- package/dist/ui/tool-formatters.js +516 -0
- package/dist/ui/tools-overlay-v2.d.ts +47 -0
- package/dist/ui/tools-overlay-v2.js +218 -0
- package/dist/ui/tools-overlay.d.ts +10 -2
- package/dist/ui/tools-overlay.js +172 -220
- package/dist/ui/tutorial-overlay-v2.d.ts +31 -0
- package/dist/ui/tutorial-overlay-v2.js +1035 -0
- package/dist/ui/tutorial-overlay.d.ts +1 -0
- package/dist/ui/tutorial-overlay.js +400 -302
- package/dist/ui/workflow-overlay.d.ts +22 -0
- package/dist/ui/workflow-overlay.js +636 -0
- package/dist/utils/debug-log.d.ts +28 -0
- package/dist/utils/debug-log.js +57 -0
- package/dist/utils/model-tiers.js +1 -1
- package/dist/utils/path-safety.d.ts +56 -0
- package/dist/utils/path-safety.js +239 -0
- package/dist/workflow/guided-mode-injector.d.ts +42 -0
- package/dist/workflow/guided-mode-injector.js +191 -0
- package/dist/workflow/index.d.ts +8 -0
- package/dist/workflow/index.js +8 -0
- package/dist/workflow/step-criteria.d.ts +62 -0
- package/dist/workflow/step-criteria.js +150 -0
- package/dist/workflow/step-tracker.d.ts +92 -0
- package/dist/workflow/step-tracker.js +141 -0
- package/package.json +12 -5
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Result Formatters
|
|
3
|
+
*
|
|
4
|
+
* Extracts content, summary, and success from tool results.
|
|
5
|
+
* Each tool type has its own formatter to produce human-readable output.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Format tool result for display.
|
|
9
|
+
* Handles the agent's structured result format.
|
|
10
|
+
*/
|
|
11
|
+
export function formatToolResult(toolName, result) {
|
|
12
|
+
// Handle structured results from @compilr-dev/agents
|
|
13
|
+
// Format: { success: boolean, result: { content: string, ... } }
|
|
14
|
+
if (typeof result === 'object' && result !== null) {
|
|
15
|
+
const obj = result;
|
|
16
|
+
// Check for success/result wrapper
|
|
17
|
+
const success = obj.success !== false;
|
|
18
|
+
const innerResult = (obj.result ?? obj);
|
|
19
|
+
// Extract content based on tool type
|
|
20
|
+
let content = '';
|
|
21
|
+
let summary = '';
|
|
22
|
+
const toolLower = toolName.toLowerCase();
|
|
23
|
+
if (toolLower === 'bash' || toolLower === 'bash_output') {
|
|
24
|
+
({ content, summary } = formatBash(innerResult));
|
|
25
|
+
}
|
|
26
|
+
else if (toolLower === 'read_file' || toolLower === 'read') {
|
|
27
|
+
({ content, summary } = formatReadFile(innerResult));
|
|
28
|
+
}
|
|
29
|
+
else if (toolLower === 'write_file' || toolLower === 'write') {
|
|
30
|
+
({ content, summary } = formatWriteFile());
|
|
31
|
+
}
|
|
32
|
+
else if (toolLower === 'edit') {
|
|
33
|
+
({ content, summary } = formatEdit(innerResult));
|
|
34
|
+
}
|
|
35
|
+
else if (toolLower === 'glob') {
|
|
36
|
+
({ content, summary } = formatGlob(innerResult));
|
|
37
|
+
}
|
|
38
|
+
else if (toolLower === 'grep') {
|
|
39
|
+
({ content, summary } = formatGrep(innerResult));
|
|
40
|
+
}
|
|
41
|
+
else if (toolLower === 'backlog_read' || toolLower === 'workitem_query') {
|
|
42
|
+
({ content, summary } = formatBacklogRead(innerResult));
|
|
43
|
+
}
|
|
44
|
+
else if (toolLower === 'git_status') {
|
|
45
|
+
({ content, summary } = formatGitStatus(innerResult));
|
|
46
|
+
}
|
|
47
|
+
else if (toolLower === 'git_diff') {
|
|
48
|
+
({ content, summary } = formatGitDiff(innerResult));
|
|
49
|
+
}
|
|
50
|
+
else if (toolLower === 'git_commit') {
|
|
51
|
+
({ content, summary } = formatGitCommit(innerResult));
|
|
52
|
+
}
|
|
53
|
+
else if (toolLower === 'git_log') {
|
|
54
|
+
({ content, summary } = formatGitLog(innerResult));
|
|
55
|
+
}
|
|
56
|
+
else if (toolLower === 'git_branch') {
|
|
57
|
+
({ content, summary } = formatGitBranch(innerResult));
|
|
58
|
+
}
|
|
59
|
+
else if (toolLower === 'run_tests') {
|
|
60
|
+
({ content, summary } = formatRunTests(innerResult));
|
|
61
|
+
}
|
|
62
|
+
else if (toolLower === 'run_lint') {
|
|
63
|
+
({ content, summary } = formatRunLint(innerResult));
|
|
64
|
+
}
|
|
65
|
+
else if (toolLower === 'detect_project') {
|
|
66
|
+
({ content, summary } = formatDetectProject(innerResult));
|
|
67
|
+
}
|
|
68
|
+
else if (toolLower === 'find_project_root') {
|
|
69
|
+
({ content, summary } = formatFindProjectRoot(innerResult));
|
|
70
|
+
}
|
|
71
|
+
else if (toolLower === 'backlog_write' || toolLower.startsWith('workitem_')) {
|
|
72
|
+
({ content, summary } = formatBacklogWrite(innerResult));
|
|
73
|
+
}
|
|
74
|
+
else if (toolLower.startsWith('anchor_')) {
|
|
75
|
+
({ content, summary } = formatAnchor(innerResult));
|
|
76
|
+
}
|
|
77
|
+
else if (toolLower === 'kill_shell') {
|
|
78
|
+
({ content, summary } = formatKillShell(innerResult));
|
|
79
|
+
}
|
|
80
|
+
else if (toolLower === 'project_get') {
|
|
81
|
+
({ content, summary } = formatProjectGet(innerResult));
|
|
82
|
+
}
|
|
83
|
+
else if (toolLower === 'project_create') {
|
|
84
|
+
({ content, summary } = formatProjectCreate(innerResult));
|
|
85
|
+
}
|
|
86
|
+
else if (toolLower === 'project_update') {
|
|
87
|
+
({ content, summary } = formatProjectUpdate(innerResult));
|
|
88
|
+
}
|
|
89
|
+
else if (toolLower === 'project_list') {
|
|
90
|
+
({ content, summary } = formatProjectList(innerResult));
|
|
91
|
+
}
|
|
92
|
+
else if (toolLower.startsWith('project_document_')) {
|
|
93
|
+
({ content, summary } = formatProjectDocument(toolLower, innerResult));
|
|
94
|
+
}
|
|
95
|
+
else if (toolLower === 'task') {
|
|
96
|
+
({ content, summary } = formatTask(innerResult));
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// Generic handling
|
|
100
|
+
({ content, summary } = formatGeneric(innerResult));
|
|
101
|
+
}
|
|
102
|
+
return { content, summary, success };
|
|
103
|
+
}
|
|
104
|
+
// Fallback for string results
|
|
105
|
+
const content = String(result);
|
|
106
|
+
const lines = content.split('\n').filter((l) => l.length > 0);
|
|
107
|
+
return {
|
|
108
|
+
content,
|
|
109
|
+
summary: lines.length > 0 ? lines[0].slice(0, 60) : 'Completed',
|
|
110
|
+
success: true,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
// =============================================================================
|
|
114
|
+
// Individual Formatters
|
|
115
|
+
// =============================================================================
|
|
116
|
+
function formatBash(result) {
|
|
117
|
+
const rawStdout = result.stdout;
|
|
118
|
+
const rawStderr = result.stderr;
|
|
119
|
+
const stdout = (typeof rawStdout === 'string' ? rawStdout : '').trim();
|
|
120
|
+
const stderr = (typeof rawStderr === 'string' ? rawStderr : '').trim();
|
|
121
|
+
const exitCode = typeof result.exitCode === 'number' ? result.exitCode : 0;
|
|
122
|
+
// Filter out common locale warnings from stderr
|
|
123
|
+
const filteredStderr = stderr.split('\n')
|
|
124
|
+
.filter((line) => !line.includes('setlocale') && !line.includes('LC_ALL'))
|
|
125
|
+
.join('\n').trim();
|
|
126
|
+
const content = stdout || filteredStderr;
|
|
127
|
+
const lines = content.split('\n').filter((l) => l.length > 0);
|
|
128
|
+
let summary;
|
|
129
|
+
if (exitCode !== 0) {
|
|
130
|
+
summary = `Exit code: ${String(exitCode)}`;
|
|
131
|
+
}
|
|
132
|
+
else if (lines.length > 0) {
|
|
133
|
+
summary = lines.length === 1 ? lines[0].slice(0, 60) : `${String(lines.length)} lines`;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
summary = 'Completed';
|
|
137
|
+
}
|
|
138
|
+
return { content, summary };
|
|
139
|
+
}
|
|
140
|
+
function formatReadFile(result) {
|
|
141
|
+
const rawContent = result.content;
|
|
142
|
+
const content = typeof rawContent === 'string' ? rawContent : '';
|
|
143
|
+
const lines = content.split('\n').filter((l) => l.length > 0);
|
|
144
|
+
return { content, summary: `Read ${String(lines.length)} lines` };
|
|
145
|
+
}
|
|
146
|
+
function formatWriteFile() {
|
|
147
|
+
return { content: '', summary: 'File written' };
|
|
148
|
+
}
|
|
149
|
+
function formatEdit(result) {
|
|
150
|
+
const rawDiff = result.diff;
|
|
151
|
+
const rawContent = result.content;
|
|
152
|
+
const content = typeof rawDiff === 'string' ? rawDiff : typeof rawContent === 'string' ? rawContent : '';
|
|
153
|
+
return { content, summary: 'File edited' };
|
|
154
|
+
}
|
|
155
|
+
function formatGlob(result) {
|
|
156
|
+
const rawFiles = result.files ?? result.content;
|
|
157
|
+
if (Array.isArray(rawFiles)) {
|
|
158
|
+
const content = rawFiles.join('\n');
|
|
159
|
+
return { content, summary: `Found ${String(rawFiles.length)} files` };
|
|
160
|
+
}
|
|
161
|
+
else if (typeof rawFiles === 'string') {
|
|
162
|
+
const content = rawFiles;
|
|
163
|
+
const count = content.split('\n').filter((l) => l.length > 0).length;
|
|
164
|
+
return { content, summary: `Found ${String(count)} files` };
|
|
165
|
+
}
|
|
166
|
+
return { content: '', summary: 'No files found' };
|
|
167
|
+
}
|
|
168
|
+
function formatGrep(result) {
|
|
169
|
+
const rawMatches = result.matches ?? result.content;
|
|
170
|
+
if (Array.isArray(rawMatches)) {
|
|
171
|
+
const content = rawMatches.join('\n');
|
|
172
|
+
return { content, summary: `Found ${String(rawMatches.length)} matches` };
|
|
173
|
+
}
|
|
174
|
+
else if (typeof rawMatches === 'string') {
|
|
175
|
+
const content = rawMatches;
|
|
176
|
+
const count = content.split('\n').filter((l) => l.length > 0).length;
|
|
177
|
+
return { content, summary: `Found ${String(count)} matches` };
|
|
178
|
+
}
|
|
179
|
+
return { content: '', summary: 'No matches found' };
|
|
180
|
+
}
|
|
181
|
+
function formatBacklogRead(result) {
|
|
182
|
+
const items = result.items;
|
|
183
|
+
const total = result.total;
|
|
184
|
+
if (Array.isArray(items)) {
|
|
185
|
+
if (items.length === 0) {
|
|
186
|
+
return { content: '', summary: 'No items' };
|
|
187
|
+
}
|
|
188
|
+
// Build content with item summaries
|
|
189
|
+
const itemLines = items.slice(0, 10).map((item) => {
|
|
190
|
+
const id = item.id || '?';
|
|
191
|
+
const title = (item.title || 'Untitled').slice(0, 50);
|
|
192
|
+
const status = item.status || '?';
|
|
193
|
+
const priority = item.priority ? ` [${item.priority}]` : '';
|
|
194
|
+
return `${id}: ${title} (${status})${priority}`;
|
|
195
|
+
});
|
|
196
|
+
if (items.length > 10) {
|
|
197
|
+
itemLines.push(`... and ${String(items.length - 10)} more`);
|
|
198
|
+
}
|
|
199
|
+
return { content: itemLines.join('\n'), summary: `${String(total ?? items.length)} items` };
|
|
200
|
+
}
|
|
201
|
+
return { content: '', summary: 'No items' };
|
|
202
|
+
}
|
|
203
|
+
function formatGitStatus(result) {
|
|
204
|
+
const branch = result.branch;
|
|
205
|
+
const isClean = result.isClean;
|
|
206
|
+
const staged = result.staged;
|
|
207
|
+
const modified = result.modified;
|
|
208
|
+
const untracked = result.untracked;
|
|
209
|
+
if (isClean) {
|
|
210
|
+
return { content: '', summary: `${branch || 'unknown'} (clean)` };
|
|
211
|
+
}
|
|
212
|
+
const parts = [];
|
|
213
|
+
if (staged?.length)
|
|
214
|
+
parts.push(`${String(staged.length)} staged`);
|
|
215
|
+
if (modified?.length)
|
|
216
|
+
parts.push(`${String(modified.length)} modified`);
|
|
217
|
+
if (untracked?.length)
|
|
218
|
+
parts.push(`${String(untracked.length)} untracked`);
|
|
219
|
+
const summary = `${branch || 'unknown'}: ${parts.join(', ')}`;
|
|
220
|
+
// Build detailed content
|
|
221
|
+
const lines = [];
|
|
222
|
+
if (staged?.length) {
|
|
223
|
+
lines.push('Staged:');
|
|
224
|
+
staged.slice(0, 5).forEach((f) => lines.push(` + ${f.path}`));
|
|
225
|
+
if (staged.length > 5)
|
|
226
|
+
lines.push(` ... and ${String(staged.length - 5)} more`);
|
|
227
|
+
}
|
|
228
|
+
if (modified?.length) {
|
|
229
|
+
lines.push('Modified:');
|
|
230
|
+
modified.slice(0, 5).forEach((f) => lines.push(` M ${f.path}`));
|
|
231
|
+
if (modified.length > 5)
|
|
232
|
+
lines.push(` ... and ${String(modified.length - 5)} more`);
|
|
233
|
+
}
|
|
234
|
+
if (untracked?.length) {
|
|
235
|
+
lines.push('Untracked:');
|
|
236
|
+
untracked.slice(0, 5).forEach((f) => lines.push(` ? ${f.path}`));
|
|
237
|
+
if (untracked.length > 5)
|
|
238
|
+
lines.push(` ... and ${String(untracked.length - 5)} more`);
|
|
239
|
+
}
|
|
240
|
+
return { content: lines.join('\n'), summary };
|
|
241
|
+
}
|
|
242
|
+
function formatGitDiff(result) {
|
|
243
|
+
const files = result.files;
|
|
244
|
+
const stats = result.stats;
|
|
245
|
+
const diff = result.diff;
|
|
246
|
+
if (!files?.length) {
|
|
247
|
+
return { content: '', summary: 'No changes' };
|
|
248
|
+
}
|
|
249
|
+
const ins = stats?.insertions ?? 0;
|
|
250
|
+
const del = stats?.deletions ?? 0;
|
|
251
|
+
const summary = `${String(files.length)} file(s), +${String(ins)} -${String(del)}`;
|
|
252
|
+
const content = diff || files.map((f) => f.path).join('\n');
|
|
253
|
+
return { content, summary };
|
|
254
|
+
}
|
|
255
|
+
function formatGitCommit(result) {
|
|
256
|
+
const shortHash = result.shortHash;
|
|
257
|
+
const branch = result.branch;
|
|
258
|
+
const filesCount = result.filesCommitted;
|
|
259
|
+
const message = result.message;
|
|
260
|
+
const msgPreview = (message || '').slice(0, 40);
|
|
261
|
+
const filesInfo = filesCount ? ` (${String(filesCount)} files)` : '';
|
|
262
|
+
const summary = `[${branch || '?'}] ${shortHash || '?'}: ${msgPreview}${filesInfo}`;
|
|
263
|
+
return { content: '', summary };
|
|
264
|
+
}
|
|
265
|
+
function formatGitLog(result) {
|
|
266
|
+
const commits = result.commits;
|
|
267
|
+
if (!commits?.length) {
|
|
268
|
+
return { content: '', summary: 'No commits' };
|
|
269
|
+
}
|
|
270
|
+
const summary = `${String(commits.length)} commit(s)`;
|
|
271
|
+
const lines = commits.slice(0, 10).map((c) => `${c.shortHash || '?'} ${(c.subject || '').slice(0, 50)}`);
|
|
272
|
+
if (commits.length > 10)
|
|
273
|
+
lines.push(`... and ${String(commits.length - 10)} more`);
|
|
274
|
+
return { content: lines.join('\n'), summary };
|
|
275
|
+
}
|
|
276
|
+
function formatGitBranch(result) {
|
|
277
|
+
const current = result.current;
|
|
278
|
+
const branches = result.branches;
|
|
279
|
+
const message = result.message;
|
|
280
|
+
if (message) {
|
|
281
|
+
return { content: '', summary: message };
|
|
282
|
+
}
|
|
283
|
+
if (branches?.length) {
|
|
284
|
+
const summary = `${String(branches.length)} branch(es), current: ${current || '?'}`;
|
|
285
|
+
const content = branches.map((b) => `${b.current ? '* ' : ' '}${b.name}`).join('\n');
|
|
286
|
+
return { content, summary };
|
|
287
|
+
}
|
|
288
|
+
return { content: '', summary: current ? `On branch ${current}` : 'Unknown' };
|
|
289
|
+
}
|
|
290
|
+
function formatRunTests(result) {
|
|
291
|
+
const exitCode = result.exitCode;
|
|
292
|
+
const passed = result.passed;
|
|
293
|
+
const failed = result.failed;
|
|
294
|
+
const skipped = result.skipped;
|
|
295
|
+
const framework = result.framework;
|
|
296
|
+
const output = result.output;
|
|
297
|
+
const parts = [];
|
|
298
|
+
if (passed !== undefined)
|
|
299
|
+
parts.push(`${String(passed)} passed`);
|
|
300
|
+
if (failed !== undefined)
|
|
301
|
+
parts.push(`${String(failed)} failed`);
|
|
302
|
+
if (skipped !== undefined)
|
|
303
|
+
parts.push(`${String(skipped)} skipped`);
|
|
304
|
+
let summary;
|
|
305
|
+
if (parts.length > 0) {
|
|
306
|
+
summary = parts.join(', ');
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
summary = exitCode === 0 ? 'Tests passed' : `Tests failed (exit ${String(exitCode)})`;
|
|
310
|
+
}
|
|
311
|
+
if (framework)
|
|
312
|
+
summary = `[${framework}] ${summary}`;
|
|
313
|
+
return { content: output || '', summary };
|
|
314
|
+
}
|
|
315
|
+
function formatRunLint(result) {
|
|
316
|
+
const exitCode = result.exitCode;
|
|
317
|
+
const errors = result.errors;
|
|
318
|
+
const warnings = result.warnings;
|
|
319
|
+
const linter = result.linter;
|
|
320
|
+
const output = result.output;
|
|
321
|
+
const parts = [];
|
|
322
|
+
if (errors !== undefined)
|
|
323
|
+
parts.push(`${String(errors)} error(s)`);
|
|
324
|
+
if (warnings !== undefined)
|
|
325
|
+
parts.push(`${String(warnings)} warning(s)`);
|
|
326
|
+
let summary;
|
|
327
|
+
if (parts.length > 0) {
|
|
328
|
+
summary = parts.join(', ');
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
summary = exitCode === 0 ? 'Lint passed' : `Lint failed (exit ${String(exitCode)})`;
|
|
332
|
+
}
|
|
333
|
+
if (linter)
|
|
334
|
+
summary = `[${linter}] ${summary}`;
|
|
335
|
+
return { content: output || '', summary };
|
|
336
|
+
}
|
|
337
|
+
function formatDetectProject(result) {
|
|
338
|
+
const primary = result.primary;
|
|
339
|
+
const types = result.types;
|
|
340
|
+
const packageManager = result.packageManager;
|
|
341
|
+
const testFramework = result.testFramework;
|
|
342
|
+
const summary = primary || (types?.length ? types.join(', ') : 'Unknown project');
|
|
343
|
+
const details = [];
|
|
344
|
+
if (packageManager)
|
|
345
|
+
details.push(`Package manager: ${packageManager}`);
|
|
346
|
+
if (testFramework)
|
|
347
|
+
details.push(`Test framework: ${testFramework}`);
|
|
348
|
+
if (result.linter)
|
|
349
|
+
details.push(`Linter: ${result.linter}`);
|
|
350
|
+
if (result.buildTool)
|
|
351
|
+
details.push(`Build tool: ${result.buildTool}`);
|
|
352
|
+
return { content: details.join('\n'), summary };
|
|
353
|
+
}
|
|
354
|
+
function formatFindProjectRoot(result) {
|
|
355
|
+
const root = result.root;
|
|
356
|
+
const foundMarker = result.foundMarker;
|
|
357
|
+
const summary = root || 'Not found';
|
|
358
|
+
const content = foundMarker ? `Found via: ${foundMarker}` : '';
|
|
359
|
+
return { content, summary };
|
|
360
|
+
}
|
|
361
|
+
function formatBacklogWrite(result) {
|
|
362
|
+
const action = result.action;
|
|
363
|
+
const itemId = result.itemId;
|
|
364
|
+
const message = result.message;
|
|
365
|
+
const summary = message || (itemId ? `${action || 'Done'}: ${itemId}` : (action || 'Done'));
|
|
366
|
+
return { content: '', summary };
|
|
367
|
+
}
|
|
368
|
+
function formatAnchor(result) {
|
|
369
|
+
const message = result.message;
|
|
370
|
+
const id = result.id;
|
|
371
|
+
const anchors = result.anchors;
|
|
372
|
+
let summary;
|
|
373
|
+
if (message) {
|
|
374
|
+
summary = message;
|
|
375
|
+
}
|
|
376
|
+
else if (id) {
|
|
377
|
+
summary = `Anchor: ${id}`;
|
|
378
|
+
}
|
|
379
|
+
else if (anchors?.length) {
|
|
380
|
+
summary = `${String(anchors.length)} anchor(s)`;
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
summary = 'Done';
|
|
384
|
+
}
|
|
385
|
+
const content = anchors ? anchors.map((a) => `[${a.id}] ${a.content.slice(0, 50)}`).join('\n') : '';
|
|
386
|
+
return { content, summary };
|
|
387
|
+
}
|
|
388
|
+
function formatKillShell(result) {
|
|
389
|
+
const message = result.message;
|
|
390
|
+
return { content: '', summary: message || 'Shell terminated' };
|
|
391
|
+
}
|
|
392
|
+
function formatProjectGet(result) {
|
|
393
|
+
const project = result.project;
|
|
394
|
+
if (!project) {
|
|
395
|
+
const message = result.message;
|
|
396
|
+
return { content: '', summary: message || 'No project found' };
|
|
397
|
+
}
|
|
398
|
+
const name = project.displayName || project.name || 'Unknown';
|
|
399
|
+
const status = project.status || '';
|
|
400
|
+
const type = project.type || '';
|
|
401
|
+
const path = project.path || '';
|
|
402
|
+
const summary = `${name} (${type || 'project'})`;
|
|
403
|
+
const details = [];
|
|
404
|
+
if (status)
|
|
405
|
+
details.push(`Status: ${status}`);
|
|
406
|
+
if (path)
|
|
407
|
+
details.push(`Path: ${path}`);
|
|
408
|
+
if (project.lifecycleState)
|
|
409
|
+
details.push(`Stage: ${project.lifecycleState}`);
|
|
410
|
+
if (project.framework)
|
|
411
|
+
details.push(`Framework: ${project.framework}`);
|
|
412
|
+
if (project.language)
|
|
413
|
+
details.push(`Language: ${project.language}`);
|
|
414
|
+
return { content: details.join('\n'), summary };
|
|
415
|
+
}
|
|
416
|
+
function formatProjectCreate(result) {
|
|
417
|
+
const project = result.project;
|
|
418
|
+
const message = result.message;
|
|
419
|
+
if (project) {
|
|
420
|
+
const name = project.displayName || project.name || 'Unknown';
|
|
421
|
+
return { content: '', summary: message || `Created project: ${name}` };
|
|
422
|
+
}
|
|
423
|
+
return { content: '', summary: message || 'Project created' };
|
|
424
|
+
}
|
|
425
|
+
function formatProjectUpdate(result) {
|
|
426
|
+
const project = result.project;
|
|
427
|
+
const message = result.message;
|
|
428
|
+
if (project) {
|
|
429
|
+
const name = project.displayName || project.name || 'Unknown';
|
|
430
|
+
return { content: '', summary: message || `Updated project: ${name}` };
|
|
431
|
+
}
|
|
432
|
+
return { content: '', summary: message || 'Project updated' };
|
|
433
|
+
}
|
|
434
|
+
function formatProjectList(result) {
|
|
435
|
+
const projects = result.projects;
|
|
436
|
+
const total = result.total;
|
|
437
|
+
if (!projects?.length) {
|
|
438
|
+
return { content: '', summary: 'No projects found' };
|
|
439
|
+
}
|
|
440
|
+
const summary = `${String(total ?? projects.length)} project(s)`;
|
|
441
|
+
const lines = projects.slice(0, 10).map((p) => {
|
|
442
|
+
const name = p.displayName || p.name || '?';
|
|
443
|
+
const status = p.status ? ` [${p.status}]` : '';
|
|
444
|
+
const type = p.type ? ` (${p.type})` : '';
|
|
445
|
+
return `${name}${type}${status}`;
|
|
446
|
+
});
|
|
447
|
+
if (projects.length > 10)
|
|
448
|
+
lines.push(`... and ${String(projects.length - 10)} more`);
|
|
449
|
+
return { content: lines.join('\n'), summary };
|
|
450
|
+
}
|
|
451
|
+
function formatProjectDocument(toolName, result) {
|
|
452
|
+
const action = toolName.replace('project_document_', '');
|
|
453
|
+
// Handle document_get - return the document
|
|
454
|
+
if (action === 'get') {
|
|
455
|
+
const document = result.document;
|
|
456
|
+
if (!document) {
|
|
457
|
+
return { content: '', summary: 'Document not found' };
|
|
458
|
+
}
|
|
459
|
+
const docType = document.docType || 'unknown';
|
|
460
|
+
const content = document.content || '';
|
|
461
|
+
const preview = content.length > 200 ? content.slice(0, 200) + '...' : content;
|
|
462
|
+
return { content: preview, summary: `Document: ${docType}` };
|
|
463
|
+
}
|
|
464
|
+
// Handle document_list - return list of documents
|
|
465
|
+
if (action === 'list') {
|
|
466
|
+
const documents = result.documents;
|
|
467
|
+
if (!documents?.length) {
|
|
468
|
+
return { content: '', summary: 'No documents found' };
|
|
469
|
+
}
|
|
470
|
+
const summary = `${String(documents.length)} document(s)`;
|
|
471
|
+
const lines = documents.map((d) => d.docType || '?');
|
|
472
|
+
return { content: lines.join('\n'), summary };
|
|
473
|
+
}
|
|
474
|
+
// Handle document_add/delete - simple confirmation
|
|
475
|
+
const message = result.message;
|
|
476
|
+
const docType = result.docType;
|
|
477
|
+
if (message) {
|
|
478
|
+
return { content: '', summary: message };
|
|
479
|
+
}
|
|
480
|
+
if (action === 'add') {
|
|
481
|
+
return { content: '', summary: docType ? `Added document: ${docType}` : 'Document added' };
|
|
482
|
+
}
|
|
483
|
+
if (action === 'delete') {
|
|
484
|
+
return { content: '', summary: docType ? `Deleted document: ${docType}` : 'Document deleted' };
|
|
485
|
+
}
|
|
486
|
+
return { content: '', summary: 'Done' };
|
|
487
|
+
}
|
|
488
|
+
function formatTask(result) {
|
|
489
|
+
const response = result.response;
|
|
490
|
+
const agentType = result.agentType;
|
|
491
|
+
const iterations = result.iterations;
|
|
492
|
+
const toolCalls = result.toolCalls;
|
|
493
|
+
// Build summary: [agentType] N iterations, M tool calls
|
|
494
|
+
const parts = [];
|
|
495
|
+
if (iterations !== undefined) {
|
|
496
|
+
parts.push(`${String(iterations)} iteration${iterations === 1 ? '' : 's'}`);
|
|
497
|
+
}
|
|
498
|
+
if (toolCalls !== undefined) {
|
|
499
|
+
parts.push(`${String(toolCalls)} tool call${toolCalls === 1 ? '' : 's'}`);
|
|
500
|
+
}
|
|
501
|
+
let summary = agentType ? `[${agentType}] ` : '';
|
|
502
|
+
summary += parts.length > 0 ? parts.join(', ') : 'Done';
|
|
503
|
+
// Content is the response text
|
|
504
|
+
const content = response || '';
|
|
505
|
+
return { content, summary };
|
|
506
|
+
}
|
|
507
|
+
function formatGeneric(result) {
|
|
508
|
+
const content = typeof result.content === 'string'
|
|
509
|
+
? result.content
|
|
510
|
+
: typeof result.output === 'string'
|
|
511
|
+
? result.output
|
|
512
|
+
: JSON.stringify(result);
|
|
513
|
+
const lines = content.split('\n').filter((l) => l.length > 0);
|
|
514
|
+
const summary = lines.length > 0 ? lines[0].slice(0, 60) : 'Completed';
|
|
515
|
+
return { content, summary };
|
|
516
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools Overlay V2
|
|
3
|
+
*
|
|
4
|
+
* Displays available agent tools in a categorized, searchable list.
|
|
5
|
+
* Uses TabbedListOverlayV2 for the new Overlay interface.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Tabs: All, Files, Code, Git, Project, Agent
|
|
9
|
+
* - Search with / toggle
|
|
10
|
+
* - Detail view for full tool information
|
|
11
|
+
* - Works with TerminalUI's overlay management
|
|
12
|
+
*/
|
|
13
|
+
import { TabbedListOverlayV2, BaseScreen } from './base/index.js';
|
|
14
|
+
export interface ToolParameter {
|
|
15
|
+
name: string;
|
|
16
|
+
type: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
required: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ToolPermissionInfo {
|
|
21
|
+
level: 'once' | 'always' | 'session';
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ToolInfo {
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
parameters?: ToolParameter[];
|
|
28
|
+
permission?: ToolPermissionInfo;
|
|
29
|
+
}
|
|
30
|
+
export interface ToolsOverlayV2Options {
|
|
31
|
+
/** List of available tools */
|
|
32
|
+
tools: ToolInfo[];
|
|
33
|
+
}
|
|
34
|
+
export interface ToolsOverlayV2Result {
|
|
35
|
+
/** Whether the overlay was dismissed without action */
|
|
36
|
+
dismissed: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Tools overlay using the new Overlay interface.
|
|
40
|
+
* Displays available tools in a searchable, tabbed list.
|
|
41
|
+
*/
|
|
42
|
+
export declare class ToolsOverlayV2 extends TabbedListOverlayV2<ToolInfo, ToolsOverlayV2Result> {
|
|
43
|
+
readonly type: "inline";
|
|
44
|
+
readonly id = "tools-overlay-v2";
|
|
45
|
+
constructor(options: ToolsOverlayV2Options);
|
|
46
|
+
protected createDetailScreen(tool: ToolInfo): BaseScreen | null;
|
|
47
|
+
}
|