qlogicagent 2.18.9 → 2.18.10

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.
Files changed (62) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/host-contract.js +1 -1
  3. package/dist/index.js +445 -984
  4. package/dist/pet-host.js +8 -8
  5. package/dist/project-memory-host.js +40 -0
  6. package/dist/protocol.js +1 -1
  7. package/dist/types/cli/acp-session-host.d.ts +1 -1
  8. package/dist/types/cli/community-resource-installer.d.ts +3 -5
  9. package/dist/types/cli/default-project-bootstrap.d.ts +1 -1
  10. package/dist/types/cli/handlers/agents-handler.d.ts +8 -6
  11. package/dist/types/cli/handlers/community-handler.d.ts +0 -4
  12. package/dist/types/cli/handlers/control-handler.d.ts +1 -1
  13. package/dist/types/cli/handlers/project-handler.d.ts +1 -1
  14. package/dist/types/cli/handlers/session-handler.d.ts +0 -7
  15. package/dist/types/cli/handlers/solo-handler.d.ts +0 -2
  16. package/dist/types/cli/memory-coordinator.d.ts +1 -1
  17. package/dist/types/cli/multi-agent-state-coordinator.d.ts +0 -3
  18. package/dist/types/cli/pet-runtime.d.ts +5 -5
  19. package/dist/types/cli/product-coordinator.d.ts +0 -2
  20. package/dist/types/cli/project-memory-store-factory.d.ts +11 -1
  21. package/dist/types/cli/rpc-registry.d.ts +0 -2
  22. package/dist/types/cli/stdio-runtime-bootstrap.d.ts +2 -0
  23. package/dist/types/cli/stdio-runtime-services.d.ts +2 -0
  24. package/dist/types/cli/stdio-server.d.ts +3 -1
  25. package/dist/types/config/cn-mirror.d.ts +2 -2
  26. package/dist/types/host-contract/index.d.ts +167 -9
  27. package/dist/types/orchestration/agent-instance.d.ts +1 -3
  28. package/dist/types/orchestration/goal-mode-adapters.d.ts +0 -3
  29. package/dist/types/orchestration/goal-run-persistence.d.ts +0 -3
  30. package/dist/types/orchestration/product-persistence.d.ts +1 -4
  31. package/dist/types/orchestration/product-planner.d.ts +2 -3
  32. package/dist/types/orchestration/run-state-host-authority.d.ts +7 -0
  33. package/dist/types/orchestration/solo-evaluator.d.ts +2 -3
  34. package/dist/types/orchestration/solo-persistence.d.ts +4 -7
  35. package/dist/types/orchestration/testing/delegate-test-bridge.d.ts +13 -2
  36. package/dist/types/orchestration/workflow/node-schema.d.ts +2 -1
  37. package/dist/types/orchestration/workflow/qla-executor-host.d.ts +1 -1
  38. package/dist/types/orchestration/workflow/workflow-bundle.d.ts +1 -1
  39. package/dist/types/project-memory-host.d.ts +3 -0
  40. package/dist/types/protocol/wire/acp-agent-management.d.ts +1 -1
  41. package/dist/types/protocol/wire/acp-protocol.d.ts +1 -1
  42. package/dist/types/runtime/infra/acp-detector.d.ts +1 -1
  43. package/dist/types/runtime/infra/background-tasks.d.ts +1 -1
  44. package/dist/types/runtime/pet/pet-community-assets.d.ts +7 -17
  45. package/dist/types/runtime/pet/petdex-vision-qa.d.ts +12 -0
  46. package/dist/types/runtime/ports/memory-recall-source.d.ts +10 -0
  47. package/dist/types/runtime/ports/project-memory-store.d.ts +1 -1
  48. package/dist/types/runtime/session/session-persistence.d.ts +3 -4
  49. package/dist/types/skills/memory/host-memory-provider.d.ts +2 -2
  50. package/dist/types/skills/memory/memory-config-resolver.d.ts +4 -0
  51. package/dist/types/skills/memory/task-distillation.d.ts +1 -1
  52. package/dist/types/test-support/run-state-authority-setup.d.ts +1 -0
  53. package/dist/types/transport/host-pet-client.d.ts +20 -0
  54. package/dist/types/transport/host-run-state-client.d.ts +17 -0
  55. package/dist/workflow-host.js +9 -9
  56. package/package.json +12 -2
  57. package/dist/runtime/infra/mcp-bridge-server.js +0 -338
  58. package/dist/types/cli/handlers/message-feedback-handler.d.ts +0 -31
  59. package/dist/types/runtime/infra/agent-process.d.ts +0 -368
  60. package/dist/types/runtime/infra/external-agent-pool.d.ts +0 -89
  61. package/dist/types/skills/memory/local-memory-provider.d.ts +0 -325
  62. package/dist/types/skills/memory/memory-provider-factory.d.ts +0 -33
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qlogicagent",
3
- "version": "2.18.9",
3
+ "version": "2.18.10",
4
4
  "description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -48,6 +48,10 @@
