mirror of
https://github.com/blackboxprogramming/context-bridge.git
synced 2026-03-16 23:57:16 -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>
161 lines
3.4 KiB
Bash
Executable File
161 lines
3.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# lib/config.js
|
|
cat > lib/config.js << 'EOF'
|
|
const Conf = require('conf');
|
|
const path = require('path');
|
|
const os = require('os');
|
|
|
|
const config = new Conf({
|
|
projectName: 'context-bridge',
|
|
configName: 'config',
|
|
cwd: path.join(os.homedir(), '.context-bridge')
|
|
});
|
|
|
|
function getConfig() {
|
|
return {
|
|
token: config.get('github_token'),
|
|
gistId: config.get('gist_id'),
|
|
gistUrl: config.get('gist_url'),
|
|
rawUrl: config.get('raw_url'),
|
|
lastUpdated: config.get('last_updated'),
|
|
template: config.get('template'),
|
|
name: config.get('name')
|
|
};
|
|
}
|
|
|
|
function setConfig(key, value) {
|
|
config.set(key, value);
|
|
}
|
|
|
|
function clearConfig() {
|
|
config.clear();
|
|
}
|
|
|
|
module.exports = {
|
|
getConfig,
|
|
setConfig,
|
|
clearConfig,
|
|
config
|
|
};
|
|
EOF
|
|
|
|
# lib/gist.js
|
|
cat > lib/gist.js << 'EOF'
|
|
const { Octokit } = require('@octokit/rest');
|
|
const { getConfig } = require('./config');
|
|
|
|
async function createGist(content, description = 'My AI Context - Context Bridge') {
|
|
const config = getConfig();
|
|
if (!config.token) {
|
|
throw new Error('Not authenticated. Run: context login');
|
|
}
|
|
|
|
const octokit = new Octokit({ auth: config.token });
|
|
|
|
const { data } = await octokit.gists.create({
|
|
description,
|
|
public: false,
|
|
files: {
|
|
'CONTEXT.md': {
|
|
content
|
|
}
|
|
}
|
|
});
|
|
|
|
return {
|
|
id: data.id,
|
|
url: data.html_url,
|
|
rawUrl: data.files['CONTEXT.md'].raw_url
|
|
};
|
|
}
|
|
|
|
async function updateGist(content, message = null) {
|
|
const config = getConfig();
|
|
if (!config.token) {
|
|
throw new Error('Not authenticated. Run: context login');
|
|
}
|
|
if (!config.gistId) {
|
|
throw new Error('No context initialized. Run: context init');
|
|
}
|
|
|
|
const octokit = new Octokit({ auth: config.token });
|
|
|
|
const description = message
|
|
? `My AI Context - ${message} (${new Date().toISOString().split('T')[0]})`
|
|
: `My AI Context - Updated ${new Date().toISOString().split('T')[0]}`;
|
|
|
|
const { data } = await octokit.gists.update({
|
|
gist_id: config.gistId,
|
|
description,
|
|
files: {
|
|
'CONTEXT.md': {
|
|
content
|
|
}
|
|
}
|
|
});
|
|
|
|
return {
|
|
id: data.id,
|
|
url: data.html_url,
|
|
rawUrl: data.files['CONTEXT.md'].raw_url
|
|
};
|
|
}
|
|
|
|
async function getGist() {
|
|
const config = getConfig();
|
|
if (!config.token) {
|
|
throw new Error('Not authenticated. Run: context login');
|
|
}
|
|
if (!config.gistId) {
|
|
throw new Error('No context initialized. Run: context init');
|
|
}
|
|
|
|
const octokit = new Octokit({ auth: config.token });
|
|
|
|
const { data } = await octokit.gists.get({
|
|
gist_id: config.gistId
|
|
});
|
|
|
|
return {
|
|
content: data.files['CONTEXT.md'].content,
|
|
url: data.html_url,
|
|
rawUrl: data.files['CONTEXT.md'].raw_url,
|
|
updatedAt: data.updated_at,
|
|
revisions: data.history.length
|
|
};
|
|
}
|
|
|
|
async function getGistHistory(limit = 10) {
|
|
const config = getConfig();
|
|
if (!config.token) {
|
|
throw new Error('Not authenticated. Run: context login');
|
|
}
|
|
if (!config.gistId) {
|
|
throw new Error('No context initialized. Run: context init');
|
|
}
|
|
|
|
const octokit = new Octokit({ auth: config.token });
|
|
|
|
const { data } = await octokit.gists.get({
|
|
gist_id: config.gistId
|
|
});
|
|
|
|
return data.history.slice(0, limit).map(h => ({
|
|
version: h.version,
|
|
committedAt: h.committed_at,
|
|
changeStatus: h.change_status,
|
|
user: h.user.login
|
|
}));
|
|
}
|
|
|
|
module.exports = {
|
|
createGist,
|
|
updateGist,
|
|
getGist,
|
|
getGistHistory
|
|
};
|
|
EOF
|
|
|
|
echo "Created lib files"
|