vigthoria-cli 1.10.47 → 1.10.49

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.
Files changed (60) hide show
  1. package/dist/commands/agent-session-menu.js +2 -8
  2. package/dist/commands/auth.js +51 -68
  3. package/dist/commands/bridge.js +42 -22
  4. package/dist/commands/cancel.js +15 -22
  5. package/dist/commands/chat.d.ts +3 -0
  6. package/dist/commands/chat.js +326 -295
  7. package/dist/commands/config.js +33 -73
  8. package/dist/commands/deploy.js +83 -123
  9. package/dist/commands/device.js +21 -61
  10. package/dist/commands/edit.js +32 -39
  11. package/dist/commands/explain.js +18 -25
  12. package/dist/commands/fork.d.ts +17 -0
  13. package/dist/commands/fork.js +164 -0
  14. package/dist/commands/generate.js +37 -44
  15. package/dist/commands/history.d.ts +17 -0
  16. package/dist/commands/history.js +113 -0
  17. package/dist/commands/hub.js +95 -102
  18. package/dist/commands/index.js +41 -46
  19. package/dist/commands/legion.js +146 -186
  20. package/dist/commands/preview.d.ts +55 -0
  21. package/dist/commands/preview.js +467 -0
  22. package/dist/commands/replay.d.ts +18 -0
  23. package/dist/commands/replay.js +156 -0
  24. package/dist/commands/repo.d.ts +97 -0
  25. package/dist/commands/repo.js +773 -0
  26. package/dist/commands/review.js +29 -36
  27. package/dist/commands/security.js +5 -12
  28. package/dist/commands/update.d.ts +9 -0
  29. package/dist/commands/update.js +201 -0
  30. package/dist/commands/wallet.js +28 -35
  31. package/dist/commands/workflow.js +13 -20
  32. package/dist/index.d.ts +21 -0
  33. package/dist/index.js +1652 -0
  34. package/dist/utils/api.d.ts +544 -0
  35. package/dist/utils/api.js +5486 -0
  36. package/dist/utils/brain-hub-client.js +1 -5
  37. package/dist/utils/bridge-client.js +11 -52
  38. package/dist/utils/cli-state.d.ts +54 -0
  39. package/dist/utils/cli-state.js +185 -0
  40. package/dist/utils/codebase-indexer.js +4 -41
  41. package/dist/utils/config.d.ts +82 -0
  42. package/dist/utils/config.js +269 -0
  43. package/dist/utils/context-ranker.js +15 -21
  44. package/dist/utils/desktop-bridge-client.d.ts +12 -0
  45. package/dist/utils/desktop-bridge-client.js +30 -0
  46. package/dist/utils/files.js +5 -42
  47. package/dist/utils/logger.js +42 -50
  48. package/dist/utils/persona.js +3 -8
  49. package/dist/utils/post-write-validator.js +26 -33
  50. package/dist/utils/project-memory.js +16 -23
  51. package/dist/utils/session.d.ts +118 -0
  52. package/dist/utils/session.js +423 -0
  53. package/dist/utils/task-display.js +13 -20
  54. package/dist/utils/tools.d.ts +269 -0
  55. package/dist/utils/tools.js +3450 -0
  56. package/dist/utils/workspace-brain-service.js +8 -45
  57. package/dist/utils/workspace-cache.js +18 -26
  58. package/dist/utils/workspace-stream.js +21 -63
  59. package/package.json +2 -1
  60. package/scripts/release/validate-no-go-gates.sh +7 -4
