@taurgis/bonsai 3.2.2 → 4.0.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 (57) hide show
  1. package/README.md +2 -2
  2. package/agents/agents/salesforce-docs-researcher.agent.md +4 -4
  3. package/bin/cli.mjs +7 -4
  4. package/dist/base-command.d.ts +37 -0
  5. package/dist/base-command.js +97 -6
  6. package/dist/commands/config/base.js +1 -0
  7. package/dist/commands/config/get.js +2 -2
  8. package/dist/commands/config/list.js +2 -2
  9. package/dist/commands/config/set.js +2 -2
  10. package/dist/commands/config/unset.js +2 -2
  11. package/dist/commands/fetch.js +4 -0
  12. package/dist/commands/inspect.js +11 -2
  13. package/dist/commands/list.d.ts +12 -9
  14. package/dist/commands/list.js +67 -39
  15. package/dist/commands/prune.d.ts +2 -0
  16. package/dist/commands/prune.js +35 -4
  17. package/dist/commands/status.js +10 -0
  18. package/dist/hooks/command-not-found/suggest.d.ts +1 -1
  19. package/dist/hooks/command-not-found/suggest.js +12 -2
  20. package/dist/lib/argv.d.ts +5 -0
  21. package/dist/lib/argv.js +27 -5
  22. package/dist/lib/cli-flag-manifest.d.ts +7 -0
  23. package/dist/lib/cli-flag-manifest.js +7 -0
  24. package/dist/lib/cli-presentation.d.ts +6 -4
  25. package/dist/lib/cli-presentation.js +7 -4
  26. package/dist/lib/cli-result-types.d.ts +25 -1
  27. package/dist/lib/config/index.d.ts +2 -2
  28. package/dist/lib/config/index.js +2 -2
  29. package/dist/lib/config/io.d.ts +9 -0
  30. package/dist/lib/config/io.js +71 -21
  31. package/dist/lib/config/schema.d.ts +2 -0
  32. package/dist/lib/config/schema.js +7 -0
  33. package/dist/lib/envelope.js +11 -4
  34. package/dist/lib/prune-flags.d.ts +2 -0
  35. package/dist/lib/prune-flags.js +18 -6
  36. package/dist/lib/research/artifact-index.js +7 -1
  37. package/dist/lib/research/artifact.js +20 -2
  38. package/dist/lib/research/browser.d.ts +12 -0
  39. package/dist/lib/research/browser.js +63 -8
  40. package/dist/lib/research/cli-io.d.ts +7 -0
  41. package/dist/lib/research/fetch-command-service.js +80 -23
  42. package/dist/lib/research/fetcher.js +3 -1
  43. package/dist/lib/research/import-command-service.js +22 -1
  44. package/dist/lib/research/metadata-filters.d.ts +18 -0
  45. package/dist/lib/research/metadata-filters.js +37 -0
  46. package/dist/lib/research/metadata-flags.d.ts +34 -0
  47. package/dist/lib/research/metadata-flags.js +45 -0
  48. package/dist/lib/research/prompt-injection.d.ts +2 -1
  49. package/dist/lib/research/prompt-injection.js +18 -2
  50. package/dist/lib/research/resolve-target.d.ts +2 -0
  51. package/dist/lib/research/resolve-target.js +1 -1
  52. package/dist/lib/research/storage.d.ts +4 -7
  53. package/dist/lib/research/storage.js +26 -25
  54. package/dist/lib/text.d.ts +14 -8
  55. package/dist/lib/text.js +21 -9
  56. package/oclif.manifest.json +120 -12
  57. package/package.json +2 -1
@@ -18,6 +18,10 @@
18
18
  {
19
19
  "description": "cache a volatile page with compressed JSON output",
20
20
  "command": "<%= config.bin %> https://news.ycombinator.com/ --format compressed --ttl 2h --json"
21
+ },
22
+ {
23
+ "description": "fetch multiple URLs in one batch (space-separated)",
24
+ "command": "<%= config.bin %> https://docs.nestjs.com/ https://docs.nestjs.com/first-steps"
21
25
  }
22
26
  ],
23
27
  "flags": {
@@ -37,9 +41,15 @@
37
41
  "allowNo": false,
38
42
  "type": "boolean"
39
43
  },
44
+ "toon": {
45
+ "description": "emit the same envelope as --json, encoded as TOON (fewer tokens); cannot be combined with --json",
46
+ "name": "toon",
47
+ "allowNo": false,
48
+ "type": "boolean"
49
+ },
40
50
  "topic": {
41
51
  "char": "t",
42
- "description": "main research topic for metadata",
52
+ "description": "main research topic for metadata (max 200 chars)",
43
53
  "name": "topic",
44
54
  "hasDynamicHelp": false,
45
55
  "multiple": false,
@@ -47,7 +57,7 @@
47
57
  },
