jetty-mcp-server 1.0.3 → 1.1.0
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.md +59 -0
- package/dist/api-client.d.ts +71 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +201 -0
- package/dist/api-client.js.map +1 -0
- package/dist/client.d.ts +12 -39
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +21 -187
- package/dist/client.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib.d.ts +14 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/lib.js +11 -0
- package/dist/lib.js.map +1 -0
- package/dist/tool-definitions.d.ts +49 -0
- package/dist/tool-definitions.d.ts.map +1 -0
- package/dist/tool-definitions.js +428 -0
- package/dist/tool-definitions.js.map +1 -0
- package/dist/tools.d.ts +8 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +10 -339
- package/dist/tools.js.map +1 -1
- package/dist/webmcp.d.ts +61 -0
- package/dist/webmcp.d.ts.map +1 -0
- package/dist/webmcp.js +98 -0
- package/dist/webmcp.js.map +1 -0
- package/package.json +49 -6
- package/src/client.ts +0 -332
- package/src/index.ts +0 -17
- package/src/tools.ts +0 -585
- package/tests/auth.test.mjs +0 -129
- package/tests/routines.test.mjs +0 -236
- package/tsconfig.json +0 -18
package/dist/client.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node client for the stdio MCP server: the browser-safe core (api-client.ts)
|
|
3
|
+
* plus token resolution from the environment and the file `jetty login`
|
|
4
|
+
* writes. Not for the browser — it imports node:fs.
|
|
5
|
+
*/
|
|
1
6
|
import { readFileSync } from "node:fs";
|
|
2
7
|
import { homedir } from "node:os";
|
|
3
8
|
import { join } from "node:path";
|
|
4
|
-
|
|
9
|
+
import { DEFAULT_API_URL, JettyApiClient, } from "./api-client.js";
|
|
10
|
+
export { DEFAULT_API_URL, JettyApiClient } from "./api-client.js";
|
|
5
11
|
// The `jetty` CLI / Claude Code skill writes the collection-scoped `mlc_` key
|
|
6
12
|
// here on `jetty login`. We fall back to it so an already-logged-in user does
|
|
7
13
|
// not also have to plumb JETTY_API_TOKEN into the MCP server's env. Resolved
|
|
@@ -9,198 +15,13 @@ const DEFAULT_API_URL = "https://flows-api.jetty.io";
|
|
|
9
15
|
function tokenFilePath() {
|
|
10
16
|
return join(homedir(), ".config", "jetty", "token");
|
|
11
17
|
}
|
|
12
|
-
export class JettyClient {
|
|
13
|
-
token;
|
|
14
|
-
apiUrl;
|
|
15
|
-
constructor() {
|
|
16
|
-
this.token = resolveToken();
|
|
17
|
-
this.apiUrl = process.env.JETTY_API_URL || DEFAULT_API_URL;
|
|
18
|
-
}
|
|
19
|
-
requireToken() {
|
|
20
|
-
if (!this.token) {
|
|
21
|
-
throw new Error("No Jetty token found. Set JETTY_API_TOKEN, or run `jetty login` " +
|
|
22
|
-
`(writes ${tokenFilePath()}). ` +
|
|
23
|
-
"Get a token at https://jetty.io → Settings → API Tokens");
|
|
24
|
-
}
|
|
25
|
-
return this.token;
|
|
26
|
-
}
|
|
27
|
-
async request(path, options = {}) {
|
|
28
|
-
const url = `${this.apiUrl}${path}`;
|
|
29
|
-
const headers = {
|
|
30
|
-
Authorization: `Bearer ${this.requireToken()}`,
|
|
31
|
-
...(options.headers || {}),
|
|
32
|
-
};
|
|
33
|
-
const res = await fetch(url, { ...options, headers });
|
|
34
|
-
if (!res.ok) {
|
|
35
|
-
const body = await res.text();
|
|
36
|
-
throw new Error(`Jetty API error ${res.status}: ${body}`);
|
|
37
|
-
}
|
|
38
|
-
const contentType = res.headers.get("content-type") || "";
|
|
39
|
-
if (contentType.includes("application/json")) {
|
|
40
|
-
return res.json();
|
|
41
|
-
}
|
|
42
|
-
return res.text();
|
|
43
|
-
}
|
|
44
|
-
api(path, options) {
|
|
45
|
-
return this.request(path, options);
|
|
46
|
-
}
|
|
47
|
-
// Collections
|
|
48
|
-
async listCollections() {
|
|
49
|
-
return this.api("/api/v1/collections/");
|
|
50
|
-
}
|
|
51
|
-
async getCollection(collection) {
|
|
52
|
-
return this.api(`/api/v1/collections/${collection}`);
|
|
53
|
-
}
|
|
54
|
-
// Tasks
|
|
55
|
-
async listTasks(collection) {
|
|
56
|
-
return this.api(`/api/v1/tasks/${collection}/`);
|
|
57
|
-
}
|
|
58
|
-
async getTask(collection, task) {
|
|
59
|
-
return this.api(`/api/v1/tasks/${collection}/${task}`);
|
|
60
|
-
}
|
|
61
|
-
async createTask(collection, name, workflow, description) {
|
|
62
|
-
return this.api(`/api/v1/tasks/${collection}`, {
|
|
63
|
-
method: "POST",
|
|
64
|
-
headers: { "Content-Type": "application/json" },
|
|
65
|
-
body: JSON.stringify({ name, description: description || "", workflow }),
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
async updateTask(collection, task, updates) {
|
|
69
|
-
return this.api(`/api/v1/tasks/${collection}/${task}`, {
|
|
70
|
-
method: "PUT",
|
|
71
|
-
headers: { "Content-Type": "application/json" },
|
|
72
|
-
body: JSON.stringify(updates),
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
async deleteTask(collection, task) {
|
|
76
|
-
return this.api(`/api/v1/tasks/${collection}/${task}`, {
|
|
77
|
-
method: "DELETE",
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
// Trial keys
|
|
81
|
-
async getTrialStatus(collection) {
|
|
82
|
-
return this.api(`/api/v1/trial/${collection}`);
|
|
83
|
-
}
|
|
84
|
-
async activateTrial(collection) {
|
|
85
|
-
return this.api(`/api/v1/trial/${collection}/activate`, {
|
|
86
|
-
method: "POST",
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
// Collection environment
|
|
90
|
-
async getCollectionEnvironment(collection) {
|
|
91
|
-
return this.api(`/api/v1/collections/${collection}/environment`);
|
|
92
|
-
}
|
|
93
|
-
// Run workflows
|
|
94
|
-
async runWorkflow(collection, task, initParams, useTrialKeys) {
|
|
95
|
-
const formData = new FormData();
|
|
96
|
-
formData.append("init_params", JSON.stringify(initParams || {}));
|
|
97
|
-
if (useTrialKeys) {
|
|
98
|
-
formData.append("use_trial_keys", "true");
|
|
99
|
-
}
|
|
100
|
-
return this.api(`/api/v1/run/${collection}/${task}`, {
|
|
101
|
-
method: "POST",
|
|
102
|
-
body: formData,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
async runWorkflowSync(collection, task, initParams, useTrialKeys) {
|
|
106
|
-
const formData = new FormData();
|
|
107
|
-
formData.append("init_params", JSON.stringify(initParams || {}));
|
|
108
|
-
if (useTrialKeys) {
|
|
109
|
-
formData.append("use_trial_keys", "true");
|
|
110
|
-
}
|
|
111
|
-
return this.api(`/api/v1/run-sync/${collection}/${task}`, {
|
|
112
|
-
method: "POST",
|
|
113
|
-
body: formData,
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
// Trajectories
|
|
117
|
-
async listTrajectories(collection, task, limit = 10, page = 1) {
|
|
118
|
-
return this.api(`/api/v1/db/trajectories/${collection}/${task}?limit=${limit}&page=${page}`);
|
|
119
|
-
}
|
|
120
|
-
async getTrajectory(collection, task, trajectoryId) {
|
|
121
|
-
return this.api(`/api/v1/db/trajectory/${collection}/${task}/${trajectoryId}`);
|
|
122
|
-
}
|
|
123
|
-
// Stats
|
|
124
|
-
async getStats(collection, task) {
|
|
125
|
-
return this.api(`/api/v1/db/stats/${collection}/${task}`);
|
|
126
|
-
}
|
|
127
|
-
// Labels
|
|
128
|
-
async addLabel(collection, task, trajectoryId, key, value, author) {
|
|
129
|
-
return this.api(`/api/v1/trajectory/${collection}/${task}/${trajectoryId}/labels`, {
|
|
130
|
-
method: "POST",
|
|
131
|
-
headers: { "Content-Type": "application/json" },
|
|
132
|
-
body: JSON.stringify({ key, value, author }),
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
// Workflow logs
|
|
136
|
-
async getWorkflowLogs(workflowId) {
|
|
137
|
-
return this.api(`/api/v1/workflows-logs/${workflowId}`);
|
|
138
|
-
}
|
|
139
|
-
// Step templates
|
|
140
|
-
async listStepTemplates() {
|
|
141
|
-
return this.request("/api/v1/step-templates");
|
|
142
|
-
}
|
|
143
|
-
async getStepTemplate(name) {
|
|
144
|
-
return this.request(`/api/v1/step-templates/${name}`);
|
|
145
|
-
}
|
|
146
|
-
// Environment variables
|
|
147
|
-
async setEnvironmentVars(collection, vars) {
|
|
148
|
-
return this.api(`/api/v1/collections/${collection}/environment`, {
|
|
149
|
-
method: "PATCH",
|
|
150
|
-
headers: { "Content-Type": "application/json" },
|
|
151
|
-
body: JSON.stringify({ environment_variables: vars }),
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
// Routines (scheduled runs)
|
|
155
|
-
async listRoutines(collection, task) {
|
|
156
|
-
const path = task
|
|
157
|
-
? `/api/v1/routines/${collection}/${task}`
|
|
158
|
-
: `/api/v1/routines/${collection}`;
|
|
159
|
-
return this.api(path);
|
|
160
|
-
}
|
|
161
|
-
async getRoutine(collection, task, name) {
|
|
162
|
-
return this.api(`/api/v1/routines/${collection}/${task}/${name}`);
|
|
163
|
-
}
|
|
164
|
-
async createRoutine(collection, task, body) {
|
|
165
|
-
return this.api(`/api/v1/routines/${collection}/${task}`, {
|
|
166
|
-
method: "POST",
|
|
167
|
-
headers: { "Content-Type": "application/json" },
|
|
168
|
-
body: JSON.stringify(body),
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
async updateRoutine(collection, task, name, patch) {
|
|
172
|
-
return this.api(`/api/v1/routines/${collection}/${task}/${name}`, {
|
|
173
|
-
method: "PATCH",
|
|
174
|
-
headers: { "Content-Type": "application/json" },
|
|
175
|
-
body: JSON.stringify(patch),
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
async deleteRoutine(collection, task, name) {
|
|
179
|
-
return this.api(`/api/v1/routines/${collection}/${task}/${name}`, {
|
|
180
|
-
method: "DELETE",
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
async pauseRoutine(collection, task, name) {
|
|
184
|
-
return this.api(`/api/v1/routines/${collection}/${task}/${name}/pause`, { method: "POST" });
|
|
185
|
-
}
|
|
186
|
-
async resumeRoutine(collection, task, name) {
|
|
187
|
-
return this.api(`/api/v1/routines/${collection}/${task}/${name}/resume`, { method: "POST" });
|
|
188
|
-
}
|
|
189
|
-
async runRoutineNow(collection, task, name) {
|
|
190
|
-
return this.api(`/api/v1/routines/${collection}/${task}/${name}/run-now`, { method: "POST" });
|
|
191
|
-
}
|
|
192
|
-
async listRoutineRuns(collection, task, name, limit) {
|
|
193
|
-
const qs = typeof limit === "number" ? `?limit=${limit}` : "";
|
|
194
|
-
return this.api(`/api/v1/routines/${collection}/${task}/${name}/runs${qs}`);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
18
|
/**
|
|
198
19
|
* Resolve the API token: prefer JETTY_API_TOKEN (trimmed, non-empty), then the
|
|
199
20
|
* token file written by `jetty login`. The env var is checked for emptiness
|
|
200
21
|
* because the plugin's .mcp.json may pass it through as "" — which must not
|
|
201
22
|
* count as "set" and must not block the file fallback.
|
|
202
23
|
*/
|
|
203
|
-
function resolveToken() {
|
|
24
|
+
export function resolveToken() {
|
|
204
25
|
const fromEnv = process.env.JETTY_API_TOKEN?.trim();
|
|
205
26
|
if (fromEnv)
|
|
206
27
|
return fromEnv;
|
|
@@ -214,4 +35,17 @@ function resolveToken() {
|
|
|
214
35
|
}
|
|
215
36
|
return undefined;
|
|
216
37
|
}
|
|
38
|
+
export class JettyClient extends JettyApiClient {
|
|
39
|
+
constructor(options = {}) {
|
|
40
|
+
super({
|
|
41
|
+
...options,
|
|
42
|
+
token: options.token ?? resolveToken(),
|
|
43
|
+
apiUrl: options.apiUrl ?? (process.env.JETTY_API_URL || DEFAULT_API_URL),
|
|
44
|
+
missingTokenMessage: options.missingTokenMessage ??
|
|
45
|
+
"No Jetty token found. Set JETTY_API_TOKEN, or run `jetty login` " +
|
|
46
|
+
`(writes ${tokenFilePath()}). ` +
|
|
47
|
+
"Get a token at https://jetty.io → Settings → API Tokens",
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
217
51
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,eAAe,EACf,cAAc,GAEf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGlE,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,qEAAqE;AACrE,SAAS,aAAa;IACpB,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC;IACpD,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAE5B,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,YAAY,CAAC,aAAa,EAAE,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9D,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,uDAAuD;IACzD,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,OAAO,WAAY,SAAQ,cAAc;IAC7C,YAAY,UAAiC,EAAE;QAC7C,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,YAAY,EAAE;YACtC,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,eAAe,CAAC;YACxE,mBAAmB,EACjB,OAAO,CAAC,mBAAmB;gBAC3B,kEAAkE;oBAChE,WAAW,aAAa,EAAE,KAAK;oBAC/B,yDAAyD;SAC9D,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/index.js
CHANGED
package/dist/lib.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library entry (`import ... from "jetty-mcp-server"`). Side-effect free;
|
|
3
|
+
* the stdio server lives in index.ts and is what the `jetty-mcp-server`
|
|
4
|
+
* binary runs.
|
|
5
|
+
*/
|
|
6
|
+
export { JettyClient, resolveToken } from "./client.js";
|
|
7
|
+
export { JettyApiClient, DEFAULT_API_URL } from "./api-client.js";
|
|
8
|
+
export type { JettyApiClientOptions, TokenSource } from "./api-client.js";
|
|
9
|
+
export { registerTools } from "./tools.js";
|
|
10
|
+
export { JETTY_TOOLS, JETTY_WEBMCP_TOOLS, getJettyTool, jsonResult } from "./tool-definitions.js";
|
|
11
|
+
export type { JettyToolDefinition, ToolAnnotations, ToolResult } from "./tool-definitions.js";
|
|
12
|
+
export { findModelContext, jettyWebMcpTools, registerJettyWebMcpTools, toWebMcpTool, toolInputJsonSchema, } from "./webmcp.js";
|
|
13
|
+
export type { JettyWebMcpOptions, ModelContextLike, RegisterJettyWebMcpResult, WebMcpTool, } from "./webmcp.js";
|
|
14
|
+
//# sourceMappingURL=lib.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClE,YAAY,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAClG,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9F,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,mBAAmB,GACpB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,yBAAyB,EACzB,UAAU,GACX,MAAM,aAAa,CAAC"}
|
package/dist/lib.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library entry (`import ... from "jetty-mcp-server"`). Side-effect free;
|
|
3
|
+
* the stdio server lives in index.ts and is what the `jetty-mcp-server`
|
|
4
|
+
* binary runs.
|
|
5
|
+
*/
|
|
6
|
+
export { JettyClient, resolveToken } from "./client.js";
|
|
7
|
+
export { JettyApiClient, DEFAULT_API_URL } from "./api-client.js";
|
|
8
|
+
export { registerTools } from "./tools.js";
|
|
9
|
+
export { JETTY_TOOLS, JETTY_WEBMCP_TOOLS, getJettyTool, jsonResult } from "./tool-definitions.js";
|
|
10
|
+
export { findModelContext, jettyWebMcpTools, registerJettyWebMcpTools, toWebMcpTool, toolInputJsonSchema, } from "./webmcp.js";
|
|
11
|
+
//# sourceMappingURL=lib.js.map
|
package/dist/lib.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAElG,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Jetty tool catalog, declared once as data. Both surfaces consume it:
|
|
3
|
+
*
|
|
4
|
+
* - tools.ts registers every definition on an MCP server (stdio, npx).
|
|
5
|
+
* - webmcp.ts registers the same definitions on a page's
|
|
6
|
+
* `navigator.modelContext` (WebMCP), deriving JSON Schema from the zod
|
|
7
|
+
* shape and executing through a browser-side JettyApiClient.
|
|
8
|
+
*
|
|
9
|
+
* Browser-safe: imports zod and the client type only.
|
|
10
|
+
*/
|
|
11
|
+
import { z, type ZodRawShape, type ZodTypeAny } from "zod";
|
|
12
|
+
import type { JettyApiClient } from "./api-client.js";
|
|
13
|
+
/** MCP tool annotations (a subset of the spec's ToolAnnotations). */
|
|
14
|
+
export interface ToolAnnotations {
|
|
15
|
+
readOnlyHint: boolean;
|
|
16
|
+
destructiveHint?: boolean;
|
|
17
|
+
idempotentHint?: boolean;
|
|
18
|
+
openWorldHint?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface JettyToolDefinition<Shape extends ZodRawShape = ZodRawShape> {
|
|
21
|
+
name: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
/** zod raw shape — the MCP SDK's native input form. */
|
|
25
|
+
inputSchema: Shape;
|
|
26
|
+
annotations: ToolAnnotations;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the WebMCP adapter may expose the tool. Defaults to true; the
|
|
29
|
+
* MCP server registers every tool regardless. Set false for account-level
|
|
30
|
+
* actions a page should not hand to an in-browser agent.
|
|
31
|
+
*/
|
|
32
|
+
webmcp?: boolean;
|
|
33
|
+
handler: (client: JettyApiClient, args: z.objectOutputType<Shape, ZodTypeAny>) => Promise<unknown>;
|
|
34
|
+
}
|
|
35
|
+
/** The MCP/WebMCP result envelope both surfaces return. */
|
|
36
|
+
export interface ToolResult {
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
content: {
|
|
39
|
+
type: "text";
|
|
40
|
+
text: string;
|
|
41
|
+
}[];
|
|
42
|
+
isError?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare function jsonResult(data: unknown): ToolResult;
|
|
45
|
+
export declare const JETTY_TOOLS: readonly JettyToolDefinition[];
|
|
46
|
+
/** The subset of the catalog the WebMCP adapter may expose. */
|
|
47
|
+
export declare const JETTY_WEBMCP_TOOLS: readonly JettyToolDefinition[];
|
|
48
|
+
export declare function getJettyTool(name: string): JettyToolDefinition | undefined;
|
|
49
|
+
//# sourceMappingURL=tool-definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-definitions.d.ts","sourceRoot":"","sources":["../src/tool-definitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB,CAAC,KAAK,SAAS,WAAW,GAAG,WAAW;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,WAAW,EAAE,KAAK,CAAC;IACnB,WAAW,EAAE,eAAe,CAAC;IAC7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,CACP,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,KACxC,OAAO,CAAC,OAAO,CAAC,CAAC;CACvB;AAED,2DAA2D;AAC3D,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,CAIpD;AA8CD,eAAO,MAAM,WAAW,EAAE,SAAS,mBAAmB,EAuYrD,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,EAAE,SAAS,mBAAmB,EAE5D,CAAC;AAEF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAE1E"}
|