mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 03:13:41 +08:00
chore(search): drop internal issue refs and external-project names from plugin search code
- Remove "(issue #477)" internal planning references from shipped Java (SearchProviderRegistry, PluginSearchBridge, and the two new tests) — code should describe what it does, not point at issue trackers. - Drop "openclaw" external-project attribution from the search provider comments (SearchProviderRegistry, SearchCache, SearchQuery), restating them as objective functional descriptions.
This commit is contained in:
parent
0a58b3fb35
commit
80815612ce
@ -13,7 +13,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* Bridge that wraps a plugin's {@link PluginSearchProvider} into the platform's
|
||||
* internal {@link SearchProvider} interface (issue #477).
|
||||
* internal {@link SearchProvider} interface.
|
||||
* <p>
|
||||
* The platform-side {@link SystemSettingsDTO} is intentionally ignored — plugin
|
||||
* providers read their own config via {@code PluginContext#getConfig}, keeping
|
||||
|
||||
@ -8,7 +8,7 @@ import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 搜索结果内存缓存 — 借鉴 openclaw 的 SEARCH_CACHE 设计
|
||||
* 搜索结果内存缓存
|
||||
*
|
||||
* <p>避免 Agent 同一对话中多次搜索相同/相似 query 时重复调用搜索 API。
|
||||
* <ul>
|
||||
|
||||
@ -15,7 +15,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* 搜索提供商注册表 — 收集所有 {@link SearchProvider} 实现,提供优先级排序与自动探测
|
||||
*
|
||||
* <p>借鉴 openclaw 的 provider auto-detect 机制:
|
||||
* <p>provider 自动探测机制:
|
||||
* <ol>
|
||||
* <li>用户显式配置的 primary provider → 直接使用</li>
|
||||
* <li>按 autoDetectOrder 遍历,优先选有 credential 的 provider</li>
|
||||
@ -45,7 +45,7 @@ public class SearchProviderRegistry {
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册一个插件提供的 provider(issue #477)。
|
||||
* 注册一个插件提供的 provider。
|
||||
*
|
||||
* @throws IllegalArgumentException id 为空,或与内置/已注册插件 provider 冲突
|
||||
*/
|
||||
@ -95,7 +95,7 @@ public class SearchProviderRegistry {
|
||||
/**
|
||||
* 根据当前配置,解析应使用的 provider。
|
||||
*
|
||||
* <p>解析策略(借鉴 openclaw resolveWebSearchProviderId):
|
||||
* <p>解析策略:
|
||||
* <ol>
|
||||
* <li>如果用户配置了 primary provider 且该 provider 可用 → 选中</li>
|
||||
* <li>否则按 autoDetectOrder 遍历,跳过 keyless,先找有 credential 的</li>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package vip.mate.tool.search;
|
||||
|
||||
/**
|
||||
* 搜索查询参数封装 — 借鉴 openclaw 的丰富工具参数设计
|
||||
* 搜索查询参数封装
|
||||
*
|
||||
* @param query 搜索关键词(必须)
|
||||
* @param freshness 时间范围过滤:day / week / month / year(可选)
|
||||
|
||||
@ -29,7 +29,7 @@ import static org.mockito.Mockito.mock;
|
||||
/**
|
||||
* PluginContextImpl#registerSearchProvider: wraps the plugin SPI in a bridge,
|
||||
* registers it into SearchProviderRegistry, and records the id on LoadedPlugin
|
||||
* so disable/rollback can unregister it (issue #477).
|
||||
* so disable/rollback can unregister it.
|
||||
*/
|
||||
class PluginContextImplSearchTest {
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertSame;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
/**
|
||||
* Plugin-provider mutability of {@link SearchProviderRegistry} (issue #477):
|
||||
* Plugin-provider mutability of {@link SearchProviderRegistry}:
|
||||
* plugin JARs register/unregister providers at runtime; the registry must merge
|
||||
* them with the Spring-injected built-ins and reject id conflicts.
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user