@seele00/seele 0.1.61 → 0.1.63

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.
Files changed (70) hide show
  1. package/codex/package.json +1 -1
  2. package/package.json +1 -1
  3. package/server/dist/conversations/store.js +91 -1
  4. package/server/dist/server.js +28 -2
  5. package/web/dist/assets/{abnfDiagram-VRR7QNED-C-GmxOf1.js → abnfDiagram-VRR7QNED-DXJQwnn-.js} +1 -1
  6. package/web/dist/assets/{arc-DDtd5ukE.js → arc-D_47-IET.js} +1 -1
  7. package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-Zcrj93zx.js → architectureDiagram-ZJ3FMSHR-CKUldIzR.js} +1 -1
  8. package/web/dist/assets/{blockDiagram-677ZJIJ3-BmW_eWmu.js → blockDiagram-677ZJIJ3-BD4Ym8Xi.js} +1 -1
  9. package/web/dist/assets/{c4Diagram-LMCZKHZV-BqjKf0hc.js → c4Diagram-LMCZKHZV-Cn268vLB.js} +1 -1
  10. package/web/dist/assets/channel-Uz6zF6Xw.js +1 -0
  11. package/web/dist/assets/{chunk-2Q5K7J3B-a9AZFLXE.js → chunk-2Q5K7J3B-D00lQ7mJ.js} +1 -1
  12. package/web/dist/assets/{chunk-32BRIVSS-BCkXoLsJ.js → chunk-32BRIVSS-z7gv8Mry.js} +1 -1
  13. package/web/dist/assets/{chunk-5VM5RSS4-CYvgXUg9.js → chunk-5VM5RSS4-BZJeO_rz.js} +1 -1
  14. package/web/dist/assets/{chunk-EX3LRPZG-Bk4pbTj4.js → chunk-EX3LRPZG-DoIg9UGx.js} +1 -1
  15. package/web/dist/assets/{chunk-JWPE2WC7-BWqM8eD-.js → chunk-JWPE2WC7-C1LcQus2.js} +1 -1
  16. package/web/dist/assets/{chunk-MOJQB5TN-BDc7Owjb.js → chunk-MOJQB5TN--JPbFu4n.js} +1 -1
  17. package/web/dist/assets/{chunk-RYQCIY6F-D09BsSzx.js → chunk-RYQCIY6F-BVv30W60.js} +1 -1
  18. package/web/dist/assets/{chunk-V7JOEXUC-CTzvzLEU.js → chunk-V7JOEXUC-DYoSFgRT.js} +1 -1
  19. package/web/dist/assets/{chunk-VR4S4FIN-C1ZE--Nt.js → chunk-VR4S4FIN-C8BRkTOa.js} +1 -1
  20. package/web/dist/assets/{chunk-XXDRQBXY-BXoQdCUS.js → chunk-XXDRQBXY-CDfofIob.js} +1 -1
  21. package/web/dist/assets/classDiagram-OUVF2IWQ-D6mpE1t2.js +1 -0
  22. package/web/dist/assets/classDiagram-v2-EOCWNBFH-D6mpE1t2.js +1 -0
  23. package/web/dist/assets/{core-7jBzBKfi.js → core-C10OFTno.js} +1 -1
  24. package/web/dist/assets/{cose-bilkent-JH36ORCC-Dj8ACMXD.js → cose-bilkent-JH36ORCC-g9E8J4Fz.js} +1 -1
  25. package/web/dist/assets/{cynefin-VYW2F7L2-B02zjHpN.js → cynefin-VYW2F7L2-Dc689veM.js} +1 -1
  26. package/web/dist/assets/{cynefinDiagram-TSTJHNR4-S6xOPYUg.js → cynefinDiagram-TSTJHNR4-BAAq_jvr.js} +1 -1
  27. package/web/dist/assets/{dagre-VKFMJZFB-DBps2cpF.js → dagre-VKFMJZFB-CPtiniZQ.js} +1 -1
  28. package/web/dist/assets/{diagram-FQU43EPY-Csa0t7d6.js → diagram-FQU43EPY-CvbIL3lu.js} +1 -1
  29. package/web/dist/assets/{diagram-G47NLZAW-CJDkgMuf.js → diagram-G47NLZAW-u5m78Utg.js} +1 -1
  30. package/web/dist/assets/{diagram-NH7WQ7WH-DipELJWi.js → diagram-NH7WQ7WH-4f-Ipubv.js} +1 -1
  31. package/web/dist/assets/{diagram-OA4YK3LP-Du1l3-2I.js → diagram-OA4YK3LP-SUl1EQ56.js} +1 -1
  32. package/web/dist/assets/{diagram-WEI45ONY-B3sreihq.js → diagram-WEI45ONY-C_Upd46l.js} +1 -1
  33. package/web/dist/assets/{ebnfDiagram-CCIWWBDH-DK92dwOE.js → ebnfDiagram-CCIWWBDH-CHp2D7Q9.js} +1 -1
  34. package/web/dist/assets/{erDiagram-Q63AITRT-DEEPoGT-.js → erDiagram-Q63AITRT-DQliHxOw.js} +1 -1
  35. package/web/dist/assets/{flowDiagram-23GEKE2U-DfHAV-5d.js → flowDiagram-23GEKE2U-BcOYSJFM.js} +1 -1
  36. package/web/dist/assets/{ganttDiagram-NO4QXBWP-DuPB9mQa.js → ganttDiagram-NO4QXBWP-CDLHtJq0.js} +1 -1
  37. package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-DRiejHE6.js → gitGraphDiagram-IHSO6WYX-2j8C3mlk.js} +1 -1
  38. package/web/dist/assets/index-BqSosI7W.js +111 -0
  39. package/web/dist/assets/index-C3hMCVKa.css +1 -0
  40. package/web/dist/assets/{infoDiagram-FWYZ7A6U-BFbN_gCc.js → infoDiagram-FWYZ7A6U-ClxdyQnM.js} +1 -1
  41. package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-qpQEAqZ0.js → ishikawaDiagram-FXEZZL3T-Bc2nIRgb.js} +1 -1
  42. package/web/dist/assets/{journeyDiagram-5HDEW3XC-B6Hucs1I.js → journeyDiagram-5HDEW3XC-R-vJ00LW.js} +1 -1
  43. package/web/dist/assets/{kanban-definition-HUTT4EX6-DcJgfaLq.js → kanban-definition-HUTT4EX6-CR0s_Mo8.js} +1 -1
  44. package/web/dist/assets/{linear-BGGGx9QM.js → linear-BQgrawZS.js} +1 -1
  45. package/web/dist/assets/{mermaid.core-BpfGpLSK.js → mermaid.core-faLMbjSU.js} +4 -4
  46. package/web/dist/assets/{mindmap-definition-LN4V7U3C-w9Nrze0Z.js → mindmap-definition-LN4V7U3C-BZULnQui.js} +1 -1
  47. package/web/dist/assets/{pegDiagram-2B236MQR-DR8kd-Uf.js → pegDiagram-2B236MQR-DUm1p_1o.js} +1 -1
  48. package/web/dist/assets/{pieDiagram-ENE6RG2P-cJAEwOMZ.js → pieDiagram-ENE6RG2P-r3LCASRK.js} +1 -1
  49. package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-uqa2DfnD.js → quadrantDiagram-ABIIQ3AL-CGaCp0Px.js} +1 -1
  50. package/web/dist/assets/{railroadDiagram-RFXS5EU6-B3D_Qhhz.js → railroadDiagram-RFXS5EU6-DmEKGO1A.js} +1 -1
  51. package/web/dist/assets/{requirementDiagram-TGXJPOKE-HTpZiir8.js → requirementDiagram-TGXJPOKE-Byc4ivmp.js} +1 -1
  52. package/web/dist/assets/{sankeyDiagram-HTMAVEWB-Dk5U_RAw.js → sankeyDiagram-HTMAVEWB-BtJiL4zX.js} +1 -1
  53. package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-BVQdjwc7.js → sequenceDiagram-DBY2YBRQ-Bg3vdDGW.js} +1 -1
  54. package/web/dist/assets/{sizeCapture-X5ZJPWSS-cQqggv7d.js → sizeCapture-X5ZJPWSS-CCRwjaWU.js} +1 -1
  55. package/web/dist/assets/{stateDiagram-2N3HPSRC-DYyCojiz.js → stateDiagram-2N3HPSRC-CQU-udox.js} +1 -1
  56. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-YNSWW4ip.js +1 -0
  57. package/web/dist/assets/{swimlanes-5IMT3BWC-D3DM4_kt.js → swimlanes-5IMT3BWC-r3tJnQLJ.js} +2 -2
  58. package/web/dist/assets/swimlanesDiagram-G3AALYLV-BGZAc11_.js +8 -0
  59. package/web/dist/assets/{timeline-definition-FHXFAJF6-Cn_urqFk.js → timeline-definition-FHXFAJF6-DryYrdts.js} +1 -1
  60. package/web/dist/assets/{vennDiagram-L72KCM5P-BsDcbpwv.js → vennDiagram-L72KCM5P-ZLPc0qvQ.js} +1 -1
  61. package/web/dist/assets/{wardleyDiagram-EHGQE667-B7QBTkxh.js → wardleyDiagram-EHGQE667-RmgA6vQ9.js} +1 -1
  62. package/web/dist/assets/{xychartDiagram-FW5EYKEG-BmBhEATK.js → xychartDiagram-FW5EYKEG-BGIzispI.js} +1 -1
  63. package/web/dist/index.html +2 -2
  64. package/web/dist/assets/channel-C383rS7h.js +0 -1
  65. package/web/dist/assets/classDiagram-OUVF2IWQ-COnk6cPI.js +0 -1
  66. package/web/dist/assets/classDiagram-v2-EOCWNBFH-COnk6cPI.js +0 -1
  67. package/web/dist/assets/index-B04o0cQL.css +0 -1
  68. package/web/dist/assets/index-CQuxrDDr.js +0 -111
  69. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-C_Jg0hPe.js +0 -1
  70. package/web/dist/assets/swimlanesDiagram-G3AALYLV-Dq3PD0M1.js +0 -8
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seele-codex/codex",
3
- "version": "0.1.61",
3
+ "version": "0.1.63",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seele00/seele",
3
- "version": "0.1.61",
3
+ "version": "0.1.63",
4
4
  "description": "Browser UI and server runtime for Seele Codex",
