clay-server 5.1.0-beta.2 → 5.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 (101) hide show
  1. package/bin/cli.js +9 -91
  2. package/lib/builtin-mates.js +7 -7
  3. package/lib/daemon-settings.js +11 -0
  4. package/lib/daemon.js +8 -37
  5. package/lib/linear-store.js +35 -8
  6. package/lib/mate-identity-file.js +39 -0
  7. package/lib/mate-knowledge-sync.js +1 -1
  8. package/lib/mate-ready-creation.js +2 -1
  9. package/lib/mates-identity.js +4 -4
  10. package/lib/mates-prompts.js +4 -3
  11. package/lib/mates.js +12 -11
  12. package/lib/os-users.js +5 -16
  13. package/lib/project-connection.js +0 -7
  14. package/lib/project-debate.js +3 -2
  15. package/lib/project-filesystem.js +21 -39
  16. package/lib/project-mate-interaction.js +7 -6
  17. package/lib/project-server-settings.js +31 -0
  18. package/lib/project-sessions.js +57 -184
  19. package/lib/project.js +3 -3
  20. package/lib/public/app.js +6 -37
  21. package/lib/public/css/input.css +3 -1
  22. package/lib/public/css/menus.css +3 -0
  23. package/lib/public/css/overlays.css +7 -0
  24. package/lib/public/css/project-settings-modal.css +56 -0
  25. package/lib/public/css/server-settings-system.css +125 -0
  26. package/lib/public/css/session-github.css +25 -16
  27. package/lib/public/css/settings-ui.css +247 -22
  28. package/lib/public/css/shared-browser.css +7 -3
  29. package/lib/public/css/title-bar.css +5 -1
  30. package/lib/public/index.html +173 -447
  31. package/lib/public/modules/account-island.js +9 -7
  32. package/lib/public/modules/admin-settings-email.js +197 -0
  33. package/lib/public/modules/admin-settings-invitations.js +183 -0
  34. package/lib/public/modules/admin-settings-projects.js +198 -0
  35. package/lib/public/modules/admin-settings-ui.js +100 -0
  36. package/lib/public/modules/admin-settings-users.js +331 -0
  37. package/lib/public/modules/admin.js +19 -949
  38. package/lib/public/modules/app-dm.js +0 -2
  39. package/lib/public/modules/app-messages.js +13 -52
  40. package/lib/public/modules/app-rate-limit.js +70 -12
  41. package/lib/public/modules/avatar.js +6 -1
  42. package/lib/public/modules/context-sources.js +27 -18
  43. package/lib/public/modules/default-ai.js +14 -7
  44. package/lib/public/modules/header-tui-font.js +10 -20
  45. package/lib/public/modules/home-mate-avatar-editor.js +2 -2
  46. package/lib/public/modules/linear-settings.js +3 -2
  47. package/lib/public/modules/markdown.js +5 -6
  48. package/lib/public/modules/notification-settings.js +81 -0
  49. package/lib/public/modules/notifications.js +44 -28
  50. package/lib/public/modules/personal-settings-dialog.js +51 -0
  51. package/lib/public/modules/profile.js +15 -6
  52. package/lib/public/modules/project-settings-environment.js +106 -0
  53. package/lib/public/modules/project-settings.js +72 -628
  54. package/lib/public/modules/server-settings-controls.js +316 -0
  55. package/lib/public/modules/server-settings-environment.js +194 -0
  56. package/lib/public/modules/server-settings-navigation.js +39 -0
  57. package/lib/public/modules/server-settings-state.js +54 -0
  58. package/lib/public/modules/server-settings.js +116 -788
  59. package/lib/public/modules/server-storage-settings.js +84 -0
  60. package/lib/public/modules/session-github.js +2 -1
  61. package/lib/public/modules/session-presence-ui.js +1 -1
  62. package/lib/public/modules/settings-env-values.js +34 -0
  63. package/lib/public/modules/settings-select.js +121 -0
  64. package/lib/public/modules/shared-browser.js +22 -12
  65. package/lib/public/modules/stt-picker.js +14 -5
  66. package/lib/public/modules/terminal-prefs.js +22 -0
  67. package/lib/public/modules/theme.js +88 -52
  68. package/lib/public/modules/user-settings-account.js +318 -0
  69. package/lib/public/modules/user-settings-appearance.js +55 -0
  70. package/lib/public/modules/user-settings-editors.js +24 -0
  71. package/lib/public/modules/user-settings-integrations.js +104 -0
  72. package/lib/public/modules/user-settings-layout.js +80 -0
  73. package/lib/public/modules/user-settings-preferences.js +48 -0
  74. package/lib/public/modules/user-settings-profile.js +53 -0
  75. package/lib/public/modules/user-settings-themes.js +38 -0
  76. package/lib/public/modules/user-settings-voice.js +75 -0
  77. package/lib/public/modules/user-settings.js +53 -480
  78. package/lib/public/style.css +4 -0
  79. package/lib/sdk-message-processor.js +16 -4
  80. package/lib/sdk-quota-snapshot.js +37 -0
  81. package/lib/server-appearance-settings.js +71 -0
  82. package/lib/server-linear.js +14 -8
  83. package/lib/server-mate-instructions.js +2 -2
  84. package/lib/server-mates.js +2 -1
  85. package/lib/server-notification-settings.js +67 -0
  86. package/lib/server-settings.js +4 -0
  87. package/lib/server-storage.js +57 -0
  88. package/lib/server.js +10 -2
  89. package/lib/sessions.js +3 -4
  90. package/lib/startup-projects.js +40 -0
  91. package/lib/storage-native-walk.js +85 -0
  92. package/lib/storage-usage.js +144 -0
  93. package/lib/users-preferences.js +0 -74
  94. package/lib/users.js +0 -4
  95. package/lib/ws-schema.js +2 -4
  96. package/lib/yoke/acp-process-manager.js +2 -2
  97. package/lib/yoke/adapters/codex.js +12 -52
  98. package/lib/yoke/codex-app-server.js +2 -2
  99. package/lib/yoke/codex-model-catalog.js +52 -0
  100. package/lib/yoke/codex-rate-limits.js +26 -0
  101. package/package.json +3 -3
@@ -28,7 +28,7 @@
28
28
  it (or boots with it already saved). See ensureD2CodingWebfont(). -->
29
29
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@xterm/xterm@5/css/xterm.min.css">
30
30
  <script>
31
- (function(){try{var k="clay-theme-vars",v=localStorage.getItem(k),r=document.documentElement;if(v){var o=JSON.parse(v),p;for(p in o)r.style.setProperty(p,o[p]);var vt=localStorage.getItem(k.replace("-vars","-variant"));if(vt==="light"){r.classList.add("light-theme");r.classList.remove("dark-theme")}else{r.classList.add("dark-theme");r.classList.remove("light-theme")}var m=document.querySelector('meta[name="theme-color"]');if(m&&o["--bg"])m.setAttribute("content",o["--bg"])}else{var sl=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches;if(sl){r.classList.add("light-theme");r.classList.remove("dark-theme")}}}catch(e){}})();
31
+ (function(){var light=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches;document.documentElement.classList.add(light?"light-theme":"dark-theme");})();
32
32
  </script>
