@herbertgao/pi-extensions 2026.10.10 → 2026.10.11
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.md +10 -8
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +3 -0
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +3 -0
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +3 -3
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/compact-mode.ts +126 -42
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/interaction.ts +24 -6
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/scroll.ts +69 -16
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/mouse/sticky-prompt.ts +1 -1
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
- package/node_modules/@herbertgao/sol-pi/README.md +7 -1
- package/node_modules/@herbertgao/sol-pi/docs/compatibility.md +28 -4
- package/node_modules/@herbertgao/sol-pi/docs/configuration.md +17 -4
- package/node_modules/@herbertgao/sol-pi/package.json +1 -1
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/index.ts +35 -25
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/action-fusion/then-run.ts +95 -26
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/candidate.ts +39 -2
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/evidence-preserving-reducer/index.ts +24 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/observation-pack/index.ts +12 -7
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/extension.ts +138 -130
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/projection.ts +88 -14
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/extensions/online-context-compact/tools.ts +9 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/index.ts +14 -5
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/shell-options.ts +22 -0
- package/node_modules/@herbertgao/sol-pi/src/sol-pi/tui.ts +11 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/answer-channel.ts +109 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/ask-user-question.ts +117 -71
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/hosts.md +2 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/keyboard.md +3 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/startup-performance.md +83 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/docs/tool-schema.md +74 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/events.ts +84 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/index.ts +10 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/package.json +4 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/presentation.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/reconcile.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/rpc-fallback.ts +5 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/build-questionnaire.ts +19 -19
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/i18n-bridge.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/key-router.ts +7 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/questionnaire-session.ts +10 -10
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/row-intent.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/contract.ts +6 -6
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/derivations.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/focus.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/selectors/projections.ts +9 -9
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state-reducer.ts +5 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/state/state.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/external-answer.ts +125 -0
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/format-answer.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/normalize-params.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/response-envelope.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/types.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/tool/validate-questionnaire.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/component-binding.ts +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/multi-select-view.ts +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/option-list-view.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/markdown-content-cache.ts +3 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-block-renderer.ts +5 -5
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-layout-decider.ts +3 -3
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/preview/preview-pane.ts +10 -10
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/submit-picker.ts +2 -2
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/tab-bar.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/components/wrapping-select.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-builder.ts +9 -9
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/dialog-copy.ts +1 -1
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/props-adapter.ts +8 -8
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-components.ts +4 -4
- package/node_modules/@juicesharp/rpiv-ask-user-question/view/tab-content-strategy.ts +10 -10
- package/node_modules/@narumitw/pi-btw/dist/index.ts +3 -0
- package/node_modules/@narumitw/pi-btw/dist/index.ts.map +2 -2
- package/node_modules/@narumitw/pi-btw/package.json +4 -4
- package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +6 -0
- package/node_modules/@narumitw/pi-btw/src/keybindings.ts +1 -1
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts +1 -0
- package/node_modules/@narumitw/pi-caffeinate/dist/index.ts.map +2 -2
- package/node_modules/@narumitw/pi-caffeinate/package.json +3 -3
- package/node_modules/@narumitw/pi-caffeinate/src/inhibitor-process.ts +1 -0
- package/node_modules/pi-antigravity/README.md +6 -2
- package/node_modules/pi-antigravity/package.json +2 -2
- package/node_modules/pi-antigravity/src/client/client.ts +44 -52
- package/node_modules/pi-antigravity/src/index.ts +13 -0
- package/node_modules/pi-antigravity/src/models/discovery.ts +25 -2
- package/node_modules/pi-antigravity/src/models/grouping.ts +107 -68
- package/node_modules/pi-antigravity/src/models/models.ts +10 -0
- package/node_modules/pi-antigravity/src/search/search.ts +581 -43
- package/node_modules/pi-antigravity/src/stream/stream.ts +53 -13
- package/node_modules/pi-antigravity/src/types/types.ts +13 -0
- package/node_modules/pi-antigravity/src/usage/usage.ts +11 -3
- package/node_modules/pi-web-access/CHANGELOG.md +21 -0
- package/node_modules/pi-web-access/README.md +22 -7
- package/node_modules/pi-web-access/credential-source.ts +54 -4
- package/node_modules/pi-web-access/curator-page.ts +3 -1
- package/node_modules/pi-web-access/curator-server.ts +1 -0
- package/node_modules/pi-web-access/deepseek.ts +204 -0
- package/node_modules/pi-web-access/dist/index.js +927 -642
- package/node_modules/pi-web-access/dist/mcp-cli.js +877 -615
- package/node_modules/pi-web-access/gemini-adc.ts +48 -1
- package/node_modules/pi-web-access/gemini-search.ts +8 -4
- package/node_modules/pi-web-access/index.ts +16 -1
- package/node_modules/pi-web-access/package.json +1 -1
- package/node_modules/pi-web-access/page-query.ts +12 -6
- package/node_modules/pi-web-access/query-rewrite.ts +16 -13
- package/node_modules/pi-web-access/summary-review.ts +16 -6
- package/node_modules/pi-web-access/utils.ts +3 -0
- package/node_modules/pi-web-access/web-tool-core.ts +2 -0
- package/package.json +9 -9
|
@@ -18,17 +18,22 @@ import {
|
|
|
18
18
|
endpointCandidates,
|
|
19
19
|
fetchAvailableRuntimeModel,
|
|
20
20
|
formatRequestDiagnostics,
|
|
21
|
+
isUsableRuntimeModelId,
|
|
21
22
|
jsonOrTextError,
|
|
22
23
|
loadCodeAssist,
|
|
23
24
|
parseApiKey,
|
|
24
25
|
resolveProjectId,
|
|
25
26
|
} from "../client/client.js";
|
|
26
27
|
import {
|
|
28
|
+
getCurrentAvailableModels,
|
|
27
29
|
getCurrentEndpoint,
|
|
30
|
+
getCurrentMatchedModelDebug,
|
|
28
31
|
runWithDiagnostics,
|
|
32
|
+
setLastAvailableModels,
|
|
29
33
|
setLastEndpoint,
|
|
30
34
|
setLastError,
|
|
31
35
|
setLastLatencyMs,
|
|
36
|
+
setLastMatchedModelDebug,
|
|
32
37
|
setLastProjectId,
|
|
33
38
|
setLastResolvedRuntimeModel,
|
|
34
39
|
setLastStatus,
|
|
@@ -992,6 +997,40 @@ export function mapStopReason(reason: string | undefined): StopReason {
|
|
|
992
997
|
return reason ? StopReason.Error : StopReason.Stop;
|
|
993
998
|
}
|
|
994
999
|
|
|
1000
|
+
/** Account quota walls. These must stay non-retryable and may fail over to another login. */
|
|
1001
|
+
function isAccountQuota429(text: string): boolean {
|
|
1002
|
+
return (
|
|
1003
|
+
/Individual quota reached/i.test(text) ||
|
|
1004
|
+
/Resets? in /i.test(text) ||
|
|
1005
|
+
(!/rate.?limit/i.test(text) && /quota exceeded|exceeded your|daily limit/i.test(text))
|
|
1006
|
+
);
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/** Short throttles. Pi retries these; persistent model unavailability must not match. */
|
|
1010
|
+
function isRetryableRateLimit(text: string): boolean {
|
|
1011
|
+
return /rate.?limit|too many requests/i.test(text);
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* Keep the numeric status out of non-retryable errors. Pi treats the digits 429 as a
|
|
1016
|
+
* retryable provider error even when the friendly text says the model is unavailable.
|
|
1017
|
+
*/
|
|
1018
|
+
function publicErrorStatus(status: number | undefined, friendly: string): string {
|
|
1019
|
+
if (status === undefined) return "no response";
|
|
1020
|
+
return /retrying automatically/i.test(friendly) ? String(status) : "request-failed";
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
/** Record a static route so doctor output is not matched=none on models that skip discovery. */
|
|
1024
|
+
function recordStaticRouteDiagnostics(runtimeModel: string): void {
|
|
1025
|
+
if (!getCurrentMatchedModelDebug()) {
|
|
1026
|
+
setLastMatchedModelDebug(`static:${runtimeModel}`);
|
|
1027
|
+
}
|
|
1028
|
+
if (!getCurrentAvailableModels()) {
|
|
1029
|
+
const ids = Object.keys(getCurrentAntigravityRouting());
|
|
1030
|
+
setLastAvailableModels(ids.length > 0 ? ids.join(",") : "static-catalog");
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
|
|
995
1034
|
/** Exported for unit tests. */
|
|
996
1035
|
export function friendlyAntigravityError(status: number | undefined, text: string): string {
|
|
997
1036
|
const msg = redactSecrets(jsonOrTextError(text)).slice(0, 500);
|
|
@@ -1058,7 +1097,13 @@ export function friendlyAntigravityError(status: number | undefined, text: strin
|
|
|
1058
1097
|
if (hardLimit) {
|
|
1059
1098
|
return `Quota reached.${wait ? ` Please wait ${wait}.` : ""} Next: switch models or retry later.`;
|
|
1060
1099
|
}
|
|
1061
|
-
|
|
1100
|
+
if (/rate.?limit|too many requests/i.test(msg)) {
|
|
1101
|
+
return "Rate limited by Antigravity (429 ResourceExhausted). Next: retrying automatically; if it persists, switch models.";
|
|
1102
|
+
}
|
|
1103
|
+
// A generic RESOURCE_EXHAUSTED body, with no reset hint, is how unavailable models
|
|
1104
|
+
// such as gemini-3.1-pro fail (#89). Do not include 429/ResourceExhausted: those
|
|
1105
|
+
// tokens make Pi burn its automatic retry budget and look like an account quota wall.
|
|
1106
|
+
return `This model is unavailable right now (${msg || "resource exhausted"}). Next: switch to gemini-3.8-flash or another Flash model. This is not necessarily an account quota wall.`;
|
|
1062
1107
|
}
|
|
1063
1108
|
if (status === 500) {
|
|
1064
1109
|
return "Antigravity had an internal server error. Next: retry in a moment or switch models.";
|
|
@@ -1501,7 +1546,7 @@ export function streamAntigravity(
|
|
|
1501
1546
|
// Dynamic lookup is only needed for unmapped custom models.
|
|
1502
1547
|
if (!isKnownModel && !antigravityEnv("RUNTIME_MODEL")) {
|
|
1503
1548
|
const dynamic = await fetchAvailableRuntimeModel(creds.token, projectId, baseRuntimeModel);
|
|
1504
|
-
if (dynamic?.id &&
|
|
1549
|
+
if (dynamic?.id && isUsableRuntimeModelId(dynamic.id)) {
|
|
1505
1550
|
initialRuntimeModel = dynamic.id;
|
|
1506
1551
|
}
|
|
1507
1552
|
}
|
|
@@ -1529,6 +1574,7 @@ export function streamAntigravity(
|
|
|
1529
1574
|
for (let candIdx = 0; candIdx < runtimeCandidates.length; candIdx++) {
|
|
1530
1575
|
runtimeModel = runtimeCandidates[candIdx]!;
|
|
1531
1576
|
setLastResolvedRuntimeModel(runtimeModel);
|
|
1577
|
+
recordStaticRouteDiagnostics(runtimeModel);
|
|
1532
1578
|
const body = JSON.stringify(buildRequest(model, context, projectId, opts, runtimeModel));
|
|
1533
1579
|
|
|
1534
1580
|
for (const endpoint of endpointCandidates()) {
|
|
@@ -1547,15 +1593,9 @@ export function streamAntigravity(
|
|
|
1547
1593
|
setLastStatus(response.status);
|
|
1548
1594
|
if (response.ok) break;
|
|
1549
1595
|
lastText = await response.text();
|
|
1550
|
-
if (
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
/Resets? in /i.test(lastText) ||
|
|
1554
|
-
(!/rate.?limit/i.test(lastText) &&
|
|
1555
|
-
/quota exceeded|exceeded your|daily limit/i.test(lastText)))
|
|
1556
|
-
) {
|
|
1557
|
-
break;
|
|
1558
|
-
}
|
|
1596
|
+
if (response.status === 429 && isAccountQuota429(lastText)) break;
|
|
1597
|
+
// Generic resource exhaustion is a dead model, not a reason to walk every endpoint.
|
|
1598
|
+
if (response.status === 429 && !isRetryableRateLimit(lastText)) break;
|
|
1559
1599
|
if (![403, 404, 429, 500, 502, 503, 504].includes(response.status)) break;
|
|
1560
1600
|
}
|
|
1561
1601
|
|
|
@@ -1573,7 +1613,7 @@ export function streamAntigravity(
|
|
|
1573
1613
|
if (
|
|
1574
1614
|
dynamic?.id &&
|
|
1575
1615
|
!runtimeCandidates.includes(dynamic.id) &&
|
|
1576
|
-
|
|
1616
|
+
isUsableRuntimeModelId(dynamic.id)
|
|
1577
1617
|
) {
|
|
1578
1618
|
runtimeCandidates.push(dynamic.id);
|
|
1579
1619
|
continue;
|
|
@@ -1634,7 +1674,7 @@ export function streamAntigravity(
|
|
|
1634
1674
|
throw new Error(friendly);
|
|
1635
1675
|
}
|
|
1636
1676
|
throw new Error(
|
|
1637
|
-
`Antigravity API error (${response?.status
|
|
1677
|
+
`Antigravity API error (${publicErrorStatus(response?.status, friendly)}, ${formatRequestDiagnostics({ projectId, runtimeModel })}): ${friendly}`,
|
|
1638
1678
|
);
|
|
1639
1679
|
}
|
|
1640
1680
|
|
|
@@ -222,6 +222,7 @@ export type AccountUsage = {
|
|
|
222
222
|
quotaSummaryError?: string;
|
|
223
223
|
models: ModelQuotaRow[];
|
|
224
224
|
defaultAgentModelId?: string;
|
|
225
|
+
agentModelSorts?: unknown;
|
|
225
226
|
fetchedAt: number;
|
|
226
227
|
};
|
|
227
228
|
|
|
@@ -251,6 +252,8 @@ export type QuotaSummaryRaw = {
|
|
|
251
252
|
};
|
|
252
253
|
|
|
253
254
|
export type ModelInfoRaw = {
|
|
255
|
+
maxTokens?: unknown;
|
|
256
|
+
maxOutputTokens?: unknown;
|
|
254
257
|
isInternal?: unknown;
|
|
255
258
|
displayName?: unknown;
|
|
256
259
|
label?: unknown;
|
|
@@ -267,10 +270,20 @@ export type ModelInfoRaw = {
|
|
|
267
270
|
};
|
|
268
271
|
};
|
|
269
272
|
|
|
273
|
+
export type AgentModelSortGroup = {
|
|
274
|
+
modelIds?: unknown;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export type AgentModelSort = {
|
|
278
|
+
displayName?: unknown;
|
|
279
|
+
groups?: AgentModelSortGroup[];
|
|
280
|
+
};
|
|
281
|
+
|
|
270
282
|
export type AvailableModelsRaw = {
|
|
271
283
|
models?: Record<string, ModelInfoRaw>;
|
|
272
284
|
defaultAgentModelId?: unknown;
|
|
273
285
|
defaultAgentModel?: unknown;
|
|
286
|
+
agentModelSorts?: AgentModelSort[];
|
|
274
287
|
};
|
|
275
288
|
|
|
276
289
|
export type TierRaw = {
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import { isRecord } from "../utils/util.js";
|
|
17
17
|
import { safeError } from "../utils/security.js";
|
|
18
18
|
import { antigravityFetch } from "../utils/http.js";
|
|
19
|
+
import { extractRecommendedModelIds } from "../models/grouping.js";
|
|
19
20
|
import type {
|
|
20
21
|
AccountUsage,
|
|
21
22
|
ApiErrorBody,
|
|
@@ -142,10 +143,12 @@ function parseQuotaSummary(data: unknown): { groups: QuotaGroup[]; description?:
|
|
|
142
143
|
function parseModels(data: unknown): {
|
|
143
144
|
models: ModelQuotaRow[];
|
|
144
145
|
defaultAgentModelId?: string;
|
|
146
|
+
agentModelSorts?: unknown;
|
|
145
147
|
} {
|
|
146
148
|
const raw = (isRecord(data) ? data : {}) as AvailableModelsRaw;
|
|
147
149
|
const modelsObj = raw.models && isRecord(raw.models) ? raw.models : {};
|
|
148
150
|
const models: ModelQuotaRow[] = [];
|
|
151
|
+
const recommendedIds = extractRecommendedModelIds(raw.agentModelSorts);
|
|
149
152
|
for (const [modelId, info] of Object.entries(modelsObj)) {
|
|
150
153
|
if (!info || !isRecord(info)) continue;
|
|
151
154
|
if (info.isInternal || String(modelId).startsWith("chat_")) continue;
|
|
@@ -170,7 +173,7 @@ function parseModels(data: unknown): {
|
|
|
170
173
|
: undefined,
|
|
171
174
|
supportsThinking: !!info.supportsThinking,
|
|
172
175
|
supportsImages: !!info.supportsImages,
|
|
173
|
-
recommended: !!info.recommended,
|
|
176
|
+
recommended: !!info.recommended || (recommendedIds?.has(modelId) ?? false),
|
|
174
177
|
});
|
|
175
178
|
}
|
|
176
179
|
models.sort((a, b) => a.modelId.localeCompare(b.modelId));
|
|
@@ -180,6 +183,7 @@ function parseModels(data: unknown): {
|
|
|
180
183
|
raw.defaultAgentModelId || raw.defaultAgentModel
|
|
181
184
|
? String(raw.defaultAgentModelId || raw.defaultAgentModel)
|
|
182
185
|
: undefined,
|
|
186
|
+
agentModelSorts: raw.agentModelSorts,
|
|
183
187
|
};
|
|
184
188
|
}
|
|
185
189
|
|
|
@@ -260,7 +264,7 @@ export async function fetchAccountUsage(apiKeyRaw?: string): Promise<AccountUsag
|
|
|
260
264
|
const { groups, description } = summary
|
|
261
265
|
? parseQuotaSummary(summary.data)
|
|
262
266
|
: { groups: [], description: undefined };
|
|
263
|
-
const { models, defaultAgentModelId } = parseModels(available.data);
|
|
267
|
+
const { models, defaultAgentModelId, agentModelSorts } = parseModels(available.data);
|
|
264
268
|
|
|
265
269
|
const assistData = (isRecord(assistResult?.data) ? assistResult.data : {}) as LoadCodeAssistRaw;
|
|
266
270
|
const productTier = parseTier(assistData.currentTier);
|
|
@@ -285,6 +289,7 @@ export async function fetchAccountUsage(apiKeyRaw?: string): Promise<AccountUsag
|
|
|
285
289
|
quotaSummaryError,
|
|
286
290
|
models,
|
|
287
291
|
defaultAgentModelId,
|
|
292
|
+
agentModelSorts,
|
|
288
293
|
fetchedAt: Date.now(),
|
|
289
294
|
};
|
|
290
295
|
}
|
|
@@ -331,9 +336,12 @@ export function formatModelsList(usage: AccountUsage, opts?: { all?: boolean }):
|
|
|
331
336
|
if (usage.defaultAgentModelId) lines.push(`defaultAgentModel=${usage.defaultAgentModelId}`);
|
|
332
337
|
lines.push("");
|
|
333
338
|
|
|
339
|
+
const recommendedIds = extractRecommendedModelIds(usage.agentModelSorts);
|
|
334
340
|
const rows = opts?.all
|
|
335
341
|
? usage.models
|
|
336
|
-
:
|
|
342
|
+
: recommendedIds && recommendedIds.size > 0
|
|
343
|
+
? usage.models.filter((m) => recommendedIds.has(m.modelId))
|
|
344
|
+
: usage.models.filter((m) => !/tab_|chat_/i.test(m.modelId));
|
|
337
345
|
|
|
338
346
|
if (!rows.length) {
|
|
339
347
|
lines.push("No models returned.");
|
|
@@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.42.0] - 2026-10-17
|
|
8
|
+
|
|
9
|
+
### Highlights
|
|
10
|
+
|
|
11
|
+
- Search with DeepSeek: a new provider for DeepSeek's own Search API, used when you pick it.
|
|
12
|
+
- Page answers and search summaries now work when your selected model is a Pi virtual model, such as a router.
|
|
13
|
+
- Gemini can sign in on Google Compute Engine with the machine's attached service account, with no credentials file.
|
|
14
|
+
- `!command` API key sources work on Windows the way they do in Pi itself, so commands like `$HOME/bin/secret-get` run.
|
|
15
|
+
- An opt-in setting keeps the web tools off every request until they're needed and lets Pi's `tool_search` find them.
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- DeepSeek search provider, backed by DeepSeek's [Search API](https://api-docs.deepseek.com/guides/search). Select `provider: "deepseek"` or add it to `searchRouting`, and set `deepseekApiKey` or `DEEPSEEK_API_KEY`. DeepSeek bills each successful search, so `auto` and `all` never use it. Allowed and excluded domains become `site:` and `-site:` filters, and `recencyFilter` becomes an `after:` date. DeepSeek accepts queries up to 128 characters including those filters, so a longer one fails before anything is sent. Thanks to [@syxb2](https://github.com/syxb2) for [issue #577](https://github.com/nicobailon/pi-web-access/issues/577) and [@Lang646](https://github.com/Lang646) for the API details on [issue #119](https://github.com/nicobailon/pi-web-access/issues/119).
|
|
20
|
+
- `geminiAuth: "adc"` now works on Google Compute Engine with no credentials file. When neither `GOOGLE_APPLICATION_CREDENTIALS` nor `~/.config/gcloud/application_default_credentials.json` exists, it uses the token of the machine's attached service account. `GCE_METADATA_HOST` changes the metadata host, and `METADATA_SERVER_DETECTION=none` turns this off. Thanks to [@sergiopadure](https://github.com/sergiopadure) for [PR #572](https://github.com/nicobailon/pi-web-access/pull/572).
|
|
21
|
+
- `"toolExposure": "deferred"` in `web-search.json` keeps `web_search`, `source_check`, `fetch_content`, and `get_search_content` off every request until `web_enable` or Pi's `tool_search` loads them. It always uses dynamic activation, so it can't be combined with `"toolActivation": "eager"`. The default, `"direct"`, works as before. Thanks to [@hannonpi1228](https://github.com/hannonpi1228) for [issue #575](https://github.com/nicobailon/pi-web-access/issues/575) and [PR #576](https://github.com/nicobailon/pi-web-access/pull/576).
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- `fetch_content` answer mode and search summaries work with Pi virtual models. Before, answer mode failed with `Virtual model … must be routed before streaming`, and summaries quietly fell back to the plain list of results. Thanks to [@yansongda](https://github.com/yansongda) for [issue #574](https://github.com/nicobailon/pi-web-access/issues/574).
|
|
26
|
+
- On Windows, `!command` API key sources run in Git Bash (or `bash.exe` on `PATH`), as Pi's own `!command` settings do, so POSIX syntax like `$HOME` works. Without bash they still run in `cmd.exe`. Standard Windows variables such as `USERPROFILE` and `SystemRoot` now reach the command. Thanks to [@estrizhok](https://github.com/estrizhok) for [issue #571](https://github.com/nicobailon/pi-web-access/issues/571).
|
|
27
|
+
|
|
7
28
|
## [0.41.0] - 2026-10-14
|
|
8
29
|
|
|
9
30
|
### Highlights
|
|
@@ -165,7 +165,7 @@ fetch_content({ url: "/path/to/recording.mp4", prompt: "What error appears on sc
|
|
|
165
165
|
|
|
166
166
|
### web_search
|
|
167
167
|
|
|
168
|
-
Search the web via OpenAI, Brave, Parallel, TinyFish, Search1API, Searchinfinity, Querit, Tavily, Firecrawl, Jina, SERPdive, Kagi, Bocha, Ollama, AnySearch, XCrawl, Valyu, xAI, Mistral, Bright Data SERP, SerpBase, SerpApi, Serper, Serply, You.com, keyless Keenable, Ceramic, self-hosted SearXNG, explicit-only degoog, keyless DuckDuckGo, Exa, Perplexity AI, Gemini, or Kimi. The default `none` workflow makes no summary-generation model call and opens no curator/browser: it returns bounded raw results, identifies the provider used for each query, and stores the full results for retrieval by responseId. The selected search provider may itself be model-backed.
|
|
168
|
+
Search the web via OpenAI, Brave, Parallel, TinyFish, Search1API, Searchinfinity, Querit, Tavily, Firecrawl, Jina, SERPdive, Kagi, Bocha, Ollama, AnySearch, XCrawl, Valyu, xAI, Mistral, Bright Data SERP, SerpBase, SerpApi, Serper, Serply, You.com, keyless Keenable, Ceramic, DeepSeek, self-hosted SearXNG, explicit-only degoog, keyless DuckDuckGo, Exa, Perplexity AI, Gemini, or Kimi. The default `none` workflow makes no summary-generation model call and opens no curator/browser: it returns bounded raw results, identifies the provider used for each query, and stores the full results for retrieval by responseId. The selected search provider may itself be model-backed.
|
|
169
169
|
|
|
170
170
|
```typescript
|
|
171
171
|
web_search({ query: "rust async programming" })
|
|
@@ -189,7 +189,7 @@ web_search({ queries: ["query 1", "query 2"], workflow: "auto-summary" })
|
|
|
189
189
|
| `recencyFilter` | `day`, `week`, `month`, or `year` |
|
|
190
190
|
| `domainFilter` | Limit to domains (prefix with `-` to exclude) |
|
|
191
191
|
| `category` | Exa only: restrict results to a category such as `news` or `research paper`; other providers ignore it. Without an API key, if Exa's filtered search is unavailable, the category is added to the query instead |
|
|
192
|
-
| `provider` | Configured provider when omitted or set to `auto`; `all` searches every eligible provider except Parallel MCP, degoog, DuckDuckGo, Kimi, AnySearch, XCrawl, Valyu, xAI, Mistral, Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Baizhi, Z.ai, Keenable, and
|
|
192
|
+
| `provider` | Configured provider when omitted or set to `auto`; `all` searches every eligible provider except Parallel MCP, degoog, DuckDuckGo, Kimi, AnySearch, XCrawl, Valyu, xAI, Mistral, Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Baizhi, Z.ai, Keenable, Ceramic, and DeepSeek simultaneously; otherwise `openai`, `brave`, `parallel`, `parallel-mcp`, `tinyfish`, `search1api`, `searchinfinity`, `querit`, `tavily`, `you`, `firecrawl`, `jina`, `serpdive`, `kagi`, `bocha`, `ollama`, `anysearch`, `xcrawl`, `valyu`, `xai`, `mistral`, `brightdata`, `serpbase`, `serpapi`, `serper`, `serply`, `baizhi`, `zai`, `keenable`, `ceramic`, `deepseek`, `searxng`, `degoog`, `duckduckgo`, `exa`, `perplexity`, `gemini`, or `kimi` (auto-selects when no provider or routing is configured; Parallel MCP, degoog, DuckDuckGo, Kimi, AnySearch, XCrawl, Valyu, xAI, Mistral, Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Baizhi, Z.ai, Keenable, Ceramic, and DeepSeek are explicit-only) |
|
|
193
193
|
| `includeContent` | Fetch full page content from sources in background |
|
|
194
194
|
| `workflow` | `none` (skip curator; fresh-install default), `summary-review` (open curator and auto-generate a summary draft), or `auto-summary` (generate a summary without opening the curator) |
|
|
195
195
|
|
|
@@ -480,6 +480,7 @@ Config defaults to `~/.pi/agent/web-search.json` when neither `PI_CODING_AGENT_D
|
|
|
480
480
|
"valyuApiKey": "$VALYU_API_KEY",
|
|
481
481
|
"keenableApiKey": "$KEENABLE_API_KEY",
|
|
482
482
|
"ceramicApiKey": "$CERAMIC_API_KEY",
|
|
483
|
+
"deepseekApiKey": "$DEEPSEEK_API_KEY",
|
|
483
484
|
"serpbaseApiKey": "$SERPBASE_API_KEY",
|
|
484
485
|
"serpapiApiKey": "$SERPAPI_KEY",
|
|
485
486
|
"serperApiKey": "$SERPER_API_KEY",
|
|
@@ -620,7 +621,7 @@ Config defaults to `~/.pi/agent/web-search.json` when neither `PI_CODING_AGENT_D
|
|
|
620
621
|
|
|
621
622
|
`summaryInstructions` appends custom text to the Requirements section of the summary prompt used by the curator UI and `auto-summary` mode (e.g. `"- Preserve concrete figures verbatim: prices, limits, versions, dates.\n- Name the product version each claim applies to."`). The text is passed verbatim to the summary model, so use one `- ` bullet per requirement. It is additive: the built-in guardrails (no invented sources, explicit weak/conflicting-evidence notes, the Sources section) always stay in place, and curator regeneration feedback is still appended afterwards. Missing, non-string, or blank values leave the default prompt unchanged.
|
|
622
623
|
|
|
623
|
-
All provider API-key fields (`openaiApiKey`, `braveApiKey`, `parallelApiKey`, `tinyfishApiKey`, `search1apiApiKey`, `searchinfinityApiKey`, `queritApiKey`, `tavilyApiKey`, `youApiKey`, `jinaApiKey`, `serpdiveApiKey`, `kagiApiKey`, `bochaApiKey`, `ollamaApiKey`, `valyuApiKey`, `serpbaseApiKey`, `serpapiApiKey`, `serperApiKey`, `serplyApiKey`, `baizhiApiKey`, `zaiApiKey`, `keenableApiKey`, `ceramicApiKey`, `degoogApiKey`, `anysearchApiKey`, `xcrawlApiKey`, `xaiApiKey`, `mistralApiKey`, `brightdataApiKey`, `firecrawlApiKey`, `crawl4aiApiToken`, `exaApiKey`, `perplexityApiKey`, `geminiApiKey`, `datalabApiKey`, and `cloudflareApiKey`) accept explicit credential sources. Use `$NAME` or `${NAME}` to read one named environment variable, or prefix a trusted local shell command with `!` to resolve one value at provider request time. Escape `$$` as a literal leading `$` and `$!` as a literal leading `!`:
|
|
624
|
+
All provider API-key fields (`openaiApiKey`, `braveApiKey`, `parallelApiKey`, `tinyfishApiKey`, `search1apiApiKey`, `searchinfinityApiKey`, `queritApiKey`, `tavilyApiKey`, `youApiKey`, `jinaApiKey`, `serpdiveApiKey`, `kagiApiKey`, `bochaApiKey`, `ollamaApiKey`, `valyuApiKey`, `serpbaseApiKey`, `serpapiApiKey`, `serperApiKey`, `serplyApiKey`, `baizhiApiKey`, `zaiApiKey`, `keenableApiKey`, `ceramicApiKey`, `deepseekApiKey`, `degoogApiKey`, `anysearchApiKey`, `xcrawlApiKey`, `xaiApiKey`, `mistralApiKey`, `brightdataApiKey`, `firecrawlApiKey`, `crawl4aiApiToken`, `exaApiKey`, `perplexityApiKey`, `geminiApiKey`, `datalabApiKey`, and `cloudflareApiKey`) accept explicit credential sources. Use `$NAME` or `${NAME}` to read one named environment variable, or prefix a trusted local shell command with `!` to resolve one value at provider request time. Escape `$$` as a literal leading `$` and `$!` as a literal leading `!`:
|
|
624
625
|
|
|
625
626
|
```json
|
|
626
627
|
{
|
|
@@ -631,9 +632,9 @@ All provider API-key fields (`openaiApiKey`, `braveApiKey`, `parallelApiKey`, `t
|
|
|
631
632
|
}
|
|
632
633
|
```
|
|
633
634
|
|
|
634
|
-
This syntax applies to provider credentials only; other configuration fields are not interpolated. `firecrawlApiKey`, `crawl4aiApiToken`, `kagiApiKey`, `ollamaApiKey`, `valyuApiKey`, `serpbaseApiKey`, `serpapiApiKey`, `serperApiKey`, `serplyApiKey`, `baizhiApiKey`, `zaiApiKey`, `keenableApiKey`, `ceramicApiKey`, `degoogApiKey`, `mistralApiKey`, and `brightdataApiKey` use the same credential-source rules, while `braveBaseUrl`, `exaBaseUrl`, `tavilyBaseUrl`, `firecrawlBaseUrl`, `firecrawlApiVersion`, `firecrawlFreshScrape`, `firecrawlPdfMaxPages`, `crawl4aiBaseUrl`, `degoogBaseUrl`, `degoogEngines`, `brightdataSerpZone`, `brightdataUnlockerZone`, and `zaiEndpoint` are literal config values.
|
|
635
|
+
This syntax applies to provider credentials only; other configuration fields are not interpolated. `firecrawlApiKey`, `crawl4aiApiToken`, `kagiApiKey`, `ollamaApiKey`, `valyuApiKey`, `serpbaseApiKey`, `serpapiApiKey`, `serperApiKey`, `serplyApiKey`, `baizhiApiKey`, `zaiApiKey`, `keenableApiKey`, `ceramicApiKey`, `deepseekApiKey`, `degoogApiKey`, `mistralApiKey`, and `brightdataApiKey` use the same credential-source rules, while `braveBaseUrl`, `exaBaseUrl`, `tavilyBaseUrl`, `firecrawlBaseUrl`, `firecrawlApiVersion`, `firecrawlFreshScrape`, `firecrawlPdfMaxPages`, `crawl4aiBaseUrl`, `degoogBaseUrl`, `degoogEngines`, `brightdataSerpZone`, `brightdataUnlockerZone`, and `zaiEndpoint` are literal config values.
|
|
635
636
|
|
|
636
|
-
A command source is not run while the extension loads or registers tools. Each selected provider request runs it again with a five-second timeout, a 16 KiB output limit, a minimized environment, and a one-line non-empty stdout requirement. Command text and stderr are omitted from errors. These commands are trusted local configuration, not a same-user process isolation boundary; use absolute executable paths and protect the config file. `OP_SESSION_*` and `OP_SERVICE_ACCOUNT_TOKEN`, when present in Pi's environment, are forwarded to trusted resolver commands so 1Password CLI sessions and service accounts can be reused without storing their credentials in config. For example, `"braveApiKey": "!/absolute/path/to/op read 'op://Automation/Brave/credential'"` resolves that item after you replace the executable placeholder with your trusted installation's absolute path, but the `op://` argument is not an authorization boundary: every configured resolver command that receives the token can exercise all vault and item permissions granted to its service account. Prefer a narrowly scoped service account. An explicit source overrides legacy provider environment variables and fails that provider locally rather than falling back with a stale credential. Direct Google Gemini API requests send the resolved key only in the `x-goog-api-key` header, never in the URL.
|
|
637
|
+
A command source is not run while the extension loads or registers tools. Each selected provider request runs it again with a five-second timeout, a 16 KiB output limit, a minimized environment, and a one-line non-empty stdout requirement. Command text and stderr are omitted from errors. On Windows the command runs in Git Bash (or `bash.exe` on `PATH`), like Pi's own `!command` config values, so POSIX syntax such as `$HOME` works; it falls back to `cmd.exe` when no bash is found. These commands are trusted local configuration, not a same-user process isolation boundary; use absolute executable paths and protect the config file. `OP_SESSION_*` and `OP_SERVICE_ACCOUNT_TOKEN`, when present in Pi's environment, are forwarded to trusted resolver commands so 1Password CLI sessions and service accounts can be reused without storing their credentials in config. For example, `"braveApiKey": "!/absolute/path/to/op read 'op://Automation/Brave/credential'"` resolves that item after you replace the executable placeholder with your trusted installation's absolute path, but the `op://` argument is not an authorization boundary: every configured resolver command that receives the token can exercise all vault and item permissions granted to its service account. Prefer a narrowly scoped service account. An explicit source overrides legacy provider environment variables and fails that provider locally rather than falling back with a stale credential. Direct Google Gemini API requests send the resolved key only in the `x-goog-api-key` header, never in the URL.
|
|
637
638
|
|
|
638
639
|
`mistralSearchModel` defaults to `mistral-small-latest` and must be a non-empty string. `mistralSearchTool` defaults to `web_search` and accepts only `web_search` or the opt-in `web_search_premium` tool.
|
|
639
640
|
|
|
@@ -685,6 +686,8 @@ Bright Data Web Unlocker is a paid `fetch_content` fallback after Parallel and b
|
|
|
685
686
|
|
|
686
687
|
**Ceramic.** Set `ceramicApiKey` or `CERAMIC_API_KEY` ([get a key](https://platform.ceramic.ai/keys)) and select `provider: "ceramic"` to query [Ceramic](https://www.ceramic.ai)'s web search API, a paid keyword search index with free starter credits. Ceramic is explicit-only: it is never chosen by `auto` or `provider: "all"`, but it can be configured as the named provider or added to `searchRouting`. Ceramic matches keywords rather than questions, so short keyword queries work best. Allowed domains become `site:` clauses in the query; excluded domains are only removed from the returned results, because Ceramic documents no exclusion syntax, so a search with exclusions can return fewer results than requested. `recencyFilter` is unsupported and is not sent, because Ceramic has no date filter. Result snippets are capped at 500 characters.
|
|
687
688
|
|
|
689
|
+
**DeepSeek.** Set `deepseekApiKey` or `DEEPSEEK_API_KEY` ([get a key](https://platform.deepseek.com/api_keys)) and select `provider: "deepseek"` to query DeepSeek's [Search API](https://api-docs.deepseek.com/guides/search), which is billed per successful request. DeepSeek is explicit-only: it is never chosen by `auto` or `provider: "all"`, but it can be configured as the named provider or added to `searchRouting`. Allowed domains become `site:` clauses, excluded domains become `-site:` clauses, and `recencyFilter` becomes an `after:` date in the query. DeepSeek accepts at most 128 characters per query including those clauses, so a longer query fails before any request is sent. Each result's snippet is DeepSeek's model-oriented `summary`, capped at 800 characters.
|
|
690
|
+
|
|
688
691
|
**Serper.** Set `serperApiKey` or `SERPER_API_KEY` and select `provider: "serper"` to query Serper's Google Search API. Serper is explicit-only: it is never chosen by `auto` or `provider: "all"`, but it can be configured as the named provider or added to `searchRouting`.
|
|
689
692
|
|
|
690
693
|
**Tavily key pool.** Set `TAVILY_API_KEY_1` through `TAVILY_API_KEY_20` to try another key when Tavily returns HTTP 401, 402, 403, 429, or 432. `TAVILY_API_KEY_INDEX` picks the first slot to try (default `1`). Search tries each distinct numbered key once, wrapping around, then tries `tavilyApiKey` / `TAVILY_API_KEY`. Explicit `$VAR` and `!command` sources still fail closed. All attempts share the 60-second search deadline.
|
|
@@ -701,9 +704,10 @@ The Baizhi input contract is based on the [published September 16 discovery snap
|
|
|
701
704
|
|
|
702
705
|
**Parallel MCP.** Select `provider: "parallel-mcp"` to use Parallel Search MCP without an API key, or add it to `searchRouting`. It is explicit-only and is never chosen by `auto` or `provider: "all"`; the existing `parallel` provider remains the key-required REST API. A configured `parallelApiKey` or `PARALLEL_API_KEY` is sent as an optional Bearer token for higher MCP limits. To use MCP `web_fetch`, add `parallel-mcp` to `fetchRouting.providers` and set `fetchRouting.allowRemoteHostedProviders` to `true`; it is not part of the default fetch route.
|
|
703
706
|
|
|
704
|
-
Without an explicit `$` or `!` source, `OPENAI_API_KEY`, `BRAVE_API_KEY`, `PARALLEL_API_KEY`, `TINYFISH_API_KEY`, `SEARCH1API_KEY`, `SEARCHINFINITY_API_KEY`, `QUERIT_API_KEY`, `TAVILY_API_KEY`, `YDC_API_KEY`, `JINA_API_KEY`, `SERPDIVE_API_KEY`, `KAGI_API_KEY`, `BOCHA_API_KEY`, `OLLAMA_API_KEY`, `SERPBASE_API_KEY`, `SERPAPI_KEY`, `SERPER_API_KEY`, `SERPLY_API_KEY`, `BAIZHI_API_KEY`, `ZAI_API_KEY`, `KEENABLE_API_KEY`, `CERAMIC_API_KEY`, `ANYSEARCH_API_KEY`, `XCRAWL_API_KEY`, `VALYU_API_KEY`, `XAI_API_KEY`, `MISTRAL_API_KEY`, `BRIGHTDATA_API_KEY`, `FIRECRAWL_API_KEY`, `CRAWL4AI_API_TOKEN`, `DEGOOG_API_KEY`, `EXA_API_KEY`, `GEMINI_API_KEY`, `DATALAB_API_KEY`, `DATALAB_PROCESSING_LOCATION`, `DATALAB_MODE`, `DATALAB_API_BASE`, `PERPLEXITY_API_KEY`, `GOOGLE_GEMINI_BASE_URL`, and `CLOUDFLARE_API_KEY` env vars retain their existing precedence over literal config file values. `openaiResponsesUrl` can point OpenAI `web_search` and `source_check` at a third-party gateway that supports the OpenAI Responses API and web search tool; it is an explicit endpoint override, not derived from Pi model provider settings, and defaults to `https://api.openai.com/v1/responses`. `openaiSearchModel` pins the model id used for OpenAI `web_search`, bypassing automatic selection (newest Luna model, then newest bare `gpt-N` or `gpt-N.N` id, then newest other `gpt-<version>` id; `gpt-6-luna` when only an API key is configured); the id is sent verbatim with whichever OpenAI auth resolves, so gateway-only model ids work too. `xaiSearchModel` similarly pins the xAI search model. `openaiSearchProviders` sets which Pi model providers OpenAI `web_search` resolves login credentials from, in priority order; it defaults to `["openai-codex", "openai"]`, entries that are not registered or not signed in are skipped, and an empty array skips Pi credentials entirely so the `openaiApiKey` / `OPENAI_API_KEY` fallback applies. Useful for choosing between multiple Codex accounts (for example a second account registered by an extension) or forcing API-key billing while signed into Codex. Configured Exa API keys use Exa's own account limits directly; any legacy local `exa-usage.json` file is ignored. `GOOGLE_GEMINI_BASE_URL` overrides the Gemini API host for Gemini generate-content calls such as search, URL context, YouTube, and local video analysis. Set it to a bare host with no trailing slash and no version segment, for example `https://my-gateway.example.com/gemini`; `geminiBaseUrl` is the config-file equivalent. When the configured host contains `gateway.ai.cloudflare.com`, authentication uses `cf-aig-authorization: Bearer <token>` from `CLOUDFLARE_API_KEY` or `cloudflareApiKey`, and `GEMINI_API_KEY` is not required for generate-content calls. Alternatively, set `geminiAuth` to `"adc"` to authenticate Gemini generate-content calls with Google Application Default Credentials (ADC) instead of an API key; calls go to the Vertex AI endpoint (`aiplatform.googleapis.com`) with an OAuth bearer token minted from the ADC file (`GOOGLE_APPLICATION_CREDENTIALS` or `~/.config/gcloud/application_default_credentials.json`, i.e. `gcloud auth application-default login`). `geminiProject`/`geminiLocation` set the Vertex project and location and fall back to the `GOOGLE_CLOUD_PROJECT`/`GOOGLE_CLOUD_LOCATION` (or `GCLOUD_PROJECT`) env vars; project and location are required. ADC supports `authorized_user` (OAuth refresh token) and `service_account` (JWT assertion) credential files, and tokens are cached and refreshed from expiry. ADC mode covers search, URL context, and PDF/inline-data extraction; YouTube and local video analysis still go through the Gemini Files API, so they fall back to Gemini Web unless a `GEMINI_API_KEY` is also configured. The access token is treated as a credential and is redacted from errors. Local video file upload still uses Google's Files API directly, so gateway-only video extraction falls back to Gemini Web unless a `GEMINI_API_KEY` is also configured. `provider` or `searchProvider` sets the default search provider and is used when a tool call omits `provider` or sends `"auto"`: `"all"`, `"openai"`, `"brave"`, `"parallel"`, `"parallel-mcp"`, `"tinyfish"`, `"search1api"`, `"searchinfinity"`, `"querit"`, `"tavily"`, `"firecrawl"`, `"jina"`, `"serpdive"`, `"kagi"`, `"bocha"`, `"ollama"`, `"anysearch"`, `"xcrawl"`, `"valyu"`, `"xai"`, `"mistral"`, `"brightdata"`, `"serpbase"`, `"serpapi"`, `"serper"`, `"serply"`, `"you"`, `"baizhi"`, `"zai"`, `"keenable"`, `"ceramic"`, `"searxng"`, `"degoog"`, `"exa"`, `"perplexity"`, or `"gemini"`. Parallel MCP, degoog, AnySearch, XCrawl, Valyu, xAI, Mistral, Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Baizhi, Z.ai, Keenable, and Ceramic are never selected by `auto`; choose them explicitly or place them in `searchRouting`. If either single-provider field is configured, it takes precedence over `searchRouting`. Otherwise, `searchRouting` can opt into an ordered `providers` list and an explicit `fallbackOn` list containing `"transient"`, `"quota"`, `"network"`, and/or `"invalid-response"`; only those typed failures continue to the next available candidate. `"all"` is not valid inside `searchRouting.providers`, because that list defines sequential fallback rather than multi-provider aggregation. Named providers remain strict, and exhausted routes return per-provider diagnostics. `provider` can also be a non-empty array of named providers such as `["brave", "exa"]`; those providers run concurrently using the same aggregation path as `"all"`, while `"auto"` and `"all"` are invalid inside arrays. Random, weighted, sticky, and cooldown routing are not enabled. This is also updated automatically when you change the provider in the curator UI. Set `webSearch.enabled` to `false` to unregister the configured search and source-check tools while leaving fetch/content tools available. `toolNames` can opt into alternate public tool names for environments where another extension or model reserves the defaults, without changing behavior: `webSearch`, `sourceCheck`, `fetchContent`, and `getSearchContent` default to `web_search`, `source_check`, `fetch_content`, and `get_search_content`. `workflow` sets the default search workflow: `"none"` (default; raw results, no curator), `"summary-review"` (opens curator with an auto-generated summary draft), or `"auto-summary"` (returns a model-generated summary without opening the browser curator). Overridden per-call via the `workflow` parameter on the configured search tool, or toggled at runtime with `/curator`. `browserCookies.profile` pins Gemini Web cookie lookup to a specific Chromium profile. When omitted, detected Chromium profiles are scanned in stable order and the first profile containing the required Gemini cookies is used. macOS discovery supports Helium, Chrome, Brave, and Arc; Linux discovery supports Chromium and Chrome. `allowBrowserCookies` enables Chromium cookie extraction for Gemini Web; it defaults to `false` to avoid browser data access and surprise macOS Keychain prompts. You can also set `PI_ALLOW_BROWSER_COOKIES=1`. Cookie databases are copied to a temporary read-only working copy; the reader uses `node:sqlite` when available and otherwise tries the `sqlite3` CLI or Python's standard-library SQLite module. `searchModel` overrides the Gemini API model used by the configured search tool without changing URL, YouTube, or video extraction defaults. Gemini API grounded search uses `gemini-3.6-flash` by default; set `searchModel` to choose another model. Gemini Web browser-cookie fallback uses its separate `gemini-3.1-pro` default because Gemini Web relies on private header values; explicitly configured unsupported Web models fail instead of silently falling back to 2.5 Flash. `summaryModel` sets the default model used for generating summary drafts in the curator UI and `auto-summary` mode (e.g. `"anthropic/claude-haiku-4-5"`, `"openai-codex/gpt-5.3-codex-spark"`, or `"openrouter/nvidia/nemotron-3-super-120b-a12b:free"`). Preferred summary and query-rewrite models also resolve through routed provider registrations such as OpenRouter when the native provider is unavailable. When Pi `enabledModels` is configured, summaries are limited to that allowlist; if no enabled summary model is available, the tool returns a deterministic summary instead of calling an unrelated model. `summaryGenerationDeadlineMs` sets the maximum time for one summary model attempt in the curator UI and `auto-summary` mode. It defaults to `30000`, must be a positive integer, and is capped at `600000`. `maxInlineContentChars` sets the direct `fetch_content` content slice and the default and maximum `get_search_content` slice. It defaults to `30000`, must be a positive integer, and is capped at `200000`; full fetched content remains stored for later retrieval. `curatorTimeoutSeconds` controls the initial curator idle timeout (default `20`, max `600`); users can still adjust the timer in the curator UI. `ssrf.allowRanges` lists CIDR ranges (e.g. `"198.18.0.0/15"`, `"fd00::/8"`) exempted from the SSRF guard that otherwise blocks private/reserved IP ranges. This unblocks `fetch_content`/`web_search` on hosts whose network proxy runs in TUN + fake-IP mode (Surge, Clash, Mihomo, Stash, ...), where public domains resolve into a synthetic reserved range. It is **off by default** — the guard stays fully enabled unless you list ranges here. Use the narrowest range that covers your proxy's fake-IP pool. All-address CIDRs such as `0.0.0.0/0` and `::/0` are rejected. `ssrf.trustEnvProxy` is a separate opt-in for networks where only the proxy can resolve hostnames; it skips local DNS preflight only for hostnames sent through the configured `proxy` or, when none is configured, hostnames covered by valid HTTP(S) proxy env vars in sandboxes that route through them, and still blocks localhost, literal private IP targets, and `NO_PROXY` matches. It does not configure proxy transport.
|
|
707
|
+
Without an explicit `$` or `!` source, `OPENAI_API_KEY`, `BRAVE_API_KEY`, `PARALLEL_API_KEY`, `TINYFISH_API_KEY`, `SEARCH1API_KEY`, `SEARCHINFINITY_API_KEY`, `QUERIT_API_KEY`, `TAVILY_API_KEY`, `YDC_API_KEY`, `JINA_API_KEY`, `SERPDIVE_API_KEY`, `KAGI_API_KEY`, `BOCHA_API_KEY`, `OLLAMA_API_KEY`, `SERPBASE_API_KEY`, `SERPAPI_KEY`, `SERPER_API_KEY`, `SERPLY_API_KEY`, `BAIZHI_API_KEY`, `ZAI_API_KEY`, `KEENABLE_API_KEY`, `CERAMIC_API_KEY`, `DEEPSEEK_API_KEY`, `ANYSEARCH_API_KEY`, `XCRAWL_API_KEY`, `VALYU_API_KEY`, `XAI_API_KEY`, `MISTRAL_API_KEY`, `BRIGHTDATA_API_KEY`, `FIRECRAWL_API_KEY`, `CRAWL4AI_API_TOKEN`, `DEGOOG_API_KEY`, `EXA_API_KEY`, `GEMINI_API_KEY`, `DATALAB_API_KEY`, `DATALAB_PROCESSING_LOCATION`, `DATALAB_MODE`, `DATALAB_API_BASE`, `PERPLEXITY_API_KEY`, `GOOGLE_GEMINI_BASE_URL`, and `CLOUDFLARE_API_KEY` env vars retain their existing precedence over literal config file values. `openaiResponsesUrl` can point OpenAI `web_search` and `source_check` at a third-party gateway that supports the OpenAI Responses API and web search tool; it is an explicit endpoint override, not derived from Pi model provider settings, and defaults to `https://api.openai.com/v1/responses`. `openaiSearchModel` pins the model id used for OpenAI `web_search`, bypassing automatic selection (newest Luna model, then newest bare `gpt-N` or `gpt-N.N` id, then newest other `gpt-<version>` id; `gpt-6-luna` when only an API key is configured); the id is sent verbatim with whichever OpenAI auth resolves, so gateway-only model ids work too. `xaiSearchModel` similarly pins the xAI search model. `openaiSearchProviders` sets which Pi model providers OpenAI `web_search` resolves login credentials from, in priority order; it defaults to `["openai-codex", "openai"]`, entries that are not registered or not signed in are skipped, and an empty array skips Pi credentials entirely so the `openaiApiKey` / `OPENAI_API_KEY` fallback applies. Useful for choosing between multiple Codex accounts (for example a second account registered by an extension) or forcing API-key billing while signed into Codex. Configured Exa API keys use Exa's own account limits directly; any legacy local `exa-usage.json` file is ignored. `GOOGLE_GEMINI_BASE_URL` overrides the Gemini API host for Gemini generate-content calls such as search, URL context, YouTube, and local video analysis. Set it to a bare host with no trailing slash and no version segment, for example `https://my-gateway.example.com/gemini`; `geminiBaseUrl` is the config-file equivalent. When the configured host contains `gateway.ai.cloudflare.com`, authentication uses `cf-aig-authorization: Bearer <token>` from `CLOUDFLARE_API_KEY` or `cloudflareApiKey`, and `GEMINI_API_KEY` is not required for generate-content calls. Alternatively, set `geminiAuth` to `"adc"` to authenticate Gemini generate-content calls with Google Application Default Credentials (ADC) instead of an API key; calls go to the Vertex AI endpoint (`aiplatform.googleapis.com`) with an OAuth bearer token minted from the ADC file (`GOOGLE_APPLICATION_CREDENTIALS` or `~/.config/gcloud/application_default_credentials.json`, i.e. `gcloud auth application-default login`) or, on Compute Engine, from the metadata server. `geminiProject`/`geminiLocation` set the Vertex project and location and fall back to the `GOOGLE_CLOUD_PROJECT`/`GOOGLE_CLOUD_LOCATION` (or `GCLOUD_PROJECT`) env vars; project and location are required. ADC supports `authorized_user` (OAuth refresh token) and `service_account` (JWT assertion) credential files, and when neither `GOOGLE_APPLICATION_CREDENTIALS` nor `~/.config/gcloud/application_default_credentials.json` exists and Pi runs on Google Compute Engine, ADC uses the attached service account token from the GCE metadata server (`GCE_METADATA_HOST` overrides the host; `METADATA_SERVER_DETECTION=none` disables it); tokens are cached and refreshed from expiry. ADC mode covers search, URL context, and PDF/inline-data extraction; YouTube and local video analysis still go through the Gemini Files API, so they fall back to Gemini Web unless a `GEMINI_API_KEY` is also configured. The access token is treated as a credential and is redacted from errors. Local video file upload still uses Google's Files API directly, so gateway-only video extraction falls back to Gemini Web unless a `GEMINI_API_KEY` is also configured. `provider` or `searchProvider` sets the default search provider and is used when a tool call omits `provider` or sends `"auto"`: `"all"`, `"openai"`, `"brave"`, `"parallel"`, `"parallel-mcp"`, `"tinyfish"`, `"search1api"`, `"searchinfinity"`, `"querit"`, `"tavily"`, `"firecrawl"`, `"jina"`, `"serpdive"`, `"kagi"`, `"bocha"`, `"ollama"`, `"anysearch"`, `"xcrawl"`, `"valyu"`, `"xai"`, `"mistral"`, `"brightdata"`, `"serpbase"`, `"serpapi"`, `"serper"`, `"serply"`, `"you"`, `"baizhi"`, `"zai"`, `"keenable"`, `"ceramic"`, `"deepseek"`, `"searxng"`, `"degoog"`, `"exa"`, `"perplexity"`, or `"gemini"`. Parallel MCP, degoog, AnySearch, XCrawl, Valyu, xAI, Mistral, Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Baizhi, Z.ai, Keenable, Ceramic, and DeepSeek are never selected by `auto`; choose them explicitly or place them in `searchRouting`. If either single-provider field is configured, it takes precedence over `searchRouting`. Otherwise, `searchRouting` can opt into an ordered `providers` list and an explicit `fallbackOn` list containing `"transient"`, `"quota"`, `"network"`, and/or `"invalid-response"`; only those typed failures continue to the next available candidate. `"all"` is not valid inside `searchRouting.providers`, because that list defines sequential fallback rather than multi-provider aggregation. Named providers remain strict, and exhausted routes return per-provider diagnostics. `provider` can also be a non-empty array of named providers such as `["brave", "exa"]`; those providers run concurrently using the same aggregation path as `"all"`, while `"auto"` and `"all"` are invalid inside arrays. Random, weighted, sticky, and cooldown routing are not enabled. This is also updated automatically when you change the provider in the curator UI. Set `webSearch.enabled` to `false` to unregister the configured search and source-check tools while leaving fetch/content tools available. `toolNames` can opt into alternate public tool names for environments where another extension or model reserves the defaults, without changing behavior: `webSearch`, `sourceCheck`, `fetchContent`, and `getSearchContent` default to `web_search`, `source_check`, `fetch_content`, and `get_search_content`. `workflow` sets the default search workflow: `"none"` (default; raw results, no curator), `"summary-review"` (opens curator with an auto-generated summary draft), or `"auto-summary"` (returns a model-generated summary without opening the browser curator). Overridden per-call via the `workflow` parameter on the configured search tool, or toggled at runtime with `/curator`. `browserCookies.profile` pins Gemini Web cookie lookup to a specific Chromium profile. When omitted, detected Chromium profiles are scanned in stable order and the first profile containing the required Gemini cookies is used. macOS discovery supports Helium, Chrome, Brave, and Arc; Linux discovery supports Chromium and Chrome. `allowBrowserCookies` enables Chromium cookie extraction for Gemini Web; it defaults to `false` to avoid browser data access and surprise macOS Keychain prompts. You can also set `PI_ALLOW_BROWSER_COOKIES=1`. Cookie databases are copied to a temporary read-only working copy; the reader uses `node:sqlite` when available and otherwise tries the `sqlite3` CLI or Python's standard-library SQLite module. `searchModel` overrides the Gemini API model used by the configured search tool without changing URL, YouTube, or video extraction defaults. Gemini API grounded search uses `gemini-3.6-flash` by default; set `searchModel` to choose another model. Gemini Web browser-cookie fallback uses its separate `gemini-3.1-pro` default because Gemini Web relies on private header values; explicitly configured unsupported Web models fail instead of silently falling back to 2.5 Flash. `summaryModel` sets the default model used for generating summary drafts in the curator UI and `auto-summary` mode (e.g. `"anthropic/claude-haiku-4-5"`, `"openai-codex/gpt-5.3-codex-spark"`, or `"openrouter/nvidia/nemotron-3-super-120b-a12b:free"`). Preferred summary and query-rewrite models also resolve through routed provider registrations such as OpenRouter when the native provider is unavailable. When Pi `enabledModels` is configured, summaries are limited to that allowlist; if no enabled summary model is available, the tool returns a deterministic summary instead of calling an unrelated model. `summaryGenerationDeadlineMs` sets the maximum time for one summary model attempt in the curator UI and `auto-summary` mode. It defaults to `30000`, must be a positive integer, and is capped at `600000`. `maxInlineContentChars` sets the direct `fetch_content` content slice and the default and maximum `get_search_content` slice. It defaults to `30000`, must be a positive integer, and is capped at `200000`; full fetched content remains stored for later retrieval. `curatorTimeoutSeconds` controls the initial curator idle timeout (default `20`, max `600`); users can still adjust the timer in the curator UI. `ssrf.allowRanges` lists CIDR ranges (e.g. `"198.18.0.0/15"`, `"fd00::/8"`) exempted from the SSRF guard that otherwise blocks private/reserved IP ranges. This unblocks `fetch_content`/`web_search` on hosts whose network proxy runs in TUN + fake-IP mode (Surge, Clash, Mihomo, Stash, ...), where public domains resolve into a synthetic reserved range. It is **off by default** — the guard stays fully enabled unless you list ranges here. Use the narrowest range that covers your proxy's fake-IP pool. All-address CIDRs such as `0.0.0.0/0` and `::/0` are rejected. `ssrf.trustEnvProxy` is a separate opt-in for networks where only the proxy can resolve hostnames; it skips local DNS preflight only for hostnames sent through the configured `proxy` or, when none is configured, hostnames covered by valid HTTP(S) proxy env vars in sandboxes that route through them, and still blocks localhost, literal private IP targets, and `NO_PROXY` matches. It does not configure proxy transport.
|
|
705
708
|
|
|
706
709
|
### Kimi Code Plan
|
|
710
|
+
|
|
707
711
|
Run `/login kimi-coding` in Pi and complete sign-in for an active Kimi Code Plan. Then select `provider: "kimi"`, include `"kimi"` in an explicit provider array, or add it to `searchRouting.providers`. The extension resolves a model with provider `kimi-coding` from Pi's model registry and reuses Pi's refreshed OAuth credential; no Moonshot Open Platform key is configured here.
|
|
708
712
|
|
|
709
713
|
Kimi search calls `POST https://api.kimi.com/coding/v1/search` with the query as `text_query`. This is the Kimi Code Plan search service, not Moonshot Open Platform `$web_search`. The endpoint exposes no native recency parameter, so `recencyFilter` is unsupported and is not sent. Shared `domainFilter` and `numResults` behavior is enforced locally on the returned `search_results`.
|
|
@@ -712,7 +716,7 @@ Kimi is explicit-only: it is never chosen by `auto` and never participates in `p
|
|
|
712
716
|
|
|
713
717
|
### All providers
|
|
714
718
|
|
|
715
|
-
Set `provider: "all"` on `web_search` or `source_check`, or configure `"provider": "all"` as the default, to run the same query against every eligible search provider simultaneously. Parallel MCP, DuckDuckGo, Kimi, AnySearch, XCrawl, Valyu, xAI, Mistral, Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Baizhi, Z.ai, Keenable, and
|
|
719
|
+
Set `provider: "all"` on `web_search` or `source_check`, or configure `"provider": "all"` as the default, to run the same query against every eligible search provider simultaneously. Parallel MCP, DuckDuckGo, Kimi, AnySearch, XCrawl, Valyu, xAI, Mistral, Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Baizhi, Z.ai, Keenable, Ceramic, and DeepSeek are always excluded because they are explicit-only; Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Ceramic, and DeepSeek are paid search APIs, while Baizhi, Z.ai, Kimi, and Mistral may consume account quota or paid search-tool usage, so `all` never spends either resource without an explicit request. Exa remains eligible through its zero-config MCP path, OpenAI can use Pi auth, and other API-backed search providers participate when their API key, local endpoint, or gateway makes them available. Browser-cookie access alone does not opt Gemini into `all`; select Gemini explicitly or configure its API/gateway.
|
|
716
720
|
|
|
717
721
|
Successful provider answers are preserved separately while source URLs and inline content are deduplicated, and one provider failure does not discard the other results. If every participating provider fails, the tool returns per-provider diagnostics. Configured Firecrawl participates in `all` like other eligible providers. In the Curator, **All** can also be selected like the other provider buttons. Each participating provider gets its own result card, including a provider badge and independent selection checkbox; failed providers get their own disabled error card. The final summary is generated from the selected provider cards and is what Pi receives. Outside the Curator, the same provider answers remain available as labeled sections in one tool response.
|
|
718
722
|
|
|
@@ -1065,6 +1069,16 @@ Enabling the tools mid-conversation can cost a prompt-cache miss. Some models ac
|
|
|
1065
1069
|
|
|
1066
1070
|
Restart Pi after changing it. Dynamic activation needs Pi 0.86.0 or newer; older Pi logs a warning and keeps every enabled web tool available.
|
|
1067
1071
|
|
|
1072
|
+
`"toolExposure": "deferred"` goes further: `web_search`, `source_check`, `fetch_content`, and `get_search_content` stay off every request until `web_enable` or Pi's `tool_search` loads them. `tool_search` only does this when it is enabled in Pi's settings, for example `"defaultTools": ["+tool_search"]`.
|
|
1073
|
+
|
|
1074
|
+
```json
|
|
1075
|
+
{
|
|
1076
|
+
"toolExposure": "deferred"
|
|
1077
|
+
}
|
|
1078
|
+
```
|
|
1079
|
+
|
|
1080
|
+
Deferred exposure always uses dynamic activation, so it can't be combined with `"toolActivation": "eager"`. The default is `"direct"`. Restart Pi after changing it. It is not a guaranteed saving: loading the tools later can cost the cache miss described above, and finding them through `tool_search` takes an extra model turn.
|
|
1081
|
+
|
|
1068
1082
|
### Shortcuts
|
|
1069
1083
|
|
|
1070
1084
|
Both shortcuts are configurable via `~/.pi/agent/web-search.json`:
|
|
@@ -1131,6 +1145,7 @@ Rate limits: Perplexity is capped at 10 requests/minute (client-side). Jina Sear
|
|
|
1131
1145
|
| `valyu.ts` | Explicit-only Valyu research search provider |
|
|
1132
1146
|
| `keenable.ts` | Explicit-only Keenable search provider, keyless with an optional API key |
|
|
1133
1147
|
| `ceramic.ts` | Explicit-only Ceramic keyword search provider |
|
|
1148
|
+
| `deepseek.ts` | Explicit-only DeepSeek Search API provider |
|
|
1134
1149
|
| `xai-search.ts` | Explicit-only xAI (Grok) hosted web/X search provider |
|
|
1135
1150
|
| `mistral-search.ts` | Explicit-only Mistral Conversations web search provider |
|
|
1136
1151
|
| `kimi-search.ts` | Explicit-only Kimi Code Plan search provider |
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { exec } from "node:child_process";
|
|
1
|
+
import { exec, execFile } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
2
3
|
import { promisify } from "node:util";
|
|
3
4
|
|
|
4
5
|
const execAsync = promisify(exec);
|
|
6
|
+
const execFileAsync = promisify(execFile);
|
|
5
7
|
const COMMAND_TIMEOUT_MS = 5_000;
|
|
6
8
|
const MAX_CREDENTIAL_BYTES = 16_384;
|
|
7
9
|
const ENV_SOURCE = /^\$(?:([A-Za-z_][A-Za-z0-9_]*)|\{([A-Za-z_][A-Za-z0-9_]*)\})$/;
|
|
8
10
|
const OP_SESSION_NAME = /^OP_SESSION_[A-Za-z0-9_]+$/;
|
|
11
|
+
// Pi drives the legacy WSL launcher through stdin; credential commands fall back to cmd.exe instead.
|
|
12
|
+
const LEGACY_WSL_BASH = /^[a-z]:\\windows\\(?:system32|sysnative)\\bash\.exe$/i;
|
|
9
13
|
const COMMAND_ENVIRONMENT_NAMES = [
|
|
10
14
|
"HOME",
|
|
11
15
|
"USER",
|
|
@@ -23,6 +27,21 @@ const COMMAND_ENVIRONMENT_NAMES = [
|
|
|
23
27
|
"SSH_AUTH_SOCK",
|
|
24
28
|
"WSL_DISTRO_NAME",
|
|
25
29
|
"WSL_INTEROP",
|
|
30
|
+
// Git Bash derives $HOME from USERPROFILE, and Windows children need SystemRoot for networking and crypto.
|
|
31
|
+
"SystemRoot",
|
|
32
|
+
"windir",
|
|
33
|
+
"ComSpec",
|
|
34
|
+
"PATHEXT",
|
|
35
|
+
"USERPROFILE",
|
|
36
|
+
"HOMEDRIVE",
|
|
37
|
+
"HOMEPATH",
|
|
38
|
+
"APPDATA",
|
|
39
|
+
"LOCALAPPDATA",
|
|
40
|
+
"TEMP",
|
|
41
|
+
"TMP",
|
|
42
|
+
"ProgramData",
|
|
43
|
+
"ProgramFiles",
|
|
44
|
+
"ProgramFiles(x86)",
|
|
26
45
|
] as const;
|
|
27
46
|
|
|
28
47
|
export type CredentialFailureCategory =
|
|
@@ -117,18 +136,49 @@ function isMalformedExplicitSource(source: string): boolean {
|
|
|
117
136
|
return source.startsWith("$") && escapedSource(source) === null && explicitEnvironmentName(source) === null;
|
|
118
137
|
}
|
|
119
138
|
|
|
139
|
+
async function bashOnPath(signal: AbortSignal | undefined, timeoutMs: number): Promise<string | null> {
|
|
140
|
+
try {
|
|
141
|
+
const { stdout } = await execFileAsync("where", ["bash.exe"], { encoding: "utf8", signal, timeout: timeoutMs, windowsHide: true });
|
|
142
|
+
return stdout.trim().split(/\r?\n/)[0] || null;
|
|
143
|
+
} catch {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Resolves bash on Windows in Pi's own `!command` order: Git Bash install locations, then bash.exe on PATH. */
|
|
149
|
+
export async function findWindowsBash(
|
|
150
|
+
environment: Record<string, string | undefined>,
|
|
151
|
+
exists: (path: string) => boolean,
|
|
152
|
+
findOnPath: () => Promise<string | null>,
|
|
153
|
+
): Promise<string | null> {
|
|
154
|
+
for (const root of [environment.ProgramFiles, environment["ProgramFiles(x86)"]]) {
|
|
155
|
+
const candidate = root ? `${root}\\Git\\bin\\bash.exe` : null;
|
|
156
|
+
if (candidate && exists(candidate)) return candidate;
|
|
157
|
+
}
|
|
158
|
+
const found = await findOnPath();
|
|
159
|
+
return found && exists(found) && !LEGACY_WSL_BASH.test(found.replace(/\//g, "\\")) ? found : null;
|
|
160
|
+
}
|
|
161
|
+
|
|
120
162
|
async function defaultRunCommand(
|
|
121
163
|
command: string,
|
|
122
164
|
options: CredentialCommandOptions,
|
|
123
165
|
): Promise<CredentialCommandResult> {
|
|
124
|
-
|
|
166
|
+
// The bash lookup and the command share one timeout budget and the caller's abort signal.
|
|
167
|
+
const deadline = Date.now() + options.timeoutMs;
|
|
168
|
+
const bash = process.platform === "win32"
|
|
169
|
+
? await findWindowsBash(process.env, existsSync, () => bashOnPath(options.signal, options.timeoutMs))
|
|
170
|
+
: null;
|
|
171
|
+
const execOptions = {
|
|
125
172
|
encoding: "utf8",
|
|
126
173
|
env: options.environment,
|
|
127
174
|
maxBuffer: options.maxOutputBytes + 1,
|
|
128
175
|
signal: options.signal,
|
|
129
|
-
timeout:
|
|
176
|
+
timeout: Math.max(1, deadline - Date.now()),
|
|
130
177
|
windowsHide: true,
|
|
131
|
-
}
|
|
178
|
+
} as const;
|
|
179
|
+
const result = bash
|
|
180
|
+
? await execFileAsync(bash, ["-c", command], execOptions)
|
|
181
|
+
: await execAsync(command, execOptions);
|
|
132
182
|
return { stdout: result.stdout };
|
|
133
183
|
}
|
|
134
184
|
|
|
@@ -53,6 +53,7 @@ function buildProviderButtons(
|
|
|
53
53
|
{ value: "valyu", label: "Valyu", available: available.valyu },
|
|
54
54
|
{ value: "keenable", label: "Keenable", available: available.keenable },
|
|
55
55
|
{ value: "ceramic", label: "Ceramic", available: available.ceramic },
|
|
56
|
+
{ value: "deepseek", label: "DeepSeek", available: available.deepseek },
|
|
56
57
|
];
|
|
57
58
|
|
|
58
59
|
return providers
|
|
@@ -1479,7 +1480,7 @@ const SCRIPT = `(function() {
|
|
|
1479
1480
|
var token = DATA.sessionToken;
|
|
1480
1481
|
var timeoutSec = DATA.timeout;
|
|
1481
1482
|
var queries = Array.isArray(DATA.queries) ? DATA.queries : [];
|
|
1482
|
-
var providers = ["auto", "all", "openai", "exa", "brave", "parallel", "parallel-mcp", "tinyfish", "search1api", "searchinfinity", "querit", "tavily", "firecrawl", "jina", "serpdive", "kagi", "bocha", "ollama", "searxng", "degoog", "duckduckgo", "perplexity", "gemini", "kimi", "anysearch", "xcrawl", "xai", "mistral", "brightdata", "serpbase", "serpapi", "serper", "serply", "valyu", "baizhi", "you", "zai", "keenable", "ceramic"];
|
|
1483
|
+
var providers = ["auto", "all", "openai", "exa", "brave", "parallel", "parallel-mcp", "tinyfish", "search1api", "searchinfinity", "querit", "tavily", "firecrawl", "jina", "serpdive", "kagi", "bocha", "ollama", "searxng", "degoog", "duckduckgo", "perplexity", "gemini", "kimi", "anysearch", "xcrawl", "xai", "mistral", "brightdata", "serpbase", "serpapi", "serper", "serply", "valyu", "baizhi", "you", "zai", "keenable", "ceramic", "deepseek"];
|
|
1483
1484
|
var availProviders = DATA.availableProviders && typeof DATA.availableProviders === "object" ? DATA.availableProviders : {};
|
|
1484
1485
|
var workflow = "summary-review";
|
|
1485
1486
|
var initialDefaultProvider = typeof DATA.defaultProvider === "string" ? DATA.defaultProvider : "exa";
|
|
@@ -1721,6 +1722,7 @@ const SCRIPT = `(function() {
|
|
|
1721
1722
|
if (provider === "valyu") return "Valyu";
|
|
1722
1723
|
if (provider === "keenable") return "Keenable";
|
|
1723
1724
|
if (provider === "ceramic") return "Ceramic";
|
|
1725
|
+
if (provider === "deepseek") return "DeepSeek";
|
|
1724
1726
|
return "Unknown";
|
|
1725
1727
|
}
|
|
1726
1728
|
|
|
@@ -312,6 +312,7 @@ export function startCuratorServer(
|
|
|
312
312
|
if (provider === "valyu") return availableProviders.valyu;
|
|
313
313
|
if (provider === "keenable") return availableProviders.keenable;
|
|
314
314
|
if (provider === "ceramic") return availableProviders.ceramic;
|
|
315
|
+
if (provider === "deepseek") return availableProviders.deepseek;
|
|
315
316
|
return false;
|
|
316
317
|
}
|
|
317
318
|
|