08 — Authoring App

The BKA app the creator opens. Browser-first 4G app, Foundry-shaped (chat-with-doc + library + composer), tailored to publish-flow concerns.


Where it lives

One app, deployed once, shared across all creators. Each creator's data is in their own GitHub repos + lives transiently in their browser's OPFS-SQLite cache.


App surface — top-level navigation

Mirroring agicore-foundry's titlebar pattern:

┌────────────────────────────────────────────────────────────┐
│  ← apps    BKA — <handle>     [compose] [library] [stats]  │
│                                          [⌘K] [?]  [chip]  │
└────────────────────────────────────────────────────────────┘
│                                                             │
│  (active route)                                             │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Tabs (top-right):

Top-left: ← apps links back to binary-blender.com/apps (same as Foundry + andon-loop-demo)

Top-right helpers: command palette, help, UserChip


Compose tab (the heart of the app)

Borrowed wholesale from agicore-foundry's Library route — chat-with-doc with the <edit> + <create_document> tag protocol, just specialized for posts.

┌─────────────────────┬─────────────────────┬──────────────────────┐
│  Chat               │  Post editor        │  Right sidebar       │
│  - replies          │  - title input      │  - session picker    │
│  - composer         │  - markdown editor  │  - media uploads     │
│                     │  - live preview     │  - tags input        │
│                     │                     │  - publish button    │
└─────────────────────┴─────────────────────┴──────────────────────┘

Chat (left): the AI conversation. Uses the cross-app activeSessionStore so the session from Foundry/Community follows you here. The model can:

Same doc-edit-stream filter as Foundry/Library. Same prompt protocol. Same patterns.

Editor (center): markdown editor (CodeMirror). Above: title input. Below: live preview pane (toggleable).

The editor's content is the body of the draft. Title + metadata sit in fields above; tags + thumbnail picker sit in the right sidebar.

Right sidebar (tabs):


Library tab

Two-pane view of the creator's content:

┌──────────────────────────┬─────────────────────────────────┐
│  Filters                 │  Items                          │
│  - status:               │  - thumbnails or list view      │
│    [ ] draft             │  - one row per post/draft       │
│    [ ] published         │  - click to open in Compose     │
│    [ ] unpublished       │  - right-click for actions      │
│  - tag:                  │    (delete, unpublish, edit)    │
│    [ ] intro             │                                 │
│    [ ] code              │                                 │
│  - kind:                 │                                 │
│    [ ] post              │                                 │
│    [ ] video             │                                 │
└──────────────────────────┴─────────────────────────────────┘

Reads from both private repo (drafts) and public repo (published) via the local git-store cache. Lets the creator manage the full archive without leaving the app.

Media management:


Stats tab

A small dashboard showing:

CF Analytics requires the creator's CF token (already cached during onboarding). All requests browser-direct to CF API. No data aggregated server-side by us.


State + storage

Per-creator data (mirrored from GitHub via git-store)

Following the agicore-foundry git-canonical pattern (4G doc 13):

Two git-stores: one for the private repo, one for the public repo. Both use the same git-store/ library pattern, just with different repo URLs.

App-level state (browser, not git-backed)


Cross-app behavior

BKA is a peer of Foundry / Community / andon-loop-demo in the binary-blender stack:


Visual register

Per the per-audience-register feedback memory, BKA needs a register distinct from the four already named. Tentative: warm-publication.

To be finalized in a design pass once the layout is stubbed.


Component reuse from agicore-foundry

Specific files to copy/adapt (per the 4G stack pattern):

Foundry file BKA use
src/lib/google-auth.ts verbatim
src/store/authStore.ts verbatim
src/components/SignInGate.tsx verbatim
src/components/UserChip.tsx verbatim
src/store/activeSessionStore.ts verbatim
src/lib/git-store/* verbatim (with two store instances)
src/lib/github-sync.ts adapt for two-repo + Releases API
src/lib/auto-push.ts verbatim
src/lib/doc-edit-stream.ts verbatim
src/lib/chat-send.ts verbatim
src/lib/babyai-client.ts verbatim
src/components/Sidebar/ModelsPanel.tsx adapt for BKA's model picker
src/components/SessionPanel.tsx verbatim
src/components/GithubBackupModal.tsx mostly verbatim, repurposed for BKA's per-creator backup view

The principle: don't reinvent. The Foundry plumbing works. BKA is the next 4G app, not the first.


What's NEW in BKA (no Foundry precedent)

These pieces don't exist in Foundry and need fresh implementation:

Each is bounded; total new surface is manageable.


Mobile / tablet

v1 ships desktop-only browser. Mobile authoring is a real use case but adds touch composer + camera/voice capture concerns that deserve their own design pass. Deferred to post-v1.

The viewer site (the creator's public archive) IS mobile-friendly from day 1 — that's a viewer-template concern, not an authoring-app concern.