Skip to content

Feat/automation condition action nodes - #9

Merged
pikann merged 3 commits into
masterfrom
feat/automation-condition-action-nodes
Aug 3, 2026
Merged

Feat/automation condition action nodes#9
pikann merged 3 commits into
masterfrom
feat/automation-condition-action-nodes

Conversation

@pikann

@pikann pikann commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds SDK support for plugins to register Condition and Action automation-graph node handlers, alongside the existing event handlers.

  • automation.go: new ConditionRequest/ConditionResult and ActionRequest/ActionResult types (with NodeType, ProjectID, and TaskSnapshot), plus the marshal helpers shared by the WASM and native dispatch paths.
  • context.go: Context.Condition(nodeType, handler) and Context.Action(nodeType, handler) registration APIs, mirroring the existing Context.Event(topic, handler) pattern.
  • dispatch.go: dispatcher.evaluateCondition/runAction deserialize the host payload (including node_type) and route to the handler registered for that node type.
  • wasm_exports.go: EvaluateCondition/RunAction wasmexport functions, using the same (ptr,len)->int64 packed-pointer calling convention as the existing HandleRequest export.
  • testing.go + plugintest/plugintest.go: DispatchCondition/DispatchAction native-test helpers, and Context.EvaluateCondition/Context.RunAction test-harness methods for plugin unit tests.

A follow-up commit adds ProjectID to ConditionRequest/ActionRequest so handlers have automation context beyond the node type.

Test plan

  • go build, go vet, go test clean (native)
  • GOOS=wasip1 GOARCH=wasm go build clean

pikann added 3 commits July 30, 2026 11:58
Adds SDK support for plugins to register Condition and Action
automation-graph node handlers, alongside the existing event handlers.

- automation.go: ConditionRequest/ConditionResult, ActionRequest/
  ActionResult (with NodeType + TaskSnapshot), and the marshal helpers
  used by both the WASM and native dispatch paths.
- context.go: Context.Condition(nodeType, handler) and
  Context.Action(nodeType, handler) registration API, mirroring the
  existing Context.Event(topic, handler) pattern.
- dispatch.go: dispatcher.evaluateCondition/runAction deserialize the
  host payload (now including node_type - see the paired paca core
  change) and route to the handler registered for that node type.
- wasm_exports.go: EvaluateCondition/RunAction wasmexport functions,
  using the same (ptr,len)->int64 packed-pointer calling convention as
  the existing HandleRequest export (confirmed against the host
  runtime's callExport in paca core's platform/plugin/runtime.go).
- testing.go + plugintest/plugintest.go: DispatchCondition/
  DispatchAction native-test helpers, and Context.EvaluateCondition/
  Context.RunAction test-harness methods for plugin unit tests.

Verified: go build/vet/test clean (native), GOOS=wasip1 GOARCH=wasm
go build clean.
@pikann
pikann merged commit bc99139 into master Aug 3, 2026
4 checks passed
@pikann
pikann deleted the feat/automation-condition-action-nodes branch August 3, 2026 15:17
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