@krak-stack/registry 0.1.50 → 0.1.52
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.
- package/CHANGELOG.md +34 -0
- package/README.md +16 -424
- package/dist/components/ui/data-table.d.ts +20 -1
- package/dist/components/ui/data-table.js +52 -1
- package/dist/lib/docs.js +2 -2
- package/dist/services/agent/client/index.js +1 -1
- package/dist/services/events/browser.d.ts +26 -0
- package/dist/services/events/browser.js +579 -0
- package/dist/services/events/client/audit-log-table.d.ts +53 -0
- package/dist/services/events/client/audit-log-table.js +3655 -0
- package/dist/services/events/index.d.ts +215 -0
- package/dist/services/events/index.js +1046 -0
- package/dist/services/events/migrations.d.ts +4 -0
- package/dist/services/events/migrations.js +42 -0
- package/dist/services/events/record.d.ts +3 -0
- package/dist/services/events/record.js +14 -0
- package/dist/services/events/request-context.d.ts +6 -0
- package/dist/services/events/schema.d.ts +237 -0
- package/dist/services/events/schema.js +361 -0
- package/dist/services/opentelemetry/api.d.ts +3 -1
- package/dist/services/opentelemetry/api.js +133 -64
- package/dist/services/opentelemetry/browser.d.ts +17 -20
- package/dist/services/opentelemetry/browser.js +58 -162
- package/dist/services/opentelemetry/events.d.ts +3 -1
- package/dist/services/opentelemetry/{server.d.ts → index.d.ts} +8 -5
- package/dist/services/opentelemetry/{server.js → index.js} +66 -48
- package/dist/services/opentelemetry/processor.d.ts +19 -0
- package/dist/services/opentelemetry/schema.d.ts +8 -20
- package/dist/services/opentelemetry/web-vitals.d.ts +15 -0
- package/dist/services/opentelemetry/web-vitals.js +229 -0
- package/package.json +35 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @krak-stack/registry
|
|
2
2
|
|
|
3
|
+
## 0.1.52
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Replace AuditLogTable's profile resolver callbacks with an application-supplied `actors` list and export `AuditActor`. Match responsible actors by type and ID and resolve user impersonators from the same list. Use neutral labels for unavailable profiles so loading or partial member lists do not misidentify users as former members.
|
|
8
|
+
- Add `Events.listAudit` using the shared Query schema for organization-scoped pagination, filtering, and sorting. Return unchanged OTLP EventLogRecord values in the standard paginated response. Export a bilingual AuditLogTable from `events/client` with application-owned live member profiles, standard query state, and the shared KrakStack locale.
|
|
9
|
+
|
|
10
|
+
Include audit queries and the table in the Events registry item and documentation. Include the opt-in Browser Web Vitals layer and its documentation in the OpenTelemetry registry item, without changing package subpath imports.
|
|
11
|
+
|
|
12
|
+
Present audit history in five columns: Time, Action, Target, Actor, and Method. Separate the responsible user or organization from request authentication. Resolve current profiles in the application, while retaining key identities, historical roles, and target types in unchanged log records. Include localized labels and safe identity fallbacks.
|
|
13
|
+
|
|
14
|
+
Define principal attribution as `app.actor.type/id`, authentication as `app.auth.method` and API-key identity as `app.auth.credential.id`. Method displays User session, API Key, or Unknown from verified authentication only, without interpreting agent, channel, or user-agent metadata. Protect auth annotations from browser claims. Document the application vocabulary and its relationship to OTel and OCSF.
|
|
15
|
+
|
|
16
|
+
Retain the verified impersonator ID as `app.auth.impersonator.id` while keeping the effective user as Actor. Show localized impersonation attribution in the Actor cell, resolving profiles from the application-provided actors list and falling back to the retained ID when a profile is unavailable. Never infer membership status from a missing profile or change Method during impersonation.
|
|
17
|
+
|
|
18
|
+
- Add a `reference` table column and reusable `DataTableReferenceCell` for an image beside stacked primary/secondary text, such as a user's name and email. Include configurable circle/square images, initials/image-error fallbacks, and readable search, sorting, and exports without exposing image URLs.
|
|
19
|
+
- Require a typed `target: { id, name, type }` on audit events and generate an event UUID when `eventId` is omitted. Persist historical `user.roles`, but exclude user display names/photos from recorded events so applications can resolve current profiles by actor ID. Browser claims cannot override auth-owned attribution. Existing audit callers must supply a target; explicit IDs retain retry deduplication.
|
|
20
|
+
|
|
21
|
+
## 0.1.51
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 0e67ce7: Add application events, server audit recording, and cookieless browser analytics through the OTLP/HTTP JSON logs endpoint.
|
|
26
|
+
- Install: `service-events`, or the `@krak-stack/registry/events`, `/events/browser`, and `/events/migrations` exports.
|
|
27
|
+
- Default OTLP: forward analytics to your telemetry backend; use `Otlp.event` for server telemetry.
|
|
28
|
+
- Optional SQL: PostgreSQL/SQLite persistence for in-app queries, visit timelines, and transactional audit records. `Events.track` requires SQL and supports verified actor context.
|
|
29
|
+
- Browser: `BrowserEvents` provides event/page tracking, automatic SPA views, DNT/GPC support, and path sanitization.
|
|
30
|
+
- Enrichment: trusted Cloudflare/custom geolocation and daily visitor IDs, without browser storage or automatic raw IP storage.
|
|
31
|
+
- Web Vitals: a separate `BrowserWebVitals` layer reuses the browser event exporter, respects DNT/GPC, and keeps `web-vitals` out of base browser imports.
|
|
32
|
+
- Dependencies: Bowser and Web Vitals are regular package dependencies, so package consumers do not need to declare them separately.
|
|
33
|
+
- Composition: `BrowserEvents` and `BrowserWebVitals` consume `BrowserOtlp`; server-side `Events` and `HttpApiOtlp` consume `Otlp`. Browser event export is enabled by default, batching is shared, and `Events.ingestionLayer` connects HTTP ingestion to application recording.
|
|
34
|
+
|
|
35
|
+
SQL is authoritative for persisted events; collector forwarding is best effort. Audit classification provides an application audit trail, not immutable archival storage or a compliance guarantee.
|
|
36
|
+
|
|
3
37
|
## 0.1.50
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,449 +1,41 @@
|
|
|
1
1
|
# @krak-stack/registry
|
|
2
2
|
|
|
3
|
-
Tree-shakable
|
|
3
|
+
Tree-shakable components and Effect services from the KrakStack registry.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
4
6
|
|
|
5
7
|
```bash
|
|
6
8
|
bun add @krak-stack/registry
|
|
7
9
|
```
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Applications using Effect forms need `@lucas-barake/effect-form@1.1.0` and
|
|
12
|
-
`@lucas-barake/effect-form-react@1.1.0`, which support stable Effect 4 without
|
|
13
|
-
compatibility patches:
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
bun add @lucas-barake/effect-form@1.1.0 @lucas-barake/effect-form-react@1.1.0
|
|
17
|
-
```
|
|
11
|
+
Install the peer dependencies required by the items you use. Each item's registry documentation lists its dependencies and setup.
|
|
18
12
|
|
|
19
|
-
|
|
20
|
-
entries and patch files, update any form version overrides to `1.1.0`, and run
|
|
21
|
-
`bun install`. Preserve unrelated dependency patches.
|
|
13
|
+
## Use
|
|
22
14
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Import only the subpaths used by the application:
|
|
15
|
+
Import from the specific package subpaths you need:
|
|
26
16
|
|
|
27
17
|
```tsx
|
|
28
18
|
import { DataTable } from "@krak-stack/registry/data-table";
|
|
29
|
-
import {
|
|
30
|
-
import { AgentService } from "@krak-stack/registry/agent";
|
|
31
|
-
import { AgentWidget, makeAgentAtoms } from "@krak-stack/registry/agent/client";
|
|
32
|
-
import { makeAgentApiGroup } from "@krak-stack/registry/agent/schema";
|
|
33
|
-
import { makeHttpApiToolkit } from "@krak-stack/registry/httpapi/toolkit";
|
|
34
|
-
import { makeHttpApiCli } from "@krak-stack/registry/httpapi/cli";
|
|
35
|
-
import { HttpApiAdapter } from "@krak-stack/registry/httpapi/adapter";
|
|
36
|
-
import { HttpApiOtlp } from "@krak-stack/registry/opentelemetry/api";
|
|
19
|
+
import { Otlp } from "@krak-stack/registry/opentelemetry";
|
|
37
20
|
import { BrowserOtlp } from "@krak-stack/registry/opentelemetry/browser";
|
|
38
|
-
import { createDocsSource, makeDocs } from "@krak-stack/registry/docs";
|
|
39
|
-
import { loadMdxDocsDirectory } from "@krak-stack/registry/docs/server";
|
|
40
|
-
import {
|
|
41
|
-
DocumentationToolkit,
|
|
42
|
-
DocumentationToolkitLayer,
|
|
43
|
-
} from "@krak-stack/registry/documentation-toolkit";
|
|
44
|
-
import {
|
|
45
|
-
WebFetchToolkit,
|
|
46
|
-
WebFetchToolkitLayer,
|
|
47
|
-
} from "@krak-stack/registry/webfetch-toolkit";
|
|
48
|
-
import { Query } from "@krak-stack/registry/query";
|
|
49
|
-
import { createSeo } from "@krak-stack/registry/seo";
|
|
50
|
-
import { FileExtractionService } from "@krak-stack/registry/service-file-extraction";
|
|
51
|
-
import { FileExtractedTextSchema } from "@krak-stack/registry/service-file-extraction/schema";
|
|
52
|
-
import {
|
|
53
|
-
HealthApiGroup,
|
|
54
|
-
healthHandler,
|
|
55
|
-
HealthService,
|
|
56
|
-
} from "@krak-stack/registry/service-health";
|
|
57
|
-
import { NotificationService } from "@krak-stack/registry/service-notification";
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## OpenTelemetry
|
|
61
|
-
|
|
62
|
-
| Export | Purpose |
|
|
63
|
-
| --------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
64
|
-
| `HttpApiOtlp.layer` from `opentelemetry/api` | Server exporters and same-origin browser ingestion routes. Includes `ServerOtlp.layer`. |
|
|
65
|
-
| `ServerOtlp.layer` from `opentelemetry/server` | Exporters for workers, workflows, and CLIs without an HTTP server. |
|
|
66
|
-
| `BrowserOtlp.layer(options)` from `opentelemetry/browser` | Browser tracing and optional events, logs, and metrics. |
|
|
67
|
-
|
|
68
|
-
### Setup
|
|
69
|
-
|
|
70
|
-
Provide the HTTP layer once at the application composition root:
|
|
71
|
-
|
|
72
|
-
```ts
|
|
73
|
-
import { Layer } from "effect";
|
|
74
|
-
import { HttpApiOtlp } from "@krak-stack/registry/opentelemetry/api";
|
|
75
|
-
|
|
76
|
-
const appLayer = appRoutes.pipe(Layer.provideMerge(HttpApiOtlp.layer));
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Configure an OTLP/HTTP collector on the server:
|
|
80
|
-
|
|
81
|
-
```dotenv
|
|
82
|
-
OTEL_SERVICE_NAME=my-app-api
|
|
83
|
-
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
|
|
84
|
-
OTEL_TRACES_EXPORTER=otlp
|
|
85
|
-
OTEL_METRICS_EXPORTER=otlp
|
|
86
|
-
OTEL_LOGS_EXPORTER=otlp
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Browser events require the logs signal. The proxy forwards enabled signals from
|
|
90
|
-
`/api/otel/v1/{traces,metrics,logs}` to the collector. Keep collector credentials
|
|
91
|
-
server-side. Server log endpoint/header overrides use
|
|
92
|
-
`OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` / `OTEL_EXPORTER_OTLP_LOGS_HEADERS`, falling
|
|
93
|
-
back to the shared endpoint/headers; these overrides do not change proxy routing.
|
|
94
|
-
`OTEL_SDK_DISABLED=true` disables server export, not browser collection.
|
|
95
|
-
|
|
96
|
-
Install one browser layer on the Atom context passed to `AtomHttpApi.Service`:
|
|
97
|
-
|
|
98
|
-
```ts
|
|
99
|
-
import { Atom } from "effect/reactivity";
|
|
100
|
-
import { BrowserOtlp } from "@krak-stack/registry/opentelemetry/browser";
|
|
101
|
-
|
|
102
|
-
const apiRuntime = Atom.context();
|
|
103
|
-
if (!import.meta.env.SSR) {
|
|
104
|
-
apiRuntime.addGlobalLayer(
|
|
105
|
-
BrowserOtlp.layer({ serviceName: "my-app-web", events: {} }),
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Mount/read `ApiClient.runtime` in the root layout to start it. Browser methods
|
|
111
|
-
target the active layer even when run from another Effect runtime. Calls before
|
|
112
|
-
startup or after disposal are no-ops, not buffered. Dispose long-lived server and
|
|
113
|
-
browser runtimes on shutdown to flush pending data.
|
|
114
|
-
|
|
115
|
-
### Browser API
|
|
116
|
-
|
|
117
|
-
All methods return Effects. Use `yield*` inside Effect code or
|
|
118
|
-
`Effect.runPromise(...)` / `Effect.runFork(...)` from application callbacks.
|
|
119
|
-
|
|
120
|
-
| Method | Behavior |
|
|
121
|
-
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
122
|
-
| `identify({ userId?, organizationId? })` | Replace identity for future events; omitted fields clear old values. Emits no event. |
|
|
123
|
-
| `identify(null)` | Clear identity, for example on logout. |
|
|
124
|
-
| `track(name, properties?, options?)` | Record a named event. |
|
|
125
|
-
| `page(options?)` | Record `browser.page_view`. Accepts `path`, `name`, `category`, `properties`, and event `options`. `pageView` is an alias. |
|
|
126
|
-
|
|
127
|
-
`identify` has no typed failure: invalid input warns without including supplied
|
|
128
|
-
values and leaves identity unchanged. `track` and `page` fail with an Effect
|
|
129
|
-
schema error on invalid input. Identity is in memory only, applies to events
|
|
130
|
-
rather than automatic traces/logs, and never rewrites queued events.
|
|
131
|
-
|
|
132
|
-
### Auth example
|
|
133
|
-
|
|
134
|
-
Mount this once under the application's Atom registry. `ApiClient` and
|
|
135
|
-
`authSessionAtom` are application-owned; the telemetry package has no auth
|
|
136
|
-
dependency. The session atom in this example exposes KrakStack Auth session data.
|
|
137
|
-
|
|
138
|
-
```tsx
|
|
139
|
-
import { useAtomSubscribe, useAtomValue } from "@effect/atom-react";
|
|
140
|
-
import { BrowserOtlp } from "@krak-stack/registry/opentelemetry/browser";
|
|
141
|
-
import { Effect } from "effect";
|
|
142
|
-
import { AsyncResult } from "effect/reactivity";
|
|
143
|
-
import { ApiClient } from "@/lib/api-client";
|
|
144
|
-
import { authSessionAtom } from "@/services/auth/client";
|
|
145
|
-
|
|
146
|
-
export const AuthTelemetry = () => {
|
|
147
|
-
const runtime = useAtomValue(ApiClient.runtime);
|
|
148
|
-
|
|
149
|
-
useAtomSubscribe(
|
|
150
|
-
authSessionAtom,
|
|
151
|
-
(session) => {
|
|
152
|
-
if (!AsyncResult.isSuccess(runtime)) return;
|
|
153
|
-
|
|
154
|
-
Effect.runFork(
|
|
155
|
-
BrowserOtlp.identify(
|
|
156
|
-
AsyncResult.isSuccess(session) && !session.waiting && session.value
|
|
157
|
-
? {
|
|
158
|
-
userId: session.value.user.id,
|
|
159
|
-
organizationId:
|
|
160
|
-
session.value.session.activeOrganizationId ?? undefined,
|
|
161
|
-
}
|
|
162
|
-
: null,
|
|
163
|
-
),
|
|
164
|
-
);
|
|
165
|
-
},
|
|
166
|
-
{ immediate: true },
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
return null;
|
|
170
|
-
};
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
This identifies after startup and clears identity during auth loading, failure,
|
|
174
|
-
and logout. The first page view may be anonymous. For other auth libraries, pass
|
|
175
|
-
the same two IDs or `null` when auth state changes. Apply your own consent policy;
|
|
176
|
-
do not send names, emails, or session tokens as identity.
|
|
177
|
-
|
|
178
|
-
### Page views and browser options
|
|
179
|
-
|
|
180
|
-
`events: {}` enables custom events and one page view on startup, then on pathname
|
|
181
|
-
changes through `pushState`, `replaceState`, and back/forward navigation.
|
|
182
|
-
Same-path and query/hash-only changes are ignored. Tracking follows URL changes,
|
|
183
|
-
not loader completion. Paths exclude query strings/fragments but may still
|
|
184
|
-
contain personal IDs.
|
|
185
|
-
|
|
186
|
-
For sanitized route templates or custom timing, use
|
|
187
|
-
`events: { pageViews: false }` and call `page({ path: "/orders/:id" })` manually.
|
|
188
|
-
Do not combine automatic and manual tracking for the same view.
|
|
189
|
-
|
|
190
|
-
| Layer option | Default |
|
|
191
|
-
| ----------------------------------------- | --------------------------------------------------------------- |
|
|
192
|
-
| `serviceName` | Required |
|
|
193
|
-
| `traces` | `{}`; includes global exception capture. `false` disables both. |
|
|
194
|
-
| `events`, `logs`, `metrics` | `false`; enable each independently with `{}`. |
|
|
195
|
-
| `baseUrl` | `/api/otel` |
|
|
196
|
-
| `serviceVersion`, `attributes`, `headers` | Optional resource/transport metadata. |
|
|
197
|
-
|
|
198
|
-
Browser events batch every 30 seconds, up to 100 records by default. Override
|
|
199
|
-
`exportInterval`, `maxBatchSize`, and `shutdownTimeout` under `events`.
|
|
200
|
-
|
|
201
|
-
### Server events and shared options
|
|
202
|
-
|
|
203
|
-
Define server events as Effects and run them inside the runtime with
|
|
204
|
-
`ServerOtlp.layer` (or the HTTP layer):
|
|
205
|
-
|
|
206
|
-
```ts
|
|
207
|
-
import { Effect } from "effect";
|
|
208
|
-
import { ServerOtlp } from "@krak-stack/registry/opentelemetry/server";
|
|
209
|
-
|
|
210
|
-
const orderCompleted = Effect.gen(function* () {
|
|
211
|
-
yield* ServerOtlp.track("app.order.completed", { "order.total": 49 });
|
|
212
|
-
});
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
Authenticated handlers inherit `user.id` and `organization.id` from
|
|
216
|
-
`AuthMiddleware` log annotations. Server identity is fiber-scoped; there is no
|
|
217
|
-
server `identify` method. Background jobs can supply identity per event.
|
|
218
|
-
|
|
219
|
-
Both `track` methods accept `options`:
|
|
220
|
-
|
|
221
|
-
| Option | OTLP attribute / meaning |
|
|
222
|
-
| ------------------------------------------------- | ------------------------------------------------------------------- |
|
|
223
|
-
| `userId`, `anonymousId`, `sessionId`, `messageId` | `user.id`, `analytics.anonymous_id`, `session.id`, `log.record.uid` |
|
|
224
|
-
| `context` | Additional flat attributes |
|
|
225
|
-
| `timestamp` | Effect `DateTime.Utc` occurrence time; otherwise recorded now |
|
|
226
|
-
|
|
227
|
-
Attribute precedence, lowest to highest: context, properties, explicit identity
|
|
228
|
-
options, browser identified identity, scoped log annotations. Values support
|
|
229
|
-
strings, finite numbers, booleans, and homogeneous arrays, not nested objects.
|
|
230
|
-
Use stable event names and put dynamic values in attributes. Message IDs support
|
|
231
|
-
correlation, not guaranteed deduplication.
|
|
232
|
-
|
|
233
|
-
Events are OTLP log records with `eventName`, INFO severity, and active trace/span
|
|
234
|
-
IDs when available; they do not create spans. `browser.page_view`, `url.path`,
|
|
235
|
-
`analytics.page.name`, and `analytics.page.category` describe page events; the
|
|
236
|
-
analytics names are project conventions, not standardized OTel semantics.
|
|
237
|
-
|
|
238
|
-
Configure collector/storage separately. Browser identity is untrusted analytics
|
|
239
|
-
metadata, not authorization or an audit trail. No visitor/session IDs or cookies
|
|
240
|
-
are generated. Browser flushing on hidden/pagehide is best-effort. Apply payload
|
|
241
|
-
and rate limits at ingestion, and keep sensitive data out of events and
|
|
242
|
-
high-cardinality fields out of Loki labels.
|
|
243
|
-
|
|
244
|
-
## Other services
|
|
245
|
-
|
|
246
|
-
`@krak-stack/registry/service-notification` is the source-compatible direct
|
|
247
|
-
dispatcher. Use the separate `@krak-stack/notifications` package for a durable
|
|
248
|
-
inbox, package-owned migrations, persisted delivery jobs, retries, workers, and
|
|
249
|
-
one-shot reminders.
|
|
250
|
-
|
|
251
|
-
Create a configured SEO helper once with site-wide defaults, then use it for each page:
|
|
252
|
-
|
|
253
|
-
```tsx
|
|
254
|
-
const siteSeo = createSeo({
|
|
255
|
-
origin: "https://krakstack.net",
|
|
256
|
-
locales: ["en", "fr"],
|
|
257
|
-
siteName: "KrakStack",
|
|
258
|
-
sameAs: ["https://github.com/krakcons/krakstack"],
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
<Route
|
|
262
|
-
head={() =>
|
|
263
|
-
siteSeo({
|
|
264
|
-
title: "KrakStack",
|
|
265
|
-
description: "Production-ready building blocks for TanStack apps.",
|
|
266
|
-
locale: "en",
|
|
267
|
-
})
|
|
268
|
-
}
|
|
269
|
-
/>;
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
The returned object contains `meta`, `links`, and derived JSON-LD `scripts`. Website pages receive `WebSite` and `Organization` data; documentation pages can pass `type: "article"` for `Article` data. Use the lower-level `seo` function directly when a configured factory is not useful.
|
|
273
|
-
|
|
274
|
-
HTTP API adapter, AI tool, and CLI utilities are available under
|
|
275
|
-
the `@krak-stack/registry/httpapi/*` subpaths. Keep application-specific API
|
|
276
|
-
layers, handlers, authentication, and client bindings in the application.
|
|
277
|
-
|
|
278
|
-
Use `@krak-stack/registry/httpapi/toolkit` for HTTP API tools.
|
|
279
|
-
|
|
280
|
-
### HTTP API tools and MCP
|
|
281
|
-
|
|
282
|
-
Static toolkits keep definitions and implementations separate:
|
|
283
|
-
`DocumentationToolkit` / `DocumentationToolkitLayer({ docs, locale })` and
|
|
284
|
-
`WebFetchToolkit` / `WebFetchToolkitLayer(options?)`. Merge the definitions with
|
|
285
|
-
`Toolkit.merge`, then provide their handler layers. Web-fetch options are
|
|
286
|
-
validated during layer acquisition through the Effect error channel.
|
|
287
|
-
|
|
288
|
-
HTTP API tools are generated dynamically, so `makeHttpApiToolkit()` returns
|
|
289
|
-
matching definitions and handlers together.
|
|
290
|
-
|
|
291
|
-
CLI, toolkit, and MCP registration share `HttpApiAdapter.operations`. Each operation
|
|
292
|
-
contains its tool name, typed `inputSchema`, derived `inputJsonSchema`, and method
|
|
293
|
-
annotations. Inputs use `{ params, query, headers, body }`; only the CLI turns
|
|
294
|
-
terminal arguments into that shape. The generated HTTP client handles wire
|
|
295
|
-
encoding, and payload codecs retain their transformations.
|
|
296
|
-
|
|
297
|
-
Use `makeHttpApiToolkit(config)` to construct matching tools and handlers once:
|
|
298
|
-
|
|
299
|
-
```ts
|
|
300
|
-
import { makeHttpApiToolkit } from "@krak-stack/registry/httpapi/toolkit";
|
|
301
|
-
|
|
302
|
-
const { toolkit, handlers } = yield * makeHttpApiToolkit();
|
|
303
|
-
const tools = yield * toolkit.pipe(Effect.provide(handlers));
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
Provide one `HttpApiAdapter` layer through the surrounding Effect layers:
|
|
307
|
-
|
|
308
|
-
```ts
|
|
309
|
-
const adapterLayer = HttpApiAdapter.layer({
|
|
310
|
-
api: AppApi,
|
|
311
|
-
baseUrl: "https://example.com",
|
|
312
|
-
methods: ["get"],
|
|
313
|
-
}).pipe(Layer.provide(FetchHttpClient.layer));
|
|
314
21
|
```
|
|
315
22
|
|
|
316
|
-
|
|
317
|
-
input/success codecs, execution client, and result encoder all use the same API.
|
|
318
|
-
Import from `@krak-stack/registry/httpapi/adapter`, or install
|
|
319
|
-
`@krak-stack/httpapi-adapter` with shadcn. The old client/helper package subpaths
|
|
320
|
-
and client registry item have been removed.
|
|
321
|
-
Configuration is optional. Construct once and use the returned pair for agents
|
|
322
|
-
or MCP; the separate `HttpApiToolkit` and `HttpApiToolkitLayer` factories have
|
|
323
|
-
been removed.
|
|
324
|
-
|
|
325
|
-
For CLI commands, `makeHttpApiCli()` returns `{ command, run }`. Provide the same
|
|
326
|
-
`HttpApiAdapter` layer and supply the platform CLI services when
|
|
327
|
-
running commands. `run` derives the CLI version from the API metadata:
|
|
328
|
-
|
|
329
|
-
```ts
|
|
330
|
-
const { command, run } = yield * makeHttpApiCli();
|
|
331
|
-
yield * run(args);
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
`makeHttpApiCli` is the only public CLI export. `HttpApiCli`, its layer, and the
|
|
335
|
-
custom runners have been removed. Process arguments, platform services, error
|
|
336
|
-
reporting, and exit handling belong to the application's Effect runtime:
|
|
337
|
-
|
|
338
|
-
```ts
|
|
339
|
-
import { NodeRuntime, NodeServices } from "@effect/platform-node";
|
|
340
|
-
|
|
341
|
-
Effect.gen(function* () {
|
|
342
|
-
const { run } = yield* makeHttpApiCli();
|
|
343
|
-
yield* run(process.argv.slice(2));
|
|
344
|
-
}).pipe(
|
|
345
|
-
Effect.provide(adapterLayer),
|
|
346
|
-
Effect.provide(NodeServices.layer),
|
|
347
|
-
NodeRuntime.runMain,
|
|
348
|
-
);
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
Install `@effect/platform-node` matching your Effect version for this example;
|
|
352
|
-
`adapterLayer` supplies the application's `HttpApiAdapter`.
|
|
353
|
-
|
|
354
|
-
For an HTTP MCP server, register the toolkit directly with Effect. Keep the
|
|
355
|
-
transport and server identity in the application:
|
|
356
|
-
|
|
357
|
-
```ts
|
|
358
|
-
import { Effect, Layer } from "effect";
|
|
359
|
-
import { McpProtocol, McpServer } from "effect/ai";
|
|
360
|
-
import { FetchHttpClient } from "effect/http";
|
|
361
|
-
import { HttpApiAdapter } from "@krak-stack/registry/httpapi/adapter";
|
|
362
|
-
import { makeHttpApiToolkit } from "@krak-stack/registry/httpapi/toolkit";
|
|
363
|
-
import { AppApi } from "@/api";
|
|
364
|
-
|
|
365
|
-
export const mcpLayer = Layer.effectDiscard(
|
|
366
|
-
Effect.gen(function* () {
|
|
367
|
-
const { toolkit, handlers } = yield* makeHttpApiToolkit({});
|
|
368
|
-
yield* McpServer.registerToolkit(toolkit).pipe(Effect.provide(handlers));
|
|
369
|
-
}),
|
|
370
|
-
).pipe(
|
|
371
|
-
Layer.provideMerge(
|
|
372
|
-
McpServer.layerHttp({
|
|
373
|
-
name: "app",
|
|
374
|
-
version: "1.0.0",
|
|
375
|
-
path: "/api/mcp",
|
|
376
|
-
protocols: [McpProtocol.v2025_11_25],
|
|
377
|
-
}),
|
|
378
|
-
),
|
|
379
|
-
Layer.provide(
|
|
380
|
-
HttpApiAdapter.layer({
|
|
381
|
-
api: AppApi,
|
|
382
|
-
baseUrl: "http://localhost:3000",
|
|
383
|
-
methods: ["get"],
|
|
384
|
-
}),
|
|
385
|
-
),
|
|
386
|
-
Layer.provide(FetchHttpClient.layer),
|
|
387
|
-
);
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
This example explicitly selects GET operations; `HttpApiAdapter` otherwise includes
|
|
391
|
-
all supported methods. Use `include` to narrow exposure further. Supply an
|
|
392
|
-
authenticated `HttpClient` instead of `FetchHttpClient.layer` when the downstream
|
|
393
|
-
API requires credentials. Inbound MCP authentication and authorization remain
|
|
394
|
-
application-owned; tool annotations are not access controls.
|
|
395
|
-
|
|
396
|
-
If intentionally exposing writes, enforce authorization or confirmation in the
|
|
397
|
-
application before opting out of agent approval with `needsApproval: () => false`.
|
|
398
|
-
Approval requirements are no longer silently disabled by an MCP adapter.
|
|
399
|
-
|
|
400
|
-
The `HttpApiMcp` service, `@krak-stack/registry/httpapi/mcp` export, and
|
|
401
|
-
`@krak-stack/httpapi-mcp` registry item have been removed. Replace them with the
|
|
402
|
-
composition above. Any Effect toolkit can be registered this way; it does not
|
|
403
|
-
need to originate from an HttpApi.
|
|
404
|
-
|
|
405
|
-
Documentation consumers load and compile their application-owned MDX on the
|
|
406
|
-
server, then pass the validated page records to `createDocsSource` and
|
|
407
|
-
`makeDocs`:
|
|
408
|
-
|
|
409
|
-
```ts
|
|
410
|
-
const pages = await loadMdxDocsDirectory("src/content/docs");
|
|
411
|
-
const source = createDocsSource({ pages, locales: ["en", "fr"] });
|
|
412
|
-
```
|
|
413
|
-
|
|
414
|
-
The `@krak-stack/registry/docs/server` export requires the Bun runtime. Keep it
|
|
415
|
-
behind a server-only module or server function so it is not included in browser
|
|
416
|
-
bundles.
|
|
417
|
-
|
|
418
|
-
Add the package's Tailwind source to the application stylesheet:
|
|
23
|
+
For packaged UI components, include the Tailwind source in your application stylesheet:
|
|
419
24
|
|
|
420
25
|
```css
|
|
421
26
|
@import "@krak-stack/registry/tailwind.css";
|
|
422
27
|
```
|
|
423
28
|
|
|
424
|
-
|
|
29
|
+
To install editable source instead of importing the package, use the shadcn registry:
|
|
425
30
|
|
|
426
31
|
```bash
|
|
427
|
-
bunx shadcn@latest add
|
|
32
|
+
bunx shadcn@latest add https://krakstack.net/r/data-table.json
|
|
428
33
|
```
|
|
429
34
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
## Oxlint Plugin
|
|
433
|
-
|
|
434
|
-
Projects that prefer centrally versioned rules can load the compiled anti-slop
|
|
435
|
-
plugin directly from the package:
|
|
436
|
-
|
|
437
|
-
```json
|
|
438
|
-
{
|
|
439
|
-
"jsPlugins": [
|
|
440
|
-
{
|
|
441
|
-
"name": "anti-slop",
|
|
442
|
-
"specifier": "@krak-stack/registry/oxlint/anti-slop"
|
|
443
|
-
}
|
|
444
|
-
]
|
|
445
|
-
}
|
|
446
|
-
```
|
|
35
|
+
## Find components and documentation
|
|
447
36
|
|
|
448
|
-
|
|
449
|
-
|
|
37
|
+
- [KrakStack registry and docs](https://krakstack.net): browse items, dependencies, setup and usage.
|
|
38
|
+
- [Package exports](./package.json): available import subpaths.
|
|
39
|
+
- [Registry definitions](../../registry.json): item names, source files and documentation.
|
|
40
|
+
- [Source code](https://github.com/krakcons/krakstack): implementations and examples.
|
|
41
|
+
- [Changelog](./CHANGELOG.md): package releases.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { type PaginationMessages } from "./pagination.js";
|
|
3
3
|
import type { QueryType } from "../../lib/query.js";
|
|
4
4
|
type RowData = object;
|
|
@@ -19,6 +19,22 @@ export interface DataTableListItem {
|
|
|
19
19
|
label: string;
|
|
20
20
|
value?: string;
|
|
21
21
|
}
|
|
22
|
+
export interface DataTableReferenceItem {
|
|
23
|
+
label: string;
|
|
24
|
+
/** Secondary text, such as a user's email or a record identifier. */
|
|
25
|
+
description?: string | null;
|
|
26
|
+
imageSrc?: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface DataTableReferenceOptions<TData> {
|
|
29
|
+
getItem: (row: TData) => DataTableReferenceItem | null | undefined;
|
|
30
|
+
emptyLabel?: ReactNode;
|
|
31
|
+
imageVariant?: "circle" | "square";
|
|
32
|
+
}
|
|
33
|
+
export declare const DataTableReferenceCell: ({ item, emptyLabel, imageVariant, }: {
|
|
34
|
+
item: DataTableReferenceItem | null | undefined;
|
|
35
|
+
emptyLabel?: ReactNode;
|
|
36
|
+
imageVariant?: "circle" | "square";
|
|
37
|
+
}) => string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null;
|
|
22
38
|
export interface DataTableListOption extends DataTableListItem {
|
|
23
39
|
value: string;
|
|
24
40
|
}
|
|
@@ -147,6 +163,9 @@ type DataTableColumnType<TData> = {
|
|
|
147
163
|
} | {
|
|
148
164
|
type: "boolean";
|
|
149
165
|
typeOptions?: DataTableBooleanOptions<TData>;
|
|
166
|
+
} | {
|
|
167
|
+
type: "reference";
|
|
168
|
+
typeOptions: DataTableReferenceOptions<TData>;
|
|
150
169
|
} | {
|
|
151
170
|
type: "list";
|
|
152
171
|
typeOptions: DataTableListColumn<TData>;
|
|
@@ -983,6 +983,47 @@ var DataTablePersistedUiStateSchema = Schema.Struct({
|
|
|
983
983
|
view: Schema.Literals(["table", "gallery"])
|
|
984
984
|
}).annotate({ identifier: "DataTablePersistedUiState" });
|
|
985
985
|
var dataTableStorageRuntime = Atom.runtime(BrowserKeyValueStore.layerLocalStorage);
|
|
986
|
+
var DataTableReferenceCell = ({
|
|
987
|
+
item,
|
|
988
|
+
emptyLabel = "—",
|
|
989
|
+
imageVariant = "circle"
|
|
990
|
+
}) => {
|
|
991
|
+
const [failedImage, setFailedImage] = useState();
|
|
992
|
+
if (!item)
|
|
993
|
+
return emptyLabel;
|
|
994
|
+
const initials = item.label.trim().split(/\s+/).slice(0, 2).map((word) => word.slice(0, 1)).join("").toLocaleUpperCase();
|
|
995
|
+
return /* @__PURE__ */ jsxs8("div", {
|
|
996
|
+
className: "flex min-w-0 items-center gap-2",
|
|
997
|
+
children: [
|
|
998
|
+
/* @__PURE__ */ jsx14("div", {
|
|
999
|
+
className: cn("bg-muted flex size-8 shrink-0 items-center justify-center overflow-hidden text-xs font-medium", imageVariant === "circle" ? "rounded-full" : "rounded-md"),
|
|
1000
|
+
children: item.imageSrc && item.imageSrc !== failedImage ? /* @__PURE__ */ jsx14("img", {
|
|
1001
|
+
src: item.imageSrc,
|
|
1002
|
+
alt: item.label,
|
|
1003
|
+
className: "size-full object-cover",
|
|
1004
|
+
onError: () => setFailedImage(item.imageSrc ?? undefined)
|
|
1005
|
+
}) : /* @__PURE__ */ jsx14("span", {
|
|
1006
|
+
"aria-hidden": "true",
|
|
1007
|
+
children: initials
|
|
1008
|
+
})
|
|
1009
|
+
}),
|
|
1010
|
+
/* @__PURE__ */ jsxs8("div", {
|
|
1011
|
+
className: "flex min-w-0 flex-col leading-tight",
|
|
1012
|
+
children: [
|
|
1013
|
+
/* @__PURE__ */ jsx14("span", {
|
|
1014
|
+
className: "truncate font-medium",
|
|
1015
|
+
children: item.label
|
|
1016
|
+
}),
|
|
1017
|
+
item.description ? /* @__PURE__ */ jsx14("span", {
|
|
1018
|
+
className: "text-muted-foreground truncate text-xs",
|
|
1019
|
+
children: item.description
|
|
1020
|
+
}) : null
|
|
1021
|
+
]
|
|
1022
|
+
})
|
|
1023
|
+
]
|
|
1024
|
+
});
|
|
1025
|
+
};
|
|
1026
|
+
var referenceText = (item) => item ? [item.label, item.description].filter(Boolean).join(" — ") : "";
|
|
986
1027
|
var messages2 = {
|
|
987
1028
|
en: {
|
|
988
1029
|
...paginationMessages("en"),
|
|
@@ -1112,7 +1153,7 @@ var buildDataTableRows = (rowData, columns, getRowId) => {
|
|
|
1112
1153
|
index,
|
|
1113
1154
|
values: new Map(columns.map((column) => {
|
|
1114
1155
|
const { colDef } = column;
|
|
1115
|
-
const value = colDef.valueGetter ? colDef.valueGetter({ data, rowId: id, rowIndex: index, colDef }) : colDef.type === "list" ? colDef.typeOptions.getItems(data).map((item) => item.label).join(", ") : colDef.field ? data[colDef.field] : undefined;
|
|
1156
|
+
const value = colDef.valueGetter ? colDef.valueGetter({ data, rowId: id, rowIndex: index, colDef }) : colDef.type === "list" ? colDef.typeOptions.getItems(data).map((item) => item.label).join(", ") : colDef.type === "reference" ? referenceText(colDef.typeOptions.getItem(data)) : colDef.field ? data[colDef.field] : undefined;
|
|
1116
1157
|
return [column.id, value];
|
|
1117
1158
|
}))
|
|
1118
1159
|
};
|
|
@@ -1443,6 +1484,15 @@ var renderCell = (row, column, locale = "en", labels = dataTableMessages(locale)
|
|
|
1443
1484
|
...params
|
|
1444
1485
|
});
|
|
1445
1486
|
const colDef = column.colDef;
|
|
1487
|
+
if (colDef.type === "reference") {
|
|
1488
|
+
if (colDef.valueFormatter)
|
|
1489
|
+
return colDef.valueFormatter(params);
|
|
1490
|
+
return /* @__PURE__ */ jsx14(DataTableReferenceCell, {
|
|
1491
|
+
item: colDef.typeOptions.getItem(row.data),
|
|
1492
|
+
emptyLabel: colDef.typeOptions.emptyLabel,
|
|
1493
|
+
imageVariant: colDef.typeOptions.imageVariant
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1446
1496
|
if (colDef.type === "number") {
|
|
1447
1497
|
if (colDef.valueFormatter)
|
|
1448
1498
|
return colDef.valueFormatter(params);
|
|
@@ -3437,6 +3487,7 @@ export {
|
|
|
3437
3487
|
DataTable,
|
|
3438
3488
|
DataTableListCell,
|
|
3439
3489
|
DataTableListSummary,
|
|
3490
|
+
DataTableReferenceCell,
|
|
3440
3491
|
DataTableRowActions,
|
|
3441
3492
|
buildDataTableRows,
|
|
3442
3493
|
dataTableMessages,
|
package/dist/lib/docs.js
CHANGED
|
@@ -410,7 +410,7 @@ var MarkdownContent = ({
|
|
|
410
410
|
dangerouslySetInnerHTML: { __html: remainingHtml }
|
|
411
411
|
}, "html-final"));
|
|
412
412
|
return /* @__PURE__ */ jsx5("div", {
|
|
413
|
-
className: cn("[&_a:hover]:text-primary [&_a]:decoration-border [&_blockquote]:border-primary/40 [&_blockquote]:bg-muted/40 [&_h2_a]:text-muted-foreground [&_h3_a]:text-muted-foreground [&_[data-inline-code]]:bg-muted text-[0.98rem] leading-7 [&_[data-markdown-table]]:overflow-x-auto [&_[data-inline-code]]:rounded [&_[data-inline-code]]:px-1.5 [&_[data-inline-code]]:py-0.5 [&_[data-inline-code]]:font-mono [&_[data-inline-code]]:text-[0.875em] [&_a]:font-medium [&_a]:underline [&_a]:decoration-1 [&_a]:underline-offset-4 [&_a]:transition-colors [&_blockquote]:my-5 [&_blockquote]:rounded-r-lg [&_blockquote]:border-l-4 [&_blockquote]:px-5 [&_blockquote]:py-1 [&_h2]:mt-12 [&_h2]:scroll-mt-20 [&_h2]:border-t [&_h2]:pt-8 [&_h2]:text-2xl [&_h2]:font-bold [&_h2]:tracking-tight [&_h2_a]:ml-2 [&_h2_a]:no-underline [&_h2:first-of-type]:mt-0 [&_h2:first-of-type]:border-t-0 [&_h2:first-of-type]:pt-0 [&_h3]:mt-8 [&_h3]:scroll-mt-20 [&_h3]:text-xl [&_h3]:font-semibold [&_h3]:tracking-tight [&_h3_a]:ml-2 [&_h3_a]:no-underline [&_ol]:my-5 [&_p]:my-5 [&_table]:w-full [&_table]:text-sm [&_td]:border-b [&_td]:p-2 [&_th]:border-b [&_th]:p-2 [&_th]:text-left [&_ul]:my-5", className),
|
|
413
|
+
className: cn("[&_a:hover]:text-primary [&_a]:decoration-border [&_blockquote]:border-primary/40 [&_blockquote]:bg-muted/40 [&_h2_a]:text-muted-foreground [&_h3_a]:text-muted-foreground [&_[data-inline-code]]:bg-muted text-[0.98rem] leading-7 [&_[data-markdown-table]]:overflow-x-auto [&_[data-inline-code]]:rounded [&_[data-inline-code]]:px-1.5 [&_[data-inline-code]]:py-0.5 [&_[data-inline-code]]:font-mono [&_[data-inline-code]]:text-[0.875em] [&_a]:font-medium [&_a]:underline [&_a]:decoration-1 [&_a]:underline-offset-4 [&_a]:transition-colors [&_blockquote]:my-5 [&_blockquote]:rounded-r-lg [&_blockquote]:border-l-4 [&_blockquote]:px-5 [&_blockquote]:py-1 [&_h2]:mt-12 [&_h2]:scroll-mt-20 [&_h2]:border-t [&_h2]:pt-8 [&_h2]:text-2xl [&_h2]:font-bold [&_h2]:tracking-tight [&_h2_a]:ml-2 [&_h2_a]:no-underline [&_h2:first-of-type]:mt-0 [&_h2:first-of-type]:border-t-0 [&_h2:first-of-type]:pt-0 [&_h3]:mt-8 [&_h3]:scroll-mt-20 [&_h3]:text-xl [&_h3]:font-semibold [&_h3]:tracking-tight [&_h3_a]:ml-2 [&_h3_a]:no-underline [&_ol]:my-5 [&_p]:my-5 [&_table]:w-full [&_table]:text-sm [&_td]:border-b [&_td]:p-2 [&_th]:border-b [&_th]:p-2 [&_th]:text-left [&_ul]:my-5", "[&_li]:my-1 [&_li>ol]:my-2 [&_li>p]:my-2 [&_li>ul]:my-2 [&_ol]:list-decimal [&_ol]:ps-6 [&_ul]:list-disc [&_ul]:ps-6", className),
|
|
414
414
|
children: content
|
|
415
415
|
});
|
|
416
416
|
};
|
|
@@ -2011,7 +2011,7 @@ var DocsArticle = ({
|
|
|
2011
2011
|
});
|
|
2012
2012
|
};
|
|
2013
2013
|
var useActiveDocsHeading = (headings) => {
|
|
2014
|
-
const [activeHeadingId, setActiveHeadingId] = useState6(
|
|
2014
|
+
const [activeHeadingId, setActiveHeadingId] = useState6();
|
|
2015
2015
|
useEffect5(() => {
|
|
2016
2016
|
const elements = headings.flatMap((heading) => {
|
|
2017
2017
|
const element = document.getElementById(heading.id);
|
|
@@ -413,7 +413,7 @@ var MarkdownContent = ({
|
|
|
413
413
|
dangerouslySetInnerHTML: { __html: remainingHtml }
|
|
414
414
|
}, "html-final"));
|
|
415
415
|
return /* @__PURE__ */ jsx4("div", {
|
|
416
|
-
className: cn("[&_a:hover]:text-primary [&_a]:decoration-border [&_blockquote]:border-primary/40 [&_blockquote]:bg-muted/40 [&_h2_a]:text-muted-foreground [&_h3_a]:text-muted-foreground [&_[data-inline-code]]:bg-muted text-[0.98rem] leading-7 [&_[data-markdown-table]]:overflow-x-auto [&_[data-inline-code]]:rounded [&_[data-inline-code]]:px-1.5 [&_[data-inline-code]]:py-0.5 [&_[data-inline-code]]:font-mono [&_[data-inline-code]]:text-[0.875em] [&_a]:font-medium [&_a]:underline [&_a]:decoration-1 [&_a]:underline-offset-4 [&_a]:transition-colors [&_blockquote]:my-5 [&_blockquote]:rounded-r-lg [&_blockquote]:border-l-4 [&_blockquote]:px-5 [&_blockquote]:py-1 [&_h2]:mt-12 [&_h2]:scroll-mt-20 [&_h2]:border-t [&_h2]:pt-8 [&_h2]:text-2xl [&_h2]:font-bold [&_h2]:tracking-tight [&_h2_a]:ml-2 [&_h2_a]:no-underline [&_h2:first-of-type]:mt-0 [&_h2:first-of-type]:border-t-0 [&_h2:first-of-type]:pt-0 [&_h3]:mt-8 [&_h3]:scroll-mt-20 [&_h3]:text-xl [&_h3]:font-semibold [&_h3]:tracking-tight [&_h3_a]:ml-2 [&_h3_a]:no-underline [&_ol]:my-5 [&_p]:my-5 [&_table]:w-full [&_table]:text-sm [&_td]:border-b [&_td]:p-2 [&_th]:border-b [&_th]:p-2 [&_th]:text-left [&_ul]:my-5", className),
|
|
416
|
+
className: cn("[&_a:hover]:text-primary [&_a]:decoration-border [&_blockquote]:border-primary/40 [&_blockquote]:bg-muted/40 [&_h2_a]:text-muted-foreground [&_h3_a]:text-muted-foreground [&_[data-inline-code]]:bg-muted text-[0.98rem] leading-7 [&_[data-markdown-table]]:overflow-x-auto [&_[data-inline-code]]:rounded [&_[data-inline-code]]:px-1.5 [&_[data-inline-code]]:py-0.5 [&_[data-inline-code]]:font-mono [&_[data-inline-code]]:text-[0.875em] [&_a]:font-medium [&_a]:underline [&_a]:decoration-1 [&_a]:underline-offset-4 [&_a]:transition-colors [&_blockquote]:my-5 [&_blockquote]:rounded-r-lg [&_blockquote]:border-l-4 [&_blockquote]:px-5 [&_blockquote]:py-1 [&_h2]:mt-12 [&_h2]:scroll-mt-20 [&_h2]:border-t [&_h2]:pt-8 [&_h2]:text-2xl [&_h2]:font-bold [&_h2]:tracking-tight [&_h2_a]:ml-2 [&_h2_a]:no-underline [&_h2:first-of-type]:mt-0 [&_h2:first-of-type]:border-t-0 [&_h2:first-of-type]:pt-0 [&_h3]:mt-8 [&_h3]:scroll-mt-20 [&_h3]:text-xl [&_h3]:font-semibold [&_h3]:tracking-tight [&_h3_a]:ml-2 [&_h3_a]:no-underline [&_ol]:my-5 [&_p]:my-5 [&_table]:w-full [&_table]:text-sm [&_td]:border-b [&_td]:p-2 [&_th]:border-b [&_th]:p-2 [&_th]:text-left [&_ul]:my-5", "[&_li]:my-1 [&_li>ol]:my-2 [&_li>p]:my-2 [&_li>ul]:my-2 [&_ol]:list-decimal [&_ol]:ps-6 [&_ul]:list-disc [&_ul]:ps-6", className),
|
|
417
417
|
children: content
|
|
418
418
|
});
|
|
419
419
|
};
|