@syncropel/config
v0.8.0
Published
JSON Schema definitions + TypeScript types for the Syncropel daemon's configuration records. Use with any JSON Schema validator to lint routing rules, triggers, fold rules, health checks, AITL rules, and permission rules before applying them via `th_engin
Downloads
236
Maintainers
Readme
@syncropel/config
JSON Schemas + TypeScript types for Syncropel daemon configuration
records. Use this package to lint config records (routing rules,
triggers, fold rules, health checks, AITL rules, permission rules, auth
configs) before submitting them via a th_engine_config LEARN.
Pairs with the @syncropel/sdk
record client and with any GitOps pipeline that applies config records
from YAML / JSON source.
Install
npm install @syncropel/config
# peer: any JSON Schema validator — ajv is the conventional choice
npm install ajvUsage
import {
RoutingRuleSchema,
type RoutingRule,
} from "@syncropel/config";
import Ajv from "ajv";
const ajv = new Ajv({ strict: true });
const validate = ajv.compile(RoutingRuleSchema);
const rule: RoutingRule = {
name: "route-code-intents",
match_expression: 'record.act == "INTEND" && record.body.domain == "code"',
action_template: {
kind: "Route",
target: "did:sync:agent:dev",
budget_usd: 1.0,
},
};
if (!validate(rule)) {
console.error("invalid rule:", validate.errors);
process.exit(1);
}The compile-time type and the runtime schema stay aligned — changes to one show up in the other on the next package bump.
What's in the box
| Schema | TypeScript type | Used for |
|---|---|---|
| RoutingRuleSchema | RoutingRule | Dispatch-pipeline routing rules |
| EventTriggerSchema | EventTrigger | Record-match or cron-scheduled triggers |
| FoldRuleSchema | FoldRule | Task-thread status derivation |
| HealthCheckSchema | HealthCheck | CEL-based health checks |
| AitlRuleSchema | AitlRule | How intelligence proposals are gated |
| PermissionRuleSchema | PermissionRule | Fail-closed permission rules |
| AuthRequiredSchema | AuthRequired | auth.required = true/false switch |
| AuthCorsOriginsSchema | AuthCorsOrigins | CORS allowlist |
All schemas live under ./schemas/ and are importable as plain JSON
for tooling that doesn't want the TypeScript surface.
Provenance + drift
The schemas in this v0.1.0 release are hand-authored from the Rust
config.rs source of truth. The generation of schemas directly from
the Rust serde types via schemars is tracked as a v0.19 follow-up
task in the Syncropel roadmap (see the schemars-automation entry
under the v0.19 planning docs once they land). Once that ships, the
hand-authored files are replaced with generator output and a CI check
pins drift so the two can't diverge silently.
Meanwhile, if you spot a mismatch between what the schemas accept and
what the daemon actually deserializes, please file an
issue. The schemas
track crates/syncropel-engine/src/config.rs as-of v0.1.0
(daemon 0.18.0); field additions land in the next @syncropel/config
minor release.
License
Apache-2.0.
