Implement the bDS2-compatible core Lua host API and generated docs #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Complete the core Lua scripting surface so user scripts can perform the same everyday project operations as bDS2, using RuDS engines rather than a parallel data layer.
Current state
crates/bds-core/src/scripting/mod.rsinstalls onlybds.app.log,bds.app.progress, andbds.app.toast.specs/script.alliumunderCoreHostApiCompatibilityis the normative method list.scripts/{slug}.lua. Do not introduce an extension setting.Required behavior
Expose the core namespaces and methods listed in
specs/script.allium:bds.appbds.projectsbds.metabds.postsbds.mediabds.scriptsbds.templatesbds.tagsbds.tasksbds.publishbds.chatbds.report_progress(payload)Bind project-scoped calls to the active project and delegate to existing core engines/query functions. Returned values must contain only serializable public fields. Use ISO-8601 timestamps and string enum values. Lookup/create/update failures return
nil; boolean command failures returnfalse, following the generated signature.Keep the current
bds.app.progressandbds.app.toasthelpers as additive APIs. Do not expose ambient filesystem, process, package-loading, or unrestricted host access.bds.sync,bds.embeddings, conversational chat, agents, and MCP are extension work and are out of scope.Documentation
Add one machine-readable method/type manifest and generate from it:
docs/scripting/Add a sync test that fails if the exposed capability names, manifest, or generated reference diverge. Do not maintain duplicate hand-written method inventories.
Implementation notes
docs/UI_STYLE_GUIDE.mdbefore any documentation/editor UI changes.../bDS2/lib/bds/scripting/capabilities.ex, its capability modules,api_docs.ex, and scripting API tests where the Allium contract is silent.Acceptance criteria
specs/script.alliumis callable from a Lua utility in the active project.allium check specs/*.allium,cargo fmt --all -- --check,cargo build --workspace, andcargo test --workspacepass.Implemented in commit
9a72287. The core Lua host now exposes the exact bDS2-compatible signatures with project scoping and fail-closed return values; rendered macros and Blogmark transforms receive the project host; Blogmark execution is cancellable; desktop bds.app capabilities delegate to the native shell; Lua reindexing is project-scoped; progress is reported once; and manifest-generated API/type docs, completions, and executable examples are bundled. bds.sync and bds.embeddings remain absent as extension-only work. Verified with Allium check/analyse, cargo fmt, workspace build, strict Clippy, and the complete workspace test suite.