@hasna/brains 0.0.16 → 0.0.17
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/cli/index.js +49 -23
- package/dist/db/index.d.ts.map +1 -1
- package/dist/index.js +30 -18
- package/dist/mcp/index.js +39 -42
- package/dist/server/index.js +159 -41190
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
function __accessProp(key) {
|
|
9
|
+
return this[key];
|
|
10
|
+
}
|
|
11
|
+
var __toESMCache_node;
|
|
12
|
+
var __toESMCache_esm;
|
|
8
13
|
var __toESM = (mod, isNodeMode, target) => {
|
|
14
|
+
var canCache = mod != null && typeof mod === "object";
|
|
15
|
+
if (canCache) {
|
|
16
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
17
|
+
var cached = cache.get(mod);
|
|
18
|
+
if (cached)
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
9
21
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
22
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
23
|
for (let key of __getOwnPropNames(mod))
|
|
12
24
|
if (!__hasOwnProp.call(to, key))
|
|
13
25
|
__defProp(to, key, {
|
|
14
|
-
get: (
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
15
27
|
enumerable: true
|
|
16
28
|
});
|
|
29
|
+
if (canCache)
|
|
30
|
+
cache.set(mod, to);
|
|
17
31
|
return to;
|
|
18
32
|
};
|
|
19
33
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
|
+
var __returnValue = (v) => v;
|
|
35
|
+
function __exportSetter(name, newValue) {
|
|
36
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
37
|
+
}
|
|
20
38
|
var __export = (target, all) => {
|
|
21
39
|
for (var name in all)
|
|
22
40
|
__defProp(target, name, {
|
|
23
41
|
get: all[name],
|
|
24
42
|
enumerable: true,
|
|
25
43
|
configurable: true,
|
|
26
|
-
set: (
|
|
44
|
+
set: __exportSetter.bind(all, name)
|
|
27
45
|
});
|
|
28
46
|
};
|
|
29
47
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -2158,11 +2176,11 @@ import { join as join5 } from "path";
|
|
|
2158
2176
|
import { join as join6, dirname } from "path";
|
|
2159
2177
|
import { existsSync as existsSync6, writeFileSync as writeFileSync2, unlinkSync, mkdirSync as mkdirSync3 } from "fs";
|
|
2160
2178
|
import { homedir as homedir5, platform } from "os";
|
|
2161
|
-
function
|
|
2179
|
+
function __accessProp2(key) {
|
|
2162
2180
|
return this[key];
|
|
2163
2181
|
}
|
|
2164
|
-
function
|
|
2165
|
-
this[name] =
|
|
2182
|
+
function __exportSetter2(name, newValue) {
|
|
2183
|
+
this[name] = __returnValue2.bind(null, newValue);
|
|
2166
2184
|
}
|
|
2167
2185
|
function translateSql(sql2, dialect) {
|
|
2168
2186
|
if (dialect === "sqlite")
|
|
@@ -4798,10 +4816,10 @@ function registerCloudCommands(program2, serviceName) {
|
|
|
4798
4816
|
}
|
|
4799
4817
|
});
|
|
4800
4818
|
}
|
|
4801
|
-
var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2,
|
|
4819
|
+
var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2, __toESMCache_node2, __toESMCache_esm2, __toESM2 = (mod, isNodeMode, target) => {
|
|
4802
4820
|
var canCache = mod != null && typeof mod === "object";
|
|
4803
4821
|
if (canCache) {
|
|
4804
|
-
var cache = isNodeMode ?
|
|
4822
|
+
var cache = isNodeMode ? __toESMCache_node2 ??= new WeakMap : __toESMCache_esm2 ??= new WeakMap;
|
|
4805
4823
|
var cached = cache.get(mod);
|
|
4806
4824
|
if (cached)
|
|
4807
4825
|
return cached;
|
|
@@ -4811,19 +4829,19 @@ var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2, __t
|
|
|
4811
4829
|
for (let key of __getOwnPropNames2(mod))
|
|
4812
4830
|
if (!__hasOwnProp2.call(to, key))
|
|
4813
4831
|
__defProp2(to, key, {
|
|
4814
|
-
get:
|
|
4832
|
+
get: __accessProp2.bind(mod, key),
|
|
4815
4833
|
enumerable: true
|
|
4816
4834
|
});
|
|
4817
4835
|
if (canCache)
|
|
4818
4836
|
cache.set(mod, to);
|
|
4819
4837
|
return to;
|
|
4820
|
-
}, __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports),
|
|
4838
|
+
}, __commonJS2 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports), __returnValue2 = (v) => v, __export2 = (target, all) => {
|
|
4821
4839
|
for (var name in all)
|
|
4822
4840
|
__defProp2(target, name, {
|
|
4823
4841
|
get: all[name],
|
|
4824
4842
|
enumerable: true,
|
|
4825
4843
|
configurable: true,
|
|
4826
|
-
set:
|
|
4844
|
+
set: __exportSetter2.bind(all, name)
|
|
4827
4845
|
});
|
|
4828
4846
|
}, __esm2 = (fn, res) => () => (fn && (res = fn(fn = 0)), res), __require2, require_postgres_array, require_arrayParser, require_postgres_date, require_mutable, require_postgres_interval, require_postgres_bytea, require_textParsers, require_pg_int8, require_binaryParsers, require_builtins, require_pg_types, require_defaults, require_utils, require_utils_legacy, require_utils_webcrypto, require_utils2, require_cert_signatures, require_sasl, require_type_overrides, require_pg_connection_string, require_connection_parameters, require_result, require_query, require_messages, require_buffer_writer, require_serializer, require_buffer_reader, require_parser, require_dist, require_empty, require_stream, require_connection, require_split2, require_helper, require_lib, require_client, require_pg_pool, require_query2, require_client2, require_lib2, import_lib, Client, Pool, Connection, types, Query, DatabaseError, escapeIdentifier, escapeLiteral, Result, TypeOverrides, defaults, esm_default, init_esm, init_adapter, util, objectUtil, ZodParsedType, getParsedType = (data) => {
|
|
4829
4847
|
const t = typeof data;
|
|
@@ -17329,8 +17347,15 @@ var trainingDatasets = sqliteTable("training_datasets", {
|
|
|
17329
17347
|
});
|
|
17330
17348
|
|
|
17331
17349
|
// src/db/index.ts
|
|
17332
|
-
|
|
17350
|
+
var _migrated = false;
|
|
17351
|
+
function ensureMigrated() {
|
|
17352
|
+
if (_migrated)
|
|
17353
|
+
return;
|
|
17354
|
+
migrateDotfile("brains");
|
|
17355
|
+
_migrated = true;
|
|
17356
|
+
}
|
|
17333
17357
|
function getDb(dbPath) {
|
|
17358
|
+
ensureMigrated();
|
|
17334
17359
|
const adapter = dbPath ? new SqliteAdapter(dbPath) : createDatabase({ service: "brains" });
|
|
17335
17360
|
const sqlite = adapter.raw;
|
|
17336
17361
|
const db = drizzle(sqlite, { schema: exports_schema });
|
|
@@ -17379,6 +17404,7 @@ function getDb(dbPath) {
|
|
|
17379
17404
|
return db;
|
|
17380
17405
|
}
|
|
17381
17406
|
function getRawDb(dbPath) {
|
|
17407
|
+
ensureMigrated();
|
|
17382
17408
|
return dbPath ? new SqliteAdapter(dbPath) : createDatabase({ service: "brains" });
|
|
17383
17409
|
}
|
|
17384
17410
|
|
|
@@ -20897,11 +20923,11 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
20897
20923
|
}
|
|
20898
20924
|
return this._addChatCompletion(__classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
|
|
20899
20925
|
}
|
|
20900
|
-
[(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function
|
|
20926
|
+
[(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function _ChatCompletionStream_beginRequest2() {
|
|
20901
20927
|
if (this.ended)
|
|
20902
20928
|
return;
|
|
20903
20929
|
__classPrivateFieldSet5(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
|
|
20904
|
-
}, _ChatCompletionStream_getChoiceEventState = function
|
|
20930
|
+
}, _ChatCompletionStream_getChoiceEventState = function _ChatCompletionStream_getChoiceEventState2(choice) {
|
|
20905
20931
|
let state = __classPrivateFieldGet6(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index];
|
|
20906
20932
|
if (state) {
|
|
20907
20933
|
return state;
|
|
@@ -20916,7 +20942,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
20916
20942
|
};
|
|
20917
20943
|
__classPrivateFieldGet6(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state;
|
|
20918
20944
|
return state;
|
|
20919
|
-
}, _ChatCompletionStream_addChunk = function
|
|
20945
|
+
}, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk2(chunk) {
|
|
20920
20946
|
if (this.ended)
|
|
20921
20947
|
return;
|
|
20922
20948
|
const completion = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk);
|
|
@@ -20983,7 +21009,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
20983
21009
|
}
|
|
20984
21010
|
}
|
|
20985
21011
|
}
|
|
20986
|
-
}, _ChatCompletionStream_emitToolCallDoneEvent = function
|
|
21012
|
+
}, _ChatCompletionStream_emitToolCallDoneEvent = function _ChatCompletionStream_emitToolCallDoneEvent2(choiceSnapshot, toolCallIndex) {
|
|
20987
21013
|
const state = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
|
|
20988
21014
|
if (state.done_tool_calls.has(toolCallIndex)) {
|
|
20989
21015
|
return;
|
|
@@ -21006,7 +21032,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
21006
21032
|
} else {
|
|
21007
21033
|
assertNever2(toolCallSnapshot.type);
|
|
21008
21034
|
}
|
|
21009
|
-
}, _ChatCompletionStream_emitContentDoneEvents = function
|
|
21035
|
+
}, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents2(choiceSnapshot) {
|
|
21010
21036
|
const state = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
|
|
21011
21037
|
if (choiceSnapshot.message.content && !state.content_done) {
|
|
21012
21038
|
state.content_done = true;
|
|
@@ -21028,7 +21054,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
21028
21054
|
state.logprobs_refusal_done = true;
|
|
21029
21055
|
this._emit("logprobs.refusal.done", { refusal: choiceSnapshot.logprobs.refusal });
|
|
21030
21056
|
}
|
|
21031
|
-
}, _ChatCompletionStream_endRequest = function
|
|
21057
|
+
}, _ChatCompletionStream_endRequest = function _ChatCompletionStream_endRequest2() {
|
|
21032
21058
|
if (this.ended) {
|
|
21033
21059
|
throw new OpenAIError(`stream has ended, this shouldn't happen`);
|
|
21034
21060
|
}
|
|
@@ -21039,13 +21065,13 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
21039
21065
|
__classPrivateFieldSet5(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
|
|
21040
21066
|
__classPrivateFieldSet5(this, _ChatCompletionStream_choiceEventStates, [], "f");
|
|
21041
21067
|
return finalizeChatCompletion(snapshot, __classPrivateFieldGet6(this, _ChatCompletionStream_params, "f"));
|
|
21042
|
-
}, _ChatCompletionStream_getAutoParseableResponseFormat = function
|
|
21068
|
+
}, _ChatCompletionStream_getAutoParseableResponseFormat = function _ChatCompletionStream_getAutoParseableResponseFormat2() {
|
|
21043
21069
|
const responseFormat = __classPrivateFieldGet6(this, _ChatCompletionStream_params, "f")?.response_format;
|
|
21044
21070
|
if (isAutoParsableResponseFormat(responseFormat)) {
|
|
21045
21071
|
return responseFormat;
|
|
21046
21072
|
}
|
|
21047
21073
|
return null;
|
|
21048
|
-
}, _ChatCompletionStream_accumulateChatCompletion = function
|
|
21074
|
+
}, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion2(chunk) {
|
|
21049
21075
|
var _a, _b, _c, _d;
|
|
21050
21076
|
let snapshot = __classPrivateFieldGet6(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
|
|
21051
21077
|
const { choices, ...rest } = chunk;
|
|
@@ -22271,11 +22297,11 @@ class ResponseStream extends EventStream {
|
|
|
22271
22297
|
}
|
|
22272
22298
|
return __classPrivateFieldGet7(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this);
|
|
22273
22299
|
}
|
|
22274
|
-
[(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function
|
|
22300
|
+
[(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function _ResponseStream_beginRequest2() {
|
|
22275
22301
|
if (this.ended)
|
|
22276
22302
|
return;
|
|
22277
22303
|
__classPrivateFieldSet6(this, _ResponseStream_currentResponseSnapshot, undefined, "f");
|
|
22278
|
-
}, _ResponseStream_addEvent = function
|
|
22304
|
+
}, _ResponseStream_addEvent = function _ResponseStream_addEvent2(event, starting_after) {
|
|
22279
22305
|
if (this.ended)
|
|
22280
22306
|
return;
|
|
22281
22307
|
const maybeEmit = (name, event2) => {
|
|
@@ -22323,7 +22349,7 @@ class ResponseStream extends EventStream {
|
|
|
22323
22349
|
maybeEmit(event.type, event);
|
|
22324
22350
|
break;
|
|
22325
22351
|
}
|
|
22326
|
-
}, _ResponseStream_endRequest = function
|
|
22352
|
+
}, _ResponseStream_endRequest = function _ResponseStream_endRequest2() {
|
|
22327
22353
|
if (this.ended) {
|
|
22328
22354
|
throw new OpenAIError(`stream has ended, this shouldn't happen`);
|
|
22329
22355
|
}
|
|
@@ -22335,7 +22361,7 @@ class ResponseStream extends EventStream {
|
|
|
22335
22361
|
const parsedResponse = finalizeResponse(snapshot, __classPrivateFieldGet7(this, _ResponseStream_params, "f"));
|
|
22336
22362
|
__classPrivateFieldSet6(this, _ResponseStream_finalResponse, parsedResponse, "f");
|
|
22337
22363
|
return parsedResponse;
|
|
22338
|
-
}, _ResponseStream_accumulateResponse = function
|
|
22364
|
+
}, _ResponseStream_accumulateResponse = function _ResponseStream_accumulateResponse2(event) {
|
|
22339
22365
|
let snapshot = __classPrivateFieldGet7(this, _ResponseStream_currentResponseSnapshot, "f");
|
|
22340
22366
|
if (!snapshot) {
|
|
22341
22367
|
if (event.type !== "response.created") {
|
package/dist/db/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkC,aAAa,EAAuB,MAAM,cAAc,CAAC;AAElG,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,cAAc,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkC,aAAa,EAAuB,MAAM,cAAc,CAAC;AAElG,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,cAAc,aAAa,CAAC;AAS5B,wBAAgB,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM;;EAsDpC;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAGvD"}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __returnValue = (v) => v;
|
|
4
|
+
function __exportSetter(name, newValue) {
|
|
5
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
6
|
+
}
|
|
3
7
|
var __export = (target, all) => {
|
|
4
8
|
for (var name in all)
|
|
5
9
|
__defProp(target, name, {
|
|
6
10
|
get: all[name],
|
|
7
11
|
enumerable: true,
|
|
8
12
|
configurable: true,
|
|
9
|
-
set: (
|
|
13
|
+
set: __exportSetter.bind(all, name)
|
|
10
14
|
});
|
|
11
15
|
};
|
|
12
16
|
// node_modules/drizzle-orm/bun-sqlite/driver.js
|
|
@@ -3736,9 +3740,9 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
3736
3740
|
return to;
|
|
3737
3741
|
};
|
|
3738
3742
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
3739
|
-
var
|
|
3740
|
-
function
|
|
3741
|
-
this[name] =
|
|
3743
|
+
var __returnValue2 = (v) => v;
|
|
3744
|
+
function __exportSetter2(name, newValue) {
|
|
3745
|
+
this[name] = __returnValue2.bind(null, newValue);
|
|
3742
3746
|
}
|
|
3743
3747
|
var __export2 = (target, all) => {
|
|
3744
3748
|
for (var name in all)
|
|
@@ -3746,7 +3750,7 @@ var __export2 = (target, all) => {
|
|
|
3746
3750
|
get: all[name],
|
|
3747
3751
|
enumerable: true,
|
|
3748
3752
|
configurable: true,
|
|
3749
|
-
set:
|
|
3753
|
+
set: __exportSetter2.bind(all, name)
|
|
3750
3754
|
});
|
|
3751
3755
|
};
|
|
3752
3756
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -13353,8 +13357,15 @@ var trainingDatasets = sqliteTable("training_datasets", {
|
|
|
13353
13357
|
});
|
|
13354
13358
|
|
|
13355
13359
|
// src/db/index.ts
|
|
13356
|
-
|
|
13360
|
+
var _migrated = false;
|
|
13361
|
+
function ensureMigrated() {
|
|
13362
|
+
if (_migrated)
|
|
13363
|
+
return;
|
|
13364
|
+
migrateDotfile("brains");
|
|
13365
|
+
_migrated = true;
|
|
13366
|
+
}
|
|
13357
13367
|
function getDb(dbPath) {
|
|
13368
|
+
ensureMigrated();
|
|
13358
13369
|
const adapter = dbPath ? new SqliteAdapter(dbPath) : createDatabase({ service: "brains" });
|
|
13359
13370
|
const sqlite = adapter.raw;
|
|
13360
13371
|
const db = drizzle(sqlite, { schema: exports_schema });
|
|
@@ -13403,6 +13414,7 @@ function getDb(dbPath) {
|
|
|
13403
13414
|
return db;
|
|
13404
13415
|
}
|
|
13405
13416
|
function getRawDb(dbPath) {
|
|
13417
|
+
ensureMigrated();
|
|
13406
13418
|
return dbPath ? new SqliteAdapter(dbPath) : createDatabase({ service: "brains" });
|
|
13407
13419
|
}
|
|
13408
13420
|
// src/db/pg-migrations.ts
|
|
@@ -16950,11 +16962,11 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
16950
16962
|
}
|
|
16951
16963
|
return this._addChatCompletion(__classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
|
|
16952
16964
|
}
|
|
16953
|
-
[(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function
|
|
16965
|
+
[(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function _ChatCompletionStream_beginRequest2() {
|
|
16954
16966
|
if (this.ended)
|
|
16955
16967
|
return;
|
|
16956
16968
|
__classPrivateFieldSet5(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
|
|
16957
|
-
}, _ChatCompletionStream_getChoiceEventState = function
|
|
16969
|
+
}, _ChatCompletionStream_getChoiceEventState = function _ChatCompletionStream_getChoiceEventState2(choice) {
|
|
16958
16970
|
let state = __classPrivateFieldGet6(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index];
|
|
16959
16971
|
if (state) {
|
|
16960
16972
|
return state;
|
|
@@ -16969,7 +16981,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
16969
16981
|
};
|
|
16970
16982
|
__classPrivateFieldGet6(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state;
|
|
16971
16983
|
return state;
|
|
16972
|
-
}, _ChatCompletionStream_addChunk = function
|
|
16984
|
+
}, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk2(chunk) {
|
|
16973
16985
|
if (this.ended)
|
|
16974
16986
|
return;
|
|
16975
16987
|
const completion = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk);
|
|
@@ -17036,7 +17048,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17036
17048
|
}
|
|
17037
17049
|
}
|
|
17038
17050
|
}
|
|
17039
|
-
}, _ChatCompletionStream_emitToolCallDoneEvent = function
|
|
17051
|
+
}, _ChatCompletionStream_emitToolCallDoneEvent = function _ChatCompletionStream_emitToolCallDoneEvent2(choiceSnapshot, toolCallIndex) {
|
|
17040
17052
|
const state = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
|
|
17041
17053
|
if (state.done_tool_calls.has(toolCallIndex)) {
|
|
17042
17054
|
return;
|
|
@@ -17059,7 +17071,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17059
17071
|
} else {
|
|
17060
17072
|
assertNever2(toolCallSnapshot.type);
|
|
17061
17073
|
}
|
|
17062
|
-
}, _ChatCompletionStream_emitContentDoneEvents = function
|
|
17074
|
+
}, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents2(choiceSnapshot) {
|
|
17063
17075
|
const state = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
|
|
17064
17076
|
if (choiceSnapshot.message.content && !state.content_done) {
|
|
17065
17077
|
state.content_done = true;
|
|
@@ -17081,7 +17093,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17081
17093
|
state.logprobs_refusal_done = true;
|
|
17082
17094
|
this._emit("logprobs.refusal.done", { refusal: choiceSnapshot.logprobs.refusal });
|
|
17083
17095
|
}
|
|
17084
|
-
}, _ChatCompletionStream_endRequest = function
|
|
17096
|
+
}, _ChatCompletionStream_endRequest = function _ChatCompletionStream_endRequest2() {
|
|
17085
17097
|
if (this.ended) {
|
|
17086
17098
|
throw new OpenAIError(`stream has ended, this shouldn't happen`);
|
|
17087
17099
|
}
|
|
@@ -17092,13 +17104,13 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17092
17104
|
__classPrivateFieldSet5(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
|
|
17093
17105
|
__classPrivateFieldSet5(this, _ChatCompletionStream_choiceEventStates, [], "f");
|
|
17094
17106
|
return finalizeChatCompletion(snapshot, __classPrivateFieldGet6(this, _ChatCompletionStream_params, "f"));
|
|
17095
|
-
}, _ChatCompletionStream_getAutoParseableResponseFormat = function
|
|
17107
|
+
}, _ChatCompletionStream_getAutoParseableResponseFormat = function _ChatCompletionStream_getAutoParseableResponseFormat2() {
|
|
17096
17108
|
const responseFormat = __classPrivateFieldGet6(this, _ChatCompletionStream_params, "f")?.response_format;
|
|
17097
17109
|
if (isAutoParsableResponseFormat(responseFormat)) {
|
|
17098
17110
|
return responseFormat;
|
|
17099
17111
|
}
|
|
17100
17112
|
return null;
|
|
17101
|
-
}, _ChatCompletionStream_accumulateChatCompletion = function
|
|
17113
|
+
}, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion2(chunk) {
|
|
17102
17114
|
var _a, _b, _c, _d;
|
|
17103
17115
|
let snapshot = __classPrivateFieldGet6(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
|
|
17104
17116
|
const { choices, ...rest } = chunk;
|
|
@@ -18324,11 +18336,11 @@ class ResponseStream extends EventStream {
|
|
|
18324
18336
|
}
|
|
18325
18337
|
return __classPrivateFieldGet7(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this);
|
|
18326
18338
|
}
|
|
18327
|
-
[(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function
|
|
18339
|
+
[(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function _ResponseStream_beginRequest2() {
|
|
18328
18340
|
if (this.ended)
|
|
18329
18341
|
return;
|
|
18330
18342
|
__classPrivateFieldSet6(this, _ResponseStream_currentResponseSnapshot, undefined, "f");
|
|
18331
|
-
}, _ResponseStream_addEvent = function
|
|
18343
|
+
}, _ResponseStream_addEvent = function _ResponseStream_addEvent2(event, starting_after) {
|
|
18332
18344
|
if (this.ended)
|
|
18333
18345
|
return;
|
|
18334
18346
|
const maybeEmit = (name, event2) => {
|
|
@@ -18376,7 +18388,7 @@ class ResponseStream extends EventStream {
|
|
|
18376
18388
|
maybeEmit(event.type, event);
|
|
18377
18389
|
break;
|
|
18378
18390
|
}
|
|
18379
|
-
}, _ResponseStream_endRequest = function
|
|
18391
|
+
}, _ResponseStream_endRequest = function _ResponseStream_endRequest2() {
|
|
18380
18392
|
if (this.ended) {
|
|
18381
18393
|
throw new OpenAIError(`stream has ended, this shouldn't happen`);
|
|
18382
18394
|
}
|
|
@@ -18388,7 +18400,7 @@ class ResponseStream extends EventStream {
|
|
|
18388
18400
|
const parsedResponse = finalizeResponse(snapshot, __classPrivateFieldGet7(this, _ResponseStream_params, "f"));
|
|
18389
18401
|
__classPrivateFieldSet6(this, _ResponseStream_finalResponse, parsedResponse, "f");
|
|
18390
18402
|
return parsedResponse;
|
|
18391
|
-
}, _ResponseStream_accumulateResponse = function
|
|
18403
|
+
}, _ResponseStream_accumulateResponse = function _ResponseStream_accumulateResponse2(event) {
|
|
18392
18404
|
let snapshot = __classPrivateFieldGet7(this, _ResponseStream_currentResponseSnapshot, "f");
|
|
18393
18405
|
if (!snapshot) {
|
|
18394
18406
|
if (event.type !== "response.created") {
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
5
3
|
var __defProp = Object.defineProperty;
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
|
-
for (let key of __getOwnPropNames(mod))
|
|
12
|
-
if (!__hasOwnProp.call(to, key))
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: () => mod[key],
|
|
15
|
-
enumerable: true
|
|
16
|
-
});
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
4
|
+
var __returnValue = (v) => v;
|
|
5
|
+
function __exportSetter(name, newValue) {
|
|
6
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
7
|
+
}
|
|
19
8
|
var __export = (target, all) => {
|
|
20
9
|
for (var name in all)
|
|
21
10
|
__defProp(target, name, {
|
|
22
11
|
get: all[name],
|
|
23
12
|
enumerable: true,
|
|
24
13
|
configurable: true,
|
|
25
|
-
set: (
|
|
14
|
+
set: __exportSetter.bind(all, name)
|
|
26
15
|
});
|
|
27
16
|
};
|
|
28
17
|
var __require = import.meta.require;
|
|
@@ -3735,17 +3724,17 @@ import { homedir as homedir4 } from "os";
|
|
|
3735
3724
|
import { join as join4 } from "path";
|
|
3736
3725
|
import { join as join6, dirname } from "path";
|
|
3737
3726
|
import { homedir as homedir5, platform } from "os";
|
|
3738
|
-
var
|
|
3739
|
-
var
|
|
3727
|
+
var __create = Object.create;
|
|
3728
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
3740
3729
|
var __defProp2 = Object.defineProperty;
|
|
3741
|
-
var
|
|
3742
|
-
var
|
|
3730
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3731
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3743
3732
|
function __accessProp(key) {
|
|
3744
3733
|
return this[key];
|
|
3745
3734
|
}
|
|
3746
3735
|
var __toESMCache_node;
|
|
3747
3736
|
var __toESMCache_esm;
|
|
3748
|
-
var
|
|
3737
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
3749
3738
|
var canCache = mod != null && typeof mod === "object";
|
|
3750
3739
|
if (canCache) {
|
|
3751
3740
|
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
@@ -3753,10 +3742,10 @@ var __toESM2 = (mod, isNodeMode, target) => {
|
|
|
3753
3742
|
if (cached)
|
|
3754
3743
|
return cached;
|
|
3755
3744
|
}
|
|
3756
|
-
target = mod != null ?
|
|
3745
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
3757
3746
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target;
|
|
3758
|
-
for (let key of
|
|
3759
|
-
if (!
|
|
3747
|
+
for (let key of __getOwnPropNames(mod))
|
|
3748
|
+
if (!__hasOwnProp.call(to, key))
|
|
3760
3749
|
__defProp2(to, key, {
|
|
3761
3750
|
get: __accessProp.bind(mod, key),
|
|
3762
3751
|
enumerable: true
|
|
@@ -3766,9 +3755,9 @@ var __toESM2 = (mod, isNodeMode, target) => {
|
|
|
3766
3755
|
return to;
|
|
3767
3756
|
};
|
|
3768
3757
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
3769
|
-
var
|
|
3770
|
-
function
|
|
3771
|
-
this[name] =
|
|
3758
|
+
var __returnValue2 = (v) => v;
|
|
3759
|
+
function __exportSetter2(name, newValue) {
|
|
3760
|
+
this[name] = __returnValue2.bind(null, newValue);
|
|
3772
3761
|
}
|
|
3773
3762
|
var __export2 = (target, all) => {
|
|
3774
3763
|
for (var name in all)
|
|
@@ -3776,7 +3765,7 @@ var __export2 = (target, all) => {
|
|
|
3776
3765
|
get: all[name],
|
|
3777
3766
|
enumerable: true,
|
|
3778
3767
|
configurable: true,
|
|
3779
|
-
set:
|
|
3768
|
+
set: __exportSetter2.bind(all, name)
|
|
3780
3769
|
});
|
|
3781
3770
|
};
|
|
3782
3771
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -8587,7 +8576,7 @@ var TypeOverrides;
|
|
|
8587
8576
|
var defaults;
|
|
8588
8577
|
var esm_default;
|
|
8589
8578
|
var init_esm = __esm(() => {
|
|
8590
|
-
import_lib =
|
|
8579
|
+
import_lib = __toESM(require_lib2(), 1);
|
|
8591
8580
|
Client = import_lib.default.Client;
|
|
8592
8581
|
Pool = import_lib.default.Pool;
|
|
8593
8582
|
Connection = import_lib.default.Connection;
|
|
@@ -13961,8 +13950,15 @@ var trainingDatasets = sqliteTable("training_datasets", {
|
|
|
13961
13950
|
});
|
|
13962
13951
|
|
|
13963
13952
|
// src/db/index.ts
|
|
13964
|
-
|
|
13953
|
+
var _migrated = false;
|
|
13954
|
+
function ensureMigrated() {
|
|
13955
|
+
if (_migrated)
|
|
13956
|
+
return;
|
|
13957
|
+
migrateDotfile("brains");
|
|
13958
|
+
_migrated = true;
|
|
13959
|
+
}
|
|
13965
13960
|
function getDb(dbPath) {
|
|
13961
|
+
ensureMigrated();
|
|
13966
13962
|
const adapter = dbPath ? new SqliteAdapter(dbPath) : createDatabase({ service: "brains" });
|
|
13967
13963
|
const sqlite = adapter.raw;
|
|
13968
13964
|
const db = drizzle(sqlite, { schema: exports_schema });
|
|
@@ -14011,6 +14007,7 @@ function getDb(dbPath) {
|
|
|
14011
14007
|
return db;
|
|
14012
14008
|
}
|
|
14013
14009
|
function getRawDb(dbPath) {
|
|
14010
|
+
ensureMigrated();
|
|
14014
14011
|
return dbPath ? new SqliteAdapter(dbPath) : createDatabase({ service: "brains" });
|
|
14015
14012
|
}
|
|
14016
14013
|
|
|
@@ -17478,11 +17475,11 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17478
17475
|
}
|
|
17479
17476
|
return this._addChatCompletion(__classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
|
|
17480
17477
|
}
|
|
17481
|
-
[(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function
|
|
17478
|
+
[(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function _ChatCompletionStream_beginRequest2() {
|
|
17482
17479
|
if (this.ended)
|
|
17483
17480
|
return;
|
|
17484
17481
|
__classPrivateFieldSet5(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
|
|
17485
|
-
}, _ChatCompletionStream_getChoiceEventState = function
|
|
17482
|
+
}, _ChatCompletionStream_getChoiceEventState = function _ChatCompletionStream_getChoiceEventState2(choice) {
|
|
17486
17483
|
let state = __classPrivateFieldGet6(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index];
|
|
17487
17484
|
if (state) {
|
|
17488
17485
|
return state;
|
|
@@ -17497,7 +17494,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17497
17494
|
};
|
|
17498
17495
|
__classPrivateFieldGet6(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state;
|
|
17499
17496
|
return state;
|
|
17500
|
-
}, _ChatCompletionStream_addChunk = function
|
|
17497
|
+
}, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk2(chunk) {
|
|
17501
17498
|
if (this.ended)
|
|
17502
17499
|
return;
|
|
17503
17500
|
const completion = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk);
|
|
@@ -17564,7 +17561,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17564
17561
|
}
|
|
17565
17562
|
}
|
|
17566
17563
|
}
|
|
17567
|
-
}, _ChatCompletionStream_emitToolCallDoneEvent = function
|
|
17564
|
+
}, _ChatCompletionStream_emitToolCallDoneEvent = function _ChatCompletionStream_emitToolCallDoneEvent2(choiceSnapshot, toolCallIndex) {
|
|
17568
17565
|
const state = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
|
|
17569
17566
|
if (state.done_tool_calls.has(toolCallIndex)) {
|
|
17570
17567
|
return;
|
|
@@ -17587,7 +17584,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17587
17584
|
} else {
|
|
17588
17585
|
assertNever2(toolCallSnapshot.type);
|
|
17589
17586
|
}
|
|
17590
|
-
}, _ChatCompletionStream_emitContentDoneEvents = function
|
|
17587
|
+
}, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents2(choiceSnapshot) {
|
|
17591
17588
|
const state = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
|
|
17592
17589
|
if (choiceSnapshot.message.content && !state.content_done) {
|
|
17593
17590
|
state.content_done = true;
|
|
@@ -17609,7 +17606,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17609
17606
|
state.logprobs_refusal_done = true;
|
|
17610
17607
|
this._emit("logprobs.refusal.done", { refusal: choiceSnapshot.logprobs.refusal });
|
|
17611
17608
|
}
|
|
17612
|
-
}, _ChatCompletionStream_endRequest = function
|
|
17609
|
+
}, _ChatCompletionStream_endRequest = function _ChatCompletionStream_endRequest2() {
|
|
17613
17610
|
if (this.ended) {
|
|
17614
17611
|
throw new OpenAIError(`stream has ended, this shouldn't happen`);
|
|
17615
17612
|
}
|
|
@@ -17620,13 +17617,13 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17620
17617
|
__classPrivateFieldSet5(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
|
|
17621
17618
|
__classPrivateFieldSet5(this, _ChatCompletionStream_choiceEventStates, [], "f");
|
|
17622
17619
|
return finalizeChatCompletion(snapshot, __classPrivateFieldGet6(this, _ChatCompletionStream_params, "f"));
|
|
17623
|
-
}, _ChatCompletionStream_getAutoParseableResponseFormat = function
|
|
17620
|
+
}, _ChatCompletionStream_getAutoParseableResponseFormat = function _ChatCompletionStream_getAutoParseableResponseFormat2() {
|
|
17624
17621
|
const responseFormat = __classPrivateFieldGet6(this, _ChatCompletionStream_params, "f")?.response_format;
|
|
17625
17622
|
if (isAutoParsableResponseFormat(responseFormat)) {
|
|
17626
17623
|
return responseFormat;
|
|
17627
17624
|
}
|
|
17628
17625
|
return null;
|
|
17629
|
-
}, _ChatCompletionStream_accumulateChatCompletion = function
|
|
17626
|
+
}, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion2(chunk) {
|
|
17630
17627
|
var _a, _b, _c, _d;
|
|
17631
17628
|
let snapshot = __classPrivateFieldGet6(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
|
|
17632
17629
|
const { choices, ...rest } = chunk;
|
|
@@ -18852,11 +18849,11 @@ class ResponseStream extends EventStream {
|
|
|
18852
18849
|
}
|
|
18853
18850
|
return __classPrivateFieldGet7(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this);
|
|
18854
18851
|
}
|
|
18855
|
-
[(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function
|
|
18852
|
+
[(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function _ResponseStream_beginRequest2() {
|
|
18856
18853
|
if (this.ended)
|
|
18857
18854
|
return;
|
|
18858
18855
|
__classPrivateFieldSet6(this, _ResponseStream_currentResponseSnapshot, undefined, "f");
|
|
18859
|
-
}, _ResponseStream_addEvent = function
|
|
18856
|
+
}, _ResponseStream_addEvent = function _ResponseStream_addEvent2(event, starting_after) {
|
|
18860
18857
|
if (this.ended)
|
|
18861
18858
|
return;
|
|
18862
18859
|
const maybeEmit = (name, event2) => {
|
|
@@ -18904,7 +18901,7 @@ class ResponseStream extends EventStream {
|
|
|
18904
18901
|
maybeEmit(event.type, event);
|
|
18905
18902
|
break;
|
|
18906
18903
|
}
|
|
18907
|
-
}, _ResponseStream_endRequest = function
|
|
18904
|
+
}, _ResponseStream_endRequest = function _ResponseStream_endRequest2() {
|
|
18908
18905
|
if (this.ended) {
|
|
18909
18906
|
throw new OpenAIError(`stream has ended, this shouldn't happen`);
|
|
18910
18907
|
}
|
|
@@ -18916,7 +18913,7 @@ class ResponseStream extends EventStream {
|
|
|
18916
18913
|
const parsedResponse = finalizeResponse(snapshot, __classPrivateFieldGet7(this, _ResponseStream_params, "f"));
|
|
18917
18914
|
__classPrivateFieldSet6(this, _ResponseStream_finalResponse, parsedResponse, "f");
|
|
18918
18915
|
return parsedResponse;
|
|
18919
|
-
}, _ResponseStream_accumulateResponse = function
|
|
18916
|
+
}, _ResponseStream_accumulateResponse = function _ResponseStream_accumulateResponse2(event) {
|
|
18920
18917
|
let snapshot = __classPrivateFieldGet7(this, _ResponseStream_currentResponseSnapshot, "f");
|
|
18921
18918
|
if (!snapshot) {
|
|
18922
18919
|
if (event.type !== "response.created") {
|