From 5769d46d84264223cabb5a6cfaa7f9c896f846fd Mon Sep 17 00:00:00 2001 From: Orual Date: Fri, 7 Nov 2025 13:38:59 -0500 Subject: [PATCH] moved stuff around, new lexicons --- Cargo.lock | 49 ++++++------ Cargo.toml | 3 +- .../lexicons/app_bsky_actor_defs.json | 4 - ...p_bsky_unspecced_getPostThreadOtherV2.json | 5 -- .../app_bsky_unspecced_getPostThreadV2.json | 5 -- .../lexicons/sh_weaver_notebook_book.json | 4 + .../lexicons/sh_weaver_notebook_defs.json | 5 ++ crates/weaver-api/src/app_bsky/actor.rs | 13 ---- .../unspecced/get_post_thread_other_v2.rs | 30 +------- .../app_bsky/unspecced/get_post_thread_v2.rs | 36 +-------- crates/weaver-api/src/sh_weaver/notebook.rs | 21 ++++++ .../weaver-api/src/sh_weaver/notebook/book.rs | 60 +++++++++++---- .../Cargo.toml | 2 +- .../appview-config.toml | 0 .../build.rs | 0 .../diesel.toml | 0 .../migrations/.keep | 0 .../down.sql | 0 .../up.sql | 0 .../down.sql | 0 .../2025-05-15-230036_create_appviewdb/up.sql | 0 .../src/api_error.rs | 0 .../src/config.rs | 0 .../src/db.rs | 0 .../src/main.rs | 0 .../src/middleware.rs | 0 .../src/models.rs | 0 .../src/oauth.rs | 0 .../src/routes/health_check.rs | 0 .../src/routes/login.rs | 0 .../src/routes/logout.rs | 0 .../src/routes/mod.rs | 0 .../src/routes/oauth.rs | 0 .../src/schema.rs | 0 .../src/state.rs | 0 .../src/telemetry.rs | 0 .../{weaver-server => weaver-app}/.gitignore | 0 .../{weaver-server => weaver-app}/Cargo.toml | 2 +- .../{weaver-server => weaver-app}/Dioxus.toml | 0 .../{weaver-server => weaver-app}/README.md | 0 .../assets/dx-components-theme.css | 0 ...PlexSans-Italic-VariableFont_wdth,wght.ttf | Bin .../IBMPlexSans-VariableFont_wdth,wght.ttf | Bin .../assets/styling/entry-card.css | 0 .../assets/styling/entry.css | 0 .../assets/styling/main.css | 0 .../assets/styling/navbar.css | 0 .../assets/styling/notebook-card.css | 0 .../assets/styling/theme-defaults.css | 0 .../assets/weaver_photo_sm.jpg | Bin .../src/blobcache.rs | 0 .../src/cache_impl.rs | 0 .../src/components/avatar/component.rs | 0 .../src/components/avatar/mod.rs | 0 .../src/components/avatar/style.css | 0 .../src/components/css.rs | 6 +- .../src/components/entry.rs | 0 .../src/components/identity.rs | 0 .../src/components/mod.rs | 0 .../src/fetch.rs | 0 .../{weaver-server => weaver-app}/src/main.rs | 0 .../src/views/home.rs | 0 .../src/views/mod.rs | 0 .../src/views/navbar.rs | 0 .../src/views/notebook.rs | 0 .../src/views/notebookpage.rs | 0 crates/weaver-common/Cargo.toml | 1 + crates/weaver-common/src/constellation.rs | 71 ++++++++++++++++++ crates/weaver-common/src/lib.rs | 1 + flake.nix | 16 ++-- lexicons/actor/defs.json | 8 +- lexicons/notebook/book.json | 1 + lexicons/notebook/defs.json | 5 ++ weaver_notes/.obsidian/workspace.json | 11 +-- weaver_notes/Arch.md | 22 ++++++ 75 files changed, 232 insertions(+), 149 deletions(-) rename crates/{weaver-appview => weaver-app-server}/Cargo.toml (98%) rename crates/{weaver-appview => weaver-app-server}/appview-config.toml (100%) rename crates/{weaver-appview => weaver-app-server}/build.rs (100%) rename crates/{weaver-appview => weaver-app-server}/diesel.toml (100%) rename crates/{weaver-appview => weaver-app-server}/migrations/.keep (100%) rename crates/{weaver-appview => weaver-app-server}/migrations/00000000000000_diesel_initial_setup/down.sql (100%) rename crates/{weaver-appview => weaver-app-server}/migrations/00000000000000_diesel_initial_setup/up.sql (100%) rename crates/{weaver-appview => weaver-app-server}/migrations/2025-05-15-230036_create_appviewdb/down.sql (100%) rename crates/{weaver-appview => weaver-app-server}/migrations/2025-05-15-230036_create_appviewdb/up.sql (100%) rename crates/{weaver-appview => weaver-app-server}/src/api_error.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/config.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/db.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/main.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/middleware.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/models.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/oauth.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/routes/health_check.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/routes/login.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/routes/logout.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/routes/mod.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/routes/oauth.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/schema.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/state.rs (100%) rename crates/{weaver-appview => weaver-app-server}/src/telemetry.rs (100%) rename crates/{weaver-server => weaver-app}/.gitignore (100%) rename crates/{weaver-server => weaver-app}/Cargo.toml (98%) rename crates/{weaver-server => weaver-app}/Dioxus.toml (100%) rename crates/{weaver-server => weaver-app}/README.md (100%) rename crates/{weaver-server => weaver-app}/assets/dx-components-theme.css (100%) rename crates/{weaver-server => weaver-app}/assets/fonts/IBMPlexSans-Italic-VariableFont_wdth,wght.ttf (100%) rename crates/{weaver-server => weaver-app}/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf (100%) rename crates/{weaver-server => weaver-app}/assets/styling/entry-card.css (100%) rename crates/{weaver-server => weaver-app}/assets/styling/entry.css (100%) rename crates/{weaver-server => weaver-app}/assets/styling/main.css (100%) rename crates/{weaver-server => weaver-app}/assets/styling/navbar.css (100%) rename crates/{weaver-server => weaver-app}/assets/styling/notebook-card.css (100%) rename crates/{weaver-server => weaver-app}/assets/styling/theme-defaults.css (100%) rename crates/{weaver-server => weaver-app}/assets/weaver_photo_sm.jpg (100%) rename crates/{weaver-server => weaver-app}/src/blobcache.rs (100%) rename crates/{weaver-server => weaver-app}/src/cache_impl.rs (100%) rename crates/{weaver-server => weaver-app}/src/components/avatar/component.rs (100%) rename crates/{weaver-server => weaver-app}/src/components/avatar/mod.rs (100%) rename crates/{weaver-server => weaver-app}/src/components/avatar/style.css (100%) rename crates/{weaver-server => weaver-app}/src/components/css.rs (92%) rename crates/{weaver-server => weaver-app}/src/components/entry.rs (100%) rename crates/{weaver-server => weaver-app}/src/components/identity.rs (100%) rename crates/{weaver-server => weaver-app}/src/components/mod.rs (100%) rename crates/{weaver-server => weaver-app}/src/fetch.rs (100%) rename crates/{weaver-server => weaver-app}/src/main.rs (100%) rename crates/{weaver-server => weaver-app}/src/views/home.rs (100%) rename crates/{weaver-server => weaver-app}/src/views/mod.rs (100%) rename crates/{weaver-server => weaver-app}/src/views/navbar.rs (100%) rename crates/{weaver-server => weaver-app}/src/views/notebook.rs (100%) rename crates/{weaver-server => weaver-app}/src/views/notebookpage.rs (100%) create mode 100644 crates/weaver-common/src/constellation.rs create mode 100644 weaver_notes/Arch.md diff --git a/Cargo.lock b/Cargo.lock index 0f56853..69d0ca2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8525,7 +8525,30 @@ dependencies = [ ] [[package]] -name = "weaver-appview" +name = "weaver-app" +version = "0.1.0" +dependencies = [ + "axum", + "chrono", + "console_error_panic_hook", + "dashmap", + "dioxus", + "dioxus-primitives", + "jacquard", + "jacquard-axum", + "markdown-weaver", + "mime-sniffer", + "mini-moka", + "n0-future", + "serde_json", + "time", + "weaver-api", + "weaver-common", + "weaver-renderer", +] + +[[package]] +name = "weaver-app-server" version = "0.1.0" dependencies = [ "axum", @@ -8589,6 +8612,7 @@ version = "0.1.0" dependencies = [ "http", "jacquard", + "jacquard-common", "markdown-weaver", "markdown-weaver-escape", "miette 7.6.0", @@ -8644,29 +8668,6 @@ dependencies = [ "yaml-rust2", ] -[[package]] -name = "weaver-server" -version = "0.1.0" -dependencies = [ - "axum", - "chrono", - "console_error_panic_hook", - "dashmap", - "dioxus", - "dioxus-primitives", - "jacquard", - "jacquard-axum", - "markdown-weaver", - "mime-sniffer", - "mini-moka", - "n0-future", - "serde_json", - "time", - "weaver-api", - "weaver-common", - "weaver-renderer", -] - [[package]] name = "web-sys" version = "0.3.82" diff --git a/Cargo.toml b/Cargo.toml index 6246052..d67a8e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ resolver = "2" # paths because the flake.nix is written in a way such that top-level members # (`weaver-cli` and `weaver-server`) are built as different derivations which avoid being # rebuilt if the other package's sources change. -members = ["crates/*", "crates/weaver-server", "crates/weaver-server"] +members = ["crates/*"] #default-members = ["crates/weaver-cli"] @@ -42,6 +42,7 @@ markdown-weaver-escape = { git = "https://github.com/rsform/markdown-weaver" } jacquard = { git = "https://tangled.org/@nonbinary.computer/jacquard", default-features = false, features = ["derive", "api_bluesky"] } jacquard-api = { git = "https://tangled.org/@nonbinary.computer/jacquard" } +jacquard-common = { git = "https://tangled.org/@nonbinary.computer/jacquard" } jacquard-axum = { git = "https://tangled.org/@nonbinary.computer/jacquard" } [profile] diff --git a/crates/weaver-api/lexicons/app_bsky_actor_defs.json b/crates/weaver-api/lexicons/app_bsky_actor_defs.json index 9019b30..94ea65f 100644 --- a/crates/weaver-api/lexicons/app_bsky_actor_defs.json +++ b/crates/weaver-api/lexicons/app_bsky_actor_defs.json @@ -743,10 +743,6 @@ "threadViewPref": { "type": "object", "properties": { - "prioritizeFollowedUsers": { - "type": "boolean", - "description": "Show followed users at the top of all replies." - }, "sort": { "type": "string", "description": "Sorting mode for threads.", diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadOtherV2.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadOtherV2.json index 5d52338..1bb66de 100644 --- a/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadOtherV2.json +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadOtherV2.json @@ -15,11 +15,6 @@ "type": "string", "description": "Reference (AT-URI) to post record. This is the anchor post.", "format": "at-uri" - }, - "prioritizeFollowedUsers": { - "type": "boolean", - "description": "Whether to prioritize posts from followed users. It only has effect when the user is authenticated.", - "default": false } } }, diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadV2.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadV2.json index 46d2883..87483a0 100644 --- a/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadV2.json +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadV2.json @@ -35,11 +35,6 @@ "minimum": 0, "maximum": 100 }, - "prioritizeFollowedUsers": { - "type": "boolean", - "description": "Whether to prioritize posts from followed users. It only has effect when the user is authenticated.", - "default": false - }, "sort": { "type": "string", "description": "Sorting for the thread replies.", diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_book.json b/crates/weaver-api/lexicons/sh_weaver_notebook_book.json index 6038db2..d078894 100644 --- a/crates/weaver-api/lexicons/sh_weaver_notebook_book.json +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_book.json @@ -32,6 +32,10 @@ "ref": "com.atproto.repo.strongRef" } }, + "path": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#path" + }, "tags": { "type": "ref", "ref": "sh.weaver.notebook.defs#tags" diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_defs.json b/crates/weaver-api/lexicons/sh_weaver_notebook_defs.json index 2085a9b..af58414 100644 --- a/crates/weaver-api/lexicons/sh_weaver_notebook_defs.json +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_defs.json @@ -163,6 +163,11 @@ } } }, + "path": { + "type": "string", + "description": "The path of the notebook.", + "maxLength": 100 + }, "renderedView": { "type": "object", "description": "View of a rendered and cached notebook entry", diff --git a/crates/weaver-api/src/app_bsky/actor.rs b/crates/weaver-api/src/app_bsky/actor.rs index 0c69f98..2e09d9b 100644 --- a/crates/weaver-api/src/app_bsky/actor.rs +++ b/crates/weaver-api/src/app_bsky/actor.rs @@ -2124,16 +2124,6 @@ fn lexicon_doc_app_bsky_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< properties: { #[allow(unused_mut)] let mut map = ::std::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "prioritizeFollowedUsers", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { - description: None, - default: None, - r#const: None, - }), - ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("sort"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { @@ -7111,9 +7101,6 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for StatusView<'a> { )] #[serde(rename_all = "camelCase")] pub struct ThreadViewPref<'a> { - /// Show followed users at the top of all replies. - #[serde(skip_serializing_if = "std::option::Option::is_none")] - pub prioritize_followed_users: std::option::Option, /// Sorting mode for threads. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs index 3fc1d1f..691dc9b 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs @@ -18,9 +18,6 @@ pub struct GetPostThreadOtherV2<'a> { #[serde(borrow)] pub anchor: jacquard_common::types::string::AtUri<'a>, - /// (default: false) - #[serde(skip_serializing_if = "std::option::Option::is_none")] - pub prioritize_followed_users: std::option::Option, } pub mod get_post_thread_other_v2_state { @@ -60,7 +57,6 @@ pub struct GetPostThreadOtherV2Builder<'a, S: get_post_thread_other_v2_state::St _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, - ::core::option::Option, ), _phantom: ::core::marker::PhantomData<&'a ()>, } @@ -80,7 +76,7 @@ impl<'a> GetPostThreadOtherV2Builder<'a, get_post_thread_other_v2_state::Empty> pub fn new() -> Self { GetPostThreadOtherV2Builder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: (None, None), + __unsafe_private_named: (None,), _phantom: ::core::marker::PhantomData, } } @@ -105,19 +101,6 @@ where } } -impl<'a, S: get_post_thread_other_v2_state::State> GetPostThreadOtherV2Builder<'a, S> { - /// Set the `prioritizeFollowedUsers` field (optional) - pub fn prioritize_followed_users(mut self, value: impl Into>) -> Self { - self.__unsafe_private_named.1 = value.into(); - self - } - /// Set the `prioritizeFollowedUsers` field to an Option value (optional) - pub fn maybe_prioritize_followed_users(mut self, value: Option) -> Self { - self.__unsafe_private_named.1 = value; - self - } -} - impl<'a, S> GetPostThreadOtherV2Builder<'a, S> where S: get_post_thread_other_v2_state::State, @@ -127,7 +110,6 @@ where pub fn build(self) -> GetPostThreadOtherV2<'a> { GetPostThreadOtherV2 { anchor: self.__unsafe_private_named.0.unwrap(), - prioritize_followed_users: self.__unsafe_private_named.1, } } } @@ -422,16 +404,6 @@ fn lexicon_doc_app_bsky_unspecced_getPostThreadOtherV2() -> ::jacquard_lexicon:: known_values: None, }), ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "prioritizeFollowedUsers", - ), - ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { - description: None, - default: None, - r#const: None, - }), - ); map }, }), diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs index e554a06..25e75df 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs @@ -27,9 +27,6 @@ pub struct GetPostThreadV2<'a> { ///(default: 10, min: 0, max: 100) #[serde(skip_serializing_if = "std::option::Option::is_none")] pub branching_factor: std::option::Option, - /// (default: false) - #[serde(skip_serializing_if = "std::option::Option::is_none")] - pub prioritize_followed_users: std::option::Option, ///(default: "oldest") #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] @@ -76,7 +73,6 @@ pub struct GetPostThreadV2Builder<'a, S: get_post_thread_v2_state::State> { ::core::option::Option>, ::core::option::Option, ::core::option::Option, - ::core::option::Option, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, @@ -94,7 +90,7 @@ impl<'a> GetPostThreadV2Builder<'a, get_post_thread_v2_state::Empty> { pub fn new() -> Self { GetPostThreadV2Builder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: (None, None, None, None, None, None), + __unsafe_private_named: (None, None, None, None, None), _phantom: ::core::marker::PhantomData, } } @@ -158,31 +154,18 @@ impl<'a, S: get_post_thread_v2_state::State> GetPostThreadV2Builder<'a, S> { } } -impl<'a, S: get_post_thread_v2_state::State> GetPostThreadV2Builder<'a, S> { - /// Set the `prioritizeFollowedUsers` field (optional) - pub fn prioritize_followed_users(mut self, value: impl Into>) -> Self { - self.__unsafe_private_named.4 = value.into(); - self - } - /// Set the `prioritizeFollowedUsers` field to an Option value (optional) - pub fn maybe_prioritize_followed_users(mut self, value: Option) -> Self { - self.__unsafe_private_named.4 = value; - self - } -} - impl<'a, S: get_post_thread_v2_state::State> GetPostThreadV2Builder<'a, S> { /// Set the `sort` field (optional) pub fn sort( mut self, value: impl Into>>, ) -> Self { - self.__unsafe_private_named.5 = value.into(); + self.__unsafe_private_named.4 = value.into(); self } /// Set the `sort` field to an Option value (optional) pub fn maybe_sort(mut self, value: Option>) -> Self { - self.__unsafe_private_named.5 = value; + self.__unsafe_private_named.4 = value; self } } @@ -199,8 +182,7 @@ where anchor: self.__unsafe_private_named.1.unwrap(), below: self.__unsafe_private_named.2, branching_factor: self.__unsafe_private_named.3, - prioritize_followed_users: self.__unsafe_private_named.4, - sort: self.__unsafe_private_named.5, + sort: self.__unsafe_private_named.4, } } } @@ -553,16 +535,6 @@ fn lexicon_doc_app_bsky_unspecced_getPostThreadV2() -> ::jacquard_lexicon::lexic r#const: None, }), ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "prioritizeFollowedUsers", - ), - ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { - description: None, - default: None, - r#const: None, - }), - ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("sort"), ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { diff --git a/crates/weaver-api/src/sh_weaver/notebook.rs b/crates/weaver-api/src/sh_weaver/notebook.rs index cd23db0..da8d1e9 100644 --- a/crates/weaver-api/src/sh_weaver/notebook.rs +++ b/crates/weaver-api/src/sh_weaver/notebook.rs @@ -600,6 +600,25 @@ fn lexicon_doc_sh_weaver_notebook_defs() -> ::jacquard_lexicon::lexicon::Lexicon }, }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("path"), + ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The path of the notebook.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(100usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("renderedView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { @@ -1815,6 +1834,8 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotebookView<'a> { } } +/// The path of the notebook. +pub type Path<'a> = jacquard_common::CowStr<'a>; /// View of a rendered and cached notebook entry #[jacquard_derive::lexicon] #[derive( diff --git a/crates/weaver-api/src/sh_weaver/notebook/book.rs b/crates/weaver-api/src/sh_weaver/notebook/book.rs index 89d9a7b..2203cbf 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/book.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/book.rs @@ -27,6 +27,9 @@ pub struct Book<'a> { pub entry_list: Vec>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] + pub path: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] pub tags: Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] @@ -87,6 +90,7 @@ pub struct BookBuilder<'a, S: book_state::State> { ::core::option::Option>>, ::core::option::Option, ::core::option::Option>>, + ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, @@ -106,7 +110,7 @@ impl<'a> BookBuilder<'a, book_state::Empty> { pub fn new() -> Self { BookBuilder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: (None, None, None, None, None, None), + __unsafe_private_named: (None, None, None, None, None, None, None), _phantom: ::core::marker::PhantomData, } } @@ -169,13 +173,32 @@ where } } +impl<'a, S: book_state::State> BookBuilder<'a, S> { + /// Set the `path` field (optional) + pub fn path( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `path` field to an Option value (optional) + pub fn maybe_path( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + impl<'a, S: book_state::State> BookBuilder<'a, S> { /// Set the `tags` field (optional) pub fn tags( mut self, value: impl Into>>, ) -> Self { - self.__unsafe_private_named.3 = value.into(); + self.__unsafe_private_named.4 = value.into(); self } /// Set the `tags` field to an Option value (optional) @@ -183,7 +206,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: Option>, ) -> Self { - self.__unsafe_private_named.3 = value; + self.__unsafe_private_named.4 = value; self } } @@ -194,7 +217,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: impl Into>>, ) -> Self { - self.__unsafe_private_named.4 = value.into(); + self.__unsafe_private_named.5 = value.into(); self } /// Set the `theme` field to an Option value (optional) @@ -202,7 +225,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: Option>, ) -> Self { - self.__unsafe_private_named.4 = value; + self.__unsafe_private_named.5 = value; self } } @@ -213,7 +236,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: impl Into>>, ) -> Self { - self.__unsafe_private_named.5 = value.into(); + self.__unsafe_private_named.6 = value.into(); self } /// Set the `title` field to an Option value (optional) @@ -221,7 +244,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: Option>, ) -> Self { - self.__unsafe_private_named.5 = value; + self.__unsafe_private_named.6 = value; self } } @@ -238,9 +261,10 @@ where authors: self.__unsafe_private_named.0.unwrap(), created_at: self.__unsafe_private_named.1, entry_list: self.__unsafe_private_named.2.unwrap(), - tags: self.__unsafe_private_named.3, - theme: self.__unsafe_private_named.4, - title: self.__unsafe_private_named.5, + path: self.__unsafe_private_named.3, + tags: self.__unsafe_private_named.4, + theme: self.__unsafe_private_named.5, + title: self.__unsafe_private_named.6, extra_data: Default::default(), } } @@ -256,9 +280,10 @@ where authors: self.__unsafe_private_named.0.unwrap(), created_at: self.__unsafe_private_named.1, entry_list: self.__unsafe_private_named.2.unwrap(), - tags: self.__unsafe_private_named.3, - theme: self.__unsafe_private_named.4, - title: self.__unsafe_private_named.5, + path: self.__unsafe_private_named.3, + tags: self.__unsafe_private_named.4, + theme: self.__unsafe_private_named.5, + title: self.__unsafe_private_named.6, extra_data: Some(extra_data), } } @@ -426,6 +451,15 @@ fn lexicon_doc_sh_weaver_notebook_book() -> ::jacquard_lexicon::lexicon::Lexicon max_length: None, }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("path"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#path", + ), + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tags"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { diff --git a/crates/weaver-appview/Cargo.toml b/crates/weaver-app-server/Cargo.toml similarity index 98% rename from crates/weaver-appview/Cargo.toml rename to crates/weaver-app-server/Cargo.toml index 42aa0b1..5df60a0 100644 --- a/crates/weaver-appview/Cargo.toml +++ b/crates/weaver-app-server/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "weaver-appview" +name = "weaver-app-server" version.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/weaver-appview/appview-config.toml b/crates/weaver-app-server/appview-config.toml similarity index 100% rename from crates/weaver-appview/appview-config.toml rename to crates/weaver-app-server/appview-config.toml diff --git a/crates/weaver-appview/build.rs b/crates/weaver-app-server/build.rs similarity index 100% rename from crates/weaver-appview/build.rs rename to crates/weaver-app-server/build.rs diff --git a/crates/weaver-appview/diesel.toml b/crates/weaver-app-server/diesel.toml similarity index 100% rename from crates/weaver-appview/diesel.toml rename to crates/weaver-app-server/diesel.toml diff --git a/crates/weaver-appview/migrations/.keep b/crates/weaver-app-server/migrations/.keep similarity index 100% rename from crates/weaver-appview/migrations/.keep rename to crates/weaver-app-server/migrations/.keep diff --git a/crates/weaver-appview/migrations/00000000000000_diesel_initial_setup/down.sql b/crates/weaver-app-server/migrations/00000000000000_diesel_initial_setup/down.sql similarity index 100% rename from crates/weaver-appview/migrations/00000000000000_diesel_initial_setup/down.sql rename to crates/weaver-app-server/migrations/00000000000000_diesel_initial_setup/down.sql diff --git a/crates/weaver-appview/migrations/00000000000000_diesel_initial_setup/up.sql b/crates/weaver-app-server/migrations/00000000000000_diesel_initial_setup/up.sql similarity index 100% rename from crates/weaver-appview/migrations/00000000000000_diesel_initial_setup/up.sql rename to crates/weaver-app-server/migrations/00000000000000_diesel_initial_setup/up.sql diff --git a/crates/weaver-appview/migrations/2025-05-15-230036_create_appviewdb/down.sql b/crates/weaver-app-server/migrations/2025-05-15-230036_create_appviewdb/down.sql similarity index 100% rename from crates/weaver-appview/migrations/2025-05-15-230036_create_appviewdb/down.sql rename to crates/weaver-app-server/migrations/2025-05-15-230036_create_appviewdb/down.sql diff --git a/crates/weaver-appview/migrations/2025-05-15-230036_create_appviewdb/up.sql b/crates/weaver-app-server/migrations/2025-05-15-230036_create_appviewdb/up.sql similarity index 100% rename from crates/weaver-appview/migrations/2025-05-15-230036_create_appviewdb/up.sql rename to crates/weaver-app-server/migrations/2025-05-15-230036_create_appviewdb/up.sql diff --git a/crates/weaver-appview/src/api_error.rs b/crates/weaver-app-server/src/api_error.rs similarity index 100% rename from crates/weaver-appview/src/api_error.rs rename to crates/weaver-app-server/src/api_error.rs diff --git a/crates/weaver-appview/src/config.rs b/crates/weaver-app-server/src/config.rs similarity index 100% rename from crates/weaver-appview/src/config.rs rename to crates/weaver-app-server/src/config.rs diff --git a/crates/weaver-appview/src/db.rs b/crates/weaver-app-server/src/db.rs similarity index 100% rename from crates/weaver-appview/src/db.rs rename to crates/weaver-app-server/src/db.rs diff --git a/crates/weaver-appview/src/main.rs b/crates/weaver-app-server/src/main.rs similarity index 100% rename from crates/weaver-appview/src/main.rs rename to crates/weaver-app-server/src/main.rs diff --git a/crates/weaver-appview/src/middleware.rs b/crates/weaver-app-server/src/middleware.rs similarity index 100% rename from crates/weaver-appview/src/middleware.rs rename to crates/weaver-app-server/src/middleware.rs diff --git a/crates/weaver-appview/src/models.rs b/crates/weaver-app-server/src/models.rs similarity index 100% rename from crates/weaver-appview/src/models.rs rename to crates/weaver-app-server/src/models.rs diff --git a/crates/weaver-appview/src/oauth.rs b/crates/weaver-app-server/src/oauth.rs similarity index 100% rename from crates/weaver-appview/src/oauth.rs rename to crates/weaver-app-server/src/oauth.rs diff --git a/crates/weaver-appview/src/routes/health_check.rs b/crates/weaver-app-server/src/routes/health_check.rs similarity index 100% rename from crates/weaver-appview/src/routes/health_check.rs rename to crates/weaver-app-server/src/routes/health_check.rs diff --git a/crates/weaver-appview/src/routes/login.rs b/crates/weaver-app-server/src/routes/login.rs similarity index 100% rename from crates/weaver-appview/src/routes/login.rs rename to crates/weaver-app-server/src/routes/login.rs diff --git a/crates/weaver-appview/src/routes/logout.rs b/crates/weaver-app-server/src/routes/logout.rs similarity index 100% rename from crates/weaver-appview/src/routes/logout.rs rename to crates/weaver-app-server/src/routes/logout.rs diff --git a/crates/weaver-appview/src/routes/mod.rs b/crates/weaver-app-server/src/routes/mod.rs similarity index 100% rename from crates/weaver-appview/src/routes/mod.rs rename to crates/weaver-app-server/src/routes/mod.rs diff --git a/crates/weaver-appview/src/routes/oauth.rs b/crates/weaver-app-server/src/routes/oauth.rs similarity index 100% rename from crates/weaver-appview/src/routes/oauth.rs rename to crates/weaver-app-server/src/routes/oauth.rs diff --git a/crates/weaver-appview/src/schema.rs b/crates/weaver-app-server/src/schema.rs similarity index 100% rename from crates/weaver-appview/src/schema.rs rename to crates/weaver-app-server/src/schema.rs diff --git a/crates/weaver-appview/src/state.rs b/crates/weaver-app-server/src/state.rs similarity index 100% rename from crates/weaver-appview/src/state.rs rename to crates/weaver-app-server/src/state.rs diff --git a/crates/weaver-appview/src/telemetry.rs b/crates/weaver-app-server/src/telemetry.rs similarity index 100% rename from crates/weaver-appview/src/telemetry.rs rename to crates/weaver-app-server/src/telemetry.rs diff --git a/crates/weaver-server/.gitignore b/crates/weaver-app/.gitignore similarity index 100% rename from crates/weaver-server/.gitignore rename to crates/weaver-app/.gitignore diff --git a/crates/weaver-server/Cargo.toml b/crates/weaver-app/Cargo.toml similarity index 98% rename from crates/weaver-server/Cargo.toml rename to crates/weaver-app/Cargo.toml index 6141eee..138c411 100644 --- a/crates/weaver-server/Cargo.toml +++ b/crates/weaver-app/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "weaver-server" +name = "weaver-app" version = "0.1.0" authors = ["Orual "] edition = "2021" diff --git a/crates/weaver-server/Dioxus.toml b/crates/weaver-app/Dioxus.toml similarity index 100% rename from crates/weaver-server/Dioxus.toml rename to crates/weaver-app/Dioxus.toml diff --git a/crates/weaver-server/README.md b/crates/weaver-app/README.md similarity index 100% rename from crates/weaver-server/README.md rename to crates/weaver-app/README.md diff --git a/crates/weaver-server/assets/dx-components-theme.css b/crates/weaver-app/assets/dx-components-theme.css similarity index 100% rename from crates/weaver-server/assets/dx-components-theme.css rename to crates/weaver-app/assets/dx-components-theme.css diff --git a/crates/weaver-server/assets/fonts/IBMPlexSans-Italic-VariableFont_wdth,wght.ttf b/crates/weaver-app/assets/fonts/IBMPlexSans-Italic-VariableFont_wdth,wght.ttf similarity index 100% rename from crates/weaver-server/assets/fonts/IBMPlexSans-Italic-VariableFont_wdth,wght.ttf rename to crates/weaver-app/assets/fonts/IBMPlexSans-Italic-VariableFont_wdth,wght.ttf diff --git a/crates/weaver-server/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf b/crates/weaver-app/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf similarity index 100% rename from crates/weaver-server/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf rename to crates/weaver-app/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf diff --git a/crates/weaver-server/assets/styling/entry-card.css b/crates/weaver-app/assets/styling/entry-card.css similarity index 100% rename from crates/weaver-server/assets/styling/entry-card.css rename to crates/weaver-app/assets/styling/entry-card.css diff --git a/crates/weaver-server/assets/styling/entry.css b/crates/weaver-app/assets/styling/entry.css similarity index 100% rename from crates/weaver-server/assets/styling/entry.css rename to crates/weaver-app/assets/styling/entry.css diff --git a/crates/weaver-server/assets/styling/main.css b/crates/weaver-app/assets/styling/main.css similarity index 100% rename from crates/weaver-server/assets/styling/main.css rename to crates/weaver-app/assets/styling/main.css diff --git a/crates/weaver-server/assets/styling/navbar.css b/crates/weaver-app/assets/styling/navbar.css similarity index 100% rename from crates/weaver-server/assets/styling/navbar.css rename to crates/weaver-app/assets/styling/navbar.css diff --git a/crates/weaver-server/assets/styling/notebook-card.css b/crates/weaver-app/assets/styling/notebook-card.css similarity index 100% rename from crates/weaver-server/assets/styling/notebook-card.css rename to crates/weaver-app/assets/styling/notebook-card.css diff --git a/crates/weaver-server/assets/styling/theme-defaults.css b/crates/weaver-app/assets/styling/theme-defaults.css similarity index 100% rename from crates/weaver-server/assets/styling/theme-defaults.css rename to crates/weaver-app/assets/styling/theme-defaults.css diff --git a/crates/weaver-server/assets/weaver_photo_sm.jpg b/crates/weaver-app/assets/weaver_photo_sm.jpg similarity index 100% rename from crates/weaver-server/assets/weaver_photo_sm.jpg rename to crates/weaver-app/assets/weaver_photo_sm.jpg diff --git a/crates/weaver-server/src/blobcache.rs b/crates/weaver-app/src/blobcache.rs similarity index 100% rename from crates/weaver-server/src/blobcache.rs rename to crates/weaver-app/src/blobcache.rs diff --git a/crates/weaver-server/src/cache_impl.rs b/crates/weaver-app/src/cache_impl.rs similarity index 100% rename from crates/weaver-server/src/cache_impl.rs rename to crates/weaver-app/src/cache_impl.rs diff --git a/crates/weaver-server/src/components/avatar/component.rs b/crates/weaver-app/src/components/avatar/component.rs similarity index 100% rename from crates/weaver-server/src/components/avatar/component.rs rename to crates/weaver-app/src/components/avatar/component.rs diff --git a/crates/weaver-server/src/components/avatar/mod.rs b/crates/weaver-app/src/components/avatar/mod.rs similarity index 100% rename from crates/weaver-server/src/components/avatar/mod.rs rename to crates/weaver-app/src/components/avatar/mod.rs diff --git a/crates/weaver-server/src/components/avatar/style.css b/crates/weaver-app/src/components/avatar/style.css similarity index 100% rename from crates/weaver-server/src/components/avatar/style.css rename to crates/weaver-app/src/components/avatar/style.css diff --git a/crates/weaver-server/src/components/css.rs b/crates/weaver-app/src/components/css.rs similarity index 92% rename from crates/weaver-server/src/components/css.rs rename to crates/weaver-app/src/components/css.rs index 3166aaa..a34c013 100644 --- a/crates/weaver-server/src/components/css.rs +++ b/crates/weaver-app/src/components/css.rs @@ -15,7 +15,7 @@ use jacquard::smol_str::SmolStr; #[allow(unused_imports)] use std::sync::Arc; #[allow(unused_imports)] -use weaver_renderer::theme::{Theme, ResolvedTheme}; +use weaver_renderer::theme::{ResolvedTheme, Theme}; #[cfg(feature = "server")] use axum::{extract::Extension, response::IntoResponse}; @@ -24,12 +24,12 @@ use axum::{extract::Extension, response::IntoResponse}; pub fn NotebookCss(ident: SmolStr, notebook: SmolStr) -> Element { rsx! { document::Stylesheet { - href: "{get_server_url()}/css/{ident}/{notebook}" + href: "{get_server_url()}/{ident}/{notebook}/css" } } } -#[get("/css/{ident}/{notebook}", fetcher: Extension>)] +#[get("/{ident}/{notebook}/css", fetcher: Extension>)] pub async fn css(ident: SmolStr, notebook: SmolStr) -> Result { use jacquard::client::AgentSessionExt; use jacquard::types::ident::AtIdentifier; diff --git a/crates/weaver-server/src/components/entry.rs b/crates/weaver-app/src/components/entry.rs similarity index 100% rename from crates/weaver-server/src/components/entry.rs rename to crates/weaver-app/src/components/entry.rs diff --git a/crates/weaver-server/src/components/identity.rs b/crates/weaver-app/src/components/identity.rs similarity index 100% rename from crates/weaver-server/src/components/identity.rs rename to crates/weaver-app/src/components/identity.rs diff --git a/crates/weaver-server/src/components/mod.rs b/crates/weaver-app/src/components/mod.rs similarity index 100% rename from crates/weaver-server/src/components/mod.rs rename to crates/weaver-app/src/components/mod.rs diff --git a/crates/weaver-server/src/fetch.rs b/crates/weaver-app/src/fetch.rs similarity index 100% rename from crates/weaver-server/src/fetch.rs rename to crates/weaver-app/src/fetch.rs diff --git a/crates/weaver-server/src/main.rs b/crates/weaver-app/src/main.rs similarity index 100% rename from crates/weaver-server/src/main.rs rename to crates/weaver-app/src/main.rs diff --git a/crates/weaver-server/src/views/home.rs b/crates/weaver-app/src/views/home.rs similarity index 100% rename from crates/weaver-server/src/views/home.rs rename to crates/weaver-app/src/views/home.rs diff --git a/crates/weaver-server/src/views/mod.rs b/crates/weaver-app/src/views/mod.rs similarity index 100% rename from crates/weaver-server/src/views/mod.rs rename to crates/weaver-app/src/views/mod.rs diff --git a/crates/weaver-server/src/views/navbar.rs b/crates/weaver-app/src/views/navbar.rs similarity index 100% rename from crates/weaver-server/src/views/navbar.rs rename to crates/weaver-app/src/views/navbar.rs diff --git a/crates/weaver-server/src/views/notebook.rs b/crates/weaver-app/src/views/notebook.rs similarity index 100% rename from crates/weaver-server/src/views/notebook.rs rename to crates/weaver-app/src/views/notebook.rs diff --git a/crates/weaver-server/src/views/notebookpage.rs b/crates/weaver-app/src/views/notebookpage.rs similarity index 100% rename from crates/weaver-server/src/views/notebookpage.rs rename to crates/weaver-app/src/views/notebookpage.rs diff --git a/crates/weaver-common/Cargo.toml b/crates/weaver-common/Cargo.toml index ca7e9a4..cc5250b 100644 --- a/crates/weaver-common/Cargo.toml +++ b/crates/weaver-common/Cargo.toml @@ -19,6 +19,7 @@ markdown-weaver = { workspace = true } http = "1.3.1" jacquard = { workspace = true } +jacquard-common = { workspace = true } trait-variant = "0.1" serde = { workspace = true } diff --git a/crates/weaver-common/src/constellation.rs b/crates/weaver-common/src/constellation.rs new file mode 100644 index 0000000..535e685 --- /dev/null +++ b/crates/weaver-common/src/constellation.rs @@ -0,0 +1,71 @@ +use jacquard::{ + CowStr, IntoStatic, XrpcRequest, + types::{ + did::Did, + nsid::Nsid, + string::{RecordKey, Rkey}, + }, +}; +use serde::{Deserialize, Serialize}; + +const DEFAULT_CURSOR_LIMIT: u64 = 16; +const DEFAULT_CURSOR_LIMIT_MAX: u64 = 100; + +fn get_default_cursor_limit() -> u64 { + DEFAULT_CURSOR_LIMIT +} + +#[derive(Clone, Deserialize, Serialize, XrpcRequest, IntoStatic)] +#[xrpc( + nsid = "blue.microcosm.links.getBacklinks", + method = Query, + output = GetBacklinksResponse, +)] +pub struct GetBacklinksQuery<'a> { + /// The link target + /// + /// can be an AT-URI, plain DID, or regular URI + subject: jacquard::types::uri::Uri<'a>, + /// Filter links only from this link source + /// + /// eg.: `app.bsky.feed.like:subject.uri` + source: CowStr<'a>, + #[serde(borrow)] + cursor: Option>, + /// Filter links only from these DIDs + /// + /// include multiple times to filter by multiple source DIDs + #[serde(default)] + did: Vec>, + /// Set the max number of links to return per page of results + #[serde(default = "get_default_cursor_limit")] + limit: u64, + // TODO: allow reverse (er, forward) order as well +} +#[derive(Deserialize, Serialize, IntoStatic)] +pub struct GetBacklinksResponse<'a> { + total: u64, + #[serde(borrow)] + records: Vec>, + cursor: Option>, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, IntoStatic)] +pub struct RecordId<'a> { + #[serde(borrow)] + pub did: Did<'a>, + pub collection: Nsid<'a>, + pub rkey: RecordKey>, +} + +impl RecordId<'_> { + pub fn did(&self) -> Did<'_> { + self.did.clone() + } + pub fn collection(&self) -> Nsid<'_> { + self.collection.clone() + } + pub fn rkey(&self) -> RecordKey> { + self.rkey.clone() + } +} diff --git a/crates/weaver-common/src/lib.rs b/crates/weaver-common/src/lib.rs index 4fcc173..e8572de 100644 --- a/crates/weaver-common/src/lib.rs +++ b/crates/weaver-common/src/lib.rs @@ -1,5 +1,6 @@ //! Weaver common library - thin wrapper around jacquard with notebook-specific conveniences +pub mod constellation; pub mod error; pub mod view; diff --git a/flake.nix b/flake.nix index 4d718f6..bdb1018 100644 --- a/flake.nix +++ b/flake.nix @@ -120,10 +120,10 @@ cargoExtraArgs = "-p ${name}-cli"; src = fileSetForCrate ./crates/weaver-cli; }); - weaver-server = craneLib.buildPackage (individualCrateArgs + weaver-app = craneLib.buildPackage (individualCrateArgs // { - pname = "${name}-server"; - cargoExtraArgs = "-p ${name}-server"; + pname = "${name}-app"; + cargoExtraArgs = "-p ${name}-app"; src = fileSetForCrate ./crates/weaver-server; }); weaver-renderer = craneLib.buildPackage (individualCrateArgs @@ -135,7 +135,7 @@ in { checks = { # Build the crates as part of `nix flake check` for convenience - inherit weaver-cli weaver-server weaver-renderer; + inherit weaver-cli weaver-app weaver-renderer; # Run clippy (and deny all warnings) on the workspace source, # again, reusing the dependency artifacts from above. @@ -189,7 +189,7 @@ packages = { - inherit weaver-cli weaver-server; + inherit weaver-cli weaver-app; } // lib.optionalAttrs (!pkgs.stdenv.isDarwin) { # weaver-workspace-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs // { @@ -202,7 +202,7 @@ drv = weaver-cli; }; weaver-server = flake-utils.lib.mkApp { - drv = weaver-server; + drv = weaver-app; }; }; @@ -210,10 +210,10 @@ # dioxus-cli = pkgs.dioxus-cli.overrideAttrs (_: { # postPatch = '' # rm Cargo.lock - # cp ${./crates/weaver-server/Dioxus.lock} Cargo.lock + # cp ${./crates/weaver-app/Dioxus.lock} Cargo.lock # ''; # cargoDeps = pkgs.rustPlatform.importCargoLock { - # lockFile = ./crates/weaver-server/Dioxus.lock; + # lockFile = ./crates/weaver-app/Dioxus.lock; # }; # }); cargoLock = builtins.fromTOML (builtins.readFile ./Cargo.lock); diff --git a/lexicons/actor/defs.json b/lexicons/actor/defs.json index f2ee1bb..6691e8a 100644 --- a/lexicons/actor/defs.json +++ b/lexicons/actor/defs.json @@ -111,11 +111,9 @@ "required": ["did"], "properties": { "did": { "type": "string", "format": "did" }, - "handle": { "type": "string", "format": "handle" }, - "displayName": { - "type": "string", - "maxGraphemes": 64, - "maxLength": 640 + "signature": { + "type": "bytes" + "description": "signed bytes of the corresponding notebook record in the author's repo" } } }, diff --git a/lexicons/notebook/book.json b/lexicons/notebook/book.json index d19c1a0..8de8b00 100644 --- a/lexicons/notebook/book.json +++ b/lexicons/notebook/book.json @@ -11,6 +11,7 @@ "required": ["authors", "entryList"], "properties": { "title": { "type": "ref", "ref": "sh.weaver.notebook.defs#title" }, + "path": { "type": "ref", "ref": "sh.weaver.notebook.defs#path" }, "tags": { "type": "ref", "ref": "sh.weaver.notebook.defs#tags" }, "authors": { "type": "array", diff --git a/lexicons/notebook/defs.json b/lexicons/notebook/defs.json index 2cdfd1d..46db449 100644 --- a/lexicons/notebook/defs.json +++ b/lexicons/notebook/defs.json @@ -104,6 +104,11 @@ "maxLength": 300, "description": "The title of the notebook entry." }, + "path": { + "type": "string", + "maxLength": 100, + "description": "The path of the notebook." + }, "tags": { "type": "array", "items": { diff --git a/weaver_notes/.obsidian/workspace.json b/weaver_notes/.obsidian/workspace.json index 1f8d5b1..98f1511 100644 --- a/weaver_notes/.obsidian/workspace.json +++ b/weaver_notes/.obsidian/workspace.json @@ -13,12 +13,12 @@ "state": { "type": "markdown", "state": { - "file": "Weaver - Long-form writing.md", + "file": "Arch.md", "mode": "source", "source": false }, "icon": "lucide-file", - "title": "Weaver - Long-form writing" + "title": "Arch" } } ] @@ -94,7 +94,7 @@ "state": { "type": "backlink", "state": { - "file": "Weaver - Long-form writing.md", + "file": "Arch.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -104,7 +104,7 @@ "unlinkedCollapsed": true }, "icon": "links-coming-in", - "title": "Backlinks for Weaver - Long-form writing" + "title": "Backlinks for Arch" } }, { @@ -170,9 +170,10 @@ }, "active": "f41bdf1f327c8668", "lastOpenFiles": [ + "Weaver - Long-form writing.md", + "Arch.md", "weaver_photo_med.jpg", "xkcd_345_excerpt.png", - "Weaver - Long-form writing.md", "light_mode_excerpt.png", "notebook_entry_preview.png" ] diff --git a/weaver_notes/Arch.md b/weaver_notes/Arch.md new file mode 100644 index 0000000..39b3df0 --- /dev/null +++ b/weaver_notes/Arch.md @@ -0,0 +1,22 @@ +## Viewer/minimal app + +#### Routes - names can be title/name or rkey, ident can be did or handle +/{ident}/{notebook}/{entry} - entry +/{ident}/{notebook}/{page} - page of entries +/{ident}/{notebook}/{chapter}/{entry|page} - entry/page in chapter +/{ident}/{notebook} - index/"cover page" +/{ident} - profile page + +/ - discover (later, home) + + +/record/{at-uri} - fallback viewer? +/post/{at-uri} - bsky post, anything similarly shaped +/leaflet/{pub}/{rkey} - leaflet +/blog/{at-uri} - whitewind, etc. +/feed/{at-uri} + + +/{notebook}/image/{name|cid} +/{notebook}/blob/{cid} +/{ident}/{notebook}/css \ No newline at end of file -- knotmirror 0.0.1