@agenr/openclaw-plugin 1.5.0 → 2026.6.2
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/LICENSE +21 -661
- package/README.md +1 -0
- package/dist/build-before-turn-artifact-NPUHVWFE.js +71 -0
- package/dist/build-recall-artifact-F3LS3PZX.js +62 -0
- package/dist/chunk-5AXMFBHR.js +14 -0
- package/dist/chunk-5AYIXQRF.js +4452 -0
- package/dist/chunk-5TIP2EPP.js +6944 -0
- package/dist/chunk-GAERET5Q.js +2070 -0
- package/dist/chunk-GF3PX3VM.js +41 -0
- package/dist/chunk-GKZQ5AG5.js +44 -0
- package/dist/chunk-LDJN7CVU.js +3231 -0
- package/dist/chunk-MC3C2XM5.js +148 -0
- package/dist/chunk-NBS62ES5.js +3012 -0
- package/dist/chunk-NSLTJBUC.js +270 -0
- package/dist/chunk-OJSIZDZD.js +9 -0
- package/dist/chunk-OWGQWQUP.js +45 -0
- package/dist/chunk-Q5UTJXHZ.js +1069 -0
- package/dist/chunk-SOQW7356.js +2416 -0
- package/dist/chunk-VBPYU7GO.js +597 -0
- package/dist/chunk-VTHBPXDQ.js +1750 -0
- package/dist/chunk-XFJ4S4G2.js +1679 -0
- package/dist/chunk-Y5NB3FTH.js +106 -0
- package/dist/chunk-ZX55JBV2.js +4451 -0
- package/dist/index.js +1905 -15298
- package/dist/lifecycle-checkpoint-IAC5FCQU.js +154 -0
- package/dist/scan-6JKPOQHD.js +6 -0
- package/dist/service-EKFACEN6.js +15 -0
- package/dist/service-RHNB5AEQ.js +861 -0
- package/dist/sink-AUAAWC5O.js +8 -0
- package/openclaw.plugin.json +148 -11
- package/package.json +7 -5
- package/dist/anthropic-RE4XNAKE.js +0 -5515
- package/dist/azure-openai-responses-IQLXOCZS.js +0 -190
- package/dist/chunk-6DQXEU2A.js +0 -32306
- package/dist/chunk-EAQYK3U2.js +0 -41
- package/dist/chunk-HNWLZUWE.js +0 -31
- package/dist/chunk-JRUUYSFL.js +0 -262
- package/dist/chunk-OLOUBEE5.js +0 -14022
- package/dist/chunk-P5HNPYGQ.js +0 -174
- package/dist/chunk-RD7BUOBD.js +0 -416
- package/dist/chunk-RWWH2U4W.js +0 -7056
- package/dist/chunk-SEOMNQGB.js +0 -86
- package/dist/chunk-SQLXP7LT.js +0 -4792
- package/dist/chunk-URGOKODJ.js +0 -17
- package/dist/dist-R6ESEJ6P.js +0 -1244
- package/dist/google-NAVXTQLO.js +0 -371
- package/dist/google-gemini-cli-NKYJWHX2.js +0 -712
- package/dist/google-vertex-ZBJ2EDRH.js +0 -414
- package/dist/mistral-SBQYC4J5.js +0 -38407
- package/dist/multipart-parser-DV373IRF.js +0 -371
- package/dist/openai-codex-responses-XN3T3DEN.js +0 -712
- package/dist/openai-completions-75ZFOFU6.js +0 -657
- package/dist/openai-responses-DCK4BVNT.js +0 -198
- package/dist/src-T5RRS2HN.js +0 -1408
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/core/dreaming/efficiency.ts
|
|
2
|
+
var PROFILE_DURABLE_TOKEN_ESTIMATE = 36;
|
|
3
|
+
var PROFILE_DIRECTIVE_TOKEN_ESTIMATE = 24;
|
|
4
|
+
function buildDreamEfficiencySummary(input) {
|
|
5
|
+
const evidenceItemsRead = input.scan.episodesSinceLastRun + input.scan.ingestFilesSinceLastRun + input.scan.durablesCreatedSinceLastRun;
|
|
6
|
+
const profileInjectionTokenEstimate = estimateProfileInjectionTokens(input.profileDurableCount, input.directiveCount);
|
|
7
|
+
return {
|
|
8
|
+
evidenceItemsRead,
|
|
9
|
+
synthesizedDurableMutations: input.synthesizedDurableMutations,
|
|
10
|
+
costPerSynthesizedDurableUsd: input.synthesizedDurableMutations > 0 ? roundEfficiencyMetric(input.estimatedCostUsd / input.synthesizedDurableMutations) : null,
|
|
11
|
+
profileInjectionTokenEstimate,
|
|
12
|
+
recomputeRatio: evidenceItemsRead === 0 ? 0 : roundEfficiencyMetric(input.synthesizedDurableMutations / evidenceItemsRead)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function deriveDreamEfficiencySummary(summary, estimatedCostUsd) {
|
|
16
|
+
if (!summary.scan || !summary.project) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return buildDreamEfficiencySummary({
|
|
20
|
+
scan: summary.scan,
|
|
21
|
+
estimatedCostUsd,
|
|
22
|
+
synthesizedDurableMutations: countSynthesizedDurableMutations(summary),
|
|
23
|
+
profileDurableCount: summary.project.profileDurableCount,
|
|
24
|
+
directiveCount: summary.project.directiveCount
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function countSynthesizedDurableMutations(summary) {
|
|
28
|
+
return (summary.extract?.durablesInserted ?? 0) + (summary.temporalize?.revisionsApplied ?? 0) + (summary.prune?.durablesStaled ?? 0);
|
|
29
|
+
}
|
|
30
|
+
function estimateProfileInjectionTokens(profileDurableCount, directiveCount) {
|
|
31
|
+
return profileDurableCount * PROFILE_DURABLE_TOKEN_ESTIMATE + directiveCount * PROFILE_DIRECTIVE_TOKEN_ESTIMATE;
|
|
32
|
+
}
|
|
33
|
+
function roundEfficiencyMetric(value) {
|
|
34
|
+
return Number(value.toFixed(6));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
buildDreamEfficiencySummary,
|
|
39
|
+
deriveDreamEfficiencySummary,
|
|
40
|
+
estimateProfileInjectionTokens
|
|
41
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/app/dreaming/scan.ts
|
|
2
|
+
async function runDreamScan(options, deps) {
|
|
3
|
+
const since = await resolveScanSince(options, deps.port);
|
|
4
|
+
const [episodesSinceLastRun, ingestFilesSinceLastRun, durablesCreatedSinceLastRun, unsynthesizedImportanceSum] = await Promise.all([
|
|
5
|
+
deps.port.countEpisodesSince(since, options.project),
|
|
6
|
+
deps.port.countIngestFilesSince(since),
|
|
7
|
+
deps.port.countDurablesCreatedSince(since, options.project),
|
|
8
|
+
deps.port.sumDurableImportanceCreatedSince(since, options.project)
|
|
9
|
+
]);
|
|
10
|
+
const evidenceRefs = [];
|
|
11
|
+
if (ingestFilesSinceLastRun > 0) {
|
|
12
|
+
evidenceRefs.push({
|
|
13
|
+
kind: "ingest_log",
|
|
14
|
+
locator: `since:${since}`,
|
|
15
|
+
observedAt: options.now().toISOString()
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
if (episodesSinceLastRun > 0) {
|
|
19
|
+
evidenceRefs.push({
|
|
20
|
+
kind: "episode",
|
|
21
|
+
locator: `since:${since}`,
|
|
22
|
+
observedAt: options.now().toISOString()
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
episodesSinceLastRun,
|
|
27
|
+
ingestFilesSinceLastRun,
|
|
28
|
+
durablesCreatedSinceLastRun,
|
|
29
|
+
evidenceRefs,
|
|
30
|
+
unsynthesizedImportanceSum
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async function resolveScanSince(options, port) {
|
|
34
|
+
if (options.fullBacklog === true) {
|
|
35
|
+
return "1970-01-01T00:00:00.000Z";
|
|
36
|
+
}
|
|
37
|
+
const lastRun = await port.getLastRun();
|
|
38
|
+
const lastSuccessfulAt = lastRun?.status === "completed" ? lastRun.completedAt : null;
|
|
39
|
+
return lastSuccessfulAt ?? "1970-01-01T00:00:00.000Z";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
runDreamScan
|
|
44
|
+
};
|