@camstack/types 1.2.310 → 1.2.311

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.
@@ -8,44 +8,48 @@
8
8
  * and knows its tunnel and mesh names — every input the automatic answer
9
9
  * needs. A variable that restated it could only drift from it.
10
10
  *
11
- * ## Roles
11
+ * ## Roles (D734)
12
12
  *
13
13
  * An address — a DETECTED endpoint or an operator-entered CUSTOM address —
14
14
  * carries role flags, the same way for both:
15
15
  *
16
- * - `viewer` (many) — what the apps race and connect to. Automatic: every
17
- * LAN IPv4 address plus the public tunnel.
18
- * - `notifications` (one) — where notification taps and links point.
19
- * Automatic: the CamStack app link (D709).
20
- * - `agents` (one) — what agents and LAN devices pull from (addon bundles,
21
- * models, a camera relay's broker host). Automatic: a LAN IPv4 literal,
22
- * then any plausible LAN address, then the mesh. Never a public tunnel: it
23
- * is a detour off the LAN for traffic that never left it.
24
- * - `signIn` (one) — sign-in links, OIDC callbacks, the passkey relying
25
- * party, OAuth2's hub URL. Automatic: the public tunnel, then the mesh, then
26
- * the LAN.
16
+ * - `appConnections` (many) — what the CamStack apps try when connecting.
17
+ * Automatic: every LAN IPv4 address plus the public tunnel.
18
+ * - `notificationTaps` (one) — ONLY where tapping a notification opens.
19
+ * Automatic: the CamStack app link (D709); a hub address may be flagged.
20
+ * - `publicEndpoint` (one) — every URL that must work from OUTSIDE the home
21
+ * network: sign-in links, OIDC / OAuth2 callbacks, the passkey relying
22
+ * party, account linking, and the notification centre's action buttons,
23
+ * attachment / media links and admin links. Automatic: the public tunnel,
24
+ * then the mesh, then the LAN. Never the app link.
25
+ * - `internal` (one) — what agents and LAN devices download from (addon
26
+ * bundles, models, a camera relay's broker host, Home Assistant media).
27
+ * Automatic: a LAN IPv4 literal, then any plausible LAN address, then the
28
+ * mesh. Never a public tunnel: it is a detour off the LAN for traffic that
29
+ * never left it.
27
30
  *
28
31
  * A single-valued role is stored as ONE URL, so "at most one address carries
29
32
  * it" holds by construction, not by a check. A flag wins outright; no flag is
30
33
  * automatic. Automatic picks only among DETECTED endpoints — a custom address
31
34
  * serves exactly the roles it is flagged with. Loopback and the app link are
32
- * never an agents or sign-in answer: loopback names whoever dials it, and the
33
- * app link is not a hub address. `null` means nothing qualifies — the caller
34
- * must say so rather than substitute `127.0.0.1`.
35
+ * never an internal or public-endpoint answer: loopback names whoever dials
36
+ * it, and the app link is not a hub address. `null` means nothing qualifies —
37
+ * the caller must say so rather than substitute `127.0.0.1`.
35
38
  */
36
- import type { ConnectionEndpoint } from './local-network.cap.js';
37
- export declare const HUB_ADDRESS_ROLES: readonly ["viewer", "notifications", "agents", "signIn"];
38
- export type HubAddressRole = (typeof HUB_ADDRESS_ROLES)[number];
39
+ import type { z } from 'zod';
40
+ import type { ConnectionEndpoint, HubAddressRoleSchema } from './local-network.cap.js';
41
+ export declare const HUB_ADDRESS_ROLES: readonly ["appConnections", "notificationTaps", "internal", "publicEndpoint"];
42
+ export type HubAddressRole = z.infer<typeof HubAddressRoleSchema>;
39
43
  /** The roles at most one address carries. */
40
- export type SingleHubAddressRole = Exclude<HubAddressRole, 'viewer'>;
44
+ export type SingleHubAddressRole = Exclude<HubAddressRole, 'appConnections'>;
41
45
  export declare const SINGLE_HUB_ADDRESS_ROLES: readonly SingleHubAddressRole[];
42
46
  export declare function isSingleHubAddressRole(role: HubAddressRole): role is SingleHubAddressRole;
43
47
  /** The operator's role flags, as stored. `null` / `[]` = automatic. */
44
48
  export interface HubAddressFlags {
45
- readonly viewer: readonly string[];
46
- readonly notifications: string | null;
47
- readonly agents: string | null;
48
- readonly signIn: string | null;
49
+ readonly appConnections: readonly string[];
50
+ readonly notificationTaps: string | null;
51
+ readonly internal: string | null;
52
+ readonly publicEndpoint: string | null;
49
53
  }
50
54
  export declare const AUTOMATIC_HUB_ADDRESS_FLAGS: HubAddressFlags;
51
55
  export type HubAddressCheck = {
@@ -61,14 +65,14 @@ export type HubAddressCheck = {
61
65
  * Answers the normalised origin (`scheme://host[:port]`).
62
66
  */
63
67
  export declare function validateCustomAddress(raw: string): HubAddressCheck;
64
- /** The reason a plain-http sign-in address is refused unless accepted. */
65
- export declare const SIGN_IN_HTTP_REASON = "Sign-in needs an https:// address: passkeys and most identity providers refuse a plain-http origin. Accept http only for a sign-in that never leaves your own network.";
68
+ /** The reason a plain-http public endpoint is refused unless accepted. */
69
+ export declare const PUBLIC_ENDPOINT_HTTP_REASON = "The public endpoint needs an https:// address: passkeys and most identity providers refuse a plain-http origin. Accept http only when sign-in and notification links never leave your own network.";
66
70
  /**
67
71
  * May `baseUrl` carry `role`? The address check above, plus two role rules:
68
- * the app link carries `notifications` only (it is not a hub address), and a
69
- * plain-http address carries `signIn` only when the operator explicitly
70
- * accepted it (`acceptInsecureHttp`) — a LAN-only password or magic-link
71
- * sign-in works over http, a passkey or an OIDC callback does not.
72
+ * the app link carries `notificationTaps` only (it is not a hub address), and
73
+ * a plain-http address carries `publicEndpoint` only when the operator
74
+ * explicitly accepted it (`acceptInsecureHttp`) — a LAN-only password or
75
+ * magic-link sign-in works over http, a passkey or an OIDC callback does not.
72
76
  */
73
77
  export declare function checkRoleAddress(role: HubAddressRole, baseUrl: string, options?: {
74
78
  readonly acceptInsecureHttp?: boolean;
@@ -82,42 +86,47 @@ export interface HubAddressRoleResolution {
82
86
  readonly resolved: string | null;
83
87
  readonly source: HubAddressSource;
84
88
  }
85
- export interface HubViewerResolution {
86
- /** The addresses flagged `viewer`, or empty for automatic. */
89
+ export interface HubAppConnectionsResolution {
90
+ /** The addresses flagged `appConnections`, or empty for automatic. */
87
91
  readonly flagged: readonly string[];
88
92
  /** What the apps race right now (may be empty when nothing is up). */
89
93
  readonly resolved: readonly string[];
90
94
  readonly source: HubAddressSource;
91
95
  }
92
- /** `agents`: what agents and LAN devices pull from. */
93
- export declare function resolveAgentsAddress(endpoints: readonly ConnectionEndpoint[], flags: HubAddressFlags): HubAddressRoleResolution;
94
- /** `signIn`: sign-in links, OIDC callbacks, the relying party, OAuth2. */
95
- export declare function resolveSignInAddress(endpoints: readonly ConnectionEndpoint[], flags: HubAddressFlags): HubAddressRoleResolution;
96
- /** `notifications`: the flagged address, else the CamStack app link (D709). */
97
- export declare function resolveNotificationsAddress(flags: HubAddressFlags): HubAddressRoleResolution;
98
- /** AUTO viewer race: LAN IPv4 + the public tunnel. Never IPv6, mesh, loopback or custom. */
99
- export declare function isDefaultViewerEndpoint(endpoint: ConnectionEndpoint): boolean;
96
+ /** `internal`: what agents and LAN devices download from. */
97
+ export declare function resolveInternalAddress(endpoints: readonly ConnectionEndpoint[], flags: HubAddressFlags): HubAddressRoleResolution;
98
+ /**
99
+ * `publicEndpoint`: every URL that must work off the LAN — sign-in links, OIDC
100
+ * / OAuth2 callbacks, the relying party, and notification buttons,
101
+ * attachments, media and admin links.
102
+ */
103
+ export declare function resolvePublicEndpoint(endpoints: readonly ConnectionEndpoint[], flags: HubAddressFlags): HubAddressRoleResolution;
104
+ /** `notificationTaps`: the flagged address, else the CamStack app link (D709). */
105
+ export declare function resolveNotificationTapAddress(flags: HubAddressFlags): HubAddressRoleResolution;
106
+ /** AUTO app connections: LAN IPv4 + the public tunnel. Never IPv6, mesh, loopback or custom. */
107
+ export declare function isDefaultAppConnectionEndpoint(endpoint: ConnectionEndpoint): boolean;
100
108
  /**
101
109
  * The endpoints the apps race: the flagged ones that are in `endpoints`
102
- * (which carries the custom addresses flagged `viewer`), else AUTO. A flagged
110
+ * (which carries the custom addresses flagged `appConnections`), else AUTO. A flagged
103
111
  * set none of which is currently up falls back to AUTO rather than racing
104
112
  * nothing.
105
113
  */
106
- export declare function selectViewerEndpoints(endpoints: readonly ConnectionEndpoint[], flags: HubAddressFlags): ConnectionEndpoint[];
107
- /** `viewer`: what the apps race and connect to. */
108
- export declare function resolveViewerAddresses(endpoints: readonly ConnectionEndpoint[], flags: HubAddressFlags): HubViewerResolution;
114
+ export declare function selectAppConnectionEndpoints(endpoints: readonly ConnectionEndpoint[], flags: HubAddressFlags): ConnectionEndpoint[];
115
+ /** `appConnections`: what the apps try when connecting. */
116
+ export declare function resolveAppConnections(endpoints: readonly ConnectionEndpoint[], flags: HubAddressFlags): HubAppConnectionsResolution;
109
117
  /** Every role's answer. */
110
118
  export interface HubAddressRoles {
111
- readonly viewer: HubViewerResolution;
112
- readonly notifications: HubAddressRoleResolution;
113
- readonly agents: HubAddressRoleResolution;
114
- readonly signIn: HubAddressRoleResolution;
119
+ readonly appConnections: HubAppConnectionsResolution;
120
+ readonly notificationTaps: HubAddressRoleResolution;
121
+ readonly internal: HubAddressRoleResolution;
122
+ readonly publicEndpoint: HubAddressRoleResolution;
115
123
  }
116
124
  /**
117
- * Every role at once, each through its own resolver. `viewerPalette` is what
118
- * the apps race (it carries the custom addresses flagged `viewer`);
119
- * `hubPalette` is the detected HTTPS palette agents and sign-in resolve over.
125
+ * Every role at once, each through its own resolver. `appPalette` is what
126
+ * the apps race (it carries the custom addresses flagged `appConnections`);
127
+ * `hubPalette` is the detected HTTPS palette `internal` and `publicEndpoint`
128
+ * resolve over.
120
129
  */
121
- export declare function resolveHubAddressRoles(viewerPalette: readonly ConnectionEndpoint[], hubPalette: readonly ConnectionEndpoint[], flags: HubAddressFlags): HubAddressRoles;
130
+ export declare function resolveHubAddressRoles(appPalette: readonly ConnectionEndpoint[], hubPalette: readonly ConnectionEndpoint[], flags: HubAddressFlags): HubAddressRoles;
122
131
  /** The bare hostname of a base URL, or `null` when it does not parse. */
123
132
  export declare function hubAddressHostname(baseUrl: string | null): string | null;
@@ -64,7 +64,7 @@ export { EMBEDDING_MODEL_FAILED, EMBEDDING_REQUIREMENTS_FAILED, EMBEDDING_REQUIR
64
64
  export type { FailureContribution, IFailureContributionProvider, } from './failure-contribution.cap.js';
65
65
  export { FailureContributionSchema, FailureReasonCountSchema, failureContributionCapability, } from './failure-contribution.cap.js';
66
66
  export { filesystemBrowseCapability, type IFilesystemBrowseProvider, } from './filesystem-browse.cap.js';
67
- export { AUTOMATIC_HUB_ADDRESS_FLAGS, checkRoleAddress, HUB_ADDRESS_ROLES, type HubAddressCheck, type HubAddressFlags, type HubAddressRole, type HubAddressRoleResolution, type HubAddressRoles, type HubAddressSource, type HubViewerResolution, hubAddressHostname, isDefaultViewerEndpoint, isSingleHubAddressRole, resolveAgentsAddress, resolveHubAddressRoles, resolveNotificationsAddress, resolveSignInAddress, resolveViewerAddresses, SIGN_IN_HTTP_REASON, SINGLE_HUB_ADDRESS_ROLES, type SingleHubAddressRole, selectViewerEndpoints, validateCustomAddress, } from './hub-address.js';
67
+ export { AUTOMATIC_HUB_ADDRESS_FLAGS, checkRoleAddress, HUB_ADDRESS_ROLES, type HubAddressCheck, type HubAddressFlags, type HubAddressRole, type HubAddressRoleResolution, type HubAddressRoles, type HubAddressSource, type HubAppConnectionsResolution, hubAddressHostname, isDefaultAppConnectionEndpoint, isSingleHubAddressRole, PUBLIC_ENDPOINT_HTTP_REASON, resolveAppConnections, resolveHubAddressRoles, resolveInternalAddress, resolveNotificationTapAddress, resolvePublicEndpoint, SINGLE_HUB_ADDRESS_ROLES, type SingleHubAddressRole, selectAppConnectionEndpoints, validateCustomAddress, } from './hub-address.js';
68
68
  export { type HfModelResolution, HfModelResolutionSchema, type ILlmProvider, type LlmDefault, LlmDefaultSchema, type LlmDefaultSelector, LlmDefaultSelectorSchema, type LlmProfile, type LlmProfileKind, type LlmProfileKindDescriptor, LlmProfileKindDescriptorSchema, LlmProfileKindSchema, LlmProfileSchema, type LlmRuntimeNode, LlmRuntimeNodeSchema, type LlmUsageRollup, LlmUsageRollupSchema, llmCapability, type ManagedModelCatalogEntry, ManagedModelCatalogEntrySchema, } from './llm.cap.js';
69
69
  export { type AppleFmAvailability, AppleFmAvailabilitySchema, type AppleFmUnavailableReason, AppleFmUnavailableReasonSchema, type ILlmRuntimeProvider, type LlmDownloadProgress, LlmDownloadProgressSchema, type LlmNodeModel, LlmNodeModelSchema, type LlmRuntimeAppleCompleteInput, LlmRuntimeAppleCompleteInputSchema, type LlmRuntimeCancelInput, LlmRuntimeCancelInputSchema, type LlmRuntimeCompleteInput, LlmRuntimeCompleteInputSchema, type LlmRuntimeDiskUsage, LlmRuntimeDiskUsageSchema, type LlmRuntimeStatus, LlmRuntimeStatusSchema, llmRuntimeCapability, type ManagedModelExtraFile, ManagedModelExtraFileSchema, type ManagedModelRef, ManagedModelRefSchema, type ManagedRuntimeConfig, ManagedRuntimeConfigSchema, } from './llm-runtime.cap.js';
70
70
  export { type LlmErrorCode, LlmErrorCodeSchema, type LlmGenerateBaseInput, LlmGenerateBaseInputSchema, type LlmGenerateErr, LlmGenerateErrSchema, type LlmGenerateOk, LlmGenerateOkSchema, type LlmGenerateResult, LlmGenerateResultSchema, type LlmImage, LlmImageSchema, type LlmRefusalSource, LlmRefusalSourceSchema, type LlmRetryPolicy, LlmRetryPolicySchema, LlmTimeoutDefaults, type LlmUsage, LlmUsageSchema, } from './llm-shared.js';