@peter.naydenov/shortcuts 4.0.1 → 4.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 (89) hide show
  1. package/AGENTS.md +54 -0
  2. package/Changelog.md +14 -0
  3. package/README.md +935 -426
  4. package/dist/plugins/click/_listenDOM.d.ts +2 -2
  5. package/dist/plugins/form/_listenDOM.d.ts +4 -4
  6. package/dist/plugins/hover/_listenDOM.d.ts +2 -2
  7. package/dist/plugins/key/_listenDOM.d.ts +2 -2
  8. package/dist/plugins/scroll/_listenDOM.d.ts +2 -2
  9. package/dist/shortcuts.cjs +1 -1
  10. package/dist/shortcuts.esm.mjs +1 -1
  11. package/dist/shortcuts.umd.js +1 -1
  12. package/graphify-out/.graphify_benchmark.json +35 -0
  13. package/graphify-out/.graphify_python +1 -0
  14. package/graphify-out/GRAPH_REPORT.md +121 -0
  15. package/graphify-out/cache/024633ee076562ce0dbc0bf3b5315906f4e5d48c57bc96856b98cd5d42a69009.json +1 -0
  16. package/graphify-out/cache/037d2ba5552034c06beca677b1914ac7a053f696dfeaf12ca0de06eb42659f18.json +1 -0
  17. package/graphify-out/cache/055bfc2a3bfb8747f7ee0b7335704d2dff1c071d25a9bdd4f954e4cc2d630772.json +1 -0
  18. package/graphify-out/cache/0b2f626892ed04f158e39593dbf5f266c2a5982a21b2dddb144edc79af81e2d1.json +1 -0
  19. package/graphify-out/cache/0c17fe866170c4ab4023ac0680d1e05c5dc232a17ac0f08dfa1e76c2eaf75c44.json +1 -0
  20. package/graphify-out/cache/1392dca26291b5396829f1a996aac2c1d34a03d134a5fcf54e4f15824ee74e2b.json +1 -0
  21. package/graphify-out/cache/18113cd08ebffb11ed91ffab9c6d34795e22bfb5993941db07a52eed6eba45b8.json +1 -0
  22. package/graphify-out/cache/1a7a71b157cadd117435818e1a6561157c2930c4066d3a207fe04e318f76b296.json +1 -0
  23. package/graphify-out/cache/2448db4b822a94d6f3512ce8788077f35dfb567aef8628a846fad841b40575e7.json +1 -0
  24. package/graphify-out/cache/2592868b7b9d2de3f2cb575b7bd68ca2f252d34f71c12f2e8721d789cfbfbf88.json +1 -0
  25. package/graphify-out/cache/2aaf58292523f67421e6f728fd97740c5bf07dd903cf267cf557a4383759ba5e.json +1 -0
  26. package/graphify-out/cache/349a418954e66e5ef45370dca740ebff559a72d11f5810f6d40c0af14ef768e0.json +1 -0
  27. package/graphify-out/cache/361eacb4abb14862b75257bdf673a353826bf5764fb187ccde94ae21454bcf99.json +1 -0
  28. package/graphify-out/cache/40b4c82a11a2a31b279563c143d91d7894eb3f3d0c386f8323cb8062bcdfadd5.json +1 -0
  29. package/graphify-out/cache/40db98ff036ad694953cb13628795fabc0c5892ff093dfdcc18a309ac0d10846.json +1 -0
  30. package/graphify-out/cache/43a590ac22f05be183ea1a4655922185595c969f79dd3df3d44d1c7e49355785.json +1 -0
  31. package/graphify-out/cache/4993a6e98dcf33bb6fa78341b4eeac4776e2322f10522eecdc5195aa7969f35a.json +1 -0
  32. package/graphify-out/cache/5095c6e52a24f4ecec9acf63835761ad508df88d56b1799faec47672fbd4e348.json +1 -0
  33. package/graphify-out/cache/5cba1d38ffea01d8c62e5a0b0d8b164cf9b115ff1b6f1acc606f78877712d5de.json +1 -0
  34. package/graphify-out/cache/67aadf0b8f90224cb725e903e6fedbf6828f203467a633f98031b0740930cb21.json +1 -0
  35. package/graphify-out/cache/68dffbffbd811942d85ef2600ca31e423d3c3c343de98cbba4c954c94dd11470.json +1 -0
  36. package/graphify-out/cache/69c684e506b9ce22e95aff044c1da4b0f88ef72c510da02a739edbe551372a8e.json +1 -0
  37. package/graphify-out/cache/6e336587fcfe2b298f23326e881f048d37f1bb062d00806c338da58a8fd281ca.json +1 -0
  38. package/graphify-out/cache/78d88737e6db913f091c4c48e96953df065f6808e2b60dd828fdee64067dac91.json +1 -0
  39. package/graphify-out/cache/7e5340b989299a0b7217d1fd0d2b919cba65142f3e468b0aca5f4ffd5c0594d8.json +1 -0
  40. package/graphify-out/cache/813d6bac52066ed8733781c35710ecb7995e6cabbe0d9abb9854e3c67610b974.json +1 -0
  41. package/graphify-out/cache/8180f34832546e874bc5f1931eee545d97300be49faac5c9b6d515653a763324.json +1 -0
  42. package/graphify-out/cache/885894ca90af6a3724182762bc4fc7ff7d22727a931d46fe7593d1eea10c0c71.json +1 -0
  43. package/graphify-out/cache/8a304ae8f6bf02bfa40923cdbea99e4bea943db52c185f22caa43ba7c34f94d3.json +1 -0
  44. package/graphify-out/cache/903a7dea28112a27dcc1b9ece66514f4d5dd6ca264f5ee70835aca069a8df2ad.json +1 -0
  45. package/graphify-out/cache/9831a7833c5bfeb9a0611e416f7038bd37884b42a9a720f9b4c0a01f860a4f54.json +1 -0
  46. package/graphify-out/cache/98dbdcdd1b19bc942850f50b1ebdeb1865c72ba724990217464efd28a3732b32.json +1 -0
  47. package/graphify-out/cache/a2459f621d588f0166ae6a4204bb6b89f9d669b3ad0c54a88afac6c7abb134b4.json +1 -0
  48. package/graphify-out/cache/a25d47ecf087fa6888d641f89f08cefd35c68b5823c8c55b3baa0243ab110110.json +1 -0
  49. package/graphify-out/cache/a3bd22d8493943a3195c3ef1254a7240624a962edf2baa2c30eb0ae60564fbe7.json +1 -0
  50. package/graphify-out/cache/a4d4fb674183a3b348f542b1b9fb9c0d7b176c43636afb2554af088a9613a1c0.json +1 -0
  51. package/graphify-out/cache/a87a705106773b14c5a25697d30c743cdab01df551cdd9892d6ec46f98ad1659.json +1 -0
  52. package/graphify-out/cache/a9416d0397b5fb994b8c3847aea2599a9d33940e6f0652accc5ba1de478349ee.json +1 -0
  53. package/graphify-out/cache/ab03b9df0e9b8a74db3782c96fee833d800d93838fc0c056306ac2ef9a3e0c09.json +1 -0
  54. package/graphify-out/cache/ad3a99182567225cc19374c28d33097f146547bd945967c723b66d1065134ce9.json +1 -0
  55. package/graphify-out/cache/aece91cfc3a5181bbb77a1758921dfb6a323ab04cc402ce42f2832446d04f420.json +1 -0
  56. package/graphify-out/cache/bd65fd515423e8964058f6aa997c05e3e0fb9e6d39209d4a1d76a079c6af46e8.json +1 -0
  57. package/graphify-out/cache/c2a85071784f9516ab2dea976eeb3a514a53b15701bbf60b4d8be6cd3385cd6c.json +1 -0
  58. package/graphify-out/cache/c9a8c9342926031f308af0eb0a8d60cf0b443e84bae839da42998956465e47e6.json +1 -0
  59. package/graphify-out/cache/d05c0aa647a624e0c696f53c027d066c35d0893695e9a23fd820235ee86b4a70.json +1 -0
  60. package/graphify-out/cache/d3d9832015ab51f52ae88375cea2cbeabecd4a000578e28e899ce23e74245733.json +1 -0
  61. package/graphify-out/cache/d449ad503a40840d41cbf24ed57f408bf5fdf891f830990f836cf52da5c605eb.json +1 -0
  62. package/graphify-out/cache/d92b22194973f3c39ac53d85a29f5d4837d07b0f9f0d375e3ddce8da158777fb.json +1 -0
  63. package/graphify-out/cache/dda8f89f688d8a4db8b7279031ad26a0d8d4accc0aa049abda5fa19eac4bd5ef.json +1 -0
  64. package/graphify-out/cache/e1d80dbca10b7e2ba65339eff0649699c6091d30b836a1e9d5d094bb95aacc48.json +1 -0
  65. package/graphify-out/cache/e207108277cbe1af0501688b0268fea879d0414424386fbaa93a5861f306bdba.json +1 -0
  66. package/graphify-out/cache/e6032dad287da859a517d6b59105595db90e81833dbd850b37653bbd0f3acef7.json +1 -0
  67. package/graphify-out/cache/f49d7295a833de68579e0e265832bc78d21e901764e31705423e621a703124dc.json +1 -0
  68. package/graphify-out/cache/fcf90a1251a332948a773c6aaaad4ce7f6de8d2f2333687cb2fe94e0d860a6c9.json +1 -0
  69. package/graphify-out/cache/fe06fcb623d36858b89c8741696482530a084f599d48bea88de7943fae0f9bea.json +1 -0
  70. package/graphify-out/cache/ffa0f819e023809d17aac1af75cf0f6fbf08500615aee27341b658f24357105a.json +1 -0
  71. package/graphify-out/cost.json +12 -0
  72. package/graphify-out/graph.html +266 -0
  73. package/graphify-out/graph.json +634 -0
  74. package/graphify-out/manifest.json +124 -0
  75. package/how-to-create-a-plugin.md +573 -0
  76. package/package.json +23 -21
  77. package/src/main.js +5 -5
  78. package/src/plugins/click/_listenDOM.js +3 -3
  79. package/src/plugins/form/_listenDOM.js +7 -6
  80. package/src/plugins/hover/_listenDOM.js +2 -2
  81. package/src/plugins/key/_listenDOM.js +4 -4
  82. package/src/plugins/scroll/_listenDOM.js +1 -1
  83. package/test/01-general.test.js +1 -1
  84. package/test/02-key.test.js +45 -1
  85. package/test/03-click.test.js +51 -2
  86. package/test/04-form.test.js +26 -1
  87. package/test/05-hover.test.js +50 -2
  88. package/test/06-scroll.test.js +21 -0
  89. package/How.to.create.plugins.md +0 -929
