@overworks/chara-card-tui 0.2.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 +31 -0
- package/dist/App.d.ts +2 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +175 -0
- package/dist/App.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @overworks/chara-card-tui
|
|
2
|
+
|
|
3
|
+
Interactive TUI Explorer for Character Cards (V1, V2, V3).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Visual Preview**: View character avatars directly in your terminal using Sixel, Kitty, or iTerm protocols (with automatic fallback for other terminals).
|
|
8
|
+
- **File Explorer**: Browse JSON, PNG, and CharX files in your terminal.
|
|
9
|
+
- **Instant Inspector**: View card metadata, validation status, and issues at a glance.
|
|
10
|
+
- **Quick Actions**:
|
|
11
|
+
- **Normalize**: Press `n` to save a normalized JSON version of any card.
|
|
12
|
+
- **Pack**: Press `p` on a directory to package it into a `.charx` container.
|
|
13
|
+
- **Cross-Platform**: Works on Linux, macOS, and Windows.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Run instantly via npx
|
|
19
|
+
npx @overworks/chara-card-tui
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Controls
|
|
23
|
+
|
|
24
|
+
- **Arrow Keys**: Navigate the file list.
|
|
25
|
+
- **n**: Normalize and save the selected card as JSON.
|
|
26
|
+
- **p**: Pack the selected directory into a `.charx` container.
|
|
27
|
+
- **q / Esc**: Quit the explorer.
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
MIT
|
package/dist/App.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAqBA,eAAO,MAAM,GAAG,+CAyRf,CAAC"}
|
package/dist/App.js
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { Box, Text, useInput, useApp } from 'ink';
|
|
4
|
+
import SelectInput from 'ink-select-input';
|
|
5
|
+
import Image, { TerminalInfoProvider } from 'ink-picture';
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { validateCard, extractCardFromPng, parseCharx, buildCharx, normalizeV3Card, normalizeV2Card, upgradeV1ToV2, } from '@overworks/chara-card-core';
|
|
9
|
+
export const App = () => {
|
|
10
|
+
const { exit } = useApp();
|
|
11
|
+
const [files, setFiles] = useState([]);
|
|
12
|
+
const [selectedFile, setSelectedFile] = useState(null);
|
|
13
|
+
const [cardInfo, setCardInfo] = useState(null);
|
|
14
|
+
const [imageBuffer, setImageBuffer] = useState(null);
|
|
15
|
+
const [error, setError] = useState(null);
|
|
16
|
+
const [statusMessage, setStatusMessage] = useState(null);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (statusMessage) {
|
|
19
|
+
const timer = setTimeout(() => setStatusMessage(null), 3000);
|
|
20
|
+
return () => clearTimeout(timer);
|
|
21
|
+
}
|
|
22
|
+
}, [statusMessage]);
|
|
23
|
+
const refreshFiles = () => {
|
|
24
|
+
const allFiles = fs.readdirSync(process.cwd());
|
|
25
|
+
const filtered = allFiles
|
|
26
|
+
.filter(f => {
|
|
27
|
+
const ext = path.extname(f).toLowerCase();
|
|
28
|
+
try {
|
|
29
|
+
const isDir = fs.statSync(f).isDirectory();
|
|
30
|
+
return isDir || ext === '.json' || ext === '.png' || ext === '.charx';
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
.map(f => {
|
|
37
|
+
const isDir = fs.statSync(f).isDirectory();
|
|
38
|
+
return { label: isDir ? `[DIR] ${f}` : f, value: f };
|
|
39
|
+
});
|
|
40
|
+
setFiles(filtered);
|
|
41
|
+
return filtered;
|
|
42
|
+
};
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
const filtered = refreshFiles();
|
|
45
|
+
if (filtered.length > 0 && filtered[0]) {
|
|
46
|
+
setSelectedFile(filtered[0].value);
|
|
47
|
+
}
|
|
48
|
+
}, []);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!selectedFile)
|
|
51
|
+
return;
|
|
52
|
+
try {
|
|
53
|
+
const isDir = fs.statSync(selectedFile).isDirectory();
|
|
54
|
+
if (isDir) {
|
|
55
|
+
setCardInfo({ container: 'directory', ok: true });
|
|
56
|
+
setImageBuffer(null);
|
|
57
|
+
setError(null);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const buffer = fs.readFileSync(selectedFile);
|
|
61
|
+
let value = null;
|
|
62
|
+
let container = "json";
|
|
63
|
+
let imgBuf = null;
|
|
64
|
+
// PNG Detection
|
|
65
|
+
if (buffer[0] === 0x89 && buffer[1] === 0x50) {
|
|
66
|
+
value = extractCardFromPng(buffer);
|
|
67
|
+
container = "png";
|
|
68
|
+
imgBuf = buffer;
|
|
69
|
+
}
|
|
70
|
+
// ZIP Detection
|
|
71
|
+
else if (buffer[0] === 0x50 && buffer[1] === 0x4b) {
|
|
72
|
+
const { card, assets } = parseCharx(buffer);
|
|
73
|
+
value = card;
|
|
74
|
+
container = "charx";
|
|
75
|
+
// Find best image asset
|
|
76
|
+
const imageKey = Object.keys(assets).find(k => k.toLowerCase() === 'card.png' || k.toLowerCase() === 'avatar.png') ||
|
|
77
|
+
Object.keys(assets).find(k => k.toLowerCase().endsWith('.png')) ||
|
|
78
|
+
Object.keys(assets).find(k => k.toLowerCase().endsWith('.webp'));
|
|
79
|
+
if (imageKey) {
|
|
80
|
+
imgBuf = assets[imageKey] || null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// JSON
|
|
84
|
+
else {
|
|
85
|
+
value = JSON.parse(new TextDecoder().decode(buffer));
|
|
86
|
+
imgBuf = null;
|
|
87
|
+
}
|
|
88
|
+
const result = validateCard(value);
|
|
89
|
+
setCardInfo({
|
|
90
|
+
ok: result.ok,
|
|
91
|
+
format: result.format,
|
|
92
|
+
card: result.ok ? result.card : value,
|
|
93
|
+
container,
|
|
94
|
+
issues: result.issues,
|
|
95
|
+
});
|
|
96
|
+
setImageBuffer(imgBuf);
|
|
97
|
+
setError(null);
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
setError(e.message);
|
|
101
|
+
setCardInfo(null);
|
|
102
|
+
setImageBuffer(null);
|
|
103
|
+
}
|
|
104
|
+
}, [selectedFile]);
|
|
105
|
+
useInput((input, key) => {
|
|
106
|
+
if (input === 'q' || key.escape) {
|
|
107
|
+
exit();
|
|
108
|
+
}
|
|
109
|
+
if (input === 'n' && cardInfo?.ok && cardInfo.container !== 'directory' && selectedFile) {
|
|
110
|
+
try {
|
|
111
|
+
let normalized;
|
|
112
|
+
if (cardInfo.format === 'v3')
|
|
113
|
+
normalized = normalizeV3Card(cardInfo.card);
|
|
114
|
+
else if (cardInfo.format === 'v2')
|
|
115
|
+
normalized = normalizeV2Card(cardInfo.card);
|
|
116
|
+
else
|
|
117
|
+
normalized = upgradeV1ToV2(cardInfo.card);
|
|
118
|
+
const outPath = `${selectedFile.replace(/\.[^/.]+$/, '')}.normalized.json`;
|
|
119
|
+
fs.writeFileSync(outPath, JSON.stringify(normalized, null, 2));
|
|
120
|
+
setStatusMessage(`Saved to ${outPath}`);
|
|
121
|
+
refreshFiles();
|
|
122
|
+
}
|
|
123
|
+
catch (e) {
|
|
124
|
+
setStatusMessage(`Error: ${e.message}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (input === 'p' && cardInfo?.container === 'directory' && selectedFile) {
|
|
128
|
+
try {
|
|
129
|
+
const dirPath = selectedFile;
|
|
130
|
+
const subFiles = fs.readdirSync(dirPath);
|
|
131
|
+
const assets = {};
|
|
132
|
+
let card = undefined;
|
|
133
|
+
for (const fileName of subFiles) {
|
|
134
|
+
const filePath = path.join(dirPath, fileName);
|
|
135
|
+
const stat = fs.statSync(filePath);
|
|
136
|
+
if (stat.isDirectory())
|
|
137
|
+
continue;
|
|
138
|
+
const buffer = fs.readFileSync(filePath);
|
|
139
|
+
if (fileName.toLowerCase().endsWith(".json") && !card) {
|
|
140
|
+
try {
|
|
141
|
+
const json = JSON.parse(new TextDecoder().decode(buffer));
|
|
142
|
+
const validated = validateCard(json);
|
|
143
|
+
if (validated.ok) {
|
|
144
|
+
card = validated.card;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch { }
|
|
149
|
+
}
|
|
150
|
+
assets[fileName] = buffer;
|
|
151
|
+
}
|
|
152
|
+
if (!card) {
|
|
153
|
+
setStatusMessage("Error: No valid card JSON found in directory");
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const outPath = `${dirPath.replace(/\/$/, "")}.charx`;
|
|
157
|
+
const buffer = buildCharx(card, assets);
|
|
158
|
+
fs.writeFileSync(outPath, buffer);
|
|
159
|
+
setStatusMessage(`Packed into ${outPath}`);
|
|
160
|
+
refreshFiles();
|
|
161
|
+
}
|
|
162
|
+
catch (e) {
|
|
163
|
+
setStatusMessage(`Error: ${e.message}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
const handleSelect = (item) => {
|
|
168
|
+
// Action on enter?
|
|
169
|
+
};
|
|
170
|
+
const handleHighlight = (item) => {
|
|
171
|
+
setSelectedFile(item.value);
|
|
172
|
+
};
|
|
173
|
+
return (_jsx(TerminalInfoProvider, { children: _jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "Character Card Explorer" }), _jsx(Text, { dimColor: true, children: " (Press 'q' to quit)" })] }), _jsxs(Box, { flexDirection: "row", height: 20, children: [_jsxs(Box, { width: "40%", borderStyle: "single", flexDirection: "column", paddingX: 1, children: [_jsx(Text, { underline: true, children: "Files" }), files.length > 0 ? (_jsx(SelectInput, { items: files, onSelect: handleSelect, onHighlight: handleHighlight })) : (_jsx(Text, { italic: true, color: "gray", children: "No cards found in CWD" }))] }), _jsxs(Box, { width: "60%", borderStyle: "single", flexDirection: "row", paddingX: 1, children: [_jsxs(Box, { flexDirection: "column", flexGrow: 1, children: [_jsx(Text, { underline: true, children: "Inspector" }), error && (_jsxs(Text, { color: "red", children: ["Error: ", error] })), cardInfo && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [cardInfo.container === 'directory' ? (_jsxs(Text, { children: ["Type: ", _jsx(Text, { color: "yellow", children: "Directory" })] })) : (_jsxs(_Fragment, { children: [_jsxs(Text, { children: ["Status: ", cardInfo.ok ? _jsx(Text, { color: "green", children: "Valid" }) : _jsx(Text, { color: "red", children: "Invalid" }), _jsxs(Text, { dimColor: true, children: [" [", cardInfo.container, "]"] })] }), _jsxs(Text, { children: ["Format: ", _jsx(Text, { color: "yellow", children: cardInfo.format })] }), cardInfo.card && (_jsxs(_Fragment, { children: [_jsxs(Text, { children: ["Name: ", _jsx(Text, { bold: true, children: cardInfo.card.name || (cardInfo.card.data?.name) })] }), cardInfo.card.data?.creator && (_jsxs(Text, { children: ["Creator: ", cardInfo.card.data.creator] })), cardInfo.card.data?.tags && cardInfo.card.data.tags.length > 0 && (_jsxs(Text, { children: ["Tags: ", cardInfo.card.data.tags.join(', ')] })), cardInfo.card.data?.assets && (_jsxs(Text, { children: ["Assets: ", cardInfo.card.data.assets.length] }))] })), !cardInfo.ok && cardInfo.issues.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: "red", bold: true, children: "Issues:" }), cardInfo.issues.slice(0, 3).map((issue, i) => (_jsxs(Text, { color: "red", children: ["- ", issue.message, " (", issue.path, ")"] }, i))), cardInfo.issues.length > 3 && _jsx(Text, { color: "red", children: "..." })] }))] })), _jsxs(Box, { marginTop: 1, flexDirection: "column", children: [_jsx(Text, { color: "cyan", bold: true, children: "Actions:" }), cardInfo.container === 'directory' ? (_jsx(Text, { children: "- Press 'p' to Pack into .charx" })) : (_jsxs(_Fragment, { children: [_jsx(Text, { children: "- Press 'n' to Normalize & Save as JSON" }), _jsx(Text, { children: "- Press 'c' to Convert to... (TODO)" })] }))] })] })), !selectedFile && !error && (_jsx(Text, { italic: true, color: "gray", children: "Select a file to inspect" }))] }), imageBuffer && (_jsx(Box, { marginLeft: 2, width: 30, height: 15, justifyContent: "center", alignItems: "center", children: _jsx(Image, { src: Buffer.from(imageBuffer), width: 28, height: 14, alt: "Character Preview" }) }))] })] }), statusMessage && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "magenta", bold: true, children: ["Status: ", statusMessage] }) }))] }) }));
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=App.js.map
|
package/dist/App.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClD,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,EAAE,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,aAAa,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E,MAAM,EAAE,EAAE,EAAE,GAAG,EAAC,mBAAmB,GAAG,GAC1F,CACP,IACG,IACF,EAEL,aAAa,IAAI,CAChB,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,MAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,+BAAU,aAAa,IAAQ,GACrD,CACP,IACG,GACe,CACxB,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,CAAC,KAAC,GAAG,KAAG,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@overworks/chara-card-tui",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "TUI Explorer for Character Cards",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"chara-tui": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc -p tsconfig.json",
|
|
23
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
24
|
+
"test": "vitest run"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@overworks/chara-card-core": "workspace:*",
|
|
28
|
+
"ink": "^5.1.0",
|
|
29
|
+
"ink-picture": "^1.3.5",
|
|
30
|
+
"ink-select-input": "^6.2.0",
|
|
31
|
+
"react": "^18.3.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/react": "^18.3.12",
|
|
35
|
+
"ink-testing-library": "^4.0.0"
|
|
36
|
+
}
|
|
37
|
+
}
|