@synapsor/runner 0.1.0-alpha.1 → 0.1.0-alpha.11
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/README.md +426 -19
- package/TRADEMARKS.md +23 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +20 -8723
- package/dist/runner.mjs +12958 -0
- package/docs/README.md +53 -0
- package/docs/app-owned-executors.md +21 -0
- package/docs/cloud-mode.md +24 -0
- package/docs/current-scope.md +24 -0
- package/docs/dependency-license-inventory.md +35 -0
- package/docs/getting-started-own-database.md +460 -0
- package/docs/http-mcp.md +276 -0
- package/docs/licensing.md +36 -0
- package/docs/limitations.md +95 -0
- package/docs/local-mode.md +351 -0
- package/docs/mcp-audit.md +152 -0
- package/docs/mcp-client-setup.md +270 -0
- package/docs/openai-agents-sdk.md +57 -0
- package/docs/recipes.md +61 -0
- package/docs/release-notes.md +158 -0
- package/docs/security-boundary.md +94 -0
- package/docs/troubleshooting-first-run.md +248 -0
- package/docs/use-your-own-database.md +18 -0
- package/docs/writeback-executors.md +220 -0
- package/examples/app-owned-writeback/README.md +120 -0
- package/examples/app-owned-writeback/business-actions.md +221 -0
- package/examples/app-owned-writeback/command-handler.mjs +46 -0
- package/examples/app-owned-writeback/node-fastify-handler.mjs +55 -0
- package/examples/app-owned-writeback/python-fastapi-handler.py +57 -0
- package/examples/dangerous-mcp-tools.json +88 -0
- package/examples/mcp-postgres-billing-app-handler/README.md +82 -0
- package/examples/mcp-postgres-billing-app-handler/app-handler.mjs +197 -0
- package/examples/mcp-postgres-billing-app-handler/docker-compose.yml +13 -0
- package/examples/mcp-postgres-billing-app-handler/schema.sql +59 -0
- package/examples/mcp-postgres-billing-app-handler/scripts/run-demo.sh +99 -0
- package/examples/mcp-postgres-billing-app-handler/seed.sql +39 -0
- package/examples/mcp-postgres-billing-app-handler/synapsor.runner.json +157 -0
- package/examples/openai-agents-http/README.md +64 -0
- package/examples/openai-agents-http/agent.py +54 -0
- package/examples/openai-agents-http/requirements.txt +1 -0
- package/examples/openai-agents-stdio/README.md +66 -0
- package/examples/openai-agents-stdio/agent.py +72 -0
- package/examples/openai-agents-stdio/requirements.txt +1 -0
- package/examples/reference-support-billing-app/README.md +137 -0
- package/examples/reference-support-billing-app/docker-compose.yml +13 -0
- package/examples/reference-support-billing-app/mcp-client.generic.json +11 -0
- package/examples/reference-support-billing-app/schema.sql +68 -0
- package/examples/reference-support-billing-app/scripts/run-demo.sh +7 -0
- package/examples/reference-support-billing-app/seed.sql +33 -0
- package/examples/reference-support-billing-app/synapsor.runner.json +241 -0
- package/fixtures/benchmark/mcp-efficiency.json +53 -0
- package/fixtures/benchmark/mcp-efficiency.txt +25 -0
- package/fixtures/protocol/MANIFEST.json +54 -0
- package/fixtures/protocol/change-set.late-fee-waiver.v1.json +72 -0
- package/fixtures/protocol/execution-receipt.applied.v1.json +14 -0
- package/fixtures/protocol/execution-receipt.conflict.v1.json +15 -0
- package/fixtures/protocol/runner-registration.v1.json +22 -0
- package/fixtures/protocol/writeback-job.late-fee-waiver.v1.json +44 -0
- package/package.json +14 -4
- package/recipes/accounts.trial_extension.json +42 -0
- package/recipes/billing.late_fee_waiver.json +46 -0
- package/recipes/credits.account_credit.json +45 -0
- package/recipes/orders.refund_review.json +57 -0
- package/recipes/support.ticket_resolution.json +51 -0
- package/dist/bin.cjs +0 -13
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"mode": "review",
|
|
4
|
+
"storage": {
|
|
5
|
+
"sqlite_path": "./tmp/reference-support-billing/local.db"
|
|
6
|
+
},
|
|
7
|
+
"sources": {
|
|
8
|
+
"app_postgres": {
|
|
9
|
+
"engine": "postgres",
|
|
10
|
+
"read_url_env": "REFERENCE_POSTGRES_READ_URL",
|
|
11
|
+
"write_url_env": "REFERENCE_POSTGRES_WRITE_URL",
|
|
12
|
+
"statement_timeout_ms": 3000
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"trusted_context": {
|
|
16
|
+
"provider": "environment",
|
|
17
|
+
"values": {
|
|
18
|
+
"tenant_id_env": "SYNAPSOR_TENANT_ID",
|
|
19
|
+
"principal_env": "SYNAPSOR_PRINCIPAL"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"contexts": {
|
|
23
|
+
"local_operator": {
|
|
24
|
+
"provider": "environment",
|
|
25
|
+
"values": {
|
|
26
|
+
"tenant_id_env": "SYNAPSOR_TENANT_ID",
|
|
27
|
+
"principal_env": "SYNAPSOR_PRINCIPAL"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"capabilities": [
|
|
32
|
+
{
|
|
33
|
+
"name": "support.inspect_ticket",
|
|
34
|
+
"kind": "read",
|
|
35
|
+
"source": "app_postgres",
|
|
36
|
+
"context": "local_operator",
|
|
37
|
+
"target": {
|
|
38
|
+
"schema": "public",
|
|
39
|
+
"table": "support_tickets",
|
|
40
|
+
"primary_key": "id",
|
|
41
|
+
"tenant_key": "tenant_id"
|
|
42
|
+
},
|
|
43
|
+
"args": {
|
|
44
|
+
"ticket_id": { "type": "string", "required": true, "max_length": 128 }
|
|
45
|
+
},
|
|
46
|
+
"lookup": { "id_from_arg": "ticket_id" },
|
|
47
|
+
"visible_columns": ["id", "tenant_id", "customer_id", "subject", "status", "resolution_note", "updated_at"],
|
|
48
|
+
"evidence": "required",
|
|
49
|
+
"max_rows": 1
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "support.propose_ticket_resolution",
|
|
53
|
+
"kind": "proposal",
|
|
54
|
+
"source": "app_postgres",
|
|
55
|
+
"context": "local_operator",
|
|
56
|
+
"target": {
|
|
57
|
+
"schema": "public",
|
|
58
|
+
"table": "support_tickets",
|
|
59
|
+
"primary_key": "id",
|
|
60
|
+
"tenant_key": "tenant_id"
|
|
61
|
+
},
|
|
62
|
+
"args": {
|
|
63
|
+
"ticket_id": { "type": "string", "required": true, "max_length": 128 },
|
|
64
|
+
"resolution_note": { "type": "string", "required": true, "max_length": 1000 }
|
|
65
|
+
},
|
|
66
|
+
"lookup": { "id_from_arg": "ticket_id" },
|
|
67
|
+
"visible_columns": ["id", "tenant_id", "customer_id", "subject", "status", "resolution_note", "updated_at"],
|
|
68
|
+
"evidence": "required",
|
|
69
|
+
"max_rows": 1,
|
|
70
|
+
"patch": {
|
|
71
|
+
"status": { "fixed": "pending_review" },
|
|
72
|
+
"resolution_note": { "from_arg": "resolution_note" }
|
|
73
|
+
},
|
|
74
|
+
"allowed_columns": ["status", "resolution_note"],
|
|
75
|
+
"transition_guards": {
|
|
76
|
+
"status": {
|
|
77
|
+
"allowed": {
|
|
78
|
+
"open": ["pending_review"],
|
|
79
|
+
"pending_review": ["resolved"]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"conflict_guard": { "column": "updated_at" },
|
|
84
|
+
"approval": { "mode": "human", "required_role": "support_lead" }
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "support.inspect_customer_account",
|
|
88
|
+
"kind": "read",
|
|
89
|
+
"source": "app_postgres",
|
|
90
|
+
"context": "local_operator",
|
|
91
|
+
"target": {
|
|
92
|
+
"schema": "public",
|
|
93
|
+
"table": "customers",
|
|
94
|
+
"primary_key": "id",
|
|
95
|
+
"tenant_key": "tenant_id"
|
|
96
|
+
},
|
|
97
|
+
"args": {
|
|
98
|
+
"customer_id": { "type": "string", "required": true, "max_length": 128 }
|
|
99
|
+
},
|
|
100
|
+
"lookup": { "id_from_arg": "customer_id" },
|
|
101
|
+
"visible_columns": ["id", "tenant_id", "name", "plan", "plan_credit_cents", "credit_reason", "updated_at"],
|
|
102
|
+
"evidence": "required",
|
|
103
|
+
"max_rows": 1
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "support.propose_plan_credit",
|
|
107
|
+
"kind": "proposal",
|
|
108
|
+
"source": "app_postgres",
|
|
109
|
+
"context": "local_operator",
|
|
110
|
+
"target": {
|
|
111
|
+
"schema": "public",
|
|
112
|
+
"table": "customers",
|
|
113
|
+
"primary_key": "id",
|
|
114
|
+
"tenant_key": "tenant_id"
|
|
115
|
+
},
|
|
116
|
+
"args": {
|
|
117
|
+
"customer_id": { "type": "string", "required": true, "max_length": 128 },
|
|
118
|
+
"credit_cents": { "type": "number", "required": true, "minimum": 0, "maximum": 5000 },
|
|
119
|
+
"reason": { "type": "string", "required": true, "max_length": 500 }
|
|
120
|
+
},
|
|
121
|
+
"lookup": { "id_from_arg": "customer_id" },
|
|
122
|
+
"visible_columns": ["id", "tenant_id", "name", "plan", "plan_credit_cents", "credit_reason", "updated_at"],
|
|
123
|
+
"evidence": "required",
|
|
124
|
+
"max_rows": 1,
|
|
125
|
+
"patch": {
|
|
126
|
+
"plan_credit_cents": { "from_arg": "credit_cents" },
|
|
127
|
+
"credit_reason": { "from_arg": "reason" }
|
|
128
|
+
},
|
|
129
|
+
"allowed_columns": ["plan_credit_cents", "credit_reason"],
|
|
130
|
+
"numeric_bounds": {
|
|
131
|
+
"plan_credit_cents": { "minimum": 0, "maximum": 5000 }
|
|
132
|
+
},
|
|
133
|
+
"conflict_guard": { "column": "updated_at" },
|
|
134
|
+
"approval": { "mode": "human", "required_role": "support_lead" }
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "billing.inspect_invoice",
|
|
138
|
+
"kind": "read",
|
|
139
|
+
"source": "app_postgres",
|
|
140
|
+
"context": "local_operator",
|
|
141
|
+
"target": {
|
|
142
|
+
"schema": "public",
|
|
143
|
+
"table": "invoices",
|
|
144
|
+
"primary_key": "id",
|
|
145
|
+
"tenant_key": "tenant_id"
|
|
146
|
+
},
|
|
147
|
+
"args": {
|
|
148
|
+
"invoice_id": { "type": "string", "required": true, "max_length": 128 }
|
|
149
|
+
},
|
|
150
|
+
"lookup": { "id_from_arg": "invoice_id" },
|
|
151
|
+
"visible_columns": ["id", "tenant_id", "customer_id", "status", "balance_cents", "late_fee_cents", "waiver_reason", "updated_at"],
|
|
152
|
+
"evidence": "required",
|
|
153
|
+
"max_rows": 1
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "billing.propose_late_fee_waiver",
|
|
157
|
+
"kind": "proposal",
|
|
158
|
+
"source": "app_postgres",
|
|
159
|
+
"context": "local_operator",
|
|
160
|
+
"target": {
|
|
161
|
+
"schema": "public",
|
|
162
|
+
"table": "invoices",
|
|
163
|
+
"primary_key": "id",
|
|
164
|
+
"tenant_key": "tenant_id"
|
|
165
|
+
},
|
|
166
|
+
"args": {
|
|
167
|
+
"invoice_id": { "type": "string", "required": true, "max_length": 128 },
|
|
168
|
+
"reason": { "type": "string", "required": true, "max_length": 500 }
|
|
169
|
+
},
|
|
170
|
+
"lookup": { "id_from_arg": "invoice_id" },
|
|
171
|
+
"visible_columns": ["id", "tenant_id", "customer_id", "status", "balance_cents", "late_fee_cents", "waiver_reason", "updated_at"],
|
|
172
|
+
"evidence": "required",
|
|
173
|
+
"max_rows": 1,
|
|
174
|
+
"patch": {
|
|
175
|
+
"late_fee_cents": { "fixed": 0 },
|
|
176
|
+
"waiver_reason": { "from_arg": "reason" }
|
|
177
|
+
},
|
|
178
|
+
"allowed_columns": ["late_fee_cents", "waiver_reason"],
|
|
179
|
+
"numeric_bounds": {
|
|
180
|
+
"late_fee_cents": { "minimum": 0, "maximum": 10000 }
|
|
181
|
+
},
|
|
182
|
+
"conflict_guard": { "column": "updated_at" },
|
|
183
|
+
"approval": { "mode": "human", "required_role": "billing_lead" }
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"name": "orders.inspect_order",
|
|
187
|
+
"kind": "read",
|
|
188
|
+
"source": "app_postgres",
|
|
189
|
+
"context": "local_operator",
|
|
190
|
+
"target": {
|
|
191
|
+
"schema": "public",
|
|
192
|
+
"table": "orders",
|
|
193
|
+
"primary_key": "id",
|
|
194
|
+
"tenant_key": "tenant_id"
|
|
195
|
+
},
|
|
196
|
+
"args": {
|
|
197
|
+
"order_id": { "type": "string", "required": true, "max_length": 128 }
|
|
198
|
+
},
|
|
199
|
+
"lookup": { "id_from_arg": "order_id" },
|
|
200
|
+
"visible_columns": ["id", "tenant_id", "customer_id", "status", "status_change_reason", "updated_at"],
|
|
201
|
+
"evidence": "required",
|
|
202
|
+
"max_rows": 1
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "orders.propose_status_change",
|
|
206
|
+
"kind": "proposal",
|
|
207
|
+
"source": "app_postgres",
|
|
208
|
+
"context": "local_operator",
|
|
209
|
+
"target": {
|
|
210
|
+
"schema": "public",
|
|
211
|
+
"table": "orders",
|
|
212
|
+
"primary_key": "id",
|
|
213
|
+
"tenant_key": "tenant_id"
|
|
214
|
+
},
|
|
215
|
+
"args": {
|
|
216
|
+
"order_id": { "type": "string", "required": true, "max_length": 128 },
|
|
217
|
+
"status": { "type": "string", "required": true, "enum": ["ready_to_ship", "canceled"] },
|
|
218
|
+
"reason": { "type": "string", "required": true, "max_length": 500 }
|
|
219
|
+
},
|
|
220
|
+
"lookup": { "id_from_arg": "order_id" },
|
|
221
|
+
"visible_columns": ["id", "tenant_id", "customer_id", "status", "status_change_reason", "updated_at"],
|
|
222
|
+
"evidence": "required",
|
|
223
|
+
"max_rows": 1,
|
|
224
|
+
"patch": {
|
|
225
|
+
"status": { "from_arg": "status" },
|
|
226
|
+
"status_change_reason": { "from_arg": "reason" }
|
|
227
|
+
},
|
|
228
|
+
"allowed_columns": ["status", "status_change_reason"],
|
|
229
|
+
"transition_guards": {
|
|
230
|
+
"status": {
|
|
231
|
+
"allowed": {
|
|
232
|
+
"paid": ["ready_to_ship", "canceled"],
|
|
233
|
+
"processing": ["ready_to_ship"]
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"conflict_guard": { "column": "updated_at" },
|
|
238
|
+
"approval": { "mode": "human", "required_role": "orders_lead" }
|
|
239
|
+
}
|
|
240
|
+
]
|
|
241
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"benchmark": "mcp-efficiency",
|
|
3
|
+
"fixture": "late-fee-waiver",
|
|
4
|
+
"tokenizer": {
|
|
5
|
+
"name": "synapsor-fixture-tokenizer-v1",
|
|
6
|
+
"version": 1,
|
|
7
|
+
"method": "deterministic regex tokenization for fixture comparison; not a model billing tokenizer"
|
|
8
|
+
},
|
|
9
|
+
"note": "This benchmark compares the included fixture/reference workflow only. It is not a universal token-savings claim.",
|
|
10
|
+
"paths": {
|
|
11
|
+
"generic_database_mcp_reference": {
|
|
12
|
+
"exposed_tools": 4,
|
|
13
|
+
"serialized_tools_list_bytes": 822,
|
|
14
|
+
"serialized_tools_list_tokens": 298,
|
|
15
|
+
"schema_context_bytes": 215,
|
|
16
|
+
"schema_context_tokens": 75,
|
|
17
|
+
"business_result_bytes": 199,
|
|
18
|
+
"business_result_tokens": 77,
|
|
19
|
+
"scripted_tool_calls": 5,
|
|
20
|
+
"exposes_raw_sql": true,
|
|
21
|
+
"exposes_write_credentials": false,
|
|
22
|
+
"approval_separated": false,
|
|
23
|
+
"stale_row_conflict_checked": false
|
|
24
|
+
},
|
|
25
|
+
"synapsor_runner_semantic_path": {
|
|
26
|
+
"exposed_tools": 2,
|
|
27
|
+
"serialized_tools_list_bytes": 728,
|
|
28
|
+
"serialized_tools_list_tokens": 236,
|
|
29
|
+
"schema_context_bytes": 331,
|
|
30
|
+
"schema_context_tokens": 87,
|
|
31
|
+
"business_result_bytes": 277,
|
|
32
|
+
"business_result_tokens": 91,
|
|
33
|
+
"scripted_tool_calls": 2,
|
|
34
|
+
"exposes_raw_sql": false,
|
|
35
|
+
"exposes_write_credentials": false,
|
|
36
|
+
"approval_separated": true,
|
|
37
|
+
"stale_row_conflict_checked": true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"scripted_plans": {
|
|
41
|
+
"generic_database_mcp_reference": [
|
|
42
|
+
"list_tables",
|
|
43
|
+
"describe_table invoices",
|
|
44
|
+
"query_database SELECT invoice",
|
|
45
|
+
"formulate raw UPDATE",
|
|
46
|
+
"execute_sql UPDATE invoice"
|
|
47
|
+
],
|
|
48
|
+
"synapsor_runner_semantic_path": [
|
|
49
|
+
"billing.inspect_invoice",
|
|
50
|
+
"billing.propose_late_fee_waiver"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
MCP efficiency benchmark: late-fee-waiver fixture
|
|
2
|
+
Tokenizer: synapsor-fixture-tokenizer-v1 (deterministic fixture tokenizer; not a model billing tokenizer)
|
|
3
|
+
Scope: included fixture/reference workflow only; not a universal savings claim.
|
|
4
|
+
|
|
5
|
+
Generic database MCP reference:
|
|
6
|
+
exposed tools: 4
|
|
7
|
+
tools/list: 822 bytes, 298 tokens
|
|
8
|
+
scripted tool calls: 5
|
|
9
|
+
schema/context: 215 bytes, 75 tokens
|
|
10
|
+
business result: 199 bytes, 77 tokens
|
|
11
|
+
raw SQL exposed: yes
|
|
12
|
+
approval separated: no
|
|
13
|
+
stale-row conflict checked: no
|
|
14
|
+
|
|
15
|
+
Synapsor Runner semantic path:
|
|
16
|
+
exposed tools: 2
|
|
17
|
+
tools/list: 728 bytes, 236 tokens
|
|
18
|
+
scripted tool calls: 2
|
|
19
|
+
schema/context: 331 bytes, 87 tokens
|
|
20
|
+
business result: 277 bytes, 91 tokens
|
|
21
|
+
raw SQL exposed: no
|
|
22
|
+
approval separated: yes
|
|
23
|
+
stale-row conflict checked: yes
|
|
24
|
+
|
|
25
|
+
Run with --json to inspect machine-readable measurements and scripted plans.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "synapsor.protocol-manifest.v1",
|
|
3
|
+
"protocol_set": "database-mcp-writeback",
|
|
4
|
+
"version": "0.1.0-alpha",
|
|
5
|
+
"hash_algorithm": "sha256",
|
|
6
|
+
"note": "This manifest is copied in Synapsor main protocol/MANIFEST.json and synapsor-runner fixtures/protocol/MANIFEST.json. Hashes are over the checked-in JSON artifact bytes.",
|
|
7
|
+
"artifacts": [
|
|
8
|
+
{
|
|
9
|
+
"kind": "fixture",
|
|
10
|
+
"name": "change-set.late-fee-waiver.v1.json",
|
|
11
|
+
"sha256": "7112d0f28832e61b4ac5846d169666c0476ba92eb68c6790c10ac614ee3f2b33"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"kind": "fixture",
|
|
15
|
+
"name": "execution-receipt.applied.v1.json",
|
|
16
|
+
"sha256": "5af8be1b72b03d5a4c7af22748d9ade9f0febbf5e9503931054361ef998b5870"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "fixture",
|
|
20
|
+
"name": "execution-receipt.conflict.v1.json",
|
|
21
|
+
"sha256": "64e8a5fd90cdeafa2dd92a2c67cad1307b9d09e585cc82b06b987bde382f7733"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"kind": "fixture",
|
|
25
|
+
"name": "runner-registration.v1.json",
|
|
26
|
+
"sha256": "3eaf844cdc94a4274601cedfed7252d65dd837a345c8c3b0f17ab6bbdf7f75da"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"kind": "fixture",
|
|
30
|
+
"name": "writeback-job.late-fee-waiver.v1.json",
|
|
31
|
+
"sha256": "577e7987427031b55134c3d7296e644b1c8b7adec495758d4cff3665e954dbc8"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"kind": "schema",
|
|
35
|
+
"name": "change-set.v1.schema.json",
|
|
36
|
+
"sha256": "4e52b369b0d3bea30b0ed7b61ec239fc67de3dc691ed4014d6d5eabc7d2be4de"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"kind": "schema",
|
|
40
|
+
"name": "execution-receipt.v1.schema.json",
|
|
41
|
+
"sha256": "69504ce51fa66440e42d57ef6cb36cc6d8543427d8d385c9ccff954ecae5ec83"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"kind": "schema",
|
|
45
|
+
"name": "runner-registration.v1.schema.json",
|
|
46
|
+
"sha256": "86242555545b44ae747965ddb8aa35e2982587c76c2538f0f646e8b63994286b"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"kind": "schema",
|
|
50
|
+
"name": "writeback-job.v1.schema.json",
|
|
51
|
+
"sha256": "eab35194dd6b6caa7694aa8f14afbf265338d6ee8ed3d3db5d08ec83c4e7092e"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "synapsor.change-set.v1",
|
|
3
|
+
"proposal_id": "wrp_123",
|
|
4
|
+
"proposal_version": 1,
|
|
5
|
+
"action": "billing.waive_late_fee",
|
|
6
|
+
"mode": "review_required",
|
|
7
|
+
"principal": {
|
|
8
|
+
"id": "support_agent_17",
|
|
9
|
+
"source": "trusted_session"
|
|
10
|
+
},
|
|
11
|
+
"scope": {
|
|
12
|
+
"tenant_id": "acme",
|
|
13
|
+
"business_object": "invoice",
|
|
14
|
+
"object_id": "INV-3001"
|
|
15
|
+
},
|
|
16
|
+
"source": {
|
|
17
|
+
"kind": "external_postgres",
|
|
18
|
+
"source_id": "src_pg_acme",
|
|
19
|
+
"schema": "public",
|
|
20
|
+
"table": "invoices",
|
|
21
|
+
"primary_key": {
|
|
22
|
+
"column": "id",
|
|
23
|
+
"value": "INV-3001"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"before": {
|
|
27
|
+
"late_fee_cents": 5500,
|
|
28
|
+
"waiver_reason": null,
|
|
29
|
+
"updated_at": "2026-06-20T14:31:08Z"
|
|
30
|
+
},
|
|
31
|
+
"patch": {
|
|
32
|
+
"late_fee_cents": 0,
|
|
33
|
+
"waiver_reason": "customer requested review"
|
|
34
|
+
},
|
|
35
|
+
"after": {
|
|
36
|
+
"late_fee_cents": 0,
|
|
37
|
+
"waiver_reason": "customer requested review",
|
|
38
|
+
"updated_at": "2026-06-20T14:31:08Z"
|
|
39
|
+
},
|
|
40
|
+
"guards": {
|
|
41
|
+
"tenant": {
|
|
42
|
+
"column": "tenant_id",
|
|
43
|
+
"value": "acme"
|
|
44
|
+
},
|
|
45
|
+
"allowed_columns": [
|
|
46
|
+
"late_fee_cents",
|
|
47
|
+
"waiver_reason"
|
|
48
|
+
],
|
|
49
|
+
"expected_version": {
|
|
50
|
+
"column": "updated_at",
|
|
51
|
+
"value": "2026-06-20T14:31:08Z"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"evidence": {
|
|
55
|
+
"bundle_id": "ev_456",
|
|
56
|
+
"query_fingerprint": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
|
|
57
|
+
"items": []
|
|
58
|
+
},
|
|
59
|
+
"approval": {
|
|
60
|
+
"status": "pending",
|
|
61
|
+
"required_role": "support_lead"
|
|
62
|
+
},
|
|
63
|
+
"writeback": {
|
|
64
|
+
"status": "not_applied",
|
|
65
|
+
"mode": "trusted_worker_required"
|
|
66
|
+
},
|
|
67
|
+
"source_database_mutated": false,
|
|
68
|
+
"integrity": {
|
|
69
|
+
"proposal_hash": "sha256:2222222222222222222222222222222222222222222222222222222222222222"
|
|
70
|
+
},
|
|
71
|
+
"created_at": "2026-06-20T14:31:09Z"
|
|
72
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "synapsor.execution-receipt.v1",
|
|
3
|
+
"writeback_job_id": "wbj_123",
|
|
4
|
+
"proposal_id": "wrp_123",
|
|
5
|
+
"runner_id": "runner_123",
|
|
6
|
+
"status": "applied",
|
|
7
|
+
"rows_affected": 1,
|
|
8
|
+
"idempotency_key": "wrp_123:INV-3001",
|
|
9
|
+
"previous_version": "2026-06-20T14:31:08Z",
|
|
10
|
+
"new_version": "2026-06-20T14:34:19Z",
|
|
11
|
+
"source_database_mutated": true,
|
|
12
|
+
"executed_at": "2026-06-20T14:34:19Z",
|
|
13
|
+
"receipt_hash": "sha256:3333333333333333333333333333333333333333333333333333333333333333"
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "synapsor.execution-receipt.v1",
|
|
3
|
+
"writeback_job_id": "wbj_124",
|
|
4
|
+
"proposal_id": "wrp_124",
|
|
5
|
+
"runner_id": "runner_123",
|
|
6
|
+
"status": "conflict",
|
|
7
|
+
"rows_affected": 0,
|
|
8
|
+
"idempotency_key": "wrp_124:INV-3001",
|
|
9
|
+
"previous_version": "2026-06-20T14:31:08Z",
|
|
10
|
+
"new_version": "2026-06-20T14:39:19Z",
|
|
11
|
+
"source_database_mutated": false,
|
|
12
|
+
"executed_at": "2026-06-20T14:40:19Z",
|
|
13
|
+
"safe_error_code": "VERSION_CONFLICT",
|
|
14
|
+
"receipt_hash": "sha256:4444444444444444444444444444444444444444444444444444444444444444"
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "synapsor.runner-registration.v1",
|
|
3
|
+
"runner_id": "runner_123",
|
|
4
|
+
"runner_version": "0.1.0-alpha.0",
|
|
5
|
+
"engines": [
|
|
6
|
+
"postgres",
|
|
7
|
+
"mysql"
|
|
8
|
+
],
|
|
9
|
+
"capabilities": [
|
|
10
|
+
"single_row_update",
|
|
11
|
+
"idempotency_receipts",
|
|
12
|
+
"version_conflict_guard"
|
|
13
|
+
],
|
|
14
|
+
"scope": {
|
|
15
|
+
"project_id": "acme-support",
|
|
16
|
+
"source_ids": [
|
|
17
|
+
"src_pg_acme",
|
|
18
|
+
"src_mysql_acme"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"registered_at": "2026-06-20T14:30:00Z"
|
|
22
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "synapsor.writeback-job.v1",
|
|
3
|
+
"writeback_job_id": "wbj_123",
|
|
4
|
+
"proposal_id": "wrp_123",
|
|
5
|
+
"proposal_version": 1,
|
|
6
|
+
"proposal_hash": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
|
|
7
|
+
"runner_scope": {
|
|
8
|
+
"project_id": "acme-support",
|
|
9
|
+
"source_id": "src_pg_acme"
|
|
10
|
+
},
|
|
11
|
+
"engine": "postgres",
|
|
12
|
+
"operation": "single_row_update",
|
|
13
|
+
"target": {
|
|
14
|
+
"schema": "public",
|
|
15
|
+
"table": "invoices",
|
|
16
|
+
"primary_key": {
|
|
17
|
+
"column": "id",
|
|
18
|
+
"value": "INV-3001"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"tenant_guard": {
|
|
22
|
+
"column": "tenant_id",
|
|
23
|
+
"value": "acme"
|
|
24
|
+
},
|
|
25
|
+
"allowed_columns": [
|
|
26
|
+
"late_fee_cents",
|
|
27
|
+
"waiver_reason"
|
|
28
|
+
],
|
|
29
|
+
"patch": {
|
|
30
|
+
"late_fee_cents": 0,
|
|
31
|
+
"waiver_reason": "approved support waiver"
|
|
32
|
+
},
|
|
33
|
+
"conflict_guard": {
|
|
34
|
+
"kind": "column",
|
|
35
|
+
"column": "updated_at",
|
|
36
|
+
"expected_value": "2026-06-20T14:31:08Z"
|
|
37
|
+
},
|
|
38
|
+
"idempotency_key": "wrp_123:INV-3001",
|
|
39
|
+
"lease": {
|
|
40
|
+
"lease_id": "lease_123",
|
|
41
|
+
"attempt": 1,
|
|
42
|
+
"expires_at": "2026-06-20T14:36:00Z"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synapsor/runner",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.11",
|
|
4
4
|
"description": "Commit-safe MCP runner for Postgres and MySQL agents",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"synapsor-runner": "dist/
|
|
8
|
+
"synapsor-runner": "dist/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
|
-
"dist/bin.cjs",
|
|
12
11
|
"dist/cli.js",
|
|
13
12
|
"dist/cli.d.ts",
|
|
14
13
|
"dist/cli.d.ts.map",
|
|
15
14
|
"dist/local-ui.d.ts",
|
|
16
15
|
"dist/local-ui.d.ts.map",
|
|
16
|
+
"dist/runner.mjs",
|
|
17
|
+
"docs/**/*.md",
|
|
18
|
+
"examples/dangerous-mcp-tools.json",
|
|
19
|
+
"examples/app-owned-writeback/**",
|
|
20
|
+
"examples/mcp-postgres-billing-app-handler/**",
|
|
21
|
+
"examples/openai-agents-http/**",
|
|
22
|
+
"examples/openai-agents-stdio/**",
|
|
23
|
+
"examples/reference-support-billing-app/**",
|
|
24
|
+
"fixtures/**",
|
|
25
|
+
"recipes/**/*.json",
|
|
17
26
|
"README.md",
|
|
18
27
|
"LICENSE",
|
|
19
|
-
"NOTICE"
|
|
28
|
+
"NOTICE",
|
|
29
|
+
"TRADEMARKS.md"
|
|
20
30
|
],
|
|
21
31
|
"engines": {
|
|
22
32
|
"node": ">=22.5.0"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "accounts.trial_extension",
|
|
3
|
+
"title": "Trial extension",
|
|
4
|
+
"summary": "Inspect one account and propose a bounded trial extension.",
|
|
5
|
+
"expected_table_type": "accounts or subscriptions table",
|
|
6
|
+
"required_columns": ["id", "tenant_id", "trial_ends_at", "extension_reason", "updated_at"],
|
|
7
|
+
"recommended_primary_key": "id",
|
|
8
|
+
"recommended_tenant_key": "tenant_id",
|
|
9
|
+
"recommended_conflict_column": "updated_at",
|
|
10
|
+
"visible_columns": ["id", "tenant_id", "plan", "trial_ends_at", "extension_reason", "updated_at"],
|
|
11
|
+
"allowed_write_columns": ["trial_ends_at", "extension_reason"],
|
|
12
|
+
"semantic_tools": ["accounts.inspect_account", "accounts.propose_trial_extension"],
|
|
13
|
+
"notes": [
|
|
14
|
+
"Use a handler executor if trial changes must go through your billing service."
|
|
15
|
+
],
|
|
16
|
+
"spec": {
|
|
17
|
+
"version": 1,
|
|
18
|
+
"engine": "postgres",
|
|
19
|
+
"mode": "review",
|
|
20
|
+
"schema": "public",
|
|
21
|
+
"table": "accounts",
|
|
22
|
+
"primary_key": "id",
|
|
23
|
+
"tenant_key": "tenant_id",
|
|
24
|
+
"conflict_column": "updated_at",
|
|
25
|
+
"namespace": "accounts",
|
|
26
|
+
"object_name": "account",
|
|
27
|
+
"inspect_tool_name": "accounts.inspect_account",
|
|
28
|
+
"proposal_tool_name": "accounts.propose_trial_extension",
|
|
29
|
+
"lookup_arg": "account_id",
|
|
30
|
+
"visible_columns": ["id", "tenant_id", "plan", "trial_ends_at", "extension_reason", "updated_at"],
|
|
31
|
+
"allowed_columns": ["trial_ends_at", "extension_reason"],
|
|
32
|
+
"patch": {
|
|
33
|
+
"trial_ends_at": { "from_arg": "trial_ends_at" },
|
|
34
|
+
"extension_reason": { "from_arg": "reason" }
|
|
35
|
+
},
|
|
36
|
+
"patch_args": {
|
|
37
|
+
"trial_ends_at": { "type": "string", "required": true, "max_length": 64 },
|
|
38
|
+
"reason": { "type": "string", "required": true, "max_length": 500 }
|
|
39
|
+
},
|
|
40
|
+
"approval": { "required_role": "account_admin" }
|
|
41
|
+
}
|
|
42
|
+
}
|