cc-viewer 1.7.22 → 1.8.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 +19 -0
- package/cli.js +92 -11
- package/concepts/ar/GlobalSettings.md +2 -2
- package/concepts/ar/Tool-Artifact.md +7 -0
- package/concepts/ar/Tool-EndConversation.md +35 -0
- package/concepts/ar/Tool-LSP.md +6 -1
- package/concepts/ar/Tool-ListAgents.md +35 -0
- package/concepts/ar/Tool-ListConnectors.md +34 -0
- package/concepts/ar/Tool-ListMcpResources.md +35 -0
- package/concepts/ar/Tool-ListPlugins.md +35 -0
- package/concepts/ar/Tool-ListSkills.md +37 -0
- package/concepts/ar/Tool-Monitor.md +7 -0
- package/concepts/ar/Tool-Projects.md +46 -0
- package/concepts/ar/Tool-ProposeGoal.md +43 -0
- package/concepts/ar/Tool-PushNotification.md +6 -0
- package/concepts/ar/Tool-REPL.md +47 -0
- package/concepts/ar/Tool-ReadMcpResource.md +32 -0
- package/concepts/ar/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/ar/Tool-ReadNotifications.md +27 -0
- package/concepts/ar/Tool-RemoteTrigger.md +7 -0
- package/concepts/ar/Tool-ScheduleWakeup.md +5 -0
- package/concepts/ar/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/ar/Tool-SendFeedback.md +38 -0
- package/concepts/ar/Tool-SendFile.md +36 -0
- package/concepts/ar/Tool-SendMessage.md +5 -0
- package/concepts/ar/Tool-SendUserFile.md +38 -0
- package/concepts/ar/Tool-SendUserMessage.md +38 -0
- package/concepts/ar/Tool-SuggestConnectors.md +28 -0
- package/concepts/ar/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/ar/Tool-SuggestSkills.md +33 -0
- package/concepts/ar/Tool-TaskCreate.md +6 -0
- package/concepts/ar/Tool-TaskGet.md +6 -0
- package/concepts/ar/Tool-TaskList.md +6 -0
- package/concepts/ar/Tool-TaskUpdate.md +6 -0
- package/concepts/ar/Tool-TodoWrite.md +43 -0
- package/concepts/ar/Tool-ToolSearch.md +5 -0
- package/concepts/ar/Tool-WebSearch.md +6 -0
- package/concepts/ar/Tools.md +26 -4
- package/concepts/da/GlobalSettings.md +2 -2
- package/concepts/da/Tool-Artifact.md +8 -1
- package/concepts/da/Tool-EndConversation.md +35 -0
- package/concepts/da/Tool-LSP.md +6 -1
- package/concepts/da/Tool-ListAgents.md +35 -0
- package/concepts/da/Tool-ListConnectors.md +34 -0
- package/concepts/da/Tool-ListMcpResources.md +35 -0
- package/concepts/da/Tool-ListPlugins.md +35 -0
- package/concepts/da/Tool-ListSkills.md +37 -0
- package/concepts/da/Tool-Monitor.md +7 -0
- package/concepts/da/Tool-Projects.md +46 -0
- package/concepts/da/Tool-ProposeGoal.md +43 -0
- package/concepts/da/Tool-PushNotification.md +6 -0
- package/concepts/da/Tool-REPL.md +47 -0
- package/concepts/da/Tool-ReadMcpResource.md +32 -0
- package/concepts/da/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/da/Tool-ReadNotifications.md +27 -0
- package/concepts/da/Tool-RemoteTrigger.md +7 -0
- package/concepts/da/Tool-ScheduleWakeup.md +5 -0
- package/concepts/da/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/da/Tool-SendFeedback.md +38 -0
- package/concepts/da/Tool-SendFile.md +36 -0
- package/concepts/da/Tool-SendMessage.md +5 -0
- package/concepts/da/Tool-SendUserFile.md +38 -0
- package/concepts/da/Tool-SendUserMessage.md +38 -0
- package/concepts/da/Tool-SuggestConnectors.md +28 -0
- package/concepts/da/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/da/Tool-SuggestSkills.md +33 -0
- package/concepts/da/Tool-TaskCreate.md +6 -0
- package/concepts/da/Tool-TaskGet.md +6 -0
- package/concepts/da/Tool-TaskList.md +6 -0
- package/concepts/da/Tool-TaskUpdate.md +6 -0
- package/concepts/da/Tool-TodoWrite.md +43 -0
- package/concepts/da/Tool-ToolSearch.md +5 -0
- package/concepts/da/Tool-WebSearch.md +6 -0
- package/concepts/da/Tools.md +26 -4
- package/concepts/de/GlobalSettings.md +2 -2
- package/concepts/de/Tool-Artifact.md +7 -0
- package/concepts/de/Tool-EndConversation.md +35 -0
- package/concepts/de/Tool-LSP.md +6 -1
- package/concepts/de/Tool-ListAgents.md +35 -0
- package/concepts/de/Tool-ListConnectors.md +34 -0
- package/concepts/de/Tool-ListMcpResources.md +35 -0
- package/concepts/de/Tool-ListPlugins.md +35 -0
- package/concepts/de/Tool-ListSkills.md +37 -0
- package/concepts/de/Tool-Monitor.md +7 -0
- package/concepts/de/Tool-Projects.md +46 -0
- package/concepts/de/Tool-ProposeGoal.md +43 -0
- package/concepts/de/Tool-PushNotification.md +6 -0
- package/concepts/de/Tool-REPL.md +47 -0
- package/concepts/de/Tool-ReadMcpResource.md +32 -0
- package/concepts/de/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/de/Tool-ReadNotifications.md +27 -0
- package/concepts/de/Tool-RemoteTrigger.md +7 -0
- package/concepts/de/Tool-ScheduleWakeup.md +5 -0
- package/concepts/de/Tool-SearchMcpRegistry.md +30 -0
- package/concepts/de/Tool-SendFeedback.md +38 -0
- package/concepts/de/Tool-SendFile.md +36 -0
- package/concepts/de/Tool-SendMessage.md +5 -0
- package/concepts/de/Tool-SendUserFile.md +38 -0
- package/concepts/de/Tool-SendUserMessage.md +38 -0
- package/concepts/de/Tool-SuggestConnectors.md +28 -0
- package/concepts/de/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/de/Tool-SuggestSkills.md +33 -0
- package/concepts/de/Tool-TaskCreate.md +6 -0
- package/concepts/de/Tool-TaskGet.md +6 -0
- package/concepts/de/Tool-TaskList.md +6 -0
- package/concepts/de/Tool-TaskUpdate.md +6 -0
- package/concepts/de/Tool-TodoWrite.md +43 -0
- package/concepts/de/Tool-ToolSearch.md +5 -0
- package/concepts/de/Tool-WebSearch.md +6 -0
- package/concepts/de/Tools.md +26 -4
- package/concepts/en/GlobalSettings.md +2 -2
- package/concepts/en/Tool-Artifact.md +7 -0
- package/concepts/en/Tool-EndConversation.md +35 -0
- package/concepts/en/Tool-LSP.md +5 -0
- package/concepts/en/Tool-ListAgents.md +35 -0
- package/concepts/en/Tool-ListConnectors.md +34 -0
- package/concepts/en/Tool-ListMcpResources.md +35 -0
- package/concepts/en/Tool-ListPlugins.md +35 -0
- package/concepts/en/Tool-ListSkills.md +37 -0
- package/concepts/en/Tool-Monitor.md +7 -0
- package/concepts/en/Tool-Projects.md +46 -0
- package/concepts/en/Tool-ProposeGoal.md +43 -0
- package/concepts/en/Tool-PushNotification.md +6 -0
- package/concepts/en/Tool-REPL.md +47 -0
- package/concepts/en/Tool-ReadMcpResource.md +32 -0
- package/concepts/en/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/en/Tool-ReadNotifications.md +27 -0
- package/concepts/en/Tool-RemoteTrigger.md +7 -0
- package/concepts/en/Tool-ScheduleWakeup.md +5 -0
- package/concepts/en/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/en/Tool-SendFeedback.md +38 -0
- package/concepts/en/Tool-SendFile.md +36 -0
- package/concepts/en/Tool-SendMessage.md +5 -0
- package/concepts/en/Tool-SendUserFile.md +38 -0
- package/concepts/en/Tool-SendUserMessage.md +38 -0
- package/concepts/en/Tool-SuggestConnectors.md +28 -0
- package/concepts/en/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/en/Tool-SuggestSkills.md +33 -0
- package/concepts/en/Tool-TaskCreate.md +6 -0
- package/concepts/en/Tool-TaskGet.md +6 -0
- package/concepts/en/Tool-TaskList.md +6 -0
- package/concepts/en/Tool-TaskUpdate.md +6 -0
- package/concepts/en/Tool-TodoWrite.md +43 -0
- package/concepts/en/Tool-ToolSearch.md +5 -0
- package/concepts/en/Tool-WebSearch.md +6 -0
- package/concepts/en/Tools.md +26 -4
- package/concepts/es/GlobalSettings.md +2 -2
- package/concepts/es/Tool-Artifact.md +7 -0
- package/concepts/es/Tool-EndConversation.md +35 -0
- package/concepts/es/Tool-LSP.md +5 -0
- package/concepts/es/Tool-ListAgents.md +35 -0
- package/concepts/es/Tool-ListConnectors.md +34 -0
- package/concepts/es/Tool-ListMcpResources.md +35 -0
- package/concepts/es/Tool-ListPlugins.md +35 -0
- package/concepts/es/Tool-ListSkills.md +37 -0
- package/concepts/es/Tool-Monitor.md +7 -0
- package/concepts/es/Tool-Projects.md +46 -0
- package/concepts/es/Tool-ProposeGoal.md +43 -0
- package/concepts/es/Tool-PushNotification.md +6 -0
- package/concepts/es/Tool-REPL.md +47 -0
- package/concepts/es/Tool-ReadMcpResource.md +32 -0
- package/concepts/es/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/es/Tool-ReadNotifications.md +27 -0
- package/concepts/es/Tool-RemoteTrigger.md +7 -0
- package/concepts/es/Tool-ScheduleWakeup.md +5 -0
- package/concepts/es/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/es/Tool-SendFeedback.md +38 -0
- package/concepts/es/Tool-SendFile.md +36 -0
- package/concepts/es/Tool-SendMessage.md +5 -0
- package/concepts/es/Tool-SendUserFile.md +38 -0
- package/concepts/es/Tool-SendUserMessage.md +38 -0
- package/concepts/es/Tool-SuggestConnectors.md +28 -0
- package/concepts/es/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/es/Tool-SuggestSkills.md +33 -0
- package/concepts/es/Tool-TaskCreate.md +6 -0
- package/concepts/es/Tool-TaskGet.md +6 -0
- package/concepts/es/Tool-TaskList.md +6 -0
- package/concepts/es/Tool-TaskUpdate.md +6 -0
- package/concepts/es/Tool-TodoWrite.md +43 -0
- package/concepts/es/Tool-ToolSearch.md +5 -0
- package/concepts/es/Tool-WebSearch.md +6 -0
- package/concepts/es/Tools.md +26 -4
- package/concepts/fr/GlobalSettings.md +2 -2
- package/concepts/fr/Tool-Artifact.md +7 -0
- package/concepts/fr/Tool-EndConversation.md +35 -0
- package/concepts/fr/Tool-LSP.md +5 -0
- package/concepts/fr/Tool-ListAgents.md +35 -0
- package/concepts/fr/Tool-ListConnectors.md +34 -0
- package/concepts/fr/Tool-ListMcpResources.md +35 -0
- package/concepts/fr/Tool-ListPlugins.md +35 -0
- package/concepts/fr/Tool-ListSkills.md +37 -0
- package/concepts/fr/Tool-Monitor.md +7 -0
- package/concepts/fr/Tool-Projects.md +46 -0
- package/concepts/fr/Tool-ProposeGoal.md +43 -0
- package/concepts/fr/Tool-PushNotification.md +6 -0
- package/concepts/fr/Tool-REPL.md +47 -0
- package/concepts/fr/Tool-ReadMcpResource.md +32 -0
- package/concepts/fr/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/fr/Tool-ReadNotifications.md +27 -0
- package/concepts/fr/Tool-RemoteTrigger.md +7 -0
- package/concepts/fr/Tool-ScheduleWakeup.md +5 -0
- package/concepts/fr/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/fr/Tool-SendFeedback.md +38 -0
- package/concepts/fr/Tool-SendFile.md +36 -0
- package/concepts/fr/Tool-SendMessage.md +5 -0
- package/concepts/fr/Tool-SendUserFile.md +38 -0
- package/concepts/fr/Tool-SendUserMessage.md +38 -0
- package/concepts/fr/Tool-SuggestConnectors.md +28 -0
- package/concepts/fr/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/fr/Tool-SuggestSkills.md +33 -0
- package/concepts/fr/Tool-TaskCreate.md +6 -0
- package/concepts/fr/Tool-TaskGet.md +6 -0
- package/concepts/fr/Tool-TaskList.md +6 -0
- package/concepts/fr/Tool-TaskUpdate.md +6 -0
- package/concepts/fr/Tool-TodoWrite.md +43 -0
- package/concepts/fr/Tool-ToolSearch.md +5 -0
- package/concepts/fr/Tool-WebSearch.md +6 -0
- package/concepts/fr/Tools.md +26 -4
- package/concepts/it/GlobalSettings.md +2 -2
- package/concepts/it/Tool-Artifact.md +7 -0
- package/concepts/it/Tool-EndConversation.md +35 -0
- package/concepts/it/Tool-LSP.md +5 -0
- package/concepts/it/Tool-ListAgents.md +35 -0
- package/concepts/it/Tool-ListConnectors.md +34 -0
- package/concepts/it/Tool-ListMcpResources.md +35 -0
- package/concepts/it/Tool-ListPlugins.md +35 -0
- package/concepts/it/Tool-ListSkills.md +37 -0
- package/concepts/it/Tool-Monitor.md +7 -0
- package/concepts/it/Tool-Projects.md +46 -0
- package/concepts/it/Tool-ProposeGoal.md +43 -0
- package/concepts/it/Tool-PushNotification.md +6 -0
- package/concepts/it/Tool-REPL.md +47 -0
- package/concepts/it/Tool-ReadMcpResource.md +32 -0
- package/concepts/it/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/it/Tool-ReadNotifications.md +27 -0
- package/concepts/it/Tool-RemoteTrigger.md +7 -0
- package/concepts/it/Tool-ScheduleWakeup.md +5 -0
- package/concepts/it/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/it/Tool-SendFeedback.md +38 -0
- package/concepts/it/Tool-SendFile.md +36 -0
- package/concepts/it/Tool-SendMessage.md +5 -0
- package/concepts/it/Tool-SendUserFile.md +38 -0
- package/concepts/it/Tool-SendUserMessage.md +38 -0
- package/concepts/it/Tool-SuggestConnectors.md +28 -0
- package/concepts/it/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/it/Tool-SuggestSkills.md +33 -0
- package/concepts/it/Tool-TaskCreate.md +6 -0
- package/concepts/it/Tool-TaskGet.md +6 -0
- package/concepts/it/Tool-TaskList.md +6 -0
- package/concepts/it/Tool-TaskUpdate.md +6 -0
- package/concepts/it/Tool-TodoWrite.md +43 -0
- package/concepts/it/Tool-ToolSearch.md +5 -0
- package/concepts/it/Tool-WebSearch.md +6 -0
- package/concepts/it/Tools.md +26 -4
- package/concepts/ja/GlobalSettings.md +2 -2
- package/concepts/ja/Tool-Artifact.md +7 -0
- package/concepts/ja/Tool-EndConversation.md +35 -0
- package/concepts/ja/Tool-LSP.md +5 -0
- package/concepts/ja/Tool-ListAgents.md +35 -0
- package/concepts/ja/Tool-ListConnectors.md +34 -0
- package/concepts/ja/Tool-ListMcpResources.md +35 -0
- package/concepts/ja/Tool-ListPlugins.md +35 -0
- package/concepts/ja/Tool-ListSkills.md +37 -0
- package/concepts/ja/Tool-Monitor.md +7 -0
- package/concepts/ja/Tool-Projects.md +46 -0
- package/concepts/ja/Tool-ProposeGoal.md +43 -0
- package/concepts/ja/Tool-PushNotification.md +6 -0
- package/concepts/ja/Tool-REPL.md +47 -0
- package/concepts/ja/Tool-ReadMcpResource.md +32 -0
- package/concepts/ja/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/ja/Tool-ReadNotifications.md +27 -0
- package/concepts/ja/Tool-RemoteTrigger.md +7 -0
- package/concepts/ja/Tool-ScheduleWakeup.md +5 -0
- package/concepts/ja/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/ja/Tool-SendFeedback.md +38 -0
- package/concepts/ja/Tool-SendFile.md +36 -0
- package/concepts/ja/Tool-SendMessage.md +5 -0
- package/concepts/ja/Tool-SendUserFile.md +38 -0
- package/concepts/ja/Tool-SendUserMessage.md +38 -0
- package/concepts/ja/Tool-SuggestConnectors.md +28 -0
- package/concepts/ja/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/ja/Tool-SuggestSkills.md +33 -0
- package/concepts/ja/Tool-TaskCreate.md +6 -0
- package/concepts/ja/Tool-TaskGet.md +6 -0
- package/concepts/ja/Tool-TaskList.md +6 -0
- package/concepts/ja/Tool-TaskUpdate.md +6 -0
- package/concepts/ja/Tool-TodoWrite.md +43 -0
- package/concepts/ja/Tool-ToolSearch.md +5 -0
- package/concepts/ja/Tool-WebSearch.md +6 -0
- package/concepts/ja/Tools.md +26 -4
- package/concepts/ko/GlobalSettings.md +2 -2
- package/concepts/ko/Tool-Artifact.md +7 -0
- package/concepts/ko/Tool-EndConversation.md +35 -0
- package/concepts/ko/Tool-LSP.md +5 -0
- package/concepts/ko/Tool-ListAgents.md +35 -0
- package/concepts/ko/Tool-ListConnectors.md +34 -0
- package/concepts/ko/Tool-ListMcpResources.md +35 -0
- package/concepts/ko/Tool-ListPlugins.md +35 -0
- package/concepts/ko/Tool-ListSkills.md +37 -0
- package/concepts/ko/Tool-Monitor.md +7 -0
- package/concepts/ko/Tool-Projects.md +46 -0
- package/concepts/ko/Tool-ProposeGoal.md +43 -0
- package/concepts/ko/Tool-PushNotification.md +6 -0
- package/concepts/ko/Tool-REPL.md +47 -0
- package/concepts/ko/Tool-ReadMcpResource.md +32 -0
- package/concepts/ko/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/ko/Tool-ReadNotifications.md +27 -0
- package/concepts/ko/Tool-RemoteTrigger.md +7 -0
- package/concepts/ko/Tool-ScheduleWakeup.md +5 -0
- package/concepts/ko/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/ko/Tool-SendFeedback.md +38 -0
- package/concepts/ko/Tool-SendFile.md +36 -0
- package/concepts/ko/Tool-SendMessage.md +5 -0
- package/concepts/ko/Tool-SendUserFile.md +38 -0
- package/concepts/ko/Tool-SendUserMessage.md +38 -0
- package/concepts/ko/Tool-SuggestConnectors.md +28 -0
- package/concepts/ko/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/ko/Tool-SuggestSkills.md +33 -0
- package/concepts/ko/Tool-TaskCreate.md +6 -0
- package/concepts/ko/Tool-TaskGet.md +6 -0
- package/concepts/ko/Tool-TaskList.md +6 -0
- package/concepts/ko/Tool-TaskUpdate.md +6 -0
- package/concepts/ko/Tool-TodoWrite.md +43 -0
- package/concepts/ko/Tool-ToolSearch.md +5 -0
- package/concepts/ko/Tool-WebSearch.md +6 -0
- package/concepts/ko/Tools.md +26 -4
- package/concepts/no/GlobalSettings.md +2 -2
- package/concepts/no/Tool-Artifact.md +7 -0
- package/concepts/no/Tool-EndConversation.md +35 -0
- package/concepts/no/Tool-LSP.md +7 -2
- package/concepts/no/Tool-ListAgents.md +35 -0
- package/concepts/no/Tool-ListConnectors.md +34 -0
- package/concepts/no/Tool-ListMcpResources.md +35 -0
- package/concepts/no/Tool-ListPlugins.md +35 -0
- package/concepts/no/Tool-ListSkills.md +37 -0
- package/concepts/no/Tool-Monitor.md +7 -0
- package/concepts/no/Tool-Projects.md +46 -0
- package/concepts/no/Tool-ProposeGoal.md +43 -0
- package/concepts/no/Tool-PushNotification.md +6 -0
- package/concepts/no/Tool-REPL.md +47 -0
- package/concepts/no/Tool-ReadMcpResource.md +32 -0
- package/concepts/no/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/no/Tool-ReadNotifications.md +27 -0
- package/concepts/no/Tool-RemoteTrigger.md +7 -0
- package/concepts/no/Tool-ScheduleWakeup.md +5 -0
- package/concepts/no/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/no/Tool-SendFeedback.md +38 -0
- package/concepts/no/Tool-SendFile.md +36 -0
- package/concepts/no/Tool-SendMessage.md +5 -0
- package/concepts/no/Tool-SendUserFile.md +38 -0
- package/concepts/no/Tool-SendUserMessage.md +38 -0
- package/concepts/no/Tool-SuggestConnectors.md +28 -0
- package/concepts/no/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/no/Tool-SuggestSkills.md +33 -0
- package/concepts/no/Tool-TaskCreate.md +6 -0
- package/concepts/no/Tool-TaskGet.md +6 -0
- package/concepts/no/Tool-TaskList.md +6 -0
- package/concepts/no/Tool-TaskUpdate.md +6 -0
- package/concepts/no/Tool-TodoWrite.md +43 -0
- package/concepts/no/Tool-ToolSearch.md +5 -0
- package/concepts/no/Tool-WebSearch.md +6 -0
- package/concepts/no/Tools.md +26 -4
- package/concepts/pl/GlobalSettings.md +2 -2
- package/concepts/pl/Tool-Artifact.md +7 -0
- package/concepts/pl/Tool-EndConversation.md +35 -0
- package/concepts/pl/Tool-LSP.md +5 -0
- package/concepts/pl/Tool-ListAgents.md +35 -0
- package/concepts/pl/Tool-ListConnectors.md +34 -0
- package/concepts/pl/Tool-ListMcpResources.md +35 -0
- package/concepts/pl/Tool-ListPlugins.md +35 -0
- package/concepts/pl/Tool-ListSkills.md +37 -0
- package/concepts/pl/Tool-Monitor.md +7 -0
- package/concepts/pl/Tool-Projects.md +46 -0
- package/concepts/pl/Tool-ProposeGoal.md +43 -0
- package/concepts/pl/Tool-PushNotification.md +6 -0
- package/concepts/pl/Tool-REPL.md +47 -0
- package/concepts/pl/Tool-ReadMcpResource.md +32 -0
- package/concepts/pl/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/pl/Tool-ReadNotifications.md +27 -0
- package/concepts/pl/Tool-RemoteTrigger.md +7 -0
- package/concepts/pl/Tool-ScheduleWakeup.md +5 -0
- package/concepts/pl/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/pl/Tool-SendFeedback.md +38 -0
- package/concepts/pl/Tool-SendFile.md +36 -0
- package/concepts/pl/Tool-SendMessage.md +5 -0
- package/concepts/pl/Tool-SendUserFile.md +38 -0
- package/concepts/pl/Tool-SendUserMessage.md +38 -0
- package/concepts/pl/Tool-SuggestConnectors.md +28 -0
- package/concepts/pl/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/pl/Tool-SuggestSkills.md +33 -0
- package/concepts/pl/Tool-TaskCreate.md +6 -0
- package/concepts/pl/Tool-TaskGet.md +6 -0
- package/concepts/pl/Tool-TaskList.md +6 -0
- package/concepts/pl/Tool-TaskUpdate.md +6 -0
- package/concepts/pl/Tool-TodoWrite.md +43 -0
- package/concepts/pl/Tool-ToolSearch.md +5 -0
- package/concepts/pl/Tool-WebSearch.md +6 -0
- package/concepts/pl/Tools.md +26 -4
- package/concepts/pt-BR/GlobalSettings.md +2 -2
- package/concepts/pt-BR/Tool-Artifact.md +7 -0
- package/concepts/pt-BR/Tool-EndConversation.md +35 -0
- package/concepts/pt-BR/Tool-LSP.md +5 -0
- package/concepts/pt-BR/Tool-ListAgents.md +35 -0
- package/concepts/pt-BR/Tool-ListConnectors.md +34 -0
- package/concepts/pt-BR/Tool-ListMcpResources.md +35 -0
- package/concepts/pt-BR/Tool-ListPlugins.md +35 -0
- package/concepts/pt-BR/Tool-ListSkills.md +37 -0
- package/concepts/pt-BR/Tool-Monitor.md +7 -0
- package/concepts/pt-BR/Tool-Projects.md +46 -0
- package/concepts/pt-BR/Tool-ProposeGoal.md +43 -0
- package/concepts/pt-BR/Tool-PushNotification.md +6 -0
- package/concepts/pt-BR/Tool-REPL.md +47 -0
- package/concepts/pt-BR/Tool-ReadMcpResource.md +32 -0
- package/concepts/pt-BR/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/pt-BR/Tool-ReadNotifications.md +27 -0
- package/concepts/pt-BR/Tool-RemoteTrigger.md +7 -0
- package/concepts/pt-BR/Tool-ScheduleWakeup.md +5 -0
- package/concepts/pt-BR/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/pt-BR/Tool-SendFeedback.md +38 -0
- package/concepts/pt-BR/Tool-SendFile.md +36 -0
- package/concepts/pt-BR/Tool-SendMessage.md +5 -0
- package/concepts/pt-BR/Tool-SendUserFile.md +38 -0
- package/concepts/pt-BR/Tool-SendUserMessage.md +38 -0
- package/concepts/pt-BR/Tool-SuggestConnectors.md +28 -0
- package/concepts/pt-BR/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/pt-BR/Tool-SuggestSkills.md +33 -0
- package/concepts/pt-BR/Tool-TaskCreate.md +6 -0
- package/concepts/pt-BR/Tool-TaskGet.md +6 -0
- package/concepts/pt-BR/Tool-TaskList.md +6 -0
- package/concepts/pt-BR/Tool-TaskUpdate.md +6 -0
- package/concepts/pt-BR/Tool-TodoWrite.md +43 -0
- package/concepts/pt-BR/Tool-ToolSearch.md +5 -0
- package/concepts/pt-BR/Tool-WebSearch.md +6 -0
- package/concepts/pt-BR/Tools.md +26 -4
- package/concepts/ru/GlobalSettings.md +2 -2
- package/concepts/ru/Tool-Artifact.md +7 -0
- package/concepts/ru/Tool-EndConversation.md +35 -0
- package/concepts/ru/Tool-LSP.md +5 -0
- package/concepts/ru/Tool-ListAgents.md +35 -0
- package/concepts/ru/Tool-ListConnectors.md +34 -0
- package/concepts/ru/Tool-ListMcpResources.md +35 -0
- package/concepts/ru/Tool-ListPlugins.md +35 -0
- package/concepts/ru/Tool-ListSkills.md +37 -0
- package/concepts/ru/Tool-Monitor.md +7 -0
- package/concepts/ru/Tool-Projects.md +46 -0
- package/concepts/ru/Tool-ProposeGoal.md +43 -0
- package/concepts/ru/Tool-PushNotification.md +6 -0
- package/concepts/ru/Tool-REPL.md +47 -0
- package/concepts/ru/Tool-ReadMcpResource.md +32 -0
- package/concepts/ru/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/ru/Tool-ReadNotifications.md +27 -0
- package/concepts/ru/Tool-RemoteTrigger.md +7 -0
- package/concepts/ru/Tool-ScheduleWakeup.md +5 -0
- package/concepts/ru/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/ru/Tool-SendFeedback.md +38 -0
- package/concepts/ru/Tool-SendFile.md +36 -0
- package/concepts/ru/Tool-SendMessage.md +5 -0
- package/concepts/ru/Tool-SendUserFile.md +38 -0
- package/concepts/ru/Tool-SendUserMessage.md +38 -0
- package/concepts/ru/Tool-SuggestConnectors.md +28 -0
- package/concepts/ru/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/ru/Tool-SuggestSkills.md +33 -0
- package/concepts/ru/Tool-TaskCreate.md +6 -0
- package/concepts/ru/Tool-TaskGet.md +6 -0
- package/concepts/ru/Tool-TaskList.md +6 -0
- package/concepts/ru/Tool-TaskUpdate.md +6 -0
- package/concepts/ru/Tool-TodoWrite.md +43 -0
- package/concepts/ru/Tool-ToolSearch.md +5 -0
- package/concepts/ru/Tool-WebSearch.md +6 -0
- package/concepts/ru/Tools.md +26 -4
- package/concepts/th/GlobalSettings.md +2 -2
- package/concepts/th/Tool-Artifact.md +7 -0
- package/concepts/th/Tool-EndConversation.md +35 -0
- package/concepts/th/Tool-LSP.md +5 -0
- package/concepts/th/Tool-ListAgents.md +35 -0
- package/concepts/th/Tool-ListConnectors.md +34 -0
- package/concepts/th/Tool-ListMcpResources.md +35 -0
- package/concepts/th/Tool-ListPlugins.md +35 -0
- package/concepts/th/Tool-ListSkills.md +37 -0
- package/concepts/th/Tool-Monitor.md +7 -0
- package/concepts/th/Tool-Projects.md +46 -0
- package/concepts/th/Tool-ProposeGoal.md +43 -0
- package/concepts/th/Tool-PushNotification.md +6 -0
- package/concepts/th/Tool-REPL.md +47 -0
- package/concepts/th/Tool-ReadMcpResource.md +32 -0
- package/concepts/th/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/th/Tool-ReadNotifications.md +27 -0
- package/concepts/th/Tool-RemoteTrigger.md +7 -0
- package/concepts/th/Tool-ScheduleWakeup.md +5 -0
- package/concepts/th/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/th/Tool-SendFeedback.md +38 -0
- package/concepts/th/Tool-SendFile.md +36 -0
- package/concepts/th/Tool-SendMessage.md +5 -0
- package/concepts/th/Tool-SendUserFile.md +38 -0
- package/concepts/th/Tool-SendUserMessage.md +38 -0
- package/concepts/th/Tool-SuggestConnectors.md +28 -0
- package/concepts/th/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/th/Tool-SuggestSkills.md +33 -0
- package/concepts/th/Tool-TaskCreate.md +6 -0
- package/concepts/th/Tool-TaskGet.md +6 -0
- package/concepts/th/Tool-TaskList.md +6 -0
- package/concepts/th/Tool-TaskUpdate.md +6 -0
- package/concepts/th/Tool-TodoWrite.md +43 -0
- package/concepts/th/Tool-ToolSearch.md +5 -0
- package/concepts/th/Tool-WebSearch.md +13 -7
- package/concepts/th/Tools.md +26 -4
- package/concepts/tr/GlobalSettings.md +2 -2
- package/concepts/tr/Tool-Artifact.md +7 -0
- package/concepts/tr/Tool-EndConversation.md +35 -0
- package/concepts/tr/Tool-LSP.md +5 -0
- package/concepts/tr/Tool-ListAgents.md +35 -0
- package/concepts/tr/Tool-ListConnectors.md +34 -0
- package/concepts/tr/Tool-ListMcpResources.md +35 -0
- package/concepts/tr/Tool-ListPlugins.md +35 -0
- package/concepts/tr/Tool-ListSkills.md +37 -0
- package/concepts/tr/Tool-Monitor.md +7 -0
- package/concepts/tr/Tool-Projects.md +46 -0
- package/concepts/tr/Tool-ProposeGoal.md +43 -0
- package/concepts/tr/Tool-PushNotification.md +6 -0
- package/concepts/tr/Tool-REPL.md +47 -0
- package/concepts/tr/Tool-ReadMcpResource.md +32 -0
- package/concepts/tr/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/tr/Tool-ReadNotifications.md +27 -0
- package/concepts/tr/Tool-RemoteTrigger.md +7 -0
- package/concepts/tr/Tool-ScheduleWakeup.md +5 -0
- package/concepts/tr/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/tr/Tool-SendFeedback.md +38 -0
- package/concepts/tr/Tool-SendFile.md +36 -0
- package/concepts/tr/Tool-SendMessage.md +5 -0
- package/concepts/tr/Tool-SendUserFile.md +38 -0
- package/concepts/tr/Tool-SendUserMessage.md +38 -0
- package/concepts/tr/Tool-SuggestConnectors.md +28 -0
- package/concepts/tr/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/tr/Tool-SuggestSkills.md +33 -0
- package/concepts/tr/Tool-TaskCreate.md +6 -0
- package/concepts/tr/Tool-TaskGet.md +6 -0
- package/concepts/tr/Tool-TaskList.md +6 -0
- package/concepts/tr/Tool-TaskUpdate.md +6 -0
- package/concepts/tr/Tool-TodoWrite.md +43 -0
- package/concepts/tr/Tool-ToolSearch.md +5 -0
- package/concepts/tr/Tool-WebSearch.md +6 -0
- package/concepts/tr/Tools.md +26 -4
- package/concepts/uk/GlobalSettings.md +2 -2
- package/concepts/uk/Tool-Artifact.md +7 -0
- package/concepts/uk/Tool-EndConversation.md +35 -0
- package/concepts/uk/Tool-LSP.md +5 -0
- package/concepts/uk/Tool-ListAgents.md +35 -0
- package/concepts/uk/Tool-ListConnectors.md +34 -0
- package/concepts/uk/Tool-ListMcpResources.md +35 -0
- package/concepts/uk/Tool-ListPlugins.md +35 -0
- package/concepts/uk/Tool-ListSkills.md +37 -0
- package/concepts/uk/Tool-Monitor.md +7 -0
- package/concepts/uk/Tool-Projects.md +46 -0
- package/concepts/uk/Tool-ProposeGoal.md +43 -0
- package/concepts/uk/Tool-PushNotification.md +6 -0
- package/concepts/uk/Tool-REPL.md +47 -0
- package/concepts/uk/Tool-ReadMcpResource.md +32 -0
- package/concepts/uk/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/uk/Tool-ReadNotifications.md +27 -0
- package/concepts/uk/Tool-RemoteTrigger.md +7 -0
- package/concepts/uk/Tool-ScheduleWakeup.md +5 -0
- package/concepts/uk/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/uk/Tool-SendFeedback.md +38 -0
- package/concepts/uk/Tool-SendFile.md +36 -0
- package/concepts/uk/Tool-SendMessage.md +5 -0
- package/concepts/uk/Tool-SendUserFile.md +38 -0
- package/concepts/uk/Tool-SendUserMessage.md +38 -0
- package/concepts/uk/Tool-SuggestConnectors.md +28 -0
- package/concepts/uk/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/uk/Tool-SuggestSkills.md +33 -0
- package/concepts/uk/Tool-TaskCreate.md +6 -0
- package/concepts/uk/Tool-TaskGet.md +6 -0
- package/concepts/uk/Tool-TaskList.md +6 -0
- package/concepts/uk/Tool-TaskUpdate.md +6 -0
- package/concepts/uk/Tool-TodoWrite.md +43 -0
- package/concepts/uk/Tool-ToolSearch.md +5 -0
- package/concepts/uk/Tool-WebSearch.md +6 -0
- package/concepts/uk/Tools.md +26 -4
- package/concepts/zh/GlobalSettings.md +2 -2
- package/concepts/zh/Tool-Artifact.md +7 -0
- package/concepts/zh/Tool-EndConversation.md +35 -0
- package/concepts/zh/Tool-LSP.md +5 -0
- package/concepts/zh/Tool-ListAgents.md +35 -0
- package/concepts/zh/Tool-ListConnectors.md +34 -0
- package/concepts/zh/Tool-ListMcpResources.md +35 -0
- package/concepts/zh/Tool-ListPlugins.md +35 -0
- package/concepts/zh/Tool-ListSkills.md +37 -0
- package/concepts/zh/Tool-Monitor.md +7 -0
- package/concepts/zh/Tool-Projects.md +46 -0
- package/concepts/zh/Tool-ProposeGoal.md +43 -0
- package/concepts/zh/Tool-PushNotification.md +6 -0
- package/concepts/zh/Tool-REPL.md +47 -0
- package/concepts/zh/Tool-ReadMcpResource.md +32 -0
- package/concepts/zh/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/zh/Tool-ReadNotifications.md +27 -0
- package/concepts/zh/Tool-RemoteTrigger.md +7 -0
- package/concepts/zh/Tool-ScheduleWakeup.md +5 -0
- package/concepts/zh/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/zh/Tool-SendFeedback.md +38 -0
- package/concepts/zh/Tool-SendFile.md +36 -0
- package/concepts/zh/Tool-SendMessage.md +5 -0
- package/concepts/zh/Tool-SendUserFile.md +38 -0
- package/concepts/zh/Tool-SendUserMessage.md +38 -0
- package/concepts/zh/Tool-SuggestConnectors.md +28 -0
- package/concepts/zh/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/zh/Tool-SuggestSkills.md +33 -0
- package/concepts/zh/Tool-TaskCreate.md +6 -0
- package/concepts/zh/Tool-TaskGet.md +6 -0
- package/concepts/zh/Tool-TaskList.md +6 -0
- package/concepts/zh/Tool-TaskUpdate.md +6 -0
- package/concepts/zh/Tool-TodoWrite.md +43 -0
- package/concepts/zh/Tool-ToolSearch.md +5 -0
- package/concepts/zh/Tool-WebSearch.md +6 -0
- package/concepts/zh/Tools.md +26 -4
- package/concepts/zh-TW/GlobalSettings.md +2 -2
- package/concepts/zh-TW/Tool-Artifact.md +7 -0
- package/concepts/zh-TW/Tool-EndConversation.md +35 -0
- package/concepts/zh-TW/Tool-LSP.md +5 -0
- package/concepts/zh-TW/Tool-ListAgents.md +35 -0
- package/concepts/zh-TW/Tool-ListConnectors.md +34 -0
- package/concepts/zh-TW/Tool-ListMcpResources.md +35 -0
- package/concepts/zh-TW/Tool-ListPlugins.md +35 -0
- package/concepts/zh-TW/Tool-ListSkills.md +37 -0
- package/concepts/zh-TW/Tool-Monitor.md +7 -0
- package/concepts/zh-TW/Tool-Projects.md +46 -0
- package/concepts/zh-TW/Tool-ProposeGoal.md +43 -0
- package/concepts/zh-TW/Tool-PushNotification.md +6 -0
- package/concepts/zh-TW/Tool-REPL.md +47 -0
- package/concepts/zh-TW/Tool-ReadMcpResource.md +32 -0
- package/concepts/zh-TW/Tool-ReadMcpResourceDir.md +32 -0
- package/concepts/zh-TW/Tool-ReadNotifications.md +27 -0
- package/concepts/zh-TW/Tool-RemoteTrigger.md +7 -0
- package/concepts/zh-TW/Tool-ScheduleWakeup.md +5 -0
- package/concepts/zh-TW/Tool-SearchMcpRegistry.md +31 -0
- package/concepts/zh-TW/Tool-SendFeedback.md +38 -0
- package/concepts/zh-TW/Tool-SendFile.md +36 -0
- package/concepts/zh-TW/Tool-SendMessage.md +5 -0
- package/concepts/zh-TW/Tool-SendUserFile.md +38 -0
- package/concepts/zh-TW/Tool-SendUserMessage.md +38 -0
- package/concepts/zh-TW/Tool-SuggestConnectors.md +28 -0
- package/concepts/zh-TW/Tool-SuggestPluginInstall.md +39 -0
- package/concepts/zh-TW/Tool-SuggestSkills.md +33 -0
- package/concepts/zh-TW/Tool-TaskCreate.md +6 -0
- package/concepts/zh-TW/Tool-TaskGet.md +6 -0
- package/concepts/zh-TW/Tool-TaskList.md +6 -0
- package/concepts/zh-TW/Tool-TaskUpdate.md +6 -0
- package/concepts/zh-TW/Tool-TodoWrite.md +43 -0
- package/concepts/zh-TW/Tool-ToolSearch.md +5 -0
- package/concepts/zh-TW/Tool-WebSearch.md +6 -0
- package/concepts/zh-TW/Tools.md +26 -4
- package/dist/assets/{App-BaKGIW0-.js → App-CCu0y2Cq.js} +2 -2
- package/dist/assets/{MdxEditorPanel-DG-UE0PC.js → MdxEditorPanel-BBhgTmDk.js} +1 -1
- package/dist/assets/{Mobile-CQaUYdaf.js → Mobile-vN4lyiaz.js} +1 -1
- package/dist/assets/{ProxyStatsModal-j-Aty9Lu.js → ProxyStatsModal-BOflqr0R.js} +1 -1
- package/dist/assets/index-C3BRHDVF.js +2 -0
- package/dist/assets/seqResourceLoaders-DI0G5nu1.css +41 -0
- package/dist/assets/seqResourceLoaders-DpYqp6SP.js +2 -0
- package/dist/index.html +1 -1
- package/findcc.js +17 -8
- package/node_modules/@ccv/core/package.json +13 -0
- package/{server/lib → node_modules/@ccv/core/src}/approval-modal-prefs.js +1 -1
- package/node_modules/@ccv/core/src/clearCheckpoint.js +7 -0
- package/{src/utils → node_modules/@ccv/core/src}/contentFilter.js +207 -141
- package/{server/lib → node_modules/@ccv/core/src}/context-rules.js +2 -2
- package/{server/lib → node_modules/@ccv/core/src}/delta-reconstructor.js +60 -4
- package/{server/lib → node_modules/@ccv/core/src}/error-report.js +5 -4
- package/{server/lib → node_modules/@ccv/core/src}/session-boundary.js +3 -3
- package/{src/utils → node_modules/@ccv/core/src}/teammateDetector.js +9 -0
- package/{server/lib → node_modules/@ccv/core/src}/tools-xml-formatter.js +3 -3
- package/{server/lib → node_modules/@ccv/core/src}/v2-transcript-normalizer.js +1 -1
- package/{server/lib → node_modules/@ccv/core/src}/voice-pack-events.js +2 -2
- package/package.json +11 -96
- package/server/_paths.js +28 -7
- package/server/i18n.js +60 -0
- package/server/interceptor.js +36 -11
- package/server/lib/adapters/dingtalk-adapter.js +2 -2
- package/server/lib/adapters/discord-adapter.js +2 -2
- package/server/lib/adapters/feishu-adapter.js +2 -2
- package/server/lib/adapters/wecom-adapter.js +2 -2
- package/server/lib/approval-policy.js +29 -0
- package/server/lib/{ask-store.js → ask/ask-store.js} +3 -3
- package/server/lib/{perm-bridge.js → ask/perm-bridge.js} +5 -5
- package/server/lib/chat-queue.js +341 -0
- package/server/lib/cli-inject.js +1 -1
- package/server/lib/context-watcher.js +3 -3
- package/server/lib/create_system_prompt.js +0 -9
- package/server/lib/enrich-plan-input.js +1 -1
- package/server/lib/ensure-hooks.js +2 -2
- package/server/lib/file-access-policy.js +6 -1
- package/server/lib/file-api.js +17 -1
- package/server/lib/{dingtalk-bridge.js → im/dingtalk-bridge.js} +1 -1
- package/server/lib/{im-append-system.js → im/im-append-system.js} +5 -13
- package/server/lib/{im-bridge-core.js → im/im-bridge-core.js} +12 -6
- package/server/lib/{im-config.js → im/im-config.js} +1 -1
- package/server/lib/im/im-deny.js +4 -0
- package/server/lib/{im-lang.js → im/im-lang.js} +1 -1
- package/server/lib/{im-lock.js → im/im-lock.js} +2 -2
- package/server/lib/{im-process-manager.js → im/im-process-manager.js} +1 -1
- package/server/lib/{im-senders.js → im/im-senders.js} +1 -1
- package/server/lib/{im-skills.js → im/im-skills.js} +2 -2
- package/server/lib/interceptor-core.js +8 -5
- package/server/lib/kv-cache-analyzer.js +6 -5
- package/server/lib/launch-config.js +321 -0
- package/server/lib/log-file-utils.js +21 -0
- package/server/lib/log-management.js +6 -17
- package/server/lib/log-stream.js +1 -1
- package/server/lib/log-watcher.js +1 -1
- package/server/lib/model-system-prompts.js +1 -1
- package/server/lib/prefs-store.js +2 -2
- package/server/lib/project-prefs.js +6 -6
- package/server/lib/project-state.js +15 -0
- package/server/lib/{proxy-retry.js → proxy/proxy-retry.js} +2 -2
- package/server/lib/{proxy-stats.js → proxy/proxy-stats.js} +3 -3
- package/server/lib/sdk-adapter.js +6 -74
- package/server/lib/sdk-manager.js +383 -278
- package/server/lib/skills-api.js +1 -1
- package/server/lib/spawn-model-resolver.js +21 -6
- package/server/lib/stats-worker.js +2 -2
- package/server/lib/system-prompt-files.js +11 -10
- package/server/lib/system-prompt-render.js +23 -7
- package/server/lib/system-prompt-snapshots.js +452 -0
- package/server/lib/updater.js +63 -3
- package/server/lib/user-prompt-extract.js +5 -5
- package/server/lib/v2/adapter.js +3 -3
- package/server/lib/v2/conversation-store.js +1 -1
- package/server/lib/v2/convert.js +3 -3
- package/server/lib/v2/jsonl-read.js +1 -1
- package/server/lib/v2/live-feed.js +3 -3
- package/server/lib/v2/meta-rows.js +3 -3
- package/server/lib/v2/replay.js +1 -1
- package/server/lib/v2/session-list.js +1 -1
- package/server/lib/v2/session-owner.js +1 -1
- package/server/lib/v2/v2-writer.js +26 -1
- package/server/lib/v2/verify.js +1 -1
- package/server/lib/voice-pack-manager.js +4 -5
- package/server/lib/wire-compress.js +1 -1
- package/server/proxy.js +5 -5
- package/server/pty-manager.js +282 -184
- package/server/routes/ask-perm.js +1 -1
- package/server/routes/dingtalk.js +3 -3
- package/server/routes/events.js +2 -2
- package/server/routes/im.js +5 -5
- package/server/routes/preferences.js +3 -3
- package/server/routes/workspaces.js +1 -1
- package/server/server.js +207 -58
- package/server/system-prompt-templates/systemPromptModel.md +0 -8
- package/server/system-prompt-templates/systemPromptVariables.ar.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.da.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.de.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.es.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.fr.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.it.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.ja.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.ko.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.no.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.pl.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.pt-BR.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.ru.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.th.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.tr.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.uk.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.zh-TW.md +0 -7
- package/server/system-prompt-templates/systemPromptVariables.zh.md +0 -7
- package/concepts/ar/Tool-TeamCreate.md +0 -53
- package/concepts/ar/Tool-TeamDelete.md +0 -44
- package/concepts/ar/Tool-executeCode.md +0 -47
- package/concepts/ar/Tool-getDiagnostics.md +0 -44
- package/concepts/da/Tool-TeamCreate.md +0 -53
- package/concepts/da/Tool-TeamDelete.md +0 -44
- package/concepts/da/Tool-executeCode.md +0 -47
- package/concepts/da/Tool-getDiagnostics.md +0 -44
- package/concepts/de/Tool-TeamCreate.md +0 -53
- package/concepts/de/Tool-TeamDelete.md +0 -44
- package/concepts/de/Tool-executeCode.md +0 -47
- package/concepts/de/Tool-getDiagnostics.md +0 -44
- package/concepts/en/Tool-TeamCreate.md +0 -53
- package/concepts/en/Tool-TeamDelete.md +0 -44
- package/concepts/en/Tool-executeCode.md +0 -47
- package/concepts/en/Tool-getDiagnostics.md +0 -44
- package/concepts/es/Tool-TeamCreate.md +0 -53
- package/concepts/es/Tool-TeamDelete.md +0 -44
- package/concepts/es/Tool-executeCode.md +0 -47
- package/concepts/es/Tool-getDiagnostics.md +0 -44
- package/concepts/fr/Tool-TeamCreate.md +0 -53
- package/concepts/fr/Tool-TeamDelete.md +0 -44
- package/concepts/fr/Tool-executeCode.md +0 -47
- package/concepts/fr/Tool-getDiagnostics.md +0 -44
- package/concepts/it/Tool-TeamCreate.md +0 -53
- package/concepts/it/Tool-TeamDelete.md +0 -44
- package/concepts/it/Tool-executeCode.md +0 -47
- package/concepts/it/Tool-getDiagnostics.md +0 -44
- package/concepts/ja/Tool-TeamCreate.md +0 -53
- package/concepts/ja/Tool-TeamDelete.md +0 -44
- package/concepts/ja/Tool-executeCode.md +0 -47
- package/concepts/ja/Tool-getDiagnostics.md +0 -44
- package/concepts/ko/Tool-TeamCreate.md +0 -53
- package/concepts/ko/Tool-TeamDelete.md +0 -44
- package/concepts/ko/Tool-executeCode.md +0 -47
- package/concepts/ko/Tool-getDiagnostics.md +0 -44
- package/concepts/no/Tool-TeamCreate.md +0 -53
- package/concepts/no/Tool-TeamDelete.md +0 -44
- package/concepts/no/Tool-executeCode.md +0 -47
- package/concepts/no/Tool-getDiagnostics.md +0 -44
- package/concepts/pl/Tool-TeamCreate.md +0 -53
- package/concepts/pl/Tool-TeamDelete.md +0 -44
- package/concepts/pl/Tool-executeCode.md +0 -47
- package/concepts/pl/Tool-getDiagnostics.md +0 -44
- package/concepts/pt-BR/Tool-TeamCreate.md +0 -53
- package/concepts/pt-BR/Tool-TeamDelete.md +0 -44
- package/concepts/pt-BR/Tool-executeCode.md +0 -47
- package/concepts/pt-BR/Tool-getDiagnostics.md +0 -44
- package/concepts/ru/Tool-TeamCreate.md +0 -53
- package/concepts/ru/Tool-TeamDelete.md +0 -44
- package/concepts/ru/Tool-executeCode.md +0 -47
- package/concepts/ru/Tool-getDiagnostics.md +0 -44
- package/concepts/th/Tool-TeamCreate.md +0 -53
- package/concepts/th/Tool-TeamDelete.md +0 -44
- package/concepts/th/Tool-executeCode.md +0 -41
- package/concepts/th/Tool-getDiagnostics.md +0 -32
- package/concepts/tr/Tool-TeamCreate.md +0 -53
- package/concepts/tr/Tool-TeamDelete.md +0 -44
- package/concepts/tr/Tool-executeCode.md +0 -47
- package/concepts/tr/Tool-getDiagnostics.md +0 -44
- package/concepts/uk/Tool-TeamCreate.md +0 -53
- package/concepts/uk/Tool-TeamDelete.md +0 -44
- package/concepts/uk/Tool-executeCode.md +0 -47
- package/concepts/uk/Tool-getDiagnostics.md +0 -44
- package/concepts/zh/Tool-TeamCreate.md +0 -53
- package/concepts/zh/Tool-TeamDelete.md +0 -44
- package/concepts/zh/Tool-executeCode.md +0 -47
- package/concepts/zh/Tool-getDiagnostics.md +0 -44
- package/concepts/zh-TW/Tool-TeamCreate.md +0 -53
- package/concepts/zh-TW/Tool-TeamDelete.md +0 -44
- package/concepts/zh-TW/Tool-executeCode.md +0 -47
- package/concepts/zh-TW/Tool-getDiagnostics.md +0 -44
- package/dist/assets/index-CyiyzBfV.js +0 -2
- package/dist/assets/seqResourceLoaders-BgD_Rwvc.css +0 -41
- package/dist/assets/seqResourceLoaders-XMiEIVyV.js +0 -2
- package/src/utils/apiUrl.js +0 -26
- package/src/utils/askFallback.js +0 -21
- package/src/utils/askOptionDesc.js +0 -55
- package/src/utils/askPortalMatcher.js +0 -54
- package/src/utils/autoApproveOptions.js +0 -27
- package/src/utils/avatarAnimationPostPass.js +0 -49
- package/src/utils/builtinPresets.js +0 -18
- package/src/utils/clearCheckpoint.js +0 -7
- package/src/utils/commandValidator.js +0 -45
- package/src/utils/contextRaw.js +0 -18
- package/src/utils/contextSidebarNavigation.js +0 -16
- package/src/utils/contextTurns.js +0 -117
- package/src/utils/displayScaleHelper.js +0 -47
- package/src/utils/effectiveModel.js +0 -17
- package/src/utils/entry-slim.js +0 -563
- package/src/utils/entryCache.js +0 -144
- package/src/utils/errorReport.js +0 -6
- package/src/utils/fileExpandedPathsStorage.js +0 -70
- package/src/utils/fileIcons.jsx +0 -36
- package/src/utils/fileOpen.js +0 -37
- package/src/utils/formatters.js +0 -48
- package/src/utils/gitApi.js +0 -50
- package/src/utils/gitTreeBuilder.js +0 -19
- package/src/utils/helpers.js +0 -854
- package/src/utils/identityHeal.js +0 -108
- package/src/utils/imConnState.js +0 -59
- package/src/utils/imOrigin.js +0 -24
- package/src/utils/imTr.js +0 -7
- package/src/utils/imageCompress.js +0 -83
- package/src/utils/imageDownscale.js +0 -28
- package/src/utils/imageResize.js +0 -112
- package/src/utils/ingestPipeline.js +0 -47
- package/src/utils/isProxyMode.js +0 -11
- package/src/utils/lazyWithReload.js +0 -53
- package/src/utils/markdown.js +0 -30
- package/src/utils/markdownIncremental.js +0 -39
- package/src/utils/markdownProfiler.js +0 -113
- package/src/utils/mdExtensionDetect.js +0 -64
- package/src/utils/memoryLinkParser.js +0 -44
- package/src/utils/modalMask.js +0 -15
- package/src/utils/modelSuggestions.js +0 -48
- package/src/utils/monotime.js +0 -6
- package/src/utils/pinnedMenu.js +0 -55
- package/src/utils/presetShortcuts.js +0 -14
- package/src/utils/projectAlias.js +0 -135
- package/src/utils/promptClassifier.js +0 -112
- package/src/utils/promptDetect.js +0 -196
- package/src/utils/promptNav.js +0 -60
- package/src/utils/ptyChunkBuilder.js +0 -251
- package/src/utils/quickMenuHoverIntent.js +0 -35
- package/src/utils/rateLimitParser.js +0 -119
- package/src/utils/readResultPool.js +0 -106
- package/src/utils/refreshCachedItemProp.js +0 -30
- package/src/utils/resizeCalc.js +0 -21
- package/src/utils/resolveLocalized.js +0 -17
- package/src/utils/searchApi.js +0 -47
- package/src/utils/searchReplace.js +0 -51
- package/src/utils/seqResourceLoaders.js +0 -79
- package/src/utils/sessionManager.js +0 -482
- package/src/utils/sessionMerge.js +0 -239
- package/src/utils/skillModalController.js +0 -111
- package/src/utils/skillsParser.js +0 -116
- package/src/utils/slashCommandLabels.js +0 -80
- package/src/utils/splitDragCalc.js +0 -73
- package/src/utils/stickyBottomController.js +0 -643
- package/src/utils/svgSanitize.js +0 -48
- package/src/utils/systemTags.js +0 -47
- package/src/utils/tClaude.js +0 -20
- package/src/utils/teamModalBuilder.js +0 -351
- package/src/utils/teamSessionParser.js +0 -190
- package/src/utils/teammateAvatars.js +0 -194
- package/src/utils/termDiag.js +0 -114
- package/src/utils/terminalClipboard.js +0 -117
- package/src/utils/terminalWriteQueue.js +0 -398
- package/src/utils/thinkingMerge.js +0 -49
- package/src/utils/toolCatalog.js +0 -29
- package/src/utils/toolResultBuilder.js +0 -411
- package/src/utils/toolResultClassifier.js +0 -16
- package/src/utils/toolResultCore.js +0 -194
- package/src/utils/toolsDiff.js +0 -44
- package/src/utils/toolsXmlFormatter.js +0 -3
- package/src/utils/ultraplanController.js +0 -109
- package/src/utils/ultraplanExperts.js +0 -86
- package/src/utils/ultraplanTemplates.js +0 -154
- package/src/utils/userImageRefs.js +0 -49
- package/src/utils/v3Assembler.js +0 -125
- package/src/utils/v3Rows.js +0 -49
- package/src/utils/voicePackPlayer.js +0 -233
- package/src/utils/webSearchGrouping.js +0 -111
- package/src/utils/workflowFormat.js +0 -52
- package/src/utils/workflowRuns.js +0 -118
- package/src/utils/workflowStore.js +0 -94
- /package/{src/utils → node_modules/@ccv/core/src}/requestType.js +0 -0
- /package/server/lib/{ask-bridge.js → ask/ask-bridge.js} +0 -0
- /package/server/lib/{ask-constants.js → ask/ask-constants.js} +0 -0
- /package/server/lib/{ask-reaper.js → ask/ask-reaper.js} +0 -0
- /package/server/lib/{dingtalk-config.js → im/dingtalk-config.js} +0 -0
- /package/server/lib/{im-log-watcher.js → im/im-log-watcher.js} +0 -0
- /package/server/lib/{proxy-env.js → proxy/proxy-env.js} +0 -0
- /package/server/lib/{proxy-errors.js → proxy/proxy-errors.js} +0 -0
|
@@ -1,411 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Incremental tool result state builder.
|
|
3
|
-
* Processes assistant tool_use and user tool_result blocks into lookup maps.
|
|
4
|
-
*
|
|
5
|
-
* NOTE: server_tool_use(如 Anthropic 的 web_search)和 web_search_tool_result 不入此 map,
|
|
6
|
-
* 它们由 ChatMessage.renderAssistantContent 直接从 assistant content 数组渲染。
|
|
7
|
-
* 详见 src/utils/webSearchGrouping.js 与 src/components/viewers/WebSearchResultsView.jsx。
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { t } from '../i18n';
|
|
11
|
-
import { buildSingleToolResultCore } from './toolResultCore.js';
|
|
12
|
-
|
|
13
|
-
// --- WeakMap cache for tool result state ---
|
|
14
|
-
|
|
15
|
-
const _toolResultCache = new WeakMap();
|
|
16
|
-
|
|
17
|
-
// 稳定引用,避免 `req.body?.messages || []` 每次构造新 `[]` 字面量打穿 WeakMap 缓存
|
|
18
|
-
// (subAgentEntries 扫描在每次 requests-change 时跑,缓存命中是热路径性能假设)。
|
|
19
|
-
const EMPTY_MESSAGES = Object.freeze([]);
|
|
20
|
-
|
|
21
|
-
export function getToolResultCache(messages) {
|
|
22
|
-
return _toolResultCache.get(messages) || null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function setToolResultCache(messages, state) {
|
|
26
|
-
_toolResultCache.set(messages, state);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// --- State builder ---
|
|
31
|
-
|
|
32
|
-
const MAX_EDIT_SNAPSHOTS = 300;
|
|
33
|
-
|
|
34
|
-
export function createEmptyToolState() {
|
|
35
|
-
return {
|
|
36
|
-
toolUseMap: {},
|
|
37
|
-
toolResultMap: {},
|
|
38
|
-
readContentMap: {},
|
|
39
|
-
editSnapshotMap: {},
|
|
40
|
-
askAnswerMap: {},
|
|
41
|
-
planApprovalMap: {},
|
|
42
|
-
latestPlanContent: null,
|
|
43
|
-
latestPlanFilePath: null,
|
|
44
|
-
_fileState: {},
|
|
45
|
-
_editOrder: [],
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* i18n 包装:在 toolResultCore 的 buildSingleToolResultCore 基础上附加本地化 label。
|
|
51
|
-
* 生产路径调用此函数;test 直接调 core 以避开 i18n 依赖。
|
|
52
|
-
*/
|
|
53
|
-
export function buildSingleToolResult(block, matchedTool) {
|
|
54
|
-
const core = buildSingleToolResultCore(block, matchedTool);
|
|
55
|
-
let label = t('ui.toolReturn');
|
|
56
|
-
if (matchedTool) {
|
|
57
|
-
if (matchedTool.name === 'Task' && matchedTool.input) {
|
|
58
|
-
const st = matchedTool.input.subagent_type || '';
|
|
59
|
-
const desc = matchedTool.input.description || '';
|
|
60
|
-
label = `SubAgent: ${st}${desc ? ' — ' + desc : ''}`;
|
|
61
|
-
} else {
|
|
62
|
-
label = t('ui.toolReturnNamed', { name: matchedTool.name });
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return { label, ...core };
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* 全局聚合所有 requests 的 tool_result 块,按 tool_use_id 索引。
|
|
70
|
-
*
|
|
71
|
-
* 设计动机:并行 SubAgent / Teammate 的请求在日志中互相穿插,K+1 不一定是同一 agent
|
|
72
|
-
* 的下一个 turn。两遍扫描建立"id → result"全局索引,渲染时 O(1) 查询,免去运行时配对。
|
|
73
|
-
*
|
|
74
|
-
* Pass 1: 全量构建 toolUseMap(供 label / toolName / toolInput 解析)
|
|
75
|
-
* - body.messages 里 role=assistant 的 tool_use 块
|
|
76
|
-
* - response.body.content 里的 tool_use 块(末轮)
|
|
77
|
-
* Pass 2: 提取所有 tool_result 块写入索引(role=user 消息的 content[])
|
|
78
|
-
*
|
|
79
|
-
* id 冲突风险:Anthropic API 用 nanoid 24+ char,2^-128 量级,可忽略。
|
|
80
|
-
*/
|
|
81
|
-
export function buildGlobalToolResultIndex(requests) {
|
|
82
|
-
const state = createEmptyGlobalIndexState();
|
|
83
|
-
appendToGlobalToolResultIndex(state, requests, 0);
|
|
84
|
-
return state.index;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// 同一 session 内并发持有的 base64 image 上限:更早入索引的 entry 一旦超过此数,
|
|
88
|
-
// 其 images 字段被改成 oversized 占位,释放 base64 字节(单图 2MB × N = 几十 MB
|
|
89
|
-
// 常驻内存的隐患)。32 张覆盖大多数实际会话;若超过,旧图回退为占位,新图保留。
|
|
90
|
-
const MAX_LIVE_IMAGE_ENTRIES = 32;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* 增量索引 state:供 ChatView / TeamModal 在 requests 增量到达时复用,避免每次全量扫描。
|
|
94
|
-
* index : { [tool_use_id]: entry } (出参,共享给调用方)
|
|
95
|
-
* _useMap : 已扫到的 tool_use 块 (Pass 1 累积,Pass 2 查 label)
|
|
96
|
-
* _imageEntryIds : FIFO 队列,跟踪持有 base64 image 的 entry id,超 MAX 时驱逐最早
|
|
97
|
-
*/
|
|
98
|
-
export function createEmptyGlobalIndexState() {
|
|
99
|
-
return { index: {}, _useMap: {}, _imageEntryIds: [] };
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// 把超出 LRU 上限的最早 image entry 降级为 oversized 占位,释放 base64 字符串。
|
|
103
|
-
function _enforceImageBudget(state) {
|
|
104
|
-
const { index, _imageEntryIds } = state;
|
|
105
|
-
while (_imageEntryIds.length > MAX_LIVE_IMAGE_ENTRIES) {
|
|
106
|
-
const evictId = _imageEntryIds.shift();
|
|
107
|
-
const entry = index[evictId];
|
|
108
|
-
if (!entry || !Array.isArray(entry.images)) continue;
|
|
109
|
-
entry.images = entry.images.map(img => (
|
|
110
|
-
img && img.src && !img.oversized
|
|
111
|
-
? { oversized: true, mediaType: img.mediaType, sizeBytes: img.src.length }
|
|
112
|
-
: img
|
|
113
|
-
));
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* 增量追加:扫描 requests[startIndex..] 并把新发现的 tool_use / tool_result 累积到 state。
|
|
119
|
-
* 仅写入新出现的 id(`!(id in index)`),原条目幂等,可重复调用同一切片不会引入副作用。
|
|
120
|
-
*/
|
|
121
|
-
export function appendToGlobalToolResultIndex(state, requests, startIndex) {
|
|
122
|
-
if (!Array.isArray(requests)) return;
|
|
123
|
-
const { index, _useMap, _imageEntryIds } = state;
|
|
124
|
-
for (let i = startIndex; i < requests.length; i++) {
|
|
125
|
-
const r = requests[i];
|
|
126
|
-
if (!r) continue;
|
|
127
|
-
const msgs = r.body?.messages;
|
|
128
|
-
if (Array.isArray(msgs)) {
|
|
129
|
-
for (const m of msgs) {
|
|
130
|
-
if (m?.role === 'assistant' && Array.isArray(m.content)) {
|
|
131
|
-
for (const b of m.content) {
|
|
132
|
-
if (b?.type === 'tool_use' && b.id) _useMap[b.id] = b;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
const respContent = r.response?.body?.content;
|
|
138
|
-
if (Array.isArray(respContent)) {
|
|
139
|
-
for (const b of respContent) {
|
|
140
|
-
if (b?.type === 'tool_use' && b.id) _useMap[b.id] = b;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
for (let i = startIndex; i < requests.length; i++) {
|
|
145
|
-
const r = requests[i];
|
|
146
|
-
const msgs = r?.body?.messages;
|
|
147
|
-
if (!Array.isArray(msgs)) continue;
|
|
148
|
-
for (const m of msgs) {
|
|
149
|
-
if (m?.role !== 'user' || !Array.isArray(m.content)) continue;
|
|
150
|
-
for (const b of m.content) {
|
|
151
|
-
if (b?.type === 'tool_result' && b.tool_use_id && !(b.tool_use_id in index)) {
|
|
152
|
-
const entry = buildSingleToolResult(b, _useMap[b.tool_use_id]);
|
|
153
|
-
index[b.tool_use_id] = entry;
|
|
154
|
-
if (Array.isArray(entry.images) && entry.images.some(img => img && img.src)) {
|
|
155
|
-
_imageEntryIds.push(b.tool_use_id);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
_enforceImageBudget(state);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* SubAgent / Teammate 渲染入口:组合本地 cachedBuildToolResultMap 与全局索引。
|
|
166
|
-
* globalIndex 由调用方一次性构建(buildGlobalToolResultIndex),所有 entry 共享,
|
|
167
|
-
* 渲染查询 O(1)。
|
|
168
|
-
*
|
|
169
|
-
* 补偿仅覆盖 toolResultMap;readContentMap / editSnapshotMap / latestPlanContent
|
|
170
|
-
* 等辅助 map 不在补偿范围内 —— SubAgent 卡片只渲染 response.content 块,Read snapshot
|
|
171
|
-
* 等高级展开由 mainAgent 路径消费,与 SubAgent 解耦。
|
|
172
|
-
*/
|
|
173
|
-
export function buildSubAgentResultMap(req, globalIndex) {
|
|
174
|
-
const localState = cachedBuildToolResultMap(req?.body?.messages || EMPTY_MESSAGES);
|
|
175
|
-
const respContent = req?.response?.body?.content;
|
|
176
|
-
if (!Array.isArray(respContent) || !globalIndex) {
|
|
177
|
-
return localState.toolResultMap;
|
|
178
|
-
}
|
|
179
|
-
// filled lazy-alloc 为 null sentinel:无补偿时返回原引用,避免下游 ChatMessage memo 抖动。
|
|
180
|
-
let filled = null;
|
|
181
|
-
for (const b of respContent) {
|
|
182
|
-
if (b?.type === 'tool_use' && b.id && !localState.toolResultMap[b.id] && globalIndex[b.id]) {
|
|
183
|
-
if (!filled) filled = {};
|
|
184
|
-
filled[b.id] = globalIndex[b.id];
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
if (!filled) return localState.toolResultMap;
|
|
188
|
-
return { ...localState.toolResultMap, ...filled };
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export function appendToolResultMap(state, messages, startIndex, extraToolUses) {
|
|
192
|
-
const { toolUseMap, toolResultMap, readContentMap, editSnapshotMap, askAnswerMap, planApprovalMap, _fileState } = state;
|
|
193
|
-
// V2 live: tool_use blocks merged into an already-scanned message by a later
|
|
194
|
-
// split row are surfaced on the synthetic entry's _toolUses. Register them so
|
|
195
|
-
// their tool_result pairs with a real matchedTool (label / input / Read/Edit
|
|
196
|
-
// state). Side-effect tracking (Write/Edit/Ask/ExitPlanMode) stays in the
|
|
197
|
-
// message loop below — these blocks were already seen there when first merged.
|
|
198
|
-
if (Array.isArray(extraToolUses)) {
|
|
199
|
-
for (const block of extraToolUses) {
|
|
200
|
-
if (!block || !block.id || block.id in toolUseMap) continue;
|
|
201
|
-
let parsed = block;
|
|
202
|
-
if (typeof block.input === 'string') {
|
|
203
|
-
try {
|
|
204
|
-
const cleaned = block.input.replace(/^\[object Object\]/, '');
|
|
205
|
-
parsed = { ...block, input: JSON.parse(cleaned) };
|
|
206
|
-
} catch {}
|
|
207
|
-
}
|
|
208
|
-
toolUseMap[parsed.id] = parsed;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
for (let i = startIndex; i < messages.length; i++) {
|
|
212
|
-
const msg = messages[i];
|
|
213
|
-
if (msg.role === 'assistant' && Array.isArray(msg.content)) {
|
|
214
|
-
for (const block of msg.content) {
|
|
215
|
-
if (block.type === 'tool_use') {
|
|
216
|
-
let parsed = block;
|
|
217
|
-
if (typeof block.input === 'string') {
|
|
218
|
-
try {
|
|
219
|
-
const cleaned = block.input.replace(/^\[object Object\]/, '');
|
|
220
|
-
parsed = { ...block, input: JSON.parse(cleaned) };
|
|
221
|
-
} catch {}
|
|
222
|
-
}
|
|
223
|
-
toolUseMap[parsed.id] = parsed;
|
|
224
|
-
// Write → .claude/plans/ 文件内容追踪
|
|
225
|
-
if (parsed.name === 'Write' && parsed.input?.file_path
|
|
226
|
-
&& /[/\\]\.claude[/\\]plans[/\\]/.test(parsed.input.file_path) && parsed.input.content) {
|
|
227
|
-
state.latestPlanContent = parsed.input.content;
|
|
228
|
-
}
|
|
229
|
-
// ExitPlanMode V2: input 直接携带 plan + planFilePath(normalizeToolInput 注入)
|
|
230
|
-
// 不依赖前置 Write/Edit,是 multi-agent-room 等无前置场景的核心数据源
|
|
231
|
-
if (parsed.name === 'ExitPlanMode' && parsed.input && typeof parsed.input === 'object') {
|
|
232
|
-
if (typeof parsed.input.plan === 'string' && parsed.input.plan.trim()) {
|
|
233
|
-
state.latestPlanContent = parsed.input.plan;
|
|
234
|
-
state._planDirty = (state._planDirty || 0) + 1;
|
|
235
|
-
}
|
|
236
|
-
if (typeof parsed.input.planFilePath === 'string' && parsed.input.planFilePath) {
|
|
237
|
-
state.latestPlanFilePath = parsed.input.planFilePath;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
// Edit → editSnapshotMap + _fileState 更新
|
|
241
|
-
if (parsed.name === 'Edit' && parsed.input) {
|
|
242
|
-
const fp = parsed.input.file_path;
|
|
243
|
-
const oldStr = parsed.input.old_string;
|
|
244
|
-
const newStr = parsed.input.new_string;
|
|
245
|
-
if (fp && oldStr != null && newStr != null && _fileState[fp]) {
|
|
246
|
-
const entry = _fileState[fp];
|
|
247
|
-
// 淘汰时留 null 占位:rebuild 时 key 已存在则跳过,避免重建已淘汰条目
|
|
248
|
-
if (!(parsed.id in editSnapshotMap)) {
|
|
249
|
-
editSnapshotMap[parsed.id] = { plainText: entry.plainText, lineNums: entry.lineNums.slice() };
|
|
250
|
-
state._editOrder.push(parsed.id);
|
|
251
|
-
if (state._editOrder.length > MAX_EDIT_SNAPSHOTS) {
|
|
252
|
-
const evictId = state._editOrder.shift();
|
|
253
|
-
editSnapshotMap[evictId] = null;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
const idx = entry.plainText.indexOf(oldStr);
|
|
257
|
-
if (idx >= 0) {
|
|
258
|
-
const before = entry.plainText.substring(0, idx);
|
|
259
|
-
const lineOffset = before.split('\n').length - 1;
|
|
260
|
-
const oldLineCount = oldStr.split('\n').length;
|
|
261
|
-
const newLineCount = newStr.split('\n').length;
|
|
262
|
-
const lineDelta = newLineCount - oldLineCount;
|
|
263
|
-
entry.plainText = entry.plainText.substring(0, idx) + newStr + entry.plainText.substring(idx + oldStr.length);
|
|
264
|
-
if (lineDelta !== 0) {
|
|
265
|
-
const startNum = entry.lineNums[lineOffset] || (lineOffset + 1);
|
|
266
|
-
const newNums = [];
|
|
267
|
-
for (let j = 0; j < newLineCount; j++) {
|
|
268
|
-
newNums.push(startNum + j);
|
|
269
|
-
}
|
|
270
|
-
entry.lineNums = [
|
|
271
|
-
...entry.lineNums.slice(0, lineOffset),
|
|
272
|
-
...newNums,
|
|
273
|
-
...entry.lineNums.slice(lineOffset + oldLineCount).map(n => n + lineDelta),
|
|
274
|
-
];
|
|
275
|
-
}
|
|
276
|
-
// Edit plan 文件时同步 latestPlanContent(Write 只追踪全量写入,Edit 追踪增量编辑后的完整内容)
|
|
277
|
-
if (/[/\\]\.claude[/\\]plans[/\\]/.test(fp)) {
|
|
278
|
-
state.latestPlanContent = entry.plainText;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
} else if (msg.role === 'user' && Array.isArray(msg.content)) {
|
|
286
|
-
for (const block of msg.content) {
|
|
287
|
-
if (block.type === 'tool_result') {
|
|
288
|
-
const matchedTool = toolUseMap[block.tool_use_id];
|
|
289
|
-
const entry = buildSingleToolResult(block, matchedTool);
|
|
290
|
-
const { resultText, isPermissionDenied, isUltraplan } = entry;
|
|
291
|
-
toolResultMap[block.tool_use_id] = entry;
|
|
292
|
-
if (matchedTool && matchedTool.name === 'Read' && matchedTool.input?.file_path) {
|
|
293
|
-
readContentMap[matchedTool.input.file_path] = resultText;
|
|
294
|
-
// _fileState 更新(行号解析)
|
|
295
|
-
const readLines = resultText.split('\n');
|
|
296
|
-
const plainLines = [];
|
|
297
|
-
const lineNums = [];
|
|
298
|
-
for (const rl of readLines) {
|
|
299
|
-
const m = rl.match(/^\s*(\d+)[\t→](.*)$/);
|
|
300
|
-
if (m) {
|
|
301
|
-
lineNums.push(parseInt(m[1], 10));
|
|
302
|
-
plainLines.push(m[2]);
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
if (plainLines.length > 0) {
|
|
306
|
-
const existing = _fileState[matchedTool.input.file_path];
|
|
307
|
-
if (existing) {
|
|
308
|
-
const mergedMap = new Map();
|
|
309
|
-
const existingLines = existing.plainText.split('\n');
|
|
310
|
-
for (let j = 0; j < existing.lineNums.length; j++) {
|
|
311
|
-
mergedMap.set(existing.lineNums[j], existingLines[j]);
|
|
312
|
-
}
|
|
313
|
-
for (let j = 0; j < lineNums.length; j++) {
|
|
314
|
-
mergedMap.set(lineNums[j], plainLines[j]);
|
|
315
|
-
}
|
|
316
|
-
const sortedKeys = [...mergedMap.keys()].sort((a, b) => a - b);
|
|
317
|
-
_fileState[matchedTool.input.file_path] = {
|
|
318
|
-
plainText: sortedKeys.map(k => mergedMap.get(k)).join('\n'),
|
|
319
|
-
lineNums: sortedKeys,
|
|
320
|
-
};
|
|
321
|
-
} else {
|
|
322
|
-
_fileState[matchedTool.input.file_path] = { plainText: plainLines.join('\n'), lineNums };
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
if (matchedTool && matchedTool.name === 'AskUserQuestion') {
|
|
327
|
-
const parsed = parseAskAnswerText(resultText);
|
|
328
|
-
// 被拒绝的 AskUserQuestion:分 cancelled / rejected 两类——
|
|
329
|
-
// - cancelled:cc-viewer 主动取消(Cancel 按钮 / 输入框打字打断)。
|
|
330
|
-
// ask-bridge.js / sdk-manager.js 注入 reason 时统一加 [cc-viewer:cancel] 前缀
|
|
331
|
-
// 作为协议级 sentinel,前缀匹配比模糊文案匹配稳定(SDK 升级换文案不影响)。
|
|
332
|
-
// - rejected:schema 校验失败 / hook deny 等"未触达"语义。
|
|
333
|
-
// ChatMessage 用这两个 sentinel 区分渲染(cancelled 显式带 __cancelReason__ 灰态)。
|
|
334
|
-
if (Object.keys(parsed).length === 0 && isPermissionDenied) {
|
|
335
|
-
const looksCancelled = /\[cc-viewer:cancel\]/.test(resultText);
|
|
336
|
-
if (looksCancelled) {
|
|
337
|
-
// 截掉 [cc-viewer:cancel] 前缀只显示用户可读 reason,再 slice 200 防超长
|
|
338
|
-
const cleanedReason = resultText.replace(/^\s*\[cc-viewer:cancel\]\s*/, '').slice(0, 200);
|
|
339
|
-
askAnswerMap[block.tool_use_id] = { __cancelled__: true, __cancelReason__: cleanedReason };
|
|
340
|
-
} else {
|
|
341
|
-
askAnswerMap[block.tool_use_id] = { __rejected__: true };
|
|
342
|
-
}
|
|
343
|
-
} else {
|
|
344
|
-
askAnswerMap[block.tool_use_id] = parsed;
|
|
345
|
-
}
|
|
346
|
-
state._askDirty = (state._askDirty || 0) + 1;
|
|
347
|
-
}
|
|
348
|
-
if (matchedTool && matchedTool.name === 'ExitPlanMode') {
|
|
349
|
-
if (isPermissionDenied) {
|
|
350
|
-
const userSaid = resultText.match(/the user said:\s*([\s\S]*)/i);
|
|
351
|
-
planApprovalMap[block.tool_use_id] = {
|
|
352
|
-
status: isUltraplan ? 'ultraplan' : 'rejected',
|
|
353
|
-
feedback: userSaid ? userSaid[1].trim() : '',
|
|
354
|
-
};
|
|
355
|
-
} else {
|
|
356
|
-
planApprovalMap[block.tool_use_id] = parsePlanApproval(resultText);
|
|
357
|
-
}
|
|
358
|
-
state._planDirty = (state._planDirty || 0) + 1;
|
|
359
|
-
// Plan 审批完成(approved/rejected)后无条件重置 latestPlanContent / latestPlanFilePath,
|
|
360
|
-
// 防止下一个 plan 周期显示旧内容。已审批卡片的 V2 plan 渲染由 ChatMessage 的
|
|
361
|
-
// approval.planContent || inp.plan || planFileContents 兜底链承担,不依赖 latestPlanContent。
|
|
362
|
-
state.latestPlanContent = null;
|
|
363
|
-
state.latestPlanFilePath = null;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
export function buildToolResultMap(messages) {
|
|
372
|
-
const state = createEmptyToolState();
|
|
373
|
-
appendToolResultMap(state, messages, 0);
|
|
374
|
-
return state;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
export function cachedBuildToolResultMap(messages) {
|
|
378
|
-
let cached = _toolResultCache.get(messages);
|
|
379
|
-
if (!cached) {
|
|
380
|
-
cached = buildToolResultMap(messages);
|
|
381
|
-
_toolResultCache.set(messages, cached);
|
|
382
|
-
}
|
|
383
|
-
return cached;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
/** 从 AskUserQuestion tool_result 文本中提取答案 map */
|
|
387
|
-
export function parseAskAnswerText(text) {
|
|
388
|
-
const answers = {};
|
|
389
|
-
const re = /"([^"]+)"="([^"]*)"/g;
|
|
390
|
-
let m;
|
|
391
|
-
while ((m = re.exec(text)) !== null) {
|
|
392
|
-
answers[m[1]] = m[2];
|
|
393
|
-
}
|
|
394
|
-
return answers;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
/** 从 ExitPlanMode tool_result 文本中解析审批状态和计划内容 */
|
|
398
|
-
export function parsePlanApproval(text) {
|
|
399
|
-
if (!text) return { status: 'pending' };
|
|
400
|
-
if (/User has approved/i.test(text)) {
|
|
401
|
-
// Heading may carry a suffix before the colon, e.g. "## Approved Plan (edited by user):"
|
|
402
|
-
// (Claude Code CLI ≥2.1.201); [^\n]* keeps matching the plain "## Approved Plan:" form.
|
|
403
|
-
const planMatch = text.match(/##\s*Approved Plan[^\n]*:\s*\n([\s\S]*)/i);
|
|
404
|
-
return { status: 'approved', planContent: planMatch ? planMatch[1].trim() : '' };
|
|
405
|
-
}
|
|
406
|
-
if (/User rejected/i.test(text)) {
|
|
407
|
-
const feedbackMatch = text.match(/feedback:\s*(.+)/i) || text.match(/User rejected[^:]*:\s*(.+)/i);
|
|
408
|
-
return { status: 'rejected', feedback: feedbackMatch ? feedbackMatch[1].trim() : '' };
|
|
409
|
-
}
|
|
410
|
-
return { status: 'pending' };
|
|
411
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// 孤儿 tool_use:assistant 调工具但 schema/Zod safeParse 在 PreToolUse hook 之前就抛了
|
|
2
|
-
// InputValidationError——cc-viewer 看到 jsonl 里有 tool_use 块但底层 CLI 从未 spawn hook,
|
|
3
|
-
// 用户既无法答也无法干预。区分于 isPermissionDenied(用户主动拒):前者根因在 model schema
|
|
4
|
-
// 与 runtime validator 不一致,后者是用户语义否决。
|
|
5
|
-
//
|
|
6
|
-
// 单独成文件让 Node test runner 可直接 import(toolResultBuilder.js 通过 helpers.js 拉了
|
|
7
|
-
// SVG asset import,在 jsdom-less 环境无法加载)。
|
|
8
|
-
export function classifyToolResultError(resultText, isError) {
|
|
9
|
-
const isPermissionDenied = isError && resultText
|
|
10
|
-
&& /doesn't want to proceed|Permission.*denied|rejected.*tool use|interrupted by user for tool use/i.test(resultText);
|
|
11
|
-
const isInputValidationError = isError && resultText
|
|
12
|
-
&& /InputValidationError|<tool_use_error>/i.test(resultText)
|
|
13
|
-
&& !isPermissionDenied;
|
|
14
|
-
const isUltraplan = isPermissionDenied && resultText && /ultraplan/i.test(resultText);
|
|
15
|
-
return { isPermissionDenied, isInputValidationError, isUltraplan };
|
|
16
|
-
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tool_result entry 的纯 JS 核心,无 i18n / SVG 依赖。
|
|
3
|
-
* 拆出独立模块是为了让 node --test 可直接 import(避开 helpers.js → SVG 的 vite-only 链)。
|
|
4
|
-
* 生产路径仍在 toolResultBuilder.js 通过 buildSingleToolResult 包装,补 i18n label。
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { internToolResult } from './readResultPool.js';
|
|
8
|
-
import { classifyToolResultError } from './toolResultClassifier.js';
|
|
9
|
-
|
|
10
|
-
export function extractToolResultText(toolResult) {
|
|
11
|
-
if (!toolResult.content) return String(toolResult.content ?? '');
|
|
12
|
-
if (typeof toolResult.content === 'string') return toolResult.content;
|
|
13
|
-
if (Array.isArray(toolResult.content)) {
|
|
14
|
-
return toolResult.content
|
|
15
|
-
.filter(b => b.type === 'text')
|
|
16
|
-
.map(b => b.text)
|
|
17
|
-
.join('\n');
|
|
18
|
-
}
|
|
19
|
-
return JSON.stringify(toolResult.content);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// 白名单防恶意 JSONL 拼任意 MIME(svg+xml 在某些浏览器可嵌入脚本;text/html 应被
|
|
23
|
-
// <img> 拒绝但日志污染仍可避免)。
|
|
24
|
-
const SAFE_IMAGE_MIME = new Set(['image/png', 'image/jpeg', 'image/gif', 'image/webp']);
|
|
25
|
-
|
|
26
|
-
// base64 字符串长度上限(2MB ≈ 1.5MB 原图)。超限不渲染 <img>,降级为文字提示,
|
|
27
|
-
// 避免每次 Popover 重渲染都构造几 MB src 字符串导致 React diff / 浏览器解码卡顿。
|
|
28
|
-
const MAX_IMAGE_BASE64_LEN = 2 * 1024 * 1024;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 提取 tool_result 内嵌的 image 块为可直接渲染的 src 列表(或大图占位)。
|
|
32
|
-
* Anthropic API 协议:Read 图片文件 / 截图等返回 `{type:'image', source: {type:'base64', media_type, data}}`,
|
|
33
|
-
* 也可能是 `{type:'url', url}`。
|
|
34
|
-
*
|
|
35
|
-
* 安全/性能:
|
|
36
|
-
* - media_type 必须在白名单内,否则跳过
|
|
37
|
-
* - base64 超过 MAX_IMAGE_BASE64_LEN 时,返回 { oversized: true, sizeBytes } 让 UI 降级显示
|
|
38
|
-
*/
|
|
39
|
-
export function extractToolResultImages(toolResult) {
|
|
40
|
-
if (!toolResult || !Array.isArray(toolResult.content)) return [];
|
|
41
|
-
const out = [];
|
|
42
|
-
for (const b of toolResult.content) {
|
|
43
|
-
if (!b || b.type !== 'image' || !b.source) continue;
|
|
44
|
-
const s = b.source;
|
|
45
|
-
if (s.type === 'base64' && typeof s.data === 'string' && s.data.length > 0 && typeof s.media_type === 'string') {
|
|
46
|
-
if (!SAFE_IMAGE_MIME.has(s.media_type)) continue;
|
|
47
|
-
if (s.data.length > MAX_IMAGE_BASE64_LEN) {
|
|
48
|
-
out.push({ oversized: true, mediaType: s.media_type, sizeBytes: Math.floor(s.data.length * 0.75) });
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
out.push({ src: `data:${s.media_type};base64,${s.data}`, mediaType: s.media_type });
|
|
52
|
-
} else if (s.type === 'url' && typeof s.url === 'string' && /^https?:\/\//.test(s.url)) {
|
|
53
|
-
out.push({ src: s.url, mediaType: 'image/url' });
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return out;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Workflow tool_result 文本固定以此句开头(后台启动即时返回,完成走单独的 task-notification)。
|
|
60
|
-
const WF_LAUNCH_MARKER = 'Workflow launched in background';
|
|
61
|
-
const WF_TASK_ID_RE = /Task ID:\s*([A-Za-z0-9_-]+)/;
|
|
62
|
-
const WF_RUN_ID_RE = /Run ID:\s*(wf_[A-Za-z0-9_-]+)/;
|
|
63
|
-
// Transcript dir / Script file 路径段:…/projects/<cwd 编码>/<sessionId(UUID)>/…
|
|
64
|
-
const WF_SESSION_RE = /\/projects\/[^/\s]+\/([0-9a-fA-F-]{36})\//;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* 从 Workflow tool_result 原始文本解析定位线索。命中返回 { runId, taskId, sessionId },
|
|
68
|
-
* 否则返回 null。sessionId 为全局唯一 UUID,足以让服务端 /api/workflow-journal 定位 journal
|
|
69
|
-
* 目录,无需 project hint。
|
|
70
|
-
*
|
|
71
|
-
* @param {string} txt - tool_result resultText 原文
|
|
72
|
-
* @returns {{ runId: string|null, taskId: string|null, sessionId: string|null } | null}
|
|
73
|
-
*/
|
|
74
|
-
export function parseWorkflowFromText(txt) {
|
|
75
|
-
if (typeof txt !== 'string' || txt.indexOf(WF_LAUNCH_MARKER) === -1) return null;
|
|
76
|
-
const taskId = (txt.match(WF_TASK_ID_RE) || [])[1] || null;
|
|
77
|
-
const runId = (txt.match(WF_RUN_ID_RE) || [])[1] || null;
|
|
78
|
-
const sessionId = (txt.match(WF_SESSION_RE) || [])[1] || null;
|
|
79
|
-
if (!runId && !taskId) return null;
|
|
80
|
-
return { runId, taskId, sessionId };
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function buildSingleToolResultCore(block, matchedTool) {
|
|
84
|
-
let toolName = null;
|
|
85
|
-
let toolInput = null;
|
|
86
|
-
if (matchedTool) {
|
|
87
|
-
toolName = matchedTool.name;
|
|
88
|
-
toolInput = matchedTool.input;
|
|
89
|
-
}
|
|
90
|
-
let resultText = extractToolResultText(block);
|
|
91
|
-
resultText = internToolResult(resultText);
|
|
92
|
-
const isError = !!block.is_error;
|
|
93
|
-
const { isPermissionDenied, isInputValidationError, isUltraplan } = classifyToolResultError(resultText, isError);
|
|
94
|
-
const images = extractToolResultImages(block);
|
|
95
|
-
// Workflow 工具:直接从原始 tool_result 文本解析 { runId, taskId, sessionId } 线索定位
|
|
96
|
-
// 并拉取 workflow run journal 渲染面板。线索原生存在于 wire 文本("Workflow launched in
|
|
97
|
-
// background. Task ID: … / Run ID: wf_… / Transcript dir: …/projects/<cwd>/<sessionId>/…"),
|
|
98
|
-
// 不依赖服务端注入——历史日志(含未经 enrich 的旧日志)同样可识别。
|
|
99
|
-
// 回退:兼容旧路径已注入的 block._ccvWorkflow(服务端 enrich-workflow,仍用于 live)。
|
|
100
|
-
// 文本解析命中时补回 _ccvWorkflow 携带的 project(解析线索里没有),用于 journal 定位的精确消歧。
|
|
101
|
-
const parsedWf = parseWorkflowFromText(resultText);
|
|
102
|
-
const ccvWf = (block._ccvWorkflow && typeof block._ccvWorkflow === 'object') ? block._ccvWorkflow : null;
|
|
103
|
-
const workflow = parsedWf
|
|
104
|
-
? { ...parsedWf, project: ccvWf?.project || null }
|
|
105
|
-
: ccvWf;
|
|
106
|
-
return { toolName, toolInput, resultText, isError, isPermissionDenied, isInputValidationError, isUltraplan, images, workflow };
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const ANSI_ESCAPE = /\x1b\[[0-9;]*[A-Za-z]/g;
|
|
110
|
-
const READ_LINE_PREFIX = /^\s*\d+[→\t](.*)$/;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* 紧凑模式 Popover 浮窗的 tool_result 预览:从 toolResultMap entry 生成截断文本。
|
|
114
|
-
*
|
|
115
|
-
* 返回 null 的场景(由 caller skip 渲染预览块):
|
|
116
|
-
* - entry 不存在 / resultText 为空
|
|
117
|
-
* - isPermissionDenied / isInputValidationError(外部已有红 badge,避免双显示)
|
|
118
|
-
*
|
|
119
|
-
* 工具特定清洗:
|
|
120
|
-
* - Read:strip 行号前缀(` 123→content` → `content`)
|
|
121
|
-
* - Bash:strip ANSI 转义(`\x1b[31mERROR\x1b[0m` → `ERROR`)
|
|
122
|
-
*
|
|
123
|
-
* 截断策略:行数上限 maxLines(默认 50,留够内容让 CSS max-height + overflow:auto 触发
|
|
124
|
-
* 滚动),每行字符上限 maxChars(默认 500,防止超长单行撑爆 popover)。
|
|
125
|
-
*/
|
|
126
|
-
export function compactResultPreview(entry, opts = {}) {
|
|
127
|
-
if (!entry || typeof entry !== 'object') return null;
|
|
128
|
-
if (entry.isPermissionDenied || entry.isInputValidationError) return null;
|
|
129
|
-
|
|
130
|
-
// 图片优先:Read 图片文件 / 截图等场景,images 数组非空则返回图片预览(text 可同时存在,作为辅助文本)
|
|
131
|
-
const images = Array.isArray(entry.images) ? entry.images : null;
|
|
132
|
-
const hasImages = images && images.length > 0;
|
|
133
|
-
|
|
134
|
-
const raw = entry.resultText;
|
|
135
|
-
const hasText = typeof raw === 'string' && raw.length > 0;
|
|
136
|
-
if (!hasImages && !hasText) return null;
|
|
137
|
-
|
|
138
|
-
const maxLines = opts.maxLines || 50;
|
|
139
|
-
const maxChars = opts.maxChars || 500;
|
|
140
|
-
|
|
141
|
-
let text = null;
|
|
142
|
-
if (hasText) {
|
|
143
|
-
let cleaned = raw;
|
|
144
|
-
if (entry.toolName === 'Bash') {
|
|
145
|
-
cleaned = cleaned.replace(ANSI_ESCAPE, '');
|
|
146
|
-
}
|
|
147
|
-
const lines = cleaned.split('\n');
|
|
148
|
-
const totalLines = lines.length;
|
|
149
|
-
const slice = lines.slice(0, maxLines);
|
|
150
|
-
const out = [];
|
|
151
|
-
for (let i = 0; i < slice.length; i++) {
|
|
152
|
-
let line = slice[i];
|
|
153
|
-
if (entry.toolName === 'Read') {
|
|
154
|
-
const m = line.match(READ_LINE_PREFIX);
|
|
155
|
-
if (m) line = m[1];
|
|
156
|
-
}
|
|
157
|
-
if (line.length > maxChars) line = line.slice(0, maxChars) + '…';
|
|
158
|
-
out.push(line);
|
|
159
|
-
}
|
|
160
|
-
text = out.join('\n');
|
|
161
|
-
if (totalLines > maxLines) text = text + '\n…';
|
|
162
|
-
if (text.trim().length === 0) text = null;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if (!hasImages && !text) return null;
|
|
166
|
-
return { text, images: hasImages ? images : null };
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* 简化模式是否应在消息流内联 tool_result 图片。
|
|
171
|
-
* 与 compactResultPreview 的跳过条件(isPermissionDenied / isInputValidationError)
|
|
172
|
-
* 保持同一语义;另外要求至少一张「可渲染」的图(有 src 的非 oversized),
|
|
173
|
-
* 纯 oversized 占位不内联(否则消息流里全是虚线占位噪音)。
|
|
174
|
-
*
|
|
175
|
-
* @param {object|null} entry - toolResultMap 条目(可能为 undefined:SubAgent 末轮
|
|
176
|
-
* tool_use 的 result 未到位 / WebSearch / 历史计数缺口等窗口)
|
|
177
|
-
* @returns {boolean}
|
|
178
|
-
*/
|
|
179
|
-
export function shouldInlineToolImages(entry) {
|
|
180
|
-
if (!entry || typeof entry !== 'object') return false;
|
|
181
|
-
if (entry.isPermissionDenied || entry.isInputValidationError) return false;
|
|
182
|
-
if (!Array.isArray(entry.images) || entry.images.length === 0) return false;
|
|
183
|
-
return entry.images.some((img) => img && img.src && !img.oversized);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* oversized 图片占位文案(3 处复用:ToolResultView / ChatMessage Popover / 内联块)。
|
|
188
|
-
* `[image png · 512 KB · too large to preview]`
|
|
189
|
-
*/
|
|
190
|
-
export function formatOversizedImagePlaceholder(img) {
|
|
191
|
-
const mediaType = (img && img.mediaType ? String(img.mediaType).replace('image/', '') : 'image');
|
|
192
|
-
const sizeKB = img && typeof img.sizeBytes === 'number' ? Math.round(img.sizeBytes / 1024) : 0;
|
|
193
|
-
return `[image ${mediaType} · ${sizeKB} KB · too large to preview]`;
|
|
194
|
-
}
|
package/src/utils/toolsDiff.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tools diff —— 计算「当前请求 tools」相对「上一条 MainAgent 请求 tools」的新增/移除。
|
|
3
|
-
*
|
|
4
|
-
* 用于 ContextTab 的 tools 变化可视化(tools_search 等场景下 tools 列表逐请求变化)。
|
|
5
|
-
* 抽成纯函数:① 让渲染逻辑变短;② 统一 added/removed 的统计口径(均按唯一 name 计数,
|
|
6
|
-
* 不再 added 按数组、removed 按集合导致重名时口径不一致);③ 可独立单测。
|
|
7
|
-
*
|
|
8
|
-
* 约定:tool 按 name 比对(无 name 的 tool 不参与 diff);prevTools 非数组(无上一条 /
|
|
9
|
-
* 当前请求非 MainAgent)时视为「无可比对基线」,hasPrev=false、不产生任何 added/removed。
|
|
10
|
-
*
|
|
11
|
-
* @param {Array|undefined|null} prevTools 上一条请求的 tools 数组(可空)
|
|
12
|
-
* @param {Array|undefined|null} curTools 当前请求的 tools 数组
|
|
13
|
-
* @returns {{
|
|
14
|
-
* hasPrev: boolean, // 是否存在可比对基线
|
|
15
|
-
* isAdded: (name: string) => boolean, // 某 name 是否为相对上一条新增
|
|
16
|
-
* addedNames: string[], // 新增的唯一 name 列表
|
|
17
|
-
* removedNames: string[], // 移除的唯一 name 列表(上一条有、当前没有)
|
|
18
|
-
* addedCount: number, // = addedNames.length
|
|
19
|
-
* removedCount: number, // = removedNames.length
|
|
20
|
-
* changed: boolean, // 是否有任何新增或移除
|
|
21
|
-
* }}
|
|
22
|
-
*/
|
|
23
|
-
export function computeToolsDiff(prevTools, curTools) {
|
|
24
|
-
const prevNameSet = Array.isArray(prevTools)
|
|
25
|
-
? new Set(prevTools.map(t => t?.name).filter(Boolean))
|
|
26
|
-
: null;
|
|
27
|
-
const curNameSet = new Set(
|
|
28
|
-
(Array.isArray(curTools) ? curTools : []).map(t => t?.name).filter(Boolean),
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
const addedNames = prevNameSet ? [...curNameSet].filter(n => !prevNameSet.has(n)) : [];
|
|
32
|
-
const removedNames = prevNameSet ? [...prevNameSet].filter(n => !curNameSet.has(n)) : [];
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
hasPrev: prevNameSet != null,
|
|
36
|
-
// 仅对有 name 且存在基线的 tool 判新增;无 name 无法按名比对,一律不标记
|
|
37
|
-
isAdded: (name) => prevNameSet != null && !!name && !prevNameSet.has(name),
|
|
38
|
-
addedNames,
|
|
39
|
-
removedNames,
|
|
40
|
-
addedCount: addedNames.length,
|
|
41
|
-
removedCount: removedNames.length,
|
|
42
|
-
changed: addedNames.length > 0 || removedNames.length > 0,
|
|
43
|
-
};
|
|
44
|
-
}
|