@coffer-org/plugin-http 2.0.0 → 2.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/dist/runtime/chain-store.js +19 -2
- package/package.json +4 -4
|
@@ -4,12 +4,29 @@ const log = getLogger('http-connector');
|
|
|
4
4
|
const CONNECTOR = 'http';
|
|
5
5
|
const DEFAULT_MAX_DEPTH = 30;
|
|
6
6
|
export async function recordUser(m) {
|
|
7
|
-
await putThreadMessage({
|
|
7
|
+
await putThreadMessage({
|
|
8
|
+
connector: CONNECTOR,
|
|
9
|
+
chatId: m.chatId,
|
|
10
|
+
msgId: m.msgId,
|
|
11
|
+
role: 'user',
|
|
12
|
+
sender: m.sender ?? null,
|
|
13
|
+
text: m.text,
|
|
14
|
+
ts: m.ts,
|
|
15
|
+
replyToId: m.replyToId,
|
|
16
|
+
});
|
|
8
17
|
}
|
|
9
18
|
export async function recordAssistant(m) {
|
|
10
19
|
if (m.botMsgId == null || !m.text.trim())
|
|
11
20
|
return false;
|
|
12
|
-
await putThreadMessage({
|
|
21
|
+
await putThreadMessage({
|
|
22
|
+
connector: CONNECTOR,
|
|
23
|
+
chatId: m.chatId,
|
|
24
|
+
msgId: m.botMsgId,
|
|
25
|
+
role: 'assistant',
|
|
26
|
+
text: m.text,
|
|
27
|
+
ts: m.now,
|
|
28
|
+
replyToId: m.parentMsgId,
|
|
29
|
+
});
|
|
13
30
|
return true;
|
|
14
31
|
}
|
|
15
32
|
export async function buildChain(headMsgId, opts) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coffer-org/plugin-http",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24"
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"test": "node --import tsx --test \"src/runtime/*.test.ts\""
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@coffer-org/plugin-orchestrator": "^2.
|
|
29
|
-
"@coffer-org/sdk": "^2.
|
|
30
|
-
"@coffer-org/server": "^2.0
|
|
28
|
+
"@coffer-org/plugin-orchestrator": "^2.1.0",
|
|
29
|
+
"@coffer-org/sdk": "^2.1.0",
|
|
30
|
+
"@coffer-org/server": "^2.2.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {},
|
|
33
33
|
"coffer": {
|