@jskit-ai/assistant-core 0.1.196 → 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.
|
|
12
|
-
"@jskit-ai/http-runtime": "0.1.
|
|
13
|
-
"@jskit-ai/kernel": "0.1.
|
|
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.
|
|
18
|
-
"@jskit-ai/connectors-catalog": "0.1.
|
|
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",
|
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.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.
|
|
38
|
-
"@jskit-ai/resource-crud-core": "0.1.
|
|
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.
|
|
48
|
-
"@jskit-ai/kernel": "0.1.
|
|
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
|
},
|
|
@@ -566,10 +566,17 @@ function codexAppServerProviderThreadTurn(value = {}, turnId = "") {
|
|
|
566
566
|
|
|
567
567
|
function codexAppServerProviderTurnAssistantSegments(turn = {}) {
|
|
568
568
|
const seenItemIds = new Set();
|
|
569
|
-
|
|
570
|
-
|
|
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
|
|
579
|
+
return phase === "final_answer" || (!phase && !active && index >= responseStart);
|
|
573
580
|
})
|
|
574
581
|
.map((item) => {
|
|
575
582
|
const itemId = normalizeText(item.id);
|
|
@@ -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
|
+
});
|