openclaw-zero-agency 0.2.2 → 0.2.3
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/dist/index.js +9 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -107,9 +107,14 @@ export default definePluginEntry({
|
|
|
107
107
|
}
|
|
108
108
|
let receipt = null;
|
|
109
109
|
if (candidates.length) {
|
|
110
|
-
const runId = ctx?.runId ?? ctx?.sessionId ??
|
|
111
|
-
receipt = createHash("sha256").update(`${runId}:${candidates[0].id}:${Date.now()}:${randomUUID()}`).digest("hex").slice(0, 16);
|
|
112
|
-
|
|
110
|
+
const runId = ctx?.runId ?? ctx?.sessionId ?? null;
|
|
111
|
+
receipt = createHash("sha256").update(`${runId ?? "global"}:${candidates[0].id}:${Date.now()}:${randomUUID()}`).digest("hex").slice(0, 16);
|
|
112
|
+
const rec = { id: receipt, pack: candidates[0].pack, at: Date.now(), expires: Date.now() + ttl };
|
|
113
|
+
// Tool context does not always carry runId; always publish a global
|
|
114
|
+
// receipt so the gate can match when the tool cannot see the run.
|
|
115
|
+
if (runId)
|
|
116
|
+
store().set(runId, rec);
|
|
117
|
+
store().set("global", rec);
|
|
113
118
|
prune();
|
|
114
119
|
}
|
|
115
120
|
await telemetry(telemetryPath, { kind: "route", agent: ctx?.agentId ?? null, session: ctx?.sessionKey ?? null, query: params.task.slice(0, 200), selected: candidates[0]?.id ?? null, candidates: candidates.length, receipt });
|
|
@@ -137,7 +142,7 @@ export default definePluginEntry({
|
|
|
137
142
|
return undefined;
|
|
138
143
|
const runId = event?.runId ?? ctx?.runId ?? "unknown-run";
|
|
139
144
|
prune();
|
|
140
|
-
const r = store().get(runId);
|
|
145
|
+
const r = (runId && store().get(runId)) || store().get("global");
|
|
141
146
|
if (r) {
|
|
142
147
|
await telemetry(telemetryPath, { kind: "gate", decision: "receipt-ok", tool: event?.toolName, runId, receipt: r.id });
|
|
143
148
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-zero-agency",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Zero Agency: capability packs, programmatic routing and a receipt gate for OpenClaw. Packs inform judgement; they never confer authority.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|