@gmickel/gno 1.27.1 → 1.29.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 (195) hide show
  1. package/README.md +46 -20
  2. package/assets/skill/SKILL.md +59 -1
  3. package/browser-extension/artifacts/gno-browser-clipper-v1.29.0.zip +0 -0
  4. package/browser-extension/artifacts/gno-browser-clipper-v1.29.0.zip.sha256 +1 -0
  5. package/browser-extension/dist/chunk-b2zm0jjd.js +50 -0
  6. package/browser-extension/dist/manifest.json +1 -1
  7. package/browser-extension/dist/preview.html +1 -1
  8. package/browser-extension/dist/service-worker.js +6 -6
  9. package/package.json +2 -2
  10. package/spec/cli.md +82 -5
  11. package/spec/db/schema.sql +31 -0
  12. package/spec/mcp.md +71 -0
  13. package/spec/output-schemas/ask.schema.json +156 -1
  14. package/spec/output-schemas/browser-clip-preview.schema.json +30 -0
  15. package/spec/output-schemas/collection-egress-check.schema.json +91 -0
  16. package/spec/output-schemas/collection-egress-policy-set.schema.json +56 -0
  17. package/spec/output-schemas/collection-egress-policy.schema.json +41 -0
  18. package/spec/output-schemas/context-capsule-v1.schema.json +183 -3
  19. package/spec/output-schemas/context-capsule-verification.schema.json +1 -1
  20. package/spec/output-schemas/egress-audit-management.schema.json +88 -0
  21. package/spec/output-schemas/get.schema.json +94 -0
  22. package/spec/output-schemas/mcp-http-error.schema.json +113 -2
  23. package/spec/output-schemas/mcp-job-status.schema.json +28 -0
  24. package/spec/output-schemas/multi-get.schema.json +128 -0
  25. package/spec/output-schemas/publish-artifact.schema.json +32 -0
  26. package/spec/output-schemas/record-import.schema.json +223 -0
  27. package/spec/output-schemas/retrieval-trace-common.schema.json +31 -0
  28. package/spec/output-schemas/retrieval-trace-export.schema.json +3 -0
  29. package/spec/output-schemas/retrieval-trace-qrels.schema.json +3 -0
  30. package/spec/output-schemas/retrieval-trace-summary.schema.json +4 -0
  31. package/spec/output-schemas/search-result.schema.json +94 -0
  32. package/spec/output-schemas/search-results.schema.json +155 -0
  33. package/spec/project-profile.schema.json +66 -0
  34. package/src/app/context-format.ts +1 -1
  35. package/src/app/context-runtime-contract.ts +16 -7
  36. package/src/cli/commands/ask.ts +7 -0
  37. package/src/cli/commands/collection/index.ts +5 -0
  38. package/src/cli/commands/collection/policy.ts +126 -0
  39. package/src/cli/commands/context-build.ts +5 -0
  40. package/src/cli/commands/daemon.ts +45 -3
  41. package/src/cli/commands/egress-audit.ts +68 -0
  42. package/src/cli/commands/embed.ts +2 -0
  43. package/src/cli/commands/get.ts +12 -2
  44. package/src/cli/commands/index-cmd.ts +13 -0
  45. package/src/cli/commands/multi-get.ts +9 -2
  46. package/src/cli/commands/query.ts +12 -0
  47. package/src/cli/commands/replay.ts +13 -3
  48. package/src/cli/commands/shared.ts +28 -0
  49. package/src/cli/commands/update.ts +5 -0
  50. package/src/cli/commands/vsearch.ts +3 -1
  51. package/src/cli/program.ts +127 -0
  52. package/src/config/index.ts +9 -0
  53. package/src/config/project-profile.ts +2 -0
  54. package/src/config/types.ts +66 -0
  55. package/src/converters/adapters/browser-export/adapter.ts +199 -0
  56. package/src/converters/adapters/browser-export/formats.ts +358 -0
  57. package/src/converters/adapters/email/adapter.ts +429 -0
  58. package/src/converters/adapters/email/html.ts +162 -0
  59. package/src/converters/adapters/email/mime.ts +454 -0
  60. package/src/converters/adapters/email/parameters.ts +77 -0
  61. package/src/converters/adapters/ical/adapter.ts +475 -0
  62. package/src/converters/adapters/ical/recurrence.ts +186 -0
  63. package/src/converters/adapters/jsonl/adapter.ts +238 -0
  64. package/src/converters/adapters/jsonl/config.ts +105 -0
  65. package/src/converters/adapters/shared/html-text.ts +165 -0
  66. package/src/converters/adapters/shared/record-utils.ts +79 -0
  67. package/src/converters/adapters/shared/utf8-lines.ts +141 -0
  68. package/src/converters/adapters/transcript/adapter.ts +295 -0
  69. package/src/converters/adapters/transcript/json.ts +184 -0
  70. package/src/converters/adapters/transcript/model.ts +171 -0
  71. package/src/converters/adapters/transcript/text.ts +58 -0
  72. package/src/converters/adapters/transcript/timed.ts +152 -0
  73. package/src/converters/index.ts +11 -1
  74. package/src/converters/mime.ts +8 -0
  75. package/src/converters/pipeline.ts +15 -1
  76. package/src/converters/registry.ts +37 -1
  77. package/src/converters/types.ts +136 -0
  78. package/src/core/browser-clip.ts +16 -1
  79. package/src/core/collection-egress-policy-projection.ts +28 -0
  80. package/src/core/collection-egress-policy-service.ts +443 -0
  81. package/src/core/collection-egress-policy-validation.ts +242 -0
  82. package/src/core/config-mutation.ts +31 -19
  83. package/src/core/context-capsule-schema.ts +198 -1
  84. package/src/core/context-capsule-validation.ts +4 -4
  85. package/src/core/context-capsule-verification.ts +5 -1
  86. package/src/core/context-capsule.ts +177 -112
  87. package/src/core/context-evidence.ts +93 -15
  88. package/src/core/destination-classifier.ts +402 -0
  89. package/src/core/document-capabilities.ts +12 -0
  90. package/src/core/egress-audit.ts +239 -0
  91. package/src/core/egress-authorization.ts +50 -0
  92. package/src/core/egress-enforcement.ts +264 -0
  93. package/src/core/egress-policy.ts +440 -0
  94. package/src/core/egress-provenance.ts +336 -0
  95. package/src/core/job-manager.ts +37 -0
  96. package/src/core/network-boundary-inventory.ts +261 -0
  97. package/src/core/project-profile-apply-state.ts +5 -0
  98. package/src/core/project-profile.ts +4 -0
  99. package/src/core/record-metadata.ts +49 -0
  100. package/src/core/retrieval-qrels.ts +6 -0
  101. package/src/core/retrieval-replay.ts +18 -4
  102. package/src/core/retrieval-trace-export.ts +23 -4
  103. package/src/core/retrieval-trace-management-helpers.ts +1 -0
  104. package/src/core/retrieval-trace-management-types.ts +3 -0
  105. package/src/core/retrieval-trace-management.ts +9 -1
  106. package/src/core/retrieval-trace-session.ts +94 -0
  107. package/src/core/retrieval-trace.ts +22 -0
  108. package/src/ingestion/record-adapter-canonical.ts +433 -0
  109. package/src/ingestion/record-adapter.ts +448 -0
  110. package/src/ingestion/record-container.ts +704 -0
  111. package/src/ingestion/record-path.ts +20 -0
  112. package/src/ingestion/record-sync.ts +70 -0
  113. package/src/ingestion/sync.ts +243 -36
  114. package/src/ingestion/types.ts +71 -1
  115. package/src/ingestion/walker.ts +31 -11
  116. package/src/llm/errors.ts +10 -0
  117. package/src/llm/http-inference.ts +175 -0
  118. package/src/llm/http-policy.ts +537 -0
  119. package/src/llm/httpEmbedding.ts +47 -28
  120. package/src/llm/httpGeneration.ts +31 -18
  121. package/src/llm/httpRerank.ts +30 -18
  122. package/src/llm/index.ts +1 -0
  123. package/src/llm/nodeLlamaCpp/adapter.ts +55 -20
  124. package/src/llm/pinned-http-connection.ts +177 -0
  125. package/src/mcp/context.ts +53 -1
  126. package/src/mcp/http-egress.ts +220 -0
  127. package/src/mcp/http-security.ts +32 -21
  128. package/src/mcp/http-session.ts +13 -2
  129. package/src/mcp/http-transport.ts +96 -6
  130. package/src/mcp/sync-egress.ts +24 -0
  131. package/src/mcp/tools/add-collection.ts +4 -0
  132. package/src/mcp/tools/ask.ts +1 -1
  133. package/src/mcp/tools/context.ts +9 -2
  134. package/src/mcp/tools/egress.ts +247 -0
  135. package/src/mcp/tools/embed.ts +1 -0
  136. package/src/mcp/tools/get.ts +10 -2
  137. package/src/mcp/tools/index-cmd.ts +7 -0
  138. package/src/mcp/tools/index.ts +98 -0
  139. package/src/mcp/tools/multi-get.ts +9 -2
  140. package/src/mcp/tools/query.ts +10 -0
  141. package/src/mcp/tools/remove-collection.ts +4 -0
  142. package/src/mcp/tools/sync.ts +6 -0
  143. package/src/mcp/tools/trace.ts +7 -1
  144. package/src/mcp/tools/vsearch.ts +1 -0
  145. package/src/mcp/tools/workspace-write.ts +2 -0
  146. package/src/pipeline/egress-lineage.ts +124 -0
  147. package/src/pipeline/filters.ts +1 -1
  148. package/src/pipeline/graph-retrieval.ts +7 -4
  149. package/src/pipeline/hybrid.ts +21 -4
  150. package/src/pipeline/result-context.ts +12 -4
  151. package/src/pipeline/search.ts +23 -4
  152. package/src/pipeline/types.ts +6 -0
  153. package/src/pipeline/vsearch.ts +67 -28
  154. package/src/publish/artifact.ts +31 -3
  155. package/src/publish/export-service.ts +25 -0
  156. package/src/sdk/client.ts +119 -2
  157. package/src/sdk/documents.ts +13 -5
  158. package/src/sdk/embed.ts +1 -0
  159. package/src/sdk/types.ts +33 -0
  160. package/src/serve/browse-tree.ts +4 -2
  161. package/src/serve/clipper-capture.ts +5 -1
  162. package/src/serve/closed-json.ts +61 -0
  163. package/src/serve/config-sync.ts +4 -1
  164. package/src/serve/context.ts +1 -0
  165. package/src/serve/doc-events.ts +110 -39
  166. package/src/serve/public/components/CollectionEgressCheckPanel.tsx +411 -0
  167. package/src/serve/public/components/CollectionEgressPolicyEditor.tsx +78 -0
  168. package/src/serve/public/components/CollectionModelDialog.tsx +93 -9
  169. package/src/serve/public/components/EgressAuditPanel.tsx +278 -0
  170. package/src/serve/public/globals.built.css +1 -1
  171. package/src/serve/public/pages/Collections.tsx +3 -0
  172. package/src/serve/resident-request.ts +80 -3
  173. package/src/serve/resident-runtime.ts +63 -1
  174. package/src/serve/routes/api.ts +237 -65
  175. package/src/serve/routes/clipper.ts +64 -1
  176. package/src/serve/routes/mcp.ts +6 -0
  177. package/src/serve/routes/traces.ts +27 -4
  178. package/src/serve/server.ts +118 -7
  179. package/src/store/migrations/022-record-export-lineage.ts +42 -0
  180. package/src/store/migrations/023-collection-egress-policy.ts +61 -0
  181. package/src/store/migrations/024-egress-derived-lineage.ts +121 -0
  182. package/src/store/migrations/025-collection-egress-policy-revision.ts +40 -0
  183. package/src/store/migrations/index.ts +8 -0
  184. package/src/store/retrieval-trace-codec.ts +15 -0
  185. package/src/store/sqlite/adapter.ts +284 -14
  186. package/src/store/sqlite/change-journal-store.ts +41 -2
  187. package/src/store/sqlite/egress-audit-store.ts +485 -0
  188. package/src/store/sqlite/retrieval-trace-management-store.ts +47 -6
  189. package/src/store/sqlite/retrieval-trace-retention.ts +2 -0
  190. package/src/store/sqlite/retrieval-trace-rows.ts +8 -1
  191. package/src/store/sqlite/retrieval-trace-store.ts +104 -5
  192. package/src/store/types.ts +166 -1
  193. package/browser-extension/artifacts/gno-browser-clipper-v1.27.1.zip +0 -0
  194. package/browser-extension/artifacts/gno-browser-clipper-v1.27.1.zip.sha256 +0 -1
  195. package/browser-extension/dist/chunk-vn5f663b.js +0 -50
