sporades 0.8.6 → 0.9.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 (119) hide show
  1. package/CHANGES.md +98 -85
  2. package/README.md +33 -0
  3. package/bin/sporades-host-helper.js +300 -11
  4. package/bin/sporades.js +3592 -513
  5. package/dist/access-key-contract.d.ts +5 -0
  6. package/dist/access-key-contract.d.ts.map +1 -0
  7. package/dist/access-key-contract.js +5 -0
  8. package/dist/access-key-contract.js.map +1 -0
  9. package/dist/access-keys-runtime.d.ts +195 -0
  10. package/dist/access-keys-runtime.d.ts.map +1 -0
  11. package/dist/access-keys-runtime.js +871 -0
  12. package/dist/access-keys-runtime.js.map +1 -0
  13. package/dist/acl-runtime.d.ts +5 -2
  14. package/dist/acl-runtime.d.ts.map +1 -1
  15. package/dist/acl-runtime.js +12 -5
  16. package/dist/acl-runtime.js.map +1 -1
  17. package/dist/auth-admission.d.ts +23 -0
  18. package/dist/auth-admission.d.ts.map +1 -0
  19. package/dist/auth-admission.js +189 -0
  20. package/dist/auth-admission.js.map +1 -0
  21. package/dist/auth-runtime.d.ts +34 -1
  22. package/dist/auth-runtime.d.ts.map +1 -1
  23. package/dist/auth-runtime.js +88 -25
  24. package/dist/auth-runtime.js.map +1 -1
  25. package/dist/bundle-pipeline.d.ts.map +1 -1
  26. package/dist/bundle-pipeline.js +7 -0
  27. package/dist/bundle-pipeline.js.map +1 -1
  28. package/dist/cli/access-key-operator-envelope.d.ts +9 -0
  29. package/dist/cli/access-key-operator-envelope.d.ts.map +1 -0
  30. package/dist/cli/access-key-operator-envelope.js +209 -0
  31. package/dist/cli/access-key-operator-envelope.js.map +1 -0
  32. package/dist/cli/cli-help.d.ts +9 -2
  33. package/dist/cli/cli-help.d.ts.map +1 -1
  34. package/dist/cli/cli-help.js +26 -0
  35. package/dist/cli/cli-help.js.map +1 -1
  36. package/dist/cli/cli-support.d.ts +1 -0
  37. package/dist/cli/cli-support.d.ts.map +1 -1
  38. package/dist/cli/cli-version.d.ts +1 -1
  39. package/dist/cli/cli-version.js +1 -1
  40. package/dist/cli/host-helper-requests.d.ts +8 -2
  41. package/dist/cli/host-helper-requests.d.ts.map +1 -1
  42. package/dist/cli/project-config.d.ts +1 -0
  43. package/dist/cli/project-config.d.ts.map +1 -1
  44. package/dist/cli/project-config.js +5 -0
  45. package/dist/cli/project-config.js.map +1 -1
  46. package/dist/cli/schedule-inspection-envelope.d.ts.map +1 -1
  47. package/dist/cli/schedule-inspection-envelope.js +46 -3
  48. package/dist/cli/schedule-inspection-envelope.js.map +1 -1
  49. package/dist/cli/sporades-host-helper.js +73 -9
  50. package/dist/cli/sporades-host-helper.js.map +1 -1
  51. package/dist/cli/sporades.js +195 -3
  52. package/dist/cli/sporades.js.map +1 -1
  53. package/dist/client-toolchain.js +11 -1
  54. package/dist/client-toolchain.js.map +1 -1
  55. package/dist/client.d.ts +1 -0
  56. package/dist/client.d.ts.map +1 -1
  57. package/dist/client.js +1 -0
  58. package/dist/client.js.map +1 -1
  59. package/dist/database-runtime.d.ts +1 -0
  60. package/dist/database-runtime.d.ts.map +1 -1
  61. package/dist/database-runtime.js +258 -11
  62. package/dist/database-runtime.js.map +1 -1
  63. package/dist/file-storage-runtime.d.ts +1 -1
  64. package/dist/file-storage-runtime.d.ts.map +1 -1
  65. package/dist/file-storage-runtime.js +4 -4
  66. package/dist/file-storage-runtime.js.map +1 -1
  67. package/dist/generated-source-manifest.json +43 -2
  68. package/dist/http-runtime.d.ts +1 -1
  69. package/dist/http-runtime.d.ts.map +1 -1
  70. package/dist/http-runtime.js +100 -13
  71. package/dist/http-runtime.js.map +1 -1
  72. package/dist/jobs-runtime.d.ts +63 -0
  73. package/dist/jobs-runtime.d.ts.map +1 -1
  74. package/dist/jobs-runtime.js +164 -4
  75. package/dist/jobs-runtime.js.map +1 -1
  76. package/dist/server-runtime-source.d.ts +57 -2
  77. package/dist/server-runtime-source.d.ts.map +1 -1
  78. package/dist/server-runtime-source.js +600 -116
  79. package/dist/server-runtime-source.js.map +1 -1
  80. package/dist/server.d.ts +28 -0
  81. package/dist/server.d.ts.map +1 -1
  82. package/dist/server.js +140 -6
  83. package/dist/server.js.map +1 -1
  84. package/dist/stripe-events-runtime.d.ts +16 -0
  85. package/dist/stripe-events-runtime.d.ts.map +1 -0
  86. package/dist/stripe-events-runtime.js +21 -0
  87. package/dist/stripe-events-runtime.js.map +1 -0
  88. package/dist/stripe-payment-config.d.ts +24 -0
  89. package/dist/stripe-payment-config.d.ts.map +1 -0
  90. package/dist/stripe-payment-config.js +143 -0
  91. package/dist/stripe-payment-config.js.map +1 -0
  92. package/dist/stripe-payment-integration.d.ts +11 -0
  93. package/dist/stripe-payment-integration.d.ts.map +1 -0
  94. package/dist/stripe-payment-integration.js +309 -0
  95. package/dist/stripe-payment-integration.js.map +1 -0
  96. package/dist/stripe-webhook-runtime.d.ts +22 -0
  97. package/dist/stripe-webhook-runtime.d.ts.map +1 -0
  98. package/dist/stripe-webhook-runtime.js +38 -0
  99. package/dist/stripe-webhook-runtime.js.map +1 -0
  100. package/dist/teams-runtime.d.ts.map +1 -1
  101. package/dist/teams-runtime.js +47 -20
  102. package/dist/teams-runtime.js.map +1 -1
  103. package/dist/templates/client-runtime-template.d.ts.map +1 -1
  104. package/dist/templates/client-runtime-template.js +44 -10
  105. package/dist/templates/client-runtime-template.js.map +1 -1
  106. package/dist/templates/scaffold-template.d.ts +3 -0
  107. package/dist/templates/scaffold-template.d.ts.map +1 -1
  108. package/dist/templates/scaffold-template.js +318 -11
  109. package/dist/templates/scaffold-template.js.map +1 -1
  110. package/dist/templates/server-bundle-entry.d.ts.map +1 -1
  111. package/dist/templates/server-bundle-entry.js +55 -7
  112. package/dist/templates/server-bundle-entry.js.map +1 -1
  113. package/dist/templates/server-bundle-module-graph.d.ts.map +1 -1
  114. package/dist/templates/server-bundle-module-graph.js +15 -4
  115. package/dist/templates/server-bundle-module-graph.js.map +1 -1
  116. package/package.json +10 -1
  117. package/src/types/client.d.ts +52 -1
  118. package/src/types/server.d.ts +179 -28
  119. package/src/types/stripe.d.ts +102 -0
