@synapsor/runner 0.1.0-alpha.9 → 0.1.1

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 (85) hide show
  1. package/CHANGELOG.md +189 -0
  2. package/README.md +949 -164
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/runner.mjs +2982 -238
  6. package/docs/README.md +90 -15
  7. package/docs/app-owned-executors.md +38 -0
  8. package/docs/capability-authoring.md +265 -0
  9. package/docs/cloud-mode.md +24 -0
  10. package/docs/current-scope.md +29 -0
  11. package/docs/dependency-license-inventory.md +35 -0
  12. package/docs/doctor.md +98 -0
  13. package/docs/getting-started-own-database.md +131 -46
  14. package/docs/handler-helper.md +228 -0
  15. package/docs/http-mcp.md +85 -17
  16. package/docs/licensing.md +36 -0
  17. package/docs/local-mode.md +44 -25
  18. package/docs/mcp-audit.md +8 -8
  19. package/docs/mcp-client-setup.md +59 -21
  20. package/docs/openai-agents-sdk.md +57 -0
  21. package/docs/recipes.md +6 -6
  22. package/docs/release-notes.md +348 -0
  23. package/docs/release-policy.md +125 -0
  24. package/docs/result-envelope-v2.md +151 -0
  25. package/docs/rfcs/001-result-envelope-v2.md +143 -0
  26. package/docs/rfcs/002-app-owned-handler-helper.md +161 -0
  27. package/docs/rfcs/003-integrator-feedback-teardown.md +97 -0
  28. package/docs/store-lifecycle.md +83 -0
  29. package/docs/troubleshooting-first-run.md +6 -6
  30. package/docs/use-your-own-database.md +18 -0
  31. package/docs/writeback-executors.md +92 -1
  32. package/examples/app-owned-writeback/README.md +128 -0
  33. package/examples/app-owned-writeback/business-actions.md +221 -0
  34. package/examples/app-owned-writeback/command-handler.mjs +55 -0
  35. package/examples/app-owned-writeback/node-fastify-handler.mjs +64 -0
  36. package/examples/app-owned-writeback/python-fastapi-handler.py +66 -0
  37. package/examples/claude-desktop-postgres/Makefile +6 -0
  38. package/examples/claude-desktop-postgres/README.md +40 -0
  39. package/examples/cursor-postgres/Makefile +6 -0
  40. package/examples/cursor-postgres/README.md +30 -0
  41. package/examples/mcp-postgres-billing-app-handler/README.md +94 -0
  42. package/examples/mcp-postgres-billing-app-handler/app-handler.mjs +123 -0
  43. package/examples/mcp-postgres-billing-app-handler/docker-compose.yml +13 -0
  44. package/examples/mcp-postgres-billing-app-handler/schema.sql +59 -0
  45. package/examples/mcp-postgres-billing-app-handler/scripts/run-demo.sh +100 -0
  46. package/examples/mcp-postgres-billing-app-handler/seed.sql +39 -0
  47. package/examples/mcp-postgres-billing-app-handler/synapsor-handler.mjs +437 -0
  48. package/examples/mcp-postgres-billing-app-handler/synapsor.runner.json +158 -0
  49. package/examples/mysql-refund-agent/Makefile +4 -0
  50. package/examples/mysql-refund-agent/README.md +36 -0
  51. package/examples/openai-agents-http/Makefile +6 -0
  52. package/examples/openai-agents-http/README.md +33 -12
  53. package/examples/openai-agents-http/agent.py +29 -65
  54. package/examples/openai-agents-stdio/Makefile +6 -0
  55. package/examples/openai-agents-stdio/README.md +24 -6
  56. package/examples/openai-agents-stdio/agent.py +4 -2
  57. package/examples/raw-sql-vs-synapsor/Makefile +11 -0
  58. package/examples/raw-sql-vs-synapsor/README.md +41 -0
  59. package/examples/reference-support-billing-app/README.md +16 -16
  60. package/examples/reference-support-billing-app/mcp-client.generic.json +1 -1
  61. package/examples/support-billing-agent/Makefile +19 -0
  62. package/examples/support-billing-agent/README.md +89 -0
  63. package/examples/support-billing-agent/app/README.md +13 -0
  64. package/examples/support-billing-agent/db/schema.sql +91 -0
  65. package/examples/support-billing-agent/db/seed.sql +43 -0
  66. package/examples/support-billing-agent/docker-compose.yml +13 -0
  67. package/examples/support-billing-agent/scripts/run-demo.sh +15 -0
  68. package/examples/support-billing-agent/synapsor.runner.json +233 -0
  69. package/fixtures/benchmark/mcp-efficiency.json +53 -0
  70. package/fixtures/benchmark/mcp-efficiency.txt +25 -0
  71. package/fixtures/protocol/MANIFEST.json +54 -0
  72. package/fixtures/protocol/change-set.late-fee-waiver.v1.json +72 -0
  73. package/fixtures/protocol/execution-receipt.applied.v1.json +14 -0
  74. package/fixtures/protocol/execution-receipt.conflict.v1.json +15 -0
  75. package/fixtures/protocol/runner-registration.v1.json +22 -0
  76. package/fixtures/protocol/writeback-job.late-fee-waiver.v1.json +44 -0
  77. package/package.json +27 -4
  78. package/schemas/change-set.v1.schema.json +140 -0
  79. package/schemas/execution-receipt.v1.schema.json +34 -0
  80. package/schemas/onboarding-selection.v1.schema.json +132 -0
  81. package/schemas/runner-registration.v1.schema.json +48 -0
  82. package/schemas/synapsor.app-handler-receipt.v1.json +39 -0
  83. package/schemas/synapsor.app-handler-request.v1.json +119 -0
  84. package/schemas/synapsor.runner.schema.json +415 -0
  85. package/schemas/writeback-job.v1.schema.json +121 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,189 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ No unreleased changes yet.
