@lunora/runtime 1.0.0-alpha.281 → 1.0.0-alpha.283

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/LICENSE.md CHANGED
@@ -1,231 +1,208 @@
1
- # Functional Source License, Version 1.1, Apache 2.0 Future License
2
1
 
3
- ## Abbreviation
4
-
5
- FSL-1.1-Apache-2.0
6
-
7
- ## Notice
8
-
9
- Copyright 2026 anolilab and contributors
10
-
11
- ## Terms and Conditions
12
-
13
- ### Licensor ("We")
14
-
15
- The party offering the Software under these Terms and Conditions.
16
-
17
- ### The Software
18
-
19
- The "Software" is each version of the software that we make available under
20
- these Terms and Conditions, as indicated by our inclusion of these Terms and
21
- Conditions with the Software.
22
-
23
- ### License Grant
24
-
25
- Subject to your compliance with this License Grant and the Patents,
26
- Redistribution and Trademark clauses below, we hereby grant you the right to
27
- use, copy, modify, create derivative works, publicly perform, publicly display
28
- and redistribute the Software for any Permitted Purpose identified below.
29
-
30
- ### Permitted Purpose
31
-
32
- A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
- means making the Software available to others in a commercial product or service
34
- that:
35
-
36
- 1. substitutes for the Software;
37
-
38
- 2. substitutes for any other product or service we offer using the Software that
39
- exists as of the date we make the Software available; or
40
-
41
- 3. offers the same or substantially similar functionality as the Software.
42
-
43
- Permitted Purposes specifically include using the Software:
44
-
45
- 1. for your internal use and access;
46
-
47
- 2. for non-commercial education;
48
-
49
- 3. for non-commercial research; and
50
-
51
- 4. in connection with professional services that you provide to a licensee using
52
- the Software in accordance with these Terms and Conditions.
53
-
54
- ### Patents
55
-
56
- To the extent your use for a Permitted Purpose would necessarily infringe our
57
- patents, the license grant above includes a license under our patents. If you
58
- make a claim against any party that the Software infringes or contributes to the
59
- infringement of any patent, then your patent license to the Software ends
60
- immediately.
61
-
62
- ### Redistribution
63
-
64
- The Terms and Conditions apply to all copies, modifications and derivatives of
65
- the Software.
66
-
67
- If you redistribute any copies, modifications or derivatives of the Software,
68
- you must include a copy of or a link to these Terms and Conditions and not
69
- remove any copyright notices provided in or with the Software.
70
-
71
- ### Disclaimer
72
-
73
- THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
- IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
- PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
-
77
- IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
- SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN
79
- IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
-
81
- ### Trademarks
82
-
83
- Except for displaying the License Details and identifying us as the origin of
84
- the Software, you have no right under these Terms and Conditions to use our
85
- trademarks, trade names, service marks or product names.
86
-
87
- ## Grant of Future License
88
-
89
- We hereby irrevocably grant you an additional license to use the Software under
90
- the Apache License, Version 2.0 that is effective on the second anniversary of
91
- the date we make the Software available. On or after that date, you may use the
92
- Software under the Apache License, Version 2.0, in which case the following will
93
- apply:
94
-
95
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
- this file except in compliance with the License.
97
-
98
- You may obtain a copy of the License at
99
-
100
- http://www.apache.org/licenses/LICENSE-2.0
101
-
102
- Unless required by applicable law or agreed to in writing, software distributed
103
- under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
- CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
- specific language governing permissions and limitations under the License.
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
106
203
 
107
204
  <!-- DEPENDENCIES -->
108
205
  <!-- /DEPENDENCIES -->
109
206
 
110
207
  <!-- TYPE_DEPENDENCIES -->
