@stll/chat 0.2.5 → 0.2.6
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.
package/dist/link-detection.d.ts
CHANGED
|
@@ -10,5 +10,6 @@ export declare const normalizeChatLink: (input: string) => {
|
|
|
10
10
|
href: string;
|
|
11
11
|
hostname: string;
|
|
12
12
|
} | null;
|
|
13
|
+
export declare const getChatLinkSite: (hostname: string) => string | null;
|
|
13
14
|
export declare const detectChatLinks: (text: string) => ChatLinkSpan[];
|
|
14
15
|
//#endregion
|
package/dist/link-detection.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LinkifyIt } from "linkify-it";
|
|
2
|
-
import { parse } from "tldts";
|
|
2
|
+
import { getDomain, parse } from "tldts";
|
|
3
3
|
//#region src/link-detection.ts
|
|
4
4
|
const HTTP_SCHEME = /^https?:\/\//iu;
|
|
5
5
|
const BARE_HOST_LABEL_START = /^[\p{L}\p{N}]/u;
|
|
@@ -39,6 +39,7 @@ const normalizeChatLink = (input) => {
|
|
|
39
39
|
hostname: url.hostname
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
+
const getChatLinkSite = (hostname) => getDomain(hostname, { allowPrivateDomains: false });
|
|
42
43
|
const detectChatLinks = (text) => {
|
|
43
44
|
const suffixes = Array.from(text.matchAll(/\.([\p{L}\p{N}-]+)/gu), (match) => match[1] ?? "");
|
|
44
45
|
const linkify = new LinkifyIt({
|
|
@@ -65,4 +66,4 @@ const detectChatLinks = (text) => {
|
|
|
65
66
|
return spans;
|
|
66
67
|
};
|
|
67
68
|
//#endregion
|
|
68
|
-
export { detectChatLinks, normalizeChatLink };
|
|
69
|
+
export { detectChatLinks, getChatLinkSite, normalizeChatLink };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/chat",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Typed React chat composer, message stream, model selector, and transport runtime primitives.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"dependencies": {
|
|
88
88
|
"@ag-ui/core": "1.0.2",
|
|
89
89
|
"@stll/ai-catalog": "^0.8.2",
|
|
90
|
-
"@stll/ui": "^0.50.
|
|
90
|
+
"@stll/ui": "^0.50.1",
|
|
91
91
|
"@tanstack/ai-client": "0.38.0",
|
|
92
92
|
"@types/hast": "^3.0.5",
|
|
93
93
|
"better-result": "3.0.1",
|