Skip to content

Gaps #21: add-ins, Office add-ins, VBA through an add-in, live co-editing and document chat - #1123

Open
sirmmo wants to merge 39 commits into
storytold:mainfrom
sirmmo:feat/plugin-host
Open

sirmmo wants to merge 39 commits into
storytold:mainfrom
sirmmo:feat/plugin-host

Conversation

@sirmmo

@sirmmo sirmmo commented Oct 13, 2026 •

Copy link
Copy Markdown

What this changes

GridCraft gets an add-in system and what is built on it:

  • plugin functions and commands;
  • Office (Office.js) add-ins;
  • VBA macros run by an external add-in;
  • live co-editing with document chat;
  • editing inside Nextcloud.

It fills gaps.md #21. The reference docs are docs/plugins.md (the protocol), docs/officejs.md (Office add-ins) and docs/collab.md (co-editing and chat). WordCraft (storytold/wordcraft#2586) and DeckCraft (storytold/deckcraft#919) get the same system, so one add-in can serve all three apps. The cross-app specs (co-editing, chat, add-in requirements, protocol 2.2) live in sirmmo/craft-collab.

The add-ins are separate programs in any language. GridCraft starts them and talks JSON-RPC 2.0 over stdin/stdout, so an add-in that crashes, hangs or answers badly costs a cell an error value, never the workbook. That follows the never-crash rule: timeouts, restarts, failed after 3 failures, bounded input everywhere, no panics. Everything is a command: the add-ins' features are reachable from the UI, the CLI, MCP and the control channel, and programmatic calls never open dialogs.

Step by step

The commits are grouped by feature. Each builds and passes the gates on its own:

  1. Add-ins, protocol 1 (1f36da7, 98c053b, d439ba0, 17759bb, db41d50, 1d8398f, 1eee7d5, 4fb1ed1):
    • Plugins add formula functions and commands. Function results are cached per argument list. Commands answer with engine commands, run as one undo step.
    • Ribbon groups and context-menu items.
    • Automate › Add-ins and Options › Add-ins, to turn plugins on and off.
    • Install from GitHub: the release zip is picked by platform, with size and path limits, and you're asked to confirm first.
    • One plugin can serve several apps (apps, uiFor, host.id).
    • Commands see the selection's formulas and the workbook's sheets and names.
    • Plugin functions are suggested while typing and listed in Insert Function.
    • A plugin that exits says why.
  2. Office add-ins (df386fb, 249a47d, 2f721c6):
    • Office manifests (manifest.xml) load as add-ins whose task panes open in a web view (macOS and Windows), through the office.sync bridge.
    • crates/office-js is a Rust/wasm replacement for Office.js (the Excel namespace).
    • crates/office-js/bootstrap.js is the repo's one hand-written JavaScript file, approved by the project owner as the single exception to Rust-only.
  3. Protocol 1.1, VBA and the Developer tab (c3cc5b2, 9e562fb):
    • Host requests: an add-in can ask GridCraft for things while it works (host/sync, the VBA project, messages, log), all in the same undo step.
    • Macros: a macro add-in brings Visual Basic, Macros, Record Macro and Macro Security. The VBA interpreter is the external, separately released add-in craft-vba.
    • Ribbon buttons that run macros are saved as the workbook's customUI14.xml.
    • A workbook with macros saves as .xlsm (.xltx as .xltm) instead of losing them.
  4. Protocol 1.2 (ac4bda7): add-ins return dialogs that GridCraft draws (lists, forms, messages, chained), can open files, and hear when workbooks open, save and close; context.document.
  5. Co-editing, protocol 2 (085723b, 19fd81b, 7b55cce, dbeb957):
    • The push channel: add-ins can send messages at any time.
    • Native co-editing on Yjs (yrs, MIT): rows and columns have stable ids, so inserts don't shift anyone's references.
    • Undo is per person, with presence, optional end-to-end encryption (AES-256-GCM) and recovery.
    • Transports are add-ins (MQTT, a local relay, Nextcloud).
    • Share and the people's circles are in the title bar; others' selections show in their colours, with name tags.
  6. Add-in requirements, manifest 1.3 (946ab4f, d9f659b): add-ins can require app versions, protocol features and other add-ins with version ranges. Unmet ones are blocked with the reason, with Install Missing; Office add-ins' requirement sets are checked.
  7. Office.js fixes from Microsoft's samples (e15933b, 9ba50f4):
    • Microsoft's own office.js, which sample pages load, can no longer replace ours; on Windows its hosts resolve to nothing.
    • ExecuteFunction ribbon commands work, colour names are accepted, and more of the common API is in.
  8. Microsoft's samples in the real app (c0e1f43, abb5b24, 5fda225):
    • cargo xtask office-samples drives Microsoft's hosted add-in samples in GridCraft's real task-pane web view through the control channel (office.panes, office.eval).
    • It found and fixed a real bug: Office.onReady fired before the page's HTML was parsed on macOS.
  9. Document chat (1ae23cf): a chat panel beside the workbook, shared live and saved inside the .xlsx (/craft/chat.json) until someone clears it explicitly.
  10. Editing inside Nextcloud (d46c339): the web build can be the editor that craft-live, a WOPI server for Nextcloud Office, embeds, with live co-editing between browser and desktop.
  11. Protocol 2.2 (3e325c1):
    • Plugin functions know their workbook: functions/call carries document.
    • A just-opened workbook is announced before its first calculation.
    • Dialogs get multi-line code fields.
    • Functions can return a blank cell, range.setValues can write literal text, and a plugin can invalidate its cached results.

