create-claude-code-visualizer 0.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 (220) hide show
  1. package/index.js +393 -0
  2. package/package.json +31 -0
  3. package/templates/CLAUDE.md +108 -0
  4. package/templates/app/.env.local.example +14 -0
  5. package/templates/app/ecosystem.config.js +29 -0
  6. package/templates/app/next-env.d.ts +6 -0
  7. package/templates/app/next.config.ts +16 -0
  8. package/templates/app/package-lock.json +4581 -0
  9. package/templates/app/package.json +38 -0
  10. package/templates/app/postcss.config.js +5 -0
  11. package/templates/app/src/app/agents/[slug]/chat/loading.tsx +26 -0
  12. package/templates/app/src/app/agents/[slug]/chat/page.tsx +579 -0
  13. package/templates/app/src/app/agents/[slug]/loading.tsx +19 -0
  14. package/templates/app/src/app/agents/page.tsx +8 -0
  15. package/templates/app/src/app/api/agents/[slug]/capabilities/route.ts +11 -0
  16. package/templates/app/src/app/api/agents/[slug]/route.ts +57 -0
  17. package/templates/app/src/app/api/agents/route.ts +28 -0
  18. package/templates/app/src/app/api/ai/generate-agent/route.ts +87 -0
  19. package/templates/app/src/app/api/ai/improve-claude-md/route.ts +78 -0
  20. package/templates/app/src/app/api/ai/suggestions/route.ts +64 -0
  21. package/templates/app/src/app/api/ai/title/route.ts +88 -0
  22. package/templates/app/src/app/api/auth/role/route.ts +17 -0
  23. package/templates/app/src/app/api/commands/[slug]/route.ts +61 -0
  24. package/templates/app/src/app/api/commands/route.ts +6 -0
  25. package/templates/app/src/app/api/governance/costs/route.ts +117 -0
  26. package/templates/app/src/app/api/governance/sessions/route.ts +335 -0
  27. package/templates/app/src/app/api/notifications/route.ts +62 -0
  28. package/templates/app/src/app/api/preferences/route.ts +44 -0
  29. package/templates/app/src/app/api/runs/[id]/approve/route.ts +38 -0
  30. package/templates/app/src/app/api/runs/[id]/events/route.ts +28 -0
  31. package/templates/app/src/app/api/runs/[id]/metadata/route.ts +30 -0
  32. package/templates/app/src/app/api/runs/[id]/route.ts +21 -0
  33. package/templates/app/src/app/api/runs/[id]/start/route.ts +61 -0
  34. package/templates/app/src/app/api/runs/[id]/stop/route.ts +16 -0
  35. package/templates/app/src/app/api/runs/[id]/stream/route.ts +201 -0
  36. package/templates/app/src/app/api/runs/route.ts +95 -0
  37. package/templates/app/src/app/api/schedules/[id]/route.ts +81 -0
  38. package/templates/app/src/app/api/schedules/route.ts +75 -0
  39. package/templates/app/src/app/api/settings/access-logs/route.ts +33 -0
  40. package/templates/app/src/app/api/settings/claude-md/route.ts +44 -0
  41. package/templates/app/src/app/api/settings/env-keys/route.ts +271 -0
  42. package/templates/app/src/app/api/settings/users/route.ts +108 -0
  43. package/templates/app/src/app/api/skills/[slug]/route.ts +43 -0
  44. package/templates/app/src/app/api/skills/route.ts +6 -0
  45. package/templates/app/src/app/api/tools/route.ts +65 -0
  46. package/templates/app/src/app/api/uploads/cleanup/route.ts +29 -0
  47. package/templates/app/src/app/api/uploads/route.ts +77 -0
  48. package/templates/app/src/app/auth/callback/route.ts +19 -0
  49. package/templates/app/src/app/globals.css +115 -0
  50. package/templates/app/src/app/layout.tsx +24 -0
  51. package/templates/app/src/app/loading.tsx +16 -0
  52. package/templates/app/src/app/login/page.tsx +64 -0
  53. package/templates/app/src/app/not-authorized/page.tsx +33 -0
  54. package/templates/app/src/app/runs/page.tsx +55 -0
  55. package/templates/app/src/app/schedules/page.tsx +110 -0
  56. package/templates/app/src/app/settings/page.tsx +1294 -0
  57. package/templates/app/src/app/skills/page.tsx +7 -0
  58. package/templates/app/src/components/agent-card.tsx +58 -0
  59. package/templates/app/src/components/agent-grid.tsx +90 -0
  60. package/templates/app/src/components/auth/auth-context.tsx +79 -0
  61. package/templates/app/src/components/chat-thread.tsx +50 -0
  62. package/templates/app/src/components/chat-view.tsx +670 -0
  63. package/templates/app/src/components/commands-browser.tsx +349 -0
  64. package/templates/app/src/components/create-agent-modal.tsx +388 -0
  65. package/templates/app/src/components/governance-dashboard.tsx +397 -0
  66. package/templates/app/src/components/icons.tsx +401 -0
  67. package/templates/app/src/components/layout/agent-sidebar.tsx +504 -0
  68. package/templates/app/src/components/layout/app-shell.tsx +29 -0
  69. package/templates/app/src/components/layout/nav.tsx +87 -0
  70. package/templates/app/src/components/layout/overview-inner.tsx +14 -0
  71. package/templates/app/src/components/layout/profile-menu.tsx +95 -0
  72. package/templates/app/src/components/layout/sidebar.tsx +30 -0
  73. package/templates/app/src/components/markdown.tsx +57 -0
  74. package/templates/app/src/components/message-bar.tsx +161 -0
  75. package/templates/app/src/components/notifications/notification-bell.tsx +104 -0
  76. package/templates/app/src/components/notifications/notification-panel.tsx +116 -0
  77. package/templates/app/src/components/overview/overview-content.tsx +287 -0
  78. package/templates/app/src/components/overview/overview-context.tsx +88 -0
  79. package/templates/app/src/components/preferences-modal.tsx +112 -0
  80. package/templates/app/src/components/run-form.tsx +73 -0
  81. package/templates/app/src/components/run-history-table.tsx +226 -0
  82. package/templates/app/src/components/run-output.tsx +187 -0
  83. package/templates/app/src/components/schedule-form.tsx +148 -0
  84. package/templates/app/src/components/skills-browser.tsx +338 -0
  85. package/templates/app/src/components/tool-tooltip.tsx +82 -0
  86. package/templates/app/src/hooks/use-sse.ts +115 -0
  87. package/templates/app/src/instrumentation.ts +9 -0
  88. package/templates/app/src/lib/agent-cache.ts +19 -0
  89. package/templates/app/src/lib/agent-runner.ts +411 -0
  90. package/templates/app/src/lib/agents.ts +168 -0
  91. package/templates/app/src/lib/ai.ts +40 -0
  92. package/templates/app/src/lib/approval-store.ts +70 -0
  93. package/templates/app/src/lib/auth-guard.ts +116 -0
  94. package/templates/app/src/lib/capabilities.ts +191 -0
  95. package/templates/app/src/lib/line-diff.ts +96 -0
  96. package/templates/app/src/lib/queue.ts +22 -0
  97. package/templates/app/src/lib/redis.ts +12 -0
  98. package/templates/app/src/lib/role-permissions.ts +166 -0
  99. package/templates/app/src/lib/run-agent.ts +442 -0
  100. package/templates/app/src/lib/supabase-browser.ts +8 -0
  101. package/templates/app/src/lib/supabase-middleware.ts +63 -0
  102. package/templates/app/src/lib/supabase-server.ts +28 -0
  103. package/templates/app/src/lib/supabase.ts +6 -0
  104. package/templates/app/src/lib/tool-descriptions.ts +29 -0
  105. package/templates/app/src/lib/types.ts +73 -0
  106. package/templates/app/src/lib/typewriter-animation.ts +159 -0
  107. package/templates/app/src/middleware.ts +13 -0
  108. package/templates/app/tsconfig.json +21 -0
  109. package/templates/app/uploads/.gitkeep +0 -0
  110. package/templates/app/worker/index.ts +342 -0
  111. package/templates/claude/agents/ai-trends-scout.md +66 -0
  112. package/templates/claude/commands/add-to-todos.md +56 -0
  113. package/templates/claude/commands/check-todos.md +56 -0
  114. package/templates/claude/hooks/auto-approve-safe.sh +34 -0
  115. package/templates/claude/hooks/auto-format.sh +25 -0
  116. package/templates/claude/hooks/block-destructive.sh +32 -0
  117. package/templates/claude/hooks/compaction-preserver.sh +16 -0
  118. package/templates/claude/hooks/notify.sh +26 -0
  119. package/templates/claude/settings.local.json +66 -0
  120. package/templates/claude/skills/frontend-design/SKILL.md +127 -0
  121. package/templates/claude/skills/frontend-design/reference/color-and-contrast.md +132 -0
  122. package/templates/claude/skills/frontend-design/reference/interaction-design.md +123 -0
  123. package/templates/claude/skills/frontend-design/reference/motion-design.md +99 -0
  124. package/templates/claude/skills/frontend-design/reference/responsive-design.md +114 -0
  125. package/templates/claude/skills/frontend-design/reference/spatial-design.md +100 -0
  126. package/templates/claude/skills/frontend-design/reference/typography.md +131 -0
  127. package/templates/claude/skills/frontend-design/reference/ux-writing.md +107 -0
  128. package/templates/claude/skills/gws-admin-reports/SKILL.md +57 -0
  129. package/templates/claude/skills/gws-calendar/SKILL.md +108 -0
  130. package/templates/claude/skills/gws-calendar-agenda/SKILL.md +52 -0
  131. package/templates/claude/skills/gws-calendar-insert/SKILL.md +55 -0
  132. package/templates/claude/skills/gws-chat/SKILL.md +73 -0
  133. package/templates/claude/skills/gws-chat-send/SKILL.md +49 -0
  134. package/templates/claude/skills/gws-classroom/SKILL.md +75 -0
  135. package/templates/claude/skills/gws-docs/SKILL.md +48 -0
  136. package/templates/claude/skills/gws-docs-write/SKILL.md +49 -0
  137. package/templates/claude/skills/gws-drive/SKILL.md +137 -0
  138. package/templates/claude/skills/gws-drive-upload/SKILL.md +52 -0
  139. package/templates/claude/skills/gws-events/SKILL.md +67 -0
  140. package/templates/claude/skills/gws-events-renew/SKILL.md +48 -0
  141. package/templates/claude/skills/gws-events-subscribe/SKILL.md +59 -0
  142. package/templates/claude/skills/gws-forms/SKILL.md +45 -0
  143. package/templates/claude/skills/gws-gmail/SKILL.md +59 -0
  144. package/templates/claude/skills/gws-gmail-forward/SKILL.md +53 -0
  145. package/templates/claude/skills/gws-gmail-reply/SKILL.md +56 -0
  146. package/templates/claude/skills/gws-gmail-reply-all/SKILL.md +60 -0
  147. package/templates/claude/skills/gws-gmail-send/SKILL.md +55 -0
  148. package/templates/claude/skills/gws-gmail-triage/SKILL.md +50 -0
  149. package/templates/claude/skills/gws-gmail-watch/SKILL.md +58 -0
  150. package/templates/claude/skills/gws-keep/SKILL.md +48 -0
  151. package/templates/claude/skills/gws-meet/SKILL.md +51 -0
  152. package/templates/claude/skills/gws-modelarmor/SKILL.md +42 -0
  153. package/templates/claude/skills/gws-modelarmor-create-template/SKILL.md +53 -0
  154. package/templates/claude/skills/gws-modelarmor-sanitize-prompt/SKILL.md +48 -0
  155. package/templates/claude/skills/gws-modelarmor-sanitize-response/SKILL.md +48 -0
  156. package/templates/claude/skills/gws-people/SKILL.md +67 -0
  157. package/templates/claude/skills/gws-shared/SKILL.md +66 -0
  158. package/templates/claude/skills/gws-sheets/SKILL.md +53 -0
  159. package/templates/claude/skills/gws-sheets-append/SKILL.md +51 -0
  160. package/templates/claude/skills/gws-sheets-read/SKILL.md +47 -0
  161. package/templates/claude/skills/gws-slides/SKILL.md +43 -0
  162. package/templates/claude/skills/gws-tasks/SKILL.md +56 -0
  163. package/templates/claude/skills/gws-workflow/SKILL.md +44 -0
  164. package/templates/claude/skills/gws-workflow-email-to-task/SKILL.md +47 -0
  165. package/templates/claude/skills/gws-workflow-file-announce/SKILL.md +50 -0
  166. package/templates/claude/skills/gws-workflow-meeting-prep/SKILL.md +47 -0
  167. package/templates/claude/skills/gws-workflow-standup-report/SKILL.md +46 -0
  168. package/templates/claude/skills/gws-workflow-weekly-digest/SKILL.md +46 -0
  169. package/templates/claude/skills/persona-content-creator/SKILL.md +33 -0
  170. package/templates/claude/skills/persona-customer-support/SKILL.md +34 -0
  171. package/templates/claude/skills/persona-event-coordinator/SKILL.md +35 -0
  172. package/templates/claude/skills/persona-exec-assistant/SKILL.md +35 -0
  173. package/templates/claude/skills/persona-hr-coordinator/SKILL.md +33 -0
  174. package/templates/claude/skills/persona-it-admin/SKILL.md +30 -0
  175. package/templates/claude/skills/persona-project-manager/SKILL.md +35 -0
  176. package/templates/claude/skills/persona-researcher/SKILL.md +33 -0
  177. package/templates/claude/skills/persona-sales-ops/SKILL.md +35 -0
  178. package/templates/claude/skills/persona-team-lead/SKILL.md +36 -0
  179. package/templates/claude/skills/recipe-backup-sheet-as-csv/SKILL.md +25 -0
  180. package/templates/claude/skills/recipe-batch-invite-to-event/SKILL.md +25 -0
  181. package/templates/claude/skills/recipe-block-focus-time/SKILL.md +24 -0
  182. package/templates/claude/skills/recipe-bulk-download-folder/SKILL.md +25 -0
  183. package/templates/claude/skills/recipe-collect-form-responses/SKILL.md +25 -0
  184. package/templates/claude/skills/recipe-compare-sheet-tabs/SKILL.md +25 -0
  185. package/templates/claude/skills/recipe-copy-sheet-for-new-month/SKILL.md +25 -0
  186. package/templates/claude/skills/recipe-create-classroom-course/SKILL.md +25 -0
  187. package/templates/claude/skills/recipe-create-doc-from-template/SKILL.md +29 -0
  188. package/templates/claude/skills/recipe-create-events-from-sheet/SKILL.md +24 -0
  189. package/templates/claude/skills/recipe-create-expense-tracker/SKILL.md +26 -0
  190. package/templates/claude/skills/recipe-create-feedback-form/SKILL.md +25 -0
  191. package/templates/claude/skills/recipe-create-gmail-filter/SKILL.md +26 -0
  192. package/templates/claude/skills/recipe-create-meet-space/SKILL.md +25 -0
  193. package/templates/claude/skills/recipe-create-presentation/SKILL.md +25 -0
  194. package/templates/claude/skills/recipe-create-shared-drive/SKILL.md +25 -0
  195. package/templates/claude/skills/recipe-create-task-list/SKILL.md +26 -0
  196. package/templates/claude/skills/recipe-create-vacation-responder/SKILL.md +25 -0
  197. package/templates/claude/skills/recipe-draft-email-from-doc/SKILL.md +25 -0
  198. package/templates/claude/skills/recipe-email-drive-link/SKILL.md +25 -0
  199. package/templates/claude/skills/recipe-find-free-time/SKILL.md +25 -0
  200. package/templates/claude/skills/recipe-find-large-files/SKILL.md +24 -0
  201. package/templates/claude/skills/recipe-forward-labeled-emails/SKILL.md +27 -0
  202. package/templates/claude/skills/recipe-generate-report-from-sheet/SKILL.md +34 -0
  203. package/templates/claude/skills/recipe-label-and-archive-emails/SKILL.md +25 -0
  204. package/templates/claude/skills/recipe-log-deal-update/SKILL.md +25 -0
  205. package/templates/claude/skills/recipe-organize-drive-folder/SKILL.md +26 -0
  206. package/templates/claude/skills/recipe-plan-weekly-schedule/SKILL.md +26 -0
  207. package/templates/claude/skills/recipe-post-mortem-setup/SKILL.md +25 -0
  208. package/templates/claude/skills/recipe-reschedule-meeting/SKILL.md +25 -0
  209. package/templates/claude/skills/recipe-review-meet-participants/SKILL.md +25 -0
  210. package/templates/claude/skills/recipe-review-overdue-tasks/SKILL.md +25 -0
  211. package/templates/claude/skills/recipe-save-email-attachments/SKILL.md +26 -0
  212. package/templates/claude/skills/recipe-save-email-to-doc/SKILL.md +29 -0
  213. package/templates/claude/skills/recipe-schedule-recurring-event/SKILL.md +24 -0
  214. package/templates/claude/skills/recipe-send-team-announcement/SKILL.md +24 -0
  215. package/templates/claude/skills/recipe-share-doc-and-notify/SKILL.md +25 -0
  216. package/templates/claude/skills/recipe-share-event-materials/SKILL.md +25 -0
  217. package/templates/claude/skills/recipe-share-folder-with-team/SKILL.md +26 -0
  218. package/templates/claude/skills/recipe-sync-contacts-to-sheet/SKILL.md +25 -0
  219. package/templates/claude/skills/recipe-watch-drive-changes/SKILL.md +25 -0
  220. package/templates/mcp.json +12 -0
