patchwarden 1.1.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +83 -8
- package/README.md +78 -10
- package/dist/assessments/agentAssessor.d.ts +1 -1
- package/dist/assessments/agentAssessor.js +3 -3
- package/dist/assessments/assessmentStore.d.ts +1 -1
- package/dist/assessments/assessmentStore.js +2 -2
- package/dist/assessments/confirmCli.js +5 -4
- package/dist/config.d.ts +7 -0
- package/dist/config.js +34 -0
- package/dist/control/middleware/auth.d.ts +10 -0
- package/dist/control/middleware/auth.js +8 -0
- package/dist/control/middleware/static.d.ts +3 -0
- package/dist/control/middleware/static.js +65 -0
- package/dist/control/routes/audit.d.ts +15 -0
- package/dist/control/routes/audit.js +277 -0
- package/dist/control/routes/evidence.d.ts +4 -0
- package/dist/control/routes/evidence.js +96 -0
- package/dist/control/routes/lineage.d.ts +3 -0
- package/dist/control/routes/lineage.js +71 -0
- package/dist/control/routes/policy.d.ts +3 -0
- package/dist/control/routes/policy.js +81 -0
- package/dist/control/routes/process.d.ts +5 -0
- package/dist/control/routes/process.js +200 -0
- package/dist/control/routes/sessions.d.ts +22 -0
- package/dist/control/routes/sessions.js +224 -0
- package/dist/control/routes/status.d.ts +6 -0
- package/dist/control/routes/status.js +250 -0
- package/dist/control/routes/taskActions.d.ts +21 -0
- package/dist/control/routes/taskActions.js +233 -0
- package/dist/control/routes/tasks.d.ts +20 -0
- package/dist/control/routes/tasks.js +310 -0
- package/dist/control/routes/workspace.d.ts +15 -0
- package/dist/control/routes/workspace.js +193 -0
- package/dist/control/runtime.d.ts +91 -0
- package/dist/control/runtime.js +392 -0
- package/dist/control/server.d.ts +13 -0
- package/dist/control/server.js +479 -0
- package/dist/control/shared.d.ts +35 -0
- package/dist/control/shared.js +288 -0
- package/dist/controlCenter.d.ts +6 -0
- package/dist/controlCenter.js +7 -2001
- package/dist/direct/directGuards.js +30 -8
- package/dist/direct/directSessionStore.d.ts +2 -0
- package/dist/direct/directVerification.js +7 -0
- package/dist/doctor.d.ts +18 -1
- package/dist/doctor.js +579 -348
- package/dist/goal/goalReport.d.ts +54 -0
- package/dist/goal/goalReport.js +204 -0
- package/dist/goal/goalStatus.d.ts +6 -0
- package/dist/goal/specKitImport.d.ts +63 -0
- package/dist/goal/specKitImport.js +220 -0
- package/dist/goal/subgoalSync.js +2 -1
- package/dist/httpServer.js +15 -12
- package/dist/index.js +7 -4
- package/dist/logging.d.ts +7 -1
- package/dist/logging.js +8 -0
- package/dist/policy/projectPolicy.d.ts +55 -0
- package/dist/policy/projectPolicy.js +286 -0
- package/dist/runner/changeCapture.d.ts +3 -3
- package/dist/runner/changeCapture.js +63 -39
- package/dist/runner/cli.js +7 -6
- package/dist/runner/postTaskCleanup.js +26 -2
- package/dist/runner/runTask.js +245 -221
- package/dist/runner/simpleProcess.js +4 -4
- package/dist/runner/watch.js +17 -14
- package/dist/security/contentRedaction.d.ts +6 -0
- package/dist/security/contentRedaction.js +22 -0
- package/dist/smoke-test.js +261 -255
- package/dist/test/unit/apply-patch.test.d.ts +1 -0
- package/dist/test/unit/apply-patch.test.js +225 -0
- package/dist/test/unit/create-task.test.d.ts +1 -0
- package/dist/test/unit/create-task.test.js +197 -0
- package/dist/test/unit/direct-guards.test.js +124 -9
- package/dist/test/unit/evidence-pack.test.d.ts +1 -0
- package/dist/test/unit/evidence-pack.test.js +224 -0
- package/dist/test/unit/get-task-status.test.d.ts +1 -0
- package/dist/test/unit/get-task-status.test.js +174 -0
- package/dist/test/unit/get-task-summary.test.d.ts +1 -0
- package/dist/test/unit/get-task-summary.test.js +146 -0
- package/dist/test/unit/goal-report.test.d.ts +1 -0
- package/dist/test/unit/goal-report.test.js +159 -0
- package/dist/test/unit/goal-subgoal-task.test.js +6 -6
- package/dist/test/unit/goal-tools-registry.test.js +6 -4
- package/dist/test/unit/path-guard.test.js +24 -0
- package/dist/test/unit/project-policy-release-mode.test.d.ts +1 -0
- package/dist/test/unit/project-policy-release-mode.test.js +125 -0
- package/dist/test/unit/run-task-loop.test.d.ts +1 -0
- package/dist/test/unit/run-task-loop.test.js +380 -0
- package/dist/test/unit/schema-drift-check.test.js +10 -9
- package/dist/test/unit/spec-kit-import.test.d.ts +1 -0
- package/dist/test/unit/spec-kit-import.test.js +341 -0
- package/dist/test/unit/wait-for-task.test.d.ts +1 -0
- package/dist/test/unit/wait-for-task.test.js +144 -0
- package/dist/tools/auditTask.d.ts +8 -63
- package/dist/tools/auditTask.js +12 -8
- package/dist/tools/createDirectSession.d.ts +1 -1
- package/dist/tools/createDirectSession.js +2 -2
- package/dist/tools/createTask.d.ts +2 -2
- package/dist/tools/createTask.js +4 -4
- package/dist/tools/dispatch/coreDispatch.d.ts +9 -0
- package/dist/tools/dispatch/coreDispatch.js +282 -0
- package/dist/tools/dispatch/diagnosticDispatch.d.ts +14 -0
- package/dist/tools/dispatch/diagnosticDispatch.js +78 -0
- package/dist/tools/dispatch/directDispatch.d.ts +8 -0
- package/dist/tools/dispatch/directDispatch.js +115 -0
- package/dist/tools/dispatch/goalDispatch.d.ts +8 -0
- package/dist/tools/dispatch/goalDispatch.js +91 -0
- package/dist/tools/dispatch/releaseDispatch.d.ts +8 -0
- package/dist/tools/dispatch/releaseDispatch.js +45 -0
- package/dist/tools/dispatch/types.d.ts +23 -0
- package/dist/tools/dispatch/types.js +15 -0
- package/dist/tools/evidencePack.d.ts +45 -0
- package/dist/tools/evidencePack.js +375 -0
- package/dist/tools/finalizeDirectSession.d.ts +1 -1
- package/dist/tools/finalizeDirectSession.js +3 -3
- package/dist/tools/goalSubgoalTask.d.ts +1 -1
- package/dist/tools/goalSubgoalTask.js +2 -2
- package/dist/tools/healthCheck.js +3 -3
- package/dist/tools/recommendAgentForTask.d.ts +19 -0
- package/dist/tools/recommendAgentForTask.js +56 -0
- package/dist/tools/registry.d.ts +3 -3
- package/dist/tools/registry.js +333 -402
- package/dist/tools/releaseMode.d.ts +50 -0
- package/dist/tools/releaseMode.js +370 -0
- package/dist/tools/retryTask.d.ts +2 -2
- package/dist/tools/retryTask.js +2 -2
- package/dist/tools/runDirectVerificationBundle.d.ts +26 -0
- package/dist/tools/runDirectVerificationBundle.js +64 -0
- package/dist/tools/runTaskLoop.d.ts +57 -0
- package/dist/tools/runTaskLoop.js +417 -0
- package/dist/tools/runVerification.d.ts +4 -0
- package/dist/tools/runVerification.js +4 -0
- package/dist/tools/safeViews.d.ts +8 -2
- package/dist/tools/safeViews.js +4 -2
- package/dist/tools/taskLineage.d.ts +91 -0
- package/dist/tools/taskLineage.js +175 -0
- package/dist/tools/toolCatalog.d.ts +2 -2
- package/dist/tools/toolCatalog.js +6 -0
- package/dist/tools/toolRegistry.js +132 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +2 -2
- package/docs/CODE_WIKI.md +983 -0
- package/docs/agentseal-integration.md +150 -0
- package/docs/architecture.md +63 -0
- package/docs/assets/patchwarden-oss-demo.gif +0 -0
- package/docs/chatgpt-usage.md +31 -0
- package/docs/control-center/README.md +9 -0
- package/docs/dashboard-overview.md +86 -0
- package/docs/demo.md +8 -0
- package/docs/direct-session-workflow.md +98 -0
- package/docs/evidence-pack-schema.md +215 -0
- package/docs/execution-plan-2026-07-09.md +315 -0
- package/docs/lineage-evidence-pack-workflow.md +127 -0
- package/docs/mcp-inspector-testing.md +200 -0
- package/docs/open-source-application.md +162 -0
- package/docs/opencode-worker.md +151 -0
- package/docs/openhands-worker.md +181 -0
- package/docs/release-evidence.md +72 -0
- package/docs/roadmap-execution-and-acceptance.md +365 -0
- package/docs/spec-kit-integration.md +131 -0
- package/docs/task-safe-review-workflow.md +98 -0
- package/docs/threat-model.md +79 -0
- package/docs/user-feedback.md +40 -0
- package/docs/why-patchwarden.md +110 -0
- package/package.json +3 -3
- package/scripts/checks/control-center-smoke.js +443 -0
- package/scripts/checks/control-smoke.js +2 -2
- package/scripts/checks/lifecycle-smoke.js +29 -23
- package/scripts/checks/mcp-manifest-check.js +12 -0
- package/scripts/checks/mcp-smoke.js +33 -7
- package/scripts/checks/watcher-supervisor-smoke.js +1 -1
- package/scripts/generate-demo-gif.py +320 -0
- package/src/assessments/agentAssessor.ts +3 -3
- package/src/assessments/assessmentStore.ts +2 -2
- package/src/assessments/confirmCli.ts +5 -4
- package/src/config.ts +37 -0
- package/src/control/middleware/auth.ts +17 -0
- package/src/control/middleware/static.ts +71 -0
- package/src/control/routes/audit.ts +321 -0
- package/src/control/routes/evidence.ts +107 -0
- package/src/control/routes/lineage.ts +92 -0
- package/src/control/routes/policy.ts +81 -0
- package/src/control/routes/process.ts +204 -0
- package/src/control/routes/sessions.ts +251 -0
- package/src/control/routes/status.ts +325 -0
- package/src/control/routes/taskActions.ts +248 -0
- package/src/control/routes/tasks.ts +323 -0
- package/src/control/routes/workspace.ts +203 -0
- package/src/control/runtime.ts +472 -0
- package/src/control/server.ts +471 -0
- package/src/control/shared.ts +294 -0
- package/src/controlCenter.ts +7 -2150
- package/src/direct/directGuards.ts +28 -7
- package/src/direct/directSessionStore.ts +2 -0
- package/src/direct/directVerification.ts +7 -0
- package/src/doctor.ts +741 -481
- package/src/goal/goalReport.ts +271 -0
- package/src/goal/goalStatus.ts +6 -0
- package/src/goal/specKitImport.ts +355 -0
- package/src/goal/subgoalSync.ts +4 -2
- package/src/httpServer.ts +17 -14
- package/src/index.ts +7 -4
- package/src/logging.ts +10 -1
- package/src/policy/projectPolicy.ts +344 -0
- package/src/runner/changeCapture.ts +70 -42
- package/src/runner/cli.ts +7 -6
- package/src/runner/postTaskCleanup.ts +26 -2
- package/src/runner/runTask.ts +325 -223
- package/src/runner/simpleProcess.ts +4 -4
- package/src/runner/watch.ts +17 -14
- package/src/security/contentRedaction.ts +29 -0
- package/src/smoke-test.ts +254 -252
- package/src/test/unit/apply-patch.test.ts +293 -0
- package/src/test/unit/create-task.test.ts +255 -0
- package/src/test/unit/direct-guards.test.ts +178 -8
- package/src/test/unit/evidence-pack.test.ts +251 -0
- package/src/test/unit/get-task-status.test.ts +203 -0
- package/src/test/unit/get-task-summary.test.ts +173 -0
- package/src/test/unit/goal-report.test.ts +189 -0
- package/src/test/unit/goal-subgoal-task.test.ts +6 -6
- package/src/test/unit/goal-tools-registry.test.ts +7 -5
- package/src/test/unit/path-guard.test.ts +30 -0
- package/src/test/unit/project-policy-release-mode.test.ts +156 -0
- package/src/test/unit/run-task-loop.test.ts +425 -0
- package/src/test/unit/schema-drift-check.test.ts +11 -9
- package/src/test/unit/spec-kit-import.test.ts +429 -0
- package/src/test/unit/wait-for-task.test.ts +176 -0
- package/src/tools/auditTask.ts +99 -59
- package/src/tools/createDirectSession.ts +3 -3
- package/src/tools/createTask.ts +7 -7
- package/src/tools/dispatch/coreDispatch.ts +374 -0
- package/src/tools/dispatch/diagnosticDispatch.ts +101 -0
- package/src/tools/dispatch/directDispatch.ts +167 -0
- package/src/tools/dispatch/goalDispatch.ts +127 -0
- package/src/tools/dispatch/releaseDispatch.ts +65 -0
- package/src/tools/dispatch/types.ts +24 -0
- package/src/tools/evidencePack.ts +490 -0
- package/src/tools/finalizeDirectSession.ts +4 -4
- package/src/tools/goalSubgoalTask.ts +2 -2
- package/src/tools/healthCheck.ts +3 -3
- package/src/tools/listWorkspace.ts +71 -71
- package/src/tools/recommendAgentForTask.ts +79 -0
- package/src/tools/registry.ts +352 -509
- package/src/tools/releaseMode.ts +450 -0
- package/src/tools/retryTask.ts +2 -2
- package/src/tools/runDirectVerificationBundle.ts +98 -0
- package/src/tools/runTaskLoop.ts +526 -0
- package/src/tools/runVerification.ts +8 -0
- package/src/tools/safeViews.ts +4 -2
- package/src/tools/taskLineage.ts +300 -0
- package/src/tools/toolCatalog.ts +6 -0
- package/src/tools/toolRegistry.ts +132 -0
- package/src/version.ts +2 -2
- package/ui/pages/audit.html +192 -3
- package/ui/pages/dashboard.html +1070 -14
- package/ui/pages/direct-sessions.html +505 -53
- package/ui/pages/task-detail.html +456 -438
- package/ui/pages/tasks.html +598 -61
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dispatch handlers for Goal Session tools (v0.8.0+).
|
|
3
|
+
*
|
|
4
|
+
* Covers goal lifecycle, subgoal management, Spec Kit import,
|
|
5
|
+
* worktree merge/discard, and goal reporting.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { createGoal, listGoals, readGoal, readGoalStatus } from "../../goal/goalStore.js";
|
|
9
|
+
import { suggestNextSubgoal } from "../../goal/goalGraph.js";
|
|
10
|
+
import { exportHandoff } from "../../goal/handoffExport.js";
|
|
11
|
+
import { acceptSubgoal, rejectSubgoal, summarizeGoalProgress } from "../../goal/goalProgress.js";
|
|
12
|
+
import { exportGoalReport } from "../../goal/goalReport.js";
|
|
13
|
+
import { importSpecKitTasks, parseSpecKitJson } from "../../goal/specKitImport.js";
|
|
14
|
+
import { createSubgoalTask } from "../goalSubgoalTask.js";
|
|
15
|
+
import { mergeWorktreeTool } from "../mergeWorktree.js";
|
|
16
|
+
import { discardWorktreeTool } from "../discardWorktree.js";
|
|
17
|
+
import type { ToolHandlerMap } from "./types.js";
|
|
18
|
+
import { toResult } from "./types.js";
|
|
19
|
+
|
|
20
|
+
export const goalHandlers: ToolHandlerMap = {
|
|
21
|
+
create_goal: async (args) => {
|
|
22
|
+
return toResult(
|
|
23
|
+
createGoal(
|
|
24
|
+
String(args?.repo_path ?? ""),
|
|
25
|
+
String(args?.title ?? ""),
|
|
26
|
+
String(args?.goal_description ?? ""),
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
list_goals: async () => {
|
|
32
|
+
return toResult({ goals: listGoals() });
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
read_goal: async (args) => {
|
|
36
|
+
return toResult(readGoal(String(args?.goal_id ?? "")));
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
create_subgoal_task: async (args) => {
|
|
40
|
+
return toResult(
|
|
41
|
+
await createSubgoalTask({
|
|
42
|
+
goal_id: String(args?.goal_id ?? ""),
|
|
43
|
+
subgoal_title: String(args?.subgoal_title ?? ""),
|
|
44
|
+
depends_on: Array.isArray(args?.depends_on) ? args.depends_on.map(String) : undefined,
|
|
45
|
+
plan_id: args?.plan_id ? String(args.plan_id) : undefined,
|
|
46
|
+
inline_plan: args?.inline_plan ? String(args.inline_plan) : undefined,
|
|
47
|
+
plan_title: args?.plan_title ? String(args.plan_title) : undefined,
|
|
48
|
+
template: args?.template ? (String(args.template) as any) : undefined,
|
|
49
|
+
goal: args?.goal ? String(args.goal) : undefined,
|
|
50
|
+
agent: args?.agent ? String(args.agent) : undefined,
|
|
51
|
+
repo_path: String(args?.repo_path ?? ""),
|
|
52
|
+
test_command: args?.test_command ? String(args.test_command) : undefined,
|
|
53
|
+
verify_commands: Array.isArray(args?.verify_commands)
|
|
54
|
+
? args.verify_commands.map(String)
|
|
55
|
+
: undefined,
|
|
56
|
+
timeout_seconds: args?.timeout_seconds ? Number(args.timeout_seconds) : undefined,
|
|
57
|
+
scope: Array.isArray(args?.scope) ? args.scope.map(String) : undefined,
|
|
58
|
+
forbidden: Array.isArray(args?.forbidden) ? args.forbidden.map(String) : undefined,
|
|
59
|
+
verification: Array.isArray(args?.verification) ? args.verification.map(String) : undefined,
|
|
60
|
+
done_evidence: Array.isArray(args?.done_evidence) ? args.done_evidence.map(String) : undefined,
|
|
61
|
+
isolate_worktree:
|
|
62
|
+
args?.isolate_worktree === undefined ? undefined : Boolean(args.isolate_worktree),
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
accept_subgoal: async (args) => {
|
|
68
|
+
return toResult(
|
|
69
|
+
acceptSubgoal(String(args?.goal_id ?? ""), String(args?.subgoal_id ?? "")),
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
reject_subgoal: async (args) => {
|
|
74
|
+
return toResult(
|
|
75
|
+
rejectSubgoal(
|
|
76
|
+
String(args?.goal_id ?? ""),
|
|
77
|
+
String(args?.subgoal_id ?? ""),
|
|
78
|
+
String(args?.reason ?? ""),
|
|
79
|
+
),
|
|
80
|
+
);
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
suggest_next_subgoal: async (args) => {
|
|
84
|
+
const goalStatus = readGoalStatus(String(args?.goal_id ?? ""));
|
|
85
|
+
return toResult(suggestNextSubgoal(goalStatus));
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
summarize_goal_progress: async (args) => {
|
|
89
|
+
return toResult(summarizeGoalProgress(String(args?.goal_id ?? "")));
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
export_handoff: async (args) => {
|
|
93
|
+
const goalId = String(args?.goal_id ?? "");
|
|
94
|
+
const goalStatus = readGoalStatus(goalId);
|
|
95
|
+
return toResult(exportHandoff(goalId, goalStatus));
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
export_goal_report: async (args) => {
|
|
99
|
+
const goalId = String(args?.goal_id ?? "");
|
|
100
|
+
return toResult(exportGoalReport(goalId));
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
import_speckit_tasks: async (args) => {
|
|
104
|
+
const goalId = String(args?.goal_id ?? "");
|
|
105
|
+
const jsonText = String(args?.spec_kit_json ?? "");
|
|
106
|
+
const input = parseSpecKitJson(jsonText);
|
|
107
|
+
return toResult(importSpecKitTasks(goalId, input));
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
merge_worktree: async (args) => {
|
|
111
|
+
return toResult(
|
|
112
|
+
mergeWorktreeTool({
|
|
113
|
+
worktree_id: String(args?.worktree_id ?? ""),
|
|
114
|
+
repo_path: String(args?.repo_path ?? ""),
|
|
115
|
+
}),
|
|
116
|
+
);
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
discard_worktree: async (args) => {
|
|
120
|
+
return toResult(
|
|
121
|
+
discardWorktreeTool({
|
|
122
|
+
worktree_id: String(args?.worktree_id ?? ""),
|
|
123
|
+
repo_path: String(args?.repo_path ?? ""),
|
|
124
|
+
}),
|
|
125
|
+
);
|
|
126
|
+
},
|
|
127
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dispatch handlers for release-mode tools (v1.3.0+).
|
|
3
|
+
*
|
|
4
|
+
* Wraps releaseCheck, releasePrepare, releaseVerify, and releaseCleanup
|
|
5
|
+
* from releaseMode.ts.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
releaseCheck,
|
|
10
|
+
releasePrepare,
|
|
11
|
+
releaseVerify,
|
|
12
|
+
releaseCleanup,
|
|
13
|
+
} from "../releaseMode.js";
|
|
14
|
+
import type { ToolHandlerMap } from "./types.js";
|
|
15
|
+
import { toResult } from "./types.js";
|
|
16
|
+
|
|
17
|
+
export const releaseHandlers: ToolHandlerMap = {
|
|
18
|
+
release_check: async (args) => {
|
|
19
|
+
return toResult(
|
|
20
|
+
await releaseCheck({
|
|
21
|
+
repo_path: String(args?.repo_path ?? ""),
|
|
22
|
+
target_stage: String(args?.target_stage ?? "local_ready") as any,
|
|
23
|
+
package_name: args?.package_name ? String(args.package_name) : undefined,
|
|
24
|
+
version: args?.version ? String(args.version) : undefined,
|
|
25
|
+
github_repo: args?.github_repo ? String(args.github_repo) : undefined,
|
|
26
|
+
branch: args?.branch ? String(args.branch) : undefined,
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
release_prepare: async (args) => {
|
|
32
|
+
return toResult(
|
|
33
|
+
releasePrepare({
|
|
34
|
+
repo_path: String(args?.repo_path ?? ""),
|
|
35
|
+
required_commands: Array.isArray(args?.required_commands)
|
|
36
|
+
? args.required_commands.map(String)
|
|
37
|
+
: undefined,
|
|
38
|
+
timeout_seconds:
|
|
39
|
+
args?.timeout_seconds !== undefined ? Number(args.timeout_seconds) : undefined,
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
release_verify: async (args) => {
|
|
45
|
+
return toResult(
|
|
46
|
+
await releaseVerify({
|
|
47
|
+
repo_path: String(args?.repo_path ?? ""),
|
|
48
|
+
package_name: args?.package_name ? String(args.package_name) : undefined,
|
|
49
|
+
version: args?.version ? String(args.version) : undefined,
|
|
50
|
+
github_repo: args?.github_repo ? String(args.github_repo) : undefined,
|
|
51
|
+
branch: args?.branch ? String(args.branch) : undefined,
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
release_cleanup: async (args) => {
|
|
57
|
+
return toResult(
|
|
58
|
+
releaseCleanup({
|
|
59
|
+
repo_path: String(args?.repo_path ?? ""),
|
|
60
|
+
dry_run: args?.dry_run !== undefined ? Boolean(args.dry_run) : undefined,
|
|
61
|
+
patterns: Array.isArray(args?.patterns) ? args.patterns.map(String) : undefined,
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
64
|
+
},
|
|
65
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types and helpers for the dispatch map.
|
|
3
|
+
*
|
|
4
|
+
* Each domain dispatch file exports a `ToolHandlerMap` whose handlers
|
|
5
|
+
* directly call the existing tool functions — no logic is rewritten.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type ToolHandler = (
|
|
9
|
+
args: Record<string, unknown> | undefined,
|
|
10
|
+
) => Promise<{ content: Array<{ type: string; text: string }> }>;
|
|
11
|
+
|
|
12
|
+
export type ToolHandlerMap = Record<string, ToolHandler>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Wrap a plain data value into the MCP CallToolResult content envelope.
|
|
16
|
+
* Mirrors the original `toResult` helper from registry.ts.
|
|
17
|
+
*/
|
|
18
|
+
export function toResult(data: unknown): {
|
|
19
|
+
content: Array<{ type: string; text: string }>;
|
|
20
|
+
} {
|
|
21
|
+
return {
|
|
22
|
+
content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
|
|
23
|
+
};
|
|
24
|
+
}
|