33
33
  <script>if(window.navigator.standalone||window.matchMedia("(display-mode:standalone)").matches){document.documentElement.classList.add("pwa-standalone")}</script>
34
34
  <link rel="stylesheet" href="style.css?v=20260913-scheduled-tasks4">
@@ -317,6 +317,7 @@
317
317
  <button id="debate-pdf-btn" class="hidden" title="Export debate as PDF"><i data-lucide="download"></i></button>
318
318
  <button id="find-in-session-btn" title="Search in session (Ctrl+F)"><i data-lucide="search"></i></button>
319
319
  <button type="button" id="sticky-notes-toggle-btn" aria-label="Hide sticky notes" aria-pressed="false" title="Hide sticky notes"><i data-lucide="eye-off"></i></button>
320
+ <button type="button" id="shared-browser-toggle-btn" class="hidden" title="Browser" aria-label="Browser" aria-controls="shared-browser-panel" aria-expanded="false" disabled><i data-lucide="globe"></i></button>
320
321
  <button id="terminal-toggle-btn" title="Terminal"><i data-lucide="square-terminal"></i><span id="terminal-count" class="hidden"></span></button>
321
322
  </div>
322
323
  </div>
@@ -324,7 +325,8 @@
324
325
  <div id="app">
325
326
  <div id="connect-overlay">
326
327
  <div class="connect-brand">
327
- <img class="connect-symbol" src="clay-studio-symbol.png" alt="Clay Studio">
328
+ <img class="connect-symbol" src="clay-studio-symbol.png" alt="">
329
+ <img class="connect-wordmark" src="clay-studio-wordmark-bold.svg" alt="Clay Studio" width="4742" height="1156">
328
330
  </div>
329
331
  <p id="connect-overlay-msg">Connecting…</p>
330
332
  </div>
@@ -648,77 +650,27 @@
648
650
  <div id="mate-memory-digest-detail" class="mate-memory-digest-detail hidden"></div>
649
651
  </div>
650
652
  </div>
651
- <div id="project-settings" class="hidden panel-fullscreen">
652
- <div class="project-settings-layout">
653
- <div class="project-settings-nav">
654
- <div class="project-settings-nav-inner">
655
- <div class="server-settings-nav-header" id="ps-nav-title">-</div>
656
- <select id="ps-nav-dropdown" class="settings-nav-dropdown">
657
- <optgroup label="General">
658
- <option value="profile" selected>Profile</option>
659
- <option value="defaults">Model</option>
660
- </optgroup>
661
- <optgroup label="Config">
662
- <option value="instructions">Instructions</option>
663
- <option value="environment">Environment</option>
664
- </optgroup>
665
- </select>
666
- <div class="server-settings-nav-items">
667
- <div class="settings-nav-category">General</div>
668
- <button class="settings-nav-item active" data-section="profile"><span>Profile</span></button>
669
- <button class="settings-nav-item" data-section="defaults"><span>Model</span></button>
670
- <div class="settings-nav-separator"></div>
671
- <div class="settings-nav-category">Config</div>
672
- <button class="settings-nav-item" data-section="instructions"><span>Instructions</span></button>
673
- <button class="settings-nav-item" data-section="environment"><span>Environment</span></button>
674
- </div>
675
- </div>
676
- </div>
677
- <div class="project-settings-content">
678
- <div class="project-settings-content-inner">
679
- <!-- Profile -->
680
- <div class="ps-section active" data-section="profile">
681
- <h2>Profile</h2>
682
- <div class="settings-card">
683
- <div class="settings-field">
684
- <label class="settings-label">Project Name</label>
685
- <div class="ps-name-row">
686
- <span class="settings-value" id="ps-project-name">-</span>
687
- <button class="settings-btn-sm" id="ps-rename-btn">Rename</button>
688
- </div>
689
- <div class="ps-rename-form hidden" id="ps-rename-form">
690
- <input type="text" class="ps-text-input" id="ps-rename-input" autocomplete="off" spellcheck="false">
691
- <div class="ps-rename-actions">
692
- <button class="settings-btn-sm" id="ps-rename-save">Save</button>
693
- <button class="settings-btn-sm settings-btn-ghost" id="ps-rename-cancel">Cancel</button>
694
- </div>
695
- </div>
696
- </div>
697
- <div class="settings-field">
698
- <label class="settings-label">Icon</label>
699
- <div class="ps-icon-row">
700
- <span class="ps-icon-preview" id="ps-icon-preview"></span>
701
- <button class="settings-btn-sm" id="ps-icon-btn">Change</button>
702
- <button class="settings-btn-sm settings-btn-ghost hidden" id="ps-icon-remove-btn">Remove</button>
703
- </div>
704
- <div id="ps-emoji-picker-anchor"></div>
705
- </div>
706
- <div class="settings-field" id="ps-owner-field" style="display:none">
707
- <label class="settings-label">Owner</label>
708
- <div class="settings-hint">The user whose Claude account is used for all sessions in this project.</div>
709
- <div class="ps-owner-row">
710
- <span class="settings-value" id="ps-owner-name">-</span>
711
- <button class="settings-btn-sm" id="ps-transfer-btn">Transfer</button>
712
- <span class="ps-owner-locked-hint hidden" id="ps-owner-locked-hint">Ownership of home directory projects cannot be transferred.</span>
713
- </div>
714
- <div class="ps-transfer-form hidden" id="ps-transfer-form">
715
- <select class="ps-select" id="ps-transfer-select"></select>
716
- <div class="ps-rename-actions">
717
- <button class="settings-btn-sm" id="ps-transfer-save">Transfer</button>
718
- <button class="settings-btn-sm settings-btn-ghost" id="ps-transfer-cancel">Cancel</button>
719
- </div>
720
- </div>
653
+ <div id="project-settings" class="hidden">
654
+ <div class="ps-modal" role="dialog" aria-modal="true" aria-labelledby="ps-modal-title">
655
+ <header class="ps-modal-header"><div><h2 id="ps-modal-title">Project settings</h2><span id="ps-nav-title"></span></div><button class="settings-btn-sm" id="project-settings-close" aria-label="Close project settings"><i data-lucide="x"></i></button></header>
656
+ <div class="project-settings-layout">
657
+ <nav class="project-settings-nav" aria-label="Project settings">
658
+ <div class="project-settings-nav-inner"><select id="ps-nav-dropdown" class="settings-nav-dropdown" aria-label="Settings page"></select><div class="server-settings-nav-items"></div></div>
659
+ </nav>
660
+ <div class="project-settings-content"><div class="project-settings-content-inner">
661
+ <section class="ps-section active" data-section="profile">
662
+ <h2>General</h2><p class="ps-section-desc">Identify this project in your workspace.</p>
663
+ <div class="ps-project-identity">
664
+ <div class="ps-project-mark"><button id="ps-icon-btn" class="ps-project-icon" aria-label="Change project icon" title="Change project icon"><span id="ps-icon-preview" class="ps-icon-preview"></span><i data-lucide="pencil"></i></button><button class="ps-icon-reset hidden" id="ps-icon-remove-btn">Reset icon</button></div>
665
+ <div class="ps-project-identity-copy"><span class="settings-label">Project name</span><div class="ps-name-row"><strong id="ps-project-name">-</strong><button class="settings-btn-sm" id="ps-rename-btn">Rename</button></div>
666
+ <div class="ps-rename-form hidden" id="ps-rename-form"><input type="text" class="ps-text-input" id="ps-rename-input" aria-label="Project name" autocomplete="off" spellcheck="false"><div class="ps-rename-actions"><button class="settings-btn-sm" id="ps-rename-save">Save</button><button class="settings-btn-sm settings-btn-ghost" id="ps-rename-cancel">Cancel</button></div></div>
667
+ <p class="settings-hint">Used in the sidebar and project switcher. Renaming does not move the project folder.</p>
721
668
  </div>
