@arnilo/prism-acp-agent 0.2.9 → 0.3.1
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/CHANGELOG.md +11 -0
- package/dist/src/index.js +49 -9
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.1] - 2026-08-29
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Plan 035-039 changed-package cut: additive runtime performance, tooling, and documentation deltas; peer window refresh.
|
|
7
|
+
|
|
8
|
+
## [0.3.0] - 2026-08-20
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Spawnable ACP agents create per-session coding registries backed by advertised client editor buffers, preserving durable approval resumes through the same session agent; disk-backed shell/search/list/glob/delete/move behavior remains explicit hybrid mode.
|
|
13
|
+
|
|
3
14
|
## [0.2.8] - 2026-08-18
|
|
4
15
|
|
|
5
16
|
### Added
|
package/dist/src/index.js
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
11
|
import { createAgent, createAgentRunLifecycle, createMemoryCheckpointStore, createMemorySessionStore, createMockProvider, createToolRegistry, } from "@arnilo/prism";
|
|
12
|
-
import { createPrismAcpAgent } from "@arnilo/prism-ag-ui/acp";
|
|
13
|
-
import { createCodingTools } from "@arnilo/prism-coding-agent";
|
|
12
|
+
import { createAcpClientFilesystem, createPrismAcpAgent } from "@arnilo/prism-ag-ui/acp";
|
|
13
|
+
import { createAcpFilesystemOperations, createCodingTools } from "@arnilo/prism-coding-agent";
|
|
14
14
|
import { createSqlitePersistence } from "@arnilo/prism-session-store-sqlite";
|
|
15
15
|
export { ConfigError, loadConfig, parseConfig } from "./config.js";
|
|
16
16
|
/** MCP allow-list gate: http/sse servers must match an allow prefix; stdio needs the "stdio" marker. */
|
|
@@ -26,6 +26,14 @@ export function selectMcpServers(allow, servers) {
|
|
|
26
26
|
export function createSpawnableAgent(options) {
|
|
27
27
|
const { config } = options;
|
|
28
28
|
const ownership = { userId: config.userId };
|
|
29
|
+
const identity = {
|
|
30
|
+
tenantId: "local",
|
|
31
|
+
userId: config.userId,
|
|
32
|
+
principal: { kind: "user", id: config.userId },
|
|
33
|
+
scopes: ["coding"],
|
|
34
|
+
issuedAt: new Date().toISOString(),
|
|
35
|
+
verified: true,
|
|
36
|
+
};
|
|
29
37
|
let store;
|
|
30
38
|
let checkpoints;
|
|
31
39
|
if (config.sessionStore.type === "sqlite") {
|
|
@@ -37,28 +45,60 @@ export function createSpawnableAgent(options) {
|
|
|
37
45
|
store = createMemorySessionStore();
|
|
38
46
|
checkpoints = createMemoryCheckpointStore();
|
|
39
47
|
}
|
|
48
|
+
const defaultAgentId = "prism-acp-agent";
|
|
40
49
|
const tools = createToolRegistry(createCodingTools(config.cwd));
|
|
41
50
|
const prismAgent = createAgent({
|
|
42
|
-
id:
|
|
51
|
+
id: defaultAgentId,
|
|
43
52
|
model: { provider: "mock", model: "mock" },
|
|
44
53
|
provider: options.provider ?? createMockProvider(),
|
|
45
54
|
store,
|
|
46
55
|
tools,
|
|
47
56
|
ownership,
|
|
57
|
+
identity,
|
|
48
58
|
runState: { checkpoints, definitionRevision: "1", interruptBeforeTool: true },
|
|
49
59
|
});
|
|
60
|
+
// ACP fs adapters carry session ids, so editor-backed tool registries must be
|
|
61
|
+
// built per session instead of shared through the default disk agent.
|
|
62
|
+
const sessionAgents = new Map();
|
|
50
63
|
return createPrismAcpAgent({
|
|
51
64
|
name: "Prism ACP Agent",
|
|
52
65
|
authorize: () => ({ ownership }),
|
|
53
|
-
sessionFactory: async (input) =>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
tools
|
|
57
|
-
|
|
66
|
+
sessionFactory: async (input) => {
|
|
67
|
+
const sessionId = input.sessionId ?? randomUUID();
|
|
68
|
+
let sessionAgent = prismAgent;
|
|
69
|
+
let sessionTools = tools;
|
|
70
|
+
let agentId = defaultAgentId;
|
|
71
|
+
if (input.coding?.filesystem) {
|
|
72
|
+
const operations = createAcpFilesystemOperations(input.coding.filesystem);
|
|
73
|
+
sessionTools = createToolRegistry(createCodingTools(input.cwd, {
|
|
74
|
+
read: { operations: operations.read },
|
|
75
|
+
write: { operations: operations.write },
|
|
76
|
+
edit: { operations: operations.edit },
|
|
77
|
+
}));
|
|
78
|
+
agentId = `${defaultAgentId}:${sessionId}`;
|
|
79
|
+
sessionAgent = createAgent({ ...prismAgent.config, id: agentId, tools: sessionTools });
|
|
80
|
+
sessionAgents.set(agentId, sessionAgent);
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
session: sessionAgent.createSession({ id: sessionId }),
|
|
84
|
+
agentId,
|
|
85
|
+
tools: sessionTools,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
58
88
|
lifecycle: createAgentRunLifecycle({
|
|
59
89
|
checkpoints,
|
|
60
|
-
resolveAgent: () =>
|
|
90
|
+
resolveAgent: ({ agentId }) => {
|
|
91
|
+
if (agentId === defaultAgentId)
|
|
92
|
+
return { agent: prismAgent, definitionRevision: "1" };
|
|
93
|
+
const sessionAgent = sessionAgents.get(agentId);
|
|
94
|
+
if (!sessionAgent)
|
|
95
|
+
throw new Error(`Unknown ACP session agent: ${agentId}`);
|
|
96
|
+
return { agent: sessionAgent, definitionRevision: "1" };
|
|
97
|
+
},
|
|
61
98
|
}),
|
|
99
|
+
coding: {
|
|
100
|
+
filesystem: (client, sessionId) => createAcpClientFilesystem(client, sessionId),
|
|
101
|
+
},
|
|
62
102
|
mcp: config.mcp ? { transports: ["http", "sse"], select: ({ servers }) => selectMcpServers(config.mcp.allow, servers) } : undefined,
|
|
63
103
|
modes: config.modes
|
|
64
104
|
? { modes: config.modes.modes, ...(config.modes.defaultModeId !== undefined ? { defaultModeId: config.modes.defaultModeId } : {}) }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arnilo/prism-acp-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Spawnable ACP agent: serves createPrismAcpAgent over stdio from a config file.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@agentclientprotocol/sdk": "1.3.0",
|
|
32
|
-
"@arnilo/prism-coding-agent": "0.
|
|
33
|
-
"@arnilo/prism-session-store-sqlite": "0.
|
|
32
|
+
"@arnilo/prism-coding-agent": "^0.3.0",
|
|
33
|
+
"@arnilo/prism-session-store-sqlite": "^0.3.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@arnilo/prism": "0.
|
|
37
|
-
"@arnilo/prism-ag-ui": "0.
|
|
36
|
+
"@arnilo/prism": "^0.3.1",
|
|
37
|
+
"@arnilo/prism-ag-ui": "^0.3.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@arnilo/prism": "file:../..",
|