111
-
112
- # Licenses of bundled types
113
- The published @lunora/runtime artifact additionally contains code with the following licenses:
114
- FSL-1.1-Apache-2.0
115
-
116
- # Bundled types:
117
- ## @lunora/workflow
118
- License: FSL-1.1-Apache-2.0
119
- By: Daniel Bannert
120
- Repository: git+https://github.com/anolilab/lunora.git
121
-
122
- > # Functional Source License, Version 1.1, Apache 2.0 Future License
123
- >
124
- > ## Abbreviation
125
- >
126
- > FSL-1.1-Apache-2.0
127
- >
128
- > ## Notice
129
- >
130
- > Copyright 2026 anolilab and contributors
131
- >
132
- > ## Terms and Conditions
133
- >
134
- > ### Licensor ("We")
135
- >
136
- > The party offering the Software under these Terms and Conditions.
137
- >
138
- > ### The Software
139
- >
140
- > The "Software" is each version of the software that we make available under
141
- > these Terms and Conditions, as indicated by our inclusion of these Terms and
142
- > Conditions with the Software.
143
- >
144
- > ### License Grant
145
- >
146
- > Subject to your compliance with this License Grant and the Patents,
147
- > Redistribution and Trademark clauses below, we hereby grant you the right to
148
- > use, copy, modify, create derivative works, publicly perform, publicly display
149
- > and redistribute the Software for any Permitted Purpose identified below.
150
- >
151
- > ### Permitted Purpose
152
- >
153
- > A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
154
- > means making the Software available to others in a commercial product or service
155
- > that:
156
- >
157
- > 1. substitutes for the Software;
158
- >
159
- > 2. substitutes for any other product or service we offer using the Software that
160
- > exists as of the date we make the Software available; or
161
- >
162
- > 3. offers the same or substantially similar functionality as the Software.
163
- >
164
- > Permitted Purposes specifically include using the Software:
165
- >
166
- > 1. for your internal use and access;
167
- >
168
- > 2. for non-commercial education;
169
- >
170
- > 3. for non-commercial research; and
171
- >
172
- > 4. in connection with professional services that you provide to a licensee using
173
- > the Software in accordance with these Terms and Conditions.
174
- >
175
- > ### Patents
176
- >
177
- > To the extent your use for a Permitted Purpose would necessarily infringe our
178
- > patents, the license grant above includes a license under our patents. If you
179
- > make a claim against any party that the Software infringes or contributes to the
180
- > infringement of any patent, then your patent license to the Software ends
181
- > immediately.
182
- >
183
- > ### Redistribution
184
- >
185
- > The Terms and Conditions apply to all copies, modifications and derivatives of
186
- > the Software.
187
- >
188
- > If you redistribute any copies, modifications or derivatives of the Software,
189
- > you must include a copy of or a link to these Terms and Conditions and not
190
- > remove any copyright notices provided in or with the Software.
191
- >
192
- > ### Disclaimer
193
- >
194
- > THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
195
- > IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
196
- > PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
197
- >
198
- > IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
199
- > SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN
200
- > IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
201
- >
202
- > ### Trademarks
203
- >
204
- > Except for displaying the License Details and identifying us as the origin of
205
- > the Software, you have no right under these Terms and Conditions to use our
206
- > trademarks, trade names, service marks or product names.
207
- >
208
- > ## Grant of Future License
209
- >
210
- > We hereby irrevocably grant you an additional license to use the Software under
211
- > the Apache License, Version 2.0 that is effective on the second anniversary of
212
- > the date we make the Software available. On or after that date, you may use the
213
- > Software under the Apache License, Version 2.0, in which case the following will
214
- > apply:
215
- >
216
- > Licensed under the Apache License, Version 2.0 (the "License"); you may not use
217
- > this file except in compliance with the License.
218
- >
219
- > You may obtain a copy of the License at
220
- >
221
- > http://www.apache.org/licenses/LICENSE-2.0
222
- >
223
- > Unless required by applicable law or agreed to in writing, software distributed
224
- > under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
225
- > CONDITIONS OF ANY KIND, either express or implied. See the License for the
226
- > specific language governing permissions and limitations under the License.
227
- >
228
- > <!-- DEPENDENCIES -->
229
- > <!-- /DEPENDENCIES -->
230
-
231
208
  <!-- /TYPE_DEPENDENCIES -->
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  <div align="center">
16
16
 
17
17
  [![typescript-image][typescript-badge]][typescript-url]
18
- [![FSL-1.1-Apache-2.0 licence][license-badge]][license]
18
+ [![Apache-2.0 licence][license-badge]][license]
19
19
  [![npm version][npm-version-badge]][npm-version]
20
20
  [![npm downloads][npm-downloads-badge]][npm-downloads]
21
21
  [![PRs Welcome][prs-welcome-badge]][prs-welcome]
@@ -173,11 +173,11 @@ This is an open source project and will always remain free to use. If you think
173
173
 
174
174
  ## License
175
175
 
176
- The Lunora runtime package is open-sourced software licensed under the [FSL-1.1-Apache-2.0][license].
176
+ The Lunora runtime package is open-sourced software licensed under the [Apache-2.0][license].
177
177
 
178
178
  <!-- badges -->
179
179
 
180
- [license-badge]: https://img.shields.io/badge/license-FSL--1.1--Apache--2.0-blue.svg?style=for-the-badge
180
+ [license-badge]: https://img.shields.io/badge/license-Apache--2.0-blue.svg?style=for-the-badge
181
181
  [license]: https://github.com/anolilab/lunora/blob/alpha/LICENSE.md
182
182
  [npm-version-badge]: https://img.shields.io/npm/v/@lunora/runtime?style=for-the-badge
183
183
  [npm-version]: https://www.npmjs.com/package/@lunora/runtime
