The Coline App SDK: apps, tools, file types and surfaces that run inside Coline workspaces, and public websites with Coline Sites. TypeScript, with an in-memory test workspace. MIT.
| * |
| 6 | * Deliberately coarse: each value is a consent-screen line item, not a |
| 7 | * per-endpoint scope. Sensitive domains (messages, mail, calendar, tasks) |
| 8 | * are intentionally absent and land post-v2 as individual product |
| 9 | * decisions. |
| 10 | */ |
| 11 |
| 12 | export const APP_PERMISSIONS_V2 = [ |
| 13 | "members.read", |
| 14 | "files.read", |
| 15 | "files.write", |
| 16 | "drives.app", |
| 17 | "storage.app", |
| 18 | "search.index", |
| 19 | "search.query", |
| 20 | "notifications.write", |
| 21 | "ai.generate", |
| 22 | "ai.tools", |
| 23 | "events.emit", |
| 24 | "webhooks.subscribe", |
| 25 | "commands.register", |
| 26 | "realtime.subscribe", |
| 27 | ] as const; |
| 28 |
| 29 | export const appPermissionV2Schema = z.enum(APP_PERMISSIONS_V2); |
| 30 | export type AppPermissionV2 = z.infer<typeof appPermissionV2Schema>; |
| 31 |
| 32 | /** Human-readable consent copy, keyed by permission. */ |
| 33 | export const APP_PERMISSION_V2_DESCRIPTIONS: Record<AppPermissionV2, string> = { |
| 34 | "members.read": "See who is in the workspace (names, handles, avatars).", |
| 35 | "files.read": "Read files the installing user can access.", |
| 36 | "files.write": "Create and update files on behalf of users.", |
| 37 | "drives.app": "Use its own app drive for files it creates.", |
| 38 | "storage.app": "Store app data (key-value state and records) in the workspace.", |
| 39 | "search.index": "Add its content to workspace search.", |
| 40 | "search.query": "Search the workspace on behalf of users.", |
| 41 | "notifications.write": "Send notifications to workspace members.", |
| 42 | "ai.generate": "Use Coline AI models (billed to the workspace).", |
| 43 | "ai.tools": "Offer tools that Kairo and agents can run.", |
| 44 | "events.emit": "Emit ambient events into the workspace.", |
| 45 | "webhooks.subscribe": "Receive workspace events at its backend.", |
| 46 | "commands.register": "Add commands to the command palette.", |
| 47 | "realtime.subscribe": "Receive live updates for its own surfaces.", |
| 48 | }; |
| 49 |
| 50 | export const appPermissionV2ListSchema = z |
| 51 | .array(appPermissionV2Schema) |
| 52 | .max(APP_PERMISSIONS_V2.length) |
| 53 | .default([]) |
| 54 | .refine( |
| 55 | (values) => new Set(values).size === values.length, |
| 56 | "Permissions must be unique.", |
| 57 | ); |
| 58 |