@feltdb/feltkit 0.3.17 → 0.3.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.
Files changed (107) hide show
  1. package/dist/app.d.ts +195 -5
  2. package/dist/app.js +150 -3
  3. package/dist/app.js.map +1 -1
  4. package/dist/appboundry/build.d.ts +45 -0
  5. package/dist/appboundry/build.js +52 -1
  6. package/dist/appboundry/build.js.map +1 -1
  7. package/dist/appboundry/guest.js +39 -1
  8. package/dist/appboundry/guest.js.map +1 -1
  9. package/dist/appboundry/host.js +4 -0
  10. package/dist/appboundry/host.js.map +1 -1
  11. package/dist/authorize.js +1 -0
  12. package/dist/authorize.js.map +1 -1
  13. package/dist/cli/deploy-appboundry-self-hosted.d.ts +2 -0
  14. package/dist/cli/deploy-appboundry-self-hosted.js +1 -1
  15. package/dist/cli/deploy-appboundry-self-hosted.js.map +1 -1
  16. package/dist/cli/deploy-appboundry.js +3 -0
  17. package/dist/cli/deploy-appboundry.js.map +1 -1
  18. package/dist/cli/main.js +6 -1
  19. package/dist/cli/main.js.map +1 -1
  20. package/dist/client/index.d.ts +192 -5
  21. package/dist/client/index.js +301 -28
  22. package/dist/client/index.js.map +1 -1
  23. package/dist/docs.d.ts +1 -1
  24. package/dist/docs.js +1 -0
  25. package/dist/docs.js.map +1 -1
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.js.map +1 -1
  28. package/dist/react/auth.d.ts +131 -0
  29. package/dist/react/auth.js +830 -0
  30. package/dist/react/auth.js.map +1 -0
  31. package/dist/react/context.d.ts +8 -0
  32. package/dist/react/context.js +14 -0
  33. package/dist/react/context.js.map +1 -0
  34. package/dist/react/index.d.ts +3 -18
  35. package/dist/react/index.js +5 -13
  36. package/dist/react/index.js.map +1 -1
  37. package/dist/runtime/accounts.d.ts +33 -2
  38. package/dist/runtime/accounts.js +167 -27
  39. package/dist/runtime/accounts.js.map +1 -1
  40. package/dist/runtime/authority.d.ts +8 -1
  41. package/dist/runtime/authority.js +11 -2
  42. package/dist/runtime/authority.js.map +1 -1
  43. package/dist/runtime/challenges.d.ts +51 -0
  44. package/dist/runtime/challenges.js +121 -0
  45. package/dist/runtime/challenges.js.map +1 -0
  46. package/dist/runtime/changes.d.ts +22 -0
  47. package/dist/runtime/changes.js +51 -3
  48. package/dist/runtime/changes.js.map +1 -1
  49. package/dist/runtime/context.d.ts +41 -0
  50. package/dist/runtime/contract.js +14 -3
  51. package/dist/runtime/contract.js.map +1 -1
  52. package/dist/runtime/data.d.ts +36 -2
  53. package/dist/runtime/data.js +56 -17
  54. package/dist/runtime/data.js.map +1 -1
  55. package/dist/runtime/live.d.ts +48 -0
  56. package/dist/runtime/live.js +154 -0
  57. package/dist/runtime/live.js.map +1 -0
  58. package/dist/runtime/outbox.js +3 -0
  59. package/dist/runtime/outbox.js.map +1 -1
  60. package/dist/runtime/runtime.d.ts +70 -5
  61. package/dist/runtime/runtime.js +290 -35
  62. package/dist/runtime/runtime.js.map +1 -1
  63. package/dist/runtime/search.d.ts +54 -0
  64. package/dist/runtime/search.js +66 -0
  65. package/dist/runtime/search.js.map +1 -0
  66. package/dist/runtime/sessions.d.ts +16 -2
  67. package/dist/runtime/sessions.js +40 -4
  68. package/dist/runtime/sessions.js.map +1 -1
  69. package/dist/runtime/tenancy.d.ts +189 -0
  70. package/dist/runtime/tenancy.js +376 -0
  71. package/dist/runtime/tenancy.js.map +1 -0
  72. package/dist/runtime/tenant-scope.d.ts +9 -0
  73. package/dist/runtime/tenant-scope.js +127 -0
  74. package/dist/runtime/tenant-scope.js.map +1 -0
  75. package/dist/runtime/transactions.d.ts +45 -2
  76. package/dist/runtime/transactions.js +36 -9
  77. package/dist/runtime/transactions.js.map +1 -1
  78. package/dist/server/index.d.ts +2 -1
  79. package/dist/server/index.js +300 -58
  80. package/dist/server/index.js.map +1 -1
  81. package/dist/server/mcp.js +6 -3
  82. package/dist/server/mcp.js.map +1 -1
  83. package/dist/server/session-http.d.ts +48 -0
  84. package/dist/server/session-http.js +116 -0
  85. package/dist/server/session-http.js.map +1 -0
  86. package/dist/server/tenancy.d.ts +40 -0
  87. package/dist/server/tenancy.js +191 -0
  88. package/dist/server/tenancy.js.map +1 -0
  89. package/dist/testing/index.d.ts +7 -0
  90. package/dist/testing/index.js +7 -2
  91. package/dist/testing/index.js.map +1 -1
  92. package/docs/AGENT-OPERATIONS.md +1 -0
  93. package/docs/APPBOUNDRY.md +11 -1
  94. package/docs/ARCHITECTURE.md +4 -2
  95. package/docs/AUTH.md +262 -0
  96. package/docs/GUARANTEES.md +50 -3
  97. package/docs/README.md +3 -2
  98. package/docs/SECURITY.md +3 -2
  99. package/docs/TRANSACTIONS.md +98 -1
  100. package/docs/UPSTREAM-GAPS.md +2 -0
  101. package/package.json +11 -10
  102. package/skills/.claude-plugin/marketplace.json +1 -1
  103. package/skills/.claude-plugin/plugin.json +1 -1
  104. package/skills/feltkit-data/SKILL.md +6 -0
  105. package/dist/runtime/account-links.d.ts +0 -19
  106. package/dist/runtime/account-links.js +0 -45
  107. package/dist/runtime/account-links.js.map +0 -1
