Registry-correct flow management for off-box callers, bump to 1.5.0 - #50
Merged
Conversation
… bump to 1.5.0 serve.ts gains a pure validation endpoint that runs validateFlow against the live in-process step registry — the one place off-box callers (Clawnify hook server) can get registry-correct validation for flows using plugin-registered custom steps (clawnify_app, clawnify_action, ...). Draft/version semantics (resolveFlowFile, versionsDir, listVersions, readVersion, readLatestVersion, publishDraft) move from plugin closures into src/core/manage.ts so out-of-process callers import the same implementation instead of mirroring it. flow_publish keeps its in-process validation and now delegates the snapshot to publishDraft — no behavior change.
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.
What
POST /flows/validatein the flow server — purevalidateFlow()against the live in-process step registry. This is the one place an off-box caller can validate flows that use plugin-registered custom steps (clawnify_app,clawnify_action,send_email), which only exist in the gateway process. No state, no execution — safe unauthenticated like/health.src/core/manage.ts— draft/version semantics (resolveFlowFile,versionsDir,listVersions,readVersion,readLatestVersion,publishDraft) extracted from the plugin's closures so out-of-process platform callers (the Clawnify hook server) import the same implementation instead of mirroring the.clawflow/versions/<name>/<N>.jsonlayout.publishDraftdeliberately does not validate — callers validate first with the registry they have.flow_publishkeeps its in-process validation and delegates the snapshot topublishDraft— no behavior change.Why
The Clawnify CLI gains
flows create/edit/publish(clawnify/clawnify PR linked below). Validation must see the live registry or it falsely rejects our own documented steps; publishing must use the engine's layout or it drifts. Both are now imported from the engine, per the ADR (never a second parser).Tests
tests/manage.test.ts: publishDraft versioning/stamping/errors, resolveFlowFile conventions, and the validate route (valid, node-level errors, custom-step-aware viadefaultRegistry, malformed bodies, run-route shadowing).POST /flows/validateanswers via the public tunnel; the hook's save/publish paths work end-to-end against it.