@hanzo/rooms 0.1.0

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 (235) hide show
  1. package/LICENSE-APACHE +205 -0
  2. package/LICENSE-MIT +21 -0
  3. package/README.md +23 -0
  4. package/dist/Account.d.ts +8 -0
  5. package/dist/Account.js +58 -0
  6. package/dist/Beluga.d.ts +12 -0
  7. package/dist/Beluga.js +152 -0
  8. package/dist/Billing.d.ts +1 -0
  9. package/dist/Billing.js +31 -0
  10. package/dist/Board.d.ts +9 -0
  11. package/dist/Board.js +447 -0
  12. package/dist/Boxes.d.ts +1 -0
  13. package/dist/Boxes.js +173 -0
  14. package/dist/CalScheduler.d.ts +15 -0
  15. package/dist/CalScheduler.js +196 -0
  16. package/dist/Chat.d.ts +35 -0
  17. package/dist/Chat.js +1049 -0
  18. package/dist/Column.d.ts +15 -0
  19. package/dist/Column.js +88 -0
  20. package/dist/Contacts.d.ts +1 -0
  21. package/dist/Contacts.js +301 -0
  22. package/dist/Directory.d.ts +24 -0
  23. package/dist/Directory.js +356 -0
  24. package/dist/Drive.d.ts +2 -0
  25. package/dist/Drive.js +466 -0
  26. package/dist/Find.d.ts +7 -0
  27. package/dist/Find.js +82 -0
  28. package/dist/Guide.d.ts +6 -0
  29. package/dist/Guide.js +272 -0
  30. package/dist/Home.d.ts +39 -0
  31. package/dist/Home.js +306 -0
  32. package/dist/Inbox.d.ts +9 -0
  33. package/dist/Inbox.js +193 -0
  34. package/dist/Market.d.ts +3 -0
  35. package/dist/Market.js +149 -0
  36. package/dist/Me.d.ts +27 -0
  37. package/dist/Me.js +251 -0
  38. package/dist/Meet.d.ts +9 -0
  39. package/dist/Meet.js +370 -0
  40. package/dist/ModeMark.d.ts +8 -0
  41. package/dist/ModeMark.js +18 -0
  42. package/dist/OrgSwitcher.d.ts +31 -0
  43. package/dist/OrgSwitcher.js +120 -0
  44. package/dist/Orgs.d.ts +10 -0
  45. package/dist/Orgs.js +582 -0
  46. package/dist/Profile.d.ts +4 -0
  47. package/dist/Profile.js +67 -0
  48. package/dist/Prose.d.ts +5 -0
  49. package/dist/Prose.js +111 -0
  50. package/dist/ProviderMark.d.ts +17 -0
  51. package/dist/ProviderMark.js +277 -0
  52. package/dist/Recents.d.ts +10 -0
  53. package/dist/Recents.js +91 -0
  54. package/dist/RightPane.d.ts +13 -0
  55. package/dist/RightPane.js +426 -0
  56. package/dist/Room.d.ts +8 -0
  57. package/dist/Room.js +50 -0
  58. package/dist/Scene.d.ts +12 -0
  59. package/dist/Scene.js +105 -0
  60. package/dist/Settings.d.ts +46 -0
  61. package/dist/Settings.js +321 -0
  62. package/dist/Setup.d.ts +1 -0
  63. package/dist/Setup.js +36 -0
  64. package/dist/Share.d.ts +3 -0
  65. package/dist/Share.js +130 -0
  66. package/dist/Shared.d.ts +1 -0
  67. package/dist/Shared.js +113 -0
  68. package/dist/Shell.d.ts +63 -0
  69. package/dist/Shell.js +1225 -0
  70. package/dist/Start.d.ts +1 -0
  71. package/dist/Start.js +96 -0
  72. package/dist/Support.d.ts +14 -0
  73. package/dist/Support.js +122 -0
  74. package/dist/Talk.d.ts +4 -0
  75. package/dist/Talk.js +107 -0
  76. package/dist/Upgrade.d.ts +11 -0
  77. package/dist/Upgrade.js +75 -0
  78. package/dist/Usage.d.ts +1 -0
  79. package/dist/Usage.js +21 -0
  80. package/dist/Vibe.d.ts +2 -0
  81. package/dist/Vibe.js +188 -0
  82. package/dist/Work.d.ts +12 -0
  83. package/dist/Work.js +256 -0
  84. package/dist/bots/Bots.d.ts +2 -0
  85. package/dist/bots/Bots.js +456 -0
  86. package/dist/bots/Lights.d.ts +8 -0
  87. package/dist/bots/Lights.js +13 -0
  88. package/dist/bots/api.d.ts +120 -0
  89. package/dist/bots/api.js +75 -0
  90. package/dist/bots/face.d.ts +5 -0
  91. package/dist/bots/face.js +13 -0
  92. package/dist/bots/ink.d.ts +7 -0
  93. package/dist/bots/ink.js +29 -0
  94. package/dist/bots/kit.d.ts +113 -0
  95. package/dist/bots/kit.js +43 -0
  96. package/dist/bots/runtime.d.ts +4 -0
  97. package/dist/bots/runtime.js +326 -0
  98. package/dist/card.d.ts +52 -0
  99. package/dist/card.js +52 -0
  100. package/dist/cast.d.ts +143 -0
  101. package/dist/cast.js +251 -0
  102. package/dist/connect.d.ts +29 -0
  103. package/dist/connect.js +64 -0
  104. package/dist/contacts-store.d.ts +111 -0
  105. package/dist/contacts-store.js +276 -0
  106. package/dist/conversations.d.ts +54 -0
  107. package/dist/conversations.js +98 -0
  108. package/dist/copy.d.ts +23 -0
  109. package/dist/copy.js +39 -0
  110. package/dist/crew.d.ts +36 -0
  111. package/dist/crew.js +304 -0
  112. package/dist/dev.d.ts +3 -0
  113. package/dist/dev.js +102 -0
  114. package/dist/enso.d.ts +70 -0
  115. package/dist/enso.js +112 -0
  116. package/dist/failure.d.ts +57 -0
  117. package/dist/failure.js +143 -0
  118. package/dist/ground.d.ts +32 -0
  119. package/dist/ground.js +32 -0
  120. package/dist/host.d.ts +76 -0
  121. package/dist/host.js +76 -0
  122. package/dist/index.d.ts +14 -0
  123. package/dist/index.js +12 -0
  124. package/dist/kept.d.ts +5 -0
  125. package/dist/kept.js +27 -0
  126. package/dist/lib/account.d.ts +49 -0
  127. package/dist/lib/account.js +229 -0
  128. package/dist/lib/ai.d.ts +46 -0
  129. package/dist/lib/ai.js +140 -0
  130. package/dist/lib/api.d.ts +43 -0
  131. package/dist/lib/api.js +62 -0
  132. package/dist/lib/bare.d.ts +9 -0
  133. package/dist/lib/bare.js +7 -0
  134. package/dist/lib/coding.d.ts +105 -0
  135. package/dist/lib/coding.js +87 -0
  136. package/dist/lib/destination.d.ts +102 -0
  137. package/dist/lib/destination.js +260 -0
  138. package/dist/lib/durable.d.ts +66 -0
  139. package/dist/lib/durable.js +107 -0
  140. package/dist/lib/first.d.ts +11 -0
  141. package/dist/lib/first.js +23 -0
  142. package/dist/lib/home.d.ts +61 -0
  143. package/dist/lib/home.js +54 -0
  144. package/dist/lib/host.d.ts +104 -0
  145. package/dist/lib/host.js +132 -0
  146. package/dist/lib/hostname.d.ts +1 -0
  147. package/dist/lib/hostname.js +14 -0
  148. package/dist/lib/hydrated.d.ts +1 -0
  149. package/dist/lib/hydrated.js +20 -0
  150. package/dist/lib/integrations.d.ts +21 -0
  151. package/dist/lib/integrations.js +1 -0
  152. package/dist/lib/intent.d.ts +6 -0
  153. package/dist/lib/intent.js +71 -0
  154. package/dist/lib/invite.d.ts +155 -0
  155. package/dist/lib/invite.js +245 -0
  156. package/dist/lib/limits.d.ts +55 -0
  157. package/dist/lib/limits.js +119 -0
  158. package/dist/lib/list.d.ts +9 -0
  159. package/dist/lib/list.js +11 -0
  160. package/dist/lib/mark.d.ts +13 -0
  161. package/dist/lib/mark.js +85 -0
  162. package/dist/lib/mix.d.ts +22 -0
  163. package/dist/lib/mix.js +22 -0
  164. package/dist/lib/models.d.ts +27 -0
  165. package/dist/lib/models.js +106 -0
  166. package/dist/lib/org.d.ts +109 -0
  167. package/dist/lib/org.js +140 -0
  168. package/dist/lib/path.d.ts +9 -0
  169. package/dist/lib/path.js +29 -0
  170. package/dist/lib/plans.d.ts +193 -0
  171. package/dist/lib/plans.js +310 -0
  172. package/dist/lib/prose.d.ts +13 -0
  173. package/dist/lib/prose.js +62 -0
  174. package/dist/lib/reach.d.ts +17 -0
  175. package/dist/lib/reach.js +70 -0
  176. package/dist/lib/rooms.json +23 -0
  177. package/dist/lib/served.d.ts +20 -0
  178. package/dist/lib/served.js +92 -0
  179. package/dist/lib/session.d.ts +211 -0
  180. package/dist/lib/session.js +493 -0
  181. package/dist/lib/share.d.ts +131 -0
  182. package/dist/lib/share.js +216 -0
  183. package/dist/lib/signout.d.ts +14 -0
  184. package/dist/lib/signout.js +40 -0
  185. package/dist/lib/tags.d.ts +27 -0
  186. package/dist/lib/tags.js +46 -0
  187. package/dist/lib/tap.d.ts +17 -0
  188. package/dist/lib/tap.js +9 -0
  189. package/dist/lib/tier.d.ts +115 -0
  190. package/dist/lib/tier.js +207 -0
  191. package/dist/lib/tiers.d.ts +9 -0
  192. package/dist/lib/tiers.js +141 -0
  193. package/dist/lib/todo.d.ts +125 -0
  194. package/dist/lib/todo.js +379 -0
  195. package/dist/look.d.ts +1 -0
  196. package/dist/look.js +21 -0
  197. package/dist/meters.d.ts +8 -0
  198. package/dist/meters.js +31 -0
  199. package/dist/model.d.ts +4 -0
  200. package/dist/model.js +44 -0
  201. package/dist/network.d.ts +64 -0
  202. package/dist/network.js +216 -0
  203. package/dist/open.d.ts +81 -0
  204. package/dist/open.js +149 -0
  205. package/dist/pane.d.ts +92 -0
  206. package/dist/pane.js +231 -0
  207. package/dist/progress.d.ts +46 -0
  208. package/dist/progress.js +51 -0
  209. package/dist/recent.d.ts +67 -0
  210. package/dist/recent.js +161 -0
  211. package/dist/rooms.d.ts +131 -0
  212. package/dist/rooms.js +195 -0
  213. package/dist/roster.d.ts +28 -0
  214. package/dist/roster.js +70 -0
  215. package/dist/span.d.ts +14 -0
  216. package/dist/span.js +50 -0
  217. package/dist/speech.d.ts +44 -0
  218. package/dist/speech.js +229 -0
  219. package/dist/stars.d.ts +16 -0
  220. package/dist/stars.js +75 -0
  221. package/dist/tabs.d.ts +26 -0
  222. package/dist/tabs.js +25 -0
  223. package/dist/team.d.ts +11 -0
  224. package/dist/team.gen.d.ts +10 -0
  225. package/dist/team.gen.js +11 -0
  226. package/dist/team.js +30 -0
  227. package/dist/tools.d.ts +35 -0
  228. package/dist/tools.js +143 -0
  229. package/dist/tours.d.ts +24 -0
  230. package/dist/tours.js +311 -0
  231. package/dist/waiting.d.ts +15 -0
  232. package/dist/waiting.js +17 -0
  233. package/dist/where.d.ts +54 -0
  234. package/dist/where.js +14 -0
  235. package/package.json +108 -0
