@finchagentic/mcp 4.6.2 → 4.6.4
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/README.md +39 -74
- package/dist/_http-cache.js +96 -0
- package/dist/_text-search.js +39 -0
- package/dist/agent-loop.js +301 -0
- package/dist/annotations.js +122 -0
- package/dist/cli.js +1391 -0
- package/dist/clink-input.js +15 -0
- package/dist/config.js +132 -0
- package/dist/convex.js +175 -0
- package/dist/dex-pair.js +54 -0
- package/dist/enrichment-router.js +315 -0
- package/dist/index.js +258 -0
- package/dist/llm.js +298 -0
- package/dist/local-memory-file.js +150 -0
- package/dist/local-memory.js +135 -0
- package/dist/local-vault.js +456 -0
- package/dist/output-schemas.js +605 -0
- package/dist/project.js +36 -0
- package/dist/prompts.js +111 -0
- package/dist/public-url.js +107 -0
- package/dist/resources.js +111 -0
- package/dist/server.js +322 -0
- package/dist/signal-gate.js +57 -0
- package/dist/token-decimals.js +26 -0
- package/dist/token-gate.js +88 -0
- package/dist/tool-filter.js +53 -0
- package/dist/tools/_solidity-scan.js +313 -0
- package/dist/tools/agents.js +441 -0
- package/dist/tools/automation.js +354 -0
- package/dist/tools/base-mcp.js +466 -0
- package/dist/tools/base.js +283 -0
- package/dist/tools/chronicle.js +268 -0
- package/dist/tools/coder.js +94 -0
- package/dist/tools/deep-research.js +1421 -0
- package/dist/tools/defi.js +292 -0
- package/dist/tools/equity.js +372 -0
- package/dist/tools/events.js +182 -0
- package/dist/tools/github.js +564 -0
- package/dist/tools/insider.js +264 -0
- package/dist/tools/insight.js +630 -0
- package/dist/tools/market.js +555 -0
- package/dist/tools/memory.js +1059 -0
- package/dist/tools/miroshark.js +350 -0
- package/dist/tools/monitor.js +319 -0
- package/dist/tools/os.js +236 -0
- package/dist/tools/packets.js +296 -0
- package/dist/tools/research-chain.js +226 -0
- package/dist/tools/research-compare.js +280 -0
- package/dist/tools/research.js +188 -0
- package/dist/tools/rh-bridge.js +148 -0
- package/dist/tools/rh-mcp.js +1448 -0
- package/dist/tools/rh-orders.js +556 -0
- package/dist/tools/scanner.js +564 -0
- package/dist/tools/stake.js +369 -0
- package/dist/tools/vault.js +1020 -0
- package/dist/tools/wallet.js +200 -0
- package/dist/types.js +2 -0
- package/dist/wallet.js +372 -0
- package/package.json +4 -7
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MUTATING_TOOL_NAMES = void 0;
|
|
4
|
+
exports.annotationsFor = annotationsFor;
|
|
5
|
+
exports.withAnnotations = withAnnotations;
|
|
6
|
+
const output_schemas_js_1 = require("./output-schemas.js");
|
|
7
|
+
// Read-only AND no network - a purely local computation (static analysis).
|
|
8
|
+
// Read-only but open-world is the default, so this set only exists to flip
|
|
9
|
+
// openWorldHint off for the rare offline tool.
|
|
10
|
+
const READ_ONLY_LOCAL = new Set([
|
|
11
|
+
"audit_contract", // deterministic static Solidity scan, no backend call
|
|
12
|
+
]);
|
|
13
|
+
// readOnly=false, destructive=false, idempotent=true.
|
|
14
|
+
// Toggles and upserts: re-running with the same args lands in the same state.
|
|
15
|
+
const WRITE_IDEMPOTENT = new Set([
|
|
16
|
+
"agent_update",
|
|
17
|
+
"pause_automation",
|
|
18
|
+
"stake_auto_restake",
|
|
19
|
+
"vault_link",
|
|
20
|
+
"vault_pin",
|
|
21
|
+
"vault_tag",
|
|
22
|
+
"vault_unpublish",
|
|
23
|
+
]);
|
|
24
|
+
// readOnly=false, destructive=false.
|
|
25
|
+
// Additive writes / new resources: they create or append, they don't destroy.
|
|
26
|
+
const WRITE = new Set([
|
|
27
|
+
"agent_spawn",
|
|
28
|
+
"chronicle_add",
|
|
29
|
+
"code_session_save",
|
|
30
|
+
"memory_add",
|
|
31
|
+
"memory_extract",
|
|
32
|
+
"memory_consolidate",
|
|
33
|
+
"packet_create",
|
|
34
|
+
"schedule_research",
|
|
35
|
+
"vault_save",
|
|
36
|
+
"vault_store_credential",
|
|
37
|
+
"miroshark_simulate",
|
|
38
|
+
"finch_shell_chat", // orchestrator: can spawn/save/create via delegated tools
|
|
39
|
+
]);
|
|
40
|
+
// readOnly=false, destructive=true.
|
|
41
|
+
// Deletes, cancels, irreversible publishes, and anything that moves real funds
|
|
42
|
+
// (or arms an order engine that will). Clients should confirm before running.
|
|
43
|
+
const DESTRUCTIVE = new Set([
|
|
44
|
+
// removals / cancels
|
|
45
|
+
"cancel_monitor",
|
|
46
|
+
"delete_automation",
|
|
47
|
+
"memory_delete",
|
|
48
|
+
"miroshark_stop",
|
|
49
|
+
"rh_order_cancel",
|
|
50
|
+
"vault_delete",
|
|
51
|
+
// irreversible public exposure
|
|
52
|
+
"packet_share", // "copies already taken remain" per its own description
|
|
53
|
+
// money movement (Base)
|
|
54
|
+
// NOTE: base_mcp_lend deliberately excluded - per its own description it
|
|
55
|
+
// "Returns deposit INSTRUCTIONS only... Does NOT broadcast" - it's a read,
|
|
56
|
+
// not a fund move, so it falls through to the read-only default below.
|
|
57
|
+
"base_mcp_send",
|
|
58
|
+
"base_mcp_swap",
|
|
59
|
+
// off-chain signature that can itself authorise value movement (order,
|
|
60
|
+
// session login) without any on-chain tx - same risk class as a real
|
|
61
|
+
// transfer per its own tool description, so it belongs here rather than
|
|
62
|
+
// in WRITE_IDEMPOTENT ("re-sign = same sig" is true but undersells the risk)
|
|
63
|
+
"wallet_sign_message",
|
|
64
|
+
// money movement (Robinhood Chain)
|
|
65
|
+
"rh_mcp_swap",
|
|
66
|
+
"rh_dca_create", // arms recurring real buys
|
|
67
|
+
"rh_bracket_create", // arms real TP/SL sells
|
|
68
|
+
// a swap/send automation arms unattended, REPEATING real fund movement
|
|
69
|
+
// (the backend's 1-minute cron evaluator fires it) - same risk class as
|
|
70
|
+
// rh_dca_create/rh_bracket_create above, not a plain additive write. An
|
|
71
|
+
// alert-only automation doesn't move funds, but the tool can't tell which
|
|
72
|
+
// kind it's about to create until AFTER the backend parses rawInput, so
|
|
73
|
+
// it's classified by its worst case, same reasoning as rh_orders_tick.
|
|
74
|
+
"create_automation",
|
|
75
|
+
"rh_orders_tick", // preview by default, but can execute:true and move funds
|
|
76
|
+
// executors that run other (possibly fund-moving) tools
|
|
77
|
+
"run_automation",
|
|
78
|
+
"packet_run",
|
|
79
|
+
// money movement (FINCH staking, custodial wallet) - stake locks real value
|
|
80
|
+
// for a fixed period; unstake moves it (plus rewards) back
|
|
81
|
+
"stake_finch",
|
|
82
|
+
"unstake_finch",
|
|
83
|
+
"claim_vested_rewards", // treasury -> custodial wallet USDG transfer
|
|
84
|
+
]);
|
|
85
|
+
function annotationsFor(name) {
|
|
86
|
+
if (DESTRUCTIVE.has(name)) {
|
|
87
|
+
return { readOnlyHint: false, destructiveHint: true, openWorldHint: true };
|
|
88
|
+
}
|
|
89
|
+
if (WRITE_IDEMPOTENT.has(name)) {
|
|
90
|
+
return { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true };
|
|
91
|
+
}
|
|
92
|
+
if (WRITE.has(name)) {
|
|
93
|
+
return { readOnlyHint: false, destructiveHint: false, openWorldHint: true };
|
|
94
|
+
}
|
|
95
|
+
if (READ_ONLY_LOCAL.has(name)) {
|
|
96
|
+
return { readOnlyHint: true, openWorldHint: false };
|
|
97
|
+
}
|
|
98
|
+
return { readOnlyHint: true, openWorldHint: true };
|
|
99
|
+
}
|
|
100
|
+
// Decorate a tool list with MCP metadata: behavioural annotations
|
|
101
|
+
// (readOnly/destructive/etc) and, for tools registered in OUTPUT_SCHEMAS, a
|
|
102
|
+
// machine-readable `outputSchema`. A value already present on the tool is left
|
|
103
|
+
// untouched, so a module can always override either.
|
|
104
|
+
function withAnnotations(tools) {
|
|
105
|
+
return tools.map((t) => {
|
|
106
|
+
const patch = {};
|
|
107
|
+
if (!t.annotations)
|
|
108
|
+
patch.annotations = annotationsFor(t.name);
|
|
109
|
+
if (!t.outputSchema && output_schemas_js_1.OUTPUT_SCHEMAS[t.name]) {
|
|
110
|
+
patch.outputSchema = output_schemas_js_1.OUTPUT_SCHEMAS[t.name];
|
|
111
|
+
}
|
|
112
|
+
return Object.keys(patch).length ? { ...t, ...patch } : t;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
// Exported for the test suite to assert the classification only references real
|
|
116
|
+
// tool names (catches typos / tools renamed out from under a set).
|
|
117
|
+
exports.MUTATING_TOOL_NAMES = [
|
|
118
|
+
...WRITE_IDEMPOTENT,
|
|
119
|
+
...WRITE,
|
|
120
|
+
...DESTRUCTIVE,
|
|
121
|
+
...READ_ONLY_LOCAL,
|
|
122
|
+
];
|