@synapsor/runner 0.1.0-alpha.1 → 0.1.0-alpha.2

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.
Files changed (50) hide show
  1. package/README.md +15 -13
  2. package/TRADEMARKS.md +23 -0
  3. package/dist/cli.js +15 -8723
  4. package/dist/runner.mjs +8767 -0
  5. package/docs/MCP_RUNNER_IMPLEMENTATION_PLAN.md +187 -0
  6. package/docs/README.md +56 -0
  7. package/docs/architecture.md +65 -0
  8. package/docs/capability-config.md +180 -0
  9. package/docs/cloud-mode.md +140 -0
  10. package/docs/config-migrations.md +67 -0
  11. package/docs/demo-transcript.md +73 -0
  12. package/docs/dependency-license-inventory.md +35 -0
  13. package/docs/first-10-minutes.md +147 -0
  14. package/docs/getting-started-own-database.md +367 -0
  15. package/docs/licensing.md +38 -0
  16. package/docs/limitations.md +75 -0
  17. package/docs/local-mode.md +246 -0
  18. package/docs/local-ui.md +163 -0
  19. package/docs/mcp-audit.md +135 -0
  20. package/docs/mcp-client-setup.md +155 -0
  21. package/docs/mcp-efficiency-benchmark.md +84 -0
  22. package/docs/operations.md +38 -0
  23. package/docs/own-db-20-minutes.md +185 -0
  24. package/docs/production-readiness.md +39 -0
  25. package/docs/protocol.md +90 -0
  26. package/docs/recipes.md +61 -0
  27. package/docs/roadmap.md +13 -0
  28. package/docs/schema-inspection.md +88 -0
  29. package/docs/security-boundary.md +70 -0
  30. package/docs/shadow-mode.md +67 -0
  31. package/docs/telemetry.md +28 -0
  32. package/docs/threat-model.md +25 -0
  33. package/docs/troubleshooting-first-run.md +248 -0
  34. package/docs/trusted-context.md +70 -0
  35. package/docs/writeback-executors.md +128 -0
  36. package/examples/dangerous-mcp-tools.json +88 -0
  37. package/examples/reference-support-billing-app/README.md +86 -0
  38. package/examples/reference-support-billing-app/docker-compose.yml +13 -0
  39. package/examples/reference-support-billing-app/mcp-client.generic.json +11 -0
  40. package/examples/reference-support-billing-app/schema.sql +55 -0
  41. package/examples/reference-support-billing-app/scripts/run-demo.sh +7 -0
  42. package/examples/reference-support-billing-app/seed.sql +26 -0
  43. package/examples/reference-support-billing-app/synapsor.runner.json +136 -0
  44. package/package.json +10 -4
  45. package/recipes/accounts.trial_extension.json +42 -0
  46. package/recipes/billing.late_fee_waiver.json +46 -0
  47. package/recipes/credits.account_credit.json +45 -0
  48. package/recipes/orders.refund_review.json +57 -0
  49. package/recipes/support.ticket_resolution.json +51 -0
  50. package/dist/bin.cjs +0 -13
