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. Tasks, calendar, and messages require explicit consent |
| 8 | * and an invoking user; mail is not exposed. |
| 9 | */ |
| 10 |
| 11 | export const APP_PERMISSIONS_V2 = [ |
| 12 | "references.read", |
| 13 | "tasks.read", |
| 14 | "tasks.write", |
| 15 | "calendar.read", |
| 16 | "calendar.write", |
| 17 | "messages.read", |
| 18 | "messages.write", |
| 19 | "members.read", |
| 20 | "files.read", |
| 21 | "files.write", |
| 22 | "drives.app", |
| 23 | "storage.app", |
| 24 | "search.index", |
| 25 | "search.query", |
| 26 | "notifications.write", |
| 27 | "ai.generate", |
| 28 | "ai.tools", |
| 29 | "events.emit", |
| 30 | "webhooks.subscribe", |
| 31 | "commands.register", |
| 32 | "realtime.subscribe", |
| 33 | "network.external", |
| 34 | "jobs.run", |
| 35 | "endpoints.receive", |
| 36 | "connections.use", |
| 37 | "site.serve", |
| 38 | ] as const; |
| 39 |
| 40 | export const appPermissionV2Schema = z.enum(APP_PERMISSIONS_V2); |
| 41 | export type AppPermissionV2 = z.infer<typeof appPermissionV2Schema>; |
| 42 |
| 43 | /** Human-readable consent copy, keyed by permission. */ |
| 44 | export const APP_PERMISSION_V2_DESCRIPTIONS: Record<AppPermissionV2, string> = { |
| 45 | "references.read": "Resolve names and links for workspace objects you can access.", |
| 46 | "tasks.read": "Read tasks and task board statuses you can access.", |
| 47 | "tasks.write": "Create, edit, and delete tasks on your behalf.", |
| 48 | "calendar.read": "Read calendar events you can access.", |
| 49 | "calendar.write": "Create, edit, and cancel calendar events on your behalf.", |
| 50 | "messages.read": "Read conversations and task or event comments you can access.", |
| 51 | "messages.write": "Send messages and comments on your behalf.", |
| 52 | "members.read": "See who is in the workspace (names, emails, handles, avatars).", |
| 53 | "files.read": "Read files the installing user can access.", |
| 54 | "files.write": "Create and update files on behalf of users.", |
| 55 | "drives.app": "Use its own app drive for files it creates.", |
| 56 | "storage.app": "Store app data (key-value state and records) in the workspace.", |
| 57 | "search.index": "Add its content to workspace search.", |
| 58 | "search.query": "Search the workspace on behalf of users.", |
| 59 | "notifications.write": "Send notifications to workspace members.", |
| 60 | "ai.generate": "Use Coline AI models (billed to the workspace).", |
| 61 | "ai.tools": "Offer tools that Kairo and agents can run.", |
| 62 | "events.emit": "Emit ambient events into the workspace.", |
| 63 | "webhooks.subscribe": "Receive workspace events at its backend.", |
| 64 | "commands.register": "Add commands to the command palette.", |
| 65 | "realtime.subscribe": "Receive live updates for its own surfaces.", |
| 66 | "network.external": |
| 67 | "Call the external services it lists (through Coline, with the app's own credentials).", |
| 68 | "jobs.run": "Run background work after you leave, on your behalf or its own.", |
| 69 | "endpoints.receive": "Receive requests from the external services it lists at private URLs.", |
| 70 | "connections.use": "Ask you to connect accounts on the services it lists, and use them for you.", |
| 71 | "site.serve": |
| 72 | "Serve a public website. Visitors can use only the tools and collections the app opens to them.", |
| 73 | }; |
| 74 |
| 75 | export const appPermissionV2ListSchema = z |
| 76 | .array(appPermissionV2Schema) |
| 77 | .max(APP_PERMISSIONS_V2.length) |
| 78 | .default([]) |
| 79 | .refine((values) => new Set(values).size === values.length, "Permissions must be unique."); |
| 80 |