@ai-matrx/chat 0.5.2 → 0.5.4

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @ai-matrx/chat
2
2
 
3
+ ## 0.5.4 — tree-shakeable, and the first screen sheds its heavy parts
4
+
5
+ - `"sideEffects"` is no longer `true`: it lists the CSS and the ten files that run on import
6
+ (registrations, the page-leave listener, diagnostics). Guard: `pnpm check:side-effects`
7
+ (`apps/shared/scripts/check-side-effects-listed.mjs`, self-tested), now part of `check:package`.
8
+ - Lazy on first use, never on the first chat screen: every tool card in the tool-call registry, the
9
+ media variable inputs (image/audio/video/document/YouTube), the media, comment and working-document
10
+ context-item bodies, and the documents workspace tab.
11
+ - Side-panel canary (bare Vite host, npm-installed): first chat screen 1829 → 1738 kB gzip with
12
+ rich-content 0.2.56; budget ratcheted to 1745.
13
+
14
+ Consumer action: none. A host that imported a chat module only for an effect not in the list should
15
+ import the module it uses instead.
16
+
17
+ ## 0.5.3
18
+
19
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
20
+ `git diff npm/chat/v0.5.2..npm/chat/v0.5.3 -- apps/shared/chat`).
21
+ No source changes intended and no consumer action required.
22
+
3
23
  ## 0.5.2 — `convertMarkdownToHtml` may answer with a promise
4
24
 
5
25
  - The `convertMarkdownToHtml` slot is typed `(markdown: string) => string | Promise<string>` and
@@ -33,12 +33,14 @@ import { NoteBody, NoteFooter, NoteTitleActions } from "./bodies/NoteBody.js";
33
33
  import { TaskBody } from "./bodies/TaskBody.js";
34
34
  import { WebpageBody, WebpageFooter } from "./bodies/WebpageBody.js";
35
35
  import { DataBody } from "./bodies/DataBody.js";
36
- import { MediaBody, MediaFooter } from "./bodies/MediaBody.js";
37
- import { WorkingDocumentBody } from "./bodies/WorkingDocumentBody.js";
38
36
  import { ProcessedDocumentBody } from "./bodies/ProcessedDocumentBody.js";
39
37
  import { ProcessedDocumentTitle } from "./bodies/ProcessedDocumentTitle.js";
40
38
  import { GenericBody, GenericFooter } from "./bodies/GenericBody.js";
41
- import { RemarkBody } from "./bodies/RemarkBody.js";
39
+ import { clientLazy } from "../../../utils/client-lazy.js";
40
+ const MediaBody = clientLazy(() => import("./bodies/MediaBody.js").then((m) => ({ default: m.MediaBody })));
41
+ const MediaFooter = clientLazy(() => import("./bodies/MediaBody.js").then((m) => ({ default: m.MediaFooter })));
42
+ const WorkingDocumentBody = clientLazy(() => import("./bodies/WorkingDocumentBody.js").then((m) => ({ default: m.WorkingDocumentBody })));
43
+ const RemarkBody = clientLazy(() => import("./bodies/RemarkBody.js").then((m) => ({ default: m.RemarkBody })));
42
44
  import { BookmarkReferenceBody } from "./bodies/BookmarkReferenceBody.js";
43
45
  import { EntityReferenceBody } from "./bodies/EntityReferenceBody.js";
44
46
  import { ContextInputBody } from "./bodies/ContextInputBody.js";
@@ -29,7 +29,8 @@ import { RunSettingsEditor } from "../../run-controls/RunSettingsEditor.js";
29
29
  import { RunModelPicker } from "../../run-controls/RunModelPicker.js";
30
30
  import { RunConfigOverrides } from "../../run-controls/RunConfigOverrides.js";
31
31
  import { RunInputCapabilities } from "../../run-controls/RunInputCapabilities.js";
