@anuma/sdk 1.2.2 → 1.3.1
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/expo/index.cjs +353 -219
- package/dist/expo/index.d.mts +80 -7
- package/dist/expo/index.d.ts +80 -7
- package/dist/expo/index.mjs +272 -143
- package/dist/react/index.cjs +440 -306
- package/dist/react/index.d.mts +80 -7
- package/dist/react/index.d.ts +80 -7
- package/dist/react/index.mjs +314 -185
- package/dist/server/index.cjs +474 -413
- package/dist/server/index.d.mts +20 -6
- package/dist/server/index.d.ts +20 -6
- package/dist/server/index.mjs +349 -288
- package/package.json +1 -1
package/dist/server/index.cjs
CHANGED
|
@@ -13863,13 +13863,13 @@ var require_helpers5 = __commonJS({
|
|
|
13863
13863
|
return n.default = e, t && t.set(e, n), n;
|
|
13864
13864
|
}
|
|
13865
13865
|
var createTimestampsFor = exports2.createTimestampsFor = function(model) {
|
|
13866
|
-
var
|
|
13866
|
+
var date10 = Date.now();
|
|
13867
13867
|
var timestamps = {};
|
|
13868
13868
|
if ("createdAt" in model) {
|
|
13869
|
-
timestamps.created_at =
|
|
13869
|
+
timestamps.created_at = date10;
|
|
13870
13870
|
}
|
|
13871
13871
|
if ("updatedAt" in model) {
|
|
13872
|
-
timestamps.updated_at =
|
|
13872
|
+
timestamps.updated_at = date10;
|
|
13873
13873
|
}
|
|
13874
13874
|
return timestamps;
|
|
13875
13875
|
};
|
|
@@ -13956,8 +13956,8 @@ var require_Model = __commonJS({
|
|
|
13956
13956
|
function associations(...associationList) {
|
|
13957
13957
|
return (0, _fromPairs.default)(associationList);
|
|
13958
13958
|
}
|
|
13959
|
-
var
|
|
13960
|
-
function
|
|
13959
|
+
var Model12 = exports2.default = /* @__PURE__ */ (function() {
|
|
13960
|
+
function Model13(collection, raw) {
|
|
13961
13961
|
this._isEditing = false;
|
|
13962
13962
|
this._preparedState = null;
|
|
13963
13963
|
this.__changes = null;
|
|
@@ -13965,7 +13965,7 @@ var require_Model = __commonJS({
|
|
|
13965
13965
|
this.collection = collection;
|
|
13966
13966
|
this._raw = raw;
|
|
13967
13967
|
}
|
|
13968
|
-
var _proto =
|
|
13968
|
+
var _proto = Model13.prototype;
|
|
13969
13969
|
_proto._getChanges = function() {
|
|
13970
13970
|
if (!this.__changes) {
|
|
13971
13971
|
this.__changes = new _rx.BehaviorSubject(this);
|
|
@@ -14110,7 +14110,7 @@ var require_Model = __commonJS({
|
|
|
14110
14110
|
_proto.callReader = function(action) {
|
|
14111
14111
|
return this.db._workQueue.subAction(action);
|
|
14112
14112
|
};
|
|
14113
|
-
|
|
14113
|
+
Model13._prepareCreate = function(collection, recordBuilder) {
|
|
14114
14114
|
var record = new this(
|
|
14115
14115
|
collection,
|
|
14116
14116
|
// sanitizedRaw sets id
|
|
@@ -14123,13 +14123,13 @@ var require_Model = __commonJS({
|
|
|
14123
14123
|
record.__logVerbose("prepareCreate");
|
|
14124
14124
|
return record;
|
|
14125
14125
|
};
|
|
14126
|
-
|
|
14126
|
+
Model13._prepareCreateFromDirtyRaw = function(collection, dirtyRaw) {
|
|
14127
14127
|
var record = new this(collection, (0, _RawRecord.sanitizedRaw)(dirtyRaw, collection.schema));
|
|
14128
14128
|
record._preparedState = "create";
|
|
14129
14129
|
record.__logVerbose("prepareCreateFromDirtyRaw");
|
|
14130
14130
|
return record;
|
|
14131
14131
|
};
|
|
14132
|
-
|
|
14132
|
+
Model13._disposableFromDirtyRaw = function(collection, dirtyRaw) {
|
|
14133
14133
|
var record = new this(collection, (0, _RawRecord.sanitizedRaw)(dirtyRaw, collection.schema));
|
|
14134
14134
|
record._raw._status = "disposable";
|
|
14135
14135
|
record.__logVerbose("disposableFromDirtyRaw");
|
|
@@ -14187,7 +14187,7 @@ var require_Model = __commonJS({
|
|
|
14187
14187
|
_logger.default.debug("".concat(debugName, ": ").concat(this.__debugName));
|
|
14188
14188
|
}
|
|
14189
14189
|
};
|
|
14190
|
-
return (0, _createClass2.default)(
|
|
14190
|
+
return (0, _createClass2.default)(Model13, [{
|
|
14191
14191
|
key: "id",
|
|
14192
14192
|
get: function get() {
|
|
14193
14193
|
return this._raw.id;
|
|
@@ -14249,8 +14249,8 @@ var require_Model = __commonJS({
|
|
|
14249
14249
|
}
|
|
14250
14250
|
}]);
|
|
14251
14251
|
})();
|
|
14252
|
-
|
|
14253
|
-
|
|
14252
|
+
Model12.associations = {};
|
|
14253
|
+
Model12._wmelonTag = "model";
|
|
14254
14254
|
}
|
|
14255
14255
|
});
|
|
14256
14256
|
|
|
@@ -14624,7 +14624,7 @@ var require_field = __commonJS({
|
|
|
14624
14624
|
exports2.default = void 0;
|
|
14625
14625
|
var _makeDecorator = _interopRequireDefault(require_makeDecorator());
|
|
14626
14626
|
var _common = require_common2();
|
|
14627
|
-
var
|
|
14627
|
+
var field10 = (0, _makeDecorator.default)(function(columnName) {
|
|
14628
14628
|
return function(target, key, descriptor) {
|
|
14629
14629
|
(0, _common.ensureDecoratorUsedProperly)(columnName, target, key, descriptor);
|
|
14630
14630
|
return {
|
|
@@ -14639,7 +14639,7 @@ var require_field = __commonJS({
|
|
|
14639
14639
|
};
|
|
14640
14640
|
};
|
|
14641
14641
|
});
|
|
14642
|
-
var _default = exports2.default =
|
|
14642
|
+
var _default = exports2.default = field10;
|
|
14643
14643
|
}
|
|
14644
14644
|
});
|
|
14645
14645
|
|
|
@@ -14689,16 +14689,16 @@ var require_date = __commonJS({
|
|
|
14689
14689
|
if (cached) {
|
|
14690
14690
|
return cached;
|
|
14691
14691
|
}
|
|
14692
|
-
var
|
|
14693
|
-
cache.set(rawValue,
|
|
14694
|
-
return
|
|
14692
|
+
var date10 = new Date(rawValue);
|
|
14693
|
+
cache.set(rawValue, date10);
|
|
14694
|
+
return date10;
|
|
14695
14695
|
}
|
|
14696
14696
|
return null;
|
|
14697
14697
|
},
|
|
14698
|
-
set: function(
|
|
14699
|
-
var rawValue =
|
|
14700
|
-
if (rawValue &&
|
|
14701
|
-
cache.set(rawValue, new Date(
|
|
14698
|
+
set: function(date10) {
|
|
14699
|
+
var rawValue = date10 ? +new Date(date10) : null;
|
|
14700
|
+
if (rawValue && date10) {
|
|
14701
|
+
cache.set(rawValue, new Date(date10));
|
|
14702
14702
|
}
|
|
14703
14703
|
this.asModel._setRaw(columnName, rawValue);
|
|
14704
14704
|
}
|
|
@@ -14718,7 +14718,7 @@ var require_text = __commonJS({
|
|
|
14718
14718
|
exports2.default = void 0;
|
|
14719
14719
|
var _makeDecorator = _interopRequireDefault(require_makeDecorator());
|
|
14720
14720
|
var _common = require_common2();
|
|
14721
|
-
var
|
|
14721
|
+
var text12 = (0, _makeDecorator.default)(function(columnName) {
|
|
14722
14722
|
return function(target, key, descriptor) {
|
|
14723
14723
|
(0, _common.ensureDecoratorUsedProperly)(columnName, target, key, descriptor);
|
|
14724
14724
|
return {
|
|
@@ -14733,7 +14733,7 @@ var require_text = __commonJS({
|
|
|
14733
14733
|
};
|
|
14734
14734
|
};
|
|
14735
14735
|
});
|
|
14736
|
-
var _default = exports2.default =
|
|
14736
|
+
var _default = exports2.default = text12;
|
|
14737
14737
|
}
|
|
14738
14738
|
});
|
|
14739
14739
|
|
|
@@ -14747,7 +14747,7 @@ var require_readonly = __commonJS({
|
|
|
14747
14747
|
var _extends2 = _interopRequireDefault(require_extends());
|
|
14748
14748
|
var _makeDecorator = _interopRequireDefault(require_makeDecorator());
|
|
14749
14749
|
var _invariant = _interopRequireDefault(require_invariant());
|
|
14750
|
-
var
|
|
14750
|
+
var readonly8 = (0, _makeDecorator.default)(function() {
|
|
14751
14751
|
return function(target, key, descriptor) {
|
|
14752
14752
|
if (descriptor.get || descriptor.set) {
|
|
14753
14753
|
return (0, _extends2.default)({}, descriptor, {
|
|
@@ -14760,7 +14760,7 @@ var require_readonly = __commonJS({
|
|
|
14760
14760
|
return descriptor;
|
|
14761
14761
|
};
|
|
14762
14762
|
});
|
|
14763
|
-
var _default = exports2.default =
|
|
14763
|
+
var _default = exports2.default = readonly8;
|
|
14764
14764
|
}
|
|
14765
14765
|
});
|
|
14766
14766
|
|
|
@@ -15999,7 +15999,7 @@ async function createConversationOp(ctx, opts, defaultTitle = "New Conversation"
|
|
|
15999
15999
|
);
|
|
16000
16000
|
}
|
|
16001
16001
|
async function getConversationOp(ctx, id) {
|
|
16002
|
-
const results = await ctx.conversationsCollection.query(
|
|
16002
|
+
const results = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("conversation_id", id), import_watermelondb14.Q.where("is_deleted", false)).fetch();
|
|
16003
16003
|
return results.length > 0 ? await conversationToStored(
|
|
16004
16004
|
results[0],
|
|
16005
16005
|
ctx.walletAddress,
|
|
@@ -16008,7 +16008,7 @@ async function getConversationOp(ctx, id) {
|
|
|
16008
16008
|
) : null;
|
|
16009
16009
|
}
|
|
16010
16010
|
async function getConversationsOp(ctx) {
|
|
16011
|
-
const results = await ctx.conversationsCollection.query(
|
|
16011
|
+
const results = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("is_deleted", false), import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc)).fetch();
|
|
16012
16012
|
return Promise.all(
|
|
16013
16013
|
results.map(
|
|
16014
16014
|
(conv) => conversationToStored(conv, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
|
|
@@ -16028,19 +16028,19 @@ function conversationToLazyStored(conversation) {
|
|
|
16028
16028
|
};
|
|
16029
16029
|
}
|
|
16030
16030
|
async function getConversationsLazyOp(ctx) {
|
|
16031
|
-
const results = await ctx.conversationsCollection.query(
|
|
16031
|
+
const results = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("is_deleted", false), import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc)).fetch();
|
|
16032
16032
|
return results.map(conversationToLazyStored);
|
|
16033
16033
|
}
|
|
16034
16034
|
async function getConversationsByProjectLazyOp(ctx, projectId) {
|
|
16035
16035
|
const results = await ctx.conversationsCollection.query(
|
|
16036
|
-
|
|
16037
|
-
|
|
16038
|
-
|
|
16036
|
+
import_watermelondb14.Q.where("project_id", projectId === null ? "" : projectId),
|
|
16037
|
+
import_watermelondb14.Q.where("is_deleted", false),
|
|
16038
|
+
import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc)
|
|
16039
16039
|
).fetch();
|
|
16040
16040
|
return results.map(conversationToLazyStored);
|
|
16041
16041
|
}
|
|
16042
16042
|
async function updateConversationTitleOp(ctx, id, title) {
|
|
16043
|
-
const results = await ctx.conversationsCollection.query(
|
|
16043
|
+
const results = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("conversation_id", id), import_watermelondb14.Q.where("is_deleted", false)).fetch();
|
|
16044
16044
|
if (results.length > 0) {
|
|
16045
16045
|
const encryptedOpts = ctx.walletAddress && ctx.signMessage ? await encryptConversationFields(
|
|
16046
16046
|
{ title },
|
|
@@ -16059,7 +16059,7 @@ async function updateConversationTitleOp(ctx, id, title) {
|
|
|
16059
16059
|
return false;
|
|
16060
16060
|
}
|
|
16061
16061
|
async function deleteConversationOp(ctx, id) {
|
|
16062
|
-
const results = await ctx.conversationsCollection.query(
|
|
16062
|
+
const results = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("conversation_id", id), import_watermelondb14.Q.where("is_deleted", false)).fetch();
|
|
16063
16063
|
if (results.length > 0) {
|
|
16064
16064
|
await ctx.database.write(async () => {
|
|
16065
16065
|
await results[0].update((conv) => {
|
|
@@ -16071,7 +16071,7 @@ async function deleteConversationOp(ctx, id) {
|
|
|
16071
16071
|
return false;
|
|
16072
16072
|
}
|
|
16073
16073
|
async function updateConversationProjectOp(ctx, id, projectId) {
|
|
16074
|
-
const results = await ctx.conversationsCollection.query(
|
|
16074
|
+
const results = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("conversation_id", id), import_watermelondb14.Q.where("is_deleted", false)).fetch();
|
|
16075
16075
|
if (results.length > 0) {
|
|
16076
16076
|
await ctx.database.write(async () => {
|
|
16077
16077
|
await results[0].update((conv) => {
|
|
@@ -16084,9 +16084,9 @@ async function updateConversationProjectOp(ctx, id, projectId) {
|
|
|
16084
16084
|
}
|
|
16085
16085
|
async function getConversationsByProjectOp(ctx, projectId) {
|
|
16086
16086
|
const results = await ctx.conversationsCollection.query(
|
|
16087
|
-
|
|
16088
|
-
|
|
16089
|
-
|
|
16087
|
+
import_watermelondb14.Q.where("project_id", projectId === null ? "" : projectId),
|
|
16088
|
+
import_watermelondb14.Q.where("is_deleted", false),
|
|
16089
|
+
import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc)
|
|
16090
16090
|
).fetch();
|
|
16091
16091
|
return Promise.all(
|
|
16092
16092
|
results.map(
|
|
@@ -16095,7 +16095,7 @@ async function getConversationsByProjectOp(ctx, projectId) {
|
|
|
16095
16095
|
);
|
|
16096
16096
|
}
|
|
16097
16097
|
async function getMessagesOp(ctx, convId) {
|
|
16098
|
-
const results = await ctx.messagesCollection.query(
|
|
16098
|
+
const results = await ctx.messagesCollection.query(import_watermelondb14.Q.where("conversation_id", convId), import_watermelondb14.Q.sortBy("message_id", import_watermelondb14.Q.asc)).fetch();
|
|
16099
16099
|
return Promise.all(
|
|
16100
16100
|
results.map(
|
|
16101
16101
|
(msg) => messageToStored(msg, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
|
|
@@ -16103,7 +16103,7 @@ async function getMessagesOp(ctx, convId) {
|
|
|
16103
16103
|
);
|
|
16104
16104
|
}
|
|
16105
16105
|
async function clearMessagesOp(ctx, convId) {
|
|
16106
|
-
const messages = await ctx.messagesCollection.query(
|
|
16106
|
+
const messages = await ctx.messagesCollection.query(import_watermelondb14.Q.where("conversation_id", convId)).fetch();
|
|
16107
16107
|
await ctx.database.write(async () => {
|
|
16108
16108
|
for (const message of messages) {
|
|
16109
16109
|
await message.update((msg) => {
|
|
@@ -16170,9 +16170,9 @@ async function createMessageOp(ctx, opts) {
|
|
|
16170
16170
|
}
|
|
16171
16171
|
}
|
|
16172
16172
|
const newest = await ctx.messagesCollection.query(
|
|
16173
|
-
|
|
16174
|
-
|
|
16175
|
-
|
|
16173
|
+
import_watermelondb14.Q.where("conversation_id", opts.conversationId),
|
|
16174
|
+
import_watermelondb14.Q.sortBy("message_id", import_watermelondb14.Q.desc),
|
|
16175
|
+
import_watermelondb14.Q.take(1)
|
|
16176
16176
|
).fetch();
|
|
16177
16177
|
const messageId = (newest[0]?.messageId ?? 0) + 1;
|
|
16178
16178
|
const encryptedOpts = await encryptMessageOptsIfNeeded(ctx, opts);
|
|
@@ -16186,7 +16186,7 @@ async function createMessageOp(ctx, opts) {
|
|
|
16186
16186
|
return messageToStored(created, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner);
|
|
16187
16187
|
}
|
|
16188
16188
|
async function upsertMessageOp(ctx, opts) {
|
|
16189
|
-
const results = await ctx.messagesCollection.query(
|
|
16189
|
+
const results = await ctx.messagesCollection.query(import_watermelondb14.Q.where("id", opts.uniqueId)).fetch();
|
|
16190
16190
|
const existing = results.length > 0 ? results[0] : null;
|
|
16191
16191
|
if (!existing) {
|
|
16192
16192
|
return createMessageOp(ctx, opts);
|
|
@@ -16344,12 +16344,12 @@ async function readJsonField(model, column, walletAddress) {
|
|
|
16344
16344
|
}
|
|
16345
16345
|
async function searchMessagesOp(ctx, queryVector, options) {
|
|
16346
16346
|
const { limit = 10, minSimilarity = 0.5, conversationId } = options || {};
|
|
16347
|
-
const activeConversations = await ctx.conversationsCollection.query(
|
|
16347
|
+
const activeConversations = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("is_deleted", false)).fetch();
|
|
16348
16348
|
const activeConversationIds = new Set(
|
|
16349
16349
|
// Use _getRaw for reliable raw column access
|
|
16350
16350
|
activeConversations.map((c) => String(c._getRaw("conversation_id")))
|
|
16351
16351
|
);
|
|
16352
|
-
const queryConditions = conversationId ? [
|
|
16352
|
+
const queryConditions = conversationId ? [import_watermelondb14.Q.where("conversation_id", conversationId)] : [];
|
|
16353
16353
|
const messages = await ctx.messagesCollection.query(...queryConditions).fetch();
|
|
16354
16354
|
const candidates = [];
|
|
16355
16355
|
for (const message of messages) {
|
|
@@ -16377,12 +16377,12 @@ async function searchMessagesOp(ctx, queryVector, options) {
|
|
|
16377
16377
|
}
|
|
16378
16378
|
async function searchChunksOp(ctx, queryVector, options) {
|
|
16379
16379
|
const { limit = 10, minSimilarity = 0.5, conversationId, embeddingModel } = options || {};
|
|
16380
|
-
const activeConversations = await ctx.conversationsCollection.query(
|
|
16380
|
+
const activeConversations = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("is_deleted", false)).fetch();
|
|
16381
16381
|
const activeConversationIds = new Set(
|
|
16382
16382
|
// Use _getRaw for reliable raw column access
|
|
16383
16383
|
activeConversations.map((c) => String(c._getRaw("conversation_id")))
|
|
16384
16384
|
);
|
|
16385
|
-
const queryConditions = conversationId ? [
|
|
16385
|
+
const queryConditions = conversationId ? [import_watermelondb14.Q.where("conversation_id", conversationId)] : [];
|
|
16386
16386
|
const messages = await ctx.messagesCollection.query(...queryConditions).fetch();
|
|
16387
16387
|
const candidates = [];
|
|
16388
16388
|
let staleSkipped = 0;
|
|
@@ -16447,13 +16447,13 @@ async function searchChunksOp(ctx, queryVector, options) {
|
|
|
16447
16447
|
}
|
|
16448
16448
|
async function getAllFilesOp(ctx, options) {
|
|
16449
16449
|
const { conversationId, limit } = options || {};
|
|
16450
|
-
const activeConversations = await ctx.conversationsCollection.query(
|
|
16450
|
+
const activeConversations = await ctx.conversationsCollection.query(import_watermelondb14.Q.where("is_deleted", false)).fetch();
|
|
16451
16451
|
const activeConversationIds = new Set(
|
|
16452
16452
|
// Use _getRaw for reliable raw column access
|
|
16453
16453
|
activeConversations.map((c) => String(c._getRaw("conversation_id")))
|
|
16454
16454
|
);
|
|
16455
|
-
const queryConditions = conversationId ? [
|
|
16456
|
-
const messages = await ctx.messagesCollection.query(...queryConditions,
|
|
16455
|
+
const queryConditions = conversationId ? [import_watermelondb14.Q.where("conversation_id", conversationId)] : [];
|
|
16456
|
+
const messages = await ctx.messagesCollection.query(...queryConditions, import_watermelondb14.Q.sortBy("created_at", import_watermelondb14.Q.desc)).fetch();
|
|
16457
16457
|
const filesWithContext = [];
|
|
16458
16458
|
for (const message of messages) {
|
|
16459
16459
|
const msgConvId = String(message._getRaw("conversation_id"));
|
|
@@ -16513,11 +16513,11 @@ function makeSyntheticStoredConversation(opts, defaultTitle) {
|
|
|
16513
16513
|
isDeleted: false
|
|
16514
16514
|
};
|
|
16515
16515
|
}
|
|
16516
|
-
var
|
|
16516
|
+
var import_watermelondb14, import_uuid2;
|
|
16517
16517
|
var init_operations = __esm({
|
|
16518
16518
|
"src/lib/db/chat/operations.ts"() {
|
|
16519
16519
|
"use strict";
|
|
16520
|
-
|
|
16520
|
+
import_watermelondb14 = __toESM(require_watermelondb());
|
|
16521
16521
|
import_uuid2 = require("uuid");
|
|
16522
16522
|
init_logger();
|
|
16523
16523
|
init_vector();
|
|
@@ -16598,7 +16598,7 @@ async function upsertEntitiesOp(ctx, entities) {
|
|
|
16598
16598
|
const out = /* @__PURE__ */ new Map();
|
|
16599
16599
|
if (unique.length === 0) return out;
|
|
16600
16600
|
return await ctx.database.write(async () => {
|
|
16601
|
-
const existing = await ctx.entityCollection.query(
|
|
16601
|
+
const existing = await ctx.entityCollection.query(import_watermelondb16.Q.where("canonical_name", import_watermelondb16.Q.oneOf(unique))).fetch();
|
|
16602
16602
|
const existingNames = new Set(existing.map((e) => e.canonicalName));
|
|
16603
16603
|
const updates = existing.filter((e) => {
|
|
16604
16604
|
const incoming = kindByName.get(e.canonicalName);
|
|
@@ -16633,7 +16633,7 @@ async function linkMemoryEntitiesOp(ctx, memoryId, entityInputs) {
|
|
|
16633
16633
|
if (entities.length === 0) return [];
|
|
16634
16634
|
const userId = ctx.userId;
|
|
16635
16635
|
await ctx.database.write(async () => {
|
|
16636
|
-
const existingLinks = await ctx.memoryEntityCollection.query(
|
|
16636
|
+
const existingLinks = await ctx.memoryEntityCollection.query(import_watermelondb16.Q.where("memory_id", memoryId)).fetch();
|
|
16637
16637
|
const existingEntityIds = new Set(existingLinks.map((l) => String(l.entityId)));
|
|
16638
16638
|
const toCreate = entities.filter((e) => !existingEntityIds.has(e.uniqueId));
|
|
16639
16639
|
if (toCreate.length === 0) return;
|
|
@@ -16650,7 +16650,7 @@ async function linkMemoryEntitiesOp(ctx, memoryId, entityInputs) {
|
|
|
16650
16650
|
}
|
|
16651
16651
|
async function unlinkMemoryEntitiesOp(ctx, memoryIds) {
|
|
16652
16652
|
if (memoryIds.length === 0) return;
|
|
16653
|
-
const links = await ctx.memoryEntityCollection.query(
|
|
16653
|
+
const links = await ctx.memoryEntityCollection.query(import_watermelondb16.Q.where("memory_id", import_watermelondb16.Q.oneOf(Array.from(memoryIds)))).fetch();
|
|
16654
16654
|
if (links.length === 0) return;
|
|
16655
16655
|
await ctx.database.write(async () => {
|
|
16656
16656
|
await ctx.database.batch(...links.map((l) => l.prepareDestroyPermanently()));
|
|
@@ -16658,7 +16658,7 @@ async function unlinkMemoryEntitiesOp(ctx, memoryIds) {
|
|
|
16658
16658
|
}
|
|
16659
16659
|
async function unlinkAllMemoryEntitiesForUserOp(ctx, userId) {
|
|
16660
16660
|
if (!userId) return;
|
|
16661
|
-
const links = await ctx.memoryEntityCollection.query(
|
|
16661
|
+
const links = await ctx.memoryEntityCollection.query(import_watermelondb16.Q.where("user_id", userId)).fetch();
|
|
16662
16662
|
if (links.length === 0) return;
|
|
16663
16663
|
await ctx.database.write(async () => {
|
|
16664
16664
|
await ctx.database.batch(...links.map((l) => l.prepareDestroyPermanently()));
|
|
@@ -16667,15 +16667,15 @@ async function unlinkAllMemoryEntitiesForUserOp(ctx, userId) {
|
|
|
16667
16667
|
async function getMemoriesByEntityNamesOp(ctx, entityNames) {
|
|
16668
16668
|
const unique = Array.from(new Set(entityNames.map(normalizeEntityName).filter((n) => n.length > 0)));
|
|
16669
16669
|
if (unique.length === 0) return /* @__PURE__ */ new Map();
|
|
16670
|
-
const entityRows = await ctx.entityCollection.query(
|
|
16670
|
+
const entityRows = await ctx.entityCollection.query(import_watermelondb16.Q.where("canonical_name", import_watermelondb16.Q.oneOf(unique))).fetch();
|
|
16671
16671
|
if (entityRows.length === 0) return /* @__PURE__ */ new Map();
|
|
16672
16672
|
const entityIdToName = new Map(entityRows.map((e) => [e.id, e.canonicalName]));
|
|
16673
|
-
const linkConditions = [
|
|
16673
|
+
const linkConditions = [import_watermelondb16.Q.where("entity_id", import_watermelondb16.Q.oneOf(entityRows.map((e) => e.id)))];
|
|
16674
16674
|
if (ctx.userId !== void 0) {
|
|
16675
16675
|
if (ctx.allowUnscopedRows) {
|
|
16676
|
-
linkConditions.push(
|
|
16676
|
+
linkConditions.push(import_watermelondb16.Q.or(import_watermelondb16.Q.where("user_id", ctx.userId), import_watermelondb16.Q.where("user_id", null)));
|
|
16677
16677
|
} else {
|
|
16678
|
-
linkConditions.push(
|
|
16678
|
+
linkConditions.push(import_watermelondb16.Q.where("user_id", ctx.userId));
|
|
16679
16679
|
}
|
|
16680
16680
|
}
|
|
16681
16681
|
const links = await ctx.memoryEntityCollection.query(...linkConditions).fetch();
|
|
@@ -16693,11 +16693,11 @@ async function getMemoriesByEntityNamesOp(ctx, entityNames) {
|
|
|
16693
16693
|
}
|
|
16694
16694
|
return out;
|
|
16695
16695
|
}
|
|
16696
|
-
var
|
|
16696
|
+
var import_watermelondb16;
|
|
16697
16697
|
var init_operations2 = __esm({
|
|
16698
16698
|
"src/lib/db/entities/operations.ts"() {
|
|
16699
16699
|
"use strict";
|
|
16700
|
-
|
|
16700
|
+
import_watermelondb16 = __toESM(require_watermelondb());
|
|
16701
16701
|
init_types3();
|
|
16702
16702
|
}
|
|
16703
16703
|
});
|
|
@@ -16742,9 +16742,9 @@ function isOwnedByCtxUser(ctx, record) {
|
|
|
16742
16742
|
}
|
|
16743
16743
|
function baseVaultConditions(ctx, options) {
|
|
16744
16744
|
return [
|
|
16745
|
-
...options?.includeDeleted ? [] : [
|
|
16746
|
-
...ctx.userId !== void 0 ? [
|
|
16747
|
-
...options?.since ? [
|
|
16745
|
+
...options?.includeDeleted ? [] : [import_watermelondb17.Q.where("is_deleted", false)],
|
|
16746
|
+
...ctx.userId !== void 0 ? [import_watermelondb17.Q.where("user_id", ctx.userId)] : [],
|
|
16747
|
+
...options?.since ? [import_watermelondb17.Q.where("updated_at", import_watermelondb17.Q.gt(options.since.getTime()))] : []
|
|
16748
16748
|
];
|
|
16749
16749
|
}
|
|
16750
16750
|
async function mapInBatches(items, fn) {
|
|
@@ -16830,11 +16830,11 @@ async function createVaultMemoryOp(ctx, opts) {
|
|
|
16830
16830
|
async function getMemoriesByEventTimeOp(ctx, windowStart, windowEnd) {
|
|
16831
16831
|
const records = await ctx.vaultMemoryCollection.query(
|
|
16832
16832
|
...baseVaultConditions(ctx),
|
|
16833
|
-
|
|
16834
|
-
|
|
16835
|
-
|
|
16836
|
-
|
|
16837
|
-
|
|
16833
|
+
import_watermelondb17.Q.where("event_time_start", import_watermelondb17.Q.notEq(null)),
|
|
16834
|
+
import_watermelondb17.Q.where("event_time_start", import_watermelondb17.Q.lte(windowEnd)),
|
|
16835
|
+
import_watermelondb17.Q.or(
|
|
16836
|
+
import_watermelondb17.Q.where("event_time_start", import_watermelondb17.Q.gte(windowStart)),
|
|
16837
|
+
import_watermelondb17.Q.where("event_time_kind", import_watermelondb17.Q.oneOf(["range", "ongoing"]))
|
|
16838
16838
|
)
|
|
16839
16839
|
).fetch();
|
|
16840
16840
|
const out = [];
|
|
@@ -16980,10 +16980,10 @@ async function vaultMemoryRawToStored(raw, walletAddress, signMessage, embeddedW
|
|
|
16980
16980
|
async function getAllVaultMemoriesOp(ctx, options) {
|
|
16981
16981
|
const conditions = [
|
|
16982
16982
|
...baseVaultConditions(ctx, options),
|
|
16983
|
-
...options?.scopes?.length ? [
|
|
16984
|
-
...options?.folderId !== void 0 ? [
|
|
16985
|
-
|
|
16986
|
-
...options?.limit !== null && options?.limit !== void 0 && options.limit > 0 ? [
|
|
16983
|
+
...options?.scopes?.length ? [import_watermelondb17.Q.where("scope", import_watermelondb17.Q.oneOf(options.scopes))] : [],
|
|
16984
|
+
...options?.folderId !== void 0 ? [import_watermelondb17.Q.where("folder_id", options.folderId)] : [],
|
|
16985
|
+
import_watermelondb17.Q.sortBy(options?.since ? "updated_at" : "created_at", import_watermelondb17.Q.desc),
|
|
16986
|
+
...options?.limit !== null && options?.limit !== void 0 && options.limit > 0 ? [import_watermelondb17.Q.take(options.limit)] : []
|
|
16987
16987
|
];
|
|
16988
16988
|
const results = await ctx.vaultMemoryCollection.query(...conditions).unsafeFetchRaw();
|
|
16989
16989
|
return mapInBatches(
|
|
@@ -17097,9 +17097,9 @@ async function deleteVaultMemoryOp(ctx, id) {
|
|
|
17097
17097
|
}
|
|
17098
17098
|
async function getUnfiledVaultMemoriesOp(ctx) {
|
|
17099
17099
|
const conditions = [
|
|
17100
|
-
|
|
17100
|
+
import_watermelondb17.Q.where("folder_id", null),
|
|
17101
17101
|
...baseVaultConditions(ctx),
|
|
17102
|
-
|
|
17102
|
+
import_watermelondb17.Q.sortBy("created_at", import_watermelondb17.Q.desc)
|
|
17103
17103
|
];
|
|
17104
17104
|
const results = await ctx.vaultMemoryCollection.query(...conditions).fetch();
|
|
17105
17105
|
return mapInBatches(
|
|
@@ -17109,7 +17109,7 @@ async function getUnfiledVaultMemoriesOp(ctx) {
|
|
|
17109
17109
|
}
|
|
17110
17110
|
async function deleteAllVaultMemoriesForUserOp(ctx, userId) {
|
|
17111
17111
|
if (ctx.userId !== void 0 && ctx.userId !== userId) return 0;
|
|
17112
|
-
const records = await ctx.vaultMemoryCollection.query(
|
|
17112
|
+
const records = await ctx.vaultMemoryCollection.query(import_watermelondb17.Q.where("user_id", userId), import_watermelondb17.Q.where("is_deleted", false)).fetch();
|
|
17113
17113
|
if (records.length === 0) return 0;
|
|
17114
17114
|
await ctx.database.write(async () => {
|
|
17115
17115
|
const prepared = records.map(
|
|
@@ -17149,60 +17149,60 @@ async function updateVaultMemoryEmbeddingOp(ctx, id, embedding, embeddingModel)
|
|
|
17149
17149
|
return false;
|
|
17150
17150
|
}
|
|
17151
17151
|
}
|
|
17152
|
-
var
|
|
17152
|
+
var import_watermelondb17;
|
|
17153
17153
|
var init_operations3 = __esm({
|
|
17154
17154
|
"src/lib/db/memoryVault/operations.ts"() {
|
|
17155
17155
|
"use strict";
|
|
17156
|
-
|
|
17156
|
+
import_watermelondb17 = __toESM(require_watermelondb());
|
|
17157
17157
|
init_operations2();
|
|
17158
17158
|
init_encryption2();
|
|
17159
17159
|
}
|
|
17160
17160
|
});
|
|
17161
17161
|
|
|
17162
17162
|
// src/lib/memoryEngine/chunking.ts
|
|
17163
|
-
function splitIntoSentences(
|
|
17163
|
+
function splitIntoSentences(text12) {
|
|
17164
17164
|
const sentenceRegex = /[.!?]+[\s"')}\]]*(?=\s|$)/g;
|
|
17165
17165
|
const sentences = [];
|
|
17166
17166
|
let lastIndex = 0;
|
|
17167
17167
|
let match;
|
|
17168
|
-
while ((match = sentenceRegex.exec(
|
|
17168
|
+
while ((match = sentenceRegex.exec(text12)) !== null) {
|
|
17169
17169
|
const endIndex = match.index + match[0].length;
|
|
17170
|
-
const sentence =
|
|
17170
|
+
const sentence = text12.slice(lastIndex, endIndex).trim();
|
|
17171
17171
|
if (sentence) {
|
|
17172
17172
|
sentences.push(sentence);
|
|
17173
17173
|
}
|
|
17174
17174
|
lastIndex = endIndex;
|
|
17175
17175
|
}
|
|
17176
|
-
const remaining =
|
|
17176
|
+
const remaining = text12.slice(lastIndex).trim();
|
|
17177
17177
|
if (remaining) {
|
|
17178
17178
|
sentences.push(remaining);
|
|
17179
17179
|
}
|
|
17180
17180
|
return sentences;
|
|
17181
17181
|
}
|
|
17182
|
-
function chunkText(
|
|
17182
|
+
function chunkText(text12, options) {
|
|
17183
17183
|
const {
|
|
17184
17184
|
chunkSize = DEFAULT_CHUNK_SIZE,
|
|
17185
17185
|
chunkOverlap: requestedOverlap = DEFAULT_CHUNK_OVERLAP,
|
|
17186
17186
|
minChunkSize = DEFAULT_MIN_CHUNK_SIZE
|
|
17187
17187
|
} = options ?? {};
|
|
17188
17188
|
const chunkOverlap = Math.min(requestedOverlap, chunkSize - 1);
|
|
17189
|
-
if (
|
|
17189
|
+
if (text12.length <= chunkSize) {
|
|
17190
17190
|
return [
|
|
17191
17191
|
{
|
|
17192
|
-
text:
|
|
17192
|
+
text: text12.trim(),
|
|
17193
17193
|
startOffset: 0,
|
|
17194
|
-
endOffset:
|
|
17194
|
+
endOffset: text12.length
|
|
17195
17195
|
}
|
|
17196
17196
|
];
|
|
17197
17197
|
}
|
|
17198
|
-
const sentences = splitIntoSentences(
|
|
17198
|
+
const sentences = splitIntoSentences(text12);
|
|
17199
17199
|
const chunks = [];
|
|
17200
17200
|
let currentChunkSentences = [];
|
|
17201
17201
|
let currentChunkStart = 0;
|
|
17202
17202
|
let currentOffset = 0;
|
|
17203
17203
|
for (let i = 0; i < sentences.length; i++) {
|
|
17204
17204
|
const sentence = sentences[i];
|
|
17205
|
-
let sentenceStart =
|
|
17205
|
+
let sentenceStart = text12.indexOf(sentence, currentOffset);
|
|
17206
17206
|
if (sentenceStart === -1) {
|
|
17207
17207
|
sentenceStart = currentOffset;
|
|
17208
17208
|
}
|
|
@@ -17249,7 +17249,7 @@ function chunkText(text11, options) {
|
|
|
17249
17249
|
if (overlapSentences.length > 0) {
|
|
17250
17250
|
currentChunkSentences = [...overlapSentences, sentence];
|
|
17251
17251
|
const overlapText = overlapSentences[0];
|
|
17252
|
-
const overlapStart =
|
|
17252
|
+
const overlapStart = text12.lastIndexOf(overlapText, currentOffset);
|
|
17253
17253
|
currentChunkStart = overlapStart === -1 ? sentenceStart : overlapStart;
|
|
17254
17254
|
} else {
|
|
17255
17255
|
currentChunkSentences = [sentence];
|
|
@@ -17269,18 +17269,18 @@ function chunkText(text11, options) {
|
|
|
17269
17269
|
chunks.push({
|
|
17270
17270
|
text: chunkText2,
|
|
17271
17271
|
startOffset: currentChunkStart,
|
|
17272
|
-
endOffset:
|
|
17272
|
+
endOffset: text12.length
|
|
17273
17273
|
});
|
|
17274
17274
|
}
|
|
17275
17275
|
}
|
|
17276
17276
|
if (chunks.length === 0) {
|
|
17277
|
-
const trimmedText =
|
|
17277
|
+
const trimmedText = text12.trim();
|
|
17278
17278
|
if (trimmedText.length > 0) {
|
|
17279
17279
|
return [
|
|
17280
17280
|
{
|
|
17281
17281
|
text: trimmedText,
|
|
17282
17282
|
startOffset: 0,
|
|
17283
|
-
endOffset:
|
|
17283
|
+
endOffset: text12.length
|
|
17284
17284
|
}
|
|
17285
17285
|
];
|
|
17286
17286
|
}
|
|
@@ -18231,10 +18231,10 @@ function embeddingErrorFrom(response) {
|
|
|
18231
18231
|
const message = typeof response.error === "object" && response.error && "error" in response.error ? response.error.error : "API embedding failed";
|
|
18232
18232
|
return new EmbeddingHttpError(message, response.response?.status);
|
|
18233
18233
|
}
|
|
18234
|
-
async function generateEmbedding(
|
|
18234
|
+
async function generateEmbedding(text12, options) {
|
|
18235
18235
|
const { baseUrl = BASE_URL, getToken, apiKey, model, cache } = options;
|
|
18236
18236
|
if (cache) {
|
|
18237
|
-
const cached = cache.get(
|
|
18237
|
+
const cached = cache.get(text12);
|
|
18238
18238
|
if (cached) return cached;
|
|
18239
18239
|
}
|
|
18240
18240
|
let headers;
|
|
@@ -18255,7 +18255,7 @@ async function generateEmbedding(text11, options) {
|
|
|
18255
18255
|
body: {
|
|
18256
18256
|
// Mask PII from the request body only — the cache above still keys on
|
|
18257
18257
|
// the original `text`, so callers keep their original values.
|
|
18258
|
-
input: options.maskInput ? options.maskInput(
|
|
18258
|
+
input: options.maskInput ? options.maskInput(text12) : text12,
|
|
18259
18259
|
model: model ?? DEFAULT_API_EMBEDDING_MODEL
|
|
18260
18260
|
},
|
|
18261
18261
|
headers
|
|
@@ -18275,7 +18275,7 @@ async function generateEmbedding(text11, options) {
|
|
|
18275
18275
|
});
|
|
18276
18276
|
}
|
|
18277
18277
|
if (cache) {
|
|
18278
|
-
cache.set(
|
|
18278
|
+
cache.set(text12, embedding);
|
|
18279
18279
|
}
|
|
18280
18280
|
return embedding;
|
|
18281
18281
|
}
|
|
@@ -18728,8 +18728,8 @@ var init_rrf = __esm({
|
|
|
18728
18728
|
});
|
|
18729
18729
|
|
|
18730
18730
|
// src/lib/memoryVault/bm25.ts
|
|
18731
|
-
function tokenize(
|
|
18732
|
-
const m =
|
|
18731
|
+
function tokenize(text12) {
|
|
18732
|
+
const m = text12.toLowerCase().match(TOKEN_RE);
|
|
18733
18733
|
if (!m) return [];
|
|
18734
18734
|
return m.filter((t) => !STOPWORDS.has(t));
|
|
18735
18735
|
}
|
|
@@ -20908,15 +20908,15 @@ var init_redactor = __esm({
|
|
|
20908
20908
|
* (sequential, per-pattern) and the async {@link collectRegexSpans} (span)
|
|
20909
20909
|
* paths so the detection rules live in exactly one place.
|
|
20910
20910
|
*/
|
|
20911
|
-
findMatches(
|
|
20911
|
+
findMatches(text12, pattern) {
|
|
20912
20912
|
const regex = new RegExp(pattern.regex.source, pattern.regex.flags);
|
|
20913
20913
|
const found = [];
|
|
20914
20914
|
let m;
|
|
20915
|
-
while ((m = regex.exec(
|
|
20915
|
+
while ((m = regex.exec(text12)) !== null) {
|
|
20916
20916
|
const value = m[0];
|
|
20917
20917
|
if (pattern.validate && !pattern.validate(value)) continue;
|
|
20918
20918
|
if (pattern.context) {
|
|
20919
|
-
const before =
|
|
20919
|
+
const before = text12.slice(Math.max(0, m.index - 40), m.index);
|
|
20920
20920
|
if (!pattern.context.test(before)) continue;
|
|
20921
20921
|
}
|
|
20922
20922
|
found.push({ match: value, index: m.index });
|
|
@@ -20932,9 +20932,9 @@ var init_redactor = __esm({
|
|
|
20932
20932
|
* earlier patterns, so an earlier (more specific) pattern claims a region
|
|
20933
20933
|
* before a later one can — placeholders are inert and match no pattern.
|
|
20934
20934
|
*/
|
|
20935
|
-
scan(
|
|
20935
|
+
scan(text12, makeReplacement) {
|
|
20936
20936
|
const matches = [];
|
|
20937
|
-
let redacted =
|
|
20937
|
+
let redacted = text12;
|
|
20938
20938
|
for (const pattern of this.patterns) {
|
|
20939
20939
|
const found = this.findMatches(redacted, pattern);
|
|
20940
20940
|
if (found.length === 0) continue;
|
|
@@ -20955,8 +20955,8 @@ var init_redactor = __esm({
|
|
|
20955
20955
|
* Scan and redact PII from a single text string, using numbered, reversible
|
|
20956
20956
|
* placeholders ([EMAIL_1], …) tracked on this instance.
|
|
20957
20957
|
*/
|
|
20958
|
-
redactText(
|
|
20959
|
-
return this.scan(
|
|
20958
|
+
redactText(text12) {
|
|
20959
|
+
return this.scan(text12, (category, value) => this.getPlaceholder(category, value));
|
|
20960
20960
|
}
|
|
20961
20961
|
/**
|
|
20962
20962
|
* Mask PII with unnumbered, NON-reversible tokens ([EMAIL], [SSN], …) without
|
|
@@ -20965,8 +20965,8 @@ var init_redactor = __esm({
|
|
|
20965
20965
|
* embeddings endpoint while staying deterministic, so the same content always
|
|
20966
20966
|
* masks identically and search stays consistent across conversations.
|
|
20967
20967
|
*/
|
|
20968
|
-
maskText(
|
|
20969
|
-
return this.scan(
|
|
20968
|
+
maskText(text12) {
|
|
20969
|
+
return this.scan(text12, (category) => `[${category}]`).text;
|
|
20970
20970
|
}
|
|
20971
20971
|
// ───────────────────────────────────────────────────────────────────────
|
|
20972
20972
|
// Async (regex + NER) path. Mirrors the sync API but additionally folds in
|
|
@@ -20976,10 +20976,10 @@ var init_redactor = __esm({
|
|
|
20976
20976
|
// ───────────────────────────────────────────────────────────────────────
|
|
20977
20977
|
/** All regex matches as spans on the ORIGINAL text (priority 0). Uses the
|
|
20978
20978
|
* same {@link findMatches} guards as the sync scan. */
|
|
20979
|
-
collectRegexSpans(
|
|
20979
|
+
collectRegexSpans(text12) {
|
|
20980
20980
|
const spans = [];
|
|
20981
20981
|
this.patterns.forEach((pattern, patternIndex) => {
|
|
20982
|
-
for (const { match, index } of this.findMatches(
|
|
20982
|
+
for (const { match, index } of this.findMatches(text12, pattern)) {
|
|
20983
20983
|
spans.push({
|
|
20984
20984
|
start: index,
|
|
20985
20985
|
end: index + match.length,
|
|
@@ -20998,16 +20998,16 @@ var init_redactor = __esm({
|
|
|
20998
20998
|
* of "Stripe") from producing a corrupting partial placeholder like
|
|
20999
20999
|
* `[ORG_1]e`.
|
|
21000
21000
|
*/
|
|
21001
|
-
normalizeNerSpans(
|
|
21001
|
+
normalizeNerSpans(text12, raw) {
|
|
21002
21002
|
if (!Array.isArray(raw)) return [];
|
|
21003
21003
|
const out = [];
|
|
21004
21004
|
raw.forEach((s, i) => {
|
|
21005
21005
|
if (!Number.isFinite(s.start) || !Number.isFinite(s.end)) return;
|
|
21006
|
-
let start = Math.max(0, Math.min(Math.trunc(s.start),
|
|
21007
|
-
let end = Math.max(0, Math.min(Math.trunc(s.end),
|
|
21006
|
+
let start = Math.max(0, Math.min(Math.trunc(s.start), text12.length));
|
|
21007
|
+
let end = Math.max(0, Math.min(Math.trunc(s.end), text12.length));
|
|
21008
21008
|
if (end <= start) return;
|
|
21009
|
-
while (start > 0 && isWordChar(
|
|
21010
|
-
while (end <
|
|
21009
|
+
while (start > 0 && isWordChar(text12[start - 1])) start--;
|
|
21010
|
+
while (end < text12.length && isWordChar(text12[end])) end++;
|
|
21011
21011
|
const category = String(s.category ?? "").trim();
|
|
21012
21012
|
if (!category) return;
|
|
21013
21013
|
out.push({ start, end, category, priority: 1, order: i });
|
|
@@ -21016,10 +21016,10 @@ var init_redactor = __esm({
|
|
|
21016
21016
|
}
|
|
21017
21017
|
/** Run the configured detector defensively: failures degrade to regex-only
|
|
21018
21018
|
* (fail-open on detection, not on protection) with a one-time warning. */
|
|
21019
|
-
async detectNerSpans(
|
|
21019
|
+
async detectNerSpans(text12) {
|
|
21020
21020
|
if (!this.nerDetector) return [];
|
|
21021
21021
|
try {
|
|
21022
|
-
return this.normalizeNerSpans(
|
|
21022
|
+
return this.normalizeNerSpans(text12, await this.nerDetector.detect(text12));
|
|
21023
21023
|
} catch (err) {
|
|
21024
21024
|
this.warnNerFailure(err);
|
|
21025
21025
|
return [];
|
|
@@ -21052,11 +21052,11 @@ var init_redactor = __esm({
|
|
|
21052
21052
|
* in pattern then document order, matching the sync scan's numbering). The
|
|
21053
21053
|
* string is then EMITTED in document order.
|
|
21054
21054
|
*/
|
|
21055
|
-
rebuildSpans(
|
|
21055
|
+
rebuildSpans(text12, spans, makeReplacement) {
|
|
21056
21056
|
const placeholderByStart = /* @__PURE__ */ new Map();
|
|
21057
21057
|
const matches = [];
|
|
21058
21058
|
for (const s of spans) {
|
|
21059
|
-
const value =
|
|
21059
|
+
const value = text12.slice(s.start, s.end);
|
|
21060
21060
|
const placeholder = makeReplacement(s.category, value);
|
|
21061
21061
|
placeholderByStart.set(s.start, placeholder);
|
|
21062
21062
|
matches.push({ category: s.category, original: value, placeholder });
|
|
@@ -21065,16 +21065,16 @@ var init_redactor = __esm({
|
|
|
21065
21065
|
let result = "";
|
|
21066
21066
|
let cursor = 0;
|
|
21067
21067
|
for (const s of emitOrder) {
|
|
21068
|
-
result +=
|
|
21068
|
+
result += text12.slice(cursor, s.start) + (placeholderByStart.get(s.start) ?? "");
|
|
21069
21069
|
cursor = s.end;
|
|
21070
21070
|
}
|
|
21071
|
-
result +=
|
|
21071
|
+
result += text12.slice(cursor);
|
|
21072
21072
|
return { text: result, matches };
|
|
21073
21073
|
}
|
|
21074
21074
|
/** Merge regex + NER spans for `text` into a resolved, non-overlapping set. */
|
|
21075
|
-
async detectAllSpans(
|
|
21076
|
-
const nerPromise = this.detectNerSpans(
|
|
21077
|
-
const regexSpans = this.collectRegexSpans(
|
|
21075
|
+
async detectAllSpans(text12) {
|
|
21076
|
+
const nerPromise = this.detectNerSpans(text12);
|
|
21077
|
+
const regexSpans = this.collectRegexSpans(text12);
|
|
21078
21078
|
const ner = await nerPromise;
|
|
21079
21079
|
return this.resolveOverlaps([...regexSpans, ...ner]);
|
|
21080
21080
|
}
|
|
@@ -21083,11 +21083,11 @@ var init_redactor = __esm({
|
|
|
21083
21083
|
* unstructured PII (the configured {@link NerDetector}) with numbered,
|
|
21084
21084
|
* reversible placeholders. With no detector, identical to `redactText`.
|
|
21085
21085
|
*/
|
|
21086
|
-
async redactTextAsync(
|
|
21087
|
-
if (!this.nerDetector) return this.redactText(
|
|
21088
|
-
const spans = await this.detectAllSpans(
|
|
21086
|
+
async redactTextAsync(text12) {
|
|
21087
|
+
if (!this.nerDetector) return this.redactText(text12);
|
|
21088
|
+
const spans = await this.detectAllSpans(text12);
|
|
21089
21089
|
return this.rebuildSpans(
|
|
21090
|
-
|
|
21090
|
+
text12,
|
|
21091
21091
|
spans,
|
|
21092
21092
|
(category, value) => this.getPlaceholder(category, value)
|
|
21093
21093
|
);
|
|
@@ -21096,10 +21096,10 @@ var init_redactor = __esm({
|
|
|
21096
21096
|
* Async counterpart to {@link maskText}: stateless `[CATEGORY]` masking over
|
|
21097
21097
|
* regex + NER matches. With no detector, identical to `maskText`.
|
|
21098
21098
|
*/
|
|
21099
|
-
async maskTextAsync(
|
|
21100
|
-
if (!this.nerDetector) return this.maskText(
|
|
21101
|
-
const spans = await this.detectAllSpans(
|
|
21102
|
-
return this.rebuildSpans(
|
|
21099
|
+
async maskTextAsync(text12) {
|
|
21100
|
+
if (!this.nerDetector) return this.maskText(text12);
|
|
21101
|
+
const spans = await this.detectAllSpans(text12);
|
|
21102
|
+
return this.rebuildSpans(text12, spans, (category) => `[${category}]`).text;
|
|
21103
21103
|
}
|
|
21104
21104
|
/**
|
|
21105
21105
|
* Async counterpart to {@link redactMessages}. Text parts are redacted
|
|
@@ -21185,9 +21185,9 @@ var init_redactor = __esm({
|
|
|
21185
21185
|
* {@link restoreForStorage} instead, which tolerates the mangled echoes the
|
|
21186
21186
|
* extraction models produce.
|
|
21187
21187
|
*/
|
|
21188
|
-
deAnonymize(
|
|
21189
|
-
if (!
|
|
21190
|
-
let restored =
|
|
21188
|
+
deAnonymize(text12) {
|
|
21189
|
+
if (!text12.includes("[")) return text12;
|
|
21190
|
+
let restored = text12;
|
|
21191
21191
|
for (const [placeholder, original] of this.placeholderToValue) {
|
|
21192
21192
|
if (restored.includes(placeholder)) {
|
|
21193
21193
|
restored = restored.split(placeholder).join(original);
|
|
@@ -21212,15 +21212,15 @@ var init_redactor = __esm({
|
|
|
21212
21212
|
* - `unresolved` is derived from the lookup miss during this pass, not from a
|
|
21213
21213
|
* regex re-scan of the output — so it can't trip over a restored value.
|
|
21214
21214
|
*/
|
|
21215
|
-
restoreForStorage(
|
|
21215
|
+
restoreForStorage(text12) {
|
|
21216
21216
|
if (this.storagePattern === void 0) this.storagePattern = this.buildStoragePattern();
|
|
21217
21217
|
if (!this.storagePattern || this.placeholderToValue.size === 0) {
|
|
21218
|
-
return { text:
|
|
21218
|
+
return { text: text12, unresolved: false };
|
|
21219
21219
|
}
|
|
21220
21220
|
this.storageLookup ?? (this.storageLookup = this.buildStorageLookup());
|
|
21221
21221
|
const { exact, ci, ciCollisions } = this.storageLookup;
|
|
21222
21222
|
let unresolved = false;
|
|
21223
|
-
const restored =
|
|
21223
|
+
const restored = text12.replace(
|
|
21224
21224
|
this.storagePattern,
|
|
21225
21225
|
(match, bracketed, bare) => {
|
|
21226
21226
|
const body = bracketed ?? bare ?? "";
|
|
@@ -21652,10 +21652,10 @@ __export(index_exports, {
|
|
|
21652
21652
|
module.exports = __toCommonJS(index_exports);
|
|
21653
21653
|
|
|
21654
21654
|
// src/lib/db/manager.ts
|
|
21655
|
-
var
|
|
21655
|
+
var import_watermelondb13 = __toESM(require_watermelondb());
|
|
21656
21656
|
|
|
21657
21657
|
// src/lib/db/schema.ts
|
|
21658
|
-
var
|
|
21658
|
+
var import_watermelondb12 = __toESM(require_watermelondb());
|
|
21659
21659
|
var import_migrations = __toESM(require_migrations());
|
|
21660
21660
|
|
|
21661
21661
|
// src/lib/db/appFiles/models.ts
|
|
@@ -21814,46 +21814,67 @@ __decorateClass([
|
|
|
21814
21814
|
(0, import_decorators2.date)("updated_at")
|
|
21815
21815
|
], ConversationSummary.prototype, "updatedAt", 2);
|
|
21816
21816
|
|
|
21817
|
-
// src/lib/db/
|
|
21817
|
+
// src/lib/db/conversationMemory/models.ts
|
|
21818
21818
|
var import_watermelondb3 = __toESM(require_watermelondb());
|
|
21819
21819
|
var import_decorators3 = __toESM(require_decorators());
|
|
21820
|
-
var
|
|
21820
|
+
var ConversationMemory = class extends import_watermelondb3.Model {
|
|
21821
|
+
};
|
|
21822
|
+
ConversationMemory.table = "conversation_memory";
|
|
21823
|
+
ConversationMemory.associations = {};
|
|
21824
|
+
__decorateClass([
|
|
21825
|
+
(0, import_decorators3.text)("conversation_id")
|
|
21826
|
+
], ConversationMemory.prototype, "conversationId", 2);
|
|
21827
|
+
__decorateClass([
|
|
21828
|
+
(0, import_decorators3.text)("memory_id")
|
|
21829
|
+
], ConversationMemory.prototype, "memoryId", 2);
|
|
21830
|
+
__decorateClass([
|
|
21831
|
+
(0, import_decorators3.field)("score")
|
|
21832
|
+
], ConversationMemory.prototype, "score", 2);
|
|
21833
|
+
__decorateClass([
|
|
21834
|
+
import_decorators3.readonly,
|
|
21835
|
+
(0, import_decorators3.date)("created_at")
|
|
21836
|
+
], ConversationMemory.prototype, "createdAt", 2);
|
|
21837
|
+
|
|
21838
|
+
// src/lib/db/entities/models.ts
|
|
21839
|
+
var import_watermelondb4 = __toESM(require_watermelondb());
|
|
21840
|
+
var import_decorators4 = __toESM(require_decorators());
|
|
21841
|
+
var Entity = class extends import_watermelondb4.Model {
|
|
21821
21842
|
};
|
|
21822
21843
|
Entity.table = "entity";
|
|
21823
21844
|
__decorateClass([
|
|
21824
|
-
(0,
|
|
21845
|
+
(0, import_decorators4.text)("canonical_name")
|
|
21825
21846
|
], Entity.prototype, "canonicalName", 2);
|
|
21826
21847
|
__decorateClass([
|
|
21827
|
-
(0,
|
|
21848
|
+
(0, import_decorators4.field)("kind")
|
|
21828
21849
|
], Entity.prototype, "kind", 2);
|
|
21829
21850
|
__decorateClass([
|
|
21830
|
-
|
|
21831
|
-
(0,
|
|
21851
|
+
import_decorators4.readonly,
|
|
21852
|
+
(0, import_decorators4.date)("created_at")
|
|
21832
21853
|
], Entity.prototype, "createdAt", 2);
|
|
21833
21854
|
__decorateClass([
|
|
21834
|
-
(0,
|
|
21855
|
+
(0, import_decorators4.date)("updated_at")
|
|
21835
21856
|
], Entity.prototype, "updatedAt", 2);
|
|
21836
|
-
var MemoryEntity = class extends
|
|
21857
|
+
var MemoryEntity = class extends import_watermelondb4.Model {
|
|
21837
21858
|
};
|
|
21838
21859
|
MemoryEntity.table = "memory_entity";
|
|
21839
21860
|
__decorateClass([
|
|
21840
|
-
(0,
|
|
21861
|
+
(0, import_decorators4.text)("memory_id")
|
|
21841
21862
|
], MemoryEntity.prototype, "memoryId", 2);
|
|
21842
21863
|
__decorateClass([
|
|
21843
|
-
(0,
|
|
21864
|
+
(0, import_decorators4.text)("entity_id")
|
|
21844
21865
|
], MemoryEntity.prototype, "entityId", 2);
|
|
21845
21866
|
__decorateClass([
|
|
21846
|
-
(0,
|
|
21867
|
+
(0, import_decorators4.field)("user_id")
|
|
21847
21868
|
], MemoryEntity.prototype, "userId", 2);
|
|
21848
21869
|
__decorateClass([
|
|
21849
|
-
|
|
21850
|
-
(0,
|
|
21870
|
+
import_decorators4.readonly,
|
|
21871
|
+
(0, import_decorators4.date)("created_at")
|
|
21851
21872
|
], MemoryEntity.prototype, "createdAt", 2);
|
|
21852
21873
|
|
|
21853
21874
|
// src/lib/db/media/models.ts
|
|
21854
|
-
var
|
|
21855
|
-
var
|
|
21856
|
-
var Media = class extends
|
|
21875
|
+
var import_watermelondb5 = __toESM(require_watermelondb());
|
|
21876
|
+
var import_decorators5 = __toESM(require_decorators());
|
|
21877
|
+
var Media = class extends import_watermelondb5.Model {
|
|
21857
21878
|
};
|
|
21858
21879
|
Media.table = "media";
|
|
21859
21880
|
Media.associations = {
|
|
@@ -21861,256 +21882,256 @@ Media.associations = {
|
|
|
21861
21882
|
conversations: { type: "belongs_to", key: "conversation_id" }
|
|
21862
21883
|
};
|
|
21863
21884
|
__decorateClass([
|
|
21864
|
-
(0,
|
|
21885
|
+
(0, import_decorators5.text)("media_id")
|
|
21865
21886
|
], Media.prototype, "mediaId", 2);
|
|
21866
21887
|
__decorateClass([
|
|
21867
|
-
(0,
|
|
21888
|
+
(0, import_decorators5.text)("wallet_address")
|
|
21868
21889
|
], Media.prototype, "walletAddress", 2);
|
|
21869
21890
|
__decorateClass([
|
|
21870
|
-
(0,
|
|
21891
|
+
(0, import_decorators5.text)("message_id")
|
|
21871
21892
|
], Media.prototype, "messageId", 2);
|
|
21872
21893
|
__decorateClass([
|
|
21873
|
-
(0,
|
|
21894
|
+
(0, import_decorators5.text)("conversation_id")
|
|
21874
21895
|
], Media.prototype, "conversationId", 2);
|
|
21875
21896
|
__decorateClass([
|
|
21876
|
-
(0,
|
|
21897
|
+
(0, import_decorators5.text)("name")
|
|
21877
21898
|
], Media.prototype, "name", 2);
|
|
21878
21899
|
__decorateClass([
|
|
21879
|
-
(0,
|
|
21900
|
+
(0, import_decorators5.text)("mime_type")
|
|
21880
21901
|
], Media.prototype, "mimeType", 2);
|
|
21881
21902
|
__decorateClass([
|
|
21882
|
-
(0,
|
|
21903
|
+
(0, import_decorators5.text)("media_type")
|
|
21883
21904
|
], Media.prototype, "mediaType", 2);
|
|
21884
21905
|
__decorateClass([
|
|
21885
|
-
(0,
|
|
21906
|
+
(0, import_decorators5.field)("size")
|
|
21886
21907
|
], Media.prototype, "size", 2);
|
|
21887
21908
|
__decorateClass([
|
|
21888
|
-
(0,
|
|
21909
|
+
(0, import_decorators5.text)("role")
|
|
21889
21910
|
], Media.prototype, "role", 2);
|
|
21890
21911
|
__decorateClass([
|
|
21891
|
-
(0,
|
|
21912
|
+
(0, import_decorators5.text)("model")
|
|
21892
21913
|
], Media.prototype, "model", 2);
|
|
21893
21914
|
__decorateClass([
|
|
21894
|
-
(0,
|
|
21915
|
+
(0, import_decorators5.text)("source_url")
|
|
21895
21916
|
], Media.prototype, "sourceUrl", 2);
|
|
21896
21917
|
__decorateClass([
|
|
21897
|
-
(0,
|
|
21918
|
+
(0, import_decorators5.json)("dimensions", (raw) => raw)
|
|
21898
21919
|
], Media.prototype, "dimensions", 2);
|
|
21899
21920
|
__decorateClass([
|
|
21900
|
-
(0,
|
|
21921
|
+
(0, import_decorators5.field)("duration")
|
|
21901
21922
|
], Media.prototype, "duration", 2);
|
|
21902
21923
|
__decorateClass([
|
|
21903
|
-
(0,
|
|
21924
|
+
(0, import_decorators5.json)("metadata", (raw) => raw)
|
|
21904
21925
|
], Media.prototype, "metadata", 2);
|
|
21905
21926
|
__decorateClass([
|
|
21906
|
-
|
|
21907
|
-
(0,
|
|
21927
|
+
import_decorators5.readonly,
|
|
21928
|
+
(0, import_decorators5.date)("created_at")
|
|
21908
21929
|
], Media.prototype, "createdAt", 2);
|
|
21909
21930
|
__decorateClass([
|
|
21910
|
-
(0,
|
|
21931
|
+
(0, import_decorators5.date)("updated_at")
|
|
21911
21932
|
], Media.prototype, "updatedAt", 2);
|
|
21912
21933
|
__decorateClass([
|
|
21913
|
-
(0,
|
|
21934
|
+
(0, import_decorators5.field)("is_deleted")
|
|
21914
21935
|
], Media.prototype, "isDeleted", 2);
|
|
21915
21936
|
|
|
21916
21937
|
// src/lib/db/memoryVault/models.ts
|
|
21917
|
-
var
|
|
21918
|
-
var
|
|
21919
|
-
var VaultMemory = class extends
|
|
21938
|
+
var import_watermelondb6 = __toESM(require_watermelondb());
|
|
21939
|
+
var import_decorators6 = __toESM(require_decorators());
|
|
21940
|
+
var VaultMemory = class extends import_watermelondb6.Model {
|
|
21920
21941
|
};
|
|
21921
21942
|
VaultMemory.table = "memory_vault";
|
|
21922
21943
|
__decorateClass([
|
|
21923
|
-
(0,
|
|
21944
|
+
(0, import_decorators6.text)("content")
|
|
21924
21945
|
], VaultMemory.prototype, "content", 2);
|
|
21925
21946
|
__decorateClass([
|
|
21926
|
-
(0,
|
|
21947
|
+
(0, import_decorators6.text)("scope")
|
|
21927
21948
|
], VaultMemory.prototype, "scope", 2);
|
|
21928
21949
|
__decorateClass([
|
|
21929
|
-
(0,
|
|
21950
|
+
(0, import_decorators6.field)("folder_id")
|
|
21930
21951
|
], VaultMemory.prototype, "folderId", 2);
|
|
21931
21952
|
__decorateClass([
|
|
21932
|
-
(0,
|
|
21953
|
+
(0, import_decorators6.field)("user_id")
|
|
21933
21954
|
], VaultMemory.prototype, "userId", 2);
|
|
21934
21955
|
__decorateClass([
|
|
21935
|
-
(0,
|
|
21956
|
+
(0, import_decorators6.field)("embedding")
|
|
21936
21957
|
], VaultMemory.prototype, "embedding", 2);
|
|
21937
21958
|
__decorateClass([
|
|
21938
|
-
(0,
|
|
21959
|
+
(0, import_decorators6.field)("embedding_model")
|
|
21939
21960
|
], VaultMemory.prototype, "embeddingModel", 2);
|
|
21940
21961
|
__decorateClass([
|
|
21941
|
-
(0,
|
|
21962
|
+
(0, import_decorators6.field)("source_chunk_ids")
|
|
21942
21963
|
], VaultMemory.prototype, "sourceChunkIds", 2);
|
|
21943
21964
|
__decorateClass([
|
|
21944
|
-
(0,
|
|
21965
|
+
(0, import_decorators6.field)("proof_count")
|
|
21945
21966
|
], VaultMemory.prototype, "proofCount", 2);
|
|
21946
21967
|
__decorateClass([
|
|
21947
|
-
(0,
|
|
21968
|
+
(0, import_decorators6.field)("source")
|
|
21948
21969
|
], VaultMemory.prototype, "source", 2);
|
|
21949
21970
|
__decorateClass([
|
|
21950
|
-
(0,
|
|
21971
|
+
(0, import_decorators6.field)("event_time_start")
|
|
21951
21972
|
], VaultMemory.prototype, "eventTimeStart", 2);
|
|
21952
21973
|
__decorateClass([
|
|
21953
|
-
(0,
|
|
21974
|
+
(0, import_decorators6.field)("event_time_end")
|
|
21954
21975
|
], VaultMemory.prototype, "eventTimeEnd", 2);
|
|
21955
21976
|
__decorateClass([
|
|
21956
|
-
(0,
|
|
21977
|
+
(0, import_decorators6.field)("event_time_kind")
|
|
21957
21978
|
], VaultMemory.prototype, "eventTimeKind", 2);
|
|
21958
21979
|
__decorateClass([
|
|
21959
|
-
(0,
|
|
21980
|
+
(0, import_decorators6.field)("topics_user_managed")
|
|
21960
21981
|
], VaultMemory.prototype, "topicsUserManaged", 2);
|
|
21961
21982
|
__decorateClass([
|
|
21962
|
-
|
|
21963
|
-
(0,
|
|
21983
|
+
import_decorators6.readonly,
|
|
21984
|
+
(0, import_decorators6.date)("created_at")
|
|
21964
21985
|
], VaultMemory.prototype, "createdAt", 2);
|
|
21965
21986
|
__decorateClass([
|
|
21966
|
-
(0,
|
|
21987
|
+
(0, import_decorators6.date)("updated_at")
|
|
21967
21988
|
], VaultMemory.prototype, "updatedAt", 2);
|
|
21968
21989
|
__decorateClass([
|
|
21969
|
-
(0,
|
|
21990
|
+
(0, import_decorators6.field)("is_deleted")
|
|
21970
21991
|
], VaultMemory.prototype, "isDeleted", 2);
|
|
21971
21992
|
|
|
21972
21993
|
// src/lib/db/project/models.ts
|
|
21973
|
-
var
|
|
21974
|
-
var
|
|
21975
|
-
var Project = class extends
|
|
21994
|
+
var import_watermelondb7 = __toESM(require_watermelondb());
|
|
21995
|
+
var import_decorators7 = __toESM(require_decorators());
|
|
21996
|
+
var Project = class extends import_watermelondb7.Model {
|
|
21976
21997
|
};
|
|
21977
21998
|
Project.table = "projects";
|
|
21978
21999
|
Project.associations = {
|
|
21979
22000
|
conversations: { type: "has_many", foreignKey: "project_id" }
|
|
21980
22001
|
};
|
|
21981
22002
|
__decorateClass([
|
|
21982
|
-
(0,
|
|
22003
|
+
(0, import_decorators7.text)("project_id")
|
|
21983
22004
|
], Project.prototype, "projectId", 2);
|
|
21984
22005
|
__decorateClass([
|
|
21985
|
-
(0,
|
|
22006
|
+
(0, import_decorators7.text)("name")
|
|
21986
22007
|
], Project.prototype, "name", 2);
|
|
21987
22008
|
__decorateClass([
|
|
21988
|
-
(0,
|
|
22009
|
+
(0, import_decorators7.date)("created_at")
|
|
21989
22010
|
], Project.prototype, "createdAt", 2);
|
|
21990
22011
|
__decorateClass([
|
|
21991
|
-
(0,
|
|
22012
|
+
(0, import_decorators7.date)("updated_at")
|
|
21992
22013
|
], Project.prototype, "updatedAt", 2);
|
|
21993
22014
|
__decorateClass([
|
|
21994
|
-
(0,
|
|
22015
|
+
(0, import_decorators7.field)("is_deleted")
|
|
21995
22016
|
], Project.prototype, "isDeleted", 2);
|
|
21996
22017
|
|
|
21997
22018
|
// src/lib/db/savedTools/models.ts
|
|
21998
|
-
var
|
|
21999
|
-
var
|
|
22019
|
+
var import_watermelondb8 = __toESM(require_watermelondb());
|
|
22020
|
+
var import_decorators8 = __toESM(require_decorators());
|
|
22000
22021
|
var sanitizeParameters = (raw) => raw ?? {};
|
|
22001
|
-
var SavedTool = class extends
|
|
22022
|
+
var SavedTool = class extends import_watermelondb8.Model {
|
|
22002
22023
|
};
|
|
22003
22024
|
SavedTool.table = "saved_tools";
|
|
22004
22025
|
SavedTool.associations = {};
|
|
22005
22026
|
__decorateClass([
|
|
22006
|
-
(0,
|
|
22027
|
+
(0, import_decorators8.text)("name")
|
|
22007
22028
|
], SavedTool.prototype, "name", 2);
|
|
22008
22029
|
__decorateClass([
|
|
22009
|
-
(0,
|
|
22030
|
+
(0, import_decorators8.text)("display_name")
|
|
22010
22031
|
], SavedTool.prototype, "displayName", 2);
|
|
22011
22032
|
__decorateClass([
|
|
22012
|
-
(0,
|
|
22033
|
+
(0, import_decorators8.text)("description")
|
|
22013
22034
|
], SavedTool.prototype, "description", 2);
|
|
22014
22035
|
__decorateClass([
|
|
22015
|
-
(0,
|
|
22036
|
+
(0, import_decorators8.json)("parameters", sanitizeParameters)
|
|
22016
22037
|
], SavedTool.prototype, "parameters", 2);
|
|
22017
22038
|
__decorateClass([
|
|
22018
|
-
(0,
|
|
22039
|
+
(0, import_decorators8.text)("html")
|
|
22019
22040
|
], SavedTool.prototype, "html", 2);
|
|
22020
22041
|
__decorateClass([
|
|
22021
|
-
(0,
|
|
22042
|
+
(0, import_decorators8.text)("conversation_id")
|
|
22022
22043
|
], SavedTool.prototype, "conversationId", 2);
|
|
22023
22044
|
__decorateClass([
|
|
22024
|
-
|
|
22025
|
-
(0,
|
|
22045
|
+
import_decorators8.readonly,
|
|
22046
|
+
(0, import_decorators8.date)("created_at")
|
|
22026
22047
|
], SavedTool.prototype, "createdAt", 2);
|
|
22027
22048
|
__decorateClass([
|
|
22028
|
-
(0,
|
|
22049
|
+
(0, import_decorators8.date)("updated_at")
|
|
22029
22050
|
], SavedTool.prototype, "updatedAt", 2);
|
|
22030
22051
|
__decorateClass([
|
|
22031
|
-
(0,
|
|
22052
|
+
(0, import_decorators8.field)("is_deleted")
|
|
22032
22053
|
], SavedTool.prototype, "isDeleted", 2);
|
|
22033
22054
|
|
|
22034
22055
|
// src/lib/db/settings/models.ts
|
|
22035
|
-
var
|
|
22036
|
-
var
|
|
22037
|
-
var ModelPreference = class extends
|
|
22056
|
+
var import_watermelondb9 = __toESM(require_watermelondb());
|
|
22057
|
+
var import_decorators9 = __toESM(require_decorators());
|
|
22058
|
+
var ModelPreference = class extends import_watermelondb9.Model {
|
|
22038
22059
|
};
|
|
22039
22060
|
ModelPreference.table = "modelPreferences";
|
|
22040
22061
|
__decorateClass([
|
|
22041
|
-
(0,
|
|
22062
|
+
(0, import_decorators9.text)("wallet_address")
|
|
22042
22063
|
], ModelPreference.prototype, "walletAddress", 2);
|
|
22043
22064
|
__decorateClass([
|
|
22044
|
-
(0,
|
|
22065
|
+
(0, import_decorators9.text)("models")
|
|
22045
22066
|
], ModelPreference.prototype, "models", 2);
|
|
22046
22067
|
|
|
22047
22068
|
// src/lib/db/userPreferences/models.ts
|
|
22048
|
-
var
|
|
22049
|
-
var
|
|
22050
|
-
var UserPreference = class extends
|
|
22069
|
+
var import_watermelondb10 = __toESM(require_watermelondb());
|
|
22070
|
+
var import_decorators10 = __toESM(require_decorators());
|
|
22071
|
+
var UserPreference = class extends import_watermelondb10.Model {
|
|
22051
22072
|
};
|
|
22052
22073
|
UserPreference.table = "userPreferences";
|
|
22053
22074
|
__decorateClass([
|
|
22054
|
-
(0,
|
|
22075
|
+
(0, import_decorators10.text)("wallet_address")
|
|
22055
22076
|
], UserPreference.prototype, "walletAddress", 2);
|
|
22056
22077
|
__decorateClass([
|
|
22057
|
-
(0,
|
|
22078
|
+
(0, import_decorators10.text)("nickname")
|
|
22058
22079
|
], UserPreference.prototype, "nickname", 2);
|
|
22059
22080
|
__decorateClass([
|
|
22060
|
-
(0,
|
|
22081
|
+
(0, import_decorators10.text)("occupation")
|
|
22061
22082
|
], UserPreference.prototype, "occupation", 2);
|
|
22062
22083
|
__decorateClass([
|
|
22063
|
-
(0,
|
|
22084
|
+
(0, import_decorators10.text)("description")
|
|
22064
22085
|
], UserPreference.prototype, "description", 2);
|
|
22065
22086
|
__decorateClass([
|
|
22066
|
-
(0,
|
|
22087
|
+
(0, import_decorators10.text)("models")
|
|
22067
22088
|
], UserPreference.prototype, "models", 2);
|
|
22068
22089
|
__decorateClass([
|
|
22069
|
-
(0,
|
|
22090
|
+
(0, import_decorators10.text)("personality")
|
|
22070
22091
|
], UserPreference.prototype, "personality", 2);
|
|
22071
22092
|
__decorateClass([
|
|
22072
|
-
(0,
|
|
22093
|
+
(0, import_decorators10.field)("created_at")
|
|
22073
22094
|
], UserPreference.prototype, "createdAt", 2);
|
|
22074
22095
|
__decorateClass([
|
|
22075
|
-
(0,
|
|
22096
|
+
(0, import_decorators10.field)("updated_at")
|
|
22076
22097
|
], UserPreference.prototype, "updatedAt", 2);
|
|
22077
22098
|
|
|
22078
22099
|
// src/lib/db/vaultFolders/models.ts
|
|
22079
|
-
var
|
|
22080
|
-
var
|
|
22081
|
-
var VaultFolder = class extends
|
|
22100
|
+
var import_watermelondb11 = __toESM(require_watermelondb());
|
|
22101
|
+
var import_decorators11 = __toESM(require_decorators());
|
|
22102
|
+
var VaultFolder = class extends import_watermelondb11.Model {
|
|
22082
22103
|
};
|
|
22083
22104
|
VaultFolder.table = "vault_folders";
|
|
22084
22105
|
__decorateClass([
|
|
22085
|
-
(0,
|
|
22106
|
+
(0, import_decorators11.text)("name")
|
|
22086
22107
|
], VaultFolder.prototype, "name", 2);
|
|
22087
22108
|
__decorateClass([
|
|
22088
|
-
(0,
|
|
22109
|
+
(0, import_decorators11.text)("scope")
|
|
22089
22110
|
], VaultFolder.prototype, "scope", 2);
|
|
22090
22111
|
__decorateClass([
|
|
22091
|
-
|
|
22092
|
-
(0,
|
|
22112
|
+
import_decorators11.readonly,
|
|
22113
|
+
(0, import_decorators11.date)("created_at")
|
|
22093
22114
|
], VaultFolder.prototype, "createdAt", 2);
|
|
22094
22115
|
__decorateClass([
|
|
22095
|
-
(0,
|
|
22116
|
+
(0, import_decorators11.date)("updated_at")
|
|
22096
22117
|
], VaultFolder.prototype, "updatedAt", 2);
|
|
22097
22118
|
__decorateClass([
|
|
22098
|
-
(0,
|
|
22119
|
+
(0, import_decorators11.field)("is_deleted")
|
|
22099
22120
|
], VaultFolder.prototype, "isDeleted", 2);
|
|
22100
22121
|
__decorateClass([
|
|
22101
|
-
(0,
|
|
22122
|
+
(0, import_decorators11.field)("is_system")
|
|
22102
22123
|
], VaultFolder.prototype, "isSystem", 2);
|
|
22103
22124
|
__decorateClass([
|
|
22104
|
-
(0,
|
|
22125
|
+
(0, import_decorators11.text)("context")
|
|
22105
22126
|
], VaultFolder.prototype, "context", 2);
|
|
22106
22127
|
|
|
22107
22128
|
// src/lib/db/schema.ts
|
|
22108
|
-
var SDK_SCHEMA_VERSION =
|
|
22109
|
-
var sdkSchema = (0,
|
|
22129
|
+
var SDK_SCHEMA_VERSION = 35;
|
|
22130
|
+
var sdkSchema = (0, import_watermelondb12.appSchema)({
|
|
22110
22131
|
version: SDK_SCHEMA_VERSION,
|
|
22111
22132
|
tables: [
|
|
22112
22133
|
// Chat storage tables
|
|
22113
|
-
(0,
|
|
22134
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22114
22135
|
name: "history",
|
|
22115
22136
|
columns: [
|
|
22116
22137
|
{ name: "message_id", type: "number" },
|
|
@@ -22147,7 +22168,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22147
22168
|
// JSON stringified LlmapiToolCallEvent[]
|
|
22148
22169
|
]
|
|
22149
22170
|
}),
|
|
22150
|
-
(0,
|
|
22171
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22151
22172
|
name: "conversations",
|
|
22152
22173
|
columns: [
|
|
22153
22174
|
{ name: "conversation_id", type: "string", isIndexed: true },
|
|
@@ -22160,7 +22181,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22160
22181
|
]
|
|
22161
22182
|
}),
|
|
22162
22183
|
// Project storage table
|
|
22163
|
-
(0,
|
|
22184
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22164
22185
|
name: "projects",
|
|
22165
22186
|
columns: [
|
|
22166
22187
|
{ name: "project_id", type: "string", isIndexed: true },
|
|
@@ -22171,7 +22192,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22171
22192
|
]
|
|
22172
22193
|
}),
|
|
22173
22194
|
// Settings storage tables (deprecated - use userPreferences)
|
|
22174
|
-
(0,
|
|
22195
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22175
22196
|
name: "modelPreferences",
|
|
22176
22197
|
columns: [
|
|
22177
22198
|
{ name: "wallet_address", type: "string", isIndexed: true },
|
|
@@ -22179,7 +22200,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22179
22200
|
]
|
|
22180
22201
|
}),
|
|
22181
22202
|
// Unified user preferences storage
|
|
22182
|
-
(0,
|
|
22203
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22183
22204
|
name: "userPreferences",
|
|
22184
22205
|
columns: [
|
|
22185
22206
|
// Identity
|
|
@@ -22198,7 +22219,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22198
22219
|
]
|
|
22199
22220
|
}),
|
|
22200
22221
|
// Memory vault storage
|
|
22201
|
-
(0,
|
|
22222
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22202
22223
|
name: "memory_vault",
|
|
22203
22224
|
columns: [
|
|
22204
22225
|
{ name: "content", type: "string" },
|
|
@@ -22230,7 +22251,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22230
22251
|
]
|
|
22231
22252
|
}),
|
|
22232
22253
|
// Entity table — canonical names extracted from auto-extraction (W5).
|
|
22233
|
-
(0,
|
|
22254
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22234
22255
|
name: "entity",
|
|
22235
22256
|
columns: [
|
|
22236
22257
|
{ name: "canonical_name", type: "string", isIndexed: true },
|
|
@@ -22240,7 +22261,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22240
22261
|
]
|
|
22241
22262
|
}),
|
|
22242
22263
|
// Many-to-many join: which memories reference which entities.
|
|
22243
|
-
(0,
|
|
22264
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22244
22265
|
name: "memory_entity",
|
|
22245
22266
|
columns: [
|
|
22246
22267
|
{ name: "memory_id", type: "string", isIndexed: true },
|
|
@@ -22250,7 +22271,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22250
22271
|
]
|
|
22251
22272
|
}),
|
|
22252
22273
|
// Vault folder organization
|
|
22253
|
-
(0,
|
|
22274
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22254
22275
|
name: "vault_folders",
|
|
22255
22276
|
columns: [
|
|
22256
22277
|
{ name: "name", type: "string" },
|
|
@@ -22263,7 +22284,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22263
22284
|
]
|
|
22264
22285
|
}),
|
|
22265
22286
|
// Conversation summary cache for progressive history summarization
|
|
22266
|
-
(0,
|
|
22287
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22267
22288
|
name: "conversation_summaries",
|
|
22268
22289
|
columns: [
|
|
22269
22290
|
{ name: "conversation_id", type: "string", isIndexed: true },
|
|
@@ -22276,7 +22297,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22276
22297
|
]
|
|
22277
22298
|
}),
|
|
22278
22299
|
// Media library storage (images, videos, audio, documents)
|
|
22279
|
-
(0,
|
|
22300
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22280
22301
|
name: "media",
|
|
22281
22302
|
columns: [
|
|
22282
22303
|
// Identity
|
|
@@ -22312,7 +22333,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22312
22333
|
]
|
|
22313
22334
|
}),
|
|
22314
22335
|
// ── App files ─────────────────────────────────────────────────────────
|
|
22315
|
-
(0,
|
|
22336
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22316
22337
|
name: "app_files",
|
|
22317
22338
|
columns: [
|
|
22318
22339
|
{ name: "conversation_id", type: "string", isIndexed: true },
|
|
@@ -22323,7 +22344,7 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22323
22344
|
]
|
|
22324
22345
|
}),
|
|
22325
22346
|
// ── Saved tools ──────────────────────────────────────────────────────
|
|
22326
|
-
(0,
|
|
22347
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22327
22348
|
name: "saved_tools",
|
|
22328
22349
|
columns: [
|
|
22329
22350
|
{ name: "name", type: "string" },
|
|
@@ -22337,6 +22358,16 @@ var sdkSchema = (0, import_watermelondb11.appSchema)({
|
|
|
22337
22358
|
{ name: "updated_at", type: "number" },
|
|
22338
22359
|
{ name: "is_deleted", type: "boolean", isIndexed: true }
|
|
22339
22360
|
]
|
|
22361
|
+
}),
|
|
22362
|
+
// ── Conversation memories (panel persistence) ────────────────────────
|
|
22363
|
+
(0, import_watermelondb12.tableSchema)({
|
|
22364
|
+
name: "conversation_memory",
|
|
22365
|
+
columns: [
|
|
22366
|
+
{ name: "conversation_id", type: "string", isIndexed: true },
|
|
22367
|
+
{ name: "memory_id", type: "string", isIndexed: true },
|
|
22368
|
+
{ name: "score", type: "number" },
|
|
22369
|
+
{ name: "created_at", type: "number", isIndexed: true }
|
|
22370
|
+
]
|
|
22340
22371
|
})
|
|
22341
22372
|
]
|
|
22342
22373
|
});
|
|
@@ -22797,6 +22828,23 @@ var sdkMigrations = (0, import_migrations.schemaMigrations)({
|
|
|
22797
22828
|
columns: [{ name: "topics_user_managed", type: "boolean", isOptional: true }]
|
|
22798
22829
|
})
|
|
22799
22830
|
]
|
|
22831
|
+
},
|
|
22832
|
+
// v34 -> v35: conversation_memory table. Records which vault memories a
|
|
22833
|
+
// conversation drew on (ids + score only) so the conversation-level Memories
|
|
22834
|
+
// panel survives reload. Additive create — no existing data touched.
|
|
22835
|
+
{
|
|
22836
|
+
toVersion: 35,
|
|
22837
|
+
steps: [
|
|
22838
|
+
(0, import_migrations.createTable)({
|
|
22839
|
+
name: "conversation_memory",
|
|
22840
|
+
columns: [
|
|
22841
|
+
{ name: "conversation_id", type: "string", isIndexed: true },
|
|
22842
|
+
{ name: "memory_id", type: "string", isIndexed: true },
|
|
22843
|
+
{ name: "score", type: "number" },
|
|
22844
|
+
{ name: "created_at", type: "number", isIndexed: true }
|
|
22845
|
+
]
|
|
22846
|
+
})
|
|
22847
|
+
]
|
|
22800
22848
|
}
|
|
22801
22849
|
]
|
|
22802
22850
|
});
|
|
@@ -22813,7 +22861,8 @@ var sdkModelClasses = [
|
|
|
22813
22861
|
ModelPreference,
|
|
22814
22862
|
UserPreference,
|
|
22815
22863
|
SavedTool,
|
|
22816
|
-
AppFile
|
|
22864
|
+
AppFile,
|
|
22865
|
+
ConversationMemory
|
|
22817
22866
|
];
|
|
22818
22867
|
|
|
22819
22868
|
// src/lib/db/manager.ts
|
|
@@ -22844,8 +22893,18 @@ function getMigrationReloadKey(prefix, walletAddress) {
|
|
|
22844
22893
|
}
|
|
22845
22894
|
var DatabaseManager = class {
|
|
22846
22895
|
constructor(options) {
|
|
22847
|
-
|
|
22848
|
-
|
|
22896
|
+
/**
|
|
22897
|
+
* WatermelonDB instances cached by their derived `dbName` (not by raw wallet
|
|
22898
|
+
* address). Caching per dbName makes {@link getDatabase} idempotent: a wallet
|
|
22899
|
+
* that is requested again — including after a transient `undefined`/guest
|
|
22900
|
+
* excursion or an address that briefly arrives in a different form during
|
|
22901
|
+
* sign-up — reuses the SAME instance instead of being torn down and rebuilt.
|
|
22902
|
+
* The rebuild was what left the web OPFS adapter disposed/orphaned mid-session
|
|
22903
|
+
* (client#4821). Instances are kept for the lifetime of the manager (typically
|
|
22904
|
+
* guest + one wallet); switching wallets keeps prior ones cached rather than
|
|
22905
|
+
* disposing an instance the app may still hold a reference to.
|
|
22906
|
+
*/
|
|
22907
|
+
this.databases = /* @__PURE__ */ new Map();
|
|
22849
22908
|
this.migrationInProgress = false;
|
|
22850
22909
|
this.dbNamePrefix = options.dbNamePrefix;
|
|
22851
22910
|
this.createAdapter = options.createAdapter;
|
|
@@ -22862,8 +22921,9 @@ var DatabaseManager = class {
|
|
|
22862
22921
|
/**
|
|
22863
22922
|
* Get or create a WatermelonDB Database instance for the given wallet.
|
|
22864
22923
|
*
|
|
22865
|
-
*
|
|
22866
|
-
*
|
|
22924
|
+
* Instances are cached per derived dbName and reused across calls (including
|
|
22925
|
+
* repeat/guest-interleaved requests for the same wallet); a new one is built
|
|
22926
|
+
* only for a dbName not yet seen. See the `databases` field for why.
|
|
22867
22927
|
*
|
|
22868
22928
|
* @param walletAddress - The wallet address to scope the database to.
|
|
22869
22929
|
* If undefined, uses a "guest" database.
|
|
@@ -22871,46 +22931,47 @@ var DatabaseManager = class {
|
|
|
22871
22931
|
* @throws If a destructive migration is in progress
|
|
22872
22932
|
*/
|
|
22873
22933
|
getDatabase(walletAddress) {
|
|
22874
|
-
|
|
22875
|
-
|
|
22876
|
-
|
|
22877
|
-
|
|
22878
|
-
to: walletAddress
|
|
22879
|
-
});
|
|
22880
|
-
this.database = null;
|
|
22881
|
-
}
|
|
22882
|
-
if (this.database) {
|
|
22883
|
-
return this.database;
|
|
22934
|
+
const dbName = this.getDbName(walletAddress);
|
|
22935
|
+
const cached = this.databases.get(dbName);
|
|
22936
|
+
if (cached) {
|
|
22937
|
+
return cached;
|
|
22884
22938
|
}
|
|
22885
22939
|
const needsMigration = this.handleSchemaMigration(walletAddress);
|
|
22886
22940
|
if (needsMigration) {
|
|
22887
22941
|
throw new Error("Database migration in progress - app will restart");
|
|
22888
22942
|
}
|
|
22889
|
-
this.currentWalletAddress = walletAddress;
|
|
22890
|
-
const dbName = this.getDbName(walletAddress);
|
|
22891
22943
|
this.logger.debug?.("Initializing database", {
|
|
22892
22944
|
component: "DatabaseManager",
|
|
22893
22945
|
dbName,
|
|
22894
22946
|
walletAddress
|
|
22895
22947
|
});
|
|
22896
22948
|
const adapter = this.createAdapter(dbName, sdkSchema, sdkMigrations);
|
|
22897
|
-
|
|
22949
|
+
const database = new import_watermelondb13.Database({
|
|
22898
22950
|
adapter,
|
|
22899
22951
|
modelClasses: sdkModelClasses
|
|
22900
22952
|
});
|
|
22901
|
-
|
|
22953
|
+
this.databases.set(dbName, database);
|
|
22954
|
+
return database;
|
|
22902
22955
|
}
|
|
22903
22956
|
/**
|
|
22904
|
-
* Reset
|
|
22957
|
+
* Reset ALL cached databases (useful for logout or testing).
|
|
22905
22958
|
*/
|
|
22906
22959
|
async resetDatabase() {
|
|
22907
|
-
const
|
|
22908
|
-
|
|
22909
|
-
|
|
22910
|
-
await db.
|
|
22911
|
-
|
|
22912
|
-
|
|
22913
|
-
|
|
22960
|
+
const errors = [];
|
|
22961
|
+
for (const [dbName, db] of [...this.databases.entries()]) {
|
|
22962
|
+
try {
|
|
22963
|
+
await db.write(async () => {
|
|
22964
|
+
await db.unsafeResetDatabase();
|
|
22965
|
+
});
|
|
22966
|
+
this.databases.delete(dbName);
|
|
22967
|
+
} catch (error) {
|
|
22968
|
+
errors.push({ dbName, error });
|
|
22969
|
+
}
|
|
22970
|
+
}
|
|
22971
|
+
if (errors.length > 0) {
|
|
22972
|
+
throw new Error(
|
|
22973
|
+
`Failed to reset ${errors.length} database(s): ${errors.map((e) => e.dbName).join(", ")}`
|
|
22974
|
+
);
|
|
22914
22975
|
}
|
|
22915
22976
|
}
|
|
22916
22977
|
/**
|
|
@@ -23618,7 +23679,7 @@ async function decryptConversationTitle(encryptedTitle, address) {
|
|
|
23618
23679
|
init_operations();
|
|
23619
23680
|
|
|
23620
23681
|
// src/lib/db/chat/summaryOperations.ts
|
|
23621
|
-
var
|
|
23682
|
+
var import_watermelondb15 = __toESM(require_watermelondb());
|
|
23622
23683
|
function createSummaryContext(database) {
|
|
23623
23684
|
return {
|
|
23624
23685
|
database,
|
|
@@ -23637,14 +23698,14 @@ function modelToStored(record) {
|
|
|
23637
23698
|
};
|
|
23638
23699
|
}
|
|
23639
23700
|
async function getConversationSummaryOp(ctx, conversationId) {
|
|
23640
|
-
const results = await ctx.summariesCollection.query(
|
|
23701
|
+
const results = await ctx.summariesCollection.query(import_watermelondb15.Q.where("conversation_id", conversationId)).fetch();
|
|
23641
23702
|
if (results.length === 0) return null;
|
|
23642
23703
|
return modelToStored(results[0]);
|
|
23643
23704
|
}
|
|
23644
23705
|
async function upsertConversationSummaryOp(ctx, conversationId, summary, summarizedUpTo, tokenCount) {
|
|
23645
23706
|
let record;
|
|
23646
23707
|
await ctx.database.write(async () => {
|
|
23647
|
-
const existing = await ctx.summariesCollection.query(
|
|
23708
|
+
const existing = await ctx.summariesCollection.query(import_watermelondb15.Q.where("conversation_id", conversationId)).fetch();
|
|
23648
23709
|
if (existing.length > 0) {
|
|
23649
23710
|
record = await existing[0].update((rec) => {
|
|
23650
23711
|
rec.summary = summary;
|
|
@@ -23664,7 +23725,7 @@ async function upsertConversationSummaryOp(ctx, conversationId, summary, summari
|
|
|
23664
23725
|
}
|
|
23665
23726
|
async function deleteConversationSummaryOp(ctx, conversationId) {
|
|
23666
23727
|
await ctx.database.write(async () => {
|
|
23667
|
-
const existing = await ctx.summariesCollection.query(
|
|
23728
|
+
const existing = await ctx.summariesCollection.query(import_watermelondb15.Q.where("conversation_id", conversationId)).fetch();
|
|
23668
23729
|
for (const record of existing) {
|
|
23669
23730
|
await record.destroyPermanently();
|
|
23670
23731
|
}
|
|
@@ -23701,9 +23762,9 @@ New lines of conversation:
|
|
|
23701
23762
|
{new_lines}
|
|
23702
23763
|
|
|
23703
23764
|
New summary:`;
|
|
23704
|
-
function estimateTokens(
|
|
23705
|
-
if (!
|
|
23706
|
-
return Math.ceil(
|
|
23765
|
+
function estimateTokens(text12) {
|
|
23766
|
+
if (!text12) return 0;
|
|
23767
|
+
return Math.ceil(text12.length / 4);
|
|
23707
23768
|
}
|
|
23708
23769
|
var PER_MESSAGE_OVERHEAD_TOKENS = 4;
|
|
23709
23770
|
var MAX_MESSAGES_PER_SUMMARIZATION = 20;
|
|
@@ -23763,14 +23824,14 @@ function splitMessagesAtThreshold(messages, tokenThreshold, minWindowMessages) {
|
|
|
23763
23824
|
}
|
|
23764
23825
|
async function redactSummaryPrompt(prompt, redactor, onPiiRedacted) {
|
|
23765
23826
|
if (!redactor) return prompt;
|
|
23766
|
-
const { text:
|
|
23827
|
+
const { text: text12, matches } = await redactor.redactTextAsync(prompt);
|
|
23767
23828
|
if (matches.length > 0 && onPiiRedacted) {
|
|
23768
23829
|
try {
|
|
23769
23830
|
onPiiRedacted(matches);
|
|
23770
23831
|
} catch {
|
|
23771
23832
|
}
|
|
23772
23833
|
}
|
|
23773
|
-
return
|
|
23834
|
+
return text12;
|
|
23774
23835
|
}
|
|
23775
23836
|
async function progressiveSummarize(options) {
|
|
23776
23837
|
const {
|
|
@@ -24076,7 +24137,7 @@ async function cleanupConversationSummary(database, conversationId) {
|
|
|
24076
24137
|
init_operations3();
|
|
24077
24138
|
|
|
24078
24139
|
// src/lib/db/vaultFolders/operations.ts
|
|
24079
|
-
var
|
|
24140
|
+
var import_watermelondb18 = __toESM(require_watermelondb());
|
|
24080
24141
|
function folderToStored(folder) {
|
|
24081
24142
|
return {
|
|
24082
24143
|
uniqueId: folder.id,
|
|
@@ -24101,7 +24162,7 @@ async function createVaultFolderOp(ctx, opts) {
|
|
|
24101
24162
|
return folderToStored(created);
|
|
24102
24163
|
}
|
|
24103
24164
|
async function getAllVaultFoldersOp(ctx) {
|
|
24104
|
-
const results = await ctx.vaultFolderCollection.query(
|
|
24165
|
+
const results = await ctx.vaultFolderCollection.query(import_watermelondb18.Q.where("is_deleted", false), import_watermelondb18.Q.sortBy("created_at", import_watermelondb18.Q.desc)).fetch();
|
|
24105
24166
|
return results.map(folderToStored);
|
|
24106
24167
|
}
|
|
24107
24168
|
async function updateVaultFolderOp(ctx, id, opts) {
|
|
@@ -24118,7 +24179,7 @@ async function updateVaultFolderOp(ctx, id, opts) {
|
|
|
24118
24179
|
})
|
|
24119
24180
|
);
|
|
24120
24181
|
if (scopeChanged) {
|
|
24121
|
-
const memories = await ctx.vaultMemoryCollection.query(
|
|
24182
|
+
const memories = await ctx.vaultMemoryCollection.query(import_watermelondb18.Q.where("folder_id", id), import_watermelondb18.Q.where("is_deleted", false)).fetch();
|
|
24122
24183
|
for (const memory of memories) {
|
|
24123
24184
|
updates.push(
|
|
24124
24185
|
memory.prepareUpdate((r) => {
|
|
@@ -24140,7 +24201,7 @@ async function deleteVaultFolderOp(ctx, id) {
|
|
|
24140
24201
|
const record = await ctx.vaultFolderCollection.find(id);
|
|
24141
24202
|
if (record.isDeleted) return false;
|
|
24142
24203
|
await ctx.database.write(async () => {
|
|
24143
|
-
const memories = await ctx.vaultMemoryCollection.query(
|
|
24204
|
+
const memories = await ctx.vaultMemoryCollection.query(import_watermelondb18.Q.where("folder_id", id), import_watermelondb18.Q.where("is_deleted", false)).fetch();
|
|
24144
24205
|
const preparedMemories = memories.map(
|
|
24145
24206
|
(memory) => memory.prepareUpdate((r) => {
|
|
24146
24207
|
r._setRaw("folder_id", null);
|
|
@@ -24209,7 +24270,7 @@ async function updateVaultFolderContextOp(ctx, id, context) {
|
|
|
24209
24270
|
}
|
|
24210
24271
|
}
|
|
24211
24272
|
async function getVaultFolderMemoryCountOp(ctx, folderId) {
|
|
24212
|
-
return await ctx.vaultMemoryCollection.query(
|
|
24273
|
+
return await ctx.vaultMemoryCollection.query(import_watermelondb18.Q.where("folder_id", folderId), import_watermelondb18.Q.where("is_deleted", false)).fetchCount();
|
|
24213
24274
|
}
|
|
24214
24275
|
|
|
24215
24276
|
// src/lib/db/vaultFolders/defaults.ts
|
|
@@ -24252,7 +24313,7 @@ async function _ensureDefaultFoldersImpl(ctx) {
|
|
|
24252
24313
|
}
|
|
24253
24314
|
|
|
24254
24315
|
// src/lib/db/project/operations.ts
|
|
24255
|
-
var
|
|
24316
|
+
var import_watermelondb19 = __toESM(require_watermelondb());
|
|
24256
24317
|
init_operations();
|
|
24257
24318
|
|
|
24258
24319
|
// src/lib/db/project/types.ts
|
|
@@ -24284,15 +24345,15 @@ async function createProjectOp(ctx, opts, defaultName = "New Project") {
|
|
|
24284
24345
|
return projectToStored(created);
|
|
24285
24346
|
}
|
|
24286
24347
|
async function getProjectOp(ctx, id) {
|
|
24287
|
-
const results = await ctx.projectsCollection.query(
|
|
24348
|
+
const results = await ctx.projectsCollection.query(import_watermelondb19.Q.where("project_id", id), import_watermelondb19.Q.where("is_deleted", false)).fetch();
|
|
24288
24349
|
return results.length > 0 ? projectToStored(results[0]) : null;
|
|
24289
24350
|
}
|
|
24290
24351
|
async function getProjectsOp(ctx) {
|
|
24291
|
-
const results = await ctx.projectsCollection.query(
|
|
24352
|
+
const results = await ctx.projectsCollection.query(import_watermelondb19.Q.where("is_deleted", false), import_watermelondb19.Q.sortBy("created_at", import_watermelondb19.Q.desc)).fetch();
|
|
24292
24353
|
return results.map(projectToStored);
|
|
24293
24354
|
}
|
|
24294
24355
|
async function updateProjectNameOp(ctx, id, name) {
|
|
24295
|
-
const results = await ctx.projectsCollection.query(
|
|
24356
|
+
const results = await ctx.projectsCollection.query(import_watermelondb19.Q.where("project_id", id), import_watermelondb19.Q.where("is_deleted", false)).fetch();
|
|
24296
24357
|
if (results.length > 0) {
|
|
24297
24358
|
await ctx.database.write(async () => {
|
|
24298
24359
|
await results[0].update((proj) => {
|
|
@@ -24304,7 +24365,7 @@ async function updateProjectNameOp(ctx, id, name) {
|
|
|
24304
24365
|
return false;
|
|
24305
24366
|
}
|
|
24306
24367
|
async function updateProjectOp(ctx, id, opts) {
|
|
24307
|
-
const results = await ctx.projectsCollection.query(
|
|
24368
|
+
const results = await ctx.projectsCollection.query(import_watermelondb19.Q.where("project_id", id), import_watermelondb19.Q.where("is_deleted", false)).fetch();
|
|
24308
24369
|
if (results.length > 0) {
|
|
24309
24370
|
await ctx.database.write(async () => {
|
|
24310
24371
|
await results[0].update((proj) => {
|
|
@@ -24316,7 +24377,7 @@ async function updateProjectOp(ctx, id, opts) {
|
|
|
24316
24377
|
return false;
|
|
24317
24378
|
}
|
|
24318
24379
|
async function deleteProjectOp(ctx, id) {
|
|
24319
|
-
const results = await ctx.projectsCollection.query(
|
|
24380
|
+
const results = await ctx.projectsCollection.query(import_watermelondb19.Q.where("project_id", id), import_watermelondb19.Q.where("is_deleted", false)).fetch();
|
|
24320
24381
|
if (results.length > 0) {
|
|
24321
24382
|
await ctx.database.write(async () => {
|
|
24322
24383
|
await results[0].update((proj) => {
|
|
@@ -24329,14 +24390,14 @@ async function deleteProjectOp(ctx, id) {
|
|
|
24329
24390
|
}
|
|
24330
24391
|
async function getProjectConversationsOp(ctx, projectId) {
|
|
24331
24392
|
const results = await ctx.conversationsCollection.query(
|
|
24332
|
-
|
|
24333
|
-
|
|
24334
|
-
|
|
24393
|
+
import_watermelondb19.Q.where("project_id", projectId),
|
|
24394
|
+
import_watermelondb19.Q.where("is_deleted", false),
|
|
24395
|
+
import_watermelondb19.Q.sortBy("created_at", import_watermelondb19.Q.desc)
|
|
24335
24396
|
).fetch();
|
|
24336
24397
|
return results.map(conversationToStoredRaw);
|
|
24337
24398
|
}
|
|
24338
24399
|
async function getProjectConversationCountOp(ctx, projectId) {
|
|
24339
|
-
return await ctx.conversationsCollection.query(
|
|
24400
|
+
return await ctx.conversationsCollection.query(import_watermelondb19.Q.where("project_id", projectId), import_watermelondb19.Q.where("is_deleted", false)).fetchCount();
|
|
24340
24401
|
}
|
|
24341
24402
|
|
|
24342
24403
|
// src/lib/db/media/types.ts
|
|
@@ -24363,7 +24424,7 @@ function isSupportedMediaType(mimeType) {
|
|
|
24363
24424
|
}
|
|
24364
24425
|
|
|
24365
24426
|
// src/lib/db/media/operations.ts
|
|
24366
|
-
var
|
|
24427
|
+
var import_watermelondb20 = __toESM(require_watermelondb());
|
|
24367
24428
|
init_logger();
|
|
24368
24429
|
|
|
24369
24430
|
// src/lib/storage/mcpImages.ts
|
|
@@ -24597,7 +24658,7 @@ async function createMediaBatchOp(ctx, optionsArray) {
|
|
|
24597
24658
|
})
|
|
24598
24659
|
);
|
|
24599
24660
|
});
|
|
24600
|
-
const results = await mediaCollection.query(
|
|
24661
|
+
const results = await mediaCollection.query(import_watermelondb20.Q.where("media_id", import_watermelondb20.Q.oneOf(mediaIds))).fetch();
|
|
24601
24662
|
return Promise.all(
|
|
24602
24663
|
results.map(
|
|
24603
24664
|
(m) => mediaToStored(m, ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner)
|
|
@@ -24606,21 +24667,21 @@ async function createMediaBatchOp(ctx, optionsArray) {
|
|
|
24606
24667
|
}
|
|
24607
24668
|
async function getMediaByIdOp(ctx, mediaId) {
|
|
24608
24669
|
const mediaCollection = ctx.database.get("media");
|
|
24609
|
-
const results = await mediaCollection.query(
|
|
24670
|
+
const results = await mediaCollection.query(import_watermelondb20.Q.where("media_id", mediaId), import_watermelondb20.Q.where("is_deleted", false)).fetch();
|
|
24610
24671
|
return results.length > 0 ? await mediaToStored(results[0], ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner) : null;
|
|
24611
24672
|
}
|
|
24612
24673
|
async function getMediaBySourceUrlOp(ctx, sourceUrl, walletAddress) {
|
|
24613
24674
|
const mediaCollection = ctx.database.get("media");
|
|
24614
24675
|
const results = await mediaCollection.query(
|
|
24615
|
-
|
|
24616
|
-
|
|
24617
|
-
|
|
24676
|
+
import_watermelondb20.Q.where("source_url", sourceUrl),
|
|
24677
|
+
import_watermelondb20.Q.where("wallet_address", walletAddress),
|
|
24678
|
+
import_watermelondb20.Q.where("is_deleted", false)
|
|
24618
24679
|
).fetch();
|
|
24619
24680
|
return results.length > 0 ? await mediaToStored(results[0], ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner) : null;
|
|
24620
24681
|
}
|
|
24621
24682
|
async function updateMediaOp(ctx, mediaId, options) {
|
|
24622
24683
|
const mediaCollection = ctx.database.get("media");
|
|
24623
|
-
const results = await mediaCollection.query(
|
|
24684
|
+
const results = await mediaCollection.query(import_watermelondb20.Q.where("media_id", mediaId)).fetch();
|
|
24624
24685
|
if (results.length === 0) {
|
|
24625
24686
|
return null;
|
|
24626
24687
|
}
|
|
@@ -24640,7 +24701,7 @@ async function updateMediaOp(ctx, mediaId, options) {
|
|
|
24640
24701
|
m._setRaw("updated_at", now);
|
|
24641
24702
|
});
|
|
24642
24703
|
});
|
|
24643
|
-
const updated = await mediaCollection.query(
|
|
24704
|
+
const updated = await mediaCollection.query(import_watermelondb20.Q.where("media_id", mediaId)).fetch();
|
|
24644
24705
|
return updated.length > 0 ? await mediaToStored(updated[0], ctx.walletAddress, ctx.signMessage, ctx.embeddedWalletSigner) : null;
|
|
24645
24706
|
}
|
|
24646
24707
|
async function updateMediaMessageIdBatchOp(ctx, mediaIds, messageId) {
|
|
@@ -24648,7 +24709,7 @@ async function updateMediaMessageIdBatchOp(ctx, mediaIds, messageId) {
|
|
|
24648
24709
|
return 0;
|
|
24649
24710
|
}
|
|
24650
24711
|
const mediaCollection = ctx.database.get("media");
|
|
24651
|
-
const results = await mediaCollection.query(
|
|
24712
|
+
const results = await mediaCollection.query(import_watermelondb20.Q.where("media_id", import_watermelondb20.Q.oneOf(mediaIds))).fetch();
|
|
24652
24713
|
if (results.length === 0) {
|
|
24653
24714
|
return 0;
|
|
24654
24715
|
}
|
|
@@ -24670,13 +24731,13 @@ var IMAGE_VIDEO_MIMES = VIDEO_EXTENSIONS.map((ext) => `image/${ext}`);
|
|
|
24670
24731
|
async function relinkMisclassifiedVideosOp(ctx, walletAddress) {
|
|
24671
24732
|
const mediaCollection = ctx.database.get("media");
|
|
24672
24733
|
const candidates = await mediaCollection.query(
|
|
24673
|
-
|
|
24674
|
-
|
|
24675
|
-
|
|
24676
|
-
|
|
24677
|
-
|
|
24678
|
-
...IMAGE_VIDEO_MIMES.map((m) =>
|
|
24679
|
-
|
|
24734
|
+
import_watermelondb20.Q.where("wallet_address", walletAddress),
|
|
24735
|
+
import_watermelondb20.Q.where("is_deleted", false),
|
|
24736
|
+
import_watermelondb20.Q.where("media_type", "image"),
|
|
24737
|
+
import_watermelondb20.Q.or(
|
|
24738
|
+
import_watermelondb20.Q.where("mime_type", import_watermelondb20.Q.like("video/%")),
|
|
24739
|
+
...IMAGE_VIDEO_MIMES.map((m) => import_watermelondb20.Q.where("mime_type", m)),
|
|
24740
|
+
import_watermelondb20.Q.where("mime_type", "application/octet-stream")
|
|
24680
24741
|
)
|
|
24681
24742
|
).fetch();
|
|
24682
24743
|
if (candidates.length === 0) {
|
|
@@ -24725,7 +24786,7 @@ async function relinkMisclassifiedVideosOp(ctx, walletAddress) {
|
|
|
24725
24786
|
}
|
|
24726
24787
|
async function deleteMediaOp(ctx, mediaId) {
|
|
24727
24788
|
const mediaCollection = ctx.database.get("media");
|
|
24728
|
-
const results = await mediaCollection.query(
|
|
24789
|
+
const results = await mediaCollection.query(import_watermelondb20.Q.where("media_id", mediaId)).fetch();
|
|
24729
24790
|
if (results.length === 0) {
|
|
24730
24791
|
return false;
|
|
24731
24792
|
}
|
|
@@ -24743,7 +24804,7 @@ async function deleteMediaOp(ctx, mediaId) {
|
|
|
24743
24804
|
}
|
|
24744
24805
|
async function hardDeleteMediaOp(ctx, mediaId) {
|
|
24745
24806
|
const mediaCollection = ctx.database.get("media");
|
|
24746
|
-
const results = await mediaCollection.query(
|
|
24807
|
+
const results = await mediaCollection.query(import_watermelondb20.Q.where("media_id", mediaId)).fetch();
|
|
24747
24808
|
if (results.length === 0) {
|
|
24748
24809
|
return false;
|
|
24749
24810
|
}
|
|
@@ -24755,28 +24816,28 @@ async function hardDeleteMediaOp(ctx, mediaId) {
|
|
|
24755
24816
|
}
|
|
24756
24817
|
async function getMediaOp(ctx, filters) {
|
|
24757
24818
|
const mediaCollection = ctx.database.get("media");
|
|
24758
|
-
const conditions = [
|
|
24819
|
+
const conditions = [import_watermelondb20.Q.where("wallet_address", filters.walletAddress)];
|
|
24759
24820
|
if (!filters.includeDeleted) {
|
|
24760
|
-
conditions.push(
|
|
24821
|
+
conditions.push(import_watermelondb20.Q.where("is_deleted", false));
|
|
24761
24822
|
}
|
|
24762
24823
|
if (filters.mediaType) {
|
|
24763
|
-
conditions.push(
|
|
24824
|
+
conditions.push(import_watermelondb20.Q.where("media_type", filters.mediaType));
|
|
24764
24825
|
}
|
|
24765
24826
|
if (filters.role) {
|
|
24766
|
-
conditions.push(
|
|
24827
|
+
conditions.push(import_watermelondb20.Q.where("role", filters.role));
|
|
24767
24828
|
}
|
|
24768
24829
|
if (filters.conversationId) {
|
|
24769
|
-
conditions.push(
|
|
24830
|
+
conditions.push(import_watermelondb20.Q.where("conversation_id", filters.conversationId));
|
|
24770
24831
|
}
|
|
24771
24832
|
if (filters.model) {
|
|
24772
|
-
conditions.push(
|
|
24833
|
+
conditions.push(import_watermelondb20.Q.where("model", filters.model));
|
|
24773
24834
|
}
|
|
24774
|
-
conditions.push(
|
|
24835
|
+
conditions.push(import_watermelondb20.Q.sortBy("created_at", import_watermelondb20.Q.desc));
|
|
24775
24836
|
if (filters.limit) {
|
|
24776
|
-
conditions.push(
|
|
24837
|
+
conditions.push(import_watermelondb20.Q.take(filters.limit));
|
|
24777
24838
|
}
|
|
24778
24839
|
if (filters.offset) {
|
|
24779
|
-
conditions.push(
|
|
24840
|
+
conditions.push(import_watermelondb20.Q.skip(filters.offset));
|
|
24780
24841
|
}
|
|
24781
24842
|
const results = await mediaCollection.query(...conditions).fetch();
|
|
24782
24843
|
return Promise.all(
|
|
@@ -24806,9 +24867,9 @@ async function getMediaByConversationOp(ctx, walletAddress, conversationId, limi
|
|
|
24806
24867
|
async function getMediaByMessageOp(ctx, messageId) {
|
|
24807
24868
|
const mediaCollection = ctx.database.get("media");
|
|
24808
24869
|
const results = await mediaCollection.query(
|
|
24809
|
-
|
|
24810
|
-
|
|
24811
|
-
|
|
24870
|
+
import_watermelondb20.Q.where("message_id", messageId),
|
|
24871
|
+
import_watermelondb20.Q.where("is_deleted", false),
|
|
24872
|
+
import_watermelondb20.Q.sortBy("created_at", import_watermelondb20.Q.asc)
|
|
24812
24873
|
).fetch();
|
|
24813
24874
|
return Promise.all(
|
|
24814
24875
|
results.map(
|
|
@@ -24821,9 +24882,9 @@ async function getMediaByIdsOp(ctx, mediaIds, includeDeleted = false) {
|
|
|
24821
24882
|
return [];
|
|
24822
24883
|
}
|
|
24823
24884
|
const mediaCollection = ctx.database.get("media");
|
|
24824
|
-
const conditions = [
|
|
24885
|
+
const conditions = [import_watermelondb20.Q.where("media_id", import_watermelondb20.Q.oneOf(mediaIds))];
|
|
24825
24886
|
if (!includeDeleted) {
|
|
24826
|
-
conditions.push(
|
|
24887
|
+
conditions.push(import_watermelondb20.Q.where("is_deleted", false));
|
|
24827
24888
|
}
|
|
24828
24889
|
const results = await mediaCollection.query(...conditions).fetch();
|
|
24829
24890
|
const mediaMap = new Map(results.map((m) => [m.mediaId, m]));
|
|
@@ -24860,10 +24921,10 @@ async function searchMediaOp(ctx, walletAddress, query, limit) {
|
|
|
24860
24921
|
const queryLower = query.toLowerCase();
|
|
24861
24922
|
const MAX_SEARCH_RECORDS = 500;
|
|
24862
24923
|
const allResults = await mediaCollection.query(
|
|
24863
|
-
|
|
24864
|
-
|
|
24865
|
-
|
|
24866
|
-
|
|
24924
|
+
import_watermelondb20.Q.where("wallet_address", walletAddress),
|
|
24925
|
+
import_watermelondb20.Q.where("is_deleted", false),
|
|
24926
|
+
import_watermelondb20.Q.sortBy("created_at", import_watermelondb20.Q.desc),
|
|
24927
|
+
import_watermelondb20.Q.take(MAX_SEARCH_RECORDS)
|
|
24867
24928
|
).fetch();
|
|
24868
24929
|
const decrypted = await Promise.all(
|
|
24869
24930
|
allResults.map(
|
|
@@ -24876,11 +24937,11 @@ async function searchMediaOp(ctx, walletAddress, query, limit) {
|
|
|
24876
24937
|
async function getMediaCountOp(ctx, walletAddress, mediaType) {
|
|
24877
24938
|
const mediaCollection = ctx.database.get("media");
|
|
24878
24939
|
const conditions = [
|
|
24879
|
-
|
|
24880
|
-
|
|
24940
|
+
import_watermelondb20.Q.where("wallet_address", walletAddress),
|
|
24941
|
+
import_watermelondb20.Q.where("is_deleted", false)
|
|
24881
24942
|
];
|
|
24882
24943
|
if (mediaType) {
|
|
24883
|
-
conditions.push(
|
|
24944
|
+
conditions.push(import_watermelondb20.Q.where("media_type", mediaType));
|
|
24884
24945
|
}
|
|
24885
24946
|
return await mediaCollection.query(...conditions).fetchCount();
|
|
24886
24947
|
}
|
|
@@ -24895,7 +24956,7 @@ async function getMediaCountsByTypeOp(ctx, walletAddress) {
|
|
|
24895
24956
|
}
|
|
24896
24957
|
async function deleteMediaByConversationOp(ctx, conversationId) {
|
|
24897
24958
|
const mediaCollection = ctx.database.get("media");
|
|
24898
|
-
const results = await mediaCollection.query(
|
|
24959
|
+
const results = await mediaCollection.query(import_watermelondb20.Q.where("conversation_id", conversationId), import_watermelondb20.Q.where("is_deleted", false)).fetch();
|
|
24899
24960
|
if (results.length === 0) {
|
|
24900
24961
|
return 0;
|
|
24901
24962
|
}
|
|
@@ -24916,7 +24977,7 @@ async function deleteMediaByConversationOp(ctx, conversationId) {
|
|
|
24916
24977
|
}
|
|
24917
24978
|
async function deleteMediaByMessageOp(ctx, messageId) {
|
|
24918
24979
|
const mediaCollection = ctx.database.get("media");
|
|
24919
|
-
const results = await mediaCollection.query(
|
|
24980
|
+
const results = await mediaCollection.query(import_watermelondb20.Q.where("message_id", messageId), import_watermelondb20.Q.where("is_deleted", false)).fetch();
|
|
24920
24981
|
if (results.length === 0) {
|
|
24921
24982
|
return 0;
|
|
24922
24983
|
}
|
|
@@ -24937,7 +24998,7 @@ async function deleteMediaByMessageOp(ctx, messageId) {
|
|
|
24937
24998
|
}
|
|
24938
24999
|
|
|
24939
25000
|
// src/lib/db/userPreferences/operations.ts
|
|
24940
|
-
var
|
|
25001
|
+
var import_watermelondb21 = __toESM(require_watermelondb());
|
|
24941
25002
|
function userPreferenceToStored(preference) {
|
|
24942
25003
|
return {
|
|
24943
25004
|
uniqueId: preference.id,
|
|
@@ -24952,7 +25013,7 @@ function userPreferenceToStored(preference) {
|
|
|
24952
25013
|
};
|
|
24953
25014
|
}
|
|
24954
25015
|
async function getUserPreferenceOp(ctx, walletAddress) {
|
|
24955
|
-
const results = await ctx.userPreferencesCollection.query(
|
|
25016
|
+
const results = await ctx.userPreferencesCollection.query(import_watermelondb21.Q.where("wallet_address", walletAddress)).fetch();
|
|
24956
25017
|
return results.length > 0 ? userPreferenceToStored(results[0]) : null;
|
|
24957
25018
|
}
|
|
24958
25019
|
async function createUserPreferenceOp(ctx, opts) {
|
|
@@ -24972,7 +25033,7 @@ async function createUserPreferenceOp(ctx, opts) {
|
|
|
24972
25033
|
return userPreferenceToStored(created);
|
|
24973
25034
|
}
|
|
24974
25035
|
async function updateUserPreferenceOp(ctx, walletAddress, opts) {
|
|
24975
|
-
const results = await ctx.userPreferencesCollection.query(
|
|
25036
|
+
const results = await ctx.userPreferencesCollection.query(import_watermelondb21.Q.where("wallet_address", walletAddress)).fetch();
|
|
24976
25037
|
if (results.length === 0) return null;
|
|
24977
25038
|
const preference = results[0];
|
|
24978
25039
|
await ctx.database.write(async () => {
|
|
@@ -25000,7 +25061,7 @@ async function updateUserPreferenceOp(ctx, walletAddress, opts) {
|
|
|
25000
25061
|
async function setUserPreferenceOp(ctx, walletAddress, opts) {
|
|
25001
25062
|
const now = Date.now();
|
|
25002
25063
|
const result = await ctx.database.write(async () => {
|
|
25003
|
-
const results = await ctx.userPreferencesCollection.query(
|
|
25064
|
+
const results = await ctx.userPreferencesCollection.query(import_watermelondb21.Q.where("wallet_address", walletAddress)).fetch();
|
|
25004
25065
|
if (results.length > 0) {
|
|
25005
25066
|
const preference = results[0];
|
|
25006
25067
|
await preference.update((pref) => {
|
|
@@ -25048,7 +25109,7 @@ async function updateModelsOp(ctx, walletAddress, models) {
|
|
|
25048
25109
|
return updateUserPreferenceOp(ctx, walletAddress, { models });
|
|
25049
25110
|
}
|
|
25050
25111
|
async function deleteUserPreferenceOp(ctx, walletAddress) {
|
|
25051
|
-
const results = await ctx.userPreferencesCollection.query(
|
|
25112
|
+
const results = await ctx.userPreferencesCollection.query(import_watermelondb21.Q.where("wallet_address", walletAddress)).fetch();
|
|
25052
25113
|
if (results.length === 0) return false;
|
|
25053
25114
|
await ctx.database.write(async () => {
|
|
25054
25115
|
await results[0].destroyPermanently();
|
|
@@ -25063,9 +25124,9 @@ async function migrateFromModelPreferencesOp(ctx, walletAddress) {
|
|
|
25063
25124
|
if (existing) {
|
|
25064
25125
|
return existing;
|
|
25065
25126
|
}
|
|
25066
|
-
const modelResults = await ctx.modelPreferencesCollection.query(
|
|
25127
|
+
const modelResults = await ctx.modelPreferencesCollection.query(import_watermelondb21.Q.where("wallet_address", walletAddress)).fetch();
|
|
25067
25128
|
const personalityKey = `${walletAddress}_personality_settings`;
|
|
25068
|
-
const personalityResults = await ctx.modelPreferencesCollection.query(
|
|
25129
|
+
const personalityResults = await ctx.modelPreferencesCollection.query(import_watermelondb21.Q.where("wallet_address", personalityKey)).fetch();
|
|
25069
25130
|
if (modelResults.length === 0 && personalityResults.length === 0) {
|
|
25070
25131
|
return null;
|
|
25071
25132
|
}
|
|
@@ -25145,7 +25206,7 @@ var SLIDER_CONFIG = [
|
|
|
25145
25206
|
];
|
|
25146
25207
|
|
|
25147
25208
|
// src/lib/db/settings/operations.ts
|
|
25148
|
-
var
|
|
25209
|
+
var import_watermelondb22 = __toESM(require_watermelondb());
|
|
25149
25210
|
function modelPreferenceToStored(preference) {
|
|
25150
25211
|
return {
|
|
25151
25212
|
uniqueId: preference.id,
|
|
@@ -25154,12 +25215,12 @@ function modelPreferenceToStored(preference) {
|
|
|
25154
25215
|
};
|
|
25155
25216
|
}
|
|
25156
25217
|
async function getModelPreferenceOp(ctx, walletAddress) {
|
|
25157
|
-
const results = await ctx.modelPreferencesCollection.query(
|
|
25218
|
+
const results = await ctx.modelPreferencesCollection.query(import_watermelondb22.Q.where("wallet_address", walletAddress)).fetch();
|
|
25158
25219
|
return results.length > 0 ? modelPreferenceToStored(results[0]) : null;
|
|
25159
25220
|
}
|
|
25160
25221
|
async function setModelPreferenceOp(ctx, walletAddress, models) {
|
|
25161
25222
|
const result = await ctx.database.write(async () => {
|
|
25162
|
-
const results = await ctx.modelPreferencesCollection.query(
|
|
25223
|
+
const results = await ctx.modelPreferencesCollection.query(import_watermelondb22.Q.where("wallet_address", walletAddress)).fetch();
|
|
25163
25224
|
if (results.length > 0) {
|
|
25164
25225
|
const preference = results[0];
|
|
25165
25226
|
await preference.update((pref) => {
|
|
@@ -25177,7 +25238,7 @@ async function setModelPreferenceOp(ctx, walletAddress, models) {
|
|
|
25177
25238
|
return modelPreferenceToStored(result);
|
|
25178
25239
|
}
|
|
25179
25240
|
async function deleteModelPreferenceOp(ctx, walletAddress) {
|
|
25180
|
-
const results = await ctx.modelPreferencesCollection.query(
|
|
25241
|
+
const results = await ctx.modelPreferencesCollection.query(import_watermelondb22.Q.where("wallet_address", walletAddress)).fetch();
|
|
25181
25242
|
if (results.length === 0) return false;
|
|
25182
25243
|
await ctx.database.write(async () => {
|
|
25183
25244
|
await results[0].destroyPermanently();
|
|
@@ -25499,7 +25560,7 @@ function createMemoryVaultTool(vaultCtx, options, embeddingOptions, cache) {
|
|
|
25499
25560
|
}
|
|
25500
25561
|
|
|
25501
25562
|
// src/lib/memory/autoExtract.ts
|
|
25502
|
-
var
|
|
25563
|
+
var import_watermelondb23 = __toESM(require_watermelondb());
|
|
25503
25564
|
init_operations2();
|
|
25504
25565
|
init_types3();
|
|
25505
25566
|
init_logger();
|
|
@@ -25706,7 +25767,7 @@ async function assertMergeTargetGoneOrThrow(ctx, targetId) {
|
|
|
25706
25767
|
// src/lib/memory/autoExtract.ts
|
|
25707
25768
|
async function isMemoryTopicsUserManaged(ctx, memoryId) {
|
|
25708
25769
|
try {
|
|
25709
|
-
const rows = await ctx.database.get(VaultMemory.table).query(
|
|
25770
|
+
const rows = await ctx.database.get(VaultMemory.table).query(import_watermelondb23.Q.where("id", memoryId)).fetch();
|
|
25710
25771
|
return rows[0]?.topicsUserManaged === true;
|
|
25711
25772
|
} catch {
|
|
25712
25773
|
return true;
|
|
@@ -26060,7 +26121,7 @@ function createAutoExtractor(options) {
|
|
|
26060
26121
|
...options.retainCtx,
|
|
26061
26122
|
embeddingOptions: {
|
|
26062
26123
|
...options.retainCtx.embeddingOptions,
|
|
26063
|
-
maskInput: (
|
|
26124
|
+
maskInput: (text12) => piiRedactor.maskText(text12)
|
|
26064
26125
|
}
|
|
26065
26126
|
} : options.retainCtx;
|
|
26066
26127
|
function processTurn(messages, conversationId) {
|
|
@@ -26185,9 +26246,9 @@ function formatRecallResult(memories) {
|
|
|
26185
26246
|
return `[${i + 1}] fact (id: ${m.id}${eventSuffix})
|
|
26186
26247
|
${m.content}`;
|
|
26187
26248
|
}
|
|
26188
|
-
const
|
|
26249
|
+
const date10 = m.createdAt.toISOString().slice(0, 10);
|
|
26189
26250
|
const who = m.role === "assistant" ? "assistant" : "user";
|
|
26190
|
-
return `[${i + 1}] conversation excerpt (${who}, ${
|
|
26251
|
+
return `[${i + 1}] conversation excerpt (${who}, ${date10})
|
|
26191
26252
|
${m.content}`;
|
|
26192
26253
|
});
|
|
26193
26254
|
return `Found ${memories.length} relevant memories:
|
|
@@ -26387,19 +26448,19 @@ function parseAnswer(body, base, parseSchema) {
|
|
|
26387
26448
|
if (typeof body !== "object" || body === null) return base;
|
|
26388
26449
|
const obj = body;
|
|
26389
26450
|
const choices = obj.choices;
|
|
26390
|
-
let
|
|
26451
|
+
let text12 = "";
|
|
26391
26452
|
if (Array.isArray(choices) && choices.length > 0) {
|
|
26392
26453
|
const message = choices[0].message;
|
|
26393
26454
|
if (typeof message === "object" && message !== null) {
|
|
26394
26455
|
const content = message.content;
|
|
26395
|
-
if (typeof content === "string")
|
|
26456
|
+
if (typeof content === "string") text12 = content;
|
|
26396
26457
|
}
|
|
26397
26458
|
}
|
|
26398
26459
|
const usage = obj.usage;
|
|
26399
26460
|
let structuredOutput;
|
|
26400
|
-
if (parseSchema &&
|
|
26461
|
+
if (parseSchema && text12) {
|
|
26401
26462
|
try {
|
|
26402
|
-
structuredOutput = JSON.parse(extractJsonCandidate(
|
|
26463
|
+
structuredOutput = JSON.parse(extractJsonCandidate(text12));
|
|
26403
26464
|
} catch (err) {
|
|
26404
26465
|
getLogger().warn("[memory/reflect] structured output was not valid JSON", {
|
|
26405
26466
|
err: err instanceof Error ? err.message : String(err)
|
|
@@ -26407,7 +26468,7 @@ function parseAnswer(body, base, parseSchema) {
|
|
|
26407
26468
|
}
|
|
26408
26469
|
}
|
|
26409
26470
|
return {
|
|
26410
|
-
text:
|
|
26471
|
+
text: text12,
|
|
26411
26472
|
...structuredOutput !== void 0 && { structuredOutput },
|
|
26412
26473
|
basedOn: base.basedOn,
|
|
26413
26474
|
usage: {
|
|
@@ -27767,10 +27828,10 @@ var PdfProcessor = class {
|
|
|
27767
27828
|
async process(file) {
|
|
27768
27829
|
const logger = getLogger();
|
|
27769
27830
|
try {
|
|
27770
|
-
const
|
|
27771
|
-
if (
|
|
27831
|
+
const text12 = await extractTextFromPdf(file.dataUrl);
|
|
27832
|
+
if (text12 && text12.trim().length > 0) {
|
|
27772
27833
|
return {
|
|
27773
|
-
extractedText:
|
|
27834
|
+
extractedText: text12,
|
|
27774
27835
|
format: "plain"
|
|
27775
27836
|
};
|
|
27776
27837
|
}
|
|
@@ -27853,16 +27914,16 @@ var TextProcessor = class {
|
|
|
27853
27914
|
async process(file) {
|
|
27854
27915
|
try {
|
|
27855
27916
|
const arrayBuffer = await dataUrlToArrayBuffer(file.dataUrl);
|
|
27856
|
-
const
|
|
27857
|
-
if (!
|
|
27917
|
+
const text12 = new TextDecoder("utf-8", { fatal: false }).decode(arrayBuffer);
|
|
27918
|
+
if (!text12.trim()) {
|
|
27858
27919
|
return null;
|
|
27859
27920
|
}
|
|
27860
27921
|
return {
|
|
27861
|
-
extractedText:
|
|
27922
|
+
extractedText: text12,
|
|
27862
27923
|
format: this.resolveFormat(file),
|
|
27863
27924
|
metadata: {
|
|
27864
27925
|
byteLength: arrayBuffer.byteLength,
|
|
27865
|
-
characterCount:
|
|
27926
|
+
characterCount: text12.length
|
|
27866
27927
|
}
|
|
27867
27928
|
};
|
|
27868
27929
|
} catch (error) {
|
|
@@ -27926,8 +27987,8 @@ var WordProcessor = class {
|
|
|
27926
27987
|
/**
|
|
27927
27988
|
* Count words in text
|
|
27928
27989
|
*/
|
|
27929
|
-
countWords(
|
|
27930
|
-
return
|
|
27990
|
+
countWords(text12) {
|
|
27991
|
+
return text12.split(/\s+/).filter((w) => w.length > 0).length;
|
|
27931
27992
|
}
|
|
27932
27993
|
};
|
|
27933
27994
|
|
|
@@ -28363,10 +28424,10 @@ var cryptoPriceCentroid = [0.025576787463333337, 0.0017598020599999997, -0.01339
|
|
|
28363
28424
|
var noCryptoPriceCentroid = [0.015473095138684206, 0.0031634101517105263, -0.011257569272697374, -0.02186071628118421, 0.008889833600921049, -0.006683160151842105, -0.009353561542368423, 0.01352172231447368, -0.01804750482084211, -0.00367377302894737, -0.02944732364736842, -0.002762284484078947, 0.033265779919736845, -0.006296026233684209, 0.022671929989210516, -0.0011530866775394733, 0.007070449366500001, -0.0050351310097368415, 0.010799295548421052, 8887227547368423e-20, 0.016334833743289468, 0.014258147745263154, 0.009584979092368422, 0.003050773904342107, -0.013426355076315791, 0.03582639014592105, -0.01160198427105263, -0.012974957788421051, -0.0031303864967105266, 0.021372544676315785, -0.02374843410263159, -0.009223416682894739, 0.005602822635394739, 0.02924898819473684, -0.014123551471890794, 0.019027650408421047, -0.005074793619605263, -4600031255263159e-19, 0.010498459563947368, -0.011094227593421054, 0.010249076817105258, -5753623577631579e-19, -0.005674418818421051, -0.00447285064486842, -0.005516097867105263, -0.007470266562368424, -0.005471375803289476, -0.006780112021052632, 0.007059772195657894, 0.0021554959672368413, 0.004705735464473685, -0.02317132775394737, -0.011564555390789474, -0.002422056378552632, -0.006380764081578948, -0.004005146213289473, -0.00794062262769737, 0.01414054164342105, -0.01016237577355263, 0.003978143405131578, -0.03655277326578946, 0.006158242906276315, 0.004217046339078946, -0.008940671309210528, -0.00673433677186842, 0.010728261618421055, 0.005998754786184212, -0.012994214264868421, 0.01220040680802632, -0.010796953655434208, -0.006105011632500001, 0.008011191312894737, 0.006423354985394737, 0.0012142853823684213, 0.009146709284210528, 0.022887410982105266, -0.022682944046052637, -0.020356859009684213, 0.010394592805789476, 0.022593094030263154, -7750265294736841e-19, 0.010491877809868419, -0.00632094335789474, -0.00435166075344737, -0.0033312799659210527, -0.013687921215789472, -0.0021700710893421053, -0.009265354446052636, -0.007450454793684212, -0.01119890545223684, 0.01885215469736842, -0.0016829954880263156, 0.004660542770078946, 0.01614547219013159, 0.0012384379707105267, 0.0012953595593421052, -0.019026688374473685, -0.012046473879210519, -0.01890812402105263, -0.0013315808465131577, 0.011091345418421055, 0.021520818015789468, -0.005630902795947368, -0.0019751528094210527, 0.016361938930000004, -0.006861605829210528, -0.0028363347098684204, 0.008591381667894738, -0.009064190686052631, 0.0019356226038157898, 6169263489473686e-19, 0.005576595939605265, 0.01869662389342105, 0.001262012349342105, -0.005366806441447369, -0.016217105081578947, 0.0016831897417500007, -0.0018950253057894739, -0.002175052982236842, 0.015151523774342104, 0.009984357328157894, -0.008543766583157896, -0.00730858755781579, -0.005671754766447369, 0.016222894231578945, -0.006877592555789474, -0.00339728109881579, 0.002327833744078947, -0.007433236152460526, 0.003641817336996051, -22983315413157884e-20, -0.018579861956578948, -0.002013661149605263, -0.0012221983013157892, -0.005588193124592107, 0.0017740131994736844, -0.005087314752105264, -0.0024032324010526303, -0.021181957791973682, 0.015352973211842105, 0.0014077697809210523, 0.01886358938289474, 0.0034620092081578944, 0.001262707815105263, -0.016702094776315787, 0.0024528663467105263, -0.015399577423684214, 0.013716609889342105, 0.008007916322368419, 17873636657894727e-20, 0.012559814308552636, 0.004152347459210525, -0.007167261042105263, -0.010308009533421052, -0.0118209450956579, 0.0034850848647894755, -0.01689842138618421, 0.02312426354868421, 0.018107834585526318, -0.005113781234210525, 0.0036598878982894733, -0.002219674033289473, 0.010094555771578948, -0.004721280503184208, -4728102780263162e-19, -0.005741379793631579, 0.004688492021052632, -0.009298409537368421, 0.021306954543421058, 0.002625481324473684, 0.0021689222906578947, 0.0016470091790789468, 0.021918357023684207, 0.01859015762499999, 0.008736974258815788, -0.007575892959605263, 0.0012198560669736834, -0.013031221881184206, 0.005416682665447367, 0.014852952819736842, -27517017642368397e-20, 0.01096887469118421, -0.0013455180846052635, 0.022272436745131585, 0.0067934349073684175, 0.012959732387171052, -0.02075517668026316, -0.0064723936585, -0.0038070007211315794, 0.0012372250631578945, 0.0050306169430263175, -0.006763357246763157, -0.006772821312763157, 0.010125664042499998, 0.002038023320000001, 0.011549378190657895, 0.0029378070836842116, 0.010960937982500004, 0.010825824704473684, 0.0021591957962631583, 0.04206184268421052, -0.024262397277631575, 0.008255900677763156, 0.009695903923947372, -0.007390906788684211, -0.008087284358947368, -0.021996855926315787, 0.011287301983684214, -5568711708289474e-19, -0.014932725518421055, 0.009245778972302627, 0.0015213949119210516, 0.009132084528947367, 0.016006044472368423, 0.011636527018026314, 0.006784626309736844, 0.013307319816763155, -0.0027379106158421057, -0.0020452238106578946, -0.004009475287105262, 0.010760948439342109, -0.008745640049473686, -0.003213084865263158, -0.002908590922105263, -0.008224298627236842, -0.01243814725003421, 0.002076089559092105, -0.009891295528947368, 0.002955430833842103, -0.026389982763157894, 0.00307576746013158, -0.019563673766447378, 0.0016621273825, -0.008313485993421054, 0.004804929035789474, -0.00549750888473684, 0.00505214069705263, -0.011755459830263165, -0.0024296008852631576, 0.00875007432236842, -0.008075735610789475, -0.01105359596322368, 0.0039991457536842105, -0.010148718380263164, 0.0025960758788157894, -0.010566656651710528, 0.012436943196578952, -0.016535537697368412, 0.01290098068868421, -0.01656991388736842, -0.007831062019144736, 0.005940865221447369, -9759450793421052e-19, -0.008620581310184207, -0.003005893026447368, -0.002761302409605262, -0.0030793885886842114, -0.006974357054078946, 9721991617105264e-19, 0.010942189804473684, 0.002026653777631579, -0.012401945011578947, 0.0033469499360526318, 0.018924720229473682, -0.005991988553184208, 0.0033316007316315788, -0.015320591599605263, -0.02128828745542763, -0.0022622942237697373, 0.0069056783826315785, 0.004446302767763156, -0.016207595330789474, 11362097776315657e-20, 0.008954130263986842, -0.010221943235789475, 0.014461354018157896, 0.0028590932341973686, -0.010514913011447373, -0.015841919529473683, -0.01389901701263158, -0.009229765706842105, 2461921435526319e-19, 0.020577489130263162, -0.022800926136842106, -0.0015163221825394738, -0.013809464157236842, 0.004897803686315791, 0.018522811494736845, -0.009630460222828948, 0.011984547498157897, 0.0111937101125, 0.015270678807631577, 0.0019252811815789483, 0.014758101361842106, -0.005758524065263159, -0.0021391250729868427, -0.010472078178684207, -0.012900316256973682, -0.0014497102297763157, 0.006431885074342107, -0.003826420850657895, 0.004125123941578948, 7190557013157885e-20, 0.005760016457894736, -0.01029894582407894, -0.014202551836842109, -0.008429392661184212, -0.004542960022631579, 0.004390327258289474, -0.017841332352631578, -0.02092670811578947, -0.011721044171184207, 0.001154552708868421, -0.008358092435263156, -0.009767428120921056, 0.00617505359518421, 0.004506490673552631, 0.0020017606636842113, -0.00796983946092105, 0.020977802086842096, -0.0075353952266447415, -0.007463197555921055, -0.012128650817236842, 0.019736432668421053, 0.002261451146973684, 0.004720614210526316, -0.009998388954473686, -0.005624677788552632, -0.022545385379078953, -0.001583800878381579, -0.002379242887671053, -0.006442413411381578, -0.00695587538394737, 0.0011264698367105268, -0.0045705394853947385, -0.0015821324533815784, 0.023414226677631576, -0.0012724761923684214, 0.023761430540263154, 0.0029503868397894734, -0.0033352330858684217, -0.011512791865657892, 0.00981099949723684, -5708729797368422e-19, 8188937956578947e-19, 0.010694227110197371, 0.008592401465789476, -35825991868421067e-20, -0.004266100294447367, 0.005692018715789475, -0.0033002098638157907, 0.004866896994999999, 0.01000889828684211, 0.006752862654868419, 0.0026472819757499995, -0.005589931472697369, -0.017258877186842114, 0.01836197345605264, 0.003980058679868421, -0.0020851821997368417, -0.006682193140302631, 0.008638199788657895, 0.01154588990657895, -0.0014030509926710529, 0.00623447043604513, 0.016997480921671054, -0.0076195284961842105, 9118090571052634e-19, -0.01740562824342105, 0.001625513271842105, -0.012645379938157893, 0.010188843557894742, -0.012510250708026317, 0.0014163581344342104, 0.007640950823026323, 0.009030281375263157, -6778679552631581e-19, -0.021454867002973686, 0.001957897549473684, 0.001193311223026316, 0.0027351965483684215, -0.05114138984210526, 9931653628947367e-19, -0.0034956210430263156, -0.011831037061315788, 0.010289316701315792, -0.006878016126315793, 0.004890278758947368, 0.005483033461842105, -0.01275958679236842, -0.01331795716276316, 0.003143929424078947, -0.0022857318045394724, 0.007633577711973686, 0.0021747185855263158, 0.005520500721710526, 0.008252045688684212, -0.014708749063026315, -0.010071718517500002, 0.004989717453947367, 0.017077984349605266, -8273659215789473e-19, 0.005120420113328947, 0.007857212020657894, -0.007720276348289473, 0.002462438197763158, -55125038157895184e-21, 0.004356982750105262, -0.00700954478736842, 0.008855195414342104, -0.007593518517105262, 5683125496052636e-19, 0.006104346186842107, 0.0018523006100263158, 0.011868568778421053, 0.008818247002631579, 0.007355409463684211, 0.014110024566184213, -0.004139245012105264, -0.008042714513815788, -0.008814672356447366, 0.010348661143157892, 0.008645756135526317, -0.0039321516707894735, -0.018719250872499996, 0.016164309558789468, 0.011362069608157893, 0.012222493691973682, 0.009424688908947371, -0.00664402617118421, -0.007866664878289475, -0.012993650039078946, -0.018103016852631583, -0.0065906644863157875, 0.004789760346776317, -0.014935053199342104, 0.014902569211842109, 0.004785409491052631, 0.007345346444473684, 0.003159245409736842, 0.01312098370328947, 0.006301784642499999, 0.005022653047368423, -0.002849895648684211, -0.0032933022748421045, 0.004350993063026316, -0.007350343983026319, 0.010007334274736844, -0.0028172315381578953, -0.011997126834394734, -0.005281044011052631, 0.017256082294736845, -0.026231524928157893, 0.001482624986578947, -0.01504677556723684, -0.006961093627631583, -0.009158235009605265, -0.010464971171052636, -0.012205843889473683, 0.013581314933421051, 0.024057515715473682, -0.026571698318421058, -39512425210526327e-20, -0.008364490104342107, 0.01043953546486842, -0.006329244778157894, 0.00677121107763158, -0.006404679137105265, -0.008498417039605265, -0.011997726845921054, -0.00819236379276316, -0.008719842036447368, 2480567830263159e-19, -0.009615319662105265, 0.010179268672105262, 0.010257863497157897, -0.002203600034342105, -0.014915970727368411, 0.010107625643947371, -0.0016536920541710522, -0.006636945585526316, -0.016858044851315784, -0.020209110402631573, -0.007010765250131577, 0.0073754879921052625, 0.019676440628368427, 0.010058316429868416, -0.026224092562236838, -0.010421548158342108, 0.004843649796842105, -0.018334794059605263, 0.007321559153421053, 0.014406508708157897, -0.013035912961381586, 0.008222181527763156, -0.002566978908289474, 0.009497600043981577, -0.0056751013231578955, 0.004298258599210526, -0.00134152910618421, 0.0017198262138157904, -0.00527642314413158, -0.006738037163421052, 8391017913947374e-19, -0.011822055771453949, -0.0023647280209210526, 0.018581314182894736, 0.0013511696361842105, -0.008034561226052629, 0.0050400383831578945, 0.011289238419736843, -0.01018335548486842, -0.008891896734736842, 0.007739089927236841, -0.014787865826578945, -0.017835246043026314, 0.0056641722032894715, -0.0059957612642105255, -0.006282649575526315, 0.016645820401710514, 0.002203326760921053, 0.0022889429653157895, -0.008153908865789473, -0.009116433642894738, 0.014059073972894742, 0.006152197939947369, 0.01395997850157895, -0.012334291357763155, 0.017010570389868414, -0.0063333831828947355, -0.0025206653310921056, 0.006800531193421053, -0.004048019489342104, -0.006107880013157895, -0.011589549206710528, -0.0023016446209210527, 0.018917020458026318, -0.0018317876103026314, 0.007985371543710523, -0.009285482378157892, -0.007067705323684211, 0.011150805990789475, -0.009777598592105264, -0.008635949183289476, -0.004163104284868419, 0.010232138396315793, -0.0019257375613157897, -5739201986842089e-20, 0.013092055408684215, 0.01974871008065789, 0.005587073321842107, 0.025888940701315793, 0.016139226412631578, -0.0011026304183986845, -0.006448130678552632, 0.0013506662108157892, -0.00879462901421053, 0.0067748442927236825, -0.002999273877368421, 5861502590000002e-19, -31988263750131585e-20, -9557692903947368e-19, -0.005667702506315793, -0.006468547942684208, -0.017199129730526317, -0.019429718929210527, -0.003644407856578948, 0.004087335838671054, -0.003677765850855264, 0.007942120783605264, 6586344227631579e-19, -0.0037614600624999986, 0.0055129023461368415, 0.011244061396578945, 0.005010426876315791, 0.0072596023613157885, -0.008378387808157896, 0.01193223011842105, 0.002783704421578947, -0.0018955311381578942, 0.016495522016315784, 0.0010300654348684207, 0.0029166797853947372, 0.0019548181412, 0.0034482197978947357, -0.01597233675447369, -0.004172262047894737, 0.004349557685394737, 0.0057765581432894725, -0.017049438059999998, -0.004525430396052631, -28143429157894773e-20, 0.008926862911842108, -0.01706470510842106, -0.009343251894078945, -0.014551790916315796, 0.0037077234910526317, -0.024520926263157893, 0.005740144142368422, 0.0053956368143421056, -0.005766834186973687, -0.012353098134999999, 0.005150600744473685, -0.002591634655236843, -0.0034600672671052644, 0.020232129807894742, 0.0019706625393421055, -0.021094935969078955, 0.013562589856578945, -0.01982315960263158, 0.0022789787307368413, 0.0030350554696052627, -0.0023380354609868425, 0.0016429701249999996, 0.0013748243807894737, -0.011015212538802624, -0.01045923693026316, -0.010230515132368417, 0.0031865286891710532, 0.019525663493815786, -0.01229977110328947, -0.01392738180263158, 0.0047192255380921035, 0.009634271472381582, -0.0036637588399210516, 0.01367465738263158, -9074315167105264e-19, 0.009034615510460526, -0.013227085239526318, -0.008698134963421054, -0.005679745975289474, 0.016064328626710523, 6854882098684209e-19, -0.02409260117894737, -0.029390496973684222, -8429490286315783e-19, 0.017532396812105267, 0.003992892611842105, -0.015176699562894741, 0.017688143694565794, 0.015704753903289473, -0.006714242723157895, 0.006966373187026316, 0.014712872807894739, 0.0048426642788421065, 0.004560759092499999, 0.014764954930526316, 0.007755880210394735, -0.0063704605949999995, 0.013370230355131577, 0.006058873911578949, -0.007236065584644737, 0.02192650811447368, -0.0036055442649473683, 0.017262371172368424, -0.019675186598421057, 0.012352453031578945, -0.019395975741052625, -0.005476996759473683, -0.003981952255394738, -0.019128493134342103, -0.006420192784736843, 0.00663706127763158, -0.00931713626539474, -0.004438600155394738, -0.0074747220036842105, -3532221511315789e-19, 0.003786715305789473, 0.002143004024210527, -0.013259830103026315, -0.019481669799736843, 0.0063924609735921045, -0.006268689519868423, 0.011194401769210527, 0.014244597600921052, -0.009581357068684208, 0.015704279303947365, 0.002868509497368421, 0.009993456976842102, -0.009288659571184214, -0.00567008211111842, -0.0016774708461842105, -0.015881515857631583, -0.0031357240957894735, 0.009431347011250004, -0.02115866819605263, -0.002224235694342105, 0.016286955564605264, 0.007042988388157893, 0.002287434175, 0.010197640378157893, -0.005280943861578946, 0.0014105266302631581, 8359535263157892e-19, 0.0047502692026315805, 0.013299677349078947, -0.0023519426788157897, -0.004674174603421053, 0.018177119728907887, -0.0014176172173881575, 0.007134867282894738, -22741002690789458e-20, -0.022838398981578946, -0.003212089612105263, 2004287202631577e-19, -0.022176862091973677, -0.020671407409605266, 0.009063825494342106, -0.016635621425526326, -0.008275760027894737, -0.010347646235000002, 0.009041304183157893, 0.0051814241601315794, 0.005795941738552632, -0.006237753602210528, -0.004308292899078948, 0.027939477830263154, 0.0022927221325526313, -0.009122603172894738, -0.012685393528368422, 0.035720136647368415, 3721588992105262e-19, -0.015025574779078942, 0.0087486222525, -0.009074244906710525, -0.01173346431697368, 0.012090590483960533, 0.016366954857105268, 0.011179668721052633, -0.0073358287721842115, -0.007733899611315792, -0.003457529575921053, -0.006236338289078949, 0.005774385420526318, -0.018860930085526313, 0.01522345625828947, -0.012091792738157891, -0.004068704780263158, -0.004178824925921053, -0.013820312269210535, -0.01096366969644737, -0.004025642653947369, -0.024534325314078946, 0.006440052884473688, -0.016726629586052633, -3620708957894737e-19, 0.0047140585557894745, 0.0018035156026315793, 0.0048402487059210535, -0.00438187360013158, -6329667841710535e-19, 0.013023098627184216, -0.0015603331286578957, -0.0015727194086052627, 0.015044479001315789, 0.003913626584973687, -0.011406708371973688, 0.009567988548947368, 0.0048712744065789486, 8060304496052634e-19, -0.0027007557632499997, -0.007984334569848683, 0.0035786119902631594, 0.008549296575394733, 0.013448384334736838, 0.003980597008986842, 0.0027732479433552628, 0.0022548364651710537, 0.01305019627302631, -0.010885881758421052, 0.0046425705302631575, -0.006159144808684208, 0.0016908100748684212, 0.010177649750394735, -0.00148574499868421, -0.007758489989078948, -0.010132687943157893, 0.010328826282539472, -0.007675625043065791, 0.010875474622368417, -10961718381578953e-20, 2469314122368423e-19, 0.01456813955157895, -0.002258910603421052, -0.006317790170921054, 0.008751932444473686, -0.009791627398947367, 0.015247204259210523, 0.010811477365789473, 0.006444553805289473, -0.009046801008342103, 0.0030660862369736833, 0.020425601981842102, 1083259947368725e-21, 0.024182386267499998, -0.017303176044473685, 0.006597084168552631, 0.001865562837526316, 0.001028871313631579, 0.01472760354684211, -0.0075378481717105275, 0.010146784916184209, -0.007357307590657895, 0.015889662872500005, -0.0010280143740789473, 0.008057754063236841, -0.0017568669571052641, -0.004133698758421052, 0.007827215762368422, 0.03512832019999999, -0.00993780903394737, -0.004260993277631579, -0.008866919430526315, -0.012339414527631576, -45847830315789447e-20, 0.00838245042193421, -0.016904068641184215, -0.01032341292509211, -0.0179430145493421, -0.005017911380025, 0.004198584343289474, -0.012134608429342105, 0.02621189465, 0.021764919877236843, -0.0016967839548684218, 0.0064469595144736845, 0.0015113159294999998, 0.01449087951447368, 0.00908490776328947, 0.0021144275999999997, -0.0023710569351315784, -0.012429141851184206, -0.007313173065394735, -0.003165631556907895, -0.005191618546052632, -0.00811820481360526, 0.006263298302894738, -4727746834342098e-19, 0.01215529816414474, 0.005959134763223686, -0.003053097290263157, 0.0022509379385526307, -0.012437947575526312, -0.017363427211052634, -0.0044620109, 0.01702834882368421, -0.0014438623280263164, 0.007209018304078949, -0.005530027731842105, -0.006350269325728949, -1933061736184215e-19, -0.012560664186842102, 0.021907004355263156, -0.00368476647618421, -0.008714235420315792, 0.006064745458157897, 0.004239938750368421, -0.003381502998157895, -0.009450509392500002, 0.021473245165789474, -0.006664313856578946, -0.007727308110131578, 0.01755496648539474, -0.008046387513815787, 0.004243436594473684, -0.0018419240855263163, -0.002696314727236842, 0.00458863617605263, -0.009136615755921052, -0.01227240456026316, 0.007315492906276317, 0.001563661388157895, -0.005130049675394736, -0.002669057950473685, -0.0014561823650000002, -0.005081315489473683, -0.019940945634210522, 0.0020929494719736843, 0.004403723249342103, -0.03075529604868421, -0.008624309510289472, 0.01228930504118421, -0.009409504784473681, 0.0011323868934210513, -5501856157894726e-19, 0.011253276619736843, -0.005881537943934211, -0.009128014259078948, -0.002782203197434212, -0.00439761305381579, 0.018774566821052625, -0.011816556899605264, -0.019359096755263157, -0.009348714950473683, -0.0010719945900657896, 0.010479289703256579, -0.011939962278157891, 0.005665995433736843, 0.006774268349210528, 0.0034390900013157896, -0.008370486944868423, 0.017960268711842104, -0.0040098660762236836, 7006663912157889e-19, 0.0015448419175000006, 0.030164748171052642, -0.013288672209210527, -0.0194342324281579, -0.014333865537368415, -0.0010687613120394742, 0.006369927146184209, -0.02037403711921052, -0.0011595645836842109, 0.012291525279210526, -0.004659846724868422, 0.014351864156447373, 0.004539899117368421, -0.011356260933815792, 0.014434559298684207, 0.003388873248815791, 6091339384210531e-19, 0.009991929092763158, 0.019049285447499998, -0.007336658402000001, 0.01645323191407895, 0.011546428464605267, -0.003781113732894739, 0.01016362579592105, 0.003369438427763157, -0.012699591561842107, -0.027960629820000003, 0.006582685929197369, -0.0014268903726315791, 0.005638759550394738, -0.006515546567039474, -0.004676419364394737, 0.008950068268947365, -0.006762236009210526, 0.010658080675000004, -0.005891587223157895, -0.014665679521842107, -0.013644553504473684, 10368947013157792e-20, -0.007762898519210526, -0.01131838790855263, -0.00988497489276316, -0.0072114894752039445, 0.0027077467686842105, 7480073221052632e-19, 0.001175619631578947, 9005636573684216e-19, -0.017333229999605265, 5094909162236838e-19, 0.012029732047368418, 0.009794908618684218, -0.01157117548918421, -0.009239849182894735, 0.005636658962236845, -0.008340407034210524, -817503516907895e-18, 0.003921638921052632, 0.005545640947368417, 0.014569629413078954, -0.00717244047236842, 0.00835087193605263, -0.008531247800499998, -0.004064330462, 0.008101339765526315, -0.01701503037605263, 0.004955823044473687, -0.0022204531394868425, -0.01208521188631579, -0.002832061093026315, -0.002318643040434209, -0.007110677303947368, 0.001033564958947368, 0.027433827638157895, 0.010220588290263156, -0.007394786349605265, -0.006538531349210523, -0.0022718601860526317, -0.004229559157973685, 0.005938436034868422, 0.01048373804263158, 0.00986031018078947, 0.020336058257894734, 0.004668691585657895, -0.011039444343815792, -0.03195965501315791, 22211712236841965e-20, 0.004621380856581578, -0.0032872489723684223, 0.0022427985402631574, 0.009466410571710526, 0.017591113605263154, -0.004106379021052631, 0.006385616363748682, -0.0040017953515789455, 0.0012984135143552632, -0.0013681684519605262, 0.006150785983582896, 0.02349364751052632, -0.003507428290921053, -0.023245202525000005, 0.0073350322506578955, -0.012751762621973684, -0.009509772432105263, -0.011624634206315787, 0.008383111918289473, 0.008738430290394734, -0.0019306551646052629, 0.004987825924447366, 0.0067051984610657905, 0.010962145944078953, -0.006160766227763156, -0.01599381954276316, -0.005996254381473684, 0.013413042621052635, -0.016699554863157894, -0.00425797138263158, -0.002346582932368421, -0.003454997969210526, 0.015414278531447364, 0.0020144495526315796, 0.004778662968414474, 0.019607659189473686, -36090899996052645e-20, -0.008492139364605267, 0.007747498233499999, -0.0013514066389473686, -0.013021238629802628, 0.02135893455000001, 0.0050934569453947335, -0.005380931788039476, 0.0034462612061184213, 0.002471601183026315, 0.0018443146213815793, -0.005110344829342106, -0.014184218227105262, -0.0043937764976315795, -0.004010257807763158, 0.007609986475131577, -0.0017383072384999994, -0.008765348437499997, 0.006436899067289473, -0.005252098280921053, 0.0012666882906842106, 7271012838815791e-19, -0.012168801171973687, -0.006950649873815789, 0.006179354461447367, 0.008584705725921056, 6826743815789457e-20, 0.005478510884342106, -0.001656087406842105, 0.004353472659210527, -0.007852758323026314, 0.00774670264888684, -0.004548253065789474, -0.00872336939763158, 0.007497302493421052, -0.003937119212631579, 0.005084670148232898, -0.006804365856578951, -0.004160022079342104, -8716827518421054e-19, -0.0018917191575000003, -0.04542618686578948, -7962240394736886e-20, 0.005303945623421051, -0.0010489784114473685, 0.0040561710610526325, -0.005575023273947369, -0.014307941818026318, -0.005483095651842106, -0.0036865826026315804, -0.007326996465921051, -0.007258892687710523, -0.017002108826973682, 0.0026596006468421053, 0.007241479605526319, -0.006855145818736838, -0.007547068765263157, -0.011135433282763159, 0.015574704355921056, 0.015176253521052627, -0.006872319883815792, 0.0017937790452631581, 0.0012157494165789468, 0.007882637975789471, 0.003405427387894736, -0.004297595478375, 0.017864616917368424, 0.0030970381859210523, -0.0023354204692105267, 0.0017386867781578944, 0.02049815361294737, -0.00913410340657895, 0.01556748598855263, 0.0014741332142105261, 0.00888697265651316, -0.008259757955789475, 0.010162209150921054, -0.015258628212236844, 0.007913002543421052, 5999896474736846e-19, 0.010361211858157896, -0.005668571334210528, 0.009625429015263158, -0.0104467670125, 82077470868421e-17, -0.0016111464500000003, 0.011819657311842107, -0.010997043170815787, 0.026556267275000003, 0.006691072826710528, 0.020695954338157893, 0.003105390495, 0.007586750871802631, -0.006386726654605265, -0.02003319237539473, 4345854440394738e-19, -0.008994508450263157, -0.026183591028947364, -0.002199864392631578, -0.0028300363084210523, 0.008933973642105263, -0.004872168878026316, -0.010508434657894736, -0.030814126236842106, 0.003977499332947367, 0.003367798314605263, -0.008800812126184209, 0.03421133572763158, 0.036882231234210514, -0.009774976162894739, 0.014867376786052633, 0.01847335194828948, 0.004703114508157895, 0.004981278706842106, -20820300881578947e-20, 0.0023825047832894738, -0.006051949050131578, 0.005748253940526316, -0.048717287638157886, 0.006936276815973685, -0.00717120160088158, -0.0011371543828947368, -633878522763158e-18, -0.009472156436842108, 0.004011299037763159, -6579590755328946e-19, 0.006974676819078946, -0.005393841788815792, -0.004757979923842104, -0.0033050710856578945, 0.011350404267631583, -0.007076194413157896, 0.0017202756382894743, 0.012773173556842102, 0.0030848825621578946, 0.0027823394973684207, -0.00670719708276316, 0.005835784166710526, 0.006515324253026317, 0.008066022838947366, 0.001960170838894737, 0.0051619980871052615, 0.0026211382473684216, -5182459471052627e-19, -0.0027954785167105234, -0.004234536522631581, -0.009315601918947366, 0.008809953131578951, -6880571447368561e-21, -7682047319210527e-19, -4287664078947533e-21, -0.008450649188421052, -0.0035262061703947374, 0.012014457226315788, 0.00802163259636842, -0.014263569363815795, -0.001529443673157895, 0.0038201108919736853, -0.0021061006564999994, -0.006485662478921053, -4953983351315789e-19, -39382826565789427e-20, 0.0028122849150000006, -0.012065431929342112, -0.004557107439381579, -0.004202265546447372, -0.006648211306315786, -0.0026814599381578944, -0.004716990799535528, 0.011677914061486841, 0.0054311442510526315, -0.009687709625394739, -0.00401446957026316, 21303643315789461e-20, -0.004548820044210527, 0.001488740388592105, -0.008498280648552632, -0.009067142177105258, -0.001475207605789474, 0.003382969827236843, -0.003364108026184211, -0.015231927833026314, -25714068360526294e-20, -0.009678724665486842, 21494394868420982e-20, 0.0069928910540789455, -0.009154249508157892, -0.014927330287236848, -0.04244073076315791, -0.009253368699736841, -0.007564927833815789, -0.006217242748684212, -0.007667895968815788, 0.012352994166578951, 0.005073167429381579, -0.005000820531315791, -0.01045439083394737, 0.0015025571015789476, 0.0064443839557894724, -0.007921140097105263, 0.01298356292368421, 0.022927954959605267, -0.005738576246052634, 0.01002808020881579, -0.0017933789327631581, -0.0036308607342026324, 0.007852910432894737, 0.008723654298289477, 0.005285313737631579, 0.013029228591842109, 0.0033245363744736855, -0.00546107157763158, -0.01238937413552632, -0.014016715163947365, -0.00480338421131579, -0.017565224993223685, -0.0010297757147368421, 0.0190754480131579, -0.016528817848684218, -1554027478552634e-19, -0.0033909335259210555, -0.02275056143078949, -0.012455294898723683, -4695065194736842e-19, -0.019497075148026316, 29407749652631535e-20, -0.004932486893276316, 800515078947368e-20, -0.019466739034210534, 0.0011483287201315788, -0.006102988706842104, 0.004115763767592106, 0.004177756370252632, -0.002618433127763157, -0.00537044665544737, -0.011829460742671057, 0.00692578045657895, 0.006913495407763157, -0.0012394369451315791, 0.004177181062190789, -0.004855147448592105, -0.009354103443947366, 0.008475817234342108, -0.0060853426540789495, 0.017770833389999994, 0.010468942911184213, -0.006522560685973683, -0.015092426563342105, 0.008636236548684206, 0.004441229959605264, 0.005320611943289475, -9800074276184207e-19, -0.010191143523026322, -0.007796377074999998, 0.005595688935526317, -0.0016283605736842112, -0.012121330430263163, 0.008727131922578948, 0.002284515743368422, 0.002682018403026316, 0.02112667354078947, -0.013087226411842108, 0.011961740068421057, -0.0029621327447368426, -0.00711086599605263, -7157445806315789e-19, 0.00296389472118421, -0.002106245437236842, -2060961381578952e-19, -0.0023762942430657894, 0.0067748971048684214, 0.02305358949394737, 0.024209113952105267, -0.0010323672338157883, 5835666469736843e-19, 0.0011928865788157893, -0.013926641433421053, -0.0010454462015131592, -0.008992499685921052, 0.005833304399473685, 0.007247240086842105, 0.007005285494078946, 0.00532119499868421, -0.002409817022763158, -0.009118484332407894, 0.00902553582131579, 0.003644393953815789, -0.001458669926578947, -0.007759722557236839, -0.015974711869276317, 0.005593415395263159, -0.00699891096894737, 0.013671992413157898, 0.0030071592296052633, -0.00725996611631579, 0.00831834310973684, 15080351578947707e-21, 0.010492338298289472, -0.011587350163157897, 0.007662332826842105, 0.008755792813026311, 0.007074787369210524, 0.01825972633684211, 0.005628270758078947, 0.013933462579342108, 4695127519736841e-19, -0.016538577678947376, 0.013688757842105262, -0.00958296806763158, -0.01084689514210526, 0.004655695267894736, 0.002764839804828948, -0.008966435890710524, 0.01818742012328948, -0.002021167613421053, 0.011088005707894739, -0.003949641440789475, 0.016206056167105264, -0.018271099290000006, 0.012128778174342108, 0.016409871427894733, -0.005132905442789474, 0.013977325583552627, 0.0027061513397368423, -0.030432116805263153, 0.009202131592500001, -0.005219011863552631, -0.02768622942105263, 0.005146511143078947, 0.016741514684210528, 0.008617631309868421, 0.001446558946578948, -0.010973319831578945, -0.002393318402447369, 0.0025146223098815794, 0.002058704305, 0.009670727197499998, 0.006972026925486846, 0.007941592818026316, 0.006313998498157896, 0.004550358204605262, 0.019503475739868426, -0.00808706035526316, 0.0014521665658289477, 0.008814657770526316, -0.0034991419792894736, 0.001152647225789473, 0.0035165233944736848, -0.008015521834605265, 0.0030662299349999986, -0.008316208095789476, 0.0018460274468421055, 0.010874037769736845, 0.0019301458946052628, 0.014981398493289479, 0.0063040013951315785, 0.0011182811667105259, -0.001531185306381579, 0.007286755069710524, 0.007252432990381575, 0.005447569480263158, 0.005672717215565791, -0.011183678003684212, 0.0010281094409210528, 0.0037040489348026313, -0.018558228386052637, -0.0024118456417105264, 0.001912976863157895, 0.004824422551335526, -0.007085397379605263, 0.010146420386052636, -0.012797370635526323, 0.005280684883421054, -0.007430231397421052, 0.0012657216987105263, -0.003414122816315788, -0.001953577547894738, 0.004944337450526315, -0.009499839262763153, -0.007726497248157897, 0.02043591631578946, 0.005235241476657896, -0.016428867193421043, -0.02316521289473684, -5283661032894735e-19, 0.0039097042727631575, -33895851092105274e-20, 0.01083217157236842, -7426432255263161e-19, -0.00391929611618421, -0.007359749506882893, -0.0035571319606578938, 0.012559667453289472, 0.0058923027007894745, 0.015785403049999997, -0.013460644672368413, 8476099292105275e-19, -0.0033159500932236833, 0.008975023673552632, -0.01474813875868421, 0.01023825899394737, -0.01589566984736842, -7458934167105253e-19, 0.015296658677631575, 0.008350472782171053, -0.01303794148592105, 0.009825855495394734, -0.0031653390423157907, -0.0023992715984210533, 0.012867784544868418, -0.007730846508157893, -0.008233608065789473, -0.00578186875105263, 7660654657894731e-19, 0.007309484258749999, -0.004728002686184211, 0.024414807685526316, 0.07103057530263161, 138350805131579e-18, -0.0227730847868421, -0.002000239483157895, -2523412961842105e-19, 0.0036002593248947363, -0.00960461145763158, -0.014719047412763165, -0.010525172183026317, -0.008946292160657896, -0.00487614558486842, -0.015348885583552638, 0.005484280077631576, 0.0047399032012368425, -0.011332118468552635, 0.018375535672368423, 0.0028248364129736837, 0.002669773003710525, -0.013733811623947365, -0.012085463925657897, -0.005202895044802634, 0.0011071545386052636, 0.002822448957105263, -0.005775769501039475, -0.007958374655000005, -0.012961527270999999, 0.008736424775394736, 0.001623934084342105, -0.0029857376405, 0.006539750386447366, -921088730657895e-18, 0.01011317570105263, 0.004816758724236842, 0.01006797531394737, -0.024919923669736846, -0.013252434965131578, 0.004975805359868419, 0.0028436151710394737, 0.026767861371052633, 0.01679312495263158, 0.0029180558214473695, -0.01334025122631579, 0.006395531258157895, 0.012167909879868426, 0.0010437845743947376, 0.015899900866315795, -0.015891970886315786, -0.007016795418947369, 0.005720414304868421, 0.014279509605394737, 0.011842180225789475, 0.012174502878815788, -0.004032991572842103, -0.01191846249868421, 0.006569720230394738, -0.007758679420881577, 0.008243021787499999, -0.0056768207752631574, -0.010259304986710528, -0.005975154729605264, 0.022218811560526314, -0.01284212495, -0.0043886743385526325, -0.007587261113289475, -0.00100997453736842, 0.007466683218736842, 0.0017474622250000002, 0.011411024255263157, 0.007287669592105263, -0.011071793518989473, -0.007791523718026317, 0.0024424171717105266, 0.010883432589473684, 0.017893625253684212, 0.008674725273447368, 0.00948412372276316, 0.004439929401005265, -0.012966921410526314, -0.009952035897894734, -0.009481836221250003, 6631337719736842e-19, 0.013784739155921056, 0.01274559315868421, 0.015312255263157895, 0.014739994169736837, 0.001961665102973683, 0.016666361813815787, -0.01601210714707894, -0.003862630162710527, 0.0017456178976315803, 0.002383359211842105, 0.005658344708289475, 0.02028012731447368, 0.0038586854298289478, -0.003930425682236844, 0.005947570116842103, 0.006645788041973682, 0.00593962558863158, -0.0055098527475, -2709300878947366e-19, -0.02526451096052632, 0.0034957235959210526, -0.004797192927499998, 0.010852291108092103, -0.0024250138515789464, -0.008193180311052631, -0.006060304734868421, -0.005015898619736843, 0.009915213199078949, 0.0049576433317105265, 13137401934210517e-20, -0.011906290325000004, 0.005487915484868421, -0.0026353010490789476, -0.006053524171552631, -0.01679510672763158, 0.0019228737013157898, 0.01702610227171053, 0.007407213732763154, 0.001119691041315789, -0.0041095490676315806, -8301038464210527e-19, 0.0033998062114736845, 0.010597575788947365, 0.014257269136842107, 0.007372944618421052, -0.0035281079432894734, -0.017203723107131575, 0.004068165850842105, 0.00382046129631579, -0.011138788382368418, 0.01527541427763158, 0.01094105444394737, 0.003186118735263158, -0.011153858221842101, -0.001682062516447369, 1102902368421087e-20, -0.007634609815394738, -0.0024121695576315794, -0.004676494936184211, -0.004374885159342105, -0.004125291510394737, 8512605788947367e-19, -0.015911860113236847, -0.01630071632578947, 0.0075893821925000025, 0.016570409282894737, -0.0028060973136842106, -0.010812139536144735, -0.0035154795997368424, -0.007599472084868421, -0.0027118450077763152, 0.003790211149736841, -0.0016624428627631574, -0.006025105557500002, -0.00271212489868421, 0.004819238931578948, -2838972343421054e-19, 0.008508885079999997, 0.0037412741409736843, 0.003480958837938158, 0.01989113539539474, -0.007170555643552633, 0.007131082274999999, -0.00324891509618421, 0.017624990426578946, -0.008696587564605262, 0.009625076661710525, -0.003385572580052631, -0.0011940798148684204, 0.013382737070394736, -0.0019341717852631578, 0.014078404609210527, 0.006157531654513156, -0.00436843442881579, 0.010804814319078945, 0.016877812977368414, -0.004866282633157894, -0.004019908407105263, -0.008622002943026319, -0.001156913919736843, 0.00860937810460526, 0.00854736410960526, 0.006645876394210526, 0.006044397847105263, -0.0029129494269078955, 0.005728795454605264, 0.003868690374868421, 14415561068421056e-20, -0.011550837929210526, 0.0024273528732894744, 0.01675736555552631, 0.008618001551842105, -0.009086696278947369, -0.0019255664260000005, 0.017823474286842108, 0.023852092268289476, 0.005640211945657894, -0.0157103212696579, 0.002671248446973685, 5732126974736841e-19, -0.003747782739723685, -0.015167234880263156, -7942613815789339e-21, 20631670931578946e-20, 0.005739634929078944, 0.008089517185263155, -0.005618019369960528, -0.004716671923026316, 0.002440650008157895, -0.013887452536578948, 0.010245098745394738, 0.011824351372763156, -0.005547870031710528, -16388543065789472e-20, -0.0074466632465789466, 0.00498810127631579, 0.015039879665789478, -0.0040669246943421085, -0.005869341766447369, -0.024218201709868412, 0.001695024713552631, -0.005041553392631579, -0.00783228454736842, -0.005132145636842107, 579431247268421e-18, 0.0026811771932894746, -0.007146641212236844, -0.008457516277105264, -0.015692255188223682, 0.024690377132894726, 20765250613157882e-20, -0.0020539644646052624, -0.005768370673684211, 0.003702322850921053, 0.004201434479473683, 0.0028723328136842103, -0.014360589550263161, 0.003967806877105263, 0.004476002342671051, 0.004944308020131578, -0.01157276546618421, -0.009082047036973684, 0.0036693403972368425, 0.009826728072236843, 0.0074656336861842094, -6485088782894734e-19, -0.0014051343403289473, 0.007369758026842101, -0.010425479788289477, 0.01821328323157895, -0.012023113507986844, 0.001740522146710527, 0.005332594062894738, -0.001378770888421052, -0.015753834223815794, 0.0076369660996052635, -0.014926969834157896, 0.0038507784668157883, -0.0041886614165, 0.005354455710657894, -9931518065789487e-20, -0.002756159138157895, 0.014061157835657897, -13951124842105257e-20, -0.013132667226578947, -0.0019348305806052633, -0.009907254651973684, 0.009314450074276314, -0.006995864365000003, -0.004312180836447369, 0.004297729036710528, 0.0047553823486842116, -0.00931211325394737, 0.021702308997368424, 0.007112765311718424, -0.008150883757249996, -0.0015760545419210529, -16017972894736844e-20, 0.0012709232195131578, 0.008913342906302628, -0.009902096786842104, 0.03158665600926315, -0.0043072190056578944, 0.007661704021052634, 0.004888625593815791, 0.003962992540921054, 0.004328961708421054, -0.0062252458030263155, -0.0073411886288157905, -0.002077252053605263, -0.011778288789210526, -0.00824901193289474, -0.0036174059680000002, 0.008596170780328946, -0.007529505605394737, 0.00450591202768421, -0.016162284833421053, -0.006285099551315791, 0.01741020744342105, -0.004753392869697369, 0.004862889815131579, 0.008373598259, 0.007595550645657895, -0.007107993389473689, -0.008475462659473682, 5595674320263158e-19, -0.0034365798056578915, -0.016078184318421052, -0.010819015256052633, -0.0018932811597368428, -0.0060824286468421015, 0.009014217587631579, -0.005298673378684211, 0.0020203203051710524, 0.0023555486237763156, -0.011414600681763159, -0.029000318375131576, 0.012605560375, -0.015203555485526316, 0.013647403227894738, -0.008804857755526316, 0.008642128292289471, -7019206473684211e-19, 0.028421054261842115, 0.010750185311184211, 0.004273382298328947, 0.014962174191052634, -0.0091029727825, 0.004545577043947365, -0.005067943168815789, -0.008576309225131579, -0.009371516520921051, -0.003953041012539474, 0.0026335486594868413, 0.0010443595075789475, -0.006137380078947367, -0.019068207819210526, -0.0066171946843947395, 0.0154603859943421, -0.03956156613026316, -0.005423286051376317, 0.0064764647446052615, 0.017917068601973684, 0.018834929819078944, -0.023795076729473678, -0.005232680938421053, 0.007063256785526317, -0.002471332747368421, -0.005540072479078948, 0.0030247992273684196, -0.041372428210526314, -0.022792676082894738, 0.01496056775592105, 7162006171052637e-20, -0.0054049346089473675, -5917285729473686e-19, -0.006140541838736841, 0.01165498020263158, 7520184688157894e-19, -0.004048719246052633, -0.004093513149078948, 0.001113782621578947, -0.00515289844513158, -0.014532121503749999, -0.005462963103684211, 0.002013934241710526, 0.006934004597374998, 0.011849665684605267, -0.02845128821973684, -0.0027645604678947374, -0.029641802678947365, 0.005846543234157898, 0.004001273209868421, 0.009660376192697369, -0.01431830397552632, -0.0034636234957236833, -0.015780388346842117, -0.0061515257567105255, 0.011677517784078944, 0.011294756013947365, 0.009406988080263162, 0.02362260060394736, 0.006315555671052633, -0.00983715779947368, -0.012793336953947368, -0.010380582411513158, -0.005019749015, 0.004049450225131579, 0.017717702139473684, 0.012014558753947363, -0.004216072575789474, 0.012309840076065792, 0.003926167156578947, -0.011685566748684212, -25353602302631577e-22, -0.005299348902368422, 0.007730379013289471, -0.0027699679941184216, -0.0069104686293421065, -0.002654266115921053, -0.012859640121842106, -0.0107146154105921, 0.004399860249078947, -0.006205988169868421, -0.002287691709381579, 0.0022477117532631575, -0.011032372216710525, 0.0038386147140789476, 0.017001313835526322, 0.003409522446052632, 0.0038818556153947365, 0.0010723420983289483, 0.007902039610460527, 0.0023776093863157894, -0.006922669011657895, -0.012493596986842102, 5051128443421054e-19, -0.003519559938197369, 0.009428645297631578, -0.0010605874422368415, -0.008557814389473686, -7813989881578948e-19, -0.008372406573684214, 9731762513157829e-20, -0.008460361298552634, -0.0022174336363157904, -0.008624776876973684, 11917679249999991e-20, 0.006416730669828947, 0.008520198330263157, 0.012873614050657895, 0.011955042275394739, 0.01041146601725, -0.007033908750526316, -0.0016643551606578938, -0.011975207748157898, -0.010176406554210527, 0.0046722559355434215, -0.019248556189473687, 0.012035626013513158, 0.005876074411052633, 0.0023601008795000006, 0.0017393916595131586, -0.006760177633552631, 0.0037472353740789477, 0.08577118239473684, -0.004266319282368422, -0.0071308153913157875, 0.002913963492236842, -0.011218220720921051, 0.0016349006751315786, -0.0019050253921052633, -0.003319563322894737, -0.004499976557500002, 0.009833074842368417, 0.007605858973947369, 0.005772069280921054, -5503060188947367e-19, 0.013013069021578944, -0.0034565342047368423, -0.01143237421848684, 0.01110795669013158, -987561984539474e-18, -0.006423849459473684, 0.00217356449263158, 0.0010567873492894734, 0.014532239263815788, 0.010447370052631582, -0.00759626205513158, -0.0022266032110526313, -0.008538287243881578, -0.01131031077157895, -0.015313536264473682, 0.005158005157763159, 0.0030549536626315785, 0.004764115755657894, -0.012034718590789474, -0.006626763940263157, 0.009110119795921048, -0.002301413071921053, 0.015578638884210528, -0.005167726482500001, 0.02117604996315789, 0.008285337067996052, -0.007844231455157892, -0.01983585482868422, 0.008469638907236843, 3119132776315813e-20, -0.001960619750092105, -0.0174250582075, 0.0024971948229210532, -0.009844892709210526, -0.00997894878157895, 0.008923550396710523, -0.015006534729868421, 0.010365114785526321, -0.01453934758578947, -0.003352099966710527, 7359328694736843e-19, -0.010912618383552628, 0.00553644026263158, -0.0020364845940789474, 0.01638792804421053, -0.002702654283236842, 8317131059210523e-19, -0.0062164165, 0.01416901248881579, -0.001157289313026316, 0.0015120998847368426, 0.018197012598026318, 0.018230856374999993, 0.0013759326027105259, -0.0022414605464473685, 0.010594263889473684, 0.0032048177697368407, 0.0015967663478421053, 0.005898981746447367, 0.0026566908555921056, 0.007526576979868416, 0.006680355165921054, -0.010573069984868419, -0.0037745313918421054, 0.005754974540473685, 0.008721350822763157, -0.004220488521921052, 0.007543852856315786, 0.002001725290789474, 3765012028947365e-19, -0.005974376834473688, -0.007132448870578947, -0.008149476120263158, 0.020858640447368428, -0.0026150683706578945, 0.0025981752977631586, 0.011055772810526318, 0.006417484732236842, 0.02127346352631579, -0.010789793555, 0.0018354179835526315, 0.01635032267421053, -0.00914016103246053, 0.00721719150447368, -0.011749975486184212, 0.007983058785, -0.0025599285438157905, -0.02525250945921052, 0.016565419086578947, -0.0049727678667105275, 0.016954254666710526, 0.0072252290184210526, 0.00663506177881579, -0.016708790731052633, -0.019179279734736834, 0.0036575822153815793, -0.0036278681642105243, 9362055535526312e-19, 0.003667399366578948, -0.005599063442105262, -0.001710235229973684, -0.0020441094883684213, 0.008895651518289471, 0.011197020705263155, -0.0096675727705921, 0.0048109815131578935, -0.009713690278157895, -6161499026315836e-20, 0.013903376549342109, -0.0037505515171052627, -0.004402282192631579, -0.00803135064986842, -0.0022901599207236834, 0.0028172990298684225, 0.005441962186973684, 0.008157506930394737, -0.005246615045631578, 0.0017373259923157893, -0.011001224905657895, 0.0012983470696052632, -0.01309617162052632, 5287650694736846e-19, -0.012678124126447364, -0.004449979991315788, 0.013012943638552632, 0.002311609178421053, 0.00852208751355263, -0.0021326908651973695, 0.006498695877500001, -0.012073736925131582, 0.010822192646592104, 0.004732820625263159, -0.003690172558684211, -0.009818942454868423, -0.00727969328513158, -0.01263686636618421, -0.003183486671921052, -0.009880075140921055, 0.002198814761578948, 0.013470662695263156, 0.00607287450868421, -6002962989999996e-19, 0.008114174997552634, 0.011275753842105262, -0.005673379224736841, 0.0031662297654605257, 0.0028777117961842117, 0.008016936837894739, 0.0017901154897368426, -0.006646555544013159, -0.008096424208289474, -0.006122036452894737, -0.0057617752151315794, 0.0011516110418421056, 0.0033034063114473684, 0.001144898634342105, 0.015016336455263162, -0.005089427256578948, 0.011095485811210526, -0.01487947794381579, 2754231664473685e-19, 0.01434458742828948, 0.004142680879736844, -0.008173420285131577, 0.009047083722894741, 0.006638912060921054, -0.010928462396842106, 0.005584001594493421, -0.006758851203157896, 0.012239943157835526, 7178325472368416e-19, 0.004164529241644737, 0.006919659793157895, 0.0018766501502631577, 0.005851904381052632, 0.01649575659144737, 0.018543284467894737, -0.004570943860131577, -0.014199454217763158, -0.004522597645789472, 0.01323128955736842, 0.009430725228289473, 4302028357894734e-19, 0.014124286351315792, 0.0014682764307894735, 0.014347456733684217, -0.004273947661315787, -0.005397340513289473, 0.004777006242105263, 0.0014340101824815783, 0.004214361838684211, 0.004253698227473684, -0.005495129646250002, -0.004944426877631579, 0.001132264872631579, -0.025759664019736846, 0.01343974873236842, 0.007074848766842105, -0.017592669572894747, 0.0017375639004473685, 0.015513802537763154, -976651714342105e-18, 0.006099546812236844, 0.009297965083289474, -0.006545829302368422, 0.002187739041315791, 0.003335506018026315, 0.0021257748652631593, 0.007083832225526319, -0.00821666152184211, 0.008502307442157893, -0.0012726394867368417, 0.003975927348552632, 0.005120596614473684, 0.005579327967368418, -0.0076789852039473696, -0.021034838578947373, 0.007545610900131577, 0.011339017010394737, 0.01220300189605263, 0.012834558334486842, 23943841328947444e-20, -0.012060543739868423, -9013390900000001e-19, -0.007001447220394739, 0.001807072239342103, -0.007920413789473684, -0.014183284144078948, 0.0032435898167105224, 0.007661070786578948, -0.009576734622368422, -24735532930263165e-20, -3279625464473687e-19, 0.00592114891631579, -0.0031360228920394744, -0.004423669705131578, -0.006236715882473684, -0.01428929095, 0.0012041522547368432, 0.009992463885789478, 0.014660581713355257, -0.012100258024789475, -0.0041604909128947366, -0.0022737396475000005, -0.005318546005078945, -0.0019765347979631576, 0.001943228074394737, 0.01009488755486842, 0.006165831676578947, 0.0018300388325000001, -18122561157894723e-20, -0.020566950382894744, -0.006887413951872369, 0.004043231116447368, 0.014405956009276313, -0.004649199056078947, 0.016667253566842104, -0.012720103426315793, -0.004804016313157894, -4011695289473683e-19, 0.004846170921052631, -0.0016384565850263162, 0.017794608296052634, -0.007291804857605264, 5409149652631579e-19, -0.005412328068421052, 0.014002738125526317, 0.007782216855789474, 0.03379361171052632, -0.0037693036657894725, 0.006207439997131578, 0.011665550201763155, -0.002727257783815789, 0.006404820097236843, -0.007757448749342103, 0.00321114124381579, -0.005974114834342104, -0.017798501374999998, 0.008996167303710525, 0.004107372101447368, 0.007539583035263157, -0.0014233594372368415, 0.00381117836013158, 0.008256078101842102, -0.0018291068210526304, 0.0019358302312894743, -0.010674378317894738, 0.0065658293554078945, -0.007450003366710528, 0.004437219244605264, -0.024618154752631582, -0.015038326359078957, -0.00463826566381579, 0.007930537400131579, 0.004519121789078946, -21704581684210515e-20, -0.007922356677894737, -0.011271936131578942, 0.006213316302368421, -0.001811201335361843, -0.06298805399342101, -0.003931348754999999, -0.002375323733289475, 0.006955065128421053, 0.011551465797368423, 0.005049561330973682, -0.004226440632631578, 0.001415731466381579, -13998377784210452e-20, -0.0011909930659210531, -0.002045448113026316, -7439456209210522e-19, 0.008089150971763161, -0.007385254353552632, 0.0017794121346052629, -0.0021466796694736847, -0.007901907795526318, -0.006739856069736841, -0.0031380352994736845, 0.0076046099585000025, -0.011527594351315795, -0.0020396639011052635, 0.001525548389342105, -0.006094216933684211, -0.0014722651828947364, -4518903077631577e-19, 0.007140101749473689, -0.011676537059210524, -0.019966328755921053, -0.0024167389288157906, -0.008110973655078945, -0.010138389487328942, 0.004652459228947369, 0.003344180307855263, -0.00269698604401316, -0.006219439502236842, -0.012621290809263159, -0.010441855874605261, -0.001525004825868421, 3106502772368417e-19, -0.02632054453157896, 0.014578032460263153, -0.004134980474473683, 11510845465789741e-21, 0.0062397942408684215, -0.0063305206980263165, -0.0032845915709868406, -0.011880825206578951, -0.004127339640789471, -0.005412744576842107, 5791435789473685e-19, -0.005604593690263158, 0.01140999920789474, -0.0035105268881578944, -0.005644377784736843, 3777405411052633e-19, 0.006655294573118422, 0.012310034789868423, -0.012314680914342105, -0.004660671697236843, 0.019227642512499997, 0.012370556660526312, 0.0018540437435131578, 2843068044736842e-19, 0.0029149404551315795, 0.001349117293078947, 0.004231145650921054, 0.005014896011447368, 0.0030759806921052636, 0.002634996195394737, -0.02146838184355263, -0.023354627235526327, 0.007463801508881578, -0.044740355858815806, 16885995480789474e-21, 0.0018187605642105266, -0.0028608081773684206, -0.019586663092236847, -0.005291358396439473, -9306446955263162e-19, 9336062423026312e-19, 0.00640387573013158, -0.05765600515921052, -0.0010193050008289466, 0.0029813614198157894, 0.0017824373404078948, -0.006496215178552631, 0.024087691802631577, -0.010348639678947369, 503021751973684e-18, -0.009403571023947366, 0.012732326389460522, -0.005403565589605263, 10905120605263125e-20, -0.008504000929605262, 0.006370600620263157, 0.018242643109210525, 0.009379113575526317, -0.01214825572302631, -0.0015711109278947369, -0.0020749150806842107, 0.0051656843653947355, -0.015150247375526317, 0.0034633881215789457, -0.0023204803727631573, 0.0013554988172368421, -0.00916673603631579, -1386599248684208e-19, -0.011236653686842102, 0.01057515615355263, 0.0038270946907894747, 0.0032054099676315792, -718647992236842e-18, -8057763245394725e-19, -0.004644138220394738, 5584668676973688e-19, 0.004134472640657893, 0.003242992475139473, 0.004408569986710524, 0.006886769568421052, 0.0022040188868421057, 0.004717420271184211, -0.010944220514868425, -0.01496134418960526, -0.004904572456118423, -0.0029349479123026317, 5269890798684209e-19, -0.018642433568684214, -0.0014636822255263157, -0.0032874282358578933, -0.005220993034210527, -0.001006430675144737, 9930258057894734e-19, 0.01337606780197368, 0.009240478431184211, -0.01117918292618421, 0.015037270521710534, 0.00705424925763158, 0.004022910573421053, 0.004511536920394735, 7300990415789472e-19, 0.0025198337564868423, 0.004174408284605264, -0.006822327408157894, -0.012508884771973679, 0.0018977242146052643, 0.00169175941868421, 0.00914618583809211, 0.00616711017276316, -0.016066297167105267, -0.007600618392368421, -5936514901315801e-19, 0.009191851769736843, -0.01048495533644737, 0.0039003314751315785, 0.010082093744078946, -0.02150961690736843, -0.003076141387631579, 0.01795051239210526, -0.0016097397646052626, 0.006738568165394737, -0.01008712938552631, -0.0023239680332894736, -0.0023542645427631586, -0.007415254536973685, -0.0017370888950000002, -2142969864736847e-19, -0.0019526079594736842, 0.004812759554289475, -0.003177666265657895, -0.010193668303157894, -0.008950753272763155, -0.012276084238157898, -0.013801354708684207, 0.013260181611973685, 0.005137841782236843, -0.005623419413947369, 0.002380635332763157, 0.020261579571842093, 0.0025086264638157895, 23285078407894738e-20, -0.013896984565526316, -0.002813308350394737, 0.006464827561842104, -0.0017387912031578952, -0.009293710947368423, -0.002234433483973683, 0.0029236971019736837, -7009606947368418e-19, 0.004321338025526315, 0.011410774383157896, 0.0019641712277631575, -0.0032173488855263156, -9017514617105258e-19, 0.02536431413421052, -0.0036204208476315796, -0.0045066121440394714, 0.007895695332842106, 0.01375771906894737, 0.0016665629351973685, -0.009256044322434214, -0.010135795456671053, 0.008737079069078947, 0.0034428967317105263, -0.010638219975263161, -0.004573688986184211, -0.008506904400102367, 0.0025543856753947364, 0.004874314954210525, 0.010396809270921051, -0.0018452750817105265, 0.01090056822052632, 0.02098761590078947, 0.009814058689144733, -0.0029276505494736844, -0.010893099969697373, 0.01975842706710526, -0.010948870352592106, 0.0058412445308815815, 0.015515693848684214, 0.0020952677422368424, 0.008907295886842106, 0.00873527318223684, -0.006631097216973685, -0.01977647116223684, 0.010740387438947363, 0.008736050202499998, -6532119030263152e-19, -8522597289473685e-19, 0.007881729391184214, 0.007262564786315789, 0.009642556828684206, 0.009887033669644734, -0.00506204858236842, 0.00914667588671053, -0.005646160281184208, 0.0015682480643947365, 0.007187644667573682, -6413499337828947e-19, 0.0014132899411842103, 0.0017755321165263149, -0.007160940067000004, 0.012367878591973682, 22851084263157844e-20, -0.006308410619078947, -0.0015791580263157898, 0.00442315712593421, -0.006452675031118422, -0.009020969568421053, -0.011030041889539469, -8780194159210523e-19, 9627984798684214e-19, 0.00363151196994737, 0.02183342311710526, 0.02024013596973684, -0.012353824388684213, -764319970657895e-18, 0.002105059234210527, -0.0014566305570592104, 0.002706323287631579, 0.00607090862407895, -0.009545597578157896, -0.004247753485894737, -0.0176261248381579, -0.0031491103884210524, -0.003108941359539473, 0.015593445543815788, -0.04427306710881578, -0.0020792380994736847, 0.011489951907105264, 0.006966976375342106, 0.0015082572486578947, 0.007737702031710525, -0.00655683788473684, 0.007863643000657894, 0.002917634675013158, -0.004152638770789473, 0.005619210159473683, 0.005586618189342104, 0.010026886728421051, -0.004179918709473686, -0.005501686800131579, -0.00604261921421053, -0.0071300491338157895, 0.014459129589473686, -0.0037379425788157897, -0.0020940462386842117, -0.00957774127394737, -0.03357854765131578, 0.025668219275000004, 0.022622876078947373, 0.0022629713582894718, -0.0026858775323684216, -0.0017051095038157894, 0.003815842962894737, -3828872972368422e-19, 0.0026066615468157894, 0.012387053006578948, -0.006318214374868418, -0.007521578666315793, -0.01284997625631579, 0.012826012949078947, 0.0010223195625, -0.011615881295131579, 0.0022139161670263153, -0.002016348744078947, -0.0028064120447368417, -0.015572008834210525, -0.0019618904405263164, 0.00544554776289474, 0.009761993845921054, -0.012984902144736842, -0.014145811457894734, -0.008978529723144736, 0.004056017691315789, -0.011844596710394733, -0.0059587758225, 0.007508870492105264, -0.005443937433289474, 0.002935879441578947, 0.01486225123960526, -0.005532202826052629, 0.005462015192631581, -0.02565744589868421, -0.008383098813815791, 0.003647495577368422, 5357671111842098e-19, 0.01166961910486842, -0.006377186925131579, 0.0127008994825, -0.009436918356578944, 0.0020323967420921053, -0.008456428355526319, -2027747211842104e-19, -0.0030937144914473694, -0.011085721413078948, -0.009645654179210527, -0.014846991478947372, -0.0035684288476315797, -0.011654160063684214, -0.01581150187026316, -0.016840036789473687, 0.013057866414473684, -0.008234539141578947, 0.0053163960105263195, 0.020490004785526317, -0.00960410656486842, -0.006657243668236841, 0.010736420357105264, -0.01748494961973684, 0.0011016242359736844, 0.005718755139868422, 0.006338006613157893, 0.0038684128078947367, 0.005595157857631579, 0.017694987824210535, 0.017391755352355258, -0.003702699658552634, -0.005022188236513158, 0.01342638474771316, -0.0043205563098684206, -0.0028454328957894745, 2592531746052632e-19, -0.004767219290789473, 0.013560908384539477, 0.005906873550263159, -0.009617733145394736, 0.003591151950263157, 0.005010814367368423, 0.0012510964286842107, 0.0028993149072368417, -0.0051906266312368434, 0.00729437020368421, -0.012531499855657886, 0.020476676778750005, -0.009869155927894734, 0.0025973456112368416, -0.021903372915789476, 0.008153542140921052, -0.006835870289605262, -0.010486773017592106, 0.017626112727631586, -0.004606312977368421, -0.014957404596052633, 0.0020897874979618424, -0.004724369788980265, 0.021548606073684213, -0.0019029721914473681, 0.006200722453289475, -0.003450824262276317, -0.006826156169210524, -0.010176031075657897, 0.024789349911842107, 0.003143936896315789, -0.004955119694078948, 9158874664473686e-19, 0.0052856249526315804, 0.01390172287763158, 0.004978571828947366, -0.0032051206281578947, -0.007972612475236842, -0.007769723397631579, -0.00202725623381579, -0.003416697538776315, -0.002556709217407894, 0.0184408019, -0.01105052606855263, -0.014664148855789474, 0.003882449320657895, -0.012429670850921054, 0.013084466028552635, -0.04336451231578946, 0.0074979511960526326, -0.001663643616907895, 0.008059816289473682, -0.011445970542105267, -0.004167850928697367, -0.003230411173657895, 0.02097656965710526, -0.011578596098421053, 0.012013696860657893, 0.001233423443421052, -0.002649905661144737, -0.00883562393153947, 0.0015486095338157892, -0.010413099061842105, 0.013987708639236847, -0.0038697919174999996, 0.006219689598421055, 0.006652394345230264, -0.005381284718815789, -0.0037626181478947387, 0.01059816618401315, 0.003220842913421052, 0.0035804951468421044, 0.010183990906447369, -0.009547694365789472, 7697464371184215e-19, -0.011326520949342108, 0.036538593302236834, 9323258973684188e-20, -0.008973688185921053, 0.00706366331381579, 0.001107784416394737, -4910452642105268e-19, -6440596276315794e-19, -0.0036792987653684202, 0.003713873318157893, -0.004735835042960525, -9658112065789478e-19, -0.043979574686842084, -0.0016790318328947353, 9925788503157894e-19, 0.018722528654473682, -0.0021518665293421054, 0.0035296605411842103, 1413653897368415e-19, -0.017016988203947366, 0.004561038191973685, 0.015442165966184201, -0.007485759814473685, -0.017065918415000002, 0.009342482221710524, -0.0020734458669736835, -0.002520825664789474, -0.021231756026315784, -0.010013884122368423, 0.009265903680263157, 0.008139276791052632, -5609036057894738e-19, 0.015773905215697364, -0.001884182508960525, -0.0024270794468947356, -0.00422654353631579, 0.006008762833684209, -0.003698271740263158, 0.016081907390789473, 0.030718033629736848, -0.007108369866842106, 0.00527163336881579, -9271790684210529e-19, 0.0068789392490789456, -0.013093138075605264, -0.012924308120526315, 0.00556886656968421, 0.0033076618509210527, 0.0017935490473684217, -0.008094466807394738, -0.01079597931, 0.01151358625263158, 0.00893792486236842, 0.010344446836842108, -0.00719051074644737, 0.00572758606, 0.004846286956973685, 0.00814658403092105, -0.0010492790623684207, 0.0049120969460526315, -0.01486755767197368, 0.004852195027565792, -0.007043126832710525, 0.005356651270263156, -0.0035065615885723684, -0.005829078253026317, 0.025083412392631576, 0.0015541765726315804, -0.013320558341842105, -0.027978110792105267, -0.004866113275657896, 0.009822611491184208, -0.004338714495526316, 0.028622747207894733, 0.0056140354747368434, -0.012210432556184212, 0.0033045029190263164, -19000230480263145e-20, -0.0034141616881578937, -0.004623406075394737, 0.006392982858421052, 0.01835209741710526, 0.01747985185131579, 0.004233065692460527, 0.01626176455263158, 0.0032433631718421056, -0.011749469372421053, -0.012891163621052632, -0.01571628433157894, 0.002652207523026316, 0.004507458543026318, -0.01775668739868421, -0.03493414880657894, -0.016362935907894737, 7675142188157897e-19, 0.010285956762684217, -0.0014735680384210526, 0.011252831868552636, 9547897207894737e-19, 0.006510753468289477, 0.005189211297763158, -0.013117319414473682, 0.003801194065131578, -0.008176472670263162, -0.008538372863026316, 0.02108607474342105, 0.0037161164223684204, -0.004774306337894736, -0.0077946213527631605, 0.0024585640678947366, -0.012176232483421057, -0.012235060736184205, 0.001400212257894737, 0.0027084579294736843, 0.0068722990685526324, 0.013335502111842099, -0.005830226586052632, 0.011873504235263161, -0.013693625648026312, -0.010449696567302632, 0.011044927082500003, 0.015400494224552629, -0.009381916401355262, 0.006673642672368421, -0.0018263740446052626, -0.0021770728546052624, 0.016361497218421055, -0.01863254121315789, -0.003530500149210525, -0.03730359020723685, -0.004191118148289474, -0.0045071628236842114, 0.015596569568947373, 0.004240642962276315, -0.002759536991368422, 0.005148003131355265, -0.0069468455677631595, 0.012819585946447368, -0.003170211528815789, 0.01752115107447369, 0.009766708002105265, 0.01720768516973684, -0.01617324446578948, 0.012112183639473681, -0.021386946318421057, -19106013060526326e-20, 0.006491905236710525, 0.012694083912631583, -0.012121427248552632, 0.007453259151052631, -0.005300583340657895, -0.0034357232692105253, -0.008234549374210526, -0.0049134867761842105, -0.011864055638157895, -0.00727513381118421, -0.006225588572394736, -0.014474562209210527, -1696423735526317e-19, -0.009927942404210525, 0.005164234018026316, 0.0017515462315789469, 0.0015904607235526311, 0.007963644751578946, 0.012216724002631584, -0.009501306335068424, -0.003338244066407896, -0.013702270143026316, 3177477896842107e-19, -0.004519560832171056, 0.002465137685263159, 0.0021053644855789483, 0.01910074195263158, 0.012031324014473682, -0.0018186422331578943, 0.005212327788421051, -0.004785163042710527, 0.0021153964885526322, -0.00444928972188158, -0.0035029865, 0.0075856674897368396, -0.016637170858460525, -0.0049104649688157895, 0.004211803076513158, -8546719754210526e-19, -0.005023115469473685, 0.0029476111911842105, 0.002885427894921053, 0.004207519965584211, -0.0045995042944736875, 0.003015317669210526, -0.003959649376578948, -0.001799221694921052, -0.010122554486973682, -0.004602558039210528, 0.0013513901315789464, 3764912463157896e-19, 0.008489159527105262, 0.014707852295131572, 0.002345036650789474, -0.0032689961036842102, 0.04255329955263159, -0.014716855848684204, 0.008619987162236838, 0.008365918811578948, -0.005013759794736842, 0.004195959585499997, -0.008992120611710525, -0.009782703207236846, -0.0022335605896052625, 0.01287937127763158, -0.015554637754473693, 0.008397985909605265, 0.002251561622499998, -0.010050093168815789, 0.008956767632171053, 0.013687852065394742, 0.013600534268289477, 0.004365934441315789, -0.0030305592554868413, -0.00781057913469737, -0.004966902079605262, 0.01856187427644737, -0.0025631659986842118, 0.004677612719921054, 10226186131578904e-20, -0.014421684380263157, 0.016739205349605258, 0.0050146044172894744, 0.011911084407631578, -0.002687138399210526, 0.00960758048539474, -0.002726553521315789, -2118536161842109e-19, 0.013187813793947371, 0.009969895463026316, 0.006658861126052631, -0.0018322755946052636, -0.0017487937331578944, -0.011101524417894743, -0.032939431818421065, 0.01520578899605263, 0.0015081202571052632, -0.005066026860486843, 493556515986842e-18, 0.004060829064605263, -0.005561150131894735, 0.010997560033026309, 0.004095647503947369, 0.012622729288684204, -0.004958941837157896, 0.006538527521447367, -0.0010266161943421049, -0.004851542462973687, 0.0016268616459210535, 0.008403855759605262, -0.005476859455, -0.00812804427618421, 0.007041481924657892, 8838693684210528e-20, 0.00597193902618421, -0.00842409854263158, 0.0024697172419736856, 0.005663838686578944, 0.0036075020965789487, -0.0023292463477631578, -0.0032376719465789477, 0.021101475338026313, 26567486563157904e-20, 0.016493054231184204, -0.002458445587631579, 0.0010258956694736841, 0.00225805411368421, 0.0031990768135526323, 0.006263685490526316, -0.004572679283552632, 0.009529538310526317, -0.011298854067368422, -0.010216326432368422, -0.01634466709473685, -0.014281002560460524, 2702401223684224e-20, 0.005255444044671053, -5290619164473683e-19, 0.020079138140789477, -0.0017828449621052637, -0.012192540535789468, -0.007199579816184209, -0.00116835002625, 0.00958368675736842, 0.007733851895789477, 0.007963292808289474, 0.025216065143421052, 0.004103331857894736, 0.0030591781828947368, -0.009872114714473685, -0.004663548545, 0.004991833832105262, -0.006863926871710525, 0.001242838931578947, 0.020425079027802634, 0.012370465663815786, -0.012126274007894736, 0.010670443024473687, -0.01464566428460526, -0.0038673775906710524, 41958086710526394e-21, 0.01994244099210526, 0.015357990706842106, 0.0063989385026315794, -0.018309239200000004, 0.006747877917368419, -0.017506960167236837, 0.005670401942631581, -0.010581732321578946, 0.0011620065078947373, 0.012163235759210531, 0.006399715106223681, -0.006113071873210528, -0.0028651888345789466, 0.002149627898157895, -0.012140688709210527, -0.010713522528947373, 0.02737408816710527, 0.017518066717105266, -0.005137931570986841, 0.003589904351447368, 0.0010994190049210533, -0.004798525595026317, -4554749059210497e-20, -6981043210526358e-20, 0.017134092135131583, 0.012083527265789476, -0.049615527359210515, 0.005816751165736842, 0.01857131190000001, 0.02351225466336842, 0.01219104790131579, -0.0010487995125921048, -0.0044726659714473685, -0.001028941063157895, -0.005443464117499998, -0.00634262967868421, 0.010381099005263152, 0.001703392962105263, -0.009139037917894735, 0.009512460323684208, 0.008586436496315792, -0.025455710537105262, -0.009792295319078947, -7742059002744737e-19, 0.018877256644736842, 0.038857334956578955, 0.003912381590921053, -0.008361733056842105, 0.016590833038421057, -0.005869556491710525, 0.009990736888552633, 38346460510526274e-20, -0.016626637246578948, -0.012364668933289474, 0.0018547245361842113, 0.006512999228605265, -0.001085481154868421, -0.009963445404999997, 0.004301809971973684, 3661409990131576e-19, -4224867659394737e-19, 48160601578947393e-20, -0.007223044006763162, -0.026113254673289465, -0.0013004677222368422, -0.0017831314044736836, 0.01561539529144738, -0.0066719939618421036, -0.00877529002351316, 0.006605579253289475, 0.005603149853552632, -0.007193712031578948, -0.0016247132320263158, -0.012534181940394738, 0.017229109368421053, 0.00245370861631579, -0.006031722248552632, 0.0031117475930263158, 0.0043886369376315805, -0.0024453895729249996, 0.00690473798328947, 40740072210526353e-20, -0.0031424490643421057, 0.019926203121315794, 0.012182200482894739, 0.008118145491578951, -0.005559053631315788, -27164370357368446e-20, -0.003351124758092105, 0.005957678860368421, -0.008513101869473681, 0.007304541067499999, 0.019957336234210518, -0.0030209489469736834, 0.004469626572763158, 0.012090736671578948, 0.01514115723331579, 0.0042360726635526326, -0.010162506523684207, -0.002649304801184211, -0.007750173208749997, 0.0019587431771447374, -0.027095424518421053, 0.0066075871005263145, 0.00536601891631579, -0.0010357673420394737, -0.003466868494342106, 0.014316960686578954, 0.0023369776231578956, -0.0053653818119210545, -0.007858214859999999, -0.013146294391315785, -0.0018566735342105262, -0.009514895538421051, -0.0036132000074342112, 0.0034368430490789486, -8554010195394731e-19, -0.0032387031372368437, 0.00244777456131579, -0.006286163061842106, 0.011771267721710532, 0.023035620363157896, -0.0043442739443421054, -0.009922730226315792, -0.004276738937499999, -0.0035189323507894745, 0.0039030267724473704, 0.014395429023592102, -0.0012053757906578947, -2897619489473682e-19, 0.007045867771144736, 0.007517767199210526, 0.007418771915644738, 0.010169157498289476, 0.00706302323276316, 0.013311043676250002, 0.003038169512894737, 0.0033463043809210517, 0.001753204881197368, -0.0074550630986842115, -0.03247426388684211, -0.014712809272763156, -0.01257650307744737, -0.005583758863815789, -0.010988394333684212, -0.01094829823105263, 0.014527793146184208, -0.01726736960019736, -0.0011412191313157898, -0.003875160005921052, 0.0054491025328289484, 0.00764098283223684, -0.01397128377631579, 0.020156240986078953, -0.018178711318157893, 0.007760771186842106, -0.012693300230263159, 0.0034562666953947383, 0.017623470872368423, 0.01328646389205263, 0.006033057996184212, 0.0021477171030263157, 0.004209592630394737, 0.022607883206578958, 45995770960526315e-20, 0.004256902114473686, 0.007727120836526311, -0.011495399911315795, -0.006097572578026317, -0.003288532194342106, 23524967355263143e-20, -0.01843602415421052, -0.006332212189999999, -0.007104603521578947, -0.006046406687763155, 0.0031444280434210527, 0.011026709301315791, 0.007965343235657892, -7478460321052628e-19, 0.010399411723157894, -0.003222595633552633, 0.0013722621246052631, -9306063203684211e-19, -0.008244672536447365, 0.010224801592763153, 0.011236862973157893, 0.002438936607828946, -0.0011834995152631578, -0.007761896696973684, -0.006536142010526313, -0.004305835025789474, -0.006375306423552633, 0.002894340127526317, -0.007056530478157897, -0.006344087711473684, 0.012371267300526317, -0.008661172924210528, 0.016608231906578945, 0.006209598555605264, -0.0049610081385394736, -0.006289596580421053, -0.008653004873157896, 0.006589724684342105, 0.0042221396663157905, -0.024205309596052636, -0.007927559016842107, -0.0036796517148684213, -0.010860645916842101, -0.001776141146973683, -0.0066375001164473675, 0.002395305515921052, -0.014593319744736844, 0.00733454749668421, 0.0019130213015789476, -0.02945044170131579, 0.0021041659146052625, -0.002779561371539474, -0.020078335207894735, 0.003642550809710527, 5936502644736846e-19, 0.00325616999868421, 0.017399437181578953, -0.06370752007631578, -0.003701780296631579, 0.007564594753552632, -0.00405948423839737, 0.0015840840405263162, 0.005836310675263158, -0.012381032086315788, -0.004665367583947368, -0.0010173959317894734, 0.005156387308802632, -0.0165339495006579, 734178938157895e-18, 0.024508261125789473, 0.01724277075526316, 0.008913617889078948, 0.018123411353289477, 0.019972735151315802, -0.015223236485526315, -0.011504417352105265, 0.010046699026184209, -0.009774468743421052, 0.014051472367763159, -799595632236844e-19, 0.015914003425263158, -0.010235261282894738, -0.012426796318973685, -0.00529559477105263, 0.0032275154818421047, -0.012022474961184216, 0.004842165463157897, -0.012777494966842105, 0.007940708949736842, -0.010386868507894734, -0.012277893373289472, -0.01469461501513158, 6472758955460526e-19, 0.011309826192631581, 0.0014896182946052632, -0.0018290806492105261, 0.004781091154078948, 0.009413893570921053, 0.00916419533118421, -0.002920155307368421, -0.004322433785789473, 0.010922147476842106, -9692939010657897e-19, -0.00471161965105263, 0.0022456688428947364, -0.01511019358289474, 0.01469485253026316, -0.0034939871920921027, 0.005169176186973684, -0.004767383189802632, -0.004363123971710525, 0.008160435356184211, 0.008593854647631578, -0.014373928093157892, 0.012998453866184211, 0.012818183890921054, -0.0012967544054736846, 0.018860078121447365, 0.011299536434868421, 0.010162780092499995, 0.010768595093881578, 0.006929429669736845, -0.009301306071052631, -0.001229964434210526, 0.022915811622105268, 0.005473494591263157, 0.01684595049736842, 0.0068085582832894745, -0.009735548395394736, -0.008009809031052632, 0.00818278650394737, -0.00514607482631579, -0.0017882432596052638, -0.003795041893157895, -0.0028177598829473675, -0.009401223562894738, -0.015638386469736837, -0.013144470036842108, -0.0025362829124999987, -0.015570190517552634, 0.0072135779351315795, -0.0033293784007894737, 0.0033921677573684203, 0.0171126722368421, -0.016200724738157896, 0.002023070578552632, -0.005874176478421054, -0.007982894414539473, -0.01305297109342105, 0.013835959466144737, -0.007678114530657894, 0.0016565042665789473, -0.0029898593556578947, 0.018475673282499997, -0.004774599107368421, -0.01045985660768421, 5002329298684213e-19, 455613157105266e-19, 0.012770474667763154, 0.0036531933109210527, -0.006355904673157896, -0.00323254957336842, -28950164197368423e-20, -0.0016983754679473682, -6461348456578951e-19, 0.011579839645394736, 3174967802632419e-21, -0.009248690072105265, 0.010413905775572371, 0.00742944108473684, 0.00453180122631579, 0.01615883042802631, -0.0032757992935526312, -0.0038371938214394738, -0.002908959269342105, 0.009208926093951316, -0.0014955339189473683, -0.013758465006973683, -0.0063294295475, -0.005727852496578948, -0.005272904527105263, -0.001316834533684211, -0.01645172019144737, -0.007092707085578947, -0.003522257189605263, -0.013505265605263156, -0.011881032946052632, 0.011369551982828954, 44452595263157905e-21, -0.006352405066578949, 0.0052995613325, 0.009505844287763156, -0.006053228503013156, 0.006845024962368421, -0.011510292038552633, -0.0032177408799999997, -0.004505434028289475, 0.004123595264342105, 0.006593527555000002, -0.011078657794605259, -0.014011584826078945, 0.0029858133488157895, 4344722920789474e-19, 0.008640971361973684, 0.006481291948157893, -0.005891967694342105, 0.008448872632763157, 0.016859102106052633, 0.0014603208068421055, 0.005249472965605262, -0.00686901125013158, -0.010637044371578948, 0.011924648195789474, -0.0058005032065789495, 0.015501499024999997, -0.006453810105921054, -0.002997035320473683, 0.018575800172368425, -0.008515451444736838, 0.012462028264473679, -0.003774380357539475, -0.0019450062711842105, 0.00391133496173684, 0.004730433910526316, -0.001315982468776316, 3232796018157894e-19, -0.0066704201258026286, 0.00680665693223684, -39029438710526344e-20, 0.005489703965131578, 0.008671756791842107, -0.012851425032368417, 0.003147755206052631, 0.0026194010623684216, -0.007664137591973682, -0.011883636635, 0.004133208043763159, -8303924315789413e-20, 0.003270837395131579, -0.005892774992763157, 0.012238801593815785, 0.006942355931973683, 0.02878469881921053, 9479045131578946e-19, 0.0017351399474736847, 0.008778382914078947, 0.0010939997295263163, 0.0030465893436842097, 0.014783142862368417, 0.01642540962717105, 0.0036857923714473675, -0.015363344993026315, 0.009919231350263158, -0.011551756493421059, 0.0023134715465394744, 0.011385295549473687, 0.013802586752105264, -0.01116167753921053, -0.003641126586684211, -0.013648889441184206, 0.014234762527368418, 0.002806655006105263, -0.013499138960736849, 0.005006243019473683, 0.015739427460526312, -0.0027175753445131574, -0.010932971389473686, -0.010770135974552631, 890700216526316e-18, -0.012623942286842103, 0.016124839350000003, -0.002831514939934211, 0.012697006429342104, -0.007019076696973686, -0.006475317798065787, 0.007137869946052634, 0.006031961175105265, -0.00705848445763158, 0.0033737443014210527, -2768167815789512e-20, 0.017694467707894734, 0.006258390639605262, -0.002385706069394737, 0.003583886412894737, -7993168968421051e-19, -0.01620972400113158, 0.01370171146118421, 0.00461520679318421, -7547631113157896e-19, 0.002939954357631579, -0.006845462558289473, 0.007328082212763157, 0.007676322326467105, 0.004349595261973684, 0.015829044343197374, -0.00368448221881579, 5303418106447364e-19, 0.0026827215614473685, -0.008580460431710527, 0.005024989097499999, -0.003635687485394737, 0.002272944439315789, -0.006124602738289472, -0.016172138838026325, 0.015377584130394738, 0.010782426606184206, -0.021383269930657894, 0.005706450336052631, 0.0018523320315789475, 3522892494736843e-19, 0.004350316041157894, 0.005934959479144734, 0.01708160452131579, -0.007678650551447369, -0.0033582777418421053, -0.017157569269684224, 0.007354085403947371, 8351606031578944e-19, -0.005335390844342104, -0.002535301282368421, 0.014636234615921057, 0.004858749898355263, 0.007662922150526313, -0.0016256868378026308, 0.01556731267368421, -0.005104593538289476, -0.019748377389473677, -0.013980995652631582, 0.00946453539263158, -0.008415238208421055, -0.011370187082631577, -0.024026692542368423, -0.028569824043500013, -0.004478069888947369, 0.0031515005953947363, -0.002700122834605264, 0.00815917739855658, -0.00445320840494737, 0.006830579967631578, -0.006684497927105263, 0.010432664122105263, -0.014661140320368424, -0.006587801074605265, 0.007357709939078946, -0.005931698591973684, -7732484365789474e-19, -0.002239530471052632, 0.007788843097894735, 0.0064669147390789454, -0.0030537573617631575, 0.017894125887236843, 0.014577202200000002, 0.0015132674616710532, -0.0057732834064473685, -0.0027821142750131585, -0.01908095769276315, 0.009781772397894737, 0.009500178334210524, -0.08152622444736843, 0.008212754039473679, -0.01767476994144737, 0.0026395801725000003, 0.0014657673559210526, 0.007638076904605263, 0.004058115665973685, 0.0035145148113157896, -0.011827003826315791, -0.0027065570113157895, 0.0023756798456578943, 0.008448311618421052, 0.017983404865789466, 0.016279126637631577, -0.0012591387876315795, -0.01015563660263158, -0.007210258607868422, 5225580767105262e-19, 0.008399898934210526, 0.005169876301250003, -0.0054817867677631575, 0.004851883672052633, 8781897375131572e-19, -0.004407749175657896, -0.0037234890038684225, 0.010837226267236846, -0.008299530855789473, 0.012997853572105266, -0.017374133039473685, 0.01771941214802632, -0.010850383854999996, -0.0025922976049605273, -0.005014948546052633, 0.001572493777631579, -0.009683719784736844, 0.003544048853289474, -0.005399044507894736, 0.0019298673893421046, 0.008562550747213162, 0.007685438104276315, 9653876659736838e-19, 0.006209795067934209, -0.007815720736421053, 0.01339235502684211, -0.014595927550000002, -0.001961306322894736, 0.01755357029118421, 0.009892284107105262, -0.004357266436710526, -0.024933551971052636, -0.008265622360263156, 46308488684210446e-21, 0.008073451047105263, -0.006002720232921055, 0.00960784907105263, -0.008960232250921057, 0.009452138660526316, -1669984473684197e-19, 0.006347901398026315, 0.006253983917105261, -0.001933425444473684, -0.010605378191710526, 0.0017956876511842107, 0.010316846388552634, -0.006851734682407896, 0.017523879366710526, -0.003045540768026316, 0.021021487419736837, -0.00978115143263158, 0.007848767184210523, 0.008862482220921052, -0.01242224652736842, 0.0013790572871052633, 0.014478706237421052, -0.008613721365578947, 8338612144736844e-19, 0.003780419830131578, 0.00346602358868421, 0.01269026605723684, 0.009463772316851317, 0.012594825682894736, -0.0069123792341578925, 0.0013869928297368425, -0.012008816909210525, -0.005822936399078947, -0.016418475083815786, -0.010629006791973683, 0.008168218550394738, 0.00664607999610526, -5069868140000001e-19, 0.004181848071447371, -0.0011114877839473682, 0.02246608591315789, -0.0034439313037368416, -0.004351277874210527, 0.0014461106753947362, -0.009660680614197373, -0.005408365936052628, 0.01752714284907894, 0.008516543233210525, 0.002278526259736842, -0.006875266473026315, -0.0069421802624999975, 0.013035910887894736, 0.0015391923593421058, 0.0012664572747368423, 0.0011414591399473686, -0.0037214528182894745, 0.015104741671868427, -0.013068065997078947, -9741302530000001e-19, -0.0033918721798684216, 0.005097137174605263, 0.004477671593026316, 0.006166728530789473, -4620546571052633e-19, -0.00529603509618421, 8418184122421051e-19, -0.0012031493919868418, 15712514144736853e-20, -0.0019224767417105261, 0.005464992050000003, 0.004573905729556577, -0.005107717659999997, -0.001779724216276316, 0.0062555419631578945, 0.014157424513157893, -0.002229668639710526, -0.004112240003421051, -0.008737391783947368, -0.01772272931749999, -0.011969726380789475, 3489228665526319e-19, 0.008398761923223683, 0.006083781918289473, 0.0038491992196052634, 0.006757484750263158, -0.0033988848290789457, 0.010786320785381581, 0.007709229539986843, -0.0027759906160526315, 0.01513786151671053, -33675679921052606e-20, -9034154792105268e-19, -0.006730010358421051, -0.0038794277310526316, 0.011774508437552627, 0.0075108212575000005, -5415923363157894e-19, -0.010228818563289476, -0.004567732969605264, -0.006103785833947367, -0.007408031901286839, -0.0032699436107894737, -0.007860791874210528, 0.01599756300842105, -0.016585482788684217, -0.008410989815789471, -0.0024622896271447366, -31383816486842115e-20, -0.006790721234210526, 0.0037121541342105256, -0.009942839455, -0.012361527721052628, 0.019747696744736844, -0.004605994977907893, 0.0033676318580263156, 8737887935394738e-19, 0.002211198596144737, 0.010937877776315795, -0.01129901567118421, -8168034689473677e-19, -0.009641223938421057, 0.009402437952631576, 0.0056297516052631605, -0.0010065862368421055, -0.02594543341447368, -0.0011355776477631582, -0.011891248669605264, -0.00839228417031579, 0.007896343589210524, 0.007322515729342106, 0.0033040433167105263, 0.003778204579868421, 0.011096790547631581, -0.0015593353430263153, 0.014356465188157893, -0.006630788594118421, 4828352872894737e-19, 0.0010450569010473684, -0.007027775473815791, -0.006984254253157892, -0.00792534963342105, -0.00162584528, -0.006522221855263158, 0.01805963293197369, -0.004809070690789476, -0.01814591389078947, -0.005865267296828947, 0.003988285848684209, -0.008169152964999999, -0.008437095909210527, 0.009360843043815788, 0.030021375652105258, 0.007297060365657896, -0.0023612295406578963, -0.01073050399763947, 0.0019045162401315795, 0.00651718905263158, 0.0010275199546052635, -0.006277306921263158, 0.0012021913027105262, -0.011182417592105264, -0.002024020123421053, -0.006231476668342106, 4796000135526314e-19, 0.006449109247355262, 7456603261184208e-19, -0.005144762157460526, -0.0021357675948684212, -0.01883197047171053, -0.025576503247368407, -0.013539074083421053, -0.011034470814473686, 0.0024368244498684222, -0.002245899774736842, 0.007094408709210526, 0.0012029363072368422, -0.009510369465000001, -0.012366834156578943, 22163493250000016e-20, -864950124473684e-18, -0.0054156288555263134, 0.005750937247368423, 0.003270796098421053, 0.002449161180921053, 52041173618420834e-21, 0.010704513787500002, 0.001962141009605263, 0.004546446430526313, -0.009514348226710524, 0.013900074301842112, 0.007515311701355261, 0.0035688571342105263, -0.0031417825293421063, 0.013631733623026311, 0.004473217585789474, 0.022099065907894736, -0.010242928179605263, -0.021115605811315788, -0.0020430657981592103, -0.004960829025921049, 6026669513157779e-20, -0.004585000899605264, -0.004475863079315788, -0.004507509982368421, 0.012760686508684211, 0.0035079304818421055, 0.0043142242481578955, -0.0037753994023157884, 0.009972505233289472, 0.004257388717499998, 0.0037933767182894737, -0.003782828635039474, -0.016245113222631585, -0.0067635378846052615, 0.001699853626842106, 0.0049727823532894734, -0.0026726438017763156, 35606309460526324e-20, 0.0014221154155263163, -0.006753894785657897, -0.0021303370428947363, 0.0020290390381578942, 0.0065541381115789485, 0.005578077509210527, 0.00597834956631579, -0.015656070957894737, -0.005700937814868422, -0.003300278165210526, 0.0010437032015789478, -0.006081244438026316, -0.012030119331578949, 0.008609655173684212, -0.012421846317171054, 0.0038849181815789487, -0.003441401350921053, 0.005337632936842106, -0.00501430082631579, 0.007684295191355262, -0.018589622549210528, 0.0020294963380921055, -0.01736990133552631, -12342767794736842e-20, 0.013101640196631579, -19718100105263185e-20, 0.00191136175070921, 0.002991744120394736, 0.005360340401578948, -0.002541910205657895, -0.011420830478947371, 0.0025571802081578946, -0.007654641906842104, 1324760923026315e-19, 0.009839589908289474, 0.014137809323684214, 0.005973617257894737, 0.0044086344710526325, -0.007683909966710525, -0.014283573396973682, -0.015558832550000004, 0.006422352959605265, 0.0015610042364473677, 0.005954876463289471, 0.01747821746710526, 0.012649821948026316, -0.00588777466013158, 0.00278459120360921, -0.0027093084425131573, 0.00528561605, -0.0013567440365789465, -0.0036329947868421046, -0.027717547824078946, -0.009446810628947372, 0.0016673699111842107, 0.01964425766578947, -0.00695099289526316, 0.01540288453881579, -0.0017949823404736845, -0.0017532934771052637, 0.011818318206578948, 0.0014771281863157897, 0.010423521287236842, 7254289103947369e-19, -0.004566167288026315, -0.003529428743197369, 0.0011952240294736843, -0.003898400712605264, -0.010473680018684213, 0.00285922366139474, -0.006599853688026317, -0.02107415088815789, 0.0052880693118421045, 0.006744707181578948, -0.00798451460657895, -0.004557204219868423, -0.01156681187255263, 0.0076239759752631635, 0.0035902046968684207, -0.012573743979605262, -0.003764909397236842, 6335979498684211e-19, -0.003016045632947368, 0.0018927498906578949, 0.007497210715789474, -0.005934193091907899, 0.0035080823515789466, -0.0018217714548684216, -5523007649828952e-19, -7058270163815789e-19, 0.012370342157368423, -15139791644736762e-21, -0.013432961709210524, -4939559349999998e-19, 0.010054779912499996, -0.001919280470486842, -0.0013844150172368421, 0.007696783919605264, 0.008991117240473684, -0.007747281024078945, -0.004739962277894735, 0.007187543989473684, 0.003015955778815791, -0.001928289877644735, 0.004620562280552632, -0.0014514659089473684, -0.020361874824473686, 0.010851485952894735, -0.0048367870628947375, 7418370901184215e-19, 0.003954019490328949, -0.0036905010957894754, 0.005135467446315788, -7641653630263166e-19, 0.002803192092157894, 9011874512236843e-19, -0.006852827178236843, -0.009182144093157896, 6662634763552632e-19, 0.003859204278289474, 0.002627766069263158, 16687577934210564e-20, -0.004155122549868421, 0.007481256317894739, 0.010201827506842105, -0.02001931662526316, 0.008597913657499998, 0.009211417565, -0.003000300423684211, 48565491249999974e-20, -0.006839893910657894, -0.0024400726705263165, 0.0018072735346052636, -0.019441373660526323, 0.008917724683289475, 0.006977527517447371, 0.0012267423015789476, 37295210526322205e-22, -0.03201578951578947, 0.0014607340267894736, 0.010337255695263156, 0.002957082175947369, 0.009742125079473684, 0.0062952107691315795, 0.010293411451381573, 0.007467224718026317, -0.01702668064539474, 0.005315579784210528, -0.03403872432368421, -0.0036593492817105257, -0.013481478045789471, -0.005543817282105263, 0.0024990400036842106, -0.005272580224539472, 0.009082922817368418, -0.001777538198289474, -0.00401194444394737, 0.00793982549736842, 23839166631578926e-20, 0.005703706245131579, 0.0032615849919210536, 5623444232236841e-19, -0.009299548110394735, 0.0010441157952631576, -0.012694072275263158, 0.004126734016842105, -0.001088491213815789, -43924066513157913e-20, -0.006497900055789475, -0.008375932914473687, 0.006604953940657895, 0.008322977985131578, 0.0014929076139473686, -0.005037357923289473, 0.001687304174736842, 0.005036407010486843, 0.002468036690526316, 0.0014052489157894733, -0.0022257209973684214, 0.005458085299473683, 0.009009774955749998, 0.0858067330657895, -0.007581642367631578, 0.01083994584868421, -0.0022605711906578943, 21345696315789494e-20, -0.005091092415263156, -0.0064649052059342115, -0.0031673467632894734, 0.007837809513026317, -0.0048379660456749985, 0.003358471353947369, -0.007209436236315789, -0.004074764670526317, -0.002432236466131579, -0.001538101053328947, -0.003958276178197368, -0.001431222515394737, -0.002890863070263158, -0.005015565842105263, 0.006637256008947367, -0.01610401879026316, 16318058486842113e-20, 0.006704906538815789, -0.00704305531026316, -0.006291144144078946, 0.00933739933177632, 0.003039505811973684, -0.002349317244736842, 6161272673684213e-19, 0.011576436187894739, 19294986634210533e-20, -5418114680263158e-19, 0.002641153911184212, -0.00675274457026316, 0.008304665786171056, 0.001867557076842105, 0.007009144105789473, 37644492855263173e-20, 0.008968001444210526, 0.0015434073640789474, 0.005244117515263159, 0.0029953329880263156, 5347106021052633e-19, 0.004156591307368421, -0.0022211070997368424, 0.0034716415264473685, -0.0065318866889473685, 977989682631579e-18, -0.0014095522748684215, -0.006451674766447366, 0.0032100871473157893, -0.005529904199539473, 0.0059584155557894725, -9850399996052639e-19, 0.006995684919078948, -0.0022856163722368393, -0.01090589053710526, 0.009130581944078944, 0.00312594295013158, 0.007374450093421053, 0.0025797777251710522, 29641350526315737e-21, 0.001176881737763158, -0.014572063391447372, -2289824355263157e-19, -0.004469249211710526, 0.007769186374868425, -0.002506505231434211, 0.006041142717631577, -0.002120238433026316, -0.009695580013552628, -0.005020087666881578, 0.005143053156315791, 0.007150294719789475, 0.0023021195396710527, 0.003707133851447368, 0.006069693725921051, -0.00467861785710526, 0.02125906401236842, 9268083446052627e-19, -0.003634692288684209, -0.003680463652815789, 0.0040336247021052615, 0.0013372253536447368, 0.0021130635865789465, -4880915286842109e-19, -0.012233446567342104, -0.004310965072894738, -0.01132869828552632, -0.006841497305263159, -0.0016422147394736845, -0.002537146005289474, 0.003615671777368422, 0.00814799093118421, -0.005056491793263158, 0.013174237758684208, 3394553878157892e-19, -0.008489372885473684, -0.0027938550723684203, 0.0030627760844078957, 9348454796052637e-19, 0.004848255386842105, -0.0117739507, -6810965494736843e-19, -0.002880153715, 0.008861613728178947, 0.0033199058337500006, -0.003612675859078948, 0.002928360304065789, 0.0039185375651315775, -7332073442631576e-19, -0.0012935513150789466, 0.004886879997894738, 0.007781129023552632, -0.004267412731052632, -0.003639562495460526, 0.00523262424868421, -0.003657068880394737, 0.005125610617552631, -0.004419953952236842, -9843244355092107e-19, -2347114171052623e-20, 0.0016072527152631584, 0.003128275799539474, 4279722777368421e-19, 0.006050774428552632, -0.004237210059210528, -0.0025468053725000005, 0.0026924242311184205, -0.02019396686092105, -0.005761839523684209, -0.009751797271973686, 0.011594078876973685, 9348787827236843e-19, 0.014106164205263163, 6055481813026316e-19, -7440742407894764e-20, -0.005227106624868422, 0.013380218100789466, 0.008165820871447366, -4882895227631577e-19, -0.0010533377903157893, -0.0016510250091447362, 0.0018723641477631577, -0.004344320649736843, 0.002451466830486842, 0.003751309517368421, -1192675066447369e-19, 5871760036842106e-19, 0.00721447406936842, 0.003513352502315789, 0.009986706387763158, -0.003577922982105263, -0.006272508934210527, 0.00939798507907895, 0.005559408675131579, -0.004530027807368421, 0.008267799573289474, 9763903811842103e-19, 6323663030263157e-19, -0.018563745183684206, 0.003477922045657895, 0.0034454675522368416, 0.0022030032148815794, 9718481634210526e-19, -0.006363050955000002, 0.009044980506973683, -0.007551598236973688, -6711054927894736e-19, -0.0013286158334210524, 0.0017464641878947365, -0.011715851191973686, -0.005520589822500002, 8535201651315791e-19, 0.010038929649605262];
|
|
28364
28425
|
|
|
28365
28426
|
// src/lib/chat/preProcessor.ts
|
|
28366
|
-
function wrapAsUserText(prefix,
|
|
28367
|
-
if (!
|
|
28427
|
+
function wrapAsUserText(prefix, text12) {
|
|
28428
|
+
if (!text12 || !text12.trim()) return [];
|
|
28368
28429
|
return [{ role: "user", content: [{ type: "text", text: `${prefix}
|
|
28369
|
-
${
|
|
28430
|
+
${text12}` }] }];
|
|
28370
28431
|
}
|
|
28371
28432
|
|
|
28372
28433
|
// src/lib/chat/preProcessorMath.ts
|
|
@@ -30242,13 +30303,13 @@ var StreamSmoother = class {
|
|
|
30242
30303
|
/**
|
|
30243
30304
|
* Add text to the buffer. If smoothing is disabled, passes through immediately.
|
|
30244
30305
|
*/
|
|
30245
|
-
push(
|
|
30246
|
-
if (this.destroyed || !
|
|
30306
|
+
push(text12) {
|
|
30307
|
+
if (this.destroyed || !text12) return;
|
|
30247
30308
|
if (!this.enabled) {
|
|
30248
|
-
this.callback(
|
|
30309
|
+
this.callback(text12);
|
|
30249
30310
|
return;
|
|
30250
30311
|
}
|
|
30251
|
-
this.buffer +=
|
|
30312
|
+
this.buffer += text12;
|
|
30252
30313
|
this.ensureTimer();
|
|
30253
30314
|
}
|
|
30254
30315
|
/**
|
|
@@ -30259,9 +30320,9 @@ var StreamSmoother = class {
|
|
|
30259
30320
|
if (this.destroyed) return;
|
|
30260
30321
|
this.stopTimer();
|
|
30261
30322
|
if (this.buffer.length > 0) {
|
|
30262
|
-
const
|
|
30323
|
+
const text12 = this.buffer;
|
|
30263
30324
|
this.buffer = "";
|
|
30264
|
-
this.callback(
|
|
30325
|
+
this.callback(text12);
|
|
30265
30326
|
}
|
|
30266
30327
|
this.resolveDrain();
|
|
30267
30328
|
}
|
|
@@ -30328,9 +30389,9 @@ var StreamSmoother = class {
|
|
|
30328
30389
|
const currentSpeed = this.getCurrentSpeed(elapsed);
|
|
30329
30390
|
const charsThisTick = Math.max(1, Math.round(currentSpeed * (TICK_INTERVAL / 1e3)));
|
|
30330
30391
|
const toRelease = Math.min(charsThisTick, this.buffer.length);
|
|
30331
|
-
const
|
|
30392
|
+
const text12 = this.buffer.slice(0, toRelease);
|
|
30332
30393
|
this.buffer = this.buffer.slice(toRelease);
|
|
30333
|
-
this.callback(
|
|
30394
|
+
this.callback(text12);
|
|
30334
30395
|
if (this.buffer.length === 0) {
|
|
30335
30396
|
this.stopTimer();
|
|
30336
30397
|
this.resolveDrain();
|
|
@@ -30692,9 +30753,9 @@ async function runToolLoop(options) {
|
|
|
30692
30753
|
messages = await redactBatch(messages);
|
|
30693
30754
|
if (preProcessors?.length) {
|
|
30694
30755
|
try {
|
|
30695
|
-
const
|
|
30696
|
-
if (
|
|
30697
|
-
const embedding = await generateEmbedding(
|
|
30756
|
+
const text12 = extractLastUserText(messages);
|
|
30757
|
+
if (text12.length > 0) {
|
|
30758
|
+
const embedding = await generateEmbedding(text12, {
|
|
30698
30759
|
apiKey: headers?.["X-API-Key"],
|
|
30699
30760
|
getToken: token ? () => Promise.resolve(token) : void 0,
|
|
30700
30761
|
baseUrl
|
|
@@ -30702,7 +30763,7 @@ async function runToolLoop(options) {
|
|
|
30702
30763
|
const results = await Promise.all(
|
|
30703
30764
|
preProcessors.map(async (p) => {
|
|
30704
30765
|
try {
|
|
30705
|
-
return await p({ prompt:
|
|
30766
|
+
return await p({ prompt: text12, embedding, signal: combinedSignal });
|
|
30706
30767
|
} catch (err) {
|
|
30707
30768
|
console.warn("[runToolLoop] pre-processor failed:", err);
|
|
30708
30769
|
return void 0;
|
|
@@ -30855,11 +30916,11 @@ async function runToolLoop(options) {
|
|
|
30855
30916
|
}
|
|
30856
30917
|
});
|
|
30857
30918
|
accumulator = createStreamAccumulator(model || void 0);
|
|
30858
|
-
contentSmoother = new StreamSmoother((
|
|
30859
|
-
if (emitData) emitData(
|
|
30919
|
+
contentSmoother = new StreamSmoother((text12) => {
|
|
30920
|
+
if (emitData) emitData(text12);
|
|
30860
30921
|
}, smoothing);
|
|
30861
|
-
thinkingSmoother = new StreamSmoother((
|
|
30862
|
-
if (emitThinking) emitThinking(
|
|
30922
|
+
thinkingSmoother = new StreamSmoother((text12) => {
|
|
30923
|
+
if (emitThinking) emitThinking(text12);
|
|
30863
30924
|
}, smoothing);
|
|
30864
30925
|
let chunksEmittedDownstream = false;
|
|
30865
30926
|
try {
|
|
@@ -31327,11 +31388,11 @@ Executing tool: ${toolInfo}
|
|
|
31327
31388
|
}
|
|
31328
31389
|
});
|
|
31329
31390
|
currentAccumulator = createStreamAccumulator(model || void 0);
|
|
31330
|
-
contContentSmoother = new StreamSmoother((
|
|
31331
|
-
if (emitData) emitData(
|
|
31391
|
+
contContentSmoother = new StreamSmoother((text12) => {
|
|
31392
|
+
if (emitData) emitData(text12);
|
|
31332
31393
|
}, smoothing);
|
|
31333
|
-
contThinkingSmoother = new StreamSmoother((
|
|
31334
|
-
if (emitThinking) emitThinking(
|
|
31394
|
+
contThinkingSmoother = new StreamSmoother((text12) => {
|
|
31395
|
+
if (emitThinking) emitThinking(text12);
|
|
31335
31396
|
}, smoothing);
|
|
31336
31397
|
let chunksEmittedDownstream = false;
|
|
31337
31398
|
try {
|
|
@@ -31533,11 +31594,11 @@ async function resumeStream(options) {
|
|
|
31533
31594
|
} = options;
|
|
31534
31595
|
const strategy = getStrategy(handle.apiType);
|
|
31535
31596
|
const accumulator = createStreamAccumulator(handle.model || void 0);
|
|
31536
|
-
const contentSmoother = new StreamSmoother((
|
|
31537
|
-
if (onData) onData(
|
|
31597
|
+
const contentSmoother = new StreamSmoother((text12) => {
|
|
31598
|
+
if (onData) onData(text12);
|
|
31538
31599
|
}, smoothing);
|
|
31539
|
-
const thinkingSmoother = new StreamSmoother((
|
|
31540
|
-
if (onThinking) onThinking(
|
|
31600
|
+
const thinkingSmoother = new StreamSmoother((text12) => {
|
|
31601
|
+
if (onThinking) onThinking(text12);
|
|
31541
31602
|
}, smoothing);
|
|
31542
31603
|
const idleController = new AbortController();
|
|
31543
31604
|
let watchdog;
|
|
@@ -31823,9 +31884,9 @@ function extractUserMessages(messages, maxCount, documentPattern) {
|
|
|
31823
31884
|
}
|
|
31824
31885
|
return result.reverse();
|
|
31825
31886
|
}
|
|
31826
|
-
function truncateAtWordBoundary(
|
|
31827
|
-
if (
|
|
31828
|
-
const truncated =
|
|
31887
|
+
function truncateAtWordBoundary(text12, maxLength) {
|
|
31888
|
+
if (text12.length <= maxLength) return text12;
|
|
31889
|
+
const truncated = text12.slice(0, maxLength);
|
|
31829
31890
|
const lastSpace = truncated.lastIndexOf(" ");
|
|
31830
31891
|
return lastSpace > maxLength * 0.5 ? truncated.slice(0, lastSpace) : truncated;
|
|
31831
31892
|
}
|
|
@@ -31950,12 +32011,12 @@ function buildSystemPrompt(ctx, options) {
|
|
|
31950
32011
|
let prompt = "";
|
|
31951
32012
|
const activeSections = [];
|
|
31952
32013
|
for (const section of sections) {
|
|
31953
|
-
const
|
|
31954
|
-
if (
|
|
31955
|
-
if (maxLength > 0 && prompt.length +
|
|
32014
|
+
const text12 = section.render(ctx);
|
|
32015
|
+
if (text12 === null) continue;
|
|
32016
|
+
if (maxLength > 0 && prompt.length + text12.length > maxLength) {
|
|
31956
32017
|
continue;
|
|
31957
32018
|
}
|
|
31958
|
-
prompt +=
|
|
32019
|
+
prompt += text12;
|
|
31959
32020
|
activeSections.push(section.key);
|
|
31960
32021
|
}
|
|
31961
32022
|
return { prompt, activeSections };
|