omni-viewer-core 0.13.0 → 0.15.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/README.md CHANGED
@@ -15,8 +15,8 @@ models, viewers mount into a DOM element, and everything host-specific
15
15
  - **Documents** — PDF, Word (DOCX and legacy DOC), HWP, PowerPoint (PPTX and
16
16
  legacy PPT), Markdown, LaTeX (structure and math preview, not typesetting)
17
17
  - **Data & spreadsheets** — Excel, CSV/TSV, JSON, JSONL/NDJSON, YAML, TOML,
18
- Parquet, Avro, HDF5, MATLAB MAT, Safetensors, GGUF, ONNX, Protocol Buffers, ReqIF,
19
- SQLite
18
+ Parquet, Avro, HDF5, MATLAB MAT, NumPy (NPY/NPZ), Safetensors, GGUF, ONNX, TFLite/LiteRT,
19
+ Protocol Buffers, ReqIF, SQLite
20
20
  - **Media & graphics** — audio (waveform/spectrogram), video, images,
21
21
  Photoshop PSD
22
22
  - **Engineering & automotive** — CAN DBC, AUTOSAR ARXML, ASAM A2L, Vector
@@ -86,8 +86,13 @@ available, but it requires the host to load the complete file first.
86
86
 
87
87
  ### GGUF metadata and tensor index
88
88
 
89
- GGUF parsing delegates to `@huggingface/gguf`, then normalizes its bigint and
90
- large-array values into an Omni Viewer JSON-safe document. Node hosts can parse
89
+ GGUF parsing reads the header, metadata block, and tensor index directly from
90
+ ranged reads, and normalizes their bigint and large-array values into an Omni
91
+ Viewer JSON-safe document. Tensor payload bytes are never read, metadata array
92
+ bodies are skipped rather than decoded, and only a bounded number of metadata
93
+ and tensor entries is retained, so a model's vocabulary size does not affect
94
+ peak memory or what the document contains. `normalizeGguf` remains available for
95
+ hosts that already hold a `@huggingface/gguf` parse result. Node hosts can parse
91
96
  a local model without loading tensor payloads and mount the result separately:
92
97
 
