@taifoon/n8n-nodes-typesafe 1.2.0 → 1.4.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 +43 -0
- package/dist/nodes/TaifoonTypeSafe/TaifoonTypeSafe.node.js +36 -13
- package/dist/nodes/TaifoonTypeSafe/TaifoonTypeSafe.node.js.map +1 -1
- package/dist/nodes/TaifoonTypeSafe/translate.d.ts +1 -0
- package/dist/nodes/TaifoonTypeSafe/translate.js +47 -11
- package/dist/nodes/TaifoonTypeSafe/translate.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/MCP.md +57 -0
- package/docs/WORKFLOWS.md +8 -0
- package/package.json +1 -1
package/docs/MCP.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# TypeSafe over MCP
|
|
2
|
+
|
|
3
|
+
A remote MCP server for typed decisions, for clients that speak MCP instead of installing a node:
|
|
4
|
+
n8n's **MCP Client** node (it works on n8n Cloud, where community nodes may not be installable), hosted
|
|
5
|
+
agents, Claude. It is a separate service run by Taifoon, not part of this npm package.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
URL https://typesafe.taifoon.dev/mcp
|
|
9
|
+
Transport HTTP Streamable (stateless: one POST, one JSON answer)
|
|
10
|
+
Auth Bearer = your own TypeSafe key (console.typesafe.ai), or none for 3 free calls
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
| tool | what it does | model call |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `typesafe_translate` | a plain-language task becomes typed questions; eleven languages; never invents options | none, free, no key |
|
|
16
|
+
| `typesafe_ask` | typed questions about a `state`; optional `routing` gives pass, fail or review; optional `reply_language` says the answers back as sentences | one |
|
|
17
|
+
| `typesafe_gate` | an approval gate before a tool call: `allow`, `deny` or `review` | one |
|
|
18
|
+
|
|
19
|
+
## In n8n
|
|
20
|
+
|
|
21
|
+
Add an **MCP Client** node: *Server Transport* HTTP Streamable, *Endpoint* `https://typesafe.taifoon.dev/mcp`,
|
|
22
|
+
*Authentication* Bearer Auth with a credential holding your TypeSafe key, pick a tool. The answer arrives under
|
|
23
|
+
`structuredContent`, for example `{{ $json.structuredContent.verdict }}`.
|
|
24
|
+
|
|
25
|
+
Ready to import: [`examples/approval-gate-mcp.workflow.json`](../examples/approval-gate-mcp.workflow.json).
|
|
26
|
+
The same gate built with this package's node, which calls TypeSafe directly:
|
|
27
|
+
[`examples/approval-gate-node.workflow.json`](../examples/approval-gate-node.workflow.json).
|
|
28
|
+
|
|
29
|
+
## The approval gate, from a real run
|
|
30
|
+
|
|
31
|
+
Four proposed tool calls, with the context "the user asked the agent to tidy up the project folder":
|
|
32
|
+
|
|
33
|
+
| proposed call | p(safe) | p(hard to undo) | verdict |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| `read_file ./README.md` | 0.96 | 0.01 | **allow** |
|
|
36
|
+
| `move_file notes.txt -> archive/` | 0.84 | 0.19 | **review**: under `allow_at` 0.9 |
|
|
37
|
+
| `run_sql DROP DATABASE customers` | 0.01 | 0.98 | **deny** |
|
|
38
|
+
| `send_email` to every customer | 0.01 | 0.98 | **deny** |
|
|
39
|
+
|
|
40
|
+
Each answer took 0.25 to 0.6 s and about 430 input tokens, roughly 0.00002 USD.
|
|
41
|
+
|
|
42
|
+
The rule: `allow` needs p(safe) at or over `allow_at` (default 0.9) and an action that is not hard to undo;
|
|
43
|
+
p(safe) at or under `deny_at` (default 0.3) is `deny`; everything else is `review`, including an answer that
|
|
44
|
+
did not validate and an outage. A gate that did not hear a clear answer does not allow. The node version of
|
|
45
|
+
the same workflow asks a pick-one question instead and let the file move through at 99% confidence: the two
|
|
46
|
+
are different instruments, so choose one and check its thresholds against your own examples. These are raw
|
|
47
|
+
model probabilities, not guarantees.
|
|
48
|
+
|
|
49
|
+
## What the server sees, and keeps
|
|
50
|
+
|
|
51
|
+
Your key crosses the server on its way to TypeSafe, over TLS. It is used for that one call and dropped:
|
|
52
|
+
never written, never logged, never returned. Logs hold the tool name, the outcome, a salted hash of the
|
|
53
|
+
caller, the country and the client product; never the key, the address, the state or a question's text.
|
|
54
|
+
If you would rather have nobody in the path, use this package's node with the direct connection.
|
|
55
|
+
|
|
56
|
+
Limits: 60 requests a minute per address. With a key: 20 questions and a 32,000-character state per call.
|
|
57
|
+
Without: 4 questions, 4,000 characters, 3 calls in total, shared with the node's Free Trial connection.
|
package/docs/WORKFLOWS.md
CHANGED
|
@@ -25,3 +25,11 @@ The importable example is `examples/typed-gate.workflow.json`.
|
|
|
25
25
|
with backoff is the right response. A `402` is not retryable: it names what is missing.
|
|
26
26
|
- **Batching.** One item is one request. For many items, keep n8n's batching on and the deck's daily
|
|
27
27
|
ceiling in mind; TypeSafe allows 1,200 requests a minute.
|
|
28
|
+
|
|
29
|
+
## Approval gate before an agent's tool call
|
|
30
|
+
|
|
31
|
+
An agent proposes a tool call; a model that only judges says whether it may run. Two ready-made versions,
|
|
32
|
+
both from a real run: [`approval-gate-node.workflow.json`](../examples/approval-gate-node.workflow.json)
|
|
33
|
+
uses this node (Pass = run it, Fail = block it, Review = ask a person), and
|
|
34
|
+
[`approval-gate-mcp.workflow.json`](../examples/approval-gate-mcp.workflow.json) uses n8n's MCP Client
|
|
35
|
+
against the hosted server. Details and the measured answers: [TypeSafe over MCP](MCP.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taifoon/n8n-nodes-typesafe",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "TypeSafe for n8n: ask Jev (a System One model) yes/no, pick-one and rate-it questions about any workflow item and route on calibrated answers. Works directly with your own TypeSafe key; includes a task-to-questions translator and Pass / Fail / Review outputs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|