@ismaelsoilet/synapsejs 1.8.0 → 1.11.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.
- package/README.md +98 -6
- package/bin/synapse.ts +291 -241
- package/package.json +2 -2
- package/src/client/components.tsx +459 -1
- package/src/client/context.tsx +23 -3
- package/src/client/error-boundary.tsx +59 -0
- package/src/client/hooks.ts +100 -1
- package/src/client/toast.tsx +219 -0
- package/src/client/upload.ts +153 -0
- package/src/client.ts +37 -2
- package/src/compiler/client-bundler.ts +94 -2
- package/src/compiler/context-bench.ts +9 -1
- package/src/compiler/contract.ts +31 -4
- package/src/compiler/db-schema-generator.ts +39 -8
- package/src/compiler/fields-parser.ts +28 -1
- package/src/compiler/impact-analyzer.ts +31 -1
- package/src/compiler/migration-runner.ts +10 -2
- package/src/compiler/optional-coverage.ts +137 -0
- package/src/compiler/oracle-runner.ts +18 -4
- package/src/compiler/scaffolder.ts +227 -9
- package/src/compiler/slice-discovery.ts +8 -1
- package/src/compiler/slice-splitter.ts +68 -6
- package/src/compiler/slice-templates.ts +234 -10
- package/src/compiler/typescript-api.ts +33 -0
- package/src/core/action-context.ts +101 -15
- package/src/core/config.ts +88 -10
- package/src/core/cron-parser.ts +167 -0
- package/src/core/database-client.ts +103 -6
- package/src/core/index.ts +5 -0
- package/src/core/jobs.ts +37 -0
- package/src/core/oauth-client.ts +322 -0
- package/src/core/path-guard.ts +105 -0
- package/src/core/postgres-client.ts +37 -0
- package/src/core/postgres-queue.ts +76 -9
- package/src/core/query-builder.ts +166 -34
- package/src/core/session-context.ts +45 -4
- package/src/core/session-token.ts +124 -8
- package/src/core/sqlite-client.ts +20 -0
- package/src/core/storage.ts +60 -19
- package/src/core/topics.ts +84 -0
- package/src/core/webhook-signature.ts +151 -0
- package/src/index.ts +2 -1
- package/src/mcp/server.ts +317 -218
- package/src/mcp/tools.ts +329 -0
- package/src/project-status.ts +433 -0
- package/src/runtime/client-entry.ts +11 -5
- package/src/runtime/network-guard.ts +3 -1
- package/src/runtime/queue-engine.ts +167 -5
- package/src/runtime/rate-limiter.ts +14 -4
- package/src/runtime/security-headers.ts +35 -0
- package/src/runtime/server.ts +1174 -236
- package/src/runtime/uploads.ts +199 -19
- package/src/version.ts +9 -2
- package/templates/starter/package.json +2 -2
- package/templates/starter/tsconfig.json +1 -0
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SynapseJS - Project Status (single source of truth)
|
|
3
|
+
*
|
|
4
|
+
* Version, feature maturity, adoption and the tool inventory live here, in one
|
|
5
|
+
* machine-readable module. `synapse info`, the health endpoint, the MCP server
|
|
6
|
+
* metadata and the documentation gate all read it, so a claim cannot drift from a
|
|
7
|
+
* value a test is able to check — and no surface carries a version literal of its own.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { MCP_TOOL_NAMES } from './mcp/tools';
|
|
11
|
+
import { SYNAPSE_VERSION } from './version';
|
|
12
|
+
|
|
13
|
+
export interface FeatureStatus {
|
|
14
|
+
feature: string;
|
|
15
|
+
/**
|
|
16
|
+
* `stable` requires a test that fails when the behaviour breaks and, where the
|
|
17
|
+
* capability wraps an engine, a suite that executes against a real engine.
|
|
18
|
+
* `experimental` means it works but its evidence is a template assertion or a
|
|
19
|
+
* test double. `roadmap` means it is not shipped.
|
|
20
|
+
*/
|
|
21
|
+
status: 'stable' | 'experimental' | 'roadmap';
|
|
22
|
+
evidence: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The feature inventory. `experimental` is not an insult: it states which capabilities
|
|
27
|
+
* have no behavioural test or no real-engine suite yet, instead of advertising them.
|
|
28
|
+
*/
|
|
29
|
+
export const FEATURE_STATUS: FeatureStatus[] = [
|
|
30
|
+
{
|
|
31
|
+
feature: 'Vertical slices (N = 1) with Locality of Behavior',
|
|
32
|
+
status: 'stable',
|
|
33
|
+
evidence: 'bun test packages/synapse/test/locality.test.ts'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
feature: 'Result<T, E> control flow (no public throwing helper)',
|
|
37
|
+
status: 'stable',
|
|
38
|
+
evidence: 'bun test packages/synapse/test/machine-types.test.ts'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
feature: 'TypeBox JIT input contracts',
|
|
42
|
+
status: 'stable',
|
|
43
|
+
evidence: 'bun test packages/synapse/test/slice-contract.test.ts'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
feature: 'Declarative sliceSchema migrations, applied once per statement',
|
|
47
|
+
status: 'stable',
|
|
48
|
+
evidence: 'bun test packages/synapse/test/migration-runner.test.ts'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
feature: 'Domain errors map to HTTP status (401/403/404/409/422/500)',
|
|
52
|
+
status: 'stable',
|
|
53
|
+
evidence: 'bun test packages/synapse/test/runtime-server.test.ts'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
feature: 'Zero-wiring routing, SSR shell and RPC dispatcher',
|
|
57
|
+
status: 'stable',
|
|
58
|
+
evidence: 'bun --cwd examples/enterprise-crm test:e2e'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
feature: 'Signed sessions (SYNAPSE_SESSION_SECRET), tenant from verified claims only',
|
|
62
|
+
status: 'stable',
|
|
63
|
+
evidence: 'bun test packages/synapse/test/session-security.test.ts'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
feature: 'Request-time session revocation with a bounded in-process set and prunable table',
|
|
67
|
+
status: 'stable',
|
|
68
|
+
evidence: 'bun test packages/synapse/test/session-security.test.ts'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
feature: 'Login with Bun.password, signed token and cookie session (storeSession/clearSession)',
|
|
72
|
+
status: 'stable',
|
|
73
|
+
evidence: 'bun --cwd apps/crm test (login oracle: the server accepts the issued token)'
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
feature: 'Caller-supplied identity headers only under the explicit SYNAPSE_DEV_HEADERS opt-in',
|
|
77
|
+
status: 'stable',
|
|
78
|
+
evidence: 'bun test packages/synapse/test/session-security.test.ts'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
feature: 'Cross-slice atomicity through src/shared modules (db.transaction, rollback proven on SQLite)',
|
|
82
|
+
status: 'stable',
|
|
83
|
+
evidence: 'bun test packages/synapse/test/shared-modules.test.ts'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
feature: 'Slice boundary: a slice never imports another slice (SLICE_IMPORTS_SLICE)',
|
|
87
|
+
status: 'stable',
|
|
88
|
+
evidence: 'bun test packages/synapse/test/slice-splitter.test.ts'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
feature: 'Browser RPC transport that never throws (RPC_MALFORMED/RPC_UNREACHABLE as values)',
|
|
92
|
+
status: 'stable',
|
|
93
|
+
evidence: 'bun test packages/synapse/test/rpc-client.test.ts'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
feature: 'Pre-built client bundles with a manifest (synapse build)',
|
|
97
|
+
status: 'stable',
|
|
98
|
+
evidence: 'bun test packages/synapse/test/client-bundler.test.ts'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
feature: 'Uploads with session, byte ceiling, content sniffing and traversal guard (/_synapse/files)',
|
|
102
|
+
status: 'stable',
|
|
103
|
+
evidence: 'bun test packages/synapse/test/uploads.test.ts'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
feature: 'Embedded SQLite engine (WAL, prepared-statement cache)',
|
|
107
|
+
status: 'stable',
|
|
108
|
+
evidence: 'bun test packages/synapse/test/sqlite-client.test.ts'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
feature: 'Slice discovery resolution (never reports PASS with zero slices)',
|
|
112
|
+
status: 'stable',
|
|
113
|
+
evidence: 'bun test packages/synapse/test/slice-discovery.test.ts'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
feature: 'Centralized Database Schema Catalog (.codebase/db-schema.d.ts)',
|
|
117
|
+
status: 'stable',
|
|
118
|
+
evidence: 'bun test packages/synapse/test/db-schema-generator.test.ts'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
feature: 'Unified Object Storage (LocalStorage + AWS S3/R2 with SigV4 signing on upload and delete)',
|
|
122
|
+
status: 'stable',
|
|
123
|
+
evidence: 'bun test packages/synapse/test/storage.test.ts'
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
feature: 'Isomorphic slice splitter (shared/server/client modules)',
|
|
127
|
+
status: 'stable',
|
|
128
|
+
evidence: 'bun test packages/synapse/test/slice-splitter.test.ts'
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
feature: 'Slice invariants executed by bun:test (per-invariant reporting)',
|
|
132
|
+
status: 'stable',
|
|
133
|
+
evidence: 'bun test packages/synapse/test/oracle-runner.test.ts'
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
feature: 'Rate limiting with an opt-in proxy trust and a registry that refuses the excess',
|
|
137
|
+
status: 'stable',
|
|
138
|
+
evidence: 'bun test packages/synapse/test/production-hardening.test.ts'
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
feature: 'Token bucket rate limiting on RPC, uploads, webhooks, SSE, images, machine endpoints and pages',
|
|
142
|
+
status: 'stable',
|
|
143
|
+
evidence: 'bun test packages/synapse/test/abuse-resistance.test.ts'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
feature: 'SSRF & network guard with the validated address pinned for the actual fetch',
|
|
147
|
+
status: 'stable',
|
|
148
|
+
evidence: 'bun test packages/synapse/test/abuse-resistance.test.ts'
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
feature: 'Bounded LRU SSR cache and query normalization',
|
|
152
|
+
status: 'stable',
|
|
153
|
+
evidence: 'bun test packages/synapse/test/production-hardening.test.ts'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
feature: 'Isolated SQLite queue engine (defineJob, exponential backoff, interrupt-safe shutdown)',
|
|
157
|
+
status: 'stable',
|
|
158
|
+
evidence: 'bun test packages/synapse/test/graceful-shutdown.test.ts'
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
feature: 'SQLite queue zombie-job visibility recovery',
|
|
162
|
+
status: 'stable',
|
|
163
|
+
evidence: 'bun test packages/synapse/test/production-hardening.test.ts'
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
feature: 'Graceful HTTP shutdown: configured drain, 503 DRAINING for the excess, persistence closed last',
|
|
167
|
+
status: 'stable',
|
|
168
|
+
evidence: 'bun test packages/synapse/test/graceful-shutdown.test.ts'
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
feature: 'Bidirectional DDL migrations with transactional rollback (synapse rollback)',
|
|
172
|
+
status: 'stable',
|
|
173
|
+
evidence:
|
|
174
|
+
'bun test packages/synapse/test/feature-exercise.test.ts (a shipped slice declares a reversible block and rolls it back)'
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
feature: 'Declared realtime topics over SSE (defineTopic, tenant-namespaced, bounded registry)',
|
|
178
|
+
status: 'stable',
|
|
179
|
+
evidence: 'bun test packages/synapse/test/sse-gateway.test.ts'
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
feature: 'Native bidirectional WebSockets (defineSocket) with a fail-closed origin check',
|
|
183
|
+
status: 'stable',
|
|
184
|
+
evidence: 'bun test packages/synapse/test/http-response-hardening.test.ts'
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
feature: 'In-memory SSR micro-cache & ISR (defineCache, stale-while-revalidate)',
|
|
188
|
+
status: 'stable',
|
|
189
|
+
evidence: 'bun test packages/synapse/test/onda7-deficiencies.test.tsx'
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
feature: 'Vendor code-splitting and dynamic metadata (sliceMeta)',
|
|
193
|
+
status: 'stable',
|
|
194
|
+
evidence: 'bun test packages/synapse/test/onda1.test.ts'
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
feature: 'Hierarchical domain layouts (_layout.tsx)',
|
|
198
|
+
status: 'stable',
|
|
199
|
+
evidence: 'bun test packages/synapse/test/onda1.test.ts'
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
feature: 'MCP stdio server (JSON-RPC 2.0) with the tool inventory derived from the registered list',
|
|
203
|
+
status: 'stable',
|
|
204
|
+
evidence: 'bun test packages/synapse/test/mcp-server.test.ts'
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
feature: 'AST skeletonizer to .codebase/repo-map.d.ts',
|
|
208
|
+
status: 'stable',
|
|
209
|
+
evidence: 'bun test packages/synapse/test/repo-map.test.ts'
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
feature: 'PostgreSQL parity (migrations, DDL, action round-trip) against a live engine',
|
|
213
|
+
status: 'stable',
|
|
214
|
+
evidence: 'TEST_DATABASE_URL=... bun run test:postgres (CI provides a postgres:16 service)'
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
feature: 'Distributed PostgreSQL queue (SKIP LOCKED, full jitter, dead-letter queue)',
|
|
218
|
+
status: 'experimental',
|
|
219
|
+
evidence:
|
|
220
|
+
'real-engine suite: packages/synapse/test/postgres-adapters.test.ts (gated on TEST_DATABASE_URL; reports skipped without an engine, run by CI) — the substring suite postgres-queue.test.ts stays only as a change detector'
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
feature: 'Distributed PostgreSQL event hub (LISTEN, payload offload)',
|
|
224
|
+
status: 'experimental',
|
|
225
|
+
evidence:
|
|
226
|
+
'real-engine suite: packages/synapse/test/postgres-adapters.test.ts (gated on TEST_DATABASE_URL; reports skipped without an engine, run by CI); onda3.test.ts covers the in-process path'
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
feature: 'On-demand image optimizer (resize, convert, remote allowlist)',
|
|
230
|
+
status: 'experimental',
|
|
231
|
+
evidence:
|
|
232
|
+
'bun test packages/synapse/test/onda4.test.ts exercises the guard rails; the conversion path has no real test yet'
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
feature: 'Webhooks (POST /_synapse/webhooks/<domain>/<name>) with HMAC signature and a bounded replay window',
|
|
236
|
+
status: 'stable',
|
|
237
|
+
evidence:
|
|
238
|
+
'bun --cwd examples/enterprise-crm test (stripe-payment oracle: valid, tampered, replayed and stale deliveries)'
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
feature: 'React hydration from a client bundle the splitter produces',
|
|
242
|
+
status: 'stable',
|
|
243
|
+
evidence:
|
|
244
|
+
'bun test packages/synapse/test/hydration.test.tsx (mounts the layout tree, asserts no mismatch and live state)'
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
feature: 'Isomorphic i18n routing (/<locale>/...)',
|
|
248
|
+
status: 'stable',
|
|
249
|
+
evidence: 'bun test packages/synapse/test/onda3.test.ts'
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
feature: 'Multi-tenancy: tenant from verified claims, per-tenant topic and cache isolation',
|
|
253
|
+
status: 'stable',
|
|
254
|
+
evidence: 'bun test packages/synapse/test/multi-tenancy.test.ts'
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
feature: 'Context surface benchmark (files/tokens an agent must read)',
|
|
258
|
+
status: 'stable',
|
|
259
|
+
evidence: 'bun run bench'
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
feature: 'Background jobs (defineJob) exercised end to end by a committed slice',
|
|
263
|
+
status: 'stable',
|
|
264
|
+
evidence:
|
|
265
|
+
'bun --cwd examples/enterprise-crm test (enqueue-welcome-email oracle: the job handler writes the delivery row)'
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
feature: 'WebSocket definitions (defineSocket) exercised by a committed slice',
|
|
269
|
+
status: 'stable',
|
|
270
|
+
evidence: 'bun --cwd examples/enterprise-crm test (chat/room oracle: join and echo frames)'
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
feature: 'SSR cache definitions (defineCache) exercised by a committed slice',
|
|
274
|
+
status: 'stable',
|
|
275
|
+
evidence: 'bun --cwd examples/enterprise-crm test (catalog/products oracle: policy and filtered loader)'
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
feature: 'Server-side metadata (sliceMeta) and reversible migration blocks in shipped slices',
|
|
279
|
+
status: 'stable',
|
|
280
|
+
evidence: 'bun test packages/synapse/test/feature-exercise.test.ts (rollback rolls back a real statement)'
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
feature: 'Query aggregations, GROUP BY and portable HAVING',
|
|
284
|
+
status: 'stable',
|
|
285
|
+
evidence:
|
|
286
|
+
'bun test packages/synapse/test/query-builder.test.ts; TEST_DATABASE_URL=... bun test packages/synapse/test/postgres-adapters.test.ts'
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
feature: 'Cron scheduling with POSIX DOM/DOW semantics and runAt',
|
|
290
|
+
status: 'stable',
|
|
291
|
+
evidence: 'bun test packages/synapse/test/cron-queue.test.ts'
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
feature: 'PostgreSQL cron scope fails with CRON_UNSUPPORTED_ENGINE',
|
|
295
|
+
status: 'stable',
|
|
296
|
+
evidence: 'TEST_DATABASE_URL=... bun test packages/synapse/test/postgres-adapters.test.ts'
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
feature: 'Fine-grained permissions inside signed session tokens',
|
|
300
|
+
status: 'stable',
|
|
301
|
+
evidence: 'bun test packages/synapse/test/session-security.test.ts'
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
feature: 'OAuth PKCE, state validation and bounded token exchange',
|
|
305
|
+
status: 'stable',
|
|
306
|
+
evidence: 'bun test packages/synapse/test/session-security.test.ts'
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
feature: 'Local CSS bundle without a CDN',
|
|
310
|
+
status: 'stable',
|
|
311
|
+
evidence: 'bun test packages/synapse/test/css-bundle.test.ts'
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
feature: 'Client error boundary for slice render failures',
|
|
315
|
+
status: 'stable',
|
|
316
|
+
evidence: 'bun test packages/synapse/test/hydration.test.tsx'
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
feature: 'SPA morphing preserves focus and form state',
|
|
320
|
+
status: 'stable',
|
|
321
|
+
evidence: 'bun test packages/synapse/test/turbo-router.test.tsx'
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
feature: 'Transactional domain scaffolding (new-domain)',
|
|
325
|
+
status: 'stable',
|
|
326
|
+
evidence: 'bun test packages/synapse/test/scaffolder.test.ts'
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
feature: 'Large-slice warning (WARN_LARGE_SLICE)',
|
|
330
|
+
status: 'stable',
|
|
331
|
+
evidence: 'bun test packages/synapse/test/slice-splitter.test.ts'
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
feature: 'TypeScript compiler API guard (COMPILER_API_UNAVAILABLE)',
|
|
335
|
+
status: 'stable',
|
|
336
|
+
evidence: 'bun test packages/synapse/test/compiler-api.test.ts'
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
feature: 'Accessible UI primitives (Modal, Drawer, Tabs, Dropdown, Toast)',
|
|
340
|
+
status: 'stable',
|
|
341
|
+
evidence:
|
|
342
|
+
'bun test packages/synapse/test/ui-primitives.test.tsx packages/synapse/test/ui-primitives-client.test.tsx'
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
feature: 'Isomorphic dynamic route parameters (useParams/useSearchParams)',
|
|
346
|
+
status: 'stable',
|
|
347
|
+
evidence:
|
|
348
|
+
'bun test packages/synapse/test/dynamic-routes.test.tsx packages/synapse/test/dynamic-routes-client.test.tsx'
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
feature: 'Streaming HTTP responses (ctx.stream, chunked transfer)',
|
|
352
|
+
status: 'stable',
|
|
353
|
+
evidence: 'bun test packages/synapse/test/streaming-oauth.test.ts'
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
feature: 'Client upload hook with progress and abort (useUpload)',
|
|
357
|
+
status: 'stable',
|
|
358
|
+
evidence: 'bun test packages/synapse/test/upload-hook.test.tsx'
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
feature: 'Multi-provider OAuth presets and profile normalization (Google/GitHub/Discord)',
|
|
362
|
+
status: 'stable',
|
|
363
|
+
evidence: 'bun test packages/synapse/test/streaming-oauth.test.ts'
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
feature: 'Native MCP server with 23 tools, including route/seed/slice/component tools',
|
|
367
|
+
status: 'stable',
|
|
368
|
+
evidence: 'bun test packages/synapse/test/mcp-server.test.ts'
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
feature: 'Modal CRUD slice scaffolding (--template=modal-crud)',
|
|
372
|
+
status: 'stable',
|
|
373
|
+
evidence: 'bun test packages/synapse/test/scaffolder.test.ts'
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
feature: 'Vendor bundle auto-rebuild and client-primitive exports',
|
|
377
|
+
status: 'stable',
|
|
378
|
+
evidence: 'bun test packages/synapse/test/client-bundler.test.ts'
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
feature: 'Hydration URL synchronization and interactive modal/dropdown semantics',
|
|
382
|
+
status: 'stable',
|
|
383
|
+
evidence: 'bun test packages/synapse/test/client-entry.test.ts packages/synapse/test/ui-primitives-client.test.tsx'
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
feature: 'Incremental diagnostics cache across processes',
|
|
387
|
+
status: 'roadmap',
|
|
388
|
+
evidence: 'removido na 0.4.0: medido mais lento que o check completo (2.5s vs 1.9s)'
|
|
389
|
+
}
|
|
390
|
+
];
|
|
391
|
+
|
|
392
|
+
/** What the project can honestly say about external adoption today. */
|
|
393
|
+
export const ADOPTION = {
|
|
394
|
+
externalAdopters: 0,
|
|
395
|
+
basis:
|
|
396
|
+
'Sem adoção externa registrada: nenhum deploy de terceiros é conhecido, e a classificação acima reflete a evidência de teste, não uso em produção.'
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
export function projectStatus() {
|
|
400
|
+
return {
|
|
401
|
+
framework: 'SynapseJS',
|
|
402
|
+
version: SYNAPSE_VERSION,
|
|
403
|
+
runtime: 'Bun + Bun.serve',
|
|
404
|
+
database: 'Embedded SQLite (WAL) and PostgreSQL, both verified',
|
|
405
|
+
protocols: ['REST/HTTP', 'Isomorphic RPC', 'Model Context Protocol (MCP)'],
|
|
406
|
+
adoption: ADOPTION,
|
|
407
|
+
toolCount: MCP_TOOL_NAMES.length,
|
|
408
|
+
tools: MCP_TOOL_NAMES,
|
|
409
|
+
features: FEATURE_STATUS,
|
|
410
|
+
commands: [
|
|
411
|
+
'new',
|
|
412
|
+
'dev',
|
|
413
|
+
'start',
|
|
414
|
+
'check',
|
|
415
|
+
'migrate',
|
|
416
|
+
'rollback',
|
|
417
|
+
'db-drift',
|
|
418
|
+
'impact',
|
|
419
|
+
'mcp',
|
|
420
|
+
'skeleton',
|
|
421
|
+
'db-schema',
|
|
422
|
+
'split',
|
|
423
|
+
'build',
|
|
424
|
+
'test',
|
|
425
|
+
'worker',
|
|
426
|
+
'new-slice',
|
|
427
|
+
'new-shared',
|
|
428
|
+
'contract',
|
|
429
|
+
'coverage',
|
|
430
|
+
'info'
|
|
431
|
+
]
|
|
432
|
+
};
|
|
433
|
+
}
|
|
@@ -45,13 +45,14 @@ export function clientEntrySource(options: ClientEntryOptions): string {
|
|
|
45
45
|
`// [SYNAPSE-JS GENERATED CLIENT ENTRY] hydrates the slice in the browser`,
|
|
46
46
|
`import React from 'react';`,
|
|
47
47
|
`import { hydrateRoot } from 'react-dom/client';`,
|
|
48
|
-
`import { rpcCall, SynapseProvider } from 'synapsejs/client';`,
|
|
48
|
+
`import { rpcCall, SynapseProvider, ToastProvider } from 'synapsejs/client';`,
|
|
49
49
|
...layoutImports,
|
|
50
50
|
`import { ${options.componentName} } from ${JSON.stringify(options.clientModulePath)};`,
|
|
51
51
|
``,
|
|
52
52
|
`export function hydrate() {`,
|
|
53
53
|
` const scope = globalThis as unknown as Record<string, unknown>;`,
|
|
54
54
|
` const props = (scope[${JSON.stringify(CLIENT_PROPS_GLOBAL)}] ?? {}) as Record<string, unknown>;`,
|
|
55
|
+
` const currentUrl = (scope.__SYNAPSE_URL__ as string) || (typeof window !== 'undefined' ? window.location.href : '/');`,
|
|
55
56
|
` const root = document.getElementById(${JSON.stringify(rootId)});`,
|
|
56
57
|
` if (root) {`,
|
|
57
58
|
` const sliceElement = React.createElement(${options.componentName}, {`,
|
|
@@ -71,22 +72,27 @@ export function clientEntrySource(options: ClientEntryOptions): string {
|
|
|
71
72
|
` const RootLayout = (RootLayoutModule as any).default || (RootLayoutModule as any).Layout || null;`
|
|
72
73
|
);
|
|
73
74
|
}
|
|
75
|
+
lines.push(` const layoutProps = { ...props, url: currentUrl };`);
|
|
74
76
|
let treeExpr = 'sliceElement';
|
|
75
77
|
if (options.domainLayoutPath) {
|
|
76
|
-
treeExpr = `(typeof DomainLayout === 'function' ? React.createElement(DomainLayout,
|
|
78
|
+
treeExpr = `(typeof DomainLayout === 'function' ? React.createElement(DomainLayout, layoutProps, ${treeExpr}) : ${treeExpr})`;
|
|
77
79
|
}
|
|
78
80
|
if (options.rootLayoutPath) {
|
|
79
|
-
treeExpr = `(typeof RootLayout === 'function' ? React.createElement(RootLayout,
|
|
81
|
+
treeExpr = `(typeof RootLayout === 'function' ? React.createElement(RootLayout, layoutProps, ${treeExpr}) : ${treeExpr})`;
|
|
80
82
|
}
|
|
81
83
|
lines.push(` const treeWithLayout = ${treeExpr};`);
|
|
82
84
|
lines.push(` hydrateRoot(`);
|
|
83
85
|
lines.push(` root,`);
|
|
84
|
-
lines.push(
|
|
86
|
+
lines.push(
|
|
87
|
+
` React.createElement(SynapseProvider, { props, session: props.session as any, url: currentUrl }, React.createElement(ToastProvider, null, treeWithLayout))`
|
|
88
|
+
);
|
|
85
89
|
lines.push(` );`);
|
|
86
90
|
} else {
|
|
87
91
|
lines.push(` hydrateRoot(`);
|
|
88
92
|
lines.push(` root,`);
|
|
89
|
-
lines.push(
|
|
93
|
+
lines.push(
|
|
94
|
+
` React.createElement(SynapseProvider, { props, session: props.session as any, url: currentUrl }, React.createElement(ToastProvider, null, sliceElement))`
|
|
95
|
+
);
|
|
90
96
|
lines.push(` );`);
|
|
91
97
|
}
|
|
92
98
|
|
|
@@ -159,7 +159,9 @@ export async function validateExternalUrl(
|
|
|
159
159
|
return { ok: true, resolvedIp: hostname };
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
//
|
|
162
|
+
// Pre-flight resolution. The address returned here is what the caller must connect
|
|
163
|
+
// to — this check alone does not prevent rebinding, pinning the fetch to
|
|
164
|
+
// `resolvedIp` is what does (see fetchPinnedExternal in runtime/server.ts).
|
|
163
165
|
try {
|
|
164
166
|
const records = await dns.promises.lookup(hostname, { all: true });
|
|
165
167
|
if (!records || records.length === 0) {
|