@a5c-ai/krate 5.0.1-staging.69cb593ea → 5.0.1-staging.6be34ee2a

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.
@@ -1,433 +1,397 @@
1
1
  # Krate Web Console Specification
2
2
 
3
- > Derived from implementation. Source: `packages/krate/web/`
4
-
5
- ## 1. Page Inventory
6
-
7
- Framework: Next.js 16 + React 19 (App Router)
8
- Base path: `packages/krate/web/app/`
9
-
10
- ### Top-Level Pages
11
-
12
- | Route | File | Purpose |
13
- |-------|------|---------|
14
- | `/` | `page.jsx` | Landing/home page |
15
- | `/login` | `login/page.jsx` | Authentication login |
16
- | `/logout` | `logout/page.jsx` | Session logout |
17
- | `/orgs` | `orgs/page.jsx` | Organization list |
18
- | `/people` | `people/page.jsx` | People directory |
19
-
20
- ### Organization Dashboard
21
-
22
- | Route | File | Purpose |
23
- |-------|------|---------|
24
- | `/orgs/[org]` | `orgs/[org]/page.jsx` | Org dashboard overview |
25
- | `/orgs/[org]/profile` | `orgs/[org]/profile/page.jsx` | User profile |
26
- | `/orgs/[org]/people` | `orgs/[org]/people/page.jsx` | Org members |
27
- | `/orgs/[org]/inbox` | `orgs/[org]/inbox/page.jsx` | Notification inbox |
28
- | `/orgs/[org]/insights` | `orgs/[org]/insights/page.jsx` | Analytics and insights |
29
-
30
- ### Ship (Repositories & Code)
31
-
32
- | Route | File | Purpose |
33
- |-------|------|---------|
34
- | `/orgs/[org]/repositories` | `orgs/[org]/repositories/page.jsx` | Repository list |
35
- | `/orgs/[org]/repositories/[repo]/code` | `repositories/[repo]/code/page.jsx` | Code browser |
36
- | `/orgs/[org]/repositories/[repo]/pull-requests` | `repositories/[repo]/pull-requests/page.jsx` | PR list |
37
- | `/orgs/[org]/repositories/[repo]/issues` | `repositories/[repo]/issues/page.jsx` | Issue list |
38
- | `/orgs/[org]/repositories/[repo]/issues/[issue]` | `repositories/[repo]/issues/[issue]/page.jsx` | Issue detail |
39
- | `/orgs/[org]/repositories/[repo]/hooks` | `repositories/[repo]/hooks/page.jsx` | Webhook config |
40
- | `/orgs/[org]/repositories/[repo]/runs` | `repositories/[repo]/runs/page.jsx` | Repo agent runs |
41
- | `/orgs/[org]/repositories/[repo]/settings` | `repositories/[repo]/settings/page.jsx` | Repo settings |
42
- | `/orgs/[org]/runs` | `orgs/[org]/runs/page.jsx` | All runs overview |
43
-
44
- ### Manage (Access & Policy)
45
-
46
- | Route | File | Purpose |
47
- |-------|------|---------|
48
- | `/orgs/[org]/access/permissions` | `access/permissions/page.jsx` | Permission management |
49
- | `/orgs/[org]/access/ssh-keys` | `access/ssh-keys/page.jsx` | SSH key management |
50
- | `/orgs/[org]/access/branch-protection` | `access/branch-protection/page.jsx` | Branch rules |
51
- | `/orgs/[org]/settings` | `orgs/[org]/settings/page.jsx` | Org settings |
52
- | `/orgs/[org]/settings/secrets` | `settings/secrets/page.jsx` | Secret management |
53
- | `/orgs/[org]/hooks-events` | `orgs/[org]/hooks-events/page.jsx` | Webhook events |
54
- | `/orgs/[org]/deployments` | `orgs/[org]/deployments/page.jsx` | Deployments |
55
- | `/orgs/[org]/runners-ci` | `orgs/[org]/runners-ci/page.jsx` | Runner pools & CI |
56
-
57
- ### Agents
58
-
59
- | Route | File | Purpose |
60
- |-------|------|---------|
61
- | `/orgs/[org]/agents` | `agents/page.jsx` | Agent overview |
62
- | `/orgs/[org]/agents/stacks` | `agents/stacks/page.jsx` | Stack list |
63
- | `/orgs/[org]/agents/stacks/new` | `agents/stacks/new/page.jsx` | Create stack |
64
- | `/orgs/[org]/agents/stacks/[name]` | `agents/stacks/[name]/page.jsx` | Stack detail |
65
- | `/orgs/[org]/agents/runs` | `agents/runs/page.jsx` | Dispatch run list |
66
- | `/orgs/[org]/agents/runs/[runId]` | `agents/runs/[runId]/page.jsx` | Run detail |
67
- | `/orgs/[org]/agents/sessions` | `agents/sessions/page.jsx` | Session list |
68
- | `/orgs/[org]/agents/sessions/[sessionId]` | `agents/sessions/[sessionId]/page.jsx` | Session detail |
69
- | `/orgs/[org]/agents/rules` | `agents/rules/page.jsx` | Trigger rule list |
70
- | `/orgs/[org]/agents/rules/new` | `agents/rules/new/page.jsx` | Create trigger rule |
71
- | `/orgs/[org]/agents/rules/[ruleName]` | `agents/rules/[ruleName]/page.jsx` | Rule detail |
72
- | `/orgs/[org]/agents/approvals` | `agents/approvals/page.jsx` | Approval queue |
73
- | `/orgs/[org]/agents/workspaces` | `agents/workspaces/page.jsx` | Workspace list |
74
- | `/orgs/[org]/agents/workspaces/[workspaceId]` | `agents/workspaces/[workspaceId]/page.jsx` | Workspace detail |
75
- | `/orgs/[org]/agents/settings` | `agents/settings/page.jsx` | Agent settings |
76
- | `/orgs/[org]/agents/projects` | `agents/projects/page.jsx` | Project list |
77
- | `/orgs/[org]/agents/projects/[projectId]` | `agents/projects/[projectId]/page.jsx` | Project detail |
78
- | `/orgs/[org]/agents/projects/[projectId]/issues` | `projects/[projectId]/issues/page.jsx` | Project issues |
79
- | `/orgs/[org]/agents/projects/[projectId]/issues/[issue]` | `projects/[projectId]/issues/[issue]/page.jsx` | Project issue detail |
80
- | `/orgs/[org]/agents/memory` | `agents/memory/page.jsx` | Memory overview |
81
- | `/orgs/[org]/agents/memory/search` | `agents/memory/search/page.jsx` | Memory search |
82
- | `/orgs/[org]/agents/memory/ontology` | `agents/memory/ontology/page.jsx` | Ontology editor |
83
- | `/orgs/[org]/agents/memory/imports` | `agents/memory/imports/page.jsx` | Import list |
84
- | `/orgs/[org]/agents/memory/imports/[importId]` | `agents/memory/imports/[importId]/page.jsx` | Import detail |
85
-
86
- ### External
87
-
88
- | Route | File | Purpose |
89
- |-------|------|---------|
90
- | `/orgs/[org]/external` | `orgs/[org]/external/page.jsx` | External overview |
91
- | `/orgs/[org]/external/providers/new` | `external/providers/new/page.jsx` | Add provider |
92
- | `/orgs/[org]/external/sync` | `external/sync/page.jsx` | Sync dashboard |
93
- | `/orgs/[org]/external/conflicts` | `external/conflicts/page.jsx` | Conflict list |
94
-
95
- ### Observe & Tools
96
-
97
- | Route | File | Purpose |
98
- |-------|------|---------|
99
- | `/orgs/[org]/api-docs` | `orgs/[org]/api-docs/page.jsx` | API documentation |
100
- | `/orgs/[org]/controller-api` | `orgs/[org]/controller-api/page.jsx` | Controller API explorer |
101
- | `/orgs/[org]/advanced-plans` | `orgs/[org]/advanced-plans/page.jsx` | Advanced plans |
102
- | `/orgs/[org]/operations-install` | `orgs/[org]/operations-install/page.jsx` | Operations install guide |
103
-
104
- **Total: 57 pages**
3
+ > Exhaustive reference for the Krate web console.
4
+ > Source: `packages/krate/web/`
5
+ > Framework: Next.js 16 + React 19 (App Router)
105
6
 
