@ai-matrx/chat 0.4.20 → 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.20",
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",
@@ -227,25 +227,25 @@
227
227
  "uuid": "^14.0.2",
228
228
  "zod": "^4.6.5",
229
229
  "@ai-matrx/alchemy": "latest",
230
- "@ai-matrx/associations": "latest",
231
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",
236
235
  "@ai-matrx/data": "latest",
237
- "@ai-matrx/diff": "latest",
238
236
  "@ai-matrx/design-system": "latest",
237
+ "@ai-matrx/diff": "latest",
238
+ "@ai-matrx/icons": "latest",
239
239
  "@ai-matrx/kit": "latest",
240
240
  "@ai-matrx/media": "latest",
241
241
  "@ai-matrx/print": "latest",
242
242
  "@ai-matrx/realtime": "latest",
243
243
  "@ai-matrx/records": "latest",
244
244
  "@ai-matrx/records-ui": "latest",
245
- "@ai-matrx/icons": "latest",
246
- "@ai-matrx/tap-target": "latest",
245
+ "@ai-matrx/rich-content": "latest",
247
246
  "@ai-matrx/rich-editor": "latest",
248
- "@ai-matrx/rich-content": "latest"
247
+ "@ai-matrx/tap-target": "latest",
248
+ "@ai-matrx/agents": "latest"
249
249
  },
250
250
  "devDependencies": {
251
251
  "@arethetypeswrong/cli": "^0.18.5",