package/CHANGES.md CHANGED
@@ -1,103 +1,116 @@
1
1
  # Changes
2
2
 
3
- ## Unreleased - 2026-08-17
3
+ ## Unreleased - 2026-08-21
4
4
 
5
- Changes since v0.8.5.
5
+ Changes since v0.8.7.
6
6
 
7
7
  ### 🚀 Features
8
8
 
9
- - Migrate additive unique constraints atomically (2cf8381).
10
- - Add conflict-targeted idempotent table inserts (bd2aeaa).
11
- - Expose privileged Team inspections (16d784a).
12
- - Declare unique Capsule table constraints (f638b36).
13
- - Expose exact Team membership counts (6893db7).
9
+ - Allow token-shaped Access-key metadata (7211528).
10
+ - Implement verified Stripe event policy delivery (7a68cbe).
11
+ - Implement signed Stripe callback admission (8721c85).
12
+ - Add access key operator controls (08161a6).
13
+ - Add durable Stripe Customer Portal sessions (8a3a604).
14
+ - Preserve access key provenance in jobs (9d1cd62).
15
+ - Add scoped access key file reads (a1033cf).
16
+ - Add browser access key management (7859ecd).
17
+ - Complete owner access key lifecycle (d9c72ab).
18
+ - Implement durable one-time Stripe Checkout (79da915).
19
+ - Add user-owned scoped access keys (2ede8b3).
20
+ - Add declarative session auth admission (a62c566).
21
+ - Preserve exact endpoint body bytes (0968c99).
14
22
 
