@discomedia/utils 1.0.43 → 1.0.45
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-frontend.cjs +9 -3
- package/dist/index-frontend.cjs.map +1 -1
- package/dist/index-frontend.mjs +9 -3
- package/dist/index-frontend.mjs.map +1 -1
- package/dist/index.cjs +22 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +22 -16
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +4 -4
- package/dist/test.js +6107 -1118
- package/dist/test.js.map +1 -1
- package/dist/types/llm-config.d.ts.map +1 -1
- package/dist/types/llm-openai.d.ts +3 -3
- package/dist/types/llm-openai.d.ts.map +1 -1
- package/dist/types/llm-utils.d.ts +2 -2
- package/dist/types/llm-utils.d.ts.map +1 -1
- package/dist/types/types/llm-types.d.ts +2 -2
- package/dist/types/types/llm-types.d.ts.map +1 -1
- package/dist/types-frontend/llm-config.d.ts.map +1 -1
- package/dist/types-frontend/llm-openai.d.ts +3 -3
- package/dist/types-frontend/llm-openai.d.ts.map +1 -1
- package/dist/types-frontend/llm-utils.d.ts +2 -2
- package/dist/types-frontend/llm-utils.d.ts.map +1 -1
- package/dist/types-frontend/types/llm-types.d.ts +2 -2
- package/dist/types-frontend/types/llm-types.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-config.d.ts","sourceRoot":"","sources":["../../src/llm-config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,iBAAiB,CAAC;AAE5C,eAAO,MAAM,wBAAwB,wtBAMpC,CAAC;AAEF,UAAU,YAAY;IACpB,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"llm-config.d.ts","sourceRoot":"","sources":["../../src/llm-config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,iBAAiB,CAAC;AAE5C,eAAO,MAAM,wBAAwB,wtBAMpC,CAAC;AAEF,UAAU,YAAY;IACpB,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,EAAE,YAyD9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,YAWhC,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAEnD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAS5E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,eAAe,CAAC,EAAE,MAAM,EACxB,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,CA0BR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tool } from 'openai/resources/responses/responses';
|
|
2
|
-
import { LLMResponse, LLMOptions, LLMModel, ContextMessage } from './types';
|
|
2
|
+
import { LLMResponse, LLMOptions, LLMModel, ContextMessage, OpenAIModel } from './types';
|
|
3
3
|
import { ResponseCreateParamsNonStreaming } from 'openai/resources/responses/responses';
|
|
4
4
|
export declare const DEFAULT_OPTIONS: LLMOptions;
|
|
5
5
|
/**
|
|
@@ -13,13 +13,13 @@ export declare function supportsTemperature(model: string): boolean;
|
|
|
13
13
|
* @param model The model to check.
|
|
14
14
|
* @returns True if the model is a reasoning model, false otherwise.
|
|
15
15
|
*/
|
|
16
|
-
export declare function isReasoningModel(model: string):
|
|
16
|
+
export declare function isReasoningModel(model: string): model is OpenAIModel;
|
|
17
17
|
/**
|
|
18
18
|
* Checks if the given model is a GPT-5 model. GPT-5 models don't support tool_choice other than 'auto'.
|
|
19
19
|
* @param model The model to check.
|
|
20
20
|
* @returns True if the model is a GPT-5 model, false otherwise.
|
|
21
21
|
*/
|
|
22
|
-
export declare function isGPT5Model(model: string):
|
|
22
|
+
export declare function isGPT5Model(model: string): model is OpenAIModel;
|
|
23
23
|
/**
|
|
24
24
|
* Makes a call to OpenAI's Responses API for more advanced use cases with built-in tools.
|
|
25
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-openai.d.ts","sourceRoot":"","sources":["../../src/llm-openai.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,IAAI,EAIL,MAAM,sCAAsC,CAAC;AAI9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAwB,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"llm-openai.d.ts","sourceRoot":"","sources":["../../src/llm-openai.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,IAAI,EAIL,MAAM,sCAAsC,CAAC;AAI9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAwB,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/G,OAAO,EACL,gCAAgC,EAOjC,MAAM,sCAAsC,CAAC;AAE9C,eAAO,MAAM,eAAe,EAAE,UAG7B,CAAC;AAqBF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAK1D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW,CAGpE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW,CAG/D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,oBAAoB,GAAU,CAAC,GAAG,MAAM,EACnD,OAAO,MAAM,GAAG,gCAAgC,CAAC,OAAO,CAAC,EACzD,UAAS,IAAI,CAAC,gCAAgC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CACX,KACL,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CA0HxB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,WAAW,CAAC,CAAC,GAAG,MAAM,EAC1C,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACtC,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;CACvB,GACL,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAsHzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenAIResponseFormat } from './types';
|
|
2
|
-
export declare function normalizeModelName(model: string):
|
|
1
|
+
import { LLMModel, OpenAIResponseFormat } from './types';
|
|
2
|
+
export declare function normalizeModelName(model: string): LLMModel;
|
|
3
3
|
export declare const CODE_BLOCK_TYPES: string[];
|
|
4
4
|
/**
|
|
5
5
|
* Tries to parse JSON from the given content string according to the specified
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-utils.d.ts","sourceRoot":"","sources":["../../src/llm-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"llm-utils.d.ts","sourceRoot":"","sources":["../../src/llm-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAe,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGtE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAE1D;AAED,eAAO,MAAM,gBAAgB,UAAsF,CAAC;AAElH;;;;;;;;;;GAUG;AACL,wBAAsB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,oBAAoB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CA+E/G"}
|
|
@@ -3,7 +3,7 @@ import { ImageGenerateParams } from 'openai/resources/images';
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents OpenAI models
|
|
5
5
|
*/
|
|
6
|
-
export type OpenAIModel = 'gpt-4o-mini' | 'gpt-4o' | 'o1-mini' | 'o1' | 'o3-mini' | 'gpt-4.1' | 'gpt-4.1-mini' | 'o4-mini' | 'gpt-4.1-nano' | 'o3' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano';
|
|
6
|
+
export type OpenAIModel = 'gpt-4o-mini' | 'gpt-4o' | 'o1-mini' | 'o1' | 'o3-mini' | 'gpt-4.1' | 'gpt-4.1-mini' | 'o4-mini' | 'gpt-4.1-nano' | 'o3' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1';
|
|
7
7
|
/**
|
|
8
8
|
* Represents Deepseek models
|
|
9
9
|
*/
|
|
@@ -11,7 +11,7 @@ export type DeepseekModel = 'deepseek-chat' | 'deepseek-reasoner';
|
|
|
11
11
|
/**
|
|
12
12
|
* Represents OpenRouter models
|
|
13
13
|
*/
|
|
14
|
-
export type OpenRouterModel = 'openai/gpt-5' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-oss-120b' | 'z.ai/glm-4.5' | 'z.ai/glm-4.5-air' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-lite' | 'deepseek/deepseek-r1-0528' | 'deepseek/deepseek-chat-v3-0324';
|
|
14
|
+
export type OpenRouterModel = 'openai/gpt-5' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5.1' | 'openai/gpt-oss-120b' | 'z.ai/glm-4.5' | 'z.ai/glm-4.5-air' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-lite' | 'deepseek/deepseek-r1-0528' | 'deepseek/deepseek-chat-v3-0324';
|
|
15
15
|
/**
|
|
16
16
|
* Represents pricing information for OpenRouter models
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-types.d.ts","sourceRoot":"","sources":["../../../src/types/llm-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAClI,OAAO,EAAE,mBAAmB,EAAc,MAAM,yBAAyB,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,cAAc,GAAG,IAAI,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"llm-types.d.ts","sourceRoot":"","sources":["../../../src/types/llm-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAClI,OAAO,EAAE,mBAAmB,EAAc,MAAM,yBAAyB,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,aAAa,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Y,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACzC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC/C,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-config.d.ts","sourceRoot":"","sources":["../../src/llm-config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,iBAAiB,CAAC;AAE5C,eAAO,MAAM,wBAAwB,wtBAMpC,CAAC;AAEF,UAAU,YAAY;IACpB,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"llm-config.d.ts","sourceRoot":"","sources":["../../src/llm-config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,iBAAiB,CAAC;AAE5C,eAAO,MAAM,wBAAwB,wtBAMpC,CAAC;AAEF,UAAU,YAAY;IACpB,CAAC,SAAS,EAAE,MAAM,GAAG;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,EAAE,YAyD9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,YAWhC,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAEnD,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAS5E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,eAAe,CAAC,EAAE,MAAM,EACxB,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM,CA0BR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tool } from 'openai/resources/responses/responses';
|
|
2
|
-
import { LLMResponse, LLMOptions, LLMModel, ContextMessage } from './types';
|
|
2
|
+
import { LLMResponse, LLMOptions, LLMModel, ContextMessage, OpenAIModel } from './types';
|
|
3
3
|
import { ResponseCreateParamsNonStreaming } from 'openai/resources/responses/responses';
|
|
4
4
|
export declare const DEFAULT_OPTIONS: LLMOptions;
|
|
5
5
|
/**
|
|
@@ -13,13 +13,13 @@ export declare function supportsTemperature(model: string): boolean;
|
|
|
13
13
|
* @param model The model to check.
|
|
14
14
|
* @returns True if the model is a reasoning model, false otherwise.
|
|
15
15
|
*/
|
|
16
|
-
export declare function isReasoningModel(model: string):
|
|
16
|
+
export declare function isReasoningModel(model: string): model is OpenAIModel;
|
|
17
17
|
/**
|
|
18
18
|
* Checks if the given model is a GPT-5 model. GPT-5 models don't support tool_choice other than 'auto'.
|
|
19
19
|
* @param model The model to check.
|
|
20
20
|
* @returns True if the model is a GPT-5 model, false otherwise.
|
|
21
21
|
*/
|
|
22
|
-
export declare function isGPT5Model(model: string):
|
|
22
|
+
export declare function isGPT5Model(model: string): model is OpenAIModel;
|
|
23
23
|
/**
|
|
24
24
|
* Makes a call to OpenAI's Responses API for more advanced use cases with built-in tools.
|
|
25
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-openai.d.ts","sourceRoot":"","sources":["../../src/llm-openai.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,IAAI,EAIL,MAAM,sCAAsC,CAAC;AAI9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAwB,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"llm-openai.d.ts","sourceRoot":"","sources":["../../src/llm-openai.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,IAAI,EAIL,MAAM,sCAAsC,CAAC;AAI9C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAwB,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/G,OAAO,EACL,gCAAgC,EAOjC,MAAM,sCAAsC,CAAC;AAE9C,eAAO,MAAM,eAAe,EAAE,UAG7B,CAAC;AAqBF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAK1D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW,CAGpE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW,CAG/D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,oBAAoB,GAAU,CAAC,GAAG,MAAM,EACnD,OAAO,MAAM,GAAG,gCAAgC,CAAC,OAAO,CAAC,EACzD,UAAS,IAAI,CAAC,gCAAgC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CACX,KACL,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CA0HxB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,WAAW,CAAC,CAAC,GAAG,MAAM,EAC1C,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IACP,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACtC,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;CACvB,GACL,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAsHzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OpenAIResponseFormat } from './types';
|
|
2
|
-
export declare function normalizeModelName(model: string):
|
|
1
|
+
import { LLMModel, OpenAIResponseFormat } from './types';
|
|
2
|
+
export declare function normalizeModelName(model: string): LLMModel;
|
|
3
3
|
export declare const CODE_BLOCK_TYPES: string[];
|
|
4
4
|
/**
|
|
5
5
|
* Tries to parse JSON from the given content string according to the specified
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-utils.d.ts","sourceRoot":"","sources":["../../src/llm-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"llm-utils.d.ts","sourceRoot":"","sources":["../../src/llm-utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAe,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGtE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAE1D;AAED,eAAO,MAAM,gBAAgB,UAAsF,CAAC;AAElH;;;;;;;;;;GAUG;AACL,wBAAsB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,oBAAoB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CA+E/G"}
|
|
@@ -3,7 +3,7 @@ import { ImageGenerateParams } from 'openai/resources/images';
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents OpenAI models
|
|
5
5
|
*/
|
|
6
|
-
export type OpenAIModel = 'gpt-4o-mini' | 'gpt-4o' | 'o1-mini' | 'o1' | 'o3-mini' | 'gpt-4.1' | 'gpt-4.1-mini' | 'o4-mini' | 'gpt-4.1-nano' | 'o3' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano';
|
|
6
|
+
export type OpenAIModel = 'gpt-4o-mini' | 'gpt-4o' | 'o1-mini' | 'o1' | 'o3-mini' | 'gpt-4.1' | 'gpt-4.1-mini' | 'o4-mini' | 'gpt-4.1-nano' | 'o3' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5.1';
|
|
7
7
|
/**
|
|
8
8
|
* Represents Deepseek models
|
|
9
9
|
*/
|
|
@@ -11,7 +11,7 @@ export type DeepseekModel = 'deepseek-chat' | 'deepseek-reasoner';
|
|
|
11
11
|
/**
|
|
12
12
|
* Represents OpenRouter models
|
|
13
13
|
*/
|
|
14
|
-
export type OpenRouterModel = 'openai/gpt-5' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-oss-120b' | 'z.ai/glm-4.5' | 'z.ai/glm-4.5-air' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-lite' | 'deepseek/deepseek-r1-0528' | 'deepseek/deepseek-chat-v3-0324';
|
|
14
|
+
export type OpenRouterModel = 'openai/gpt-5' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5.1' | 'openai/gpt-oss-120b' | 'z.ai/glm-4.5' | 'z.ai/glm-4.5-air' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-lite' | 'deepseek/deepseek-r1-0528' | 'deepseek/deepseek-chat-v3-0324';
|
|
15
15
|
/**
|
|
16
16
|
* Represents pricing information for OpenRouter models
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm-types.d.ts","sourceRoot":"","sources":["../../../src/types/llm-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAClI,OAAO,EAAE,mBAAmB,EAAc,MAAM,yBAAyB,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,cAAc,GAAG,IAAI,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"llm-types.d.ts","sourceRoot":"","sources":["../../../src/types/llm-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAClI,OAAO,EAAE,mBAAmB,EAAc,MAAM,yBAAyB,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,cAAc,GAAG,IAAI,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS,CAAC;AA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,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC/C,UAAU,CAAC,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAC;CAChD;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.45",
|
|
7
7
|
"author": "Disco Media",
|
|
8
8
|
"description": "Utility functions used in Disco Media apps",
|
|
9
9
|
"always-build-npm": true,
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"dotenv": "^17.2.3",
|
|
36
|
-
"openai": "^6.
|
|
36
|
+
"openai": "^6.9.1",
|
|
37
37
|
"p-limit": "^7.2.0",
|
|
38
38
|
"tslib": "^2.8.1",
|
|
39
39
|
"ws": "^8.18.3"
|
|
40
40
|
},
|
|
41
41
|
"license": "ISC",
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@rollup/plugin-commonjs": "^
|
|
43
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
44
44
|
"@rollup/plugin-json": "^6.1.0",
|
|
45
45
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
46
46
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
47
47
|
"@types/ws": "^8.18.1",
|
|
48
48
|
"lightweight-charts": "^5.0.9",
|
|
49
|
-
"rollup": "^4.
|
|
49
|
+
"rollup": "^4.53.2",
|
|
50
50
|
"typescript": "^5.9.3"
|
|
51
51
|
}
|
|
52
52
|
}
|