Skip to content

feat(desktop): ABI Desktop standalone local app#1070

Open
jravenel wants to merge 48 commits into
mainfrom
feat/abi-desktop-app
Open

feat(desktop): ABI Desktop standalone local app#1070
jravenel wants to merge 48 commits into
mainfrom
feat/abi-desktop-app

Conversation

@jravenel

@jravenel jravenel commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds ABI Desktop at libs/naas-abi/naas_abi/apps/desktop/: a lightweight Nexus-style local app (Chat + Code) with no Postgres/Docker dependency
  • Hexagonal harness layer (HarnessPort) with opencode and pi adapters; SQLite store; embedded Oxigraph graph; Monaco IDE + xterm terminal; Ollama probe in Settings
  • Vendored offline frontend assets (Monaco, xterm, marked); PyInstaller spec + build.md for macOS .app packaging
  • Comprehensive TDD suite with injectable seams and in-process fake opencode server

Closes #1069

Note: PR #964 adds a Code IDE section inside Nexus. This PR is a separate standalone desktop app with overlapping UX but different architecture (local-only, no naas_abi engine imports).

Test plan

  • uv run pytest libs/naas-abi/naas_abi/apps/desktop -v
  • uv run python libs/naas-abi/naas_abi/apps/desktop/run.py — verify Chat and Code sections load
  • Settings → Doctor shows workspace, graph, and harness health
  • With opencode on PATH: send a chat message and confirm SSE streaming
  • Code section: create/edit/save a file in Monaco; terminal connects
  • Optional: PyInstaller build per build.md and launch dist/ABI Desktop.app

jravenel added 2 commits July 10, 2026 01:02
Introduce a lightweight Nexus-style desktop app with Chat and Code sections,
opencode/pi harness adapters, SQLite persistence, embedded Oxigraph, Monaco IDE,
Ollama integrations, Settings, TDD coverage, and PyInstaller packaging.
Add native Finder drop bridge via pywebview, /api/files/import-local endpoint,
graceful shutdown, and web UI polish for file import feedback.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploying abi-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 33f5ddf
Status: ✅  Deploy successful!
Preview URL: https://d5fd1fa5.abi-docs-76c.pages.dev
Branch Preview URL: https://feat-abi-desktop-app.abi-docs-76c.pages.dev

View logs

jravenel added 27 commits July 10, 2026 01:06
ABI Desktop chat failed when opencode agents ran against phi and other
models without tool calling. Filter Ollama sync to tool-capable models,
validate at send time, dedupe stream errors, and seed opencode.json plus
env templates so workspace config is visible in the Code explorer.
Introduce canonical {workspace}/{org}/{model}/ paths for AGENTS.md, MEMORY.md, and RDF files, wire settings/API/graph/chat integration, and document the layout in an ADR.
Load system ontology TTL into the embedded graph, resolve chat/code
section routes via SPARQL, and document iteration-1 routing in ADR.
Load system BFO7 TTL plus routing vocabulary into Oxigraph, scaffold meaningful ontology/instances per org/model, and resolve harness agents from SPARQL on chat send.
Route composer intent to local or cloud models via instances.ttl realizabilities, expose POST /api/router/suggest, and show debounced suggestion chips in the chat UI.
Restore Ollama-to-instances sync, hermetic test isolation, Graph active-context panel with auto SPARQL, and automatic repair of corrupt context TTL so BFO7 routing works when ~/abi is the workspace.
…code chat

