@taifoon/n8n-nodes-typesafe 1.4.0 → 2.0.1
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 +48 -289
- package/dist/nodes/TaifoonTypeSafe/TaifoonTypeSafe.node.js +95 -56
- package/dist/nodes/TaifoonTypeSafe/TaifoonTypeSafe.node.js.map +1 -1
- package/dist/nodes/TaifoonTypeSafe/jev/abi.d.ts +7 -0
- package/dist/nodes/TaifoonTypeSafe/jev/abi.js +83 -0
- package/dist/nodes/TaifoonTypeSafe/jev/abi.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/contracts.d.ts +33 -0
- package/dist/nodes/TaifoonTypeSafe/jev/contracts.js +25 -0
- package/dist/nodes/TaifoonTypeSafe/jev/contracts.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/assurance-hook.d.ts +6 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/assurance-hook.js +17 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/assurance-hook.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/bitagent-erc8183.d.ts +7 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/bitagent-erc8183.js +17 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/bitagent-erc8183.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/index.d.ts +12 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/index.js +25 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/index.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/judge-adapter.d.ts +5 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/judge-adapter.js +17 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/judge-adapter.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/types.d.ts +25 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/types.js +13 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/types.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/virtuals-erc8183.d.ts +6 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/virtuals-erc8183.js +17 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/virtuals-erc8183.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/virtuals-memo-acp.d.ts +5 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/virtuals-memo-acp.js +17 -0
- package/dist/nodes/TaifoonTypeSafe/jev/evaluator/virtuals-memo-acp.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/hash.d.ts +8 -0
- package/dist/nodes/TaifoonTypeSafe/jev/hash.js +139 -0
- package/dist/nodes/TaifoonTypeSafe/jev/hash.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/receipt.d.ts +64 -0
- package/dist/nodes/TaifoonTypeSafe/jev/receipt.js +47 -0
- package/dist/nodes/TaifoonTypeSafe/jev/receipt.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/record.d.ts +31 -0
- package/dist/nodes/TaifoonTypeSafe/jev/record.js +43 -0
- package/dist/nodes/TaifoonTypeSafe/jev/record.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/records.d.ts +74 -0
- package/dist/nodes/TaifoonTypeSafe/jev/records.js +61 -0
- package/dist/nodes/TaifoonTypeSafe/jev/records.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/jev/rubric.d.ts +97 -0
- package/dist/nodes/TaifoonTypeSafe/jev/rubric.js +89 -0
- package/dist/nodes/TaifoonTypeSafe/jev/rubric.js.map +1 -0
- package/dist/nodes/TaifoonTypeSafe/translate.js +15 -18
- package/dist/nodes/TaifoonTypeSafe/translate.js.map +1 -1
- package/dist/package.json +11 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/HOW_IT_WORKS.md +74 -0
- package/docs/JEV_OPTIONS.md +20 -0
- package/docs/KEY_POLICY.md +0 -6
- package/docs/MCP.md +2 -3
- package/docs/OUTPUTS.md +55 -0
- package/docs/RELIABILITY.md +51 -0
- package/docs/SECURE_KEYS.md +2 -2
- package/docs/TRADING_EXAMPLES.md +79 -0
- package/docs/TRANSLATION.md +32 -0
- package/docs/UPGRADING.md +8 -0
- package/package.json +11 -5
package/README.md
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
# TypeSafe for n8n
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
gets this ticket, how urgent is it, is this invoice a duplicate. Today you either write brittle rules
|
|
5
|
-
for that, or you ask a chat model and then fight with its prose: parse the answer, handle the day it
|
|
6
|
-
says "It depends", pay for a paragraph you throw away.
|
|
3
|
+
**Let your n8n workflow make a decision, and send it to a person when it is not sure.**
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
- **What:** an n8n node that asks TypeSafe's Jev yes/no (Noul), pick-one (Choice) and rate-it (Score) questions
|
|
6
|
+
about any item, and routes it to **Pass**, **Fail** or **Review**.
|
|
7
|
+
- **Why:** a chat model writes prose you have to parse and guesses when unsure. This node returns a probability for
|
|
8
|
+
every answer, so an uncertain item goes to a person instead of going wrong quietly.
|
|
9
|
+
- **How:** in n8n, **Settings → Community Nodes → Install** `@taifoon/n8n-nodes-typesafe`, add your TypeSafe key, and ask
|
|
10
|
+
"Is this a refund request?".
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
[console.typesafe.ai](https://console.typesafe.ai). That is the only account involved: the node talks
|
|
15
|
-
to TypeSafe directly, and nobody else, including us, is in the path.
|
|
12
|
+
Use it to route tickets, classify rows, guard an LLM's input or output, or gate an agent's tool call for approval.
|
|
13
|
+
It is not for writing text, summarising, or reasoning about code.
|
|
16
14
|
|
|
17
15
|
```
|
|
18
16
|
item ──► TypeSafe ──► Pass confident, and it cleared your thresholds
|
|
@@ -20,83 +18,16 @@ item ──► TypeSafe ──► Pass confident, and it cleared your thres
|
|
|
20
18
|
└──► Review unsure, or the answer did not validate: send this to a person
|
|
21
19
|
```
|
|
22
20
|
|
|
23
|
-
## The idea: three systems, each doing the one thing it is good at
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
n8n Taifoon TypeSafe
|
|
27
|
-
the workflow the coordination layer the judge
|
|
28
|
-
───────────── ────────────────────── ─────────
|
|
29
|
-
gathers the item ──► turns your words into ──► answers each question
|
|
30
|
-
runs the branches typed questions with a probability
|
|
31
|
-
▲ turns the answers back ◄──
|
|
32
|
-
└──────────────── into Pass / Fail / Review,
|
|
33
|
-
and into sentences in the
|
|
34
|
-
asker's own language
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
- **n8n** is where your process already lives: the triggers, the data, the people who get notified.
|
|
38
|
-
It is good at moving things and bad at judgment.
|
|
39
|
-
- **TypeSafe** is a model that only judges. It cannot write an essay, which is the point: it returns
|
|
40
|
-
a number you can threshold, quickly and cheaply, instead of prose you have to interpret.
|
|
41
|
-
- **Taifoon's part is the layer between them**, and it is plain code that ships inside this node. Going
|
|
42
|
-
in, it compiles what you mean ("is this a refund?") into the three question types the model
|
|
43
|
-
understands. Coming out, it compiles the model's probabilities into the only three things a workflow
|
|
44
|
-
can act on: go ahead, do not, or ask a human. Every threshold in that step is yours and sits on the
|
|
45
|
-
canvas where you can see it. And when a person is waiting on the other end, it says the answers back
|
|
46
|
-
as sentences in the language they wrote in.
|
|
47
|
-
|
|
48
|
-
Why three outputs and not two: a yes/no forces a confident answer even when the model is guessing, and
|
|
49
|
-
that is how automations go wrong silently. **Review** is the honest third option. It is where the
|
|
50
|
-
low-confidence cases and the malformed answers go, so a person sees exactly the items that need one.
|
|
51
|
-
|
|
52
|
-
## Who this is for
|
|
53
|
-
|
|
54
|
-
- **Support and ops teams** routing tickets, emails and alerts without maintaining a wall of IF nodes.
|
|
55
|
-
- **Anyone putting an LLM in a workflow** who wants a cheap, fast guard in front of it or behind it:
|
|
56
|
-
is this input safe, is this output on topic, does it contain personal data.
|
|
57
|
-
- **Builders of data pipelines** who need to classify, de-duplicate or score thousands of rows and
|
|
58
|
-
cannot afford, or wait for, a chat model on each one.
|
|
59
|
-
- **People who do not trust a yes/no without a number.** Every answer comes with how sure the model
|
|
60
|
-
is, so the uncertain cases go to a human instead of going wrong quietly.
|
|
61
|
-
|
|
62
|
-
It is not for writing text, summarising, or reasoning about code. We measured that honestly; see
|
|
63
|
-
[What it is good and bad at](#what-it-is-good-and-bad-at).
|
|
64
|
-
|
|
65
|
-
## Three kinds of question
|
|
66
|
-
|
|
67
|
-
| You ask | You get back | Think of it as |
|
|
68
|
-
|---|---|---|
|
|
69
|
-
| **Yes / no** ("Noul") | `p`, the probability the statement is true | an IF with a dial |
|
|
70
|
-
| **Pick one** ("Choice") | the option, a probability for every option, and a `confidence` | a Switch that knows when it is guessing |
|
|
71
|
-
| **Rate it** ("Score") | a level on a rubric you write, and a `confidence` | a ranking you can threshold |
|
|
72
|
-
|
|
73
|
-
Two things make the answers sharper, and both are optional:
|
|
74
|
-
|
|
75
|
-
- **Describe the options.** Write `billing = payments and refunds; technical = bugs and outages; other = fits none`.
|
|
76
|
-
The descriptions go to the model and are what separates options that sound alike. Add an `other`: a message
|
|
77
|
-
that fits nowhere is then answered *other* with confidence, instead of being forced into a team.
|
|
78
|
-
- **Say what yes and no mean.** A yes/no question has *Yes Means* and *No Means* fields for where the line is.
|
|
79
|
-
|
|
80
|
-
Ask all the questions that might matter in the same node. They are answered at once and independently,
|
|
81
|
-
so ten questions cost about the same as one.
|
|
82
|
-
|
|
83
21
|
## Install
|
|
84
22
|
|
|
85
23
|
In self-hosted n8n: **Settings → Community Nodes → Install**, then enter `@taifoon/n8n-nodes-typesafe`.
|
|
86
24
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
25
|
+
Get a TypeSafe API key from [console.typesafe.ai](https://console.typesafe.ai) and create a
|
|
26
|
+
**TypeSafe API** credential. The test button makes one tiny real call, so you know at once whether the key works.
|
|
27
|
+
The node talks to TypeSafe directly with your key, and nobody else, including us, is in the path.
|
|
90
28
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
secrets file so nobody ever sees it: [Supplying keys securely](docs/SECURE_KEYS.md).
|
|
94
|
-
|
|
95
|
-
**Upgrading from 1.1 or earlier?** The credential type was renamed (from `typeSafeApi` to
|
|
96
|
-
`taifoonTypeSafeApi`) so it cannot collide with other TypeSafe packages or a future built-in node. After
|
|
97
|
-
updating, create the **TypeSafe API** credential again and select it in your TypeSafe nodes. Nothing else
|
|
98
|
-
changed. If you pre-fill credentials from a file, use the new name as the key
|
|
99
|
-
([Supplying keys securely](docs/SECURE_KEYS.md)).
|
|
29
|
+
Running n8n for a team? [Supply the key from a secrets file](docs/SECURE_KEYS.md). Upgrading from 1.1 or
|
|
30
|
+
earlier? The credential type was renamed: [Upgrading](docs/UPGRADING.md).
|
|
100
31
|
|
|
101
32
|
## Try it in two minutes
|
|
102
33
|
|
|
@@ -113,227 +44,55 @@ changed. If you pre-fill credentials from a file, use the new name as the key
|
|
|
113
44
|
|
|
114
45
|
Ready-made versions are in [`examples/`](examples).
|
|
115
46
|
|
|
116
|
-
##
|
|
117
|
-
|
|
118
|
-
The **Translate** operation turns a sentence into questions:
|
|
119
|
-
|
|
120
|
-
> *Check if the customer is asking for a refund. Classify the ticket into billing, technical, sales or
|
|
121
|
-
> abuse. Rate the urgency from 1 to 5.*
|
|
122
|
-
|
|
123
|
-
becomes a yes/no, a pick-one with exactly those four options, and a five-level rating. It runs inside
|
|
124
|
-
the node: no network call, no key, no cost, and the same sentence always gives the same result.
|
|
125
|
-
|
|
126
|
-
It understands **English, Spanish, German, French, Portuguese, Italian, Polish, Dutch, Russian, Japanese
|
|
127
|
-
and Arabic**, detects the language per sentence, and you can mix them in one task. Anything else still
|
|
128
|
-
works as a yes/no.
|
|
129
|
-
|
|
130
|
-
**Your language is not here? Please add it.** A language is one small word pack in
|
|
131
|
-
[`nodes/TaifoonTypeSafe/translate.ts`](nodes/TaifoonTypeSafe/translate.ts): the verbs that mean "pick
|
|
132
|
-
one", the words that mean "rate it", how options are introduced and separated, how a scale is written,
|
|
133
|
-
and a four-level default rubric. No logic changes. Add the pack, add one test sentence to the self-test,
|
|
134
|
-
open a pull request. Native speakers catch what we cannot: we would especially welcome Chinese, Korean,
|
|
135
|
-
Hindi, Turkish, Ukrainian, Swedish, Hebrew and Indonesian, and corrections to the eleven we ship.
|
|
136
|
-
|
|
137
|
-
It splits a sentence that holds several jobs (*check if it is a refund and rate the urgency*), keeps the levels you
|
|
138
|
-
name (*rate the tone as polite, neutral or rude*) and reads *from 5 to 1* as the 1 to 5 scale. When it cannot do what
|
|
139
|
-
you wrote it says so in `warnings` rather than substituting quietly: a *0 to 10* scale has eleven steps and a rating
|
|
140
|
-
takes at most ten, and *is the customer new or returning?* asked as a yes/no answers whether EITHER holds, not which.
|
|
141
|
-
|
|
142
|
-
It is deliberately literal. It will not invent categories you did not name: *"classify this ticket"*
|
|
143
|
-
with no list comes back flagged `needs_input`. It suggests thresholds but never applies them for you,
|
|
144
|
-
for the reason in the next section.
|
|
145
|
-
|
|
146
|
-
## Answering people in their own language
|
|
147
|
-
|
|
148
|
-
Branches are for workflows. When a person is waiting for the answer (a support chat, a Telegram bot, a
|
|
149
|
-
trading assistant), `{"noul": 0.97}` is no use to them. Set **Reply Language** on the Ask operation and
|
|
150
|
-
the output gains a `reply`:
|
|
151
|
-
|
|
152
|
-
```json
|
|
153
|
-
{ "lang": "de", "flagHuman": true,
|
|
154
|
-
"text": "Prüfe, ob die Volatilität ungewöhnlich hoch ist. Ja (94 % sicher)\n? Bewerte die Dringlichkeit ... Vermutlich 4 (4 von 5), aber unsicher (36 %)\nNicht sicher genug: Ich gebe das an einen Menschen weiter.",
|
|
155
|
-
"lines": [{ "id": "...", "question": "...", "answer": "...", "outcome": "review" }], "verdict": "..." }
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
- **Match Questions** answers in the language the questions were written in, so one workflow serves
|
|
159
|
-
every customer. Or pin a language: English questions, Polish answers.
|
|
160
|
-
- It is templates, not a model: free, offline, and the same answers always read the same. The person's
|
|
161
|
-
own sentence, options and rubric levels are echoed exactly as they wrote them; only the glue around
|
|
162
|
-
them is translated, so nothing is paraphrased and nothing is invented.
|
|
163
|
-
- It never rounds doubt away. A coin-flip reads as *hard to say*, not yes. A rating the model is spread
|
|
164
|
-
across reads as *probably 4, but not sure*. And when anything went to Review, `flagHuman` is true and the
|
|
165
|
-
last line says a person is taking over. Wire that to a person, do not soften it.
|
|
166
|
-
|
|
167
|
-
The same eleven languages as Translate, and the same request: a voice is one row of thirteen short
|
|
168
|
-
strings in [`translate.ts`](nodes/TaifoonTypeSafe/translate.ts). Native speakers, please correct ours.
|
|
169
|
-
|
|
170
|
-
## Raw output: the model's own numbers, untouched
|
|
171
|
-
|
|
172
|
-
Everything above — Routing, Reply, the per-question shaping — is this node interpreting the answer for
|
|
173
|
-
you. When you would rather do that yourself, turn on **Raw Output** on the Ask operation. The node then
|
|
174
|
-
returns the API's answer *exactly as TypeSafe sent it*, with none of its interpretation:
|
|
175
|
-
|
|
176
|
-
```json
|
|
177
|
-
{ "model": "jev-latest", "provider": "typesafe", "connection": "direct", "latency_ms": 812,
|
|
178
|
-
"usage": { "input_tokens": 545 },
|
|
179
|
-
"raw": { "model": "jev-latest",
|
|
180
|
-
"answers": {
|
|
181
|
-
"is_refund": { "noul": 0.98 },
|
|
182
|
-
"urgency": { "score": 3.6, "confidence": 0.41, "probabilities": [ ... ], "legend": [ ... ] },
|
|
183
|
-
"which_lane": { "choice": "billing", "confidence": 0.77, "probabilities": { "billing": 0.77, "shipping": 0.19, "other": 0.04 } }
|
|
184
|
-
} } }
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
- **No Routing, no Reply, no reshaping.** `raw` is the whole `{answers, model, usage}` object the model
|
|
188
|
-
returned. The probabilities, confidences and `noul`/`score`/`choice` values are the model's own — this
|
|
189
|
-
is the `--raw` form for when you want the raw calibration to feed your own logic, a training set, or a
|
|
190
|
-
model that learns from Jev's best cases.
|
|
191
|
-
- **Everything flows on the first output.** The fail/review outputs are a Routing feature, and Routing
|
|
192
|
-
is skipped in raw mode, so nothing is split off.
|
|
193
|
-
- Works on both connections (your key and the free trial). `Fail Closed` still applies before the raw
|
|
194
|
-
object is emitted, so a malformed answer still stops the item unless you turn it off.
|
|
195
|
-
|
|
196
|
-
## Basic trading tasks, with gates
|
|
197
|
-
|
|
198
|
-
A worked example of the whole loop on something less forgiving than support tickets. These are real:
|
|
199
|
-
live 5-minute candles, the real model, run on 2026-09-21. A program computed the facts first
|
|
200
|
-
(averages, ranges, volatility ratios, whether the New York morning session is open); each task is
|
|
201
|
-
written the way a person would type it, one per language; the gates are plain thresholds in code.
|
|
202
|
-
|
|
203
|
-
**A pre-trade entry gate, in English** (NQ, 798 ms, left by **Fail**)
|
|
204
|
-
|
|
205
|
-
> Check if price is above its 20-bar average. Check if the last hour's move is larger than usual for this market. Classify the market into trending up, trending down or ranging. Rate how stretched price is from its average from 1 to 5.
|
|
206
|
-
|
|
207
|
-
| compiled to | gate |
|
|
208
|
-
|---|---|
|
|
209
|
-
| noul | `gte` 0.7 |
|
|
210
|
-
| noul | `lte` 0.5 |
|
|
211
|
-
| choice | `minConfidence` 0.6, `in` trending up |
|
|
212
|
-
| score | `max` 2 |
|
|
213
|
-
|
|
214
|
-
```
|
|
215
|
-
✓ Check if price is above its 20-bar average. Yes (99% sure)
|
|
216
|
-
✗ Check if the last hour's move is larger than usual for this market. Yes (94% sure)
|
|
217
|
-
✓ Classify the market into trending up, trending down or ranging. trending up (86% confident)
|
|
218
|
-
✓ Rate how stretched price is from its average from 1 to 5. 2 (2 of 5), 55% confident
|
|
219
|
-
At least one check did not pass.
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
The second check failed on purpose: the gate wants a calm last hour (`lte 0.5`) and the hour was not calm.
|
|
223
|
-
That is a gate doing its job, not the model being wrong.
|
|
224
|
-
|
|
225
|
-
**A pre-trade order sanity check, in Japanese** (BTC, 301 ms, left by **Review**)
|
|
226
|
-
|
|
227
|
-
> この注文の数量は通常より異常に大きいですか。指値は現在の価格から大きく離れていますか。この注文を次のいずれかに分類してください:通常、要確認、誤発注の疑い。
|
|
228
|
-
|
|
229
|
-
| compiled to | gate |
|
|
230
|
-
|---|---|
|
|
231
|
-
| noul | `lte` 0.3 |
|
|
232
|
-
| noul | `lte` 0.3 |
|
|
233
|
-
| choice | `minConfidence` 0.6, `in` 通常 |
|
|
234
|
-
|
|
235
|
-
```
|
|
236
|
-
✓ この注文の数量は通常より異常に大きいですか。 いいえ(確信度86%)
|
|
237
|
-
✓ 指値は現在の価格から大きく離れていますか。 いいえ(確信度94%)
|
|
238
|
-
? この注文を次のいずれかに分類してください:通常、要確認、誤発注の疑い。 おそらく通常ですが、確信はありません(46%)
|
|
239
|
-
確信が足りないため、担当者に確認を依頼します。
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
Both yes/no checks passed, but the model would not commit to a category, so the order goes to a person.
|
|
243
|
-
That is what Review is for. (The order is a sample ticket measured against the real last price.)
|
|
244
|
-
|
|
245
|
-
**An exit guard, in German** (BTC, 663 ms, left by **Review**)
|
|
246
|
-
|
|
247
|
-
> Prüfe, ob der Kurs unter dem 20-Perioden-Durchschnitt liegt. Prüfe, ob die Volatilität ungewöhnlich hoch ist. Bewerte die Dringlichkeit, eine Long-Position zu verkleinern, von 1 bis 5.
|
|
248
|
-
|
|
249
|
-
| compiled to | gate |
|
|
250
|
-
|---|---|
|
|
251
|
-
| noul | reported, not gated |
|
|
252
|
-
| noul | reported, not gated |
|
|
253
|
-
| score | `min` 3, `minConfidence` 0.5 |
|
|
254
|
-
|
|
255
|
-
```
|
|
256
|
-
Prüfe, ob der Kurs unter dem 20-Perioden-Durchschnitt liegt. Nein (99 % sicher)
|
|
257
|
-
Prüfe, ob die Volatilität ungewöhnlich hoch ist. Ja (94 % sicher)
|
|
258
|
-
? Bewerte die Dringlichkeit, eine Long-Position zu verkleinern, von 1 bis 5. Vermutlich 4 (4 von 5), aber unsicher (36 %)
|
|
259
|
-
Nicht sicher genug: Ich gebe das an einen Menschen weiter.
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
A rating is a centre of mass. Without `minConfidence` this one would have cleared `min 3` while the model
|
|
263
|
-
was only about a third sure. We found that in this very run, which is why a rating gate can now ask for
|
|
264
|
-
confidence too.
|
|
265
|
-
|
|
266
|
-
All eleven languages, with the facts the model was shown: [docs/TRADING_GATES.md](docs/TRADING_GATES.md).
|
|
267
|
-
Across the run, 11 of 11 languages were detected, the model's reading of the first fact matched plain code in
|
|
268
|
-
11 of 11, the median call took 295 ms, and all 11 calls together cost 0.000331 USD.
|
|
269
|
-
|
|
270
|
-
**What this is not.** These gates describe and guard a state a program has already measured. They do not
|
|
271
|
-
forecast. We tested that hard: six pre-registered trials on these same markets, and no model (this one,
|
|
272
|
-
Claude, or our own) forecast direction. A model in a trading loop supplies judgment about *now*; it does
|
|
273
|
-
not create an edge, and a strategy without one loses faster with a model in it. Keep the arithmetic, the
|
|
274
|
-
thresholds and every veto in code.
|
|
275
|
-
|
|
276
|
-
## The one rule about routing
|
|
277
|
-
|
|
278
|
-
An item leaves by **Pass** only if *every* question you put in Routing passed. So only route the
|
|
279
|
-
questions you actually want to gate on. If you route `urgency` as well, a perfectly good refund ticket
|
|
280
|
-
"fails" just because it is not urgent. We made exactly that mistake while building this.
|
|
47
|
+
## Three kinds of question
|
|
281
48
|
|
|
282
|
-
|
|
|
49
|
+
| You ask | You get back | Think of it as |
|
|
283
50
|
|---|---|---|
|
|
284
|
-
| Yes / no | `
|
|
285
|
-
| Pick one |
|
|
286
|
-
| Rate it |
|
|
287
|
-
|
|
288
|
-
A mistake in Routing never reads as a pass. A rule that names a question you did not ask (a typo, a renamed ID), a
|
|
289
|
-
yes/no rule with no threshold, or a confidence bar on an answer that carries no confidence all send the item to
|
|
290
|
-
**Review**, with the reason in `decisions`.
|
|
291
|
-
|
|
292
|
-
Two details: a rating is a **zero-based level number** (0 is your first level; every answer includes a
|
|
293
|
-
`legend`), and an answer that does not validate always goes to Review. Nothing fails open.
|
|
294
|
-
|
|
295
|
-
## What it is good and bad at
|
|
296
|
-
|
|
297
|
-
We benchmarked it against Claude Sonnet, and the results are mixed in a useful way:
|
|
298
|
-
|
|
299
|
-
- **Answering a real system's yes/no checks:** it matched or beat Sonnet on every decision.
|
|
300
|
-
- **Forecasting next-day rain from two days of weather:** a tie (81% against 78%), and neither clearly
|
|
301
|
-
beat the naive "same as today".
|
|
302
|
-
- **Judging claims about small Python functions:** Sonnet got 100%, this got 83%. It is not a code
|
|
303
|
-
reasoner.
|
|
51
|
+
| **Yes / no** ("Noul") | `p`, the probability the statement is true | an IF with a dial |
|
|
52
|
+
| **Pick one** ("Choice") | the option, a probability for every option, and a `confidence` | a Switch that knows when it is guessing |
|
|
53
|
+
| **Rate it** ("Score") | a level on a rubric you write, and a `confidence` | a ranking you can threshold |
|
|
304
54
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
dozen of your own labelled items** before trusting them.
|
|
55
|
+
Describe the options, and add an `other`, to sharpen a Choice. Ask every question that might matter in one node:
|
|
56
|
+
they are answered at once and independently, so ten cost about the same as one.
|
|
308
57
|
|
|
309
|
-
##
|
|
58
|
+
## What you must know
|
|
310
59
|
|
|
60
|
+
- **Route only what you gate on.** An item leaves by **Pass** only if *every* routed question passed. Route
|
|
61
|
+
`urgency` too, and a good refund ticket "fails" for not being urgent.
|
|
62
|
+
- **Nothing fails open.** A Routing mistake, or an answer that does not validate, sends the item to **Review**.
|
|
63
|
+
- **A rating is a zero-based level number.** 0 is your first level; every answer includes a `legend`.
|
|
64
|
+
- **Fit thresholds on your own items.** Label a few dozen before you trust them. The raw probabilities are
|
|
65
|
+
not calibrated on your data.
|
|
311
66
|
- **Calculate first, then ask.** Do arithmetic in a Code node. Ask the model for judgment, never a sum.
|
|
312
|
-
- **
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
- **Remember what n8n stores.** By default n8n keeps every execution's data. If your items contain
|
|
317
|
-
personal data, set `EXECUTIONS_DATA_SAVE_ON_SUCCESS=none` on your instance. This node never writes
|
|
318
|
-
your key into an execution record, including when a request fails.
|
|
67
|
+
- **Leave Fail Closed on.** A malformed answer then stops the item instead of flowing on as an empty value.
|
|
68
|
+
|
|
69
|
+
Cost: about 0.6 to 0.8 s and 450 input tokens for three questions. TypeSafe charges 0.042 USD per million input
|
|
70
|
+
tokens and nothing for output: roughly 0.00002 USD per item. Input is text or JSON; no images or audio.
|
|
319
71
|
|
|
320
|
-
##
|
|
72
|
+
## More operations and options
|
|
321
73
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
74
|
+
- **Translate** turns a sentence into questions, in eleven languages, offline and free.
|
|
75
|
+
[How Translate works](docs/TRANSLATION.md)
|
|
76
|
+
- **Reply Language** says the answers back as sentences in the asker's language. **Raw Output** returns
|
|
77
|
+
TypeSafe's answer untouched. [Reply and Raw Output](docs/OUTPUTS.md)
|
|
78
|
+
- **Jev Options** grade an agent job under RUBRIC_v1 and return unsigned on-chain calls.
|
|
79
|
+
[Jev Options](docs/JEV_OPTIONS.md), and the standalone package [`@taifoon/jev`](https://github.com/taifoon-io/jev).
|
|
325
80
|
|
|
326
|
-
##
|
|
81
|
+
## Documentation
|
|
327
82
|
|
|
328
|
-
[
|
|
329
|
-
[
|
|
330
|
-
|
|
83
|
+
- [How it works, and who it is for](docs/HOW_IT_WORKS.md)
|
|
84
|
+
- [Routing, reliability, cost and benchmark](docs/RELIABILITY.md)
|
|
85
|
+
- [Workflow patterns](docs/WORKFLOWS.md)
|
|
86
|
+
- [TypeSafe over MCP, and an approval gate for agent tool calls](docs/MCP.md)
|
|
87
|
+
- [Basic trading tasks, with gates](docs/TRADING_EXAMPLES.md) and [in eleven languages](docs/TRADING_GATES.md)
|
|
88
|
+
- [Supplying keys securely](docs/SECURE_KEYS.md) · [Key policy and rotation](docs/KEY_POLICY.md)
|
|
331
89
|
|
|
332
90
|
This package integrates one service: TypeSafe. It is published from GitHub Actions with an npm provenance
|
|
333
91
|
statement, and every release must pass n8n's community-package scanner.
|
|
334
92
|
|
|
335
|
-
|
|
336
93
|
## Licence
|
|
337
94
|
|
|
95
|
+
Independent project. Jev and TypeSafe are products of TypeSafe AI, Inc., which does not endorse this package.
|
|
96
|
+
|
|
338
97
|
MIT. An independent community node by [Taifoon](https://github.com/taifoon-io). TypeSafe and Jev are
|
|
339
98
|
trademarks of TypeSafe AI; this project is not affiliated with or endorsed by TypeSafe AI.
|