sphereai-cli 1.0.17 → 1.0.19

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/.env CHANGED
@@ -1,13 +1,13 @@
1
- # Main API URL (for prompts and other resources after authentication)
2
- #SPHEREAI_API_URL=https://localhost:5001
3
- SPHEREAI_API_URL=https://api.develop.sphereai.nava.com.br
4
-
5
- # CLI API URL (for key-based authentication)
6
- SPHEREAI_CLI_API_URL=https://cli.api.develop.sphereai.nava.com.br
7
-
8
- # OAuth2 URL (for legacy OAuth authentication)
9
- SPHEREAI_AUTH_URL=http://localhost:3000/login?callback=http://localhost:3001/callback
10
- SPHEREAI_OAUTH_CALLBACK_PORT=3001
11
-
12
- # develop config
1
+ # Main API URL (for prompts and other resources after authentication)
2
+ #SPHEREAI_API_URL=https://localhost:5001
3
+ SPHEREAI_API_URL=https://api.develop.sphereai.nava.com.br
4
+
5
+ # CLI API URL (for key-based authentication)
6
+ SPHEREAI_CLI_API_URL=https://cli.api.develop.sphereai.nava.com.br
7
+
8
+ # OAuth2 URL (for legacy OAuth authentication)
9
+ SPHEREAI_AUTH_URL=http://localhost:3000/login?callback=http://localhost:3001/callback
10
+ SPHEREAI_OAUTH_CALLBACK_PORT=3001
11
+
12
+ # develop config
13
13
  NODE_TLS_REJECT_UNAUTHORIZED=0
package/.sphereignore ADDED
@@ -0,0 +1,46 @@
1
+ # .sphereignore - Files and directories to exclude from tracking
2
+ # Similar to .gitignore syntax
3
+
4
+ # Dependencies
5
+ node_modules/
6
+ bower_components/
7
+
8
+ # Build outputs
9
+ dist/
10
+ build/
11
+ out/
12
+ *.js.map
13
+
14
+ # Environment variables
15
+ .env
16
+ .env.*
17
+
18
+ # Logs
19
+ *.log
20
+ logs/
21
+ npm-debug.log*
22
+
23
+ # IDE / Editor
24
+ .vscode/
25
+ .idea/
26
+ *.swp
27
+ *.swo
28
+ *~
29
+
30
+ # OS files
31
+ .DS_Store
32
+ Thumbs.db
33
+ Desktop.ini
34
+
35
+ # Testing
36
+ coverage/
37
+ .nyc_output/
38
+
39
+ # Temporary files
40
+ *.tmp
41
+ *.temp
42
+ .cache/
43
+
44
+ # Git
45
+ .git/
46
+ .gitignore
package/README.md CHANGED
@@ -30,6 +30,30 @@ You're ready to use SphereAI CLI commands.
30
30
 
31
31
  ## Commands
32
32
 
33
+ ### Initialization
34
+
35
+ Initialize SphereAI in your project directory.
36
+
37
+ | Command | Description |
38
+ |---------|-------------|
39
+ | `sphereai init` | Create a default .sphereignore file |
40
+
41
+ **Options:**
42
+
43
+ | Option | Description |
44
+ |--------|-------------|
45
+ | `-f, --force` | Overwrite existing .sphereignore file |
46
+
47
+ **Examples:**
48
+
49
+ ```bash
50
+ # Initialize with default .sphereignore
51
+ sphereai init
52
+
53
+ # Overwrite existing .sphereignore
54
+ sphereai init --force
55
+ ```
56
+
33
57
  ### Authentication
34
58
 