669
+ </div>
670
+ <div id="ps-emoji-picker-anchor"></div>
671
+ <div class="ps-project-location"><h3>Project folder</h3><p id="ps-project-path" class="ps-project-path"></p><p class="settings-hint">The working directory for this project.</p></div>
672
+ </section>
673
+ <section class="ps-section" data-section="access"><h2>Access</h2><p class="ps-section-desc" id="ps-access-note"></p><div class="settings-card">
722
674
  <div class="settings-field" id="ps-session-visibility-default-field" style="display:none">
723
675
  <label class="settings-label" for="ps-session-visibility-default">New session visibility</label>
724
676
  <div class="settings-hint">Applies to new project conversations and Issue Start work sessions. Existing sessions, hidden work, and delegated workflows keep their current visibility.</div>
@@ -729,108 +681,14 @@
729
681
  <option value="shared">Shared with project members</option>
730
682
  </select>
731
683
  </div>
732
- </div>
733
- </div>
734
- <!-- Defaults -->
735
- <div class="ps-section" data-section="defaults">
736
- <h2>Model</h2>
737
- <p class="ps-section-desc">Configure which model to use and how Claude behaves during sessions.</p>
738
- <div class="settings-card">
739
- <div class="settings-field">
740
- <label class="settings-label">Model</label>
741
- <div class="settings-hint">Choose the Claude model to use. Larger models are slower but more capable.</div>
742
- <div id="ps-model-list" class="settings-model-list"></div>
743
- </div>
744
- </div>
745
- <div class="settings-card" id="ps-beta-card" style="display:none">
746
- <div class="settings-field">
747
- <label class="settings-label">Extended Context (Beta)</label>
748
- <div class="settings-hint">Enable 1M token context window for Sonnet models. Allows processing much larger codebases and files, but may increase latency.</div>
749
- <label class="settings-toggle-row ps-beta-toggle-row">
750
- <div>
751
- <span class="settings-label">1M Context</span>
752
- </div>
753
- <input type="checkbox" id="ps-beta-1m">
754
- <span class="toggle-track"><span class="toggle-thumb"></span></span>
755
- </label>
756
- </div>
757
- </div>
758
- <div class="settings-card">
759
- <div class="settings-field">
760
- <label class="settings-label">Mode</label>
761
- <div class="settings-hint">Controls how Claude handles tool use and file edits.</div>
762
- <div id="ps-mode-list" class="settings-model-list"></div>
763
- </div>
764
- </div>
765
- <div class="settings-card" id="ps-effort-card">
766
- <div class="settings-field">
767
- <label class="settings-label">Effort</label>
768
- <div class="settings-hint">Controls how much thinking effort Claude puts into responses. Higher effort means longer, more thorough responses.</div>
769
- <div class="settings-btn-group" id="ps-effort-bar"></div>
770
- </div>
771
- </div>
772
- <div class="settings-card" id="ps-thinking-card">
773
- <div class="settings-field">
774
- <label class="settings-label">Thinking</label>
775
- <div class="settings-hint">Controls whether Claude shows its reasoning process. Budget mode lets you set a token limit.</div>
776
- <div class="settings-btn-group" id="ps-thinking-bar"></div>
777
- <div id="ps-thinking-budget-row" class="settings-budget-row" style="display:none">
778
- <label class="settings-budget-label">Budget tokens</label>
779
- <input id="ps-thinking-budget" type="number" class="settings-budget-input" min="1024" max="128000" step="1024" value="10000">
780
- </div>
781
- </div>
782
- </div>
783
- </div>
784
- <!-- Instructions -->
785
- <div class="ps-section" data-section="instructions">
786
- <h2>CLAUDE.md</h2>
787
- <p class="ps-section-desc">Edit the CLAUDE.md file for this project. These instructions are passed to Claude at the start of every session.</p>
788
- <div class="settings-card">
789
- <div class="settings-field">
790
- <div id="ps-instructions-status" class="settings-hint"></div>
791
- <textarea class="ps-textarea" id="ps-instructions-editor" rows="20" spellcheck="false" placeholder="# Project Instructions&#10;&#10;Write instructions for Claude here..."></textarea>
792
- <div class="ps-textarea-actions">
793
- <button class="settings-btn-sm" id="ps-instructions-save">Save</button>
794
- <span class="ps-save-status" id="ps-instructions-save-status"></span>
795
- </div>
796
- </div>
797
- </div>
798
- </div>
799
- <!-- Environment -->
800
- <div class="ps-section" data-section="environment">
684
+ </div></section>
685
+ <section class="ps-section" data-section="environment">
801
686
  <h2>Environment</h2>
802
- <p class="ps-section-desc">Store API keys, tokens, and config for coding-agent processes in this project. Changes apply to newly created processes; active processes, terminals, the daemon, and the browser keep their current environment.</p>
803
- <div class="ps-env-tabs">
804
- <button class="ps-env-tab active" data-tab="project">Project</button>
805
- <button class="ps-env-tab" data-tab="shared">Shared</button>
806
- </div>
807
- <div class="ps-env-tab-content active" data-tab="project">
808
- <div class="ps-env-header">
809
- <button class="settings-btn-sm" id="ps-env-add-btn"><i data-lucide="plus"></i> Add Variable</button>
810
- <span class="ps-save-status" id="ps-env-save-status"></span>
811
- </div>
812
- <div class="ps-env-list" id="ps-env-list">
813
- <!-- rows rendered by JS -->
814
- </div>
815
- </div>
816
- <div class="ps-env-tab-content" data-tab="shared">
817
- <p class="settings-hint" style="margin-bottom: 12px;">Shared variables apply to newly created coding-agent processes in all projects. Project-level variables take precedence.</p>
818
- <div class="ps-env-header">
819
- <button class="settings-btn-sm" id="ps-shared-env-add-btn"><i data-lucide="plus"></i> Add Variable</button>
820
- <span class="ps-save-status" id="ps-shared-env-save-status"></span>
821
- </div>
822
- <div class="ps-env-list" id="ps-shared-env-list">
823
- <!-- rows rendered by JS -->
824
- </div>
825
- </div>
826
- </div>
827
- </div>
828
- </div>
829
- <div class="project-settings-close-col">
830
- <button class="server-settings-close-btn" id="project-settings-close" title="Close">
831
- <i data-lucide="x"></i>
832
- <span>ESC</span>
833
- </button>
687
+ <p class="ps-section-desc">Variables for newly created coding-agent processes in this project; active processes, terminals, the daemon, and the browser keep their current environment. Shared variables are managed in Server Settings.</p>
688
+ <div class="ps-env-header"><button class="settings-btn-sm" id="ps-env-add-btn" disabled><i data-lucide="plus"></i> Add variable</button><button class="settings-btn-sm" id="ps-env-save" disabled>Save changes</button><span class="ps-save-status" id="ps-env-save-status" role="status"></span></div>
689
+ <div class="ps-env-list" id="ps-env-list"></div>
690
+ </section>
691
+ </div></div>
834
692
  </div>