32
- import { DocumentsWorkspace } from "../../working-document/documents-workspace/DocumentsWorkspace.js";
32
+ import { clientLazy } from "@ai-matrx/kit/client-lazy";
33
+ const DocumentsWorkspace = clientLazy(() => import("../../working-document/documents-workspace/DocumentsWorkspace.js").then((m) => ({ default: m.DocumentsWorkspace })));
33
34
  import { selectWorkingDocEnabled } from "../../../redux/execution-system/instance-working-document/instance-working-document.selectors.js";
34
35
  import { ActiveContextTree } from "../../../../context/sources/scopes.js";
35
36
  import { selectHasActiveContext } from "../../../../context/sources/scopes.js";
@@ -10,11 +10,12 @@ import { selectShowVariablePanel } from "../../../redux/execution-system/instanc
10
10
  import { setUserVariableValue } from "../../../redux/execution-system/instance-variable-values/instance-variable-values.slice.js";
11
11
  import { selectUserVariableValues } from "../../../redux/execution-system/instance-variable-values/instance-variable-values.selectors.js";
12
12
  import { isMediaVariableType } from "../../../types/agent-definition.types.js";
13
- import { ImageVariableInput } from "../input-components/ImageVariableInput.js";
14
- import { AudioVariableInput } from "../input-components/AudioVariableInput.js";
15
- import { VideoVariableInput } from "../input-components/VideoVariableInput.js";
16
- import { DocumentVariableInput } from "../input-components/DocumentVariableInput.js";
17
- import { YoutubeVariableInput } from "../input-components/YoutubeVariableInput.js";
13
+ import { clientLazy } from "@ai-matrx/kit/client-lazy";
14
+ const ImageVariableInput = clientLazy(() => import("../input-components/ImageVariableInput.js").then((m) => ({ default: m.ImageVariableInput })));
15
+ const AudioVariableInput = clientLazy(() => import("../input-components/AudioVariableInput.js").then((m) => ({ default: m.AudioVariableInput })));
16
+ const VideoVariableInput = clientLazy(() => import("../input-components/VideoVariableInput.js").then((m) => ({ default: m.VideoVariableInput })));
17
+ const DocumentVariableInput = clientLazy(() => import("../input-components/DocumentVariableInput.js").then((m) => ({ default: m.DocumentVariableInput })));
18
+ const YoutubeVariableInput = clientLazy(() => import("../input-components/YoutubeVariableInput.js").then((m) => ({ default: m.YoutubeVariableInput })));
18
19
  import { ArrowRight, Minus, Plus } from "lucide-react";
19
20
  import { variableRunLabel } from "@ai-matrx/agents";
20
21
  import { Button } from "@ai-matrx/design-system/controls";
