mirror of
https://github.com/KeygraphHQ/shannon.git
synced 2026-04-01 10:20:53 +02:00
* chore: initialize TypeScript configuration and build setup - Add tsconfig.json for root and mcp-server with strict type checking - Install typescript and @types/node as devDependencies - Add npm build script for TypeScript compilation - Update main entrypoint to compiled dist/shannon.js - Update Dockerfile to build TypeScript before running - Configure output directory and module resolution for Node.js * refactor: migrate codebase from JavaScript to TypeScript - Convert all 37 JavaScript files to TypeScript (.js -> .ts) - Add type definitions in src/types/ for agents, config, errors, session - Update mcp-server with proper TypeScript types - Move entry point from shannon.mjs to src/shannon.ts - Update tsconfig.json with rootDir: "./src" for cleaner dist output - Update Dockerfile to build TypeScript before runtime - Update package.json paths to use compiled dist/shannon.js No runtime behavior changes - pure type safety migration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: update CLI references from ./shannon.mjs to shannon - Update help text in src/cli/ui.ts - Update usage examples in src/cli/command-handler.ts - Update setup message in src/shannon.ts - Update CLAUDE.md documentation with TypeScript file structure - Replace all ./shannon.mjs references with shannon command 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: remove unnecessary eslint-disable comments ESLint is not configured in this project, making these comments redundant. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
// Copyright (C) 2025 Keygraph, Inc.
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License version 3
|
|
// as published by the Free Software Foundation.
|
|
|
|
import chalk from 'chalk';
|
|
|
|
export class ProgressIndicator {
|
|
private message: string;
|
|
private frames: string[] = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
private frameIndex: number = 0;
|
|
private interval: ReturnType<typeof setInterval> | null = null;
|
|
private isRunning: boolean = false;
|
|
|
|
constructor(message: string = 'Working...') {
|
|
this.message = message;
|
|
}
|
|
|
|
start(): void {
|
|
if (this.isRunning) return;
|
|
|
|
this.isRunning = true;
|
|
this.frameIndex = 0;
|
|
|
|
this.interval = setInterval(() => {
|
|
// Clear the line and write the spinner
|
|
process.stdout.write(
|
|
`\r${chalk.cyan(this.frames[this.frameIndex])} ${chalk.dim(this.message)}`
|
|
);
|
|
this.frameIndex = (this.frameIndex + 1) % this.frames.length;
|
|
}, 100);
|
|
}
|
|
|
|
stop(): void {
|
|
if (!this.isRunning) return;
|
|
|
|
if (this.interval) {
|
|
clearInterval(this.interval);
|
|
this.interval = null;
|
|
}
|
|
|
|
// Clear the spinner line
|
|
process.stdout.write('\r' + ' '.repeat(this.message.length + 5) + '\r');
|
|
this.isRunning = false;
|
|
}
|
|
|
|
finish(successMessage: string = 'Complete'): void {
|
|
this.stop();
|
|
console.log(chalk.green(`✓ ${successMessage}`));
|
|
}
|
|
}
|