@gmickel/gno 1.40.0 → 1.41.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/README.md +1 -0
- package/assets/skill/SKILL.md +17 -0
- package/assets/skill/cli-reference.md +48 -0
- package/assets/skill/mcp-reference.md +24 -0
- package/browser-extension/artifacts/{gno-browser-clipper-v1.40.0.zip → gno-browser-clipper-v1.41.0.zip} +0 -0
- package/browser-extension/artifacts/gno-browser-clipper-v1.41.0.zip.sha256 +1 -0
- package/browser-extension/dist/manifest.json +1 -1
- package/package.json +1 -1
- package/spec/cli.md +146 -7
- package/spec/db/schema.sql +17 -0
- package/spec/mcp.md +194 -0
- package/spec/output-schemas/memory-recall.schema.json +159 -0
- package/spec/output-schemas/memory-remember.schema.json +164 -0
- package/spec/output-schemas/status.schema.json +269 -54
- package/src/cli/commands/memory.ts +491 -0
- package/src/cli/commands/status.ts +23 -4
- package/src/cli/options.ts +4 -0
- package/src/cli/program.ts +127 -0
- package/src/config/types.ts +7 -0
- package/src/core/audit-provenance.ts +91 -0
- package/src/core/audit-workspace.ts +17 -0
- package/src/core/memory-diagnostics.ts +144 -0
- package/src/core/memory-fence.ts +239 -0
- package/src/core/memory-recall.ts +269 -0
- package/src/core/memory-record.ts +435 -0
- package/src/core/memory-remember.ts +425 -0
- package/src/core/memory-types.ts +211 -0
- package/src/core/memory.ts +87 -0
- package/src/ingestion/sync.ts +17 -0
- package/src/mcp/http-egress.ts +2 -0
- package/src/mcp/tools/index.ts +43 -0
- package/src/mcp/tools/memory-recall.ts +122 -0
- package/src/mcp/tools/memory-remember.ts +177 -0
- package/src/mcp/tools/memory-shared.ts +80 -0
- package/src/pipeline/search.ts +2 -0
- package/src/pipeline/types.ts +8 -0
- package/src/sdk/client.ts +94 -1
- package/src/sdk/index.ts +13 -0
- package/src/sdk/types.ts +28 -0
- package/src/serve/routes/api.ts +167 -0
- package/src/serve/server.ts +26 -0
- package/src/store/migrations/027-memory-scopes.ts +37 -0
- package/src/store/migrations/index.ts +2 -0
- package/src/store/sqlite/adapter.ts +127 -3
- package/src/store/types.ts +54 -0
- package/browser-extension/artifacts/gno-browser-clipper-v1.40.0.zip.sha256 +0 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "gno://schemas/memory-recall@1.0",
|
|
4
|
+
"title": "GNO Memory Recall Result",
|
|
5
|
+
"description": "Shared result of `recall` on every surface (CLI --json, MCP gno_recall, REST POST /api/memory/recall, SDK client.recall()). Derived from RecallResult in src/core/memory.ts. Every returned fact carries a gno:// cite and its egress lineage; the receipt is content-free and bound to caller + session.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["facts", "receipt", "budget", "retrieval"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"facts": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": { "$ref": "#/$defs/recalledFact" }
|
|
13
|
+
},
|
|
14
|
+
"receipt": { "$ref": "#/$defs/receipt" },
|
|
15
|
+
"budget": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"required": ["maxFacts", "maxTokens", "usedTokens", "omitted"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"maxFacts": { "type": "integer", "minimum": 1 },
|
|
21
|
+
"maxTokens": { "type": "integer", "minimum": 1 },
|
|
22
|
+
"usedTokens": { "type": "integer", "minimum": 0 },
|
|
23
|
+
"omitted": { "type": "integer", "minimum": 0 }
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"retrieval": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"additionalProperties": false,
|
|
29
|
+
"required": ["mode"],
|
|
30
|
+
"properties": {
|
|
31
|
+
"mode": { "enum": ["hybrid", "lexical"] },
|
|
32
|
+
"semanticUnavailable": { "type": "string" }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"egressLineage": {
|
|
36
|
+
"$ref": "#/$defs/egressLineage",
|
|
37
|
+
"description": "Strictest source policy across every returned fact; absent when no fact was returned."
|
|
38
|
+
},
|
|
39
|
+
"hint": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Self-teaching line naming `gno remember`; present only when no fact was returned."
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"$defs": {
|
|
45
|
+
"uri": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"pattern": "^gno://[^/]+/.+"
|
|
48
|
+
},
|
|
49
|
+
"sha256": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
52
|
+
},
|
|
53
|
+
"recalledFact": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": [
|
|
57
|
+
"uri",
|
|
58
|
+
"docid",
|
|
59
|
+
"recordId",
|
|
60
|
+
"text",
|
|
61
|
+
"scopes",
|
|
62
|
+
"caller",
|
|
63
|
+
"session",
|
|
64
|
+
"createdAt",
|
|
65
|
+
"contentHash",
|
|
66
|
+
"supersedes",
|
|
67
|
+
"score",
|
|
68
|
+
"spanHash",
|
|
69
|
+
"egressLineage"
|
|
70
|
+
],
|
|
71
|
+
"properties": {
|
|
72
|
+
"uri": { "$ref": "#/$defs/uri" },
|
|
73
|
+
"docid": { "type": "string", "minLength": 1 },
|
|
74
|
+
"recordId": { "type": "string", "pattern": "^mem-" },
|
|
75
|
+
"text": { "type": "string", "minLength": 1 },
|
|
76
|
+
"scopes": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"minItems": 1,
|
|
79
|
+
"maxItems": 8,
|
|
80
|
+
"items": { "type": "string", "minLength": 1, "maxLength": 64 }
|
|
81
|
+
},
|
|
82
|
+
"caller": { "type": "string", "minLength": 1 },
|
|
83
|
+
"session": { "type": "string", "minLength": 1 },
|
|
84
|
+
"createdAt": { "type": "string", "format": "date-time" },
|
|
85
|
+
"contentHash": { "$ref": "#/$defs/sha256" },
|
|
86
|
+
"source": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"minLength": 1,
|
|
89
|
+
"description": "Free-text evidence recorded with the fact, when one was given."
|
|
90
|
+
},
|
|
91
|
+
"supersedes": {
|
|
92
|
+
"type": "array",
|
|
93
|
+
"items": { "$ref": "#/$defs/uri" }
|
|
94
|
+
},
|
|
95
|
+
"score": { "type": "number", "minimum": 0 },
|
|
96
|
+
"spanHash": {
|
|
97
|
+
"$ref": "#/$defs/sha256",
|
|
98
|
+
"description": "Hash of the returned span; replaying it to remember with this receipt is fenced."
|
|
99
|
+
},
|
|
100
|
+
"egressLineage": { "$ref": "#/$defs/egressLineage" }
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"receipt": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"required": [
|
|
107
|
+
"caller",
|
|
108
|
+
"session",
|
|
109
|
+
"issuedAt",
|
|
110
|
+
"memoryIds",
|
|
111
|
+
"spanHashes",
|
|
112
|
+
"digest"
|
|
113
|
+
],
|
|
114
|
+
"properties": {
|
|
115
|
+
"caller": { "type": "string", "minLength": 1 },
|
|
116
|
+
"session": { "type": "string", "minLength": 1 },
|
|
117
|
+
"issuedAt": { "type": "string", "format": "date-time" },
|
|
118
|
+
"memoryIds": {
|
|
119
|
+
"type": "array",
|
|
120
|
+
"items": { "type": "string", "minLength": 1 }
|
|
121
|
+
},
|
|
122
|
+
"spanHashes": {
|
|
123
|
+
"type": "array",
|
|
124
|
+
"items": { "$ref": "#/$defs/sha256" }
|
|
125
|
+
},
|
|
126
|
+
"digest": { "$ref": "#/$defs/sha256" }
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"egressLineage": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"additionalProperties": false,
|
|
132
|
+
"required": ["effectivePolicy", "digest", "sources"],
|
|
133
|
+
"properties": {
|
|
134
|
+
"effectivePolicy": { "enum": ["local_only", "lan", "remote"] },
|
|
135
|
+
"digest": { "$ref": "#/$defs/sha256" },
|
|
136
|
+
"sources": {
|
|
137
|
+
"type": "array",
|
|
138
|
+
"minItems": 1,
|
|
139
|
+
"maxItems": 128,
|
|
140
|
+
"items": {
|
|
141
|
+
"type": "object",
|
|
142
|
+
"additionalProperties": false,
|
|
143
|
+
"required": ["collection", "policy", "source"],
|
|
144
|
+
"properties": {
|
|
145
|
+
"collection": {
|
|
146
|
+
"type": "string",
|
|
147
|
+
"pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
|
|
148
|
+
},
|
|
149
|
+
"policy": { "enum": ["local_only", "lan", "remote"] },
|
|
150
|
+
"source": {
|
|
151
|
+
"enum": ["explicit", "config_default", "legacy_default"]
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "gno://schemas/memory-remember@1.0",
|
|
4
|
+
"title": "GNO Memory Remember Result",
|
|
5
|
+
"description": "Shared result of `remember` on every surface (CLI --json, MCP gno_remember, REST POST /api/memory/remember, SDK client.remember()). Derived from RememberResult in src/core/memory.ts. Exactly one outcome branch applies.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"oneOf": [
|
|
8
|
+
{
|
|
9
|
+
"type": "object",
|
|
10
|
+
"additionalProperties": false,
|
|
11
|
+
"required": ["outcome", "record", "matching"],
|
|
12
|
+
"properties": {
|
|
13
|
+
"outcome": { "const": "existing" },
|
|
14
|
+
"record": { "$ref": "#/$defs/fact" },
|
|
15
|
+
"matching": { "$ref": "#/$defs/matching" }
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"type": "object",
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"required": ["outcome", "candidates", "matching"],
|
|
22
|
+
"properties": {
|
|
23
|
+
"outcome": { "const": "candidates" },
|
|
24
|
+
"candidates": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": { "$ref": "#/$defs/candidate" }
|
|
27
|
+
},
|
|
28
|
+
"matching": { "$ref": "#/$defs/matching" }
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": false,
|
|
34
|
+
"required": ["outcome", "record", "absPath", "sync", "matching"],
|
|
35
|
+
"properties": {
|
|
36
|
+
"outcome": { "enum": ["added", "superseded"] },
|
|
37
|
+
"record": { "$ref": "#/$defs/fact" },
|
|
38
|
+
"absPath": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "Absolute path of the fact file that was written."
|
|
41
|
+
},
|
|
42
|
+
"sync": { "$ref": "#/$defs/sync" },
|
|
43
|
+
"matching": { "$ref": "#/$defs/matching" }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"$defs": {
|
|
48
|
+
"uri": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "Stable gno:// virtual URI of the fact document.",
|
|
51
|
+
"pattern": "^gno://[^/]+/.+"
|
|
52
|
+
},
|
|
53
|
+
"sha256": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
56
|
+
},
|
|
57
|
+
"scopes": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"description": "Normalized explicit scopes (1..8); there is no implicit global scope.",
|
|
60
|
+
"minItems": 1,
|
|
61
|
+
"maxItems": 8,
|
|
62
|
+
"items": { "type": "string", "minLength": 1, "maxLength": 64 }
|
|
63
|
+
},
|
|
64
|
+
"fact": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"required": [
|
|
68
|
+
"uri",
|
|
69
|
+
"docid",
|
|
70
|
+
"recordId",
|
|
71
|
+
"text",
|
|
72
|
+
"scopes",
|
|
73
|
+
"caller",
|
|
74
|
+
"session",
|
|
75
|
+
"createdAt",
|
|
76
|
+
"contentHash",
|
|
77
|
+
"supersedes"
|
|
78
|
+
],
|
|
79
|
+
"properties": {
|
|
80
|
+
"uri": { "$ref": "#/$defs/uri" },
|
|
81
|
+
"docid": { "type": "string", "minLength": 1 },
|
|
82
|
+
"recordId": { "type": "string", "pattern": "^mem-" },
|
|
83
|
+
"text": { "type": "string", "minLength": 1 },
|
|
84
|
+
"scopes": { "$ref": "#/$defs/scopes" },
|
|
85
|
+
"caller": { "type": "string", "minLength": 1 },
|
|
86
|
+
"session": { "type": "string", "minLength": 1 },
|
|
87
|
+
"createdAt": { "type": "string", "format": "date-time" },
|
|
88
|
+
"contentHash": { "$ref": "#/$defs/sha256" },
|
|
89
|
+
"source": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"minLength": 1,
|
|
92
|
+
"description": "Free-text evidence recorded with the fact, when one was given."
|
|
93
|
+
},
|
|
94
|
+
"supersedes": {
|
|
95
|
+
"type": "array",
|
|
96
|
+
"description": "Predecessor gno:// virtual URIs (empty for an added fact).",
|
|
97
|
+
"items": { "$ref": "#/$defs/uri" }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"candidate": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"additionalProperties": false,
|
|
104
|
+
"required": [
|
|
105
|
+
"uri",
|
|
106
|
+
"docid",
|
|
107
|
+
"recordId",
|
|
108
|
+
"text",
|
|
109
|
+
"scopes",
|
|
110
|
+
"caller",
|
|
111
|
+
"session",
|
|
112
|
+
"createdAt",
|
|
113
|
+
"contentHash",
|
|
114
|
+
"supersedes",
|
|
115
|
+
"similarity",
|
|
116
|
+
"match"
|
|
117
|
+
],
|
|
118
|
+
"properties": {
|
|
119
|
+
"uri": { "$ref": "#/$defs/uri" },
|
|
120
|
+
"docid": { "type": "string", "minLength": 1 },
|
|
121
|
+
"recordId": { "type": "string", "pattern": "^mem-" },
|
|
122
|
+
"text": { "type": "string", "minLength": 1 },
|
|
123
|
+
"scopes": { "$ref": "#/$defs/scopes" },
|
|
124
|
+
"caller": { "type": "string", "minLength": 1 },
|
|
125
|
+
"session": { "type": "string", "minLength": 1 },
|
|
126
|
+
"createdAt": { "type": "string", "format": "date-time" },
|
|
127
|
+
"contentHash": { "$ref": "#/$defs/sha256" },
|
|
128
|
+
"source": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"minLength": 1,
|
|
131
|
+
"description": "Free-text evidence recorded with the fact, when one was given."
|
|
132
|
+
},
|
|
133
|
+
"supersedes": {
|
|
134
|
+
"type": "array",
|
|
135
|
+
"items": { "$ref": "#/$defs/uri" }
|
|
136
|
+
},
|
|
137
|
+
"similarity": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
138
|
+
"match": { "enum": ["exact", "likely", "weak"] }
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"matching": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"additionalProperties": false,
|
|
144
|
+
"required": ["mode", "threshold"],
|
|
145
|
+
"properties": {
|
|
146
|
+
"mode": { "enum": ["semantic", "lexical"] },
|
|
147
|
+
"semanticUnavailable": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"description": "Present when semantic matching was unavailable and lexical was used."
|
|
150
|
+
},
|
|
151
|
+
"threshold": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"sync": {
|
|
155
|
+
"type": "object",
|
|
156
|
+
"additionalProperties": false,
|
|
157
|
+
"required": ["status"],
|
|
158
|
+
"properties": {
|
|
159
|
+
"status": { "enum": ["completed", "failed"] },
|
|
160
|
+
"error": { "type": "string" }
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|