Brand inspector as Hugin
This commit is contained in:
parent
b460612680
commit
8631f0ab62
10 changed files with 103 additions and 51 deletions
10
README.md
10
README.md
|
|
@ -32,7 +32,7 @@ This is not an ORM in a fake mustache. It is for cases where you want:
|
|||
|
||||
That keeps the polymorphic boundary tight without making callers write boilerplate by candlelight.
|
||||
|
||||
## Inspector
|
||||
## Hugin Inspector
|
||||
|
||||
CultCache files may use the `.cc` extension. The bytes are still the canonical
|
||||
`cultcache.store.v1` MessagePack snapshot; the extension is the human handle, not
|
||||
|
|
@ -50,15 +50,15 @@ Build the Vite inspector bundle:
|
|||
npm run build:inspector
|
||||
```
|
||||
|
||||
Build a desktop package:
|
||||
Build the desktop package:
|
||||
|
||||
```sh
|
||||
npm run dist:inspector
|
||||
```
|
||||
|
||||
The inspector is read-only. Drop a `.cc`, `.msgpack`, or `.mpack` file onto the
|
||||
window to inspect the snapshot header, schema catalog, records, and decoded
|
||||
MessagePack payload previews without registering application schemas.
|
||||
Hugin is read-only. Drop a `.cc`, `.msgpack`, or `.mpack` file onto the window to
|
||||
inspect the snapshot header, schema catalog, records, and decoded MessagePack
|
||||
payload previews without registering application schemas.
|
||||
|
||||
## Example
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
{
|
||||
"appId": "com.gamecult.cultcache.inspector",
|
||||
"productName": "CultCache Inspector",
|
||||
"executableName": "CultCacheInspector",
|
||||
"productName": "Hugin",
|
||||
"executableName": "Hugin",
|
||||
"asar": false,
|
||||
"icon": "inspector/public/hugin.ico",
|
||||
"extraMetadata": {
|
||||
"main": "electron/main.cjs"
|
||||
},
|
||||
|
|
@ -16,7 +17,7 @@
|
|||
"win": {
|
||||
"signAndEditExecutable": false,
|
||||
"target": ["portable"],
|
||||
"artifactName": "CultCache-Inspector-${version}.${ext}"
|
||||
"artifactName": "Hugin-${version}.${ext}"
|
||||
},
|
||||
"mac": {
|
||||
"target": ["dir"]
|
||||
|
|
|
|||
|
|
@ -9,8 +9,9 @@ function createWindow() {
|
|||
height: 780,
|
||||
minWidth: 820,
|
||||
minHeight: 560,
|
||||
title: "CultCache Inspector",
|
||||
backgroundColor: "#f4f2ea",
|
||||
title: "Hugin",
|
||||
icon: path.join(__dirname, "..", "dist-inspector", "hugin-64.png"),
|
||||
backgroundColor: "#05090d",
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
contextIsolation: true,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>CultCache Inspector</title>
|
||||
<title>Hugin</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
|
|
|||
BIN
inspector/public/hugin-256.png
Normal file
BIN
inspector/public/hugin-256.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
inspector/public/hugin-64.png
Normal file
BIN
inspector/public/hugin-64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
BIN
inspector/public/hugin.ico
Normal file
BIN
inspector/public/hugin.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
inspector/public/hugin.png
Normal file
BIN
inspector/public/hugin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
|
|
@ -46,8 +46,11 @@ function render(): void {
|
|||
<main class="workspace ${dragging ? "is-dragging" : ""}">
|
||||
<section class="sidebar">
|
||||
<div class="brand">
|
||||
<h1>CultCache Inspector</h1>
|
||||
<p>Drop a <code>.cc</code> file and read the wire format without registering app schemas.</p>
|
||||
<img src="/hugin-64.png" alt="" width="64" height="64" />
|
||||
<div>
|
||||
<h1>Hugin</h1>
|
||||
<p>CultCache state inspection for <code>.cc</code> files.</p>
|
||||
</div>
|
||||
</div>
|
||||
<label class="dropzone">
|
||||
<input id="file-input" type="file" accept=".cc,.msgpack,.mpack,application/octet-stream" />
|
||||
|
|
@ -124,8 +127,9 @@ function renderEmptyState(): string {
|
|||
function renderNoFile(): string {
|
||||
return `
|
||||
<div class="hero">
|
||||
<h2>No file loaded</h2>
|
||||
<p>Drag a CultCache <code>.cc</code> store into the window. The inspector shows the snapshot header, schema catalog, records, and decoded payload slot arrays.</p>
|
||||
<img src="/hugin.png" alt="" />
|
||||
<h2>No state loaded</h2>
|
||||
<p>Drag a CultCache <code>.cc</code> store into the window to inspect the snapshot header, schema catalog, records, and decoded MessagePack payloads.</p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,20 @@
|
|||
:root {
|
||||
color-scheme: light;
|
||||
color-scheme: dark;
|
||||
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
color: #1b2421;
|
||||
background: #f4f2ea;
|
||||
color: #dce9ee;
|
||||
background: #05090d;
|
||||
--bg: #05090d;
|
||||
--panel: #0b131b;
|
||||
--panel-strong: #101c27;
|
||||
--ink: #dce9ee;
|
||||
--muted: #8296a3;
|
||||
--line: #1e3444;
|
||||
--line-bright: #1e7fa4;
|
||||
--cyan: #33e6f3;
|
||||
--cyan-soft: rgba(51, 230, 243, 0.16);
|
||||
--cyan-glow: rgba(51, 230, 243, 0.36);
|
||||
--brass: #d49a3d;
|
||||
--danger: #ff897d;
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
|
@ -29,25 +41,44 @@ code {
|
|||
|
||||
.workspace {
|
||||
display: grid;
|
||||
grid-template-columns: 310px minmax(0, 1fr);
|
||||
grid-template-columns: 330px minmax(0, 1fr);
|
||||
min-height: 100vh;
|
||||
background:
|
||||
radial-gradient(circle at 78% 18%, rgba(39, 202, 239, 0.12), transparent 30%),
|
||||
linear-gradient(135deg, #05090d 0%, #07111a 48%, #030507 100%);
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
border-right: 1px solid #cfd7d0;
|
||||
background: #fffdf7;
|
||||
border-right: 1px solid var(--line);
|
||||
background: linear-gradient(180deg, rgba(14, 27, 38, 0.98), rgba(5, 9, 13, 0.98));
|
||||
padding: 22px;
|
||||
box-shadow: 8px 0 36px rgba(0, 0, 0, 0.32);
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: grid;
|
||||
grid-template-columns: 64px minmax(0, 1fr);
|
||||
gap: 14px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.brand img {
|
||||
border-radius: 8px;
|
||||
image-rendering: pixelated;
|
||||
filter: drop-shadow(0 0 14px var(--cyan-glow));
|
||||
}
|
||||
|
||||
.brand h1 {
|
||||
margin: 0;
|
||||
font-size: 25px;
|
||||
color: #f0fbff;
|
||||
font-size: 30px;
|
||||
line-height: 1.05;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.brand p {
|
||||
margin: 10px 0 18px;
|
||||
color: #61716b;
|
||||
margin: 7px 0 18px;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
|
@ -57,17 +88,19 @@ code {
|
|||
gap: 6px;
|
||||
place-items: center;
|
||||
min-height: 132px;
|
||||
border: 2px dashed #8ba59e;
|
||||
border: 1px dashed #276982;
|
||||
border-radius: 8px;
|
||||
background: #eef7f4;
|
||||
color: #123f3b;
|
||||
background: linear-gradient(180deg, rgba(13, 38, 50, 0.72), rgba(6, 15, 22, 0.88));
|
||||
color: var(--cyan);
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
box-shadow: inset 0 0 18px rgba(51, 230, 243, 0.06);
|
||||
}
|
||||
|
||||
.is-dragging .dropzone {
|
||||
border-color: #0f766e;
|
||||
background: #dff4ef;
|
||||
border-color: var(--cyan);
|
||||
background: rgba(51, 230, 243, 0.12);
|
||||
box-shadow: 0 0 22px var(--cyan-glow), inset 0 0 22px rgba(51, 230, 243, 0.1);
|
||||
}
|
||||
|
||||
.dropzone input {
|
||||
|
|
@ -83,7 +116,7 @@ code {
|
|||
}
|
||||
|
||||
.drop-copy {
|
||||
color: #61716b;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
|
|
@ -94,15 +127,15 @@ code {
|
|||
}
|
||||
|
||||
.metric {
|
||||
border: 1px solid #d6ddd7;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
background: #ffffff;
|
||||
background: rgba(12, 23, 32, 0.92);
|
||||
padding: 11px;
|
||||
}
|
||||
|
||||
.metric span {
|
||||
display: block;
|
||||
color: #61716b;
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
|
@ -121,18 +154,27 @@ code {
|
|||
display: grid;
|
||||
align-content: center;
|
||||
min-height: calc(100vh - 36px);
|
||||
max-width: 620px;
|
||||
max-width: 680px;
|
||||
}
|
||||
|
||||
.hero img {
|
||||
width: 168px;
|
||||
height: 168px;
|
||||
margin-bottom: 18px;
|
||||
image-rendering: pixelated;
|
||||
filter: drop-shadow(0 0 28px var(--cyan-glow));
|
||||
}
|
||||
|
||||
.hero h2 {
|
||||
margin: 0;
|
||||
color: #f0fbff;
|
||||
font-size: 42px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.hero p {
|
||||
margin: 14px 0 0;
|
||||
color: #61716b;
|
||||
color: var(--muted);
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
|
|
@ -148,10 +190,11 @@ code {
|
|||
|
||||
.panel {
|
||||
min-width: 0;
|
||||
border: 1px solid #cfd7d0;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
background: #ffffff;
|
||||
background: rgba(8, 16, 23, 0.94);
|
||||
overflow: hidden;
|
||||
box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
|
||||
}
|
||||
|
||||
.panel header {
|
||||
|
|
@ -159,18 +202,20 @@ code {
|
|||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #dce2dd;
|
||||
border-bottom: 1px solid var(--line);
|
||||
padding: 11px 12px;
|
||||
background: rgba(16, 28, 39, 0.92);
|
||||
}
|
||||
|
||||
.panel h2 {
|
||||
margin: 0;
|
||||
color: #f0fbff;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.panel header span {
|
||||
overflow: hidden;
|
||||
color: #61716b;
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
|
@ -186,9 +231,9 @@ code {
|
|||
|
||||
.row {
|
||||
width: 100%;
|
||||
border: 1px solid #d6ddd7;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 6px;
|
||||
background: #fbfcfa;
|
||||
background: var(--panel-strong);
|
||||
color: inherit;
|
||||
padding: 10px;
|
||||
text-align: left;
|
||||
|
|
@ -196,8 +241,8 @@ code {
|
|||
}
|
||||
|
||||
.row[aria-selected="true"] {
|
||||
border-color: #0f766e;
|
||||
box-shadow: inset 3px 0 0 #0f766e;
|
||||
border-color: var(--cyan);
|
||||
box-shadow: inset 3px 0 0 var(--cyan), 0 0 18px rgba(51, 230, 243, 0.12);
|
||||
}
|
||||
|
||||
.row strong,
|
||||
|
|
@ -208,7 +253,7 @@ code {
|
|||
|
||||
.row span {
|
||||
margin-top: 4px;
|
||||
color: #61716b;
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
|
@ -229,7 +274,7 @@ dl {
|
|||
}
|
||||
|
||||
dt {
|
||||
color: #61716b;
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
|
@ -242,8 +287,9 @@ pre {
|
|||
max-height: 440px;
|
||||
overflow: auto;
|
||||
border-radius: 6px;
|
||||
background: #15201e;
|
||||
color: #f1fff9;
|
||||
border: 1px solid #142b39;
|
||||
background: #03080c;
|
||||
color: #dffbff;
|
||||
padding: 12px;
|
||||
font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
|
||||
font-size: 12px;
|
||||
|
|
@ -251,15 +297,15 @@ pre {
|
|||
}
|
||||
|
||||
.error {
|
||||
border: 1px solid #e0ada6;
|
||||
border: 1px solid rgba(255, 137, 125, 0.42);
|
||||
border-radius: 6px;
|
||||
background: #fff3f0;
|
||||
color: #9c332f;
|
||||
background: rgba(94, 27, 24, 0.28);
|
||||
color: var(--danger);
|
||||
padding: 10px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.empty {
|
||||
padding: 18px;
|
||||
color: #61716b;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue