@anuma/sdk 9.1.7 → 9.1.9
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 +120 -66
- package/dist/expo/index.mjs +121 -67
- package/dist/react/index.cjs +157 -103
- package/dist/react/index.mjs +152 -98
- package/dist/server/index.cjs +107 -59
- package/dist/server/index.mjs +107 -59
- package/package.json +1 -1
package/dist/react/index.mjs
CHANGED
|
@@ -14831,10 +14831,10 @@ async function getVaultRankingProjectionsOp(ctx, options) {
|
|
|
14831
14831
|
function baseVaultSql(ctx, options) {
|
|
14832
14832
|
const clauses = [
|
|
14833
14833
|
`"_status" is not 'deleted'`,
|
|
14834
|
-
'"is_deleted" = 0',
|
|
14834
|
+
...options?.includeDeleted ? [] : ['"is_deleted" = 0'],
|
|
14835
14835
|
...options?.includeArchived ? [] : ['"archived_at" is null'],
|
|
14836
14836
|
...options?.includeQuarantined ? [] : [`"trust_tier" is not 'quarantined'`],
|
|
14837
|
-
'"superseded_by" is null'
|
|
14837
|
+
...options?.includeSuperseded ? [] : ['"superseded_by" is null']
|
|
14838
14838
|
];
|
|
14839
14839
|
const args = [];
|
|
14840
14840
|
if (ctx.userId !== void 0) {
|
|
@@ -14843,6 +14843,38 @@ function baseVaultSql(ctx, options) {
|
|
|
14843
14843
|
}
|
|
14844
14844
|
return { sql: clauses.join(" and "), args };
|
|
14845
14845
|
}
|
|
14846
|
+
async function getVaultProfileMetadataOp(ctx, options) {
|
|
14847
|
+
const mapRaw = (raw) => ({
|
|
14848
|
+
uniqueId: raw.id,
|
|
14849
|
+
scope: raw.scope ?? "",
|
|
14850
|
+
createdAt: new Date(raw.created_at),
|
|
14851
|
+
updatedAt: new Date(raw.updated_at),
|
|
14852
|
+
lastObservedAt: raw.last_observed_at ?? null,
|
|
14853
|
+
supersededAt: raw.superseded_at ?? null,
|
|
14854
|
+
supersededBy: raw.superseded_by ?? null,
|
|
14855
|
+
isDeleted: raw.is_deleted === true || raw.is_deleted === 1,
|
|
14856
|
+
proofCount: raw.proof_count ?? null
|
|
14857
|
+
});
|
|
14858
|
+
const listOptions = { ...options, includeDeleted: true, includeSuperseded: true };
|
|
14859
|
+
let rows;
|
|
14860
|
+
try {
|
|
14861
|
+
const base = baseVaultSql(ctx, listOptions);
|
|
14862
|
+
const clauses = [base.sql, `"_status" != 'deleted'`];
|
|
14863
|
+
const args = [...base.args];
|
|
14864
|
+
if (options?.scopes?.length) {
|
|
14865
|
+
clauses.push(`"scope" in (${options.scopes.map(() => "?").join(",")})`);
|
|
14866
|
+
args.push(...options.scopes);
|
|
14867
|
+
}
|
|
14868
|
+
const sql = `select "id", "scope", "created_at", "updated_at", "last_observed_at", "superseded_at", "superseded_by", "is_deleted", "proof_count" from "memory_vault" where ${clauses.join(" and ")}`;
|
|
14869
|
+
rows = await ctx.vaultMemoryCollection.query(Q9.unsafeSqlQuery(sql, args)).unsafeFetchRaw();
|
|
14870
|
+
} catch (err) {
|
|
14871
|
+
getLogger().debug(
|
|
14872
|
+
"memoryVault: getVaultProfileMetadataOp uses the query fallback: " + (err instanceof Error ? err.message : String(err))
|
|
14873
|
+
);
|
|
14874
|
+
rows = await ctx.vaultMemoryCollection.query(...vaultListConditions(ctx, listOptions)).unsafeFetchRaw();
|
|
14875
|
+
}
|
|
14876
|
+
return rows.map(mapRaw);
|
|
14877
|
+
}
|
|
14846
14878
|
async function getVaultCandidateKeysOp(ctx, options) {
|
|
14847
14879
|
const mapRaw = (raw) => ({
|
|
14848
14880
|
uniqueId: raw.id,
|
|
@@ -15726,6 +15758,9 @@ async function findQuarantinedDuplicateOp(ctx, content, sourceIds2, where) {
|
|
|
15726
15758
|
return null;
|
|
15727
15759
|
}
|
|
15728
15760
|
|
|
15761
|
+
// src/lib/db/memoryVault/photoIngest.ts
|
|
15762
|
+
import { Q as Q10 } from "@nozbe/watermelondb";
|
|
15763
|
+
|
|
15729
15764
|
// src/lib/memory/decay.ts
|
|
15730
15765
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
15731
15766
|
var SHORT_TTL_MS = 30 * DAY_MS;
|
|
@@ -15798,6 +15833,16 @@ function classifyDecay(m, now, policy) {
|
|
|
15798
15833
|
|
|
15799
15834
|
// src/lib/db/memoryVault/photoIngest.ts
|
|
15800
15835
|
var PHOTO_MEMORY_ID_PREFIX = "photo:";
|
|
15836
|
+
var PHOTO_ID_QUERY_CHUNK_SIZE = 500;
|
|
15837
|
+
async function getExistingPhotoMemoryIds(ctx, rows) {
|
|
15838
|
+
const existing = /* @__PURE__ */ new Set();
|
|
15839
|
+
for (let i = 0; i < rows.length; i += PHOTO_ID_QUERY_CHUNK_SIZE) {
|
|
15840
|
+
const ids = rows.slice(i, i + PHOTO_ID_QUERY_CHUNK_SIZE).map((row) => row.memoryId);
|
|
15841
|
+
const found = await ctx.vaultMemoryCollection.query(Q10.where("id", Q10.oneOf(ids))).fetchIds();
|
|
15842
|
+
for (const id2 of found) existing.add(id2);
|
|
15843
|
+
}
|
|
15844
|
+
return existing;
|
|
15845
|
+
}
|
|
15801
15846
|
async function ingestPublishedPhotoMemoriesOp(ctx, rows) {
|
|
15802
15847
|
const byId = /* @__PURE__ */ new Map();
|
|
15803
15848
|
for (const r of rows) {
|
|
@@ -15806,7 +15851,7 @@ async function ingestPublishedPhotoMemoriesOp(ctx, rows) {
|
|
|
15806
15851
|
}
|
|
15807
15852
|
const photoRows = [...byId.values()];
|
|
15808
15853
|
if (photoRows.length === 0) return { inserted: 0, skipped: 0 };
|
|
15809
|
-
const known = await ctx
|
|
15854
|
+
const known = await getExistingPhotoMemoryIds(ctx, photoRows);
|
|
15810
15855
|
const candidates = photoRows.filter((r) => !known.has(r.memoryId));
|
|
15811
15856
|
if (candidates.length === 0) return { inserted: 0, skipped: photoRows.length };
|
|
15812
15857
|
const fresh = candidates;
|
|
@@ -15826,7 +15871,7 @@ async function ingestPublishedPhotoMemoriesOp(ctx, rows) {
|
|
|
15826
15871
|
const now = Date.now();
|
|
15827
15872
|
let inserted = 0;
|
|
15828
15873
|
await ctx.database.write(async () => {
|
|
15829
|
-
const present =
|
|
15874
|
+
const present = await getExistingPhotoMemoryIds(ctx, fresh);
|
|
15830
15875
|
const writable = fresh.map((row, i) => ({ row, content: contents[i] })).filter(({ row }) => !present.has(row.memoryId));
|
|
15831
15876
|
inserted = writable.length;
|
|
15832
15877
|
if (writable.length === 0) return;
|
|
@@ -15860,7 +15905,7 @@ async function ingestPublishedPhotoMemoriesOp(ctx, rows) {
|
|
|
15860
15905
|
}
|
|
15861
15906
|
|
|
15862
15907
|
// src/lib/db/project/operations.ts
|
|
15863
|
-
import { Q as
|
|
15908
|
+
import { Q as Q11 } from "@nozbe/watermelondb";
|
|
15864
15909
|
|
|
15865
15910
|
// src/lib/db/project/types.ts
|
|
15866
15911
|
function generateProjectId() {
|
|
@@ -15891,15 +15936,15 @@ async function createProjectOp(ctx, opts, defaultName = "New Project") {
|
|
|
15891
15936
|
return projectToStored(created);
|
|
15892
15937
|
}
|
|
15893
15938
|
async function getProjectOp(ctx, id2) {
|
|
15894
|
-
const results = await ctx.projectsCollection.query(
|
|
15939
|
+
const results = await ctx.projectsCollection.query(Q11.where("project_id", id2), Q11.where("is_deleted", false)).fetch();
|
|
15895
15940
|
return results.length > 0 ? projectToStored(results[0]) : null;
|
|
15896
15941
|
}
|
|
15897
15942
|
async function getProjectsOp(ctx) {
|
|
15898
|
-
const results = await ctx.projectsCollection.query(
|
|
15943
|
+
const results = await ctx.projectsCollection.query(Q11.where("is_deleted", false), Q11.sortBy("created_at", Q11.desc)).fetch();
|
|
15899
15944
|
return results.map(projectToStored);
|
|
15900
15945
|
}
|
|
15901
15946
|
async function updateProjectNameOp(ctx, id2, name) {
|
|
15902
|
-
const results = await ctx.projectsCollection.query(
|
|
15947
|
+
const results = await ctx.projectsCollection.query(Q11.where("project_id", id2), Q11.where("is_deleted", false)).fetch();
|
|
15903
15948
|
if (results.length > 0) {
|
|
15904
15949
|
await ctx.database.write(async () => {
|
|
15905
15950
|
await results[0].update((proj) => {
|
|
@@ -15911,7 +15956,7 @@ async function updateProjectNameOp(ctx, id2, name) {
|
|
|
15911
15956
|
return false;
|
|
15912
15957
|
}
|
|
15913
15958
|
async function updateProjectOp(ctx, id2, opts) {
|
|
15914
|
-
const results = await ctx.projectsCollection.query(
|
|
15959
|
+
const results = await ctx.projectsCollection.query(Q11.where("project_id", id2), Q11.where("is_deleted", false)).fetch();
|
|
15915
15960
|
if (results.length > 0) {
|
|
15916
15961
|
await ctx.database.write(async () => {
|
|
15917
15962
|
await results[0].update((proj) => {
|
|
@@ -15923,7 +15968,7 @@ async function updateProjectOp(ctx, id2, opts) {
|
|
|
15923
15968
|
return false;
|
|
15924
15969
|
}
|
|
15925
15970
|
async function deleteProjectOp(ctx, id2) {
|
|
15926
|
-
const results = await ctx.projectsCollection.query(
|
|
15971
|
+
const results = await ctx.projectsCollection.query(Q11.where("project_id", id2), Q11.where("is_deleted", false)).fetch();
|
|
15927
15972
|
if (results.length > 0) {
|
|
15928
15973
|
await ctx.database.write(async () => {
|
|
15929
15974
|
await results[0].update((proj) => {
|
|
@@ -15936,14 +15981,14 @@ async function deleteProjectOp(ctx, id2) {
|
|
|
15936
15981
|
}
|
|
15937
15982
|
async function getProjectConversationsOp(ctx, projectId) {
|
|
15938
15983
|
const results = await ctx.conversationsCollection.query(
|
|
15939
|
-
|
|
15940
|
-
|
|
15941
|
-
|
|
15984
|
+
Q11.where("project_id", projectId),
|
|
15985
|
+
Q11.where("is_deleted", false),
|
|
15986
|
+
Q11.sortBy("created_at", Q11.desc)
|
|
15942
15987
|
).fetch();
|
|
15943
15988
|
return results.map(conversationToStoredRaw);
|
|
15944
15989
|
}
|
|
15945
15990
|
async function getProjectConversationCountOp(ctx, projectId) {
|
|
15946
|
-
return await ctx.conversationsCollection.query(
|
|
15991
|
+
return await ctx.conversationsCollection.query(Q11.where("project_id", projectId), Q11.where("is_deleted", false)).fetchCount();
|
|
15947
15992
|
}
|
|
15948
15993
|
|
|
15949
15994
|
// src/lib/db/queue/manager.ts
|
|
@@ -16286,7 +16331,7 @@ var WalletPoller = class {
|
|
|
16286
16331
|
};
|
|
16287
16332
|
|
|
16288
16333
|
// src/lib/db/savedTools/operations.ts
|
|
16289
|
-
import { Q as
|
|
16334
|
+
import { Q as Q12 } from "@nozbe/watermelondb";
|
|
16290
16335
|
function savedToolToStored(tool) {
|
|
16291
16336
|
return {
|
|
16292
16337
|
uniqueId: tool.id,
|
|
@@ -16319,7 +16364,7 @@ async function createSavedToolOp(ctx, opts) {
|
|
|
16319
16364
|
return savedToolToStored(created);
|
|
16320
16365
|
}
|
|
16321
16366
|
async function getAllSavedToolsOp(ctx) {
|
|
16322
|
-
const results = await ctx.savedToolsCollection.query(
|
|
16367
|
+
const results = await ctx.savedToolsCollection.query(Q12.where("is_deleted", false), Q12.sortBy("created_at", Q12.desc)).fetch();
|
|
16323
16368
|
return results.map(savedToolToStored);
|
|
16324
16369
|
}
|
|
16325
16370
|
async function getSavedToolByIdOp(ctx, uniqueId) {
|
|
@@ -16371,7 +16416,7 @@ async function deleteSavedToolOp(ctx, uniqueId) {
|
|
|
16371
16416
|
}
|
|
16372
16417
|
|
|
16373
16418
|
// src/lib/db/settings/operations.ts
|
|
16374
|
-
import { Q as
|
|
16419
|
+
import { Q as Q13 } from "@nozbe/watermelondb";
|
|
16375
16420
|
function modelPreferenceToStored(preference) {
|
|
16376
16421
|
return {
|
|
16377
16422
|
uniqueId: preference.id,
|
|
@@ -16380,12 +16425,12 @@ function modelPreferenceToStored(preference) {
|
|
|
16380
16425
|
};
|
|
16381
16426
|
}
|
|
16382
16427
|
async function getModelPreferenceOp(ctx, walletAddress) {
|
|
16383
|
-
const results = await ctx.modelPreferencesCollection.query(
|
|
16428
|
+
const results = await ctx.modelPreferencesCollection.query(Q13.where("wallet_address", walletAddress)).fetch();
|
|
16384
16429
|
return results.length > 0 ? modelPreferenceToStored(results[0]) : null;
|
|
16385
16430
|
}
|
|
16386
16431
|
async function setModelPreferenceOp(ctx, walletAddress, models) {
|
|
16387
16432
|
const result = await ctx.database.write(async () => {
|
|
16388
|
-
const results = await ctx.modelPreferencesCollection.query(
|
|
16433
|
+
const results = await ctx.modelPreferencesCollection.query(Q13.where("wallet_address", walletAddress)).fetch();
|
|
16389
16434
|
if (results.length > 0) {
|
|
16390
16435
|
const preference = results[0];
|
|
16391
16436
|
await preference.update((pref) => {
|
|
@@ -16403,7 +16448,7 @@ async function setModelPreferenceOp(ctx, walletAddress, models) {
|
|
|
16403
16448
|
return modelPreferenceToStored(result);
|
|
16404
16449
|
}
|
|
16405
16450
|
async function deleteModelPreferenceOp(ctx, walletAddress) {
|
|
16406
|
-
const results = await ctx.modelPreferencesCollection.query(
|
|
16451
|
+
const results = await ctx.modelPreferencesCollection.query(Q13.where("wallet_address", walletAddress)).fetch();
|
|
16407
16452
|
if (results.length === 0) return false;
|
|
16408
16453
|
await ctx.database.write(async () => {
|
|
16409
16454
|
await results[0].destroyPermanently();
|
|
@@ -16427,7 +16472,7 @@ var settingsStorageSchema = appSchema3({
|
|
|
16427
16472
|
});
|
|
16428
16473
|
|
|
16429
16474
|
// src/lib/db/userPreferences/operations.ts
|
|
16430
|
-
import { Q as
|
|
16475
|
+
import { Q as Q14 } from "@nozbe/watermelondb";
|
|
16431
16476
|
function userPreferenceToStored(preference) {
|
|
16432
16477
|
return {
|
|
16433
16478
|
uniqueId: preference.id,
|
|
@@ -16443,7 +16488,7 @@ function userPreferenceToStored(preference) {
|
|
|
16443
16488
|
};
|
|
16444
16489
|
}
|
|
16445
16490
|
async function getUserPreferenceOp(ctx, walletAddress) {
|
|
16446
|
-
const results = await ctx.userPreferencesCollection.query(
|
|
16491
|
+
const results = await ctx.userPreferencesCollection.query(Q14.where("wallet_address", walletAddress)).fetch();
|
|
16447
16492
|
return results.length > 0 ? userPreferenceToStored(results[0]) : null;
|
|
16448
16493
|
}
|
|
16449
16494
|
async function createUserPreferenceOp(ctx, opts) {
|
|
@@ -16464,7 +16509,7 @@ async function createUserPreferenceOp(ctx, opts) {
|
|
|
16464
16509
|
return userPreferenceToStored(created);
|
|
16465
16510
|
}
|
|
16466
16511
|
async function updateUserPreferenceOp(ctx, walletAddress, opts) {
|
|
16467
|
-
const results = await ctx.userPreferencesCollection.query(
|
|
16512
|
+
const results = await ctx.userPreferencesCollection.query(Q14.where("wallet_address", walletAddress)).fetch();
|
|
16468
16513
|
if (results.length === 0) return null;
|
|
16469
16514
|
const preference = results[0];
|
|
16470
16515
|
await ctx.database.write(async () => {
|
|
@@ -16495,7 +16540,7 @@ async function updateUserPreferenceOp(ctx, walletAddress, opts) {
|
|
|
16495
16540
|
async function setUserPreferenceOp(ctx, walletAddress, opts) {
|
|
16496
16541
|
const now = Date.now();
|
|
16497
16542
|
const result = await ctx.database.write(async () => {
|
|
16498
|
-
const results = await ctx.userPreferencesCollection.query(
|
|
16543
|
+
const results = await ctx.userPreferencesCollection.query(Q14.where("wallet_address", walletAddress)).fetch();
|
|
16499
16544
|
if (results.length > 0) {
|
|
16500
16545
|
const preference = results[0];
|
|
16501
16546
|
await preference.update((pref) => {
|
|
@@ -16547,7 +16592,7 @@ async function updateModelsOp(ctx, walletAddress, models) {
|
|
|
16547
16592
|
return updateUserPreferenceOp(ctx, walletAddress, { models });
|
|
16548
16593
|
}
|
|
16549
16594
|
async function deleteUserPreferenceOp(ctx, walletAddress) {
|
|
16550
|
-
const results = await ctx.userPreferencesCollection.query(
|
|
16595
|
+
const results = await ctx.userPreferencesCollection.query(Q14.where("wallet_address", walletAddress)).fetch();
|
|
16551
16596
|
if (results.length === 0) return false;
|
|
16552
16597
|
await ctx.database.write(async () => {
|
|
16553
16598
|
await results[0].destroyPermanently();
|
|
@@ -16562,9 +16607,9 @@ async function migrateFromModelPreferencesOp(ctx, walletAddress) {
|
|
|
16562
16607
|
if (existing) {
|
|
16563
16608
|
return existing;
|
|
16564
16609
|
}
|
|
16565
|
-
const modelResults = await ctx.modelPreferencesCollection.query(
|
|
16610
|
+
const modelResults = await ctx.modelPreferencesCollection.query(Q14.where("wallet_address", walletAddress)).fetch();
|
|
16566
16611
|
const personalityKey = `${walletAddress}_personality_settings`;
|
|
16567
|
-
const personalityResults = await ctx.modelPreferencesCollection.query(
|
|
16612
|
+
const personalityResults = await ctx.modelPreferencesCollection.query(Q14.where("wallet_address", personalityKey)).fetch();
|
|
16568
16613
|
if (modelResults.length === 0 && personalityResults.length === 0) {
|
|
16569
16614
|
return null;
|
|
16570
16615
|
}
|
|
@@ -16666,7 +16711,7 @@ var SLIDER_CONFIG = [
|
|
|
16666
16711
|
];
|
|
16667
16712
|
|
|
16668
16713
|
// src/lib/db/vaultFolders/operations.ts
|
|
16669
|
-
import { Q as
|
|
16714
|
+
import { Q as Q15 } from "@nozbe/watermelondb";
|
|
16670
16715
|
function folderToStored(folder) {
|
|
16671
16716
|
return {
|
|
16672
16717
|
uniqueId: folder.id,
|
|
@@ -16691,7 +16736,7 @@ async function createVaultFolderOp(ctx, opts) {
|
|
|
16691
16736
|
return folderToStored(created);
|
|
16692
16737
|
}
|
|
16693
16738
|
async function getAllVaultFoldersOp(ctx) {
|
|
16694
|
-
const results = await ctx.vaultFolderCollection.query(
|
|
16739
|
+
const results = await ctx.vaultFolderCollection.query(Q15.where("is_deleted", false), Q15.sortBy("created_at", Q15.desc)).fetch();
|
|
16695
16740
|
return results.map(folderToStored);
|
|
16696
16741
|
}
|
|
16697
16742
|
async function updateVaultFolderOp(ctx, id2, opts) {
|
|
@@ -16700,7 +16745,7 @@ async function updateVaultFolderOp(ctx, id2, opts) {
|
|
|
16700
16745
|
if (record2.isDeleted) return null;
|
|
16701
16746
|
const scopeChanged = opts.scope !== void 0 && opts.scope !== record2.scope;
|
|
16702
16747
|
const updated = await ctx.database.write(async () => {
|
|
16703
|
-
const memories = scopeChanged ? await ctx.vaultMemoryCollection.query(
|
|
16748
|
+
const memories = scopeChanged ? await ctx.vaultMemoryCollection.query(Q15.where("folder_id", id2), Q15.where("is_deleted", false)).fetch() : [];
|
|
16704
16749
|
const updates = [];
|
|
16705
16750
|
updates.push(
|
|
16706
16751
|
record2.prepareUpdate((r) => {
|
|
@@ -16729,7 +16774,7 @@ async function deleteVaultFolderOp(ctx, id2) {
|
|
|
16729
16774
|
const record2 = await ctx.vaultFolderCollection.find(id2);
|
|
16730
16775
|
if (record2.isDeleted) return false;
|
|
16731
16776
|
await ctx.database.write(async () => {
|
|
16732
|
-
const memories = await ctx.vaultMemoryCollection.query(
|
|
16777
|
+
const memories = await ctx.vaultMemoryCollection.query(Q15.where("folder_id", id2), Q15.where("is_deleted", false)).fetch();
|
|
16733
16778
|
const preparedMemories = memories.map(
|
|
16734
16779
|
(memory) => memory.prepareUpdate((r) => {
|
|
16735
16780
|
r._setRaw("folder_id", null);
|
|
@@ -16800,7 +16845,7 @@ async function updateVaultFolderContextOp(ctx, id2, context) {
|
|
|
16800
16845
|
}
|
|
16801
16846
|
}
|
|
16802
16847
|
async function getVaultFolderMemoryCountOp(ctx, folderId) {
|
|
16803
|
-
return await ctx.vaultMemoryCollection.query(
|
|
16848
|
+
return await ctx.vaultMemoryCollection.query(Q15.where("folder_id", folderId), Q15.where("is_deleted", false)).fetchCount();
|
|
16804
16849
|
}
|
|
16805
16850
|
|
|
16806
16851
|
// src/lib/db/vaultFolders/defaults.ts
|
|
@@ -16843,7 +16888,7 @@ async function _ensureDefaultFoldersImpl(ctx) {
|
|
|
16843
16888
|
}
|
|
16844
16889
|
|
|
16845
16890
|
// src/lib/memory/autoExtract.ts
|
|
16846
|
-
import { Q as
|
|
16891
|
+
import { Q as Q16 } from "@nozbe/watermelondb";
|
|
16847
16892
|
|
|
16848
16893
|
// src/lib/memory/entitySalience.ts
|
|
16849
16894
|
var GENERIC_ENTITY_NAMES = /* @__PURE__ */ new Set([
|
|
@@ -19637,7 +19682,7 @@ async function assertMergeTargetGoneOrThrow(ctx, targetId, expectedContent) {
|
|
|
19637
19682
|
// src/lib/memory/autoExtract.ts
|
|
19638
19683
|
async function isMemoryTopicsUserManaged(ctx, memoryId) {
|
|
19639
19684
|
try {
|
|
19640
|
-
const rows = await ctx.database.get(VaultMemory.table).query(
|
|
19685
|
+
const rows = await ctx.database.get(VaultMemory.table).query(Q16.where("id", memoryId)).fetch();
|
|
19641
19686
|
return rows[0]?.topicsUserManaged === true;
|
|
19642
19687
|
} catch {
|
|
19643
19688
|
return true;
|
|
@@ -22219,7 +22264,7 @@ function parseAnswer(body, base, parseSchema) {
|
|
|
22219
22264
|
}
|
|
22220
22265
|
|
|
22221
22266
|
// src/lib/memory/store/local.ts
|
|
22222
|
-
import { Q as
|
|
22267
|
+
import { Q as Q17 } from "@nozbe/watermelondb";
|
|
22223
22268
|
|
|
22224
22269
|
// src/lib/memory/topicExtract.ts
|
|
22225
22270
|
var TOPIC_EXTRACTION_BATCH_SIZE = 10;
|
|
@@ -22501,8 +22546,8 @@ function createLocalMemoryStore(options) {
|
|
|
22501
22546
|
writeOptions?.signal?.throwIfAborted();
|
|
22502
22547
|
};
|
|
22503
22548
|
const vaultCache = options.vaultCache ?? createVaultEmbeddingCache();
|
|
22504
|
-
const ownedBy = userId !== void 0 ? [
|
|
22505
|
-
const linksOwnedBy = userId === void 0 ? [] : options.allowUnscopedRows ? [
|
|
22549
|
+
const ownedBy = userId !== void 0 ? [Q17.where("user_id", userId)] : [];
|
|
22550
|
+
const linksOwnedBy = userId === void 0 ? [] : options.allowUnscopedRows ? [Q17.or(Q17.where("user_id", userId), Q17.where("user_id", null))] : [Q17.where("user_id", userId)];
|
|
22506
22551
|
const watchedColumns = [
|
|
22507
22552
|
"content",
|
|
22508
22553
|
"scope",
|
|
@@ -22548,7 +22593,7 @@ function createLocalMemoryStore(options) {
|
|
|
22548
22593
|
list: (listOptions) => getAllVaultMemoriesOp(vaultCtx, listOptions),
|
|
22549
22594
|
get: (id2) => getVaultMemoryOp(vaultCtx, id2),
|
|
22550
22595
|
listArchived: async () => {
|
|
22551
|
-
const ids = await vaultCtx.vaultMemoryCollection.query(
|
|
22596
|
+
const ids = await vaultCtx.vaultMemoryCollection.query(Q17.where("is_deleted", false), Q17.where("archived_at", Q17.notEq(null)), ...ownedBy).fetchIds();
|
|
22552
22597
|
if (ids.length === 0) return [];
|
|
22553
22598
|
const rows = await getAllVaultMemoriesOp(vaultCtx, { memoryIds: ids, includeArchived: true });
|
|
22554
22599
|
return rows.sort((a, b) => (b.archivedAt ?? 0) - (a.archivedAt ?? 0));
|
|
@@ -22564,7 +22609,7 @@ function createLocalMemoryStore(options) {
|
|
|
22564
22609
|
set.add(String(link.memory_id));
|
|
22565
22610
|
members.set(entityId, set);
|
|
22566
22611
|
}
|
|
22567
|
-
const entities = userId === void 0 ? await entityCtx.entityCollection.query().unsafeFetchRaw() : members.size ? await entityCtx.entityCollection.query(
|
|
22612
|
+
const entities = userId === void 0 ? await entityCtx.entityCollection.query().unsafeFetchRaw() : members.size ? await entityCtx.entityCollection.query(Q17.where("id", Q17.oneOf([...members.keys()]))).unsafeFetchRaw() : [];
|
|
22568
22613
|
const byName = /* @__PURE__ */ new Map();
|
|
22569
22614
|
for (const entity of entities) {
|
|
22570
22615
|
const name = String(entity.canonical_name);
|
|
@@ -22614,7 +22659,7 @@ function createLocalMemoryStore(options) {
|
|
|
22614
22659
|
setTopics: (memoryId, topics) => setMemoryEntitiesOp(vaultCtx, memoryId, topics),
|
|
22615
22660
|
addTopics: (memoryId, topics, writeOptions) => database.write(async (writer) => {
|
|
22616
22661
|
await assertWrite(writeOptions);
|
|
22617
|
-
const owned = await vaultCtx.vaultMemoryCollection.query(
|
|
22662
|
+
const owned = await vaultCtx.vaultMemoryCollection.query(Q17.where("id", memoryId), Q17.where("is_deleted", false), ...ownedBy).fetchCount();
|
|
22618
22663
|
return owned > 0 ? writer.callWriter(
|
|
22619
22664
|
() => linkMemoryEntitiesOp(
|
|
22620
22665
|
{
|
|
@@ -22686,7 +22731,7 @@ function createLocalMemoryStore(options) {
|
|
|
22686
22731
|
else onChange();
|
|
22687
22732
|
};
|
|
22688
22733
|
};
|
|
22689
|
-
const memories = subscribeOptions?.includeDeleted ? vaultCtx.vaultMemoryCollection.query(...ownedBy).observe() : vaultCtx.vaultMemoryCollection.query(
|
|
22734
|
+
const memories = subscribeOptions?.includeDeleted ? vaultCtx.vaultMemoryCollection.query(...ownedBy).observe() : vaultCtx.vaultMemoryCollection.query(Q17.where("is_deleted", false), ...ownedBy).observeWithColumns(
|
|
22690
22735
|
subscribeOptions?.embeddings ? [...watchedColumns, "embedding", "embedding_model"] : watchedColumns
|
|
22691
22736
|
);
|
|
22692
22737
|
const subscriptions = [memories.subscribe(afterFirst())];
|
|
@@ -23601,7 +23646,7 @@ async function migrateMemoriesToRemote(options) {
|
|
|
23601
23646
|
}
|
|
23602
23647
|
|
|
23603
23648
|
// src/lib/memory/store/remoteStore.ts
|
|
23604
|
-
import { v7 as uuidv76 } from "uuid";
|
|
23649
|
+
import { v5 as uuidv5, v7 as uuidv76 } from "uuid";
|
|
23605
23650
|
function projection({ memory }) {
|
|
23606
23651
|
return {
|
|
23607
23652
|
uniqueId: memory.memory_id,
|
|
@@ -23676,32 +23721,38 @@ function stateFilters(options) {
|
|
|
23676
23721
|
include_superseded: options.includeSuperseded
|
|
23677
23722
|
};
|
|
23678
23723
|
}
|
|
23679
|
-
function
|
|
23680
|
-
|
|
23681
|
-
|
|
23682
|
-
return
|
|
23683
|
-
|
|
23684
|
-
|
|
23685
|
-
|
|
23686
|
-
|
|
23687
|
-
|
|
23688
|
-
|
|
23689
|
-
|
|
23690
|
-
|
|
23691
|
-
|
|
23692
|
-
|
|
23693
|
-
|
|
23694
|
-
|
|
23695
|
-
|
|
23696
|
-
|
|
23697
|
-
|
|
23698
|
-
|
|
23699
|
-
|
|
23700
|
-
|
|
23701
|
-
|
|
23702
|
-
|
|
23703
|
-
|
|
23704
|
-
|
|
23724
|
+
function subscriptionState({ memory, version }) {
|
|
23725
|
+
const membership = memory.trust_tier === "quarantined" ? void 0 : String(!!memory.is_deleted);
|
|
23726
|
+
const hidden = membership === void 0 || memory.is_deleted || memory.archived_at !== void 0 && memory.archived_at !== null || !!memory.superseded_by;
|
|
23727
|
+
return {
|
|
23728
|
+
version,
|
|
23729
|
+
membership,
|
|
23730
|
+
fingerprint: hidden ? void 0 : uuidv5(
|
|
23731
|
+
JSON.stringify([
|
|
23732
|
+
memory.content,
|
|
23733
|
+
memory.scope,
|
|
23734
|
+
memory.updated_at,
|
|
23735
|
+
memory.fact_type,
|
|
23736
|
+
memory.event_time_start,
|
|
23737
|
+
memory.event_time_end,
|
|
23738
|
+
memory.event_time_kind,
|
|
23739
|
+
memory.trust_tier,
|
|
23740
|
+
memory.visibility,
|
|
23741
|
+
memory.published_at,
|
|
23742
|
+
memory.geohash,
|
|
23743
|
+
memory.topics,
|
|
23744
|
+
memory.topics_user_managed,
|
|
23745
|
+
memory.media,
|
|
23746
|
+
memory.source
|
|
23747
|
+
]),
|
|
23748
|
+
uuidv5.URL
|
|
23749
|
+
)
|
|
23750
|
+
};
|
|
23751
|
+
}
|
|
23752
|
+
function subscriptionKey(state, options) {
|
|
23753
|
+
if (options.includeDeleted) return state.membership;
|
|
23754
|
+
if (state.fingerprint === void 0) return void 0;
|
|
23755
|
+
return options.embeddings ? `${state.version}:${state.fingerprint}` : state.fingerprint;
|
|
23705
23756
|
}
|
|
23706
23757
|
function topicInputs(topics, source) {
|
|
23707
23758
|
return topics.flatMap((topic2) => {
|
|
@@ -23779,7 +23830,7 @@ function createRemoteMemoryStore(options) {
|
|
|
23779
23830
|
for (const record2 of records) {
|
|
23780
23831
|
const previous = seen.get(record2.memory.memory_id);
|
|
23781
23832
|
if ((previous?.version ?? 0) + 1 === record2.version)
|
|
23782
|
-
seen.set(record2.memory.memory_id, record2);
|
|
23833
|
+
seen.set(record2.memory.memory_id, subscriptionState(record2));
|
|
23783
23834
|
}
|
|
23784
23835
|
for (const subscriber of [...subscribers])
|
|
23785
23836
|
if (relevant(change, subscriber.options)) safely(subscriber.onChange);
|
|
@@ -24286,7 +24337,8 @@ function createRemoteMemoryStore(options) {
|
|
|
24286
24337
|
const failed = /* @__PURE__ */ new Map();
|
|
24287
24338
|
const collect = (page) => {
|
|
24288
24339
|
warnFailed(page.failed);
|
|
24289
|
-
|
|
24340
|
+
for (const record2 of page.items)
|
|
24341
|
+
records.push({ id: record2.memory.memory_id, state: subscriptionState(record2) });
|
|
24290
24342
|
for (const failure of page.failed) failed.set(failure.memory_id, failure.version);
|
|
24291
24343
|
};
|
|
24292
24344
|
let resume = cursor2;
|
|
@@ -24391,14 +24443,13 @@ function createRemoteMemoryStore(options) {
|
|
|
24391
24443
|
if (subscriber.options.topics) changed.add(subscriber);
|
|
24392
24444
|
}
|
|
24393
24445
|
if (topicState !== void 0) topicFingerprint = topicState;
|
|
24394
|
-
for (const
|
|
24395
|
-
const id2 = record2.memory.memory_id;
|
|
24446
|
+
for (const { id: id2, state } of records) {
|
|
24396
24447
|
const previous = seen.get(id2);
|
|
24397
|
-
seen.set(id2,
|
|
24448
|
+
seen.set(id2, state);
|
|
24398
24449
|
if (!ready) continue;
|
|
24399
24450
|
for (const subscriber of subscribers) {
|
|
24400
24451
|
const before = previous && subscriptionKey(previous, subscriber.options);
|
|
24401
|
-
if (before !== subscriptionKey(
|
|
24452
|
+
if (before !== subscriptionKey(state, subscriber.options)) changed.add(subscriber);
|
|
24402
24453
|
}
|
|
24403
24454
|
}
|
|
24404
24455
|
ready = true;
|
|
@@ -25000,7 +25051,7 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
25000
25051
|
};
|
|
25001
25052
|
const previous = options.previous && options.previous.version === PROFILE_DOC_VERSION && configMatches(options.previous.config, config) ? options.previous : void 0;
|
|
25002
25053
|
const listOptions = { scopes, includeDeleted: true, includeSuperseded: true };
|
|
25003
|
-
const [memories, projections] = store ? await Promise.all([store.list(listOptions), store.listProjections(listOptions)]) : [await
|
|
25054
|
+
const [memories, projections] = store ? await Promise.all([store.list(listOptions), store.listProjections(listOptions)]) : [await getVaultProfileMetadataOp(vaultCtx, { scopes }), []];
|
|
25004
25055
|
const watermark = computeVaultWatermark(memories);
|
|
25005
25056
|
const observationTrends = summarizeObservationTrends(
|
|
25006
25057
|
memories.filter((m) => !m.isDeleted && m.supersededBy === null).map((m) => ({
|
|
@@ -25036,7 +25087,8 @@ async function synthesizeProfile(ctx, options = {}) {
|
|
|
25036
25087
|
previous,
|
|
25037
25088
|
watermark,
|
|
25038
25089
|
options.reviewedMemoryIds,
|
|
25039
|
-
previousUnreadable
|
|
25090
|
+
previousUnreadable,
|
|
25091
|
+
store ? void 0 : (ids) => getVaultEmbeddingsByIdsOp(vaultCtx, ids)
|
|
25040
25092
|
);
|
|
25041
25093
|
const memoriesById = new Map(memories.map((memory) => [memory.uniqueId, memory]));
|
|
25042
25094
|
const fallbackPriors = /* @__PURE__ */ new Map();
|
|
@@ -25123,7 +25175,7 @@ function computeVaultWatermark(memories) {
|
|
|
25123
25175
|
}
|
|
25124
25176
|
return max;
|
|
25125
25177
|
}
|
|
25126
|
-
async function computeStaleFacetKeys(ctx, memories, facets, previous, watermark, reviewedMemoryIds, previouslyUnreadable) {
|
|
25178
|
+
async function computeStaleFacetKeys(ctx, memories, facets, previous, watermark, reviewedMemoryIds, previouslyUnreadable, loadEmbeddings) {
|
|
25127
25179
|
const allKeys = new Set(facets.map((f) => f.key));
|
|
25128
25180
|
if (previous && watermark < previous.vaultWatermark) return allKeys;
|
|
25129
25181
|
if (!previous) return allKeys;
|
|
@@ -25156,7 +25208,9 @@ async function computeStaleFacetKeys(ctx, memories, facets, previous, watermark,
|
|
|
25156
25208
|
toAttribute = toAttribute.filter((m) => allowed.has(m.uniqueId));
|
|
25157
25209
|
}
|
|
25158
25210
|
if (toAttribute.length > 0) {
|
|
25159
|
-
const
|
|
25211
|
+
const candidates = loadEmbeddings ? await loadEmbeddings(toAttribute.map((m) => m.uniqueId)) : toAttribute;
|
|
25212
|
+
if (candidates.length !== toAttribute.length) return allKeys;
|
|
25213
|
+
const attributed = await attributeFacts(ctx, candidates, facets);
|
|
25160
25214
|
if (attributed === null) return allKeys;
|
|
25161
25215
|
for (const k of attributed) stale.add(k);
|
|
25162
25216
|
}
|
|
@@ -25580,17 +25634,17 @@ async function assembleMemoryContext(options) {
|
|
|
25580
25634
|
}
|
|
25581
25635
|
|
|
25582
25636
|
// src/lib/memory/durableExtraction.ts
|
|
25583
|
-
import { Q as
|
|
25637
|
+
import { Q as Q18 } from "@nozbe/watermelondb";
|
|
25584
25638
|
async function messagePositions(storage, ids) {
|
|
25585
25639
|
try {
|
|
25586
25640
|
return await storage.messagesCollection.query(
|
|
25587
|
-
|
|
25641
|
+
Q18.unsafeSqlQuery(
|
|
25588
25642
|
`select "id", "conversation_id", "message_id" from "history" where "_status" is not 'deleted' and "id" in (${ids.map(() => "?").join(",")})`,
|
|
25589
25643
|
ids
|
|
25590
25644
|
)
|
|
25591
25645
|
).unsafeFetchRaw();
|
|
25592
25646
|
} catch {
|
|
25593
|
-
return await storage.messagesCollection.query(
|
|
25647
|
+
return await storage.messagesCollection.query(Q18.where("id", Q18.oneOf(ids))).unsafeFetchRaw();
|
|
25594
25648
|
}
|
|
25595
25649
|
}
|
|
25596
25650
|
var MAX_JOBS_PER_PASS = 3;
|
|
@@ -25763,7 +25817,7 @@ function createDurableAutoExtractor(options) {
|
|
|
25763
25817
|
const source = options.messageSource?.(conversationId);
|
|
25764
25818
|
if (source)
|
|
25765
25819
|
return await fromSource(source.status(conversationId)) === "ready" && (await loadFromSource(source, conversationId, ids)).every(Boolean);
|
|
25766
|
-
return await storage.conversationsCollection.query(
|
|
25820
|
+
return await storage.conversationsCollection.query(Q18.where("conversation_id", conversationId), Q18.where("is_deleted", false)).fetchCount() > 0 && await storage.messagesCollection.query(Q18.where("conversation_id", conversationId), Q18.where("id", Q18.oneOf(ids))).fetchCount() === ids.length;
|
|
25767
25821
|
}
|
|
25768
25822
|
function schedule(delay) {
|
|
25769
25823
|
if (disposed) return;
|
|
@@ -25937,7 +25991,7 @@ function createDurableAutoExtractor(options) {
|
|
|
25937
25991
|
let sourceWaiting = false;
|
|
25938
25992
|
try {
|
|
25939
25993
|
await writes;
|
|
25940
|
-
const pending = await jobs.query(
|
|
25994
|
+
const pending = await jobs.query(Q18.where("owner_key", owner), Q18.where("message_ids", Q18.notEq("[]"))).fetch();
|
|
25941
25995
|
storeFailures = 0;
|
|
25942
25996
|
let processed = 0;
|
|
25943
25997
|
for (const job of pending) {
|
|
@@ -25969,7 +26023,7 @@ function createDurableAutoExtractor(options) {
|
|
|
25969
26023
|
let ids = [];
|
|
25970
26024
|
let loaded = [];
|
|
25971
26025
|
try {
|
|
25972
|
-
const present = source ? sourceStatus === "ready" : await storage.conversationsCollection.query(
|
|
26026
|
+
const present = source ? sourceStatus === "ready" : await storage.conversationsCollection.query(Q18.where("conversation_id", conversationId), Q18.where("is_deleted", false)).fetchCount() > 0;
|
|
25973
26027
|
if (!present) {
|
|
25974
26028
|
await database.write(() => job.destroyPermanently());
|
|
25975
26029
|
continue;
|
|
@@ -26137,7 +26191,7 @@ function createDurableAutoExtractor(options) {
|
|
|
26137
26191
|
const scope = currentScope();
|
|
26138
26192
|
writes = writes.then(
|
|
26139
26193
|
() => database.write(async () => {
|
|
26140
|
-
const existing = await jobs.query(
|
|
26194
|
+
const existing = await jobs.query(Q18.where("owner_key", owner), Q18.where("conversation_id", conversationId)).fetch();
|
|
26141
26195
|
const job = existing.find(
|
|
26142
26196
|
(candidate) => candidate._getRaw("scope") === scope && (candidate._getRaw("folder_id") ?? null) === folderId
|
|
26143
26197
|
);
|
|
@@ -26150,8 +26204,8 @@ function createDurableAutoExtractor(options) {
|
|
|
26150
26204
|
if (watermarks.length) {
|
|
26151
26205
|
const misplaced = new Set(
|
|
26152
26206
|
await storage.messagesCollection.query(
|
|
26153
|
-
|
|
26154
|
-
|
|
26207
|
+
Q18.where("id", Q18.oneOf(watermarks)),
|
|
26208
|
+
Q18.where("conversation_id", Q18.notEq(conversationId))
|
|
26155
26209
|
).fetchIds()
|
|
26156
26210
|
);
|
|
26157
26211
|
for (const prior of existing)
|
|
@@ -31024,10 +31078,10 @@ var UNREVISIONED_COLUMNS = /* @__PURE__ */ new Set([
|
|
|
31024
31078
|
]);
|
|
31025
31079
|
async function getBackupRevision(database, conversationId) {
|
|
31026
31080
|
const serialized = await database.read(async () => {
|
|
31027
|
-
const { Q:
|
|
31081
|
+
const { Q: Q22 } = await import("@nozbe/watermelondb");
|
|
31028
31082
|
const tables = await Promise.all(
|
|
31029
31083
|
["conversations", "history"].map(
|
|
31030
|
-
(table) => database.get(table).query(
|
|
31084
|
+
(table) => database.get(table).query(Q22.where("conversation_id", conversationId), Q22.sortBy("id", Q22.asc)).unsafeFetchRaw()
|
|
31031
31085
|
)
|
|
31032
31086
|
);
|
|
31033
31087
|
return JSON.stringify(
|
|
@@ -31070,9 +31124,9 @@ async function pushConversationToICloud(database, conversationId, userAddress, d
|
|
|
31070
31124
|
}
|
|
31071
31125
|
async function performICloudExport(database, userAddress, deps, onProgress) {
|
|
31072
31126
|
await deps.requestEncryptionKey(userAddress);
|
|
31073
|
-
const { Q:
|
|
31127
|
+
const { Q: Q22 } = await import("@nozbe/watermelondb");
|
|
31074
31128
|
const conversationsCollection = database.get("conversations");
|
|
31075
|
-
const records = await conversationsCollection.query(
|
|
31129
|
+
const records = await conversationsCollection.query(Q22.where("is_deleted", false)).fetch();
|
|
31076
31130
|
const conversations = records.map(conversationToStoredRaw);
|
|
31077
31131
|
const total = conversations.length;
|
|
31078
31132
|
if (total === 0) {
|
|
@@ -34795,7 +34849,7 @@ function useExportPdf() {
|
|
|
34795
34849
|
}
|
|
34796
34850
|
|
|
34797
34851
|
// src/react/useFiles.ts
|
|
34798
|
-
import { Q as
|
|
34852
|
+
import { Q as Q19 } from "@nozbe/watermelondb";
|
|
34799
34853
|
import { useCallback as useCallback8, useEffect as useEffect6, useMemo as useMemo6, useState as useState8 } from "react";
|
|
34800
34854
|
function useFiles(options) {
|
|
34801
34855
|
const { database, walletAddress } = options;
|
|
@@ -34813,7 +34867,7 @@ function useFiles(options) {
|
|
|
34813
34867
|
setIsLoading(true);
|
|
34814
34868
|
try {
|
|
34815
34869
|
const coll = database.get("media");
|
|
34816
|
-
await coll.query(
|
|
34870
|
+
await coll.query(Q19.take(1)).fetch();
|
|
34817
34871
|
setMediaCollection(coll);
|
|
34818
34872
|
setIsReady(true);
|
|
34819
34873
|
} catch (error) {
|
|
@@ -36038,7 +36092,7 @@ function usePhoneCalls(options = {}) {
|
|
|
36038
36092
|
}
|
|
36039
36093
|
|
|
36040
36094
|
// src/react/useProjects.ts
|
|
36041
|
-
import { Q as
|
|
36095
|
+
import { Q as Q20 } from "@nozbe/watermelondb";
|
|
36042
36096
|
import { useCallback as useCallback15, useEffect as useEffect10, useMemo as useMemo8, useState as useState14 } from "react";
|
|
36043
36097
|
function useProjects(options) {
|
|
36044
36098
|
const { database, initialProjectId } = options;
|
|
@@ -36060,7 +36114,7 @@ function useProjects(options) {
|
|
|
36060
36114
|
conversations: convColl?.table
|
|
36061
36115
|
});
|
|
36062
36116
|
getLogger().debug("[useProjects] Running test query on projects table...");
|
|
36063
|
-
const testResult = await projColl.query(
|
|
36117
|
+
const testResult = await projColl.query(Q20.take(1)).fetch();
|
|
36064
36118
|
getLogger().debug(
|
|
36065
36119
|
"[useProjects] Test query succeeded, found",
|
|
36066
36120
|
testResult.length,
|
|
@@ -36147,7 +36201,7 @@ function useProjects(options) {
|
|
|
36147
36201
|
if (!projectsCollection) {
|
|
36148
36202
|
return;
|
|
36149
36203
|
}
|
|
36150
|
-
const subscription = projectsCollection.query(
|
|
36204
|
+
const subscription = projectsCollection.query(Q20.where("is_deleted", false)).observe().subscribe((records) => {
|
|
36151
36205
|
setProjects(records.map(projectToStored));
|
|
36152
36206
|
});
|
|
36153
36207
|
return () => subscription.unsubscribe();
|
|
@@ -36269,7 +36323,7 @@ function useProjects(options) {
|
|
|
36269
36323
|
import { useCallback as useCallback16, useMemo as useMemo9, useSyncExternalStore } from "react";
|
|
36270
36324
|
|
|
36271
36325
|
// src/react/userSettingsStore.ts
|
|
36272
|
-
import { Q as
|
|
36326
|
+
import { Q as Q21 } from "@nozbe/watermelondb";
|
|
36273
36327
|
var EMPTY_SNAPSHOT = Object.freeze({
|
|
36274
36328
|
modelPreference: null,
|
|
36275
36329
|
userPreference: null,
|
|
@@ -36321,7 +36375,7 @@ async function startLoad(entry, walletAddress) {
|
|
|
36321
36375
|
}
|
|
36322
36376
|
function startObserve(entry, walletAddress) {
|
|
36323
36377
|
let isInitialEmission = true;
|
|
36324
|
-
entry.observeSub = entry.storageCtx.userPreferencesCollection.query(
|
|
36378
|
+
entry.observeSub = entry.storageCtx.userPreferencesCollection.query(Q21.where("wallet_address", walletAddress)).observeWithColumns([
|
|
36325
36379
|
"nickname",
|
|
36326
36380
|
"occupation",
|
|
36327
36381
|
"description",
|