@vxil/cli 0.21.0 → 0.23.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.
- package/dist/_vxil-feature-configs.d.ts +17 -2
- package/dist/config.d.ts +18 -7
- package/dist/vxil.js +854 -146
- package/package.json +4 -4
|
@@ -15,6 +15,11 @@ export declare const RESERVED_CREDIT_TYPES: ReadonlySet<string>;
|
|
|
15
15
|
* Read by the schema, the deploy clamp and the CLI. */
|
|
16
16
|
export declare const FN_RETRY_MAX_ATTEMPTS = 5;
|
|
17
17
|
export declare const FN_RETRY_BINDING_KINDS: ReadonlySet<string>;
|
|
18
|
+
/** An `http` binding's caps (2026-10-11; rules at fnForwardHeadersError /
|
|
19
|
+
* fnServerScopesError). Up here because the schema below reads them. */
|
|
20
|
+
export declare const FN_FORWARD_HEADERS_MAX = 8;
|
|
21
|
+
export declare const FN_FORWARD_HEADER_VALUE_MAX = 256;
|
|
22
|
+
export declare const FN_SERVER_SCOPES_MAX = 32;
|
|
18
23
|
/** True when a credit_type is a vxil-COGS reserved type (grant/consume/config
|
|
19
24
|
* of which is restricted to internal platform machinery). */
|
|
20
25
|
export declare function isReservedCreditType(creditType: string): boolean;
|
|
@@ -710,6 +715,7 @@ export declare const PaymentsConfigSchema: import("@sinclair/typebox").TObject<{
|
|
|
710
715
|
amount: import("@sinclair/typebox").TInteger;
|
|
711
716
|
period: import("@sinclair/typebox").TString;
|
|
712
717
|
mode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"add">, import("@sinclair/typebox").TLiteral<"reset">]>>;
|
|
718
|
+
expireOnEnd: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
713
719
|
}>>>;
|
|
714
720
|
}>>;
|
|
715
721
|
priceMap: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>>;
|
|
@@ -744,6 +750,8 @@ export declare const FunctionsConfigSchema: import("@sinclair/typebox").TObject<
|
|
|
744
750
|
maxAttempts: import("@sinclair/typebox").TInteger;
|
|
745
751
|
}>>;
|
|
746
752
|
overlap: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"allow">, import("@sinclair/typebox").TLiteral<"skip">]>>;
|
|
753
|
+
forwardHeaders: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
754
|
+
serverScopes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
747
755
|
}>>>;
|
|
748
756
|
scriptRef: import("@sinclair/typebox").TString;
|
|
749
757
|
scopes: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
@@ -824,12 +832,12 @@ export type AuthHookEvent = (typeof AUTH_HOOK_EVENTS)[number];
|
|
|
824
832
|
/** The events a `cmsHook` function binding may name — the closed union
|
|
825
833
|
* `packages/config` types on the `cmsHook` trigger, and the keys of the
|
|
826
834
|
* functions-v1 receiver's CMS_HOOK_EVENTS_FOR (beforeCreate → created,
|
|
827
|
-
* beforeUpdate → updated, beforeWrite → both). Omitted = beforeWrite. Anything
|
|
835
|
+
* beforeUpdate → updated, beforeWrite → both, afterPublish → published). Omitted = beforeWrite. Anything
|
|
828
836
|
* else is refused at config write (E-CMSHOOK, 2026-10-01): an unknown name used
|
|
829
837
|
* to fall back to beforeWrite at delivery, so a typo like 'afterCreate' or
|
|
830
838
|
* 'beforeDelete' silently subscribed the function to creates AND updates.
|
|
831
839
|
* A CI gate pins every copy to this list. */
|
|
832
|
-
export declare const CMS_HOOK_EVENTS: readonly ["beforeCreate", "beforeUpdate", "beforeWrite"];
|
|
840
|
+
export declare const CMS_HOOK_EVENTS: readonly ["beforeCreate", "beforeUpdate", "beforeWrite", "afterPublish"];
|
|
833
841
|
export type CmsHookEvent = (typeof CMS_HOOK_EVENTS)[number];
|
|
834
842
|
/** The ONE refusal text for an unknown cmsHook binding event (the config
|
|
835
843
|
* validator and the deploy route's early 422 both use it). */
|
|
@@ -869,6 +877,13 @@ export declare const MCP_MAX_PROMPTS = 32;
|
|
|
869
877
|
* stays ALLOWED (fn→fn composition). Source of truth for both the config-write
|
|
870
878
|
* validation below and the control-plane deploy clamp. */
|
|
871
879
|
export declare const DENY_FUNCTION_SCOPES: Set<string>;
|
|
880
|
+
export declare function fnForwardHeadersError(raw: unknown): string | null;
|
|
881
|
+
/** FN-SERVER-SCOPES: an `http` binding's `serverScopes` — the scopes of the
|
|
882
|
+
* tenant-only tokens (`server_jwts`) minted next to the caller-bound ones.
|
|
883
|
+
* Each must be one of the function's own `scopes` (pass `fnScopes` once they
|
|
884
|
+
* are known; undefined checks the shape only), so a caller can never reach
|
|
885
|
+
* more than the author granted the function. */
|
|
886
|
+
export declare function fnServerScopesError(raw: unknown, fnScopes?: readonly string[]): string | null;
|
|
872
887
|
/** `{var}` names of a rate-limit key template (rate-limits-v1 core.ts
|
|
873
888
|
* templateVars parity). */
|
|
874
889
|
export declare function rlTemplateVars(template: string): string[];
|
package/dist/config.d.ts
CHANGED
|
@@ -178,10 +178,18 @@ export interface FunctionTriggerRetry {
|
|
|
178
178
|
/** A function trigger (guide ch. 8). cmsHook fires on a CMS write;
|
|
179
179
|
* authHook fires on ONE auth lifecycle event (default `user.created` — the
|
|
180
180
|
* post-signup hook; at-least-once, ~1min fanout latency). */
|
|
181
|
-
export type FunctionTrigger =
|
|
181
|
+
export type FunctionTrigger =
|
|
182
|
+
/** `http` (2026-10-11): `forwardHeaders` — up to 8 `x-…` request header
|
|
183
|
+
* names copied into the envelope's `client.headers` (caller-asserted: never
|
|
184
|
+
* for authorization); `serverScopes` — scopes (each one of the function's
|
|
185
|
+
* own `scopes`) of extra tenant-only tokens, `server_jwts`, for writes the
|
|
186
|
+
* end user must not make. */
|
|
187
|
+
{
|
|
182
188
|
kind: 'http';
|
|
183
189
|
path?: string;
|
|
184
190
|
retry?: FunctionTriggerRetry;
|
|
191
|
+
forwardHeaders?: string[];
|
|
192
|
+
serverScopes?: string[];
|
|
185
193
|
}
|
|
186
194
|
/** `overlap: 'skip'` (2026-10-01): a due tick fires nothing while the
|
|
187
195
|
* previous tick's run is still open (queued / running / retrying / waiting /
|
|
@@ -206,21 +214,24 @@ export type FunctionTrigger = {
|
|
|
206
214
|
* name — lowercase dotted segments, ≤64 chars, validated at deploy — and is
|
|
207
215
|
* also enforced at delivery: a non-matching event is ACK-200 skipped.
|
|
208
216
|
* Declaring the binding is what opts the function into event delivery; a
|
|
209
|
-
* receiver that declares only `cron` keeps the older cron+{} wake.
|
|
217
|
+
* receiver that declares only `cron` keeps the older cron+{} wake.
|
|
218
|
+
* `source` is optional: a bare `{ kind: 'webhook' }` receives every event. */
|
|
210
219
|
| {
|
|
211
220
|
kind: 'webhook';
|
|
212
|
-
source
|
|
221
|
+
source?: string;
|
|
213
222
|
retry?: FunctionTriggerRetry;
|
|
214
223
|
}
|
|
215
224
|
/** `cmsHook`: fires after a CMS write in `collection`. The platform filters
|
|
216
225
|
* deliveries on the binding (2026-09-19): `beforeCreate` → created only,
|
|
217
|
-
* `beforeUpdate` → updated only, `beforeWrite` → created|updated
|
|
218
|
-
*
|
|
219
|
-
*
|
|
226
|
+
* `beforeUpdate` → updated only, `beforeWrite` → created|updated,
|
|
227
|
+
* `afterPublish` → published (a draft→published transition is its own event,
|
|
228
|
+
* not an update); a write to another collection never wakes the function.
|
|
229
|
+
* Deleted/bulk events are not delivered to a cmsHook binding. `event`
|
|
230
|
+
* defaults to `beforeWrite`. */
|
|
220
231
|
| {
|
|
221
232
|
kind: 'cmsHook';
|
|
222
233
|
collection: string;
|
|
223
|
-
event
|
|
234
|
+
event?: 'beforeCreate' | 'beforeUpdate' | 'beforeWrite' | 'afterPublish';
|
|
224
235
|
retry?: FunctionTriggerRetry;
|
|
225
236
|
} | {
|
|
226
237
|
kind: 'authHook';
|