@n8n/chat-hub 1.1.0
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/LICENSE.md +88 -0
- package/README.md +32 -0
- package/dist/artifact.d.ts +2 -0
- package/dist/artifact.js +33 -0
- package/dist/artifact.js.map +1 -0
- package/dist/build.tsbuildinfo +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/parser.d.ts +7 -0
- package/dist/parser.js +203 -0
- package/dist/parser.js.map +1 -0
- package/package.json +30 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./parser"), exports);
|
|
18
|
+
__exportStar(require("./artifact"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B"}
|
package/dist/parser.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ChatHubMessageType, type ChatMessageContentChunk } from '@n8n/api-types';
|
|
2
|
+
export interface MessageWithContent {
|
|
3
|
+
type: ChatHubMessageType;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function appendChunkToParsedMessageItems(items: ChatMessageContentChunk[], chunk: string): ChatMessageContentChunk[];
|
|
7
|
+
export declare function parseMessage(message: MessageWithContent): ChatMessageContentChunk[];
|
package/dist/parser.js
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.appendChunkToParsedMessageItems = appendChunkToParsedMessageItems;
|
|
4
|
+
exports.parseMessage = parseMessage;
|
|
5
|
+
const api_types_1 = require("@n8n/api-types");
|
|
6
|
+
function appendChunkToParsedMessageItems(items, chunk) {
|
|
7
|
+
const result = [...items];
|
|
8
|
+
let remaining = chunk;
|
|
9
|
+
if (result.length > 0) {
|
|
10
|
+
const lastItem = result[result.length - 1];
|
|
11
|
+
if (lastItem.type === 'hidden') {
|
|
12
|
+
remaining = lastItem.content + chunk;
|
|
13
|
+
result.pop();
|
|
14
|
+
}
|
|
15
|
+
else if ((lastItem.type === 'artifact-create' || lastItem.type === 'artifact-edit') &&
|
|
16
|
+
lastItem.isIncomplete) {
|
|
17
|
+
remaining = lastItem.content + chunk;
|
|
18
|
+
result.pop();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const buttonChunk = tryParseButtonsJson(remaining);
|
|
22
|
+
if (buttonChunk) {
|
|
23
|
+
result.push(buttonChunk);
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
let currentPos = 0;
|
|
27
|
+
const createCommandRegex = /<command:artifact-create>/g;
|
|
28
|
+
const editCommandRegex = /<command:artifact-edit>/g;
|
|
29
|
+
while (currentPos < remaining.length) {
|
|
30
|
+
createCommandRegex.lastIndex = currentPos;
|
|
31
|
+
editCommandRegex.lastIndex = currentPos;
|
|
32
|
+
const createMatch = createCommandRegex.exec(remaining);
|
|
33
|
+
const editMatch = editCommandRegex.exec(remaining);
|
|
34
|
+
let nextMatch = null;
|
|
35
|
+
let commandType = null;
|
|
36
|
+
if (createMatch && editMatch) {
|
|
37
|
+
if (createMatch.index < editMatch.index) {
|
|
38
|
+
nextMatch = createMatch;
|
|
39
|
+
commandType = 'create';
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
nextMatch = editMatch;
|
|
43
|
+
commandType = 'edit';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else if (createMatch) {
|
|
47
|
+
nextMatch = createMatch;
|
|
48
|
+
commandType = 'create';
|
|
49
|
+
}
|
|
50
|
+
else if (editMatch) {
|
|
51
|
+
nextMatch = editMatch;
|
|
52
|
+
commandType = 'edit';
|
|
53
|
+
}
|
|
54
|
+
if (!nextMatch || !commandType) {
|
|
55
|
+
const textContent = remaining.slice(currentPos);
|
|
56
|
+
if (textContent) {
|
|
57
|
+
const { text, hiddenPrefix } = splitPotentialCommandPrefix(textContent);
|
|
58
|
+
if (text) {
|
|
59
|
+
addTextToResult(result, text);
|
|
60
|
+
}
|
|
61
|
+
if (hiddenPrefix) {
|
|
62
|
+
result.push({ type: 'hidden', content: hiddenPrefix });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
if (nextMatch.index > currentPos) {
|
|
68
|
+
const textContent = remaining.slice(currentPos, nextMatch.index);
|
|
69
|
+
addTextToResult(result, textContent);
|
|
70
|
+
}
|
|
71
|
+
const commandStart = nextMatch.index;
|
|
72
|
+
const commandContent = remaining.slice(commandStart);
|
|
73
|
+
if (commandType === 'create') {
|
|
74
|
+
const parsed = parseArtifactCreateCommand(commandContent);
|
|
75
|
+
result.push(parsed.item);
|
|
76
|
+
currentPos = commandStart + parsed.consumed;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
const parsed = parseArtifactEditCommand(commandContent);
|
|
80
|
+
result.push(parsed.item);
|
|
81
|
+
currentPos = commandStart + parsed.consumed;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
function addTextToResult(result, textContent) {
|
|
87
|
+
if (textContent === '') {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (result.length > 0) {
|
|
91
|
+
const lastItem = result[result.length - 1];
|
|
92
|
+
if (lastItem.type === 'text') {
|
|
93
|
+
result[result.length - 1] = { type: 'text', content: lastItem.content + textContent };
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
result.push({ type: 'text', content: textContent });
|
|
98
|
+
}
|
|
99
|
+
function splitPotentialCommandPrefix(text) {
|
|
100
|
+
const commandTags = ['<command:artifact-create>', '<command:artifact-edit>'];
|
|
101
|
+
for (let len = 1; len <= Math.min(text.length, 30); len++) {
|
|
102
|
+
const suffix = text.slice(-len);
|
|
103
|
+
for (const tag of commandTags) {
|
|
104
|
+
if (tag.startsWith(suffix)) {
|
|
105
|
+
return {
|
|
106
|
+
text: text.slice(0, -len),
|
|
107
|
+
hiddenPrefix: suffix,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return { text, hiddenPrefix: '' };
|
|
113
|
+
}
|
|
114
|
+
function parseArtifactCreateCommand(content) {
|
|
115
|
+
const closingTag = '</command:artifact-create>';
|
|
116
|
+
const closingIndex = content.indexOf(closingTag);
|
|
117
|
+
const isIncomplete = closingIndex === -1;
|
|
118
|
+
const commandContent = isIncomplete
|
|
119
|
+
? content
|
|
120
|
+
: content.slice(0, closingIndex + closingTag.length);
|
|
121
|
+
const title = extractTagContent(commandContent, 'title') ?? '';
|
|
122
|
+
const type = extractTagContent(commandContent, 'type') ?? '';
|
|
123
|
+
const contentField = extractTagContent(commandContent, 'content') ?? '';
|
|
124
|
+
return {
|
|
125
|
+
item: {
|
|
126
|
+
type: 'artifact-create',
|
|
127
|
+
content: commandContent,
|
|
128
|
+
command: { title, type, content: contentField },
|
|
129
|
+
isIncomplete,
|
|
130
|
+
},
|
|
131
|
+
consumed: commandContent.length,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function parseArtifactEditCommand(content) {
|
|
135
|
+
const closingTag = '</command:artifact-edit>';
|
|
136
|
+
const closingIndex = content.indexOf(closingTag);
|
|
137
|
+
const isIncomplete = closingIndex === -1;
|
|
138
|
+
const commandContent = isIncomplete
|
|
139
|
+
? content
|
|
140
|
+
: content.slice(0, closingIndex + closingTag.length);
|
|
141
|
+
const title = extractTagContent(commandContent, 'title') ?? '';
|
|
142
|
+
const oldString = extractTagContent(commandContent, 'oldString') ?? '';
|
|
143
|
+
const newString = extractTagContent(commandContent, 'newString') ?? '';
|
|
144
|
+
const replaceAllStr = extractTagContent(commandContent, 'replaceAll') ?? 'false';
|
|
145
|
+
const replaceAll = replaceAllStr.toLowerCase() === 'true';
|
|
146
|
+
return {
|
|
147
|
+
item: {
|
|
148
|
+
type: 'artifact-edit',
|
|
149
|
+
content: commandContent,
|
|
150
|
+
command: { title, oldString, newString, replaceAll },
|
|
151
|
+
isIncomplete,
|
|
152
|
+
},
|
|
153
|
+
consumed: commandContent.length,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function extractTagContent(xml, tagName) {
|
|
157
|
+
const openTag = `<${tagName}>`;
|
|
158
|
+
const closeTag = `</${tagName}>`;
|
|
159
|
+
const startIndex = xml.indexOf(openTag);
|
|
160
|
+
if (startIndex === -1) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
const contentStart = startIndex + openTag.length;
|
|
164
|
+
const endIndex = xml.indexOf(closeTag, contentStart);
|
|
165
|
+
if (endIndex === -1) {
|
|
166
|
+
let content = xml.slice(contentStart);
|
|
167
|
+
for (let len = 1; len < closeTag.length; len++) {
|
|
168
|
+
const partialCloseTag = closeTag.slice(0, len);
|
|
169
|
+
if (content.endsWith(partialCloseTag)) {
|
|
170
|
+
content = content.slice(0, -len);
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return content.length > 0 ? content : null;
|
|
175
|
+
}
|
|
176
|
+
return xml.slice(contentStart, endIndex);
|
|
177
|
+
}
|
|
178
|
+
function tryParseButtonsJson(content) {
|
|
179
|
+
if (!content.startsWith('{'))
|
|
180
|
+
return null;
|
|
181
|
+
try {
|
|
182
|
+
const parsed = JSON.parse(content);
|
|
183
|
+
const result = api_types_1.chatHubMessageWithButtonsSchema.safeParse(parsed);
|
|
184
|
+
if (result.success) {
|
|
185
|
+
return {
|
|
186
|
+
type: 'with-buttons',
|
|
187
|
+
content: result.data.text,
|
|
188
|
+
buttons: result.data.buttons,
|
|
189
|
+
blockUserInput: result.data.blockUserInput,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
}
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
function parseMessage(message) {
|
|
198
|
+
if (message.type !== 'ai') {
|
|
199
|
+
return [{ type: 'text', content: message.content }];
|
|
200
|
+
}
|
|
201
|
+
return appendChunkToParsedMessageItems([], message.content);
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":";;AAWA,0EAuGC;AAgKD,oCAMC;AAxRD,8CAIwB;AAOxB,SAAgB,+BAA+B,CAC9C,KAAgC,EAChC,KAAa;IAEb,MAAM,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IAC1B,IAAI,SAAS,GAAG,KAAK,CAAC;IAGtB,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,QAAQ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AAI,CAAC,IAAI;gBACzB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO;gBAC5B,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc;aAC1C,CAAC;QACH,CAAC;IACF,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAOD,SAAgB,YAAY,CAAC,OAA2B;IACvD,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAC3B,OAAO,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,+BAA+B,CAAC,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7D,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@n8n/chat-hub",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "src/index.ts",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist/**/*"
|
|
9
|
+
],
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@n8n/typescript-config": "1.3.0"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@n8n/api-types": "1.8.0"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"clean": "rimraf dist .turbo",
|
|
18
|
+
"dev": "pnpm watch",
|
|
19
|
+
"typecheck": "tsc --noEmit",
|
|
20
|
+
"build": "tsc -p tsconfig.build.json",
|
|
21
|
+
"format": "biome format --write .",
|
|
22
|
+
"format:check": "biome ci .",
|
|
23
|
+
"lint": "eslint . --quiet",
|
|
24
|
+
"lint:fix": "eslint . --fix",
|
|
25
|
+
"watch": "tsc -p tsconfig.build.json --watch",
|
|
26
|
+
"test": "jest",
|
|
27
|
+
"test:unit": "jest",
|
|
28
|
+
"test:dev": "jest --watch"
|
|
29
|
+
}
|
|
30
|
+
}
|