@intelliweave/embedded 2.0.72-beta.5 → 2.0.72-beta.7
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/component/chunk-FSRPMVAS.js +1 -0
- package/dist/component/component.d.ts +77 -0
- package/dist/component/component.js +265 -47
- package/dist/component/ort-wasm-simd-threaded.wasm +0 -0
- package/dist/component/ort.bundle.min-5QOPZPPI.js +1834 -0
- package/dist/intelliweave-wordpress.zip +0 -0
- package/dist/node/node.d.ts +78 -1
- package/dist/node/node.js +22 -15
- package/dist/react/react.d.ts +73 -0
- package/dist/react/react.js +141 -33
- package/dist/script-tag/script-tag.js +176 -68
- package/dist/webpack/index.d.ts +78 -1
- package/dist/webpack/index.js +144 -36
- package/package.json +1 -1
- package/tests/common.html +357 -0
- package/tests/fullscreen.html +37 -0
- package/tests/images.html +35 -0
- package/tests/index.html +32 -0
- package/tests/local-hub.html +34 -0
- package/tests/subagents.html +128 -0
- package/vitest.config.ts +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Test Page</title>
|
|
7
|
+
<!-- Include Materialize CSS, or comment it out if you don't want it -->
|
|
8
|
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css" rel="stylesheet">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
|
|
12
|
+
<h1 id='header' data-ww-describe>Number calculator</h1>
|
|
13
|
+
<p id='subtitle' data-ww-describe>This tool lets you add two numbers together.</p>
|
|
14
|
+
<input id='num1' type="number" placeholder="First number" data-ww-describe="First number field" /> +
|
|
15
|
+
<input id='num2' type="number" placeholder="Second number" data-ww-describe="Second number field" /> =
|
|
16
|
+
<input id='result' type="number" placeholder="Result" disabled data-ww-describe="Result field" />
|
|
17
|
+
<input id='add' type="button" value="Add" data-ww-describe="Click this to add the numbers." />
|
|
18
|
+
<script>
|
|
19
|
+
document.getElementById('add').addEventListener('click', function() {
|
|
20
|
+
var num1 = parseFloat(document.getElementById('num1').value) || 0
|
|
21
|
+
var num2 = parseFloat(document.getElementById('num2').value) || 0
|
|
22
|
+
document.getElementById('result').value = num1 + num2;
|
|
23
|
+
})
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<!-- Document test -->
|
|
27
|
+
<h1>Document Generation</h1>
|
|
28
|
+
<button onclick="generateDoc()">Generate document</button>
|
|
29
|
+
<hr/>
|
|
30
|
+
<div id='gen-doc'></div>
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/showdown@2.1.0/dist/showdown.min.js"></script>
|
|
32
|
+
<script>
|
|
33
|
+
async function generateDoc() {
|
|
34
|
+
|
|
35
|
+
// Prompt
|
|
36
|
+
let txt = prompt("Enter query:")
|
|
37
|
+
if (!txt)
|
|
38
|
+
return
|
|
39
|
+
|
|
40
|
+
// Write to document
|
|
41
|
+
document.getElementById('gen-doc').innerText = 'Loading...'
|
|
42
|
+
|
|
43
|
+
// Catch errors
|
|
44
|
+
try {
|
|
45
|
+
|
|
46
|
+
// Generate doc
|
|
47
|
+
let markdown = await window.intelliweave.embed.ai.logic.generateMarkdown(txt)
|
|
48
|
+
|
|
49
|
+
// Convert to HTML
|
|
50
|
+
var html = new showdown.Converter().makeHtml(markdown)
|
|
51
|
+
|
|
52
|
+
// Write to document
|
|
53
|
+
document.getElementById('gen-doc').innerHTML = html
|
|
54
|
+
|
|
55
|
+
} catch (err) {
|
|
56
|
+
|
|
57
|
+
// Log error
|
|
58
|
+
console.error(err)
|
|
59
|
+
document.getElementById('gen-doc').innerText = 'Error: ' + err.message
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
65
|
+
<input id="input-question" type="text" placeholder="Enter question" />
|
|
66
|
+
<input id="input-data" type="text" placeholder="Enter data" />
|
|
67
|
+
<input id="input-options" type="text" placeholder="Enter array of options seperated by a comma" />
|
|
68
|
+
<button onclick="processChooseOption()">processChooseOption</button>
|
|
69
|
+
<script>
|
|
70
|
+
async function processChooseOption(){
|
|
71
|
+
let question = document.getElementById('input-question').value
|
|
72
|
+
let data = document.getElementById('input-data').value
|
|
73
|
+
let options = document.getElementById('input-options').value.split(',')
|
|
74
|
+
let response = await window.intelliweave.embed.ai.logic.choose(question, data, options)
|
|
75
|
+
console.log(response)
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<h1>Choose (multiple choice)</h1>
|
|
81
|
+
|
|
82
|
+
<div class="input-field">
|
|
83
|
+
<input id="input-question" type="text" class="validate" />
|
|
84
|
+
<label for="input-question">Enter Question</label>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="input-field">
|
|
87
|
+
<textarea id="input-data" class="materialize-textarea"></textarea>
|
|
88
|
+
<label for="input-data">Enter Data</label>
|
|
89
|
+
</div>
|
|
90
|
+
<!-- Material checkbox field, use ;; to seperate options -->
|
|
91
|
+
<label style="margin-top: 20px">
|
|
92
|
+
<input type="checkbox" id="separate-option"/>
|
|
93
|
+
<span>To seperate with ';;' instead</span>
|
|
94
|
+
</label>
|
|
95
|
+
|
|
96
|
+
<div class="input-field" style="margin-top: 30px">
|
|
97
|
+
<textarea id="input-options" class="materialize-textarea">
|
|
98
|
+
Input Options</textarea
|
|
99
|
+
>
|
|
100
|
+
<label id = 'options-label' for="input-options">Enter Options (comma separated)</label>
|
|
101
|
+
</div>
|
|
102
|
+
<script>
|
|
103
|
+
document.getElementById('separate-option').addEventListener('change', (e) => {
|
|
104
|
+
document.getElementById('options-label').textContent =
|
|
105
|
+
e.target.checked ? "Enter Options ( ;; separated)" : "Enter Options (comma separated)";
|
|
106
|
+
});
|
|
107
|
+
</script>
|
|
108
|
+
<button
|
|
109
|
+
class="btn waves-effect waves-light"
|
|
110
|
+
onclick="processChooseOption()"
|
|
111
|
+
>
|
|
112
|
+
Process
|
|
113
|
+
</button>
|
|
114
|
+
<div class="input-field" style="margin-top: 20px">
|
|
115
|
+
<textarea id="output" class="materialize-textarea" readonly>
|
|
116
|
+
Output</textarea
|
|
117
|
+
>
|
|
118
|
+
<label for="output">Output</label>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<!-- Include Materialize JS -->
|
|
122
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
|
|
123
|
+
<script>
|
|
124
|
+
async function processChooseOption() {
|
|
125
|
+
let question = document.getElementById("input-question").value;
|
|
126
|
+
let data = document.getElementById("input-data").value;
|
|
127
|
+
let separate = document.getElementById("separate-option").checked;
|
|
128
|
+
console.log(separate);
|
|
129
|
+
let options = separate ? document.getElementById("input-options").value.split(';;') : document.getElementById("input-options").value.split(',');
|
|
130
|
+
let response = await window.intelliweave.embed.ai.logic.choose(
|
|
131
|
+
question,
|
|
132
|
+
data,
|
|
133
|
+
options
|
|
134
|
+
);
|
|
135
|
+
console.log(response);
|
|
136
|
+
document.getElementById("output").value = response;
|
|
137
|
+
}
|
|
138
|
+
</script>
|
|
139
|
+
|
|
140
|
+
<!-- async extract(question: string, data: any, allowMultiple: boolean, extractions: { name: string, type: string, description?: string }[]) -->
|
|
141
|
+
<h1>Extract</h1>
|
|
142
|
+
<div class="input-field">
|
|
143
|
+
<input id="input-extract-question" type="text" class="validate" />
|
|
144
|
+
<label for="input-extract-question">Enter Question</label>
|
|
145
|
+
</div>
|
|
146
|
+
<div class="input-field">
|
|
147
|
+
<textarea id="input-extract-data" class="materialize-textarea"></textarea>
|
|
148
|
+
<label for="input-extract-data">Enter Data</label>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="input-field">
|
|
151
|
+
<textarea id="input-extract-extractions" class="materialize-textarea">
|
|
152
|
+
EXAMPLE:
|
|
153
|
+
[
|
|
154
|
+
{
|
|
155
|
+
"name": "name",
|
|
156
|
+
"type": "string",
|
|
157
|
+
"description": "Name of the person"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"name": "age",
|
|
161
|
+
"type": "number",
|
|
162
|
+
"description": "Age of the person"
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
</textarea
|
|
166
|
+
>
|
|
167
|
+
<label for="input-extract-extractions">Enter Extractions (name, type, description(optional)) </label>
|
|
168
|
+
</div>
|
|
169
|
+
<button
|
|
170
|
+
class="btn waves-effect waves-light"
|
|
171
|
+
onclick="processExtract()"
|
|
172
|
+
>
|
|
173
|
+
Process
|
|
174
|
+
</button>
|
|
175
|
+
|
|
176
|
+
<div class="input-field" style="margin-top: 20px">
|
|
177
|
+
<textarea id="output-extract" class="materialize-textarea" readonly style="height: auto;">
|
|
178
|
+
Output</textarea
|
|
179
|
+
>
|
|
180
|
+
<label for="output-extract">Output</label>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<script>
|
|
184
|
+
async function processExtract() {
|
|
185
|
+
let question = document.getElementById("input-extract-question").value;
|
|
186
|
+
let data = document.getElementById("input-extract-data").value;
|
|
187
|
+
let extractions = JSON.parse(
|
|
188
|
+
document.getElementById("input-extract-extractions").value
|
|
189
|
+
);
|
|
190
|
+
let response = await window.intelliweave.embed.ai.logic.extract(
|
|
191
|
+
question,
|
|
192
|
+
data,
|
|
193
|
+
false,
|
|
194
|
+
extractions
|
|
195
|
+
);
|
|
196
|
+
console.log(response);
|
|
197
|
+
let outputElement = document.getElementById("output-extract");
|
|
198
|
+
outputElement.value = JSON.stringify(
|
|
199
|
+
response
|
|
200
|
+
);
|
|
201
|
+
outputElement.style.height = "auto";
|
|
202
|
+
outputElement.style.height = outputElement.scrollHeight + "px";
|
|
203
|
+
|
|
204
|
+
}
|
|
205
|
+
</script>
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
<!-- Code -->
|
|
209
|
+
<script>
|
|
210
|
+
window.intelliweave = {
|
|
211
|
+
|
|
212
|
+
// API key overrides any manually set settings here
|
|
213
|
+
apiKey: '9adb5223-abd8-4145-bad7-85680f95532f', // <-- Cal - Correct key for this test app
|
|
214
|
+
// apiKey: 'b69348ad-fffd-4373-9800-43a63cfd6267', // <-- Pirate persona
|
|
215
|
+
// apiKey: '95f5e706-74a0-4af6-abdf-6f6c4760b4df', // <-- Localhost
|
|
216
|
+
// apiKey: '6a185968-e5bc-4cde-b3f8-5e8d63258f35', // <-- Nova
|
|
217
|
+
// apiKey: '6273e7d8-e29b-4dea-b5d9-eeac8730707d', // <-- OpenRouter - Gemini 3 Pro
|
|
218
|
+
// apiKey: '80d31824-ac2a-491d-8eec-b23126dea69c', // <-- Anthropic - Claude Haiku 4.5
|
|
219
|
+
// apiKey: 'a006b8a0-943a-403a-a405-f1137f9f0729', // <-- Anthropic - Claude Sonnet 4.5
|
|
220
|
+
// apiKey: '8a18af0e-a6b5-4147-97c4-0f7d68603559', // <-- Anthropic - Claude Opus 4.5
|
|
221
|
+
// apiKey: '725ed5ce-301e-4674-ab4d-26906f1b396b', // <-- Sebas (interactive fiction game test)
|
|
222
|
+
|
|
223
|
+
// Enable verbose logging
|
|
224
|
+
debug: true,
|
|
225
|
+
|
|
226
|
+
// Introduction details, controls the user's first interaction experience
|
|
227
|
+
// introductionMessage: 'Welcome to the number calculator! Would you like to know more about what it can do? Or maybe a guided tour?',
|
|
228
|
+
// introductionSuggestions: [
|
|
229
|
+
// 'Please tell me more',
|
|
230
|
+
// 'A guided tour please!'
|
|
231
|
+
// ],
|
|
232
|
+
|
|
233
|
+
// Knowledge base
|
|
234
|
+
knowledgeBase: [
|
|
235
|
+
|
|
236
|
+
// App details
|
|
237
|
+
{
|
|
238
|
+
id: 'app.info',
|
|
239
|
+
type: 'info',
|
|
240
|
+
name: 'App Info',
|
|
241
|
+
tags: 'app info, app details, app information, purpose, pricing, cost',
|
|
242
|
+
content: `
|
|
243
|
+
This app is called the Number Calculator. It's a simple app with two number fields and an Add button to add the
|
|
244
|
+
two numbers together. The purpose of this app is to test IntelliWeave, which is an AI tool with a variety of features.
|
|
245
|
+
There is also a Generate Doc button which uses the AI to generate a document based on what the user wants to know.
|
|
246
|
+
|
|
247
|
+
This app is free to use, but there is a Pro version for $4 per month. This gives you access to more features and
|
|
248
|
+
customer support.
|
|
249
|
+
`
|
|
250
|
+
},
|
|
251
|
+
|
|
252
|
+
// Tour
|
|
253
|
+
{
|
|
254
|
+
type: 'tour',
|
|
255
|
+
name: 'Calculator Tour',
|
|
256
|
+
content: `
|
|
257
|
+
Steps:
|
|
258
|
+
1. Focus the field #num1, suggest response "Continue", and ask the user to enter a number.
|
|
259
|
+
2. Focus the field #num2, suggest response "Continue", and ask the user to enter a number.
|
|
260
|
+
3. Focus the button #add, and tell them they can click it to get the result. This is the end of the tour.
|
|
261
|
+
`,
|
|
262
|
+
},
|
|
263
|
+
|
|
264
|
+
// Add action
|
|
265
|
+
{
|
|
266
|
+
id: 'add',
|
|
267
|
+
type: 'action',
|
|
268
|
+
name: 'Add numbers',
|
|
269
|
+
content: 'Adds the first and second number fields together using the on-screen calculator.',
|
|
270
|
+
parameters: [
|
|
271
|
+
{ name: 'num1', type: 'number', description: 'The first number to add.' },
|
|
272
|
+
{ name: 'num2', type: 'number', description: 'The second number to add.' },
|
|
273
|
+
],
|
|
274
|
+
action: params => {
|
|
275
|
+
document.getElementById('num1').value = params.num1
|
|
276
|
+
document.getElementById('num2').value = params.num2
|
|
277
|
+
document.getElementById('add').click()
|
|
278
|
+
return 'Result: ' + document.getElementById('result').value
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
// Function to focus a field
|
|
283
|
+
{
|
|
284
|
+
id: 'ui.focusElement',
|
|
285
|
+
type: 'action',
|
|
286
|
+
name: 'Focus on an element',
|
|
287
|
+
content: "Focuses and draws the user's attention to an HTML element on the page.",
|
|
288
|
+
isContext: true,
|
|
289
|
+
parameters: [
|
|
290
|
+
{ name: 'elementID', type: 'string', description: 'The HTML ID of the element to focus.' }
|
|
291
|
+
],
|
|
292
|
+
action: (params) => {
|
|
293
|
+
|
|
294
|
+
// Get element ID
|
|
295
|
+
let id = params.elementID || ""
|
|
296
|
+
if (id.startsWith('#')) id = id.substring(1)
|
|
297
|
+
if (!id)
|
|
298
|
+
throw new Error(`No element ID specified.`)
|
|
299
|
+
|
|
300
|
+
// Find the element
|
|
301
|
+
let element = document.getElementById(id)
|
|
302
|
+
if (!element)
|
|
303
|
+
throw new Error(`Could not find the element with ID "${id}".`)
|
|
304
|
+
|
|
305
|
+
// Scroll to the element
|
|
306
|
+
element.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' })
|
|
307
|
+
|
|
308
|
+
// Focus the element
|
|
309
|
+
intelliweave.embed.attr.focusID = id
|
|
310
|
+
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
|
|
314
|
+
],
|
|
315
|
+
|
|
316
|
+
// actions: {
|
|
317
|
+
|
|
318
|
+
// // Calculate function
|
|
319
|
+
// calculateAdd: {
|
|
320
|
+
// description: 'Uses the first and second number fields to calculate the result.',
|
|
321
|
+
// args: [{ name: 'num1', description: 'First number' }, { name: 'num2', description: 'Second number' }],
|
|
322
|
+
// action: ({num1, num2}) => {
|
|
323
|
+
// document.getElementById('num1').value = num1;
|
|
324
|
+
// document.getElementById('num2').value = num2;
|
|
325
|
+
// document.getElementById('add').click();
|
|
326
|
+
// return document.getElementById('result').value;
|
|
327
|
+
// }
|
|
328
|
+
// }
|
|
329
|
+
|
|
330
|
+
// }
|
|
331
|
+
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// Test for dynamically updated KB entries. This should count the number of KB interactions there have been.
|
|
335
|
+
// You can test this by continually asking "Please give me the value of test.counter without searching."
|
|
336
|
+
let counter = 0
|
|
337
|
+
function query(s) {
|
|
338
|
+
counter += 1
|
|
339
|
+
return [
|
|
340
|
+
{
|
|
341
|
+
id: 'test.counter',
|
|
342
|
+
type: 'info',
|
|
343
|
+
name: 'Counter',
|
|
344
|
+
tags: 'test, counter',
|
|
345
|
+
content: `Current counter value: ${counter}`
|
|
346
|
+
}
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
document.addEventListener('webweaver_kb_search', e => {
|
|
350
|
+
e.sources.push({ query })
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
</script>
|
|
354
|
+
<script src="../dist/script-tag/script-tag.js" type="module"></script>
|
|
355
|
+
|
|
356
|
+
</body>
|
|
357
|
+
</html>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>Test Page</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
|
|
10
|
+
<!-- Code -->
|
|
11
|
+
<script>
|
|
12
|
+
window.intelliweave = {
|
|
13
|
+
|
|
14
|
+
// API key overrides any manually set settings here
|
|
15
|
+
// apiKey: '9adb5223-abd8-4145-bad7-85680f95532f', // <-- Cal
|
|
16
|
+
// apiKey: 'b69348ad-fffd-4373-9800-43a63cfd6267', // <-- Pirate persona
|
|
17
|
+
// apiKey: '95f5e706-74a0-4af6-abdf-6f6c4760b4df', // <-- Localhost
|
|
18
|
+
// apiKey: '6a185968-e5bc-4cde-b3f8-5e8d63258f35', // <-- Nova
|
|
19
|
+
// apiKey: '6273e7d8-e29b-4dea-b5d9-eeac8730707d', // <-- OpenRouter - Gemini 3 Pro
|
|
20
|
+
// apiKey: '80d31824-ac2a-491d-8eec-b23126dea69c', // <-- Anthropic - Claude Haiku 4.5
|
|
21
|
+
// apiKey: 'a006b8a0-943a-403a-a405-f1137f9f0729', // <-- Anthropic - Claude Sonnet 4.5
|
|
22
|
+
// apiKey: '8a18af0e-a6b5-4147-97c4-0f7d68603559', // <-- Anthropic - Claude Opus 4.5
|
|
23
|
+
apiKey: '725ed5ce-301e-4674-ab4d-26906f1b396b', // <-- Sebas (interactive fiction game test)
|
|
24
|
+
|
|
25
|
+
// Enable verbose logging
|
|
26
|
+
debug: true,
|
|
27
|
+
|
|
28
|
+
// Enable fullscreen layout
|
|
29
|
+
layout: 'fullscreen',
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
</script>
|
|
34
|
+
<script src="../dist/script-tag/script-tag.js" type="module"></script>
|
|
35
|
+
|
|
36
|
+
</body>
|
|
37
|
+
</html>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>IntelliWeave – Subagents Test</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
|
|
10
|
+
<!-- Code -->
|
|
11
|
+
<script>
|
|
12
|
+
window.intelliweave = {
|
|
13
|
+
|
|
14
|
+
// API key
|
|
15
|
+
apiKey: 'fd6686cc-80e7-49c1-9b99-43dc1648fa50',
|
|
16
|
+
|
|
17
|
+
// Enable verbose logging
|
|
18
|
+
debug: true,
|
|
19
|
+
|
|
20
|
+
// Enable fullscreen layout
|
|
21
|
+
layout: 'fullscreen',
|
|
22
|
+
|
|
23
|
+
// Introduction details, controls the user's first interaction experience
|
|
24
|
+
// introductionMessage: 'Welcome to the <b>Subagent Test</b>.',
|
|
25
|
+
introductionSuggestions: [
|
|
26
|
+
'Tell me about Helderberg Winery Reserve 2023',
|
|
27
|
+
],
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
</script>
|
|
32
|
+
<script src="../dist/script-tag/script-tag.js" type="module"></script>
|
|
33
|
+
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
package/tests/index.html
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>IntelliWeave – Tests</title>
|
|
7
|
+
<style>
|
|
8
|
+
body { font-family: system-ui, sans-serif; max-width: 480px; margin: 60px auto; color: #222; }
|
|
9
|
+
h1 { font-size: 1.4rem; margin-bottom: 0.25rem; }
|
|
10
|
+
p.subtitle { color: #888; margin-top: 0; }
|
|
11
|
+
ul { list-style: none; padding: 0; }
|
|
12
|
+
li + li { margin-top: 8px; }
|
|
13
|
+
a { color: #0066cc; text-decoration: none; }
|
|
14
|
+
a:hover { text-decoration: underline; }
|
|
15
|
+
</style>
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
|
|
19
|
+
<h1>IntelliWeave Tests</h1>
|
|
20
|
+
<p class="subtitle">Pick a test suite to run.</p>
|
|
21
|
+
|
|
22
|
+
<ul>
|
|
23
|
+
<li><a href="common.html">Common tests</a></li>
|
|
24
|
+
<li><a href="fullscreen.html">Fullscreen UI</a></li>
|
|
25
|
+
<li><a href="subagents.html">Subagents</a></li>
|
|
26
|
+
<li><a href="images.html">Images from the knowledge base</a></li>
|
|
27
|
+
<li><a href="local-hub.html">Connect to locally running hub instance</a></li>
|
|
28
|
+
<!-- Add new test pages here -->
|
|
29
|
+
</ul>
|
|
30
|
+
|
|
31
|
+
</body>
|
|
32
|
+
</html>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>IntelliWeave – Subagents Test</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
|
|
10
|
+
<!-- Code -->
|
|
11
|
+
<script>
|
|
12
|
+
window.intelliweave = {
|
|
13
|
+
|
|
14
|
+
// Enable verbose logging
|
|
15
|
+
debug: true,
|
|
16
|
+
|
|
17
|
+
// Introduction details, controls the user's first interaction experience
|
|
18
|
+
// introductionMessage: 'Welcome to the <b>Subagent Test</b>.',
|
|
19
|
+
introductionSuggestions: [
|
|
20
|
+
'Tell me about Helderberg Winery Reserve 2023',
|
|
21
|
+
],
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
</script>
|
|
26
|
+
<script src="../dist/component/component.js" type="module"></script>
|
|
27
|
+
<intelliweave-embed
|
|
28
|
+
apiKey='fd6686cc-80e7-49c1-9b99-43dc1648fa50'
|
|
29
|
+
hubAPI='http://localhost:3000/api'
|
|
30
|
+
layout='fullscreen'
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
</body>
|
|
34
|
+
</html>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>IntelliWeave – Subagents Test</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
|
|
10
|
+
<!-- Code -->
|
|
11
|
+
<script>
|
|
12
|
+
window.intelliweave = {
|
|
13
|
+
|
|
14
|
+
// API key
|
|
15
|
+
apiKey: '80d31824-ac2a-491d-8eec-b23126dea69c', // <-- Anthropic - Claude Haiku 4.5
|
|
16
|
+
|
|
17
|
+
// Enable verbose logging
|
|
18
|
+
debug: true,
|
|
19
|
+
|
|
20
|
+
// Enable fullscreen layout
|
|
21
|
+
layout: 'fullscreen',
|
|
22
|
+
|
|
23
|
+
// Introduction details, controls the user's first interaction experience
|
|
24
|
+
introductionMessage: 'Welcome to the <b>Subagent Test</b>.',
|
|
25
|
+
introductionSuggestions: [
|
|
26
|
+
'Please take me to my profile page.',
|
|
27
|
+
'What is my user ID?',
|
|
28
|
+
],
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
</script>
|
|
33
|
+
<script src="../dist/script-tag/script-tag.js" type="module"></script>
|
|
34
|
+
<script>
|
|
35
|
+
|
|
36
|
+
// Override for testing the subagents
|
|
37
|
+
window.addEventListener('load', () => {
|
|
38
|
+
|
|
39
|
+
// Remove existing knowledge
|
|
40
|
+
let ai = window.intelliweave.embed.ai
|
|
41
|
+
ai.knowledgeBase.reset()
|
|
42
|
+
|
|
43
|
+
// Add some new subagents
|
|
44
|
+
// Create a subagent which knows about page routes
|
|
45
|
+
const IW_TESTER_ANTHROPIC_KEY = 'a006b8a0-943a-403a-a405-f1137f9f0729'
|
|
46
|
+
ai.subAgents.register({
|
|
47
|
+
id: 'page-changer',
|
|
48
|
+
apiKey: IW_TESTER_ANTHROPIC_KEY,
|
|
49
|
+
clearExistingKnowledge: true,
|
|
50
|
+
usageInstructions: 'Use this tool to ask the page changer subagent questions about pages and to change the current page.',
|
|
51
|
+
knowledge: () => [
|
|
52
|
+
|
|
53
|
+
/** Available pages */
|
|
54
|
+
{
|
|
55
|
+
type: 'info',
|
|
56
|
+
isContext: true,
|
|
57
|
+
name: 'Page: Home',
|
|
58
|
+
content: 'Page URL: /home\nDescription: The homepage'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: 'info',
|
|
62
|
+
isContext: true,
|
|
63
|
+
name: 'Page: About',
|
|
64
|
+
content: 'Page URL: /about\nDescription: The about page'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'info',
|
|
68
|
+
isContext: true,
|
|
69
|
+
name: 'Page: Contact',
|
|
70
|
+
content: 'Page URL: /contact\nDescription: The contact page'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: 'info',
|
|
74
|
+
isContext: true,
|
|
75
|
+
name: 'Page: Profile',
|
|
76
|
+
content: 'Page URL: /profile?id=xxx\nDescription: The profile page for a specific user. Replace xxx with the user ID.',
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
/** Page changer */
|
|
80
|
+
{
|
|
81
|
+
type: 'action',
|
|
82
|
+
isContext: true,
|
|
83
|
+
name: 'Change Page',
|
|
84
|
+
content: 'Use this tool to change the current page route.',
|
|
85
|
+
parameters: [
|
|
86
|
+
{ type: 'string', name: 'route', description: 'The pathname/route of the page to change to' }
|
|
87
|
+
],
|
|
88
|
+
action: async (input, _ai) => {
|
|
89
|
+
console.log('CHANGED ROUTE: ', input.route)
|
|
90
|
+
alert(`Page changed to: ${input.route}`)
|
|
91
|
+
return `Page changed to ${input.route}`
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
]
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
// Create a subagent which knows about the current user
|
|
99
|
+
let didAskForUserID = false
|
|
100
|
+
let userID = "1224"
|
|
101
|
+
ai.subAgents.register({
|
|
102
|
+
id: 'user-info',
|
|
103
|
+
apiKey: IW_TESTER_ANTHROPIC_KEY,
|
|
104
|
+
clearExistingKnowledge: true,
|
|
105
|
+
usageInstructions: 'Use this tool to ask the user info subagent questions about the current user, including IDs.',
|
|
106
|
+
knowledge: () => [
|
|
107
|
+
|
|
108
|
+
/** User info */
|
|
109
|
+
{
|
|
110
|
+
type: 'action',
|
|
111
|
+
isContext: true,
|
|
112
|
+
name: 'Get User ID',
|
|
113
|
+
content: 'Use this tool to get the current user ID.',
|
|
114
|
+
action: async (input, _ai) => {
|
|
115
|
+
didAskForUserID = true
|
|
116
|
+
return `The current user ID is "${userID}"`
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
]
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
</script>
|
|
126
|
+
|
|
127
|
+
</body>
|
|
128
|
+
</html>
|
package/vitest.config.ts
CHANGED
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
test: {
|
|
6
6
|
|
|
7
7
|
// Allow longer timeouts, since AI takes a while to respond sometimes
|
|
8
|
-
testTimeout:
|
|
8
|
+
testTimeout: 5 * 60 * 1000,
|
|
9
9
|
|
|
10
10
|
// Default to sequential tests since Anthropic has rate limiting by IP
|
|
11
11
|
// Concurrent tests should be marked as so individually.
|