@tutti-os/agent-gui 0.0.124 → 0.0.126

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 (59) hide show
  1. package/dist/{AgentGUI-D-Ktaq3h.d.ts → AgentGUI-CKk3WQrn.d.ts} +3 -1
  2. package/dist/{AgentRichTextReadonly-ZWKC3FJE.js → AgentRichTextReadonly-KOUZGF5Q.js} +5 -5
  3. package/dist/agent-conversation/index.js +7 -7
  4. package/dist/agent-gui.d.ts +3 -2
  5. package/dist/agent-gui.js +15 -15
  6. package/dist/agent-message-center/index.js +6 -6
  7. package/dist/{agentFileMentionContracts-DY4Z70CN.d.ts → agentFileMentionContracts-CWAeuL7S.d.ts} +1 -1
  8. package/dist/{chunk-OKGXHKJ2.js → chunk-2JFMGOHU.js} +2 -2
  9. package/dist/{chunk-KACVD2GZ.js → chunk-2ZVXN2Z7.js} +5 -5
  10. package/dist/chunk-2ZVXN2Z7.js.map +1 -0
  11. package/dist/{chunk-XXACYFIR.js → chunk-4CACBXIB.js} +2 -2
  12. package/dist/{chunk-ZCNZ53CF.js → chunk-6RMVLH3G.js} +2 -2
  13. package/dist/{chunk-WEHEJ25P.js → chunk-ADQENNSG.js} +53 -61
  14. package/dist/chunk-ADQENNSG.js.map +1 -0
  15. package/dist/{chunk-C3IGPKCP.js → chunk-BDWZUA3L.js} +10 -9
  16. package/dist/chunk-BDWZUA3L.js.map +1 -0
  17. package/dist/{chunk-3XS6P7BA.js → chunk-CO6XO5A2.js} +5 -5
  18. package/dist/{chunk-6NUOJ6PS.js → chunk-F2Z7P7BB.js} +4 -4
  19. package/dist/{chunk-DXIL75XS.js → chunk-G3XB4FAQ.js} +3 -3
  20. package/dist/{chunk-2EH3KOJV.js → chunk-PRE4IT6E.js} +170 -18
  21. package/dist/chunk-PRE4IT6E.js.map +1 -0
  22. package/dist/{chunk-NWPGWLWP.js → chunk-QDNOOAAS.js} +21 -57
  23. package/dist/chunk-QDNOOAAS.js.map +1 -0
  24. package/dist/{chunk-PPOCDOYZ.js → chunk-QWKJ646Z.js} +176 -145
  25. package/dist/chunk-QWKJ646Z.js.map +1 -0
  26. package/dist/{chunk-RQDDJHEO.js → chunk-RB6ZYQBA.js} +2 -2
  27. package/dist/{chunk-JM24HADP.js → chunk-RMQREVJY.js} +1 -1
  28. package/dist/chunk-RMQREVJY.js.map +1 -0
  29. package/dist/{chunk-RN7DI3Y2.js → chunk-X22KJXVG.js} +2 -2
  30. package/dist/context-mention-palette/index.d.ts +1 -1
  31. package/dist/context-mention-palette/index.js +8 -8
  32. package/dist/context-mention-provider.d.ts +15 -2
  33. package/dist/context-mention-provider.js +1 -1
  34. package/dist/i18n/index.d.ts +4 -4
  35. package/dist/i18n/index.js +2 -2
  36. package/dist/index.d.ts +4 -3
  37. package/dist/index.js +15 -15
  38. package/dist/mention-search.d.ts +8 -3
  39. package/dist/mention-search.js +6 -6
  40. package/dist/workbench/contribution.js +3 -3
  41. package/dist/workbench/index.js +3 -3
  42. package/dist/workbench/sessionTitle.js +2 -2
  43. package/package.json +14 -14
  44. package/dist/chunk-2EH3KOJV.js.map +0 -1
  45. package/dist/chunk-C3IGPKCP.js.map +0 -1
  46. package/dist/chunk-JM24HADP.js.map +0 -1
  47. package/dist/chunk-KACVD2GZ.js.map +0 -1
  48. package/dist/chunk-NWPGWLWP.js.map +0 -1
  49. package/dist/chunk-PPOCDOYZ.js.map +0 -1
  50. package/dist/chunk-WEHEJ25P.js.map +0 -1
  51. /package/dist/{AgentRichTextReadonly-ZWKC3FJE.js.map → AgentRichTextReadonly-KOUZGF5Q.js.map} +0 -0
  52. /package/dist/{chunk-OKGXHKJ2.js.map → chunk-2JFMGOHU.js.map} +0 -0
  53. /package/dist/{chunk-XXACYFIR.js.map → chunk-4CACBXIB.js.map} +0 -0
  54. /package/dist/{chunk-ZCNZ53CF.js.map → chunk-6RMVLH3G.js.map} +0 -0
  55. /package/dist/{chunk-3XS6P7BA.js.map → chunk-CO6XO5A2.js.map} +0 -0
  56. /package/dist/{chunk-6NUOJ6PS.js.map → chunk-F2Z7P7BB.js.map} +0 -0
  57. /package/dist/{chunk-DXIL75XS.js.map → chunk-G3XB4FAQ.js.map} +0 -0
  58. /package/dist/{chunk-RQDDJHEO.js.map → chunk-RB6ZYQBA.js.map} +0 -0
  59. /package/dist/{chunk-RN7DI3Y2.js.map → chunk-X22KJXVG.js.map} +0 -0
