@ashx-j/lunr-ai 0.2.5 → 0.2.7
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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/xai-effort.d.ts +27 -0
- package/dist/xai-effort.d.ts.map +1 -0
- package/dist/xai-effort.js +53 -0
- package/dist/xai-effort.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -30,4 +30,5 @@ export * from "./utils/overflow.ts";
|
|
|
30
30
|
export * from "./utils/retry.ts";
|
|
31
31
|
export * from "./utils/typebox-helpers.ts";
|
|
32
32
|
export * from "./utils/validation.ts";
|
|
33
|
+
export { parseXaiGrok4Minor, withXaiEffortMetadata, XAI_GROK45_THINKING_LEVEL_MAP, XAI_GROK46_THINKING_LEVEL_MAP, } from "./xai-effort.ts";
|
|
33
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAO/B,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC/G,YAAY,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AACnF,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/F,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,YAAY,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACnH,YAAY,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxG,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,GACjB,MAAM,mCAAmC,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n\n// Core only, side-effect free: no generated catalogs, no provider factories,\n// no api-registry, no OAuth implementations, no compat. Provider factories\n// live under \"@ashx-j/lunr-ai/providers/*\", API implementations under\n// \"@ashx-j/lunr-ai/api/*\", the old global API under\n// \"@ashx-j/lunr-ai/compat\".\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./api/anthropic-messages.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./api/azure-openai-responses.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./api/bedrock-converse-stream.ts\";\nexport type { GoogleOptions } from \"./api/google-generative-ai.ts\";\nexport type { GoogleThinkingLevel } from \"./api/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./api/google-vertex.ts\";\nexport * from \"./api/lazy.ts\";\nexport type { MistralOptions } from \"./api/mistral-conversations.ts\";\nexport type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats } from \"./api/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./api/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./api/openai-responses.ts\";\nexport type { PiMessagesEvent, PiMessagesOptions, PiMessagesRewriteImpact } from \"./api/pi-messages.ts\";\nexport * from \"./auth/context.ts\";\nexport * from \"./auth/credential-store.ts\";\nexport * from \"./auth/helpers.ts\";\nexport * from \"./auth/types.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./compat/extension-oauth-types.ts\";\nexport * from \"./images-models.ts\";\nexport * from \"./models.ts\";\nexport * from \"./models-store.ts\";\nexport * from \"./providers/faux.ts\";\nexport * from \"./session-resources.ts\";\nexport * from \"./types.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport * from \"./utils/overflow.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport * from \"./utils/validation.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAO/B,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC/G,YAAY,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AACnF,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC/F,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,YAAY,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,YAAY,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACnH,YAAY,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACxG,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,YAAY,EACX,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,iBAAiB,EACjB,iBAAiB,GACjB,MAAM,mCAAmC,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,6BAA6B,EAC7B,6BAA6B,GAC7B,MAAM,iBAAiB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n\n// Core only, side-effect free: no generated catalogs, no provider factories,\n// no api-registry, no OAuth implementations, no compat. Provider factories\n// live under \"@ashx-j/lunr-ai/providers/*\", API implementations under\n// \"@ashx-j/lunr-ai/api/*\", the old global API under\n// \"@ashx-j/lunr-ai/compat\".\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./api/anthropic-messages.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./api/azure-openai-responses.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./api/bedrock-converse-stream.ts\";\nexport type { GoogleOptions } from \"./api/google-generative-ai.ts\";\nexport type { GoogleThinkingLevel } from \"./api/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./api/google-vertex.ts\";\nexport * from \"./api/lazy.ts\";\nexport type { MistralOptions } from \"./api/mistral-conversations.ts\";\nexport type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats } from \"./api/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./api/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./api/openai-responses.ts\";\nexport type { PiMessagesEvent, PiMessagesOptions, PiMessagesRewriteImpact } from \"./api/pi-messages.ts\";\nexport * from \"./auth/context.ts\";\nexport * from \"./auth/credential-store.ts\";\nexport * from \"./auth/helpers.ts\";\nexport * from \"./auth/types.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./compat/extension-oauth-types.ts\";\nexport * from \"./images-models.ts\";\nexport * from \"./models.ts\";\nexport * from \"./models-store.ts\";\nexport * from \"./providers/faux.ts\";\nexport * from \"./session-resources.ts\";\nexport * from \"./types.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport * from \"./utils/overflow.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport * from \"./utils/validation.ts\";\nexport {\n\tparseXaiGrok4Minor,\n\twithXaiEffortMetadata,\n\tXAI_GROK45_THINKING_LEVEL_MAP,\n\tXAI_GROK46_THINKING_LEVEL_MAP,\n} from \"./xai-effort.ts\";\n"]}
|
package/dist/index.js
CHANGED
|
@@ -17,4 +17,5 @@ export * from "./utils/overflow.js";
|
|
|
17
17
|
export * from "./utils/retry.js";
|
|
18
18
|
export * from "./utils/typebox-helpers.js";
|
|
19
19
|
export * from "./utils/validation.js";
|
|
20
|
+
export { parseXaiGrok4Minor, withXaiEffortMetadata, XAI_GROK45_THINKING_LEVEL_MAP, XAI_GROK46_THINKING_LEVEL_MAP, } from "./xai-effort.js";
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAa/B,cAAc,eAAe,CAAC;AAM9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAShC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n\n// Core only, side-effect free: no generated catalogs, no provider factories,\n// no api-registry, no OAuth implementations, no compat. Provider factories\n// live under \"@ashx-j/lunr-ai/providers/*\", API implementations under\n// \"@ashx-j/lunr-ai/api/*\", the old global API under\n// \"@ashx-j/lunr-ai/compat\".\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./api/anthropic-messages.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./api/azure-openai-responses.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./api/bedrock-converse-stream.ts\";\nexport type { GoogleOptions } from \"./api/google-generative-ai.ts\";\nexport type { GoogleThinkingLevel } from \"./api/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./api/google-vertex.ts\";\nexport * from \"./api/lazy.ts\";\nexport type { MistralOptions } from \"./api/mistral-conversations.ts\";\nexport type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats } from \"./api/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./api/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./api/openai-responses.ts\";\nexport type { PiMessagesEvent, PiMessagesOptions, PiMessagesRewriteImpact } from \"./api/pi-messages.ts\";\nexport * from \"./auth/context.ts\";\nexport * from \"./auth/credential-store.ts\";\nexport * from \"./auth/helpers.ts\";\nexport * from \"./auth/types.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./compat/extension-oauth-types.ts\";\nexport * from \"./images-models.ts\";\nexport * from \"./models.ts\";\nexport * from \"./models-store.ts\";\nexport * from \"./providers/faux.ts\";\nexport * from \"./session-resources.ts\";\nexport * from \"./types.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport * from \"./utils/overflow.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport * from \"./utils/validation.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAa/B,cAAc,eAAe,CAAC;AAM9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAShC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,OAAO,EACN,kBAAkB,EAClB,qBAAqB,EACrB,6BAA6B,EAC7B,6BAA6B,GAC7B,MAAM,iBAAiB,CAAC","sourcesContent":["export type { Static, TSchema } from \"typebox\";\nexport { Type } from \"typebox\";\n\n// Core only, side-effect free: no generated catalogs, no provider factories,\n// no api-registry, no OAuth implementations, no compat. Provider factories\n// live under \"@ashx-j/lunr-ai/providers/*\", API implementations under\n// \"@ashx-j/lunr-ai/api/*\", the old global API under\n// \"@ashx-j/lunr-ai/compat\".\nexport type { AnthropicEffort, AnthropicOptions, AnthropicThinkingDisplay } from \"./api/anthropic-messages.ts\";\nexport type { AzureOpenAIResponsesOptions } from \"./api/azure-openai-responses.ts\";\nexport type { BedrockOptions, BedrockThinkingDisplay } from \"./api/bedrock-converse-stream.ts\";\nexport type { GoogleOptions } from \"./api/google-generative-ai.ts\";\nexport type { GoogleThinkingLevel } from \"./api/google-shared.ts\";\nexport type { GoogleVertexOptions } from \"./api/google-vertex.ts\";\nexport * from \"./api/lazy.ts\";\nexport type { MistralOptions } from \"./api/mistral-conversations.ts\";\nexport type { OpenAICodexResponsesOptions, OpenAICodexWebSocketDebugStats } from \"./api/openai-codex-responses.ts\";\nexport type { OpenAICompletionsOptions } from \"./api/openai-completions.ts\";\nexport type { OpenAIResponsesOptions } from \"./api/openai-responses.ts\";\nexport type { PiMessagesEvent, PiMessagesOptions, PiMessagesRewriteImpact } from \"./api/pi-messages.ts\";\nexport * from \"./auth/context.ts\";\nexport * from \"./auth/credential-store.ts\";\nexport * from \"./auth/helpers.ts\";\nexport * from \"./auth/types.ts\";\nexport type {\n\tOAuthAuthInfo,\n\tOAuthDeviceCodeInfo,\n\tOAuthLoginCallbacks,\n\tOAuthPrompt,\n\tOAuthSelectOption,\n\tOAuthSelectPrompt,\n} from \"./compat/extension-oauth-types.ts\";\nexport * from \"./images-models.ts\";\nexport * from \"./models.ts\";\nexport * from \"./models-store.ts\";\nexport * from \"./providers/faux.ts\";\nexport * from \"./session-resources.ts\";\nexport * from \"./types.ts\";\nexport * from \"./utils/diagnostics.ts\";\nexport * from \"./utils/event-stream.ts\";\nexport * from \"./utils/json-parse.ts\";\nexport * from \"./utils/overflow.ts\";\nexport * from \"./utils/retry.ts\";\nexport * from \"./utils/typebox-helpers.ts\";\nexport * from \"./utils/validation.ts\";\nexport {\n\tparseXaiGrok4Minor,\n\twithXaiEffortMetadata,\n\tXAI_GROK45_THINKING_LEVEL_MAP,\n\tXAI_GROK46_THINKING_LEVEL_MAP,\n} from \"./xai-effort.ts\";\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* xAI Grok 4.x thinking overlays.
|
|
3
|
+
* Used by generate-models.ts. Do not hand-edit catalog JSON for these maps.
|
|
4
|
+
*
|
|
5
|
+
* Docs (https://docs.x.ai/developers/model-capabilities/text/reasoning):
|
|
6
|
+
* - grok-4.5: low / medium / high (cannot disable). xhigh is treated as high.
|
|
7
|
+
* - grok-4.6+: low / medium / high / xhigh (cannot disable).
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseXaiGrok4Minor(modelId: string): number | undefined;
|
|
10
|
+
/** off/minimal unsupported; no native xhigh. */
|
|
11
|
+
export declare const XAI_GROK45_THINKING_LEVEL_MAP: {
|
|
12
|
+
readonly off: null;
|
|
13
|
+
readonly minimal: null;
|
|
14
|
+
};
|
|
15
|
+
/** off/minimal unsupported; native xhigh. */
|
|
16
|
+
export declare const XAI_GROK46_THINKING_LEVEL_MAP: {
|
|
17
|
+
readonly off: null;
|
|
18
|
+
readonly minimal: null;
|
|
19
|
+
readonly xhigh: "xhigh";
|
|
20
|
+
};
|
|
21
|
+
/** Stamp Grok 4.x effort maps onto any catalog layer so a stale shard cannot hide xhigh. */
|
|
22
|
+
export declare function withXaiEffortMetadata<T extends {
|
|
23
|
+
id: string;
|
|
24
|
+
provider?: string;
|
|
25
|
+
api?: string;
|
|
26
|
+
}>(model: T): T;
|
|
27
|
+
//# sourceMappingURL=xai-effort.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xai-effort.d.ts","sourceRoot":"","sources":["../src/xai-effort.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKtE;AAED,gDAAgD;AAChD,eAAO,MAAM,6BAA6B;;;CAGhC,CAAC;AAEX,6CAA6C;AAC7C,eAAO,MAAM,6BAA6B;;;;CAIhC,CAAC;AAEX,4FAA4F;AAC5F,wBAAgB,qBAAqB,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAsB5G","sourcesContent":["/**\n * xAI Grok 4.x thinking overlays.\n * Used by generate-models.ts. Do not hand-edit catalog JSON for these maps.\n *\n * Docs (https://docs.x.ai/developers/model-capabilities/text/reasoning):\n * - grok-4.5: low / medium / high (cannot disable). xhigh is treated as high.\n * - grok-4.6+: low / medium / high / xhigh (cannot disable).\n */\nexport function parseXaiGrok4Minor(modelId: string): number | undefined {\n\tconst match = /^grok-(\\d+)\\.(\\d+)/i.exec(modelId);\n\tif (!match) return undefined;\n\tif (Number(match[1]) !== 4) return undefined;\n\treturn Number(match[2]);\n}\n\n/** off/minimal unsupported; no native xhigh. */\nexport const XAI_GROK45_THINKING_LEVEL_MAP = {\n\toff: null,\n\tminimal: null,\n} as const;\n\n/** off/minimal unsupported; native xhigh. */\nexport const XAI_GROK46_THINKING_LEVEL_MAP = {\n\toff: null,\n\tminimal: null,\n\txhigh: \"xhigh\",\n} as const;\n\n/** Stamp Grok 4.x effort maps onto any catalog layer so a stale shard cannot hide xhigh. */\nexport function withXaiEffortMetadata<T extends { id: string; provider?: string; api?: string }>(model: T): T {\n\tif (model.provider !== \"xai\") return model;\n\tconst minor = parseXaiGrok4Minor(model.id);\n\tconst current = model as T & { thinkingLevelMap?: object; compat?: object };\n\tif (minor === 5) {\n\t\treturn {\n\t\t\t...model,\n\t\t\tthinkingLevelMap: { ...current.thinkingLevelMap, ...XAI_GROK45_THINKING_LEVEL_MAP },\n\t\t};\n\t}\n\tif (minor !== undefined && minor >= 6) {\n\t\tconst thinkingLevelMap = { ...current.thinkingLevelMap, ...XAI_GROK46_THINKING_LEVEL_MAP };\n\t\tif (model.api === \"openai-completions\") {\n\t\t\treturn {\n\t\t\t\t...model,\n\t\t\t\tthinkingLevelMap,\n\t\t\t\tcompat: { ...current.compat, supportsReasoningEffort: true },\n\t\t\t};\n\t\t}\n\t\treturn { ...model, thinkingLevelMap };\n\t}\n\treturn model;\n}\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* xAI Grok 4.x thinking overlays.
|
|
3
|
+
* Used by generate-models.ts. Do not hand-edit catalog JSON for these maps.
|
|
4
|
+
*
|
|
5
|
+
* Docs (https://docs.x.ai/developers/model-capabilities/text/reasoning):
|
|
6
|
+
* - grok-4.5: low / medium / high (cannot disable). xhigh is treated as high.
|
|
7
|
+
* - grok-4.6+: low / medium / high / xhigh (cannot disable).
|
|
8
|
+
*/
|
|
9
|
+
export function parseXaiGrok4Minor(modelId) {
|
|
10
|
+
const match = /^grok-(\d+)\.(\d+)/i.exec(modelId);
|
|
11
|
+
if (!match)
|
|
12
|
+
return undefined;
|
|
13
|
+
if (Number(match[1]) !== 4)
|
|
14
|
+
return undefined;
|
|
15
|
+
return Number(match[2]);
|
|
16
|
+
}
|
|
17
|
+
/** off/minimal unsupported; no native xhigh. */
|
|
18
|
+
export const XAI_GROK45_THINKING_LEVEL_MAP = {
|
|
19
|
+
off: null,
|
|
20
|
+
minimal: null,
|
|
21
|
+
};
|
|
22
|
+
/** off/minimal unsupported; native xhigh. */
|
|
23
|
+
export const XAI_GROK46_THINKING_LEVEL_MAP = {
|
|
24
|
+
off: null,
|
|
25
|
+
minimal: null,
|
|
26
|
+
xhigh: "xhigh",
|
|
27
|
+
};
|
|
28
|
+
/** Stamp Grok 4.x effort maps onto any catalog layer so a stale shard cannot hide xhigh. */
|
|
29
|
+
export function withXaiEffortMetadata(model) {
|
|
30
|
+
if (model.provider !== "xai")
|
|
31
|
+
return model;
|
|
32
|
+
const minor = parseXaiGrok4Minor(model.id);
|
|
33
|
+
const current = model;
|
|
34
|
+
if (minor === 5) {
|
|
35
|
+
return {
|
|
36
|
+
...model,
|
|
37
|
+
thinkingLevelMap: { ...current.thinkingLevelMap, ...XAI_GROK45_THINKING_LEVEL_MAP },
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
if (minor !== undefined && minor >= 6) {
|
|
41
|
+
const thinkingLevelMap = { ...current.thinkingLevelMap, ...XAI_GROK46_THINKING_LEVEL_MAP };
|
|
42
|
+
if (model.api === "openai-completions") {
|
|
43
|
+
return {
|
|
44
|
+
...model,
|
|
45
|
+
thinkingLevelMap,
|
|
46
|
+
compat: { ...current.compat, supportsReasoningEffort: true },
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return { ...model, thinkingLevelMap };
|
|
50
|
+
}
|
|
51
|
+
return model;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=xai-effort.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xai-effort.js","sourceRoot":"","sources":["../src/xai-effort.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAsB;IACvE,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC7C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAAA,CACxB;AAED,gDAAgD;AAChD,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC5C,GAAG,EAAE,IAAI;IACT,OAAO,EAAE,IAAI;CACJ,CAAC;AAEX,6CAA6C;AAC7C,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC5C,GAAG,EAAE,IAAI;IACT,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,OAAO;CACL,CAAC;AAEX,4FAA4F;AAC5F,MAAM,UAAU,qBAAqB,CAA4D,KAAQ,EAAK;IAC7G,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAC3C,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,KAA2D,CAAC;IAC5E,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QACjB,OAAO;YACN,GAAG,KAAK;YACR,gBAAgB,EAAE,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,GAAG,6BAA6B,EAAE;SACnF,CAAC;IACH,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACvC,MAAM,gBAAgB,GAAG,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,GAAG,6BAA6B,EAAE,CAAC;QAC3F,IAAI,KAAK,CAAC,GAAG,KAAK,oBAAoB,EAAE,CAAC;YACxC,OAAO;gBACN,GAAG,KAAK;gBACR,gBAAgB;gBAChB,MAAM,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,uBAAuB,EAAE,IAAI,EAAE;aAC5D,CAAC;QACH,CAAC;QACD,OAAO,EAAE,GAAG,KAAK,EAAE,gBAAgB,EAAE,CAAC;IACvC,CAAC;IACD,OAAO,KAAK,CAAC;AAAA,CACb","sourcesContent":["/**\n * xAI Grok 4.x thinking overlays.\n * Used by generate-models.ts. Do not hand-edit catalog JSON for these maps.\n *\n * Docs (https://docs.x.ai/developers/model-capabilities/text/reasoning):\n * - grok-4.5: low / medium / high (cannot disable). xhigh is treated as high.\n * - grok-4.6+: low / medium / high / xhigh (cannot disable).\n */\nexport function parseXaiGrok4Minor(modelId: string): number | undefined {\n\tconst match = /^grok-(\\d+)\\.(\\d+)/i.exec(modelId);\n\tif (!match) return undefined;\n\tif (Number(match[1]) !== 4) return undefined;\n\treturn Number(match[2]);\n}\n\n/** off/minimal unsupported; no native xhigh. */\nexport const XAI_GROK45_THINKING_LEVEL_MAP = {\n\toff: null,\n\tminimal: null,\n} as const;\n\n/** off/minimal unsupported; native xhigh. */\nexport const XAI_GROK46_THINKING_LEVEL_MAP = {\n\toff: null,\n\tminimal: null,\n\txhigh: \"xhigh\",\n} as const;\n\n/** Stamp Grok 4.x effort maps onto any catalog layer so a stale shard cannot hide xhigh. */\nexport function withXaiEffortMetadata<T extends { id: string; provider?: string; api?: string }>(model: T): T {\n\tif (model.provider !== \"xai\") return model;\n\tconst minor = parseXaiGrok4Minor(model.id);\n\tconst current = model as T & { thinkingLevelMap?: object; compat?: object };\n\tif (minor === 5) {\n\t\treturn {\n\t\t\t...model,\n\t\t\tthinkingLevelMap: { ...current.thinkingLevelMap, ...XAI_GROK45_THINKING_LEVEL_MAP },\n\t\t};\n\t}\n\tif (minor !== undefined && minor >= 6) {\n\t\tconst thinkingLevelMap = { ...current.thinkingLevelMap, ...XAI_GROK46_THINKING_LEVEL_MAP };\n\t\tif (model.api === \"openai-completions\") {\n\t\t\treturn {\n\t\t\t\t...model,\n\t\t\t\tthinkingLevelMap,\n\t\t\t\tcompat: { ...current.compat, supportsReasoningEffort: true },\n\t\t\t};\n\t\t}\n\t\treturn { ...model, thinkingLevelMap };\n\t}\n\treturn model;\n}\n"]}
|