pi-querit 1.0.0 → 1.0.1
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 +1 -1
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/config.ts +4 -4
- package/src/index.ts +1 -1
package/README-zh.md
CHANGED
package/README.md
CHANGED
|
@@ -161,7 +161,7 @@ These are persistent defaults applied to every `web_search` call. They are store
|
|
|
161
161
|
|
|
162
162
|
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
163
|
|
|
164
|
-
For CI or ephemeral use, set `QUERIT_API_KEY`. The
|
|
164
|
+
For CI or ephemeral use, set `QUERIT_API_KEY`. The environment variable takes precedence when both are present.
|
|
165
165
|
|
|
166
166
|
## Tools
|
|
167
167
|
|
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}`,
|