48
58
  "tags": {
49
59
  "char": "g",
50
- "description": "taxonomic tags for this research (can be repeated)",
60
+ "description": "taxonomic tags for this research (can be repeated, max 100 chars each)",
51
61
  "name": "tags",
52
62
  "hasDynamicHelp": false,
53
63
  "multiple": true,
@@ -187,6 +197,12 @@
187
197
  "allowNo": false,
188
198
  "type": "boolean"
189
199
  },
200
+ "toon": {
201
+ "description": "emit the same envelope as --json, encoded as TOON (fewer tokens); cannot be combined with --json",
202
+ "name": "toon",
203
+ "allowNo": false,
204
+ "type": "boolean"
205
+ },
190
206
  "stdin": {
191
207
  "description": "read Markdown from stdin",
192
208
  "name": "stdin",
@@ -215,7 +231,7 @@
215
231
  },
216
232
  "topic": {
217
233
  "char": "t",
218
- "description": "main topic for this research note",
234
+ "description": "main topic for this research note (max 200 chars)",
219
235
  "name": "topic",
220
236
  "hasDynamicHelp": false,
221
237
  "multiple": false,
@@ -223,7 +239,7 @@
223
239
  },
224
240
  "tags": {
225
241
  "char": "g",
226
- "description": "taxonomic tags (can be repeated)",
242
+ "description": "taxonomic tags (can be repeated, max 100 chars each)",
227
243
  "name": "tags",
228
244
  "hasDynamicHelp": false,
229
245
  "multiple": true,
@@ -304,6 +320,10 @@
304
320
  {
305
321
  "description": "inspect cached metadata as JSON",
306
322
  "command": "<%= config.bin %> <%= command.id %> https://example.com/docs --json"
323
+ },
324
+ {
325
+ "description": "inspect multiple URLs in one batch (space-separated)",
326
+ "command": "<%= config.bin %> <%= command.id %> https://example.com/docs https://example.com/api"
307
327
  }
308
328
  ],
309
329
  "flags": {
@@ -322,6 +342,12 @@
322
342
  "name": "read-only",
323
343
  "allowNo": false,
324
344
  "type": "boolean"
345
+ },
346
+ "toon": {
347
+ "description": "emit the same envelope as --json, encoded as TOON (fewer tokens); cannot be combined with --json",
348
+ "name": "toon",
349
+ "allowNo": false,
350
+ "type": "boolean"
325
351
  }
326
352
  },
327
353
  "hasDynamicHelp": false,
