Skip to content

Save a version and publish a model to Commons from AI Chat - #84

Merged
pfsteve merged 1 commit into
mainfrom
feat/ai-chat-save-publish
Nov 6, 2026
Merged

pfsteve merged 1 commit into
mainfrom
feat/ai-chat-save-publish

Conversation

@pfsteve

@pfsteve pfsteve commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

AI Chat can now save the open document and publish a 3D model to Commons when asked. Until now a request like "publish this to Commons in my shaker cabinet collection" got a list of manual steps.

What you see

  • Save: "save this" or "save it with the note: added the drawer runners" saves a private cloud version, exactly as Save version does. The chat shows "Saved version N." If nothing changed, it says so and makes no new version. Notes are in your words, or the agent's summary of its own changes when you ask for that. This works in models and Layout drawings.
  • Publish (3D models): the agent saves a version, then shows a Publish to Commons card with:
    • the title, a description it drafted, and the category
    • the license: CC BY 4.0 suggested when you don't name one, or the copy's retained source licenses
    • collections matched to yours by name, or created as new private ones
    • a picture of the current view
  • Publish model (or Publish changes) opens the existing publishing dialog with the card's values and publishes as soon as the upload is ready. That includes the first-time profile step. Edit details opens the same dialog to review first. Cancel publishes nothing. Afterwards the card shows Published with a link to the model.
  • The agent never publishes on its own. Your click on the card is the publish action, the same as clicking Publish model in the dialog.

How it works

  • Backend (requests-core):
    • Three new tools: document_save, commons_publishing_info (the agent's view of your collections, the categories, licenses, the current publication, and retained or blocked source licenses) and commons_publish_propose.
    • Their prompt rules. The tools are offered only to tabs whose descriptor says save: 1 or publish: 1 (publishing in model tabs only).
    • A publication made or a cancelled card ends the turn without another model call, like a clone. A failure goes back to the agent to explain.
  • Chat (requests-ui): the card, a line outcome for the save message, and "Published" / "Not published." lines after a reload.
  • Host (ui):
    • chatPublishing saves through the existing CloudAutosave and prepares the card: it matches collections, keeps a published model's current details unless the agent changes them, and refuses no-derivatives sources.
    • App mounts PublishSnapshot for the card.
    • editorView is extracted from Save version.
  • Dialog (commons-ui): UploadDialog gains preset (details and collections), autoPublish, and onPublication, so a publication whose collections failed still reports.

Compatibility and deployment

Older backends ignore save and publish in the descriptor, and older clients never send them. The feature goes live once the backend in this change is deployed.

Testing

  • tsc -b, eslint ., spdx-check, license-check and the full vitest suite pass (586 files, 4505 tests).
  • New tests:
    • which tools are offered, and when a turn ends quietly
    • the save line
    • the card's Publish, Edit details, a dialog closed without publishing, Cancel, and a failure to prepare
    • reload lines
    • the host's save and card preparation: new and published models, collection matching, retained and no-derivatives sources
    • the tool session's save path
    • the dialog auto-publishing from a preset and applying preset collections
  • Not yet tried by hand against a live agent.

🤖 Generated with Claude Code

Asking AI Chat to save now saves the open model or drawing as a private
cloud version, exactly as Save version does, with optional change notes in
the requester's words or the agent's summary of its changes. The chat shows
"Saved version N." or says nothing changed and no version was made.

In a 3D model, asking to publish ("publish this to Commons in my Shaker
cabinets collection") saves a version and shows a Publish to Commons card:
title, a drafted description, category, license (CC BY 4.0 suggested when
none is named, or the copy's retained source licenses), collections matched
to the publisher's own by name or created as new private ones, and the
current view. Nothing is public until Publish model (Publish changes for a
published model) is chosen: it opens the publishing dialog with the card's
values and publishes as soon as the upload is ready, including the first
profile step. Edit details opens the same dialog to review first; Cancel
publishes nothing. The card then shows Published with a link.

Backend: document_save, commons_publishing_info and commons_publish_propose
with their rules, offered to tabs that say they can save or publish; a
publication made or cancelled ends the turn without another model call.
The publishing dialog takes a preset, auto-publishing and a callback for a
publication whose collections failed. Help covers both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pfsteve
pfsteve merged commit a36b43b into main Nov 6, 2026
11 checks passed
@pfsteve
pfsteve deleted the feat/ai-chat-save-publish branch November 6, 2026 23:11
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