kloudy 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 ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "kloudy",
3
+ "version": "0.4.0",
4
+ "description": "Ask for Kloudy: CLI, MCP and SDK clients for the same scoped engine session.",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "engines": {
8
+ "node": ">=20.19.0"
9
+ },
10
+ "bin": {
11
+ "kloudy": "bin/entry.mjs"
12
+ },
13
+ "exports": {
14
+ ".": "./src/client.mjs",
15
+ "./mcp": "./src/mcp.mjs",
16
+ "./wrap": "./src/wrap.mjs",
17
+ "./session": "./src/connection.mjs",
18
+ "./httpk": "./src/httpk.mjs",
19
+ "./hosted": "./src/hosted.mjs",
20
+ "./public": "./src/public.mjs",
21
+ "./strings": "./src/strings.mjs",
22
+ "./sdf": "./src/sdf.mjs",
23
+ "./query": "./src/query.mjs",
24
+ "./activity": "./src/activity.mjs",
25
+ "./status-indicator.css": "./src/status-indicator.css",
26
+ "./models": "./src/models.mjs",
27
+ "./host-interface": "./src/host-interface.mjs",
28
+ "./replies": "./src/replies.mjs"
29
+ },
30
+ "files": [
31
+ "bin",
32
+ "src",
33
+ "schemas",
34
+ "README.md",
35
+ "MCP-DEFAULT.md",
36
+ "LICENSE"
37
+ ],
38
+ "scripts": {
39
+ "test": "node --test test/*.test.mjs",
40
+ "check": "node --check bin/kloudy.mjs && node --check src/client.mjs && npm test",
41
+ "start": "node bin/kloudy.mjs",
42
+ "proof": "node scripts/prove.mjs",
43
+ "build:approval": "node scripts/build-approval.mjs"
44
+ },
45
+ "dependencies": {
46
+ "@modelcontextprotocol/ext-apps": "2.0.3",
47
+ "@modelcontextprotocol/sdk": "1.31.0",
48
+ "ajv": "8.20.0",
49
+ "ajv-formats": "3.0.1",
50
+ "js-tiktoken": "1.0.21",
51
+ "jsonc-parser": "3.3.1",
52
+ "smol-toml": "1.9.0",
53
+ "zod": "4.6.5"
54
+ },
55
+ "devDependencies": {
56
+ "esbuild": "0.28.2"
57
+ },
58
+ "mcpName": "io.github.Gio300/kloudy",
59
+ "repository": {
60
+ "type": "git",
61
+ "url": "git+https://github.com/Gio300/kloudy-open.git"
62
+ },
63
+ "homepage": "https://kloudy.ai/install",
64
+ "publishConfig": {
65
+ "access": "public",
66
+ "registry": "https://registry.npmjs.org"
67
+ }
68
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pranab Sarkar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,411 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://sdfprotocol.org/schemas/sdf-document-0.2.schema.json",
4
+ "title": "SDF Document v0.2",
5
+ "description": "Structured Data Format v0.2.0 - Agent-readable content protocol with hierarchical type system",
6
+ "type": "object",
7
+ "required": [
8
+ "sdf_version",
9
+ "id",
10
+ "parent_type",
11
+ "type",
12
+ "type_data",
13
+ "source",
14
+ "summary",
15
+ "provenance"
16
+ ],
17
+ "additionalProperties": false,
18
+ "properties": {
19
+ "sdf_version": {
20
+ "type": "string",
21
+ "const": "0.2.0",
22
+ "description": "SDF protocol version"
23
+ },
24
+ "id": {
25
+ "type": "string",
26
+ "pattern": "^sdf:[a-f0-9]{64}$",
27
+ "description": "Unique document identifier (sdf:<sha256>)"
28
+ },
29
+ "canonical_url": {
30
+ "type": "string",
31
+ "format": "uri",
32
+ "description": "Original source URL"
33
+ },
34
+ "parent_type": {
35
+ "type": "string",
36
+ "enum": [
37
+ "article",
38
+ "documentation",
39
+ "commerce",
40
+ "data",
41
+ "reference",
42
+ "discussion",
43
+ "code",
44
+ "media",
45
+ "profile",
46
+ "event"
47
+ ],
48
+ "description": "Top-level content category (like MIME type)"
49
+ },
50
+ "type": {
51
+ "type": "string",
52
+ "description": "Specific content subtype (like MIME subtype)"
53
+ },
54
+ "type_data": {
55
+ "type": "object",
56
+ "description": "Type-specific structured data (fields depend on parent_type + type)"
57
+ },
58
+ "aspects": {
59
+ "type": "array",
60
+ "description": "Additional type overlays for multi-type content",
61
+ "items": {
62
+ "type": "object",
63
+ "required": ["aspect_type", "type_data"],
64
+ "properties": {
65
+ "aspect_type": {
66
+ "type": "object",
67
+ "required": ["parent_type", "type"],
68
+ "properties": {
69
+ "parent_type": {
70
+ "type": "string",
71
+ "enum": ["article", "documentation", "commerce", "data", "reference", "discussion", "code", "media", "profile", "event"]
72
+ },
73
+ "type": { "type": "string" },
74
+ "schema": { "type": "string", "format": "uri" }
75
+ }
76
+ },
77
+ "type_data": { "type": "object" },
78
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
79
+ }
80
+ }
81
+ },
82
+ "language": {
83
+ "type": "string",
84
+ "description": "BCP-47 language tag"
85
+ },
86
+ "created_at": {
87
+ "type": "string",
88
+ "format": "date-time"
89
+ },
90
+ "updated_at": {
91
+ "type": "string",
92
+ "format": "date-time"
93
+ },
94
+ "source": {
95
+ "type": "object",
96
+ "required": ["url", "fetched_at"],
97
+ "properties": {
98
+ "url": { "type": "string", "format": "uri" },
99
+ "title": { "type": "string" },
100
+ "author": { "type": "string" },
101
+ "site_name": { "type": "string" },
102
+ "published_at": { "type": "string", "format": "date-time" },
103
+ "fetched_at": { "type": "string", "format": "date-time" }
104
+ }
105
+ },
106
+ "summary": {
107
+ "type": "object",
108
+ "required": ["brief", "key_points"],
109
+ "properties": {
110
+ "brief": { "type": "string", "maxLength": 300 },
111
+ "detailed": { "type": "string", "maxLength": 1000 },
112
+ "key_points": { "type": "array", "items": { "type": "string" }, "maxItems": 10 }
113
+ }
114
+ },
115
+ "entities": {
116
+ "type": "array",
117
+ "items": {
118
+ "type": "object",
119
+ "required": ["name", "type"],
120
+ "properties": {
121
+ "name": { "type": "string" },
122
+ "type": {
123
+ "type": "string",
124
+ "enum": ["person", "organization", "concept", "technology", "location", "product", "event", "other"]
125
+ },
126
+ "description": { "type": "string" },
127
+ "relevance": { "type": "number", "minimum": 0, "maximum": 1 },
128
+ "identifiers": {
129
+ "type": "array",
130
+ "items": {
131
+ "type": "object",
132
+ "required": ["scheme", "value"],
133
+ "properties": {
134
+ "scheme": { "type": "string" },
135
+ "value": { "type": "string" },
136
+ "url": { "type": "string", "format": "uri" }
137
+ }
138
+ }
139
+ }
140
+ }
141
+ }
142
+ },
143
+ "claims": {
144
+ "type": "array",
145
+ "items": {
146
+ "type": "object",
147
+ "required": ["statement", "type"],
148
+ "properties": {
149
+ "statement": { "type": "string" },
150
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
151
+ "evidence": { "type": "string" },
152
+ "type": {
153
+ "type": "string",
154
+ "enum": ["fact", "opinion", "prediction", "instruction", "definition"]
155
+ },
156
+ "verification": {
157
+ "type": "object",
158
+ "properties": {
159
+ "status": {
160
+ "type": "string",
161
+ "enum": ["verified", "disputed", "unverified", "retracted"]
162
+ },
163
+ "priority": { "type": "string" },
164
+ "check_queries": { "type": "array", "items": { "type": "string" } },
165
+ "refs": { "type": "array", "items": { "type": "string" } }
166
+ }
167
+ },
168
+ "temporal": {
169
+ "type": "object",
170
+ "properties": {
171
+ "as_of": { "type": "string", "format": "date-time" },
172
+ "valid_until": { "type": "string", "format": "date-time" },
173
+ "time_sensitivity": { "type": "string" }
174
+ }
175
+ }
176
+ }
177
+ }
178
+ },
179
+ "topics": {
180
+ "type": "array",
181
+ "items": { "type": "string" }
182
+ },
183
+ "relationships": {
184
+ "type": "array",
185
+ "items": {
186
+ "type": "object",
187
+ "required": ["subject", "predicate", "object"],
188
+ "properties": {
189
+ "subject": { "type": "string" },
190
+ "predicate": {
191
+ "type": "string",
192
+ "enum": ["relates_to", "depends_on", "contradicts", "supports", "part_of", "created_by", "used_by", "alternative_to"]
193
+ },
194
+ "object": { "type": "string" }
195
+ }
196
+ }
197
+ },
198
+ "sections": {
199
+ "type": "array",
200
+ "items": {
201
+ "type": "object",
202
+ "required": ["title", "summary"],
203
+ "properties": {
204
+ "title": { "type": "string" },
205
+ "summary": { "type": "string" },
206
+ "content_type": {
207
+ "type": "string",
208
+ "enum": ["text", "code", "data", "media", "mixed"]
209
+ }
210
+ }
211
+ }
212
+ },
213
+ "metadata": {
214
+ "type": "object",
215
+ "properties": {
216
+ "word_count": { "type": "integer", "minimum": 0 },
217
+ "reading_level": {
218
+ "type": "string",
219
+ "enum": ["basic", "intermediate", "advanced", "expert"]
220
+ },
221
+ "content_quality": { "type": "number", "minimum": 0, "maximum": 1 },
222
+ "freshness": {
223
+ "type": "string",
224
+ "enum": ["current", "recent", "dated", "evergreen"]
225
+ }
226
+ }
227
+ },
228
+ "provenance": {
229
+ "type": "object",
230
+ "required": ["converter", "content_hash"],
231
+ "properties": {
232
+ "converter": { "type": "string" },
233
+ "model_used": { "type": "string" },
234
+ "conversion_confidence": { "type": "number", "minimum": 0, "maximum": 1 },
235
+ "content_hash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
236
+ "signature": { "type": ["string", "null"] },
237
+ "source": {
238
+ "type": "object",
239
+ "properties": {
240
+ "type": { "type": "string" },
241
+ "url": { "type": "string", "format": "uri" },
242
+ "name": { "type": "string" }
243
+ }
244
+ },
245
+ "chain": {
246
+ "type": "array",
247
+ "items": {
248
+ "type": "object",
249
+ "properties": {
250
+ "step": { "type": "string" },
251
+ "tool": { "type": "string" },
252
+ "timestamp": { "type": "string", "format": "date-time" }
253
+ }
254
+ }
255
+ },
256
+ "attestations": {
257
+ "type": "array",
258
+ "items": {
259
+ "type": "object",
260
+ "properties": {
261
+ "attester": { "type": "string" },
262
+ "method": { "type": "string" },
263
+ "value": { "type": "string" },
264
+ "timestamp": { "type": "string", "format": "date-time" }
265
+ }
266
+ }
267
+ },
268
+ "consensus": {
269
+ "type": "object",
270
+ "properties": {
271
+ "agreement_level": { "type": "number", "minimum": 0, "maximum": 1 },
272
+ "sources_count": { "type": "integer", "minimum": 0 },
273
+ "method": { "type": "string" }
274
+ }
275
+ }
276
+ }
277
+ },
278
+ "profiles": {
279
+ "type": "object",
280
+ "properties": {
281
+ "agent": {
282
+ "type": "object",
283
+ "properties": {
284
+ "priority_claims": { "type": "array", "items": { "type": "string" } },
285
+ "preferred_resolution": { "type": "string", "enum": ["brief", "detailed", "full"] },
286
+ "allowed_actions": { "type": "array", "items": { "type": "string" } },
287
+ "context_budget": { "type": "integer", "minimum": 0 },
288
+ "tool_hints": { "type": "array", "items": { "type": "string" } }
289
+ }
290
+ },
291
+ "search": {
292
+ "type": "object",
293
+ "properties": {
294
+ "index_fields": { "type": "array", "items": { "type": "string" } },
295
+ "boost_fields": { "type": "array", "items": { "type": "string" } },
296
+ "facets": { "type": "array", "items": { "type": "string" } },
297
+ "snippet_field": { "type": "string" }
298
+ }
299
+ },
300
+ "analytics": {
301
+ "type": "object",
302
+ "properties": {
303
+ "tracked_metrics": { "type": "array", "items": { "type": "string" } },
304
+ "time_series_fields": { "type": "array", "items": { "type": "string" } },
305
+ "aggregation_rules": { "type": "array", "items": { "type": "string" } }
306
+ }
307
+ },
308
+ "compliance": {
309
+ "type": "object",
310
+ "properties": {
311
+ "required_fields": { "type": "array", "items": { "type": "string" } },
312
+ "retention_policy": { "type": "string" },
313
+ "audit_fields": { "type": "array", "items": { "type": "string" } },
314
+ "pii_flags": { "type": "array", "items": { "type": "string" } }
315
+ }
316
+ }
317
+ }
318
+ },
319
+ "sdf": {
320
+ "type": "object",
321
+ "description": "SDF protocol header",
322
+ "properties": {
323
+ "version": { "type": "string" },
324
+ "schema_uri": { "type": "string", "format": "uri" },
325
+ "dialect": { "type": "string", "enum": ["core", "strict"] },
326
+ "features": { "type": "array", "items": { "type": "string" } },
327
+ "compatibility": {
328
+ "type": "object",
329
+ "properties": {
330
+ "min_consumer_version": { "type": "string" },
331
+ "deprecated_fields": { "type": "array", "items": { "type": "string" } }
332
+ }
333
+ }
334
+ }
335
+ },
336
+ "temporal": {
337
+ "type": "object",
338
+ "required": ["retrieved_at"],
339
+ "properties": {
340
+ "published_at": { "type": "string", "format": "date-time" },
341
+ "updated_at": { "type": "string", "format": "date-time" },
342
+ "retrieved_at": { "type": "string", "format": "date-time" },
343
+ "valid_from": { "type": "string", "format": "date-time" },
344
+ "valid_until": { "type": "string", "format": "date-time" },
345
+ "timezone": { "type": "string" },
346
+ "freshness": {
347
+ "type": "object",
348
+ "properties": {
349
+ "staleness_days": { "type": "number" },
350
+ "volatility": {
351
+ "type": "string",
352
+ "enum": ["static", "slow", "moderate", "fast", "realtime"]
353
+ },
354
+ "recommended_recheck_after_days": { "type": "number" },
355
+ "reason_codes": { "type": "array", "items": { "type": "string" } }
356
+ }
357
+ }
358
+ }
359
+ },
360
+ "links": {
361
+ "type": "array",
362
+ "items": {
363
+ "type": "object",
364
+ "required": ["rel", "href"],
365
+ "properties": {
366
+ "rel": { "type": "string" },
367
+ "href": { "type": "string", "format": "uri" },
368
+ "type": { "type": "string" },
369
+ "title": { "type": "string" },
370
+ "target_id": { "type": "string" },
371
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
372
+ "evidence": { "type": "object" }
373
+ }
374
+ }
375
+ },
376
+ "embeddings": {
377
+ "type": "array",
378
+ "items": {
379
+ "type": "object",
380
+ "required": ["id", "scope", "target_ref", "model"],
381
+ "properties": {
382
+ "id": { "type": "string" },
383
+ "scope": { "type": "string" },
384
+ "target_ref": { "type": "string" },
385
+ "model": { "type": "string" },
386
+ "vector": { "type": "array", "items": { "type": "number" } },
387
+ "vector_uri": { "type": "string", "format": "uri" },
388
+ "created_at": { "type": "string", "format": "date-time" },
389
+ "input_hash": { "type": "string" },
390
+ "normalize": { "type": "boolean" },
391
+ "distance": { "type": "string" }
392
+ }
393
+ }
394
+ },
395
+ "omitted": {
396
+ "type": "object",
397
+ "properties": {
398
+ "resolution": { "type": "string", "enum": ["compact", "standard", "full"] },
399
+ "omitted_paths": { "type": "array", "items": { "type": "string" } },
400
+ "available_at": { "type": "string", "format": "uri" }
401
+ }
402
+ },
403
+ "extensions": {
404
+ "type": "object",
405
+ "description": "Vendor extensions: { vendor_name: { ... } }",
406
+ "additionalProperties": {
407
+ "type": "object"
408
+ }
409
+ }
410
+ }
411
+ }
@@ -0,0 +1,176 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kloudy.ai/schemas/sdf-webpage-v1.schema.json",
4
+ "title": "Kloudy extractive SDF webpage profile v1",
5
+ "allOf": [
6
+ {
7
+ "$ref": "https://sdfprotocol.org/schemas/sdf-document-0.2.schema.json"
8
+ }
9
+ ],
10
+ "type": "object",
11
+ "required": [
12
+ "sections",
13
+ "extensions",
14
+ "metadata",
15
+ "links",
16
+ "entities"
17
+ ],
18
+ "properties": {
19
+ "parent_type": {
20
+ "const": "article"
21
+ },
22
+ "type": {
23
+ "const": "article.x-kloudy-webpage"
24
+ },
25
+ "entities": {
26
+ "maxItems": 0
27
+ },
28
+ "sections": {
29
+ "type": "array",
30
+ "minItems": 1,
31
+ "maxItems": 40,
32
+ "items": {
33
+ "type": "object",
34
+ "properties": {
35
+ "title": {
36
+ "type": "string",
37
+ "maxLength": 160
38
+ },
39
+ "summary": {
40
+ "type": "string",
41
+ "maxLength": 1600
42
+ }
43
+ },
44
+ "required": [
45
+ "title",
46
+ "summary"
47
+ ]
48
+ }
49
+ },
50
+ "links": {
51
+ "maxItems": 50,
52
+ "items": {
53
+ "type": "object",
54
+ "properties": {
55
+ "href": {
56
+ "type": "string",
57
+ "maxLength": 2048
58
+ },
59
+ "title": {
60
+ "type": "string",
61
+ "maxLength": 160
62
+ },
63
+ "rel": {
64
+ "const": "references"
65
+ }
66
+ },
67
+ "required": [
68
+ "href",
69
+ "title",
70
+ "rel"
71
+ ]
72
+ }
73
+ },
74
+ "extensions": {
75
+ "type": "object",
76
+ "required": [
77
+ "x-kloudy"
78
+ ],
79
+ "properties": {
80
+ "x-kloudy": {
81
+ "type": "object",
82
+ "required": [
83
+ "profile",
84
+ "interaction_mode",
85
+ "capabilities",
86
+ "ownership_verified",
87
+ "published",
88
+ "truncated",
89
+ "resolution"
90
+ ],
91
+ "properties": {
92
+ "profile": {
93
+ "const": "kloudy.sdf.webpage/1"
94
+ },
95
+ "interaction_mode": {
96
+ "const": "informational_only"
97
+ },
98
+ "capabilities": {
99
+ "type": "array",
100
+ "maxItems": 0
101
+ },
102
+ "ownership_verified": {
103
+ "const": false
104
+ },
105
+ "published": {
106
+ "const": false
107
+ },
108
+ "truncated": {
109
+ "type": "boolean"
110
+ },
111
+ "resolution": {
112
+ "enum": [
113
+ "compact",
114
+ "standard"
115
+ ]
116
+ }
117
+ }
118
+ }
119
+ }
120
+ },
121
+ "source": {
122
+ "type": "object",
123
+ "properties": {
124
+ "url": {
125
+ "maxLength": 4096
126
+ },
127
+ "title": {
128
+ "type": "string",
129
+ "maxLength": 200
130
+ }
131
+ },
132
+ "required": [
133
+ "title"
134
+ ]
135
+ },
136
+ "metadata": {
137
+ "type": "object",
138
+ "properties": {
139
+ "title": {
140
+ "type": "string",
141
+ "maxLength": 200
142
+ }
143
+ },
144
+ "required": [
145
+ "title"
146
+ ]
147
+ },
148
+ "summary": {
149
+ "type": "object",
150
+ "properties": {
151
+ "brief": {
152
+ "maxLength": 300
153
+ },
154
+ "key_points": {
155
+ "maxItems": 4,
156
+ "items": {
157
+ "type": "string",
158
+ "maxLength": 200
159
+ }
160
+ }
161
+ }
162
+ },
163
+ "type_data": {
164
+ "type": "object",
165
+ "required": [
166
+ "headline"
167
+ ],
168
+ "properties": {
169
+ "headline": {
170
+ "type": "string",
171
+ "maxLength": 200
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }