apps 0.0.1-beta.17 → 0.0.1-beta.18

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.
@@ -7,6 +7,24 @@ export declare const UiContext: Schema.Struct<{
7
7
  readonly profile: Schema.optional<Schema.NonEmptyString>;
8
8
  readonly expectedProfileRevision: Schema.optional<Schema.Int>;
9
9
  }>;
10
+ /** A problem with one of the page profile's accounts, from stored state. Labels are the owner's own names. */
11
+ export type UiAccountProblem = {
12
+ readonly provider: string;
13
+ readonly reason: "missing" | "removed" | "incompatible";
14
+ } | {
15
+ readonly provider: string;
16
+ readonly account: string;
17
+ readonly reason: "credentials_rejected" | "forbidden" | "upstream_unavailable" | "check_failed";
18
+ };
19
+ /** Account problems found when the page opened, with dashboard links that resolve them. */
20
+ export interface UiAccountNotice {
21
+ readonly app: string;
22
+ readonly problems: readonly UiAccountProblem[];
23
+ /** The profile's accounts in the dashboard. */
24
+ readonly fix: string;
25
+ /** The dashboard chooser, returning to this page. */
26
+ readonly choose: string;
27
+ }
10
28
  /** Retained browser bytes. Hosts authorize access before reading or rendering them. */
11
29
  export interface AppUiAsset {
12
30
  readonly body: Uint8Array;
@@ -0,0 +1,9 @@
1
+ /** Host-rendered account notices; no authored app code or provider responses enter them. */
2
+ import type { UiAccountNotice, UiAccountProblem } from "../contracts/ui.js";
3
+ /** Missing, removed, incompatible, or rejected accounts stop the app; other failed checks are advisory. */
4
+ export declare const accountProblemBlocks: (problem: UiAccountProblem) => boolean;
5
+ export declare const accountProblemText: (problem: UiAccountProblem) => string;
6
+ /** Full page shown instead of the app while an account problem stops it from working. */
7
+ export declare const accountBlockedPage: (notice: UiAccountNotice) => string;
8
+ /** Inline card for advisory problems; the app still loads underneath. */
9
+ export declare const accountNoticeBootstrap: (notice: UiAccountNotice) => string;
@@ -1,12 +1,16 @@
1
1
  import { Effect } from "effect";
2
2
  import { HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
3
- import { UiForbidden, type AppUiAsset } from "../contracts/ui.js";
4
- /** Render an authorized deployment with a host-owned deployment watcher. */
3
+ import { UiForbidden, type AppUiAsset, type UiAccountNotice } from "../contracts/ui.js";
4
+ /**
5
+ * Render an authorized deployment with a host-owned deployment watcher. Account problems that stop
6
+ * the app replace its document with a page that links to their fix; others add a dismissible card.
7
+ */
5
8
  export declare const appDocument: <E, R>(options: {
6
9
  readonly deployment: string;
7
10
  readonly profile?: string | undefined;
8
11
  readonly expectedProfileRevision?: number | undefined;
9
12
  readonly origin: string;
13
+ readonly accounts?: UiAccountNotice | undefined;
10
14
  readonly asset: (path: string) => Effect.Effect<AppUiAsset | undefined, E, R>;
11
15
  }) => Effect.Effect<HttpServerResponse.HttpServerResponse, UiForbidden | E, HttpServerRequest.HttpServerRequest | R>;
12
16
  /** Serve an asset only after the host has checked current access and file existence.