15
23
  ### 🐛 Bug Fixes
16
24
 
17
- - Shut down rejected runtime candidates (5ec8198).
18
- - Preserve candidate on activation degradation (302268c).
19
- - Activate replacement jobs after teardown (ee4db9f).
20
- - Serialize job lease recovery (09dca55).
21
- - Refresh job leases after dev handoff (5961f77).
22
- - Recover jobs across runtime handoff (6d2b344).
23
- - Gate jobs on successful runtime initialization (3082aad).
24
- - Validate all schedule cursors (bf3dea0).
25
- - Arm schedule recovery after commit (da43e54).
26
- - Persist schedule upgrade lineage (54d664e).
27
- - Close schedule handoff and root reentry races (281029a).
28
- - Serialize legacy schedule upgrades (9e87fb1).
29
- - Publish schedule incarnations atomically (78da563).
30
- - Make schedule generations authoritative (9005b1e).
31
- - Bind schedules to declaration generations (b478ae7).
32
- - Make schedule claims transactional (960f2c6).
33
- - Seal retained job and libsql lifecycle (c5dc235).
34
- - Recover future leases and schedules safely (fa08688).
35
- - Bound job lifecycle time domains (89149c7).
36
- - Close pre-handler job shutdown races (ffdca81).
37
- - Make runtime shutdown failure atomic (1958f3b).
38
- - Harden transactional lifecycle cleanup (e408f2d).
39
- - Defer transactional job cancellation (2d3cf3e).
40
- - Linearize team reads and job claims (1aa5391).
41
- - Wake retained jobs on startup (0a66d61).
42
- - Settle transactional log writes (43e1b2b).
43
- - Revoke settled transaction adapters (bef9821).
44
- - Abort jobs through the root runtime (5a43040).
45
- - Settle jobs before lifecycle shutdown (51d1d9d).
46
- - Settle job shutdown safely (9d38300).
47
- - Await runtime closure during shutdown (ff688f1).
48
- - Settle scheduled Jobs before runtime shutdown (7e7204e).
49
- - Scope unique migration error translation (9af3b24).
50
- - Preserve non-unique migration errors (2cfb207).
51
- - Fix chained transaction release and async insert type (386ea84).
52
- - Fix async insertOrIgnore documentation (a41f2ac).
53
- - Guard privileged join-link reads (dea4ebc).
54
- - Close privileged Team inspection races (d53136c).
55
- - Redact privileged Team join metadata (ad77482).
56
- - Defer existing table unique changes (e49477d).
57
-
58
- ### 🔧 Improvements
59
-
60
- - Ignore Macos fluff files (d4ae934).
25
+ - Fix Stripe callback and Vanilla policy gaps (6b5792f).
26
+ - Bound hosted inspection diagnostics (84977d0).
27
+ - Preserve bounded host inspection failures (5ff9e59).
28
+ - Bind privileged key work to run lifetime (1c201e4).
29
+ - Close operator audit and output gaps (16669ee).
30
+ - Harden access key operator boundaries (a8a6e99).
31
+ - Reject malformed schedule provenance (04d5528).
32
+ - Bind scheduled jobs to privileged actors (f0945a8).
33
+ - Validate scheduled job actor provenance (5f984a4).
34
+ - Harden durable job provenance (5023593).
35
+ - Redact file scope denial provenance (9947213).
36
+ - Correlate access key response loss (a9ed599).
37
+ - Recover access key management failures (e3d42d1).
38
+ - Require sessions for owner security changes (79e99ae).
39
+ - Close first-key transition races (90472d8).
40
+ - Serialize access key owner transitions (effce34).
41
+ - Privatize access key runtime state (f091dd8).
42
+ - Preserve middleware access key state (8d27903).
43
+ - Isolate lifecycle audit delivery (ebc095a).
44
+ - Commit access key lifecycle audits (e6b0a6d).
45
+ - Preserve access key provenance (4f87ed6).
46
+ - Isolate access key admission (48fe0a5).
47
+ - Preserve guarded handler type safety (9496593).
48
+ - Harden declarative auth admission (1d35da1).
61
49
 
