Consolidate tools and fix static assets

This commit is contained in:
2026-04-12 01:18:26 +02:00
parent 7843073d13
commit f625cdae0d
14 changed files with 639 additions and 221 deletions

View File

@@ -1,8 +1,28 @@
<div class="api-grid">
<section class="panel tooling-surface">
<h2 class="panel-title">Reference data</h2>
<p class="panel-copy"><code>GET /api/reference-data</code></p>
<pre class="code-block">{
<ToolPageFrame
Eyebrow="API reference"
Title="API Surface"
Summary="The stable lookup and critical-cell editing contracts are grouped here by workflow so diagnostics and curation work can move quickly without leaving the app shell.">
<Actions>
<a class="btn btn-link" href="/tools">All tools</a>
<a class="btn btn-secondary" href="/tools/diagnostics">Open diagnostics</a>
</Actions>
<ChildContent>
<div class="api-reference-groups">
<section class="api-reference-group">
<div class="api-reference-group-header">
<span class="tool-page-eyebrow">Read models</span>
<h2>Reference and lookup payloads</h2>
</div>
<div class="api-grid">
<section class="panel tooling-surface api-endpoint-card">
<div class="api-endpoint-card-header">
<h3 class="panel-title">Reference data</h3>
<code>GET /api/reference-data</code>
</div>
<div class="tool-link-card-summary">Bootstraps attack tables, critical tables, labels, and high-level metadata for the main client flows.</div>
<pre class="code-block">{
"attackTables": [
{
"key": "broadsword",
@@ -22,35 +42,52 @@
}
]
}</pre>
</section>
</section>
<section class="panel tooling-surface">
<h2 class="panel-title">Attack lookup</h2>
<p class="panel-copy"><code>POST /api/lookup/attack</code></p>
<pre class="code-block">{
<section class="panel tooling-surface api-endpoint-card">
<div class="api-endpoint-card-header">
<h3 class="panel-title">Attack lookup</h3>
<code>POST /api/lookup/attack</code>
</div>
<div class="tool-link-card-summary">Resolves attack-table outcomes for the player-facing `Play` surface.</div>
<pre class="code-block">{
"attackTable": "broadsword",
"armorType": "AT10",
"roll": 111,
"criticalRoll": 72
}</pre>
</section>
</section>
<section class="panel tooling-surface">
<h2 class="panel-title">Critical lookup</h2>
<p class="panel-copy"><code>POST /api/lookup/critical</code></p>
<pre class="code-block">{
<section class="panel tooling-surface api-endpoint-card">
<div class="api-endpoint-card-header">
<h3 class="panel-title">Critical lookup</h3>
<code>POST /api/lookup/critical</code>
</div>
<div class="tool-link-card-summary">Returns resolved critical outcomes plus the imported table metadata needed to inspect the underlying source row.</div>
<pre class="code-block">{
"criticalType": "mana",
"column": "E",
"roll": 100,
"group": null
}</pre>
<p class="panel-copy">Response now includes table metadata, roll-band bounds, raw imported cell text, parse status, and parsed JSON alongside the gameplay description.</p>
</section>
</section>
</div>
</section>
<section class="panel tooling-surface">
<h2 class="panel-title">Cell editor load</h2>
<p class="panel-copy"><code>GET /api/tables/critical/{slug}/cells/{resultId}</code></p>
<pre class="code-block">{
<section class="api-reference-group">
<div class="api-reference-group-header">
<span class="tool-page-eyebrow">Curation contracts</span>
<h2>Critical-cell editing workflow</h2>
</div>
<div class="api-grid">
<section class="panel tooling-surface api-endpoint-card">
<div class="api-endpoint-card-header">
<h3 class="panel-title">Cell editor load</h3>
<code>GET /api/tables/critical/{slug}/cells/{resultId}</code>
</div>
<div class="tool-link-card-summary">Loads the full editable graph for one stored critical-table cell, including review notes and nested branches.</div>
<pre class="code-block">{
"resultId": 412,
"tableSlug": "slash",
"tableName": "Slash Critical Strike Table",
@@ -73,19 +110,23 @@
"effects": [],
"branches": []
}</pre>
<p class="panel-copy">Use this to retrieve the full editable result graph for one critical-table cell, including nested branches, normalized effects, and review notes for unresolved quick-parse tokens.</p>
</section>
</section>
<section class="panel tooling-surface">
<h2 class="panel-title">Cell source image</h2>
<p class="panel-copy"><code>GET /api/tables/critical/{slug}/cells/{resultId}/source-image</code></p>
<p class="panel-copy">Streams the importer-generated PNG crop for the current critical cell. Returns <code>404</code> when the row has no stored crop or the artifact is missing.</p>
</section>
<section class="panel tooling-surface api-endpoint-card">
<div class="api-endpoint-card-header">
<h3 class="panel-title">Cell source image</h3>
<code>GET /api/tables/critical/{slug}/cells/{resultId}/source-image</code>
</div>
<div class="tool-link-card-summary">Streams the importer-generated PNG crop for the current critical cell and returns `404` when no stored artifact is available.</div>
</section>
<section class="panel tooling-surface">
<h2 class="panel-title">Cell re-parse</h2>
<p class="panel-copy"><code>POST /api/tables/critical/{slug}/cells/{resultId}/reparse</code></p>
<pre class="code-block">{
<section class="panel tooling-surface api-endpoint-card">
<div class="api-endpoint-card-header">
<h3 class="panel-title">Cell re-parse</h3>
<code>POST /api/tables/critical/{slug}/cells/{resultId}/reparse</code>
</div>
<div class="tool-link-card-summary">Re-runs the single-cell parser and merges generated output with the current override state without persisting changes.</div>
<pre class="code-block">{
"currentState": {
"rawCellText": "Strike to thigh. +8H\nWith greaves: blow glances aside.",
"descriptionText": "Curated prose",
@@ -101,15 +142,17 @@
"branches": []
}
}</pre>
<p class="panel-copy">Re-runs the shared single-cell parser, merges the generated result with the current override state, and returns the refreshed editor payload without saving changes. Unknown or partially parsed tokens are surfaced explicitly in the returned review data.</p>
</section>
</section>
<section class="panel tooling-surface">
<h2 class="panel-title">Cell editor save</h2>
<p class="panel-copy"><code>PUT /api/tables/critical/{slug}/cells/{resultId}</code></p>
<pre class="code-block">{
<section class="panel tooling-surface api-endpoint-card">
<div class="api-endpoint-card-header">
<h3 class="panel-title">Cell editor save</h3>
<code>PUT /api/tables/critical/{slug}/cells/{resultId}</code>
</div>
<div class="tool-link-card-summary">Replaces the stored base result, branch rows, and effect rows for the targeted cell with the submitted curated payload.</div>
<pre class="code-block">{
"rawCellText": "Corrected imported text",
"descriptionText": "Rewritten prose after manual review",
"descriptionText": "Rewritten prose after manual review",
"rawAffixText": "+10H - must parry 2 rnds",
"parseStatus": "manually_curated",
"parsedJson": "{\"reviewed\":true}",
@@ -138,6 +181,9 @@
],
"branches": []
}</pre>
<p class="panel-copy">The save endpoint replaces the stored base result, branch rows, and effect rows for that cell with the submitted curated payload.</p>
</section>
</div>
</section>
</div>
</section>
</div>
</ChildContent>
</ToolPageFrame>