Dasemu 196de21731 Fase 9 (1/N): re-host the semantic API onto the daemon
Ports the 38-operation semantic API from deps/db-sync's Cloudflare Worker
handler (handler/semantic.cljs + routes/semantic.cljs) onto the daemon's
own authoritative conn, per the plan's Fase 9. deps/db-sync itself is
untouched -- this only adds the daemon-side equivalent.

New:
- worker/semantic_routes.cljs: route table + OpenAPI 3.1.0 document
  generator, adapted from the CF-Worker's routes/semantic.cljs. Drops the
  :graph-id URL segment and listGraphs operation entirely -- the daemon is
  bound to a single repo per process (see db_worker_node.cljs's
  bound-repo), unlike the CF-Worker's per-graph Durable Objects, so every
  request implicitly targets the daemon's own bound repo. Security scheme
  is a bearer token (the daemon's actual session auth) instead of OAuth2.
- worker/handler/semantic.cljs: the 38 operations themselves, ported from
  the CF-Worker's handler/semantic.cljs. Adaptations from the original:
  * ensure-conn! (lazy SQLite conn open) -> worker.state/get-datascript-conn
    (the daemon already holds the authoritative conn for its bound repo).
  * broadcast-change! calls dropped entirely -- any transact! against the
    conn is already picked up by the listener worker.db-listener installs,
    which broadcasts to every connected client, so nothing here needs to
    push manually.
  * HTTP body reads (p/let + body-clj) dropped -- bodies arrive already
    JSON-parsed from the HTTP layer, and every operation is synchronous
    (DataScript itself is synchronous), so none of this needs promises.
  * http/bad-request, http/not-found, js/Response error helpers -> ex-info
    with :status/:code, matching every other thread-api in this codebase.
  * R2 asset storage -> platform/asset-write-bytes! (local filesystem),
    using the <uuid>.<type> naming convention components/block/asset.cljs
    already establishes. R2 signed URLs -> server-relative
    /v1/assets/:repo/:name paths (already served, with ETag caching, by
    the existing Fase 5 asset routes) since bearer-token auth already
    gates those with the same ?token= fallback semantic GET routes need.
  Registered as a single :thread-api/semantic-request thread-api
  dispatched by handler keyword, mirroring how the CF-Worker original
  dispatched via one big `case` in `handle`.
- db_worker_node.cljs: wires a /v1/semantic/* branch (JSON body parsed
  for most operations; raw bytes read directly for assets-create,
  mirroring the existing /v1/assets/:repo/:name PUT route) plus
  /v1/semantic/openapi.json. Unlike /v1/invoke -- an internal RPC
  transport whose transit-encoded results Logseq's own clients already
  know how to decode -- /v1/semantic/* is the public HTTP API documented
  by the OpenAPI doc and meant for arbitrary HTTP/MCP clients, so results
  are decoded server-side into plain JSON, the same way the existing
  /v1/assets/:repo/:name GET route already does for the other route with
  external HTTP consumers.
- src/test/frontend/worker/semantic_test.cljs: exercises pages,
  blocks/properties, capture, tags/tasks, search, the OpenAPI document,
  401-without-auth, and 404-on-unknown-route against a live daemon over
  real HTTP. 7 tests, 31 assertions.

Verification: all 5 shadow-cljs targets compile with 0 warnings. Full
`bb dev:test` run has zero regressions -- the only failures are the same
7 pre-existing, sandboxed-network-related persist_db_test.cljs failures
(ECONNREFUSED / Invalid URL) already documented as environmental in the
Fase 8 commit.

Found and fixed in-session: semantic_test.cljs originally set its own
LOGSEQ_DAEMON_USERNAME/PASSWORD env vars at namespace load time, colliding
with db_worker_node_test.cljs doing the same (both get bundled into the
same test.js process) -- whichever namespace loaded last won the race and
locked the other file's daemons out of their own bootstrapped credential,
cascading into ~150 unrelated failures. Fixed by reusing the same literal
credential constants instead of introducing a second one.

Known follow-up, not yet done: the plan's "consolidar MCP" half of Fase 9
-- an MCP JSON-RPC endpoint on the daemon (the CF-Worker's equivalent,
deps/db-sync/worker/entry.mjs, leans on @cloudflare/codemode's
openApiMcpServer plus ChatGPT-app-specific tooling that doesn't port to
Node) and the decision on electron/mcp_server.cljs's fate are still open.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-26 16:34:14 +02:00
2026-08-25 15:32:15 +02:00

Logseq

A privacy-first, open-source platform for knowledge management and collaboration



Download Logseq

forum chat on Discord follow on Twitter

latest release version

Table of Contents

🚀 Database Version

The Database version (DB version) of Logseq introduces DB graphs. See this page to get an overview of the main features for DB graphs. If you are an existing user, see changes with the DB version. The DB version has its own new mobile app (on iOS, with Android coming soon)! To participate in the mobile app alpha, please complete this brief form. The DB version also has a new sync approach, RTC (Real Time Collaboration)! You can use it to sync graphs between multiple devices or collaborate with others. To participate in the RTC alpha, please fill out this form.

The DB version is in beta status while the new mobile app and RTC is in alpha. This means that data loss is possible so we recommend automated backups or regular SQLite DB backups. We recommend you create a dedicated test graph and choose one project that’s not crucial for you.

To get started with the DB version:

  • To try the latest web version, go to https://app.logseq.com/.
  • To try the latest desktop version, go to https://github.com/logseq/logseq/releases/tag/nightly and download the artifact for your operating system.
  • To try the latest by building from the source code
    • Use test/db for stable releases. Fewer bugs and slower updates. Update frequency: days or weeks.
    • Use master for the latest updates as they are developed. Expect more bugs and faster changes. Update frequency: hours or days.
  • To report bugs, please file them at https://github.com/logseq/db-test/issues.
  • For feature or enhancement requests, please file them on Discord on the #db-feedback channel.
  • For discussions:
    • General ==> see the #db-chat channel in Discord.
    • Sync and RTC ==> see the #sync-test channel in Discord.
    • Mobile ==> see the #mobile-test channel in Discord.

🤔 Why Logseq?

Logseq is a knowledge management and collaboration platform. It focuses on privacy, longevity, and user control. Logseq offers a range of powerful tools for knowledge management, collaboration, PDF annotation, and task management with support for multiple file formats, including Markdown and Org-mode, and various features for organizing and structuring your notes.

In addition to its core features, Logseq has a growing ecosystem of plugins and themes that enable a wide range of workflows and customization options. Mobile apps are also available, providing access to most of the features of the desktop application. Whether you're a student, a professional, or anyone who values a clear and organized approach to managing your ideas and notes, Logseq is an excellent choice for anyone looking to improve their productivity and streamline their workflow.

logseq-demo

Download Logseq

👀 How can I use it?

To start using Logseq, follow these simple steps:

  1. Download the latest version of Logseq
  2. Install Logseq on your device and launch the application
  3. Start writing ✍️

That's it! You can now enjoy the benefits of using Logseq to streamline your workflow, manage your projects, and stay on top of your goals. Have fun! 🎉

Linux users: Use the automated installer script for the best experience:

# Download and run the installer
curl -fsSL https://raw.githubusercontent.com/logseq/logseq/master/scripts/install-linux.sh | bash

# Or install a specific version
curl -fsSL https://raw.githubusercontent.com/logseq/logseq/master/scripts/install-linux.sh | bash -s -- 0.10.14

# For user-specific installation (no root required)
curl -fsSL https://raw.githubusercontent.com/logseq/logseq/master/scripts/install-linux.sh | bash -s -- --user

📚 Learn more

🫶 Support Logseq Development

If you find Logseq useful and want to help us keep the project growing, please consider supporting our contributors on Open Collective. Your support shows our contributors that their efforts are appreciated and motivates them to continue their excellent work. Every contribution, no matter how small, helps us keep improving Logseq.

💡 Feature requests

We value your input on improving Logseq and making it more useful for you. If you have any ideas or feature requests, please share them in the Logseq Forum: Feature Requests section.

Your feedback helps us understand our users' needs and prioritize the features that matter most to you. We appreciate your time and effort in sharing your thoughts with us.

We appreciate your support, and we look forward to hearing your ideas!

🔌 Plugin API

Logseq provides a plugin API that enables developers to create custom plugins and extend the functionality of Logseq. The plugin API documentation is available at plugins-doc.logseq.com, where you can find everything needed to get started with plugin development.

We value your feedback and suggestions on how to improve our documentation. Please do not hesitate to contact us with any comments or questions. Your input helps us to provide a better experience for our users and developers.

Thank you for using Logseq, and we look forward to seeing what you create with our plugin API!

🌟 Contributing to Logseq

To start contributing to Logseq, please read CONTRIBUTING.md. There are ways to contribute with code and without code. We welcome all contributions, big or small, and we appreciate your time and effort in helping us improve Logseq. We look forward to your contributions 🚀

🛠️ Setting Up a Development Environment

If you want to set up a development environment for the Logseq web or desktop app, please refer to the Develop Logseq guide for macOS/Linux users and the Develop Logseq on Windows guide for Windows users.

In addition to these guides, you can also find other helpful resources in the docs/ folder, such as the Guide for Contributing to Translations, the Docker Web App Guide and the mobile development guide

🧰 Logseq CLI (Node)

Logseq CLI documentation is maintained in docs/cli/logseq-cli.md.

✨ Inspiration

Logseq is inspired by several unique tools and projects, including Roam Research, Org Mode, TiddlyWiki, Workflowy, and Cuekeeper.

We owe a huge debt of gratitude to the developers and creators of these projects, and we hope that Logseq can continue to build on their innovative ideas and make them accessible to a broader audience.

Thank you to all those who inspire us, and we look forward to seeing what the Logseq community will create with this tool!

Logseq is also made possible by the following projects:

  • Clojure & ClojureScript - A dynamic, functional, general-purpose programming language
  • DataScript - An immutable database and Datalog query-engine for Clojure, ClojureScript and JS
  • OCaml & Angstrom, for the document parser mldoc
  • isomorphic-git - A pure JavaScript implementation of Git for NodeJS and web browsers
  • SCI - A Small Clojure Interpreter

🙏 Thank You

We want to express our sincere gratitude to our Open Collective sponsors, backers, and contributors. Your support and contributions allow us to continue developing and improving Logseq. Thank you for being a part of our community and helping us make Logseq the best it can be!

💎 Sponsors

[Become a sponsor]

🌟 Contributors

Logseq - Your joyful, private digital garden | Product Hunt

Description
No description provided
Readme 27 MiB
Languages
Clojure 72%
OCaml 11.4%
JavaScript 7.1%
CSS 3.9%
Swift 1.6%
Other 3.9%