@kanzo-tech/ai 0.13.1 → 0.14.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.
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js.map +1 -1
- package/package.json +5 -5
package/dist/markdown.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ import { StreamdownProps } from 'streamdown';
|
|
|
18
18
|
* roughly 136, for a parser it never calls.
|
|
19
19
|
*
|
|
20
20
|
* So it lives here, behind `@kanzo-tech/ai/markdown`, with `streamdown` as an **optional peer** —
|
|
21
|
-
* the same door `@kanzo-tech/ui/editor` stands behind for CodeMirror and `@kanzo-tech/
|
|
22
|
-
* for
|
|
21
|
+
* the same door `@kanzo-tech/ui/editor` stands behind for CodeMirror and `@kanzo-tech/ui/analytics`
|
|
22
|
+
* for vgplot. Nothing installs the tarball without the peers any more, so the door is held only by
|
|
23
23
|
* `index.ts` never naming `./markdown` — the `size` budget is what would notice it opening.
|
|
24
24
|
*
|
|
25
25
|
* ## The animation is Streamdown's now, not ours
|
package/dist/markdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.js","sources":["../src/markdown.tsx"],"sourcesContent":["// No `\"use client\"` here, and `client-boundary.test.ts` is what caught the first version that had\n// one: this module holds no state, no effect and no handler of its own. `streamdown/dist/index.js`\n// opens with the directive itself, so importing it establishes the boundary — a second one here\n// would opt the wrapper out of server rendering for nothing.\nimport { Streamdown, type StreamdownProps } from \"streamdown\";\nimport { cn } from \"@kanzo-tech/ui\";\n\n/**\n * **`MessageText`, for a source that streams markdown.**\n *\n * `MessageText` takes a plain string and renders it as text, which is right for a model answering\n * in prose and wrong the moment one emits a `**bold`, a list or a fence. The hard part is not the\n * markdown — it is the *incomplete* markdown: a stream delivers `**bo`, then `**bold`, then\n * `**bold**`, and a parser that renders each of those honestly makes the answer flicker between\n * literal asterisks and emphasis as it completes. Streamdown exists to close those, and closing\n * them well is a parser's worth of work rather than a component's.\n *\n * ## Why a subpath, and it is a one-way door\n *\n * **Measured before it was decided:** `streamdown` bundles to **495 kB minified, 128 kB brotli**\n * on its own — `parse5` 123 kB for `rehype-raw`'s HTML, `entities` 51 kB, `marked` 40 kB, the\n * unified stack behind them. `@kanzo-tech/ai`'s whole root barrel is budgeted at 20 kB and measures\n * 8.34. A static import from `index.ts` would take every host that renders plain prose from 8 kB to\n * roughly 136, for a parser it never calls.\n *\n * So it lives here, behind `@kanzo-tech/ai/markdown`, with `streamdown` as an **optional peer** —\n * the same door `@kanzo-tech/ui/editor` stands behind for CodeMirror and `@kanzo-tech/
|
|
1
|
+
{"version":3,"file":"markdown.js","sources":["../src/markdown.tsx"],"sourcesContent":["// No `\"use client\"` here, and `client-boundary.test.ts` is what caught the first version that had\n// one: this module holds no state, no effect and no handler of its own. `streamdown/dist/index.js`\n// opens with the directive itself, so importing it establishes the boundary — a second one here\n// would opt the wrapper out of server rendering for nothing.\nimport { Streamdown, type StreamdownProps } from \"streamdown\";\nimport { cn } from \"@kanzo-tech/ui\";\n\n/**\n * **`MessageText`, for a source that streams markdown.**\n *\n * `MessageText` takes a plain string and renders it as text, which is right for a model answering\n * in prose and wrong the moment one emits a `**bold`, a list or a fence. The hard part is not the\n * markdown — it is the *incomplete* markdown: a stream delivers `**bo`, then `**bold`, then\n * `**bold**`, and a parser that renders each of those honestly makes the answer flicker between\n * literal asterisks and emphasis as it completes. Streamdown exists to close those, and closing\n * them well is a parser's worth of work rather than a component's.\n *\n * ## Why a subpath, and it is a one-way door\n *\n * **Measured before it was decided:** `streamdown` bundles to **495 kB minified, 128 kB brotli**\n * on its own — `parse5` 123 kB for `rehype-raw`'s HTML, `entities` 51 kB, `marked` 40 kB, the\n * unified stack behind them. `@kanzo-tech/ai`'s whole root barrel is budgeted at 20 kB and measures\n * 8.34. A static import from `index.ts` would take every host that renders plain prose from 8 kB to\n * roughly 136, for a parser it never calls.\n *\n * So it lives here, behind `@kanzo-tech/ai/markdown`, with `streamdown` as an **optional peer** —\n * the same door `@kanzo-tech/ui/editor` stands behind for CodeMirror and `@kanzo-tech/ui/analytics`\n * for vgplot. Nothing installs the tarball without the peers any more, so the door is held only by\n * `index.ts` never naming `./markdown` — the `size` budget is what would notice it opening.\n *\n * ## The animation is Streamdown's now, not ours\n *\n * `MessageText` hand-rolls a per-word cascade whose four rules are all read off Streamdown's\n * `animate.ts` — its docblock says so and names each one. Here the original is present, so it does\n * the work: `animated` with `sep: \"word\"` is the same idea from the source it was copied from, and\n * two implementations of one cascade is one too many. The numbers below are `MessageText`'s, so a\n * transcript that mixes the two components does not visibly change rhythm mid-conversation.\n *\n * **A message that mounts complete did not arrive**, so `streaming` also decides whether anything\n * animates at all — a transcript loaded from history must not replay itself, which is the one rule\n * of `MessageText` that has no counterpart in a prop and has to be spelled here.\n */\nexport interface MessageMarkdownProps\n extends Omit<StreamdownProps, \"children\" | \"mode\" | \"animated\"> {\n /** The answer so far, as markdown. Grows; never rewritten. */\n children: string;\n /** More is coming: closes the incomplete markdown, animates the arrival, draws the caret. */\n streaming?: boolean;\n /**\n * Renames the part. Declared here and nowhere else in the package: every other component takes\n * `slot` for free from `React.HTMLAttributes`, and `StreamdownProps` is react-markdown's\n * `Options` rather than the attributes of an element, so it carries no `slot` to inherit.\n */\n slot?: string;\n}\n\n/** `MessageText`'s cascade, so the two components keep the same rhythm. See its docblock. */\nconst STAGGER = 18;\n\nexport const MessageMarkdown = (props: MessageMarkdownProps) => {\n const { children, streaming = false, className, slot, ...rest } = props;\n\n return (\n // The element exists so the part has one. `Streamdown` renders a `div` of its own but drops\n // every prop it does not consume — measured, not assumed, and `markdown.test.tsx` is what keeps\n // it measured: `data-slot` and `data-streaming` handed to it reach no attribute at all. So the\n // two things a consumer selects on are written here, on an element we own, and only\n // Streamdown's own options are passed down.\n <div\n className={cn(\"min-w-0 break-words\", className)}\n data-streaming={streaming || undefined}\n data-slot={slot ?? \"message-markdown\"}\n >\n <Streamdown\n animated={streaming ? { sep: \"word\", stagger: STAGGER } : false}\n // Streamdown's own caret, rather than the `<span>` `MessageText` draws: it belongs at the\n // end of the last *rendered* block, which only the renderer knows — a caret appended by us\n // would sit after a table rather than inside the paragraph the model is still writing.\n caret={streaming ? \"block\" : undefined}\n mode={streaming ? \"streaming\" : \"static\"}\n // The whole point. `false` renders `**bo` as two asterisks and a `bo`.\n parseIncompleteMarkdown={streaming}\n {...rest}\n >\n {children}\n </Streamdown>\n </div>\n );\n};\n"],"names":["STAGGER","MessageMarkdown","props","children","streaming","className","slot","rest","jsx","cn","Streamdown"],"mappings":";;;AAyDA,MAAMA,IAAU,IAEHC,IAAkB,CAACC,MAAgC;AAC9D,QAAM,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAO,WAAAC,GAAW,MAAAC,GAAM,GAAGC,MAASL;AAElE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAME,gBAAAM;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC,EAAG,uBAAuBJ,CAAS;AAAA,QAC9C,kBAAgBD,KAAa;AAAA,QAC7B,aAAWE,KAAQ;AAAA,QAEnB,UAAA,gBAAAE;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,UAAUN,IAAY,EAAE,KAAK,QAAQ,SAASJ,MAAY;AAAA,YAI1D,OAAOI,IAAY,UAAU;AAAA,YAC7B,MAAMA,IAAY,cAAc;AAAA,YAEhC,yBAAyBA;AAAA,YACxB,GAAGG;AAAA,YAEH,UAAAJ;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA;AAGN;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanzo-tech/ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Kanzo AI surfaces — the transcript, the composer, a model's reasoning and the calls it makes, plus the field affordances that stream into a value. Sibling of @kanzo-tech/ui, not part of it: a Message has a role and one of the roles is `assistant`, which is domain knowledge the generic vocabulary does not carry.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"./tailwind.css": "./src/tailwind.css",
|
|
27
27
|
"./package.json": "./package.json"
|
|
28
28
|
},
|
|
29
|
-
"//peers": "Everything on the root barrel draws with @kanzo-tech/ui's parts and Ark's machines, so both are required peers rather than dependencies — two copies of Ark would mean two portals and two focus traps. streamdown is the one OPTIONAL peer, and it is why ./markdown exists: it measures 495 kB minified and 128 kB brotli on its own, against a 20 kB budget for the whole root barrel, so a host that renders plain text must not pay for a markdown parser. Same door as @kanzo-tech/ui/editor and @kanzo-tech/
|
|
29
|
+
"//peers": "Everything on the root barrel draws with @kanzo-tech/ui's parts and Ark's machines, so both are required peers rather than dependencies — two copies of Ark would mean two portals and two focus traps. streamdown is the one OPTIONAL peer, and it is why ./markdown exists: it measures 495 kB minified and 128 kB brotli on its own, against a 20 kB budget for the whole root barrel, so a host that renders plain text must not pay for a markdown parser. Same door as @kanzo-tech/ui/editor and @kanzo-tech/ui/analytics.",
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@ark-ui/react": "^5.37.2",
|
|
32
32
|
"lucide-react": ">=1",
|
|
33
33
|
"react": ">=19",
|
|
34
34
|
"react-dom": ">=19",
|
|
35
35
|
"streamdown": ">=2",
|
|
36
|
-
"@kanzo-tech/ui": "0.
|
|
36
|
+
"@kanzo-tech/ui": "0.14.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"tailwind-variants": "^3.2.2"
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"react-dom": "^19.0.0",
|
|
52
52
|
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
53
53
|
"streamdown": "^2.5.0",
|
|
54
|
-
"@kanzo-tech/theme": "0.
|
|
55
|
-
"@kanzo-tech/ui": "0.
|
|
54
|
+
"@kanzo-tech/theme": "0.14.0",
|
|
55
|
+
"@kanzo-tech/ui": "0.14.0"
|
|
56
56
|
},
|
|
57
57
|
"//size-limit": "First measurement taken at the split, so this budget is a change detector from day one rather than a number inherited from somewhere. The four AI-assist modules that moved here cost @kanzo-tech/ui's root barrel about 4 kB when they arrived (38 -> 42 kB, recorded in that package's own note); the barrel is rebaselined down by the same move.",
|
|
58
58
|
"size-limit": [
|