106
7
  ---
107
8
 
108
- ## 2. Component Library
109
-
110
- Source: `packages/krate/web/app/components/`
111
-
112
- | Component | File | Purpose |
113
- |-----------|------|---------|
114
- | ActivityFeed | `activity-feed.jsx` | Real-time activity stream with time-grouped entries |
115
- | AgentSettingsForm | `agent-settings-form.jsx` | Agent configuration form (adapters, providers, gateway) |
116
- | ApiExplorer | `api-explorer.jsx` | Interactive API testing interface |
117
- | AppSettings | `app-settings.jsx` | Application-level settings panel |
118
- | ApprovalActions | `approval-actions.jsx` | Approve/deny action buttons for agent gates |
119
- | ApprovalModeToggle | `approval-mode-toggle.jsx` | Toggle between approval modes |
120
- | CodeEditor | `code-editor.jsx` | Syntax-highlighted code editor |
121
- | CommandPalette | `command-palette.jsx` | Global command palette (Cmd+K) with search |
122
- | DeploymentPipeline | `deployment-pipeline.jsx` | Visual pipeline progress display |
123
- | DispatchButton | `dispatch-button.jsx` | One-click agent dispatch trigger |
124
- | ExternalConflictResolver | `external-conflict-resolver.jsx` | Side-by-side conflict resolution UI |
125
- | ExternalProviderList | `external-provider-list.jsx` | Provider listing with status indicators |
126
- | ExternalProviderWizard | `external-provider-wizard.jsx` | Multi-step provider setup wizard |
127
- | ExternalSyncDashboard | `external-sync-dashboard.jsx` | Sync status overview with metrics |
128
- | GlobalSearch | `global-search.jsx` | Full-text search across all resources |
129
- | HealthMonitor | `health-monitor.jsx` | System health indicators and status |
130
- | IssueEditor | `issue-editor.jsx` | Rich issue create/edit form |
131
- | IssueList | `issue-list.jsx` | Filterable issue list view |
132
- | KanbanCard | `kanban-card.jsx` | Draggable card for kanban board |
133
- | KanbanColumn | `kanban-column.jsx` | Drop target column for kanban |
134
- | KanbanEnhanced | `kanban-enhanced.jsx` | Full kanban board with drag-drop |
135
- | KanbanFilters | `kanban-filters.jsx` | Filter bar for kanban views |
136
- | KanbanInteractive | `kanban-interactive.jsx` | Interactive kanban with real-time updates |
137
- | KeyboardShortcuts | `keyboard-shortcuts.jsx` | Keyboard shortcut overlay/help |
138
- | KrateLoading | `krate-loading.jsx` | Branded loading spinner |
139
- | LiveUpdates | `live-updates.jsx` | SSE-powered live data refresh |
140
- | MemoryImportReview | `memory-import-review.jsx` | Review and approve memory imports |
141
- | MemoryOntologyEditor | `memory-ontology-editor.jsx` | Visual ontology editor |
142
- | MemorySearchForm | `memory-search-form.jsx` | Graph/grep query builder |
143
- | NotificationBell | `notification-bell.jsx` | Bell icon with unread count badge |
144
- | PullRequestList | `pull-request-list.jsx` | PR list with status indicators |
145
- | RepoCodeBrowser | `repo-code-browser.jsx` | File tree + content viewer |
146
- | RepoRuns | `repo-runs.jsx` | Repository-scoped run list |
147
- | ResourceActions | `resource-actions.jsx` | Edit/delete/view action menu |
148
- | ResourceCrudActions | `resource-crud-actions.jsx` | Full CRUD operation buttons |
149
- | RuleActions | `rule-actions.jsx` | Trigger rule action buttons |
150
- | RunActions | `run-actions.jsx` | Dispatch run action buttons |
151
- | RunnerPoolManager | `runner-pool-manager.jsx` | Pool sizing and configuration |
152
- | SecretManager | `secret-manager.jsx` | Secret CRUD with masked values |
153
- | SessionCost | `session-cost.jsx` | Token/cost display for sessions |
154
- | SessionShell | `session-shell.jsx` | Terminal-style session viewer |
155
- | SessionTabs | `session-tabs.jsx` | Tabbed session detail view |
156
- | SettingsAdapters | `settings-adapters.jsx` | Adapter configuration panel |
157
- | SettingsGateway | `settings-gateway.jsx` | Gateway configuration panel |
158
- | SettingsProviders | `settings-providers.jsx` | Provider configuration panel |
159
- | StackActions | `stack-actions.jsx` | Stack management action buttons |
160
- | StackBuilder | `stack-builder.jsx` | Visual agent stack builder |
161
- | StackBuilderGraph | `stack-builder-graph.jsx` | Graph visualization for stack composition |
162
- | ThemeRuntime | `theme-runtime.jsx` | Dark/light theme toggle and persistence |
163
- | ToolInspector | `tool-inspector.jsx` | MCP tool inspection panel |
164
- | TriggerRuleForm | `trigger-rule-form.jsx` | Trigger rule creation/edit form |
165
- | UserProfile | `user-profile.jsx` | User profile display and edit |
166
- | WebhookManager | `webhook-manager.jsx` | Webhook subscription management |
167
- | WorkspaceAssociations | `workspace-associations.jsx` | Work item link management |
168
- | WorkspaceCodespace | `workspace-codespace.jsx` | Live codespace interface |
169
- | WorkspacePanel | `workspace-panel.jsx` | Workspace overview panel |
170
- | WorkspaceRunHistory | `workspace-run-history.jsx` | Historical runs for workspace |
171
-
172
- **Total: 56 components**
9
+ ## 1. Page Inventory (57 pages)
10
+
11
+ ### 1.1 Top-Level Pages
12
+
13
+ | # | Route | File | Data Source | Purpose | Interactive Elements |
14
+ |---|-------|------|-------------|---------|---------------------|
15
+ | 1 | `/` | `page.jsx` | None | Landing/home page | Login CTA, org selector |
16
+ | 2 | `/login` | `login/page.jsx` | `listEnabledAuthProviders()` | Authentication login | Provider buttons (GitHub, SSO) |
17
+ | 3 | `/logout` | `logout/page.jsx` | None | Session logout | Auto-redirect to /login |
18
+ | 4 | `/orgs` | `orgs/page.jsx` | `fetchControllerUiModel()` | Organization list | Org cards, create org button |
19
+ | 5 | `/people` | `people/page.jsx` | `fetchControllerUiModel()` | People directory | User search, team filter |
20
+
21
+ ### 1.2 Organization Dashboard (5 pages)
22
+
23
+ | # | Route | File | Data Source | Purpose | Interactive Elements |
24
+ |---|-------|------|-------------|---------|---------------------|
25
+ | 6 | `/orgs/[org]` | `orgs/[org]/page.jsx` | `uiModel.views.dashboard` | Org dashboard overview | Cards (repos, PRs, issues, runs), activity feed, quick actions |
26
+ | 7 | `/orgs/[org]/profile` | `orgs/[org]/profile/page.jsx` | `uiModel.identity` | User profile | Edit display name, email; linked identities |
27
+ | 8 | `/orgs/[org]/people` | `orgs/[org]/people/page.jsx` | `uiModel.identity.users` | Org members | Invite button, team assignment, role toggle |
28
+ | 9 | `/orgs/[org]/inbox` | `orgs/[org]/inbox/page.jsx` | `notifications.listNotifications()` | Notification inbox | Mark as read, filter by type, clear all |
29
+ | 10 | `/orgs/[org]/insights` | `orgs/[org]/insights/page.jsx` | `uiModel.metrics` | Analytics and insights | Time range selector, metric cards |
30
+
31
+ ### 1.3 Ship (Repositories & Code) 9 pages
32
+
33
+ | # | Route | File | Data Source | Purpose | Interactive Elements |
34
+ |---|-------|------|-------------|---------|---------------------|
35
+ | 11 | `/orgs/[org]/repositories` | `orgs/[org]/repositories/page.jsx` | `uiModel.views.dashboard.repositories` | Repository list | Create repo form, visibility filter, search |
36
+ | 12 | `/orgs/[org]/repositories/[repo]/code` | `repositories/[repo]/code/page.jsx` | `git-proxy` API | Code browser | File tree, branch selector, breadcrumb |
37
+ | 13 | `/orgs/[org]/repositories/[repo]/pull-requests` | `repositories/[repo]/pull-requests/page.jsx` | `uiModel resources PullRequest` | PR list | Status filter, create PR button |
38
+ | 14 | `/orgs/[org]/repositories/[repo]/issues` | `repositories/[repo]/issues/page.jsx` | `uiModel resources Issue` | Issue list | Label filter, assignee, new issue |
39
+ | 15 | `/orgs/[org]/repositories/[repo]/issues/[issue]` | `issues/[issue]/page.jsx` | Issue resource | Issue detail | Comment form, label editor, close/reopen |
40
+ | 16 | `/orgs/[org]/repositories/[repo]/hooks` | `repositories/[repo]/hooks/page.jsx` | `WebhookSubscription` | Webhook config | Add webhook form, delivery list, replay |
41
+ | 17 | `/orgs/[org]/repositories/[repo]/runs` | `repositories/[repo]/runs/page.jsx` | `AgentDispatchRun` filtered by repo | Repo agent runs | Run list, dispatch button, status filter |
42
+ | 18 | `/orgs/[org]/repositories/[repo]/settings` | `repositories/[repo]/settings/page.jsx` | Repository resource | Repo settings | Rename, visibility toggle, danger zone (delete) |
43
+ | 19 | `/orgs/[org]/runs` | `orgs/[org]/runs/page.jsx` | `uiModel.agents.runs` | All runs overview | Filter by stack, status, repository |
44
+
45
+ ### 1.4 Manage (Access & Policy) 8 pages
46
+
47
+ | # | Route | File | Data Source | Purpose | Interactive Elements |
48
+ |---|-------|------|-------------|---------|---------------------|
49
+ | 20 | `/orgs/[org]/access/permissions` | `access/permissions/page.jsx` | `uiModel.identity.permissions` | Permission management | Grant/revoke, subject selector, permission level |
50
+ | 21 | `/orgs/[org]/access/ssh-keys` | `access/ssh-keys/page.jsx` | `uiModel.identity.sshKeys` | SSH key management | Add key form, revoke button, scope filter |
51
+ | 22 | `/orgs/[org]/access/branch-protection` | `access/branch-protection/page.jsx` | `BranchProtection` resources | Branch rules | Ref pattern input, toggle required reviews |
52
+ | 23 | `/orgs/[org]/settings` | `orgs/[org]/settings/page.jsx` | Organization resource | Org settings | Display name, slug, namespace info, danger zone |
53
+ | 24 | `/orgs/[org]/settings/secrets` | `settings/secrets/page.jsx` | `/api/orgs/:org/secrets` | Secret management | Add secret form, delete, grant management |
54
+ | 25 | `/orgs/[org]/hooks-events` | `orgs/[org]/hooks-events/page.jsx` | `WebhookSubscription + Delivery` | Webhook events | Subscription list, delivery inspector, replay |
55
+ | 26 | `/orgs/[org]/deployments` | `orgs/[org]/deployments/page.jsx` | `uiModel.delivery` | Deployments | Application list, release history, health |
56
+ | 27 | `/orgs/[org]/runners-ci` | `orgs/[org]/runners-ci/page.jsx` | `RunnerPool + Pipeline + Job` | Runner pools & CI | Pool editor, pipeline list, job detail |
57
+
58
+ ### 1.5 Agents 24 pages
59
+
60
+ | # | Route | File | Data Source | Purpose | Interactive Elements |
61
+ |---|-------|------|-------------|---------|---------------------|
62
+ | 28 | `/orgs/[org]/agents` | `agents/page.jsx` | `uiModel.agents` | Agent overview | Stack count cards, active runs, pending approvals |
63
+ | 29 | `/orgs/[org]/agents/stacks` | `agents/stacks/page.jsx` | `uiModel.agents.stacks` | Stack list | Readiness indicators, create button |
64
+ | 30 | `/orgs/[org]/agents/stacks/new` | `agents/stacks/new/page.jsx` | `STACK_LAYERS, COMPOSITION_FACETS` | Create stack | Multi-step StackBuilder form |
65
+ | 31 | `/orgs/[org]/agents/stacks/[name]` | `agents/stacks/[name]/page.jsx` | AgentStack resource | Stack detail | Conditions list, capabilities graph, edit |
66
+ | 32 | `/orgs/[org]/agents/runs` | `agents/runs/page.jsx` | `uiModel.agents.runs` | Dispatch run list | Phase filter, repository filter, cost summary |
67
+ | 33 | `/orgs/[org]/agents/runs/[runId]` | `agents/runs/[runId]/page.jsx` | AgentDispatchRun + Attempt | Run detail | Attempt timeline, transcript, workspace link |
68
+ | 34 | `/orgs/[org]/agents/sessions` | `agents/sessions/page.jsx` | `uiModel.agents.sessions` | Session list | Active/completed filter, cost column |
69
+ | 35 | `/orgs/[org]/agents/sessions/[sessionId]` | `agents/sessions/[sessionId]/page.jsx` | AgentSession + Transcript | Session detail | SessionTabs: transcript, tools, cost, shell |
70
+ | 36 | `/orgs/[org]/agents/rules` | `agents/rules/page.jsx` | `uiModel.agents.rules` | Trigger rule list | Source type badges, enable/disable toggle |
71
+ | 37 | `/orgs/[org]/agents/rules/new` | `agents/rules/new/page.jsx` | Stack list for dropdown | Create trigger rule | TriggerRuleForm with source type selector |
72
+ | 38 | `/orgs/[org]/agents/rules/[ruleName]` | `agents/rules/[ruleName]/page.jsx` | AgentTriggerRule resource | Rule detail | Edit form, execution history |
73
+ | 39 | `/orgs/[org]/agents/approvals` | `agents/approvals/page.jsx` | `uiModel.agents.approvals` | Approval queue | Approve/Deny buttons, filter by action type |
74
+ | 40 | `/orgs/[org]/agents/workspaces` | `agents/workspaces/page.jsx` | `uiModel.agents.workspaces` | Workspace list | Phase badges, repository links |
75
+ | 41 | `/orgs/[org]/agents/workspaces/[workspaceId]` | `agents/workspaces/[workspaceId]/page.jsx` | KrateWorkspace resource | Workspace detail | Codespace launch, associations, run history |
76
+ | 42 | `/orgs/[org]/agents/settings` | `agents/settings/page.jsx` | Adapter + Provider + Gateway | Agent settings | Adapter config, provider forms, gateway URL |
77
+ | 43 | `/orgs/[org]/agents/projects` | `agents/projects/page.jsx` | `uiModel.agents.projects` | Project list | Create project, kanban toggle |
78
+ | 44 | `/orgs/[org]/agents/projects/[projectId]` | `agents/projects/[projectId]/page.jsx` | KrateProject resource | Project detail | Kanban board, issue list, settings |
79
+ | 45 | `/orgs/[org]/agents/projects/[projectId]/issues` | `projects/[projectId]/issues/page.jsx` | Issues filtered by project | Project issues | Filter, create issue |
80
+ | 46 | `/orgs/[org]/agents/projects/[projectId]/issues/[issue]` | `issues/[issue]/page.jsx` | Issue resource | Project issue detail | Comment, labels, assign |
81
+ | 47 | `/orgs/[org]/agents/memory` | `agents/memory/page.jsx` | `uiModel.agents.memoryRepositories` | Memory overview | Repository list, snapshot count |
82
+ | 48 | `/orgs/[org]/agents/memory/search` | `agents/memory/search/page.jsx` | Memory query API | Memory search | MemorySearchForm, results display |
83
+ | 49 | `/orgs/[org]/agents/memory/ontology` | `agents/memory/ontology/page.jsx` | AgentMemoryOntology | Ontology editor | MemoryOntologyEditor, node/edge kind editors |
84
+ | 50 | `/orgs/[org]/agents/memory/imports` | `agents/memory/imports/page.jsx` | `uiModel.agents.memoryImports` | Import list | Status badges, review button |
85
+ | 51 | `/orgs/[org]/agents/memory/imports/[importId]` | `agents/memory/imports/[importId]/page.jsx` | AgentRunMemoryImport | Import detail | MemoryImportReview, approve/reject |
86
+
87
+ ### 1.6 External — 4 pages
88
+
89
+ | # | Route | File | Data Source | Purpose | Interactive Elements |
90
+ |---|-------|------|-------------|---------|---------------------|
91
+ | 52 | `/orgs/[org]/external` | `orgs/[org]/external/page.jsx` | ExternalBackendProvider list | External overview | Provider cards, add button |
92
+ | 53 | `/orgs/[org]/external/providers/new` | `external/providers/new/page.jsx` | Provider type list | Add provider | ExternalProviderWizard (multi-step) |
93
+ | 54 | `/orgs/[org]/external/sync` | `external/sync/page.jsx` | ExternalSyncState | Sync dashboard | ExternalSyncDashboard, trigger sync |
94
+ | 55 | `/orgs/[org]/external/conflicts` | `external/conflicts/page.jsx` | ExternalSyncConflict list | Conflict list | ExternalConflictResolver, strategy selector |
95
+
96
+ ### 1.7 Observe & Tools — 4 pages
97
+
98
+ | # | Route | File | Data Source | Purpose | Interactive Elements |
99
+ |---|-------|------|-------------|---------|---------------------|
100
+ | 56 | `/orgs/[org]/api-docs` | `orgs/[org]/api-docs/page.jsx` | controllerEndpoints | API documentation | Endpoint list, try-it panel |
101
+ | 57 | `/orgs/[org]/controller-api` | `orgs/[org]/controller-api/page.jsx` | Full snapshot | Controller API explorer | ApiExplorer with request/response |
102
+ | 58 | `/orgs/[org]/advanced-plans` | `orgs/[org]/advanced-plans/page.jsx` | Resource YAML | Advanced plans | YAML editor, apply button |
103
+ | 59 | `/orgs/[org]/operations-install` | `orgs/[org]/operations-install/page.jsx` | uiModel.operations | Operations install guide | Copy commands, step indicators |
173
104
 
