You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(automation): resolve & validate script-node callables; function registration (#1870) (#1903)
* feat(automation): resolve & validate script-node callables; function registration path (#1870)
A flow `script` node pointing at an unregistered callable — or declaring no
`actionType`/`function` at all — built fine and silently did nothing at
runtime. Close the gap on three surfaces:
- Runtime: the built-in `script` executor resolves its target (built-in
side-effect → registered function → else fail loud). The old
`(no-op handler)` success path is removed, so an unwired callable can no
longer quietly skip the step.
- Registration path: add `AutomationEngine.setFunctionResolver()`/
`resolveFunction()` and bridge it in the plugin's `start()` to ObjectQL's
`resolveFunction` (fed by `bundle.functions` / `defineStack({ functions })`).
A `script` node can now invoke an authored function by name:
`{ type: 'script', config: { function: 'my_fn', inputs: { … } } }`.
- Build: `objectstack build` flags a `script` node that names no callable
(the `actionType: undefined` repro). Existence is checked at runtime —
functions are code, not serialized into the artifact.
Tests: new script-executor suite (function resolution, loud failure, bare
actionType shorthand, thrown-function surfacing) + CLI build-validation cases.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* fix(automation): recognize inline `config.script` so it isn't flagged as an empty no-op (#1870)
CI Build Core caught that the build-time check (and the runtime executor) treated
a `script` node carrying inline JS in `config.script` as target-less, breaking
example-crm/showcase builds. Inline `config.script` is a distinct, recognized
form — the built-in runtime has no server-side JS sandbox so it does NOT execute
it (a separate gap, out of #1870's callable-resolution scope). Now:
- build validation accepts `function` | `actionType` | non-empty `script`;
- the runtime executor warns loudly that inline scripts aren't executed (and
points to `defineStack({ functions })`) instead of failing the step or
silently succeeding.
Verified example-crm, app-showcase, app-todo all build clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments