@jskit-ai/assistant-core 0.1.181 → 0.1.182

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.181",
12
- "@jskit-ai/http-runtime": "0.1.201",
13
- "@jskit-ai/kernel": "0.1.203",
11
+ "@jskit-ai/assistant-core": "0.1.182",
12
+ "@jskit-ai/http-runtime": "0.1.202",
13
+ "@jskit-ai/kernel": "0.1.204",
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.20",
18
- "@jskit-ai/connectors-catalog": "0.1.20"
17
+ "@jskit-ai/connectors-core": "0.1.21",
18
+ "@jskit-ai/connectors-catalog": "0.1.21"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@vitejs/plugin-vue": "^6.0.7",
@@ -4,6 +4,8 @@ import AssistantConversationElement from "../../src/client/conversation/Assistan
4
4
  import { useAssistantAttachments } from "../../src/client/conversation/useAssistantAttachments.js";
5
5
  import { useAssistantSuggestions } from "../../src/client/conversation/useAssistantSuggestions.js";
6
6
  const phase = ref("idle");
7
+ const attribution = new URLSearchParams(location.search).has("attribution");
8
+ const assistantLabel = ref("Current assistant");
7
9
  const draft = ref("");
8
10
  const narrow = ref(false);
9
11
  const submissions = ref(0);
@@ -51,7 +53,17 @@ const goalState = reactive({
51
53
  resume() { goal.value = { ...goal.value, status: "active", sampledAt: Date.now() }; }
52
54
  });
53
55
  const adapter = reactive({
54
- conversation: { turns: [], visible: true, scrollKey: "fixture", welcomeMessage: "Composer responsiveness fixture" },
56
+ conversation: {
57
+ assistantLabel,
58
+ turns: attribution ? [
59
+ { turnId: "one", assistantLabel: "First assistant", assistantDetails: "First model",
60
+ assistant: { role: "assistant", text: "First answer" } },
61
+ { turnId: "two", assistantLabel: "Second assistant", assistantDetails: "Second model",
62
+ assistant: { role: "assistant", text: "Second answer", assistantLabel: "Message assistant", assistantDetails: "Message model" } },
63
+ { turnId: "three", assistant: { role: "assistant", text: "Unattributed answer" } }
64
+ ] : [],
65
+ visible: true, scrollKey: "fixture", welcomeMessage: "Composer responsiveness fixture"
66
+ },
55
67
  composer: {
56
68
  draft,
57
69
  rows: 2,
@@ -76,6 +88,7 @@ const adapter = reactive({
76
88
  <v-app>
77
89
  <v-main>
78
90
  <div class="controls">
91
+ <button v-if="attribution" @click="assistantLabel = 'Next assistant'">Change assistant</button>
79
92
  <button v-for="state in ['idle', 'active', 'reconnecting', 'stopping', 'stopped']" :key="state" @click="phase = state">External {{ state }}</button>
80
93
  <button @click="narrow = !narrow">Resize pane</button>
81
94
  <button @click="feedback = !feedback">Toggle action feedback</button>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/assistant-core",
3
- "version": "0.1.181",
3
+ "version": "0.1.182",
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.145",
38
- "@jskit-ai/resource-crud-core": "0.1.145",
37
+ "@jskit-ai/resource-core": "0.1.146",
38
+ "@jskit-ai/resource-crud-core": "0.1.146",
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.201",
48
- "@jskit-ai/kernel": "0.1.203",
47
+ "@jskit-ai/http-runtime": "0.1.202",
48
+ "@jskit-ai/kernel": "0.1.204",
49
49
  "vue": "^3.5.13",
50
50
  "vuetify": "^4.0.0"
51
51
  },
@@ -197,7 +197,7 @@
197
197
  :messages="entry.messages"
198
198
  :pending="isWorking && entry === displayEntries.at(-1)"
199
199
  :preview-limit="progressPreviewLimit"
200
- :aria-label="`${assistantLabel} progress`"
200
+ :aria-label="`${entry.turn.assistantLabel || assistantLabel} progress`"
201
201
  />
202
202
  <div
203
203
  v-else
@@ -209,7 +209,9 @@
209
209
  <v-icon :icon="mdiRobotOutline" size="16" />
210
210
  </span>
211
211
  <div class="assistant-transcript__message-header">
212
- <span>{{ assistantLabel }}</span>
212
+ <span :title="entry.message.assistantDetails || entry.turn.assistantDetails || undefined">
213
+ {{ entry.message.assistantLabel || entry.turn.assistantLabel || assistantLabel }}
214
+ </span>
213
215
  </div>
214
216
  </div>
215
217
  <div class="assistant-transcript__message assistant-transcript__message--assistant">
@@ -22,6 +22,26 @@ const VIEWPORTS = Object.freeze([
22
22
  Object.freeze({ name: "drawer", width: 360, height: 600 })
23
23
  ]);
24
24
 
25
+ test("saved reply attribution remains when the current assistant changes", {
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
+ const page = await browser.newPage();
32
+ await page.goto(`${vite.baseURL}/?conversation=1&attribution=1`);
33
+ const names = page.locator('[data-message-role="assistant"] .assistant-transcript__message-header span');
34
+ await expect(names).toHaveText(["First assistant", "Message assistant", "Current assistant"]);
35
+ await expect(names.nth(0)).toHaveAttribute("title", "First model");
36
+ await expect(names.nth(1)).toHaveAttribute("title", "Message model");
37
+ await page.getByRole("button", { name: "Change assistant", exact: true }).click();
38
+ await expect(names).toHaveText(["First assistant", "Message assistant", "Next assistant"]);
39
+ } finally {
40
+ await browser.close();
41
+ await stopProcess(vite);
42
+ }
43
+ });
44
+
25
45
  test("streaming answers grow in one bubble, preserve drafts and settle once at every width", {
26
46
  skip: !RUN_BROWSER_TEST, timeout: 90_000
27
47
  }, async () => {