package/AGENTS.md ADDED
@@ -0,0 +1,54 @@
1
+ # Agent notes — git-shortcuts
2
+
3
+ ## Graphify
4
+ A graph of this codebase has been built. Artifacts live in `graphify-out/`:
5
+
6
+ - `graphify-out/GRAPH_REPORT.md` — textual audit (god-nodes, surprising edges, sample questions)
7
+ - `graphify-out/graph.html` — interactive vis.js visualization (open in browser, search + click-to-inspect)
8
+ - `graphify-out/graph.json` — raw graph data
9
+ - `graphify-out/manifest.json` — file mtimes (used by `graphify --update`)
10
+ - `graphify-out/cost.json` — cumulative token spend
11
+ - `graphify-out/cache/` — semantic cache (speeds up re-extraction)
12
+ - `graphify-out/.graphify_benchmark.json` — per-question token reduction stats
13
+
14
+ ### How to use the graph
15
+ - **Browser:** open `graphify-out/graph.html`
16
+ - **Ask the agent:** request queries like "find edges between key plugin and form plugin" or "what are the top 5 god-nodes in community C17"
17
+ - **Python directly:** the venv interpreter is pinned at `graphify-out/.graphify_python`. Example:
18
+ ```
19
+ $(cat graphify-out/.graphify_python) -c "
20
+ import json
21
+ from networkx.readwrite import json_graph
22
+ G = json_graph.node_link_graph(json.loads(open('graphify-out/graph.json').read()), edges='links')
23
+ print([n for n in G.neighbors('main_main')])
24
+ "
25
+ ```
26
+
27
+ ### Re-running graphify
28
+ - Full: invoke `/graphify` again
29
+ - Incremental: `graphify --update` (uses `manifest.json` to re-extract only changed files)
30
+ - Cache hit means code files won't be re-processed; only changed files get re-extracted
31
+
32
+ ### Known limitations of the current graph
33
+ - Built from AST + cached code semantic only. The 32 subagent extractions for docs (README, API, Changelog, Migration guide, etc.) and 58 images were dispatched but **their outputs were never persisted to disk** before the run was truncated. The graph is strong on structural edges (imports, calls, containment) but weak on prose meaning.
34
+ - 60 communities is inflated by the minified test bundle `html/assets/index-DOkKC3NI.js`. The meaningful source-code communities are C17 (plugins), C18 (sorter), C21 (prettifier), C28 (block nav), C35–C48 (test helpers + public API), C49–C59 (configs + test files).
35
+ - Token reduction: 5.2x (106,545 corpus → ~20,658 per query). See `.graphify_benchmark.json`.
36
+
37
+ ### Staleness
38
+ The graph reflects the code as of last `/graphify` run. If files change, the graph goes stale — re-run `/graphify` or `graphify --update` to refresh.
39
+
40
+ ## v4.1.0 architecture: `data.dependencies.emit`
41
+ The 4.1.0 release moves the `emit` function off the event-data top level and onto `data.dependencies`:
42
+
43
+ - `src/main.js:116-118` initializes `dependencies.extra = { emit: ev.emit }` so every plugin's `data.dependencies` carries the library's emitter by default.
44
+ - `src/main.js:238` (the `API.emit` synthetic event) passes `data = { dependencies: dependencies.extra }`.
45
+ - Each plugin's `_listenDOM.js` sets `dependencies: extra` (or `extra` destructured from `dependencies`) — no top-level `emit` field on event data.
46
+ - `src/main.js:273-280` (the `API.reset()` function) re-affirms the default: `dependencies.extra = { emit: ev.emit }` (NOT `{}`), so plugins enabled after a `reset()` still get `data.dependencies.emit`.
47
+ - User actions call `data.dependencies.emit(eventName, ...args)`. Custom keys still flow into `data.dependencies` via `setDependencies({...})` (merged, not replaced).
48
+ - Tests verify at least these places still work:
49
+ - `test/02-key.test.js:475, 495` — `captured.dependencies.emit` exists, used for workflow
50
+ - `test/03-click.test.js:598, 621` — same
51
+ - `test/04-form.test.js:329` — same
52
+ - `test/05-hover.test.js:463, 486` — same
53
+ - `test/06-scroll.test.js:376` — same
54
+ - `test/01-general.test.js:215` — `short.emit('yo', { ... })` (public API, still works with the new data shape because variadic args pass through to listeners as positional args)
package/Changelog.md CHANGED
@@ -1,6 +1,20 @@
1
1
  ## Release History
