proofscan 0.5.10 → 0.6.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.
- package/dist/cli.js +14 -8
- package/dist/cli.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +5 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/scan.d.ts.map +1 -1
- package/dist/commands/scan.js +45 -7
- package/dist/commands/scan.js.map +1 -1
- package/dist/commands/shell.d.ts +6 -0
- package/dist/commands/shell.d.ts.map +1 -0
- package/dist/commands/shell.js +33 -0
- package/dist/commands/shell.js.map +1 -0
- package/dist/commands/view.d.ts.map +1 -1
- package/dist/commands/view.js +14 -7
- package/dist/commands/view.js.map +1 -1
- package/dist/shell/completer.d.ts +18 -0
- package/dist/shell/completer.d.ts.map +1 -0
- package/dist/shell/completer.js +136 -0
- package/dist/shell/completer.js.map +1 -0
- package/dist/shell/history.d.ts +20 -0
- package/dist/shell/history.d.ts.map +1 -0
- package/dist/shell/history.js +75 -0
- package/dist/shell/history.js.map +1 -0
- package/dist/shell/index.d.ts +11 -0
- package/dist/shell/index.d.ts.map +1 -0
- package/dist/shell/index.js +10 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/shell/prompt.d.ts +34 -0
- package/dist/shell/prompt.d.ts.map +1 -0
- package/dist/shell/prompt.js +87 -0
- package/dist/shell/prompt.js.map +1 -0
- package/dist/shell/repl.d.ts +76 -0
- package/dist/shell/repl.d.ts.map +1 -0
- package/dist/shell/repl.js +490 -0
- package/dist/shell/repl.js.map +1 -0
- package/dist/shell/selector.d.ts +23 -0
- package/dist/shell/selector.d.ts.map +1 -0
- package/dist/shell/selector.js +86 -0
- package/dist/shell/selector.js.map +1 -0
- package/dist/shell/types.d.ts +47 -0
- package/dist/shell/types.d.ts.map +1 -0
- package/dist/shell/types.js +71 -0
- package/dist/shell/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell TAB completion
|
|
3
|
+
*/
|
|
4
|
+
import { TOP_LEVEL_COMMANDS, COMMAND_SUBCOMMANDS, COMMAND_OPTIONS, COMMON_OPTIONS, SHELL_BUILTINS, } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Parse input line into tokens
|
|
7
|
+
*/
|
|
8
|
+
function tokenize(line) {
|
|
9
|
+
// Simple tokenization by whitespace
|
|
10
|
+
return line.trim().split(/\s+/).filter(t => t !== '');
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get completions for the current input
|
|
14
|
+
*/
|
|
15
|
+
export function getCompletions(line, context, dataProvider) {
|
|
16
|
+
const tokens = tokenize(line);
|
|
17
|
+
const currentToken = tokens.length > 0 ? tokens[tokens.length - 1] : '';
|
|
18
|
+
const isNewToken = line.endsWith(' ') || tokens.length === 0;
|
|
19
|
+
// If line ends with space, we're completing a new token
|
|
20
|
+
const tokenToComplete = isNewToken ? '' : currentToken;
|
|
21
|
+
const completedTokens = isNewToken ? tokens : tokens.slice(0, -1);
|
|
22
|
+
// Determine what to complete based on context
|
|
23
|
+
const candidates = getCandidates(completedTokens, tokenToComplete, context, dataProvider);
|
|
24
|
+
// Filter candidates by prefix
|
|
25
|
+
const matches = candidates.filter(c => c.startsWith(tokenToComplete));
|
|
26
|
+
return [matches, tokenToComplete];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get candidate completions based on parsed tokens
|
|
30
|
+
*/
|
|
31
|
+
function getCandidates(completedTokens, currentToken, context, dataProvider) {
|
|
32
|
+
// No tokens yet - complete top-level commands + builtins
|
|
33
|
+
if (completedTokens.length === 0) {
|
|
34
|
+
return [...SHELL_BUILTINS, ...TOP_LEVEL_COMMANDS];
|
|
35
|
+
}
|
|
36
|
+
const firstToken = completedTokens[0];
|
|
37
|
+
// Handle shell builtins
|
|
38
|
+
if (SHELL_BUILTINS.includes(firstToken)) {
|
|
39
|
+
return getBuiltinCompletions(firstToken, completedTokens, currentToken, context, dataProvider);
|
|
40
|
+
}
|
|
41
|
+
// Handle command completions
|
|
42
|
+
return getCommandCompletions(completedTokens, currentToken, context, dataProvider);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get completions for shell builtins
|
|
46
|
+
*/
|
|
47
|
+
function getBuiltinCompletions(command, tokens, _currentToken, _context, dataProvider) {
|
|
48
|
+
switch (command) {
|
|
49
|
+
case 'use':
|
|
50
|
+
if (tokens.length === 1) {
|
|
51
|
+
// `use <connector>` or `use session`
|
|
52
|
+
return ['session', ...dataProvider.getConnectorIds()];
|
|
53
|
+
}
|
|
54
|
+
if (tokens.length === 2 && tokens[1] === 'session') {
|
|
55
|
+
// `use session <sessionPrefix>`
|
|
56
|
+
return dataProvider.getSessionPrefixes(undefined, 50);
|
|
57
|
+
}
|
|
58
|
+
return [];
|
|
59
|
+
case 'help':
|
|
60
|
+
if (tokens.length === 1) {
|
|
61
|
+
return [...SHELL_BUILTINS, ...TOP_LEVEL_COMMANDS];
|
|
62
|
+
}
|
|
63
|
+
return [];
|
|
64
|
+
default:
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get completions for regular commands
|
|
70
|
+
*/
|
|
71
|
+
function getCommandCompletions(tokens, currentToken, context, dataProvider) {
|
|
72
|
+
const firstToken = tokens[0];
|
|
73
|
+
const candidates = [];
|
|
74
|
+
// Check if this command has subcommands
|
|
75
|
+
const subcommands = COMMAND_SUBCOMMANDS[firstToken];
|
|
76
|
+
if (subcommands && tokens.length === 1) {
|
|
77
|
+
candidates.push(...subcommands);
|
|
78
|
+
}
|
|
79
|
+
// Get options for the command
|
|
80
|
+
const commandKey = tokens.slice(0, 2).join(' ');
|
|
81
|
+
const options = COMMAND_OPTIONS[commandKey] || COMMAND_OPTIONS[firstToken] || [];
|
|
82
|
+
candidates.push(...options, ...COMMON_OPTIONS);
|
|
83
|
+
// Check if we're completing an option value
|
|
84
|
+
const prevToken = tokens[tokens.length - 1];
|
|
85
|
+
if (prevToken) {
|
|
86
|
+
// --id expects connector id for certain commands
|
|
87
|
+
if (prevToken === '--id') {
|
|
88
|
+
if (['scan', 's', 'connectors', 'connector'].includes(firstToken)) {
|
|
89
|
+
return dataProvider.getConnectorIds();
|
|
90
|
+
}
|
|
91
|
+
if (['rpc'].includes(firstToken)) {
|
|
92
|
+
return dataProvider.getRpcIds(context.session);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// --session expects session prefix
|
|
96
|
+
if (prevToken === '--session') {
|
|
97
|
+
return dataProvider.getSessionPrefixes(context.connector, 50);
|
|
98
|
+
}
|
|
99
|
+
// --connector expects connector id
|
|
100
|
+
if (prevToken === '--connector') {
|
|
101
|
+
return dataProvider.getConnectorIds();
|
|
102
|
+
}
|
|
103
|
+
// --status expects ok/err/all
|
|
104
|
+
if (prevToken === '--status') {
|
|
105
|
+
return ['ok', 'err', 'all'];
|
|
106
|
+
}
|
|
107
|
+
// --format expects format options
|
|
108
|
+
if (prevToken === '--format') {
|
|
109
|
+
return ['json', 'yaml', 'table'];
|
|
110
|
+
}
|
|
111
|
+
// --from expects import format
|
|
112
|
+
if (prevToken === '--from') {
|
|
113
|
+
return ['mcpServers'];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// For scan start without --id, suggest connector ids as positional
|
|
117
|
+
if (tokens.length >= 2 && (firstToken === 'scan' || firstToken === 's') && tokens[1] === 'start') {
|
|
118
|
+
if (!tokens.includes('--id') && !currentToken.startsWith('-')) {
|
|
119
|
+
candidates.push(...dataProvider.getConnectorIds());
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// For tree command, suggest connector ids as positional argument
|
|
123
|
+
if ((firstToken === 'tree' || firstToken === 't') && tokens.length === 1) {
|
|
124
|
+
if (!currentToken.startsWith('-')) {
|
|
125
|
+
candidates.push(...dataProvider.getConnectorIds());
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return [...new Set(candidates)]; // Deduplicate
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Create a readline completer function
|
|
132
|
+
*/
|
|
133
|
+
export function createCompleter(context, dataProvider) {
|
|
134
|
+
return (line) => getCompletions(line, context, dataProvider);
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=completer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completer.js","sourceRoot":"","sources":["../../src/shell/completer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC;AAQpB;;GAEG;AACH,SAAS,QAAQ,CAAC,IAAY;IAC5B,oCAAoC;IACpC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,OAAqB,EACrB,YAAiC;IAEjC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC;IAE7D,wDAAwD;IACxD,MAAM,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;IACvD,MAAM,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KAAK,OAAO,EAAE,CAAC;QACjG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9D,UAAU,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,eAAe,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAED,iEAAiE;IACjE,IAAI,CAAC,UAAU,KAAK,MAAM,IAAI,UAAU,KAAK,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAClC,UAAU,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,eAAe,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,cAAc;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAqB,EACrB,YAAiC;IAEjC,OAAO,CAAC,IAAY,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell history management
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Get the history file path (OS-specific)
|
|
6
|
+
*/
|
|
7
|
+
export declare function getHistoryPath(): string;
|
|
8
|
+
/**
|
|
9
|
+
* Load history from file
|
|
10
|
+
*/
|
|
11
|
+
export declare function loadHistory(): string[];
|
|
12
|
+
/**
|
|
13
|
+
* Save history to file
|
|
14
|
+
*/
|
|
15
|
+
export declare function saveHistory(history: string[]): void;
|
|
16
|
+
/**
|
|
17
|
+
* Add a line to history (deduplicates consecutive entries)
|
|
18
|
+
*/
|
|
19
|
+
export declare function addToHistory(history: string[], line: string): string[];
|
|
20
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/shell/history.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAevC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,EAAE,CAatC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAiBnD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAYtE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell history management
|
|
3
|
+
*/
|
|
4
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
5
|
+
import { homedir, platform } from 'os';
|
|
6
|
+
import { join, dirname } from 'path';
|
|
7
|
+
const MAX_HISTORY_SIZE = 1000;
|
|
8
|
+
/**
|
|
9
|
+
* Get the history file path (OS-specific)
|
|
10
|
+
*/
|
|
11
|
+
export function getHistoryPath() {
|
|
12
|
+
const home = homedir();
|
|
13
|
+
const os = platform();
|
|
14
|
+
switch (os) {
|
|
15
|
+
case 'win32':
|
|
16
|
+
// Windows: %APPDATA%\proofscan\shell_history
|
|
17
|
+
return join(process.env.APPDATA || join(home, 'AppData', 'Roaming'), 'proofscan', 'shell_history');
|
|
18
|
+
case 'darwin':
|
|
19
|
+
// macOS: ~/.config/proofscan/shell_history
|
|
20
|
+
return join(home, '.config', 'proofscan', 'shell_history');
|
|
21
|
+
default:
|
|
22
|
+
// Linux: ~/.config/proofscan/shell_history
|
|
23
|
+
return join(process.env.XDG_CONFIG_HOME || join(home, '.config'), 'proofscan', 'shell_history');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Load history from file
|
|
28
|
+
*/
|
|
29
|
+
export function loadHistory() {
|
|
30
|
+
const path = getHistoryPath();
|
|
31
|
+
if (!existsSync(path)) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const content = readFileSync(path, 'utf-8');
|
|
36
|
+
return content.split('\n').filter(line => line.trim() !== '');
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Save history to file
|
|
44
|
+
*/
|
|
45
|
+
export function saveHistory(history) {
|
|
46
|
+
const path = getHistoryPath();
|
|
47
|
+
const dir = dirname(path);
|
|
48
|
+
// Ensure directory exists
|
|
49
|
+
if (!existsSync(dir)) {
|
|
50
|
+
mkdirSync(dir, { recursive: true });
|
|
51
|
+
}
|
|
52
|
+
// Limit history size
|
|
53
|
+
const trimmed = history.slice(-MAX_HISTORY_SIZE);
|
|
54
|
+
try {
|
|
55
|
+
writeFileSync(path, trimmed.join('\n') + '\n', 'utf-8');
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// Ignore errors during save
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Add a line to history (deduplicates consecutive entries)
|
|
63
|
+
*/
|
|
64
|
+
export function addToHistory(history, line) {
|
|
65
|
+
const trimmed = line.trim();
|
|
66
|
+
if (trimmed === '') {
|
|
67
|
+
return history;
|
|
68
|
+
}
|
|
69
|
+
// Don't add if same as last entry
|
|
70
|
+
if (history.length > 0 && history[history.length - 1] === trimmed) {
|
|
71
|
+
return history;
|
|
72
|
+
}
|
|
73
|
+
return [...history, trimmed];
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/shell/history.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EA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ePrompt, supportsColor } from './prompt.js';
|
|
6
|
+
export { getHistoryPath, loadHistory, saveHistory } from './history.js';
|
|
7
|
+
export { createCompleter, getCompletions, type DynamicDataProvider } from './completer.js';
|
|
8
|
+
export { selectConnector, selectSession, canInteract } from './selector.js';
|
|
9
|
+
export type { ShellContext, CompletionResult } from './types.js';
|
|
10
|
+
export { TOP_LEVEL_COMMANDS, COMMAND_SUBCOMMANDS, SHELL_BUILTINS } from './types.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5E,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell module exports
|
|
3
|
+
*/
|
|
4
|
+
export { ShellRepl, isValidArg } from './repl.js';
|
|
5
|
+
export { generatePrompt, supportsColor } from './prompt.js';
|
|
6
|
+
export { getHistoryPath, loadHistory, saveHistory } from './history.js';
|
|
7
|
+
export { createCompleter, getCompletions } from './completer.js';
|
|
8
|
+
export { selectConnector, selectSession, canInteract } from './selector.js';
|
|
9
|
+
export { TOP_LEVEL_COMMANDS, COMMAND_SUBCOMMANDS, SHELL_BUILTINS } from './types.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shell/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,cAAc,EAA4B,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell prompt generation with color support
|
|
3
|
+
*/
|
|
4
|
+
import type { ShellContext } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Check if color output is supported
|
|
7
|
+
*/
|
|
8
|
+
export declare function supportsColor(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Shorten session ID to prefix
|
|
11
|
+
*/
|
|
12
|
+
export declare function shortenSessionId(sessionId: string, length?: number): string;
|
|
13
|
+
/**
|
|
14
|
+
* Generate the shell prompt string
|
|
15
|
+
* Format: proofscan|<connector>|<sessionPrefix>>
|
|
16
|
+
*/
|
|
17
|
+
export declare function generatePrompt(context: ShellContext): string;
|
|
18
|
+
/**
|
|
19
|
+
* Generate a plain prompt (no colors)
|
|
20
|
+
*/
|
|
21
|
+
export declare function generatePlainPrompt(context: ShellContext): string;
|
|
22
|
+
/**
|
|
23
|
+
* Print success message
|
|
24
|
+
*/
|
|
25
|
+
export declare function printSuccess(message: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* Print error message
|
|
28
|
+
*/
|
|
29
|
+
export declare function printError(message: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Print info message
|
|
32
|
+
*/
|
|
33
|
+
export declare function printInfo(message: string): void;
|
|
34
|
+
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/shell/prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAc/C;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAQvC;AAYD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,MAAU,GAAG,MAAM,CAE9E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAgB5D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAUjE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAElD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE/C"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell prompt generation with color support
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* ANSI color codes
|
|
6
|
+
*/
|
|
7
|
+
const COLORS = {
|
|
8
|
+
reset: '\x1b[0m',
|
|
9
|
+
dim: '\x1b[2m',
|
|
10
|
+
cyan: '\x1b[36m',
|
|
11
|
+
yellow: '\x1b[33m',
|
|
12
|
+
green: '\x1b[32m',
|
|
13
|
+
red: '\x1b[31m',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Check if color output is supported
|
|
17
|
+
*/
|
|
18
|
+
export function supportsColor() {
|
|
19
|
+
// Respect NO_COLOR environment variable
|
|
20
|
+
if (process.env.NO_COLOR !== undefined) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
// Check if stdout is a TTY
|
|
24
|
+
return process.stdout.isTTY === true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Apply color if supported
|
|
28
|
+
*/
|
|
29
|
+
function color(text, colorCode) {
|
|
30
|
+
if (!supportsColor()) {
|
|
31
|
+
return text;
|
|
32
|
+
}
|
|
33
|
+
return `${colorCode}${text}${COLORS.reset}`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Shorten session ID to prefix
|
|
37
|
+
*/
|
|
38
|
+
export function shortenSessionId(sessionId, length = 8) {
|
|
39
|
+
return sessionId.slice(0, length);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Generate the shell prompt string
|
|
43
|
+
* Format: proofscan|<connector>|<sessionPrefix>>
|
|
44
|
+
*/
|
|
45
|
+
export function generatePrompt(context) {
|
|
46
|
+
const parts = [];
|
|
47
|
+
// proofscan (dim)
|
|
48
|
+
parts.push(color('proofscan', COLORS.dim));
|
|
49
|
+
// connector (cyan) or * if not set
|
|
50
|
+
const connector = context.connector || '*';
|
|
51
|
+
parts.push(color(connector, COLORS.cyan));
|
|
52
|
+
// session prefix (yellow) if set
|
|
53
|
+
if (context.session) {
|
|
54
|
+
parts.push(color(shortenSessionId(context.session), COLORS.yellow));
|
|
55
|
+
}
|
|
56
|
+
return parts.join('|') + '> ';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Generate a plain prompt (no colors)
|
|
60
|
+
*/
|
|
61
|
+
export function generatePlainPrompt(context) {
|
|
62
|
+
const parts = ['proofscan'];
|
|
63
|
+
parts.push(context.connector || '*');
|
|
64
|
+
if (context.session) {
|
|
65
|
+
parts.push(shortenSessionId(context.session));
|
|
66
|
+
}
|
|
67
|
+
return parts.join('|') + '> ';
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Print success message
|
|
71
|
+
*/
|
|
72
|
+
export function printSuccess(message) {
|
|
73
|
+
console.log(color('✓ ' + message, COLORS.green));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Print error message
|
|
77
|
+
*/
|
|
78
|
+
export function printError(message) {
|
|
79
|
+
console.error(color('✗ ' + message, COLORS.red));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Print info message
|
|
83
|
+
*/
|
|
84
|
+
export function printInfo(message) {
|
|
85
|
+
console.log(color(message, COLORS.dim));
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/shell/prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,UAAU;IACjB,GAAG,EAAE,UAAU;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,wCAAwC;IACxC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACvC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,2BAA2B;IAC3B,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,SAAS,KAAK,CAAC,IAAY,EAAE,SAAiB;IAC5C,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,GAAG,SAAS,GAAG,IAA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M,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shell REPL implementation
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Validate an argument for safe command execution.
|
|
6
|
+
* Since we use shell: false, most injection vectors are blocked.
|
|
7
|
+
* We only reject the most dangerous shell metacharacters as defense-in-depth.
|
|
8
|
+
*
|
|
9
|
+
* Blocked characters: & | ; ` $ (command chaining and substitution)
|
|
10
|
+
* \n \r (newline injection)
|
|
11
|
+
* \0 (null byte injection)
|
|
12
|
+
*/
|
|
13
|
+
export declare function isValidArg(arg: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Shell REPL class
|
|
16
|
+
*/
|
|
17
|
+
export declare class ShellRepl {
|
|
18
|
+
private context;
|
|
19
|
+
private rl;
|
|
20
|
+
private history;
|
|
21
|
+
private configPath;
|
|
22
|
+
private running;
|
|
23
|
+
private connectorsCache;
|
|
24
|
+
private sessionsCache;
|
|
25
|
+
private rpcsCache;
|
|
26
|
+
constructor(configPath: string);
|
|
27
|
+
/**
|
|
28
|
+
* Invalidate all caches (called after data-modifying commands)
|
|
29
|
+
*/
|
|
30
|
+
private invalidateCache;
|
|
31
|
+
/**
|
|
32
|
+
* Get data provider for completions with caching
|
|
33
|
+
*/
|
|
34
|
+
private getDataProvider;
|
|
35
|
+
/**
|
|
36
|
+
* Start the REPL
|
|
37
|
+
*/
|
|
38
|
+
start(): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Process a line of input
|
|
41
|
+
*/
|
|
42
|
+
private processLine;
|
|
43
|
+
/**
|
|
44
|
+
* Handle built-in shell commands
|
|
45
|
+
*/
|
|
46
|
+
private handleBuiltin;
|
|
47
|
+
/**
|
|
48
|
+
* Show help
|
|
49
|
+
*/
|
|
50
|
+
private showHelp;
|
|
51
|
+
/**
|
|
52
|
+
* Show current context
|
|
53
|
+
*/
|
|
54
|
+
private showContext;
|
|
55
|
+
/**
|
|
56
|
+
* Handle 'use' command
|
|
57
|
+
*/
|
|
58
|
+
private handleUse;
|
|
59
|
+
/**
|
|
60
|
+
* Reset context
|
|
61
|
+
*/
|
|
62
|
+
private resetContext;
|
|
63
|
+
/**
|
|
64
|
+
* Execute a pfscan command
|
|
65
|
+
*/
|
|
66
|
+
private executeCommand;
|
|
67
|
+
/**
|
|
68
|
+
* Build command arguments with context applied
|
|
69
|
+
*/
|
|
70
|
+
private buildCommandArgs;
|
|
71
|
+
/**
|
|
72
|
+
* Check if command has a positional connector argument
|
|
73
|
+
*/
|
|
74
|
+
private hasPositionalConnector;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=repl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../src/shell/repl.ts"],"names":[],"mappings":"AAAA;;GAEG;AAqBH;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAG/C;AAUD;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,EAAE,CAAmC;IAC7C,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,OAAO,CAAS;IAGxB,OAAO,CAAC,eAAe,CAAqC;IAC5D,OAAO,CAAC,aAAa,CAAgD;IACrE,OAAO,CAAC,SAAS,CAAgD;gBAErD,UAAU,EAAE,MAAM;IAY9B;;OAEG;IACH,OAAO,CAAC,eAAe;IAMvB;;OAEG;IACH,OAAO,CAAC,eAAe;IAwDvB;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA4D5B;;OAEG;YACW,WAAW;IAwBzB;;OAEG;YACW,aAAa;IAiC3B;;OAEG;IACH,OAAO,CAAC,QAAQ;IA0BhB;;OAEG;IACH,OAAO,CAAC,WAAW;IAQnB;;OAEG;YACW,SAAS;IA+IvB;;OAEG;IACH,OAAO,CAAC,YAAY;IAOpB;;OAEG;YACW,cAAc;IAmD5B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAiCxB;;OAEG;IACH,OAAO,CAAC,sBAAsB;CAO/B"}
|