enigma-cli 1.42.1 → 1.44.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 (30) hide show
  1. package/assets/registry/primitives/registry.json +498 -8
  2. package/assets/registry/utils/registry.json +4 -2
  3. package/assets/skills/anti-overengineering-policy/skill.json +1 -1
  4. package/assets/skills/anti-overengineering-review/skill.json +1 -1
  5. package/assets/skills/backend-policy/skill.json +1 -1
  6. package/assets/skills/ciphera-style-policy/skill.json +1 -1
  7. package/assets/skills/code-review-policy/skill.json +1 -1
  8. package/assets/skills/core-engineering-policy/skill.json +1 -1
  9. package/assets/skills/database-expert/skill.json +1 -1
  10. package/assets/skills/debugging-policy/skill.json +1 -1
  11. package/assets/skills/dependency-policy/skill.json +1 -1
  12. package/assets/skills/email-policy/skill.json +1 -1
  13. package/assets/skills/frontend-design/skill.json +1 -1
  14. package/assets/skills/frontend-policy/SKILL.md +9 -1
  15. package/assets/skills/frontend-policy/skill.json +3 -3
  16. package/assets/skills/git-policy/skill.json +1 -1
  17. package/assets/skills/logo-sourcing-policy/skill.json +1 -1
  18. package/assets/skills/security-policy/SKILL.md +9 -0
  19. package/assets/skills/security-policy/skill.json +3 -3
  20. package/assets/skills/skill-creator/skill.json +1 -1
  21. package/assets/skills/task-completion-policy/skill.json +1 -1
  22. package/assets/skills/technical-writing-policy/skill.json +1 -1
  23. package/assets/skills/testing-policy/skill.json +1 -1
  24. package/assets/skills/validation-policy/skill.json +1 -1
  25. package/bin/checksums.json +4 -4
  26. package/bin/enigma.mjs +34 -0
  27. package/dist/codegraph-hook.js +2483 -0
  28. package/dist/guardrails.js +282 -1
  29. package/dist/post-edit.js +283 -2
  30. package/package.json +1 -1
