Files
nanobot/nanobot/channels/linear/webui/manifest.ts
T

34 lines
927 B
TypeScript

export function linearManifestUrl(
publicBaseUrl: string,
webhookPath: string,
callbackPath: string,
): string {
const manifest = {
$schema: "https://linear.app/.well-known/oauth-app-manifest.schema.json",
schemaVersion: "1.0.0",
distribution: "private",
display: {
description: "Use nanobot as a native issue agent.",
},
developer: { name: "nanobot" },
oauth: {
client_name: "nanobot Agent",
client_uri: publicBaseUrl,
redirect_uris: [`${publicBaseUrl}${callbackPath}`],
grant_types: ["authorization_code"],
},
webhook: {
enabled: true,
url: `${publicBaseUrl}${webhookPath}`,
resourceTypes: [
"AgentSessionEvent",
"PermissionChange",
"OAuthAuthorization",
],
},
};
return `https://linear.app/settings/api/applications/new?${new URLSearchParams({
manifest: JSON.stringify(manifest),
})}`;
}