@@ -338,7 +364,7 @@
338
364
  "list": {
339
365
  "aliases": [],
340
366
  "args": {},
341
- "description": "List page-level cached artifacts with source URLs, topic, tags, freshness, capture method, and token estimates.",
367
+ "description": "List page-level cached artifacts by source URL, topic, freshness, and token estimate. Pass --full for every metadata field (cache key, path, artifact type, tags, capture method, quality notes, timestamps).",
342
368
  "examples": [
343
369
  {
344
370
  "description": "list cached entries",
@@ -355,6 +381,10 @@
355
381
  {
356
382
  "description": "list entries matching a URL glob",
357
383
  "command": "<%= config.bin %> list --url \"https://react.dev/*\""
384
+ },
385
+ {
386
+ "description": "list every metadata field instead of the minimal default row",
387
+ "command": "<%= config.bin %> list --full --json"
358
388
  }
359
389
  ],
360
390
  "flags": {
@@ -374,6 +404,12 @@
374
404
  "allowNo": false,
375
405
  "type": "boolean"
376
406
  },
407
+ "toon": {
408
+ "description": "emit the same envelope as --json, encoded as TOON (fewer tokens); cannot be combined with --json",
409
+ "name": "toon",
410
+ "allowNo": false,
411
+ "type": "boolean"
412
+ },
377
413
  "topic": {
378
414
  "char": "t",
379
415
  "description": "exact topic (case-insensitive)",
@@ -436,12 +472,18 @@
436
472
  "type": "option"
437
473
  },
438
474
  "limit": {
439
- "description": "result count (default 50, max 100)",
475
+ "description": "result count (max 100)",
440
476
  "name": "limit",
441
477
  "default": 50,
442
478
  "hasDynamicHelp": false,
443
479
  "multiple": false,
444
480
  "type": "option"
481
+ },
482
+ "full": {
483
+ "description": "include every metadata field (cache key, path, artifact type, tags, capture method, quality notes, timestamps); default output is a minimal row (source URLs, topic, freshness, token estimate)",
484
+ "name": "full",
485
+ "allowNo": false,
486
+ "type": "boolean"
445
487
  }
446
488
  },
447
489
  "hasDynamicHelp": false,
@@ -458,7 +500,7 @@
458
500
  "prune": {
459
501
  "aliases": [],
460
502
  "args": {},
461
- "description": "Delete cached artifacts by content age, idle time, URL glob, or artifact type.",
503
+ "description": "Delete cached artifacts by content age, idle time, URL glob, artifact type, topic, or tags.",
462
504
  "examples": [
463
505
  {
464
506
  "description": "preview pruning entries older than 30 days",
@@ -471,6 +513,10 @@
471
513
  {
472
514
  "description": "prune entries matching a URL glob",
473
515
  "command": "<%= config.bin %> prune --url \"https://react.dev/*\" --yes"
516
+ },
517
+ {
518
+ "description": "prune entries tagged as deprecated",
519
+ "command": "<%= config.bin %> prune --tags deprecated --yes"
474
520
  }
475
521
  ],
476
522
  "flags": {
@@ -490,6 +536,12 @@
490
536
  "allowNo": false,
491
537
  "type": "boolean"
492
538
  },
539
+ "toon": {
540
+ "description": "emit the same envelope as --json, encoded as TOON (fewer tokens); cannot be combined with --json",
541
+ "name": "toon",
542
+ "allowNo": false,
543
+ "type": "boolean"
544
+ },
493
545
  "older-than": {
494
546
  "description": "content age threshold (fetched_at, else validated_at), e.g. \"30d\"",
495
547
  "name": "older-than",
@@ -511,6 +563,22 @@
511
563
  "multiple": false,
512
564
  "type": "option"
513
565
  },
566
+ "topic": {
567
+ "char": "t",
568
+ "description": "exact topic (case-insensitive)",
569
+ "name": "topic",
570
+ "hasDynamicHelp": false,
571
+ "multiple": false,
572
+ "type": "option"
573
+ },
574
+ "tags": {
575
+ "char": "g",
576
+ "description": "tags to require (must match all)",
577
+ "name": "tags",
578
+ "hasDynamicHelp": false,
579
+ "multiple": true,
580
+ "type": "option"
581
+ },
514
582
  "artifact-type": {
515
583
  "description": "artifact type to prune, including section children",
516
584
  "name": "artifact-type",
@@ -567,6 +635,10 @@
567
635
  {
568
636
  "description": "evaluate status with a specific tier and TTL",
569
637
  "command": "<%= config.bin %> <%= command.id %> https://example.com/docs --tier volatile --ttl 2h"
638
+ },
639
+ {
640
+ "description": "check multiple URLs in one batch (space-separated)",
641
+ "command": "<%= config.bin %> <%= command.id %> https://example.com/docs https://example.com/api"
570
642
  }
571
643
  ],
572
644
  "flags": {
@@ -586,6 +658,12 @@
586
658
  "allowNo": false,
587
659
  "type": "boolean"
588
660
  },
661
+ "toon": {
662
+ "description": "emit the same envelope as --json, encoded as TOON (fewer tokens); cannot be combined with --json",
663
+ "name": "toon",
664
+ "allowNo": false,
665
+ "type": "boolean"
666
+ },
589
667
  "tier": {
590
668
  "description": "freshness tier policy to evaluate; when omitted, uses the cached entry's own tier",
591
669
  "name": "tier",
@@ -655,6 +733,12 @@
655
733
  "name": "read-only",
656
734
  "allowNo": false,
657
735
  "type": "boolean"
736
+ },
737
+ "toon": {
738
+ "description": "emit the same envelope as --json, encoded as TOON (fewer tokens); cannot be combined with --json",
739
+ "name": "toon",
740
+ "allowNo": false,
741
+ "type": "boolean"
658
742
  }
659
743
  },
660
744
  "hasDynamicHelp": false,
@@ -677,7 +761,7 @@
677
761
  "required": false
678
762
  }
679
763
  },
