tarsk 0.3.2 → 0.3.16
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/dist/cli.d.ts +3 -0
- package/dist/cli.js +22 -0
- package/dist/index.js +15 -4
- package/dist/public/assets/{index-DJC-p914.js → index-CLr9LKtA.js} +1679 -1682
- package/dist/public/index.html +1 -1
- package/node_modules/@neovate/code/LICENSE +21 -0
- package/node_modules/@neovate/code/README.md +56 -0
- package/node_modules/@neovate/code/dist/cli.mjs +714 -716
- package/node_modules/@neovate/code/dist/index.d.ts +0 -373
- package/node_modules/@neovate/code/dist/index.mjs +790 -792
- package/node_modules/@neovate/code/package.json +138 -2
- package/node_modules/@neovate/code/vendor/ripgrep/COPYING +3 -0
- package/node_modules/@neovate/code/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/node_modules/@neovate/code/vendor/ripgrep/arm64-linux/rg +0 -0
- package/node_modules/@neovate/code/vendor/ripgrep/x64-darwin/rg +0 -0
- package/node_modules/@neovate/code/vendor/ripgrep/x64-linux/rg +0 -0
- package/node_modules/@neovate/code/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/package.json +3 -3
- package/dist/managers/ConversationManager.d.ts +0 -83
- package/dist/managers/ConversationManager.js +0 -129
- package/dist/managers/GitManager.d.ts +0 -133
- package/dist/managers/GitManager.js +0 -330
- package/dist/managers/MetadataManager.d.ts +0 -139
- package/dist/managers/MetadataManager.js +0 -309
- package/dist/managers/ModelManager.d.ts +0 -57
- package/dist/managers/ModelManager.js +0 -129
- package/dist/managers/NeovateExecutor.d.ts +0 -40
- package/dist/managers/NeovateExecutor.js +0 -138
- package/dist/managers/ProjectManager.d.ts +0 -162
- package/dist/managers/ProjectManager.js +0 -353
- package/dist/managers/ThreadManager.d.ts +0 -181
- package/dist/managers/ThreadManager.js +0 -325
- package/dist/model-info-openai.d.ts +0 -17
- package/dist/model-info-openai.js +0 -59
- package/dist/public/assets/index-B443aj9k.js +0 -8506
- package/dist/routes/chat-old.d.ts +0 -21
- package/dist/routes/chat-old.js +0 -251
- package/dist/routes/projects-old.d.ts +0 -20
- package/dist/routes/projects-old.js +0 -297
- package/dist/routes/threads-old.d.ts +0 -14
- package/dist/routes/threads-old.js +0 -393
- package/dist/utils/openai-pricing-scraper.d.ts +0 -17
- package/dist/utils/openai-pricing-scraper.js +0 -185
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from 'child_process';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
// Run the main index.js with --open flag to open browser
|
|
8
|
+
const indexPath = path.join(__dirname, 'index.js');
|
|
9
|
+
const args = [...process.argv.slice(2), '--open'];
|
|
10
|
+
const child = spawn('node', [indexPath, ...args], {
|
|
11
|
+
stdio: 'inherit'
|
|
12
|
+
});
|
|
13
|
+
process.on('SIGINT', () => {
|
|
14
|
+
child.kill('SIGINT');
|
|
15
|
+
});
|
|
16
|
+
process.on('SIGTERM', () => {
|
|
17
|
+
child.kill('SIGTERM');
|
|
18
|
+
});
|
|
19
|
+
child.on('exit', (code) => {
|
|
20
|
+
process.exit(code || 0);
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/index.js
CHANGED
|
@@ -22,11 +22,21 @@ import { createGitRoutes } from './routes/git.js';
|
|
|
22
22
|
import { AVAILABLE_PROGRAMS } from './types/models.js';
|
|
23
23
|
const __filename = fileURLToPath(import.meta.url);
|
|
24
24
|
const __dirname = path.dirname(__filename);
|
|
25
|
+
// Parse arguments
|
|
26
|
+
const args = process.argv.slice(2);
|
|
27
|
+
const isDebug = args.includes('--debug');
|
|
28
|
+
const shouldOpenBrowser = args.includes('--open');
|
|
29
|
+
// Suppress console.log unless debug is enabled
|
|
30
|
+
if (!isDebug) {
|
|
31
|
+
console.log = () => { };
|
|
32
|
+
}
|
|
33
|
+
const positionalArgs = args.filter(arg => !arg.startsWith('--'));
|
|
34
|
+
const rootFolderArg = positionalArgs[0];
|
|
25
35
|
const app = new Hono();
|
|
26
36
|
// Configure CORS middleware
|
|
27
37
|
app.use('/*', cors());
|
|
28
38
|
// Initialize managers
|
|
29
|
-
const rootFolder = process.env.ROOT_FOLDER || process.cwd();
|
|
39
|
+
const rootFolder = rootFolderArg ? path.resolve(process.cwd(), rootFolderArg) : (process.env.ROOT_FOLDER || process.cwd());
|
|
30
40
|
const metadataManager = new MetadataManager(rootFolder);
|
|
31
41
|
const gitManager = new GitManagerImpl();
|
|
32
42
|
const projectManager = new ProjectManagerImpl(rootFolder, metadataManager, gitManager);
|
|
@@ -86,13 +96,14 @@ app.all('*', (c) => {
|
|
|
86
96
|
});
|
|
87
97
|
const port = process.env.PORT ? parseInt(process.env.PORT) : 641;
|
|
88
98
|
const url = `http://localhost:${port}`;
|
|
89
|
-
console.log
|
|
99
|
+
// Use process.stdout.write to ensure this message is shown even if console.log is suppressed
|
|
100
|
+
process.stdout.write(`Tarsk started on ${url}\n`);
|
|
90
101
|
serve({
|
|
91
102
|
fetch: app.fetch,
|
|
92
103
|
port
|
|
93
104
|
}, () => {
|
|
94
|
-
// Open browser
|
|
95
|
-
if (
|
|
105
|
+
// Open browser only if --open flag is passed
|
|
106
|
+
if (shouldOpenBrowser) {
|
|
96
107
|
const start = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
97
108
|
exec(`${start} ${url}`);
|
|
98
109
|
}
|