tg-claude 0.3.3 → 0.3.4
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/package.json +2 -3
- package/dist/claude/ClaudeProcess.d.ts +0 -77
- package/dist/claude/ClaudeProcess.d.ts.map +0 -1
- package/dist/claude/ClaudeProcess.js +0 -270
- package/dist/claude/ClaudeProcess.js.map +0 -1
- package/dist/claude/EventAdapter.d.ts +0 -44
- package/dist/claude/EventAdapter.d.ts.map +0 -1
- package/dist/claude/EventAdapter.js +0 -135
- package/dist/claude/EventAdapter.js.map +0 -1
- package/dist/claude/index.d.ts +0 -10
- package/dist/claude/index.d.ts.map +0 -1
- package/dist/claude/index.js +0 -9
- package/dist/claude/index.js.map +0 -1
- package/dist/claude/types.d.ts +0 -244
- package/dist/claude/types.d.ts.map +0 -1
- package/dist/claude/types.js +0 -8
- package/dist/claude/types.js.map +0 -1
- package/dist/env.d.ts +0 -21
- package/dist/env.d.ts.map +0 -1
- package/dist/env.js +0 -49
- package/dist/env.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -415
- package/dist/index.js.map +0 -1
- package/dist/parser/AnsiStripper.d.ts +0 -54
- package/dist/parser/AnsiStripper.d.ts.map +0 -1
- package/dist/parser/AnsiStripper.js +0 -115
- package/dist/parser/AnsiStripper.js.map +0 -1
- package/dist/parser/OptionExtractor.d.ts +0 -31
- package/dist/parser/OptionExtractor.d.ts.map +0 -1
- package/dist/parser/OptionExtractor.js +0 -91
- package/dist/parser/OptionExtractor.js.map +0 -1
- package/dist/parser/OutputParser.d.ts +0 -121
- package/dist/parser/OutputParser.d.ts.map +0 -1
- package/dist/parser/OutputParser.js +0 -306
- package/dist/parser/OutputParser.js.map +0 -1
- package/dist/parser/PromptDetector.d.ts +0 -20
- package/dist/parser/PromptDetector.d.ts.map +0 -1
- package/dist/parser/PromptDetector.js +0 -68
- package/dist/parser/PromptDetector.js.map +0 -1
- package/dist/parser/index.d.ts +0 -7
- package/dist/parser/index.d.ts.map +0 -1
- package/dist/parser/index.js +0 -5
- package/dist/parser/index.js.map +0 -1
- package/dist/parser/types.d.ts +0 -73
- package/dist/parser/types.d.ts.map +0 -1
- package/dist/parser/types.js +0 -2
- package/dist/parser/types.js.map +0 -1
- package/dist/pty/OutputBuffer.d.ts +0 -39
- package/dist/pty/OutputBuffer.d.ts.map +0 -1
- package/dist/pty/OutputBuffer.js +0 -55
- package/dist/pty/OutputBuffer.js.map +0 -1
- package/dist/pty/PtyProcess.d.ts +0 -47
- package/dist/pty/PtyProcess.d.ts.map +0 -1
- package/dist/pty/PtyProcess.js +0 -94
- package/dist/pty/PtyProcess.js.map +0 -1
- package/dist/pty/PtyService.d.ts +0 -55
- package/dist/pty/PtyService.d.ts.map +0 -1
- package/dist/pty/PtyService.js +0 -115
- package/dist/pty/PtyService.js.map +0 -1
- package/dist/pty/index.d.ts +0 -5
- package/dist/pty/index.d.ts.map +0 -1
- package/dist/pty/index.js +0 -4
- package/dist/pty/index.js.map +0 -1
- package/dist/pty/types.d.ts +0 -36
- package/dist/pty/types.d.ts.map +0 -1
- package/dist/pty/types.js +0 -2
- package/dist/pty/types.js.map +0 -1
- package/dist/router/BoundedQueue.d.ts +0 -57
- package/dist/router/BoundedQueue.d.ts.map +0 -1
- package/dist/router/BoundedQueue.js +0 -86
- package/dist/router/BoundedQueue.js.map +0 -1
- package/dist/router/EventRouter.d.ts +0 -103
- package/dist/router/EventRouter.d.ts.map +0 -1
- package/dist/router/EventRouter.js +0 -169
- package/dist/router/EventRouter.js.map +0 -1
- package/dist/router/index.d.ts +0 -13
- package/dist/router/index.d.ts.map +0 -1
- package/dist/router/index.js +0 -12
- package/dist/router/index.js.map +0 -1
- package/dist/router/types.d.ts +0 -104
- package/dist/router/types.d.ts.map +0 -1
- package/dist/router/types.js +0 -6
- package/dist/router/types.js.map +0 -1
- package/dist/setup/envWriter.d.ts +0 -22
- package/dist/setup/envWriter.d.ts.map +0 -1
- package/dist/setup/envWriter.js +0 -68
- package/dist/setup/envWriter.js.map +0 -1
- package/dist/setup/index.d.ts +0 -4
- package/dist/setup/index.d.ts.map +0 -1
- package/dist/setup/index.js +0 -4
- package/dist/setup/index.js.map +0 -1
- package/dist/setup/validators.d.ts +0 -22
- package/dist/setup/validators.d.ts.map +0 -1
- package/dist/setup/validators.js +0 -47
- package/dist/setup/validators.js.map +0 -1
- package/dist/setup/wizard.d.ts +0 -7
- package/dist/setup/wizard.d.ts.map +0 -1
- package/dist/setup/wizard.js +0 -56
- package/dist/setup/wizard.js.map +0 -1
- package/dist/telegram/TelegramBot.d.ts +0 -163
- package/dist/telegram/TelegramBot.d.ts.map +0 -1
- package/dist/telegram/TelegramBot.js +0 -634
- package/dist/telegram/TelegramBot.js.map +0 -1
- package/dist/telegram/index.d.ts +0 -7
- package/dist/telegram/index.d.ts.map +0 -1
- package/dist/telegram/index.js +0 -6
- package/dist/telegram/index.js.map +0 -1
- package/dist/telegram/types.d.ts +0 -30
- package/dist/telegram/types.d.ts.map +0 -1
- package/dist/telegram/types.js +0 -5
- package/dist/telegram/types.js.map +0 -1
- package/dist/terminal/TerminalInterface.d.ts +0 -61
- package/dist/terminal/TerminalInterface.d.ts.map +0 -1
- package/dist/terminal/TerminalInterface.js +0 -218
- package/dist/terminal/TerminalInterface.js.map +0 -1
- package/dist/terminal/index.d.ts +0 -3
- package/dist/terminal/index.d.ts.map +0 -1
- package/dist/terminal/index.js +0 -2
- package/dist/terminal/index.js.map +0 -1
- package/dist/terminal/types.d.ts +0 -17
- package/dist/terminal/types.d.ts.map +0 -1
- package/dist/terminal/types.js +0 -2
- package/dist/terminal/types.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/telegram/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/telegram/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/telegram/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,UAAU;AACV,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/telegram/types.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Telegram bot configuration and payload types.
|
|
3
|
-
*/
|
|
4
|
-
import type { PromptOption } from '../parser/types.js';
|
|
5
|
-
/**
|
|
6
|
-
* Configuration for TelegramBot initialization.
|
|
7
|
-
*/
|
|
8
|
-
export interface TelegramConfig {
|
|
9
|
-
/** Telegram Bot API token from BotFather */
|
|
10
|
-
token: string;
|
|
11
|
-
/** Telegram user ID for whitelist authentication (AUTH-01) */
|
|
12
|
-
allowedUserId: number;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Payload for sending notification messages to Telegram.
|
|
16
|
-
* Represents a blocking prompt from Claude that needs user input.
|
|
17
|
-
*/
|
|
18
|
-
export interface NotificationPayload {
|
|
19
|
-
/** Session ID for routing the response back */
|
|
20
|
-
sessionId: string;
|
|
21
|
-
/** The question or prompt text */
|
|
22
|
-
question: string;
|
|
23
|
-
/** Available options for the user to select */
|
|
24
|
-
options: PromptOption[];
|
|
25
|
-
/** Optional raw context for debugging */
|
|
26
|
-
rawContext?: string;
|
|
27
|
-
/** Whether multiple options can be selected (enables toggle buttons) */
|
|
28
|
-
multiSelect?: boolean;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/telegram/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
package/dist/telegram/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/telegram/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { QuestionOption } from '../claude/types.js';
|
|
2
|
-
import type { TerminalInterfaceOptions } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Terminal interface for stdin/stdout interaction alongside Telegram.
|
|
5
|
-
* Handles user input via readline and publishes to EventRouter.
|
|
6
|
-
*
|
|
7
|
-
* Uses composition pattern consistent with EventRouter and ClaudeProcess.
|
|
8
|
-
*/
|
|
9
|
-
export declare class TerminalInterface {
|
|
10
|
-
private readonly router;
|
|
11
|
-
private readonly sessionId;
|
|
12
|
-
private readonly rl;
|
|
13
|
-
private readonly promptString;
|
|
14
|
-
/** Whether the interface is waiting for user input */
|
|
15
|
-
private awaitingInput;
|
|
16
|
-
/** Current question options for numeric selection */
|
|
17
|
-
private currentOptions;
|
|
18
|
-
/** Whether current question is multi-select */
|
|
19
|
-
private isMultiSelect;
|
|
20
|
-
constructor(options: TerminalInterfaceOptions);
|
|
21
|
-
/**
|
|
22
|
-
* Set up handler for line input events
|
|
23
|
-
*/
|
|
24
|
-
private setupLineHandler;
|
|
25
|
-
/**
|
|
26
|
-
* Set up handler for close event (Ctrl+D)
|
|
27
|
-
*/
|
|
28
|
-
private setupCloseHandler;
|
|
29
|
-
/**
|
|
30
|
-
* Display an AskUserQuestion prompt with numbered options
|
|
31
|
-
* @param question - The question text
|
|
32
|
-
* @param options - Available options
|
|
33
|
-
* @param multiSelect - Whether multiple options can be selected
|
|
34
|
-
*/
|
|
35
|
-
displayQuestion(question: string, options: QuestionOption[], multiSelect?: boolean): void;
|
|
36
|
-
/**
|
|
37
|
-
* Display text output to terminal stdout
|
|
38
|
-
*/
|
|
39
|
-
displayText(text: string): void;
|
|
40
|
-
/**
|
|
41
|
-
* Display a notification/status message (clears current line for clean output)
|
|
42
|
-
*/
|
|
43
|
-
displayNotification(message: string): void;
|
|
44
|
-
/**
|
|
45
|
-
* Set whether the interface is awaiting user input
|
|
46
|
-
*/
|
|
47
|
-
setAwaitingInput(value: boolean): void;
|
|
48
|
-
/**
|
|
49
|
-
* Get current awaiting input state
|
|
50
|
-
*/
|
|
51
|
-
isAwaitingInput(): boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Get the current session ID
|
|
54
|
-
*/
|
|
55
|
-
getSessionId(): string;
|
|
56
|
-
/**
|
|
57
|
-
* Close the terminal interface and cleanup readline
|
|
58
|
-
*/
|
|
59
|
-
close(): void;
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=TerminalInterface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TerminalInterface.d.ts","sourceRoot":"","sources":["../../src/terminal/TerminalInterface.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;IACvC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC,sDAAsD;IACtD,OAAO,CAAC,aAAa,CAAS;IAE9B,qDAAqD;IACrD,OAAO,CAAC,cAAc,CAAwB;IAE9C,+CAA+C;IAC/C,OAAO,CAAC,aAAa,CAAS;gBAElB,OAAO,EAAE,wBAAwB;IAe7C;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAgGxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAMzB;;;;;OAKG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,WAAW,UAAQ,GAAG,IAAI;IAoCvF;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAW1C;;OAEG;IACH,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAOtC;;OAEG;IACH,eAAe,IAAI,OAAO;IAI1B;;OAEG;IACH,YAAY,IAAI,MAAM;IAItB;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { createInterface } from 'node:readline';
|
|
2
|
-
import { stdin, stdout, stderr } from 'node:process';
|
|
3
|
-
/**
|
|
4
|
-
* Terminal interface for stdin/stdout interaction alongside Telegram.
|
|
5
|
-
* Handles user input via readline and publishes to EventRouter.
|
|
6
|
-
*
|
|
7
|
-
* Uses composition pattern consistent with EventRouter and ClaudeProcess.
|
|
8
|
-
*/
|
|
9
|
-
export class TerminalInterface {
|
|
10
|
-
router;
|
|
11
|
-
sessionId;
|
|
12
|
-
rl;
|
|
13
|
-
promptString;
|
|
14
|
-
/** Whether the interface is waiting for user input */
|
|
15
|
-
awaitingInput = false;
|
|
16
|
-
/** Current question options for numeric selection */
|
|
17
|
-
currentOptions = [];
|
|
18
|
-
/** Whether current question is multi-select */
|
|
19
|
-
isMultiSelect = false;
|
|
20
|
-
constructor(options) {
|
|
21
|
-
this.router = options.router;
|
|
22
|
-
this.sessionId = options.sessionId;
|
|
23
|
-
this.promptString = options.prompt ?? '> ';
|
|
24
|
-
this.rl = createInterface({
|
|
25
|
-
input: stdin,
|
|
26
|
-
output: stdout,
|
|
27
|
-
prompt: this.promptString,
|
|
28
|
-
});
|
|
29
|
-
this.setupLineHandler();
|
|
30
|
-
this.setupCloseHandler();
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Set up handler for line input events
|
|
34
|
-
*/
|
|
35
|
-
setupLineHandler() {
|
|
36
|
-
this.rl.on('line', (line) => {
|
|
37
|
-
// Skip if not awaiting input
|
|
38
|
-
if (!this.awaitingInput) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
// Skip empty lines
|
|
42
|
-
const trimmed = line.trim();
|
|
43
|
-
if (trimmed === '') {
|
|
44
|
-
this.rl.prompt();
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (this.isMultiSelect && trimmed.includes(',')) {
|
|
48
|
-
// Multi-select: parse comma-separated numbers
|
|
49
|
-
const indices = [];
|
|
50
|
-
const labels = [];
|
|
51
|
-
for (const part of trimmed.split(',')) {
|
|
52
|
-
const num = parseInt(part.trim(), 10);
|
|
53
|
-
if (!isNaN(num) && num >= 1 && num <= this.currentOptions.length) {
|
|
54
|
-
const idx = num - 1; // 0-based
|
|
55
|
-
if (!indices.includes(idx)) {
|
|
56
|
-
indices.push(idx);
|
|
57
|
-
// Get the option label
|
|
58
|
-
const opt = this.currentOptions[idx];
|
|
59
|
-
labels.push(opt.label);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (indices.length > 0) {
|
|
64
|
-
// Send comma-separated labels as text
|
|
65
|
-
const responseText = labels.join(', ');
|
|
66
|
-
this.router.publishInbound({
|
|
67
|
-
sessionId: this.sessionId,
|
|
68
|
-
type: 'response',
|
|
69
|
-
payload: {
|
|
70
|
-
text: responseText,
|
|
71
|
-
},
|
|
72
|
-
timestamp: Date.now(),
|
|
73
|
-
source: 'terminal',
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
// No valid numbers, treat as freeform
|
|
78
|
-
this.router.publishInbound({
|
|
79
|
-
sessionId: this.sessionId,
|
|
80
|
-
type: 'response',
|
|
81
|
-
payload: {
|
|
82
|
-
text: trimmed,
|
|
83
|
-
},
|
|
84
|
-
timestamp: Date.now(),
|
|
85
|
-
source: 'terminal',
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
// Single number or freeform text (existing logic)
|
|
91
|
-
const numericValue = parseInt(trimmed, 10);
|
|
92
|
-
if (!isNaN(numericValue) &&
|
|
93
|
-
numericValue >= 1 &&
|
|
94
|
-
numericValue <= this.currentOptions.length) {
|
|
95
|
-
// Numeric selection - publish with optionIndex (0-based)
|
|
96
|
-
this.router.publishInbound({
|
|
97
|
-
sessionId: this.sessionId,
|
|
98
|
-
type: 'response',
|
|
99
|
-
payload: {
|
|
100
|
-
text: trimmed,
|
|
101
|
-
optionIndex: numericValue - 1,
|
|
102
|
-
},
|
|
103
|
-
timestamp: Date.now(),
|
|
104
|
-
source: 'terminal',
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
// Freeform text response
|
|
109
|
-
this.router.publishInbound({
|
|
110
|
-
sessionId: this.sessionId,
|
|
111
|
-
type: 'response',
|
|
112
|
-
payload: {
|
|
113
|
-
text: trimmed,
|
|
114
|
-
},
|
|
115
|
-
timestamp: Date.now(),
|
|
116
|
-
source: 'terminal',
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
// Clear awaiting state after input received
|
|
121
|
-
this.awaitingInput = false;
|
|
122
|
-
this.currentOptions = [];
|
|
123
|
-
this.isMultiSelect = false;
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Set up handler for close event (Ctrl+D)
|
|
128
|
-
*/
|
|
129
|
-
setupCloseHandler() {
|
|
130
|
-
this.rl.on('close', () => {
|
|
131
|
-
stderr.write('[Terminal] Input stream closed (Ctrl+D)\n');
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Display an AskUserQuestion prompt with numbered options
|
|
136
|
-
* @param question - The question text
|
|
137
|
-
* @param options - Available options
|
|
138
|
-
* @param multiSelect - Whether multiple options can be selected
|
|
139
|
-
*/
|
|
140
|
-
displayQuestion(question, options, multiSelect = false) {
|
|
141
|
-
// Clear current line for clean output
|
|
142
|
-
process.stdout.clearLine?.(0);
|
|
143
|
-
process.stdout.cursorTo?.(0);
|
|
144
|
-
// Print separator and question
|
|
145
|
-
console.log('\n' + '='.repeat(60));
|
|
146
|
-
const selectHint = multiSelect ? ' [multi-select]' : '';
|
|
147
|
-
console.log(`Claude is asking:${selectHint}\n`);
|
|
148
|
-
console.log(question + '\n');
|
|
149
|
-
// Print numbered options
|
|
150
|
-
options.forEach((opt, index) => {
|
|
151
|
-
const line = opt.description
|
|
152
|
-
? ` ${index + 1}. ${opt.label} - ${opt.description}`
|
|
153
|
-
: ` ${index + 1}. ${opt.label}`;
|
|
154
|
-
console.log(line);
|
|
155
|
-
});
|
|
156
|
-
// Different hint for multi-select vs single-select
|
|
157
|
-
if (multiSelect) {
|
|
158
|
-
console.log('\nEnter numbers separated by commas (e.g., 1,3), or type a response:');
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
console.log('\nEnter number to select, or type a response:');
|
|
162
|
-
}
|
|
163
|
-
console.log('='.repeat(60) + '\n');
|
|
164
|
-
// Set state for input handling
|
|
165
|
-
this.awaitingInput = true;
|
|
166
|
-
this.currentOptions = options;
|
|
167
|
-
this.isMultiSelect = multiSelect;
|
|
168
|
-
// Show prompt
|
|
169
|
-
this.rl.prompt();
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Display text output to terminal stdout
|
|
173
|
-
*/
|
|
174
|
-
displayText(text) {
|
|
175
|
-
stdout.write(text);
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Display a notification/status message (clears current line for clean output)
|
|
179
|
-
*/
|
|
180
|
-
displayNotification(message) {
|
|
181
|
-
// Clear current line and move cursor to start for clean output
|
|
182
|
-
process.stdout.clearLine?.(0);
|
|
183
|
-
process.stdout.cursorTo?.(0);
|
|
184
|
-
console.log(`\n${message}`);
|
|
185
|
-
// Re-show prompt if awaiting input
|
|
186
|
-
if (this.awaitingInput) {
|
|
187
|
-
this.rl.prompt(true);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Set whether the interface is awaiting user input
|
|
192
|
-
*/
|
|
193
|
-
setAwaitingInput(value) {
|
|
194
|
-
this.awaitingInput = value;
|
|
195
|
-
if (value) {
|
|
196
|
-
this.rl.prompt();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Get current awaiting input state
|
|
201
|
-
*/
|
|
202
|
-
isAwaitingInput() {
|
|
203
|
-
return this.awaitingInput;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Get the current session ID
|
|
207
|
-
*/
|
|
208
|
-
getSessionId() {
|
|
209
|
-
return this.sessionId;
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Close the terminal interface and cleanup readline
|
|
213
|
-
*/
|
|
214
|
-
close() {
|
|
215
|
-
this.rl.close();
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
//# sourceMappingURL=TerminalInterface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TerminalInterface.js","sourceRoot":"","sources":["../../src/terminal/TerminalInterface.ts"],"names":[],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AC,KAAK,EAAE,CAAC;IAClB,CAAC;CACF"}
|
package/dist/terminal/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/terminal/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/terminal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/terminal/types.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { QuestionOption } from '../claude/types.js';
|
|
2
|
-
import type { EventRouter } from '../router/EventRouter.js';
|
|
3
|
-
/** Options for creating TerminalInterface */
|
|
4
|
-
export interface TerminalInterfaceOptions {
|
|
5
|
-
/** EventRouter for publishing inbound events */
|
|
6
|
-
router: EventRouter;
|
|
7
|
-
/** Session ID for this terminal instance */
|
|
8
|
-
sessionId: string;
|
|
9
|
-
/** Prompt string (default: '> ') */
|
|
10
|
-
prompt?: string;
|
|
11
|
-
}
|
|
12
|
-
/** Display options for AskUserQuestion in terminal */
|
|
13
|
-
export interface TerminalQuestionDisplay {
|
|
14
|
-
question: string;
|
|
15
|
-
options: QuestionOption[];
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/terminal/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,gDAAgD;IAChD,MAAM,EAAE,WAAW,CAAC;IACpB,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,sDAAsD;AACtD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B"}
|
package/dist/terminal/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/terminal/types.ts"],"names":[],"mappings":""}
|