174
105
  ---
175
106
 
176
- ## 3. Navigation Architecture
107
+ ## 2. Component Library (56 components)
108
+
109
+ ### 2.1 Agent Components
110
+
111
+ | # | Component | File | Props | State | API Calls | Key Behavior |
112
+ |---|-----------|------|-------|-------|-----------|--------------|
113
+ | 1 | ApprovalActions | `approval-actions.jsx` | `{ approval, org, onDecide }` | — | POST approvals/:name/decide | Approve/Deny buttons with reason modal |
114
+ | 2 | ApprovalModeToggle | `approval-mode-toggle.jsx` | `{ stack, onToggle }` | `useState(mode)` | — | Toggle between yolo/prompt/deny |
115
+ | 3 | DispatchButton | `dispatch-button.jsx` | `{ stack, repo, org, onDispatch }` | `useState(loading)` | POST agents/dispatch | One-click dispatch with loading state |
116
+ | 4 | RunActions | `run-actions.jsx` | `{ run, org }` | — | — | Retry, cancel, view workspace links |
117
+ | 5 | RuleActions | `rule-actions.jsx` | `{ rule, org }` | — | — | Edit, disable, delete trigger rule |
118
+ | 6 | StackActions | `stack-actions.jsx` | `{ stack, org }` | — | — | Edit, dispatch, delete stack |
119
+ | 7 | StackBuilder | `stack-builder.jsx` | `{ org, layers, onSave }` | Multi-step form state | POST resources | Multi-step agent stack creation wizard |
120
+ | 8 | StackBuilderGraph | `stack-builder-graph.jsx` | `{ stack, capabilities }` | — | — | Visual capability graph |
121
+ | 9 | SessionCost | `session-cost.jsx` | `{ session, transcript }` | — | — | Token count and cost display |
122
+ | 10 | SessionShell | `session-shell.jsx` | `{ sessionId, org }` | SSE subscription | SSE stream | Terminal-style live session viewer |
123
+ | 11 | SessionTabs | `session-tabs.jsx` | `{ session, transcript }` | `useState(activeTab)` | — | Tabbed: Transcript, Tools, Cost, Shell |
124
+ | 12 | ToolInspector | `tool-inspector.jsx` | `{ mcpServers, toolProfiles }` | — | — | MCP tool listing with status |
125
+ | 13 | TriggerRuleForm | `trigger-rule-form.jsx` | `{ org, stacks, onSave }` | Form state | POST resources | Source type selector, cron/webhook/comment/label fields |
126
+
127
+ ### 2.2 Memory Components
128
+
129
+ | # | Component | File | Props | Key Behavior |
130
+ |---|-----------|------|-------|--------------|
131
+ | 14 | MemorySearchForm | `memory-search-form.jsx` | `{ org, onSearch }` | Mode selector (graph/grep/both), query input, kind filter, depth |
132
+ | 15 | MemoryOntologyEditor | `memory-ontology-editor.jsx` | `{ ontology, org }` | Node kind editor, edge kind editor, vocabulary |
133
+ | 16 | MemoryImportReview | `memory-import-review.jsx` | `{ importResource, org }` | Diff view, approve/reject buttons |
134
+
135
+ ### 2.3 External Components
136
+
137
+ | # | Component | File | Props | Key Behavior |
138
+ |---|-----------|------|-------|--------------|
139
+ | 17 | ExternalConflictResolver | `external-conflict-resolver.jsx` | `{ conflict, org }` | Side-by-side diff, strategy buttons |
140
+ | 18 | ExternalProviderList | `external-provider-list.jsx` | `{ providers }` | Cards with status indicators |
141
+ | 19 | ExternalProviderWizard | `external-provider-wizard.jsx` | `{ org, onComplete }` | Multi-step: type → credentials → scope → confirm |
142
+ | 20 | ExternalSyncDashboard | `external-sync-dashboard.jsx` | `{ syncStates, org }` | Status overview with metrics |
143
+
144
+ ### 2.4 Kanban Components
145
+
146
+ | # | Component | File | Props | Key Behavior |
147
+ |---|-----------|------|-------|--------------|
148
+ | 21 | KanbanCard | `kanban-card.jsx` | `{ item, onDragStart }` | Draggable card with issue/PR preview |
149
+ | 22 | KanbanColumn | `kanban-column.jsx` | `{ status, items, onDrop }` | Drop target column |
150
+ | 23 | KanbanEnhanced | `kanban-enhanced.jsx` | `{ project, issues }` | Full board with columns |
151
+ | 24 | KanbanFilters | `kanban-filters.jsx` | `{ onFilter }` | Label, assignee, repository filters |
152
+ | 25 | KanbanInteractive | `kanban-interactive.jsx` | `{ project, org }` | SSE-powered live kanban with drag-drop |
153
+
154
+ ### 2.5 Workspace Components
155
+
156
+ | # | Component | File | Props | Key Behavior |
157
+ |---|-----------|------|-------|--------------|
158
+ | 26 | WorkspacePanel | `workspace-panel.jsx` | `{ workspace }` | Overview: phase, repo, branch, PVC |
159
+ | 27 | WorkspaceCodespace | `workspace-codespace.jsx` | `{ workspace, org }` | Launch/stop codespace, URL display |
160
+ | 28 | WorkspaceAssociations | `workspace-associations.jsx` | `{ workspace }` | Add/remove run, user, session links |
161
+ | 29 | WorkspaceRunHistory | `workspace-run-history.jsx` | `{ workspace, runs }` | Active runs, historical runs table |
162
+
163
+ ### 2.6 Repository Components
164
+
165
+ | # | Component | File | Props | Key Behavior |
166
+ |---|-----------|------|-------|--------------|
167
+ | 30 | RepoCodeBrowser | `repo-code-browser.jsx` | `{ org, repo, branch }` | File tree + content viewer via git-proxy |
168
+ | 31 | RepoRuns | `repo-runs.jsx` | `{ runs, org }` | Filtered run list for a repository |
169
+ | 32 | PullRequestList | `pull-request-list.jsx` | `{ pullRequests, org }` | PR list with status indicators |
170
+ | 33 | IssueList | `issue-list.jsx` | `{ issues, org }` | Filterable issue list |
171
+ | 34 | IssueEditor | `issue-editor.jsx` | `{ issue, org }` | Rich issue create/edit form |
172
+ | 35 | WebhookManager | `webhook-manager.jsx` | `{ subscriptions, deliveries }` | CRUD webhooks, delivery inspector |
173
+
174
+ ### 2.7 Global Components
175
+
176
+ | # | Component | File | Props | Key Behavior |
177
+ |---|-----------|------|-------|--------------|
178
+ | 36 | CommandPalette | `command-palette.jsx` | `{ org }` | Cmd+K / Ctrl+K; full-text search, quick nav |
179
+ | 37 | KeyboardShortcuts | `keyboard-shortcuts.jsx` | — | ? overlay; nav shortcuts, action shortcuts |
180
+ | 38 | GlobalSearch | `global-search.jsx` | `{ org }` | Full-text search across all resources |
181
+ | 39 | NotificationBell | `notification-bell.jsx` | `{ org }` | Badge with unread count, dropdown panel |
182
+ | 40 | ActivityFeed | `activity-feed.jsx` | `{ org, events }` | Time-grouped activity entries |
183
+ | 41 | HealthMonitor | `health-monitor.jsx` | `{ connection }` | System component status indicators |
184
+ | 42 | LiveUpdates | `live-updates.jsx` | `{ org, onEvent }` | SSE connection, auto-reconnect |
185
+ | 43 | ThemeRuntime | `theme-runtime.jsx` | — | Dark/light toggle, system preference detection |
186
+ | 44 | KrateLoading | `krate-loading.jsx` | `{ label? }` | Branded loading spinner |
187
+
188
+ ### 2.8 Settings Components
189
+
190
+ | # | Component | File | Props | Key Behavior |
191
+ |---|-----------|------|-------|--------------|
192
+ | 45 | AgentSettingsForm | `agent-settings-form.jsx` | `{ org }` | Combined adapters + providers + gateway form |
193
+ | 46 | SettingsAdapters | `settings-adapters.jsx` | `{ adapters, org }` | Adapter CRUD |
194
+ | 47 | SettingsProviders | `settings-providers.jsx` | `{ providers, org }` | Provider CRUD |
195
+ | 48 | SettingsGateway | `settings-gateway.jsx` | `{ gateway, org }` | Gateway URL + feature flags |
196
+ | 49 | AppSettings | `app-settings.jsx` | `{ org }` | App-level settings |
197
+ | 50 | SecretManager | `secret-manager.jsx` | `{ org }` | Secret CRUD with masked values |
198
+ | 51 | RunnerPoolManager | `runner-pool-manager.jsx` | `{ pools, org }` | Pool sizing with warm/max sliders |
199
+ | 52 | UserProfile | `user-profile.jsx` | `{ user, org }` | Profile display and edit |
200
+
201
+ ### 2.9 Utility Components
202
+
203
+ | # | Component | File | Props | Key Behavior |
204
+ |---|-----------|------|-------|--------------|
205
+ | 53 | ResourceActions | `resource-actions.jsx` | `{ resource, org }` | View/Edit/Delete menu |
206
+ | 54 | ResourceCrudActions | `resource-crud-actions.jsx` | `{ kind, org }` | Full CRUD buttons |
207
+ | 55 | CodeEditor | `code-editor.jsx` | `{ value, language, onChange }` | Syntax-highlighted editor |
208
+ | 56 | ApiExplorer | `api-explorer.jsx` | `{ endpoints }` | Interactive API testing |
209
+ | 57 | DeploymentPipeline | `deployment-pipeline.jsx` | `{ applications }` | Visual pipeline progress |
177
210
 
