mirror of
https://github.com/blackboxprogramming/context-bridge.git
synced 2026-03-17 07:57:21 -05:00
Agent Coordination: - Epimetheus (Architect) identity assigned and registered - Connected to PS-SHA-∞ memory system (4,059 entries) - Task claimed from marketplace - Broadcasting to other agents Launch Documentation Created: - PUBLISH_TO_NPM.md - Complete npm publishing guide - STRIPE_LIVE_SETUP.md - Stripe live mode setup guide - AGENT_COORDINATION_REPORT.md - Full status and next steps - EPIMETHEUS_SESSION_COMPLETE.md - Session summary - Added all previous documentation to repo Launch Status: 98% Complete Blocked on: User actions (npm login + Stripe products) Ready: Screenshots, testing, submissions, announcements Next Steps: 1. User: npm login && npm publish (10 min) 2. User: Create Stripe products (5 min) 3. Capture 5 screenshots (15 min) 4. Manual testing on 4 platforms (20 min) 5. Submit to Chrome Web Store (30 min) 6. Launch announcements (10 min) Total time to launch: ~90 minutes Agent Body: qwen2.5-coder:7b (open source) Memory Hash: 4e3d2012 Collaboration: ACTIVE Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
168 lines
4.5 KiB
JavaScript
168 lines
4.5 KiB
JavaScript
const inquirer = require('inquirer');
|
|
const chalk = require('chalk');
|
|
const ora = require('ora');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const { getConfig, setConfig } = require('../config');
|
|
const { createGist } = require('../gist');
|
|
|
|
async function init(options) {
|
|
console.log(chalk.bold.cyan('\n🌉 Create Your Context\n'));
|
|
|
|
const config = getConfig();
|
|
|
|
if (!config.token) {
|
|
console.log(chalk.yellow('⚠ Not authenticated. Please run:'), chalk.cyan('context login\n'));
|
|
return;
|
|
}
|
|
|
|
if (config.gistId) {
|
|
const { confirm } = await inquirer.prompt([
|
|
{
|
|
type: 'confirm',
|
|
name: 'confirm',
|
|
message: 'You already have a context. Create a new one?',
|
|
default: false
|
|
}
|
|
]);
|
|
|
|
if (!confirm) {
|
|
console.log(chalk.gray('Cancelled.\n'));
|
|
return;
|
|
}
|
|
}
|
|
|
|
const templates = [
|
|
{ name: 'Blank (start from scratch)', value: 'blank' },
|
|
{ name: 'Software Developer', value: 'developer' },
|
|
{ name: 'Product Manager', value: 'pm' },
|
|
{ name: 'Designer', value: 'designer' },
|
|
{ name: 'Writer', value: 'writer' },
|
|
{ name: 'Student', value: 'student' },
|
|
{ name: 'Entrepreneur', value: 'entrepreneur' }
|
|
];
|
|
|
|
const { template } = await inquirer.prompt([
|
|
{
|
|
type: 'list',
|
|
name: 'template',
|
|
message: 'Choose a template:',
|
|
choices: templates,
|
|
default: options.template || 'blank'
|
|
}
|
|
]);
|
|
|
|
const { name, role, project } = await inquirer.prompt([
|
|
{
|
|
type: 'input',
|
|
name: 'name',
|
|
message: 'Your name:',
|
|
default: config.name
|
|
},
|
|
{
|
|
type: 'input',
|
|
name: 'role',
|
|
message: 'Your role/title:',
|
|
when: template !== 'blank'
|
|
},
|
|
{
|
|
type: 'input',
|
|
name: 'project',
|
|
message: 'Current project/focus:',
|
|
when: template !== 'blank'
|
|
}
|
|
]);
|
|
|
|
let content;
|
|
if (template === 'blank') {
|
|
content = generateBlankContext(name);
|
|
} else {
|
|
const templatePath = path.join(__dirname, '../../templates', `${template}.md`);
|
|
if (fs.existsSync(templatePath)) {
|
|
content = fs.readFileSync(templatePath, 'utf-8');
|
|
// Safe replacement - no regex special chars issues
|
|
content = content
|
|
.split('[NAME]').join(name || 'Your Name')
|
|
.split('[ROLE]').join(role || 'Your role')
|
|
.split('[PROJECT]').join(project || 'Your current project')
|
|
.split('[DATE]').join(new Date().toISOString().split('T')[0]);
|
|
} else {
|
|
console.log(chalk.yellow(`⚠ Template not found: ${template}`));
|
|
content = generateBlankContext(name);
|
|
}
|
|
}
|
|
|
|
const spinner = ora('Creating your context...').start();
|
|
|
|
try {
|
|
const gist = await createGist(content);
|
|
|
|
setConfig('gist_id', gist.id);
|
|
setConfig('gist_url', gist.url);
|
|
setConfig('raw_url', gist.rawUrl);
|
|
setConfig('last_updated', new Date().toISOString());
|
|
setConfig('template', template);
|
|
setConfig('name', name);
|
|
|
|
spinner.succeed(chalk.green('Context created!'));
|
|
|
|
console.log(chalk.bold('\n📋 Your Context URLs:\n'));
|
|
console.log(`${chalk.gray('Gist:')} ${chalk.cyan(gist.url)}`);
|
|
console.log(`${chalk.gray('Raw:')} ${chalk.cyan(gist.rawUrl)}`);
|
|
|
|
console.log(chalk.bold('\n💡 How to use:\n'));
|
|
console.log(`1. ${chalk.cyan('context view')} - View your context`);
|
|
console.log(`2. ${chalk.cyan('context update')} - Edit and push changes`);
|
|
console.log(`3. ${chalk.cyan('context url')} - Get shareable URL`);
|
|
console.log(`\n4. In any AI chat, say: ${chalk.green(`"Read ${gist.rawUrl} first"`)}`);
|
|
console.log();
|
|
} catch (error) {
|
|
spinner.fail(chalk.red('Failed to create context'));
|
|
console.log(chalk.red(`Error: ${error.message}\n`));
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
function generateBlankContext(name) {
|
|
const date = new Date().toISOString().split('T')[0];
|
|
|
|
return `# ${name}'s Context
|
|
|
|
**Last Updated**: ${date}
|
|
**Active Work**: [Your current project]
|
|
**Status**: [Current status]
|
|
|
|
## Who I Am
|
|
- **Name**: ${name}
|
|
- **Role**: [Your role]
|
|
|
|
## Current Project
|
|
- **Project**: [Project name]
|
|
- **Stack**: [Technologies]
|
|
- **Goal**: [What you're building]
|
|
|
|
## My Preferences
|
|
- [How you like to work with AI]
|
|
- [Communication style]
|
|
- [Technical preferences]
|
|
|
|
## What I'm Working On Now
|
|
[Current task or focus]
|
|
|
|
## Recent Context
|
|
[What happened in last session]
|
|
|
|
## For AI Continuity
|
|
Read this file at the start of every conversation.
|
|
Update it at the end of each session with:
|
|
- What was completed
|
|
- What's next
|
|
- Current blockers
|
|
|
|
---
|
|
*Created with [Context Bridge](https://context-bridge.pages.dev)*
|
|
`;
|
|
}
|
|
|
|
module.exports = init;
|