@@ -28,12 +28,13 @@ import {
28
28
  import { VoiceTextarea } from "../../../../host/ui-slots.js";
29
29
  import { formatText, humanizeIdentifier } from "@ai-matrx/kit/text-case";
30
30
  import { cn } from "@ai-matrx/design-system";
31
+ import { clientLazy } from "@ai-matrx/kit/client-lazy";
31
32
  import { isMediaVariableType } from "../../../types/agent-definition.types.js";
32
- import { ImageVariableInput } from "../input-components/ImageVariableInput.js";
33
- import { AudioVariableInput } from "../input-components/AudioVariableInput.js";
34
- import { VideoVariableInput } from "../input-components/VideoVariableInput.js";
35
- import { DocumentVariableInput } from "../input-components/DocumentVariableInput.js";
36
- import { YoutubeVariableInput } from "../input-components/YoutubeVariableInput.js";
33
+ const ImageVariableInput = clientLazy(() => import("../input-components/ImageVariableInput.js").then((m) => ({ default: m.ImageVariableInput })));
34
+ const AudioVariableInput = clientLazy(() => import("../input-components/AudioVariableInput.js").then((m) => ({ default: m.AudioVariableInput })));
35
+ const VideoVariableInput = clientLazy(() => import("../input-components/VideoVariableInput.js").then((m) => ({ default: m.VideoVariableInput })));
36
+ const DocumentVariableInput = clientLazy(() => import("../input-components/DocumentVariableInput.js").then((m) => ({ default: m.DocumentVariableInput })));
37
+ const YoutubeVariableInput = clientLazy(() => import("../input-components/YoutubeVariableInput.js").then((m) => ({ default: m.YoutubeVariableInput })));
37
38
  const IOS_INPUT_STYLE = { fontSize: "16px" };
38
39
  function AgentVariableForm({ conversationId }) {
39
40
  const dispatch = useAppDispatch();
@@ -9,11 +9,12 @@ import { Minus, Plus } from "lucide-react";
9
9
  import { variableRunLabel } from "@ai-matrx/agents";
10
10
  import { cn } from "@ai-matrx/design-system";
11
11
  import { isMediaVariableType } from "../../../types/agent-definition.types.js";
12
- import { ImageVariableInput } from "../input-components/ImageVariableInput.js";
13
- import { AudioVariableInput } from "../input-components/AudioVariableInput.js";
14
- import { VideoVariableInput } from "../input-components/VideoVariableInput.js";
15
- import { DocumentVariableInput } from "../input-components/DocumentVariableInput.js";
16
- import { YoutubeVariableInput } from "../input-components/YoutubeVariableInput.js";
12
+ import { clientLazy } from "@ai-matrx/kit/client-lazy";
13
+ const ImageVariableInput = clientLazy(() => import("../input-components/ImageVariableInput.js").then((m) => ({ default: m.ImageVariableInput })));
14
+ const AudioVariableInput = clientLazy(() => import("../input-components/AudioVariableInput.js").then((m) => ({ default: m.AudioVariableInput })));
15
+ const VideoVariableInput = clientLazy(() => import("../input-components/VideoVariableInput.js").then((m) => ({ default: m.VideoVariableInput })));
16
+ const DocumentVariableInput = clientLazy(() => import("../input-components/DocumentVariableInput.js").then((m) => ({ default: m.DocumentVariableInput })));
17
+ const YoutubeVariableInput = clientLazy(() => import("../input-components/YoutubeVariableInput.js").then((m) => ({ default: m.YoutubeVariableInput })));
17
18
  import { useAppSelector, useAppDispatch } from "../../../../store/hooks.js";
18
19
  import {
19
20
  selectInstanceVariableDefinitions,
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { formatCount } from "@ai-matrx/kit/format";
4
+ import { clientLazy } from "@ai-matrx/kit/client-lazy";
4
5
  import {
5
6
  CheckCircle,
6
7
  FileSearch,
@@ -37,39 +38,39 @@ import { withSurfaceWriteDiff } from "../surface-write/withSurfaceWriteDiff.js";
37
38
  import { DIFF_START_OPEN_KNOB, readSurfaceWrite } from "../surface-write/readSurfaceWrite.js";
38
39
  import { getSessionKnob } from "../../host/prefs.js";
39
40
  import { reportUnregisteredHostSlot } from "../../host/diagnostics.js";
40
- import { SearchInline } from "../renderers/search/SearchInline.js";
41
- import { SearchOverlay } from "../renderers/search/SearchOverlay.js";
42
- import { ScrapeInline } from "../renderers/scrape/ScrapeInline.js";
43
- import { ScrapeOverlay } from "../renderers/scrape/ScrapeOverlay.js";
41
+ const SearchInline = clientLazy(() => import("../renderers/search/SearchInline.js").then((m) => ({ default: m.SearchInline })));
42
+ const SearchOverlay = clientLazy(() => import("../renderers/search/SearchOverlay.js").then((m) => ({ default: m.SearchOverlay })));
43
+ const ScrapeInline = clientLazy(() => import("../renderers/scrape/ScrapeInline.js").then((m) => ({ default: m.ScrapeInline })));
44
+ const ScrapeOverlay = clientLazy(() => import("../renderers/scrape/ScrapeOverlay.js").then((m) => ({ default: m.ScrapeOverlay })));
44
45
  import { parseScrape } from "../renderers/scrape/parseScrape.js";
45
- import { WebInline } from "../renderers/web/WebInline.js";
46
- import { WebOverlay } from "../renderers/web/WebOverlay.js";
46
+ const WebInline = clientLazy(() => import("../renderers/web/WebInline.js").then((m) => ({ default: m.WebInline })));
47
+ const WebOverlay = clientLazy(() => import("../renderers/web/WebOverlay.js").then((m) => ({ default: m.WebOverlay })));
47
48
  import { resolveWebActionKind } from "../renderers/web/webAction.js";
48
- import { NewsInline } from "../renderers/news-api/NewsInline.js";
49
- import { NewsOverlay } from "../renderers/news-api/NewsOverlay.js";
50
- import { WorkbookInline } from "../renderers/workbook/WorkbookInline.js";
51
- import { WorkbookOverlay } from "../renderers/workbook/WorkbookOverlay.js";
52
- import { DictionaryInline } from "../renderers/dictionary/DictionaryInline.js";
53
- import { DictionaryOverlay } from "../renderers/dictionary/DictionaryOverlay.js";
54
- import { ResearchInline } from "../renderers/research/ResearchInline.js";
49
+ const NewsInline = clientLazy(() => import("../renderers/news-api/NewsInline.js").then((m) => ({ default: m.NewsInline })));
50
+ const NewsOverlay = clientLazy(() => import("../renderers/news-api/NewsOverlay.js").then((m) => ({ default: m.NewsOverlay })));
51
+ const WorkbookInline = clientLazy(() => import("../renderers/workbook/WorkbookInline.js").then((m) => ({ default: m.WorkbookInline })));
52
+ const WorkbookOverlay = clientLazy(() => import("../renderers/workbook/WorkbookOverlay.js").then((m) => ({ default: m.WorkbookOverlay })));
53
+ const DictionaryInline = clientLazy(() => import("../renderers/dictionary/DictionaryInline.js").then((m) => ({ default: m.DictionaryInline })));
54
+ const DictionaryOverlay = clientLazy(() => import("../renderers/dictionary/DictionaryOverlay.js").then((m) => ({ default: m.DictionaryOverlay })));
55
+ const ResearchInline = clientLazy(() => import("../renderers/research/ResearchInline.js").then((m) => ({ default: m.ResearchInline })));
55
56
  import { researchOverlayTabs } from "../renderers/research/ResearchOverlay.js";
56
- import { RandomWheelInline } from "../renderers/random-wheel/RandomWheelInline.js";
57
- import { RecordsInline } from "../renderers/records/RecordsInline.js";
58
- import { CtxGetInline } from "../renderers/ctx/CtxGetInline.js";
59
- import { CtxBatchInline } from "../renderers/ctx/CtxBatchInline.js";
60
- import { CtxPatchInline } from "../renderers/ctx/CtxPatchInline.js";
61
- import { ContextActionInline } from "../renderers/ctx/ContextActionInline.js";
62
- import { SqlInline } from "../renderers/sql/SqlInline.js";
63
- import { FsInline } from "../renderers/fs/FsInline.js";
64
- import { ShellInline } from "../renderers/shell/ShellInline.js";
65
- import { SkillInline } from "../renderers/skill/SkillInline.js";
66
- import { AskInline } from "../renderers/ask/AskInline.js";
67
- import { AskPersonInline } from "../renderers/ask-person/AskPersonInline.js";
68
- import { CloudBrowserInline } from "../renderers/cloud-browser/CloudBrowserRunCard.js";
57
+ const RandomWheelInline = clientLazy(() => import("../renderers/random-wheel/RandomWheelInline.js").then((m) => ({ default: m.RandomWheelInline })));
58
+ const RecordsInline = clientLazy(() => import("../renderers/records/RecordsInline.js").then((m) => ({ default: m.RecordsInline })));
59
+ const CtxGetInline = clientLazy(() => import("../renderers/ctx/CtxGetInline.js").then((m) => ({ default: m.CtxGetInline })));
60
+ const CtxBatchInline = clientLazy(() => import("../renderers/ctx/CtxBatchInline.js").then((m) => ({ default: m.CtxBatchInline })));
61
+ const CtxPatchInline = clientLazy(() => import("../renderers/ctx/CtxPatchInline.js").then((m) => ({ default: m.CtxPatchInline })));
62
+ const ContextActionInline = clientLazy(() => import("../renderers/ctx/ContextActionInline.js").then((m) => ({ default: m.ContextActionInline })));
63
+ const SqlInline = clientLazy(() => import("../renderers/sql/SqlInline.js").then((m) => ({ default: m.SqlInline })));
64
+ const FsInline = clientLazy(() => import("../renderers/fs/FsInline.js").then((m) => ({ default: m.FsInline })));
65
+ const ShellInline = clientLazy(() => import("../renderers/shell/ShellInline.js").then((m) => ({ default: m.ShellInline })));
66
+ const SkillInline = clientLazy(() => import("../renderers/skill/SkillInline.js").then((m) => ({ default: m.SkillInline })));
67
+ const AskInline = clientLazy(() => import("../renderers/ask/AskInline.js").then((m) => ({ default: m.AskInline })));
68
+ const AskPersonInline = clientLazy(() => import("../renderers/ask-person/AskPersonInline.js").then((m) => ({ default: m.AskPersonInline })));
69
+ const CloudBrowserInline = clientLazy(() => import("../renderers/cloud-browser/CloudBrowserRunCard.js").then((m) => ({ default: m.CloudBrowserInline })));
69
70
  import { cloudBrowserAction } from "../renderers/cloud-browser/cloudBrowserRun.js";
70
- import { DbSchemaInline } from "../renderers/sql/DbSchemaInline.js";
71
+ const DbSchemaInline = clientLazy(() => import("../renderers/sql/DbSchemaInline.js").then((m) => ({ default: m.DbSchemaInline })));
71
72
  import { summarizeSql } from "../renderers/sql/summarizeSql.js";
72
- import { AgentCallInline } from "../renderers/agent-call/AgentCallInline.js";
73
+ const AgentCallInline = clientLazy(() => import("../renderers/agent-call/AgentCallInline.js").then((m) => ({ default: m.AgentCallInline })));
73
74
  import { isImageGenerationAgentCall } from "../renderers/agent-call/agentCallKind.js";
74
75
  import { isCollaborationAgentCall } from "../renderers/agent-call/collab.js";
75
76
  import { collabHeaderSubtitle } from "../renderers/agent-call/collab-subtitle.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/chat",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
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. One chat, one renderer: the old kernel entries (., /external-store, /matrx, /react, /tools, styles.css, tokens.css) are retired.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -167,25 +167,25 @@
167
167
  "uuid": "^14.0.2",
168
168
  "zod": "^4.6.5",
169
169
  "@ai-matrx/agents": "latest",
170
- "@ai-matrx/content-ir-react": "latest",
171
- "@ai-matrx/content-ir": "latest",
170
+ "@ai-matrx/alchemy": "latest",
171
+ "@ai-matrx/associations": "latest",
172
+ "@ai-matrx/browser-audio": "latest",
172
173
  "@ai-matrx/canvas": "latest",
174
+ "@ai-matrx/content-ir": "latest",
175
+ "@ai-matrx/content-ir-react": "latest",
173
176
  "@ai-matrx/data": "latest",
174
177
  "@ai-matrx/design-system": "latest",
175
- "@ai-matrx/alchemy": "latest",
176
178
  "@ai-matrx/diff": "latest",
177
- "@ai-matrx/icons": "latest",
178
179
  "@ai-matrx/kit": "latest",
180
+ "@ai-matrx/media": "latest",
179
181
  "@ai-matrx/print": "latest",
180
182
  "@ai-matrx/realtime": "latest",
181
- "@ai-matrx/media": "latest",
182
183
  "@ai-matrx/records": "latest",
183
- "@ai-matrx/records-ui": "latest",
184
184
  "@ai-matrx/rich-content": "latest",
185
185
  "@ai-matrx/rich-editor": "latest",
186
186
  "@ai-matrx/tap-target": "latest",
187
- "@ai-matrx/associations": "latest",
188
- "@ai-matrx/browser-audio": "latest"
187
+ "@ai-matrx/icons": "latest",
188
+ "@ai-matrx/records-ui": "latest"
189
189
  },
190
190
  "devDependencies": {
191
191
  "@arethetypeswrong/cli": "^0.18.5",
@@ -218,7 +218,27 @@
218
218
  "engines": {
219
219
  "node": ">=20"
220
220
  },
221
- "sideEffects": true,
221
+ "sideEffects": [
222
+ "**/*.css",
223
+ "./src/ui/markdown-stream/rich-content-defaults.ts",
224
+ "./dist/ui/markdown-stream/rich-content-defaults.js",
225
+ "./src/agents/components/messages-display/rich-document/chat-message-source.ts",
226
+ "./dist/agents/components/messages-display/rich-document/chat-message-source.js",
227
+ "./src/agents/redux/execution-system/client-capabilities/*",
228
+ "./dist/agents/redux/execution-system/client-capabilities/*",
229
+ "./src/agents/redux/execution-system/utils/page-leaving.ts",
230
+ "./dist/agents/redux/execution-system/utils/page-leaving.js",
231
+ "./src/host/diagnostics.ts",
232
+ "./dist/host/diagnostics.js",
233
+ "./src/tool-call-visualization/db-renderer/toolRendererCache.ts",
234
+ "./dist/tool-call-visualization/db-renderer/toolRendererCache.js",
235
+ "./src/voice-agent/relay/useVoiceRelaySession.ts",
236
+ "./dist/voice-agent/relay/useVoiceRelaySession.js",
237
+ "./src/surfaces/runtime/SurfaceRuntimeContext.tsx",
238
+ "./dist/surfaces/runtime/SurfaceRuntimeContext.js",
239
+ "./src/agents/components/context-items/registry.tsx",
240
+ "./dist/agents/components/context-items/registry.js"
241
+ ],
222
242
  "peerDependencies": {
223
243
  "@reduxjs/toolkit": ">=2.0.0",
224
244
  "next": ">=16.0.0-0",
@@ -263,7 +283,7 @@
263
283
  "scripts": {
264
284
  "build": "pnpm --filter @ai-matrx/rich-editor build && pnpm clean && tsup && node ./scripts/tsc-own.mjs -p tsconfig.build.json && node ./scripts/finish-build.mjs",
265
285
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
266
- "check:package": "pnpm build && node ../scripts/check-exports-agreement.mjs && publint && pnpm verify:tarball && pnpm verify:modules-tarball && pnpm check:front-door:self-test && pnpm check:front-door:canary && pnpm check:host-boundary && pnpm check:no-builder-tier && pnpm check:one-holder && pnpm check:host-doors && pnpm check:no-package-slots",
286
+ "check:package": "pnpm build && node ../scripts/check-exports-agreement.mjs && publint && pnpm verify:tarball && pnpm verify:modules-tarball && pnpm check:front-door:self-test && pnpm check:front-door:canary && pnpm check:host-boundary && pnpm check:no-builder-tier && pnpm check:one-holder && pnpm check:host-doors && pnpm check:no-package-slots && pnpm check:side-effects",
267
287
  "check:host-boundary": "node ./scripts/check-host-boundary.mjs && node ./scripts/check-host-boundary.mjs --self-test",
268
288
  "check:host-doors": "node ./scripts/check-host-source-doors.mjs && node ./scripts/check-host-source-doors.mjs --self-test",
269
289
  "check:no-package-slots": "node ./scripts/check-no-package-slots.mjs && node ./scripts/check-no-package-slots.mjs --self-test",
@@ -279,6 +299,7 @@
279
299
  "check:front-door:self-test": "node ./scripts/check-front-door.mjs --self-test",
280
300
  "check:front-door:canary": "node ./scripts/check-front-door.mjs --root ./canary/src",
281
301
  "deps:write": "node ./scripts/finish-build.mjs --write-deps",
282
- "check:side-panel-bundle": "node ./scripts/check-side-panel-bundle.mjs"
302
+ "check:side-panel-bundle": "node ./scripts/check-side-panel-bundle.mjs",
303
+ "check:side-effects": "node ../scripts/check-side-effects-listed.mjs . && node ../scripts/check-side-effects-listed.mjs --self-test"
283
304
  }
284
305
  }