@@ -0,0 +1,269 @@
1
+ /**
2
+ * Configuration Manager for Vigthoria CLI
3
+ */
4
+ import Conf from 'conf';
5
+ import { secureFileMode } from './cli-state.js';
6
+ const defaultConfig = {
7
+ apiUrl: 'https://coder.vigthoria.io',
8
+ modelsApiUrl: 'https://api.vigthoria.io', // Direct AI Models API - no proxying through Coder
9
+ wsUrl: 'wss://coder.vigthoria.io/ws',
10
+ selfHostedModelsApiUrl: null,
11
+ authToken: null,
12
+ refreshToken: null,
13
+ userId: null,
14
+ email: null,
15
+ v3ServiceKey: null,
16
+ subscription: {
17
+ plan: null,
18
+ status: null,
19
+ expiresAt: null,
20
+ },
21
+ preferences: {
22
+ defaultModel: 'code',
23
+ theme: 'dark',
24
+ autoApplyFixes: false,
25
+ showDiffs: true,
26
+ contextLines: 3,
27
+ maxTokens: 4096,
28
+ },
29
+ persona: 'default',
30
+ project: {
31
+ rootPath: null,
32
+ ignorePatterns: [
33
+ 'node_modules',
34
+ '.git',
35
+ 'dist',
36
+ 'build',
37
+ '__pycache__',
38
+ '.venv',
39
+ 'venv',
40
+ '.env',
41
+ '*.log',
42
+ ],
43
+ },
44
+ };
45
+ export class Config {
46
+ store;
47
+ static OPERATOR_PLANS = new Set(['enterprise', 'admin', 'master_admin']);
48
+ static CLOUD_PLANS = new Set(['pro', 'professional', 'ultra', 'enterprise', 'master_admin', 'admin']);
49
+ constructor() {
50
+ // `Conf` defaults to 0o644 on POSIX which would leave auth tokens
51
+ // readable by every local user. We post-process the file in
52
+ // `secureOnDisk()` to enforce 0o600 ownership. The `fileMode`
53
+ // option exists on newer `conf` releases — supply it via a cast so
54
+ // older type-defs do not reject the field.
55
+ this.store = new Conf({
56
+ projectName: 'vigthoria-cli',
57
+ defaults: defaultConfig,
58
+ ...{ fileMode: 0o600 },
59
+ schema: {
60
+ apiUrl: { type: 'string' },
61
+ modelsApiUrl: { type: 'string' },
62
+ wsUrl: { type: 'string' },
63
+ selfHostedModelsApiUrl: { type: ['string', 'null'] },
64
+ authToken: { type: ['string', 'null'] },
65
+ refreshToken: { type: ['string', 'null'] },
66
+ userId: { type: ['string', 'null'] },
67
+ email: { type: ['string', 'null'] },
68
+ v3ServiceKey: { type: ['string', 'null'] },
69
+ subscription: {
70
+ type: 'object',
71
+ properties: {
72
+ plan: { type: ['string', 'null'] },
73
+ status: { type: ['string', 'null'] },
74
+ expiresAt: { type: ['string', 'null'] },
75
+ },
76
+ },
77
+ preferences: {
78
+ type: 'object',
79
+ properties: {
80
+ defaultModel: { type: 'string' },
81
+ theme: { type: 'string', enum: ['dark', 'light'] },
82
+ autoApplyFixes: { type: 'boolean' },
83
+ showDiffs: { type: 'boolean' },
84
+ contextLines: { type: 'number' },
85
+ maxTokens: { type: 'number' },
86
+ },
87
+ },
88
+ persona: { type: 'string', enum: ['default', 'wiener_grant'] },
89
+ project: {
90
+ type: 'object',
91
+ properties: {
92
+ rootPath: { type: ['string', 'null'] },
93
+ ignorePatterns: { type: 'array', items: { type: 'string' } },
94
+ },
95
+ },
96
+ },
97
+ });
98
+ // Defence-in-depth: re-apply 0600 every time we instantiate Config so
99
+ // that an older install which created the file with 0644 gets locked
100
+ // down on next startup.
101
+ try {
102
+ secureFileMode(this.store.path);
103
+ }
104
+ catch { /* best-effort */ }
105
+ }
106
+ /**
107
+ * Re-apply secure POSIX permissions to the on-disk config file. Safe
108
+ * to call repeatedly; no-op on Windows.
109
+ */
110
+ secureOnDisk() {
111
+ try {
112
+ secureFileMode(this.store.path);
113
+ }
114
+ catch { /* best-effort */ }
115
+ }
116
+ get(key) {
117
+ return this.store.get(key);
118
+ }
119
+ set(key, value) {
120
+ this.store.set(key, value);
121
+ }
122
+ getAll() {
123
+ return this.store.store;
124
+ }
125
+ reset() {
126
+ this.store.clear();
127
+ }
128
+ isAuthenticated() {
129
+ return this.store.get('authToken') !== null;
130
+ }
131
+ hasValidSubscription() {
132
+ const sub = this.store.get('subscription');
133
+ if (!sub.status || sub.status !== 'active')
134
+ return false;
135
+ if (sub.expiresAt) {
136
+ const expires = new Date(sub.expiresAt);
137
+ return expires > new Date();
138
+ }
139
+ return true;
140
+ }
141
+ getNormalizedPlan() {
142
+ return (this.store.get('subscription').plan || '').trim().toLowerCase();
143
+ }
144
+ hasOperatorAccess() {
145
+ return Config.OPERATOR_PLANS.has(this.getNormalizedPlan());
146
+ }
147
+ hasCloudAccess() {
148
+ return Config.CLOUD_PLANS.has(this.getNormalizedPlan());
149
+ }
150
+ getConfigPath() {
151
+ return this.store.path;
152
+ }
153
+ // Auth helpers
154
+ setAuth(data) {
155
+ this.store.set('authToken', data.token);
156
+ if (data.refreshToken) {
157
+ this.store.set('refreshToken', data.refreshToken);
158
+ }
159
+ this.store.set('userId', data.userId);
160
+ this.store.set('email', data.email);
161
+ // Tighten permissions whenever the token rotates so a brand-new
162
+ // install (which may have created the file under a previous default
163
+ // umask) becomes 0600 immediately after first login.
164
+ this.secureOnDisk();
165
+ }
166
+ clearAuth() {
167
+ this.store.set('authToken', null);
168
+ this.store.set('refreshToken', null);
169
+ this.store.set('userId', null);
170
+ this.store.set('email', null);
171
+ this.store.set('subscription', {
172
+ plan: null,
173
+ status: null,
174
+ expiresAt: null,
175
+ });
176
+ }
177
+ setSubscription(data) {
178
+ this.store.set('subscription', {
179
+ plan: data.plan,
180
+ status: data.status,
181
+ expiresAt: data.expiresAt || null,
182
+ });
183
+ }
184
+ // Model selection - Vigthoria Models (internal routing IDs only)
185
+ getAvailableModels() {
186
+ const sub = this.store.get('subscription');
187
+ const plan = (sub.plan || '').toLowerCase();
188
+ void plan;
189
+ // ═══════════════════════════════════════════════════════════════
190
+ // Vigthoria server infrastructure operational models
191
+ // ═══════════════════════════════════════════════════════════════
192
+ const models = [
193
+ { id: 'code', name: 'Vigthoria v3 Code 35B', description: 'Native 35B coding model on Blackwell (V3 pipeline)', tier: 'local', backendModel: 'vigthoria-v3-code-35b' },
194
+ { id: 'code-35b', name: 'Vigthoria v3 Code 35B', description: 'Same flagship model as code', tier: 'local', backendModel: 'vigthoria-v3-code-35b' },
195
+ { id: 'code-9b', name: 'Vigthoria v3 Code 9B', description: 'Efficient coding specialist for quick tasks', tier: 'local', backendModel: 'vigthoria-v3-code-9b' },
196
+ { id: 'balanced', name: 'Vigthoria Balanced 4B', description: 'Balanced general-purpose local model', tier: 'local', backendModel: 'vigthoria-v3-balanced-4b' },
197
+ { id: 'balanced-4b', name: 'Vigthoria Balanced 4B', description: 'Efficient 4B general-purpose model (Qwen3.5-4B based)', tier: 'local', backendModel: 'vigthoria-v3-balanced-4b' },
198
+ ];
199
+ if (this.hasCloudAccess()) {
200
+ models.push({ id: 'cloud-fast', name: 'Vigthoria Cloud Fast', description: 'Fast cloud responses for lighter work', tier: 'cloud', backendModel: 'vigthoria-cloud-fast' }, { id: 'cloud-balanced', name: 'Vigthoria Cloud Balanced', description: 'Default quality/cost balance for chat and coding', tier: 'cloud', backendModel: 'vigthoria-cloud-balanced' }, { id: 'cloud-code', name: 'Vigthoria Cloud Code', description: 'Economical cloud coding and completion', tier: 'cloud', backendModel: 'vigthoria-cloud-code' }, { id: 'cloud-power', name: 'Vigthoria Cloud Power', description: 'Premium general intelligence for demanding work', tier: 'cloud', backendModel: 'vigthoria-cloud-power' }, { id: 'cloud-maximum', name: 'Vigthoria Cloud Maximum', description: 'Maximum power for complex architecture and reviews', tier: 'cloud', backendModel: 'vigthoria-cloud-maximum' },
201
+ // Legacy aliases
202
+ { id: 'cloud', name: 'Vigthoria Cloud Balanced', description: 'Legacy alias for cloud-balanced', tier: 'cloud', backendModel: 'vigthoria-cloud-balanced' }, { id: 'cloud-reason', name: 'Vigthoria Cloud Balanced', description: 'Legacy alias for cloud-balanced', tier: 'cloud', backendModel: 'vigthoria-cloud-balanced' }, { id: 'ultra', name: 'Vigthoria Cloud Maximum', description: 'Legacy alias for cloud-maximum', tier: 'cloud', backendModel: 'vigthoria-cloud-maximum' });
203
+ }
204
+ const hubPrefs = this.store.get('hubModelPrefs');
205
+ if (hubPrefs?.enabledCloudModels?.length) {
206
+ return this.filterModelsByHubPreferences(models, hubPrefs.enabledCloudModels);
207
+ }
208
+ return models;
209
+ }
210
+ async refreshHubModelPreferences() {
211
+ const token = this.store.get('authToken');
212
+ const apiUrl = String(this.store.get('apiUrl') || '').replace(/\/$/, '');
213
+ if (!token || !apiUrl)
214
+ return;
215
+ try {
216
+ const response = await fetch(`${apiUrl}/api/user/credits/model-preferences`, {
217
+ headers: { Authorization: `Bearer ${token}` },
218
+ signal: AbortSignal.timeout(8000),
219
+ });
220
+ if (!response.ok)
221
+ return;
222
+ const prefs = await response.json();
223
+ if (prefs?.success === false)
224
+ return;
225
+ this.store.set('hubModelPrefs', {
226
+ enabledCloudModels: Array.isArray(prefs.enabledCloudModels) ? prefs.enabledCloudModels : [],
227
+ defaultCloudModel: typeof prefs.defaultCloudModel === 'string' ? prefs.defaultCloudModel : undefined,
228
+ defaultLocalModel: typeof prefs.defaultLocalModel === 'string' ? prefs.defaultLocalModel : undefined,
229
+ balance: typeof prefs.balance === 'number' ? prefs.balance : undefined,
230
+ fetchedAt: new Date().toISOString(),
231
+ });
232
+ }
233
+ catch {
234
+ // Non-fatal: CLI can still run with default model catalog.
235
+ }
236
+ }
237
+ // Check if a model is a "Cloud" tier model
238
+ isCloudModel(modelId) {
239
+ const cloudModels = ['cloud-fast', 'cloud-balanced', 'cloud-code', 'cloud-power', 'cloud-maximum', 'cloud', 'cloud-reason', 'ultra'];
240
+ return cloudModels.includes(modelId) || modelId.includes('cloud');
241
+ }
242
+ filterModelsByHubPreferences(models, enabledCloudModels) {
243
+ if (!enabledCloudModels || !enabledCloudModels.length)
244
+ return models;
245
+ const enabled = new Set(enabledCloudModels);
246
+ return models.filter((model) => model.tier !== 'cloud' || enabled.has(model.backendModel));
247
+ }
248
+ // Check if task is complex enough to suggest Cloud upgrade
249
+ isComplexTask(prompt) {
250
+ const complexIndicators = [
251
+ /refactor/i, /architect/i, /redesign/i, /migrate/i,
252
+ /multi.?file/i, /multiple files/i, /entire.*project/i,
253
+ /all files/i, /whole.*codebase/i, /implement.*feature/i,
254
+ /create.*system/i, /build.*from.*scratch/i,
255
+ /analyze.*project/i, /review.*codebase/i,
256
+ /audit.*project/i, /audit.*workspace/i,
257
+ /full overview/i, /analyse.*workspace/i,
258
+ /analy[sz]e.*entire/i, /deep audit/i,
259
+ ];
260
+ return complexIndicators.some(pattern => pattern.test(prompt));
261
+ }
262
+ shouldUseCloudForHeavyTask(prompt) {
263
+ // DISABLED: Cloud routing is now EXPLICIT ONLY (--model cloud or /cloud command)
264
+ // Do NOT auto-route based on keywords. User must opt-in.
265
+ // If user wants cloud: they'll use --model cloud or request it explicitly.
266
+ void prompt;
267
+ return false;
268
+ }
269
+ }
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * Vigthoria CLI — Semantic Context Ranker
4
3
  *
