blecsd 0.1.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.
Files changed (109) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +220 -0
  3. package/dist/3d/index.d.ts +5 -0
  4. package/dist/3d/index.js +1 -0
  5. package/dist/audio/index.d.ts +177 -0
  6. package/dist/audio/index.js +1 -0
  7. package/dist/border-D_Jb4ZJV.d.ts +257 -0
  8. package/dist/cell-DwIu2ryP.d.ts +505 -0
  9. package/dist/chunk-2UBBZFE4.js +1 -0
  10. package/dist/chunk-35LCBY6P.js +1 -0
  11. package/dist/chunk-3B7MIVW6.js +1 -0
  12. package/dist/chunk-3EGGGI5J.js +3 -0
  13. package/dist/chunk-4LWWONFK.js +1 -0
  14. package/dist/chunk-4X4N4HNQ.js +2 -0
  15. package/dist/chunk-5PELJRUQ.js +1 -0
  16. package/dist/chunk-AEJIX2MW.js +1 -0
  17. package/dist/chunk-AQ7LW75B.js +1 -0
  18. package/dist/chunk-AXZQAH4X.js +1 -0
  19. package/dist/chunk-B6Z2JFRY.js +1 -0
  20. package/dist/chunk-BCADUCOZ.js +1 -0
  21. package/dist/chunk-C5PCEQ6G.js +1 -0
  22. package/dist/chunk-CIK4AMUA.js +1 -0
  23. package/dist/chunk-DNRXW56C.js +1 -0
  24. package/dist/chunk-FC5FFAAC.js +12 -0
  25. package/dist/chunk-FGHEFXLK.js +1 -0
  26. package/dist/chunk-FYEBZAWN.js +1 -0
  27. package/dist/chunk-G7GIWWLE.js +1 -0
  28. package/dist/chunk-GYHI26UE.js +1 -0
  29. package/dist/chunk-H2YAOJDW.js +1 -0
  30. package/dist/chunk-J4JZ2NU2.js +1 -0
  31. package/dist/chunk-JKVHO4LH.js +1 -0
  32. package/dist/chunk-K2B2OXQ5.js +5 -0
  33. package/dist/chunk-K37L3G4Z.js +4 -0
  34. package/dist/chunk-KD55INV7.js +1 -0
  35. package/dist/chunk-KFAK4A3G.js +1 -0
  36. package/dist/chunk-LCN2ZITE.js +1 -0
  37. package/dist/chunk-LYSK5S63.js +1 -0
  38. package/dist/chunk-NZ55KBM6.js +1 -0
  39. package/dist/chunk-OMMJ7B5P.js +1 -0
  40. package/dist/chunk-OUXUPF3V.js +33 -0
  41. package/dist/chunk-OVT2PPGW.js +19 -0
  42. package/dist/chunk-P6CJO3BC.js +1 -0
  43. package/dist/chunk-PSXXMBVJ.js +1 -0
  44. package/dist/chunk-PXXGH3BV.js +1 -0
  45. package/dist/chunk-QIKIOVP2.js +1 -0
  46. package/dist/chunk-SHUC6JWA.js +1 -0
  47. package/dist/chunk-TDXJDLY6.js +6 -0
  48. package/dist/chunk-TWSWTBYL.js +1 -0
  49. package/dist/chunk-TYMY2TBR.js +3 -0
  50. package/dist/chunk-VNZ6CWJA.js +2 -0
  51. package/dist/chunk-VOCM5T2G.js +5 -0
  52. package/dist/chunk-W5OU7Z6J.js +1 -0
  53. package/dist/chunk-WNG4A3K7.js +4 -0
  54. package/dist/chunk-XQIGERNI.js +1 -0
  55. package/dist/chunk-XZA63ZPO.js +1 -0
  56. package/dist/chunk-YAMOSPWB.js +4 -0
  57. package/dist/chunk-YD6ULIUR.js +1 -0
  58. package/dist/chunk-Z4EZERNE.js +1 -0
  59. package/dist/cli/init.d.ts +86 -0
  60. package/dist/cli/init.js +179 -0
  61. package/dist/color-B78w3zH-.d.ts +79 -0
  62. package/dist/components/index.d.ts +10298 -0
  63. package/dist/components/index.js +1 -0
  64. package/dist/core/index.d.ts +6700 -0
  65. package/dist/core/index.js +1 -0
  66. package/dist/debug/index.d.ts +711 -0
  67. package/dist/debug/index.js +1 -0
  68. package/dist/doubleBuffer-CKQFmlPN.d.ts +95 -0
  69. package/dist/errors/index.d.ts +1110 -0
  70. package/dist/errors/index.js +1 -0
  71. package/dist/events-BbbxkgvX.d.ts +125 -0
  72. package/dist/game/index.d.ts +486 -0
  73. package/dist/game/index.js +1 -0
  74. package/dist/gameLoop-BIPW7-OY.d.ts +219 -0
  75. package/dist/index-zSGJ2eUk.d.ts +3156 -0
  76. package/dist/index.d.ts +246 -0
  77. package/dist/index.js +1 -0
  78. package/dist/input/index.d.ts +158 -0
  79. package/dist/input/index.js +1 -0
  80. package/dist/inputActions-CefRUBuT.d.ts +2637 -0
  81. package/dist/keyParser-Bwm8-l7v.d.ts +229 -0
  82. package/dist/mouseParser-Cfrbn3AX.d.ts +177 -0
  83. package/dist/parser-iMHmQuUh.d.ts +265 -0
  84. package/dist/program-BZaKqDKH.d.ts +141 -0
  85. package/dist/renderable-jTMOA-GK.d.ts +302 -0
  86. package/dist/scheduler-DcfoFuum.d.ts +86 -0
  87. package/dist/schemas/index.d.ts +936 -0
  88. package/dist/schemas/index.js +1 -0
  89. package/dist/systems/index.d.ts +4036 -0
  90. package/dist/systems/index.js +1 -0
  91. package/dist/terminal/index.d.ts +7357 -0
  92. package/dist/terminal/index.js +1 -0
  93. package/dist/terminus-14-bold-HWSPRLJD.js +1 -0
  94. package/dist/terminus-14-normal-T3SWMH4D.js +1 -0
  95. package/dist/tilemap-D1HJvKy3.d.ts +1211 -0
  96. package/dist/types-BcsvoKzf.d.ts +68 -0
  97. package/dist/utils/index.d.ts +6104 -0
  98. package/dist/utils/index.js +1 -0
  99. package/dist/viewport3d-xI33-_wq.d.ts +182 -0
  100. package/dist/virtualScrollback-DvZTRU8a.d.ts +274 -0
  101. package/dist/virtualViewport-Dx2iJliO.d.ts +2334 -0
  102. package/dist/virtualizedLineStore-DwPEvPkk.d.ts +297 -0
  103. package/dist/widgets/bigText.d.ts +230 -0
  104. package/dist/widgets/bigText.js +1 -0
  105. package/dist/widgets/fonts/index.d.ts +211 -0
  106. package/dist/widgets/fonts/index.js +1 -0
  107. package/dist/widgets/index.d.ts +8591 -0
  108. package/dist/widgets/index.js +1 -0
  109. package/package.json +213 -0