835
693
  </div>
836
694
  </div>
@@ -926,29 +784,40 @@
926
784
  </div>
927
785
  <div class="us-modal-body">
928
786
  <nav class="us-modal-nav">
929
- <select id="user-settings-nav-dropdown" class="settings-nav-dropdown">
930
- <option value="us-account" selected>Account</option>
931
- <option value="us-appearance">Appearance</option>
932
- <option value="us-chat">Chat</option>
933
- <option value="us-mates">Mates</option>
934
- <option value="us-experimental">Experimental</option>
935
- <option value="us-email">Email</option>
936
- <option value="us-integrations">Integrations</option>
937
- </select>
938
- <div class="us-modal-nav-items">
939
- <button class="us-nav-item active" data-section="us-account"><span>Account</span></button>
940
- <button class="us-nav-item" data-section="us-appearance"><span>Appearance</span></button>
941
- <button class="us-nav-item" data-section="us-chat"><span>Chat</span></button>
942
- <button class="us-nav-item" data-section="us-mates"><span>Mates</span></button>
943
- <button class="us-nav-item" data-section="us-experimental"><span>Experimental</span></button>
944
- <button class="us-nav-item" data-section="us-email"><span>Email</span></button>
945
- <button class="us-nav-item" data-section="us-integrations"><span>Integrations</span></button>
946
- <div class="us-nav-separator"></div>
947
- <button class="us-nav-item us-nav-danger" data-section="us-logout"><span>Log Out</span></button>
948
- </div>
787
+ <select id="user-settings-nav-dropdown" class="settings-nav-dropdown"></select>
788
+ <div class="us-modal-nav-items"></div>
949
789
  </nav>
950
790
  <div class="us-modal-content">
951
791
 
792
+ <div class="us-section" data-section="us-notifications">
793
+ <h2>Notifications</h2><p class="settings-hint">Alert and sound preferences belong to your account. Browser permission and push subscription belong to this device.</p><p id="personal-notification-status" class="settings-hint" role="status"></p>
794
+ <div class="settings-card">
795
+ <label class="settings-toggle-row">
796
+ <div>
797
+ <span class="settings-label">Push notifications</span>
798
+ <div class="settings-hint">Receive push notifications when tasks complete.</div>
799
+ </div>
800
+ <input type="checkbox" id="settings-notif-push">
801
+ <span class="toggle-track"><span class="toggle-thumb"></span></span>
802
+ </label>
803
+ <label class="settings-toggle-row">
804
+ <div>
805
+ <span class="settings-label">Browser alerts</span>
806
+ <div class="settings-hint">Show browser notification alerts when tasks finish.</div>
807
+ </div>
808
+ <input type="checkbox" id="settings-notif-alert">
809
+ <span class="toggle-track"><span class="toggle-thumb"></span></span>
810
+ </label>
811
+ <label class="settings-toggle-row">
812
+ <div>
813
+ <span class="settings-label">Sound</span>
814
+ <div class="settings-hint">Play a sound when tasks are completed.</div>
815
+ </div>
816
+ <input type="checkbox" id="settings-notif-sound">
817
+ <span class="toggle-track"><span class="toggle-thumb"></span></span>
818
+ </label>
819
+ </div>
820
+ </div>
952
821
  <!-- Account section -->
953
822
  <div class="us-section" data-section="us-account">
954
823
  <h2>Account</h2>
@@ -1031,7 +900,7 @@
1031
900
  <h2>Chat</h2>
1032
901
  <div class="settings-card">
1033
902
  <div class="settings-field">
1034
- <label class="settings-label" for="us-lang-select">Voice Input Language</label>
903
+ <label class="settings-label" for="us-lang-select">Voice input language</label>
1035
904
  <div class="settings-hint">Used by speech-to-text when you dictate messages.</div>
1036
905
  <select id="us-lang-select" class="settings-select us-lang-select">
1037
906
  <option value="en-US">English</option>
@@ -1054,16 +923,6 @@
1054
923
  <span class="toggle-track"><span class="toggle-thumb"></span></span>
1055
924
  </label>
1056
925
  </div>
1057
- <div class="settings-card">
1058
- <label class="settings-toggle-row">
1059
- <div>
1060
- <span class="settings-label">Open Claude as terminal (TUI)</span>
1061
- <div class="settings-hint">Render Claude sessions in an embedded <code>claude</code> terminal instead of Clay's chat UI. Applies on the next session open.</div>
1062
- </div>
1063
- <input type="checkbox" id="us-claude-open-mode">
1064
- <span class="toggle-track"><span class="toggle-thumb"></span></span>
1065
- </label>
1066
- </div>
1067
926
  <div class="settings-card">
1068
927
  <div class="settings-card-body">
1069
928
  <div class="settings-label">Auto-approved commands</div>
@@ -1156,96 +1015,34 @@
1156
1015
  </div>
1157
1016
 
1158
1017
  <!-- === Server Settings (full-screen overlay) === -->
1159
- <div id="server-settings" class="hidden">
1018
+ <div id="server-settings" class="hidden" role="dialog" aria-modal="true" aria-label="Server settings">
1160
1019
  <div class="server-settings-layout">
1161
- <div class="server-settings-nav">
1020
+ <nav class="server-settings-nav" aria-label="Server settings pages">
1162
1021
  <div class="server-settings-nav-inner">
