@synapsor/runner 1.5.0 → 1.5.3

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 (60) hide show
  1. package/CHANGELOG.md +92 -3
  2. package/README.md +96 -109
  3. package/dist/authoring.d.ts +23 -0
  4. package/dist/authoring.d.ts.map +1 -0
  5. package/dist/authoring.mjs +1318 -0
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +4 -5
  8. package/dist/local-ui.d.ts +14 -0
  9. package/dist/local-ui.d.ts.map +1 -1
  10. package/dist/runner.mjs +10845 -5598
  11. package/dist/runtime.mjs +29 -1
  12. package/dist/shadow.d.ts +36 -0
  13. package/dist/shadow.d.ts.map +1 -0
  14. package/dist/shadow.mjs +5262 -0
  15. package/docs/README.md +25 -2
  16. package/docs/alternatives.md +122 -0
  17. package/docs/capability-authoring.md +43 -0
  18. package/docs/client-recipes.md +218 -0
  19. package/docs/contract-testing.md +9 -7
  20. package/docs/cursor-plugin.md +78 -0
  21. package/docs/effect-regression.md +39 -2
  22. package/docs/fresh-developer-usability.md +110 -0
  23. package/docs/getting-started-own-database.md +96 -2
  24. package/docs/host-compatibility.md +59 -0
  25. package/docs/local-mode.md +6 -5
  26. package/docs/mcp-audit.md +166 -2
  27. package/docs/mcp-client-setup.md +4 -0
  28. package/docs/mcp-clients.md +33 -4
  29. package/docs/oss-vs-cloud.md +3 -0
  30. package/docs/release-notes.md +90 -4
  31. package/docs/security-boundary.md +20 -5
  32. package/docs/shadow-studies.md +47 -4
  33. package/docs/troubleshooting-first-run.md +46 -0
  34. package/examples/support-billing-agent/README.md +18 -0
  35. package/examples/support-billing-agent/app/README.md +6 -0
  36. package/examples/support-billing-agent/app/contract.ts +28 -0
  37. package/examples/support-billing-agent/app/effect-adapter.mjs +23 -0
  38. package/examples/support-billing-agent/app/record-shadow-outcomes.mjs +44 -0
  39. package/examples/support-billing-agent/scripts/run-evaluation.sh +6 -5
  40. package/examples/support-plan-credit/README.md +48 -2
  41. package/examples/support-plan-credit/mcp-client-examples/README.md +23 -0
  42. package/examples/support-plan-credit/mcp-client-examples/claude-code.sh +34 -0
  43. package/examples/support-plan-credit/mcp-client-examples/codex.config.toml +24 -0
  44. package/examples/support-plan-credit/mcp-client-examples/generic-stdio.mjs +35 -0
  45. package/examples/support-plan-credit/mcp-client-examples/generic-streamable-http.mjs +31 -0
  46. package/examples/support-plan-credit/mcp-client-examples/google-adk.py +40 -0
  47. package/examples/support-plan-credit/mcp-client-examples/langchain.mjs +29 -0
  48. package/examples/support-plan-credit/mcp-client-examples/llamaindex.py +36 -0
  49. package/examples/support-plan-credit/mcp-client-examples/openai-agents-stdio.ts +1 -1
  50. package/examples/support-plan-credit/mcp-client-examples/openai-agents-streamable-http.ts +1 -1
  51. package/examples/support-plan-credit/mcp-client-examples/vscode.mcp.json +20 -0
  52. package/examples/support-plan-credit/synapsor/actions/support.propose_plan_credit.contract-tests.generated.json +221 -0
  53. package/examples/support-plan-credit/synapsor/actions/support.propose_plan_credit.ts +34 -0
  54. package/fixtures/mcp-audit/README.md +14 -0
  55. package/fixtures/mcp-audit/cursor-bypass-config.json +38 -0
  56. package/fixtures/mcp-audit/dangerous-tools-list.json +33 -0
  57. package/fixtures/mcp-audit/reviewed-proposal-tools-list.json +60 -0
  58. package/package.json +18 -3
  59. package/schemas/mcp-audit-report.schema.json +100 -1
  60. package/schemas/synapsor.contract-tests.schema.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,96 @@
