okit-cli 0.0.1

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 (88) hide show
  1. package/README.md +222 -0
  2. package/dist/commands/check.d.ts +13 -0
  3. package/dist/commands/check.d.ts.map +1 -0
  4. package/dist/commands/check.js +259 -0
  5. package/dist/commands/check.js.map +1 -0
  6. package/dist/commands/claude.d.ts +10 -0
  7. package/dist/commands/claude.d.ts.map +1 -0
  8. package/dist/commands/claude.js +504 -0
  9. package/dist/commands/claude.js.map +1 -0
  10. package/dist/commands/menu.d.ts +3 -0
  11. package/dist/commands/menu.d.ts.map +1 -0
  12. package/dist/commands/menu.js +152 -0
  13. package/dist/commands/menu.js.map +1 -0
  14. package/dist/commands/repo.d.ts +3 -0
  15. package/dist/commands/repo.d.ts.map +1 -0
  16. package/dist/commands/repo.js +266 -0
  17. package/dist/commands/repo.js.map +1 -0
  18. package/dist/commands/uninstall.d.ts +2 -0
  19. package/dist/commands/uninstall.d.ts.map +1 -0
  20. package/dist/commands/uninstall.js +125 -0
  21. package/dist/commands/uninstall.js.map +1 -0
  22. package/dist/commands/upgrade.d.ts +6 -0
  23. package/dist/commands/upgrade.d.ts.map +1 -0
  24. package/dist/commands/upgrade.js +204 -0
  25. package/dist/commands/upgrade.js.map +1 -0
  26. package/dist/config/i18n.d.ts +141 -0
  27. package/dist/config/i18n.d.ts.map +1 -0
  28. package/dist/config/i18n.js +316 -0
  29. package/dist/config/i18n.js.map +1 -0
  30. package/dist/config/registry.d.ts +24 -0
  31. package/dist/config/registry.d.ts.map +1 -0
  32. package/dist/config/registry.js +388 -0
  33. package/dist/config/registry.js.map +1 -0
  34. package/dist/config/user.d.ts +32 -0
  35. package/dist/config/user.d.ts.map +1 -0
  36. package/dist/config/user.js +72 -0
  37. package/dist/config/user.js.map +1 -0
  38. package/dist/executor/deps/BrewDependencyProvider.d.ts +8 -0
  39. package/dist/executor/deps/BrewDependencyProvider.d.ts.map +1 -0
  40. package/dist/executor/deps/BrewDependencyProvider.js +52 -0
  41. package/dist/executor/deps/BrewDependencyProvider.js.map +1 -0
  42. package/dist/executor/deps/DependencyProvider.d.ts +11 -0
  43. package/dist/executor/deps/DependencyProvider.d.ts.map +1 -0
  44. package/dist/executor/deps/DependencyProvider.js +3 -0
  45. package/dist/executor/deps/DependencyProvider.js.map +1 -0
  46. package/dist/executor/deps/NpmDependencyProvider.d.ts +12 -0
  47. package/dist/executor/deps/NpmDependencyProvider.d.ts.map +1 -0
  48. package/dist/executor/deps/NpmDependencyProvider.js +78 -0
  49. package/dist/executor/deps/NpmDependencyProvider.js.map +1 -0
  50. package/dist/executor/deps/PipxDependencyProvider.d.ts +8 -0
  51. package/dist/executor/deps/PipxDependencyProvider.d.ts.map +1 -0
  52. package/dist/executor/deps/PipxDependencyProvider.js +32 -0
  53. package/dist/executor/deps/PipxDependencyProvider.js.map +1 -0
  54. package/dist/executor/deps/UvToolDependencyProvider.d.ts +8 -0
  55. package/dist/executor/deps/UvToolDependencyProvider.d.ts.map +1 -0
  56. package/dist/executor/deps/UvToolDependencyProvider.js +35 -0
  57. package/dist/executor/deps/UvToolDependencyProvider.js.map +1 -0
  58. package/dist/executor/plan/ExecutionPlanner.d.ts +13 -0
  59. package/dist/executor/plan/ExecutionPlanner.d.ts.map +1 -0
  60. package/dist/executor/plan/ExecutionPlanner.js +109 -0
  61. package/dist/executor/plan/ExecutionPlanner.js.map +1 -0
  62. package/dist/executor/plan/TopologicalSorter.d.ts +3 -0
  63. package/dist/executor/plan/TopologicalSorter.d.ts.map +1 -0
  64. package/dist/executor/plan/TopologicalSorter.js +49 -0
  65. package/dist/executor/plan/TopologicalSorter.js.map +1 -0
  66. package/dist/executor/plan/registryDeps.d.ts +3 -0
  67. package/dist/executor/plan/registryDeps.d.ts.map +1 -0
  68. package/dist/executor/plan/registryDeps.js +22 -0
  69. package/dist/executor/plan/registryDeps.js.map +1 -0
  70. package/dist/executor/runner.d.ts +13 -0
  71. package/dist/executor/runner.d.ts.map +1 -0
  72. package/dist/executor/runner.js +430 -0
  73. package/dist/executor/runner.js.map +1 -0
  74. package/dist/main.d.ts +3 -0
  75. package/dist/main.d.ts.map +1 -0
  76. package/dist/main.js +244 -0
  77. package/dist/main.js.map +1 -0
  78. package/dist/utils/sound.d.ts +10 -0
  79. package/dist/utils/sound.d.ts.map +1 -0
  80. package/dist/utils/sound.js +36 -0
  81. package/dist/utils/sound.js.map +1 -0
  82. package/dist/web/api/config.js +73 -0
  83. package/dist/web/api/stats.js +130 -0
  84. package/dist/web/public/app.js +284 -0
  85. package/dist/web/public/index.html +367 -0
  86. package/dist/web/public/styles.css +1004 -0
  87. package/dist/web/server.js +41 -0
  88. package/package.json +61 -0
