caplets 0.3.0 → 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caplets",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Progressive disclosure gateway for MCP servers.",
5
5
  "keywords": [
6
6
  "caplets",
@@ -37,6 +37,7 @@
37
37
  "access": "public"
38
38
  },
39
39
  "dependencies": {
40
+ "@apidevtools/swagger-parser": "^12.1.0",
40
41
  "@modelcontextprotocol/sdk": "^1.29.0",
41
42
  "commander": "^14.0.3",
42
43
  "vfile": "^6.0.3",
@@ -187,9 +187,100 @@
187
187
  }
188
188
  },
189
189
  "additionalProperties": false,
190
- "description": "Required MCP server backend configuration for this Caplet."
190
+ "description": "MCP server backend configuration for this Caplet."
191
+ },
192
+ "openapiEndpoint": {
193
+ "type": "object",
194
+ "properties": {
195
+ "specPath": {
196
+ "description": "Local OpenAPI specification path.",
197
+ "type": "string",
198
+ "minLength": 1
199
+ },
200
+ "specUrl": {
201
+ "description": "Remote OpenAPI specification URL.",
202
+ "type": "string",
203
+ "minLength": 1
204
+ },
205
+ "baseUrl": {
206
+ "description": "Override base URL for OpenAPI requests.",
207
+ "type": "string",
208
+ "minLength": 1
209
+ },
210
+ "auth": {
211
+ "oneOf": [
212
+ {
213
+ "type": "object",
214
+ "properties": {
215
+ "type": {
216
+ "type": "string",
217
+ "const": "none"
218
+ }
219
+ },
220
+ "required": ["type"],
221
+ "additionalProperties": false
222
+ },
223
+ {
224
+ "type": "object",
225
+ "properties": {
226
+ "type": {
227
+ "type": "string",
228
+ "const": "bearer"
229
+ },
230
+ "token": {
231
+ "type": "string",
232
+ "minLength": 1
233
+ }
234
+ },
235
+ "required": ["type", "token"],
236
+ "additionalProperties": false
237
+ },
238
+ {
239
+ "type": "object",
240
+ "properties": {
241
+ "type": {
242
+ "type": "string",
243
+ "const": "headers"
244
+ },
245
+ "headers": {
246
+ "type": "object",
247
+ "propertyNames": {
248
+ "type": "string"
249
+ },
250
+ "additionalProperties": {
251
+ "type": "string",
252
+ "minLength": 1
253
+ }
254
+ }
255
+ },
256
+ "required": ["type", "headers"],
257
+ "additionalProperties": false
258
+ }
259
+ ],
260
+ "description": "Explicit OpenAPI request auth config. Use {\"type\":\"none\"} for public APIs."
261
+ },
262
+ "requestTimeoutMs": {
263
+ "description": "Timeout in milliseconds for OpenAPI HTTP requests.",
264
+ "type": "integer",
265
+ "exclusiveMinimum": 0,
266
+ "maximum": 9007199254740991
267
+ },
268
+ "operationCacheTtlMs": {
269
+ "description": "Milliseconds OpenAPI operation metadata stays fresh. Set 0 to refresh every time.",
270
+ "type": "integer",
271
+ "minimum": 0,
272
+ "maximum": 9007199254740991
273
+ },
274
+ "disabled": {
275
+ "description": "When true, omit this Caplet from discovery.",
276
+ "type": "boolean"
277
+ }
278
+ },
279
+ "required": ["auth"],
280
+ "additionalProperties": false,
281
+ "description": "OpenAPI endpoint backend configuration for this Caplet."
191
282
  }
192
283
  },
193
- "required": ["name", "description", "mcpServer"],
284
+ "required": ["name", "description"],
194
285
  "additionalProperties": false
195
286
  }
@@ -220,6 +220,126 @@
220
220
  "required": ["name", "description"],
221
221
  "additionalProperties": false
222
222
  }
223
+ },
224
+ "openapiEndpoints": {
225
+ "default": {},
226
+ "description": "OpenAPI endpoints keyed by stable Caplet ID.",
227
+ "type": "object",
228
+ "propertyNames": {
229
+ "type": "string",
230
+ "pattern": "^[a-zA-Z0-9_-]{1,64}$"
231
+ },
232
+ "additionalProperties": {
233
+ "type": "object",
234
+ "properties": {
235
+ "name": {
236
+ "type": "string",
237
+ "minLength": 1,
238
+ "maxLength": 80,
239
+ "description": "Human-readable OpenAPI display name."
240
+ },
241
+ "description": {
242
+ "type": "string",
243
+ "description": "Capability description shown to agents before OpenAPI operations are disclosed."
244
+ },
245
+ "specPath": {
246
+ "description": "Local OpenAPI specification path.",
247
+ "type": "string",
248
+ "minLength": 1
249
+ },
250
+ "specUrl": {
251
+ "description": "Remote OpenAPI specification URL.",
252
+ "type": "string",
253
+ "format": "uri"
254
+ },
255
+ "baseUrl": {
256
+ "description": "Override base URL for OpenAPI requests.",
257
+ "type": "string",
258
+ "format": "uri"
259
+ },
260
+ "auth": {
261
+ "oneOf": [
262
+ {
263
+ "type": "object",
264
+ "properties": {
265
+ "type": {
266
+ "type": "string",
267
+ "const": "none"
268
+ }
269
+ },
270
+ "required": ["type"],
271
+ "additionalProperties": false
272
+ },
273
+ {
274
+ "type": "object",
275
+ "properties": {
276
+ "type": {
277
+ "type": "string",
278
+ "const": "bearer"
279
+ },
280
+ "token": {
281
+ "type": "string",
282
+ "minLength": 1
283
+ }
284
+ },
285
+ "required": ["type", "token"],
286
+ "additionalProperties": false
287
+ },
288
+ {
289
+ "type": "object",
290
+ "properties": {
291
+ "type": {
292
+ "type": "string",
293
+ "const": "headers"
294
+ },
295
+ "headers": {
296
+ "type": "object",
297
+ "propertyNames": {
298
+ "type": "string"
299
+ },
300
+ "additionalProperties": {
301
+ "type": "string",
302
+ "minLength": 1
303
+ }
304
+ }
305
+ },
306
+ "required": ["type", "headers"],
307
+ "additionalProperties": false
308
+ }
309
+ ],
310
+ "description": "Explicit OpenAPI request auth config. Use {\"type\":\"none\"} for public APIs."
311
+ },
312
+ "tags": {
313
+ "type": "array",
314
+ "items": {
315
+ "type": "string",
316
+ "minLength": 1,
317
+ "maxLength": 80
318
+ }
319
+ },
320
+ "requestTimeoutMs": {
321
+ "default": 60000,
322
+ "description": "Timeout in milliseconds for OpenAPI HTTP requests.",
323
+ "type": "integer",
324
+ "exclusiveMinimum": 0,
325
+ "maximum": 9007199254740991
326
+ },
327
+ "operationCacheTtlMs": {
328
+ "default": 30000,
329
+ "description": "Milliseconds OpenAPI operation metadata stays fresh. Set 0 to refresh every time.",
330
+ "type": "integer",
331
+ "minimum": 0,
332
+ "maximum": 9007199254740991
333
+ },
334
+ "disabled": {
335
+ "default": false,
336
+ "description": "When true, omit this OpenAPI Caplet from discovery.",
337
+ "type": "boolean"
338
+ }
339
+ },
340
+ "required": ["name", "description", "auth"],
341
+ "additionalProperties": false
342
+ }
223
343
  }
224
344
  },
225
345
  "additionalProperties": false