hero_office: OnlyOffice connector restructure + hero_os Office archipelago embed #1
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_office#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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
Turn
hero_officefrom a single-crate OnlyOffice+WebDAV connector into a proper Hero service, and embed the OnlyOffice editor surfaces (documents, spreadsheets, presentations, PDFs, diagrams) as apps inhero_osunder a new "Office" archipelago.Original instructions
Follow-ups during the session:
api.jsthat adapts to 5documentTypevalues —word,cell,slide,pdf,diagram.nu_servicepattern (scripts/nu_service.nu, modeled onservice_proxy.nu)./hero_office/ui" — fixed prefix handling (X-Forwarded-Prefix).hero_foundryis the newhero_fossil; use its context model" — swapped custom per-context fossil UDS code for hero_foundry's single-server REST API.x2thas no Mac build path, no prebuilt binary). Docker interim with shared JWT secret.What shipped
Workspace restructure (
hero_office/)Old single-crate axum app replaced with standard 4-crate Hero workspace under
crates/:hero_office_serverhero_office/rpc.sock— business logic + JWT signing + hero_foundry clienthero_office_sdkhero_rpc_derive::openrpc_client!macrohero_office_uihero_office/ui.sock— admin dashboard + 5 OnlyOffice wrapper surfaceshero_office_examples#[ignore]d integration testsPlus
buildenv.sh,scripts/nu_service.nu,README.md.Old
src/removed.cargo check --workspace --testspasses clean.Server (OpenRPC methods)
All hand-written in
crates/hero_office_server/openrpc.json, exposed asPOST /rpcover UDS (HTTP-over-UDS to match the rest of Hero):healthlist_contextsGET /api/contextson hero_foundrylist_documents(context, type_filter?)documentTypecreate_editor_session(context, filename)get_document(context, filename)save_document(key, download_url, filetype?)UI routes
Router-mounted under
/hero_office/ui/…:GET /admin/?context=…— Bootstrap 5.3.3 dashboard, per-type countsGET /{word|cell|slide|pdf|diagram}/?context=…— file browser filtered to that OnlyOffice documentType (the surfaces hero_os iframes)GET /{type}/edit/{filename}?context=…— loads OnlyOfficeapi.js, callsnew DocsAPI.DocEditor(...)with the signed configGET /files/{ctx}/{filename}— byte proxy for the OnlyOffice containerPOST /callback/{ctx}— OnlyOffice save callbackAll URLs go through a
forwarded_prefix()helper that honorsX-Forwarded-Prefix, so the same binary works behind hero_router or directly on its UDS.hero_os integration
crates/hero_os_app/src/registry.rs: addedofficehierarchical archipelago (5 inline islands — no per-app crate needed) modeled on the existing books/biz/voice pattern.island_content.rs: 5ExternalServiceIframematch arms, one per OnlyOffice documentType.Stub
hero_archipelagos/archipelagos/embed/office/crate left orphaned (not in workspace) — can be deleted.hero_foundry integration
Replaced the inlined PROPFIND/per-context UDS WebDAV client with a thin HTTP-over-UDS client targeting hero_foundry's single REST socket:
GET /api/contexts→ context discoveryGET /api/files/{ctx}/,GET /api/files/{ctx}/{f},PUT /api/files/{ctx}/{f}Populated
~/hero/var/foundry_storage/{demo,incubaid}/with sample docs (docx, pptx, csv, md, txt) for demo purposes.OnlyOffice runtime
Research conclusion (reported in thread): native Mac build of Document Server is multi-day because the
x2tC++ converter has no Mac build path. OrbStack-VM with apt install is viable but dep resolution on 25.10 failed; 24.04 would work but user opted to keep Docker as interim.Container runs:
JWT secret matches
ONLYOFFICE_JWT_SECRETin thehero_office_serveraction env.Socket layout
nu_service
scripts/nu_service.nuimplementsinstall | start [--reset] | stop | statusper thenu_serviceskill, modeled onservice_proxy.nu. Registers bothhero_office_serverandhero_office_uiactions with shared env (ONLYOFFICE_JWT_SECRET, OO_SERVER_URL, CONNECTOR_EXTERNAL_URL), ties them into a singlehero_officeservice viaservice.set.Status — live locally
http://localhost:9988/hero_office/ui/admin//hero_office/ui/word/?context=demo,/hero_office/ui/cell/?context=demo, …/hero_office/ui/word/edit/meeting-notes.docx?context=demo— renders OnlyOffice api.js; editing requires OnlyOffice container at:8081with matching JWT.Open items / follow-ups
x2tgets a Mac build path upstream.hero_osis_base.context.list,hero_office'slist_contextswill inherit richer metadata (names, descriptions) without code change here.hero_archipelagos/archipelagos/embed/office/stub (orphaned crate, not in workspace).hero_office_examples/tests/integration.rsare#[ignore]d; add CI wiring to run them against a live foundry+hero_office.openrpc_client!macro (which IS hero_rpc codegen, but applied to hand-writtenopenrpc.json, not OSchema). Migration to full OSchema pipeline (build.rs +hero_rpc_generator) is a clean follow-up that doesn't change the public API.Docs
README.mdupdated with socket layout, env vars, URL surface, and hero_os integration notes./hero_ui_dashboard,/hero_sockets,/hero_crates_best_practices_check,/web_embed, and/nu_serviceskills.🤖 Generated with Claude Code
Update 2026-04-20 — OnlyOffice container blocked on network
OnlyOffice Docs (
onlyoffice/documentserver~1.5 GB, arm64) couldn't pull on current link. Pull ran for 12h+ without acquiring the last layer; measured downstream ~50 KB/s on a neutral 100 MB test, which would be 8+ hours at best. Pull killed to stop wasting state.Everything hero_office-side is live and verified independently:
hero_routerautodiscovers bothhero_officesockets as healthy (ui=web, rpc=openrpc with all 6 methods parsed fromopenrpc.json)/hero_office/ui/{word,cell,slide,pdf,diagram}/?context=democreate_editor_sessionreturns a proper JWT-signed OnlyOffice config (verified in-thread —token,document.url,editorConfig.callbackUrlall point athost.docker.internal:9988/hero_office/ui/…per hero_router's prefix convention)demo,incubaid) — docx, pptx, csv, md, txtWhat remains: pulling the container on a faster connection and hitting the editor URL to confirm the iframe renders. This is a standalone OnlyOffice concern — the hero_office integration itself doesn't change based on that outcome.
Follow-ups for this task
docker pull onlyoffice/documentserveron a faster network and verify editor iframe loads at/hero_office/ui/word/edit/meeting-notes.docx?context=demoforge.ourworld.tf's container registry (lhumina_code/onlyoffice_documentserver) to avoid dockerhub pull times on fresh installsdx buildpanic inkratesre:herolib_ai/image-io; unrelated to these changesUpdate — herolib_ai/krates panic resolved ✅
Root cause:
krates0.17.5 (pinned bydx/dioxus-cli0.7) has a bug in its feature-graph builder — when a feature's activators are alldep:entries, the feature name never gets added to the resolved node's feature list. Later, a binary search looks up that feature name by string and panics onunreachable!().herolib_aihappened to hit it:image-io = ["dep:image", "dep:base64"].Fix
Minimal one-line workaround in
hero_lib: add an empty marker feature as a third activator, giving krates a non-dep:edge to follow.Functionally a no-op. The marker feature enables nothing.
Commits
lhumina_code/hero_lib@3ec721d3— the fixlhumina_code/hero_os@4323659— lockfile bump to pick it upVerified
make build-wasmnow completes cleanly: 286/286 crates compiled, wasm-bindgen ran, bundle produced attarget/dx/hero_os_app/debug/web/public.Follow-up removed from this issue
Item 3 ("Rebuild hero_os WASM blocked on herolib_ai panic") is resolved. Remaining follow-ups: OnlyOffice container pull (network) and image mirroring to forge.ourworld.tf.