@shipstatic/mcp 1.0.0-beta.13 → 1.0.0-beta.14
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/call.d.ts +0 -11
- package/dist/call.js +35 -0
- package/package.json +3 -3
package/dist/call.d.ts
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
/**
|
|
3
|
-
* The two error arms that earn a hint. Everything else relays verbatim — a
|
|
4
|
-
* hint on any other type sends the agent chasing a credential that is not the
|
|
5
|
-
* problem.
|
|
6
|
-
*
|
|
7
|
-
* They are ARGUMENTS rather than constants because they are the one part of
|
|
8
|
-
* the mapping that legitimately differs per transport: stdio can name the
|
|
9
|
-
* environment variable it owns, and the hosted endpoint deliberately cannot
|
|
10
|
-
* (it has no configuration of its own, and naming another package's variable
|
|
11
|
-
* is how this pair silently desynchronised once already).
|
|
12
|
-
*/
|
|
13
2
|
export interface ErrorHints {
|
|
14
3
|
/** Appended after `Hint: ` when the SDK rejects the credential. */
|
|
15
4
|
authentication: string;
|
package/dist/call.js
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
import { ErrorType, isShipError } from '@shipstatic/ship';
|
|
2
|
+
/**
|
|
3
|
+
* The two CREDENTIAL arms that earn a per-transport hint. Everything else
|
|
4
|
+
* relays verbatim — a credential hint on any other type sends the agent
|
|
5
|
+
* chasing a problem it does not have.
|
|
6
|
+
*
|
|
7
|
+
* They are ARGUMENTS rather than constants because they are the one part of
|
|
8
|
+
* the mapping that legitimately differs per transport: stdio can name the
|
|
9
|
+
* environment variable it owns, and the hosted endpoint deliberately cannot
|
|
10
|
+
* (it has no configuration of its own, and naming another package's variable
|
|
11
|
+
* is how this pair silently desynchronised once already).
|
|
12
|
+
*
|
|
13
|
+
* A third arm — maintenance — is hinted too, but it is NOT a member here: a
|
|
14
|
+
* closed platform is closed identically on every transport, so its text is a
|
|
15
|
+
* module constant (`MAINTENANCE_HINT`) rather than a per-transport argument.
|
|
16
|
+
* The membership test for this interface is "does the text differ per
|
|
17
|
+
* transport?", not "does the arm get a hint?".
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* The maintenance hint — a CONSTANT, for the reason stated on `ErrorHints`:
|
|
21
|
+
* this text does not differ per transport, so making it an argument would ask
|
|
22
|
+
* two callers to agree on one sentence forever.
|
|
23
|
+
*
|
|
24
|
+
* The instruction to an agent matters more here than on any other arm. A tool
|
|
25
|
+
* failure normally invites a retry, and retrying is exactly wrong against a
|
|
26
|
+
* platform that is closed on purpose: the loop cannot succeed, and it spends
|
|
27
|
+
* the caller's budget discovering that. So the hint leads with the refusal to
|
|
28
|
+
* retry and closes with the reassurance the agent should relay to its user.
|
|
29
|
+
*/
|
|
30
|
+
const MAINTENANCE_HINT = 'The platform is temporarily closed for scheduled maintenance. Do not retry in a loop — wait and try again later. Deployed sites are unaffected and stay online.';
|
|
2
31
|
/**
|
|
3
32
|
* Builds the `call()` wrapper both transports use: SDK promise in, MCP
|
|
4
33
|
* `CallToolResult` out.
|
|
@@ -79,6 +108,12 @@ function isPlainObject(value) {
|
|
|
79
108
|
function toErrorResult(error, hints, onAuthFailure) {
|
|
80
109
|
if (isShipError(error)) {
|
|
81
110
|
let message = error.message;
|
|
111
|
+
// First, because it is the one arm that is not about this caller at all:
|
|
112
|
+
// the platform is closed, nothing the agent sends can succeed, and the
|
|
113
|
+
// useful instruction is to stop rather than to fix something.
|
|
114
|
+
if (error.isType(ErrorType.Maintenance)) {
|
|
115
|
+
message += `\n\nHint: ${MAINTENANCE_HINT}`;
|
|
116
|
+
}
|
|
82
117
|
if (error.isType(ErrorType.Authentication)) {
|
|
83
118
|
message += `\n\nHint: ${hints.authentication}`;
|
|
84
119
|
onAuthFailure?.({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipstatic/mcp",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.14",
|
|
4
4
|
"mcpName": "com.shipstatic/mcp",
|
|
5
5
|
"description": "ShipStatic MCP — deploy static websites from AI agents. Full toolset incl. custom domains. Free hosted endpoint at mcp.shipstatic.com — no install.",
|
|
6
6
|
"type": "module",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"license": "MIT",
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
69
|
-
"@shipstatic/ship": "2.0.0-beta.
|
|
70
|
-
"@shipstatic/types": "2.5.0-beta.
|
|
69
|
+
"@shipstatic/ship": "2.0.0-beta.20",
|
|
70
|
+
"@shipstatic/types": "2.5.0-beta.23",
|
|
71
71
|
"zod": "^4.4.3"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|