35
59
  | Command | Description |
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerInitCommand(program: Command): void;
3
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuB1D"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.registerInitCommand = registerInitCommand;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const formatters_1 = require("../utils/formatters");
40
+ function getDefaultSphereIgnoreContent() {
41
+ // Read from the template file bundled with the package
42
+ const templatePath = path.join(__dirname, '..', '..', '.sphereignore');
43
+ if (fs.existsSync(templatePath)) {
44
+ return fs.readFileSync(templatePath, 'utf-8');
45
+ }
46
+ throw new Error('Default .sphereignore template not found');
47
+ }
48
+ function registerInitCommand(program) {
49
+ program
50
+ .command('init')
51
+ .description('Initialize SphereAI in the current directory')
52
+ .option('-f, --force', 'Overwrite existing .sphereignore file')
53
+ .action((options) => {
54
+ const sphereignorePath = path.join(process.cwd(), '.sphereignore');
55
+ if (fs.existsSync(sphereignorePath) && !options.force) {
56
+ (0, formatters_1.warning)('.sphereignore already exists. Use --force to overwrite.');
57
+ return;
58
+ }
59
+ try {
60
+ const content = getDefaultSphereIgnoreContent();
61
+ fs.writeFileSync(sphereignorePath, content, 'utf-8');
62
+ (0, formatters_1.success)('Created .sphereignore file');
63
+ (0, formatters_1.info)('You can now customize the ignore patterns for your project.');
64
+ }
65
+ catch (err) {
66
+ (0, formatters_1.error)('Failed to create .sphereignore file: ' + err.message);
67
+ process.exit(1);
68
+ }
69
+ });
70
+ }
71
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,kDAuBC;AAtCD,uCAAyB;AACzB,2CAA6B;AAC7B,oDAAoE;AAEpE,SAAS,6BAA6B;IACpC,uDAAuD;IACvD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;IAEvE,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,OAAO,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAC9D,CAAC;AAED,SAAgB,mBAAmB,CAAC,OAAgB;IAClD,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,8CAA8C,CAAC;SAC3D,MAAM,CAAC,aAAa,EAAE,uCAAuC,CAAC;SAC9D,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,eAAe,CAAC,CAAC;QAEnE,IAAI,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACtD,IAAA,oBAAO,EAAC,yDAAyD,CAAC,CAAC;YACnE,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,6BAA6B,EAAE,CAAC;YAChD,EAAE,CAAC,aAAa,CAAC,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACrD,IAAA,oBAAO,EAAC,4BAA4B,CAAC,CAAC;YACtC,IAAA,iBAAI,EAAC,6DAA6D,CAAC,CAAC;QACtE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAA,kBAAK,EAAC,uCAAuC,GAAI,GAAa,CAAC,OAAO,CAAC,CAAC;YACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ const prompts_1 = require("./commands/prompts");
16
16
  const files_1 = require("./commands/files");
17
17
  const execute_1 = require("./commands/execute");
18
18
  const debug_1 = require("./commands/debug");
19
+ const init_1 = require("./commands/init");
19
20
  const config_service_1 = require("./services/config-service");
20
21
  const api_client_1 = require("./services/api-client");
21
22
  const package_json_1 = __importDefault(require("../package.json"));
@@ -51,52 +52,53 @@ program
51
52
  (0, files_1.registerFilesCommands)(program);
52
53
  (0, execute_1.registerExecuteCommand)(program);
53
54
  (0, debug_1.registerDebugCommand)(program);
55
+ (0, init_1.registerInitCommand)(program);
54
56
  // Add help examples
