@krak-stack/registry 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +19 -0
  2. package/dist/components/ui/app-brand.d.ts +18 -13
  3. package/dist/components/ui/app-brand.js +48 -15
  4. package/dist/components/ui/code-block.js +10 -6
  5. package/dist/components/ui/copy-button.d.ts +1 -1
  6. package/dist/components/ui/copy-button.js +1 -1
  7. package/dist/components/ui/data-table.d.ts +1 -1
  8. package/dist/components/ui/data-table.js +21 -20
  9. package/dist/components/ui/effect-form.js +7 -6
  10. package/dist/components/ui/file-picker.js +2 -1
  11. package/dist/components/ui/form.js +17 -15
  12. package/dist/components/ui/google-map.d.ts +6 -10
  13. package/dist/components/ui/google-map.js +19 -14
  14. package/dist/components/ui/locale-switcher.js +7 -1
  15. package/dist/components/ui/sidebar-layout.js +19 -21
  16. package/dist/components/ui/theme-switcher.js +1 -1
  17. package/dist/lib/docs-core.js +165 -109
  18. package/dist/lib/documentation-toolkit.d.ts +1 -1
  19. package/dist/lib/documentation-toolkit.js +41 -40
  20. package/dist/lib/httpapi-cli.d.ts +6 -6
  21. package/dist/lib/httpapi-cli.js +83 -48
  22. package/dist/lib/httpapi-client.d.ts +11 -2
  23. package/dist/lib/httpapi-client.js +29 -9
  24. package/dist/lib/httpapi-helpers.d.ts +15 -21
  25. package/dist/lib/httpapi-helpers.js +38 -26
  26. package/dist/lib/httpapi-mcp.js +81 -50
  27. package/dist/lib/httpapi-toolkit.d.ts +3 -2
  28. package/dist/lib/httpapi-toolkit.js +101 -65
  29. package/dist/lib/seo.js +29 -17
  30. package/dist/oxlint/anti-slop/index.js +1592 -0
  31. package/dist/services/agent/client/atom.d.ts +7 -7
  32. package/dist/services/agent/client/index.js +100 -62
  33. package/dist/services/agent/index.d.ts +71 -71
  34. package/dist/services/agent/index.js +38 -19
  35. package/dist/services/notification/channels/index.d.ts +11 -9
  36. package/dist/services/notification/channels/ses/index.d.ts +6 -6
  37. package/dist/services/notification/channels/ses/index.js +15 -11
  38. package/dist/services/notification/client/index.js +3 -2
  39. package/dist/services/notification/client/notification-menu.d.ts +9 -9
  40. package/dist/services/notification/index.d.ts +7 -6
  41. package/dist/services/notification/public.js +3 -2
  42. package/dist/services/s3/index.d.ts +2 -16
  43. package/dist/services/s3/index.js +12 -9
  44. package/package.json +7 -1
@@ -1,5 +1,5 @@
1
1
  import { Config, Context, Effect, Layer, Redacted } from "effect";
2
- import { type NotificationChannelShape } from "..";
2
+ import { type NotificationChannel } from "..";
3
3
  import { SesEmailNotification } from "./schema.js";