@@ -6,7 +6,7 @@ import {
6
6
  setCurrentAgentGuiI18nRuntime,
7
7
  translate,
8
8
  translateInUiLanguage
9
- } from "./chunk-KACVD2GZ.js";
9
+ } from "./chunk-2ZVXN2Z7.js";
10
10
 
11
11
  // i18n/index.ts
12
12
  import React, {
@@ -68,4 +68,4 @@ export {
68
68
  AgentGuiI18nProvider,
69
69
  useTranslation
70
70
  };
71
- //# sourceMappingURL=chunk-ZCNZ53CF.js.map
71
+ //# sourceMappingURL=chunk-6RMVLH3G.js.map
@@ -6,14 +6,14 @@ import {
6
6
  import {
7
7
  getOptionalAgentHostApi,
8
8
  useOptionalAgentHostApi
9
- } from "./chunk-OKGXHKJ2.js";
9
+ } from "./chunk-2JFMGOHU.js";
10
10
  import {
11
11
  managedAgentRoundedIconUrl
12
12
  } from "./chunk-EDNJMG5T.js";
13
13
  import {
14
14
  translate,
15
15
  useTranslation
16
- } from "./chunk-ZCNZ53CF.js";
16
+ } from "./chunk-6RMVLH3G.js";
17
17
  import {
18
18
  resolveAgentWorkspaceFileVisualKind
19
19
  } from "./chunk-PJP5BUU6.js";
@@ -265,7 +265,6 @@ import {
265
265
  useMemo,
266
266
  useState as useState6
267
267
  } from "react";
268
- import { FileText } from "lucide-react";
269
268
  import ReactMarkdown from "react-markdown";