@@ -0,0 +1,211 @@
1
+ /**
2
+ * WHERE THE SESSION IS KEPT, named once.
3
+ *
4
+ * The @hanzo/iam SDK owns these keys and publishes no reader a plain module can
5
+ * call — `getSession()` needs `configureIam()`, and this app configures through
6
+ * `IamProvider` instead. So the names are restated here, in ONE file, and
7
+ * everything that needs the bearer asks this.
8
+ *
9
+ * That is not a style preference. Four modules restated the name themselves and
10
+ * every one of them got it wrong — they read `hanzo_access_token` while the SDK
11
+ * writes `hanzo_iam_access_token`, so invitations, referrals, coding runs and
12
+ * signed-in telemetry all read null and behaved as if nobody was signed in.
13
+ * Nothing errored: `bearer()` threw "Sign in to manage invitations" at somebody
14
+ * who was signed in, which reads as a permissions problem rather than a typo.
15
+ * Two derivations of one name never agree; this is the one derivation.
16
+ */
17
+ /**
18
+ * The access token, or null.
19
+ *
20
+ * Guarded because storage THROWS rather than answering null in a browser that
21
+ * refuses it, and a caller reaching for the bearer is usually about to make a
22
+ * request — one that should fail as unauthenticated, not as an exception.
23
+ */
24
+ export declare function bearer(): string | null;
25
+ /**
26
+ * Whether the stored access token is live: present, and not past the expiry the
27
+ * SDK wrote beside it — the SDK's own fast path (`IAM#getValidAccessToken`)
28
+ * without the refresh, which is a request and cannot be waited for here. No
29
+ * expiry reads as live, as it does in the SDK.
30
+ */
31
+ export declare function live(): boolean;
32
+ /** The attribute on `<html>` that says `/` is showing the app, not the landing. */
33
+ export declare const APP = "data-app";
34
+ /** Whether `search` names a place in the app. */
35
+ export declare const place: (search: string) => boolean;
36
+ /**
37
+ * `live()`, and a place in the app, as the script `/` runs as the first child
38
+ * of its landing (app/_apex.tsx `[data-landing]`), before the rest of the
39
+ * landing is parsed (app/page.tsx). Either marks the document with `APP` and
40
+ * takes the landing off the page at once: a signed-in reader is never shown the
41
+ * pitch while the app loads, and a reader on their way to sign in to a place is
42
+ * not shown it while they leave. Same keys, same test. An inline style, because
43
+ * this is decided before any stylesheet or component has run.
44
+ */
45
+ export declare const BOOT: string;
46
+ /**
47
+ * Whether this tab may still ask: a person's browser, and not asked in this tab
48
+ * yet. A browser that refuses storage cannot remember having asked, so it never
49
+ * asks.
50
+ */
51
+ export declare function unasked(): boolean;
52
+ /** Spend this tab's ask: it is written down before it is made, so it is made once. */
53
+ export declare function asked(): void;
54
+ /**
55
+ * Whether the browser holds an existing session (stored token, JWT subject,
56
+ * or migration candidate).
57
+ *
58
+ * Guarded against storage exceptions. Used across workspace and marketing
59
+ * headers so a signed-in person never sees "Sign in".
60
+ */
61
+ export declare function hasSession(): boolean;
62
+ /**
63
+ * Carry a session across the move from per-tab storage to per-origin.
64
+ *
65
+ * The session used to be held in `sessionStorage`, which is why it did not
66
+ * survive closing a tab. It is `localStorage` now — but everyone already signed
67
+ * in was signed in THERE, and the new build looks HERE, so the fix for "I have
68
+ * to sign in again" would itself have signed everybody out one last time.
69
+ *
70
+ * The old store is read once and its keys moved over. After that this does
71
+ * nothing, because there is nothing left to find: a migration, not a fallback,
72
+ * and a fallback is what would keep two answers about who is signed in alive.
73
+ *
74
+ * ONLY WHEN THE NEW STORE IS EMPTY. A session established since the move is the
75
+ * current one, and a stale per-tab copy must never overwrite it.
76
+ */
77
+ export declare function carry(): void;
78
+ /**
79
+ * The subject the stored access token names, or undefined.
80
+ *
81
+ * Read off the claim rather than waited for from userinfo, because that is
82
+ * what makes `own` runnable BEFORE anything else reads storage: the token is
83
+ * in place from the first line of the first script, and the SDK's own fast
84
+ * path judges a session the same way. Expiry is not consulted — a stale
85
+ * token still says whose browser this is, and the SDK either refreshes it or
86
+ * clears it, at which point the answer changes here too.
87
+ */
88
+ export declare function subject(): string | undefined;
89
+ /**
90
+ * Bind everything this site keeps in the browser to ONE person.
91
+ *
92
+ * Every `hanzo*` key — conversations, contacts, the calendar, the board, the
93
+ * agent's persona, the chat's history, the SDK's current org — is written per
94
+ * browser and would be read by whoever is signed in next. So the subject is
95
+ * recorded beside them, and when a different subject arrives (or nobody: a
96
+ * sign-out) the last person's keys are removed before anything reads them.
97
+ * The SDK's `hanzo_iam_*` keys are the arriving session itself and stay —
98
+ * except the org and project it last selected, which are the last person's.
99
+ *
100
+ * Same subject, no work. Called synchronously where the providers mount, so
101
+ * a page's first read of storage already sees a browser that is the reader's.
102
+ */
103
+ export declare function own(sub: string | undefined): void;
104
+ /**
105
+ * Follow the session every tab of this site shares.
106
+ *
107
+ * The SDK in each tab keeps its own copy of who is signed in and is told
108
+ * nothing when another tab changes the store. A sign-out there empties the
109
+ * tokens, and a tab that did not hear it goes on drawing the person it was
110
+ * opened for while every call it makes carries `X-Org-Id` and no bearer, which
111
+ * the platform answers as nobody (`a validated principal is required`).
112
+ *
113
+ * `moved` runs when the stored access token stops naming `was` — removed, or
114
+ * naming someone else; a cleared store (`key` null) is read the same way — and
115
+ * when the organization a SuperAdmin stepped into (`assumed`) changes, because
116
+ * the person is the same and every request's scope is not. Any other token for
117
+ * the same subject is not a move: that is a refresh in another tab, and
118
+ * `bearer()` reads it at call time. A tab on the sign-in callback is finishing
119
+ * its own sign-in and is left to it.
120
+ *
121
+ * When the store is left with nobody, the silent ask is marked spent in this
122
+ * tab before `moved` runs: the sign-out that emptied it may still be on its way
123
+ * to IAM, and an ask arriving first would be answered from the session being
124
+ * ended and sign this tab straight back in. The reader signs in again from the
125
+ * form. Returns the unsubscribe.
126
+ */
127
+ export declare function follow(was: string | undefined, moved: () => void): () => void;
128
+ /**
129
+ * The organizations the token says this person belongs to, home first.
130
+ * Empty for an account that has not made one: the SDK's own list falls back to
131
+ * the `owner` claim, which is the application's org and nobody's to work in.
132
+ */
133
+ export declare function orgs(): string[];
134
+ /**
135
+ * The reader's role in one organization as IAM signed it into the token's `orgs`
136
+ * claim — owner, admin or member — or null where the token names no such org.
137
+ * It is the role in THAT org only (HIP-0527: org admin is scoped to its org), so
138
+ * it says nothing about any other org and nothing about SuperAdmin.
139
+ */
140
+ export declare function role(o: string | null): string | null;
141
+ /**
142
+ * Who the token names — its display name and email — or null. The IAM user says
143
+ * the same once userinfo answers; this is the answer before it, so a signed-in
144
+ * reader is never drawn as a stranger while it is asked.
145
+ */
146
+ export declare function named(): {
147
+ name: string;
148
+ email: string;
149
+ } | null;
150
+ /**
151
+ * The reader's account as IAM keys a membership: `<home org>/<username>`, or null.
152
+ * The token's `name` is the username and its `orgs` claim lists the home org first.
153
+ */
154
+ export declare function me(): string | null;
155
+ /** The organization this browser works in: the SDK's selection, when it is one of the token's. */
156
+ export declare function org(): string | null;
157
+ /** The headers that scope a request to the signed-in person and their organization. */
158
+ export declare function scope(): Record<string, string>;
159
+ /**
160
+ * Expire the access token so the next load mints one carrying the account's
161
+ * current claims — after it joins an organization. The token itself stays,
162
+ * because it is what names the person: removing it would read as a sign-out
163
+ * and `own()` would empty everything the person just chose. The SDK sees an
164
+ * expired token and refreshes on the refresh token.
165
+ */
166
+ export declare function renew(): void;
167
+ /** Fired on `window` when the organization this browser works in changes. */
168
+ export declare const ORG = "hanzo:org";
169
+ /** This person picked an organization in this browser. `own()` clears it with the person. */
170
+ export declare const PICKED = "hanzo:org:picked";
171
+ /**
172
+ * Work in this organization from now on: the SDK's selection, noted as picked
173
+ * and announced. Noted here, so a choice made anywhere — the rooms' gate, the
174
+ * app's account menu — is one the gate does not ask for again.
175
+ */
176
+ export declare function pick(o: string): void;
177
+ /** The reserved org whose own people are the platform's operators. */
178
+ export declare const ADMIN_ORG = "admin";
179
+ /**
180
+ * Whether the signed-in person is a SUPERADMIN, as IAM signs it: the org of the
181
+ * person's own row — the first entry of the token's `orgs`, which IAM always puts
182
+ * first (hanzoai/iam internal/store/membership.go `MemberOrgRefs`) — is the
183
+ * reserved `admin` org. It is the equality IAM decides `assume` and the
184
+ * organization list on (pkg/schema/user.go `SuperAdmin`) and cloud's `Super`.
185
+ * Not the `owner` claim: a sign-in token carries the APPLICATION's org there. A
186
+ * membership of `admin` is not it either, and neither is being an org's admin.
187
+ * It decides only what is drawn: IAM refuses everyone else the list of every
188
+ * organization and the step into one.
189
+ */
190
+ export declare function superAdmin(): boolean;
191
+ /** The organization a SuperAdmin stepped into through IAM, from the token's `assumed` claim, or null. */
192
+ export declare function assumed(): string | null;
193
+ /**
194
+ * Step into an organization as its support, or step back out (`org` null).
195
+ *
196
+ * IAM does the whole act: `POST /v1/iam/assume {org}` answers the same person's
197
+ * token re-scoped to that organization — `assumed` names it and `orgs` gains it —
198
+ * and records the step in that organization's audit log; `POST /v1/iam/release`
199
+ * answers the token with nothing assumed and records that too
200
+ * (hanzoai/iam internal/oidc/masquerade.go). The answer is kept where the SDK
201
+ * keeps the session, with its own expiry, so every request made from here on
202
+ * carries it and the SDK's next refresh ends support mode by itself. The page
203
+ * reloads so every room reads under it.
204
+ */
205
+ export declare function support(org: string | null): Promise<void>;
206
+ /**
207
+ * Leave support mode when IAM cannot answer the step out: the stored token is
208
+ * marked spent, so the SDK's refresh — which mints from the person's own grant
209
+ * and assumes nothing — replaces it on the reload.
210
+ */
211
+ export declare function abandon(): void;