Docs, gaps, ROADMAP and the parity checklists are updated with their timestamp lines and revision histories.

Add-ins that work with this today

  • craft-vba: VBA macros, the recorder and ribbon callbacks.
  • gridcraft-r: R formulas, statistics, scripts and plots.
  • craft-python: Python formulas and scripting with a doc API.
  • craft-dotnet: .NET add-ins, with source compatibility for Office interop/VSTO and Excel-DNA-style UDFs.
  • craft-nextcloud: Nextcloud files, local backups and locking.
  • craft-collab: co-editing transports (craft-mqtt) and conformance tests.

Testing

  • Gates: cargo fmt, clippy with -D warnings, the workspace tests, and xtask layers, assets and wasm all pass.
  • New tests:
    • engine tests with fake add-in processes for each protocol level;
    • co-editing convergence fuzzing with 2, 3 and 4 sessions;
    • replay of the shared conformance transcripts;
    • Office.js library tests (wasm-bindgen) and a Node test of bootstrap.js;
    • kittest UI tests for dialogs, the title bar and chat;
    • the craft-live web client end to end against craft-live's fake Nextcloud.
  • Microsoft's Excel samples in the real app, on macOS and Windows (GitHub runners, WKWebView and WebView2), all as expected:
    • hello world, add-in commands (pane button and ExecuteFunction), save/read custom settings and keyboard-shortcut actions pass;
    • custom functions are blocked with their reason;
    • Microsoft's office.js is confirmed never to run.
  • Built for macOS and Windows on the fork's CI.
  • Not yet verified by hand:
    • co-editing between two machines;
    • craft-live inside a real Nextcloud.

Notes for reviewers

  • The branch includes storytold/gridcraft's main up to today (merged, not rebased).
  • The fork-only test workflows (test builds, Office samples) are not part of this branch.
  • Clean room: nothing from Microsoft's Office (no assets, files or code); Office.js and VBA behaviour comes from public documentation.
  • Mostly new code in new crates (crates/plugin, crates/collab, crates/office-js) plus engine commands and UI panels. Existing behaviour changes only in that workbooks with macros save as .xlsm, and in the title bar's right side, which now holds Share. Export moved to the More menu.

🤖 Generated with Claude Code

