@ateam-ai-mobile/core 0.1.30 → 0.1.32

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.
package/dist/index.d.mts CHANGED
@@ -654,7 +654,24 @@ interface TenantMembership {
654
654
  id: string;
655
655
  name: string;
656
656
  role: string | null;
657
+ /** Id of the cluster master this workspace sits under; set only when the person also has that master. */
658
+ master?: string;
657
659
  }
660
+ interface TenantRow {
661
+ tenant: TenantMembership;
662
+ /** 0 = top level, 1 = a cluster member shown under its master. */
663
+ depth: 0 | 1;
664
+ /** Last member of its master's group (draws the connector's end). */
665
+ last: boolean;
666
+ /** How many members this row is the master of. */
667
+ memberCount: number;
668
+ }
669
+ /**
670
+ * Order a membership list for display: cluster members sit right under their master, everything else keeps its
671
+ * order. Pure; every workspace appears exactly once, whatever the links (chains A>B>C all sit one level in).
672
+ * The same rule as the web switcher (WorkspaceSwitcher.jsx nestByMaster) so web and phone read the same.
673
+ */
674
+ declare function nestByMaster(tenants: TenantMembership[]): TenantRow[];
658
675
  /**
659
676
  * List the tenants the CURRENT user belongs to.
660
677
  *
@@ -1267,4 +1284,4 @@ interface AcsKvStorage {
1267
1284
  }
1268
1285
  declare function setAcsCacheStorage(kv: AcsKvStorage | null): void;
1269
1286
 
1270
- export { type AcsArtifact, type AcsDeleteReason, type AcsEvent, type AcsKvStorage, type AcsPatchReason, type AcsReachabilityReporter, type AcsSurface, type AdasConfig, type AdasGateFlags, type AdasPhase, type AdasSession, type AdasUser, type AttachmentCache, type AttachmentPreview, type AuthSession, type AuthSessionDeps, type AuthSessionState, type BufferedCommand, type ChannelPrefs, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type DeleteResult, type DevModeState, type DevicePlatform, type DispatchRow, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobProgress, type Message, type MessageAttachment, type NotifChannel, type NotifPrefs, type OtpStartResult, type OutgoingAttachment, type PatchResult, PluginCommandEmitter, type PushBackend, type PushRegistration, type QuietHoursPrefs, type RefreshOutcome, type RegisterDeviceResponse, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TokenProvider, type ToolCall, type UIAction, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, closeChatStream, colors, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, focusPlugin, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getTenant, getToken, getUser, getVoiceApiUrl, initAdas, isAdasInitialized, isDevHost, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, notifyAcsWsForeground, notifyAppForeground, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, pluginCommandEmitter, postCommandResult, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, refreshToken, registerHostIntent, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, signInWithApple, signInWithGoogle, spacing, switchTenant, tenantFromToken, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt };
1287
+ export { type AcsArtifact, type AcsDeleteReason, type AcsEvent, type AcsKvStorage, type AcsPatchReason, type AcsReachabilityReporter, type AcsSurface, type AdasConfig, type AdasGateFlags, type AdasPhase, type AdasSession, type AdasUser, type AttachmentCache, type AttachmentPreview, type AuthSession, type AuthSessionDeps, type AuthSessionState, type BufferedCommand, type ChannelPrefs, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type DeleteResult, type DevModeState, type DevicePlatform, type DispatchRow, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobProgress, type Message, type MessageAttachment, type NotifChannel, type NotifPrefs, type OtpStartResult, type OutgoingAttachment, type PatchResult, PluginCommandEmitter, type PushBackend, type PushRegistration, type QuietHoursPrefs, type RefreshOutcome, type RegisterDeviceResponse, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TenantRow, type TokenProvider, type ToolCall, type UIAction, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, closeChatStream, colors, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, focusPlugin, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getTenant, getToken, getUser, getVoiceApiUrl, initAdas, isAdasInitialized, isDevHost, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, nestByMaster, notifyAcsWsForeground, notifyAppForeground, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, pluginCommandEmitter, postCommandResult, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, refreshToken, registerHostIntent, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, signInWithApple, signInWithGoogle, spacing, switchTenant, tenantFromToken, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt };
package/dist/index.d.ts CHANGED
@@ -654,7 +654,24 @@ interface TenantMembership {
654
654
  id: string;
655
655
  name: string;
656
656
  role: string | null;
657
+ /** Id of the cluster master this workspace sits under; set only when the person also has that master. */
658
+ master?: string;
657
659
  }
660
+ interface TenantRow {
661
+ tenant: TenantMembership;
662
+ /** 0 = top level, 1 = a cluster member shown under its master. */
663
+ depth: 0 | 1;
664
+ /** Last member of its master's group (draws the connector's end). */
665
+ last: boolean;
666
+ /** How many members this row is the master of. */
667
+ memberCount: number;
668
+ }
669
+ /**
670
+ * Order a membership list for display: cluster members sit right under their master, everything else keeps its
671
+ * order. Pure; every workspace appears exactly once, whatever the links (chains A>B>C all sit one level in).
672
+ * The same rule as the web switcher (WorkspaceSwitcher.jsx nestByMaster) so web and phone read the same.
673
+ */
674
+ declare function nestByMaster(tenants: TenantMembership[]): TenantRow[];
658
675
  /**
659
676
  * List the tenants the CURRENT user belongs to.
660
677
  *
@@ -1267,4 +1284,4 @@ interface AcsKvStorage {
1267
1284
  }
1268
1285
  declare function setAcsCacheStorage(kv: AcsKvStorage | null): void;
1269
1286
 
1270
- export { type AcsArtifact, type AcsDeleteReason, type AcsEvent, type AcsKvStorage, type AcsPatchReason, type AcsReachabilityReporter, type AcsSurface, type AdasConfig, type AdasGateFlags, type AdasPhase, type AdasSession, type AdasUser, type AttachmentCache, type AttachmentPreview, type AuthSession, type AuthSessionDeps, type AuthSessionState, type BufferedCommand, type ChannelPrefs, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type DeleteResult, type DevModeState, type DevicePlatform, type DispatchRow, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobProgress, type Message, type MessageAttachment, type NotifChannel, type NotifPrefs, type OtpStartResult, type OutgoingAttachment, type PatchResult, PluginCommandEmitter, type PushBackend, type PushRegistration, type QuietHoursPrefs, type RefreshOutcome, type RegisterDeviceResponse, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TokenProvider, type ToolCall, type UIAction, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, closeChatStream, colors, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, focusPlugin, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getTenant, getToken, getUser, getVoiceApiUrl, initAdas, isAdasInitialized, isDevHost, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, notifyAcsWsForeground, notifyAppForeground, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, pluginCommandEmitter, postCommandResult, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, refreshToken, registerHostIntent, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, signInWithApple, signInWithGoogle, spacing, switchTenant, tenantFromToken, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt };
1287
+ export { type AcsArtifact, type AcsDeleteReason, type AcsEvent, type AcsKvStorage, type AcsPatchReason, type AcsReachabilityReporter, type AcsSurface, type AdasConfig, type AdasGateFlags, type AdasPhase, type AdasSession, type AdasUser, type AttachmentCache, type AttachmentPreview, type AuthSession, type AuthSessionDeps, type AuthSessionState, type BufferedCommand, type ChannelPrefs, type ConsumerCapabilityConfig, type ConsumerProviderConfig, type ConsumerSignInResult, type DeleteResult, type DevModeState, type DevicePlatform, type DispatchRow, type HandoffExchangeResult, type HomeAction, type HomeActionLeaf, type HomeActionReason, type InvitePreview, type JobProgress, type Message, type MessageAttachment, type NotifChannel, type NotifPrefs, type OtpStartResult, type OutgoingAttachment, type PatchResult, PluginCommandEmitter, type PushBackend, type PushRegistration, type QuietHoursPrefs, type RefreshOutcome, type RegisterDeviceResponse, type Session, type SessionEnv, type SessionPersistence, type SessionStatus, type SessionUser, TABLE_BLOCK_CLOSE, TABLE_BLOCK_OPEN, type TelegramBotInfo, type TenantMembership, type TenantRow, type TokenProvider, type ToolCall, type UIAction, type WorkspaceCapabilities, type WorkspaceSnapshot, type WorkspaceState, ada, apiFetch, apiFetchRaw, blocksToText, borderRadius, capabilityEnabled, closeChatStream, colors, connectAcsWs, connectorCall, createAuthSession, createPushRegistration, deleteArtifact, devModeFromCatalog, disconnectAcsWs, exchangeHandoff, fetchConsumerConfig, focusPlugin, fontSize, getConfig, getConsumerAuthApiUrl, getCoreApiUrl, getCoreWsUrl, getPrefs as getNotifPrefs, getTelegramBotInfo as getNotifTelegramBotInfo, getSession, getTenant, getToken, getUser, getVoiceApiUrl, initAdas, isAdasInitialized, isDevHost, joinWithApple, joinWithGoogle, linkChannelStart, linkChannelVerify, linkTelegram as linkNotifTelegram, listHomeActions, listMadeForYou, listMyTenants, listSurface, mcpFetch, mcpToolCall, nestByMaster, notifyAcsWsForeground, notifyAppForeground, onAppForeground, openJoinWithApple, openJoinWithGoogle, parseDeepLinkParam, parseHandoffCode, parseInviteCode, patchArtifact, patchHomeAction, pluginCommandEmitter, postCommandResult, previewInvite, readDevMode, recentDispatches as recentNotifDispatches, recordEvent, refreshToken, registerHostIntent, registerDevice as registerPushDevice, resolveAdasPhase, setAcsCacheStorage, setAcsReachabilityReporter, setClientDeclarationProvider, setDevMode, setHomeActionOrder, setPrefs as setNotifPrefs, setOrder, signInWithApple, signInWithGoogle, spacing, switchTenant, tenantFromToken, unlinkChannel as unlinkNotifChannel, unregisterDevice as unregisterPushDevice, unwrapMcpResult, useCapability, useChatStore, useHomeActionsStore, useWidgetsStore, useWorkspaceStore, userFromJwt };
package/dist/index.js CHANGED
@@ -67,6 +67,7 @@ __export(index_exports, {
67
67
  listSurface: () => listSurface,
68
68
  mcpFetch: () => mcpFetch,
69
69
  mcpToolCall: () => mcpToolCall,
70
+ nestByMaster: () => nestByMaster,
70
71
  notifyAcsWsForeground: () => notifyAcsWsForeground,
71
72
  notifyAppForeground: () => notifyAppForeground,
72
73
  onAppForeground: () => onAppForeground,
@@ -2167,6 +2168,24 @@ async function pollJob(jobId, token) {
2167
2168
  }
2168
2169
 
2169
2170
  // src/api/tenants.ts
2171
+ function nestByMaster(tenants) {
2172
+ const ids = new Set(tenants.map((t) => t.id));
2173
+ const hasMaster = (t) => !!t.master && t.master !== t.id && ids.has(t.master);
2174
+ const kids = /* @__PURE__ */ new Map();
2175
+ for (const t of tenants) if (hasMaster(t)) kids.set(t.master, [...kids.get(t.master) || [], t]);
2176
+ const rows = [];
2177
+ const seen = /* @__PURE__ */ new Set();
2178
+ const add = (t, depth, last) => {
2179
+ if (seen.has(t.id)) return;
2180
+ seen.add(t.id);
2181
+ const k = kids.get(t.id) || [];
2182
+ rows.push({ tenant: t, depth, last, memberCount: k.length });
2183
+ k.forEach((m, i) => add(m, 1, i === k.length - 1));
2184
+ };
2185
+ for (const t of tenants) if (!hasMaster(t)) add(t, 0, false);
2186
+ for (const t of tenants) add(t, 0, false);
2187
+ return rows;
2188
+ }
2170
2189
  async function listMyTenants() {
2171
2190
  const token = getToken();
2172
2191
  if (!token) return [];
@@ -2181,7 +2200,8 @@ async function listMyTenants() {
2181
2200
  // Fall back to the id rather than to an empty string: a nameless row in
2182
2201
  // a team switcher is unpickable.
2183
2202
  name: t.name || t.id,
2184
- role: t.role ?? null
2203
+ role: t.role ?? null,
2204
+ ...typeof t.master === "string" && t.master ? { master: t.master } : {}
2185
2205
  }));
2186
2206
  } catch {
2187
2207
  return [];
@@ -2365,6 +2385,7 @@ var borderRadius = {
2365
2385
  listSurface,
2366
2386
  mcpFetch,
2367
2387
  mcpToolCall,
2388
+ nestByMaster,
2368
2389
  notifyAcsWsForeground,
2369
2390
  notifyAppForeground,
2370
2391
  onAppForeground,