@slexkit/mcp 0.3.2 → 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.
@@ -0,0 +1,413 @@
1
+ {
2
+ "name": "slex-capabilities-catalog",
3
+ "packageName": "slexkit",
4
+ "version": "0.4.0",
5
+ "schemaVersion": "2026-06",
6
+ "protocolVersion": "0.1",
7
+ "expressionContext": [
8
+ {
9
+ "name": "g",
10
+ "scope": "always",
11
+ "summary": "Reactive state proxy."
12
+ },
13
+ {
14
+ "name": "std",
15
+ "scope": "always",
16
+ "summary": "Pure deterministic SlexKit standard library."
17
+ },
18
+ {
19
+ "name": "api",
20
+ "scope": "host-injected",
21
+ "summary": "Host or secure runtime capability object."
22
+ },
23
+ {
24
+ "name": "$event",
25
+ "scope": "event handlers",
26
+ "summary": "Event payload for on* handlers."
27
+ },
28
+ {
29
+ "name": "$item",
30
+ "scope": "$for",
31
+ "summary": "Current array item."
32
+ },
33
+ {
34
+ "name": "$index",
35
+ "scope": "$for",
36
+ "summary": "Current item index."
37
+ },
38
+ {
39
+ "name": "$key",
40
+ "scope": "$for",
41
+ "summary": "Current item key."
42
+ }
43
+ ],
44
+ "stdlib": [
45
+ {
46
+ "name": "math",
47
+ "summary": "Small numeric helpers for common interactive calculations.",
48
+ "functions": [
49
+ {
50
+ "name": "std.math.clamp",
51
+ "signature": "clamp(value, min, max)",
52
+ "summary": "Clamp a number into a range.",
53
+ "pure": true,
54
+ "example": "std.math.clamp(g.score, 0, 100)"
55
+ },
56
+ {
57
+ "name": "std.math.round",
58
+ "signature": "round(value, digits = 0)",
59
+ "summary": "Round with a fixed number of decimal digits.",
60
+ "pure": true,
61
+ "example": "std.math.round(g.latency, 1)"
62
+ },
63
+ {
64
+ "name": "std.math.safeDivide",
65
+ "signature": "safeDivide(numerator, denominator, fallback = 0)",
66
+ "summary": "Divide with a fallback for zero or invalid denominators.",
67
+ "pure": true,
68
+ "example": "std.math.safeDivide(g.used, g.total, 0)"
69
+ },
70
+ {
71
+ "name": "std.math.percent",
72
+ "signature": "percent(part, total, digits = 1)",
73
+ "summary": "Return part / total as a percentage number.",
74
+ "pure": true,
75
+ "example": "std.math.percent(g.done, g.total, 1)"
76
+ },
77
+ {
78
+ "name": "std.math.lerp",
79
+ "signature": "lerp(start, end, t)",
80
+ "summary": "Linear interpolation.",
81
+ "pure": true,
82
+ "example": "std.math.lerp(0, 100, g.progress)"
83
+ }
84
+ ]
85
+ },
86
+ {
87
+ "name": "stats",
88
+ "summary": "Finite-number aggregations for arrays.",
89
+ "functions": [
90
+ {
91
+ "name": "std.stats.sum",
92
+ "signature": "sum(values)",
93
+ "summary": "Sum finite numeric values. Empty arrays return 0.",
94
+ "pure": true,
95
+ "example": "std.stats.sum(g.samples)"
96
+ },
97
+ {
98
+ "name": "std.stats.mean",
99
+ "signature": "mean(values)",
100
+ "summary": "Average finite numeric values. Empty arrays return NaN.",
101
+ "pure": true,
102
+ "example": "std.stats.mean(g.samples)"
103
+ },
104
+ {
105
+ "name": "std.stats.min",
106
+ "signature": "min(values)",
107
+ "summary": "Minimum finite numeric value. Empty arrays return NaN.",
108
+ "pure": true,
109
+ "example": "std.stats.min(g.samples)"
110
+ },
111
+ {
112
+ "name": "std.stats.max",
113
+ "signature": "max(values)",
114
+ "summary": "Maximum finite numeric value. Empty arrays return NaN.",
115
+ "pure": true,
116
+ "example": "std.stats.max(g.samples)"
117
+ },
118
+ {
119
+ "name": "std.stats.median",
120
+ "signature": "median(values)",
121
+ "summary": "Median finite numeric value. Empty arrays return NaN.",
122
+ "pure": true,
123
+ "example": "std.stats.median(g.samples)"
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "name": "format",
129
+ "summary": "Deterministic display formatting with en-US defaults.",
130
+ "functions": [
131
+ {
132
+ "name": "std.format.fixed",
133
+ "signature": "fixed(value, digits = 2)",
134
+ "summary": "Format a number with fixed decimal places.",
135
+ "pure": true,
136
+ "example": "std.format.fixed(g.voltage, 3)"
137
+ },
138
+ {
139
+ "name": "std.format.number",
140
+ "signature": "number(value, digits = 0, locale = 'en-US')",
141
+ "summary": "Locale number formatting.",
142
+ "pure": true,
143
+ "example": "std.format.number(g.requests)"
144
+ },
145
+ {
146
+ "name": "std.format.compact",
147
+ "signature": "compact(value, digits = 1, locale = 'en-US')",
148
+ "summary": "Compact number formatting.",
149
+ "pure": true,
150
+ "example": "std.format.compact(g.users)"
151
+ },
152
+ {
153
+ "name": "std.format.percent",
154
+ "signature": "percent(ratio, digits = 1)",
155
+ "summary": "Format a ratio as a percentage string.",
156
+ "pure": true,
157
+ "example": "std.format.percent(g.done / g.total, 1)"
158
+ },
159
+ {
160
+ "name": "std.format.currency",
161
+ "signature": "currency(value, currency = 'USD', locale = 'en-US')",
162
+ "summary": "Format a currency value.",
163
+ "pure": true,
164
+ "example": "std.format.currency(g.revenue, 'USD')"
165
+ }
166
+ ]
167
+ },
168
+ {
169
+ "name": "units",
170
+ "summary": "Small unit display helpers for common dashboards.",
171
+ "functions": [
172
+ {
173
+ "name": "std.units.withUnit",
174
+ "signature": "withUnit(value, unit, digits = 2)",
175
+ "summary": "Format a value with a unit suffix.",
176
+ "pure": true,
177
+ "example": "std.units.withUnit(g.power, 'W', 1)"
178
+ },
179
+ {
180
+ "name": "std.units.bytes",
181
+ "signature": "bytes(value, digits = 1)",
182
+ "summary": "Format bytes as B, KB, MB, GB, TB, or PB.",
183
+ "pure": true,
184
+ "example": "std.units.bytes(g.payloadBytes)"
185
+ },
186
+ {
187
+ "name": "std.units.duration",
188
+ "signature": "duration(ms, digits = 1)",
189
+ "summary": "Format milliseconds as ms, s, min, or h.",
190
+ "pure": true,
191
+ "example": "std.units.duration(g.elapsedMs)"
192
+ },
193
+ {
194
+ "name": "std.units.si",
195
+ "signature": "si(value, unit = '', digits = 2)",
196
+ "summary": "Format with SI prefixes.",
197
+ "pure": true,
198
+ "example": "std.units.si(g.frequency, 'Hz', 2)"
199
+ }
200
+ ]
201
+ }
202
+ ],
203
+ "stdlibFunctionNames": [
204
+ "std.math.clamp",
205
+ "std.math.round",
206
+ "std.math.safeDivide",
207
+ "std.math.percent",
208
+ "std.math.lerp",
209
+ "std.stats.sum",
210
+ "std.stats.mean",
211
+ "std.stats.min",
212
+ "std.stats.max",
213
+ "std.stats.median",
214
+ "std.format.fixed",
215
+ "std.format.number",
216
+ "std.format.compact",
217
+ "std.format.percent",
218
+ "std.format.currency",
219
+ "std.units.withUnit",
220
+ "std.units.bytes",
221
+ "std.units.duration",
222
+ "std.units.si"
223
+ ],
224
+ "apiCapabilities": [
225
+ {
226
+ "name": "api.get",
227
+ "policy": "network",
228
+ "signature": "get(url, options)",
229
+ "summary": "Policy-gated GET request.",
230
+ "example": "await api.get('https://api.example.com/status')",
231
+ "secureDefault": "denied",
232
+ "forbidden": [
233
+ "fetch(url)",
234
+ "XMLHttpRequest",
235
+ "WebSocket"
236
+ ]
237
+ },
238
+ {
239
+ "name": "api.post",
240
+ "policy": "network",
241
+ "signature": "post(url, body, options)",
242
+ "summary": "Policy-gated POST request.",
243
+ "example": "await api.post('https://api.example.com/items', { ok: true })",
244
+ "secureDefault": "denied",
245
+ "forbidden": [
246
+ "fetch(url)",
247
+ "XMLHttpRequest",
248
+ "WebSocket"
249
+ ]
250
+ },
251
+ {
252
+ "name": "api.fetch",
253
+ "policy": "network",
254
+ "signature": "fetch(url, options)",
255
+ "summary": "Policy-gated GET or POST request.",
256
+ "example": "await api.fetch(url, { method: 'GET' })",
257
+ "secureDefault": "denied",
258
+ "forbidden": [
259
+ "fetch(url)",
260
+ "XMLHttpRequest",
261
+ "WebSocket"
262
+ ]
263
+ },
264
+ {
265
+ "name": "api.setTimeout",
266
+ "policy": "timer",
267
+ "signature": "setTimeout(fn, ms)",
268
+ "summary": "Policy-gated timeout.",
269
+ "example": "api.setTimeout(function () { g.ready = true; }, 500)",
270
+ "secureDefault": "denied",
271
+ "forbidden": [
272
+ "setTimeout(fn, ms)"
273
+ ]
274
+ },
275
+ {
276
+ "name": "api.clearTimeout",
277
+ "policy": "timer",
278
+ "signature": "clearTimeout(id)",
279
+ "summary": "Clear a policy-gated timeout.",
280
+ "example": "api.clearTimeout(g.timeoutId)",
281
+ "secureDefault": "denied"
282
+ },
283
+ {
284
+ "name": "api.setInterval",
285
+ "policy": "timer",
286
+ "signature": "setInterval(fn, ms)",
287
+ "summary": "Policy-gated interval.",
288
+ "example": "api.setInterval(function () { g.ticks += 1; }, 1000)",
289
+ "secureDefault": "denied",
290
+ "forbidden": [
291
+ "setInterval(fn, ms)"
292
+ ]
293
+ },
294
+ {
295
+ "name": "api.clearInterval",
296
+ "policy": "timer",
297
+ "signature": "clearInterval(id)",
298
+ "summary": "Clear a policy-gated interval.",
299
+ "example": "api.clearInterval(g.intervalId)",
300
+ "secureDefault": "denied"
301
+ },
302
+ {
303
+ "name": "api.raf",
304
+ "policy": "animation",
305
+ "signature": "raf(fn)",
306
+ "summary": "Policy-gated animation frame.",
307
+ "example": "api.raf(function (time) { g.time = time; })",
308
+ "secureDefault": "denied",
309
+ "forbidden": [
310
+ "requestAnimationFrame(fn)"
311
+ ]
312
+ },
313
+ {
314
+ "name": "api.cancelRaf",
315
+ "policy": "animation",
316
+ "signature": "cancelRaf(id)",
317
+ "summary": "Cancel a policy-gated animation frame.",
318
+ "example": "api.cancelRaf(g.rafId)",
319
+ "secureDefault": "denied"
320
+ },
321
+ {
322
+ "name": "api.createCanvas",
323
+ "policy": "canvas",
324
+ "signature": "createCanvas(width, height)",
325
+ "summary": "Create a policy-counted canvas.",
326
+ "example": "var canvas = api.createCanvas(320, 180)",
327
+ "secureDefault": "denied"
328
+ },
329
+ {
330
+ "name": "api.getCanvasContext",
331
+ "policy": "canvas",
332
+ "signature": "getCanvasContext(canvas, contextId, options)",
333
+ "summary": "Get a policy-checked canvas context.",
334
+ "example": "var ctx = api.getCanvasContext(canvas, '2d')",
335
+ "secureDefault": "denied"
336
+ },
337
+ {
338
+ "name": "api.onDispose",
339
+ "policy": "lifecycle",
340
+ "signature": "onDispose(fn)",
341
+ "summary": "Register runtime cleanup.",
342
+ "example": "api.onDispose(function () { g.closed = true; })",
343
+ "secureDefault": "available"
344
+ },
345
+ {
346
+ "name": "api.now",
347
+ "policy": "lifecycle",
348
+ "signature": "now()",
349
+ "summary": "Runtime clock.",
350
+ "example": "api.now()",
351
+ "secureDefault": "available"
352
+ },
353
+ {
354
+ "name": "api.isTimeoutError",
355
+ "policy": "diagnostics",
356
+ "signature": "isTimeoutError(error)",
357
+ "summary": "Check timeout errors.",
358
+ "example": "api.isTimeoutError(error)",
359
+ "secureDefault": "available"
360
+ },
361
+ {
362
+ "name": "api.isNetworkError",
363
+ "policy": "diagnostics",
364
+ "signature": "isNetworkError(error)",
365
+ "summary": "Check network errors.",
366
+ "example": "api.isNetworkError(error)",
367
+ "secureDefault": "available"
368
+ },
369
+ {
370
+ "name": "api.isPolicyError",
371
+ "policy": "diagnostics",
372
+ "signature": "isPolicyError(error)",
373
+ "summary": "Check policy errors.",
374
+ "example": "api.isPolicyError(error)",
375
+ "secureDefault": "available"
376
+ },
377
+ {
378
+ "name": "api.errorMessage",
379
+ "policy": "diagnostics",
380
+ "signature": "errorMessage(error)",
381
+ "summary": "Extract a displayable error message.",
382
+ "example": "api.errorMessage(error)",
383
+ "secureDefault": "available"
384
+ }
385
+ ],
386
+ "apiCapabilityNames": [
387
+ "api.get",
388
+ "api.post",
389
+ "api.fetch",
390
+ "api.setTimeout",
391
+ "api.clearTimeout",
392
+ "api.setInterval",
393
+ "api.clearInterval",
394
+ "api.raf",
395
+ "api.cancelRaf",
396
+ "api.createCanvas",
397
+ "api.getCanvasContext",
398
+ "api.onDispose",
399
+ "api.now",
400
+ "api.isTimeoutError",
401
+ "api.isNetworkError",
402
+ "api.isPolicyError",
403
+ "api.errorMessage"
404
+ ],
405
+ "secureNativeCapabilitiesDenied": [
406
+ "fetch",
407
+ "XMLHttpRequest",
408
+ "WebSocket",
409
+ "setTimeout",
410
+ "setInterval",
411
+ "requestAnimationFrame"
412
+ ]
413
+ }