dsh-thinking-levels 4.4.2 → 4.4.3
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/CHANGELOG.ja.md +44 -36
- package/CHANGELOG.ko.md +44 -36
- package/CHANGELOG.md +37 -26
- package/dsh.plugin.json +1 -1
- package/lib/client.js +92 -38
- package/lib/client.js.map +1 -1
- package/lib/takeover-sync.d.ts +11 -3
- package/lib/takeover-sync.js +13 -5
- package/package.json +1 -1
package/lib/takeover-sync.d.ts
CHANGED
|
@@ -63,9 +63,17 @@ export interface PiAiSection {
|
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Whether a provider profile targets a CUSTOM openai-completions gateway:
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* not custom and
|
|
66
|
+
* an explicitly declared `api: openai-completions`, or — only when the profile
|
|
67
|
+
* names no protocol at all — a baseURL that is not an official host. A catalog
|
|
68
|
+
* route without either (e.g. xiaomi via pi-ai discovery) is not custom and is
|
|
69
|
+
* left alone.
|
|
70
|
+
*
|
|
71
|
+
* An explicit protocol is AUTHORITATIVE (issue #6): only openai-completions
|
|
72
|
+
* takes the compat fields this sync writes (`supportsDeveloperRole`,
|
|
73
|
+
* `thinkingFormat`), and a Responses/Anthropic route on a self-hosted baseURL
|
|
74
|
+
* would reject the WHOLE providers payload — so the protocol decides before
|
|
75
|
+
* the baseURL heuristic. Thinking itself is declared through the
|
|
76
|
+
* protocol-neutral `reasoningEfforts` and needs no route of this shape.
|
|
69
77
|
* @param profile - the provider profile slice.
|
|
70
78
|
* @returns true when the route is a custom openai-completions gateway.
|
|
71
79
|
*/
|
package/lib/takeover-sync.js
CHANGED
|
@@ -53,17 +53,25 @@ function isEffortsTable(value) {
|
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Whether a provider profile targets a CUSTOM openai-completions gateway:
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* not custom and
|
|
56
|
+
* an explicitly declared `api: openai-completions`, or — only when the profile
|
|
57
|
+
* names no protocol at all — a baseURL that is not an official host. A catalog
|
|
58
|
+
* route without either (e.g. xiaomi via pi-ai discovery) is not custom and is
|
|
59
|
+
* left alone.
|
|
60
|
+
*
|
|
61
|
+
* An explicit protocol is AUTHORITATIVE (issue #6): only openai-completions
|
|
62
|
+
* takes the compat fields this sync writes (`supportsDeveloperRole`,
|
|
63
|
+
* `thinkingFormat`), and a Responses/Anthropic route on a self-hosted baseURL
|
|
64
|
+
* would reject the WHOLE providers payload — so the protocol decides before
|
|
65
|
+
* the baseURL heuristic. Thinking itself is declared through the
|
|
66
|
+
* protocol-neutral `reasoningEfforts` and needs no route of this shape.
|
|
59
67
|
* @param profile - the provider profile slice.
|
|
60
68
|
* @returns true when the route is a custom openai-completions gateway.
|
|
61
69
|
*/
|
|
62
70
|
export function isCustomOpenAiGateway(profile) {
|
|
63
71
|
if (profile === undefined)
|
|
64
72
|
return false;
|
|
65
|
-
if (profile.api === '
|
|
66
|
-
return
|
|
73
|
+
if (typeof profile.api === 'string')
|
|
74
|
+
return profile.api === 'openai-completions';
|
|
67
75
|
const baseURL = profile.baseURL;
|
|
68
76
|
if (typeof baseURL !== 'string' || baseURL.length === 0)
|
|
69
77
|
return false;
|