supercompat 4.0.4 → 4.1.0
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/openai/index.cjs +11093 -11008
- package/dist/openai/index.cjs.map +1 -1
- package/dist/openai/index.d.cts +46 -62
- package/dist/openai/index.d.ts +46 -62
- package/dist/openai/index.js +11065 -10976
- package/dist/openai/index.js.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +45 -16
- package/dist/types/index.d.ts +45 -16
- package/package.json +1 -1
package/dist/types/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/domas/Developer/supercorp/supercompat/packages/supercompat/dist/types/index.cjs","../../src/types/index.ts"],"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__toCommonJS","mod","value","types_exports","module","exports"],"mappings":"AAAA;;;;;AACA,IAAIA,YAAYC,OAAOC,cAAc;AACrC,IAAIC,mBAAmBF,OAAOG,wBAAwB;AACtD,IAAIC,oBAAoBJ,OAAOK,mBAAmB;AAClD,IAAIC,eAAeN,OAAOO,SAAS,CAACC,cAAc;AAClD,IAAIC,cAAc,SAACC,IAAIC,MAAMC,QAAQC;IACnC,IAAIF,QAAQ,CAAA,OAAOA,qCAAP,SAAOA,KAAG,MAAM,YAAY,OAAOA,SAAS,YAAY;YAC7D,kCAAA,2BAAA;;;gBAAA,IAAIG,MAAJ;gBACH,IAAI,CAACR,aAAaS,IAAI,CAACL,IAAII,QAAQA,QAAQF,QACzCb,UAAUW,IAAII,KAAK;oBAAEE,KAAK;+BAAML,IAAI,CAACG,IAAI;;oBAAEG,YAAY,CAAEJ,CAAAA,OAAOX,iBAAiBS,MAAMG,IAAG,KAAMD,KAAKI,UAAU;gBAAC;;YAFpH,QAAK,YAAWb,kBAAkBO,0BAA7B,SAAA,6BAAA,QAAA,yBAAA;;YAAA;YAAA;;;qBAAA,6BAAA;oBAAA;;;oBAAA;0BAAA;;;;IAGP;IACA,OAAOD;AACT;AACA,IAAIQ,eAAe,SAACC;WAAQV,YAAYV,UAAU,CAAC,GAAG,cAAc;QAAEqB,OAAO;IAAK,IAAID;;AAEtF,qBAAqB;ACfrB,IAAAE,gBAAA,CAAA;AAAAC,OAAAC,OAAA,GAAAL,aAAAG","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/types/index.ts\nvar types_exports = {};\nmodule.exports = __toCommonJS(types_exports);\n","import type OpenAI from 'openai'\n\nexport type MessageWithRun = OpenAI.Beta.Threads.Message & {\n run: (OpenAI.Beta.Threads.Run & {\n runSteps: OpenAI.Beta.Threads.Runs.RunStep[]\n }) | null\n}\n\
|
|
1
|
+
{"version":3,"sources":["/Users/domas/Developer/supercorp/supercompat/packages/supercompat/dist/types/index.cjs","../../src/types/index.ts"],"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__toCommonJS","mod","value","types_exports","module","exports"],"mappings":"AAAA;;;;;AACA,IAAIA,YAAYC,OAAOC,cAAc;AACrC,IAAIC,mBAAmBF,OAAOG,wBAAwB;AACtD,IAAIC,oBAAoBJ,OAAOK,mBAAmB;AAClD,IAAIC,eAAeN,OAAOO,SAAS,CAACC,cAAc;AAClD,IAAIC,cAAc,SAACC,IAAIC,MAAMC,QAAQC;IACnC,IAAIF,QAAQ,CAAA,OAAOA,qCAAP,SAAOA,KAAG,MAAM,YAAY,OAAOA,SAAS,YAAY;YAC7D,kCAAA,2BAAA;;;gBAAA,IAAIG,MAAJ;gBACH,IAAI,CAACR,aAAaS,IAAI,CAACL,IAAII,QAAQA,QAAQF,QACzCb,UAAUW,IAAII,KAAK;oBAAEE,KAAK;+BAAML,IAAI,CAACG,IAAI;;oBAAEG,YAAY,CAAEJ,CAAAA,OAAOX,iBAAiBS,MAAMG,IAAG,KAAMD,KAAKI,UAAU;gBAAC;;YAFpH,QAAK,YAAWb,kBAAkBO,0BAA7B,SAAA,6BAAA,QAAA,yBAAA;;YAAA;YAAA;;;qBAAA,6BAAA;oBAAA;;;oBAAA;0BAAA;;;;IAGP;IACA,OAAOD;AACT;AACA,IAAIQ,eAAe,SAACC;WAAQV,YAAYV,UAAU,CAAC,GAAG,cAAc;QAAEqB,OAAO;IAAK,IAAID;;AAEtF,qBAAqB;ACfrB,IAAAE,gBAAA,CAAA;AAAAC,OAAAC,OAAA,GAAAL,aAAAG","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/types/index.ts\nvar types_exports = {};\nmodule.exports = __toCommonJS(types_exports);\n","import type OpenAI from 'openai'\n\nexport type MessageWithRun = OpenAI.Beta.Threads.Message & {\n run: (OpenAI.Beta.Threads.Run & {\n runSteps: OpenAI.Beta.Threads.Runs.RunStep[]\n }) | null\n}\n\nexport interface GetOpenaiAssistantFn {\n (args: { select: { id: true } }):\n | Pick<OpenAI.Beta.Assistants.Assistant, 'id'>\n | Promise<Pick<OpenAI.Beta.Assistants.Assistant, 'id'>>\n (args?: { select?: { id?: false } }):\n | OpenAI.Beta.Assistants.Assistant\n | Promise<OpenAI.Beta.Assistants.Assistant>\n}\n\n/**\n * Body shape from Assistants surface storage adapters (prismaStorageAdapter, memoryStorageAdapter).\n * This is a serialized OpenAI Run object — contains both API params and event metadata.\n */\nexport type AssistantsRunBody = OpenAI.Beta.Threads.Run\n\n/**\n * Body shape from Responses surface storage adapters (prismaStorageAdapter, openaiResponsesStorageAdapter).\n * These are Responses API params — passed directly to client.responses.create() by native adapters,\n * or used by completionsRunAdapter to build a /chat/completions request.\n */\nexport type ResponsesRunBody = {\n model?: string\n input?: OpenAI.Responses.ResponseInput\n status?: string\n instructions?: string\n tools?: OpenAI.Responses.Tool[]\n tool_choice?: OpenAI.Responses.ResponseCreateParams['tool_choice']\n metadata?: Record<string, string> | null\n temperature?: number\n top_p?: number\n max_output_tokens?: number\n text?: OpenAI.Responses.ResponseTextConfig\n truncation?: OpenAI.Responses.ResponseCreateParams['truncation']\n conversation?: string\n parallel_tool_calls?: boolean\n // Azure agent reference\n agent?: { name: string; type: string }\n}\n\n/**\n * Body shape from Azure Agents storage adapter.\n */\nexport type AzureAgentsRunBody = {\n threadId: string\n assistantId: string\n instructions?: string\n tools?: OpenAI.Beta.Threads.Runs.RunCreateParams['tools']\n}\n\nexport type RunAdapterBody = AssistantsRunBody | ResponsesRunBody | AzureAgentsRunBody\n\nexport type RunAdapterHandleArgs = {\n client: OpenAI\n body: RunAdapterBody\n onEvent: (event: any) => Promise<any>\n getMessages?: () => Promise<MessageWithRun[]>\n}\n\nexport type RunAdapterHandle = (\n args: RunAdapterHandleArgs,\n) => Promise<void>\n\nexport type RunAdapter = {\n handleRun: RunAdapterHandle\n getOpenaiAssistant?: GetOpenaiAssistantFn\n}\n\nexport type RunAdapterPartobClient = Omit<RunAdapter, 'handleRun'> & {\n handleRun: (\n args: Omit<RunAdapterHandleArgs, 'client'>,\n ) => ReturnType<RunAdapterHandle>\n}\n\nexport type RunAdapterWithAssistant = RunAdapterPartobClient & {\n getOpenaiAssistant: GetOpenaiAssistantFn\n}\n\nexport type StorageAdapterArgs = {\n client: OpenAI\n runAdapter: RunAdapterPartobClient\n originalClient?: any\n}\n\nexport type RequestHandler = (\n url: string,\n init: RequestInit & { body?: string },\n) => Promise<Response>\n"]}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -17,30 +17,59 @@ interface GetOpenaiAssistantFn {
|
|
|
17
17
|
};
|
|
18
18
|
}): OpenAI.Beta.Assistants.Assistant | Promise<OpenAI.Beta.Assistants.Assistant>;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Body shape from Assistants surface storage adapters (prismaStorageAdapter, memoryStorageAdapter).
|
|
22
|
+
* This is a serialized OpenAI Run object — contains both API params and event metadata.
|
|
23
|
+
*/
|
|
24
|
+
type AssistantsRunBody = OpenAI.Beta.Threads.Run;
|
|
25
|
+
/**
|
|
26
|
+
* Body shape from Responses surface storage adapters (prismaStorageAdapter, openaiResponsesStorageAdapter).
|
|
27
|
+
* These are Responses API params — passed directly to client.responses.create() by native adapters,
|
|
28
|
+
* or used by completionsRunAdapter to build a /chat/completions request.
|
|
29
|
+
*/
|
|
30
|
+
type ResponsesRunBody = {
|
|
31
|
+
model?: string;
|
|
32
|
+
input?: OpenAI.Responses.ResponseInput;
|
|
33
|
+
status?: string;
|
|
34
|
+
instructions?: string;
|
|
35
|
+
tools?: OpenAI.Responses.Tool[];
|
|
36
|
+
tool_choice?: OpenAI.Responses.ResponseCreateParams['tool_choice'];
|
|
37
|
+
metadata?: Record<string, string> | null;
|
|
38
|
+
temperature?: number;
|
|
39
|
+
top_p?: number;
|
|
40
|
+
max_output_tokens?: number;
|
|
41
|
+
text?: OpenAI.Responses.ResponseTextConfig;
|
|
42
|
+
truncation?: OpenAI.Responses.ResponseCreateParams['truncation'];
|
|
43
|
+
conversation?: string;
|
|
44
|
+
parallel_tool_calls?: boolean;
|
|
45
|
+
agent?: {
|
|
46
|
+
name: string;
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
27
49
|
};
|
|
28
|
-
|
|
29
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Body shape from Azure Agents storage adapter.
|
|
52
|
+
*/
|
|
53
|
+
type AzureAgentsRunBody = {
|
|
30
54
|
threadId: string;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
55
|
+
assistantId: string;
|
|
56
|
+
instructions?: string;
|
|
57
|
+
tools?: OpenAI.Beta.Threads.Runs.RunCreateParams['tools'];
|
|
58
|
+
};
|
|
59
|
+
type RunAdapterBody = AssistantsRunBody | ResponsesRunBody | AzureAgentsRunBody;
|
|
60
|
+
type RunAdapterHandleArgs = {
|
|
61
|
+
client: OpenAI;
|
|
62
|
+
body: RunAdapterBody;
|
|
63
|
+
onEvent: (event: any) => Promise<any>;
|
|
64
|
+
getMessages?: () => Promise<MessageWithRun[]>;
|
|
35
65
|
};
|
|
36
|
-
type RunAdapterHandleArgs = RunAdapterHandleArgsThreadRun | RunAdapterHandleArgsResponse;
|
|
37
66
|
type RunAdapterHandle = (args: RunAdapterHandleArgs) => Promise<void>;
|
|
38
67
|
type RunAdapter = {
|
|
39
68
|
handleRun: RunAdapterHandle;
|
|
40
69
|
getOpenaiAssistant?: GetOpenaiAssistantFn;
|
|
41
70
|
};
|
|
42
71
|
type RunAdapterPartobClient = Omit<RunAdapter, 'handleRun'> & {
|
|
43
|
-
handleRun: (args: Omit<
|
|
72
|
+
handleRun: (args: Omit<RunAdapterHandleArgs, 'client'>) => ReturnType<RunAdapterHandle>;
|
|
44
73
|
};
|
|
45
74
|
type RunAdapterWithAssistant = RunAdapterPartobClient & {
|
|
46
75
|
getOpenaiAssistant: GetOpenaiAssistantFn;
|
|
@@ -54,4 +83,4 @@ type RequestHandler = (url: string, init: RequestInit & {
|
|
|
54
83
|
body?: string;
|
|
55
84
|
}) => Promise<Response>;
|
|
56
85
|
|
|
57
|
-
export type { MessageWithRun, RequestHandler, RunAdapter, RunAdapterHandle, RunAdapterHandleArgs, RunAdapterPartobClient, RunAdapterWithAssistant, StorageAdapterArgs };
|
|
86
|
+
export type { AssistantsRunBody, AzureAgentsRunBody, GetOpenaiAssistantFn, MessageWithRun, RequestHandler, ResponsesRunBody, RunAdapter, RunAdapterBody, RunAdapterHandle, RunAdapterHandleArgs, RunAdapterPartobClient, RunAdapterWithAssistant, StorageAdapterArgs };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,30 +17,59 @@ interface GetOpenaiAssistantFn {
|
|
|
17
17
|
};
|
|
18
18
|
}): OpenAI.Beta.Assistants.Assistant | Promise<OpenAI.Beta.Assistants.Assistant>;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Body shape from Assistants surface storage adapters (prismaStorageAdapter, memoryStorageAdapter).
|
|
22
|
+
* This is a serialized OpenAI Run object — contains both API params and event metadata.
|
|
23
|
+
*/
|
|
24
|
+
type AssistantsRunBody = OpenAI.Beta.Threads.Run;
|
|
25
|
+
/**
|
|
26
|
+
* Body shape from Responses surface storage adapters (prismaStorageAdapter, openaiResponsesStorageAdapter).
|
|
27
|
+
* These are Responses API params — passed directly to client.responses.create() by native adapters,
|
|
28
|
+
* or used by completionsRunAdapter to build a /chat/completions request.
|
|
29
|
+
*/
|
|
30
|
+
type ResponsesRunBody = {
|
|
31
|
+
model?: string;
|
|
32
|
+
input?: OpenAI.Responses.ResponseInput;
|
|
33
|
+
status?: string;
|
|
34
|
+
instructions?: string;
|
|
35
|
+
tools?: OpenAI.Responses.Tool[];
|
|
36
|
+
tool_choice?: OpenAI.Responses.ResponseCreateParams['tool_choice'];
|
|
37
|
+
metadata?: Record<string, string> | null;
|
|
38
|
+
temperature?: number;
|
|
39
|
+
top_p?: number;
|
|
40
|
+
max_output_tokens?: number;
|
|
41
|
+
text?: OpenAI.Responses.ResponseTextConfig;
|
|
42
|
+
truncation?: OpenAI.Responses.ResponseCreateParams['truncation'];
|
|
43
|
+
conversation?: string;
|
|
44
|
+
parallel_tool_calls?: boolean;
|
|
45
|
+
agent?: {
|
|
46
|
+
name: string;
|
|
47
|
+
type: string;
|
|
48
|
+
};
|
|
27
49
|
};
|
|
28
|
-
|
|
29
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Body shape from Azure Agents storage adapter.
|
|
52
|
+
*/
|
|
53
|
+
type AzureAgentsRunBody = {
|
|
30
54
|
threadId: string;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
55
|
+
assistantId: string;
|
|
56
|
+
instructions?: string;
|
|
57
|
+
tools?: OpenAI.Beta.Threads.Runs.RunCreateParams['tools'];
|
|
58
|
+
};
|
|
59
|
+
type RunAdapterBody = AssistantsRunBody | ResponsesRunBody | AzureAgentsRunBody;
|
|
60
|
+
type RunAdapterHandleArgs = {
|
|
61
|
+
client: OpenAI;
|
|
62
|
+
body: RunAdapterBody;
|
|
63
|
+
onEvent: (event: any) => Promise<any>;
|
|
64
|
+
getMessages?: () => Promise<MessageWithRun[]>;
|
|
35
65
|
};
|
|
36
|
-
type RunAdapterHandleArgs = RunAdapterHandleArgsThreadRun | RunAdapterHandleArgsResponse;
|
|
37
66
|
type RunAdapterHandle = (args: RunAdapterHandleArgs) => Promise<void>;
|
|
38
67
|
type RunAdapter = {
|
|
39
68
|
handleRun: RunAdapterHandle;
|
|
40
69
|
getOpenaiAssistant?: GetOpenaiAssistantFn;
|
|
41
70
|
};
|
|
42
71
|
type RunAdapterPartobClient = Omit<RunAdapter, 'handleRun'> & {
|
|
43
|
-
handleRun: (args: Omit<
|
|
72
|
+
handleRun: (args: Omit<RunAdapterHandleArgs, 'client'>) => ReturnType<RunAdapterHandle>;
|
|
44
73
|
};
|
|
45
74
|
type RunAdapterWithAssistant = RunAdapterPartobClient & {
|
|
46
75
|
getOpenaiAssistant: GetOpenaiAssistantFn;
|
|
@@ -54,4 +83,4 @@ type RequestHandler = (url: string, init: RequestInit & {
|
|
|
54
83
|
body?: string;
|
|
55
84
|
}) => Promise<Response>;
|
|
56
85
|
|
|
57
|
-
export type { MessageWithRun, RequestHandler, RunAdapter, RunAdapterHandle, RunAdapterHandleArgs, RunAdapterPartobClient, RunAdapterWithAssistant, StorageAdapterArgs };
|
|
86
|
+
export type { AssistantsRunBody, AzureAgentsRunBody, GetOpenaiAssistantFn, MessageWithRun, RequestHandler, ResponsesRunBody, RunAdapter, RunAdapterBody, RunAdapterHandle, RunAdapterHandleArgs, RunAdapterPartobClient, RunAdapterWithAssistant, StorageAdapterArgs };
|