@unblocklabs/unblock-memory 0.12.3 → 0.14.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 +19 -18
- package/defaults.json +162 -0
- package/dist/src/analysis.js +1 -1
- package/dist/src/cluster-review.d.ts +2 -0
- package/dist/src/cluster-review.js +9 -8
- package/dist/src/config.d.ts +9 -6
- package/dist/src/config.js +59 -45
- package/dist/src/curation.d.ts +1 -1
- package/dist/src/decision-client.d.ts +45 -0
- package/dist/src/decision-client.js +87 -0
- package/dist/src/{typesafe.d.ts → decision-ranking.d.ts} +15 -18
- package/dist/src/decision-ranking.js +155 -0
- package/dist/src/{typesafe-review.d.ts → decision-review.d.ts} +13 -9
- package/dist/src/decision-review.js +193 -0
- package/dist/src/defaults.d.ts +8 -0
- package/dist/src/defaults.js +128 -0
- package/dist/src/diagnostics.d.ts +5 -5
- package/dist/src/emotion-baselines.d.ts +28 -3
- package/dist/src/emotion-baselines.js +312 -115
- package/dist/src/evidence-review.d.ts +22 -8
- package/dist/src/evidence-review.js +11 -8
- package/dist/src/extraction-chunk.d.ts +3 -0
- package/dist/src/extraction-chunk.js +25 -6
- package/dist/src/extraction-config.js +4 -2
- package/dist/src/extraction-model.d.ts +25 -17
- package/dist/src/extraction-model.js +232 -104
- package/dist/src/extraction-runtime.d.ts +3 -1
- package/dist/src/extraction-runtime.js +48 -20
- package/dist/src/extraction-source.d.ts +1 -1
- package/dist/src/extraction-source.js +21 -12
- package/dist/src/extraction-store.d.ts +29 -3
- package/dist/src/extraction-store.js +149 -25
- package/dist/src/extraction-worker.d.ts +3 -3
- package/dist/src/extraction-worker.js +250 -95
- package/dist/src/inside-out-runtime.js +43 -30
- package/dist/src/inside-out-sources.js +2 -1
- package/dist/src/inside-out-store.d.ts +2 -2
- package/dist/src/inside-out-store.js +111 -69
- package/dist/src/inside-out.d.ts +10 -9
- package/dist/src/inside-out.js +194 -106
- package/dist/src/manager.d.ts +22 -9
- package/dist/src/manager.js +279 -172
- package/dist/src/memory-database.js +3 -2
- package/dist/src/memory-passage.d.ts +2 -2
- package/dist/src/memory-passage.js +3 -2
- package/dist/src/memory-search.d.ts +4 -2
- package/dist/src/memory-search.js +5 -5
- package/dist/src/memory-whisperer.d.ts +1 -1
- package/dist/src/memory-whisperer.js +195 -129
- package/dist/src/my-turn.d.ts +1 -1
- package/dist/src/my-turn.js +90 -70
- package/dist/src/people-background.d.ts +5 -1
- package/dist/src/people-background.js +31 -7
- package/dist/src/people-dossier-review.d.ts +20 -8
- package/dist/src/people-dossier-review.js +15 -11
- package/dist/src/people-hooks.js +127 -22
- package/dist/src/people-learning-cron.d.ts +1 -1
- package/dist/src/people-learning-cron.js +107 -57
- package/dist/src/people-learning-inventory.d.ts +1 -0
- package/dist/src/people-learning-inventory.js +283 -172
- package/dist/src/people-learning-prompt.js +1 -1
- package/dist/src/people-learning-runtime.d.ts +1 -1
- package/dist/src/people-learning-runtime.js +360 -203
- package/dist/src/people-learning-store.d.ts +27 -4
- package/dist/src/people-learning-store.js +312 -96
- package/dist/src/people-primer-tool.js +13 -10
- package/dist/src/people-primer.d.ts +3 -1
- package/dist/src/people-primer.js +66 -48
- package/dist/src/people-store.d.ts +18 -21
- package/dist/src/people-store.js +188 -64
- package/dist/src/people-tools.js +138 -93
- package/dist/src/plugin.js +19 -18
- package/dist/src/quality-audit.d.ts +2 -0
- package/dist/src/quality-audit.js +11 -9
- package/dist/src/quality-triage.js +4 -3
- package/dist/src/query-generator.js +5 -2
- package/dist/src/response-audit.d.ts +1 -1
- package/dist/src/response-audit.js +78 -44
- package/dist/src/response-config.js +3 -1
- package/dist/src/response-episodes.d.ts +1 -1
- package/dist/src/response-episodes.js +15 -19
- package/dist/src/response-identity.js +2 -1
- package/dist/src/response-judge.d.ts +151 -145
- package/dist/src/response-judge.js +535 -204
- package/dist/src/response-memory.js +2 -1
- package/dist/src/response-outcome.js +9 -8
- package/dist/src/response-reviews.d.ts +29 -1
- package/dist/src/response-reviews.js +113 -15
- package/dist/src/response-runtime.js +10 -9
- package/dist/src/response-stages.d.ts +50 -53
- package/dist/src/response-stages.js +10 -4
- package/dist/src/response-store.d.ts +7 -6
- package/dist/src/response-store.js +335 -212
- package/dist/src/review-tools.d.ts +8 -2
- package/dist/src/review-tools.js +22 -21
- package/dist/src/runtime.d.ts +7 -4
- package/dist/src/runtime.js +625 -98
- package/dist/src/safety-config.js +3 -2
- package/dist/src/safety-whisperer.d.ts +2 -2
- package/dist/src/safety-whisperer.js +90 -73
- package/dist/src/session-sync.d.ts +3 -1
- package/dist/src/session-sync.js +202 -96
- package/dist/src/skill-whisperer.d.ts +2 -2
- package/dist/src/skill-whisperer.js +55 -32
- package/dist/src/slack-directory.js +3 -2
- package/dist/src/training-gate.d.ts +9 -22
- package/dist/src/training-gate.js +34 -36
- package/dist/src/training-input.js +4 -3
- package/dist/src/training-judge.d.ts +9 -16
- package/dist/src/training-judge.js +6 -5
- package/dist/src/training-models.d.ts +1 -1
- package/dist/src/training-models.js +9 -7
- package/dist/src/training-queries.d.ts +14 -9
- package/dist/src/training-queries.js +374 -231
- package/dist/src/training-retrieval.d.ts +17 -27
- package/dist/src/training-retrieval.js +186 -139
- package/dist/src/training-runtime.d.ts +3 -0
- package/dist/src/training-runtime.js +76 -18
- package/dist/src/training-store.d.ts +18 -3
- package/dist/src/training-store.js +141 -52
- package/dist/src/training.js +9 -11
- package/dist/src/whisperer-context.d.ts +13 -0
- package/dist/src/whisperer-context.js +22 -1
- package/docs/configuration.md +83 -64
- package/docs/extraction.md +26 -35
- package/docs/memory-training.md +7 -6
- package/docs/people-learning.md +2 -2
- package/docs/peoplesql.md +6 -6
- package/docs/response-audit.md +10 -8
- package/docs/retrieval.md +43 -47
- package/openclaw.plugin.json +76 -75
- package/package.json +5 -2
- package/skills/memory-curator/SKILL.md +1 -1
- package/skills/people-whisperer/SKILL.md +1 -1
- package/dist/src/typesafe-client.d.ts +0 -30
- package/dist/src/typesafe-client.js +0 -92
- package/dist/src/typesafe-review.js +0 -154
- package/dist/src/typesafe.js +0 -147
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "unblock-memory",
|
|
3
3
|
"name": "Unblock Memory",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.0",
|
|
5
5
|
"description": "Indexes, retrieves, and analyzes configured workspace memory with existing QMD vectors.",
|
|
6
6
|
"kind": "memory",
|
|
7
7
|
"activation": { "onStartup": true },
|
|
@@ -47,35 +47,43 @@
|
|
|
47
47
|
"memory_people_learning": { "sideEffecting": true }
|
|
48
48
|
},
|
|
49
49
|
"uiHints": {
|
|
50
|
-
"myTurn.enabled": { "label": "My Turn", "help": "Opt in to sending recent group/channel conversation text and agent identity to
|
|
50
|
+
"myTurn.enabled": { "label": "My Turn", "help": "Opt in to sending recent group/channel conversation text and agent identity to the configured decision model (default: https://codex.unblocklabs.ai/v1/decisions -> OpenRouter Liquid d1.2-ultra). Appends an advisory NO_REPLY hint only when the model clearly favors silence. DMs and internal wakes are excluded. Failures never prevent a turn. Requires hook conversation access and prompt injection. Disabled by default." },
|
|
51
51
|
"myTurn.historyMessages": { "label": "My Turn Message Window", "help": "Recent host-confirmed human messages including the trigger (1-50, default 10). Agent/bot/internal messages and unverified bundled history are excluded. If the trigger cannot be verified human, My Turn skips without affecting the agent turn." },
|
|
52
52
|
"myTurn.channels": { "label": "My Turn Channel Overrides", "help": "Canonical provider IDs, e.g. slack or imessage. Once My Turn is enabled, omitted providers and omitted enabled flags default on. Set a provider's enabled to false to exclude it." },
|
|
53
|
-
"peoplePrimer.enabled": { "label": "People Background Primer", "help": "Opt in to sending identity, approved excerpts and proposed snippets to
|
|
53
|
+
"peoplePrimer.enabled": { "label": "People Background Primer", "help": "Opt in to sending identity, approved excerpts and proposed snippets to the configured decision model (default: Codex LB -> OpenRouter Liquid d1.2-ultra). Prepares evidence and checks <=70-word blurbs before replace_dossier saves; disabled/unavailable reviews require explicit manual verification. Existing dossiers are not evidence. Results are accessible to the agent's tool callers." },
|
|
54
54
|
"peoplePrimer.corpora": { "label": "Primer Approved Corpora", "help": "Explicit non-skill corpus allowlist. Sessions includes all indexed conversations; approve only content suitable for this agent's audiences." },
|
|
55
|
-
"responseAudit.enabled": { "label": "Response Quality Audit", "help": "Opt in to background
|
|
55
|
+
"responseAudit.enabled": { "label": "Response Quality Audit", "help": "Opt in to background decision-model evaluation (default: Codex LB -> OpenRouter Liquid d1.2-ultra) of approved Slack humans. Operator-only reports; no prompt or memory writes." },
|
|
56
56
|
"responseAudit.sentimentEnabled": { "label": "Human Sentiment Analysis", "help": "Default on within an enabled, approved response audit. Includes annoyance, frustration and expressed intensity; does not imply agent fault." },
|
|
57
57
|
"responseAudit.intervalMinutes": { "label": "Response Audit Interval (minutes)", "help": "Shared cadence for quality and enabled sentiment analysis. Unchanged successful exchanges are cached. Zero means manual-only." },
|
|
58
|
-
"responseAudit.senderIds": { "label": "Approved Human Sender IDs", "help": "Explicit human Slack user IDs whose exchanges may be sent to
|
|
58
|
+
"responseAudit.senderIds": { "label": "Approved Human Sender IDs", "help": "Explicit human Slack user IDs whose exchanges may be sent to the configured decision model. Also requires trusted human identity or owner metadata; explicit bots are always excluded." },
|
|
59
59
|
"responseAudit.memoryCorpora": { "label": "Response Audit Memory Evidence", "help": "Optional configured file corpora approved for current-index memory-gap investigation. Does not prove historical availability." },
|
|
60
60
|
"qualityAudit.enabled": {
|
|
61
61
|
"label": "Memory Quality Audit",
|
|
62
|
-
"help": "Enable an on-demand
|
|
62
|
+
"help": "Enable an on-demand decision-model audit (default: Codex LB -> OpenRouter Liquid d1.2-ultra). Records review indicators only; never edits or suppresses data."
|
|
63
63
|
},
|
|
64
|
-
"evidenceReview.enabled": { "label": "Evidence Review", "help": "Opt in to sending proposed claims and explicitly approved indexed evidence to
|
|
65
|
-
"evidenceReview.corpora": { "label": "Evidence Review Corpora", "help": "Explicit non-skill corpus approval for claim evidence sent to
|
|
64
|
+
"evidenceReview.enabled": { "label": "Evidence Review", "help": "Opt in to sending proposed claims and explicitly approved indexed evidence to the configured decision model (default: Codex LB -> OpenRouter Liquid d1.2-ultra). Advisory only; never writes." },
|
|
65
|
+
"evidenceReview.corpora": { "label": "Evidence Review Corpora", "help": "Explicit non-skill corpus approval for claim evidence sent to the configured decision model." },
|
|
66
66
|
"qualityAudit.corpora": {
|
|
67
67
|
"label": "Approved Audit Corpora",
|
|
68
|
-
"help": "Explicit non-skill corpora approved for external
|
|
68
|
+
"help": "Explicit non-skill corpora approved for external decision-model processing and maintenance results visible to every audience using this agent. Sessions means ALL indexed sessions, not only the current conversation."
|
|
69
69
|
},
|
|
70
|
-
"
|
|
71
|
-
"label": "
|
|
72
|
-
"help": "Shared provider gate for My Turn, opted-in whisperers, people primer/save review, evidence/quality reviews and response audits. Does not enable features or approve corpora by itself. Memory search discovers locally and uses
|
|
70
|
+
"decisionModel.enabled": {
|
|
71
|
+
"label": "Decision Model Judgments",
|
|
72
|
+
"help": "Shared provider gate for My Turn, opted-in whisperers, people primer/save review, evidence/quality reviews and response audits. Does not enable features or approve corpora by itself. Memory search discovers locally and uses the configured decision model to rank usefulness; People Whisperer injection stays local."
|
|
73
73
|
},
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
"decisionModel.endpoint": {
|
|
75
|
+
"label": "Decision Model Endpoint",
|
|
76
|
+
"help": "HTTPS (or loopback HTTP) decision API endpoint without credentials, query, or fragment. Defaults to https://codex.unblocklabs.ai/v1/decisions (OpenRouter Liquid d1.2-ultra)."
|
|
77
|
+
},
|
|
78
|
+
"decisionModel.model": {
|
|
79
|
+
"label": "Decision Model ID",
|
|
80
|
+
"help": "Model alias sent to the decision endpoint. Defaults to liquid/d1.2-ultra."
|
|
81
|
+
},
|
|
82
|
+
"decisionModel.apiKey": { "label": "Decision API Key", "sensitive": true },
|
|
83
|
+
"decisionModel.timeoutMs": { "label": "Decision Request Timeout", "help": "Per-request timeout, not the whole operation. People primer/dossier review use peoplePrimer.timeoutMs instead; Memory Whisperer has its own total deadline, Skill Whisperer and My Turn have their own total deadlines." },
|
|
84
|
+
"decisionModel.apiKeyFile": {
|
|
85
|
+
"label": "Decision API Key File",
|
|
86
|
+
"help": "Absolute path to a plaintext API key or a dotenv file (CODEX_LB_API_KEY, or DECISION_MODEL_API_KEY for custom endpoints). Use a key for the configured endpoint."
|
|
79
87
|
},
|
|
80
88
|
"keepEmbeddingModelWarm": {
|
|
81
89
|
"label": "Keep Embedding Model Warm",
|
|
@@ -91,15 +99,15 @@
|
|
|
91
99
|
},
|
|
92
100
|
"memoryWhisperer.enabled": {
|
|
93
101
|
"label": "Memory Whisperer",
|
|
94
|
-
"help": "Append up to three
|
|
102
|
+
"help": "Append up to three decision-model-approved historical excerpts after the user prompt. Requires explicit corpora, decision-model credentials (defaults to https://codex.unblocklabs.ai/v1/decisions -> OpenRouter liquid/d1.2-ultra), and hook conversation access. Disabled by default."
|
|
95
103
|
},
|
|
96
104
|
"memoryWhisperer.corpora": {
|
|
97
105
|
"label": "Approved Hint Corpora",
|
|
98
|
-
"help": "Explicit non-skill corpus allowlist for automatic recall and
|
|
106
|
+
"help": "Explicit non-skill corpus allowlist for automatic recall and decision-model processing (defaults to https://codex.unblocklabs.ai/v1/decisions -> OpenRouter liquid/d1.2-ultra). Session recall spans this agent's indexed sessions; the sessions corpus chatTypes setting controls direct-message inclusion."
|
|
99
107
|
},
|
|
100
108
|
"safetyWhisperer.enabled": {
|
|
101
109
|
"label": "Safety Whisperer",
|
|
102
|
-
"help": "Prompt-level guardrail, not access control. Sends every checked human message and bounded recent history to
|
|
110
|
+
"help": "Prompt-level guardrail, not access control. Sends every checked human message and bounded recent history to the configured decision endpoint (defaults to https://codex.unblocklabs.ai/v1/decisions -> OpenRouter liquid/d1.2-ultra) and appends a scenario's flaggedPrompt when an unapproved requestor's message matches. Fails open: if the check cannot run, the turn proceeds without it. Requires hook conversation access and prompt injection. Disabled by default."
|
|
103
111
|
},
|
|
104
112
|
"safetyWhisperer.scenarios": {
|
|
105
113
|
"label": "Safety Scenarios",
|
|
@@ -107,7 +115,7 @@
|
|
|
107
115
|
},
|
|
108
116
|
"people.enabled": {
|
|
109
117
|
"label": "PeopleSQL",
|
|
110
|
-
"help": "Enable the agent-local people store, Slack identity observation and people tools. Disabled by default; whispering and
|
|
118
|
+
"help": "Enable the agent-local people store, Slack identity observation and people tools. Disabled by default; whispering and decision-model primer/review are separate opt-ins."
|
|
111
119
|
},
|
|
112
120
|
"people.whisperer.enabled": {
|
|
113
121
|
"label": "People Whisperer",
|
|
@@ -128,10 +136,10 @@
|
|
|
128
136
|
"type": "object", "additionalProperties": false,
|
|
129
137
|
"properties": {
|
|
130
138
|
"enabled": { "type": "boolean", "default": false },
|
|
131
|
-
"intervalMinutes": { "type": "integer", "minimum": 0, "maximum": 10080
|
|
132
|
-
"maxInteractions": { "type": "integer", "minimum": 1, "maximum": 10000
|
|
133
|
-
"maxContextTokens": { "type": "integer", "minimum": 256, "maximum": 30000
|
|
134
|
-
"baselineMinInteractions": { "type": "integer", "minimum": 1, "maximum": 10000
|
|
139
|
+
"intervalMinutes": { "type": "integer", "minimum": 0, "maximum": 10080 },
|
|
140
|
+
"maxInteractions": { "type": "integer", "minimum": 1, "maximum": 10000 },
|
|
141
|
+
"maxContextTokens": { "type": "integer", "minimum": 256, "maximum": 30000 },
|
|
142
|
+
"baselineMinInteractions": { "type": "integer", "minimum": 1, "maximum": 10000 }
|
|
135
143
|
}
|
|
136
144
|
},
|
|
137
145
|
"extraction": {
|
|
@@ -139,13 +147,13 @@
|
|
|
139
147
|
"properties": {
|
|
140
148
|
"enabled": { "type": "boolean", "default": false },
|
|
141
149
|
"publish": { "type": "boolean", "default": false },
|
|
142
|
-
"intervalMinutes": { "type": "integer", "minimum": 0, "maximum": 1440
|
|
150
|
+
"intervalMinutes": { "type": "integer", "minimum": 0, "maximum": 1440 },
|
|
143
151
|
"chatTypes": { "type": "array", "items": { "enum": ["direct", "channel", "group"] }, "default": [] },
|
|
144
|
-
"historyMessages": { "type": "integer", "minimum": 0, "maximum": 20
|
|
145
|
-
"maxBatches": { "type": "integer", "minimum": 1, "maximum": 50
|
|
146
|
-
"minSupport": { "type": "number", "minimum": 0, "maximum": 1
|
|
147
|
-
"minRetention": { "type": "number", "minimum": 0, "maximum": 1
|
|
148
|
-
"minReplacement": { "type": "number", "minimum": 0, "maximum": 1
|
|
152
|
+
"historyMessages": { "type": "integer", "minimum": 0, "maximum": 20 },
|
|
153
|
+
"maxBatches": { "type": "integer", "minimum": 1, "maximum": 50 },
|
|
154
|
+
"minSupport": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
155
|
+
"minRetention": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
156
|
+
"minReplacement": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
149
157
|
}
|
|
150
158
|
},
|
|
151
159
|
"responseAudit": {
|
|
@@ -155,10 +163,10 @@
|
|
|
155
163
|
"sentimentEnabled": { "type": "boolean", "default": true },
|
|
156
164
|
"senderIds": { "type": "array", "maxItems": 50, "items": { "type": "string", "pattern": "\\S" }, "default": [] },
|
|
157
165
|
"chatTypes": { "type": "array", "minItems": 1, "maxItems": 50, "items": { "type": "string", "enum": ["direct", "group", "channel"] }, "default": ["direct"] },
|
|
158
|
-
"historyMessages": { "type": "integer", "minimum": 0, "maximum": 20
|
|
159
|
-
"lookbackDays": { "type": "integer", "minimum": 1, "maximum": 90
|
|
160
|
-
"maxEpisodes": { "type": "integer", "minimum": 1, "maximum": 100
|
|
161
|
-
"intervalMinutes": { "type": "integer", "minimum": 0, "maximum": 1440
|
|
166
|
+
"historyMessages": { "type": "integer", "minimum": 0, "maximum": 20 },
|
|
167
|
+
"lookbackDays": { "type": "integer", "minimum": 1, "maximum": 90 },
|
|
168
|
+
"maxEpisodes": { "type": "integer", "minimum": 1, "maximum": 100 },
|
|
169
|
+
"intervalMinutes": { "type": "integer", "minimum": 0, "maximum": 1440 },
|
|
162
170
|
"memoryCorpora": { "type": "array", "maxItems": 50, "items": { "type": "string", "pattern": "\\S" }, "default": [] }
|
|
163
171
|
}
|
|
164
172
|
},
|
|
@@ -168,9 +176,9 @@
|
|
|
168
176
|
"properties": {
|
|
169
177
|
"enabled": { "type": "boolean", "default": false },
|
|
170
178
|
"corpora": { "type": "array", "items": { "type": "string", "pattern": "\\S" }, "default": [] },
|
|
171
|
-
"minNoise": { "type": "number", "minimum": 0, "maximum": 1
|
|
179
|
+
"minNoise": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
172
180
|
},
|
|
173
|
-
"default": { "enabled": false, "corpora": []
|
|
181
|
+
"default": { "enabled": false, "corpora": [] }
|
|
174
182
|
},
|
|
175
183
|
"peoplePrimer": {
|
|
176
184
|
"type": "object", "additionalProperties": false,
|
|
@@ -284,17 +292,16 @@
|
|
|
284
292
|
"additionalProperties": false,
|
|
285
293
|
"properties": {
|
|
286
294
|
"enabled": { "type": "boolean", "default": false },
|
|
287
|
-
"maxChars": { "type": "integer", "minimum": 1, "maximum": 4000
|
|
295
|
+
"maxChars": { "type": "integer", "minimum": 1, "maximum": 4000 }
|
|
288
296
|
},
|
|
289
|
-
"default": { "enabled": false
|
|
297
|
+
"default": { "enabled": false }
|
|
290
298
|
},
|
|
291
299
|
"todos": {
|
|
292
300
|
"type": "object",
|
|
293
301
|
"additionalProperties": false,
|
|
294
302
|
"properties": {
|
|
295
|
-
"maxOpen": { "type": "integer", "minimum": 1, "maximum": 10000
|
|
296
|
-
}
|
|
297
|
-
"default": { "maxOpen": 1000 }
|
|
303
|
+
"maxOpen": { "type": "integer", "minimum": 1, "maximum": 10000 }
|
|
304
|
+
}
|
|
298
305
|
},
|
|
299
306
|
"learning": {
|
|
300
307
|
"type": "object", "additionalProperties": false,
|
|
@@ -325,21 +332,25 @@
|
|
|
325
332
|
},
|
|
326
333
|
"default": {
|
|
327
334
|
"enabled": false,
|
|
328
|
-
"whisperer": { "enabled": false
|
|
329
|
-
"todos": { "maxOpen": 1000 }
|
|
335
|
+
"whisperer": { "enabled": false }
|
|
330
336
|
}
|
|
331
337
|
},
|
|
332
|
-
"
|
|
338
|
+
"decisionModel": {
|
|
333
339
|
"type": "object",
|
|
334
340
|
"additionalProperties": false,
|
|
335
341
|
"not": { "required": ["apiKey", "apiKeyFile"] },
|
|
336
342
|
"properties": {
|
|
337
343
|
"enabled": { "type": "boolean", "default": true },
|
|
344
|
+
"endpoint": {
|
|
345
|
+
"type": "string",
|
|
346
|
+
"format": "uri",
|
|
347
|
+
"pattern": "^[Hh][Tt][Tt][Pp](?:[Ss]://(?:\\[[0-9A-Fa-f:.]+\\]|[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?\\.?)|://(?:[Ll][Oo][Cc][Aa][Ll][Hh][Oo][Ss][Tt]|127\\.0\\.0\\.1|\\[::1\\]))(?::\\d+)?(?:/[^\\s?#]*)?$"
|
|
348
|
+
},
|
|
349
|
+
"model": { "type": "string", "pattern": "\\S" },
|
|
338
350
|
"apiKey": { "type": "string", "pattern": "\\S" },
|
|
339
351
|
"apiKeyFile": { "type": "string", "pattern": "\\S" },
|
|
340
|
-
"timeoutMs": { "type": "integer", "minimum": 1, "maximum": 10000
|
|
341
|
-
}
|
|
342
|
-
"default": { "enabled": true, "timeoutMs": 1500 }
|
|
352
|
+
"timeoutMs": { "type": "integer", "minimum": 1, "maximum": 10000 }
|
|
353
|
+
}
|
|
343
354
|
},
|
|
344
355
|
"memoryWhisperer": {
|
|
345
356
|
"type": "object",
|
|
@@ -347,12 +358,11 @@
|
|
|
347
358
|
"properties": {
|
|
348
359
|
"api": {
|
|
349
360
|
"type": "object", "additionalProperties": false,
|
|
350
|
-
"description": "
|
|
361
|
+
"description": "Optional authenticated query-model API. An empty or omitted endpoint uses deterministic local queries unless overridden by operational defaults.",
|
|
351
362
|
"properties": {
|
|
352
|
-
"endpoint": { "type": "string", "pattern": "^https?://"
|
|
363
|
+
"endpoint": { "type": "string", "pattern": "^(?:$|https?://)" },
|
|
353
364
|
"apiKeyFile": { "type": "string", "pattern": "^/", "description": "Absolute path to the API bearer token file. When unset or unreadable, Memory Whisperer falls back to deterministic local queries." }
|
|
354
|
-
}
|
|
355
|
-
"default": { "endpoint": "http://192.168.1.191:18087" }
|
|
365
|
+
}
|
|
356
366
|
},
|
|
357
367
|
"mlx": {
|
|
358
368
|
"type": "object", "additionalProperties": false,
|
|
@@ -363,25 +373,23 @@
|
|
|
363
373
|
"modelPath": { "type": "string", "pattern": "^/" }
|
|
364
374
|
}
|
|
365
375
|
},
|
|
366
|
-
"complementaryHints": { "type": "boolean", "default": false, "description": "Optionally remove confidently redundant hints with
|
|
376
|
+
"complementaryHints": { "type": "boolean", "default": false, "description": "Optionally remove confidently redundant hints with one decision-model request per directional pair. Uncertainty retains hints." },
|
|
367
377
|
"enabled": { "type": "boolean", "default": false },
|
|
368
378
|
"corpora": { "type": "array", "items": { "type": "string", "pattern": "\\S" }, "default": [] },
|
|
369
|
-
"minUsefulness": { "type": "number", "minimum": 0, "maximum": 1
|
|
370
|
-
"maxHints": { "type": "integer", "minimum": 1, "maximum": 3
|
|
371
|
-
"cooldownTurns": { "type": "integer", "minimum": 0, "maximum": 1000
|
|
372
|
-
"timeoutMs": { "type": "integer", "minimum": 1, "maximum": 10000
|
|
379
|
+
"minUsefulness": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
380
|
+
"maxHints": { "type": "integer", "minimum": 1, "maximum": 3 },
|
|
381
|
+
"cooldownTurns": { "type": "integer", "minimum": 0, "maximum": 1000 },
|
|
382
|
+
"timeoutMs": { "type": "integer", "minimum": 1, "maximum": 10000 }
|
|
373
383
|
},
|
|
374
384
|
"default": {
|
|
375
|
-
"enabled": false, "corpora": []
|
|
376
|
-
"maxHints": 3, "cooldownTurns": 10, "timeoutMs": 3000,
|
|
377
|
-
"api": { "endpoint": "http://192.168.1.191:18087" }
|
|
385
|
+
"enabled": false, "corpora": []
|
|
378
386
|
}
|
|
379
387
|
},
|
|
380
388
|
"myTurn": {
|
|
381
389
|
"type": "object", "additionalProperties": false,
|
|
382
390
|
"properties": {
|
|
383
391
|
"enabled": { "type": "boolean", "default": false },
|
|
384
|
-
"historyMessages": { "type": "integer", "minimum": 1, "maximum": 50
|
|
392
|
+
"historyMessages": { "type": "integer", "minimum": 1, "maximum": 50 },
|
|
385
393
|
"channels": {
|
|
386
394
|
"type": "object",
|
|
387
395
|
"propertyNames": { "pattern": "^[a-z0-9][a-z0-9_-]*$" },
|
|
@@ -392,21 +400,16 @@
|
|
|
392
400
|
"default": {}
|
|
393
401
|
}
|
|
394
402
|
},
|
|
395
|
-
"default": { "enabled": false, "
|
|
403
|
+
"default": { "enabled": false, "channels": {} }
|
|
396
404
|
},
|
|
397
405
|
"skillWhisperer": {
|
|
398
406
|
"type": "object",
|
|
399
407
|
"additionalProperties": false,
|
|
400
408
|
"properties": {
|
|
401
409
|
"enabled": { "type": "boolean", "description": "Defaults to true when a corpus with kind \"skills\" is configured, otherwise false. An explicit true without one is ignored with a warning." },
|
|
402
|
-
"historyMessages": { "type": "integer", "minimum": 0
|
|
403
|
-
"minScore": { "type": "number", "minimum": 0, "maximum": 1
|
|
404
|
-
"cooldownTurns": { "type": "integer", "minimum": 0
|
|
405
|
-
},
|
|
406
|
-
"default": {
|
|
407
|
-
"historyMessages": 5,
|
|
408
|
-
"minScore": 0.5,
|
|
409
|
-
"cooldownTurns": 10
|
|
410
|
+
"historyMessages": { "type": "integer", "minimum": 0 },
|
|
411
|
+
"minScore": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
412
|
+
"cooldownTurns": { "type": "integer", "minimum": 0 }
|
|
410
413
|
}
|
|
411
414
|
},
|
|
412
415
|
"safetyWhisperer": {
|
|
@@ -415,8 +418,8 @@
|
|
|
415
418
|
"description": "Optional prompt-level guardrail for sensitive request scenarios. Fails open when the check cannot run.",
|
|
416
419
|
"properties": {
|
|
417
420
|
"enabled": { "type": "boolean", "default": false },
|
|
418
|
-
"historyMessages": { "type": "integer", "minimum": 0, "maximum": 20
|
|
419
|
-
"timeoutMs": { "type": "integer", "minimum": 1, "maximum": 10000
|
|
421
|
+
"historyMessages": { "type": "integer", "minimum": 0, "maximum": 20 },
|
|
422
|
+
"timeoutMs": { "type": "integer", "minimum": 1, "maximum": 10000 },
|
|
420
423
|
"excludedChannels": {
|
|
421
424
|
"type": "array",
|
|
422
425
|
"maxItems": 500,
|
|
@@ -445,7 +448,7 @@
|
|
|
445
448
|
"enabled": { "type": "boolean", "default": true },
|
|
446
449
|
"instructions": { "type": "string", "pattern": "\\S", "maxLength": 2000, "description": "What requests this scenario covers, including exclusions." },
|
|
447
450
|
"flaggedPrompt": { "type": "string", "pattern": "\\S", "maxLength": 2000, "description": "Appended next to the human message when an unapproved requestor's message matches." },
|
|
448
|
-
"minProbability": { "type": "number", "minimum": 0, "maximum": 1, "
|
|
451
|
+
"minProbability": { "type": "number", "minimum": 0, "maximum": 1, "description": "Minimum decision-model yes-probability that the current request is covered." },
|
|
449
452
|
"agentIds": {
|
|
450
453
|
"type": "array",
|
|
451
454
|
"minItems": 1,
|
|
@@ -489,8 +492,6 @@
|
|
|
489
492
|
},
|
|
490
493
|
"default": {
|
|
491
494
|
"enabled": false,
|
|
492
|
-
"historyMessages": 6,
|
|
493
|
-
"timeoutMs": 3000,
|
|
494
495
|
"excludedChannels": [],
|
|
495
496
|
"scenarios": []
|
|
496
497
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unblocklabs/unblock-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Workspace-native memory for OpenClaw, powered by QMD",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
23
|
+
"!dist/defaults.json",
|
|
24
|
+
"defaults.json",
|
|
23
25
|
"src/mlx-query-worker.py",
|
|
24
26
|
"src/query_contract.py",
|
|
25
27
|
"src/query-tokenizer",
|
|
@@ -51,7 +53,8 @@
|
|
|
51
53
|
},
|
|
52
54
|
"dependencies": {
|
|
53
55
|
"@huggingface/tokenizers": "0.2.0",
|
|
54
|
-
"@unblocklabs/
|
|
56
|
+
"@unblocklabs/decisions": "^0.1.3",
|
|
57
|
+
"@unblocklabs/qmd": "3.1.1",
|
|
55
58
|
"chokidar": "5.0.0",
|
|
56
59
|
"js-tiktoken": "1.0.21",
|
|
57
60
|
"picomatch": "^4.0.5",
|
|
@@ -32,7 +32,7 @@ knowledge.
|
|
|
32
32
|
## Investigate
|
|
33
33
|
|
|
34
34
|
For suspected ingestion defects, `memory_review_cluster` inspects a bounded
|
|
35
|
-
center/edge sample using
|
|
35
|
+
center/edge sample using the decision model when quality auditing is enabled. Its findings
|
|
36
36
|
apply only to those members; a shared label is a hypothesis, not permission to
|
|
37
37
|
discard a cluster. Inspect original sources before proposing an ingestion fix.
|
|
38
38
|
|
|
@@ -23,7 +23,7 @@ Research original sources using `memory_people_prime`, `memory_search` and
|
|
|
23
23
|
preferences and working-style feedback, including corrections. Sync sessions with
|
|
24
24
|
`memory_sync_sessions` and inspect `memory_sync_status` when needed. Existing
|
|
25
25
|
dossiers and the agent's earlier assertions are not independent evidence. Do not
|
|
26
|
-
send evidence outside the approved corpora to
|
|
26
|
+
send evidence outside the approved corpora to the decision endpoint.
|
|
27
27
|
|
|
28
28
|
## Store a compact, sourced dossier
|
|
29
29
|
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Type } from "typebox";
|
|
2
|
-
import type { UnblockMemoryConfig } from "./config.js";
|
|
3
|
-
export declare const TYPESAFE_MODEL = "jev-1.13.0";
|
|
4
|
-
export declare const TYPESAFE_NOUL_SCHEMA: Type.TObject<{
|
|
5
|
-
type: Type.TLiteral<"noul">;
|
|
6
|
-
noul: Type.TNumber;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const TYPESAFE_NOUL_ANSWERS_SCHEMA: Type.TObject<{
|
|
9
|
-
answers: Type.TRecord<"^.*$", Type.TObject<{
|
|
10
|
-
type: Type.TLiteral<"noul">;
|
|
11
|
-
noul: Type.TNumber;
|
|
12
|
-
}>>;
|
|
13
|
-
}>;
|
|
14
|
-
/** A conservative estimate of serialized size, not Jev's tokenizer. Non-ASCII is budgeted separately. */
|
|
15
|
-
export declare function estimateJevTokens(value: unknown): number;
|
|
16
|
-
export declare class TypeSafeRequestError extends Error {
|
|
17
|
-
readonly code: "timeout" | "cancelled" | "http_error" | "invalid_response" | "network_error";
|
|
18
|
-
readonly status?: number | undefined;
|
|
19
|
-
constructor(message: string, code: "timeout" | "cancelled" | "http_error" | "invalid_response" | "network_error", status?: number | undefined);
|
|
20
|
-
}
|
|
21
|
-
/** A TypeSafe deadline: the request's own timeout, or the caller's timed-out signal. */
|
|
22
|
-
export declare function isTypeSafeTimeout(error: unknown, signal: AbortSignal): boolean;
|
|
23
|
-
/** Explicit credentials take precedence; a missing explicit file never selects another key. */
|
|
24
|
-
export declare function resolveTypeSafeApiKey(config: UnblockMemoryConfig["typesafe"]): Promise<string | undefined>;
|
|
25
|
-
/** One TypeSafe request. The caller owns the response schema and failure policy. */
|
|
26
|
-
export declare function requestTypeSafe(params: {
|
|
27
|
-
apiKey: string;
|
|
28
|
-
timeoutMs?: number;
|
|
29
|
-
signal?: AbortSignal;
|
|
30
|
-
}, state: unknown, questions: unknown): Promise<unknown>;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { parseEnv } from "node:util";
|
|
3
|
-
import { Type } from "typebox";
|
|
4
|
-
import { abortedByTimeout } from "./abortable.js";
|
|
5
|
-
export const TYPESAFE_MODEL = "jev-1.13.0";
|
|
6
|
-
export const TYPESAFE_NOUL_SCHEMA = Type.Object({
|
|
7
|
-
type: Type.Literal("noul"), noul: Type.Number({ minimum: 0, maximum: 1 }),
|
|
8
|
-
});
|
|
9
|
-
export const TYPESAFE_NOUL_ANSWERS_SCHEMA = Type.Object({ answers: Type.Record(Type.String(), TYPESAFE_NOUL_SCHEMA) });
|
|
10
|
-
/** A conservative estimate of serialized size, not Jev's tokenizer. Non-ASCII is budgeted separately. */
|
|
11
|
-
export function estimateJevTokens(value) {
|
|
12
|
-
let n = 0;
|
|
13
|
-
for (const c of JSON.stringify(value))
|
|
14
|
-
n += c.codePointAt(0) < 128 ? 1 / 3 : 2;
|
|
15
|
-
return Math.ceil(n);
|
|
16
|
-
}
|
|
17
|
-
export class TypeSafeRequestError extends Error {
|
|
18
|
-
code;
|
|
19
|
-
status;
|
|
20
|
-
constructor(message, code, status) {
|
|
21
|
-
super(message);
|
|
22
|
-
this.code = code;
|
|
23
|
-
this.status = status;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/** A TypeSafe deadline: the request's own timeout, or the caller's timed-out signal. */
|
|
27
|
-
export function isTypeSafeTimeout(error, signal) {
|
|
28
|
-
return (error instanceof TypeSafeRequestError && error.code === "timeout") || abortedByTimeout(signal);
|
|
29
|
-
}
|
|
30
|
-
/** Explicit credentials take precedence; a missing explicit file never selects another key. */
|
|
31
|
-
export async function resolveTypeSafeApiKey(config) {
|
|
32
|
-
if (!config.enabled)
|
|
33
|
-
return undefined;
|
|
34
|
-
if (config.apiKey)
|
|
35
|
-
return config.apiKey.trim() || undefined;
|
|
36
|
-
if (!config.apiKeyFile)
|
|
37
|
-
return process.env.TYPESAFE_API_KEY?.trim() || undefined;
|
|
38
|
-
let contents;
|
|
39
|
-
try {
|
|
40
|
-
contents = (await readFile(config.apiKeyFile, "utf8")).trim();
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT")
|
|
44
|
-
return undefined;
|
|
45
|
-
throw new Error("TypeSafe credential file could not be read");
|
|
46
|
-
}
|
|
47
|
-
if (!contents)
|
|
48
|
-
return undefined;
|
|
49
|
-
if (/^(?:export\s+)?[A-Za-z_][A-Za-z0-9_]*\s*=/m.test(contents) || contents.startsWith("#")) {
|
|
50
|
-
return parseEnv(contents).TYPESAFE_API_KEY?.trim() || undefined;
|
|
51
|
-
}
|
|
52
|
-
if (/\s/.test(contents))
|
|
53
|
-
throw new Error("TypeSafe credential file must contain a key or dotenv entries");
|
|
54
|
-
return contents;
|
|
55
|
-
}
|
|
56
|
-
/** One TypeSafe request. The caller owns the response schema and failure policy. */
|
|
57
|
-
export async function requestTypeSafe(params, state, questions) {
|
|
58
|
-
const timeout = params.timeoutMs === undefined ? undefined : AbortSignal.timeout(params.timeoutMs);
|
|
59
|
-
const signal = params.signal && timeout ? AbortSignal.any([params.signal, timeout]) : params.signal ?? timeout;
|
|
60
|
-
try {
|
|
61
|
-
signal?.throwIfAborted();
|
|
62
|
-
const response = await fetch("https://api.typesafe.ai/v1/systemone", {
|
|
63
|
-
method: "POST", redirect: "error", signal,
|
|
64
|
-
headers: { Authorization: `Bearer ${params.apiKey}`, "Content-Type": "application/json" },
|
|
65
|
-
body: JSON.stringify({ model: TYPESAFE_MODEL, state, questions }),
|
|
66
|
-
});
|
|
67
|
-
if (!response.ok) {
|
|
68
|
-
try {
|
|
69
|
-
await response.body?.cancel();
|
|
70
|
-
}
|
|
71
|
-
catch { /* Status is authoritative; discard unsafe cancellation detail. */ }
|
|
72
|
-
throw new TypeSafeRequestError(`TypeSafe HTTP ${response.status}`, "http_error", response.status);
|
|
73
|
-
}
|
|
74
|
-
try {
|
|
75
|
-
return await response.json();
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
if (error instanceof SyntaxError)
|
|
79
|
-
throw new TypeSafeRequestError("TypeSafe returned invalid JSON", "invalid_response");
|
|
80
|
-
throw error;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
if (error instanceof TypeSafeRequestError)
|
|
85
|
-
throw error;
|
|
86
|
-
if (signal?.aborted) {
|
|
87
|
-
const timedOut = abortedByTimeout(signal);
|
|
88
|
-
throw new TypeSafeRequestError(timedOut ? "TypeSafe request timed out" : "TypeSafe request cancelled", timedOut ? "timeout" : "cancelled");
|
|
89
|
-
}
|
|
90
|
-
throw new TypeSafeRequestError("TypeSafe request failed", "network_error");
|
|
91
|
-
}
|
|
92
|
-
}
|