@ai-setting/roy-agent-core 1.7.58 → 1.7.61
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/config/index.js +8 -8
- package/dist/env/agent/index.js +14 -14
- package/dist/env/commands/index.js +8 -8
- package/dist/env/context/index.js +4 -4
- package/dist/env/debug/index.js +8 -8
- package/dist/env/event-source/cli-command-handler.d.ts +90 -0
- package/dist/env/event-source/event-source-handlers.d.ts +12 -1
- package/dist/env/event-source/index.d.ts +4 -2
- package/dist/env/event-source/index.js +30 -20
- package/dist/env/event-source/types.d.ts +89 -1
- package/dist/env/hook/index.js +6 -6
- package/dist/env/index.d.ts +1 -1
- package/dist/env/index.js +46 -46
- package/dist/env/llm/index.js +9 -9
- package/dist/env/log-trace/index.d.ts +1 -1
- package/dist/env/log-trace/index.js +12 -8
- package/dist/env/log-trace/logger.d.ts +2 -0
- package/dist/env/mcp/index.js +9 -9
- package/dist/env/mcp/tool/index.js +2 -2
- package/dist/env/memory/index.js +9 -9
- package/dist/env/memory/plugin/index.js +2 -2
- package/dist/env/plugin/index.js +8 -8
- package/dist/env/prompt/index.js +8 -8
- package/dist/env/session/index.js +11 -11
- package/dist/env/session/storage/index.js +5 -5
- package/dist/env/skill/index.js +8 -8
- package/dist/env/task/delegate/index.js +9 -9
- package/dist/env/task/index.js +16 -16
- package/dist/env/task/mcp/index.d.ts +16 -0
- package/dist/env/task/mcp/index.js +222 -0
- package/dist/env/task/mcp/task-mcp-server.d.ts +142 -0
- package/dist/env/task/plugins/index.d.ts +1 -0
- package/dist/env/task/plugins/index.js +47 -12
- package/dist/env/task/storage/index.js +4 -4
- package/dist/env/task/storage/migrations/log-migration.d.ts +19 -0
- package/dist/env/task/storage/sqlite-task-store.d.ts +29 -0
- package/dist/env/task/task-component.d.ts +48 -3
- package/dist/env/task/tools/index.js +4 -4
- package/dist/env/task/tools/task-types.d.ts +60 -11
- package/dist/env/tool/built-in/index.js +4 -4
- package/dist/env/tool/index.js +11 -11
- package/dist/env/workflow/engine/index.js +13 -13
- package/dist/env/workflow/hooks/index.js +8 -8
- package/dist/env/workflow/index.js +23 -23
- package/dist/env/workflow/nodes/index.js +3 -3
- package/dist/env/workflow/plugins/index.js +9 -9
- package/dist/env/workflow/service/index.js +3 -3
- package/dist/env/workflow/storage/index.js +4 -4
- package/dist/env/workflow/tools/index.js +15 -15
- package/dist/env/workflow/tools/run-workflow.d.ts +30 -0
- package/dist/env/workflow/utils/index.js +5 -5
- package/dist/env/workflow/utils/session-recovery.d.ts +27 -0
- package/dist/index.js +81 -71
- package/dist/shared/@ai-setting/{roy-agent-core-tze5596n.js → roy-agent-core-0f989bnp.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-e250355z.js → roy-agent-core-22r4zmkw.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-8p63s836.js → roy-agent-core-2qkrpc7m.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-47s81t6g.js → roy-agent-core-3bpntd80.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-rcgvmtms.js → roy-agent-core-3p59ap0x.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-en2xqxs9.js → roy-agent-core-4m5spt7m.js} +39 -14
- package/dist/shared/@ai-setting/{roy-agent-core-5f7myqnb.js → roy-agent-core-5565cvw8.js} +11 -5
- package/dist/shared/@ai-setting/{roy-agent-core-2fk8c9ax.js → roy-agent-core-5knpegzr.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-08njdcpj.js → roy-agent-core-60p2380d.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-0yn7a78e.js → roy-agent-core-6cyjps72.js} +14 -14
- package/dist/shared/@ai-setting/{roy-agent-core-89sxsrc7.js → roy-agent-core-8fy467qs.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-x6c45yqd.js → roy-agent-core-99nwgj84.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-20m8je6e.js → roy-agent-core-9k8ms63r.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-0kn3zt1t.js → roy-agent-core-9s3payp1.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-hefarcp0.js → roy-agent-core-a5nh5q6v.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-hs41gx9w.js → roy-agent-core-aa514zm8.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-yphwdm9x.js → roy-agent-core-ajmgyawx.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-caevk7xd.js → roy-agent-core-arx535cs.js} +30 -8
- package/dist/shared/@ai-setting/{roy-agent-core-vath15kt.js → roy-agent-core-bc3v8pw4.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-m97jn2ra.js → roy-agent-core-bdzdw1g3.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ck60j1q9.js → roy-agent-core-bxkjk7zx.js} +2 -1
- package/dist/shared/@ai-setting/{roy-agent-core-6bradb0j.js → roy-agent-core-cndvj1hv.js} +8 -8
- package/dist/shared/@ai-setting/{roy-agent-core-d75t8gea.js → roy-agent-core-dg286rpd.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-q4gdfypk.js → roy-agent-core-dp1hp24k.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-ygn5tzt1.js → roy-agent-core-dythsgkn.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-em4hks9t.js → roy-agent-core-e6k448ka.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-ytd5eztz.js → roy-agent-core-expvav8a.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-vgdhxbx3.js → roy-agent-core-g44nbgtt.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-14bq77wr.js → roy-agent-core-g5sw19fa.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-991pk4ss.js → roy-agent-core-gtb4fj8j.js} +16 -16
- package/dist/shared/@ai-setting/{roy-agent-core-gksw1gjb.js → roy-agent-core-hf0t8agb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-txwptxk1.js → roy-agent-core-j0x9yf96.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-84rs0c8d.js → roy-agent-core-jrksyqb6.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-ge87xbas.js → roy-agent-core-jsdqzfbj.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-m68z3pw1.js → roy-agent-core-jsn21cb9.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-n0p0hwgd.js → roy-agent-core-kfmrfaft.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-7q4wdze2.js → roy-agent-core-khc23qs1.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-e1w17tht.js → roy-agent-core-m2tv4pj0.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-4096f575.js → roy-agent-core-mhppywse.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-t64nmayv.js → roy-agent-core-mw0bc9g6.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-8bngppw0.js → roy-agent-core-n1ck0x1r.js} +13 -13
- package/dist/shared/@ai-setting/{roy-agent-core-w93z6a42.js → roy-agent-core-nd5171pv.js} +12 -12
- package/dist/shared/@ai-setting/{roy-agent-core-geh6j7bw.js → roy-agent-core-p2dpcyrz.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-fw6k4w1h.js → roy-agent-core-pj5tfmn5.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-029r8kdw.js → roy-agent-core-q212q0w1.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-psg6f1v6.js → roy-agent-core-qgapy83x.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-jjxdmedn.js → roy-agent-core-qpqqx1wd.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-syyw58p9.js → roy-agent-core-qrjs2500.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-84xtww7d.js → roy-agent-core-qw5fpa24.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-kq9pz2a7.js → roy-agent-core-rnzm0tpf.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-7nb23tdd.js → roy-agent-core-s7w47mnn.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-t4x089js.js → roy-agent-core-sf9tsj0g.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-jjhw9am6.js → roy-agent-core-tn96n4wz.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-c7w2h47a.js → roy-agent-core-vmfk4m1v.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-cyefe8z5.js → roy-agent-core-x1m0gs0q.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-baaa4wtp.js → roy-agent-core-xc0es9zc.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-fbjd7bt6.js → roy-agent-core-xeqp659x.js} +64 -29
- package/dist/shared/@ai-setting/{roy-agent-core-rt115qfc.js → roy-agent-core-y0k9kaxz.js} +14 -4
- package/dist/shared/@ai-setting/{roy-agent-core-c36335nw.js → roy-agent-core-yd85623y.js} +15 -3
- package/dist/shared/@ai-setting/{roy-agent-core-9zhkdg6w.js → roy-agent-core-ygfjgk9b.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-vh0qzb24.js → roy-agent-core-ymcvsdzn.js} +36 -15
- package/dist/shared/@ai-setting/{roy-agent-core-eanq305k.js → roy-agent-core-yr5eqyhz.js} +11 -11
- package/dist/shared/@ai-setting/{roy-agent-core-fy4mcj6x.js → roy-agent-core-ytnedzks.js} +292 -105
- package/dist/shared/@ai-setting/{roy-agent-core-2ctyjy62.js → roy-agent-core-z51jktet.js} +1 -1
- package/dist/utils/temp-file-manager/index.js +2 -2
- package/package.json +16 -1
- /package/dist/shared/@ai-setting/{roy-agent-core-3ztzc83c.js → roy-agent-core-5enxfga2.js} +0 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import {
|
|
2
|
+
completeTaskTool,
|
|
3
|
+
createTaskTool,
|
|
4
|
+
getTaskTool,
|
|
5
|
+
listTasksTool,
|
|
6
|
+
searchTasksTool,
|
|
7
|
+
treeTasksTool,
|
|
8
|
+
updateTaskTool
|
|
9
|
+
} from "../../../shared/@ai-setting/roy-agent-core-ymcvsdzn.js";
|
|
10
|
+
import {
|
|
11
|
+
createOperationTool,
|
|
12
|
+
listOperationsTool
|
|
13
|
+
} from "../../../shared/@ai-setting/roy-agent-core-rn57psp0.js";
|
|
14
|
+
import"../../../shared/@ai-setting/roy-agent-core-qrjs2500.js";
|
|
15
|
+
import"../../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
16
|
+
import"../../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
17
|
+
import"../../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
18
|
+
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
19
|
+
|
|
20
|
+
// src/env/task/mcp/task-mcp-server.ts
|
|
21
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
22
|
+
var TASK_MCP_TOOL_NAMES = [
|
|
23
|
+
"task_create",
|
|
24
|
+
"task_tree",
|
|
25
|
+
"task_get",
|
|
26
|
+
"task_list",
|
|
27
|
+
"task_search",
|
|
28
|
+
"task_update",
|
|
29
|
+
"task_complete",
|
|
30
|
+
"task_operation_create",
|
|
31
|
+
"task_operation_list"
|
|
32
|
+
];
|
|
33
|
+
var TASK_MCP_JSON_RPC_ERRORS = Object.freeze({
|
|
34
|
+
PARSE_ERROR: -32700,
|
|
35
|
+
INVALID_REQUEST: -32600,
|
|
36
|
+
METHOD_NOT_FOUND: -32601,
|
|
37
|
+
INVALID_PARAMS: -32602,
|
|
38
|
+
INTERNAL_ERROR: -32603
|
|
39
|
+
});
|
|
40
|
+
var TASK_MCP_SUPPORTED_PROTOCOL_VERSIONS = Object.freeze([
|
|
41
|
+
"2025-11-25",
|
|
42
|
+
"2025-06-18",
|
|
43
|
+
"2025-03-26",
|
|
44
|
+
"2024-11-05",
|
|
45
|
+
"2024-10-07"
|
|
46
|
+
]);
|
|
47
|
+
var TASK_MCP_DEFAULT_PROTOCOL_VERSION = "2025-11-25";
|
|
48
|
+
var TASK_TOOL_FACTORIES = [
|
|
49
|
+
createTaskTool,
|
|
50
|
+
treeTasksTool,
|
|
51
|
+
getTaskTool,
|
|
52
|
+
listTasksTool,
|
|
53
|
+
searchTasksTool,
|
|
54
|
+
updateTaskTool,
|
|
55
|
+
completeTaskTool,
|
|
56
|
+
createOperationTool,
|
|
57
|
+
listOperationsTool
|
|
58
|
+
];
|
|
59
|
+
function toJsonSchemaDocument(parameters) {
|
|
60
|
+
const p = parameters;
|
|
61
|
+
if (!p)
|
|
62
|
+
return {};
|
|
63
|
+
const target = p.shape ? p : p._def?.schema ?? p;
|
|
64
|
+
try {
|
|
65
|
+
const doc = zodToJsonSchema(target, {
|
|
66
|
+
target: "jsonSchema7",
|
|
67
|
+
$refStrategy: "none",
|
|
68
|
+
effectStrategy: "input"
|
|
69
|
+
});
|
|
70
|
+
const { $schema: _ignored, ...rest } = doc;
|
|
71
|
+
return { type: "object", properties: {}, ...rest };
|
|
72
|
+
} catch {
|
|
73
|
+
return { type: "object", properties: {} };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function createTaskMcpToolDefinitions(backend) {
|
|
77
|
+
return TASK_TOOL_FACTORIES.map((factory) => {
|
|
78
|
+
const tool = factory(backend);
|
|
79
|
+
return {
|
|
80
|
+
name: tool.name,
|
|
81
|
+
description: tool.description,
|
|
82
|
+
inputSchema: toJsonSchemaDocument(tool.parameters)
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function negotiateTaskMcpProtocolVersion(requested) {
|
|
87
|
+
if (requested && TASK_MCP_SUPPORTED_PROTOCOL_VERSIONS.includes(requested)) {
|
|
88
|
+
return requested;
|
|
89
|
+
}
|
|
90
|
+
return TASK_MCP_DEFAULT_PROTOCOL_VERSION;
|
|
91
|
+
}
|
|
92
|
+
function toolErrorText(message) {
|
|
93
|
+
return {
|
|
94
|
+
content: [{ type: "text", text: message }],
|
|
95
|
+
isError: true
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function createTaskMcpServer(backend, options = {}) {
|
|
99
|
+
const name = options.name ?? "roy-task";
|
|
100
|
+
const version = options.version ?? "1.0.0";
|
|
101
|
+
const toolDefs = createTaskMcpToolDefinitions(backend);
|
|
102
|
+
const byName = new Map(toolDefs.map((d) => [d.name, d]));
|
|
103
|
+
const callTool = async (toolName, args) => {
|
|
104
|
+
const factory = TASK_TOOL_FACTORIES.find((f) => f(backend).name === toolName);
|
|
105
|
+
if (!factory) {
|
|
106
|
+
throw new Error(`unknown tool: ${toolName}`);
|
|
107
|
+
}
|
|
108
|
+
const tool = factory(backend);
|
|
109
|
+
const ctx = {
|
|
110
|
+
session_id: options.sessionId ?? "unknown",
|
|
111
|
+
workdir: options.workdir
|
|
112
|
+
};
|
|
113
|
+
const result = await tool.execute(args ?? {}, ctx);
|
|
114
|
+
const r = result;
|
|
115
|
+
if (r && r.success === false) {
|
|
116
|
+
throw new Error(r.error ?? `tool "${toolName}" failed`);
|
|
117
|
+
}
|
|
118
|
+
return r && "output" in r ? r.output : result;
|
|
119
|
+
};
|
|
120
|
+
const handleRequest = async (request) => {
|
|
121
|
+
const { id, method, params } = request;
|
|
122
|
+
if (id === undefined || id === null) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
switch (method) {
|
|
126
|
+
case "initialize": {
|
|
127
|
+
const requested = params?.protocolVersion;
|
|
128
|
+
return {
|
|
129
|
+
jsonrpc: "2.0",
|
|
130
|
+
id,
|
|
131
|
+
result: {
|
|
132
|
+
protocolVersion: negotiateTaskMcpProtocolVersion(typeof requested === "string" ? requested : undefined),
|
|
133
|
+
capabilities: { tools: {} },
|
|
134
|
+
serverInfo: { name, version }
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
case "server/discover": {
|
|
139
|
+
const meta = params?._meta;
|
|
140
|
+
const requested = meta?.["io.modelcontextprotocol/protocolVersion"];
|
|
141
|
+
return {
|
|
142
|
+
jsonrpc: "2.0",
|
|
143
|
+
id,
|
|
144
|
+
result: {
|
|
145
|
+
protocolVersion: negotiateTaskMcpProtocolVersion(typeof requested === "string" ? requested : undefined),
|
|
146
|
+
capabilities: { tools: {} },
|
|
147
|
+
serverInfo: { name, version }
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
case "ping":
|
|
152
|
+
return { jsonrpc: "2.0", id, result: {} };
|
|
153
|
+
case "tools/list":
|
|
154
|
+
return { jsonrpc: "2.0", id, result: { tools: toolDefs } };
|
|
155
|
+
case "tools/call": {
|
|
156
|
+
const toolName = params?.name;
|
|
157
|
+
const args = params?.arguments || {};
|
|
158
|
+
if (typeof toolName !== "string") {
|
|
159
|
+
return {
|
|
160
|
+
jsonrpc: "2.0",
|
|
161
|
+
id,
|
|
162
|
+
error: {
|
|
163
|
+
code: TASK_MCP_JSON_RPC_ERRORS.INVALID_PARAMS,
|
|
164
|
+
message: "tools/call requires a tool name"
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
if (!byName.has(toolName)) {
|
|
169
|
+
return {
|
|
170
|
+
jsonrpc: "2.0",
|
|
171
|
+
id,
|
|
172
|
+
error: {
|
|
173
|
+
code: TASK_MCP_JSON_RPC_ERRORS.INVALID_PARAMS,
|
|
174
|
+
message: `unknown tool: ${toolName}`
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
const value = await callTool(toolName, args);
|
|
180
|
+
return {
|
|
181
|
+
jsonrpc: "2.0",
|
|
182
|
+
id,
|
|
183
|
+
result: {
|
|
184
|
+
content: [{ type: "text", text: JSON.stringify(value ?? null, null, 2) }]
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
} catch (err) {
|
|
188
|
+
const message = err instanceof Error ? err.message : `tool "${toolName}" failed: ${String(err)}`;
|
|
189
|
+
return {
|
|
190
|
+
jsonrpc: "2.0",
|
|
191
|
+
id,
|
|
192
|
+
result: toolErrorText(message)
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
default:
|
|
197
|
+
return {
|
|
198
|
+
jsonrpc: "2.0",
|
|
199
|
+
id,
|
|
200
|
+
error: {
|
|
201
|
+
code: TASK_MCP_JSON_RPC_ERRORS.METHOD_NOT_FOUND,
|
|
202
|
+
message: `method not found: ${method}`
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
return {
|
|
208
|
+
handleRequest,
|
|
209
|
+
listTools: () => toolDefs,
|
|
210
|
+
callTool
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
export {
|
|
214
|
+
toJsonSchemaDocument,
|
|
215
|
+
negotiateTaskMcpProtocolVersion,
|
|
216
|
+
createTaskMcpToolDefinitions,
|
|
217
|
+
createTaskMcpServer,
|
|
218
|
+
TASK_MCP_TOOL_NAMES,
|
|
219
|
+
TASK_MCP_SUPPORTED_PROTOCOL_VERSIONS,
|
|
220
|
+
TASK_MCP_JSON_RPC_ERRORS,
|
|
221
|
+
TASK_MCP_DEFAULT_PROTOCOL_VERSION
|
|
222
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Task MCP Server — roy's task tools over MCP, reusable by any host.
|
|
3
|
+
*
|
|
4
|
+
* Task #4619 —「代码逻辑都在 roy-agent,插件只是薄的一层」的核心交付之一。
|
|
5
|
+
*
|
|
6
|
+
* ## 为什么 core 需要这个模块
|
|
7
|
+
*
|
|
8
|
+
* `roy-agent-core` 之前**只有 MCP client**(`packages/core/src/env/mcp/*`),
|
|
9
|
+
* 没有任何 server。结果每一个「MCP 说话」的宿主都得自己写一个 server,
|
|
10
|
+
* 而 server 之上还得自己实现一遍 task 语义 —— 于是出现了
|
|
11
|
+
* `roy-plugin-for-agent/claude/mcp/roy-task-mcp-server.mjs`(281 行)+
|
|
12
|
+
* `claude/mcp/bridge.mjs`(482 行裸 SQL)这套复刻。
|
|
13
|
+
*
|
|
14
|
+
* 本模块把「MCP 传输 + 工具装配」收进 core:
|
|
15
|
+
*
|
|
16
|
+
* ```
|
|
17
|
+
* 宿主(Claude Code / Codex / opencode / …)
|
|
18
|
+
* └─ 只做一件事:new TaskMcpServer(backend) 并把 stdin/stdout 接上
|
|
19
|
+
* └─ 工具定义、JSON Schema、语义、错误封装 ← 全在 core
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* 语义本身来自 `TaskBackend`(= `TaskStoreBackend`),工具描述与参数 schema
|
|
23
|
+
* 来自 core 自己的工具工厂(`createTaskTool` / `treeTasksTool` / …),
|
|
24
|
+
* **不是**手抄的副本。
|
|
25
|
+
*
|
|
26
|
+
* ## 依赖注入
|
|
27
|
+
*
|
|
28
|
+
* 宿主提供 `TaskBackend`(`@ai-setting/roy-agent-core/env/task/backend`):
|
|
29
|
+
*
|
|
30
|
+
* - 想读 roy 自己的库 → `createSQLiteTaskPort()` + `TaskStoreBackend`
|
|
31
|
+
* - 想用自己的库 → 实现 `TaskPersistencePort` + `TaskStoreBackend`
|
|
32
|
+
* - 已有 sidecar 词表 → `createRoySidecarTaskPort(store, vocabulary)`
|
|
33
|
+
*
|
|
34
|
+
* 三种都拿到**完全相同**的语义与工具面。
|
|
35
|
+
*/
|
|
36
|
+
import type { TaskBackend } from "../backend/types";
|
|
37
|
+
/** The task tools exposed over MCP. */
|
|
38
|
+
export declare const TASK_MCP_TOOL_NAMES: readonly ["task_create", "task_tree", "task_get", "task_list", "task_search", "task_update", "task_complete", "task_operation_create", "task_operation_list"];
|
|
39
|
+
export type TaskMcpToolName = (typeof TASK_MCP_TOOL_NAMES)[number];
|
|
40
|
+
/** An MCP tool definition (JSON Schema document — MCP requires JSON Schema). */
|
|
41
|
+
export interface TaskMcpToolDefinition {
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
inputSchema: Record<string, unknown>;
|
|
45
|
+
}
|
|
46
|
+
/** JSON-RPC error codes used by this server. */
|
|
47
|
+
export declare const TASK_MCP_JSON_RPC_ERRORS: Readonly<{
|
|
48
|
+
PARSE_ERROR: -32700;
|
|
49
|
+
INVALID_REQUEST: -32600;
|
|
50
|
+
METHOD_NOT_FOUND: -32601;
|
|
51
|
+
INVALID_PARAMS: -32602;
|
|
52
|
+
INTERNAL_ERROR: -32603;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* MCP protocol versions this server understands.
|
|
56
|
+
*
|
|
57
|
+
* ⚠️ Task #4622 — `2025-11-25` was **missing** here.
|
|
58
|
+
*
|
|
59
|
+
* Task #4619 moved this contract into core but copied the list without the
|
|
60
|
+
* newest entry. That regressed the handshake in two ways:
|
|
61
|
+
*
|
|
62
|
+
* 1. `@modelcontextprotocol/sdk@1.29.0` (this repo's own dependency)
|
|
63
|
+
* declares `LATEST_PROTOCOL_VERSION = '2025-11-25'` — a modern client
|
|
64
|
+
* asks for exactly that version.
|
|
65
|
+
* 2. The **already published** plugin (`@ai-setting/roy-task-plugin@0.6.1`)
|
|
66
|
+
* listed `2025-11-25` first and used it as its `DEFAULT_PROTOCOL_VERSION`.
|
|
67
|
+
*
|
|
68
|
+
* So core without it silently *downgraded* the negotiated version relative
|
|
69
|
+
* to the plugin release users already run. The list must stay a superset of
|
|
70
|
+
* the SDK's own list, newest first.
|
|
71
|
+
*/
|
|
72
|
+
export declare const TASK_MCP_SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
|
|
73
|
+
export declare const TASK_MCP_DEFAULT_PROTOCOL_VERSION = "2025-11-25";
|
|
74
|
+
export interface TaskMcpServerOptions {
|
|
75
|
+
/** Server name reported in `initialize`. */
|
|
76
|
+
name?: string;
|
|
77
|
+
/** Server version reported in `initialize`. */
|
|
78
|
+
version?: string;
|
|
79
|
+
/** Session id stamped on created tasks / operations. */
|
|
80
|
+
sessionId?: string;
|
|
81
|
+
/** Working directory reported to tools that want one. */
|
|
82
|
+
workdir?: string;
|
|
83
|
+
}
|
|
84
|
+
/** A JSON-RPC request as it arrives on the wire. */
|
|
85
|
+
export interface TaskMcpRequest {
|
|
86
|
+
jsonrpc?: string;
|
|
87
|
+
id?: number | string | null;
|
|
88
|
+
method?: string;
|
|
89
|
+
params?: Record<string, unknown>;
|
|
90
|
+
}
|
|
91
|
+
/** A JSON-RPC response. `null` means "no response" (notification). */
|
|
92
|
+
export interface TaskMcpResponse {
|
|
93
|
+
jsonrpc: "2.0";
|
|
94
|
+
id: number | string | null;
|
|
95
|
+
result?: Record<string, unknown>;
|
|
96
|
+
error?: {
|
|
97
|
+
code: number;
|
|
98
|
+
message: string;
|
|
99
|
+
data?: unknown;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/** The server handle a host drives. */
|
|
103
|
+
export interface TaskMcpServer {
|
|
104
|
+
/**
|
|
105
|
+
* Handle one JSON-RPC request. Returns `null` for notifications.
|
|
106
|
+
*
|
|
107
|
+
* Async because tool execution is async — a host that speaks JSON-RPC over
|
|
108
|
+
* stdio awaits this before writing the response.
|
|
109
|
+
*/
|
|
110
|
+
handleRequest(request: TaskMcpRequest): Promise<TaskMcpResponse | null>;
|
|
111
|
+
/** The tool surface this server exposes. */
|
|
112
|
+
listTools(): TaskMcpToolDefinition[];
|
|
113
|
+
/** Invoke a tool by name (throws on unknown tool). */
|
|
114
|
+
callTool(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Convert a zod schema (v3) into a JSON Schema document.
|
|
118
|
+
*
|
|
119
|
+
* MCP requires a **JSON Schema document**, not a zod object. roy's
|
|
120
|
+
* `task_operation_create` / `task_operation_list` use `ZodEffects`
|
|
121
|
+
* (preprocess + transform), so the inner schema is unwrapped first.
|
|
122
|
+
*
|
|
123
|
+
* Fault-isolated: a conversion failure degrades to `{}` (the tool advertises
|
|
124
|
+
* no parameters) rather than breaking server startup.
|
|
125
|
+
*/
|
|
126
|
+
export declare function toJsonSchemaDocument(parameters: unknown): Record<string, unknown>;
|
|
127
|
+
/**
|
|
128
|
+
* Build the MCP tool definitions for a backend.
|
|
129
|
+
*
|
|
130
|
+
* The descriptions and parameter schemas come from **core's own tool
|
|
131
|
+
* factories** — a host never has to hand-write them.
|
|
132
|
+
*/
|
|
133
|
+
export declare function createTaskMcpToolDefinitions(backend: TaskBackend): TaskMcpToolDefinition[];
|
|
134
|
+
/** Negotiate a protocol version, falling back to our default. */
|
|
135
|
+
export declare function negotiateTaskMcpProtocolVersion(requested?: string): string;
|
|
136
|
+
/**
|
|
137
|
+
* Create a task MCP server bound to a `TaskBackend`.
|
|
138
|
+
*
|
|
139
|
+
* The returned handle is transport-agnostic: the host decides how bytes get
|
|
140
|
+
* in and out (stdio for Claude Code, an HTTP/SSE transport, a socket, …).
|
|
141
|
+
*/
|
|
142
|
+
export declare function createTaskMcpServer(backend: TaskBackend, options?: TaskMcpServerOptions): TaskMcpServer;
|
|
@@ -6,3 +6,4 @@ export { createAutoTaskPlugin, type AutoTaskPluginConfig, } from "./auto-task-pl
|
|
|
6
6
|
export { WORKFLOW_EXTRACTOR_PROMPT, formatExtractorInput, formatExtractorInputFromDescription, parseExtractorOutput, } from "./workflow-extractor-agent";
|
|
7
7
|
export { LarkCliTaskNotifyHook, createLarkCliTaskNotifyHook, type TaskNotifyConfig, NotifyType, } from "./lark-cli-task-notify-plugin";
|
|
8
8
|
export { PerTaskGroupChatPlugin, createPerTaskGroupChatPlugin, type PerTaskGroupConfig, } from "./per-task-group-chat-plugin";
|
|
9
|
+
export { LarkCardPatchNotifier, type LarkCardPatchNotifierOptions, buildTaskCard, buildWorkflowCard, renderProgressBar, renderMilestones, renderProcessSteps, renderTaskInfoLines, renderContextAsLines, renderWorkflowInfoLines, formatTimestampForDisplay, formatDateTimeForDisplay, formatDurationMs, sanitizeInlineText, humanizeValue, resolveTaskTitleForDisplay, buildChatAppLink, DEFAULT_APP_LINK_BASE, type CardStatus, type WorkflowCardStatus, type Milestone, type ProcessStep, type TaskMeta, type WorkflowMeta, type CardPayload, type StartTaskOptions, type UpdateTaskOptions, type FinishTaskOptions, type StartTaskResult, type StartWorkflowOptions, type UpdateWorkflowOptions, type FinishWorkflowOptions, } from "./lark-card-patch-notifier";
|
|
@@ -10,34 +10,69 @@ import {
|
|
|
10
10
|
formatExtractorInput,
|
|
11
11
|
formatExtractorInputFromDescription,
|
|
12
12
|
parseExtractorOutput
|
|
13
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
14
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
15
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
13
|
+
} from "../../../shared/@ai-setting/roy-agent-core-n1ck0x1r.js";
|
|
14
|
+
import"../../../shared/@ai-setting/roy-agent-core-z51jktet.js";
|
|
15
|
+
import"../../../shared/@ai-setting/roy-agent-core-xeqp659x.js";
|
|
16
16
|
import"../../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
17
17
|
import"../../../shared/@ai-setting/roy-agent-core-6masakz4.js";
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
import {
|
|
19
|
+
DEFAULT_APP_LINK_BASE,
|
|
20
|
+
LarkCardPatchNotifier,
|
|
21
|
+
buildChatAppLink,
|
|
22
|
+
buildTaskCard,
|
|
23
|
+
buildWorkflowCard,
|
|
24
|
+
formatDateTimeForDisplay,
|
|
25
|
+
formatDurationMs,
|
|
26
|
+
formatTimestampForDisplay,
|
|
27
|
+
humanizeValue,
|
|
28
|
+
renderContextAsLines,
|
|
29
|
+
renderMilestones,
|
|
30
|
+
renderProcessSteps,
|
|
31
|
+
renderProgressBar,
|
|
32
|
+
renderTaskInfoLines,
|
|
33
|
+
renderWorkflowInfoLines,
|
|
34
|
+
resolveTaskTitleForDisplay,
|
|
35
|
+
sanitizeInlineText
|
|
36
|
+
} from "../../../shared/@ai-setting/roy-agent-core-yd85623y.js";
|
|
37
|
+
import"../../../shared/@ai-setting/roy-agent-core-8fy467qs.js";
|
|
38
|
+
import"../../../shared/@ai-setting/roy-agent-core-60p2380d.js";
|
|
21
39
|
import"../../../shared/@ai-setting/roy-agent-core-jrj30vq3.js";
|
|
22
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
40
|
+
import"../../../shared/@ai-setting/roy-agent-core-hf0t8agb.js";
|
|
23
41
|
import"../../../shared/@ai-setting/roy-agent-core-e25xkv53.js";
|
|
24
42
|
import"../../../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
25
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
26
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
27
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
28
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
43
|
+
import"../../../shared/@ai-setting/roy-agent-core-bdzdw1g3.js";
|
|
44
|
+
import"../../../shared/@ai-setting/roy-agent-core-qrjs2500.js";
|
|
45
|
+
import"../../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
46
|
+
import"../../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
29
47
|
import"../../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
30
48
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
31
49
|
export {
|
|
50
|
+
sanitizeInlineText,
|
|
51
|
+
resolveTaskTitleForDisplay,
|
|
52
|
+
renderWorkflowInfoLines,
|
|
53
|
+
renderTaskInfoLines,
|
|
54
|
+
renderProgressBar,
|
|
55
|
+
renderProcessSteps,
|
|
56
|
+
renderMilestones,
|
|
57
|
+
renderContextAsLines,
|
|
32
58
|
parseExtractorOutput,
|
|
59
|
+
humanizeValue,
|
|
60
|
+
formatTimestampForDisplay,
|
|
33
61
|
formatExtractorInputFromDescription,
|
|
34
62
|
formatExtractorInput,
|
|
63
|
+
formatDurationMs,
|
|
64
|
+
formatDateTimeForDisplay,
|
|
35
65
|
createPerTaskGroupChatPlugin,
|
|
36
66
|
createLarkCliTaskNotifyHook,
|
|
37
67
|
createAutoTaskPlugin,
|
|
68
|
+
buildWorkflowCard,
|
|
69
|
+
buildTaskCard,
|
|
70
|
+
buildChatAppLink,
|
|
38
71
|
WORKFLOW_EXTRACTOR_PROMPT,
|
|
39
72
|
TaskTagPlugin,
|
|
40
73
|
PerTaskGroupChatPlugin,
|
|
41
74
|
NotifyType,
|
|
42
|
-
LarkCliTaskNotifyHook
|
|
75
|
+
LarkCliTaskNotifyHook,
|
|
76
|
+
LarkCardPatchNotifier,
|
|
77
|
+
DEFAULT_APP_LINK_BASE
|
|
43
78
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
1
|
+
import"../../../shared/@ai-setting/roy-agent-core-khc23qs1.js";
|
|
2
2
|
import {
|
|
3
3
|
SQLiteTaskStore,
|
|
4
4
|
getDefaultDataDir,
|
|
5
5
|
getDefaultTaskDbPath
|
|
6
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
7
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
8
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
6
|
+
} from "../../../shared/@ai-setting/roy-agent-core-xeqp659x.js";
|
|
7
|
+
import"../../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
8
|
+
import"../../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
10
10
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
11
11
|
export {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Migration logging helper.
|
|
3
|
+
*
|
|
4
|
+
* Task #4619 — the task migrations used to print with `console.log`, which
|
|
5
|
+
* is **stdout**.
|
|
6
|
+
*
|
|
7
|
+
* That is fatal for a stdio MCP server: the MCP stdio transport is
|
|
8
|
+
* newline-delimited JSON-RPC on stdout, and one stray non-JSON line makes
|
|
9
|
+
* the client drop the server (Claude Code reports
|
|
10
|
+
* `mcp_servers: [{"name":"plugin:roy-task:roy-task","status":"failed"}]`).
|
|
11
|
+
*
|
|
12
|
+
* Measured: the plugin's MCP server emitted **24 of 26 stdout lines** that
|
|
13
|
+
* were not JSON — 5 migration banners plus core's `[INFO]` trace lines.
|
|
14
|
+
*
|
|
15
|
+
* So migration output goes to **stderr**, always. It is diagnostics, not
|
|
16
|
+
* protocol.
|
|
17
|
+
*/
|
|
18
|
+
/** Print one migration diagnostic to stderr (never stdout). */
|
|
19
|
+
export declare function logMigration(message: string): void;
|
|
@@ -11,6 +11,26 @@
|
|
|
11
11
|
* - 内存缓存提高性能
|
|
12
12
|
* - 默认路径:~/.local/share/roy-agent/tasks.db
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* 获取 SQLite 数据库类
|
|
16
|
+
*
|
|
17
|
+
* 根据运行时环境选择正确的实现:
|
|
18
|
+
* - Bun 运行时:使用 bun:sqlite(命名导出)
|
|
19
|
+
* - Node.js 22.5+:使用 node:sqlite(内置,无需原生编译)
|
|
20
|
+
* - 旧版 Node.js/Electron:使用 better-sqlite3(默认导出,需要原生编译)
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ Task #4619:`node:sqlite` 优先于 `better-sqlite3`。
|
|
23
|
+
*
|
|
24
|
+
* `better-sqlite3` 是**原生插件**。插件的 Claude 侧 MCP server 是
|
|
25
|
+
* `#!/usr/bin/env node` 的 `.mjs` 脚本 —— 纯 node 环境。它不能依赖一个
|
|
26
|
+
* 需要编译的原生模块(插件自己的 `bridge.mjs` 注释记录了 better-sqlite3
|
|
27
|
+
* 在 node 24 下 `Assertion failed: (env) != nullptr` 直接 abort 进程)。
|
|
28
|
+
*
|
|
29
|
+
* `node:sqlite`(Node 22.5+,Node 24 已 stable)是 **node 内置**的,
|
|
30
|
+
* 且 `prepare(sql).all() / .get() / .run()` 与 better-sqlite3 同形,
|
|
31
|
+
* 所以 `createCompatibleDatabase` 的 shim 无需改动即可工作。
|
|
32
|
+
*/
|
|
33
|
+
export declare function getDatabaseClass(): new (path: string) => any;
|
|
14
34
|
/**
|
|
15
35
|
* 创建兼容的 Database 实例
|
|
16
36
|
*
|
|
@@ -21,6 +41,15 @@
|
|
|
21
41
|
* 此函数确保两种实现都有 run() 方法
|
|
22
42
|
*/
|
|
23
43
|
export declare function createCompatibleDatabase(path: string): any;
|
|
44
|
+
/**
|
|
45
|
+
* Apply the bun:sqlite ↔ better-sqlite3 / node:sqlite compat shim to an
|
|
46
|
+
* **existing** database handle.
|
|
47
|
+
*
|
|
48
|
+
* Task #4619 — factored out of `createCompatibleDatabase` so the shim can be
|
|
49
|
+
* applied to a `node:sqlite` handle (which the plugin's plain-node MCP
|
|
50
|
+
* server uses) without going through the driver constructor.
|
|
51
|
+
*/
|
|
52
|
+
export declare function createCompatibleDatabaseFrom(db: any): any;
|
|
24
53
|
import type { Task, TaskOperation, TaskTag, CreateTaskOptions, UpdateTaskOptions, ListTasksOptions, TaskListResult, SearchTasksOptions, CreateOperationOptions, ListOperationsOptions } from "../types";
|
|
25
54
|
import type { ListTagsOptions, SearchTagsOptions } from "../tag-service";
|
|
26
55
|
/**
|
|
@@ -137,11 +137,56 @@ export declare class TaskComponent extends BaseComponent {
|
|
|
137
137
|
getTaskIdBySessionId(sessionId: string): Promise<number | undefined>;
|
|
138
138
|
/**
|
|
139
139
|
* Get task with operations
|
|
140
|
+
*
|
|
141
|
+
* Task #4619 (cross-validation M-2): the result is **flat** —
|
|
142
|
+
* `{ ...task, operations }` — not `{ task, operations }`.
|
|
143
|
+
*
|
|
144
|
+
* Two independent reasons, both about the published contract:
|
|
145
|
+
*
|
|
146
|
+
* 1. The old plugin's `taskGet` returned `{ ...task, operations }`, and
|
|
147
|
+
* that flat shape is what every client written against the published
|
|
148
|
+
* plugin reads (`task.title`, `task.operations`). Nesting moved every
|
|
149
|
+
* task field one level down — just as breaking as dropping the
|
|
150
|
+
* operations.
|
|
151
|
+
* 2. `TaskStoreBackend.getTaskWithOperations()` (the backend the plugin
|
|
152
|
+
* binds) already returns the flat shape. The two implementations had
|
|
153
|
+
* drifted, so the same tool produced two different shapes depending on
|
|
154
|
+
* which backend it was bound to.
|
|
155
|
+
*
|
|
156
|
+
* ---
|
|
157
|
+
*
|
|
158
|
+
* Task #4622: the flat shape ALSO carries a **nested `task` alias**, so
|
|
159
|
+
* the already-published `@ai-setting/roy-agent-cli@1.7.59` keeps working.
|
|
160
|
+
*
|
|
161
|
+
* That CLI declares `"@ai-setting/roy-agent-core": "^1.5.83"` — a range
|
|
162
|
+
* that accepts 1.7.61 — and its `tasks get` command reads the **nested**
|
|
163
|
+
* shape:
|
|
164
|
+
*
|
|
165
|
+
* const result = await taskComponent.getTaskWithOperations(args.id);
|
|
166
|
+
* output.log(`Task #${result.task.id}: ${result.task.title}`);
|
|
167
|
+
*
|
|
168
|
+
* Publishing the flat-only shape therefore broke `roy-agent tasks get`
|
|
169
|
+
* for every user still on CLI 1.7.59:
|
|
170
|
+
*
|
|
171
|
+
* TypeError: Cannot read properties of undefined (reading 'id')
|
|
172
|
+
*
|
|
173
|
+
* (Measured against the real published tarball, not reasoned about.)
|
|
174
|
+
*
|
|
175
|
+
* So the result carries **both** views:
|
|
176
|
+
*
|
|
177
|
+
* result.id → flat access (the plugin's MCP contract)
|
|
178
|
+
* result.task.id → nested access (published CLI 1.7.59)
|
|
179
|
+
*
|
|
180
|
+
* The alias points at the **same object** the flat fields were spread
|
|
181
|
+
* from, so the two views can never disagree. It is deliberately **not**
|
|
182
|
+
* self-referential (`result.task === result`), because that would make
|
|
183
|
+
* `JSON.stringify` throw "Converting circular structure to JSON" — and
|
|
184
|
+
* this very object is what `task_get` serialises for the MCP wire.
|
|
140
185
|
*/
|
|
141
|
-
getTaskWithOperations(id: number): Promise<{
|
|
142
|
-
task: Task;
|
|
186
|
+
getTaskWithOperations(id: number): Promise<(Task & {
|
|
143
187
|
operations: TaskOperation[];
|
|
144
|
-
|
|
188
|
+
task: Task;
|
|
189
|
+
}) | undefined>;
|
|
145
190
|
/**
|
|
146
191
|
* Update task
|
|
147
192
|
*/
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
searchTasksTool,
|
|
10
10
|
treeTasksTool,
|
|
11
11
|
updateTaskTool
|
|
12
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
13
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
14
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
15
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
12
|
+
} from "../../../shared/@ai-setting/roy-agent-core-ymcvsdzn.js";
|
|
13
|
+
import"../../../shared/@ai-setting/roy-agent-core-qrjs2500.js";
|
|
14
|
+
import"../../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
15
|
+
import"../../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
16
16
|
import"../../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
17
17
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
18
18
|
export {
|