1163
- <div class="server-settings-nav-header" id="settings-server-name"></div>
1164
- <select id="settings-nav-dropdown" class="settings-nav-dropdown">
1165
- <optgroup label="General">
1166
- <option value="overview" selected>Status</option>
1167
- <option value="notifications">Notifications</option>
1168
- <option value="security">Security</option>
1169
- <option value="network">Network</option>
1170
- </optgroup>
1171
- <optgroup label="Config">
1172
- <option value="claudemd">Instructions</option>
1173
- <option value="environment">Environment</option>
1174
- </optgroup>
1175
- <optgroup label="Admin" class="settings-admin-only">
1176
- <option value="admin-users">Users</option>
1177
- <option value="admin-invites">Invites</option>
1178
- <option value="admin-projects">Projects</option>
1179
- <option value="admin-smtp">Email</option>
1180
- </optgroup>
1181
- <optgroup label="Server">
1182
- <option value="keep-awake" class="hidden" id="settings-keep-awake-opt">Keep Awake</option>
1183
- <option value="inherit-groups" class="hidden" id="settings-inherit-groups-opt">User Groups</option>
1184
- <option value="restart">Restart</option>
1185
- <option value="shutdown">Shutdown</option>
1186
- </optgroup>
1187
- </select>
1188
- <div class="server-settings-nav-items">
1189
- <div class="settings-nav-category">General</div>
1190
- <button class="settings-nav-item active" data-section="overview"><span>Status</span></button>
1191
- <button class="settings-nav-item" data-section="notifications"><span>Notifications</span></button>
1192
- <button class="settings-nav-item" data-section="security"><span>Security</span></button>
1193
- <button class="settings-nav-item" data-section="network"><span>Network</span></button>
1194
- <div class="settings-nav-separator"></div>
1195
- <div class="settings-nav-category">Config</div>
1196
- <button class="settings-nav-item" data-section="claudemd"><span>Instructions</span></button>
1197
- <button class="settings-nav-item" data-section="environment"><span>Environment</span></button>
1198
- <button class="settings-nav-item" data-section="storage"><span>Storage</span></button>
1199
- <div class="settings-nav-separator settings-admin-only"></div>
1200
- <div class="settings-nav-category settings-admin-only">Admin</div>
1201
- <button class="settings-nav-item settings-admin-only" data-section="admin-users"><span>Users</span></button>
1202
- <button class="settings-nav-item settings-admin-only" data-section="admin-invites"><span>Invites</span></button>
1203
- <button class="settings-nav-item settings-admin-only" data-section="admin-projects"><span>Projects</span></button>
1204
- <button class="settings-nav-item settings-admin-only" data-section="admin-smtp"><span>Email</span></button>
1205
- <div class="settings-nav-separator"></div>
1206
- <div class="settings-nav-category">Server</div>
1207
- <button class="settings-nav-item hidden" data-section="keep-awake" id="settings-keep-awake-nav"><span>Keep Awake</span></button>
1208
- <button class="settings-nav-item hidden settings-admin-only" data-section="inherit-groups" id="settings-inherit-groups-nav"><span>User Groups</span></button>
1209
- <button class="settings-nav-item" data-section="restart"><span>Restart</span></button>
1210
- <button class="settings-nav-item settings-nav-danger" data-section="shutdown"><span>Shutdown</span></button>
1211
- </div>
1022
+ <div class="server-settings-nav-header">Server settings<small id="settings-server-name"></small></div>
1023
+ <select id="settings-nav-dropdown" class="settings-nav-dropdown" aria-label="Settings page"></select>
1024
+ <div class="server-settings-nav-items" id="settings-page-nav"></div>
1025
+ <button class="settings-nav-item" id="settings-personal-link">Personal notifications ↗</button>
1212
1026
  </div>
1213
- </div>
1214
- <div class="server-settings-content">
1215
- <div class="server-settings-content-inner">
1216
- <div class="server-settings-section active" data-section="overview">
1217
- <h2>Status</h2>
1027
+ </nav>
1028
+ <div class="server-settings-content"><div class="server-settings-content-inner">
1029
+ <p id="settings-access-status" role="status">Checking administrator access…</p>
1030
+ <div class="server-settings-section active" data-section="overview">
1031
+ <h2 tabindex="-1">Overview</h2><p class="settings-page-description">Diagnostics for this Clay server. Configuration changes require administrator access.</p>
1218
1032
  <div class="settings-card">
1219
1033
  <div class="settings-field">
1220
1034
  <label class="settings-label">Host</label>
1221
1035
  <div class="settings-value" id="settings-hostname">-</div>
1222
1036
  <div class="settings-value settings-mono" id="settings-lan-ip" style="font-size:12px;color:var(--text-muted)"></div>
1223
1037
  </div>
1224
- <div class="settings-field">
1225
- <label class="settings-label">Server Version</label>
1226
- <div class="settings-value" id="settings-server-version">-</div>
1227
- <button class="settings-btn-sm settings-btn-update" id="settings-update-check"><i data-lucide="refresh-cw"></i> Check for updates</button>
1228
- </div>
1229
- <label class="settings-toggle-row">
1230
- <div>
1231
- <span class="settings-label">Early Access</span>
1232
- <div class="settings-hint">Receive pre-release updates before they reach the stable channel.</div>
1233
- </div>
1234
- <input type="checkbox" id="settings-update-channel">
1235
- <span class="toggle-track"><span class="toggle-thumb"></span></span>
1236
- </label>
1237
- <div class="settings-field-row">
1238
- <label class="settings-label">Port</label>
1239
- <span class="settings-value settings-mono" id="settings-port">-</span>
1240
- </div>
1241
- <div class="settings-field-row">
1242
- <label class="settings-label">HTTPS</label>
1243
- <span class="settings-value settings-badge" id="settings-tls">-</span>
1244
- </div>
1038
+
1039
+
1040
+
1041
+
1245
1042
  <div class="settings-field-row">
1246
1043
  <div>
1247
- <label class="settings-label">Skip Permissions</label>
1248
- <div class="settings-hint">Auto-approves all tool executions. Restart with <code style="font-size:12px">--dangerously-skip-permissions</code> to enable.</div>
1044
+ <label class="settings-label">Session permission mode</label>
1045
+ <div class="settings-hint">The selected session’s current permission mode. Session controls manage this independently.</div>
1249
1046
  </div>
1250
1047
  <span class="settings-value settings-badge" id="settings-skip-perms">Disabled</span>
1251
1048
  </div>
@@ -1254,7 +1051,7 @@
1254
1051
  <span class="settings-value settings-badge" id="settings-debug">-</span>
1255
1052
  </div>
1256
1053
  </div>
1257
- <h3>Server Status</h3>
1054
+ <h3>Process and current project</h3>
1258
1055
  <div class="settings-card">
1259
1056
  <div class="settings-field-row">
1260
1057
  <label class="settings-label">PID</label>
@@ -1269,27 +1066,80 @@
1269
1066
  <span class="settings-value" id="settings-status-rss">-</span>
1270
1067
  </div>
1271
1068
  <div class="settings-field-row">
1272
- <label class="settings-label">Active Sessions</label>
1069
+ <label class="settings-label">Project sessions</label>
1273
1070
  <span class="settings-value" id="settings-status-sessions">-</span>
1274
1071
  </div>
1275
1072
  <div class="settings-field-row">
1276
- <label class="settings-label">Connected Clients</label>
1073
+ <label class="settings-label">Project clients</label>
1277
1074
  <span class="settings-value" id="settings-status-clients">-</span>
1278
1075
  </div>
1279
1076
  </div>
1280
1077
  <div class="settings-card">
1281
1078
  <div class="settings-field-row">
1282
- <label class="settings-label">WebSocket Path</label>
1079
+ <label class="settings-label">Current project connection</label>
1283
1080
  <span class="settings-value settings-mono" id="settings-ws-path">-</span>
1284
1081
  </div>
1285
1082
  <div class="settings-field-row">
1286
- <label class="settings-label">Project Slug</label>
1083
+ <label class="settings-label">Current project</label>
1287
1084
  <span class="settings-value settings-mono" id="settings-project-slug">-</span>
1288
1085
  </div>
1289
1086
  </div>
1290
1087
  </div>
