@playcraft/common 0.0.56 → 0.0.57
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/agent/index.d.ts +1 -0
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -0
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/openai-responses-api.d.ts +18 -0
- package/dist/agent/openai-responses-api.d.ts.map +1 -0
- package/dist/agent/openai-responses-api.js +28 -0
- package/dist/agent/openai-responses-api.js.map +1 -0
- package/package.json +5 -1
package/dist/agent/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
package/dist/agent/index.js
CHANGED
package/dist/agent/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const IEGG_LITELLM_DEFAULT_URL = "https://litellm.ai.levelinfinite.com";
|
|
2
|
+
/**
|
|
3
|
+
* IEGG LiteLLM 官方入口是 `/v1/chat/completions`、`/v1/responses`。
|
|
4
|
+
* AI SDK 会把路径接在 baseURL 后面,所以 baseURL 必须自带 `/v1`,
|
|
5
|
+
* 否则会打到 `/chat/completions`、`/responses`。
|
|
6
|
+
*/
|
|
7
|
+
export declare function normalizeIeggLiteLLMBaseUrl(apiBaseUrl?: string | null): string;
|
|
8
|
+
/**
|
|
9
|
+
* GPT chat/reasoning 模型走 `/v1/responses`(`input`),Claude 等代理模型仍走
|
|
10
|
+
* `/v1/chat/completions`(`messages`)。
|
|
11
|
+
*/
|
|
12
|
+
export declare function shouldUseOpenAIResponsesApi(model: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* OpenCode 仍走 openai-compatible Chat Completions。Azure gpt-6 + tools
|
|
15
|
+
* 在这条链路上必须显式 `reasoning_effort=none`。
|
|
16
|
+
*/
|
|
17
|
+
export declare function shouldForceChatReasoningNone(model: string): boolean;
|
|
18
|
+
//# sourceMappingURL=openai-responses-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-responses-api.d.ts","sourceRoot":"","sources":["../../src/agent/openai-responses-api.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,yCAAyC,CAAC;AAE/E;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAI9E;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGlE;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGnE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const IEGG_LITELLM_DEFAULT_URL = 'https://litellm.ai.levelinfinite.com';
|
|
2
|
+
/**
|
|
3
|
+
* IEGG LiteLLM 官方入口是 `/v1/chat/completions`、`/v1/responses`。
|
|
4
|
+
* AI SDK 会把路径接在 baseURL 后面,所以 baseURL 必须自带 `/v1`,
|
|
5
|
+
* 否则会打到 `/chat/completions`、`/responses`。
|
|
6
|
+
*/
|
|
7
|
+
export function normalizeIeggLiteLLMBaseUrl(apiBaseUrl) {
|
|
8
|
+
const raw = apiBaseUrl?.trim() || IEGG_LITELLM_DEFAULT_URL;
|
|
9
|
+
const trimmed = raw.replace(/\/+$/, '');
|
|
10
|
+
return trimmed.endsWith('/v1') ? trimmed : `${trimmed}/v1`;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* GPT chat/reasoning 模型走 `/v1/responses`(`input`),Claude 等代理模型仍走
|
|
14
|
+
* `/v1/chat/completions`(`messages`)。
|
|
15
|
+
*/
|
|
16
|
+
export function shouldUseOpenAIResponsesApi(model) {
|
|
17
|
+
const normalized = (model.split('/').pop() ?? model).toLowerCase();
|
|
18
|
+
return /^gpt-\d/.test(normalized);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* OpenCode 仍走 openai-compatible Chat Completions。Azure gpt-6 + tools
|
|
22
|
+
* 在这条链路上必须显式 `reasoning_effort=none`。
|
|
23
|
+
*/
|
|
24
|
+
export function shouldForceChatReasoningNone(model) {
|
|
25
|
+
const normalized = (model.split('/').pop() ?? model).toLowerCase();
|
|
26
|
+
return /^gpt-6/.test(normalized);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=openai-responses-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai-responses-api.js","sourceRoot":"","sources":["../../src/agent/openai-responses-api.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG,sCAAsC,CAAC;AAE/E;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,UAA0B;IACpE,MAAM,GAAG,GAAG,UAAU,EAAE,IAAI,EAAE,IAAI,wBAAwB,CAAC;IAC3D,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACxC,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,KAAK,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAa;IACvD,MAAM,UAAU,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IACnE,OAAO,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAAa;IACxD,MAAM,UAAU,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IACnE,OAAO,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcraft/common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -65,6 +65,10 @@
|
|
|
65
65
|
"types": "./dist/agent/model-context-window.d.ts",
|
|
66
66
|
"default": "./dist/agent/model-context-window.js"
|
|
67
67
|
},
|
|
68
|
+
"./agent/openai-responses-api": {
|
|
69
|
+
"types": "./dist/agent/openai-responses-api.d.ts",
|
|
70
|
+
"default": "./dist/agent/openai-responses-api.js"
|
|
71
|
+
},
|
|
68
72
|
"./agent/context-usage": {
|
|
69
73
|
"types": "./dist/agent/context-usage.d.ts",
|
|
70
74
|
"default": "./dist/agent/context-usage.js"
|