@ai-matrx/chat 0.4.19 → 0.4.21

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.
@@ -1,16 +1 @@
1
- /**
2
- * `clientLazy` — the package's host-neutral replacement for `next/dynamic(..., { ssr: false })`.
3
- * A lazily loaded component that renders only on the client: on the server and during hydration
4
- * it renders `loading` (hydration-safe through `useSyncExternalStore`); on the client it renders
5
- * the loaded component inside a Suspense boundary with the same `loading` as the fallback.
6
- *
7
- * Plain React (`lazy` + `Suspense`), so a Vite / Electron / extension host needs no `next`
8
- * installed (HOST-OWNED-SOURCE-PLAN P28e). Guard: `host/__tests__/no-next-import-outside-next-binding`.
9
- */
10
- import { type ComponentType } from "react";
11
- export declare function useIsClient(): boolean;
12
- export declare function clientLazy<P extends object>(load: () => Promise<{
13
- default: ComponentType<P>;
14
- } | ComponentType<P>>, options?: {
15
- loading?: ComponentType;
16
- }): ComponentType<P>;
1
+ export { clientLazy, useIsClient } from "@ai-matrx/kit/client-lazy";
@@ -1,26 +1,5 @@
1
1
  "use client";
2
- import { createElement, lazy, Suspense, useSyncExternalStore } from "react";
3
- const subscribe = () => () => {
4
- };
5
- const onClient = () => true;
6
- const onServer = () => false;
7
- function useIsClient() {
8
- return useSyncExternalStore(subscribe, onClient, onServer);
9
- }
10
- function clientLazy(load, options = {}) {
11
- const Lazy = lazy(async () => {
12
- const m = await load();
13
- return typeof m === "function" || !("default" in m) ? { default: m } : m;
14
- });
15
- const Loading = options.loading;
16
- function ClientLazy(props) {
17
- const client = useIsClient();
18
- const fallback = Loading ? createElement(Loading) : null;
19
- if (!client) return fallback;
20
- return createElement(Suspense, { fallback }, createElement(Lazy, props));
21
- }
22
- return ClientLazy;
23
- }
2
+ import { clientLazy, useIsClient } from "@ai-matrx/kit/client-lazy";
24
3
  export {
25
4
  clientLazy,
26
5
  useIsClient
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/chat",
3
- "version": "0.4.19",
3
+ "version": "0.4.21",
4
4
  "description": "THE one AI Matrx person-to-agent chat system: the full chat (running agents, conversations, tool calls, streaming, context, surfaces, voice) as per-module subpaths @ai-matrx/chat/<domain>/<module> over a host contract (/host, /host/react) whose only required value is a db; plus the kernel compatibility entries (., /external-store, /matrx, /react, /tools, styles.css, tokens.css) until P28.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -226,16 +226,17 @@
226
226
  "server-only": "^0.0.1",
227
227
  "uuid": "^14.0.2",
228
228
  "zod": "^4.6.5",
229
- "@ai-matrx/associations": "latest",
230
- "@ai-matrx/browser-audio": "latest",
231
229
  "@ai-matrx/alchemy": "latest",
230
+ "@ai-matrx/browser-audio": "latest",
231
+ "@ai-matrx/associations": "latest",
232
232
  "@ai-matrx/canvas": "latest",
233
233
  "@ai-matrx/content-ir": "latest",
234
- "@ai-matrx/agents": "latest",
235
234
  "@ai-matrx/content-ir-react": "latest",
235
+ "@ai-matrx/data": "latest",
236
236
  "@ai-matrx/design-system": "latest",
237
237
  "@ai-matrx/diff": "latest",
238
238
  "@ai-matrx/icons": "latest",
239
+ "@ai-matrx/kit": "latest",
239
240
  "@ai-matrx/media": "latest",
240
241
  "@ai-matrx/print": "latest",
241
242
  "@ai-matrx/realtime": "latest",
@@ -244,8 +245,7 @@
244
245
  "@ai-matrx/rich-content": "latest",
245
246
  "@ai-matrx/rich-editor": "latest",
246
247
  "@ai-matrx/tap-target": "latest",
247
- "@ai-matrx/data": "latest",
248
- "@ai-matrx/kit": "latest"
248
+ "@ai-matrx/agents": "latest"
249
249
  },
250
250
  "devDependencies": {
251
251
  "@arethetypeswrong/cli": "^0.18.5",