@@ -0,0 +1,131 @@
1
+ import type { AuthRedirect, SessionInfo, TenantInfo, TenantsInfo } from "../client/index.js";
2
+ /** Turn the built-in stylesheet off (render it once near the root): every class stays, unstyled. */
3
+ export declare function FeltKitAuthStyles({ disabled }: {
4
+ disabled?: boolean;
5
+ }): null;
6
+ /**
7
+ * What a link into the app carried (sign-in link, verification, reset, invitation, provider sign-in),
8
+ * read once per page load and shared by every component. An invitation is kept for this tab until it
9
+ * is accepted or dismissed, so signing in first does not lose it.
10
+ */
11
+ export declare function useAuthRedirect(): {
12
+ redirect: AuthRedirect | null;
13
+ pending: boolean;
14
+ clear(): void;
15
+ };
16
+ export interface UseAuth {
17
+ /** True until the first answer from the server. */
18
+ loading: boolean;
19
+ /** The signed-in principal, or null. */
20
+ user: NonNullable<SessionInfo["principal"]> | null;
21
+ /** The signed-in account (built-in accounts), or null. */
22
+ account: NonNullable<SessionInfo["account"]> | null;
23
+ /** The tenant this session works in (`auth.tenant`), or null. */
24
+ tenant: TenantInfo | null;
25
+ permissions: string[];
26
+ /** What the app offers: sign-up, password, magic link, providers, e-mail (`session.accounts`). */
27
+ settings: SessionInfo["accounts"] | null;
28
+ tenancy: SessionInfo["tenancy"] | null;
29
+ session: SessionInfo | undefined;
30
+ /** Whether the user holds a permission (e.g. to show an admin screen; the server checks again). */
31
+ can(permission: string): boolean;
32
+ signOut(): Promise<void>;
33
+ refresh(): void;
34
+ }
35
+ /** The current session: who is signed in, their account and tenant, and what the app offers. */
36
+ export declare function useAuth(): UseAuth;
37
+ export interface UseTenant {
38
+ loading: boolean;
39
+ error: string | null;
40
+ /** The tenant this session works in, or null. */
41
+ current: TenantInfo | null;
42
+ /** Your tenants, most recently used first. */
43
+ tenants: TenantsInfo["tenants"];
44
+ settings: TenantsInfo["settings"] | null;
45
+ /** Switch (the server checks your membership; every live query re-runs). */
46
+ switchTo(tenantId: string | null): Promise<void>;
47
+ create(name: string): Promise<void>;
48
+ refresh(): void;
49
+ }
50
+ /** Your tenants and the current one (`auth.tenant`). */
51
+ export declare function useTenant(): UseTenant;
52
+ export interface SignInProps {
53
+ /** Shown above the form: your app's name and logo. */
54
+ brand?: {
55
+ name?: string;
56
+ logo?: string;
57
+ };
58
+ title?: string;
59
+ /** Where a provider sign-in returns to. Only a path on this site is used. Default: the current path. */
60
+ returnTo?: string;
61
+ /** Called once signed in. */
62
+ onSignedIn?(): void;
63
+ /** Start on sign-up instead of sign-in. */
64
+ initialMode?: "sign-in" | "sign-up";
65
+ /** Prefill the address (an invitation for it, say). */
66
+ email?: string;
67
+ className?: string;
68
+ /** Leave out the card frame (for embedding in your own layout). */
69
+ bare?: boolean;
70
+ }
71
+ /** A safe return path: a path on this site, never another origin. */
72
+ export declare function safeReturnPath(value: string | undefined | null, fallback?: string): string;
73
+ /**
74
+ * Sign in or create an account: password, e-mailed link (and code), Google / GitHub / OpenID Connect,
75
+ * forgot password, and the screens links back into the app need (reset, verification result,
76
+ * expired or used links). Offers only what the app enables.
77
+ */
78
+ export declare function SignIn(props: SignInProps): import("react/jsx-runtime").JSX.Element;
79
+ /** Shows what a link opened while signed in did (address verified or changed, a link that failed). */
80
+ export declare function AuthNotices({ className }: {
81
+ className?: string;
82
+ }): import("react/jsx-runtime").JSX.Element | null;
83
+ /** A reminder to verify the account's address, with a button to send the link again. */
84
+ export declare function VerifyEmailBanner({ className }: {
85
+ className?: string;
86
+ }): import("react/jsx-runtime").JSX.Element | null;
87
+ /**
88
+ * Accept an invitation: the one in the link that opened the app (kept for this tab until used), or
89
+ * `token`. Shows what it is for; asks the person to sign in (as the invited address) first when
90
+ * needed; handles expired, withdrawn, used and wrong-account invitations. Renders nothing when there
91
+ * is no invitation.
92
+ */
93
+ export declare function AcceptInvitation(props: {
94
+ token?: string;
95
+ onAccepted?(tenant: TenantInfo | null): void;
96
+ onDismiss?(): void;
97
+ brand?: SignInProps["brand"];
98
+ className?: string;
99
+ }): import("react/jsx-runtime").JSX.Element | null;
100
+ /**
101
+ * The current workspace, and a menu to switch to another or create one. Keyboard: Enter/Space opens,
102
+ * arrows move, Escape closes. Switching re-checks your membership on the server and re-runs every query.
103
+ */
104
+ export declare function TenantSwitcher(props: {
105
+ className?: string;
106
+ onSwitched?(tenant: TenantInfo | null): void;
107
+ allowCreate?: boolean;
108
+ }): import("react/jsx-runtime").JSX.Element | null;
109
+ /** For a person with no workspace yet: create one (or wait for an invitation). */
110
+ export declare function CreateTenant(props: {
111
+ className?: string;
112
+ title?: string;
113
+ onCreated?(): void;
114
+ }): import("react/jsx-runtime").JSX.Element;
115
+ /** Members of the current workspace: roles (for those who may manage), removal, and leaving. */
116
+ export declare function MembersPanel(props: {
117
+ className?: string;
118
+ }): import("react/jsx-runtime").JSX.Element | null;
119
+ /** Invite people to the current workspace by e-mail; see, copy and withdraw open invitations. */
120
+ export declare function InvitationsPanel(props: {
121
+ className?: string;
122
+ }): import("react/jsx-runtime").JSX.Element | null;
123
+ /** Workspace settings: its name (for roles with tenant.update), members, invitations. */
124
+ export declare function TenantSettings(props: {
125
+ className?: string;
126
+ }): import("react/jsx-runtime").JSX.Element | null;
127
+ /** Profile, address, password, connected providers, active sessions, sign out. */
128
+ export declare function AccountSettings(props: {
129
+ className?: string;
130
+ onSignedOut?(): void;
131
+ }): import("react/jsx-runtime").JSX.Element | null;