@peers-app/peers-ui 0.32.3 → 0.33.1

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 (83) hide show
  1. package/dist/command-palette/command-palette-ui.d.ts +1 -1
  2. package/dist/command-palette/command-palette-ui.js +10 -74
  3. package/dist/command-palette/command-palette.js +4 -4
  4. package/dist/components/markdown-editor/mention-node.js +16 -12
  5. package/dist/components/markdown-editor/mentions-plugin.js +2 -5
  6. package/dist/components/markdown-with-mentions.js +10 -5
  7. package/dist/components/router.js +1 -41
  8. package/dist/globals.d.ts +2 -6
  9. package/dist/globals.js +0 -35
  10. package/dist/mention-configs.d.ts +1 -5
  11. package/dist/mention-configs.js +4 -54
  12. package/dist/notifications/group-names.d.ts +2 -0
  13. package/dist/notifications/group-names.js +23 -0
  14. package/dist/notifications/notification-bell.d.ts +5 -3
  15. package/dist/notifications/notification-bell.js +23 -49
  16. package/dist/notifications/notifications-client.d.ts +12 -1
  17. package/dist/notifications/notifications-client.js +20 -7
  18. package/dist/notifications/notifications-panel.d.ts +41 -0
  19. package/dist/notifications/notifications-panel.js +108 -0
  20. package/dist/notifications/notifications-screen.js +14 -4
  21. package/dist/screens/account/account-screen.js +1 -1
  22. package/dist/screens/network-viewer/connection-troubleshooter.js +8 -9
  23. package/dist/screens/packages/package-details.js +1 -1
  24. package/dist/screens/search/global-search.js +2 -4
  25. package/dist/screens/tools/tool-catalog-ipc.d.ts +6 -6
  26. package/dist/screens/tools/tool-catalog-ipc.js +4 -5
  27. package/dist/screens/tools/tool-info.js +2 -2
  28. package/dist/screens/tools/tool-schema.d.ts +1 -1
  29. package/dist/screens/tools/tool-schema.js +2 -2
  30. package/dist/system-apps/index.d.ts +0 -3
  31. package/dist/system-apps/index.js +1 -13
  32. package/dist/tabs-layout/network-status-indicator.d.ts +8 -2
  33. package/dist/tabs-layout/network-status-indicator.js +8 -3
  34. package/dist/tabs-layout/tabs-layout.js +21 -4
  35. package/dist/tabs-layout/tabs-state.d.ts +1 -0
  36. package/dist/tabs-layout/tabs-state.js +9 -2
  37. package/dist/utils.d.ts +0 -2
  38. package/dist/utils.js +0 -9
  39. package/package.json +3 -3
  40. package/dist/components/access-level-field.d.ts +0 -10
  41. package/dist/components/access-level-field.js +0 -28
  42. package/dist/components/message-logs/message-logs.d.ts +0 -6
  43. package/dist/components/message-logs/message-logs.js +0 -324
  44. package/dist/components/message-logs/tool-access-approval-card.d.ts +0 -13
  45. package/dist/components/message-logs/tool-access-approval-card.js +0 -82
  46. package/dist/components/messages/avatar.d.ts +0 -9
  47. package/dist/components/messages/avatar.js +0 -101
  48. package/dist/components/messages/channel-message-list.d.ts +0 -13
  49. package/dist/components/messages/channel-message-list.js +0 -158
  50. package/dist/components/messages/channel-view.d.ts +0 -5
  51. package/dist/components/messages/channel-view.js +0 -62
  52. package/dist/components/messages/message-compose.d.ts +0 -11
  53. package/dist/components/messages/message-compose.js +0 -152
  54. package/dist/components/messages/message-display.d.ts +0 -9
  55. package/dist/components/messages/message-display.js +0 -99
  56. package/dist/components/messages/thread-message-list.d.ts +0 -10
  57. package/dist/components/messages/thread-message-list.js +0 -122
  58. package/dist/screens/assistants/assistant-config.d.ts +0 -5
  59. package/dist/screens/assistants/assistant-config.js +0 -56
  60. package/dist/screens/assistants/assistant-details.d.ts +0 -3
  61. package/dist/screens/assistants/assistant-details.js +0 -41
  62. package/dist/screens/assistants/assistant-info.d.ts +0 -11
  63. package/dist/screens/assistants/assistant-info.js +0 -13
  64. package/dist/screens/assistants/assistant-list.d.ts +0 -2
  65. package/dist/screens/assistants/assistant-list.js +0 -80
  66. package/dist/screens/assistants/assistant-tools.d.ts +0 -4
  67. package/dist/screens/assistants/assistant-tools.js +0 -24
  68. package/dist/screens/tools/tool-access-ipc.d.ts +0 -7
  69. package/dist/screens/tools/tool-access-ipc.js +0 -18
  70. package/dist/screens/workflows/workflow-details.d.ts +0 -5
  71. package/dist/screens/workflows/workflow-details.js +0 -57
  72. package/dist/screens/workflows/workflow-info.d.ts +0 -4
  73. package/dist/screens/workflows/workflow-info.js +0 -11
  74. package/dist/screens/workflows/workflow-instructions.d.ts +0 -4
  75. package/dist/screens/workflows/workflow-instructions.js +0 -86
  76. package/dist/screens/workflows/workflow-list.d.ts +0 -1
  77. package/dist/screens/workflows/workflow-list.js +0 -70
  78. package/dist/system-apps/assistants.app.d.ts +0 -2
  79. package/dist/system-apps/assistants.app.js +0 -8
  80. package/dist/system-apps/threads.app.d.ts +0 -2
  81. package/dist/system-apps/threads.app.js +0 -8
  82. package/dist/system-apps/workflows.app.d.ts +0 -2
  83. package/dist/system-apps/workflows.app.js +0 -8
