supernote 0.27.0__tar.gz → 0.28.0__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.
- supernote-0.28.0/PKG-INFO +193 -0
- supernote-0.28.0/README.md +139 -0
- {supernote-0.27.0 → supernote-0.28.0}/pyproject.toml +1 -1
- supernote-0.28.0/supernote/alembic/versions/d8e9f0a1b2c3_add_wiki_tables.py +212 -0
- supernote-0.28.0/supernote/alembic/versions/e9f0a1b2c3d4_add_user_id_to_system_task.py +70 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/cli/__init__.py +1 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/cli/admin.py +22 -10
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/__init__.py +4 -2
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/admin.py +9 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/client.py +5 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/events.py +2 -2
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/exceptions.py +5 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/summary.py +16 -1
- supernote-0.28.0/supernote/client/wiki.py +204 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/__init__.py +1 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/events.py +14 -11
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/extended.py +63 -2
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/file_device.py +4 -2
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/summary.py +11 -7
- supernote-0.28.0/supernote/models/wiki.py +235 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/ai/eval.py +175 -2
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/ai/models/__init__.py +1 -0
- supernote-0.28.0/supernote/server/ai/models/text.py +154 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/ai/prompts.py +15 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/app.py +16 -81
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/__init__.py +51 -3
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/ai/__init__.py +53 -9
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/ai/http.py +4 -3
- supernote-0.28.0/supernote/server/components/config/__init__.py +70 -0
- supernote-0.28.0/supernote/server/components/config/http.py +84 -0
- supernote-0.28.0/supernote/server/components/config/models.py +133 -0
- supernote-0.28.0/supernote/server/components/config/service.py +496 -0
- supernote-0.28.0/supernote/server/components/conversion/__init__.py +54 -0
- supernote-0.28.0/supernote/server/components/conversion/http.py +269 -0
- supernote-0.27.0/supernote/server/services/conversion.py → supernote-0.28.0/supernote/server/components/conversion/service.py +128 -9
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/events/http.py +9 -24
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/events/mcp.py +2 -14
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/events/service.py +5 -3
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/fake_ai/__init__.py +2 -2
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/fake_ai/embedding.py +4 -6
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/fake_ai/ocr.py +2 -2
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/fake_ai/summary.py +2 -2
- supernote-0.28.0/supernote/server/components/fake_ai/text.py +82 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/gemini/__init__.py +1 -1
- supernote-0.28.0/supernote/server/components/gemini/text.py +75 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/http/__init__.py +27 -3
- supernote-0.28.0/supernote/server/components/integrity/__init__.py +51 -0
- supernote-0.28.0/supernote/server/components/integrity/http.py +91 -0
- supernote-0.27.0/supernote/server/services/integrity.py → supernote-0.28.0/supernote/server/components/integrity/service.py +37 -5
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/mcp/__init__.py +22 -9
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/metrics/http.py +2 -3
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/oauth/__init__.py +9 -5
- supernote-0.28.0/supernote/server/components/oauth/client_metadata.py +347 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/oauth/http.py +162 -55
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/oauth/models.py +19 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/oauth/provider.py +110 -24
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/openai/__init__.py +1 -1
- supernote-0.28.0/supernote/server/components/openai/text.py +76 -0
- supernote-0.28.0/supernote/server/components/processor/__init__.py +129 -0
- supernote-0.28.0/supernote/server/components/processor/base.py +456 -0
- supernote-0.28.0/supernote/server/components/processor/http.py +312 -0
- supernote-0.28.0/supernote/server/components/processor/mcp.py +101 -0
- {supernote-0.27.0/supernote/server/services/processor_modules → supernote-0.28.0/supernote/server/components/processor}/page_hashing.py +60 -3
- {supernote-0.27.0/supernote/server/services/processor_modules → supernote-0.28.0/supernote/server/components/processor}/png_conversion.py +48 -8
- supernote-0.28.0/supernote/server/components/processor/processor.py +26 -0
- supernote-0.28.0/supernote/server/components/processor/service.py +1626 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/schedule/http.py +19 -27
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/schedule/mcp.py +1 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/search/__init__.py +9 -8
- supernote-0.28.0/supernote/server/components/search/chunk_search.py +588 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/search/http.py +11 -24
- supernote-0.28.0/supernote/server/components/search/lexical_scoring.py +371 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/search/mcp.py +8 -8
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/search/models.py +4 -4
- supernote-0.27.0/supernote/server/services/processor_modules/embedding.py → supernote-0.28.0/supernote/server/components/search/processor.py +31 -2
- supernote-0.28.0/supernote/server/components/search/service.py +178 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/socketio/http.py +1 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/socketio/manager.py +14 -11
- supernote-0.28.0/supernote/server/components/summary/__init__.py +98 -0
- supernote-0.27.0/supernote/server/routes/summary.py → supernote-0.28.0/supernote/server/components/summary/http.py +231 -27
- supernote-0.27.0/supernote/server/services/processor_modules/summary.py → supernote-0.28.0/supernote/server/components/summary/processor.py +52 -4
- supernote-0.27.0/supernote/server/services/summary.py → supernote-0.28.0/supernote/server/components/summary/service.py +72 -12
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/transcript/__init__.py +2 -2
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/transcript/http.py +7 -20
- supernote-0.27.0/supernote/server/services/processor_modules/ocr.py → supernote-0.28.0/supernote/server/components/transcript/processor.py +44 -6
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/web_ui/http.py +2 -2
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/webhooks/__init__.py +1 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/webhooks/config.py +5 -2
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/webhooks/service.py +30 -54
- supernote-0.28.0/supernote/server/components/wiki/__init__.py +131 -0
- supernote-0.28.0/supernote/server/components/wiki/compiler.py +640 -0
- supernote-0.28.0/supernote/server/components/wiki/config.py +47 -0
- supernote-0.28.0/supernote/server/components/wiki/export.py +82 -0
- supernote-0.28.0/supernote/server/components/wiki/http.py +404 -0
- supernote-0.28.0/supernote/server/components/wiki/mcp.py +316 -0
- supernote-0.28.0/supernote/server/components/wiki/models.py +125 -0
- supernote-0.28.0/supernote/server/components/wiki/prompts.py +477 -0
- supernote-0.28.0/supernote/server/components/wiki/service.py +992 -0
- supernote-0.28.0/supernote/server/components/wiki/source_service.py +211 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/config.py +176 -16
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/core.py +89 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/__init__.py +4 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/event_log.py +2 -2
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/note_processing.py +6 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/oauth_grant.py +1 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/summary.py +1 -1
- supernote-0.28.0/supernote/server/db/models/wiki.py +389 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/events.py +49 -16
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/keys.py +6 -21
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/metrics.py +3 -0
- supernote-0.28.0/supernote/server/resources/prompts/image/default/prompt.md +8 -0
- supernote-0.28.0/supernote/server/resources/prompts/ocr/default/system.md +13 -0
- supernote-0.28.0/supernote/server/resources/prompts/wiki_compile/default/instructions.md +29 -0
- supernote-0.28.0/supernote/server/resources/prompts/wiki_conflict/default/instructions.md +20 -0
- supernote-0.28.0/supernote/server/resources/prompts/wiki_lint/default/instructions.md +16 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/routes/__init__.py +2 -6
- supernote-0.28.0/supernote/server/routes/admin.py +109 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/routes/auth.py +140 -46
- supernote-0.28.0/supernote/server/routes/decorators.py +62 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/routes/file_device.py +29 -111
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/routes/file_web.py +17 -17
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/routes/oss.py +7 -135
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/services/__init__.py +4 -10
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/services/blob.py +1 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/services/file.py +64 -34
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/index.html +44 -21
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/api/client.js +111 -8
- supernote-0.28.0/supernote/server/static/js/api/digests.js +336 -0
- supernote-0.28.0/supernote/server/static/js/api/wiki.js +256 -0
- supernote-0.28.0/supernote/server/static/js/components/DigestPanel.js +537 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/FileViewer.js +24 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/OAuthConsentCard.js +38 -7
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/SearchModal.js +6 -6
- supernote-0.28.0/supernote/server/static/js/components/SettingsPanel.js +324 -0
- supernote-0.28.0/supernote/server/static/js/components/SystemPanel.js +833 -0
- supernote-0.28.0/supernote/server/static/js/components/WikiPanel.js +629 -0
- supernote-0.28.0/supernote/server/static/js/components/digests/DigestCard.js +142 -0
- supernote-0.28.0/supernote/server/static/js/components/digests/DigestEditorModal.js +165 -0
- supernote-0.28.0/supernote/server/static/js/components/digests/DigestSidebar.js +143 -0
- supernote-0.28.0/supernote/server/static/js/components/viewer/MermaidBlock.js +82 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/viewer/ViewerSidePanel.js +84 -5
- supernote-0.28.0/supernote/server/static/js/composables/useDigests.js +294 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/composables/useRouter.js +100 -14
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/main.js +107 -9
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/types.d.ts +110 -0
- supernote-0.28.0/supernote/server/static/js/utils/markdown.js +144 -0
- supernote-0.28.0/supernote/server/static/js/utils/mermaid.js +130 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/utils/oauth.js +26 -5
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/style.css +7 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/utils/hashing.py +1 -1
- supernote-0.28.0/supernote/server/utils/image.py +164 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/utils/note_content.py +1 -1
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/utils/paths.py +23 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/utils/prompt_loader.py +8 -0
- supernote-0.28.0/supernote/server/utils/request.py +118 -0
- supernote-0.28.0/supernote/server/utils/stopwords.py +28 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/utils/tasks.py +9 -5
- {supernote-0.27.0 → supernote-0.28.0}/supernote/testing/server_runner.py +132 -73
- supernote-0.28.0/supernote.egg-info/PKG-INFO +193 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote.egg-info/SOURCES.txt +63 -13
- supernote-0.27.0/PKG-INFO +0 -414
- supernote-0.27.0/README.md +0 -360
- supernote-0.27.0/supernote/models/webhook.py +0 -66
- supernote-0.27.0/supernote/server/components/search/service.py +0 -223
- supernote-0.27.0/supernote/server/resources/prompts/ocr/default/system.md +0 -4
- supernote-0.27.0/supernote/server/routes/admin.py +0 -360
- supernote-0.27.0/supernote/server/routes/decorators.py +0 -27
- supernote-0.27.0/supernote/server/routes/extended.py +0 -352
- supernote-0.27.0/supernote/server/services/processor.py +0 -962
- supernote-0.27.0/supernote/server/services/processor_modules/__init__.py +0 -208
- supernote-0.27.0/supernote/server/static/js/components/SettingsPanel.js +0 -241
- supernote-0.27.0/supernote/server/static/js/components/SystemPanel.js +0 -308
- supernote-0.27.0/supernote/server/static/js/utils/markdown.js +0 -61
- supernote-0.27.0/supernote.egg-info/PKG-INFO +0 -414
- {supernote-0.27.0 → supernote-0.28.0}/LICENSE +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/NOTICE +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/setup.cfg +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/env.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/script.py.mako +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/0543a383957b_initial_schema.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/68964804740d_prevent_user_id_reuse.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/7a8291f043bc_add_links_and_sort_fields_to_schedule_task.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/a2b3c4d5e6f7_scope_summary_unique_identifier_by_user.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/a4b5c6d7e8f9_reparent_uncategorized_ai_summaries.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/b5c6d7e8f9a0_add_previous_text_to_note_page_content.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/b7397248a96b_merge_mixed_case_system_roots.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/b8e9c0d1e2f3_backfill_summary_md5_and_timestamps.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/c1d2e3f4a5b6_add_embedding_model_to_note_page_content.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/c3d4e5f6a7b8_seed_sync_initialized_for_existing_users.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/c7d8e9f0a1b2_add_oauth_grants_table.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/d1e2f3a4b5c6_add_client_task_ids.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/d4e5f6a7b8c9_unify_schedule_ids_as_string.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/d5e6f7a8b9c0_reset_legacy_default_user_quota.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/e6f7a8b9c0d1_add_note_and_page_metadata_tables.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/e7f8a9b0c1d2_add_update_time_to_schedule_task_group.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/e8f9a0b1c2d3_add_api_keys_table.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/f1a2b3c4d5e6_make_schedule_task_list_id_nullable.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/f2a3b4c5d6e7_add_user_event_log_table.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic/versions/f3b4c5d6e7f8_migrate_generated_summaries_to_ai_category.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/alembic.ini +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/cli/client.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/cli/main.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/cli/notebook.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/cli/server.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/api.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/auth.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/device.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/extended.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/hashing.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/login_client.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/schedule.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/socket.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/client/web.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/auth.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/base.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/equipment.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/file_common.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/file_web.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/schedule.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/socket.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/system.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/models/user.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/author.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/color.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/converter.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/decoder.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/encoder.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/exceptions.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/fileformat.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/manipulator.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/parser.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/renderer.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/ArchitectsDaughter-Regular.ttf +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/Caveat-Variable.ttf +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/InstrumentSerif-Italic.ttf +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/InstrumentSerif-Regular.ttf +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/Karla-Variable.ttf +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/OFL-ArchitectsDaughter.txt +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/OFL-Caveat.txt +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/OFL-InstrumentSerif.txt +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/OFL-Karla.txt +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/OFL-SpaceMono.txt +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/SpaceMono-Bold.ttf +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/SpaceMono-Regular.ttf +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/resources/fonts/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/schema.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/notebook/utils.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/py.typed +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/ai/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/ai/base.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/ai/models/embedding.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/ai/models/ocr.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/ai/models/summary.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/apple/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/apple/backend.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/apple/ocr.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/events/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/events/models.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/gemini/backend.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/gemini/embedding.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/gemini/ocr.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/gemini/summary.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/mcp/metrics.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/mcp/server.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/metrics/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/metrics/storage.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/openai/backend.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/openai/embedding.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/openai/ocr.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/openai/summary.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/schedule/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/schedule/ical_export.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/schedule/service.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/socketio/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/transcript/mcp.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/transcript/models.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/transcript/service.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/components/web_ui/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/constants.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/base.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/migrations.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/api_key.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/device.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/file.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/kv.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/login_record.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/schedule.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/models/user.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/db/session.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/exceptions.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/prompts/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/prompts/ocr/common/context.md +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/prompts/ocr/common/legend.md +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/prompts/ocr/daily/prompt.md +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/prompts/ocr/monthly/prompt.md +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/prompts/ocr/weekly/prompt.md +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/prompts/summary/common/instruction.md +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/prompts/summary/daily/prompt.md +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/prompts/summary/default/prompt.md +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/prompts/summary/monthly/prompt.md +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/resources/prompts/summary/weekly/prompt.md +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/routes/system.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/services/coordination.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/services/user.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/services/vfs.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/socket_auth.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/favicon.ico +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/api/http.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/api/schedule.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/FileBrowserPanel.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/FileCard.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/LoginCard.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/MoveModal.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/RecycleBinPanel.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/RenameModal.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/TaskPanel.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/tasks/TaskEditorModal.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/tasks/TaskIcsModal.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/tasks/TaskRow.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/tasks/TaskSidebar.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/viewer/ViewerMediaPreview.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/viewer/ViewerToolbar.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/components/viewer/noteMeta.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/composables/useCanvasScrollSync.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/composables/useFileSystem.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/composables/useModalEscape.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/composables/useProcessingStatus.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/composables/useRecycleBin.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/composables/useSchedule.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/composables/useToast.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/utils/clipboard.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/static/js/utils/format.js +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/trace.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/utils/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/utils/auth_utils.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/utils/rapid_log.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/utils/rate_limit.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/utils/unique_id.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/server/utils/url_signer.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/testing/__init__.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote/testing/notebook_fixtures.py +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote.egg-info/dependency_links.txt +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote.egg-info/entry_points.txt +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote.egg-info/requires.txt +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/supernote.egg-info/top_level.txt +0 -0
- {supernote-0.27.0 → supernote-0.28.0}/tests/test_init.py +0 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: supernote
|
|
3
|
+
Version: 0.28.0
|
|
4
|
+
Summary: Unofficial Python toolkit for Ratta Supernote: parse and author .note files, self-host a lightweight SQLite private cloud, and run optional AI synthesis
|
|
5
|
+
Author-email: Allen Porter <allen.porter@gmail.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Source, https://github.com/allenporter/supernote
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Intended Audience :: System Administrators
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Topic :: Office/Business
|
|
14
|
+
Classifier: Topic :: System :: Archiving :: Mirroring
|
|
15
|
+
Requires-Python: >=3.13
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
License-File: NOTICE
|
|
19
|
+
Requires-Dist: colour>=0.1.5
|
|
20
|
+
Requires-Dist: numpy>=1.19.0
|
|
21
|
+
Requires-Dist: Pillow>=7.2.0
|
|
22
|
+
Requires-Dist: potracer>=0.0.1
|
|
23
|
+
Requires-Dist: reportlab>=3.6.1
|
|
24
|
+
Requires-Dist: svgwrite>=1.4
|
|
25
|
+
Provides-Extra: client
|
|
26
|
+
Requires-Dist: aiohttp; extra == "client"
|
|
27
|
+
Requires-Dist: mashumaro>=3.17; extra == "client"
|
|
28
|
+
Requires-Dist: python-socketio>=5.11.0; extra == "client"
|
|
29
|
+
Requires-Dist: requests; extra == "client"
|
|
30
|
+
Requires-Dist: tqdm; extra == "client"
|
|
31
|
+
Provides-Extra: server
|
|
32
|
+
Requires-Dist: aiohttp>=3.14.0; extra == "server"
|
|
33
|
+
Requires-Dist: mashumaro>=3.17; extra == "server"
|
|
34
|
+
Requires-Dist: pyyaml>=6.0; extra == "server"
|
|
35
|
+
Requires-Dist: PyJWT>=2.10.1; extra == "server"
|
|
36
|
+
Requires-Dist: SQLAlchemy[asyncio]>=2.0.0; extra == "server"
|
|
37
|
+
Requires-Dist: alembic>=1.13.0; extra == "server"
|
|
38
|
+
Requires-Dist: aiosqlite>=0.19.0; extra == "server"
|
|
39
|
+
Requires-Dist: aiofiles>=25.1.0; extra == "server"
|
|
40
|
+
Requires-Dist: aiohttp-remotes>=1.3.0; extra == "server"
|
|
41
|
+
Requires-Dist: google-genai>=1.57.0; extra == "server"
|
|
42
|
+
Requires-Dist: httpx2>=2.0.0; extra == "server"
|
|
43
|
+
Requires-Dist: mcp>=2.2.0; extra == "server"
|
|
44
|
+
Requires-Dist: aiohttp-asgi>=0.6.1; extra == "server"
|
|
45
|
+
Requires-Dist: starlette>=0.35.0; extra == "server"
|
|
46
|
+
Requires-Dist: prometheus-client>=0.20.0; extra == "server"
|
|
47
|
+
Requires-Dist: python-socketio>=5.11.0; extra == "server"
|
|
48
|
+
Requires-Dist: ical>=8.0.0; extra == "server"
|
|
49
|
+
Provides-Extra: apple
|
|
50
|
+
Requires-Dist: pyobjc-framework-Vision>=10.0; sys_platform == "darwin" and extra == "apple"
|
|
51
|
+
Provides-Extra: all
|
|
52
|
+
Requires-Dist: supernote[client,server]; extra == "all"
|
|
53
|
+
Dynamic: license-file
|
|
54
|
+
|
|
55
|
+
# Open Private Cloud for Supernote
|
|
56
|
+
|
|
57
|
+
A lightweight, self-hosted Python private cloud server, offline `.note` toolkit, and optional AI knowledge hub for your Ratta Supernote (Nomad, A5 X2 Manta, A5 X, A6 X).
|
|
58
|
+
|
|
59
|
+
<p align="center">
|
|
60
|
+
<img src="docs/static-assets/web-files-explorer.png" alt="Open Private Cloud for Supernote Web UI showing synced folders and handwritten .note thumbnails" width="840">
|
|
61
|
+
</p>
|
|
62
|
+
|
|
63
|
+
[](https://github.com/allenporter/supernote)
|
|
64
|
+
[](https://allenporter.github.io/supernote/)
|
|
65
|
+
[](https://github.com/allenporter/supernote/blob/main/LICENSE)
|
|
66
|
+
|
|
67
|
+
> **Unofficial Community Project:** We love [Ratta](https://supernote.com/)'s hardware and built this project for the Supernote community. It is an independent open-source project and is not affiliated with, endorsed by, or sponsored by Shanghai Ratta Smart Technology Co., Ltd. *Supernote* and *Ratta* are trademarks of Shanghai Ratta Smart Technology Co., Ltd.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Start Small—Everything Is Optional
|
|
72
|
+
|
|
73
|
+
Unlike the official multi-container Java, MariaDB, and Redis Private Cloud stack (~2 GB+ RAM), Open Private Cloud runs in a single Python process backed by SQLite. Every major feature is an optional component that isn't even imported when turned off, so you only pay for what you use:
|
|
74
|
+
|
|
75
|
+
| Tier | Memory Footprint | What's Included | AI Required? |
|
|
76
|
+
| :--- | :--- | :--- | :---: |
|
|
77
|
+
| **1. Bare Sync Server** | ~135 MB RAM | Drop-in Private Cloud sync for Raspberry Pi / NAS, storage quotas (`web_enabled: false`, `mcp_enabled: false`) | No |
|
|
78
|
+
| **2. Web Workspace & Integrations** | ~160 MB idle (~310 MB peak) | 4-tab Web UI (Files, Digests, Tasks, Wiki), `.ics` calendar feeds, webhooks, native page-keyword search | No |
|
|
79
|
+
| **3. Optional AI & Knowledge Hub** | ~160 MB idle + chosen model | Handwriting & diagram OCR, standalone image OCR, hybrid semantic search, opt-in LLM Wiki + Obsidian export, MCP server for Claude/Cursor | Optional (Gemini or local Ollama/vLLM) |
|
|
80
|
+
| **4. Offline `.note` Toolkit** | CLI / library only | Parse `.note` files, convert to PDF/PNG/SVG, or author Bullet Journal `.note` files from Markdown—no server needed | No |
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## What Do You Want to Do?
|
|
85
|
+
|
|
86
|
+
| If you want to… | Start here |
|
|
87
|
+
| :--- | :--- |
|
|
88
|
+
| Replace Ratta's 2 GB Private Cloud stack on a Raspberry Pi, NAS, or Docker host | [Self-Hosting & Quickstart Guide](docs/guides/bootstrap_guide.md) |
|
|
89
|
+
| Choose between Google Gemini, local Ollama/vLLM, Apple Vision, or zero AI | [Choosing an AI Provider](docs/guides/ai_providers.md) |
|
|
90
|
+
| Transcribe handwriting, Bullet Journals, Mermaid diagrams, and whiteboard photos | [Handwriting OCR & Multimodal Workflows](docs/guides/ocr_and_multimodal.md) |
|
|
91
|
+
| Search across years of notebooks by keyword or meaning | [Search & Retrieval](docs/guides/search.md) |
|
|
92
|
+
| Turn your synced notes and tasks into an Obsidian-ready personal wiki | [LLM Wiki](docs/guides/llm_wiki.md) |
|
|
93
|
+
| Connect Claude Desktop, Claude Code, or Cursor to read notes and inspect sketches | [MCP Server & AI Assistants](docs/guides/mcp.md) |
|
|
94
|
+
| Sync Supernote To-Dos to Apple Reminders, Google Calendar, or Home Assistant | [Webhooks, iCal (`.ics`) & Integrations](docs/guides/webhooks_and_integrations.md) |
|
|
95
|
+
| Convert or author `.note` files offline from the terminal or Python | [CLI Reference](docs/reference/cli_reference.md) · [`supernote.notebook`](supernote/notebook/README.md) |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Quick Tour of the Web UI
|
|
100
|
+
|
|
101
|
+
Browse synced folders with rendered `.note` cover thumbnails, open handwritten pages side-by-side with AI Markdown transcripts (including rendered Mermaid diagrams), review reading digests, manage synced tasks, or curate your opt-in LLM Wiki—all in a mobile-friendly editorial Web UI.
|
|
102
|
+
|
|
103
|
+
<p align="center">
|
|
104
|
+
<img src="docs/static-assets/web-notebook-viewer.png" alt="Handwritten Notebook Viewer side-by-side with AI Markdown OCR Transcript" width="840">
|
|
105
|
+
</p>
|
|
106
|
+
|
|
107
|
+
<p align="center">
|
|
108
|
+
<img src="docs/static-assets/web-tasks-dashboard.png" alt="Tasks and Schedule Dashboard with task lists, priorities, due dates, and iCal feed export" width="840">
|
|
109
|
+
</p>
|
|
110
|
+
|
|
111
|
+
<p align="center">
|
|
112
|
+
<img src="docs/static-assets/web-wiki-reader.png" alt="LLM Wiki Reader with clickable wikilinks, backlinks, provenance sources, and Obsidian export" width="840">
|
|
113
|
+
</p>
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Quick Start
|
|
118
|
+
|
|
119
|
+
For Docker Compose, Caddy/Nginx reverse proxies, and backups, see the [Self-Hosting & Quickstart Guide](docs/guides/bootstrap_guide.md).
|
|
120
|
+
|
|
121
|
+
### 1. Start the server
|
|
122
|
+
|
|
123
|
+
**Zero-AI sync server (Python or Docker):**
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
pip install "supernote[all]" # Server + cloud/admin CLI (or supernote[server] for server only)
|
|
127
|
+
supernote serve
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
docker run -d -p 8080:8080 -v $(pwd)/storage:/data --name supernote-server ghcr.io/allenporter/supernote:latest
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
To run in **Bare Sync Mode (~135 MB RAM)** without the Web UI or MCP server:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
SUPERNOTE_WEB_ENABLED=false SUPERNOTE_MCP_ENABLED=false supernote serve
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Add optional AI (Google Gemini default or local Ollama/vLLM):**
|
|
141
|
+
|
|
142
|
+
Set `SUPERNOTE_GEMINI_API_KEY` to enable handwriting OCR, summaries, and hybrid search with `gemini-3.5-flash-lite` and `gemini-embedding-2` (or point `config/config.yaml` at a local Ollama, llama.cpp, or vLLM server so notes never leave your network). See [Choosing an AI Provider](docs/guides/ai_providers.md) for OCR/search benchmarks, local configs, and API data-retention policies.
|
|
143
|
+
|
|
144
|
+
### 2. Create your admin account
|
|
145
|
+
|
|
146
|
+
The first registered user becomes the administrator and closes public registration:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
supernote admin --url http://localhost:8080 user add you@example.com
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 3. Pair your Supernote
|
|
153
|
+
|
|
154
|
+
1. On your tablet, open **Settings → Sync → Supernote Cloud** and choose **Private Cloud**.
|
|
155
|
+
2. Enter your server URL (for example, `http://192.168.1.5:8080`) and sign in with your new account.
|
|
156
|
+
3. Tap **Sync**.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Documentation
|
|
161
|
+
|
|
162
|
+
### Guides
|
|
163
|
+
- [Self-Hosting & Quickstart](docs/guides/bootstrap_guide.md)
|
|
164
|
+
- [Choosing an AI Provider](docs/guides/ai_providers.md) (Gemini vs. local Ollama/vLLM vs. no AI, benchmarks, and data policies)
|
|
165
|
+
- [Handwriting OCR & Multimodal Workflows](docs/guides/ocr_and_multimodal.md)
|
|
166
|
+
- [Search & Retrieval](docs/guides/search.md)
|
|
167
|
+
- [LLM Wiki](docs/guides/llm_wiki.md)
|
|
168
|
+
- [MCP Server & AI Assistants](docs/guides/mcp.md)
|
|
169
|
+
- [Webhooks, iCal (`.ics`) & Integrations](docs/guides/webhooks_and_integrations.md)
|
|
170
|
+
|
|
171
|
+
### Reference & Operations
|
|
172
|
+
- [Configuration Reference](docs/reference/configuration.md) (`config.yaml` & `SUPERNOTE_*` environment variables)
|
|
173
|
+
- [CLI Reference](docs/reference/cli_reference.md) (`supernote` local, cloud, and admin commands)
|
|
174
|
+
- [Prometheus & Grafana Monitoring](docs/reference/monitoring.md)
|
|
175
|
+
- [Security & Threat Model](docs/reference/security.md)
|
|
176
|
+
- [OCR Benchmarks](evals/ocr/RESULTS.md) · [Search & Embedding Benchmarks](evals/search/RESULTS.md)
|
|
177
|
+
|
|
178
|
+
### Architecture & Python SDK
|
|
179
|
+
- [Server Component Catalog](docs/architecture/components.md) · [Server & Sync Protocol](docs/architecture/server_architecture.md) · [Binary `.note` Format Spec](docs/architecture/notebook_spec.md)
|
|
180
|
+
- Python packages: [`supernote.server`](supernote/server/README.md) · [`supernote.client`](supernote/client/__init__.py) · [`supernote.notebook`](supernote/notebook/README.md) · [`supernote.models`](supernote/models/README.md)
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Installation & Contributing
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
pip install supernote # Offline .note parser, converter & Markdown authoring
|
|
188
|
+
pip install "supernote[client]" # + Async Cloud API client & cloud/admin CLI
|
|
189
|
+
pip install "supernote[server]" # + Private Cloud server, Web UI, AI & MCP
|
|
190
|
+
pip install "supernote[all]" # Everything
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Contributions are welcome! See [Contributing](docs/CONTRIBUTING.md) and the [Database Migration Guide](docs/architecture/schema_migration_guide.md) to get started locally with `./script/bootstrap`, `./script/test`, `./script/lint`, and `./script/docs`.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Open Private Cloud for Supernote
|
|
2
|
+
|
|
3
|
+
A lightweight, self-hosted Python private cloud server, offline `.note` toolkit, and optional AI knowledge hub for your Ratta Supernote (Nomad, A5 X2 Manta, A5 X, A6 X).
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="docs/static-assets/web-files-explorer.png" alt="Open Private Cloud for Supernote Web UI showing synced folders and handwritten .note thumbnails" width="840">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
[](https://github.com/allenporter/supernote)
|
|
10
|
+
[](https://allenporter.github.io/supernote/)
|
|
11
|
+
[](https://github.com/allenporter/supernote/blob/main/LICENSE)
|
|
12
|
+
|
|
13
|
+
> **Unofficial Community Project:** We love [Ratta](https://supernote.com/)'s hardware and built this project for the Supernote community. It is an independent open-source project and is not affiliated with, endorsed by, or sponsored by Shanghai Ratta Smart Technology Co., Ltd. *Supernote* and *Ratta* are trademarks of Shanghai Ratta Smart Technology Co., Ltd.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Start Small—Everything Is Optional
|
|
18
|
+
|
|
19
|
+
Unlike the official multi-container Java, MariaDB, and Redis Private Cloud stack (~2 GB+ RAM), Open Private Cloud runs in a single Python process backed by SQLite. Every major feature is an optional component that isn't even imported when turned off, so you only pay for what you use:
|
|
20
|
+
|
|
21
|
+
| Tier | Memory Footprint | What's Included | AI Required? |
|
|
22
|
+
| :--- | :--- | :--- | :---: |
|
|
23
|
+
| **1. Bare Sync Server** | ~135 MB RAM | Drop-in Private Cloud sync for Raspberry Pi / NAS, storage quotas (`web_enabled: false`, `mcp_enabled: false`) | No |
|
|
24
|
+
| **2. Web Workspace & Integrations** | ~160 MB idle (~310 MB peak) | 4-tab Web UI (Files, Digests, Tasks, Wiki), `.ics` calendar feeds, webhooks, native page-keyword search | No |
|
|
25
|
+
| **3. Optional AI & Knowledge Hub** | ~160 MB idle + chosen model | Handwriting & diagram OCR, standalone image OCR, hybrid semantic search, opt-in LLM Wiki + Obsidian export, MCP server for Claude/Cursor | Optional (Gemini or local Ollama/vLLM) |
|
|
26
|
+
| **4. Offline `.note` Toolkit** | CLI / library only | Parse `.note` files, convert to PDF/PNG/SVG, or author Bullet Journal `.note` files from Markdown—no server needed | No |
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## What Do You Want to Do?
|
|
31
|
+
|
|
32
|
+
| If you want to… | Start here |
|
|
33
|
+
| :--- | :--- |
|
|
34
|
+
| Replace Ratta's 2 GB Private Cloud stack on a Raspberry Pi, NAS, or Docker host | [Self-Hosting & Quickstart Guide](docs/guides/bootstrap_guide.md) |
|
|
35
|
+
| Choose between Google Gemini, local Ollama/vLLM, Apple Vision, or zero AI | [Choosing an AI Provider](docs/guides/ai_providers.md) |
|
|
36
|
+
| Transcribe handwriting, Bullet Journals, Mermaid diagrams, and whiteboard photos | [Handwriting OCR & Multimodal Workflows](docs/guides/ocr_and_multimodal.md) |
|
|
37
|
+
| Search across years of notebooks by keyword or meaning | [Search & Retrieval](docs/guides/search.md) |
|
|
38
|
+
| Turn your synced notes and tasks into an Obsidian-ready personal wiki | [LLM Wiki](docs/guides/llm_wiki.md) |
|
|
39
|
+
| Connect Claude Desktop, Claude Code, or Cursor to read notes and inspect sketches | [MCP Server & AI Assistants](docs/guides/mcp.md) |
|
|
40
|
+
| Sync Supernote To-Dos to Apple Reminders, Google Calendar, or Home Assistant | [Webhooks, iCal (`.ics`) & Integrations](docs/guides/webhooks_and_integrations.md) |
|
|
41
|
+
| Convert or author `.note` files offline from the terminal or Python | [CLI Reference](docs/reference/cli_reference.md) · [`supernote.notebook`](supernote/notebook/README.md) |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Quick Tour of the Web UI
|
|
46
|
+
|
|
47
|
+
Browse synced folders with rendered `.note` cover thumbnails, open handwritten pages side-by-side with AI Markdown transcripts (including rendered Mermaid diagrams), review reading digests, manage synced tasks, or curate your opt-in LLM Wiki—all in a mobile-friendly editorial Web UI.
|
|
48
|
+
|
|
49
|
+
<p align="center">
|
|
50
|
+
<img src="docs/static-assets/web-notebook-viewer.png" alt="Handwritten Notebook Viewer side-by-side with AI Markdown OCR Transcript" width="840">
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
<p align="center">
|
|
54
|
+
<img src="docs/static-assets/web-tasks-dashboard.png" alt="Tasks and Schedule Dashboard with task lists, priorities, due dates, and iCal feed export" width="840">
|
|
55
|
+
</p>
|
|
56
|
+
|
|
57
|
+
<p align="center">
|
|
58
|
+
<img src="docs/static-assets/web-wiki-reader.png" alt="LLM Wiki Reader with clickable wikilinks, backlinks, provenance sources, and Obsidian export" width="840">
|
|
59
|
+
</p>
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Quick Start
|
|
64
|
+
|
|
65
|
+
For Docker Compose, Caddy/Nginx reverse proxies, and backups, see the [Self-Hosting & Quickstart Guide](docs/guides/bootstrap_guide.md).
|
|
66
|
+
|
|
67
|
+
### 1. Start the server
|
|
68
|
+
|
|
69
|
+
**Zero-AI sync server (Python or Docker):**
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pip install "supernote[all]" # Server + cloud/admin CLI (or supernote[server] for server only)
|
|
73
|
+
supernote serve
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
docker run -d -p 8080:8080 -v $(pwd)/storage:/data --name supernote-server ghcr.io/allenporter/supernote:latest
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
To run in **Bare Sync Mode (~135 MB RAM)** without the Web UI or MCP server:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
SUPERNOTE_WEB_ENABLED=false SUPERNOTE_MCP_ENABLED=false supernote serve
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Add optional AI (Google Gemini default or local Ollama/vLLM):**
|
|
87
|
+
|
|
88
|
+
Set `SUPERNOTE_GEMINI_API_KEY` to enable handwriting OCR, summaries, and hybrid search with `gemini-3.5-flash-lite` and `gemini-embedding-2` (or point `config/config.yaml` at a local Ollama, llama.cpp, or vLLM server so notes never leave your network). See [Choosing an AI Provider](docs/guides/ai_providers.md) for OCR/search benchmarks, local configs, and API data-retention policies.
|
|
89
|
+
|
|
90
|
+
### 2. Create your admin account
|
|
91
|
+
|
|
92
|
+
The first registered user becomes the administrator and closes public registration:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
supernote admin --url http://localhost:8080 user add you@example.com
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 3. Pair your Supernote
|
|
99
|
+
|
|
100
|
+
1. On your tablet, open **Settings → Sync → Supernote Cloud** and choose **Private Cloud**.
|
|
101
|
+
2. Enter your server URL (for example, `http://192.168.1.5:8080`) and sign in with your new account.
|
|
102
|
+
3. Tap **Sync**.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Documentation
|
|
107
|
+
|
|
108
|
+
### Guides
|
|
109
|
+
- [Self-Hosting & Quickstart](docs/guides/bootstrap_guide.md)
|
|
110
|
+
- [Choosing an AI Provider](docs/guides/ai_providers.md) (Gemini vs. local Ollama/vLLM vs. no AI, benchmarks, and data policies)
|
|
111
|
+
- [Handwriting OCR & Multimodal Workflows](docs/guides/ocr_and_multimodal.md)
|
|
112
|
+
- [Search & Retrieval](docs/guides/search.md)
|
|
113
|
+
- [LLM Wiki](docs/guides/llm_wiki.md)
|
|
114
|
+
- [MCP Server & AI Assistants](docs/guides/mcp.md)
|
|
115
|
+
- [Webhooks, iCal (`.ics`) & Integrations](docs/guides/webhooks_and_integrations.md)
|
|
116
|
+
|
|
117
|
+
### Reference & Operations
|
|
118
|
+
- [Configuration Reference](docs/reference/configuration.md) (`config.yaml` & `SUPERNOTE_*` environment variables)
|
|
119
|
+
- [CLI Reference](docs/reference/cli_reference.md) (`supernote` local, cloud, and admin commands)
|
|
120
|
+
- [Prometheus & Grafana Monitoring](docs/reference/monitoring.md)
|
|
121
|
+
- [Security & Threat Model](docs/reference/security.md)
|
|
122
|
+
- [OCR Benchmarks](evals/ocr/RESULTS.md) · [Search & Embedding Benchmarks](evals/search/RESULTS.md)
|
|
123
|
+
|
|
124
|
+
### Architecture & Python SDK
|
|
125
|
+
- [Server Component Catalog](docs/architecture/components.md) · [Server & Sync Protocol](docs/architecture/server_architecture.md) · [Binary `.note` Format Spec](docs/architecture/notebook_spec.md)
|
|
126
|
+
- Python packages: [`supernote.server`](supernote/server/README.md) · [`supernote.client`](supernote/client/__init__.py) · [`supernote.notebook`](supernote/notebook/README.md) · [`supernote.models`](supernote/models/README.md)
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Installation & Contributing
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pip install supernote # Offline .note parser, converter & Markdown authoring
|
|
134
|
+
pip install "supernote[client]" # + Async Cloud API client & cloud/admin CLI
|
|
135
|
+
pip install "supernote[server]" # + Private Cloud server, Web UI, AI & MCP
|
|
136
|
+
pip install "supernote[all]" # Everything
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Contributions are welcome! See [Contributing](docs/CONTRIBUTING.md) and the [Database Migration Guide](docs/architecture/schema_migration_guide.md) to get started locally with `./script/bootstrap`, `./script/test`, `./script/lint`, and `./script/docs`.
|
|
@@ -4,7 +4,7 @@ requires = ["setuptools>=77.0"]
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "supernote"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.28.0"
|
|
8
8
|
license = "Apache-2.0"
|
|
9
9
|
license-files = ["LICENSE", "NOTICE"]
|
|
10
10
|
description = "Unofficial Python toolkit for Ratta Supernote: parse and author .note files, self-host a lightweight SQLite private cloud, and run optional AI synthesis"
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"""Add per-user LLM wiki tables (`f_wiki_*`).
|
|
2
|
+
|
|
3
|
+
Revision ID: d8e9f0a1b2c3
|
|
4
|
+
Revises: c7d8e9f0a1b2
|
|
5
|
+
Create Date: 2026-11-24 04:16:00.000000
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from collections.abc import Sequence
|
|
9
|
+
|
|
10
|
+
import sqlalchemy as sa
|
|
11
|
+
from alembic import op
|
|
12
|
+
|
|
13
|
+
# revision identifiers, used by Alembic.
|
|
14
|
+
revision: str = "d8e9f0a1b2c3"
|
|
15
|
+
down_revision: str | Sequence[str] | None = "c7d8e9f0a1b2"
|
|
16
|
+
branch_labels: str | Sequence[str] | None = None
|
|
17
|
+
depends_on: str | Sequence[str] | None = None
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def upgrade() -> None:
|
|
21
|
+
"""Create the seven multi-user `f_wiki_*` tables and tenant-scoped indexes."""
|
|
22
|
+
op.create_table(
|
|
23
|
+
"f_wiki_page",
|
|
24
|
+
sa.Column("user_id", sa.BigInteger(), nullable=False),
|
|
25
|
+
sa.Column("page_id", sa.BigInteger(), nullable=False),
|
|
26
|
+
sa.Column("slug", sa.String(length=191), nullable=False),
|
|
27
|
+
sa.Column("title", sa.String(length=255), nullable=False),
|
|
28
|
+
sa.Column("page_kind", sa.String(length=32), nullable=False),
|
|
29
|
+
sa.Column("summary", sa.String(length=512), nullable=False),
|
|
30
|
+
sa.Column("body_md", sa.Text(), nullable=False),
|
|
31
|
+
sa.Column("claims_json", sa.JSON(), nullable=False),
|
|
32
|
+
sa.Column("edit_policy", sa.String(length=32), nullable=False),
|
|
33
|
+
sa.Column("last_author_kind", sa.String(length=32), nullable=False),
|
|
34
|
+
sa.Column("version", sa.Integer(), nullable=False),
|
|
35
|
+
sa.Column("is_deleted", sa.Boolean(), nullable=False),
|
|
36
|
+
sa.Column("create_time", sa.BigInteger(), nullable=False),
|
|
37
|
+
sa.Column("update_time", sa.BigInteger(), nullable=False),
|
|
38
|
+
sa.PrimaryKeyConstraint("user_id", "page_id"),
|
|
39
|
+
sa.UniqueConstraint("user_id", "slug", name="uq_f_wiki_page_user_slug"),
|
|
40
|
+
)
|
|
41
|
+
op.create_index(
|
|
42
|
+
"ix_f_wiki_page_user_kind_updated",
|
|
43
|
+
"f_wiki_page",
|
|
44
|
+
["user_id", "page_kind", "update_time"],
|
|
45
|
+
unique=False,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
op.create_table(
|
|
49
|
+
"f_wiki_revision",
|
|
50
|
+
sa.Column("user_id", sa.BigInteger(), nullable=False),
|
|
51
|
+
sa.Column("revision_id", sa.BigInteger(), nullable=False),
|
|
52
|
+
sa.Column("page_id", sa.BigInteger(), nullable=False),
|
|
53
|
+
sa.Column("revision_no", sa.Integer(), nullable=False),
|
|
54
|
+
sa.Column("title", sa.String(length=255), nullable=False),
|
|
55
|
+
sa.Column("body_md", sa.Text(), nullable=False),
|
|
56
|
+
sa.Column("claims_json", sa.JSON(), nullable=False),
|
|
57
|
+
sa.Column("author_kind", sa.String(length=32), nullable=False),
|
|
58
|
+
sa.Column("author_ref", sa.String(length=128), nullable=True),
|
|
59
|
+
sa.Column("change_summary", sa.String(length=512), nullable=False),
|
|
60
|
+
sa.Column("source_event_seq", sa.BigInteger(), nullable=True),
|
|
61
|
+
sa.Column("create_time", sa.BigInteger(), nullable=False),
|
|
62
|
+
sa.PrimaryKeyConstraint("user_id", "revision_id"),
|
|
63
|
+
sa.UniqueConstraint(
|
|
64
|
+
"user_id", "page_id", "revision_no", name="uq_f_wiki_revision_page_rev"
|
|
65
|
+
),
|
|
66
|
+
)
|
|
67
|
+
op.create_index(
|
|
68
|
+
"ix_f_wiki_revision_user_event",
|
|
69
|
+
"f_wiki_revision",
|
|
70
|
+
["user_id", "source_event_seq"],
|
|
71
|
+
unique=False,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
op.create_table(
|
|
75
|
+
"f_wiki_alias",
|
|
76
|
+
sa.Column("user_id", sa.BigInteger(), nullable=False),
|
|
77
|
+
sa.Column("alias_id", sa.BigInteger(), nullable=False),
|
|
78
|
+
sa.Column("page_id", sa.BigInteger(), nullable=False),
|
|
79
|
+
sa.Column("alias_text", sa.String(length=255), nullable=False),
|
|
80
|
+
sa.Column("normalized_alias", sa.String(length=255), nullable=False),
|
|
81
|
+
sa.Column("origin", sa.String(length=32), nullable=False),
|
|
82
|
+
sa.Column("create_time", sa.BigInteger(), nullable=False),
|
|
83
|
+
sa.PrimaryKeyConstraint("user_id", "alias_id"),
|
|
84
|
+
sa.UniqueConstraint(
|
|
85
|
+
"user_id", "normalized_alias", name="uq_f_wiki_alias_user_norm"
|
|
86
|
+
),
|
|
87
|
+
)
|
|
88
|
+
op.create_index(
|
|
89
|
+
"ix_f_wiki_alias_user_page",
|
|
90
|
+
"f_wiki_alias",
|
|
91
|
+
["user_id", "page_id"],
|
|
92
|
+
unique=False,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
op.create_table(
|
|
96
|
+
"f_wiki_link",
|
|
97
|
+
sa.Column("user_id", sa.BigInteger(), nullable=False),
|
|
98
|
+
sa.Column("from_page_id", sa.BigInteger(), nullable=False),
|
|
99
|
+
sa.Column("target_slug", sa.String(length=191), nullable=False),
|
|
100
|
+
sa.Column("target_page_id", sa.BigInteger(), nullable=True),
|
|
101
|
+
sa.Column("link_label", sa.String(length=255), nullable=True),
|
|
102
|
+
sa.Column("update_time", sa.BigInteger(), nullable=False),
|
|
103
|
+
sa.PrimaryKeyConstraint("user_id", "from_page_id", "target_slug"),
|
|
104
|
+
)
|
|
105
|
+
op.create_index(
|
|
106
|
+
"ix_f_wiki_link_user_target",
|
|
107
|
+
"f_wiki_link",
|
|
108
|
+
["user_id", "target_slug"],
|
|
109
|
+
unique=False,
|
|
110
|
+
)
|
|
111
|
+
op.create_index(
|
|
112
|
+
"ix_f_wiki_link_user_target_page",
|
|
113
|
+
"f_wiki_link",
|
|
114
|
+
["user_id", "target_page_id"],
|
|
115
|
+
unique=False,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
op.create_table(
|
|
119
|
+
"f_wiki_source_ref",
|
|
120
|
+
sa.Column("user_id", sa.BigInteger(), nullable=False),
|
|
121
|
+
sa.Column("page_id", sa.BigInteger(), nullable=False),
|
|
122
|
+
sa.Column("source_type", sa.String(length=32), nullable=False),
|
|
123
|
+
sa.Column("source_key", sa.String(length=191), nullable=False),
|
|
124
|
+
sa.Column("file_id", sa.BigInteger(), nullable=True),
|
|
125
|
+
sa.Column("last_event_seq", sa.BigInteger(), nullable=True),
|
|
126
|
+
sa.Column("is_source_deleted", sa.Boolean(), nullable=False),
|
|
127
|
+
sa.Column("update_time", sa.BigInteger(), nullable=False),
|
|
128
|
+
sa.PrimaryKeyConstraint("user_id", "page_id", "source_type", "source_key"),
|
|
129
|
+
)
|
|
130
|
+
op.create_index(
|
|
131
|
+
"ix_f_wiki_source_ref_user_entity",
|
|
132
|
+
"f_wiki_source_ref",
|
|
133
|
+
["user_id", "source_type", "source_key"],
|
|
134
|
+
unique=False,
|
|
135
|
+
)
|
|
136
|
+
op.create_index(
|
|
137
|
+
"ix_f_wiki_source_ref_user_file",
|
|
138
|
+
"f_wiki_source_ref",
|
|
139
|
+
["user_id", "file_id"],
|
|
140
|
+
unique=False,
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
op.create_table(
|
|
144
|
+
"f_wiki_checkpoint",
|
|
145
|
+
sa.Column("user_id", sa.BigInteger(), nullable=False),
|
|
146
|
+
sa.Column("last_sync_token", sa.String(length=128), nullable=True),
|
|
147
|
+
sa.Column("pending_events_since_lint", sa.Integer(), nullable=False),
|
|
148
|
+
sa.Column("last_lint_time", sa.BigInteger(), nullable=True),
|
|
149
|
+
sa.Column("backfill_file_cursor", sa.BigInteger(), nullable=True),
|
|
150
|
+
sa.Column("tokens_used_day", sa.Integer(), nullable=False),
|
|
151
|
+
sa.Column("budget_day_utc", sa.String(length=10), nullable=True),
|
|
152
|
+
sa.Column("status", sa.String(length=32), nullable=False),
|
|
153
|
+
sa.Column("last_error", sa.String(length=512), nullable=True),
|
|
154
|
+
sa.Column("update_time", sa.BigInteger(), nullable=False),
|
|
155
|
+
sa.PrimaryKeyConstraint("user_id"),
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
op.create_table(
|
|
159
|
+
"f_wiki_lint_issue",
|
|
160
|
+
sa.Column("user_id", sa.BigInteger(), nullable=False),
|
|
161
|
+
sa.Column("issue_id", sa.BigInteger(), nullable=False),
|
|
162
|
+
sa.Column("dedup_key", sa.String(length=191), nullable=False),
|
|
163
|
+
sa.Column("issue_type", sa.String(length=48), nullable=False),
|
|
164
|
+
sa.Column("severity", sa.String(length=16), nullable=False),
|
|
165
|
+
sa.Column("page_id", sa.BigInteger(), nullable=True),
|
|
166
|
+
sa.Column("target_page_id", sa.BigInteger(), nullable=True),
|
|
167
|
+
sa.Column("description", sa.Text(), nullable=False),
|
|
168
|
+
sa.Column("proposal_json", sa.JSON(), nullable=True),
|
|
169
|
+
sa.Column("status", sa.String(length=24), nullable=False),
|
|
170
|
+
sa.Column("create_time", sa.BigInteger(), nullable=False),
|
|
171
|
+
sa.Column("update_time", sa.BigInteger(), nullable=False),
|
|
172
|
+
sa.PrimaryKeyConstraint("user_id", "issue_id"),
|
|
173
|
+
sa.UniqueConstraint("user_id", "dedup_key", name="uq_f_wiki_lint_user_dedup"),
|
|
174
|
+
)
|
|
175
|
+
op.create_index(
|
|
176
|
+
"ix_f_wiki_lint_user_status",
|
|
177
|
+
"f_wiki_lint_issue",
|
|
178
|
+
["user_id", "status", "issue_type"],
|
|
179
|
+
unique=False,
|
|
180
|
+
)
|
|
181
|
+
op.create_index(
|
|
182
|
+
"ix_f_wiki_lint_user_page",
|
|
183
|
+
"f_wiki_lint_issue",
|
|
184
|
+
["user_id", "page_id"],
|
|
185
|
+
unique=False,
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
def downgrade() -> None:
|
|
190
|
+
"""Drop all `f_wiki_*` tables and indexes."""
|
|
191
|
+
op.drop_index("ix_f_wiki_lint_user_page", table_name="f_wiki_lint_issue")
|
|
192
|
+
op.drop_index("ix_f_wiki_lint_user_status", table_name="f_wiki_lint_issue")
|
|
193
|
+
op.drop_table("f_wiki_lint_issue")
|
|
194
|
+
|
|
195
|
+
op.drop_table("f_wiki_checkpoint")
|
|
196
|
+
|
|
197
|
+
op.drop_index("ix_f_wiki_source_ref_user_file", table_name="f_wiki_source_ref")
|
|
198
|
+
op.drop_index("ix_f_wiki_source_ref_user_entity", table_name="f_wiki_source_ref")
|
|
199
|
+
op.drop_table("f_wiki_source_ref")
|
|
200
|
+
|
|
201
|
+
op.drop_index("ix_f_wiki_link_user_target_page", table_name="f_wiki_link")
|
|
202
|
+
op.drop_index("ix_f_wiki_link_user_target", table_name="f_wiki_link")
|
|
203
|
+
op.drop_table("f_wiki_link")
|
|
204
|
+
|
|
205
|
+
op.drop_index("ix_f_wiki_alias_user_page", table_name="f_wiki_alias")
|
|
206
|
+
op.drop_table("f_wiki_alias")
|
|
207
|
+
|
|
208
|
+
op.drop_index("ix_f_wiki_revision_user_event", table_name="f_wiki_revision")
|
|
209
|
+
op.drop_table("f_wiki_revision")
|
|
210
|
+
|
|
211
|
+
op.drop_index("ix_f_wiki_page_user_kind_updated", table_name="f_wiki_page")
|
|
212
|
+
op.drop_table("f_wiki_page")
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Add user_id to f_system_task primary key and unique constraint
|
|
2
|
+
|
|
3
|
+
Revision ID: e9f0a1b2c3d4
|
|
4
|
+
Revises: d8e9f0a1b2c3
|
|
5
|
+
Create Date: 2026-11-24 04:50:00.000000
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from collections.abc import Sequence
|
|
10
|
+
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
from alembic import op
|
|
13
|
+
|
|
14
|
+
# revision identifiers, used by Alembic.
|
|
15
|
+
revision: str = "e9f0a1b2c3d4"
|
|
16
|
+
down_revision: str | Sequence[str] | None = "d8e9f0a1b2c3"
|
|
17
|
+
branch_labels: str | Sequence[str] | None = None
|
|
18
|
+
depends_on: str | Sequence[str] | None = None
|
|
19
|
+
|
|
20
|
+
_NAMING_CONVENTION = {
|
|
21
|
+
"pk": "pk_%(table_name)s",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def upgrade() -> None:
|
|
26
|
+
"""Add user_id column, backfill from f_user_file, and scope PK and unique constraint."""
|
|
27
|
+
op.add_column(
|
|
28
|
+
"f_system_task",
|
|
29
|
+
sa.Column("user_id", sa.BigInteger(), nullable=True),
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
conn = op.get_bind()
|
|
33
|
+
conn.execute(
|
|
34
|
+
sa.text(
|
|
35
|
+
"""
|
|
36
|
+
UPDATE f_system_task
|
|
37
|
+
SET user_id = (
|
|
38
|
+
SELECT f_user_file.user_id
|
|
39
|
+
FROM f_user_file
|
|
40
|
+
WHERE f_user_file.id = f_system_task.file_id
|
|
41
|
+
)
|
|
42
|
+
"""
|
|
43
|
+
)
|
|
44
|
+
)
|
|
45
|
+
conn.execute(sa.text("DELETE FROM f_system_task WHERE user_id IS NULL"))
|
|
46
|
+
|
|
47
|
+
with op.batch_alter_table(
|
|
48
|
+
"f_system_task", naming_convention=_NAMING_CONVENTION
|
|
49
|
+
) as batch_op:
|
|
50
|
+
batch_op.alter_column("user_id", existing_type=sa.BigInteger(), nullable=False)
|
|
51
|
+
batch_op.drop_constraint("uq_system_task", type_="unique")
|
|
52
|
+
batch_op.create_unique_constraint(
|
|
53
|
+
"uq_system_task", ["user_id", "file_id", "task_type", "key"]
|
|
54
|
+
)
|
|
55
|
+
batch_op.drop_constraint("pk_f_system_task", type_="primary")
|
|
56
|
+
batch_op.create_primary_key("pk_f_system_task", ["user_id", "id"])
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def downgrade() -> None:
|
|
60
|
+
"""Remove user_id from f_system_task primary key, unique constraint, and schema."""
|
|
61
|
+
with op.batch_alter_table(
|
|
62
|
+
"f_system_task", naming_convention=_NAMING_CONVENTION
|
|
63
|
+
) as batch_op:
|
|
64
|
+
batch_op.drop_constraint("uq_system_task", type_="unique")
|
|
65
|
+
batch_op.create_unique_constraint(
|
|
66
|
+
"uq_system_task", ["file_id", "task_type", "key"]
|
|
67
|
+
)
|
|
68
|
+
batch_op.drop_constraint("pk_f_system_task", type_="primary")
|
|
69
|
+
batch_op.create_primary_key("pk_f_system_task", ["id"])
|
|
70
|
+
batch_op.drop_column("user_id")
|
|
@@ -5,7 +5,7 @@ organizes subcommands into lazy-loaded modules so offline notebook commands (`cr
|
|
|
5
5
|
`analyze`, `convert`, `merge`, `reconstruct`) run without importing server or cloud client
|
|
6
6
|
dependencies.
|
|
7
7
|
|
|
8
|
-
> **Looking for terminal usage and flags?** See the **[CLI Reference Guide](../../docs/cli_reference.md)** for complete examples of every `supernote` command.
|
|
8
|
+
> **Looking for terminal usage and flags?** See the **[CLI Reference Guide](../../docs/reference/cli_reference.md)** for complete examples of every `supernote` command.
|
|
9
9
|
|
|
10
10
|
## Module Structure
|
|
11
11
|
|