From ab116f846567cd37595eaeac47dd19fc20f94123 Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 11 Jun 2026 13:31:56 +1000 Subject: [PATCH 1/7] =?UTF-8?q?refactor:=20rename=20@crema/arcadia-client?= =?UTF-8?q?=20=E2=86=92=20@crema/arcadia-core-client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disambiguates the Phoenix/auth client lib from lib-arcadia-agents-client. Dir lib-arcadia-client → lib-arcadia-core-client; alias updated in tsconfig paths, vite config, app.css @source, imports, CI and docs. Co-Authored-By: Claude Opus 4.8 (1M context) --- CLAUDE.md | 2 +- README.md | 4 ++-- app/app.css | 2 +- app/components/settings/llm-configurations-panel.tsx | 2 +- app/components/users/user-detail-sheet.tsx | 2 +- app/lib/admin-tools.ts | 2 +- app/lib/arcadia-knowledge.ts | 2 +- app/lib/arcadia/announcements.ts | 2 +- app/lib/arcadia/api-keys.ts | 2 +- app/lib/arcadia/audit-logs.ts | 2 +- app/lib/arcadia/buckets.ts | 2 +- app/lib/arcadia/digital-objects.ts | 2 +- app/lib/arcadia/health.ts | 2 +- app/lib/arcadia/integrations.ts | 2 +- app/lib/arcadia/invitations.ts | 2 +- app/lib/arcadia/llm-configs.ts | 2 +- app/lib/arcadia/llm-proxy.ts | 2 +- app/lib/arcadia/memberships.ts | 2 +- app/lib/arcadia/monitoring.ts | 2 +- app/lib/arcadia/networking.ts | 2 +- app/lib/arcadia/organizations.ts | 2 +- app/lib/arcadia/profiles.ts | 2 +- app/lib/arcadia/roles.ts | 2 +- app/lib/arcadia/scheduled-tasks.ts | 2 +- app/lib/arcadia/secrets.ts | 2 +- app/lib/arcadia/sso.ts | 2 +- app/lib/arcadia/status-page.ts | 2 +- app/lib/arcadia/storage-configs.ts | 2 +- app/lib/arcadia/tenants.ts | 2 +- app/lib/arcadia/user-stats.ts | 2 +- app/lib/arcadia/users.ts | 2 +- app/lib/arcadia/webhooks.ts | 2 +- app/lib/gateway.ts | 2 +- app/lib/llm-config-bootstrap.tsx | 2 +- app/lib/profile-bootstrap.tsx | 2 +- app/root.tsx | 2 +- app/routes/activity.tsx | 2 +- app/routes/ai.tsx | 2 +- app/routes/announcements.tsx | 2 +- app/routes/assistant.tsx | 2 +- app/routes/buckets.tsx | 2 +- app/routes/home.tsx | 2 +- app/routes/integrations.tsx | 2 +- app/routes/memberships.tsx | 2 +- app/routes/monitoring.tsx | 2 +- app/routes/networking.tsx | 2 +- app/routes/organizations.tsx | 2 +- app/routes/profile.tsx | 2 +- app/routes/scheduled-tasks.tsx | 2 +- app/routes/secrets.tsx | 2 +- app/routes/settings.tsx | 2 +- app/routes/sso.tsx | 2 +- app/routes/status-page.tsx | 2 +- app/routes/storage.tsx | 2 +- app/routes/tenants.tsx | 2 +- app/routes/users.tsx | 2 +- app/routes/webhooks.tsx | 2 +- tsconfig.json | 4 ++-- vite.config.ts | 4 ++-- 59 files changed, 62 insertions(+), 62 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 87d12bc..19ff989 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,7 +9,7 @@ This file is a quick map, not a duplication of upstream docs. - **Arcadia Admin** is the operator/admin UI for [arcadia-core](../reference/arcadia-app), a multi-tenant Phoenix backend. Surfaces tenant management, user/role admin, billing, audit logs, storage configs, scheduled tasks, feature flags, and platform monitoring on top of arcadia's `/api/v1` and `/admin/*` endpoints. - **Cloned from** [Vibespace](../vibespace) — the starter for webapps in this style. Vibespace and Skyrise are the upstream sources of truth for the shell and the theme; don't backport arcadia-admin-specific changes into Vibespace unless they're broadly applicable. -- **Backend reference** lives at `../reference/arcadia-app/`. Treat it as read-only documentation — it's the Phoenix umbrella app that owns the OpenAPI spec, controllers, schemas, and seed data. Spec is regenerated from a running arcadia at `http://localhost:4000/api/openapi` via `node ../lib-arcadia-client/scripts/sync-spec.mjs` (run from this directory). +- **Backend reference** lives at `../reference/arcadia-app/`. Treat it as read-only documentation — it's the Phoenix umbrella app that owns the OpenAPI spec, controllers, schemas, and seed data. Spec is regenerated from a running arcadia at `http://localhost:4000/api/openapi` via `node ../lib-arcadia-core-client/scripts/sync-spec.mjs` (run from this directory). - **Skyrise** (`lib-theme-skyrise`) is the canonical theme — premium AI-first glass, iridescent body, vivid text, Apple-spring motion. Theme tweaks belong upstream in Vibespace + Skyrise, not here. - The brand string lives in **one place**: `app/lib/identity.ts` (`useBrand()` / `getBrand()`). Don't hardcode "Arcadia Admin" in components, page titles, or copy. diff --git a/README.md b/README.md index e8986a3..f413da9 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ To use it for real: `app/components/layout/app-shell.tsx` — left rail + appbar + avatar dropdown. Brand identity in `app/lib/identity.ts` (`name: "Arcadia Admin"`, icon: `Shield`). The shell is **template code, not a lib** — fork it freely as admin features are added. ### Arcadia client + auth UI -- [`@crema/arcadia-client`](../lib-arcadia-client) — typed HTTP client (generic + openapi-fetch-backed `client.typed`), Phoenix Channels realtime, error normalization. Mounted at the root via ``. +- [`@crema/arcadia-core-client`](../lib-arcadia-core-client) — typed HTTP client (generic + openapi-fetch-backed `client.typed`), Phoenix Channels realtime, error normalization. Mounted at the root via ``. - [`@crema/arcadia-auth-ui`](../lib-arcadia-auth-ui) — login / signup / password reset / 2FA forms, themed via Skyrise tokens. The `/login` route renders ``. ### Skyrise theme @@ -51,7 +51,7 @@ your-workspace/ arcadia-admin/ ← this repo vibespace/ ← starter that this was cloned from reference/arcadia-app/ ← Phoenix backend (read-only reference) - lib-arcadia-client/ + lib-arcadia-core-client/ lib-arcadia-auth-ui/ lib-action-bus/ lib-aifirst-ui/ diff --git a/app/app.css b/app/app.css index 6dfa9da..b264497 100644 --- a/app/app.css +++ b/app/app.css @@ -15,7 +15,7 @@ @source "../../lib-aifirst-ui/src"; @source "../../lib-llm-ui/src"; @source "../../lib-action-bus/src"; -@source "../../lib-arcadia-client/src"; +@source "../../lib-arcadia-core-client/src"; @source "../../lib-arcadia-auth-ui/src"; @source "../../lib-table-ui/src"; @source "../../lib-search-ui/src"; diff --git a/app/components/settings/llm-configurations-panel.tsx b/app/components/settings/llm-configurations-panel.tsx index 23e6554..cb1f72a 100644 --- a/app/components/settings/llm-configurations-panel.tsx +++ b/app/components/settings/llm-configurations-panel.tsx @@ -9,7 +9,7 @@ import { useCallback, useEffect, useMemo, useState } from "react" import { Pencil, Plus, Sparkles, Star, Trash2, Upload } from "lucide-react" -import { useArcadiaClient } from "@crema/arcadia-client" +import { useArcadiaClient } from "@crema/arcadia-core-client" import { loadSettings as loadActiveSettings, saveSettings as saveActiveSettings, diff --git a/app/components/users/user-detail-sheet.tsx b/app/components/users/user-detail-sheet.tsx index ccd326c..fd18118 100644 --- a/app/components/users/user-detail-sheet.tsx +++ b/app/components/users/user-detail-sheet.tsx @@ -15,7 +15,7 @@ import { X, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { AlertBanner, ConfirmDialog } from "@crema/feedback-ui" import { Badge } from "~/components/ui/badge" diff --git a/app/lib/admin-tools.ts b/app/lib/admin-tools.ts index 98f87bf..1dc9ab0 100644 --- a/app/lib/admin-tools.ts +++ b/app/lib/admin-tools.ts @@ -5,7 +5,7 @@ // Each tool is a named function with documented args. The LLM never sees // raw HTTP — only the menu below. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" import { createToolRuntime, type ToolDef, diff --git a/app/lib/arcadia-knowledge.ts b/app/lib/arcadia-knowledge.ts index e193cb7..b0070f4 100644 --- a/app/lib/arcadia-knowledge.ts +++ b/app/lib/arcadia-knowledge.ts @@ -31,7 +31,7 @@ Things to keep in mind when assisting: - Writes are auditable. Suggest the user double-check tenant slug and impact before suspend/deactivate. Deactivate is harsher than suspend — only use when clearly intended. - The operator can impersonate tenant users for debugging (POST /api/v1/admin/impersonate/:user_id) — surface this when they ask "why can't user X log in". - Quotas / rate cards / billing config errors usually surface as 402/403 from /api/v1 endpoints — diagnose by checking the tenant's billing-config and api-metering quotas. -- The reference Phoenix app lives at \`reference/arcadia-app/\` in the workspace; its OpenAPI spec is at /api/openapi (sync via \`node ../lib-arcadia-client/scripts/sync-spec.mjs\`). +- The reference Phoenix app lives at \`reference/arcadia-app/\` in the workspace; its OpenAPI spec is at /api/openapi (sync via \`node ../lib-arcadia-core-client/scripts/sync-spec.mjs\`). - Search admin (arcadia-search) is a separate service. Manage tenants/corpora at \`/search\`. Use \`list_search_corpora\` if you don't know what's indexed; \`rebuild_search_corpus\` after uploads or when results look stale; \`search_kb\` / \`read_chunk\` to query. When the user asks something that maps to a tool, call it. When they ask about a concept, explain it from this primer in plain language. Write tools (suspend_tenant, activate_tenant) prompt the operator with an inline confirm card before they actually run — you do not need to ask in prose first; just call the tool and the user will see the confirmation UI. If the user denies a write, do not retry it; ask what they'd like to do differently. diff --git a/app/lib/arcadia/announcements.ts b/app/lib/arcadia/announcements.ts index 8761220..9e43555 100644 --- a/app/lib/arcadia/announcements.ts +++ b/app/lib/arcadia/announcements.ts @@ -1,7 +1,7 @@ // Platform announcements helpers. // Backend: /api/v1/admin/announcements (admin CRUD). -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type AnnouncementType = | "info" diff --git a/app/lib/arcadia/api-keys.ts b/app/lib/arcadia/api-keys.ts index 05be977..e4cccab 100644 --- a/app/lib/arcadia/api-keys.ts +++ b/app/lib/arcadia/api-keys.ts @@ -4,7 +4,7 @@ // once — list/show endpoints only return the prefix. Callers must surface // the value to the user immediately on create. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export interface ApiKey { id: string diff --git a/app/lib/arcadia/audit-logs.ts b/app/lib/arcadia/audit-logs.ts index 51915a1..213fe3b 100644 --- a/app/lib/arcadia/audit-logs.ts +++ b/app/lib/arcadia/audit-logs.ts @@ -1,7 +1,7 @@ // Audit log + observability helpers. // All endpoints are read-only; the backend writes audit events itself. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type AuditSeverity = "info" | "warning" | "error" | "critical" | string diff --git a/app/lib/arcadia/buckets.ts b/app/lib/arcadia/buckets.ts index f6bf877..c9e4268 100644 --- a/app/lib/arcadia/buckets.ts +++ b/app/lib/arcadia/buckets.ts @@ -2,7 +2,7 @@ // Backend: /api/v1/platform/buckets/*. All operations require a // storage_config_id pointing at a credential row in /api/v1/storage_configs. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export interface Bucket { name: string diff --git a/app/lib/arcadia/digital-objects.ts b/app/lib/arcadia/digital-objects.ts index 014fc51..a97bb63 100644 --- a/app/lib/arcadia/digital-objects.ts +++ b/app/lib/arcadia/digital-objects.ts @@ -2,7 +2,7 @@ // used by the avatar uploader. The full digital-objects API is much // larger; add endpoints here as we wire more features. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export interface DigitalObject { id: string diff --git a/app/lib/arcadia/health.ts b/app/lib/arcadia/health.ts index 307b6de..9dc39a6 100644 --- a/app/lib/arcadia/health.ts +++ b/app/lib/arcadia/health.ts @@ -4,7 +4,7 @@ // independently; the overall endpoint aggregates and returns 503 if any // subsystem is not "ok". See arcadia-app commit f427892. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type HealthSubsystem = "api" | "db" | "workers" | "storage" diff --git a/app/lib/arcadia/integrations.ts b/app/lib/arcadia/integrations.ts index 6385b5b..97a9a48 100644 --- a/app/lib/arcadia/integrations.ts +++ b/app/lib/arcadia/integrations.ts @@ -4,7 +4,7 @@ // arcadia-console's tenant surface); this file just exposes operator-idiomatic // names so the page reads naturally. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" import { createIntegrationsApi, type CredentialInput, diff --git a/app/lib/arcadia/invitations.ts b/app/lib/arcadia/invitations.ts index 8aa3823..b1c61a4 100644 --- a/app/lib/arcadia/invitations.ts +++ b/app/lib/arcadia/invitations.ts @@ -1,7 +1,7 @@ // Arcadia invitations API helpers. // Backed by /api/v1/invitations. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export interface InvitationRole { id: string diff --git a/app/lib/arcadia/llm-configs.ts b/app/lib/arcadia/llm-configs.ts index ac51d1c..bf10a31 100644 --- a/app/lib/arcadia/llm-configs.ts +++ b/app/lib/arcadia/llm-configs.ts @@ -8,7 +8,7 @@ // `tenant_id: null` configurations are platform-defaults visible to // every tenant. Names are unique within (tenant, name). -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type LlmProvider = "openai" | "anthropic" | "deepseek" | "qwen" | "lmstudio" diff --git a/app/lib/arcadia/llm-proxy.ts b/app/lib/arcadia/llm-proxy.ts index f202c2f..e79baba 100644 --- a/app/lib/arcadia/llm-proxy.ts +++ b/app/lib/arcadia/llm-proxy.ts @@ -7,7 +7,7 @@ // the proxy round-trips end-to-end (auth → secret resolution → upstream // dispatch → response shape). -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type LLMProxyProvider = | "openai" diff --git a/app/lib/arcadia/memberships.ts b/app/lib/arcadia/memberships.ts index 6fd43d9..d86b697 100644 --- a/app/lib/arcadia/memberships.ts +++ b/app/lib/arcadia/memberships.ts @@ -1,7 +1,7 @@ // Tenant memberships — the M:N glue between users and tenants. // Backend: /api/v1/admin/memberships (admin) + /api/v1/me/tenants (self). -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type MembershipStatus = "active" | "suspended" | "deactivated" | string diff --git a/app/lib/arcadia/monitoring.ts b/app/lib/arcadia/monitoring.ts index d33f252..f608493 100644 --- a/app/lib/arcadia/monitoring.ts +++ b/app/lib/arcadia/monitoring.ts @@ -2,7 +2,7 @@ // Wraps /api/v1/admin/monitoring/* + /api/v1/platform/* + a few observability // endpoints used by the monitoring dashboard. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" // --- Rate limits --------------------------------------------------------- diff --git a/app/lib/arcadia/networking.ts b/app/lib/arcadia/networking.ts index 4fc4ba6..832eb22 100644 --- a/app/lib/arcadia/networking.ts +++ b/app/lib/arcadia/networking.ts @@ -1,7 +1,7 @@ // Networking helpers: firewalls, VPCs, domains + DNS records, floating IPs. // Backend: /api/v1/platform/{firewalls,vpcs,domains,floating_ips,...}. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" const BASE = "/api/v1/platform" diff --git a/app/lib/arcadia/organizations.ts b/app/lib/arcadia/organizations.ts index d33449f..74c4f97 100644 --- a/app/lib/arcadia/organizations.ts +++ b/app/lib/arcadia/organizations.ts @@ -5,7 +5,7 @@ // `OrganizationContext` plug, so the same per-org routes used by end-users // are used here to mutate any org in the tenant. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type OrgStatus = "active" | "frozen" | "pending_deletion" | string export type OnOwnerRemoval = diff --git a/app/lib/arcadia/profiles.ts b/app/lib/arcadia/profiles.ts index 2aac4d9..cd1e035 100644 --- a/app/lib/arcadia/profiles.ts +++ b/app/lib/arcadia/profiles.ts @@ -3,7 +3,7 @@ // profile fields. The "profile" here is the per-tenant profile row, not // the auth account. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export interface Profile { id: string diff --git a/app/lib/arcadia/roles.ts b/app/lib/arcadia/roles.ts index a2e55be..d58ab9d 100644 --- a/app/lib/arcadia/roles.ts +++ b/app/lib/arcadia/roles.ts @@ -1,7 +1,7 @@ // Arcadia roles API helpers. // Backed by /api/v1/roles (resources route, except :new and :edit). -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export interface Role { id: string diff --git a/app/lib/arcadia/scheduled-tasks.ts b/app/lib/arcadia/scheduled-tasks.ts index debd9d4..cad797d 100644 --- a/app/lib/arcadia/scheduled-tasks.ts +++ b/app/lib/arcadia/scheduled-tasks.ts @@ -1,7 +1,7 @@ // Scheduled tasks (cron) helpers. // Backend: /api/v1/admin/scheduled-tasks (CRUD + runs/enable/disable/trigger). -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type ScheduledTaskAction = "webhook" | "event" diff --git a/app/lib/arcadia/secrets.ts b/app/lib/arcadia/secrets.ts index 469fdcb..d2fd4cb 100644 --- a/app/lib/arcadia/secrets.ts +++ b/app/lib/arcadia/secrets.ts @@ -5,7 +5,7 @@ // exposed by these endpoints. Tenant-side resolution (returning the value) // goes through a separate runtime endpoint that's not used by the admin UI. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type SecretCategory = | "api_key" diff --git a/app/lib/arcadia/sso.ts b/app/lib/arcadia/sso.ts index f4a3f9e..7c75785 100644 --- a/app/lib/arcadia/sso.ts +++ b/app/lib/arcadia/sso.ts @@ -2,7 +2,7 @@ // Backend: /api/v1/sso/identity-providers (tenant CRUD) + /sessions. // Note: certificates are large and write-only. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export interface IdentityProvider { id: string diff --git a/app/lib/arcadia/status-page.ts b/app/lib/arcadia/status-page.ts index c43a982..b932937 100644 --- a/app/lib/arcadia/status-page.ts +++ b/app/lib/arcadia/status-page.ts @@ -1,7 +1,7 @@ // Status page helpers — components, incidents, subscribers. // Backend: /api/v1/admin/status-page/* (admin CRUD). -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type ComponentStatus = | "operational" diff --git a/app/lib/arcadia/storage-configs.ts b/app/lib/arcadia/storage-configs.ts index 43dd9f7..1d82dd5 100644 --- a/app/lib/arcadia/storage-configs.ts +++ b/app/lib/arcadia/storage-configs.ts @@ -8,7 +8,7 @@ // generic `arcadia.GET` / `arcadia.POST` / etc. — same pattern as // `tenants.ts`. Switch to `arcadia.typed.*` when the spec gains coverage. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type StorageBackend = "s3" | "local" | "gcs" export type StorageStatus = "active" | "inactive" | "degraded" | "maintenance" diff --git a/app/lib/arcadia/tenants.ts b/app/lib/arcadia/tenants.ts index ccc602f..e825a80 100644 --- a/app/lib/arcadia/tenants.ts +++ b/app/lib/arcadia/tenants.ts @@ -6,7 +6,7 @@ // gains coverage, switch to `arcadia.typed.GET("/api/v1/admin/tenants", ...)` // and drop these manual types. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type TenantStatus = "active" | "suspended" | "deactivated" | string diff --git a/app/lib/arcadia/user-stats.ts b/app/lib/arcadia/user-stats.ts index d19f2a0..e29b45d 100644 --- a/app/lib/arcadia/user-stats.ts +++ b/app/lib/arcadia/user-stats.ts @@ -1,6 +1,6 @@ // Per-user usage + quota helpers. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export interface UserUsage { storage_used_bytes: number diff --git a/app/lib/arcadia/users.ts b/app/lib/arcadia/users.ts index f206af0..8bc17f4 100644 --- a/app/lib/arcadia/users.ts +++ b/app/lib/arcadia/users.ts @@ -4,7 +4,7 @@ // describe these operations as typed paths, so we hand-roll types and use // the generic verb methods on the client. Same pattern as tenants.ts. -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type UserStatus = "active" | "inactive" | "suspended" diff --git a/app/lib/arcadia/webhooks.ts b/app/lib/arcadia/webhooks.ts index c0f6c3d..23220a2 100644 --- a/app/lib/arcadia/webhooks.ts +++ b/app/lib/arcadia/webhooks.ts @@ -1,7 +1,7 @@ // Outbound webhook helpers. // Backend: /api/v1/webhooks (CRUD + pause/resume/regenerate-secret/deliveries/stats/test). -import type { ArcadiaClient } from "@crema/arcadia-client" +import type { ArcadiaClient } from "@crema/arcadia-core-client" export type WebhookStatus = "active" | "paused" | "disabled" export type WebhookRetryStrategy = "linear" | "exponential" diff --git a/app/lib/gateway.ts b/app/lib/gateway.ts index 471d934..4919ccc 100644 --- a/app/lib/gateway.ts +++ b/app/lib/gateway.ts @@ -7,7 +7,7 @@ // same 401 cleanup. The gateway's CORS already allows localhost + any // *.sky-ai.com origin, so the browser calls it directly. -import { createArcadiaClient, type ArcadiaClient } from "@crema/arcadia-client" +import { createArcadiaClient, type ArcadiaClient } from "@crema/arcadia-core-client" const GATEWAY_URL = import.meta.env.VITE_LLM_GATEWAY_URL ?? "http://localhost:4015" diff --git a/app/lib/llm-config-bootstrap.tsx b/app/lib/llm-config-bootstrap.tsx index 07d8126..2542d4e 100644 --- a/app/lib/llm-config-bootstrap.tsx +++ b/app/lib/llm-config-bootstrap.tsx @@ -11,7 +11,7 @@ // panel remains the place to switch between configs. import { useEffect } from "react" -import { useArcadiaClient } from "@crema/arcadia-client" +import { useArcadiaClient } from "@crema/arcadia-core-client" import { loadSettings, saveSettings, diff --git a/app/lib/profile-bootstrap.tsx b/app/lib/profile-bootstrap.tsx index 6d1a342..c489d7d 100644 --- a/app/lib/profile-bootstrap.tsx +++ b/app/lib/profile-bootstrap.tsx @@ -3,7 +3,7 @@ // immediately, without waiting for the user to navigate to /profile. import { useEffect } from "react" -import { useArcadiaClient } from "@crema/arcadia-client" +import { useArcadiaClient } from "@crema/arcadia-core-client" import { fetchDigitalObjectAsBlobUrl } from "~/lib/arcadia/digital-objects" import { getProfile, pickAvatarUrl } from "~/lib/arcadia/profiles" diff --git a/app/root.tsx b/app/root.tsx index 33eff63..809e294 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -12,7 +12,7 @@ import "./app.css" import { ToastProvider, Toaster } from "@crema/notification-ui" import { CommandBusProvider } from "@crema/action-bus" -import { ArcadiaProvider } from "@crema/arcadia-client" +import { ArcadiaProvider } from "@crema/arcadia-core-client" import { LlmConfigBootstrap } from "~/lib/llm-config-bootstrap" import { ProfileBootstrap } from "~/lib/profile-bootstrap" // CREMA:PROVIDERS-IMPORTS diff --git a/app/routes/activity.tsx b/app/routes/activity.tsx index e2234c8..761ca40 100644 --- a/app/routes/activity.tsx +++ b/app/routes/activity.tsx @@ -1,7 +1,7 @@ import { useCallback, useEffect, useMemo, useState } from "react" import { Activity, Eye, RefreshCw } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, BadgeCell, diff --git a/app/routes/ai.tsx b/app/routes/ai.tsx index 5c68152..b8bedf6 100644 --- a/app/routes/ai.tsx +++ b/app/routes/ai.tsx @@ -67,7 +67,7 @@ import { import { addLibraryItem } from "~/lib/library" import { Avatar, AvatarFallback } from "~/components/ui/avatar" import { pageTitle } from "~/lib/page-meta" -import { useArcadiaClient } from "@crema/arcadia-client" +import { useArcadiaClient } from "@crema/arcadia-core-client" import type { Message as LLMMessage, ToolCall } from "@crema/llm-ui" // Shape of a single hit returned by the `search_docs` tool. Defined here // rather than imported from the lib because the tool wrapper in diff --git a/app/routes/announcements.tsx b/app/routes/announcements.tsx index b626a96..407fd0a 100644 --- a/app/routes/announcements.tsx +++ b/app/routes/announcements.tsx @@ -7,7 +7,7 @@ import { Trash2, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, BadgeCell, diff --git a/app/routes/assistant.tsx b/app/routes/assistant.tsx index 05c6510..11ff8b1 100644 --- a/app/routes/assistant.tsx +++ b/app/routes/assistant.tsx @@ -98,7 +98,7 @@ import { runLLMToolCalls, } from "~/lib/admin-tools" import { ARCADIA_KNOWLEDGE } from "~/lib/arcadia-knowledge" -import { useArcadiaClient } from "@crema/arcadia-client" +import { useArcadiaClient } from "@crema/arcadia-core-client" import { ConfirmCard } from "~/components/assistant/confirm-card" import type { ToolCall } from "@crema/llm-ui" diff --git a/app/routes/buckets.tsx b/app/routes/buckets.tsx index cfe4ff2..da2fb64 100644 --- a/app/routes/buckets.tsx +++ b/app/routes/buckets.tsx @@ -17,7 +17,7 @@ import { Trash2, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, DataTable, diff --git a/app/routes/home.tsx b/app/routes/home.tsx index 3d144aa..69fac8c 100644 --- a/app/routes/home.tsx +++ b/app/routes/home.tsx @@ -11,7 +11,7 @@ import { Users as UsersIcon, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { AlertBanner } from "@crema/feedback-ui" import { AppShell } from "~/components/layout/app-shell" diff --git a/app/routes/integrations.tsx b/app/routes/integrations.tsx index d1bc374..034836d 100644 --- a/app/routes/integrations.tsx +++ b/app/routes/integrations.tsx @@ -14,7 +14,7 @@ import { Plus, Trash2, } from "lucide-react" -import { ArcadiaError } from "@crema/arcadia-client" +import { ArcadiaError } from "@crema/arcadia-core-client" import { AppShell } from "~/components/layout/app-shell" import { Badge } from "~/components/ui/badge" diff --git a/app/routes/memberships.tsx b/app/routes/memberships.tsx index 414aa5d..834b395 100644 --- a/app/routes/memberships.tsx +++ b/app/routes/memberships.tsx @@ -9,7 +9,7 @@ import { Trash2, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, BadgeCell, diff --git a/app/routes/monitoring.tsx b/app/routes/monitoring.tsx index 43bf544..6b7a0a1 100644 --- a/app/routes/monitoring.tsx +++ b/app/routes/monitoring.tsx @@ -14,7 +14,7 @@ import { Zap, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { AlertBanner } from "@crema/feedback-ui" import { BarChart, diff --git a/app/routes/networking.tsx b/app/routes/networking.tsx index 5b85014..7623737 100644 --- a/app/routes/networking.tsx +++ b/app/routes/networking.tsx @@ -10,7 +10,7 @@ import { Wifi, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { AlertBanner, ConfirmDialog, EmptyState, LoadingOverlay } from "@crema/feedback-ui" import { AppShell } from "~/components/layout/app-shell" diff --git a/app/routes/organizations.tsx b/app/routes/organizations.tsx index 19b1b1f..ed5489f 100644 --- a/app/routes/organizations.tsx +++ b/app/routes/organizations.tsx @@ -11,7 +11,7 @@ import { Users as UsersIcon, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, BadgeCell, diff --git a/app/routes/profile.tsx b/app/routes/profile.tsx index 441e6b6..1a7655f 100644 --- a/app/routes/profile.tsx +++ b/app/routes/profile.tsx @@ -1,7 +1,7 @@ import { useCallback, useEffect, useState } from "react" import { Check, RefreshCw, Trash2 } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { AlertBanner } from "@crema/feedback-ui" import { AppShell } from "~/components/layout/app-shell" diff --git a/app/routes/scheduled-tasks.tsx b/app/routes/scheduled-tasks.tsx index 83a335d..d198264 100644 --- a/app/routes/scheduled-tasks.tsx +++ b/app/routes/scheduled-tasks.tsx @@ -12,7 +12,7 @@ import { Zap, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, BadgeCell, diff --git a/app/routes/secrets.tsx b/app/routes/secrets.tsx index e6aff59..98eec0c 100644 --- a/app/routes/secrets.tsx +++ b/app/routes/secrets.tsx @@ -12,7 +12,7 @@ import { Trash2, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, BadgeCell, diff --git a/app/routes/settings.tsx b/app/routes/settings.tsx index 6eef29c..b1c4227 100644 --- a/app/routes/settings.tsx +++ b/app/routes/settings.tsx @@ -16,7 +16,7 @@ import { useSettings as useProviderSettings, type LLMProvidersSettings, } from "@crema/llm-providers-ui" -import { useArcadiaClient } from "@crema/arcadia-client" +import { useArcadiaClient } from "@crema/arcadia-core-client" import { probeProxy, type LLMProxyProvider } from "~/lib/arcadia/llm-proxy" import { LlmConfigurationsPanel } from "~/components/settings/llm-configurations-panel" diff --git a/app/routes/sso.tsx b/app/routes/sso.tsx index 1db2bd3..ec9b95b 100644 --- a/app/routes/sso.tsx +++ b/app/routes/sso.tsx @@ -9,7 +9,7 @@ import { X, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, BadgeCell, diff --git a/app/routes/status-page.tsx b/app/routes/status-page.tsx index 583a2df..9d4e511 100644 --- a/app/routes/status-page.tsx +++ b/app/routes/status-page.tsx @@ -8,7 +8,7 @@ import { Trash2, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { AlertBanner, ConfirmDialog, EmptyState, LoadingOverlay } from "@crema/feedback-ui" import { IncidentTimeline, diff --git a/app/routes/storage.tsx b/app/routes/storage.tsx index 7eae9bb..9a89137 100644 --- a/app/routes/storage.tsx +++ b/app/routes/storage.tsx @@ -12,7 +12,7 @@ import { Wrench, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, BadgeCell, diff --git a/app/routes/tenants.tsx b/app/routes/tenants.tsx index f203945..b93dfa6 100644 --- a/app/routes/tenants.tsx +++ b/app/routes/tenants.tsx @@ -1,7 +1,7 @@ import { useCallback, useEffect, useMemo, useState, type FormEvent } from "react" import { Pause, Play, Plus, RefreshCw } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, BadgeCell, diff --git a/app/routes/users.tsx b/app/routes/users.tsx index 6e54e99..cc6c5f2 100644 --- a/app/routes/users.tsx +++ b/app/routes/users.tsx @@ -14,7 +14,7 @@ import { X, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, BadgeCell, diff --git a/app/routes/webhooks.tsx b/app/routes/webhooks.tsx index 23ec4b8..961d872 100644 --- a/app/routes/webhooks.tsx +++ b/app/routes/webhooks.tsx @@ -15,7 +15,7 @@ import { Webhook as WebhookIcon, } from "lucide-react" -import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-client" +import { ArcadiaError, useArcadiaClient } from "@crema/arcadia-core-client" import { ActionsCell, BadgeCell, diff --git a/tsconfig.json b/tsconfig.json index c563df5..96aeef1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,8 +26,8 @@ "@crema/llm-ui/*": ["../lib-llm-ui/src/*"], "@crema/action-bus": ["../lib-action-bus/src/index.tsx"], "@crema/action-bus/*": ["../lib-action-bus/src/*"], - "@crema/arcadia-client": ["../lib-arcadia-client/src/index.tsx"], - "@crema/arcadia-client/*": ["../lib-arcadia-client/src/*"], + "@crema/arcadia-core-client": ["../lib-arcadia-core-client/src/index.tsx"], + "@crema/arcadia-core-client/*": ["../lib-arcadia-core-client/src/*"], "@crema/integration-registry-client": ["../lib-integration-registry-client/src/index.tsx"], "@crema/integration-registry-client/*": ["../lib-integration-registry-client/src/*"], "@crema/arcadia-auth-ui": ["../lib-arcadia-auth-ui/src/index.tsx"], diff --git a/vite.config.ts b/vite.config.ts index 49fff80..2983ba3 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -60,7 +60,7 @@ const searchUiSrc = fileURLToPath( new URL("../lib-search-ui/src", import.meta.url), ) const arcadiaClientSrc = fileURLToPath( - new URL("../lib-arcadia-client/src", import.meta.url), + new URL("../lib-arcadia-core-client/src", import.meta.url), ) const integrationRegistryClientSrc = fileURLToPath( new URL("../lib-integration-registry-client/src", import.meta.url), @@ -175,7 +175,7 @@ export default defineConfig({ { find: "@crema/auth-ui", replacement: `${authUiSrc}/index.tsx` }, { find: "@crema/table-ui", replacement: `${tableUiSrc}/index.tsx` }, { find: "@crema/search-ui", replacement: `${searchUiSrc}/index.tsx` }, - { find: "@crema/arcadia-client", replacement: `${arcadiaClientSrc}/index.tsx` }, + { find: "@crema/arcadia-core-client", replacement: `${arcadiaClientSrc}/index.tsx` }, { find: "@crema/integration-registry-client", replacement: `${integrationRegistryClientSrc}/index.tsx`, -- 2.48.1 From 938143f3f574a6cee583245ae81de702b2260fb4 Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 11 Jun 2026 13:40:25 +1000 Subject: [PATCH 2/7] =?UTF-8?q?refactor:=20rename=20service=20references?= =?UTF-8?q?=20arcadia-app=20=E2=86=92=20arcadia-core?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Phoenix auth/identity/tenancy backend repo is being renamed arcadia-app → arcadia-core (its primary OTP app is already arcadia_core). Updates prose, doc paths, and git.sky-ai.com repo URLs. Deliberately leaves the Rust crate arcadia-app-client and host arcadia-app.internal (handled separately), and the kept namespace (issuer/release "arcadia"). Co-Authored-By: Claude Opus 4.8 (1M context) --- CLAUDE.md | 4 ++-- README.md | 8 ++++---- app/lib/admin-tools.ts | 6 +++--- app/lib/arcadia-knowledge.ts | 4 ++-- app/lib/arcadia/health.ts | 2 +- app/lib/arcadia/llm-configs.ts | 2 +- app/lib/arcadia/llm-proxy.ts | 2 +- app/lib/gateway.ts | 6 +++--- app/routes/sso.tsx | 2 +- docs/LLM_PROXY_CONTRACT.md | 2 +- docs/RAG.md | 6 +++--- scripts/build-docs-index.mjs | 6 +++--- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 19ff989..9411b5d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,9 +7,9 @@ This file is a quick map, not a duplication of upstream docs. ## What Arcadia Admin is -- **Arcadia Admin** is the operator/admin UI for [arcadia-core](../reference/arcadia-app), a multi-tenant Phoenix backend. Surfaces tenant management, user/role admin, billing, audit logs, storage configs, scheduled tasks, feature flags, and platform monitoring on top of arcadia's `/api/v1` and `/admin/*` endpoints. +- **Arcadia Admin** is the operator/admin UI for [arcadia-core](../reference/arcadia-core), a multi-tenant Phoenix backend. Surfaces tenant management, user/role admin, billing, audit logs, storage configs, scheduled tasks, feature flags, and platform monitoring on top of arcadia's `/api/v1` and `/admin/*` endpoints. - **Cloned from** [Vibespace](../vibespace) — the starter for webapps in this style. Vibespace and Skyrise are the upstream sources of truth for the shell and the theme; don't backport arcadia-admin-specific changes into Vibespace unless they're broadly applicable. -- **Backend reference** lives at `../reference/arcadia-app/`. Treat it as read-only documentation — it's the Phoenix umbrella app that owns the OpenAPI spec, controllers, schemas, and seed data. Spec is regenerated from a running arcadia at `http://localhost:4000/api/openapi` via `node ../lib-arcadia-core-client/scripts/sync-spec.mjs` (run from this directory). +- **Backend reference** lives at `../reference/arcadia-core/`. Treat it as read-only documentation — it's the Phoenix umbrella app that owns the OpenAPI spec, controllers, schemas, and seed data. Spec is regenerated from a running arcadia at `http://localhost:4000/api/openapi` via `node ../lib-arcadia-core-client/scripts/sync-spec.mjs` (run from this directory). - **Skyrise** (`lib-theme-skyrise`) is the canonical theme — premium AI-first glass, iridescent body, vivid text, Apple-spring motion. Theme tweaks belong upstream in Vibespace + Skyrise, not here. - The brand string lives in **one place**: `app/lib/identity.ts` (`useBrand()` / `getBrand()`). Don't hardcode "Arcadia Admin" in components, page titles, or copy. diff --git a/README.md b/README.md index f413da9..c9272c9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Arcadia Admin -Admin webapp for [arcadia-core](../reference/arcadia-app) — the multi-tenant Phoenix backend. Built on the [Crema design system](https://git.sky-ai.com/CremaUIStudio) with the **Skyrise** theme and started from the [Vibespace](../vibespace) starter. +Admin webapp for [arcadia-core](../reference/arcadia-core) — the multi-tenant Phoenix backend. Built on the [Crema design system](https://git.sky-ai.com/CremaUIStudio) with the **Skyrise** theme and started from the [Vibespace](../vibespace) starter. Surfaces tenant management, user/role administration, billing, audit logs, storage configs, scheduled tasks, feature flags, and platform monitoring on top of arcadia's `/api/v1` and `/admin/*` endpoints. @@ -15,7 +15,7 @@ Open [http://localhost:5173](http://localhost:5173). The app talks to arcadia at To use it for real: -1. Have arcadia running locally (see `../reference/arcadia-app/DEV_SETUP.md`). +1. Have arcadia running locally (see `../reference/arcadia-core/DEV_SETUP.md`). 2. Visit `/login` and sign in with admin credentials. In dev seeds: `admin@example.com` / `AdminP@ssw0rd` (tenant `default`). ## Configuration @@ -50,7 +50,7 @@ Surface tints (`body[data-surface="snow|stone|sage|slate"]`) and dark mode (`htm your-workspace/ arcadia-admin/ ← this repo vibespace/ ← starter that this was cloned from - reference/arcadia-app/ ← Phoenix backend (read-only reference) + reference/arcadia-core/ ← Phoenix backend (read-only reference) lib-arcadia-core-client/ lib-arcadia-auth-ui/ lib-action-bus/ @@ -84,4 +84,4 @@ your-workspace/ - [`docs/AI_FIRST.md`](docs/AI_FIRST.md) — command-bus / DSL system tour - [`app/components/layout/THEME_CONTRACT.md`](app/components/layout/THEME_CONTRACT.md) — token contract every theme must satisfy - `CLAUDE.md` — orientation for an LLM working in this repo -- `../reference/arcadia-app/` — backend (DEV_SETUP, controllers, OpenAPI source-of-truth) +- `../reference/arcadia-core/` — backend (DEV_SETUP, controllers, OpenAPI source-of-truth) diff --git a/app/lib/admin-tools.ts b/app/lib/admin-tools.ts index 1dc9ab0..e8324ed 100644 --- a/app/lib/admin-tools.ts +++ b/app/lib/admin-tools.ts @@ -53,7 +53,7 @@ const docsClient = createRAGClient("/docs-index.json") // tooling and wire it through `.env.local`. // 3. operator session JWT — works only when arcadia-search shares the // JWT signing secret with the arcadia issuing the operator's session -// (i.e. local arcadia-app + local arcadia-search with matching keys). +// (i.e. local arcadia-core + local arcadia-search with matching keys). // 4. "dev" literal — only accepted by AUTH_MODE=dev backends. function readEnv(key: string): string | undefined { if (typeof import.meta === "undefined") return undefined @@ -667,7 +667,7 @@ const TOOLS: ToolDef[] = [ { name: "search_docs", description: - "Search the arcadia-app documentation (architecture, API surface, deploy/setup guides) for passages relevant to a question. Use this for conceptual or procedural questions where the live API tools won't help — e.g. 'how does multi-tenant isolation work', 'how do I deploy to production', 'what is the modular monolith pattern'. Returns up to `limit` ranked passages with title, sourcePath, and excerpt. Cite results by sourcePath in your reply.", + "Search the arcadia-core documentation (architecture, API surface, deploy/setup guides) for passages relevant to a question. Use this for conceptual or procedural questions where the live API tools won't help — e.g. 'how does multi-tenant isolation work', 'how do I deploy to production', 'what is the modular monolith pattern'. Returns up to `limit` ranked passages with title, sourcePath, and excerpt. Cite results by sourcePath in your reply.", parameters: { type: "object", properties: { @@ -715,7 +715,7 @@ const TOOLS: ToolDef[] = [ { name: "search_kb", description: - "Lexical (BM25) search over the arcadia-search Tantivy backend. Returns chunks with snippets + chunk_ids that can be passed to `read_chunk` to expand. Prefer this over `search_docs` (browser) when you need richer hits or when the content wouldn't be in the bundled docs.\n\nKnown corpora on the platform-admin tenant:\n- `docs` — arcadia-app architecture/ops docs (same as the browser RAG, server-hosted for parity).\n- `operator-tools` — arcadia-search + arcadia-admin documentation (admin sidecar, deploy script, search admin UI, MULTI_TENANT, RAG, AI_FIRST, LIBS, LLM_PROXY_CONTRACT).\n- `files` — markdown/text files uploaded by tenant users via arcadia-app.\n\nIf you're not sure what's available, call `list_search_corpora` first. Operators can add new corpora via the `/search` route.", + "Lexical (BM25) search over the arcadia-search Tantivy backend. Returns chunks with snippets + chunk_ids that can be passed to `read_chunk` to expand. Prefer this over `search_docs` (browser) when you need richer hits or when the content wouldn't be in the bundled docs.\n\nKnown corpora on the platform-admin tenant:\n- `docs` — arcadia-core architecture/ops docs (same as the browser RAG, server-hosted for parity).\n- `operator-tools` — arcadia-search + arcadia-admin documentation (admin sidecar, deploy script, search admin UI, MULTI_TENANT, RAG, AI_FIRST, LIBS, LLM_PROXY_CONTRACT).\n- `files` — markdown/text files uploaded by tenant users via arcadia-core.\n\nIf you're not sure what's available, call `list_search_corpora` first. Operators can add new corpora via the `/search` route.", parameters: { type: "object", properties: { diff --git a/app/lib/arcadia-knowledge.ts b/app/lib/arcadia-knowledge.ts index b0070f4..037e196 100644 --- a/app/lib/arcadia-knowledge.ts +++ b/app/lib/arcadia-knowledge.ts @@ -1,5 +1,5 @@ // Domain primer baked into the assistant's system prompt so it understands -// what arcadia-app is, what platform admins do, and how the data model fits +// what arcadia-core is, what platform admins do, and how the data model fits // together. Keep this tight — it costs context tokens on every turn. export const ARCADIA_KNOWLEDGE = `Arcadia (the backend you administer): @@ -31,7 +31,7 @@ Things to keep in mind when assisting: - Writes are auditable. Suggest the user double-check tenant slug and impact before suspend/deactivate. Deactivate is harsher than suspend — only use when clearly intended. - The operator can impersonate tenant users for debugging (POST /api/v1/admin/impersonate/:user_id) — surface this when they ask "why can't user X log in". - Quotas / rate cards / billing config errors usually surface as 402/403 from /api/v1 endpoints — diagnose by checking the tenant's billing-config and api-metering quotas. -- The reference Phoenix app lives at \`reference/arcadia-app/\` in the workspace; its OpenAPI spec is at /api/openapi (sync via \`node ../lib-arcadia-core-client/scripts/sync-spec.mjs\`). +- The reference Phoenix app lives at \`reference/arcadia-core/\` in the workspace; its OpenAPI spec is at /api/openapi (sync via \`node ../lib-arcadia-core-client/scripts/sync-spec.mjs\`). - Search admin (arcadia-search) is a separate service. Manage tenants/corpora at \`/search\`. Use \`list_search_corpora\` if you don't know what's indexed; \`rebuild_search_corpus\` after uploads or when results look stale; \`search_kb\` / \`read_chunk\` to query. When the user asks something that maps to a tool, call it. When they ask about a concept, explain it from this primer in plain language. Write tools (suspend_tenant, activate_tenant) prompt the operator with an inline confirm card before they actually run — you do not need to ask in prose first; just call the tool and the user will see the confirmation UI. If the user denies a write, do not retry it; ask what they'd like to do differently. diff --git a/app/lib/arcadia/health.ts b/app/lib/arcadia/health.ts index 9dc39a6..050396a 100644 --- a/app/lib/arcadia/health.ts +++ b/app/lib/arcadia/health.ts @@ -2,7 +2,7 @@ // // Backed by /api/v1/health* (public — no auth). Each subsystem is probed // independently; the overall endpoint aggregates and returns 503 if any -// subsystem is not "ok". See arcadia-app commit f427892. +// subsystem is not "ok". See arcadia-core commit f427892. import type { ArcadiaClient } from "@crema/arcadia-core-client" diff --git a/app/lib/arcadia/llm-configs.ts b/app/lib/arcadia/llm-configs.ts index bf10a31..936b0b2 100644 --- a/app/lib/arcadia/llm-configs.ts +++ b/app/lib/arcadia/llm-configs.ts @@ -124,7 +124,7 @@ export async function getCatalog(arcadia: ArcadiaClient): Promise, diff --git a/app/lib/arcadia/llm-proxy.ts b/app/lib/arcadia/llm-proxy.ts index e79baba..161c8c6 100644 --- a/app/lib/arcadia/llm-proxy.ts +++ b/app/lib/arcadia/llm-proxy.ts @@ -1,6 +1,6 @@ // Arcadia LLM proxy client. // -// Implements the spec in docs/LLM_PROXY_CONTRACT.md against arcadia-app's +// Implements the spec in docs/LLM_PROXY_CONTRACT.md against arcadia-core's // POST /api/v1/ai/llm/chat. The lib (@crema/llm-providers-ui buildAdapter) // owns the streaming chat path itself; this module exposes a lightweight // non-streaming probe so the Settings "Test connection" button can verify diff --git a/app/lib/gateway.ts b/app/lib/gateway.ts index 4919ccc..2871fea 100644 --- a/app/lib/gateway.ts +++ b/app/lib/gateway.ts @@ -1,9 +1,9 @@ // Arcadia LLM-gateway client. // -// The integration registry lives on arcadia-llm-gateway, not arcadia-app, so +// The integration registry lives on arcadia-llm-gateway, not arcadia-core, so // it needs its own ArcadiaClient pointed at a different base URL. Everything -// else is identical to the arcadia-app client: the same access token (the -// gateway validates arcadia-app JWTs via the shared Guardian secret) and the +// else is identical to the arcadia-core client: the same access token (the +// gateway validates arcadia-core JWTs via the shared Guardian secret) and the // same 401 cleanup. The gateway's CORS already allows localhost + any // *.sky-ai.com origin, so the browser calls it directly. diff --git a/app/routes/sso.tsx b/app/routes/sso.tsx index ec9b95b..2f22cb4 100644 --- a/app/routes/sso.tsx +++ b/app/routes/sso.tsx @@ -580,7 +580,7 @@ function IdpEditorDialog({ id="idp-callback" value={callbackUrl} onChange={(e) => setCallbackUrl(e.target.value)} - placeholder="https://your-arcadia-app/api/v1/auth/saml/callback" + placeholder="https://your-arcadia-core/api/v1/auth/saml/callback" className="font-mono text-xs" data-action="idp-form-callback" /> diff --git a/docs/LLM_PROXY_CONTRACT.md b/docs/LLM_PROXY_CONTRACT.md index 6014eb1..1411a3c 100644 --- a/docs/LLM_PROXY_CONTRACT.md +++ b/docs/LLM_PROXY_CONTRACT.md @@ -1,6 +1,6 @@ # LLM Proxy Contract -> **Status: implemented.** Backend lives in `arcadia-app` at `apps/arcadia_core/lib/arcadia/ai/llm_proxy*` (see commit `75669f1`). This document remains the contract that `lib-llm-providers-ui` and `app/lib/arcadia/llm-proxy.ts` expect from arcadia — keep it in sync if either side changes. +> **Status: implemented.** Backend lives in `arcadia-core` at `apps/arcadia_core/lib/arcadia/ai/llm_proxy*` (see commit `75669f1`). This document remains the contract that `lib-llm-providers-ui` and `app/lib/arcadia/llm-proxy.ts` expect from arcadia — keep it in sync if either side changes. ## Why a proxy? diff --git a/docs/RAG.md b/docs/RAG.md index 7da9af9..4ec7d80 100644 --- a/docs/RAG.md +++ b/docs/RAG.md @@ -14,7 +14,7 @@ shape. |---|---|---| | Lib / service | `@crema/lexical-rag-ui` | `arcadia-search` (Rust) | | Engine | MiniSearch (BM25, JS) | Tantivy (BM25, Rust) | -| Where it runs | In the user's browser | Sibling of arcadia-app | +| Where it runs | In the user's browser | Sibling of arcadia-core | | Index storage | Static JSON, fetched once | mmap'd disk, ~30–80MB resident | | Practical corpus size | ~5–10MB / ~50–100k chunks | GB-scale, no hard cap | | Update cadence | Static — rebuilt at app build time | Live — cron, webhook, or admin trigger | @@ -58,7 +58,7 @@ The index is a single JSON file built offline by **How it's wired here.** - Build script: `arcadia-admin/scripts/build-docs-index.mjs` reads - markdown from `../reference/arcadia-app/`, chunks at H1–H3, + markdown from `../reference/arcadia-core/`, chunks at H1–H3, produces `public/docs-index.json`. Runs on `npm run build:docs` (and as the `prebuild` step before `npm run build`). - Tool wrapper: `app/lib/admin-tools.ts` constructs a singleton @@ -130,7 +130,7 @@ text extraction, webhook signature, service tokens) see The default deploy runs **both**: -- `search_docs` indexes the same arcadia-app docs the parity corpus +- `search_docs` indexes the same arcadia-core docs the parity corpus on `arcadia-search` indexes. Same content, two engines. - This is intentional — it means the assistant always has *something* to search, even if `arcadia-search` is down or unreachable. The diff --git a/scripts/build-docs-index.mjs b/scripts/build-docs-index.mjs index c217807..4b3829c 100644 --- a/scripts/build-docs-index.mjs +++ b/scripts/build-docs-index.mjs @@ -1,7 +1,7 @@ #!/usr/bin/env node // Build the /docs-index.json bundle consumed by @crema/lexical-rag-ui at // runtime. Thin wrapper — all engine logic lives in the lib's builder.ts; -// this file owns the per-app config (which arcadia-app docs to index and +// this file owns the per-app config (which arcadia-core docs to index and // how to tag them). // // Run: npm run build:docs @@ -18,11 +18,11 @@ import MiniSearch from "minisearch" import { buildIndex } from "../../lib-lexical-rag-ui/src/builder.mjs" const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..") -const ARCADIA = resolve(ROOT, "../reference/arcadia-app") +const ARCADIA = resolve(ROOT, "../reference/arcadia-core") const OUT = resolve(ROOT, "public/docs-index.json") const SOURCES = [ - // Arcadia platform docs (resolved against ARCADIA = ../reference/arcadia-app). + // Arcadia platform docs (resolved against ARCADIA = ../reference/arcadia-core). { path: "README.md", tags: ["core"] }, { path: "docs/ARCADIA.md", tags: ["core"] }, { path: "docs/MODULAR_MONOLITH.md", tags: ["core"] }, -- 2.48.1 From 7415b40240c31e0d49a9953830b59f90e175d677 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 14 Jul 2026 13:43:57 +1000 Subject: [PATCH 3/7] Admin UX overhaul: P0 fixes, error-UX foundations, nav cleanup, tenant detail page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the 2026-07-14 UI/UX audit (17/40). Four phases: P1 — Settings route crashed on Agents→Edit (Input/Textarea used but never imported). Added imports + a shared route-level error boundary (components/route-error.tsx) re-exported from all shell routes, so one crashing panel degrades to an explained card with the nav intact instead of replacing the whole app with a stack trace. Corrected the stale CLAUDE.md claim that `npm run typecheck` crashes — it works, and would have caught the missing import. P2 — Error/empty/feedback foundations. Fixed useSession identity churn that fired ~3x duplicate fetches per screen and self-inflicted 429s (referentially stable snapshot). New lib/errors.ts (describeError → plain-language + the fix) and components/data-state.tsx (DataState renders exactly one of error/loading/empty/content, so a failed load never shows as "empty"; DialogError for in-dialog failures; 429 auto-retry). Rolled across all 15 list routes; every mutation now toasts. Surfaced+fixed two silent-failure bugs (sso + buckets-CORS swallowed load errors; the latter could wipe rules on save). P3 — Nav IA + trust cleanup. Default-expanded rail; regrouped into 7 coherent sections; collapsed the Apps/Plan/Entitlements stub triplication into one honest /billing page; deleted fabricated seeded notifications and the dead Help menu item; fixed the 403 copy (referenced a tenant switcher that doesn't exist); removed orphan /assistant + /library routes; gated dev-seed login hints behind DEV; renamed /activity → /audit-log with a redirect. P4 — Tenant detail page (routes/tenants.$id.tsx + components/tenant-detail/*), closing the provision→configure gap. 8 tabs (Overview, Plan & quotas, Branding, Localization, Email & SMS, Feature flags, IP rules, Inbound webhooks), each verified saving to the real backend. Row name links to detail. Co-Authored-By: Claude Fable 5 --- .gitignore | 3 + CLAUDE.md | 5 +- PRODUCT.md | 40 + app/components/data-state.tsx | 183 ++ app/components/layout/app-shell.tsx | 55 +- app/components/route-error.tsx | 104 + app/components/route-guard.tsx | 7 +- app/components/tenant-detail/branding-tab.tsx | 201 ++ app/components/tenant-detail/delivery-tab.tsx | 364 +++ .../tenant-detail/feature-flags-tab.tsx | 174 ++ .../tenant-detail/inbound-webhooks-tab.tsx | 534 ++++ app/components/tenant-detail/ip-rules-tab.tsx | 389 +++ .../tenant-detail/localization-tab.tsx | 114 + app/components/tenant-detail/plan-tab.tsx | 279 ++ app/components/tenant-detail/section.tsx | 97 + app/lib/arcadia/tenants.ts | 426 ++- app/lib/capabilities.ts | 9 +- app/lib/errors.ts | 134 + app/lib/notifications.ts | 61 +- app/lib/session.ts | 44 +- app/routes.ts | 10 +- app/routes/activity-redirect.tsx | 13 + app/routes/activity.tsx | 77 +- app/routes/ai.tsx | 2 + app/routes/announcements.tsx | 229 +- app/routes/apps.tsx | 44 - app/routes/assistant.tsx | 2317 ----------------- app/routes/billing.tsx | 81 + app/routes/buckets.tsx | 391 +-- app/routes/entitlements.tsx | 42 - app/routes/home.tsx | 2 + app/routes/integrations.tsx | 2 + app/routes/library.tsx | 205 -- app/routes/login.tsx | 12 +- app/routes/memberships.tsx | 188 +- app/routes/monitoring.tsx | 2 + app/routes/networking.tsx | 443 ++-- app/routes/organizations.tsx | 429 +-- app/routes/plan.tsx | 40 - app/routes/profile.tsx | 2 + app/routes/scheduled-tasks.tsx | 228 +- app/routes/search.tsx | 374 +-- app/routes/secrets.tsx | 255 +- app/routes/settings.tsx | 4 + app/routes/sso.tsx | 234 +- app/routes/status-page.tsx | 290 ++- app/routes/storage.tsx | 170 +- app/routes/tenants.$id.tsx | 375 +++ app/routes/tenants.tsx | 181 +- app/routes/users.tsx | 402 +-- app/routes/webhooks.tsx | 231 +- 51 files changed, 5923 insertions(+), 4575 deletions(-) create mode 100644 PRODUCT.md create mode 100644 app/components/data-state.tsx create mode 100644 app/components/route-error.tsx create mode 100644 app/components/tenant-detail/branding-tab.tsx create mode 100644 app/components/tenant-detail/delivery-tab.tsx create mode 100644 app/components/tenant-detail/feature-flags-tab.tsx create mode 100644 app/components/tenant-detail/inbound-webhooks-tab.tsx create mode 100644 app/components/tenant-detail/ip-rules-tab.tsx create mode 100644 app/components/tenant-detail/localization-tab.tsx create mode 100644 app/components/tenant-detail/plan-tab.tsx create mode 100644 app/components/tenant-detail/section.tsx create mode 100644 app/lib/errors.ts create mode 100644 app/routes/activity-redirect.tsx delete mode 100644 app/routes/apps.tsx delete mode 100644 app/routes/assistant.tsx create mode 100644 app/routes/billing.tsx delete mode 100644 app/routes/entitlements.tsx delete mode 100644 app/routes/library.tsx delete mode 100644 app/routes/plan.tsx create mode 100644 app/routes/tenants.$id.tsx diff --git a/.gitignore b/.gitignore index 358ef59..c641b88 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ # Generated by `npm run build:docs` — regenerated on every full build # (prebuild) and on demand during dev. Don't commit the artifact. /public/docs-index.json + +# impeccable tooling scratch (critique snapshots, live-server state) +.impeccable/ diff --git a/CLAUDE.md b/CLAUDE.md index 9411b5d..2eb3766 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -26,7 +26,7 @@ This file is a quick map, not a duplication of upstream docs. - `npm run dev` — Vite dev server (React Router 7). - `npm run build` — production build (`react-router build`). - `npm run start` — serve the built app (`react-router-serve ./build/server/index.js`). -- `npm run typecheck` — `react-router typegen && tsc`. See gotcha below; may crash. +- `npm run typecheck` — `react-router typegen && tsc`. **Works** (2026-07-14). Run it before every commit. - `start.sh` / `stop.sh` — repo's preferred way to run/stop the dev server in the background. - `npm run test` — Vitest run (vibespace-inherited setup; jsdom + @testing-library/react). @@ -141,6 +141,7 @@ This repo was scaffolded from `create-crema-app`, which patches marker comments. ## Known gotchas -- `npm run typecheck` may crash with a TypeScript internal error — pre-existing in the Crema toolchain. There's no test runner here, so rely on careful reads + dev server. +- `npm run typecheck` **does not crash** — verified 2026-07-14. The old "it crashes, rely on careful reads" note was stale, and it cost us: a route shipped using `Input`/`Textarea` without importing them, which `tsc` reports instantly as TS2304 but nobody was running it. It currently reports ~39 pre-existing errors in `app/` (mostly `TS2322` prop mismatches) and more in sibling libs; treat *new* errors as blocking even while that backlog stands. +- Every route that renders `` re-exports a shared route-level error boundary (`app/components/route-error.tsx`). Keep that export when adding routes — without it, one crashing panel replaces the entire console with an unstyled stack trace and strands the operator with no nav. - Vite "Outdated Optimize Dep" 504s after editing `vite.config.ts` or `tsconfig.json`: stop dev, `rm -rf node_modules/.vite`, restart, hard-reload. - After editing a sibling lib's exports, the dev server sometimes needs a manual restart to pick up the new types. diff --git a/PRODUCT.md b/PRODUCT.md new file mode 100644 index 0000000..fca9af3 --- /dev/null +++ b/PRODUCT.md @@ -0,0 +1,40 @@ +# Product + +## Register + +product + +## Users + +Two audiences share one build, split by JWT capability gating: + +- **Platform operators** (`platform_admin`) — Sky AI staff running the whole arcadia-core fleet: provisioning tenants, watching monitoring, rotating secrets, managing SSO, announcements, status page, integrations. Expert, technical, use it daily, usually on desktop. +- **Tenant admins** (`tenant_admin`) — a customer's administrator managing their own tenant: users, memberships, plan, entitlements, storage, activity. Semi-technical; may visit rarely (only when something needs changing), so rediscoverability matters more than muscle memory. + +The job to be done is administrative control of a multi-tenant agentic-cloud platform: "get in, change the thing safely, verify it took effect, get out." + +## Product Purpose + +Arcadia Admin is the operator/admin UI for arcadia-core (multi-tenant Phoenix backend). It surfaces tenant lifecycle, user/role administration, billing (apps/plan/entitlements), storage, secrets, webhooks, scheduled tasks, SSO, announcements, status page, monitoring, and audit on top of arcadia's `/api/v1` and `/admin/*` endpoints. Success = an operator can onboard a new tenant end-to-end and change any runtime setting without reaching for iex/mix tasks or SSH. + +## Brand Personality + +Calm, capable, trustworthy. "Premium AI-first glass" (Skyrise theme) but the register is product: the tool should disappear into the task. Confidence through clarity and safe defaults, not decoration. + +## Anti-references + +- Enterprise admin sprawl (endless nested settings à la old AWS console). +- Toy dashboards — fake stat tiles, decorative charts with no drill-down. +- Anything that makes destructive platform actions (delete tenant, rotate secret) feel casual. + +## Design Principles + +1. **Safe by construction** — destructive/irreversible actions are explicit, confirmed, and auditable; errors name the fix. +2. **One contract, everywhere** — capability map drives nav and guards; `data-action` ids on every interactive element (AI/script drivable). +3. **Verify what you changed** — every mutation reflects visible state (toast + updated row + audit trail), never silent success. +4. **Recognition over recall** — a tenant admin who shows up quarterly should find everything from the sidebar without training. +5. **Density where experts live** — tables and panels can be dense, but each screen has one clear primary action. + +## Accessibility & Inclusion + +WCAG AA floor (4.5:1 body text), full keyboard operability, visible focus, labeled icons, `prefers-reduced-motion` honored. Desktop-first but mobile shell must remain usable (operators respond to incidents from phones). diff --git a/app/components/data-state.tsx b/app/components/data-state.tsx new file mode 100644 index 0000000..799370a --- /dev/null +++ b/app/components/data-state.tsx @@ -0,0 +1,183 @@ +import { useEffect, useState, type ReactNode } from "react" +import { AlertTriangle, RefreshCw, ShieldOff, WifiOff } from "lucide-react" +import { LoadingOverlay } from "@crema/feedback-ui" + +import { Button } from "~/components/ui/button" +import { describeError, type LoadError } from "~/lib/errors" + +/** + * The load-state discriminator every list screen renders through. + * + * The rule it enforces: **a failed load is never an empty one.** Screens used + * to render their "No events match those filters — loosen the filter set…" + * empty state underneath a red "Too Many Requests" banner, so an operator + * couldn't tell a quiet audit log from a broken one. Exactly one of + * error / loading / empty / content renders here, ever. + */ +export function DataState({ + loading, + error, + isEmpty, + empty, + onRetry, + loadingLabel = "Loading…", + children, +}: { + loading: boolean + /** The raw thrown value; normalised for display here. */ + error: unknown + isEmpty: boolean + /** What to show when the load succeeded and there is genuinely nothing. */ + empty: ReactNode + onRetry: () => void + loadingLabel?: string + children: ReactNode +}) { + if (error) return + + // First load: nothing to show yet. Subsequent refreshes keep the table on + // screen and let the table's own `loading` prop dim it, so the page doesn't + // flash empty every time an operator hits Refresh. + if (loading && isEmpty) + return ( +
+ +
+ ) + + if (isEmpty) return <>{empty} + + return <>{children} +} + +export function ErrorState({ + error, + onRetry, +}: { + error: unknown + onRetry: () => void +}) { + const d: LoadError = describeError(error) + const Icon = + d.status === 403 || d.status === 401 + ? ShieldOff + : d.title === "Can't reach arcadia" + ? WifiOff + : AlertTriangle + + return ( +
+
+ +
+ +
+

{d.title}

+ {d.detail ? ( +

{d.detail}

+ ) : null} + {d.fields?.length ? ( +
    + {d.fields.map((f) => ( +
  • {f}
  • + ))} +
+ ) : null} +
+ + {d.retryable ? ( + d.retryAfterSec ? ( + + ) : ( + + ) + ) : null} +
+ ) +} + +/** + * An error raised while a dialog is open, rendered *inside* that dialog. + * + * Page-level banners are invisible here: the modal scrim dims them and the + * dialog covers them. A failed submit has to speak where the operator is + * looking — right above the buttons they just pressed. + */ +export function DialogError({ + error, + context = "save", +}: { + error: unknown + context?: string +}) { + const d = describeError(error, context) + + return ( +
+ +
+

{d.title}

+ {d.detail ?

{d.detail}

: null} + {d.fields?.length ? ( +
    + {d.fields.map((f) => ( +
  • {f}
  • + ))} +
+ ) : null} +
+
+ ) +} + +/** 429s resolve on their own — count down, retry, and say so. Nagging the + * operator to click Retry into a rate limiter would just extend it. */ +function AutoRetry({ + seconds, + onRetry, +}: { + seconds: number + onRetry: () => void +}) { + const [left, setLeft] = useState(seconds) + + useEffect(() => { + if (left <= 0) { + onRetry() + return + } + const t = setTimeout(() => setLeft((n) => n - 1), 1000) + return () => clearTimeout(t) + // `onRetry` is intentionally excluded: routes hand us a fresh closure each + // render, and depending on it would reset the countdown forever. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [left]) + + return ( +
+ + + retrying in {left}s + +
+ ) +} diff --git a/app/components/layout/app-shell.tsx b/app/components/layout/app-shell.tsx index ed6b1e9..5ab4c95 100644 --- a/app/components/layout/app-shell.tsx +++ b/app/components/layout/app-shell.tsx @@ -18,7 +18,6 @@ import { PanelLeftOpen, User as UserIcon, LogOut, - HelpCircle, Menu, Play, HardDrive, @@ -38,8 +37,6 @@ import { Database, Plug, MessageSquare, - Eye, - LayoutGrid, CreditCard, // CREMA:NAV-ICONS } from "lucide-react" @@ -76,7 +73,6 @@ import { dismissAll, markAllRead, markRead, - seedIfEmpty, unreadCount, useNotifications, } from "~/lib/notifications" @@ -121,7 +117,10 @@ const pinnedTop: NavItem[] = [ ] // Pinned items render flat at the bottom of the rail, below all groups. +// Audit log is cross-cutting rather than owned by any one group, so it sits +// here next to Settings. const pinnedBottom: NavItem[] = [ + { to: "/audit-log", icon: Activity, label: "Audit log" }, { to: "/settings", icon: Settings, label: "Settings" }, ] @@ -132,9 +131,9 @@ const navGroups: NavGroup[] = [ icon: Building2, items: [ { to: "/tenants", icon: Building2, label: "Tenants" }, - { to: "/memberships", icon: UserCheck, label: "Memberships" }, { to: "/organizations", icon: Building, label: "Organizations" }, { to: "/users", icon: UsersIcon, label: "Users" }, + { to: "/memberships", icon: UserCheck, label: "Memberships" }, { to: "/sso", icon: ShieldCheck, label: "SSO" }, ], }, @@ -142,11 +141,9 @@ const navGroups: NavGroup[] = [ key: "billing", label: "Billing", icon: CreditCard, - items: [ - { to: "/apps", icon: LayoutGrid, label: "Apps" }, - { to: "/plan", icon: CreditCard, label: "Plan" }, - { to: "/entitlements", icon: Gauge, label: "Entitlements" }, - ], + // One item today (Plan/Entitlements/Apps collapsed here — none has a live + // endpoint yet). They split back into siblings under this group once wired. + items: [{ to: "/billing", icon: CreditCard, label: "Plan & usage" }], }, { key: "data", @@ -156,17 +153,25 @@ const navGroups: NavGroup[] = [ { to: "/storage", icon: HardDrive, label: "Storage" }, { to: "/buckets", icon: Boxes, label: "Buckets" }, { to: "/secrets", icon: KeyRound, label: "Secrets" }, - { to: "/integrations", icon: Plug, label: "Integrations" }, ], }, { - key: "integrations", - label: "Integrations", + key: "automation", + label: "Automation", icon: Plug, items: [ { to: "/webhooks", icon: WebhookIcon, label: "Webhooks" }, { to: "/scheduled-tasks", icon: CalendarClock, label: "Scheduled" }, + { to: "/integrations", icon: Plug, label: "Integrations" }, + ], + }, + { + key: "infrastructure", + label: "Infrastructure", + icon: Network, + items: [ { to: "/networking", icon: Network, label: "Networking" }, + { to: "/monitoring", icon: Gauge, label: "Monitoring" }, ], }, { @@ -178,15 +183,6 @@ const navGroups: NavGroup[] = [ { to: "/status-page", icon: AlertOctagon, label: "Status page" }, ], }, - { - key: "observability", - label: "Observability", - icon: Eye, - items: [ - { to: "/monitoring", icon: Gauge, label: "Monitoring" }, - { to: "/activity", icon: Activity, label: "Audit log" }, - ], - }, { key: "ai", label: "AI & Search", @@ -260,8 +256,12 @@ export function AppShell({ // short-circuit so a sign-out doesn't reduce the hook count and trip // React's "rendered fewer hooks than expected" check. const [expanded, setExpanded] = useState(() => { - if (typeof window === "undefined") return false - return localStorage.getItem(SIDEBAR_KEY) === "1" + if (typeof window === "undefined") return true + // Default to expanded on first run — an icon-only rail of ~18 pictograms is + // unreadable to anyone who hasn't memorised it. Collapse stays available and + // is remembered once chosen. + const stored = localStorage.getItem(SIDEBAR_KEY) + return stored === null ? true : stored === "1" }) useEffect(() => { localStorage.setItem(SIDEBAR_KEY, expanded ? "1" : "0") @@ -627,9 +627,6 @@ export function AppShell({ > Settings - - Help - { - seedIfEmpty() - }, []) - return ( + + +
+
+ +
+
+ {title} + {description} +
+
+
+ + {message ? ( +

+ {message} +

+ ) : null} + +
+ + +
+ + {stack ? ( +
+ + Stack trace (dev only) + +
+                {stack}
+              
+
+ ) : null} +
+
+
+ ) +} diff --git a/app/components/route-guard.tsx b/app/components/route-guard.tsx index 927fd5f..7e7bff0 100644 --- a/app/components/route-guard.tsx +++ b/app/components/route-guard.tsx @@ -39,9 +39,10 @@ function Forbidden({ capability }: { capability: Capability }) {

You can't access this page

- This view requires the {capability}{" "} - capability on your active tenant. If you think you should have it, - switch tenants from the avatar menu or ask an admin. + This view needs the{" "} + {capability} capability, + which your account doesn't hold on the current tenant. Ask a platform + administrator to grant it.

diff --git a/app/components/tenant-detail/branding-tab.tsx b/app/components/tenant-detail/branding-tab.tsx new file mode 100644 index 0000000..0cba271 --- /dev/null +++ b/app/components/tenant-detail/branding-tab.tsx @@ -0,0 +1,201 @@ +import { useState } from "react" + +import { useArcadiaClient } from "@crema/arcadia-core-client" +import { useToast } from "@crema/notification-ui" + +import { TenantSection, Field } from "~/components/tenant-detail/section" +import { Input } from "~/components/ui/input" +import { Textarea } from "~/components/ui/textarea" +import { updateBranding } from "~/lib/arcadia/tenants" +import type { TenantTabProps } from "~/routes/tenants.$id" + +/** + * Tenant branding: logo/favicon URLs, the three brand colours, and a custom-CSS + * override. All fields are optional; clearing one and saving sends `null` so it + * clears server-side (the server accepts null and validates any colour it does + * get against a `#rrggbb` hex). + */ +export function BrandingTab({ tenant, reload }: TenantTabProps) { + const arcadia = useArcadiaClient() + const toast = useToast() + const b = tenant.branding + + const [logoUrl, setLogoUrl] = useState(b.logo_url ?? "") + const [faviconUrl, setFaviconUrl] = useState(b.favicon_url ?? "") + const [primary, setPrimary] = useState(b.primary_color ?? "") + const [secondary, setSecondary] = useState(b.secondary_color ?? "") + const [accent, setAccent] = useState(b.accent_color ?? "") + const [customCss, setCustomCss] = useState(b.custom_css ?? "") + + const [saving, setSaving] = useState(false) + const [error, setError] = useState(null) + + const dirty = + logoUrl !== (b.logo_url ?? "") || + faviconUrl !== (b.favicon_url ?? "") || + primary !== (b.primary_color ?? "") || + secondary !== (b.secondary_color ?? "") || + accent !== (b.accent_color ?? "") || + customCss !== (b.custom_css ?? "") + + const save = async () => { + setSaving(true) + setError(null) + try { + await updateBranding(arcadia, tenant.id, { + logo_url: emptyToNull(logoUrl), + favicon_url: emptyToNull(faviconUrl), + primary_color: emptyToNull(primary), + secondary_color: emptyToNull(secondary), + accent_color: emptyToNull(accent), + custom_css: customCss.trim() === "" ? null : customCss, + }) + await reload() + toast.success("Branding updated") + } catch (err) { + setError(err) + } finally { + setSaving(false) + } + } + + return ( + + + setLogoUrl(e.target.value)} + placeholder="https://…" + data-action="tenant-detail-branding-logo-url" + /> + + + + setFaviconUrl(e.target.value)} + placeholder="https://…" + data-action="tenant-detail-branding-favicon-url" + /> + + + + + + + +