co-maintainer 0.6.3 → 0.6.5

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 (78) hide show
  1. package/THIRD_PARTY_NOTICES +161 -0
  2. package/dist/package.json +4 -2
  3. package/dist/src/ai/batch.js +7 -0
  4. package/dist/src/cli/args.js +21 -3
  5. package/dist/src/cli/commands/registry.js +38 -3
  6. package/dist/src/cli/commands/serve.js +31 -3
  7. package/dist/src/cli/commands/set.js +54 -0
  8. package/dist/src/config.d.ts +14 -0
  9. package/dist/src/github/client.js +13 -0
  10. package/dist/src/github/permissions.js +8 -0
  11. package/dist/src/server/api/jobs.js +8 -1
  12. package/dist/src/server/api/repos.js +73 -11
  13. package/dist/src/server/api/settings.js +6 -0
  14. package/dist/src/server/app.d.ts +5 -0
  15. package/dist/src/server/app.js +7 -0
  16. package/dist/src/server/http.d.ts +3 -0
  17. package/dist/src/server/http.js +5 -0
  18. package/dist/src/server/pages/activity.js +412 -19
  19. package/dist/src/server/pages/add_repo.js +6 -1
  20. package/dist/src/server/pages/analytics.js +99 -31
  21. package/dist/src/server/pages/catalog.d.ts +1 -0
  22. package/dist/src/server/pages/catalog.js +145 -0
  23. package/dist/src/server/pages/client.d.ts +1 -1
  24. package/dist/src/server/pages/client.js +1 -1
  25. package/dist/src/server/pages/home.d.ts +14 -4
  26. package/dist/src/server/pages/home.js +83 -49
  27. package/dist/src/server/pages/icons.d.ts +3 -0
  28. package/dist/src/server/pages/icons.js +3 -0
  29. package/dist/src/server/pages/knowledge.js +10 -5
  30. package/dist/src/server/pages/layout.d.ts +19 -3
  31. package/dist/src/server/pages/layout.js +156 -33
  32. package/dist/src/server/pages/pr.js +4 -3
  33. package/dist/src/server/pages/rate_limit_waits.d.ts +5 -0
  34. package/dist/src/server/pages/rate_limit_waits.js +74 -0
  35. package/dist/src/server/pages/repo.js +100 -66
  36. package/dist/src/server/pages/repo_prs.js +4 -3
  37. package/dist/src/server/pages/repo_remote.js +4 -3
  38. package/dist/src/server/pages/repo_settings.d.ts +2 -2
  39. package/dist/src/server/pages/repo_settings.js +420 -46
  40. package/dist/src/server/pages/router.d.ts +5 -0
  41. package/dist/src/server/pages/router.js +82 -31
  42. package/dist/src/server/pages/settings.d.ts +10 -1
  43. package/dist/src/server/pages/settings.js +350 -206
  44. package/dist/src/server/pages/setup.d.ts +2 -5
  45. package/dist/src/server/pages/setup.js +21 -23
  46. package/dist/src/server/pages/styles.d.ts +1 -1
  47. package/dist/src/server/pages/styles.js +1 -1
  48. package/dist/src/server/pages/ui.d.ts +117 -0
  49. package/dist/src/server/pages/ui.js +166 -0
  50. package/dist/src/services/cli_repos.d.ts +2 -0
  51. package/dist/src/services/cli_repos.js +50 -0
  52. package/dist/src/services/concurrency.d.ts +39 -0
  53. package/dist/src/services/concurrency.js +88 -0
  54. package/dist/src/services/dashboard.d.ts +43 -1
  55. package/dist/src/services/dashboard.js +10 -2
  56. package/dist/src/services/jobs.js +5 -3
  57. package/dist/src/services/nav_counts.d.ts +8 -0
  58. package/dist/src/services/nav_counts.js +19 -0
  59. package/dist/src/services/rate_limit.d.ts +33 -0
  60. package/dist/src/services/rate_limit.js +78 -0
  61. package/dist/src/services/repo_list.d.ts +19 -0
  62. package/dist/src/services/repo_list.js +38 -0
  63. package/dist/src/services/review.d.ts +23 -1
  64. package/dist/src/services/review.js +165 -35
  65. package/dist/src/services/search.d.ts +13 -0
  66. package/dist/src/services/search.js +72 -0
  67. package/dist/src/services/setup.js +14 -4
  68. package/dist/src/services/setup_checklist.d.ts +1 -1
  69. package/dist/src/services/setup_checklist.js +26 -47
  70. package/dist/src/store/findings.d.ts +1 -1
  71. package/dist/src/store/findings.js +3 -3
  72. package/dist/src/store/migrations.js +7 -0
  73. package/dist/src/store/repos.d.ts +5 -0
  74. package/dist/src/store/repos.js +12 -0
  75. package/dist/src/store/reviews.d.ts +12 -1
  76. package/dist/src/store/reviews.js +34 -2
  77. package/dist/src/store/rows.d.ts +6 -0
  78. package/package.json +4 -2
