cvpfus Codex commited on
Commit
5aad2d1
·
1 Parent(s): 938a15c

Add copy buttons for runtime commands

Browse files

Co-authored-by: Codex <codex@openai.com>

Files changed (5) hide show
  1. FIELD_NOTES.md +1 -1
  2. README.md +1 -1
  3. SUBMISSION.md +1 -1
  4. scripts/verify.py +2 -0
  5. static/app.js +12 -0
FIELD_NOTES.md CHANGED
@@ -26,7 +26,7 @@ Tiny Narrator is a small-model accessibility article reader. It is not a generic
26
 
27
  The app exposes the same budget through `/api/model-budget`, including numeric `params_billion` values, per-model `within_limit` values, and a boolean `all_models_within_limit` check. The session panel renders each model's parameter count and Tiny Titan pass state so the claim is visible during the demo.
28
 
29
- Runtime setup is also data-backed. `/api/runtime-setup` lists the app command, llama.cpp launch command, model-specific runtime paths, environment values, and fallbacks. The session panel renders the runtime labels, setup commands, and fallbacks so the demo can distinguish real model wiring from deterministic safety nets.
30
 
31
  The judge runbook lives at `/api/demo-script` and is rendered in the session panel with its API evidence checks. It keeps the live presentation repeatable by pairing visible actions with API checks for health, model budget, runtime setup, runtime status, image descriptions, reader narration, and speech. Each API check includes copyable curl and PowerShell-friendly `curl.exe` commands for quick reproduction. Deployed demos can set `PUBLIC_BASE_URL` so those commands point at the public Space instead of localhost.
32
 
 
26
 
27
  The app exposes the same budget through `/api/model-budget`, including numeric `params_billion` values, per-model `within_limit` values, and a boolean `all_models_within_limit` check. The session panel renders each model's parameter count and Tiny Titan pass state so the claim is visible during the demo.
28
 
29
+ Runtime setup is also data-backed. `/api/runtime-setup` lists the app command, llama.cpp launch command, model-specific runtime paths, environment values, and fallbacks. The session panel renders the runtime labels, setup commands, copy controls, and fallbacks so the demo can distinguish real model wiring from deterministic safety nets.
30
 
31
  The judge runbook lives at `/api/demo-script` and is rendered in the session panel with its API evidence checks. It keeps the live presentation repeatable by pairing visible actions with API checks for health, model budget, runtime setup, runtime status, image descriptions, reader narration, and speech. Each API check includes copyable curl and PowerShell-friendly `curl.exe` commands for quick reproduction. Deployed demos can set `PUBLIC_BASE_URL` so those commands point at the public Space instead of localhost.
32
 
README.md CHANGED
@@ -135,6 +135,6 @@ A submission-readiness panel reads `/api/submission-readiness`, giving judges on
135
 
136
  The Copy Evidence button reads `/api/evidence-bundle` and copies the core judge receipts as formatted JSON for quick review or submission notes.
137
 
138
- A runtime-plan panel reads `/api/runtime-setup` and summarizes each model path's runtime, setup command, and fallback, keeping the live demo honest about what is online and what is deterministic.
139
 
140
  `/api/runtime-status` performs a short readiness check for llama.cpp and local speech dependencies, then reports which fallback paths are ready for a live demo. The session panel renders live status details for reader brain, vision, speech, and image generation.
 
135
 
136
  The Copy Evidence button reads `/api/evidence-bundle` and copies the core judge receipts as formatted JSON for quick review or submission notes.
137
 
138
+ A runtime-plan panel reads `/api/runtime-setup` and summarizes each model path's runtime, setup command, and fallback, keeping the live demo honest about what is online and what is deterministic. Runtime setup commands have copy controls with the same clipboard fallback messaging as judge API commands.
139
 
140
  `/api/runtime-status` performs a short readiness check for llama.cpp and local speech dependencies, then reports which fallback paths are ready for a live demo. The session panel renders live status details for reader brain, vision, speech, and image generation.
SUBMISSION.md CHANGED
@@ -38,7 +38,7 @@ The prototype is designed for a live hackathon demo: every model-facing path has
38
 
39
  - `/api/health`: app identity, custom frontend marker, llama.cpp base URL, and model manifest.
40
  - `/api/model-budget`: Tiny Titan parameter proof with numeric `params_billion` and per-model pass values.
