pi-querit 1.0.0 → 1.0.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/README-zh.md +3 -1
- package/README.md +3 -1
- package/package.json +1 -1
- package/src/config.ts +4 -4
- package/src/index.ts +1 -1
- package/src/summary.ts +1 -2
package/README-zh.md
CHANGED
|
@@ -126,6 +126,7 @@ pi install npm:pi-querit
|
|
|
126
126
|
| `count` | `1` – `20` | API 默认(`5`) | 每次搜索的结果数量。可通过 `count` 参数单次覆盖。 |
|
|
127
127
|
| `timeRange` | `d7` · `w2` · `m3` · `y1` | *(无 — 不限时间)* | 限制结果为过去 7 天、2 周、3 个月或 1 年。 |
|
|
128
128
|
| `includeContent` | `yes` / `no` | `no` | 在结果中包含句子级内容摘录,提供更丰富的上下文。 |
|
|
129
|
+
| `chunksPerDoc` | `1` – `3` | API 默认(`1`) | 每个结果请求的内容块数。该高级选项只能直接编辑 `querit-search.json`,设置向导不提供此项。 |
|
|
129
130
|
| `countries` | `argentina` · `australia` · `brazil` · `canada` · `colombia` · `france` · `germany` · `india` · `indonesia` · `japan` · `mexico` · `nigeria` · `philippines` · `south korea` · `spain` · `united kingdom` · `united states` | *(无 — 全球)* | 将结果偏向特定国家。逗号分隔,可多选。 |
|
|
130
131
|
| `languages` | `english` · `japanese` · `korean` · `german` · `french` · `spanish` · `portuguese` | *(无 — 全部)* | 按语言过滤结果。逗号分隔,可多选。 |
|
|
131
132
|
| `includeDomains` | 域名列表 | *(无 — 不限制)* | **白名单** —— 只返回这些域名的结果。 |
|
|
@@ -149,6 +150,7 @@ pi install npm:pi-querit
|
|
|
149
150
|
"summaryThinkingLevel": "medium",
|
|
150
151
|
"search": {
|
|
151
152
|
"count": 5,
|
|
153
|
+
"chunksPerDoc": 1,
|
|
152
154
|
"timeRange": "m3",
|
|
153
155
|
"includeContent": false,
|
|
154
156
|
"countries": ["united states"],
|
|
@@ -161,7 +163,7 @@ pi install npm:pi-querit
|
|
|
161
163
|
|
|
162
164
|
POSIX 系统上文件权限为 `0600`;Windows 上依赖用户配置文件 ACL 保护。API Key 不会出现在工具结果或日志中。
|
|
163
165
|
|
|
164
|
-
CI 或临时使用可设置环境变量 `QUERIT_API_KEY
|
|
166
|
+
CI 或临时使用可设置环境变量 `QUERIT_API_KEY`,环境变量优先于 JSON 配置。
|
|
165
167
|
|
|
166
168
|
## 工具
|
|
167
169
|
|
package/README.md
CHANGED
|
@@ -126,6 +126,7 @@ These are persistent defaults applied to every `web_search` call. They are store
|
|
|
126
126
|
| `count` | `1` – `20` | API default (`5`) | Number of results per search. Can be overridden per call via the `count` parameter. |
|
|
127
127
|
| `timeRange` | `d7` · `w2` · `m3` · `y1` | *(none — all time)* | Restrict results to the past 7 days, 2 weeks, 3 months, or 1 year. |
|
|
128
128
|
| `includeContent` | `yes` / `no` | `no` | Include sentence-level content excerpts in results for richer context. |
|
|
129
|
+
| `chunksPerDoc` | `1` – `3` | API default (`1`) | Content chunks requested per result. This advanced option is configured by editing `querit-search.json`; it is not exposed in the setup wizard. |
|
|
129
130
|
| `countries` | `argentina` · `australia` · `brazil` · `canada` · `colombia` · `france` · `germany` · `india` · `indonesia` · `japan` · `mexico` · `nigeria` · `philippines` · `south korea` · `spain` · `united kingdom` · `united states` | *(none — global)* | Bias results toward specific countries. Comma-separated, multi-select. |
|
|
130
131
|
| `languages` | `english` · `japanese` · `korean` · `german` · `french` · `spanish` · `portuguese` | *(none — all)* | Filter results by language. Comma-separated, multi-select. |
|
|
131
132
|
| `includeDomains` | domain list | *(none — unrestricted)* | **Whitelist** — only these domains return results. |
|
|
@@ -149,6 +150,7 @@ These are persistent defaults applied to every `web_search` call. They are store
|
|
|
149
150
|
"summaryThinkingLevel": "medium",
|
|
150
151
|
"search": {
|
|
151
152
|
"count": 5,
|
|
153
|
+
"chunksPerDoc": 1,
|
|
152
154
|
"timeRange": "m3",
|
|
153
155
|
"includeContent": false,
|
|
154
156
|
"countries": ["united states"],
|
|
@@ -161,7 +163,7 @@ These are persistent defaults applied to every `web_search` call. They are store
|
|
|
161
163
|
|
|
162
164
|
The extension applies mode `0600` on POSIX systems. On Windows, the file remains protected by the user profile's filesystem ACLs. The key is never included in tool results or logs.
|
|
163
165
|
|
|
164
|
-
For CI or ephemeral use, set `QUERIT_API_KEY`. The
|
|
166
|
+
For CI or ephemeral use, set `QUERIT_API_KEY`. The environment variable takes precedence when both are present.
|
|
165
167
|
|
|
166
168
|
## Tools
|
|
167
169
|
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -127,11 +127,11 @@ export async function loadQueritConfig(configPath = getQueritConfigPath()): Prom
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
export async function resolveQueritApiKey(options: ApiKeyResolutionOptions = {}): Promise<string | undefined> {
|
|
130
|
-
const config = await loadQueritConfig(options.configPath ?? getQueritConfigPath());
|
|
131
|
-
if (config?.apiKey) return config.apiKey;
|
|
132
|
-
|
|
133
130
|
const environmentKey = (options.env ?? process.env).QUERIT_API_KEY?.trim();
|
|
134
|
-
|
|
131
|
+
if (environmentKey) return environmentKey;
|
|
132
|
+
|
|
133
|
+
const config = await loadQueritConfig(options.configPath ?? getQueritConfigPath());
|
|
134
|
+
return config?.apiKey || undefined;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
export async function saveQueritConfig(
|
package/src/index.ts
CHANGED
|
@@ -113,7 +113,7 @@ export function registerQueritExtension(pi: ExtensionAPI, options: QueritExtensi
|
|
|
113
113
|
|
|
114
114
|
const requireRuntime = async (): Promise<{ client: QueritClientLike; config?: QueritConfig }> => {
|
|
115
115
|
const config = await loadQueritConfig(configPath);
|
|
116
|
-
const apiKey =
|
|
116
|
+
const apiKey = (options.env ?? process.env).QUERIT_API_KEY?.trim() ?? config?.apiKey;
|
|
117
117
|
if (!apiKey) {
|
|
118
118
|
throw new Error(
|
|
119
119
|
`Querit is not configured. Run /querit-setup in Pi or set QUERIT_API_KEY. Configuration file: ${configPath}`,
|
package/src/summary.ts
CHANGED
|
@@ -68,7 +68,7 @@ export async function generateSearchSummary(
|
|
|
68
68
|
? AbortSignal.any([signal, deadlineController.signal])
|
|
69
69
|
: deadlineController.signal;
|
|
70
70
|
|
|
71
|
-
const operation = performSummary(search, ctx, modelReference, completionSignal, completeFn,
|
|
71
|
+
const operation = performSummary(search, ctx, modelReference, completionSignal, completeFn, thinkingLevel);
|
|
72
72
|
void operation.catch(() => undefined);
|
|
73
73
|
|
|
74
74
|
try {
|
|
@@ -137,7 +137,6 @@ async function performSummary(
|
|
|
137
137
|
modelReference: string,
|
|
138
138
|
signal: AbortSignal,
|
|
139
139
|
completeFn: CompleteFunction,
|
|
140
|
-
timeoutMs: number,
|
|
141
140
|
thinkingLevel?: QueritThinkingLevel,
|
|
142
141
|
): Promise<SummaryGenerationResult> {
|
|
143
142
|
const { provider, id } = parseModelReference(modelReference);
|