@xenosystem/agent-interface-host 0.1.160 → 0.1.162
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/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -11
- package/dist/index.js.map +1 -1
- package/dist/transcript/withoutLoggedBodies.d.ts +10 -0
- package/dist/transcript/withoutLoggedBodies.d.ts.map +1 -0
- package/dist/transcript/withoutLoggedBodies.js +32 -0
- package/dist/transcript/withoutLoggedBodies.js.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A saved conversation without the bodies its log already holds (decision 0004, step 6).
|
|
3
|
+
*
|
|
4
|
+
* Decided turn by turn, and only ever toward keeping: a turn's messages leave the saved copy only when its log says exactly
|
|
5
|
+
* the same words and holds its attachments. A turn still running, one that differs, one the log has never heard of and a
|
|
6
|
+
* local command result all stay. The caller reads the rest back from the log.
|
|
7
|
+
*/
|
|
8
|
+
import type { AgentConversationTranscriptItem } from '@xenosystem/agent-interface-contract';
|
|
9
|
+
export declare function withoutLoggedBodies(conversation: Record<string, unknown>, items: readonly AgentConversationTranscriptItem[]): Record<string, unknown>;
|
|
10
|
+
//# sourceMappingURL=withoutLoggedBodies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withoutLoggedBodies.d.ts","sourceRoot":"","sources":["../../src/transcript/withoutLoggedBodies.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAA;AAM3F,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,+BAA+B,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0BrJ"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const text = (value) => (typeof value === 'string' ? value.trim() : '');
|
|
2
|
+
const count = (value) => (Array.isArray(value) ? value.length : 0);
|
|
3
|
+
export function withoutLoggedBodies(conversation, items) {
|
|
4
|
+
if (!Array.isArray(conversation.messages))
|
|
5
|
+
return conversation;
|
|
6
|
+
const prompts = new Map(items.flatMap((item) => (item.kind === 'user' ? [[item.requestId, item]] : [])));
|
|
7
|
+
const replies = new Map(items.flatMap((item) => (item.kind === 'assistant' ? [[item.requestId, item]] : [])));
|
|
8
|
+
const kept = [];
|
|
9
|
+
let waiting = [];
|
|
10
|
+
for (const value of conversation.messages) {
|
|
11
|
+
if (value?.role === 'user') {
|
|
12
|
+
waiting.push(value);
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
const reply = replies.get(String(value?.id));
|
|
16
|
+
const prompt = prompts.get(String(value?.id));
|
|
17
|
+
const held = !value?.isCommandResult
|
|
18
|
+
&& reply !== undefined
|
|
19
|
+
&& prompt !== undefined
|
|
20
|
+
&& reply.status === 'completed'
|
|
21
|
+
&& text(value?.content) === text(reply.text)
|
|
22
|
+
&& waiting.length === 1
|
|
23
|
+
&& text(waiting[0]?.content) === text(prompt.text)
|
|
24
|
+
&& count(waiting[0]?.attachments) === count(prompt.attachments);
|
|
25
|
+
if (!held)
|
|
26
|
+
kept.push(...waiting, value);
|
|
27
|
+
waiting = [];
|
|
28
|
+
}
|
|
29
|
+
kept.push(...waiting);
|
|
30
|
+
return { ...conversation, messages: kept, logHeld: true };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=withoutLoggedBodies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withoutLoggedBodies.js","sourceRoot":"","sources":["../../src/transcript/withoutLoggedBodies.ts"],"names":[],"mappings":"AAUA,MAAM,IAAI,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAA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GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAA;QAC7C,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,eAAe;eAC/B,KAAK,KAAK,SAAS;eACnB,MAAM,KAAK,SAAS;eACpB,KAAK,CAAC,MAAM,KAAK,WAAW;eAC5B,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;eACzC,OAAO,CAAC,MAAM,KAAK,CAAC;eACpB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;eAC/C,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,KAAK,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;QACjE,IAAI,CAAC,IAAI;YAAE,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,CAAA;QACvC,OAAO,GAAG,EAAE,CAAA;IACd,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAA;IACrB,OAAO,EAAE,GAAG,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAC3D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xenosystem/agent-interface-host",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.162",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@xenosystem/acp-core": "0.2.25",
|
|
35
35
|
"@xenosystem/acp-provider-manager": "0.2.25",
|
|
36
|
-
"@xenosystem/agent-sdk": "0.10.
|
|
36
|
+
"@xenosystem/agent-sdk": "0.10.105",
|
|
37
37
|
"@xenosystem/capability-sdk": "0.1.1",
|
|
38
38
|
"@xenosystem/primitives": "0.3.1",
|
|
39
39
|
"zod": "4.6.7",
|
|
40
|
-
"@xenosystem/agent-interface-contract": "0.1.
|
|
41
|
-
"@xenosystem/capability-mcp": "0.1.
|
|
42
|
-
"@xenosystem/agent-interface-core": "0.1.
|
|
40
|
+
"@xenosystem/agent-interface-contract": "0.1.162",
|
|
41
|
+
"@xenosystem/capability-mcp": "0.1.162",
|
|
42
|
+
"@xenosystem/agent-interface-core": "0.1.162"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
45
|
"@xenosystem/acp-agent": "0.2.25",
|
|
46
|
-
"@xenosystem/agent-interface-client": "0.1.
|
|
46
|
+
"@xenosystem/agent-interface-client": "0.1.162"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@xeno-corporation/account": "0.4.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"better-sqlite3": "13.0.3",
|
|
67
67
|
"node-pty": "^1.1.0",
|
|
68
68
|
"fflate": "^0.8.3",
|
|
69
|
-
"@xenosystem/agent-interface-client": "0.1.
|
|
69
|
+
"@xenosystem/agent-interface-client": "0.1.162"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {}
|
|
72
72
|
}
|