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(sdk): expose custom conditions on createGovernance (0.17.0)
Add conditions?: RegisteredConditionType[] to GovernanceConfig and
mirror the engine's condition-registry surface
(registerCondition / unregisterCondition / getRegisteredCondition /
getRegisteredConditions / clearConditionRegistry) on
GovernanceInstance, so callers using the documented createGovernance
flow no longer have to drop down to createPolicyEngine to register
custom evaluators. Widen GovernanceConfig.defaultOutcome to the full
PolicyOutcome union to match PolicyEngineConfig.defaultOutcome.
Update the README's Quick Start with a Custom Conditions section.
Copy file name to clipboardExpand all lines: README.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,6 +189,57 @@ if (decision.outcome === 'require_approval') {
189
189
}
190
190
```
191
191
192
+
### Custom Conditions
193
+
194
+
When the built-in condition types aren't enough, register your own evaluators directly on the governance instance — no need to drop down to `createPolicyEngine` for this. Pass them at construction or register them at runtime:
Mirror methods are available on the instance: `registerCondition`, `unregisterCondition`, `getRegisteredCondition`, `getRegisteredConditions`, `clearConditionRegistry`. Custom evaluators must be **synchronous** — the policy engine is sync by design.
Copy file name to clipboardExpand all lines: packages/governance/README.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,6 +189,57 @@ if (decision.outcome === 'require_approval') {
189
189
}
190
190
```
191
191
192
+
### Custom Conditions
193
+
194
+
When the built-in condition types aren't enough, register your own evaluators directly on the governance instance — no need to drop down to `createPolicyEngine` for this. Pass them at construction or register them at runtime:
Mirror methods are available on the instance: `registerCondition`, `unregisterCondition`, `getRegisteredCondition`, `getRegisteredConditions`, `clearConditionRegistry`. Custom evaluators must be **synchronous** — the policy engine is sync by design.
0 commit comments