@synapsor/runner 0.1.0-alpha.10 → 0.1.0-alpha.13

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 (54) hide show
  1. package/README.md +203 -21
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/runner.mjs +1103 -115
  4. package/docs/README.md +38 -0
  5. package/docs/app-owned-executors.md +26 -0
  6. package/docs/capability-authoring.md +265 -0
  7. package/docs/cloud-mode.md +24 -0
  8. package/docs/current-scope.md +24 -0
  9. package/docs/dependency-license-inventory.md +35 -0
  10. package/docs/doctor.md +98 -0
  11. package/docs/handler-helper.md +200 -0
  12. package/docs/http-mcp.md +35 -1
  13. package/docs/licensing.md +36 -0
  14. package/docs/local-mode.md +13 -2
  15. package/docs/mcp-client-setup.md +39 -0
  16. package/docs/openai-agents-sdk.md +57 -0
  17. package/docs/release-notes.md +76 -2
  18. package/docs/release-policy.md +86 -0
  19. package/docs/result-envelope-v2.md +148 -0
  20. package/docs/rfcs/001-result-envelope-v2.md +143 -0
  21. package/docs/rfcs/002-app-owned-handler-helper.md +161 -0
  22. package/docs/rfcs/003-integrator-feedback-teardown.md +97 -0
  23. package/docs/store-lifecycle.md +83 -0
  24. package/docs/use-your-own-database.md +18 -0
  25. package/docs/writeback-executors.md +29 -0
  26. package/examples/app-owned-writeback/README.md +1 -0
  27. package/examples/mcp-postgres-billing-app-handler/README.md +86 -0
  28. package/examples/mcp-postgres-billing-app-handler/app-handler.mjs +125 -0
  29. package/examples/mcp-postgres-billing-app-handler/docker-compose.yml +13 -0
  30. package/examples/mcp-postgres-billing-app-handler/schema.sql +59 -0
  31. package/examples/mcp-postgres-billing-app-handler/scripts/run-demo.sh +100 -0
  32. package/examples/mcp-postgres-billing-app-handler/seed.sql +39 -0
  33. package/examples/mcp-postgres-billing-app-handler/synapsor-handler.mjs +437 -0
  34. package/examples/mcp-postgres-billing-app-handler/synapsor.runner.json +158 -0
  35. package/examples/openai-agents-http/README.md +10 -2
  36. package/examples/openai-agents-stdio/README.md +8 -4
  37. package/examples/openai-agents-stdio/agent.py +2 -0
  38. package/fixtures/benchmark/mcp-efficiency.json +53 -0
  39. package/fixtures/benchmark/mcp-efficiency.txt +25 -0
  40. package/fixtures/protocol/MANIFEST.json +54 -0
  41. package/fixtures/protocol/change-set.late-fee-waiver.v1.json +72 -0
  42. package/fixtures/protocol/execution-receipt.applied.v1.json +14 -0
  43. package/fixtures/protocol/execution-receipt.conflict.v1.json +15 -0
  44. package/fixtures/protocol/runner-registration.v1.json +22 -0
  45. package/fixtures/protocol/writeback-job.late-fee-waiver.v1.json +44 -0
  46. package/package.json +4 -1
  47. package/schemas/change-set.v1.schema.json +140 -0
  48. package/schemas/execution-receipt.v1.schema.json +34 -0
  49. package/schemas/onboarding-selection.v1.schema.json +125 -0
  50. package/schemas/runner-registration.v1.schema.json +48 -0
  51. package/schemas/synapsor.app-handler-receipt.v1.json +39 -0
  52. package/schemas/synapsor.app-handler-request.v1.json +119 -0
  53. package/schemas/synapsor.runner.schema.json +412 -0
  54. package/schemas/writeback-job.v1.schema.json +121 -0
