aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts
diff options
context:
space:
mode:
authorsharkiecodes <lanyi_stroud@brown.edu>2025-07-22 21:05:47 -0400
committersharkiecodes <lanyi_stroud@brown.edu>2025-07-22 21:05:47 -0400
commit16e7cfcac3d41bd86ef953f131bb0fecba11f299 (patch)
treea2b91bf30e75e513b4913ac88ec3158e512665cf /src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts
parent8ff34d5335093c4ff85473227f39b3e83133d999 (diff)
adjusted agent to include UI control tool
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts')
-rw-r--r--src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts b/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts
index daf6ed941..090b9f5c9 100644
--- a/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts
+++ b/src/client/views/nodes/chatbot/tools/CanvasDocsTool.ts
@@ -283,7 +283,20 @@ export class CanvasDocsTool extends BaseTool<typeof parameterRules> {
try {
const includeSystemDocs = args.includeSystemDocs || false;
- const canvasDocs = this.getAllCanvasDocuments(includeSystemDocs);
+ const allCanvasDocs = this.getAllCanvasDocuments(includeSystemDocs);
+
+ // Filter out container/dashboard documents to only show actual content
+ const canvasDocs = allCanvasDocs.filter(doc => {
+ // Filter out collection containers and docking views (dashboards)
+ const isContainer = doc.type === 'collection' || doc._type_collection === 'Docking';
+ if (isContainer) {
+ console.log(`[CanvasDocsTool] Filtering out container document: ${doc.title || 'Untitled'} (type: ${doc.type}, _type_collection: ${doc._type_collection})`);
+ return false;
+ }
+ return true;
+ });
+
+ console.log(`[CanvasDocsTool] Found ${allCanvasDocs.length} total documents, ${canvasDocs.length} content documents after filtering containers`);
switch (args.action) {
case 'list': {