@@ -1,2 +1,2 @@
1
- /** Searchable overlay for launching apps, running commands, and starting threads. */
1
+ /** Searchable overlay for launching apps and running commands. */
2
2
  export declare function CommandPaletteOverlay(): import("react/jsx-runtime").JSX.Element | null;
@@ -2,17 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CommandPaletteOverlay = CommandPaletteOverlay;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const peers_sdk_1 = require("@peers-app/peers-sdk");
6
5
  // biome-ignore lint/correctness/noUnusedImports: classic JSX (`jsx: react`) needs React in scope for emit
7
6
  const react_1 = require("react");
8
- const globals_1 = require("../globals");
9
7
  const hooks_1 = require("../hooks");
10
8
  const color_mode_dropdown_1 = require("../screens/settings/color-mode-dropdown");
11
9
  const system_apps_1 = require("../system-apps");
12
10
  const tabs_state_1 = require("../tabs-layout/tabs-state");
13
11
  const routes_loader_1 = require("../ui-router/routes-loader");
14
12
  const command_palette_1 = require("./command-palette");
15
- /** Searchable overlay for launching apps, running commands, and starting threads. */
13
+ /** Searchable overlay for launching apps and running commands. */
16
14
  function CommandPaletteOverlay() {
17
15
  const [isOpen] = (0, hooks_1.useObservable)(command_palette_1.isCommandPaletteOpen);
18
16
  const [_persistedQuery] = (0, hooks_1.useObservable)(command_palette_1.commandSearchQuery);
@@ -95,23 +93,6 @@ function CommandPaletteOverlay() {
95
93
  app.packageName.toLowerCase().includes(lowerQuery));
96
94
  };
97
95
  const filteredApps = searchApps(searchQuery);
98
- // Function to create a new thread from search query
99
- const createNewThreadFromQuery = (0, react_1.useCallback)(async (query) => {
100
- try {
101
- const currentUser = await (0, peers_sdk_1.getMe)();
102
- const threadMessage = await (0, peers_sdk_1.Messages)().insert({
103
- messageId: (0, peers_sdk_1.newid)(),
104
- userId: currentUser.userId,
105
- channelId: currentUser.userId,
106
- message: query.trim(),
107
- createdAt: new Date(),
108
- });
109
- await (0, globals_1.openThreadInTab)(threadMessage);
110
- }
111
- catch (error) {
112
- console.error("Failed to create new thread:", error);
113
- }
114
- }, []);
115
96
  // Create a flattened list that matches the visual rendering order
116
97
  // Apps first, then commands
117
98
  const allItems = [];
