ranuts 0.4.1-alpha.1 → 0.5.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/CLAUDE.md +178 -26
- package/README.de.md +62 -0
- package/README.es.md +62 -0
- package/README.fa.md +62 -0
- package/README.ja.md +62 -0
- package/README.ko.md +62 -0
- package/README.md +35 -90
- package/README.pt.md +62 -0
- package/README.zh-CN.md +35 -89
- package/dist/iife/index.iife.js +4 -0
- package/dist/iife/utils.iife.js +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +306 -1
- package/dist/src/_virtual/_rolldown/runtime/index.js +12 -0
- package/dist/src/conversation/engine.d.ts +109 -0
- package/dist/src/conversation/engine.js +101 -0
- package/dist/src/conversation/index.d.ts +12 -0
- package/dist/src/conversation/index.js +4 -0
- package/dist/src/conversation/types.d.ts +99 -0
- package/dist/src/stream/accumulator.d.ts +51 -0
- package/dist/src/stream/accumulator.js +79 -0
- package/dist/src/stream/budget.d.ts +89 -0
- package/dist/src/stream/budget.js +45 -0
- package/dist/src/stream/index.d.ts +25 -0
- package/dist/src/stream/index.js +11 -0
- package/dist/src/stream/sse.d.ts +51 -0
- package/dist/src/stream/sse.js +61 -0
- package/dist/src/stream/types.d.ts +106 -0
- package/dist/src/sw/index.js +52 -1
- package/dist/src/utils/async.js +49 -0
- package/dist/src/utils/audioRecorder.js +1121 -0
- package/dist/src/utils/behavior.js +9 -0
- package/dist/src/utils/binary.js +89 -0
- package/dist/src/utils/bom.d.ts +31 -9
- package/dist/src/utils/bom.js +165 -0
- package/dist/src/utils/bridge.js +310 -0
- package/dist/src/utils/canvas.d.ts +1 -0
- package/dist/src/utils/canvas.js +103 -0
- package/dist/src/utils/chain.js +76 -0
- package/dist/src/utils/color.d.ts +0 -1
- package/dist/src/utils/color.js +312 -0
- package/dist/src/utils/compose.js +22 -0
- package/dist/src/utils/console.js +22 -0
- package/dist/src/utils/debounce.js +18 -0
- package/dist/src/utils/device.d.ts +0 -9
- package/dist/src/utils/device.js +31 -0
- package/dist/src/utils/diff.d.ts +51 -0
- package/dist/src/utils/diff.js +110 -0
- package/dist/src/utils/dom.d.ts +1 -1
- package/dist/src/utils/dom.js +89 -0
- package/dist/src/utils/error.js +11 -0
- package/dist/src/utils/event.d.ts +3 -3
- package/dist/src/utils/event.js +39 -0
- package/dist/src/utils/file.js +14 -0
- package/dist/src/utils/func.js +4 -0
- package/dist/src/utils/i18n/index.js +79 -1
- package/dist/src/utils/idb.js +177 -0
- package/dist/src/utils/img.d.ts +1 -1
- package/dist/src/utils/img.js +68 -0
- package/dist/src/utils/index.d.ts +81 -77
- package/dist/src/utils/index.js +306 -1
- package/dist/src/utils/lang.d.ts +23 -6
- package/dist/src/utils/lang.js +42 -0
- package/dist/src/utils/localePath.js +48 -0
- package/dist/src/utils/memoize.d.ts +1 -7
- package/dist/src/utils/memoize.js +16 -0
- package/dist/src/utils/mimeType.js +841 -0
- package/dist/src/utils/monitor.js +84 -0
- package/dist/src/utils/network.js +117 -0
- package/dist/src/utils/noop.js +5 -0
- package/dist/src/utils/number.d.ts +20 -0
- package/dist/src/utils/number.js +185 -0
- package/dist/src/utils/obj.d.ts +2 -2
- package/dist/src/utils/obj.js +140 -0
- package/dist/src/utils/paginate.js +93 -0
- package/dist/src/utils/performance.js +26 -0
- package/dist/src/utils/placement.d.ts +42 -5
- package/dist/src/utils/placement.js +37 -0
- package/dist/src/utils/prefetch.js +69 -0
- package/dist/src/utils/queue.js +46 -0
- package/dist/src/utils/report.js +44 -0
- package/dist/src/utils/request.js +35 -0
- package/dist/src/utils/script.d.ts +1 -1
- package/dist/src/utils/script.js +46 -0
- package/dist/src/utils/scroll.d.ts +93 -0
- package/dist/src/utils/scroll.js +62 -0
- package/dist/src/utils/secure.js +36 -0
- package/dist/src/utils/segment.js +43 -0
- package/dist/src/utils/signal.d.ts +1 -1
- package/dist/src/utils/signal.js +13 -0
- package/dist/src/utils/speech.js +59 -0
- package/dist/src/utils/storage.js +53 -0
- package/dist/src/utils/str.d.ts +0 -6
- package/dist/src/utils/str.js +395 -0
- package/dist/src/utils/style.js +29 -0
- package/dist/src/utils/subscribe.js +58 -0
- package/dist/src/utils/throttle.js +17 -0
- package/dist/src/utils/time.d.ts +0 -21
- package/dist/src/utils/time.js +97 -0
- package/dist/src/utils/totp/sha/common.d.ts +1 -1
- package/dist/src/utils/totp/sha/common.js +201 -0
- package/dist/src/utils/totp/sha/converters.d.ts +1 -1
- package/dist/src/utils/totp/sha/converters.js +188 -0
- package/dist/src/utils/totp/sha/primitives_32.js +55 -0
- package/dist/src/utils/totp/sha/primitives_64.js +85 -0
- package/dist/src/utils/totp/sha/sha.d.ts +1 -1
- package/dist/src/utils/totp/sha/sha.js +30 -0
- package/dist/src/utils/totp/sha/sha1.d.ts +2 -2
- package/dist/src/utils/totp/sha/sha1.js +51 -0
- package/dist/src/utils/totp/sha/sha256.d.ts +2 -2
- package/dist/src/utils/totp/sha/sha256.js +56 -0
- package/dist/src/utils/totp/sha/sha3.d.ts +3 -3
- package/dist/src/utils/totp/sha/sha3.js +253 -0
- package/dist/src/utils/totp/sha/sha512.d.ts +3 -3
- package/dist/src/utils/totp/sha/sha512.js +177 -0
- package/dist/src/utils/totp/totp.js +49 -0
- package/dist/src/utils/tween.js +59 -0
- package/dist/src/utils/visual/application.d.ts +4 -4
- package/dist/src/utils/visual/application.js +42 -0
- package/dist/src/utils/visual/enums.js +19 -0
- package/dist/src/utils/visual/event/boundary.d.ts +2 -2
- package/dist/src/utils/visual/event/boundary.js +93 -0
- package/dist/src/utils/visual/event/event.d.ts +1 -1
- package/dist/src/utils/visual/event/event.js +34 -0
- package/dist/src/utils/visual/event/index.d.ts +4 -4
- package/dist/src/utils/visual/event/types.d.ts +2 -2
- package/dist/src/utils/visual/event/types.js +23 -0
- package/dist/src/utils/visual/graphics/graphics.d.ts +8 -8
- package/dist/src/utils/visual/graphics/graphics.js +168 -0
- package/dist/src/utils/visual/graphics/graphicsData.d.ts +3 -3
- package/dist/src/utils/visual/graphics/graphicsData.js +12 -0
- package/dist/src/utils/visual/graphics/graphicsGeometry.d.ts +7 -7
- package/dist/src/utils/visual/graphics/graphicsGeometry.js +39 -0
- package/dist/src/utils/visual/graphics/index.d.ts +3 -3
- package/dist/src/utils/visual/index.d.ts +8 -8
- package/dist/src/utils/visual/index.js +20 -1
- package/dist/src/utils/visual/math/bezier.js +15 -0
- package/dist/src/utils/visual/math/enums.js +6 -0
- package/dist/src/utils/visual/math/index.d.ts +4 -4
- package/dist/src/utils/visual/math/matrix.d.ts +1 -1
- package/dist/src/utils/visual/math/matrix.js +59 -0
- package/dist/src/utils/visual/math/transform.d.ts +2 -2
- package/dist/src/utils/visual/math/transform.js +50 -0
- package/dist/src/utils/visual/render/batchRenderer.d.ts +4 -4
- package/dist/src/utils/visual/render/batchRenderer.js +59 -0
- package/dist/src/utils/visual/render/canvasRenderer.d.ts +3 -3
- package/dist/src/utils/visual/render/canvasRenderer.js +17 -0
- package/dist/src/utils/visual/render/filter.d.ts +1 -1
- package/dist/src/utils/visual/render/filter.js +92 -0
- package/dist/src/utils/visual/render/index.d.ts +2 -2
- package/dist/src/utils/visual/render/index.js +20 -0
- package/dist/src/utils/visual/render/render.d.ts +4 -4
- package/dist/src/utils/visual/render/render.js +19 -0
- package/dist/src/utils/visual/render/renderTarget.js +28 -0
- package/dist/src/utils/visual/render/utils/batch/index.d.ts +4 -4
- package/dist/src/utils/visual/render/utils/batch/index.js +88 -0
- package/dist/src/utils/visual/render/utils/earcut.js +328 -0
- package/dist/src/utils/visual/render/utils/float.js +65 -0
- package/dist/src/utils/visual/render/utils/index.js +50 -0
- package/dist/src/utils/visual/render/utils/verticy.d.ts +2 -2
- package/dist/src/utils/visual/render/utils/verticy.js +162 -0
- package/dist/src/utils/visual/render/utils/webgl/initShader.d.ts +1 -1
- package/dist/src/utils/visual/render/utils/webgl/initShader.js +31 -0
- package/dist/src/utils/visual/render/utils/webgl/shaders.js +22 -0
- package/dist/src/utils/visual/render/utils/webgpu/shaders.js +32 -0
- package/dist/src/utils/visual/render/webGPURenderer.d.ts +2 -2
- package/dist/src/utils/visual/render/webGPURenderer.js +185 -0
- package/dist/src/utils/visual/render/webGlRenderer.d.ts +2 -2
- package/dist/src/utils/visual/render/webGlRenderer.js +88 -0
- package/dist/src/utils/visual/shape/circle.d.ts +3 -3
- package/dist/src/utils/visual/shape/circle.js +17 -0
- package/dist/src/utils/visual/shape/ellipse.d.ts +3 -3
- package/dist/src/utils/visual/shape/ellipse.js +18 -0
- package/dist/src/utils/visual/shape/index.d.ts +6 -6
- package/dist/src/utils/visual/shape/polygon.d.ts +3 -3
- package/dist/src/utils/visual/shape/polygon.js +29 -0
- package/dist/src/utils/visual/shape/rectangle.d.ts +3 -3
- package/dist/src/utils/visual/shape/rectangle.js +18 -0
- package/dist/src/utils/visual/shape/roundedRectangle.d.ts +3 -3
- package/dist/src/utils/visual/shape/roundedRectangle.js +32 -0
- package/dist/src/utils/visual/shape/shape.d.ts +2 -2
- package/dist/src/utils/visual/shape/shape.js +5 -0
- package/dist/src/utils/visual/style/fill.js +18 -0
- package/dist/src/utils/visual/style/index.d.ts +2 -2
- package/dist/src/utils/visual/style/line.d.ts +2 -2
- package/dist/src/utils/visual/style/line.js +18 -0
- package/dist/src/utils/visual/types.d.ts +1 -1
- package/dist/src/utils/visual/vertex/container.d.ts +5 -5
- package/dist/src/utils/visual/vertex/container.js +54 -0
- package/dist/src/utils/visual/vertex/point.js +37 -0
- package/dist/src/utils/visual/vertex/vertex.d.ts +7 -7
- package/dist/src/utils/visual/vertex/vertex.js +76 -0
- package/dist/src/utils/worker.js +89 -0
- package/dist/src/utils/zip.js +161 -0
- package/dist/src/vnode/h.d.ts +1 -1
- package/dist/src/vnode/h.js +22 -0
- package/dist/src/vnode/hooks.d.ts +1 -1
- package/dist/src/vnode/htmlDomApi.js +94 -0
- package/dist/src/vnode/index.d.ts +16 -16
- package/dist/src/vnode/index.js +28 -1
- package/dist/src/vnode/init.d.ts +1 -1
- package/dist/src/vnode/init.js +104 -0
- package/dist/src/vnode/is.d.ts +1 -1
- package/dist/src/vnode/is.js +20 -0
- package/dist/src/vnode/modules/attributes.d.ts +1 -1
- package/dist/src/vnode/modules/attributes.js +21 -0
- package/dist/src/vnode/modules/class.d.ts +1 -1
- package/dist/src/vnode/modules/class.js +18 -0
- package/dist/src/vnode/modules/index.js +15 -0
- package/dist/src/vnode/modules/listeners.d.ts +1 -1
- package/dist/src/vnode/modules/listeners.js +36 -0
- package/dist/src/vnode/modules/props.d.ts +1 -1
- package/dist/src/vnode/modules/props.js +17 -0
- package/dist/src/vnode/modules/style.d.ts +1 -1
- package/dist/src/vnode/modules/style.js +52 -0
- package/dist/src/vnode/vnode.d.ts +6 -6
- package/dist/src/vnode/vnode.js +13 -0
- package/dist/third-party/jschardet/LICENSE.txt +504 -0
- package/dist/third-party/jschardet/NOTICE.txt +33 -0
- package/docs/API.md +86 -65
- package/package.json +20 -15
- package/dist/bin/generate-api-docs.d.ts +0 -1
- package/dist/build/build.es.d.ts +0 -2
- package/dist/build/build.umd.d.ts +0 -2
- package/dist/build/build.umd.node.d.ts +0 -2
- package/dist/build/build.umd.utils.d.ts +0 -2
- package/dist/chain-CTywmh_H.js +0 -1
- package/dist/color-B_KMM8UX.js +0 -1
- package/dist/enums-BAgbyGdH.js +0 -1
- package/dist/examples/clone-deep-example.d.ts +0 -1
- package/dist/examples/is-equal-example.d.ts +0 -1
- package/dist/i18n-BJIS1fR1.js +0 -1
- package/dist/plugins/vite-plugins-banner.d.ts +0 -2
- package/dist/rolldown-runtime-I3TIJKkN.js +0 -1
- package/dist/src/node/appendFile.d.ts +0 -7
- package/dist/src/node/body.d.ts +0 -9
- package/dist/src/node/color.d.ts +0 -7
- package/dist/src/node/command.d.ts +0 -8
- package/dist/src/node/ctx2req.d.ts +0 -5
- package/dist/src/node/fileInfo.d.ts +0 -7
- package/dist/src/node/fs.d.ts +0 -7
- package/dist/src/node/get.d.ts +0 -10
- package/dist/src/node/getIPAdress.d.ts +0 -1
- package/dist/src/node/index.d.ts +0 -25
- package/dist/src/node/index.js +0 -1
- package/dist/src/node/isColorSupported.d.ts +0 -2
- package/dist/src/node/paresUrl.d.ts +0 -19
- package/dist/src/node/readDir.d.ts +0 -6
- package/dist/src/node/readFile.d.ts +0 -9
- package/dist/src/node/router.d.ts +0 -42
- package/dist/src/node/send.d.ts +0 -7
- package/dist/src/node/server.d.ts +0 -18
- package/dist/src/node/startTask.d.ts +0 -2
- package/dist/src/node/stream.d.ts +0 -15
- package/dist/src/node/taskEnd.d.ts +0 -2
- package/dist/src/node/traverse.d.ts +0 -17
- package/dist/src/node/watchFile.d.ts +0 -8
- package/dist/src/node/writeFile.d.ts +0 -8
- package/dist/src/node/ws.d.ts +0 -8
- package/dist/src/utils/visual/render/utils/batch/index.test.d.ts +0 -1
- package/dist/src/utils/visual/render/utils/index.test.d.ts +0 -1
- package/dist/test/binary.test.d.ts +0 -1
- package/dist/test/bridge.test.d.ts +0 -1
- package/dist/test/canvas.test.d.ts +0 -1
- package/dist/test/clearBr.test.d.ts +0 -1
- package/dist/test/cloneDeep.test.d.ts +0 -1
- package/dist/test/color.test.d.ts +0 -1
- package/dist/test/command.test.d.ts +0 -1
- package/dist/test/encodeUrl.test.d.ts +0 -1
- package/dist/test/escapeHtml.test.d.ts +0 -1
- package/dist/test/is-equal.test.d.ts +0 -1
- package/dist/test/mimeType.test.d.ts +0 -1
- package/dist/test/package-exports.test.d.ts +0 -1
- package/dist/test/server.test.d.ts +0 -1
- package/dist/test/status.test.d.ts +0 -1
- package/dist/test/sw.test.d.ts +0 -1
- package/dist/test/totp.test.d.ts +0 -1
- package/dist/test/tween.test.d.ts +0 -1
- package/dist/test/utils/async.test.d.ts +0 -1
- package/dist/test/utils/autosize.test.d.ts +0 -1
- package/dist/test/utils/color-grade.test.d.ts +0 -1
- package/dist/test/utils/compose.test.d.ts +0 -1
- package/dist/test/utils/event.test.d.ts +0 -1
- package/dist/test/utils/file-read.test.d.ts +0 -1
- package/dist/test/utils/format.test.d.ts +0 -1
- package/dist/test/utils/i18n.test.d.ts +0 -1
- package/dist/test/utils/idb-collection.test.d.ts +0 -1
- package/dist/test/utils/idb.test.d.ts +0 -1
- package/dist/test/utils/instrumentation.test.d.ts +0 -1
- package/dist/test/utils/interp.test.d.ts +0 -1
- package/dist/test/utils/lang.test.d.ts +0 -1
- package/dist/test/utils/locale-path.test.d.ts +0 -1
- package/dist/test/utils/media-query.test.d.ts +0 -1
- package/dist/test/utils/mergeObj.test.d.ts +0 -1
- package/dist/test/utils/number-parse.test.d.ts +0 -1
- package/dist/test/utils/paginate.test.d.ts +0 -1
- package/dist/test/utils/placement.test.d.ts +0 -1
- package/dist/test/utils/prefetch.test.d.ts +0 -1
- package/dist/test/utils/query-storage.test.d.ts +0 -1
- package/dist/test/utils/queue.test.d.ts +0 -1
- package/dist/test/utils/report-config.test.d.ts +0 -1
- package/dist/test/utils/report-image.test.d.ts +0 -1
- package/dist/test/utils/secure.test.d.ts +0 -1
- package/dist/test/utils/segment.test.d.ts +0 -1
- package/dist/test/utils/signal-once.test.d.ts +0 -1
- package/dist/test/utils/single-flight.test.d.ts +0 -1
- package/dist/test/utils/speech.test.d.ts +0 -1
- package/dist/test/utils/text-boundary.test.d.ts +0 -1
- package/dist/test/utils/time.test.d.ts +0 -1
- package/dist/test/utils/timing.test.d.ts +0 -1
- package/dist/test/utils/truncate.test.d.ts +0 -1
- package/dist/test/utils/visual/filter.test.d.ts +0 -1
- package/dist/test/utils/worker-client.test.d.ts +0 -1
- package/dist/test/utils/worker-serve.test.d.ts +0 -1
- package/dist/test/utils/zip.test.d.ts +0 -1
- package/dist/test/visual/math.test.d.ts +0 -1
- package/dist/test/visual-application.test.d.ts +0 -1
- package/dist/test/visual-batch.test.d.ts +0 -1
- package/dist/test/visual-math.test.d.ts +0 -1
- package/dist/test/vnode/index.d.ts +0 -1
- package/dist/test/vnode/server.d.ts +0 -2
- package/dist/test/vnode/vnode.d.ts +0 -1
- package/dist/test/vnode.test.d.ts +0 -1
- package/dist/test/websocket.test.d.ts +0 -1
- package/dist/test/writeFile.test.d.ts +0 -1
- package/dist/umd/index.umd.cjs +0 -1
- package/dist/umd/node/node.umd.cjs +0 -1
- package/dist/umd/utils/utils.umd.cjs +0 -1
- package/dist/utils-BNwhohXq.js +0 -1
- package/dist/vite.config.d.ts +0 -8
- package/dist/vitest.config.d.ts +0 -2
package/docs/API.md
CHANGED
|
@@ -8,16 +8,17 @@ constraints, conventions) read [../CLAUDE.md](../CLAUDE.md) first.
|
|
|
8
8
|
Import from the **subpath** that owns the symbol, e.g. `import { debounce } from
|
|
9
9
|
'ranuts/utils'`. The root `ranuts` barrel re-exports the utils + visual surface.
|
|
10
10
|
|
|
11
|
-
**
|
|
11
|
+
**422 exports** across 7 entry points.
|
|
12
12
|
|
|
13
13
|
## Entry points
|
|
14
14
|
|
|
15
|
-
- [`ranuts/utils`](#ranuts-utils) — Browser and general-purpose utilities · _browser + node_ ·
|
|
15
|
+
- [`ranuts/utils`](#ranuts-utils) — Browser and general-purpose utilities · _browser + node_ · 333 exports
|
|
16
16
|
- [`ranuts/sw`](#ranuts-sw) — Service Worker caching strategies and the precache protocol · _service worker only_ · 9 exports
|
|
17
|
-
- [`ranuts/node`](#ranuts-node) — Node server utilities (fs / http / ws / middleware) · _node only_ · 26 exports
|
|
18
17
|
- [`ranuts/visual`](#ranuts-visual) — 2D rendering engine (Canvas / WebGL / WebGPU) · _browser only_ · 16 exports
|
|
19
18
|
- [`ranuts/i18n`](#ranuts-i18n) — Framework-agnostic i18n engine (also re-exported from ranuts/utils) · _browser + node_ · 9 exports
|
|
20
19
|
- [`ranuts/vnode`](#ranuts-vnode) — Snabbdom-style virtual DOM · _browser_ · 26 exports
|
|
20
|
+
- [`ranuts/stream`](#ranuts-stream) — SSE parsing, a provider-neutral model-stream fold, and the token budget that decides when a history stops fitting · _browser + node_ · 20 exports
|
|
21
|
+
- [`ranuts/conversation`](#ranuts-conversation) — Project an append-only event log into renderable conversation nodes · _browser + node_ · 9 exports
|
|
21
22
|
|
|
22
23
|
## `ranuts/utils`
|
|
23
24
|
|
|
@@ -34,6 +35,7 @@ import { /* … */ } from 'ranuts/utils';
|
|
|
34
35
|
- `addNumSym(value: string | number, flag?: string | number) => string`
|
|
35
36
|
- `adoptSheetText(shadowRoot: ShadowRoot, cssText: string, marker?: string) => void` — Inject dynamic styles supplied at runtime (a component's `sheet` property, say).
|
|
36
37
|
- `adoptStyles(shadowRoot: ShadowRoot, cssText: string, marker?: string) => void` — Inject a component's static styles into a shadow root.
|
|
38
|
+
- `alignCrossAxis(align: PlacementAlign, anchorStart: number, anchorSize: number, floatingSize: number) => number` — Where a floating panel starts along the cross axis, given how
|
|
37
39
|
- `appendUrl(url: string, params?: Record<string, string>) => string` — Turn an object into a query string and append it to a URL
|
|
38
40
|
- `arrayBufferToString(buffer: ArrayBuffer | Uint8Array) => string` — Decode bytes into a string using the sniffed encoding. Required when reading
|
|
39
41
|
- `autosizeTextarea(element: HTMLTextAreaElement) => (() => void)` — Make a `<textarea>` grow and shrink with its content, so a long message is
|
|
@@ -55,18 +57,19 @@ import { /* … */ } from 'ranuts/utils';
|
|
|
55
57
|
- `compose<T>(middleware: Array<Middleware<T>>) => ComposedMiddleware<T>` — Run a chain of async functions as if it were sequential
|
|
56
58
|
- `computePlacement(options: ComputePlacementOptions) => ComputedPlacement` — Position a floating panel relative to an anchor rect: flips to the opposite
|
|
57
59
|
- `concatBytes(chunks: readonly Uint8Array[]) => Uint8Array` — Join byte chunks into one buffer, in order.
|
|
58
|
-
- `connection() =>
|
|
60
|
+
- `connection() => NetworkInformation | undefined` — Current network status: type, throughput, and whether the connection changed
|
|
59
61
|
- `convertImageToBase64(file: File) => Promise<convertImageToBase64Return>` — Convert an image to base64
|
|
60
62
|
- `cosinePalette(t: number, a: RGB, b: RGB, c: RGB, d: RGB) => RGB` — Inigo Quilez cosine gradient palette: `a + b * cos(2π(c·t + d))`. Each of `a,b,c,d` is an RGB triple; `t` is the position 0..1. Returns an RGB triple.
|
|
61
63
|
- `crc32(data: Uint8Array) => number` — CRC32 checksum (IEEE 802.3 polynomial), the one ZIP stores per entry.
|
|
62
64
|
- `create(tagName: string, options?: ElementCreationOptions) => Chain`
|
|
65
|
+
- `createBottomFollower(options: BottomFollowerOptions) => BottomFollower` — Creates a bottom-follow controller for one scrollport.
|
|
63
66
|
- `createData(params?: Record<string, unknown>) => Record<string, unknown>` — Build the standard envelope that accompanies a report — page URL, referrer,
|
|
64
67
|
- `createDocumentFragment(list: Element[]) => DocumentFragment | undefined` — Create a DocumentFragment
|
|
65
68
|
- `createDoubleTapDetector(options?: DoubleTapDetectorOptions) => DoubleTapDetector` — Double-tap detection over raw `(x, y, time)` samples — pointer-type-agnostic,
|
|
66
69
|
- `createHandoff<T>({ dbName, storeName, key }: HandoffOptions) => Handoff<T>` — A one-shot value handoff between two pages of the same origin, backed by
|
|
67
70
|
- `createI18n<TDict extends StringValues<TDict> = MessageDict>(config?: I18nConfig<TDict>) => I18nCore<TDict>` — Create and register the global i18n singleton.
|
|
68
71
|
- `createLocalePath(config: LocalePathConfig) => LocalePath` — Create the set of locale path conversion functions.
|
|
69
|
-
- `createObjectURL(src: Blob | ArrayBuffer | Response) => Promise<string>`
|
|
72
|
+
- `createObjectURL(src: string | Blob | ArrayBuffer | Response) => Promise<string>`
|
|
70
73
|
- `createPortBridge(port: MessagePort) => PortBridge` — Build a bridge on any MessagePort (a Web Worker, a SharedWorker, or a port from a completed handshake).
|
|
71
74
|
- `createRaceGuard() => RaceGuard` — Bump-and-compare guard against a stale async response overwriting a newer
|
|
72
75
|
- `createSignal<T = unknown>(value: T, options?: SignalOptions<T>) => [() => T, (newValue: T) => void]` — Create a minimal signal with optional event broadcasting, returned as
|
|
@@ -80,15 +83,17 @@ import { /* … */ } from 'ranuts/utils';
|
|
|
80
83
|
- `decodeTextBytes(bytes: Uint8Array, encodings?: string[]) => string` — Decode text bytes, trying encodings in order until one holds.
|
|
81
84
|
- `deferred<T = void>() => Deferred<T>` — A promise plus its `resolve` / `reject`, for the case where the thing that
|
|
82
85
|
- `delay(ms: number) => Promise<void>` — Resolve after `ms` milliseconds. Uses the bare `setTimeout`, so it works in
|
|
83
|
-
- `detectLanguage(text: string, sampleSize?: number) => TextLanguage` — Decide a text's primary
|
|
86
|
+
- `detectLanguage(text: string, sampleSize?: number) => TextLanguage` — Decide a text's primary script from character ratios. Pure statistics, no
|
|
87
|
+
- `diffLines(oldText: string, newText: string, options?: DiffOptions) => DiffHunk[]` — Diffs two texts by line.
|
|
84
88
|
- `durationHandler<T, U>(handler: (...args: T[]) => U, ...params: T[]) => ((a: number) => Promise<U>)` — Run a function repeatedly at a fixed interval
|
|
85
89
|
- `encodeUrl(url: string) => string` — Encode a URL to a percent-encoded form, excluding already-encoded sequences.
|
|
86
90
|
- `escapeHtml(string?: string | number | null) => string`
|
|
87
91
|
- `fanShapedByArc(ctx: CanvasRenderingContext2D, maxRadius: number, start: number, end: number, gutter: number) => void` — Trace a pie slice with arc(), including the gutter between slices.
|
|
88
92
|
- `fenceCode(body: string, lang?: string) => string` — Wrap text in a Markdown code fence long enough to survive backticks inside it.
|
|
89
93
|
- `fetchMaybeGzip(input: RequestInfo | URL, init?: RequestInit) => Promise<Uint8Array>` — Fetch a resource that may be delivered gzipped or already
|
|
90
|
-
- `filterObj(obj: Record<string, unknown>, list: Array<string>) => Record<string, unknown>` — Return a new object without the
|
|
94
|
+
- `filterObj(obj: Record<string, unknown>, list: Array<string>) => Record<string, unknown>` — Return a new object without the listed keys — typically used to drop fields before sending an object on
|
|
91
95
|
- `fit(value: number, a1: number, a2: number, b1: number, b2: number) => number` — Remap `value` from `[a1, a2]` onto `[b1, b2]` and clamp to the output range — the shader `fit`.
|
|
96
|
+
- `formatBytes(bytes: number) => string` — Format a byte count for a person to read.
|
|
92
97
|
- `formatDate(value?: DateInput, pattern?: string) => string` — Format a date with a token pattern. Accepts a timestamp, a date string, a
|
|
93
98
|
- `formatDuration(seconds: number) => string` — Format an elapsed number of **seconds** as a colon-separated clock duration,
|
|
94
99
|
- `formatJson(value: string | object, onError?: (error: Error) => void, indent?: number) => string` — Pretty-print JSON. Accepts an object or a JSON string (single quotes are
|
|
@@ -155,8 +160,6 @@ import { /* … */ } from 'ranuts/utils';
|
|
|
155
160
|
- `luma(r: number, g: number, b: number) => number` — Perceived brightness (luma) of an RGB colour using Rec. 601 weights. Channels may be 0..1 or 0..255 — the result keeps that scale.
|
|
156
161
|
- `matchMediaQuery(query: string) => boolean` — Read whether a media query currently matches, synchronously. Returns false under SSR.
|
|
157
162
|
- `mathjs(a: number, type: string, b: number) => ComputeNumberResult`
|
|
158
|
-
- `md5(str: string) => string` — MD5 hash function implementation
|
|
159
|
-
- `memoize<T extends Func>(fn: T | unknown) => ((...args: Parameters<T>) => ReturnType<T>)` — Former name of `once`. The name is misleading — it does not cache per
|
|
160
163
|
- `merge(a: Obj, b?: Obj) => Obj` — Merge objects
|
|
161
164
|
- `mergeExports(obj: Record<string, string>, exports: Record<string, string>) => Record<string, string>` — Copy an exports object onto `obj`, then freeze it
|
|
162
165
|
- `navigatorLanguage() => TextLanguage` — Map the browser UI language into the same buckets (the default when there is
|
|
@@ -192,7 +195,7 @@ import { /* … */ } from 'ranuts/utils';
|
|
|
192
195
|
- `removeClassToElement(element: Element, removeClass: string) => void` — Remove a class from an element
|
|
193
196
|
- `replaceOld(source: any, name: string, replacement: (...args: unknown[]) => unknown, isForced?: boolean) => () => void` — Replace a property on an object, wrapping whatever was there before.
|
|
194
197
|
- `report({ url, type, payload }: BeaconPayload) => boolean` — Send a telemetry beacon. Prefers `navigator.sendBeacon` (does not block
|
|
195
|
-
- `requestUrlToBuffer(src: string, options
|
|
198
|
+
- `requestUrlToBuffer{ (src: string, options?: Partial<RequestUrlToArraybufferOption<'' | 'arraybuffer'>>): Promise<requestUrlToArraybufferReturn>; <T extends XML… (+2 overloads)` — Fetch a URL as an ArrayBuffer by default, or as the requested XHR response type
|
|
196
199
|
- `resolveLocale(options: ResolveLocaleOptions) => string` — Resolve which of your supported locales to use, from the usual chain:
|
|
197
200
|
- `rewriteZip(bytes: Uint8Array, options?: RewriteZipOptions) => Promise<Uint8Array>` — Rebuild an archive with some entries replaced and/or new entries appended.
|
|
198
201
|
- `rgbaString(r: number, g: number, b: number, a: number) => string` — Build a CSS `rgba()` string. Alpha is 0–100 rather than 0–1, matching the
|
|
@@ -220,8 +223,6 @@ import { /* … */ } from 'ranuts/utils';
|
|
|
220
223
|
- `srgbToLinear(c: number) => number` — Convert one sRGB channel (0..1) to linear-light (IEC 61966-2-1 transfer function).
|
|
221
224
|
- `strParse(str?: string, sep?: string | RegExp, eq?: string | RegExp) => Record<string, string>` — Parse a delimited string into an object, e.g.
|
|
222
225
|
- `throttle<T extends (...args: any[]) => any>(fn: T, delay?: number) => Throttled<T>` — Throttle — under a burst of calls, run at a fixed interval: the first call
|
|
223
|
-
- `timeFormat(time: number) => string` — Format a number of seconds as a colon-separated duration
|
|
224
|
-
- `timestampToTime(timestamp?: number | string) => Date & { format?: Function; }` — Turn a timestamp into a `Date` carrying a `format` method.
|
|
225
226
|
- `toFullWidth(value: string) => string` — Convert half-width characters to full-width (the inverse of `toHalfWidth`)
|
|
226
227
|
- `toHalfWidth(value: string) => string` — Convert full-width characters to half-width (digits, letters, punctuation and
|
|
227
228
|
- `toString(value: string | number) => string`
|
|
@@ -264,6 +265,8 @@ import { /* … */ } from 'ranuts/utils';
|
|
|
264
265
|
|
|
265
266
|
- `interface AcceptPortBridgeOptions`
|
|
266
267
|
- `interface BeaconPayload`
|
|
268
|
+
- `interface BottomFollower` — Imperative bottom-follow controller.
|
|
269
|
+
- `interface BottomFollowerOptions` — How to construct a follower.
|
|
267
270
|
- `interface BridgeManagerOptions`
|
|
268
271
|
- `interface BroadcastPayload`
|
|
269
272
|
- `interface CallToPayload`
|
|
@@ -271,6 +274,9 @@ import { /* … */ } from 'ranuts/utils';
|
|
|
271
274
|
- `interface ComputePlacementOptions`
|
|
272
275
|
- `interface Debounced`
|
|
273
276
|
- `interface Deferred` — Promise primitives that JavaScript does not ship: an externally settled promise and a
|
|
277
|
+
- `interface DiffHunk` — A run of changed lines plus the context around it.
|
|
278
|
+
- `interface DiffLine` — One line of a diff, carrying both line numbers so a gutter can show either side.
|
|
279
|
+
- `interface DiffOptions` — How to compute a diff.
|
|
274
280
|
- `interface DoubleTapDetector`
|
|
275
281
|
- `interface DoubleTapDetectorOptions`
|
|
276
282
|
- `interface FormatRelativeOptions`
|
|
@@ -325,17 +331,20 @@ import { /* … */ } from 'ranuts/utils';
|
|
|
325
331
|
|
|
326
332
|
- `type CurrentDevice`
|
|
327
333
|
- `type DateInput` — Accepted everywhere a moment in time is taken; `undefined` means "now".
|
|
334
|
+
- `type DiffLineKind` — What happened to one line.
|
|
328
335
|
- `type EasingFn` — One easing function: (elapsed, from, delta, duration) => current value
|
|
329
336
|
- `type ImgSource` — A bitmap container usable both as a drawImage source and as a render target
|
|
330
337
|
- `type LocaleChangeHandler`
|
|
331
338
|
- `type LocaleMessages` — Locale → dictionary. Parameterised by the dictionary shape so an app can hand in its own
|
|
332
339
|
- `type MessageDict`
|
|
333
|
-
- `type Placement`
|
|
340
|
+
- `type Placement` — A side, optionally suffixed with a cross-axis alignment — the same grammar
|
|
341
|
+
- `type PlacementAlign` — Where the panel lines up along the cross axis: with the anchor's leading
|
|
342
|
+
- `type PlacementSide` — The side of the anchor a floating panel sits on.
|
|
334
343
|
- `type RelativeStyle` — `'compact'` is ours; the other three are `Intl.RelativeTimeFormat` styles.
|
|
335
344
|
- `type RGB` — An RGB triple with each channel in 0..1 (linear or sRGB depending on the operation).
|
|
336
345
|
- `type SpeechErrorKind` — `denied` means the user or the browser refused the microphone — worth surfacing.
|
|
337
346
|
- `type StringValues` — "An object whose values are all strings" — the constraint the dictionary type parameter
|
|
338
|
-
- `type TextLanguage` — Coarse
|
|
347
|
+
- `type TextLanguage` — Coarse script bucket: the four writing systems that need different handling, plus
|
|
339
348
|
- `type TranslateParams`
|
|
340
349
|
- `type TruncatePosition` — Which end of the string gets dropped when it is too long.
|
|
341
350
|
|
|
@@ -350,9 +359,7 @@ import { /* … */ } from 'ranuts/utils';
|
|
|
350
359
|
- `const cubic: SpeedType`
|
|
351
360
|
- `const DEFAULT_CHANNEL: "default"`
|
|
352
361
|
- `const expo: SpeedType`
|
|
353
|
-
- `const FMT: Record<string, string[]>`
|
|
354
362
|
- `const HEX_COLOR_REGEX: RegExp` — `#rgb` / `#rrggbb` (the `#` is required)
|
|
355
|
-
- `const isClient: boolean` — Whether a `window` existed **when this module was first imported**.
|
|
356
363
|
- `const MessageCodec: { encode(data: any): string; decode<T = any>(encodedStr: string): T | null; encodeFile(file: File): Promise<string>; decodeFile(encoded: st…` — Message codec.
|
|
357
364
|
- `const MimeType: Map<string, string>`
|
|
358
365
|
- `const MOBILE_MEDIA_QUERY: "(max-width: 768px)"` — Viewport breakpoint, matching where the mobile layout takes over
|
|
@@ -392,55 +399,6 @@ import { /* … */ } from 'ranuts/sw';
|
|
|
392
399
|
- `interface ServePrecacheOptions`
|
|
393
400
|
- `interface SWScope` — Minimal view of the SW global the helpers touch, so they can be unit-tested with a stub.
|
|
394
401
|
|
|
395
|
-
## `ranuts/node`
|
|
396
|
-
|
|
397
|
-
Node server utilities (fs / http / ws / middleware) · runtime: **node only** · source: `src/node/index.ts`
|
|
398
|
-
|
|
399
|
-
```ts
|
|
400
|
-
import { /* … */ } from 'ranuts/node';
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
### Functions
|
|
404
|
-
|
|
405
|
-
- `appendFile(path: string, content: string) => Promise<Ranuts.Identification>` — Append content to an existing file
|
|
406
|
-
- `bodyMiddleware(options?: Partial<ServerBody>) => MiddlewareFunction`
|
|
407
|
-
- `connect(connectMiddleware: ConnectMiddleware) => MiddlewareFunction`
|
|
408
|
-
- `get({ url }: Request) => Promise<Response>`
|
|
409
|
-
- `getIPAdress() => string | undefined`
|
|
410
|
-
- `default(req: Req) => ParseUrl | undefined` — Parse an IncomingMessage's request URL; the return type is always ParseUrl
|
|
411
|
-
- `prompt({ message, stream, defaultResponse }: PromptOption) => Promise<boolean>`
|
|
412
|
-
- `queryFileInfo(path: string) => Promise<Ranuts.Identification>` — Stat a file — typically to tell a file from a directory via data.isDirectory()
|
|
413
|
-
- `readDir(options: Options) => Array<string>`
|
|
414
|
-
- `readFile(path: string, format?: BufferEncoding) => FilePromiseResult` — Read a file, returning a status code and the content on success
|
|
415
|
-
- `readStream(option: ReadOption) => ReadStream`
|
|
416
|
-
- `runCommand(command: string, args: string[]) => Promise<void>`
|
|
417
|
-
- `startTask() => symbol`
|
|
418
|
-
- `staticMiddleware(option?: Partial<Option>) => MiddlewareFunction`
|
|
419
|
-
- `taskEnd(symbol: symbol) => number | bigint`
|
|
420
|
-
- `traverse(dir: string, callback: Caller, pre?: string) => Promise<any>` — Walk every directory recursively, running a function for each file found
|
|
421
|
-
- `traverseSync(dir: string, callback: Caller, pre?: string) => void` — Synchronous: walk every directory recursively, running a function for each file found
|
|
422
|
-
- `watchFile(path: string, interval?: number) => Promise<Ranuts.Identification>` — Watch a file for changes and report its status
|
|
423
|
-
- `writeFile(path: string, content: string) => Promise<Ranuts.Identification>` — Write a file at the given path, truncating it if it exists and creating it if it does not
|
|
424
|
-
- `writeStream(option: WriteOption) => WriteStream`
|
|
425
|
-
- `WSS(this: any, server: http.Server) => void` — Create a WebSocket Server
|
|
426
|
-
|
|
427
|
-
### Classes
|
|
428
|
-
|
|
429
|
-
- `class Router`
|
|
430
|
-
- `class Server`
|
|
431
|
-
|
|
432
|
-
### Interfaces
|
|
433
|
-
|
|
434
|
-
- `interface Context`
|
|
435
|
-
|
|
436
|
-
### Constants
|
|
437
|
-
|
|
438
|
-
- `const isColorSupported: boolean`
|
|
439
|
-
|
|
440
|
-
### Other
|
|
441
|
-
|
|
442
|
-
- `default`
|
|
443
|
-
|
|
444
402
|
## `ranuts/visual`
|
|
445
403
|
|
|
446
404
|
2D rendering engine (Canvas / WebGL / WebGPU) · runtime: **browser only** · source: `src/utils/visual/index.ts`
|
|
@@ -558,3 +516,66 @@ import { /* … */ } from 'ranuts/vnode';
|
|
|
558
516
|
|
|
559
517
|
- `namespace is` — Type guards — array / string / primitive / VNode
|
|
560
518
|
|
|
519
|
+
## `ranuts/stream`
|
|
520
|
+
|
|
521
|
+
SSE parsing, a provider-neutral model-stream fold, and the token budget that decides when a history stops fitting · runtime: **browser + node** · source: `src/stream/index.ts`
|
|
522
|
+
|
|
523
|
+
```ts
|
|
524
|
+
import { /* … */ } from 'ranuts/stream';
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
### Functions
|
|
528
|
+
|
|
529
|
+
- `addUsage(total: TokenUsage | undefined, next: TokenUsage | undefined) => TokenUsage` — Adds two usage reports.
|
|
530
|
+
- `createStreamAccumulator() => StreamAccumulator` — Creates a fold over one streamed response.
|
|
531
|
+
- `estimateTokens(text: string) => number` — Estimates how many tokens a string costs.
|
|
532
|
+
- `mapEventStream(source: ByteSource, map: (event: ServerSentEvent) => readonly StreamChunk[]) => AsyncGenerator<StreamChunk>` — Maps SSE events onto StreamChunk values using a caller-supplied vendor mapping.
|
|
533
|
+
- `parseEventStream(source: ByteSource) => AsyncGenerator<ServerSentEvent>` — Parses a byte stream as `text/event-stream`.
|
|
534
|
+
- `planCompaction(sizes: readonly number[], limits: CompactionLimits) => CompactionPlan` — Decides how much of a history no longer fits.
|
|
535
|
+
|
|
536
|
+
### Interfaces
|
|
537
|
+
|
|
538
|
+
- `interface CompactionLimits` — What a compaction has to fit under, and what it may not touch.
|
|
539
|
+
- `interface CompactionPlan` — What to do with a history that has grown.
|
|
540
|
+
- `interface ReasoningBlock` — Model reasoning, when the provider exposes it. Kept separate from TextBlock
|
|
541
|
+
- `interface ServerSentEvent` — One parsed `text/event-stream` event.
|
|
542
|
+
- `interface StreamAccumulator` — Stateful fold over one response's chunks.
|
|
543
|
+
- `interface StreamSnapshot` — Immutable view of everything received so far.
|
|
544
|
+
- `interface TextBlock` — Assistant prose addressed to the user.
|
|
545
|
+
- `interface TokenUsage` — Token counts reported for one response. Every field is optional: providers differ.
|
|
546
|
+
- `interface ToolCallBlock` — One tool invocation requested by the model.
|
|
547
|
+
|
|
548
|
+
### Types
|
|
549
|
+
|
|
550
|
+
- `type ByteSource` — Anything `for await` can walk that yields byte chunks — a `fetch` body, or a fake.
|
|
551
|
+
- `type ContentBlock` — One completed unit of assistant output.
|
|
552
|
+
- `type ContentBlockType` — Discriminator for the content a block accumulates.
|
|
553
|
+
- `type FinishReason` — Why the response ended.
|
|
554
|
+
- `type StreamChunk` — One normalized event from a streamed response.
|
|
555
|
+
|
|
556
|
+
## `ranuts/conversation`
|
|
557
|
+
|
|
558
|
+
Project an append-only event log into renderable conversation nodes · runtime: **browser + node** · source: `src/conversation/index.ts`
|
|
559
|
+
|
|
560
|
+
```ts
|
|
561
|
+
import { /* … */ } from 'ranuts/conversation';
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
### Functions
|
|
565
|
+
|
|
566
|
+
- `createConversationEngine<Event>(options: ConversationEngineOptions<Event>) => ConversationEngine<Event>` — Creates an engine over a set of definitions.
|
|
567
|
+
|
|
568
|
+
### Interfaces
|
|
569
|
+
|
|
570
|
+
- `interface ConversationEngine` — A running conversation projection.
|
|
571
|
+
- `interface ConversationEngineOptions` — How to construct an engine.
|
|
572
|
+
- `interface ConversationMatch` — A definition's claim on one event.
|
|
573
|
+
- `interface ConversationNode` — One live node, as a view sees it.
|
|
574
|
+
- `interface ConversationNodeDefinition` — One independently registered event-to-node state machine.
|
|
575
|
+
- `interface ConversationReader` — Strictly-backward lookup offered to a definition while it starts a node.
|
|
576
|
+
|
|
577
|
+
### Types
|
|
578
|
+
|
|
579
|
+
- `type ConversationPublication` — When subscribers should see the result of one accepted event.
|
|
580
|
+
- `type FrameScheduler` — Defers work to the next paint, or to a microtask where there is no paint.
|
|
581
|
+
|
package/package.json
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ranuts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Tree-shakeable TypeScript utility library: DOM/BOM helpers, string/object/number/color utils, debounce/throttle/compose, a 2D rendering engine and a virtual DOM.",
|
|
5
|
-
"main": "dist/index.
|
|
5
|
+
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"type": "module",
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"./dist/iife/**"
|
|
10
|
+
],
|
|
8
11
|
"types": "dist/index.d.ts",
|
|
9
12
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
13
|
+
"node": ">=24.0.0"
|
|
11
14
|
},
|
|
12
15
|
"exports": {
|
|
13
16
|
".": {
|
|
14
17
|
"types": "./dist/index.d.ts",
|
|
15
|
-
"import": "./dist/index.js"
|
|
16
|
-
"require": "./dist/umd/index.umd.cjs"
|
|
17
|
-
},
|
|
18
|
-
"./node": {
|
|
19
|
-
"types": "./dist/src/node/index.d.ts",
|
|
20
|
-
"import": "./dist/src/node/index.js",
|
|
21
|
-
"require": "./dist/umd/node/node.umd.cjs"
|
|
18
|
+
"import": "./dist/index.js"
|
|
22
19
|
},
|
|
23
20
|
"./utils": {
|
|
24
21
|
"types": "./dist/src/utils/index.d.ts",
|
|
25
|
-
"import": "./dist/src/utils/index.js"
|
|
26
|
-
"require": "./dist/umd/utils/utils.umd.cjs"
|
|
22
|
+
"import": "./dist/src/utils/index.js"
|
|
27
23
|
},
|
|
28
24
|
"./visual": {
|
|
29
25
|
"types": "./dist/src/utils/visual/index.d.ts",
|
|
@@ -40,6 +36,14 @@
|
|
|
40
36
|
"./vnode": {
|
|
41
37
|
"types": "./dist/src/vnode/index.d.ts",
|
|
42
38
|
"import": "./dist/src/vnode/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./stream": {
|
|
41
|
+
"types": "./dist/src/stream/index.d.ts",
|
|
42
|
+
"import": "./dist/src/stream/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./conversation": {
|
|
45
|
+
"types": "./dist/src/conversation/index.d.ts",
|
|
46
|
+
"import": "./dist/src/conversation/index.js"
|
|
43
47
|
}
|
|
44
48
|
},
|
|
45
49
|
"repository": {
|
|
@@ -89,14 +93,14 @@
|
|
|
89
93
|
"license": "MIT",
|
|
90
94
|
"devDependencies": {
|
|
91
95
|
"@types/node": "26.1.2",
|
|
92
|
-
"@vitest/coverage-v8": "4.1.
|
|
96
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
93
97
|
"@webgpu/types": "0.1.71",
|
|
94
98
|
"jsdom": "29.1.1",
|
|
95
99
|
"terser": "5.49.2",
|
|
96
100
|
"tsx": "4.23.10",
|
|
97
101
|
"typescript": "7.0.2",
|
|
98
102
|
"vite": "8.2.1",
|
|
99
|
-
"vitest": "4.1.
|
|
103
|
+
"vitest": "4.1.11"
|
|
100
104
|
},
|
|
101
105
|
"dependencies": {
|
|
102
106
|
"jschardet": "3.1.4"
|
|
@@ -105,9 +109,10 @@
|
|
|
105
109
|
"build": "sh ./bin/build.sh",
|
|
106
110
|
"test": "vitest run",
|
|
107
111
|
"test:coverage": "vitest run --coverage",
|
|
112
|
+
"verify:package": "node bin/verify-package.mjs",
|
|
108
113
|
"tsc": "tsc --noEmit",
|
|
109
114
|
"dev": "vite --host",
|
|
110
115
|
"doc:api": "tsx ./bin/generate-api-docs.ts",
|
|
111
|
-
"
|
|
116
|
+
"doc:api:check": "tsx ./bin/generate-api-docs.ts --check"
|
|
112
117
|
}
|
|
113
118
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/build/build.es.d.ts
DELETED
package/dist/chain-CTywmh_H.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=["svg","path","g","circle","rect","line","polyline","polygon","ellipse","text","tspan","textPath","defs","marker","radialGradient","stop","linearGradient","clipPath","mask","pattern","image","use","symbol","foreignObject","feGaussianBlur","feColorMatrix"],t=class t{listener;element;constructor(e,t){this.element=this.create(e,t),this.listener=/* @__PURE__ */new Map}create=(t,n)=>e.includes(t)?document.createElementNS("http://www.w3.org/2000/svg",t,n):document.createElement(t,n);setAttribute=(e,t)=>(this.element.setAttribute(e,t),this);removeAttribute=e=>(this.element.removeAttribute(e),this);append=e=>(this.element.appendChild(e),this);remove=e=>(this.element.removeChild(e),this);setTextContent=e=>(this.element.textContent=e,this);setStyle=(e,t)=>(this.element.style.setProperty(e,t),this);addElementByType=(e,n)=>{e instanceof t&&n.appendChild(e.element),e instanceof HTMLElement&&n.appendChild(e)};addChild=e=>{if(Array.isArray(e)){const t=document.createDocumentFragment();e.forEach(e=>{this.addElementByType(e,t)}),this.element.appendChild(t)}else this.addElementByType(e,this.element);return this};listen=(e,t,n)=>{let s=this.listener.get(e);s||(s=/* @__PURE__ */new Map,this.listener.set(e,s));const i=s.get(t.name);return i===t&&console.warn(`${i.name} listener has been added to ${e} event, please remove it first.`),this.element.addEventListener(e,t,n),s.set(t.name,t),this};clearListener=(e,t,n)=>{this.element.removeEventListener(e,t,n);const s=this.listener.get(e);return s?s.delete(t.name):console.warn(`No ${e} event listener has been added.`),this};clearAllListener=()=>{for(const[e,t]of this.listener){for(const[n,s]of t)this.element.removeEventListener(e,s),t.delete(n);this.listener.delete(e)}return this}},n=(e,n)=>new t(e,n);export{n,t};
|