@fidacy/openclaw-plugin 0.1.2 → 0.1.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/CHANGELOG.md +5 -0
- package/dist/index.js +52 -6
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -25,3 +25,8 @@ First release. Fidacy payment firewall as a native OpenClaw plugin:
|
|
|
25
25
|
ClawHub-native adoption is attributable (was indistinguishable from MCP).
|
|
26
26
|
- DENY responses now point to the `fidacy_upgrade` tool.
|
|
27
27
|
- Inherits the self-documenting first-run config + friendlier boot line.
|
|
28
|
+
|
|
29
|
+
## 0.1.3 — 2026-07-02
|
|
30
|
+
|
|
31
|
+
- Same upgrade micro-trigger system as @fidacy/mcp 0.1.11 (once-per-install,
|
|
32
|
+
value-proven moments only), routed through the fidacy_upgrade tool.
|
package/dist/index.js
CHANGED
|
@@ -4564,7 +4564,12 @@ function readConfig() {
|
|
|
4564
4564
|
anon_id: raw.anon_id,
|
|
4565
4565
|
tier: raw.tier === "paid" ? "paid" : "free",
|
|
4566
4566
|
api_key: typeof raw.api_key === "string" ? raw.api_key : null,
|
|
4567
|
-
mandate: raw.mandate
|
|
4567
|
+
mandate: raw.mandate,
|
|
4568
|
+
// Install-state passthrough: dropping these on a read→write cycle would
|
|
4569
|
+
// reset every once-per-install nudge into an every-time nag.
|
|
4570
|
+
created_at: typeof raw.created_at === "string" ? raw.created_at : void 0,
|
|
4571
|
+
nudges: raw.nudges && typeof raw.nudges === "object" ? raw.nudges : void 0,
|
|
4572
|
+
decisions_count: typeof raw.decisions_count === "number" ? raw.decisions_count : void 0
|
|
4568
4573
|
};
|
|
4569
4574
|
} catch {
|
|
4570
4575
|
return null;
|
|
@@ -4582,7 +4587,8 @@ function ensureState() {
|
|
|
4582
4587
|
anon_id: randomUUID2(),
|
|
4583
4588
|
tier: "free",
|
|
4584
4589
|
api_key: null,
|
|
4585
|
-
mandate: { payees: [], categories: ["*"], currency: "USD", perTxMax: 2500, maxTotal: 1e4 }
|
|
4590
|
+
mandate: { payees: [], categories: ["*"], currency: "USD", perTxMax: 2500, maxTotal: 1e4 },
|
|
4591
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4586
4592
|
};
|
|
4587
4593
|
try {
|
|
4588
4594
|
writeConfig(config);
|
|
@@ -4604,7 +4610,7 @@ function resolveMandateRules(cfg) {
|
|
|
4604
4610
|
}
|
|
4605
4611
|
|
|
4606
4612
|
// ../mcp/src/telemetry.ts
|
|
4607
|
-
var CLIENT_VERSION = true ? "0.1.
|
|
4613
|
+
var CLIENT_VERSION = true ? "0.1.3" : "dev";
|
|
4608
4614
|
var currentShell = "mcp";
|
|
4609
4615
|
function setTelemetryShell(shell) {
|
|
4610
4616
|
currentShell = shell;
|
|
@@ -4727,7 +4733,7 @@ function requestUpgrade() {
|
|
|
4727
4733
|
}
|
|
4728
4734
|
|
|
4729
4735
|
// ../mcp/src/provision.ts
|
|
4730
|
-
var CLIENT_VERSION2 = true ? "0.1.
|
|
4736
|
+
var CLIENT_VERSION2 = true ? "0.1.3" : "dev";
|
|
4731
4737
|
function provisionEnabled() {
|
|
4732
4738
|
const v = (process.env.FIDACY_DISABLE_PROVISION ?? "").trim().toLowerCase();
|
|
4733
4739
|
return !(v === "1" || v === "true" || v === "yes");
|
|
@@ -4762,6 +4768,44 @@ async function autoProvision() {
|
|
|
4762
4768
|
}
|
|
4763
4769
|
}
|
|
4764
4770
|
|
|
4771
|
+
// ../mcp/src/nudges.ts
|
|
4772
|
+
function nudgeOnce(key) {
|
|
4773
|
+
const cfg = readConfig();
|
|
4774
|
+
if (!cfg) return false;
|
|
4775
|
+
if (cfg.nudges?.[key]) return false;
|
|
4776
|
+
cfg.nudges = { ...cfg.nudges ?? {}, [key]: true };
|
|
4777
|
+
try {
|
|
4778
|
+
writeConfig(cfg);
|
|
4779
|
+
} catch {
|
|
4780
|
+
return false;
|
|
4781
|
+
}
|
|
4782
|
+
return true;
|
|
4783
|
+
}
|
|
4784
|
+
function bumpDecisionCount() {
|
|
4785
|
+
const cfg = readConfig();
|
|
4786
|
+
if (!cfg) return 0;
|
|
4787
|
+
const n = (cfg.decisions_count ?? 0) + 1;
|
|
4788
|
+
cfg.decisions_count = n;
|
|
4789
|
+
try {
|
|
4790
|
+
writeConfig(cfg);
|
|
4791
|
+
} catch {
|
|
4792
|
+
}
|
|
4793
|
+
return n;
|
|
4794
|
+
}
|
|
4795
|
+
function decisionNudge(status, violatedRule, upgradeToolName) {
|
|
4796
|
+
const count = bumpDecisionCount();
|
|
4797
|
+
if (status === "DENY" && violatedRule?.startsWith("duplicate_invoice") && nudgeOnce("bec_catch")) {
|
|
4798
|
+
return `That was a duplicate-invoice (BEC) catch \u2014 the #1 payment fraud. On a free account every block like this is server-signed and anchored to Bitcoin: court-grade evidence. Call the ${upgradeToolName} tool to start.`;
|
|
4799
|
+
}
|
|
4800
|
+
if (status === "DENY" && nudgeOnce("first_deny")) {
|
|
4801
|
+
return `Fidacy just blocked this for you \u2014 for server-signed, anchored proof of every block (free account, local history migrates), call the ${upgradeToolName} tool.`;
|
|
4802
|
+
}
|
|
4803
|
+
if (count === 10 && nudgeOnce("milestone_10")) {
|
|
4804
|
+
return `That's 10 actions gated on this install. For a signed, Bitcoin-anchored history of all of them (free account), call the ${upgradeToolName} tool.`;
|
|
4805
|
+
}
|
|
4806
|
+
return null;
|
|
4807
|
+
}
|
|
4808
|
+
|
|
4765
4809
|
// ../mcp/src/assess.ts
|
|
4766
4810
|
var AssessError = class extends Error {
|
|
4767
4811
|
type;
|
|
@@ -4942,8 +4986,10 @@ var index_default = defineToolPlugin({
|
|
|
4942
4986
|
}),
|
|
4943
4987
|
async execute(params, config) {
|
|
4944
4988
|
const d = await boot().decide(params, subjectOf(config));
|
|
4945
|
-
const
|
|
4946
|
-
${d.grant}` : `DENY (decision ${d.decisionId}). Rule violated: ${d.violatedRule}. No grant issued, this payment cannot proceed. The denial itself is recorded in the tamper-evident, hash-chained audit: call get_audit_proof with decisionId ${d.decisionId} for the proof of what was blocked
|
|
4989
|
+
const base = d.status === "ALLOW" ? `ALLOW (decision ${d.decisionId})${params.invoiceRef ? ` for invoice ${params.invoiceRef}` : ""}. To settle, call the executor with the SAME payee, amount, currency, and idempotencyKey, and set "grant" to EXACTLY this signed value:
|
|
4990
|
+
${d.grant}` : `DENY (decision ${d.decisionId}). Rule violated: ${d.violatedRule}. No grant issued, this payment cannot proceed. The denial itself is recorded in the tamper-evident, hash-chained audit: call get_audit_proof with decisionId ${d.decisionId} for the proof of what was blocked.`;
|
|
4991
|
+
const nudge = decisionNudge(d.status, d.violatedRule, "fidacy_upgrade");
|
|
4992
|
+
const message = nudge ? `${base} ${nudge}` : base;
|
|
4947
4993
|
return { status: d.status, decisionId: d.decisionId, grant: d.grant, violatedRule: d.violatedRule, message };
|
|
4948
4994
|
}
|
|
4949
4995
|
}),
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "fidacy",
|
|
3
3
|
"name": "Fidacy \u2014 Payment Firewall",
|
|
4
4
|
"description": "A signed, independently-verifiable verdict on every money-moving agent action. Blocks wrong/lookalike payee, over-cap, and duplicate-invoice fraud before money moves. Non-custodial, local-first, deny-by-default.",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.3",
|
|
6
6
|
"contracts": {
|
|
7
7
|
"tools": [
|
|
8
8
|
"request_payment",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fidacy/openclaw-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Fidacy payment firewall as a native OpenClaw plugin: signed, verifiable verdicts on every money-moving agent action, in-process (no MCP subprocess).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://fidacy.com",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"typebox": "1.1.39",
|
|
57
57
|
"typescript": "^5.6.3",
|
|
58
58
|
"@fidacy/firewall": "0.1.0",
|
|
59
|
-
"@fidacy/mcp": "0.1.
|
|
59
|
+
"@fidacy/mcp": "0.1.11"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "node scripts/bundle.mjs",
|