270
269
  import rehypeSanitize, {
271
270
  defaultSchema
@@ -275,13 +274,8 @@ import {
275
274
  resolveWorkspaceFileExtension,
276
275
  workspaceFileName as basenameWorkspacePath2
277
276
  } from "@tutti-os/workspace-file-manager/services";
278
- import {
279
- Tooltip,
280
- TooltipContent,
281
- TooltipProvider,
282
- TooltipTrigger,
283
- useTextOverflow
284
- } from "@tutti-os/ui-system/components";
277
+ import { MentionPill } from "@tutti-os/ui-system/components";
278
+ import { useResolvedRichTextMention } from "@tutti-os/ui-rich-text/editor";
285
279
 
286
280
  // shared/utils/websiteUrl.ts
287
281
  var ALLOWED_WEBSITE_PROTOCOLS = /* @__PURE__ */ new Set(["http:", "https:"]);
@@ -1363,13 +1357,19 @@ function parseMentionLink(href, rawLabel, workspaceAppIcons = [], agentTargets =
1363
1357
  return null;
1364
1358
  }
1365
1359
  const label = rawLabel.trim().replace(/^@+/, "").trim() || (kind === "workspace-app-factory" ? appFactoryFallbackLabel : "");
1360
+ const identity = {
1361
+ entityId,
1362
+ providerId: mention.providerId,
1363
+ ...mention.scope ? { scope: mention.scope } : {}
1364
+ };
1366
1365
  if (kind === "pasted-text") {
1367
- return { kind, label };
1366
+ return { ...identity, kind, label };
1368
1367
  }
1369
1368
  if (kind === "workspace-app" || kind === "workspace-app-factory") {
1370
1369
  const appId = kind === "workspace-app" ? entityId : "";
1371
1370
  const workspaceId = mention.scope?.workspaceId?.trim() || "";
1372
1371
  return {
1372
+ ...identity,
1373
1373
  kind,
1374
1374
  ...kind === "workspace-app" ? { appId } : {},
1375
1375
  label,
@@ -1392,6 +1392,7 @@ function parseMentionLink(href, rawLabel, workspaceAppIcons = [], agentTargets =
1392
1392
  const agentProviderId = target?.provider?.trim() || void 0;
1393
1393
  const targetLabel = target?.name?.trim() || label;
1394
1394
  return {
1395
+ ...identity,
1395
1396
  agentProviderId,
1396
1397
  kind,
1397
1398
  label: targetLabel,
@@ -1408,6 +1409,7 @@ function parseMentionLink(href, rawLabel, workspaceAppIcons = [], agentTargets =
1408
1409
  });
1409
1410
  const localProvider = agentTargetId.startsWith("local:") ? agentTargetId.slice("local:".length).trim() : "";
1410
1411
  return {
1412
+ ...identity,
1411
1413
  kind,
1412
1414
  label,
1413
1415
  iconUrl: target?.iconUrl?.trim() || (localProvider ? managedAgentRoundedIconUrl(localProvider) : void 0)
@@ -1422,6 +1424,7 @@ function parseMentionLink(href, rawLabel, workspaceAppIcons = [], agentTargets =
1422
1424
  workspaceId
1423
1425
  }) : void 0;
1424
1426
  return {
1427
+ ...identity,
1425
1428
  kind,
1426
1429
  label,
1427
1430
  iconUrl: mention.scope?.icon?.trim() || appIconUrl,
@@ -1431,11 +1434,13 @@ function parseMentionLink(href, rawLabel, workspaceAppIcons = [], agentTargets =
1431
1434
  }
1432
1435
  if (kind === "workspace-issue") {
1433
1436
  return {
1437
+ ...identity,
1434
1438
  kind,
1435
1439
  label
1436
1440
  };
1437
1441
  }
1438
1442
  return {
1443
+ ...identity,
1439
1444
  kind,
1440
1445
  label
1441
1446
  };
@@ -3193,9 +3198,19 @@ function MentionLink({
3193
3198
  ...props
3194
3199
  }) {
3195
3200
  "use memo";
3196
- const tooltipText = mention.label;
3197
- const { ref: mainRef, overflowing } = useTextOverflow(tooltipText);
3198
- const link = /* @__PURE__ */ jsxs4(
3201
+ const snapshot = useResolvedRichTextMention({
3202
+ providerId: mention.providerId,
3203
+ entityId: mention.entityId,
3204
+ label: mention.label,
3205
+ scope: mention.scope
3206
+ });
3207
+ const resolved = snapshot.state === "ready" ? snapshot.resolved : void 0;
3208
+ const label = resolved?.label?.trim() || mention.label;
3209
+ const presentation = resolved?.presentation;
3210
+ const iconUrl = presentation?.iconUrl?.trim() || presentation?.thumbnailUrl?.trim() || presentation?.agentIconUrl?.trim() || mention.iconUrl;
3211
+ const pillKind = mention.kind === "workspace-issue" || mention.referenceSource === "task" ? "issue" : mention.kind === "session" || mention.kind === "agent-target" ? "session" : mention.kind === "pasted-text" ? "file" : "app";
3212
+ const usesSessionIcon = mention.kind === "session";
3213
+ return /* @__PURE__ */ jsx5(
3199
3214
  "a",
3200
3215
  {
3201
3216
  ...props,
@@ -3205,11 +3220,11 @@ function MentionLink({
3205
3220
  ),
3206
3221
  "data-agent-file-mention": "true",
3207
3222
  "data-agent-link-href": href,
3208
- "data-agent-mention-icon-url": mention.iconUrl,
3223
+ "data-agent-mention-icon-url": iconUrl,
3209
3224
  "data-agent-mention-href": href,
3210
3225
  "data-agent-mention-kind": mention.kind,
3211
3226
  "data-agent-reference-source": mention.referenceSource,
3212
- "aria-label": mention.label,
3227
+ "aria-label": label,
3213
3228
  role: "link",
3214
3229
  tabIndex: 0,
3215
3230
  onClick: (event) => {
@@ -3221,52 +3236,29 @@ function MentionLink({
3221
3236
  onKeyDown: (event) => {
3222
3237
  activateMarkdownLinkFromKey(event, href, onLinkClick);
3223
3238
  },
3224
- children: [
3225
- mention.kind === "pasted-text" ? /* @__PURE__ */ jsx5(
3226
- "span",
3227
- {
3228
- className: "grid h-4 w-4 shrink-0 place-items-center text-[var(--text-tertiary)]",
3229
- "aria-hidden": "true",
3230
- children: /* @__PURE__ */ jsx5(FileText, { size: 14, strokeWidth: 2 })
3231
- }
3232
- ) : mention.kind === "workspace-app" || mention.kind === "workspace-reference" || mention.kind === "agent-target" || mention.kind === "session" && mention.iconUrl ? /* @__PURE__ */ jsx5(
3233
- "span",
3234
- {
3235
- className: "grid h-4 w-4 shrink-0 place-items-center overflow-hidden rounded-[4px] bg-block",
3236
- "aria-hidden": "true",
3237
- "data-agent-mention-app-icon": mention.kind === "session" ? void 0 : "true",
3238
- "data-agent-mention-session-icon": mention.kind === "session" ? "true" : void 0,
3239
- "data-workspace-app-icon": mention.kind === "session" ? void 0 : "true",
3240
- children: mention.iconUrl ? /* @__PURE__ */ jsx5(
3241
- "img",
3242
- {
3243
- src: mention.iconUrl,
3244
- alt: "",
3245
- className: "h-full w-full object-cover",
3246
- decoding: "async",
3247
- loading: "lazy",
3248
- draggable: false
3249
- }
3250
- ) : /* @__PURE__ */ jsx5("span", { className: "tsh-agent-object-token__kind-icon h-4 w-4" })
3251
- }
3252
- ) : /* @__PURE__ */ jsx5("span", { className: "tsh-agent-object-token__kind", "aria-hidden": "true", children: /* @__PURE__ */ jsx5(
3253
- "span",
3254
- {
3255
- className: "tsh-agent-object-token__kind-icon",
3256
- "aria-hidden": "true"
3257
- }
3258
- ) }),
3259
- /* @__PURE__ */ jsx5("span", { className: "tsh-agent-object-token__main", ref: mainRef, children: mention.label })
3260
- ]
3239
+ children: /* @__PURE__ */ jsx5(
3240
+ MentionPill,
3241
+ {
3242
+ className: "top-0 max-w-full",
3243
+ iconUrl,
3244
+ iconContainerProps: {
3245
+ className: "h-4 w-4",
3246
+ "data-agent-mention-app-icon": usesSessionIcon ? void 0 : "true",
3247
+ "data-agent-mention-session-icon": usesSessionIcon ? "true" : void 0,
3248
+ "data-workspace-app-icon": usesSessionIcon ? void 0 : "true"
3249
+ },
3250
+ fallbackIconProps: {
3251
+ "data-agent-mention-fallback-icon": "true"
3252
+ },
3253
+ kind: pillKind,
3254
+ label: /* @__PURE__ */ jsx5("span", { className: "tsh-agent-object-token__main", children: label }),
3255
+ removable: false,
3256
+ tooltipEnabled: !previewMode,
3257
+ withTooltipProvider: !previewMode
3258
+ }
3259
+ )
3261
3260
  }
3262
3261
  );
3263
- if (previewMode) {
3264
- return link;
3265
- }
3266
- return /* @__PURE__ */ jsx5(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs4(Tooltip, { children: [
3267
- /* @__PURE__ */ jsx5(TooltipTrigger, { asChild: true, children: link }),
3268
- overflowing ? /* @__PURE__ */ jsx5(TooltipContent, { className: "max-w-[min(420px,calc(100vw-32px))] whitespace-normal text-left [overflow-wrap:anywhere]", children: tooltipText }) : null
3269
- ] }) });
3270
3262
  }
3271
3263
 
3272
3264
  // app/renderer/components/ui/custom-scroll-area.tsx
@@ -3737,4 +3729,4 @@ export {
3737
3729
  AgentMessageMarkdown,
3738
3730
  CustomScrollArea
3739
3731
  };
3740
- //# sourceMappingURL=chunk-WEHEJ25P.js.map
3732
+ //# sourceMappingURL=chunk-ADQENNSG.js.map