1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-12-04 18:56:44 +01:00
archivr/crates/archivr-server/static/index.html
TheGeneralist 0aeb1a9580 feat: PUT /summary endpoint for agent-written and hand-edited summaries
Adds PUT /api/archives/:id/entries/:uid/summary so agents (via the MCP)
and humans (via the web UI) can write or edit entry summaries without
going through a server-side LLM provider.

Core (archivr-core)
- summarizer.rs: EXTERNAL_SUMMARY_KINDS, external_summary_text,
  normalize_external_model — full validation (trim, dedupe+lowercase tags,
  control-char checks, per-field length limits) + 13 unit tests.
- database.rs: extract new_summary_uid(); add insert_completed_entry_summary
  — single-row INSERT with status='completed', prompt_version='external',
  input_sha256='external', all timestamps set to now.

Server (archivr-server)
- routes.rs: ExternalSummaryBody, put_entry_summary_handler. Checks: role
  (USER), entry visibility (hidden→404), kind in [agent|manual], model
  validation, text validation, manual-requires-existing-summary (409).
  Returns 201 + the new EntrySummaryRecord. Route registered alongside
  existing GET+POST.
- entry_access.rs: PUT /summary added to the hidden-entry gate test.
- Three new tokio tests: agent creates and becomes latest, manual requires
  existing summary, body and role validation.

Frontend
- api.js: saveEntrySummary (PUT, kind:'manual').
- ContextRail.jsx: SUMMARY_SOURCE_LABEL (agent/manual labels), three new
  state vars, handleSaveSummary (scoped to selected entry), edit form
  (TL;DR/summary/tags + Save/Cancel), provider controls hidden while editing.
- styles.css: rail-summary-edit-btn, rail-summary-editor and sub-classes.

Companion MCP PR: thegeneralist01/archivr-mcp#<TBD>
2026-10-13 18:27:52 +02:00

15 lines
515 B
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Archivr</title>
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<script type="module" crossorigin src="/assets/index-CSEU9J6M.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-D-bTRI4I.css">
</head>
<body>
<div id="root"></div>
</body>
</html>