55
- program.addHelpText('after', `
56
-
57
- Examples:
58
- # Authenticate using UserChannelKey
59
- $ sphereai auth login YOUR_USER_CHANNEL_KEY
60
-
61
- # Authenticate using OAuth2 (legacy)
62
- $ sphereai auth login-oauth
63
-
64
- # Set token manually
65
- $ sphereai auth set-token eyJhbGc...
66
-
67
- # Check current user
68
- $ sphereai auth whoami
69
-
70
- # List all prompts
71
- $ sphereai prompts list
72
-
73
- # List prompts with pagination
74
- $ sphereai prompts list --page 2 --size 20
75
-
76
- # List prompts in JSON format
77
- $ sphereai prompts list --output json
78
-
79
- # Add all files from current directory
80
- $ sphereai files add .
81
-
82
- # Add a specific file
83
- $ sphereai files add src/index.ts
84
-
85
- # List tracked files
86
- $ sphereai files list
87
-
88
- # Show status of tracked files
89
- $ sphereai files status
90
-
91
- # Clear all tracked files
92
- $ sphereai files clear --force
93
-
94
- # Execute AI command with tracked files
95
- $ sphereai execute --prompt-id 123
96
-
97
- Configuration:
98
- Config file location: ~/.config/sphereai-cli/config.json
99
- View config: sphereai auth config
57
+ program.addHelpText('after', `
58
+
59
+ Examples:
60
+ # Authenticate using UserChannelKey
61
+ $ sphereai auth login YOUR_USER_CHANNEL_KEY
62
+
63
+ # Authenticate using OAuth2 (legacy)
64
+ $ sphereai auth login-oauth
65
+
66
+ # Set token manually
67
+ $ sphereai auth set-token eyJhbGc...
68
+
69
+ # Check current user
70
+ $ sphereai auth whoami
71
+
72
+ # List all prompts
73
+ $ sphereai prompts list
74
+
75
+ # List prompts with pagination
76
+ $ sphereai prompts list --page 2 --size 20
77
+
78
+ # List prompts in JSON format
79
+ $ sphereai prompts list --output json
80
+
81
+ # Add all files from current directory
82
+ $ sphereai files add .
83
+
84
+ # Add a specific file
85
+ $ sphereai files add src/index.ts
86
+
87
+ # List tracked files
88
+ $ sphereai files list
89
+
90
+ # Show status of tracked files
91
+ $ sphereai files status
92
+
93
+ # Clear all tracked files
94
+ $ sphereai files clear --force
95
+
96
+ # Execute AI command with tracked files
97
+ $ sphereai execute --prompt-id 123
98
+
99
+ Configuration:
100
+ Config file location: ~/.config/sphereai-cli/config.json
101
+ View config: sphereai auth config
100
102
  `);
101
103
  // Parse command line arguments
102
104
  program.parse(process.argv);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AACA,oDAA4B;AAC5B,gDAAwB;AAExB,gBAAM,CAAC,MAAM,CAAC;IACZ,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC;CACzC,CAAC,CAAC;AAEH,yCAAoC;AACpC,0CAAuD;AACvD,gDAA6D;AAC7D,4CAAyD;AACzD,gDAA4D;AAC5D,4CAAwD;AACxD,8DAA0D;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rC,CAAC;SAAM,CAAC;QACN,mBAAmB;QACnB,MAAM,WAAW,GAAG,8BAAa,CAAC,QAAQ,EAAE,CAAC;QAC7C,IAAI,WAAW,EAAE,CAAC;YAChB,sBAAS,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,0BAA0B;AAC1B,IAAA,2BAAoB,EAAC,OAAO,CAAC,CAAC;AAC9B,IAAA,iCAAuB,EAAC,OAAO,CAAC,CAAC;AACjC,IAAA,6BAAqB,EAAC,OAAO,CAAC,CAAC;AAC/B,IAAA,gCAAsB,EAAC,OAAO,CAAC,CAAC;AAChC,IAAA,4BAAoB,EAAC,OAAO,CAAC,CAAC;AAC9B,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC;AAE7B,oBAAoB;AACpB,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6C5B,CAAC,CAAC;AAEH,+BAA+B;AAC/B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,mCAAmC;AACnC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sphereai-cli",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "CLI tool for interacting with the SphereAI API",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -44,6 +44,7 @@
44
44
  },
45
45
  "files": [
46
46
  "dist",
47
- ".env"
47
+ ".env",
48
+ ".sphereignore"
48
49
  ]
49
50
  }
@@ -1,3 +0,0 @@
1
- import { Command } from 'commander';
2
- export declare function registerModelsCommands(program: Command): void;
3
- //# sourceMappingURL=models.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/commands/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoE7D"}
@@ -1,70 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.registerModelsCommands = registerModelsCommands;
7
- const ora_1 = __importDefault(require("ora"));
8
- const api_client_1 = require("../services/api-client");
9
- const config_service_1 = require("../services/config-service");
10
- const formatters_1 = require("../utils/formatters");
11
- const errors_1 = require("../utils/errors");
12
- function registerModelsCommands(program) {
13
- const models = program
14
- .command('models')
15
- .description('AI Models management commands');
16
- // List models command
17
- models
18
- .command('list')
19
- .alias('ls')
20
- .description('List available AI models')
21
- .option('-p, --page <number>', 'Page number', parseInt, 1)
22
- .option('-s, --size <number>', 'Page size', parseInt, 20)
23
- .option('-a, --active-only', 'Show only active models', false)
24
- .option('-o, --output <format>', 'Output format (json|table)', 'table')
25
- .action(async (options) => {
26
- try {
27
- const token = config_service_1.configService.getToken();
28
- (0, errors_1.requireAuth)(token);
29
- const spinner = (0, ora_1.default)('Fetching AI models...').start();
30
- const queryParams = {
31
- _page: options.page,
32
- _size: options.size,
33
- _order: 'name'
34
- };
35
- // Filter active only
36
- if (options.activeOnly) {
37
- queryParams.active = true;
38
- }
39
- const modelsData = await api_client_1.apiClient.listModels(queryParams);
40
- spinner.stop();
41
- const format = options.output;
42
- console.log((0, formatters_1.formatModelsList)(modelsData, format));
43
- (0, formatters_1.info)(`Showing page ${options.page} (${modelsData.length} results)`);
44
- }
45
- catch (err) {
46
- (0, errors_1.handleError)(err);
47
- }
48
- });
49
- // Get model command
50
- models
51
- .command('get')
52
- .description('Get AI model details by ID')
53
- .argument('<model-id>', 'AI Model ID', parseInt)
54
- .option('-o, --output <format>', 'Output format (json|table)', 'table')
55
- .action(async (modelId, options) => {
56
- try {
57
- const token = config_service_1.configService.getToken();
58
- (0, errors_1.requireAuth)(token);
59
- const spinner = (0, ora_1.default)('Fetching model details...').start();
60
- const model = await api_client_1.apiClient.getModel(modelId);
61
- spinner.stop();
62
- const format = options.output;
63
- console.log((0, formatters_1.formatModel)(model, format));
64
- }
65
- catch (err) {
66
- (0, errors_1.handleError)(err);
67
- }
68
- });
69
- }
70
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/commands/models.ts"],"names":[],"mappings":";;;;;AAYA,wDAoEC;AA/ED,8CAAsB;AACtB,uDAAmD;AACnD,+DAA2D;AAC3D,oDAK6B;AAC7B,4CAA2D;AAE3D,SAAgB,sBAAsB,CAAC,OAAgB;IACrD,MAAM,MAAM,GAAG,OAAO;SACnB,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,+BAA+B,CAAC,CAAC;IAEhD,sBAAsB;IACtB,MAAM;SACH,OAAO,CAAC,MAAM,CAAC;SACf,KAAK,CAAC,IAAI,CAAC;SACX,WAAW,CAAC,0BAA0B,CAAC;SACvC,MAAM,CAAC,qBAAqB,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC;SACzD,MAAM,CAAC,qBAAqB,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,CAAC;SACxD,MAAM,CAAC,mBAAmB,EAAE,yBAAyB,EAAE,KAAK,CAAC;SAC7D,MAAM,CAAC,uBAAuB,EAAE,4BAA4B,EAAE,OAAO,CAAC;SACtE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,8BAAa,CAAC,QAAQ,EAAE,CAAC;YACvC,IAAA,oBAAW,EAAC,KAAK,CAAC,CAAC;YAEnB,MAAM,OAAO,GAAG,IA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MAAM,KAAK,GAAG,MAAM,sBAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAEhD,OAAO,CAAC,IAAI,EAAE,CAAC;YAEf,MAAM,MAAM,GAAG,OAAO,CAAC,MAAsB,CAAC;YAC9C,OAAO,CAAC,GAAG,CAAC,IAAA,wBAAW,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAA,oBAAW,EAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,31 +0,0 @@
1
- export interface FileWalkerOptions {
2
- ignoreFilePath?: string;
3
- includeDotFiles?: boolean;
4
- maxDepth?: number;
5
- }
6
- export declare class FileWalker {
7
- private ignoreParser;
8
- private options;
9
- constructor(options?: FileWalkerOptions);
10
- /**
11
- * Walk through a directory and return all non-ignored files
12
- */
13
- walk(dir: string): string[];
14
- /**
15
- * Recursively walk through directories
16
- */
17
- private walkRecursive;
18
- /**
19
- * Filter a list of file paths based on ignore patterns
20
- */
21
- filterFiles(files: string[], baseDir?: string): string[];
22
- /**
23
- * Check if a specific file should be ignored
24
- */
25
- shouldIgnore(filePath: string): boolean;
26
- /**
27
- * Get the ignore patterns (for debugging)
28
- */
29
- getIgnorePatterns(): any;
30
- }
31
- //# sourceMappingURL=file-walker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-walker.d.ts","sourceRoot":"","sources":["../../src/utils/file-walker.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,OAAO,CAA8B;gBAEjC,OAAO,GAAE,iBAAsB;IAc3C;;OAEG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAM3B;;OAEG;IACH,OAAO,CAAC,aAAa;IAmCrB;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;IAOxD;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIvC;;OAEG;IACH,iBAAiB;CAGlB"}
@@ -1,118 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.FileWalker = void 0;
37
- const fs = __importStar(require("fs"));
38
- const path = __importStar(require("path"));
39
- const ignore_parser_1 = require("./ignore-parser");
40
- class FileWalker {
41
- constructor(options = {}) {
42
- this.ignoreParser = new ignore_parser_1.IgnoreParser();
43
- this.options = {
44
- ignoreFilePath: options.ignoreFilePath || '.sphereignore',
45
- includeDotFiles: options.includeDotFiles ?? false,
46
- maxDepth: options.maxDepth ?? Infinity
47
- };
48
- // Load ignore patterns if file exists
49
- if (this.options.ignoreFilePath && fs.existsSync(this.options.ignoreFilePath)) {
50
- this.ignoreParser.parseFile(this.options.ignoreFilePath);
51
- }
52
- }
53
- /**
54
- * Walk through a directory and return all non-ignored files
55
- */
56
- walk(dir) {
57
- const files = [];
58
- this.walkRecursive(dir, dir, files, 0);
59
- return files;
60
- }
61
- /**
62
- * Recursively walk through directories
63
- */
64
- walkRecursive(baseDir, currentDir, files, depth) {
65
- if (depth > this.options.maxDepth) {
66
- return;
67
- }
68
- let entries;
69
- try {
70
- entries = fs.readdirSync(currentDir, { withFileTypes: true });
71
- }
72
- catch (error) {
73
- // Skip directories we can't read
74
- return;
75
- }
76
- for (const entry of entries) {
77
- const fullPath = path.join(currentDir, entry.name);
78
- const relativePath = path.relative(baseDir, fullPath);
79
- // Skip dot files/directories if not included
80
- if (!this.options.includeDotFiles && entry.name.startsWith('.')) {
81
- continue;
82
- }
83
- // Check if this path should be ignored
84
- if (this.ignoreParser.shouldIgnore(relativePath)) {
85
- continue;
86
- }
87
- if (entry.isDirectory()) {
88
- this.walkRecursive(baseDir, fullPath, files, depth + 1);
89
- }
90
- else if (entry.isFile()) {
91
- files.push(fullPath);
92
- }
93
- }
94
- }
95
- /**
96
- * Filter a list of file paths based on ignore patterns
97
- */
98
- filterFiles(files, baseDir) {
99
- return files.filter(file => {
100
- const relativePath = baseDir ? path.relative(baseDir, file) : file;
101
- return !this.ignoreParser.shouldIgnore(relativePath);
102
- });
103
- }
104
- /**
105
- * Check if a specific file should be ignored
106
- */
107
- shouldIgnore(filePath) {
108
- return this.ignoreParser.shouldIgnore(filePath);
109
- }
110
- /**
111
- * Get the ignore patterns (for debugging)
112
- */
113
- getIgnorePatterns() {
114
- return this.ignoreParser.getPatterns();
115
- }
116
- }
117
- exports.FileWalker = FileWalker;
118
- //# sourceMappingURL=file-walker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-walker.js","sourceRoot":"","sources":["../../src/utils/file-walker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,mDAA+C;AAQ/C,MAAa,UAAU;IAIrB,YAAY,UAA6B,EAAE;QACzC,IAAI,CAAC,YAAY,GAAG,IAAI,4BAAY,EAAE,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG;YACb,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,eAAe;YACzD,eAAe,EAAE,OAAO,CAAC,eAAe,IAAI,KAAK;YACjD,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,QAAQ;SACvC,CAAC;QAEF,sCAAsC;QACtC,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;YAC9E,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,GAAW;QACd,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QACvC,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,OAAe,EAAE,UAAkB,EAAE,KAAe,EAAE,KAAa;QACvF,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YAClC,OAAO;QACT,CAAC;QAED,IAAI,OAAoB,CAAC;QACzB,IAAI,CAAC;YACH,OAAO,GAAG,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CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,QAAgB;QAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,iBAAiB;QACf,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;CACF;AAxFD,gCAwFC"}
@@ -1,21 +0,0 @@
1
- export interface IgnorePattern {
2
- pattern: string;
3
- isNegation: boolean;
4
- isDirectory: boolean;
5
- }
6
- export declare class IgnoreParser {
7
- private patterns;
8
- /**
9
- * Parse a .sphereignore file and extract patterns
10
- * Supports:
11
- * - File extensions (*.log, *.tmp)
12
- * - Specific file names (config.local.json)
13
- * - Directory patterns (node_modules/, dist/)
14
- * - Negation patterns (!important.log)
15
- * - Comments (# this is a comment)
16
- * - Wildcards (src/**/ (): any;
17
- test: any;
18
- ts: any;
19
- (): any;
20
- }
21
- //# sourceMappingURL=ignore-parser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ignore-parser.d.ts","sourceRoot":"","sources":["../../src/utils/ignore-parser.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAuB;IAEvC;;;;;;;;2BAQuB,CAAC;IAAC,IAAI,MAAA;IAAC,EAAE,MAAA;IAC9B;CAAA"}
@@ -1,170 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.IgnoreParser = void 0;
37
- const fs = __importStar(require("fs"));
38
- const path = __importStar(require("path"));
39
- class IgnoreParser {
40
- constructor() {
41
- this.patterns = [];
42
- }
43
- /**
44
- * Parse a .sphereignore file and extract patterns
45
- * Supports:
46
- * - File extensions (*.log, *.tmp)
47
- * - Specific file names (config.local.json)
48
- * - Directory patterns (node_modules/, dist/)
49
- * - Negation patterns (!important.log)
50
- * - Comments (# this is a comment)
51
- * - Wildcards (src/**/ *() { }
52
- *() { }
53
- }
54
- exports.IgnoreParser = IgnoreParser;
55
- /;
56
- parseFile(ignoreFilePath, string);
57
- void {
58
- if(, fs) { }, : .existsSync(ignoreFilePath)
59
- };
60
- {
61
- return;
62
- }
63
- const content = fs.readFileSync(ignoreFilePath, 'utf-8');
64
- const lines = content.split(/\r?\n/);
65
- for (const line of lines) {
66
- const trimmed = line.trim();
67
- // Skip empty lines and comments
68
- if (!trimmed || trimmed.startsWith('#')) {
69
- continue;
70
- }
71
- const pattern = this.parsePattern(trimmed);
72
- this.patterns.push(pattern);
73
- }
74
- parsePattern(line, string);
75
- IgnorePattern;
76
- {
77
- let pattern = line;
78
- let isNegation = false;
79
- // Check for negation pattern
80
- if (pattern.startsWith('!')) {
81
- isNegation = true;
82
- pattern = pattern.substring(1);
83
- }
84
- // Check if it's a directory pattern
85
- const isDirectory = pattern.endsWith('/');
86
- if (isDirectory) {
87
- pattern = pattern.slice(0, -1);
88
- }
89
- return {
90
- pattern: pattern,
91
- isNegation,
92
- isDirectory
93
- };
94
- }
95
- /**
96
- * Check if a file path should be ignored
97
- */
98
- shouldIgnore(filePath, string);
99
- boolean;
100
- {
101
- const normalizedPath = filePath.replace(/\\/g, '/');
102
- let ignored = false;
103
- for (const { pattern, isNegation, isDirectory } of this.patterns) {
104
- const matches = this.matchPattern(normalizedPath, pattern, isDirectory);
105
- if (matches) {
106
- ignored = !isNegation;
107
- }
108
- }
109
- return ignored;
110
- }
111
- matchPattern(filePath, string, pattern, string, isDirectory, boolean);
112
- boolean;
113
- {
114
- const fileName = path.basename(filePath);
115
- const normalizedPattern = pattern.replace(/\\/g, '/');
116
- // If it's a directory pattern, check if path contains the directory
117
- if (isDirectory) {
118
- return filePath.includes(normalizedPattern + '/') ||
119
- filePath.startsWith(normalizedPattern + '/');
120
- }
121
- // Handle extension patterns (*.log, *.tmp)
122
- if (normalizedPattern.startsWith('*.')) {
123
- const extension = normalizedPattern.substring(1); // includes the dot
124
- return fileName.endsWith(extension);
125
- }
126
- // Handle wildcards with path segments (src/**/*.test.ts)
127
- if (normalizedPattern.includes('**')) {
128
- const regexPattern = this.convertGlobToRegex(normalizedPattern);
129
- return regexPattern.test(filePath);
130
- }
131
- // Handle simple wildcards (*.log, test-*.js)
132
- if (normalizedPattern.includes('*')) {
133
- const regexPattern = this.convertSimpleWildcardToRegex(normalizedPattern);
134
- return regexPattern.test(fileName);
135
- }
136
- // Exact match for file name or path
137
- return fileName === normalizedPattern || filePath === normalizedPattern ||
138
- filePath.endsWith('/' + normalizedPattern);
139
- }
140
- convertGlobToRegex(pattern, string);
141
- RegExp;
142
- {
143
- let regexStr = pattern
144
- .replace(/\./g, '\\.')
145
- .replace(/\*\*/g, '___DOUBLE_STAR___')
146
- .replace(/\*/g, '[^/]*')
147
- .replace(/___DOUBLE_STAR___/g, '.*')
148
- .replace(/\?/g, '.');
149
- // Anchor the pattern
150
- regexStr = '^' + regexStr + '$';
151
- return new RegExp(regexStr);
152
- }
153
- convertSimpleWildcardToRegex(pattern, string);
154
- RegExp;
155
- {
156
- const regexStr = pattern
157
- .replace(/\./g, '\\.')
158
- .replace(/\*/g, '.*')
159
- .replace(/\?/g, '.');
160
- return new RegExp('^' + regexStr + '$');
161
- }
162
- /**
163
- * Get all patterns (for debugging)
164
- */
165
- getPatterns();
166
- IgnorePattern[];
167
- {
168
- return this.patterns;
169
- }
170
- //# sourceMappingURL=ignore-parser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ignore-parser.js","sourceRoot":"","sources":["../../src/utils/ignore-parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAQ7B,MAAa,YAAY;IAAzB;QACU,aAAQ,GAAoB,EAAE,CAAC;IAWrC,CAAC,AAAD;IATF;;;;;;;;2BAQuB,CAAA,CAAC,KAAA,CAAC,AAAD;IACvB,CAAC,KAAA,CAAC,AAAD;CAAA;AAZJ,oCAYI;AAAA,CAAC,CAAA;AACH,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AAAE,KAAK;IACtC,EAAE,CAAE,EAAC,EAAE,IAAA,CAAC,AAAD,EAAA,EAAA,CAAC,UAAU,CAAC,cAAc,CAAC;CAAC,CAAA;AAAC,CAAC;IACnC,OAAO;AACT,CAAC;AAED,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;AACzD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CA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