@krak-stack/registry 0.1.60 → 0.2.0

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 (93) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/components/ui/app-brand.js +17 -17
  3. package/dist/components/ui/code-block.js +6 -6
  4. package/dist/components/ui/color-picker.d.ts +30 -0
  5. package/dist/components/ui/color-picker.js +386 -0
  6. package/dist/components/ui/copy-button.js +4 -4
  7. package/dist/components/ui/data-table.js +468 -455
  8. package/dist/components/ui/editing-locale-switcher.js +10 -10
  9. package/dist/components/ui/effect-form.js +186 -185
  10. package/dist/components/ui/error-component.js +10 -18
  11. package/dist/components/ui/file-picker.js +2 -2
  12. package/dist/components/ui/form.d.ts +131 -335
  13. package/dist/components/ui/form.js +137 -136
  14. package/dist/components/ui/google-map.js +38 -6
  15. package/dist/components/ui/icon-input.js +48 -45
  16. package/dist/components/ui/krakstack-provider.js +2 -2
  17. package/dist/components/ui/locale-switcher.js +4 -4
  18. package/dist/components/ui/pagination.js +2 -2
  19. package/dist/components/ui/search-menu.js +2 -2
  20. package/dist/components/ui/sidebar-layout.js +82 -80
  21. package/dist/components/ui/theme-switcher.js +6 -6
  22. package/dist/components/ui/virtualized-combobox.js +34 -31
  23. package/dist/lib/docs.d.ts +2 -2
  24. package/dist/lib/docs.js +187 -185
  25. package/dist/lib/docs.server.js +45 -23
  26. package/dist/lib/documentation-toolkit.d.ts +2 -2
  27. package/dist/lib/documentation-toolkit.js +45 -23
  28. package/dist/lib/httpapi-adapter.d.ts +11 -3
  29. package/dist/lib/httpapi-adapter.js +42 -15
  30. package/dist/lib/httpapi-cli.d.ts +13 -4
  31. package/dist/lib/httpapi-cli.js +70 -28
  32. package/dist/lib/httpapi-toolkit.js +40 -13
  33. package/dist/lib/query.d.ts +4 -4
  34. package/dist/lib/query.js +13 -13
  35. package/dist/lib/seo.js +2 -2
  36. package/dist/lib/webfetch-toolkit.js +7 -7
  37. package/dist/oxlint/anti-slop/index.js +2 -2
  38. package/dist/services/agent/client/index.js +155 -153
  39. package/dist/services/agent/index.js +3 -3
  40. package/dist/services/agent/schema.js +5 -5
  41. package/dist/services/events/browser.js +38 -23
  42. package/dist/services/events/client/audit-log-table.js +472 -459
  43. package/dist/services/events/client/tracking-notice.js +9 -4
  44. package/dist/services/events/index.d.ts +3 -1
  45. package/dist/services/events/index.js +79 -74
  46. package/dist/services/events/migrations.js +2 -2
  47. package/dist/services/events/record.js +2 -2
  48. package/dist/services/events/schema.d.ts +18 -10
  49. package/dist/services/events/schema.js +42 -42
  50. package/dist/services/file-extraction/index.js +4 -4
  51. package/dist/services/file-extraction/schema.d.ts +3 -1
  52. package/dist/services/file-extraction/schema.js +2 -2
  53. package/dist/services/health/api.builder.d.ts +8 -8
  54. package/dist/services/health/api.group.d.ts +8 -8
  55. package/dist/services/health/index.d.ts +10 -6
  56. package/dist/services/health/index.js +17 -13
  57. package/dist/services/health/schema.d.ts +7 -7
  58. package/dist/services/notification/channels/ses/index.js +2 -2
  59. package/dist/services/notification/channels/ses/schema.js +2 -2
  60. package/dist/services/notification/client/index.js +5 -5
  61. package/dist/services/notification/index.js +3 -3
  62. package/dist/services/notification/persistence/drizzle.js +2 -2
  63. package/dist/services/notification/persistence/index.js +15 -15
  64. package/dist/services/notification/persistence/schema.js +12 -12
  65. package/dist/services/notification/public.js +8 -8
  66. package/dist/services/notification/schema.d.ts +3 -1
  67. package/dist/services/notification/schema.js +2 -2
  68. package/dist/services/opentelemetry/api.js +7 -5
  69. package/dist/services/opentelemetry/browser.js +9 -9
  70. package/dist/services/opentelemetry/index.js +2 -2
  71. package/dist/services/opentelemetry/processor.d.ts +3 -1
  72. package/dist/services/opentelemetry/web-vitals.js +12 -7
  73. package/dist/services/s3/index.js +2 -2
  74. package/dist/services/s3/schema.d.ts +3 -1
  75. package/dist/services/s3/schema.js +2 -2
  76. package/dist/services/speech/api.js +3 -1
  77. package/dist/services/speech/index.js +15 -8
  78. package/dist/services/speech/schema.d.ts +3 -1
  79. package/dist/services/speech/schema.js +12 -10
  80. package/dist/services/webhooks/client/delivery-table.d.ts +62 -0
  81. package/dist/services/webhooks/client/delivery-table.js +4711 -0
  82. package/dist/services/webhooks/http-client.d.ts +1 -0
  83. package/dist/services/webhooks/http-client.js +17 -5
  84. package/dist/services/webhooks/index.d.ts +2 -0
  85. package/dist/services/webhooks/index.js +249 -114
  86. package/dist/services/webhooks/migrations.d.ts +3 -0
  87. package/dist/services/webhooks/migrations.js +21 -2
  88. package/dist/services/webhooks/receiver.d.ts +45 -0
  89. package/dist/services/webhooks/schema.d.ts +15 -5
  90. package/dist/services/webhooks/schema.js +41 -21
  91. package/dist/services/webhooks/url.d.ts +5 -0
  92. package/dist/services/webhooks/url.js +18 -2
  93. package/package.json +10 -1