178
- ### Navigation Groups
179
-
180
- | Group | Icon | Pages |
181
- |-------|------|-------|
182
- | **Ship** | Code | Repositories, Pull Requests, Issues, Code |
183
- | **Manage** | Settings | Permissions, SSH Keys, Branch Protection, Settings, Deployments, Runners |
184
- | **Agents** | Bot | Stacks, Runs, Sessions, Rules, Approvals, Workspaces, Projects, Memory |
185
- | **Observe** | Eye | Hooks & Events, Insights, Inbox, Health |
186
- | **External** | Link | Providers, Sync, Conflicts |
187
-
188
- ### Command Palette (Cmd+K)
189
-
190
- Source: `command-palette.jsx`
191
-
192
- - Global keyboard shortcut: `Cmd+K` (macOS) / `Ctrl+K` (Windows/Linux)
193
- - Full-text search across all resources
194
- - Quick navigation to any page
195
- - Recent items history
211
+ ---
196
212
 
197
- ### Keyboard Shortcuts
213
+ ## 3. Data Flow Architecture
198
214
 
199
- Source: `keyboard-shortcuts.jsx`
215
+ ### 3.1 Fetch Pipeline
200
216
 
201
- - Navigation shortcuts for major sections
202
- - Action shortcuts (new, edit, delete)
203
- - Modal shortcuts (close, confirm)
204
- - `?` to show shortcut overlay
217
+ ```
218
+ Page Component (Server Component)
219
+ loadKrateUi() / fetchControllerUiModel({ baseUrl, org })
220
+ HTTP GET /api/controller?org=<org>
221
+ → createKrateHttpHandler matches route
222
+ → createControllerUiModel(snapshot, { organization })
223
+ → Stale-while-revalidate cache (30s TTL)
224
+ → Pass data as props to Client Components
225
+ ```
205
226
 
