Skip to content

add_component!: the keyword code, the constructor call for export_script - #18

Merged
StackEnjoyer merged 3 commits into
mainfrom
feature/add-component-code
Oct 6, 2026
Merged

StackEnjoyer merged 3 commits into
mainfrom
feature/add-component-code

Conversation

@TacHawkes

Copy link
Copy Markdown
Collaborator

An object built in code (by a script, a tool or an agent) can now be added with its constructor call: add_component!(gui, obj; code = "...") records it with the pose of obj when it is added, as the catalog does with its origin. export_script then writes the call and the moves since it was added instead of a comment "construct it here"; export_changes lists it with its constructor as well. Also for sources.

The page "Edit" and copying stay for parts of the catalog, whose entry and parameters are known.

  • tests: "objects added with their code" in TestLiveExportScript.jl
  • skill files updated: API.md; AGENTS.md: gap of P1

…cript

An object built in code (by a script, a tool or an agent) can now be
added with its constructor call: `add_component!(gui, obj; code = "...")`
records it with the pose of `obj` when it is added, as the catalog does
with its `origin`. export_script then writes the call and the moves since
it was added instead of a comment "construct it here"; export_changes
lists it with its constructor as well. Also for sources.

The page "Edit" and copying stay for parts of the catalog, whose entry
and parameters are known.

- tests: "objects added with their code" in TestLiveExportScript.jl
- skill files updated: API.md; AGENTS.md: gap of P1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Hugo Uittenbosch and others added 2 commits October 6, 2026 17:15
Conflict in test/TestLiveExportScript.jl: both sides added a testset at
the same place ("objects added with their code" here, "labels that the
script takes otherwise" on main). Both are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xport

- `code` that is empty, does not parse or has several statements throws an
  ArgumentError and nothing is added: export_script writes it as
  `name = code`, so the script would not run.
- The docstring says that `code` must run on its own in the script (no
  variables of the session) and that an object moved before it was added
  with `code` is exported in a wrong pose, which is not checked.
- The docs page "Adding and removing components", the limits in the skill
  and the docstrings of export_script and export_changes name the objects
  added with `code` besides those of the catalog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StackEnjoyer
StackEnjoyer merged commit bd418bf into main Oct 6, 2026
3 checks passed
@StackEnjoyer
StackEnjoyer deleted the feature/add-component-code branch October 6, 2026 16:52
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.

3 participants