@@ -147,9 +128,7 @@ function CommandPaletteOverlay() {
147
128
  const handleKeyDown = (e) => {
148
129
  if (e.key === "ArrowDown") {
149
130
  e.preventDefault();
150
- // Allow selection to go one past the end if there's a search query (for new thread option)
151
- const maxIndex = searchQuery.trim() ? allItems.length : allItems.length - 1;
152
- setSelectedIndex((prev) => Math.min(prev + 1, maxIndex));
131
+ setSelectedIndex((prev) => Math.min(prev + 1, allItems.length - 1));
153
132
  }
154
133
  else if (e.key === "ArrowUp") {
155
134
  e.preventDefault();
@@ -157,34 +136,19 @@ function CommandPaletteOverlay() {
157
136
  }
158
137
  else if (e.key === "Enter") {
159
138
  e.preventDefault();
160
- // Check if the new thread option is selected (selectedIndex >= allItems.length)
161
- if (selectedIndex >= allItems.length && searchQuery.trim()) {
139
+ const selectedItem = allItems[selectedIndex];
140
+ if (selectedItem?.type === "app" && selectedItem.app) {
162
141
  (0, command_palette_1.closeCommandPalette)();
163
- createNewThreadFromQuery(searchQuery);
142
+ (0, tabs_state_1.goToTabPath)(selectedItem.app.path);
164
143
  }
165
- else {
166
- const selectedItem = allItems[selectedIndex];
167
- if (selectedItem) {
168
- if (selectedItem.type === "app" && selectedItem.app) {
169
- (0, command_palette_1.closeCommandPalette)();
170
- (0, tabs_state_1.goToTabPath)(selectedItem.app.path);
171
- }
172
- else if (selectedItem.type === "command" && selectedItem.command) {
173
- (0, command_palette_1.executeCommand)(selectedItem.command.id);
174
- }
175
- }
176
- else if (searchQuery.trim()) {
177
- // Fallback: Create a new thread with the search query as the message
178
- // This happens when no item is selected (selectedIndex is out of bounds or -1)
179
- (0, command_palette_1.closeCommandPalette)();
180
- createNewThreadFromQuery(searchQuery);
181
- }
144
+ else if (selectedItem?.type === "command" && selectedItem.command) {
145
+ (0, command_palette_1.executeCommand)(selectedItem.command.id);
182
146
  }
183
147
  }
184
148
  };
185
149
  document.addEventListener("keydown", handleKeyDown);
186
150
  return () => document.removeEventListener("keydown", handleKeyDown);
187
- }, [isOpen, selectedIndex, createNewThreadFromQuery, searchQuery]);
151
+ }, [isOpen, selectedIndex, allItems]);
188
152
  if (!isOpen)
189
153
  return null;
190
154
  const isDark = _colorMode === "dark";
@@ -284,36 +248,8 @@ function CommandPaletteOverlay() {
284
248
  ? "1px solid #495057"
285
249
  : "1px solid var(--peers-surface-border)",
286
250
  }, children: command.shortcut }))] }, command.id));
287
- })] }, category))), searchQuery.trim() && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "px-3 py-1 small text-muted fw-bold text-uppercase", style: { fontSize: "11px", letterSpacing: "0.5px" }, children: "Actions" }), (0, jsx_runtime_1.jsx)("div", { className: `px-3 py-2 d-flex align-items-center ${(allItems.length === 0 || selectedIndex >= allItems.length) &&
288
- searchQuery.trim()
289
- ? isDark
290
- ? "bg-primary bg-opacity-25"
291
- : "bg-primary bg-opacity-10"
292
- : ""}`, style: {
293
- cursor: "pointer",
294
- transition: "background-color 0.1s ease",
295
- borderTop: allItems.length > 0
296
- ? `1px solid ${isDark ? "#495057" : "var(--peers-surface-border)"}`
297
- : "none",
298
- marginTop: allItems.length > 0 ? "8px" : "0",
299
- paddingTop: allItems.length > 0 ? "12px" : "8px",
300
- }, onClick: () => {
301
- (0, command_palette_1.closeCommandPalette)();
302
- createNewThreadFromQuery(searchQuery);
303
- }, onMouseEnter: () => {
304
- // Set selected index beyond the list to indicate this item is selected
305
- setSelectedIndex(allItems.length);
306
- }, children: (0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-chat-dots me-3", style: {
307
- fontSize: "16px",
308
- color: (allItems.length === 0 || selectedIndex >= allItems.length) &&
309
- searchQuery.trim()
310
- ? isDark
311
- ? "#ffffff"
312
- : "#0d6efd"
313
- : "#6c757d",
314
- minWidth: "16px",
315
- } }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "fw-medium", children: ["Start new thread:", " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-muted", children: [searchQuery.trim().slice(0, 50), searchQuery.trim().length > 50 ? "..." : ""] })] }), (0, jsx_runtime_1.jsx)("div", { className: "small text-muted", style: { fontSize: "12px" }, children: "Press Enter to create" })] })] }) })] }))] })) }), (0, jsx_runtime_1.jsxs)("div", { className: `px-3 py-2 small text-muted border-top d-flex align-items-center justify-content-between`, style: {
251
+ })] }, category)))] })) }), (0, jsx_runtime_1.jsxs)("div", { className: `px-3 py-2 small text-muted border-top d-flex align-items-center justify-content-between`, style: {
316
252
  borderTopColor: isDark ? "#495057" : "var(--peers-surface-border)",
317
253
  fontSize: "11px",
318
- }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-3", children: [(0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "\u21B5" }), " to select"] }), (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "\u2191\u2193" }), " to navigate"] }), (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "esc" }), " to close"] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [allItems.length, " result", allItems.length !== 1 ? "s" : "", searchQuery.trim() && allItems.length === 0 && " • Start thread"] })] })] }) }));
254
+ }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-3", children: [(0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "\u21B5" }), " to select"] }), (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "\u2191\u2193" }), " to navigate"] }), (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "esc" }), " to close"] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [allItems.length, " result", allItems.length !== 1 ? "s" : ""] })] })] }) }));
319
255
  }