6
+
7
+ ## 0.1.1
8
+
9
+ ### Launch Readiness
10
+
11
+ - Reworked the README and packaged npm README so the first screen leads with
12
+ the `execute_sql` risk, the reviewed-business-action alternative, badges,
13
+ and the no-database quick demo.
14
+ - Added the self-contained `examples/support-billing-agent/` flagship demo with
15
+ schema, seed data, reviewed contract, app-boundary note, one-command
16
+ `make demo`, and the exact model-facing tools:
17
+ `support.inspect_ticket`, `support.propose_plan_credit`,
18
+ `billing.inspect_invoice`, and `billing.propose_late_fee_waiver`.
19
+ - Added copy-paste example entry points for raw SQL vs Synapsor,
20
+ Claude Desktop, Cursor, OpenAI Agents SDK over Streamable HTTP and stdio, and
21
+ MySQL refund review.
22
+ - Added agent-native repo guidance files for Codex/Claude/Cursor/Copilot and
23
+ verified in a temp copy that an agent can create an inspect/propose
24
+ capability with non-interactive CLI commands without reading generated
25
+ `dist/` files.
26
+ - Restructured the docs index into a task-first path from quickstart to raw SQL
27
+ risk, demo, own database setup, capability generation, MCP serving,
28
+ propose/approve/apply, replay/audit, app-owned handlers, and concepts.
29
+ - Added release-gate and repo hygiene assets, including issue/PR templates,
30
+ threat model/security references, README badges, and package metadata.
31
+ - Hardened package building so generated `.synapsor` local ledgers are not
32
+ shipped in npm examples.
33
+
34
+ ## 0.1.0
35
+
36
+ ### Stable Channel
37
+
38
+ - Promotes the alpha.17 safety/onboarding surface to the first stable
39
+ `@synapsor/runner` release.
40
+ - Documents the `0.1.x` compatibility promise for the `synapsor-runner` binary,
41
+ `synapsor.runner.json` schema version `1`, result envelope v2, stdio and
42
+ Streamable HTTP MCP surfaces, MCP client snippets, local inspection commands,
43
+ direct SQL writeback, and app-owned executor contracts.
44
+
45
+ ### Included From Alpha.17
46
+
47
+ - Prompt-free onboarding for scripts, CI, and LLM agents.
48
+ - Review-mode configs that avoid silently disabled writeback.
49
+ - `up --serve`, stale lease reclaim, result envelope v2 defaults for new
50
+ configs, app-owned handler warnings, final wizard preview, friendlier
51
+ capability names, local event webhooks, and smoke-call first-run guidance.
52
+
53
+ ## 0.1.0-alpha.17
54
+
55
+ ### Added
56
+
57
+ - Prompt-free onboarding for `onboard db` / `init` through `--yes`,
58
+ `--non-interactive`, and `--answers <file.json>`.
59
+ - Friendly scripted onboarding flags: `--tenant-column`, `--id-arg`, `--patch
60
+ column=fixed:value|arg:name`, `--patch-bounds`, `--status-guards`,
61
+ `--read-description`, `--read-returns-hint`, `--handler-output`, and
62
+ `--emit-handler`.
63
+ - Answers-file onboarding can emit the same artifacts as the wizard: reviewed
64
+ config, `.env.example`, MCP snippets, and optional handler template.
65
+ - Guided onboarding now shows a final "what I am about to write" preview where
66
+ users can revise visible fields or capability names before files are written.
67
+ - README and runner README now include a short "How An External Handler Works"
68
+ explanation directly after the writeback rule.
69
+ - `events webhook` / `events push` can POST local proposal/writeback lifecycle
70
+ events to a local/dev/staging HTTP endpoint for review UIs or notifications.
71
+
72
+ ### Changed
73
+
74
+ - When `--namespace` is omitted, generated capability names derive a namespace
75
+ from the selected table instead of defaulting to `source.*`.
76
+ - App-owned `http_handler` and `command_handler` generated configs mark the
77
+ Runner source as `read_only: true` when no writer env is supplied. These
78
+ configs now validate without a `WRITEBACK_DISABLED` warning.
79
+ - Direct SQL review-mode proposal capabilities still require `write_url_env`
80
+ readiness; missing writer env remains visible as `WRITEBACK_DISABLED`.
81
+ - Published docs/examples no longer contain install-looking
82
+ `@synapsor/handler` imports. The app-owned example uses the bundled
83
+ `synapsor-handler.mjs` shim directly.
84
+
85
+ ## 0.1.0-alpha.16
86
+
87
+ ### Added
88
+
89
+ - `synapsor-runner up` for first-session review-mode bring-up. It validates
90
+ the local config/store, checks active store leases, summarizes model-facing
91
+ tools, explains direct SQL versus app-owned executor writeback, and prints
92
+ the next smoke, approval, apply, replay, UI, and doctor commands.
93
+ - Guided app-owned executor setup can now write a starter handler template
94
+ during `init --wizard` / `start --from-env ... --mode review`.
95
+ - `result_format: 2` for a stable MCP result envelope with `ok`, `summary`,
96
+ `data`, `proposal`, `error`, `evidence`, `source_database_changed`, and
97
+ `_meta.canonical_capability`.
98
+ - `--result-format v1|v2` for `mcp serve`, `mcp serve --transport
99
+ streamable-http`, `mcp serve-streamable-http`, and the legacy JSON-RPC
100
+ bridge.
101
+ - Capability config fields `description`, per-argument `description`, and
102
+ `returns_hint`; these are surfaced in MCP tool metadata.
103
+ - `tools list` as a first-class alias for `tools preview`, including
104
+ `tools list --aliases`.
105
+ - `mcp client-config --include-instructions` for Claude/Cursor/OpenAI-style
106
+ client snippets with propose-first agent guidance.
107
+ - `schemas/synapsor.runner.schema.json` for editor validation.
108
+ - `docs/capability-authoring.md`, `docs/result-envelope-v2.md`, and RFC source
109
+ docs under `docs/rfcs/`.
110
+
111
+ ### Changed
112
+
113
+ - Handler templates, template CLI output, app-owned writeback docs, and
114
+ examples now carry the explicit handler security warning: app handlers own the
115
+ final business write and must re-check tenant/scope, conflict guards,
116
+ idempotency, business action, transactions, and safe receipts.
117
+ - OpenAI-safe aliases include the canonical Synapsor capability name in
118
+ descriptions/metadata so model-visible aliases can still be audited against
119
+ dotted capability names.
120
+ - v2 MCP errors redact raw driver/infra strings and map failures to a small
121
+ safe error-code enum.
122
+ - Release policy now keeps the stable channel gated on `up`, review-mode wizard
123
+ verification, handler warning coverage, clean npm install checks, and at
124
+ least one external developer following the README without source reading.
125
+
126
+ ### Compatibility
127
+
128
+ - Result envelope v1 remains the default in this alpha. Opt in with
129
+ `result_format: 2` or `--result-format v2`.
130
+ - The public command remains `synapsor-runner`.
131
+
132
+ ## 0.1.0-alpha.15
133
+
134
+ ### Changed
135
+
136
+ - Clarified that users install only `@synapsor/runner`. A handler is the
137
+ user's app endpoint or script for rich approved writes, and Runner includes
138
+ templates/examples to help build one.
139
+
140
+ ## 0.1.0-alpha.14
141
+
142
+ ### Changed
143
+
144
+ - Clarified that `@synapsor/handler` is not published as a standalone npm
145
+ package yet. The TypeScript helper currently exists in the source monorepo
146
+ and as the bundled `synapsor-handler.mjs` shim used by the packaged
147
+ app-owned executor example.
148
+ - Included `CHANGELOG.md` in the `@synapsor/runner` npm tarball so users can
149
+ inspect alpha changes without cloning the repository.
150
+
151
+ ## 0.1.0-alpha.13
152
+
153
+ ### Changed
154
+
155
+ - Reworked the README opening around a five-line mental model: agent talks to
156
+ Runner, Runner exposes capabilities, proposals are saved but not applied, and
157
+ approval/writeback stay outside the model-facing tool surface.
158
+ - Added plain definitions for capability, proposal, writeback, and executor near
159
+ the top of the README.
160
+ - Added the direct-writeback versus app-owned-executor rule up front: guarded
161
+ one-row updates can use Runner direct writeback; richer business actions use
162
+ an app-owned executor.
163
+ - Added a tiny readable own-database config example with one read capability and
164
+ one proposal capability so new users can picture what the guided wizard
165
+ creates.
166
+
167
+ ## 0.1.0-alpha.12
168
+
169
+ ### Added
170
+
171
+ - `doctor --check-writeback` verifies direct SQL writer connectivity,
172
+ receipt-table readiness, and rollback-only access to configured proposal
173
+ target tables/columns without mutating business rows.
174
+ - `docs/doctor.md` documents redacted setup checks, handler reachability,
175
+ direct SQL writeback probes, and receipt-table guidance.
176
+ - `store reset --yes` removes only the local SQLite ledger files and refuses
177
+ active server leases unless `--force` is provided.
178
+
179
+ ### Changed
180
+
181
+ - Doctor output now warns when direct SQL writeback has not been probed and
182
+ points to `--check-writeback`.
183
+ - Packed/public verification scripts exercise `store reset` in addition to
184
+ stats/prune.
185
+
186
+ ## 0.1.0-alpha.11
187
+
188
+ See [docs/release-notes.md](docs/release-notes.md) for the current published
189
+ alpha notes.