proseview 0.4.0__tar.gz → 0.4.2__tar.gz
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.
- {proseview-0.4.0 → proseview-0.4.2}/PKG-INFO +62 -35
- {proseview-0.4.0 → proseview-0.4.2}/README.md +61 -34
- {proseview-0.4.0 → proseview-0.4.2}/proseview/__init__.py +1 -1
- {proseview-0.4.0 → proseview-0.4.2}/proseview/claude_agent_client.py +94 -45
- {proseview-0.4.0 → proseview-0.4.2}/proseview/config.py +3 -1
- {proseview-0.4.0 → proseview-0.4.2}/proseview/discuss.py +200 -20
- {proseview-0.4.0 → proseview-0.4.2}/proseview/epub.py +2 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/export.py +4 -1
- {proseview-0.4.0 → proseview-0.4.2}/proseview/generator.py +40 -8
- {proseview-0.4.0 → proseview-0.4.2}/proseview/history.py +42 -12
- proseview-0.4.2/proseview/obsidian.py +106 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/repo.py +203 -82
- {proseview-0.4.0 → proseview-0.4.2}/proseview/scenes.py +60 -21
- {proseview-0.4.0 → proseview-0.4.2}/proseview/server.py +49 -13
- {proseview-0.4.0 → proseview-0.4.2}/proseview/snapshot.py +2 -1
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/app.css +1059 -53
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/00-state.js +21 -0
- proseview-0.4.2/proseview/templates/assets/js/12-lossless-markdown.js +182 -0
- proseview-0.4.2/proseview/templates/assets/js/13-frontmatter.js +158 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/20-theme-font-charts.js +9 -4
- proseview-0.4.2/proseview/templates/assets/js/21-appearance-picker.js +141 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/30-router-modal.js +39 -8
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/40-prose-editor.js +189 -26
- proseview-0.4.2/proseview/templates/assets/js/45-book.js +418 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/60-selection.js +75 -14
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/65-ai-proposals.js +1 -1
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/68-discuss.js +677 -171
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/69-file-edit.js +133 -11
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/70-dashboard.js +40 -5
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/75-file-management.js +34 -2
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/76-export.js +5 -1
- proseview-0.4.2/proseview/templates/assets/js/77-manuscript-setup.js +51 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/80-sidebar-init.js +19 -3
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/index.html.j2 +96 -40
- {proseview-0.4.0 → proseview-0.4.2}/proseview/typst_render.py +2 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview.egg-info/PKG-INFO +62 -35
- {proseview-0.4.0 → proseview-0.4.2}/proseview.egg-info/SOURCES.txt +7 -1
- {proseview-0.4.0 → proseview-0.4.2}/pyproject.toml +1 -1
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_bundling.py +5 -2
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_claude_agent_client.py +95 -49
- proseview-0.4.2/tests/test_claude_permissions.py +179 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_discuss.py +23 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_discuss_manager.py +149 -3
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_discuss_transport_conformance.py +6 -3
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_export.py +4 -9
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_history.py +58 -8
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_layouts.py +21 -15
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_lossless_markdown.py +46 -5
- proseview-0.4.2/tests/test_obsidian.py +34 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_repo.py +135 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_server.py +58 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_snapshot.py +5 -8
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_watch.py +4 -2
- proseview-0.4.0/proseview/templates/assets/js/12-lossless-markdown.js +0 -95
- proseview-0.4.0/tests/test_claude_read_only.py +0 -165
- {proseview-0.4.0 → proseview-0.4.2}/LICENSE +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/__main__.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/__init__.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/classic/epub.css +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/classic/pdf.typ +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/classic/style.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/fonts/GreatVibes-Regular.ttf +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/fonts/LiberationSerif-Bold.ttf +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/fonts/LiberationSerif-BoldItalic.ttf +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/fonts/LiberationSerif-Italic.ttf +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/fonts/LiberationSerif-Regular.ttf +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/fonts/NotoSans-Bold.ttf +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/fonts/NotoSans-Regular.ttf +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/fonts/OFL.txt +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/fonts/README.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/manuscript/pdf.typ +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/manuscript/style.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/modern/epub.css +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/modern/style.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/romance/epub.css +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/book_styles/romance/style.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/cli.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/codex_app_server.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/editor.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/epub_check.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/export_dashboard.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/export_demo.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/goals.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/highlights.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/hunks.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/lexical.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/patches.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/pdf.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/pdf_check.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/raw_html.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/related.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/roster.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/canon_refactor/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/canon_refactor/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/clarify/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/clarify/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/clarity_flow/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/clarity_flow/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/continuity/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/continuity/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/custom_rewrite/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/custom_rewrite/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/pacing_tension/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/pacing_tension/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/quick_critique/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/quick_critique/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/rephrase/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/rephrase/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/scene_continuity/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/scene_continuity/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/sensory_detail/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/sensory_detail/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/show_moment/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/show_moment/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/style_consistency/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/style_consistency/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/tighten/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/tighten/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/verify_refactor/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/verify_refactor/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/voice_character/SKILL.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/skills/voice_character/agents/openai.yaml +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/story.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/01-static-snapshot.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/10-prose-indicators.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/15-overview.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/15-search.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/18-timeline.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/19-analysis.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/50-discard-confirm.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/66-history.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/js/80-settings.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/assets/themes/graphite.css +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/README.md +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/chart.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/chartjs-plugin-annotation.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/marked.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/entities-4.5.0-es2022-entities.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/entities-4.5.0-es2022-lib-decode.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/entities-4.5.0-es2022-lib-escape.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/entities-4.5.0.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/linkify-it-5.0.2-es2022-linkify-it.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/linkify-it-5.0.2.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/markdown-it-14.0.0.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/markdown-it-14.3.0-es2022-markdown-it.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/mdurl-2.0.0.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/mdurl-2.1.0-es2022-mdurl.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/orderedmap-2.0.0.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/orderedmap-2.1.1-es2022-orderedmap.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-commands-1.7.1-X-ZHByb3NlbWlycm9yLW1vZGVsQDEuMjUuNCxwcm9zZW1pcnJvci1zdGF0ZUAxLjQuNCxwcm9zZW1pcnJvci10cmFuc2Zvcm1AMS4xMC40-es2022-prosemirror-commands.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-commands.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-history-1.5.0-X-ZHByb3NlbWlycm9yLW1vZGVsQDEuMjUuNCxwcm9zZW1pcnJvci1zdGF0ZUAxLjQuNCxwcm9zZW1pcnJvci10cmFuc2Zvcm1AMS4xMC40-es2022-prosemirror-history.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-history.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-inputrules-1.4.0-X-ZHByb3NlbWlycm9yLW1vZGVsQDEuMjUuNCxwcm9zZW1pcnJvci1zdGF0ZUAxLjQuNCxwcm9zZW1pcnJvci10cmFuc2Zvcm1AMS4xMC40-es2022-prosemirror-inputrules.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-inputrules.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-keymap-1.2.3-X-ZHByb3NlbWlycm9yLW1vZGVsQDEuMjUuNCxwcm9zZW1pcnJvci1zdGF0ZUAxLjQuNCxwcm9zZW1pcnJvci10cmFuc2Zvcm1AMS4xMC40-es2022-prosemirror-keymap.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-keymap.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-markdown-1.13.4-X-ZHByb3NlbWlycm9yLW1vZGVsQDEuMjUuNA-es2022-prosemirror-markdown.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-markdown.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-model-1.25.4-es2022-prosemirror-model.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-model.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-schema-list-1.5.0-X-ZHByb3NlbWlycm9yLW1vZGVsQDEuMjUuNCxwcm9zZW1pcnJvci1zdGF0ZUAxLjQuNCxwcm9zZW1pcnJvci10cmFuc2Zvcm1AMS4xMC40-es2022-prosemirror-schema-list.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-schema-list.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-state-1.4.4-X-ZHByb3NlbWlycm9yLW1vZGVsQDEuMjUuNCxwcm9zZW1pcnJvci10cmFuc2Zvcm1AMS4xMC40-es2022-prosemirror-state.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-state.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-transform-1.10.4-X-ZHByb3NlbWlycm9yLW1vZGVsQDEuMjUuNA-es2022-prosemirror-transform.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-view-1.41.8-X-ZHByb3NlbWlycm9yLW1vZGVsQDEuMjUuNCxwcm9zZW1pcnJvci1zdGF0ZUAxLjQuNCxwcm9zZW1pcnJvci10cmFuc2Zvcm1AMS4xMC40-es2022-prosemirror-view.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/prosemirror-view.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/punycode.js-2.3.1-es2022-punycode.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/punycode.js-2.3.1.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/rope-sequence-1.3.0.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/rope-sequence-1.3.4-es2022-rope-sequence.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/uc.micro-2.0.0.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/uc.micro-2.1.0-es2022-uc.micro.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/uc.micro-2.1.0.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/w3c-keyname-2.2.0.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/templates/vendor/pm/w3c-keyname-2.2.8-es2022-w3c-keyname.js +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview/watch.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview.egg-info/dependency_links.txt +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview.egg-info/entry_points.txt +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview.egg-info/requires.txt +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/proseview.egg-info/top_level.txt +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/setup.cfg +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_annotations.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_app_refresh.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_app_selection.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_backups.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_book.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_cli.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_codex_app_server.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_config.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_discuss_agent_selection.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_editor.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_epub.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_export_dashboard.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_frontmatter_scaffold.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_generator.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_genre_bands.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_goals.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_highlights.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_hunks.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_images.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_manuscript_edge_cases.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_matter.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_note_edit.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_patches.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_pdf.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_platform.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_raw_html.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_related.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_release.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_roster.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_scale.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_scene_prose.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_story.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_styles.py +0 -0
- {proseview-0.4.0 → proseview-0.4.2}/tests/test_themes.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: proseview
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: A writing studio for novels in plain Markdown.
|
|
5
5
|
Author: Ari Saif
|
|
6
6
|
License: MIT
|
|
@@ -51,19 +51,21 @@ analysis, edit a scene, and export the book as an EPUB or a PDF. Nothing to
|
|
|
51
51
|
install, and your edits never leave the tab.
|
|
52
52
|
|
|
53
53
|
Proseview turns a folder of Markdown scenes into a place to write the book:
|
|
54
|
-
read and edit scenes and
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
read and edit scenes and the rest of your Markdown files on a typeset page,
|
|
55
|
+
read the whole book from start to finish, check pacing, prose and character
|
|
56
|
+
presence, ask Codex or Claude about the manuscript, and export it as an
|
|
57
|
+
e-book or a print-ready PDF. Your files stay plain Markdown, and a save
|
|
58
|
+
changes only what you edited.
|
|
58
59
|
|
|
59
60
|
Core analysis stays on your machine: no account, subscription, database, or
|
|
60
61
|
telemetry. AI features are opt-in and run through agent CLIs you installed and
|
|
61
|
-
logged into yourself — Codex or Claude in the side dock. When you
|
|
62
|
-
Proseview sends
|
|
63
|
-
|
|
62
|
+
logged into yourself — Codex or Claude in the side dock. When you ask one,
|
|
63
|
+
Proseview sends your question, which file is open, and any selection or
|
|
64
|
+
`@`mentioned paths to that agent, which reads what it needs from your project
|
|
65
|
+
under its own login and data handling.
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
Your files stay where they are, as plain `.md`, so Proseview sits alongside
|
|
68
|
+
Obsidian, Vim, or any other Markdown editor.
|
|
67
69
|
|
|
68
70
|
```bash
|
|
69
71
|
pipx install "proseview[claude]"
|
|
@@ -78,19 +80,23 @@ Leave off `[claude]` if you will not use the Claude tab. [Quick start →](#-qui
|
|
|
78
80
|

|
|
79
81
|

|
|
80
82
|
|
|
81
|
-

|
|
83
|
+

|
|
82
84
|
|
|
83
85
|
## ✨ What it does
|
|
84
86
|
|
|
85
87
|
### ✍️ Write
|
|
86
88
|
|
|
87
89
|
- 📖 **Reading view and WYSIWYG editor.** The same typographic page, with
|
|
88
|
-
`Edit` toggled on. `Mod-S` saves; a conflict guard checks the file mtime
|
|
90
|
+
`Edit` toggled on. `Mod-S` saves and returns to reading; a conflict guard checks the file mtime
|
|
89
91
|
so a change made in your own editor is never silently overwritten. A save
|
|
90
92
|
rewrites only the paragraphs you changed.
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
- 📚 **Read the book.** The whole manuscript as one continuous text, the way
|
|
94
|
+
an e-reader shows it, with a progress bar, chapter list, scene and chapter
|
|
95
|
+
skips, and `Edit` beside each scene. It reopens where you stopped.
|
|
96
|
+
- 📝 **Every Markdown file editable.** Story bible, plans, and any other
|
|
97
|
+
Markdown file in the book get the same `Edit` and `Save`, with backups and
|
|
98
|
+
the same conflict guard. Files with HTML inside their lines are edited as
|
|
99
|
+
plain Markdown.
|
|
94
100
|
- 📁 **File browser.** Create empty Markdown files and folders, rename them
|
|
95
101
|
inline, or move them to Proseview Trash from the row menu or right-click.
|
|
96
102
|
- 🔎 **Repository search.** `Mod-K` from anywhere — paths, metadata, TODOs,
|
|
@@ -137,13 +143,17 @@ your machine, under your login: Codex and Claude, one tab each in the side
|
|
|
137
143
|
dock, each with its own project conversation. Both run at once; switching tabs
|
|
138
144
|
or opening another file never interrupts either one.
|
|
139
145
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
146
|
+
They work as they do in the VS Code extensions. Each question says which file
|
|
147
|
+
is open, plus your selection and any files you `@`mention, and the agent reads
|
|
148
|
+
the rest of the project itself. Claude loads your own Claude settings
|
|
149
|
+
(permission rules, `CLAUDE.md`, skills, MCP servers) and asks in the panel
|
|
150
|
+
wherever the Claude Code extension would ask; Codex asks before a command that
|
|
151
|
+
would change something. Raw model reasoning is never forwarded to the browser.
|
|
144
152
|
|
|
145
|
-
|
|
146
|
-
|
|
153
|
+
An edit the agent makes is saved, and a small card after the turn shows the
|
|
154
|
+
file and how many changes it made, with Expand view to see the diff, Undo all,
|
|
155
|
+
and Looks good. Reading passes such as Quick critique make no edits, and
|
|
156
|
+
continuity and canon questions come back with citations.
|
|
147
157
|
|
|
148
158
|
Everything else works without an agent installed. For the Claude tab, install
|
|
149
159
|
Proseview with its `claude` extra (`pipx install "proseview[claude]"`, or
|
|
@@ -163,22 +173,38 @@ filter verbs, sensory language, passive voice.
|
|
|
163
173
|
### Editing
|
|
164
174
|
|
|
165
175
|
`Edit` turns the page you were reading into the page you type into — same
|
|
166
|
-
typography, same highlights. `Mod-S` saves to the file, and the stats update.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
176
|
+
typography, same highlights. `Mod-S` saves to the file and returns to reading, and the stats update; `E` picks up where you left off.
|
|
177
|
+
A scene's frontmatter sits above its prose as the YAML it is, and in edit mode
|
|
178
|
+
it is a box you can change too; a typo that is not YAML is pointed out, not
|
|
179
|
+
saved.
|
|
180
|
+
|
|
181
|
+
Story-bible pages, plans, and other Markdown files open in the file view with
|
|
182
|
+
their own `Edit` button (or press `E`). Frontmatter is kept as it is. Tables
|
|
183
|
+
show as tables and are saved as written; a file with HTML inside its lines
|
|
184
|
+
opens as plain Markdown, so it is saved exactly as typed. Like
|
|
171
185
|
scenes, each save keeps a backup and won't overwrite a change made elsewhere.
|
|
172
186
|
A save rewrites only the paragraphs you changed, so Obsidian `[[wikilinks]]`,
|
|
173
187
|
callouts and embeds elsewhere in the file stay exactly as written.
|
|
174
188
|
|
|
175
189
|

|
|
176
190
|
|
|
191
|
+
### Read the book
|
|
192
|
+
|
|
193
|
+
**Read the book** on the dashboard shows the whole manuscript as one
|
|
194
|
+
continuous text, every scene in order under its chapter's heading. A quiet bar
|
|
195
|
+
at the bottom shows how far through you are, skips by scene or chapter (the
|
|
196
|
+
arrow keys do too) and opens a chapter list; `Aa` sets the text size, line
|
|
197
|
+
width, font and theme. `Edit` beside a scene (or `E`) opens it in the editor,
|
|
198
|
+
and leaving brings you back to the same place in the book.
|
|
199
|
+
|
|
200
|
+

|
|
201
|
+
|
|
177
202
|
### Agent tabs
|
|
178
203
|
|
|
179
204
|
Codex and Claude each get a tab and a separate project conversation. Opening
|
|
180
|
-
another file does not replace either conversation
|
|
181
|
-
|
|
205
|
+
another file does not replace either conversation; the next question simply
|
|
206
|
+
tells the agent which file you are in now, and the agent reads it from the
|
|
207
|
+
project. Type `@` to point at other files.
|
|
182
208
|
|
|
183
209
|

|
|
184
210
|
|
|
@@ -232,9 +258,11 @@ proseview --root /path/to/your/novel
|
|
|
232
258
|
`[claude]` adds the SDK the Claude tab needs; plain `pipx install proseview`
|
|
233
259
|
is everything else. A browser tab opens at `http://localhost:7842`. Press Ctrl-C to stop.
|
|
234
260
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
261
|
+
Proseview's book features read a `manuscript/` folder: one folder per
|
|
262
|
+
chapter, one Markdown file per scene. Point it at a folder without one, such as
|
|
263
|
+
an Obsidian vault, and it opens as plain Markdown you can read, edit and
|
|
264
|
+
search; **Choose manuscript folder…** on the dashboard tells it where the book
|
|
265
|
+
is (or that the whole folder is), and the rest switches on.
|
|
238
266
|
|
|
239
267
|
```text
|
|
240
268
|
my-novel/
|
|
@@ -292,10 +320,9 @@ discuss:
|
|
|
292
320
|
|
|
293
321
|
Proseview is alpha. Everything described above works today. Still unfinished:
|
|
294
322
|
|
|
295
|
-
- 🚧
|
|
296
|
-
|
|
297
|
-
- 🚧
|
|
298
|
-
so you don't need to drop into your text editor for routine fields.
|
|
323
|
+
- 🚧 The `$` skill picker on the Claude tab. Claude uses your Claude skills
|
|
324
|
+
on its own, but the picker lists only Codex's today.
|
|
325
|
+
- 🚧 Read the book does not yet update live when a scene changes on disk.
|
|
299
326
|
|
|
300
327
|
See [plans/roadmap.md](plans/roadmap.md) for the full punch list.
|
|
301
328
|
|
|
@@ -8,19 +8,21 @@ analysis, edit a scene, and export the book as an EPUB or a PDF. Nothing to
|
|
|
8
8
|
install, and your edits never leave the tab.
|
|
9
9
|
|
|
10
10
|
Proseview turns a folder of Markdown scenes into a place to write the book:
|
|
11
|
-
read and edit scenes and
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
read and edit scenes and the rest of your Markdown files on a typeset page,
|
|
12
|
+
read the whole book from start to finish, check pacing, prose and character
|
|
13
|
+
presence, ask Codex or Claude about the manuscript, and export it as an
|
|
14
|
+
e-book or a print-ready PDF. Your files stay plain Markdown, and a save
|
|
15
|
+
changes only what you edited.
|
|
15
16
|
|
|
16
17
|
Core analysis stays on your machine: no account, subscription, database, or
|
|
17
18
|
telemetry. AI features are opt-in and run through agent CLIs you installed and
|
|
18
|
-
logged into yourself — Codex or Claude in the side dock. When you
|
|
19
|
-
Proseview sends
|
|
20
|
-
|
|
19
|
+
logged into yourself — Codex or Claude in the side dock. When you ask one,
|
|
20
|
+
Proseview sends your question, which file is open, and any selection or
|
|
21
|
+
`@`mentioned paths to that agent, which reads what it needs from your project
|
|
22
|
+
under its own login and data handling.
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
Your files stay where they are, as plain `.md`, so Proseview sits alongside
|
|
25
|
+
Obsidian, Vim, or any other Markdown editor.
|
|
24
26
|
|
|
25
27
|
```bash
|
|
26
28
|
pipx install "proseview[claude]"
|
|
@@ -35,19 +37,23 @@ Leave off `[claude]` if you will not use the Claude tab. [Quick start →](#-qui
|
|
|
35
37
|

|
|
36
38
|

|
|
37
39
|
|
|
38
|
-

|
|
40
|
+

|
|
39
41
|
|
|
40
42
|
## ✨ What it does
|
|
41
43
|
|
|
42
44
|
### ✍️ Write
|
|
43
45
|
|
|
44
46
|
- 📖 **Reading view and WYSIWYG editor.** The same typographic page, with
|
|
45
|
-
`Edit` toggled on. `Mod-S` saves; a conflict guard checks the file mtime
|
|
47
|
+
`Edit` toggled on. `Mod-S` saves and returns to reading; a conflict guard checks the file mtime
|
|
46
48
|
so a change made in your own editor is never silently overwritten. A save
|
|
47
49
|
rewrites only the paragraphs you changed.
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
- 📚 **Read the book.** The whole manuscript as one continuous text, the way
|
|
51
|
+
an e-reader shows it, with a progress bar, chapter list, scene and chapter
|
|
52
|
+
skips, and `Edit` beside each scene. It reopens where you stopped.
|
|
53
|
+
- 📝 **Every Markdown file editable.** Story bible, plans, and any other
|
|
54
|
+
Markdown file in the book get the same `Edit` and `Save`, with backups and
|
|
55
|
+
the same conflict guard. Files with HTML inside their lines are edited as
|
|
56
|
+
plain Markdown.
|
|
51
57
|
- 📁 **File browser.** Create empty Markdown files and folders, rename them
|
|
52
58
|
inline, or move them to Proseview Trash from the row menu or right-click.
|
|
53
59
|
- 🔎 **Repository search.** `Mod-K` from anywhere — paths, metadata, TODOs,
|
|
@@ -94,13 +100,17 @@ your machine, under your login: Codex and Claude, one tab each in the side
|
|
|
94
100
|
dock, each with its own project conversation. Both run at once; switching tabs
|
|
95
101
|
or opening another file never interrupts either one.
|
|
96
102
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
They work as they do in the VS Code extensions. Each question says which file
|
|
104
|
+
is open, plus your selection and any files you `@`mention, and the agent reads
|
|
105
|
+
the rest of the project itself. Claude loads your own Claude settings
|
|
106
|
+
(permission rules, `CLAUDE.md`, skills, MCP servers) and asks in the panel
|
|
107
|
+
wherever the Claude Code extension would ask; Codex asks before a command that
|
|
108
|
+
would change something. Raw model reasoning is never forwarded to the browser.
|
|
101
109
|
|
|
102
|
-
|
|
103
|
-
|
|
110
|
+
An edit the agent makes is saved, and a small card after the turn shows the
|
|
111
|
+
file and how many changes it made, with Expand view to see the diff, Undo all,
|
|
112
|
+
and Looks good. Reading passes such as Quick critique make no edits, and
|
|
113
|
+
continuity and canon questions come back with citations.
|
|
104
114
|
|
|
105
115
|
Everything else works without an agent installed. For the Claude tab, install
|
|
106
116
|
Proseview with its `claude` extra (`pipx install "proseview[claude]"`, or
|
|
@@ -120,22 +130,38 @@ filter verbs, sensory language, passive voice.
|
|
|
120
130
|
### Editing
|
|
121
131
|
|
|
122
132
|
`Edit` turns the page you were reading into the page you type into — same
|
|
123
|
-
typography, same highlights. `Mod-S` saves to the file, and the stats update.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
133
|
+
typography, same highlights. `Mod-S` saves to the file and returns to reading, and the stats update; `E` picks up where you left off.
|
|
134
|
+
A scene's frontmatter sits above its prose as the YAML it is, and in edit mode
|
|
135
|
+
it is a box you can change too; a typo that is not YAML is pointed out, not
|
|
136
|
+
saved.
|
|
137
|
+
|
|
138
|
+
Story-bible pages, plans, and other Markdown files open in the file view with
|
|
139
|
+
their own `Edit` button (or press `E`). Frontmatter is kept as it is. Tables
|
|
140
|
+
show as tables and are saved as written; a file with HTML inside its lines
|
|
141
|
+
opens as plain Markdown, so it is saved exactly as typed. Like
|
|
128
142
|
scenes, each save keeps a backup and won't overwrite a change made elsewhere.
|
|
129
143
|
A save rewrites only the paragraphs you changed, so Obsidian `[[wikilinks]]`,
|
|
130
144
|
callouts and embeds elsewhere in the file stay exactly as written.
|
|
131
145
|
|
|
132
146
|

|
|
133
147
|
|
|
148
|
+
### Read the book
|
|
149
|
+
|
|
150
|
+
**Read the book** on the dashboard shows the whole manuscript as one
|
|
151
|
+
continuous text, every scene in order under its chapter's heading. A quiet bar
|
|
152
|
+
at the bottom shows how far through you are, skips by scene or chapter (the
|
|
153
|
+
arrow keys do too) and opens a chapter list; `Aa` sets the text size, line
|
|
154
|
+
width, font and theme. `Edit` beside a scene (or `E`) opens it in the editor,
|
|
155
|
+
and leaving brings you back to the same place in the book.
|
|
156
|
+
|
|
157
|
+

|
|
158
|
+
|
|
134
159
|
### Agent tabs
|
|
135
160
|
|
|
136
161
|
Codex and Claude each get a tab and a separate project conversation. Opening
|
|
137
|
-
another file does not replace either conversation
|
|
138
|
-
|
|
162
|
+
another file does not replace either conversation; the next question simply
|
|
163
|
+
tells the agent which file you are in now, and the agent reads it from the
|
|
164
|
+
project. Type `@` to point at other files.
|
|
139
165
|
|
|
140
166
|

|
|
141
167
|
|
|
@@ -189,9 +215,11 @@ proseview --root /path/to/your/novel
|
|
|
189
215
|
`[claude]` adds the SDK the Claude tab needs; plain `pipx install proseview`
|
|
190
216
|
is everything else. A browser tab opens at `http://localhost:7842`. Press Ctrl-C to stop.
|
|
191
217
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
218
|
+
Proseview's book features read a `manuscript/` folder: one folder per
|
|
219
|
+
chapter, one Markdown file per scene. Point it at a folder without one, such as
|
|
220
|
+
an Obsidian vault, and it opens as plain Markdown you can read, edit and
|
|
221
|
+
search; **Choose manuscript folder…** on the dashboard tells it where the book
|
|
222
|
+
is (or that the whole folder is), and the rest switches on.
|
|
195
223
|
|
|
196
224
|
```text
|
|
197
225
|
my-novel/
|
|
@@ -249,10 +277,9 @@ discuss:
|
|
|
249
277
|
|
|
250
278
|
Proseview is alpha. Everything described above works today. Still unfinished:
|
|
251
279
|
|
|
252
|
-
- 🚧
|
|
253
|
-
|
|
254
|
-
- 🚧
|
|
255
|
-
so you don't need to drop into your text editor for routine fields.
|
|
280
|
+
- 🚧 The `$` skill picker on the Claude tab. Claude uses your Claude skills
|
|
281
|
+
on its own, but the picker lists only Codex's today.
|
|
282
|
+
- 🚧 Read the book does not yet update live when a scene changes on disk.
|
|
256
283
|
|
|
257
284
|
See [plans/roadmap.md](plans/roadmap.md) for the full punch list.
|
|
258
285
|
|
|
@@ -18,12 +18,12 @@ reason for a piece of machinery below:
|
|
|
18
18
|
is threads and queues. One event loop runs on a private thread and every
|
|
19
19
|
public method bridges to it, while inbound notifications are handed to a
|
|
20
20
|
dispatcher thread so manager callbacks can safely re-enter this class.
|
|
21
|
-
* **
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
* **Claude's own permissions, plus two rules.** Claude loads the writer's
|
|
22
|
+
settings as the Claude Code extension does and asks, through
|
|
23
|
+
``can_use_tool``, exactly where the extension would. A ``PreToolUse`` hook,
|
|
24
|
+
which runs before those permissions, adds Prosview's two rules: an edit goes
|
|
25
|
+
through Prosview so it can be reviewed after the turn, and a reading pass
|
|
26
|
+
makes no edit at all.
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
29
|
from __future__ import annotations
|
|
@@ -48,12 +48,9 @@ APPROVAL_METHODS = {
|
|
|
48
48
|
}
|
|
49
49
|
APPROVAL_DECISIONS = ["accept", "acceptForSession", "decline", "cancel"]
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
#: Tools that change the manuscript. They are offered only on a turn the writer
|
|
55
|
-
#: asked to change something, and every one of them still stops at the
|
|
56
|
-
#: PreToolUse gate below, so Claude asks before it writes.
|
|
51
|
+
#: Tools that change the manuscript. A writing turn routes every one of them
|
|
52
|
+
#: through Prosview (which keeps the text for the review); a reading pass
|
|
53
|
+
#: refuses them.
|
|
57
54
|
WRITE_TOOLS = ["Write", "Edit", "NotebookEdit"]
|
|
58
55
|
|
|
59
56
|
#: SDK-internal plumbing, not writer-facing actions. ``StructuredOutput`` is how
|
|
@@ -210,7 +207,12 @@ def sanitize_claude_message(message: dict[str, Any]) -> list[dict[str, Any]]:
|
|
|
210
207
|
elif activity["kind"] == "webSearch":
|
|
211
208
|
activity["query"] = _bounded(params.get("query"), 4000)
|
|
212
209
|
else:
|
|
213
|
-
activity.update(
|
|
210
|
+
activity.update(
|
|
211
|
+
tool=_bounded(tool, 1000),
|
|
212
|
+
server=_bounded(params.get("server"), 1000),
|
|
213
|
+
path=_bounded(params.get("path"), 2000),
|
|
214
|
+
pattern=_bounded(params.get("pattern"), 1000),
|
|
215
|
+
)
|
|
214
216
|
return [{"type": "activity.updated", **common, "activity": activity}]
|
|
215
217
|
if method == "warning":
|
|
216
218
|
return [{"type": "warning", **common, "message": _bounded(params.get("message"))}]
|
|
@@ -245,6 +247,10 @@ class _Session:
|
|
|
245
247
|
# Captured at thread/start; the developer instructions live here rather
|
|
246
248
|
# than on each turn, matching where the manager sends them.
|
|
247
249
|
self.thread_params: dict[str, Any] = {}
|
|
250
|
+
#: Whether this turn may change files. Per turn, not per session: the
|
|
251
|
+
#: session's tool list is fixed when it connects, so a session whose
|
|
252
|
+
#: first turn was a reading pass would otherwise never edit again.
|
|
253
|
+
self.may_write = False
|
|
248
254
|
#: True once a turn has run, so later turns resume the session rather
|
|
249
255
|
#: than trying to name one that already exists.
|
|
250
256
|
self.started = False
|
|
@@ -563,13 +569,10 @@ class ClaudeAgentClient:
|
|
|
563
569
|
return {"data": rows, "default": defaults}
|
|
564
570
|
|
|
565
571
|
def user_model_defaults(self) -> dict[str, str]:
|
|
566
|
-
"""Read the writer's configured model and effort
|
|
572
|
+
"""Read the writer's configured model and effort.
|
|
567
573
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
allow-rules that would shadow the approval gate. Two scalar keys carry
|
|
571
|
-
none of that, and ignoring them would mean a writer who configured Opus
|
|
572
|
-
silently gets whatever the SDK defaults to instead.
|
|
574
|
+
The session loads this file itself; Prosview reads these two keys so
|
|
575
|
+
the model picker can say what "Default" means and pass it on.
|
|
573
576
|
"""
|
|
574
577
|
path = Path(
|
|
575
578
|
os.environ.get("CLAUDE_CONFIG_DIR") or (Path.home() / ".claude")
|
|
@@ -653,19 +656,21 @@ class ClaudeAgentClient:
|
|
|
653
656
|
async def pre_tool_use(input_data: dict[str, Any], tool_use_id: Any, context: Any):
|
|
654
657
|
return await self._gate_tool(session, input_data)
|
|
655
658
|
|
|
659
|
+
async def can_use_tool(tool: str, tool_input: dict[str, Any], context: Any):
|
|
660
|
+
return await self._permission_prompt(session, tool, tool_input)
|
|
661
|
+
|
|
656
662
|
options: dict[str, Any] = {
|
|
657
663
|
"cwd": self.cwd,
|
|
658
|
-
#
|
|
659
|
-
# settings
|
|
660
|
-
#
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
"
|
|
666
|
-
list(WRITE_TOOLS) if params.get("mayWrite") else []
|
|
667
|
-
),
|
|
664
|
+
# Claude here is Claude as the Claude Code extension runs it: the
|
|
665
|
+
# writer's settings (user, project, local) with their permission
|
|
666
|
+
# rules, CLAUDE.md, skills and MCP servers, all its own tools, and
|
|
667
|
+
# its own system prompt. Where it would ask, it asks in the panel
|
|
668
|
+
# (can_use_tool below). Prosview adds two things only, at the
|
|
669
|
+
# PreToolUse gate: edits go to the review, and a reading pass makes
|
|
670
|
+
# none.
|
|
671
|
+
"setting_sources": ["user", "project", "local"],
|
|
668
672
|
"include_partial_messages": True,
|
|
673
|
+
"can_use_tool": can_use_tool,
|
|
669
674
|
}
|
|
670
675
|
selection = self.turn_model(params)
|
|
671
676
|
if selection["model"]:
|
|
@@ -675,8 +680,10 @@ class ClaudeAgentClient:
|
|
|
675
680
|
instructions = params.get("developerInstructions") or session.thread_params.get(
|
|
676
681
|
"developerInstructions"
|
|
677
682
|
)
|
|
683
|
+
system_prompt: dict[str, Any] = {"type": "preset", "preset": "claude_code"}
|
|
678
684
|
if instructions:
|
|
679
|
-
|
|
685
|
+
system_prompt["append"] = str(instructions)
|
|
686
|
+
options["system_prompt"] = system_prompt
|
|
680
687
|
schema = params.get("outputSchema")
|
|
681
688
|
if schema:
|
|
682
689
|
options["output_format"] = {"type": "json_schema", "schema": schema}
|
|
@@ -687,7 +694,15 @@ class ClaudeAgentClient:
|
|
|
687
694
|
if self._options_factory is not None:
|
|
688
695
|
return self._options_factory(hooks={"PreToolUse": [pre_tool_use]}, **options)
|
|
689
696
|
|
|
690
|
-
from claude_agent_sdk import ClaudeAgentOptions, HookMatcher
|
|
697
|
+
from claude_agent_sdk import ClaudeAgentOptions, HookMatcher, PermissionResultAllow, PermissionResultDeny
|
|
698
|
+
|
|
699
|
+
async def can_use_tool_sdk(tool: str, tool_input: dict[str, Any], context: Any):
|
|
700
|
+
verdict = await can_use_tool(tool, tool_input, context)
|
|
701
|
+
if verdict.get("behavior") == "allow":
|
|
702
|
+
return PermissionResultAllow()
|
|
703
|
+
return PermissionResultDeny(message=verdict.get("message") or "The writer declined this action.")
|
|
704
|
+
|
|
705
|
+
options["can_use_tool"] = can_use_tool_sdk
|
|
691
706
|
|
|
692
707
|
options["hooks"] = {"PreToolUse": [HookMatcher(matcher=None, hooks=[pre_tool_use])]}
|
|
693
708
|
return ClaudeAgentOptions(**options)
|
|
@@ -746,6 +761,7 @@ class ClaudeAgentClient:
|
|
|
746
761
|
await self._apply_model_change(session, params)
|
|
747
762
|
client = await self._ensure_session_client(session, params)
|
|
748
763
|
session.turn_id = turn_id
|
|
764
|
+
session.may_write = bool(params.get("mayWrite"))
|
|
749
765
|
session.expects_structured = bool(params.get("outputSchema"))
|
|
750
766
|
session.internal_tool_ids = set()
|
|
751
767
|
session.started = True
|
|
@@ -877,7 +893,12 @@ class ClaudeAgentClient:
|
|
|
877
893
|
"tool": tool,
|
|
878
894
|
"command": tool_input.get("command"),
|
|
879
895
|
"cwd": tool_input.get("cwd") or self.cwd,
|
|
880
|
-
"query": tool_input.get("query"),
|
|
896
|
+
"query": tool_input.get("query") or tool_input.get("url"),
|
|
897
|
+
# What a Read, Grep or Glob looked at, so the step
|
|
898
|
+
# can name it as Codex's do.
|
|
899
|
+
"path": tool_input.get("file_path") or tool_input.get("notebook_path")
|
|
900
|
+
or tool_input.get("path"),
|
|
901
|
+
"pattern": tool_input.get("pattern"),
|
|
881
902
|
"changes": [{"path": tool_input.get("file_path"), "kind": "modify"}]
|
|
882
903
|
if tool_input.get("file_path")
|
|
883
904
|
else [],
|
|
@@ -979,34 +1000,62 @@ class ClaudeAgentClient:
|
|
|
979
1000
|
# --- approvals ---------------------------------------------------------
|
|
980
1001
|
|
|
981
1002
|
async def _gate_tool(self, session: _Session, input_data: dict[str, Any]) -> dict[str, Any]:
|
|
982
|
-
"""
|
|
1003
|
+
"""Prosview's two rules, before Claude's own permissions are consulted.
|
|
1004
|
+
|
|
1005
|
+
An edit goes through Prosview, which keeps the file's text for the
|
|
1006
|
+
review after the turn (and a reading pass makes no edit at all).
|
|
1007
|
+
Everything else gets no decision here: Claude's permission rules
|
|
1008
|
+
decide, and ask through ``can_use_tool`` when they would ask.
|
|
1009
|
+
"""
|
|
983
1010
|
tool = str(input_data.get("tool_name") or "")
|
|
984
1011
|
tool_input = input_data.get("tool_input") or {}
|
|
985
|
-
if tool in
|
|
986
|
-
|
|
1012
|
+
if tool in WRITE_TOOLS:
|
|
1013
|
+
if not session.may_write:
|
|
1014
|
+
return self._hook_decision("deny", "This is a reading pass; it does not change files.")
|
|
1015
|
+
verdict = await self._ask_writer(session, tool, tool_input, input_data.get("tool_use_id"), input_data.get("cwd"))
|
|
1016
|
+
return self._hook_decision(verdict["behavior"], verdict.get("message", ""))
|
|
1017
|
+
return {}
|
|
1018
|
+
|
|
1019
|
+
async def _permission_prompt(self, session: _Session, tool: str, tool_input: dict[str, Any]) -> dict[str, Any]:
|
|
1020
|
+
"""Claude would ask here; the writer answers in the panel."""
|
|
1021
|
+
if tool in INTERNAL_TOOLS:
|
|
1022
|
+
return {"behavior": "allow"}
|
|
1023
|
+
return await self._ask_writer(session, tool, tool_input, None, None)
|
|
987
1024
|
|
|
1025
|
+
async def _ask_writer(
|
|
1026
|
+
self, session: _Session, tool: str, tool_input: dict[str, Any], tool_use_id: Any, cwd: Any
|
|
1027
|
+
) -> dict[str, Any]:
|
|
988
1028
|
granted = self._session_grants.get(session.thread_id) or set()
|
|
989
1029
|
if tool in granted:
|
|
990
|
-
return
|
|
1030
|
+
return {"behavior": "allow"}
|
|
991
1031
|
|
|
992
1032
|
kind = "fileChange" if _activity_kind(tool) == "fileChange" else "command"
|
|
993
1033
|
request_id = uuid.uuid4().hex
|
|
994
1034
|
loop = self._loop
|
|
995
1035
|
if loop is None:
|
|
996
|
-
return
|
|
1036
|
+
return {"behavior": "deny", "message": "Prosview is not connected."}
|
|
997
1037
|
future: asyncio.Future[dict[str, Any]] = loop.create_future()
|
|
998
1038
|
self._approvals[request_id] = future
|
|
999
1039
|
|
|
1000
1040
|
params: dict[str, Any] = {
|
|
1001
1041
|
"threadId": session.thread_id,
|
|
1002
1042
|
"turnId": session.turn_id,
|
|
1003
|
-
"itemId":
|
|
1004
|
-
"reason": f"Claude wants to use {tool}
|
|
1005
|
-
"
|
|
1043
|
+
"itemId": tool_use_id,
|
|
1044
|
+
"reason": f"Claude wants to use {tool}.",
|
|
1045
|
+
"tool": tool,
|
|
1046
|
+
"cwd": str(cwd or self.cwd),
|
|
1006
1047
|
"availableDecisions": list(APPROVAL_DECISIONS),
|
|
1007
1048
|
}
|
|
1008
1049
|
if kind == "command":
|
|
1009
|
-
|
|
1050
|
+
# Say what the tool would do, not just its name.
|
|
1051
|
+
detail = (
|
|
1052
|
+
tool_input.get("command")
|
|
1053
|
+
or (f"Search the web for “{tool_input.get('query')}”" if tool == "WebSearch" and tool_input.get("query") else "")
|
|
1054
|
+
or (f"Open {tool_input.get('url')}" if tool == "WebFetch" and tool_input.get("url") else "")
|
|
1055
|
+
or (f"Start a helper agent: {tool_input.get('description')}" if tool in {"Task", "Agent"} and tool_input.get("description") else "")
|
|
1056
|
+
or tool
|
|
1057
|
+
)
|
|
1058
|
+
params["command"] = _bounded(detail, 4000)
|
|
1010
1059
|
else:
|
|
1011
1060
|
params["changes"] = [{"path": tool_input.get("file_path"), "kind": "modify"}]
|
|
1012
1061
|
params["command"] = _bounded(f"{tool} {tool_input.get('file_path') or ''}".strip(), 4000)
|
|
@@ -1015,17 +1064,17 @@ class ClaudeAgentClient:
|
|
|
1015
1064
|
try:
|
|
1016
1065
|
result = await asyncio.wait_for(future, timeout=APPROVAL_TIMEOUT)
|
|
1017
1066
|
except (TimeoutError, asyncio.CancelledError):
|
|
1018
|
-
return
|
|
1067
|
+
return {"behavior": "deny", "message": "Prosview did not receive an approval in time."}
|
|
1019
1068
|
finally:
|
|
1020
1069
|
self._approvals.pop(request_id, None)
|
|
1021
1070
|
|
|
1022
1071
|
decision = str(result.get("decision") or "decline")
|
|
1023
1072
|
if decision == "acceptForSession":
|
|
1024
1073
|
self._session_grants.setdefault(session.thread_id, set()).add(tool)
|
|
1025
|
-
return
|
|
1074
|
+
return {"behavior": "allow"}
|
|
1026
1075
|
if decision == "accept":
|
|
1027
|
-
return
|
|
1028
|
-
return
|
|
1076
|
+
return {"behavior": "allow"}
|
|
1077
|
+
return {"behavior": "deny", "message": "The writer declined this action."}
|
|
1029
1078
|
|
|
1030
1079
|
@staticmethod
|
|
1031
1080
|
def _hook_decision(decision: str, reason: str = "") -> dict[str, Any]:
|
|
@@ -322,7 +322,9 @@ class Config:
|
|
|
322
322
|
data = {}
|
|
323
323
|
|
|
324
324
|
defaults = Config()
|
|
325
|
-
|
|
325
|
+
|
|
326
|
+
if self.manuscript_path != defaults.manuscript_path or "manuscript_path" in data:
|
|
327
|
+
data["manuscript_path"] = self.manuscript_path
|
|
326
328
|
if self.target_words != defaults.target_words or "target_words" in data:
|
|
327
329
|
data["target_words"] = self.target_words
|
|
328
330
|
if self.daily_target != defaults.daily_target or "daily_target" in data:
|