@codemieai/code 0.0.35 → 0.0.37
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/README.md +33 -0
- package/dist/agents/codemie-code/agent.d.ts +1 -1
- package/dist/agents/codemie-code/agent.d.ts.map +1 -1
- package/dist/agents/codemie-code/agent.js +2 -2
- package/dist/agents/codemie-code/agent.js.map +1 -1
- package/dist/agents/codemie-code/index.js +1 -1
- package/dist/agents/codemie-code/index.js.map +1 -1
- package/dist/agents/codemie-code/prompts.d.ts +1 -1
- package/dist/agents/codemie-code/prompts.d.ts.map +1 -1
- package/dist/agents/codemie-code/skills/core/SkillDiscovery.d.ts.map +1 -0
- package/dist/{skills → agents/codemie-code/skills}/core/SkillDiscovery.js +1 -1
- package/dist/agents/codemie-code/skills/core/SkillDiscovery.js.map +1 -0
- package/dist/agents/codemie-code/skills/core/SkillManager.d.ts.map +1 -0
- package/dist/{skills → agents/codemie-code/skills}/core/SkillManager.js +1 -1
- package/dist/agents/codemie-code/skills/core/SkillManager.js.map +1 -0
- package/dist/agents/codemie-code/skills/core/types.d.ts.map +1 -0
- package/dist/agents/codemie-code/skills/core/types.js.map +1 -0
- package/dist/agents/codemie-code/skills/index.d.ts.map +1 -0
- package/dist/agents/codemie-code/skills/index.js.map +1 -0
- package/dist/agents/codemie-code/skills/utils/content-loader.d.ts.map +1 -0
- package/dist/{skills → agents/codemie-code/skills}/utils/content-loader.js +1 -1
- package/dist/agents/codemie-code/skills/utils/content-loader.js.map +1 -0
- package/dist/agents/codemie-code/skills/utils/frontmatter.d.ts.map +1 -0
- package/dist/agents/codemie-code/skills/utils/frontmatter.js.map +1 -0
- package/dist/agents/codemie-code/skills/utils/pattern-matcher.d.ts.map +1 -0
- package/dist/agents/codemie-code/skills/utils/pattern-matcher.js.map +1 -0
- package/dist/agents/codemie-code/tools/assistant-invocation.d.ts.map +1 -1
- package/dist/agents/codemie-code/tools/assistant-invocation.js +2 -2
- package/dist/agents/codemie-code/tools/assistant-invocation.js.map +1 -1
- package/dist/agents/codemie-code/types.d.ts +1 -1
- package/dist/agents/codemie-code/types.d.ts.map +1 -1
- package/dist/agents/core/extension/BaseExtensionInstaller.d.ts.map +1 -1
- package/dist/agents/core/extension/BaseExtensionInstaller.js +11 -4
- package/dist/agents/core/extension/BaseExtensionInstaller.js.map +1 -1
- package/dist/agents/core/session/BaseProcessor.d.ts +22 -1
- package/dist/agents/core/session/BaseProcessor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude-acp.plugin.d.ts +5 -0
- package/dist/agents/plugins/claude/claude-acp.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude-acp.plugin.js +12 -2
- package/dist/agents/plugins/claude/claude-acp.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +5 -1
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/claude.session.d.ts +5 -0
- package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.session.js +101 -2
- package/dist/agents/plugins/claude/claude.session.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts +0 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +13 -19
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js +29 -4
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js.map +1 -1
- package/dist/cli/commands/assistants/chat.js +9 -6
- package/dist/cli/commands/assistants/chat.js.map +1 -1
- package/dist/cli/commands/assistants/constants.d.ts +2 -6
- package/dist/cli/commands/assistants/constants.d.ts.map +1 -1
- package/dist/cli/commands/assistants/constants.js +2 -5
- package/dist/cli/commands/assistants/constants.js.map +1 -1
- package/dist/cli/commands/assistants/index.d.ts.map +1 -1
- package/dist/cli/commands/assistants/index.js +1 -11
- package/dist/cli/commands/assistants/index.js.map +1 -1
- package/dist/cli/commands/assistants/setup/configuration/actions.d.ts +30 -0
- package/dist/cli/commands/assistants/setup/configuration/actions.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/actions.js +63 -0
- package/dist/cli/commands/assistants/setup/configuration/actions.js.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/constants.d.ts +49 -0
- package/dist/cli/commands/assistants/setup/configuration/constants.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/constants.js +56 -0
- package/dist/cli/commands/assistants/setup/configuration/constants.js.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/index.d.ts +9 -0
- package/dist/cli/commands/assistants/setup/configuration/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/index.js +8 -0
- package/dist/cli/commands/assistants/setup/configuration/index.js.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/selection.d.ts +12 -0
- package/dist/cli/commands/assistants/setup/configuration/selection.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/selection.js +94 -0
- package/dist/cli/commands/assistants/setup/configuration/selection.js.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/types.d.ts +22 -0
- package/dist/cli/commands/assistants/setup/configuration/types.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/types.js +2 -0
- package/dist/cli/commands/assistants/setup/configuration/types.js.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/ui.d.ts +9 -0
- package/dist/cli/commands/assistants/setup/configuration/ui.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/configuration/ui.js +86 -0
- package/dist/cli/commands/assistants/setup/configuration/ui.js.map +1 -0
- package/dist/cli/commands/assistants/setup/constants.d.ts +26 -0
- package/dist/cli/commands/assistants/setup/constants.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/constants.js +21 -0
- package/dist/cli/commands/assistants/setup/constants.js.map +1 -0
- package/dist/cli/commands/assistants/setup/data.d.ts +30 -0
- package/dist/cli/commands/assistants/setup/data.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/data.js +125 -0
- package/dist/cli/commands/assistants/setup/data.js.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.d.ts.map +1 -0
- package/dist/cli/commands/assistants/{generators → setup/generators}/claude-agent-generator.js +6 -2
- package/dist/cli/commands/assistants/setup/generators/claude-agent-generator.js.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts +12 -0
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js +94 -0
- package/dist/cli/commands/assistants/setup/generators/claude-skill-generator.js.map +1 -0
- package/dist/cli/commands/assistants/setup/helpers.d.ts +27 -0
- package/dist/cli/commands/assistants/setup/helpers.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/helpers.js +94 -0
- package/dist/cli/commands/assistants/setup/helpers.js.map +1 -0
- package/dist/cli/commands/assistants/setup/index.d.ts +17 -0
- package/dist/cli/commands/assistants/setup/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/index.js +193 -0
- package/dist/cli/commands/assistants/setup/index.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/actions.d.ts +47 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/actions.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/actions.js +140 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/actions.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/constants.d.ts +56 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/constants.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/constants.js +61 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/constants.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/index.d.ts +12 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/index.js +48 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/index.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.d.ts +6 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.js +90 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/interactive-prompt.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/types.d.ts +37 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/types.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/types.js +2 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/types.js.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.d.ts +6 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.js +103 -0
- package/dist/cli/commands/assistants/setup/manualConfiguration/ui.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/actions.d.ts +31 -0
- package/dist/cli/commands/assistants/setup/selection/actions.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/actions.js +321 -0
- package/dist/cli/commands/assistants/setup/selection/actions.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/constants.d.ts +79 -0
- package/dist/cli/commands/assistants/setup/selection/constants.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/constants.js +90 -0
- package/dist/cli/commands/assistants/setup/selection/constants.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/index.d.ts +25 -0
- package/dist/cli/commands/assistants/setup/selection/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/index.js +127 -0
- package/dist/cli/commands/assistants/setup/selection/index.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts +20 -0
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js +328 -0
- package/dist/cli/commands/assistants/setup/selection/interactive-prompt.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/types.d.ts +27 -0
- package/dist/cli/commands/assistants/setup/selection/types.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/types.js +2 -0
- package/dist/cli/commands/assistants/setup/selection/types.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/ui.d.ts +11 -0
- package/dist/cli/commands/assistants/setup/selection/ui.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/ui.js +189 -0
- package/dist/cli/commands/assistants/setup/selection/ui.js.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/utils.d.ts +36 -0
- package/dist/cli/commands/assistants/setup/selection/utils.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/selection/utils.js +55 -0
- package/dist/cli/commands/assistants/setup/selection/utils.js.map +1 -0
- package/dist/cli/commands/assistants/setup/summary/index.d.ts +16 -0
- package/dist/cli/commands/assistants/setup/summary/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/setup/summary/index.js +48 -0
- package/dist/cli/commands/assistants/setup/summary/index.js.map +1 -0
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +8 -0
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/log/cleaner.d.ts +33 -0
- package/dist/cli/commands/log/cleaner.d.ts.map +1 -0
- package/dist/cli/commands/log/cleaner.js +214 -0
- package/dist/cli/commands/log/cleaner.js.map +1 -0
- package/dist/cli/commands/log/filter.d.ts +55 -0
- package/dist/cli/commands/log/filter.d.ts.map +1 -0
- package/dist/cli/commands/log/filter.js +128 -0
- package/dist/cli/commands/log/filter.js.map +1 -0
- package/dist/cli/commands/log/follower.d.ts +36 -0
- package/dist/cli/commands/log/follower.d.ts.map +1 -0
- package/dist/cli/commands/log/follower.js +151 -0
- package/dist/cli/commands/log/follower.js.map +1 -0
- package/dist/cli/commands/log/formatter.d.ts +76 -0
- package/dist/cli/commands/log/formatter.d.ts.map +1 -0
- package/dist/cli/commands/log/formatter.js +261 -0
- package/dist/cli/commands/log/formatter.js.map +1 -0
- package/dist/cli/commands/log/index.d.ts +6 -0
- package/dist/cli/commands/log/index.d.ts.map +1 -0
- package/dist/cli/commands/log/index.js +398 -0
- package/dist/cli/commands/log/index.js.map +1 -0
- package/dist/cli/commands/log/parser.d.ts +20 -0
- package/dist/cli/commands/log/parser.d.ts.map +1 -0
- package/dist/cli/commands/log/parser.js +111 -0
- package/dist/cli/commands/log/parser.js.map +1 -0
- package/dist/cli/commands/log/reader.d.ts +61 -0
- package/dist/cli/commands/log/reader.d.ts.map +1 -0
- package/dist/cli/commands/log/reader.js +327 -0
- package/dist/cli/commands/log/reader.js.map +1 -0
- package/dist/cli/commands/log/types.d.ts +100 -0
- package/dist/cli/commands/log/types.d.ts.map +1 -0
- package/dist/cli/commands/log/types.js +5 -0
- package/dist/cli/commands/log/types.js.map +1 -0
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +2 -0
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/skill.js +1 -1
- package/dist/cli/commands/skill.js.map +1 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +8 -0
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/env/types.d.ts +1 -0
- package/dist/env/types.d.ts.map +1 -1
- package/dist/env/types.js.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.d.ts +5 -0
- package/dist/providers/plugins/sso/session/SessionSyncer.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.js +102 -3
- package/dist/providers/plugins/sso/session/SessionSyncer.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts +0 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.js +25 -48
- package/dist/providers/plugins/sso/session/processors/conversations/conversation-sync-processor.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js +8 -34
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-sync-processor.js.map +1 -1
- package/dist/utils/native-installer.d.ts +1 -0
- package/dist/utils/native-installer.d.ts.map +1 -1
- package/dist/utils/native-installer.js +60 -9
- package/dist/utils/native-installer.js.map +1 -1
- package/dist/utils/windows-path.d.ts +54 -0
- package/dist/utils/windows-path.d.ts.map +1 -0
- package/dist/utils/windows-path.js +347 -0
- package/dist/utils/windows-path.js.map +1 -0
- package/package.json +2 -2
- package/dist/cli/commands/assistants/generators/claude-agent-generator.d.ts.map +0 -1
- package/dist/cli/commands/assistants/generators/claude-agent-generator.js.map +0 -1
- package/dist/cli/commands/assistants/list.d.ts +0 -11
- package/dist/cli/commands/assistants/list.d.ts.map +0 -1
- package/dist/cli/commands/assistants/list.js +0 -323
- package/dist/cli/commands/assistants/list.js.map +0 -1
- package/dist/skills/core/SkillDiscovery.d.ts.map +0 -1
- package/dist/skills/core/SkillDiscovery.js.map +0 -1
- package/dist/skills/core/SkillManager.d.ts.map +0 -1
- package/dist/skills/core/SkillManager.js.map +0 -1
- package/dist/skills/core/types.d.ts.map +0 -1
- package/dist/skills/core/types.js.map +0 -1
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/utils/content-loader.d.ts.map +0 -1
- package/dist/skills/utils/content-loader.js.map +0 -1
- package/dist/skills/utils/frontmatter.d.ts.map +0 -1
- package/dist/skills/utils/frontmatter.js.map +0 -1
- package/dist/skills/utils/pattern-matcher.d.ts.map +0 -1
- package/dist/skills/utils/pattern-matcher.js.map +0 -1
- /package/dist/{skills → agents/codemie-code/skills}/core/SkillDiscovery.d.ts +0 -0
- /package/dist/{skills → agents/codemie-code/skills}/core/SkillManager.d.ts +0 -0
- /package/dist/{skills → agents/codemie-code/skills}/core/types.d.ts +0 -0
- /package/dist/{skills → agents/codemie-code/skills}/core/types.js +0 -0
- /package/dist/{skills → agents/codemie-code/skills}/index.d.ts +0 -0
- /package/dist/{skills → agents/codemie-code/skills}/index.js +0 -0
- /package/dist/{skills → agents/codemie-code/skills}/utils/content-loader.d.ts +0 -0
- /package/dist/{skills → agents/codemie-code/skills}/utils/frontmatter.d.ts +0 -0
- /package/dist/{skills → agents/codemie-code/skills}/utils/frontmatter.js +0 -0
- /package/dist/{skills → agents/codemie-code/skills}/utils/pattern-matcher.d.ts +0 -0
- /package/dist/{skills → agents/codemie-code/skills}/utils/pattern-matcher.js +0 -0
- /package/dist/cli/commands/assistants/{generators → setup/generators}/claude-agent-generator.d.ts +0 -0
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log command - View and manage logs and sessions
|
|
3
|
+
*/
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import { writeFileSync } from 'fs';
|
|
7
|
+
import { LogReader, SessionReader } from './reader.js';
|
|
8
|
+
import { LogFormatter } from './formatter.js';
|
|
9
|
+
import { LogFollower } from './follower.js';
|
|
10
|
+
import { LogCleaner } from './cleaner.js';
|
|
11
|
+
import { logger } from '../../../utils/logger.js';
|
|
12
|
+
export function createLogCommand() {
|
|
13
|
+
const command = new Command('log');
|
|
14
|
+
command
|
|
15
|
+
.description('View and manage debug logs and sessions')
|
|
16
|
+
.option('--session <id>', 'Filter by session ID')
|
|
17
|
+
.option('--agent <name>', 'Filter by agent (claude, gemini, etc.)')
|
|
18
|
+
.option('--profile <name>', 'Filter by profile name')
|
|
19
|
+
.option('--level <level>', 'Filter by log level (debug, info, warn, error)')
|
|
20
|
+
.option('--from <date>', 'Filter from date (YYYY-MM-DD)')
|
|
21
|
+
.option('--to <date>', 'Filter to date (YYYY-MM-DD)')
|
|
22
|
+
.option('--last <duration>', 'Filter last duration (e.g., 7d, 24h, 30m)')
|
|
23
|
+
.option('--grep <pattern>', 'Search pattern (supports regex)')
|
|
24
|
+
.option('-n, --lines <number>', 'Number of lines to show (default: 50)', '50')
|
|
25
|
+
.option('-v, --verbose', 'Show full details including session IDs and profiles')
|
|
26
|
+
.option('--format <format>', 'Output format (text, json, jsonl)', 'text')
|
|
27
|
+
.option('--no-color', 'Disable color output')
|
|
28
|
+
.option('-o, --output <path>', 'Write to file instead of stdout')
|
|
29
|
+
.action(async (options) => {
|
|
30
|
+
try {
|
|
31
|
+
await viewDebugLogs(options);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
logger.error('Log command failed:', error);
|
|
35
|
+
console.error(chalk.red(`\n✗ Failed: ${error instanceof Error ? error.message : String(error)}\n`));
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
// Subcommand: debug (alias for default behavior)
|
|
40
|
+
const debugCommand = new Command('debug');
|
|
41
|
+
debugCommand
|
|
42
|
+
.description('View debug logs (same as default log command)')
|
|
43
|
+
.option('--session <id>', 'Filter by session ID')
|
|
44
|
+
.option('--agent <name>', 'Filter by agent')
|
|
45
|
+
.option('--profile <name>', 'Filter by profile')
|
|
46
|
+
.option('--level <level>', 'Filter by log level')
|
|
47
|
+
.option('--from <date>', 'Filter from date')
|
|
48
|
+
.option('--to <date>', 'Filter to date')
|
|
49
|
+
.option('--last <duration>', 'Filter last duration')
|
|
50
|
+
.option('--grep <pattern>', 'Search pattern')
|
|
51
|
+
.option('-n, --lines <number>', 'Number of lines', '50')
|
|
52
|
+
.option('-v, --verbose', 'Show full details')
|
|
53
|
+
.option('--format <format>', 'Output format', 'text')
|
|
54
|
+
.option('--no-color', 'Disable color')
|
|
55
|
+
.option('-o, --output <path>', 'Output file')
|
|
56
|
+
.action(async (options) => {
|
|
57
|
+
try {
|
|
58
|
+
await viewDebugLogs(options);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
logger.error('Debug log command failed:', error);
|
|
62
|
+
console.error(chalk.red(`\n✗ Failed: ${error instanceof Error ? error.message : String(error)}\n`));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
command.addCommand(debugCommand);
|
|
67
|
+
// Subcommand: session <id>
|
|
68
|
+
const sessionCommand = new Command('session');
|
|
69
|
+
sessionCommand
|
|
70
|
+
.description('View specific session details')
|
|
71
|
+
.argument('<id>', 'Session ID')
|
|
72
|
+
.option('-v, --verbose', 'Show conversation details')
|
|
73
|
+
.option('--format <format>', 'Output format (text, json)', 'text')
|
|
74
|
+
.option('--no-color', 'Disable color')
|
|
75
|
+
.action(async (sessionId, options) => {
|
|
76
|
+
try {
|
|
77
|
+
await viewSession(sessionId, options);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
logger.error('Session view failed:', error);
|
|
81
|
+
console.error(chalk.red(`\n✗ Failed: ${error instanceof Error ? error.message : String(error)}\n`));
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
command.addCommand(sessionCommand);
|
|
86
|
+
// Subcommand: list-sessions
|
|
87
|
+
const listSessionsCommand = new Command('list-sessions');
|
|
88
|
+
listSessionsCommand
|
|
89
|
+
.description('List all sessions')
|
|
90
|
+
.option('--agent <name>', 'Filter by agent')
|
|
91
|
+
.option('--from <date>', 'Filter from date')
|
|
92
|
+
.option('--to <date>', 'Filter to date')
|
|
93
|
+
.option('--last <duration>', 'Filter last duration')
|
|
94
|
+
.option('--sort <field>', 'Sort by field (time, duration, agent)', 'time')
|
|
95
|
+
.option('--reverse', 'Reverse sort order')
|
|
96
|
+
.option('--format <format>', 'Output format (text, json)', 'text')
|
|
97
|
+
.option('--no-color', 'Disable color')
|
|
98
|
+
.action(async (options) => {
|
|
99
|
+
try {
|
|
100
|
+
await listSessions(options);
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
logger.error('List sessions failed:', error);
|
|
104
|
+
console.error(chalk.red(`\n✗ Failed: ${error instanceof Error ? error.message : String(error)}\n`));
|
|
105
|
+
process.exit(1);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
command.addCommand(listSessionsCommand);
|
|
109
|
+
// Subcommand: follow
|
|
110
|
+
const followCommand = new Command('follow');
|
|
111
|
+
followCommand
|
|
112
|
+
.description('Follow logs in real-time (tail -f style)')
|
|
113
|
+
.option('--agent <name>', 'Filter by agent')
|
|
114
|
+
.option('--level <level>', 'Filter by log level')
|
|
115
|
+
.option('--grep <pattern>', 'Search pattern')
|
|
116
|
+
.option('-v, --verbose', 'Show full details')
|
|
117
|
+
.option('--no-color', 'Disable color')
|
|
118
|
+
.action(async (options) => {
|
|
119
|
+
try {
|
|
120
|
+
await followLogs(options);
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
logger.error('Follow logs failed:', error);
|
|
124
|
+
console.error(chalk.red(`\n✗ Failed: ${error instanceof Error ? error.message : String(error)}\n`));
|
|
125
|
+
process.exit(1);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
command.addCommand(followCommand);
|
|
129
|
+
// Subcommand: clean
|
|
130
|
+
const cleanCommand = new Command('clean');
|
|
131
|
+
cleanCommand
|
|
132
|
+
.description('Clean up old logs and sessions')
|
|
133
|
+
.option('--days <number>', 'Retention period in days (default: 5)', '5')
|
|
134
|
+
.option('--sessions', 'Also delete old sessions (not just debug logs)')
|
|
135
|
+
.option('--dry-run', 'Preview what would be deleted without actually deleting')
|
|
136
|
+
.option('--yes', 'Skip confirmation prompt')
|
|
137
|
+
.action(async (options) => {
|
|
138
|
+
try {
|
|
139
|
+
await cleanLogs(options);
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
logger.error('Clean logs failed:', error);
|
|
143
|
+
console.error(chalk.red(`\n✗ Failed: ${error instanceof Error ? error.message : String(error)}\n`));
|
|
144
|
+
process.exit(1);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
command.addCommand(cleanCommand);
|
|
148
|
+
return command;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* View debug logs
|
|
152
|
+
*/
|
|
153
|
+
async function viewDebugLogs(options) {
|
|
154
|
+
const filter = parseFilterOptions(options);
|
|
155
|
+
const maxLines = parseInt(String(options.lines || '50'), 10);
|
|
156
|
+
// Read logs
|
|
157
|
+
const reader = new LogReader();
|
|
158
|
+
const entries = await reader.readLogs(filter, maxLines);
|
|
159
|
+
// Format output
|
|
160
|
+
const formatter = new LogFormatter({
|
|
161
|
+
format: options.format || 'text',
|
|
162
|
+
colorize: options.noColor !== true,
|
|
163
|
+
verbose: options.verbose || false
|
|
164
|
+
});
|
|
165
|
+
let output;
|
|
166
|
+
switch (options.format) {
|
|
167
|
+
case 'json':
|
|
168
|
+
output = formatter.formatJSON(entries);
|
|
169
|
+
break;
|
|
170
|
+
case 'jsonl':
|
|
171
|
+
output = formatter.formatJSONL(entries);
|
|
172
|
+
break;
|
|
173
|
+
default:
|
|
174
|
+
output = formatter.formatText(entries);
|
|
175
|
+
}
|
|
176
|
+
// Output to file or stdout
|
|
177
|
+
if (options.output) {
|
|
178
|
+
writeFileSync(options.output, output);
|
|
179
|
+
console.log(chalk.green(`\n✓ Logs written to ${options.output}\n`));
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
console.log(output);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* View specific session details
|
|
187
|
+
*/
|
|
188
|
+
async function viewSession(sessionId, options) {
|
|
189
|
+
const reader = new SessionReader();
|
|
190
|
+
// Read session metadata
|
|
191
|
+
const session = reader.readSession(sessionId);
|
|
192
|
+
if (!session) {
|
|
193
|
+
console.error(chalk.red(`\n✗ Session not found: ${sessionId}\n`));
|
|
194
|
+
process.exit(1);
|
|
195
|
+
}
|
|
196
|
+
// Read conversation if verbose
|
|
197
|
+
const conversation = options.verbose ? reader.readSessionConversation(sessionId) : undefined;
|
|
198
|
+
// Format output
|
|
199
|
+
const formatter = new LogFormatter({
|
|
200
|
+
format: options.format || 'text',
|
|
201
|
+
colorize: options.noColor !== true,
|
|
202
|
+
verbose: options.verbose || false
|
|
203
|
+
});
|
|
204
|
+
if (options.format === 'json') {
|
|
205
|
+
const output = JSON.stringify({ session, conversation }, null, 2);
|
|
206
|
+
console.log(output);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
const output = formatter.formatSession(session, conversation);
|
|
210
|
+
console.log(output);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* List all sessions
|
|
215
|
+
*/
|
|
216
|
+
async function listSessions(options) {
|
|
217
|
+
const filter = parseFilterOptions(options);
|
|
218
|
+
const reader = new SessionReader();
|
|
219
|
+
// Read sessions
|
|
220
|
+
let sessions = reader.listSessions(filter);
|
|
221
|
+
// Convert to list entries
|
|
222
|
+
const entries = sessions.map(s => ({
|
|
223
|
+
sessionId: s.sessionId,
|
|
224
|
+
agentName: s.agentName,
|
|
225
|
+
startTime: new Date(s.startTime),
|
|
226
|
+
duration: s.endTime ? s.endTime - s.startTime : undefined,
|
|
227
|
+
status: s.status,
|
|
228
|
+
workingDirectory: s.workingDirectory,
|
|
229
|
+
gitBranch: s.gitBranch
|
|
230
|
+
}));
|
|
231
|
+
// Sort
|
|
232
|
+
const sortField = options.sort || 'time';
|
|
233
|
+
entries.sort((a, b) => {
|
|
234
|
+
let comparison = 0;
|
|
235
|
+
switch (sortField) {
|
|
236
|
+
case 'duration':
|
|
237
|
+
comparison = (a.duration || 0) - (b.duration || 0);
|
|
238
|
+
break;
|
|
239
|
+
case 'agent':
|
|
240
|
+
comparison = a.agentName.localeCompare(b.agentName);
|
|
241
|
+
break;
|
|
242
|
+
case 'time':
|
|
243
|
+
default:
|
|
244
|
+
comparison = a.startTime.getTime() - b.startTime.getTime();
|
|
245
|
+
}
|
|
246
|
+
return options.reverse ? -comparison : comparison;
|
|
247
|
+
});
|
|
248
|
+
// Format output
|
|
249
|
+
const formatter = new LogFormatter({
|
|
250
|
+
format: options.format || 'text',
|
|
251
|
+
colorize: options.noColor !== true,
|
|
252
|
+
verbose: false
|
|
253
|
+
});
|
|
254
|
+
if (options.format === 'json') {
|
|
255
|
+
console.log(JSON.stringify(entries, null, 2));
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
const output = formatter.formatSessionList(entries);
|
|
259
|
+
console.log(output);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Follow logs in real-time
|
|
264
|
+
*/
|
|
265
|
+
async function followLogs(options) {
|
|
266
|
+
const filter = parseFilterOptions(options);
|
|
267
|
+
const reader = new LogReader();
|
|
268
|
+
const logFile = reader.getMostRecentLogFile();
|
|
269
|
+
if (!logFile) {
|
|
270
|
+
console.error(chalk.red('\n✗ No log file found for today\n'));
|
|
271
|
+
console.error(chalk.dim('Debug logs are created when agents run.\n'));
|
|
272
|
+
process.exit(1);
|
|
273
|
+
}
|
|
274
|
+
const formatter = new LogFormatter({
|
|
275
|
+
format: 'text',
|
|
276
|
+
colorize: options.noColor !== true,
|
|
277
|
+
verbose: options.verbose || false
|
|
278
|
+
});
|
|
279
|
+
console.log(chalk.cyan(`\nFollowing logs: ${logFile}`));
|
|
280
|
+
console.log(chalk.dim('Press Ctrl+C to stop\n'));
|
|
281
|
+
const follower = new LogFollower(formatter, filter);
|
|
282
|
+
await follower.follow(logFile);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Clean old logs
|
|
286
|
+
*/
|
|
287
|
+
async function cleanLogs(options) {
|
|
288
|
+
const retentionDays = parseInt(String(options.days || '5'), 10);
|
|
289
|
+
const includeSessions = options.sessions || false;
|
|
290
|
+
const dryRun = options.dryRun || false;
|
|
291
|
+
// Confirmation prompt (unless --yes or --dry-run)
|
|
292
|
+
if (!dryRun && !options.yes) {
|
|
293
|
+
console.log(chalk.yellow('\n⚠️ Warning: This will permanently delete files.\n'));
|
|
294
|
+
console.log(` Retention period: ${retentionDays} days`);
|
|
295
|
+
console.log(` Debug logs: Will be deleted`);
|
|
296
|
+
console.log(` Sessions: ${includeSessions ? 'Will be deleted' : 'Will NOT be deleted'}\n`);
|
|
297
|
+
console.log(chalk.dim('Run with --dry-run to preview what would be deleted.\n'));
|
|
298
|
+
console.log(chalk.dim('Run with --yes to skip this confirmation.\n'));
|
|
299
|
+
process.exit(1);
|
|
300
|
+
}
|
|
301
|
+
// Perform cleanup
|
|
302
|
+
const cleaner = new LogCleaner();
|
|
303
|
+
const stats = cleaner.clean(retentionDays, includeSessions, dryRun);
|
|
304
|
+
// Format output
|
|
305
|
+
const formatter = new LogFormatter({ colorize: options.noColor !== true, format: 'text', verbose: false });
|
|
306
|
+
const output = formatter.formatCleanupStats(stats, dryRun);
|
|
307
|
+
console.log(output);
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Parse filter options from command line arguments
|
|
311
|
+
*/
|
|
312
|
+
function parseFilterOptions(options) {
|
|
313
|
+
const filter = {};
|
|
314
|
+
if (options.session) {
|
|
315
|
+
filter.sessionId = options.session;
|
|
316
|
+
}
|
|
317
|
+
if (options.agent) {
|
|
318
|
+
filter.agent = options.agent;
|
|
319
|
+
}
|
|
320
|
+
if (options.profile) {
|
|
321
|
+
filter.profile = options.profile;
|
|
322
|
+
}
|
|
323
|
+
if (options.level) {
|
|
324
|
+
filter.level = options.level;
|
|
325
|
+
}
|
|
326
|
+
// Parse date filters
|
|
327
|
+
if (options.from) {
|
|
328
|
+
const fromDate = parseDate(options.from);
|
|
329
|
+
if (!fromDate) {
|
|
330
|
+
console.warn(chalk.yellow(`Warning: Invalid --from date "${options.from}", ignoring filter`));
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
filter.fromDate = fromDate;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
if (options.to) {
|
|
337
|
+
const toDate = parseDate(options.to);
|
|
338
|
+
if (!toDate) {
|
|
339
|
+
console.warn(chalk.yellow(`Warning: Invalid --to date "${options.to}", ignoring filter`));
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
filter.toDate = toDate;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
// Parse --last duration
|
|
346
|
+
if (options.last) {
|
|
347
|
+
const duration = parseDuration(options.last);
|
|
348
|
+
if (!duration) {
|
|
349
|
+
console.warn(chalk.yellow(`Warning: Invalid --last duration "${options.last}", ignoring filter`));
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
filter.fromDate = new Date(Date.now() - duration);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
// Parse --grep pattern
|
|
356
|
+
if (options.grep) {
|
|
357
|
+
filter.pattern = options.grep;
|
|
358
|
+
filter.isRegex = false; // Simple string search for now
|
|
359
|
+
}
|
|
360
|
+
return filter;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Parse date string (YYYY-MM-DD) to Date object
|
|
364
|
+
*/
|
|
365
|
+
function parseDate(dateStr) {
|
|
366
|
+
try {
|
|
367
|
+
const date = new Date(dateStr);
|
|
368
|
+
if (isNaN(date.getTime())) {
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
371
|
+
return date;
|
|
372
|
+
}
|
|
373
|
+
catch {
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Parse duration string (e.g., "7d", "24h", "30m") to milliseconds
|
|
379
|
+
*/
|
|
380
|
+
function parseDuration(durationStr) {
|
|
381
|
+
const match = durationStr.match(/^(\d+)([dhm])$/);
|
|
382
|
+
if (!match) {
|
|
383
|
+
return null;
|
|
384
|
+
}
|
|
385
|
+
const value = parseInt(match[1], 10);
|
|
386
|
+
const unit = match[2];
|
|
387
|
+
switch (unit) {
|
|
388
|
+
case 'd':
|
|
389
|
+
return value * 24 * 60 * 60 * 1000;
|
|
390
|
+
case 'h':
|
|
391
|
+
return value * 60 * 60 * 1000;
|
|
392
|
+
case 'm':
|
|
393
|
+
return value * 60 * 1000;
|
|
394
|
+
default:
|
|
395
|
+
return null;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/commands/log/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,MAAM,UAAU,gBAAgB;IAC9B,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;IAEnC,OAAO;SACJ,WAAW,CAAC,yCAAyC,CAAC;SACtD,MAAM,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;SAChD,MAAM,CAAC,gBAAgB,EAAE,wCAAwC,CAAC;SAClE,MAAM,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;SACpD,MAAM,CAAC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AC,gBAAgB,CAAC,CAAC;IAClD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAEtB,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,GAAG;YACN,OAAO,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QACrC,KAAK,GAAG;YACN,OAAO,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAChC,KAAK,GAAG;YACN,OAAO,KAAK,GAAG,EAAE,GAAG,IAAI,CAAC;QAC3B;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log parser - Parse log entries and session data
|
|
3
|
+
*/
|
|
4
|
+
import type { LogEntry, SessionMetadata } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Parse a debug log line into structured LogEntry
|
|
7
|
+
* Format: [timestamp] [LEVEL] [AGENT] [SESSION_ID] [PROFILE] message
|
|
8
|
+
* Example: [2026-02-03T09:18:48.816Z] [INFO] [claude] [7427566e-...] [codemie-sso] Session sync enabled
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseLogLine(line: string): LogEntry | null;
|
|
11
|
+
/**
|
|
12
|
+
* Parse session metadata from JSON file
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseSessionMetadata(jsonContent: string): SessionMetadata | null;
|
|
15
|
+
/**
|
|
16
|
+
* Parse session conversation from JSONL file
|
|
17
|
+
* Returns array of conversation turns
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseSessionConversation(jsonlContent: string): Array<Record<string, unknown>>;
|
|
20
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/log/parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAY,eAAe,EAAE,MAAM,YAAY,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CA+C1D;AAaD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAsBhF;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAiB7F"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log parser - Parse log entries and session data
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Parse a debug log line into structured LogEntry
|
|
6
|
+
* Format: [timestamp] [LEVEL] [AGENT] [SESSION_ID] [PROFILE] message
|
|
7
|
+
* Example: [2026-02-03T09:18:48.816Z] [INFO] [claude] [7427566e-...] [codemie-sso] Session sync enabled
|
|
8
|
+
*/
|
|
9
|
+
export function parseLogLine(line) {
|
|
10
|
+
if (!line.trim()) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
// Match log format with optional profile
|
|
14
|
+
const regex = /^\[([^\]]+)\] \[([^\]]+)\] \[([^\]]+)\] \[([^\]]+)\](?: \[([^\]]+)\])? (.+)$/;
|
|
15
|
+
const match = line.match(regex);
|
|
16
|
+
if (!match) {
|
|
17
|
+
// Return as unparsed entry with current timestamp
|
|
18
|
+
return {
|
|
19
|
+
timestamp: new Date(),
|
|
20
|
+
level: 'debug',
|
|
21
|
+
agent: 'unknown',
|
|
22
|
+
sessionId: 'unknown',
|
|
23
|
+
profile: null,
|
|
24
|
+
message: line,
|
|
25
|
+
rawLine: line
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const [, timestampStr, levelStr, agent, sessionId, profile, message] = match;
|
|
29
|
+
// Parse timestamp
|
|
30
|
+
let timestamp;
|
|
31
|
+
try {
|
|
32
|
+
timestamp = new Date(timestampStr);
|
|
33
|
+
if (isNaN(timestamp.getTime())) {
|
|
34
|
+
timestamp = new Date();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
timestamp = new Date();
|
|
39
|
+
}
|
|
40
|
+
// Normalize log level
|
|
41
|
+
const level = normalizeLogLevel(levelStr);
|
|
42
|
+
return {
|
|
43
|
+
timestamp,
|
|
44
|
+
level,
|
|
45
|
+
agent,
|
|
46
|
+
sessionId,
|
|
47
|
+
profile: profile || null,
|
|
48
|
+
message: message.trim(),
|
|
49
|
+
rawLine: line
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Normalize log level string to LogLevel type
|
|
54
|
+
*/
|
|
55
|
+
function normalizeLogLevel(levelStr) {
|
|
56
|
+
const normalized = levelStr.toLowerCase();
|
|
57
|
+
if (normalized === 'info')
|
|
58
|
+
return 'info';
|
|
59
|
+
if (normalized === 'warn' || normalized === 'warning')
|
|
60
|
+
return 'warn';
|
|
61
|
+
if (normalized === 'error')
|
|
62
|
+
return 'error';
|
|
63
|
+
return 'debug';
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Parse session metadata from JSON file
|
|
67
|
+
*/
|
|
68
|
+
export function parseSessionMetadata(jsonContent) {
|
|
69
|
+
try {
|
|
70
|
+
const data = JSON.parse(jsonContent);
|
|
71
|
+
// Validate required fields
|
|
72
|
+
if (!data.sessionId || !data.agentName || !data.provider || !data.startTime) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
sessionId: data.sessionId,
|
|
77
|
+
agentName: data.agentName,
|
|
78
|
+
provider: data.provider,
|
|
79
|
+
startTime: data.startTime,
|
|
80
|
+
endTime: data.endTime,
|
|
81
|
+
status: data.status || 'active',
|
|
82
|
+
workingDirectory: data.workingDirectory || '',
|
|
83
|
+
gitBranch: data.gitBranch
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Parse session conversation from JSONL file
|
|
92
|
+
* Returns array of conversation turns
|
|
93
|
+
*/
|
|
94
|
+
export function parseSessionConversation(jsonlContent) {
|
|
95
|
+
const turns = [];
|
|
96
|
+
const lines = jsonlContent.trim().split('\n');
|
|
97
|
+
for (const line of lines) {
|
|
98
|
+
if (!line.trim())
|
|
99
|
+
continue;
|
|
100
|
+
try {
|
|
101
|
+
const turn = JSON.parse(line);
|
|
102
|
+
turns.push(turn);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// Skip malformed lines
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return turns;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/cli/commands/log/parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,yCAAyC;IACzC,MAAM,KAAK,GAAG,8EAA8E,CAAC;IAC7F,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAEhC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,kDAAkD;QAClD,OAAO;YACL,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,KAAK,EAAE,OAAO;YACd,KAAK,EAAE,SAAS;YAChB,SAAS,EA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*/
|
|
4
|
+
import type { LogEntry, SessionMetadata, LogFilter } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Read debug log entries with optional filtering
|
|
7
|
+
*/
|
|
8
|
+
export declare class LogReader {
|
|
9
|
+
private logsDir;
|
|
10
|
+
constructor(logsDir?: string);
|
|
11
|
+
/**
|
|
12
|
+
* Read log entries from specified date range
|
|
13
|
+
* Returns entries in chronological order (oldest first)
|
|
14
|
+
*/
|
|
15
|
+
readLogs(filter?: LogFilter, maxLines?: number): Promise<LogEntry[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Read a single log file and parse entries
|
|
18
|
+
*/
|
|
19
|
+
private readLogFile;
|
|
20
|
+
/**
|
|
21
|
+
* Get list of log files that fall within date range
|
|
22
|
+
* Returns files sorted by date (oldest first)
|
|
23
|
+
*/
|
|
24
|
+
private getLogFilesInRange;
|
|
25
|
+
/**
|
|
26
|
+
* Check if log entry matches filter criteria
|
|
27
|
+
*/
|
|
28
|
+
private matchesFilter;
|
|
29
|
+
/**
|
|
30
|
+
* Get the most recent log file path
|
|
31
|
+
*/
|
|
32
|
+
getMostRecentLogFile(): string | null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Read session metadata and related files
|
|
36
|
+
*/
|
|
37
|
+
export declare class SessionReader {
|
|
38
|
+
private sessionsDir;
|
|
39
|
+
constructor(sessionsDir?: string);
|
|
40
|
+
/**
|
|
41
|
+
* Read a single session's metadata
|
|
42
|
+
*/
|
|
43
|
+
readSession(sessionId: string): SessionMetadata | null;
|
|
44
|
+
/**
|
|
45
|
+
* List all sessions with optional filtering
|
|
46
|
+
*/
|
|
47
|
+
listSessions(filter?: LogFilter): SessionMetadata[];
|
|
48
|
+
/**
|
|
49
|
+
* Check if session matches filter criteria
|
|
50
|
+
*/
|
|
51
|
+
private matchesSessionFilter;
|
|
52
|
+
/**
|
|
53
|
+
* Get session conversation (JSONL file)
|
|
54
|
+
*/
|
|
55
|
+
readSessionConversation(sessionId: string): Array<Record<string, unknown>>;
|
|
56
|
+
/**
|
|
57
|
+
* Get total size of all session files
|
|
58
|
+
*/
|
|
59
|
+
getTotalSessionsSize(): number;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/log/reader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvE;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAS;gBAEZ,OAAO,CAAC,EAAE,MAAM;IAI5B;;;OAGG;IACG,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAiC1E;;OAEG;YACW,WAAW;IA0BzB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAiC1B;;OAEG;IACH,OAAO,CAAC,aAAa;IA8DrB;;OAEG;IACH,oBAAoB,IAAI,MAAM,GAAG,IAAI;CAStC;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,WAAW,CAAS;gBAEhB,WAAW,CAAC,EAAE,MAAM;IAIhC;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI;IAoBtD;;OAEG;IACH,YAAY,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe,EAAE;IAgDnD;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAsB5B;;OAEG;IACH,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IA0B1E;;OAEG;IACH,oBAAoB,IAAI,MAAM;CAwB/B"}
|