feat(smart-forms): engine tools for full Smart Form lifecycle#14
Merged
Conversation
Add 12 engine tools covering the complete Smart Form authoring and release
lifecycle, plus CDU page protocol validation on push.
New engine tools:
- createSmartForm — create actor + develop/production envs
- pullSmartForm — download all env file trees to <actorId>/<env>/
- pushSmartForm — diff-and-push changed files; validates page config
against CDU schema before sending (new cduschema pkg)
- deploySmartForm — deploy develop → production (resolves env names to IDs)
- listReleases — list releases for an env
- diffReleases — diff two releases by source_hash
- rollbackRelease — forward-only rollback to a prior release
- getFileHistory — list version history for a file
- getFileVersion — fetch source of one specific file version
- rollbackFile — restore a file to a prior version
- listTrash — list soft-deleted objects in an env
- restoreFromTrash — restore from trash
New packages:
- internal/cduschema: embeds smart-forms-swagger.json, extracts 28 valid
component classes, validates page config (Page→Grid→Form→Section→Item)
and locale files before push
New skill:
- simulator-smart-forms: full Smart Form authoring specialist covering
create/edit/push/deploy/release/file-history workflow, CDU page protocol,
component catalogue, and templating — all via MCP tools (no raw API paths)
Also: SIMULATOR_WORK_DIR support in cmd/server and credentials so the server
reads .env from the user's project dir when launched from the plugin dir.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename engine files with consistent prefixes so graph and CDU tools sort together in the file tree: - graph_chart.go, graph_compact_layout.go, graph_placements.go, graph_prune_edges.go, graph_push.go, graph_sync.go, graph_upload.go - smart_form_create.go, smart_form_pull.go, smart_form_push.go (smart_form_file_history.go and smart_form_releases.go already correct) Remove internal/tools/apps.go: the 4 appOps it held (createApplication, createSmartForm, manageAppContent, listSmartForms) are superseded by the engine tools added in the previous commit. Drop the dead _ = appOps reference from build.go and clean up stale notes in README and ARCHITECTURE. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move all engine code from the flat internal/engines/ into three sub-packages
to group files by domain:
internal/engines/ecore/ — shared runtime config + HTTP helpers
runtime.go Config, Cfg, Configure, SetBaseURL, ResetAuth,
AuthHeader, BuildBaseURL, EnsureAuth
httpclient.go APIHTTPClient (shared TLS-aware HTTP client)
helpers.go Seg, RequireUUID, PapiGET, PapiPOST, PapiPUT
ecore_test.go TestRequireUUID, TestSeg, TestBuildBaseURL*
internal/engines/graph/ — graph sync, layout, pruning, upload, chart
sync.go, push.go, compact_layout.go, placements.go, prune_edges.go,
chart.go, upload.go, svg.go, helpers.go, register.go
sync_test.go, security_test.go
internal/engines/smartform/ — CDU create/pull/push, releases, file history
create.go, pull.go, push.go, releases.go, file_history.go, register.go
internal/engines/ — thin wiring layer
register.go calls graph.Register + smartform.Register
runtime.go re-exports Configure/SetBaseURL/ResetAuth from ecore
(so cmd/server and tools/build.go need no import changes)
All tests pass; go build and go vet clean.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createSmartForm,pullSmartForm,pushSmartForm,deploySmartForm,listReleases,diffReleases,rollbackRelease,getFileHistory,getFileVersion,rollbackFile,listTrash,restoreFromTrashinternal/cduschemapackage — embedssmart-forms-swagger.json, extracts 28 valid CDU component classes, validatespages/*/configandlocalefiles beforepushSmartFormsends them to the serversimulator-smart-formsskill — full Smart Form authoring specialist: create → pull → edit → push → deploy → release/rollback workflow, CDU page protocol, component catalogue, templating; all documented via MCP tool calls (no raw API paths)SIMULATOR_WORK_DIRsupport —cmd/serverandcredentials.gonow read.envfrom the user's project dir when the server is launched from the plugin dirTest plan
go build ./...andgo vet ./...passgo test ./internal/cduschema/...— 4 tests pass (GetRules: 28 classes, ValidatePageConfig valid/errors, ValidateLocale)createSmartForm(title, ref)returnsactorId+ two envspullSmartForm(actorId)writes files +.manifest.jsonto<actorId>/develop/and<actorId>/production/pushSmartFormwith a bad page config returnsvalidationErrorsand abortspushSmartFormwith valid changes returns{ changed: N, unchanged: M }deploySmartForm(actorId)creates a release without needing env IDslistReleases(actorId)returns release listrollbackRelease(actorId, releaseId)creates a new active release🤖 Generated with Claude Code