Skip to content

1 what is this#2

Draft
cubap wants to merge 6 commits intomainfrom
1-what-is-this
Draft

1 what is this#2
cubap wants to merge 6 commits intomainfrom
1-what-is-this

Conversation

@cubap
Copy link
Copy Markdown
Member

@cubap cubap commented Apr 18, 2026

This pull request introduces the initial implementation of the TPEN-Prompts split-tool scaffold for manuscript transcription with LLM assistance. It establishes the project structure, adds a comprehensive contribution guide, and implements the first split-screen interface with supporting JavaScript modules for context handling, prompt building, and secure messaging. The most important changes are:

Project Structure and Documentation

  • Added a detailed CONTRIBUTING.md outlining interface contracts, message formats, candidate requirements, save flow, runtime module responsibilities, security requirements, and PR expectations.
  • Updated README.md to describe the project layout, source directories, and example interface usage.
  • Added a Jekyll _config.yml to define collections for pages, scripts, and tools, and to ensure proper site generation.

Split-Tool Interface Implementation

  • Added _pages/transcription-assist.html, a split-screen tool interface that receives TPEN context, generates LLM prompts, and provides manual fallback for updating TPEN via JSON. Includes UI for context display, prompt generation, and manual API submission.

JavaScript Module Scaffolding

  • Implemented _scripts/message-bridge.js for secure message passing with origin validation, context and ID token request/response handling, and context validation.
  • Implemented _scripts/prompt-builder.js to generate context-aware, instruction-driven LLM prompts, including authoritative instruction file links and sample save-ready JSON payloads.

cubap added 6 commits April 17, 2026 15:32
Move and reorganize runtime JS into a new _scripts collection and add a full transcription-assist tool. Renamed/_moved tpen-api.js from _tools to _scripts and updated its candidate/unit handling (accepts pct/percent, normalizes unit handling, changes selector prefix), returns manifestUri and canvas dimensions. Add new runtime modules: message-bridge.js (origin allow-list, context + separate ID token request/subscribe flows), prompt-builder.js (tool-call JSON prompt generator), and transcription-assist.js (UI orchestration, canvas resolution, prompt generation, ID token request, candidate parsing/normalization and save flow). Update _pages/transcription-assist.html to load the new script path, add ID token UI button and metadata. Update docs (CONTRIBUTING.md, README.md and generated _site files) to reflect new _scripts layout, prompt schema, save flow, and security notes. Add several _tools markdown docs (COMMON_TASKS, HANDWRITING_TEXT_RECOGNITION, IMAGE_ANALYSIS, TPEN_API). Remove old generated /_site tool JS artifacts. Update _config.yml to publish the new scripts collection.
Add a browser-side fallback for read-only LLM outputs that can only GET resources: UI, handlers, and docs to let users paste serialized JSON payloads and submit Update Page/Columns/Lines requests to TPEN. Includes:

- UI/CSS: Manual TPEN Update panel with three payload cards (Page, Columns, Lines) and responsive layout.
- JS: new API_BASE, textarea parsing, fetch helpers, method inference for columns, and submit handlers wired to buttons; status updates and token checks included.
- Prompt changes: update prompt-builder to reference authoritative instruction files and require a single JSON tool-call response.
- Docs: COMMON_TASKS.md and TPEN_API.md updated to document the browser-submit fallback contract and user workflow.
- Minor fix: tighten unit validation in tpen-api.js to only allow empty/percent/pct when rawUnit is present.

This change enables models that cannot perform writes to still produce save-ready payloads which the user can submit from the browser using their authenticated session.
Add helpers to build the tools base URL and derive instruction file URLs (handles /split-tools/ paths and server-side fallback). Include idToken in the transcription prompt context and replace hardcoded _tools paths with generated URLs. Tighten instructions: prevent fabricating transcription lines or bounds, only emit save-ready JSON when explicitly requested, and ask to report missing resources instead of inventing data.
@cubap cubap linked an issue Apr 18, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What is this?

1 participant