@@ -0,0 +1,46 @@
1
+ {
2
+ "id": "billing.late_fee_waiver",
3
+ "title": "Late-fee waiver",
4
+ "summary": "Inspect one invoice and create a review-required proposal to waive a late fee.",
5
+ "expected_table_type": "invoice or billing table",
6
+ "required_columns": ["id", "tenant_id", "late_fee_cents", "waiver_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", "late_fee_cents", "waiver_reason", "status", "updated_at"],
11
+ "allowed_write_columns": ["late_fee_cents", "waiver_reason"],
12
+ "semantic_tools": ["billing.inspect_invoice", "billing.propose_late_fee_waiver"],
13
+ "notes": [
14
+ "Start against staging.",
15
+ "Keep the model-facing tool proposal-only.",
16
+ "Set a business-specific maximum waiver bound before real use."
17
+ ],
18
+ "spec": {
19
+ "version": 1,
20
+ "engine": "postgres",
21
+ "mode": "review",
22
+ "schema": "public",
23
+ "table": "invoices",
24
+ "primary_key": "id",
25
+ "tenant_key": "tenant_id",
26
+ "conflict_column": "updated_at",
27
+ "namespace": "billing",
28
+ "object_name": "invoice",
29
+ "inspect_tool_name": "billing.inspect_invoice",
30
+ "proposal_tool_name": "billing.propose_late_fee_waiver",
31
+ "lookup_arg": "invoice_id",
32
+ "visible_columns": ["id", "tenant_id", "late_fee_cents", "waiver_reason", "status", "updated_at"],
33
+ "allowed_columns": ["late_fee_cents", "waiver_reason"],
34
+ "patch": {
35
+ "late_fee_cents": { "fixed": 0 },
36
+ "waiver_reason": { "from_arg": "reason" }
37
+ },
38
+ "patch_args": {
39
+ "reason": { "type": "string", "required": true, "max_length": 500 }
40
+ },
41
+ "numeric_bounds": {
42
+ "late_fee_cents": { "minimum": 0, "maximum": 10000 }
43
+ },
44
+ "approval": { "required_role": "billing_lead" }
45
+ }
46
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "id": "credits.account_credit",
3
+ "title": "Account credit",
4
+ "summary": "Inspect one account balance row and propose a bounded account credit.",
5
+ "expected_table_type": "account credits or balances table",
6
+ "required_columns": ["id", "tenant_id", "credit_cents", "credit_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", "credit_cents", "credit_reason", "updated_at"],
11
+ "allowed_write_columns": ["credit_cents", "credit_reason"],
12
+ "semantic_tools": ["credits.inspect_account_credit", "credits.propose_account_credit"],
13
+ "notes": [
14
+ "Configure the maximum credit bound before running against real data."
15
+ ],
16
+ "spec": {
17
+ "version": 1,
18
+ "engine": "postgres",
19
+ "mode": "review",
20
+ "schema": "public",
21
+ "table": "account_credits",
22
+ "primary_key": "id",
23
+ "tenant_key": "tenant_id",
24
+ "conflict_column": "updated_at",
25
+ "namespace": "credits",
26
+ "object_name": "account_credit",
27
+ "inspect_tool_name": "credits.inspect_account_credit",
28
+ "proposal_tool_name": "credits.propose_account_credit",
29
+ "lookup_arg": "credit_id",
30
+ "visible_columns": ["id", "tenant_id", "credit_cents", "credit_reason", "updated_at"],
31
+ "allowed_columns": ["credit_cents", "credit_reason"],
32
+ "patch": {
33
+ "credit_cents": { "from_arg": "credit_cents" },
34
+ "credit_reason": { "from_arg": "reason" }
35
+ },
36
+ "patch_args": {
37
+ "credit_cents": { "type": "number", "required": true, "minimum": 0, "maximum": 10000 },
38
+ "reason": { "type": "string", "required": true, "max_length": 500 }
39
+ },
40
+ "numeric_bounds": {
41
+ "credit_cents": { "minimum": 0, "maximum": 10000 }
42
+ },
43
+ "approval": { "required_role": "billing_lead" }
44
+ }
45
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "id": "orders.refund_review",
3
+ "title": "Refund review",
4
+ "summary": "Inspect one order and propose a reviewed refund status update.",
5
+ "expected_table_type": "orders table",
6
+ "required_columns": ["id", "tenant_id", "status", "refund_cents", "refund_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", "status", "total_cents", "refund_cents", "refund_reason", "updated_at"],
11
+ "allowed_write_columns": ["status", "refund_cents", "refund_reason"],
12
+ "semantic_tools": ["orders.inspect_order", "orders.propose_refund_review"],
13
+ "notes": [
14
+ "Use numeric bounds that match your real refund policy.",
15
+ "Keep payment-provider execution outside MCP."
16
+ ],
17
+ "spec": {
18
+ "version": 1,
19
+ "engine": "mysql",
20
+ "mode": "review",
21
+ "schema": "app",
22
+ "table": "orders",
23
+ "primary_key": "id",
24
+ "tenant_key": "tenant_id",
25
+ "conflict_column": "updated_at",
26
+ "namespace": "orders",
27
+ "object_name": "order",
28
+ "inspect_tool_name": "orders.inspect_order",
29
+ "proposal_tool_name": "orders.propose_refund_review",
30
+ "lookup_arg": "order_id",
31
+ "visible_columns": ["id", "tenant_id", "status", "total_cents", "refund_cents", "refund_reason", "updated_at"],
32
+ "allowed_columns": ["status", "refund_cents", "refund_reason"],
33
+ "patch": {
34
+ "status": { "from_arg": "next_status" },
35
+ "refund_cents": { "from_arg": "refund_cents" },
36
+ "refund_reason": { "from_arg": "reason" }
37
+ },
38
+ "patch_args": {
39
+ "next_status": { "type": "string", "required": true, "enum": ["refund_requested", "refunded", "needs_review"] },
40
+ "refund_cents": { "type": "number", "required": true, "minimum": 0, "maximum": 100000 },
41
+ "reason": { "type": "string", "required": true, "max_length": 500 }
42
+ },
43
+ "numeric_bounds": {
44
+ "refund_cents": { "minimum": 0, "maximum": 100000 }
45
+ },
46
+ "transition_guards": {
47
+ "status": {
48
+ "allowed": {
49
+ "paid": ["refund_requested", "needs_review"],
50
+ "shipped": ["refund_requested", "needs_review"],
51
+ "refund_requested": ["refunded", "needs_review"]
52
+ }
53
+ }
54
+ },
55
+ "approval": { "required_role": "ops_lead" }
56
+ }
57
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "id": "support.ticket_resolution",
3
+ "title": "Support ticket resolution",
4
+ "summary": "Inspect one support ticket and propose a reviewed status/resolution update.",
5
+ "expected_table_type": "support ticket table",
6
+ "required_columns": ["id", "tenant_id", "status", "resolution_note", "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", "subject", "status", "resolution_note", "updated_at"],
11
+ "allowed_write_columns": ["status", "resolution_note"],
12
+ "semantic_tools": ["support.inspect_ticket", "support.propose_ticket_resolution"],
13
+ "notes": [
14
+ "Use a safe view if ticket bodies contain sensitive data.",
15
+ "Keep status transitions explicit."
16
+ ],
17
+ "spec": {
18
+ "version": 1,
19
+ "engine": "postgres",
20
+ "mode": "review",
21
+ "schema": "public",
22
+ "table": "support_tickets",
23
+ "primary_key": "id",
24
+ "tenant_key": "tenant_id",
25
+ "conflict_column": "updated_at",
26
+ "namespace": "support",
27
+ "object_name": "ticket",
28
+ "inspect_tool_name": "support.inspect_ticket",
29
+ "proposal_tool_name": "support.propose_ticket_resolution",
30
+ "lookup_arg": "ticket_id",
31
+ "visible_columns": ["id", "tenant_id", "subject", "status", "resolution_note", "updated_at"],
32
+ "allowed_columns": ["status", "resolution_note"],
33
+ "patch": {
34
+ "status": { "from_arg": "next_status" },
35
+ "resolution_note": { "from_arg": "resolution_note" }
36
+ },
37
+ "patch_args": {
38
+ "next_status": { "type": "string", "required": true, "enum": ["pending_review", "resolved", "needs_human"] },
39
+ "resolution_note": { "type": "string", "required": true, "max_length": 1000 }
40
+ },
41
+ "transition_guards": {
42
+ "status": {
43
+ "allowed": {
44
+ "open": ["pending_review", "needs_human"],
45
+ "pending_review": ["resolved", "needs_human"]
46
+ }
47
+ }
48
+ },
49
+ "approval": { "required_role": "support_lead" }
50
+ }
51
+ }
package/dist/bin.cjs DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
- const { spawnSync } = require('node:child_process');
3
- const { join } = require('node:path');
4
- const result = spawnSync(process.execPath, ['--no-warnings', join(__dirname, 'cli.js'), ...process.argv.slice(2)], {
5
- stdio: 'inherit',
6
- env: { ...process.env, NODE_NO_WARNINGS: '1', SYNAPSOR_RUNNER_COMMAND_NAME: 'synapsor-runner' },
7
- });
8
- if (result.error) {
9
- console.error(result.error);
10
- process.exit(1);
11
- }
12
- if (result.signal) process.kill(process.pid, result.signal);
13
- process.exit(result.status ?? 1);