@@ -0,0 +1,41 @@
1
+ const express = require('express');
2
+ const path = require('path');
3
+ const { getStats } = require('./api/stats');
4
+ const { getConfig, updateConfig } = require('./api/config');
5
+
6
+ function createServer(port = 3000) {
7
+ const app = express();
8
+
9
+ // Middleware
10
+ app.use(express.json());
11
+ app.use(express.static(path.join(__dirname, 'public')));
12
+
13
+ // API Routes
14
+ app.get('/api/stats', getStats);
15
+ app.get('/api/config', getConfig);
16
+ app.post('/api/config', updateConfig);
17
+
18
+ // SPA fallback - handle 404 for non-API routes
19
+ app.use((req, res) => {
20
+ // Don't redirect API routes
21
+ if (req.path.startsWith('/api/')) {
22
+ return res.status(404).json({ error: 'Not found' });
23
+ }
24
+ res.sendFile(path.join(__dirname, 'public', 'index.html'));
25
+ });
26
+
27
+ return app;
28
+ }
29
+
30
+ function startServer(port = 3000) {
31
+ const app = createServer(port);
32
+
33
+ app.listen(port, '127.0.0.1', () => {
34
+ console.log(`\n🌐 Claude UI is running at http://localhost:${port}`);
35
+ console.log(`Press Ctrl+C to stop\n`);
36
+ });
37
+
38
+ return app;
39
+ }
40
+
41
+ module.exports = { createServer, startServer };
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "okit-cli",
3
+ "version": "0.0.1",
4
+ "description": "OKIT v1 - 精简版工具执行器",
5
+ "main": "dist/main.js",
6
+ "bin": {
7
+ "okit": "dist/main.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc && npm run copy-web",
11
+ "copy-web": "mkdir -p dist/web && cp -r src/web/public dist/web/ && cp src/web/server.js dist/web/ && cp -r src/web/api dist/web/",
12
+ "dev": "ts-node src/main.ts",
13
+ "start": "node dist/main.js",
14
+ "pkg": "pkg . --out-path=bin"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "package.json",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "keywords": [
23
+ "cli",
24
+ "agent",
25
+ "devtools",
26
+ "installer",
27
+ "infrastructure"
28
+ ],
29
+ "author": "dolphin-molt",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/dolphin-molt/okit.git"
33
+ },
34
+ "license": "MIT",
35
+ "dependencies": {
36
+ "@types/express": "^5.0.6",
37
+ "commander": "^11.0.0",
38
+ "execa": "^5.1.1",
39
+ "express": "^5.2.1",
40
+ "fs-extra": "^11.1.1",
41
+ "kleur": "^4.1.5",
42
+ "ora": "^5.4.1",
43
+ "prompts": "^2.4.2"
44
+ },
45
+ "devDependencies": {
46
+ "@types/fs-extra": "^11.0.1",
47
+ "@types/node": "^20.5.0",
48
+ "@types/prompts": "^2.4.4",
49
+ "pkg": "^5.8.1",
50
+ "ts-node": "^10.9.1",
51
+ "typescript": "^5.1.6"
52
+ },
53
+ "pkg": {
54
+ "scripts": "dist/**/*.js",
55
+ "targets": [
56
+ "node18-macos-arm64",
57
+ "node18-macos-x64"
58
+ ],
59
+ "outputPath": "bin"
60
+ }
61
+ }