@synapsor/runner 1.4.122 → 1.5.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 (61) hide show
  1. package/CHANGELOG.md +71 -19
  2. package/README.md +56 -46
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/local-ui.d.ts.map +1 -1
  5. package/dist/runner.mjs +14531 -8137
  6. package/dist/runtime.d.ts +50 -0
  7. package/dist/runtime.d.ts.map +1 -0
  8. package/dist/runtime.mjs +15066 -0
  9. package/docs/README.md +19 -3
  10. package/docs/capability-authoring.md +17 -1
  11. package/docs/contract-review.md +33 -0
  12. package/docs/database-enforced-scope.md +273 -0
  13. package/docs/dependency-license-inventory.md +6 -2
  14. package/docs/doctor.md +17 -0
  15. package/docs/effect-regression.md +142 -0
  16. package/docs/getting-started-own-database.md +7 -0
  17. package/docs/local-mode.md +7 -3
  18. package/docs/mcp-apps.md +188 -0
  19. package/docs/mcp-audit.md +54 -0
  20. package/docs/mcp-client-setup.md +16 -4
  21. package/docs/mcp-clients.md +8 -0
  22. package/docs/production.md +8 -0
  23. package/docs/release-notes.md +67 -11
  24. package/docs/release-policy.md +9 -5
  25. package/docs/runner-config-reference.md +25 -0
  26. package/docs/schema-api-candidates.md +68 -0
  27. package/docs/security-boundary.md +14 -1
  28. package/docs/shadow-studies.md +198 -0
  29. package/examples/mcp-postgres-billing-app-handler/app-handler.mjs +9 -1
  30. package/examples/mcp-postgres-billing-app-handler/schema.sql +11 -0
  31. package/examples/mcp-postgres-billing-app-handler/synapsor-handler.mjs +3 -0
  32. package/examples/raw-sql-vs-synapsor/Makefile +2 -2
  33. package/examples/raw-sql-vs-synapsor/README.md +6 -4
  34. package/examples/support-billing-agent/Makefile +5 -1
  35. package/examples/support-billing-agent/README.md +39 -5
  36. package/examples/support-billing-agent/db/schema.sql +88 -1
  37. package/examples/support-billing-agent/db/seed.sql +15 -15
  38. package/examples/support-billing-agent/scripts/run-demo.sh +4 -0
  39. package/examples/support-billing-agent/scripts/run-evaluation.sh +62 -0
  40. package/examples/support-billing-agent/shadow-study/cases.jsonl +6 -0
  41. package/examples/support-billing-agent/shadow-study/outcomes.jsonl +2 -0
  42. package/examples/support-billing-agent/synapsor.runner.json +17 -5
  43. package/fixtures/contracts/capability-surface-fitness.contract.json +190 -0
  44. package/fixtures/effects/changed/eff_support_late_fee_v1.result.json +58 -0
  45. package/fixtures/effects/dataset.json +8 -0
  46. package/fixtures/effects/results/eff_support_late_fee_v1.result.json +59 -0
  47. package/fixtures/effects/support-late-fee.effect.json +71 -0
  48. package/fixtures/generators/drizzle/malicious.ts +11 -0
  49. package/fixtures/generators/drizzle/schema.ts +12 -0
  50. package/fixtures/generators/openapi/external-ref.yaml +15 -0
  51. package/fixtures/generators/openapi/openapi.yaml +81 -0
  52. package/fixtures/generators/prisma/schema.prisma +34 -0
  53. package/package.json +13 -2
  54. package/schemas/effect-dataset.schema.json +19 -0
  55. package/schemas/effect-fixture.schema.json +191 -0
  56. package/schemas/effect-result.schema.json +52 -0
  57. package/schemas/mcp-audit-candidates.schema.json +41 -0
  58. package/schemas/mcp-audit-report.schema.json +104 -0
  59. package/schemas/schema-candidate-review.schema.json +167 -0
  60. package/schemas/schema-candidates.schema.json +49 -0
  61. package/schemas/synapsor.runner.schema.json +51 -0
@@ -0,0 +1,50 @@
1
+ export type TenantCredentialResolver = {
2
+ id: string;
3
+ resolve(input: {
4
+ source_name: string;
5
+ engine: "postgres" | "mysql";
6
+ access: "read" | "write";
7
+ tenant_id: string;
8
+ principal: string;
9
+ }): Promise<{
10
+ connection_url: string;
11
+ credential_id: string;
12
+ expires_at?: string;
13
+ }>;
14
+ };
15
+ export type RunnerStdioOptions = {
16
+ configPath?: string;
17
+ storePath?: string;
18
+ credentialResolver: TenantCredentialResolver;
19
+ };
20
+ export type RunnerHttpOptions = RunnerStdioOptions & {
21
+ host?: string;
22
+ port?: number;
23
+ authTokenEnv?: string;
24
+ devNoAuth?: boolean;
25
+ corsOrigin?: string;
26
+ env?: Record<string, string | undefined>;
27
+ };
28
+ export type RunnerHttpServerHandle = {
29
+ host: string;
30
+ port: number;
31
+ url: string;
32
+ close(): Promise<void>;
33
+ };
34
+ /**
35
+ * Embed Runner's stdio MCP transport with an application-owned tenant
36
+ * credential broker. The CLI intentionally does not load executable resolver
37
+ * modules.
38
+ */
39
+ export declare function serveRunnerStdio(options: RunnerStdioOptions): Promise<void>;
40
+ /**
41
+ * Embed the spec-compatible Streamable HTTP transport with an
42
+ * application-owned tenant credential broker.
43
+ */
44
+ export declare function startRunnerStreamableHttp(options: RunnerHttpOptions): Promise<RunnerHttpServerHandle>;
45
+ /**
46
+ * Embed the legacy JSON-RPC HTTP bridge. Prefer Streamable HTTP for new MCP
47
+ * clients.
48
+ */
49
+ export declare function startRunnerJsonRpcHttp(options: RunnerHttpOptions): Promise<RunnerHttpServerHandle>;
50
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,wBAAwB,GAAG;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,KAAK,EAAE;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;QAC7B,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QACzB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;CACJ,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,wBAAwB,CAAC;CAC9C,C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