@synapsor/runner 0.1.16 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +19 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/runner.mjs +3216 -590
- package/docs/conformance.md +5 -0
- package/docs/current-scope.md +2 -2
- package/docs/dsl-reference.md +18 -0
- package/docs/http-mcp.md +41 -0
- package/docs/limitations.md +2 -1
- package/docs/oss-vs-cloud.md +3 -2
- package/docs/production.md +171 -1
- package/docs/release-notes.md +28 -6
- package/docs/release-policy.md +37 -6
- package/docs/runner-config-reference.md +110 -5
- package/examples/support-plan-credit/README.md +16 -1
- package/examples/support-plan-credit/contract.synapsor.sql +2 -0
- package/examples/support-plan-credit/synapsor.contract.json +15 -0
- package/package.json +1 -1
- package/schemas/synapsor.runner.schema.json +100 -0
|
@@ -166,6 +166,21 @@
|
|
|
166
166
|
"policies": [
|
|
167
167
|
{
|
|
168
168
|
"kind": "approval",
|
|
169
|
+
"limits": [
|
|
170
|
+
{
|
|
171
|
+
"kind": "count",
|
|
172
|
+
"max": 20,
|
|
173
|
+
"period": "day",
|
|
174
|
+
"scope": "tenant_policy"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"field": "plan_credit_cents",
|
|
178
|
+
"kind": "total",
|
|
179
|
+
"max": 100000,
|
|
180
|
+
"period": "day",
|
|
181
|
+
"scope": "tenant_policy"
|
|
182
|
+
}
|
|
183
|
+
],
|
|
169
184
|
"mode": "green",
|
|
170
185
|
"name": "support_propose_plan_credit_auto_approval",
|
|
171
186
|
"rules": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synapsor/runner",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Stop giving AI agents execute_sql; expose reviewed Postgres/MySQL MCP actions with proposals, approval, writeback, and replay.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -58,6 +58,35 @@
|
|
|
58
58
|
"description": "SQLite ledger path. The file can contain visible business-data evidence and is created with owner-only permissions on POSIX.",
|
|
59
59
|
"type": "string",
|
|
60
60
|
"minLength": 1
|
|
61
|
+
},
|
|
62
|
+
"shared_postgres": {
|
|
63
|
+
"description": "Optional shared Postgres ledger. mode=mirror coordinates bounded CLI mutations with a schema-scoped advisory lock while the live runtime store remains local SQLite. mode=runtime_store makes MCP serving use Postgres as the primary proposal/evidence/replay store.",
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"required": ["mode", "url_env"],
|
|
67
|
+
"properties": {
|
|
68
|
+
"mode": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"enum": ["mirror", "runtime_store", "disabled"]
|
|
71
|
+
},
|
|
72
|
+
"url_env": {
|
|
73
|
+
"description": "Environment variable containing the shared ledger Postgres URL. The URL itself must not be stored in config.",
|
|
74
|
+
"type": "string",
|
|
75
|
+
"pattern": "^[A-Z_][A-Z0-9_]*$"
|
|
76
|
+
},
|
|
77
|
+
"schema": {
|
|
78
|
+
"description": "Postgres schema for shared ledger tables.",
|
|
79
|
+
"type": "string",
|
|
80
|
+
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
|
|
81
|
+
"default": "synapsor_runner"
|
|
82
|
+
},
|
|
83
|
+
"lock_timeout_ms": {
|
|
84
|
+
"description": "How long mirror-mode CLI commands wait for the schema-scoped advisory lock.",
|
|
85
|
+
"type": "integer",
|
|
86
|
+
"minimum": 0,
|
|
87
|
+
"default": 10000
|
|
88
|
+
}
|
|
89
|
+
}
|
|
61
90
|
}
|
|
62
91
|
}
|
|
63
92
|
},
|
|
@@ -117,6 +146,53 @@
|
|
|
117
146
|
"disable_auto_approval": { "type": "boolean" }
|
|
118
147
|
}
|
|
119
148
|
},
|
|
149
|
+
"operator_identity": {
|
|
150
|
+
"description": "Operator identity used by approve, reject, and apply. signed_key verifies possession of a registered private key; dev_env is local-development compatibility only.",
|
|
151
|
+
"type": "object",
|
|
152
|
+
"additionalProperties": false,
|
|
153
|
+
"required": ["provider"],
|
|
154
|
+
"allOf": [
|
|
155
|
+
{
|
|
156
|
+
"if": { "properties": { "provider": { "const": "signed_key" } }, "required": ["provider"] },
|
|
157
|
+
"then": { "required": ["operators"] }
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"properties": {
|
|
161
|
+
"provider": { "enum": ["dev_env", "signed_key"] },
|
|
162
|
+
"actor_env": { "$ref": "#/$defs/env_name" },
|
|
163
|
+
"roles_env": { "$ref": "#/$defs/env_name" },
|
|
164
|
+
"apply_roles": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/identifier" } },
|
|
165
|
+
"operators": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"minProperties": 1,
|
|
168
|
+
"additionalProperties": {
|
|
169
|
+
"type": "object",
|
|
170
|
+
"additionalProperties": false,
|
|
171
|
+
"required": ["public_key_path", "roles"],
|
|
172
|
+
"properties": {
|
|
173
|
+
"public_key_path": { "type": "string", "minLength": 1 },
|
|
174
|
+
"roles": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/identifier" } }
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"session_auth": {
|
|
181
|
+
"description": "Signed per-session identity for Streamable HTTP http_claims contexts. The HMAC secret stays in an environment variable.",
|
|
182
|
+
"type": "object",
|
|
183
|
+
"additionalProperties": false,
|
|
184
|
+
"required": ["provider", "secret_env"],
|
|
185
|
+
"properties": {
|
|
186
|
+
"provider": { "const": "jwt_hs256" },
|
|
187
|
+
"secret_env": { "$ref": "#/$defs/env_name" },
|
|
188
|
+
"previous_secret_env": { "$ref": "#/$defs/env_name" },
|
|
189
|
+
"issuer": { "type": "string", "minLength": 1 },
|
|
190
|
+
"audience": { "type": "string", "minLength": 1 },
|
|
191
|
+
"tenant_claim": { "$ref": "#/$defs/identifier" },
|
|
192
|
+
"principal_claim": { "$ref": "#/$defs/identifier" },
|
|
193
|
+
"clock_skew_seconds": { "type": "integer", "minimum": 0, "maximum": 300 }
|
|
194
|
+
}
|
|
195
|
+
},
|
|
120
196
|
"cloud": {
|
|
121
197
|
"type": "object",
|
|
122
198
|
"additionalProperties": false,
|
|
@@ -521,6 +597,30 @@
|
|
|
521
597
|
"max": { "type": "integer", "minimum": 0 }
|
|
522
598
|
}
|
|
523
599
|
}
|
|
600
|
+
},
|
|
601
|
+
"limits": {
|
|
602
|
+
"description": "Reviewed aggregate ceilings for policy auto-approval. Exceeding one falls back to human review.",
|
|
603
|
+
"type": "array",
|
|
604
|
+
"minItems": 1,
|
|
605
|
+
"items": {
|
|
606
|
+
"type": "object",
|
|
607
|
+
"additionalProperties": false,
|
|
608
|
+
"required": ["kind", "max", "period"],
|
|
609
|
+
"allOf": [
|
|
610
|
+
{
|
|
611
|
+
"if": { "properties": { "kind": { "const": "total" } }, "required": ["kind"] },
|
|
612
|
+
"then": { "required": ["field"] },
|
|
613
|
+
"else": { "not": { "required": ["field"] } }
|
|
614
|
+
}
|
|
615
|
+
],
|
|
616
|
+
"properties": {
|
|
617
|
+
"kind": { "enum": ["count", "total"] },
|
|
618
|
+
"max": { "type": "integer", "minimum": 0 },
|
|
619
|
+
"period": { "const": "day" },
|
|
620
|
+
"field": { "$ref": "#/$defs/identifier" },
|
|
621
|
+
"scope": { "enum": ["tenant_policy", "tenant_policy_object"] }
|
|
622
|
+
}
|
|
623
|
+
}
|
|
524
624
|
}
|
|
525
625
|
}
|
|
526
626
|
}
|