@ai-matrx/chat 0.4.20 → 0.4.22

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.22",
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",
@@ -229,23 +229,23 @@
229
229
  "@ai-matrx/alchemy": "latest",
230
230
  "@ai-matrx/associations": "latest",
231
231
  "@ai-matrx/browser-audio": "latest",
232
+ "@ai-matrx/agents": "latest",
232
233
  "@ai-matrx/canvas": "latest",
233
234
  "@ai-matrx/content-ir": "latest",
234
- "@ai-matrx/agents": "latest",
235
235
  "@ai-matrx/content-ir-react": "latest",
236
236
  "@ai-matrx/data": "latest",
237
- "@ai-matrx/diff": "latest",
238
237
  "@ai-matrx/design-system": "latest",
238
+ "@ai-matrx/diff": "latest",
239
239
  "@ai-matrx/kit": "latest",
240
- "@ai-matrx/media": "latest",
240
+ "@ai-matrx/icons": "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/media": "latest"
249
249
  },
250
250
  "devDependencies": {
251
251
  "@arethetypeswrong/cli": "^0.18.5",