@sjcx/vorma 0.0.0-pre.2 → 0.0.0-pre.4

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 (137) hide show
  1. package/dist/build/assemble-artifacts.d.ts +1 -1
  2. package/dist/build/bundle-client.d.ts +1 -1
  3. package/dist/build/cli.js +53 -44
  4. package/dist/build/compile-application.d.ts +2 -2
  5. package/dist/build/development-artifacts.d.ts +1 -1
  6. package/dist/build/development-build.d.ts +3 -6
  7. package/dist/build/development-server-process.d.ts +3 -3
  8. package/dist/build/development-work.d.ts +4 -3
  9. package/dist/build/generate-application.d.ts +4 -4
  10. package/dist/build/index.d.ts +2 -3
  11. package/dist/build/index.js +1 -1
  12. package/dist/build/inspect-projects.d.ts +3 -3
  13. package/dist/build/load-config.d.ts +17 -16
  14. package/dist/build/publish-artifacts.d.ts +1 -4
  15. package/dist/build/render-client-transport.d.ts +1 -1
  16. package/dist/build/render-server-generated.d.ts +1 -12
  17. package/dist/build/render-types.d.ts +1 -1
  18. package/dist/build/resolve-config.d.ts +6 -9
  19. package/dist/build/source-layout.d.ts +2 -2
  20. package/dist/build/typescript-projects.d.ts +5 -0
  21. package/dist/{build-DcP5_DUV.js → build-BeUTL6eX.js} +104 -301
  22. package/package.json +5 -36
  23. package/dist/build/compile-server.d.ts +0 -42
  24. package/dist/client/assembly.d.ts +0 -40
  25. package/dist/client/browser-http-client.d.ts +0 -10
  26. package/dist/client/client-loaders.d.ts +0 -93
  27. package/dist/client/commit.d.ts +0 -41
  28. package/dist/client/contracts.d.ts +0 -192
  29. package/dist/client/core.d.ts +0 -45
  30. package/dist/client/development.d.ts +0 -16
  31. package/dist/client/document-recovery.d.ts +0 -4
  32. package/dist/client/endpoints.d.ts +0 -54
  33. package/dist/client/errors.d.ts +0 -87
  34. package/dist/client/freshness.d.ts +0 -51
  35. package/dist/client/head.d.ts +0 -14
  36. package/dist/client/history.d.ts +0 -25
  37. package/dist/client/index.d.ts +0 -80
  38. package/dist/client/index.js +0 -150
  39. package/dist/client/links.d.ts +0 -48
  40. package/dist/client/materialize.d.ts +0 -21
  41. package/dist/client/modules.d.ts +0 -2
  42. package/dist/client/navigation.d.ts +0 -47
  43. package/dist/client/payload.d.ts +0 -54
  44. package/dist/client/prefetch.d.ts +0 -28
  45. package/dist/client/prepare.d.ts +0 -47
  46. package/dist/client/projections.d.ts +0 -26
  47. package/dist/client/queries.d.ts +0 -33
  48. package/dist/client/react/application.d.ts +0 -87
  49. package/dist/client/react/hooks.d.ts +0 -36
  50. package/dist/client/react/index.d.ts +0 -5
  51. package/dist/client/react/index.js +0 -3237
  52. package/dist/client/react/link.d.ts +0 -27
  53. package/dist/client/react/view.d.ts +0 -86
  54. package/dist/client/request.d.ts +0 -16
  55. package/dist/client/route-context.d.ts +0 -31
  56. package/dist/client/route-matching.d.ts +0 -22
  57. package/dist/client/route-synchronization.d.ts +0 -30
  58. package/dist/client/route-url.d.ts +0 -5
  59. package/dist/client/runtime.d.ts +0 -82
  60. package/dist/client/scroll.d.ts +0 -16
  61. package/dist/client/services.d.ts +0 -34
  62. package/dist/client/state.d.ts +0 -102
  63. package/dist/client/static-assets.d.ts +0 -3
  64. package/dist/client/stylesheets.d.ts +0 -7
  65. package/dist/client/transport-type-entries.d.ts +0 -2
  66. package/dist/client/types.d.ts +0 -152
  67. package/dist/client/view-definition.d.ts +0 -24
  68. package/dist/client/work-indicator.d.ts +0 -18
  69. package/dist/compile-Me8EOyMK.js +0 -870
  70. package/dist/development-B_rxuwY7.js +0 -128
  71. package/dist/hash-set-BPx3iXec.js +0 -141
  72. package/dist/href-Cqyax8Y0.js +0 -357
  73. package/dist/materialize-DZ7VSLFk.js +0 -739
  74. package/dist/metadata-BoPKo-G2.js +0 -32
  75. package/dist/primitives/tasks/index.d.ts +0 -1
  76. package/dist/primitives/tasks/index.js +0 -1
  77. package/dist/route-context-CtY_9U_W.js +0 -559
  78. package/dist/route-matching-D_uSG2P9.js +0 -33
  79. package/dist/search-parse-0f7oqVsG.js +0 -375
  80. package/dist/server/config/index.d.ts +0 -36
  81. package/dist/server/config/index.js +0 -30
  82. package/dist/server/development/metadata.d.ts +0 -11
  83. package/dist/server/document.d.ts +0 -37
  84. package/dist/server/form-data.d.ts +0 -21
  85. package/dist/server/graph/compile.d.ts +0 -118
  86. package/dist/server/graph/declarations.d.ts +0 -117
  87. package/dist/server/graph/literal-error-tag.d.ts +0 -14
  88. package/dist/server/graph/pattern-conflicts.d.ts +0 -36
  89. package/dist/server/graph/search-schema.d.ts +0 -13
  90. package/dist/server/graph/transport-schema.d.ts +0 -11
  91. package/dist/server/index.d.ts +0 -310
  92. package/dist/server/index.js +0 -2311
  93. package/dist/server/public-assets.d.ts +0 -18
  94. package/dist/server/runtime/application.d.ts +0 -15
  95. package/dist/server/runtime/assets.d.ts +0 -15
  96. package/dist/server/runtime/context.d.ts +0 -96
  97. package/dist/server/runtime/domain-errors.d.ts +0 -11
  98. package/dist/server/runtime/effects.d.ts +0 -83
  99. package/dist/server/runtime/execute.d.ts +0 -13
  100. package/dist/server/runtime/finalize.d.ts +0 -44
  101. package/dist/server/runtime/handler.d.ts +0 -106
  102. package/dist/server/runtime/head.d.ts +0 -22
  103. package/dist/server/runtime/payload.d.ts +0 -50
  104. package/dist/server/runtime/pipeline.d.ts +0 -27
  105. package/dist/server/runtime/plan.d.ts +0 -98
  106. package/dist/server/runtime/render-document.d.ts +0 -16
  107. package/dist/server/runtime/startup-error.d.ts +0 -11
  108. package/dist/server/runtime/transport-type-entries.d.ts +0 -2
  109. package/dist/server/runtime/vercel-deployment.d.ts +0 -2
  110. package/dist/server/url-pathname.d.ts +0 -13
  111. package/dist/static-assets-BrH3O0M8.js +0 -199
  112. package/dist/universal/generated-types.d.ts +0 -9
  113. package/dist/universal/href.d.ts +0 -17
  114. package/dist/universal/http-method.d.ts +0 -4
  115. package/dist/universal/json-transport.d.ts +0 -14
  116. package/dist/universal/null-prototype-record.d.ts +0 -7
  117. package/dist/universal/path-wire.d.ts +0 -71
  118. package/dist/universal/pattern-language.d.ts +0 -4
  119. package/dist/universal/protocol-schemas.d.ts +0 -99
  120. package/dist/universal/protocol.d.ts +0 -162
  121. package/dist/universal/search-grammar.d.ts +0 -7
  122. package/dist/universal/search-parse.d.ts +0 -22
  123. package/dist/universal/search-serialize.d.ts +0 -16
  124. package/dist/universal/search-shape.d.ts +0 -32
  125. package/dist/universal/static-assets.d.ts +0 -2
  126. package/dist/universal/transport-types/big-decimal.d.ts +0 -13
  127. package/dist/universal/transport-types/chunk.d.ts +0 -8
  128. package/dist/universal/transport-types/date-time-utc.d.ts +0 -13
  129. package/dist/universal/transport-types/date-time-zoned.d.ts +0 -13
  130. package/dist/universal/transport-types/duration.d.ts +0 -13
  131. package/dist/universal/transport-types/hash-map.d.ts +0 -8
  132. package/dist/universal/transport-types/hash-set.d.ts +0 -8
  133. package/dist/universal/transport-types/option.d.ts +0 -10
  134. package/dist/universal/transport-types/redacted.d.ts +0 -9
  135. package/dist/universal/value-transport.d.ts +0 -117
  136. package/dist/value-transport-Bst4Hk-n.js +0 -864
  137. /package/dist/{universal → build}/content-digest.d.ts +0 -0
