@dainprotocol/service-sdk 2.0.52 → 2.0.53
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/client/client.d.ts +4 -4
- package/dist/client/client.js +4 -6
- package/dist/client/client.js.map +1 -1
- package/package.json +10 -9
- package/dist/__tests__/api-sdk.test.d.ts +0 -1
- package/dist/__tests__/api-sdk.test.js +0 -102
- package/dist/__tests__/api-sdk.test.js.map +0 -1
- package/dist/__tests__/auth.test.d.ts +0 -1
- package/dist/__tests__/auth.test.js +0 -110
- package/dist/__tests__/auth.test.js.map +0 -1
- package/dist/__tests__/citations-plugin.test.d.ts +0 -1
- package/dist/__tests__/citations-plugin.test.js +0 -491
- package/dist/__tests__/citations-plugin.test.js.map +0 -1
- package/dist/__tests__/context-behavior.test.d.ts +0 -1
- package/dist/__tests__/context-behavior.test.js +0 -290
- package/dist/__tests__/context-behavior.test.js.map +0 -1
- package/dist/__tests__/convertToVercelTool.test.d.ts +0 -1
- package/dist/__tests__/convertToVercelTool.test.js +0 -527
- package/dist/__tests__/convertToVercelTool.test.js.map +0 -1
- package/dist/__tests__/core.test.d.ts +0 -1
- package/dist/__tests__/core.test.js +0 -154
- package/dist/__tests__/core.test.js.map +0 -1
- package/dist/__tests__/crypto-plugin.test.d.ts +0 -1
- package/dist/__tests__/crypto-plugin.test.js +0 -694
- package/dist/__tests__/crypto-plugin.test.js.map +0 -1
- package/dist/__tests__/humanActions.test.d.ts +0 -1
- package/dist/__tests__/humanActions.test.js +0 -221
- package/dist/__tests__/humanActions.test.js.map +0 -1
- package/dist/__tests__/integration.test.d.ts +0 -1
- package/dist/__tests__/integration.test.js +0 -1573
- package/dist/__tests__/integration.test.js.map +0 -1
- package/dist/__tests__/mealMeSchemas.test.d.ts +0 -576
- package/dist/__tests__/mealMeSchemas.test.js +0 -627
- package/dist/__tests__/mealMeSchemas.test.js.map +0 -1
- package/dist/__tests__/oauth-context-simple.test.d.ts +0 -1
- package/dist/__tests__/oauth-context-simple.test.js +0 -90
- package/dist/__tests__/oauth-context-simple.test.js.map +0 -1
- package/dist/__tests__/oauth-context.test.d.ts +0 -1
- package/dist/__tests__/oauth-context.test.js +0 -282
- package/dist/__tests__/oauth-context.test.js.map +0 -1
- package/dist/__tests__/oauth.test.d.ts +0 -1
- package/dist/__tests__/oauth.test.js +0 -378
- package/dist/__tests__/oauth.test.js.map +0 -1
- package/dist/__tests__/oauth2-client-context.test.d.ts +0 -1
- package/dist/__tests__/oauth2-client-context.test.js +0 -165
- package/dist/__tests__/oauth2-client-context.test.js.map +0 -1
- package/dist/__tests__/oauth2-client-integration.test.d.ts +0 -1
- package/dist/__tests__/oauth2-client-integration.test.js +0 -182
- package/dist/__tests__/oauth2-client-integration.test.js.map +0 -1
- package/dist/__tests__/oauth2-client-simple.test.d.ts +0 -1
- package/dist/__tests__/oauth2-client-simple.test.js +0 -144
- package/dist/__tests__/oauth2-client-simple.test.js.map +0 -1
- package/dist/__tests__/oauth2-context.test.d.ts +0 -1
- package/dist/__tests__/oauth2-context.test.js +0 -201
- package/dist/__tests__/oauth2-context.test.js.map +0 -1
- package/dist/__tests__/oauth2-datasource.test.d.ts +0 -1
- package/dist/__tests__/oauth2-datasource.test.js +0 -251
- package/dist/__tests__/oauth2-datasource.test.js.map +0 -1
- package/dist/__tests__/plugin.test.d.ts +0 -1
- package/dist/__tests__/plugin.test.js +0 -900
- package/dist/__tests__/plugin.test.js.map +0 -1
- package/dist/__tests__/processes.test.d.ts +0 -1
- package/dist/__tests__/processes.test.js +0 -239
- package/dist/__tests__/processes.test.js.map +0 -1
- package/dist/__tests__/streaming.test.d.ts +0 -1
- package/dist/__tests__/streaming.test.js +0 -592
- package/dist/__tests__/streaming.test.js.map +0 -1
- package/dist/__tests__/testEnums.d.ts +0 -1
- package/dist/__tests__/testEnums.js +0 -73
- package/dist/__tests__/testEnums.js.map +0 -1
- package/dist/__tests__/testOptionals.test.d.ts +0 -1
- package/dist/__tests__/testOptionals.test.js +0 -83
- package/dist/__tests__/testOptionals.test.js.map +0 -1
- package/dist/__tests__/types.test.d.ts +0 -1
- package/dist/__tests__/types.test.js +0 -98
- package/dist/__tests__/types.test.js.map +0 -1
- package/dist/service/zod-json-converter.d.ts +0 -14
- package/dist/service/zod-json-converter.js +0 -203
- package/dist/service/zod-json-converter.js.map +0 -1
|
@@ -1,491 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// File: src/__tests__/citations-plugin.test.ts
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const client_auth_1 = require("@/client/client-auth");
|
|
6
|
-
const client_1 = require("@/client/client");
|
|
7
|
-
const ed25519_1 = require("@noble/curves/ed25519");
|
|
8
|
-
const bs58_1 = tslib_1.__importDefault(require("bs58"));
|
|
9
|
-
const nodeService_1 = require("@/service/nodeService");
|
|
10
|
-
const core_1 = require("@/service/core");
|
|
11
|
-
const zod_1 = require("zod");
|
|
12
|
-
const citations_plugin_1 = require("@/plugins/citations-plugin");
|
|
13
|
-
describe("DAIN Framework CitationsPlugin System", () => {
|
|
14
|
-
// Generate test keys
|
|
15
|
-
const servicePrivateKey = ed25519_1.ed25519.utils.randomPrivateKey();
|
|
16
|
-
const servicePublicKey = ed25519_1.ed25519.getPublicKey(servicePrivateKey);
|
|
17
|
-
const serviceAddress = bs58_1.default.encode(servicePublicKey);
|
|
18
|
-
const clientPrivateKey = ed25519_1.ed25519.utils.randomPrivateKey();
|
|
19
|
-
// Set up client authentication
|
|
20
|
-
const agentAuth = new client_auth_1.DainClientAuth({
|
|
21
|
-
privateKeyBase58: bs58_1.default.encode(clientPrivateKey),
|
|
22
|
-
agentId: "agent-citations-test",
|
|
23
|
-
orgId: "org-citations-test",
|
|
24
|
-
});
|
|
25
|
-
// Create CitationsPlugin instances for client and service
|
|
26
|
-
const clientCitationsPlugin = new citations_plugin_1.CitationsPlugin();
|
|
27
|
-
const serviceCitationsPlugin = new citations_plugin_1.CitationsPlugin();
|
|
28
|
-
// Initialize the connection to the DAIN service with the client citations plugin
|
|
29
|
-
const dainConnection = new client_1.DainServiceConnection("http://localhost:4486", agentAuth, {
|
|
30
|
-
plugins: [clientCitationsPlugin]
|
|
31
|
-
});
|
|
32
|
-
// Create a test tool that produces citations
|
|
33
|
-
const researchTool = (0, core_1.createTool)({
|
|
34
|
-
id: "research-tool",
|
|
35
|
-
name: "Research Tool",
|
|
36
|
-
description: "Tool that produces research results with citations",
|
|
37
|
-
input: zod_1.z.object({
|
|
38
|
-
topic: zod_1.z.string(),
|
|
39
|
-
includeMultiple: zod_1.z.boolean().optional(),
|
|
40
|
-
citationType: zod_1.z.enum(["article", "book", "document", "webpage", "video", "report", "other"]).optional()
|
|
41
|
-
}),
|
|
42
|
-
output: zod_1.z.object({
|
|
43
|
-
articles: zod_1.z.array(zod_1.z.object({
|
|
44
|
-
content: zod_1.z.string(),
|
|
45
|
-
id: zod_1.z.string(),
|
|
46
|
-
citation: zod_1.z.object({
|
|
47
|
-
id: zod_1.z.string(),
|
|
48
|
-
ui: zod_1.z.any(),
|
|
49
|
-
url: zod_1.z.string().optional(),
|
|
50
|
-
title: zod_1.z.string().optional(),
|
|
51
|
-
author: zod_1.z.string().optional(),
|
|
52
|
-
date: zod_1.z.string().optional(),
|
|
53
|
-
type: zod_1.z.string().optional(),
|
|
54
|
-
source: zod_1.z.string().optional(),
|
|
55
|
-
})
|
|
56
|
-
})),
|
|
57
|
-
summary: zod_1.z.string(),
|
|
58
|
-
totalCitations: zod_1.z.number()
|
|
59
|
-
}),
|
|
60
|
-
handler: async ({ topic, includeMultiple = false, citationType = "article" }) => {
|
|
61
|
-
const articles = [
|
|
62
|
-
{
|
|
63
|
-
content: `This is a comprehensive research article about ${topic}. It provides detailed analysis and insights into the subject matter.`,
|
|
64
|
-
id: `article-1-${Date.now()}`,
|
|
65
|
-
citation: {
|
|
66
|
-
id: `citation-1-${Date.now()}`,
|
|
67
|
-
ui: {
|
|
68
|
-
type: "citation",
|
|
69
|
-
title: `Research on ${topic}`,
|
|
70
|
-
preview: `Academic research about ${topic}`
|
|
71
|
-
},
|
|
72
|
-
url: `https://academic.example.com/${topic.toLowerCase().replace(/\s+/g, '-')}`,
|
|
73
|
-
title: `Research on ${topic}`,
|
|
74
|
-
author: "Dr. Jane Smith",
|
|
75
|
-
date: "2024-01-10",
|
|
76
|
-
type: citationType,
|
|
77
|
-
source: "Academic Journal",
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
];
|
|
81
|
-
if (includeMultiple) {
|
|
82
|
-
articles.push({
|
|
83
|
-
content: `Additional insights about ${topic} from a different perspective and methodology.`,
|
|
84
|
-
id: `article-2-${Date.now()}`,
|
|
85
|
-
citation: {
|
|
86
|
-
id: `citation-2-${Date.now()}`,
|
|
87
|
-
ui: {
|
|
88
|
-
type: "citation",
|
|
89
|
-
title: `${topic} Analysis`,
|
|
90
|
-
preview: `Industry analysis of ${topic}`
|
|
91
|
-
},
|
|
92
|
-
url: `https://industry.example.com/${topic.toLowerCase().replace(/\s+/g, '-')}-analysis`,
|
|
93
|
-
title: `${topic} Analysis`,
|
|
94
|
-
author: "John Doe",
|
|
95
|
-
date: "2024-01-12",
|
|
96
|
-
type: "report",
|
|
97
|
-
source: "Industry Report",
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
articles.push({
|
|
101
|
-
content: `Historical context and background information about ${topic}.`,
|
|
102
|
-
id: `article-3-${Date.now()}`,
|
|
103
|
-
citation: {
|
|
104
|
-
id: `citation-3-${Date.now()}`,
|
|
105
|
-
ui: {
|
|
106
|
-
type: "citation",
|
|
107
|
-
title: `History of ${topic}`,
|
|
108
|
-
preview: `Historical overview of ${topic}`
|
|
109
|
-
},
|
|
110
|
-
url: `https://history.example.com/${topic.toLowerCase().replace(/\s+/g, '-')}-history`,
|
|
111
|
-
title: `History of ${topic}`,
|
|
112
|
-
author: "Prof. Alice Johnson",
|
|
113
|
-
date: "2023-12-15",
|
|
114
|
-
type: "book",
|
|
115
|
-
source: "Historical Archives",
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
return {
|
|
120
|
-
text: `Found ${articles.length} article(s) about ${topic} with citations`,
|
|
121
|
-
data: {
|
|
122
|
-
articles,
|
|
123
|
-
summary: `Research summary of ${articles.length} articles about ${topic}`,
|
|
124
|
-
totalCitations: articles.length
|
|
125
|
-
},
|
|
126
|
-
ui: {
|
|
127
|
-
type: "research-results",
|
|
128
|
-
count: articles.length
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
// Create a tool that produces mixed content with some citations
|
|
134
|
-
const mixedContentTool = (0, core_1.createTool)({
|
|
135
|
-
id: "mixed-content-tool",
|
|
136
|
-
name: "Mixed Content Tool",
|
|
137
|
-
description: "Tool that produces mixed content, some with citations",
|
|
138
|
-
input: zod_1.z.object({
|
|
139
|
-
query: zod_1.z.string()
|
|
140
|
-
}),
|
|
141
|
-
output: zod_1.z.object({
|
|
142
|
-
results: zod_1.z.array(zod_1.z.any()),
|
|
143
|
-
metadata: zod_1.z.object({
|
|
144
|
-
hasReferences: zod_1.z.boolean(),
|
|
145
|
-
sourceCount: zod_1.z.number()
|
|
146
|
-
})
|
|
147
|
-
}),
|
|
148
|
-
handler: async ({ query }) => {
|
|
149
|
-
const results = [
|
|
150
|
-
// Regular content without citation
|
|
151
|
-
{
|
|
152
|
-
type: "summary",
|
|
153
|
-
content: `Summary information about ${query}`,
|
|
154
|
-
id: `summary-${Date.now()}`
|
|
155
|
-
},
|
|
156
|
-
// Content with citation
|
|
157
|
-
{
|
|
158
|
-
type: "reference",
|
|
159
|
-
content: `Referenced information about ${query} from authoritative sources.`,
|
|
160
|
-
id: `ref-1-${Date.now()}`,
|
|
161
|
-
citation: {
|
|
162
|
-
id: `citation-mixed-1-${Date.now()}`,
|
|
163
|
-
ui: {
|
|
164
|
-
type: "citation",
|
|
165
|
-
title: `Authority on ${query}`,
|
|
166
|
-
preview: `Authoritative source about ${query}`
|
|
167
|
-
},
|
|
168
|
-
url: `https://authority.example.com/${query.toLowerCase().replace(/\s+/g, '-')}`,
|
|
169
|
-
title: `Authority on ${query}`,
|
|
170
|
-
author: "Expert Panel",
|
|
171
|
-
date: "2024-01-08",
|
|
172
|
-
type: "webpage",
|
|
173
|
-
source: "Authority Website",
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
// Another regular content
|
|
177
|
-
{
|
|
178
|
-
type: "note",
|
|
179
|
-
content: `Additional notes about ${query}`,
|
|
180
|
-
id: `note-${Date.now()}`
|
|
181
|
-
},
|
|
182
|
-
// Nested structure with citation
|
|
183
|
-
{
|
|
184
|
-
type: "detailed",
|
|
185
|
-
content: `Detailed analysis of ${query}`,
|
|
186
|
-
id: `detailed-${Date.now()}`,
|
|
187
|
-
references: [
|
|
188
|
-
{
|
|
189
|
-
content: `Supporting evidence for ${query} analysis.`,
|
|
190
|
-
id: `support-1-${Date.now()}`,
|
|
191
|
-
citation: {
|
|
192
|
-
id: `citation-mixed-2-${Date.now()}`,
|
|
193
|
-
ui: {
|
|
194
|
-
type: "citation",
|
|
195
|
-
title: `Evidence for ${query}`,
|
|
196
|
-
preview: `Supporting evidence about ${query}`
|
|
197
|
-
},
|
|
198
|
-
url: `https://evidence.example.com/${query.toLowerCase().replace(/\s+/g, '-')}`,
|
|
199
|
-
title: `Evidence for ${query}`,
|
|
200
|
-
author: "Research Team",
|
|
201
|
-
date: "2024-01-05",
|
|
202
|
-
type: "document",
|
|
203
|
-
source: "Research Database",
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
]
|
|
207
|
-
}
|
|
208
|
-
];
|
|
209
|
-
return {
|
|
210
|
-
text: `Found mixed content about ${query}`,
|
|
211
|
-
data: {
|
|
212
|
-
results,
|
|
213
|
-
metadata: {
|
|
214
|
-
hasReferences: true,
|
|
215
|
-
sourceCount: 3
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
ui: {
|
|
219
|
-
type: "mixed-results"
|
|
220
|
-
},
|
|
221
|
-
};
|
|
222
|
-
},
|
|
223
|
-
});
|
|
224
|
-
// Initialize the DAIN service with the SERVICE citations plugin instance
|
|
225
|
-
const dainService = (0, nodeService_1.defineDAINService)({
|
|
226
|
-
metadata: {
|
|
227
|
-
title: "Citations Plugin Test Service",
|
|
228
|
-
description: "A DAIN service for testing the citations plugin",
|
|
229
|
-
version: "1.0.0",
|
|
230
|
-
author: "Test Author",
|
|
231
|
-
tags: ["citations", "plugin", "test"],
|
|
232
|
-
},
|
|
233
|
-
identity: {
|
|
234
|
-
publicKey: bs58_1.default.encode(servicePublicKey),
|
|
235
|
-
agentId: "citations-agent",
|
|
236
|
-
orgId: "citations-org",
|
|
237
|
-
privateKey: bs58_1.default.encode(servicePrivateKey),
|
|
238
|
-
},
|
|
239
|
-
tools: [researchTool, mixedContentTool],
|
|
240
|
-
plugins: [serviceCitationsPlugin], // Using service-side plugin instance
|
|
241
|
-
});
|
|
242
|
-
let server;
|
|
243
|
-
beforeAll(async () => {
|
|
244
|
-
server = await dainService.startNode({ port: 4486 });
|
|
245
|
-
await new Promise(resolve => setTimeout(resolve, 500)); // Give server time to start
|
|
246
|
-
});
|
|
247
|
-
afterAll(async () => {
|
|
248
|
-
await server.shutdown();
|
|
249
|
-
});
|
|
250
|
-
it("should extract citations from tool responses", async () => {
|
|
251
|
-
// Call the research tool
|
|
252
|
-
const result = await dainConnection.callTool("research-tool", {
|
|
253
|
-
topic: "Artificial Intelligence",
|
|
254
|
-
includeMultiple: false,
|
|
255
|
-
citationType: "article"
|
|
256
|
-
});
|
|
257
|
-
console.log("[CLIENT] Received response:", JSON.stringify(result, null, 2));
|
|
258
|
-
// Verify the response structure
|
|
259
|
-
expect(result.data.articles).toBeDefined();
|
|
260
|
-
expect(result.data.articles.length).toBe(1);
|
|
261
|
-
expect(result.data.totalCitations).toBe(1);
|
|
262
|
-
// Use the CLIENT plugin helper to extract citations
|
|
263
|
-
const citations = clientCitationsPlugin.getCitationsFromResponse(result);
|
|
264
|
-
console.log("[CLIENT] Extracted citations:", JSON.stringify(citations, null, 2));
|
|
265
|
-
expect(citations).toBeDefined();
|
|
266
|
-
expect(citations.length).toBe(1);
|
|
267
|
-
const citation = citations[0];
|
|
268
|
-
expect(citation.id).toBeDefined();
|
|
269
|
-
expect(citation.title).toBe("Research on Artificial Intelligence");
|
|
270
|
-
expect(citation.author).toBe("Dr. Jane Smith");
|
|
271
|
-
expect(citation.type).toBe("article");
|
|
272
|
-
expect(citation.source).toBe("Academic Journal");
|
|
273
|
-
expect(citation.url).toContain("artificial-intelligence");
|
|
274
|
-
// Test the plugin's response data extraction
|
|
275
|
-
const pluginData = clientCitationsPlugin.getResponseData(result);
|
|
276
|
-
expect(pluginData).toBeDefined();
|
|
277
|
-
expect(pluginData?.citations).toBeDefined();
|
|
278
|
-
expect(pluginData?.citationCount).toBe(1);
|
|
279
|
-
});
|
|
280
|
-
it("should extract multiple citations from tool responses", async () => {
|
|
281
|
-
// Call the research tool with multiple citations
|
|
282
|
-
const result = await dainConnection.callTool("research-tool", {
|
|
283
|
-
topic: "Machine Learning",
|
|
284
|
-
includeMultiple: true
|
|
285
|
-
});
|
|
286
|
-
// Use the CLIENT plugin helper to extract citations
|
|
287
|
-
const citations = clientCitationsPlugin.getCitationsFromResponse(result);
|
|
288
|
-
expect(citations.length).toBe(3);
|
|
289
|
-
// Verify each citation has required fields
|
|
290
|
-
citations.forEach(citation => {
|
|
291
|
-
expect(citation.id).toBeDefined();
|
|
292
|
-
expect(citation.ui).toBeDefined();
|
|
293
|
-
expect(typeof citation.id).toBe("string");
|
|
294
|
-
});
|
|
295
|
-
// Verify different citation types
|
|
296
|
-
const citationTypes = citations.map(c => c.type);
|
|
297
|
-
expect(citationTypes).toContain("article");
|
|
298
|
-
expect(citationTypes).toContain("report");
|
|
299
|
-
expect(citationTypes).toContain("book");
|
|
300
|
-
// Test content with citations extraction
|
|
301
|
-
const contentWithCitations = clientCitationsPlugin.getContentWithCitationsFromResponse(result);
|
|
302
|
-
expect(contentWithCitations.length).toBe(3);
|
|
303
|
-
contentWithCitations.forEach(content => {
|
|
304
|
-
expect(content.content).toBeDefined();
|
|
305
|
-
expect(content.id).toBeDefined();
|
|
306
|
-
expect(content.citation).toBeDefined();
|
|
307
|
-
expect(typeof content.content).toBe("string");
|
|
308
|
-
});
|
|
309
|
-
});
|
|
310
|
-
it("should extract citations from mixed content structures", async () => {
|
|
311
|
-
// Call the mixed content tool
|
|
312
|
-
const result = await dainConnection.callTool("mixed-content-tool", {
|
|
313
|
-
query: "Data Science"
|
|
314
|
-
});
|
|
315
|
-
// Extract citations from the mixed content
|
|
316
|
-
const citations = clientCitationsPlugin.getCitationsFromResponse(result);
|
|
317
|
-
console.log("[CLIENT] Citations from mixed content:", JSON.stringify(citations, null, 2));
|
|
318
|
-
// Should find citations even in nested structures
|
|
319
|
-
expect(citations.length).toBe(2);
|
|
320
|
-
// Verify the citations were found correctly
|
|
321
|
-
const citationTitles = citations.map(c => c.title);
|
|
322
|
-
expect(citationTitles).toContain("Authority on Data Science");
|
|
323
|
-
expect(citationTitles).toContain("Evidence for Data Science");
|
|
324
|
-
// Test content with citations extraction
|
|
325
|
-
const contentWithCitations = clientCitationsPlugin.getContentWithCitationsFromResponse(result);
|
|
326
|
-
expect(contentWithCitations.length).toBe(2);
|
|
327
|
-
// Verify the plugin data
|
|
328
|
-
const pluginData = clientCitationsPlugin.getResponseData(result);
|
|
329
|
-
expect(pluginData?.citationCount).toBe(2);
|
|
330
|
-
expect(pluginData?.citations?.length).toBe(2);
|
|
331
|
-
expect(pluginData?.contentWithCitations?.length).toBe(2);
|
|
332
|
-
});
|
|
333
|
-
it("should find specific citations by ID", async () => {
|
|
334
|
-
// Call the research tool
|
|
335
|
-
const result = await dainConnection.callTool("research-tool", {
|
|
336
|
-
topic: "Neural Networks",
|
|
337
|
-
includeMultiple: true
|
|
338
|
-
});
|
|
339
|
-
// Extract all citations
|
|
340
|
-
const citations = clientCitationsPlugin.getCitationsFromResponse(result);
|
|
341
|
-
expect(citations.length).toBe(3);
|
|
342
|
-
// Get a specific citation by ID
|
|
343
|
-
const firstCitationId = citations[0].id;
|
|
344
|
-
const foundCitation = clientCitationsPlugin.getCitationById(result, firstCitationId);
|
|
345
|
-
expect(foundCitation).toBeDefined();
|
|
346
|
-
expect(foundCitation?.id).toBe(firstCitationId);
|
|
347
|
-
expect(foundCitation?.title).toContain("Neural Networks");
|
|
348
|
-
// Test with non-existent ID
|
|
349
|
-
const nonExistentCitation = clientCitationsPlugin.getCitationById(result, "non-existent-id");
|
|
350
|
-
expect(nonExistentCitation).toBeUndefined();
|
|
351
|
-
});
|
|
352
|
-
it("should format citations for display", async () => {
|
|
353
|
-
// Call the research tool
|
|
354
|
-
const result = await dainConnection.callTool("research-tool", {
|
|
355
|
-
topic: "Deep Learning",
|
|
356
|
-
includeMultiple: true
|
|
357
|
-
});
|
|
358
|
-
// Extract citations
|
|
359
|
-
const citations = clientCitationsPlugin.getCitationsFromResponse(result);
|
|
360
|
-
// Format citations for display
|
|
361
|
-
const formattedCitations = clientCitationsPlugin.formatCitations(citations);
|
|
362
|
-
expect(formattedCitations.length).toBe(3);
|
|
363
|
-
// Verify formatting includes key information
|
|
364
|
-
formattedCitations.forEach(formatted => {
|
|
365
|
-
expect(typeof formatted).toBe("string");
|
|
366
|
-
expect(formatted.length).toBeGreaterThan(0);
|
|
367
|
-
});
|
|
368
|
-
// Check that the first citation contains expected elements
|
|
369
|
-
const firstFormatted = formattedCitations[0];
|
|
370
|
-
expect(firstFormatted).toContain("Research on Deep Learning");
|
|
371
|
-
expect(firstFormatted).toContain("Dr. Jane Smith");
|
|
372
|
-
expect(firstFormatted).toContain("Academic Journal");
|
|
373
|
-
expect(firstFormatted).toContain("2024-01-10");
|
|
374
|
-
});
|
|
375
|
-
it("should group citations by type", async () => {
|
|
376
|
-
// Call the research tool with multiple types
|
|
377
|
-
const result = await dainConnection.callTool("research-tool", {
|
|
378
|
-
topic: "Computer Vision",
|
|
379
|
-
includeMultiple: true
|
|
380
|
-
});
|
|
381
|
-
// Extract citations
|
|
382
|
-
const citations = clientCitationsPlugin.getCitationsFromResponse(result);
|
|
383
|
-
// Group citations by type
|
|
384
|
-
const groupedCitations = clientCitationsPlugin.groupCitationsByType(citations);
|
|
385
|
-
console.log("[CLIENT] Grouped citations:", JSON.stringify(groupedCitations, null, 2));
|
|
386
|
-
// Verify grouping
|
|
387
|
-
expect(groupedCitations).toBeDefined();
|
|
388
|
-
expect(Object.keys(groupedCitations).length).toBeGreaterThan(1);
|
|
389
|
-
// Check specific groups
|
|
390
|
-
expect(groupedCitations["article"]).toBeDefined();
|
|
391
|
-
expect(groupedCitations["report"]).toBeDefined();
|
|
392
|
-
expect(groupedCitations["book"]).toBeDefined();
|
|
393
|
-
// Verify each group contains the right citations
|
|
394
|
-
expect(groupedCitations["article"].length).toBe(1);
|
|
395
|
-
expect(groupedCitations["report"].length).toBe(1);
|
|
396
|
-
expect(groupedCitations["book"].length).toBe(1);
|
|
397
|
-
});
|
|
398
|
-
it("should handle responses with no citations gracefully", async () => {
|
|
399
|
-
// Create a simple tool that doesn't produce citations
|
|
400
|
-
const noCitationsTool = (0, core_1.createTool)({
|
|
401
|
-
id: "no-citations-tool",
|
|
402
|
-
name: "No Citations Tool",
|
|
403
|
-
description: "Tool that produces content without citations",
|
|
404
|
-
input: zod_1.z.object({ message: zod_1.z.string() }),
|
|
405
|
-
output: zod_1.z.object({ response: zod_1.z.string() }),
|
|
406
|
-
handler: async ({ message }) => {
|
|
407
|
-
return {
|
|
408
|
-
text: `Response to: ${message}`,
|
|
409
|
-
data: {
|
|
410
|
-
response: `This is a simple response to "${message}" without any citations.`
|
|
411
|
-
},
|
|
412
|
-
ui: null
|
|
413
|
-
};
|
|
414
|
-
},
|
|
415
|
-
});
|
|
416
|
-
// Add the tool to our service temporarily for this test
|
|
417
|
-
// We'll simulate calling it by creating a mock response
|
|
418
|
-
const mockResponse = {
|
|
419
|
-
text: "Response to: test message",
|
|
420
|
-
data: {
|
|
421
|
-
response: "This is a simple response without any citations."
|
|
422
|
-
},
|
|
423
|
-
ui: null,
|
|
424
|
-
plugins: {
|
|
425
|
-
"citations-plugin": {
|
|
426
|
-
citations: [],
|
|
427
|
-
citationCount: 0
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
};
|
|
431
|
-
// Test extraction from response with no citations
|
|
432
|
-
const citations = clientCitationsPlugin.getCitationsFromResponse(mockResponse);
|
|
433
|
-
expect(citations).toBeDefined();
|
|
434
|
-
expect(citations.length).toBe(0);
|
|
435
|
-
const contentWithCitations = clientCitationsPlugin.getContentWithCitationsFromResponse(mockResponse);
|
|
436
|
-
expect(contentWithCitations).toBeDefined();
|
|
437
|
-
expect(contentWithCitations.length).toBe(0);
|
|
438
|
-
// Test plugin data
|
|
439
|
-
const pluginData = clientCitationsPlugin.getResponseData(mockResponse);
|
|
440
|
-
expect(pluginData?.citationCount).toBe(0);
|
|
441
|
-
expect(pluginData?.citations).toEqual([]);
|
|
442
|
-
});
|
|
443
|
-
it("should demonstrate direct citation extraction methods", async () => {
|
|
444
|
-
// Create test data structures with citations
|
|
445
|
-
const testData = {
|
|
446
|
-
articles: [
|
|
447
|
-
{
|
|
448
|
-
content: "Test content 1",
|
|
449
|
-
id: "test-1",
|
|
450
|
-
citation: {
|
|
451
|
-
id: "citation-test-1",
|
|
452
|
-
ui: { type: "citation", title: "Test Citation 1" },
|
|
453
|
-
title: "Test Citation 1",
|
|
454
|
-
author: "Test Author 1",
|
|
455
|
-
type: "article",
|
|
456
|
-
source: "Test Source 1"
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
],
|
|
460
|
-
metadata: {
|
|
461
|
-
nested: {
|
|
462
|
-
references: [
|
|
463
|
-
{
|
|
464
|
-
citation: {
|
|
465
|
-
id: "citation-test-2",
|
|
466
|
-
ui: { type: "citation", title: "Test Citation 2" },
|
|
467
|
-
title: "Test Citation 2",
|
|
468
|
-
author: "Test Author 2",
|
|
469
|
-
type: "book",
|
|
470
|
-
source: "Test Source 2"
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
]
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
};
|
|
477
|
-
// Test direct extraction methods
|
|
478
|
-
const extractedCitations = clientCitationsPlugin.extractCitations(testData);
|
|
479
|
-
expect(extractedCitations.length).toBe(2);
|
|
480
|
-
const extractedContent = clientCitationsPlugin.extractContentWithCitations(testData);
|
|
481
|
-
expect(extractedContent.length).toBe(1);
|
|
482
|
-
expect(extractedContent[0].content).toBe("Test content 1");
|
|
483
|
-
expect(extractedContent[0].citation.title).toBe("Test Citation 1");
|
|
484
|
-
// Test with null/undefined data
|
|
485
|
-
const emptyCitations = clientCitationsPlugin.extractCitations(null);
|
|
486
|
-
expect(emptyCitations.length).toBe(0);
|
|
487
|
-
const emptyContent = clientCitationsPlugin.extractContentWithCitations(undefined);
|
|
488
|
-
expect(emptyContent.length).toBe(0);
|
|
489
|
-
});
|
|
490
|
-
});
|
|
491
|
-
//# sourceMappingURL=citations-plugin.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"citations-plugin.test.js","sourceRoot":"","sources":["../../src/__tests__/citations-plugin.test.ts"],"names":[],"mappings":";AAAA,+CAA+C;;;AAE/C,sDAAsD;AACtD,4CAAwD;AACxD,mDAAgD;AAChD,wDAAwB;AACxB,uDAA0D;AAC1D,yCAA4C;AAC5C,6BAAwB;AACxB,iEAA4F;AAE5F,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACrD,qBAAqB;IACrB,MAAM,iBAAiB,GAAG,iBAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAC3D,MAAM,gBAAgB,GAAG,iBAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;IACjE,MAAM,cAAc,GAAG,cAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACr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