@@ -0,0 +1,3 @@
1
+ /** Generated from src/server/pages/icons/*.svg by scripts/embed_assets.mjs — do not edit. */
2
+ export declare const iconNames: readonly string[];
3
+ export declare const sprite = "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"position:absolute;width:0;height:0;overflow:hidden\" aria-hidden=\"true\"><symbol id=\"i-activity\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\" /></symbol><symbol id=\"i-arrow-right\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" /></symbol><symbol id=\"i-book-open\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 5v16\" />\n <path d=\"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z\" /></symbol><symbol id=\"i-calendar-clock\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M16 14v2.2l1.6 1\" />\n <path d=\"M16 2v3\" />\n <path d=\"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338\" />\n <path d=\"M3 9h5.859\" />\n <path d=\"M8 2v3\" />\n <circle cx=\"16\" cy=\"16\" r=\"6\" /></symbol><symbol id=\"i-chart-no-axes-column\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 21v-6\" />\n <path d=\"M12 21V3\" />\n <path d=\"M19 21V9\" /></symbol><symbol id=\"i-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 6 9 17l-5-5\" /></symbol><symbol id=\"i-chevron-right\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m9 18 6-6-6-6\" /></symbol><symbol id=\"i-circle\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" /></symbol><symbol id=\"i-circle-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" /></symbol><symbol id=\"i-circle-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m16 9-5.5 5.5L8 12\" /></symbol><symbol id=\"i-circle-pause\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"10\" x2=\"10\" y1=\"15\" y2=\"9\" />\n <line x1=\"14\" x2=\"14\" y1=\"15\" y2=\"9\" /></symbol><symbol id=\"i-circle-x\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15 9-6 6\" />\n <path d=\"m9 9 6 6\" /></symbol><symbol id=\"i-coins\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M13.744 17.736a6 6 0 1 1-7.48-7.48\" />\n <path d=\"M15 6h1v4\" />\n <path d=\"m6.134 14.768.866-.5 2 3.464\" />\n <circle cx=\"16\" cy=\"8\" r=\"6\" /></symbol><symbol id=\"i-copy\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" /></symbol><symbol id=\"i-cpu\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 20v2\" />\n <path d=\"M12 2v2\" />\n <path d=\"M17 20v2\" />\n <path d=\"M17 2v2\" />\n <path d=\"M2 12h2\" />\n <path d=\"M2 17h2\" />\n <path d=\"M2 7h2\" />\n <path d=\"M20 12h2\" />\n <path d=\"M20 17h2\" />\n <path d=\"M20 7h2\" />\n <path d=\"M7 20v2\" />\n <path d=\"M7 2v2\" />\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <rect x=\"8\" y=\"8\" width=\"8\" height=\"8\" rx=\"1\" /></symbol><symbol id=\"i-download\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 15V3\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"m7 10 5 5 5-5\" /></symbol><symbol id=\"i-external-link\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" /></symbol><symbol id=\"i-file-pen\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z\" /></symbol><symbol id=\"i-flag\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528\" /></symbol><symbol id=\"i-flask-conical\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2\" />\n <path d=\"M6.453 15h11.094\" />\n <path d=\"M8.5 2h7\" /></symbol><symbol id=\"i-git-branch\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 6a9 9 0 0 0-9 9V3\" />\n <circle cx=\"18\" cy=\"6\" r=\"3\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" /></symbol><symbol id=\"i-git-pull-request\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"18\" cy=\"18\" r=\"3\" />\n <circle cx=\"6\" cy=\"6\" r=\"3\" />\n <path d=\"M13 6h3a2 2 0 0 1 2 2v7\" />\n <line x1=\"6\" x2=\"6\" y1=\"9\" y2=\"21\" /></symbol><symbol id=\"i-git-pull-request-arrow\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"5\" cy=\"6\" r=\"3\" />\n <path d=\"M5 9v12\" />\n <circle cx=\"19\" cy=\"18\" r=\"3\" />\n <path d=\"m15 9-3-3 3-3\" />\n <path d=\"M12 6h5a2 2 0 0 1 2 2v7\" /></symbol><symbol id=\"i-github\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4\" />\n <path d=\"M9 18c-4.51 2-5-2-7-2\" /></symbol><symbol id=\"i-history\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n <path d=\"M12 7v5l4 2\" /></symbol><symbol id=\"i-inbox\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\" /></symbol><symbol id=\"i-info\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" /></symbol><symbol id=\"i-key-round\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z\" />\n <circle cx=\"16.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" /></symbol><symbol id=\"i-laptop\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z\" />\n <path d=\"M20.054 15.987H3.946\" /></symbol><symbol id=\"i-layers\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\" />\n <path d=\"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" />\n <path d=\"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" /></symbol><symbol id=\"i-layout-grid\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" /></symbol><symbol id=\"i-list\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 5h.01\" />\n <path d=\"M3 12h.01\" />\n <path d=\"M3 19h.01\" />\n <path d=\"M8 5h13\" />\n <path d=\"M8 12h13\" />\n <path d=\"M8 19h13\" /></symbol><symbol id=\"i-list-checks\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M13 5h8\" />\n <path d=\"M13 12h8\" />\n <path d=\"M13 19h8\" />\n <path d=\"m3 17 2 2 4-4\" />\n <path d=\"m3 7 2 2 4-4\" /></symbol><symbol id=\"i-list-ordered\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11 5h10\" />\n <path d=\"M11 12h10\" />\n <path d=\"M11 19h10\" />\n <path d=\"M4 4h1v5\" />\n <path d=\"M4 9h2\" />\n <path d=\"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02\" /></symbol><symbol id=\"i-loader\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 2v4\" />\n <path d=\"m16.2 7.8 2.9-2.9\" />\n <path d=\"M18 12h4\" />\n <path d=\"m16.2 16.2 2.9 2.9\" />\n <path d=\"M12 18v4\" />\n <path d=\"m4.9 19.1 2.9-2.9\" />\n <path d=\"M2 12h4\" />\n <path d=\"m4.9 4.9 2.9 2.9\" /></symbol><symbol id=\"i-lock\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\" /></symbol><symbol id=\"i-log-out\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m16 17 5-5-5-5\" />\n <path d=\"M21 12H9\" />\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" /></symbol><symbol id=\"i-menu\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 5h16\" />\n <path d=\"M4 12h16\" />\n <path d=\"M4 19h16\" /></symbol><symbol id=\"i-message-square-text\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\" />\n <path d=\"M7 11h10\" />\n <path d=\"M7 15h6\" />\n <path d=\"M7 7h8\" /></symbol><symbol id=\"i-moon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\" /></symbol><symbol id=\"i-octagon-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 16h.01\" />\n <path d=\"M12 8v4\" />\n <path d=\"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z\" /></symbol><symbol id=\"i-plus\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" /></symbol><symbol id=\"i-refresh-cw\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" /></symbol><symbol id=\"i-rotate-cw\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" /></symbol><symbol id=\"i-search\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21 21-4.34-4.34\" />\n <circle cx=\"11\" cy=\"11\" r=\"8\" /></symbol><symbol id=\"i-search-x\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m13.5 8.5-5 5\" />\n <path d=\"m8.5 8.5 5 5\" />\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" /></symbol><symbol id=\"i-server\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"20\" height=\"8\" x=\"2\" y=\"2\" rx=\"2\" ry=\"2\" />\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"14\" rx=\"2\" ry=\"2\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"6\" y2=\"6\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"18\" y2=\"18\" /></symbol><symbol id=\"i-settings-2\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 17H5\" />\n <path d=\"M19 7h-9\" />\n <circle cx=\"17\" cy=\"17\" r=\"3\" />\n <circle cx=\"7\" cy=\"7\" r=\"3\" /></symbol><symbol id=\"i-shield-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"m9 12 2 2 4-4\" /></symbol><symbol id=\"i-sliders-horizontal\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 5H3\" />\n <path d=\"M12 19H3\" />\n <path d=\"M14 3v4\" />\n <path d=\"M16 17v4\" />\n <path d=\"M21 12h-9\" />\n <path d=\"M21 19h-5\" />\n <path d=\"M21 5h-7\" />\n <path d=\"M8 10v4\" />\n <path d=\"M8 12H3\" /></symbol><symbol id=\"i-sparkles\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\" />\n <path d=\"M20 2v4\" />\n <path d=\"M22 4h-4\" />\n <circle cx=\"4\" cy=\"20\" r=\"2\" /></symbol><symbol id=\"i-square\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" /></symbol><symbol id=\"i-terminal\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" /></symbol><symbol id=\"i-timer\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" /></symbol><symbol id=\"i-triangle-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" /></symbol><symbol id=\"i-users\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <path d=\"M16 3.128a4 4 0 0 1 0 7.744\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" /></symbol><symbol id=\"i-wallet\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1\" />\n <path d=\"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4\" /></symbol><symbol id=\"i-wand-sparkles\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72\" />\n <path d=\"m14 7 3 3\" />\n <path d=\"M5 6v4\" />\n <path d=\"M19 14v4\" />\n <path d=\"M10 2v2\" />\n <path d=\"M7 8H3\" />\n <path d=\"M21 16h-4\" />\n <path d=\"M11 3H9\" /></symbol><symbol id=\"i-webhook\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2\" />\n <path d=\"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06\" />\n <path d=\"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8\" /></symbol></svg>";
@@ -0,0 +1,3 @@
1
+ /** Generated from src/server/pages/icons/*.svg by scripts/embed_assets.mjs — do not edit. */
2
+ export const iconNames = JSON.parse("[\"activity\",\"arrow-right\",\"book-open\",\"calendar-clock\",\"chart-no-axes-column\",\"check\",\"chevron-right\",\"circle\",\"circle-alert\",\"circle-check\",\"circle-pause\",\"circle-x\",\"coins\",\"copy\",\"cpu\",\"download\",\"external-link\",\"file-pen\",\"flag\",\"flask-conical\",\"git-branch\",\"git-pull-request\",\"git-pull-request-arrow\",\"github\",\"history\",\"inbox\",\"info\",\"key-round\",\"laptop\",\"layers\",\"layout-grid\",\"list\",\"list-checks\",\"list-ordered\",\"loader\",\"lock\",\"log-out\",\"menu\",\"message-square-text\",\"moon\",\"octagon-alert\",\"plus\",\"refresh-cw\",\"rotate-cw\",\"search\",\"search-x\",\"server\",\"settings-2\",\"shield-check\",\"sliders-horizontal\",\"sparkles\",\"square\",\"terminal\",\"timer\",\"triangle-alert\",\"users\",\"wallet\",\"wand-sparkles\",\"webhook\"]");
3
+ export const sprite = "<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"position:absolute;width:0;height:0;overflow:hidden\" aria-hidden=\"true\"><symbol id=\"i-activity\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\" /></symbol><symbol id=\"i-arrow-right\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" /></symbol><symbol id=\"i-book-open\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 5v16\" />\n <path d=\"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z\" /></symbol><symbol id=\"i-calendar-clock\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M16 14v2.2l1.6 1\" />\n <path d=\"M16 2v3\" />\n <path d=\"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338\" />\n <path d=\"M3 9h5.859\" />\n <path d=\"M8 2v3\" />\n <circle cx=\"16\" cy=\"16\" r=\"6\" /></symbol><symbol id=\"i-chart-no-axes-column\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 21v-6\" />\n <path d=\"M12 21V3\" />\n <path d=\"M19 21V9\" /></symbol><symbol id=\"i-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 6 9 17l-5-5\" /></symbol><symbol id=\"i-chevron-right\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m9 18 6-6-6-6\" /></symbol><symbol id=\"i-circle\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" /></symbol><symbol id=\"i-circle-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" /></symbol><symbol id=\"i-circle-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m16 9-5.5 5.5L8 12\" /></symbol><symbol id=\"i-circle-pause\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"10\" x2=\"10\" y1=\"15\" y2=\"9\" />\n <line x1=\"14\" x2=\"14\" y1=\"15\" y2=\"9\" /></symbol><symbol id=\"i-circle-x\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15 9-6 6\" />\n <path d=\"m9 9 6 6\" /></symbol><symbol id=\"i-coins\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M13.744 17.736a6 6 0 1 1-7.48-7.48\" />\n <path d=\"M15 6h1v4\" />\n <path d=\"m6.134 14.768.866-.5 2 3.464\" />\n <circle cx=\"16\" cy=\"8\" r=\"6\" /></symbol><symbol id=\"i-copy\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" /></symbol><symbol id=\"i-cpu\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 20v2\" />\n <path d=\"M12 2v2\" />\n <path d=\"M17 20v2\" />\n <path d=\"M17 2v2\" />\n <path d=\"M2 12h2\" />\n <path d=\"M2 17h2\" />\n <path d=\"M2 7h2\" />\n <path d=\"M20 12h2\" />\n <path d=\"M20 17h2\" />\n <path d=\"M20 7h2\" />\n <path d=\"M7 20v2\" />\n <path d=\"M7 2v2\" />\n <rect x=\"4\" y=\"4\" width=\"16\" height=\"16\" rx=\"2\" />\n <rect x=\"8\" y=\"8\" width=\"8\" height=\"8\" rx=\"1\" /></symbol><symbol id=\"i-download\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 15V3\" />\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"m7 10 5 5 5-5\" /></symbol><symbol id=\"i-external-link\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" /></symbol><symbol id=\"i-file-pen\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34\" />\n <path d=\"M14 2v5a1 1 0 0 0 1 1h5\" />\n <path d=\"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z\" /></symbol><symbol id=\"i-flag\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528\" /></symbol><symbol id=\"i-flask-conical\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2\" />\n <path d=\"M6.453 15h11.094\" />\n <path d=\"M8.5 2h7\" /></symbol><symbol id=\"i-git-branch\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 6a9 9 0 0 0-9 9V3\" />\n <circle cx=\"18\" cy=\"6\" r=\"3\" />\n <circle cx=\"6\" cy=\"18\" r=\"3\" /></symbol><symbol id=\"i-git-pull-request\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"18\" cy=\"18\" r=\"3\" />\n <circle cx=\"6\" cy=\"6\" r=\"3\" />\n <path d=\"M13 6h3a2 2 0 0 1 2 2v7\" />\n <line x1=\"6\" x2=\"6\" y1=\"9\" y2=\"21\" /></symbol><symbol id=\"i-git-pull-request-arrow\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"5\" cy=\"6\" r=\"3\" />\n <path d=\"M5 9v12\" />\n <circle cx=\"19\" cy=\"18\" r=\"3\" />\n <path d=\"m15 9-3-3 3-3\" />\n <path d=\"M12 6h5a2 2 0 0 1 2 2v7\" /></symbol><symbol id=\"i-github\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4\" />\n <path d=\"M9 18c-4.51 2-5-2-7-2\" /></symbol><symbol id=\"i-history\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" />\n <path d=\"M3 3v5h5\" />\n <path d=\"M12 7v5l4 2\" /></symbol><symbol id=\"i-inbox\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\" /></symbol><symbol id=\"i-info\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" /></symbol><symbol id=\"i-key-round\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z\" />\n <circle cx=\"16.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\" /></symbol><symbol id=\"i-laptop\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z\" />\n <path d=\"M20.054 15.987H3.946\" /></symbol><symbol id=\"i-layers\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\" />\n <path d=\"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" />\n <path d=\"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" /></symbol><symbol id=\"i-layout-grid\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" /></symbol><symbol id=\"i-list\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 5h.01\" />\n <path d=\"M3 12h.01\" />\n <path d=\"M3 19h.01\" />\n <path d=\"M8 5h13\" />\n <path d=\"M8 12h13\" />\n <path d=\"M8 19h13\" /></symbol><symbol id=\"i-list-checks\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M13 5h8\" />\n <path d=\"M13 12h8\" />\n <path d=\"M13 19h8\" />\n <path d=\"m3 17 2 2 4-4\" />\n <path d=\"m3 7 2 2 4-4\" /></symbol><symbol id=\"i-list-ordered\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11 5h10\" />\n <path d=\"M11 12h10\" />\n <path d=\"M11 19h10\" />\n <path d=\"M4 4h1v5\" />\n <path d=\"M4 9h2\" />\n <path d=\"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02\" /></symbol><symbol id=\"i-loader\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 2v4\" />\n <path d=\"m16.2 7.8 2.9-2.9\" />\n <path d=\"M18 12h4\" />\n <path d=\"m16.2 16.2 2.9 2.9\" />\n <path d=\"M12 18v4\" />\n <path d=\"m4.9 19.1 2.9-2.9\" />\n <path d=\"M2 12h4\" />\n <path d=\"m4.9 4.9 2.9 2.9\" /></symbol><symbol id=\"i-lock\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d=\"M7 11V7a5 5 0 0 1 10 0v4\" /></symbol><symbol id=\"i-log-out\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m16 17 5-5-5-5\" />\n <path d=\"M21 12H9\" />\n <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" /></symbol><symbol id=\"i-menu\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 5h16\" />\n <path d=\"M4 12h16\" />\n <path d=\"M4 19h16\" /></symbol><symbol id=\"i-message-square-text\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z\" />\n <path d=\"M7 11h10\" />\n <path d=\"M7 15h6\" />\n <path d=\"M7 7h8\" /></symbol><symbol id=\"i-moon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\" /></symbol><symbol id=\"i-octagon-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 16h.01\" />\n <path d=\"M12 8v4\" />\n <path d=\"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z\" /></symbol><symbol id=\"i-plus\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M5 12h14\" />\n <path d=\"M12 5v14\" /></symbol><symbol id=\"i-refresh-cw\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" />\n <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" />\n <path d=\"M8 16H3v5\" /></symbol><symbol id=\"i-rotate-cw\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\" />\n <path d=\"M21 3v5h-5\" /></symbol><symbol id=\"i-search\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21 21-4.34-4.34\" />\n <circle cx=\"11\" cy=\"11\" r=\"8\" /></symbol><symbol id=\"i-search-x\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m13.5 8.5-5 5\" />\n <path d=\"m8.5 8.5 5 5\" />\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" /></symbol><symbol id=\"i-server\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"20\" height=\"8\" x=\"2\" y=\"2\" rx=\"2\" ry=\"2\" />\n <rect width=\"20\" height=\"8\" x=\"2\" y=\"14\" rx=\"2\" ry=\"2\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"6\" y2=\"6\" />\n <line x1=\"6\" x2=\"6.01\" y1=\"18\" y2=\"18\" /></symbol><symbol id=\"i-settings-2\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 17H5\" />\n <path d=\"M19 7h-9\" />\n <circle cx=\"17\" cy=\"17\" r=\"3\" />\n <circle cx=\"7\" cy=\"7\" r=\"3\" /></symbol><symbol id=\"i-shield-check\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" />\n <path d=\"m9 12 2 2 4-4\" /></symbol><symbol id=\"i-sliders-horizontal\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 5H3\" />\n <path d=\"M12 19H3\" />\n <path d=\"M14 3v4\" />\n <path d=\"M16 17v4\" />\n <path d=\"M21 12h-9\" />\n <path d=\"M21 19h-5\" />\n <path d=\"M21 5h-7\" />\n <path d=\"M8 10v4\" />\n <path d=\"M8 12H3\" /></symbol><symbol id=\"i-sparkles\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\" />\n <path d=\"M20 2v4\" />\n <path d=\"M22 4h-4\" />\n <circle cx=\"4\" cy=\"20\" r=\"2\" /></symbol><symbol id=\"i-square\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" /></symbol><symbol id=\"i-terminal\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" /></symbol><symbol id=\"i-timer\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" /></symbol><symbol id=\"i-triangle-alert\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" /></symbol><symbol id=\"i-users\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\" />\n <path d=\"M16 3.128a4 4 0 0 1 0 7.744\" />\n <path d=\"M22 21v-2a4 4 0 0 0-3-3.87\" />\n <circle cx=\"9\" cy=\"7\" r=\"4\" /></symbol><symbol id=\"i-wallet\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1\" />\n <path d=\"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4\" /></symbol><symbol id=\"i-wand-sparkles\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72\" />\n <path d=\"m14 7 3 3\" />\n <path d=\"M5 6v4\" />\n <path d=\"M19 14v4\" />\n <path d=\"M10 2v2\" />\n <path d=\"M7 8H3\" />\n <path d=\"M21 16h-4\" />\n <path d=\"M11 3H9\" /></symbol><symbol id=\"i-webhook\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2\" />\n <path d=\"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06\" />\n <path d=\"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8\" /></symbol></svg>";
@@ -1,4 +1,4 @@
1
- import { capped, empty, html, layout, repoNav, skSlot, text, when, } from "./layout.js";
1
+ import { capped, empty, escapeHtml, html, layout, markdown, repoTabs, skSlot, text, when, } from "./layout.js";
2
2
  import { COMPARE_FILE_CAP, MAX_COMMITS_COUNTED } from "../../services/drift.js";