package/dist/post-edit.js CHANGED
@@ -569,7 +569,12 @@ __export(guardrails_exports, {
569
569
  formatFindings: () => formatFindings,
570
570
  handRolledColorPicker: () => handRolledColorPicker,
571
571
  handRolledContextMenu: () => handRolledContextMenu,
572
+ handRolledLightbox: () => handRolledLightbox,
573
+ handRolledPalette: () => handRolledPalette,
574
+ handRolledSelect: () => handRolledSelect,
572
575
  handRolledSelection: () => handRolledSelection,
576
+ handRolledToast: () => handRolledToast,
577
+ handRolledVideoPlayer: () => handRolledVideoPlayer,
573
578
  loadRules: () => loadRules,
574
579
  missingPathAlias: () => missingPathAlias,
575
580
  missingWindowsHide: () => missingWindowsHide,
@@ -587,6 +592,7 @@ __export(guardrails_exports, {
587
592
  summarizeLedger: () => summarizeLedger,
588
593
  textareaSizeBounds: () => textareaSizeBounds,
589
594
  truncatedValueUnreachable: () => truncatedValueUnreachable,
595
+ twoFactorPasswordPrompt: () => twoFactorPasswordPrompt,
590
596
  unboundedRemoteList: () => unboundedRemoteList,
591
597
  viewBlankedWhileLoading: () => viewBlankedWhileLoading,
592
598
  wideNamedImports: () => wideNamedImports
@@ -841,6 +847,86 @@ function handRolledColorPicker(content) {
841
847
  }
842
848
  return [];
843
849
  }
850
+ function handRolledLightbox(content) {
851
+ if (LIGHTBOX_MITIGATED.test(content)) return [];
852
+ if (!LIGHTBOX_IMAGE.test(content) || !LIGHTBOX_WHEEL.test(content)) return [];
853
+ if (!LIGHTBOX_ZOOM.test(content) || !LIGHTBOX_DIALOG.test(content)) return [];
854
+ const lines = content.split("\n");
855
+ for (let i = 0; i < lines.length; i++) {
856
+ const line = lines[i];
857
+ if (COMMENT_LINE.test(line) || /enigma:/.test(line)) continue;
858
+ if (!LIGHTBOX_WHEEL.test(line)) continue;
859
+ return [{ line: i + 1, detail: "a picture in a dialog, a wheel that scales it, and the zoom it keeps" }];
860
+ }
861
+ return [];
862
+ }
863
+ function handRolledVideoPlayer(content) {
864
+ if (VIDEO_MITIGATED.test(content)) return [];
865
+ if (!VIDEO_ELEMENT.test(content) || !VIDEO_DRIVEN.test(content)) return [];
866
+ if (!VIDEO_TIMELINE.test(content) || !VIDEO_CONTROLS.test(content)) return [];
867
+ const lines = content.split("\n");
868
+ for (let i = 0; i < lines.length; i++) {
869
+ const line = lines[i];
870
+ if (COMMENT_LINE.test(line) || /enigma:/.test(line)) continue;
871
+ if (!VIDEO_DRIVEN.test(line)) continue;
872
+ return [{ line: i + 1, detail: "a video element, its playback driven by code, and a bar of controls over it" }];
873
+ }
874
+ return [];
875
+ }
876
+ function twoFactorPasswordPrompt(content) {
877
+ if (TWOFA_MITIGATED.test(content)) return [];
878
+ if (!TWOFA_SUBJECT.test(content) || !TWOFA_ENROLL.test(content)) return [];
879
+ const lines = content.split("\n");
880
+ for (let i = 0; i < lines.length; i++) {
881
+ const line = lines[i];
882
+ if (COMMENT_LINE.test(line) || /enigma:/.test(line)) continue;
883
+ if (!TWOFA_SUBJECT.test(line) || !TWOFA_ENROLL.test(line)) continue;
884
+ for (let j = Math.max(0, i - TWOFA_WINDOW); j < Math.min(lines.length, i + TWOFA_WINDOW); j++) {
885
+ const near = lines[j];
886
+ if (COMMENT_LINE.test(near) || /enigma:/.test(near)) continue;
887
+ if (!TWOFA_PASSWORD.test(near)) continue;
888
+ return [{ line: j + 1, detail: "a password field inside a first-time 2FA enrollment" }];
889
+ }
890
+ }
891
+ return [];
892
+ }
893
+ function handRolledSelect(content) {
894
+ if (LISTBOX_MITIGATED.test(content)) return [];
895
+ if (!LISTBOX_ROLE.test(content) || !LISTBOX_OPEN.test(content) || !LISTBOX_OPTIONS.test(content)) return [];
896
+ const lines = content.split("\n");
897
+ for (let i = 0; i < lines.length; i++) {
898
+ const line = lines[i];
899
+ if (COMMENT_LINE.test(line) || /enigma:/.test(line)) continue;
900
+ if (!LISTBOX_ROLE.test(line)) continue;
901
+ return [{ line: i + 1, detail: "a listbox role over an options list with its own open state" }];
902
+ }
903
+ return [];
904
+ }
905
+ function handRolledToast(content) {
906
+ if (TOAST_MITIGATED.test(content)) return [];
907
+ if (!TOAST_QUEUE.test(content) || !TOAST_TIMER.test(content)) return [];
908
+ const lines = content.split("\n");
909
+ for (let i = 0; i < lines.length; i++) {
910
+ const line = lines[i];
911
+ if (COMMENT_LINE.test(line) || /enigma:/.test(line)) continue;
912
+ if (!TOAST_QUEUE.test(line)) continue;
913
+ return [{ line: i + 1, detail: "a queue of toasts dismissed by a timer" }];
914
+ }
915
+ return [];
916
+ }
917
+ function handRolledPalette(content) {
918
+ if (PALETTE_MITIGATED.test(content)) return [];
919
+ if (!PALETTE_SHORTCUT.test(content) || !PALETTE_MODIFIER.test(content)) return [];
920
+ if (!PALETTE_OPEN.test(content) || !PALETTE_FILTER.test(content)) return [];
921
+ const lines = content.split("\n");
922
+ for (let i = 0; i < lines.length; i++) {
923
+ const line = lines[i];
924
+ if (COMMENT_LINE.test(line) || /enigma:/.test(line)) continue;
925
+ if (!PALETTE_SHORTCUT.test(line)) continue;
926
+ return [{ line: i + 1, detail: "Ctrl/Cmd+K opening a filtered panel" }];
927
+ }
928
+ return [];
929
+ }
844
930
  function truncatedValueUnreachable(content) {
845
931
  const lines = content.split("\n");
846
932
  const out = [];
@@ -1376,7 +1462,7 @@ enigma-guardrails: BLOCKED - ${r.blocks.length} convention violation(s):`);
1376
1462
  console.log(`enigma-guardrails: ${r.count} ${all ? "tracked" : "staged"} file(s) checked, no blocking violations.`);
1377
1463
  return 0;
1378
1464
  }
1379
- var COMMENT_LINE, SKELETON_GUARD_SRC, SKELETON_SIGNAL_SRC, BUILTIN_RULES, PROJECT_CHECKS, CURRENT_PASSWORD, NEW_PASSWORD, NEW_PASSWORD_PROP, NOT_A_JSX_PROP, FILE_CHECKS, FIXERS, SPAWNERS, MUTATING_REQUEST, ENTITY_WRITE, OPTIMISTIC_SIGNAL, ALLOW_SERVER_FIRST, RESULT_BINDING, BLOCK_LOOKBACK, BLOCK_LOOKAHEAD, TEXTAREA, TEXTAREA_LOWER, TEXTAREA_UPPER, TEXTAREA_FIXED, TEXTAREA_AUTOSIZE, VIEW_GUARD, LOADING_NAME, LOADING_VALUE, VIEW_GUARD_LOADING, VIEW_CHROME_HEADING, VIEW_CHROME_TEXT, VIEW_BODY_LOOKAHEAD, ALLOW_VIEW_SKELETON, SKELETON_GUARD, SKELETON_SIGNAL, REMOTE_COLLECTION_BINDINGS, LIST_BOUNDED, ALLOW_UNBOUNDED_LIST, MENU_HANDLER, MENU_POINT, MENU_STATE, MENU_MITIGATED, SELECT_RANGE_KEY, SELECT_ADD_KEY, SELECT_STATE, SELECT_MITIGATED, COLOR_MATHS, COLOR_DRAG, COLOR_MEASURE, COLOR_STATE, COLOR_MITIGATED, CLIP_ONE_LINE, DYNAMIC_CHILD, VALUE_REACHABLE, WRAPPER_LOOKBACK, ALLOW_CLIPPED_VALUE, CLIPPED_SIMPLE_VALUE, NOT_TEXT_BINDING, ASYNC_ROUTE, SERVER_DATA_AWAIT, STREAM_BOUNDARY, ALLOW_BLOCKING_PAGE, LOADING_BOUNDARY_FILE, SPECIFIER, MODULE_EXT, JS_EXT, tsconfigCache, NAMED_IMPORT, GENERIC_ACCOUNTS, INTERNAL_MODULE, globCache, DIFF_HUNK, LEDGER_MAX_BYTES, LEDGER_KEEP, LEDGER_KEEP_REPLY, grEntry, isGrEntry;
1465
+ var COMMENT_LINE, SKELETON_GUARD_SRC, SKELETON_SIGNAL_SRC, BUILTIN_RULES, PROJECT_CHECKS, CURRENT_PASSWORD, NEW_PASSWORD, NEW_PASSWORD_PROP, NOT_A_JSX_PROP, FILE_CHECKS, FIXERS, SPAWNERS, MUTATING_REQUEST, ENTITY_WRITE, OPTIMISTIC_SIGNAL, ALLOW_SERVER_FIRST, RESULT_BINDING, BLOCK_LOOKBACK, BLOCK_LOOKAHEAD, TEXTAREA, TEXTAREA_LOWER, TEXTAREA_UPPER, TEXTAREA_FIXED, TEXTAREA_AUTOSIZE, VIEW_GUARD, LOADING_NAME, LOADING_VALUE, VIEW_GUARD_LOADING, VIEW_CHROME_HEADING, VIEW_CHROME_TEXT, VIEW_BODY_LOOKAHEAD, ALLOW_VIEW_SKELETON, SKELETON_GUARD, SKELETON_SIGNAL, REMOTE_COLLECTION_BINDINGS, LIST_BOUNDED, ALLOW_UNBOUNDED_LIST, MENU_HANDLER, MENU_POINT, MENU_STATE, MENU_MITIGATED, SELECT_RANGE_KEY, SELECT_ADD_KEY, SELECT_STATE, SELECT_MITIGATED, COLOR_MATHS, COLOR_DRAG, COLOR_MEASURE, COLOR_STATE, COLOR_MITIGATED, LIGHTBOX_IMAGE, LIGHTBOX_WHEEL, LIGHTBOX_ZOOM, LIGHTBOX_DIALOG, LIGHTBOX_MITIGATED, VIDEO_ELEMENT, VIDEO_DRIVEN, VIDEO_TIMELINE, VIDEO_CONTROLS, VIDEO_MITIGATED, TWOFA_SUBJECT, TWOFA_ENROLL, TWOFA_PASSWORD, TWOFA_MITIGATED, TWOFA_WINDOW, LISTBOX_ROLE, LISTBOX_OPEN, LISTBOX_OPTIONS, LISTBOX_MITIGATED, TOAST_QUEUE, TOAST_TIMER, TOAST_MITIGATED, PALETTE_SHORTCUT, PALETTE_MODIFIER, PALETTE_OPEN, PALETTE_FILTER, PALETTE_MITIGATED, CLIP_ONE_LINE, DYNAMIC_CHILD, VALUE_REACHABLE, WRAPPER_LOOKBACK, ALLOW_CLIPPED_VALUE, CLIPPED_SIMPLE_VALUE, NOT_TEXT_BINDING, ASYNC_ROUTE, SERVER_DATA_AWAIT, STREAM_BOUNDARY, ALLOW_BLOCKING_PAGE, LOADING_BOUNDARY_FILE, SPECIFIER, MODULE_EXT, JS_EXT, tsconfigCache, NAMED_IMPORT, GENERIC_ACCOUNTS, INTERNAL_MODULE, globCache, DIFF_HUNK, LEDGER_MAX_BYTES, LEDGER_KEEP, LEDGER_KEEP_REPLY, grEntry, isGrEntry;
1380
1466
  var init_guardrails = __esm({
1381
1467
  "src/guardrails.ts"() {
1382
1468
  "use strict";
@@ -2437,6 +2523,168 @@ var init_guardrails = __esm({
2437
2523
  severity: "block",
2438
2524
  skill: "frontend-policy"
2439
2525
  },
2526
+ {
2527
+ id: "fe-lightbox-hand-rolled",
2528
+ label: "Image viewers come from the primitive",
2529
+ files: ["*.tsx", "*.jsx", "*.vue", "*.svelte", "*.astro", "*.ts", "*.js"],
2530
+ excludeFiles: [
2531
+ "*.test.*",
2532
+ "*.spec.*",
2533
+ "**/tests/**",
2534
+ "**/__tests__/**",
2535
+ "**/fixtures/**",
2536
+ "*.min.js",
2537
+ "**/dist/**",
2538
+ "**/build/**",
2539
+ "**/node_modules/**",
2540
+ "**/vendor/**",
2541
+ "dist/**",
2542
+ "build/**",
2543
+ "node_modules/**",
2544
+ "vendor/**"
2545
+ ],
2546
+ scope: "file",
2547
+ stage: "diff",
2548
+ fileCheck: "fe-lightbox-hand-rolled",
2549
+ message: "A lightbox written by hand: a picture in a dialog, a wheel that scales it, and a zoom kept as state. The tail is long and always the same. A wheel listener is PASSIVE by default, so every notch zooms the image and scrolls the article behind the backdrop with it. Scaling around the frame's centre slides whatever was under the pointer away from it, so zooming into a face means hunting for it again. Nothing bounds the pan, so a drag strands the picture off screen with no way back but closing. The dialog is left in the page rather than portalled, and the first ancestor with `overflow: hidden` clips it. Escape does not close it, the body still scrolls under it, and focus never returns to the image it was opened from. `enigma add image` (@enigmax/primitives) is `<Image>`: a press enlarges it and the wheel zooms around the cursor by default, with a drag to pan, a pinch on touch and the keyboard driving both - and the arrows, the strip of previews, a download menu and a discard action off until asked for. The viewer is its own chunk, fetched on intent, so a page of images nobody enlarges downloads none of it. Mark the line `enigma:allow-hand-rolled-lightbox` when the viewer genuinely has to be your own (frontend-policy).",
2550
+ severity: "block",
2551
+ skill: "frontend-policy"
2552
+ },
2553
+ {
2554
+ id: "fe-video-player-hand-rolled",
2555
+ label: "Video controls come from the primitive",
2556
+ files: ["*.tsx", "*.jsx", "*.vue", "*.svelte", "*.astro", "*.ts", "*.js"],
2557
+ excludeFiles: [
2558
+ "*.test.*",
2559
+ "*.spec.*",
2560
+ "**/tests/**",
2561
+ "**/__tests__/**",
2562
+ "**/fixtures/**",
2563
+ "*.min.js",
2564
+ "**/dist/**",
2565
+ "**/build/**",
2566
+ "**/node_modules/**",
2567
+ "**/vendor/**",
2568
+ "dist/**",
2569
+ "build/**",
2570
+ "node_modules/**",
2571
+ "vendor/**"
2572
+ ],
2573
+ scope: "file",
2574
+ stage: "diff",
2575
+ fileCheck: "fe-video-player-hand-rolled",
2576
+ message: "Controls written by hand over a `<video>`. What follows is the same every time: `play()` returns a promise that REJECTS - no gesture yet, an autoplay policy, no source - and the unhandled rejection leaves the button saying pause over a video that never started; the state is kept in the component instead of read back from the element's own events, so anything else that plays or pauses it (the media keys, picture in picture, the operating system) desynchronises the bar; the scrubber is a div with a click handler rather than a slider a keyboard can drive or a screen reader can read; the buffered ranges are ignored, or read as `buffered.end(0)`, which reports a range nobody is watching; the clock changes width as it passes ten minutes and shoves every control along with it; the shortcuts fire while somebody is typing in a comment box; and fullscreen calls `requestFullscreen` on a container, which iOS Safari does not have at all. `enigma add video` (@enigmax/primitives) is `<Video>`, shaped after Plyr: the same control set and the same shortcuts, the element as the source of truth, and a theme restyled through `data-*` attributes. Mark the line `enigma:allow-hand-rolled-video-player` when the player genuinely has to be your own (frontend-policy).",
2577
+ severity: "block",
2578
+ skill: "frontend-policy"
2579
+ },
2580
+ {
2581
+ id: "sec-2fa-reauth-prompt",
2582
+ label: "A credential just proven is not asked for again",
2583
+ files: ["*.tsx", "*.jsx", "*.vue", "*.svelte", "*.astro", "*.ts", "*.js", "*.py", "*.rb", "*.php"],
2584
+ excludeFiles: [
2585
+ "*.test.*",
2586
+ "*.spec.*",
2587
+ "**/tests/**",
2588
+ "**/__tests__/**",
2589
+ "**/fixtures/**",
2590
+ "*.min.js",
2591
+ "**/dist/**",
2592
+ "**/build/**",
2593
+ "**/node_modules/**",
2594
+ "**/vendor/**",
2595
+ "dist/**",
2596
+ "build/**",
2597
+ "node_modules/**",
2598
+ "vendor/**"
2599
+ ],
2600
+ scope: "file",
2601
+ stage: "diff",
2602
+ fileCheck: "sec-2fa-reauth-prompt",
2603
+ message: "Turning 2FA on asks for the password the visitor typed a moment ago. Nothing is verified by asking: the session was established by that exact credential during sign-up or sign-in, so the answer is already known - and what the prompt teaches is that a password box can appear at any moment for no stated reason, which is the habit every phishing page relies on. The step that proves the factor works is the CODE from the authenticator, not the password. Re-authentication is a real control and this is not it: it belongs to a sensitive change on a session that is no longer FRESH, so record `authenticatedAt` when the session is created and treat it as fresh for 5-15 minutes; ask again only past that window, and prefer the second factor or a passkey over the password when you do. The actions worth guarding that way are changing the password or the email, disabling 2FA or removing a factor, regenerating recovery codes, issuing an API token, changing payout details and deleting the account. Mark the line `enigma:allow-2fa-password-prompt` where a policy genuinely requires the prompt (security-policy).",
2604
+ severity: "block",
2605
+ skill: "security-policy"
2606
+ },
2607
+ {
2608
+ id: "fe-select-hand-rolled",
2609
+ label: "Custom selects come from the primitive",
2610
+ files: ["*.tsx", "*.jsx", "*.vue", "*.svelte", "*.astro", "*.ts", "*.js"],
2611
+ excludeFiles: [
2612
+ "*.test.*",
2613
+ "*.spec.*",
2614
+ "**/tests/**",
2615
+ "**/__tests__/**",
2616
+ "**/fixtures/**",
2617
+ "*.min.js",
2618
+ "**/dist/**",
2619
+ "**/build/**",
2620
+ "**/node_modules/**",
2621
+ "**/vendor/**",
2622
+ "dist/**",
2623
+ "build/**",
2624
+ "node_modules/**",
2625
+ "vendor/**"
2626
+ ],
2627
+ scope: "file",
2628
+ stage: "diff",
2629
+ fileCheck: "fe-select-hand-rolled",
2630
+ message: "A select written by hand. Replacing the native one is often right - it cannot hold an icon, a second line or a tag, and its popup is drawn by the OS - but what replaces it has to do everything the platform was doing for free, and the panel is the part that gets written. Missing every time: a typeahead (one letter walks the rows that start with it, a longer buffer refines), a disabled row that is listed and announced but that the arrow keys walk PAST rather than onto, a highlight that the pointer and the keyboard share (two highlights on screen is what makes Enter open the row the mouse is not on), a panel that measures before it opens instead of hanging off the bottom of the window, a hidden input so the form it sits in can actually submit the value, and a long list rendered a window at a time instead of 250 rows for the seven anybody sees. `enigma add select` (@enigmax/primitives) is all of it with a test each, plus a filter that turns itself on from the option count, multi-select with tags, and a baseline theme because an unstyled popup is transparent text lying on the page. Mark the line `enigma:allow-hand-rolled-select` when the listbox genuinely has to be your own (frontend-policy).",
2631
+ severity: "block",
2632
+ skill: "frontend-policy"
2633
+ },
2634
+ {
2635
+ id: "fe-toast-hand-rolled",
2636
+ label: "Toasts come from the primitive",
2637
+ files: ["*.tsx", "*.jsx", "*.vue", "*.svelte", "*.astro", "*.ts", "*.js"],
2638
+ excludeFiles: [
2639
+ "*.test.*",
2640
+ "*.spec.*",
2641
+ "**/tests/**",
2642
+ "**/__tests__/**",
2643
+ "**/fixtures/**",
2644
+ "*.min.js",
2645
+ "**/dist/**",
2646
+ "**/build/**",
2647
+ "**/node_modules/**",
2648
+ "**/vendor/**",
2649
+ "dist/**",
2650
+ "build/**",
2651
+ "node_modules/**",
2652
+ "vendor/**"
2653
+ ],
2654
+ scope: "file",
2655
+ stage: "diff",
2656
+ fileCheck: "fe-toast-hand-rolled",
2657
+ message: "A toast stack written by hand: an array of messages and a `setTimeout` that removes them. The queue is the easy half; what is missing is the timing. A timer that does not PAUSE while the pointer is over the toast dismisses the one thing somebody stopped to read, and one that does not pause on a hidden tab expires every toast the moment the tab is left. A timer restarted by a re-render never fires at all, and one keyed on the array index dismisses the wrong toast as soon as two overlap. Then the stack pushes the page around as it grows, and none of it is announced, because a toast needs a live region rather than a div that appeared. `enigma add toast` (@enigmax/primitives) is the real thing - hover and focus pause it, the tab pauses it, promise toasts, actions, and one styled surface you can restyle. Mark the line `enigma:allow-hand-rolled-toast` when the stack genuinely has to be your own (frontend-policy).",
2658
+ severity: "block",
2659
+ skill: "frontend-policy"
2660
+ },
2661
+ {
2662
+ id: "fe-palette-hand-rolled",
2663
+ label: "The Ctrl+K palette comes from the primitive",
2664
+ files: ["*.tsx", "*.jsx", "*.vue", "*.svelte", "*.astro", "*.ts", "*.js"],
2665
+ excludeFiles: [
2666
+ "*.test.*",
2667
+ "*.spec.*",
2668
+ "**/tests/**",
2669
+ "**/__tests__/**",
2670
+ "**/fixtures/**",
2671
+ "*.min.js",
2672
+ "**/dist/**",
2673
+ "**/build/**",
2674
+ "**/node_modules/**",
2675
+ "**/vendor/**",
2676
+ "dist/**",
2677
+ "build/**",
2678
+ "node_modules/**",
2679
+ "vendor/**"
2680
+ ],
2681
+ scope: "file",
2682
+ stage: "diff",
2683
+ fileCheck: "fe-palette-hand-rolled",
2684
+ message: "A command palette written by hand. The shortcut and the panel are an afternoon; the list underneath is where every palette breaks. A shorter result list leaves the highlight past the end, so Enter opens nothing - the single most common palette bug. The arrows stop at the last row instead of wrapping, which reads as a frozen panel. Focus moves to the row, so the caret leaves the field and a screen reader hears nothing (a row is announced through `aria-activedescendant`, with focus never leaving the input). The pointer gets its own highlight beside the keyboard's, so Enter opens the row the mouse is not on. It reopens holding the last query, which hides what an empty query is for - the recents. And dismissing hands focus to the top of the document instead of back to the trigger. `enigma add palette` (@enigmax/primitives) has each of those with a test, plus grouping whose keyboard sequence stays flat across groups, recents guarded against a storage that throws in a private window, and a scroll lock that compensates for the scrollbar. Mark the line `enigma:allow-hand-rolled-palette` when the palette genuinely has to be your own (frontend-policy).",
2685
+ severity: "block",
2686
+ skill: "frontend-policy"
2687
+ },
2440
2688
  {
2441
2689
  id: "fe-icon-action-button",
2442
2690
  label: "Repeated actions are icon buttons, not text labels",
@@ -3224,7 +3472,13 @@ var init_guardrails = __esm({
3224
3472
  "fe-new-password-affordance-on-signin": (content) => newPasswordAffordanceOnSignIn(content),
3225
3473
  "fe-context-menu-hand-rolled": (content) => handRolledContextMenu(content),
3226
3474
  "fe-selection-hand-rolled": (content) => handRolledSelection(content),
3227
- "fe-color-picker-hand-rolled": (content) => handRolledColorPicker(content)
3475
+ "fe-color-picker-hand-rolled": (content) => handRolledColorPicker(content),
3476
+ "fe-lightbox-hand-rolled": (content) => handRolledLightbox(content),
3477
+ "fe-video-player-hand-rolled": (content) => handRolledVideoPlayer(content),
3478
+ "sec-2fa-reauth-prompt": (content) => twoFactorPasswordPrompt(content),
3479
+ "fe-select-hand-rolled": (content) => handRolledSelect(content),
3480
+ "fe-toast-hand-rolled": (content) => handRolledToast(content),
3481
+ "fe-palette-hand-rolled": (content) => handRolledPalette(content)
3228
3482
  };
3229
3483
  FIXERS = {
3230
3484
  "fe-name-input-capitalize": (line, file) => {
@@ -3297,6 +3551,33 @@ var init_guardrails = __esm({
3297
3551
  COLOR_MEASURE = /getBoundingClientRect/;
3298
3552
  COLOR_STATE = /\bset(?:Color|Colour|Hue|Saturation|Lightness|Brightness|Alpha|Opacity)\b|\b(?:hue|saturation)\s*[:=]/i;
3299
3553
  COLOR_MITIGATED = /@enigmax\/primitives|type=["']color["']|react-colorful|react-color|@uiw\/react-color|vue-color|ngx-color|@radix-ui|enigma:allow-hand-rolled-color-picker/;
3554
+ LIGHTBOX_IMAGE = /<img\b|<Image\b|createElement\(\s*["'`]img["'`]/;
3555
+ LIGHTBOX_WHEEL = /onWheel|@wheel|on:wheel|addEventListener\(\s*["'`]wheel["'`]/;
3556
+ LIGHTBOX_ZOOM = /\bset(?:Scale|Zoom)\b|\b(?:scale|zoom)\s*[:=]\s*[0-9(]|scale\(/;
3557
+ LIGHTBOX_DIALOG = /role=["']dialog["']|aria-modal|lightbox|createPortal|["']Escape["']|backdrop/i;
3558
+ LIGHTBOX_MITIGATED = /@enigmax\/primitives|data-enigma-image|ImageViewer\b|yet-another-react-lightbox|react-image-lightbox|photoswipe|medium-zoom|viewerjs|fancybox|lightgallery|react-medium-image-zoom|enigma:allow-hand-rolled-lightbox/i;
3559
+ VIDEO_ELEMENT = /<video\b|createElement\(\s*["'`]video["'`]|HTMLVideoElement/;
3560
+ VIDEO_DRIVEN = /\.play\(\)|\.pause\(\)|\bplaybackRate\b|requestPictureInPicture/;
3561
+ VIDEO_TIMELINE = /\bcurrentTime\b|timeupdate|\.buffered\b/i;
3562
+ VIDEO_CONTROLS = /aria-label=["'](?:Play|Pause|Mute|Seek|Fullscreen)|onClick=\{[^}]*(?:play|pause)|requestFullscreen|toggleFullscreen|isPlaying|setPlaying/i;
3563
+ VIDEO_MITIGATED = /@enigmax\/primitives|data-enigma-video|["'`]plyr|from\s+["'`]plyr|video\.js|videojs|react-player|vidstack|media-chrome|@vime|shaka-player|enigma:allow-hand-rolled-video-player/i;
3564
+ TWOFA_SUBJECT = /2fa|two[-_ ]?factor|totp|mfa|authenticator|otpauth/i;
3565
+ TWOFA_ENROLL = /enroll?(?!ed)|set[-_ ]?up|activate(?!d)|enable(?!d)|provision(?!ed)/i;
3566
+ TWOFA_PASSWORD = /type=["']password["']|\bpassword\s*[:=]|\bpassword\b\s*[,)]|currentPassword|current_password/i;
3567
+ TWOFA_MITIGATED = /authenticatedAt|authenticated_at|reauthenticat|sudo[-_ ]?mode|sudoMode|freshSession|fresh_session|requireFresh|lastAuthAt|last_auth_at|recentlyAuthenticated|stepUp|step_up|enigma:allow-2fa-password-prompt/i;
3568
+ TWOFA_WINDOW = 25;
3569
+ LISTBOX_ROLE = /role=["'{\s]*["']?(?:listbox|option)\b|aria-activedescendant/;
3570
+ LISTBOX_OPEN = /\bset(?:Open|IsOpen|DropdownOpen|MenuOpen|Expanded)\b|\bisOpen\b|\baria-expanded\b/;
3571
+ LISTBOX_OPTIONS = /\b(?:options|choices)\b/;
3572
+ LISTBOX_MITIGATED = /@enigmax\/primitives|createSelect|useSelectContext|<Select|SelectRoot|radix-ui|@headlessui|downshift|react-select|@mui\/material|antd|@mantine|@chakra-ui|primereact|enigma:allow-hand-rolled-select/;
3573
+ TOAST_QUEUE = /\bset(?:Toasts?|Snackbars?)\b|\btoasts\.(?:map|filter|slice)\b|\btoastQueue\b/;
3574
+ TOAST_TIMER = /setTimeout\(/;
3575
+ TOAST_MITIGATED = /@enigmax\/primitives|createNotifications|useNotifications|<Toaster|ToastT\b|ToasterProps\b|["']sonner["']|react-hot-toast|react-toastify|notistack|@radix-ui|@mui\/material|@chakra-ui|@mantine|antd|enigma:allow-hand-rolled-toast/;
3576
+ PALETTE_SHORTCUT = /key\s*===?\s*["'`][kK]["'`]/;
3577
+ PALETTE_MODIFIER = /metaKey|ctrlKey/;
3578
+ PALETTE_OPEN = /\bset(?:Open|IsOpen|PaletteOpen|CommandOpen|Palette)\b/;
3579
+ PALETTE_FILTER = /\bquery\b|\bfilter\(|\bsearch\b/i;
3580
+ PALETTE_MITIGATED = /@enigmax\/primitives|isPaletteShortcut|usePaletteContext|<SearchPalette|PaletteRoot|["']cmdk["']|\bkbar\b|enigma:allow-hand-rolled-palette/;
3300
3581
  CLIP_ONE_LINE = /\btruncate\b|\btext-ellipsis\b|text-overflow\s*:\s*ellipsis/;
3301
3582
  DYNAMIC_CHILD = /(?<![=!<>-])>\s*\{(?![#/:@])/;
3302
3583
  VALUE_REACHABLE = /\btitle\s*=|aria-label\s*=|<\s*Tooltip|TooltipTrigger|data-tooltip|hoverCard|HoverCard/i;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enigma-cli",
3
- "version": "1.42.1",
3
+ "version": "1.44.0",
4
4
  "description": "Everything you need to work with a coding agent: install shared policy skills for Claude Code, OpenAI Codex and opencode, and set up portable git security hooks.",
5
5
  "type": "module",
6
6
  "bin": {