openmates 0.18.0-alpha.28 → 0.18.0-alpha.29

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.
@@ -11655,6 +11655,29 @@ var OpenMatesClient = class _OpenMatesClient {
11655
11655
  }).map((embed) => [embed.embed_id, embed])
11656
11656
  );
11657
11657
  if (finalized.size === 0) return;
11658
+ for (const parent of finalized.values()) {
11659
+ for (const childId of parent.embed_ids ?? []) {
11660
+ if (finalized.has(childId)) continue;
11661
+ const childResponse = params.ws.waitForMessage(
11662
+ "send_embed_data",
11663
+ (payload) => {
11664
+ const frame = payload;
11665
+ const nested = frame.payload ?? frame;
11666
+ return nested.embed_id === childId;
11667
+ }
11668
+ );
11669
+ await params.ws.sendAsync("request_embed", { embed_id: childId });
11670
+ const envelope = (await childResponse).payload;
11671
+ const child = envelope.payload ?? envelope;
11672
+ if (child.parent_embed_id !== parent.embed_id || !child.content || (child.status ?? "finished") !== "finished" || child.chat_id && child.chat_id !== params.chatId && child.chat_id !== computeSHA256(params.chatId)) {
11673
+ throw new Error(`Cannot persist referenced child embed ${childId}: original finished child data is unavailable.`);
11674
+ }
11675
+ if (child.message_id === computeSHA256(params.fallbackMessageId)) {
11676
+ child.message_id = params.fallbackMessageId;
11677
+ }
11678
+ finalized.set(childId, child);
11679
+ }
11680
+ }
11658
11681
  const masterKey = this.getMasterKeyBytes();
11659
11682
  const parentKeys = /* @__PURE__ */ new Map();
11660
11683
  const processed = /* @__PURE__ */ new Set();
@@ -11757,8 +11780,8 @@ var OpenMatesClient = class _OpenMatesClient {
11757
11780
  );
11758
11781
  await params.ws.sendAsync("store_embed_keys", { request_id: keysRequestId, keys });
11759
11782
  await keysConfirmed;
11760
- parentKeys.set(embed.embed_id, embedKey);
11761
11783
  }
11784
+ parentKeys.set(embed.embed_id, embedKey);
11762
11785
  if (Array.isArray(embed.version_history_rows)) {
11763
11786
  for (const row of embed.version_history_rows) {
11764
11787
  if (!row.embed_id || typeof row.version_number !== "number") continue;
package/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  resolveProjectContext,
13
13
  serializeToYaml,
14
14
  shouldRequireTrustedAccountGuard
15
- } from "./chunk-4RPAJ4KP.js";
15
+ } from "./chunk-DL2SX5XG.js";
16
16
  import "./chunk-IWKP55ZB.js";
17
17
  import "./chunk-BBKJZ23O.js";
18
18
  export {
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ import {
42
42
  selectAssistantMessagesForSpeech,
43
43
  serializeToYaml,
44
44
  summarizeAssistantSpeech
45
- } from "./chunk-4RPAJ4KP.js";
45
+ } from "./chunk-DL2SX5XG.js";
46
46
  import "./chunk-IWKP55ZB.js";
47
47
  import "./chunk-BBKJZ23O.js";
48
48
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.18.0-alpha.28",
3
+ "version": "0.18.0-alpha.29",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",