-- allium: 1
-- bDS (Blogging Desktop Server) — Axiom Specification
-- Distilled from the existing bDS application at ../bDS2/
-- This is the behavioural baseline for the rewrite effort.

-- An offline-first desktop application for blog authoring with
-- static site generation, SSH publishing, AI integration, and
-- external tool integration via MCP.

-- Core domain
use "./project.allium" as project           -- Multi-project management
use "./post.allium" as post                 -- Post lifecycle, frontmatter, file layout
use "./media.allium" as media               -- Media import, thumbnails, sidecars
use "./translation.allium" as translation   -- Post and media translations
use "./tag.allium" as tag                   -- Tags with mass operations
use "./template.allium" as template         -- Liquid template management
use "./script.allium" as script             -- Scripting (macros, utilities, transforms)
use "./menu.allium" as menu                 -- OPML navigation menu
use "./metadata.allium" as metadata         -- Project config, categories, publishing prefs

-- Infrastructure
use "./search.allium" as search             -- FTS5 full-text search with Snowball stemming
use "./rendering.allium" as rendering       -- Template render assigns, filters, macros (preview + generation)
use "./generation.allium" as generation     -- Static site generation (sections, routes, hashing)
use "./preview.allium" as preview           -- Local HTTP preview server
use "./publishing.allium" as publishing     -- SSH upload (SCP / rsync)
use "./task.allium" as task                 -- Background task manager
use "./i18n.allium" as i18n                 -- Split localization (UI vs content)

-- UI
use "./layout.allium" as layout             -- App shell, activity bar, status bar, panels
use "./tabs.allium" as tabs                 -- Tab system, editor routing, preview/pin
use "./sidebar_views.allium" as sidebar     -- 10 sidebar views, content, behaviour
use "./modals.allium" as modals             -- Shared modals (AI suggestions, confirm, gallery)
use "./editor_post.allium" as editor_post   -- Post editor view and actions
use "./editor_media.allium" as editor_media -- Media editor view and actions
use "./editor_settings.allium" as editor_settings -- Settings + style views
use "./editor_tags.allium" as editor_tags   -- Tags view and colour picker
use "./editor_chat.allium" as editor_chat   -- Chat panel and model selector
use "./editor_script.allium" as editor_script   -- Script editor
use "./editor_template.allium" as editor_template -- Template editor
use "./editor_misc.allium" as editor_misc   -- Dashboard, menu, metadata diff, git diff, etc.

-- Flows and side-effects
use "./ui_data_flow.allium" as ui_data_flow -- Sidebar/editor/tab reactive coordination
use "./engine_side_effects.allium" as engine_side_effects -- CRUD side-effect chains
use "./action_patterns.allium" as action_patterns -- AI gating, translation chains, confirmations

-- Integration
use "./git.allium" as git                   -- Git operations, LFS, reconciliation
use "./import.allium" as wordpress_import   -- WordPress WXR analysis and execution
use "./mcp.allium" as mcp                   -- MCP server (tools, resources, proposals)
use "./cli.allium" as cli                   -- Headless automation commands
use "./events.allium" as events             -- Multi-client domain event bus
use "./server.allium" as server             -- Headless SSH engine host
use "./tui.allium" as tui                   -- Terminal renderer and remote client
use "./ai.allium" as ai                     -- AI one-shot tasks and chat
use "./embedding.allium" as embedding       -- Semantic similarity (HNSW vectors)
use "./cli_sync.allium" as cli_sync         -- CLI-to-app notification sync
use "./metadata_diff.allium" as metadata_diff   -- DB/filesystem diff and rebuild

-- Compatibility contract
--
-- MUST stay identical:
--   persistence semantics, post markdown frontmatter,
--   translation file naming, media sidecars, thumbnail conventions,
--   template file formats, menu OPML, generated routes/feeds/sitemaps,
--   full-text search behaviour, slug generation, metadata diff,
--   rebuild-from-filesystem
--
-- MAY change intentionally:
--   implementation language, desktop container, UI framework,
--   editor implementation, internal process model, runtime libraries

-- Resolved questions:
--
-- 1. Slug generation scope: only German and English letters are used.
--    Verify transliteration preserves the established bDS behaviour for
--    ä/ö/ü/ß/ÄÖÜ.
--
-- 2. Liquid subset: see template.allium for the exact subset.
--    Only 5 tags, 4 standard filters, 2 custom filters, 5 operators.
--    .size is property access on arrays, NOT a pipe filter.
--
-- 3. Macro calling convention: [[macroslug param1=value1 ...]]
--    Double-bracket syntax, not Liquid tags. Identical to current app.
--
-- 4. AI provider model: the rewrite uses two configurable OpenAI-compatible
--    endpoints (online + airplane mode) rather than a fixed named-provider set.
--    See ai.allium for details.