@@ -1,18 +0,0 @@
1
- import { Effect } from "effect";
2
- import * as Path from "effect/Path";
3
- import type { PlatformError } from "effect/PlatformError";
4
- import * as HttpPlatform from "effect/unstable/http/HttpPlatform";
5
- import * as HttpServerRequest from "effect/unstable/http/HttpServerRequest";
6
- import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
7
- import type { Application } from "./index.ts";
8
- import { type VormaStartupError } from "./runtime/startup-error.ts";
9
- /**
10
- * Serves the build's public directory from the process filesystem. Requests for
11
- * URLs outside the published set, and every other method than `GET` and `HEAD`,
12
- * continue to the host's own router. The host passes its explicitly assembled
13
- * application so that this constructor can read the build metadata. The caller
14
- * explicitly registers the returned middleware through the host router.
15
- */
16
- export declare function makePublicAssetsFileMiddleware(input: {
17
- readonly app: Application;
18
- }): Effect.Effect<<E, R>(httpEffect: Effect.Effect<HttpServerResponse.HttpServerResponse, E, R>) => Effect.Effect<HttpServerResponse.HttpServerResponse, E | import("./development/metadata.ts").DevelopmentMetadataIssue | PlatformError | VormaStartupError, R | HttpServerRequest.HttpServerRequest>, VormaStartupError, HttpPlatform.HttpPlatform | Path.Path>;
@@ -1,15 +0,0 @@
1
- import { Context, Effect, Layer } from "effect";
2
- import { type ProductionMetadata } from "../../universal/protocol.ts";
3
- import type { VormaConfig } from "../config/index.ts";
4
- import type { DevelopmentMetadataIssue } from "../development/metadata.ts";
5
- import type { RegisterableDeclaration } from "../index.ts";
6
- import { type VormaStartupError } from "./startup-error.ts";
7
- export type CompiledApplication = {
8
- readonly registeredDeclarations: ReadonlyArray<RegisterableDeclaration>;
9
- readonly metadata: ProductionMetadata;
10
- readonly readDevelopmentMetadata?: Effect.Effect<ProductionMetadata, DevelopmentMetadataIssue>;
11
- };
12
- export declare const ApplicationRuntime: Context.Service<CompiledApplication, CompiledApplication>;
13
- export declare const APPLICATION_RUNTIME: unique symbol;
14
- /** One shared acquisition for an application's compiled registration and asset metadata. */
15
- export declare function makeApplicationRuntime(config: VormaConfig): Layer.Layer<CompiledApplication, VormaStartupError>;
@@ -1,15 +0,0 @@
1
- import type { ClientModule } from "../../universal/protocol.ts";
2
- /** Ordered, deduplicated asset URLs for a document and subsequent navigation. */
3
- export type PreparedAssets = {
4
- readonly navigationDepUrls: ReadonlyArray<string>;
5
- readonly navigationCssBundleUrls: ReadonlyArray<string>;
6
- readonly documentDepUrls: ReadonlyArray<string>;
7
- readonly documentCssBundleUrls: ReadonlyArray<string>;
8
- readonly navigationStaticAssetUrls: ReadonlyArray<string>;
9
- readonly documentStaticAssetUrls: ReadonlyArray<string>;
10
- };
11
- /** Combines static module metadata without running application code. */
12
- export declare function prepareAssets(input: {
13
- readonly clientEntry: ClientModule;
14
- readonly views: ReadonlyArray<ClientModule | null>;
15
- }): PreparedAssets;
@@ -1,96 +0,0 @@
1
- import { Effect, Ref } from "effect";
2
- import * as Cookies from "effect/unstable/http/Cookies";
3
- import type * as HttpServerRequest from "effect/unstable/http/HttpServerRequest";
4
- import type { ProductionMetadata } from "../../universal/protocol.ts";
5
- import type { Element } from "../document.ts";
6
- import type { RedirectStatus, ResponseEffects } from "./effects.ts";
7
- declare const ResponseInputError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
8
- readonly _tag: "ResponseInputError";
9
- } & Readonly<A>;
10
- export declare class ResponseInputError extends ResponseInputError_base<{
11
- readonly operation: "expireCookie" | "redirectToPattern";
12
- readonly message: string;
13
- readonly cause: unknown;
14
- }> {
15
- }
16
- type IncomingRequestFacts = {
17
- readonly request: HttpServerRequest.HttpServerRequest;
18
- /** The build the browser runtime is running, when the request came from it. */
19
- readonly clientBuildId: string | undefined;
20
- readonly getCookie: (name: string) => string | undefined;
21
- /** The hashed URL of a public asset by its source key. A leading slash is optional. */
22
- readonly getPublicUrl: (key: string) => string;
23
- };
24
- export type RequestFacts<Pattern extends string, Params, Input> = IncomingRequestFacts & {
25
- readonly pattern: Pattern;
26
- readonly params: Params;
27
- readonly splatValues: ReadonlyArray<string>;
28
- readonly input: Input;
29
- };
30
- export type MiddlewareRequestFacts = IncomingRequestFacts;
31
- export type ResponseOps = {
32
- readonly setStatus: (status: number) => Effect.Effect<void>;
33
- readonly setHeader: (options: {
34
- readonly name: string;
35
- readonly value: string;
36
- }) => Effect.Effect<void>;
37
- readonly appendHeader: (options: {
38
- readonly name: string;
39
- readonly value: string;
40
- }) => Effect.Effect<void>;
41
- readonly setCookie: (cookie: Cookies.Cookie) => Effect.Effect<void>;
42
- readonly expireCookie: (options: {
43
- readonly name: string;
44
- readonly path?: string;
45
- readonly domain?: string;
46
- }) => Effect.Effect<void, ResponseInputError>;
47
- /** Ends the response with a redirect to a URL. A request carrying the client-redirect acceptance header receives it as data; anything else gets the status. */
48
- readonly redirectToUrl: (options: {
49
- readonly url: string | URL;
50
- readonly status: RedirectStatus;
51
- }) => Effect.Effect<never>;
52
- /** Ends the response with a redirect to one of the application's own patterns. */
53
- readonly redirectToPattern: (options: {
54
- readonly pattern: string;
55
- readonly params?: Readonly<Record<string, string>>;
56
- readonly splatValues?: ReadonlyArray<string>;
57
- readonly input?: unknown;
58
- readonly hash?: string;
59
- readonly status: RedirectStatus;
60
- }) => Effect.Effect<never, ResponseInputError>;
61
- };
62
- export type HeadOps = {
63
- readonly setTitle: (title: string) => Effect.Effect<void>;
64
- readonly setDescription: (description: string) => Effect.Effect<void>;
65
- readonly addMeta: (attributes: Readonly<Record<string, string>>) => Effect.Effect<void>;
66
- /** Collects plain head elements for ordered response composition. */
67
- readonly addHead: (elements: ReadonlyArray<Element>) => Effect.Effect<void>;
68
- };
69
- export type RequestSource = {
70
- readonly request: HttpServerRequest.HttpServerRequest;
71
- readonly clientBuildId: string | undefined;
72
- readonly acceptsClientRedirect: boolean;
73
- readonly metadata: ProductionMetadata;
74
- };
75
- export declare function makeIncomingRequestFacts(source: RequestSource): IncomingRequestFacts;
76
- export declare function makeRequestFacts<Pattern extends string, Params, Input>(source: RequestSource, facts: {
77
- readonly pattern: Pattern;
78
- readonly params: Params;
79
- readonly splatValues: ReadonlyArray<string>;
80
- readonly input: Input;
81
- }): RequestFacts<Pattern, Params, Input>;
82
- /** A UI route target resolved against the plan: its authored pattern and its validated search record, if any. */
83
- export type ResolvedRouteTarget = {
84
- readonly pattern: string;
85
- readonly search: unknown;
86
- };
87
- export declare function makeResponseOps(input: {
88
- readonly effects: Ref.Ref<ResponseEffects>;
89
- readonly acceptsClientRedirect: boolean;
90
- readonly resolveRouteTargetFn: (options: {
91
- readonly pattern: string;
92
- readonly search: unknown;
93
- }) => Effect.Effect<ResolvedRouteTarget, unknown>;
94
- }): ResponseOps;
95
- export declare function makeHeadOps(effects: Ref.Ref<ResponseEffects>): HeadOps;
96
- export {};
@@ -1,11 +0,0 @@
1
- import { type TransportedValue } from "../../universal/value-transport.ts";
2
- import type { EndpointErrorDeclaration } from "../graph/declarations.ts";
3
- export type MatchedDeclaredError = {
4
- readonly tag: string;
5
- readonly status: number;
6
- readonly data: TransportedValue;
7
- };
8
- export declare function matchDeclaredError(input: {
9
- readonly errors: ReadonlyArray<EndpointErrorDeclaration>;
10
- readonly value: unknown;
11
- }): MatchedDeclaredError | undefined;
@@ -1,83 +0,0 @@
1
- import * as Cookies from "effect/unstable/http/Cookies";
2
- import type { RedirectStatus } from "../../universal/protocol-schemas.ts";
3
- import type { TransportedValue } from "../../universal/value-transport.ts";
4
- import type { Element } from "../document.ts";
5
- export type HeaderOp = {
6
- readonly kind: "set" | "append";
7
- readonly name: string;
8
- readonly value: string;
9
- };
10
- /** A cookie as Effect's HTTP layer represents it, already validated by `Cookies.makeCookie`. */
11
- export type Cookie = Cookies.Cookie;
12
- export type { RedirectStatus } from "../../universal/protocol-schemas.ts";
13
- export type Terminal = {
14
- readonly _tag: "Redirect";
15
- readonly location: string;
16
- readonly status: RedirectStatus;
17
- /** The client runtime asked to perform the redirect itself: 200 plus a header instead of a 3xx. */
18
- readonly client: boolean;
19
- } | {
20
- readonly _tag: "Error";
21
- readonly status: number;
22
- readonly text: string;
23
- /** A matched declared domain failure: its tag and its fields, transported by value. */
24
- readonly domain?: {
25
- readonly tag: string;
26
- readonly data: TransportedValue;
27
- } | undefined;
28
- };
29
- export type ResponseEffects = {
30
- readonly status: number | null;
31
- readonly terminal: Terminal | null;
32
- readonly headerOps: ReadonlyArray<HeaderOp>;
33
- readonly cookies: Cookies.Cookies;
34
- readonly headElements: ReadonlyArray<Element>;
35
- };
36
- export type TerminalResponseEffects = ResponseEffects & {
37
- readonly terminal: Terminal;
38
- };
39
- export declare const empty: ResponseEffects;
40
- /** Whether these effects end the response for everything after them. */
41
- export declare function endsResponse(effects: ResponseEffects): effects is TerminalResponseEffects;
42
- export declare function mergeResponseEffects(input: {
43
- readonly earlier: ResponseEffects;
44
- readonly later: ResponseEffects;
45
- }): ResponseEffects;
46
- export declare function setStatus(input: {
47
- readonly effects: ResponseEffects;
48
- readonly status: number;
49
- }): ResponseEffects;
50
- export declare function setHeader(input: {
51
- readonly effects: ResponseEffects;
52
- readonly name: string;
53
- readonly value: string;
54
- }): ResponseEffects;
55
- export declare function appendHeader(input: {
56
- readonly effects: ResponseEffects;
57
- readonly name: string;
58
- readonly value: string;
59
- }): ResponseEffects;
60
- export declare function setCookie(input: {
61
- readonly effects: ResponseEffects;
62
- readonly cookie: Cookie;
63
- }): ResponseEffects;
64
- export declare function appendHeadElements(input: {
65
- readonly effects: ResponseEffects;
66
- readonly elements: ReadonlyArray<Element>;
67
- }): ResponseEffects;
68
- export declare function setRedirect(input: {
69
- readonly effects: ResponseEffects;
70
- readonly location: string;
71
- readonly status: RedirectStatus;
72
- readonly client: boolean;
73
- }): ResponseEffects;
74
- /** Made by the execute program from a handler's error, never by a handler. */
75
- export declare function setTerminalError(input: {
76
- readonly effects: ResponseEffects;
77
- readonly status: number;
78
- readonly text: string;
79
- readonly domain?: {
80
- readonly tag: string;
81
- readonly data: TransportedValue;
82
- } | undefined;
83
- }): TerminalResponseEffects;
@@ -1,13 +0,0 @@
1
- import { Effect, type Scope } from "effect";
2
- import type { TransportedValue } from "../../universal/value-transport.ts";
3
- import * as Effects from "./effects.ts";
4
- import { type HandlerOutput, type Invocation, type TerminalOutcome, type UiExecutionInput, type UiExecutionReport, type UiRoute } from "./handler.ts";
5
- export declare function executeEndpoint<Services>(input: {
6
- readonly effects: Effects.ResponseEffects;
7
- readonly endpoint: Invocation<TransportedValue, Services>;
8
- }): Effect.Effect<HandlerOutput<TransportedValue>, never, Services | Scope.Scope>;
9
- export declare function executeUi<Services>(input: {
10
- readonly effects: Effects.ResponseEffects;
11
- readonly positions: ReadonlyArray<UiExecutionInput<Services>>;
12
- }): Effect.Effect<UiExecutionReport<UiRoute> | TerminalOutcome, never, Services | Scope.Scope>;
13
- export declare function executeMiddleware<Services>(invocations: ReadonlyArray<Invocation<void, Services>>): Effect.Effect<HandlerOutput<void>, never, Services | Scope.Scope>;
@@ -1,44 +0,0 @@
1
- import { Result } from "effect";
2
- import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
3
- import type { ResponseEffects } from "./effects.ts";
4
- export type FrameworkOwnedHeaderError = {
5
- readonly _tag: "FrameworkOwnedHeader";
6
- readonly name: string;
7
- };
8
- export type FinalizeError = FrameworkOwnedHeaderError;
9
- /** A navigation's JSON payload response with its application or conservative cache policy. */
10
- export declare function finalizeJson(input: {
11
- readonly json: string;
12
- readonly effects: ResponseEffects;
13
- readonly clientBuildId: string;
14
- }): Result.Result<HttpServerResponse.HttpServerResponse, FinalizeError>;
15
- /** A first load's HTML response with its application or conservative cache policy. */
16
- export declare function finalizeHtml(input: {
17
- readonly html: string;
18
- readonly effects: ResponseEffects;
19
- readonly clientBuildId: string;
20
- }): Result.Result<HttpServerResponse.HttpServerResponse, FinalizeError>;
21
- /** An endpoint's JSON response. No cache-control is assumed for endpoints. */
22
- export declare function finalizeEndpointJson(input: {
23
- readonly json: string;
24
- readonly effects: ResponseEffects;
25
- readonly clientBuildId: string;
26
- }): Result.Result<HttpServerResponse.HttpServerResponse, FinalizeError>;
27
- /** An endpoint redirect, or its structured public handler rejection. */
28
- export declare function finalizeEndpointTerminal(input: {
29
- readonly effects: ResponseEffects;
30
- readonly clientBuildId: string;
31
- }): Result.Result<HttpServerResponse.HttpServerResponse, FinalizeError>;
32
- /** A response that ended before any body was produced: a redirect or an error. */
33
- export declare function finalizeTerminal(input: {
34
- readonly effects: ResponseEffects;
35
- readonly clientBuildId: string;
36
- }): Result.Result<HttpServerResponse.HttpServerResponse, FinalizeError>;
37
- /** The answer to a client whose build does not match the server's. */
38
- export declare function finalizeBuildSkew(clientBuildId: string): HttpServerResponse.HttpServerResponse;
39
- /** A plain-text response for a Vorma protocol or execution failure. */
40
- export declare function finalizeStatus(input: {
41
- readonly status: number;
42
- readonly text: string;
43
- readonly clientBuildId: string;
44
- }): HttpServerResponse.HttpServerResponse;
@@ -1,106 +0,0 @@
1
- import { Cause, Effect, type Result } from "effect";
2
- import type { TransportedValue } from "../../universal/value-transport.ts";
3
- import type { ResponseEffects, TerminalResponseEffects } from "./effects.ts";
4
- import type { UiPosition } from "./plan.ts";
5
- export type HandlerRole = "middleware" | "uiLoader" | "endpoint";
6
- declare const HandlerError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
7
- readonly _tag: "HandlerError";
8
- } & Readonly<A>;
9
- /**
10
- * How any handler fails on purpose. In a UI loader: the response carries the
11
- * status and public message without the failed route's metadata or module.
12
- * An available ancestor boundary or the application boundary renders the error.
13
- * In an endpoint or
14
- * task middleware: the response is the status and the message. `cause` never
15
- * leaves the server.
16
- */
17
- export declare class HandlerError extends HandlerError_base<{
18
- readonly status: number;
19
- readonly clientMessage?: string;
20
- readonly cause?: unknown;
21
- }> {
22
- }
23
- /**
24
- * A declared domain failure on its way to the wire. A `HandlerError` with
25
- * the encoded domain payload beside it, so the execute program keeps its
26
- * single error channel while the response keeps the tag and data a generic
27
- * rejection cannot carry. Constructed only by the endpoint runner after it
28
- * matched the thrown value against the declaration's error schemas.
29
- */
30
- export declare class DeclaredDomainError extends HandlerError {
31
- readonly tag: string;
32
- readonly data: TransportedValue;
33
- constructor(input: {
34
- readonly status: number;
35
- readonly clientMessage?: string;
36
- readonly tag: string;
37
- readonly data: TransportedValue;
38
- });
39
- }
40
- /** The public message for a status the application did not explain. */
41
- export declare function getStatusText(status: number): string;
42
- /** Ends a handler without exposing private control flow in its error channel. */
43
- export declare const interruptHandler: Effect.Effect<never>;
44
- export declare function matchesHandlerEndInterruption(cause: Cause.Cause<unknown>): boolean;
45
- export type TerminalOutcome = {
46
- readonly _tag: "Terminal";
47
- readonly effects: TerminalResponseEffects;
48
- };
49
- export type HandlerOutput<Value> = {
50
- readonly _tag: "Continue";
51
- readonly effects: ResponseEffects;
52
- readonly data: Value;
53
- } | TerminalOutcome;
54
- export type Invocation<Value, Services> = {
55
- readonly id: string;
56
- readonly role: HandlerRole;
57
- readonly pattern: string;
58
- readonly run: Effect.Effect<InvocationOutcome<Value>, unknown, Services>;
59
- };
60
- /** A failure stops later invocations but retains this invocation's recorded response operations. */
61
- export type InvocationOutcome<Value> = HandlerOutput<Value> | {
62
- readonly _tag: "Failed";
63
- readonly effects: ResponseEffects;
64
- readonly cause: Cause.Cause<unknown>;
65
- };
66
- /** A matched position and its parsed search; parsing failure belongs to its loader. */
67
- export type UiRoute = {
68
- readonly position: UiPosition;
69
- readonly searchInput: Result.Result<unknown, HandlerError> | null;
70
- };
71
- export type UiExecutionInput<Services> = {
72
- readonly owner: UiRoute;
73
- readonly invocation: Invocation<TransportedValue, Services> | null;
74
- };
75
- /** A successful position retains its original owner and required data. */
76
- export type CompletedPosition<Owner, Value> = {
77
- readonly _tag: "NoHandler";
78
- readonly owner: Owner;
79
- } | {
80
- readonly _tag: "Completed";
81
- readonly owner: Owner;
82
- readonly data: Value;
83
- };
84
- export type UiExecutionPosition<Owner> = CompletedPosition<Owner, TransportedValue> | {
85
- readonly _tag: "Failed";
86
- readonly owner: Owner;
87
- readonly error: ServerError;
88
- } | {
89
- readonly _tag: "Suppressed";
90
- readonly owner: Owner;
91
- };
92
- export type UiExecutionReport<Owner> = {
93
- readonly _tag: "Ui";
94
- readonly effects: ResponseEffects;
95
- readonly positions: ReadonlyArray<UiExecutionPosition<Owner>>;
96
- };
97
- /** A UI loader failed; the page still renders, from this segment's error boundary down. */
98
- export type ServerError = {
99
- readonly id: string;
100
- readonly pattern: string;
101
- /** Index into the complete matched UI chain, outermost first. */
102
- readonly index: number;
103
- readonly status: number;
104
- readonly clientMessage: string;
105
- };
106
- export {};
@@ -1,22 +0,0 @@
1
- import type { Element } from "../document.ts";
2
- import type { HeadDeduplicationRule } from "../graph/declarations.ts";
3
- /** The built-in identities. An element matches a rule when its tag matches and every listed attribute matches; `true` means present with any value. */
4
- export declare const defaultDedupeRules: ReadonlyArray<HeadDeduplicationRule>;
5
- export type PreparedHead = {
6
- readonly title: Element | null;
7
- readonly meta: ReadonlyArray<Element>;
8
- readonly rest: ReadonlyArray<Element>;
9
- };
10
- type CompiledHeadRule = {
11
- readonly index: number;
12
- readonly attributes: ReadonlyArray<readonly [string, string | true]>;
13
- };
14
- export type CompiledHeadRules = ReadonlyMap<string, ReadonlyArray<CompiledHeadRule>>;
15
- /** Normalizes the application's static rules once, preserving priority within each tag. */
16
- export declare function compileHeadRules(rules: ReadonlyArray<HeadDeduplicationRule>): CompiledHeadRules;
17
- /** Deduplicates managed defaults and ordered contributions before classification. */
18
- export declare function prepareHead(input: {
19
- readonly elements: ReadonlyArray<Element>;
20
- readonly rules: CompiledHeadRules;
21
- }): PreparedHead;
22
- export {};
@@ -1,50 +0,0 @@
1
- import { Result } from "effect";
2
- import type { HeadElementWire, NavigationPayload, RoutePayloadWire, SsrPayload } from "../../universal/protocol-schemas.ts";
3
- import type { ClientModule } from "../../universal/protocol.ts";
4
- import type { TransportedValue } from "../../universal/value-transport.ts";
5
- import { type Element, type RenderError } from "../document.ts";
6
- import { type PreparedAssets } from "./assets.ts";
7
- import type { UiExecutionReport } from "./handler.ts";
8
- import { type PreparedHead, type CompiledHeadRules } from "./head.ts";
9
- import type { UiPosition } from "./plan.ts";
10
- export type HeadRenderError = {
11
- readonly _tag: "HeadRender";
12
- readonly tag: string;
13
- readonly reason: RenderError;
14
- };
15
- /** One matched position and the search its loader read; null when the route has no search contract or the parse failed, which the report records as that position's error. */
16
- export type UiRouteInput = {
17
- readonly position: UiPosition;
18
- readonly searchInput: TransportedValue | null;
19
- };
20
- export type PayloadProjection = {
21
- readonly route: RoutePayloadWire;
22
- readonly preparedHead: PreparedHead;
23
- } & PreparedAssets;
24
- export declare function projectPayload(input: {
25
- readonly clientEntry: ClientModule;
26
- readonly assets: PreparedAssets;
27
- readonly report: UiExecutionReport<UiRouteInput>;
28
- /** The document's authored head elements, the overridable defaults. */
29
- readonly headDefaults: ReadonlyArray<Element>;
30
- readonly dedupeRules: CompiledHeadRules;
31
- }): PayloadProjection;
32
- export declare function toNavigationPayload(projection: PayloadProjection): Result.Result<NavigationPayload, HeadRenderError>;
33
- export declare function toSsrPayload(input: {
34
- readonly projection: PayloadProjection;
35
- readonly clientBuildId: string;
36
- readonly isDev: boolean;
37
- readonly deploymentId: string | undefined;
38
- }): SsrPayload;
39
- /** The deduped head for a response, with later contributions replacing the first position of each identity. */
40
- export declare function prepareHeadOf(input: {
41
- readonly report: UiExecutionReport<UiRouteInput>;
42
- readonly headDefaults: ReadonlyArray<Element>;
43
- readonly dedupeRules: CompiledHeadRules;
44
- }): PreparedHead;
45
- /**
46
- * A head element on the wire: raw attribute values, which the client sets
47
- * through the DOM, and escaped text or trusted HTML, which the client sets
48
- * as inner HTML. The initial document uses the same serialization.
49
- */
50
- export declare function toWireHeadElement(element: Element): Result.Result<HeadElementWire, HeadRenderError>;
@@ -1,27 +0,0 @@
1
- import { TaskContext, TaskRuntime } from "@vorma/primitives/tasks";
2
- import { Context, Effect, Layer, type Scope } from "effect";
3
- import type * as FileSystem from "effect/FileSystem";
4
- import type * as Path from "effect/Path";
5
- import { HttpServerError, type Multipart } from "effect/unstable/http";
6
- import * as HttpServerRequest from "effect/unstable/http/HttpServerRequest";
7
- import type * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
8
- import { type ProductionMetadata } from "../../universal/protocol.ts";
9
- import { type Plan, type RequestOperation } from "./plan.ts";
10
- export type ServiceKind = "document" | "uiLoaders" | "queries" | "mutations" | "streams" | "middleware";
11
- /** The services the host built for the document and each handler kind. */
12
- export type KindServices = Readonly<Record<ServiceKind, Context.Context<never>>>;
13
- export type PipelineInput = {
14
- readonly plan: Plan;
15
- readonly operation: RequestOperation;
16
- readonly metadata: ProductionMetadata;
17
- readonly request: HttpServerRequest.HttpServerRequest;
18
- readonly services: KindServices;
19
- readonly isDev: boolean;
20
- readonly deploymentId?: string;
21
- };
22
- export declare function handleRequest<RequestServices = never, RequestError = never, RequestRequirements = never>(input: PipelineInput & {
23
- readonly requestServices?: Layer.Layer<RequestServices, RequestError, RequestRequirements>;
24
- }): Effect.Effect<HttpServerResponse.HttpServerResponse, BodyError | HttpServerError.HttpServerError | RequestError, BodyServices | TaskContext | TaskRuntime | RequestRequirements | Scope.Scope>;
25
- type BodyServices = FileSystem.FileSystem | Path.Path | Scope.Scope;
26
- type BodyError = HttpServerError.HttpServerError | Multipart.MultipartError;
27
- export {};
@@ -1,98 +0,0 @@
1
- import { type CompiledNestedPattern, type FlatMatcher, type FlatValueMatcher, type NestedValueMatcher, type PatternCompileError } from "@vorma/primitives/matcher";
2
- import { Result } from "effect";
3
- import { type PathWireError } from "../../universal/path-wire.ts";
4
- import type { ClientModule, ClientViewModule } from "../../universal/protocol.ts";
5
- import { type EndpointNode, type GraphError, type MiddlewareNode, type UiLoaderNode, type UiSearchOwner } from "../graph/compile.ts";
6
- import type { HtmlDocumentDeclaration, HttpMethod, EndpointDeclaration, TaskMiddlewareDeclaration, UiLoaderDeclaration } from "../graph/declarations.ts";
7
- import { type PreparedAssets } from "./assets.ts";
8
- import { type CompiledHeadRules } from "./head.ts";
9
- export type MiddlewareEntry = {
10
- readonly node: MiddlewareNode;
11
- readonly matcher: FlatMatcher;
12
- };
13
- export type UiNode = {
14
- /** The logical authored identity exposed to application and browser code. */
15
- readonly pattern: string;
16
- readonly registered: CompiledNestedPattern;
17
- readonly uiLoader: UiLoaderNode | null;
18
- readonly searchOwners: ReadonlyArray<UiSearchOwner>;
19
- readonly clientViewModule: ClientViewModule | null;
20
- };
21
- /** One matched UI position: its node and the captures its own pattern names. */
22
- export type UiPosition = {
23
- readonly node: UiNode;
24
- /** The parameters this position's pattern names, decoded. */
25
- readonly params: Readonly<Record<string, string>>;
26
- /** The segments this position's splat captured, decoded; empty without one. */
27
- readonly splatValues: ReadonlyArray<string>;
28
- };
29
- export type Plan = {
30
- readonly clientEntry: ClientModule;
31
- /** Contains structural preparation only, never request execution or results. */
32
- readonly preparedRequests: Map<string, Result.Result<RequestPreparation, PathWireError>>;
33
- readonly document: HtmlDocumentDeclaration;
34
- /** The built-in head identities followed by the document's own, in authored order. */
35
- readonly headDeduplicationRules: CompiledHeadRules;
36
- readonly uiMatcher: NestedValueMatcher<UiNode>;
37
- /** UI positions by authored identity, for application-authored targets. */
38
- readonly uiByAuthoredPattern: ReadonlyMap<string, UiNode>;
39
- readonly endpoints: ReadonlyMap<HttpMethod, FlatValueMatcher<EndpointNode>>;
40
- readonly middleware: ReadonlyArray<MiddlewareEntry>;
41
- };
42
- export type PlanError = {
43
- readonly _tag: "PlanError";
44
- readonly cause: PatternCompileError | PathWireError;
45
- };
46
- /** Compiles application declarations and server-side view metadata into request matchers. */
47
- export declare function compileRequestPlan(input: {
48
- readonly clientEntry: ClientModule;
49
- readonly document: HtmlDocumentDeclaration;
50
- readonly handlers: ReadonlyArray<UiLoaderDeclaration | EndpointDeclaration>;
51
- readonly middleware: ReadonlyArray<TaskMiddlewareDeclaration>;
52
- readonly clientViews: Readonly<Record<string, ClientViewModule>>;
53
- }): Result.Result<Plan, PlanError | ReadonlyArray<GraphError>>;
54
- /** The application selects the operation when mounting its native handler. */
55
- export type RequestOperation = {
56
- readonly _tag: "Ui";
57
- } | {
58
- readonly _tag: "Endpoint";
59
- readonly method: HttpMethod;
60
- };
61
- export type Target = {
62
- readonly _tag: "Endpoint";
63
- readonly node: EndpointNode;
64
- readonly params: Readonly<Record<string, string>>;
65
- readonly splatValues: ReadonlyArray<string>;
66
- } | {
67
- readonly _tag: "Ui";
68
- /** Outermost to innermost. */
69
- readonly positions: ReadonlyArray<UiPosition>;
70
- readonly assets: PreparedAssets;
71
- } | {
72
- readonly _tag: "NotFound";
73
- };
74
- export type RequestPreparation = {
75
- readonly target: Target;
76
- readonly middleware: ReadonlyArray<MiddlewareNode>;
77
- };
78
- /** Bounds retained pathname preparation across every operation in one plan. */
79
- export declare const REQUEST_PREPARATION_CAPACITY = 4096;
80
- /** Reuses only operation/pathname-derived data within this compiled application. */
81
- export declare function getRequestPreparation(input: {
82
- readonly plan: Plan;
83
- readonly operation: RequestOperation;
84
- /** Canonical matcher-wire pathname, without a query string. */
85
- readonly path: string;
86
- }): Result.Result<RequestPreparation, PathWireError>;
87
- export declare function classifyRequest(input: {
88
- readonly plan: Plan;
89
- readonly operation: RequestOperation;
90
- /** Canonical matcher-wire pathname. */
91
- readonly path: string;
92
- }): Result.Result<Target, PathWireError>;
93
- /** Selects task middleware for the mounted operation, in declaration order. */
94
- export declare function getMiddlewareFor(input: {
95
- readonly plan: Plan;
96
- readonly method: string;
97
- readonly path: string;
98
- }): ReadonlyArray<MiddlewareNode>;
@@ -1,16 +0,0 @@
1
- import { Result } from "effect";
2
- import { type RenderError } from "../document.ts";
3
- import type { DocumentAttributes } from "../graph/declarations.ts";
4
- import type { PreparedHead } from "./head.ts";
5
- /** Serializes the fixed document structure after head deduplication and classification. */
6
- export declare function renderDocument(input: {
7
- readonly attributes: DocumentAttributes;
8
- readonly prepared: PreparedHead;
9
- readonly criticalCss: string;
10
- readonly developmentHeadHtml?: string;
11
- readonly cssBundleUrls: ReadonlyArray<string>;
12
- readonly modulePreloadUrls: ReadonlyArray<string>;
13
- readonly staticAssetUrls: ReadonlyArray<string>;
14
- readonly entryImportUrl: string;
15
- readonly payloadJson: string;
16
- }): Result.Result<string, RenderError>;
@@ -1,11 +0,0 @@
1
- export type VormaStartupError = {
2
- readonly _tag: "VormaStartupError";
3
- readonly operation: "loadApplicationRuntime" | "resolvePublicAssetDirectory" | "resolvePublicAssetFile" | "readDeploymentConfiguration" | "validateApplicationGraph" | "buildRequestPlan";
4
- readonly message: string;
5
- readonly cause?: unknown;
6
- };
7
- export declare function createVormaStartupError(input: {
8
- readonly operation: VormaStartupError["operation"];
9
- readonly message: string;
10
- readonly cause?: unknown;
11
- }): VormaStartupError;
@@ -1,2 +0,0 @@
1
- import type { TransportTypeEntry } from "../../universal/value-transport.ts";
2
- export declare const SERVER_TRANSPORT_TYPE_ENTRIES: ReadonlyArray<TransportTypeEntry>;
@@ -1,2 +0,0 @@
1
- import { Config, Effect } from "effect";
2
- export declare const getVercelDeploymentId: Effect.Effect<string | undefined, Config.ConfigError, never>;