2
2
 
3
3
 
4
+ ### 4.1.0 ( 2026-06-07 )
5
+ - [x] Feature: Added `dependencies.emit` to event data of all plugins (key, click, hover, scroll, form). The `emit` function lives on `data.dependencies` (the same bag populated by `setDependencies`), so a handler can trigger other events — including custom event names — from within another event handler, enabling pipelines and workflows;
6
+ - [x] Feature: Custom event names. `data.dependencies.emit` accepts any string as an event name, not just plugin shortcuts. Use a non-plugin prefix (e.g. `@`, `app:`) for application-level hooks that won't collide with library events;
7
+ - [x] Documentation: New section 'Custom Events & Workflows' in README.md with examples for chained gestures, multi-plugin workflows, and custom application event names;
8
+ - [x] Types: Added `dependencies.emit` (function) to KeyEventData, ClickEventData, HoverEventData, ScrollEventData, and FormEventData typedefs (and their generated .d.ts files);
9
+ - [x] Tests: Added `dependencies.emit` tests for all 5 plugins. Added workflow tests for key, click, and hover that verify one handler can trigger another via `data.dependencies.emit`;
10
+ - [x] Dev deps update. @peter.naydenov/visual-controller-for-react to v.3.1.2 (fixes broken ESM build in test environment);
11
+
12
+
13
+
14
+ ### 4.0.2 ( 2026-04-02 )
15
+ - [x] Dependencies update. @peter.naydenov/notice to 2.4.2
16
+
17
+
4
18
 
5
19
  ### 4.0.1 ( 2026-03-24 )
6
20
  - [x] Dev deps update. TypeScript to v.6.0.2;