41
- - `/api/runtime-setup`: app command, model runtime commands rendered in the UI, environment values, and fallback paths.
42
  - `/api/runtime-status`: online or fallback-ready status for each model path, rendered in the session panel.
43
  - `/api/accessibility-audit`: semantic queue, keyboard navigation, reader cursor state, shortcut safety, live narration, alt text, transcript, user control, and fallback evidence.
44
  - `/api/demo-script`: repeatable judge runbook and API checks.
 
38
 
39
  - `/api/health`: app identity, custom frontend marker, llama.cpp base URL, and model manifest.
40
  - `/api/model-budget`: Tiny Titan parameter proof with numeric `params_billion` and per-model pass values.
41
+ - `/api/runtime-setup`: app command, copyable model runtime commands rendered in the UI, environment values, and fallback paths.
42
  - `/api/runtime-status`: online or fallback-ready status for each model path, rendered in the session panel.
43
  - `/api/accessibility-audit`: semantic queue, keyboard navigation, reader cursor state, shortcut safety, live narration, alt text, transcript, user control, and fallback evidence.
44
  - `/api/demo-script`: repeatable judge runbook and API checks.
scripts/verify.py CHANGED
@@ -57,6 +57,8 @@ def verify_static_assets() -> None:
57
  assert_true("loadDemoScript" in app_js, "Frontend should render the structured demo script")
58
  assert_true("runtimeStatusList.innerHTML" in app_js, "Frontend should render live runtime status details")
59
  assert_true("runtime-command" in app_js, "Frontend should render runtime setup commands")
 
 
60
  assert_true("payload.api_checks" in app_js, "Frontend should render structured demo API checks")
61
  assert_true("demo-api-command" in app_js, "Frontend should render copyable demo commands")
62
  assert_true("demo-command-copy" in app_js, "Frontend should expose copy buttons for demo commands")
 
57
  assert_true("loadDemoScript" in app_js, "Frontend should render the structured demo script")
58
  assert_true("runtimeStatusList.innerHTML" in app_js, "Frontend should render live runtime status details")
59
  assert_true("runtime-command" in app_js, "Frontend should render runtime setup commands")
60
+ assert_true("runtime-command-copy" in app_js, "Frontend should expose copy buttons for runtime setup commands")
61
+ assert_true("runtimeSetupList.addEventListener" in app_js, "Runtime setup command copy actions should be delegated")
62
  assert_true("payload.api_checks" in app_js, "Frontend should render structured demo API checks")
63
  assert_true("demo-api-command" in app_js, "Frontend should render copyable demo commands")
64
  assert_true("demo-command-copy" in app_js, "Frontend should expose copy buttons for demo commands")
static/app.js CHANGED
@@ -396,6 +396,7 @@ async function loadRuntimeSetup() {
396
  <span class="runtime-pill">${escapeHtml(step.runtime)}</span>
397
  </div>
398
  <code class="runtime-command">${escapeHtml(step.command)}</code>
 
399
  <p>${escapeHtml(step.fallback)}</p>
400
  </li>
401
  `)
@@ -823,6 +824,17 @@ demoApiCheckList.addEventListener("click", async (event) => {
823
  "Command is visible, but clipboard access is unavailable.",
824
  );
825
  });
 
 
 
 
 
 
 
 
 
 
 
826
  controls.play.addEventListener("click", () => {
827
  if (!enabled) return;
828
  if (currentIndex < 0) {
 
396
  <span class="runtime-pill">${escapeHtml(step.runtime)}</span>
397
  </div>
398
  <code class="runtime-command">${escapeHtml(step.command)}</code>
399
+ <button class="runtime-command-copy" type="button" data-command="${escapeHtml(step.command)}">Copy command</button>
400
  <p>${escapeHtml(step.fallback)}</p>
401
  </li>
402
  `)
 
824
  "Command is visible, but clipboard access is unavailable.",
825
  );
826
  });
827
+ runtimeSetupList.addEventListener("click", async (event) => {
828
+ const button = event.target.closest(".runtime-command-copy");
829
+ if (!button) return;
830
+ const command = button.dataset.command || "";
831
+ await copyTextToClipboard(
832
+ command,
833
+ "Runtime setup command copied.",
834
+ "Runtime setup command is empty.",
835
+ "Runtime setup command is visible, but clipboard access is unavailable.",
836
+ );
837
+ });
838
  controls.play.addEventListener("click", () => {
839
  if (!enabled) return;
840
  if (currentIndex < 0) {