206
- ---
227
+ ### 3.2 Controller UI Model Shape
207
228
 
208
- ## 4. UI Patterns
229
+ `createControllerUiModel()` produces:
209
230
 
210
- ### PageFrame Layout
231
+ ```javascript
232
+ {
233
+ product: 'Krate',
234
+ status: 'ready' | 'degraded',
235
+ namespace: 'krate-org-acme',
236
+ platformNamespace: 'krate-system',
237
+ org: { name, slug, displayName, namespace },
238
+ orgs: [...],
239
+ generatedAt: ISO timestamp,
240
+ controller: { mode, endpoints, architecture, storage, connection, apiService, commands },
241
+ metrics: { components, resources, events, users, teams, repositories, pullRequests, issues, projects, pipelines, ... },
242
+ components: [...runtimeComponents],
243
+ resources: [...KRATE_RESOURCES mapped with items],
244
+ events: [...last 8 K8s events],
245
+ delivery: { applications, runtime, capabilityCatalog },
246
+ policyEngine: { mode, health, profiles, templates, bindings, violations },
247
+ agents: { stacks, runs, rules, sessions, workspaces, approvals, adapters, providers, projects, gateway, transcripts, memoryRepositories, memorySnapshots, memoryImports },
248
+ identity: { counts, providers, users, teams, invites, mappings, permissions, sshKeys, reconciliation },
249
+ validation: [...healthChecks],
250
+ views: { dashboard, pullRequestReview, failingRun, runnerPoolEditor, webhookInspector, triageView }
251
+ }
252
+ ```
211
253
 
212
- Standard page layout with:
213
- - Sidebar navigation (collapsible)
214
- - Header with org selector, search, notification bell
215
- - Main content area
216
- - Breadcrumb navigation
254
+ ### 3.3 API Proxy Routes (Web)
217
255
 
218
- ### EmptyState
256
+ | Route | Target | Method |
257
+ |-------|--------|--------|
258
+ | `/api/orgs` | Krate API | GET |
259
+ | `/api/orgs/[org]/repositories` | Resource CRUD | GET/POST |
260
+ | `/api/auth/[provider]` | OAuth redirect | GET |
261
+ | `/api/auth/callback/[provider]` | OAuth callback | GET |
262
+ | `/api/auth/logout` | Session destruction | POST |
263
+ | `/api/auth/delegated` | Delegated identity | GET |
264
+ | `/api/atlas/search` | Atlas graph search | POST |
265
+ | `/api/git-proxy` | Gitea tree/blob proxy | POST |
266
+ | `/api/watch/[...resource]` | SSE watch endpoint | GET |
219
267
 
220
- Used when a resource list has no items:
221
- - Illustration/icon
222
- - Title and description
223
- - Primary CTA button (e.g., "Create Stack")
224
- - Secondary action link
268
+ ---
225
269
 
226
- ### StatusPill
270
+ ## 4. Navigation Architecture
227
271
 