package/dist/index.d.mts CHANGED
@@ -3062,6 +3062,39 @@ declare const decorateResponse: (response: Response, request: Request, resolved:
3062
3062
  interface AssetsFetcherLike {
3063
3063
  fetch: (request: Request) => Promise<Response>;
3064
3064
  }
3065
+ /** One file the CLI sends: its name under `lunora/migrations/` and its SQL text. */
3066
+ interface SqlMigrationFileRequest {
3067
+ name: string;
3068
+ sql: string;
3069
+ }
3070
+ interface SqlMigrationApplyRequest {
3071
+ /** Run only additive statements (a new table or index, an added column). Set by the route from the caller's token, never by the body. */
3072
+ additiveOnly: boolean;
3073
+ /** Record every pending file as applied without running it. Drift is still refused. */
3074
+ baseline: boolean;
3075
+ /** Record pending files up to and including this one (by name), and leave the later ones pending. */
3076
+ baselineThrough?: string;
3077
+ /** Run files that hold destructive statements. Without it such a file is refused and nothing runs. */
3078
+ confirmDestructive: boolean;
3079
+ /** Report the plan without running or recording anything. */
3080
+ dryRun: boolean;
3081
+ files: ReadonlyArray<SqlMigrationFileRequest>;
3082
+ }
3083
+ /** The per-file outcome, as `@lunora/d1`'s `applySqlMigrationFiles` reports it. */
3084
+ interface SqlMigrationApplyResult {
3085
+ files: ReadonlyArray<{
3086
+ destructive: ReadonlyArray<string>;
3087
+ name: string;
3088
+ rootOnly: ReadonlyArray<string>;
3089
+ skipped: ReadonlyArray<string>;
3090
+ state: "applied" | "baselined" | "changed" | "pending" | "ran";
3091
+ statements: ReadonlyArray<string>;
3092
+ }>;
3093
+ /** A dry run only: the pending files a real run with the same options would refuse. */
3094
+ refused?: ReadonlyArray<string>;
3095
+ }
3096
+ /** The worker option that runs a request against the D1 binding. */
3097
+ type SqlMigrationApplier = (request: SqlMigrationApplyRequest) => Promise<SqlMigrationApplyResult>;
3065
3098
  /**
3066
3099
  * Who is allowed to hand this worker a trace to join.
3067
3100
  *
@@ -3126,6 +3159,16 @@ type TraceTrustSignal = "mtls";
3126
3159
  * can reach the worker.
3127
3160
  */
3128
3161
  type TrustInboundTraceContext = boolean | TraceTrustSignal | ((request: Request) => boolean);
3162
+ /**
3163
+ * The scopes a named admin token can be minted with. A token with no scope can do everything a named token can do,
3164
+ * and nothing a scope unlocks. A scope unlocks one narrow surface; the root token is the only thing that unlocks the rest.
3165
+ *
3166
+ * Not a package: the worker, the shard and the CLI import it by relative path and the bundler inlines it. Keep it
3167
+ * zero-dependency.
3168
+ */
3169
+ /** `migrations`: run the SQL migration files, but only their additive statements (see `@lunora/d1`'s `additiveOnly`). */
3170
+ declare const ADMIN_TOKEN_SCOPES: readonly ["migrations"];
3171
+ type AdminTokenScope = (typeof ADMIN_TOKEN_SCOPES)[number];
3129
3172
  /** One named admin token as `GET /_lunora/admin/tokens` lists it. The secret is never listed. */
3130
3173
  interface AdminTokenSummary {
3131
3174
  /** Epoch ms. */
@@ -3140,6 +3183,8 @@ interface AdminTokenSummary {
3140
3183
  * name: revoke it again to clear the row. A revoked token is refused regardless.
3141
3184
  */
3142
3185
  revoked?: boolean;
3186
+ /** What the token may do beyond the admin plane. Empty for an ordinary token. */
3187
+ scopes: AdminTokenScope[];
3143
3188
  }
3144
3189
  /** The answer to `POST /_lunora/admin/tokens` — the only response that ever carries the secret. */
3145
3190
  interface CreatedAdminToken {
@@ -3308,6 +3353,7 @@ interface SchedulerRunOptions {
3308
3353
  maxAttempts?: number;
3309
3354
  maxMs?: number;
3310
3355
  };
3356
+ shardKey?: string;
3311
3357
  }
3312
3358
  /**
3313
3359
  * The scheduler surface on an HTTP action context. Mirrors `@lunora/server`'s
@@ -3965,6 +4011,13 @@ interface NotifySubscriptionFilter {
3965
4011
  * unauthenticated end user.
3966
4012
  */
3967
4013
  interface ShardCaller {
4014
+ /**
4015
+ * The function being called, where the transport names one: the RPC envelope
4016
+ * (single, batch, REST, `serverQuery`), the scheduler's target and a `ctx.run*`
4017
+ * on a named shard. Unset on a path that names none (a WebSocket upgrade, a live
4018
+ * publish, `fetchShard`), so a gate keyed on it must refuse those callers.
4019
+ */
4020
+ functionPath?: string;
3968
4021
  /** The identity `resolveIdentity` produced for this request, or `null` when the caller is unauthenticated. */
3969
4022
  identity: ResolvedIdentity | null;
3970
4023
  /** The shard the caller named (the default shard when the request named none). */
@@ -4074,6 +4127,11 @@ interface WorkerOptions {
4074
4127
  * (point-in-time recovery). When omitted, apply covers only shard-local tables.
4075
4128
  */
4076
4129
  applyGlobals?: GlobalCdcApplyFunction;
4130
+ /**
4131
+ * Runs the SQL migration files `lunora migrate apply` sends (`POST /_lunora/admin/sql-migrations`). Codegen sets it
4132
+ * for a D1 global plane. Absent, the route refuses, since a file that drops a table has no binding to run against.
4133
+ */
4134
+ applySqlMigrations?: SqlMigrationApplier;
4077
4135
  /**
4078
4136
  * The generated architecture manifest (module catalog + static call graph).
4079
4137
  * Codegen emits `_generated/architecture.ts` once the app declares a module