papergod 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +244 -0
- package/ROADMAP.md +171 -0
- package/example/main.tex +360 -0
- package/frontend/src/components/ui/badge.jsx +5 -0
- package/frontend/src/components/ui/button.jsx +24 -0
- package/frontend/src/components/workbench.jsx +182 -0
- package/frontend/src/lib/utils.js +6 -0
- package/frontend/src/main.jsx +19 -0
- package/frontend/src/theme.css +256 -0
- package/frontend/vite.config.js +23 -0
- package/package.json +73 -0
- package/papergod-demo.png +0 -0
- package/public/app.js +5480 -0
- package/public/brand/papergod-logo.png +0 -0
- package/public/i18n.js +95 -0
- package/public/index.html +480 -0
- package/public/pdf-sentence-mapping.js +142 -0
- package/public/react/app.js +209 -0
- package/public/react/assets/addon-fit-YJmn1quW.js +12 -0
- package/public/react/assets/addon-web-links-BWjmmSgS.js +12 -0
- package/public/react/assets/main.css +32 -0
- package/public/react/assets/xterm-BqvuqXEL.js +27 -0
- package/public/style.css +1462 -0
- package/src/cli.js +128 -0
- package/src/server/agent-adapters.js +1240 -0
- package/src/server/agent-errors.js +105 -0
- package/src/server/agent-runtime.js +81 -0
- package/src/server/agent.js +173 -0
- package/src/server/app-version.js +86 -0
- package/src/server/change-history.js +114 -0
- package/src/server/document-structure.js +174 -0
- package/src/server/index.js +1442 -0
- package/src/server/latex-structure.js +344 -0
- package/src/server/latex.js +67 -0
- package/src/server/library-engine.js +193 -0
- package/src/server/library-files.js +134 -0
- package/src/server/literature-review.js +122 -0
- package/src/server/orchestration-engine.js +662 -0
- package/src/server/paragraph-analysis.js +300 -0
- package/src/server/project-resources.js +290 -0
- package/src/server/project-store.js +808 -0
- package/src/server/prompt-manifest.js +300 -0
- package/src/server/references.js +425 -0
- package/src/server/review-panel.js +263 -0
- package/src/server/revise-workflow.js +278 -0
- package/src/server/revision-engine.js +607 -0
- package/src/server/security.js +16 -0
- package/src/server/text-extraction.js +149 -0
- package/src/server/workspace-browser.js +49 -0
- package/src/server/workspace-registry.js +143 -0
- package/src/server/workspace-terminal.js +99 -0
- package/src/server/workspace.js +223 -0
- package/src/server/zotero.js +98 -0
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Papergod</title>
|
|
7
|
+
<link rel="icon" type="image/png" href="/brand/papergod-logo.png">
|
|
8
|
+
<link rel="stylesheet" href="/vendor/codemirror/lib/codemirror.css">
|
|
9
|
+
<link rel="stylesheet" href="/style.css">
|
|
10
|
+
<link rel="stylesheet" href="/react/assets/main.css">
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="root"></div>
|
|
14
|
+
|
|
15
|
+
<div id="workspace-manager-overlay" class="hidden compact-overlay" role="dialog" aria-modal="true" aria-labelledby="workspace-manager-title">
|
|
16
|
+
<section id="workspace-manager-dialog" class="compact-dialog">
|
|
17
|
+
<div class="library-header"><div><h2 id="workspace-manager-title" data-i18n="workspace.title">Workspaces</h2><p data-i18n="workspace.subtitle">Switch papers without restarting Papergod. Each folder keeps its own Agent configuration and writing data.</p></div><button id="workspace-manager-close" type="button" aria-label="Close">×</button></div>
|
|
18
|
+
<div class="workspace-manager-body">
|
|
19
|
+
<div id="workspace-current-card"><span data-i18n="workspace.current">Current workspace</span><strong id="workspace-current-name">—</strong><code id="workspace-current-path">—</code></div>
|
|
20
|
+
<div id="workspace-list" aria-live="polite"><div class="outline-empty" data-i18n="workspace.loading">Loading workspaces…</div></div>
|
|
21
|
+
<form id="workspace-add-form">
|
|
22
|
+
<label for="workspace-path" data-i18n="workspace.addLabel">Add a local folder</label>
|
|
23
|
+
<p data-i18n="workspace.addHelp">Choose an existing folder, including a cloned Git repository. Empty folders receive a starter paper and writing library.</p>
|
|
24
|
+
<div class="workspace-path-row"><input id="workspace-path" type="text" placeholder="/absolute/path/to/paper" required><button id="workspace-browse" type="button" data-i18n="workspace.browse">Browse…</button></div>
|
|
25
|
+
<section id="workspace-browser" class="hidden">
|
|
26
|
+
<div class="workspace-browser-head"><button id="workspace-browser-up" type="button" aria-label="Parent folder">↑</button><code id="workspace-browser-path">—</code><button id="workspace-browser-select" type="button" data-i18n="workspace.selectFolder">Select this folder</button></div>
|
|
27
|
+
<div id="workspace-browser-list"><div class="outline-empty" data-i18n="workspace.loadingFolders">Loading folders…</div></div>
|
|
28
|
+
</section>
|
|
29
|
+
<button id="workspace-add" class="primary" type="submit" data-i18n="workspace.addSwitch">Add and switch</button>
|
|
30
|
+
<p id="workspace-manager-note" role="status" aria-live="polite"></p>
|
|
31
|
+
</form>
|
|
32
|
+
</div>
|
|
33
|
+
</section>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div id="terminal-overlay" class="hidden compact-overlay" role="dialog" aria-modal="true" aria-labelledby="terminal-title">
|
|
37
|
+
<section id="terminal-dialog" class="compact-dialog">
|
|
38
|
+
<div class="library-header"><div><h2 id="terminal-title" data-i18n="terminal.title">Workspace Terminal</h2><p id="terminal-workspace" data-i18n="terminal.starting">Starting shell in the current workspace…</p></div><div class="terminal-header-actions"><button id="terminal-stop" type="button" data-i18n="terminal.stop">Stop terminal</button><button id="terminal-close" type="button" aria-label="Close">×</button></div></div>
|
|
39
|
+
<div id="terminal-screen" aria-label="Interactive workspace terminal"></div>
|
|
40
|
+
<div id="terminal-status" role="status" aria-live="polite" data-i18n="terminal.connecting">Connecting…</div>
|
|
41
|
+
</section>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div id="references-overlay" class="hidden compact-overlay" role="dialog" aria-modal="true" aria-labelledby="references-title">
|
|
45
|
+
<section id="references-dialog" class="compact-dialog">
|
|
46
|
+
<div class="library-header"><div><h2 id="references-title" data-i18n="references.title">References</h2><p data-i18n="references.subtitle">One searchable citation library from local papers and Zotero Desktop.</p></div><button id="references-close" type="button" aria-label="Close">×</button></div>
|
|
47
|
+
<div class="references-toolbar">
|
|
48
|
+
<input id="references-search" type="search" data-i18n-placeholder="references.search" placeholder="Search title, author, year, DOI, or citekey…">
|
|
49
|
+
<button id="references-write-bib" type="button" data-i18n="references.writeBib">Update references.bib</button>
|
|
50
|
+
<button id="references-check" type="button" data-i18n="references.check">Check citations</button>
|
|
51
|
+
<button id="references-insert-selected" class="primary" type="button" data-i18n="references.insertSelected">Insert selected</button>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="references-review-row">
|
|
54
|
+
<input id="references-review-prompt" type="text" data-i18n-placeholder="references.reviewPrompt" placeholder="What should the review paragraph cover? (optional)">
|
|
55
|
+
<button id="references-review" type="button" data-i18n="references.reviewButton">Generate review paragraph</button>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="references-body">
|
|
58
|
+
<aside class="references-sources">
|
|
59
|
+
<section><h3 data-i18n="references.folderSource">Literature folders</h3><p data-i18n="references.folderHelp">Scan BibTeX and PDF files recursively. Uncertain PDF matches remain marked for review.</p>
|
|
60
|
+
<form id="references-folder-form"><div class="reference-folder-path-row"><input id="references-folder-path" type="text" placeholder="/absolute/path/to/papers" required><button id="references-folder-browse" type="button" data-i18n="workspace.browse">Browse…</button></div><button type="submit" data-i18n="references.addScan">Add & scan</button></form>
|
|
61
|
+
<div id="references-folders"><div class="outline-empty" data-i18n="references.noFolders">No folders configured.</div></div>
|
|
62
|
+
<button id="references-rescan" type="button" data-i18n="references.rescan">Rescan folders</button>
|
|
63
|
+
</section>
|
|
64
|
+
<section><div class="reference-source-heading"><h3>Zotero Desktop</h3><span id="zotero-status">—</span></div><p data-i18n="references.zoteroHelp">Read the local Zotero library without cloud credentials.</p>
|
|
65
|
+
<button id="zotero-connect" type="button" data-i18n="references.connectZotero">Connect Zotero</button>
|
|
66
|
+
<select id="zotero-collection" class="hidden"><option value="" data-i18n="references.allZotero">All Zotero items</option></select>
|
|
67
|
+
<div class="zotero-search-row hidden" id="zotero-search-row"><input id="zotero-search" type="search" placeholder="Search Zotero…"><button id="zotero-search-button" type="button" data-i18n="references.searchButton">Search</button></div>
|
|
68
|
+
<div id="zotero-results"></div>
|
|
69
|
+
</section>
|
|
70
|
+
</aside>
|
|
71
|
+
<main class="references-library">
|
|
72
|
+
<div class="references-summary"><span id="references-count">0 references</span><span id="references-bib-file">references.bib</span></div>
|
|
73
|
+
<div id="references-check-result" class="hidden"></div>
|
|
74
|
+
<div id="references-review-result" class="hidden"></div>
|
|
75
|
+
<button id="references-add-setup" class="hidden" type="button" data-i18n="references.addSetup">Add bibliography setup to paper</button>
|
|
76
|
+
<div id="references-list"><div class="outline-empty" data-i18n="references.loading">Loading references…</div></div>
|
|
77
|
+
</main>
|
|
78
|
+
</div>
|
|
79
|
+
<div id="references-note" role="status" aria-live="polite"></div>
|
|
80
|
+
</section>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div id="pdf-scope-menu" class="hidden pdf-menu" role="menu" aria-label="PDF annotation scope">
|
|
84
|
+
<button data-pdf-scope="word" type="button" data-i18n="pdf.word">Word</button>
|
|
85
|
+
<button data-pdf-scope="sentence" type="button" data-i18n="pdf.sentence">Sentence</button>
|
|
86
|
+
<button data-pdf-scope="paragraph" type="button" data-i18n="pdf.paragraph">Paragraph</button>
|
|
87
|
+
<button id="pdf-locate-source" class="pdf-menu-secondary" type="button" data-i18n="pdf.locateSource">Locate in LaTeX source</button>
|
|
88
|
+
<button id="pdf-sentence-reader-open" type="button" data-i18n="pdf.reader">Sentence reader</button>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div id="pdf-edit-menu" class="hidden pdf-menu" role="dialog" aria-label="PDF revision comment">
|
|
92
|
+
<blockquote id="pdf-edit-quote"></blockquote>
|
|
93
|
+
<textarea id="pdf-edit-comment" rows="3" placeholder="What should the AI change?" data-i18n-placeholder="pdf.commentPlaceholder"></textarea>
|
|
94
|
+
<div class="pdf-edit-actions"><button id="pdf-edit-cancel" type="button" data-i18n="pdf.cancel">Cancel</button><button id="pdf-edit-submit" class="primary" type="button" data-i18n="pdf.queue">Add to revision queue</button></div>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div id="sentence-reader-overlay" class="hidden compact-overlay" role="dialog" aria-modal="true" aria-labelledby="sentence-reader-title">
|
|
98
|
+
<section id="sentence-reader-dialog" class="compact-dialog">
|
|
99
|
+
<header class="sentence-reader-header">
|
|
100
|
+
<div><h2 id="sentence-reader-title" data-i18n="reader.title">Sentence reader</h2><p id="sentence-reader-position">Sentence 1 of 1</p></div>
|
|
101
|
+
<button id="sentence-reader-close" type="button" aria-label="Close sentence reader" data-i18n-aria-label="reader.close">×</button>
|
|
102
|
+
</header>
|
|
103
|
+
<div class="sentence-reader-body">
|
|
104
|
+
<p class="sentence-reader-help" data-i18n="reader.help">Focus on one sentence at a time. Select a word to comment on that word; leave all words unselected to comment on the whole sentence.</p>
|
|
105
|
+
<article id="sentence-reader-text" tabindex="0" aria-live="polite"></article>
|
|
106
|
+
<div id="sentence-reader-selection" data-i18n="reader.scopeSentence">Current scope: whole sentence</div>
|
|
107
|
+
<label for="sentence-reader-comment" data-i18n="reader.comment">Revision comment</label>
|
|
108
|
+
<textarea id="sentence-reader-comment" rows="4" placeholder="Describe how this sentence should be revised…" data-i18n-placeholder="reader.commentPlaceholder"></textarea>
|
|
109
|
+
<div class="sentence-reader-actions">
|
|
110
|
+
<button id="sentence-reader-prev" type="button" data-i18n="reader.previous">← Previous sentence</button>
|
|
111
|
+
<button id="sentence-reader-next" type="button" data-i18n="reader.next">Next sentence →</button>
|
|
112
|
+
<button id="sentence-reader-submit" class="primary" type="button" data-i18n="reader.queue">Add to revision queue</button>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</section>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<div id="agent-config-overlay" class="hidden compact-overlay" role="dialog" aria-modal="true" aria-labelledby="agent-config-title">
|
|
119
|
+
<section class="compact-dialog">
|
|
120
|
+
<div class="library-header"><div><h2 id="agent-config-title" data-i18n="agentConfig.title">Agent Configuration</h2><p data-i18n="agentConfig.subtitle">Configure local CLI Agents; unavailable adapters retain the same interface shape</p></div><button id="agent-config-close" aria-label="Close">×</button></div>
|
|
121
|
+
<div class="compact-dialog-body">
|
|
122
|
+
<div id="agent-provider-list"></div>
|
|
123
|
+
<form id="agent-config-form">
|
|
124
|
+
<label for="agent-config-provider" data-i18n="agentConfig.provider">Provider</label>
|
|
125
|
+
<select id="agent-config-provider"></select>
|
|
126
|
+
<p id="agent-config-note" aria-live="polite"></p>
|
|
127
|
+
<div class="agent-config-actions">
|
|
128
|
+
<button id="agent-config-login" type="button" class="hidden">Sign in</button>
|
|
129
|
+
<button id="agent-config-probe" type="button" data-i18n="agentConfig.check">Test subscription</button>
|
|
130
|
+
<button id="agent-config-save" type="submit" class="primary" data-i18n="agentConfig.save">Use this Agent</button>
|
|
131
|
+
</div>
|
|
132
|
+
<details class="agent-advanced-settings">
|
|
133
|
+
<summary>Advanced settings</summary>
|
|
134
|
+
<div class="agent-advanced-grid">
|
|
135
|
+
<label for="agent-config-command" data-i18n="agentConfig.command">CLI command</label>
|
|
136
|
+
<input id="agent-config-command" placeholder="codex">
|
|
137
|
+
<label for="agent-config-model" data-i18n="agentConfig.model">Model override</label>
|
|
138
|
+
<div class="agent-model-picker">
|
|
139
|
+
<input id="agent-config-model" placeholder="Use the CLI default" autocomplete="off">
|
|
140
|
+
<div id="agent-model-dropdown" class="agent-model-dropdown hidden" role="listbox" aria-label="Available models"></div>
|
|
141
|
+
</div>
|
|
142
|
+
<label for="agent-config-reasoning">Reasoning effort</label>
|
|
143
|
+
<select id="agent-config-reasoning"><option value="">Automatic by task</option><option value="minimal">Minimal</option><option value="low">Low</option><option value="medium">Medium</option><option value="high">High</option><option value="xhigh">Extra high</option></select>
|
|
144
|
+
<label for="agent-config-args" data-i18n="agentConfig.args">Prefix args (one per line)</label>
|
|
145
|
+
<textarea id="agent-config-args" rows="3"></textarea>
|
|
146
|
+
</div>
|
|
147
|
+
</details>
|
|
148
|
+
</form>
|
|
149
|
+
</div>
|
|
150
|
+
</section>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<div id="agent-activity-details-overlay" class="hidden compact-overlay" role="dialog" aria-modal="true" aria-labelledby="agent-activity-details-title">
|
|
154
|
+
<section id="agent-activity-details-dialog" class="compact-dialog">
|
|
155
|
+
<div class="library-header"><div><h2 id="agent-activity-details-title" data-i18n="activity.detailsTitle">Agent CLI details</h2><p id="agent-activity-details-meta" data-i18n="activity.detailsHelp">Inspect the exact background command progress and provider output.</p></div><button id="agent-activity-details-close" type="button" aria-label="Close">×</button></div>
|
|
156
|
+
<div class="agent-activity-details-body">
|
|
157
|
+
<pre id="agent-activity-details-log" data-i18n="activity.liveOutput">Live CLI output will appear here.</pre>
|
|
158
|
+
</div>
|
|
159
|
+
</section>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<div id="prompt-preview-overlay" class="hidden compact-overlay" role="dialog" aria-modal="true" aria-labelledby="prompt-preview-title">
|
|
163
|
+
<section class="compact-dialog prompt-dialog">
|
|
164
|
+
<div class="library-header"><div><h2 id="prompt-preview-title" data-i18n="promptPreview.title">Final Agent Prompt</h2><p id="prompt-preview-meta" data-i18n="promptPreview.empty">Not generated yet</p></div><button id="prompt-preview-close" aria-label="Close">×</button></div>
|
|
165
|
+
<h3>Actual CLI payload</h3>
|
|
166
|
+
<pre id="prompt-preview-content" data-i18n="promptPreview.bodyEmpty">Prompt not generated yet.</pre>
|
|
167
|
+
<details class="prompt-manifest-details" open>
|
|
168
|
+
<summary>Prompt Manifest · tasks, stable targets, and local resource addresses</summary>
|
|
169
|
+
<pre id="prompt-preview-manifest">Manifest not generated yet.</pre>
|
|
170
|
+
</details>
|
|
171
|
+
</section>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<div id="invoke-confirm-overlay" class="hidden compact-overlay" role="dialog" aria-modal="true" aria-labelledby="invoke-confirm-title">
|
|
175
|
+
<section class="compact-dialog confirm-dialog">
|
|
176
|
+
<div class="library-header"><div><h2 id="invoke-confirm-title" data-i18n="invoke.title">Confirm Agent Invocation</h2><p data-i18n="invoke.subtitle">The queued modification intents, temporary prompt, and managed context will be sent as one final prompt.</p></div><button id="invoke-confirm-close" aria-label="Close">×</button></div>
|
|
177
|
+
<div class="confirm-dialog-body">
|
|
178
|
+
<p id="invoke-confirm-summary" data-i18n="invoke.preparing">Preparing prompt…</p>
|
|
179
|
+
<div class="confirm-actions"><button id="invoke-cancel" type="button" data-i18n="invoke.cancel">Cancel</button><button id="invoke-confirm" class="primary" type="button" data-i18n="invoke.confirm">Confirm</button></div>
|
|
180
|
+
</div>
|
|
181
|
+
</section>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<div id="change-history-overlay" class="hidden compact-overlay" role="dialog" aria-modal="true" aria-labelledby="change-history-title">
|
|
185
|
+
<section id="change-history-dialog" class="compact-dialog">
|
|
186
|
+
<div class="library-header"><div><h2 id="change-history-title" data-i18n="history.title">Change history</h2><p data-i18n="history.subtitle">Preview and restore any of the five most recent paper versions.</p></div><div class="change-history-header-actions"><button id="change-history-refresh" type="button" data-i18n="history.refresh">Refresh</button><button id="change-history-close" type="button" aria-label="Close">×</button></div></div>
|
|
187
|
+
<div id="change-history-body">
|
|
188
|
+
<aside id="change-history-list"><div class="outline-empty" data-i18n="history.loading">Loading change history…</div></aside>
|
|
189
|
+
<main id="change-history-detail"><div class="change-history-empty"><strong data-i18n="history.select">Select a version</strong><p data-i18n="history.selectHelp">Open a version to inspect its changes without altering the paper.</p></div></main>
|
|
190
|
+
</div>
|
|
191
|
+
</section>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
<div id="focus-annotation-overlay" class="hidden" role="dialog" aria-modal="true" aria-labelledby="focus-annotation-title">
|
|
195
|
+
<section id="focus-annotation-dialog">
|
|
196
|
+
<div class="library-header">
|
|
197
|
+
<div><h2 id="focus-annotation-title">Focus Annotation</h2><p>Read one paragraph and one sentence at a time, then prepare precise prompts for later Agent revisions</p></div>
|
|
198
|
+
<div class="focus-header-status"><span id="focus-annotation-progress">No document loaded</span><button id="focus-annotation-close" aria-label="Close">×</button></div>
|
|
199
|
+
</div>
|
|
200
|
+
<div id="focus-annotation-body">
|
|
201
|
+
<aside id="focus-outline-column">
|
|
202
|
+
<div class="focus-column-heading"><span>Paper structure</span><small>Sections and paragraphs</small></div>
|
|
203
|
+
<div id="focus-section-tree"><div class="outline-empty">No structure available</div></div>
|
|
204
|
+
</aside>
|
|
205
|
+
<main id="focus-paragraph-column">
|
|
206
|
+
<div class="focus-column-heading"><span>Paragraph reading</span><small id="focus-paragraph-position">No paragraph selected</small></div>
|
|
207
|
+
<div class="focus-navigation">
|
|
208
|
+
<button id="focus-prev-paragraph" type="button">← Previous</button>
|
|
209
|
+
<button id="focus-locate-paragraph" type="button">Open in editor</button>
|
|
210
|
+
<button id="focus-next-paragraph" type="button">Next →</button>
|
|
211
|
+
</div>
|
|
212
|
+
<article id="focus-paragraph-text" class="focus-reading-text">Select a paragraph from the paper structure.</article>
|
|
213
|
+
<div class="focus-prompt-editor paragraph-prompt-editor">
|
|
214
|
+
<label for="focus-paragraph-prompt">Paragraph revision prompt</label>
|
|
215
|
+
<p>Describe the paragraph's purpose, required evidence, constraints, and intended revision.</p>
|
|
216
|
+
<textarea id="focus-paragraph-prompt" rows="8" placeholder="Example: Establish the research gap, retain the quantitative evidence, and end with the study question."></textarea>
|
|
217
|
+
<button id="focus-save-paragraph" class="primary" type="button">Save paragraph prompt</button>
|
|
218
|
+
</div>
|
|
219
|
+
</main>
|
|
220
|
+
<aside id="focus-sentence-column">
|
|
221
|
+
<div class="focus-column-heading"><span>Sentence reading</span><small id="focus-sentence-position">No sentence selected</small></div>
|
|
222
|
+
<div id="focus-sentence-list"><div class="outline-empty">Select a paragraph first</div></div>
|
|
223
|
+
<article id="focus-sentence-text" class="focus-reading-text sentence-reading-text">Select a sentence to inspect it closely.</article>
|
|
224
|
+
<div class="focus-prompt-editor sentence-prompt-editor">
|
|
225
|
+
<label for="focus-sentence-intent">Sentence intent</label>
|
|
226
|
+
<input id="focus-sentence-intent" placeholder="What rhetorical job does this sentence perform?">
|
|
227
|
+
<label for="focus-sentence-prompt">Sentence revision prompt</label>
|
|
228
|
+
<textarea id="focus-sentence-prompt" rows="5" placeholder="Example: Replace vague emphasis with a measurable claim; do not alter the reported values."></textarea>
|
|
229
|
+
<button id="focus-save-sentence" class="primary" type="button">Save sentence annotation</button>
|
|
230
|
+
</div>
|
|
231
|
+
</aside>
|
|
232
|
+
</div>
|
|
233
|
+
</section>
|
|
234
|
+
</div>
|
|
235
|
+
|
|
236
|
+
<div id="library-overlay" class="hidden" role="dialog" aria-modal="true" aria-labelledby="library-title">
|
|
237
|
+
<section id="library-drawer">
|
|
238
|
+
<div class="library-header">
|
|
239
|
+
<div><h2 id="library-title">Writing libraries</h2><p>Corpora, reusable sentence patterns, and collaboration vocabulary</p></div>
|
|
240
|
+
<button id="library-close" aria-label="Close">×</button>
|
|
241
|
+
</div>
|
|
242
|
+
<div class="library-toolbar">
|
|
243
|
+
<select id="library-kind">
|
|
244
|
+
<option value="corpora">Corpora</option>
|
|
245
|
+
<option value="sentence-patterns">Sentence patterns</option>
|
|
246
|
+
<option value="vocabulary">Vocabulary</option>
|
|
247
|
+
</select>
|
|
248
|
+
<select id="library-scope" class="hidden">
|
|
249
|
+
<option value="global">Global vocabulary</option>
|
|
250
|
+
<option value="session">This writing session</option>
|
|
251
|
+
</select>
|
|
252
|
+
<input id="library-search" type="search" placeholder="Search this library...">
|
|
253
|
+
<button id="library-extract">Extract from paper</button>
|
|
254
|
+
<button id="library-extract-pdf" type="button" data-i18n="library.extractPdf">Extract from PDF</button>
|
|
255
|
+
</div>
|
|
256
|
+
<div id="pdf-extract-row" class="hidden">
|
|
257
|
+
<select id="pdf-file-select" aria-label="PDF file"></select>
|
|
258
|
+
<button id="pdf-extract-run" class="primary" type="button" data-i18n="library.extractPdfRun">Extract patterns</button>
|
|
259
|
+
<button id="pdf-extract-cancel" type="button" data-i18n="library.cancel">Cancel</button>
|
|
260
|
+
</div>
|
|
261
|
+
<div class="library-body">
|
|
262
|
+
<form id="library-form">
|
|
263
|
+
<h3>Add resource</h3>
|
|
264
|
+
<label id="resource-name-label" for="resource-name">Name</label>
|
|
265
|
+
<input id="resource-name" required>
|
|
266
|
+
<label id="resource-content-label" for="resource-content">Content</label>
|
|
267
|
+
<textarea id="resource-content" rows="5" required></textarea>
|
|
268
|
+
<label id="resource-description-label" for="resource-description">Description</label>
|
|
269
|
+
<textarea id="resource-description" rows="2"></textarea>
|
|
270
|
+
<label for="resource-tags">Tags (comma separated)</label>
|
|
271
|
+
<input id="resource-tags">
|
|
272
|
+
<div id="resource-extra-field">
|
|
273
|
+
<label id="resource-extra-label" for="resource-extra">Applicable sections</label>
|
|
274
|
+
<input id="resource-extra">
|
|
275
|
+
</div>
|
|
276
|
+
<div id="resource-examples-field" class="hidden">
|
|
277
|
+
<label for="resource-examples">Examples (one per line)</label>
|
|
278
|
+
<textarea id="resource-examples" rows="2"></textarea>
|
|
279
|
+
</div>
|
|
280
|
+
<label for="resource-source">Source / citation</label>
|
|
281
|
+
<input id="resource-source">
|
|
282
|
+
<button type="submit" class="primary">Add to library</button>
|
|
283
|
+
</form>
|
|
284
|
+
<div class="library-results-column">
|
|
285
|
+
<div id="library-candidates" class="hidden"></div>
|
|
286
|
+
<div id="library-list"></div>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
</section>
|
|
290
|
+
</div>
|
|
291
|
+
|
|
292
|
+
<div id="review-overlay" class="hidden" role="dialog" aria-modal="true" aria-labelledby="review-title">
|
|
293
|
+
<section id="review-drawer">
|
|
294
|
+
<div class="library-header">
|
|
295
|
+
<div><h2 id="review-title">Review & Revise</h2><p>From feedback and revision plans to response letters, verification, and delivery</p></div>
|
|
296
|
+
<button id="review-close" aria-label="Close">×</button>
|
|
297
|
+
</div>
|
|
298
|
+
<nav id="review-workflow-tabs" role="tablist" aria-label="Review and revision workflow">
|
|
299
|
+
<button id="review-plan-tab" class="active" type="button" role="tab" aria-selected="true" aria-controls="review-planning-view">1. Opinions & plans</button>
|
|
300
|
+
<button id="review-delivery-tab" type="button" role="tab" aria-selected="false" aria-controls="review-delivery-view">2. Responses & delivery</button>
|
|
301
|
+
</nav>
|
|
302
|
+
<div id="review-planning-view" class="review-body" role="tabpanel" aria-labelledby="review-plan-tab">
|
|
303
|
+
<aside class="review-inputs">
|
|
304
|
+
<form id="selection-comment-form">
|
|
305
|
+
<h3>Comment on selection</h3>
|
|
306
|
+
<p class="helper">Select text in the editor, then anchor a comment to that exact range.</p>
|
|
307
|
+
<textarea id="selection-comment" rows="3" placeholder="What should change, and why?" required></textarea>
|
|
308
|
+
<input id="selection-fix" placeholder="Optional replacement text">
|
|
309
|
+
<div class="review-row">
|
|
310
|
+
<select id="selection-category"><option>content</option><option>style</option><option>grammar</option><option>structure</option><option>method</option><option>evidence</option><option>citation</option></select>
|
|
311
|
+
<select id="selection-severity"><option>info</option><option>minor</option><option>major</option><option>critical</option></select>
|
|
312
|
+
</div>
|
|
313
|
+
<button type="submit" class="primary">Add anchored comment</button>
|
|
314
|
+
</form>
|
|
315
|
+
<form id="review-import-form">
|
|
316
|
+
<h3>Import reviewer feedback</h3>
|
|
317
|
+
<input id="review-actor" placeholder="Reviewer / source">
|
|
318
|
+
<textarea id="review-import-text" rows="8" placeholder="1. Replace “old text” with “new text”. 2. Explain the evidence for..." required></textarea>
|
|
319
|
+
<button type="submit" class="primary">Extract atomic opinions</button>
|
|
320
|
+
</form>
|
|
321
|
+
</aside>
|
|
322
|
+
<main class="review-workspace">
|
|
323
|
+
<section class="review-section">
|
|
324
|
+
<div class="review-section-head">
|
|
325
|
+
<div><h3>Opinions</h3><span id="annotation-count">0 selected</span></div>
|
|
326
|
+
<div class="review-row"><input id="revision-title-input" value="Guided revision" aria-label="Revision title"><button id="plan-selected" class="primary">Plan selected</button></div>
|
|
327
|
+
</div>
|
|
328
|
+
<div id="annotation-list"><div class="outline-empty">No comments yet</div></div>
|
|
329
|
+
</section>
|
|
330
|
+
<section class="review-section revision-section">
|
|
331
|
+
<div class="review-section-head"><div><h3>Revision plans</h3><span>Every write is previewed and user-approved</span></div></div>
|
|
332
|
+
<div id="revision-list"><div class="outline-empty">No revision plans yet</div></div>
|
|
333
|
+
</section>
|
|
334
|
+
</main>
|
|
335
|
+
</div>
|
|
336
|
+
<div id="review-delivery-view" class="self-revise-body hidden" role="tabpanel" aria-labelledby="review-delivery-tab">
|
|
337
|
+
<aside class="self-revise-actions">
|
|
338
|
+
<section>
|
|
339
|
+
<h3>Additional review</h3>
|
|
340
|
+
<p>Run an independent specialist panel, then send its prioritized concerns back into the opinions and plans stage.</p>
|
|
341
|
+
<button id="self-open-panel" type="button">Run peer review panel</button>
|
|
342
|
+
</section>
|
|
343
|
+
<section>
|
|
344
|
+
<h3>Generate a full-paper draft</h3>
|
|
345
|
+
<p>Uses project/document prompts, outline prompts, paragraph goals, and selected writing-library resources.</p>
|
|
346
|
+
<textarea id="paper-generation-instruction" rows="5" placeholder="Describe the intended paper, contribution, evidence, and constraints..."></textarea>
|
|
347
|
+
<div id="generation-resource-status">Writing resources: automatic</div>
|
|
348
|
+
<button id="generate-paper" class="primary" type="button">Generate reviewable draft</button>
|
|
349
|
+
<div id="paper-generation-preview" class="hidden"></div>
|
|
350
|
+
</section>
|
|
351
|
+
<section>
|
|
352
|
+
<h3>Portable export</h3>
|
|
353
|
+
<p>Download source, annotations, reviews, revisions, response letters, change lists, run history, and recovery metadata.</p>
|
|
354
|
+
<button id="download-workflow-export" type="button">Download JSON bundle</button>
|
|
355
|
+
</section>
|
|
356
|
+
</aside>
|
|
357
|
+
<main class="self-revise-workspace">
|
|
358
|
+
<div class="review-section-head"><div><h3>Responses & verification</h3><span id="self-revise-summary">Loading...</span></div><button id="refresh-self-revise">Refresh</button></div>
|
|
359
|
+
<div id="self-revision-list"><div class="outline-empty">No revision plans yet</div></div>
|
|
360
|
+
<div class="review-section-head history-heading"><div><h3>Workflow history</h3><span>Agent runs, reviews, and revisions</span></div></div>
|
|
361
|
+
<div id="workflow-history"><div class="outline-empty">No history yet</div></div>
|
|
362
|
+
</main>
|
|
363
|
+
</div>
|
|
364
|
+
</section>
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
<div id="peer-review-overlay" class="hidden" role="dialog" aria-modal="true" aria-labelledby="peer-review-title">
|
|
368
|
+
<section id="peer-review-drawer">
|
|
369
|
+
<div class="library-header">
|
|
370
|
+
<div><h2 id="peer-review-title">Peer review panel</h2><p>Independent specialist reviews, followed by explicit consensus and conflict synthesis</p></div>
|
|
371
|
+
<button id="peer-review-close" aria-label="Close">×</button>
|
|
372
|
+
</div>
|
|
373
|
+
<div class="peer-review-body">
|
|
374
|
+
<aside class="panel-builder">
|
|
375
|
+
<h3>Configure a review round</h3>
|
|
376
|
+
<label for="panel-name">Round name</label>
|
|
377
|
+
<input id="panel-name" value="Independent peer review">
|
|
378
|
+
<label for="panel-provider">Agent provider</label>
|
|
379
|
+
<select id="panel-provider"><option value="mock">Mock</option><option value="codex">Codex</option><option value="claude-code">Claude Code</option><option value="opencode">OpenCode</option><option value="pi">Pi Agent</option></select>
|
|
380
|
+
<div class="builder-heading"><h3>Reviewers</h3><span>Select 1–8</span></div>
|
|
381
|
+
<div id="reviewer-builder"><div class="outline-empty">Loading profiles...</div></div>
|
|
382
|
+
<details class="custom-builder"><summary>Add custom reviewer</summary>
|
|
383
|
+
<input id="custom-reviewer-name" placeholder="Reviewer name">
|
|
384
|
+
<select id="custom-reviewer-role"><option value="methodology">Methodology</option><option value="statistics">Statistics</option><option value="writing">Writing</option><option value="domain">Domain</option><option value="reproducibility">Reproducibility</option></select>
|
|
385
|
+
<textarea id="custom-reviewer-focus" rows="2" placeholder="Independent review focus"></textarea>
|
|
386
|
+
<textarea id="custom-reviewer-prompt" rows="2" placeholder="Additional instruction"></textarea>
|
|
387
|
+
<button id="add-custom-reviewer" type="button">Add reviewer</button>
|
|
388
|
+
</details>
|
|
389
|
+
<div class="builder-heading"><h3>Rubric</h3><button id="add-rubric" type="button">+ criterion</button></div>
|
|
390
|
+
<div id="rubric-builder"></div>
|
|
391
|
+
<button id="create-panel" class="primary" type="button">Create review round</button>
|
|
392
|
+
</aside>
|
|
393
|
+
<main class="panel-results">
|
|
394
|
+
<div class="review-section-head"><div><h3>Review rounds</h3><span id="peer-review-count">0 rounds</span></div><button id="refresh-peer-reviews">Refresh</button></div>
|
|
395
|
+
<div id="peer-review-list"><div class="outline-empty">No review rounds yet</div></div>
|
|
396
|
+
</main>
|
|
397
|
+
</div>
|
|
398
|
+
</section>
|
|
399
|
+
</div>
|
|
400
|
+
|
|
401
|
+
<div id="orchestration-overlay" class="hidden" role="dialog" aria-modal="true" aria-labelledby="orchestration-title">
|
|
402
|
+
<section id="orchestration-dialog">
|
|
403
|
+
<div class="library-header">
|
|
404
|
+
<div><h2 id="orchestration-title" data-i18n="orch.title">Agent orchestration</h2><p data-i18n="orch.subtitle">Connect configured local Agents into reviewable multi-step workflows with approval gates. Every node output and edge summary is audited.</p></div>
|
|
405
|
+
<div class="orch-header-actions">
|
|
406
|
+
<select id="orchestration-select" aria-label="Orchestration"></select>
|
|
407
|
+
<button id="orchestration-new" type="button" data-i18n="orch.new">New</button>
|
|
408
|
+
<button id="orchestration-delete" type="button" data-i18n="orch.delete">Delete</button>
|
|
409
|
+
<button id="orchestration-close" type="button" aria-label="Close">×</button>
|
|
410
|
+
</div>
|
|
411
|
+
</div>
|
|
412
|
+
<div id="orchestration-body">
|
|
413
|
+
<aside id="orchestration-palette">
|
|
414
|
+
<h3 data-i18n="orch.palette">Palette</h3>
|
|
415
|
+
<button id="orch-add-agent" type="button" data-i18n="orch.addAgent">+ Agent node</button>
|
|
416
|
+
<button id="orch-add-gate" type="button" data-i18n="orch.addGate">+ Approval gate</button>
|
|
417
|
+
<hr>
|
|
418
|
+
<button id="orch-connect-toggle" type="button" data-i18n="orch.connect">Connect nodes</button>
|
|
419
|
+
<button id="orch-delete-selected" type="button" data-i18n="orch.deleteSelected">Delete selected</button>
|
|
420
|
+
<button id="orch-clear" type="button" data-i18n="orch.clear">Clear results</button>
|
|
421
|
+
<p class="orch-hint" data-i18n="orch.hint">Drag nodes to arrange them. Click Connect, then two nodes in order to link them.</p>
|
|
422
|
+
</aside>
|
|
423
|
+
<main id="orchestration-canvas-wrap">
|
|
424
|
+
<div id="orchestration-canvas">
|
|
425
|
+
<svg id="orchestration-edges" aria-hidden="true"></svg>
|
|
426
|
+
<div id="orchestration-nodes"></div>
|
|
427
|
+
</div>
|
|
428
|
+
<div id="orchestration-statusbar">
|
|
429
|
+
<span id="orchestration-status" class="orch-status" data-i18n="orch.draft">Draft</span>
|
|
430
|
+
<span id="orchestration-status-detail"></span>
|
|
431
|
+
<span class="orch-status-actions"><button id="orchestration-reset" type="button" data-i18n="orch.reset">Reset</button><button id="orchestration-cancel" class="hidden" type="button" data-i18n="orch.cancelRun">Cancel run</button><button id="orchestration-run" class="primary" type="button" data-i18n="orch.run">Run</button></span>
|
|
432
|
+
</div>
|
|
433
|
+
</main>
|
|
434
|
+
<aside id="orchestration-inspector">
|
|
435
|
+
<div class="orch-inspector-head"><h3 data-i18n="orch.inspector">Inspector</h3><span id="orch-inspector-hint">Select a node or edge</span></div>
|
|
436
|
+
<div id="orchestration-inspector-body"></div>
|
|
437
|
+
</aside>
|
|
438
|
+
</div>
|
|
439
|
+
<div id="orchestration-note" role="status" aria-live="polite"></div>
|
|
440
|
+
</section>
|
|
441
|
+
</div>
|
|
442
|
+
|
|
443
|
+
<div id="analysis-overlay" class="hidden compact-overlay" role="dialog" aria-modal="true" aria-labelledby="analysis-title">
|
|
444
|
+
<section id="analysis-dialog" class="compact-dialog analysis-dialog">
|
|
445
|
+
<div class="library-header">
|
|
446
|
+
<div><h2 id="analysis-title" data-i18n="analysis.title">Paragraph analysis</h2><p id="analysis-target-name" data-i18n="analysis.loading">Analyzing…</p></div>
|
|
447
|
+
<button id="analysis-close" type="button" aria-label="Close">×</button>
|
|
448
|
+
</div>
|
|
449
|
+
<div id="analysis-body">
|
|
450
|
+
<aside id="analysis-sidebar">
|
|
451
|
+
<h3 data-i18n="analysis.units">Units</h3>
|
|
452
|
+
<div id="analysis-target-list"><div class="outline-empty" data-i18n="analysis.loading">Loading…</div></div>
|
|
453
|
+
</aside>
|
|
454
|
+
<main id="analysis-main">
|
|
455
|
+
<div id="analysis-verdict" class="hidden"></div>
|
|
456
|
+
<section class="analysis-section">
|
|
457
|
+
<div class="analysis-section-head"><h3 data-i18n="analysis.sentenceChart">Sentence lengths</h3><span id="analysis-chart-caption"></span></div>
|
|
458
|
+
<div id="analysis-chart" aria-label="Sentence length bar chart"></div>
|
|
459
|
+
</section>
|
|
460
|
+
<section class="analysis-section">
|
|
461
|
+
<div class="analysis-section-head"><h3 data-i18n="analysis.stats">Statistics</h3></div>
|
|
462
|
+
<div id="analysis-stats"></div>
|
|
463
|
+
</section>
|
|
464
|
+
<section class="analysis-section">
|
|
465
|
+
<details class="analysis-formulas">
|
|
466
|
+
<summary data-i18n="analysis.formulas">Formulas used</summary>
|
|
467
|
+
<div id="analysis-formula-list"></div>
|
|
468
|
+
</details>
|
|
469
|
+
</section>
|
|
470
|
+
<div id="analysis-note" role="status" aria-live="polite"></div>
|
|
471
|
+
</main>
|
|
472
|
+
</div>
|
|
473
|
+
</section>
|
|
474
|
+
</div>
|
|
475
|
+
|
|
476
|
+
<script src="/vendor/codemirror/lib/codemirror.js"></script>
|
|
477
|
+
<script src="/vendor/codemirror/mode/stex/stex.js"></script>
|
|
478
|
+
<script type="module" src="/react/app.js"></script>
|
|
479
|
+
</body>
|
|
480
|
+
</html>
|