@gmickel/gno 1.17.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 (167) hide show
  1. package/README.md +18 -4
  2. package/assets/skill/SKILL.md +44 -1
  3. package/assets/skill/mcp-reference.md +21 -0
  4. package/package.json +3 -2
  5. package/spec/AGENTS.md +83 -0
  6. package/spec/CLAUDE.md +83 -0
  7. package/spec/bench-fixture.schema.json +137 -0
  8. package/spec/cli.md +2894 -0
  9. package/spec/db/schema.sql +442 -0
  10. package/spec/evals-agentic.md +510 -0
  11. package/spec/evals.md +1106 -0
  12. package/spec/mcp.md +2229 -0
  13. package/spec/output-schemas/activation-verification.schema.json +515 -0
  14. package/spec/output-schemas/ask.schema.json +366 -0
  15. package/spec/output-schemas/backlinks.schema.json +131 -0
  16. package/spec/output-schemas/bench-result.schema.json +120 -0
  17. package/spec/output-schemas/capture-receipt.schema.json +143 -0
  18. package/spec/output-schemas/collection-list.schema.json +45 -0
  19. package/spec/output-schemas/context-capsule-v1.schema.json +691 -0
  20. package/spec/output-schemas/context-capsule-verification.schema.json +1338 -0
  21. package/spec/output-schemas/context-list.schema.json +21 -0
  22. package/spec/output-schemas/doctor.schema.json +313 -0
  23. package/spec/output-schemas/error.schema.json +30 -0
  24. package/spec/output-schemas/expansion.schema.json +37 -0
  25. package/spec/output-schemas/get.schema.json +140 -0
  26. package/spec/output-schemas/graph-query.schema.json +99 -0
  27. package/spec/output-schemas/graph.schema.json +371 -0
  28. package/spec/output-schemas/links-list.schema.json +186 -0
  29. package/spec/output-schemas/mcp-add-collection-result.schema.json +23 -0
  30. package/spec/output-schemas/mcp-capture-result.schema.json +152 -0
  31. package/spec/output-schemas/mcp-http-error.schema.json +30 -0
  32. package/spec/output-schemas/mcp-job-list.schema.json +58 -0
  33. package/spec/output-schemas/mcp-job-status.schema.json +224 -0
  34. package/spec/output-schemas/mcp-remove-result.schema.json +39 -0
  35. package/spec/output-schemas/mcp-sync-result.schema.json +41 -0
  36. package/spec/output-schemas/mcp-tag-result.schema.json +33 -0
  37. package/spec/output-schemas/models-list.schema.json +93 -0
  38. package/spec/output-schemas/multi-get.schema.json +103 -0
  39. package/spec/output-schemas/process-status.schema.json +119 -0
  40. package/spec/output-schemas/query-diagnose.schema.json +123 -0
  41. package/spec/output-schemas/resident-status.schema.json +154 -0
  42. package/spec/output-schemas/retrieval-trace-common.schema.json +492 -0
  43. package/spec/output-schemas/retrieval-trace-delete.schema.json +16 -0
  44. package/spec/output-schemas/retrieval-trace-export.schema.json +61 -0
  45. package/spec/output-schemas/retrieval-trace-filters.schema.json +139 -0
  46. package/spec/output-schemas/retrieval-trace-judgment.schema.json +15 -0
  47. package/spec/output-schemas/retrieval-trace-list.schema.json +18 -0
  48. package/spec/output-schemas/retrieval-trace-payloads.schema.json +178 -0
  49. package/spec/output-schemas/retrieval-trace-purge.schema.json +31 -0
  50. package/spec/output-schemas/retrieval-trace-qrels.schema.json +303 -0
  51. package/spec/output-schemas/retrieval-trace-replay.schema.json +286 -0
  52. package/spec/output-schemas/retrieval-trace-show.schema.json +69 -0
  53. package/spec/output-schemas/retrieval-trace-summary.schema.json +65 -0
  54. package/spec/output-schemas/search-result.schema.json +154 -0
  55. package/spec/output-schemas/search-results.schema.json +338 -0
  56. package/spec/output-schemas/similar.schema.json +84 -0
  57. package/spec/output-schemas/status.schema.json +676 -0
  58. package/spec/output-schemas/tags-list.schema.json +48 -0
  59. package/src/app/context-runtime-types.ts +3 -0
  60. package/src/app/context-runtime.ts +15 -1
  61. package/src/cli/commands/ask.ts +106 -36
  62. package/src/cli/commands/context-build.ts +56 -9
  63. package/src/cli/commands/daemon.ts +69 -2
  64. package/src/cli/commands/get.ts +64 -3
  65. package/src/cli/commands/models/pull.ts +13 -3
  66. package/src/cli/commands/query.ts +62 -23
  67. package/src/cli/commands/replay.ts +140 -0
  68. package/src/cli/commands/search.ts +48 -3
  69. package/src/cli/commands/shared.ts +3 -1
  70. package/src/cli/commands/status.ts +2 -0
  71. package/src/cli/commands/trace.ts +200 -0
  72. package/src/cli/commands/vsearch.ts +75 -53
  73. package/src/cli/detach.ts +37 -20
  74. package/src/cli/program.ts +329 -27
  75. package/src/config/index.ts +12 -0
  76. package/src/config/retrieval-traces.ts +56 -0
  77. package/src/config/types.ts +41 -0
  78. package/src/core/context-compiler.ts +11 -4
  79. package/src/core/job-manager.ts +19 -0
  80. package/src/core/mutation-generations.ts +33 -0
  81. package/src/core/retrieval-qrels.ts +405 -0
  82. package/src/core/retrieval-replay-candidate.ts +368 -0
  83. package/src/core/retrieval-replay-types.ts +109 -0
  84. package/src/core/retrieval-replay-validation.ts +89 -0
  85. package/src/core/retrieval-replay.ts +441 -0
  86. package/src/core/retrieval-trace-evidence-origin.ts +175 -0
  87. package/src/core/retrieval-trace-export.ts +113 -0
  88. package/src/core/retrieval-trace-filter-normalization.ts +27 -0
  89. package/src/core/retrieval-trace-filters.ts +19 -0
  90. package/src/core/retrieval-trace-management-helpers.ts +247 -0
  91. package/src/core/retrieval-trace-management-types.ts +132 -0
  92. package/src/core/retrieval-trace-management.ts +422 -0
  93. package/src/core/retrieval-trace-request.ts +141 -0
  94. package/src/core/retrieval-trace-session.ts +494 -0
  95. package/src/core/retrieval-trace.ts +472 -0
  96. package/src/llm/cache.ts +13 -3
  97. package/src/llm/nodeLlamaCpp/adapter.ts +10 -1
  98. package/src/llm/nodeLlamaCpp/lifecycle.ts +71 -0
  99. package/src/mcp/context.ts +161 -0
  100. package/src/mcp/http-security.ts +477 -0
  101. package/src/mcp/http-session.ts +272 -0
  102. package/src/mcp/http-transport.ts +370 -0
  103. package/src/mcp/resources/index.ts +141 -134
  104. package/src/mcp/server.ts +19 -79
  105. package/src/mcp/tools/add-collection.ts +3 -1
  106. package/src/mcp/tools/capture.ts +3 -0
  107. package/src/mcp/tools/clear-collection-embeddings.ts +2 -0
  108. package/src/mcp/tools/context.ts +68 -16
  109. package/src/mcp/tools/embed.ts +62 -52
  110. package/src/mcp/tools/get.ts +35 -1
  111. package/src/mcp/tools/index-cmd.ts +88 -74
  112. package/src/mcp/tools/index.ts +96 -2
  113. package/src/mcp/tools/query.ts +95 -64
  114. package/src/mcp/tools/remove-collection.ts +2 -0
  115. package/src/mcp/tools/search.ts +36 -13
  116. package/src/mcp/tools/status.ts +11 -0
  117. package/src/mcp/tools/sync.ts +16 -14
  118. package/src/mcp/tools/trace.ts +143 -0
  119. package/src/mcp/tools/vsearch.ts +71 -38
  120. package/src/mcp/tools/workspace-write.ts +7 -3
  121. package/src/pipeline/answer.ts +167 -26
  122. package/src/pipeline/graph-retrieval.ts +15 -1
  123. package/src/pipeline/hybrid.ts +151 -43
  124. package/src/pipeline/search.ts +36 -3
  125. package/src/pipeline/trace-metadata.ts +47 -0
  126. package/src/pipeline/types.ts +43 -0
  127. package/src/pipeline/vsearch.ts +101 -38
  128. package/src/sdk/client.ts +380 -71
  129. package/src/sdk/documents.ts +48 -1
  130. package/src/sdk/index.ts +17 -0
  131. package/src/sdk/types.ts +28 -0
  132. package/src/serve/background-runtime.ts +12 -212
  133. package/src/serve/context-capsule.ts +67 -8
  134. package/src/serve/embed-scheduler.ts +74 -43
  135. package/src/serve/index.ts +9 -0
  136. package/src/serve/jobs.ts +78 -80
  137. package/src/serve/public/app.tsx +12 -1
  138. package/src/serve/public/components/HealthCenter.tsx +74 -1
  139. package/src/serve/public/globals.built.css +1 -1
  140. package/src/serve/public/lib/workspace-tabs.ts +2 -0
  141. package/src/serve/public/pages/Dashboard.tsx +11 -0
  142. package/src/serve/public/pages/TraceHistory.tsx +478 -0
  143. package/src/serve/public/pages/trace-history-detail.tsx +224 -0
  144. package/src/serve/resident-admission.ts +159 -0
  145. package/src/serve/resident-background-work.ts +39 -0
  146. package/src/serve/resident-request.ts +55 -0
  147. package/src/serve/resident-runtime.ts +490 -0
  148. package/src/serve/resident-status.ts +96 -0
  149. package/src/serve/retrieval-trace.ts +28 -0
  150. package/src/serve/routes/api.ts +629 -239
  151. package/src/serve/routes/mcp.ts +69 -0
  152. package/src/serve/routes/traces.ts +156 -0
  153. package/src/serve/server.ts +276 -37
  154. package/src/serve/status-model.ts +51 -0
  155. package/src/serve/status.ts +5 -0
  156. package/src/store/index.ts +31 -0
  157. package/src/store/migrations/014-retrieval-traces.ts +303 -0
  158. package/src/store/migrations/index.ts +2 -0
  159. package/src/store/retrieval-trace-codec.ts +384 -0
  160. package/src/store/sqlite/adapter.ts +179 -10
  161. package/src/store/sqlite/retrieval-trace-management-store.ts +341 -0
  162. package/src/store/sqlite/retrieval-trace-retention.ts +349 -0
  163. package/src/store/sqlite/retrieval-trace-rows.ts +267 -0
  164. package/src/store/sqlite/retrieval-trace-store.ts +515 -0
  165. package/src/store/types.ts +297 -0
  166. package/src/store/vector/sqlite-vec.ts +76 -1
  167. package/src/store/vector/types.ts +1 -1
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/retrieval-trace-summary@1.0",
4
+ "title": "GNO Retrieval Trace Summary",
5
+ "definitions": {
6
+ "sha256": {
7
+ "type": "string",
8
+ "pattern": "^[a-f0-9]{64}$"
9
+ },
10
+ "textShape": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["characters", "terms"],
14
+ "properties": {
15
+ "characters": { "type": "integer", "minimum": 0 },
16
+ "terms": { "type": "integer", "minimum": 0 }
17
+ }
18
+ },
19
+ "fingerprints": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["pipeline", "model", "config", "index"],
23
+ "properties": {
24
+ "pipeline": { "$ref": "#/definitions/sha256" },
25
+ "model": { "$ref": "#/definitions/sha256" },
26
+ "config": { "$ref": "#/definitions/sha256" },
27
+ "index": { "$ref": "#/definitions/sha256" }
28
+ }
29
+ }
30
+ },
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": [
34
+ "traceId",
35
+ "schemaVersion",
36
+ "redactionMode",
37
+ "replayCapable",
38
+ "status",
39
+ "queryShape",
40
+ "goalShape",
41
+ "fingerprints",
42
+ "createdAtMs",
43
+ "updatedAtMs",
44
+ "expiresAtMs",
45
+ "byteSize",
46
+ "creationDigest"
47
+ ],
48
+ "properties": {
49
+ "traceId": { "type": "string", "minLength": 1, "maxLength": 128 },
50
+ "schemaVersion": { "const": "1.0" },
51
+ "redactionMode": { "enum": ["metadata", "replay"] },
52
+ "replayCapable": { "type": "boolean" },
53
+ "status": {
54
+ "enum": ["open", "completed", "partial", "failed", "cancelled"]
55
+ },
56
+ "queryShape": { "$ref": "#/definitions/textShape" },
57
+ "goalShape": { "$ref": "#/definitions/textShape" },
58
+ "fingerprints": { "$ref": "#/definitions/fingerprints" },
59
+ "createdAtMs": { "type": "integer", "minimum": 0 },
60
+ "updatedAtMs": { "type": "integer", "minimum": 0 },
61
+ "expiresAtMs": { "type": "integer", "minimum": 0 },
62
+ "byteSize": { "type": "integer", "minimum": 0 },
63
+ "creationDigest": { "$ref": "#/definitions/sha256" }
64
+ }
65
+ }
@@ -0,0 +1,154 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/search-result@1.0",
4
+ "title": "GNO Search Result Item",
5
+ "description": "A single search result from gno search, vsearch, or query commands",
6
+ "type": "object",
7
+ "required": ["docid", "score", "uri", "snippet", "source"],
8
+ "properties": {
9
+ "docid": {
10
+ "type": "string",
11
+ "description": "Document ID (short hash of source)",
12
+ "pattern": "^#[a-f0-9]{6,8}$"
13
+ },
14
+ "score": {
15
+ "type": "number",
16
+ "description": "Relevance score (0-1 normalized)",
17
+ "minimum": 0,
18
+ "maximum": 1
19
+ },
20
+ "uri": {
21
+ "type": "string",
22
+ "description": "Document URI (gno://collection/path, optionally with ?index= for non-default indexes)",
23
+ "pattern": "^gno://[^/]+/.+(\\?index=[^\\s]+)?$"
24
+ },
25
+ "line": {
26
+ "type": "integer",
27
+ "description": "Best matching/source line (1-indexed)",
28
+ "minimum": 1
29
+ },
30
+ "title": {
31
+ "type": "string",
32
+ "description": "Extracted document title (optional)"
33
+ },
34
+ "contentType": {
35
+ "type": "string",
36
+ "description": "Canonical inferred content type"
37
+ },
38
+ "categories": {
39
+ "type": "array",
40
+ "description": "Category filters associated with the document",
41
+ "items": {
42
+ "type": "string"
43
+ }
44
+ },
45
+ "snippetLanguage": {
46
+ "type": "string",
47
+ "description": "Language of snippet content (BCP-47 or 'und')"
48
+ },
49
+ "context": {
50
+ "type": "string",
51
+ "description": "Resolved user-configured retrieval guidance, ordered from global to collection to matching path prefixes"
52
+ },
53
+ "snippet": {
54
+ "type": "string",
55
+ "description": "Matching text snippet from document mirror"
56
+ },
57
+ "snippetRange": {
58
+ "type": "object",
59
+ "description": "Line range of snippet in mirror content",
60
+ "properties": {
61
+ "startLine": {
62
+ "type": "integer",
63
+ "description": "Start line (1-indexed)",
64
+ "minimum": 1
65
+ },
66
+ "endLine": {
67
+ "type": "integer",
68
+ "description": "End line (1-indexed, inclusive)",
69
+ "minimum": 1
70
+ }
71
+ },
72
+ "required": ["startLine", "endLine"]
73
+ },
74
+ "source": {
75
+ "type": "object",
76
+ "description": "Source file metadata",
77
+ "required": ["relPath", "mime", "ext"],
78
+ "properties": {
79
+ "absPath": {
80
+ "type": "string",
81
+ "description": "Absolute path (included with --source or in MCP)"
82
+ },
83
+ "relPath": {
84
+ "type": "string",
85
+ "description": "Path relative to collection root"
86
+ },
87
+ "mime": {
88
+ "type": "string",
89
+ "description": "MIME type of source file"
90
+ },
91
+ "ext": {
92
+ "type": "string",
93
+ "description": "File extension (including dot)",
94
+ "pattern": "^\\.[a-zA-Z0-9]+$"
95
+ },
96
+ "modifiedAt": {
97
+ "type": "string",
98
+ "description": "Last modification time (ISO 8601)",
99
+ "format": "date-time"
100
+ },
101
+ "sizeBytes": {
102
+ "type": "integer",
103
+ "description": "File size in bytes",
104
+ "minimum": 0
105
+ },
106
+ "sourceHash": {
107
+ "type": "string",
108
+ "description": "SHA-256 hash of source file"
109
+ }
110
+ }
111
+ },
112
+ "conversion": {
113
+ "type": "object",
114
+ "description": "Conversion metadata",
115
+ "properties": {
116
+ "converterId": {
117
+ "type": "string",
118
+ "description": "Converter identifier (e.g., 'adapter/markitdown-js')"
119
+ },
120
+ "converterVersion": {
121
+ "type": "string",
122
+ "description": "Converter version"
123
+ },
124
+ "mirrorHash": {
125
+ "type": "string",
126
+ "description": "SHA-256 hash of mirror content"
127
+ },
128
+ "warnings": {
129
+ "type": "array",
130
+ "description": "Conversion warnings",
131
+ "items": {
132
+ "type": "object",
133
+ "properties": {
134
+ "code": {
135
+ "type": "string",
136
+ "enum": [
137
+ "LOSSY",
138
+ "TRUNCATED",
139
+ "PARTIAL",
140
+ "UNSUPPORTED_FEATURE",
141
+ "LOW_CONFIDENCE"
142
+ ]
143
+ },
144
+ "message": {
145
+ "type": "string"
146
+ }
147
+ },
148
+ "required": ["code", "message"]
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
@@ -0,0 +1,338 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/search-results@1.0",
4
+ "title": "GNO Search Results",
5
+ "description": "Array of search results with metadata",
6
+ "type": "object",
7
+ "required": ["results", "meta"],
8
+ "$defs": {
9
+ "searchResult": {
10
+ "type": "object",
11
+ "required": ["docid", "score", "uri", "snippet", "source"],
12
+ "properties": {
13
+ "docid": {
14
+ "type": "string",
15
+ "description": "Document ID (short hash of source)",
16
+ "pattern": "^#[a-f0-9]{6,8}$"
17
+ },
18
+ "score": {
19
+ "type": "number",
20
+ "description": "Relevance score (0-1 normalized)",
21
+ "minimum": 0,
22
+ "maximum": 1
23
+ },
24
+ "uri": {
25
+ "type": "string",
26
+ "description": "Document URI (gno://collection/path, optionally with ?index= for non-default indexes)",
27
+ "pattern": "^gno://[^/]+/.+(\\?index=[^\\s]+)?$"
28
+ },
29
+ "line": {
30
+ "type": "integer",
31
+ "description": "Best matching/source line (1-indexed)",
32
+ "minimum": 1
33
+ },
34
+ "title": {
35
+ "type": "string",
36
+ "description": "Extracted document title (optional)"
37
+ },
38
+ "contentType": {
39
+ "type": "string",
40
+ "description": "Canonical inferred content type"
41
+ },
42
+ "categories": {
43
+ "type": "array",
44
+ "description": "Category filters associated with the document",
45
+ "items": {
46
+ "type": "string"
47
+ }
48
+ },
49
+ "snippetLanguage": {
50
+ "type": "string",
51
+ "description": "Language of snippet content (BCP-47 or 'und')"
52
+ },
53
+ "context": {
54
+ "type": "string",
55
+ "description": "Resolved user-configured retrieval guidance, ordered from global to collection to matching path prefixes"
56
+ },
57
+ "snippet": {
58
+ "type": "string",
59
+ "description": "Matching text snippet from document mirror"
60
+ },
61
+ "snippetRange": {
62
+ "type": "object",
63
+ "description": "Line range of snippet in mirror content",
64
+ "properties": {
65
+ "startLine": {
66
+ "type": "integer",
67
+ "description": "Start line (1-indexed)",
68
+ "minimum": 1
69
+ },
70
+ "endLine": {
71
+ "type": "integer",
72
+ "description": "End line (1-indexed, inclusive)",
73
+ "minimum": 1
74
+ }
75
+ },
76
+ "required": ["startLine", "endLine"]
77
+ },
78
+ "source": {
79
+ "type": "object",
80
+ "description": "Source file metadata",
81
+ "required": ["relPath", "mime", "ext"],
82
+ "properties": {
83
+ "absPath": {
84
+ "type": "string",
85
+ "description": "Absolute path (included with --source or in MCP)"
86
+ },
87
+ "relPath": {
88
+ "type": "string",
89
+ "description": "Path relative to collection root"
90
+ },
91
+ "mime": {
92
+ "type": "string",
93
+ "description": "MIME type of source file"
94
+ },
95
+ "ext": {
96
+ "type": "string",
97
+ "description": "File extension (including dot)",
98
+ "pattern": "^\\.[a-zA-Z0-9]+$"
99
+ },
100
+ "modifiedAt": {
101
+ "type": "string",
102
+ "description": "Last modification time (ISO 8601)",
103
+ "format": "date-time"
104
+ },
105
+ "documentDate": {
106
+ "type": "string",
107
+ "description": "Canonical frontmatter document date (ISO 8601)",
108
+ "format": "date-time"
109
+ },
110
+ "sizeBytes": {
111
+ "type": "integer",
112
+ "description": "File size in bytes",
113
+ "minimum": 0
114
+ },
115
+ "sourceHash": {
116
+ "type": "string",
117
+ "description": "SHA-256 hash of source file"
118
+ }
119
+ }
120
+ },
121
+ "conversion": {
122
+ "type": "object",
123
+ "description": "Conversion metadata",
124
+ "properties": {
125
+ "converterId": {
126
+ "type": "string",
127
+ "description": "Converter identifier (e.g., 'adapter/markitdown-js')"
128
+ },
129
+ "converterVersion": {
130
+ "type": "string",
131
+ "description": "Converter version"
132
+ },
133
+ "mirrorHash": {
134
+ "type": "string",
135
+ "description": "SHA-256 hash of mirror content"
136
+ },
137
+ "warnings": {
138
+ "type": "array",
139
+ "description": "Conversion warnings",
140
+ "items": {
141
+ "type": "object",
142
+ "properties": {
143
+ "code": {
144
+ "type": "string",
145
+ "enum": [
146
+ "LOSSY",
147
+ "TRUNCATED",
148
+ "PARTIAL",
149
+ "UNSUPPORTED_FEATURE",
150
+ "LOW_CONFIDENCE"
151
+ ]
152
+ },
153
+ "message": {
154
+ "type": "string"
155
+ }
156
+ },
157
+ "required": ["code", "message"]
158
+ }
159
+ }
160
+ }
161
+ },
162
+ "tags": {
163
+ "type": "array",
164
+ "description": "Tags associated with the document",
165
+ "items": {
166
+ "type": "string"
167
+ }
168
+ }
169
+ }
170
+ }
171
+ },
172
+ "properties": {
173
+ "results": {
174
+ "type": "array",
175
+ "description": "Array of search result items",
176
+ "items": {
177
+ "$ref": "#/$defs/searchResult"
178
+ }
179
+ },
180
+ "meta": {
181
+ "type": "object",
182
+ "description": "Search metadata",
183
+ "required": ["query", "mode", "totalResults"],
184
+ "properties": {
185
+ "query": {
186
+ "type": "string",
187
+ "description": "Original search query"
188
+ },
189
+ "mode": {
190
+ "type": "string",
191
+ "description": "Search mode used",
192
+ "enum": ["bm25", "vector", "hybrid", "bm25_only"]
193
+ },
194
+ "expanded": {
195
+ "type": "boolean",
196
+ "description": "Whether query expansion was used"
197
+ },
198
+ "reranked": {
199
+ "type": "boolean",
200
+ "description": "Whether reranking was applied"
201
+ },
202
+ "vectorsUsed": {
203
+ "type": "boolean",
204
+ "description": "Whether vector search was used"
205
+ },
206
+ "totalResults": {
207
+ "type": "integer",
208
+ "description": "Total number of results returned",
209
+ "minimum": 0
210
+ },
211
+ "collection": {
212
+ "type": "string",
213
+ "description": "Collection filter if applied"
214
+ },
215
+ "intent": {
216
+ "type": "string",
217
+ "description": "Disambiguating context used to steer retrieval without being searched directly"
218
+ },
219
+ "lang": {
220
+ "type": "string",
221
+ "description": "Language filter/hint if applied"
222
+ },
223
+ "since": {
224
+ "type": "string",
225
+ "description": "Temporal lower bound applied (ISO 8601)",
226
+ "format": "date-time"
227
+ },
228
+ "until": {
229
+ "type": "string",
230
+ "description": "Temporal upper bound applied (ISO 8601)",
231
+ "format": "date-time"
232
+ },
233
+ "categories": {
234
+ "type": "array",
235
+ "description": "Category/content-type filters applied (if any)",
236
+ "items": { "type": "string" }
237
+ },
238
+ "author": {
239
+ "type": "string",
240
+ "description": "Author filter applied (if any)"
241
+ },
242
+ "candidateLimit": {
243
+ "type": "integer",
244
+ "description": "Max candidates sent to reranking (if applicable)",
245
+ "minimum": 1
246
+ },
247
+ "graphExpansion": {
248
+ "type": "object",
249
+ "description": "Bounded one-hop graph retrieval expansion summary",
250
+ "required": [
251
+ "enabled",
252
+ "seedCount",
253
+ "candidateCount",
254
+ "maxCandidates",
255
+ "edgeConfidence",
256
+ "fallbackReasons"
257
+ ],
258
+ "properties": {
259
+ "enabled": {
260
+ "type": "boolean",
261
+ "description": "Whether graph expansion added candidates"
262
+ },
263
+ "seedCount": {
264
+ "type": "integer",
265
+ "minimum": 0,
266
+ "description": "Number of top retrieval seeds used for graph expansion"
267
+ },
268
+ "candidateCount": {
269
+ "type": "integer",
270
+ "minimum": 0,
271
+ "description": "Number of graph neighbors added to the candidate set"
272
+ },
273
+ "maxCandidates": {
274
+ "type": "integer",
275
+ "minimum": 1,
276
+ "description": "Graph candidate cap applied"
277
+ },
278
+ "edgeConfidence": {
279
+ "type": "object",
280
+ "required": ["explicit", "inferred", "ambiguous", "similarity"],
281
+ "properties": {
282
+ "explicit": { "type": "integer", "minimum": 0 },
283
+ "inferred": { "type": "integer", "minimum": 0 },
284
+ "ambiguous": { "type": "integer", "minimum": 0 },
285
+ "similarity": { "type": "integer", "minimum": 0 }
286
+ }
287
+ },
288
+ "fallbackReasons": {
289
+ "type": "array",
290
+ "items": { "type": "string" },
291
+ "description": "Reasons graph expansion did not add candidates, if any"
292
+ }
293
+ }
294
+ },
295
+ "exclude": {
296
+ "type": "array",
297
+ "description": "Explicit exclusion terms applied",
298
+ "items": { "type": "string" }
299
+ },
300
+ "queryLanguage": {
301
+ "type": "string",
302
+ "description": "Detected or overridden query language for prompt selection (typically BCP-47)"
303
+ },
304
+ "queryModes": {
305
+ "type": "object",
306
+ "description": "Summary of structured query modes applied",
307
+ "required": ["term", "intent", "hyde"],
308
+ "properties": {
309
+ "term": {
310
+ "type": "integer",
311
+ "minimum": 0,
312
+ "description": "Number of term mode entries"
313
+ },
314
+ "intent": {
315
+ "type": "integer",
316
+ "minimum": 0,
317
+ "description": "Number of intent mode entries"
318
+ },
319
+ "hyde": {
320
+ "type": "boolean",
321
+ "description": "Whether a hyde entry was provided"
322
+ }
323
+ }
324
+ },
325
+ "tagsAll": {
326
+ "type": "array",
327
+ "items": { "type": "string" },
328
+ "description": "Tags ALL filter applied (if any)"
329
+ },
330
+ "tagsAny": {
331
+ "type": "array",
332
+ "items": { "type": "string" },
333
+ "description": "Tags ANY filter applied (if any)"
334
+ }
335
+ }
336
+ }
337
+ }
338
+ }
@@ -0,0 +1,84 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "gno://schemas/similar@1.0",
4
+ "title": "GNO Similar Documents",
5
+ "description": "List of semantically similar documents",
6
+ "type": "object",
7
+ "required": ["similar", "meta"],
8
+ "properties": {
9
+ "similar": {
10
+ "type": "array",
11
+ "description": "List of similar documents ordered by similarity score",
12
+ "items": {
13
+ "type": "object",
14
+ "required": ["docid", "uri", "score"],
15
+ "properties": {
16
+ "docid": {
17
+ "type": "string",
18
+ "description": "Document ID"
19
+ },
20
+ "uri": {
21
+ "type": "string",
22
+ "description": "Document URI"
23
+ },
24
+ "title": {
25
+ "type": "string",
26
+ "description": "Document title"
27
+ },
28
+ "score": {
29
+ "type": "number",
30
+ "description": "Similarity score (0-1, higher is more similar)",
31
+ "minimum": 0,
32
+ "maximum": 1
33
+ },
34
+ "collection": {
35
+ "type": "string",
36
+ "description": "Document collection"
37
+ },
38
+ "relPath": {
39
+ "type": "string",
40
+ "description": "Relative path within collection"
41
+ }
42
+ }
43
+ }
44
+ },
45
+ "meta": {
46
+ "type": "object",
47
+ "required": ["docid", "totalResults"],
48
+ "properties": {
49
+ "docid": {
50
+ "type": "string",
51
+ "description": "Source document ID"
52
+ },
53
+ "uri": {
54
+ "type": "string",
55
+ "description": "Source document URI"
56
+ },
57
+ "title": {
58
+ "type": "string",
59
+ "description": "Source document title"
60
+ },
61
+ "totalResults": {
62
+ "type": "integer",
63
+ "description": "Number of similar documents returned",
64
+ "minimum": 0
65
+ },
66
+ "limit": {
67
+ "type": "integer",
68
+ "description": "Maximum results requested",
69
+ "minimum": 1
70
+ },
71
+ "threshold": {
72
+ "type": "number",
73
+ "description": "Minimum similarity threshold used",
74
+ "minimum": 0,
75
+ "maximum": 1
76
+ },
77
+ "crossCollection": {
78
+ "type": "boolean",
79
+ "description": "Whether cross-collection search was enabled"
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }