Skip to content

History and recipes APIs at services level, flow storage encapsulated - #74

Merged
agviegas merged 1 commit into
mainfrom
feat/history-and-recipes
Oct 11, 2026
Merged

agviegas merged 1 commit into
mainfrom
feat/history-and-recipes

Conversation

@agviegas

Copy link
Copy Markdown
Contributor

What

client.history(projectId): a project's connected documents (Revit, AutoCAD...), their version timelines ordered by the parent graph, deltas and full models, and change requests (suggestions) with their full lifecycle (queue, read payload, resolve). client.recipes: the registry and runner for recipes, scripts that write suggestions in a native app's own language, declared by a manifest (to, inputs, runtime: browser|cloud, settingsSchema, a self-documenting rules table) plus one run function. Consumer example in core/examples/history.ts, indexed for the AI quickstart docs.

Why shaped like this

  • The flow layout is stated once, privately (bimterop folders, revitflow_history.json, revitflow_ops.json, hidden deltas, schema revitflow/ops@1). Wire format byte-compatible with the plugins; zero migration. When the layout moves into hidden project storage, or the platform grows the first-class history API (agreed phase 2), only src/core/history.ts changes.
  • The lost-append race is narrowed, not fixed: sync takes expectedLatestGuid, re-reads right before writing and refuses with StaleHistoryError when the head moved. Closing it needs the server-side append; documented in the module header as phase 2, as discussed.
  • Recipes run where the caller is (browser by default, cloud for unattended) and only ever queue a suggestion, so running one is safe by construction: nothing touches the native app until its owner applies it there.

Not here on purpose

The .frag payload builder (OperationBuilder) stays out: it belongs in the fragments toolkit per flow's STATE.md. The platform-level catalog (recipes as published items) sits on top of the same manifest later.

Merging publishes to npm via the release workflow (changeset included, minor).

🤖 Generated with Claude Code

client.history(projectId): connected docs, graph-ordered timelines,
deltas, models, and suggestions (change requests) with their lifecycle.
The bimterop layout is stated once, privately, so the hidden-folder move
and the platform-level API swap stay internal. Appends re-check the head
and refuse with StaleHistoryError when it moved; the remaining race is
the documented phase-2 server-side append.

client.recipes: registry and runner for recipes, scripts that write
suggestions in a native app language, declared by manifest (to, inputs,
runtime, settingsSchema, self-documenting rules) plus one run function.

Consumer example in core/examples/history.ts, indexed for the AI docs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@agviegas
agviegas merged commit 5b7b0aa into main Oct 11, 2026
1 check passed
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.

1 participant