228
- Tone-based status indicators:
272
+ ### 4.1 Navigation Groups
229
273
 
230
- | Tone | Color | Used For |
231
- |------|-------|----------|
232
- | success | Green | Running, Healthy, Approved |
233
- | warning | Amber | Pending, Degraded |
234
- | error | Red | Failed, Denied, Conflict |
235
- | info | Blue | In Progress, Syncing |
236
- | neutral | Gray | Unknown, Inactive |
274
+ | Group | Icon | Pages | Section |
275
+ |-------|------|-------|---------|
276
+ | **Ship** | Code | Repositories, PRs, Issues, Code, Runs | Primary development |
277
+ | **Manage** | Settings | Permissions, SSH Keys, Branch Protection, Settings, Secrets, Deployments, Runners | Administration |
278
+ | **Agents** | Bot | Stacks, Runs, Sessions, Rules, Approvals, Workspaces, Projects, Memory | AI orchestration |
279
+ | **Observe** | Eye | Hooks & Events, Insights, Inbox, Health, API Docs | Monitoring |
280
+ | **External** | Link | Providers, Sync, Conflicts | Integration |
237
281
 
238
- ### InlineCreateForm
282
+ ### 4.2 Command Palette
239
283
 
240
- Quick resource creation without navigating away:
241
- - Collapsible form below list header
242
- - Minimal required fields
243
- - Auto-focus on first field
244
- - Cancel/Create buttons
284
+ - Trigger: `Cmd+K` (macOS) / `Ctrl+K` (Windows/Linux)
285
+ - Features: full-text search across resources, quick page navigation, recent items
286
+ - Implementation: `command-palette.jsx`
245
287
 
246
- ### ResourceActions
288
+ ### 4.3 Keyboard Shortcuts
247
289
 
248
- Contextual action menu per resource:
249
- - View (navigate to detail)
250
- - Edit (inline or modal)
251
- - Delete (with confirmation dialog)
252
- - Custom actions per resource kind
290
+ - `?` Show shortcut overlay
291
+ - `j/k` Navigate items in lists
292
+ - `n` New (context-dependent)
293
+ - `Escape` Close modal/palette
253
294
 
254
295
  ---
255
296
 
256
- ## 5. Data Flow
297
+ ## 5. Real-Time Updates
257
298
 
258
- ### Fetch Pipeline
299
+ ### 5.1 LiveUpdates Component
259
300
 
301
+ ```jsx
302
+ // Connection lifecycle:
303
+ // 1. Connect to /api/orgs/:org/agents/events/stream
304
+ // 2. Receive {"type":"connected"} — mark as connected
305
+ // 3. Process {"type":"resource-change", kind, name, operation}
306
+ // 4. On disconnect: auto-reconnect with backoff
307
+ // 5. Receive {"type":"heartbeat"} every 30s — keepalive
260
308
  ```
261
- Page Component
262
- → loadKrateUi() / fetchControllerUiModel()
263
- → HTTP GET /api/controller?org=<org>
264
- → createControllerUiModel(snapshot, { organization })
265
- → Stale-while-revalidate cache (30s)
266
- → Render with data
267
- ```
268
-
269
- Source: `packages/krate/core/src/controller-client.js`, `controller-ui.js`
270
-
271
- ### Controller UI Model
272
-
273
- `createControllerUiModel(snapshot, options)` produces:
274
- - `orgs` — Organization list
275
- - `repositories` — Repository list with stats
276
- - `pullRequests` — Open PRs with review status
277
- - `pipelines` — Recent pipeline runs
278
- - `agents` — Stacks, runs, sessions
279
- - `memory` — Memory repositories and queries
280
-
281
- ### API Proxy Routes
282
309
 
283
- Source: `packages/krate/web/app/api/`
310
+ ### 5.2 SSE-Powered Components
284
311
 
285
- | Route | Target |
286
- |-------|--------|
287
- | `/api/orgs` | Krate API `/api/orgs` |
288
- | `/api/orgs/[org]/repositories` | Resource CRUD |
289
- | `/api/auth/[provider]` | OAuth redirect |
290
- | `/api/auth/callback/[provider]` | OAuth callback |
291
- | `/api/auth/logout` | Session destruction |
292
- | `/api/auth/delegated` | Delegated identity |
293
- | `/api/atlas/search` | Atlas graph search |
294
- | `/api/git-proxy` | Gitea tree/blob proxy |
295
- | `/api/watch/[...resource]` | SSE watch endpoint |
312
+ | Component | SSE Usage |
313
+ |-----------|-----------|
314
+ | KanbanInteractive | Live card movement on issue/PR status changes |
315
+ | NotificationBell | Real-time unread count updates |
316
+ | ActivityFeed | New events prepended |
317
+ | SessionShell | Live transcript streaming |
318
+ | HealthMonitor | Connection status indicator |
296
319
 
297
320
  ---
298
321
 
299
- ## 6. Dark Mode
322
+ ## 6. Theme System
300
323
 
301
- Source: `theme-runtime.jsx`
324
+ ### 6.1 Implementation
302
325
 
303
- ### Implementation
304
-
305
- - CSS custom properties (variables) for all colors
326
+ - CSS custom properties for all colors
306
327
  - Two theme sets: `light` and `dark`
307
328
  - Applied via `data-theme` attribute on `<html>`
329
+ - ThemeRuntime component manages state
308
330
 
309
- ### Persistence
310
-
311
- - User preference stored in `localStorage` key `krate-theme`
312
- - Initial value: system preference via `prefers-color-scheme` media query
313
- - Toggle available in header/settings
314
-
315
- ### System Preference Detection
331
+ ### 6.2 Persistence
316
332
 
317
333
  ```javascript
