hale-commenting-system 1.0.2 → 1.0.4
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/cli/dist/index.js +12 -11
- package/cli/dist/index.js.map +1 -1
- package/dist/index.d.mts +151 -52
- package/dist/index.d.ts +151 -52
- package/dist/index.js +2171 -68
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2200 -68
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/cli/dist/index.js
CHANGED
|
@@ -80,15 +80,15 @@ function printSetupInstructions(platform, project) {
|
|
|
80
80
|
GitHubAuthProvider,
|
|
81
81
|
CommentOverlay,
|
|
82
82
|
CommentDrawer
|
|
83
|
-
} from '
|
|
84
|
-
import
|
|
83
|
+
} from 'hale-commenting-system';
|
|
84
|
+
import haleCommentsConfig from './hale-comments.config.json';
|
|
85
85
|
import React from 'react';
|
|
86
86
|
|
|
87
87
|
function App() {
|
|
88
88
|
const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);
|
|
89
89
|
|
|
90
90
|
return (
|
|
91
|
-
<GitHubAuthProvider config={
|
|
91
|
+
<GitHubAuthProvider config={haleCommentsConfig}>
|
|
92
92
|
<VersionProvider>
|
|
93
93
|
<CommentProvider>
|
|
94
94
|
<CommentDrawer
|
|
@@ -158,6 +158,7 @@ async function promptPlatform(projectRoot) {
|
|
|
158
158
|
name: "platform",
|
|
159
159
|
message: "Select your deployment platform:",
|
|
160
160
|
choices: [
|
|
161
|
+
{ name: "Local development (runs locally only)", value: "local" },
|
|
161
162
|
{ name: "Vercel", value: "vercel" },
|
|
162
163
|
{ name: "Netlify", value: "netlify" },
|
|
163
164
|
{ name: "Manual (I will configure myself)", value: "manual" }
|
|
@@ -476,7 +477,7 @@ export { handler };
|
|
|
476
477
|
|
|
477
478
|
// src/generators/serverless.ts
|
|
478
479
|
async function generateServerless(platform, projectRoot) {
|
|
479
|
-
if (platform === "vercel") {
|
|
480
|
+
if (platform === "vercel" || platform === "local") {
|
|
480
481
|
const apiDir = path2.join(projectRoot, "api");
|
|
481
482
|
await ensureDir(apiDir);
|
|
482
483
|
await writeFile(
|
|
@@ -597,9 +598,9 @@ async function generateConfig(githubConfig, platform, projectRoot) {
|
|
|
597
598
|
{ name: "needs-review", color: "fbca04", description: "Needs team review" }
|
|
598
599
|
]
|
|
599
600
|
};
|
|
600
|
-
const configPath = path4.join(projectRoot, "
|
|
601
|
+
const configPath = path4.join(projectRoot, "hale-comments.config.json");
|
|
601
602
|
await writeFile(configPath, JSON.stringify(config, null, 2));
|
|
602
|
-
console.log(chalk6.dim(" \u2192 Created
|
|
603
|
+
console.log(chalk6.dim(" \u2192 Created hale-comments.config.json"));
|
|
603
604
|
}
|
|
604
605
|
|
|
605
606
|
// src/generators/code.ts
|
|
@@ -859,7 +860,7 @@ async function initCommand(options) {
|
|
|
859
860
|
spinner.fail(`Failed to create environment files: ${error.message}`);
|
|
860
861
|
process.exit(1);
|
|
861
862
|
}
|
|
862
|
-
spinner.start("Creating
|
|
863
|
+
spinner.start("Creating hale-comments.config.json...");
|
|
863
864
|
try {
|
|
864
865
|
await generateConfig(githubConfig, platform, project.root);
|
|
865
866
|
spinner.succeed("Configuration file created");
|
|
@@ -912,12 +913,12 @@ async function validateCommand() {
|
|
|
912
913
|
console.log(chalk11.bold.cyan("\n\u{1F50D} Validating Apollo Commenting System Setup\n"));
|
|
913
914
|
const spinner = ora2("Checking configuration files...").start();
|
|
914
915
|
const cwd = process.cwd();
|
|
915
|
-
const configPath = path6.join(cwd, "
|
|
916
|
+
const configPath = path6.join(cwd, "hale-comments.config.json");
|
|
916
917
|
const hasConfig = await fileExists(configPath);
|
|
917
918
|
if (!hasConfig) {
|
|
918
919
|
spinner.fail("Configuration file not found");
|
|
919
|
-
console.log(chalk11.red("\n\u2717
|
|
920
|
-
console.log(chalk11.dim(" Run:
|
|
920
|
+
console.log(chalk11.red("\n\u2717 hale-comments.config.json not found"));
|
|
921
|
+
console.log(chalk11.dim(" Run: hale-commenting-system init\n"));
|
|
921
922
|
process.exit(1);
|
|
922
923
|
}
|
|
923
924
|
let config;
|
|
@@ -927,7 +928,7 @@ async function validateCommand() {
|
|
|
927
928
|
spinner.succeed("Configuration file found");
|
|
928
929
|
} catch (error) {
|
|
929
930
|
spinner.fail("Invalid configuration file");
|
|
930
|
-
console.log(chalk11.red("\n\u2717 Could not parse
|
|
931
|
+
console.log(chalk11.red("\n\u2717 Could not parse hale-comments.config.json\n"));
|
|
931
932
|
process.exit(1);
|
|
932
933
|
}
|
|
933
934
|
spinner.start("Checking environment files...");
|
package/cli/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/commands/init.ts","../src/utils/detect.ts","../src/utils/logger.ts","../src/prompts/platform.ts","../src/prompts/github.ts","../src/generators/serverless.ts","../src/utils/fs.ts","../src/templates/vercel-auth.ts","../src/templates/netlify-auth.ts","../src/generators/env.ts","../src/generators/config.ts","../src/generators/code.ts","../src/validators/github.ts","../src/validators/repo.ts","../src/validators/labels.ts","../src/commands/validate.ts"],"sourcesContent":["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { initCommand } from './commands/init.js';\nimport { validateCommand } from './commands/validate.js';\n\nconst program = new Command();\n\nprogram\n .name('hale-commenting-system')\n .description('Hale Commenting System CLI - Setup wizard and tooling')\n .version('1.0.0');\n\nprogram\n .command('init')\n .description('Initialize Apollo Commenting System in your project')\n .option('-y, --yes', 'Skip prompts and use defaults')\n .option('--platform <platform>', 'Target platform (vercel, netlify, manual)')\n .action(async (options) => {\n try {\n await initCommand(options);\n } catch (error: any) {\n console.error(chalk.red('\\n✗ Error:'), error.message);\n process.exit(1);\n }\n });\n\nprogram\n .command('validate')\n .description('Validate your commenting system setup')\n .action(async () => {\n try {\n await validateCommand();\n } catch (error: any) {\n console.error(chalk.red('\\n✗ Error:'), error.message);\n process.exit(1);\n }\n });\n\nprogram\n .command('update')\n .description('Update existing configuration')\n .action(() => {\n console.log(chalk.yellow('\\n⚠️ Coming soon: Update configuration\\n'));\n console.log(chalk.dim('For now, you can manually edit apollo-comments.config.json\\n'));\n });\n\n// Show help if no command provided\nif (!process.argv.slice(2).length) {\n program.help();\n}\n\nprogram.parse();\n\n","import chalk from 'chalk';\nimport ora from 'ora';\nimport inquirer from 'inquirer';\nimport { detectProject } from '../utils/detect.js';\nimport { printWelcome, printSetupInstructions, printSuccess, printNextSteps, printWarning } from '../utils/logger.js';\nimport { promptPlatform } from '../prompts/platform.js';\nimport { promptGitHubConfig } from '../prompts/github.js';\nimport { generateServerless } from '../generators/serverless.js';\nimport { generateEnvFiles } from '../generators/env.js';\nimport { generateConfig } from '../generators/config.js';\nimport { integrateProviders, showIntegrationDiff } from '../generators/code.js';\nimport { validateGitHubConnection } from '../validators/github.js';\nimport { validateRepoAccess } from '../validators/repo.js';\nimport { ensureLabels } from '../validators/labels.js';\n\ninterface InitOptions {\n yes?: boolean;\n platform?: string;\n}\n\nexport async function initCommand(options: InitOptions) {\n printWelcome();\n\n const spinner = ora('Detecting project...').start();\n\n // Step 1: Detect project type\n let project;\n try {\n project = await detectProject(process.cwd());\n spinner.succeed(`Detected: ${project.framework} with ${project.buildTool}`);\n } catch (error: any) {\n spinner.fail(error.message);\n process.exit(1);\n }\n\n if (!project.isReact) {\n spinner.fail('This package requires a React project');\n console.log(chalk.red('\\n✗ Apollo Commenting System requires React.\\n'));\n process.exit(1);\n }\n\n if (!project.hasPatternFly) {\n printWarning('PatternFly not detected. This package is optimized for PatternFly projects.');\n if (!options.yes) {\n const { continueAnyway } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'continueAnyway',\n message: 'Continue anyway?',\n default: false\n }\n ]);\n if (!continueAnyway) {\n console.log(chalk.dim('\\nSetup cancelled.\\n'));\n process.exit(0);\n }\n }\n }\n\n // Step 2: Select platform\n const platform = options.platform || await promptPlatform(project.root);\n\n // Step 3: Prompt for GitHub OAuth settings\n const githubConfig = await promptGitHubConfig(options.yes || false);\n\n // Step 4: Validate GitHub connection\n spinner.start('Validating GitHub connection...');\n const isValid = await validateGitHubConnection(githubConfig);\n if (!isValid) {\n spinner.fail('GitHub connection failed. Please check your internet connection.');\n process.exit(1);\n }\n spinner.succeed('GitHub connection validated');\n\n // Step 5: Validate repo access\n spinner.start('Checking repository access...');\n const hasAccess = await validateRepoAccess(githubConfig);\n if (!hasAccess) {\n spinner.fail('Cannot access repository. Check the owner/repo name.');\n process.exit(1);\n }\n spinner.succeed('Repository access confirmed');\n\n // Step 6: Ensure labels exist\n spinner.start('Checking issue labels...');\n await ensureLabels(githubConfig);\n spinner.succeed('Issue labels documented');\n\n // Step 7: Generate serverless functions\n spinner.start('Generating serverless functions...');\n try {\n await generateServerless(platform, project.root);\n spinner.succeed('Serverless functions created');\n } catch (error: any) {\n spinner.fail(`Failed to generate serverless functions: ${error.message}`);\n process.exit(1);\n }\n\n // Step 8: Generate environment files\n spinner.start('Creating environment files...');\n try {\n await generateEnvFiles(githubConfig, platform, project.root);\n spinner.succeed('Environment files created');\n } catch (error: any) {\n spinner.fail(`Failed to create environment files: ${error.message}`);\n process.exit(1);\n }\n\n // Step 9: Generate config file\n spinner.start('Creating apollo-comments.config.json...');\n try {\n await generateConfig(githubConfig, platform, project.root);\n spinner.succeed('Configuration file created');\n } catch (error: any) {\n spinner.fail(`Failed to create config file: ${error.message}`);\n process.exit(1);\n }\n\n // Step 10: Offer auto-integration\n printSuccess();\n \n if (!options.yes) {\n const { autoIntegrate } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'autoIntegrate',\n message: 'Automatically integrate providers into your App file?',\n default: true\n }\n ]);\n\n if (autoIntegrate) {\n spinner.start('Integrating providers...');\n const result = await integrateProviders(project.root);\n \n if (result.success) {\n spinner.succeed('Providers integrated!');\n showIntegrationDiff(result.filePath);\n console.log(chalk.green('✓ Your app is ready to use the commenting system!\\n'));\n console.log(chalk.cyan('Next steps:'));\n console.log(chalk.white('1. Review the changes in your App file'));\n console.log(chalk.white('2. Start your dev server: npm run start:dev'));\n console.log(chalk.white('3. Open http://localhost:9000\\n'));\n } else {\n spinner.warn(result.message);\n console.log(chalk.yellow('\\nFalling back to manual integration:\\n'));\n printSetupInstructions(platform, project);\n printNextSteps();\n }\n } else {\n printSetupInstructions(platform, project);\n printNextSteps();\n }\n } else {\n // If --yes flag, skip integration and show manual instructions\n printSetupInstructions(platform, project);\n printNextSteps();\n }\n}\n\n","import fs from 'fs/promises';\nimport path from 'path';\n\nexport interface ProjectInfo {\n root: string;\n framework: string;\n buildTool: string;\n isReact: boolean;\n hasPatternFly: boolean;\n hasTypeScript: boolean;\n packageJson: any;\n}\n\nexport async function detectProject(cwd: string): Promise<ProjectInfo> {\n const packageJsonPath = path.join(cwd, 'package.json');\n \n let packageJson: any = {};\n try {\n const content = await fs.readFile(packageJsonPath, 'utf-8');\n packageJson = JSON.parse(content);\n } catch (error) {\n throw new Error('No package.json found. Are you in a Node.js project?');\n }\n\n const deps = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies\n };\n\n const buildTool = await detectBuildTool(cwd, deps);\n\n return {\n root: cwd,\n framework: detectFramework(deps),\n buildTool,\n isReact: !!deps['react'],\n hasPatternFly: !!deps['@patternfly/react-core'],\n hasTypeScript: !!deps['typescript'],\n packageJson\n };\n}\n\nfunction detectFramework(deps: any): string {\n if (deps['react']) return 'React';\n if (deps['vue']) return 'Vue';\n if (deps['@angular/core']) return 'Angular';\n return 'Unknown';\n}\n\nasync function detectBuildTool(cwd: string, deps: any): Promise<string> {\n if (deps['vite']) return 'Vite';\n if (deps['webpack']) return 'Webpack';\n \n try {\n await fs.access(path.join(cwd, 'next.config.js'));\n return 'Next.js';\n } catch {\n // Next.js config not found\n }\n\n return 'Unknown';\n}\n\nexport async function detectPlatform(cwd: string): Promise<string | null> {\n try {\n await fs.access(path.join(cwd, 'vercel.json'));\n return 'vercel';\n } catch {\n // Not Vercel\n }\n\n try {\n await fs.access(path.join(cwd, 'netlify.toml'));\n return 'netlify';\n } catch {\n // Not Netlify\n }\n\n return null;\n}\n\n","import chalk from 'chalk';\n\nexport function printWelcome() {\n console.log(chalk.bold.cyan('\\n🚀 Hale Commenting System Setup Wizard\\n'));\n}\n\nexport function printSetupInstructions(platform: string, project: any) {\n console.log(chalk.bold('\\n📝 Manual Setup Required:\\n'));\n\n console.log(chalk.cyan('1. Add the CommentProvider to your App.tsx:\\n'));\n \n console.log(chalk.white(`import {\n CommentProvider,\n VersionProvider,\n GitHubAuthProvider,\n CommentOverlay,\n CommentDrawer\n} from '@apollo/commenting-system';\nimport apolloCommentsConfig from './apollo-comments.config.json';\nimport React from 'react';\n\nfunction App() {\n const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);\n\n return (\n <GitHubAuthProvider config={apolloCommentsConfig}>\n <VersionProvider>\n <CommentProvider>\n <CommentDrawer \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n >\n <CommentOverlay \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n />\n {/* Your app content */}\n </CommentDrawer>\n </CommentProvider>\n </VersionProvider>\n </GitHubAuthProvider>\n );\n}\n`));\n\n console.log(chalk.cyan('\\n2. Deploy your serverless functions:\\n'));\n\n if (platform === 'vercel') {\n console.log(chalk.white(' vercel --prod'));\n } else if (platform === 'netlify') {\n console.log(chalk.white(' netlify deploy --prod'));\n } else {\n console.log(chalk.white(' Follow your platform\\'s deployment guide'));\n }\n\n console.log(chalk.cyan('\\n3. Update your GitHub OAuth App callback URL:\\n'));\n console.log(chalk.white(' https://your-domain.com/api/github-oauth-callback\\n'));\n}\n\nexport function printSuccess() {\n console.log(chalk.green.bold('\\n✓ Setup complete!\\n'));\n}\n\nexport function printNextSteps() {\n console.log(chalk.cyan('\\nNext steps:'));\n console.log(chalk.white('1. Review generated files in your project'));\n console.log(chalk.white('2. Add the CommentProvider to your App.tsx (see instructions above)'));\n console.log(chalk.white('3. Deploy your serverless functions'));\n console.log(chalk.white('4. Run: npm run dev\\n'));\n\n console.log(chalk.dim('Run \"hale-commenting-system validate\" to verify your setup.\\n'));\n}\n\nexport function printError(message: string) {\n console.log(chalk.red.bold(`\\n✗ Error: ${message}\\n`));\n}\n\nexport function printWarning(message: string) {\n console.log(chalk.yellow(`⚠️ ${message}`));\n}\n\n","import inquirer from 'inquirer';\nimport chalk from 'chalk';\nimport { detectPlatform } from '../utils/detect.js';\n\nexport async function promptPlatform(projectRoot: string): Promise<string> {\n // Auto-detect platform\n const detectedPlatform = await detectPlatform(projectRoot);\n\n if (detectedPlatform) {\n console.log(chalk.green(`✓ Detected ${detectedPlatform} configuration`));\n \n const { usePlatform } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'usePlatform',\n message: `Use ${detectedPlatform} for serverless functions?`,\n default: true\n }\n ]);\n\n if (usePlatform) {\n return detectedPlatform;\n }\n }\n\n const { platform } = await inquirer.prompt([\n {\n type: 'list',\n name: 'platform',\n message: 'Select your deployment platform:',\n choices: [\n { name: 'Vercel', value: 'vercel' },\n { name: 'Netlify', value: 'netlify' },\n { name: 'Manual (I will configure myself)', value: 'manual' }\n ]\n }\n ]);\n\n return platform;\n}\n\n","import inquirer from 'inquirer';\nimport chalk from 'chalk';\n\nexport interface GitHubConfig {\n clientId: string;\n clientSecret: string;\n owner: string;\n repo: string;\n}\n\nexport async function promptGitHubConfig(skipPrompts: boolean = false): Promise<GitHubConfig> {\n if (skipPrompts) {\n console.log(chalk.yellow('Using default/environment values...'));\n return {\n clientId: process.env.GITHUB_CLIENT_ID || '',\n clientSecret: process.env.GITHUB_CLIENT_SECRET || '',\n owner: process.env.GITHUB_OWNER || '',\n repo: process.env.GITHUB_REPO || ''\n };\n }\n\n console.log(chalk.bold('\\n📋 GitHub OAuth Configuration\\n'));\n console.log(chalk.dim('You need to create a GitHub OAuth App:'));\n console.log(chalk.dim('https://github.com/settings/developers\\n'));\n\n const answers = await inquirer.prompt<GitHubConfig>([\n {\n type: 'input',\n name: 'clientId',\n message: 'GitHub OAuth Client ID:',\n validate: (input: string) => input.length > 0 || 'Client ID is required'\n },\n {\n type: 'password',\n name: 'clientSecret',\n message: 'GitHub OAuth Client Secret:',\n mask: '*',\n validate: (input: string) => input.length > 0 || 'Client Secret is required'\n },\n {\n type: 'input',\n name: 'owner',\n message: 'GitHub Repository Owner (user or org):',\n validate: (input: string) => input.length > 0 || 'Owner is required'\n },\n {\n type: 'input',\n name: 'repo',\n message: 'GitHub Repository Name:',\n validate: (input: string) => input.length > 0 || 'Repository name is required'\n }\n ]);\n\n return answers;\n}\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { ensureDir, writeFile } from '../utils/fs.js';\nimport { vercelAuthLoginTemplate, vercelAuthCallbackTemplate } from '../templates/vercel-auth.js';\nimport { netlifyAuthLoginTemplate, netlifyAuthCallbackTemplate } from '../templates/netlify-auth.js';\n\nexport async function generateServerless(platform: string, projectRoot: string): Promise<void> {\n if (platform === 'vercel') {\n const apiDir = path.join(projectRoot, 'api');\n await ensureDir(apiDir);\n\n await writeFile(\n path.join(apiDir, 'github-oauth-login.ts'),\n vercelAuthLoginTemplate\n );\n\n await writeFile(\n path.join(apiDir, 'github-oauth-callback.ts'),\n vercelAuthCallbackTemplate\n );\n\n console.log(chalk.dim(' → Created api/github-oauth-login.ts'));\n console.log(chalk.dim(' → Created api/github-oauth-callback.ts'));\n } else if (platform === 'netlify') {\n const functionsDir = path.join(projectRoot, 'netlify', 'functions');\n await ensureDir(functionsDir);\n\n await writeFile(\n path.join(functionsDir, 'github-oauth-login.ts'),\n netlifyAuthLoginTemplate\n );\n\n await writeFile(\n path.join(functionsDir, 'github-oauth-callback.ts'),\n netlifyAuthCallbackTemplate\n );\n\n console.log(chalk.dim(' → Created netlify/functions/github-oauth-login.ts'));\n console.log(chalk.dim(' → Created netlify/functions/github-oauth-callback.ts'));\n } else {\n console.log(chalk.yellow(' Manual platform selected. You must create serverless functions yourself.'));\n console.log(chalk.dim(' See: https://github.com/apollo/commenting-system/blob/main/docs/manual-setup.md'));\n }\n}\n\n","import fs from 'fs/promises';\nimport path from 'path';\n\nexport async function fileExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function ensureDir(dirPath: string): Promise<void> {\n await fs.mkdir(dirPath, { recursive: true });\n}\n\nexport async function writeFileIfNotExists(filePath: string, content: string): Promise<boolean> {\n const exists = await fileExists(filePath);\n if (exists) {\n return false;\n }\n \n await fs.writeFile(filePath, content, 'utf-8');\n return true;\n}\n\nexport async function appendToFile(filePath: string, content: string): Promise<void> {\n await fs.appendFile(filePath, content, 'utf-8');\n}\n\nexport async function readFile(filePath: string): Promise<string> {\n return fs.readFile(filePath, 'utf-8');\n}\n\nexport async function writeFile(filePath: string, content: string): Promise<void> {\n await fs.writeFile(filePath, content, 'utf-8');\n}\n\nexport function getRelativePath(from: string, to: string): string {\n return path.relative(from, to);\n}\n\n","export const vercelAuthLoginTemplate = `import { VercelRequest, VercelResponse } from '@vercel/node';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse): Promise<void> {\n try {\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n \n if (!clientId) {\n res.status(500).json({ error: 'GitHub OAuth not configured - missing client ID' });\n return;\n }\n\n // Get the base URL from the request\n const protocol = (req.headers['x-forwarded-proto'] as string) || 'https';\n const host = (req.headers.host || req.headers['x-forwarded-host']) as string;\n \n if (!host) {\n res.status(500).json({ error: 'Could not determine host' });\n return;\n }\n \n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUri = \\`\\${baseUrl}/api/github-oauth-callback\\`;\n\n // Redirect to GitHub OAuth\n // Scope: public_repo allows read/write access to public repositories only\n const githubAuthUrl = \\`https://github.com/login/oauth/authorize?client_id=\\${clientId}&redirect_uri=\\${encodeURIComponent(redirectUri)}&scope=public_repo\\`;\n\n res.redirect(302, githubAuthUrl);\n } catch (error: any) {\n res.status(500).json({ \n error: 'Internal server error', \n details: error.message\n });\n }\n}\n`;\n\nexport const vercelAuthCallbackTemplate = `import { VercelRequest, VercelResponse } from '@vercel/node';\nimport axios from 'axios';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse): Promise<void> {\n try {\n const code = req.query.code as string;\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n const clientSecret = process.env.GITHUB_CLIENT_SECRET;\n\n if (!code) {\n res.status(400).json({ error: 'No code provided' });\n return;\n }\n\n if (!clientId || !clientSecret) {\n res.status(500).json({ error: 'GitHub OAuth not configured properly' });\n return;\n }\n\n // Exchange code for access token\n const tokenResponse = await axios.post(\n 'https://github.com/login/oauth/access_token',\n {\n client_id: clientId,\n client_secret: clientSecret,\n code,\n },\n {\n headers: {\n Accept: 'application/json',\n },\n }\n );\n\n const accessToken = tokenResponse.data.access_token;\n\n if (!accessToken) {\n throw new Error('No access token received');\n }\n\n // Get user info\n const userResponse = await axios.get('https://api.github.com/user', {\n headers: {\n Authorization: \\`token \\${accessToken}\\`,\n },\n });\n\n const user = userResponse.data;\n\n // Redirect back to the app with token in URL fragment (client-side only)\n const protocol = req.headers['x-forwarded-proto'] || 'https';\n const host = req.headers.host || req.headers['x-forwarded-host'];\n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUrl = \\`\\${baseUrl}/#/auth-callback?token=\\${accessToken}&login=\\${user.login}&avatar=\\${encodeURIComponent(user.avatar_url)}\\`;\n\n res.redirect(302, redirectUrl);\n } catch (error: any) {\n res.status(500).json({\n error: 'Failed to exchange code for token',\n details: error.message,\n });\n }\n}\n`;\n\n","export const netlifyAuthLoginTemplate = `import { Handler, HandlerEvent, HandlerContext } from '@netlify/functions';\nimport axios from 'axios';\n\nconst handler: Handler = async (event: HandlerEvent, context: HandlerContext) => {\n try {\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n \n if (!clientId) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'GitHub OAuth not configured - missing client ID' })\n };\n }\n\n // Get the base URL from the request\n const protocol = event.headers['x-forwarded-proto'] || 'https';\n const host = event.headers.host;\n \n if (!host) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'Could not determine host' })\n };\n }\n \n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUri = \\`\\${baseUrl}/.netlify/functions/github-oauth-callback\\`;\n\n // Redirect to GitHub OAuth\n const githubAuthUrl = \\`https://github.com/login/oauth/authorize?client_id=\\${clientId}&redirect_uri=\\${encodeURIComponent(redirectUri)}&scope=public_repo\\`;\n\n return {\n statusCode: 302,\n headers: {\n Location: githubAuthUrl\n },\n body: ''\n };\n } catch (error: any) {\n return {\n statusCode: 500,\n body: JSON.stringify({ \n error: 'Internal server error', \n details: error.message\n })\n };\n }\n};\n\nexport { handler };\n`;\n\nexport const netlifyAuthCallbackTemplate = `import { Handler, HandlerEvent, HandlerContext } from '@netlify/functions';\nimport axios from 'axios';\n\nconst handler: Handler = async (event: HandlerEvent, context: HandlerContext) => {\n try {\n const code = event.queryStringParameters?.code;\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n const clientSecret = process.env.GITHUB_CLIENT_SECRET;\n\n if (!code) {\n return {\n statusCode: 400,\n body: JSON.stringify({ error: 'No code provided' })\n };\n }\n\n if (!clientId || !clientSecret) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'GitHub OAuth not configured properly' })\n };\n }\n\n // Exchange code for access token\n const tokenResponse = await axios.post(\n 'https://github.com/login/oauth/access_token',\n {\n client_id: clientId,\n client_secret: clientSecret,\n code,\n },\n {\n headers: {\n Accept: 'application/json',\n },\n }\n );\n\n const accessToken = tokenResponse.data.access_token;\n\n if (!accessToken) {\n throw new Error('No access token received');\n }\n\n // Get user info\n const userResponse = await axios.get('https://api.github.com/user', {\n headers: {\n Authorization: \\`token \\${accessToken}\\`,\n },\n });\n\n const user = userResponse.data;\n\n // Redirect back to the app with token in URL fragment\n const protocol = event.headers['x-forwarded-proto'] || 'https';\n const host = event.headers.host;\n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUrl = \\`\\${baseUrl}/#/auth-callback?token=\\${accessToken}&login=\\${user.login}&avatar=\\${encodeURIComponent(user.avatar_url)}\\`;\n\n return {\n statusCode: 302,\n headers: {\n Location: redirectUrl\n },\n body: ''\n };\n } catch (error: any) {\n return {\n statusCode: 500,\n body: JSON.stringify({\n error: 'Failed to exchange code for token',\n details: error.message,\n })\n };\n }\n};\n\nexport { handler };\n`;\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { fileExists, appendToFile, writeFile, readFile } from '../utils/fs.js';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function generateEnvFiles(\n githubConfig: GitHubConfig, \n platform: string, \n projectRoot: string\n): Promise<void> {\n const envContent = `\n# Apollo Commenting System Configuration\n# Generated by apollo-comments CLI\n\n# GitHub OAuth\nGITHUB_CLIENT_ID=${githubConfig.clientId}\nGITHUB_CLIENT_SECRET=${githubConfig.clientSecret}\nGITHUB_OWNER=${githubConfig.owner}\nGITHUB_REPO=${githubConfig.repo}\n\n# Vite (if using Vite)\nVITE_GITHUB_CLIENT_ID=${githubConfig.clientId}\nVITE_GITHUB_OWNER=${githubConfig.owner}\nVITE_GITHUB_REPO=${githubConfig.repo}\n`;\n\n const envLocalPath = path.join(projectRoot, '.env.local');\n const envPath = path.join(projectRoot, '.env');\n\n // Check if .env.local exists and already contains GitHub config\n const envLocalExists = await fileExists(envLocalPath);\n \n if (envLocalExists) {\n const existingEnv = await readFile(envLocalPath);\n if (existingEnv.includes('GITHUB_CLIENT_ID')) {\n console.log(chalk.yellow(' .env.local already contains GitHub config. Skipping...'));\n } else {\n await appendToFile(envLocalPath, envContent);\n console.log(chalk.dim(' → Updated .env.local'));\n }\n } else {\n await writeFile(envLocalPath, envContent.trim());\n console.log(chalk.dim(' → Created .env.local'));\n }\n\n // Create .env.example without secrets\n const envExampleContent = `# Apollo Commenting System Configuration\n\n# GitHub OAuth (get from https://github.com/settings/developers)\nGITHUB_CLIENT_ID=your_client_id_here\nGITHUB_CLIENT_SECRET=your_client_secret_here\nGITHUB_OWNER=your_github_org\nGITHUB_REPO=your_repo_name\n\n# Vite (if using Vite)\nVITE_GITHUB_CLIENT_ID=your_client_id_here\nVITE_GITHUB_OWNER=your_github_org\nVITE_GITHUB_REPO=your_repo_name\n`;\n\n await writeFile(path.join(projectRoot, '.env.example'), envExampleContent);\n console.log(chalk.dim(' → Created .env.example'));\n\n // Add .env.local to .gitignore if not already present\n const gitignorePath = path.join(projectRoot, '.gitignore');\n if (await fileExists(gitignorePath)) {\n const gitignoreContent = await readFile(gitignorePath);\n if (!gitignoreContent.includes('.env.local')) {\n await appendToFile(gitignorePath, '\\n# Apollo Commenting System\\n.env.local\\n');\n console.log(chalk.dim(' → Updated .gitignore'));\n }\n }\n}\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { writeFile } from '../utils/fs.js';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function generateConfig(\n githubConfig: GitHubConfig,\n platform: string,\n projectRoot: string\n): Promise<void> {\n // Build redirect URI based on platform\n let redirectUri = 'http://localhost:9000/api/github-oauth-callback';\n \n if (platform === 'netlify') {\n redirectUri = 'https://your-domain.com/.netlify/functions/github-oauth-callback';\n } else if (platform === 'vercel') {\n redirectUri = 'https://your-domain.com/api/github-oauth-callback';\n }\n\n const config = {\n version: '1.0.0',\n platform,\n github: {\n owner: githubConfig.owner,\n repo: githubConfig.repo,\n clientId: githubConfig.clientId\n },\n redirectUri,\n features: {\n aiSummarization: true,\n versionTracking: true,\n gitlabIntegration: false\n },\n labels: [\n { name: 'comment', color: '0075ca', description: 'User feedback comment' },\n { name: 'prototype-feedback', color: 'd93f0b', description: 'Prototype feedback' },\n { name: 'needs-review', color: 'fbca04', description: 'Needs team review' }\n ]\n };\n\n const configPath = path.join(projectRoot, 'apollo-comments.config.json');\n await writeFile(configPath, JSON.stringify(config, null, 2));\n console.log(chalk.dim(' → Created apollo-comments.config.json'));\n}\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { readFile, writeFile, fileExists } from '../utils/fs.js';\n\ninterface IntegrationResult {\n success: boolean;\n filePath: string;\n message: string;\n}\n\nexport async function integrateProviders(projectRoot: string): Promise<IntegrationResult> {\n // Find the App entry point - try common locations\n const possiblePaths = [\n 'src/app/index.tsx',\n 'src/app/App.tsx',\n 'src/App.tsx',\n 'src/index.tsx'\n ];\n\n let appFilePath: string | null = null;\n \n for (const p of possiblePaths) {\n const fullPath = path.join(projectRoot, p);\n if (await fileExists(fullPath)) {\n appFilePath = fullPath;\n break;\n }\n }\n\n if (!appFilePath) {\n return {\n success: false,\n filePath: '',\n message: 'Could not find App entry point. Please integrate manually.'\n };\n }\n\n try {\n const content = await readFile(appFilePath);\n \n // Check if already integrated\n if (content.includes('hale-commenting-system') || content.includes('GitHubAuthProvider')) {\n return {\n success: false,\n filePath: appFilePath,\n message: 'Providers already integrated or commenting system imports found.'\n };\n }\n\n const modifiedContent = injectProviders(content);\n \n if (modifiedContent === content) {\n return {\n success: false,\n filePath: appFilePath,\n message: 'Could not automatically integrate. File structure not recognized.'\n };\n }\n\n await writeFile(appFilePath, modifiedContent);\n\n return {\n success: true,\n filePath: appFilePath,\n message: `Successfully integrated providers into ${path.relative(projectRoot, appFilePath)}`\n };\n } catch (error: any) {\n return {\n success: false,\n filePath: appFilePath,\n message: `Error: ${error.message}`\n };\n }\n}\n\nfunction injectProviders(content: string): string {\n // Add imports at the top (after existing imports)\n const imports = `import {\n CommentProvider,\n VersionProvider,\n GitHubAuthProvider,\n CommentOverlay,\n CommentDrawer\n} from 'hale-commenting-system';\nimport apolloCommentsConfig from './apollo-comments.config.json';`;\n\n // Find the last import statement\n const importRegex = /import\\s+.*?from\\s+['\"].*?['\"];?/g;\n const matches = content.match(importRegex);\n \n if (!matches || matches.length === 0) {\n // No imports found, add at the beginning\n content = imports + '\\n\\n' + content;\n } else {\n const lastImport = matches[matches.length - 1];\n const lastImportIndex = content.lastIndexOf(lastImport);\n const insertPosition = lastImportIndex + lastImport.length;\n content = content.slice(0, insertPosition) + '\\n\\n' + imports + content.slice(insertPosition);\n }\n\n // Find the return statement with Router/App structure\n // Look for patterns like: return ( <Router> or return <Router>\n const returnMatch = content.match(/return\\s*\\(?[\\s\\n]*<(\\w+)/);\n \n if (!returnMatch) {\n return content; // Can't find return statement\n }\n\n const componentName = returnMatch[1]; // Router, Fragment, etc.\n \n // Find the closing tag\n const closingTag = `</${componentName}>`;\n const closingIndex = content.indexOf(closingTag);\n \n if (closingIndex === -1) {\n return content; // Can't find closing tag\n }\n\n // Add state hook before return\n const stateHook = ` const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);\\n\\n`;\n \n // Find the function body (after function declaration)\n const functionMatch = content.match(/const\\s+\\w+.*?=.*?\\(\\).*?=>\\s*\\{/);\n if (functionMatch) {\n const insertPos = functionMatch.index! + functionMatch[0].length;\n content = content.slice(0, insertPos) + '\\n' + stateHook + content.slice(insertPos);\n }\n\n // Wrap the return content with providers\n const returnStartMatch = content.match(/return\\s*\\(/);\n if (returnStartMatch) {\n const returnStart = returnStartMatch.index! + returnStartMatch[0].length;\n const returnEnd = content.indexOf(closingTag, returnStart) + closingTag.length;\n \n const originalReturn = content.slice(returnStart, returnEnd);\n \n const wrappedReturn = `\n <GitHubAuthProvider config={apolloCommentsConfig}>\n <VersionProvider>\n <CommentProvider>\n <CommentDrawer \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n >\n <CommentOverlay \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n />\n ${originalReturn.trim()}\n </CommentDrawer>\n </CommentProvider>\n </VersionProvider>\n </GitHubAuthProvider>\n `;\n \n content = content.slice(0, returnStart) + wrappedReturn + content.slice(returnEnd);\n }\n\n return content;\n}\n\nexport function showIntegrationDiff(filePath: string) {\n console.log(chalk.cyan('\\nChanges made to your App file:'));\n console.log(chalk.white('• Added commenting system imports'));\n console.log(chalk.white('• Added state hook for comment thread selection'));\n console.log(chalk.white('• Wrapped app with GitHubAuthProvider, VersionProvider, and CommentProvider'));\n console.log(chalk.white('• Added CommentDrawer and CommentOverlay components\\n'));\n console.log(chalk.dim(`Modified: ${filePath}\\n`));\n}\n\n","import axios from 'axios';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function validateGitHubConnection(config: GitHubConfig): Promise<boolean> {\n try {\n // Test basic GitHub API connectivity\n const response = await axios.get('https://api.github.com/rate_limit', {\n headers: {\n 'Accept': 'application/vnd.github.v3+json'\n },\n timeout: 5000\n });\n return response.status === 200;\n } catch (error) {\n console.error('GitHub connection error:', error);\n return false;\n }\n}\n\n","import axios from 'axios';\nimport chalk from 'chalk';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function validateRepoAccess(config: GitHubConfig): Promise<boolean> {\n try {\n // Note: This checks if the repo exists publicly\n // Private repos would need authentication\n const response = await axios.get(\n `https://api.github.com/repos/${config.owner}/${config.repo}`,\n {\n headers: {\n 'Accept': 'application/vnd.github.v3+json'\n },\n timeout: 5000\n }\n );\n return response.status === 200;\n } catch (error: any) {\n if (error.response?.status === 404) {\n console.log(chalk.yellow(` Repository ${config.owner}/${config.repo} not found or is private`));\n console.log(chalk.yellow(' Note: Private repos require authentication at runtime'));\n // We'll allow this to proceed since private repos are valid\n return true;\n }\n console.error(' Repo access error:', error.message);\n return false;\n }\n}\n\n","import chalk from 'chalk';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nconst REQUIRED_LABELS = [\n { name: 'comment', color: '0075ca', description: 'User feedback comment' },\n { name: 'prototype-feedback', color: 'd93f0b', description: 'Prototype feedback' },\n { name: 'needs-review', color: 'fbca04', description: 'Needs team review' }\n];\n\nexport async function ensureLabels(config: GitHubConfig): Promise<void> {\n // Note: Creating labels requires authentication\n // For now, just inform the user about required labels\n console.log(chalk.dim('\\n Required labels for GitHub issues:'));\n REQUIRED_LABELS.forEach(label => {\n console.log(chalk.dim(` - ${label.name} (#${label.color}): ${label.description}`));\n });\n console.log(chalk.dim(' These will be created automatically at runtime with proper authentication.\\n'));\n}\n\nexport function getRequiredLabels() {\n return REQUIRED_LABELS;\n}\n\n","import chalk from 'chalk';\nimport ora from 'ora';\nimport path from 'path';\nimport { fileExists, readFile } from '../utils/fs.js';\nimport { validateGitHubConnection } from '../validators/github.js';\nimport { validateRepoAccess } from '../validators/repo.js';\n\nexport async function validateCommand() {\n console.log(chalk.bold.cyan('\\n🔍 Validating Apollo Commenting System Setup\\n'));\n\n const spinner = ora('Checking configuration files...').start();\n const cwd = process.cwd();\n\n // Check for config file\n const configPath = path.join(cwd, 'apollo-comments.config.json');\n const hasConfig = await fileExists(configPath);\n \n if (!hasConfig) {\n spinner.fail('Configuration file not found');\n console.log(chalk.red('\\n✗ apollo-comments.config.json not found'));\n console.log(chalk.dim(' Run: apollo-comments init\\n'));\n process.exit(1);\n }\n\n let config: any;\n try {\n const configContent = await readFile(configPath);\n config = JSON.parse(configContent);\n spinner.succeed('Configuration file found');\n } catch (error) {\n spinner.fail('Invalid configuration file');\n console.log(chalk.red('\\n✗ Could not parse apollo-comments.config.json\\n'));\n process.exit(1);\n }\n\n // Check for .env.local\n spinner.start('Checking environment files...');\n const envPath = path.join(cwd, '.env.local');\n const hasEnv = await fileExists(envPath);\n \n if (!hasEnv) {\n spinner.warn('Environment file not found (.env.local)');\n } else {\n spinner.succeed('Environment file found');\n }\n\n // Check for serverless functions\n spinner.start('Checking serverless functions...');\n let hasServerless = false;\n \n if (config.platform === 'vercel') {\n const apiDir = path.join(cwd, 'api');\n const loginPath = path.join(apiDir, 'github-oauth-login.ts');\n const callbackPath = path.join(apiDir, 'github-oauth-callback.ts');\n hasServerless = await fileExists(loginPath) && await fileExists(callbackPath);\n } else if (config.platform === 'netlify') {\n const functionsDir = path.join(cwd, 'netlify', 'functions');\n const loginPath = path.join(functionsDir, 'github-oauth-login.ts');\n const callbackPath = path.join(functionsDir, 'github-oauth-callback.ts');\n hasServerless = await fileExists(loginPath) && await fileExists(callbackPath);\n }\n\n if (!hasServerless && config.platform !== 'manual') {\n spinner.warn('Serverless functions not found');\n } else {\n spinner.succeed('Serverless functions found');\n }\n\n // Validate GitHub connection\n spinner.start('Validating GitHub connection...');\n const isValid = await validateGitHubConnection(config.github);\n if (!isValid) {\n spinner.fail('GitHub connection failed');\n console.log(chalk.red('\\n✗ Could not connect to GitHub API\\n'));\n process.exit(1);\n }\n spinner.succeed('GitHub connection validated');\n\n // Validate repo access\n spinner.start('Validating repository access...');\n const hasAccess = await validateRepoAccess(config.github);\n if (!hasAccess) {\n spinner.warn('Repository access could not be confirmed');\n } else {\n spinner.succeed('Repository access confirmed');\n }\n\n console.log(chalk.green.bold('\\n✓ Validation complete!\\n'));\n console.log(chalk.white('Your Apollo Commenting System setup looks good.\\n'));\n}\n\n"],"mappings":";;;AAAA,SAAS,eAAe;AACxB,OAAOA,aAAW;;;ACDlB,OAAOC,aAAW;AAClB,OAAO,SAAS;AAChB,OAAOC,eAAc;;;ACFrB,OAAO,QAAQ;AACf,OAAO,UAAU;AAYjB,eAAsB,cAAc,KAAmC;AACrE,QAAM,kBAAkB,KAAK,KAAK,KAAK,cAAc;AAErD,MAAI,cAAmB,CAAC;AACxB,MAAI;AACF,UAAM,UAAU,MAAM,GAAG,SAAS,iBAAiB,OAAO;AAC1D,kBAAc,KAAK,MAAM,OAAO;AAAA,EAClC,SAAS,OAAO;AACd,UAAM,IAAI,MAAM,sDAAsD;AAAA,EACxE;AAEA,QAAM,OAAO;AAAA,IACX,GAAG,YAAY;AAAA,IACf,GAAG,YAAY;AAAA,EACjB;AAEA,QAAM,YAAY,MAAM,gBAAgB,KAAK,IAAI;AAEjD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,WAAW,gBAAgB,IAAI;AAAA,IAC/B;AAAA,IACA,SAAS,CAAC,CAAC,KAAK,OAAO;AAAA,IACvB,eAAe,CAAC,CAAC,KAAK,wBAAwB;AAAA,IAC9C,eA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Q,MAAMA,QAAM,IAAI,iBAAY,GAAG,MAAM,OAAO;AACpD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,QAAQ,EAChB,YAAY,+BAA+B,EAC3C,OAAO,MAAM;AACZ,UAAQ,IAAIA,QAAM,OAAO,qDAA2C,CAAC;AACrE,UAAQ,IAAIA,QAAM,IAAI,8DAA8D,CAAC;AACvF,CAAC;AAGH,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,EAAE,QAAQ;AACjC,UAAQ,KAAK;AACf;AAEA,QAAQ,MAAM;","names":["chalk","chalk","inquirer","chalk","chalk","inquirer","chalk","path","chalk","fs","fs","fs","path","chalk","path","chalk","path","chalk","path","chalk","path","chalk","path","chalk","path","chalk","axios","chalk","chalk","chalk","inquirer","chalk","ora","path","chalk","ora","path","chalk"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/commands/init.ts","../src/utils/detect.ts","../src/utils/logger.ts","../src/prompts/platform.ts","../src/prompts/github.ts","../src/generators/serverless.ts","../src/utils/fs.ts","../src/templates/vercel-auth.ts","../src/templates/netlify-auth.ts","../src/generators/env.ts","../src/generators/config.ts","../src/generators/code.ts","../src/validators/github.ts","../src/validators/repo.ts","../src/validators/labels.ts","../src/commands/validate.ts"],"sourcesContent":["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { initCommand } from './commands/init.js';\nimport { validateCommand } from './commands/validate.js';\n\nconst program = new Command();\n\nprogram\n .name('hale-commenting-system')\n .description('Hale Commenting System CLI - Setup wizard and tooling')\n .version('1.0.0');\n\nprogram\n .command('init')\n .description('Initialize Apollo Commenting System in your project')\n .option('-y, --yes', 'Skip prompts and use defaults')\n .option('--platform <platform>', 'Target platform (vercel, netlify, manual)')\n .action(async (options) => {\n try {\n await initCommand(options);\n } catch (error: any) {\n console.error(chalk.red('\\n✗ Error:'), error.message);\n process.exit(1);\n }\n });\n\nprogram\n .command('validate')\n .description('Validate your commenting system setup')\n .action(async () => {\n try {\n await validateCommand();\n } catch (error: any) {\n console.error(chalk.red('\\n✗ Error:'), error.message);\n process.exit(1);\n }\n });\n\nprogram\n .command('update')\n .description('Update existing configuration')\n .action(() => {\n console.log(chalk.yellow('\\n⚠️ Coming soon: Update configuration\\n'));\n console.log(chalk.dim('For now, you can manually edit apollo-comments.config.json\\n'));\n });\n\n// Show help if no command provided\nif (!process.argv.slice(2).length) {\n program.help();\n}\n\nprogram.parse();\n\n","import chalk from 'chalk';\nimport ora from 'ora';\nimport inquirer from 'inquirer';\nimport { detectProject } from '../utils/detect.js';\nimport { printWelcome, printSetupInstructions, printSuccess, printNextSteps, printWarning } from '../utils/logger.js';\nimport { promptPlatform } from '../prompts/platform.js';\nimport { promptGitHubConfig } from '../prompts/github.js';\nimport { generateServerless } from '../generators/serverless.js';\nimport { generateEnvFiles } from '../generators/env.js';\nimport { generateConfig } from '../generators/config.js';\nimport { integrateProviders, showIntegrationDiff } from '../generators/code.js';\nimport { validateGitHubConnection } from '../validators/github.js';\nimport { validateRepoAccess } from '../validators/repo.js';\nimport { ensureLabels } from '../validators/labels.js';\n\ninterface InitOptions {\n yes?: boolean;\n platform?: string;\n}\n\nexport async function initCommand(options: InitOptions) {\n printWelcome();\n\n const spinner = ora('Detecting project...').start();\n\n // Step 1: Detect project type\n let project;\n try {\n project = await detectProject(process.cwd());\n spinner.succeed(`Detected: ${project.framework} with ${project.buildTool}`);\n } catch (error: any) {\n spinner.fail(error.message);\n process.exit(1);\n }\n\n if (!project.isReact) {\n spinner.fail('This package requires a React project');\n console.log(chalk.red('\\n✗ Apollo Commenting System requires React.\\n'));\n process.exit(1);\n }\n\n if (!project.hasPatternFly) {\n printWarning('PatternFly not detected. This package is optimized for PatternFly projects.');\n if (!options.yes) {\n const { continueAnyway } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'continueAnyway',\n message: 'Continue anyway?',\n default: false\n }\n ]);\n if (!continueAnyway) {\n console.log(chalk.dim('\\nSetup cancelled.\\n'));\n process.exit(0);\n }\n }\n }\n\n // Step 2: Select platform\n const platform = options.platform || await promptPlatform(project.root);\n\n // Step 3: Prompt for GitHub OAuth settings\n const githubConfig = await promptGitHubConfig(options.yes || false);\n\n // Step 4: Validate GitHub connection\n spinner.start('Validating GitHub connection...');\n const isValid = await validateGitHubConnection(githubConfig);\n if (!isValid) {\n spinner.fail('GitHub connection failed. Please check your internet connection.');\n process.exit(1);\n }\n spinner.succeed('GitHub connection validated');\n\n // Step 5: Validate repo access\n spinner.start('Checking repository access...');\n const hasAccess = await validateRepoAccess(githubConfig);\n if (!hasAccess) {\n spinner.fail('Cannot access repository. Check the owner/repo name.');\n process.exit(1);\n }\n spinner.succeed('Repository access confirmed');\n\n // Step 6: Ensure labels exist\n spinner.start('Checking issue labels...');\n await ensureLabels(githubConfig);\n spinner.succeed('Issue labels documented');\n\n // Step 7: Generate serverless functions\n spinner.start('Generating serverless functions...');\n try {\n await generateServerless(platform, project.root);\n spinner.succeed('Serverless functions created');\n } catch (error: any) {\n spinner.fail(`Failed to generate serverless functions: ${error.message}`);\n process.exit(1);\n }\n\n // Step 8: Generate environment files\n spinner.start('Creating environment files...');\n try {\n await generateEnvFiles(githubConfig, platform, project.root);\n spinner.succeed('Environment files created');\n } catch (error: any) {\n spinner.fail(`Failed to create environment files: ${error.message}`);\n process.exit(1);\n }\n\n // Step 9: Generate config file\n spinner.start('Creating hale-comments.config.json...');\n try {\n await generateConfig(githubConfig, platform, project.root);\n spinner.succeed('Configuration file created');\n } catch (error: any) {\n spinner.fail(`Failed to create config file: ${error.message}`);\n process.exit(1);\n }\n\n // Step 10: Offer auto-integration\n printSuccess();\n \n if (!options.yes) {\n const { autoIntegrate } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'autoIntegrate',\n message: 'Automatically integrate providers into your App file?',\n default: true\n }\n ]);\n\n if (autoIntegrate) {\n spinner.start('Integrating providers...');\n const result = await integrateProviders(project.root);\n \n if (result.success) {\n spinner.succeed('Providers integrated!');\n showIntegrationDiff(result.filePath);\n console.log(chalk.green('✓ Your app is ready to use the commenting system!\\n'));\n console.log(chalk.cyan('Next steps:'));\n console.log(chalk.white('1. Review the changes in your App file'));\n console.log(chalk.white('2. Start your dev server: npm run start:dev'));\n console.log(chalk.white('3. Open http://localhost:9000\\n'));\n } else {\n spinner.warn(result.message);\n console.log(chalk.yellow('\\nFalling back to manual integration:\\n'));\n printSetupInstructions(platform, project);\n printNextSteps();\n }\n } else {\n printSetupInstructions(platform, project);\n printNextSteps();\n }\n } else {\n // If --yes flag, skip integration and show manual instructions\n printSetupInstructions(platform, project);\n printNextSteps();\n }\n}\n\n","import fs from 'fs/promises';\nimport path from 'path';\n\nexport interface ProjectInfo {\n root: string;\n framework: string;\n buildTool: string;\n isReact: boolean;\n hasPatternFly: boolean;\n hasTypeScript: boolean;\n packageJson: any;\n}\n\nexport async function detectProject(cwd: string): Promise<ProjectInfo> {\n const packageJsonPath = path.join(cwd, 'package.json');\n \n let packageJson: any = {};\n try {\n const content = await fs.readFile(packageJsonPath, 'utf-8');\n packageJson = JSON.parse(content);\n } catch (error) {\n throw new Error('No package.json found. Are you in a Node.js project?');\n }\n\n const deps = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies\n };\n\n const buildTool = await detectBuildTool(cwd, deps);\n\n return {\n root: cwd,\n framework: detectFramework(deps),\n buildTool,\n isReact: !!deps['react'],\n hasPatternFly: !!deps['@patternfly/react-core'],\n hasTypeScript: !!deps['typescript'],\n packageJson\n };\n}\n\nfunction detectFramework(deps: any): string {\n if (deps['react']) return 'React';\n if (deps['vue']) return 'Vue';\n if (deps['@angular/core']) return 'Angular';\n return 'Unknown';\n}\n\nasync function detectBuildTool(cwd: string, deps: any): Promise<string> {\n if (deps['vite']) return 'Vite';\n if (deps['webpack']) return 'Webpack';\n \n try {\n await fs.access(path.join(cwd, 'next.config.js'));\n return 'Next.js';\n } catch {\n // Next.js config not found\n }\n\n return 'Unknown';\n}\n\nexport async function detectPlatform(cwd: string): Promise<string | null> {\n try {\n await fs.access(path.join(cwd, 'vercel.json'));\n return 'vercel';\n } catch {\n // Not Vercel\n }\n\n try {\n await fs.access(path.join(cwd, 'netlify.toml'));\n return 'netlify';\n } catch {\n // Not Netlify\n }\n\n return null;\n}\n\n","import chalk from 'chalk';\n\nexport function printWelcome() {\n console.log(chalk.bold.cyan('\\n🚀 Hale Commenting System Setup Wizard\\n'));\n}\n\nexport function printSetupInstructions(platform: string, project: any) {\n console.log(chalk.bold('\\n📝 Manual Setup Required:\\n'));\n\n console.log(chalk.cyan('1. Add the CommentProvider to your App.tsx:\\n'));\n \n console.log(chalk.white(`import {\n CommentProvider,\n VersionProvider,\n GitHubAuthProvider,\n CommentOverlay,\n CommentDrawer\n} from 'hale-commenting-system';\nimport haleCommentsConfig from './hale-comments.config.json';\nimport React from 'react';\n\nfunction App() {\n const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);\n\n return (\n <GitHubAuthProvider config={haleCommentsConfig}>\n <VersionProvider>\n <CommentProvider>\n <CommentDrawer \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n >\n <CommentOverlay \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n />\n {/* Your app content */}\n </CommentDrawer>\n </CommentProvider>\n </VersionProvider>\n </GitHubAuthProvider>\n );\n}\n`));\n\n console.log(chalk.cyan('\\n2. Deploy your serverless functions:\\n'));\n\n if (platform === 'vercel') {\n console.log(chalk.white(' vercel --prod'));\n } else if (platform === 'netlify') {\n console.log(chalk.white(' netlify deploy --prod'));\n } else {\n console.log(chalk.white(' Follow your platform\\'s deployment guide'));\n }\n\n console.log(chalk.cyan('\\n3. Update your GitHub OAuth App callback URL:\\n'));\n console.log(chalk.white(' https://your-domain.com/api/github-oauth-callback\\n'));\n}\n\nexport function printSuccess() {\n console.log(chalk.green.bold('\\n✓ Setup complete!\\n'));\n}\n\nexport function printNextSteps() {\n console.log(chalk.cyan('\\nNext steps:'));\n console.log(chalk.white('1. Review generated files in your project'));\n console.log(chalk.white('2. Add the CommentProvider to your App.tsx (see instructions above)'));\n console.log(chalk.white('3. Deploy your serverless functions'));\n console.log(chalk.white('4. Run: npm run dev\\n'));\n\n console.log(chalk.dim('Run \"hale-commenting-system validate\" to verify your setup.\\n'));\n}\n\nexport function printError(message: string) {\n console.log(chalk.red.bold(`\\n✗ Error: ${message}\\n`));\n}\n\nexport function printWarning(message: string) {\n console.log(chalk.yellow(`⚠️ ${message}`));\n}\n\n","import inquirer from 'inquirer';\nimport chalk from 'chalk';\nimport { detectPlatform } from '../utils/detect.js';\n\nexport async function promptPlatform(projectRoot: string): Promise<string> {\n // Auto-detect platform\n const detectedPlatform = await detectPlatform(projectRoot);\n\n if (detectedPlatform) {\n console.log(chalk.green(`✓ Detected ${detectedPlatform} configuration`));\n \n const { usePlatform } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'usePlatform',\n message: `Use ${detectedPlatform} for serverless functions?`,\n default: true\n }\n ]);\n\n if (usePlatform) {\n return detectedPlatform;\n }\n }\n\n const { platform } = await inquirer.prompt([\n {\n type: 'list',\n name: 'platform',\n message: 'Select your deployment platform:',\n choices: [\n { name: 'Local development (runs locally only)', value: 'local' },\n { name: 'Vercel', value: 'vercel' },\n { name: 'Netlify', value: 'netlify' },\n { name: 'Manual (I will configure myself)', value: 'manual' }\n ]\n }\n ]);\n\n return platform;\n}\n\n","import inquirer from 'inquirer';\nimport chalk from 'chalk';\n\nexport interface GitHubConfig {\n clientId: string;\n clientSecret: string;\n owner: string;\n repo: string;\n}\n\nexport async function promptGitHubConfig(skipPrompts: boolean = false): Promise<GitHubConfig> {\n if (skipPrompts) {\n console.log(chalk.yellow('Using default/environment values...'));\n return {\n clientId: process.env.GITHUB_CLIENT_ID || '',\n clientSecret: process.env.GITHUB_CLIENT_SECRET || '',\n owner: process.env.GITHUB_OWNER || '',\n repo: process.env.GITHUB_REPO || ''\n };\n }\n\n console.log(chalk.bold('\\n📋 GitHub OAuth Configuration\\n'));\n console.log(chalk.dim('You need to create a GitHub OAuth App:'));\n console.log(chalk.dim('https://github.com/settings/developers\\n'));\n\n const answers = await inquirer.prompt<GitHubConfig>([\n {\n type: 'input',\n name: 'clientId',\n message: 'GitHub OAuth Client ID:',\n validate: (input: string) => input.length > 0 || 'Client ID is required'\n },\n {\n type: 'password',\n name: 'clientSecret',\n message: 'GitHub OAuth Client Secret:',\n mask: '*',\n validate: (input: string) => input.length > 0 || 'Client Secret is required'\n },\n {\n type: 'input',\n name: 'owner',\n message: 'GitHub Repository Owner (user or org):',\n validate: (input: string) => input.length > 0 || 'Owner is required'\n },\n {\n type: 'input',\n name: 'repo',\n message: 'GitHub Repository Name:',\n validate: (input: string) => input.length > 0 || 'Repository name is required'\n }\n ]);\n\n return answers;\n}\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { ensureDir, writeFile } from '../utils/fs.js';\nimport { vercelAuthLoginTemplate, vercelAuthCallbackTemplate } from '../templates/vercel-auth.js';\nimport { netlifyAuthLoginTemplate, netlifyAuthCallbackTemplate } from '../templates/netlify-auth.js';\n\nexport async function generateServerless(platform: string, projectRoot: string): Promise<void> {\n if (platform === 'vercel' || platform === 'local') {\n const apiDir = path.join(projectRoot, 'api');\n await ensureDir(apiDir);\n\n await writeFile(\n path.join(apiDir, 'github-oauth-login.ts'),\n vercelAuthLoginTemplate\n );\n\n await writeFile(\n path.join(apiDir, 'github-oauth-callback.ts'),\n vercelAuthCallbackTemplate\n );\n\n console.log(chalk.dim(' → Created api/github-oauth-login.ts'));\n console.log(chalk.dim(' → Created api/github-oauth-callback.ts'));\n } else if (platform === 'netlify') {\n const functionsDir = path.join(projectRoot, 'netlify', 'functions');\n await ensureDir(functionsDir);\n\n await writeFile(\n path.join(functionsDir, 'github-oauth-login.ts'),\n netlifyAuthLoginTemplate\n );\n\n await writeFile(\n path.join(functionsDir, 'github-oauth-callback.ts'),\n netlifyAuthCallbackTemplate\n );\n\n console.log(chalk.dim(' → Created netlify/functions/github-oauth-login.ts'));\n console.log(chalk.dim(' → Created netlify/functions/github-oauth-callback.ts'));\n } else {\n console.log(chalk.yellow(' Manual platform selected. You must create serverless functions yourself.'));\n console.log(chalk.dim(' See: https://github.com/apollo/commenting-system/blob/main/docs/manual-setup.md'));\n }\n}\n\n","import fs from 'fs/promises';\nimport path from 'path';\n\nexport async function fileExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function ensureDir(dirPath: string): Promise<void> {\n await fs.mkdir(dirPath, { recursive: true });\n}\n\nexport async function writeFileIfNotExists(filePath: string, content: string): Promise<boolean> {\n const exists = await fileExists(filePath);\n if (exists) {\n return false;\n }\n \n await fs.writeFile(filePath, content, 'utf-8');\n return true;\n}\n\nexport async function appendToFile(filePath: string, content: string): Promise<void> {\n await fs.appendFile(filePath, content, 'utf-8');\n}\n\nexport async function readFile(filePath: string): Promise<string> {\n return fs.readFile(filePath, 'utf-8');\n}\n\nexport async function writeFile(filePath: string, content: string): Promise<void> {\n await fs.writeFile(filePath, content, 'utf-8');\n}\n\nexport function getRelativePath(from: string, to: string): string {\n return path.relative(from, to);\n}\n\n","export const vercelAuthLoginTemplate = `import { VercelRequest, VercelResponse } from '@vercel/node';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse): Promise<void> {\n try {\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n \n if (!clientId) {\n res.status(500).json({ error: 'GitHub OAuth not configured - missing client ID' });\n return;\n }\n\n // Get the base URL from the request\n const protocol = (req.headers['x-forwarded-proto'] as string) || 'https';\n const host = (req.headers.host || req.headers['x-forwarded-host']) as string;\n \n if (!host) {\n res.status(500).json({ error: 'Could not determine host' });\n return;\n }\n \n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUri = \\`\\${baseUrl}/api/github-oauth-callback\\`;\n\n // Redirect to GitHub OAuth\n // Scope: public_repo allows read/write access to public repositories only\n const githubAuthUrl = \\`https://github.com/login/oauth/authorize?client_id=\\${clientId}&redirect_uri=\\${encodeURIComponent(redirectUri)}&scope=public_repo\\`;\n\n res.redirect(302, githubAuthUrl);\n } catch (error: any) {\n res.status(500).json({ \n error: 'Internal server error', \n details: error.message\n });\n }\n}\n`;\n\nexport const vercelAuthCallbackTemplate = `import { VercelRequest, VercelResponse } from '@vercel/node';\nimport axios from 'axios';\n\nexport default async function handler(req: VercelRequest, res: VercelResponse): Promise<void> {\n try {\n const code = req.query.code as string;\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n const clientSecret = process.env.GITHUB_CLIENT_SECRET;\n\n if (!code) {\n res.status(400).json({ error: 'No code provided' });\n return;\n }\n\n if (!clientId || !clientSecret) {\n res.status(500).json({ error: 'GitHub OAuth not configured properly' });\n return;\n }\n\n // Exchange code for access token\n const tokenResponse = await axios.post(\n 'https://github.com/login/oauth/access_token',\n {\n client_id: clientId,\n client_secret: clientSecret,\n code,\n },\n {\n headers: {\n Accept: 'application/json',\n },\n }\n );\n\n const accessToken = tokenResponse.data.access_token;\n\n if (!accessToken) {\n throw new Error('No access token received');\n }\n\n // Get user info\n const userResponse = await axios.get('https://api.github.com/user', {\n headers: {\n Authorization: \\`token \\${accessToken}\\`,\n },\n });\n\n const user = userResponse.data;\n\n // Redirect back to the app with token in URL fragment (client-side only)\n const protocol = req.headers['x-forwarded-proto'] || 'https';\n const host = req.headers.host || req.headers['x-forwarded-host'];\n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUrl = \\`\\${baseUrl}/#/auth-callback?token=\\${accessToken}&login=\\${user.login}&avatar=\\${encodeURIComponent(user.avatar_url)}\\`;\n\n res.redirect(302, redirectUrl);\n } catch (error: any) {\n res.status(500).json({\n error: 'Failed to exchange code for token',\n details: error.message,\n });\n }\n}\n`;\n\n","export const netlifyAuthLoginTemplate = `import { Handler, HandlerEvent, HandlerContext } from '@netlify/functions';\nimport axios from 'axios';\n\nconst handler: Handler = async (event: HandlerEvent, context: HandlerContext) => {\n try {\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n \n if (!clientId) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'GitHub OAuth not configured - missing client ID' })\n };\n }\n\n // Get the base URL from the request\n const protocol = event.headers['x-forwarded-proto'] || 'https';\n const host = event.headers.host;\n \n if (!host) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'Could not determine host' })\n };\n }\n \n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUri = \\`\\${baseUrl}/.netlify/functions/github-oauth-callback\\`;\n\n // Redirect to GitHub OAuth\n const githubAuthUrl = \\`https://github.com/login/oauth/authorize?client_id=\\${clientId}&redirect_uri=\\${encodeURIComponent(redirectUri)}&scope=public_repo\\`;\n\n return {\n statusCode: 302,\n headers: {\n Location: githubAuthUrl\n },\n body: ''\n };\n } catch (error: any) {\n return {\n statusCode: 500,\n body: JSON.stringify({ \n error: 'Internal server error', \n details: error.message\n })\n };\n }\n};\n\nexport { handler };\n`;\n\nexport const netlifyAuthCallbackTemplate = `import { Handler, HandlerEvent, HandlerContext } from '@netlify/functions';\nimport axios from 'axios';\n\nconst handler: Handler = async (event: HandlerEvent, context: HandlerContext) => {\n try {\n const code = event.queryStringParameters?.code;\n const clientId = process.env.GITHUB_CLIENT_ID || process.env.VITE_GITHUB_CLIENT_ID;\n const clientSecret = process.env.GITHUB_CLIENT_SECRET;\n\n if (!code) {\n return {\n statusCode: 400,\n body: JSON.stringify({ error: 'No code provided' })\n };\n }\n\n if (!clientId || !clientSecret) {\n return {\n statusCode: 500,\n body: JSON.stringify({ error: 'GitHub OAuth not configured properly' })\n };\n }\n\n // Exchange code for access token\n const tokenResponse = await axios.post(\n 'https://github.com/login/oauth/access_token',\n {\n client_id: clientId,\n client_secret: clientSecret,\n code,\n },\n {\n headers: {\n Accept: 'application/json',\n },\n }\n );\n\n const accessToken = tokenResponse.data.access_token;\n\n if (!accessToken) {\n throw new Error('No access token received');\n }\n\n // Get user info\n const userResponse = await axios.get('https://api.github.com/user', {\n headers: {\n Authorization: \\`token \\${accessToken}\\`,\n },\n });\n\n const user = userResponse.data;\n\n // Redirect back to the app with token in URL fragment\n const protocol = event.headers['x-forwarded-proto'] || 'https';\n const host = event.headers.host;\n const baseUrl = \\`\\${protocol}://\\${host}\\`;\n const redirectUrl = \\`\\${baseUrl}/#/auth-callback?token=\\${accessToken}&login=\\${user.login}&avatar=\\${encodeURIComponent(user.avatar_url)}\\`;\n\n return {\n statusCode: 302,\n headers: {\n Location: redirectUrl\n },\n body: ''\n };\n } catch (error: any) {\n return {\n statusCode: 500,\n body: JSON.stringify({\n error: 'Failed to exchange code for token',\n details: error.message,\n })\n };\n }\n};\n\nexport { handler };\n`;\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { fileExists, appendToFile, writeFile, readFile } from '../utils/fs.js';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function generateEnvFiles(\n githubConfig: GitHubConfig, \n platform: string, \n projectRoot: string\n): Promise<void> {\n const envContent = `\n# Apollo Commenting System Configuration\n# Generated by apollo-comments CLI\n\n# GitHub OAuth\nGITHUB_CLIENT_ID=${githubConfig.clientId}\nGITHUB_CLIENT_SECRET=${githubConfig.clientSecret}\nGITHUB_OWNER=${githubConfig.owner}\nGITHUB_REPO=${githubConfig.repo}\n\n# Vite (if using Vite)\nVITE_GITHUB_CLIENT_ID=${githubConfig.clientId}\nVITE_GITHUB_OWNER=${githubConfig.owner}\nVITE_GITHUB_REPO=${githubConfig.repo}\n`;\n\n const envLocalPath = path.join(projectRoot, '.env.local');\n const envPath = path.join(projectRoot, '.env');\n\n // Check if .env.local exists and already contains GitHub config\n const envLocalExists = await fileExists(envLocalPath);\n \n if (envLocalExists) {\n const existingEnv = await readFile(envLocalPath);\n if (existingEnv.includes('GITHUB_CLIENT_ID')) {\n console.log(chalk.yellow(' .env.local already contains GitHub config. Skipping...'));\n } else {\n await appendToFile(envLocalPath, envContent);\n console.log(chalk.dim(' → Updated .env.local'));\n }\n } else {\n await writeFile(envLocalPath, envContent.trim());\n console.log(chalk.dim(' → Created .env.local'));\n }\n\n // Create .env.example without secrets\n const envExampleContent = `# Apollo Commenting System Configuration\n\n# GitHub OAuth (get from https://github.com/settings/developers)\nGITHUB_CLIENT_ID=your_client_id_here\nGITHUB_CLIENT_SECRET=your_client_secret_here\nGITHUB_OWNER=your_github_org\nGITHUB_REPO=your_repo_name\n\n# Vite (if using Vite)\nVITE_GITHUB_CLIENT_ID=your_client_id_here\nVITE_GITHUB_OWNER=your_github_org\nVITE_GITHUB_REPO=your_repo_name\n`;\n\n await writeFile(path.join(projectRoot, '.env.example'), envExampleContent);\n console.log(chalk.dim(' → Created .env.example'));\n\n // Add .env.local to .gitignore if not already present\n const gitignorePath = path.join(projectRoot, '.gitignore');\n if (await fileExists(gitignorePath)) {\n const gitignoreContent = await readFile(gitignorePath);\n if (!gitignoreContent.includes('.env.local')) {\n await appendToFile(gitignorePath, '\\n# Apollo Commenting System\\n.env.local\\n');\n console.log(chalk.dim(' → Updated .gitignore'));\n }\n }\n}\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { writeFile } from '../utils/fs.js';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function generateConfig(\n githubConfig: GitHubConfig,\n platform: string,\n projectRoot: string\n): Promise<void> {\n // Build redirect URI based on platform\n let redirectUri = 'http://localhost:9000/api/github-oauth-callback';\n \n if (platform === 'netlify') {\n redirectUri = 'https://your-domain.com/.netlify/functions/github-oauth-callback';\n } else if (platform === 'vercel') {\n redirectUri = 'https://your-domain.com/api/github-oauth-callback';\n }\n\n const config = {\n version: '1.0.0',\n platform,\n github: {\n owner: githubConfig.owner,\n repo: githubConfig.repo,\n clientId: githubConfig.clientId\n },\n redirectUri,\n features: {\n aiSummarization: true,\n versionTracking: true,\n gitlabIntegration: false\n },\n labels: [\n { name: 'comment', color: '0075ca', description: 'User feedback comment' },\n { name: 'prototype-feedback', color: 'd93f0b', description: 'Prototype feedback' },\n { name: 'needs-review', color: 'fbca04', description: 'Needs team review' }\n ]\n };\n\n const configPath = path.join(projectRoot, 'hale-comments.config.json');\n await writeFile(configPath, JSON.stringify(config, null, 2));\n console.log(chalk.dim(' → Created hale-comments.config.json'));\n}\n\n","import path from 'path';\nimport chalk from 'chalk';\nimport { readFile, writeFile, fileExists } from '../utils/fs.js';\n\ninterface IntegrationResult {\n success: boolean;\n filePath: string;\n message: string;\n}\n\nexport async function integrateProviders(projectRoot: string): Promise<IntegrationResult> {\n // Find the App entry point - try common locations\n const possiblePaths = [\n 'src/app/index.tsx',\n 'src/app/App.tsx',\n 'src/App.tsx',\n 'src/index.tsx'\n ];\n\n let appFilePath: string | null = null;\n \n for (const p of possiblePaths) {\n const fullPath = path.join(projectRoot, p);\n if (await fileExists(fullPath)) {\n appFilePath = fullPath;\n break;\n }\n }\n\n if (!appFilePath) {\n return {\n success: false,\n filePath: '',\n message: 'Could not find App entry point. Please integrate manually.'\n };\n }\n\n try {\n const content = await readFile(appFilePath);\n \n // Check if already integrated\n if (content.includes('hale-commenting-system') || content.includes('GitHubAuthProvider')) {\n return {\n success: false,\n filePath: appFilePath,\n message: 'Providers already integrated or commenting system imports found.'\n };\n }\n\n const modifiedContent = injectProviders(content);\n \n if (modifiedContent === content) {\n return {\n success: false,\n filePath: appFilePath,\n message: 'Could not automatically integrate. File structure not recognized.'\n };\n }\n\n await writeFile(appFilePath, modifiedContent);\n\n return {\n success: true,\n filePath: appFilePath,\n message: `Successfully integrated providers into ${path.relative(projectRoot, appFilePath)}`\n };\n } catch (error: any) {\n return {\n success: false,\n filePath: appFilePath,\n message: `Error: ${error.message}`\n };\n }\n}\n\nfunction injectProviders(content: string): string {\n // Add imports at the top (after existing imports)\n const imports = `import {\n CommentProvider,\n VersionProvider,\n GitHubAuthProvider,\n CommentOverlay,\n CommentDrawer\n} from 'hale-commenting-system';\nimport apolloCommentsConfig from './apollo-comments.config.json';`;\n\n // Find the last import statement\n const importRegex = /import\\s+.*?from\\s+['\"].*?['\"];?/g;\n const matches = content.match(importRegex);\n \n if (!matches || matches.length === 0) {\n // No imports found, add at the beginning\n content = imports + '\\n\\n' + content;\n } else {\n const lastImport = matches[matches.length - 1];\n const lastImportIndex = content.lastIndexOf(lastImport);\n const insertPosition = lastImportIndex + lastImport.length;\n content = content.slice(0, insertPosition) + '\\n\\n' + imports + content.slice(insertPosition);\n }\n\n // Find the return statement with Router/App structure\n // Look for patterns like: return ( <Router> or return <Router>\n const returnMatch = content.match(/return\\s*\\(?[\\s\\n]*<(\\w+)/);\n \n if (!returnMatch) {\n return content; // Can't find return statement\n }\n\n const componentName = returnMatch[1]; // Router, Fragment, etc.\n \n // Find the closing tag\n const closingTag = `</${componentName}>`;\n const closingIndex = content.indexOf(closingTag);\n \n if (closingIndex === -1) {\n return content; // Can't find closing tag\n }\n\n // Add state hook before return\n const stateHook = ` const [selectedThreadId, setSelectedThreadId] = React.useState<string | null>(null);\\n\\n`;\n \n // Find the function body (after function declaration)\n const functionMatch = content.match(/const\\s+\\w+.*?=.*?\\(\\).*?=>\\s*\\{/);\n if (functionMatch) {\n const insertPos = functionMatch.index! + functionMatch[0].length;\n content = content.slice(0, insertPos) + '\\n' + stateHook + content.slice(insertPos);\n }\n\n // Wrap the return content with providers\n const returnStartMatch = content.match(/return\\s*\\(/);\n if (returnStartMatch) {\n const returnStart = returnStartMatch.index! + returnStartMatch[0].length;\n const returnEnd = content.indexOf(closingTag, returnStart) + closingTag.length;\n \n const originalReturn = content.slice(returnStart, returnEnd);\n \n const wrappedReturn = `\n <GitHubAuthProvider config={apolloCommentsConfig}>\n <VersionProvider>\n <CommentProvider>\n <CommentDrawer \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n >\n <CommentOverlay \n selectedThreadId={selectedThreadId} \n onThreadSelect={setSelectedThreadId}\n />\n ${originalReturn.trim()}\n </CommentDrawer>\n </CommentProvider>\n </VersionProvider>\n </GitHubAuthProvider>\n `;\n \n content = content.slice(0, returnStart) + wrappedReturn + content.slice(returnEnd);\n }\n\n return content;\n}\n\nexport function showIntegrationDiff(filePath: string) {\n console.log(chalk.cyan('\\nChanges made to your App file:'));\n console.log(chalk.white('• Added commenting system imports'));\n console.log(chalk.white('• Added state hook for comment thread selection'));\n console.log(chalk.white('• Wrapped app with GitHubAuthProvider, VersionProvider, and CommentProvider'));\n console.log(chalk.white('• Added CommentDrawer and CommentOverlay components\\n'));\n console.log(chalk.dim(`Modified: ${filePath}\\n`));\n}\n\n","import axios from 'axios';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function validateGitHubConnection(config: GitHubConfig): Promise<boolean> {\n try {\n // Test basic GitHub API connectivity\n const response = await axios.get('https://api.github.com/rate_limit', {\n headers: {\n 'Accept': 'application/vnd.github.v3+json'\n },\n timeout: 5000\n });\n return response.status === 200;\n } catch (error) {\n console.error('GitHub connection error:', error);\n return false;\n }\n}\n\n","import axios from 'axios';\nimport chalk from 'chalk';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nexport async function validateRepoAccess(config: GitHubConfig): Promise<boolean> {\n try {\n // Note: This checks if the repo exists publicly\n // Private repos would need authentication\n const response = await axios.get(\n `https://api.github.com/repos/${config.owner}/${config.repo}`,\n {\n headers: {\n 'Accept': 'application/vnd.github.v3+json'\n },\n timeout: 5000\n }\n );\n return response.status === 200;\n } catch (error: any) {\n if (error.response?.status === 404) {\n console.log(chalk.yellow(` Repository ${config.owner}/${config.repo} not found or is private`));\n console.log(chalk.yellow(' Note: Private repos require authentication at runtime'));\n // We'll allow this to proceed since private repos are valid\n return true;\n }\n console.error(' Repo access error:', error.message);\n return false;\n }\n}\n\n","import chalk from 'chalk';\nimport type { GitHubConfig } from '../prompts/github.js';\n\nconst REQUIRED_LABELS = [\n { name: 'comment', color: '0075ca', description: 'User feedback comment' },\n { name: 'prototype-feedback', color: 'd93f0b', description: 'Prototype feedback' },\n { name: 'needs-review', color: 'fbca04', description: 'Needs team review' }\n];\n\nexport async function ensureLabels(config: GitHubConfig): Promise<void> {\n // Note: Creating labels requires authentication\n // For now, just inform the user about required labels\n console.log(chalk.dim('\\n Required labels for GitHub issues:'));\n REQUIRED_LABELS.forEach(label => {\n console.log(chalk.dim(` - ${label.name} (#${label.color}): ${label.description}`));\n });\n console.log(chalk.dim(' These will be created automatically at runtime with proper authentication.\\n'));\n}\n\nexport function getRequiredLabels() {\n return REQUIRED_LABELS;\n}\n\n","import chalk from 'chalk';\nimport ora from 'ora';\nimport path from 'path';\nimport { fileExists, readFile } from '../utils/fs.js';\nimport { validateGitHubConnection } from '../validators/github.js';\nimport { validateRepoAccess } from '../validators/repo.js';\n\nexport async function validateCommand() {\n console.log(chalk.bold.cyan('\\n🔍 Validating Apollo Commenting System Setup\\n'));\n\n const spinner = ora('Checking configuration files...').start();\n const cwd = process.cwd();\n\n // Check for config file\n const configPath = path.join(cwd, 'hale-comments.config.json');\n const hasConfig = await fileExists(configPath);\n \n if (!hasConfig) {\n spinner.fail('Configuration file not found');\n console.log(chalk.red('\\n✗ hale-comments.config.json not found'));\n console.log(chalk.dim(' Run: hale-commenting-system init\\n'));\n process.exit(1);\n }\n\n let config: any;\n try {\n const configContent = await readFile(configPath);\n config = JSON.parse(configContent);\n spinner.succeed('Configuration file found');\n } catch (error) {\n spinner.fail('Invalid configuration file');\n console.log(chalk.red('\\n✗ Could not parse hale-comments.config.json\\n'));\n process.exit(1);\n }\n\n // Check for .env.local\n spinner.start('Checking environment files...');\n const envPath = path.join(cwd, '.env.local');\n const hasEnv = await fileExists(envPath);\n \n if (!hasEnv) {\n spinner.warn('Environment file not found (.env.local)');\n } else {\n spinner.succeed('Environment file found');\n }\n\n // Check for serverless functions\n spinner.start('Checking serverless functions...');\n let hasServerless = false;\n \n if (config.platform === 'vercel') {\n const apiDir = path.join(cwd, 'api');\n const loginPath = path.join(apiDir, 'github-oauth-login.ts');\n const callbackPath = path.join(apiDir, 'github-oauth-callback.ts');\n hasServerless = await fileExists(loginPath) && await fileExists(callbackPath);\n } else if (config.platform === 'netlify') {\n const functionsDir = path.join(cwd, 'netlify', 'functions');\n const loginPath = path.join(functionsDir, 'github-oauth-login.ts');\n const callbackPath = path.join(functionsDir, 'github-oauth-callback.ts');\n hasServerless = await fileExists(loginPath) && await fileExists(callbackPath);\n }\n\n if (!hasServerless && config.platform !== 'manual') {\n spinner.warn('Serverless functions not found');\n } else {\n spinner.succeed('Serverless functions found');\n }\n\n // Validate GitHub connection\n spinner.start('Validating GitHub connection...');\n const isValid = await validateGitHubConnection(config.github);\n if (!isValid) {\n spinner.fail('GitHub connection failed');\n console.log(chalk.red('\\n✗ Could not connect to GitHub API\\n'));\n process.exit(1);\n }\n spinner.succeed('GitHub connection validated');\n\n // Validate repo access\n spinner.start('Validating repository access...');\n const hasAccess = await validateRepoAccess(config.github);\n if (!hasAccess) {\n spinner.warn('Repository access could not be confirmed');\n } else {\n spinner.succeed('Repository access confirmed');\n }\n\n console.log(chalk.green.bold('\\n✓ Validation complete!\\n'));\n console.log(chalk.white('Your Apollo Commenting System setup looks good.\\n'));\n}\n\n"],"mappings":";;;AAAA,SAAS,eAAe;AACxB,OAAOA,aAAW;;;ACDlB,OAAOC,aAAW;AAClB,OAAO,SAAS;AAChB,OAAOC,eAAc;;;ACFrB,OAAO,QAAQ;AACf,OAAO,UAAU;AAYjB,eAAsB,cAAc,KAAmC;AACrE,QAAM,kBAAkB,KAAK,KAAK,KAAK,cAAc;AAErD,MAAI,cAAmB,CAAC;AACxB,MAAI;AACF,UAAM,UAAU,MAAM,GAAG,SAAS,iBAAiB,OAAO;AAC1D,kBAAc,KAAK,MAAM,OAAO;AAAA,EAClC,SAAS,OAAO;AACd,UAAM,IAAI,MAAM,sDAAsD;AAAA,EACxE;AAEA,QAAM,OAAO;AAAA,IACX,GAAG,YAAY;AAAA,IACf,GAAG,YAAY;AAAA,EACjB;AAEA,QAAM,YAAY,MAAM,gBAAgB,KAAK,IAAI;AAEjD,SAAO;AAAA,IACL,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M,IAAI,iBAAY,GAAG,MAAM,OAAO;AACpD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,UAAU,EAClB,YAAY,uCAAuC,EACnD,OAAO,YAAY;AAClB,MAAI;AACF,UAAM,gBAAgB;AAAA,EACxB,SAAS,OAAY;AACnB,YAAQ,MAAMA,QAAM,IAAI,iBAAY,GAAG,MAAM,OAAO;AACpD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,QAAQ,EAChB,YAAY,+BAA+B,EAC3C,OAAO,MAAM;AACZ,UAAQ,IAAIA,QAAM,OAAO,qDAA2C,CAAC;AACrE,UAAQ,IAAIA,QAAM,IAAI,8DAA8D,CAAC;AACvF,CAAC;AAGH,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,EAAE,QAAQ;AACjC,UAAQ,KAAK;AACf;AAEA,QAAQ,MAAM;","names":["chalk","chalk","inquirer","chalk","chalk","inquirer","chalk","path","chalk","fs","fs","fs","path","chalk","path","chalk","path","chalk","path","chalk","path","chalk","path","chalk","path","chalk","axios","chalk","chalk","chalk","inquirer","chalk","ora","path","chalk","ora","path","chalk"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,87 +1,186 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
interface CommentOverlayProps {
|
|
4
4
|
selectedThreadId: string | null;
|
|
5
|
-
onThreadSelect: (
|
|
5
|
+
onThreadSelect: (id: string) => void;
|
|
6
6
|
}
|
|
7
|
-
declare const CommentOverlay: React.
|
|
7
|
+
declare const CommentOverlay: React.FunctionComponent<CommentOverlayProps>;
|
|
8
8
|
|
|
9
9
|
interface CommentDrawerProps {
|
|
10
|
-
selectedThreadId: string | null;
|
|
11
|
-
onThreadSelect: (threadId: string | null) => void;
|
|
12
10
|
children: React.ReactNode;
|
|
11
|
+
selectedThreadId: string | null;
|
|
12
|
+
onThreadSelect: (id: string | null) => void;
|
|
13
13
|
}
|
|
14
|
-
declare const CommentDrawer: React.
|
|
14
|
+
declare const CommentDrawer: React.FunctionComponent<CommentDrawerProps>;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
type SyncStatus = 'synced' | 'local' | 'pending' | 'syncing' | 'error';
|
|
17
|
+
interface Comment {
|
|
18
|
+
id: string;
|
|
19
|
+
author?: string;
|
|
20
|
+
text: string;
|
|
21
|
+
createdAt: string;
|
|
22
|
+
githubCommentId?: number;
|
|
23
|
+
}
|
|
24
|
+
interface Thread {
|
|
25
|
+
id: string;
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
route: string;
|
|
29
|
+
comments: Comment[];
|
|
30
|
+
issueNumber?: number;
|
|
31
|
+
syncStatus: SyncStatus;
|
|
32
|
+
syncError?: string;
|
|
33
|
+
version?: string;
|
|
34
|
+
provider?: 'github' | 'gitlab';
|
|
35
|
+
}
|
|
36
|
+
interface CommentContextType {
|
|
37
|
+
threads: Thread[];
|
|
38
|
+
showPins: boolean;
|
|
39
|
+
enableCommenting: boolean;
|
|
40
|
+
toggleShowPins: () => void;
|
|
41
|
+
toggleEnableCommenting: () => void;
|
|
42
|
+
addThread: (x: number, y: number, route: string, version?: string) => string;
|
|
43
|
+
addReply: (threadId: string, text: string) => Promise<void>;
|
|
44
|
+
updateComment: (threadId: string, commentId: string, text: string) => Promise<void>;
|
|
45
|
+
deleteComment: (threadId: string, commentId: string) => Promise<void>;
|
|
46
|
+
deleteThread: (threadId: string) => Promise<void>;
|
|
47
|
+
clearAllThreads: () => void;
|
|
48
|
+
getThreadsForRoute: (route: string, version?: string) => Thread[];
|
|
49
|
+
syncFromGitHub: (route: string) => Promise<void>;
|
|
50
|
+
retrySync: () => Promise<void>;
|
|
51
|
+
isSyncing: boolean;
|
|
52
|
+
hasPendingSync: boolean;
|
|
53
|
+
}
|
|
54
|
+
declare const CommentProvider: React.FunctionComponent<{
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
}>;
|
|
57
|
+
declare const useComments: () => CommentContextType;
|
|
17
58
|
|
|
18
|
-
|
|
59
|
+
interface CommentPinProps {
|
|
60
|
+
thread: Thread;
|
|
61
|
+
onPinClick: () => void;
|
|
62
|
+
isSelected?: boolean;
|
|
63
|
+
}
|
|
64
|
+
declare const CommentPin: React.FunctionComponent<CommentPinProps>;
|
|
19
65
|
|
|
20
|
-
declare const
|
|
66
|
+
declare const AIAssistant: React.FunctionComponent;
|
|
21
67
|
|
|
22
|
-
declare const
|
|
23
|
-
children: React.ReactNode;
|
|
24
|
-
}>;
|
|
25
|
-
declare const useComments: () => any;
|
|
68
|
+
declare const AIChatPanel: React.FunctionComponent;
|
|
26
69
|
|
|
27
|
-
|
|
70
|
+
interface VersionContextType {
|
|
71
|
+
currentVersion: string;
|
|
72
|
+
setCurrentVersion: (version: string) => void;
|
|
73
|
+
}
|
|
74
|
+
declare const VersionProvider: React.FunctionComponent<{
|
|
28
75
|
children: React.ReactNode;
|
|
29
76
|
}>;
|
|
30
|
-
declare const useVersion: () =>
|
|
77
|
+
declare const useVersion: () => VersionContextType;
|
|
31
78
|
|
|
79
|
+
interface GitHubUser {
|
|
80
|
+
login: string;
|
|
81
|
+
avatar: string;
|
|
82
|
+
}
|
|
83
|
+
interface GitHubAuthContextType {
|
|
84
|
+
user: GitHubUser | null;
|
|
85
|
+
isAuthenticated: boolean;
|
|
86
|
+
login: () => void;
|
|
87
|
+
logout: () => void;
|
|
88
|
+
}
|
|
32
89
|
declare const GitHubAuthProvider: React.FC<{
|
|
33
90
|
children: React.ReactNode;
|
|
34
|
-
config?: any;
|
|
35
91
|
}>;
|
|
36
|
-
declare const useGitHubAuth: () =>
|
|
92
|
+
declare const useGitHubAuth: () => GitHubAuthContextType;
|
|
37
93
|
|
|
94
|
+
interface GitLabUser {
|
|
95
|
+
username?: string;
|
|
96
|
+
avatar?: string;
|
|
97
|
+
}
|
|
98
|
+
interface GitLabAuthContextType {
|
|
99
|
+
user: GitLabUser | null;
|
|
100
|
+
isAuthenticated: boolean;
|
|
101
|
+
login: () => void;
|
|
102
|
+
logout: () => void;
|
|
103
|
+
getToken: () => string | null;
|
|
104
|
+
}
|
|
38
105
|
declare const GitLabAuthProvider: React.FC<{
|
|
39
106
|
children: React.ReactNode;
|
|
40
107
|
}>;
|
|
41
|
-
declare const useGitLabAuth: () =>
|
|
108
|
+
declare const useGitLabAuth: () => GitLabAuthContextType;
|
|
42
109
|
|
|
43
|
-
|
|
110
|
+
interface AIMessage {
|
|
111
|
+
id: string;
|
|
112
|
+
role: 'user' | 'bot';
|
|
113
|
+
content: string;
|
|
114
|
+
timestamp: string;
|
|
115
|
+
}
|
|
116
|
+
interface AIContextType {
|
|
117
|
+
isChatbotVisible: boolean;
|
|
118
|
+
messages: AIMessage[];
|
|
119
|
+
isLoading: boolean;
|
|
120
|
+
toggleChatbot: () => void;
|
|
121
|
+
sendMessage: (content: string, commentContext?: {
|
|
122
|
+
threads: any[];
|
|
123
|
+
version: string;
|
|
124
|
+
route?: string;
|
|
125
|
+
}) => Promise<void>;
|
|
126
|
+
clearHistory: () => void;
|
|
127
|
+
}
|
|
128
|
+
declare const AIProvider: React.FunctionComponent<{
|
|
44
129
|
children: React.ReactNode;
|
|
45
130
|
}>;
|
|
46
|
-
declare const useAIContext: () =>
|
|
131
|
+
declare const useAIContext: () => AIContextType;
|
|
47
132
|
|
|
48
|
-
declare const githubAdapter: {};
|
|
49
133
|
declare const isGitHubConfigured: () => boolean;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
interface Comment {
|
|
55
|
-
id: string;
|
|
56
|
-
text: string;
|
|
57
|
-
author: string;
|
|
58
|
-
timestamp: Date;
|
|
59
|
-
threadId: string;
|
|
60
|
-
}
|
|
61
|
-
interface Thread {
|
|
62
|
-
id: string;
|
|
63
|
-
comments: Comment[];
|
|
64
|
-
position: {
|
|
65
|
-
x: number;
|
|
66
|
-
y: number;
|
|
67
|
-
};
|
|
68
|
-
status: 'open' | 'resolved';
|
|
69
|
-
}
|
|
70
|
-
interface SyncStatus {
|
|
71
|
-
synced: boolean;
|
|
72
|
-
lastSync?: Date;
|
|
134
|
+
interface GitHubResult<T = any> {
|
|
135
|
+
success: boolean;
|
|
136
|
+
data?: T;
|
|
73
137
|
error?: string;
|
|
74
138
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
139
|
+
declare const githubAdapter: {
|
|
140
|
+
/**
|
|
141
|
+
* Create a new GitHub Issue for a comment thread
|
|
142
|
+
*/
|
|
143
|
+
createIssue(title: string, body: string, route: string, x: number, y: number, version?: string): Promise<GitHubResult>;
|
|
144
|
+
/**
|
|
145
|
+
* Add a comment to an existing GitHub Issue
|
|
146
|
+
*/
|
|
147
|
+
createComment(issueNumber: number, body: string): Promise<GitHubResult>;
|
|
148
|
+
/**
|
|
149
|
+
* Fetch all issues for a specific route
|
|
150
|
+
*/
|
|
151
|
+
fetchIssues(route: string): Promise<any>;
|
|
152
|
+
/**
|
|
153
|
+
* Fetch all comments for a specific issue
|
|
154
|
+
*/
|
|
155
|
+
fetchComments(issueNumber: number): Promise<any>;
|
|
156
|
+
/**
|
|
157
|
+
* Close a GitHub Issue (when deleting a thread)
|
|
158
|
+
*/
|
|
159
|
+
closeIssue(issueNumber: number): Promise<GitHubResult>;
|
|
160
|
+
/**
|
|
161
|
+
* Update an existing comment on a GitHub Issue
|
|
162
|
+
*/
|
|
163
|
+
updateComment(commentId: number, body: string): Promise<GitHubResult>;
|
|
164
|
+
/**
|
|
165
|
+
* Delete a comment on a GitHub Issue
|
|
166
|
+
*/
|
|
167
|
+
deleteComment(commentId: number): Promise<GitHubResult>;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
declare const isGitLabConfigured: () => boolean;
|
|
171
|
+
interface GitLabResult<T = any> {
|
|
82
172
|
success: boolean;
|
|
83
|
-
|
|
173
|
+
data?: T;
|
|
84
174
|
error?: string;
|
|
85
175
|
}
|
|
176
|
+
declare const gitlabAdapter: {
|
|
177
|
+
createIssue(title: string, body: string, route: string, x: number, y: number, version?: string): Promise<GitLabResult>;
|
|
178
|
+
createComment(issueNumber: number, body: string): Promise<GitLabResult>;
|
|
179
|
+
updateComment(commentId: number, body: string): Promise<GitLabResult>;
|
|
180
|
+
deleteComment(commentId: number): Promise<GitLabResult>;
|
|
181
|
+
closeIssue(issueNumber: number): Promise<GitLabResult>;
|
|
182
|
+
fetchIssues(route: string): Promise<any>;
|
|
183
|
+
fetchComments(issueNumber: number): Promise<any>;
|
|
184
|
+
};
|
|
86
185
|
|
|
87
186
|
export { AIAssistant, AIChatPanel, type AIMessage, AIProvider, type Comment, CommentDrawer, CommentOverlay, CommentPin, CommentProvider, GitHubAuthProvider, type GitHubResult, GitLabAuthProvider, type SyncStatus, type Thread, VersionProvider, githubAdapter, gitlabAdapter, isGitHubConfigured, isGitLabConfigured, useAIContext, useComments, useGitHubAuth, useGitLabAuth, useVersion };
|