1291
- <div class="server-settings-section" data-section="security">
1292
- <h2>Security</h2>
1088
+ <div class="server-settings-section" data-section="network">
1089
+ <h2 tabindex="-1">Network</h2><p class="settings-page-description">Server connection policy. Port and HTTPS are configured when starting Clay.</p><h3>Listening address</h3><div class="settings-field-row">
1090
+ <label class="settings-label">Port</label>
1091
+ <span class="settings-value settings-mono" id="settings-port">-</span>
1092
+ </div><div class="settings-field-row">
1093
+ <label class="settings-label">HTTPS</label>
1094
+ <span class="settings-value settings-badge" id="settings-tls">-</span>
1095
+ </div>
1096
+ <h3>Reverse proxy &amp; tunnels</h3>
1097
+ <p class="settings-hint">Connect to Clay through an external address, even when your proxy changes the upstream host.</p>
1098
+ <form id="settings-network-form" class="settings-card">
1099
+ <div class="settings-field">
1100
+ <label class="settings-label" for="settings-network-origins">Allowed external origins</label>
1101
+ <p class="settings-hint" id="settings-network-help">Enter one address per line, including http:// or https:// and a port if needed. Do not include paths or wildcards. Leave empty if you connect directly.</p>
1102
+ <textarea id="settings-network-origins" class="settings-network-origins" rows="5" placeholder="https://clay.example.com" spellcheck="false" autocapitalize="off" autocomplete="off" aria-describedby="settings-network-help settings-network-status" disabled></textarea>
1103
+ <div class="settings-network-actions">
1104
+ <span id="settings-network-status" class="settings-hint" role="status" aria-live="polite"></span>
1105
+ <button type="submit" id="settings-network-save" class="settings-btn-sm" disabled>Save changes</button>
1106
+ </div>
1107
+ </div>
1108
+ </form>
1109
+ <p class="settings-hint">Applies to the entire server. Saved changes take effect on new connections without restarting; existing connections stay open until they reconnect. Login requirements stay unchanged.</p>
1110
+ </div>
1111
+ <div class="server-settings-section" data-section="storage">
1112
+ <h2 tabindex="-1">Storage</h2>
1113
+ <p class="settings-page-description" id="settings-storage-description">Disk usage across Clay data and registered projects.</p>
1114
+ <div class="settings-storage-heading"><h3>Disk usage by user</h3><button type="button" class="settings-btn-sm" id="settings-storage-refresh">Refresh usage</button></div>
1115
+ <p class="settings-hint" id="settings-storage-explanation">Measuring allocated disk space. Ownership details appear with the results. Large scans continue in the background; completed results may be cached for 30 seconds.</p>
1116
+ <p id="settings-storage-status" class="settings-status" role="status"></p>
1117
+ <div id="settings-storage-results" hidden>
1118
+ <div class="settings-field-row"><span class="settings-label">Total measured</span><strong id="settings-storage-total"></strong></div>
1119
+ <div class="settings-storage-table-wrap"><table class="settings-storage-table" aria-label="Allocated disk usage by filesystem owner"><thead><tr><th scope="col">User</th><th scope="col" id="settings-storage-owner-heading">Owner</th><th scope="col">Disk used</th><th scope="col">Files</th></tr></thead><tbody id="settings-storage-users"></tbody></table></div>
1120
+ <p class="settings-hint" id="settings-storage-attribution-note">System / unattributed includes files owned by the server, unmapped accounts or a Linux identity shared by multiple Clay users. “Unavailable” means the account cannot be uniquely mapped; it does not mean zero usage.</p>
1121
+ </div>
1122
+ <h3 class="settings-section-divider">Image retention</h3>
1123
+ <p class="settings-hint">Retention only removes expired Clay chat images. It does not clean up home directories or project files. Deleted images cannot be restored by changing this setting.</p>
1124
+ <div class="settings-card">
1125
+ <label class="settings-toggle-row">
1126
+ <div>
1127
+ <span class="settings-label">Image retention</span>
1128
+ <div class="settings-hint">Applied by the next periodic cleanup, including existing images. Save after reviewing the period.</div>
1129
+ </div>
1130
+ <select id="settings-image-retention" class="settings-select">
1131
+ <option value="0">Forever</option>
1132
+ <option value="3">3 days</option>
1133
+ <option value="7" selected>7 days</option>
1134
+ <option value="14">14 days</option>
1135
+ <option value="30">30 days</option>
1136
+ <option value="90">90 days</option>
1137
+ </select>
1138
+ </label>
1139
+ </div>
1140
+ </div>
1141
+ <div class="server-settings-section" data-section="security">
1142
+ <h2 tabindex="-1">Access &amp; security</h2><p class="settings-page-description">Server sign-in policy. Individual account PINs are managed in Personal settings.</p><h3>Server PIN</h3>
1293
1143
  <div class="settings-card">
1294
1144
  <div class="settings-field-row">
1295
1145
  <div>
@@ -1311,7 +1161,7 @@
1311
1161
  <div class="settings-field hidden" id="settings-pin-form">
1312
1162
  <label class="settings-label">Enter 6-digit PIN</label>
1313
1163
  <div class="settings-pin-input-row">
1314
- <input type="text" id="settings-pin-input" maxlength="6" inputmode="numeric" pattern="[0-9]*" placeholder="000000" autocomplete="off" spellcheck="false">
1164
+ <input type="password" id="settings-pin-input" maxlength="6" inputmode="numeric" pattern="[0-9]*" placeholder="000000" autocomplete="off" spellcheck="false">
1315
1165
  <button class="settings-btn-sm" id="settings-pin-save-btn">Save</button>
1316
1166
  <button class="settings-btn-sm settings-btn-ghost" id="settings-pin-cancel-btn">Cancel</button>
1317
1167
  </div>
@@ -1319,192 +1169,68 @@
1319
1169
  </div>
1320
1170
  </div>
1321
1171
  </div>
1322
- <div class="server-settings-section" data-section="network">
1323
- <h2>Network</h2>
1324
- <h3>Reverse proxy &amp; tunnels</h3>
1325
- <p class="settings-hint">Connect to Clay through an external address, even when your proxy changes the upstream host.</p>
1326
- <form id="settings-network-form" class="settings-card">
1327
- <div class="settings-field">
1328
- <label class="settings-label" for="settings-network-origins">Allowed external origins</label>
1329
- <p class="settings-hint" id="settings-network-help">Enter one address per line, including http:// or https:// and a port if needed. Do not include paths or wildcards. Leave empty if you connect directly.</p>
1330
- <textarea id="settings-network-origins" class="settings-network-origins" rows="5" placeholder="https://clay.example.com" spellcheck="false" autocapitalize="off" autocomplete="off" aria-describedby="settings-network-help settings-network-status" disabled></textarea>
1331
- <div class="settings-network-actions">
1332
- <span id="settings-network-status" class="settings-hint" role="status" aria-live="polite"></span>
1333
- <button type="submit" id="settings-network-save" class="settings-btn-sm" disabled>Save changes</button>
1334
- </div>
1335
- </div>
1336
- </form>
1337
- <p class="settings-hint">Applies to the entire server. Saved changes take effect on new connections without restarting; existing connections stay open until they reconnect. Login requirements stay unchanged.</p>
1172
+ <div class="server-settings-section settings-admin-only" data-section="admin-users">
1173
+ <h2 tabindex="-1">Users</h2><p class="settings-page-description">Manage server accounts, permissions and invitations. Changes apply to the selected user.</p>
1174
+ <h3>Accounts</h3><div class="settings-card" id="admin-users-body"></div>
1175
+ <section class="settings-section-divider"><h3>Invitations</h3><p class="settings-hint">Create, copy, email or revoke invitation links. Email invitations require server SMTP.</p>
1176
+ <div class="settings-card" id="admin-invites-body"></div></section>
1338
1177
  </div>
