@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.
Files changed (54) hide show
  1. package/LICENSE +21 -661
  2. package/README.md +1 -0
  3. package/dist/build-before-turn-artifact-NPUHVWFE.js +71 -0
  4. package/dist/build-recall-artifact-F3LS3PZX.js +62 -0
  5. package/dist/chunk-5AXMFBHR.js +14 -0
  6. package/dist/chunk-5AYIXQRF.js +4452 -0
  7. package/dist/chunk-5TIP2EPP.js +6944 -0
  8. package/dist/chunk-GAERET5Q.js +2070 -0
  9. package/dist/chunk-GF3PX3VM.js +41 -0
  10. package/dist/chunk-GKZQ5AG5.js +44 -0
  11. package/dist/chunk-LDJN7CVU.js +3231 -0
  12. package/dist/chunk-MC3C2XM5.js +148 -0
  13. package/dist/chunk-NBS62ES5.js +3012 -0
  14. package/dist/chunk-NSLTJBUC.js +270 -0
  15. package/dist/chunk-OJSIZDZD.js +9 -0
  16. package/dist/chunk-OWGQWQUP.js +45 -0
  17. package/dist/chunk-Q5UTJXHZ.js +1069 -0
  18. package/dist/chunk-SOQW7356.js +2416 -0
  19. package/dist/chunk-VBPYU7GO.js +597 -0
  20. package/dist/chunk-VTHBPXDQ.js +1750 -0
  21. package/dist/chunk-XFJ4S4G2.js +1679 -0
  22. package/dist/chunk-Y5NB3FTH.js +106 -0
  23. package/dist/chunk-ZX55JBV2.js +4451 -0
  24. package/dist/index.js +1905 -15298
  25. package/dist/lifecycle-checkpoint-IAC5FCQU.js +154 -0
  26. package/dist/scan-6JKPOQHD.js +6 -0
  27. package/dist/service-EKFACEN6.js +15 -0
  28. package/dist/service-RHNB5AEQ.js +861 -0
  29. package/dist/sink-AUAAWC5O.js +8 -0
  30. package/openclaw.plugin.json +148 -11
  31. package/package.json +7 -5
  32. package/dist/anthropic-RE4XNAKE.js +0 -5515
  33. package/dist/azure-openai-responses-IQLXOCZS.js +0 -190
  34. package/dist/chunk-6DQXEU2A.js +0 -32306
  35. package/dist/chunk-EAQYK3U2.js +0 -41
  36. package/dist/chunk-HNWLZUWE.js +0 -31
  37. package/dist/chunk-JRUUYSFL.js +0 -262
  38. package/dist/chunk-OLOUBEE5.js +0 -14022
  39. package/dist/chunk-P5HNPYGQ.js +0 -174
  40. package/dist/chunk-RD7BUOBD.js +0 -416
  41. package/dist/chunk-RWWH2U4W.js +0 -7056
  42. package/dist/chunk-SEOMNQGB.js +0 -86
  43. package/dist/chunk-SQLXP7LT.js +0 -4792
  44. package/dist/chunk-URGOKODJ.js +0 -17
  45. package/dist/dist-R6ESEJ6P.js +0 -1244
  46. package/dist/google-NAVXTQLO.js +0 -371
  47. package/dist/google-gemini-cli-NKYJWHX2.js +0 -712
  48. package/dist/google-vertex-ZBJ2EDRH.js +0 -414
  49. package/dist/mistral-SBQYC4J5.js +0 -38407
  50. package/dist/multipart-parser-DV373IRF.js +0 -371
  51. package/dist/openai-codex-responses-XN3T3DEN.js +0 -712
  52. package/dist/openai-completions-75ZFOFU6.js +0 -657
  53. package/dist/openai-responses-DCK4BVNT.js +0 -198
  54. package/dist/src-T5RRS2HN.js +0 -1408
@@ -0,0 +1,106 @@
1
+ // src/adapters/openclaw/debug/sink.ts
2
+ import { appendFile, mkdir } from "fs/promises";
3
+ import path from "path";
4
+ var NOOP_SINK = {
5
+ enabled: false,
6
+ eventLevel: "basic",
7
+ maxTopCandidates: 0,
8
+ async emit() {
9
+ return;
10
+ },
11
+ async close() {
12
+ return;
13
+ }
14
+ };
15
+ function createNoopAgenrDebugSink() {
16
+ return NOOP_SINK;
17
+ }
18
+ function createAgenrDebugSink(config) {
19
+ if (!config.enabled || !config.logPath) {
20
+ return NOOP_SINK;
21
+ }
22
+ const basePath = config.logPath;
23
+ const perSessionFiles = config.perSessionFiles;
24
+ const eventLevel = config.eventLevel;
25
+ const maxTopCandidates = config.maxTopCandidates;
26
+ const directoriesEnsured = /* @__PURE__ */ new Set();
27
+ let writeChain = Promise.resolve();
28
+ let closed = false;
29
+ const ensureDirectoryOnce = async (filePath) => {
30
+ const directory = path.dirname(filePath);
31
+ if (directoriesEnsured.has(directory)) {
32
+ return;
33
+ }
34
+ await mkdir(directory, { recursive: true });
35
+ directoriesEnsured.add(directory);
36
+ };
37
+ const resolveFilePath = (event) => {
38
+ if (!perSessionFiles) {
39
+ return basePath;
40
+ }
41
+ const sessionSuffix = sanitizeSessionSuffix(event.sessionId) ?? sanitizeSessionSuffix(event.sessionKey);
42
+ if (!sessionSuffix) {
43
+ return basePath;
44
+ }
45
+ const directory = path.dirname(basePath);
46
+ const extension = path.extname(basePath);
47
+ const baseName = path.basename(basePath, extension);
48
+ const suffixed = `${baseName}.${sessionSuffix}${extension || ".jsonl"}`;
49
+ return path.join(directory, suffixed);
50
+ };
51
+ const writeLine = async (filePath, line) => {
52
+ await ensureDirectoryOnce(filePath);
53
+ await appendFile(filePath, `${line}
54
+ `, "utf8");
55
+ };
56
+ return {
57
+ enabled: true,
58
+ eventLevel,
59
+ maxTopCandidates,
60
+ logPath: basePath,
61
+ async emit(event) {
62
+ if (closed) {
63
+ return;
64
+ }
65
+ const filePath = resolveFilePath(event);
66
+ const line = formatEventLine(event);
67
+ writeChain = writeChain.then(async () => {
68
+ try {
69
+ await writeLine(filePath, line);
70
+ } catch {
71
+ }
72
+ });
73
+ await writeChain;
74
+ },
75
+ async close() {
76
+ closed = true;
77
+ await writeChain;
78
+ }
79
+ };
80
+ }
81
+ function formatEventLine(event) {
82
+ const line = {
83
+ ts: (/* @__PURE__ */ new Date()).toISOString(),
84
+ ...event
85
+ };
86
+ return JSON.stringify(line);
87
+ }
88
+ function sanitizeSessionSuffix(value) {
89
+ if (typeof value !== "string") {
90
+ return void 0;
91
+ }
92
+ const trimmed = value.trim();
93
+ if (trimmed.length === 0) {
94
+ return void 0;
95
+ }
96
+ const sanitized = trimmed.replace(/[^A-Za-z0-9._-]+/gu, "_");
97
+ if (sanitized.length === 0) {
98
+ return void 0;
99
+ }
100
+ return sanitized.slice(0, 120);
101
+ }
102
+
103
+ export {
104
+ createNoopAgenrDebugSink,
105
+ createAgenrDebugSink
106
+ };