@kb-labs/cli-commands 2.88.0 → 2.93.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/{discover-Cz7X5bQp.d.ts → discover-D_Is1Qqq.d.ts} +13 -10
- package/dist/index.d.ts +2 -2
- package/dist/index.js +136 -116
- package/dist/index.js.map +1 -1
- package/dist/registry/index.d.ts +5 -6
- package/dist/registry/index.js +85 -68
- package/dist/registry/index.js.map +1 -1
- package/package.json +22 -22
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ManifestV3 } from '@kb-labs/plugin-contracts';
|
|
1
|
+
import { ManifestV3, PluginContextV3 } from '@kb-labs/plugin-contracts';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @kb-labs/cli-commands/registry
|
|
@@ -27,12 +27,15 @@ interface CommandManifest {
|
|
|
27
27
|
permissions?: string[];
|
|
28
28
|
telemetry?: 'opt-in' | 'off';
|
|
29
29
|
manifestV2?: ManifestV3;
|
|
30
|
+
pkgRoot?: string;
|
|
31
|
+
/** Internal flag: true for synthetic "unavailable" manifests that must not be cached. */
|
|
32
|
+
_synthetic?: boolean;
|
|
30
33
|
}
|
|
31
34
|
interface FlagDefinition {
|
|
32
35
|
name: string;
|
|
33
36
|
type: "string" | "boolean" | "number" | "array";
|
|
34
37
|
alias?: string;
|
|
35
|
-
default?:
|
|
38
|
+
default?: unknown;
|
|
36
39
|
description?: string;
|
|
37
40
|
describe?: string;
|
|
38
41
|
choices?: string[];
|
|
@@ -50,9 +53,11 @@ interface RegisteredCommand {
|
|
|
50
53
|
shadowed: boolean;
|
|
51
54
|
pkgRoot?: string;
|
|
52
55
|
packageName?: string;
|
|
56
|
+
/** Lifecycle dispose hook, set by manifest module if it exports `dispose`. */
|
|
57
|
+
_disposeHook?: () => Promise<void>;
|
|
53
58
|
}
|
|
54
59
|
interface CommandModule {
|
|
55
|
-
run: (ctx:
|
|
60
|
+
run: (ctx: unknown, argv: string[], flags: Record<string, unknown>) => Promise<number | void>;
|
|
56
61
|
}
|
|
57
62
|
interface DiscoveryResult {
|
|
58
63
|
source: 'workspace' | 'node_modules' | 'linked' | 'builtin';
|
|
@@ -121,7 +126,7 @@ type AvailabilityCheck = {
|
|
|
121
126
|
*/
|
|
122
127
|
|
|
123
128
|
interface CommandRun {
|
|
124
|
-
(ctx:
|
|
129
|
+
(ctx: PluginContextV3, argv: string[], flags: Record<string, unknown>): Promise<number | void>;
|
|
125
130
|
}
|
|
126
131
|
interface Command {
|
|
127
132
|
name: string;
|
|
@@ -142,10 +147,10 @@ interface CommandGroup {
|
|
|
142
147
|
interface CommandRegistry {
|
|
143
148
|
register(cmd: Command): void;
|
|
144
149
|
registerGroup(group: CommandGroup): void;
|
|
145
|
-
registerManifest(cmd:
|
|
150
|
+
registerManifest(cmd: RegisteredCommand): void;
|
|
146
151
|
list(): Command[];
|
|
147
152
|
listGroups(): CommandGroup[];
|
|
148
|
-
listManifests():
|
|
153
|
+
listManifests(): RegisteredCommand[];
|
|
149
154
|
markPartial(isPartial: boolean): void;
|
|
150
155
|
isPartial(): boolean;
|
|
151
156
|
}
|
|
@@ -243,9 +248,7 @@ declare function findCommandWithType(nameOrPath: string | string[]): CommandLook
|
|
|
243
248
|
* Create loader stub for ManifestV3 commands.
|
|
244
249
|
* Loader should never be executed directly – CLI adapters must handle execution.
|
|
245
250
|
*/
|
|
246
|
-
declare function createManifestV3Loader(commandId: string): () => Promise<
|
|
247
|
-
run: any;
|
|
248
|
-
}>;
|
|
251
|
+
declare function createManifestV3Loader(commandId: string): () => Promise<CommandModule>;
|
|
249
252
|
/**
|
|
250
253
|
* Ensure manifest has loader function (rehydrate after JSON serialization).
|
|
251
254
|
*/
|
|
@@ -284,4 +287,4 @@ declare function discoverManifests(cwd: string, noCache?: boolean, options?: {
|
|
|
284
287
|
*/
|
|
285
288
|
declare function discoverManifestsByNamespace(cwd: string, namespace: string, noCache?: boolean): Promise<DiscoveryResult[]>;
|
|
286
289
|
|
|
287
|
-
export { type AvailabilityCheck as A, type CommandGroup as C, type DiscoveryResult as D, type FlagDefinition as F, type GlobalFlags as G, type ProductGroup as P, type RegisteredCommand as R, __test as _, type Command as a, type CacheFile as b, type CommandLookupResult as c, type CommandManifest as d, type CommandModule as e, type CommandType as f, type PackageCacheEntry as g, discoverManifests as h, discoverManifestsByNamespace as i, findCommand as j, findCommandWithType as k,
|
|
290
|
+
export { type AvailabilityCheck as A, type CommandGroup as C, type DiscoveryResult as D, type FlagDefinition as F, type GlobalFlags as G, type ProductGroup as P, type RegisteredCommand as R, __test as _, type Command as a, type CacheFile as b, type CommandLookupResult as c, type CommandManifest as d, type CommandModule as e, type CommandType as f, type PackageCacheEntry as g, discoverManifests as h, discoverManifestsByNamespace as i, findCommand as j, findCommandWithType as k, type CommandRegistry as l, resetInProcCache as m, registry as r };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CommandGroup, P as ProductGroup, a as Command, R as RegisteredCommand } from './discover-
|
|
2
|
-
export { A as AvailabilityCheck, b as CacheFile, c as CommandLookupResult, d as CommandManifest, e as CommandModule, f as CommandType, D as DiscoveryResult, F as FlagDefinition, G as GlobalFlags, g as PackageCacheEntry, h as discoverManifests, i as discoverManifestsByNamespace, j as findCommand, k as findCommandWithType, r as registry } from './discover-
|
|
1
|
+
import { C as CommandGroup, P as ProductGroup, a as Command, R as RegisteredCommand } from './discover-D_Is1Qqq.js';
|
|
2
|
+
export { A as AvailabilityCheck, b as CacheFile, c as CommandLookupResult, d as CommandManifest, e as CommandModule, f as CommandType, D as DiscoveryResult, F as FlagDefinition, G as GlobalFlags, g as PackageCacheEntry, h as discoverManifests, i as discoverManifestsByNamespace, j as findCommand, k as findCommandWithType, r as registry } from './discover-D_Is1Qqq.js';
|
|
3
3
|
import { ILogger } from '@kb-labs/core-platform';
|
|
4
4
|
export { TimingTracker } from '@kb-labs/shared-cli-ui';
|
|
5
5
|
import * as _kb_labs_shared_command_kit from '@kb-labs/shared-command-kit';
|