@@ -0,0 +1,56 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://gno.sh/schemas/collection-egress-policy-set.schema.json",
4
+ "title": "Collection egress policy mutation",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "previous",
10
+ "current",
11
+ "change",
12
+ "invalidation"
13
+ ],
14
+ "properties": {
15
+ "schemaVersion": { "const": "1.0" },
16
+ "previous": {
17
+ "$ref": "collection-egress-policy.schema.json"
18
+ },
19
+ "current": {
20
+ "$ref": "collection-egress-policy.schema.json"
21
+ },
22
+ "change": {
23
+ "enum": ["tightened", "relaxed", "source_changed", "unchanged"]
24
+ },
25
+ "invalidation": {
26
+ "oneOf": [
27
+ { "type": "null" },
28
+ {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": [
32
+ "policyEpoch",
33
+ "queuedJobsInvalidated",
34
+ "sessionsInvalidated",
35
+ "staleWorkMustRetry"
36
+ ],
37
+ "properties": {
38
+ "policyEpoch": {
39
+ "type": "string",
40
+ "pattern": "^egress-epoch-v1:[a-f0-9]{64}$"
41
+ },
42
+ "queuedJobsInvalidated": {
43
+ "type": "integer",
44
+ "minimum": 0
45
+ },
46
+ "sessionsInvalidated": {
47
+ "type": "integer",
48
+ "minimum": 0
49
+ },
50
+ "staleWorkMustRetry": { "const": true }
51
+ }
52
+ }
53
+ ]
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://gno.sh/schemas/collection-egress-policy.schema.json",
4
+ "title": "Collection egress policy state",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "collection",
10
+ "configuredPolicy",
11
+ "effectivePolicy",
12
+ "source",
13
+ "revision",
14
+ "version"
15
+ ],
16
+ "properties": {
17
+ "schemaVersion": { "const": "1.0" },
18
+ "collection": {
19
+ "type": "string",
20
+ "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
21
+ },
22
+ "configuredPolicy": {
23
+ "type": ["string", "null"],
24
+ "enum": ["local_only", "lan", "remote", null]
25
+ },
26
+ "effectivePolicy": {
27
+ "enum": ["local_only", "lan", "remote"]
28
+ },
29
+ "source": {
30
+ "enum": ["explicit", "config_default"]
31
+ },
32
+ "revision": {
33
+ "type": "integer",
34
+ "minimum": 0
35
+ },
36
+ "version": {
37
+ "type": "string",
38
+ "pattern": "^egress-policy-v1:[a-f0-9]{64}$"
39
+ }
40
+ }
41
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "gno://schemas/context-capsule-v1@1.0",
3
+ "$id": "gno://schemas/context-capsule-v1@1.1",
4
4
  "title": "GNO Context Capsule V1",
