@taifoon/n8n-nodes-typesafe 1.0.0 → 1.1.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.
@@ -0,0 +1,312 @@
1
+ # Basic trading gates, in eleven languages
2
+
3
+ Generated by `trading_tasks.mjs` on 2026-09-21 09:00 UTC from one real run: live 5-minute candles, the real model, nothing mocked.
4
+ Every reply below is what came back. 11 tasks, 11 of 11 languages detected, the model's reading of the first fact matched plain code in 11 of 11, median 295 ms a call, 7874 input tokens for all of it: 0.000331 USD.
5
+
6
+ **What these are.** Gates that *describe and guard* a state a program has already measured. They are not forecasts and not an edge: in our own six-trial study no model forecast direction on these tapes. Compute the numbers in code, ask the model only what takes judgment, and keep every threshold where you can see it.
7
+
8
+ ## The facts the model was shown
9
+
10
+ Computed in code from public candles before any question was asked.
11
+
12
+ ```json
13
+ {
14
+ "NQ": {
15
+ "market": "NQ",
16
+ "timeframe": "5m",
17
+ "as_of_utc": "2026-09-21T08:55:00.000Z",
18
+ "last_close": 30236.5,
19
+ "sma20": 30191.66,
20
+ "close_vs_sma20_pct": 0.149,
21
+ "price_is_above_sma20": true,
22
+ "change_last_hour_pct": 0.191,
23
+ "typical_abs_hourly_change_pct": 0.088,
24
+ "last_hour_move_vs_typical": 2.17,
25
+ "change_last_5h_pct": 0.504,
26
+ "up_bars_in_last_10": 5,
27
+ "atr14": 18.96,
28
+ "atr14_vs_its_median": 1.29,
29
+ "range_5h_high": 30237.75,
30
+ "range_5h_low": 30071,
31
+ "position_in_5h_range_0_to_1": 0.99,
32
+ "volume_last_hour_vs_median_hour": 1.36,
33
+ "weekday_utc": "Mon",
34
+ "ny_morning_session_open": false
35
+ },
36
+ "BTC": {
37
+ "market": "BTC",
38
+ "timeframe": "5m",
39
+ "as_of_utc": "2026-09-21T08:55:00.000Z",
40
+ "last_close": 83795.8,
41
+ "sma20": 82276.63,
42
+ "close_vs_sma20_pct": 1.846,
43
+ "price_is_above_sma20": true,
44
+ "change_last_hour_pct": 2.559,
45
+ "typical_abs_hourly_change_pct": 0.262,
46
+ "last_hour_move_vs_typical": 9.78,
47
+ "change_last_5h_pct": 2.993,
48
+ "up_bars_in_last_10": 8,
49
+ "atr14": 343.07,
50
+ "atr14_vs_its_median": 2.78,
51
+ "range_5h_high": 84182.9,
52
+ "range_5h_low": 81210.2,
53
+ "position_in_5h_range_0_to_1": 0.87,
54
+ "volume_last_hour_vs_median_hour": 7.35,
55
+ "weekday_utc": "Mon",
56
+ "ny_morning_session_open": false
57
+ }
58
+ }
59
+ ```
60
+
61
+ ## English · NQ · Entry gate
62
+
63
+ **The person wrote**
64
+
65
+ > 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.
66
+
67
+ **It compiled to**
68
+
69
+ | # | type | gate (yours, in code) |
70
+ |---|---|---|
71
+ | 1 | noul | gte 0.7 |
72
+ | 2 | noul | lte 0.5 |
73
+ | 3 | choice: trending up / trending down / ranging | minConfidence 0.6, in trending up |
74
+ | 4 | score: 5 levels | max 2 |
75
+
76
+ **The reply** (798 ms, branch `fail`)
77
+
78
+ ```
79
+ ✓ Check if price is above its 20-bar average. Yes (99% sure)
80
+ ✗ Check if the last hour's move is larger than usual for this market. Yes (94% sure)
81
+ ✓ Classify the market into trending up, trending down or ranging. trending up (86% confident)
82
+ ✓ Rate how stretched price is from its average from 1 to 5. 2 (2 of 5), 55% confident
83
+ At least one check did not pass.
84
+ ```
85
+
86
+ ## German · BTC · Exit guard
87
+
88
+ **The person wrote**
89
+
90
+ > 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.
91
+
92
+ **It compiled to**
93
+
94
+ | # | type | gate (yours, in code) |
95
+ |---|---|---|
96
+ | 1 | noul | none: reported, not gated |
97
+ | 2 | noul | none: reported, not gated |
98
+ | 3 | score: 5 levels | min 3, minConfidence 0.5 |
99
+
100
+ **The reply** (663 ms, branch `review`, flagged for a person)
101
+
102
+ ```
103
+ Prüfe, ob der Kurs unter dem 20-Perioden-Durchschnitt liegt. Nein (99 % sicher)
104
+ Prüfe, ob die Volatilität ungewöhnlich hoch ist. Ja (94 % sicher)
105
+ ? Bewerte die Dringlichkeit, eine Long-Position zu verkleinern, von 1 bis 5. Vermutlich 4 (4 von 5), aber unsicher (36 %)
106
+ Nicht sicher genug: Ich gebe das an einen Menschen weiter.
107
+ ```
108
+
109
+ ## Japanese · BTC · Order sanity (pre-trade risk check)
110
+
111
+ **The person wrote**
112
+
113
+ > この注文の数量は通常より異常に大きいですか。指値は現在の価格から大きく離れていますか。この注文を次のいずれかに分類してください:通常、要確認、誤発注の疑い。
114
+
115
+ **It compiled to**
116
+
117
+ | # | type | gate (yours, in code) |
118
+ |---|---|---|
119
+ | 1 | noul | lte 0.3 |
120
+ | 2 | noul | lte 0.3 |
121
+ | 3 | choice: 通常 / 要確認 / 誤発注の疑い | minConfidence 0.6, in 通常 |
122
+
123
+ **The reply** (301 ms, branch `review`, flagged for a person)
124
+
125
+ ```
126
+ ✓ この注文の数量は通常より異常に大きいですか。 いいえ(確信度86%)
127
+ ✓ 指値は現在の価格から大きく離れていますか。 いいえ(確信度94%)
128
+ ? この注文を次のいずれかに分類してください:通常、要確認、誤発注の疑い。 おそらく通常ですが、確信はありません(46%)
129
+ 確信が足りないため、担当者に確認を依頼します。
130
+ ```
131
+
132
+ ## Arabic · NQ · Session gate
133
+
134
+ **The person wrote**
135
+
136
+ > تحقق مما إذا كانت جلسة نيويورك الصباحية مفتوحة الآن. قيّم مستوى التقلب من 1 إلى 5.
137
+
138
+ **It compiled to**
139
+
140
+ | # | type | gate (yours, in code) |
141
+ |---|---|---|
142
+ | 1 | noul | gte 0.7 |
143
+ | 2 | score: 5 levels | none: reported, not gated |
144
+
145
+ **The reply** (298 ms, branch `fail`)
146
+
147
+ ```
148
+ ✗ تحقق مما إذا كانت جلسة نيويورك الصباحية مفتوحة الآن. لا (بثقة 95%)
149
+ قيّم مستوى التقلب من 1 إلى 5. 4 (4 من 5)، بثقة 64%
150
+ لم يجتز أحد الفحوص على الأقل.
151
+ ```
152
+
153
+ ## Russian · BTC · Range check
154
+
155
+ **The person wrote**
156
+
157
+ > Проверь, находится ли цена у верхней границы диапазона последних 5 часов. Классифицируй рынок как: тренд вверх, тренд вниз, боковик. Оцени риск входа в лонг сейчас от 1 до 5.
158
+
159
+ **It compiled to**
160
+
161
+ | # | type | gate (yours, in code) |
162
+ |---|---|---|
163
+ | 1 | noul | gte 0.7 |
164
+ | 2 | choice: тренд вверх / тренд вниз / боковик | minConfidence 0.6 |
165
+ | 3 | score: 5 levels | max 2, minConfidence 0.4 |
166
+
167
+ **The reply** (295 ms, branch `fail`)
168
+
169
+ ```
170
+ ✗ Проверь, находится ли цена у верхней границы диапазона последних 5 часов. Скорее да (69%)
171
+ ✓ Классифицируй рынок как: тренд вверх, тренд вниз, боковик. тренд вверх (уверенность 100%)
172
+ ✗ Оцени риск входа в лонг сейчас от 1 до 5. 4 (4 из 5), уверенность 44%
173
+ Как минимум одна проверка не пройдена.
174
+ ```
175
+
176
+ ## Polish · NQ · Entry gate
177
+
178
+ **The person wrote**
179
+
180
+ > Sprawdź, czy cena jest powyżej średniej z 20 świec. Sklasyfikuj rynek jako: trend wzrostowy, trend spadkowy, konsolidacja. Oceń ryzyko wejścia w długą pozycję od 1 do 5.
181
+
182
+ **It compiled to**
183
+
184
+ | # | type | gate (yours, in code) |
185
+ |---|---|---|
186
+ | 1 | noul | gte 0.7 |
187
+ | 2 | choice: trend wzrostowy / trend spadkowy / konsolidacja | minConfidence 0.6 |
188
+ | 3 | score: 5 levels | max 2, minConfidence 0.4 |
189
+
190
+ **The reply** (331 ms, branch `fail`)
191
+
192
+ ```
193
+ ✓ Sprawdź, czy cena jest powyżej średniej z 20 świec. Tak (pewność 99%)
194
+ ✓ Sklasyfikuj rynek jako: trend wzrostowy, trend spadkowy, konsolidacja. trend wzrostowy (pewność 65%)
195
+ ✗ Oceń ryzyko wejścia w długą pozycję od 1 do 5. 4 (4 z 5), pewność 40%
196
+ Co najmniej jeden warunek nie jest spełniony.
197
+ ```
198
+
199
+ ## Spanish · BTC · Reduce-position check
200
+
201
+ **The person wrote**
202
+
203
+ > Comprueba si el volumen de la última hora es mayor de lo habitual. Clasifica el mercado en alcista, bajista o lateral. Califica la urgencia de reducir la posición de 1 a 5.
204
+
205
+ **It compiled to**
206
+
207
+ | # | type | gate (yours, in code) |
208
+ |---|---|---|
209
+ | 1 | noul | none: reported, not gated |
210
+ | 2 | choice: alcista / bajista / lateral | minConfidence 0.6 |
211
+ | 3 | score: 5 levels | min 3 |
212
+
213
+ **The reply** (253 ms, branch `fail`)
214
+
215
+ ```
216
+ Comprueba si el volumen de la última hora es mayor de lo habitual. Sí (98% de certeza)
217
+ ✓ Clasifica el mercado en alcista, bajista o lateral. alcista (100% de confianza)
218
+ ✗ Califica la urgencia de reducir la posición de 1 a 5. Probablemente 3 (3 de 5), pero no es seguro (0%)
219
+ Al menos una comprobación no pasó.
220
+ ```
221
+
222
+ ## French · NQ · Entry gate
223
+
224
+ **The person wrote**
225
+
226
+ > Vérifie si le prix est au-dessus de sa moyenne sur 20 bougies. Classe le marché en haussier, baissier ou neutre. Note le risque d'entrer à l'achat maintenant de 1 à 5.
227
+
228
+ **It compiled to**
229
+
230
+ | # | type | gate (yours, in code) |
231
+ |---|---|---|
232
+ | 1 | noul | gte 0.7 |
233
+ | 2 | choice: haussier / baissier / neutre | minConfidence 0.6 |
234
+ | 3 | score: 5 levels | max 2, minConfidence 0.4 |
235
+
236
+ **The reply** (278 ms, branch `fail`)
237
+
238
+ ```
239
+ ✓ Vérifie si le prix est au-dessus de sa moyenne sur 20 bougies. Oui (sûr à 99 %)
240
+ ✓ Classe le marché en haussier, baissier ou neutre. haussier (confiance 92 %)
241
+ ✗ Note le risque d'entrer à l'achat maintenant de 1 à 5. 4 (4 sur 5), confiance 51 %
242
+ Au moins un contrôle n'est pas passé.
243
+ ```
244
+
245
+ ## Portuguese · BTC · Entry gate
246
+
247
+ **The person wrote**
248
+
249
+ > Verifica se o preço está acima da média de 20 velas. Classifica o mercado em alta, baixa ou lateral. Avalia o risco de entrar comprado agora de 1 a 5.
250
+
251
+ **It compiled to**
252
+
253
+ | # | type | gate (yours, in code) |
254
+ |---|---|---|
255
+ | 1 | noul | gte 0.7 |
256
+ | 2 | choice: alta / baixa / lateral | minConfidence 0.6 |
257
+ | 3 | score: 5 levels | max 2, minConfidence 0.4 |
258
+
259
+ **The reply** (278 ms, branch `fail`)
260
+
261
+ ```
262
+ ✓ Verifica se o preço está acima da média de 20 velas. Sim (99% de certeza)
263
+ ✓ Classifica o mercado em alta, baixa ou lateral. alta (100% de confiança)
264
+ ✗ Avalia o risco de entrar comprado agora de 1 a 5. 4 (4 de 5), 43% de confiança
265
+ Pelo menos uma verificação não passou.
266
+ ```
267
+
268
+ ## Italian · NQ · Entry gate
269
+
270
+ **The person wrote**
271
+
272
+ > Verifica se il prezzo è sopra la media a 20 candele. Classifica il mercato in rialzista, ribassista o laterale. Valuta il rischio di entrare long adesso da 1 a 5.
273
+
274
+ **It compiled to**
275
+
276
+ | # | type | gate (yours, in code) |
277
+ |---|---|---|
278
+ | 1 | noul | gte 0.7 |
279
+ | 2 | choice: rialzista / ribassista / laterale | minConfidence 0.6 |
280
+ | 3 | score: 5 levels | max 2, minConfidence 0.4 |
281
+
282
+ **The reply** (267 ms, branch `fail`)
283
+
284
+ ```
285
+ ✓ Verifica se il prezzo è sopra la media a 20 candele. Sì (sicuro al 99%)
286
+ ✓ Classifica il mercato in rialzista, ribassista o laterale. rialzista (confidenza 92%)
287
+ ✗ Valuta il rischio di entrare long adesso da 1 a 5. 4 (4 di 5), confidenza 52%
288
+ Almeno un controllo non è superato.
289
+ ```
290
+
291
+ ## Dutch · BTC · Entry gate
292
+
293
+ **The person wrote**
294
+
295
+ > Controleer of de prijs boven het 20-bars gemiddelde ligt. Classificeer de markt als stijgend, dalend of zijwaarts. Beoordeel het risico van nu long gaan van 1 tot 5.
296
+
297
+ **It compiled to**
298
+
299
+ | # | type | gate (yours, in code) |
300
+ |---|---|---|
301
+ | 1 | noul | gte 0.7 |
302
+ | 2 | choice: stijgend / dalend / zijwaarts | minConfidence 0.6 |
303
+ | 3 | score: 5 levels | max 2, minConfidence 0.4 |
304
+
305
+ **The reply** (293 ms, branch `review`, flagged for a person)
306
+
307
+ ```
308
+ ✓ Controleer of de prijs boven het 20-bars gemiddelde ligt. Ja (98% zeker)
309
+ ✓ Classificeer de markt als stijgend, dalend of zijwaarts. stijgend (100% zekerheid)
310
+ ? Beoordeel het risico van nu long gaan van 1 tot 5. Waarschijnlijk 4 (4 van 5), maar niet zeker (32%)
311
+ Niet zeker genoeg: ik geef dit door aan een mens.
312
+ ```
@@ -50,3 +50,43 @@ threshold on your own labelled items, and leave a question unrouted until you ha
50
50
  With `jev`, state is any JSON up to 96,000 characters: `{{ JSON.stringify($json) }}` sends the whole
