Compare commits

..

2 Commits

Author SHA1 Message Date
jules
980ec285ea refactor: rename service references arcadia-app → arcadia-core
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) <noreply@anthropic.com>
2026-06-11 13:40:31 +10:00
jules
ae8332ab3f refactor: rename @crema/arcadia-client → @crema/arcadia-core-client
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) <noreply@anthropic.com>
2026-06-11 13:31:54 +10:00
2 changed files with 10 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
# @crema/arcadia-client
# @crema/arcadia-core-client
Typed HTTP client + React bindings for the [arcadia](https://git.sky-ai.com/CremaUIStudio/arcadia-app) Phoenix API. Wraps the OpenAPI-spec'd surface at `/api/v1` with auth (Bearer JWT and/or service-account API key), tenant context (`X-Tenant-ID`), idempotency keys, error normalization, and rate-limit-aware retry.
Typed HTTP client + React bindings for the [arcadia](https://git.sky-ai.com/CremaUIStudio/arcadia-core) Phoenix API. Wraps the OpenAPI-spec'd surface at `/api/v1` with auth (Bearer JWT and/or service-account API key), tenant context (`X-Tenant-ID`), idempotency keys, error normalization, and rate-limit-aware retry.
The client is **stateless about how the JWT is obtained** — callers pass `getToken` so token refresh and storage stay app-owned.
@@ -13,7 +13,7 @@ import {
useArcadia,
useArcadiaClient,
ArcadiaError,
} from "@crema/arcadia-client";
} from "@crema/arcadia-core-client";
```
## Usage in a Crema app
@@ -21,7 +21,7 @@ import {
In `app/root.tsx`, wrap providers:
```tsx
import { ArcadiaProvider } from "@crema/arcadia-client";
import { ArcadiaProvider } from "@crema/arcadia-core-client";
<ArcadiaProvider
baseUrl={import.meta.env.VITE_ARCADIA_URL}
@@ -36,7 +36,7 @@ import { ArcadiaProvider } from "@crema/arcadia-client";
In any component:
```tsx
import { useArcadiaClient, ArcadiaError } from "@crema/arcadia-client";
import { useArcadiaClient, ArcadiaError } from "@crema/arcadia-core-client";
function ResourceList() {
const arcadia = useArcadiaClient();
@@ -59,7 +59,7 @@ Endpoint request/response types come from arcadia's live OpenAPI spec. Regenerat
```bash
ARCADIA_OPENAPI_URL=http://localhost:4000/api/openapi \
node ../lib-arcadia-client/scripts/sync-spec.mjs
node ../lib-arcadia-core-client/scripts/sync-spec.mjs
```
Requires `openapi-typescript` in the consuming app's devDeps:
@@ -108,7 +108,7 @@ Phoenix Channels at `/socket/tenant`, opt-in via the provider. The socket auto-c
```
```tsx
import { useArcadiaSubscription } from "@crema/arcadia-client";
import { useArcadiaSubscription } from "@crema/arcadia-core-client";
function NotificationToasts() {
useArcadiaSubscription("notification", (n) => {
@@ -129,7 +129,7 @@ favourites, DNA-change subscriptions, notifications, search,
@-mention search), there's a typed wrapper over the generic client:
```ts
import { createArcadiaClient, createSocialBindings } from "@crema/arcadia-client";
import { createArcadiaClient, createSocialBindings } from "@crema/arcadia-core-client";
const client = createArcadiaClient({ baseUrl, getToken });
const social = createSocialBindings(client);
@@ -156,5 +156,5 @@ Realtime: the social write paths broadcast via Phoenix.PubSub →
## Conventions
- Inline imports only — no own `package.json` (lib lives by the consuming app's deps).
- Path-aliased into apps via `tsconfig.json` `paths`: `@crema/arcadia-client``../lib-arcadia-client/src/index.tsx`.
- Path-aliased into apps via `tsconfig.json` `paths`: `@crema/arcadia-core-client``../lib-arcadia-core-client/src/index.tsx`.
- Tailwind doesn't scan this lib — no UI; nothing to scan.

View File

@@ -2,7 +2,7 @@
// Fetches the arcadia OpenAPI spec and regenerates ../src/generated/openapi.d.ts.
//
// Usage (from a consuming app, with arcadia reachable):
// node ../lib-arcadia-client/scripts/sync-spec.mjs
// node ../lib-arcadia-core-client/scripts/sync-spec.mjs
//
// Configurable via env:
// ARCADIA_OPENAPI_URL default: http://localhost:4000/api/openapi