4
4
  declare module ".." {
5
5
  interface NotificationChannels {
@@ -14,17 +14,17 @@ interface SesIdentity {
14
14
  readonly region: string;
15
15
  readonly from: string | undefined;
16
16
  }
17
- interface SesNotificationConfigShape {
17
+ interface SesNotificationConfigService {
18
18
  readonly identity: SesIdentity;
19
19
  readonly accessKey: SesAccessKey;
20
20
  }
21
- declare const SesNotificationConfig_base: Context.ServiceClass<SesNotificationConfig, "SesNotificationConfig", SesNotificationConfigShape> & {
22
- readonly make: Effect.Effect<SesNotificationConfigShape, Config.ConfigError, never>;
21
+ declare const SesNotificationConfig_base: Context.ServiceClass<SesNotificationConfig, "SesNotificationConfig", SesNotificationConfigService> & {
22
+ readonly make: Effect.Effect<SesNotificationConfigService, Config.ConfigError, never>;
23
23
  };
24
24
  export declare class SesNotificationConfig extends SesNotificationConfig_base {
25
25
  static readonly layer: Layer.Layer<SesNotificationConfig, Config.ConfigError, never>;
26
26
  }
27
- declare const SesNotificationChannel_base: Context.ServiceClass<SesNotificationChannel, "SesNotificationChannel", NotificationChannelShape<"email", {
27
+ declare const SesNotificationChannel_base: Context.ServiceClass<SesNotificationChannel, "SesNotificationChannel", NotificationChannel<"email", {
28
28
  readonly from?: string | undefined;
29
29
  readonly to: string | readonly [string, ...string[]];
30
30
  readonly cc?: readonly string[] | undefined;
@@ -34,7 +34,7 @@ declare const SesNotificationChannel_base: Context.ServiceClass<SesNotificationC
34
34
  readonly text?: string | undefined;
35
35
  readonly html?: string | undefined;
36
36
  }>> & {
37
- readonly make: Effect.Effect<NotificationChannelShape<"email", {
37
+ readonly make: Effect.Effect<NotificationChannel<"email", {
38
38
  readonly from?: string | undefined;
39
39
  readonly to: string | readonly [string, ...string[]];
40
40
  readonly cc?: readonly string[] | undefined;
@@ -106,7 +106,7 @@ class SesNotificationChannel extends Context.Service()("SesNotificationChannel",
106
106
  FromEmailAddress: from,
107
107
  Destination: buildDestination(email),
108
108
  Content: { Simple: emailMessage },
109
- ...email.replyTo?.length ? { ReplyToAddresses: Array.from(email.replyTo) } : {}
109
+ ReplyToAddresses: email.replyTo?.length ? Array.from(email.replyTo) : undefined
110
110
  })),
111
111
  catch: (error) => notificationSendError("Failed to send SES email", error)
112
112
  });
@@ -119,7 +119,7 @@ class SesNotificationChannel extends Context.Service()("SesNotificationChannel",
119
119
  var notificationSendError = (message, error) => new NotificationSendError({
120
120
  channel: "email",
121
121
  message,
122
- ...error === undefined ? {} : { error }
122
+ error
123
123
  });
124
124
  var decodeEmail = (payload) => Schema3.decodeUnknownEffect(SesEmailNotification)(payload).pipe(Effect.mapError((error) => notificationSendError("Invalid SES email notification payload", error)));
125
125
  var requireBody = (email) => {
@@ -127,18 +127,22 @@ var requireBody = (email) => {
127
127
  if (!html && !text) {
128
128
  return Effect.fail(notificationSendError("SES email notification requires text or html"));
129
129
  }
130
- const body = {
131
- ...text ? { Text: { Data: text, Charset: "UTF-8" } } : {},
132
- ...html ? { Html: { Data: html, Charset: "UTF-8" } } : {}
133
- };
130
+ const body = {};
131
+ if (text)
132
+ body.Text = { Data: text, Charset: "UTF-8" };
133
+ if (html)
134
+ body.Html = { Data: html, Charset: "UTF-8" };
134
135
  return Effect.succeed(body);
135
136
  };
136
137
  var recipients = (to) => Array.isArray(to) ? Array.from(to) : [to];
137
- var buildDestination = (email) => ({
138
- ToAddresses: recipients(email.to),
139
- ...email.cc?.length ? { CcAddresses: Array.from(email.cc) } : {},
140
- ...email.bcc?.length ? { BccAddresses: Array.from(email.bcc) } : {}
141
- });
138
+ var buildDestination = (email) => {
139
+ const destination = { ToAddresses: recipients(email.to) };
140
+ if (email.cc?.length)
141
+ destination.CcAddresses = Array.from(email.cc);
142
+ if (email.bcc?.length)
143
+ destination.BccAddresses = Array.from(email.bcc);
144
+ return destination;
145
+ };
142
146
  export {
143
147
  SesNotificationConfig,
144
148
  SesNotificationChannel
@@ -8,6 +8,7 @@ import {
8
8
  TriangleAlert
9
9
  } from "lucide-react";
10
10
  import { useState } from "react";
11
+ import { Schema } from "effect";
11
12
 
12
13
  // ../../src/components/ui/badge.tsx
13
14
  import { mergeProps } from "@base-ui/react/merge-props";
@@ -974,7 +975,7 @@ function NotificationListItem({
974
975
  onNavigate(notification);
975
976
  return;
976
977
  }
977
- if (notification.href && typeof window !== "undefined") {
978
+ if (notification.href && globalThis.window) {
978
979
  window.location.assign(notification.href);
979
980
  }
980
981
  };
@@ -1112,7 +1113,7 @@ var formatNotificationDate = (value, locale) => {
1112
1113
  timeStyle: "short"
1113
1114
  }).format(date);
1114
1115
  };
1115
- var notificationTitle = (notification) => typeof notification.title === "string" ? notification.title : defaultMessages.en.notifications;
1116
+ var notificationTitle = (notification) => Schema.is(Schema.String)(notification.title) ? notification.title : defaultMessages.en.notifications;
1116
1117
  export {
1117
1118
  notificationMenuMessages,
1118
1119
  NotificationMenuTrigger,
@@ -32,8 +32,8 @@ export type NotificationMenuState = {
32
32
  open: boolean;
33
33
  unreadCount: number;
34
34
  };
35
- type NotificationAction = (notificationIds: readonly string[]) => Promise<unknown> | unknown;
36
- export type NotificationMenuProps = {
35
+ type NotificationAction<Result = ErrorOptions["cause"]> = (notificationIds: readonly string[]) => Promise<Result> | Result | void;
36
+ export type NotificationMenuProps<ActionResult = ErrorOptions["cause"]> = {
37
37
  className?: string | undefined;
38
38
  defaultOpen?: boolean | undefined;
39
39
  error?: boolean | undefined;
@@ -42,35 +42,35 @@ export type NotificationMenuProps = {
42
42
  markReadOnOpen?: boolean | undefined;
43
43
  messages?: Partial<NotificationMenuMessages> | undefined;
44
44
  notifications: readonly NotificationItem[];
45
- onArchive?: NotificationAction | undefined;
46
- onMarkRead?: NotificationAction | undefined;
45
+ onArchive?: NotificationAction<ActionResult> | undefined;
46
+ onMarkRead?: NotificationAction<ActionResult> | undefined;
47
47
  onNavigate?: ((notification: NotificationItem) => void) | undefined;
48
48
  onOpenChange?: ((open: boolean) => void) | undefined;
49
49
  open?: boolean | undefined;
50
50
  renderItem?: ((notification: NotificationItem) => ReactNode) | undefined;
51
51
  renderTrigger?: ((state: NotificationMenuState) => ReactElement) | undefined;
52
52
  };
53
- export declare function NotificationMenu({ className, defaultOpen, error, isLoading, locale, markReadOnOpen, messages: messageOverrides, notifications, onArchive, onMarkRead, onNavigate, onOpenChange, open: controlledOpen, renderItem, renderTrigger, }: NotificationMenuProps): import("react").JSX.Element;
53
+ export declare function NotificationMenu<ActionResult = ErrorOptions["cause"]>({ className, defaultOpen, error, isLoading, locale, markReadOnOpen, messages: messageOverrides, notifications, onArchive, onMarkRead, onNavigate, onOpenChange, open: controlledOpen, renderItem, renderTrigger, }: NotificationMenuProps<ActionResult>): import("react").JSX.Element;
54
54
  export declare function NotificationMenuTrigger({ labels, unreadCount, }: {
55
55
  labels?: NotificationMenuMessages | undefined;
56
56
  unreadCount: number;
57
57
  }): import("react").JSX.Element;
58
- export declare function NotificationList({ error, isLoading, labels, locale, notifications, onArchive, onNavigate, renderItem, tab, }: {
58
+ export declare function NotificationList<ActionResult>({ error, isLoading, labels, locale, notifications, onArchive, onNavigate, renderItem, tab, }: {
59
59
  error: boolean;
60
60
  isLoading: boolean;
61
61
  labels: NotificationMenuMessages;
62
62
  locale: string;
63
63
  notifications: readonly NotificationItem[];
64
- onArchive?: NotificationAction | undefined;
64
+ onArchive?: NotificationAction<ActionResult> | undefined;
65
65
  onNavigate?: ((notification: NotificationItem) => void) | undefined;
66
66
  renderItem?: ((notification: NotificationItem) => ReactNode) | undefined;
67
67
  tab: NotificationMenuTab;
68
68
  }): import("react").JSX.Element;
69
- export declare function NotificationListItem({ labels, locale, notification, onArchive, onNavigate, renderItem, }: {
69
+ export declare function NotificationListItem<ActionResult>({ labels, locale, notification, onArchive, onNavigate, renderItem, }: {
70
70
  labels: NotificationMenuMessages;
71
71
  locale: string;
72
72
  notification: NotificationItem;
73
- onArchive?: NotificationAction | undefined;
73
+ onArchive?: NotificationAction<ActionResult> | undefined;
74
74
  onNavigate?: ((notification: NotificationItem) => void) | undefined;
75
75
  renderItem?: ((notification: NotificationItem) => ReactNode) | undefined;
76
76
  }): import("react").JSX.Element;
@@ -1,16 +1,17 @@
1
1
  import { Context, Effect, Layer } from "effect";
2
- import { NotificationChannelRegistry, type NotificationMessage, type NotificationChannelShape } from "./channels/index.js";
2
+ import { NotificationChannelRegistry, type NotificationMessage, type NotificationChannel } from "./channels/index.js";
3
3
  import { NotificationSendError } from "./schema.js";
4
- export interface NotificationServiceShape {
4
+ export interface NotificationServiceContract {
5
5
  readonly send: (message: NotificationMessage) => Effect.Effect<void, NotificationSendError>;
6
6
  }
7
- declare const NotificationService_base: Context.ServiceClass<NotificationService, "NotificationService", NotificationServiceShape> & {
8
- readonly make: Effect.Effect<NotificationServiceShape, never, NotificationChannelRegistry>;
7
+ /** @deprecated Use NotificationServiceContract. */
8
+ export { type NotificationServiceContract as NotificationServiceShape };
9
+ declare const NotificationService_base: Context.ServiceClass<NotificationService, "NotificationService", NotificationServiceContract> & {
10
+ readonly make: Effect.Effect<NotificationServiceContract, never, NotificationChannelRegistry>;
9
11
  };
10
12
  export declare class NotificationService extends NotificationService_base {
11
13
  static readonly layer: Layer.Layer<NotificationService, never, NotificationChannelRegistry>;
12
- static readonly makeLayer: (channels: ReadonlyArray<NotificationChannelShape>) => Layer.Layer<NotificationService, never, never>;
14
+ static readonly makeLayer: (channels: ReadonlyArray<NotificationChannel>) => Layer.Layer<NotificationService, never, never>;
13
15
  static readonly noopLayer: Layer.Layer<NotificationService, never, never>;
14
16
  static readonly localLayer: Layer.Layer<NotificationService, never, never>;
15
17
  }
16
- export {};
@@ -78,6 +78,7 @@ import {
78
78
  TriangleAlert
79
79
  } from "lucide-react";
80
80
  import { useState } from "react";
81
+ import { Schema as Schema2 } from "effect";
81
82
 
82
83
  // ../../src/components/ui/badge.tsx
83
84
  import { mergeProps } from "@base-ui/react/merge-props";
@@ -1044,7 +1045,7 @@ function NotificationListItem({
1044
1045
  onNavigate(notification);
1045
1046
  return;
1046
1047
  }
1047
- if (notification.href && typeof window !== "undefined") {
1048
+ if (notification.href && globalThis.window) {
1048
1049
  window.location.assign(notification.href);
1049
1050
  }
1050
1051
  };
@@ -1182,7 +1183,7 @@ var formatNotificationDate = (value, locale) => {
1182
1183
  timeStyle: "short"
1183
1184
  }).format(date);
1184
1185
  };
1185
- var notificationTitle = (notification) => typeof notification.title === "string" ? notification.title : defaultMessages.en.notifications;
1186
+ var notificationTitle = (notification) => Schema2.is(Schema2.String)(notification.title) ? notification.title : defaultMessages.en.notifications;
1186
1187
  export {
1187
1188
  notificationMenuMessages,
1188
1189
  NotificationService,
@@ -1,24 +1,10 @@
1
1
  import { Config, Context, Effect, Layer } from "effect";
2
2
  import { S3ServiceError } from "./schema.js";
3
3
  declare const S3ServiceConfig_base: Context.ServiceClass<S3ServiceConfig, "S3ServiceConfig", {
4
- options: {
5
- accessKeyId: string;
6
- secretAccessKey: string;
7
- bucket: string;
8
- region?: string | undefined;
9
- endpoint?: string | undefined;
10
- sessionToken?: string | undefined;
11
- };
4
+ options: Bun.S3Options;
12
5
  }> & {
13
6
  readonly make: Effect.Effect<{
14
- options: {
15
- accessKeyId: string;
16
- secretAccessKey: string;
17
- bucket: string;
18
- region?: string | undefined;
19
- endpoint?: string | undefined;
20
- sessionToken?: string | undefined;
21
- };
7
+ options: Bun.S3Options;
22
8
  }, Config.ConfigError, never>;
23
9
  };
24
10
  export declare class S3ServiceConfig extends S3ServiceConfig_base {
@@ -43,16 +43,19 @@ class S3ServiceConfig extends Context.Service()("S3ServiceConfig", {
43
43
  const region = yield* Config.string("S3_REGION").pipe(Config.withDefault(""));
44
44
  const endpoint = yield* Config.string("S3_ENDPOINT").pipe(Config.withDefault(""));
45
45
  const sessionToken = yield* Config.redacted("S3_SESSION_TOKEN").pipe(Config.orElse(() => Config.succeed(Redacted.make(""))));
46
- return {
47
- options: {
48
- accessKeyId: Redacted.value(accessKeyId),
49
- secretAccessKey: Redacted.value(secretAccessKey),
50
- bucket,
51
- ...region ? { region } : {},
52
- ...endpoint ? { endpoint } : {},
53
- ...Redacted.value(sessionToken) ? { sessionToken: Redacted.value(sessionToken) } : {}
54
- }
46
+ const options = {
47
+ accessKeyId: Redacted.value(accessKeyId),
48
+ secretAccessKey: Redacted.value(secretAccessKey),
49
+ bucket
55
50
  };
51
+ if (region)
52
+ options.region = region;
53
+ if (endpoint)
54
+ options.endpoint = endpoint;
55
+ if (Redacted.value(sessionToken)) {
56
+ options.sessionToken = Redacted.value(sessionToken);
57
+ }
58
+ return { options };
56
59
  })
57
60
  }) {
58
61
  static layer = Layer.effect(this, this.make);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krak-stack/registry",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Tree-shakable KrakStack components and Effect services.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -68,6 +68,9 @@
68
68
  "types": "./dist/lib/seo.d.ts",
69
69
  "import": "./dist/lib/seo.js"
70
70
  },
71
+ "./oxlint/anti-slop": {
72
+ "import": "./dist/oxlint/anti-slop/index.js"
73
+ },
71
74
  "./app-brand": {
72
75
  "types": "./dist/components/ui/app-brand.d.ts",
73
76
  "import": "./dist/components/ui/app-brand.js"
@@ -206,6 +209,9 @@
206
209
  "build": "NODE_ENV=production bun run build.ts",
207
210
  "prepack": "bun run build"
208
211
  },
212
+ "dependencies": {
213
+ "@oxlint/plugins": "1.78.0"
214
+ },
209
215
  "peerDependencies": {
210
216
  "@aws-sdk/client-sesv2": "^3.1068.0",
211
217
  "@base-ui/react": "^1.5.0",