@creationix/jot 0.0.1 → 0.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.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +112 -23
  3. package/dist/jot.cjs +446 -0
  4. package/dist/jot.d.ts +6 -0
  5. package/dist/jot.js +442 -0
  6. package/package.json +34 -4
  7. package/SUMMARY.md +0 -151
  8. package/TOKEN_COUNTS.md +0 -97
  9. package/bun.lock +0 -19
  10. package/jot.test.ts +0 -133
  11. package/jot.ts +0 -650
  12. package/samples/chat.jot +0 -1
  13. package/samples/chat.json +0 -1
  14. package/samples/chat.pretty.jot +0 -6
  15. package/samples/chat.pretty.json +0 -16
  16. package/samples/firewall.jot +0 -1
  17. package/samples/firewall.json +0 -1
  18. package/samples/firewall.pretty.jot +0 -235
  19. package/samples/firewall.pretty.json +0 -344
  20. package/samples/github-issue.jot +0 -1
  21. package/samples/github-issue.json +0 -1
  22. package/samples/github-issue.pretty.jot +0 -15
  23. package/samples/github-issue.pretty.json +0 -20
  24. package/samples/hikes.jot +0 -1
  25. package/samples/hikes.json +0 -1
  26. package/samples/hikes.pretty.jot +0 -14
  27. package/samples/hikes.pretty.json +0 -38
  28. package/samples/irregular.jot +0 -1
  29. package/samples/irregular.json +0 -1
  30. package/samples/irregular.pretty.jot +0 -13
  31. package/samples/irregular.pretty.json +0 -23
  32. package/samples/json-counts-cache.jot +0 -1
  33. package/samples/json-counts-cache.json +0 -1
  34. package/samples/json-counts-cache.pretty.jot +0 -26
  35. package/samples/json-counts-cache.pretty.json +0 -26
  36. package/samples/key-folding-basic.jot +0 -1
  37. package/samples/key-folding-basic.json +0 -1
  38. package/samples/key-folding-basic.pretty.jot +0 -7
  39. package/samples/key-folding-basic.pretty.json +0 -25
  40. package/samples/key-folding-mixed.jot +0 -1
  41. package/samples/key-folding-mixed.json +0 -1
  42. package/samples/key-folding-mixed.pretty.jot +0 -16
  43. package/samples/key-folding-mixed.pretty.json +0 -24
  44. package/samples/key-folding-with-array.jot +0 -1
  45. package/samples/key-folding-with-array.json +0 -1
  46. package/samples/key-folding-with-array.pretty.jot +0 -6
  47. package/samples/key-folding-with-array.pretty.json +0 -29
  48. package/samples/large.jot +0 -1
  49. package/samples/large.json +0 -1
  50. package/samples/large.pretty.jot +0 -72
  51. package/samples/large.pretty.json +0 -93
  52. package/samples/logs.jot +0 -1
  53. package/samples/logs.json +0 -1
  54. package/samples/logs.pretty.jot +0 -96
  55. package/samples/logs.pretty.json +0 -350
  56. package/samples/medium.jot +0 -1
  57. package/samples/medium.json +0 -1
  58. package/samples/medium.pretty.jot +0 -13
  59. package/samples/medium.pretty.json +0 -30
  60. package/samples/metrics.jot +0 -1
  61. package/samples/metrics.json +0 -1
  62. package/samples/metrics.pretty.jot +0 -11
  63. package/samples/metrics.pretty.json +0 -25
  64. package/samples/package.jot +0 -1
  65. package/samples/package.json +0 -1
  66. package/samples/package.pretty.jot +0 -18
  67. package/samples/package.pretty.json +0 -18
  68. package/samples/products.jot +0 -1
  69. package/samples/products.json +0 -1
  70. package/samples/products.pretty.jot +0 -69
  71. package/samples/products.pretty.json +0 -235
  72. package/samples/routes.jot +0 -1
  73. package/samples/routes.json +0 -1
  74. package/samples/routes.pretty.jot +0 -142
  75. package/samples/routes.pretty.json +0 -354
  76. package/samples/small.jot +0 -1
  77. package/samples/small.json +0 -1
  78. package/samples/small.pretty.jot +0 -8
  79. package/samples/small.pretty.json +0 -12
  80. package/samples/users-50.jot +0 -1
  81. package/samples/users-50.json +0 -1
  82. package/samples/users-50.pretty.jot +0 -53
  83. package/samples/users-50.pretty.json +0 -354
