@fidacy/openclaw-plugin 0.2.8 → 0.2.10

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 01f0734: Two fixes proven against a real OpenClaw host. Install/active telemetry now flushes immediately at plugin load instead of on a 2s timer that died with short-lived CLI commands (openclaw plugins install/list), which is why the plugin channel reported zero despite real installs. And the manifest now declares every registered tool (spend_summary, list_decisions, sentinel_alerts, explain_decision were missing, tripping openclaw plugins doctor); the build stamps contracts.tools from the source so it can never drift again.
8
+
9
+ ## 0.2.9
10
+
11
+ ### Patch Changes
12
+
13
+ - 48e1a28: Rebundle with @fidacy/mcp 0.3.0: the free-trial decision counter now survives the background auto-provision write (it was being wiped, resetting the 20-decision anonymous trial on every restart), and anonymous telemetry counts tool usage (tool_use event, allowlisted tool name only, never content).
14
+
3
15
  ## 0.2.8
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -4709,7 +4709,7 @@ function resolveMandateRules(cfg) {
4709
4709
  }
4710
4710
 
4711
4711
  // ../mcp/src/telemetry.ts
4712
- var CLIENT_VERSION = true ? "0.2.8" : "dev";
4712
+ var CLIENT_VERSION = true ? "0.2.10" : "dev";
4713
4713
  function bandOf(amount) {
4714
4714
  if (typeof amount !== "number" || !Number.isFinite(amount) || amount <= 0) return void 0;
4715
4715
  if (amount < 10) return "lt10";
@@ -4748,6 +4748,14 @@ function anonId() {
4748
4748
  }
4749
4749
  var buffer = [];
4750
4750
  var flushTimer = null;
4751
+ var exitHookArmed = false;
4752
+ function armExitFlush() {
4753
+ if (exitHookArmed || typeof process === "undefined" || typeof process.once !== "function") return;
4754
+ exitHookArmed = true;
4755
+ process.once("beforeExit", () => {
4756
+ if (buffer.length > 0) void flush();
4757
+ });
4758
+ }
4751
4759
  function resultOf(status, violatedRule) {
4752
4760
  if (status === "ALLOW") return "allow";
4753
4761
  const r = violatedRule ?? "";
@@ -4760,8 +4768,9 @@ function resultOf(status, violatedRule) {
4760
4768
  if (r.startsWith("non_positive_amount") || r.startsWith("invalid_")) return "deny_invalid";
4761
4769
  return "deny_scope";
4762
4770
  }
4763
- function record(type, result, band, capRatio) {
4771
+ function record(type, result, band, capRatio, action) {
4764
4772
  if (!telemetryEnabled()) return;
4773
+ armExitFlush();
4765
4774
  buffer.push({
4766
4775
  type,
4767
4776
  ts: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4769,7 +4778,8 @@ function record(type, result, band, capRatio) {
4769
4778
  shell: currentShell,
4770
4779
  ...result ? { result } : {},
4771
4780
  ...band ? { band } : {},
4772
- ...capRatio ? { cap_ratio: capRatio } : {}
4781
+ ...capRatio ? { cap_ratio: capRatio } : {},
4782
+ ...action ? { action } : {}
4773
4783
  });
4774
4784
  if (!flushTimer) {
4775
4785
  flushTimer = setTimeout(() => {
@@ -4887,7 +4897,7 @@ function requestUpgrade() {
4887
4897
  }
4888
4898
 
4889
4899
  // ../mcp/src/provision.ts
4890
- var CLIENT_VERSION2 = true ? "0.2.8" : "dev";
4900
+ var CLIENT_VERSION2 = true ? "0.2.10" : "dev";
4891
4901
  function provisionEnabled() {
4892
4902
  const v = (process.env.FIDACY_DISABLE_PROVISION ?? "").trim().toLowerCase();
4893
4903
  return !(v === "1" || v === "true" || v === "yes");
@@ -4911,8 +4921,9 @@ async function autoProvision() {
4911
4921
  if (!res.ok) return "failed";
4912
4922
  const data = await res.json();
4913
4923
  if (typeof data.api_key !== "string" || !data.api_key) return "failed";
4924
+ const fresh = readConfig() ?? cfg;
4914
4925
  writeConfig({
4915
- ...cfg,
4926
+ ...fresh,
4916
4927
  api_key: data.api_key,
4917
4928
  tier: data.tier === "paid" ? "paid" : "free"
4918
4929
  });
@@ -4947,7 +4958,7 @@ function bumpDecisionCount() {
4947
4958
  sessionDecisions += 1;
4948
4959
  const cfg = readConfig();
4949
4960
  if (!cfg) return sessionDecisions;
4950
- const n = (cfg.decisions_count ?? 0) + 1;
4961
+ const n = Math.max((cfg.decisions_count ?? 0) + 1, sessionDecisions);
4951
4962
  cfg.decisions_count = n;
4952
4963
  try {
4953
4964
  writeConfig(cfg);
@@ -5402,6 +5413,7 @@ function onPluginLoad() {
5402
5413
  const state = ensureState();
5403
5414
  if (state.firstRun) recordInstall();
5404
5415
  recordAgentActive();
5416
+ void flush();
5405
5417
  void autoProvision();
5406
5418
  }
5407
5419
  var core;
@@ -3,12 +3,16 @@
3
3
  "name": "Fidacy — 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
5
  "icon": "https://fidacy.com/logo.png",
6
- "version": "0.2.6",
6
+ "version": "0.2.10",
7
7
  "contracts": {
8
8
  "tools": [
9
9
  "request_payment",
10
10
  "verify_mandate",
11
11
  "get_audit_proof",
12
+ "spend_summary",
13
+ "list_decisions",
14
+ "sentinel_alerts",
15
+ "explain_decision",
12
16
  "assess_action",
13
17
  "anchor_artifact",
14
18
  "check_artifact",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fidacy/openclaw-plugin",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
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
  "author": "Fidacy (ZeepCode Group Technology LLC) <hello@fidacy.com> (https://fidacy.com)",
@@ -57,7 +57,7 @@
57
57
  "typebox": "1.1.39",
58
58
  "typescript": "^5.6.3",
59
59
  "@fidacy/firewall": "0.1.1",
60
- "@fidacy/mcp": "0.2.10"
60
+ "@fidacy/mcp": "0.3.1"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "node scripts/bundle.mjs",