sylas-ai 0.2.21 → 0.2.22
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/LICENSE +21 -0
- package/dist/app.js +2 -2
- package/dist/app.js.map +1 -1
- package/dist/commands/RefreshTokenCommand.js +2 -2
- package/dist/commands/RefreshTokenCommand.js.map +1 -1
- package/dist/commands/SelfAuthCommand.js +2 -2
- package/dist/commands/SelfAuthCommand.js.map +1 -1
- package/dist/utils/openUrl.d.ts +7 -0
- package/dist/utils/openUrl.d.ts.map +1 -0
- package/dist/utils/openUrl.js +33 -0
- package/dist/utils/openUrl.js.map +1 -0
- package/package.json +12 -11
- package/dist/src/Application.d.ts +0 -75
- package/dist/src/Application.d.ts.map +0 -1
- package/dist/src/Application.js +0 -289
- package/dist/src/Application.js.map +0 -1
- package/dist/src/app.d.ts +0 -3
- package/dist/src/app.d.ts.map +0 -1
- package/dist/src/app.js +0 -93
- package/dist/src/app.js.map +0 -1
- package/dist/src/commands/AuthCommand.d.ts +0 -8
- package/dist/src/commands/AuthCommand.d.ts.map +0 -1
- package/dist/src/commands/AuthCommand.js +0 -70
- package/dist/src/commands/AuthCommand.js.map +0 -1
- package/dist/src/commands/CheckTokensCommand.d.ts +0 -8
- package/dist/src/commands/CheckTokensCommand.d.ts.map +0 -1
- package/dist/src/commands/CheckTokensCommand.js +0 -53
- package/dist/src/commands/CheckTokensCommand.js.map +0 -1
- package/dist/src/commands/ICommand.d.ts +0 -38
- package/dist/src/commands/ICommand.d.ts.map +0 -1
- package/dist/src/commands/ICommand.js +0 -37
- package/dist/src/commands/ICommand.js.map +0 -1
- package/dist/src/commands/RefreshTokenCommand.d.ts +0 -8
- package/dist/src/commands/RefreshTokenCommand.d.ts.map +0 -1
- package/dist/src/commands/RefreshTokenCommand.js +0 -152
- package/dist/src/commands/RefreshTokenCommand.js.map +0 -1
- package/dist/src/commands/SelfAddRepoCommand.d.ts +0 -17
- package/dist/src/commands/SelfAddRepoCommand.d.ts.map +0 -1
- package/dist/src/commands/SelfAddRepoCommand.js +0 -164
- package/dist/src/commands/SelfAddRepoCommand.js.map +0 -1
- package/dist/src/commands/SelfAuthCommand.d.ts +0 -16
- package/dist/src/commands/SelfAuthCommand.d.ts.map +0 -1
- package/dist/src/commands/SelfAuthCommand.js +0 -213
- package/dist/src/commands/SelfAuthCommand.js.map +0 -1
- package/dist/src/commands/StartCommand.d.ts +0 -8
- package/dist/src/commands/StartCommand.d.ts.map +0 -1
- package/dist/src/commands/StartCommand.js +0 -76
- package/dist/src/commands/StartCommand.js.map +0 -1
- package/dist/src/config/constants.d.ts +0 -12
- package/dist/src/config/constants.d.ts.map +0 -1
- package/dist/src/config/constants.js +0 -19
- package/dist/src/config/constants.js.map +0 -1
- package/dist/src/config/types.d.ts +0 -21
- package/dist/src/config/types.d.ts.map +0 -1
- package/dist/src/config/types.js +0 -2
- package/dist/src/config/types.js.map +0 -1
- package/dist/src/services/ConfigService.d.ts +0 -37
- package/dist/src/services/ConfigService.d.ts.map +0 -1
- package/dist/src/services/ConfigService.js +0 -121
- package/dist/src/services/ConfigService.js.map +0 -1
- package/dist/src/services/Logger.d.ts +0 -77
- package/dist/src/services/Logger.d.ts.map +0 -1
- package/dist/src/services/Logger.js +0 -100
- package/dist/src/services/Logger.js.map +0 -1
- package/dist/src/services/WorkerService.d.ts +0 -59
- package/dist/src/services/WorkerService.d.ts.map +0 -1
- package/dist/src/services/WorkerService.js +0 -220
- package/dist/src/services/WorkerService.js.map +0 -1
- package/dist/src/ui/CLIPrompts.d.ts +0 -18
- package/dist/src/ui/CLIPrompts.d.ts.map +0 -1
- package/dist/src/ui/CLIPrompts.js +0 -53
- package/dist/src/ui/CLIPrompts.js.map +0 -1
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
- package/dist/vitest.config.js +0 -13
- package/dist/vitest.config.js.map +0 -1
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { dirname, resolve } from "node:path";
|
|
3
|
-
/**
|
|
4
|
-
* Service responsible for configuration management
|
|
5
|
-
* Handles loading, saving, and validation of edge configuration
|
|
6
|
-
*/
|
|
7
|
-
export class ConfigService {
|
|
8
|
-
logger;
|
|
9
|
-
configPath;
|
|
10
|
-
constructor(sylasHome, logger) {
|
|
11
|
-
this.logger = logger;
|
|
12
|
-
this.configPath = resolve(sylasHome, "config.json");
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Get the configuration file path
|
|
16
|
-
*/
|
|
17
|
-
getConfigPath() {
|
|
18
|
-
return this.configPath;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Load edge configuration from disk
|
|
22
|
-
*/
|
|
23
|
-
load() {
|
|
24
|
-
let config = { repositories: [] };
|
|
25
|
-
if (existsSync(this.configPath)) {
|
|
26
|
-
try {
|
|
27
|
-
const content = readFileSync(this.configPath, "utf-8");
|
|
28
|
-
config = JSON.parse(content);
|
|
29
|
-
}
|
|
30
|
-
catch (e) {
|
|
31
|
-
this.logger.error(`Failed to load edge config: ${e.message}`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
// Strip promptTemplatePath from all repositories to ensure built-in template is used
|
|
35
|
-
if (config.repositories) {
|
|
36
|
-
config.repositories = config.repositories.map((repo) => {
|
|
37
|
-
const { promptTemplatePath, ...repoWithoutTemplate } = repo;
|
|
38
|
-
if (promptTemplatePath) {
|
|
39
|
-
this.logger.info(`Ignoring custom prompt template for repository: ${repo.name} (using built-in template)`);
|
|
40
|
-
}
|
|
41
|
-
return repoWithoutTemplate;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
// Run migrations on loaded config
|
|
45
|
-
config = this.migrateConfig(config);
|
|
46
|
-
return config;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Run migrations on config to ensure it's up to date
|
|
50
|
-
* Persists changes to disk if any migrations were applied
|
|
51
|
-
*/
|
|
52
|
-
migrateConfig(config) {
|
|
53
|
-
let configModified = false;
|
|
54
|
-
// Migration: Rename legacy global model fields to Claude-specific names
|
|
55
|
-
// Keep old values but move them to the new keys and remove deprecated fields.
|
|
56
|
-
if (config.defaultModel !== undefined) {
|
|
57
|
-
if (!config.claudeDefaultModel) {
|
|
58
|
-
config.claudeDefaultModel = config.defaultModel;
|
|
59
|
-
this.logger.info(`[Migration] Moved "defaultModel" to "claudeDefaultModel"`);
|
|
60
|
-
}
|
|
61
|
-
delete config.defaultModel;
|
|
62
|
-
configModified = true;
|
|
63
|
-
}
|
|
64
|
-
if (config.defaultFallbackModel !== undefined) {
|
|
65
|
-
if (!config.claudeDefaultFallbackModel) {
|
|
66
|
-
config.claudeDefaultFallbackModel = config.defaultFallbackModel;
|
|
67
|
-
this.logger.info(`[Migration] Moved "defaultFallbackModel" to "claudeDefaultFallbackModel"`);
|
|
68
|
-
}
|
|
69
|
-
delete config
|
|
70
|
-
.defaultFallbackModel;
|
|
71
|
-
configModified = true;
|
|
72
|
-
}
|
|
73
|
-
// Migration: Add "Skill" to allowedTools arrays that don't have it
|
|
74
|
-
// This enables Claude Skills functionality for existing configurations
|
|
75
|
-
// See: https://code.claude.com/docs/en/skills
|
|
76
|
-
// See: https://platform.claude.com/docs/en/agent-sdk/skills
|
|
77
|
-
if (config.repositories) {
|
|
78
|
-
for (const repo of config.repositories) {
|
|
79
|
-
if (repo.allowedTools && Array.isArray(repo.allowedTools)) {
|
|
80
|
-
if (!repo.allowedTools.includes("Skill")) {
|
|
81
|
-
repo.allowedTools.push("Skill");
|
|
82
|
-
configModified = true;
|
|
83
|
-
this.logger.info(`[Migration] Added "Skill" to allowedTools for repository: ${repo.name}`);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// Persist changes if any migrations were applied
|
|
89
|
-
if (configModified) {
|
|
90
|
-
this.save(config);
|
|
91
|
-
this.logger.info("[Migration] Configuration updated and saved to disk");
|
|
92
|
-
}
|
|
93
|
-
return config;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Save edge configuration to disk
|
|
97
|
-
*/
|
|
98
|
-
save(config) {
|
|
99
|
-
const configDir = dirname(this.configPath);
|
|
100
|
-
// Ensure the ~/.sylas directory exists
|
|
101
|
-
if (!existsSync(configDir)) {
|
|
102
|
-
mkdirSync(configDir, { recursive: true });
|
|
103
|
-
}
|
|
104
|
-
writeFileSync(this.configPath, JSON.stringify(config, null, 2));
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Update a specific field in the configuration
|
|
108
|
-
*/
|
|
109
|
-
update(updater) {
|
|
110
|
-
const config = this.load();
|
|
111
|
-
const updated = updater(config);
|
|
112
|
-
this.save(updated);
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Check if configuration exists
|
|
116
|
-
*/
|
|
117
|
-
exists() {
|
|
118
|
-
return existsSync(this.configPath);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
//# sourceMappingURL=ConfigService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigService.js","sourceRoot":"","sources":["../../../src/services/ConfigService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAI7C;;;GAGG;AACH,MAAM,OAAO,aAAa;IAKhB;IAJD,UAAU,CAAS;IAE3B,YACC,SAAiB,EACT,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAEtB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,aAAa;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAI;QAC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,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,MAAkB;QACtB,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAE3C,uCAAuC;QACvC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC5B,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,CAAC;QAED,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAA2C;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,MAAM;QACL,OAAO,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;CACD"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { type ILogger, type LogContext, type LogLevel } from "sylas-core";
|
|
2
|
-
export { LogLevel } from "sylas-core";
|
|
3
|
-
/**
|
|
4
|
-
* Logger configuration options
|
|
5
|
-
*/
|
|
6
|
-
export interface LoggerOptions {
|
|
7
|
-
/** Minimum log level to output */
|
|
8
|
-
level?: LogLevel;
|
|
9
|
-
/** Prefix to add to all log messages (used as component name) */
|
|
10
|
-
prefix?: string;
|
|
11
|
-
/** Whether to include timestamps */
|
|
12
|
-
timestamps?: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* CLI-specific logger that wraps the core ILogger.
|
|
16
|
-
*
|
|
17
|
-
* Provides CLI-presentation features (emoji formatting, raw output,
|
|
18
|
-
* dividers, child loggers) on top of the standard core logging interface.
|
|
19
|
-
*
|
|
20
|
-
* Implements ILogger so it can be passed to packages that expect the core interface.
|
|
21
|
-
*/
|
|
22
|
-
export declare class Logger implements ILogger {
|
|
23
|
-
private coreLogger;
|
|
24
|
-
private prefix;
|
|
25
|
-
private timestamps;
|
|
26
|
-
constructor(options?: LoggerOptions);
|
|
27
|
-
/**
|
|
28
|
-
* Debug log (lowest priority)
|
|
29
|
-
*/
|
|
30
|
-
debug(message: string, ...args: any[]): void;
|
|
31
|
-
/**
|
|
32
|
-
* Info log (normal priority)
|
|
33
|
-
*/
|
|
34
|
-
info(message: string, ...args: any[]): void;
|
|
35
|
-
/**
|
|
36
|
-
* Success log - maps to info level with check mark prefix
|
|
37
|
-
*/
|
|
38
|
-
success(message: string, ...args: any[]): void;
|
|
39
|
-
/**
|
|
40
|
-
* Warning log
|
|
41
|
-
*/
|
|
42
|
-
warn(message: string, ...args: any[]): void;
|
|
43
|
-
/**
|
|
44
|
-
* Error log (highest priority)
|
|
45
|
-
*/
|
|
46
|
-
error(message: string, ...args: any[]): void;
|
|
47
|
-
/**
|
|
48
|
-
* Raw output without formatting (always outputs regardless of level)
|
|
49
|
-
*/
|
|
50
|
-
raw(message: string, ...args: any[]): void;
|
|
51
|
-
/**
|
|
52
|
-
* Create a child logger with a prefix
|
|
53
|
-
*/
|
|
54
|
-
child(prefix: string): Logger;
|
|
55
|
-
/**
|
|
56
|
-
* Print a divider line
|
|
57
|
-
*/
|
|
58
|
-
divider(length?: number): void;
|
|
59
|
-
/**
|
|
60
|
-
* Create a new logger with additional context.
|
|
61
|
-
* Delegates to the core logger's withContext.
|
|
62
|
-
*/
|
|
63
|
-
withContext(context: LogContext): ILogger;
|
|
64
|
-
/**
|
|
65
|
-
* Set log level dynamically
|
|
66
|
-
*/
|
|
67
|
-
setLevel(level: LogLevel): void;
|
|
68
|
-
/**
|
|
69
|
-
* Get current log level
|
|
70
|
-
*/
|
|
71
|
-
getLevel(): LogLevel;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Default logger instance
|
|
75
|
-
*/
|
|
76
|
-
export declare const logger: Logger;
|
|
77
|
-
//# sourceMappingURL=Logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../../src/services/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,kCAAkC;IAClC,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,qBAAa,MAAO,YAAW,OAAO;IACrC,OAAO,CAAC,UAAU,CAAU;IAC5B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,UAAU,CAAU;gBAEhB,OAAO,GAAE,aAAkB;IASvC;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI5C;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI3C;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI9C;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI3C;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI5C;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAI1C;;OAEG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAQ7B;;OAEG;IACH,OAAO,CAAC,MAAM,SAAK,GAAG,IAAI;IAI1B;;;OAGG;IACH,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO;IAIzC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAI/B;;OAEG;IACH,QAAQ,IAAI,QAAQ;CAGpB;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,QAAe,CAAC"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { createLogger, } from "sylas-core";
|
|
2
|
-
// Re-export LogLevel from sylas-core so existing consumers don't break
|
|
3
|
-
export { LogLevel } from "sylas-core";
|
|
4
|
-
/**
|
|
5
|
-
* CLI-specific logger that wraps the core ILogger.
|
|
6
|
-
*
|
|
7
|
-
* Provides CLI-presentation features (emoji formatting, raw output,
|
|
8
|
-
* dividers, child loggers) on top of the standard core logging interface.
|
|
9
|
-
*
|
|
10
|
-
* Implements ILogger so it can be passed to packages that expect the core interface.
|
|
11
|
-
*/
|
|
12
|
-
export class Logger {
|
|
13
|
-
coreLogger;
|
|
14
|
-
prefix;
|
|
15
|
-
timestamps;
|
|
16
|
-
constructor(options = {}) {
|
|
17
|
-
this.prefix = options.prefix ?? "";
|
|
18
|
-
this.timestamps = options.timestamps ?? false;
|
|
19
|
-
this.coreLogger = createLogger({
|
|
20
|
-
component: this.prefix || "CLI",
|
|
21
|
-
level: options.level,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Debug log (lowest priority)
|
|
26
|
-
*/
|
|
27
|
-
debug(message, ...args) {
|
|
28
|
-
this.coreLogger.debug(message, ...args);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Info log (normal priority)
|
|
32
|
-
*/
|
|
33
|
-
info(message, ...args) {
|
|
34
|
-
this.coreLogger.info(message, ...args);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Success log - maps to info level with check mark prefix
|
|
38
|
-
*/
|
|
39
|
-
success(message, ...args) {
|
|
40
|
-
this.coreLogger.info(message, ...args);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Warning log
|
|
44
|
-
*/
|
|
45
|
-
warn(message, ...args) {
|
|
46
|
-
this.coreLogger.warn(message, ...args);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Error log (highest priority)
|
|
50
|
-
*/
|
|
51
|
-
error(message, ...args) {
|
|
52
|
-
this.coreLogger.error(message, ...args);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Raw output without formatting (always outputs regardless of level)
|
|
56
|
-
*/
|
|
57
|
-
raw(message, ...args) {
|
|
58
|
-
console.log(message, ...args);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Create a child logger with a prefix
|
|
62
|
-
*/
|
|
63
|
-
child(prefix) {
|
|
64
|
-
return new Logger({
|
|
65
|
-
level: this.coreLogger.getLevel(),
|
|
66
|
-
prefix: this.prefix ? `${this.prefix}:${prefix}` : prefix,
|
|
67
|
-
timestamps: this.timestamps,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Print a divider line
|
|
72
|
-
*/
|
|
73
|
-
divider(length = 70) {
|
|
74
|
-
this.raw("\u2500".repeat(length));
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Create a new logger with additional context.
|
|
78
|
-
* Delegates to the core logger's withContext.
|
|
79
|
-
*/
|
|
80
|
-
withContext(context) {
|
|
81
|
-
return this.coreLogger.withContext(context);
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Set log level dynamically
|
|
85
|
-
*/
|
|
86
|
-
setLevel(level) {
|
|
87
|
-
this.coreLogger.setLevel(level);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Get current log level
|
|
91
|
-
*/
|
|
92
|
-
getLevel() {
|
|
93
|
-
return this.coreLogger.getLevel();
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Default logger instance
|
|
98
|
-
*/
|
|
99
|
-
export const logger = new Logger();
|
|
100
|
-
//# sourceMappingURL=Logger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../src/services/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,YAAY,GAIZ,MAAM,YAAY,CAAC;AAEpB,uEAAuE;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AActC;;;;;;;GAOG;AACH,MAAM,OAAO,MAAM;IACV,UAAU,CAAU;IACpB,MAAM,CAAS;IACf,UAAU,CAAU;IAE5B,YAAY,UAAyB,EAAE;QACtC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC;QAC9C,IAAI,CAAC,UAAU,GAAG,YAAY,CAAC;YAC9B,SAAS,EAAE,IAAI,CAAC,MAAM,IAAI,KAAK;YAC/B,KAAK,EAAE,OAAO,CAAC,KAAK;SACpB,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAe,EAAE,GAAG,IAAW;QACpC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,OAAe,EAAE,GAAG,IAAW;QACnC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAe,EAAE,GAAG,IAAW;QACtC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,O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D;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { RepositoryConfig } from "sylas-core";
|
|
2
|
-
import type { GitService } from "sylas-edge-worker";
|
|
3
|
-
import { EdgeWorker } from "sylas-edge-worker";
|
|
4
|
-
import type { ConfigService } from "./ConfigService.js";
|
|
5
|
-
import type { Logger } from "./Logger.js";
|
|
6
|
-
/**
|
|
7
|
-
* Service responsible for EdgeWorker and Cloudflare tunnel management
|
|
8
|
-
*/
|
|
9
|
-
export declare class WorkerService {
|
|
10
|
-
private configService;
|
|
11
|
-
private gitService;
|
|
12
|
-
private sylasHome;
|
|
13
|
-
private logger;
|
|
14
|
-
private version?;
|
|
15
|
-
private edgeWorker;
|
|
16
|
-
private setupWaitingServer;
|
|
17
|
-
private isShuttingDown;
|
|
18
|
-
constructor(configService: ConfigService, gitService: GitService, sylasHome: string, logger: Logger, version?: string | undefined);
|
|
19
|
-
/**
|
|
20
|
-
* Get the EdgeWorker instance
|
|
21
|
-
*/
|
|
22
|
-
getEdgeWorker(): EdgeWorker | null;
|
|
23
|
-
/**
|
|
24
|
-
* Get the server port from EdgeWorker
|
|
25
|
-
*/
|
|
26
|
-
getServerPort(): number;
|
|
27
|
-
/**
|
|
28
|
-
* Start setup waiting mode - server infrastructure only, no EdgeWorker
|
|
29
|
-
* Used after initial authentication while waiting for server configuration
|
|
30
|
-
*/
|
|
31
|
-
startSetupWaitingMode(): Promise<void>;
|
|
32
|
-
/**
|
|
33
|
-
* Start idle mode - server infrastructure only, no EdgeWorker
|
|
34
|
-
* Used after onboarding when no repositories are configured
|
|
35
|
-
*/
|
|
36
|
-
startIdleMode(): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Stop the setup waiting mode or idle mode server
|
|
39
|
-
* Must be called before starting EdgeWorker to avoid port conflicts
|
|
40
|
-
*/
|
|
41
|
-
stopWaitingServer(): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* Start the EdgeWorker with given configuration
|
|
44
|
-
*/
|
|
45
|
-
startEdgeWorker(params: {
|
|
46
|
-
repositories: RepositoryConfig[];
|
|
47
|
-
ngrokAuthToken?: string;
|
|
48
|
-
onOAuthCallback?: (token: string, workspaceId: string, workspaceName: string) => Promise<void>;
|
|
49
|
-
}): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* Set up event handlers for EdgeWorker
|
|
52
|
-
*/
|
|
53
|
-
private setupEventHandlers;
|
|
54
|
-
/**
|
|
55
|
-
* Stop the EdgeWorker
|
|
56
|
-
*/
|
|
57
|
-
stop(): Promise<void>;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=WorkerService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkerService.d.ts","sourceRoot":"","sources":["../../../src/services/WorkerService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2B,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,qBAAa,aAAa;IAMxB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO,CAAC;IATjB,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,kBAAkB,CAAa;IACvC,OAAO,CAAC,cAAc,CAAS;gBAGtB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,YAAA;IAGzB;;OAEG;IACH,aAAa,IAAI,UAAU,GAAG,IAAI;IAIlC;;OAEG;IACH,aAAa,IAAI,MAAM;IAIvB;;;OAGG;IACG,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;IAuD5C;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAwDpC;;;OAGG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IASxC;;OAEG;IACG,eAAe,CAAC,MAAM,EAAE;QAC7B,YAAY,EAAE,gBAAgB,EAAE,CAAC;QACjC,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,eAAe,CAAC,EAAE,CACjB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,KACjB,OAAO,CAAC,IAAI,CAAC,CAAC;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC;IA6EjB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA2C1B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAmB3B"}
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { getSylasAppUrl } from "sylas-cloudflare-tunnel-client";
|
|
2
|
-
import { EdgeWorker } from "sylas-edge-worker";
|
|
3
|
-
import { DEFAULT_SERVER_PORT, parsePort } from "../config/constants.js";
|
|
4
|
-
/**
|
|
5
|
-
* Service responsible for EdgeWorker and Cloudflare tunnel management
|
|
6
|
-
*/
|
|
7
|
-
export class WorkerService {
|
|
8
|
-
configService;
|
|
9
|
-
gitService;
|
|
10
|
-
sylasHome;
|
|
11
|
-
logger;
|
|
12
|
-
version;
|
|
13
|
-
edgeWorker = null;
|
|
14
|
-
setupWaitingServer = null; // SharedApplicationServer instance during setup waiting mode
|
|
15
|
-
isShuttingDown = false;
|
|
16
|
-
constructor(configService, gitService, sylasHome, logger, version) {
|
|
17
|
-
this.configService = configService;
|
|
18
|
-
this.gitService = gitService;
|
|
19
|
-
this.sylasHome = sylasHome;
|
|
20
|
-
this.logger = logger;
|
|
21
|
-
this.version = version;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Get the EdgeWorker instance
|
|
25
|
-
*/
|
|
26
|
-
getEdgeWorker() {
|
|
27
|
-
return this.edgeWorker;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Get the server port from EdgeWorker
|
|
31
|
-
*/
|
|
32
|
-
getServerPort() {
|
|
33
|
-
return this.edgeWorker?.getServerPort() || DEFAULT_SERVER_PORT;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Start setup waiting mode - server infrastructure only, no EdgeWorker
|
|
37
|
-
* Used after initial authentication while waiting for server configuration
|
|
38
|
-
*/
|
|
39
|
-
async startSetupWaitingMode() {
|
|
40
|
-
const { SharedApplicationServer } = await import("sylas-edge-worker");
|
|
41
|
-
const { ConfigUpdater } = await import("sylas-config-updater");
|
|
42
|
-
// Determine server configuration
|
|
43
|
-
const isExternalHost = process.env.SYLAS_HOST_EXTERNAL?.toLowerCase().trim() === "true";
|
|
44
|
-
const serverPort = parsePort(process.env.SYLAS_SERVER_PORT, DEFAULT_SERVER_PORT);
|
|
45
|
-
const serverHost = isExternalHost ? "0.0.0.0" : "localhost";
|
|
46
|
-
// Create and start SharedApplicationServer
|
|
47
|
-
this.setupWaitingServer = new SharedApplicationServer(serverPort, serverHost);
|
|
48
|
-
this.setupWaitingServer.initializeFastify();
|
|
49
|
-
// Register ConfigUpdater routes
|
|
50
|
-
const configUpdater = new ConfigUpdater(this.setupWaitingServer.getFastifyInstance(), this.sylasHome, process.env.SYLAS_API_KEY || "");
|
|
51
|
-
configUpdater.register();
|
|
52
|
-
this.logger.info("✅ Config updater registered");
|
|
53
|
-
this.logger.info(" Routes: /api/update/sylas-config, /api/update/sylas-env,");
|
|
54
|
-
this.logger.info(" /api/update/repository, /api/test-mcp, /api/configure-mcp");
|
|
55
|
-
// Start the server (this also starts Cloudflare tunnel if CLOUDFLARE_TOKEN is set)
|
|
56
|
-
await this.setupWaitingServer.start();
|
|
57
|
-
this.logger.raw("");
|
|
58
|
-
this.logger.divider(70);
|
|
59
|
-
this.logger.info("⏳ Waiting for configuration from server...");
|
|
60
|
-
this.logger.info(`🔗 Server running on port ${serverPort}`);
|
|
61
|
-
if (process.env.CLOUDFLARE_TOKEN) {
|
|
62
|
-
this.logger.info("🌩️ Cloudflare tunnel: Active");
|
|
63
|
-
}
|
|
64
|
-
this.logger.info("📡 Config updater: Ready");
|
|
65
|
-
this.logger.raw("");
|
|
66
|
-
this.logger.info("Your Sylas instance is ready to receive configuration.");
|
|
67
|
-
this.logger.info(`Complete setup at: ${getSylasAppUrl()}/onboarding`);
|
|
68
|
-
this.logger.divider(70);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Start idle mode - server infrastructure only, no EdgeWorker
|
|
72
|
-
* Used after onboarding when no repositories are configured
|
|
73
|
-
*/
|
|
74
|
-
async startIdleMode() {
|
|
75
|
-
const { SharedApplicationServer } = await import("sylas-edge-worker");
|
|
76
|
-
const { ConfigUpdater } = await import("sylas-config-updater");
|
|
77
|
-
// Determine server configuration
|
|
78
|
-
const isExternalHost = process.env.SYLAS_HOST_EXTERNAL?.toLowerCase().trim() === "true";
|
|
79
|
-
const serverPort = parsePort(process.env.SYLAS_SERVER_PORT, DEFAULT_SERVER_PORT);
|
|
80
|
-
const serverHost = isExternalHost ? "0.0.0.0" : "localhost";
|
|
81
|
-
// Create and start SharedApplicationServer
|
|
82
|
-
this.setupWaitingServer = new SharedApplicationServer(serverPort, serverHost);
|
|
83
|
-
this.setupWaitingServer.initializeFastify();
|
|
84
|
-
// Register ConfigUpdater routes
|
|
85
|
-
const configUpdater = new ConfigUpdater(this.setupWaitingServer.getFastifyInstance(), this.sylasHome, process.env.SYLAS_API_KEY || "");
|
|
86
|
-
configUpdater.register();
|
|
87
|
-
this.logger.info("✅ Config updater registered");
|
|
88
|
-
this.logger.info(" Routes: /api/update/sylas-config, /api/update/sylas-env,");
|
|
89
|
-
this.logger.info(" /api/update/repository, /api/test-mcp, /api/configure-mcp");
|
|
90
|
-
// Start the server (this also starts Cloudflare tunnel if CLOUDFLARE_TOKEN is set)
|
|
91
|
-
await this.setupWaitingServer.start();
|
|
92
|
-
this.logger.raw("");
|
|
93
|
-
this.logger.divider(70);
|
|
94
|
-
this.logger.info("⏸️ No repositories configured");
|
|
95
|
-
this.logger.info(`🔗 Server running on port ${serverPort}`);
|
|
96
|
-
if (process.env.CLOUDFLARE_TOKEN) {
|
|
97
|
-
this.logger.info("🌩️ Cloudflare tunnel: Active");
|
|
98
|
-
}
|
|
99
|
-
this.logger.info("📡 Config updater: Ready");
|
|
100
|
-
this.logger.raw("");
|
|
101
|
-
const appUrl = getSylasAppUrl();
|
|
102
|
-
this.logger.info(`Waiting for repository configuration from ${appUrl}`);
|
|
103
|
-
this.logger.info(`Add repositories at: ${appUrl}/repos`);
|
|
104
|
-
this.logger.divider(70);
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Stop the setup waiting mode or idle mode server
|
|
108
|
-
* Must be called before starting EdgeWorker to avoid port conflicts
|
|
109
|
-
*/
|
|
110
|
-
async stopWaitingServer() {
|
|
111
|
-
if (this.setupWaitingServer) {
|
|
112
|
-
this.logger.info("🛑 Stopping waiting server...");
|
|
113
|
-
await this.setupWaitingServer.stop();
|
|
114
|
-
this.setupWaitingServer = null;
|
|
115
|
-
this.logger.info("✅ Waiting server stopped");
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Start the EdgeWorker with given configuration
|
|
120
|
-
*/
|
|
121
|
-
async startEdgeWorker(params) {
|
|
122
|
-
const { repositories, ngrokAuthToken, onOAuthCallback } = params;
|
|
123
|
-
// Determine if using external host
|
|
124
|
-
const isExternalHost = process.env.SYLAS_HOST_EXTERNAL?.toLowerCase().trim() === "true";
|
|
125
|
-
// Load config once for model defaults
|
|
126
|
-
const edgeConfig = this.configService.load();
|
|
127
|
-
// Create EdgeWorker configuration
|
|
128
|
-
const config = {
|
|
129
|
-
version: this.version,
|
|
130
|
-
repositories,
|
|
131
|
-
sylasHome: this.sylasHome,
|
|
132
|
-
defaultAllowedTools: process.env.ALLOWED_TOOLS?.split(",").map((t) => t.trim()) || [],
|
|
133
|
-
defaultDisallowedTools: process.env.DISALLOWED_TOOLS?.split(",").map((t) => t.trim()) ||
|
|
134
|
-
undefined,
|
|
135
|
-
// Model configuration: environment variables take precedence over config file.
|
|
136
|
-
// Legacy env vars/keys are still accepted for backwards compatibility.
|
|
137
|
-
claudeDefaultModel: process.env.SYLAS_CLAUDE_DEFAULT_MODEL ||
|
|
138
|
-
process.env.SYLAS_DEFAULT_MODEL ||
|
|
139
|
-
edgeConfig.claudeDefaultModel ||
|
|
140
|
-
edgeConfig.defaultModel,
|
|
141
|
-
claudeDefaultFallbackModel: process.env.SYLAS_CLAUDE_DEFAULT_FALLBACK_MODEL ||
|
|
142
|
-
process.env.SYLAS_DEFAULT_FALLBACK_MODEL ||
|
|
143
|
-
edgeConfig.claudeDefaultFallbackModel ||
|
|
144
|
-
edgeConfig.defaultFallbackModel,
|
|
145
|
-
geminiDefaultModel: process.env.SYLAS_GEMINI_DEFAULT_MODEL || edgeConfig.geminiDefaultModel,
|
|
146
|
-
codexDefaultModel: process.env.SYLAS_CODEX_DEFAULT_MODEL || edgeConfig.codexDefaultModel,
|
|
147
|
-
webhookBaseUrl: process.env.SYLAS_BASE_URL,
|
|
148
|
-
serverPort: parsePort(process.env.SYLAS_SERVER_PORT, DEFAULT_SERVER_PORT),
|
|
149
|
-
serverHost: isExternalHost ? "0.0.0.0" : "localhost",
|
|
150
|
-
ngrokAuthToken,
|
|
151
|
-
// User access control configuration
|
|
152
|
-
userAccessControl: edgeConfig.userAccessControl,
|
|
153
|
-
handlers: {
|
|
154
|
-
createWorkspace: async (issue, repository) => {
|
|
155
|
-
return this.gitService.createGitWorktree(issue, repository, edgeConfig.global_setup_script);
|
|
156
|
-
},
|
|
157
|
-
onOAuthCallback,
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
// Create and start EdgeWorker
|
|
161
|
-
this.edgeWorker = new EdgeWorker(config);
|
|
162
|
-
// Set config path for dynamic reloading
|
|
163
|
-
const configPath = this.configService.getConfigPath();
|
|
164
|
-
this.edgeWorker.setConfigPath(configPath);
|
|
165
|
-
// Set up event handlers
|
|
166
|
-
this.setupEventHandlers();
|
|
167
|
-
// Start the worker
|
|
168
|
-
await this.edgeWorker.start();
|
|
169
|
-
this.logger.success("Edge worker started successfully");
|
|
170
|
-
this.logger.info(`Managing ${repositories.length} repositories:`);
|
|
171
|
-
repositories.forEach((repo) => {
|
|
172
|
-
this.logger.info(` - ${repo.name} (${repo.repositoryPath})`);
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Set up event handlers for EdgeWorker
|
|
177
|
-
*/
|
|
178
|
-
setupEventHandlers() {
|
|
179
|
-
if (!this.edgeWorker)
|
|
180
|
-
return;
|
|
181
|
-
// Session events
|
|
182
|
-
this.edgeWorker.on("session:started", (issueId, _issue, repositoryId) => {
|
|
183
|
-
this.logger.info(`Started session for issue ${issueId} in repository ${repositoryId}`);
|
|
184
|
-
});
|
|
185
|
-
this.edgeWorker.on("session:ended", (issueId, exitCode, repositoryId) => {
|
|
186
|
-
this.logger.info(`Session for issue ${issueId} ended with exit code ${exitCode} in repository ${repositoryId}`);
|
|
187
|
-
});
|
|
188
|
-
// Connection events
|
|
189
|
-
this.edgeWorker.on("connected", (token) => {
|
|
190
|
-
this.logger.success(`Connected to proxy with token ending in ...${token.slice(-4)}`);
|
|
191
|
-
});
|
|
192
|
-
this.edgeWorker.on("disconnected", (token, reason) => {
|
|
193
|
-
this.logger.error(`Disconnected from proxy (token ...${token.slice(-4)}): ${reason || "Unknown reason"}`);
|
|
194
|
-
});
|
|
195
|
-
// Error events
|
|
196
|
-
this.edgeWorker.on("error", (error) => {
|
|
197
|
-
this.logger.error(`EdgeWorker error: ${error.message}`);
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Stop the EdgeWorker
|
|
202
|
-
*/
|
|
203
|
-
async stop() {
|
|
204
|
-
if (this.isShuttingDown)
|
|
205
|
-
return;
|
|
206
|
-
this.isShuttingDown = true;
|
|
207
|
-
this.logger.info("\nShutting down edge worker...");
|
|
208
|
-
// Stop setup waiting mode server if still running
|
|
209
|
-
if (this.setupWaitingServer) {
|
|
210
|
-
await this.setupWaitingServer.stop();
|
|
211
|
-
this.setupWaitingServer = null;
|
|
212
|
-
}
|
|
213
|
-
// Stop edge worker (includes stopping shared application server and Cloudflare tunnel)
|
|
214
|
-
if (this.edgeWorker) {
|
|
215
|
-
await this.edgeWorker.stop();
|
|
216
|
-
}
|
|
217
|
-
this.logger.info("Shutdown complete");
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
//# sourceMappingURL=WorkerService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkerService.js","sourceRoot":"","sources":["../../../src/services/WorkerService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAKxE;;GAEG;AACH,MAAM,OAAO,aAAa;IAMhB;IACA;IACA;IACA;IACA;IATD,UAAU,GAAsB,IAAI,CAAC;IACrC,kBAAkB,GAAQ,IAAI,CAAC,CAAC,6DAA6D;IAC7F,cAAc,GAAG,KAAK,CAAC;IAE/B,YACS,aAA4B,EAC5B,UAAsB,EACtB,SAAiB,EACjB,MAAc,EACd,OAAgB;QAJhB,kBAAa,GAAb,aAAa,CAAe;QAC5B,eAAU,GAAV,UAAU,CAAY;QACtB,cAAS,GAAT,SAAS,CAAQ;QACjB,WAAM,GAAN,MAAM,CAAQ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-
* Utility namespace for CLI prompts and user interaction
|
|
3
|
-
*/
|
|
4
|
-
export declare namespace CLIPrompts {
|
|
5
|
-
/**
|
|
6
|
-
* Ask a question and return the user's answer
|
|
7
|
-
*/
|
|
8
|
-
function ask(prompt: string): Promise<string>;
|
|
9
|
-
/**
|
|
10
|
-
* Ask a yes/no question
|
|
11
|
-
*/
|
|
12
|
-
function confirm(prompt: string, defaultValue?: boolean): Promise<boolean>;
|
|
13
|
-
/**
|
|
14
|
-
* Display a menu and get user selection
|
|
15
|
-
*/
|
|
16
|
-
function menu(title: string, options: string[]): Promise<number | null>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=CLIPrompts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CLIPrompts.d.ts","sourceRoot":"","sources":["../../../src/ui/CLIPrompts.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,yBAAiB,UAAU,CAAC;IAC3B;;OAEG;IACH,SAAsB,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAYzD;IAED;;OAEG;IACH,SAAsB,OAAO,CAC5B,MAAM,EAAE,MAAM,EACd,YAAY,UAAQ,GAClB,OAAO,CAAC,OAAO,CAAC,CASlB;IAED;;OAEG;IACH,SAAsB,IAAI,CACzB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgBxB;CACD"}
|