qlogicagent 2.11.14 → 2.12.2
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/dist/cli.js +554 -547
- package/dist/index.js +553 -546
- package/dist/types/runtime/infra/media-persistence.d.ts +16 -12
- package/dist/types/runtime/ports/web-search-contracts.d.ts +4 -0
- package/dist/types/server/search-svc.d.ts +1 -0
- package/dist/types/skills/tools/web-fetch-tool.d.ts +2 -0
- package/dist/types/skills/tools/web-research-tool.d.ts +31 -2
- package/dist/types/skills/tools/web-search-tool.d.ts +6 -0
- package/dist/types/skills/web-search/embedding-rerank.d.ts +4 -4
- package/dist/types/skills/web-search/redis-source-cache.d.ts +6 -0
- package/dist/types/skills/web-search/search-svc-source.d.ts +4 -0
- package/dist/types/skills/web-search/source-factory.d.ts +1 -3
- package/package.json +2 -1
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
* cloud URLs, this service downloads them to a persistent local directory
|
|
6
6
|
* so the user can access them offline without manual intervention.
|
|
7
7
|
*
|
|
8
|
-
* Storage layout
|
|
9
|
-
* <project
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* Storage layout:
|
|
9
|
+
* <project>/assets/images/image_20260520_143022_abc.png
|
|
10
|
+
* <project>/assets/videos/video_20260520_143055_def.mp4
|
|
11
|
+
* <project>/assets/audio/audio_20260520_143100_ghi.mp3
|
|
12
|
+
* <project>/assets/models/ <project>/assets/files/
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* 产出归项目工作区可见的 assets/ 目录(按类型分),项目级、所有会话共享 —— 文件树可见可
|
|
15
|
+
* 管理。文件名带时间戳+随机后缀保证多会话不冲突。(旧版曾存于 .qlogicagent/sessions/<id>/media/)
|
|
15
16
|
*
|
|
16
17
|
* Integration:
|
|
17
18
|
* Called from the tool result pipeline in tool-loop.ts.
|
|
@@ -31,8 +32,8 @@ export interface MediaDownloadResult {
|
|
|
31
32
|
export interface MediaPersistenceConfig {
|
|
32
33
|
/**
|
|
33
34
|
* Project working directory. Media downloads to:
|
|
34
|
-
* `{projectDir}
|
|
35
|
-
*
|
|
35
|
+
* `{projectDir}/assets/{images|videos|audio|models|files}/`
|
|
36
|
+
* 项目工作区可见目录,所有会话共享。
|
|
36
37
|
*/
|
|
37
38
|
projectDir?: string;
|
|
38
39
|
/** Maximum file size to download (bytes). Default: 500MB. */
|
|
@@ -48,8 +49,11 @@ export declare class MediaPersistence {
|
|
|
48
49
|
/** Update project root directory. */
|
|
49
50
|
setProjectDir(projectDir: string): void;
|
|
50
51
|
/**
|
|
51
|
-
* Resolve the media directory for a given
|
|
52
|
-
* Path: <project
|
|
52
|
+
* Resolve the media directory for a given media type.
|
|
53
|
+
* Path: <project>/assets/<typeSubdir>/ (项目工作区可见目录,文件树可见可管理)
|
|
54
|
+
*
|
|
55
|
+
* 产出归项目级 assets 目录(images/videos/audio/models/files),所有会话共享 —— 一个项目
|
|
56
|
+
* 不同会话的产出始终在工作区可见目录,而非会话级隐藏目录。文件名带时间戳+随机后缀保证不冲突。
|
|
53
57
|
*/
|
|
54
58
|
private resolveMediaDir;
|
|
55
59
|
/**
|
|
@@ -75,8 +79,8 @@ export declare class MediaPersistence {
|
|
|
75
79
|
}, log?: {
|
|
76
80
|
warn: (msg: string) => void;
|
|
77
81
|
}): Promise<MediaDownloadResult[]>;
|
|
78
|
-
/** Get the
|
|
79
|
-
getMediaDir(
|
|
82
|
+
/** Get the project-level assets root (<project>/assets). */
|
|
83
|
+
getMediaDir(): string;
|
|
80
84
|
/** Get the project directory (for testing/inspection). */
|
|
81
85
|
getProjectDir(): string | null;
|
|
82
86
|
}
|
|
@@ -13,5 +13,9 @@ export interface WebSearchBackend {
|
|
|
13
13
|
allowedDomains?: string[];
|
|
14
14
|
blockedDomains?: string[];
|
|
15
15
|
maxResults?: number;
|
|
16
|
+
/** 时效过滤(§4.2):day/week/month/year;源不支持时由其忽略 */
|
|
17
|
+
freshness?: "day" | "week" | "month" | "year" | "any";
|
|
18
|
+
/** 检索语言(如 "zh"/"en");源不支持时由其忽略 */
|
|
19
|
+
lang?: string;
|
|
16
20
|
}): Promise<WebSearchOutput>;
|
|
17
21
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -67,6 +67,8 @@ export interface WebFetchToolDeps {
|
|
|
67
67
|
maxChars?: number;
|
|
68
68
|
query?: string;
|
|
69
69
|
extract?: boolean;
|
|
70
|
+
/** 调用方取消信号(§15-1):用户中断后抓取必须随之中止,不再烧带宽/时间 */
|
|
71
|
+
signal?: AbortSignal;
|
|
70
72
|
}): Promise<WebFetchResult>;
|
|
71
73
|
/**
|
|
72
74
|
* Optional: summarize long content using a small/cheap model.
|
|
@@ -3,6 +3,12 @@ import type { WebAnswerToolDeps } from "./web-answer-tool.js";
|
|
|
3
3
|
export declare const WEB_RESEARCH_TOOL_NAME: "web_research";
|
|
4
4
|
export interface WebResearchToolParams {
|
|
5
5
|
task: string;
|
|
6
|
+
budget?: {
|
|
7
|
+
/** 搜-读-反思轮数上限(默认 2:首轮 + 1 轮 reflect 补搜) */
|
|
8
|
+
maxRounds?: number;
|
|
9
|
+
/** 墙钟时间上限 ms(默认 120000) */
|
|
10
|
+
maxWallClockMs?: number;
|
|
11
|
+
};
|
|
6
12
|
}
|
|
7
13
|
export declare const WEB_RESEARCH_TOOL_SCHEMA: {
|
|
8
14
|
readonly type: "object";
|
|
@@ -11,9 +17,32 @@ export declare const WEB_RESEARCH_TOOL_SCHEMA: {
|
|
|
11
17
|
readonly type: "string";
|
|
12
18
|
readonly description: string;
|
|
13
19
|
};
|
|
20
|
+
readonly budget: {
|
|
21
|
+
readonly type: "object";
|
|
22
|
+
readonly properties: {
|
|
23
|
+
readonly maxRounds: {
|
|
24
|
+
readonly type: "number";
|
|
25
|
+
readonly description: "Max search-read-reflect rounds (default 2).";
|
|
26
|
+
};
|
|
27
|
+
readonly maxWallClockMs: {
|
|
28
|
+
readonly type: "number";
|
|
29
|
+
readonly description: "Max wall-clock time in ms (default 120000).";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
readonly description: "Hard budget caps to prevent runaway research.";
|
|
33
|
+
};
|
|
14
34
|
};
|
|
15
35
|
readonly required: readonly ["task"];
|
|
16
36
|
};
|
|
17
|
-
/** 与 web_answer 同 deps
|
|
18
|
-
export
|
|
37
|
+
/** 与 web_answer 同 deps + 可选写记忆(host 注入;无则跳过,details 如实标注)。 */
|
|
38
|
+
export interface WebResearchToolDeps extends WebAnswerToolDeps {
|
|
39
|
+
/**
|
|
40
|
+
* 可选:把研究结论写入长期记忆(§14)。内部经 consolidator 去重/重要度过滤(§15-7),
|
|
41
|
+
* 返回是否成功提交(不保证最终入库条数)。
|
|
42
|
+
*/
|
|
43
|
+
saveMemory?(text: string, meta: {
|
|
44
|
+
source: string;
|
|
45
|
+
category: string;
|
|
46
|
+
}): Promise<boolean>;
|
|
47
|
+
}
|
|
19
48
|
export declare function createWebResearchTool(deps: WebResearchToolDeps): PortableTool<WebResearchToolParams>;
|
|
@@ -5,6 +5,7 @@ export interface WebSearchToolParams {
|
|
|
5
5
|
query: string;
|
|
6
6
|
allowedDomains?: string[];
|
|
7
7
|
blockedDomains?: string[];
|
|
8
|
+
freshness?: "day" | "week" | "month" | "year" | "any";
|
|
8
9
|
}
|
|
9
10
|
export declare const WEB_SEARCH_TOOL_SCHEMA: {
|
|
10
11
|
readonly type: "object";
|
|
@@ -27,6 +28,11 @@ export declare const WEB_SEARCH_TOOL_SCHEMA: {
|
|
|
27
28
|
};
|
|
28
29
|
readonly description: "Exclude results from these domains. Cannot be used together with allowedDomains.";
|
|
29
30
|
};
|
|
31
|
+
readonly freshness: {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
readonly enum: readonly ["day", "week", "month", "year", "any"];
|
|
34
|
+
readonly description: string;
|
|
35
|
+
};
|
|
30
36
|
};
|
|
31
37
|
readonly required: readonly ["query"];
|
|
32
38
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { RawHit } from "../../runtime/ports/source-provider.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { EmbeddingProvider } from "../memory/local-embedding.js";
|
|
3
3
|
export interface Reranker {
|
|
4
4
|
/** 按 query 语义相关性重排 hits;失败/无模型时返回原序(fail-loud,不破坏召回)。 */
|
|
5
5
|
rerank(query: string, hits: RawHit[]): Promise<RawHit[]>;
|
|
6
6
|
}
|
|
7
7
|
export interface EmbeddingRerankerDeps {
|
|
8
|
-
/**
|
|
9
|
-
getProvider
|
|
8
|
+
/** embedding provider 工厂(调用方注入,可异步懒解析)。dimensions=0 视为无模型 → 原序。 */
|
|
9
|
+
getProvider: () => EmbeddingProvider | Promise<EmbeddingProvider>;
|
|
10
10
|
/** 每条 hit 文本(title+snippet)最大字符,控 token。默认 512。 */
|
|
11
11
|
maxTextChars?: number;
|
|
12
12
|
}
|
|
13
|
-
export declare function createEmbeddingReranker(deps
|
|
13
|
+
export declare function createEmbeddingReranker(deps: EmbeddingRerankerDeps): Reranker;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SourceCache } from "./stability.js";
|
|
2
|
+
export interface RedisSourceCacheHandle extends SourceCache {
|
|
3
|
+
/** 探活(svc /health 用) */
|
|
4
|
+
ping(): Promise<boolean>;
|
|
5
|
+
}
|
|
6
|
+
export declare function createRedisSourceCache(redisUrl: string): Promise<RedisSourceCacheHandle>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SourceProvider } from "../../runtime/ports/source-provider.js";
|
|
2
|
+
/** 解析 search-svc base url:settings tunables → 环境变量。 */
|
|
3
|
+
export declare function resolveSearchSvcBaseUrl(): Promise<string | undefined>;
|
|
4
|
+
export declare function createSearchSvcSource(): SourceProvider;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { SourceProvider } from "../../runtime/ports/source-provider.js";
|
|
2
2
|
/**
|
|
3
|
-
* 组装 web_search 的 L0
|
|
4
|
-
* SearXNG 为默认主源;Exa/Brave/Serper 为 BYOK(凭证读 settings tunables / env),
|
|
5
|
-
* 未配置 key 时其 search 返回空数组,不影响整体召回。
|
|
3
|
+
* 组装 web_search 的 L0 数据源集合(装配时按配置决定主源,运行期各源再自行懒解析细节)。
|
|
6
4
|
*/
|
|
7
5
|
export declare function buildWebSearchSources(): SourceProvider[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qlogicagent",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.2",
|
|
4
4
|
"description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"@xiaozhiclaw/provider-core": "0.1.7",
|
|
93
93
|
"better-sqlite3": "^12.10.0",
|
|
94
94
|
"dotenv": "^17.3.1",
|
|
95
|
+
"ioredis": "^5.11.1",
|
|
95
96
|
"nanoid": "^5.1.5",
|
|
96
97
|
"pino": "^9.6.0",
|
|
97
98
|
"pino-pretty": "^13.0.0"
|