@gmickel/gno 1.18.0 → 1.19.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.
Files changed (129) hide show
  1. package/README.md +5 -3
  2. package/assets/skill/SKILL.md +27 -0
  3. package/package.json +2 -1
  4. package/spec/AGENTS.md +83 -0
  5. package/spec/CLAUDE.md +83 -0
  6. package/spec/bench-fixture.schema.json +137 -0
  7. package/spec/cli.md +2894 -0
  8. package/spec/db/schema.sql +442 -0
  9. package/spec/evals-agentic.md +510 -0
  10. package/spec/evals.md +1106 -0
  11. package/spec/mcp.md +2229 -0
  12. package/spec/output-schemas/activation-verification.schema.json +515 -0
  13. package/spec/output-schemas/ask.schema.json +366 -0
  14. package/spec/output-schemas/backlinks.schema.json +131 -0
  15. package/spec/output-schemas/bench-result.schema.json +120 -0
  16. package/spec/output-schemas/capture-receipt.schema.json +143 -0
  17. package/spec/output-schemas/collection-list.schema.json +45 -0
  18. package/spec/output-schemas/context-capsule-v1.schema.json +691 -0
  19. package/spec/output-schemas/context-capsule-verification.schema.json +1338 -0
  20. package/spec/output-schemas/context-list.schema.json +21 -0
  21. package/spec/output-schemas/doctor.schema.json +313 -0
  22. package/spec/output-schemas/error.schema.json +30 -0
  23. package/spec/output-schemas/expansion.schema.json +37 -0
  24. package/spec/output-schemas/get.schema.json +140 -0
  25. package/spec/output-schemas/graph-query.schema.json +99 -0
  26. package/spec/output-schemas/graph.schema.json +371 -0
  27. package/spec/output-schemas/links-list.schema.json +186 -0
  28. package/spec/output-schemas/mcp-add-collection-result.schema.json +23 -0
  29. package/spec/output-schemas/mcp-capture-result.schema.json +152 -0
  30. package/spec/output-schemas/mcp-http-error.schema.json +30 -0
  31. package/spec/output-schemas/mcp-job-list.schema.json +58 -0
  32. package/spec/output-schemas/mcp-job-status.schema.json +224 -0
  33. package/spec/output-schemas/mcp-remove-result.schema.json +39 -0
  34. package/spec/output-schemas/mcp-sync-result.schema.json +41 -0
  35. package/spec/output-schemas/mcp-tag-result.schema.json +33 -0
  36. package/spec/output-schemas/models-list.schema.json +93 -0
  37. package/spec/output-schemas/multi-get.schema.json +103 -0
  38. package/spec/output-schemas/process-status.schema.json +119 -0
  39. package/spec/output-schemas/query-diagnose.schema.json +123 -0
  40. package/spec/output-schemas/resident-status.schema.json +154 -0
  41. package/spec/output-schemas/retrieval-trace-common.schema.json +492 -0
  42. package/spec/output-schemas/retrieval-trace-delete.schema.json +16 -0
  43. package/spec/output-schemas/retrieval-trace-export.schema.json +61 -0
  44. package/spec/output-schemas/retrieval-trace-filters.schema.json +139 -0
  45. package/spec/output-schemas/retrieval-trace-judgment.schema.json +15 -0
  46. package/spec/output-schemas/retrieval-trace-list.schema.json +18 -0
  47. package/spec/output-schemas/retrieval-trace-payloads.schema.json +178 -0
  48. package/spec/output-schemas/retrieval-trace-purge.schema.json +31 -0
  49. package/spec/output-schemas/retrieval-trace-qrels.schema.json +303 -0
  50. package/spec/output-schemas/retrieval-trace-replay.schema.json +286 -0
  51. package/spec/output-schemas/retrieval-trace-show.schema.json +69 -0
  52. package/spec/output-schemas/retrieval-trace-summary.schema.json +65 -0
  53. package/spec/output-schemas/search-result.schema.json +154 -0
  54. package/spec/output-schemas/search-results.schema.json +338 -0
  55. package/spec/output-schemas/similar.schema.json +84 -0
  56. package/spec/output-schemas/status.schema.json +676 -0
  57. package/spec/output-schemas/tags-list.schema.json +48 -0
  58. package/src/app/context-runtime-types.ts +3 -0
  59. package/src/app/context-runtime.ts +15 -1
  60. package/src/cli/commands/ask.ts +106 -36
  61. package/src/cli/commands/context-build.ts +56 -9
  62. package/src/cli/commands/get.ts +64 -3
  63. package/src/cli/commands/query.ts +62 -23
  64. package/src/cli/commands/replay.ts +140 -0
  65. package/src/cli/commands/search.ts +48 -3
  66. package/src/cli/commands/shared.ts +3 -1
  67. package/src/cli/commands/trace.ts +200 -0
  68. package/src/cli/commands/vsearch.ts +75 -53
  69. package/src/cli/program.ts +255 -0
  70. package/src/config/index.ts +9 -0
  71. package/src/config/retrieval-traces.ts +56 -0
  72. package/src/config/types.ts +4 -0
  73. package/src/core/context-compiler.ts +11 -4
  74. package/src/core/retrieval-qrels.ts +405 -0
  75. package/src/core/retrieval-replay-candidate.ts +368 -0
  76. package/src/core/retrieval-replay-types.ts +109 -0
  77. package/src/core/retrieval-replay-validation.ts +89 -0
  78. package/src/core/retrieval-replay.ts +441 -0
  79. package/src/core/retrieval-trace-evidence-origin.ts +175 -0
  80. package/src/core/retrieval-trace-export.ts +113 -0
  81. package/src/core/retrieval-trace-filter-normalization.ts +27 -0
  82. package/src/core/retrieval-trace-filters.ts +19 -0
  83. package/src/core/retrieval-trace-management-helpers.ts +247 -0
  84. package/src/core/retrieval-trace-management-types.ts +132 -0
  85. package/src/core/retrieval-trace-management.ts +422 -0
  86. package/src/core/retrieval-trace-request.ts +141 -0
  87. package/src/core/retrieval-trace-session.ts +494 -0
  88. package/src/core/retrieval-trace.ts +472 -0
  89. package/src/mcp/tools/context.ts +59 -8
  90. package/src/mcp/tools/get.ts +35 -1
  91. package/src/mcp/tools/index.ts +74 -0
  92. package/src/mcp/tools/query.ts +95 -64
  93. package/src/mcp/tools/search.ts +36 -13
  94. package/src/mcp/tools/trace.ts +143 -0
  95. package/src/mcp/tools/vsearch.ts +71 -38
  96. package/src/pipeline/answer.ts +167 -26
  97. package/src/pipeline/graph-retrieval.ts +15 -1
  98. package/src/pipeline/hybrid.ts +151 -43
  99. package/src/pipeline/search.ts +36 -3
  100. package/src/pipeline/trace-metadata.ts +47 -0
  101. package/src/pipeline/types.ts +43 -0
  102. package/src/pipeline/vsearch.ts +101 -38
  103. package/src/sdk/client.ts +380 -71
  104. package/src/sdk/documents.ts +48 -1
  105. package/src/sdk/index.ts +17 -0
  106. package/src/sdk/types.ts +28 -0
  107. package/src/serve/context-capsule.ts +67 -8
  108. package/src/serve/public/app.tsx +12 -1
  109. package/src/serve/public/globals.built.css +1 -1
  110. package/src/serve/public/lib/workspace-tabs.ts +2 -0
  111. package/src/serve/public/pages/Dashboard.tsx +10 -0
  112. package/src/serve/public/pages/TraceHistory.tsx +478 -0
  113. package/src/serve/public/pages/trace-history-detail.tsx +224 -0
  114. package/src/serve/retrieval-trace.ts +28 -0
  115. package/src/serve/routes/api.ts +366 -72
  116. package/src/serve/routes/traces.ts +156 -0
  117. package/src/serve/server.ts +87 -2
  118. package/src/store/index.ts +31 -0
  119. package/src/store/migrations/014-retrieval-traces.ts +303 -0
  120. package/src/store/migrations/index.ts +2 -0
  121. package/src/store/retrieval-trace-codec.ts +384 -0
  122. package/src/store/sqlite/adapter.ts +153 -1
  123. package/src/store/sqlite/retrieval-trace-management-store.ts +341 -0
  124. package/src/store/sqlite/retrieval-trace-retention.ts +349 -0
  125. package/src/store/sqlite/retrieval-trace-rows.ts +267 -0
  126. package/src/store/sqlite/retrieval-trace-store.ts +515 -0
  127. package/src/store/types.ts +297 -0
  128. package/src/store/vector/sqlite-vec.ts +76 -1
  129. package/src/store/vector/types.ts +1 -1
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/context-list@1.0",
4
+ "title": "GNO Context List",
5
+ "description": "List of configured contexts for search enhancement",
6
+ "type": "array",
7
+ "items": {
8
+ "type": "object",
9
+ "required": ["scope", "text"],
10
+ "properties": {
11
+ "scope": {
12
+ "type": "string",
13
+ "description": "Scope key: '/' (global), 'name:' (collection), or 'gno://collection/path' (prefix)"
14
+ },
15
+ "text": {
16
+ "type": "string",
17
+ "description": "Context description text for search enhancement"
18
+ }
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,313 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/doctor@1.0",
4
+ "title": "GNO Doctor",
5
+ "description": "Health check diagnostics",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["healthy", "checks", "activation"],
9
+ "properties": {
10
+ "healthy": {
11
+ "type": "boolean",
12
+ "description": "Overall health status (true if no errors)"
13
+ },
14
+ "activation": {
15
+ "type": "object",
16
+ "additionalProperties": false,
17
+ "required": [
18
+ "schemaVersion",
19
+ "usable",
20
+ "healthy",
21
+ "collections",
22
+ "connectors",
23
+ "connectorProjection"
24
+ ],
25
+ "properties": {
26
+ "schemaVersion": { "const": "1.0" },
27
+ "usable": { "type": "boolean" },
28
+ "healthy": { "type": "boolean" },
29
+ "collections": {
30
+ "type": "array",
31
+ "items": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": [
35
+ "collection",
36
+ "ready",
37
+ "generatedAt",
38
+ "stages",
39
+ "semanticAvailability",
40
+ "remediation"
41
+ ],
42
+ "properties": {
43
+ "collection": { "type": "string" },
44
+ "ready": { "type": "boolean" },
45
+ "generatedAt": {
46
+ "type": ["string", "null"],
47
+ "format": "date-time"
48
+ },
49
+ "stages": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "required": ["index", "lexical", "semantic", "connector"],
53
+ "properties": {
54
+ "index": {
55
+ "$ref": "#/properties/activation/definitions/stage"
56
+ },
57
+ "lexical": {
58
+ "$ref": "#/properties/activation/definitions/stage"
59
+ },
60
+ "semantic": {
61
+ "$ref": "#/properties/activation/definitions/stage"
62
+ },
63
+ "connector": {
64
+ "$ref": "#/properties/activation/definitions/stage"
65
+ }
66
+ }
67
+ },
68
+ "semanticAvailability": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["status", "code", "command"],
72
+ "allOf": [
73
+ {
74
+ "if": {
75
+ "properties": {
76
+ "code": { "const": "vector_unavailable" }
77
+ },
78
+ "required": ["code"]
79
+ },
80
+ "then": {
81
+ "properties": { "status": { "const": "skipped" } }
82
+ }
83
+ },
84
+ {
85
+ "if": {
86
+ "properties": {
87
+ "code": {
88
+ "enum": [
89
+ "models_missing",
90
+ "embeddings_pending",
91
+ "semantic_not_checked"
92
+ ]
93
+ }
94
+ },
95
+ "required": ["code"]
96
+ },
97
+ "then": {
98
+ "properties": { "status": { "const": "pending" } }
99
+ }
100
+ }
101
+ ],
102
+ "properties": {
103
+ "status": { "enum": ["pending", "skipped"] },
104
+ "code": {
105
+ "enum": [
106
+ "models_missing",
107
+ "embeddings_pending",
108
+ "vector_unavailable",
109
+ "semantic_not_checked"
110
+ ]
111
+ },
112
+ "command": { "type": "string" }
113
+ }
114
+ },
115
+ "remediation": {
116
+ "type": ["object", "null"],
117
+ "additionalProperties": false,
118
+ "required": ["stage", "code", "command", "message"],
119
+ "properties": {
120
+ "stage": {
121
+ "enum": ["index", "lexical", "semantic", "connector"]
122
+ },
123
+ "code": {
124
+ "$ref": "#/properties/activation/definitions/code"
125
+ },
126
+ "command": { "type": "string" },
127
+ "message": { "type": "string" }
128
+ }
129
+ }
130
+ }
131
+ }
132
+ },
133
+ "connectors": {
134
+ "type": "array",
135
+ "maxItems": 64,
136
+ "items": {
137
+ "type": "object",
138
+ "additionalProperties": false,
139
+ "required": ["collection", "target", "status", "remediation"],
140
+ "properties": {
141
+ "collection": { "type": "string" },
142
+ "target": { "type": "string" },
143
+ "status": {
144
+ "enum": ["passed", "pending", "failed", "skipped"]
145
+ },
146
+ "code": {
147
+ "$ref": "#/properties/activation/definitions/code"
148
+ },
149
+ "remediation": { "type": ["string", "null"] }
150
+ }
151
+ }
152
+ },
153
+ "connectorProjection": {
154
+ "type": "object",
155
+ "additionalProperties": false,
156
+ "required": ["total", "projected", "truncated"],
157
+ "properties": {
158
+ "total": {
159
+ "type": "integer",
160
+ "minimum": 0,
161
+ "description": "All configured collection and connector target pairs before projection bounds."
162
+ },
163
+ "projected": {
164
+ "type": "integer",
165
+ "minimum": 0,
166
+ "maximum": 64,
167
+ "description": "Pairs included in connectors; always equals connectors.length."
168
+ },
169
+ "truncated": {
170
+ "type": "boolean",
171
+ "description": "True exactly when total is greater than projected; omitted pairs have no claimed result."
172
+ }
173
+ }
174
+ }
175
+ },
176
+ "definitions": {
177
+ "code": {
178
+ "enum": [
179
+ "no_documents",
180
+ "index_out_of_sync",
181
+ "no_probe_term",
182
+ "index_query_failed",
183
+ "retrieval_mismatch",
184
+ "semantic_not_checked",
185
+ "connector_not_requested",
186
+ "connector_not_configured",
187
+ "connector_probe_unavailable",
188
+ "connector_unsupported_config",
189
+ "connector_start_failed",
190
+ "connector_timeout",
191
+ "connector_missing_tools",
192
+ "connector_status_failed",
193
+ "connector_search_failed",
194
+ "connector_result_mismatch",
195
+ "target_runtime_unverifiable"
196
+ ]
197
+ },
198
+ "stage": {
199
+ "type": "object",
200
+ "additionalProperties": false,
201
+ "required": ["status", "startedAt", "completedAt", "latencyMs"],
202
+ "properties": {
203
+ "status": {
204
+ "enum": ["passed", "pending", "failed", "skipped"]
205
+ },
206
+ "startedAt": { "type": ["string", "null"], "format": "date-time" },
207
+ "completedAt": {
208
+ "type": ["string", "null"],
209
+ "format": "date-time"
210
+ },
211
+ "latencyMs": { "type": ["integer", "null"], "minimum": 0 },
212
+ "code": {
213
+ "$ref": "#/properties/activation/definitions/code"
214
+ }
215
+ }
216
+ }
217
+ }
218
+ },
219
+ "checks": {
220
+ "type": "array",
221
+ "description": "Individual diagnostic checks",
222
+ "items": {
223
+ "type": "object",
224
+ "required": ["name", "status", "message"],
225
+ "properties": {
226
+ "name": {
227
+ "type": "string",
228
+ "description": "Check identifier"
229
+ },
230
+ "status": {
231
+ "type": "string",
232
+ "enum": ["ok", "warn", "error"],
233
+ "description": "Check result status"
234
+ },
235
+ "message": {
236
+ "type": "string",
237
+ "description": "Human-readable status message"
238
+ },
239
+ "details": {
240
+ "type": "array",
241
+ "description": "Additional diagnostic details and recovery guidance",
242
+ "items": {
243
+ "type": "string"
244
+ }
245
+ },
246
+ "embeddingFingerprint": {
247
+ "type": "object",
248
+ "description": "Embedding freshness fingerprint diagnostics",
249
+ "required": [
250
+ "model",
251
+ "currentFingerprint",
252
+ "pendingChunks",
253
+ "legacyChunks",
254
+ "mixedGroups",
255
+ "groups"
256
+ ],
257
+ "properties": {
258
+ "model": {
259
+ "type": "string"
260
+ },
261
+ "currentFingerprint": {
262
+ "type": "string"
263
+ },
264
+ "pendingChunks": {
265
+ "type": "integer",
266
+ "minimum": 0
267
+ },
268
+ "legacyChunks": {
269
+ "type": "integer",
270
+ "minimum": 0
271
+ },
272
+ "mixedGroups": {
273
+ "type": "integer",
274
+ "minimum": 0
275
+ },
276
+ "groups": {
277
+ "type": "array",
278
+ "items": {
279
+ "type": "object",
280
+ "required": [
281
+ "model",
282
+ "fingerprint",
283
+ "count",
284
+ "current",
285
+ "legacy"
286
+ ],
287
+ "properties": {
288
+ "model": {
289
+ "type": "string"
290
+ },
291
+ "fingerprint": {
292
+ "type": "string"
293
+ },
294
+ "count": {
295
+ "type": "integer",
296
+ "minimum": 0
297
+ },
298
+ "current": {
299
+ "type": "boolean"
300
+ },
301
+ "legacy": {
302
+ "type": "boolean"
303
+ }
304
+ }
305
+ }
306
+ }
307
+ }
308
+ }
309
+ }
310
+ }
311
+ }
312
+ }
313
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/error@1.0",
4
+ "title": "GNO Error Response",
5
+ "description": "Error response for CLI JSON output",
6
+ "type": "object",
7
+ "required": ["error"],
8
+ "properties": {
9
+ "error": {
10
+ "type": "object",
11
+ "required": ["code", "message"],
12
+ "properties": {
13
+ "code": {
14
+ "type": "string",
15
+ "description": "Error code matching exit code",
16
+ "enum": ["VALIDATION", "RUNTIME"]
17
+ },
18
+ "message": {
19
+ "type": "string",
20
+ "description": "Human-readable error message"
21
+ },
22
+ "details": {
23
+ "type": "object",
24
+ "description": "Additional error context",
25
+ "additionalProperties": true
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/expansion@1.0",
4
+ "title": "GNO Query Expansion Result",
5
+ "description": "Result of query expansion for hybrid search",
6
+ "type": "object",
7
+ "required": ["lexicalQueries", "vectorQueries"],
8
+ "properties": {
9
+ "lexicalQueries": {
10
+ "type": "array",
11
+ "description": "Lexical (BM25) query variants",
12
+ "items": {
13
+ "type": "string"
14
+ },
15
+ "minItems": 0,
16
+ "maxItems": 5
17
+ },
18
+ "vectorQueries": {
19
+ "type": "array",
20
+ "description": "Semantic (vector) query variants",
21
+ "items": {
22
+ "type": "string"
23
+ },
24
+ "minItems": 0,
25
+ "maxItems": 5
26
+ },
27
+ "hyde": {
28
+ "type": "string",
29
+ "description": "Hypothetical document embedding (HyDE) text"
30
+ },
31
+ "notes": {
32
+ "type": "string",
33
+ "description": "Optional debug notes from expansion model"
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ }
@@ -0,0 +1,140 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/get@1.0",
4
+ "title": "GNO Get Response",
5
+ "description": "Response from gno get command",
6
+ "type": "object",
7
+ "required": [
8
+ "docid",
9
+ "uri",
10
+ "content",
11
+ "totalLines",
12
+ "source",
13
+ "capabilities"
14
+ ],
15
+ "properties": {
16
+ "docid": {
17
+ "type": "string",
18
+ "description": "Document ID",
19
+ "pattern": "^#[a-f0-9]{6,8}$"
20
+ },
21
+ "uri": {
22
+ "type": "string",
23
+ "description": "Document URI",
24
+ "pattern": "^gno://[^/]+/.+"
25
+ },
26
+ "title": {
27
+ "type": "string",
28
+ "description": "Extracted document title"
29
+ },
30
+ "content": {
31
+ "type": "string",
32
+ "description": "Mirror content (Markdown)"
33
+ },
34
+ "totalLines": {
35
+ "type": "integer",
36
+ "description": "Total lines in document",
37
+ "minimum": 0
38
+ },
39
+ "returnedLines": {
40
+ "type": "object",
41
+ "description": "Line range returned (if partial)",
42
+ "properties": {
43
+ "start": {
44
+ "type": "integer",
45
+ "minimum": 1
46
+ },
47
+ "end": {
48
+ "type": "integer",
49
+ "minimum": 1
50
+ }
51
+ },
52
+ "required": ["start", "end"]
53
+ },
54
+ "language": {
55
+ "type": "string",
56
+ "description": "Document language hint (BCP-47)"
57
+ },
58
+ "source": {
59
+ "type": "object",
60
+ "description": "Source file metadata",
61
+ "required": ["relPath", "mime", "ext"],
62
+ "properties": {
63
+ "absPath": {
64
+ "type": "string",
65
+ "description": "Absolute path to source file"
66
+ },
67
+ "relPath": {
68
+ "type": "string",
69
+ "description": "Path relative to collection root"
70
+ },
71
+ "mime": {
72
+ "type": "string",
73
+ "description": "MIME type of source file"
74
+ },
75
+ "ext": {
76
+ "type": "string",
77
+ "description": "File extension",
78
+ "pattern": "^\\.[a-zA-Z0-9]+$"
79
+ },
80
+ "modifiedAt": {
81
+ "type": "string",
82
+ "description": "Last modification time (ISO 8601)",
83
+ "format": "date-time"
84
+ },
85
+ "sizeBytes": {
86
+ "type": "integer",
87
+ "description": "File size in bytes",
88
+ "minimum": 0
89
+ },
90
+ "sourceHash": {
91
+ "type": "string",
92
+ "description": "SHA-256 hash of source file"
93
+ }
94
+ }
95
+ },
96
+ "conversion": {
97
+ "type": "object",
98
+ "description": "Conversion metadata",
99
+ "properties": {
100
+ "converterId": {
101
+ "type": "string"
102
+ },
103
+ "converterVersion": {
104
+ "type": "string"
105
+ },
106
+ "mirrorHash": {
107
+ "type": "string"
108
+ }
109
+ }
110
+ },
111
+ "capabilities": {
112
+ "type": "object",
113
+ "required": [
114
+ "editable",
115
+ "tagsEditable",
116
+ "tagsWriteback",
117
+ "canCreateEditableCopy",
118
+ "mode"
119
+ ],
120
+ "properties": {
121
+ "editable": { "type": "boolean" },
122
+ "tagsEditable": { "type": "boolean" },
123
+ "tagsWriteback": { "type": "boolean" },
124
+ "canCreateEditableCopy": { "type": "boolean" },
125
+ "mode": {
126
+ "type": "string",
127
+ "enum": ["editable", "read_only"]
128
+ },
129
+ "reason": { "type": "string" }
130
+ }
131
+ },
132
+ "tags": {
133
+ "type": "array",
134
+ "description": "Tags associated with the document",
135
+ "items": {
136
+ "type": "string"
137
+ }
138
+ }
139
+ }
140
+ }
@@ -0,0 +1,99 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/graph-query@1.0",
4
+ "title": "GNO Graph Query",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "root", "nodes", "edges", "meta"],
7
+ "properties": {
8
+ "schemaVersion": { "type": "string", "const": "1.0" },
9
+ "root": { "$ref": "#/definitions/node" },
10
+ "nodes": {
11
+ "type": "array",
12
+ "items": { "$ref": "#/definitions/node" }
13
+ },
14
+ "edges": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "object",
18
+ "required": [
19
+ "source",
20
+ "target",
21
+ "edgeType",
22
+ "relationType",
23
+ "confidence",
24
+ "edgeSource",
25
+ "depth"
26
+ ],
27
+ "properties": {
28
+ "source": { "type": "string", "pattern": "^#[a-f0-9]{6,}$" },
29
+ "target": { "type": "string", "pattern": "^#[a-f0-9]{6,}$" },
30
+ "edgeType": { "type": "string", "minLength": 1 },
31
+ "relationType": { "type": "string", "minLength": 1 },
32
+ "confidence": {
33
+ "type": "string",
34
+ "enum": ["parsed", "configured", "manual", "inferred"]
35
+ },
36
+ "edgeSource": {
37
+ "type": "string",
38
+ "enum": ["wikilink", "markdown-link", "frontmatter-relation"]
39
+ },
40
+ "depth": { "type": "integer", "minimum": 1 }
41
+ },
42
+ "additionalProperties": false
43
+ }
44
+ },
45
+ "meta": {
46
+ "type": "object",
47
+ "required": [
48
+ "direction",
49
+ "edgeType",
50
+ "maxDepth",
51
+ "maxNodes",
52
+ "frontierLimit",
53
+ "visitedLimit",
54
+ "returnedNodes",
55
+ "returnedEdges",
56
+ "truncated",
57
+ "warnings"
58
+ ],
59
+ "properties": {
60
+ "direction": { "type": "string", "enum": ["out", "in", "both"] },
61
+ "edgeType": { "type": ["string", "null"] },
62
+ "maxDepth": { "type": "integer", "minimum": 1 },
63
+ "maxNodes": { "type": "integer", "minimum": 1 },
64
+ "frontierLimit": { "type": "integer", "minimum": 1 },
65
+ "visitedLimit": { "type": "integer", "minimum": 1 },
66
+ "returnedNodes": { "type": "integer", "minimum": 1 },
67
+ "returnedEdges": { "type": "integer", "minimum": 0 },
68
+ "truncated": { "type": "boolean" },
69
+ "warnings": { "type": "array", "items": { "type": "string" } }
70
+ },
71
+ "additionalProperties": false
72
+ }
73
+ },
74
+ "additionalProperties": false,
75
+ "definitions": {
76
+ "node": {
77
+ "type": "object",
78
+ "required": [
79
+ "id",
80
+ "uri",
81
+ "title",
82
+ "collection",
83
+ "relPath",
84
+ "depth",
85
+ "graphHints"
86
+ ],
87
+ "properties": {
88
+ "id": { "type": "string", "pattern": "^#[a-f0-9]{6,}$" },
89
+ "uri": { "type": "string", "pattern": "^gno://.+" },
90
+ "title": { "type": ["string", "null"] },
91
+ "collection": { "type": "string" },
92
+ "relPath": { "type": "string" },
93
+ "depth": { "type": "integer", "minimum": 0 },
94
+ "graphHints": { "type": "array", "items": { "type": "string" } }
95
+ },
96
+ "additionalProperties": false
97
+ }
98
+ }
99
+ }