mycontext-cli 1.0.26 โ 1.0.28
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 +184 -88
- package/dist/agents/implementations/InteractiveAgent.js +1 -1
- package/dist/agents/implementations/InteractiveAgent.js.map +1 -1
- package/dist/cli.js +22 -70
- package/dist/cli.js.map +1 -1
- package/dist/commands/agent-flow.d.ts.map +1 -1
- package/dist/commands/agent-flow.js +1 -1
- package/dist/commands/agent-flow.js.map +1 -1
- package/dist/commands/generate-components.d.ts +0 -1
- package/dist/commands/generate-components.d.ts.map +1 -1
- package/dist/commands/generate-components.js +3 -106
- package/dist/commands/generate-components.js.map +1 -1
- package/dist/commands/generate.d.ts +0 -2
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +51 -496
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts +0 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +0 -102
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +0 -4
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/pricing.d.ts.map +1 -1
- package/dist/commands/pricing.js +20 -55
- package/dist/commands/pricing.js.map +1 -1
- package/dist/commands/update.d.ts +0 -3
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +11 -83
- package/dist/commands/update.js.map +1 -1
- package/dist/config/ai-providers.json +7 -7
- package/dist/config/dependencies.json +2 -2
- package/dist/utils/fileSystem.d.ts +0 -8
- package/dist/utils/fileSystem.d.ts.map +1 -1
- package/dist/utils/fileSystem.js +0 -50
- package/dist/utils/fileSystem.js.map +1 -1
- package/dist/utils/hybridAIClient.js +1 -1
- package/dist/utils/hybridAIClient.js.map +1 -1
- package/package.json +2 -3
- package/dist/commands/clear.d.ts +0 -25
- package/dist/commands/clear.d.ts.map +0 -1
- package/dist/commands/clear.js +0 -73
- package/dist/commands/clear.js.map +0 -1
- package/dist/commands/history.d.ts +0 -98
- package/dist/commands/history.d.ts.map +0 -1
- package/dist/commands/history.js +0 -308
- package/dist/commands/history.js.map +0 -1
- package/dist/commands/now.d.ts +0 -34
- package/dist/commands/now.d.ts.map +0 -1
- package/dist/commands/now.js +0 -168
- package/dist/commands/now.js.map +0 -1
- package/dist/commands/timestamp.d.ts +0 -28
- package/dist/commands/timestamp.d.ts.map +0 -1
- package/dist/commands/timestamp.js +0 -105
- package/dist/commands/timestamp.js.map +0 -1
- package/dist/commands/track.d.ts +0 -29
- package/dist/commands/track.d.ts.map +0 -1
- package/dist/commands/track.js +0 -333
- package/dist/commands/track.js.map +0 -1
package/dist/commands/clear.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClearCommand = void 0;
|
|
4
|
-
exports.registerClearCommand = registerClearCommand;
|
|
5
|
-
const child_process_1 = require("child_process");
|
|
6
|
-
const logger_1 = require("../utils/logger");
|
|
7
|
-
class ClearCommand {
|
|
8
|
-
/**
|
|
9
|
-
* Clear terminal screen
|
|
10
|
-
*/
|
|
11
|
-
static clearScreen() {
|
|
12
|
-
try {
|
|
13
|
-
// Clear screen using system command
|
|
14
|
-
(0, child_process_1.execSync)("clear", { stdio: "inherit" });
|
|
15
|
-
}
|
|
16
|
-
catch {
|
|
17
|
-
// Fallback: print newlines
|
|
18
|
-
console.log("\n".repeat(50));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Clear agent registration info from terminal
|
|
23
|
-
*/
|
|
24
|
-
static clearAgentInfo() {
|
|
25
|
-
// This is a placeholder - in practice, you can't "undo" already printed output
|
|
26
|
-
// But we can provide a clean slate for new commands
|
|
27
|
-
this.clearScreen();
|
|
28
|
-
logger_1.logger.info("๐งน Terminal cleared of agent info");
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Execute clear command
|
|
32
|
-
*/
|
|
33
|
-
static async execute(options) {
|
|
34
|
-
if (options.all || (!options.agentInfo && !options.silent)) {
|
|
35
|
-
this.clearScreen();
|
|
36
|
-
if (!options.silent) {
|
|
37
|
-
logger_1.logger.info("๐งน Terminal cleared");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
else if (options.agentInfo) {
|
|
41
|
-
this.clearAgentInfo();
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
this.clearScreen();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.ClearCommand = ClearCommand;
|
|
49
|
-
/**
|
|
50
|
-
* Register clear command with Commander
|
|
51
|
-
*/
|
|
52
|
-
function registerClearCommand(program) {
|
|
53
|
-
program
|
|
54
|
-
.command("clear")
|
|
55
|
-
.description("Clear terminal screen and agent info")
|
|
56
|
-
.option("--silent", "Clear without showing confirmation message")
|
|
57
|
-
.option("--agent-info", "Clear agent registration info specifically")
|
|
58
|
-
.option("--all", "Clear everything (default)")
|
|
59
|
-
.action(async (options) => {
|
|
60
|
-
await ClearCommand.execute(options);
|
|
61
|
-
});
|
|
62
|
-
// Add alias
|
|
63
|
-
program
|
|
64
|
-
.command("clean-terminal")
|
|
65
|
-
.description("Alias for clear command")
|
|
66
|
-
.option("--silent", "Clear without showing confirmation message")
|
|
67
|
-
.option("--agent-info", "Clear agent registration info specifically")
|
|
68
|
-
.option("--all", "Clear everything (default)")
|
|
69
|
-
.action(async (options) => {
|
|
70
|
-
await ClearCommand.execute(options);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=clear.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"clear.js","sourceRoot":"","sources":["../../src/commands/clear.ts"],"names":[],"mappings":";;;AAuDA,oDAqBC;AA1ED,iDAAyC;AACzC,4CAAyC;AAQzC,MAAa,YAAY;IACvB;;OAEG;IACH,MAAM,CAAC,WAAW;QA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AE,EAAE;QACtC,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEL,YAAY;IACZ,OAAO;SACJ,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,yBAAyB,CAAC;SACtC,MAAM,CAAC,UAAU,EAAE,4CAA4C,CAAC;SAChE,MAAM,CAAC,cAAc,EAAE,4CAA4C,CAAC;SACpE,MAAM,CAAC,OAAO,EAAE,4BAA4B,CAAC;SAC7C,MAAM,CAAC,KAAK,EAAE,OAAqB,EAAE,EAAE;QACtC,MAAM,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
export interface HistoryOptions {
|
|
3
|
-
limit?: number;
|
|
4
|
-
search?: string;
|
|
5
|
-
clear?: boolean;
|
|
6
|
-
format?: string;
|
|
7
|
-
ranked?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare class HistoryCommand {
|
|
10
|
-
private static readonly HISTORY_FILE;
|
|
11
|
-
/**
|
|
12
|
-
* Get command history file path
|
|
13
|
-
*/
|
|
14
|
-
static getHistoryPath(): string;
|
|
15
|
-
/**
|
|
16
|
-
* Ensure history directory exists
|
|
17
|
-
*/
|
|
18
|
-
static ensureHistoryDir(): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Load command history
|
|
21
|
-
*/
|
|
22
|
-
static loadHistory(): Promise<Array<{
|
|
23
|
-
command: string;
|
|
24
|
-
timestamp: string;
|
|
25
|
-
cwd: string;
|
|
26
|
-
}>>;
|
|
27
|
-
/**
|
|
28
|
-
* Save command to history
|
|
29
|
-
*/
|
|
30
|
-
static saveCommand(command: string, cwd?: string): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Clear command history
|
|
33
|
-
*/
|
|
34
|
-
static clearHistory(): Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* Search command history
|
|
37
|
-
*/
|
|
38
|
-
static searchHistory(query: string, limit?: number): Promise<Array<{
|
|
39
|
-
command: string;
|
|
40
|
-
timestamp: string;
|
|
41
|
-
cwd: string;
|
|
42
|
-
}>>;
|
|
43
|
-
/**
|
|
44
|
-
* Calculate command complexity score
|
|
45
|
-
*/
|
|
46
|
-
static calculateComplexityScore(command: string): number;
|
|
47
|
-
/**
|
|
48
|
-
* Calculate command frequency score
|
|
49
|
-
*/
|
|
50
|
-
static calculateFrequencyScore(command: string, history: Array<{
|
|
51
|
-
command: string;
|
|
52
|
-
timestamp: string;
|
|
53
|
-
cwd: string;
|
|
54
|
-
}>): number;
|
|
55
|
-
/**
|
|
56
|
-
* Calculate recency score (more recent = higher score)
|
|
57
|
-
*/
|
|
58
|
-
static calculateRecencyScore(timestamp: string): number;
|
|
59
|
-
/**
|
|
60
|
-
* Calculate overall importance score
|
|
61
|
-
*/
|
|
62
|
-
static calculateImportanceScore(entry: {
|
|
63
|
-
command: string;
|
|
64
|
-
timestamp: string;
|
|
65
|
-
cwd: string;
|
|
66
|
-
}, history: Array<{
|
|
67
|
-
command: string;
|
|
68
|
-
timestamp: string;
|
|
69
|
-
cwd: string;
|
|
70
|
-
}>): number;
|
|
71
|
-
/**
|
|
72
|
-
* Get ranked command history
|
|
73
|
-
*/
|
|
74
|
-
static getRankedHistory(limit?: number, search?: string): Promise<Array<{
|
|
75
|
-
command: string;
|
|
76
|
-
timestamp: string;
|
|
77
|
-
cwd: string;
|
|
78
|
-
score: number;
|
|
79
|
-
}>>;
|
|
80
|
-
/**
|
|
81
|
-
* Format history entry
|
|
82
|
-
*/
|
|
83
|
-
static formatHistoryEntry(entry: {
|
|
84
|
-
command: string;
|
|
85
|
-
timestamp: string;
|
|
86
|
-
cwd: string;
|
|
87
|
-
score?: number;
|
|
88
|
-
}, index: number, format: string, showScore?: boolean): string;
|
|
89
|
-
/**
|
|
90
|
-
* Execute history command
|
|
91
|
-
*/
|
|
92
|
-
static execute(options: HistoryOptions): Promise<void>;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Register history command with Commander
|
|
96
|
-
*/
|
|
97
|
-
export declare function registerHistoryCommand(program: Command): void;
|
|
98
|
-
//# sourceMappingURL=history.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/commands/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAIlC;IAEF;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,MAAM;IAI/B;;OAEG;WACU,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAK9C;;OAEG;WACU,WAAW,IAAI,OAAO,CACjC,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAC3D;IAaD;;OAEG;WACU,WAAW,CACtB,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,IAAI,CAAC;IAsBhB;;OAEG;WACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAS1C;;OAEG;WACU,aAAa,CACxB,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,MAAW,GACjB,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAA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CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CA0G7D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkC7D"}
|
package/dist/commands/history.js
DELETED
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.HistoryCommand = void 0;
|
|
40
|
-
exports.registerHistoryCommand = registerHistoryCommand;
|
|
41
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
42
|
-
const fs = __importStar(require("fs-extra"));
|
|
43
|
-
const path = __importStar(require("path"));
|
|
44
|
-
const os = __importStar(require("os"));
|
|
45
|
-
class HistoryCommand {
|
|
46
|
-
/**
|
|
47
|
-
* Get command history file path
|
|
48
|
-
*/
|
|
49
|
-
static getHistoryPath() {
|
|
50
|
-
return this.HISTORY_FILE;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Ensure history directory exists
|
|
54
|
-
*/
|
|
55
|
-
static async ensureHistoryDir() {
|
|
56
|
-
const historyDir = path.dirname(this.HISTORY_FILE);
|
|
57
|
-
await fs.ensureDir(historyDir);
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Load command history
|
|
61
|
-
*/
|
|
62
|
-
static async loadHistory() {
|
|
63
|
-
try {
|
|
64
|
-
await this.ensureHistoryDir();
|
|
65
|
-
if (await fs.pathExists(this.HISTORY_FILE)) {
|
|
66
|
-
const data = await fs.readJson(this.HISTORY_FILE);
|
|
67
|
-
return Array.isArray(data) ? data : [];
|
|
68
|
-
}
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
catch (error) {
|
|
72
|
-
return [];
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Save command to history
|
|
77
|
-
*/
|
|
78
|
-
static async saveCommand(command, cwd = process.cwd()) {
|
|
79
|
-
try {
|
|
80
|
-
const history = await this.loadHistory();
|
|
81
|
-
const newEntry = {
|
|
82
|
-
command,
|
|
83
|
-
timestamp: new Date().toISOString(),
|
|
84
|
-
cwd,
|
|
85
|
-
};
|
|
86
|
-
// Add to beginning of array
|
|
87
|
-
history.unshift(newEntry);
|
|
88
|
-
// Keep only last 1000 commands
|
|
89
|
-
const limitedHistory = history.slice(0, 1000);
|
|
90
|
-
await this.ensureHistoryDir();
|
|
91
|
-
await fs.writeJson(this.HISTORY_FILE, limitedHistory, { spaces: 2 });
|
|
92
|
-
}
|
|
93
|
-
catch (error) {
|
|
94
|
-
// Silently fail - history is not critical
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Clear command history
|
|
99
|
-
*/
|
|
100
|
-
static async clearHistory() {
|
|
101
|
-
try {
|
|
102
|
-
await this.ensureHistoryDir();
|
|
103
|
-
await fs.writeJson(this.HISTORY_FILE, []);
|
|
104
|
-
}
|
|
105
|
-
catch (error) {
|
|
106
|
-
throw new Error(`Failed to clear history: ${error}`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Search command history
|
|
111
|
-
*/
|
|
112
|
-
static async searchHistory(query, limit = 20) {
|
|
113
|
-
const history = await this.loadHistory();
|
|
114
|
-
const filtered = history.filter((entry) => entry.command.toLowerCase().includes(query.toLowerCase()));
|
|
115
|
-
return filtered.slice(0, limit);
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Calculate command complexity score
|
|
119
|
-
*/
|
|
120
|
-
static calculateComplexityScore(command) {
|
|
121
|
-
let score = 0;
|
|
122
|
-
// Length factor (longer commands are more complex)
|
|
123
|
-
score += command.length * 0.1;
|
|
124
|
-
// Special characters that are hard to type
|
|
125
|
-
const specialChars = /[!@#$%^&*()_+={}[\]|\\:";'<>?,./~`]/g;
|
|
126
|
-
const specialCharMatches = command.match(specialChars);
|
|
127
|
-
if (specialCharMatches) {
|
|
128
|
-
score += specialCharMatches.length * 2;
|
|
129
|
-
}
|
|
130
|
-
// Long flags and options
|
|
131
|
-
const longFlags = /--[a-zA-Z-]+/g;
|
|
132
|
-
const longFlagMatches = command.match(longFlags);
|
|
133
|
-
if (longFlagMatches) {
|
|
134
|
-
score += longFlagMatches.length * 1.5;
|
|
135
|
-
}
|
|
136
|
-
// Complex paths or URLs
|
|
137
|
-
if (command.includes("/") || command.includes("\\")) {
|
|
138
|
-
score += 1;
|
|
139
|
-
}
|
|
140
|
-
// Quoted strings (often complex)
|
|
141
|
-
const quotedStrings = /"[^"]*"/g;
|
|
142
|
-
const quotedMatches = command.match(quotedStrings);
|
|
143
|
-
if (quotedMatches) {
|
|
144
|
-
score += quotedMatches.length * 1.2;
|
|
145
|
-
}
|
|
146
|
-
return Math.round(score * 10) / 10;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Calculate command frequency score
|
|
150
|
-
*/
|
|
151
|
-
static calculateFrequencyScore(command, history) {
|
|
152
|
-
const normalizedCommand = command.toLowerCase().trim();
|
|
153
|
-
const frequency = history.filter((entry) => entry.command.toLowerCase().trim() === normalizedCommand).length;
|
|
154
|
-
// More frequent commands get higher score
|
|
155
|
-
return Math.log(frequency + 1) * 2;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Calculate recency score (more recent = higher score)
|
|
159
|
-
*/
|
|
160
|
-
static calculateRecencyScore(timestamp) {
|
|
161
|
-
const now = new Date();
|
|
162
|
-
const commandTime = new Date(timestamp);
|
|
163
|
-
const hoursAgo = (now.getTime() - commandTime.getTime()) / (1000 * 60 * 60);
|
|
164
|
-
// Recent commands get higher score, but not too much
|
|
165
|
-
return Math.max(0, 10 - hoursAgo * 0.1);
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Calculate overall importance score
|
|
169
|
-
*/
|
|
170
|
-
static calculateImportanceScore(entry, history) {
|
|
171
|
-
const complexityScore = this.calculateComplexityScore(entry.command);
|
|
172
|
-
const frequencyScore = this.calculateFrequencyScore(entry.command, history);
|
|
173
|
-
const recencyScore = this.calculateRecencyScore(entry.timestamp);
|
|
174
|
-
// Weighted combination
|
|
175
|
-
return complexityScore * 0.4 + frequencyScore * 0.4 + recencyScore * 0.2;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Get ranked command history
|
|
179
|
-
*/
|
|
180
|
-
static async getRankedHistory(limit = 20, search) {
|
|
181
|
-
const history = await this.loadHistory();
|
|
182
|
-
let filteredHistory = history;
|
|
183
|
-
if (search) {
|
|
184
|
-
filteredHistory = history.filter((entry) => entry.command.toLowerCase().includes(search.toLowerCase()));
|
|
185
|
-
}
|
|
186
|
-
// Calculate scores and add to entries
|
|
187
|
-
const scoredHistory = filteredHistory.map((entry) => ({
|
|
188
|
-
...entry,
|
|
189
|
-
score: this.calculateImportanceScore(entry, history),
|
|
190
|
-
}));
|
|
191
|
-
// Sort by score (highest first)
|
|
192
|
-
scoredHistory.sort((a, b) => b.score - a.score);
|
|
193
|
-
return scoredHistory.slice(0, limit);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Format history entry
|
|
197
|
-
*/
|
|
198
|
-
static formatHistoryEntry(entry, index, format, showScore = false) {
|
|
199
|
-
const date = new Date(entry.timestamp);
|
|
200
|
-
const timeStr = date.toLocaleString();
|
|
201
|
-
switch (format.toLowerCase()) {
|
|
202
|
-
case "json":
|
|
203
|
-
return JSON.stringify(entry);
|
|
204
|
-
case "simple":
|
|
205
|
-
const scoreText = showScore && entry.score ? ` (${entry.score.toFixed(1)})` : "";
|
|
206
|
-
return `${index + 1}. ${entry.command}${scoreText}`;
|
|
207
|
-
case "detailed":
|
|
208
|
-
default:
|
|
209
|
-
const scoreDisplay = showScore && entry.score
|
|
210
|
-
? ` ${chalk_1.default.yellow(`โญ ${entry.score.toFixed(1)}`)}`
|
|
211
|
-
: "";
|
|
212
|
-
return `${chalk_1.default.gray(`${index + 1}.`)} ${chalk_1.default.cyan(entry.command)}${scoreDisplay}\n ${chalk_1.default.gray(`๐
${timeStr}`)} ${chalk_1.default.gray(`๐ ${entry.cwd}`)}`;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Execute history command
|
|
217
|
-
*/
|
|
218
|
-
static async execute(options) {
|
|
219
|
-
try {
|
|
220
|
-
if (options.clear) {
|
|
221
|
-
await this.clearHistory();
|
|
222
|
-
console.log(chalk_1.default.green("โ
Command history cleared"));
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
let history;
|
|
226
|
-
let useRanking = options.ranked !== false; // Default to true unless explicitly disabled
|
|
227
|
-
if (options.search) {
|
|
228
|
-
if (useRanking) {
|
|
229
|
-
history = await this.getRankedHistory(options.limit || 20, options.search);
|
|
230
|
-
console.log(chalk_1.default.blue(`๐ Found ${history.length} commands matching "${options.search}" (ranked by importance)`));
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
history = await this.searchHistory(options.search, options.limit || 20);
|
|
234
|
-
console.log(chalk_1.default.blue(`๐ Found ${history.length} commands matching "${options.search}"`));
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
if (useRanking) {
|
|
239
|
-
history = await this.getRankedHistory(options.limit || 20);
|
|
240
|
-
console.log(chalk_1.default.blue(`๐ Command History (${history.length} commands, ranked by importance)`));
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
history = await this.loadHistory();
|
|
244
|
-
if (options.limit) {
|
|
245
|
-
history = history.slice(0, options.limit);
|
|
246
|
-
}
|
|
247
|
-
console.log(chalk_1.default.blue(`๐ Command History (${history.length} commands)`));
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
if (history.length === 0) {
|
|
251
|
-
console.log(chalk_1.default.gray("No commands found"));
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
console.log(chalk_1.default.gray("โ".repeat(60)));
|
|
255
|
-
history.forEach((entry, index) => {
|
|
256
|
-
console.log(this.formatHistoryEntry(entry, index, options.format || "detailed", useRanking));
|
|
257
|
-
if (options.format !== "simple") {
|
|
258
|
-
console.log();
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
if (options.format !== "simple") {
|
|
262
|
-
console.log(chalk_1.default.gray("โ".repeat(60)));
|
|
263
|
-
if (useRanking) {
|
|
264
|
-
console.log(chalk_1.default.yellow("๐ก Commands are ranked by importance (length, frequency, recency)"));
|
|
265
|
-
}
|
|
266
|
-
console.log(chalk_1.default.yellow("๐ก Tip: Use arrow keys to navigate command history"));
|
|
267
|
-
console.log(chalk_1.default.yellow("๐ก Tip: Use 'mycontext history --search <term>' to find specific commands"));
|
|
268
|
-
console.log(chalk_1.default.yellow("๐ก Tip: Use 'mycontext his' as a shortcut for 'mycontext history'"));
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
catch (error) {
|
|
272
|
-
console.error(chalk_1.default.red("โ Error accessing command history:"), error);
|
|
273
|
-
process.exit(1);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
exports.HistoryCommand = HistoryCommand;
|
|
278
|
-
HistoryCommand.HISTORY_FILE = path.join(os.homedir(), ".mycontext", "command_history.json");
|
|
279
|
-
/**
|
|
280
|
-
* Register history command with Commander
|
|
281
|
-
*/
|
|
282
|
-
function registerHistoryCommand(program) {
|
|
283
|
-
// Main history command
|
|
284
|
-
program
|
|
285
|
-
.command("history")
|
|
286
|
-
.description("Show recent command history (ranked by importance)")
|
|
287
|
-
.option("-l, --limit <number>", "Limit number of commands to show", "20")
|
|
288
|
-
.option("-s, --search <term>", "Search for commands containing term")
|
|
289
|
-
.option("--clear", "Clear command history")
|
|
290
|
-
.option("--no-ranked", "Disable smart ranking (show chronological order)")
|
|
291
|
-
.option("--format <format>", "Output format (detailed, simple, json)", "detailed")
|
|
292
|
-
.action(async (options) => {
|
|
293
|
-
await HistoryCommand.execute(options);
|
|
294
|
-
});
|
|
295
|
-
// Short alias
|
|
296
|
-
program
|
|
297
|
-
.command("his")
|
|
298
|
-
.description("Shortcut for 'mycontext history'")
|
|
299
|
-
.option("-l, --limit <number>", "Limit number of commands to show", "20")
|
|
300
|
-
.option("-s, --search <term>", "Search for commands containing term")
|
|
301
|
-
.option("--clear", "Clear command history")
|
|
302
|
-
.option("--no-ranked", "Disable smart ranking (show chronological order)")
|
|
303
|
-
.option("--format <format>", "Output format (detailed, simple, json)", "detailed")
|
|
304
|
-
.action(async (options) => {
|
|
305
|
-
await HistoryCommand.execute(options);
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
//# sourceMappingURL=history.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/commands/history.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4WA,wDAkCC;AA7YD,kDAA0B;AAC1B,6CAA+B;AAC/B,2CAA6B;AAC7B,uCAAyB;AAUzB,MAAa,cAAc;IAOzB;;OAEG;IACH,MAAM,CAAC,cAAc;QACnB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,gBAAgB;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACnD,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW;QAGtB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC9B,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC3C,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAClD,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACzC,CAAC;YACD,OAAO,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1,34 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
export interface NowOptions {
|
|
3
|
-
format?: string;
|
|
4
|
-
withGitHash?: boolean;
|
|
5
|
-
copy?: boolean;
|
|
6
|
-
verbose?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare class NowCommand {
|
|
9
|
-
/**
|
|
10
|
-
* Get current timestamp in YYYYMMDDHHMMSS format
|
|
11
|
-
*/
|
|
12
|
-
static getTimestamp(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Get git hash if available
|
|
15
|
-
*/
|
|
16
|
-
static getGitHash(): string | null;
|
|
17
|
-
/**
|
|
18
|
-
* Format timestamp based on format option
|
|
19
|
-
*/
|
|
20
|
-
static formatTimestamp(timestamp: string, format: string): string;
|
|
21
|
-
/**
|
|
22
|
-
* Copy text to clipboard (cross-platform)
|
|
23
|
-
*/
|
|
24
|
-
static copyToClipboard(text: string): Promise<boolean>;
|
|
25
|
-
/**
|
|
26
|
-
* Execute now command
|
|
27
|
-
*/
|
|
28
|
-
static execute(options: NowOptions): Promise<void>;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Register now command with Commander
|
|
32
|
-
*/
|
|
33
|
-
export declare function registerNowCommand(program: Command): void;
|
|
34
|
-
//# sourceMappingURL=now.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"now.d.ts","sourceRoot":"","sources":["../../src/commands/now.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,UAAU;IACrB;;OAEG;IACH,MAAM,CAAC,YAAY,IAAI,MAAM;IAY7B;;OAEG;IACH,MAAM,CAAC,UAAU,IAAI,MAAM,GAAG,IAAI;IAYlC;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IA0CjE;;OAEG;WACU,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAkB5D;;OAEG;WACU,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;CAqEzD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAezD"}
|