/** teamId prefix used when mirroring platform team groups into team-groups.json. */ export declare const PLATFORM_TEAM_PREFIX = "platform:"; export interface PlatformTeamBot { appId: string; unionId?: string; name?: string; } export interface PlatformTeamSyncTeam { teamId: string; teamName: string; /** Team-assembled group chats (机器人大厅 first) — trusted like 拉群 groups. */ groupChatIds: string[]; bots: PlatformTeamBot[]; /** Team members' (people's) union_ids — the human talk-免grant leg: a member * is trusted to TALK (never operate) to any bot on the SAME team, in any chat * they share with it (not scoped to this team's group chats). */ memberUnionIds: string[]; } export interface PlatformTeamSyncPayload { rev: string; teams: PlatformTeamSyncTeam[]; } /** * Apply a platform `team-sync` push: persist the payload (full-replace — it is * the platform's complete view of THIS machine's teams) and mirror the group * chats into team-groups.json under the platform prefix. Teams absent from the * payload (machine left the team / team deleted) drop out of both stores. */ export declare function applyPlatformTeamSync(dataDir: string, payload: { rev?: unknown; teams?: unknown; }, now?: number): PlatformTeamSyncPayload | null; /** The rev of the last applied team-sync ('' when none) — reported on * register/heartbeat so the platform knows whether to re-push. */ export declare function getPlatformTeamSyncRev(dataDir: string): string; /** All platform teams this machine belongs to (last applied sync). */ export declare function listPlatformTeams(dataDir: string): PlatformTeamSyncTeam[]; /** 该 chat 是否是某个平台团队的机器人大厅。大厅是身份登记回声室:bot 发的消息 * 只用于学习(union_id / cross-ref / recordTeamBot),绝不当任务路由。 * 只认 groupChatIds[0](协议语义:大厅 first)——后续若下发普通团队协作群, * 它们不是大厅,bot 互 @ 必须正常路由(Codex review 收窄)。 */ export declare function isPlatformHallChat(dataDir: string, chatId: string | undefined): boolean; /** Is `unionId` a bot in ANY platform team this machine belongs to? The auth * gate's platform-mode predicate — membership-driven, no expiry. */ export declare function isPlatformTeamBot(dataDir: string, unionId: string | undefined): boolean; /** Is `unionId` a HUMAN member of a platform team that THIS bot (`botAppId`) * also belongs to? The talk-免grant leg for people: a teammate is trusted to * TALK to a bot on their own team without /grant, in ANY chat they share — * not just platform-拉群 groups. The scope anchor is TEAM CO-MEMBERSHIP * (bot ∈ team.bots ∧ sender ∈ team.memberUnionIds on the SAME team), not the * chat: this is what lets a手动/原生 invite 群 work at parity with拉群 groups * (those 群 never enter groupChatIds; keying on the chat left them 要 /grant). * * Cross-team leakage stays impossible because both predicates must hold on the * SAME team, and the bot only ever sees teams it is itself opted into (platform * team-sync is pushed per member machine; a bot not in team T never appears in * T.bots, so T's members can't reach it here). TALK only — operate stays * allowedUsers-gated; the caller must never route this predicate into canOperate. */ export declare function isPlatformTeamMember(dataDir: string, botAppId: string | undefined, unionId: string | undefined): boolean; //# sourceMappingURL=platform-team-store.d.ts.map