@jskit-ai/assistant-core 0.1.195 → 0.1.197

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.195",
12
- "@jskit-ai/http-runtime": "0.1.215",
13
- "@jskit-ai/kernel": "0.1.217",
11
+ "@jskit-ai/assistant-core": "0.1.197",
12
+ "@jskit-ai/http-runtime": "0.1.217",
13
+ "@jskit-ai/kernel": "0.1.219",
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.34",
18
- "@jskit-ai/connectors-catalog": "0.1.34"
17
+ "@jskit-ai/connectors-core": "0.1.36",
18
+ "@jskit-ai/connectors-catalog": "0.1.36"
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.195",
3
+ "version": "0.1.197",
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.159",
38
- "@jskit-ai/resource-crud-core": "0.1.159",
37
+ "@jskit-ai/resource-core": "0.1.161",
38
+ "@jskit-ai/resource-crud-core": "0.1.161",
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.215",
48
- "@jskit-ai/kernel": "0.1.217",
47
+ "@jskit-ai/http-runtime": "0.1.217",
48
+ "@jskit-ai/kernel": "0.1.219",
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 > previewCount"
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 previewCount.value > 0 ? props.messages.slice(-previewCount.value) : [];
40
+ return previewMessages.value;
37
41
  });
38
42
  const toggleLabel = computed(() => {
39
43
  if (expanded.value) {
40
- return previewCount.value > 0
41
- ? `Show latest ${previewCount.value} progress updates`
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"}`;
@@ -566,10 +566,17 @@ function codexAppServerProviderThreadTurn(value = {}, turnId = "") {
566
566
 
567
567
  function codexAppServerProviderTurnAssistantSegments(turn = {}) {
568
568
  const seenItemIds = new Set();
569
- return codexAppServerProviderTurnItems(turn)
570
- .filter((item) => {
569
+ const items = codexAppServerProviderTurnItems(turn);
570
+ // Providers without phases emit progress as ordinary assistant messages.
571
+ // Only the trailing response can be a final; reasoning/tools separate it
572
+ // from earlier updates. Explicit finals retain their native attribution.
573
+ let responseStart = items.length;
574
+ while (responseStart > 0 && codexAppServerAssistantItemText(items[responseStart - 1])) responseStart -= 1;
575
+ const active = ["inProgress", "starting"].includes(codexAppServerStatusFromValue(turn.status));
576
+ return items
577
+ .filter((item, index) => {
571
578
  const phase = normalizeText(item.phase);
572
- return !phase || phase === "final_answer";
579
+ return phase === "final_answer" || (!phase && !active && index >= responseStart);
573
580
  })
574
581
  .map((item) => {
575
582
  const itemId = normalizeText(item.id);
@@ -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 () => {
@@ -0,0 +1,40 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+ import { codexAppServerProviderThreadAssistantSegments } from "../src/server/conversation/codexEvents.js";
4
+
5
+ test("phase-less Codex progress before tools does not become a final answer", () => {
6
+ const items = [
7
+ { type: "reasoning", id: "reasoning-1", content: ["Details"] },
8
+ { type: "agentMessage", id: "progress-1", text: "Checking sources." },
9
+ { type: "commandExecution", id: "tool-1" },
10
+ { type: "agentMessage", id: "progress-2", text: "Comparing prices." },
11
+ { type: "commandExecution", id: "tool-2" },
12
+ { type: "reasoning", id: "reasoning-2", content: ["More details"] },
13
+ { type: "agentMessage", id: "answer-1", text: "The answer." },
14
+ { type: "agentMessage", id: "answer-2", text: "Supporting sources." }
15
+ ];
16
+ const segments = (status, count = items.length) => codexAppServerProviderThreadAssistantSegments({
17
+ turns: [{ id: "turn", status, items: items.slice(0, count) }]
18
+ }, "turn");
19
+ assert.deepEqual(segments("inProgress"), []);
20
+ assert.deepEqual(segments("failed", 5), [], "a failed tool cannot turn earlier progress into an answer");
21
+ assert.deepEqual(segments("completed"), [
22
+ { itemId: "answer-1", text: "The answer." },
23
+ { itemId: "answer-2", text: "Supporting sources." }
24
+ ]);
25
+ assert.deepEqual(segments(undefined), segments("completed"), "saved history without status retains its trailing response");
26
+ });
27
+
28
+ test("explicit Codex finals remain independent across goal continuation and hooks", () => {
29
+ assert.deepEqual(codexAppServerProviderThreadAssistantSegments({ turns: [{
30
+ id: "turn", status: "inProgress", items: [
31
+ { type: "agentMessage", id: "answer-1", phase: "final_answer", text: "First result." },
32
+ { type: "hookPrompt", id: "hook" },
33
+ { type: "agentMessage", id: "progress", phase: "commentary", text: "Continuing." },
34
+ { type: "agentMessage", id: "answer-2", phase: "final_answer", text: "Second result." }
35
+ ]
36
+ }] }, "turn"), [
37
+ { itemId: "answer-1", text: "First result." },
38
+ { itemId: "answer-2", text: "Second result." }
39
+ ]);
40
+ });