680
- "description": "Print a config value. Without --global/--local, shows the merged effective value, in precedence order: a per-command override flag (e.g. `fetch --storage`) > env var > project file > user file > built-in default.\n\nValid keys: storage, summary.",
764
+ "description": "Print a config value. Without --global/--local, shows the merged effective value, in precedence order: a per-command override flag (e.g. `fetch --storage`) > env var > project file > user file > built-in default.\n\nValid keys: storage (global|project), summary (conservative|balanced|aggressive).",
681
765
  "examples": [
682
766
  {
683
767
  "description": "get the effective storage mode",
@@ -705,6 +789,12 @@
705
789
  "allowNo": false,
706
790
  "type": "boolean"
707
791
  },
792
+ "toon": {
793
+ "description": "emit the same envelope as --json, encoded as TOON (fewer tokens); cannot be combined with --json",
794
+ "name": "toon",
795
+ "allowNo": false,
796
+ "type": "boolean"
797
+ },
708
798
  "global": {
709
799
  "char": "g",
710
800
  "description": "read user-level config only",
@@ -738,7 +828,7 @@
738
828
  "config:list": {
739
829
  "aliases": [],
740
830
  "args": {},
741
- "description": "Show every configuration key with its current value. Use --global/--local to show a single scope.\n\nValid keys: storage, summary.",
831
+ "description": "Show every configuration key with its current value. Use --global/--local to show a single scope.\n\nValid keys: storage (global|project), summary (conservative|balanced|aggressive).",
742
832
  "examples": [
743
833
  {
744
834
  "description": "show all effective config values",
@@ -766,6 +856,12 @@
766
856
  "allowNo": false,
767
857
  "type": "boolean"
768
858
  },
859
+ "toon": {
860
+ "description": "emit the same envelope as --json, encoded as TOON (fewer tokens); cannot be combined with --json",
861
+ "name": "toon",
862
+ "allowNo": false,
863
+ "type": "boolean"
864
+ },
769
865
  "global": {
770
866
  "char": "g",
771
867
  "description": "show user-level config only",
@@ -810,7 +906,7 @@
810
906
  "required": false
811
907
  }
812
908
  },
813
- "description": "Persist a configuration value. Writes user-level config by default; pass --local for project-level config (.bonsai.json in cwd).\n\nValid keys: storage, summary. The inline form `<key>=<value>` is also accepted.",
909
+ "description": "Persist a configuration value. Writes user-level config by default; pass --local for project-level config (.bonsai.json in cwd).\n\nValid keys: storage (global|project), summary (conservative|balanced|aggressive). The inline form `<key>=<value>` is also accepted.",
814
910
  "examples": [
815
911
  {
816
912
  "description": "store research cache in the current project",
@@ -838,6 +934,12 @@
838
934
  "allowNo": false,
839
935
  "type": "boolean"
840
936
  },
937
+ "toon": {
938
+ "description": "emit the same envelope as --json, encoded as TOON (fewer tokens); cannot be combined with --json",
939
+ "name": "toon",
940
+ "allowNo": false,
941
+ "type": "boolean"
942
+ },
841
943
  "global": {
842
944
  "char": "g",
843
945
  "description": "write user-level config (default)",
@@ -883,7 +985,7 @@
883
985
  "required": false
884
986
  }
885
987
  },
886
- "description": "Delete a key from user-level config (default) or project-level config (--local), restoring the built-in default.\n\nValid keys: storage, summary.",
988
+ "description": "Delete a key from user-level config (default) or project-level config (--local), restoring the built-in default.\n\nValid keys: storage (global|project), summary (conservative|balanced|aggressive).",
887
989
  "examples": [
888
990
  {
889
991
  "description": "remove the user-level storage setting",
@@ -911,6 +1013,12 @@
911
1013
  "allowNo": false,
912
1014
  "type": "boolean"
913
1015
  },
1016
+ "toon": {
1017
+ "description": "emit the same envelope as --json, encoded as TOON (fewer tokens); cannot be combined with --json",
1018
+ "name": "toon",
1019
+ "allowNo": false,
1020
+ "type": "boolean"
1021
+ },
914
1022
  "global": {
915
1023
  "char": "g",
916
1024
  "description": "remove from user-level config (default)",
@@ -948,5 +1056,5 @@
948
1056
  "stdoutIsPrimaryData": true
949
1057
  }
950
1058
  },
951
- "version": "3.2.2"
1059
+ "version": "4.0.0"
952
1060
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taurgis/bonsai",
3
- "version": "3.2.2",
3
+ "version": "4.0.0",
4
4
  "description": "Bonsai is a standalone local research cache CLI for AI agents",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,6 +37,7 @@
37
37
  "@mozilla/readability": "^0.5.0",
38
38
  "@oclif/core": "^4.11.4",
39
39
  "@oclif/plugin-autocomplete": "^3.2.52",
40
+ "@toon-format/toon": "^4.0.0",
40
41
  "linkedom": "^0.18.12",
41
42
  "turndown": "^7.2.0",
42
43
  "undici": "^8.7.0",