@kb-labs/cli-commands 2.3.0 → 2.5.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.
@@ -0,0 +1,67 @@
1
+ import { h as CommandManifest, A as AvailabilityCheck, R as RegisteredCommand, D as DiscoveryResult } from '../discover-8_R7njIS.js';
2
+ export { k as CacheFile, d as CommandLookupResult, i as CommandModule, c as CommandType, F as FlagDefinition, G as GlobalFlags, j as PackageCacheEntry, P as ProductGroup, _ as __test, g as discoverManifests, e as discoverManifestsByNamespace, f as findCommand, b as findCommandWithType, r as registry } from '../discover-8_R7njIS.js';
3
+ import { ILogger } from '@kb-labs/core-platform';
4
+ import '@kb-labs/plugin-contracts';
5
+
6
+ /**
7
+ * @kb-labs/cli-commands/registry
8
+ * Dependency availability checking with ESM support
9
+ *
10
+ * IMPORTANT: Only resolve, never import() - imports happen in loader()
11
+ */
12
+
13
+ /**
14
+ * Check if all required dependencies for a command are available
15
+ * @param manifest Command manifest with requires field
16
+ * @param cwd Working directory to resolve from (defaults to process.cwd())
17
+ * @returns Availability status with reason and hint if unavailable
18
+ */
19
+ interface CheckRequiresOptions {
20
+ cwd?: string;
21
+ }
22
+ declare function checkRequires(manifest: CommandManifest, options?: CheckRequiresOptions): AvailabilityCheck;
23
+
24
+ /**
25
+ * @kb-labs/cli-commands/registry
26
+ * Manifest validation and registration with shadowing support
27
+ */
28
+
29
+ interface RegisterManifestsOptions {
30
+ cwd?: string;
31
+ }
32
+ interface SkippedManifest {
33
+ id: string;
34
+ source: string;
35
+ reason: string;
36
+ }
37
+ interface ManifestRegistrationResult {
38
+ registered: RegisteredCommand[];
39
+ skipped: SkippedManifest[];
40
+ collisions: number;
41
+ errors: number;
42
+ }
43
+ declare function preflightManifests(discoveryResults: DiscoveryResult[], logger?: ILogger): {
44
+ valid: DiscoveryResult[];
45
+ skipped: SkippedManifest[];
46
+ };
47
+ /**
48
+ * Register manifests with shadowing and collision detection
49
+ */
50
+ declare function registerManifests(discoveryResults: DiscoveryResult[], registry: any, // CommandRegistry interface
51
+ options?: RegisterManifestsOptions & {
52
+ logger?: ILogger;
53
+ }): Promise<ManifestRegistrationResult>;
54
+ /**
55
+ * Dispose all plugins by calling their dispose hooks
56
+ */
57
+ declare function disposeAllPlugins(registry: any, logger?: ILogger): Promise<void>;
58
+
59
+ /**
60
+ * Execute a registered command.
61
+ *
62
+ * - Unavailable commands return exit code 2.
63
+ * - Available commands are executed via manifest.loader().
64
+ */
65
+ declare function runCommand(cmd: RegisteredCommand, ctx: any, argv: string[], flags: Record<string, any>): Promise<number>;
66
+
67
+ export { AvailabilityCheck, type CheckRequiresOptions, CommandManifest, DiscoveryResult, type ManifestRegistrationResult, type RegisterManifestsOptions, RegisteredCommand, type SkippedManifest, checkRequires, disposeAllPlugins, preflightManifests, registerManifests, runCommand };