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.
@@ -63,9 +63,17 @@ export interface PiAiSection {
63
63
  }
64
64
  /**
65
65
  * Whether a provider profile targets a CUSTOM openai-completions gateway:
66
- * explicit `api: openai-completions`, or a baseURL that is not an official
67
- * host. Catalog routes without either (e.g. xiaomi via pi-ai discovery) are
68
- * not custom and are left alone.
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
  */
@@ -53,17 +53,25 @@ function isEffortsTable(value) {
53
53
  }
54
54
  /**
55
55
  * Whether a provider profile targets a CUSTOM openai-completions gateway:
56
- * explicit `api: openai-completions`, or a baseURL that is not an official
57
- * host. Catalog routes without either (e.g. xiaomi via pi-ai discovery) are
58
- * not custom and are left alone.
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 === 'openai-completions')
66
- return true;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-thinking-levels",
3
- "version": "4.4.2",
3
+ "version": "4.4.3",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org",
6
6
  "access": "public",