fix(webui): recognize typed session handles as references (#6311)

* fix(webui): recognize typed session handles as references

Refs NAN-286

* refactor(webui): simplify session reference handling

* fix(webui): recognize mentions after punctuation

* docs(webui): focus topic references on usage
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-20 01:05:11 +08:00
1 parent 1f8e49c70a
commit 909b277e7a
7 files changed
+369 -144

No files matched your search

+6
View File
@@ -1,5 +1,11 @@
import type { CliAppInfo, McpPresetInfo, SessionMention } from "@/lib/types";
const MENTION_START_BOUNDARY = /[\s([{,,、;;::!?!?。]/u;
export function isCapabilityMentionStart(value: string, position: number): boolean {
return position === 0 || MENTION_START_BOUNDARY.test(value.charAt(position - 1));
}
export type CapabilityMentionSegment =
| { kind: "text"; text: string }
| { kind: "cli"; text: string; app: CliAppInfo }