Skip to content

TeamCraft plugin for SolidCraft (plugins/solidcraft) - #391

Merged
Sebagrei merged 21 commits into
mainfrom
feature/solidcraft-plugin
Nov 22, 2026
Merged

Sebagrei merged 21 commits into
mainfrom
feature/solidcraft-plugin

Conversation

@Sebagrei

Copy link
Copy Markdown
Collaborator

Stacked on #390 → #389 → #387 → #386 → #385 → #384 (uses the teamcraft.pdm object of #369).

What

A plugin for SolidCraft's experimental plugin runtime – a WebAssembly component (craft:plugin@0.2.0, world command-plugin, capability commands@0.2), its own Cargo project like desktop/:

Entry Effect
TeamCraft status read item + revision of the design (from teamcraft.pdm), the revision page <server>/revisions/<id>, whether part number / revision still match
Check for TeamCraft read no part number, mismatch with the linked item, BOM rows without part number, one part number with two descriptions, uncountable quantities, linked designs with absolute paths or the same file name twice; ready flag
Link to TeamCraft item edit item number, revision, name (+ server) into the design properties and teamcraft.pdm in one undo step; keeps the desktop app's ids for the same item
Unlink from TeamCraft edit removes teamcraft.pdm

SolidCraft's plugins have no network access, so check-out/check-in stay in the desktop app; the plugin works on the open design. Commands used (declared in plugin.json, no file group): document.metadata, document.metadata.set, document.metadata.remove, assembly.bom, component.links.

  • src/logic.rs: the entries over a Host trait, tested against a fake design; src/lib.rs: wit-bindgen bindings (wasm32 only).
  • build.sh: wasm32-unknown-unknown → wasm-tools component new → target/package/teamcraft/ (plugin.json, plugin.wasm, SHA256SUMS); fails if the component imports anything but craft:plugin@0.2.0 (no WASI).
  • New workflow solidcraft-plugin.yml (path-filtered): fmt, clippy (host + wasm), tests, package as artifact.

Licence – please confirm

plugins/solidcraft/wit/plugin.wit is SolidCraft's interface definition, unchanged, MIT (wit/LICENSE-MIT), needed to build a component for their runtime. Recorded in the README licence table, the plugin README, interop.md and the research page (as the one exception to "no SolidCraft code").

Not done / not verified

  • Not built or tested locally (no cargo builds in this session) – the new workflow is the first build. wit-bindgen = "0.41" may need a bump.
  • Not yet tried in a real SolidCraft.

Docs

plugin README, reference/interop.md, research/solidcraft-design.md, README (features, licence table), CHANGELOG, OPEN_WORK, CLAUDE.md.

🤖 Generated with Claude Code

fork and others added 21 commits November 21, 2026 23:15
…M, CLI (#363)

Findings and sources for reading SolidCraft designs, recorded before
the readers are implemented; linked from the research index, SUMMARY,
interop page and OPEN_WORK.

Closes #363

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/scdesign.rs opens the .sc ZIP design container with bounded,
size- and CRC-checked reads and returns cache/thumbnail.png only when
its key (solidcraft-thumbnail/1) names the SHA-256 of this
document.json and of the PNG. Unknown versions, drawing containers,
damaged or oversized entries are 'no picture', never an error.
thumbnail.rs supports solidcraft-design; the existing thumbnail fuzz
target covers the new path.

Docs: guide/files.md, reference/formats.md, reference/interop.md,
README, CHANGELOG, OPEN_WORK, CLAUDE.md architecture map;
scdesign.rs added to the mutation-testing globs.

Closes #364

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scdesign::document reads the document of a ZIP or plain-JSON design
(bounded, 16 MiB), scdesign::linked_designs the file names of its
links with the placements of the linked components as counts (a
component without a placement counts once; standard parts are no
files). cadrefs uses them for .sc files instead of the text heuristic
and as instance counts. The JSON design check moved from cadformat to
scdesign. New fuzz target scdesign (harness, target, seed, CI matrix).

Docs: guide/structure.md, reference/formats.md (incl. rescan),
reference/interop.md, dev/fuzzing.md, README, CHANGELOG, OPEN_WORK,
CLAUDE.md architecture map.

Closes #365

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
desktop/src/cadlock.rs reads SolidCraft's .~<file>.lock beside a
design (regular file only, at most 4 KiB, stale after 180 s either
way) into LocalFile.open_in (program, computer, user, since). The
Workspace tab marks such files 'Open in SolidCraft', the check-in
dialog warns that unsaved changes there are not checked in. Tests
for fresh, stale, future, malformed, oversized locks, other formats,
and that lock and backup files are never uploaded.

Docs: desktop/README.md, guide/desktop.md, reference/interop.md,
CHANGELOG, OPEN_WORK.

Closes #370

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y system (#368)

cadexport gains CadProgram::SolidCraft: .sc/.solidcraft files that are
designs (ZIP container or JSON solidcraft/N, not scripts) are exported
with 'solidcraft-cli run --in <design> --out <name>.stp', found through
SOLIDCRAFT_CLI, PATH or SolidCraft's install folders (Windows, macOS
app bundle, Linux packages, ~/.local/bin, snap), run without a shell or
window under the same 15-minute limit; the wait loop is shared with the
PowerShell exports. available() lists it on every system.

Check-in: a failed or impossible STEP export (any program) no longer
stops the check-in – the file goes without its STEP and the result
says why (lessons from #342).

Docs: desktop/README.md, guide/desktop.md, guide/files.md,
reference/interop.md, README, CHANGELOG, OPEN_WORK.

Closes #368

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
desktop/src/scprops.rs builds one document.metadata.set script
(part_number, revision, description and TeamCraft's object with item
and revision ids and the server under teamcraft.pdm) and runs
'solidcraft-cli run <script> --in <design> --save <design>'; refused
for files that are not SolidCraft designs, read-only (not my
check-out) or open in SolidCraft (cadlock). cadexport's CLI runner is
shared (run_cli). Tauri command solidcraft_write_item_data and an
'Item data' button in the Workspace tab.

Docs: desktop/README.md, guide/desktop.md, reference/interop.md,
CHANGELOG, OPEN_WORK.

Closes #369

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A WebAssembly component for SolidCraft's plugin runtime
(craft:plugin@0.2.0, capability commands@0.2), its own Cargo project:
- status: the TeamCraft item and revision of the design (teamcraft.pdm,
  written by the desktop app's Item data), the revision page, whether
  part number and revision still match;
- check: what keeps the design from going into TeamCraft cleanly
  (part number, mismatch with the item, BOM rows without part number,
  one part number with two descriptions, uncountable quantities,
  absolute or same-named linked designs);
- link / unlink: write or remove the item data from inside SolidCraft.
No network (SolidCraft refuses it); only document.metadata(.set/.remove),
assembly.bom and component.links. Logic in src/logic.rs with tests
against a fake host; bindings only in the wasm build. build.sh makes
the package and refuses any import but craft:plugin@0.2.0. Workflow
'SolidCraft plugin': fmt, clippy, tests, component, artifact.
wit/plugin.wit is SolidCraft's interface, unchanged, MIT.

Docs: plugin README, reference/interop.md, research page, README
(features, licence table), CHANGELOG, OPEN_WORK, CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Sebagrei
Sebagrei merged commit a72018a into main Nov 22, 2026
6 checks passed
@Sebagrei
Sebagrei deleted the feature/solidcraft-plugin branch November 22, 2026 07:04
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