1339
- <div class="server-settings-section" data-section="notifications">
1340
- <h2>Notifications</h2>
1341
- <div class="settings-card">
1342
- <label class="settings-toggle-row">
1343
- <div>
1344
- <span class="settings-label">Push Notifications</span>
1345
- <div class="settings-hint">Receive push notifications when tasks complete.</div>
1346
- </div>
1347
- <input type="checkbox" id="settings-notif-push">
1348
- <span class="toggle-track"><span class="toggle-thumb"></span></span>
1349
- </label>
1350
- <label class="settings-toggle-row">
1351
- <div>
1352
- <span class="settings-label">Browser Alerts</span>
1353
- <div class="settings-hint">Show browser notification alerts when tasks finish.</div>
1354
- </div>
1355
- <input type="checkbox" id="settings-notif-alert">
1356
- <span class="toggle-track"><span class="toggle-thumb"></span></span>
1357
- </label>
1358
- <label class="settings-toggle-row">
1359
- <div>
1360
- <span class="settings-label">Sound</span>
1361
- <div class="settings-hint">Play a sound when tasks are completed.</div>
1362
- </div>
1363
- <input type="checkbox" id="settings-notif-sound">
1364
- <span class="toggle-track"><span class="toggle-thumb"></span></span>
1365
- </label>
1366
- </div>
1178
+ <div class="server-settings-section settings-admin-only" data-section="admin-projects">
1179
+ <h2 tabindex="-1">Project access</h2><p class="settings-page-description">Manage project ownership, visibility and allowed users. Private Mate projects and worktrees are excluded.</p>
1180
+ <div class="settings-card" id="admin-projects-body"></div>
1367
1181
  </div>
1368
- <div class="server-settings-section" data-section="claudemd">
1369
- <h2>CLAUDE.md</h2>
1370
- <p class="ps-section-desc">Edit the global CLAUDE.md file. These instructions apply to all projects and sessions on this server.</p>
1371
- <div class="settings-card">
1372
- <div class="settings-field">
1373
- <div id="ss-claudemd-status" class="settings-hint"></div>
1374
- <textarea class="ps-textarea" id="ss-claudemd-editor" rows="20" spellcheck="false" placeholder="# Global Instructions&#10;&#10;Write instructions for Claude here..."></textarea>
1375
- <div class="ps-textarea-actions">
1376
- <button class="settings-btn-sm" id="ss-claudemd-save">Save</button>
1377
- <span class="ps-save-status" id="ss-claudemd-save-status"></span>
1378
- </div>
1379
- </div>
1380
- </div>
1381
- <div class="settings-hint" style="margin-top: 8px;">
1382
- <i data-lucide="info" style="width: 14px; height: 14px; vertical-align: -2px;"></i>
1383
- This file is stored at <code>~/.claude/CLAUDE.md</code>. Project-level CLAUDE.md files take precedence over this global file.
1384
- </div>
1182
+ <div class="server-settings-section settings-admin-only" data-section="admin-smtp">
1183
+ <h2 tabindex="-1">Email delivery</h2><p class="settings-page-description">Server SMTP sends invitations and login codes. Personal mailboxes are managed separately in Personal settings → Email.</p>
1184
+ <div class="settings-card" id="admin-smtp-body"></div>
1385
1185
  </div>
1386
- <div class="server-settings-section" data-section="environment">
1186
+ <div class="server-settings-section" data-section="environment">
1387
1187
  <h2>Environment</h2>
1388
1188
  <p class="settings-hint" style="margin-bottom: 16px;">Define variables for newly created coding-agent processes across all projects. Project-level variables take precedence. Active processes, terminals, the daemon, and the browser keep their current environment.</p>
1389
1189
  <div class="ps-env-header">
1390
- <button class="settings-btn-sm" id="ss-env-add-btn"><i data-lucide="plus"></i> Add Variable</button>
1391
- <span class="ps-save-status" id="ss-env-save-status"></span>
1190
+ <button class="settings-btn-sm" id="ss-env-add-btn"><i data-lucide="plus"></i> Add variable</button>
1191
+ <button class="settings-btn-sm" id="ss-env-save" disabled>Save changes</button><span class="ps-save-status" id="ss-env-save-status" role="status"></span>
1392
1192
  </div>
1393
1193
  <div class="ps-env-list" id="ss-env-list">
1394
1194
  <!-- rows rendered by JS -->
1395
1195
  </div>
1396
1196
  </div>
1397
- <div class="server-settings-section" data-section="storage">
1398
- <h2>Storage</h2>
1399
- <div class="settings-card">
1400
- <label class="settings-toggle-row">
1197
+ <div class="server-settings-section" data-section="operations"><h2 tabindex="-1">Operations</h2><p class="settings-page-description">Maintain this server. Restarting, updating or stopping Clay affects everyone connected.</p><h3>Software updates</h3><div class="settings-field">
1198
+ <label class="settings-label">Server version</label>
1199
+ <div class="settings-value" id="settings-server-version">-</div>
1200
+ <button class="settings-btn-sm settings-btn-update" id="settings-update-check"><i data-lucide="refresh-cw"></i> Check for updates</button>
1201
+ </div><label class="settings-toggle-row">
1401
1202
  <div>
1402
- <span class="settings-label">Image retention</span>
1403
- <div class="settings-hint">Automatically delete chat images older than this period.</div>
1203
+ <span class="settings-label">Early access</span>
1204
+ <div class="settings-hint">Receive pre-release updates before they reach the stable channel.</div>
1404
1205
  </div>
1405
- <select id="settings-image-retention" class="settings-select">
1406
- <option value="0">Forever</option>
1407
- <option value="3">3 days</option>
1408
- <option value="7" selected>7 days</option>
1409
- <option value="14">14 days</option>
1410
- <option value="30">30 days</option>
1411
- <option value="90">90 days</option>
1412
- </select>
1413
- </label>
1414
- </div>
1415
- </div>
1416
- <!-- Auto-continue moved to User Settings > Behavior -->
1417
- <div class="server-settings-section hidden" data-section="keep-awake" id="settings-keep-awake-section">
1418
- <h2>Keep Awake</h2>
1206
+ <input type="checkbox" id="settings-update-channel">
1207
+ <span class="toggle-track"><span class="toggle-thumb"></span></span>
1208
+ </label><div class="settings-platform-section" id="settings-keep-awake-section">
1209
+ <h3>Host sleep</h3><p id="settings-awake-support" class="settings-hint"></p>
1419
1210
  <div class="settings-card">
1420
1211
  <label class="settings-toggle-row">
1421
1212
  <div>
1422
- <span class="settings-label">Keep Awake</span>
1213
+ <span class="settings-label">Keep awake</span>
1423
1214
  <div class="settings-hint">Prevent the system from sleeping while the server is running (macOS only).</div>
1424
1215
  </div>
1425
1216
  <input type="checkbox" id="settings-keep-awake">
1426
1217
  <span class="toggle-track"><span class="toggle-thumb"></span></span>
1427
1218
  </label>
1428
1219
  </div>
1429
- </div>
1430
- <div class="server-settings-section hidden settings-admin-only" data-section="inherit-groups" id="settings-inherit-groups-section">
1431
- <h2>User Groups</h2>
1432
- <div class="settings-card">
1433
- <label class="settings-toggle-row">
1434
- <div>
1435
- <span class="settings-label">Inherit supplementary groups</span>
1436
- <div class="settings-hint">Give each session the user's full group membership (docker, video, etc.), matching a normal login. Disable to run sessions with only the primary group. Requires <code>setpriv</code> (util-linux). Applies to new sessions.</div>
1437
- </div>
1438
- <input type="checkbox" id="settings-inherit-groups">
1439
- <span class="toggle-track"><span class="toggle-thumb"></span></span>
1440
- </label>
1441
- </div>
1442
- </div>
1443
- <div class="server-settings-section" data-section="restart">
1444
- <h2>Restart</h2>
1445
- <p class="settings-hint" style="margin-bottom: 16px;">Restart the Clay daemon process. All active sessions will be briefly interrupted and clients will automatically reconnect.</p>
1220
+ </div><div class="settings-operation">
1221
+ <h3>Restart</h3>
1222
+ <p class="settings-hint" style="margin-bottom: 16px;">Restart Clay for everyone. Active work will be interrupted and connected browsers will automatically reconnect.</p>
1446
1223
  <div class="settings-card">
1447
1224
  <div class="settings-field">
1448
- <label class="settings-label">Restart Daemon</label>
1449
- <div class="settings-hint">Spawns a new daemon process and gracefully shuts down the current one.</div>
1225
+ <label class="settings-label">Restart server</label>
1226
+ <div class="settings-hint">Unsaved settings are not applied. Drafts remain in this tab when the connection recovers.</div>
1450
1227
  <div style="margin-top: 12px;">
1451
1228
  <button class="settings-btn-sm" id="settings-restart-btn"><i data-lucide="refresh-cw" style="width:14px;height:14px;vertical-align:-2px;margin-right:4px;"></i>Restart</button>
1452
1229
  </div>
1453
1230
  <div class="settings-hint settings-restart-error hidden" id="settings-restart-error" style="margin-top: 8px;"></div>
1454
1231
  </div>
1455
1232
  </div>
1456
- </div>
1457
- <div class="server-settings-section" data-section="shutdown">
1458
- <h2>Shutdown</h2>
1459
- <div class="settings-danger-zone">
1460
- <div class="settings-danger-icon"><i data-lucide="alert-triangle"></i></div>
1461
- <div class="settings-danger-body">
1462
- <h3 class="settings-danger-title">Danger Zone</h3>
1463
- <p class="settings-danger-desc">Shutting down the server will terminate all active sessions, disconnect all clients, and stop the Clay daemon process. This action cannot be undone.</p>
1464
- </div>
1465
- </div>
1466
- <div class="settings-card settings-card-danger">
1467
- <div class="settings-field">
1468
- <label class="settings-label">Confirm Shutdown</label>
1469
- <div class="settings-hint">Type <strong>shutdown</strong> below to confirm.</div>
1470
- <div class="settings-shutdown-input-row">
1471
- <input type="text" id="settings-shutdown-input" placeholder="Type shutdown to confirm" autocomplete="off" spellcheck="false">
1472
- <button class="settings-btn-sm settings-btn-shutdown" id="settings-shutdown-btn" disabled>Shutdown</button>
1473
- </div>
1474
- <div class="settings-hint settings-shutdown-error hidden" id="settings-shutdown-error"></div>
1475
- </div>
1476
- </div>
1477
- </div>
1478
- <!-- Admin sections (multi-user, admin only) -->
1479
- <div class="server-settings-section settings-admin-only" data-section="admin-users">
1480
- <h2>Users</h2>
1481
- <div class="settings-card" id="admin-users-body"></div>
1482
- </div>
1483
- <div class="server-settings-section settings-admin-only" data-section="admin-invites">
1484
- <h2>Invites</h2>
1485
- <div class="settings-card" id="admin-invites-body"></div>
1486
- </div>
1487
- <div class="server-settings-section settings-admin-only" data-section="admin-projects">
1488
- <h2>Project Access</h2>
1489
- <div class="settings-card" id="admin-projects-body"></div>
1490
- </div>
1491
- <div class="server-settings-section settings-admin-only" data-section="admin-smtp">
1492
- <h2>Email</h2>
1493
- <p class="settings-hint" style="margin-bottom: 20px;">Configure SMTP to send invite links and one-time login codes via email. Without SMTP, users log in with a PIN instead.</p>
1494
- <div class="settings-card" id="admin-smtp-body"></div>
1495
- </div>
1496
-
1497
- </div>
1498
- </div>
1499
- </div>
1500
- <div class="server-settings-close-col">
1501
- <button id="server-settings-close" class="server-settings-close-btn">
1502
- <i data-lucide="x"></i>
1503
- <span>ESC</span>
1504
- </button>
1505
- </div>
1506
- </div>
1507
- </div>
1233
+ </div><section class="settings-operation settings-danger-operation"><div class="settings-danger-entry"><div class="settings-danger-entry-copy"><h3>Danger zone</h3><p>Shut down Clay for everyone. Active work stops; restarting requires access to the host.</p></div><button type="button" class="settings-btn-sm settings-btn-danger" id="settings-shutdown-review" aria-expanded="false" aria-controls="settings-shutdown-flow"><i data-lucide="power" aria-hidden="true"></i>Review shutdown…</button></div><div id="settings-shutdown-flow" hidden role="group" aria-labelledby="settings-shutdown-title"><h4 id="settings-shutdown-title">Shut down server</h4><p class="settings-hint">Stops Clay, interrupts active work and disconnects everyone. You will need shell or service-manager access to start it again.</p><label class="settings-label" for="settings-shutdown-input">Type shutdown to continue</label><div class="settings-shutdown-input-row"><input type="text" id="settings-shutdown-input" autocomplete="off" spellcheck="false"><button class="settings-btn-sm settings-btn-danger" id="settings-shutdown-btn" disabled>Shut down…</button></div><p id="settings-shutdown-error" class="settings-hint hidden" role="status"></p><button type="button" class="settings-btn-sm" id="settings-shutdown-back">Back</button></div></section></div></div></div><div class="server-settings-close-col"><button id="server-settings-close" class="server-settings-close-btn" aria-label="Close server settings"><i data-lucide="x"></i><span>ESC</span></button></div></div></div>
1508
1234
 
1509
1235
  <div id="paste-modal" class="hidden" role="dialog" aria-modal="true" aria-labelledby="paste-modal-title">
1510
1236
  <div class="confirm-backdrop"></div>