@fidacy/mcp 0.2.0 → 0.2.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/dist/core.js +2 -1
- package/dist/index.js +12 -7
- package/dist/lib.js +11 -6
- package/package.json +10 -9
package/dist/core.js
CHANGED
|
@@ -442,7 +442,7 @@ function resolveMandateRules(cfg) {
|
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
// src/telemetry.ts
|
|
445
|
-
var CLIENT_VERSION = true ? "0.2.
|
|
445
|
+
var CLIENT_VERSION = true ? "0.2.2" : "dev";
|
|
446
446
|
function bandOf(amount) {
|
|
447
447
|
if (typeof amount !== "number" || !Number.isFinite(amount) || amount <= 0) return void 0;
|
|
448
448
|
if (amount < 10) return "lt10";
|
|
@@ -600,5 +600,6 @@ function makeCore() {
|
|
|
600
600
|
};
|
|
601
601
|
}
|
|
602
602
|
export {
|
|
603
|
+
DevFidacyCore,
|
|
603
604
|
makeCore
|
|
604
605
|
};
|
package/dist/index.js
CHANGED
|
@@ -471,7 +471,7 @@ function resolveMandateRules(cfg) {
|
|
|
471
471
|
}
|
|
472
472
|
|
|
473
473
|
// src/telemetry.ts
|
|
474
|
-
var CLIENT_VERSION = true ? "0.2.
|
|
474
|
+
var CLIENT_VERSION = true ? "0.2.2" : "dev";
|
|
475
475
|
function bandOf(amount) {
|
|
476
476
|
if (typeof amount !== "number" || !Number.isFinite(amount) || amount <= 0) return void 0;
|
|
477
477
|
if (amount < 10) return "lt10";
|
|
@@ -814,7 +814,7 @@ async function findArtifacts(sha2562, cfg) {
|
|
|
814
814
|
}
|
|
815
815
|
|
|
816
816
|
// src/provision.ts
|
|
817
|
-
var CLIENT_VERSION2 = true ? "0.2.
|
|
817
|
+
var CLIENT_VERSION2 = true ? "0.2.2" : "dev";
|
|
818
818
|
function provisionEnabled() {
|
|
819
819
|
const v = (process.env.FIDACY_DISABLE_PROVISION ?? "").trim().toLowerCase();
|
|
820
820
|
return !(v === "1" || v === "true" || v === "yes");
|
|
@@ -878,16 +878,21 @@ function nudgeOnce(key) {
|
|
|
878
878
|
}
|
|
879
879
|
return true;
|
|
880
880
|
}
|
|
881
|
+
var sessionDecisions = 0;
|
|
882
|
+
function sessionDecisionCount() {
|
|
883
|
+
return sessionDecisions;
|
|
884
|
+
}
|
|
881
885
|
function bumpDecisionCount() {
|
|
886
|
+
sessionDecisions += 1;
|
|
882
887
|
const cfg = readConfig();
|
|
883
|
-
if (!cfg) return
|
|
888
|
+
if (!cfg) return sessionDecisions;
|
|
884
889
|
const n = (cfg.decisions_count ?? 0) + 1;
|
|
885
890
|
cfg.decisions_count = n;
|
|
886
891
|
try {
|
|
887
892
|
writeConfig(cfg);
|
|
888
893
|
} catch {
|
|
889
894
|
}
|
|
890
|
-
return n;
|
|
895
|
+
return Math.max(n, sessionDecisions);
|
|
891
896
|
}
|
|
892
897
|
function installAgeDays() {
|
|
893
898
|
const t = Date.parse(readConfig()?.created_at ?? "");
|
|
@@ -942,7 +947,7 @@ function hasEngineKey(keyOverride) {
|
|
|
942
947
|
return Boolean((keyOverride ?? process.env.FIDACY_ENGINE_API_KEY ?? "").trim());
|
|
943
948
|
}
|
|
944
949
|
function decisionsUsed() {
|
|
945
|
-
return readConfig()?.decisions_count ?? 0;
|
|
950
|
+
return Math.max(readConfig()?.decisions_count ?? 0, sessionDecisionCount());
|
|
946
951
|
}
|
|
947
952
|
function remainingFree() {
|
|
948
953
|
return Math.max(0, FREE_DECISIONS - decisionsUsed());
|
|
@@ -961,7 +966,7 @@ function activationGate(keyOverride) {
|
|
|
961
966
|
}
|
|
962
967
|
function trialCountdownLine(keyOverride) {
|
|
963
968
|
if (hasEngineKey(keyOverride)) return null;
|
|
964
|
-
if (!readConfig()) return null;
|
|
969
|
+
if (!readConfig() && sessionDecisionCount() === 0) return null;
|
|
965
970
|
const left = remainingFree();
|
|
966
971
|
if (left > 5) return null;
|
|
967
972
|
const url = claimDestination();
|
|
@@ -984,7 +989,7 @@ function activationBootLine() {
|
|
|
984
989
|
var state = ensureState();
|
|
985
990
|
var core = makeCore();
|
|
986
991
|
var subject = process.env.FIDACY_SUBJECT ?? "agent:demo";
|
|
987
|
-
var SERVER_VERSION = true ? "0.2.
|
|
992
|
+
var SERVER_VERSION = true ? "0.2.2" : "dev";
|
|
988
993
|
var bootClaim = claimUrl();
|
|
989
994
|
var server = new McpServer(
|
|
990
995
|
{ name: "fidacy", version: SERVER_VERSION },
|
package/dist/lib.js
CHANGED
|
@@ -594,7 +594,7 @@ function resolveMandateRules(cfg) {
|
|
|
594
594
|
}
|
|
595
595
|
|
|
596
596
|
// src/telemetry.ts
|
|
597
|
-
var CLIENT_VERSION = true ? "0.2.
|
|
597
|
+
var CLIENT_VERSION = true ? "0.2.2" : "dev";
|
|
598
598
|
function bandOf(amount) {
|
|
599
599
|
if (typeof amount !== "number" || !Number.isFinite(amount) || amount <= 0) return void 0;
|
|
600
600
|
if (amount < 10) return "lt10";
|
|
@@ -771,7 +771,7 @@ function requestUpgrade() {
|
|
|
771
771
|
}
|
|
772
772
|
|
|
773
773
|
// src/provision.ts
|
|
774
|
-
var CLIENT_VERSION2 = true ? "0.2.
|
|
774
|
+
var CLIENT_VERSION2 = true ? "0.2.2" : "dev";
|
|
775
775
|
function provisionEnabled() {
|
|
776
776
|
const v = (process.env.FIDACY_DISABLE_PROVISION ?? "").trim().toLowerCase();
|
|
777
777
|
return !(v === "1" || v === "true" || v === "yes");
|
|
@@ -823,16 +823,21 @@ function nudgeOnce(key) {
|
|
|
823
823
|
}
|
|
824
824
|
return true;
|
|
825
825
|
}
|
|
826
|
+
var sessionDecisions = 0;
|
|
827
|
+
function sessionDecisionCount() {
|
|
828
|
+
return sessionDecisions;
|
|
829
|
+
}
|
|
826
830
|
function bumpDecisionCount() {
|
|
831
|
+
sessionDecisions += 1;
|
|
827
832
|
const cfg = readConfig();
|
|
828
|
-
if (!cfg) return
|
|
833
|
+
if (!cfg) return sessionDecisions;
|
|
829
834
|
const n = (cfg.decisions_count ?? 0) + 1;
|
|
830
835
|
cfg.decisions_count = n;
|
|
831
836
|
try {
|
|
832
837
|
writeConfig(cfg);
|
|
833
838
|
} catch {
|
|
834
839
|
}
|
|
835
|
-
return n;
|
|
840
|
+
return Math.max(n, sessionDecisions);
|
|
836
841
|
}
|
|
837
842
|
function installAgeDays() {
|
|
838
843
|
const t = Date.parse(readConfig()?.created_at ?? "");
|
|
@@ -878,7 +883,7 @@ function hasEngineKey(keyOverride) {
|
|
|
878
883
|
return Boolean((keyOverride ?? process.env.FIDACY_ENGINE_API_KEY ?? "").trim());
|
|
879
884
|
}
|
|
880
885
|
function decisionsUsed() {
|
|
881
|
-
return readConfig()?.decisions_count ?? 0;
|
|
886
|
+
return Math.max(readConfig()?.decisions_count ?? 0, sessionDecisionCount());
|
|
882
887
|
}
|
|
883
888
|
function remainingFree() {
|
|
884
889
|
return Math.max(0, FREE_DECISIONS - decisionsUsed());
|
|
@@ -897,7 +902,7 @@ function activationGate(keyOverride) {
|
|
|
897
902
|
}
|
|
898
903
|
function trialCountdownLine(keyOverride) {
|
|
899
904
|
if (hasEngineKey(keyOverride)) return null;
|
|
900
|
-
if (!readConfig()) return null;
|
|
905
|
+
if (!readConfig() && sessionDecisionCount() === 0) return null;
|
|
901
906
|
const left = remainingFree();
|
|
902
907
|
if (left > 5) return null;
|
|
903
908
|
const url = claimDestination();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fidacy/mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Fidacy action firewall for AI agents. Mandate-gated payment authorization as an MCP server.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://fidacy.com",
|
|
@@ -36,6 +36,12 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "node scripts/bundle.mjs",
|
|
41
|
+
"dev": "tsx watch src/index.ts",
|
|
42
|
+
"start": "node dist/index.js",
|
|
43
|
+
"prepublishOnly": "npm run build"
|
|
44
|
+
},
|
|
39
45
|
"engines": {
|
|
40
46
|
"node": ">=18"
|
|
41
47
|
},
|
|
@@ -44,19 +50,14 @@
|
|
|
44
50
|
"zod": "^3.25.0"
|
|
45
51
|
},
|
|
46
52
|
"devDependencies": {
|
|
53
|
+
"@fidacy/firewall": "workspace:*",
|
|
47
54
|
"@types/node": "^22.10.0",
|
|
48
55
|
"tsx": "^4.19.2",
|
|
49
|
-
"typescript": "^5.7.2"
|
|
50
|
-
"@fidacy/firewall": "0.1.1"
|
|
56
|
+
"typescript": "^5.7.2"
|
|
51
57
|
},
|
|
52
58
|
"mcpName": "com.fidacy/mcp",
|
|
53
59
|
"repository": {
|
|
54
60
|
"type": "git",
|
|
55
61
|
"url": "git+https://github.com/lucaslubi/fidacy-mcp.git"
|
|
56
|
-
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"build": "node scripts/bundle.mjs",
|
|
59
|
-
"dev": "tsx watch src/index.ts",
|
|
60
|
-
"start": "node dist/index.js"
|
|
61
62
|
}
|
|
62
|
-
}
|
|
63
|
+
}
|