@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,148 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildManualClaimKeyLifecycle
|
|
3
|
+
} from "./chunk-VTHBPXDQ.js";
|
|
4
|
+
|
|
5
|
+
// src/core/procedures/hashing.ts
|
|
6
|
+
import { createHash } from "crypto";
|
|
7
|
+
function computeProcedureSourceHash(sourceText) {
|
|
8
|
+
return createHash("sha256").update(sourceText).digest("hex");
|
|
9
|
+
}
|
|
10
|
+
function computeProcedureRevisionHash(procedure) {
|
|
11
|
+
return createHash("sha256").update(stringifyCanonical(procedure)).digest("hex");
|
|
12
|
+
}
|
|
13
|
+
function stringifyCanonical(value) {
|
|
14
|
+
if (value === null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
15
|
+
return JSON.stringify(value);
|
|
16
|
+
}
|
|
17
|
+
if (Array.isArray(value)) {
|
|
18
|
+
return `[${value.map((item) => stringifyCanonical(item)).join(",")}]`;
|
|
19
|
+
}
|
|
20
|
+
const keys = Object.keys(value).sort((left, right) => left.localeCompare(right));
|
|
21
|
+
return `{${keys.map((key) => `${JSON.stringify(key)}:${stringifyCanonical(value[key])}`).join(",")}}`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/core/procedures/recall-text.ts
|
|
25
|
+
function composeProcedureRecallText(procedure) {
|
|
26
|
+
const lines = [
|
|
27
|
+
`procedure_key: ${procedure.procedure_key}`,
|
|
28
|
+
`title: ${procedure.title}`,
|
|
29
|
+
`goal: ${procedure.goal}`,
|
|
30
|
+
...formatSection("when_to_use", procedure.when_to_use),
|
|
31
|
+
...formatSection("when_not_to_use", procedure.when_not_to_use),
|
|
32
|
+
...formatSection("prerequisites", procedure.prerequisites),
|
|
33
|
+
"steps:",
|
|
34
|
+
...procedure.steps.flatMap((step, index) => formatStep(step, index)),
|
|
35
|
+
...formatSection("verification", procedure.verification),
|
|
36
|
+
...formatSection("failure_modes", procedure.failure_modes),
|
|
37
|
+
"sources:",
|
|
38
|
+
...procedure.sources.map((source, index) => ` ${index + 1}. ${formatSource(source)}`)
|
|
39
|
+
];
|
|
40
|
+
return lines.join("\n");
|
|
41
|
+
}
|
|
42
|
+
function formatSection(label, values) {
|
|
43
|
+
if (values.length === 0) {
|
|
44
|
+
return [`${label}: none`];
|
|
45
|
+
}
|
|
46
|
+
return [`${label}:`, ...values.map((value, index) => ` ${index + 1}. ${value}`)];
|
|
47
|
+
}
|
|
48
|
+
function formatStep(step, index) {
|
|
49
|
+
const lines = [` ${index + 1}. [${step.kind}] ${step.id} - ${step.instruction}`];
|
|
50
|
+
switch (step.kind) {
|
|
51
|
+
case "run_command":
|
|
52
|
+
lines.push(` command: ${step.command}`);
|
|
53
|
+
break;
|
|
54
|
+
case "read_reference":
|
|
55
|
+
lines.push(` ref: ${formatSource(step.ref)}`);
|
|
56
|
+
break;
|
|
57
|
+
case "inspect_state":
|
|
58
|
+
if (step.target) {
|
|
59
|
+
lines.push(` target: ${step.target}`);
|
|
60
|
+
}
|
|
61
|
+
if (step.query) {
|
|
62
|
+
lines.push(` query: ${step.query}`);
|
|
63
|
+
}
|
|
64
|
+
break;
|
|
65
|
+
case "edit_file":
|
|
66
|
+
lines.push(` path: ${step.path}`);
|
|
67
|
+
lines.push(` edit: ${step.edit}`);
|
|
68
|
+
break;
|
|
69
|
+
case "ask_user":
|
|
70
|
+
lines.push(` prompt: ${step.prompt}`);
|
|
71
|
+
break;
|
|
72
|
+
case "invoke_tool":
|
|
73
|
+
lines.push(` tool: ${step.tool}`);
|
|
74
|
+
if (step.arguments) {
|
|
75
|
+
lines.push(` arguments: ${JSON.stringify(step.arguments)}`);
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
case "verify":
|
|
79
|
+
lines.push(...step.checks.map((check, checkIndex) => ` check ${checkIndex + 1}: ${check}`));
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
if (step.conditions?.length) {
|
|
83
|
+
lines.push(` conditions: ${step.conditions.map((condition) => formatCondition(condition)).join("; ")}`);
|
|
84
|
+
}
|
|
85
|
+
if (step.stop_if?.length) {
|
|
86
|
+
lines.push(` stop_if: ${step.stop_if.map((condition) => formatCondition(condition)).join("; ")}`);
|
|
87
|
+
}
|
|
88
|
+
return lines;
|
|
89
|
+
}
|
|
90
|
+
function formatCondition(condition) {
|
|
91
|
+
switch (condition.kind) {
|
|
92
|
+
case "file_exists":
|
|
93
|
+
case "path_exists":
|
|
94
|
+
return `${condition.kind}=${condition.path}`;
|
|
95
|
+
case "env_flag":
|
|
96
|
+
return condition.value ? `${condition.kind}=${condition.name}:${condition.value}` : `${condition.kind}=${condition.name}`;
|
|
97
|
+
default:
|
|
98
|
+
return `${condition.kind}=${condition.value}`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function formatSource(source) {
|
|
102
|
+
const parts = [source.kind];
|
|
103
|
+
if (source.path) {
|
|
104
|
+
parts.push(`path=${source.path}`);
|
|
105
|
+
}
|
|
106
|
+
if (source.locator) {
|
|
107
|
+
parts.push(`locator=${source.locator}`);
|
|
108
|
+
}
|
|
109
|
+
if (source.label) {
|
|
110
|
+
parts.push(`label=${source.label}`);
|
|
111
|
+
}
|
|
112
|
+
return parts.join(" ");
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// src/app/fixtures/default-claim-key-lifecycle.ts
|
|
116
|
+
function applyDefaultClaimKeyLifecycle(durable, rationale) {
|
|
117
|
+
const claimKey = durable.claim_key?.trim();
|
|
118
|
+
if (!claimKey || durable.claim_key_status) {
|
|
119
|
+
return durable;
|
|
120
|
+
}
|
|
121
|
+
const lifecycle = buildManualClaimKeyLifecycle({
|
|
122
|
+
claimKey,
|
|
123
|
+
rawClaimKey: durable.claim_key_raw ?? durable.claim_key,
|
|
124
|
+
supportSourceKind: durable.claim_support_source_kind,
|
|
125
|
+
supportLocator: durable.claim_support_locator,
|
|
126
|
+
supportObservedAt: durable.claim_support_observed_at,
|
|
127
|
+
supportMode: durable.claim_support_mode
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
...durable,
|
|
131
|
+
claim_key_raw: durable.claim_key_raw ?? lifecycle.claim_key_raw,
|
|
132
|
+
claim_key_status: lifecycle.claim_key_status,
|
|
133
|
+
claim_key_source: durable.claim_key_source ?? lifecycle.claim_key_source,
|
|
134
|
+
claim_key_confidence: durable.claim_key_confidence ?? lifecycle.claim_key_confidence,
|
|
135
|
+
claim_key_rationale: durable.claim_key_rationale ?? rationale,
|
|
136
|
+
claim_support_source_kind: durable.claim_support_source_kind ?? lifecycle.claim_support_source_kind,
|
|
137
|
+
claim_support_locator: durable.claim_support_locator ?? lifecycle.claim_support_locator,
|
|
138
|
+
claim_support_observed_at: durable.claim_support_observed_at ?? lifecycle.claim_support_observed_at,
|
|
139
|
+
claim_support_mode: durable.claim_support_mode ?? lifecycle.claim_support_mode
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export {
|
|
144
|
+
computeProcedureSourceHash,
|
|
145
|
+
computeProcedureRevisionHash,
|
|
146
|
+
composeProcedureRecallText,
|
|
147
|
+
applyDefaultClaimKeyLifecycle
|
|
148
|
+
};
|