@syncropel/config
v0.13.1
Published
JSON Schema definitions + TypeScript types for Syncropel instance configuration records. Use with any JSON Schema validator to lint routing rules, triggers, fold rules, health checks, AITL rules, and permission rules before submitting them.
Maintainers
Readme
@syncropel/config
JSON Schemas + TypeScript types for Syncropel instance 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.
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 are hand-authored from the Rust config.rs source of
truth — the same authoring pattern this package shipped with. Schema
generation directly from Rust serde types via schemars remains a
future enhancement; until then, every minor bump captures field
additions caught by review against the source.
If you spot a mismatch between what the schemas accept and what the
server actually deserializes, please file an
issue. Field
additions land in the next @syncropel/config minor release.
See CHANGELOG.md for release notes.
License
Apache-2.0.