@@ -8,13 +7,8 @@
8
7
  *
9
8
  * No external dependencies — uses only Node.js built-ins.
10
9
  */
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.buildSemanticContext = buildSemanticContext;
16
- const node_fs_1 = __importDefault(require("node:fs"));
17
- const node_path_1 = __importDefault(require("node:path"));
10
+ import fs from 'node:fs';
11
+ import path from 'node:path';
18
12
  const IGNORED_DIRS = new Set([
19
13
  '.git', 'node_modules', 'dist', '.next', '__pycache__',
20
14
  '.vigthoria', 'coverage', '.cache', '.turbo', 'build', 'out',
@@ -45,8 +39,8 @@ function extractKeywords(prompt) {
45
39
  function scoreFile(filePath, keywords) {
46
40
  if (keywords.length === 0)
47
41
  return 0;
48
- const filename = node_path_1.default.basename(filePath).toLowerCase();
49
- const parentDir = node_path_1.default.basename(node_path_1.default.dirname(filePath)).toLowerCase();
42
+ const filename = path.basename(filePath).toLowerCase();
43
+ const parentDir = path.basename(path.dirname(filePath)).toLowerCase();
50
44
  let score = 0;
51
45
  for (const kw of keywords) {
52
46
  // Filename match (high weight)
@@ -57,7 +51,7 @@ function scoreFile(filePath, keywords) {
57
51
  score += 6;
58
52
  }
59
53
  try {
60
- const content = node_fs_1.default.readFileSync(filePath, 'utf-8').slice(0, 300000);
54
+ const content = fs.readFileSync(filePath, 'utf-8').slice(0, 300000);
61
55
  const lower = content.toLowerCase();
62
56
  for (const kw of keywords) {
63
57
  const escaped = kw.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
@@ -73,14 +67,14 @@ function scoreFile(filePath, keywords) {
73
67
  function walkWorkspace(dir, maxFiles = 800) {
74
68
  const results = [];
75
69
  const stack = [dir];
76
- const workspaceRoot = node_path_1.default.resolve(dir);
70
+ const workspaceRoot = path.resolve(dir);
77
71
  while (stack.length > 0 && results.length < maxFiles) {
78
72
  const current = stack.pop();
79
73
  if (!current)
80
74
  continue;
81
75
  let entries;
82
76
  try {
83
- entries = node_fs_1.default.readdirSync(current, { withFileTypes: true });
77
+ entries = fs.readdirSync(current, { withFileTypes: true });
84
78
  }
85
79
  catch {
86
80
  continue;
@@ -91,12 +85,12 @@ function walkWorkspace(dir, maxFiles = 800) {
91
85
  break;
92
86
  if (IGNORED_DIRS.has(entry.name))
93
87
  continue;
94
- const fullPath = node_path_1.default.join(current, entry.name);
88
+ const fullPath = path.join(current, entry.name);
95
89
  // Security: skip symlinks that escape workspace root (fixes 8.2)
96
90
  if (entry.isSymbolicLink()) {
97
91
  try {
98
- const real = node_fs_1.default.realpathSync(fullPath);
99
- if (!real.startsWith(workspaceRoot + node_path_1.default.sep) && real !== workspaceRoot)
92
+ const real = fs.realpathSync(fullPath);
93
+ if (!real.startsWith(workspaceRoot + path.sep) && real !== workspaceRoot)
100
94
  continue;
101
95
  }
102
96
  catch {
@@ -106,7 +100,7 @@ function walkWorkspace(dir, maxFiles = 800) {
106
100
  if (entry.isDirectory()) {
107
101
  stack.push(fullPath);
108
102
  }
109
- else if (entry.isFile() && TEXT_EXTENSIONS.has(node_path_1.default.extname(entry.name).toLowerCase())) {
103
+ else if (entry.isFile() && TEXT_EXTENSIONS.has(path.extname(entry.name).toLowerCase())) {
110
104
  results.push(fullPath);
111
105
  }
112
106
  }
@@ -117,8 +111,8 @@ function walkWorkspace(dir, maxFiles = 800) {
117
111
  * Score and rank workspace files by relevance to the given prompt.
118
112
  * Returns the top N files with path, score, and content snippet.
119
113
  */
120
- function buildSemanticContext(workspacePath, prompt, topN = 12) {
121
- if (!workspacePath || !node_fs_1.default.existsSync(workspacePath)) {
114
+ export function buildSemanticContext(workspacePath, prompt, topN = 12) {
115
+ if (!workspacePath || !fs.existsSync(workspacePath)) {
122
116
  return { topFiles: [], totalFilesScanned: 0, keywords: [] };
123
117
  }
124
118
  const keywords = extractKeywords(prompt);
@@ -134,11 +128,11 @@ function buildSemanticContext(workspacePath, prompt, topN = 12) {
134
128
  const topFiles = scored.map(({ filePath, score }) => {
135
129
  let snippet = '';
136
130
  try {
137
- snippet = node_fs_1.default.readFileSync(filePath, 'utf-8').slice(0, 600);
131
+ snippet = fs.readFileSync(filePath, 'utf-8').slice(0, 600);
138
132
  }
139
133
  catch { /* ignore */ }
140
134
  return {
141
- path: node_path_1.default.relative(workspacePath, filePath).replace(/\\/g, '/'),
135
+ path: path.relative(workspacePath, filePath).replace(/\\/g, '/'),
142
136
  score,
143
137
  snippet,
144
138
  };
@@ -0,0 +1,12 @@
1
+ export interface DesktopBridgeStatus {
2
+ ok: boolean;
3
+ endpoint: string;
4
+ service?: string;
5
+ version?: string;
6
+ controlEnabled?: boolean;
7
+ error?: string;
8
+ }
9
+ export declare function getDesktopBridgeStatus(options?: {
10
+ url?: string;
11
+ timeoutMs?: number;
12
+ }): Promise<DesktopBridgeStatus>;
@@ -0,0 +1,30 @@
1
+ export async function getDesktopBridgeStatus(options = {}) {
2
+ const endpoint = options.url
3
+ || process.env.VIGTHORIA_DESKTOP_BRIDGE_URL
4
+ || `http://${process.env.VIGTHORIA_DESKTOP_HOST || '127.0.0.1'}:${process.env.VIGTHORIA_DESKTOP_PORT || '49160'}`;
5
+ const timeoutMs = options.timeoutMs ?? 5000;
6
+ try {
7
+ const controller = new AbortController();
8
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
9
+ const response = await fetch(`${endpoint.replace(/\/$/, '')}/health`, {
10
+ signal: controller.signal,
11
+ headers: { Accept: 'application/json' },
12
+ });
13
+ clearTimeout(timer);
14
+ if (!response.ok) {
15
+ return { ok: false, endpoint, error: `HTTP ${response.status}` };
16
+ }
17
+ const data = await response.json();
18
+ return {
19
+ ok: true,
20
+ endpoint,
21
+ service: typeof data.service === 'string' ? data.service : undefined,
22
+ version: typeof data.version === 'string' ? data.version : undefined,
23
+ controlEnabled: data.controlEnabled === true || data.control_enabled === true,
24
+ };
25
+ }
26
+ catch (error) {
27
+ const message = error instanceof Error ? error.message : String(error);
28
+ return { ok: false, endpoint, error: message };
29
+ }
30
+ }
@@ -1,46 +1,10 @@
1
- "use strict";
2
1
  /**
3
2
  * File utilities for Vigthoria CLI
4
3
  */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.FileUtils = void 0;
40
- const fs = __importStar(require("fs"));
41
- const path = __importStar(require("path"));
42
- const glob_1 = require("glob");
43
- class FileUtils {
4
+ import * as fs from 'fs';
5
+ import * as path from 'path';
6
+ import { glob } from 'glob';
7
+ export class FileUtils {
44
8
  projectRoot;
45
9
  ignorePatterns;
46
10
  constructor(projectRoot, ignorePatterns = []) {
@@ -130,7 +94,7 @@ class FileUtils {
130
94
  if (!fs.existsSync(this.projectRoot)) {
131
95
  return [];
132
96
  }
133
- const files = await (0, glob_1.glob)(pattern, {
97
+ const files = await glob(pattern, {
134
98
  cwd: this.projectRoot,
135
99
  ignore: this.ignorePatterns,
136
100
  nodir: true,
@@ -275,4 +239,3 @@ class FileUtils {
275
239
  return { added, removed };
276
240
  }
277
241
  }
278
- exports.FileUtils = FileUtils;