51
51
  incoming item. Compute first, judge second: do arithmetic in a Code node and send the result; ask the
52
52
  model for judgment, never for a sum.
53
+
54
+ ## The reply: answers back into sentences
55
+
56
+ The third leg, for chat surfaces. `reply(answers, { questions, decisions, branch, lang })` returns
57
+ `{ lang, lines, verdict, flagHuman, text }`. It is the same kind of code as the rest: templates, no model.
58
+
59
+ | Answer | How it is said (English voice) |
60
+ |---|---|
61
+ | yes/no, p at least 0.8 | `Yes (97% sure)` |
62
+ | 0.6 to 0.8 | `Probably yes (74%)` |
63
+ | 0.4 to 0.6 | `Hard to say (52% likely)`: never yes, never no |
64
+ | 0.2 to 0.4 | `Probably not (70%)`: the percentage is how sure it is of NO |
65
+ | under 0.2 | `No (97% sure)` |
66
+ | pick one | `billing (93% confident)`; sent to Review, or under 0.6 with no gate: `Probably billing, but not sure (41%)` |
67
+ | rate it | the level's own label and its place: `Medium (3 of 5), 70% confident`; under 0.4, or sent to Review: `Probably Medium (3 of 5), but not sure (33%)` |
68
+ | did not validate | `No valid answer`: never read as a no |
69
+ | a selection with no options | not asked; the person is told `List the options to choose between, and I will pick one.` |
70
+
71
+ Rules that keep it honest:
72
+
73
+ 1. **Echo, do not paraphrase.** Each line starts with the clause exactly as the person wrote it
74
+ (`source`, kept by Translate), and options and levels are the person's own words. Only the glue is translated.
75
+ 2. **The language is the asker's.** Pinned, or the language most of the questions were written in.
76
+ 3. **A verdict states an outcome, never an action.** `Every check passed.`, not "going ahead": on an exit
77
+ guard, passing does not mean go.
78
+ 4. **Review is said out loud.** `flagHuman` is true when any line went to Review, and the last line says a
79
+ person is taking over.
80
+ 5. **A rating is a centre of mass.** The value is fractional (3.24 on a five-level scale is "between 4 and
81
+ 5, nearer 4"); the reply names the nearest level and, when confidence is low, says it is unsure. A gate on
82
+ a rating can carry `minConfidence` so an unsure rating goes to Review instead of clearing `min` by accident.
83
+
84
+ Adding a voice is adding one row to `VOICES` and one line to the self-test.
85
+
86
+ ### What the first real run caught
87
+
88
+ We ran eleven trading tasks in eleven languages against the real model before shipping this, and it found
89
+ bugs no unit test had: French `moyenne sur 20 bougies` was read as a rating "out of 20" (a number that
90
+ counts something is not a scale); the Arabic feminine lead `مما إذا كانت` left a stray letter, and removing
91
+ a scale left its `من` dangling; a German question ended in `,?`; our English scale notes `(lowest)` leaked
92
+ into Russian replies. Each is now a regression check. The self-test has 107.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taifoon/n8n-nodes-typesafe",
3
- "version": "1.0.0",
3
+ "version": "1.1.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",