@celsian/vura-contract 0.8.2
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 +21 -0
- package/README.md +179 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +312 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vura contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# @celsian/vura-contract
|
|
2
|
+
|
|
3
|
+
The dependency-free wire contract for Vura route manifests. This package exports
|
|
4
|
+
data types, validation, requirement discovery, and capability evaluation. It does
|
|
5
|
+
not import Vura's compiler, runtime, filesystem, Node built-ins, or a platform SDK.
|
|
6
|
+
Its ESM entry works in Node 20/22 and ES2022 browser/worker environments.
|
|
7
|
+
|
|
8
|
+
## Read and negotiate
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import {
|
|
12
|
+
parseManifest,
|
|
13
|
+
evaluateCapabilities,
|
|
14
|
+
type TargetCapabilities,
|
|
15
|
+
} from '@celsian/vura-contract';
|
|
16
|
+
|
|
17
|
+
// Transitional readers explicitly opt into historical unversioned manifests.
|
|
18
|
+
const manifest = parseManifest(jsonText, { allowLegacy: true });
|
|
19
|
+
const target: TargetCapabilities = {
|
|
20
|
+
name: 'Example static-only target',
|
|
21
|
+
supportedFeatures: ['static-pages'],
|
|
22
|
+
};
|
|
23
|
+
const compatibility = evaluateCapabilities(manifest, target);
|
|
24
|
+
if (!compatibility.compatible) {
|
|
25
|
+
throw new Error(compatibility.diagnostics.map(issue => issue.message).join('\n'));
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This example is a hypothetical target, not a claim about any deployed provider.
|
|
30
|
+
The caller supplies an evidence-backed capability list for the exact reader,
|
|
31
|
+
build adapter, runtime, and service configuration it is deploying. A successful
|
|
32
|
+
evaluation only establishes that those declared capabilities cover the manifest;
|
|
33
|
+
it does not prove that the target implementation actually works. Missing support
|
|
34
|
+
MUST stop admission/build/deployment at the relevant boundary. It MUST NOT become
|
|
35
|
+
a warning followed by silent loss of pages, actions, or other required behavior.
|
|
36
|
+
|
|
37
|
+
## Schema 1 (normative)
|
|
38
|
+
|
|
39
|
+
`ManifestV1` has `schemaVersion: 1`, a required `requiredFeatures` array, and the
|
|
40
|
+
complete existing `RouteManifest` fields:
|
|
41
|
+
|
|
42
|
+
- `api`: source-relative file path, URL pattern, HTTP methods, resolved `kind`,
|
|
43
|
+
optional `hasWebsocket`, and complete raw `config`.
|
|
44
|
+
- `pages`: source-relative file path, URL pattern, rendering `mode`, optional
|
|
45
|
+
singular `layout` and ordered `layouts`, `hasLoader`, `hasGetServerData`, and
|
|
46
|
+
complete raw `config`.
|
|
47
|
+
- `layouts`: source-relative file path and covered relative `dirPattern` (empty
|
|
48
|
+
string denotes the root).
|
|
49
|
+
- Optional `middleware` source path and optional `actions` with source path,
|
|
50
|
+
module ID, and exported names in original order.
|
|
51
|
+
- `timestamp`: a parseable date-time string. Producers SHOULD use ISO 8601 UTC.
|
|
52
|
+
|
|
53
|
+
Schema version and npm package version are independent. Package `0.8.2` introduces
|
|
54
|
+
schema `1`; compatible package releases need not change the schema number.
|
|
55
|
+
|
|
56
|
+
`parseManifest` accepts JSON text or a decoded object, returns `ParsedManifest`,
|
|
57
|
+
and throws `ManifestValidationError` with `issues: { path, code, message }[]` on
|
|
58
|
+
failure. `validateManifest` is the non-throwing equivalent with a discriminated
|
|
59
|
+
`success` result. `isVersionedManifest` narrows an **already validated** result to
|
|
60
|
+
`ManifestV1`; it is not a validator.
|
|
61
|
+
|
|
62
|
+
Readers MUST reject missing schema versions unless they explicitly use
|
|
63
|
+
`allowLegacy: true`. Compatibility accepts the current historical unversioned
|
|
64
|
+
DTO shape; it does not invent defaults for missing required fields. Optional
|
|
65
|
+
omissions remain absent. An explicitly supplied version other than numeric `1`
|
|
66
|
+
MUST fail, even with legacy compatibility enabled. `null`, `"1"`, and an explicit
|
|
67
|
+
`undefined` version are not legacy manifests.
|
|
68
|
+
|
|
69
|
+
Readers preserve all fields, including raw config and unknown extension metadata;
|
|
70
|
+
validation does not reconstruct a reduced object or discard fields. Decoded
|
|
71
|
+
object input is returned by reference, unchanged. Wire data MUST be JSON data;
|
|
72
|
+
callers providing decoded objects are responsible for not supplying executable
|
|
73
|
+
objects, cycles, or other non-JSON values. Extensions MUST NOT alter the meaning
|
|
74
|
+
of known fields. New behavior requiring support MUST also declare a known
|
|
75
|
+
required feature, or use a new schema understood by its readers.
|
|
76
|
+
|
|
77
|
+
Recognized fields are validated when present, including optional booleans,
|
|
78
|
+
arrays, config enums, numeric cache settings, compute resource types, and task
|
|
79
|
+
schedule strings. Unknown config keys are retained, not interpreted. Page tags
|
|
80
|
+
accept the runtime's string-array or comma-separated-string forms. The contract
|
|
81
|
+
does not validate cron syntax, machine provisioning rules, or provider-specific
|
|
82
|
+
config. It does not normalize compute requests; that belongs to the compiler.
|
|
83
|
+
|
|
84
|
+
File/layout paths MUST be relative, with no drive prefix, empty segment, control
|
|
85
|
+
character, or `.`/`..` segment. Both POSIX and Windows scanner-relative separators
|
|
86
|
+
are accepted and preserved. URL patterns MUST begin with `/` and contain no
|
|
87
|
+
query, fragment, backslash, whitespace, empty internal segment, or dot traversal.
|
|
88
|
+
Parameters (`:id`) and catch-alls (`*rest`) are preserved. Consumers still own
|
|
89
|
+
filesystem containment, symlink checks, URL decoding, and destination-specific
|
|
90
|
+
normalization; syntactic validation is not a filesystem sandbox.
|
|
91
|
+
|
|
92
|
+
## Required features (normative)
|
|
93
|
+
|
|
94
|
+
`requiredFeatures` MUST contain every requirement discoverable from the manifest.
|
|
95
|
+
Unknown feature names and duplicates fail validation. Extra **known** requirements
|
|
96
|
+
are allowed for behavior not discoverable from static metadata. A legacy manifest
|
|
97
|
+
that includes `requiredFeatures` is checked by the same rules; compatibility does
|
|
98
|
+
not ignore an unknown requirement. Omitted legacy lists are derived on evaluation.
|
|
99
|
+
|
|
100
|
+
`deriveRequiredFeatures` takes a validated `RouteManifest` and returns requirements
|
|
101
|
+
in `MANIFEST_FEATURES` registry order without mutating the manifest:
|
|
102
|
+
|
|
103
|
+
| Feature | Evidence in the manifest |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| `api` | At least one API route |
|
|
106
|
+
| `static-pages`, `server-pages`, `client-pages`, `hybrid-pages` | Corresponding page mode |
|
|
107
|
+
| `layouts` | Layout records or a page layout/chain |
|
|
108
|
+
| `actions` | At least one action module |
|
|
109
|
+
| `middleware` | Middleware path |
|
|
110
|
+
| `loaders` | Any page has `hasLoader: true` (including build-time loaders) |
|
|
111
|
+
| `legacy-server-data` | Any page has `hasGetServerData: true` |
|
|
112
|
+
| `websocket` | An API route has `hasWebsocket: true` (requires `kind: hot`) |
|
|
113
|
+
| `streaming` | API or server-mode page config declares `streaming: true` |
|
|
114
|
+
| `isr` | Non-streaming server page with positive `revalidate`, or numeric `revalidate` plus positive `swr` |
|
|
115
|
+
| `tasks` | API route has `kind: task` |
|
|
116
|
+
| `scheduled-tasks` | API config declares a schedule string |
|
|
117
|
+
| `function-compute`, `dedicated-compute` | API route's compute placement, resolved as below |
|
|
118
|
+
|
|
119
|
+
`revalidate: 0` without positive stale-while-revalidate (`swr`) always regenerates,
|
|
120
|
+
so it does not require an ISR cache. Server streaming bypasses ISR even when
|
|
121
|
+
`revalidate` is declared. Build-time page modes do not use the server's streaming
|
|
122
|
+
or ISR paths. These rules describe the existing runtime's actual behavior rather
|
|
123
|
+
than requiring support for inactive settings; the raw settings remain preserved.
|
|
124
|
+
Requirements describe the complete build-and-serve pipeline, not just request-time
|
|
125
|
+
execution. Runtime imports and arbitrary application behavior cannot be inferred
|
|
126
|
+
from manifest metadata; producers must explicitly declare additional requirements.
|
|
127
|
+
|
|
128
|
+
Workload semantics and compute placement are separate axes. `kind: task` denotes
|
|
129
|
+
task work, not a claim that it must run on a function or dedicated machine. The
|
|
130
|
+
canonical `config.compute.class` (`function` or `dedicated`) takes precedence for
|
|
131
|
+
placement. When it is absent, historical `kind: hot`, `config.hot: true`, a `hot`
|
|
132
|
+
runtime/placement/target marker, or nonempty `config.machine` implies dedicated
|
|
133
|
+
placement. Other API routes imply function placement. This reproduces the existing
|
|
134
|
+
compiler's compatibility direction without rewriting old fields or introducing a
|
|
135
|
+
second compute normalization implementation. Resource profiles are not features.
|
|
136
|
+
Resolved `hot` routes cannot declare function compute, and resolved `serverless`
|
|
137
|
+
routes cannot declare dedicated compute. A present source `config.kind` must
|
|
138
|
+
preserve task workload semantics and cannot turn a declared hot route into a
|
|
139
|
+
serverless route. The compiler-valid source `config.kind: serverless` with resolved
|
|
140
|
+
`kind: hot` is retained: dedicated placement can cause that normalization. Tasks
|
|
141
|
+
remain valid on either compute class, including historical omitted config fields.
|
|
142
|
+
|
|
143
|
+
`evaluateCapabilities` revalidates the manifest (with legacy compatibility), unions
|
|
144
|
+
derived and declared requirements, and returns `compatible`, `requiredFeatures`,
|
|
145
|
+
`unsupportedFeatures`, and field-path `diagnostics`. Invalid manifests throw;
|
|
146
|
+
unsupported targets return `compatible: false`. No built-in provider support matrix
|
|
147
|
+
is shipped: support must be proven by the caller, not guessed from provider names.
|
|
148
|
+
|
|
149
|
+
## Rolling deployment and rollback
|
|
150
|
+
|
|
151
|
+
The first adoption step is **reader-first**, not a producer format switch:
|
|
152
|
+
|
|
153
|
+
1. Release the contract package and migrate readers to it with explicit legacy
|
|
154
|
+
compatibility, preserving the full DTO through every intermediate service.
|
|
155
|
+
2. Verify packed consumer installations and real fixtures on every build,
|
|
156
|
+
dashboard, admission, worker, and runtime reader. Add each target's tested
|
|
157
|
+
capabilities and enforce refusal before any destructive deployment action.
|
|
158
|
+
3. Only after all active and rollback readers understand schema 1, enable
|
|
159
|
+
versioned producer output with a complete feature list in a separate rollout.
|
|
160
|
+
4. Measure remaining legacy artifacts and deliberately decide any later cutoff.
|
|
161
|
+
|
|
162
|
+
This package does not switch producers or impose a legacy deadline. Rollback may
|
|
163
|
+
restore unversioned producer output while upgraded readers retain compatibility.
|
|
164
|
+
Do not roll a reader back to a version incapable of reading already-emitted schema
|
|
165
|
+
1 artifacts. Never strip an unknown schema version or feature list to force a
|
|
166
|
+
new artifact through the legacy path.
|
|
167
|
+
|
|
168
|
+
## Development verification
|
|
169
|
+
|
|
170
|
+
From the repository root (Node 22 toolchain):
|
|
171
|
+
|
|
172
|
+
```sh
|
|
173
|
+
corepack pnpm exec tsc -b packages/contract
|
|
174
|
+
corepack pnpm exec vitest run packages/contract/test
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
The source tsconfig excludes ambient Node types and browser globals. Production
|
|
178
|
+
exports have no imports or dependencies; all tests use repository development
|
|
179
|
+
tools only.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** Pure data contract: no runtime, compiler, filesystem, or platform imports. */
|
|
2
|
+
export type RouteKind = 'serverless' | 'hot' | 'task';
|
|
3
|
+
export type PageMode = 'static' | 'server' | 'client' | 'hybrid';
|
|
4
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
5
|
+
export interface ApiRoute {
|
|
6
|
+
filePath: string;
|
|
7
|
+
urlPattern: string;
|
|
8
|
+
methods: HttpMethod[];
|
|
9
|
+
kind: RouteKind;
|
|
10
|
+
hasWebsocket?: boolean;
|
|
11
|
+
config: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export interface PageRoute {
|
|
14
|
+
filePath: string;
|
|
15
|
+
urlPattern: string;
|
|
16
|
+
mode: PageMode;
|
|
17
|
+
layout?: string;
|
|
18
|
+
layouts?: string[];
|
|
19
|
+
hasLoader: boolean;
|
|
20
|
+
hasGetServerData: boolean;
|
|
21
|
+
config: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface LayoutRoute {
|
|
24
|
+
filePath: string;
|
|
25
|
+
dirPattern: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ActionModule {
|
|
28
|
+
filePath: string;
|
|
29
|
+
moduleId: string;
|
|
30
|
+
exports: string[];
|
|
31
|
+
}
|
|
32
|
+
/** Unversioned shape retained for existing source consumers and producers. */
|
|
33
|
+
export interface RouteManifest {
|
|
34
|
+
api: ApiRoute[];
|
|
35
|
+
pages: PageRoute[];
|
|
36
|
+
layouts: LayoutRoute[];
|
|
37
|
+
middleware?: string;
|
|
38
|
+
actions?: ActionModule[];
|
|
39
|
+
timestamp: string;
|
|
40
|
+
}
|
|
41
|
+
export declare const SCHEMA_VERSION: 1;
|
|
42
|
+
export declare const MANIFEST_FEATURES: readonly ["api", "static-pages", "server-pages", "client-pages", "hybrid-pages", "layouts", "actions", "middleware", "loaders", "legacy-server-data", "websocket", "streaming", "isr", "tasks", "scheduled-tasks", "function-compute", "dedicated-compute"];
|
|
43
|
+
export type ManifestFeature = typeof MANIFEST_FEATURES[number];
|
|
44
|
+
export interface ManifestV1 extends RouteManifest {
|
|
45
|
+
schemaVersion: typeof SCHEMA_VERSION;
|
|
46
|
+
requiredFeatures: ManifestFeature[];
|
|
47
|
+
}
|
|
48
|
+
export type ParsedManifest = RouteManifest | ManifestV1;
|
|
49
|
+
/** Type guard for an already validated manifest (not an alternative validator). */
|
|
50
|
+
export declare function isVersionedManifest(manifest: ParsedManifest): manifest is ManifestV1;
|
|
51
|
+
export interface ParseManifestOptions {
|
|
52
|
+
allowLegacy?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface ManifestIssue {
|
|
55
|
+
path: string;
|
|
56
|
+
code: 'invalid_type' | 'invalid_value' | 'unsupported_version' | 'missing_version' | 'unknown_feature' | 'missing_feature' | 'invalid_json' | 'unsupported_feature';
|
|
57
|
+
message: string;
|
|
58
|
+
}
|
|
59
|
+
export type ManifestValidationResult = {
|
|
60
|
+
success: true;
|
|
61
|
+
manifest: ParsedManifest;
|
|
62
|
+
} | {
|
|
63
|
+
success: false;
|
|
64
|
+
issues: ManifestIssue[];
|
|
65
|
+
};
|
|
66
|
+
export declare class ManifestValidationError extends Error {
|
|
67
|
+
readonly issues: ManifestIssue[];
|
|
68
|
+
constructor(issues: ManifestIssue[]);
|
|
69
|
+
}
|
|
70
|
+
/** Validate JSON text or an already-decoded object without changing its fields. */
|
|
71
|
+
export declare function validateManifest(input: unknown, options?: ParseManifestOptions): ManifestValidationResult;
|
|
72
|
+
export declare function parseManifest(input: unknown, options?: ParseManifestOptions): ParsedManifest;
|
|
73
|
+
/** Derive requirements from validated metadata, never from a provider name. */
|
|
74
|
+
export declare function deriveRequiredFeatures(manifest: RouteManifest): ManifestFeature[];
|
|
75
|
+
export interface TargetCapabilities {
|
|
76
|
+
name: string;
|
|
77
|
+
supportedFeatures: readonly ManifestFeature[];
|
|
78
|
+
}
|
|
79
|
+
export interface CapabilityEvaluation {
|
|
80
|
+
compatible: boolean;
|
|
81
|
+
requiredFeatures: ManifestFeature[];
|
|
82
|
+
unsupportedFeatures: ManifestFeature[];
|
|
83
|
+
diagnostics: ManifestIssue[];
|
|
84
|
+
}
|
|
85
|
+
/** False means refuse this target, not silently degrade. Invalid manifests throw. */
|
|
86
|
+
export declare function evaluateCapabilities(manifest: ParsedManifest, target: TargetCapabilities): CapabilityEvaluation;
|
|
87
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,KAAK,GAAG,MAAM,CAAC;AACtD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAE1F,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,C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|
|
3
|
+
'api', 'static-pages', 'server-pages', 'client-pages', 'hybrid-pages',
|
|
4
|
+
'layouts', 'actions', 'middleware', 'loaders', 'legacy-server-data',
|
|
5
|
+
'websocket', 'streaming', 'isr', 'tasks', 'scheduled-tasks',
|
|
6
|
+
'function-compute', 'dedicated-compute',
|
|
7
|
+
];
|
|
8
|
+
/** Type guard for an already validated manifest (not an alternative validator). */
|
|
9
|
+
export function isVersionedManifest(manifest) {
|
|
10
|
+
return 'schemaVersion' in manifest && manifest.schemaVersion === SCHEMA_VERSION;
|
|
11
|
+
}
|
|
12
|
+
export class ManifestValidationError extends Error {
|
|
13
|
+
issues;
|
|
14
|
+
constructor(issues) {
|
|
15
|
+
super(issues.map(issue => `${issue.path}: ${issue.message}`).join('\n'));
|
|
16
|
+
this.name = 'ManifestValidationError';
|
|
17
|
+
this.issues = issues;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const own = (value, key) => Object.hasOwn(value, key);
|
|
21
|
+
const isObject = (value) => {
|
|
22
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
23
|
+
return false;
|
|
24
|
+
const prototype = Object.getPrototypeOf(value);
|
|
25
|
+
return prototype === Object.prototype || prototype === null;
|
|
26
|
+
};
|
|
27
|
+
const routeKinds = ['serverless', 'hot', 'task'];
|
|
28
|
+
const pageModes = ['static', 'server', 'client', 'hybrid'];
|
|
29
|
+
const httpMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS'];
|
|
30
|
+
/** Checks accumulate field-level diagnostics; they never strip unknown metadata. */
|
|
31
|
+
class Check {
|
|
32
|
+
issues = [];
|
|
33
|
+
issue(path, message, code = 'invalid_value') {
|
|
34
|
+
this.issues.push({ path, code, message });
|
|
35
|
+
}
|
|
36
|
+
object(value, path) {
|
|
37
|
+
if (isObject(value))
|
|
38
|
+
return true;
|
|
39
|
+
this.issue(path, 'Expected a plain object', 'invalid_type');
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
string(value, path) {
|
|
43
|
+
if (typeof value === 'string' && value.length > 0)
|
|
44
|
+
return true;
|
|
45
|
+
this.issue(path, 'Expected a non-empty string', 'invalid_type');
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
boolean(value, path) {
|
|
49
|
+
if (typeof value !== 'boolean')
|
|
50
|
+
this.issue(path, 'Expected a boolean', 'invalid_type');
|
|
51
|
+
}
|
|
52
|
+
enum(value, allowed, path) {
|
|
53
|
+
if (typeof value !== 'string' || !allowed.includes(value)) {
|
|
54
|
+
this.issue(path, `Expected one of: ${allowed.join(', ')}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
array(value, path, visit) {
|
|
58
|
+
if (!Array.isArray(value)) {
|
|
59
|
+
this.issue(path, 'Expected an array', 'invalid_type');
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
for (let index = 0; index < value.length; index++)
|
|
63
|
+
visit(value[index], `${path}[${index}]`);
|
|
64
|
+
}
|
|
65
|
+
relativePath(value, path, allowEmpty = false) {
|
|
66
|
+
if (allowEmpty && value === '')
|
|
67
|
+
return;
|
|
68
|
+
if (!this.string(value, path))
|
|
69
|
+
return;
|
|
70
|
+
if (/^[A-Za-z]:|[\u0000-\u001f]/.test(value) ||
|
|
71
|
+
value.split(/[\\/]/).some(part => part === '' || part === '.' || part === '..')) {
|
|
72
|
+
this.issue(path, 'Expected a project-relative path without empty, dot, or parent segments');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
url(value, path) {
|
|
76
|
+
if (!this.string(value, path))
|
|
77
|
+
return;
|
|
78
|
+
if (!value.startsWith('/') || /[\\\s?#\u0000-\u001f]/.test(value) || value.includes('//') ||
|
|
79
|
+
value.split('/').some(part => part === '.' || part === '..')) {
|
|
80
|
+
this.issue(path, 'Expected an absolute URL pattern without query, fragment, or traversal');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
optional(object, key, path, visit) {
|
|
84
|
+
if (own(object, key))
|
|
85
|
+
visit(object[key], `${path}.${key}`);
|
|
86
|
+
}
|
|
87
|
+
positive(value, path, integer = false) {
|
|
88
|
+
if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0 || (integer && !Number.isInteger(value))) {
|
|
89
|
+
this.issue(path, `Expected a positive ${integer ? 'integer' : 'finite number'}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
config(value, path, kind) {
|
|
93
|
+
if (!this.object(value, path))
|
|
94
|
+
return;
|
|
95
|
+
if (kind === 'page') {
|
|
96
|
+
this.optional(value, 'mode', path, (v, p) => this.enum(v, pageModes, p));
|
|
97
|
+
this.optional(value, 'revalidate', path, (v, p) => {
|
|
98
|
+
if (typeof v !== 'number' || !Number.isFinite(v) || v < 0)
|
|
99
|
+
this.issue(p, 'Expected a non-negative finite number');
|
|
100
|
+
});
|
|
101
|
+
this.optional(value, 'tags', path, (v, p) => {
|
|
102
|
+
if (typeof v !== 'string')
|
|
103
|
+
this.array(v, p, (item, itemPath) => { this.string(item, itemPath); });
|
|
104
|
+
});
|
|
105
|
+
this.optional(value, 'swr', path, (v, p) => {
|
|
106
|
+
if (typeof v !== 'number' || !Number.isFinite(v) || v < 0)
|
|
107
|
+
this.issue(p, 'Expected a non-negative finite number');
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
this.optional(value, 'kind', path, (v, p) => this.enum(v, routeKinds, p));
|
|
112
|
+
this.optional(value, 'hot', path, (v, p) => this.boolean(v, p));
|
|
113
|
+
this.optional(value, 'schedule', path, (v, p) => { this.string(v, p); });
|
|
114
|
+
this.optional(value, 'machine', path, (v, p) => { this.compute(v, p, false); });
|
|
115
|
+
this.optional(value, 'compute', path, (v, p) => { this.compute(v, p, true); });
|
|
116
|
+
}
|
|
117
|
+
this.optional(value, 'streaming', path, (v, p) => this.boolean(v, p));
|
|
118
|
+
}
|
|
119
|
+
compute(value, path, canonical) {
|
|
120
|
+
if (!this.object(value, path))
|
|
121
|
+
return;
|
|
122
|
+
if (canonical) {
|
|
123
|
+
this.optional(value, 'class', path, (v, p) => this.enum(v, ['function', 'dedicated'], p));
|
|
124
|
+
this.optional(value, 'size', path, (v, p) => this.enum(v, ['nano', 'small', 'medium', 'large', 'xlarge', '2xlarge', '4xlarge'], p));
|
|
125
|
+
}
|
|
126
|
+
for (const key of ['cpu', 'cpus'])
|
|
127
|
+
this.optional(value, key, path, (v, p) => this.positive(v, p, true));
|
|
128
|
+
this.optional(value, 'memoryMb', path, (v, p) => this.positive(v, p));
|
|
129
|
+
this.optional(value, 'memory', path, (v, p) => {
|
|
130
|
+
if (value.class === 'function')
|
|
131
|
+
this.enum(v, ['1gb', '4gb', '6gb', '8gb', '12gb'], p);
|
|
132
|
+
else if (typeof v === 'number')
|
|
133
|
+
this.positive(v, p);
|
|
134
|
+
else
|
|
135
|
+
this.string(v, p);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/** Validate JSON text or an already-decoded object without changing its fields. */
|
|
140
|
+
export function validateManifest(input, options = {}) {
|
|
141
|
+
const check = new Check();
|
|
142
|
+
let value = input;
|
|
143
|
+
if (typeof input === 'string') {
|
|
144
|
+
try {
|
|
145
|
+
value = JSON.parse(input);
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
return { success: false, issues: [{ path: '$', code: 'invalid_json', message: 'Invalid manifest JSON' }] };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (!check.object(value, '$'))
|
|
152
|
+
return { success: false, issues: check.issues };
|
|
153
|
+
const versioned = own(value, 'schemaVersion');
|
|
154
|
+
if (versioned && value.schemaVersion !== SCHEMA_VERSION) {
|
|
155
|
+
check.issue('$.schemaVersion', 'Unsupported schema version; expected 1', 'unsupported_version');
|
|
156
|
+
}
|
|
157
|
+
else if (!versioned && !options.allowLegacy) {
|
|
158
|
+
check.issue('$.schemaVersion', 'Missing schema version; legacy input requires allowLegacy: true', 'missing_version');
|
|
159
|
+
}
|
|
160
|
+
check.array(value.api, '$.api', (route, path) => {
|
|
161
|
+
if (!check.object(route, path))
|
|
162
|
+
return;
|
|
163
|
+
check.relativePath(route.filePath, `${path}.filePath`);
|
|
164
|
+
check.url(route.urlPattern, `${path}.urlPattern`);
|
|
165
|
+
check.enum(route.kind, routeKinds, `${path}.kind`);
|
|
166
|
+
check.array(route.methods, `${path}.methods`, (method, p) => check.enum(method, httpMethods, p));
|
|
167
|
+
check.optional(route, 'hasWebsocket', path, (v, p) => check.boolean(v, p));
|
|
168
|
+
check.config(route.config, `${path}.config`, 'api');
|
|
169
|
+
if (isObject(route.config)) {
|
|
170
|
+
const compute = isObject(route.config.compute) ? route.config.compute : {};
|
|
171
|
+
if ((route.kind === 'hot' && compute.class === 'function') ||
|
|
172
|
+
(route.kind === 'serverless' && compute.class === 'dedicated')) {
|
|
173
|
+
check.issue(`${path}.config.compute.class`, 'Compute class conflicts with resolved route kind');
|
|
174
|
+
}
|
|
175
|
+
// The compiler preserves source config.kind, so serverless -> hot is a
|
|
176
|
+
// valid dedicated-placement normalization. Task semantics never change.
|
|
177
|
+
const sourceKind = route.config.kind;
|
|
178
|
+
if (typeof sourceKind === 'string' && routeKinds.includes(sourceKind) &&
|
|
179
|
+
((sourceKind === 'task') !== (route.kind === 'task') ||
|
|
180
|
+
(sourceKind === 'hot' && route.kind !== 'hot'))) {
|
|
181
|
+
check.issue(`${path}.config.kind`, 'Declared workload conflicts with resolved route kind');
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (route.hasWebsocket === true && route.kind !== 'hot')
|
|
185
|
+
check.issue(`${path}.hasWebsocket`, 'WebSocket routes require kind: hot');
|
|
186
|
+
});
|
|
187
|
+
check.array(value.pages, '$.pages', (page, path) => {
|
|
188
|
+
if (!check.object(page, path))
|
|
189
|
+
return;
|
|
190
|
+
check.relativePath(page.filePath, `${path}.filePath`);
|
|
191
|
+
check.url(page.urlPattern, `${path}.urlPattern`);
|
|
192
|
+
check.enum(page.mode, pageModes, `${path}.mode`);
|
|
193
|
+
check.boolean(page.hasLoader, `${path}.hasLoader`);
|
|
194
|
+
check.boolean(page.hasGetServerData, `${path}.hasGetServerData`);
|
|
195
|
+
check.optional(page, 'layout', path, (v, p) => check.relativePath(v, p));
|
|
196
|
+
check.optional(page, 'layouts', path, (v, p) => check.array(v, p, (item, itemPath) => check.relativePath(item, itemPath)));
|
|
197
|
+
check.config(page.config, `${path}.config`, 'page');
|
|
198
|
+
if (isObject(page.config) && own(page.config, 'mode') && page.config.mode !== page.mode) {
|
|
199
|
+
check.issue(`${path}.config.mode`, 'Declared page mode conflicts with resolved mode');
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
check.array(value.layouts, '$.layouts', (layout, path) => {
|
|
203
|
+
if (!check.object(layout, path))
|
|
204
|
+
return;
|
|
205
|
+
check.relativePath(layout.filePath, `${path}.filePath`);
|
|
206
|
+
check.relativePath(layout.dirPattern, `${path}.dirPattern`, true);
|
|
207
|
+
});
|
|
208
|
+
check.optional(value, 'middleware', '$', (v, p) => check.relativePath(v, p));
|
|
209
|
+
check.optional(value, 'actions', '$', (actions, path) => check.array(actions, path, (action, actionPath) => {
|
|
210
|
+
if (!check.object(action, actionPath))
|
|
211
|
+
return;
|
|
212
|
+
check.relativePath(action.filePath, `${actionPath}.filePath`);
|
|
213
|
+
check.relativePath(action.moduleId, `${actionPath}.moduleId`);
|
|
214
|
+
check.array(action.exports, `${actionPath}.exports`, (name, p) => { check.string(name, p); });
|
|
215
|
+
}));
|
|
216
|
+
if (check.string(value.timestamp, '$.timestamp') && !Number.isFinite(Date.parse(value.timestamp))) {
|
|
217
|
+
check.issue('$.timestamp', 'Expected a parseable date-time string');
|
|
218
|
+
}
|
|
219
|
+
if (versioned || own(value, 'requiredFeatures')) {
|
|
220
|
+
const seen = new Set();
|
|
221
|
+
check.array(value.requiredFeatures, '$.requiredFeatures', (feature, path) => {
|
|
222
|
+
if (typeof feature !== 'string' || !MANIFEST_FEATURES.some(known => known === feature)) {
|
|
223
|
+
check.issue(path, 'Unknown required feature', 'unknown_feature');
|
|
224
|
+
}
|
|
225
|
+
else if (seen.has(feature))
|
|
226
|
+
check.issue(path, 'Duplicate required feature');
|
|
227
|
+
else
|
|
228
|
+
seen.add(feature);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
if (check.issues.length > 0)
|
|
232
|
+
return { success: false, issues: check.issues };
|
|
233
|
+
// Every consumed field above was checked; the cast retains extension metadata.
|
|
234
|
+
const manifest = value;
|
|
235
|
+
if (versioned || own(value, 'requiredFeatures')) {
|
|
236
|
+
const declared = value.requiredFeatures;
|
|
237
|
+
for (const feature of deriveRequiredFeatures(manifest)) {
|
|
238
|
+
if (!declared.includes(feature))
|
|
239
|
+
check.issue('$.requiredFeatures', `Missing required feature: ${feature}`, 'missing_feature');
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return check.issues.length > 0 ? { success: false, issues: check.issues } : { success: true, manifest };
|
|
243
|
+
}
|
|
244
|
+
export function parseManifest(input, options = {}) {
|
|
245
|
+
const result = validateManifest(input, options);
|
|
246
|
+
if (!result.success)
|
|
247
|
+
throw new ManifestValidationError(result.issues);
|
|
248
|
+
return result.manifest;
|
|
249
|
+
}
|
|
250
|
+
/** Derive requirements from validated metadata, never from a provider name. */
|
|
251
|
+
export function deriveRequiredFeatures(manifest) {
|
|
252
|
+
const features = new Set();
|
|
253
|
+
if (manifest.api.length > 0)
|
|
254
|
+
features.add('api');
|
|
255
|
+
if (manifest.layouts.length > 0 || manifest.pages.some(page => page.layout || page.layouts?.length))
|
|
256
|
+
features.add('layouts');
|
|
257
|
+
if (manifest.actions?.length)
|
|
258
|
+
features.add('actions');
|
|
259
|
+
if (manifest.middleware)
|
|
260
|
+
features.add('middleware');
|
|
261
|
+
for (const route of manifest.api) {
|
|
262
|
+
if (route.kind === 'task')
|
|
263
|
+
features.add('tasks');
|
|
264
|
+
if (typeof route.config.schedule === 'string')
|
|
265
|
+
features.add('scheduled-tasks');
|
|
266
|
+
if (route.hasWebsocket)
|
|
267
|
+
features.add('websocket');
|
|
268
|
+
if (route.config.streaming === true)
|
|
269
|
+
features.add('streaming');
|
|
270
|
+
const compute = isObject(route.config.compute) ? route.config.compute : {};
|
|
271
|
+
const legacyDedicated = route.kind === 'hot' || route.config.hot === true ||
|
|
272
|
+
['runtime', 'placement', 'target'].some(key => route.config[key] === 'hot') ||
|
|
273
|
+
(isObject(route.config.machine) && Object.keys(route.config.machine).length > 0);
|
|
274
|
+
const dedicated = compute.class === 'dedicated' || (compute.class === undefined && legacyDedicated);
|
|
275
|
+
features.add(dedicated ? 'dedicated-compute' : 'function-compute');
|
|
276
|
+
}
|
|
277
|
+
for (const page of manifest.pages) {
|
|
278
|
+
const byMode = {
|
|
279
|
+
static: 'static-pages', server: 'server-pages', client: 'client-pages', hybrid: 'hybrid-pages',
|
|
280
|
+
};
|
|
281
|
+
features.add(byMode[page.mode]);
|
|
282
|
+
if (page.hasLoader)
|
|
283
|
+
features.add('loaders');
|
|
284
|
+
if (page.hasGetServerData)
|
|
285
|
+
features.add('legacy-server-data');
|
|
286
|
+
if (page.mode === 'server') {
|
|
287
|
+
if (page.config.streaming === true)
|
|
288
|
+
features.add('streaming');
|
|
289
|
+
else if (typeof page.config.revalidate === 'number' &&
|
|
290
|
+
(page.config.revalidate > 0 || (typeof page.config.swr === 'number' && page.config.swr > 0)))
|
|
291
|
+
features.add('isr');
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return MANIFEST_FEATURES.filter(feature => features.has(feature));
|
|
295
|
+
}
|
|
296
|
+
/** False means refuse this target, not silently degrade. Invalid manifests throw. */
|
|
297
|
+
export function evaluateCapabilities(manifest, target) {
|
|
298
|
+
parseManifest(manifest, { allowLegacy: true });
|
|
299
|
+
const declared = 'requiredFeatures' in manifest ? manifest.requiredFeatures : [];
|
|
300
|
+
const required = new Set([...deriveRequiredFeatures(manifest), ...declared]);
|
|
301
|
+
const requiredFeatures = MANIFEST_FEATURES.filter(feature => required.has(feature));
|
|
302
|
+
const unsupportedFeatures = requiredFeatures.filter(feature => !target.supportedFeatures.includes(feature));
|
|
303
|
+
return {
|
|
304
|
+
compatible: unsupportedFeatures.length === 0,
|
|
305
|
+
requiredFeatures,
|
|
306
|
+
unsupportedFeatures,
|
|
307
|
+
diagnostics: unsupportedFeatures.map(feature => ({
|
|
308
|
+
path: '$.requiredFeatures', code: 'unsupported_feature', message: `${target.name} does not support required feature: ${feature}`,
|
|
309
|
+
})),
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA8CA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAU,CAAC;AACzC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc;IACrE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,oBAAoB;IACnE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,iBAAiB;IAC3D,kBAAkB,EAAE,mBAAmB;CAC/B,CAAC;AASX,mFAAmF;AACnF,MAAM,UAAU,mBAAmB,CAAC,QAAwB;IAC1D,OAAO,eAAe,IAAI,QAAQ,IAAI,QAAQ,CAAC,aAAa,KAAK,cAAc,CAAC;AAClF,CAAC;AAYD,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACvC,MAAM,CAAkB;IACjC,YAAY,MAAuB;QACjC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACzE,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI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CAAC;AACpE,CAAC;AAaD,qFAAqF;AACrF,MAAM,UAAU,oBAAoB,CAAC,QAAwB,EAAE,MAA0B;IACvF,aAAa,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,kBAAkB,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,gBAAqC,CAAC,CAAC,CAAC,EAAE,CAAC;IACtG,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,sBAAsB,CAAC,QAAQ,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC;IAC7E,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACpF,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5G,OAAO;QACL,UAAU,EAAE,mBAAmB,CAAC,MAAM,KAAK,CAAC;QAC5C,gBAAgB;QAChB,mBAAmB;QACnB,WAAW,EAAE,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC/C,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,uCAAuC,OAAO,EAAE;SACjI,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@celsian/vura-contract",
|
|
3
|
+
"version": "0.8.2",
|
|
4
|
+
"description": "Dependency-free, versioned Vura manifest contract and capability negotiation",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/CelsianJs/vura.git"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/CelsianJs/vura#readme",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/CelsianJs/vura/issues"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=20 <23"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc -b"
|
|
37
|
+
}
|
|
38
|
+
}
|