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,164 +0,0 @@
|
|
|
1
|
-
import { execSync } from "node:child_process";
|
|
2
|
-
import { randomUUID } from "node:crypto";
|
|
3
|
-
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { resolve } from "node:path";
|
|
5
|
-
import * as readline from "node:readline";
|
|
6
|
-
import { DEFAULT_BASE_BRANCH, DEFAULT_CONFIG_FILENAME, DEFAULT_WORKTREES_DIR, } from "sylas-core";
|
|
7
|
-
import { BaseCommand } from "./ICommand.js";
|
|
8
|
-
/**
|
|
9
|
-
* Self-add-repo command - clones a repo and adds it to config.json
|
|
10
|
-
*
|
|
11
|
-
* Usage:
|
|
12
|
-
* sylas self-add-repo # prompts for everything
|
|
13
|
-
* sylas self-add-repo <url> # prompts for workspace if multiple
|
|
14
|
-
* sylas self-add-repo <url> <workspace> # no prompts
|
|
15
|
-
*/
|
|
16
|
-
export class SelfAddRepoCommand extends BaseCommand {
|
|
17
|
-
rl = null;
|
|
18
|
-
getReadline() {
|
|
19
|
-
if (!this.rl) {
|
|
20
|
-
this.rl = readline.createInterface({
|
|
21
|
-
input: process.stdin,
|
|
22
|
-
output: process.stdout,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return this.rl;
|
|
26
|
-
}
|
|
27
|
-
prompt(question) {
|
|
28
|
-
return new Promise((resolve) => {
|
|
29
|
-
this.getReadline().question(question, (answer) => resolve(answer.trim()));
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
cleanup() {
|
|
33
|
-
if (this.rl) {
|
|
34
|
-
this.rl.close();
|
|
35
|
-
this.rl = null;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async execute(args) {
|
|
39
|
-
let url = args[0];
|
|
40
|
-
const workspaceName = args[1];
|
|
41
|
-
try {
|
|
42
|
-
// Load config
|
|
43
|
-
const configPath = resolve(this.app.sylasHome, DEFAULT_CONFIG_FILENAME);
|
|
44
|
-
let config;
|
|
45
|
-
try {
|
|
46
|
-
config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
47
|
-
}
|
|
48
|
-
catch {
|
|
49
|
-
this.logError(`Config file not found: ${configPath}`);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
if (!config.repositories) {
|
|
53
|
-
config.repositories = [];
|
|
54
|
-
}
|
|
55
|
-
// Get URL if not provided
|
|
56
|
-
if (!url) {
|
|
57
|
-
url = await this.prompt("Repository URL: ");
|
|
58
|
-
if (!url) {
|
|
59
|
-
this.logError("URL is required");
|
|
60
|
-
process.exit(1);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
// Extract repo name from URL
|
|
64
|
-
const repoName = url
|
|
65
|
-
.split("/")
|
|
66
|
-
.pop()
|
|
67
|
-
?.replace(/\.git$/, "");
|
|
68
|
-
if (!repoName) {
|
|
69
|
-
this.logError("Could not extract repo name from URL");
|
|
70
|
-
process.exit(1);
|
|
71
|
-
}
|
|
72
|
-
// Check for duplicate
|
|
73
|
-
if (config.repositories.some((r) => r.name === repoName)) {
|
|
74
|
-
this.logError(`Repository '${repoName}' already exists in config`);
|
|
75
|
-
process.exit(1);
|
|
76
|
-
}
|
|
77
|
-
// Find workspaces with Linear credentials
|
|
78
|
-
const workspaces = new Map();
|
|
79
|
-
for (const repo of config.repositories) {
|
|
80
|
-
if (repo.linearWorkspaceId &&
|
|
81
|
-
repo.linearToken &&
|
|
82
|
-
!workspaces.has(repo.linearWorkspaceId)) {
|
|
83
|
-
workspaces.set(repo.linearWorkspaceId, {
|
|
84
|
-
id: repo.linearWorkspaceId,
|
|
85
|
-
name: repo.linearWorkspaceName || repo.linearWorkspaceId,
|
|
86
|
-
token: repo.linearToken,
|
|
87
|
-
refreshToken: repo.linearRefreshToken,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (workspaces.size === 0) {
|
|
92
|
-
this.logError("No Linear credentials found. Run 'sylas self-auth' first.");
|
|
93
|
-
process.exit(1);
|
|
94
|
-
}
|
|
95
|
-
// Get workspace
|
|
96
|
-
let selectedWorkspace;
|
|
97
|
-
const workspaceList = Array.from(workspaces.values());
|
|
98
|
-
if (workspaceList.length === 1) {
|
|
99
|
-
// Safe: we checked length === 1 above
|
|
100
|
-
selectedWorkspace = workspaceList[0];
|
|
101
|
-
}
|
|
102
|
-
else if (workspaceName) {
|
|
103
|
-
const foundWorkspace = workspaceList.find((w) => w.name === workspaceName);
|
|
104
|
-
if (!foundWorkspace) {
|
|
105
|
-
this.logError(`Workspace '${workspaceName}' not found`);
|
|
106
|
-
process.exit(1);
|
|
107
|
-
}
|
|
108
|
-
selectedWorkspace = foundWorkspace;
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
console.log("\nAvailable workspaces:");
|
|
112
|
-
workspaceList.forEach((w, i) => {
|
|
113
|
-
console.log(` ${i + 1}. ${w.name}`);
|
|
114
|
-
});
|
|
115
|
-
const choice = await this.prompt(`Select workspace [1-${workspaceList.length}]: `);
|
|
116
|
-
const idx = parseInt(choice, 10) - 1;
|
|
117
|
-
if (idx < 0 || idx >= workspaceList.length) {
|
|
118
|
-
this.logError("Invalid selection");
|
|
119
|
-
process.exit(1);
|
|
120
|
-
}
|
|
121
|
-
// Safe: we validated idx is within bounds above
|
|
122
|
-
selectedWorkspace = workspaceList[idx];
|
|
123
|
-
}
|
|
124
|
-
// Clone the repo
|
|
125
|
-
const repositoryPath = resolve(this.app.sylasHome, "repos", repoName);
|
|
126
|
-
if (existsSync(repositoryPath)) {
|
|
127
|
-
console.log(`Repository already exists at ${repositoryPath}`);
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
console.log(`Cloning ${url}...`);
|
|
131
|
-
try {
|
|
132
|
-
execSync(`git clone ${url} ${repositoryPath}`, { stdio: "inherit" });
|
|
133
|
-
}
|
|
134
|
-
catch {
|
|
135
|
-
this.logError("Failed to clone repository");
|
|
136
|
-
process.exit(1);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
// Generate UUID and add to config
|
|
140
|
-
const id = randomUUID();
|
|
141
|
-
config.repositories.push({
|
|
142
|
-
id,
|
|
143
|
-
name: repoName,
|
|
144
|
-
repositoryPath,
|
|
145
|
-
baseBranch: DEFAULT_BASE_BRANCH,
|
|
146
|
-
workspaceBaseDir: resolve(this.app.sylasHome, DEFAULT_WORKTREES_DIR),
|
|
147
|
-
linearWorkspaceId: selectedWorkspace.id,
|
|
148
|
-
linearWorkspaceName: selectedWorkspace.name,
|
|
149
|
-
linearToken: selectedWorkspace.token,
|
|
150
|
-
linearRefreshToken: selectedWorkspace.refreshToken,
|
|
151
|
-
isActive: true,
|
|
152
|
-
});
|
|
153
|
-
writeFileSync(configPath, JSON.stringify(config, null, "\t"), "utf-8");
|
|
154
|
-
console.log(`\nAdded: ${repoName}`);
|
|
155
|
-
console.log(` ID: ${id}`);
|
|
156
|
-
console.log(` Workspace: ${selectedWorkspace.name}`);
|
|
157
|
-
process.exit(0);
|
|
158
|
-
}
|
|
159
|
-
finally {
|
|
160
|
-
this.cleanup();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
//# sourceMappingURL=SelfAddRepoCommand.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelfAddRepoCommand.js","sourceRoot":"","sources":["../../../src/commands/SelfAddRepoCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,EACN,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,GAErB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C;;;;;;;GAOG;AACH,MAAM,OAAO,kB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AG,UAAU,EAAE,CAAC;YAExB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC;gBACxB,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,cAAc;gBACd,UAAU,EAAE,mBAAmB;gBAC/B,gBAAgB,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,qBAAqB,CAAC;gBACpE,iBAAiB,EAAE,iBAAiB,CAAC,EAAE;gBACvC,mBAAmB,EAAE,iBAAiB,CAAC,IAAI;gBAC3C,WAAW,EAAE,iBAAiB,CAAC,KAAK;gBACpC,kBAAkB,EAAE,iBAAiB,CAAC,YAAY;gBAClD,QAAQ,EAAE,IAAI;aACd,CAAC,CAAC;YAEH,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;YAEvE,OAAO,CAAC,GAAG,CAAC,YAAY,QAAQ,EAAE,CAAC,CAAC;YACpC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YAC3B,OAAO,CAAC,GAAG,CAAC,gBAAgB,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC;YACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;gBAAS,CAAC;YACV,IAAI,CAAC,OAAO,EAAE,CAAC;QAChB,CAAC;IACF,CAAC;CACD"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from "./ICommand.js";
|
|
2
|
-
/**
|
|
3
|
-
* Self-auth command - authenticate with Linear OAuth directly from CLI
|
|
4
|
-
* Handles the complete OAuth flow without requiring EdgeWorker
|
|
5
|
-
*/
|
|
6
|
-
export declare class SelfAuthCommand extends BaseCommand {
|
|
7
|
-
private server;
|
|
8
|
-
private callbackPort;
|
|
9
|
-
execute(_args: string[]): Promise<void>;
|
|
10
|
-
private waitForCallback;
|
|
11
|
-
private exchangeCodeForTokens;
|
|
12
|
-
private fetchWorkspaceInfo;
|
|
13
|
-
private overwriteRepoConfigTokens;
|
|
14
|
-
private cleanup;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=SelfAuthCommand.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelfAuthCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/SelfAuthCommand.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAC/C,OAAO,CAAC,MAAM,CAAgC;IAC9C,OAAO,CAAC,YAAY,CAAyD;IAEvE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAmF/B,eAAe;YAiFf,qBAAqB;YA2CrB,kBAAkB;IAchC,OAAO,CAAC,yBAAyB;YAuBnB,OAAO;CAMrB"}
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { LinearClient } from "@linear/sdk";
|
|
4
|
-
import Fastify from "fastify";
|
|
5
|
-
import open from "open";
|
|
6
|
-
import { DEFAULT_CONFIG_FILENAME } from "sylas-core";
|
|
7
|
-
import { BaseCommand } from "./ICommand.js";
|
|
8
|
-
/**
|
|
9
|
-
* Self-auth command - authenticate with Linear OAuth directly from CLI
|
|
10
|
-
* Handles the complete OAuth flow without requiring EdgeWorker
|
|
11
|
-
*/
|
|
12
|
-
export class SelfAuthCommand extends BaseCommand {
|
|
13
|
-
server = null;
|
|
14
|
-
callbackPort = parseInt(process.env.SYLAS_SERVER_PORT || "3456", 10);
|
|
15
|
-
async execute(_args) {
|
|
16
|
-
console.log("\nSylas Linear Self-Authentication");
|
|
17
|
-
this.logDivider();
|
|
18
|
-
// Check required environment variables
|
|
19
|
-
const clientId = process.env.LINEAR_CLIENT_ID;
|
|
20
|
-
const clientSecret = process.env.LINEAR_CLIENT_SECRET;
|
|
21
|
-
const baseUrl = process.env.SYLAS_BASE_URL;
|
|
22
|
-
if (!clientId || !clientSecret || !baseUrl) {
|
|
23
|
-
this.logError("Missing required environment variables:");
|
|
24
|
-
if (!clientId)
|
|
25
|
-
console.log(" - LINEAR_CLIENT_ID");
|
|
26
|
-
if (!clientSecret)
|
|
27
|
-
console.log(" - LINEAR_CLIENT_SECRET");
|
|
28
|
-
if (!baseUrl)
|
|
29
|
-
console.log(" - SYLAS_BASE_URL");
|
|
30
|
-
console.log("\nSet these in your shell profile (.zshrc):");
|
|
31
|
-
console.log(" export LINEAR_CLIENT_ID='your-client-id'");
|
|
32
|
-
console.log(" export LINEAR_CLIENT_SECRET='your-client-secret'");
|
|
33
|
-
console.log(" export SYLAS_BASE_URL='https://your-tunnel-domain.com'");
|
|
34
|
-
process.exit(1);
|
|
35
|
-
}
|
|
36
|
-
// Check config file exists
|
|
37
|
-
const configPath = resolve(this.app.sylasHome, DEFAULT_CONFIG_FILENAME);
|
|
38
|
-
let config;
|
|
39
|
-
try {
|
|
40
|
-
config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
this.logError(`Config file not found: ${configPath}`);
|
|
44
|
-
console.log("Run 'sylas' first to create initial configuration.");
|
|
45
|
-
process.exit(1);
|
|
46
|
-
}
|
|
47
|
-
console.log("Configuration:");
|
|
48
|
-
console.log(` Client ID: ${clientId.substring(0, 20)}...`);
|
|
49
|
-
console.log(` Base URL: ${baseUrl}`);
|
|
50
|
-
console.log(` Config: ${configPath}`);
|
|
51
|
-
console.log(` Callback port: ${this.callbackPort}`);
|
|
52
|
-
console.log();
|
|
53
|
-
try {
|
|
54
|
-
// Start temporary server to receive OAuth callback
|
|
55
|
-
const authCode = await this.waitForCallback(clientId);
|
|
56
|
-
// Exchange code for tokens
|
|
57
|
-
console.log("Exchanging code for tokens...");
|
|
58
|
-
const tokens = await this.exchangeCodeForTokens(authCode, clientId, clientSecret);
|
|
59
|
-
this.logSuccess(`Got access token: ${tokens.accessToken.substring(0, 30)}...`);
|
|
60
|
-
// Fetch workspace info
|
|
61
|
-
console.log("Fetching workspace info...");
|
|
62
|
-
const workspace = await this.fetchWorkspaceInfo(tokens.accessToken);
|
|
63
|
-
this.logSuccess(`Workspace: ${workspace.name} (${workspace.id})`);
|
|
64
|
-
// Update config.json
|
|
65
|
-
console.log("Saving tokens to config.json...");
|
|
66
|
-
this.overwriteRepoConfigTokens(config, configPath, tokens, workspace);
|
|
67
|
-
const updatedCount = config.repositories.filter((r) => r.linearWorkspaceId === workspace.id).length;
|
|
68
|
-
this.logSuccess(`Updated ${updatedCount} repository/repositories`);
|
|
69
|
-
console.log();
|
|
70
|
-
this.logSuccess("Authentication complete! Restart sylas to use the new tokens.");
|
|
71
|
-
process.exit(0);
|
|
72
|
-
}
|
|
73
|
-
catch (error) {
|
|
74
|
-
this.logError(`Authentication failed: ${error.message}`);
|
|
75
|
-
process.exit(1);
|
|
76
|
-
}
|
|
77
|
-
finally {
|
|
78
|
-
// One of the key guarantees of finally ā it runs regardless of how the try block exits (return, throw, or normal completion).
|
|
79
|
-
await this.cleanup();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
async waitForCallback(clientId) {
|
|
83
|
-
return new Promise((resolve, reject) => {
|
|
84
|
-
const baseUrl = process.env.SYLAS_BASE_URL;
|
|
85
|
-
if (!baseUrl) {
|
|
86
|
-
reject(new Error("SYLAS_BASE_URL environment variable is required"));
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
const redirectUri = `${baseUrl}/callback`;
|
|
90
|
-
// https://linear.app/developers/oauth-2-0-authentication
|
|
91
|
-
// https://linear.app/developers/oauth-actor-authorization
|
|
92
|
-
const oauthUrl = `https://linear.app/oauth/authorize?client_id=${clientId}&redirect_uri=${encodeURIComponent(redirectUri)}&response_type=code&scope=write,app:assignable,app:mentionable&actor=app`;
|
|
93
|
-
this.server = Fastify({ logger: false });
|
|
94
|
-
this.server.get("/callback", async (request, reply) => {
|
|
95
|
-
const query = request.query;
|
|
96
|
-
const code = query.code;
|
|
97
|
-
const error = query.error;
|
|
98
|
-
if (error) {
|
|
99
|
-
reply
|
|
100
|
-
.type("text/html; charset=utf-8")
|
|
101
|
-
.code(400)
|
|
102
|
-
.send(`<!DOCTYPE html>
|
|
103
|
-
<html><head><meta charset="utf-8"></head>
|
|
104
|
-
<body style="font-family: system-ui; padding: 40px; text-align: center;">
|
|
105
|
-
<h2>Authorization failed</h2>
|
|
106
|
-
<p>${error}</p>
|
|
107
|
-
</body></html>`);
|
|
108
|
-
reject(new Error(`OAuth error: ${error}`));
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (code) {
|
|
112
|
-
reply
|
|
113
|
-
.type("text/html; charset=utf-8")
|
|
114
|
-
.code(200)
|
|
115
|
-
.send(`<!DOCTYPE html>
|
|
116
|
-
<html><head><meta charset="utf-8"></head>
|
|
117
|
-
<body style="font-family: system-ui; padding: 40px; text-align: center;">
|
|
118
|
-
<h2>Sylas authorized successfully</h2>
|
|
119
|
-
<p>You can close this window and return to the terminal.</p>
|
|
120
|
-
</body></html>`);
|
|
121
|
-
resolve(code);
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
reply
|
|
125
|
-
.type("text/html; charset=utf-8")
|
|
126
|
-
.code(400)
|
|
127
|
-
.send(`<!DOCTYPE html>
|
|
128
|
-
<html><head><meta charset="utf-8"></head>
|
|
129
|
-
<body style="font-family: system-ui; padding: 40px; text-align: center;">
|
|
130
|
-
<h2>Missing authorization code</h2>
|
|
131
|
-
</body></html>`);
|
|
132
|
-
reject(new Error("Missing authorization code"));
|
|
133
|
-
});
|
|
134
|
-
this.server
|
|
135
|
-
.listen({ port: this.callbackPort, host: "0.0.0.0" })
|
|
136
|
-
.then(() => {
|
|
137
|
-
console.log(`Waiting for authorization on port ${this.callbackPort}...`);
|
|
138
|
-
console.log();
|
|
139
|
-
console.log("Opening browser for Linear authorization...");
|
|
140
|
-
console.log();
|
|
141
|
-
console.log("If browser doesn't open, visit:");
|
|
142
|
-
console.log(oauthUrl);
|
|
143
|
-
console.log();
|
|
144
|
-
open(oauthUrl).catch(() => {
|
|
145
|
-
console.log("Could not open browser automatically.");
|
|
146
|
-
});
|
|
147
|
-
})
|
|
148
|
-
.catch((err) => {
|
|
149
|
-
reject(new Error(`Server error: ${err.message}`));
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
async exchangeCodeForTokens(code, clientId, clientSecret) {
|
|
154
|
-
const baseUrl = process.env.SYLAS_BASE_URL;
|
|
155
|
-
const redirectUri = `${baseUrl}/callback`;
|
|
156
|
-
// https://linear.app/developers/oauth-2-0-authentication
|
|
157
|
-
const response = await fetch("https://api.linear.app/oauth/token", {
|
|
158
|
-
method: "POST",
|
|
159
|
-
headers: {
|
|
160
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
161
|
-
},
|
|
162
|
-
body: new URLSearchParams({
|
|
163
|
-
code,
|
|
164
|
-
redirect_uri: redirectUri,
|
|
165
|
-
client_id: clientId,
|
|
166
|
-
client_secret: clientSecret,
|
|
167
|
-
grant_type: "authorization_code",
|
|
168
|
-
}).toString(),
|
|
169
|
-
});
|
|
170
|
-
if (!response.ok) {
|
|
171
|
-
const errorText = await response.text();
|
|
172
|
-
throw new Error(`Token exchange failed: ${errorText}`);
|
|
173
|
-
}
|
|
174
|
-
const data = (await response.json());
|
|
175
|
-
if (!data.access_token || !data.access_token.startsWith("lin_oauth_")) {
|
|
176
|
-
throw new Error("Invalid access token received");
|
|
177
|
-
}
|
|
178
|
-
return {
|
|
179
|
-
accessToken: data.access_token,
|
|
180
|
-
refreshToken: data.refresh_token,
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
async fetchWorkspaceInfo(accessToken) {
|
|
184
|
-
const linearClient = new LinearClient({ accessToken });
|
|
185
|
-
const viewer = await linearClient.viewer;
|
|
186
|
-
const organization = await viewer.organization;
|
|
187
|
-
if (!organization?.id) {
|
|
188
|
-
throw new Error("Failed to get workspace info from Linear");
|
|
189
|
-
}
|
|
190
|
-
return { id: organization.id, name: organization.name || organization.id };
|
|
191
|
-
}
|
|
192
|
-
overwriteRepoConfigTokens(config, configPath, tokens, workspace) {
|
|
193
|
-
// Update all repositories matching this workspace (or unset workspace)
|
|
194
|
-
for (const repo of config.repositories) {
|
|
195
|
-
if (repo.linearWorkspaceId === workspace.id ||
|
|
196
|
-
!repo.linearWorkspaceId ||
|
|
197
|
-
repo.linearWorkspaceId === "") {
|
|
198
|
-
repo.linearToken = tokens.accessToken;
|
|
199
|
-
repo.linearRefreshToken = tokens.refreshToken;
|
|
200
|
-
repo.linearWorkspaceId = workspace.id;
|
|
201
|
-
repo.linearWorkspaceName = workspace.name;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
writeFileSync(configPath, JSON.stringify(config, null, "\t"), "utf-8");
|
|
205
|
-
}
|
|
206
|
-
async cleanup() {
|
|
207
|
-
if (this.server) {
|
|
208
|
-
await this.server.close();
|
|
209
|
-
this.server = null;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
//# sourceMappingURL=SelfAuthCommand.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelfAuthCommand.js","sourceRoot":"","sources":["../../../src/commands/SelfAuthCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,OAAiC,MAAM,SAAS,CAAC;AACxD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAmB,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE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iBAAiB,KAAK,SAAS,CAAC,EAAE;gBACvC,CAAC,IAAI,CAAC,iBAAiB;gBACvB,IAAI,CAAC,iBAAiB,KAAK,EAAE,EAC5B,CAAC;gBACF,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;gBACtC,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,YAAY,CAAC;gBAC9C,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC,EAAE,CAAC;gBACtC,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC,IAAI,CAAC;YAC3C,CAAC;QACF,CAAC;QAED,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAEO,KAAK,CAAC,OAAO;QACpB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACpB,CAAC;IACF,CAAC;CACD"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from "./ICommand.js";
|
|
2
|
-
/**
|
|
3
|
-
* Start command - main entry point for starting the edge worker
|
|
4
|
-
*/
|
|
5
|
-
export declare class StartCommand extends BaseCommand {
|
|
6
|
-
execute(_args: string[]): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=StartCommand.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StartCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/StartCommand.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IACtC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAsF7C"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { getSylasAppUrl } from "sylas-cloudflare-tunnel-client";
|
|
2
|
-
import { BaseCommand } from "./ICommand.js";
|
|
3
|
-
/**
|
|
4
|
-
* Start command - main entry point for starting the edge worker
|
|
5
|
-
*/
|
|
6
|
-
export class StartCommand extends BaseCommand {
|
|
7
|
-
async execute(_args) {
|
|
8
|
-
try {
|
|
9
|
-
// Load edge configuration
|
|
10
|
-
const edgeConfig = this.app.config.load();
|
|
11
|
-
const repositories = edgeConfig.repositories || [];
|
|
12
|
-
// Check if we're in setup waiting mode (no repositories + SYLAS_SETUP_PENDING flag)
|
|
13
|
-
if (repositories.length === 0 &&
|
|
14
|
-
process.env.SYLAS_SETUP_PENDING === "true") {
|
|
15
|
-
// Enable setup waiting mode and start config watcher
|
|
16
|
-
this.app.enableSetupWaitingMode();
|
|
17
|
-
// Start setup waiting mode - server only, no EdgeWorker
|
|
18
|
-
await this.app.worker.startSetupWaitingMode();
|
|
19
|
-
// Setup signal handlers for graceful shutdown
|
|
20
|
-
this.app.setupSignalHandlers();
|
|
21
|
-
// Keep process alive and wait for configuration
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
// Check if we're in idle mode (no repositories, post-onboarding)
|
|
25
|
-
if (repositories.length === 0) {
|
|
26
|
-
// Enable idle mode and start config watcher
|
|
27
|
-
this.app.enableIdleMode();
|
|
28
|
-
// Start idle mode - server infrastructure only, no EdgeWorker
|
|
29
|
-
await this.app.worker.startIdleMode();
|
|
30
|
-
// Setup signal handlers for graceful shutdown
|
|
31
|
-
this.app.setupSignalHandlers();
|
|
32
|
-
// Keep process alive and wait for configuration
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
// Start the edge worker (SharedApplicationServer will start Cloudflare tunnel if CLOUDFLARE_TOKEN is set)
|
|
36
|
-
await this.app.worker.startEdgeWorker({
|
|
37
|
-
repositories,
|
|
38
|
-
});
|
|
39
|
-
// Display server information
|
|
40
|
-
const serverPort = this.app.worker.getServerPort();
|
|
41
|
-
this.logger.raw("");
|
|
42
|
-
this.logger.divider(70);
|
|
43
|
-
this.logger.success("Edge worker started successfully");
|
|
44
|
-
this.logger.info(`š Version: ${this.app.version}`);
|
|
45
|
-
this.logger.info(`š Server running on port ${serverPort}`);
|
|
46
|
-
if (process.env.CLOUDFLARE_TOKEN) {
|
|
47
|
-
this.logger.info("š©ļø Cloudflare tunnel: Active");
|
|
48
|
-
}
|
|
49
|
-
this.logger.info(`\nš¦ Managing ${repositories.length} repositories:`);
|
|
50
|
-
repositories.forEach((repo) => {
|
|
51
|
-
this.logger.info(` ⢠${repo.name} (${repo.repositoryPath})`);
|
|
52
|
-
});
|
|
53
|
-
this.logger.divider(70);
|
|
54
|
-
// Setup signal handlers for graceful shutdown
|
|
55
|
-
this.app.setupSignalHandlers();
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
this.logger.error(`Failed to start edge application: ${error.message}`);
|
|
59
|
-
// Provide helpful error guidance
|
|
60
|
-
if (error.message?.includes("CLOUDFLARE_TOKEN")) {
|
|
61
|
-
this.logger.info("\nš” Cloudflare tunnel requires:");
|
|
62
|
-
this.logger.info(" - CLOUDFLARE_TOKEN environment variable");
|
|
63
|
-
this.logger.info(` - Get your token from: ${getSylasAppUrl()}/onboarding`);
|
|
64
|
-
}
|
|
65
|
-
else if (error.message?.includes("Failed to connect")) {
|
|
66
|
-
this.logger.info("\nš” Connection issues can occur when:");
|
|
67
|
-
this.logger.info(" - Linear OAuth tokens have expired");
|
|
68
|
-
this.logger.info(" - The Linear API is temporarily unavailable");
|
|
69
|
-
this.logger.info(" - Your network connection is having issues");
|
|
70
|
-
}
|
|
71
|
-
await this.app.shutdown();
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=StartCommand.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StartCommand.js","sourceR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AAI,CAAC,kCAAkC,CAAC,CAAC;gBACrD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;gBAC/D,IAAI,CAAC,MAAM,CAAC,IAAI,CACf,6BAA6B,cAAc,EAAE,aAAa,CAC1D,CAAC;YACH,CAAC;iBAAM,IAAI,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;gBAC3D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;gBAC1D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;gBACnE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;YACnE,CAAC;YAED,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACF,CAAC;CACD"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Application constants
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Default server port for OAuth callbacks and webhooks
|
|
6
|
-
*/
|
|
7
|
-
export declare const DEFAULT_SERVER_PORT = 3456;
|
|
8
|
-
/**
|
|
9
|
-
* Parse a port number from string with validation
|
|
10
|
-
*/
|
|
11
|
-
export declare function parsePort(value: string | undefined, defaultPort: number): number;
|
|
12
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/config/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC;;GAEG;AACH,wBAAgB,SAAS,CACxB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,WAAW,EAAE,MAAM,GACjB,MAAM,CAMR"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Application constants
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Default server port for OAuth callbacks and webhooks
|
|
6
|
-
*/
|
|
7
|
-
export const DEFAULT_SERVER_PORT = 3456;
|
|
8
|
-
/**
|
|
9
|
-
* Parse a port number from string with validation
|
|
10
|
-
*/
|
|
11
|
-
export function parsePort(value, defaultPort) {
|
|
12
|
-
if (!value)
|
|
13
|
-
return defaultPort;
|
|
14
|
-
const parsed = parseInt(value, 10);
|
|
15
|
-
return Number.isNaN(parsed) || parsed < 1 || parsed > 65535
|
|
16
|
-
? defaultPort
|
|
17
|
-
: parsed;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/config/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC;;GAEG;AACH,MAAM,UAAU,SAAS,CACxB,KAAyB,EACzB,WAAmB;IAEnB,IAAI,CAAC,KAAK;QAAE,OAAO,WAAW,CAAC;IAC/B,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,KAAK;QAC1D,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,MAAM,CAAC;AACX,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { EdgeConfig } from "sylas-core";
|
|
2
|
-
/**
|
|
3
|
-
* Linear credentials obtained from OAuth flow
|
|
4
|
-
*/
|
|
5
|
-
export interface LinearCredentials {
|
|
6
|
-
linearToken: string;
|
|
7
|
-
linearWorkspaceId: string;
|
|
8
|
-
linearWorkspaceName: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Workspace information for issue processing
|
|
12
|
-
*/
|
|
13
|
-
export interface Workspace {
|
|
14
|
-
path: string;
|
|
15
|
-
isGitWorktree: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Re-export EdgeConfig from sylas-core for convenience
|
|
19
|
-
*/
|
|
20
|
-
export type { EdgeConfig };
|
|
21
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/src/config/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/config/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { EdgeConfig } from "../config/types.js";
|
|
2
|
-
import type { Logger } from "./Logger.js";
|
|
3
|
-
/**
|
|
4
|
-
* Service responsible for configuration management
|
|
5
|
-
* Handles loading, saving, and validation of edge configuration
|
|
6
|
-
*/
|
|
7
|
-
export declare class ConfigService {
|
|
8
|
-
private logger;
|
|
9
|
-
private configPath;
|
|
10
|
-
constructor(sylasHome: string, logger: Logger);
|
|
11
|
-
/**
|
|
12
|
-
* Get the configuration file path
|
|
13
|
-
*/
|
|
14
|
-
getConfigPath(): string;
|
|
15
|
-
/**
|
|
16
|
-
* Load edge configuration from disk
|
|
17
|
-
*/
|
|
18
|
-
load(): EdgeConfig;
|
|
19
|
-
/**
|
|
20
|
-
* Run migrations on config to ensure it's up to date
|
|
21
|
-
* Persists changes to disk if any migrations were applied
|
|
22
|
-
*/
|
|
23
|
-
private migrateConfig;
|
|
24
|
-
/**
|
|
25
|
-
* Save edge configuration to disk
|
|
26
|
-
*/
|
|
27
|
-
save(config: EdgeConfig): void;
|
|
28
|
-
/**
|
|
29
|
-
* Update a specific field in the configuration
|
|
30
|
-
*/
|
|
31
|
-
update(updater: (config: EdgeConfig) => EdgeConfig): void;
|
|
32
|
-
/**
|
|
33
|
-
* Check if configuration exists
|
|
34
|
-
*/
|
|
35
|
-
exists(): boolean;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=ConfigService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigService.d.ts","sourceRoot":"","sources":["../../../src/services/ConfigService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;GAGG;AACH,qBAAa,aAAa;IAKxB,OAAO,CAAC,MAAM;IAJf,OAAO,CAAC,UAAU,CAAS;gBAG1B,SAAS,EAAE,MAAM,EACT,MAAM,EAAE,MAAM;IAKvB;;OAEG;IACH,aAAa,IAAI,MAAM;IAIvB;;OAEG;IACH,IAAI,IAAI,UAAU;IAmClB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAuDrB;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAW9B;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,UAAU,GAAG,IAAI;IAMzD;;OAEG;IACH,MAAM,IAAI,OAAO;CAGjB"}
|