@@ -114,14 +114,14 @@ const coreCommands = [
114
114
  },
115
115
  {
116
116
  id: "go-home",
117
- label: "Go to Threads",
118
- description: "Navigate to threads/home",
117
+ label: "Go Home",
118
+ description: "Show the app launcher",
119
119
  shortcut: `${modKey}+H`,
120
- iconClassName: "bi-cpu",
120
+ iconClassName: "bi-grid-3x3-gap",
121
121
  category: "Navigation",
122
122
  action: () => {
123
123
  closeCommandPalette();
124
- (0, tabs_state_1.goToTabPath)("threads");
124
+ (0, tabs_state_1.goToTabPath)("");
125
125
  },
126
126
  },
127
127
  ];
@@ -74,18 +74,22 @@ class MentionNode extends lexical_1.TextNode {
74
74
  dom.setAttribute("data-clickable", this.data.clickable === undefined ? "" : String(this.data.clickable));
75
75
  // currently ignoring `clickable` attribute
76
76
  // if (this.data.clickable !== false) {...
77
- const onClick = mentionConfig?.onClick;
78
- dom.style.cursor = "pointer";
79
- dom.addEventListener("click", () => {
80
- if (onClick) {
81
- onClick(this.data);
82
- }
83
- else {
84
- const id = this.data.id;
85
- const href = kind === "user" ? `identity/people/${id}` : `${kind}s/${id}`;
86
- (0, globals_1.mainContentPath)(href);
87
- }
88
- });
77
+ // A kind with no config, such as a saved assistant or workflow mention, has no screen to
78
+ // open: it stays plain text, as MarkdownWithMentions renders it.
79
+ if (mentionConfig) {
80
+ const onClick = mentionConfig.onClick;
81
+ dom.style.cursor = "pointer";
82
+ dom.addEventListener("click", () => {
83
+ if (onClick) {
84
+ onClick(this.data);
85
+ }
86
+ else {
87
+ const id = this.data.id;
88
+ const href = kind === "user" ? `identity/people/${id}` : `${kind}s/${id}`;
89
+ (0, globals_1.mainContentPath)(href);
90
+ }
91
+ });
92
+ }
89
93
  if (mentionConfig && kind !== "user") {
90
94
  const iconSpan = document.createElement("i");
91
95
  iconSpan.className = `pe-1 ${mentionConfig.iconClass}`;
@@ -124,10 +124,10 @@ function useMentionLookupService(mentionString, mentionConfigs = []) {
124
124
  allResults = (0, lodash_1.uniqBy)(allResults, "id");
125
125
  let filteredResults = allResults;
126
126
  if (prefix === "@") {
127
- filteredResults = filteredResults.filter((result) => result.kind === "user" || result.kind === "assistant");
127
+ filteredResults = filteredResults.filter((result) => result.kind === "user");
128
128
  }
129
129
  else {
130
- filteredResults = filteredResults.filter((result) => result.kind !== "user" && result.kind !== "assistant");
130
+ filteredResults = filteredResults.filter((result) => result.kind !== "user");
131
131
  }
132
132
  if (kind) {
133
133
  filteredResults = allResults.filter((result) => result.kind.toLowerCase() === kind.toLowerCase());
@@ -179,9 +179,6 @@ class MentionTypeaheadOption extends LexicalTypeaheadMenuPlugin_1.MenuOption {
179
179
  this.name = data.name;
180
180
  this.picture = picture;
181
181
  this.id = data.id;
182
- // if (data.kind === 'assistant') {
183
- // this.userId = data.userId;
184
- // }
185
182
  }
186
183
  }
187
184
  function MentionsTypeaheadMenuItem({ index, isSelected, onClick, onMouseEnter, option, }) {
@@ -48,13 +48,18 @@ const processTextWithMentions = (text) => {
48
48
  style.whiteSpace = "nowrap";
49
49
  }
50
50
  const mentionConfig = mention_configs_1.mentionConfigs.find((c) => c.kind === kind);
51
- const mentionClass = mentionConfig
52
- ? mentionConfig.styleClass || "mention-default-default"
53
- : `mention-${kind}`;
54
- const onClick = mentionConfig?.onClick;
51
+ if (!mentionConfig) {
52
+ // A kind Peers no longer has, such as a saved assistant or workflow mention: its name only.
53
+ parts.push(name);
54
+ lastIndex = regex.lastIndex;
55
+ match = regex.exec(text);
56
+ continue;
57
+ }
58
+ const mentionClass = mentionConfig.styleClass || "mention-default-default";
59
+ const onClick = mentionConfig.onClick;
55
60
  const href = (!onClick && `#${kind}s/${id}`) || undefined;
56
61
  const icon = (kind === "user" && "@") ||
57
- (mentionConfig?.iconClass && (0, jsx_runtime_1.jsx)("i", { className: `pe-1 ${mentionConfig.iconClass}` })) || ((0, jsx_runtime_1.jsx)("i", { className: `pe-1 bi bi-question` }));
62
+ (mentionConfig.iconClass && (0, jsx_runtime_1.jsx)("i", { className: `pe-1 ${mentionConfig.iconClass}` })) || ((0, jsx_runtime_1.jsx)("i", { className: `pe-1 bi bi-question` }));
58
63
  parts.push((0, jsx_runtime_1.jsxs)("a", { className: mentionClass, "data-kind": kind, "data-id": id, style: style, href: href, onClick: onClick && (() => onClick(data)), children: [icon, data.name] }, cnt));
59
64
  lastIndex = regex.lastIndex;
60
65
  match = regex.exec(text);
@@ -37,8 +37,6 @@ exports.Router = Router;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const globals = __importStar(require("../globals"));
39
39
  const hooks_1 = require("../hooks");
40
- const assistant_details_1 = require("../screens/assistants/assistant-details");
41
- const assistant_list_1 = require("../screens/assistants/assistant-list");
42
40
  const identity_routes_1 = require("../screens/identity/identity-routes");
43
41
  const package_details_1 = require("../screens/packages/package-details");
44
42
  const package_list_1 = require("../screens/packages/package-list");
@@ -53,11 +51,7 @@ const tool_details_1 = require("../screens/tools/tool-details");
53
51
  const tool_list_1 = require("../screens/tools/tool-list");
54
52
  const variable_details_1 = require("../screens/variables/variable-details");
55
53
  const variable_list_1 = require("../screens/variables/variable-list");
56
- const workflow_details_1 = require("../screens/workflows/workflow-details");
57
- const workflow_list_1 = require("../screens/workflows/workflow-list");
58
54
  const ui_loader_1 = require("../ui-router/ui-loader");
59
- const channel_view_1 = require("./messages/channel-view");
60
- const thread_message_list_1 = require("./messages/thread-message-list");
61
55
  require("../screens/console-logs/console-logs-list");
62
56
  require("../screens/identity");
63
57
  require("../screens/network-viewer");
@@ -88,29 +82,10 @@ function Router({ path: providedPath } = {}) {
88
82
  if (path === "settings" || path === "profile") {
89
83
  return (0, jsx_runtime_1.jsx)(settings_page_1.SettingsPage, {});
90
84
  }
91
- if (path === "threads" || path === "") {
92
- return (0, jsx_runtime_1.jsx)(channel_view_1.ChannelMessages, {});
93
- }
94
85
  const ui = (0, ui_loader_1.UIRouter)({ path, props: {}, uiCategory: "screen" });
95
86
  if (ui) {
96
87
  return ui;
97
88
  }
98
- if (path.match(/^channel\//)) {
99
- const parts = path.split("/");
100
- parts.shift();
101
- const channelId = parts[0];
102
- // todo add additional params as props if they exist
103
- return (0, jsx_runtime_1.jsx)(channel_view_1.ChannelMessages, { channelId: channelId });
104
- }
105
- if (path === "assistants") {
106
- return (0, jsx_runtime_1.jsx)(assistant_list_1.AssistantList, {});
107
- }
108
- if (path.match(/^assistants\//)) {
109
- const parts = path.split("/");
110
- parts.shift();
111
- const id = parts[0];
112
- return (0, jsx_runtime_1.jsx)(assistant_details_1.AssistantDetails, { assistantId: id });
113
- }
114
89
  // if (path === 'tasks') {
115
90
  // return <TaskList />;
116
91
  // }
@@ -120,15 +95,6 @@ function Router({ path: providedPath } = {}) {
120
95
  // const taskId = parts[0];
121
96
  // return <TaskDetails taskId={taskId} />;
122
97
  // }
123
- if (path === "workflows") {
124
- return (0, jsx_runtime_1.jsx)(workflow_list_1.WorkflowList, {});
125
- }
126
- if (path.match(/^workflows\//)) {
127
- const parts = path.split("/");
128
- parts.shift();
129
- const workflowId = parts[0];
130
- return (0, jsx_runtime_1.jsx)(workflow_details_1.WorkflowDetails, { workflowId: workflowId });
131
- }
132
98
  // Saved tabs from the removed tool-test screens fall back to the catalog.
133
99
  if (path === "tools" || /^tools\/tests(?:\/|$)/.test(path)) {
134
100
  return (0, jsx_runtime_1.jsx)(tool_list_1.ToolList, {});
@@ -169,15 +135,9 @@ function Router({ path: providedPath } = {}) {
169
135
  const id = parts[0];
170
136
  return (0, jsx_runtime_1.jsx)(peer_type_details_1.PeerTypeDetails, { peerTypeId: id });
171
137
  }
172
- if (path.match(/^threads\//)) {
173
- const parts = path.split("/");
174
- parts.shift();
175
- const threadId = parts[0];
176
- return (0, jsx_runtime_1.jsx)(thread_message_list_1.ThreadMessageList, { threadId: threadId });
177
- }
178
138
  throw new Error(`Unrecognized route: ${originalPath}`);
179
139
  }
180
140
  catch (err) {
181
- return ((0, jsx_runtime_1.jsxs)("div", { className: "p-3", children: [(0, jsx_runtime_1.jsx)("a", { href: "#threads", children: "Home" }), (0, jsx_runtime_1.jsx)("h3", { children: "Error loading route" }), (0, jsx_runtime_1.jsxs)("pre", { children: ["route: ", `${globals.mainContentPath()}\n`, String(err)] })] }));
141
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-3", children: [(0, jsx_runtime_1.jsx)("a", { href: "#", children: "Home" }), (0, jsx_runtime_1.jsx)("h3", { children: "Error loading route" }), (0, jsx_runtime_1.jsxs)("pre", { children: ["route: ", `${globals.mainContentPath()}\n`, String(err)] })] }));
182
142
  }
183
143
  }
package/dist/globals.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type IMessage, type IUser } from "@peers-app/peers-sdk";
1
+ import { type IUser } from "@peers-app/peers-sdk";
2
2
  /** Counter incremented when installed package UI should reload. */
3
3
  export declare const packageReloaded: import("@peers-app/peers-sdk").Observable<number>;
4
4
  /** Persisted route for the active data context. Prefer {@link mainContentPath}. */
@@ -7,10 +7,6 @@ export declare const _mainContentPath: import("@peers-app/peers-sdk").Persistent
7
7
  export declare const mainContentPath: import("@peers-app/peers-sdk").Observable<string>;
8
8
  /** Read or update one query parameter on {@link mainContentPath}. */
9
9
  export declare function queryParam(name: string, value?: string): string;
10
- /** Open a message thread in its owning app tab. */
11
- export declare function openThread(thread: string | IMessage): Promise<void>;
12
- /** Resolve a message and open its root thread in a new tab. */
13
- export declare function openThreadInTab(thread: string | IMessage): Promise<void>;
14
10
  /** Signed profile for the active user after {@link loadGlobals}. */
15
11
  export declare let me: IUser;
16
12
  /** Current browser viewport width. */
@@ -29,8 +25,8 @@ export declare const groups: import("@peers-app/peers-sdk").Observable<{
29
25
  groupId: string;
30
26
  founderUserId: string;
31
27
  disabled?: boolean | undefined;
32
- iconClassName?: string | undefined;
33
28
  signedAt?: number | undefined;
29
+ iconClassName?: string | undefined;
34
30
  publicRole?: import("@peers-app/peers-sdk").GroupMemberRole | undefined;
35
31
  fileRetention?: {
36
32
  days: number | "never";
package/dist/globals.js CHANGED
@@ -2,15 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.groups = exports.isDesktop = exports.windowHeight = exports.windowWidth = exports.me = exports.mainContentPath = exports._mainContentPath = exports.packageReloaded = void 0;
4
4
  exports.queryParam = queryParam;
5
- exports.openThread = openThread;
6
- exports.openThreadInTab = openThreadInTab;
7
5
  exports.initializeHashNavigation = initializeHashNavigation;
8
6
  exports.loadGlobals = loadGlobals;
9
7
  const peers_sdk_1 = require("@peers-app/peers-sdk");
10
8
  const identity_routes_1 = require("./screens/identity/identity-routes");
11
9
  const packages_ipc_1 = require("./screens/packages/packages-ipc");
12
10
  const tabs_state_1 = require("./tabs-layout/tabs-state");
13
- const utils_1 = require("./utils");
14
11
  /** Counter incremented when installed package UI should reload. */
15
12
  exports.packageReloaded = (0, peers_sdk_1.observable)(0);
16
13
  /** Persisted route for the active data context. Prefer {@link mainContentPath}. */
@@ -64,38 +61,6 @@ function queryParam(name, value) {
64
61
  }
65
62
  return params[name];
66
63
  }
67
- /** Open a message thread in its owning app tab. */
68
- async function openThread(thread) {
69
- openThreadInTab(thread);
70
- }
71
- /** Resolve a message and open its root thread in a new tab. */
72
- async function openThreadInTab(thread) {
73
- const threadId = typeof thread === "string" ? thread : thread.messageId;
74
- const message = await (0, peers_sdk_1.Messages)().get(threadId);
75
- if (!message) {
76
- console.warn("Thread message not found:", threadId);
77
- return;
78
- }
79
- // Use parent message ID if this is a reply, otherwise use the message itself
80
- const actualThreadId = message.messageParentId || message.messageId;
81
- // Generate thread title from message content (strip mentions and clean formatting)
82
- const cleanMessage = (0, utils_1.stripMentions)(message.message);
83
- const messagePreview = cleanMessage.slice(0, 30);
84
- const threadTitle = `${messagePreview}${cleanMessage.length > 30 ? "..." : ""}` || `Thread`;
85
- // // Import openNewTab dynamically to avoid circular dependency
86
- // const { openNewTab } = await import('./tabs-layout/tabs-layout');
87
- (0, tabs_state_1.openNewTab)({
88
- packageId: "system-apps",
89
- path: `threads/${actualThreadId}`,
90
- title: threadTitle,
91
- iconClassName: "bi-chat-dots",
92
- });
93
- }
94
- // A notification clicked in the desktop app's main process opens its thread here.
95
- (0, peers_sdk_1.subscribe)("ui:openThread", (event) => {
96
- if (event.data?.threadId)
97
- void openThread(event.data.threadId);
98
- });
99
64
  /** Signed profile for the active user after {@link loadGlobals}. */
100
65
  exports.me = null;
101
66
  /** Current browser viewport width. */
@@ -9,14 +9,10 @@ export interface IMentionConfig {
9
9
  picture?: (data: IMentionData) => JSX.Element;
10
10
  onClick?: (data: IMentionData) => void;
11
11
  }
12
- /** Discover workflow-invocable tools while keeping historical mention IDs readable. */
12
+ /** Discover catalog tools while keeping historical mention IDs readable. */
13
13
  export declare const toolMentionConfig: IMentionConfig;
14
14
  /** Discover users and resolve persisted user mentions. */
15
15
  export declare const userMentionConfig: IMentionConfig;
16
- /** Discover assistants and resolve persisted assistant mentions. */
17
- export declare const assistantMentionConfig: IMentionConfig;
18
- /** Discover workflows and resolve persisted workflow mentions. */
19
- export declare const workflowMentionConfig: IMentionConfig;
20
16
  /** Discover data types and navigate to their definitions. */
21
17
  export declare const valueTypeMentionConfig: IMentionConfig;
22
18
  /** Shared mention definitions used by editors and rendered messages. */
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mentionConfigs = exports.valueTypeMentionConfig = exports.workflowMentionConfig = exports.assistantMentionConfig = exports.userMentionConfig = exports.toolMentionConfig = void 0;
3
+ exports.mentionConfigs = exports.valueTypeMentionConfig = exports.userMentionConfig = exports.toolMentionConfig = void 0;
4
4
  const peers_sdk_1 = require("@peers-app/peers-sdk");
5
5
  const globals_1 = require("./globals");
6
6
  const tool_catalog_ipc_1 = require("./screens/tools/tool-catalog-ipc");
7
7
  const MENTIONS_MAX_RESULTS = 10;
8
- /** Discover workflow-invocable tools while keeping historical mention IDs readable. */
8
+ /** Discover catalog tools while keeping historical mention IDs readable. */
9
9
  exports.toolMentionConfig = {
10
10
  kind: "tool",
11
11
  iconClass: "bi bi-tools",
12
12
  styleClass: "mention-tool",
13
13
  query: async (search) => {
14
- const results = await (0, tool_catalog_ipc_1.listWorkflowMentionTools)(search, MENTIONS_MAX_RESULTS);
14
+ const results = await (0, tool_catalog_ipc_1.listMentionTools)(search, MENTIONS_MAX_RESULTS);
15
15
  return results.map((p) => ({
16
16
  kind: "tool",
17
17
  id: p.toolId,
@@ -48,50 +48,6 @@ exports.userMentionConfig = {
48
48
  name: item.name,
49
49
  }),
50
50
  };
51
- /** Discover assistants and resolve persisted assistant mentions. */
52
- exports.assistantMentionConfig = {
53
- kind: "assistant",
54
- iconClass: "bi bi-person-fill-gear",
55
- styleClass: "mention-assistant",
56
- query: async (search) => {
57
- return (0, peers_sdk_1.Assistants)()
58
- .list({ name: { $matchWords: search } }, { pageSize: MENTIONS_MAX_RESULTS })
59
- .then((assistants) => assistants.map((assistant) => ({
60
- kind: "assistant",
61
- id: assistant.assistantId,
62
- name: assistant.name,
63
- })));
64
- },
65
- getById: (id) => (0, peers_sdk_1.Assistants)()
66
- .get(id)
67
- .then((item) => item && {
68
- kind: "assistant",
69
- id: item.assistantId,
70
- name: item.name,
71
- }),
72
- };
73
- /** Discover workflows and resolve persisted workflow mentions. */
74
- exports.workflowMentionConfig = {
75
- kind: "workflow",
76
- iconClass: "bi bi-database-fill-gear",
77
- styleClass: "mention-workflow",
78
- query: async (search) => {
79
- return (0, peers_sdk_1.Workflows)()
80
- .list({ name: { $matchWords: search } }, { pageSize: MENTIONS_MAX_RESULTS })
81
- .then((workflows) => workflows.map((workflow) => ({
82
- kind: "workflow",
83
- id: workflow.workflowId,
84
- name: workflow.name,
85
- })));
86
- },
87
- getById: (id) => (0, peers_sdk_1.Workflows)()
88
- .get(id)
89
- .then((item) => item && {
90
- kind: "workflow",
91
- id: item.workflowId,
92
- name: item.name,
93
- }),
94
- };
95
51
  /** Discover data types and navigate to their definitions. */
96
52
  exports.valueTypeMentionConfig = {
97
53
  kind: "type",
@@ -123,10 +79,4 @@ exports.valueTypeMentionConfig = {
123
79
  // }))),
124
80
  // picture = <i className="bi bi-list-task pe-1" />;
125
81
  /** Shared mention definitions used by editors and rendered messages. */
126
- exports.mentionConfigs = [
127
- exports.toolMentionConfig,
128
- exports.userMentionConfig,
129
- exports.assistantMentionConfig,
130
- exports.workflowMentionConfig,
131
- exports.valueTypeMentionConfig,
132
- ];
82
+ exports.mentionConfigs = [exports.toolMentionConfig, exports.userMentionConfig, exports.valueTypeMentionConfig];
@@ -0,0 +1,2 @@
1
+ /** Group names by id, with "Personal" for the user's own context. */
2
+ export declare function useGroupNames(): Map<string, string>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useGroupNames = useGroupNames;
4
+ const peers_sdk_1 = require("@peers-app/peers-sdk");
5
+ const react_1 = require("react");
6
+ /** Group names by id, with "Personal" for the user's own context. */
7
+ function useGroupNames() {
8
+ const [names, setNames] = (0, react_1.useState)(new Map());
9
+ (0, react_1.useEffect)(() => {
10
+ let cancelled = false;
11
+ void (0, peers_sdk_1.getUserContext)().then(async (userContext) => {
12
+ const groups = await (0, peers_sdk_1.Groups)(userContext.userDataContext).list({});
13
+ const next = new Map(groups.map((group) => [group.groupId, group.name]));
14
+ next.set(userContext.userId, "Personal");
15
+ if (!cancelled)
16
+ setNames(next);
17
+ });
18
+ return () => {
19
+ cancelled = true;
20
+ };
21
+ }, []);
22
+ return names;
23
+ }
@@ -1,6 +1,8 @@
1
- /** Group names by id, with "Personal" for the user's own context. */
2
- export declare function useGroupNames(): Map<string, string>;
3
- /** Bell with the notification badge, and a popover of active notifications. */
1
+ export { useGroupNames } from "./group-names";
2
+ /**
3
+ * Bell with the notification badge, and a popover of active notifications. On a narrow screen
4
+ * the popover is a sheet across the screen instead, so it can't run off the edge.
5
+ */
4
6
  export declare function NotificationBell({ compact }: {
5
7
  compact?: boolean;
6
8
  }): import("react/jsx-runtime").JSX.Element;