@hasna/brains 0.0.13 → 0.0.16
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/commands/cloud.d.ts +3 -0
- package/dist/cli/commands/cloud.d.ts.map +1 -0
- package/dist/cli/commands/collections.d.ts +3 -0
- package/dist/cli/commands/collections.d.ts.map +1 -0
- package/dist/cli/commands/data.d.ts +3 -0
- package/dist/cli/commands/data.d.ts.map +1 -0
- package/dist/cli/commands/finetune.d.ts +3 -0
- package/dist/cli/commands/finetune.d.ts.map +1 -0
- package/dist/cli/commands/models.d.ts +3 -0
- package/dist/cli/commands/models.d.ts.map +1 -0
- package/dist/cli/index.js +796 -789
- package/dist/index.js +17 -21
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +44 -31
- package/dist/server/index.js +41188 -150
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
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
|
-
}
|
|
7
3
|
var __export = (target, all) => {
|
|
8
4
|
for (var name in all)
|
|
9
5
|
__defProp(target, name, {
|
|
10
6
|
get: all[name],
|
|
11
7
|
enumerable: true,
|
|
12
8
|
configurable: true,
|
|
13
|
-
set:
|
|
9
|
+
set: (newValue) => all[name] = () => newValue
|
|
14
10
|
});
|
|
15
11
|
};
|
|
16
12
|
// node_modules/drizzle-orm/bun-sqlite/driver.js
|
|
@@ -3740,9 +3736,9 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
3740
3736
|
return to;
|
|
3741
3737
|
};
|
|
3742
3738
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
3743
|
-
var
|
|
3744
|
-
function
|
|
3745
|
-
this[name] =
|
|
3739
|
+
var __returnValue = (v) => v;
|
|
3740
|
+
function __exportSetter(name, newValue) {
|
|
3741
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
3746
3742
|
}
|
|
3747
3743
|
var __export2 = (target, all) => {
|
|
3748
3744
|
for (var name in all)
|
|
@@ -3750,7 +3746,7 @@ var __export2 = (target, all) => {
|
|
|
3750
3746
|
get: all[name],
|
|
3751
3747
|
enumerable: true,
|
|
3752
3748
|
configurable: true,
|
|
3753
|
-
set:
|
|
3749
|
+
set: __exportSetter.bind(all, name)
|
|
3754
3750
|
});
|
|
3755
3751
|
};
|
|
3756
3752
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -16954,11 +16950,11 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
16954
16950
|
}
|
|
16955
16951
|
return this._addChatCompletion(__classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
|
|
16956
16952
|
}
|
|
16957
|
-
[(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function
|
|
16953
|
+
[(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function _ChatCompletionStream_beginRequest() {
|
|
16958
16954
|
if (this.ended)
|
|
16959
16955
|
return;
|
|
16960
16956
|
__classPrivateFieldSet5(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
|
|
16961
|
-
}, _ChatCompletionStream_getChoiceEventState = function
|
|
16957
|
+
}, _ChatCompletionStream_getChoiceEventState = function _ChatCompletionStream_getChoiceEventState(choice) {
|
|
16962
16958
|
let state = __classPrivateFieldGet6(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index];
|
|
16963
16959
|
if (state) {
|
|
16964
16960
|
return state;
|
|
@@ -16973,7 +16969,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
16973
16969
|
};
|
|
16974
16970
|
__classPrivateFieldGet6(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state;
|
|
16975
16971
|
return state;
|
|
16976
|
-
}, _ChatCompletionStream_addChunk = function
|
|
16972
|
+
}, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk(chunk) {
|
|
16977
16973
|
if (this.ended)
|
|
16978
16974
|
return;
|
|
16979
16975
|
const completion = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk);
|
|
@@ -17040,7 +17036,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17040
17036
|
}
|
|
17041
17037
|
}
|
|
17042
17038
|
}
|
|
17043
|
-
}, _ChatCompletionStream_emitToolCallDoneEvent = function
|
|
17039
|
+
}, _ChatCompletionStream_emitToolCallDoneEvent = function _ChatCompletionStream_emitToolCallDoneEvent(choiceSnapshot, toolCallIndex) {
|
|
17044
17040
|
const state = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
|
|
17045
17041
|
if (state.done_tool_calls.has(toolCallIndex)) {
|
|
17046
17042
|
return;
|
|
@@ -17063,7 +17059,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17063
17059
|
} else {
|
|
17064
17060
|
assertNever2(toolCallSnapshot.type);
|
|
17065
17061
|
}
|
|
17066
|
-
}, _ChatCompletionStream_emitContentDoneEvents = function
|
|
17062
|
+
}, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents(choiceSnapshot) {
|
|
17067
17063
|
const state = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
|
|
17068
17064
|
if (choiceSnapshot.message.content && !state.content_done) {
|
|
17069
17065
|
state.content_done = true;
|
|
@@ -17085,7 +17081,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17085
17081
|
state.logprobs_refusal_done = true;
|
|
17086
17082
|
this._emit("logprobs.refusal.done", { refusal: choiceSnapshot.logprobs.refusal });
|
|
17087
17083
|
}
|
|
17088
|
-
}, _ChatCompletionStream_endRequest = function
|
|
17084
|
+
}, _ChatCompletionStream_endRequest = function _ChatCompletionStream_endRequest() {
|
|
17089
17085
|
if (this.ended) {
|
|
17090
17086
|
throw new OpenAIError(`stream has ended, this shouldn't happen`);
|
|
17091
17087
|
}
|
|
@@ -17096,13 +17092,13 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17096
17092
|
__classPrivateFieldSet5(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
|
|
17097
17093
|
__classPrivateFieldSet5(this, _ChatCompletionStream_choiceEventStates, [], "f");
|
|
17098
17094
|
return finalizeChatCompletion(snapshot, __classPrivateFieldGet6(this, _ChatCompletionStream_params, "f"));
|
|
17099
|
-
}, _ChatCompletionStream_getAutoParseableResponseFormat = function
|
|
17095
|
+
}, _ChatCompletionStream_getAutoParseableResponseFormat = function _ChatCompletionStream_getAutoParseableResponseFormat() {
|
|
17100
17096
|
const responseFormat = __classPrivateFieldGet6(this, _ChatCompletionStream_params, "f")?.response_format;
|
|
17101
17097
|
if (isAutoParsableResponseFormat(responseFormat)) {
|
|
17102
17098
|
return responseFormat;
|
|
17103
17099
|
}
|
|
17104
17100
|
return null;
|
|
17105
|
-
}, _ChatCompletionStream_accumulateChatCompletion = function
|
|
17101
|
+
}, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion(chunk) {
|
|
17106
17102
|
var _a, _b, _c, _d;
|
|
17107
17103
|
let snapshot = __classPrivateFieldGet6(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
|
|
17108
17104
|
const { choices, ...rest } = chunk;
|
|
@@ -18328,11 +18324,11 @@ class ResponseStream extends EventStream {
|
|
|
18328
18324
|
}
|
|
18329
18325
|
return __classPrivateFieldGet7(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this);
|
|
18330
18326
|
}
|
|
18331
|
-
[(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function
|
|
18327
|
+
[(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function _ResponseStream_beginRequest() {
|
|
18332
18328
|
if (this.ended)
|
|
18333
18329
|
return;
|
|
18334
18330
|
__classPrivateFieldSet6(this, _ResponseStream_currentResponseSnapshot, undefined, "f");
|
|
18335
|
-
}, _ResponseStream_addEvent = function
|
|
18331
|
+
}, _ResponseStream_addEvent = function _ResponseStream_addEvent(event, starting_after) {
|
|
18336
18332
|
if (this.ended)
|
|
18337
18333
|
return;
|
|
18338
18334
|
const maybeEmit = (name, event2) => {
|
|
@@ -18380,7 +18376,7 @@ class ResponseStream extends EventStream {
|
|
|
18380
18376
|
maybeEmit(event.type, event);
|
|
18381
18377
|
break;
|
|
18382
18378
|
}
|
|
18383
|
-
}, _ResponseStream_endRequest = function
|
|
18379
|
+
}, _ResponseStream_endRequest = function _ResponseStream_endRequest() {
|
|
18384
18380
|
if (this.ended) {
|
|
18385
18381
|
throw new OpenAIError(`stream has ended, this shouldn't happen`);
|
|
18386
18382
|
}
|
|
@@ -18392,7 +18388,7 @@ class ResponseStream extends EventStream {
|
|
|
18392
18388
|
const parsedResponse = finalizeResponse(snapshot, __classPrivateFieldGet7(this, _ResponseStream_params, "f"));
|
|
18393
18389
|
__classPrivateFieldSet6(this, _ResponseStream_finalResponse, parsedResponse, "f");
|
|
18394
18390
|
return parsedResponse;
|
|
18395
|
-
}, _ResponseStream_accumulateResponse = function
|
|
18391
|
+
}, _ResponseStream_accumulateResponse = function _ResponseStream_accumulateResponse(event) {
|
|
18396
18392
|
let snapshot = __classPrivateFieldGet7(this, _ResponseStream_currentResponseSnapshot, "f");
|
|
18397
18393
|
if (!snapshot) {
|
|
18398
18394
|
if (event.type !== "response.created") {
|
package/dist/mcp/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAqDjF,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AAEX,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6e9B;AAED,wBAAsB,cAAc,CAAC,SAAS,uBAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAqDjF,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AAEX,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6e9B;AAED,wBAAsB,cAAc,CAAC,SAAS,uBAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAW1E"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
3
5
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
9
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
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
|
+
};
|
|
8
19
|
var __export = (target, all) => {
|
|
9
20
|
for (var name in all)
|
|
10
21
|
__defProp(target, name, {
|
|
11
22
|
get: all[name],
|
|
12
23
|
enumerable: true,
|
|
13
24
|
configurable: true,
|
|
14
|
-
set:
|
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
|
15
26
|
});
|
|
16
27
|
};
|
|
17
28
|
var __require = import.meta.require;
|
|
@@ -3724,17 +3735,17 @@ import { homedir as homedir4 } from "os";
|
|
|
3724
3735
|
import { join as join4 } from "path";
|
|
3725
3736
|
import { join as join6, dirname } from "path";
|
|
3726
3737
|
import { homedir as homedir5, platform } from "os";
|
|
3727
|
-
var
|
|
3728
|
-
var
|
|
3738
|
+
var __create2 = Object.create;
|
|
3739
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
3729
3740
|
var __defProp2 = Object.defineProperty;
|
|
3730
|
-
var
|
|
3731
|
-
var
|
|
3741
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
3742
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
3732
3743
|
function __accessProp(key) {
|
|
3733
3744
|
return this[key];
|
|
3734
3745
|
}
|
|
3735
3746
|
var __toESMCache_node;
|
|
3736
3747
|
var __toESMCache_esm;
|
|
3737
|
-
var
|
|
3748
|
+
var __toESM2 = (mod, isNodeMode, target) => {
|
|
3738
3749
|
var canCache = mod != null && typeof mod === "object";
|
|
3739
3750
|
if (canCache) {
|
|
3740
3751
|
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
@@ -3742,10 +3753,10 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
3742
3753
|
if (cached)
|
|
3743
3754
|
return cached;
|
|
3744
3755
|
}
|
|
3745
|
-
target = mod != null ?
|
|
3756
|
+
target = mod != null ? __create2(__getProtoOf2(mod)) : {};
|
|
3746
3757
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target;
|
|
3747
|
-
for (let key of
|
|
3748
|
-
if (!
|
|
3758
|
+
for (let key of __getOwnPropNames2(mod))
|
|
3759
|
+
if (!__hasOwnProp2.call(to, key))
|
|
3749
3760
|
__defProp2(to, key, {
|
|
3750
3761
|
get: __accessProp.bind(mod, key),
|
|
3751
3762
|
enumerable: true
|
|
@@ -3755,9 +3766,9 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
3755
3766
|
return to;
|
|
3756
3767
|
};
|
|
3757
3768
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
3758
|
-
var
|
|
3759
|
-
function
|
|
3760
|
-
this[name] =
|
|
3769
|
+
var __returnValue = (v) => v;
|
|
3770
|
+
function __exportSetter(name, newValue) {
|
|
3771
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
3761
3772
|
}
|
|
3762
3773
|
var __export2 = (target, all) => {
|
|
3763
3774
|
for (var name in all)
|
|
@@ -3765,7 +3776,7 @@ var __export2 = (target, all) => {
|
|
|
3765
3776
|
get: all[name],
|
|
3766
3777
|
enumerable: true,
|
|
3767
3778
|
configurable: true,
|
|
3768
|
-
set:
|
|
3779
|
+
set: __exportSetter.bind(all, name)
|
|
3769
3780
|
});
|
|
3770
3781
|
};
|
|
3771
3782
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -8576,7 +8587,7 @@ var TypeOverrides;
|
|
|
8576
8587
|
var defaults;
|
|
8577
8588
|
var esm_default;
|
|
8578
8589
|
var init_esm = __esm(() => {
|
|
8579
|
-
import_lib =
|
|
8590
|
+
import_lib = __toESM2(require_lib2(), 1);
|
|
8580
8591
|
Client = import_lib.default.Client;
|
|
8581
8592
|
Pool = import_lib.default.Pool;
|
|
8582
8593
|
Connection = import_lib.default.Connection;
|
|
@@ -17467,11 +17478,11 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17467
17478
|
}
|
|
17468
17479
|
return this._addChatCompletion(__classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_endRequest).call(this));
|
|
17469
17480
|
}
|
|
17470
|
-
[(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function
|
|
17481
|
+
[(_ChatCompletionStream_params = new WeakMap, _ChatCompletionStream_choiceEventStates = new WeakMap, _ChatCompletionStream_currentChatCompletionSnapshot = new WeakMap, _ChatCompletionStream_instances = new WeakSet, _ChatCompletionStream_beginRequest = function _ChatCompletionStream_beginRequest() {
|
|
17471
17482
|
if (this.ended)
|
|
17472
17483
|
return;
|
|
17473
17484
|
__classPrivateFieldSet5(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
|
|
17474
|
-
}, _ChatCompletionStream_getChoiceEventState = function
|
|
17485
|
+
}, _ChatCompletionStream_getChoiceEventState = function _ChatCompletionStream_getChoiceEventState(choice) {
|
|
17475
17486
|
let state = __classPrivateFieldGet6(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index];
|
|
17476
17487
|
if (state) {
|
|
17477
17488
|
return state;
|
|
@@ -17486,7 +17497,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17486
17497
|
};
|
|
17487
17498
|
__classPrivateFieldGet6(this, _ChatCompletionStream_choiceEventStates, "f")[choice.index] = state;
|
|
17488
17499
|
return state;
|
|
17489
|
-
}, _ChatCompletionStream_addChunk = function
|
|
17500
|
+
}, _ChatCompletionStream_addChunk = function _ChatCompletionStream_addChunk(chunk) {
|
|
17490
17501
|
if (this.ended)
|
|
17491
17502
|
return;
|
|
17492
17503
|
const completion = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_accumulateChatCompletion).call(this, chunk);
|
|
@@ -17553,7 +17564,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17553
17564
|
}
|
|
17554
17565
|
}
|
|
17555
17566
|
}
|
|
17556
|
-
}, _ChatCompletionStream_emitToolCallDoneEvent = function
|
|
17567
|
+
}, _ChatCompletionStream_emitToolCallDoneEvent = function _ChatCompletionStream_emitToolCallDoneEvent(choiceSnapshot, toolCallIndex) {
|
|
17557
17568
|
const state = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
|
|
17558
17569
|
if (state.done_tool_calls.has(toolCallIndex)) {
|
|
17559
17570
|
return;
|
|
@@ -17576,7 +17587,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17576
17587
|
} else {
|
|
17577
17588
|
assertNever2(toolCallSnapshot.type);
|
|
17578
17589
|
}
|
|
17579
|
-
}, _ChatCompletionStream_emitContentDoneEvents = function
|
|
17590
|
+
}, _ChatCompletionStream_emitContentDoneEvents = function _ChatCompletionStream_emitContentDoneEvents(choiceSnapshot) {
|
|
17580
17591
|
const state = __classPrivateFieldGet6(this, _ChatCompletionStream_instances, "m", _ChatCompletionStream_getChoiceEventState).call(this, choiceSnapshot);
|
|
17581
17592
|
if (choiceSnapshot.message.content && !state.content_done) {
|
|
17582
17593
|
state.content_done = true;
|
|
@@ -17598,7 +17609,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17598
17609
|
state.logprobs_refusal_done = true;
|
|
17599
17610
|
this._emit("logprobs.refusal.done", { refusal: choiceSnapshot.logprobs.refusal });
|
|
17600
17611
|
}
|
|
17601
|
-
}, _ChatCompletionStream_endRequest = function
|
|
17612
|
+
}, _ChatCompletionStream_endRequest = function _ChatCompletionStream_endRequest() {
|
|
17602
17613
|
if (this.ended) {
|
|
17603
17614
|
throw new OpenAIError(`stream has ended, this shouldn't happen`);
|
|
17604
17615
|
}
|
|
@@ -17609,13 +17620,13 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
17609
17620
|
__classPrivateFieldSet5(this, _ChatCompletionStream_currentChatCompletionSnapshot, undefined, "f");
|
|
17610
17621
|
__classPrivateFieldSet5(this, _ChatCompletionStream_choiceEventStates, [], "f");
|
|
17611
17622
|
return finalizeChatCompletion(snapshot, __classPrivateFieldGet6(this, _ChatCompletionStream_params, "f"));
|
|
17612
|
-
}, _ChatCompletionStream_getAutoParseableResponseFormat = function
|
|
17623
|
+
}, _ChatCompletionStream_getAutoParseableResponseFormat = function _ChatCompletionStream_getAutoParseableResponseFormat() {
|
|
17613
17624
|
const responseFormat = __classPrivateFieldGet6(this, _ChatCompletionStream_params, "f")?.response_format;
|
|
17614
17625
|
if (isAutoParsableResponseFormat(responseFormat)) {
|
|
17615
17626
|
return responseFormat;
|
|
17616
17627
|
}
|
|
17617
17628
|
return null;
|
|
17618
|
-
}, _ChatCompletionStream_accumulateChatCompletion = function
|
|
17629
|
+
}, _ChatCompletionStream_accumulateChatCompletion = function _ChatCompletionStream_accumulateChatCompletion(chunk) {
|
|
17619
17630
|
var _a, _b, _c, _d;
|
|
17620
17631
|
let snapshot = __classPrivateFieldGet6(this, _ChatCompletionStream_currentChatCompletionSnapshot, "f");
|
|
17621
17632
|
const { choices, ...rest } = chunk;
|
|
@@ -18841,11 +18852,11 @@ class ResponseStream extends EventStream {
|
|
|
18841
18852
|
}
|
|
18842
18853
|
return __classPrivateFieldGet7(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this);
|
|
18843
18854
|
}
|
|
18844
|
-
[(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function
|
|
18855
|
+
[(_ResponseStream_params = new WeakMap, _ResponseStream_currentResponseSnapshot = new WeakMap, _ResponseStream_finalResponse = new WeakMap, _ResponseStream_instances = new WeakSet, _ResponseStream_beginRequest = function _ResponseStream_beginRequest() {
|
|
18845
18856
|
if (this.ended)
|
|
18846
18857
|
return;
|
|
18847
18858
|
__classPrivateFieldSet6(this, _ResponseStream_currentResponseSnapshot, undefined, "f");
|
|
18848
|
-
}, _ResponseStream_addEvent = function
|
|
18859
|
+
}, _ResponseStream_addEvent = function _ResponseStream_addEvent(event, starting_after) {
|
|
18849
18860
|
if (this.ended)
|
|
18850
18861
|
return;
|
|
18851
18862
|
const maybeEmit = (name, event2) => {
|
|
@@ -18893,7 +18904,7 @@ class ResponseStream extends EventStream {
|
|
|
18893
18904
|
maybeEmit(event.type, event);
|
|
18894
18905
|
break;
|
|
18895
18906
|
}
|
|
18896
|
-
}, _ResponseStream_endRequest = function
|
|
18907
|
+
}, _ResponseStream_endRequest = function _ResponseStream_endRequest() {
|
|
18897
18908
|
if (this.ended) {
|
|
18898
18909
|
throw new OpenAIError(`stream has ended, this shouldn't happen`);
|
|
18899
18910
|
}
|
|
@@ -18905,7 +18916,7 @@ class ResponseStream extends EventStream {
|
|
|
18905
18916
|
const parsedResponse = finalizeResponse(snapshot, __classPrivateFieldGet7(this, _ResponseStream_params, "f"));
|
|
18906
18917
|
__classPrivateFieldSet6(this, _ResponseStream_finalResponse, parsedResponse, "f");
|
|
18907
18918
|
return parsedResponse;
|
|
18908
|
-
}, _ResponseStream_accumulateResponse = function
|
|
18919
|
+
}, _ResponseStream_accumulateResponse = function _ResponseStream_accumulateResponse(event) {
|
|
18909
18920
|
let snapshot = __classPrivateFieldGet7(this, _ResponseStream_currentResponseSnapshot, "f");
|
|
18910
18921
|
if (!snapshot) {
|
|
18911
18922
|
if (event.type !== "response.created") {
|
|
@@ -24569,7 +24580,9 @@ function createMcpServer() {
|
|
|
24569
24580
|
}
|
|
24570
24581
|
async function startMcpServer(transport = new StdioServerTransport) {
|
|
24571
24582
|
const server = createMcpServer();
|
|
24572
|
-
|
|
24583
|
+
try {
|
|
24584
|
+
registerCloudTools(server, "brains");
|
|
24585
|
+
} catch {}
|
|
24573
24586
|
await server.connect(transport);
|
|
24574
24587
|
return server;
|
|
24575
24588
|
}
|