5
5
  "description": "Deterministic, extractive evidence compiled under one canonical JSON budget.",
6
6
  "type": "object",
@@ -25,6 +25,65 @@
25
25
  "capsuleId"
26
26
  ],
27
27
  "allOf": [
28
+ {
29
+ "if": {
30
+ "properties": { "schemaVersion": { "const": "1.1" } },
31
+ "required": ["schemaVersion"]
32
+ },
33
+ "then": {
34
+ "required": ["egressLineage"],
35
+ "properties": {
36
+ "egressLineage": { "$ref": "#/definitions/egressLineage" },
37
+ "evidence": {
38
+ "type": "array",
39
+ "items": {
40
+ "allOf": [
41
+ { "$ref": "#/definitions/evidence" },
42
+ {
43
+ "type": "object",
44
+ "required": ["egressLineage"],
45
+ "properties": {
46
+ "egressLineage": {
47
+ "$ref": "#/definitions/egressLineage"
48
+ }
49
+ }
50
+ }
51
+ ]
52
+ }
53
+ }
54
+ }
55
+ },
56
+ "else": {
57
+ "not": {
58
+ "type": "object",
59
+ "required": ["egressLineage"],
60
+ "properties": {
61
+ "egressLineage": { "$ref": "#/definitions/egressLineage" }
62
+ }
63
+ },
64
+ "properties": {
65
+ "evidence": {
66
+ "type": "array",
67
+ "items": {
68
+ "allOf": [
69
+ { "$ref": "#/definitions/evidence" },
70
+ {
71
+ "not": {
72
+ "type": "object",
73
+ "required": ["egressLineage"],
74
+ "properties": {
75
+ "egressLineage": {
76
+ "$ref": "#/definitions/egressLineage"
77
+ }
78
+ }
79
+ }
80
+ }
81
+ ]
82
+ }
83
+ }
84
+ }
85
+ }
86
+ },
28
87
  {
29
88
  "if": {
30
89
  "properties": {
@@ -84,9 +143,10 @@
84
143
  }
85
144
  ],
86
145
  "properties": {
87
- "schemaVersion": { "const": "1.0" },
146
+ "schemaVersion": { "enum": ["1.0", "1.1"] },
88
147
  "coordinateSpace": { "const": "canonical_mirror" },
89
148
  "capsuleId": { "$ref": "#/definitions/sha256" },
149
+ "egressLineage": { "$ref": "#/definitions/egressLineage" },
90
150
  "goal": { "type": "string", "minLength": 1, "maxLength": 16384 },
91
151
  "query": { "type": "string", "minLength": 1, "maxLength": 16384 },
92
152
  "scope": {
@@ -330,6 +390,98 @@
330
390
  }
331
391
  },
332
392
  "definitions": {
393
+ "recordAnchor": {
394
+ "type": "object",
395
+ "additionalProperties": false,
396
+ "required": ["kind", "value"],
397
+ "properties": {
398
+ "kind": {
399
+ "enum": ["line", "cue", "timestamp", "message", "event", "record"]
400
+ },
401
+ "value": { "type": "string", "minLength": 1, "maxLength": 512 },
402
+ "endValue": { "type": "string", "minLength": 1, "maxLength": 512 }
403
+ }
404
+ },
405
+ "recordAttachment": {
406
+ "type": "object",
407
+ "additionalProperties": false,
408
+ "required": ["name"],
409
+ "properties": {
410
+ "name": { "type": "string", "minLength": 1, "maxLength": 512 },
411
+ "mime": { "type": "string", "minLength": 1, "maxLength": 256 },
412
+ "bytes": {
413
+ "type": "integer",
414
+ "minimum": 0,
415
+ "maximum": 9007199254740991
416
+ },
417
+ "disposition": { "enum": ["inline", "attachment"] },
418
+ "sha256": { "$ref": "#/definitions/sha256" }
419
+ }
420
+ },
421
+ "recordEvidenceMetadata": {
422
+ "type": "object",
423
+ "additionalProperties": false,
424
+ "required": ["recordKey", "sourceLocator", "anchors", "adapter"],
425
+ "properties": {
426
+ "recordKey": { "$ref": "#/definitions/sha256" },
427
+ "sourceLocator": { "type": "string", "minLength": 1, "maxLength": 512 },
428
+ "anchors": {
429
+ "type": "array",
430
+ "maxItems": 256,
431
+ "items": { "$ref": "#/definitions/recordAnchor" }
432
+ },
433
+ "adapter": {
434
+ "type": "object",
435
+ "additionalProperties": false,
436
+ "required": ["id", "version", "fingerprint"],
437
+ "properties": {
438
+ "id": { "type": "string", "minLength": 1, "maxLength": 128 },
439
+ "version": {
440
+ "type": "string",
441
+ "minLength": 1,
442
+ "maxLength": 64
443
+ },
444
+ "fingerprint": { "$ref": "#/definitions/sha256" }
445
+ }
446
+ },
447
+ "author": { "type": "string", "maxLength": 2048 },
448
+ "participants": {
449
+ "type": "array",
450
+ "maxItems": 256,
451
+ "items": { "type": "string", "minLength": 1, "maxLength": 2048 }
452
+ },
453
+ "categories": {
454
+ "type": "array",
455
+ "maxItems": 256,
456
+ "items": { "type": "string", "minLength": 1, "maxLength": 512 }
457
+ },
458
+ "dateFields": {
459
+ "type": "object",
460
+ "maxProperties": 256,
461
+ "propertyNames": { "type": "string", "maxLength": 128 },
462
+ "additionalProperties": {
463
+ "type": "string",
464
+ "minLength": 1,
465
+ "maxLength": 256
466
+ }
467
+ },
468
+ "messageId": { "type": "string", "maxLength": 2048 },
469
+ "inReplyTo": { "type": "string", "maxLength": 2048 },
470
+ "references": {
471
+ "type": "array",
472
+ "maxItems": 256,
473
+ "items": { "type": "string", "minLength": 1, "maxLength": 2048 }
474
+ },
475
+ "threadId": { "type": "string", "maxLength": 2048 },
476
+ "eventId": { "type": "string", "maxLength": 2048 },
477
+ "sessionId": { "type": "string", "maxLength": 2048 },
478
+ "attachments": {
479
+ "type": "array",
480
+ "maxItems": 256,
481
+ "items": { "$ref": "#/definitions/recordAttachment" }
482
+ }
483
+ }
484
+ },
333
485
  "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
334
486
  "nullableSha256": {
335
487
  "oneOf": [{ "$ref": "#/definitions/sha256" }, { "type": "null" }]
@@ -354,6 +506,32 @@
354
506
  "maxLength": 64,
355
507
  "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
356
508
  },
509
+ "egressLineage": {
510
+ "type": "object",
511
+ "additionalProperties": false,
512
+ "required": ["effectivePolicy", "digest", "sources"],
513
+ "properties": {
514
+ "effectivePolicy": { "enum": ["local_only", "lan", "remote"] },
515
+ "digest": { "$ref": "#/definitions/sha256" },
516
+ "sources": {
517
+ "type": "array",
518
+ "minItems": 1,
519
+ "maxItems": 128,
520
+ "items": {
521
+ "type": "object",
522
+ "additionalProperties": false,
523
+ "required": ["collection", "policy", "source"],
524
+ "properties": {
525
+ "collection": { "$ref": "#/definitions/collection" },
526
+ "policy": { "enum": ["local_only", "lan", "remote"] },
527
+ "source": {
528
+ "enum": ["explicit", "config_default", "legacy_default"]
529
+ }
530
+ }
531
+ }
532
+ }
533
+ }
534
+ },
357
535
  "filterValues": {
358
536
  "type": "array",
359
537
  "maxItems": 128,
@@ -577,7 +755,9 @@
577
755
  "trust": { "const": "untrusted" },
578
756
  "egress": {
579
757
  "enum": ["local_only", "lan", "remote", "unclassified", "unavailable"]
580
- }
758
+ },
759
+ "egressLineage": { "$ref": "#/definitions/egressLineage" },
760
+ "record": { "$ref": "#/definitions/recordEvidenceMetadata" }
581
761
  }
582
762
  },
583
763
  "coverage": {
@@ -21,7 +21,7 @@
21
21
  "evidence"
22
22
  ],
23
23
  "properties": {
24
- "schemaVersion": { "const": "1.0" },
24
+ "schemaVersion": { "enum": ["1.0", "1.1"] },
25
25
  "coordinateSpace": { "const": "canonical_mirror" },
26
26
  "capsuleId": { "$ref": "#/definitions/sha256" },
27
27
  "operationStatus": { "const": "completed" },
@@ -0,0 +1,88 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://gno.sh/schemas/egress-audit-management.schema.json",
4
+ "title": "Egress audit management output",
5
+ "oneOf": [
6
+ {
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "required": ["schemaVersion", "receipts", "nextCursor"],
10
+ "properties": {
11
+ "schemaVersion": { "const": "1.0" },
12
+ "receipts": { "type": "array" },
13
+ "nextCursor": { "type": ["string", "null"] }
14
+ }
15
+ },
16
+ {
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "required": ["schemaVersion", "receipt"],
20
+ "properties": {
21
+ "schemaVersion": { "const": "1.0" },
22
+ "receipt": { "type": "object" }
23
+ }
24
+ },
25
+ {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": [
29
+ "schemaVersion",
30
+ "retention",
31
+ "receipts",
32
+ "bytes",
33
+ "oldestCreatedAtMs",
34
+ "newestCreatedAtMs"
35
+ ],
36
+ "properties": {
37
+ "schemaVersion": { "const": "1.0" },
38
+ "retention": { "type": "object" },
39
+ "receipts": { "type": "integer", "minimum": 0 },
40
+ "bytes": { "type": "integer", "minimum": 0 },
41
+ "oldestCreatedAtMs": { "type": ["integer", "null"] },
42
+ "newestCreatedAtMs": { "type": ["integer", "null"] }
43
+ }
44
+ },
45
+ {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": [
49
+ "schemaVersion",
50
+ "auditId",
51
+ "deleted",
52
+ "physicalCleanup",
53
+ "checkpointedFrames",
54
+ "remainingWalFrames"
55
+ ],
56
+ "properties": {
57
+ "schemaVersion": { "const": "1.0" },
58
+ "auditId": { "type": "string" },
59
+ "deleted": { "const": 1 },
60
+ "physicalCleanup": {
61
+ "enum": ["completed", "wal_busy", "failed"]
62
+ },
63
+ "checkpointedFrames": { "type": "integer" },
64
+ "remainingWalFrames": { "type": "integer" }
65
+ }
66
+ },
67
+ {
68
+ "type": "object",
69
+ "additionalProperties": false,
70
+ "required": [
71
+ "schemaVersion",
72
+ "deleted",
73
+ "physicalCleanup",
74
+ "checkpointedFrames",
75
+ "remainingWalFrames"
76
+ ],
77
+ "properties": {
78
+ "schemaVersion": { "const": "1.0" },
79
+ "deleted": { "type": "integer", "minimum": 0 },
80
+ "physicalCleanup": {
81
+ "enum": ["completed", "wal_busy", "failed"]
82
+ },
83
+ "checkpointedFrames": { "type": "integer" },
84
+ "remainingWalFrames": { "type": "integer" }
85
+ }
86
+ }
87
+ ]
88
+ }
@@ -129,6 +129,100 @@
129
129
  "reason": { "type": "string" }