62
50
  ### 📝 Documentation
63
51
 
64
- - Pin final platform contract evidence (65250af).
65
- - Align platform contracts after swarm amendments (8f64c4f).
66
- - Record swarm cleanup (7233572).
67
- - Close combined platform contract swarm (a1862c8).
68
- - Record final combined contract package proof (4c44bf8).
69
- - Record combined contract proof evidence (ac1c48c).
70
- - Record accepted unique migration contract (6c5e484).
71
- - Record accepted idempotent insert contract (19e7b63).
72
- - Align shipped Job lifecycle reference (9b7820f).
73
- - Document atomic Job enqueue lifecycle (9dbeb8a).
74
- - Reject nested database transaction scopes (3cc98b6).
75
- - Record accepted platform contract tickets (6ef6d1c).
76
- - Close unique constraint contract gaps (20baabb).
77
- - Prove unique constraint boundaries across adapters (f6d3517).
78
- - Cover immutable unique schema boundary (4fb81d9).
79
- - Initialize platform contracts swarm ledger (61816a1).
80
- - Add Team subscription platform tickets (494a086).
52
+ - Preserve legacy auth profiles in job provenance (549542e).
53
+ - Revalidate owner Sessions and trust Cloudflare clients (ca43887).
54
+ - Keep Stripe event idempotency stable across renames (a86758e).
55
+ - Normalize access key report metadata (95bec68).
56
+ - Fix access key endpoint examples (d3098bd).
57
+ - Publish scoped access key guide (0cf7f8e).
58
+ - Define completed ticket state (b4c4dc8).
59
+ - Normalize access key ticket evidence (491a042).
60
+ - Record access key adapter identities (14277b7).
61
+ - Correct access key proof attribution (a8eadaa).
62
+ - Record access key release completion (779256b).
63
+ - Prove and pack the built-in Stripe payment contract (655e656).
64
+ - Publish access key authority contract (b6efd20).
65
+ - Close access key operator ticket (27877d5).
66
+ - Close durable job provenance ticket (14bcd01).
67
+ - Close access key file reads ticket (7a94f2a).
68
+ - Close browser access key management ticket (42a8520).
69
+ - Extend Stripe Checkout to subscriptions (8d1c72c).
70
+ - Close access key lifecycle ticket (6f06be7).
71
+ - Close scoped access key tracer (c041fa8).
72
+ - Close auth admission ticket (75c817f).
73
+ - Build dormant blank Capsule Stripe foundation (6c0e683).
74
+ - Specify user-owned scoped access keys (8325d69).
81
75
 
82
76
  ### 🧪 Tests
83
77
 