48
48
  "types": "./dist/types/workflow-host.d.ts",
49
49
  "default": "./dist/workflow-host.js"
50
50
  },
51
+ "./project-memory-host": {
52
+ "types": "./dist/types/project-memory-host.d.ts",
53
+ "default": "./dist/project-memory-host.js"
54
+ },
51
55
  "./host-contract": {
52
56
  "types": "./dist/types/host-contract/index.d.ts",
53
57
  "default": "./dist/host-contract.js"
@@ -89,6 +93,9 @@
89
93
  "workflow-host": [
90
94
  "./dist/types/workflow-host.d.ts"
91
95
  ],
96
+ "project-memory-host": [
97
+ "./dist/types/project-memory-host.d.ts"
98
+ ],
92
99
  "host-contract": [
93
100
  "./dist/types/host-contract/index.d.ts"
94
101
  ],
@@ -104,14 +111,17 @@
104
111
  "build:search-svc": "node scripts/build-search-svc.mjs",
105
112
  "start": "node dist/cli.js",
106
113
  "test": "vitest run",
114
+ "test:slow": "vitest run --config vitest.release.config.ts",
115
+ "test:release": "pnpm test && pnpm run test:slow",
107
116
  "test:replay": "vitest run benchmarks/transcript-replay",
108
- "check": "pnpm run check:encoding-corruption && pnpm run check:mechanical-rules && pnpm run check:windows-hide && tsc --noEmit && pnpm test && pnpm run check:architecture-boundaries && pnpm run check:route-a-teardown && pnpm run check:transcript-tool-persistence && pnpm run check:provider-core-boundary && pnpm run check:provider-core-release-sync && pnpm run check:pet-core-boundary && pnpm run check:workspace-hygiene && pnpm run check:package-artifact",
117
+ "check": "node scripts/run-check.mjs",
109
118
  "test:watch": "vitest",
110
119
  "benchmark:hermes-superiority": "tsx benchmarks/hermes-superiority/runner.ts",
111
120
  "lint": "oxlint .",
112
121
  "check:encoding-corruption": "node scripts/check-encoding-corruption.mjs",
113
122
  "check:mechanical-rules": "node scripts/check-mechanical-rules.mjs",
114
123
  "check:windows-hide": "node scripts/check-windows-hide.mjs src",
124
+ "check:test-suite-governance": "node scripts/check-test-suite-governance.mjs",
115
125
  "check:architecture-boundaries": "node scripts/check-architecture-boundaries.mjs",
116
126
  "check:route-a-teardown": "node scripts/check-route-a-teardown.mjs",
117
127
  "check:transcript-tool-persistence": "node scripts/check-transcript-tool-persistence.mjs",
@@ -1,338 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * MCP Bridge Server — stdio MCP server for external ACP agents.
4
- *
5
- * Spawned by qlogicagent as a child of the external agent process.
6
- * Receives MCP requests (tools/list, tools/call) from the external agent
7
- * and proxies tool calls back to qlogicagent's parent RPC.
8
- *
9
- * Environment:
10
- * QLOGICAGENT_PARENT_RPC — IPC/pipe path to parent qlogicagent
11
- * QLOGICAGENT_SESSION_ID — session scope for tool calls
12
- *
13
- * Protocol: JSON-RPC 2.0 over stdio (newline-delimited)
14
- */
15
-
16
- import readline from "node:readline";
17
- import net from "node:net";
18
-
19
- // ── Tool Manifest (must match MCP_BRIDGE_TOOLS in mcp-bridge.ts) ────
20
-
21
- const TOOLS = [
22
- {
23
- name: "skills_list",
24
- description: "List AstraClaw skills currently active for this workspace and session.",
25
- inputSchema: {
26
- type: "object",
27
- properties: {},
28
- },
29
- },
30
- {
31
- name: "skill_view",
32
- description: "Read the SKILL.md workflow for an installed AstraClaw skill by name.",
33
- inputSchema: {
34
- type: "object",
35
- properties: {
36
- name: { type: "string", description: "Installed skill name" },
37
- },
38
- required: ["name"],
39
- },
40
- },
41
- {
42
- name: "mcp_connectors_list",
43
- description: "List MCP connector tools installed in AstraClaw's Plugins page and shared with this external agent.",
44
- inputSchema: {
45
- type: "object",
46
- properties: {},
47
- },
48
- },
49
- {
50
- name: "mcp_tool_call",
51
- description: "Call one AstraClaw shared MCP connector tool by toolName from mcp_connectors_list.",
52
- inputSchema: {
53
- type: "object",
54
- properties: {
55
- toolName: { type: "string", description: "Connector tool name, for example mcp__filesystem__read_text_file" },
56
- args: { type: "object", description: "Arguments for the connector tool" },
57
- },
58
- required: ["toolName"],
59
- },
60
- },
61
- {
62
- name: "media_generate",
63
- description: "Generate images or videos using AI models.",
64
- inputSchema: {
65
- type: "object",
66
- properties: {
67
- prompt: { type: "string", description: "Generation prompt" },
68
- type: { type: "string", enum: ["image", "video"], description: "Media type" },
69
- },
70
- required: ["prompt"],
71
- },
72
- },
73
- {
74
- name: "media_status",
75
- description: "Check status of an async media generation job.",
76
- inputSchema: {
77
- type: "object",
78
- properties: {
79
- jobId: { type: "string", description: "Job ID to check" },
80
- },
81
- required: ["jobId"],
82
- },
83
- },
84
- {
85
- name: "memory_read",
86
- description: "Read from persistent memory.",
87
- inputSchema: {
88
- type: "object",
89
- properties: {
90
- key: { type: "string", description: "Memory key to read" },
91
- },
92
- required: ["key"],
93
- },
94
- },
95
- {
96
- name: "memory_write",
97
- description: "Write to persistent memory.",
98
- inputSchema: {
99
- type: "object",
100
- properties: {
101
- key: { type: "string", description: "Memory key" },
102
- value: { type: "string", description: "Value to store" },
103
- },
104
- required: ["key", "value"],
105
- },
106
- },
107
- {
108
- name: "memory_search",
109
- description: "Search persistent memory by query.",
110
- inputSchema: {
111
- type: "object",
112
- properties: {
113
- query: { type: "string", description: "Search query" },
114
- },
115
- required: ["query"],
116
- },
117
- },
118
- {
119
- name: "web_search",
120
- description: "Search the web for information.",
121
- inputSchema: {
122
- type: "object",
123
- properties: {
124
- query: { type: "string", description: "Search query" },
125
- },
126
- required: ["query"],
127
- },
128
- },
129
- {
130
- name: "web_fetch",
131
- description: "Fetch content from a URL.",
132
- inputSchema: {
133
- type: "object",
134
- properties: {
135
- url: { type: "string", description: "URL to fetch" },
136
- },
137
- required: ["url"],
138
- },
139
- },
140
- {
141
- name: "team_status",
142
- description: "Get status of all agent team members.",
143
- inputSchema: {
144
- type: "object",
145
- properties: {},
146
- },
147
- },
148
- {
149
- name: "team_message",
150
- description: "Send a message to another team member agent.",
151
- inputSchema: {
152
- type: "object",
153
- properties: {
154
- targetAgentId: { type: "string", description: "Target agent ID" },
155
- message: { type: "string", description: "Message to send" },
156
- },
157
- required: ["targetAgentId", "message"],
158
- },
159
- },
160
- ];
161
-
162
- // ── Parent RPC Connection ───────────────────────────────────
163
-
164
- const PARENT_RPC = process.env.QLOGICAGENT_PARENT_RPC;
165
- const SESSION_ID = process.env.QLOGICAGENT_SESSION_ID || "unknown";
166
-
167
- let parentSocket = null;
168
- let rpcId = 1;
169
- const pendingRpc = new Map();
170
-
171
- function connectParent() {
172
- if (!PARENT_RPC) return;
173
-
174
- parentSocket = net.createConnection(PARENT_RPC, () => {
175
- process.stderr.write(`[mcp-bridge] connected to parent: ${PARENT_RPC}\n`);
176
- });
177
-
178
- let buffer = "";
179
- parentSocket.on("data", (chunk) => {
180
- buffer += chunk.toString();
181
- let nl;
182
- while ((nl = buffer.indexOf("\n")) !== -1) {
183
- const line = buffer.slice(0, nl).trim();
184
- buffer = buffer.slice(nl + 1);
185
- if (!line) continue;
186
- try {
187
- const msg = JSON.parse(line);
188
- if (msg.id !== undefined && pendingRpc.has(msg.id)) {
189
- const resolve = pendingRpc.get(msg.id);
190
- pendingRpc.delete(msg.id);
191
- resolve(msg);
192
- }
193
- } catch {
194
- // ignore parse errors
195
- }
196
- }
197
- });
198
-
199
- parentSocket.on("error", (err) => {
200
- process.stderr.write(`[mcp-bridge] parent connection error: ${err.message}\n`);
201
- });
202
-
203
- parentSocket.on("close", () => {
204
- parentSocket = null;
205
- });
206
- }
207
-
208
- function callParent(method, params) {
209
- return new Promise((resolve, reject) => {
210
- if (!parentSocket) {
211
- reject(new Error("Not connected to parent"));
212
- return;
213
- }
214
- const id = rpcId++;
215
- const msg = JSON.stringify({ jsonrpc: "2.0", id, method, params }) + "\n";
216
- pendingRpc.set(id, resolve);
217
- parentSocket.write(msg);
218
-
219
- // Connector calls can legitimately run longer than a simple capability lookup.
220
- setTimeout(() => {
221
- if (pendingRpc.has(id)) {
222
- pendingRpc.delete(id);
223
- reject(new Error(`Parent RPC timeout for ${method}`));
224
- }
225
- }, 120_000);
226
- });
227
- }
228
-
229
- // ── MCP Stdio Protocol ──────────────────────────────────────
230
-
231
- function sendResponse(id, result, error) {
232
- const msg = { jsonrpc: "2.0", id };
233
- if (error) msg.error = error;
234
- else msg.result = result;
235
- process.stdout.write(JSON.stringify(msg) + "\n");
236
- }
237
-
238
- async function handleRequest(msg) {
239
- const { id, method, params } = msg;
240
-
241
- if (method === "initialize") {
242
- sendResponse(id, {
243
- protocolVersion: "2024-11-05",
244
- capabilities: { tools: {} },
245
- serverInfo: { name: "astraclaw_capabilities", version: "1.0.0" },
246
- });
247
- return;
248
- }
249
-
250
- if (method === "tools/list") {
251
- sendResponse(id, { tools: TOOLS });
252
- return;
253
- }
254
-
255
- if (method === "tools/call") {
256
- const toolName = params?.name;
257
- const toolArgs = params?.arguments || {};
258
-
259
- if (!toolName) {
260
- sendResponse(id, null, { code: -32602, message: "Missing tool name" });
261
- return;
262
- }
263
-
264
- const knownTool = TOOLS.find((t) => t.name === toolName);
265
- if (!knownTool) {
266
- sendResponse(id, null, { code: -32602, message: `Unknown tool: ${toolName}` });
267
- return;
268
- }
269
-
270
- // Proxy to parent qlogicagent
271
- if (!parentSocket) {
272
- sendResponse(id, {
273
- content: [{ type: "text", text: `Error: MCP bridge not connected to parent` }],
274
- isError: true,
275
- });
276
- return;
277
- }
278
-
279
- try {
280
- const result = await callParent("mcp.toolCall", {
281
- sessionId: SESSION_ID,
282
- tool: toolName,
283
- arguments: toolArgs,
284
- });
285
-
286
- if (result.error) {
287
- sendResponse(id, {
288
- content: [{ type: "text", text: `Error: ${result.error.message}` }],
289
- isError: true,
290
- });
291
- } else {
292
- const text = typeof result.result === "string"
293
- ? result.result
294
- : JSON.stringify(result.result);
295
- sendResponse(id, {
296
- content: [{ type: "text", text }],
297
- });
298
- }
299
- } catch (err) {
300
- sendResponse(id, {
301
- content: [{ type: "text", text: `Error: ${err.message}` }],
302
- isError: true,
303
- });
304
- }
305
- return;
306
- }
307
-
308
- // Notification — no response needed
309
- if (id === undefined) return;
310
-
311
- sendResponse(id, null, { code: -32601, message: `Unknown method: ${method}` });
312
- }
313
-
314
- // ── Main ────────────────────────────────────────────────────
315
-
316
- connectParent();
317
-
318
- const rl = readline.createInterface({ input: process.stdin, terminal: false });
319
-
320
- rl.on("line", (line) => {
321
- const trimmed = line.trim();
322
- if (!trimmed) return;
323
- try {
324
- const msg = JSON.parse(trimmed);
325
- handleRequest(msg).catch((err) => {
326
- if (msg.id !== undefined) {
327
- sendResponse(msg.id, null, { code: -32603, message: err.message });
328
- }
329
- });
330
- } catch {
331
- // Malformed JSON — ignore
332
- }
333
- });
334
-
335
- rl.on("close", () => {
336
- if (parentSocket) parentSocket.destroy();
337
- process.exit(0);
338
- });
@@ -1,31 +0,0 @@
1
- /**
2
- * messageFeedback.* RPC handlers — assistant-message 赞/踩 feedback (design §8.1–8.3).
3
- *
4
- * The handler assembles each FeedbackEvent's context from two backend-owned sources, so the client
5
- * never has to snapshot unreliable click-time state (design §7.3):
6
- * - turn telemetry (by the unified turnId): model / provider / usage / toolSummary / fileContext.
7
- * - the persisted assistant message (by turnId): messagePreview + messageHash.
8
- * The click-time UI increment (uiContextPatch) only fills diffOpenState + browserContext.
9
- *
10
- * Persistence + the idempotent state machine live in feedback-event-store; this layer validates
11
- * params, performs the joins, computes telemetryStatus, and delegates.
12
- *
13
- * projectId is a param on all three RPCs — consistent with the sibling turnBaseline.* RPCs the
14
- * frontend already calls — so the handler resolves the project deterministically without relying
15
- * on ambient active-session state.
16
- */
17
- import { type AgentRpcError, type AgentRpcRequest } from "../../protocol/wire/index.js";
18
- export interface MessageFeedbackHandlerHost {
19
- sendResponse(id: string | number, result?: unknown, error?: AgentRpcError): void;
20
- }
21
- export declare function handleMessageFeedbackSubmit(this: MessageFeedbackHandlerHost, msg: AgentRpcRequest): Promise<void>;
22
- export declare function handleMessageFeedbackRetract(this: MessageFeedbackHandlerHost, msg: AgentRpcRequest): Promise<void>;
23
- export declare function handleMessageFeedbackState(this: MessageFeedbackHandlerHost, msg: AgentRpcRequest): Promise<void>;
24
- export declare function handleMessageFeedbackSummary(this: MessageFeedbackHandlerHost, msg: AgentRpcRequest): Promise<void>;
25
- export declare function handleMessageFeedbackMemoryCandidates(this: MessageFeedbackHandlerHost, msg: AgentRpcRequest): Promise<void>;
26
- /**
27
- * Ship a pre-redacted batch to llmrouter (design §8.6). Not user-triggered — the redaction worker
28
- * is the normal caller; this RPC exists for manual/test flushes. Events MUST already be redacted
29
- * (RedactedFeedbackEvent), since llmrouter rejects un-redacted local events (§9.1 rule 4).
30
- */
31
- export declare function handleMessageFeedbackUploadBatch(this: MessageFeedbackHandlerHost, msg: AgentRpcRequest): Promise<void>;