@@ -0,0 +1,115 @@
1
+ @import "tailwindcss";
2
+
3
+ /* --- Linear-style design tokens --- */
4
+ :root {
5
+ /* Surfaces */
6
+ --bg-base: #09090b;
7
+ --bg-raised: rgba(255, 255, 255, 0.02);
8
+ --bg-elevated: rgba(255, 255, 255, 0.04);
9
+ --bg-hover: rgba(255, 255, 255, 0.06);
10
+ --bg-active: rgba(255, 255, 255, 0.08);
11
+
12
+ /* Borders */
13
+ --border-subtle: rgba(255, 255, 255, 0.06);
14
+ --border-default: rgba(255, 255, 255, 0.08);
15
+ --border-strong: rgba(255, 255, 255, 0.12);
16
+ --border-focus: rgba(255, 255, 255, 0.2);
17
+
18
+ /* Text */
19
+ --text-primary: rgba(255, 255, 255, 0.95);
20
+ --text-secondary: rgba(255, 255, 255, 0.6);
21
+ --text-tertiary: rgba(255, 255, 255, 0.4);
22
+ --text-muted: rgba(255, 255, 255, 0.25);
23
+
24
+ /* Accent — desaturated blue, Linear-style */
25
+ --accent: #5e6ad2;
26
+ --accent-hover: #6e79d6;
27
+ --accent-muted: rgba(94, 106, 210, 0.15);
28
+ --accent-text: #8b94e4;
29
+
30
+ /* Status — desaturated */
31
+ --status-success: #4ade80;
32
+ --status-warning: #f59e0b;
33
+ --status-error: #ef4444;
34
+ --status-info: #60a5fa;
35
+
36
+ /* Font stacks */
37
+ --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
38
+ --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
39
+ }
40
+
41
+ html {
42
+ font-family: var(--font-sans);
43
+ -webkit-font-smoothing: antialiased;
44
+ -moz-osx-font-smoothing: grayscale;
45
+ }
46
+
47
+ /* Code/data elements */
48
+ code, pre, .font-mono {
49
+ font-family: var(--font-mono);
50
+ }
51
+
52
+ /* --- Focus indicators (keyboard only) --- */
53
+ @layer base {
54
+ :focus-visible {
55
+ outline: 1.5px solid var(--accent);
56
+ outline-offset: 1px;
57
+ border-radius: 4px;
58
+ }
59
+
60
+ /* Remove focus outline on mouse click */
61
+ :focus:not(:focus-visible) {
62
+ outline: none;
63
+ }
64
+ }
65
+
66
+ /* --- Reduced motion --- */
67
+ @media (prefers-reduced-motion: reduce) {
68
+ *, *::before, *::after {
69
+ animation-duration: 0.01ms !important;
70
+ animation-iteration-count: 1 !important;
71
+ transition-duration: 0.01ms !important;
72
+ scroll-behavior: auto !important;
73
+ }
74
+ }
75
+
76
+ /* --- Consistent transitions --- */
77
+ button, a, [role="button"] {
78
+ transition-property: color, background-color, border-color, opacity;
79
+ transition-duration: 150ms;
80
+ transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1); /* ease-out-expo */
81
+ }
82
+
83
+ /* Auto-hide scrollbars — visible only while scrolling/hovering */
84
+ * {
85
+ scrollbar-width: thin;
86
+ scrollbar-color: transparent transparent;
87
+ }
88
+
89
+ *:hover,
90
+ *:active {
91
+ scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
92
+ }
93
+
94
+ /* Webkit (Chrome, Edge, Safari) */
95
+ ::-webkit-scrollbar {
96
+ width: 5px;
97
+ height: 5px;
98
+ }
99
+
100
+ ::-webkit-scrollbar-track {
101
+ background: transparent;
102
+ }
103
+
104
+ ::-webkit-scrollbar-thumb {
105
+ background: transparent;
106
+ border-radius: 3px;
107
+ }
108
+
109
+ *:hover::-webkit-scrollbar-thumb {
110
+ background: rgba(255, 255, 255, 0.08);
111
+ }
112
+
113
+ *:hover::-webkit-scrollbar-thumb:hover {
114
+ background: rgba(255, 255, 255, 0.15);
115
+ }
@@ -0,0 +1,24 @@
1
+ import type { Metadata } from "next";
2
+ import { AppShell } from "@/components/layout/app-shell";
3
+ import "./globals.css";
4
+
5
+ export const metadata: Metadata = {
6
+ title: "Agent Dashboard",
7
+ description: "Personal AI Agent Dashboard",
8
+ };
9
+
10
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
11
+ return (
12
+ <html lang="en" className="dark">
13
+ <head>
14
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
15
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
16
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet" />
17
+ <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
18
+ </head>
19
+ <body className="bg-[var(--bg-base)] text-[var(--text-primary)] antialiased">
20
+ <AppShell>{children}</AppShell>
21
+ </body>
22
+ </html>
23
+ );
24
+ }
@@ -0,0 +1,16 @@
1
+ export default function HomeLoading() {
2
+ return (
3
+ <div className="animate-pulse">
4
+ <div className="h-3 w-32 rounded bg-[var(--bg-elevated)] mb-3" />
5
+ <div className="space-y-1">
6
+ {[...Array(5)].map((_, i) => (
7
+ <div key={i} className="flex items-center gap-3 px-3 py-2.5 rounded-md">
8
+ <div className="h-4 w-4 rounded bg-[var(--bg-elevated)]" />
9
+ <div className="h-3.5 w-32 rounded bg-[var(--bg-elevated)]" />
10
+ <div className="h-3 flex-1 rounded bg-[var(--bg-raised)]" />
11
+ </div>
12
+ ))}
13
+ </div>
14
+ </div>
15
+ );
16
+ }
@@ -0,0 +1,64 @@
1
+ "use client";
2
+
3
+ import { useState } from "react";
4
+ import { createClient } from "@/lib/supabase-browser";
5
+
6
+ export default function LoginPage() {
7
+ const [loading, setLoading] = useState(false);
8
+ const [error, setError] = useState<string | null>(null);
9
+
10
+ async function signInWithGoogle() {
11
+ setLoading(true);
12
+ setError(null);
13
+ const supabase = createClient();
14
+
15
+ const { error } = await supabase.auth.signInWithOAuth({
16
+ provider: "google",
17
+ options: {
18
+ redirectTo: `${window.location.origin}/auth/callback`,
19
+ },
20
+ });
21
+
22
+ if (error) {
23
+ setError(error.message);
24
+ setLoading(false);
25
+ }
26
+ }
27
+
28
+ return (
29
+ <div className="flex min-h-screen items-center justify-center bg-[var(--bg-base)]">
30
+ <div className="w-full max-w-sm space-y-6 rounded-lg border border-[var(--border-default)] bg-[#111113] p-8">
31
+ <div className="text-center space-y-2">
32
+ <div className="inline-flex items-center justify-center h-10 w-10 rounded-lg bg-[var(--bg-elevated)] border border-[var(--border-subtle)]">
33
+ <svg width="20" height="20" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" className="text-[var(--accent-text)]">
34
+ <path d="M8 2C5.8 2 4 3.8 4 6c0 1.2.5 2.2 1.3 3L6 10.5v1a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-1L10.7 9A4 4 0 0012 6c0-2.2-1.8-4-4-4z" />
35
+ <path d="M6.5 13h3M7 14h2" />
36
+ </svg>
37
+ </div>
38
+ <h1 className="text-[15px] font-semibold text-[var(--text-primary)]">PAI Dashboard</h1>
39
+ <p className="text-[13px] text-[var(--text-tertiary)]">Sign in to your personal assistant</p>
40
+ </div>
41
+
42
+ {error && (
43
+ <div className="rounded-md bg-red-500/10 border border-red-500/15 px-4 py-3 text-[13px] text-red-400">
44
+ {error}
45
+ </div>
46
+ )}
47
+
48
+ <button
49
+ onClick={signInWithGoogle}
50
+ disabled={loading}
51
+ className="flex w-full items-center justify-center gap-3 rounded-md bg-white px-4 py-2.5 text-[13px] font-medium text-zinc-900 transition-colors hover:bg-zinc-200 disabled:opacity-50 disabled:cursor-not-allowed"
52
+ >
53
+ <svg width="18" height="18" viewBox="0 0 18 18" fill="none">
54
+ <path d="M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z" fill="#4285F4"/>
55
+ <path d="M9 18c2.43 0 4.467-.806 5.956-2.18l-2.908-2.26c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332A8.997 8.997 0 009 18z" fill="#34A853"/>
56
+ <path d="M3.964 10.71A5.41 5.41 0 013.682 9c0-.593.102-1.17.282-1.71V4.958H.957A8.997 8.997 0 000 9c0 1.452.348 2.827.957 4.042l3.007-2.332z" fill="#FBBC05"/>
57
+ <path d="M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 00.957 4.958L3.964 7.29C4.672 5.163 6.656 3.58 9 3.58z" fill="#EA4335"/>
58
+ </svg>
59
+ {loading ? "Signing in..." : "Continue with Google"}
60
+ </button>
61
+ </div>
62
+ </div>
63
+ );
64
+ }
@@ -0,0 +1,33 @@
1
+ "use client";
2
+
3
+ import { createClient } from "@/lib/supabase-browser";
4
+ import { ShieldIcon } from "@/components/icons";
5
+
6
+ export default function NotAuthorizedPage() {
7
+ async function handleSignOut() {
8
+ const supabase = createClient();
9
+ await supabase.auth.signOut();
10
+ window.location.href = "/login";
11
+ }
12
+
13
+ return (
14
+ <div className="flex min-h-screen items-center justify-center bg-[var(--bg-base)]">
15
+ <div className="w-full max-w-sm space-y-6 rounded-lg border border-[var(--border-default)] bg-[#111113] p-8 text-center">
16
+ <div className="inline-flex items-center justify-center h-10 w-10 rounded-lg bg-red-500/10 border border-red-500/15">
17
+ <ShieldIcon size={20} className="text-red-400" />
18
+ </div>
19
+ <h1 className="text-[15px] font-semibold text-[var(--text-primary)]">Access Denied</h1>
20
+ <p className="text-[13px] text-[var(--text-tertiary)]">
21
+ Your account hasn&apos;t been granted access to this app. Contact an
22
+ administrator to request access.
23
+ </p>
24
+ <button
25
+ onClick={handleSignOut}
26
+ className="w-full rounded-md border border-[var(--border-default)] bg-[var(--bg-elevated)] px-4 py-2 text-[13px] font-medium text-[var(--text-secondary)] transition-colors hover:bg-[var(--bg-hover)] hover:text-[var(--text-primary)]"
27
+ >
28
+ Sign out
29
+ </button>
30
+ </div>
31
+ </div>
32
+ );
33
+ }
@@ -0,0 +1,55 @@
1
+ "use client";
2
+
3
+ import { useEffect, useState } from "react";
4
+ import { RunHistoryTable } from "@/components/run-history-table";
5
+ import type { AgentRun } from "@/lib/types";
6
+
7
+ export default function RunsPage() {
8
+ const [runs, setRuns] = useState<AgentRun[]>([]);
9
+ const [loading, setLoading] = useState(true);
10
+
11
+ useEffect(() => {
12
+ fetch("/api/runs?limit=100")
13
+ .then((r) => r.json())
14
+ .then((data) => {
15
+ setRuns(data);
16
+ setLoading(false);
17
+ });
18
+ }, []);
19
+
20
+ return (
21
+ <div>
22
+ <div className="flex items-center justify-between mb-4">
23
+ <h1 className="text-[15px] font-semibold text-[var(--text-primary)]">Run History</h1>
24
+ <button
25
+ onClick={() => {
26
+ setLoading(true);
27
+ fetch("/api/runs?limit=100")
28
+ .then((r) => r.json())
29
+ .then((data) => {
30
+ setRuns(data);
31
+ setLoading(false);
32
+ });
33
+ }}
34
+ className="rounded-md px-2.5 py-1 text-[12px] text-[var(--text-tertiary)] hover:text-[var(--text-secondary)] hover:bg-[var(--bg-hover)] transition-colors"
35
+ >
36
+ Refresh
37
+ </button>
38
+ </div>
39
+ {loading ? (
40
+ <div className="space-y-1 animate-pulse">
41
+ {[...Array(6)].map((_, i) => (
42
+ <div key={i} className="flex items-center gap-3 px-3 py-2.5 rounded-md">
43
+ <div className="h-2 w-2 rounded-full bg-[var(--bg-elevated)]" />
44
+ <div className="h-3.5 w-28 rounded bg-[var(--bg-elevated)]" />
45
+ <div className="h-3 flex-1 rounded bg-[var(--bg-raised)]" />
46
+ <div className="h-3 w-16 rounded bg-[var(--bg-raised)]" />
47
+ </div>
48
+ ))}
49
+ </div>
50
+ ) : (
51
+ <RunHistoryTable runs={runs} />
52
+ )}
53
+ </div>
54
+ );
55
+ }
@@ -0,0 +1,110 @@
1
+ "use client";
2
+
3
+ import { useEffect, useState } from "react";
4
+ import { ScheduleForm } from "@/components/schedule-form";
5
+ import type { AgentMeta, AgentSchedule } from "@/lib/types";
6
+ import type { SkillInfo } from "@/lib/capabilities";
7
+
8
+ export default function SchedulesPage() {
9
+ const [schedules, setSchedules] = useState<AgentSchedule[]>([]);
10
+ const [agents, setAgents] = useState<AgentMeta[]>([]);
11
+ const [skills, setSkills] = useState<SkillInfo[]>([]);
12
+ const [isSubmitting, setIsSubmitting] = useState(false);
13
+ const [loading, setLoading] = useState(true);
14
+
15
+ const loadData = () => {
16
+ Promise.all([
17
+ fetch("/api/schedules").then((r) => r.json()),
18
+ fetch("/api/agents").then((r) => r.json()),
19
+ fetch("/api/skills").then((r) => r.json()),
20
+ ]).then(([sched, ag, sk]) => {
21
+ setSchedules(sched);
22
+ setAgents(ag);
23
+ setSkills(sk);
24
+ setLoading(false);
25
+ });
26
+ };
27
+
28
+ useEffect(() => { loadData(); }, []);
29
+
30
+ const handleCreate = async (data: { agent_slug: string; agent_name: string; prompt: string; cron: string; skill_slug?: string }) => {
31
+ setIsSubmitting(true);
32
+ await fetch("/api/schedules", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(data) });
33
+ setIsSubmitting(false);
34
+ loadData();
35
+ };
36
+
37
+ const handleToggle = async (id: string, enabled: boolean) => {
38
+ await fetch(`/api/schedules/${id}`, { method: "PATCH", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ enabled }) });
39
+ loadData();
40
+ };
41
+
42
+ const handleDelete = async (id: string) => {
43
+ await fetch(`/api/schedules/${id}`, { method: "DELETE" });
44
+ loadData();
45
+ };
46
+
47
+ const getSkillName = (slug: string | null) => {
48
+ if (!slug) return null;
49
+ return skills.find((s) => s.slug === slug)?.name || slug;
50
+ };
51
+
52
+ if (loading) {
53
+ return (
54
+ <div className="max-w-3xl space-y-6">
55
+ <h1 className="text-[15px] font-semibold text-[var(--text-primary)]">Schedules</h1>
56
+ <div className="space-y-2 animate-pulse">
57
+ {[...Array(4)].map((_, i) => (
58
+ <div key={i} className="h-10 rounded-md bg-[var(--bg-raised)]" />
59
+ ))}
60
+ </div>
61
+ </div>
62
+ );
63
+ }
64
+
65
+ return (
66
+ <div className="max-w-3xl space-y-6">
67
+ <h1 className="text-[15px] font-semibold text-[var(--text-primary)]">Schedules</h1>
68
+
69
+ <ScheduleForm agents={agents} skills={skills} onSubmit={handleCreate} isSubmitting={isSubmitting} />
70
+
71
+ <div className="border border-[var(--border-subtle)] rounded-lg divide-y divide-[var(--border-subtle)]">
72
+ {schedules.length === 0 ? (
73
+ <p className="text-[13px] text-[var(--text-tertiary)] py-8 text-center">No schedules yet</p>
74
+ ) : (
75
+ schedules.map((schedule) => (
76
+ <div key={schedule.id} className="flex items-center justify-between px-3 py-2.5">
77
+ <div className="min-w-0 flex-1">
78
+ <div className="flex items-center gap-2 flex-wrap">
79
+ <span className="text-[13px] font-medium text-[var(--text-primary)]">{schedule.agent_name}</span>
80
+ {schedule.skill_slug && (
81
+ <span className="rounded-md bg-[var(--accent-muted)] px-1.5 py-0.5 text-[11px] text-[var(--accent-text)]">
82
+ {getSkillName(schedule.skill_slug)}
83
+ </span>
84
+ )}
85
+ <code className="rounded-md bg-[var(--bg-elevated)] border border-[var(--border-subtle)] px-1.5 py-0.5 text-[11px] text-[var(--text-tertiary)]">
86
+ {schedule.cron}
87
+ </code>
88
+ <span className={`h-1.5 w-1.5 rounded-full ${schedule.enabled ? "bg-green-400" : "bg-[var(--text-muted)]"}`} />
89
+ </div>
90
+ {schedule.prompt && (
91
+ <p className="mt-0.5 text-[12px] text-[var(--text-tertiary)] truncate">{schedule.prompt}</p>
92
+ )}
93
+ </div>
94
+ <div className="flex items-center gap-1.5 ml-4 shrink-0">
95
+ <button onClick={() => handleToggle(schedule.id, !schedule.enabled)}
96
+ className="rounded-md px-2.5 py-1 text-[11px] text-[var(--text-tertiary)] hover:text-[var(--text-secondary)] hover:bg-[var(--bg-hover)] transition-colors">
97
+ {schedule.enabled ? "Pause" : "Resume"}
98
+ </button>
99
+ <button onClick={() => handleDelete(schedule.id)}
100
+ className="rounded-md px-2.5 py-1 text-[11px] text-red-400/60 hover:text-red-400 hover:bg-red-500/10 transition-colors">
101
+ Delete
102
+ </button>
103
+ </div>
104
+ </div>
105
+ ))
106
+ )}
107
+ </div>
108
+ </div>
109
+ );
110
+ }