130
130
  }
131
131
  },
132
+ "record": {
133
+ "type": "object",
134
+ "additionalProperties": false,
135
+ "description": "Bounded logical-record provenance for a file/export source",
136
+ "required": ["recordKey", "sourceLocator", "anchors", "adapter"],
137
+ "properties": {
138
+ "recordKey": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
139
+ "sourceLocator": { "type": "string", "minLength": 1, "maxLength": 512 },
140
+ "anchors": {
141
+ "type": "array",
142
+ "maxItems": 256,
143
+ "items": {
144
+ "type": "object",
145
+ "additionalProperties": false,
146
+ "required": ["kind", "value"],
147
+ "properties": {
148
+ "kind": {
149
+ "enum": [
150
+ "line",
151
+ "cue",
152
+ "timestamp",
153
+ "message",
154
+ "event",
155
+ "record"
156
+ ]
157
+ },
158
+ "value": { "type": "string", "minLength": 1, "maxLength": 512 },
159
+ "endValue": { "type": "string", "minLength": 1, "maxLength": 512 }
160
+ }
161
+ }
162
+ },
163
+ "adapter": {
164
+ "type": "object",
165
+ "additionalProperties": false,
166
+ "required": ["id", "version", "fingerprint"],
167
+ "properties": {
168
+ "id": { "type": "string", "minLength": 1, "maxLength": 128 },
169
+ "version": { "type": "string", "minLength": 1, "maxLength": 64 },
170
+ "fingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
171
+ }
172
+ },
173
+ "author": { "type": "string", "maxLength": 2048 },
174
+ "participants": {
175
+ "type": "array",
176
+ "maxItems": 256,
177
+ "items": { "type": "string", "minLength": 1, "maxLength": 2048 }
178
+ },
179
+ "categories": {
180
+ "type": "array",
181
+ "maxItems": 256,
182
+ "items": { "type": "string", "minLength": 1, "maxLength": 512 }
183
+ },
184
+ "dateFields": {
185
+ "type": "object",
186
+ "maxProperties": 256,
187
+ "propertyNames": { "type": "string", "maxLength": 128 },
188
+ "additionalProperties": {
189
+ "type": "string",
190
+ "minLength": 1,
191
+ "maxLength": 256
192
+ }
193
+ },
194
+ "messageId": { "type": "string", "maxLength": 2048 },
195
+ "inReplyTo": { "type": "string", "maxLength": 2048 },
196
+ "references": {
197
+ "type": "array",
198
+ "maxItems": 256,
199
+ "items": { "type": "string", "minLength": 1, "maxLength": 2048 }
200
+ },
201
+ "threadId": { "type": "string", "maxLength": 2048 },
202
+ "eventId": { "type": "string", "maxLength": 2048 },
203
+ "sessionId": { "type": "string", "maxLength": 2048 },
204
+ "attachments": {
205
+ "type": "array",
206
+ "maxItems": 256,
207
+ "items": {
208
+ "type": "object",
209
+ "additionalProperties": false,
210
+ "required": ["name"],
211
+ "properties": {
212
+ "name": { "type": "string", "minLength": 1, "maxLength": 512 },
213
+ "mime": { "type": "string", "minLength": 1, "maxLength": 256 },
214
+ "bytes": {
215
+ "type": "integer",
216
+ "minimum": 0,
217
+ "maximum": 9007199254740991
218
+ },
219
+ "disposition": { "enum": ["inline", "attachment"] },
220
+ "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
221
+ }
222
+ }
223
+ }
224
+ }
225
+ },
132
226
  "tags": {
133
227
  "type": "array",
134
228
  "description": "Tags associated with the document",
@@ -13,18 +13,129 @@
13
13
  "additionalProperties": false,
14
14
  "required": ["code", "message"],
15
15
  "properties": {
16
- "code": { "const": -32000 },
16
+ "code": { "enum": [-32000, -32003] },
17
17
  "message": {
18
18
  "enum": [
19
19
  "Unauthorized",
20
20
  "Forbidden",
21
+ "Operation blocked by collection egress policy",
21
22
  "Request body too large",
22
23
  "Too many requests",
23
24
  "Resident runtime unavailable"
24
25
  ]
26
+ },
27
+ "data": {
28
+ "type": "object",
29
+ "additionalProperties": false,
30
+ "required": ["code", "message", "reason", "audit"],
31
+ "properties": {
32
+ "code": { "const": "EGRESS_DENIED" },
33
+ "message": {
34
+ "const": "Operation blocked by collection egress policy"
35
+ },
36
+ "reason": {
37
+ "enum": [
38
+ "LOCAL_DESTINATION",
39
+ "LAN_POLICY_AUTHENTICATED",
40
+ "REMOTE_POLICY_AUTHENTICATED",
41
+ "INVALID_INPUT",
42
+ "NO_COLLECTION_POLICY",
43
+ "COLLECTION_LIMIT_EXCEEDED",
44
+ "INVALID_COLLECTION",
45
+ "UNKNOWN_ACTION",
46
+ "UNKNOWN_DESTINATION",
47
+ "ACTION_DESTINATION_MISMATCH",
48
+ "UNKNOWN_CONTENT_CLASS",
49
+ "UNKNOWN_POLICY",
50
+ "UNKNOWN_POLICY_SOURCE",
51
+ "INVALID_POLICY_SOURCE_PAIR",
52
+ "INVALID_CALLER",
53
+ "CALLER_NOT_AUTHORIZED",
54
+ "AUTHENTICATION_REQUIRED",
55
+ "POLICY_LOCAL_ONLY",
56
+ "POLICY_LAN_ONLY"
57
+ ]
58
+ },
59
+ "audit": {
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "required": [
63
+ "action",
64
+ "destinationZone",
65
+ "contentClass",
66
+ "collectionCount",
67
+ "collections",
68
+ "effectivePolicy",
69
+ "effectivePolicySource",
70
+ "callerAuthenticated",
71
+ "callerOperationAuthorized"
72
+ ],
73
+ "properties": {
74
+ "action": {
75
+ "enum": [
76
+ "retrieve",
77
+ "serve",
78
+ "publish",
79
+ "remote_inference",
80
+ "export",
81
+ "clip_write",
82
+ "unknown"
83
+ ]
84
+ },
85
+ "destinationZone": {
86
+ "enum": [
87
+ "local_process",
88
+ "loopback",
89
+ "lan",
90
+ "remote",
91
+ "unknown"
92
+ ]
93
+ },
94
+ "contentClass": {
95
+ "enum": [
96
+ "source",
97
+ "snippet",
98
+ "metadata",
99
+ "attachment",
100
+ "embedding",
101
+ "capsule",
102
+ "audit_log",
103
+ "retrieval_trace",
104
+ "unknown"
105
+ ]
106
+ },
107
+ "collectionCount": { "type": "integer", "minimum": 0 },
108
+ "collections": {
109
+ "type": "array",
110
+ "items": { "type": "string" },
111
+ "maxItems": 64
112
+ },
113
+ "effectivePolicy": {
114
+ "enum": ["local_only", "lan", "remote", "unknown"]
115
+ },
116
+ "effectivePolicySource": {
117
+ "enum": [
118
+ "explicit",
119
+ "config_default",
120
+ "legacy_default",
121
+ "mixed",
122
+ "unknown"
123
+ ]
124
+ },
125
+ "callerAuthenticated": {
126
+ "anyOf": [{ "type": "boolean" }, { "type": "null" }]
127
+ },
128
+ "callerOperationAuthorized": {
129
+ "anyOf": [{ "type": "boolean" }, { "type": "null" }]
130
+ }
131
+ }
132
+ }
133
+ }
25
134
  }
26
135
  }
27
136
  },
28
- "id": { "type": "null" }
137
+ "id": {
138
+ "anyOf": [{ "type": "null" }, { "type": "integer" }, { "type": "string" }]
139
+ }
29
140
  }
30
141
  }