kaven-cli 0.3.5 → 0.4.0
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/commands/config/features.js +1026 -0
- package/dist/commands/config/index.js +1 -34
- package/dist/commands/index.js +1 -0
- package/dist/commands/init/index.js +25 -37
- package/dist/commands/marketplace/browse.js +1 -34
- package/dist/commands/module/activate.js +206 -0
- package/dist/commands/module/publish.js +2 -35
- package/dist/commands/upgrade/index.js +6 -39
- package/dist/core/AuthService.js +2 -34
- package/dist/core/CacheManager.js +3 -0
- package/dist/core/ConfigManager.js +8 -7
- package/dist/core/ErrorRecovery.js +1 -0
- package/dist/core/LicenseService.js +3 -38
- package/dist/core/ModuleDoctor.js +3 -0
- package/dist/core/ModuleInstaller.js +5 -36
- package/dist/core/ProjectInitializer.js +15 -3
- package/dist/core/RegistryResolver.js +3 -2
- package/dist/core/SchemaActivator.js +270 -0
- package/dist/core/ScriptRunner.js +3 -2
- package/dist/core/index.js +1 -0
- package/dist/index.js +69 -2
- package/dist/infrastructure/Container.js +2 -4
- package/dist/infrastructure/MarketplaceClient.js +5 -3
- package/dist/infrastructure/TelemetryBuffer.js +3 -1
- package/dist/infrastructure/TransactionalFileSystem.js +4 -1
- package/dist/infrastructure/errors.js +2 -0
- package/dist/infrastructure/index.js +1 -0
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ const doctor_1 = require("./commands/module/doctor");
|
|
|
7
7
|
const add_1 = require("./commands/module/add");
|
|
8
8
|
const remove_1 = require("./commands/module/remove");
|
|
9
9
|
const publish_1 = require("./commands/module/publish");
|
|
10
|
+
const activate_1 = require("./commands/module/activate");
|
|
10
11
|
const login_1 = require("./commands/auth/login");
|
|
11
12
|
const logout_1 = require("./commands/auth/logout");
|
|
12
13
|
const whoami_1 = require("./commands/auth/whoami");
|
|
@@ -19,6 +20,7 @@ const index_1 = require("./commands/init/index");
|
|
|
19
20
|
const index_2 = require("./commands/upgrade/index");
|
|
20
21
|
const index_3 = require("./commands/cache/index");
|
|
21
22
|
const index_4 = require("./commands/config/index");
|
|
23
|
+
const features_1 = require("./commands/config/features");
|
|
22
24
|
const index_5 = require("./commands/init-ci/index");
|
|
23
25
|
const main = () => {
|
|
24
26
|
const program = new commander_1.Command();
|
|
@@ -35,7 +37,7 @@ Examples:
|
|
|
35
37
|
$ kaven upgrade Upgrade your license tier
|
|
36
38
|
$ kaven module doctor Check project health
|
|
37
39
|
|
|
38
|
-
Documentation: https://docs.kaven.
|
|
40
|
+
Documentation: https://docs.kaven.site/cli
|
|
39
41
|
Support: https://github.com/kaven-co/kaven-cli/issues
|
|
40
42
|
`);
|
|
41
43
|
/**
|
|
@@ -48,17 +50,22 @@ Support: https://github.com/kaven-co/kaven-cli/issues
|
|
|
48
50
|
.option("--skip-install", "Skip running pnpm install after setup")
|
|
49
51
|
.option("--skip-git", "Skip git init and initial commit")
|
|
50
52
|
.option("--force", "Overwrite existing directory if it exists")
|
|
53
|
+
.option("--template <path>", "Path to a local template or custom git repository URL")
|
|
54
|
+
.option("--with-squad", "Install kaven-squad (AIOX) into squads/kaven-squad/ after scaffold")
|
|
51
55
|
.addHelpText("after", `
|
|
52
56
|
Examples:
|
|
53
57
|
$ kaven init my-app Interactive setup
|
|
54
58
|
$ kaven init my-app --defaults Use defaults (no prompts)
|
|
55
59
|
$ kaven init my-app --skip-git Skip git initialization
|
|
60
|
+
$ kaven init my-app --with-squad Install kaven-squad for AIOX integration
|
|
56
61
|
`)
|
|
57
62
|
.action((name, opts) => (0, index_1.initProject)(name, {
|
|
58
63
|
defaults: opts.defaults,
|
|
59
64
|
skipInstall: opts.skipInstall,
|
|
60
65
|
skipGit: opts.skipGit,
|
|
61
66
|
force: opts.force,
|
|
67
|
+
template: opts.template,
|
|
68
|
+
withSquad: opts.withSquad,
|
|
62
69
|
}));
|
|
63
70
|
/**
|
|
64
71
|
* Modules Group
|
|
@@ -66,7 +73,7 @@ Examples:
|
|
|
66
73
|
const moduleCommand = program
|
|
67
74
|
.command("module")
|
|
68
75
|
.alias("m")
|
|
69
|
-
.description("Manage Kaven modules: install, remove, publish, and diagnose")
|
|
76
|
+
.description("Manage Kaven modules: install, remove, publish, activate, and diagnose")
|
|
70
77
|
.addHelpText("after", `
|
|
71
78
|
Examples:
|
|
72
79
|
$ kaven module doctor Check module integrity
|
|
@@ -74,6 +81,9 @@ Examples:
|
|
|
74
81
|
$ kaven module add ./my-module Install a local module
|
|
75
82
|
$ kaven module remove payments Remove a module
|
|
76
83
|
$ kaven module publish Publish module to marketplace
|
|
84
|
+
$ kaven module list List schema modules and their status
|
|
85
|
+
$ kaven module activate billing Activate schema module (uncomment models)
|
|
86
|
+
$ kaven module deactivate billing Deactivate schema module (comment models)
|
|
77
87
|
`);
|
|
78
88
|
moduleCommand
|
|
79
89
|
.command("doctor")
|
|
@@ -129,6 +139,39 @@ Examples:
|
|
|
129
139
|
dryRun: opts.dryRun,
|
|
130
140
|
changelog: opts.changelog,
|
|
131
141
|
}));
|
|
142
|
+
moduleCommand
|
|
143
|
+
.command("activate <name> [root]")
|
|
144
|
+
.description("Activate a Kaven schema module by uncommenting its models in schema.extended.prisma")
|
|
145
|
+
.addHelpText("after", `
|
|
146
|
+
Modules: billing, projects, notifications
|
|
147
|
+
|
|
148
|
+
Examples:
|
|
149
|
+
$ kaven module activate billing
|
|
150
|
+
$ kaven module activate projects
|
|
151
|
+
$ kaven module activate projects ./my-app
|
|
152
|
+
`)
|
|
153
|
+
.action((name, root) => (0, activate_1.moduleActivate)(name, root));
|
|
154
|
+
moduleCommand
|
|
155
|
+
.command("deactivate <name> [root]")
|
|
156
|
+
.description("Deactivate a Kaven schema module by commenting its models in schema.extended.prisma")
|
|
157
|
+
.addHelpText("after", `
|
|
158
|
+
Modules: billing, projects, notifications
|
|
159
|
+
|
|
160
|
+
Examples:
|
|
161
|
+
$ kaven module deactivate billing
|
|
162
|
+
$ kaven module deactivate projects
|
|
163
|
+
$ kaven module deactivate projects ./my-app
|
|
164
|
+
`)
|
|
165
|
+
.action((name, root) => (0, activate_1.moduleDeactivate)(name, root));
|
|
166
|
+
moduleCommand
|
|
167
|
+
.command("list [root]")
|
|
168
|
+
.description("List available Kaven schema modules with their status, models, and dependencies")
|
|
169
|
+
.addHelpText("after", `
|
|
170
|
+
Examples:
|
|
171
|
+
$ kaven module list
|
|
172
|
+
$ kaven module list ./my-app
|
|
173
|
+
`)
|
|
174
|
+
.action((root) => (0, activate_1.moduleListActivation)(root));
|
|
132
175
|
/**
|
|
133
176
|
* Auth Group
|
|
134
177
|
*/
|
|
@@ -291,6 +334,9 @@ Examples:
|
|
|
291
334
|
$ kaven config get registry
|
|
292
335
|
$ kaven config view
|
|
293
336
|
$ kaven config reset
|
|
337
|
+
$ kaven config features
|
|
338
|
+
$ kaven config features --tier complete
|
|
339
|
+
$ kaven config features --list
|
|
294
340
|
`);
|
|
295
341
|
configCommand
|
|
296
342
|
.command("set <key> <value>")
|
|
@@ -310,6 +356,27 @@ Examples:
|
|
|
310
356
|
.command("reset")
|
|
311
357
|
.description("Reset configuration to defaults")
|
|
312
358
|
.action(() => (0, index_4.configReset)());
|
|
359
|
+
configCommand
|
|
360
|
+
.command("features")
|
|
361
|
+
.description("Interactive TUI to select and configure the 60 framework capabilities (feature flags)")
|
|
362
|
+
.option("--tier <tier>", "Apply a preset tier directly without prompts: starter | complete | pro | enterprise")
|
|
363
|
+
.option("--list", "List all available capabilities grouped by category, without modifying anything")
|
|
364
|
+
.addHelpText("after", `
|
|
365
|
+
Output: packages/database/prisma/seeds/capabilities.seed.ts (relative to cwd)
|
|
366
|
+
|
|
367
|
+
Examples:
|
|
368
|
+
$ kaven config features Interactive TUI (select tier + customize)
|
|
369
|
+
$ kaven config features --tier complete Apply Complete preset non-interactively
|
|
370
|
+
$ kaven config features --tier enterprise Apply all 60 capabilities
|
|
371
|
+
$ kaven config features --list Show capability catalog without writing
|
|
372
|
+
|
|
373
|
+
After generating the seed file:
|
|
374
|
+
$ pnpm prisma db seed
|
|
375
|
+
`)
|
|
376
|
+
.action((opts) => (0, features_1.configFeatures)({
|
|
377
|
+
tier: opts.tier,
|
|
378
|
+
list: opts.list ?? false,
|
|
379
|
+
}));
|
|
313
380
|
/**
|
|
314
381
|
* Init CI — Initialize CI/CD workflows
|
|
315
382
|
*/
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.container = exports.Container = void 0;
|
|
4
4
|
class Container {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
this.factories = new Map();
|
|
8
|
-
}
|
|
5
|
+
services = new Map();
|
|
6
|
+
factories = new Map();
|
|
9
7
|
register(name, factory) {
|
|
10
8
|
this.factories.set(name, factory);
|
|
11
9
|
}
|
|
@@ -8,10 +8,10 @@ const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const os_1 = __importDefault(require("os"));
|
|
10
10
|
const errors_1 = require("./errors");
|
|
11
|
-
const DEFAULT_BASE_URL = "https://
|
|
12
|
-
const REQUEST_TIMEOUT_MS =
|
|
11
|
+
const DEFAULT_BASE_URL = "https://marketplace.kaven.site";
|
|
12
|
+
const REQUEST_TIMEOUT_MS = 30_000;
|
|
13
13
|
const MAX_RETRIES = 3;
|
|
14
|
-
const INITIAL_RETRY_DELAY_MS =
|
|
14
|
+
const INITIAL_RETRY_DELAY_MS = 1_000;
|
|
15
15
|
function debug(message) {
|
|
16
16
|
if (process.env.KAVEN_DEBUG === "1") {
|
|
17
17
|
console.debug(`[kaven:debug] ${message}`);
|
|
@@ -53,6 +53,8 @@ function isRetryable(status) {
|
|
|
53
53
|
return status >= 500;
|
|
54
54
|
}
|
|
55
55
|
class MarketplaceClient {
|
|
56
|
+
baseURLPromise;
|
|
57
|
+
authService;
|
|
56
58
|
constructor(authService) {
|
|
57
59
|
this.authService = authService ?? null;
|
|
58
60
|
this.baseURLPromise = resolveBaseUrl();
|
|
@@ -8,8 +8,10 @@ const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const os_1 = __importDefault(require("os"));
|
|
10
10
|
class TelemetryBuffer {
|
|
11
|
+
static instance;
|
|
12
|
+
logPath;
|
|
13
|
+
buffer = [];
|
|
11
14
|
constructor() {
|
|
12
|
-
this.buffer = [];
|
|
13
15
|
this.logPath = path_1.default.join(os_1.default.homedir(), ".kaven", "telemetry.log");
|
|
14
16
|
}
|
|
15
17
|
static getInstance() {
|
|
@@ -8,9 +8,12 @@ const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const glob_1 = require("glob");
|
|
10
10
|
class TransactionalFileSystem {
|
|
11
|
+
projectRoot;
|
|
12
|
+
backupDir;
|
|
13
|
+
backupId;
|
|
14
|
+
filesToBackup = [];
|
|
11
15
|
constructor(projectRoot, backupDir = ".agent/backups") {
|
|
12
16
|
this.projectRoot = projectRoot;
|
|
13
|
-
this.filesToBackup = [];
|
|
14
17
|
this.backupDir = path_1.default.join(projectRoot, backupDir);
|
|
15
18
|
this.backupId = `backup_${Date.now()}`;
|
|
16
19
|
}
|
|
@@ -16,6 +16,7 @@ class AuthenticationError extends MarketplaceError {
|
|
|
16
16
|
}
|
|
17
17
|
exports.AuthenticationError = AuthenticationError;
|
|
18
18
|
class LicenseRequiredError extends MarketplaceError {
|
|
19
|
+
requiredTier;
|
|
19
20
|
constructor(requiredTier, message) {
|
|
20
21
|
super(message);
|
|
21
22
|
this.requiredTier = requiredTier;
|
|
@@ -31,6 +32,7 @@ class NotFoundError extends MarketplaceError {
|
|
|
31
32
|
}
|
|
32
33
|
exports.NotFoundError = NotFoundError;
|
|
33
34
|
class RateLimitError extends MarketplaceError {
|
|
35
|
+
retryAfter;
|
|
34
36
|
constructor(retryAfter) {
|
|
35
37
|
super(`Rate limited. Try again in ${retryAfter}s`);
|
|
36
38
|
this.retryAfter = retryAfter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kaven-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Kaven CLI - The official command line tool for Kaven",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"eslint": "^8.0.0",
|
|
56
56
|
"msw": "^2.12.10",
|
|
57
57
|
"semantic-release": "^25.0.3",
|
|
58
|
+
"tsup": "^8.5.1",
|
|
58
59
|
"typescript": "^5.0.0",
|
|
59
60
|
"vitest": "^1.0.0"
|
|
60
61
|
},
|