@@ -1,235 +0,0 @@
1
- {
2
- active: true,
3
- ruleGroups: {
4
- php_attacks: {
5
- active: true,
6
- action: deny,
7
- rules: {
8
- php_suffix: {
9
- has: [{
10
- type: path,
11
- key: null,
12
- value.suf: .php
13
- }],
14
- missing: [{
15
- type: header,
16
- key: x-secret,
17
- value.eq: bypass
18
- }],
19
- phase: finalize,
20
- system: true
21
- },
22
- jsp_suffix: {
23
- has: [
24
- { type: path,
25
- key: null,
26
- value.suf: .jsp },
27
- { type: status,
28
- value.eq: 404 }
29
- ],
30
- missing: [{
31
- type: header,
32
- key: x-secret,
33
- value.eq: bypass
34
- }],
35
- phase: init,
36
- system: true
37
- },
38
- asp_suffix: {
39
- has: [{
40
- type: path,
41
- key: null,
42
- value.suf: .asp
43
- }],
44
- missing: [{
45
- type: header,
46
- key: x-secret,
47
- value.eq: bypass
48
- }],
49
- phase: finalize,
50
- system: true
51
- },
52
- cgi_suffix: {
53
- has: [{
54
- type: path,
55
- key: null,
56
- value.suf: .cgi
57
- }],
58
- missing: [{
59
- type: header,
60
- key: x-secret,
61
- value.eq: bypass
62
- }],
63
- phase: finalize,
64
- system: true
65
- }
66
- }
67
- },
68
- sql_injection: {
69
- active: true,
70
- action: deny,
71
- rules: {
72
- union_select: {
73
- has: [{
74
- type: query,
75
- key: null,
76
- value.contains: UNION SELECT
77
- }],
78
- phase: init,
79
- system: true
80
- },
81
- drop_table: {
82
- has: [{
83
- type: query,
84
- key: null,
85
- value.contains: DROP TABLE
86
- }],
87
- phase: init,
88
- system: true
89
- },
90
- or_1_equals_1: {
91
- has: [{
92
- type: query,
93
- key: null,
94
- value.regex: "OR\\s+1\\s*=\\s*1"
95
- }],
96
- phase: init,
97
- system: true
98
- }
99
- }
100
- },
101
- rate_limiting: {
102
- active: true,
103
- action: ratelimit,
104
- rules: {
105
- api_endpoints: {
106
- has: [{
107
- type: path,
108
- key: null,
109
- value.pre: /api/
110
- }],
111
- rateLimit: {
112
- requests: 100,
113
- window: 60,
114
- key: ip
115
- },
116
- phase: init,
117
- system: false
118
- },
119
- auth_endpoints: {
120
- has: [{
121
- type: path,
122
- key: null,
123
- value.pre: /auth/
124
- }],
125
- rateLimit: {
126
- requests: 10,
127
- window: 60,
128
- key: ip
129
- },
130
- phase: init,
131
- system: false
132
- },
133
- search_endpoint: {
134
- has: [{
135
- type: path,
136
- key: null,
137
- value.eq: /search
138
- }],
139
- rateLimit: {
140
- requests: 30,
141
- window: 60,
142
- key: ip
143
- },
144
- phase: init,
145
- system: false
146
- }
147
- }
148
- },
149
- geo_blocking: {
150
- active: false,
151
- action: deny,
152
- rules.blocked_countries: {
153
- has: [{
154
- type: geo,
155
- key: country,
156
- value.in: [ XX, YY, ZZ ]
157
- }],
158
- missing: [{
159
- type: header,
160
- key: x-bypass-geo,
161
- value.eq: allowed
162
- }],
163
- phase: init,
164
- system: false
165
- }
166
- },
167
- bot_protection: {
168
- active: true,
169
- action: challenge,
170
- rules: {
171
- missing_ua: {
172
- missing: [{
173
- type: header,
174
- key: user-agent,
175
- value.exists: true
176
- }],
177
- phase: init,
178
- system: true
179
- },
180
- known_bad_bots: {
181
- has: [{
182
- type: header,
183
- key: user-agent,
184
- value.regex: (BadBot|Scraper|Harvester)
185
- }],
186
- phase: init,
187
- system: true
188
- },
189
- suspicious_rate: {
190
- has: {{
191
- :type, key, value
192
- rate, ip, { gt: 50 }
193
- header, user-agent, { regex: ^Mozilla }
194
- }},
195
- phase: finalize,
196
- system: false
197
- }
198
- }
199
- },
200
- custom_rules: {
201
- active: true,
202
- action: log,
203
- rules: {
204
- admin_access: {
205
- has: [{
206
- type: path,
207
- key: null,
208
- value.pre: /admin
209
- }],
210
- missing: [{
211
- type: header,
212
- key: x-admin-token,
213
- value.exists: true
214
- }],
215
- phase: init,
216
- system: false
217
- },
218
- api_key_required: {
219
- has: [{
220
- type: path,
221
- key: null,
222
- value.pre: /api/v2/
223
- }],
224
- missing: [{
225
- type: header,
226
- key: x-api-key,
227
- value.exists: true
228
- }],
229
- phase: init,
230
- system: false
231
- }
232
- }
233
- }
234
- }
235
- }
@@ -1,344 +0,0 @@
1
- {
2
- "active": true,
3
- "ruleGroups": {
4
- "php_attacks": {
5
- "active": true,
6
- "action": "deny",
7
- "rules": {
8
- "php_suffix": {
9
- "has": [
10
- {
11
- "type": "path",
12
- "key": null,
13
- "value": {
14
- "suf": ".php"
15
- }
16
- }
17
- ],
18
- "missing": [
19
- {
20
- "type": "header",
21
- "key": "x-secret",
22
- "value": {
23
- "eq": "bypass"
24
- }
25
- }
26
- ],
27
- "phase": "finalize",
28
- "system": true
29
- },
30
- "jsp_suffix": {
31
- "has": [
32
- {
33
- "type": "path",
34
- "key": null,
35
- "value": {
36
- "suf": ".jsp"
37
- }
38
- },
39
- {
40
- "type": "status",
41
- "value": {
42
- "eq": 404
43
- }
44
- }
45
- ],
46
- "missing": [
47
- {
48
- "type": "header",
49
- "key": "x-secret",
50
- "value": {
51
- "eq": "bypass"
52
- }
53
- }
54
- ],
55
- "phase": "init",
56
- "system": true
57
- },
58
- "asp_suffix": {
59
- "has": [
60
- {
61
- "type": "path",
62
- "key": null,
63
- "value": {
64
- "suf": ".asp"
65
- }
66
- }
67
- ],
68
- "missing": [
69
- {
70
- "type": "header",
71
- "key": "x-secret",
72
- "value": {
73
- "eq": "bypass"
74
- }
75
- }
76
- ],
77
- "phase": "finalize",
78
- "system": true
79
- },
80
- "cgi_suffix": {
81
- "has": [
82
- {
83
- "type": "path",
84
- "key": null,
85
- "value": {
86
- "suf": ".cgi"
87
- }
88
- }
89
- ],
90
- "missing": [
91
- {
92
- "type": "header",
93
- "key": "x-secret",
94
- "value": {
95
- "eq": "bypass"
96
- }
97
- }
98
- ],
99
- "phase": "finalize",
100
- "system": true
101
- }
102
- }
103
- },
104
- "sql_injection": {
105
- "active": true,
106
- "action": "deny",
107
- "rules": {
108
- "union_select": {
109
- "has": [
110
- {
111
- "type": "query",
112
- "key": null,
113
- "value": {
114
- "contains": "UNION SELECT"
115
- }
116
- }
117
- ],
118
- "phase": "init",
119
- "system": true
120
- },
121
- "drop_table": {
122
- "has": [
123
- {
124
- "type": "query",
125
- "key": null,
126
- "value": {
127
- "contains": "DROP TABLE"
128
- }
129
- }
130
- ],
131
- "phase": "init",
132
- "system": true
133
- },
134
- "or_1_equals_1": {
135
- "has": [
136
- {
137
- "type": "query",
138
- "key": null,
139
- "value": {
140
- "regex": "OR\\s+1\\s*=\\s*1"
141
- }
142
- }
143
- ],
144
- "phase": "init",
145
- "system": true
146
- }
147
- }
148
- },
149
- "rate_limiting": {
150
- "active": true,
151
- "action": "ratelimit",
152
- "rules": {
153
- "api_endpoints": {
154
- "has": [
155
- {
156
- "type": "path",
157
- "key": null,
158
- "value": {
159
- "pre": "/api/"
160
- }
161
- }
162
- ],
163
- "rateLimit": {
164
- "requests": 100,
165
- "window": 60,
166
- "key": "ip"
167
- },
168
- "phase": "init",
169
- "system": false
170
- },
171
- "auth_endpoints": {
172
- "has": [
173
- {
174
- "type": "path",
175
- "key": null,
176
- "value": {
177
- "pre": "/auth/"
178
- }
179
- }
180
- ],
181
- "rateLimit": {
182
- "requests": 10,
183
- "window": 60,
184
- "key": "ip"
185
- },
186
- "phase": "init",
187
- "system": false
188
- },
189
- "search_endpoint": {
190
- "has": [
191
- {
192
- "type": "path",
193
- "key": null,
194
- "value": {
195
- "eq": "/search"
196
- }
197
- }
198
- ],
199
- "rateLimit": {
200
- "requests": 30,
201
- "window": 60,
202
- "key": "ip"
203
- },
204
- "phase": "init",
205
- "system": false
206
- }
207
- }
208
- },
209
- "geo_blocking": {
210
- "active": false,
211
- "action": "deny",
212
- "rules": {
213
- "blocked_countries": {
214
- "has": [
215
- {
216
- "type": "geo",
217
- "key": "country",
218
- "value": {
219
- "in": [
220
- "XX",
221
- "YY",
222
- "ZZ"
223
- ]
224
- }
225
- }
226
- ],
227
- "missing": [
228
- {
229
- "type": "header",
230
- "key": "x-bypass-geo",
231
- "value": {
232
- "eq": "allowed"
233
- }
234
- }
235
- ],
236
- "phase": "init",
237
- "system": false
238
- }
239
- }
240
- },
241
- "bot_protection": {
242
- "active": true,
243
- "action": "challenge",
244
- "rules": {
245
- "missing_ua": {
246
- "missing": [
247
- {
248
- "type": "header",
249
- "key": "user-agent",
250
- "value": {
251
- "exists": true
252
- }
253
- }
254
- ],
255
- "phase": "init",
256
- "system": true
257
- },
258
- "known_bad_bots": {
259
- "has": [
260
- {
261
- "type": "header",
262
- "key": "user-agent",
263
- "value": {
264
- "regex": "(BadBot|Scraper|Harvester)"
265
- }
266
- }
267
- ],
268
- "phase": "init",
269
- "system": true
270
- },
271
- "suspicious_rate": {
272
- "has": [
273
- {
274
- "type": "rate",
275
- "key": "ip",
276
- "value": {
277
- "gt": 50
278
- }
279
- },
280
- {
281
- "type": "header",
282
- "key": "user-agent",
283
- "value": {
284
- "regex": "^Mozilla"
285
- }
286
- }
287
- ],
288
- "phase": "finalize",
289
- "system": false
290
- }
291
- }
292
- },
293
- "custom_rules": {
294
- "active": true,
295
- "action": "log",
296
- "rules": {
297
- "admin_access": {
298
- "has": [
299
- {
300
- "type": "path",
301
- "key": null,
302
- "value": {
303
- "pre": "/admin"
304
- }
305
- }
306
- ],
307
- "missing": [
308
- {
309
- "type": "header",
310
- "key": "x-admin-token",
311
- "value": {
312
- "exists": true
313
- }
314
- }
315
- ],
316
- "phase": "init",
317
- "system": false
318
- },
319
- "api_key_required": {
320
- "has": [
321
- {
322
- "type": "path",
323
- "key": null,
324
- "value": {
325
- "pre": "/api/v2/"
326
- }
327
- }
328
- ],
329
- "missing": [
330
- {
331
- "type": "header",
332
- "key": "x-api-key",
333
- "value": {
334
- "exists": true
335
- }
336
- }
337
- ],
338
- "phase": "init",
339
- "system": false
340
- }
341
- }
342
- }
343
- }
344
- }
@@ -1 +0,0 @@
1
- {id:12345,title:"Bug: Memory leak in worker threads",state:open,user:{login:devuser,id:789},labels:{{:name,color;bug,d73a4a;priority-high,ff0000}},body:"When running multiple workers, memory increases continuously without garbage collection."}
@@ -1 +0,0 @@
1
- {"id":12345,"title":"Bug: Memory leak in worker threads","state":"open","user":{"login":"devuser","id":789},"labels":[{"name":"bug","color":"d73a4a"},{"name":"priority-high","color":"ff0000"}],"body":"When running multiple workers, memory increases continuously without garbage collection."}
@@ -1,15 +0,0 @@
1
- {
2
- id: 12345,
3
- title: "Bug: Memory leak in worker threads",
4
- state: open,
5
- user: {
6
- login: devuser,
7
- id: 789
8
- },
9
- labels: {{
10
- :name, color
11
- bug, d73a4a
12
- priority-high, ff0000
13
- }},
14
- body: "When running multiple workers, memory increases continuously without garbage collection."
15
- }
@@ -1,20 +0,0 @@
1
- {
2
- "id": 12345,
3
- "title": "Bug: Memory leak in worker threads",
4
- "state": "open",
5
- "user": {
6
- "login": "devuser",
7
- "id": 789
8
- },
9
- "labels": [
10
- {
11
- "name": "bug",
12
- "color": "d73a4a"
13
- },
14
- {
15
- "name": "priority-high",
16
- "color": "ff0000"
17
- }
18
- ],
19
- "body": "When running multiple workers, memory increases continuously without garbage collection."
20
- }
package/samples/hikes.jot DELETED
@@ -1 +0,0 @@
1
- {context:{task:Our favorite hikes together,location:Boulder,season:spring_2025},friends:[ana,luis,sam],hikes:{{:id,name,distanceKm,elevationGain,companion,wasSunny;1,Blue Lake Trail,7.5,320,ana,true;2,Ridge Overlook,9.2,540,luis,false;3,Wildflower Loop,5.1,180,sam,true}}}
@@ -1 +0,0 @@
1
- {"context":{"task":"Our favorite hikes together","location":"Boulder","season":"spring_2025"},"friends":["ana","luis","sam"],"hikes":[{"id":1,"name":"Blue Lake Trail","distanceKm":7.5,"elevationGain":320,"companion":"ana","wasSunny":true},{"id":2,"name":"Ridge Overlook","distanceKm":9.2,"elevationGain":540,"companion":"luis","wasSunny":false},{"id":3,"name":"Wildflower Loop","distanceKm":5.1,"elevationGain":180,"companion":"sam","wasSunny":true}]}
@@ -1,14 +0,0 @@
1
- {
2
- context: {
3
- task: Our favorite hikes together,
4
- location: Boulder,
5
- season: spring_2025
6
- },
7
- friends: [ ana, luis, sam ],
8
- hikes: {{
9
- :id, name, distanceKm, elevationGain, companion, wasSunny
10
- 1, Blue Lake Trail, 7.5, 320, ana, true
11
- 2, Ridge Overlook, 9.2, 540, luis, false
12
- 3, Wildflower Loop, 5.1, 180, sam, true
13
- }}
14
- }
@@ -1,38 +0,0 @@
1
- {
2
- "context": {
3
- "task": "Our favorite hikes together",
4
- "location": "Boulder",
5
- "season": "spring_2025"
6
- },
7
- "friends": [
8
- "ana",
9
- "luis",
10
- "sam"
11
- ],
12
- "hikes": [
13
- {
14
- "id": 1,
15
- "name": "Blue Lake Trail",
16
- "distanceKm": 7.5,
17
- "elevationGain": 320,
18
- "companion": "ana",
19
- "wasSunny": true
20
- },
21
- {
22
- "id": 2,
23
- "name": "Ridge Overlook",
24
- "distanceKm": 9.2,
25
- "elevationGain": 540,
26
- "companion": "luis",
27
- "wasSunny": false
28
- },
29
- {
30
- "id": 3,
31
- "name": "Wildflower Loop",
32
- "distanceKm": 5.1,
33
- "elevationGain": 180,
34
- "companion": "sam",
35
- "wasSunny": true
36
- }
37
- ]
38
- }
@@ -1 +0,0 @@
1
- {events:[{type:click,x:100,y:200},{type:scroll,offset:450},{type:keypress,key:Enter,shift:true},{type:resize,width:1920,height:1080}]}
@@ -1 +0,0 @@
1
- {"events":[{"type":"click","x":100,"y":200},{"type":"scroll","offset":450},{"type":"keypress","key":"Enter","shift":true},{"type":"resize","width":1920,"height":1080}]}
@@ -1,13 +0,0 @@
1
- { events: [
2
- { type: click,
3
- x: 100,
4
- y: 200 },
5
- { type: scroll,
6
- offset: 450 },
7
- { type: keypress,
8
- key: Enter,
9
- shift: true },
10
- { type: resize,
11
- width: 1920,
12
- height: 1080 }
13
- ] }