318
- window.matchMedia('(prefers-color-scheme: dark)').matches
334
+ // Read: localStorage.getItem('krate-theme')
335
+ // Write: localStorage.setItem('krate-theme', theme)
336
+ // Default: window.matchMedia('(prefers-color-scheme: dark)').matches
337
+ // Auto-update: mediaQuery.addEventListener('change', handler)
319
338
  ```
320
339
 
321
- Listens for changes and auto-updates when no explicit preference set.
322
-
323
340
  ---
324
341
 
325
- ## 7. Authentication Flow
326
-
327
- ### Login Flow
328
-
329
- ```
330
- User → /login page
331
- → Select provider (GitHub / SSO)
332
- → Redirect to /api/auth/[provider]
333
- → OAuth authorization URL
334
- → Provider callback → /api/auth/callback/[provider]
335
- → Exchange code for profile
336
- → Create session cookie (HMAC-signed)
337
- → Redirect to /orgs/[org]
338
- ```
342
+ ## 7. Form Patterns
339
343
 
340
- ### Session Validation
344
+ ### 7.1 Multi-Step Forms
341
345
 
342
- - Cookie `krate_session` parsed on each request
343
- - HMAC signature verified with `KRATE_SESSION_SECRET`
344
- - Invalid/expired sessions redirect to `/login`
346
+ | Form | Steps | Source |
347
+ |------|-------|--------|
348
+ | StackBuilder | Model Provider → Transport → Tools → Skills → Review | `stack-builder.jsx` |
349
+ | ExternalProviderWizard | Type → Credentials → Scope → Confirm | `external-provider-wizard.jsx` |
350
+ | TriggerRuleForm | Source Type → Config → Stack Selection → Review | `trigger-rule-form.jsx` |
345
351
 
346
- ### Protected Routes
352
+ ### 7.2 Error Handling
347
353
 
348
- All mutating operations check session validity. Read operations are generally unprotected for API simplicity (auth enforced at Krate API level).
354
+ - Inline field errors below inputs
355
+ - Toast notifications for operation failures (auto-dismiss)
356
+ - Error boundary component (`error.jsx`) for unhandled errors
357
+ - Form-level validation before submission
349
358
 
350
- ### Logout
359
+ ### 7.3 Loading States
351
360
 
352
- ```
353
- User /logout
354
- /api/auth/logout
355
- Clear cookie (Max-Age=0)
356
- → Redirect to /login
357
- ```
361
+ - `KrateLoading` spinner for full-page loads
362
+ - Disabled buttons with spinner during submission
363
+ - Skeleton loading for list views
364
+ - Optimistic updates on create/edit (revert on failure)
358
365
 
359
366
  ---
360
367
 
361
- ## 8. Real-time Updates
362
-
363
- ### SSE LiveUpdates Component
364
-
365
- Source: `live-updates.jsx`
366
-
367
- - Connects to `/api/orgs/:org/agents/events/stream`
368
- - Receives JSON events via Server-Sent Events
369
- - Auto-reconnects on disconnection
370
- - Processes event types: `connected`, `heartbeat`, `resource-change`
371
-
372
- ### Notification Bell
373
-
374
- Source: `notification-bell.jsx`
375
-
376
- - Badge showing unread notification count
377
- - Dropdown panel with recent notifications
378
- - Mark as read on click
379
- - Links to relevant resource pages
380
-
381
- ### Activity Feed
368
+ ## 8. Authentication Flow (Web)
382
369
 
383
- Source: `activity-feed.jsx`
370
+ ### 8.1 Login Flow
384
371
 
385
- - Time-grouped activity entries
386
- - Resource change events (create, update, delete)
387
- - Agent dispatch and completion events
388
- - Filterable by resource kind
389
-
390
- ### Health Monitor
372
+ ```
373
+ /login Click provider /api/auth/[provider]
374
+ 302 to OAuth provider
375
+ User authorizes
376
+ → /api/auth/callback/[provider]?code=...
377
+ Exchange code → Create session cookie
378
+ → 302 to /orgs/[org]
379
+ ```
391
380
 
392
- Source: `health-monitor.jsx`
381
+ ### 8.2 Session Validation
393
382
 
394
- - System component status indicators
395
- - MCP server health checks
396
- - Kubernetes connection status
397
- - SSE connection health
383
+ - Cookie `krate_session` sent on every request
384
+ - Web API routes verify via `parseSessionCookie()`
385
+ - Invalid sessions: redirect to `/login`
386
+ - Logout: clear cookie with `Max-Age=0`, redirect to `/login`
398
387
 
399
388
  ---
400
389
 
401
- ## 9. Form Patterns
402
-
403
- ### Validation
404
-
405
- - Required field indicators (asterisk)
406
- - Format validation (email, URL, name patterns)
407
- - Custom validators per resource kind
408
- - Cross-field validation (e.g., date ranges)
409
-
410
- ### Error Display
411
-
412
- - Inline field errors below inputs
413
- - Toast notifications for operation failures
414
- - Error boundary component for unhandled errors (`error.jsx`)
415
-
416
- ### Success Feedback
417
-
418
- - Auto-dismiss success toast (3-5 seconds)
419
- - Optimistic updates on create/edit
420
- - Resource list auto-refresh after mutation
421
-
422
- ### Loading States
423
-
424
- - `KrateLoading` spinner component
425
- - Skeleton loading for lists
426
- - Disabled buttons during submission
427
- - Progress indicators for long operations
390
+ ## 9. Error Page
428
391
 
429
- ### Multi-Step Forms
392
+ Source: `packages/krate/web/app/error.jsx`
430
393
 
431
- - Stack builder (`stack-builder.jsx`) — multi-step agent configuration
432
- - Provider wizard (`external-provider-wizard.jsx`) guided provider setup
433
- - Trigger rule form (`trigger-rule-form.jsx`) conditional rule builder
394
+ - React Error Boundary component
395
+ - Displays error message and stack trace (dev mode)
396
+ - "Try Again" button to reset error state
397
+ - Falls back to minimal UI on catastrophic failure