@supersolutions/super-chat-core 0.0.0 → 0.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/LICENSE +201 -0
- package/NOTICE +14 -0
- package/README.md +72 -1
- package/dist/anthropic.d.ts +11 -0
- package/dist/anthropic.js +22 -0
- package/dist/anthropic.js.map +1 -0
- package/dist/chunk-32DPF33V.js +467 -0
- package/dist/chunk-32DPF33V.js.map +1 -0
- package/dist/chunk-JMM3X3GB.js +454 -0
- package/dist/chunk-JMM3X3GB.js.map +1 -0
- package/dist/chunk-MHGENDQX.js +1080 -0
- package/dist/chunk-MHGENDQX.js.map +1 -0
- package/dist/index.d.ts +2529 -0
- package/dist/index.js +5452 -0
- package/dist/index.js.map +1 -0
- package/dist/map-in-B1lLaNxO.d.ts +411 -0
- package/dist/map-in-ByQRBLJ2.d.ts +194 -0
- package/dist/openai.d.ts +52 -0
- package/dist/openai.js +48 -0
- package/dist/openai.js.map +1 -0
- package/dist/types-C3VavKYX.d.ts +457 -0
- package/package.json +56 -6
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a binary/media payload actually lives.
|
|
3
|
+
*
|
|
4
|
+
* `providerFile` is the important one: large files should be uploaded once
|
|
5
|
+
* (OpenAI `/v1/files`) and referenced by id, not re-encoded as base64 on every
|
|
6
|
+
* turn. `provider` is recorded so an adapter can refuse a file id minted by a
|
|
7
|
+
* different provider instead of sending a 400-guaranteed request.
|
|
8
|
+
*/
|
|
9
|
+
type MediaSource = {
|
|
10
|
+
kind: "url";
|
|
11
|
+
url: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "base64";
|
|
14
|
+
data: string;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "providerFile";
|
|
17
|
+
id: string;
|
|
18
|
+
provider: string;
|
|
19
|
+
};
|
|
20
|
+
/** Reason a tool call did not produce a normal result. */
|
|
21
|
+
type ToolFailureKind = "execution-error" | "denied" | "invalid-input" | "timeout" | "not-found";
|
|
22
|
+
type ToolCallStatus = "pending" | "awaiting-approval" | "running" | "done" | "error" | "denied";
|
|
23
|
+
type ContentPart =
|
|
24
|
+
/** Plain model- or user-authored prose. */
|
|
25
|
+
{
|
|
26
|
+
type: "text";
|
|
27
|
+
text: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Model reasoning. `signature` carries an opaque provider token (Anthropic
|
|
31
|
+
* thinking signatures, Gemini thought signatures) that MUST be echoed back on
|
|
32
|
+
* the next turn or the provider rejects the request — so we keep it on the
|
|
33
|
+
* part rather than dropping reasoning from history.
|
|
34
|
+
*/
|
|
35
|
+
| {
|
|
36
|
+
type: "reasoning";
|
|
37
|
+
text: string;
|
|
38
|
+
signature?: string;
|
|
39
|
+
redacted?: boolean;
|
|
40
|
+
} | {
|
|
41
|
+
type: "image";
|
|
42
|
+
source: MediaSource;
|
|
43
|
+
mediaType?: string;
|
|
44
|
+
detail?: "auto" | "low" | "high";
|
|
45
|
+
} | {
|
|
46
|
+
type: "file";
|
|
47
|
+
source: MediaSource;
|
|
48
|
+
mediaType: string;
|
|
49
|
+
filename?: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: "audio";
|
|
52
|
+
source: MediaSource;
|
|
53
|
+
mediaType: string;
|
|
54
|
+
transcript?: string;
|
|
55
|
+
}
|
|
56
|
+
/** A model's request to call a tool. `callId` is what correlates it to its result. */
|
|
57
|
+
| {
|
|
58
|
+
type: "tool-call";
|
|
59
|
+
callId: string;
|
|
60
|
+
name: string;
|
|
61
|
+
input: unknown;
|
|
62
|
+
status: ToolCallStatus;
|
|
63
|
+
/** Set when the raw arguments were malformed and `repair` fixed them. */
|
|
64
|
+
repaired?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/** The outcome of a tool call, fed back to the model on the next step. */
|
|
67
|
+
| {
|
|
68
|
+
type: "tool-result";
|
|
69
|
+
callId: string;
|
|
70
|
+
name: string;
|
|
71
|
+
output: unknown;
|
|
72
|
+
failure?: ToolFailureKind;
|
|
73
|
+
/**
|
|
74
|
+
* Wall-clock duration of the call.
|
|
75
|
+
*
|
|
76
|
+
* Kept on the part, not just on the event: the part is what gets folded
|
|
77
|
+
* into the committed message, so this is what makes a reloaded thread able
|
|
78
|
+
* to show how long a step took rather than only the live run.
|
|
79
|
+
*/
|
|
80
|
+
ms?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Renderer key for generative UI. The UI package looks this up in its
|
|
83
|
+
* renderer registry; unknown keys fall back to a JSON view, so a headless
|
|
84
|
+
* host is never broken by a tool that wants a custom card.
|
|
85
|
+
*/
|
|
86
|
+
render?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A first-class UI artifact produced outside the tool loop (a chart the host
|
|
90
|
+
* computed, a diff, a form). Carried through history so a reloaded thread
|
|
91
|
+
* still renders, but stripped before it reaches a provider.
|
|
92
|
+
*/
|
|
93
|
+
| {
|
|
94
|
+
type: "artifact";
|
|
95
|
+
id: string;
|
|
96
|
+
kind: string;
|
|
97
|
+
title?: string;
|
|
98
|
+
data: unknown;
|
|
99
|
+
/**
|
|
100
|
+
* For an interactive card: what the user answered. A sibling of `data`
|
|
101
|
+
* rather than nested inside it, so history-shedding can replace the
|
|
102
|
+
* payload without taking the answer with it — the answer is tiny and is
|
|
103
|
+
* what makes a re-rendered card readable.
|
|
104
|
+
*/
|
|
105
|
+
action?: unknown;
|
|
106
|
+
};
|
|
107
|
+
type MessageRole = "system" | "user" | "assistant" | "tool";
|
|
108
|
+
type Message = {
|
|
109
|
+
id: string;
|
|
110
|
+
role: MessageRole;
|
|
111
|
+
parts: ContentPart[];
|
|
112
|
+
createdAt?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Branching: the message this one replies to. `null`/absent on a root.
|
|
115
|
+
* A linear thread is the degenerate case (each message's parent is the
|
|
116
|
+
* previous one); editing or regenerating creates a SIBLING instead of
|
|
117
|
+
* rewriting history, and the active conversation is the path from a chosen
|
|
118
|
+
* head back to the root. Helpers live in content/branching.ts.
|
|
119
|
+
*/
|
|
120
|
+
parentId?: string | null;
|
|
121
|
+
/** Free-form host metadata. Never sent to a provider. */
|
|
122
|
+
metadata?: Record<string, unknown>;
|
|
123
|
+
};
|
|
124
|
+
type Usage = {
|
|
125
|
+
inputTokens?: number;
|
|
126
|
+
outputTokens?: number;
|
|
127
|
+
totalTokens?: number;
|
|
128
|
+
/** Prompt-cache hits, when the provider reports them. */
|
|
129
|
+
cachedInputTokens?: number;
|
|
130
|
+
reasoningTokens?: number;
|
|
131
|
+
};
|
|
132
|
+
type FinishReason = "stop" | "length" | "tool-calls" | "content-filter" | "cancelled" | "error" | "unknown";
|
|
133
|
+
|
|
134
|
+
type TransportRequest = {
|
|
135
|
+
/** Provider id ("openai"). The proxy transport uses it to route. */
|
|
136
|
+
provider: string;
|
|
137
|
+
/** Provider-relative path, always leading-slash ("/responses", "/responses/{id}"). */
|
|
138
|
+
path: string;
|
|
139
|
+
method: "GET" | "POST" | "DELETE";
|
|
140
|
+
body?: unknown;
|
|
141
|
+
headers?: Record<string, string>;
|
|
142
|
+
/** Hint that the response is SSE. Transports must not buffer these. */
|
|
143
|
+
stream?: boolean;
|
|
144
|
+
signal?: AbortSignal;
|
|
145
|
+
/** Extra query params, appended after any already present in `path`. */
|
|
146
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* A multipart/form-data body (file uploads). `TransportRequest.body` stays
|
|
150
|
+
* `unknown`, so this is a convention, not a breaking change: adapters that
|
|
151
|
+
* upload build this shape, and each transport recognizes it with
|
|
152
|
+
* `isMultipartBody` and encodes it for its own wire — a real FormData on a
|
|
153
|
+
* direct connection, base64 inside the JSON envelope through the proxy.
|
|
154
|
+
*
|
|
155
|
+
* Bytes are `Uint8Array` everywhere in core. Only the wire encodes.
|
|
156
|
+
*/
|
|
157
|
+
type MultipartBody = {
|
|
158
|
+
kind: "multipart";
|
|
159
|
+
/** Plain string form fields ("purpose"). */
|
|
160
|
+
fields: Record<string, string>;
|
|
161
|
+
/** Binary parts. Raw bytes in memory; the proxy base64-encodes on the wire. */
|
|
162
|
+
files: {
|
|
163
|
+
field: string;
|
|
164
|
+
filename: string;
|
|
165
|
+
mediaType?: string;
|
|
166
|
+
data: Uint8Array;
|
|
167
|
+
}[];
|
|
168
|
+
};
|
|
169
|
+
declare function isMultipartBody(b: unknown): b is MultipartBody;
|
|
170
|
+
type Transport = {
|
|
171
|
+
readonly kind: "direct" | "proxy" | "custom";
|
|
172
|
+
/**
|
|
173
|
+
* Perform the call and return the raw `Response`. Returning `Response` rather
|
|
174
|
+
* than parsed JSON is deliberate: streaming adapters need the body stream, and
|
|
175
|
+
* error mapping needs status + headers (Retry-After).
|
|
176
|
+
*/
|
|
177
|
+
fetch(req: TransportRequest): Promise<Response>;
|
|
178
|
+
/**
|
|
179
|
+
* Whether this transport can be trusted with a secret. `false` for
|
|
180
|
+
* DirectTransport in a browser — the runtime surfaces this so a host can warn
|
|
181
|
+
* rather than silently shipping a key to the client.
|
|
182
|
+
*/
|
|
183
|
+
readonly credentialSafe: boolean;
|
|
184
|
+
};
|
|
185
|
+
type RetryPolicy = {
|
|
186
|
+
maxAttempts: number;
|
|
187
|
+
/** First backoff in ms; doubled each attempt with full jitter. */
|
|
188
|
+
baseDelayMs: number;
|
|
189
|
+
maxDelayMs: number;
|
|
190
|
+
};
|
|
191
|
+
declare const DEFAULT_RETRY: RetryPolicy;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* JSON Schema, loosely typed. Plain schemas rather than zod/valibot so the core
|
|
195
|
+
* carries no validation dependency and a host can bring whatever it already uses.
|
|
196
|
+
*
|
|
197
|
+
* `type` accepts an array because JSON Schema allows union types (`["string",
|
|
198
|
+
* "number"]`), which card specs use for values that may be either.
|
|
199
|
+
*/
|
|
200
|
+
type JSONSchema = {
|
|
201
|
+
type?: string | string[];
|
|
202
|
+
properties?: Record<string, JSONSchema>;
|
|
203
|
+
items?: JSONSchema | JSONSchema[];
|
|
204
|
+
required?: string[];
|
|
205
|
+
enum?: unknown[];
|
|
206
|
+
const?: unknown;
|
|
207
|
+
description?: string;
|
|
208
|
+
additionalProperties?: boolean | JSONSchema;
|
|
209
|
+
minimum?: number;
|
|
210
|
+
maximum?: number;
|
|
211
|
+
[k: string]: unknown;
|
|
212
|
+
};
|
|
213
|
+
/** A tool as the *provider* sees it — no execute, no presets, just the schema. */
|
|
214
|
+
type ToolSpec = {
|
|
215
|
+
name: string;
|
|
216
|
+
description: string;
|
|
217
|
+
parameters: JSONSchema;
|
|
218
|
+
/**
|
|
219
|
+
* Ask the provider to guarantee schema conformance (OpenAI structured
|
|
220
|
+
* outputs). Costs a schema-compile on first use and forbids some JSON Schema
|
|
221
|
+
* features, so it is opt-in per tool rather than global.
|
|
222
|
+
*/
|
|
223
|
+
strict?: boolean;
|
|
224
|
+
};
|
|
225
|
+
type ToolChoice = {
|
|
226
|
+
type: "auto";
|
|
227
|
+
} | {
|
|
228
|
+
type: "none";
|
|
229
|
+
} | {
|
|
230
|
+
type: "required";
|
|
231
|
+
} | {
|
|
232
|
+
type: "tool";
|
|
233
|
+
name: string;
|
|
234
|
+
};
|
|
235
|
+
/**
|
|
236
|
+
* A tool the PROVIDER hosts and executes — web search, code interpreter,
|
|
237
|
+
* computer use. Distinct from `ToolSpec` in the way that matters: there is no
|
|
238
|
+
* executor here and never will be, because the call, the execution and the
|
|
239
|
+
* result all happen provider-side within one response.
|
|
240
|
+
*
|
|
241
|
+
* The shape is deliberately opaque. These definitions are provider-specific by
|
|
242
|
+
* nature (`{type: "web_search_20260209", name: "web_search"}` means nothing to
|
|
243
|
+
* a different vendor), they change on the vendor's release cadence rather than
|
|
244
|
+
* ours, and inventing a normalized union across vendors would be a lie that
|
|
245
|
+
* needs a migration every quarter. So: keyed by provider id, appended verbatim
|
|
246
|
+
* to that provider's tool array, ignored by everyone else.
|
|
247
|
+
*/
|
|
248
|
+
type ProviderNativeTool = {
|
|
249
|
+
type: string;
|
|
250
|
+
} & Record<string, unknown>;
|
|
251
|
+
type ReasoningOptions = {
|
|
252
|
+
effort?: "minimal" | "low" | "medium" | "high";
|
|
253
|
+
/** Ask for a human-readable summary of hidden reasoning, where supported. */
|
|
254
|
+
summary?: "auto" | "concise" | "detailed" | "none";
|
|
255
|
+
};
|
|
256
|
+
type ResponseFormat = {
|
|
257
|
+
type: "text";
|
|
258
|
+
} | {
|
|
259
|
+
type: "json";
|
|
260
|
+
} | {
|
|
261
|
+
type: "json_schema";
|
|
262
|
+
name: string;
|
|
263
|
+
schema: JSONSchema;
|
|
264
|
+
strict?: boolean;
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* The single request shape every adapter consumes. Deliberately flat and
|
|
268
|
+
* provider-neutral; anything genuinely provider-specific goes in
|
|
269
|
+
* `providerOptions` keyed by provider id, so an escape hatch never leaks into
|
|
270
|
+
* the shared type.
|
|
271
|
+
*/
|
|
272
|
+
type NormalizedRequest = {
|
|
273
|
+
model: string;
|
|
274
|
+
/** System/developer instructions, already assembled by the ContextBuilder. */
|
|
275
|
+
system?: string;
|
|
276
|
+
messages: Message[];
|
|
277
|
+
tools?: ToolSpec[];
|
|
278
|
+
/**
|
|
279
|
+
* Provider-hosted tools, keyed by provider id — only the matching adapter's
|
|
280
|
+
* entry is sent. They ride ALONGSIDE `tools`, never through the registry:
|
|
281
|
+
* presets gate what the host's own executors can do, and a provider-hosted
|
|
282
|
+
* search has no executor to gate.
|
|
283
|
+
*/
|
|
284
|
+
providerTools?: Record<string, ProviderNativeTool[]>;
|
|
285
|
+
toolChoice?: ToolChoice;
|
|
286
|
+
/**
|
|
287
|
+
* Names the model may call THIS step. Distinct from `tools`: the full set is
|
|
288
|
+
* declared once (stable, cacheable prompt prefix) while the active set can
|
|
289
|
+
* narrow per step. Undefined = all of `tools`.
|
|
290
|
+
*/
|
|
291
|
+
activeTools?: string[];
|
|
292
|
+
maxOutputTokens?: number;
|
|
293
|
+
temperature?: number;
|
|
294
|
+
topP?: number;
|
|
295
|
+
stopSequences?: string[];
|
|
296
|
+
responseFormat?: ResponseFormat;
|
|
297
|
+
reasoning?: ReasoningOptions;
|
|
298
|
+
/** Run server-side and poll, instead of holding a connection open. */
|
|
299
|
+
background?: boolean;
|
|
300
|
+
/**
|
|
301
|
+
* Continue from a provider-held response instead of resending history.
|
|
302
|
+
* OpenAI Responses `previous_response_id`. Adapters that cannot do this
|
|
303
|
+
* ignore it and fall back to full history, so it is always safe to set.
|
|
304
|
+
*/
|
|
305
|
+
previousResponseId?: string;
|
|
306
|
+
/** Provider-side conversation storage opt-out (OpenAI `store`). */
|
|
307
|
+
store?: boolean;
|
|
308
|
+
metadata?: Record<string, string>;
|
|
309
|
+
providerOptions?: Record<string, Record<string, unknown>>;
|
|
310
|
+
};
|
|
311
|
+
type GenerateResult = {
|
|
312
|
+
/** Normalized assistant reply. May contain text, reasoning and tool-call parts. */
|
|
313
|
+
parts: ContentPart[];
|
|
314
|
+
finishReason: FinishReason;
|
|
315
|
+
usage: Usage;
|
|
316
|
+
/** Provider-side id, needed for `previousResponseId` chaining and job polling. */
|
|
317
|
+
responseId?: string;
|
|
318
|
+
modelId: string;
|
|
319
|
+
/** Untouched provider payload, for debugging panes. Never re-sent. */
|
|
320
|
+
raw?: unknown;
|
|
321
|
+
warnings?: string[];
|
|
322
|
+
};
|
|
323
|
+
/** Normalized streaming events. Adapters translate their own SSE dialect into these. */
|
|
324
|
+
type StreamEvent = {
|
|
325
|
+
type: "start";
|
|
326
|
+
responseId?: string;
|
|
327
|
+
modelId: string;
|
|
328
|
+
} | {
|
|
329
|
+
type: "text-delta";
|
|
330
|
+
delta: string;
|
|
331
|
+
} | {
|
|
332
|
+
type: "reasoning-delta";
|
|
333
|
+
delta: string;
|
|
334
|
+
signature?: string;
|
|
335
|
+
}
|
|
336
|
+
/** A tool call has begun; arguments are still streaming in. */
|
|
337
|
+
| {
|
|
338
|
+
type: "tool-call-start";
|
|
339
|
+
callId: string;
|
|
340
|
+
name: string;
|
|
341
|
+
} | {
|
|
342
|
+
type: "tool-call-delta";
|
|
343
|
+
callId: string;
|
|
344
|
+
argsDelta: string;
|
|
345
|
+
}
|
|
346
|
+
/** Arguments complete and parsed (or repaired). */
|
|
347
|
+
| {
|
|
348
|
+
type: "tool-call-end";
|
|
349
|
+
callId: string;
|
|
350
|
+
name: string;
|
|
351
|
+
input: unknown;
|
|
352
|
+
repaired?: boolean;
|
|
353
|
+
} | {
|
|
354
|
+
type: "usage";
|
|
355
|
+
usage: Usage;
|
|
356
|
+
} | {
|
|
357
|
+
type: "finish";
|
|
358
|
+
finishReason: FinishReason;
|
|
359
|
+
responseId?: string;
|
|
360
|
+
usage?: Usage;
|
|
361
|
+
} | {
|
|
362
|
+
type: "error";
|
|
363
|
+
error: unknown;
|
|
364
|
+
};
|
|
365
|
+
type JobStatus = "queued" | "in_progress" | "completed" | "failed" | "cancelled" | "incomplete";
|
|
366
|
+
/** Handle to a provider-side background run. Serializable so it survives reload. */
|
|
367
|
+
type JobHandle = {
|
|
368
|
+
provider: string;
|
|
369
|
+
id: string;
|
|
370
|
+
model: string;
|
|
371
|
+
createdAt: number;
|
|
372
|
+
/** Last SSE sequence number seen, for resumable streaming after a disconnect. */
|
|
373
|
+
cursor?: number;
|
|
374
|
+
};
|
|
375
|
+
type JobSnapshot = {
|
|
376
|
+
handle: JobHandle;
|
|
377
|
+
status: JobStatus;
|
|
378
|
+
/** Present once terminal and successful. */
|
|
379
|
+
result?: GenerateResult;
|
|
380
|
+
error?: {
|
|
381
|
+
message: string;
|
|
382
|
+
code?: string;
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
type ProviderCapabilities = {
|
|
386
|
+
streaming: boolean;
|
|
387
|
+
/** Server-side async execution with polling (OpenAI background mode). */
|
|
388
|
+
backgroundJobs: boolean;
|
|
389
|
+
/** Resume an interrupted stream from a sequence cursor. */
|
|
390
|
+
resumableStreams: boolean;
|
|
391
|
+
tools: boolean;
|
|
392
|
+
parallelToolCalls: boolean;
|
|
393
|
+
images: boolean;
|
|
394
|
+
files: boolean;
|
|
395
|
+
audio: boolean;
|
|
396
|
+
reasoning: boolean;
|
|
397
|
+
strictJsonSchema: boolean;
|
|
398
|
+
/** Provider stores the conversation, enabling `previousResponseId`. */
|
|
399
|
+
serverSideHistory: boolean;
|
|
400
|
+
/** Can upload binaries and mint providerFile ids (`files` = accepts file parts). */
|
|
401
|
+
fileUpload: boolean;
|
|
402
|
+
};
|
|
403
|
+
type FileUploadRequest = {
|
|
404
|
+
data: Blob | ArrayBuffer | Uint8Array;
|
|
405
|
+
filename: string;
|
|
406
|
+
mediaType?: string;
|
|
407
|
+
/** Provider-specific purpose tag. OpenAI defaults to "user_data". */
|
|
408
|
+
purpose?: string;
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* Structurally a `MediaSource` `providerFile` variant, so an upload result
|
|
412
|
+
* drops straight into `file(ref, mediaType)` / `image(ref)` with no glue.
|
|
413
|
+
* `provider` is the ADAPTER's configured id — that is what `assertOwnFile`
|
|
414
|
+
* checks against, so a ref minted by one provider instance is refused by
|
|
415
|
+
* another instead of producing a guaranteed 400.
|
|
416
|
+
*/
|
|
417
|
+
type ProviderFileRef = {
|
|
418
|
+
kind: "providerFile";
|
|
419
|
+
id: string;
|
|
420
|
+
provider: string;
|
|
421
|
+
filename?: string;
|
|
422
|
+
sizeBytes?: number;
|
|
423
|
+
createdAt?: number;
|
|
424
|
+
};
|
|
425
|
+
type CallOptions = {
|
|
426
|
+
signal?: AbortSignal;
|
|
427
|
+
/** Per-call header overrides (e.g. an org id, a beta flag). */
|
|
428
|
+
headers?: Record<string, string>;
|
|
429
|
+
};
|
|
430
|
+
type Provider = {
|
|
431
|
+
readonly id: string;
|
|
432
|
+
readonly label: string;
|
|
433
|
+
readonly capabilities: ProviderCapabilities;
|
|
434
|
+
/** Adapters are constructed with a transport so they never hold a key themselves. */
|
|
435
|
+
readonly transport: Transport;
|
|
436
|
+
generate(req: NormalizedRequest, opts?: CallOptions): Promise<GenerateResult>;
|
|
437
|
+
stream(req: NormalizedRequest, opts?: CallOptions): AsyncIterable<StreamEvent>;
|
|
438
|
+
startJob?(req: NormalizedRequest, opts?: CallOptions): Promise<JobHandle>;
|
|
439
|
+
pollJob?(handle: JobHandle, opts?: CallOptions): Promise<JobSnapshot>;
|
|
440
|
+
cancelJob?(handle: JobHandle, opts?: CallOptions): Promise<JobSnapshot>;
|
|
441
|
+
/** Attach to a running background job's event stream from `handle.cursor`. */
|
|
442
|
+
streamJob?(handle: JobHandle, opts?: CallOptions): AsyncIterable<StreamEvent>;
|
|
443
|
+
/** Upload a binary once and get back a reusable providerFile ref. */
|
|
444
|
+
uploadFile?(req: FileUploadRequest, opts?: CallOptions): Promise<ProviderFileRef>;
|
|
445
|
+
deleteFile?(fileId: string, opts?: CallOptions): Promise<void>;
|
|
446
|
+
listModels?(opts?: CallOptions): Promise<ModelInfo[]>;
|
|
447
|
+
};
|
|
448
|
+
type ModelInfo = {
|
|
449
|
+
id: string;
|
|
450
|
+
label?: string;
|
|
451
|
+
contextWindow?: number;
|
|
452
|
+
maxOutputTokens?: number;
|
|
453
|
+
/** Capability overrides for this specific model (o-series reasoning, vision, …). */
|
|
454
|
+
supports?: Partial<ProviderCapabilities>;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
export { type ContentPart as C, DEFAULT_RETRY as D, type FinishReason as F, type GenerateResult as G, type JSONSchema as J, type Message as M, type NormalizedRequest as N, type ProviderCapabilities as P, type RetryPolicy as R, type StreamEvent as S, type ToolCallStatus as T, type Usage as U, type MediaSource as a, type MessageRole as b, type ToolFailureKind as c, type TransportRequest as d, type Transport as e, type ModelInfo as f, type Provider as g, type CallOptions as h, type ToolSpec as i, type JobHandle as j, type JobStatus as k, type ProviderFileRef as l, type FileUploadRequest as m, type JobSnapshot as n, type MultipartBody as o, type ReasoningOptions as p, type ResponseFormat as q, type ToolChoice as r, isMultipartBody as s };
|
package/package.json
CHANGED
|
@@ -1,16 +1,66 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supersolutions/super-chat-core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Provider-agnostic agent core: content model, skills, context assembly, tools, runtime, and hand-rolled provider adapters.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"author": "SUPER SOLUTION LABS INC",
|
|
7
|
+
"homepage": "https://github.com/Super-Solution/super-chat/tree/main/packages/core#readme",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/Super-Solution/super-chat/issues"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"agent",
|
|
13
|
+
"llm",
|
|
14
|
+
"ai",
|
|
15
|
+
"openai",
|
|
16
|
+
"anthropic",
|
|
17
|
+
"tool-calling",
|
|
18
|
+
"streaming",
|
|
19
|
+
"context-window",
|
|
20
|
+
"skills",
|
|
21
|
+
"framework"
|
|
22
|
+
],
|
|
23
|
+
"type": "module",
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"module": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./openai": {
|
|
35
|
+
"types": "./dist/openai.d.ts",
|
|
36
|
+
"import": "./dist/openai.js",
|
|
37
|
+
"default": "./dist/openai.js"
|
|
38
|
+
},
|
|
39
|
+
"./anthropic": {
|
|
40
|
+
"types": "./dist/anthropic.d.ts",
|
|
41
|
+
"import": "./dist/anthropic.js",
|
|
42
|
+
"default": "./dist/anthropic.js"
|
|
43
|
+
}
|
|
9
44
|
},
|
|
10
45
|
"files": [
|
|
11
|
-
"
|
|
46
|
+
"dist",
|
|
47
|
+
"LICENSE",
|
|
48
|
+
"NOTICE"
|
|
12
49
|
],
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "https://github.com/Super-Solution/super-chat.git",
|
|
53
|
+
"directory": "packages/core"
|
|
54
|
+
},
|
|
13
55
|
"publishConfig": {
|
|
14
56
|
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"tsup": "^8.3.5",
|
|
60
|
+
"typescript": "^5.7.2"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsup",
|
|
64
|
+
"typecheck": "tsc --noEmit"
|
|
15
65
|
}
|
|
16
66
|
}
|