@@ -92,7 +92,7 @@ class AgentHistoryError extends Data.TaggedError("AgentHistoryError") {
92
92
  var AgentStreamErrorDetails = Schema.Struct({
93
93
  message: Schema.optional(Schema.String),
94
94
  reason: Schema.optional(Schema.String),
95
- status: Schema.optional(Schema.Number),
95
+ status: Schema.optional(Schema.Finite),
96
96
  _tag: Schema.optional(Schema.String)
97
97
  }).annotate({ identifier: "AgentStreamErrorDetails" });
98
98
  var decodeAgentStreamErrorDetails = Schema.decodeUnknownOption(AgentStreamErrorDetails);
@@ -284,8 +284,8 @@ class AgentService extends Context.Service()("AgentService", {
284
284
  }));
285
285
  });
286
286
  const complete = Stream.fromEffect(Effect.gen(function* () {
287
- const history = yield* conversation.exportJson;
288
- return { type: "history", value: history };
287
+ const history2 = yield* conversation.exportJson;
288
+ return { type: "history", value: history2 };
289
289
  })).pipe(Stream.concat(Stream.succeed({ type: "finish" })));
290
290
  const response = Stream.concat(renderedRounds, complete).pipe(Stream.provideService(LanguageModel.LanguageModel, model), Stream.catch((error) => Stream.fromEffect(Effect.logError("Agent stream failed", streamErrorDetails(error))).pipe(Stream.drain, Stream.concat(Stream.make({
291
291
  type: "error",
@@ -133,10 +133,10 @@ var makeAgentApiGroup = (resource) => {
133
133
  })));
134
134
  };
135
135
  export {
136
- AGENT_REFERENCE_LIMIT,
137
- AgentEvent,
138
- AgentMarkdownCodeBlock,
139
- AgentToolMetadata,
136
+ makeAgentReference,
140
137
  makeAgentApiGroup,
141
- makeAgentReference
138
+ AgentToolMetadata,
139
+ AgentMarkdownCodeBlock,
140
+ AgentEvent,
141
+ AGENT_REFERENCE_LIMIT
142
142
  };
@@ -109,7 +109,7 @@ class OtlpEvents extends Context.Service()("krakstack/opentelemetry/Events") {
109
109
  }));
110
110
  }