@@ -0,0 +1 @@
1
+ export{Ma as AMBIGUOUS_RANGES,xe as AlignmentSchema,ae as AttrFlags,f as BOX_ASCII,e as BOX_BOLD,g as BOX_DASHED,c as BOX_DOUBLE,d as BOX_ROUNDED,b as BOX_SINGLE,Ea as COMBINING_RANGES,Fa as COMBINING_SET,Nb as DEFAULT_BATCH_SIZE,U as DEFAULT_COLLAPSE_THRESHOLD,T as DEFAULT_CONTEXT,Wc as DEFAULT_HIGHLIGHT_BATCH,sd as DEFAULT_PARSE_BATCH,Je as DEFAULT_SEARCH_BATCH,Ie as DEFAULT_TIMEOUT,Na as EMOJI_WIDE_RANGES,Xc as EMPTY_STATE,Ka as FULLWIDTH_RANGES,oc as FuzzyOptionsSchema,dd as GRAMMARS,$c as GRAMMAR_GO,Yc as GRAMMAR_JAVASCRIPT,bd as GRAMMAR_JSON,cd as GRAMMAR_PLAINTEXT,Zc as GRAMMAR_PYTHON,_c as GRAMMAR_RUST,ad as GRAMMAR_SHELL,ka as HIGH_SURROGATE_END,ja as HIGH_SURROGATE_START,Ed as LEAF_MAX_SIZE,Fd as LEAF_MIN_SIZE,ma as LOW_SURROGATE_END,la as LOW_SURROGATE_START,Gd as MAX_DEPTH,Mb as MAX_PARAGRAPH_CHUNK,He as ParsedContentSchema,Ab as TerminalWidthProfileSchema,Ge as TextSegmentSchema,Ja as WIDE_RANGES,Le as WORD_BOUNDARY_AFTER,Ke as WORD_BOUNDARY_BEFORE,zb as WidthOverrideSchema,La as ZERO_WIDTH_RANGES,$b as addFoldRegion,Wd as append,ze as attrToTag,ce as attrsToStyle,De as attrsToTags,Me as boyerMooreHorspool,n as bufferToString,B as buildLineIndex,C as buildLineIndexFromLengths,Bb as buildTestCorpus,ub as centerByWidth,Nd as charAt,Ca as charAtCodePoint,lb as charWidth,mb as charWidthAt,xa as characters,a as charsetToBoxChars,J as clampCursor,re as cleanTags,X as clearDiffCache,fd as clearHighlightCache,Lc as clearLazyContent,wd as clearMarkdownCache,Te as clearSearchCache,Eb as clearWidthOverrides,Pb as clearWrapCache,ta as codePointAt,ya as codePointLength,sa as codePointToSurrogatePair,kb as codePointWidth,va as codePoints,_ as collapseChunk,ba as collapseUnchanged,ye as colorToTag,wb as columnAtIndex,V as computeDiff,Y as computeDiffCached,Pc as computeDigitWidth,Qc as computeGutterWidth,Tc as computeVisibleGutter,od as continueHighlight,Tb as continueWrap,Oc as createArraySource,h as createCellBuffer,o as createCoalescer,F as createCursor,W as createDiffCache,Id as createEmptyRope,_b as createFoldState,Rc as createGutterConfig,ed as createHighlightCache,Hc as createLazyContent,vd as createMarkdownCache,H as createNavConfig,Hd as createRope,Se as createSearchCache,w as createSparseStore,te as createTaggedText,x as createTypedArrayPool,G as createViewport,Ob as createWrapCache,oe as decodeStyleAttr,t as deleteChange,Yd as deleteRange,v as destroyCoalescer,pd as detectLanguage,qd as detectLanguageFromContent,bb as dropUnicode,ne as encodeStyleAttr,ia as encoding,I as ensureCursorVisible,se as escapeTags,y as estimateMemoryUsage,Kc as evictChunks,aa as expandAll,Z as expandChunk,l as fillRect,Jb as filterByCategory,Cc as findAllFiles,Bc as findFile,Ze as findNearestMatch,q as flushChanges,ec as foldAll,gc as foldAtDepth,bc as foldRegion,Sc as formatLineNumber,Lb as formatTestReport,ua as fromCodePoint,tc as fuzzyFilter,pc as fuzzyMatch,qc as fuzzySearch,rc as fuzzySearchBy,uc as fuzzyTest,Be as generateCloseTags,Ae as generateTags,ic as getAllFoldRegions,Kb as getCategories,Ra as getCharWidth,r as getCoalescingState,Ia as getCombiningCharCount,z as getComponentMemoryReport,ha as getDiffStats,hc as getFoldAtLine,mc as getFoldStats,rd as getGrammarByName,hd as getHighlightStats,Cb as getKnownBadSequences,Mc as getLazyContentState,Ic as getLazyLines,Jd as getLength,Td as getLine,Ld as getLineCount,Sd as getLineEnd,Qd as getLineForIndex,Rd as getLineStart,Ud as getLines,Cd as getMarkdownLineCount,Dd as getMarkdownStats,Ye as getMatchAt,$e as getMatchStatus,Kd as getNewlineCount,We as getNextMatch,Fb as getOverrideCount,Gb as getOverrideWidth,Xe as getPreviousMatch,ea as getSideBySideView,_d as getStats,Pd as getText,da as getTotalLineCount,ca as getVisibleDiffLines,jc as getVisibleFoldLines,Bd as getVisibleMarkdown,_e as getVisibleMatches,Zb as getWrapCacheStats,Q as goToEnd,M as goToLine,P as goToStart,Va as graphemeAt,Sa as graphemeClusters,Ua as graphemeCount,Xa as graphemeWidth,Fc as groupBy,Uc as gutterWidthChanged,$a as hasGraphemeSegmenter,we as hasTags,xb as hasWideChars,yb as hasZeroWidthChars,sc as highlightMatch,nd as highlightVisibleFirst,md as highlightWithCache,vb as indexAtColumn,Vd as insert,s as insertChange,Db as installWidthOverrides,Wb as invalidateAll,kd as invalidateAllLines,jd as invalidateLine,id as invalidateLines,yd as invalidateMarkdownLines,Vb as invalidateParagraph,Ub as invalidateRange,Qa as isAmbiguousChar,Ba as isAstral,Aa as isBMP,Ga as isCombiningChar,Ha as isCombiningCharBinarySearch,Md as isEmpty,na as isHighSurrogate,oa as isLowSurrogate,Nc as isRangeLoaded,qa as isSurrogate,pa as isSurrogateCode,za as isValidCodePoint,Oa as isWideChar,A as isWithinMemoryBounds,Pa as isZeroWidthChar,D as lineForOffset,Xb as lineToPosition,Hb as measureWidthWithOverrides,vc as merge,ue as mergeSegments,L as moveCursorDown,R as moveCursorLeft,S as moveCursorRight,K as moveCursorUp,gb as normalizeNFC,hb as normalizeNFD,ib as normalizeNFKC,jb as normalizeNFKD,E as offsetForLine,lc as originalToVisibleLine,sb as padEndByWidth,tb as padStartByWidth,O as pageDown,N as pageUp,td as parseInline,ud as parseMarkdown,xd as parseMarkdownCached,pe as parseTags,ga as parseUnifiedDiff,Fe as parsedToTaggedText,Gc as partition,Yb as positionToLine,Ne as positionToLineColumn,Jc as prefetchAround,Xd as prepend,p as queueChange,ac as removeFoldRegion,zd as renderBlock,i as renderBox,Vc as renderGutterBlock,j as renderHLine,Ad as renderMarkdown,m as renderText,k as renderVLine,u as replaceChange,Zd as replaceRange,Qb as resizeWrapCache,ab as reverseGraphemes,Ib as runWidthTests,de as sattr,je as sattrAddFlag,ge as sattrCopy,me as sattrEmpty,fe as sattrEqual,ee as sattrFromStyleData,ie as sattrHasFlag,le as sattrInvert,he as sattrMerge,ke as sattrRemoveFlag,Qe as search,Re as searchBatch,Oe as searchLiteral,Pe as searchRegex,af as searchReverse,Ve as searchWithCache,Ee as segmentToTaggedText,gd as setGrammar,wc as shallowMerge,pb as sliceByWidth,Za as sliceByWidthGrapheme,Da as sliceCodePoints,Wa as sliceGraphemes,Ac as sortBy,yc as sortByIndex,xc as sortByName,zc as sortByPriority,ob as strWidth,nb as stringWidth,Ya as stringWidthGrapheme,eb as stripCombining,fb as stripControl,qe as stripTags,db as stripZeroWidth,be as styleToAttrs,Od as substring,ra as surrogatePairToCodePoint,ve as taggedLength,cb as toAscii,wa as toCodePoints,Ta as toGraphemes,fa as toUnifiedDiff,$ as toggleChunk,dc as toggleFold,ld as tokenizeLine,qb as truncateByWidth,rb as truncateWithEllipsis,_a as truncateWithEllipsisGrapheme,fc as unfoldAll,cc as unfoldRegion,Dc as unique,Ec as uniqueBy,Ue as updateSearchQuery,nc as updateTotalLines,$d as verify,kc as visibleToOriginalLine,Sb as wrapVisibleFirst,Rb as wrapWithCache,Ce as wrapWithTags}from'../chunk-OUXUPF3V.js';export{a as formatDate,b as unixTimestamp,c as unixTimestampMs}from'../chunk-AXZQAH4X.js';export{d as COMPRESSION_RATIO,a as DEFAULT_CHUNK_SIZE,b as DEFAULT_MAX_CACHED,c as DEFAULT_MAX_MEMORY,g as appendLine,h as appendLines,f as clearScrollback,u as compressOldChunks,e as createScrollbackBuffer,v as decompressAll,s as exportToText,j as getLineRange,q as getMemoryUsage,i as getScrollbackLine,p as getScrollbackStats,k as getVisibleLines,l as jumpToLine,r as loadFromText,m as scrollBy,o as scrollToBottom,n as scrollToTop,t as trimToLineCount}from'../chunk-TYMY2TBR.js';export{e as CHUNKED_THRESHOLD,a as LineIndexSchema,b as LineRangeParamsSchema,d as TrimParamsSchema,c as VisibleLinesParamsSchema,n as appendLinesToStore,m as appendToStore,h as createEmptyLineStore,f as createLineStore,g as createLineStoreFromLines,u as exportContent,v as exportLineRange,p as getByteSize,i as getLineAtIndex,s as getLineForOffset,j as getLineInfo,o as getLineStoreLineCount,k as getLineStoreRange,l as getLineStoreVisibleLines,t as getOffsetForLine,r as getStoreStats,q as isStoreEmpty,w as trimLineStore}from'../chunk-VOCM5T2G.js';import'../chunk-LCN2ZITE.js';export{d as alignLine,b as getVisibleWidth,g as padHeight,a as stripAnsi,c as truncate,e as wordWrap,f as wrapText}from'../chunk-WNG4A3K7.js';export{d as colorToHex,c as hexToColor,a as packColor,e as parseColor,b as unpackColor}from'../chunk-SHUC6JWA.js';import'../chunk-PXXGH3BV.js';import'../chunk-5PELJRUQ.js';
@@ -0,0 +1,182 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Zod schemas for 3D ECS components.
5
+ * @module 3d/schemas/components
6
+ */
7
+
8
+ /**
9
+ * Configuration for a 3D transform.
10
+ * Translation (t), rotation in radians (r), scale (s).
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const config = Transform3DConfigSchema.parse({ tx: 0, ty: 1, tz: -5 });
15
+ * ```
16
+ */
17
+ declare const Transform3DConfigSchema: z.ZodObject<{
18
+ tx: z.ZodDefault<z.ZodNumber>;
19
+ ty: z.ZodDefault<z.ZodNumber>;
20
+ tz: z.ZodDefault<z.ZodNumber>;
21
+ rx: z.ZodDefault<z.ZodNumber>;
22
+ ry: z.ZodDefault<z.ZodNumber>;
23
+ rz: z.ZodDefault<z.ZodNumber>;
24
+ sx: z.ZodDefault<z.ZodNumber>;
25
+ sy: z.ZodDefault<z.ZodNumber>;
26
+ sz: z.ZodDefault<z.ZodNumber>;
27
+ }, z.core.$strip>;
28
+ type Transform3DConfig = z.input<typeof Transform3DConfigSchema>;
29
+ /**
30
+ * Configuration for a 3D camera.
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * const config = Camera3DConfigSchema.parse({ fov: Math.PI / 3, near: 0.1, far: 100 });
35
+ * ```
36
+ */
37
+ declare const Camera3DConfigSchema: z.ZodObject<{
38
+ fov: z.ZodDefault<z.ZodNumber>;
39
+ near: z.ZodDefault<z.ZodNumber>;
40
+ far: z.ZodDefault<z.ZodNumber>;
41
+ aspect: z.ZodDefault<z.ZodNumber>;
42
+ projectionMode: z.ZodDefault<z.ZodEnum<{
43
+ perspective: "perspective";
44
+ orthographic: "orthographic";
45
+ }>>;
46
+ }, z.core.$strip>;
47
+ type Camera3DConfig = z.input<typeof Camera3DConfigSchema>;
48
+ /**
49
+ * Configuration for a 3D material.
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * const config = Material3DConfigSchema.parse({ wireColor: 0x00ff00 });
54
+ * ```
55
+ */
56
+ declare const Material3DConfigSchema: z.ZodObject<{
57
+ wireColor: z.ZodDefault<z.ZodNumber>;
58
+ fillColor: z.ZodDefault<z.ZodNumber>;
59
+ renderMode: z.ZodDefault<z.ZodEnum<{
60
+ wireframe: "wireframe";
61
+ filled: "filled";
62
+ both: "both";
63
+ }>>;
64
+ backfaceCull: z.ZodDefault<z.ZodBoolean>;
65
+ flatShading: z.ZodDefault<z.ZodBoolean>;
66
+ antiAlias: z.ZodDefault<z.ZodBoolean>;
67
+ }, z.core.$strip>;
68
+ type Material3DConfig = z.input<typeof Material3DConfigSchema>;
69
+ /**
70
+ * Configuration for a 3D viewport.
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * const config = Viewport3DConfigSchema.parse({
75
+ * left: 5, top: 2, width: 60, height: 20,
76
+ * cameraEntity: cameraEid,
77
+ * });
78
+ * ```
79
+ */
80
+ declare const Viewport3DConfigSchema: z.ZodObject<{
81
+ left: z.ZodDefault<z.ZodNumber>;
82
+ top: z.ZodDefault<z.ZodNumber>;
83
+ width: z.ZodDefault<z.ZodNumber>;
84
+ height: z.ZodDefault<z.ZodNumber>;
85
+ cameraEntity: z.ZodNumber;
86
+ backendType: z.ZodDefault<z.ZodEnum<{
87
+ braille: "braille";
88
+ halfblock: "halfblock";
89
+ sextant: "sextant";
90
+ sixel: "sixel";
91
+ kitty: "kitty";
92
+ auto: "auto";
93
+ }>>;
94
+ }, z.core.$strip>;
95
+ type Viewport3DConfig = z.input<typeof Viewport3DConfigSchema>;
96
+ /**
97
+ * Configuration for 3D animation.
98
+ * Supports continuous rotation and orbital movement.
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * const config = Animation3DConfigSchema.parse({ rotateSpeed: { y: Math.PI } });
103
+ * ```
104
+ */
105
+ declare const Animation3DConfigSchema: z.ZodObject<{
106
+ rotateSpeed: z.ZodDefault<z.ZodObject<{
107
+ x: z.ZodDefault<z.ZodNumber>;
108
+ y: z.ZodDefault<z.ZodNumber>;
109
+ z: z.ZodDefault<z.ZodNumber>;
110
+ }, z.core.$strip>>;
111
+ orbitCenter: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
112
+ orbitSpeed: z.ZodDefault<z.ZodNumber>;
113
+ orbitRadius: z.ZodOptional<z.ZodNumber>;
114
+ }, z.core.$strip>;
115
+ type Animation3DConfig = z.input<typeof Animation3DConfigSchema>;
116
+ /**
117
+ * Configuration for mouse-based 3D camera interaction.
118
+ *
119
+ * @example
120
+ * ```typescript
121
+ * const config = MouseInteraction3DConfigSchema.parse({
122
+ * rotationSensitivity: 0.01,
123
+ * zoomSensitivity: 0.5,
124
+ * });
125
+ * ```
126
+ */
127
+ declare const MouseInteraction3DConfigSchema: z.ZodObject<{
128
+ rotationSensitivity: z.ZodDefault<z.ZodNumber>;
129
+ zoomSensitivity: z.ZodDefault<z.ZodNumber>;
130
+ zoomMin: z.ZodDefault<z.ZodNumber>;
131
+ zoomMax: z.ZodDefault<z.ZodNumber>;
132
+ invertY: z.ZodDefault<z.ZodBoolean>;
133
+ }, z.core.$strip>;
134
+ type MouseInteraction3DConfig = z.input<typeof MouseInteraction3DConfigSchema>;
135
+
136
+ /**
137
+ * Zod schema for the Viewport3D widget configuration.
138
+ *
139
+ * This is the high-level widget config that users interact with.
140
+ * It combines camera, viewport, and appearance settings into one schema.
141
+ *
142
+ * @module 3d/schemas/viewport3d
143
+ */
144
+
145
+ /**
146
+ * Configuration for the Viewport3D widget.
147
+ * Combines camera, viewport, and appearance settings.
148
+ *
149
+ * @example
150
+ * ```typescript
151
+ * const config = Viewport3DWidgetConfigSchema.parse({
152
+ * left: 5, top: 2, width: 60, height: 20,
153
+ * fov: Math.PI / 3,
154
+ * backend: 'auto',
155
+ * });
156
+ * ```
157
+ */
158
+ declare const Viewport3DWidgetConfigSchema: z.ZodObject<{
159
+ left: z.ZodDefault<z.ZodNumber>;
160
+ top: z.ZodDefault<z.ZodNumber>;
161
+ width: z.ZodDefault<z.ZodNumber>;
162
+ height: z.ZodDefault<z.ZodNumber>;
163
+ fov: z.ZodDefault<z.ZodNumber>;
164
+ near: z.ZodDefault<z.ZodNumber>;
165
+ far: z.ZodDefault<z.ZodNumber>;
166
+ projectionMode: z.ZodDefault<z.ZodEnum<{
167
+ perspective: "perspective";
168
+ orthographic: "orthographic";
169
+ }>>;
170
+ backend: z.ZodDefault<z.ZodEnum<{
171
+ braille: "braille";
172
+ halfblock: "halfblock";
173
+ sextant: "sextant";
174
+ sixel: "sixel";
175
+ kitty: "kitty";
176
+ auto: "auto";
177
+ }>>;
178
+ label: z.ZodOptional<z.ZodString>;
179
+ }, z.core.$strip>;
180
+ type Viewport3DWidgetConfig = z.input<typeof Viewport3DWidgetConfigSchema>;
181
+
182
+ export { type Animation3DConfig as A, type Camera3DConfig as C, type Material3DConfig as M, type Transform3DConfig as T, type Viewport3DConfig as V, type MouseInteraction3DConfig as a, Animation3DConfigSchema as b, Camera3DConfigSchema as c, Material3DConfigSchema as d, MouseInteraction3DConfigSchema as e, Transform3DConfigSchema as f, Viewport3DConfigSchema as g, type Viewport3DWidgetConfig as h, Viewport3DWidgetConfigSchema as i };
@@ -0,0 +1,274 @@
1
+ /**
2
+ * Virtualized Scrollback Buffer
3
+ *
4
+ * Efficient storage and retrieval for unlimited scrollback history:
5
+ * - Chunked storage (N lines per chunk)
6
+ * - LRU cache for recently viewed chunks
7
+ * - Optional compression for old content
8
+ * - Fast position lookups via line index
9
+ *
10
+ * @module utils/virtualScrollback
11
+ */
12
+ /**
13
+ * A single line of content with optional metadata.
14
+ */
15
+ interface ScrollbackLine {
16
+ /** The text content of the line */
17
+ readonly text: string;
18
+ /** ANSI formatting preserved */
19
+ readonly ansi?: string;
20
+ /** Timestamp when line was added */
21
+ readonly timestamp?: number;
22
+ /** Custom metadata */
23
+ readonly meta?: Record<string, unknown>;
24
+ }
25
+ /**
26
+ * A chunk of lines.
27
+ */
28
+ interface Chunk {
29
+ /** Chunk ID (sequential) */
30
+ readonly id: number;
31
+ /** Lines in this chunk */
32
+ readonly lines: ScrollbackLine[];
33
+ /** First line index in the buffer */
34
+ readonly startLine: number;
35
+ /** Number of lines in this chunk */
36
+ readonly lineCount: number;
37
+ /** Whether this chunk is compressed */
38
+ compressed: boolean;
39
+ /** Compressed data (when compressed=true) */
40
+ compressedData?: string;
41
+ /** Approximate memory usage in bytes */
42
+ memorySize: number;
43
+ /** Last access time for LRU */
44
+ lastAccess: number;
45
+ }
46
+ /**
47
+ * Scrollback buffer configuration.
48
+ */
49
+ interface ScrollbackConfig {
50
+ /** Lines per chunk (default: 1000) */
51
+ readonly chunkSize: number;
52
+ /** Max chunks to keep in memory (LRU cache size) */
53
+ readonly maxCachedChunks: number;
54
+ /** Enable compression for old chunks */
55
+ readonly enableCompression: boolean;
56
+ /** Max total lines before eviction (0 = unlimited) */
57
+ readonly maxLines: number;
58
+ /** Memory limit in bytes (0 = unlimited) */
59
+ readonly maxMemory: number;
60
+ }
61
+ /**
62
+ * Line range query result.
63
+ */
64
+ interface LineRange {
65
+ /** Lines in the range */
66
+ readonly lines: readonly ScrollbackLine[];
67
+ /** Start line index (actual, may differ from requested) */
68
+ readonly startLine: number;
69
+ /** End line index (exclusive) */
70
+ readonly endLine: number;
71
+ /** Whether all requested lines are available */
72
+ readonly complete: boolean;
73
+ /** Time to load in milliseconds */
74
+ readonly loadTimeMs: number;
75
+ }
76
+ /**
77
+ * Scrollback buffer statistics.
78
+ */
79
+ interface ScrollbackStats {
80
+ /** Total line count */
81
+ readonly totalLines: number;
82
+ /** Total chunk count */
83
+ readonly totalChunks: number;
84
+ /** Chunks currently in memory */
85
+ readonly cachedChunks: number;
86
+ /** Compressed chunk count */
87
+ readonly compressedChunks: number;
88
+ /** Approximate memory usage in bytes */
89
+ readonly memoryBytes: number;
90
+ /** Memory usage in MB */
91
+ readonly memoryMB: number;
92
+ }
93
+ /**
94
+ * The virtualized scrollback buffer.
95
+ */
96
+ interface ScrollbackBuffer {
97
+ /** Configuration */
98
+ readonly config: ScrollbackConfig;
99
+ /** All chunks */
100
+ readonly chunks: Map<number, Chunk>;
101
+ /** LRU cache order (chunk IDs, most recent last) */
102
+ readonly lruOrder: number[];
103
+ /** Total line count */
104
+ totalLines: number;
105
+ /** Current memory usage estimate */
106
+ memoryBytes: number;
107
+ /** Next chunk ID */
108
+ nextChunkId: number;
109
+ }
110
+ /** Default lines per chunk */
111
+ declare const DEFAULT_CHUNK_SIZE = 1000;
112
+ /** Default max cached chunks */
113
+ declare const DEFAULT_MAX_CACHED = 100;
114
+ /** Default max memory (200MB) */
115
+ declare const DEFAULT_MAX_MEMORY: number;
116
+ /** Compression ratio estimate (used for memory projections) */
117
+ declare const COMPRESSION_RATIO = 0.5;
118
+ /**
119
+ * Creates a new scrollback buffer.
120
+ *
121
+ * @param config - Configuration options
122
+ * @returns New scrollback buffer
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * const buffer = createScrollbackBuffer({
127
+ * chunkSize: 1000,
128
+ * maxCachedChunks: 100,
129
+ * enableCompression: true,
130
+ * });
131
+ * ```
132
+ */
133
+ declare function createScrollbackBuffer(config?: Partial<ScrollbackConfig>): ScrollbackBuffer;
134
+ /**
135
+ * Clears all content from the buffer.
136
+ *
137
+ * @param buffer - The buffer to clear
138
+ */
139
+ declare function clearScrollback(buffer: ScrollbackBuffer): void;
140
+ /**
141
+ * Appends a line to the buffer.
142
+ *
143
+ * @param buffer - The buffer to append to
144
+ * @param text - The line text
145
+ * @param ansi - Optional ANSI formatting
146
+ * @param meta - Optional metadata
147
+ *
148
+ * @example
149
+ * ```typescript
150
+ * appendLine(buffer, 'Hello, world!');
151
+ * appendLine(buffer, '\x1b[31mRed text\x1b[0m', { color: 'red' });
152
+ * ```
153
+ */
154
+ declare function appendLine(buffer: ScrollbackBuffer, text: string, ansi?: string, meta?: Record<string, unknown>): void;
155
+ /**
156
+ * Appends multiple lines at once.
157
+ *
158
+ * @param buffer - The buffer to append to
159
+ * @param lines - Lines to append
160
+ */
161
+ declare function appendLines(buffer: ScrollbackBuffer, lines: readonly string[]): void;
162
+ /**
163
+ * Gets a single line by index.
164
+ *
165
+ * @param buffer - The buffer to read from
166
+ * @param lineIndex - The line index (0-based)
167
+ * @returns The line or undefined if not found
168
+ */
169
+ declare function getLine(buffer: ScrollbackBuffer, lineIndex: number): ScrollbackLine | undefined;
170
+ /**
171
+ * Gets a range of lines.
172
+ *
173
+ * @param buffer - The buffer to read from
174
+ * @param startLine - Start line index (inclusive)
175
+ * @param endLine - End line index (exclusive)
176
+ * @returns Line range result
177
+ */
178
+ declare function getLineRange(buffer: ScrollbackBuffer, startLine: number, endLine: number): LineRange;
179
+ /**
180
+ * Gets visible lines for a viewport.
181
+ *
182
+ * @param buffer - The buffer to read from
183
+ * @param viewportStart - First visible line
184
+ * @param viewportSize - Number of visible lines
185
+ * @returns Lines in the viewport
186
+ */
187
+ declare function getVisibleLines(buffer: ScrollbackBuffer, viewportStart: number, viewportSize: number): LineRange;
188
+ /**
189
+ * Jumps to a specific line (preloads surrounding context).
190
+ *
191
+ * @param buffer - The buffer
192
+ * @param lineIndex - Target line
193
+ * @param contextLines - Lines to preload before/after (default: 100)
194
+ * @returns The visible range after jump
195
+ */
196
+ declare function jumpToLine(buffer: ScrollbackBuffer, lineIndex: number, contextLines?: number): LineRange;
197
+ /**
198
+ * Scrolls by a number of lines.
199
+ *
200
+ * @param buffer - The buffer
201
+ * @param currentLine - Current top line
202
+ * @param delta - Lines to scroll (positive = down, negative = up)
203
+ * @param viewportSize - Viewport size
204
+ * @returns New visible range
205
+ */
206
+ declare function scrollBy(buffer: ScrollbackBuffer, currentLine: number, delta: number, viewportSize: number): LineRange;
207
+ /**
208
+ * Scrolls to the top.
209
+ *
210
+ * @param buffer - The buffer
211
+ * @param viewportSize - Viewport size
212
+ * @returns Visible range at top
213
+ */
214
+ declare function scrollToTop(buffer: ScrollbackBuffer, viewportSize: number): LineRange;
215
+ /**
216
+ * Scrolls to the bottom.
217
+ *
218
+ * @param buffer - The buffer
219
+ * @param viewportSize - Viewport size
220
+ * @returns Visible range at bottom
221
+ */
222
+ declare function scrollToBottom(buffer: ScrollbackBuffer, viewportSize: number): LineRange;
223
+ /**
224
+ * Gets buffer statistics.
225
+ *
226
+ * @param buffer - The buffer
227
+ * @returns Buffer statistics
228
+ */
229
+ declare function getScrollbackStats(buffer: ScrollbackBuffer): ScrollbackStats;
230
+ /**
231
+ * Gets the current memory usage in bytes.
232
+ *
233
+ * @param buffer - The buffer
234
+ * @returns Memory usage in bytes
235
+ */
236
+ declare function getMemoryUsage(buffer: ScrollbackBuffer): number;
237
+ /**
238
+ * Loads content from a text string.
239
+ *
240
+ * @param buffer - The buffer
241
+ * @param text - Text to load (newline-separated)
242
+ */
243
+ declare function loadFromText(buffer: ScrollbackBuffer, text: string): void;
244
+ /**
245
+ * Exports buffer content as text.
246
+ *
247
+ * @param buffer - The buffer
248
+ * @param startLine - Start line (default: 0)
249
+ * @param endLine - End line (default: all)
250
+ * @returns Exported text
251
+ */
252
+ declare function exportToText(buffer: ScrollbackBuffer, startLine?: number, endLine?: number): string;
253
+ /**
254
+ * Trims old content to stay within line limit.
255
+ *
256
+ * @param buffer - The buffer
257
+ * @param maxLines - Maximum lines to keep
258
+ */
259
+ declare function trimToLineCount(buffer: ScrollbackBuffer, maxLines: number): void;
260
+ /**
261
+ * Forces compression of all chunks except the most recent N.
262
+ *
263
+ * @param buffer - The buffer
264
+ * @param keepUncompressed - Number of recent chunks to keep uncompressed
265
+ */
266
+ declare function compressOldChunks(buffer: ScrollbackBuffer, keepUncompressed?: number): void;
267
+ /**
268
+ * Decompresses all chunks (for export or processing).
269
+ *
270
+ * @param buffer - The buffer
271
+ */
272
+ declare function decompressAll(buffer: ScrollbackBuffer): void;
273
+
274
+ export { COMPRESSION_RATIO as C, DEFAULT_CHUNK_SIZE as D, type LineRange as L, type ScrollbackBuffer as S, type Chunk as a, DEFAULT_MAX_CACHED as b, DEFAULT_MAX_MEMORY as c, type ScrollbackConfig as d, type ScrollbackLine as e, type ScrollbackStats as f, appendLine as g, appendLines as h, clearScrollback as i, compressOldChunks as j, createScrollbackBuffer as k, decompressAll as l, exportToText as m, getLineRange as n, getMemoryUsage as o, getLine as p, getScrollbackStats as q, getVisibleLines as r, jumpToLine as s, loadFromText as t, trimToLineCount as u, scrollBy as v, scrollToBottom as w, scrollToTop as x };