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