1
1
  # Changelog
2
2
 
3
- ## 1.5.0 (prepared, not published)
3
+ ## 1.5.3 (prepared, not published)
4
+
5
+ ### Intent to Safe Action
6
+
7
+ - Adds one code-first Safe Action Composer from a reviewed read boundary to a
8
+ restricted TypeScript draft, canonical contract, plain-language explanation,
9
+ and deterministic allow/deny/effect tests. Runner statically parses the file
10
+ and never imports or executes adopter code while deciding authority.
11
+ - Keeps every generated action disabled until a human reviews a real staging
12
+ Data PR in the secured Workbench and explicitly activates the complete
13
+ digest. Editing, validating, or watching a draft cannot change active MCP
14
+ tools; proposals remain pinned to their active contract digest.
15
+ - Adds current Cursor project/plugin packaging, `/synapsor-protect`, live Safe
16
+ Action diagnostics, owned install/uninstall, and an honest host matrix.
17
+ Activation, approval, apply, credentials, and trusted identity stay outside
18
+ the model-facing surface.
19
+ - Extends MCP audit with evidence-labeled authority maps, explicitly consented
20
+ selected-server bypass checks, text/JSON/Markdown/SARIF output, fixtures, and
21
+ a non-mutating GitHub Actions workflow.
22
+ - Adds a checked-in Safe Action CI workflow plus verified proposal-only recipes
23
+ for Claude Code, Codex, VS Code, OpenAI Agents, LangChain/LangGraph, Google
24
+ ADK, LlamaIndex, and generic MCP clients.
25
+ - Reframes the README and website around one existing-application Data PR,
26
+ publishes an honest alternatives guide, and adds a deterministic 36-second
27
+ support-plan-credit cut backed by real PostgreSQL proposal, receipt, retry,
28
+ and stale-conflict evidence.
29
+ - Prepares only `@synapsor/runner@1.5.3`; `@synapsor/spec@1.4.2`,
30
+ `@synapsor/dsl@1.4.3`, and the Cloud CLI remain unchanged.
31
+
32
+ ## 1.5.2 (prepared, not published)
33
+
34
+ ### First safe action in an existing application
35
+
36
+ - Establishes one canonical path from an existing application and staging
37
+ Postgres/MySQL database to a reviewed semantic action, scoped evidence, exact
38
+ proposal/Data PR, external human review, guarded apply, receipt, and replay.
39
+ Own-data failures stop honestly and never fall back to synthetic data.
40
+ - Generates a canonical contract and local Runner wiring from read-only schema
41
+ inspection while detecting Prisma, Drizzle, OpenAPI, known database
42
+ environment names, and existing Synapsor files without executing adopter
43
+ code. The happy path requires no hand-written JSON or DSL.
44
+ - Adds a focused localhost workbench for Project, Data source, Trust scope,
45
+ Action, Agent, Test, and Review. Configuration validation alone no longer
46
+ marks Test complete; a scoped read must create query-audit evidence first.
47
+ - Adds safe project-scoped Cursor install, status, and uninstall with preview,
48
+ merge, backup, ownership/integrity checks, exact-version launch, and
49
+ preservation of unrelated MCP entries. Approval, apply, revert, credentials,
50
+ and trusted identity remain outside the model-facing MCP surface.
51
+ - Adds local-only activation reports for proof, own-data onboarding, Cursor,
52
+ first read, and first proposal. Product timing explicitly excludes initial
53
+ package download; separately reported cold `npx` timing is environment-
54
+ specific. No activation telemetry or business identifiers are transmitted.
55
+ - Adds optional `@synapsor/runner/authoring` and
56
+ `@synapsor/runner/shadow` exports. TypeScript authoring emits the same
57
+ canonical public contract, while shadow progression and provider-neutral
58
+ effect regression remain non-activating and label deterministic versus
59
+ external-model evidence.
60
+ - Connects MCP audit candidates directly to the secured workbench and keeps
61
+ audit prominent in the README and docs. Adds an explicit host-compatibility
62
+ matrix and a packaged support/billing first-action reference workflow.
63
+ - Corrects the supported runtime floor to Node 22.13.0, where `node:sqlite` is
64
+ available without an experimental flag, and fails earlier runtimes before
65
+ loading the Runner bundle.
66
+ - Prepares only `@synapsor/runner@1.5.2`; `@synapsor/spec@1.4.2`,
67
+ `@synapsor/dsl@1.4.3`, and the Cloud CLI remain unchanged.
68
+
69
+ ## 1.5.1 (prepared, not published)
70
+
71
+ ### Safe ownership for disposable try state
72
+
73
+ - Stops `try` from recursively deleting a caller-provided `--state-dir`.
74
+ Custom paths are now unowned containers; Runner writes into a marked managed
75
+ child and removes only its known direct state files.
76
+ - Rejects filesystem roots, home/cwd/repository paths and their ancestors,
77
+ parent traversal, symlinked path components, unmarked lookalike directories,
78
+ and managed files replaced by links. Unrelated caller files are preserved.
79
+ - Adds an atomic per-state lease. Concurrent runs fail clearly, while a valid
80
+ lease left by a dead process can recover without broad cleanup.
81
+ - Keeps `demo inspect --state-dir` aligned with the managed-child layout and
82
+ safely adopts only the known legacy default `.synapsor/try` file set.
83
+ - Hardens explicit `--force` replacement for generated schema and MCP-audit
84
+ candidate directories against protected paths, symlinked ancestors, and
85
+ linked or invalid ownership markers.
86
+ - Consistently identifies the embedded `try` source as synthetic.
87
+ - Updates the packaged YAML parser to `2.8.3`, which includes the upstream
88
+ deeply nested collection denial-of-service fix.
89
+ - Corrects the repository's stale publication wording for the live `1.5.0`
90
+ release. Only `@synapsor/runner` is staged at `1.5.1`; Spec, DSL, and Cloud
91
+ CLI versions remain unchanged.
92
+
93
+ ## 1.5.0 (2026-07-20)
4
94
 