3
3
  function sizeLabel(bytes) {
4
4
  if (bytes < 1024)
@@ -16,8 +16,12 @@ export function renderKnowledge(username, data, viewId) {
16
16
  : `<div class="notice info"><div class="txt">Knowledge has not been built yet. Use Sync to build it.</div></div>`;
17
17
  const viewer = viewing
18
18
  ? `<div class="card"><div class="hd"><h2>${text(viewing.title)}</h2>
19
- <a class="btn sm" style="margin-left:auto" href="/repos/${text(name)}/knowledge">Close</a></div>
20
- <div class="bd"><pre class="log" style="max-height:none">${text(viewing.text)}</pre></div></div>`
19
+ <div style="margin-left:auto;display:flex;gap:8px;align-items:center">
20
+ <button class="btn sm" type="button" data-copy-doc="${text(viewing.id)}" aria-label="Copy">Copy</button>
21
+ <a class="btn sm" data-doc-download="${text(viewing.id)}" href="/repos/${text(name)}/knowledge?view=${encodeURIComponent(viewing.id)}&amp;download=1" download>Download</a>
22
+ <a class="btn sm" href="/repos/${text(name)}/knowledge">Close</a>
23
+ </div></div>
24
+ <div class="bd"><textarea hidden data-doc-source="${text(viewing.id)}">${escapeHtml(viewing.text)}</textarea>${markdown(viewing.text)}</div></div>`
21
25
  : "";
22
26
  const table = data.docs.length === 0
23
27
  ? empty("No documents", "Init this repository to generate the review guide.")
@@ -35,8 +39,9 @@ export function renderKnowledge(username, data, viewId) {
35
39
  return html(layout({
36
40
  title: `Knowledge · ${name}`,
37
41
  username,
38
- body: `<div class="wrap side">
39
- ${repoNav(name, "knowledge")}
42
+ active: "/",
43
+ body: `<div class="wrap">
44
+ ${repoTabs(name, "knowledge")}
40
45
  <div data-async>
41
46
  ${skSlot()}
42
47
  <div class="crumbs"><a href="/">Repositories</a> /
@@ -1,3 +1,4 @@
1
+ import type { NavCounts } from "../../services/nav_counts.ts";
1
2
  export declare function escapeHtml(value: unknown): string;
2
3
  export declare function text(value: unknown): string;
3
4
  export declare function markdown(value: unknown): string;
@@ -20,13 +21,28 @@ export declare function bars(items: {
20
21
  export declare function capped(value: number, cap: number): string;
21
22
  export declare function when(iso: string | null | undefined): string;
22
23
  export declare function skSlot(kind?: "table" | "block"): string;
24
+ export declare function setNavSource(source: (() => NavCounts) | undefined): void;
25
+ /** The shared shell: left menu, sidefoot user/theme/sign out, mobile topbar and
26
+ * overlay. `active` is the href of the nav item to mark; pages under Reviews
27
+ * pass `/`. */
23
28
  export declare function layout(opts: {
24
29
  title: string;
25
- username?: string;
26
- active?: "activity" | "analytics" | "settings";
30
+ username: string;
31
+ active?: string;
27
32
  body: string;
28
33
  }): string;
34
+ /** The sign-in page: a centered focus card with the same theme behavior but no
35
+ * application shell. */
36
+ export declare function layoutFocus(opts: {
37
+ title: string;
38
+ body: string;
39
+ }): string;
40
+ /** A 404 that still shows the shell, so a signed-in user keeps the menu and a
41
+ * way back. */
42
+ export declare function notFound(username: string, message: string, active?: string): Response;
29
43
  export declare function html(body: string, status?: number): Response;
30
- export declare function repoNav(fullName: string, on: string): string;
44
+ /** The repository tabs shared by every repo page. They replace the old second
45
+ * sidebar; the shell owns the only left menu. */
46
+ export declare function repoTabs(fullName: string, on: string): string;
31
47
  export declare function empty(title: string, lead: string): string;
32
48
  export declare function statusClass(kind: "ok" | "warn" | "err" | "run", label: string): string;
@@ -1,6 +1,8 @@
1
1
  import { safeCopy } from "../../util/redact.js";
2
2
  import { relativeTime } from "../../util/time.js";
3
3
  import { client } from "./client.js";
4
+ import { sprite } from "./icons.js";
5
+ import { VERSION } from "../../version.js";
4
6
  export function escapeHtml(value) {
5
7
  return String(value ?? "").replace(/[&<>"']/g, (char) => ({
6
8
  "&": "&amp;",
@@ -176,51 +178,172 @@ export function skSlot(kind = "block") {
176
178
  }
177
179
  return `<div class="sk-slot" hidden><div class="sk"></div><div class="sk"></div></div>`;
178
180
  }
181
+ /** Runs in `<head>` before first paint: a remembered dark theme is applied to
182
+ * `<html>` before the stylesheet can flash the light background. Kept inline
183
+ * and synchronous on purpose. */
184
+ const THEME_BOOTSTRAP = `try{if(localStorage.getItem("theme")==="dark"){document.documentElement.classList.add("dark")}}catch(e){}`;
185
+ function ico(name) {
186
+ return `<svg class="ic" aria-hidden="true"><use href="#i-${escapeHtml(name)}"></use></svg>`;
187
+ }
188
+ const NAV_GROUPS = [
189
+ {
190
+ label: "Reviews",
191
+ items: [
192
+ { href: "/", label: "Repositories", icon: "layout-grid" },
193
+ { href: "/activity", label: "Activity", icon: "activity" },
194
+ { href: "/usage", label: "Usage", icon: "chart-no-axes-column" },
195
+ ],
196
+ },
197
+ {
198
+ label: "Setup",
199
+ items: [{ href: "/setup", label: "Setup", icon: "list-checks" }],
200
+ },
201
+ {
202
+ label: "Settings",
203
+ items: [
204
+ { href: "/settings/ai", label: "AI models", icon: "sparkles" },
205
+ { href: "/settings/github", label: "GitHub", icon: "github" },
206
+ {
207
+ href: "/settings/defaults",
208
+ label: "Review defaults",
209
+ icon: "sliders-horizontal",
210
+ },
211
+ { href: "/settings/remote", label: "Remote access", icon: "key-round" },
212
+ { href: "/settings/server", label: "Server", icon: "server" },
213
+ { href: "/settings/sign-in", label: "Sign-in", icon: "shield-check" },
214
+ {
215
+ href: "/settings/danger",
216
+ label: "Danger zone",
217
+ icon: "triangle-alert",
218
+ },
219
+ ],
220
+ },
221
+ ];
222
+ /** Where the menu badges come from. `createApp` registers the real counts;
223
+ * a page rendered without an app (a unit test of one renderer) has none and
224
+ * shows no badges. */
225
+ let navSource;
226
+ export function setNavSource(source) {
227
+ navSource = source;
228
+ }
229
+ function readNavCounts() {
230
+ try {
231
+ return navSource?.();
232
+ }
233
+ catch {
234
+ // The badges are decoration: a closed database (a test that rendered a
235
+ // page after tearing its app down) must not break the page itself.
236
+ return undefined;
237
+ }
238
+ }
239
+ function navBadge(href, counts) {
240
+ if (!counts)
241
+ return "";
242
+ if (href === "/" && counts.repos > 0) {
243
+ return `<span class="r tnum">${counts.repos}</span>`;
244
+ }
245
+ if (href === "/activity" && counts.failed > 0) {
246
+ return `<span class="r fail-count">${counts.failed} failed</span>`;
247
+ }
248
+ if (href === "/setup")
249
+ return `<span class="r tnum">${text(counts.setup)}</span>`;
250
+ return "";
251
+ }
252
+ function navHtml(active) {
253
+ const counts = readNavCounts();
254
+ return `<nav class="nav">${NAV_GROUPS.map((group) => `<div class="grp"><p>${group.label}</p>${group.items
255
+ .map((item) => `<a class="item${item.href === active ? " on" : ""}" href="${item.href}">${ico(item.icon)}${item.label}${navBadge(item.href, counts)}</a>`)
256
+ .join("")}</div>`).join("")}</nav>`;
257
+ }
258
+ /** The Ctrl K palette, hidden until `client.js` opens it. Results are filled
259
+ * from `/api/search`. */
260
+ const PALETTE = `<div class="pal-ov" id="pal-ov" hidden></div>
261
+ <div class="pal" id="pal" role="dialog" aria-modal="true" aria-label="Search" hidden>
262
+ <div class="in">${ico("search")}<input id="pal-q" type="text" role="combobox" aria-expanded="true" aria-controls="pal-list" aria-autocomplete="list" autocomplete="off" placeholder="Search pages, repositories, pull requests" aria-label="Search pages, repositories, pull requests"><kbd>Esc</kbd></div>
263
+ <div class="list" id="pal-list" role="listbox" aria-label="Results"></div>
264
+ </div>`;
265
+ /** The shared shell: left menu, sidefoot user/theme/sign out, mobile topbar and
266
+ * overlay. `active` is the href of the nav item to mark; pages under Reviews
267
+ * pass `/`. */
179
268
  export function layout(opts) {
180
- const right = opts.username
181
- ? `<div class="right">
182
- <a href="/activity"${opts.active === "activity"
183
- ? ` style="color:var(--text);font-weight:500"`
184
- : ""}>Activity</a>
185
- <a href="/analytics"${opts.active === "analytics"
186
- ? ` style="color:var(--text);font-weight:500"`
187
- : ""}>Usage</a>
188
- <a href="/settings"${opts.active === "settings"
189
- ? ` style="color:var(--text);font-weight:500"`
190
- : ""}>Settings</a>
191
- <span>${text(opts.username)}</span>
192
- </div>`
193
- : "";
269
+ const username = opts.username;
270
+ const initials = (username || "?").slice(0, 2).toUpperCase();
194
271
  return `<!doctype html><html lang="en"><head><meta charset="utf-8">
195
- <title>${text(opts.title)}</title><link rel="stylesheet" href="/styles.css"><link rel="icon" href="/logo.png" type="image/png"><script>${client}</script></head><body>
196
- <div class="top"><div class="in">
197
- <a class="logo" href="/"><img src="/logo.png" alt="">co-maintainer</a>
198
- ${right}
199
- </div></div>
200
- ${opts.body}
272
+ <meta name="viewport" content="width=device-width, initial-scale=1">
273
+ <title>${text(opts.title)}</title><link rel="stylesheet" href="/styles.css"><link rel="icon" href="/logo.png" type="image/png"><script>${THEME_BOOTSTRAP}</script><script>${client}</script></head><body>
274
+ ${sprite}
275
+ <div class="app">
276
+ <aside class="side" id="side">
277
+ <a class="logo" href="/"><img class="mark" src="/logo.png" alt=""><span class="name"><span class="n">co-maintainer</span><span class="s">Dashboard</span></span></a>
278
+ <button type="button" class="search" data-palette aria-keyshortcuts="Control+K Meta+K">${ico("search")}<span>Search…</span><kbd>Ctrl K</kbd></button>
279
+ ${navHtml(opts.active)}
280
+ <div class="sidefoot">
281
+ <div class="me"><span class="av">${text(initials)}</span><span class="who"><span class="u">${text(username)}</span><span class="s">v${text(VERSION)}</span></span></div>
282
+ <button type="button" class="ghost" id="theme">${ico("moon")}<span>Dark mode</span></button>
283
+ <form method="post" action="/logout"><button type="submit" class="ghost">${ico("log-out")}Sign out</button></form>
284
+ </div>
285
+ </aside>
286
+ <div class="overlay" id="overlay"></div>
287
+ <main>
288
+ <div class="topbar"><button type="button" class="btn out sm" id="menu" aria-label="Menu">${ico("menu")}</button>co-maintainer</div>
289
+ ${opts.body}
290
+ </main>
291
+ </div>
292
+ ${PALETTE}
201
293
  <div id="toasts"></div>
202
294
  </body></html>`;
203
295
  }
296
+ /** The sign-in page: a centered focus card with the same theme behavior but no
297
+ * application shell. */
298
+ export function layoutFocus(opts) {
299
+ return `<!doctype html><html lang="en"><head><meta charset="utf-8">
300
+ <meta name="viewport" content="width=device-width, initial-scale=1">
301
+ <title>${text(opts.title)}</title><link rel="stylesheet" href="/styles.css"><link rel="icon" href="/logo.png" type="image/png"><script>${THEME_BOOTSTRAP}</script><script>${client}</script></head><body>
302
+ ${sprite}
303
+ <div class="focus"><main><div class="wrap">${opts.body}</div></main></div>
304
+ <div id="toasts"></div>
305
+ </body></html>`;
306
+ }
307
+ /** A 404 that still shows the shell, so a signed-in user keeps the menu and a
308
+ * way back. */
309
+ export function notFound(username, message, active) {
310
+ return html(layout({
311
+ title: "Page not found · co-maintainer",
312
+ username,
313
+ active,
314
+ body: `<div class="wrap">
315
+ <div class="pagehead"><div><h1>Page not found</h1>
316
+ <p class="lead">${text(message)}</p></div></div>
317
+ <div class="card"><div class="bd">
318
+ <a class="btn primary" href="/">Back to repositories</a>
319
+ </div></div>
320
+ </div>`,
321
+ }), 404);
322
+ }
204
323
  export function html(body, status = 200) {
205
324
  return new Response(body, {
206
325
  status,
207
326
  headers: { "content-type": "text/html; charset=utf-8" },
208
327
  });
209
328
  }
210
- export function repoNav(fullName, on) {
211
- const short = text(fullName.split("/")[1] ?? fullName);
329
+ /** The repository tabs shared by every repo page. They replace the old second
330
+ * sidebar; the shell owns the only left menu. */
331
+ export function repoTabs(fullName, on) {
212
332
  const href = `/repos/${fullName}`;
213
- const item = (id, label, path) => `<a href="${path}"${on === id ? ` class="on"` : ""}>${label}</a>`;
214
- return `<aside>
215
- <p class="lbl">${short}</p>
216
- <nav>
217
- ${item("overview", "Overview", href)}
218
- ${item("pulls", "Pull requests", `${href}/pulls`)}
219
- ${item("remote", "Remote", `${href}/remote`)}
220
- ${item("knowledge", "Knowledge", `${href}/knowledge`)}
221
- ${item("settings", "Settings", `${href}/settings`)}
222
- </nav>
223
- </aside>`;
333
+ const items = [
334
+ { id: "overview", label: "Overview", path: href },
335
+ { id: "pulls", label: "Pull requests", path: `${href}/pulls` },
336
+ { id: "knowledge", label: "Knowledge", path: `${href}/knowledge` },
337
+ { id: "remote", label: "Remote reviews", path: `${href}/remote` },
338
+ {
339
+ id: "settings",
340
+ label: "Repository settings",
341
+ path: `${href}/settings`,
342
+ },
343
+ ];
344
+ return `<nav class="tabs">${items
345
+ .map((item) => `<a href="${item.path}"${on === item.id ? ` class="on"` : ""}>${text(item.label)}</a>`)
346
+ .join("")}</nav>`;
224
347
  }
225
348
  export function empty(title, lead) {
226
349
  return `<div class="empty"><h2>${text(title)}</h2><p>${text(lead)}</p></div>`;
@@ -1,4 +1,4 @@
1
- import { empty, html, layout, markdown, repoNav, skSlot, text, when, } from "./layout.js";
1
+ import { empty, html, layout, markdown, repoTabs, skSlot, text, when, } from "./layout.js";
2
2
  import { formatCost, formatCostTotal, totalOfRows } from "./cost.js";
3
3
  export function renderPr(username, fullName, data) {
4
4
  const n = data.prNumber;
@@ -72,8 +72,9 @@ export function renderPr(username, fullName, data) {
72
72
  return html(layout({
73
73
  title: `#${n} · co-maintainer`,
74
74
  username,
75
- body: `<div class="wrap side">
76
- ${repoNav(fullName, "pulls")}
75
+ active: "/",
76
+ body: `<div class="wrap">
77
+ ${repoTabs(fullName, "pulls")}
77
78
  <div data-async>
78
79
  ${skSlot()}
79
80
  <div class="crumbs"><a href="/">Repositories</a> /
@@ -0,0 +1,5 @@
1
+ import type { RateLimitWait, RateLimitWaitSummary } from "../../services/rate_limit.ts";
2
+ export declare function rateLimitServiceLabel(service: string): string;
3
+ export declare function rateLimitWaitSummaryLine(summary: RateLimitWaitSummary): string;
4
+ export declare function rateLimitWaitNotice(waits: RateLimitWait[], summary: RateLimitWaitSummary, title: string): string;
5
+ export declare function rateLimitWaitDetails(waits: RateLimitWait[]): string;
@@ -0,0 +1,74 @@
1
+ import { escapeHtml, text, when } from "./layout.js";
2
+ const SERVICE_LABEL = {
3
+ openrouter: "OpenRouter",
4
+ github: "GitHub",
5
+ };
6
+ export function rateLimitServiceLabel(service) {
7
+ return SERVICE_LABEL[service] ?? service;
8
+ }
9
+ function secondsLabel(seconds) {
10
+ return `${seconds} s`;
11
+ }
12
+ function joinList(parts) {
13
+ if (parts.length <= 1)
14
+ return parts[0] ?? "";
15
+ if (parts.length === 2)
16
+ return `${parts[0]} and ${parts[1]}`;
17
+ return `${parts.slice(0, -1).join(", ")}, and ${parts[parts.length - 1]}`;
18
+ }
19
+ function groupWaits(waits) {
20
+ const byService = new Map();
21
+ for (const wait of waits) {
22
+ const list = byService.get(wait.service) ?? [];
23
+ list.push(wait);
24
+ byService.set(wait.service, list);
25
+ }
26
+ return [...byService.entries()].map(([service, list]) => ({
27
+ service,
28
+ waits: list,
29
+ durations: [...new Set(list.map((wait) => wait.seconds))].sort((a, b) => a - b),
30
+ }));
31
+ }
32
+ function groupSentence(group) {
33
+ const label = rateLimitServiceLabel(group.service);
34
+ const count = group.waits.length;
35
+ const times = count === 1 ? "once" : count === 2 ? "twice" : `${count} times`;
36
+ if (group.durations.length === 1) {
37
+ const each = count === 1 ? "" : " each time";
38
+ return `${label} asked to slow down ${times}; waited ${secondsLabel(group.durations[0])}${each}`;
39
+ }
40
+ return `${label} asked to slow down ${times}; waited ${joinList(group.durations.map(secondsLabel))}`;
41
+ }
42
+ export function rateLimitWaitSummaryLine(summary) {
43
+ const waits = `${summary.count} wait${summary.count === 1 ? "" : "s"}`;
44
+ return `${waits}, ${summary.totalSeconds} s total`;
45
+ }
46
+ export function rateLimitWaitNotice(waits, summary, title) {
47
+ if (waits.length === 0)
48
+ return "";
49
+ const sentences = groupWaits(waits).map(groupSentence).join(" ");
50
+ return `<div class="notice warn" data-rate-limit-waits>
51
+ <div class="txt"><b>${text(title)}</b>
52
+ <div>${escapeHtml(sentences)}</div>
53
+ <div class="muted">${text(rateLimitWaitSummaryLine(summary))}</div>
54
+ </div>
55
+ </div>`;
56
+ }
57
+ export function rateLimitWaitDetails(waits) {
58
+ if (waits.length === 0)
59
+ return "";
60
+ const rows = waits
61
+ .map((wait) => `<tr>
62
+ <td>${text(rateLimitServiceLabel(wait.service))}</td>
63
+ <td>${text(wait.stage)}</td>
64
+ <td class="muted">${text(wait.reason)}</td>
65
+ <td class="num">${text(secondsLabel(wait.seconds))}</td>
66
+ <td class="muted">${when(wait.at)}</td>
67
+ </tr>`)
68
+ .join("");
69
+ return `<div class="card"><div class="hd"><h2>Waits in this job</h2></div>
70
+ <div class="bd flush"><table>
71
+ <thead><tr><th>Service</th><th>Stage</th><th>Reason</th><th class="num">Waited</th><th>When</th></tr></thead>
72
+ <tbody>${rows}</tbody>
73
+ </table></div></div>`;
74
+ }