sirmmo and others added 3 commits October 13, 2026 16:24
Plugins are separate programs speaking JSON-RPC 2.0 over stdio, described
by plugin.json. They add formula functions (via calc::external, cached
unless volatile, with timeouts, restarts and a failed state), commands
that answer with engine commands run as one undo step with rollback,
ribbon groups on built-in or new tabs, and items in the cell, row,
column and sheet-tab menus.

- crates/plugin (L4): manifest, process host, wire values, example plugin
- engine: plugins.list/load/unload/run; home.addIns lists plugins
- ui-egui: Automate › Add-ins dialog, plugin_ui (ribbon and menus)
- apps: --plugin DIR, GRIDCRAFT_PLUGIN_PATH, settings plugins folder
- docs: plugins.md; architecture, gaps, roadmap, parity, CLI, ROADMAP

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
File › Options lists the installed plugins with a documentation link
(manifest `homepage`, `author`) and Activate / Deactivate. A plugin turned
off stays listed but loses its functions, commands, ribbon and menu items,
and its process stops; prefs.json remembers it. New commands
plugins.setEnabled and plugins.openHomepage.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…d-in list

plugins.install {url, dir?} downloads a plugin from GitHub (release asset
for this platform, else the source zipball), unpacks it safely into the
plugins folder and loads it. Options › Add-ins and the Add-ins dialog get
an install field with a confirmation step, and full-width plugin cards.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Harrison-Booth

Copy link
Copy Markdown
Contributor

Use case from a finance/PE user, in case it helps shape the plugin API. The add-ins I rely on in Excel, Word and PowerPoint are the Claude and ChatGPT Office add-ins (Office.js task panes) and Macabacus (formatting, auditing and Excel-to-PowerPoint/Word linking). Anything in this space is what keeps me on Excel.

Two questions: is Office.js add-in compatibility a goal, or is the plugin API intended to replace it? And would the plugin protocol be able to cover Macabacus-style features like formatting shortcuts and model auditing? I'd be happy to build a small plugin as a test once this lands.

@sirmmo

sirmmo commented Oct 14, 2026 •

Copy link
Copy Markdown
Author

I am already looking into the integration of office.js add-ins, as it is very broad. The idea is to keep the "native" protocol and add the office.js wrapper to make that compatible. Some elements could be natively replaced, but I think that it could be a next step.

Consider that the add-in system I am working on is shared across all three apps (word,grid and deck).

sirmmo and others added 8 commits October 14, 2026 07:52
The manifest and protocol are now the craft plugin protocol WordCraft
speaks too: `apps` names the apps a plugin is for (others refuse it),
`uiFor.gridcraft` replaces `ui` when present, `initialize` carries
`host.id`, and the process gets CRAFT_HOST and CRAFT_PLUGIN_DIR. The
install record is `.craft-source.json`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ffice.sync, task panes)