@@ -0,0 +1,121 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.synapsor.ai/synapsor.writeback-job.v1.schema.json",
4
+ "title": "Synapsor Writeback Job v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema_version",
9
+ "writeback_job_id",
10
+ "proposal_id",
11
+ "proposal_version",
12
+ "proposal_hash",
13
+ "runner_scope",
14
+ "engine",
15
+ "operation",
16
+ "target",
17
+ "tenant_guard",
18
+ "allowed_columns",
19
+ "patch",
20
+ "conflict_guard",
21
+ "idempotency_key",
22
+ "lease"
23
+ ],
24
+ "properties": {
25
+ "schema_version": { "const": "synapsor.writeback-job.v1" },
26
+ "writeback_job_id": { "type": "string", "minLength": 1 },
27
+ "proposal_id": { "type": "string", "minLength": 1 },
28
+ "proposal_version": { "type": "integer", "minimum": 1 },
29
+ "proposal_hash": { "type": "string", "pattern": "^sha256:.+" },
30
+ "runner_scope": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": ["project_id", "source_id"],
34
+ "properties": {
35
+ "project_id": { "type": "string", "minLength": 1 },
36
+ "source_id": { "type": "string", "minLength": 1 }
37
+ }
38
+ },
39
+ "engine": { "enum": ["postgres", "mysql"] },
40
+ "operation": { "const": "single_row_update" },
41
+ "target": {
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "required": ["schema", "table", "primary_key"],
45
+ "properties": {
46
+ "schema": { "$ref": "#/$defs/safeIdentifier" },
47
+ "table": { "$ref": "#/$defs/safeIdentifier" },
48
+ "primary_key": { "$ref": "#/$defs/columnValue" }
49
+ }
50
+ },
51
+ "tenant_guard": { "$ref": "#/$defs/columnValue" },
52
+ "allowed_columns": {
53
+ "type": "array",
54
+ "items": { "$ref": "#/$defs/safeIdentifier" },
55
+ "minItems": 1,
56
+ "uniqueItems": true
57
+ },
58
+ "patch": { "$ref": "#/$defs/scalarMap" },
59
+ "conflict_guard": {
60
+ "oneOf": [
61
+ {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "required": ["kind", "column", "expected_value"],
65
+ "properties": {
66
+ "kind": { "const": "column" },
67
+ "column": { "$ref": "#/$defs/safeIdentifier" },
68
+ "expected_value": { "$ref": "#/$defs/scalar" }
69
+ }
70
+ },
71
+ {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["kind", "expected_hash"],
75
+ "properties": {
76
+ "kind": { "const": "row_hash" },
77
+ "expected_hash": { "type": "string", "minLength": 1 }
78
+ }
79
+ },
80
+ {
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "required": ["kind"],
84
+ "properties": {
85
+ "kind": { "const": "none" }
86
+ }
87
+ }
88
+ ]
89
+ },
90
+ "idempotency_key": { "type": "string", "minLength": 1 },
91
+ "lease": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "required": ["lease_id", "attempt", "expires_at"],
95
+ "properties": {
96
+ "lease_id": { "type": "string", "minLength": 1 },
97
+ "attempt": { "type": "integer", "minimum": 1 },
98
+ "expires_at": { "type": "string", "format": "date-time" }
99
+ }
100
+ }
101
+ },
102
+ "$defs": {
103
+ "safeIdentifier": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$" },
104
+ "scalar": { "type": ["string", "number", "boolean", "null"] },
105
+ "scalarMap": {
106
+ "type": "object",
107
+ "propertyNames": { "$ref": "#/$defs/safeIdentifier" },
108
+ "additionalProperties": { "$ref": "#/$defs/scalar" },
109
+ "minProperties": 1
110
+ },
111
+ "columnValue": {
112
+ "type": "object",
113
+ "additionalProperties": false,
114
+ "required": ["column", "value"],
115
+ "properties": {
116
+ "column": { "$ref": "#/$defs/safeIdentifier" },
117
+ "value": { "$ref": "#/$defs/scalar" }
118
+ }
119
+ }
120
+ }
121
+ }