5
5
  "private": false,
6
6
  "type": "module",
@@ -9,7 +9,7 @@ let workspaceRootPath = null;
9
9
  let centerDatabase = null;
10
10
  let defaultOwnerId = null;
11
11
  const DEFAULT_WORKSPACE_GROUP_ID = "default";
12
- const CENTER_SCHEMA_VERSION = 8;
12
+ const CENTER_SCHEMA_VERSION = 9;
13
13
  const WORKSPACE_SCHEMA_VERSION = 8;
14
14
  const WORKSPACE_MEMORY_ITEMS_SETTING_KEY = "workspace.memory.items";
15
15
  const WORKSPACE_RESPONSIBILITY_SETTING_KEY = "workspace.responsibility";
@@ -41,6 +41,7 @@ export function initializeConversationStore(input) {
41
41
  ensureDefaultWorkspaceGroup();
42
42
  loadWorkspaceGroupsFromDatabase();
43
43
  loadConversationsFromDatabase(input.defaultSandbox);
44
+ initializeWorkspaceUnreadBaselines();
44
45
  }
45
46
  export function closeConversationStore() {
46
47
  for (const db of workspaceDatabases.values()) {
@@ -282,6 +283,44 @@ export function listConversations() {
282
283
  .sort((left, right) => right.updatedAt.localeCompare(left.updatedAt))
283
284
  .map(toSummary);
284
285
  }
286
+ export function countConversationUnreadTurns(conversation, userId) {
287
+ const baseline = getCenterDatabase()
288
+ .prepare(`
289
+ select terminal_turn_rowid
290
+ from workspace_unread_baselines
291
+ where workspace_id = ?
292
+ `)
293
+ .get(conversation.id);
294
+ const readState = getCenterDatabase()
295
+ .prepare(`
296
+ select last_read_turn_rowid
297
+ from workspace_read_states
298
+ where user_id = ? and workspace_id = ?
299
+ `)
300
+ .get(userId, conversation.id);
301
+ const cursor = Math.max(baseline?.terminal_turn_rowid ?? 0, readState?.last_read_turn_rowid ?? 0);
302
+ const row = getWorkspaceDatabase(conversation.workspacePath)
303
+ .prepare(`
304
+ select count(*) as count
305
+ from turns
306
+ where rowid > ? and status in ('completed', 'failed')
307
+ `)
308
+ .get(cursor);
309
+ return row?.count ?? 0;
310
+ }
311
+ export function markConversationRead(conversation, userId) {
312
+ const lastReadTurnRowid = latestTerminalTurnRowid(conversation);
313
+ getCenterDatabase()
314
+ .prepare(`
315
+ insert into workspace_read_states (
316
+ user_id, workspace_id, last_read_turn_rowid, updated_at
317
+ ) values (?, ?, ?, ?)
318
+ on conflict(user_id, workspace_id) do update set
319
+ last_read_turn_rowid = excluded.last_read_turn_rowid,
320
+ updated_at = excluded.updated_at
321
+ `)
322
+ .run(userId, conversation.id, lastReadTurnRowid, new Date().toISOString());
323
+ }
285
324
  export function getConversationStoreDiagnostics() {
286
325
  return {
287
326
  centerSchemaVersion: centerDatabase
@@ -751,6 +790,12 @@ export function deleteConversation(id) {
751
790
  moveWorkspaceToRecycle(conversation);
752
791
  conversations.delete(id);
753
792
  getCenterDatabase().prepare("delete from workspaces where id = ?").run(id);
793
+ getCenterDatabase()
794
+ .prepare("delete from workspace_read_states where workspace_id = ?")
795
+ .run(id);
796
+ getCenterDatabase()
797
+ .prepare("delete from workspace_unread_baselines where workspace_id = ?")
798
+ .run(id);
754
799
  const workspaceDb = workspaceDatabases.get(conversation.workspacePath);
755
800
  if (workspaceDb) {
756
801
  workspaceDb.close();
@@ -792,6 +837,13 @@ export function createConversation(input) {
792
837
  conversations.set(conversation.id, conversation);
793
838
  initializeWorkspaceDatabase(workspacePath);
794
839
  upsertConversationMetadata(conversation);
840
+ getCenterDatabase()
841
+ .prepare(`
842
+ insert into workspace_unread_baselines (
843
+ workspace_id, terminal_turn_rowid
844
+ ) values (?, 0)
845
+ `)
846
+ .run(conversation.id);
795
847
  upsertContextVersion(conversation, contextVersion);
796
848
  return conversation;
797
849
  }
@@ -1035,6 +1087,22 @@ function initializeCenterSchema(db) {
1035
1087
  updated_at text not null
1036
1088
  );
1037
1089
 
1090
+ create table if not exists workspace_unread_baselines (
1091
+ workspace_id text primary key,
1092
+ terminal_turn_rowid integer not null
1093
+ );
1094
+
1095
+ create table if not exists workspace_read_states (
1096
+ user_id text not null,
1097
+ workspace_id text not null,
1098
+ last_read_turn_rowid integer not null,
1099
+ updated_at text not null,
1100
+ primary key (user_id, workspace_id)
1101
+ );
1102
+
1103
+ create index if not exists idx_workspace_read_states_workspace
1104
+ on workspace_read_states(workspace_id);
1105
+
1038
1106
  create index if not exists idx_workspace_wakeups_status_wake_at
1039
1107
  on workspace_wakeups(status, wake_at);
1040
1108
  create index if not exists idx_workspace_wakeups_workspace_wake_at
@@ -1775,6 +1843,28 @@ function readWorkspaceSettingUpdatedAt(workspacePath, key) {
1775
1843
  ? row.updated_at
1776
1844
  : new Date().toISOString();
1777
1845
  }
1846
+ function initializeWorkspaceUnreadBaselines() {
1847
+ const insert = getCenterDatabase().prepare(`
1848
+ insert or ignore into workspace_unread_baselines (
1849
+ workspace_id, terminal_turn_rowid
1850
+ ) values (?, ?)
1851
+ `);
1852
+ runInTransaction(getCenterDatabase(), () => {
1853
+ for (const conversation of conversations.values()) {
1854
+ insert.run(conversation.id, latestTerminalTurnRowid(conversation));
1855
+ }
1856
+ });
1857
+ }
1858
+ function latestTerminalTurnRowid(conversation) {
1859
+ const row = getWorkspaceDatabase(conversation.workspacePath)
1860
+ .prepare(`
1861
+ select coalesce(max(rowid), 0) as rowid
1862
+ from turns
1863
+ where status in ('completed', 'failed')
1864
+ `)
1865
+ .get();
1866
+ return row?.rowid ?? 0;
1867
+ }
1778
1868
  export function parseMemoryItems(value) {
1779
1869
  if (!value?.trim()) {
1780
1870
  return [];
@@ -11,7 +11,7 @@ import { UserStore } from "./auth/users.js";
11
11
  import { buildRuntimeAdditionalContext } from "./contracts/index.js";
12
12
  import { openSse, sendSse } from "./realtime/sse.js";
13
13
  import { RuntimeWorkerClient } from "./runtime-worker/client.js";
14
- import { appendEvent, appendMessage, cancelWorkspaceWakeup, createConversation, createConversationTurn, createWorkspaceWakeup, createWorkspaceGroup, deleteConversation, deleteConversationEnvironmentVariable, deleteGlobalEnvironmentVariable, deleteWorkspaceGroup, getConversation, getConversationEnvironmentDescriptions, getConversationEnvironmentMap, getConversationHistoryPage, getLatestConversationNotification, getConversationRevision, getConversationTurn, getConversationWorkspaceSettings, getConversationStoreDiagnostics, getAppSettingValue, formatMemoryItems, getGlobalEnvironmentDescriptions, getGlobalEnvironmentMap, getNextScheduledWorkspaceWakeup, hasWorkspaceGroup, initializeConversationStore, isConversationSandbox, listGlobalEnvironmentVariables, listDueWorkspaceWakeups, listConversationEventsByType, listConversationTurnEvents, listAllConversationVisibleMessages, listConversationTranscriptMessagesBefore, listConversationTranscriptMessageRange, listRuntimeResets, listTranscriptRangeSummaries, listConversationEnvironmentVariables, listWorkspaceWakeups, listConversations, listWorkspaceGroups, recoverInterruptedWakeupsOnStartup, recoverInterruptedTurnsOnStartup, recordRuntimeReset, revealGlobalEnvironmentVariable, revealConversationEnvironmentVariable, appendConversationContextVersion, setConversationGroup, setConversationMemory, setConversationMemoryItems, setConversationResponsibility, setConversationWorkspaceSetting, deleteConversationWorkspaceSetting, setConversationSandbox, setConversationStatus, setConversationThread, setConversationTitle, updateWorkspaceWakeup, setWorkspaceGroupTitle, upsertTranscriptRangeSummary, upsertAppSetting, upsertConversationEnvironmentVariable, upsertGlobalEnvironmentVariable, updateConversationTurn, normalizeMemoryItems, parseMemoryItems, } from "./conversations/store.js";
14
+ import { appendEvent, appendMessage, cancelWorkspaceWakeup, countConversationUnreadTurns, createConversation, createConversationTurn, createWorkspaceWakeup, createWorkspaceGroup, deleteConversation, deleteConversationEnvironmentVariable, deleteGlobalEnvironmentVariable, deleteWorkspaceGroup, getConversation, getConversationEnvironmentDescriptions, getConversationEnvironmentMap, getConversationHistoryPage, getLatestConversationNotification, getConversationRevision, getConversationTurn, getConversationWorkspaceSettings, getConversationStoreDiagnostics, getAppSettingValue, formatMemoryItems, getGlobalEnvironmentDescriptions, getGlobalEnvironmentMap, getNextScheduledWorkspaceWakeup, hasWorkspaceGroup, initializeConversationStore, isConversationSandbox, listGlobalEnvironmentVariables, listDueWorkspaceWakeups, listConversationEventsByType, listConversationTurnEvents, listAllConversationVisibleMessages, listConversationTranscriptMessagesBefore, listConversationTranscriptMessageRange, listRuntimeResets, listTranscriptRangeSummaries, listConversationEnvironmentVariables, listWorkspaceWakeups, listConversations, listWorkspaceGroups, markConversationRead, recoverInterruptedWakeupsOnStartup, recoverInterruptedTurnsOnStartup, recordRuntimeReset, revealGlobalEnvironmentVariable, revealConversationEnvironmentVariable, appendConversationContextVersion, setConversationGroup, setConversationMemory, setConversationMemoryItems, setConversationResponsibility, setConversationWorkspaceSetting, deleteConversationWorkspaceSetting, setConversationSandbox, setConversationStatus, setConversationThread, setConversationTitle, updateWorkspaceWakeup, setWorkspaceGroupTitle, upsertTranscriptRangeSummary, upsertAppSetting, upsertConversationEnvironmentVariable, upsertGlobalEnvironmentVariable, updateConversationTurn, normalizeMemoryItems, parseMemoryItems, } from "./conversations/store.js";
15
15
  import { createWorkspaceKnowledge, deleteWorkspaceKnowledge, listWorkspaceKnowledge, summarizeWorkspaceKnowledge, updateWorkspaceKnowledge, } from "./conversations/knowledge.js";
16
16
  const config = loadConfig();
17
17
  const userStore = new UserStore(config.centerDbPath, {
@@ -598,6 +598,15 @@ const server = createServer(async (request, response) => {
598
598
  });
599
599
  return;
600
600
  }
601
+ if (request.method === "GET" && url.pathname === "/api/workspace-unread") {
602
+ sendJson(response, 200, {
603
+ workspaces: visibleConversations(authenticatedUser).map((conversation) => ({
604
+ id: conversation.id,
605
+ unreadTurnCount: conversation.unreadTurnCount,
606
+ })),
607
+ });
608
+ return;
609
+ }
601
610
  if (request.method === "GET" && url.pathname === "/api/workspace-groups") {
602
611
  sendJson(response, 200, {
603
612
  groups: visibleWorkspaceGroups(authenticatedUser),
@@ -900,10 +909,22 @@ const server = createServer(async (request, response) => {
900
909
  conversation: {
901
910
  ...conversation,
902
911
  nextWakeup: getNextScheduledWorkspaceWakeup(conversation.id),
912
+ unreadTurnCount: 0,
903
913
  },
904
914
  });
905
915
  return;
906
916
  }
917
+ const conversationReadMatch = url.pathname.match(/^\/api\/conversations\/([^/]+)\/read$/);
918
+ if (request.method === "POST" && conversationReadMatch) {
919
+ const conversation = getConversation(conversationReadMatch[1]);
920
+ if (!conversation) {
921
+ sendJson(response, 404, { error: "conversation_not_found" });
922
+ return;
923
+ }
924
+ markConversationRead(conversation, authenticatedUser.id);
925
+ sendJson(response, 200, { ok: true, unreadTurnCount: 0 });
926
+ return;
927
+ }
907
928
  const conversationMatch = url.pathname.match(/^\/api\/conversations\/([^/]+)$/);
908
929
  if (request.method === "GET" && conversationMatch) {
909
930
  const conversation = getConversation(conversationMatch[1]);
@@ -922,6 +943,7 @@ const server = createServer(async (request, response) => {
922
943
  events: page.events,
923
944
  history: page.history,
924
945
  nextWakeup: getNextScheduledWorkspaceWakeup(conversation.id),
946
+ unreadTurnCount: countConversationUnreadTurns(conversation, authenticatedUser.id),
925
947
  },
926
948
  });
927
949
  return;
@@ -4485,9 +4507,13 @@ function canManageWorkspaceGroup(user, groupId) {
4485
4507
  }
4486
4508
  function visibleConversations(user) {
4487
4509
  const items = listConversations();
4488
- return user.role === "admin"
4510
+ const visible = user.role === "admin"
4489
4511
  ? items
4490
4512
  : items.filter((conversation) => conversation.ownerId === user.id);
4513
+ return visible.map((conversation) => ({
4514
+ ...conversation,
4515
+ unreadTurnCount: countConversationUnreadTurns(conversation, user.id),
4516
+ }));
4491
4517
  }
4492
4518
  function visibleWorkspaceGroups(user) {
4493
4519
  const groups = listWorkspaceGroups();
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-BDc7Owjb.js";import{p as f}from"./chunk-JWPE2WC7-BWqM8eD-.js";import{_ as n,l as o}from"./mermaid.core-BpfGpLSK.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-B02zjHpN.js";import"./index-CQuxrDDr.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
1
+ import{g as p,r as u,d as a}from"./chunk-MOJQB5TN--JPbFu4n.js";import{p as f}from"./chunk-JWPE2WC7-C1LcQus2.js";import{_ as n,l as o}from"./mermaid.core-faLMbjSU.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-Dc689veM.js";import"./index-BqSosI7W.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
@@ -1 +1 @@
1
- import{G as ln,H as un,I as N,J as I,K as J,L as an,M as y,N as tn,O as j,P as _,Q as rn,R as o,S as on,T as sn,V as fn}from"./mermaid.core-BpfGpLSK.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,O,v,R,K,u){var D=q-l,i=O-h,n=K-v,d=u-R,a=d*D-n*i;if(!(a*a<y))return a=(n*(h-R)-d*(l-v))/a,[l+a*D,h+a*i]}function W(l,h,q,O,v,R,K){var u=l-q,D=h-O,i=(K?R:-R)/j(u*u+D*D),n=i*D,d=-i*u,a=l+n,s=h+d,f=q+n,c=O+d,L=(a+f)/2,t=(s+c)/2,m=f-a,g=c-s,A=m*m+g*g,T=v-R,P=a*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),G=(P*g-m*E)/A,H=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=G-L,e=H-t,r=w-L,M=p-t;return x*x+e*e>r*r+M*M&&(G=w,H=p),{cx:G,cy:H,x01:-n,y01:-d,x11:G*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=J(0),O=null,v=gn,R=dn,K=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,L=rn(c-f),t=c>f;if(u||(u=n=D()),s<a&&(d=s,s=a,a=d),!(s>y))u.moveTo(0,0);else if(L>tn-y)u.moveTo(s*N(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*N(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=L,E=L,G=K.apply(this,arguments)/2,H=G>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(H>y){var M=sn(H/a*I(G)),z=sn(H/s*I(G));(P-=M*2)>y?(M*=t?1:-1,A+=M,T-=M):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var Q=s*N(m),V=s*I(m),B=a*N(T),C=a*I(T);if(w>y){var F=s*N(g),U=s*I(g),X=a*N(A),Y=a*I(A),S;if(L<un)if(S=pn(Q,V,X,Y,F,U,B,C)){var Z=Q-S[0],$=V-S[1],k=F-S[0],b=U-S[1],nn=1/I(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(S[0]*S[0]+S[1]*S[1]);p=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=W(X,Y,Q,V,s,x,t),r=W(F,U,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),u.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(u.moveTo(Q,V),u.arc(0,0,s,m,g,!t)):u.moveTo(Q,V),!(a>y)||!(P>y)?u.lineTo(B,C):p>y?(e=W(B,C,F,U,a,-p,t),r=W(Q,V,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,a,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),u.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):u.arc(0,0,a,T,A,t)}if(u.closePath(),n)return u=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[N(d)*n,I(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:J(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:J(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:J(+n),i):q},i.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:J(+n),i):O},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:J(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:J(+n),i):R},i.padAngle=function(n){return arguments.length?(K=typeof n=="function"?n:J(+n),i):K},i.context=function(n){return arguments.length?(u=n??null,i):u},i}export{hn as d};
1
+ import{G as ln,H as un,I as N,J as I,K as J,L as an,M as y,N as tn,O as j,P as _,Q as rn,R as o,S as on,T as sn,V as fn}from"./mermaid.core-faLMbjSU.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,q,O,v,R,K,u){var D=q-l,i=O-h,n=K-v,d=u-R,a=d*D-n*i;if(!(a*a<y))return a=(n*(h-R)-d*(l-v))/a,[l+a*D,h+a*i]}function W(l,h,q,O,v,R,K){var u=l-q,D=h-O,i=(K?R:-R)/j(u*u+D*D),n=i*D,d=-i*u,a=l+n,s=h+d,f=q+n,c=O+d,L=(a+f)/2,t=(s+c)/2,m=f-a,g=c-s,A=m*m+g*g,T=v-R,P=a*c-f*s,E=(g<0?-1:1)*j(on(0,T*T*A-P*P)),G=(P*g-m*E)/A,H=(-P*m-g*E)/A,w=(P*g+m*E)/A,p=(-P*m+g*E)/A,x=G-L,e=H-t,r=w-L,M=p-t;return x*x+e*e>r*r+M*M&&(G=w,H=p),{cx:G,cy:H,x01:-n,y01:-d,x11:G*(v/T-1),y11:H*(v/T-1)}}function hn(){var l=cn,h=yn,q=J(0),O=null,v=gn,R=dn,K=mn,u=null,D=ln(i);function i(){var n,d,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=R.apply(this,arguments)-an,L=rn(c-f),t=c>f;if(u||(u=n=D()),s<a&&(d=s,s=a,a=d),!(s>y))u.moveTo(0,0);else if(L>tn-y)u.moveTo(s*N(f),s*I(f)),u.arc(0,0,s,f,c,!t),a>y&&(u.moveTo(a*N(c),a*I(c)),u.arc(0,0,a,c,f,t));else{var m=f,g=c,A=f,T=c,P=L,E=L,G=K.apply(this,arguments)/2,H=G>y&&(O?+O.apply(this,arguments):j(a*a+s*s)),w=_(rn(s-a)/2,+q.apply(this,arguments)),p=w,x=w,e,r;if(H>y){var M=sn(H/a*I(G)),z=sn(H/s*I(G));(P-=M*2)>y?(M*=t?1:-1,A+=M,T-=M):(P=0,A=T=(f+c)/2),(E-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(E=0,m=g=(f+c)/2)}var Q=s*N(m),V=s*I(m),B=a*N(T),C=a*I(T);if(w>y){var F=s*N(g),U=s*I(g),X=a*N(A),Y=a*I(A),S;if(L<un)if(S=pn(Q,V,X,Y,F,U,B,C)){var Z=Q-S[0],$=V-S[1],k=F-S[0],b=U-S[1],nn=1/I(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(S[0]*S[0]+S[1]*S[1]);p=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}E>y?x>y?(e=W(X,Y,Q,V,s,x,t),r=W(F,U,B,C,s,x,t),u.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),u.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(u.moveTo(Q,V),u.arc(0,0,s,m,g,!t)):u.moveTo(Q,V),!(a>y)||!(P>y)?u.lineTo(B,C):p>y?(e=W(B,C,F,U,a,-p,t),r=W(Q,V,X,Y,a,-p,t),u.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(u.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),u.arc(0,0,a,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),u.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):u.arc(0,0,a,T,A,t)}if(u.closePath(),n)return u=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-un/2;return[N(d)*n,I(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:J(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:J(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:J(+n),i):q},i.padRadius=function(n){return arguments.length?(O=n==null?null:typeof n=="function"?n:J(+n),i):O},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:J(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:J(+n),i):R},i.padAngle=function(n){return arguments.length?(K=typeof n=="function"?n:J(+n),i):K},i.context=function(n){return arguments.length?(u=n??null,i):u},i}export{hn as d};