Feat/automation condition action nodes - #9
Merged
Conversation
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.
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
Adds SDK support for plugins to register Condition and Action automation-graph node handlers, alongside the existing event handlers.
automation.go: newConditionRequest/ConditionResultandActionRequest/ActionResulttypes (withNodeType,ProjectID, andTaskSnapshot), plus the marshal helpers shared by the WASM and native dispatch paths.context.go:Context.Condition(nodeType, handler)andContext.Action(nodeType, handler)registration APIs, mirroring the existingContext.Event(topic, handler)pattern.dispatch.go:dispatcher.evaluateCondition/runActiondeserialize the host payload (includingnode_type) and route to the handler registered for that node type.wasm_exports.go:EvaluateCondition/RunActionwasmexport functions, using the same(ptr,len)->int64packed-pointer calling convention as the existingHandleRequestexport.testing.go+plugintest/plugintest.go:DispatchCondition/DispatchActionnative-test helpers, andContext.EvaluateCondition/Context.RunActiontest-harness methods for plugin unit tests.A follow-up commit adds
ProjectIDtoConditionRequest/ActionRequestso handlers have automation context beyond the node type.Test plan
go build,go vet,go testclean (native)GOOS=wasip1 GOARCH=wasm go buildclean