@thehammer/schema-mcp-server 1.0.10 → 1.0.11
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/api-client.d.ts +7 -0
- package/dist/api-client.js +13 -0
- package/dist/index.js +21 -0
- package/package.json +1 -1
package/dist/api-client.d.ts
CHANGED
|
@@ -75,4 +75,11 @@ export declare function callQualityGate(category: string, message?: string): Pro
|
|
|
75
75
|
*/
|
|
76
76
|
export declare function completeDispatch(message?: string): Promise<ApiResponse>;
|
|
77
77
|
export declare function postProgress(progressMessage: string, phase?: string): Promise<ApiResponse>;
|
|
78
|
+
/**
|
|
79
|
+
* Fail-fast termination — agent calls this the moment anything deviates from the
|
|
80
|
+
* prompt's described behavior (missing tool, unexpected response, sub-agent not found,
|
|
81
|
+
* API error the prompt doesn't cover, etc.). Never use shell, tinker, or other creative
|
|
82
|
+
* workarounds — abort and let the operator diagnose.
|
|
83
|
+
*/
|
|
84
|
+
export declare function abortDispatch(reason: string, details?: string, phase?: string): Promise<ApiResponse>;
|
|
78
85
|
export { SCHEMA_ID };
|
package/dist/api-client.js
CHANGED
|
@@ -228,4 +228,17 @@ export async function postProgress(progressMessage, phase) {
|
|
|
228
228
|
phase,
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* Fail-fast termination — agent calls this the moment anything deviates from the
|
|
233
|
+
* prompt's described behavior (missing tool, unexpected response, sub-agent not found,
|
|
234
|
+
* API error the prompt doesn't cover, etc.). Never use shell, tinker, or other creative
|
|
235
|
+
* workarounds — abort and let the operator diagnose.
|
|
236
|
+
*/
|
|
237
|
+
export async function abortDispatch(reason, details, phase) {
|
|
238
|
+
return apiRequest("POST", mcpPath("abort"), {
|
|
239
|
+
reason,
|
|
240
|
+
details,
|
|
241
|
+
phase,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
231
244
|
export { SCHEMA_ID };
|
package/dist/index.js
CHANGED
|
@@ -52,6 +52,10 @@ const COMMON_TOOLS = [
|
|
|
52
52
|
"template_preview",
|
|
53
53
|
"template_preview_html",
|
|
54
54
|
"quality_gate_list",
|
|
55
|
+
// Fail-fast termination — always available regardless of role. The agent calls
|
|
56
|
+
// this the moment anything deviates from the prompt's described behavior instead
|
|
57
|
+
// of inventing creative workarounds via shell commands or source-code exploration.
|
|
58
|
+
"abort",
|
|
55
59
|
];
|
|
56
60
|
const ROLE_TOOLS = {
|
|
57
61
|
orchestrator: new Set([
|
|
@@ -226,6 +230,23 @@ if (shouldRegister("post_progress"))
|
|
|
226
230
|
const result = await api.postProgress(message, phase);
|
|
227
231
|
return jsonResult(result);
|
|
228
232
|
});
|
|
233
|
+
if (shouldRegister("abort"))
|
|
234
|
+
server.tool("abort", "FAIL-FAST TERMINATION. Call this the moment anything deviates from the prompt's described behavior: a required tool is missing, a tool returns an unexpected error, a sub-agent can't be invoked, an API call fails in a way the prompt doesn't cover, or anything else the prompt says should work is broken. Do NOT try to work around problems with shell commands, source-code exploration, or creative solutions. Abort, explain what failed, and exit immediately. After calling abort, your response ends — no further tool calls.", {
|
|
235
|
+
reason: z
|
|
236
|
+
.string()
|
|
237
|
+
.describe("Short description of what failed (one sentence). Example: 'mcp__schema__template_patch returned tool_not_found' or 'template-builder sub-agent is not available'."),
|
|
238
|
+
details: z
|
|
239
|
+
.string()
|
|
240
|
+
.optional()
|
|
241
|
+
.describe("Full error details, stack trace, tool response, or context that would help the operator diagnose the failure."),
|
|
242
|
+
phase: z
|
|
243
|
+
.string()
|
|
244
|
+
.optional()
|
|
245
|
+
.describe("Phase you were in when the failure occurred (e.g., 'planning', 'delegating', 'template_patch')."),
|
|
246
|
+
}, async ({ reason, details, phase }) => {
|
|
247
|
+
const result = await api.abortDispatch(reason, details, phase);
|
|
248
|
+
return jsonResult(result);
|
|
249
|
+
});
|
|
229
250
|
// ============================================================================
|
|
230
251
|
// Schema Tools
|
|
231
252
|
// ============================================================================
|
package/package.json
CHANGED