toolfunnel 0.5.0 → 0.6.0
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 +231 -167
- package/bin/toolfunnel.js +372 -147
- package/docs/KNOWN_BUGS.md +99 -33
- package/docs/MANUAL.pdf +0 -0
- package/docs/design.md +70 -0
- package/docs/packaging.md +115 -115
- package/hooks/hooks.manifest.json +27 -27
- package/hooks/scripts/example-audit.js +21 -21
- package/hooks/scripts/example-deny-dangerous.js +31 -31
- package/mcp/expose.example.json +30 -30
- package/mcp/servers/mock-modern/server.js +147 -0
- package/mcp/servers/mock-upstream/server.js +192 -12
- package/package.json +1 -1
- package/src/auth/config.js +174 -174
- package/src/auth/install.js +181 -181
- package/src/auth/resource-server.js +344 -344
- package/src/core/config-home.js +134 -134
- package/src/core/events.js +105 -105
- package/src/core/hook-engine.js +275 -275
- package/src/core/hook-loader.js +791 -791
- package/src/core/hook-runner.js +346 -346
- package/src/core/logger.js +171 -171
- package/src/core/matcher.js +51 -51
- package/src/core/metrics.js +75 -75
- package/src/core/requires.js +138 -138
- package/src/core/server-config.js +98 -77
- package/src/core/tool-registry.js +180 -180
- package/src/extend/add-hook.md +152 -142
- package/src/extend/add-mcp.md +122 -121
- package/src/extend/configure.md +87 -0
- package/src/extend/create-tool.md +168 -152
- package/src/extend/howto.js +102 -98
- package/src/extend/package.md +187 -187
- package/src/extend/wrap.md +99 -0
- package/src/mcp/aggregator.js +1246 -807
- package/src/mcp/expose-store.js +460 -430
- package/src/mcp/gated-run.js +201 -194
- package/src/mcp/http-transport.js +1311 -1012
- package/src/mcp/mcp-client.js +907 -530
- package/src/mcp/modern.js +372 -0
- package/src/mcp/protocol.js +468 -466
- package/src/mcp/server.js +2688 -1405
- package/src/packages/packager.js +715 -715
- package/src/tools/drift.js +138 -138
- package/src/tools/registry.js +513 -513
- package/src/tools/tool-state.js +170 -104
- package/src/ui/public/app.js +1174 -1055
- package/src/ui/public/index.html +286 -249
- package/src/ui/public/styles.css +535 -535
- package/src/ui/server.js +1348 -1190
- package/tools/scripts/base64.js +139 -139
- package/tools/scripts/danger.js +61 -61
- package/tools/scripts/echo.js +39 -39
- package/tools/scripts/hash.js +101 -101
- package/tools/scripts/json.js +109 -109
- package/tools/scripts/text-stats.js +131 -131
- package/tools/scripts/tf-env.js +43 -43
- package/tools/scripts/tf-hook-add.js +151 -151
- package/tools/scripts/tf-hook-set.js +112 -112
- package/tools/scripts/tf-list.js +192 -192
- package/tools/scripts/tf-log.js +86 -86
- package/tools/scripts/tf-mcp-add.js +117 -117
- package/tools/scripts/tf-mcp-set.js +121 -102
- package/tools/scripts/tf-pack.js +237 -237
- package/tools/scripts/tf-tool-add.js +134 -129
- package/tools/scripts/tf-tool-set.js +142 -142
- package/tools/scripts/tf-wrap.js +103 -0
- package/tools/scripts/uuid.js +102 -102
- package/tools/tools.register.json +227 -216
|
@@ -1,216 +1,227 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"description": "Tool register for the gateway
|
|
4
|
-
"tools": [
|
|
5
|
-
{
|
|
6
|
-
"id": "echo",
|
|
7
|
-
"name": "Echo",
|
|
8
|
-
"summary": "Return the provided arguments back unchanged.",
|
|
9
|
-
"category": "demo",
|
|
10
|
-
"instructions": "Echoes its structured args back in the result. Pass any JSON value as args and the same value is returned. Useful as a connectivity / round-trip smoke test.",
|
|
11
|
-
"invoke": {
|
|
12
|
-
"type": "script",
|
|
13
|
-
"path": "scripts/echo.js"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"id": "base64",
|
|
18
|
-
"name": "Base64 Encode/Decode",
|
|
19
|
-
"summary": "Encode text to Base64 or decode Base64 back to text.",
|
|
20
|
-
"category": "encoding",
|
|
21
|
-
"instructions": "Args: { op: \"encode\"|\"decode\", text: string }. Both args required. encode -> Base64 of the UTF-8 text; decode -> UTF-8 from valid Base64 (malformed input is reported, not mangled).",
|
|
22
|
-
"invoke": {
|
|
23
|
-
"type": "script",
|
|
24
|
-
"path": "scripts/base64.js"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "hash",
|
|
29
|
-
"name": "Hash",
|
|
30
|
-
"summary": "Compute a cryptographic digest (e.g. sha256) of input text.",
|
|
31
|
-
"category": "crypto",
|
|
32
|
-
"instructions": "Args: { algo?: \"sha256\"|\"sha1\"|\"md5\" (default \"sha256\"), text: string }. Returns the lowercase hex digest of the UTF-8 text.",
|
|
33
|
-
"invoke": {
|
|
34
|
-
"type": "script",
|
|
35
|
-
"path": "scripts/hash.js"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"id": "uuid",
|
|
40
|
-
"name": "UUID Generator",
|
|
41
|
-
"summary": "Generate a random RFC 4122 v4 UUID.",
|
|
42
|
-
"category": "generators",
|
|
43
|
-
"instructions": "Args: { count?: number (default 1) }. Returns one or more freshly generated v4 UUID strings.",
|
|
44
|
-
"invoke": {
|
|
45
|
-
"type": "script",
|
|
46
|
-
"path": "scripts/uuid.js"
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"id": "json",
|
|
51
|
-
"name": "JSON Format",
|
|
52
|
-
"summary": "Validate and pretty-print a JSON string.",
|
|
53
|
-
"category": "data",
|
|
54
|
-
"instructions": "Args: { text: string, indent?: number (default 2) }. Parses the input; returns the re-serialised, indented JSON, or a clear parse error.",
|
|
55
|
-
"invoke": {
|
|
56
|
-
"type": "script",
|
|
57
|
-
"path": "scripts/json.js"
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"id": "text-stats",
|
|
62
|
-
"name": "Text Stats",
|
|
63
|
-
"summary": "Count characters, words, and lines in a block of text.",
|
|
64
|
-
"category": "text",
|
|
65
|
-
"instructions": "Args: { text: string }. Returns { chars, words, lines } computed from the input text.",
|
|
66
|
-
"invoke": {
|
|
67
|
-
"type": "script",
|
|
68
|
-
"path": "scripts/text-stats.js"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"id": "danger",
|
|
73
|
-
"name": "Danger Demo",
|
|
74
|
-
"summary": "Demonstrate a gated, potentially destructive operation.",
|
|
75
|
-
"category": "demo",
|
|
76
|
-
"instructions": "A sample tool that represents a destructive action. It is intended to be exercised behind the gate so the gating path can be tested end to end. Pass { confirm: true } to proceed.",
|
|
77
|
-
"invoke": {
|
|
78
|
-
"type": "script",
|
|
79
|
-
"path": "scripts/danger.js"
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"id": "tf_tool_add",
|
|
84
|
-
"name": "tf_tool_add",
|
|
85
|
-
"summary": "Register a new tool entry in the gateway tool register.",
|
|
86
|
-
"category": "management",
|
|
87
|
-
"instructions": "Add a register entry. Args: { id, name, summary?, category?, instructions?, inputSchema?, invoke:{type:'script',path:'scripts/<file>'}|{type:'shell',command}, scriptText? }. inputSchema is a JSON Schema object for the tool's args - a HOT-promoted tool advertises it verbatim in the top-level tools/list, so author it if the tool may be promoted. If scriptText is given for a script invoke, the body is written to tools/scripts/<basename> first. Change is LIVE (no reconnect). Fails if id already exists.",
|
|
88
|
-
"invoke": {
|
|
89
|
-
"type": "script",
|
|
90
|
-
"path": "scripts/tf-tool-add.js"
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"id": "tf_tool_set",
|
|
95
|
-
"name": "tf_tool_set",
|
|
96
|
-
"summary": "Activate, deactivate, promote (hot), hide, or remove a register tool.",
|
|
97
|
-
"category": "management",
|
|
98
|
-
"instructions": "Args: { id, action:'enable'|'disable'|'hot'|'unhot'|'hide'|'unhide'|'remove' }. enable/disable flips the active overlay (default ON)
|
|
99
|
-
"invoke": {
|
|
100
|
-
"type": "script",
|
|
101
|
-
"path": "scripts/tf-tool-set.js"
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"id": "tf_mcp_add",
|
|
106
|
-
"name": "tf_mcp_add",
|
|
107
|
-
"summary": "Register an upstream MCP (and optionally expose some of its tools).",
|
|
108
|
-
"category": "management",
|
|
109
|
-
"instructions": "Args: { id, command, args?, env?, transport?='stdio', enabled?=true, description?, expose?:[{tool, as?, category?, enabled?}] }. Adds an upstreams[] entry; each expose[] item adds a curated-direct selection. Curated-direct changes need an aggregator reconnect to surface.",
|
|
110
|
-
"invoke": {
|
|
111
|
-
"type": "script",
|
|
112
|
-
"path": "scripts/tf-mcp-add.js"
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"id": "tf_mcp_set",
|
|
117
|
-
"name": "tf_mcp_set",
|
|
118
|
-
"summary": "Enable, disable, or remove an upstream MCP.",
|
|
119
|
-
"category": "management",
|
|
120
|
-
"instructions": "Args: { id, action:'enable'|'disable'|'remove' }. enable/disable toggles the upstream; remove deletes it and cascades its expose entries. Reconnect needed for the curated-direct surface to change.",
|
|
121
|
-
"invoke": {
|
|
122
|
-
"type": "script",
|
|
123
|
-
"path": "scripts/tf-mcp-set.js"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
"id": "
|
|
128
|
-
"name": "
|
|
129
|
-
"summary": "
|
|
130
|
-
"category": "management",
|
|
131
|
-
"instructions": "Args: {
|
|
132
|
-
"invoke": {
|
|
133
|
-
"type": "script",
|
|
134
|
-
"path": "scripts/tf-
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"id": "
|
|
139
|
-
"name": "
|
|
140
|
-
"summary": "
|
|
141
|
-
"category": "management",
|
|
142
|
-
"instructions": "Args: { id,
|
|
143
|
-
"invoke": {
|
|
144
|
-
"type": "script",
|
|
145
|
-
"path": "scripts/tf-hook-
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"id": "
|
|
150
|
-
"name": "
|
|
151
|
-
"summary": "
|
|
152
|
-
"category": "management",
|
|
153
|
-
"instructions": "Args: {
|
|
154
|
-
"invoke": {
|
|
155
|
-
"type": "script",
|
|
156
|
-
"path": "scripts/tf-
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"id": "
|
|
161
|
-
"name": "
|
|
162
|
-
"summary": "
|
|
163
|
-
"category": "management",
|
|
164
|
-
"instructions": "Args: {
|
|
165
|
-
"invoke": {
|
|
166
|
-
"type": "script",
|
|
167
|
-
"path": "scripts/tf-
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
"id": "
|
|
172
|
-
"name": "
|
|
173
|
-
"summary": "
|
|
174
|
-
"category": "management",
|
|
175
|
-
"instructions": "Args: {
|
|
176
|
-
"
|
|
177
|
-
"type": "
|
|
178
|
-
"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
"
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
"
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
"
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"description": "Tool register for the gateway - built-in demo scripts.",
|
|
4
|
+
"tools": [
|
|
5
|
+
{
|
|
6
|
+
"id": "echo",
|
|
7
|
+
"name": "Echo",
|
|
8
|
+
"summary": "Return the provided arguments back unchanged.",
|
|
9
|
+
"category": "demo",
|
|
10
|
+
"instructions": "Echoes its structured args back in the result. Pass any JSON value as args and the same value is returned. Useful as a connectivity / round-trip smoke test.",
|
|
11
|
+
"invoke": {
|
|
12
|
+
"type": "script",
|
|
13
|
+
"path": "scripts/echo.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "base64",
|
|
18
|
+
"name": "Base64 Encode/Decode",
|
|
19
|
+
"summary": "Encode text to Base64 or decode Base64 back to text.",
|
|
20
|
+
"category": "encoding",
|
|
21
|
+
"instructions": "Args: { op: \"encode\"|\"decode\", text: string }. Both args required. encode -> Base64 of the UTF-8 text; decode -> UTF-8 from valid Base64 (malformed input is reported, not mangled).",
|
|
22
|
+
"invoke": {
|
|
23
|
+
"type": "script",
|
|
24
|
+
"path": "scripts/base64.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "hash",
|
|
29
|
+
"name": "Hash",
|
|
30
|
+
"summary": "Compute a cryptographic digest (e.g. sha256) of input text.",
|
|
31
|
+
"category": "crypto",
|
|
32
|
+
"instructions": "Args: { algo?: \"sha256\"|\"sha1\"|\"md5\" (default \"sha256\"), text: string }. Returns the lowercase hex digest of the UTF-8 text.",
|
|
33
|
+
"invoke": {
|
|
34
|
+
"type": "script",
|
|
35
|
+
"path": "scripts/hash.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "uuid",
|
|
40
|
+
"name": "UUID Generator",
|
|
41
|
+
"summary": "Generate a random RFC 4122 v4 UUID.",
|
|
42
|
+
"category": "generators",
|
|
43
|
+
"instructions": "Args: { count?: number (default 1) }. Returns one or more freshly generated v4 UUID strings.",
|
|
44
|
+
"invoke": {
|
|
45
|
+
"type": "script",
|
|
46
|
+
"path": "scripts/uuid.js"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "json",
|
|
51
|
+
"name": "JSON Format",
|
|
52
|
+
"summary": "Validate and pretty-print a JSON string.",
|
|
53
|
+
"category": "data",
|
|
54
|
+
"instructions": "Args: { text: string, indent?: number (default 2) }. Parses the input; returns the re-serialised, indented JSON, or a clear parse error.",
|
|
55
|
+
"invoke": {
|
|
56
|
+
"type": "script",
|
|
57
|
+
"path": "scripts/json.js"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "text-stats",
|
|
62
|
+
"name": "Text Stats",
|
|
63
|
+
"summary": "Count characters, words, and lines in a block of text.",
|
|
64
|
+
"category": "text",
|
|
65
|
+
"instructions": "Args: { text: string }. Returns { chars, words, lines } computed from the input text.",
|
|
66
|
+
"invoke": {
|
|
67
|
+
"type": "script",
|
|
68
|
+
"path": "scripts/text-stats.js"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "danger",
|
|
73
|
+
"name": "Danger Demo",
|
|
74
|
+
"summary": "Demonstrate a gated, potentially destructive operation.",
|
|
75
|
+
"category": "demo",
|
|
76
|
+
"instructions": "A sample tool that represents a destructive action. It is intended to be exercised behind the gate so the gating path can be tested end to end. Pass { confirm: true } to proceed.",
|
|
77
|
+
"invoke": {
|
|
78
|
+
"type": "script",
|
|
79
|
+
"path": "scripts/danger.js"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id": "tf_tool_add",
|
|
84
|
+
"name": "tf_tool_add",
|
|
85
|
+
"summary": "Register a new tool entry in the gateway tool register.",
|
|
86
|
+
"category": "management",
|
|
87
|
+
"instructions": "Add a register entry. Args: { id, name, summary?, category?, instructions?, inputSchema?, invoke:{type:'script',path:'scripts/<file>'}|{type:'shell',command}, scriptText? }. inputSchema is a JSON Schema object for the tool's args - a HOT-promoted tool advertises it verbatim in the top-level tools/list, so author it if the tool may be promoted. If scriptText is given for a script invoke, the body is written to tools/scripts/<basename> first. Change is LIVE (no reconnect). Fails if id already exists.",
|
|
88
|
+
"invoke": {
|
|
89
|
+
"type": "script",
|
|
90
|
+
"path": "scripts/tf-tool-add.js"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "tf_tool_set",
|
|
95
|
+
"name": "tf_tool_set",
|
|
96
|
+
"summary": "Activate, deactivate, promote (hot), hide, or remove a register tool.",
|
|
97
|
+
"category": "management",
|
|
98
|
+
"instructions": "Args: { id, action:'enable'|'disable'|'hot'|'unhot'|'hide'|'unhide'|'remove' }. enable/disable flips the active overlay (default ON) - disabled tools drop from toolfunnel_list_tools. hot/unhot promote/demote on the TOP-LEVEL every-turn surface (tools/list), making it directly callable (default OFF). hide/unhide declutter the MANAGER views only (tf_list + UI) and do NOT change what the AI sees. The id may be a local tool id, an upstream surfaced name, or a meta-tool name. remove deletes the register entry and purges its state key. All LIVE (no restart).",
|
|
99
|
+
"invoke": {
|
|
100
|
+
"type": "script",
|
|
101
|
+
"path": "scripts/tf-tool-set.js"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "tf_mcp_add",
|
|
106
|
+
"name": "tf_mcp_add",
|
|
107
|
+
"summary": "Register an upstream MCP (and optionally expose some of its tools).",
|
|
108
|
+
"category": "management",
|
|
109
|
+
"instructions": "Args: { id, command, args?, env?, transport?='stdio', enabled?=true, description?, expose?:[{tool, as?, category?, enabled?}] }. Adds an upstreams[] entry; each expose[] item adds a curated-direct selection. Curated-direct changes need an aggregator reconnect to surface.",
|
|
110
|
+
"invoke": {
|
|
111
|
+
"type": "script",
|
|
112
|
+
"path": "scripts/tf-mcp-add.js"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"id": "tf_mcp_set",
|
|
117
|
+
"name": "tf_mcp_set",
|
|
118
|
+
"summary": "Enable, disable, or remove an upstream MCP.",
|
|
119
|
+
"category": "management",
|
|
120
|
+
"instructions": "Args: { id, action:'enable'|'disable'|'remove' }. enable/disable toggles the upstream; remove deletes it and cascades its expose entries. Reconnect needed for the curated-direct surface to change.",
|
|
121
|
+
"invoke": {
|
|
122
|
+
"type": "script",
|
|
123
|
+
"path": "scripts/tf-mcp-set.js"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"id": "tf_wrap",
|
|
128
|
+
"name": "tf_wrap",
|
|
129
|
+
"summary": "Wrap ONE attached upstream MCP: its tools become the entire surface (transparent passthrough).",
|
|
130
|
+
"category": "management",
|
|
131
|
+
"instructions": "Args: {} reports status ({ wrapping, upstreams }). { off:true } clears the wrap. { upstream:'<id>', confirm:true } sets it: that upstream's tools become the ENTIRE advertised surface under their ORIGINAL names, everything else (meta-tools INCLUDED) is hidden and uncallable, and every call still fires the PreToolUse gate. Because the gateway answers both MCP eras, this keeps a legacy-only MCP working with 2026-07-28-era clients. WARNING (why confirm is required): the wrap hides tf_wrap itself, so YOU cannot undo it in-band afterwards - recovery is the config web UI (--ui) or `toolfunnel wrap --off` on a terminal. A running host applies the change live.",
|
|
132
|
+
"invoke": {
|
|
133
|
+
"type": "script",
|
|
134
|
+
"path": "scripts/tf-wrap.js"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"id": "tf_hook_add",
|
|
139
|
+
"name": "tf_hook_add",
|
|
140
|
+
"summary": "Add a hook manifest entry (e.g. a PreToolUse gate).",
|
|
141
|
+
"category": "management",
|
|
142
|
+
"instructions": "Args: { id, event, matcher?, command, script?, timeout?, enabled?=true, description?, scriptText? }. id format '<kebab-event>/<name>'. command should use the portable ${HOOKS_DIR} token. If scriptText is given, the script is authored under hooks/scripts/ (path-guarded). enabled is the manifest seed; live toggles live in hooks.state.json.",
|
|
143
|
+
"invoke": {
|
|
144
|
+
"type": "script",
|
|
145
|
+
"path": "scripts/tf-hook-add.js"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"id": "tf_hook_set",
|
|
150
|
+
"name": "tf_hook_set",
|
|
151
|
+
"summary": "Enable, disable, or remove a hook.",
|
|
152
|
+
"category": "management",
|
|
153
|
+
"instructions": "Args: { id, action:'enable'|'disable'|'remove' }. enable/disable writes the hooks.state.json overlay (wins over the manifest seed) and mirrors the manifest; remove deletes the manifest entry and purges the overlay key (the script file is left in place).",
|
|
154
|
+
"invoke": {
|
|
155
|
+
"type": "script",
|
|
156
|
+
"path": "scripts/tf-hook-set.js"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"id": "tf_list",
|
|
161
|
+
"name": "tf_list",
|
|
162
|
+
"summary": "List register tools, upstream MCPs, or hooks with their active state.",
|
|
163
|
+
"category": "management",
|
|
164
|
+
"instructions": "Args: { kind:'tools'|'mcps'|'hooks' }. tools -> register briefs + enabled/hidden overlay; mcps -> upstreams + expose selections; hooks -> configured + auto-detected inventory with live enabled state. Read-only.",
|
|
165
|
+
"invoke": {
|
|
166
|
+
"type": "script",
|
|
167
|
+
"path": "scripts/tf-list.js"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"id": "tf_log",
|
|
172
|
+
"name": "tf_log",
|
|
173
|
+
"summary": "Enable, disable, or check the gateway activity/audit log.",
|
|
174
|
+
"category": "management",
|
|
175
|
+
"instructions": "Args: { action:'enable'|'disable'|'status', path? }. Toggles ToolFunnel's JSONL audit log (tool runs + gate allow/deny decisions). Default OFF. 'status' returns {enabled,path} + recent count. Like any tool, tf_log can itself be disabled to revoke logging control.",
|
|
176
|
+
"invoke": {
|
|
177
|
+
"type": "script",
|
|
178
|
+
"path": "scripts/tf-log.js"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"id": "tf_pack",
|
|
183
|
+
"name": "tf_pack",
|
|
184
|
+
"summary": "Package the LIVE setup into a deployment-ready artifact under <home>/dist/ (portable config home, or a publishable npm package wrapping toolfunnel).",
|
|
185
|
+
"category": "management",
|
|
186
|
+
"instructions": "Args: { format?:'home'|'npm' (default 'home'), name?, version?, description?, out?, force? }. Snapshots the current setup - tools + scripts, hot/hidden curation (tools.state.json), upstream references (mcp/expose.json), policy hooks (THE GATE TRAVELS), and identity (toolfunnel.json, rewritten with the pack's name/version; a declared `requires` travels too) - into <home>/dist/<out||name>/, a SEPARATE location from the live config. format 'home' = a portable config home (zip / git init / run via --config-dir). format 'npm' = a publishable package: generated package.json with toolfunnel as a caret DEPENDENCY (depend, never copy), a 2-line bin launcher pointing --config-dir at the bundled home/, and a README stub - then `cd dist/<name> && npm publish`. NEVER ships auth/ or logs/. Refuses a non-empty destination without force:true. out is a folder NAME under dist/, never a path.",
|
|
187
|
+
"inputSchema": {
|
|
188
|
+
"type": "object",
|
|
189
|
+
"properties": {
|
|
190
|
+
"format": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"enum": [
|
|
193
|
+
"home",
|
|
194
|
+
"npm"
|
|
195
|
+
],
|
|
196
|
+
"description": "Artifact type: portable config home (default) or publishable npm package."
|
|
197
|
+
},
|
|
198
|
+
"name": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"description": "Pack/package name (default: the home's serverName)."
|
|
201
|
+
},
|
|
202
|
+
"version": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"description": "Pack version (default: the home's serverVersion, else 0.1.0)."
|
|
205
|
+
},
|
|
206
|
+
"description": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"description": "npm format: the package.json description."
|
|
209
|
+
},
|
|
210
|
+
"out": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"description": "Folder NAME under <home>/dist/ (default: name)."
|
|
213
|
+
},
|
|
214
|
+
"force": {
|
|
215
|
+
"type": "boolean",
|
|
216
|
+
"description": "Overwrite files in an existing non-empty destination."
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"additionalProperties": false
|
|
220
|
+
},
|
|
221
|
+
"invoke": {
|
|
222
|
+
"type": "script",
|
|
223
|
+
"path": "scripts/tf-pack.js"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|