@unblocklabs/unblock-memory 0.3.6 → 0.3.7
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.
|
@@ -123,6 +123,7 @@ function codexPrompt(input) {
|
|
|
123
123
|
"Return only the JSON object required by the supplied output schema.",
|
|
124
124
|
"Preserve useful current claims when evidence still supports them.",
|
|
125
125
|
"Every claim must cite an evidence source and locator already present in the input.",
|
|
126
|
+
"Copy observedAt from the matching supplied evidence and provide confidence for every claim.",
|
|
126
127
|
JSON.stringify(input),
|
|
127
128
|
].join("\n\n");
|
|
128
129
|
}
|
|
@@ -209,6 +210,20 @@ const CODEX_ENV_KEYS = [
|
|
|
209
210
|
function codexEnvironment(source) {
|
|
210
211
|
return Object.fromEntries(CODEX_ENV_KEYS.flatMap((key) => (source[key] === undefined ? [] : [[key, source[key]]])));
|
|
211
212
|
}
|
|
213
|
+
function isRecord(value) {
|
|
214
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
215
|
+
}
|
|
216
|
+
function codexOutputSchema(value) {
|
|
217
|
+
if (Array.isArray(value))
|
|
218
|
+
return value.map(codexOutputSchema);
|
|
219
|
+
if (!isRecord(value))
|
|
220
|
+
return value;
|
|
221
|
+
const schema = Object.fromEntries(Object.entries(value).map(([key, child]) => [key, codexOutputSchema(child)]));
|
|
222
|
+
if (schema.type === "object" && isRecord(schema.properties)) {
|
|
223
|
+
schema.required = Object.keys(schema.properties);
|
|
224
|
+
}
|
|
225
|
+
return schema;
|
|
226
|
+
}
|
|
212
227
|
export function createCodexPeopleRefinementRunner(runCommand = runCodexProcess, options = {}) {
|
|
213
228
|
return async ({ input, outputSchema, signal }) => {
|
|
214
229
|
const scratch = await mkdtemp(join(tmpdir(), "unblock-memory-people-refinement-"));
|
|
@@ -217,7 +232,7 @@ export function createCodexPeopleRefinementRunner(runCommand = runCodexProcess,
|
|
|
217
232
|
try {
|
|
218
233
|
const timeout = AbortSignal.timeout(options.timeoutMs ?? 15 * 60_000);
|
|
219
234
|
const commandSignal = signal ? AbortSignal.any([signal, timeout]) : timeout;
|
|
220
|
-
await writeFile(schemaPath, JSON.stringify(outputSchema), { mode: 0o600 });
|
|
235
|
+
await writeFile(schemaPath, JSON.stringify(codexOutputSchema(outputSchema)), { mode: 0o600 });
|
|
221
236
|
await runCommand({
|
|
222
237
|
executable: "codex",
|
|
223
238
|
args: [
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "unblock-memory",
|
|
3
3
|
"name": "Unblock Memory",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.7",
|
|
5
5
|
"description": "Indexes, retrieves, and analyzes configured workspace memory with existing QMD vectors.",
|
|
6
6
|
"kind": "memory",
|
|
7
7
|
"activation": { "onStartup": false },
|