@tutti-os/agent-gui 0.0.74 → 0.0.75

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/README.md +17 -0
  2. package/dist/agent-conversation/index.d.ts +4 -4
  3. package/dist/agent-conversation/index.js +8 -8
  4. package/dist/agent-message-center/index.d.ts +2 -2
  5. package/dist/agent-message-center/index.js +170 -12
  6. package/dist/agent-message-center/index.js.map +1 -1
  7. package/dist/{agentConversationVM-DPAgUJlR.d.ts → agentConversationVM-BgoqFyE9.d.ts} +1 -1
  8. package/dist/{agentGuiNodeTypes-C0WUHQzu.d.ts → agentGuiNodeTypes-CmuJ7VDZ.d.ts} +15 -5
  9. package/dist/app/renderer/agentactivity.css +52 -24
  10. package/dist/app/renderer/assets/icons/agents/cursor-colorful.png +0 -0
  11. package/dist/app/renderer/assets/icons/agents/opencode-rounded.png +0 -0
  12. package/dist/app/renderer/assets/icons/agents/provider-rail-opencode-colorful.png +0 -0
  13. package/dist/{chunk-GLMDAZSQ.js → chunk-3FYA2K4P.js} +76 -7
  14. package/dist/chunk-3FYA2K4P.js.map +1 -0
  15. package/dist/{chunk-RA3OUR64.js → chunk-4HP6V2YA.js} +16 -2
  16. package/dist/chunk-4HP6V2YA.js.map +1 -0
  17. package/dist/{chunk-W5AJTBA7.js → chunk-4TNM6ZEC.js} +3 -100
  18. package/dist/chunk-4TNM6ZEC.js.map +1 -0
  19. package/dist/{chunk-6EREXANR.js → chunk-52GTPN7X.js} +3 -14
  20. package/dist/chunk-52GTPN7X.js.map +1 -0
  21. package/dist/{chunk-ZSYDFQ4N.js → chunk-7GSBP5CN.js} +36 -15
  22. package/dist/chunk-7GSBP5CN.js.map +1 -0
  23. package/dist/{chunk-T5CEU7WH.js → chunk-BEM3KDOJ.js} +3 -3
  24. package/dist/chunk-BEM3KDOJ.js.map +1 -0
  25. package/dist/{chunk-VERGPY42.js → chunk-GZX2SGAG.js} +2 -2
  26. package/dist/{chunk-NO7WDGST.js → chunk-KELYWKTC.js} +28 -6
  27. package/dist/chunk-KELYWKTC.js.map +1 -0
  28. package/dist/{chunk-FPODKSSV.js → chunk-L2ZMLLYL.js} +12 -5
  29. package/dist/chunk-L2ZMLLYL.js.map +1 -0
  30. package/dist/{chunk-LWFV4PS5.js → chunk-M6FZ2YIR.js} +3 -3
  31. package/dist/chunk-M6FZ2YIR.js.map +1 -0
  32. package/dist/{chunk-D2Z2QZVE.js → chunk-MNESUMOS.js} +2 -2
  33. package/dist/{chunk-KVS7J7BJ.js → chunk-QDKD6RNC.js} +15 -6
  34. package/dist/{chunk-KVS7J7BJ.js.map → chunk-QDKD6RNC.js.map} +1 -1
  35. package/dist/{chunk-FHWE5SUF.js → chunk-RIRFNGPB.js} +7 -3
  36. package/dist/chunk-RIRFNGPB.js.map +1 -0
  37. package/dist/{chunk-SL2QSEIE.js → chunk-SYWMKIRW.js} +4 -4
  38. package/dist/{chunk-RF7GK4SM.js → chunk-U6AZ3XQS.js} +25 -6
  39. package/dist/chunk-U6AZ3XQS.js.map +1 -0
  40. package/dist/{chunk-Z72JKSAY.js → chunk-U6EDUTUO.js} +4 -4
  41. package/dist/{chunk-MYD37I32.js → chunk-VAKFNNKT.js} +1 -15
  42. package/dist/chunk-VAKFNNKT.js.map +1 -0
  43. package/dist/{chunk-BTUOROCD.js → chunk-XW4CVBUH.js} +2 -2
  44. package/dist/chunk-XW4CVBUH.js.map +1 -0
  45. package/dist/{chunk-4XIHKCWC.js → chunk-YWQHNFYA.js} +2 -2
  46. package/dist/context-mention-palette/index.js +9 -9
  47. package/dist/i18n/index.d.ts +2 -96
  48. package/dist/i18n/index.js +2 -2
  49. package/dist/index.d.ts +49 -7
  50. package/dist/index.js +1008 -598
  51. package/dist/index.js.map +1 -1
  52. package/dist/plan-decision-ops.d.ts +2 -2
  53. package/dist/queued-prompt-runtime.d.ts +3 -5
  54. package/dist/queued-prompt-runtime.js +1 -1
  55. package/dist/workbench/contribution.js +5 -5
  56. package/dist/workbench/index.js +8 -8
  57. package/dist/workbench/launch.d.ts +1 -1
  58. package/dist/workbench/launch.js +2 -2
  59. package/dist/workbench/providerCatalog.js +1 -1
  60. package/dist/workbench/sessionTitle.js +3 -3
  61. package/dist/workbench/state.js +2 -2
  62. package/dist/workspace-agent-generated-files.d.ts +1 -1
  63. package/dist/workspace-agent-generated-files.js +4 -4
  64. package/dist/{workspaceAgentActivityListViewModel-DJvAqZso.d.ts → workspaceAgentActivityListViewModel-TXH1VXrk.d.ts} +0 -10
  65. package/package.json +12 -12
  66. package/dist/chunk-6EREXANR.js.map +0 -1
  67. package/dist/chunk-BTUOROCD.js.map +0 -1
  68. package/dist/chunk-FHWE5SUF.js.map +0 -1
  69. package/dist/chunk-FPODKSSV.js.map +0 -1
  70. package/dist/chunk-GLMDAZSQ.js.map +0 -1
  71. package/dist/chunk-LWFV4PS5.js.map +0 -1
  72. package/dist/chunk-MYD37I32.js.map +0 -1
  73. package/dist/chunk-NO7WDGST.js.map +0 -1
  74. package/dist/chunk-RA3OUR64.js.map +0 -1
  75. package/dist/chunk-RF7GK4SM.js.map +0 -1
  76. package/dist/chunk-T5CEU7WH.js.map +0 -1
  77. package/dist/chunk-W5AJTBA7.js.map +0 -1
  78. package/dist/chunk-ZSYDFQ4N.js.map +0 -1
  79. /package/dist/{chunk-VERGPY42.js.map → chunk-GZX2SGAG.js.map} +0 -0
  80. /package/dist/{chunk-D2Z2QZVE.js.map → chunk-MNESUMOS.js.map} +0 -0
  81. /package/dist/{chunk-SL2QSEIE.js.map → chunk-SYWMKIRW.js.map} +0 -0
  82. /package/dist/{chunk-Z72JKSAY.js.map → chunk-U6EDUTUO.js.map} +0 -0
  83. /package/dist/{chunk-4XIHKCWC.js.map → chunk-YWQHNFYA.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { W as WorkspaceAgentActivityCard, n as WorkspaceAgentActivitySession, T as ToolCallStatusKind, q as WorkspaceAgentActivityTimelineItem } from './workspaceAgentActivityListViewModel-DJvAqZso.js';
1
+ import { W as WorkspaceAgentActivityCard, n as WorkspaceAgentActivitySession, T as ToolCallStatusKind, q as WorkspaceAgentActivityTimelineItem } from './workspaceAgentActivityListViewModel-TXH1VXrk.js';
2
2
 
3
3
  interface WorkspaceAgentSessionDetailMessage {
4
4
  id: string;
@@ -1,7 +1,7 @@
1
1
  import { AgentActivityUsage } from '@tutti-os/agent-activity-core';
2
2
  import { k as AgentHostAgentSessionCommand, l as AgentHostAgentSessionComposerSettings, n as AgentHostAgentSessionReasoningEffort, o as AgentHostAgentSessionSpeed, m as AgentHostAgentSessionPermissionConfig, p as AgentHostAgentSessionState, a as AgentGUIProvider, s as AgentPromptContentBlock, A as AgentGUINodeData, g as AgentGUIProviderTarget, c as AgentGUIProviderRailMode, d as AgentGUIProviderReadinessGate } from './types-DUHHejs2.js';
3
- import { A as AgentHostBatchUserInfoInput, a as AgentHostBatchUserInfoResult, b as AgentHostDeleteWorkspaceAgentSessionInput, k as AgentHostWorkspaceAgentSessionSummaryInput, j as AgentHostWorkspaceAgentSessionSummary, e as AgentHostWorkspaceAgentListInput, l as AgentHostWorkspaceAgentSnapshot, i as AgentHostWorkspaceAgentSessionMessagesInput, h as AgentHostWorkspaceAgentSessionMessages, p as WorkspaceAgentActivitySyncState } from './workspaceAgentActivityListViewModel-DJvAqZso.js';
4
- import { A as AgentApprovalItemVM, a as AgentAskUserQuestionVM, b as AgentConversationPromptVM, c as AgentConversationVM, W as WorkspaceAgentSessionDetailViewModel } from './agentConversationVM-DPAgUJlR.js';
3
+ import { A as AgentHostBatchUserInfoInput, a as AgentHostBatchUserInfoResult, b as AgentHostDeleteWorkspaceAgentSessionInput, k as AgentHostWorkspaceAgentSessionSummaryInput, j as AgentHostWorkspaceAgentSessionSummary, e as AgentHostWorkspaceAgentListInput, l as AgentHostWorkspaceAgentSnapshot, i as AgentHostWorkspaceAgentSessionMessagesInput, h as AgentHostWorkspaceAgentSessionMessages, p as WorkspaceAgentActivitySyncState } from './workspaceAgentActivityListViewModel-TXH1VXrk.js';
4
+ import { A as AgentApprovalItemVM, a as AgentAskUserQuestionVM, b as AgentConversationPromptVM, c as AgentConversationVM, W as WorkspaceAgentSessionDetailViewModel } from './agentConversationVM-BgoqFyE9.js';
5
5
  import { WorkspaceUserProjectService } from '@tutti-os/workspace-user-project/contracts';
6
6
 
7
7
  declare const APP_ERROR_CODES: readonly ["common.invalid_input", "common.approved_path_required", "common.unavailable", "common.unexpected", "session.not_found", "control_surface.unauthorized", "workspace.select_directory_failed", "workspace.select_files_failed", "workspace.ensure_directory_failed", "workspace.import_files_failed", "workspace.read_file_failed", "workspace.write_file_failed", "workspace.export_file_failed", "workspace.copy_path_failed", "workspace.host_unsupported", "workspace.runtime_artifact_unavailable", "runtime.guest_agent_lane_unavailable", "workspace.room_full", "workspace.room_delete_forbidden", "workspace.room_delete_not_found", "filesystem.create_directory_failed", "filesystem.read_file_bytes_failed", "filesystem.read_file_text_failed", "filesystem.write_file_text_failed", "filesystem.copy_entry_failed", "filesystem.move_entry_failed", "filesystem.rename_entry_failed", "filesystem.delete_entry_failed", "filesystem.read_directory_failed", "filesystem.stat_failed", "terminal.spawn_failed", "terminal.write_failed", "terminal.resize_failed", "terminal.close_failed", "terminal.attach_failed", "terminal.detach_failed", "terminal.snapshot_failed", "agent.list_models_failed", "agent.launch_failed", "agent.read_last_message_failed", "agent.provider_session_not_found", "agent.resume_session_not_local", "agent.resume_session_resolve_failed", "agent.settings_require_new_session", "task.suggest_title_failed", "persistence.unavailable", "persistence.quota_exceeded", "persistence.payload_too_large", "persistence.io_failed", "persistence.invalid_state", "persistence.invalid_node_id", "update.get_state_failed", "update.configure_failed", "update.check_failed", "update.download_failed", "update.install_failed", "PACKAGE_DOWNLOAD_INTERRUPTED", "PACKAGE_DOWNLOAD_HTTP_STATUS", "PACKAGE_DOWNLOAD_INVALID", "PACKAGE_DOWNLOAD_DISK_ERROR"];
@@ -276,6 +276,7 @@ interface AgentHostUserProject {
276
276
  id: string;
277
277
  path: string;
278
278
  label: string;
279
+ sectionKey?: string;
279
280
  createdAtUnixMs?: number;
280
281
  updatedAtUnixMs?: number;
281
282
  lastUsedAtUnixMs?: number;
@@ -410,11 +411,12 @@ interface AgentGUIConversationProjectSummary {
410
411
  id: string;
411
412
  path: string;
412
413
  label: string;
414
+ sectionKey?: string;
413
415
  createdAtUnixMs?: number;
414
416
  updatedAtUnixMs?: number;
415
417
  lastUsedAtUnixMs?: number;
416
418
  }
417
- type AgentGUIConversationUserProject = Pick<AgentHostUserProject, "id" | "path" | "label" | "createdAtUnixMs" | "updatedAtUnixMs" | "lastUsedAtUnixMs">;
419
+ type AgentGUIConversationUserProject = Pick<AgentHostUserProject, "id" | "path" | "label" | "sectionKey" | "createdAtUnixMs" | "updatedAtUnixMs" | "lastUsedAtUnixMs">;
418
420
 
419
421
  interface AgentGUIConversationSummary {
420
422
  id: string;
@@ -476,10 +478,13 @@ interface AgentGUIInlineNotice {
476
478
  autoDismissMs: number | null;
477
479
  }
478
480
  interface AgentGUIProjectConversationDeleteTarget {
479
- conversationCount: number;
481
+ conversationCount: number | null;
480
482
  label: string;
481
483
  path: string;
482
484
  }
485
+ interface AgentGUIConversationSectionDeleteTarget {
486
+ conversationCount: number | null;
487
+ }
483
488
  interface AgentGUIComposerSettingOption {
484
489
  value: string;
485
490
  label: string;
@@ -624,6 +629,10 @@ interface AgentGUINodeViewModel {
624
629
  isInterrupting: boolean;
625
630
  isCancelPending: boolean;
626
631
  isRespondingApproval: boolean;
632
+ canCancel: boolean;
633
+ canSubmitInteractive: boolean;
634
+ canGoalControl: boolean;
635
+ canUploadAttachment: boolean;
627
636
  promptImagesSupported: boolean;
628
637
  compactSupported: boolean | null;
629
638
  /**
@@ -639,6 +648,7 @@ interface AgentGUINodeViewModel {
639
648
  isDeletingProjectConversations: boolean;
640
649
  pendingDeleteConversation: AgentGUIConversationSummary | null;
641
650
  pendingDeleteProjectConversations: AgentGUIProjectConversationDeleteTarget | null;
651
+ pendingDeleteConversations: AgentGUIConversationSectionDeleteTarget | null;
642
652
  pendingApproval: AgentGUIApprovalRequest | null;
643
653
  pendingInteractivePrompt: AgentGUIInteractivePrompt | null;
644
654
  activeLiveState: "inactive" | "activating" | "active" | "failed";
@@ -647,7 +657,7 @@ interface AgentGUINodeViewModel {
647
657
  activeConversationBusy: boolean;
648
658
  canSubmit: boolean;
649
659
  composerSettings: AgentGUIComposerSettingsVM;
650
- queuedPrompts: AgentGUIQueuedPromptVM[];
660
+ queuedPrompts: readonly AgentGUIQueuedPromptVM[];
651
661
  drainingQueuedPromptId: string | null;
652
662
  canQueueWhileBusy: boolean;
653
663
  hasSentUserMessage: boolean;
@@ -6315,12 +6315,8 @@ button.agent-gui-node__conversation-section-toggle:hover
6315
6315
  left: 50%;
6316
6316
  width: 1px;
6317
6317
  height: 8px;
6318
- transform: translateX(-50%);
6319
- background: color-mix(
6320
- in srgb,
6321
- var(--line-2, var(--tutti-line-2)) 82%,
6322
- transparent
6323
- );
6318
+ transform: translate(-50%, -50%);
6319
+ background: var(--line-1, var(--nexight-line-1));
6324
6320
  }
6325
6321
 
6326
6322
  .agent-gui-message-locator__tick {
@@ -8905,33 +8901,56 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8905
8901
  }
8906
8902
 
8907
8903
  .agent-gui-node__empty-hero-launchpad-icon {
8908
- width: 54px;
8909
- height: 54px;
8910
- border-color: var(--tutti-purple);
8911
- border-radius: 8px;
8912
- background: var(--transparency-block);
8904
+ /* Size to the strip's actual content and stay centered. A fixed width narrower
8905
+ than the icons left-anchors the overflow, dragging the "centered" selected
8906
+ agent off to one side. */
8907
+ width: fit-content;
8908
+ max-width: 100%;
8909
+ height: 48px;
8910
+ border: 0;
8911
+ border-radius: 0;
8912
+ background: transparent;
8913
+ box-shadow: none;
8914
+ overflow: visible;
8913
8915
  color: var(--tutti-purple);
8914
8916
  animation: agent-gui-empty-hero-enter 260ms cubic-bezier(0.16, 1, 0.3, 1) 40ms
8915
8917
  both;
8916
8918
  }
8917
8919
 
8920
+ /* Hero launchpad: agents laid out as one centered horizontal group while
8921
+ neighbours fade away from the selected agent. Scoped to the hero so the left
8922
+ rail "All" tile (a single composed image) is unaffected. */
8918
8923
  .agent-gui-node__empty-hero-launchpad-icon
8919
8924
  .agent-gui-node__provider-rail-launchpad-icon {
8920
- width: 48px;
8925
+ display: flex;
8926
+ width: max-content;
8927
+ max-width: 100%;
8921
8928
  height: 48px;
8922
- gap: 3px;
8923
- padding: 1px;
8924
- border-radius: 8px;
8929
+ align-items: center;
8930
+ justify-content: center;
8931
+ gap: 10px;
8932
+ padding: 0;
8933
+ border-radius: 0;
8934
+ background: transparent;
8935
+ overflow: visible;
8925
8936
  }
8926
8937
 
8927
8938
  .agent-gui-node__empty-hero-launchpad-icon
8928
8939
  .agent-gui-node__provider-rail-launchpad-item {
8929
- border-radius: 6px;
8940
+ flex: 0 0 auto;
8941
+ width: 36px;
8942
+ height: 36px;
8943
+ border-radius: 9px;
8944
+ transition:
8945
+ opacity 220ms ease,
8946
+ transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
8947
+ box-shadow 220ms ease;
8930
8948
  }
8931
8949
 
8932
8950
  .agent-gui-node__empty-hero-launchpad-icon
8933
- .agent-gui-node__provider-rail-launchpad-item[data-provider-active="false"] {
8934
- opacity: 0.5;
8951
+ .agent-gui-node__provider-rail-launchpad-item[data-provider-active="true"] {
8952
+ transform: scale(1.14);
8953
+ box-shadow: 0 0 0 1.5px var(--tutti-purple);
8935
8954
  }
8936
8955
 
8937
8956
  .agent-gui-node__provider-rail-tile[data-loading="true"]
@@ -8981,6 +9000,14 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
8981
9000
  place-items: center;
8982
9001
  }
8983
9002
 
9003
+ /* The horizontal launchpad strip is wider than the single-icon slot; let the
9004
+ slot grow to the strip's width so the selected agent stays centered. */
9005
+ .agent-gui-node__empty-hero-icon-slot:has(
9006
+ > .agent-gui-node__empty-hero-launchpad-icon
9007
+ ) {
9008
+ width: auto;
9009
+ }
9010
+
8984
9011
  .agent-gui-node__empty-hero-icon-effect {
8985
9012
  display: block;
8986
9013
  width: 48px;
@@ -9069,12 +9096,11 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
9069
9096
  gap: 8px;
9070
9097
  }
9071
9098
 
9072
- .agent-gui-node__empty-provider-gate > .agent-gui-node__empty-hero-icon-effect {
9073
- margin-bottom: 10px;
9074
- }
9075
-
9076
- .agent-gui-node__empty-provider-gate > .agent-gui-node__empty-hero-title {
9077
- font-size: 24px;
9099
+ /* Gate gap is 8px; add 16px so the icon-to-title spacing is 24px. */
9100
+ .agent-gui-node__empty-provider-gate > .agent-gui-node__empty-hero-icon-effect,
9101
+ .agent-gui-node__empty-provider-gate
9102
+ > .agent-gui-node__empty-hero-launchpad-icon {
9103
+ margin-bottom: 16px;
9078
9104
  }
9079
9105
 
9080
9106
  .agent-gui-node__empty-provider-gate-description {
@@ -9098,6 +9124,8 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
9098
9124
  }
9099
9125
 
9100
9126
  .agent-gui-node__empty-provider-gate-action {
9127
+ /* Container gap is 8px; add 16px so the description-to-button spacing is 24px. */
9128
+ margin-top: 16px;
9101
9129
  animation: agent-gui-empty-hero-enter 300ms cubic-bezier(0.16, 1, 0.3, 1)
9102
9130
  190ms both;
9103
9131
  }
@@ -3,11 +3,11 @@ import {
3
3
  getOptionalAgentHostApi,
4
4
  managedAgentRoundedIconUrl,
5
5
  useOptionalAgentHostApi
6
- } from "./chunk-FHWE5SUF.js";
6
+ } from "./chunk-RIRFNGPB.js";
7
7
  import {
8
8
  translate,
9
9
  useTranslation
10
- } from "./chunk-4XIHKCWC.js";
10
+ } from "./chunk-YWQHNFYA.js";
11
11
  import {
12
12
  resolveAgentWorkspaceFileVisualKind
13
13
  } from "./chunk-PJP5BUU6.js";
@@ -1896,10 +1896,12 @@ function AgentMessageMarkdown({
1896
1896
  );
1897
1897
  const normalizedContent = useMemo(
1898
1898
  () => linkBareLocalAbsolutePaths(
1899
- normalizeMentionMarkdownLinks(
1900
- normalizePlainIssueMentionTitle ? normalizePlainIssueMentionTitleContent(
1901
- normalizePlainSessionMentionTitle(stabilizedContent)
1902
- ) : normalizePlainSessionMentionTitle(stabilizedContent)
1899
+ normalizeLocalPathMarkdownLinks(
1900
+ normalizeMentionMarkdownLinks(
1901
+ normalizePlainIssueMentionTitle ? normalizePlainIssueMentionTitleContent(
1902
+ normalizePlainSessionMentionTitle(stabilizedContent)
1903
+ ) : normalizePlainSessionMentionTitle(stabilizedContent)
1904
+ )
1903
1905
  )
1904
1906
  ),
1905
1907
  [normalizePlainIssueMentionTitle, stabilizedContent]
@@ -2961,6 +2963,73 @@ function normalizePlainIssueMentionTitleContent(content) {
2961
2963
  function normalizeMentionMarkdownLinks(content) {
2962
2964
  return content.replace(/\]([\t ]*\r?\n[\t ]*)+\((mention:\/\/)/g, "]($2").replace(/\]\((mention:\/\/[A-Za-z0-9.-]+)\)\?([^\s)]+)/g, "]($1?$2)");
2963
2965
  }
2966
+ function normalizeLocalPathMarkdownLinks(content) {
2967
+ let out = "";
2968
+ for (let index = 0; index < content.length; ) {
2969
+ const codeSpanEnd = codeSpanEndIndex(content, index);
2970
+ if (codeSpanEnd > index) {
2971
+ out += content.slice(index, codeSpanEnd);
2972
+ index = codeSpanEnd;
2973
+ continue;
2974
+ }
2975
+ const normalized = normalizeLocalPathMarkdownLinkAt(content, index);
2976
+ if (normalized) {
2977
+ out += normalized.markdown;
2978
+ index = normalized.end;
2979
+ continue;
2980
+ }
2981
+ out += content[index];
2982
+ index += 1;
2983
+ }
2984
+ return out;
2985
+ }
2986
+ function normalizeLocalPathMarkdownLinkAt(content, index) {
2987
+ if (content[index] !== "[") {
2988
+ return null;
2989
+ }
2990
+ const labelEnd = content.indexOf("]", index + 1);
2991
+ if (labelEnd < 0 || content[labelEnd + 1] !== "(") {
2992
+ return null;
2993
+ }
2994
+ const hrefStart = labelEnd + 2;
2995
+ if (content[hrefStart] === "<") {
2996
+ return null;
2997
+ }
2998
+ let hrefEnd = hrefStart;
2999
+ while (hrefEnd < content.length) {
3000
+ const current = content[hrefEnd];
3001
+ if (current === "\\" && hrefEnd + 1 < content.length) {
3002
+ hrefEnd += 2;
3003
+ continue;
3004
+ }
3005
+ if (current === "\n" || current === "\r") {
3006
+ return null;
3007
+ }
3008
+ if (current === ")") {
3009
+ break;
3010
+ }
3011
+ hrefEnd += 1;
3012
+ }
3013
+ if (content[hrefEnd] !== ")") {
3014
+ return null;
3015
+ }
3016
+ const href = content.slice(hrefStart, hrefEnd);
3017
+ const target = href.trim();
3018
+ if (target.length === 0 || !/\s/.test(target) || /[<>]/.test(target) || !isPotentialLocalMarkdownPathHref(target)) {
3019
+ return null;
3020
+ }
3021
+ return {
3022
+ markdown: `${content.slice(index, hrefStart)}<${target}>)`,
3023
+ end: hrefEnd + 1
3024
+ };
3025
+ }
3026
+ function isPotentialLocalMarkdownPathHref(href) {
3027
+ const target = href.trim();
3028
+ if (!target || target.includes("://")) {
3029
+ return false;
3030
+ }
3031
+ return target.startsWith("/") && !target.startsWith("//") || target.startsWith("~/") || target.startsWith("~\\") || /^[A-Za-z]:[\\/]/.test(target);
3032
+ }
2964
3033
  function isMentionOnlyMarkdownContent(content) {
2965
3034
  const trimmed = content.trim();
2966
3035
  if (trimmed.length === 0) {
@@ -3707,4 +3776,4 @@ export {
3707
3776
  CustomScrollArea,
3708
3777
  MessageSquareMoreIcon
3709
3778
  };
3710
- //# sourceMappingURL=chunk-GLMDAZSQ.js.map
3779
+ //# sourceMappingURL=chunk-3FYA2K4P.js.map