84
- - Reset native schedule clock before init (1153643).
85
- - Prove atomic Team Job enqueue failures (09265ab).
86
- - Preserve PostgreSQL quoting recorder transactions (85d2266).
87
- - Cover unrelated rebuild constraint failures (4605ec5).
88
- - Isolate Node 24 SQLite server tests (8542eb9).
89
- - Harden failed mutation cleanup (d43a5ab).
90
- - Bound transaction handler context lifetime (67dccb4).
91
- - Defer runtime Job dispatch until commit (0a04afb).
92
- - Persist Jobs inside handler transactions (b59004f).
93
- - Reject captured transaction reentry and drop rolled-back jobs (952309e).
94
- - Replace async-local transaction ownership (95cbb85).
95
- - Gate transaction connections and track mutation writes (20cda07).
96
- - Serialize shared database connection transactions (425e4f0).
97
- - Isolate composite unique conformance (75ace57).
98
- - Cover Team count membership lifecycle (80d6cd7).
99
- - Accept cross-realm query arrays (55b87a6).
100
- - Reject query argument array subclasses (2171b61).
78
+ - Revalidate linked Access-key owners (751ee7f).
79
+ - Bound escaped Access-key operator envelopes (099a5a1).
80
+ - Revalidate Sessions during Access-key rotation (79d3e6c).
81
+ - Make Privileged Access-key writes audit-atomic (1737023).
82
+ - Timestamp Access-key revocation after locking (3b70301).
83
+ - Preserve valid Schedule diagnostic names (a002b25).
84
+ - Close Access-key authority and issuance races (f118728).
85
+ - Recheck Access-key expiry inside rotation locks (70d4c0c).
86
+ - Enforce no-store after endpoint header merging (bf50484).
87
+ - Bind File Access-key tests to live Sessions (7e63a82).
88
+ - Require live Session authority for Access-key management (155f154).
89
+ - Revalidate Sessions during Access-key issuance (3a9288e).
90
+ - Harden Access-key operator and Hosted limits (0d5f10c).
91
+ - Make Access-key operator audits atomic (3e972ac).
92
+ - Verify acceptance container cleanup (82ac350).
93
+ - Gate raw container cleanup fallback (235ac72).
94
+ - Bind acceptance cleanup to container id (0dff342).
95
+ - Report suite failures before missing proof (27d8f62).
96
+ - Reconcile JUnit suite outcomes (a19bb41).
97
+ - Recognize required JUnit suites (1dace92).
98
+ - Tokenize junit cases once (1951edd).
99
+ - Prove admitted jobs survive key retirement (717da14).
100
+ - Harden Stripe Checkout authority boundaries (c94fc74).
101
+
102
+ ### 📦 Packaging
103
+
104
+ - Separate documentation validation from full suite (3863ac1).
105
+ - Harden release acceptance cleanup (b431ab4).
106
+ - Keep release failures opaque (9041772).
107
+ - Report bounded release failure details (b869c92).
108
+ - Report release suite failures (5dea6d8).
109
+ - Reconcile release junit evidence (2f9f8fe).
110
+ - Fail closed on release evidence (6f5b0a7).
111
+ - Require access key release evidence (ddd3b47).
112
+ - Close access key release proof gaps (62cc34b).
113
+ - Prove access key release contract (c29c725).
101
114
 
102
115
  ## 0.8.5 - 2026-08-15
103
116
 
package/README.md CHANGED
@@ -51,9 +51,14 @@ sporades host push --restart
51
51
  logs, database inspection, and non-interactive commands are first-class.
52
52
  - **Comprehensive SDK**: built-in authentication, database, user preferences,
53
53
  and storage.
54
+ - **Named automation without fake users**: linked users can issue scoped Access
55
+ keys for API clients while Capsule code retains the real owner in `ctx.auth`
56
+ and distinguishes named API access through `ctx.credential`.
54
57
  - **Built-in collaboration, explicitly authorized**: runtime-owned Teams,
55
58
  email-bound Join links, membership application roles, and explicit Team ACL
56
59
  decisions—without a hidden current Team or automatic data partitioning.