111
111
  var event = Effect.fnUntraced(function* (name, properties, options) {
112
- const decoded = yield* Schema2.decodeUnknownEffect(TelemetryEvent)({
112
+ const decoded = yield* Schema2.decodeEffect(TelemetryEvent)({
113
113
  name,
114
114
  properties,
115
115
  options
@@ -148,8 +148,11 @@ var event = Effect.fnUntraced(function* (name, properties, options) {
148
148
  import { Context as Context2, Effect as Effect5, FiberSet, Layer as Layer2, Option as Option5, Schema as Schema6 } from "effect";
149
149
 
150
150
  // ../../src/services/opentelemetry/consent.ts
151
+ import * as Data from "effect/Data";
151
152
  import { SecureRandom } from "effect/crypto";
152
153
  import { Effect as Effect2, Option as Option2, Schema as Schema3 } from "effect";
154
+ class AnalyticsPreferenceStorageError extends Data.TaggedError("AnalyticsPreferenceStorageError") {
155
+ }
153
156
  var ANALYTICS_CONSENT_COOKIE = "krakstack_analytics_consent";
154
157
  var ANALYTICS_NOTICE_VERSION = "1";
155
158
  var changedEvent = "krakstack:analytics-consent";
@@ -160,7 +163,7 @@ var analyticsPreference = (cookie, now = Date.now()) => {
160
163
  const value = readCookie(cookie);
161
164
  if (!value)
162
165
  return;
163
- const decoded = Schema3.decodeUnknownOption(codec)(value);
166
+ const decoded = Schema3.decodeOption(codec)(value);
164
167
  if (Option2.isNone(decoded))
165
168
  return;
166
169
  const preference = decoded.value;
@@ -177,8 +180,10 @@ var browserPreference = () => {
177
180
  return;
178
181
  const cookie = Effect2.runSync(Effect2.try({
179
182
  try: () => document.cookie,
180
- catch: () => new Error("Analytics preference storage unavailable")
181
- }).pipe(Effect2.catch(() => Effect2.succeed(""))));
183
+ catch: () => new AnalyticsPreferenceStorageError({
184
+ message: "Analytics preference storage unavailable"
185
+ })
186
+ }).pipe(Effect2.orElseSucceed(() => "")));
182
187
  return analyticsPreference(cookie);
183
188
  };
184
189
  var consentGeneration = 0;
@@ -361,11 +366,11 @@ var ColumnFilters = Schema4.declare(Schema4.is(ColumnFiltersArray), {
361
366
  toCodecStringTree: () => Schema4.link()(Schema4.fromJsonString(ColumnFiltersArray), SchemaTransformation.passthrough())
362
367
  });
363
368
  var Query = Schema4.Struct({
364
- page: Schema4.optional(Schema4.Union([Schema4.Number, Schema4.NumberFromString]).check(Schema4.isInt(), Schema4.isGreaterThanOrEqualTo(0))).pipe(Schema4.decodeTo(Schema4.Int.check(Schema4.isGreaterThanOrEqualTo(0)), {
369
+ page: Schema4.optional(Schema4.Union([Schema4.Finite, Schema4.FiniteFromString]).check(Schema4.isInt(), Schema4.isGreaterThanOrEqualTo(0))).pipe(Schema4.decodeTo(Schema4.Int.check(Schema4.isGreaterThanOrEqualTo(0)), {
365
370
  decode: SchemaGetter.withDefault(Effect3.succeed(0)),
366
371
  encode: SchemaGetter.transformOptional(Option3.filter((page) => page !== 0))
367
372
  })),
368
- pageSize: Schema4.optional(Schema4.Union([Schema4.Number, Schema4.NumberFromString]).check(Schema4.isInt(), Schema4.isBetween({ minimum: 1, maximum: 100 }))).pipe(Schema4.decodeTo(Schema4.Int.check(Schema4.isBetween({ minimum: 1, maximum: 100 })), {
373
+ pageSize: Schema4.optional(Schema4.Union([Schema4.Finite, Schema4.FiniteFromString]).check(Schema4.isInt(), Schema4.isBetween({ minimum: 1, maximum: 100 }))).pipe(Schema4.decodeTo(Schema4.Int.check(Schema4.isBetween({ minimum: 1, maximum: 100 })), {
369
374
  decode: SchemaGetter.withDefault(Effect3.succeed(20)),
370
375
  encode: SchemaGetter.transformOptional(Option3.filter((pageSize) => pageSize !== 20))
371
376
  })),
@@ -409,7 +414,7 @@ var EventIdentity = Schema5.Struct({
409
414
  userId: Schema5.optional(Schema5.NonEmptyString),
410
415
  organizationId: Schema5.optional(Schema5.NonEmptyString)
411
416
  }).annotate({ identifier: "EventIdentity" });
412
- var EventIpAddress = Schema5.String.check(Schema5.makeFilter((value) => Option4.isSome(Schema5.decodeUnknownOption(Schema5.IpAddressFromString)(value)) || "Invalid IP address")).annotate({ identifier: "EventIpAddress" });
417
+ var EventIpAddress = Schema5.String.check(Schema5.makeFilter((value) => Option4.isSome(Schema5.decodeOption(Schema5.IpAddressFromString)(value)) || "Invalid IP address")).annotate({ identifier: "EventIpAddress" });
413
418
  var EventCountry = Schema5.String.check(Schema5.isPattern(/^[A-Z]{2}$/), Schema5.makeFilter((value) => !["XX", "T1"].includes(value) || "Unknown country")).annotate({ identifier: "EventCountry" });
414
419
  var EventRegion = Schema5.String.check(Schema5.isPattern(/^[A-Z0-9]{1,3}$/)).annotate({ identifier: "EventRegion" });
415
420
  var EventCity = Schema5.NonEmptyString.check(Schema5.isMaxLength(128)).annotate({ identifier: "EventCity" });
@@ -616,14 +621,14 @@ var emit = Effect5.fnUntraced(function* (name, properties, options) {
616
621
  const client = yield* BrowserEventsClient;
617
622
  if (!client.allowed())
618
623
  return;
619
- const decoded = yield* Schema6.decodeUnknownEffect(BrowserEventOptions)(options ?? {});
624
+ const decoded = yield* Schema6.decodeEffect(BrowserEventOptions)(options ?? {});
620
625
  yield* event(name, { ...properties, ...client.context(name, properties) }, decoded).pipe(Effect5.provideService(OtlpEvents, client.events));
621
626
  });
622
627
  var page = Effect5.fnUntraced(function* (input = {}) {
623
628
  const client = yield* BrowserEventsClient;
624
629
  if (!client.allowed())
625
630
  return;
626
- const decoded = yield* Schema6.decodeUnknownEffect(BrowserPage)(input);
631
+ const decoded = yield* Schema6.decodeEffect(BrowserPage)(input);
627
632
  const properties = eventProperties(decoded.properties);
628
633
  if (decoded.name)
629
634
  properties["analytics.page.name"] = decoded.name;
@@ -642,8 +647,8 @@ var BrowserClientLive = Layer2.effectDiscard(Effect5.gen(function* () {
642
647
  yield* Effect5.acquireRelease(Effect5.sync(() => {
643
648
  clients.push(client);
644
649
  return client;
645
- }), (client) => Effect5.sync(() => {
646
- const index = clients.indexOf(client);
650
+ }), (client2) => Effect5.sync(() => {
651
+ const index = clients.indexOf(client2);
647
652
  if (index !== -1)
648
653
  clients.splice(index, 1);
649
654
  }));
@@ -652,18 +657,20 @@ var pageViewListeners = new Set;
652
657
  var stopPageViewTracking;
653
658
  var subscribePageViews = (listener) => {
654
659
  if (pageViewListeners.size === 0) {
655
- const pushState = history.pushState;
656
- const replaceState = history.replaceState;
660
+ const pushDescriptor = Object.getOwnPropertyDescriptor(history, "pushState");
661
+ const replaceDescriptor = Object.getOwnPropertyDescriptor(history, "replaceState");
662
+ const pushState = history.pushState.bind(history);
663
+ const replaceState = history.replaceState.bind(history);
657
664
  const notify = () => {
658
665
  for (const onPage of pageViewListeners)
659
666
  onPage();
660
667
  };
661
668
  const trackedPushState = (...args) => {
662
- pushState.apply(history, args);
669
+ pushState(...args);
663
670
  notify();
664
671
  };
665
672
  const trackedReplaceState = (...args) => {
666
- replaceState.apply(history, args);
673
+ replaceState(...args);
667
674
  notify();
668
675
  };
669
676
  history.pushState = trackedPushState;
@@ -671,10 +678,18 @@ var subscribePageViews = (listener) => {
671
678
  globalThis.addEventListener("popstate", notify);
672
679
  stopPageViewTracking = () => {
673
680
  globalThis.removeEventListener("popstate", notify);
674
- if (history.pushState === trackedPushState)
675
- history.pushState = pushState;
676
- if (history.replaceState === trackedReplaceState)
677
- history.replaceState = replaceState;
681
+ if (history.pushState === trackedPushState) {
682
+ if (pushDescriptor)
683
+ Object.defineProperty(history, "pushState", pushDescriptor);
684
+ else
685
+ Reflect.deleteProperty(history, "pushState");
686
+ }
687
+ if (history.replaceState === trackedReplaceState) {
688
+ if (replaceDescriptor)
689
+ Object.defineProperty(history, "replaceState", replaceDescriptor);
690
+ else
691
+ Reflect.deleteProperty(history, "replaceState");
692
+ }
678
693
  };
679
694
  }
680
695
  pageViewListeners.add(listener);
@@ -776,9 +791,9 @@ class BrowserEvents {
776
791
  };
777
792
  }
778
793
  export {
779
- BrowserEvents,
780
- analyticsAllowed,
781
- analyticsConsentSnapshot,
794
+ subscribeAnalyticsConsent,
782
795
  saveAnalyticsPreference,
783
- subscribeAnalyticsConsent
796
+ analyticsConsentSnapshot,
797
+ analyticsAllowed,
798
+ BrowserEvents
784
799
  };