Add ABI branding assets, templates/slides seeding, Finder drag-drop import,
Code section live HTML preview, opencode binary path resolution, and a
reliable smoke_chat.sh (qwen2.5-coder, build agent, SSE complete exit).
Wire the rounded Nexus logo in the icon rail, chat empty state, favicon,
and macOS Dock icon via PyInstaller .icns and pywebview.start(icon=).
Match Nexus message bubbles, agent/model picker pills, expandable tool-call dropdown, and RAG/URL sources panels; persist sources in SQLite and stream them over SSE.
Restore --radius: 0 and zero out all border-radius reintroduced by the Nexus chat port, keeping only .avatar.user circular per design.
Skip pywebview and PyInstaller during daily development via --browser-only
or ABI_DESKTOP_BROWSER=1; document the workflow in AGENTS.md.
Expose GET /api/graph/overview to merge SQLite app data with Oxigraph routing triples and cross-store sync edges, with a Nexus-inspired Graph section (network canvas, detail table, SPARQL/Tables tabs).
Mirror bob ontology viewer patterns with search/filter highlighting, a slide-in inspector for node meta and relations, and richer overview node details for language models and BFO buckets.
Replace ephemeral port binding with a fixed localhost URL so browser
bookmarks and tabs survive restarts; add ABI_DESKTOP_PORT override,
port-in-use errors with PID, optional +1 fallback, and --reload support.
Split the flat desktop layout into clear layers so entry points, domain logic,
HTTP API, and static UI each have a home. Updates imports, PyInstaller datas,
and AGENTS.md without changing runtime behavior.
Move opencode and pi adapters out of harness/adapters/ into sibling
provider folders, document why harness/ sits beside api/ in hexagonal
layout, and add hermes/ stub with factory registration guidance.
Align bundled TTL folder naming with harness/ (singular) and update
resolve_system_ontology_paths, PyInstaller datas, docs, and tests.
Avoid flaky failures when ABI Desktop or another process holds port 54242
by monkeypatching DEFAULT_SERVER_PORT to a free ephemeral port in port tests.
Give ABI Desktop a proper README, scripts/test.sh for pytest + coverage,
coverage-kpi.sh for CI, make test-desktop, and hermetic port tests so the
suite stays reliable when port 54242 is already in use.
Expose GET /api/workspaces and POST /api/workspaces/open so users can switch
between on-disk project folders like VS Code/Cursor, with persisted recents
and Nexus-inspired topbar UI including browser and pywebview open-folder flows.
Places the clickable workspace name on the bottom status bar (VS Code/Cursor pattern), keeps the ABI logo in the icon rail, and opens the menu upward from the bar.
Move the status bar out of #main-col so it sits at the #app root like VS Code,
spanning edge-to-edge under the icon rail and section panel.
Reverts the status-bar switch control from def2ad7 so switching stays in the Nexus-style top-left control (logo + basename + chevron) while the full-width status bar only reflects workspace and git context.
Place the interactive workspace switcher in .rail-top (Nexus sidebar-top
pattern) and keep the status bar read-only. Top bar stays panel toggle
plus section title only.
Match Nexus UX: icon rail shows only the logo button (dropdown portal to
the right with glass card, Workspaces header, active checkmark). Workspace
basename and git branch live in the status bar as read-only context.
Rail navigation updates the location hash so refresh and back/forward restore the active section; settings tabs support #settings/<tab> and #ide aliases Code.
jravenel added 17 commits July 10, 2026 11:55
Replace vague group filters with bob_ontology.html bucket legend, node coloring, and inspector subclass navigation backed by new graph bucket/subclass APIs.
Classify every graph node into one of seven BFO buckets and use inline toolbar toggles instead of legacy group chips plus a redundant sidebar.
Decompose each chat into cross-bucket aspect nodes mapped from desktop-routing.ttl
(Process, Temporal, Material, Site, Information, Role, Quality) and paint nodes
with bob_ontology.html palette colors instead of generic blue dots.
Oxigraph and the dev UI break when multiple desktop processes share ~/.abi-desktop; acquire an instance lock, write server.json, and refuse to bind on a fallback port when ABI Desktop is already healthy on the default port.
Each chat and route process now emits six satellite bucket nodes plus the process hub, with shared deduplication and grey dashed unknown placeholders. Fixed vis.js layout uses server-side ring coordinates around AI System, and ABOX/TBOX/Full toggles drive the graph API view parameter.
Persist each occurrent as processes + process_aspects + shared aspect_entities,
sync on chat create, and drive the ABOX hub-and-spoke graph from SQLite rows
with shared dedup and unknown bucket placeholders.
Expose paginated /api/processes with seven BFO bucket columns and show a scrollable events log above the vis-network canvas in the Graph Overview tab, with row click focusing the matching process node.
Give the process log its own Events rail view with a full-height table,
detail panel, and #events routing; remove the cramped table from Graph
Overview and place the workspace logo above Settings in the rail bottom.
Introduce make dev-desktop and scripts/dev.sh so the browser dev server
survives agent shell exit, clears stale locks, and auto-restarts on crash.
Uvicorn reload now uses the create_app factory import path.
dev.sh start no longer stops a healthy server, uses start_new_session
for macOS detach, flock to prevent parallel start races, and adds status.
main.py exits 0 when ABI_DESKTOP_PORT is set and our app is already healthy.
Revert the iteration-8 move that placed the workspace switcher above
Settings; match Nexus sidebar-top pattern with Settings alone in rail-bottom.
Split Events into a Table rail (Events + SQLite sub-tabs), move the workspace explorer to a dedicated Files section, and add GET /api/tables for paginated SQLite browsing.
Use /api/tables/{name} in the frontend and tests to match the server endpoint shape.
Replace Events|SQLite sub-tabs with a single table-name nav and path-based
GET /api/tables/{name}; processes/events returns the 7-bucket event grid.
Replace the tree explorer with a Nexus-style file manager: toolbar actions,
path breadcrumbs, searchable list/grid views, preview split, and context menus.
Add mtime to /api/files entries for modified-date columns.
Centralize workspace change handling in onWorkspaceChanged() so logo
dropdown and settings save refresh files, tables, graph, chat, code,
status bar, and panel sidebars for the new workspace_root.
jravenel added 2 commits July 13, 2026 15:54
When default_model is unset and qwen2.5-coder is installed, persist
ollama/qwen2.5-coder:7b on Ollama sync and prefer it for chat fallback.
Code section prompts now tell the build agent to use filesystem tools
instead of dumping HTML in chat or writing to MEMORY.md. File listing
also skips broken symlinks that previously crashed the explorer API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(desktop): ABI Desktop standalone local app

1 participant