5
95
  ### Complete guarded-action developer proof
6
96
 
@@ -31,9 +121,8 @@
31
121
  - Rewrites the README around the complete `try --prove` outcome, keeps MCP
32
122
  audit immediately second, names each isolation boundary precisely, and
33
123
  reconciles release documentation with the live npm registry.
34
- - Stages only `@synapsor/runner@1.5.0`; `@synapsor/spec@1.4.2`,
124
+ - Published only `@synapsor/runner@1.5.0`; `@synapsor/spec@1.4.2`,
35
125
  `@synapsor/dsl@1.4.3`, and `@synapsor/cli@0.1.0-beta.1` remain unchanged.
36
- Nothing is published by this change.
37
126
 
38
127
  ## 1.4.123 (2026-07-17)
39
128
 
package/README.md CHANGED
@@ -4,23 +4,27 @@
4
4
  [![license: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
5
5
  [![ci](https://github.com/Synapsor/Synapsor-Runner/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Synapsor/Synapsor-Runner/actions/workflows/ci.yml?query=branch%3Amain)
6
6
 
7
- **Approve the exact business effect, not an opaque tool call.**
7
+ **Let AI agents change real application data without giving the model SQL.**
8
8
 
9
- Synapsor Runner is an open-source MCP runtime for Postgres and MySQL. It
10
- gives agents reviewed business actions instead of `execute_sql`, saves risky
11
- changes as proposals, and keeps database credentials, approval, and writeback
12
- outside the model-facing surface.
9
+ **MCP connects the agent. Synapsor controls the commit.**
13
10
 
14
- ## Prove It In 60 Seconds
11
+ Synapsor Runner is an open-source MCP runtime for Postgres and MySQL. It gives
12
+ agents reviewed business actions, records proposed changes as exact Data PRs,
13
+ and keeps credentials, activation, approval, and commit authority outside the
14
+ model-facing surface.
15
15
 
16
- First, prove the boundary without a database, Docker, config, MCP client, LLM,
17
- or account:
16
+ ## Prove The Boundary In Four Seconds
17
+
18
+ No database, Docker, config, MCP client, LLM, or account is required:
18
19
 
19
20
  ```bash
20
21
  npx -y @synapsor/runner try --prove
21
22
  ```
22
23
 
23
- The embedded source requests a $55 waiver and shows:
24
+ The four-second product measurement begins after package resolution. A cold
25
+ `npx` download is recorded separately because registry and network time vary.
26
+
27
+ The embedded synthetic source requests a $55 waiver and proves:
24
28
 
25
29
  ```text
26
30
  Proposed effect: late_fee_cents: 5500 -> 0
@@ -31,10 +35,64 @@ Stale apply refused: yes
31
35
  ```
32
36
 
33
37
  Review happens outside the model-facing tools. The command stores inspectable
34
- state under `./.synapsor/try/` and does not test your database connection.
35
- `demo --quick` remains a noninteractive compatibility alias.
38
+ state under `./.synapsor/try/`; it teaches the boundary and does not claim to
39
+ test your database connection. `demo --quick` remains a noninteractive compatibility alias.
40
+
41
+ ## Protect One Action In Your Application
42
+
43
+ Start with a staging database and a read-only credential. Runner inspects
44
+ metadata, creates one reviewed read boundary, and opens the secured localhost
45
+ Workbench:
46
+
47
+ ```bash
48
+ npm install -g @synapsor/runner
49
+ export DATABASE_URL="postgresql://runner_reader:REPLACE_ME@db.example.com:5432/app?sslmode=require"
50
+ synapsor-runner start --from-env DATABASE_URL --schema public
51
+ ```
36
52
 
37
- Next, audit a typical raw-SQL MCP server:
53
+ Describe one business action. This creates an inert TypeScript draft; it does
54
+ not add a tool or change the active contract:
55
+
56
+ ```bash
57
+ synapsor-runner start \
58
+ --action plan_credit \
59
+ --description "Propose one reviewed customer plan credit" \
60
+ --based-on support.inspect_customer
61
+ ```
62
+
63
+ Add the reviewed tools to the current Cursor project:
64
+
65
+ ```bash
66
+ synapsor-runner mcp install cursor --project \
67
+ --config ./synapsor.runner.json \
68
+ --store ./.synapsor/local.db
69
+ ```
70
+
71
+ In Cursor, use the Workbench's exact prompt. The checked-in project
72
+ instructions require the coding agent to draft and validate the action while
73
+ leaving effect review and activation to you. Once activated, a request such as
74
+ "give CUS-3001 a $25 plan credit" can only create a semantic proposal:
75
+
76
+ ```text
77
+ Data PR wrp_...
78
+ Action support.propose_plan_credit on CUS-3001
79
+ Effect plan_credit_cents: 0 -> 2500
80
+ Source unchanged before approval: Yes
81
+ ```
82
+
83
+ Review the exact effect in the secured Workbench, select **Approve outside
84
+ MCP**, then run the displayed guarded apply command from a trusted terminal.
85
+ The agent has no approval or commit tool. Runner rechecks scope, policy, row
86
+ version, bounds, and idempotency before returning a receipt; a retry cannot
87
+ duplicate the mutation and a stale proposal conflicts.
88
+
89
+ See the [own-database guide](docs/getting-started-own-database.md) for the full
90
+ staging path and [Cursor plugin guide](docs/cursor-plugin.md) for
91
+ `/synapsor-protect` and the plugin boundary.
92
+
93
+ ## Audit An Existing MCP Server
94
+
95
+ Audit a typical raw-SQL MCP server without launching or calling one:
38
96
 
39
97
  ```bash
40
98
  npx -y @synapsor/runner audit --example dangerous-db-mcp
@@ -49,9 +107,10 @@ npx -y @synapsor/runner audit ./tools-list.json
49
107
  It flags raw SQL, arbitrary identifiers, model-controlled authority,
50
108
  model-facing approval/writeback, and missing conflict or idempotency signals.
51
109
  It does not call business tools. See [MCP Database Risk
52
- Review](docs/mcp-audit.md) for supported workflows and limits.
53
-
54
- Then [connect a staging database](#connect-a-staging-database).
110
+ Review](docs/mcp-audit.md) for local manifests, selected-server checks, CI,
111
+ SARIF, evidence labels, and limits. You may not need Runner: use the
112
+ [alternatives guide](docs/alternatives.md) to compare direct read-only access,
113
+ hand-built tools, and this reviewed boundary.
55
114
 
56
115
  ## Safety Model
57
116
 
@@ -104,73 +163,16 @@ credentials. See [Database scope] and the
104
163
 
105
164
  ## Connect A Staging Database
106
165
 
107
- Start with staging and a read-only credential. Keep database permissions,
108
- views, and RLS.
166
+ The setup above stores environment-variable names, not connection strings, and
167
+ never falls back to synthetic data if inspection fails. Keep staging, database
168
+ permissions, restricted views, and RLS underneath Runner. Bind trusted tenant
169
+ and principal values in the launching process, then review the exact field and
170
+ tool surface before connecting Cursor.
109
171
 
110
- ```bash
111
- npm install -g @synapsor/runner
112
- export DATABASE_URL="postgresql://runner_reader:REPLACE_ME@db.example.com:5432/app?sslmode=require"
113
- synapsor-runner start --from-env DATABASE_URL --schema public
114
- ```
115
-
116
- The wizard inspects metadata, generates reviewed capabilities, previews MCP
117
- tools, and prints smoke/serve commands. It stores environment-variable names,
118
- not connection strings.
119
-
120
- [Generate disabled review candidates from Prisma, Drizzle, or
121
- OpenAPI.](docs/schema-api-candidates.md)
122
-
123
- The generated capability is a tenant-scoped read with an explicit column
124
- allowlist and required evidence. See the [own-database
125
- guide](docs/getting-started-own-database.md) for the full configuration.
126
-
127
- ```json
128
- {
129
- "name": "billing.inspect_invoice",
130
- "kind": "read",
131
- "source": "app_postgres",
132
- "target": {
133
- "schema": "public",
134
- "table": "invoices",
135
- "primary_key": "id",
136
- "tenant_key": "tenant_id"
137
- },
138
- "args": {
139
- "invoice_id": { "type": "string", "required": true, "max_length": 128 }
140
- },
141
- "lookup": { "id_from_arg": "invoice_id" },
142
- "visible_columns": ["id", "tenant_id", "status", "late_fee_cents", "updated_at"],
143
- "evidence": "required",
144
- "max_rows": 1
145
- }
146
- ```
147
-
148
- Set the trusted values in the process that launches Runner, then validate and
149
- preview the exact model-facing boundary before connecting an MCP client:
150
-
151
- ```bash
152
- export SYNAPSOR_TENANT_ID="acme"
153
- export SYNAPSOR_PRINCIPAL="local-developer"
154
- synapsor-runner config validate --config ./synapsor.runner.json
155
- synapsor-runner tools preview --config ./synapsor.runner.json --store ./.synapsor/local.db
156
- synapsor-runner mcp serve --config ./synapsor.runner.json --store ./.synapsor/local.db
157
- ```
158
-
159
- For proposal capabilities and writes, follow the
160
- [complete own-database guide](docs/getting-started-own-database.md). Reviewed
161
- single-row INSERT, UPDATE, and DELETE can use Runner's guarded direct
162
- writeback. Runner also supports tightly [bounded set
163
- writes](docs/bounded-set-writeback.md): fixed-predicate UPDATE/DELETE and
164
- exact-review batch INSERT, with human approval, a hard 100-row ceiling, atomic
165
- apply, and exact receipts. Free-form predicates, unbounded or cross-table work,
166
- and external effects go through an [app-owned
167
- executor](docs/writeback-executors.md) after approval.
168
-
169
- Direct writes can use [reviewed
170
- compensation](docs/reversible-change-sets.md). Receipts capture a
171
- bounded inverse; `synapsor-runner revert <proposal_id>` creates a separately
172
- approved proposal. This is not rollback, time travel, or app-owned
173
- compensation.
172
+ The [complete own-database guide](docs/getting-started-own-database.md) covers
173
+ validation, scoped reads, disabled Prisma/Drizzle/OpenAPI candidates, guarded
174
+ single-row writes, and app-owned executors. Use the [host compatibility
175
+ matrix](docs/host-compatibility.md) for accurately tested client behavior.
174
176
 
175
177
  ## Review And Prove Your Contract
176
178
 
@@ -202,18 +204,11 @@ trust boundaries, covered threats, non-goals, and required operator controls.
202
204
  - MCP proposal, evidence, and replay handles are references rather than bearer
203
205
  authority: resource reads re-check the owning tenant and principal against
204
206
  the current trusted session.
205
- - Same-tenant owner/assignee isolation uses a reviewed
206
- [`PRINCIPAL SCOPE KEY`](docs/capability-authoring.md#same-tenant-principal-row-scope)
207
- composed with mandatory tenant scope; `test:principal-scope` proves generic
208
- cross-principal denial and evidence-handle isolation on Postgres and MySQL.
209
- - `test:live-apply`, `test:guarded-crud`, `test:bounded-set`, and
210
- `test:reversible` run disposable PostgreSQL/MySQL scenarios. They prove no
211
- pre-approval mutation, guarded single-row CRUD, idempotent retry,
212
- fail-closed conflicts, bounded atomic sets, exact receipts, and reviewed
213
- compensation.
214
- - The C++/Cloud round-trip verifier exports normalized contracts, validates
215
- them with `@synapsor/spec`, and loads them in Runner. The shared contract and
216
- verification commands are documented in [Conformance](docs/conformance.md).
207
+ - `test:principal-scope`, `test:live-apply`, `test:guarded-crud`,
208
+ `test:bounded-set`, and `test:reversible` prove cross-principal denial,
209
+ no pre-approval mutation, guarded writes, idempotent retry, conflicts,
210
+ bounded atomic sets, receipts, and reviewed compensation on disposable
211
+ PostgreSQL/MySQL fixtures.
217
212
 
218
213
  Runner is a narrow agent/database safety boundary, not a replacement for
219
214
  least-privilege database access, host security, or application authorization.
@@ -224,12 +219,9 @@ See [Security Boundary](docs/security-boundary.md) and
224
219
 
225
220
  ## Operate The Approval Loop
226
221
 
227
- Policies combine per-proposal and daily ceilings; exceeding one routes to human
228
- review. Operators get batch apply, metrics, structured logs, and optional
229
- signed roles. Local SQLite is the default; bounded fleets can use verified HTTP
230
- claims, asymmetric JWT sessions, and a shared Postgres `runtime_store`.
231
- `smoke call` follows that store and never falls back to SQLite. Use `/healthz`
232
- for liveness and `/readyz` for dependency readiness. See
222
+ Policies can combine per-proposal and aggregate ceilings; exceeding one routes
223
+ to human review. Local SQLite is the default, while bounded fleets can use
224
+ verified HTTP claims and a shared Postgres runtime store. See
233
225
  [Production](docs/production.md), [Runner Config](docs/runner-config-reference.md),
234
226
  and [Small Runner Fleets](docs/running-a-runner-fleet.md).
235
227
 
@@ -242,16 +234,11 @@ and [Small Runner Fleets](docs/running-a-runner-fleet.md).
242
234
  | `@synapsor/dsl` | SQL-like authoring that compiles contexts, capabilities, and workflow declarations into canonical contract JSON. |
243
235
  | `@synapsor/cli` | Synapsor Cloud administration, contract governance, human review, Runner connections, and shared audit records. |
244
236
 
245
- Runner executes locally. The spec is shared by Runner and Cloud/C++; the DSL
246
- is its reviewable source format. Start with [Capability
247
- Authoring](docs/capability-authoring.md). Use `.synapsor.sql` for generic SQL
248
- highlighting; legacy `.synapsor` files produce the same contract JSON.
249
-
250
- Use the [DSL Reference](docs/dsl-reference.md) for exact authoring grammar and
251
- the [Runner Config Reference](docs/runner-config-reference.md) for every wiring
252
- key, default, and path-resolution rule. The
253
- [Store Lifecycle guide](docs/store-lifecycle.md) explains ledger sensitivity,
254
- owner-only permissions, inspection commands, and retention.
237
+ Runner, JSON, `.synapsor.sql`, and the optional TypeScript
238
+ `@synapsor/runner/authoring` frontend all use the same canonical spec. The
239
+ `@synapsor/runner/shadow` helper records app-owned outcomes without granting
240
+ write authority. Start with [Capability Authoring](docs/capability-authoring.md)
241
+ and the [Runner Config Reference](docs/runner-config-reference.md).
255
242
 
256
243
  ## OSS And Cloud
257
244
 
@@ -0,0 +1,23 @@
1
+ import { type AgentContextSpec, type CapabilitySpec, type PolicySpec, type ResourceSpec, type SynapsorContract, type WorkflowSpec } from "@synapsor/spec";
2
+ export type SynapsorContractDefinition = Omit<SynapsorContract, "spec_version" | "kind">;
3
+ /** Preserve editor inference for a canonical resource definition. */
4
+ export declare function defineResource<const T extends ResourceSpec>(resource: T): T;
5
+ /** Preserve editor inference for trusted context bindings resolved outside model input. */
6
+ export declare function defineAgentContext<const T extends AgentContextSpec>(context: T): T;
7
+ /** Preserve editor inference for a canonical read, aggregate, proposal, or external capability. */
8
+ export declare function defineCapability<const T extends CapabilitySpec>(capability: T): T;
9
+ /** Preserve editor inference for a canonical workflow declaration. */
10
+ export declare function defineWorkflow<const T extends WorkflowSpec>(workflow: T): T;
11
+ /** Preserve editor inference for a canonical policy declaration. */
12
+ export declare function definePolicy<const T extends PolicySpec>(policy: T): T;
13
+ /**
14
+ * Build and validate the same language-neutral contract consumed by the JSON,
15
+ * SQL-like DSL, local Runner, and Cloud registry paths.
16
+ */
17
+ export declare function defineContract<const T extends SynapsorContractDefinition>(definition: T): SynapsorContract & T;
18
+ /** Validate and normalize a code-first definition into canonical contract JSON shape. */
19
+ export declare function compileContract(definition: SynapsorContractDefinition | SynapsorContract): SynapsorContract;
20
+ /** Serialize normalized canonical JSON for review, version control, or Runner loading. */
21
+ export declare function contractJson(definition: SynapsorContractDefinition | SynapsorContract, indentation?: number): string;
22
+ export type { AgentContextSpec, CapabilitySpec, PolicySpec, ResourceSpec, SynapsorContract, WorkflowSpec, } from "@synapsor/spec";
23
+ //# sourceMappingURL=authoring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring.d.ts","sourceRoot":"","sources":["../src/authoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,gBAAgB,EAAE,cAAc,GAAG,MAAM,CAAC,CAAC;AAEzF,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,YAAY,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAE3E;AAED,2FAA2F;AAC3F,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,CAAC,SAAS,gBAAgB,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAElF;AAED,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,CAAC,SAAS,cAAc,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAEjF;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,YAAY,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAE3E;AAED,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,KAAK,CAAC,CAAC,SAAS,UAAU,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAErE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,0BAA0B,EACvE,UAAU,EAAE,CAAC,GACZ,gBAAgB,GAAG,CAAC,CAQtB;AAED,yFAAyF;AACzF,wBAAgB,eAAe,CAAC,UAAU,EAAE,0BAA0B,GAAG,gBAAgB,GAAG,gBAAgB,CAM3G;AAED,0FAA0F;AAC1F,wBAAgB,YAAY,CAC1B,UAAU,EAAE,0BAA0B,GAAG,gBAAgB,EACzD,WAAW,SAAI,GACd,MAAM,CAKR;AAED,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,YAAY,GACb,MAAM,gBAAgB,CAAC"}