From c8bf4e0f89e506d63820d6dfac945bf405cc998e Mon Sep 17 00:00:00 2001 From: mateaix <57164338+mateaix@users.noreply.github.com> Date: Sat, 4 Jul 2026 20:28:15 +0800 Subject: [PATCH] release: v1.7.0 --- .env.example | 19 + .gitignore | 3 + README.md | 32 +- README_zh.md | 32 +- docker-compose.yml | 24 + mateclaw-desktop/.env.example | 15 + mateclaw-desktop/.gitignore | 33 + mateclaw-desktop/CODESIGNING.md | 275 ++ mateclaw-desktop/README.md | 432 ++ mateclaw-desktop/RELEASE_NOTES_v1.0.101.md | 67 + mateclaw-desktop/branding.config.json | 9 + .../build/entitlements.mac.inherit.plist | 14 + mateclaw-desktop/build/entitlements.mac.plist | 18 + mateclaw-desktop/build/icon.icns | Bin 0 -> 247190 bytes mateclaw-desktop/build/icon.ico | Bin 0 -> 285478 bytes mateclaw-desktop/build/icon.png | Bin 0 -> 247190 bytes mateclaw-desktop/build/icon_256.png | Bin 0 -> 53511 bytes mateclaw-desktop/electron-builder.cjs | 139 + mateclaw-desktop/electron/main/config.ts | 87 + mateclaw-desktop/electron/main/index.ts | 1103 +++++ mateclaw-desktop/electron/main/localBridge.ts | 205 + .../electron/main/localToolsApproval.ts | 82 + .../electron/main/localToolsConfig.ts | 122 + .../electron/main/localToolsExecutor.ts | 194 + mateclaw-desktop/electron/preload/index.ts | 55 + mateclaw-desktop/index.html | 27 + mateclaw-desktop/package.json | 51 + mateclaw-desktop/pnpm-lock.yaml | 3942 +++++++++++++++++ .../public/logo/mateclaw_logo_s.png | Bin 0 -> 68958 bytes mateclaw-desktop/src/App.vue | 1355 ++++++ mateclaw-desktop/src/env.d.ts | 67 + mateclaw-desktop/src/main.ts | 4 + mateclaw-desktop/tsconfig.json | 25 + mateclaw-desktop/tsconfig.node.json | 12 + mateclaw-desktop/tsconfig.node.tsbuildinfo | 1 + mateclaw-desktop/vite.config.ts | 72 + .../vip/mate/plugin/api/PluginContext.java | 14 + .../java/vip/mate/plugin/api/PluginType.java | 5 +- .../api/search/PluginSearchProvider.java | 53 + .../plugin/api/search/PluginSearchQuery.java | 22 + .../plugin/api/search/PluginSearchResult.java | 24 + mateclaw-plugin-search-sample/pom.xml | 50 + .../sample/search/SimpleSearchPlugin.java | 124 + .../src/main/resources/mateclaw-plugin.json | 24 + .../vip/mate/agent/AgentGraphBuilder.java | 283 +- .../main/java/vip/mate/agent/BaseAgent.java | 10 +- .../controller/AgentBindingController.java | 9 +- .../model/AgentProviderPreference.java | 10 + .../AgentBindingMcpRemovalListener.java | 71 + .../binding/service/AgentBindingService.java | 24 +- .../vip/mate/agent/context/ChatOrigin.java | 43 +- .../context/ConversationWindowManager.java | 50 +- .../mate/agent/context/PrefixBudgetPlan.java | 41 + .../agent/context/PrefixBudgetPlanner.java | 120 + .../delegation/DelegatedUsageAccumulator.java | 95 + .../agent/delegation/SubagentRunContext.java | 75 + .../agent/graph/NodeStreamingChatHelper.java | 143 +- .../agent/graph/StateGraphReActAgent.java | 62 +- .../graph/executor/ToolExecutionExecutor.java | 14 + .../graph/executor/ToolResultStorage.java | 38 + .../agent/graph/node/FinalAnswerNode.java | 9 +- .../mate/agent/graph/node/ReasoningNode.java | 101 +- .../plan/StateGraphPlanExecuteAgent.java | 45 +- .../graph/plan/node/PlanGenerationNode.java | 69 +- .../graph/plan/node/StepExecutionNode.java | 55 +- .../graph/plan/state/PlanStateAccessor.java | 27 + .../graph/state/MateClawStateAccessor.java | 6 + .../agent/graph/state/MateClawStateKeys.java | 6 + .../approval/ApprovalWorkflowService.java | 34 + .../vip/mate/auth/service/AuthService.java | 8 +- .../mate/auth/sso/SsoAutoConfiguration.java | 33 + .../mate/auth/sso/SsoCallbackResponse.java | 43 + .../java/vip/mate/auth/sso/SsoController.java | 72 + .../java/vip/mate/auth/sso/SsoProperties.java | 51 + .../java/vip/mate/auth/sso/SsoService.java | 267 ++ .../vip/mate/auth/sso/SsoStateService.java | 233 + .../sso/model/ExternalIdentityEntity.java | 60 + .../mate/auth/sso/model/SsoStateEntity.java | 37 + .../auth/sso/provider/FeishuSsoProvider.java | 230 + .../mate/auth/sso/provider/SsoProvider.java | 34 + .../sso/provider/SsoProviderRegistry.java | 50 + .../mate/auth/sso/provider/SsoUserInfo.java | 22 + .../repository/ExternalIdentityMapper.java | 14 + .../auth/sso/repository/SsoStateMapper.java | 14 + .../channel/ChannelChatOriginFactory.java | 3 +- .../java/vip/mate/channel/ChannelManager.java | 15 +- .../mate/channel/ChannelMessageRouter.java | 50 +- .../channel/feishu/FeishuChannelAdapter.java | 84 +- .../tool_guard/ToolGuardCardHandler.java | 75 + .../tool_guard/ToolGuardCardKindFactory.java | 15 +- .../vip/mate/channel/web/ChatController.java | 162 +- .../channel/webchat/WebChatController.java | 338 +- .../channel/webchat/WebChatFileService.java | 31 +- .../channel/wecom/WeComChannelAdapter.java | 32 +- .../tool_guard/ToolGuardCardHandler.java | 69 +- .../tool_guard/ToolGuardCardKindFactory.java | 11 +- .../channel/weixin/WeixinChannelAdapter.java | 24 +- .../main/java/vip/mate/cli/ExportCommand.java | 80 + .../main/java/vip/mate/cli/MateClawCli.java | 178 + .../vip/mate/common/net/SsrfAllowlist.java | 138 + .../vip/mate/common/net/SsrfProperties.java | 28 + .../java/vip/mate/config/JwtAuthFilter.java | 2 + .../vip/mate/config/LoginRateLimitFilter.java | 22 +- .../java/vip/mate/config/OpenApiConfig.java | 99 + .../mate/config/PrefixBudgetProperties.java | 69 + .../java/vip/mate/config/SecurityConfig.java | 63 +- .../java/vip/mate/config/WebMvcConfig.java | 6 + .../java/vip/mate/config/WebSocketConfig.java | 10 + .../java/vip/mate/hook/HookActionFactory.java | 3 + .../java/vip/mate/hook/action/HttpAction.java | 14 +- .../vip/mate/kbopen/auth/KbApiKeyContext.java | 39 + .../mate/kbopen/auth/KbApiKeyRateLimiter.java | 46 + .../vip/mate/kbopen/auth/KbApiKeyService.java | 240 + .../mate/kbopen/auth/KbOpenApiAuthFilter.java | 142 + .../mate/kbopen/auth/KbScopeInterceptor.java | 97 + .../vip/mate/kbopen/auth/RequireKbScope.java | 29 + .../vip/mate/kbopen/auth/TokenHashUtil.java | 58 + .../auth/model/KbApiKeyBindingEntity.java | 33 + .../kbopen/auth/model/KbApiKeyEntity.java | 64 + .../repository/KbApiKeyBindingMapper.java | 9 + .../auth/repository/KbApiKeyMapper.java | 9 + .../controller/KbApiKeyAdminController.java | 137 + .../controller/KbOpenApiController.java | 331 ++ .../controller/KbOpenResearchController.java | 230 + .../vip/mate/kbopen/dto/KbOpenApiDtos.java | 142 + .../research/KbResearchSessionRegistry.java | 188 + .../mate/kbopen/service/KbOpenApiService.java | 298 ++ .../mate/llm/cache/CacheUsageExtractor.java | 73 +- .../llm/probe/ContextLimitErrorParser.java | 64 + .../llm/probe/ContextProbeProperties.java | 25 + .../vip/mate/llm/probe/LocalContextProbe.java | 41 + .../vip/mate/llm/probe/LocalEndpoints.java | 85 + .../llm/probe/ModelContextWindowResolver.java | 125 + .../mate/llm/probe/OllamaContextProbe.java | 141 + .../probe/OpenAiCompatibleContextProbe.java | 130 + .../llm/routing/AgentBindingResolver.java | 8 +- .../mate/llm/routing/ProviderModelRef.java | 18 + .../vip/mate/llm/routing/ProviderRouter.java | 45 +- .../llm/service/ModelCapabilityService.java | 9 +- .../memory/search/SessionSearchService.java | 10 +- .../mate/memory/search/SessionSearchTool.java | 23 +- .../memory/service/MemoryRecallService.java | 19 + .../memory/service/MemoryRecallTracker.java | 12 +- .../vip/mate/memory/spi/MemoryManager.java | 54 +- .../notification/NotificationController.java | 8 + .../controller/OperationalDataController.java | 112 + .../model/ExportInProgressException.java | 10 + .../mate/operational/model/ExportTask.java | 72 + .../service/OperationalDataExportService.java | 1352 ++++++ .../planning/service/PlanningService.java | 16 +- .../java/vip/mate/plugin/LoadedPlugin.java | 3 + .../vip/mate/plugin/PluginContextImpl.java | 36 +- .../java/vip/mate/plugin/PluginManager.java | 81 +- .../plugin/bridge/PluginSearchBridge.java | 112 + .../vip/mate/plugin/model/PluginInfo.java | 3 + .../skill/controller/SkillController.java | 9 + .../controller/SkillInstallController.java | 13 +- .../mate/skill/installer/SkillHubClient.java | 12 +- .../mate/skill/installer/ZipSkillFetcher.java | 66 +- .../lifecycle/SkillConsolidationService.java | 255 ++ .../mate/skill/lifecycle/SkillCuratorJob.java | 23 + .../skill/lifecycle/SkillCuratorReport.java | 19 + .../lifecycle/SkillCuratorReportStore.java | 14 + .../lifecycle/SkillLifecycleProperties.java | 19 + .../SkillReflectionAutoConfiguration.java | 14 + .../reflection/SkillReflectionProperties.java | 49 + .../reflection/SkillReflectionService.java | 352 ++ .../vip/mate/skill/service/SkillService.java | 2 + .../controller/SystemSettingController.java | 8 + .../model/SearchProviderCatalogEntry.java | 24 + .../model/SearchProviderCatalogResponse.java | 17 + .../system/service/SystemSettingService.java | 64 +- .../mate/tool/browser/BrowserLauncher.java | 122 +- .../mate/tool/browser/BrowserProperties.java | 62 +- .../mate/tool/browser/UrlSafetyChecker.java | 133 +- .../vip/mate/tool/builtin/BrowserUseTool.java | 163 +- .../mate/tool/builtin/ChatUploadResolver.java | 74 +- .../mate/tool/builtin/CodeExecuteTool.java | 28 +- .../mate/tool/builtin/DelegateAgentTool.java | 238 +- .../mate/tool/builtin/DelegationContext.java | 79 +- .../mate/tool/builtin/MateClawDocService.java | 78 +- .../mate/tool/builtin/SessionListTool.java | 144 + .../mate/tool/builtin/SessionSendTool.java | 142 + .../mate/tool/builtin/ShellExecuteTool.java | 16 +- .../mate/tool/builtin/SkillManageTool.java | 79 +- .../DefaultToolDisclosureService.java | 84 +- .../disclosure/ToolDisclosureService.java | 32 + .../disclosure/ToolUsageRecencyTracker.java | 33 + .../tool/document/GeneratedFileCache.java | 45 + .../document/WorkspaceArtifactSurfacer.java | 121 + .../mate/tool/guard/WorkspacePathGuard.java | 82 +- .../guardian/WorkspaceBoundaryGuardian.java | 49 +- .../mate/tool/image/ImageFileDownloader.java | 10 +- .../mate/tool/image/ImageReferenceLoader.java | 40 +- .../tool/local/DesktopBridgeController.java | 44 + .../tool/local/DesktopBridgeException.java | 32 + .../DesktopBridgeHandshakeInterceptor.java | 86 + .../tool/local/DesktopBridgeRegistry.java | 181 + .../local/DesktopBridgeWebSocketHandler.java | 117 + .../vip/mate/tool/local/LocalFileTools.java | 132 + .../vip/mate/tool/local/LocalShellTool.java | 63 + .../tool/local/LocalToolBridgeService.java | 145 + .../vip/mate/tool/local/LocalToolFormat.java | 40 + .../tool/mcp/event/McpServerRemovedEvent.java | 20 + .../IdentityForwardingToolCallback.java | 112 + .../tool/mcp/runtime/McpClientManager.java | 38 +- .../runtime/McpIdentityForwardProperties.java | 151 + .../runtime/McpIdentityForwardService.java | 255 ++ .../tool/mcp/service/McpServerService.java | 4 + .../tool/model3d/Model3dFileDownloader.java | 8 +- .../tool/music/MusicGenerationService.java | 6 +- .../vip/mate/tool/search/SearchCache.java | 2 +- .../tool/search/SearchProviderRegistry.java | 89 +- .../vip/mate/tool/search/SearchQuery.java | 2 +- .../mate/tool/video/VideoFileDownloader.java | 8 +- .../main/java/vip/mate/tts/TtsService.java | 6 +- .../wiki/controller/WikiAdminController.java | 39 + .../mate/wiki/controller/WikiController.java | 3 + .../wiki/controller/WikiEntityController.java | 39 +- .../controller/WikiRelationController.java | 117 +- .../vip/mate/wiki/dto/WikiFailureItem.java | 23 + .../java/vip/mate/wiki/job/WikiKbConfig.java | 10 + .../vip/mate/wiki/job/WikiKbConfigParser.java | 3 + .../GlobalDefaultStepModelStrategy.java | 12 +- .../job/strategy/KbDefaultModelStrategy.java | 14 +- .../job/strategy/WikiLightModelStrategy.java | 92 + .../wiki/model/WikiRawMaterialEntity.java | 36 +- .../mate/wiki/profile/WikiPageTypeDef.java | 28 + .../repository/WikiRawMaterialMapper.java | 32 + .../mate/wiki/service/WikiContextService.java | 27 +- .../mate/wiki/service/WikiPageService.java | 2 +- .../wiki/service/WikiProcessingService.java | 164 +- .../wiki/service/WikiRawMaterialService.java | 114 +- .../wiki/service/WikiResearchService.java | 40 + .../service/WikiTransformationExecutor.java | 10 +- .../service/WikiTransformationService.java | 18 +- .../vip/mate/wiki/sse/WikiProgressBus.java | 2 + .../java/vip/mate/wiki/tool/WikiTool.java | 32 + .../mode/AwaitApprovalStepAdapter.java | 71 + .../conversation/ConversationService.java | 87 +- .../conversation/TokenUsageService.java | 12 + .../conversation/model/MessageEntity.java | 9 + .../workspace/conversation/vo/MessageVO.java | 12 + .../conversation/vo/TokenUsageSummaryVO.java | 9 + .../config/ChatUploadAutoConfiguration.java | 48 + .../core/config/ChatUploadProperties.java | 35 + .../service/ChatUploadLocationResolver.java | 239 + .../main/resources/application-kingbase.yml | 8 + .../src/main/resources/application-mysql.yml | 8 + .../main/resources/application-postgres.yml | 8 + .../src/main/resources/application.yml | 56 + .../src/main/resources/db/data-en.sql | 10 + .../main/resources/db/data-kingbase-en.sql | 10 + .../main/resources/db/data-kingbase-zh.sql | 10 + .../src/main/resources/db/data-mysql-en.sql | 10 + .../src/main/resources/db/data-mysql-zh.sql | 10 + .../src/main/resources/db/data-zh.sql | 10 + .../h2/V157__register_session_list_tool.sql | 10 + .../h2/V158__register_session_send_tool.sql | 9 + .../h2/V159__sso_external_identity.sql | 79 + .../h2/V160__register_local_tools.sql | 17 + .../V161__agent_provider_preference_model.sql | 21 + .../h2/V162__wiki_raw_material_error_code.sql | 9 + .../h2/V163__wiki_raw_material_warning.sql | 10 + .../db/migration/h2/V164__kb_open_api_key.sql | 30 + ...iki_transformation_starter_pack_global.sql | 14 + .../h2/V166__message_usage_detail.sql | 6 + .../V157__register_session_list_tool.sql | 10 + .../V158__register_session_send_tool.sql | 9 + .../kingbase/V159__sso_external_identity.sql | 37 + .../kingbase/V160__register_local_tools.sql | 17 + .../V161__agent_provider_preference_model.sql | 21 + .../V162__wiki_raw_material_error_code.sql | 17 + .../V163__wiki_raw_material_warning.sql | 27 + .../kingbase/V164__kb_open_api_key.sql | 30 + ...iki_transformation_starter_pack_global.sql | 14 + .../kingbase/V166__message_usage_detail.sql | 6 + .../V157__register_session_list_tool.sql | 10 + .../V158__register_session_send_tool.sql | 9 + .../mysql/V159__sso_external_identity.sql | 39 + .../mysql/V160__register_local_tools.sql | 17 + .../V161__agent_provider_preference_model.sql | 46 + .../V162__wiki_raw_material_error_code.sql | 12 + .../mysql/V163__wiki_raw_material_warning.sql | 16 + .../migration/mysql/V164__kb_open_api_key.sql | 36 + ...iki_transformation_starter_pack_global.sql | 14 + .../mysql/V166__message_usage_detail.sql | 15 + .../src/main/resources/docs/en/api.md | 327 ++ .../src/main/resources/docs/en/chat.md | 17 +- .../src/main/resources/docs/en/desktop.md | 22 + .../main/resources/docs/en/docker-deploy.md | 2 +- .../src/main/resources/docs/en/faq.md | 6 +- .../src/main/resources/docs/en/index.md | 2 +- .../src/main/resources/docs/en/mcp.md | 142 + .../src/main/resources/docs/en/models.md | 10 +- .../src/main/resources/docs/en/openapi.md | 80 + .../resources/docs/en/operational-export.md | 77 + .../src/main/resources/docs/en/quickstart.md | 4 +- .../src/main/resources/docs/en/releases.md | 1 + .../src/main/resources/docs/en/roadmap.md | 193 +- .../src/main/resources/docs/en/security.md | 47 +- .../src/main/resources/docs/en/skills.md | 4 +- .../src/main/resources/docs/en/user-guide.md | 2 +- .../src/main/resources/docs/en/webchat.md | 29 +- .../main/resources/docs/en/wecom-tuning.md | 2 +- .../src/main/resources/docs/en/wiki.md | 52 +- .../src/main/resources/docs/en/workflow.md | 6 + .../src/main/resources/docs/en/workspaces.md | 2 +- .../src/main/resources/docs/zh/api.md | 327 ++ .../src/main/resources/docs/zh/chat.md | 17 +- .../src/main/resources/docs/zh/desktop.md | 22 + .../main/resources/docs/zh/docker-deploy.md | 2 +- .../src/main/resources/docs/zh/faq.md | 6 +- .../src/main/resources/docs/zh/index.md | 2 +- .../src/main/resources/docs/zh/mcp.md | 113 + .../src/main/resources/docs/zh/models.md | 10 +- .../src/main/resources/docs/zh/openapi.md | 80 + .../resources/docs/zh/operational-export.md | 77 + .../src/main/resources/docs/zh/quickstart.md | 4 +- .../src/main/resources/docs/zh/releases.md | 1 + .../src/main/resources/docs/zh/roadmap.md | 191 +- .../src/main/resources/docs/zh/security.md | 46 +- .../src/main/resources/docs/zh/skills.md | 4 +- .../src/main/resources/docs/zh/user-guide.md | 2 +- .../src/main/resources/docs/zh/webchat.md | 29 +- .../main/resources/docs/zh/wecom-tuning.md | 2 +- .../src/main/resources/docs/zh/wiki.md | 52 +- .../src/main/resources/docs/zh/workflow.md | 6 + .../src/main/resources/docs/zh/workspaces.md | 2 +- .../prompts/memory/summarize-system.txt | 2 +- .../prompts/skill/consolidate-system.txt | 19 + .../prompts/skill/consolidate-user.txt | 6 + .../prompts/skill/reflect-system.txt | 21 + .../resources/prompts/skill/reflect-user.txt | 10 + .../vip/mate/ApplicationContextSmokeTest.java | 25 + .../AgentGraphBuilderPreferenceTest.java | 104 +- .../AgentBindingMcpRemovalE2ETest.java | 90 + .../AgentBindingMcpRemovalListenerTest.java | 47 + .../context/ChatOriginSenderFieldsTest.java | 4 +- .../mate/agent/context/ChatOriginTest.java | 4 +- ...dowManagerSpillMarkerPreservationTest.java | 9 +- .../InformativeClearedPlaceholderTest.java | 46 + .../context/PrefixBudgetPlannerTest.java | 145 + .../RuntimeContextInjectorModelTest.java | 2 +- .../RuntimeContextInjectorSenderTest.java | 6 +- .../delegation/SubagentRunContextTest.java | 94 + ...deStreamingChatHelperToolCallArgsTest.java | 44 + .../node/ReasoningNodeOutputClampTest.java | 56 + .../node/ReasoningNodePtlPromptTest.java | 7 +- .../node/PlanGenerationDisplayGoalTest.java | 76 + .../ApprovalReplayContinuityTest.java | 2 +- .../WorkflowApprovalResumeBridgeTest.java | 168 + .../mate/auth/sso/SsoStateServiceTest.java | 194 + .../channel/ChannelManagerReconcileTest.java | 3 +- .../cards/FeishuCardDispatcherTest.java | 2 + .../web/ChatControllerUploadPathTest.java | 57 + .../WebChatApprovalInteractionTest.java | 223 + .../webchat/WebChatFileServiceTest.java | 6 +- .../tool_guard/ToolGuardCardHandlerTest.java | 68 +- .../mate/common/net/SsrfAllowlistTest.java | 56 + .../mate/config/OpenApiExposedAccessTest.java | 37 + .../config/OpenApiLockedDownAccessTest.java | 59 + .../cron/service/CronJobRunnerPromptTest.java | 2 +- .../action/HttpActionSsrfAllowlistTest.java | 53 + .../kbopen/auth/KbApiKeyRateLimiterTest.java | 66 + .../mate/kbopen/auth/KbApiKeyServiceTest.java | 234 + .../kbopen/auth/KbOpenApiAuthFilterTest.java | 127 + .../controller/KbOpenApiControllerTest.java | 102 + .../KbResearchSessionRegistryTest.java | 259 ++ .../llm/cache/CacheUsageExtractorTest.java | 82 + .../probe/ContextLimitErrorParserTest.java | 62 + .../probe/ModelContextWindowResolverTest.java | 135 + .../probe/OllamaContextProbeParseTest.java | 52 + ...OpenAiCompatibleContextProbeParseTest.java | 70 + .../ProviderRouterSelectPrimaryTest.java | 113 +- .../service/ModelCapabilityServiceTest.java | 27 +- .../mate/memory/MemoryManagerBudgetTest.java | 96 + .../search/SessionSearchIsolationTest.java | 98 + .../MemoryRecallFilenameTruncationTest.java | 111 + .../plugin/PluginContextImplSearchTest.java | 103 + .../plugin/PluginManagerSearchLookupTest.java | 112 + .../plugin/PluginManagerUpdateConfigTest.java | 184 + .../plugin/bridge/PluginSearchBridgeTest.java | 167 + .../skill/installer/ZipSkillFetcherTest.java | 34 + .../SkillConsolidationServiceTest.java | 179 + .../skill/lifecycle/SkillCuratorJobTest.java | 4 +- .../SkillReflectionServiceTest.java | 173 + .../service/SystemSettingBoolApiTest.java | 7 +- .../SystemSettingServiceCatalogTest.java | 150 + .../browser/BrowserLauncherManualProbe.java | 3 +- .../tool/browser/BrowserPropertiesTest.java | 92 + .../tool/browser/UrlSafetyCheckerTest.java | 266 ++ .../tool/builtin/CodeExecuteToolArgsTest.java | 2 +- .../builtin/CodeExecuteToolArtifactTest.java | 51 + .../DelegateAgentToolDenyListTest.java | 3 +- .../tool/builtin/DelegateAgentToolTest.java | 176 +- ...elegateAsyncTaskOutputAttributionTest.java | 5 +- .../tool/builtin/DelegateAsyncToolTest.java | 5 +- .../builtin/DelegateEventSequenceTest.java | 29 +- .../tool/builtin/SessionListToolTest.java | 136 + .../tool/builtin/SessionSendToolTest.java | 147 + .../builtin/SkillManageToolWriteFileTest.java | 115 + .../disclosure/ToolDisclosureServiceTest.java | 104 +- .../GeneratedFileCacheLinkifyTest.java | 98 + .../WorkspaceArtifactSurfacerTest.java | 92 + .../guard/WorkspacePathGuardSandboxTest.java | 56 + .../guard/WorkspacePathGuardShellTest.java | 11 + .../WorkspaceBoundaryGuardianTest.java | 73 +- .../tool/image/ImageFileDownloaderTest.java | 3 +- .../tool/image/ImageReferenceLoaderTest.java | 3 +- .../IdentityForwardingToolCallbackTest.java | 72 + .../runtime/McpClientManagerSnapshotTest.java | 3 +- .../McpIdentityForwardServiceTest.java | 308 ++ .../SearchProviderRegistryPluginTest.java | 224 + .../WikiEntityControllerIdorTest.java | 102 + .../WikiRelationControllerIdorTest.java | 299 ++ .../strategy/WikiLightModelStrategyTest.java | 77 + .../WikiPageTypeDefStageInstructionsTest.java | 56 + .../WikiRawMaterialFailuresMapperE2ETest.java | 95 + .../service/WikiContextServiceBudgetTest.java | 87 + .../WikiProcessingServiceErrorCodeTest.java | 139 + .../WikiProcessingServiceLazyTest.java | 6 +- .../WikiRawMaterialFailureStateTest.java | 100 + ...ransformationStarterPackGlobalE2ETest.java | 131 + .../runtime/AwaitApprovalNotifyTest.java | 157 + ...sationServiceCleanAttachmentFilesTest.java | 15 + .../ChatUploadLocationResolverTest.java | 203 + ...ChatUploadLocationResolverTestSupport.java | 47 + mateclaw-ui/package.json | 2 +- mateclaw-ui/src/api/index.ts | 73 +- .../src/components/agents/PlanBoard.vue | 97 +- .../src/components/agents/PlanDetailPanel.vue | 19 +- .../src/components/chat/ContentSegment.vue | 11 +- .../components/chat/DelegationNodeView.vue | 12 + .../src/components/chat/MessageBubble.vue | 297 +- .../src/components/chat/MessageList.vue | 184 +- .../src/components/chat/RunOverviewPanel.vue | 427 ++ .../dashboard/OperationalExport.vue | 452 ++ .../useSearchProviderCatalog.test.ts | 99 + mateclaw-ui/src/composables/chat/useChat.ts | 88 +- .../src/composables/chat/useMessages.ts | 1 - .../src/composables/chat/useStickToBottom.ts | 17 +- mateclaw-ui/src/composables/chat/useStream.ts | 2 +- mateclaw-ui/src/composables/chat/useTyping.ts | 2 +- .../src/composables/useNotificationCenter.ts | 3 + .../composables/useSearchProviderCatalog.ts | 84 + mateclaw-ui/src/i18n/locales/en-US.ts | 125 +- mateclaw-ui/src/i18n/locales/zh-CN.ts | 125 +- mateclaw-ui/src/stores/useGoalStore.ts | 10 + mateclaw-ui/src/stores/useWikiStore.ts | 8 + mateclaw-ui/src/types/index.ts | 37 + mateclaw-ui/src/types/tokenUsage.ts | 3 + .../__tests__/generatedFileLinks.test.ts | 56 + mateclaw-ui/src/utils/generatedFileLinks.ts | 44 + mateclaw-ui/src/views/Agents.vue | 95 +- mateclaw-ui/src/views/ChatConsole.vue | 79 +- mateclaw-ui/src/views/Dashboard.vue | 113 +- mateclaw-ui/src/views/Docs/index.vue | 227 +- mateclaw-ui/src/views/Login.vue | 246 +- mateclaw-ui/src/views/Plugins.vue | 175 +- .../Models/modals/ManageModelsModal.vue | 15 +- .../src/views/Settings/SkillCurator/index.vue | 34 +- .../src/views/Settings/System/index.vue | 280 +- mateclaw-ui/src/views/TokenUsage.vue | 12 + mateclaw-ui/src/views/Tools.vue | 8 +- .../views/Wiki/components/GraphNodeSearch.vue | 222 + .../Wiki/components/RawMaterialPanel.vue | 67 +- .../Wiki/components/WikiEntityGraphView.vue | 40 +- .../Wiki/components/WikiFailureCenter.vue | 97 + .../views/Wiki/components/WikiGraphView.vue | 51 +- .../views/Wiki/components/WikiWorkspace.vue | 11 +- mateclaw-ui/src/views/Wiki/index.vue | 17 +- mateclaw-ui/src/views/layout/MainLayout.vue | 9 +- pom.xml | 3 +- 474 files changed, 37224 insertions(+), 1283 deletions(-) create mode 100644 mateclaw-desktop/.env.example create mode 100644 mateclaw-desktop/.gitignore create mode 100644 mateclaw-desktop/CODESIGNING.md create mode 100644 mateclaw-desktop/README.md create mode 100644 mateclaw-desktop/RELEASE_NOTES_v1.0.101.md create mode 100644 mateclaw-desktop/branding.config.json create mode 100644 mateclaw-desktop/build/entitlements.mac.inherit.plist create mode 100644 mateclaw-desktop/build/entitlements.mac.plist create mode 100644 mateclaw-desktop/build/icon.icns create mode 100644 mateclaw-desktop/build/icon.ico create mode 100644 mateclaw-desktop/build/icon.png create mode 100644 mateclaw-desktop/build/icon_256.png create mode 100644 mateclaw-desktop/electron-builder.cjs create mode 100644 mateclaw-desktop/electron/main/config.ts create mode 100644 mateclaw-desktop/electron/main/index.ts create mode 100644 mateclaw-desktop/electron/main/localBridge.ts create mode 100644 mateclaw-desktop/electron/main/localToolsApproval.ts create mode 100644 mateclaw-desktop/electron/main/localToolsConfig.ts create mode 100644 mateclaw-desktop/electron/main/localToolsExecutor.ts create mode 100644 mateclaw-desktop/electron/preload/index.ts create mode 100644 mateclaw-desktop/index.html create mode 100644 mateclaw-desktop/package.json create mode 100644 mateclaw-desktop/pnpm-lock.yaml create mode 100644 mateclaw-desktop/public/logo/mateclaw_logo_s.png create mode 100644 mateclaw-desktop/src/App.vue create mode 100644 mateclaw-desktop/src/env.d.ts create mode 100644 mateclaw-desktop/src/main.ts create mode 100644 mateclaw-desktop/tsconfig.json create mode 100644 mateclaw-desktop/tsconfig.node.json create mode 100644 mateclaw-desktop/tsconfig.node.tsbuildinfo create mode 100644 mateclaw-desktop/vite.config.ts create mode 100644 mateclaw-plugin-api/src/main/java/vip/mate/plugin/api/search/PluginSearchProvider.java create mode 100644 mateclaw-plugin-api/src/main/java/vip/mate/plugin/api/search/PluginSearchQuery.java create mode 100644 mateclaw-plugin-api/src/main/java/vip/mate/plugin/api/search/PluginSearchResult.java create mode 100644 mateclaw-plugin-search-sample/pom.xml create mode 100644 mateclaw-plugin-search-sample/src/main/java/vip/mate/plugin/sample/search/SimpleSearchPlugin.java create mode 100644 mateclaw-plugin-search-sample/src/main/resources/mateclaw-plugin.json create mode 100644 mateclaw-server/src/main/java/vip/mate/agent/binding/service/AgentBindingMcpRemovalListener.java create mode 100644 mateclaw-server/src/main/java/vip/mate/agent/context/PrefixBudgetPlan.java create mode 100644 mateclaw-server/src/main/java/vip/mate/agent/context/PrefixBudgetPlanner.java create mode 100644 mateclaw-server/src/main/java/vip/mate/agent/delegation/DelegatedUsageAccumulator.java create mode 100644 mateclaw-server/src/main/java/vip/mate/agent/delegation/SubagentRunContext.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/SsoAutoConfiguration.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/SsoCallbackResponse.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/SsoController.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/SsoProperties.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/SsoService.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/SsoStateService.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/model/ExternalIdentityEntity.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/model/SsoStateEntity.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/provider/FeishuSsoProvider.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/provider/SsoProvider.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/provider/SsoProviderRegistry.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/provider/SsoUserInfo.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/repository/ExternalIdentityMapper.java create mode 100644 mateclaw-server/src/main/java/vip/mate/auth/sso/repository/SsoStateMapper.java create mode 100644 mateclaw-server/src/main/java/vip/mate/cli/ExportCommand.java create mode 100644 mateclaw-server/src/main/java/vip/mate/cli/MateClawCli.java create mode 100644 mateclaw-server/src/main/java/vip/mate/common/net/SsrfAllowlist.java create mode 100644 mateclaw-server/src/main/java/vip/mate/common/net/SsrfProperties.java create mode 100644 mateclaw-server/src/main/java/vip/mate/config/OpenApiConfig.java create mode 100644 mateclaw-server/src/main/java/vip/mate/config/PrefixBudgetProperties.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/auth/KbApiKeyContext.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/auth/KbApiKeyRateLimiter.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/auth/KbApiKeyService.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/auth/KbOpenApiAuthFilter.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/auth/KbScopeInterceptor.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/auth/RequireKbScope.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/auth/TokenHashUtil.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/auth/model/KbApiKeyBindingEntity.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/auth/model/KbApiKeyEntity.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/auth/repository/KbApiKeyBindingMapper.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/auth/repository/KbApiKeyMapper.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/controller/KbApiKeyAdminController.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/controller/KbOpenApiController.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/controller/KbOpenResearchController.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/dto/KbOpenApiDtos.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/research/KbResearchSessionRegistry.java create mode 100644 mateclaw-server/src/main/java/vip/mate/kbopen/service/KbOpenApiService.java create mode 100644 mateclaw-server/src/main/java/vip/mate/llm/probe/ContextLimitErrorParser.java create mode 100644 mateclaw-server/src/main/java/vip/mate/llm/probe/ContextProbeProperties.java create mode 100644 mateclaw-server/src/main/java/vip/mate/llm/probe/LocalContextProbe.java create mode 100644 mateclaw-server/src/main/java/vip/mate/llm/probe/LocalEndpoints.java create mode 100644 mateclaw-server/src/main/java/vip/mate/llm/probe/ModelContextWindowResolver.java create mode 100644 mateclaw-server/src/main/java/vip/mate/llm/probe/OllamaContextProbe.java create mode 100644 mateclaw-server/src/main/java/vip/mate/llm/probe/OpenAiCompatibleContextProbe.java create mode 100644 mateclaw-server/src/main/java/vip/mate/llm/routing/ProviderModelRef.java create mode 100644 mateclaw-server/src/main/java/vip/mate/operational/controller/OperationalDataController.java create mode 100644 mateclaw-server/src/main/java/vip/mate/operational/model/ExportInProgressException.java create mode 100644 mateclaw-server/src/main/java/vip/mate/operational/model/ExportTask.java create mode 100644 mateclaw-server/src/main/java/vip/mate/operational/service/OperationalDataExportService.java create mode 100644 mateclaw-server/src/main/java/vip/mate/plugin/bridge/PluginSearchBridge.java create mode 100644 mateclaw-server/src/main/java/vip/mate/skill/lifecycle/SkillConsolidationService.java create mode 100644 mateclaw-server/src/main/java/vip/mate/skill/reflection/SkillReflectionAutoConfiguration.java create mode 100644 mateclaw-server/src/main/java/vip/mate/skill/reflection/SkillReflectionProperties.java create mode 100644 mateclaw-server/src/main/java/vip/mate/skill/reflection/SkillReflectionService.java create mode 100644 mateclaw-server/src/main/java/vip/mate/system/model/SearchProviderCatalogEntry.java create mode 100644 mateclaw-server/src/main/java/vip/mate/system/model/SearchProviderCatalogResponse.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/builtin/SessionListTool.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/builtin/SessionSendTool.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/disclosure/ToolUsageRecencyTracker.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/document/WorkspaceArtifactSurfacer.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/local/DesktopBridgeController.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/local/DesktopBridgeException.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/local/DesktopBridgeHandshakeInterceptor.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/local/DesktopBridgeRegistry.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/local/DesktopBridgeWebSocketHandler.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/local/LocalFileTools.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/local/LocalShellTool.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/local/LocalToolBridgeService.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/local/LocalToolFormat.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/mcp/event/McpServerRemovedEvent.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/mcp/runtime/IdentityForwardingToolCallback.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/mcp/runtime/McpIdentityForwardProperties.java create mode 100644 mateclaw-server/src/main/java/vip/mate/tool/mcp/runtime/McpIdentityForwardService.java create mode 100644 mateclaw-server/src/main/java/vip/mate/wiki/dto/WikiFailureItem.java create mode 100644 mateclaw-server/src/main/java/vip/mate/wiki/job/strategy/WikiLightModelStrategy.java create mode 100644 mateclaw-server/src/main/java/vip/mate/workspace/core/config/ChatUploadAutoConfiguration.java create mode 100644 mateclaw-server/src/main/java/vip/mate/workspace/core/config/ChatUploadProperties.java create mode 100644 mateclaw-server/src/main/java/vip/mate/workspace/core/service/ChatUploadLocationResolver.java create mode 100644 mateclaw-server/src/main/resources/db/migration/h2/V157__register_session_list_tool.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/h2/V158__register_session_send_tool.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/h2/V159__sso_external_identity.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/h2/V160__register_local_tools.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/h2/V161__agent_provider_preference_model.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/h2/V162__wiki_raw_material_error_code.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/h2/V163__wiki_raw_material_warning.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/h2/V164__kb_open_api_key.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/h2/V165__wiki_transformation_starter_pack_global.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/h2/V166__message_usage_detail.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/kingbase/V157__register_session_list_tool.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/kingbase/V158__register_session_send_tool.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/kingbase/V159__sso_external_identity.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/kingbase/V160__register_local_tools.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/kingbase/V161__agent_provider_preference_model.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/kingbase/V162__wiki_raw_material_error_code.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/kingbase/V163__wiki_raw_material_warning.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/kingbase/V164__kb_open_api_key.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/kingbase/V165__wiki_transformation_starter_pack_global.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/kingbase/V166__message_usage_detail.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/mysql/V157__register_session_list_tool.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/mysql/V158__register_session_send_tool.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/mysql/V159__sso_external_identity.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/mysql/V160__register_local_tools.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/mysql/V161__agent_provider_preference_model.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/mysql/V162__wiki_raw_material_error_code.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/mysql/V163__wiki_raw_material_warning.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/mysql/V164__kb_open_api_key.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/mysql/V165__wiki_transformation_starter_pack_global.sql create mode 100644 mateclaw-server/src/main/resources/db/migration/mysql/V166__message_usage_detail.sql create mode 100644 mateclaw-server/src/main/resources/docs/en/openapi.md create mode 100644 mateclaw-server/src/main/resources/docs/en/operational-export.md create mode 100644 mateclaw-server/src/main/resources/docs/zh/openapi.md create mode 100644 mateclaw-server/src/main/resources/docs/zh/operational-export.md create mode 100644 mateclaw-server/src/main/resources/prompts/skill/consolidate-system.txt create mode 100644 mateclaw-server/src/main/resources/prompts/skill/consolidate-user.txt create mode 100644 mateclaw-server/src/main/resources/prompts/skill/reflect-system.txt create mode 100644 mateclaw-server/src/main/resources/prompts/skill/reflect-user.txt create mode 100644 mateclaw-server/src/test/java/vip/mate/ApplicationContextSmokeTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/agent/binding/service/AgentBindingMcpRemovalE2ETest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/agent/binding/service/AgentBindingMcpRemovalListenerTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/agent/context/InformativeClearedPlaceholderTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/agent/context/PrefixBudgetPlannerTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/agent/delegation/SubagentRunContextTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/agent/graph/node/ReasoningNodeOutputClampTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/agent/graph/plan/node/PlanGenerationDisplayGoalTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/approval/WorkflowApprovalResumeBridgeTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/auth/sso/SsoStateServiceTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/channel/web/ChatControllerUploadPathTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/channel/webchat/WebChatApprovalInteractionTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/common/net/SsrfAllowlistTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/config/OpenApiExposedAccessTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/config/OpenApiLockedDownAccessTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/hook/action/HttpActionSsrfAllowlistTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/kbopen/auth/KbApiKeyRateLimiterTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/kbopen/auth/KbApiKeyServiceTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/kbopen/auth/KbOpenApiAuthFilterTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/kbopen/controller/KbOpenApiControllerTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/kbopen/research/KbResearchSessionRegistryTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/llm/cache/CacheUsageExtractorTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/llm/probe/ContextLimitErrorParserTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/llm/probe/ModelContextWindowResolverTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/llm/probe/OllamaContextProbeParseTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/llm/probe/OpenAiCompatibleContextProbeParseTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/memory/MemoryManagerBudgetTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/memory/search/SessionSearchIsolationTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/memory/service/MemoryRecallFilenameTruncationTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/plugin/PluginContextImplSearchTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/plugin/PluginManagerSearchLookupTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/plugin/PluginManagerUpdateConfigTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/plugin/bridge/PluginSearchBridgeTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/skill/lifecycle/SkillConsolidationServiceTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/skill/reflection/SkillReflectionServiceTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/system/service/SystemSettingServiceCatalogTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/tool/browser/BrowserPropertiesTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/tool/browser/UrlSafetyCheckerTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/tool/builtin/CodeExecuteToolArtifactTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/tool/builtin/SessionListToolTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/tool/builtin/SessionSendToolTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/tool/builtin/SkillManageToolWriteFileTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/tool/document/GeneratedFileCacheLinkifyTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/tool/document/WorkspaceArtifactSurfacerTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/tool/mcp/runtime/IdentityForwardingToolCallbackTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/tool/mcp/runtime/McpIdentityForwardServiceTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/tool/search/SearchProviderRegistryPluginTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/wiki/controller/WikiEntityControllerIdorTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/wiki/controller/WikiRelationControllerIdorTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/wiki/job/strategy/WikiLightModelStrategyTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/wiki/profile/WikiPageTypeDefStageInstructionsTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/wiki/repository/WikiRawMaterialFailuresMapperE2ETest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/wiki/service/WikiContextServiceBudgetTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/wiki/service/WikiProcessingServiceErrorCodeTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/wiki/service/WikiRawMaterialFailureStateTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/wiki/service/WikiTransformationStarterPackGlobalE2ETest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/workflow/runtime/AwaitApprovalNotifyTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/workspace/core/service/ChatUploadLocationResolverTest.java create mode 100644 mateclaw-server/src/test/java/vip/mate/workspace/core/service/ChatUploadLocationResolverTestSupport.java create mode 100644 mateclaw-ui/src/components/chat/RunOverviewPanel.vue create mode 100644 mateclaw-ui/src/components/dashboard/OperationalExport.vue create mode 100644 mateclaw-ui/src/composables/__tests__/useSearchProviderCatalog.test.ts create mode 100644 mateclaw-ui/src/composables/useSearchProviderCatalog.ts create mode 100644 mateclaw-ui/src/utils/__tests__/generatedFileLinks.test.ts create mode 100644 mateclaw-ui/src/utils/generatedFileLinks.ts create mode 100644 mateclaw-ui/src/views/Wiki/components/GraphNodeSearch.vue create mode 100644 mateclaw-ui/src/views/Wiki/components/WikiFailureCenter.vue diff --git a/.env.example b/.env.example index 3983a0dd..1213459f 100644 --- a/.env.example +++ b/.env.example @@ -34,6 +34,11 @@ MATECLAW_CORS_ALLOWED_ORIGINS= # 留空时回退到当前请求的 host,再退回相对路径。反代后部署建议显式设置。 MATECLAW_PUBLIC_BASE_URL= +# 是否公开 Swagger UI / OpenAPI 文档(/swagger-ui.html、/v3/api-docs)。 +# 生产数据库 profile(mysql/kingbase/postgres)默认 false —— 匿名无法浏览全部 +# 端点结构,需全局管理员(ROLE_ADMIN)。仅在内网/预发临时调试时设为 true。 +MATECLAW_OPENAPI_EXPOSE_UI= + # SearXNG 会话密钥(容器内部用,留空会用开发默认值)。生产部署请设成 32+ 位随机串。 # openssl rand -hex 32 SEARXNG_SECRET= @@ -55,6 +60,20 @@ MATECLAW_BROWSER_CDP_URL= MATECLAW_BROWSER_CHROME_PATH= MATECLAW_BROWSER_CHANNEL= +# ==================== 局域网 部署放开(可选,默认 false 严格模式) ==================== +# 浏览器 SSRF 防护:放行本地回环和私有 IP(127.0.0.1 / 10.x / 192.168.x / +# 172.16-31.x / IPv6 fc00::/7 等),公网部署务必保持 false,否则 SSRF 防护失效 +PLAYWRIGHT_ALLOW_PRIVATE_NETWORK=false +# 浏览器忽略 HTTPS 证书错误(自签证书 / IP 直连 HTTPS 场景) +# 公网部署务必保持 false,否则中间人攻击可绕过证书校验 +PLAYWRIGHT_IGNORE_HTTPS_ERRORS=false +# Playwright 单次操作超时(秒),慢链路 / 大页面可调高 +PLAYWRIGHT_DEFAULT_TIMEOUT_SECONDS=30 +# Playwright 导航超时(秒),慢网络可调高 +PLAYWRIGHT_NAVIGATION_TIMEOUT_SECONDS=30 +# snapshot 文本截断长度,超出会返回 truncated:true 提示 LLM 用 selector 缩小范围 +PLAYWRIGHT_SNAPSHOT_MAX_LENGTH=20000 + # ==================== OpenAI OAuth(Docker,可选) ==================== # # OpenAI ChatGPT OAuth 使用 Codex CLI 的 public client + PKCE / device code, diff --git a/.gitignore b/.gitignore index f93f1342..5e5ab1e8 100644 --- a/.gitignore +++ b/.gitignore @@ -105,6 +105,9 @@ CLAUDE.md # Codex CLI local artifacts .codex/ +# Codebase memory (local agent index / graph artifact; do not commit) +.codebase-memory/ + # Sync tooling local state (generated each run; report is intentionally tracked) scripts/.*-sync-state.json diff --git a/README.md b/README.md index 3d338c90..524afd5c 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@
Agent Harness · Spring Boot inside · One JAR to ship
-[](https://github.com/matevip/mateclaw) +[](https://github.com/mateaix/mateclaw) [](https://claw.mate.vip/docs) [](https://claw-demo.mate.vip) [](https://claw.mate.vip) [](https://adoptium.net/) [](https://spring.io/projects/spring-boot) [](https://vuejs.org/) -[](https://github.com/matevip/mateclaw) +[](https://github.com/mateaix/mateclaw) [](LICENSE) [[Website](https://claw.mate.vip)] [[Live Demo](https://claw-demo.mate.vip)] [[Documentation](https://claw.mate.vip/docs)] [[中文](README_zh.md)] @@ -161,7 +161,7 @@ docker compose up -d # http://localhost:18080 ### Desktop -Download from [GitHub Releases](https://github.com/matevip/mateclaw/releases). Bundles JRE 21. No Java install needed. +Download from [GitHub Releases](https://github.com/mateaix/mateclaw/releases). Bundles JRE 21. No Java install needed. --- @@ -193,7 +193,7 @@ mateclaw/ └── .env.example ``` -Desktop binaries ship via [GitHub Releases](https://github.com/matevip/mateclaw/releases) with a bundled JRE 21 — no Java install needed. +Desktop binaries ship via [GitHub Releases](https://github.com/mateaix/mateclaw/releases) with a bundled JRE 21 — no Java install needed. ## Tech stack @@ -217,25 +217,29 @@ Full docs at **[claw.mate.vip/docs](https://claw.mate.vip/docs)** — setup, arc ## Roadmap +**v1.7.0 (shipped 2026-07-04)** — a *productionization pass*: once it's in real collaboration, close every loop you can't see, gather, reach, fit, or connect: + +- **All three approval paths close the loop** — workflow `await_approval` actually pushes to channels and resolves → resumes, the WebChat (API-key) channel can approve/deny and replay, and Feishu/WeCom card clicks resolve workflow approvals directly +- **Long tasks are visible** — an always-on Run Overview rail + a per-turn token breakdown (cache hit/miss/write + reasoning split) + sub-agent cost rolled up + one-click generated-file download +- **Fits the real model window** — local-model context-window probing, a unified token budget for prefix injection, small-context degradation, and tool-schema budget gating — no more "guess 32K" pre-flight rejections or silent truncation +- **Opens up** — a knowledge-base + Deep Research open API (API-key + rate limit + SSE), a pluggable search Provider SPI, and MCP identity forwarding (carry the authenticated user's identity into a STDIO MCP) +- **Reaches further** — desktop local-embedded / remote-centralized dual mode (with `mateclaw-desktop` source opened) + a LAN deployment mode for controlled intranet access +- **One-click operational data export** — Dashboard 9-sheet Excel + a CLI for offline export + +Full story in the [v1.7.0 release notes](https://claw.mate.vip/docs/en/releases/1.7.0). + +**v1.6.0 (shipped 2026-06-22)** — make the autonomous employee *fast, sharp-eyed, and embeddable*: two-stage skill loading + prefix compression (faster first token) · `execute_code` native sandboxed code execution · vision that persists across turns + `image_analyze` · embeddable/headless webchat with per-`endUserId` memory · a Wiki you actually read (reading split from management · unified Sources tab · clickable `[[wikilinks]]`) · steadier under load (self-healing MCP · tool-call recovery · evidence-gated plans). Full story in the [v1.6.0 release notes](https://claw.mate.vip/docs/en/releases/1.6.0). + **v1.5.0 (shipped 2026-06-04)** — Goal checklists (fuzzy score → ticked boxes) · self-maintaining Wiki (`[[wikilinks]]` · fact/experience layers · pageType profiles & permissions · KB pipelines · local-directory ingest) · per-owner memory isolation (`owner_key` + visibility scope + `endUserId` passthrough) · per-agent primary knowledge base · provider-preference model routing. Full story in the [v1.5.0 release notes](https://claw.mate.vip/docs/en/releases/1.5.0). **v1.4.0 (shipped 2026-05-23)** — Persistent Goals (lock a goal, self-evaluate every turn) · subagent delegation tree (3 levels deep · sync / parallel / async · one-sentence team builder) · progressive tool/skill disclosure · Workspace RBAC (Owner / Admin / Member / Viewer) · Feishu first-class (interactive / approval / streaming cards · channel-native tools). See the [v1.4.0 release notes](https://claw.mate.vip/docs/en/releases/1.4.0). **v1.3.0 (shipped 2026-05-13)** — Workflow engine · 6-pattern trigger system · Wiki transformations · per-agent MCP binding · multimodal sidecar routing · four JVM-native document-generation tools · image edit. See the [v1.3.0 release notes](https://claw.mate.vip/docs/en/releases/1.3.0). -**v1.6.0 (in progress)** — make the autonomous employee *fast, sharp-eyed, and embeddable*: - -- **Faster first token** — two-stage skill loading (base skills resident, scenario skills retrieved on demand by a relevance scorer) plus prefix compression, cutting the cold-start payload that used to blow past a million characters -- **Native code execution** — `execute_code` lets an employee write and run sandboxed code to compute, transform data, and assemble multi-format reports, all JVM-side -- **Vision that persists** — images stay in context across turns; `image_analyze` re-reads an attachment on demand, so "zoom into that chart" follow-ups work without re-uploading -- **Embeddable & headless** — the webchat widget becomes a Web/API surface with multi-session support and per-end-user identity (`endUserId`), isolating memory per end user -- **A Wiki you actually read** — reading split from management, a unified Sources tab with per-KB auto-sync, and clickable cross-KB `[[wikilinks]]` -- **Steadier under load** — self-healing MCP connections · tool-call recovery on interleaved-thinking models · evidence-gated plan execution - ## Contributing ```bash -git clone https://github.com/matevip/mateclaw.git +git clone https://github.com/mateaix/mateclaw.git cd mateclaw cd mateclaw-server && mvn clean compile cd ../mateclaw-ui && pnpm install && pnpm dev diff --git a/README_zh.md b/README_zh.md index dae024a8..a23506d5 100644 --- a/README_zh.md +++ b/README_zh.md @@ -10,14 +10,14 @@Agent Harness · Spring Boot 内核 · 一个 JAR 交付
-[](https://github.com/matevip/mateclaw) +[](https://github.com/mateaix/mateclaw) [](https://claw.mate.vip/docs) [](https://claw-demo.mate.vip) [](https://claw.mate.vip) [](https://adoptium.net/) [](https://spring.io/projects/spring-boot) [](https://vuejs.org/) -[](https://github.com/matevip/mateclaw) +[](https://github.com/mateaix/mateclaw) [](LICENSE) [[官网](https://claw.mate.vip)] [[在线演示](https://claw-demo.mate.vip)] [[文档](https://claw.mate.vip/docs)] [[English](README.md)] @@ -161,7 +161,7 @@ docker compose up -d # http://localhost:18080 ### 桌面端 -从 [GitHub Releases](https://github.com/matevip/mateclaw/releases) 下载安装包。内嵌 JRE 21,无需额外装 Java。 +从 [GitHub Releases](https://github.com/mateaix/mateclaw/releases) 下载安装包。内嵌 JRE 21,无需额外装 Java。 --- @@ -193,7 +193,7 @@ mateclaw/ └── .env.example ``` -桌面端安装包通过 [GitHub Releases](https://github.com/matevip/mateclaw/releases) 分发,内嵌 JRE 21——无需安装 Java。 +桌面端安装包通过 [GitHub Releases](https://github.com/mateaix/mateclaw/releases) 分发,内嵌 JRE 21——无需安装 Java。 ## 技术栈 @@ -217,25 +217,29 @@ mateclaw/ ## 路线图 +**v1.7.0(2026-07-04 发布)** — 一次*生产化加固*:把它放进真正的协作里之后,那些看不见、收不拢、够不着、装不下、连不通的地方全补上: + +- **审批三条链路彻底闭环** — 工作流 `await_approval` 真的推到渠道并 resolve→恢复执行、WebChat(API-Key)渠道能批准/拒绝并重放、飞书/企微点卡片直接 resolve 工作流审批 +- **长任务看得见** — 常驻「运行总览」侧栏 + 本轮 Token 明细(缓存命中/未命中/写入 + 推理拆分)+ 子 Agent 成本向上滚加 + 生成文件一键下载 +- **装得下真实模型窗口** — 本地模型上下文窗口探测、prefix 注入统一 Token 预算、小上下文降级、工具 schema 预算门——不再被"猜个 32K"坑到预检拒绝或悄悄截断 +- **开放出去** — 知识库 / Deep Research 开放 API(API-Key + 限流 + SSE)、插件化搜索 Provider SPI、MCP 身份透传(把认证用户身份带给 STDIO MCP) +- **够得着更远** — 桌面端本地内嵌 / 远程集中部署双模式(`mateclaw-desktop` 源码开放)+ 局域网部署模式放开受控内网访问 +- **运营数据一键导出** — Dashboard 9 表 Excel + CLI 命令行离线导出 + +完整故事见 [v1.7.0 release notes](https://claw.mate.vip/docs/zh/releases/1.7.0)。 + +**v1.6.0(2026-06-22 发布)** — 让自驱的数字员工*更快、更会看、更易嵌入*:技能两段式载入 + prefix 压缩(首字节更快)· `execute_code` 原生沙箱代码执行 · 图片跨轮次留存 + `image_analyze` · 可嵌入/无头 webchat 按 `endUserId` 隔离记忆 · 真正可读的 Wiki(阅读与管理分离 · 统一 Sources 标签 · 可点击 `[[wikilinks]]`)· 高负载更稳(MCP 自愈 · 工具调用恢复 · 计划证据闸门)。完整故事见 [v1.6.0 release notes](https://claw.mate.vip/docs/zh/releases/1.6.0)。 + **v1.5.0(2026-06-04 发布)** — Goal 可勾选清单(模糊评分 → 逐项打勾)· Wiki 自维护(`[[wikilinks]]` · 事实层/经验层 · pageType 模板与权限 · 知识库流水线 · 本地目录接入)· 按拥有者隔离记忆(`owner_key` + 可见域 + `endUserId` 透传)· 每员工绑定主知识库 · 偏好 provider 驱动选型。完整故事见 [v1.5.0 release notes](https://claw.mate.vip/docs/zh/releases/1.5.0)。 **v1.4.0(2026-05-23 发布)** — 持续目标(锁定目标,每轮自评)· 子员工委派树(最深 3 层 · 同步 / 并行 / 异步 · 一句话组队)· 工具/技能渐进式披露 · 工作空间 RBAC(Owner / Admin / Member / Viewer)· 飞书一等公民(交互卡 / 审批卡 / 流式卡 · 渠道原生工具)。详见 [v1.4.0 release notes](https://claw.mate.vip/docs/zh/releases/1.4.0)。 **v1.3.0(2026-05-13 发布)** — 工作流引擎 · 6 种 pattern 触发器 · Wiki 加工器 · 每员工独立 MCP 绑定 · 多模态旁路路由 · 4 个 JVM 原生文档生成工具 · 图像编辑。详见 [v1.3.0 release notes](https://claw.mate.vip/docs/zh/releases/1.3.0)。 -**v1.6.0(开发中)** — 让自驱的数字员工*更快、更会看、更易嵌入*: - -- **首字节更快** — 技能两段式载入(基础技能常驻,场景技能由相关性评分器按需检索)+ prefix 压缩,砍掉过去单请求动辄上百万字符的冷启动负载 -- **原生代码执行** — `execute_code` 让员工自己写、自己跑沙箱代码,完成计算、数据加工与多格式报告生成,全程在 JVM 内 -- **能记住图的视觉** — 图片跨轮次保留在上下文里;`image_analyze` 按需重新解析某张附件,"放大看那张图表"这类追问无需重新上传 -- **可嵌入、可无头** — webchat 组件升级为 Web/API 接入面,支持多会话与按终端用户身份(`endUserId`)隔离记忆 -- **真正可读的 Wiki** — 阅读与管理分离、统一的 Sources 标签页(按知识库自动同步)、可点击的跨库 `[[wikilinks]]` -- **高负载更稳** — MCP 连接自愈 · interleaved-thinking 模型的工具调用恢复 · 计划执行的证据闸门 - ## 参与贡献 ```bash -git clone https://github.com/matevip/mateclaw.git +git clone https://github.com/mateaix/mateclaw.git cd mateclaw cd mateclaw-server && mvn clean compile cd ../mateclaw-ui && pnpm install && pnpm dev diff --git a/docker-compose.yml b/docker-compose.yml index 36fe8052..66fbab91 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -92,6 +92,30 @@ services: MATECLAW_BROWSER_CDP_URL: ${MATECLAW_BROWSER_CDP_URL:-} MATECLAW_BROWSER_CHROME_PATH: ${MATECLAW_BROWSER_CHROME_PATH:-} MATECLAW_BROWSER_CHANNEL: ${MATECLAW_BROWSER_CHANNEL:-} + # SSRF / TLS relaxations for isolated LAN / on-prem deployments. + # Both default to false (strict mode, public-internet safe). + # The .env file uses the PLAYWRIGHT_* prefix (component-oriented naming, + # not product-oriented) — here we translate to the MATECLAW_BROWSER_* + # container env that Spring Boot relaxed-binding maps to BrowserProperties. + # - PLAYWRIGHT_ALLOW_PRIVATE_NETWORK=true: allow loopback / private / link-local + # addresses through the browser SSRF guard. Cloud-metadata endpoints stay + # blocked. Turn on when the agent must drive http://192.168.x.x:port style + # internal services and has no path to the public internet. + # - PLAYWRIGHT_IGNORE_HTTPS_ERRORS=true: ignore HTTPS certificate errors. + # Auto-enables --ignore-certificate-errors at the Chromium command line + # when ALLOW_PRIVATE_NETWORK is also true (so CDP-attached external + # browsers benefit too). Leave false on internet-facing deployments. + MATECLAW_BROWSER_ALLOW_PRIVATE_NETWORK: ${PLAYWRIGHT_ALLOW_PRIVATE_NETWORK:-false} + MATECLAW_BROWSER_IGNORE_HTTPS_ERRORS: ${PLAYWRIGHT_IGNORE_HTTPS_ERRORS:-false} + # Playwright action / navigation timeouts (seconds). Increase for slow + # LAN or large-page scenarios. Defaults match Playwright's own (30s). + MATECLAW_BROWSER_DEFAULT_TIMEOUT_SECONDS: ${PLAYWRIGHT_DEFAULT_TIMEOUT_SECONDS:-30} + MATECLAW_BROWSER_DEFAULT_NAVIGATION_TIMEOUT_SECONDS: ${PLAYWRIGHT_NAVIGATION_TIMEOUT_SECONDS:-30} + # Hard cap on the textual snapshot returned by action=snapshot. Content + # beyond this length is dropped with a truncated:true flag and a hint to + # retry with selector. Results > framework spill threshold (~8000 chars) + # are further spilt to disk by ToolResultStorage. + MATECLAW_BROWSER_SNAPSHOT_MAX_LENGTH: ${PLAYWRIGHT_SNAPSHOT_MAX_LENGTH:-20000} # OAuth 模式默认保持 auto:localhost 访问走 LOCAL,IP/域名访问走 DEVICE_CODE。 # 本机 Docker 若要强制使用 localhost:1455 回调,可在 .env 显式设为 local。 MATECLAW_OAUTH_OPENAI_DEPLOYMENT_MODE: ${MATECLAW_OAUTH_OPENAI_DEPLOYMENT_MODE:-} diff --git a/mateclaw-desktop/.env.example b/mateclaw-desktop/.env.example new file mode 100644 index 00000000..5ba7a3ec --- /dev/null +++ b/mateclaw-desktop/.env.example @@ -0,0 +1,15 @@ +# macOS 代码签名与公证 +# 本地构建推荐不设 CSC_LINK,让 electron-builder 自动从钥匙串发现证书 +# CSC_LINK=/path/to/developer_id_application.p12 # CI/CD 专用 +# CSC_KEY_PASSWORD= # CI/CD 专用 + +APPLE_ID=your@apple.id +APPLE_APP_SPECIFIC_PASSWORD=xxxx-xxxx-xxxx-xxxx +APPLE_TEAM_ID=XXXXXXXXXX + +# GitHub Releases 发布 +GH_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + +# Windows 代码签名(可选) +# WIN_CSC_LINK=/path/to/windows-cert.pfx +# WIN_CSC_KEY_PASSWORD= diff --git a/mateclaw-desktop/.gitignore b/mateclaw-desktop/.gitignore new file mode 100644 index 00000000..2f1d662c --- /dev/null +++ b/mateclaw-desktop/.gitignore @@ -0,0 +1,33 @@ +# Dependencies +node_modules/ + +# Build output +dist/ +dist-electron/ +release/ + +# Resources (downloaded/generated, not committed) +resources/jre/ +resources/app.jar + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS files +.DS_Store +Thumbs.db + +# Logs +*.log +npm-debug.log* + +# Runtime data (H2 database created during dev testing) +data/ + +# Environment +.env +.env.local diff --git a/mateclaw-desktop/CODESIGNING.md b/mateclaw-desktop/CODESIGNING.md new file mode 100644 index 00000000..ced54225 --- /dev/null +++ b/mateclaw-desktop/CODESIGNING.md @@ -0,0 +1,275 @@ +# macOS 代码签名证书操作指南 + +本文档详细说明如何创建、导出和配置 macOS **Developer ID Application** 证书,用于 MateClaw Desktop 的签名与公证。 + +--- + +## 前置条件 + +- [Apple Developer Program](https://developer.apple.com/programs/) 会员($99/年) +- macOS 系统(需要钥匙串访问生成密钥对) + +## Step 1: 撤销旧证书(如有) + +如果本地证书已过期或私钥丢失,需先撤销线上旧证书: + +1. 登录 https://developer.apple.com/account/resources/certificates/list +2. 找到旧的 `Developer ID Application` 证书 → 点击进入详情 +3. 点击 **Revoke** → 确认撤销 +4. 回到本地 **钥匙串访问** → 删除过期证书(右键 → 删除) + +## Step 2: 生成 CSR(证书签名请求) + +CSR 会在本地生成密钥对(私钥留在钥匙串,公钥随 CSR 提交给 Apple)。 + +1. 打开 **钥匙串访问** +2. 菜单栏 → 钥匙串访问 → **证书助理** → **从证书颁发机构请求证书…** +3. 填写: + - **用户电子邮件地址**:你的 Apple ID 邮箱 + - **常用名称**:与开发者账号一致(如 `ZHANFU XU`) + - **CA 电子邮件地址**:留空 + - **请求是**:选择 **存储到磁盘** +4. 保存 `CertificateSigningRequest.certSigningRequest` 到桌面 + +## Step 3: 创建 Developer ID Application 证书 + +1. 访问 https://developer.apple.com/account/resources/certificates/add +2. 在 **Software** 分类下,选择 **Developer ID Application** +3. 点击 **Continue** +4. 上传 Step 2 保存的 CSR 文件 +5. 点击 **Continue** → **Download** 下载 `developerID_application.cer` +6. **双击**下载的 `.cer` 文件 → 自动安装到钥匙串 + +## Step 4: 验证安装 + +```bash +security find-identity -v -p codesigning | grep "Developer ID Application" +``` + +应输出类似: + +``` +"Developer ID Application: ZHANFU XU (MR97WAD978)" +``` + +在钥匙串访问 → 登录 → **我的证书**中,展开该证书应能看到关联的**私钥**(左侧三角展开)。 + +## Step 5: 导出 .p12 文件 + +`.p12` 文件包含证书 + 私钥,是 `electron-builder` 签名所需的文件。 + +1. 钥匙串访问 → 登录 → **我的证书** +2. 找到 `Developer ID Application: Your Name (TEAMID)` +3. 点左侧三角**展开**,确认包含私钥 +4. **右键证书**(不是私钥)→ **导出…** +5. 格式选择:**个人信息交换 (.p12)** +6. 保存为 `developer_id_application.p12` +7. 设置一个强密码(后续用作 `CSC_KEY_PASSWORD` 环境变量) + +> **安全提醒**:`.p12` 文件包含私钥,绝不要提交到 Git 仓库。 + +## Step 6: 创建 App 专用密码(公证用) + +Apple 公证(notarization)需要通过 Apple ID 验证身份,使用 App 专用密码代替账号密码。 + +1. 访问 https://appleid.apple.com/account/manage +2. 登录 → **登录与安全** → **App 专用密码** → **生成** +3. 标签填:`mateclaw-notarize` +4. 记录生成的密码(格式如 `xxxx-xxxx-xxxx-xxxx`) + +## Step 7: 查找 Team ID + +```bash +security find-identity -v -p codesigning | grep "Developer ID Application" +``` + +输出中括号内的 10 位字母数字即为 Team ID(如 `MR97WAD978`)。 + +## Step 8: 配置环境变量并构建 + +### 方式 A:本地钥匙串自动发现(推荐) + +证书已安装到本地钥匙串时,**不需要设置 `CSC_LINK` 和 `CSC_KEY_PASSWORD`**,electron-builder 会自动从钥匙串中发现 Developer ID Application 证书。 + +```bash +cd mateclaw-desktop + +# 只需设置公证相关变量 +export APPLE_ID="your@apple.id" +export APPLE_APP_SPECIFIC_PASSWORD="xxxx-xxxx-xxxx-xxxx" +export APPLE_TEAM_ID="XXXXXXXXXX" + +# 执行签名+公证构建 +bash scripts/build-all-platforms.sh --mac-only +``` + +> **为什么推荐这种方式?** 设置 `CSC_LINK` 时,electron-builder 会创建一个临时钥匙串来导入 `.p12` 文件,这可能导致签名过程静默卡死(无报错)。直接使用本地钥匙串可以避免此问题。 + +### 方式 B:指定 .p12 文件(CI/CD 专用) + +在 CI/CD 环境或证书不在本地钥匙串时,需要通过环境变量指定 `.p12` 文件: + +```bash +cd mateclaw-desktop + +export CSC_LINK="$HOME/developer_id_application.p12" +export CSC_KEY_PASSWORD="你的p12密码" +export APPLE_ID="your@apple.id" +export APPLE_APP_SPECIFIC_PASSWORD="xxxx-xxxx-xxxx-xxxx" +export APPLE_TEAM_ID="XXXXXXXXXX" + +bash scripts/build-all-platforms.sh --mac-only +``` + +> **注意**:`CSC_KEY_PASSWORD` 中如有特殊字符(`$`、`!`、`"`、`` ` ``),必须用**单引号**包裹,如 `export CSC_KEY_PASSWORD='pa$$w0rd!'`。 + +### GitHub Actions Secrets + +将 `.p12` 文件 Base64 编码后存为 GitHub Secret: + +```bash +base64 -i developer_id_application.p12 | pbcopy +# 粘贴到 GitHub Secret: MAC_CSC_LINK +``` + +| GitHub Secret | 值 | +|---|---| +| `MAC_CSC_LINK` | `.p12` 的 Base64 内容 | +| `MAC_CSC_KEY_PASSWORD` | `.p12` 密码 | +| `APPLE_ID` | Apple ID 邮箱 | +| `APPLE_APP_SPECIFIC_PASSWORD` | App 专用密码 | +| `APPLE_TEAM_ID` | 10 位 Team ID | + +## Step 9: 验证签名和公证 + +构建完成后验证: + +```bash +# 验证代码签名 +codesign --verify --deep --strict release/mac-arm64/MateClaw.app + +# 验证 Gatekeeper 公证状态 +spctl --assess --type execute --verbose release/mac-arm64/MateClaw.app +# 期望输出: accepted, source=Developer ID + +# 验证 DMG +spctl --assess --type open --context context:primary-signature release/MateClaw-*.dmg +``` + +--- + +## 故障排查 + +### 签名卡死(无报错) + +**现象**:构建停在 `signing` 行不动,`ps aux | grep codesign` 无进程或进程短暂出现后消失。 + +**原因**:设置了 `CSC_LINK` 后,electron-builder 会创建临时钥匙串导入 `.p12`,临时钥匙串的访问权限可能导致 `codesign` 静默卡死。 + +**解决**: +```bash +# 方案一(推荐):取消 CSC_LINK,使用本地钥匙串自动发现 +unset CSC_LINK +unset CSC_KEY_PASSWORD + +# 方案二:授权 codesign 访问钥匙串 +security unlock-keychain -p "你的Mac登录密码" ~/Library/Keychains/login.keychain-db +security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "你的Mac登录密码" ~/Library/Keychains/login.keychain-db +``` + +### `Permission denied` (classes.jsa) + +**现象**:`codesign` 报错 `Permission denied`,通常指向 JRE 中的 `classes.jsa` 文件。 + +**原因**:下载的 Adoptium JRE 中部分文件是只读的,`codesign --force` 需要写权限。 + +**解决**:`download-jre.sh` 已在解压后自动执行 `chmod -R u+w`。如果使用旧版 JRE,手动修复: +```bash +# 删除旧 JRE 重新下载(推荐) +rm -rf resources/jre/mac-arm64 resources/jre/mac-x64 +npm run setup:jre + +# 或手动修复权限 +chmod -R u+w resources/jre/ +``` + +### `MAC verification failed` (wrong password) + +**现象**:`SecKeychainItemImport: MAC verification failed during PKCS12 import (wrong password?)` + +**原因**:`CSC_KEY_PASSWORD` 与导出 `.p12` 时设置的密码不匹配。 + +**解决**: +```bash +# 验证密码是否正确 +openssl pkcs12 -in ~/developer_id_application.p12 -nokeys -passin pass:"你的密码" + +# 如果报错 mac verify failure,重新导出 .p12: +# 钥匙串访问 → 我的证书 → 右键 Developer ID Application → 导出 → 重新设置密码 + +# 注意特殊字符需用单引号包裹 +export CSC_KEY_PASSWORD='pa$$w0rd!' +``` + +### 公证上传超时 (deadlineExceeded) + +**现象**:`HTTPClientError.deadlineExceeded`,公证上传到 Apple S3 超时。 + +**原因**:网络到 Apple 服务器不稳定,700MB+ 的应用上传容易超时。 + +**解决**:先跳过公证构建,再用 `xcrun notarytool` 手动公证(支持断点续传,超时容忍度更高): +```bash +# 1. 去掉公证变量,仅签名 +unset APPLE_ID +unset APPLE_APP_SPECIFIC_PASSWORD +unset APPLE_TEAM_ID +bash scripts/build-all-platforms.sh --mac-only + +# 2. 手动公证 +xcrun notarytool submit release/MateClaw_1.0.0_arm64.zip \ + --apple-id "your@apple.id" \ + --password "app专用密码" \ + --team-id "XXXXXXXXXX" \ + --wait + +xcrun notarytool submit release/MateClaw_1.0.0_x64.zip \ + --apple-id "your@apple.id" \ + --password "app专用密码" \ + --team-id "XXXXXXXXXX" \ + --wait + +# 3. 装订公证票据到 DMG +xcrun stapler staple release/MateClaw_1.0.0_arm64.dmg +xcrun stapler staple release/MateClaw_1.0.0_x64.dmg +``` + +--- + +## 常见问题 + +### 证书过期了怎么办? + +Developer ID Application 证书有效期 **5 年**。过期后需重复 Step 1 ~ Step 5 重新创建。Apple 会在自动轮换日期前通过邮件提醒。 + +### 导出 .p12 时没有"导出"选项? + +说明本地钥匙串中没有该证书对应的私钥。私钥只存在于当初生成 CSR 的那台 Mac 上。解决方案: +- **方案 A**:在原 Mac 上导出 `.p12`,再导入到当前 Mac +- **方案 B**:撤销旧证书,在当前 Mac 重新创建(Step 1 ~ Step 5) + +### 签名很慢正常吗? + +正常。700MB+ 的应用(含 JRE + Electron Framework)签名需要 **15~30 分钟**,公证上传+审核需要额外 **5~15 分钟**。可以用以下命令监控签名进度: +```bash +watch -n 2 'ps aux | grep codesign | grep -v grep' +# macOS 需先安装:brew install watch +``` + +### 跳过签名(开发测试用) + +```bash +export CSC_IDENTITY_AUTO_DISCOVERY=false +bash scripts/build-all-platforms.sh --mac-only +``` + +未签名的应用无法使用自动升级功能,macOS 用户需手动下载 DMG 安装。 diff --git a/mateclaw-desktop/README.md b/mateclaw-desktop/README.md new file mode 100644 index 00000000..bbdd697a --- /dev/null +++ b/mateclaw-desktop/README.md @@ -0,0 +1,432 @@ +# MateClaw Desktop + +MateClaw 的桌面客户端,基于 Electron 构建,自动集成 JRE 21 和后端服务,实现双击即用。 + +## 架构 + +``` +Electron Shell +├── Splash Screen (Vue 3) ← 启动加载界面 +├── Bundled JRE 21 ← 自带 Java 运行时 +├── mateclaw-server.jar ← Spring Boot 后端 + Vue 前端 +└── BrowserWindow → localhost:18088 +``` + +**启动流程**: Electron 启动 → 显示 Splash → 用内置 JRE 启动 JAR → 等待后端就绪 → 加载主界面 + +## 快速开始 + +### 前置要求 + +- Node.js 18+ +- pnpm (前端构建) +- Maven 3.9+ (后端构建) +- Java 21+ (仅构建时需要,运行时使用内置 JRE) + +### 开发模式 + +```bash +# 1. 安装依赖 +npm install + +# 2. 构建后端 JAR(包含前端资源) +npm run setup:jar + +# 3. 下载 JRE(当前平台) +npm run setup:jre + +# 4. 启动开发模式 +npm run dev +``` + +### 打包发布 + +```bash +# macOS (.dmg) +npm run package:mac + +# Windows (.exe) +npm run package:win + +# 全平台 +npm run package:all +``` + +输出在 `release/` 目录。 + +## 目录结构 + +``` +mateclaw-desktop/ +├── electron/main/ # Electron 主进程(Java 生命周期管理) +├── electron/preload/ # 预加载脚本(安全 IPC 桥接) +├── src/ # Splash Screen(Vue 3 加载页面) +├── build/ # 应用图标和 macOS entitlements +├── scripts/ # 构建脚本 +│ ├── download-jre.sh # 下载 Adoptium JRE 21 +│ └── build.sh # 构建前端 + 后端 JAR +└── resources/ # 运行时资源(JRE + JAR,不提交到 Git) +``` + +## 环境变量 + +桌面应用**不需要任何环境变量**就能启动——LLM 供应商 Key 在 UI 里加。 + +以下是可选的环境变量(桌面应用会继承系统环境): + +| 变量 | 必须 | 说明 | +|------|------|------| +| `SERPER_API_KEY` | ❌ | Google Serper 搜索 API(搜索工具暂未迁到 UI) | +| `TAVILY_API_KEY` | ❌ | Tavily 搜索 API | + +> 💡 DashScope / OpenAI / Anthropic / DeepSeek / Kimi / Ollama 等 LLM 供应商 Key 启动后在「设置 → 模型 → 添加供应商」里粘进去,加密存到本地 H2 数据库。 + +## 自动升级 + +应用内置 `electron-updater` 自动升级,更新产物托管在 [GitHub Releases](https://github.com/matevip/mateclaw/releases)。 + +**升级流程**:启动时检查 → Splash Screen 底部通知 → 用户点击下载 → 下载完成点击重启 → 自动停止 Java 后端 → 安装新版本 + +| 平台 | 更新包格式 | 元数据文件 | 签名要求 | +|------|-----------|-----------|---------| +| Windows | NSIS `.exe` | `latest.yml` | 可选(不签名会触发 SmartScreen) | +| macOS | `.zip` | `latest-mac.yml` | **必须签名+公证**(否则只能手动 DMG 安装) | + +## 发布操作手册 + +### 第一步:配置 GitHub Token + +`electron-builder` 使用 `github` provider,需要 GitHub Personal Access Token 来创建 Release 并上传产物。 + +1. 前往 https://github.com/settings/tokens → **Generate new token (classic)** +2. 勾选 `repo` 权限(需要完整 repo 访问才能创建 Release) +3. 生成后保存 token + +```bash +# 设置环境变量(建议写入 ~/.zshrc 或 CI Secret) +export GH_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +``` + +### 第二步:版本号管理 + +每次发布前必须更新 `package.json` 中的 `version` 字段。`electron-updater` 客户端通过对比本地版本号和 `latest.yml` 中的版本号来判断是否有更新。 + +```bash +# 编辑版本号 +cd mateclaw-desktop +vim package.json # 修改 "version": "1.0.0" → "1.1.0" +``` + +版本号遵循 [SemVer](https://semver.org/): +- 修复 bug → `1.0.0` → `1.0.1` +- 新功能 → `1.0.0` → `1.1.0` +- 破坏性变更 → `1.0.0` → `2.0.0` + +### 第三步:构建并发布 + +```bash +cd mateclaw-desktop + +# 一键构建全平台 + 自动上传到 GitHub Releases +export GH_TOKEN=ghp_xxxxxxxxxxxx +bash scripts/build-all-platforms.sh --all --publish=always +``` + +这会自动: +1. 构建后端 JAR +2. 下载各平台 JRE +3. 编译前端 +4. 打包 macOS(DMG + ZIP)和 Windows(NSIS) +5. 生成 `latest.yml` 和 `latest-mac.yml` +6. 创建 GitHub Draft Release 并上传所有产物 + +完成后前往 https://github.com/matevip/mateclaw/releases ,找到 Draft Release: +- 填写 Release Notes(更新说明) +- 点击 **Publish release** 正式发布 + +也可以仅构建特定平台: + +```bash +bash scripts/build-all-platforms.sh --mac-only --publish=always # 仅 macOS +bash scripts/build-all-platforms.sh --win-only --publish=always # 仅 Windows +``` + +### 第四步(可选):手动发布 + +如果不想用 `--publish=always` 自动上传: + +```bash +# 1. 仅构建,不上传 +bash scripts/build-all-platforms.sh --all + +# 2. 查看生成的产物 +ls -la release/ +# 产物包括: +# MateClaw_1.1.0_arm64.dmg macOS ARM64 安装包 +# MateClaw_1.1.0_x64.dmg macOS x64 安装包 +# MateClaw_1.1.0_arm64.zip macOS ARM64 更新包(升级用) +# MateClaw_1.1.0_x64.zip macOS x64 更新包(升级用) +# MateClaw_1.1.0_x64_Setup.exe Windows x64 安装包 +# MateClaw_1.1.0_arm64_Setup.exe Windows ARM64 安装包 +# MateClaw_1.1.0_*.blockmap 差分下载支持文件 +# latest.yml Windows 更新元数据 +# latest-mac.yml macOS 更新元数据 + +# 3. 在 GitHub 手动创建 Release +# Tag: v1.1.0 +# 上传 release/ 目录中的所有 .exe .zip .dmg .blockmap .yml 文件 +``` + +> **注意**:`latest.yml` 和 `latest-mac.yml` 必须上传,客户端靠它们检测新版本。 + +--- + +## macOS 代码签名与公证 + +macOS 自动升级**必须**签名+公证,否则 Gatekeeper 会阻止更新后的应用启动。未签名时 macOS 用户只能手动下载 DMG 安装。 + +> **证书创建完整指南**:首次配置或证书过期时,参见 [CODESIGNING.md](./CODESIGNING.md)(含 CSR 生成、证书创建、.p12 导出、公证配置等完整步骤)。 + +### 本地签名构建(推荐) + +证书安装到本地钥匙串后,**不需要设置 `CSC_LINK`**,electron-builder 会自动发现证书: + +```bash +# 只需设置公证相关变量 +export APPLE_ID=your@apple.id +export APPLE_APP_SPECIFIC_PASSWORD=xxxx-xxxx-xxxx-xxxx # 在 appleid.apple.com 生成 +export APPLE_TEAM_ID=XXXXXXXXXX # 10 位团队 ID + +bash scripts/build-all-platforms.sh --mac-only --publish=always +``` + +`electron-builder` 会自动完成签名 → 公证 → 装订(staple)→ 上传。 + +> **注意**:不要设置 `CSC_LINK` 环境变量,否则 electron-builder 会创建临时钥匙串,可能导致签名卡死。详见 [CODESIGNING.md](./CODESIGNING.md) 故障排查章节。 + +### CI/CD 签名构建 + +CI 环境无本地钥匙串,需通过 `CSC_LINK` 指定 `.p12` 文件(Base64 编码存入 GitHub Secret): + +```bash +export CSC_LINK=base64_encoded_p12_content +export CSC_KEY_PASSWORD=your_certificate_password +export APPLE_ID=your@apple.id +export APPLE_APP_SPECIFIC_PASSWORD=xxxx-xxxx-xxxx-xxxx +export APPLE_TEAM_ID=XXXXXXXXXX + +bash scripts/build-all-platforms.sh --mac-only --publish=always +``` + +### 公证超时处理 + +如果公证上传超时(`deadlineExceeded`),可先跳过公证构建,再用 `xcrun notarytool` 手动公证: + +```bash +# 1. 去掉公证变量,仅签名出包 +unset APPLE_ID APPLE_APP_SPECIFIC_PASSWORD APPLE_TEAM_ID +bash scripts/build-all-platforms.sh --mac-only + +# 2. 手动公证(支持断点续传) +xcrun notarytool submit release/MateClaw_*.zip \ + --apple-id your@apple.id \ + --password "app专用密码" \ + --team-id XXXXXXXXXX \ + --wait + +# 3. 装订公证票据 +xcrun stapler staple release/MateClaw_*.dmg +``` + +### 跳过签名(开发/测试用) + +```bash +export CSC_IDENTITY_AUTO_DISCOVERY=false +bash scripts/build-all-platforms.sh --mac-only +``` + +--- + +## Windows 代码签名(可选) + +未签名的 Windows 安装包会触发 SmartScreen 警告("Windows 已保护你的电脑"),用户可以点击"仍要运行"。签名可消除此警告。 + +### EV 代码签名证书 + +推荐使用 EV(Extended Validation)证书,可立即获得 SmartScreen 信誉,无需积累安装量。 + +证书提供商(参考): +- [DigiCert](https://www.digicert.com/signing/code-signing-certificates) — 需硬件 token +- [SSL.com](https://www.ssl.com/certificates/ev-code-signing/) — 支持云签名 +- [Certum](https://shop.certum.eu/code-signing-certificates/) — 较便宜的选项 + +### 配置 + +```bash +# PFX 文件签名 +export WIN_CSC_LINK=/path/to/windows-cert.pfx +export WIN_CSC_KEY_PASSWORD=password + +# 或使用 signtool(需要硬件 token 的 EV 证书) +# 在 electron-builder.json 的 win 节中配置: +# "signingHashAlgorithms": ["sha256"], +# "sign": "./scripts/sign.js" +``` + +--- + +## CI/CD 自动发布(GitHub Actions) + +以下为 GitHub Actions 完整示例,实现 Git tag 推送时自动构建全平台并发布: + +```yaml +# .github/workflows/release.yml +name: Release Desktop + +on: + push: + tags: + - 'v*' # 推送 v1.0.0 等 tag 时触发 + +jobs: + release-mac: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + + - name: Build and publish macOS + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CSC_LINK: ${{ secrets.MAC_CSC_LINK }} + CSC_KEY_PASSWORD: ${{ secrets.MAC_CSC_KEY_PASSWORD }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} + APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + run: | + cd mateclaw-desktop + npm install + bash scripts/build-all-platforms.sh --mac-only --publish=always + + release-win: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + + - name: Build and publish Windows + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd mateclaw-desktop + npm install + bash scripts/build-all-platforms.sh --win-only --publish=always +``` + +### 配置 CI Secrets + +在 GitHub 仓库 → Settings → Secrets and variables → Actions → New repository secret: + +| Secret 名称 | 说明 | +|-------------|------| +| `MAC_CSC_LINK` | macOS 签名证书 .p12 的 Base64 编码:`base64 -i cert.p12 \| tr -d '\n'` | +| `MAC_CSC_KEY_PASSWORD` | .p12 证书密码 | +| `APPLE_ID` | Apple ID 邮箱 | +| `APPLE_APP_SPECIFIC_PASSWORD` | App 专用密码 | +| `APPLE_TEAM_ID` | 10 位开发者团队 ID | +| `GITHUB_TOKEN` | 自动提供,无需手动配置 | + +### 发布流程(CI 方式) + +```bash +# 1. 更新版本号 +cd mateclaw-desktop +vim package.json # "version": "1.1.0" + +# 2. 提交并打 tag +git add -A && git commit -m "release: v1.1.0" +git tag v1.1.0 +git push origin main --tags + +# 3. GitHub Actions 自动构建并创建 Draft Release +# 4. 前往 GitHub Releases 确认并发布 +``` + +--- + +## 本地测试自动升级 + +### 方式一:开发模式 + dev-app-update.yml + +在开发模式下测试 updater 流程(不需要打包): + +```bash +# 1. 在 mateclaw-desktop/ 根目录创建 dev-app-update.yml +cat > dev-app-update.yml << 'EOF' +provider: generic +url: http://localhost:8080/ +EOF + +# 2. 构建一个"新版本"的产物 +# 先把 package.json 的 version 改为更高版本(如 9.9.9) +# 然后构建: +npm run build +npx electron-builder --mac --publish=never # 或 --win +# 构建完成后把 version 改回原值 + +# 3. 启动本地文件服务器 +cd release && python3 -m http.server 8080 + +# 4. 另一个终端启动开发模式 +cd mateclaw-desktop && npm run dev +# updater 会从 localhost:8080 检查更新并发现"新版本" +``` + +> 开发模式下 `quitAndInstall()` 不会真正安装,但可验证检查→发现→下载的完整流程。 + +### 方式二:打包后端到端测试(推荐) + +```bash +# 1. 打包 v1.0.0 并安装到系统 +# 2. 修改 package.json version 为 v1.1.0 +# 3. 重新构建,产物上传到 GitHub Release(或本地服务器) +# 4. 启动已安装的 v1.0.0,观察完整升级流程: +# 检查更新 → 发现 v1.1.0 → 下载 → 重启安装 +``` + +--- + +## 发布检查单 + +- [ ] `package.json` 版本号已更新 +- [ ] 后端 JAR 已构建(`npm run setup:jar`) +- [ ] 各平台 JRE 已下载 +- [ ] `npm run build` 编译通过 +- [ ] `GH_TOKEN` 环境变量已设置 +- [ ] macOS 签名证书环境变量已设置(若需要签名) +- [ ] `bash scripts/build-all-platforms.sh --all --publish=always` 执行成功 +- [ ] GitHub Draft Release 已确认发布 +- [ ] 在旧版本应用上验证升级通知正常 + +## 技术栈 + +- **Electron** - 桌面应用框架 +- **Vite + Vue 3** - Splash Screen 构建 +- **electron-builder** + **electron-updater** - 跨平台打包与自动升级 +- **Adoptium JRE 21** - 内置 Java 运行时 diff --git a/mateclaw-desktop/RELEASE_NOTES_v1.0.101.md b/mateclaw-desktop/RELEASE_NOTES_v1.0.101.md new file mode 100644 index 00000000..ccce4a3f --- /dev/null +++ b/mateclaw-desktop/RELEASE_NOTES_v1.0.101.md @@ -0,0 +1,67 @@ +# MateClaw v1.0.101 + +## What's New + +### Mobile Responsive UI +- Sidebar transforms to slide-in drawer with hamburger menu on mobile (<=768px) +- Conversation panel becomes a toggleable overlay on mobile +- Welcome screen centers properly with auto text wrapping, single-column suggestion cards +- Chat header auto-simplifies: icon-only agent badge, adaptive model selector +- Reduced padding/gaps across all chat components for mobile screens + +### Drag & Drop File Upload +- Drag-and-drop files and folders directly into the chat area +- Electron: directory references via local path; Web: recursive file collection and upload + +### Multi-Agent Collaboration +- `DelegateAgentTool` for agent-to-agent task delegation + +### LLM Context Awareness +- Current datetime automatically injected into LLM context for time-aware responses + +### MCP Server +- Pre-configured GitHub MCP Server in seed data (ready to use out of the box) + +### Ollama Auto-Discovery +- Auto-detect local Ollama instance on startup +- Pre-configured 6 popular local models (Qwen3, Llama, DeepSeek, Gemma, Phi, Mistral) +- Local providers sorted first in model management UI + +### Model Management Enhancements +- Provider list grouped by Local / Cloud with section headers +- Zhipu AI models updated to GLM-5 series (GLM-5-Turbo / GLM-5V-Turbo / GLM-5 / GLM-5.1) +- 20+ model providers supported + +### API Docs +- Replaced Knife4j with SpringDoc OpenAPI 2.8.16 (`/swagger-ui.html`) + +## Bug Fixes + +- **Security**: Fixed SPA frontend route refresh returning 401 +- **i18n**: Window title dynamically set from language pack instead of hardcoded +- **i18n**: Fixed 5 hardcoded Chinese strings in approval bar +- **i18n**: Fixed hardcoded time formatting (locale-aware now) +- **Guard**: Aligned tool guard rule names with runtime `@Tool` method names +- **LLM**: Fixed Zhipu connection test 404 +- **UI**: Fixed suggestion cards grid misalignment with longer text +- **Upload**: File upload size limit raised to 100MB + +## Download + +| Platform | File | Note | +|----------|------|------| +| macOS Apple Silicon | `MateClaw_1.0.101_arm64.dmg` | M1 / M2 / M3 / M4 / M5 | +| macOS Intel | `MateClaw_1.0.101_x64.dmg` | Intel Mac | +| Windows | `MateClaw_1.0.101_Setup.exe` | Windows 10/11 (x64+arm64) | +| Windows x64 | `MateClaw_1.0.101_x64_Setup.exe` | Windows 10/11 x64 | +| Windows ARM64 | `MateClaw_1.0.101_arm64_Setup.exe` | Windows ARM64 | + +> zip / blockmap / yml files are for auto-update support. + +## Links + +- GitHub: https://github.com/matevip/mateclaw +- Gitee: https://gitee.com/matevip_admin/mateclaw +- Documentation: https://mateclaw.com + +**Full Changelog**: https://github.com/matevip/mateclaw/compare/v1.0.0...v1.0.101 diff --git a/mateclaw-desktop/branding.config.json b/mateclaw-desktop/branding.config.json new file mode 100644 index 00000000..f966e865 --- /dev/null +++ b/mateclaw-desktop/branding.config.json @@ -0,0 +1,9 @@ +{ + "name": "MateClaw", + "tagline": "AI Personal Assistant", + "team": "MateClaw Team", + "copyright": "Copyright © 2026 MateClaw Team", + "appId": "vip.mate.mateclaw", + "githubUrl": "https://github.com/matevip/mateclaw", + "logoFile": "mateclaw_logo_s.png" +} diff --git a/mateclaw-desktop/build/entitlements.mac.inherit.plist b/mateclaw-desktop/build/entitlements.mac.inherit.plist new file mode 100644 index 00000000..faf2370e --- /dev/null +++ b/mateclaw-desktop/build/entitlements.mac.inherit.plist @@ -0,0 +1,14 @@ + + +By>yoLQn9Kf(R8?>=c+ecxrH~V;mRx;hQ*%-eiNVFO(~7H^)C+h(fABc&5@Wq4
zIwY^4*DK^ZsOCl=_`a}@`h+aW8`4t#;FlvPcE>vzKF%o*7X%3?YSg1gV79N8`_=Lp
z&)`jb3|gSG?vv^5^Af9d*U%Wi@tD$28dmdDbb<&}a3TW~8h@@XXk5Las{D<&d3j;F
z7cL;pZ8dF}G;kyk^Ht;KmxP&C_;74*sO~$KR-2kmY}!{0<7RUok=j~KIe)x%yWSp~
zP|8zd*P+QTDa8q0GNQfe&`^t0RyDN2cO329(1WieroqK*Kczs#OX3@SGe1mbBc0J{
zxGx%|EYTx&B3Q3jp?GJ5R#?A_R}9|?O&cd{zI^LKe4ZeCnMzvpUA$El(JWK?@((f0
zl_;9Twcah;o=o~X`R(y^T}jlW_~2IS8Kpl|JLf4>xXT;oI-w|x0Y0O8sV0FK!83b<
zxc*SA6VAU$OrpdFG+@r7uCw;&`2YwsnwJ}#=6pzNyWPRhgN|~jm~reB258Ro7CHpY
zabB$Hqr;jKX72na-zvvk*Hn_l{?3X=vs4XjPY5~>C)C7lMW5BT)zK5JQ4K3dQiLma
z+1jTz?r}p v^c^f#gIAhL;9_3bC9oRLBWb9NmKFqnnZ5E(--S8PORV1ml`{
zycqj{&bi6~aDjc%unv>knEY #ZN>Ngx
zMazE0*?~Ux3>4?ZaZX*GSrId)BTB&&=;$&MEjtM^9_W|WcFBQJP=L|~nt~xyxr(o0
zKu*0h2+I@(YGTZbZnra}fwv0gZ{cyuO61vfj$S48Sg{GQWr}xVi#F0acEt-{EOYzz
z%kiZo38wF%W#57^+m51RrIJweTTW##fR&Tk318TX&vO9(l*)SGDxy70ddag^1GWJj
z%(tt(O@1MoZOyZkLpK4qm}Ow0n~?#WP#z8u4=%XHLJLaW;%kKnlJyssyB$
z9fKWVB)^Aqfp`otVC*A3W(M}eWJhJ`L?;Xy_X0z_q1#{vb})b)A>+UhyLNG|uB@hO
z*(6}KBFBzCBr8j6NebMCsXX`Gbr*ouaBfcO1g;qMP%)vu5)+Nh8)l%tzmI$#n#AZ3
z=Vl)aG}8 ^e
zl?@bj8BjXQ6tjc#!2qVkC}0kw&2Ee_@27c#BUu*l2K>6%dxN;m005GsUxEL!cP%et
zu6JPBK6QOG2h$=PhFkmEVhKzp)B(kzmu<-a(We&Dxt+*#ZCxHc_K1Aswhzg92M^0T
z-uYfh7+;3NkzHdRBRx-f)}`1`Wur)9Fwo*>Ki?uIL85ium@A=Nr%en7E&;Ag?yX&A
zot%adJOLKQ840foZv*Z6GhbEZBtLwBz*Uck1>Ar7y85^(Gl>L F_6S{jH@0D#WKsWB8G}sh{!rP>r{*VSQ+)Rs01k%44Hjj(dV%{
z%)#o^5UvcEc5N}P8{KsTe1Tny-ejg~#BM?D0!)7v4<3}gmtL3@(xHqeNv_&lmd){6
zT5zrNkSK_FB619K*R_2{6ai?K-V`;4-g_iwYzKpvS+y7~tTUJ#CA};c&Cf=uk4ABV
zQCr#rN5XhxXeyJ+GO*jqK q2X)(3M-G3n$UpvcQtFdk1z?prn+s&bZ~W4yedY_|MZX?S`CYo&
z)@jum>ZfO&e-_E6xXczMFn~2hDC5P-A{$hm^H~P7=KDyNNmoW1+;zojN&EL*J_3nE
zrItigkjbhovD`82G33F`&ca4Rux>HyA``J0dBGwe$dJKEuHFlk=&}b3l#4e*GZ%Pb
zjY@{YZOFhGE^e2d2lvU`&RtRuhBBV6Cvde2w$53Ef#*t2#>0yRaz@iiv&6@joxLOT
zTtQCC7a-EV#YNqE>TJ8{CJbC0$f5+Bx#$RFBmGk@cc}@J;yX)sk6WcN8y&)nMn)vK
zmc*TQQz<|Ms0suK(SlaZbL1>PimHry-*_yQdEaswcZrv2Gh=CxO3yw_<`(FQ)hZq1
zq#29KL`x@+$?+4%(qn4*yBppmhmIU!NUd(cF)|@W1B{L!5F?0kGk}X0YrvFq$L2pf
z-@cD&@Mca2Q^Ae`$(@*0uz|`|ZOQE2>|U+trJ4
4$?s4vY0*=%{Aj>0oAMd8Py?
z1We5437)`0dP$HA5Z7FX@bw7mP-NtS*urPIRp=OVl^J>hTl-B0Bv2rz2#%@VUc(kE
z#x2wq>j3u3BNvDrgrTyOavQNiQxjOCp+*yQ1bGpxTi44q`eba&4HKZLrQVjn)#aDS
z{EqF&yIPs7$V6x7CFuzgkXWakkqG&9K*87yl`K?t70vX3I(Dj%xs^RpY
yC`5(j^#nYGh`sG3kGnqG2D|Gt70!7Su_)E jS;>X@?y7;l%l5(zsIAs>bYs>P$ogbCGdk)CkZ+K5)9p-1FbuieN
z>{vCZg*XVVe|pR$hsfsORQjLT8JSbpEttcJ0mTgNxodh&I+KxuMNB|`vTF>c)H({$
z73rceWzl558eTm0SFs6$o-=T~I8}C+I*YTYEK
dXj6Na*DF&EL
zhSmE#5|?rOi<+q&=O1R@6=ytB4rJ^Zr9>SHt@qwA{cIqXg_h`@!xwKq{a5e5=coD`
z?CdSD9#IO6HHncQ68aBoRrc