openmates 0.15.0-alpha.26 → 0.15.0-alpha.28
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/{chunk-SK2NK7LX.js → chunk-LJQTUMTN.js} +30 -7
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -6004,7 +6004,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
6004
6004
|
}
|
|
6005
6005
|
}
|
|
6006
6006
|
const explicitTasksAppSkill = messageExplicitlyRequestsTasksAppSkill(params.message);
|
|
6007
|
-
const { ws,
|
|
6007
|
+
const { ws, ownerId } = await this.openWsClient({
|
|
6008
6008
|
taskUpdateJobs: !explicitTasksAppSkill
|
|
6009
6009
|
});
|
|
6010
6010
|
if (!params.incognito && !ownerId) {
|
|
@@ -6131,6 +6131,9 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
6131
6131
|
}
|
|
6132
6132
|
const encryptedEmbeds = [...params.encryptedEmbeds ?? []];
|
|
6133
6133
|
if (!params.incognito && params.preparedEmbeds && params.preparedEmbeds.length > 0) {
|
|
6134
|
+
if (!ownerId) {
|
|
6135
|
+
throw new Error("Authenticated user identity is required to encrypt embeds.");
|
|
6136
|
+
}
|
|
6134
6137
|
const masterKey = this.getMasterKeyBytes();
|
|
6135
6138
|
for (const embed of params.preparedEmbeds) {
|
|
6136
6139
|
const encrypted = await encryptEmbed(
|
|
@@ -6139,7 +6142,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
6139
6142
|
chatKeyBytes,
|
|
6140
6143
|
chatId,
|
|
6141
6144
|
messageId,
|
|
6142
|
-
|
|
6145
|
+
ownerId
|
|
6143
6146
|
);
|
|
6144
6147
|
if (encrypted) encryptedEmbeds.push(encrypted);
|
|
6145
6148
|
}
|
|
@@ -6648,7 +6651,8 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
6648
6651
|
embeds: resp.embeds,
|
|
6649
6652
|
chatId,
|
|
6650
6653
|
chatKeyBytes,
|
|
6651
|
-
fallbackMessageId: assistantId
|
|
6654
|
+
fallbackMessageId: assistantId,
|
|
6655
|
+
ownerId
|
|
6652
6656
|
});
|
|
6653
6657
|
await this.persistPostProcessingMetadata({
|
|
6654
6658
|
ws,
|
|
@@ -6931,7 +6935,6 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
6931
6935
|
}).map((embed) => [embed.embed_id, embed])
|
|
6932
6936
|
);
|
|
6933
6937
|
if (finalized.size === 0) return;
|
|
6934
|
-
const session = this.requireSession();
|
|
6935
6938
|
const masterKey = this.getMasterKeyBytes();
|
|
6936
6939
|
const parentKeys = /* @__PURE__ */ new Map();
|
|
6937
6940
|
const processed = /* @__PURE__ */ new Set();
|
|
@@ -6956,10 +6959,9 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
6956
6959
|
const createdAt = normalizeUnixSeconds(embed.createdAt, now);
|
|
6957
6960
|
const updatedAt = normalizeUnixSeconds(embed.updatedAt, now);
|
|
6958
6961
|
const messageId = embed.message_id || params.fallbackMessageId;
|
|
6959
|
-
const userId = embed.user_id || session.hashedEmail;
|
|
6960
6962
|
const hashedChatId = computeSHA256(params.chatId);
|
|
6961
6963
|
const hashedMessageId = computeSHA256(messageId);
|
|
6962
|
-
const hashedUserId = computeSHA256(
|
|
6964
|
+
const hashedUserId = computeSHA256(params.ownerId);
|
|
6963
6965
|
const hashedEmbedId = computeSHA256(embed.embed_id);
|
|
6964
6966
|
const encryptedContent = await encryptWithAesGcmCombined(
|
|
6965
6967
|
embed.content ?? "",
|
|
@@ -6991,7 +6993,17 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
6991
6993
|
created_at: now
|
|
6992
6994
|
}
|
|
6993
6995
|
] : [];
|
|
6996
|
+
const storeRequestId = randomUUID5();
|
|
6997
|
+
const storeConfirmed = params.ws.waitForMessage(
|
|
6998
|
+
"store_embed_confirmed",
|
|
6999
|
+
(payload) => {
|
|
7000
|
+
const p = payload;
|
|
7001
|
+
return p.request_id === storeRequestId && p.embed_id === embed.embed_id;
|
|
7002
|
+
},
|
|
7003
|
+
3e4
|
|
7004
|
+
);
|
|
6994
7005
|
await params.ws.sendAsync("store_embed", {
|
|
7006
|
+
request_id: storeRequestId,
|
|
6995
7007
|
embed_id: embed.embed_id,
|
|
6996
7008
|
encrypted_type: encryptedType,
|
|
6997
7009
|
encrypted_content: encryptedContent,
|
|
@@ -7012,8 +7024,19 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
7012
7024
|
created_at: createdAt,
|
|
7013
7025
|
updated_at: updatedAt
|
|
7014
7026
|
});
|
|
7027
|
+
await storeConfirmed;
|
|
7015
7028
|
if (keys.length > 0) {
|
|
7016
|
-
|
|
7029
|
+
const keysRequestId = randomUUID5();
|
|
7030
|
+
const keysConfirmed = params.ws.waitForMessage(
|
|
7031
|
+
"store_embed_keys_confirmed",
|
|
7032
|
+
(payload) => {
|
|
7033
|
+
const p = payload;
|
|
7034
|
+
return p.request_id === keysRequestId;
|
|
7035
|
+
},
|
|
7036
|
+
3e4
|
|
7037
|
+
);
|
|
7038
|
+
await params.ws.sendAsync("store_embed_keys", { request_id: keysRequestId, keys });
|
|
7039
|
+
await keysConfirmed;
|
|
7017
7040
|
parentKeys.set(embed.embed_id, embedKey);
|
|
7018
7041
|
}
|
|
7019
7042
|
if (Array.isArray(embed.version_history_rows)) {
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED