sylas-ai 0.2.21
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.
Potentially problematic release.
This version of sylas-ai might be problematic. Click here for more details.
- package/README.md +52 -0
- package/dist/Application.d.ts +75 -0
- package/dist/Application.d.ts.map +1 -0
- package/dist/Application.js +289 -0
- package/dist/Application.js.map +1 -0
- package/dist/app.d.ts +3 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +93 -0
- package/dist/app.js.map +1 -0
- package/dist/commands/AuthCommand.d.ts +8 -0
- package/dist/commands/AuthCommand.d.ts.map +1 -0
- package/dist/commands/AuthCommand.js +70 -0
- package/dist/commands/AuthCommand.js.map +1 -0
- package/dist/commands/CheckTokensCommand.d.ts +8 -0
- package/dist/commands/CheckTokensCommand.d.ts.map +1 -0
- package/dist/commands/CheckTokensCommand.js +53 -0
- package/dist/commands/CheckTokensCommand.js.map +1 -0
- package/dist/commands/ICommand.d.ts +38 -0
- package/dist/commands/ICommand.d.ts.map +1 -0
- package/dist/commands/ICommand.js +37 -0
- package/dist/commands/ICommand.js.map +1 -0
- package/dist/commands/RefreshTokenCommand.d.ts +8 -0
- package/dist/commands/RefreshTokenCommand.d.ts.map +1 -0
- package/dist/commands/RefreshTokenCommand.js +152 -0
- package/dist/commands/RefreshTokenCommand.js.map +1 -0
- package/dist/commands/SelfAddRepoCommand.d.ts +17 -0
- package/dist/commands/SelfAddRepoCommand.d.ts.map +1 -0
- package/dist/commands/SelfAddRepoCommand.js +164 -0
- package/dist/commands/SelfAddRepoCommand.js.map +1 -0
- package/dist/commands/SelfAuthCommand.d.ts +16 -0
- package/dist/commands/SelfAuthCommand.d.ts.map +1 -0
- package/dist/commands/SelfAuthCommand.js +213 -0
- package/dist/commands/SelfAuthCommand.js.map +1 -0
- package/dist/commands/StartCommand.d.ts +8 -0
- package/dist/commands/StartCommand.d.ts.map +1 -0
- package/dist/commands/StartCommand.js +76 -0
- package/dist/commands/StartCommand.js.map +1 -0
- package/dist/config/constants.d.ts +12 -0
- package/dist/config/constants.d.ts.map +1 -0
- package/dist/config/constants.js +19 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/config/types.d.ts +21 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -0
- package/dist/services/ConfigService.d.ts +37 -0
- package/dist/services/ConfigService.d.ts.map +1 -0
- package/dist/services/ConfigService.js +121 -0
- package/dist/services/ConfigService.js.map +1 -0
- package/dist/services/Logger.d.ts +77 -0
- package/dist/services/Logger.d.ts.map +1 -0
- package/dist/services/Logger.js +100 -0
- package/dist/services/Logger.js.map +1 -0
- package/dist/services/WorkerService.d.ts +59 -0
- package/dist/services/WorkerService.d.ts.map +1 -0
- package/dist/services/WorkerService.js +220 -0
- package/dist/services/WorkerService.js.map +1 -0
- package/dist/src/Application.d.ts +75 -0
- package/dist/src/Application.d.ts.map +1 -0
- package/dist/src/Application.js +289 -0
- package/dist/src/Application.js.map +1 -0
- package/dist/src/app.d.ts +3 -0
- package/dist/src/app.d.ts.map +1 -0
- package/dist/src/app.js +93 -0
- package/dist/src/app.js.map +1 -0
- package/dist/src/commands/AuthCommand.d.ts +8 -0
- package/dist/src/commands/AuthCommand.d.ts.map +1 -0
- package/dist/src/commands/AuthCommand.js +70 -0
- package/dist/src/commands/AuthCommand.js.map +1 -0
- package/dist/src/commands/CheckTokensCommand.d.ts +8 -0
- package/dist/src/commands/CheckTokensCommand.d.ts.map +1 -0
- package/dist/src/commands/CheckTokensCommand.js +53 -0
- package/dist/src/commands/CheckTokensCommand.js.map +1 -0
- package/dist/src/commands/ICommand.d.ts +38 -0
- package/dist/src/commands/ICommand.d.ts.map +1 -0
- package/dist/src/commands/ICommand.js +37 -0
- package/dist/src/commands/ICommand.js.map +1 -0
- package/dist/src/commands/RefreshTokenCommand.d.ts +8 -0
- package/dist/src/commands/RefreshTokenCommand.d.ts.map +1 -0
- package/dist/src/commands/RefreshTokenCommand.js +152 -0
- package/dist/src/commands/RefreshTokenCommand.js.map +1 -0
- package/dist/src/commands/SelfAddRepoCommand.d.ts +17 -0
- package/dist/src/commands/SelfAddRepoCommand.d.ts.map +1 -0
- package/dist/src/commands/SelfAddRepoCommand.js +164 -0
- package/dist/src/commands/SelfAddRepoCommand.js.map +1 -0
- package/dist/src/commands/SelfAuthCommand.d.ts +16 -0
- package/dist/src/commands/SelfAuthCommand.d.ts.map +1 -0
- package/dist/src/commands/SelfAuthCommand.js +213 -0
- package/dist/src/commands/SelfAuthCommand.js.map +1 -0
- package/dist/src/commands/StartCommand.d.ts +8 -0
- package/dist/src/commands/StartCommand.d.ts.map +1 -0
- package/dist/src/commands/StartCommand.js +76 -0
- package/dist/src/commands/StartCommand.js.map +1 -0
- package/dist/src/config/constants.d.ts +12 -0
- package/dist/src/config/constants.d.ts.map +1 -0
- package/dist/src/config/constants.js +19 -0
- package/dist/src/config/constants.js.map +1 -0
- package/dist/src/config/types.d.ts +21 -0
- package/dist/src/config/types.d.ts.map +1 -0
- package/dist/src/config/types.js +2 -0
- package/dist/src/config/types.js.map +1 -0
- package/dist/src/services/ConfigService.d.ts +37 -0
- package/dist/src/services/ConfigService.d.ts.map +1 -0
- package/dist/src/services/ConfigService.js +121 -0
- package/dist/src/services/ConfigService.js.map +1 -0
- package/dist/src/services/Logger.d.ts +77 -0
- package/dist/src/services/Logger.d.ts.map +1 -0
- package/dist/src/services/Logger.js +100 -0
- package/dist/src/services/Logger.js.map +1 -0
- package/dist/src/services/WorkerService.d.ts +59 -0
- package/dist/src/services/WorkerService.d.ts.map +1 -0
- package/dist/src/services/WorkerService.js +220 -0
- package/dist/src/services/WorkerService.js.map +1 -0
- package/dist/src/ui/CLIPrompts.d.ts +18 -0
- package/dist/src/ui/CLIPrompts.d.ts.map +1 -0
- package/dist/src/ui/CLIPrompts.js +53 -0
- package/dist/src/ui/CLIPrompts.js.map +1 -0
- package/dist/ui/CLIPrompts.d.ts +18 -0
- package/dist/ui/CLIPrompts.d.ts.map +1 -0
- package/dist/ui/CLIPrompts.js +53 -0
- package/dist/ui/CLIPrompts.js.map +1 -0
- package/dist/vitest.config.d.ts +3 -0
- package/dist/vitest.config.d.ts.map +1 -0
- package/dist/vitest.config.js +13 -0
- package/dist/vitest.config.js.map +1 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# sylas-ai
|
|
2
|
+
|
|
3
|
+
AI development agent for Linear powered by Claude Code.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g sylas-ai
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Start the agent
|
|
14
|
+
```bash
|
|
15
|
+
sylas
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Available Commands
|
|
19
|
+
|
|
20
|
+
- **`sylas`** - Start the edge worker (default)
|
|
21
|
+
- **`sylas add-repository`** - Add a new repository configuration
|
|
22
|
+
- **`sylas check-tokens`** - Check the status of all Linear tokens
|
|
23
|
+
- **`sylas refresh-token`** - Refresh a specific Linear token
|
|
24
|
+
|
|
25
|
+
### Adding Repositories
|
|
26
|
+
|
|
27
|
+
After initial setup, you can add additional repositories without restarting Sylas:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
sylas add-repository
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This command will:
|
|
34
|
+
1. Check for existing Linear credentials and reuse them if available
|
|
35
|
+
2. Start OAuth flow only if no credentials are found
|
|
36
|
+
3. Guide you through configuring the new repository
|
|
37
|
+
4. Save the updated configuration
|
|
38
|
+
|
|
39
|
+
The interactive wizard will prompt you for:
|
|
40
|
+
- Repository path (must be absolute)
|
|
41
|
+
- Base branch (defaults to 'main')
|
|
42
|
+
- Workspace directory for git worktrees
|
|
43
|
+
- Whether the repository is active
|
|
44
|
+
|
|
45
|
+
## Configuration
|
|
46
|
+
|
|
47
|
+
### Environment Variables
|
|
48
|
+
|
|
49
|
+
- `SYLAS_HOST_EXTERNAL` - Set to `true` to allow external connections (listens on `0.0.0.0` instead of `localhost`). Default: `false`
|
|
50
|
+
- Use this when running in Docker containers or when you need external access to the webhook server
|
|
51
|
+
- When `true`: Server listens on `0.0.0.0` (all interfaces)
|
|
52
|
+
- When `false` or unset: Server listens on `localhost` (local access only)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { GitService, SharedApplicationServer } from "sylas-edge-worker";
|
|
2
|
+
import { ConfigService } from "./services/ConfigService.js";
|
|
3
|
+
import { Logger } from "./services/Logger.js";
|
|
4
|
+
import { WorkerService } from "./services/WorkerService.js";
|
|
5
|
+
/**
|
|
6
|
+
* Main application context providing access to services
|
|
7
|
+
*/
|
|
8
|
+
export declare class Application {
|
|
9
|
+
readonly sylasHome: string;
|
|
10
|
+
readonly config: ConfigService;
|
|
11
|
+
readonly git: GitService;
|
|
12
|
+
readonly worker: WorkerService;
|
|
13
|
+
readonly logger: Logger;
|
|
14
|
+
readonly version: string;
|
|
15
|
+
private envWatcher?;
|
|
16
|
+
private configWatcher?;
|
|
17
|
+
private isInSetupWaitingMode;
|
|
18
|
+
private isInIdleMode;
|
|
19
|
+
private readonly envFilePath;
|
|
20
|
+
constructor(sylasHome: string, customEnvPath?: string, version?: string);
|
|
21
|
+
/**
|
|
22
|
+
* Load environment variables from the configured env file path
|
|
23
|
+
*/
|
|
24
|
+
private loadEnvFile;
|
|
25
|
+
/**
|
|
26
|
+
* Setup file watcher for .env file to reload on changes
|
|
27
|
+
*/
|
|
28
|
+
private setupEnvFileWatcher;
|
|
29
|
+
/**
|
|
30
|
+
* Ensure required Sylas directories exist
|
|
31
|
+
* Creates: ~/.sylas/repos, ~/.sylas/worktrees, ~/.sylas/mcp-configs
|
|
32
|
+
*/
|
|
33
|
+
private ensureRequiredDirectories;
|
|
34
|
+
/**
|
|
35
|
+
* Get proxy URL from environment or use default
|
|
36
|
+
*/
|
|
37
|
+
getProxyUrl(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Check if using default proxy
|
|
40
|
+
*/
|
|
41
|
+
isUsingDefaultProxy(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Create a temporary SharedApplicationServer for OAuth
|
|
44
|
+
*/
|
|
45
|
+
createTempServer(): Promise<SharedApplicationServer>;
|
|
46
|
+
/**
|
|
47
|
+
* Enable setup waiting mode and start watching config.json for repositories
|
|
48
|
+
*/
|
|
49
|
+
enableSetupWaitingMode(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Enable idle mode (post-onboarding, no repositories) and start watching config.json
|
|
52
|
+
*/
|
|
53
|
+
enableIdleMode(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Setup file watcher for config.json to detect when repositories are added
|
|
56
|
+
*/
|
|
57
|
+
private startConfigWatcher;
|
|
58
|
+
/**
|
|
59
|
+
* Remove SYLAS_SETUP_PENDING flag from .env file
|
|
60
|
+
*/
|
|
61
|
+
private removeSetupPendingFlag;
|
|
62
|
+
/**
|
|
63
|
+
* Transition from setup waiting mode to normal operation
|
|
64
|
+
*/
|
|
65
|
+
private transitionToNormalMode;
|
|
66
|
+
/**
|
|
67
|
+
* Handle graceful shutdown
|
|
68
|
+
*/
|
|
69
|
+
shutdown(): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Setup process signal handlers
|
|
72
|
+
*/
|
|
73
|
+
setupSignalHandlers(): void;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=Application.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../src/Application.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;GAEG;AACH,qBAAa,WAAW;aAaN,SAAS,EAAE,MAAM;IAZlC,SAAgB,MAAM,EAAE,aAAa,CAAC;IACtC,SAAgB,GAAG,EAAE,UAAU,CAAC;IAChC,SAAgB,MAAM,EAAE,aAAa,CAAC;IACtC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,UAAU,CAAC,CAA2B;IAC9C,OAAO,CAAC,aAAa,CAAC,CAA2B;IACjD,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAGpB,SAAS,EAAE,MAAM,EACjC,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,MAAM;IAgCjB;;OAEG;IACH,OAAO,CAAC,WAAW;IASnB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAsB3B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IAmBjC;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACH,mBAAmB,IAAI,OAAO;IAI9B;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAQ1D;;OAEG;IACH,sBAAsB,IAAI,IAAI;IAK9B;;OAEG;IACH,cAAc,IAAI,IAAI;IAKtB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA0D1B;;OAEG;YACW,sBAAsB;IA2BpC;;OAEG;YACW,sBAAsB;IA6CpC;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAe/B;;OAEG;IACH,mBAAmB,IAAI,IAAI;CA2C3B"}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, watch } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import dotenv from "dotenv";
|
|
4
|
+
import { DEFAULT_PROXY_URL, DEFAULT_WORKTREES_DIR, } from "sylas-core";
|
|
5
|
+
import { GitService, SharedApplicationServer } from "sylas-edge-worker";
|
|
6
|
+
import { DEFAULT_SERVER_PORT, parsePort } from "./config/constants.js";
|
|
7
|
+
import { ConfigService } from "./services/ConfigService.js";
|
|
8
|
+
import { Logger } from "./services/Logger.js";
|
|
9
|
+
import { WorkerService } from "./services/WorkerService.js";
|
|
10
|
+
/**
|
|
11
|
+
* Main application context providing access to services
|
|
12
|
+
*/
|
|
13
|
+
export class Application {
|
|
14
|
+
sylasHome;
|
|
15
|
+
config;
|
|
16
|
+
git;
|
|
17
|
+
worker;
|
|
18
|
+
logger;
|
|
19
|
+
version;
|
|
20
|
+
envWatcher;
|
|
21
|
+
configWatcher;
|
|
22
|
+
isInSetupWaitingMode = false;
|
|
23
|
+
isInIdleMode = false;
|
|
24
|
+
envFilePath;
|
|
25
|
+
constructor(sylasHome, customEnvPath, version) {
|
|
26
|
+
this.sylasHome = sylasHome;
|
|
27
|
+
// Initialize logger first
|
|
28
|
+
this.logger = new Logger();
|
|
29
|
+
// Store version
|
|
30
|
+
this.version = version || "unknown";
|
|
31
|
+
// Determine the env file path: use custom path if provided, otherwise default to ~/.sylas/.env
|
|
32
|
+
this.envFilePath = customEnvPath || join(sylasHome, ".env");
|
|
33
|
+
// Ensure required directories exist
|
|
34
|
+
this.ensureRequiredDirectories();
|
|
35
|
+
// Load environment variables from the determined env file path
|
|
36
|
+
this.loadEnvFile();
|
|
37
|
+
// Watch .env file for changes and reload
|
|
38
|
+
this.setupEnvFileWatcher();
|
|
39
|
+
// Initialize services
|
|
40
|
+
this.config = new ConfigService(sylasHome, this.logger);
|
|
41
|
+
this.git = new GitService(this.logger);
|
|
42
|
+
this.worker = new WorkerService(this.config, this.git, sylasHome, this.logger, this.version);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Load environment variables from the configured env file path
|
|
46
|
+
*/
|
|
47
|
+
loadEnvFile() {
|
|
48
|
+
if (existsSync(this.envFilePath)) {
|
|
49
|
+
dotenv.config({ path: this.envFilePath, override: true });
|
|
50
|
+
this.logger.info(`🔧 Loaded environment variables from ${this.envFilePath}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Setup file watcher for .env file to reload on changes
|
|
55
|
+
*/
|
|
56
|
+
setupEnvFileWatcher() {
|
|
57
|
+
// Only watch if file exists
|
|
58
|
+
if (!existsSync(this.envFilePath)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
this.envWatcher = watch(this.envFilePath, (eventType) => {
|
|
63
|
+
if (eventType === "change") {
|
|
64
|
+
this.logger.info("🔄 .env file changed, reloading...");
|
|
65
|
+
this.loadEnvFile();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
this.logger.info(`👀 Watching .env file for changes: ${this.envFilePath}`);
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
this.logger.error(`❌ Failed to watch .env file: ${error}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Ensure required Sylas directories exist
|
|
76
|
+
* Creates: ~/.sylas/repos, ~/.sylas/worktrees, ~/.sylas/mcp-configs
|
|
77
|
+
*/
|
|
78
|
+
ensureRequiredDirectories() {
|
|
79
|
+
const requiredDirs = ["repos", DEFAULT_WORKTREES_DIR, "mcp-configs"];
|
|
80
|
+
for (const dir of requiredDirs) {
|
|
81
|
+
const dirPath = join(this.sylasHome, dir);
|
|
82
|
+
if (!existsSync(dirPath)) {
|
|
83
|
+
try {
|
|
84
|
+
mkdirSync(dirPath, { recursive: true });
|
|
85
|
+
this.logger.info(`📁 Created directory: ${dirPath}`);
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
this.logger.error(`❌ Failed to create directory ${dirPath}: ${error}`);
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get proxy URL from environment or use default
|
|
96
|
+
*/
|
|
97
|
+
getProxyUrl() {
|
|
98
|
+
return process.env.PROXY_URL || DEFAULT_PROXY_URL;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Check if using default proxy
|
|
102
|
+
*/
|
|
103
|
+
isUsingDefaultProxy() {
|
|
104
|
+
return this.getProxyUrl() === DEFAULT_PROXY_URL;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Create a temporary SharedApplicationServer for OAuth
|
|
108
|
+
*/
|
|
109
|
+
async createTempServer() {
|
|
110
|
+
const serverPort = parsePort(process.env.SYLAS_SERVER_PORT, DEFAULT_SERVER_PORT);
|
|
111
|
+
return new SharedApplicationServer(serverPort);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Enable setup waiting mode and start watching config.json for repositories
|
|
115
|
+
*/
|
|
116
|
+
enableSetupWaitingMode() {
|
|
117
|
+
this.isInSetupWaitingMode = true;
|
|
118
|
+
this.startConfigWatcher();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Enable idle mode (post-onboarding, no repositories) and start watching config.json
|
|
122
|
+
*/
|
|
123
|
+
enableIdleMode() {
|
|
124
|
+
this.isInIdleMode = true;
|
|
125
|
+
this.startConfigWatcher();
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Setup file watcher for config.json to detect when repositories are added
|
|
129
|
+
*/
|
|
130
|
+
startConfigWatcher() {
|
|
131
|
+
const configPath = this.config.getConfigPath();
|
|
132
|
+
// Create empty config file if it doesn't exist
|
|
133
|
+
if (!existsSync(configPath)) {
|
|
134
|
+
try {
|
|
135
|
+
const configDir = dirname(configPath);
|
|
136
|
+
if (!existsSync(configDir)) {
|
|
137
|
+
mkdirSync(configDir, { recursive: true });
|
|
138
|
+
}
|
|
139
|
+
// Create empty config with empty repositories array
|
|
140
|
+
this.config.save({ repositories: [] });
|
|
141
|
+
this.logger.info(`📝 Created empty config file: ${configPath}`);
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
this.logger.error(`❌ Failed to create config file: ${error}`);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
try {
|
|
149
|
+
this.configWatcher = watch(configPath, async (eventType) => {
|
|
150
|
+
if (eventType === "change" &&
|
|
151
|
+
(this.isInSetupWaitingMode || this.isInIdleMode)) {
|
|
152
|
+
this.logger.info("🔄 Configuration file changed, checking for repositories...");
|
|
153
|
+
// Reload config and check if repositories were added
|
|
154
|
+
const edgeConfig = this.config.load();
|
|
155
|
+
const repositories = edgeConfig.repositories || [];
|
|
156
|
+
if (repositories.length > 0) {
|
|
157
|
+
this.logger.success("✅ Configuration received!");
|
|
158
|
+
this.logger.info(`📦 Starting edge worker with ${repositories.length} repository(ies)...`);
|
|
159
|
+
// Remove SYLAS_SETUP_PENDING flag from .env (only in setup waiting mode)
|
|
160
|
+
if (this.isInSetupWaitingMode) {
|
|
161
|
+
await this.removeSetupPendingFlag();
|
|
162
|
+
}
|
|
163
|
+
// Transition to normal operation mode
|
|
164
|
+
await this.transitionToNormalMode(repositories);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
this.logger.info(`👀 Watching config.json for repository configuration: ${configPath}`);
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
this.logger.error(`❌ Failed to watch config.json: ${error}`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Remove SYLAS_SETUP_PENDING flag from .env file
|
|
176
|
+
*/
|
|
177
|
+
async removeSetupPendingFlag() {
|
|
178
|
+
const { readFile, writeFile } = await import("node:fs/promises");
|
|
179
|
+
const envPath = join(this.sylasHome, ".env");
|
|
180
|
+
if (!existsSync(envPath)) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
const envContent = await readFile(envPath, "utf-8");
|
|
185
|
+
const updatedContent = envContent
|
|
186
|
+
.split("\n")
|
|
187
|
+
.filter((line) => !line.startsWith("SYLAS_SETUP_PENDING="))
|
|
188
|
+
.join("\n");
|
|
189
|
+
await writeFile(envPath, updatedContent, "utf-8");
|
|
190
|
+
this.logger.info("✅ Removed SYLAS_SETUP_PENDING flag from .env");
|
|
191
|
+
// Reload environment variables
|
|
192
|
+
this.loadEnvFile();
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
this.logger.error(`❌ Failed to remove SYLAS_SETUP_PENDING flag: ${error}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Transition from setup waiting mode to normal operation
|
|
200
|
+
*/
|
|
201
|
+
async transitionToNormalMode(repositories) {
|
|
202
|
+
try {
|
|
203
|
+
this.isInSetupWaitingMode = false;
|
|
204
|
+
this.isInIdleMode = false;
|
|
205
|
+
// Close config watcher
|
|
206
|
+
if (this.configWatcher) {
|
|
207
|
+
this.configWatcher.close();
|
|
208
|
+
this.configWatcher = undefined;
|
|
209
|
+
}
|
|
210
|
+
// Stop the setup waiting mode or idle mode server before starting EdgeWorker
|
|
211
|
+
await this.worker.stopWaitingServer();
|
|
212
|
+
// Start the EdgeWorker with the new configuration
|
|
213
|
+
await this.worker.startEdgeWorker({
|
|
214
|
+
repositories,
|
|
215
|
+
});
|
|
216
|
+
// Display server information
|
|
217
|
+
const serverPort = this.worker.getServerPort();
|
|
218
|
+
this.logger.raw("");
|
|
219
|
+
this.logger.divider(70);
|
|
220
|
+
this.logger.success("Edge worker started successfully");
|
|
221
|
+
this.logger.info(`📌 Version: ${this.version}`);
|
|
222
|
+
this.logger.info(`🔗 Server running on port ${serverPort}`);
|
|
223
|
+
if (process.env.CLOUDFLARE_TOKEN) {
|
|
224
|
+
this.logger.info("🌩️ Cloudflare tunnel: Active");
|
|
225
|
+
}
|
|
226
|
+
this.logger.info(`\n📦 Managing ${repositories.length} repositories:`);
|
|
227
|
+
repositories.forEach((repo) => {
|
|
228
|
+
this.logger.info(` • ${repo.name} (${repo.repositoryPath})`);
|
|
229
|
+
});
|
|
230
|
+
this.logger.divider(70);
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
this.logger.error(`❌ Failed to transition to normal mode: ${error}`);
|
|
234
|
+
process.exit(1);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Handle graceful shutdown
|
|
239
|
+
*/
|
|
240
|
+
async shutdown() {
|
|
241
|
+
// Close .env file watcher
|
|
242
|
+
if (this.envWatcher) {
|
|
243
|
+
this.envWatcher.close();
|
|
244
|
+
}
|
|
245
|
+
// Close config file watcher
|
|
246
|
+
if (this.configWatcher) {
|
|
247
|
+
this.configWatcher.close();
|
|
248
|
+
}
|
|
249
|
+
await this.worker.stop();
|
|
250
|
+
process.exit(0);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Setup process signal handlers
|
|
254
|
+
*/
|
|
255
|
+
setupSignalHandlers() {
|
|
256
|
+
process.on("SIGINT", () => {
|
|
257
|
+
this.logger.info("\nReceived SIGINT, shutting down gracefully...");
|
|
258
|
+
void this.shutdown();
|
|
259
|
+
});
|
|
260
|
+
process.on("SIGTERM", () => {
|
|
261
|
+
this.logger.info("\nReceived SIGTERM, shutting down gracefully...");
|
|
262
|
+
void this.shutdown();
|
|
263
|
+
});
|
|
264
|
+
// Handle uncaught exceptions and unhandled promise rejections
|
|
265
|
+
process.on("uncaughtException", (error) => {
|
|
266
|
+
this.logger.error(`🚨 Uncaught Exception: ${error.message}`);
|
|
267
|
+
this.logger.error(`Error type: ${error.constructor.name}`);
|
|
268
|
+
this.logger.error(`Stack: ${error.stack}`);
|
|
269
|
+
this.logger.error("This error was caught by the global handler, preventing application crash");
|
|
270
|
+
// Attempt graceful shutdown but don't wait indefinitely
|
|
271
|
+
this.shutdown().finally(() => {
|
|
272
|
+
this.logger.error("Process exiting due to uncaught exception");
|
|
273
|
+
process.exit(1);
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
process.on("unhandledRejection", (reason, promise) => {
|
|
277
|
+
this.logger.error(`🚨 Unhandled Promise Rejection at: ${promise}`);
|
|
278
|
+
this.logger.error(`Reason: ${reason}`);
|
|
279
|
+
this.logger.error("This rejection was caught by the global handler, continuing operation");
|
|
280
|
+
// Log stack trace if reason is an Error
|
|
281
|
+
if (reason instanceof Error && reason.stack) {
|
|
282
|
+
this.logger.error(`Stack: ${reason.stack}`);
|
|
283
|
+
}
|
|
284
|
+
// Log the error but don't exit the process for promise rejections
|
|
285
|
+
// as they might be recoverable
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
//# sourceMappingURL=Application.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Application.js","sourceRoot":"","sources":["../src/Application.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACN,iBAAiB,EACjB,qBAAqB,GAErB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;GAEG;AACH,MAAM,OAAO,WAAW;IAaN;IAZD,MAAM,CAAgB;IACtB,GAAG,CAAa;IAChB,MAAM,CAAgB;IACtB,MAAM,CAAS;IACf,OAAO,CAAS;IACxB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AC;YAEF,wDAAwD;YACxD,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;gBAC5B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;gBAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;YACpD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sCAAsC,OAAO,EAAE,CAAC,CAAC;YACnE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC;YACvC,IAAI,CAAC,MAAM,CAAC,KAAK,CAChB,uEAAuE,CACvE,CAAC;YAEF,wCAAwC;YACxC,IAAI,MAAM,YAAY,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;gBAC7C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAC7C,CAAC;YAED,kEAAkE;YAClE,+BAA+B;QAChC,CAAC,CAAC,CAAC;IACJ,CAAC;CACD"}
|
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":""}
|
package/dist/app.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { dirname, resolve } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { Command } from "commander";
|
|
7
|
+
import { Application } from "./Application.js";
|
|
8
|
+
import { AuthCommand } from "./commands/AuthCommand.js";
|
|
9
|
+
import { CheckTokensCommand } from "./commands/CheckTokensCommand.js";
|
|
10
|
+
import { RefreshTokenCommand } from "./commands/RefreshTokenCommand.js";
|
|
11
|
+
import { SelfAddRepoCommand } from "./commands/SelfAddRepoCommand.js";
|
|
12
|
+
import { SelfAuthCommand } from "./commands/SelfAuthCommand.js";
|
|
13
|
+
import { StartCommand } from "./commands/StartCommand.js";
|
|
14
|
+
// Get the directory of the current module for reading package.json
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = dirname(__filename);
|
|
17
|
+
// Read package.json to get the actual version
|
|
18
|
+
// When compiled, this is in dist/src/, so we need to go up two levels
|
|
19
|
+
const packageJsonPath = resolve(__dirname, "..", "..", "package.json");
|
|
20
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
21
|
+
// Setup Commander program
|
|
22
|
+
const program = new Command();
|
|
23
|
+
program
|
|
24
|
+
.name("sylas")
|
|
25
|
+
.description("AI-powered Linear issue automation using Claude")
|
|
26
|
+
.version(packageJson.version)
|
|
27
|
+
.option("--sylas-home <path>", "Specify custom Sylas config directory", resolve(homedir(), ".sylas"))
|
|
28
|
+
.option("--env-file <path>", "Path to environment variables file");
|
|
29
|
+
// Start command (default)
|
|
30
|
+
program
|
|
31
|
+
.command("start", { isDefault: true })
|
|
32
|
+
.description("Start the edge worker")
|
|
33
|
+
.action(async () => {
|
|
34
|
+
const opts = program.opts();
|
|
35
|
+
const app = new Application(opts.sylasHome, opts.envFile, packageJson.version);
|
|
36
|
+
await new StartCommand(app).execute([]);
|
|
37
|
+
});
|
|
38
|
+
// Auth command
|
|
39
|
+
program
|
|
40
|
+
.command("auth <auth-key>")
|
|
41
|
+
.description("Authenticate with Sylas using auth key")
|
|
42
|
+
.action(async (authKey) => {
|
|
43
|
+
const opts = program.opts();
|
|
44
|
+
const app = new Application(opts.sylasHome, opts.envFile, packageJson.version);
|
|
45
|
+
await new AuthCommand(app).execute([authKey]);
|
|
46
|
+
});
|
|
47
|
+
// Check tokens command
|
|
48
|
+
program
|
|
49
|
+
.command("check-tokens")
|
|
50
|
+
.description("Check the status of all Linear tokens")
|
|
51
|
+
.action(async () => {
|
|
52
|
+
const opts = program.opts();
|
|
53
|
+
const app = new Application(opts.sylasHome, opts.envFile, packageJson.version);
|
|
54
|
+
await new CheckTokensCommand(app).execute([]);
|
|
55
|
+
});
|
|
56
|
+
// Refresh token command
|
|
57
|
+
program
|
|
58
|
+
.command("refresh-token")
|
|
59
|
+
.description("Refresh a specific Linear token")
|
|
60
|
+
.action(async () => {
|
|
61
|
+
const opts = program.opts();
|
|
62
|
+
const app = new Application(opts.sylasHome, opts.envFile, packageJson.version);
|
|
63
|
+
await new RefreshTokenCommand(app).execute([]);
|
|
64
|
+
});
|
|
65
|
+
// Self-auth command - Linear OAuth directly from CLI
|
|
66
|
+
program
|
|
67
|
+
.command("self-auth")
|
|
68
|
+
.description("Authenticate with Linear OAuth directly")
|
|
69
|
+
.action(async () => {
|
|
70
|
+
const opts = program.opts();
|
|
71
|
+
const app = new Application(opts.sylasHome, opts.envFile, packageJson.version);
|
|
72
|
+
await new SelfAuthCommand(app).execute([]);
|
|
73
|
+
});
|
|
74
|
+
// Self-add-repo command - Clone and add repository
|
|
75
|
+
program
|
|
76
|
+
.command("self-add-repo [url] [workspace]")
|
|
77
|
+
.description('Clone a repo and add it to config. URL accepts any valid git clone address (e.g., "https://github.com/org/repo.git"). Workspace is the display name of the Linear workspace (e.g., "My Workspace") - not a UUID.')
|
|
78
|
+
.action(async (url, workspace) => {
|
|
79
|
+
const opts = program.opts();
|
|
80
|
+
const app = new Application(opts.sylasHome, opts.envFile, packageJson.version);
|
|
81
|
+
await new SelfAddRepoCommand(app).execute([url, workspace].filter(Boolean));
|
|
82
|
+
});
|
|
83
|
+
// Parse and execute
|
|
84
|
+
(async () => {
|
|
85
|
+
try {
|
|
86
|
+
await program.parseAsync(process.argv);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
console.error("Fatal error:", error);
|
|
90
|
+
process.exit(1);
|
|
91
|
+
}
|
|
92
|
+
})();
|
|
93
|
+
//# sourceMappingURL=app.js.map
|
package/dist/app.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,mEAAmE;AACnE,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,8CAA8C;AAC9C,sEAAsE;AACtE,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AACvE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;AAEvE,0BAA0B;AAC1B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;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E,GAAY,EAAE,SAAkB,EAAE,EAAE;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC5B,MAAM,GAAG,GAAG,IAAI,WAAW,CAC1B,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,OAAO,EACZ,WAAW,CAAC,OAAO,CACnB,CAAC;IACF,MAAM,IAAI,kBAAkB,CAAC,GAAG,CAAC,CAAC,OAAO,CACxC,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAa,CAC5C,CAAC;AACH,CAAC,CAAC,CAAC;AAEJ,oBAAoB;AACpB,CAAC,KAAK,IAAI,EAAE;IACX,IAAI,CAAC;QACJ,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;AACF,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseCommand } from "./ICommand.js";
|
|
2
|
+
/**
|
|
3
|
+
* Auth command - authenticate with Sylas Pro plan using auth key
|
|
4
|
+
*/
|
|
5
|
+
export declare class AuthCommand extends BaseCommand {
|
|
6
|
+
execute(args: string[]): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=AuthCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCommand.d.ts","sourceRoot":"","sources":["../../src/commands/AuthCommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IACrC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAiF5C"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { getSylasAppUrl } from "sylas-cloudflare-tunnel-client";
|
|
4
|
+
import { BaseCommand } from "./ICommand.js";
|
|
5
|
+
/**
|
|
6
|
+
* Auth command - authenticate with Sylas Pro plan using auth key
|
|
7
|
+
*/
|
|
8
|
+
export class AuthCommand extends BaseCommand {
|
|
9
|
+
async execute(args) {
|
|
10
|
+
// Get auth key from command line arguments
|
|
11
|
+
const authKey = args[0];
|
|
12
|
+
if (!authKey ||
|
|
13
|
+
typeof authKey !== "string" ||
|
|
14
|
+
authKey.trim().length === 0) {
|
|
15
|
+
this.logError("Error: Auth key is required");
|
|
16
|
+
console.log("\nUsage: sylas auth <auth-key>");
|
|
17
|
+
console.log(`\nGet your auth key from: ${getSylasAppUrl()}/onboarding/auth-sylas`);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
console.log("\n🔑 Authenticating with Sylas...");
|
|
21
|
+
this.logDivider();
|
|
22
|
+
try {
|
|
23
|
+
// Import ConfigApiClient
|
|
24
|
+
const { ConfigApiClient } = await import("sylas-cloudflare-tunnel-client");
|
|
25
|
+
// Call the config API to get credentials
|
|
26
|
+
console.log("Validating auth key...");
|
|
27
|
+
const configResponse = await ConfigApiClient.getConfig(authKey);
|
|
28
|
+
if (!ConfigApiClient.isValid(configResponse)) {
|
|
29
|
+
this.logError("Authentication failed");
|
|
30
|
+
console.error(configResponse.error || "Invalid response from server");
|
|
31
|
+
console.log("\nPlease verify your auth key is correct.");
|
|
32
|
+
console.log(`Get your auth key from: ${getSylasAppUrl()}/onboarding/auth-sylas`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
this.logSuccess("Authentication successful!");
|
|
36
|
+
// Ensure SYLAS_HOME directory exists
|
|
37
|
+
if (!existsSync(this.app.sylasHome)) {
|
|
38
|
+
mkdirSync(this.app.sylasHome, { recursive: true });
|
|
39
|
+
}
|
|
40
|
+
// Store tokens in ~/.sylas/.env file
|
|
41
|
+
const envPath = resolve(this.app.sylasHome, ".env");
|
|
42
|
+
const envContent = `# Sylas Authentication Credentials
|
|
43
|
+
# Generated on ${new Date().toISOString()}
|
|
44
|
+
CLOUDFLARE_TOKEN=${configResponse.config.cloudflareToken}
|
|
45
|
+
SYLAS_API_KEY=${configResponse.config.apiKey}
|
|
46
|
+
SYLAS_SETUP_PENDING=true
|
|
47
|
+
`;
|
|
48
|
+
writeFileSync(envPath, envContent, "utf-8");
|
|
49
|
+
this.logSuccess(`Credentials saved to ${envPath}`);
|
|
50
|
+
// Reload environment variables to pick up SYLAS_SETUP_PENDING
|
|
51
|
+
const dotenv = await import("dotenv");
|
|
52
|
+
dotenv.config({ path: envPath, override: true });
|
|
53
|
+
console.log("\n✨ Setup complete! Starting Sylas...");
|
|
54
|
+
this.logDivider();
|
|
55
|
+
console.log();
|
|
56
|
+
// Start the edge app with the new configuration
|
|
57
|
+
// Import StartCommand to avoid circular dependency
|
|
58
|
+
const { StartCommand } = await import("./StartCommand.js");
|
|
59
|
+
const startCommand = new StartCommand(this.app);
|
|
60
|
+
await startCommand.execute([]);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
this.logError("Authentication failed:");
|
|
64
|
+
console.error(error.message);
|
|
65
|
+
console.log("\nPlease try again or contact support if the issue persists.");
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=AuthCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCommand.js","sourceRoot":"","sources":["../../src/commands/AuthCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,C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AO,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC;YACxC,OAAO,CAAC,KAAK,CAAE,KAAe,CAAC,OAAO,CAAC,CAAC;YACxC,OAAO,CAAC,GAAG,CACV,8DAA8D,CAC9D,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseCommand } from "./ICommand.js";
|
|
2
|
+
/**
|
|
3
|
+
* Check tokens command - check the status of all Linear tokens
|
|
4
|
+
*/
|
|
5
|
+
export declare class CheckTokensCommand extends BaseCommand {
|
|
6
|
+
execute(_args: string[]): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=CheckTokensCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckTokensCommand.d.ts","sourceRoot":"","sources":["../../src/commands/CheckTokensCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAmC5C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IAC5C,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAqB7C"}
|