mirror of
https://github.com/obra/episodic-memory.git
synced 2026-09-14 13:43:14 +08:00
024b0dfb32
Fix MCP server startup error by committing pre-built JavaScript files. The dist/ directory is now tracked in git to ensure built files are immediately available after plugin installation without requiring a build step. Changes: - Remove dist/ from .gitignore - Pre-build and commit all dist/ files - Bump version to 1.0.2 in package.json, plugin.json, marketplace.json - Update CHANGELOG.md Fixes: Error: Cannot find module 'dist/mcp-server.js'
57 lines
1.6 KiB
JavaScript
57 lines
1.6 KiB
JavaScript
import { readFileSync } from 'fs';
|
|
import { formatConversationAsMarkdown, formatConversationAsHTML } from './show.js';
|
|
const args = process.argv.slice(2);
|
|
// Parse arguments
|
|
let format = 'markdown';
|
|
let filePath = null;
|
|
for (let i = 0; i < args.length; i++) {
|
|
const arg = args[i];
|
|
if (arg === '--format' || arg === '-f') {
|
|
format = args[++i];
|
|
}
|
|
else if (arg === '--help' || arg === '-h') {
|
|
console.log(`
|
|
Usage: episodic-memory show [OPTIONS] <file>
|
|
|
|
Display a conversation from a JSONL file in a human-readable format.
|
|
|
|
OPTIONS:
|
|
--format, -f FORMAT Output format: markdown or html (default: markdown)
|
|
--help, -h Show this help
|
|
|
|
EXAMPLES:
|
|
# Show conversation as markdown
|
|
episodic-memory show conversation.jsonl
|
|
|
|
# Generate HTML for browser viewing
|
|
episodic-memory show --format html conversation.jsonl > output.html
|
|
|
|
# View with pipe
|
|
episodic-memory show conversation.jsonl | less
|
|
`);
|
|
process.exit(0);
|
|
}
|
|
else if (!filePath) {
|
|
filePath = arg;
|
|
}
|
|
}
|
|
if (!filePath) {
|
|
console.error('Error: No file specified');
|
|
console.error('Usage: episodic-memory show [OPTIONS] <file>');
|
|
console.error('Try: episodic-memory show --help');
|
|
process.exit(1);
|
|
}
|
|
try {
|
|
const jsonl = readFileSync(filePath, 'utf-8');
|
|
if (format === 'html') {
|
|
console.log(formatConversationAsHTML(jsonl));
|
|
}
|
|
else {
|
|
console.log(formatConversationAsMarkdown(jsonl));
|
|
}
|
|
}
|
|
catch (error) {
|
|
console.error(`Error reading file: ${error instanceof Error ? error.message : String(error)}`);
|
|
process.exit(1);
|
|
}
|