katashiro-vscode 2.2.0 → 2.3.0

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.
Files changed (53) hide show
  1. package/dist/commands/command-helpers.d.ts +91 -0
  2. package/dist/commands/command-helpers.d.ts.map +1 -0
  3. package/dist/commands/command-helpers.js +125 -0
  4. package/dist/commands/command-helpers.js.map +1 -0
  5. package/dist/commands/command-manager.d.ts +64 -0
  6. package/dist/commands/command-manager.d.ts.map +1 -0
  7. package/dist/commands/command-manager.js +374 -0
  8. package/dist/commands/command-manager.js.map +1 -0
  9. package/dist/commands/index.d.ts +5 -0
  10. package/dist/commands/index.d.ts.map +1 -0
  11. package/dist/commands/index.js +9 -0
  12. package/dist/commands/index.js.map +1 -0
  13. package/dist/extension.d.ts +18 -0
  14. package/dist/extension.d.ts.map +1 -0
  15. package/dist/extension.js +75 -0
  16. package/dist/extension.js.map +1 -0
  17. package/dist/index.d.ts +13 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +33 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/katashiro-extension.d.ts +51 -0
  22. package/dist/katashiro-extension.d.ts.map +1 -0
  23. package/dist/katashiro-extension.js +123 -0
  24. package/dist/katashiro-extension.js.map +1 -0
  25. package/dist/ui/index.d.ts +6 -0
  26. package/dist/ui/index.d.ts.map +1 -0
  27. package/dist/ui/index.js +11 -0
  28. package/dist/ui/index.js.map +1 -0
  29. package/dist/ui/output-channel-manager.d.ts +57 -0
  30. package/dist/ui/output-channel-manager.d.ts.map +1 -0
  31. package/dist/ui/output-channel-manager.js +126 -0
  32. package/dist/ui/output-channel-manager.js.map +1 -0
  33. package/dist/ui/status-bar-manager.d.ts +68 -0
  34. package/dist/ui/status-bar-manager.d.ts.map +1 -0
  35. package/dist/ui/status-bar-manager.js +167 -0
  36. package/dist/ui/status-bar-manager.js.map +1 -0
  37. package/dist/views/history-view-provider.d.ts +77 -0
  38. package/dist/views/history-view-provider.d.ts.map +1 -0
  39. package/dist/views/history-view-provider.js +204 -0
  40. package/dist/views/history-view-provider.js.map +1 -0
  41. package/dist/views/index.d.ts +7 -0
  42. package/dist/views/index.d.ts.map +1 -0
  43. package/dist/views/index.js +16 -0
  44. package/dist/views/index.js.map +1 -0
  45. package/dist/views/knowledge-view-provider.d.ts +60 -0
  46. package/dist/views/knowledge-view-provider.d.ts.map +1 -0
  47. package/dist/views/knowledge-view-provider.js +169 -0
  48. package/dist/views/knowledge-view-provider.js.map +1 -0
  49. package/dist/views/research-view-provider.d.ts +48 -0
  50. package/dist/views/research-view-provider.d.ts.map +1 -0
  51. package/dist/views/research-view-provider.js +141 -0
  52. package/dist/views/research-view-provider.js.map +1 -0
  53. package/package.json +11 -12
@@ -0,0 +1,91 @@
1
+ /**
2
+ * CommandManager Helper Functions
3
+ *
4
+ * Extracted for better testability
5
+ * @module katashiro
6
+ * @task TSK-071
7
+ */
8
+ /**
9
+ * Search result type
10
+ */
11
+ export interface SearchResult {
12
+ title: string;
13
+ url: string;
14
+ snippet: string;
15
+ }
16
+ /**
17
+ * Content analysis result type
18
+ */
19
+ export interface AnalysisResult {
20
+ wordCount: number;
21
+ entities: string[];
22
+ topics: string[];
23
+ sentiment: string;
24
+ }
25
+ /**
26
+ * Research results type
27
+ */
28
+ export interface ResearchResults {
29
+ summary: string;
30
+ sources: string[];
31
+ }
32
+ /**
33
+ * Format search results as markdown
34
+ */
35
+ export declare function formatSearchResults(query: string, results: SearchResult[]): string;
36
+ /**
37
+ * Format content analysis as markdown
38
+ */
39
+ export declare function formatAnalysis(analysis: AnalysisResult): string;
40
+ /**
41
+ * Format research results as markdown
42
+ */
43
+ export declare function formatResearchResults(topic: string, results: ResearchResults): string;
44
+ /**
45
+ * Format summary as markdown
46
+ */
47
+ export declare function formatSummary(content: string, style: string, maxPreviewLength?: number): string;
48
+ /**
49
+ * Format report as markdown
50
+ */
51
+ export declare function formatReport(topic: string, format: string): string;
52
+ /**
53
+ * Count words in content
54
+ */
55
+ export declare function countWords(content: string): number;
56
+ /**
57
+ * Format error message
58
+ */
59
+ export declare function formatErrorMessage(message: string, error: unknown): string;
60
+ /**
61
+ * Validate input is not empty
62
+ */
63
+ export declare function validateInput(input: string | undefined | null): input is string;
64
+ /**
65
+ * Summary style options
66
+ */
67
+ export declare const SUMMARY_STYLES: readonly ["brief", "detailed", "bullet"];
68
+ export type SummaryStyle = typeof SUMMARY_STYLES[number];
69
+ /**
70
+ * Validate summary style
71
+ */
72
+ export declare function isValidSummaryStyle(style: string): style is SummaryStyle;
73
+ /**
74
+ * Research depth options
75
+ */
76
+ export declare const RESEARCH_DEPTHS: readonly ["shallow", "moderate", "deep"];
77
+ export type ResearchDepth = typeof RESEARCH_DEPTHS[number];
78
+ /**
79
+ * Validate research depth
80
+ */
81
+ export declare function isValidResearchDepth(depth: string): depth is ResearchDepth;
82
+ /**
83
+ * Report format options
84
+ */
85
+ export declare const REPORT_FORMATS: readonly ["markdown", "html", "pdf"];
86
+ export type ReportFormat = typeof REPORT_FORMATS[number];
87
+ /**
88
+ * Validate report format
89
+ */
90
+ export declare function isValidReportFormat(format: string): format is ReportFormat;
91
+ //# sourceMappingURL=command-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-helpers.d.ts","sourceRoot":"","sources":["../../src/commands/command-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAA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AAI,aAAa,CAE1E;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,sCAAuC,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAEzD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY,CAE1E"}
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ /**
3
+ * CommandManager Helper Functions
4
+ *
5
+ * Extracted for better testability
6
+ * @module katashiro
7
+ * @task TSK-071
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.REPORT_FORMATS = exports.RESEARCH_DEPTHS = exports.SUMMARY_STYLES = void 0;
11
+ exports.formatSearchResults = formatSearchResults;
12
+ exports.formatAnalysis = formatAnalysis;
13
+ exports.formatResearchResults = formatResearchResults;
14
+ exports.formatSummary = formatSummary;
15
+ exports.formatReport = formatReport;
16
+ exports.countWords = countWords;
17
+ exports.formatErrorMessage = formatErrorMessage;
18
+ exports.validateInput = validateInput;
19
+ exports.isValidSummaryStyle = isValidSummaryStyle;
20
+ exports.isValidResearchDepth = isValidResearchDepth;
21
+ exports.isValidReportFormat = isValidReportFormat;
22
+ /**
23
+ * Format search results as markdown
24
+ */
25
+ function formatSearchResults(query, results) {
26
+ let md = `# Search Results: ${query}\n\n`;
27
+ md += `Found ${results.length} results\n\n`;
28
+ for (const result of results) {
29
+ md += `## [${result.title}](${result.url})\n\n`;
30
+ md += `${result.snippet}\n\n`;
31
+ md += '---\n\n';
32
+ }
33
+ return md;
34
+ }
35
+ /**
36
+ * Format content analysis as markdown
37
+ */
38
+ function formatAnalysis(analysis) {
39
+ let md = '# Content Analysis\n\n';
40
+ md += `**Word Count:** ${analysis.wordCount}\n\n`;
41
+ md += `**Sentiment:** ${analysis.sentiment}\n\n`;
42
+ md += '## Entities\n\n';
43
+ md += analysis.entities.map((e) => `- ${e}`).join('\n');
44
+ md += '\n\n## Topics\n\n';
45
+ md += analysis.topics.map((t) => `- ${t}`).join('\n');
46
+ return md;
47
+ }
48
+ /**
49
+ * Format research results as markdown
50
+ */
51
+ function formatResearchResults(topic, results) {
52
+ let md = `# Research: ${topic}\n\n`;
53
+ md += `## Summary\n\n${results.summary}\n\n`;
54
+ md += '## Sources\n\n';
55
+ md += results.sources.map((s) => `- ${s}`).join('\n');
56
+ md += '\n\n*Generated by KATASHIRO*';
57
+ return md;
58
+ }
59
+ /**
60
+ * Format summary as markdown
61
+ */
62
+ function formatSummary(content, style, maxPreviewLength = 200) {
63
+ const preview = content.substring(0, maxPreviewLength);
64
+ const ellipsis = content.length > maxPreviewLength ? '...' : '';
65
+ return `# Summary (${style})\n\n${preview}${ellipsis}\n\n*Generated by KATASHIRO*`;
66
+ }
67
+ /**
68
+ * Format report as markdown
69
+ */
70
+ function formatReport(topic, format) {
71
+ return `# Report: ${topic}\n\nFormat: ${format}\n\n## Introduction\n\n...\n\n## Conclusion\n\n...\n\n*Generated by KATASHIRO*`;
72
+ }
73
+ /**
74
+ * Count words in content
75
+ */
76
+ function countWords(content) {
77
+ if (!content || !content.trim()) {
78
+ return 0;
79
+ }
80
+ return content.trim().split(/\s+/).length;
81
+ }
82
+ /**
83
+ * Format error message
84
+ */
85
+ function formatErrorMessage(message, error) {
86
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
87
+ return `${message}: ${errorMessage}`;
88
+ }
89
+ /**
90
+ * Validate input is not empty
91
+ */
92
+ function validateInput(input) {
93
+ return typeof input === 'string' && input.trim().length > 0;
94
+ }
95
+ /**
96
+ * Summary style options
97
+ */
98
+ exports.SUMMARY_STYLES = ['brief', 'detailed', 'bullet'];
99
+ /**
100
+ * Validate summary style
101
+ */
102
+ function isValidSummaryStyle(style) {
103
+ return exports.SUMMARY_STYLES.includes(style);
104
+ }
105
+ /**
106
+ * Research depth options
107
+ */
108
+ exports.RESEARCH_DEPTHS = ['shallow', 'moderate', 'deep'];
109
+ /**
110
+ * Validate research depth
111
+ */
112
+ function isValidResearchDepth(depth) {
113
+ return exports.RESEARCH_DEPTHS.includes(depth);
114
+ }
115
+ /**
116
+ * Report format options
117
+ */
118
+ exports.REPORT_FORMATS = ['markdown', 'html', 'pdf'];
119
+ /**
120
+ * Validate report format
121
+ */
122
+ function isValidReportFormat(format) {
123
+ return exports.REPORT_FORMATS.includes(format);
124
+ }
125
+ //# sourceMappingURL=command-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-helpers.js","sourceRoot":"","sources":["../../src/commands/command-helpers.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAgCH,kDAWC;AAKD,wCASC;AAKD,sDAOC;AAKD,sCAIC;AAKD,oCAEC;AAKD,gCAKC;AAKD,gDAGC;AAKD,sCAEC;AAWD,kDAEC;AAWD,oDAEC;AAWD,kDAEC;AAxHD;;GAEG;AACH,SAAgB,mBAAmB,CAAC,KAAa,EAAE,OAAuB;IACxE,IAAI,EAAE,GAAG,qBAAqB,KAAK,MAAM,CAAC;IAC1C,EAAE,IAAI,SAAS,OAAO,CAAC,MAAM,cAAc,CAAC;IAE5C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,EAAE,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,GAAG,OAAO,CAAC;QAChD,EAAE,IAAI,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC;QAC9B,EAAE,IAAI,SAAS,CAAC;IAClB,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;GAEG;AACH,SAAgB,cAAc,CAAC,QAAwB;IACrD,IAAI,EAAE,GAAG,wBAAwB,CAAC;IAClC,EAAE,IAAI,mBAAmB,QAAQ,CAAC,SAAS,MAAM,CAAC;IAClD,EAAE,IAAI,kBAAkB,QAAQ,CAAC,SAAS,MAAM,CAAC;IACjD,EAAE,IAAI,iBAAiB,CAAC;IACxB,EAAE,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,C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4
+ * @module katashiro
5
+ * @task TSK-071
6
+ */
7
+ import * as vscode from 'vscode';
8
+ import type { OutputChannelManager } from '../ui/output-channel-manager.js';
9
+ /**
10
+ * CommandManager
11
+ *
12
+ * Manages registration and execution of VS Code commands
13
+ */
14
+ export declare class CommandManager {
15
+ private readonly context;
16
+ private readonly output;
17
+ constructor(context: vscode.ExtensionContext, output: OutputChannelManager);
18
+ /**
19
+ * Register all commands
20
+ */
21
+ registerAll(): void;
22
+ /**
23
+ * Register a command
24
+ */
25
+ private register;
26
+ /**
27
+ * Web Search command
28
+ */
29
+ private webSearch;
30
+ /**
31
+ * Analyze Content command
32
+ */
33
+ private analyzeContent;
34
+ /**
35
+ * Generate Summary command
36
+ */
37
+ private generateSummary;
38
+ /**
39
+ * Research Topic command
40
+ */
41
+ private researchTopic;
42
+ /**
43
+ * Generate Report command
44
+ */
45
+ private generateReport;
46
+ /**
47
+ * Show Knowledge Graph command
48
+ */
49
+ private showKnowledgeGraph;
50
+ /**
51
+ * Start MCP Server command
52
+ */
53
+ private startMcpServer;
54
+ private performWebSearch;
55
+ private formatSearchResults;
56
+ private performContentAnalysis;
57
+ private formatAnalysis;
58
+ private performSummaryGeneration;
59
+ private performResearch;
60
+ private formatResearchResults;
61
+ private performReportGeneration;
62
+ private handleError;
63
+ }
64
+ //# sourceMappingURL=command-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-manager.d.ts","sourceRoot":"","sources":["../../src/commands/command-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAE5E;;;;GAIG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,OAAO,EAAE,MAAM,CAAC,gBAAgB,EAChC,MAAM,EAAE,oBAAoB;IAG/C;;OAEG;IACH,WAAW,IAAI,IAAI;IAanB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAQhB;;OAEG;YACW,SAAS;IAsCvB;;OAEG;YACW,cAAc;IA6C5B;;OAEG;YACW,eAAe;IAwD7B;;OAEG;YACW,aAAa;IAwD3B;;OAEG;YACW,cAAc;IAkD5B;;OAEG;YACW,kBAAkB;IAShC;;OAEG;YACW,cAAc;YAgBd,gBAAgB;IAkB9B,OAAO,CAAC,mBAAmB;YAgBb,sBAAsB;IAepC,OAAO,CAAC,cAAc;YAgBR,wBAAwB;YASxB,eAAe;IAY7B,OAAO,CAAC,qBAAqB;YAYf,uBAAuB;IAQrC,OAAO,CAAC,WAAW;CAMpB"}
@@ -0,0 +1,374 @@
1
+ "use strict";
2
+ /**
3
+ * CommandManager - VS Code command registration and handling
4
+ *
5
+ * @module katashiro
6
+ * @task TSK-071
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
20
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
21
+ }) : function(o, v) {
22
+ o["default"] = v;
23
+ });
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.CommandManager = void 0;
43
+ const vscode = __importStar(require("vscode"));
44
+ /**
45
+ * CommandManager
46
+ *
47
+ * Manages registration and execution of VS Code commands
48
+ */
49
+ class CommandManager {
50
+ context;
51
+ output;
52
+ constructor(context, output) {
53
+ this.context = context;
54
+ this.output = output;
55
+ }
56
+ /**
57
+ * Register all commands
58
+ */
59
+ registerAll() {
60
+ this.register('katashiro.webSearch', this.webSearch.bind(this));
61
+ this.register('katashiro.analyzeContent', this.analyzeContent.bind(this));
62
+ this.register('katashiro.generateSummary', this.generateSummary.bind(this));
63
+ this.register('katashiro.researchTopic', this.researchTopic.bind(this));
64
+ this.register('katashiro.generateReport', this.generateReport.bind(this));
65
+ this.register('katashiro.showKnowledgeGraph', this.showKnowledgeGraph.bind(this));
66
+ this.register('katashiro.startMcpServer', this.startMcpServer.bind(this));
67
+ }
68
+ /**
69
+ * Register a command
70
+ */
71
+ register(command, callback) {
72
+ const disposable = vscode.commands.registerCommand(command, callback);
73
+ this.context.subscriptions.push(disposable);
74
+ }
75
+ /**
76
+ * Web Search command
77
+ */
78
+ async webSearch() {
79
+ const query = await vscode.window.showInputBox({
80
+ prompt: 'Enter search query',
81
+ placeHolder: 'Search the web...',
82
+ });
83
+ if (!query) {
84
+ return;
85
+ }
86
+ this.output.log(`Web search: ${query}`);
87
+ await vscode.window.withProgress({
88
+ location: vscode.ProgressLocation.Notification,
89
+ title: 'KATASHIRO: Searching...',
90
+ cancellable: false,
91
+ }, async () => {
92
+ try {
93
+ // TODO: Integrate with WebSearchClient
94
+ const results = await this.performWebSearch(query);
95
+ // Show results in new document
96
+ const doc = await vscode.workspace.openTextDocument({
97
+ content: this.formatSearchResults(query, results),
98
+ language: 'markdown',
99
+ });
100
+ await vscode.window.showTextDocument(doc);
101
+ this.output.log(`Search completed: ${results.length} results`);
102
+ }
103
+ catch (error) {
104
+ this.handleError('Web search failed', error);
105
+ }
106
+ });
107
+ }
108
+ /**
109
+ * Analyze Content command
110
+ */
111
+ async analyzeContent() {
112
+ const editor = vscode.window.activeTextEditor;
113
+ if (!editor) {
114
+ vscode.window.showWarningMessage('No active editor');
115
+ return;
116
+ }
117
+ const selection = editor.selection;
118
+ const content = selection.isEmpty
119
+ ? editor.document.getText()
120
+ : editor.document.getText(selection);
121
+ if (!content.trim()) {
122
+ vscode.window.showWarningMessage('No content to analyze');
123
+ return;
124
+ }
125
+ this.output.log('Analyzing content...');
126
+ await vscode.window.withProgress({
127
+ location: vscode.ProgressLocation.Notification,
128
+ title: 'KATASHIRO: Analyzing...',
129
+ cancellable: false,
130
+ }, async () => {
131
+ try {
132
+ // TODO: Integrate with TextAnalyzer
133
+ const analysis = await this.performContentAnalysis(content);
134
+ // Show analysis in new document
135
+ const doc = await vscode.workspace.openTextDocument({
136
+ content: this.formatAnalysis(analysis),
137
+ language: 'markdown',
138
+ });
139
+ await vscode.window.showTextDocument(doc, vscode.ViewColumn.Beside);
140
+ this.output.log('Content analysis completed');
141
+ }
142
+ catch (error) {
143
+ this.handleError('Content analysis failed', error);
144
+ }
145
+ });
146
+ }
147
+ /**
148
+ * Generate Summary command
149
+ */
150
+ async generateSummary() {
151
+ const editor = vscode.window.activeTextEditor;
152
+ if (!editor) {
153
+ vscode.window.showWarningMessage('No active editor');
154
+ return;
155
+ }
156
+ const selection = editor.selection;
157
+ const content = selection.isEmpty
158
+ ? editor.document.getText()
159
+ : editor.document.getText(selection);
160
+ if (!content.trim()) {
161
+ vscode.window.showWarningMessage('No content to summarize');
162
+ return;
163
+ }
164
+ const style = await vscode.window.showQuickPick(['brief', 'detailed', 'bullet'], {
165
+ placeHolder: 'Select summary style',
166
+ });
167
+ if (!style) {
168
+ return;
169
+ }
170
+ this.output.log(`Generating ${style} summary...`);
171
+ await vscode.window.withProgress({
172
+ location: vscode.ProgressLocation.Notification,
173
+ title: 'KATASHIRO: Generating summary...',
174
+ cancellable: false,
175
+ }, async () => {
176
+ try {
177
+ // TODO: Integrate with SummaryGenerator
178
+ const summary = await this.performSummaryGeneration(content, style);
179
+ // Show summary in new document
180
+ const doc = await vscode.workspace.openTextDocument({
181
+ content: summary,
182
+ language: 'markdown',
183
+ });
184
+ await vscode.window.showTextDocument(doc, vscode.ViewColumn.Beside);
185
+ this.output.log('Summary generation completed');
186
+ }
187
+ catch (error) {
188
+ this.handleError('Summary generation failed', error);
189
+ }
190
+ });
191
+ }
192
+ /**
193
+ * Research Topic command
194
+ */
195
+ async researchTopic() {
196
+ const topic = await vscode.window.showInputBox({
197
+ prompt: 'Enter topic to research',
198
+ placeHolder: 'Research topic...',
199
+ });
200
+ if (!topic) {
201
+ return;
202
+ }
203
+ const depth = await vscode.window.showQuickPick(['shallow', 'moderate', 'deep'], {
204
+ placeHolder: 'Select research depth',
205
+ });
206
+ if (!depth) {
207
+ return;
208
+ }
209
+ this.output.log(`Researching topic: ${topic} (depth: ${depth})`);
210
+ await vscode.window.withProgress({
211
+ location: vscode.ProgressLocation.Notification,
212
+ title: 'KATASHIRO: Researching...',
213
+ cancellable: true,
214
+ }, async (progress, token) => {
215
+ try {
216
+ progress.report({ message: 'Searching web...' });
217
+ // TODO: Full research pipeline
218
+ const results = await this.performResearch(topic, depth, token);
219
+ if (token.isCancellationRequested) {
220
+ this.output.log('Research cancelled');
221
+ return;
222
+ }
223
+ // Show results
224
+ const doc = await vscode.workspace.openTextDocument({
225
+ content: this.formatResearchResults(topic, results),
226
+ language: 'markdown',
227
+ });
228
+ await vscode.window.showTextDocument(doc);
229
+ this.output.log('Research completed');
230
+ }
231
+ catch (error) {
232
+ this.handleError('Research failed', error);
233
+ }
234
+ });
235
+ }
236
+ /**
237
+ * Generate Report command
238
+ */
239
+ async generateReport() {
240
+ const topic = await vscode.window.showInputBox({
241
+ prompt: 'Enter report topic',
242
+ placeHolder: 'Report topic...',
243
+ });
244
+ if (!topic) {
245
+ return;
246
+ }
247
+ const format = await vscode.window.showQuickPick(['markdown', 'html', 'pdf'], {
248
+ placeHolder: 'Select output format',
249
+ });
250
+ if (!format) {
251
+ return;
252
+ }
253
+ this.output.log(`Generating report: ${topic} (format: ${format})`);
254
+ await vscode.window.withProgress({
255
+ location: vscode.ProgressLocation.Notification,
256
+ title: 'KATASHIRO: Generating report...',
257
+ cancellable: false,
258
+ }, async () => {
259
+ try {
260
+ // TODO: Integrate with ReportGenerator
261
+ const report = await this.performReportGeneration(topic, format);
262
+ // Show report
263
+ const language = format === 'html' ? 'html' : 'markdown';
264
+ const doc = await vscode.workspace.openTextDocument({
265
+ content: report,
266
+ language,
267
+ });
268
+ await vscode.window.showTextDocument(doc);
269
+ this.output.log('Report generation completed');
270
+ }
271
+ catch (error) {
272
+ this.handleError('Report generation failed', error);
273
+ }
274
+ });
275
+ }
276
+ /**
277
+ * Show Knowledge Graph command
278
+ */
279
+ async showKnowledgeGraph() {
280
+ this.output.log('Opening knowledge graph viewer...');
281
+ // TODO: Implement webview for knowledge graph visualization
282
+ vscode.window.showInformationMessage('KATASHIRO: Knowledge Graph viewer coming soon!');
283
+ }
284
+ /**
285
+ * Start MCP Server command
286
+ */
287
+ async startMcpServer() {
288
+ this.output.log('Starting MCP server...');
289
+ try {
290
+ // TODO: Start MCP server in background
291
+ vscode.window.showInformationMessage('KATASHIRO: MCP Server started on stdio');
292
+ this.output.log('MCP server started');
293
+ }
294
+ catch (error) {
295
+ this.handleError('Failed to start MCP server', error);
296
+ }
297
+ }
298
+ // Helper methods (placeholder implementations)
299
+ async performWebSearch(query) {
300
+ // Placeholder - will integrate with WebSearchClient
301
+ return [
302
+ {
303
+ title: `Result 1 for: ${query}`,
304
+ url: 'https://example.com/1',
305
+ snippet: 'This is a sample search result snippet...',
306
+ },
307
+ {
308
+ title: `Result 2 for: ${query}`,
309
+ url: 'https://example.com/2',
310
+ snippet: 'Another sample search result snippet...',
311
+ },
312
+ ];
313
+ }
314
+ formatSearchResults(query, results) {
315
+ let md = `# Search Results: ${query}\n\n`;
316
+ md += `Found ${results.length} results\n\n`;
317
+ for (const result of results) {
318
+ md += `## [${result.title}](${result.url})\n\n`;
319
+ md += `${result.snippet}\n\n`;
320
+ md += '---\n\n';
321
+ }
322
+ return md;
323
+ }
324
+ async performContentAnalysis(content) {
325
+ // Placeholder - will integrate with TextAnalyzer
326
+ return {
327
+ wordCount: content.split(/\s+/).length,
328
+ entities: ['Entity 1', 'Entity 2'],
329
+ topics: ['Topic 1', 'Topic 2'],
330
+ sentiment: 'neutral',
331
+ };
332
+ }
333
+ formatAnalysis(analysis) {
334
+ let md = '# Content Analysis\n\n';
335
+ md += `**Word Count:** ${analysis.wordCount}\n\n`;
336
+ md += `**Sentiment:** ${analysis.sentiment}\n\n`;
337
+ md += '## Entities\n\n';
338
+ md += analysis.entities.map((e) => `- ${e}`).join('\n');
339
+ md += '\n\n## Topics\n\n';
340
+ md += analysis.topics.map((t) => `- ${t}`).join('\n');
341
+ return md;
342
+ }
343
+ async performSummaryGeneration(content, style) {
344
+ // Placeholder - will integrate with SummaryGenerator
345
+ const preview = content.substring(0, 200);
346
+ return `# Summary (${style})\n\n${preview}...\n\n*Generated by KATASHIRO*`;
347
+ }
348
+ async performResearch(topic, depth, _token) {
349
+ // Placeholder - will integrate with full research pipeline
350
+ return {
351
+ summary: `Research findings for "${topic}" at ${depth} depth...`,
352
+ sources: ['https://example.com/source1', 'https://example.com/source2'],
353
+ };
354
+ }
355
+ formatResearchResults(topic, results) {
356
+ let md = `# Research: ${topic}\n\n`;
357
+ md += `## Summary\n\n${results.summary}\n\n`;
358
+ md += '## Sources\n\n';
359
+ md += results.sources.map((s) => `- ${s}`).join('\n');
360
+ md += '\n\n*Generated by KATASHIRO*';
361
+ return md;
362
+ }
363
+ async performReportGeneration(topic, format) {
364
+ // Placeholder - will integrate with ReportGenerator
365
+ return `# Report: ${topic}\n\nFormat: ${format}\n\n## Introduction\n\n...\n\n## Conclusion\n\n...\n\n*Generated by KATASHIRO*`;
366
+ }
367
+ handleError(message, error) {
368
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
369
+ this.output.error(`${message}: ${errorMessage}`);
370
+ vscode.window.showErrorMessage(`KATASHIRO: ${message}`);
371
+ }
372
+ }
373
+ exports.CommandManager = CommandManager;
374
+ //# sourceMappingURL=command-manager.js.map