An Office add-in's manifest.xml loads as a plugin: its ribbon buttons,
menus and cell items are plugin items and its commands open its task
pane (or call a function) instead of starting a process. office.sync
runs one context.sync() of the pane (paths from the workbook to ranges,
formats, worksheets, the common API's selection and settings) as one
undo step, bounded by the manifest's permissions. ui-egui shows the
pane and pumps its messages through Services::office; the desktop app
hosts the page in a wry web view on macOS and Windows. docs/officejs.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…and wasm-clean install.rs

The bootstrap defines stand-ins for Office and Excel that hold the
page's first calls until the wasm library is ready, then hands them
over (Office.initialize included). Approved by the owner as the single
hand-written JavaScript exception (docs/officejs.md).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…loper tab

Plugins may ask the host while they work (host/sync with the Office
bridge's object paths, the workbook's vbaProject.bin, messages, log);
all of it is one undoable step, taken back if the plugin fails. A
plugin declaring "macros": {"language": ...} answers macros/* and
brings the Developer tab: Visual Basic (modules in an editor), Macros
(run, edit, create), Record Macro, Macro Security (prompt by default,
with the Enable Content bar). The language lives in the add-in
(craft-vba for VBA); GridCraft draws the interface. Also: the bridge
reads the model's RGB colours as #RRGGBB.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…t in the message)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
context.formulas sits next to context.values: each cell's formula text
("=B2*1.1"), or null for a cell without a formula. Plugins can then tell
inputs from calculations, which colour coding and model auditing need
(hard-coded numbers in blue, formulas in black, links to other sheets in
green).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
context.activeSheet, context.sheets ([{index, name, visibility, usedRange}],
hidden sheets included) and context.names ([{name, scope, hidden,
refersTo}], at most 10,000 with namesTruncated) next to the selection.
document.inspect already computes these; plugins couldn't see them, so
they couldn't unhide every sheet, list sheets, clean up names or trim used
ranges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Harrison-Booth

Copy link
Copy Markdown
Contributor

Awesome - good to know. This would cover addins that i would like to see (Claude + ChatGPT). In the meantime, i'm working on a macabacus style plugin on the craft protocol. Happy to test the wrapper against some real excel files/ppts when it is ready. Love what you're doing here!

sirmmo and others added 13 commits October 14, 2026 15:20
… .xlsm

- The workbook's ribbon part (customUI14.xml / customUI.xml) is modelled when it
  is tabs, groups and macro buttons (model::Ribbon, xlsx custom_ui.rs): read,
  edited and written back, so Excel shows the buttons too. A richer ribbon stays
  kept content; its buttons still show and run.
- developer.ribbon / addRibbonButton / editRibbonButton / removeRibbonButton /
  pressRibbonButton; macros/run gets the button as control {id, tag}
  (Sub Go(control As IRibbonControl)).
- UI: the workbook's buttons on their tabs (built-in or their own), Developer ›
  Ribbon Buttons, Add to Ribbon in the Macros window.
- file.save writes a workbook with macros as .xlsm (.xltx as .xltm) instead of
  dropping them, and says so (renamedFrom); autosave covers .xlsm.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… in Insert Function

formulas::function_list() adds the enabled plugins' functions (category Add-ins,
their signature and description) to the built-in ones; the formula editor's
autocomplete and argument hint read them each time, so they follow plugins being
loaded, turned off and unloaded.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Plugin commands see the selection's formulas (context.formulas)
Plugin commands see the workbook's sheets and names
…ent events)

Implements the craft plugin protocol 1.2 shared with WordCraft, DeckCraft
and craft-nextcloud:

- initialize: host.features ["dialogs","open","events","document"] and
  host.language (the UI language, BCP 47).
- context.document {path, name, dirty} in commands/run, and a brief context
  (workbook, sheet, active, selection, document) in macros/run.
- Command results `open` and `dialog` (gridcraft_plugin::dialog): validated
  as hostile input, truncated at the spec's limits, malformed ones fail the
  command; a dialog may only run the plugin's declared commands. The open
  path must be absolute, an existing regular file GridCraft opens, checked
  before the step runs. plugins.run returns both; from the UI (ribbon,
  menus, Add-ins, a dialog's OK/buttons) run_or_alert opens the file via
  the normal open path (label in the status bar) and draws the dialog
  (list with icons, filter over 20 items, multi-select; form with
  text/secret/number/checkbox/choice; message) with theme tokens, chaining.
- Manifest `events` and events/documentOpened|documentSaved|documentClosed
  sent after the fact from a worker thread (30 s / 5 s), never holding up
  the open, save or close; not for AutoSave; documentClosed on file.close
  and on quit (best effort, 5 s); host/sync and host/vbaProject refused
  with AccessDenied during an event; answers shown in the status bar,
  errors in the info bar.
- Tests: plugin unit tests, engine plugin_protocol test (fake plugin
  binary), UI test that a ribbon button's dialog shows and its OK runs the
  next command, with combined message/result/dialog fields.
- Docs: plugins.md Protocol 1.2 section and manifest `events`; gaps.md,
  ROADMAP progress log.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…, collab.* commands

- crates/plugin: a continuous reader per plugin process; notifications and anytime
  requests (collab/snapshot, host/log) go to a queue the app drains (push.rs), answers
  still go to the waiting request; notify/respond without the connection's lock; 64 MiB
  lines, flood cut-off; host.features push/collab, host.collab; manifest `collab`;
  `collab.join` in command results.
- crates/collab (L3, wasm-safe): the workbook as a Yjs document (GridCraft schema 1 on
  yrs, matching craft-collab 2.0.1: block ids ~b.i, first-occurrence dedup, names,
  styles by content hash), one transaction per committed command by diffing, remote
  updates mapped back incrementally, per-user undo (yrs UndoManager), awareness
  (y-protocols), AES-256-GCM, gap holding, foreign-meta refusal.
- crates/engine: rooms, collab.share/join/leave/status/setUser, Session::collab_poll,
  per-user Undo/Redo in a room, read-only while joining, recovery, in-memory transports.
- Tests: replica convergence fuzz (2 and 3 peers, reordered and duplicated updates),
  engine command-sequence convergence fuzz, craft-collab conformance transcripts,
  a fake relay transport through the push channel, loopback end to end.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…d selections, docs

- Review tab Share group (Start Live Session, Join, Leave) and the Share dialog.
- Status bar: the session's state and the people in it; others' selections drawn in
  their colours with name tags; others' edits highlighted for two seconds.
- The desktop app keeps rooms' state in <settings>/recovery every 30 s.
- docs/collab.md (schema 1, normative, and behaviour); plugins.md Protocol 2 section;
  gaps.md, ROADMAP.md, architecture.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Title bar: Share at the right end. Not in a session it opens the Share dialog; in one it
  shows the state (green live, amber connecting/joining, grey offline) and opens the session
  popover (room, state, transport, encryption, people with "(you)", Copy invitation, Leave).
- The session's people as overlapping circles (initials on their colour, black or white text),
  at most four then "+N", yourself last; hover names, click goes to their selection (switching
  sheet) and flashes it.
- Narrow windows: the theme switch, Comments and Search give way, then circles; the title is
  truncated with "…" between the controls. Full screen on macOS drops the traffic-light gap.
  Export / Save a Copy moved to the title bar's More commands.
- Share dialog: the transport's own Start / Join from an Invitation, or a room by name; with no
  transport add-in it explains, names craft-mqtt (sirmmo/craft-collab) and opens Add-ins.
- A transport command's collab.join is now joined by the interface; result.link kept as the
  room's invitation.
- Review › Share group removed (collab.* commands unchanged); the status bar keeps only
  read-only reasons and problems. Theme tokens presence_online / presence_connecting.
- Tests: title_bar_share.rs (kittest, in-memory peers), circle/initials/contrast and
  title-bar planning unit tests. Docs: collab.md, ui-parity.md, gaps.md, ROADMAP.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sirmmo and others added 2 commits October 15, 2026 15:02
Manifests gain `requires` (apps, protocol, features, other add-ins with
Cargo-style version ranges). All installed add-ins are resolved together:
unmet requirements block an add-in with structured reasons (its functions,
commands and ribbon items absent), required add-ins start first, cycles and
chains deeper than 8 are blocked, and blocking re-evaluates on install,
load, turning on/off, unload and failure. initialize gains host.protocol
and addins. plugins.list reports state/blockedBy/requires/requiredBy;
new plugins.requirements and plugins.installMissing; plugins.install gains
withRequirements, force and version (newest release whose tag is in range);
plugins.load refuses out-of-range updates unless force. Office add-ins'
<Requirements> sets and methods are checked against Office.js's table.
UI: blocked add-ins show why with Install Missing, the install flow offers
the required add-ins, and turning off a needed add-in asks first.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sirmmo and others added 4 commits October 15, 2026 19:28
…ople circles and name tags

Selections on a sheet with no row/column ids, and past the last ones, travel
in awareness as the deterministic block ids (~<block>.<i>) those rows and
columns would get; readers resolve blocks they don't have yet. Nothing is
written to the document (schema 1 clarified in craft-collab ea58f3e).
People circles are slightly larger with less overlap and clearer initials.
Name tags sit above the selection's top edge (in the column headers at the
top of the view), fade 3 s after the person last moved, and come back on
hover over their outline.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Two threads refreshing at once could let the older snapshot win (found while porting
manifest 1.3 to DeckCraft).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Microsoft's office.js never runs in a task pane: the bootstrap gives
  <script>s from its CDNs (and npm copies) an empty script, whether parsed
  or made by the page's code, and defines Office/Excel/OfficeExtension/
  OfficeRuntime as non-replaceable accessors that hold early calls
  (onReady, Excel.run, initialize, actions.associate) until the wasm
  library adopts them; a foreign Office assigned anyway is ignored (its
  initialize is kept).
- office.sync accepts the 148 CSS colour names (any case) and #RGB
  wherever it takes #RRGGBB; reads still answer #RRGGBB.
- ExecuteFunction commands end to end: the control id is kept from the
  manifest; the function file loads hidden, the library says it's ready,
  then __craftOfficeRunFunction calls the associated (or global) function
  with event.source.id and event.completed(); the host waits up to 5
  minutes and reports functions that are missing, throw or never finish.
- Common API: context.host, new Excel.RequestContext(), the enums from
  the API reference (EventType, Index, GoToType, HostType, CoercionType,
  StartupBehavior, BindingType...), set({...}) on proxies, worksheets.add()
  without a name (next SheetN, at the end, active sheet kept), initialize
  assigned late, DocumentSelectionChanged handlers, NotSupported/
  NotImplemented answers for missing *Async, Office.addin, Office.ribbon.
- AddinCommands 1.1 and DocumentEvents 1.1 reported; ExcelApi 1.4
  documented as the subset it is.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…hosts to nothing

As DeckCraft does: WebView2 gets --host-resolver-rules for the two CDN hosts, keeping wry's
default arguments. On macOS the bootstrap stays the only guard.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sirmmo and others added 6 commits October 16, 2026 12:38
…l app

- Control channel: office.panes, office.open, office.close and office.eval
  (runs JavaScript in an add-in's page; Promises awaited; the answer comes back
  through the page's IPC channel, with a timeout and a 1 MiB bound), through a
  new OfficeHost::eval and office_pane::EvalRouter; the wry host routes answers.
- bootstrap.js: read-only __craftOfficeInfo (Office is GridCraft's, blocked
  office.js script URLs).
- cargo xtask office-samples: starts the app per scenario on a fresh profile,
  loads each hosted sample manifest, opens its pane, checks the page's Office,
  clicks the sample's buttons, checks the workbook, runs ExecuteFunction, takes
  screenshots, writes results.json and summary.md; crashes are reported and the
  next scenario gets a fresh app. Scenario table with must-pass and
  expected-unsupported checks; --dry-run drives a fake app.
- Docs: officejs.md "Testing with Microsoft's samples", control-protocol.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Document chat (craft-collab docs/chat.md, protocol 2.1): the workbook's chat in the
model (Workbook::chat), saved in XLSX as /craft/chat.json (urn:craft:relationships:chat,
application/vnd.craft.chat+json; a damaged part skipped with a warning) and in the
native JSON format; shared in live sessions through the chat/chatMeta roots (seeded
on share, the room's on join, outside the undo scope, viewers can chat); commands
chat.list/send/edit/delete/clear/export/typing and view.chat; never an undo step but
marking the workbook modified; awareness typing. The Chat pane (messages with author
circle, time, replies, edited/deleted, links, mentions; Enter sends, Shift+Enter new
line; Export, Clear chat... asking first, the Office note) and the title bar's chat
button with the unread count and a flash for mentions. Tests: model, xlsx round trip,
replicas, engine commands and sessions (two/three peers, clear, join, encrypted,
viewer, typing), chat in the convergence fuzz, craft-collab's chat transcripts in the
conformance replay, kittest for the pane and the unread count.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…, follow RunAction's cycle, collect page diagnostics

- Fills: cell.get writes the colour as {"Rgb": n} (Windows reported 16776960,
  which is #FFFF00); compare RRGGBB instead of searching the JSON text.
- keyboard-shortcuts RunAction: expect the next colour in the sample's cycle
  after the cell's current fill (a blank cell reads #FFFFFF, so #C7CC7A).
- When a waited-for page state never comes, ask the page for
  __craftOfficeInfo and DOM facts, save them under diagnostics/, and put the
  gist (readyState, onReady calls/done, callback errors, failed scripts,
  problems) in the report.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tstrap records page problems

On macOS the library (and the settings round trip) can be ready before the
page's HTML is parsed. Samples whose taskpane.js runs in <head> (add-in
commands, save custom settings) then had their Office.onReady callback run
while document.getElementById('run') was still null: the callback threw and
the buttons were never wired. Office calls onReady and initialize after the
DOM is ready, and so does GridCraft's library now (the host's ready event too).

For tests, the bootstrap now keeps uncaught errors, unhandled rejections,
console errors and warnings, script load results and the document state in
__craftOfficeInfo, with the library's onReady bookkeeping
(__craftOfficeState: calls, callbacks run, the last callback error).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…live

craft-live (a WOPI editor that replaces Collabora in Nextcloud Office) frames
the web build with #craft-live=1&ws=…&room=…&token=…; the web build now
speaks its embed contract (craft-live docs/design.md §9):

- gridcraft_engine::live: the contract without I/O (LiveClient): fragment and
  craft-live:config, y-websocket lib0 framing and control messages (type 100),
  seeding from the file (collab.share semantics, read-only until the room has
  the seed) or joining (Joining… until sync step 2), reseed/prepare, a lost
  lease, save {id,url,name,format} answered with a PUT of the file in its own
  format (xlsx/xlsm/xltx/xltm; anything else as .xlsx, which craft-live keeps
  as a copy), saveResult on failure, saveNow, closing after the room saved,
  close codes 4401/4403 and reconnecting with backoff, shell messages
  (loaded, modified, saved, peers, close, error). The engine's room is served
  in memory: one update per committed command, awareness as on the desktop.
- apps/gridcraft-web/src/live.rs: the browser I/O (postMessage with the shell,
  web_sys::WebSocket, fetch); Save asks the room to save, exports download.
- ui-egui: Services::close (the title bar's Close, File › Close through the
  host) and HostSession (the session's popover names Nextcloud, shows the file,
  person, saved state and connection, and offers Close instead of Leave).
- Desktop: collab/snapshot {file: true, format} writes the asked format when
  GridCraft can and reports the format written.
- collab: random numbers from the browser's crypto on wasm (client ids).
- Tests: native tests against a fake craft-live room, wasm-bindgen tests of the
  client compiled to wasm, a kittest for the host's Close and popover, and
  apps/gridcraft-web/e2e (not a workspace member) against the real craft-live
  server and its fake Nextcloud with proof keys.
- Docs: collab.md (In Nextcloud), packaging/web/README.md (the bundle craft-live
  serves), gaps §16/§21, ROADMAP progress log.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sirmmo and others added 3 commits October 16, 2026 20:15
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…eady waits for DOMContentLoaded

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ields, blank results, literal text, invalidation

Plugin protocol 2.2 (2.1 is the shared protocol's document chat), found by the R add-in:
- functions/call carries document {path, name, id}; results are kept per workbook and file;
  context.document and the document events carry the same session id
- documentOpened is delivered before an opened workbook's first calculation (at most 10 s per
  plugin)
- form fields: multiline, code, rows (bounded)
- {"empty": true} results show blank when the formula is the call itself; null stays 0 as in Excel
- range.setValues {literal: true}
- host/functions/invalidate {names?} during commands, events and on the push channel
host.features: functionDocument, openedBeforeCalc, multiline, emptyResult, literalValues,
invalidate.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants