openmates 0.27.0-alpha.12 → 0.27.0-alpha.13

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.
@@ -14453,6 +14453,7 @@ var OpenMatesClient = class _OpenMatesClient {
14453
14453
  let activeFocusId = null;
14454
14454
  let encryptedChatKey = null;
14455
14455
  let chatSlugLookupKey = null;
14456
+ let focusPhaseState = {};
14456
14457
  let baselineMessagesV = 0;
14457
14458
  let notificationTitle = null;
14458
14459
  let terminalExpectedMessagesV = 1;
@@ -14489,6 +14490,12 @@ var OpenMatesClient = class _OpenMatesClient {
14489
14490
  } catch {
14490
14491
  }
14491
14492
  }
14493
+ const encryptedPhaseState = chat.details.encrypted_focus_phase_state;
14494
+ if (typeof encryptedPhaseState === "string" && encryptedPhaseState) {
14495
+ const phaseText = await decryptWithAesGcmCombined(encryptedPhaseState, chatKeyBytes);
14496
+ if (!phaseText) throw new Error("Could not decrypt focus phase progress. Sync before sending again.");
14497
+ focusPhaseState = JSON.parse(phaseText);
14498
+ }
14492
14499
  const encryptedFocusId = chat.details.encrypted_active_focus_id;
14493
14500
  if (typeof encryptedFocusId === "string" && encryptedFocusId) {
14494
14501
  activeFocusId = await decryptWithAesGcmCombined(encryptedFocusId, chatKeyBytes);
@@ -14508,6 +14515,7 @@ var OpenMatesClient = class _OpenMatesClient {
14508
14515
  ws.onMessageType("focus_mode_activated", (event) => {
14509
14516
  if (event.chat_id !== chatId || !event.focus_id || !chatKeyBytes || params.incognito) return;
14510
14517
  const focusId = event.focus_id;
14518
+ if (!focusId.startsWith("project-")) delete focusPhaseState[focusId];
14511
14519
  const key = chatKeyBytes;
14512
14520
  focusPersistence = focusPersistence.then(async () => {
14513
14521
  const encryptedFocusId = await encryptWithAesGcmCombined(focusId, key);
@@ -14519,6 +14527,51 @@ var OpenMatesClient = class _OpenMatesClient {
14519
14527
  focusPersistenceError = error;
14520
14528
  });
14521
14529
  });
14530
+ ws.onMessageType("focus_phases_updated", (event) => {
14531
+ if (event.chat_id !== chatId || !event.states || !chatKeyBytes || params.incognito) return;
14532
+ const key = chatKeyBytes;
14533
+ const states = event.states;
14534
+ focusPersistence = focusPersistence.then(async () => {
14535
+ for (const [focusId, phase] of Object.entries(states)) {
14536
+ if (phase.schema_version !== 1 || phase.chat_id !== chatId || phase.focus_id !== focusId || !Number.isSafeInteger(phase.version) || phase.version < 0 || !Array.isArray(phase.transitions) || phase.transitions.length > 32) {
14537
+ throw new Error("Invalid focus phase state received");
14538
+ }
14539
+ if (focusPhaseState[focusId]?.run_id === phase.run_id && focusPhaseState[focusId].version > phase.version) states[focusId] = focusPhaseState[focusId];
14540
+ }
14541
+ focusPhaseState = states;
14542
+ const encryptedState = await encryptWithAesGcmCombined(JSON.stringify(states), key);
14543
+ const persisted = ws.waitForMessage(
14544
+ "encrypted_metadata_stored",
14545
+ (payload) => payload.chat_id === chatId,
14546
+ 2e4
14547
+ );
14548
+ await ws.sendAsync("encrypted_chat_metadata", {
14549
+ chat_id: chatId,
14550
+ ...teamId ? { team_id: teamId } : {},
14551
+ encrypted_focus_phase_state: encryptedState
14552
+ });
14553
+ await persisted;
14554
+ const eventIds = /* @__PURE__ */ new Set();
14555
+ for (const phase of Object.values(states)) for (const transition of phase.transitions) {
14556
+ if (transition.chat_id !== chatId || transition.focus_id !== phase.focus_id || !transition.event_id || eventIds.has(transition.event_id)) continue;
14557
+ eventIds.add(transition.event_id);
14558
+ const content = JSON.stringify(transition);
14559
+ await ws.sendAsync("chat_system_message_added", {
14560
+ chat_id: chatId,
14561
+ message: {
14562
+ message_id: transition.event_id,
14563
+ role: "system",
14564
+ status: "synced",
14565
+ encrypted_content: await encryptWithAesGcmCombined(content, key),
14566
+ created_at: transition.created_at
14567
+ }
14568
+ });
14569
+ }
14570
+ clearSyncCache(teamId);
14571
+ }).catch((error) => {
14572
+ focusPersistenceError = error;
14573
+ });
14574
+ });
14522
14575
  const clientCapabilities = taskUpdateJobsEnabled ? ["task_update_jobs"] : [];
14523
14576
  if (!params.incognito && chatKeyBytes) {
14524
14577
  registerCliProjectFileExecutor({
@@ -14541,6 +14594,7 @@ var OpenMatesClient = class _OpenMatesClient {
14541
14594
  client_capabilities: clientCapabilities,
14542
14595
  // Only decrypted current metadata restores focus; history is never authority.
14543
14596
  active_focus_id: activeFocusId,
14597
+ focus_phase_state: focusPhaseState,
14544
14598
  is_incognito: Boolean(params.incognito),
14545
14599
  message: {
14546
14600
  message_id: messageId,
@@ -68976,6 +69030,23 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
68976
69030
  }
68977
69031
  }
68978
69032
  },
69033
+ focus_phases: {
69034
+ phases: {
69035
+ text: "Phases"
69036
+ },
69037
+ requirements: {
69038
+ text: "Requirements"
69039
+ },
69040
+ confirmation: {
69041
+ text: "Your confirmation is required"
69042
+ },
69043
+ switched: {
69044
+ text: "Focus phase:"
69045
+ },
69046
+ returned: {
69047
+ text: "Returned to focus phase:"
69048
+ }
69049
+ },
68979
69050
  footer: {
68980
69051
  language_selector: {
68981
69052
  label: {
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  serializeToYaml,
20
20
  shouldRequireTrustedAccountGuard,
21
21
  waitForWorkflowRun
22
- } from "./chunk-Y5OTP67B.js";
22
+ } from "./chunk-4QNMHHIN.js";
23
23
  import "./chunk-FRNW5Q2V.js";
24
24
  import "./chunk-IWKP55ZB.js";
25
25
  import "./chunk-BBKJZ23O.js";
package/dist/index.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
  selectAssistantMessagesForSpeech,
44
44
  serializeToYaml,
45
45
  summarizeAssistantSpeech
46
- } from "./chunk-Y5OTP67B.js";
46
+ } from "./chunk-4QNMHHIN.js";
47
47
  import "./chunk-FRNW5Q2V.js";
48
48
  import "./chunk-IWKP55ZB.js";
49
49
  import "./chunk-BBKJZ23O.js";
@@ -17,47 +17,47 @@
17
17
  {
18
18
  "name": "libggml-base.so",
19
19
  "bytes": 1110088,
20
- "sha256": "7221794368ec6289a2c98c3b7678c2db3c34dfcd58b06f1ec98da397d1b0b7ff"
20
+ "sha256": "c64d722fab0e4fead54199164443a207cd3ad3eee8b42ad2388540068c19314a"
21
21
  },
22
22
  {
23
23
  "name": "libggml-base.so.0",
24
24
  "bytes": 1110088,
25
- "sha256": "7221794368ec6289a2c98c3b7678c2db3c34dfcd58b06f1ec98da397d1b0b7ff"
25
+ "sha256": "c64d722fab0e4fead54199164443a207cd3ad3eee8b42ad2388540068c19314a"
26
26
  },
27
27
  {
28
28
  "name": "libggml-base.so.0.15.1",
29
29
  "bytes": 1110088,
30
- "sha256": "7221794368ec6289a2c98c3b7678c2db3c34dfcd58b06f1ec98da397d1b0b7ff"
30
+ "sha256": "c64d722fab0e4fead54199164443a207cd3ad3eee8b42ad2388540068c19314a"
31
31
  },
32
32
  {
33
33
  "name": "libggml-cpu.so",
34
34
  "bytes": 869800,
35
- "sha256": "f81c4c66ed1ba92ac76821551895f22fa8c629569d83fb4fd6f7c2d939376e02"
35
+ "sha256": "5d92fb1742ee59a038123138fa46d0d5e6a1c3f03ddfc250dcf715332b86372f"
36
36
  },
37
37
  {
38
38
  "name": "libggml-cpu.so.0",
39
39
  "bytes": 869800,
40
- "sha256": "f81c4c66ed1ba92ac76821551895f22fa8c629569d83fb4fd6f7c2d939376e02"
40
+ "sha256": "5d92fb1742ee59a038123138fa46d0d5e6a1c3f03ddfc250dcf715332b86372f"
41
41
  },
42
42
  {
43
43
  "name": "libggml-cpu.so.0.15.1",
44
44
  "bytes": 869800,
45
- "sha256": "f81c4c66ed1ba92ac76821551895f22fa8c629569d83fb4fd6f7c2d939376e02"
45
+ "sha256": "5d92fb1742ee59a038123138fa46d0d5e6a1c3f03ddfc250dcf715332b86372f"
46
46
  },
47
47
  {
48
48
  "name": "libggml.so",
49
49
  "bytes": 1899104,
50
- "sha256": "71a88bd5214f9787468e512144c93d41e86926d3d23af0e3ff68e9671ec7f1f7"
50
+ "sha256": "ff3318374e6087592081d85ced75c8dd600eec54e9d14621e494d8f379533fb5"
51
51
  },
52
52
  {
53
53
  "name": "libggml.so.0",
54
54
  "bytes": 1899104,
55
- "sha256": "71a88bd5214f9787468e512144c93d41e86926d3d23af0e3ff68e9671ec7f1f7"
55
+ "sha256": "ff3318374e6087592081d85ced75c8dd600eec54e9d14621e494d8f379533fb5"
56
56
  },
57
57
  {
58
58
  "name": "libggml.so.0.15.1",
59
59
  "bytes": 1899104,
60
- "sha256": "71a88bd5214f9787468e512144c93d41e86926d3d23af0e3ff68e9671ec7f1f7"
60
+ "sha256": "ff3318374e6087592081d85ced75c8dd600eec54e9d14621e494d8f379533fb5"
61
61
  },
62
62
  {
63
63
  "name": "openmates-pii-worker",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.27.0-alpha.12",
3
+ "version": "0.27.0-alpha.13",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",