@jskit-ai/assistant-core 0.1.195 → 0.1.196
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.
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
"build": "vite build"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@jskit-ai/assistant-core": "0.1.
|
|
12
|
-
"@jskit-ai/http-runtime": "0.1.
|
|
13
|
-
"@jskit-ai/kernel": "0.1.
|
|
11
|
+
"@jskit-ai/assistant-core": "0.1.196",
|
|
12
|
+
"@jskit-ai/http-runtime": "0.1.216",
|
|
13
|
+
"@jskit-ai/kernel": "0.1.218",
|
|
14
14
|
"@mdi/js": "^7.4.47",
|
|
15
15
|
"vue": "^3.5.13",
|
|
16
16
|
"vuetify": "^4.0.0",
|
|
17
|
-
"@jskit-ai/connectors-core": "0.1.
|
|
18
|
-
"@jskit-ai/connectors-catalog": "0.1.
|
|
17
|
+
"@jskit-ai/connectors-core": "0.1.35",
|
|
18
|
+
"@jskit-ai/connectors-catalog": "0.1.35"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
@@ -10,6 +10,9 @@ const combined = ref(false);
|
|
|
10
10
|
const messages = ref([1, 2, 3].map(index => ({
|
|
11
11
|
messageId: `progress-${index}`, role: "thinking", text: `Reasoning ${index}`
|
|
12
12
|
})));
|
|
13
|
+
if (new URLSearchParams(location.search).has("detail")) {
|
|
14
|
+
messages.value = [{ messageId: "raw-first", role: "thinking", text: "Full reasoning before the update", preview: false }];
|
|
15
|
+
}
|
|
13
16
|
let sequence = 3;
|
|
14
17
|
function append(role) {
|
|
15
18
|
sequence += 1;
|
|
@@ -47,6 +50,8 @@ const adapter = computed(() => ({
|
|
|
47
50
|
<button @click="combined = !combined">Change storage rows</button>
|
|
48
51
|
<button @click="scope = scope === 'first' ? 'second' : 'first'">Change conversation</button>
|
|
49
52
|
<button v-for="role in ['thinking', 'commentary', 'assistant', 'user', 'system']" :key="role" @click="append(role)">Append {{ role }}</button>
|
|
53
|
+
<button @click="messages.push({ messageId: `summary-${sequence++}`, role: 'thinking', text: 'Checking the sources.' })">Add preview</button>
|
|
54
|
+
<button @click="messages.push({ messageId: `detail-${sequence++}`, role: 'thinking', text: 'Full reasoning after the update', preview: false })">Add detail</button>
|
|
50
55
|
</nav>
|
|
51
56
|
<AssistantConversationElement :adapter="adapter" />
|
|
52
57
|
</main>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/assistant-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.196",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node --test"
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@ai-sdk/perplexity": "^4.0.43",
|
|
35
35
|
"@ai-sdk/togetherai": "^3.0.49",
|
|
36
36
|
"@ai-sdk/xai": "^4.0.58",
|
|
37
|
-
"@jskit-ai/resource-core": "0.1.
|
|
38
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
37
|
+
"@jskit-ai/resource-core": "0.1.160",
|
|
38
|
+
"@jskit-ai/resource-crud-core": "0.1.160",
|
|
39
39
|
"@mdi/js": "^7.4.47",
|
|
40
40
|
"@openrouter/ai-sdk-provider": "^3.0.0",
|
|
41
41
|
"ai": "^7.0.101",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"ws": "^8.20.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@jskit-ai/http-runtime": "0.1.
|
|
48
|
-
"@jskit-ai/kernel": "0.1.
|
|
47
|
+
"@jskit-ai/http-runtime": "0.1.216",
|
|
48
|
+
"@jskit-ai/kernel": "0.1.218",
|
|
49
49
|
"vue": "^3.5.13",
|
|
50
50
|
"vuetify": "^4.0.0"
|
|
51
51
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="assistant-progress">
|
|
3
3
|
<button
|
|
4
|
-
v-if="messages.length >
|
|
4
|
+
v-if="expanded || messages.length > previewMessages.length"
|
|
5
5
|
:aria-expanded="expanded"
|
|
6
6
|
class="assistant-progress__toggle"
|
|
7
7
|
type="button"
|
|
@@ -29,16 +29,20 @@ const props = defineProps({
|
|
|
29
29
|
});
|
|
30
30
|
const expanded = ref(false);
|
|
31
31
|
const previewCount = computed(() => props.pending ? props.previewLimit : 0);
|
|
32
|
+
// Applications may retain detailed progress for expansion without previewing it.
|
|
33
|
+
const previewMessages = computed(() => previewCount.value > 0
|
|
34
|
+
? props.messages.filter(message => message.preview !== false).slice(-previewCount.value)
|
|
35
|
+
: []);
|
|
32
36
|
const visibleMessages = computed(() => {
|
|
33
37
|
if (expanded.value) {
|
|
34
38
|
return props.messages;
|
|
35
39
|
}
|
|
36
|
-
return
|
|
40
|
+
return previewMessages.value;
|
|
37
41
|
});
|
|
38
42
|
const toggleLabel = computed(() => {
|
|
39
43
|
if (expanded.value) {
|
|
40
|
-
return
|
|
41
|
-
? `Show latest ${
|
|
44
|
+
return previewMessages.value.length > 0
|
|
45
|
+
? `Show latest ${previewMessages.value.length} progress ${previewMessages.value.length === 1 ? "update" : "updates"}`
|
|
42
46
|
: "Hide progress updates";
|
|
43
47
|
}
|
|
44
48
|
return `Show all ${props.messages.length} progress ${props.messages.length === 1 ? "update" : "updates"}`;
|
|
@@ -22,6 +22,40 @@ const VIEWPORTS = Object.freeze([
|
|
|
22
22
|
Object.freeze({ name: "drawer", width: 360, height: 600 })
|
|
23
23
|
]);
|
|
24
24
|
|
|
25
|
+
test("progress previews omit expandable details without hiding the current update", {
|
|
26
|
+
skip: !RUN_BROWSER_TEST, timeout: 60_000
|
|
27
|
+
}, async () => {
|
|
28
|
+
const vite = await startViteFixture({ fixtureRoot: FIXTURE_ROOT });
|
|
29
|
+
const browser = await chromium.launch(createChromiumLaunchOptions());
|
|
30
|
+
try {
|
|
31
|
+
for (const width of [390, 800, 1365]) {
|
|
32
|
+
const page = await browser.newPage({ viewport: { width, height: 900 } });
|
|
33
|
+
await page.goto(`${vite.baseURL}/?progress=1&detail=1`);
|
|
34
|
+
const messages = page.locator(".assistant-progress__message");
|
|
35
|
+
await expect(messages).toHaveCount(0);
|
|
36
|
+
const toggle = page.locator(".assistant-progress__toggle");
|
|
37
|
+
await expect(toggle).toHaveText("Show all 1 progress update");
|
|
38
|
+
await page.getByRole("button", { name: "Add preview", exact: true }).click();
|
|
39
|
+
await page.getByRole("button", { name: "Add detail", exact: true }).click();
|
|
40
|
+
await expect(messages).toHaveText(["Checking the sources."]);
|
|
41
|
+
await toggle.click();
|
|
42
|
+
await expect(messages).toHaveText(["Full reasoning before the update", "Checking the sources.", "Full reasoning after the update"]);
|
|
43
|
+
await expect(toggle).toHaveAttribute("aria-expanded", "true");
|
|
44
|
+
await toggle.click();
|
|
45
|
+
await expect(messages).toHaveText(["Checking the sources."]);
|
|
46
|
+
await page.getByRole("button", { name: "Toggle working", exact: true }).click();
|
|
47
|
+
await expect(messages).toHaveCount(0);
|
|
48
|
+
await toggle.click();
|
|
49
|
+
await expect(messages).toHaveCount(3);
|
|
50
|
+
assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth));
|
|
51
|
+
await page.close();
|
|
52
|
+
}
|
|
53
|
+
} finally {
|
|
54
|
+
await browser.close();
|
|
55
|
+
await stopProcess(vite);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
25
59
|
test("saved reply attribution remains when the current assistant changes", {
|
|
26
60
|
skip: !RUN_BROWSER_TEST, timeout: 60_000
|
|
27
61
|
}, async () => {
|