93
98
  ```ts
@@ -121,6 +126,25 @@ await mountOnnxViewer({ fileName: file.name, data: bytes }, container, ctx);
121
126
  The viewer provides a connected computation graph with node inspection plus
122
127
  searchable node, initializer, input/output, and model-information panels.
123
128
 
129
+ ### TFLite / LiteRT models
130
+
131
+ The TFLite parser reads the `TFL3` FlatBuffer directly — no schema compiler and
132
+ no runtime dependency. Buffer payloads stay unread while subgraph topology,
133
+ operator codes, decoded builtin options, tensor types, shapes, quantization,
134
+ sparsity, signature definitions, and metadata are retained:
135
+
136
+ ```ts
137
+ import { mountTfliteViewer } from 'omni-viewer-core/viewers/tflite';
138
+
139
+ await mountTfliteViewer({ fileName: file.name, data: bytes }, container, ctx);
140
+ ```
141
+
142
+ The viewer provides a per-subgraph computation graph with operator and tensor
143
+ inspection, navigation into the subgraphs a control-flow operator references,
144
+ and searchable operator, tensor, input/output, buffer, and model-information
145
+ panels. Custom operators, Select TensorFlow fallbacks, and buffers stored
146
+ outside the FlatBuffer are surfaced as warnings.
147
+
124
148
  ### Archive host integration
125
149
 
126
150
  Archive decompression remains adapter-owned: pass an `ArchiveDecoder` to
@@ -68,6 +68,10 @@ export const CATALOG_EN = {
68
68
  'safetensors.structure': 'Structure', 'safetensors.noData': 'No data available.',
69
69
  'safetensors.matchingRows': '{count} matching rows',
70
70
  'safetensors.matchingRowsLimited': '{visible} / {total} matching rows shown',
71
+ 'numpy.title': 'NumPy arrays', 'numpy.selectArray': 'Select array', 'numpy.data': 'Data',
72
+ 'numpy.arrays': 'Arrays', 'numpy.copyJson': 'Copy JSON', 'numpy.noData': 'No arrays available.',
73
+ 'numpy.previewUnavailable': 'A value preview is not available for this dtype.', 'numpy.slice': 'Slice',
74
+ 'numpy.gridShown': '{rows} / {totalRows} rows · {columns} / {totalColumns} columns shown',
71
75
  'gguf.title': 'GGUF', 'gguf.search': 'Search metadata and tensors…', 'gguf.copyJson': 'Copy JSON',
72
76
  'gguf.structure': 'Structure', 'gguf.noData': 'No data available.',
73
77
  'gguf.matchingRows': '{count} matching rows',
@@ -115,6 +119,53 @@ export const CATALOG_EN = {
115
119
  'onnx.info.training': 'Training graphs', 'onnx.info.configurations': 'Device configurations',
116
120
  'onnx.info.quantization': 'Quantization annotations', 'onnx.info.deviceConfiguration': 'Device configuration',
117
121
  'onnx.info.pipelineStage': 'pipeline stage',
122
+ 'tflite.title': 'TFLite model', 'tflite.search': 'Search operators, tensors, and buffers…',
123
+ 'tflite.copyJson': 'Copy JSON', 'tflite.subgraph': 'Subgraph', 'tflite.unnamed': 'unnamed',
124
+ 'tflite.graph': 'Graph', 'tflite.operators': 'Operators', 'tflite.tensors': 'Tensors',
125
+ 'tflite.io': 'Inputs & Outputs', 'tflite.buffers': 'Buffers', 'tflite.modelInfo': 'Model Info',
126
+ 'tflite.rows': '{shown} / {total} rows shown', 'tflite.noMatches': 'No rows match the current search.',
127
+ 'tflite.selectNode': 'Select an operator or tensor to inspect it.',
128
+ 'tflite.graphLimited': 'Graph preview shows {shown} of {total} items.',
129
+ 'tflite.graphEdgesLimited': 'Only the first {count} connections are shown.',
130
+ 'tflite.moreItems': '{count} more…', 'tflite.runtime': 'runtime {version}', 'tflite.schema': 'schema v{version}',
131
+ 'tflite.scalar': 'scalar', 'tflite.unknownRank': 'unknown rank', 'tflite.optional': 'optional', 'tflite.variable': 'Variable',
132
+ 'tflite.opDetail': '#{index} · v{version}', 'tflite.customBytes': '{bytes} bytes of custom options',
133
+ 'tflite.binaryBuffer': 'binary, {bytes} in buffer {buffer}',
134
+ 'tflite.summary.operators': 'Operators', 'tflite.summary.tensors': 'Tensors',
135
+ 'tflite.summary.subgraphs': 'Subgraphs', 'tflite.summary.operatorCodes': 'Operator codes',
136
+ 'tflite.summary.weights': 'Weights', 'tflite.summary.version': 'Schema version',
137
+ 'tflite.warning.identifier': 'The file identifier is {identifier} rather than the expected TFL3.',
138
+ 'tflite.warning.version': 'The model declares schema version {version}; this viewer targets version 3.',
139
+ 'tflite.warning.noSubgraphs': 'The model contains no subgraphs.',
140
+ 'tflite.warning.emptyGraph': 'The model subgraphs contain no operators.',
141
+ 'tflite.warning.customOps': '{count} custom operator(s) require a matching runtime registration: {names}',
142
+ 'tflite.warning.flexOps': '{count} operator(s) fall back to Select TensorFlow ops.',
143
+ 'tflite.warning.appendedBuffers': '{count} buffer(s) store their payload outside the FlatBuffer.',
144
+ 'tflite.warning.externalBuffers': '{count} constant buffer(s) live in a separate file that this viewer does not read.',
145
+ 'tflite.warning.missingExternalBuffers': '{count} tensor(s) reference an external buffer the model does not declare.',
146
+ 'tflite.column.index': '#', 'tflite.column.name': 'Name', 'tflite.column.operator': 'Operator',
147
+ 'tflite.column.kind': 'Kind', 'tflite.column.version': 'Version', 'tflite.column.inputs': 'Inputs',
148
+ 'tflite.column.outputs': 'Outputs', 'tflite.column.optionsType': 'Options type', 'tflite.column.options': 'Options',
149
+ 'tflite.column.type': 'Type', 'tflite.column.shape': 'Shape', 'tflite.column.elements': 'Elements',
150
+ 'tflite.column.dataSize': 'Data size', 'tflite.column.storage': 'Storage',
151
+ 'tflite.column.quantization': 'Quantization', 'tflite.column.variable': 'Variable',
152
+ 'tflite.column.signature': 'Signature', 'tflite.column.typeShape': 'Type / Shape',
153
+ 'tflite.column.tensorIndex': 'Tensor', 'tflite.column.fileOffset': 'File offset',
154
+ 'tflite.column.usedBy': 'Used by', 'tflite.column.buffer': 'Buffer',
155
+ 'tflite.storage.empty': 'Runtime', 'tflite.storage.inline': 'Inline', 'tflite.storage.appended': 'Appended', 'tflite.storage.external': 'External file',
156
+ 'tflite.kind.builtin': 'Builtin', 'tflite.kind.custom': 'Custom', 'tflite.kind.input': 'Input',
157
+ 'tflite.kind.output': 'Output', 'tflite.kind.signatureInput': 'Signature input',
158
+ 'tflite.kind.signatureOutput': 'Signature output',
159
+ 'tflite.info.description': 'Description', 'tflite.info.schemaVersion': 'Schema version',
160
+ 'tflite.info.identifier': 'File identifier', 'tflite.info.minRuntime': 'Minimum runtime',
161
+ 'tflite.info.fileSize': 'File size', 'tflite.info.weights': 'Weight bytes',
162
+ 'tflite.info.subgraphs': 'Subgraphs', 'tflite.info.signatures': 'Signatures',
163
+ 'tflite.info.operatorCode': 'Operator code', 'tflite.info.metadata': 'Metadata',
164
+ 'tflite.info.expectedSize': 'Expected size', 'tflite.info.shapeSignature': 'Shape signature',
165
+ 'tflite.info.sparsity': 'Sparsity', 'tflite.info.traversalOrder': 'Traversal order', 'tflite.info.blockMap': 'Block map',
166
+ 'tflite.inspector.inputs': 'Inputs', 'tflite.inspector.outputs': 'Outputs',
167
+ 'tflite.inspector.intermediates': 'Intermediates', 'tflite.inspector.options': 'Options',
168
+ 'tflite.inspector.customOptions': 'Custom options', 'tflite.inspector.subgraphs': 'Referenced subgraphs',
118
169
  'proto.title': 'Protocol Buffer', 'proto.summary': '{syntax} · {package} · {messages} messages · {services} services',
119
170
  'proto.noPackage': 'no package', 'proto.search': 'Search message, field, enum, RPC', 'proto.copyPanel': 'Copy panel',
120
171
  'proto.panel.tree': 'Message Tree', 'proto.panel.types': 'Types', 'proto.panel.relationships': 'Relationships',
@@ -64,6 +64,10 @@ export const CATALOG_JA = {
64
64
  'safetensors.structure': '構造', 'safetensors.noData': '表示できるデータがありません。',
65
65
  'safetensors.matchingRows': '一致する行: {count}件',
66
66
  'safetensors.matchingRowsLimited': '一致する{total}行中{visible}行を表示',
67
+ 'numpy.title': 'NumPy配列', 'numpy.selectArray': '配列を選択', 'numpy.data': 'データ',
68
+ 'numpy.arrays': '配列一覧', 'numpy.copyJson': 'JSONをコピー', 'numpy.noData': '表示できる配列がありません。',
69
+ 'numpy.previewUnavailable': 'このデータ型の値プレビューは利用できません。', 'numpy.slice': 'スライス',
70
+ 'numpy.gridShown': '{totalRows}行中{rows}行・{totalColumns}列中{columns}列を表示',
67
71
  'gguf.title': 'GGUF', 'gguf.search': 'メタデータとテンソルを検索…', 'gguf.copyJson': 'JSONをコピー',
68
72
  'gguf.structure': '構造', 'gguf.noData': '表示できるデータがありません。',
69
73
  'gguf.matchingRows': '一致する行: {count}件',
@@ -111,6 +115,53 @@ export const CATALOG_JA = {
111
115
  'onnx.info.training': '学習グラフ', 'onnx.info.configurations': 'デバイス構成',
112
116
  'onnx.info.quantization': '量子化注釈', 'onnx.info.deviceConfiguration': 'デバイス構成',
113
117
  'onnx.info.pipelineStage': 'パイプライン段階',
118
+ 'tflite.title': 'TFLiteモデル', 'tflite.search': '演算子・テンソル・バッファを検索…',
119
+ 'tflite.copyJson': 'JSONをコピー', 'tflite.subgraph': 'サブグラフ', 'tflite.unnamed': '名前なし',
120
+ 'tflite.graph': 'グラフ', 'tflite.operators': '演算子', 'tflite.tensors': 'テンソル',
121
+ 'tflite.io': '入力と出力', 'tflite.buffers': 'バッファ', 'tflite.modelInfo': 'モデル情報',
122
+ 'tflite.rows': '{total}行中{shown}行を表示', 'tflite.noMatches': '検索条件に一致する行はありません。',
123
+ 'tflite.selectNode': '演算子またはテンソルを選択すると詳細が表示されます。',
124
+ 'tflite.graphLimited': 'グラフプレビューは全{total}件中{shown}件を表示しています。',
125
+ 'tflite.graphEdgesLimited': '接続線は最初の{count}本のみ表示しています。',
126
+ 'tflite.moreItems': '他{count}件…', 'tflite.runtime': 'ランタイム {version}', 'tflite.schema': 'スキーマ v{version}',
127
+ 'tflite.scalar': 'スカラー', 'tflite.unknownRank': 'ランク不明', 'tflite.optional': '省略可', 'tflite.variable': '変数',
128
+ 'tflite.opDetail': '#{index} · v{version}', 'tflite.customBytes': 'カスタムオプション{bytes}バイト',
129
+ 'tflite.binaryBuffer': 'バイナリ、バッファ{buffer}に{bytes}',
130
+ 'tflite.summary.operators': '演算子', 'tflite.summary.tensors': 'テンソル',
131
+ 'tflite.summary.subgraphs': 'サブグラフ', 'tflite.summary.operatorCodes': '演算子コード',
132
+ 'tflite.summary.weights': '重み', 'tflite.summary.version': 'スキーマバージョン',
133
+ 'tflite.warning.identifier': 'ファイル識別子が想定のTFL3ではなく{identifier}です。',
134
+ 'tflite.warning.version': 'モデルはスキーマバージョン{version}を宣言していますが、このビューアはバージョン3を対象としています。',
135
+ 'tflite.warning.noSubgraphs': 'モデルにサブグラフがありません。',
136
+ 'tflite.warning.emptyGraph': 'モデルのサブグラフに演算子がありません。',
137
+ 'tflite.warning.customOps': 'カスタム演算子{count}件にはランタイムへの登録が必要です: {names}',
138
+ 'tflite.warning.flexOps': '{count}件の演算子がSelect TensorFlow演算にフォールバックします。',
139
+ 'tflite.warning.appendedBuffers': '{count}件のバッファがFlatBufferの外部にデータを保持しています。',
140
+ 'tflite.warning.externalBuffers': '{count}件の定数バッファはこのビューアが読まない別ファイルにあります。',
141
+ 'tflite.warning.missingExternalBuffers': '{count}件のテンソルがモデルに宣言されていない外部バッファを参照しています。',
142
+ 'tflite.column.index': '#', 'tflite.column.name': '名前', 'tflite.column.operator': '演算子',
143
+ 'tflite.column.kind': '種類', 'tflite.column.version': 'バージョン', 'tflite.column.inputs': '入力',
144
+ 'tflite.column.outputs': '出力', 'tflite.column.optionsType': 'オプション型', 'tflite.column.options': 'オプション',
145
+ 'tflite.column.type': '型', 'tflite.column.shape': '形状', 'tflite.column.elements': '要素数',
146
+ 'tflite.column.dataSize': 'データサイズ', 'tflite.column.storage': '格納場所',
147
+ 'tflite.column.quantization': '量子化', 'tflite.column.variable': '変数',
148
+ 'tflite.column.signature': 'シグネチャ', 'tflite.column.typeShape': '型 / 形状',
149
+ 'tflite.column.tensorIndex': 'テンソル', 'tflite.column.fileOffset': 'ファイルオフセット',
150
+ 'tflite.column.usedBy': '使用元', 'tflite.column.buffer': 'バッファ',
151
+ 'tflite.storage.empty': 'ランタイム', 'tflite.storage.inline': 'インライン', 'tflite.storage.appended': '外部追加', 'tflite.storage.external': '外部ファイル',
152
+ 'tflite.kind.builtin': '組み込み', 'tflite.kind.custom': 'カスタム', 'tflite.kind.input': '入力',
153
+ 'tflite.kind.output': '出力', 'tflite.kind.signatureInput': 'シグネチャ入力',
154
+ 'tflite.kind.signatureOutput': 'シグネチャ出力',
155
+ 'tflite.info.description': '説明', 'tflite.info.schemaVersion': 'スキーマバージョン',
156
+ 'tflite.info.identifier': 'ファイル識別子', 'tflite.info.minRuntime': '最小ランタイム',
157
+ 'tflite.info.fileSize': 'ファイルサイズ', 'tflite.info.weights': '重みバイト数',
158
+ 'tflite.info.subgraphs': 'サブグラフ', 'tflite.info.signatures': 'シグネチャ',
159
+ 'tflite.info.operatorCode': '演算子コード', 'tflite.info.metadata': 'メタデータ',
160
+ 'tflite.info.expectedSize': '想定サイズ', 'tflite.info.shapeSignature': '形状シグネチャ',
161
+ 'tflite.info.sparsity': 'スパース性', 'tflite.info.traversalOrder': '走査順序', 'tflite.info.blockMap': 'ブロックマップ',
162
+ 'tflite.inspector.inputs': '入力', 'tflite.inspector.outputs': '出力',
163
+ 'tflite.inspector.intermediates': '中間テンソル', 'tflite.inspector.options': 'オプション',
164
+ 'tflite.inspector.customOptions': 'カスタムオプション', 'tflite.inspector.subgraphs': '参照サブグラフ',
114
165
  'proto.title': 'Protocol Buffer', 'proto.summary': '{syntax} · {package} · メッセージ{messages}件 · サービス{services}件',
115
166
  'proto.noPackage': 'パッケージなし', 'proto.search': 'メッセージ、フィールド、列挙型、RPCを検索', 'proto.copyPanel': 'パネルをコピー',
116
167
  'proto.panel.tree': 'メッセージツリー', 'proto.panel.types': '型', 'proto.panel.relationships': '関係',
@@ -66,6 +66,10 @@ export const CATALOG_KO = {
66
66
  'safetensors.structure': '구조', 'safetensors.noData': '표시할 데이터가 없습니다.',
67
67
  'safetensors.matchingRows': '일치하는 행 {count}개',
68
68
  'safetensors.matchingRowsLimited': '전체 {total}행 중 일치하는 {visible}행 표시',
69
+ 'numpy.title': 'NumPy 배열', 'numpy.selectArray': '배열 선택', 'numpy.data': '데이터',
70
+ 'numpy.arrays': '배열 목록', 'numpy.copyJson': 'JSON 복사', 'numpy.noData': '표시할 배열이 없습니다.',
71
+ 'numpy.previewUnavailable': '이 데이터 타입은 값 미리보기를 제공하지 않습니다.', 'numpy.slice': '슬라이스',
72
+ 'numpy.gridShown': '전체 {totalRows}행 중 {rows}행 · 전체 {totalColumns}열 중 {columns}열 표시',
69
73
  'gguf.title': 'GGUF', 'gguf.search': '메타데이터와 텐서 검색…', 'gguf.copyJson': 'JSON 복사',
70
74
  'gguf.structure': '구조', 'gguf.noData': '표시할 데이터가 없습니다.',
71
75
  'gguf.matchingRows': '일치하는 행 {count}개',
@@ -113,6 +117,53 @@ export const CATALOG_KO = {
113
117
  'onnx.info.training': '학습 그래프', 'onnx.info.configurations': '장치 구성',
114
118
  'onnx.info.quantization': '양자화 주석', 'onnx.info.deviceConfiguration': '장치 구성',
115
119
  'onnx.info.pipelineStage': '파이프라인 단계',
120
+ 'tflite.title': 'TFLite 모델', 'tflite.search': '연산자, 텐서, 버퍼 검색…',
121
+ 'tflite.copyJson': 'JSON 복사', 'tflite.subgraph': '서브그래프', 'tflite.unnamed': '이름 없음',
122
+ 'tflite.graph': '그래프', 'tflite.operators': '연산자', 'tflite.tensors': '텐서',
123
+ 'tflite.io': '입력 및 출력', 'tflite.buffers': '버퍼', 'tflite.modelInfo': '모델 정보',
124
+ 'tflite.rows': '{total}행 중 {shown}행 표시', 'tflite.noMatches': '검색 조건과 일치하는 행이 없습니다.',
125
+ 'tflite.selectNode': '연산자나 텐서를 선택하면 상세 정보가 표시됩니다.',
126
+ 'tflite.graphLimited': '그래프 미리보기에 전체 {total}개 중 {shown}개를 표시합니다.',
127
+ 'tflite.graphEdgesLimited': '연결선은 처음 {count}개만 표시합니다.',
128
+ 'tflite.moreItems': '{count}개 더…', 'tflite.runtime': '런타임 {version}', 'tflite.schema': '스키마 v{version}',
129
+ 'tflite.scalar': '스칼라', 'tflite.unknownRank': '랭크 불명', 'tflite.optional': '선택적', 'tflite.variable': '변수',
130
+ 'tflite.opDetail': '#{index} · v{version}', 'tflite.customBytes': '커스텀 옵션 {bytes}바이트',
131
+ 'tflite.binaryBuffer': '바이너리, 버퍼 {buffer}에 {bytes}',
132
+ 'tflite.summary.operators': '연산자', 'tflite.summary.tensors': '텐서',
133
+ 'tflite.summary.subgraphs': '서브그래프', 'tflite.summary.operatorCodes': '연산자 코드',
134
+ 'tflite.summary.weights': '가중치', 'tflite.summary.version': '스키마 버전',
135
+ 'tflite.warning.identifier': '파일 식별자가 예상되는 TFL3가 아니라 {identifier}입니다.',
136
+ 'tflite.warning.version': '모델이 스키마 버전 {version}을 선언했습니다. 이 뷰어는 버전 3을 기준으로 합니다.',
137
+ 'tflite.warning.noSubgraphs': '모델에 서브그래프가 없습니다.',
138
+ 'tflite.warning.emptyGraph': '모델의 서브그래프에 연산자가 없습니다.',
139
+ 'tflite.warning.customOps': '커스텀 연산자 {count}개는 런타임에 별도 등록이 필요합니다: {names}',
140
+ 'tflite.warning.flexOps': '연산자 {count}개가 Select TensorFlow 연산으로 대체됩니다.',
141
+ 'tflite.warning.appendedBuffers': '버퍼 {count}개가 FlatBuffer 바깥에 데이터를 저장합니다.',
142
+ 'tflite.warning.externalBuffers': '상수 버퍼 {count}개가 이 뷰어가 읽지 않는 별도 파일에 있습니다.',
143
+ 'tflite.warning.missingExternalBuffers': '텐서 {count}개가 모델에 선언되지 않은 외부 버퍼를 참조합니다.',
144
+ 'tflite.column.index': '#', 'tflite.column.name': '이름', 'tflite.column.operator': '연산자',
145
+ 'tflite.column.kind': '종류', 'tflite.column.version': '버전', 'tflite.column.inputs': '입력',
146
+ 'tflite.column.outputs': '출력', 'tflite.column.optionsType': '옵션 형식', 'tflite.column.options': '옵션',
147
+ 'tflite.column.type': '타입', 'tflite.column.shape': '형상', 'tflite.column.elements': '요소 수',
148
+ 'tflite.column.dataSize': '데이터 크기', 'tflite.column.storage': '저장 위치',
149
+ 'tflite.column.quantization': '양자화', 'tflite.column.variable': '변수',
150
+ 'tflite.column.signature': '시그니처', 'tflite.column.typeShape': '타입 / 형상',
151
+ 'tflite.column.tensorIndex': '텐서', 'tflite.column.fileOffset': '파일 오프셋',
152
+ 'tflite.column.usedBy': '사용처', 'tflite.column.buffer': '버퍼',
153
+ 'tflite.storage.empty': '런타임', 'tflite.storage.inline': '인라인', 'tflite.storage.appended': '외부 추가', 'tflite.storage.external': '외부 파일',
154
+ 'tflite.kind.builtin': '내장', 'tflite.kind.custom': '커스텀', 'tflite.kind.input': '입력',
155
+ 'tflite.kind.output': '출력', 'tflite.kind.signatureInput': '시그니처 입력',
156
+ 'tflite.kind.signatureOutput': '시그니처 출력',
157
+ 'tflite.info.description': '설명', 'tflite.info.schemaVersion': '스키마 버전',
158
+ 'tflite.info.identifier': '파일 식별자', 'tflite.info.minRuntime': '최소 런타임',
159
+ 'tflite.info.fileSize': '파일 크기', 'tflite.info.weights': '가중치 바이트',
160
+ 'tflite.info.subgraphs': '서브그래프', 'tflite.info.signatures': '시그니처',
161
+ 'tflite.info.operatorCode': '연산자 코드', 'tflite.info.metadata': '메타데이터',
162
+ 'tflite.info.expectedSize': '예상 크기', 'tflite.info.shapeSignature': '형상 시그니처',
163
+ 'tflite.info.sparsity': '희소성', 'tflite.info.traversalOrder': '순회 순서', 'tflite.info.blockMap': '블록 맵',
164
+ 'tflite.inspector.inputs': '입력', 'tflite.inspector.outputs': '출력',
165
+ 'tflite.inspector.intermediates': '중간 텐서', 'tflite.inspector.options': '옵션',
166
+ 'tflite.inspector.customOptions': '커스텀 옵션', 'tflite.inspector.subgraphs': '참조 서브그래프',
116
167
  'proto.title': 'Protocol Buffer', 'proto.summary': '{syntax} · {package} · 메시지 {messages}개 · 서비스 {services}개',
117
168
  'proto.noPackage': '패키지 없음', 'proto.search': '메시지, 필드, enum, RPC 검색', 'proto.copyPanel': '패널 복사',
118
169
  'proto.panel.tree': '메시지 트리', 'proto.panel.types': '타입', 'proto.panel.relationships': '관계',
@@ -57,6 +57,10 @@ export const CATALOG_ZH_CN = {
57
57
  'safetensors.title': 'Safetensors', 'safetensors.search': '搜索张量…', 'safetensors.copyJson': '复制 JSON',
58
58
  'safetensors.structure': '结构', 'safetensors.noData': '没有可用数据。',
59
59
  'safetensors.matchingRows': '{count} 个匹配行', 'safetensors.matchingRowsLimited': '显示 {visible} / {total} 个匹配行',
60
+ 'numpy.title': 'NumPy 数组', 'numpy.selectArray': '选择数组', 'numpy.data': '数据',
61
+ 'numpy.arrays': '数组列表', 'numpy.copyJson': '复制 JSON', 'numpy.noData': '没有可显示的数组。',
62
+ 'numpy.previewUnavailable': '此数据类型无法预览值。', 'numpy.slice': '切片',
63
+ 'numpy.gridShown': '显示 {rows} / {totalRows} 行 · {columns} / {totalColumns} 列',
60
64
  'gguf.title': 'GGUF', 'gguf.search': '搜索元数据和张量…', 'gguf.copyJson': '复制 JSON',
61
65
  'gguf.structure': '结构', 'gguf.noData': '没有可用数据。',
62
66
  'gguf.matchingRows': '{count} 个匹配行', 'gguf.matchingRowsLimited': '显示 {visible} / {total} 个匹配行',
@@ -102,6 +106,53 @@ export const CATALOG_ZH_CN = {
102
106
  'onnx.info.training': '训练图', 'onnx.info.configurations': '设备配置',
103
107
  'onnx.info.quantization': '量化注释', 'onnx.info.deviceConfiguration': '设备配置',
104
108
  'onnx.info.pipelineStage': '流水线阶段',
109
+ 'tflite.title': 'TFLite 模型', 'tflite.search': '搜索算子、张量和缓冲区…',
110
+ 'tflite.copyJson': '复制 JSON', 'tflite.subgraph': '子图', 'tflite.unnamed': '未命名',
111
+ 'tflite.graph': '计算图', 'tflite.operators': '算子', 'tflite.tensors': '张量',
112
+ 'tflite.io': '输入与输出', 'tflite.buffers': '缓冲区', 'tflite.modelInfo': '模型信息',
113
+ 'tflite.rows': '共 {total} 行,显示 {shown} 行', 'tflite.noMatches': '没有符合当前搜索条件的行。',
114
+ 'tflite.selectNode': '选择算子或张量以查看详情。',
115
+ 'tflite.graphLimited': '计算图预览显示 {total} 项中的 {shown} 项。',
116
+ 'tflite.graphEdgesLimited': '仅显示前 {count} 条连接。',
117
+ 'tflite.moreItems': '还有 {count} 项…', 'tflite.runtime': '运行时 {version}', 'tflite.schema': '架构 v{version}',
118
+ 'tflite.scalar': '标量', 'tflite.unknownRank': '秩未知', 'tflite.optional': '可选', 'tflite.variable': '变量',
119
+ 'tflite.opDetail': '#{index} · v{version}', 'tflite.customBytes': '自定义选项 {bytes} 字节',
120
+ 'tflite.binaryBuffer': '二进制,缓冲区 {buffer} 中 {bytes}',
121
+ 'tflite.summary.operators': '算子', 'tflite.summary.tensors': '张量',
122
+ 'tflite.summary.subgraphs': '子图', 'tflite.summary.operatorCodes': '算子编码',
123
+ 'tflite.summary.weights': '权重', 'tflite.summary.version': '架构版本',
124
+ 'tflite.warning.identifier': '文件标识为 {identifier},而非预期的 TFL3。',
125
+ 'tflite.warning.version': '模型声明的架构版本为 {version},本查看器针对版本 3。',
126
+ 'tflite.warning.noSubgraphs': '模型不包含子图。',
127
+ 'tflite.warning.emptyGraph': '模型的子图中没有算子。',
128
+ 'tflite.warning.customOps': '{count} 个自定义算子需要在运行时注册:{names}',
129
+ 'tflite.warning.flexOps': '{count} 个算子回退到 Select TensorFlow 算子。',
130
+ 'tflite.warning.appendedBuffers': '{count} 个缓冲区将数据存放在 FlatBuffer 之外。',
131
+ 'tflite.warning.externalBuffers': '{count} 个常量缓冲区位于本查看器不读取的独立文件中。',
132
+ 'tflite.warning.missingExternalBuffers': '{count} 个张量引用了模型未声明的外部缓冲区。',
133
+ 'tflite.column.index': '#', 'tflite.column.name': '名称', 'tflite.column.operator': '算子',
134
+ 'tflite.column.kind': '类别', 'tflite.column.version': '版本', 'tflite.column.inputs': '输入',
135
+ 'tflite.column.outputs': '输出', 'tflite.column.optionsType': '选项类型', 'tflite.column.options': '选项',
136
+ 'tflite.column.type': '类型', 'tflite.column.shape': '形状', 'tflite.column.elements': '元素数',
137
+ 'tflite.column.dataSize': '数据大小', 'tflite.column.storage': '存储方式',
138
+ 'tflite.column.quantization': '量化', 'tflite.column.variable': '变量',
139
+ 'tflite.column.signature': '签名', 'tflite.column.typeShape': '类型 / 形状',
140
+ 'tflite.column.tensorIndex': '张量', 'tflite.column.fileOffset': '文件偏移',
141
+ 'tflite.column.usedBy': '使用者', 'tflite.column.buffer': '缓冲区',
142
+ 'tflite.storage.empty': '运行时', 'tflite.storage.inline': '内联', 'tflite.storage.appended': '外部追加', 'tflite.storage.external': '外部文件',
143
+ 'tflite.kind.builtin': '内置', 'tflite.kind.custom': '自定义', 'tflite.kind.input': '输入',
144
+ 'tflite.kind.output': '输出', 'tflite.kind.signatureInput': '签名输入',
145
+ 'tflite.kind.signatureOutput': '签名输出',
146
+ 'tflite.info.description': '说明', 'tflite.info.schemaVersion': '架构版本',
147
+ 'tflite.info.identifier': '文件标识', 'tflite.info.minRuntime': '最低运行时',
148
+ 'tflite.info.fileSize': '文件大小', 'tflite.info.weights': '权重字节数',
149
+ 'tflite.info.subgraphs': '子图', 'tflite.info.signatures': '签名',
150
+ 'tflite.info.operatorCode': '算子编码', 'tflite.info.metadata': '元数据',
151
+ 'tflite.info.expectedSize': '预期大小', 'tflite.info.shapeSignature': '形状签名',
152
+ 'tflite.info.sparsity': '稀疏性', 'tflite.info.traversalOrder': '遍历顺序', 'tflite.info.blockMap': '块映射',
153
+ 'tflite.inspector.inputs': '输入', 'tflite.inspector.outputs': '输出',
154
+ 'tflite.inspector.intermediates': '中间张量', 'tflite.inspector.options': '选项',
155
+ 'tflite.inspector.customOptions': '自定义选项', 'tflite.inspector.subgraphs': '引用的子图',
105
156
  'proto.title': 'Protocol Buffer', 'proto.summary': '{syntax} · {package} · {messages} 条消息 · {services} 个服务',
106
157
  'proto.noPackage': '无软件包', 'proto.search': '搜索消息、字段、枚举或 RPC', 'proto.copyPanel': '复制面板',
107
158
  'proto.panel.tree': '消息树', 'proto.panel.types': '类型', 'proto.panel.relationships': '关系',
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Only the enum tables are imported. Reading the file is done here: see
3
+ * preflightGguf, which walks metadata *and* the tensor index from source bytes.
4
+ * These tables are the part of @huggingface/gguf worth depending on -- new ggml
5
+ * quantization types land there, and hand-maintaining them would drift.
6
+ */
1
7
  import { type GGUFParseOutput, type GGUFTypedMetadata } from '@huggingface/gguf';
2
8
  export interface GgufSummaryItem {
3
9
  labelKey: string;
@@ -70,27 +76,46 @@ export type HuggingFaceGgufOutput = GGUFParseOutput & {
70
76
  typedMetadata: GGUFTypedMetadata;
71
77
  };
72
78
  /**
73
- * The upstream parser necessarily owns the complete tensor index. Do not then
74
- * multiply that attacker-controlled allocation across the document model,
79
+ * Entries kept for display. The walk visits every metadata key and every tensor,
80
+ * but only this many are retained, so peak memory is independent of how many
81
+ * there are -- and the retained set is not multiplied across the document model,
75
82
  * table rows, structure text, and clipboard JSON.
76
83
  */
77
84
  export declare const GGUF_PREVIEW_ENTRY_LIMIT = 1000;
78
85
  /** Total user-controlled characters copied into normalized display structures. */
79
86
  export declare const GGUF_NORMALIZED_TEXT_BUDGET = 2000000;
80
- /** Admission limits enforced from source bytes before @huggingface/gguf allocates entry objects. */
87
+ /**
88
+ * Structural admission limits, enforced from the source header before the walk
89
+ * starts. These bound how many *entries* a file may declare, which no amount of
90
+ * streaming can make free: each one still has to be visited.
91
+ *
92
+ * Note what is deliberately absent: there is no ceiling on metadata array
93
+ * elements. Array bodies are skipped rather than materialized, so vocabulary size
94
+ * no longer decides whether a document can be built -- the ceiling that rejected
95
+ * ordinary Qwen3 and Llama 3 files in
96
+ * https://github.com/battlecook/vscode-omni-viewer/issues/18 is gone rather than
97
+ * raised. What replaces it is exact instead of tuned: an array cannot declare more
98
+ * elements than the remaining file bytes can physically hold (see readGgufValue).
99
+ */
81
100
  export declare const GGUF_PARSE_TENSOR_LIMIT = 100000;
82
101
  export declare const GGUF_PARSE_METADATA_LIMIT = 10000;
83
- export declare const GGUF_PARSE_ARRAY_ELEMENT_LIMIT = 1000000;
102
+ /** Cumulative declared metadata string bytes; caps the text a document may draw from. */
84
103
  export declare const GGUF_PARSE_STRING_BYTE_LIMIT: number;
85
104
  /**
86
105
  * Parses a remote GGUF URL. Node local files use the abortable `./node` helper.
87
- * Tensor payload bytes are not decoded; @huggingface/gguf range-reads only the
88
- * metadata and tensor-info prefix.
106
+ * Tensor payload bytes are never read: only the metadata block and the tensor
107
+ * index that follows it are range-read, and array bodies within the metadata are
108
+ * skipped rather than decoded.
89
109
  */
90
110
  export declare function parseGgufUri(uri: string, options?: GgufParseOptions): Promise<GgufDocument>;
91
- /** Parses a complete in-memory input while preserving the upstream range-reader path. */
111
+ /** Parses a complete in-memory input through the same range reader as a remote URL. */
92
112
  export declare function parseGgufBytes(input: Uint8Array, options?: GgufBytesParseOptions): Promise<GgufDocument>;
93
- /** Converts @huggingface/gguf output to Omni Viewer's JSON-safe document model. */
113
+ /**
114
+ * Converts @huggingface/gguf output to Omni Viewer's JSON-safe document model.
115
+ * Retained as a public adapter for hosts that call `gguf()` themselves; the
116
+ * viewer's own parse path builds the same document from source bytes and shares
117
+ * every accumulator and check below, so the two cannot drift apart.
118
+ */
94
119
  export declare function normalizeGguf(output: HuggingFaceGgufOutput, fileSize?: string, fileByteLength?: number | bigint, sourceHeader?: GgufHeaderInfo): GgufDocument;
95
120
  /** Formats a byte count for display. Every GGUF entry point must use this one so
96
121
  * the same file is not labelled "4.00 KB" locally and "4.00 KiB" in memory. */