@ai-setting/roy-agent-core 1.7.59 → 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 +1 -0
- package/dist/env/event-source/index.d.ts +3 -1
- package/dist/env/event-source/index.js +30 -20
- package/dist/env/event-source/types.d.ts +21 -1
- package/dist/env/hook/index.js +6 -6
- 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-6q5m1qk5.js → roy-agent-core-ytnedzks.js} +239 -90
- 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
|
@@ -10,6 +10,6 @@ export { LogTraceComponent, type LogTraceConfig, type LogTraceComponentOptions,
|
|
|
10
10
|
export { OTelTracerProvider, getTracerProvider, resetTracerProvider, type OTelTracer, type OTelSpan, type SpanOptions, } from "./opentelemetry/tracer-provider";
|
|
11
11
|
export { propagation, serialize, parse, type ExtractedContext, } from "./opentelemetry/propagation";
|
|
12
12
|
export { injectToEnv, injectToEnvWithContext, injectToEnvFromCarrier, getTraceparentHeader, type EnvCarrier, } from "./opentelemetry/propagation-env";
|
|
13
|
-
export { createLogger, setQuietMode, isQuietMode, setConfigComponent as setLoggerConfigComponent, getLogLevel, getLogLevels, getLogDir, getLogFile, setLogDirOverride, getLogDirOverride, simplifyFilePath, getMaxOutput, } from "./logger";
|
|
13
|
+
export { createLogger, setQuietMode, isQuietMode, setStdoutStrictMode, isStdoutStrictMode, setConfigComponent as setLoggerConfigComponent, getLogLevel, getLogLevels, getLogDir, getLogFile, setLogDirOverride, getLogDirOverride, simplifyFilePath, getMaxOutput, } from "./logger";
|
|
14
14
|
export { TracedAs, Traced, TracedLightweight, wrapFunction, type TracedOptions } from "./decorator";
|
|
15
15
|
export { isTraceFullMode, resetTraceFullModeCache, llmInvokeParamFilter, llmInvokeResultFilter, messagesParamFilter, toolExecParamFilter, toolInvokeParamFilter, toolExecResultFilter, envQueryParamFilter, agentRunParamFilter, recordSessionMessagesParamFilter, embedParamFilter, embedResultFilter, } from "./trace-filters";
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
injectToEnv,
|
|
8
8
|
injectToEnvFromCarrier,
|
|
9
9
|
injectToEnvWithContext
|
|
10
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
10
|
+
} from "../../shared/@ai-setting/roy-agent-core-0f989bnp.js";
|
|
11
11
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
12
|
-
import"../../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-
|
|
16
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
12
|
+
import"../../shared/@ai-setting/roy-agent-core-9s3payp1.js";
|
|
13
|
+
import"../../shared/@ai-setting/roy-agent-core-expvav8a.js";
|
|
14
|
+
import"../../shared/@ai-setting/roy-agent-core-ajmgyawx.js";
|
|
15
|
+
import"../../shared/@ai-setting/roy-agent-core-bdzdw1g3.js";
|
|
16
|
+
import"../../shared/@ai-setting/roy-agent-core-qrjs2500.js";
|
|
17
17
|
import {
|
|
18
18
|
Traced,
|
|
19
19
|
TracedAs,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
toolExecResultFilter,
|
|
33
33
|
toolInvokeParamFilter,
|
|
34
34
|
wrapFunction
|
|
35
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
35
|
+
} from "../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
36
36
|
import {
|
|
37
37
|
OTelTracerProvider,
|
|
38
38
|
SpanKind,
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
getMaxOutput,
|
|
47
47
|
getTracerProvider,
|
|
48
48
|
isQuietMode,
|
|
49
|
+
isStdoutStrictMode,
|
|
49
50
|
parse,
|
|
50
51
|
propagation,
|
|
51
52
|
resetTracerProvider,
|
|
@@ -53,8 +54,9 @@ import {
|
|
|
53
54
|
setConfigComponent,
|
|
54
55
|
setLogDirOverride,
|
|
55
56
|
setQuietMode,
|
|
57
|
+
setStdoutStrictMode,
|
|
56
58
|
simplifyFilePath
|
|
57
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
59
|
+
} from "../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
58
60
|
import {
|
|
59
61
|
SQLiteSpanStorage
|
|
60
62
|
} from "../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
@@ -65,6 +67,7 @@ export {
|
|
|
65
67
|
toolExecResultFilter,
|
|
66
68
|
toolExecParamFilter,
|
|
67
69
|
simplifyFilePath,
|
|
70
|
+
setStdoutStrictMode,
|
|
68
71
|
setQuietMode,
|
|
69
72
|
setConfigComponent as setLoggerConfigComponent,
|
|
70
73
|
setLogDirOverride,
|
|
@@ -78,6 +81,7 @@ export {
|
|
|
78
81
|
llmInvokeResultFilter,
|
|
79
82
|
llmInvokeParamFilter,
|
|
80
83
|
isTraceFullMode,
|
|
84
|
+
isStdoutStrictMode,
|
|
81
85
|
isQuietMode,
|
|
82
86
|
injectToEnvWithContext,
|
|
83
87
|
injectToEnvFromCarrier,
|
|
@@ -22,6 +22,8 @@ export declare function simplifyFilePath(fullPath: string): string;
|
|
|
22
22
|
import type { LogLevel, ILogger } from "./types";
|
|
23
23
|
export declare function isQuietMode(): boolean;
|
|
24
24
|
export declare function setQuietMode(enabled: boolean): void;
|
|
25
|
+
export declare function isStdoutStrictMode(): boolean;
|
|
26
|
+
export declare function setStdoutStrictMode(enabled: boolean): void;
|
|
25
27
|
/**
|
|
26
28
|
* 设置 ConfigComponent 实例(用于实时配置读取)
|
|
27
29
|
*/
|
package/dist/env/mcp/index.js
CHANGED
|
@@ -10,21 +10,21 @@ import {
|
|
|
10
10
|
augmentNpmEnvForPackageRunner,
|
|
11
11
|
getMcpPathPriority,
|
|
12
12
|
resolvePackageRunnerCommand
|
|
13
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
13
|
+
} from "../../shared/@ai-setting/roy-agent-core-qw5fpa24.js";
|
|
14
14
|
import {
|
|
15
15
|
adaptMcpTool,
|
|
16
16
|
convertInputSchemaToZod,
|
|
17
17
|
createMcpToolsDescription
|
|
18
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
18
|
+
} from "../../shared/@ai-setting/roy-agent-core-jsn21cb9.js";
|
|
19
19
|
import"../../shared/@ai-setting/roy-agent-core-ctdhjv68.js";
|
|
20
20
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
21
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
22
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
23
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
24
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
25
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
26
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
27
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
21
|
+
import"../../shared/@ai-setting/roy-agent-core-9s3payp1.js";
|
|
22
|
+
import"../../shared/@ai-setting/roy-agent-core-expvav8a.js";
|
|
23
|
+
import"../../shared/@ai-setting/roy-agent-core-ajmgyawx.js";
|
|
24
|
+
import"../../shared/@ai-setting/roy-agent-core-bdzdw1g3.js";
|
|
25
|
+
import"../../shared/@ai-setting/roy-agent-core-qrjs2500.js";
|
|
26
|
+
import"../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
27
|
+
import"../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
28
28
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
29
29
|
import {
|
|
30
30
|
ensureFallbackNpmPrefix,
|
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
adaptMcpTool,
|
|
3
3
|
convertInputSchemaToZod,
|
|
4
4
|
createMcpToolsDescription
|
|
5
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
6
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
5
|
+
} from "../../../shared/@ai-setting/roy-agent-core-jsn21cb9.js";
|
|
6
|
+
import"../../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
7
7
|
import"../../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
8
8
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
9
9
|
export {
|
package/dist/env/memory/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
MemoryComponent,
|
|
4
4
|
SOURCE_PRIORITY,
|
|
5
5
|
getSourcePriority
|
|
6
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
6
|
+
} from "../../shared/@ai-setting/roy-agent-core-xc0es9zc.js";
|
|
7
7
|
import {
|
|
8
8
|
RecallMemorySchema,
|
|
9
9
|
RecordMemorySchema
|
|
@@ -23,15 +23,15 @@ import {
|
|
|
23
23
|
generateProjectSummary,
|
|
24
24
|
parseMemoryAgentOutput,
|
|
25
25
|
recallMemory
|
|
26
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
26
|
+
} from "../../shared/@ai-setting/roy-agent-core-x1m0gs0q.js";
|
|
27
27
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
28
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
29
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
30
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
31
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
32
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
33
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
34
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
28
|
+
import"../../shared/@ai-setting/roy-agent-core-9s3payp1.js";
|
|
29
|
+
import"../../shared/@ai-setting/roy-agent-core-expvav8a.js";
|
|
30
|
+
import"../../shared/@ai-setting/roy-agent-core-ajmgyawx.js";
|
|
31
|
+
import"../../shared/@ai-setting/roy-agent-core-bdzdw1g3.js";
|
|
32
|
+
import"../../shared/@ai-setting/roy-agent-core-qrjs2500.js";
|
|
33
|
+
import"../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
34
|
+
import"../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
35
35
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
36
36
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
37
37
|
export {
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
generateProjectSummary,
|
|
14
14
|
parseMemoryAgentOutput,
|
|
15
15
|
recallMemory
|
|
16
|
-
} from "../../../shared/@ai-setting/roy-agent-core-
|
|
17
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
16
|
+
} from "../../../shared/@ai-setting/roy-agent-core-x1m0gs0q.js";
|
|
17
|
+
import"../../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
18
18
|
import"../../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
19
19
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
20
20
|
export {
|
package/dist/env/plugin/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EventBusNotificationChannel,
|
|
3
3
|
PluginComponent
|
|
4
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
4
|
+
} from "../../shared/@ai-setting/roy-agent-core-aa514zm8.js";
|
|
5
5
|
import {
|
|
6
6
|
normalizeLarkAtMentions
|
|
7
7
|
} from "../../shared/@ai-setting/roy-agent-core-64f22h1g.js";
|
|
8
8
|
import {
|
|
9
9
|
BasePlugin
|
|
10
10
|
} from "../../shared/@ai-setting/roy-agent-core-az13yzmc.js";
|
|
11
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
12
|
-
import"../../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-
|
|
16
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
11
|
+
import"../../shared/@ai-setting/roy-agent-core-9s3payp1.js";
|
|
12
|
+
import"../../shared/@ai-setting/roy-agent-core-expvav8a.js";
|
|
13
|
+
import"../../shared/@ai-setting/roy-agent-core-ajmgyawx.js";
|
|
14
|
+
import"../../shared/@ai-setting/roy-agent-core-bdzdw1g3.js";
|
|
15
|
+
import"../../shared/@ai-setting/roy-agent-core-qrjs2500.js";
|
|
16
|
+
import"../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
17
17
|
import {
|
|
18
18
|
createLogger,
|
|
19
19
|
init_logger
|
|
20
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
20
|
+
} from "../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
21
21
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
22
22
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
23
23
|
// src/env/plugin/lark-cli-notification-channel.ts
|
package/dist/env/prompt/index.js
CHANGED
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
PromptConfigSchema,
|
|
4
4
|
PromptPathSchema,
|
|
5
5
|
PromptRenderer
|
|
6
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
6
|
+
} from "../../shared/@ai-setting/roy-agent-core-e6k448ka.js";
|
|
7
7
|
import"../../shared/@ai-setting/roy-agent-core-6masakz4.js";
|
|
8
8
|
import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
9
9
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
10
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
11
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
12
|
-
import"../../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-
|
|
16
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
10
|
+
import"../../shared/@ai-setting/roy-agent-core-9s3payp1.js";
|
|
11
|
+
import"../../shared/@ai-setting/roy-agent-core-expvav8a.js";
|
|
12
|
+
import"../../shared/@ai-setting/roy-agent-core-ajmgyawx.js";
|
|
13
|
+
import"../../shared/@ai-setting/roy-agent-core-bdzdw1g3.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
17
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
18
18
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
19
19
|
export {
|
|
@@ -3,25 +3,25 @@ import {
|
|
|
3
3
|
MIN_SESSION_ID_LENGTH,
|
|
4
4
|
SessionComponent,
|
|
5
5
|
isValidSessionId
|
|
6
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
6
|
+
} from "../../shared/@ai-setting/roy-agent-core-rnzm0tpf.js";
|
|
7
7
|
import {
|
|
8
8
|
MemorySessionStore
|
|
9
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
9
|
+
} from "../../shared/@ai-setting/roy-agent-core-vmfk4m1v.js";
|
|
10
10
|
import"../../shared/@ai-setting/roy-agent-core-ze068vc9.js";
|
|
11
11
|
import"../../shared/@ai-setting/roy-agent-core-rvxg1wps.js";
|
|
12
12
|
import {
|
|
13
13
|
SessionMessageConverter
|
|
14
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
15
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
14
|
+
} from "../../shared/@ai-setting/roy-agent-core-jsdqzfbj.js";
|
|
15
|
+
import"../../shared/@ai-setting/roy-agent-core-m2tv4pj0.js";
|
|
16
16
|
import"../../shared/@ai-setting/roy-agent-core-zjdzk1gg.js";
|
|
17
17
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
18
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
19
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
20
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
21
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
22
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
23
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
24
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
18
|
+
import"../../shared/@ai-setting/roy-agent-core-9s3payp1.js";
|
|
19
|
+
import"../../shared/@ai-setting/roy-agent-core-expvav8a.js";
|
|
20
|
+
import"../../shared/@ai-setting/roy-agent-core-ajmgyawx.js";
|
|
21
|
+
import"../../shared/@ai-setting/roy-agent-core-bdzdw1g3.js";
|
|
22
|
+
import"../../shared/@ai-setting/roy-agent-core-qrjs2500.js";
|
|
23
|
+
import"../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
24
|
+
import"../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
25
25
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
26
26
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
27
27
|
export {
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
SQLiteSessionStore,
|
|
4
4
|
getDefaultDataDir,
|
|
5
5
|
getDefaultSessionDbPath
|
|
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-vmfk4m1v.js";
|
|
7
|
+
import"../../../shared/@ai-setting/roy-agent-core-jsdqzfbj.js";
|
|
8
|
+
import"../../../shared/@ai-setting/roy-agent-core-m2tv4pj0.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-zjdzk1gg.js";
|
|
10
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
11
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
10
|
+
import"../../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
11
|
+
import"../../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
12
12
|
import"../../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
13
13
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
14
14
|
export {
|
package/dist/env/skill/index.js
CHANGED
|
@@ -6,20 +6,20 @@ import {
|
|
|
6
6
|
getSourcePriority,
|
|
7
7
|
parseFrontmatter,
|
|
8
8
|
parseSkillFile
|
|
9
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
9
|
+
} from "../../shared/@ai-setting/roy-agent-core-3bpntd80.js";
|
|
10
10
|
import {
|
|
11
11
|
SkillToolSchema,
|
|
12
12
|
buildSkillDescription,
|
|
13
13
|
createSkillTool
|
|
14
14
|
} from "../../shared/@ai-setting/roy-agent-core-psvxt4c9.js";
|
|
15
15
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
16
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
17
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
18
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
19
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
20
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
21
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
22
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
16
|
+
import"../../shared/@ai-setting/roy-agent-core-9s3payp1.js";
|
|
17
|
+
import"../../shared/@ai-setting/roy-agent-core-expvav8a.js";
|
|
18
|
+
import"../../shared/@ai-setting/roy-agent-core-ajmgyawx.js";
|
|
19
|
+
import"../../shared/@ai-setting/roy-agent-core-bdzdw1g3.js";
|
|
20
|
+
import"../../shared/@ai-setting/roy-agent-core-qrjs2500.js";
|
|
21
|
+
import"../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
22
|
+
import"../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
23
23
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
24
24
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
25
25
|
export {
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
BackgroundTaskManager,
|
|
4
4
|
createDelegateTool,
|
|
5
5
|
createStopTool
|
|
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-cndvj1hv.js";
|
|
7
|
+
import"../../../shared/@ai-setting/roy-agent-core-g5sw19fa.js";
|
|
8
|
+
import"../../../shared/@ai-setting/roy-agent-core-z51jktet.js";
|
|
9
9
|
import"../../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
10
10
|
import"../../../shared/@ai-setting/roy-agent-core-6masakz4.js";
|
|
11
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
11
|
+
import"../../../shared/@ai-setting/roy-agent-core-dythsgkn.js";
|
|
12
12
|
import"../../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
13
13
|
import"../../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
14
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
15
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
16
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
17
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
18
|
-
import"../../../shared/@ai-setting/roy-agent-core-
|
|
14
|
+
import"../../../shared/@ai-setting/roy-agent-core-ajmgyawx.js";
|
|
15
|
+
import"../../../shared/@ai-setting/roy-agent-core-bdzdw1g3.js";
|
|
16
|
+
import"../../../shared/@ai-setting/roy-agent-core-qrjs2500.js";
|
|
17
|
+
import"../../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
18
|
+
import"../../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
19
19
|
import"../../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
20
20
|
import"../../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
21
21
|
export {
|
package/dist/env/task/index.js
CHANGED
|
@@ -5,34 +5,34 @@ import {
|
|
|
5
5
|
TaskPriorityEnum,
|
|
6
6
|
TaskStatusEnum,
|
|
7
7
|
TaskTypeEnum
|
|
8
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
8
|
+
} from "../../shared/@ai-setting/roy-agent-core-gtb4fj8j.js";
|
|
9
9
|
import"../../shared/@ai-setting/roy-agent-core-amkqnyzy.js";
|
|
10
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
11
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
12
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
10
|
+
import"../../shared/@ai-setting/roy-agent-core-cndvj1hv.js";
|
|
11
|
+
import"../../shared/@ai-setting/roy-agent-core-g5sw19fa.js";
|
|
12
|
+
import"../../shared/@ai-setting/roy-agent-core-khc23qs1.js";
|
|
13
13
|
import {
|
|
14
14
|
TaskEntityEventTypes
|
|
15
15
|
} from "../../shared/@ai-setting/roy-agent-core-8gxth0eh.js";
|
|
16
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
17
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
16
|
+
import"../../shared/@ai-setting/roy-agent-core-ymcvsdzn.js";
|
|
17
|
+
import"../../shared/@ai-setting/roy-agent-core-rn57psp0.js";
|
|
18
|
+
import"../../shared/@ai-setting/roy-agent-core-z51jktet.js";
|
|
18
19
|
import {
|
|
19
20
|
SQLiteTaskStore,
|
|
20
21
|
getDefaultTaskDbPath
|
|
21
|
-
} from "../../shared/@ai-setting/roy-agent-core-
|
|
22
|
-
import"../../shared/@ai-setting/roy-agent-core-2ctyjy62.js";
|
|
22
|
+
} from "../../shared/@ai-setting/roy-agent-core-xeqp659x.js";
|
|
23
23
|
import"../../shared/@ai-setting/roy-agent-core-1pg0fepg.js";
|
|
24
24
|
import"../../shared/@ai-setting/roy-agent-core-6masakz4.js";
|
|
25
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
25
|
+
import"../../shared/@ai-setting/roy-agent-core-dythsgkn.js";
|
|
26
26
|
import"../../shared/@ai-setting/roy-agent-core-qxnbvgwe.js";
|
|
27
27
|
import"../../shared/@ai-setting/roy-agent-core-c1v263jn.js";
|
|
28
28
|
import"../../shared/@ai-setting/roy-agent-core-7hh0brvs.js";
|
|
29
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
30
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
31
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
32
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
33
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
34
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
35
|
-
import"../../shared/@ai-setting/roy-agent-core-
|
|
29
|
+
import"../../shared/@ai-setting/roy-agent-core-9s3payp1.js";
|
|
30
|
+
import"../../shared/@ai-setting/roy-agent-core-expvav8a.js";
|
|
31
|
+
import"../../shared/@ai-setting/roy-agent-core-ajmgyawx.js";
|
|
32
|
+
import"../../shared/@ai-setting/roy-agent-core-bdzdw1g3.js";
|
|
33
|
+
import"../../shared/@ai-setting/roy-agent-core-qrjs2500.js";
|
|
34
|
+
import"../../shared/@ai-setting/roy-agent-core-2qkrpc7m.js";
|
|
35
|
+
import"../../shared/@ai-setting/roy-agent-core-y0k9kaxz.js";
|
|
36
36
|
import"../../shared/@ai-setting/roy-agent-core-jnszp0jq.js";
|
|
37
37
|
import"../../shared/@ai-setting/roy-agent-core-fs0mn2jk.js";
|
|
38
38
|
export {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Task MCP Server — public entry point.
|
|
3
|
+
*
|
|
4
|
+
* Task #4619 — 让「roy 拥有全部逻辑,插件只是薄的一层」在 MCP 侧成立。
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { createTaskMcpServer } from "@ai-setting/roy-agent-core/env/task/mcp";
|
|
8
|
+
* import { TaskStoreBackend, createSQLiteTaskPort } from "@ai-setting/roy-agent-core/env/task/backend";
|
|
9
|
+
*
|
|
10
|
+
* const server = createTaskMcpServer(new TaskStoreBackend(createSQLiteTaskPort()));
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* 宿主只负责「把字节接上」;工具清单、JSON Schema、task 语义、错误封装
|
|
14
|
+
* 全在 core。
|
|
15
|
+
*/
|
|
16
|
+
export { createTaskMcpServer, createTaskMcpToolDefinitions, negotiateTaskMcpProtocolVersion, toJsonSchemaDocument, TASK_MCP_TOOL_NAMES, TASK_MCP_SUPPORTED_PROTOCOL_VERSIONS, TASK_MCP_DEFAULT_PROTOCOL_VERSION, TASK_MCP_JSON_RPC_ERRORS, type TaskMcpToolName, type TaskMcpToolDefinition, type TaskMcpServerOptions, type TaskMcpServer, type TaskMcpRequest, type TaskMcpResponse, } from "./task-mcp-server";
|
|
@@ -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
|
+
};
|