60
+ Trusted `teams.admitJoin` policies may make atomic seat decisions from
61
+ read-only app state hidden by the joining user's ordinary row ACLs.
57
62
  - **Realtime everything**: configuration free - automatic notifications, even for Postgress and AWS-S3
58
63
 
59
64
  ## Documentation
@@ -64,6 +69,9 @@ sporades host push --restart
64
69
  command lookup, split into focused topic pages.
65
70
  - [Built-in Teams](https://mgscox.github.io/sporades/reference/teams): collaboration model, Join
66
71
  links, application roles, and explicit Team ACL decisions.
72
+ - [Access-key server and operator reference](https://mgscox.github.io/sporades/reference/server-runtime#gate-handlers-with-requireauth):
73
+ scoped Bearer admission, user-owned lifecycle, Credential provenance, and
74
+ the bounded operator CLI.
67
75
  - [LLM documentation manifest](https://mgscox.github.io/sporades/llms.txt): release-matched Markdown
68
76
  sources for agents and other documentation tools.
69
77
  - [Architecture](https://mgscox.github.io/sporades/architecture): platform model, runtime modes, Host
@@ -144,6 +152,28 @@ Sporades currently includes:
144
152
  - Inferno scaffolds across the complete template set, using native class-component
145
153
  lifecycle and classic Inferno JSX without React compatibility packages. esbuild
146
154
  remains the default; Vite is available explicitly with full-page Dev refresh.
155
+ - Every new blank Capsule includes a built-in but disabled Stripe payment
156
+ foundation: server-owned wiring, named Checkout and Customer Portal Jobs, shared Job state, an
157
+ empty Price catalogue, and no credentials, payment UI, active callback route, or
158
+ browser Stripe SDK. Complete activation supports an authorized, idempotent
159
+ one-time or recurring subscription Checkout through the same durable Job,
160
+ actor-scoped progress, safe retries, and validated Stripe-hosted redirects.
161
+ Portal remains linked-user-only: Capsule policy authorizes an opaque billing
162
+ holder and resolves its existing Customer before enqueue, then the Job repeats
163
+ both checks before provider access so revocation fails safely. No Customer
164
+ identity is stored in the Capsule intent or Job payload. It is the preferred
165
+ surface for ordinary customer-managed payment methods, invoices,
166
+ cancellations, and supported subscription changes. Complete activation also
167
+ registers one collision-checked callback path. Signed exact bytes are admitted
168
+ into one idempotent Privileged Job per Stripe Event before acknowledgment;
169
+ retries converge and no Capsule billing state changes automatically. The Job
170
+ delivers one Verified Stripe event to the blank Capsule's single
171
+ `stripeEvents: stripeEvent(...)` policy seam under the userless Privileged
172
+ audit lifecycle. Generated policy ignores unknown events and tells authors to
173
+ make deliberate consequences idempotent and order-independent, reject stale
174
+ later-arriving observations, and avoid logging or retaining raw provider data.
175
+ The catalogue owns each Price mode; browser input owns neither mode nor Stripe
176
+ identity. Existing and non-blank Capsules remain unchanged.
147
177
  - Local Dev sessions with rebuilds, WebSocket reconnects, SQLite persistence,
148
178
  logs, database inspection, auth helpers, and file storage. Every admitted
149
179
  esbuild/Vite pair uses the same acknowledged Sporades full-page refresh
@@ -154,6 +184,9 @@ Sporades currently includes:
154
184
  - Runtime-owned auth with anonymous sessions, email auth, Google OAuth,
155
185
  Microsoft OpenID Connect, Sign in with Apple, Facebook Login, and
156
186
  local identity simulation for tests and agents.
187
+ - User-owned named Access keys with Capsule-declared scopes, explicit Custom
188
+ endpoint and private-File opt-in, one-time secret disclosure, Session-only
189
+ owner management, durable Job provenance, and audited operator retirement.
157
190
  - Runtime-owned current-user preferences exposed through `sporades/client`
158
191
  without app preference tables. Preferences follow the Sporades user identity,
159
192
  survive Anonymous account linking, and notify same-user connected clients when