@delorenj/skillex 0.1.2 → 0.2.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,9 @@
1
+ import type { Command } from "commander";
2
+ import { type ResultEnvelope } from "../index.js";
3
+ interface Output {
4
+ emit(result: ResultEnvelope<unknown>, text?: string): void;
5
+ help(command: Command): void;
6
+ }
7
+ /** Register BMAD freeze/status/explain; activation stays an explicit, separate step. */
8
+ export declare function registerBmadCommands(program: Command, output: Output): void;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { BmadFreezeData, BmadFreezeOptions } from "./bmad-types.js";
2
+ import { type ResultEnvelope } from "./result.js";
3
+ /**
4
+ * Freeze the BMAD skills and per-client commands of a BMAD-enabled project into a
5
+ * versioned reference-only registry pack (ADR-0001). Import is offline, idempotent,
6
+ * and guarded: same-version repeats change nothing, and a differing existing canonical
7
+ * body is refused rather than overwritten.
8
+ */
9
+ export declare function freezeBmadPack(source: string, options?: BmadFreezeOptions): Promise<ResultEnvelope<BmadFreezeData | null>>;
@@ -0,0 +1,40 @@
1
+ import type { BmadCommandInventory, BmadProvenance, BmadSkillManifestEntry } from "./bmad-types.js";
2
+ /** Per-client command layouts discovered on a BMAD-enabled project. Not exhaustive. */
3
+ export declare const BMAD_COMMAND_CLIENTS: ReadonlyArray<{
4
+ client: string;
5
+ layout: string;
6
+ }>;
7
+ export declare const BMAD_PACK_NAME = "bmad";
8
+ export declare function sha256File(path: string): Promise<string>;
9
+ /** Expand `~` exactly like other skillex path options; the result must be a real directory. */
10
+ export declare function resolveBmadSource(source: string, options: {
11
+ cwd?: string;
12
+ }): Promise<string>;
13
+ /** Read the source's own manifests. Entirely offline; nothing is fetched. */
14
+ export declare function inspectBmadSource(sourceRoot: string): Promise<BmadProvenance>;
15
+ /**
16
+ * Membership source of truth: the source's skill-manifest.csv, reconciled against the
17
+ * rendered .agents/skills tree. Rendered bmad-* directories absent from the manifest are
18
+ * inventoried as foreign (installer-owned), never imported silently.
19
+ */
20
+ export declare function readBmadSkillManifest(sourceRoot: string): Promise<{
21
+ entries: BmadSkillManifestEntry[];
22
+ path: string;
23
+ }>;
24
+ export interface BmadCommandScan {
25
+ readonly inventory: BmadCommandInventory;
26
+ readonly totalFiles: number;
27
+ readonly danglingFiles: number;
28
+ }
29
+ export declare function bmadCommandRefs(content: string): string[];
30
+ /**
31
+ * Copy each client's command layout byte-for-byte. Original assets are preserved; files
32
+ * whose `_bmad/...` references are dangling in the source install are imported but
33
+ * reported, never silently rewritten into shims.
34
+ */
35
+ export declare function scanBmadCommands(sourceRoot: string, packVersionPath: string): Promise<BmadCommandScan>;
36
+ /** Absolute, safe version directory; refuses any traversal outside the pack family. */
37
+ export declare function bmadPackPath(registryRoot: string, version: string): string;
38
+ /** The rendered skill bytes are the only complete source: the source's own tree is pruned. */
39
+ export declare function renderedSkillDir(sourceRoot: string, name: string): string;
40
+ export declare function requireRenderedSkill(sourceRoot: string, name: string): Promise<string>;
@@ -0,0 +1,10 @@
1
+ import type { BmadExplainData, BmadExplainOptions, BmadStatusData, BmadStatusOptions } from "./bmad-types.js";
2
+ import { type ResultEnvelope } from "./result.js";
3
+ /**
4
+ * Read-only traceability for the BMAD canonical skills present in a registry. Every
5
+ * frozen BMAD skill is traced against its recorded baseline digest; undeclared pack
6
+ * children are reported as traceability gaps instead of a misleading green verify.
7
+ */
8
+ export declare function inspectBmadStatus(options?: BmadStatusOptions): Promise<ResultEnvelope<BmadStatusData | null>>;
9
+ /** Read-only explanation of one canonical BMAD skill: provenance, baseline, references. */
10
+ export declare function explainBmadSkill(name: string, options?: BmadExplainOptions): Promise<ResultEnvelope<BmadExplainData | null>>;
@@ -0,0 +1,150 @@
1
+ import type { CatalogLockOptions } from "./catalog-lock.js";
2
+ import type { RegistryOptions, RegistrySelection } from "./selection.js";
3
+ /** Freeze operates only on real local directories; registry URLs are never fetched. */
4
+ export interface BmadFreezeOptions extends RegistryOptions, CatalogLockOptions {
5
+ readonly version?: string;
6
+ readonly dryRun?: boolean;
7
+ readonly replace?: boolean;
8
+ readonly commands?: boolean;
9
+ }
10
+ export interface BmadSourceModule {
11
+ readonly name: string;
12
+ readonly version: string;
13
+ readonly source: string | null;
14
+ readonly repoUrl: string | null;
15
+ readonly sha: string | null;
16
+ }
17
+ export interface BmadSourceInstallation {
18
+ readonly version: string;
19
+ readonly installDate: string | null;
20
+ readonly lastUpdated: string | null;
21
+ }
22
+ /** Evidence captured offline from the source install's own manifests. */
23
+ export interface BmadProvenance {
24
+ readonly sourceRoot: string;
25
+ readonly installation: BmadSourceInstallation;
26
+ readonly modules: readonly BmadSourceModule[];
27
+ readonly skillManifestSha256: string | null;
28
+ readonly filesManifestSha256: string | null;
29
+ readonly filesManifestDeclared: number;
30
+ readonly filesManifestMissing: number;
31
+ }
32
+ export type BmadInventoryStatus = "imported" | "unchanged" | "skipped" | "failed";
33
+ export interface BmadSkillInventory {
34
+ readonly name: string;
35
+ readonly sourcePath: string;
36
+ readonly status: BmadInventoryStatus;
37
+ readonly digest: string | null;
38
+ readonly recordedDigest: string | null;
39
+ }
40
+ /** Skills installed by the source but outside the frozen manifest, inventoried separately. */
41
+ export interface BmadForeignSkill {
42
+ readonly name: string;
43
+ readonly path: string;
44
+ }
45
+ export interface BmadSkillManifestEntry {
46
+ readonly canonicalId: string;
47
+ readonly name: string;
48
+ readonly description: string | null;
49
+ readonly module: string | null;
50
+ readonly path: string | null;
51
+ }
52
+ export interface BmadCommandClient {
53
+ readonly client: string;
54
+ readonly layout: string;
55
+ readonly directory: string;
56
+ readonly imported: number;
57
+ readonly dangling: number;
58
+ }
59
+ export interface BmadCommandFile {
60
+ readonly name: string;
61
+ readonly client: string;
62
+ readonly layout: string;
63
+ readonly path: string;
64
+ readonly sourcePath: string;
65
+ readonly sha256: string;
66
+ readonly size: number;
67
+ readonly bmadRefs: readonly string[];
68
+ readonly danglingRefs: readonly string[];
69
+ }
70
+ export interface BmadCommandInventory {
71
+ readonly clients: readonly BmadCommandClient[];
72
+ readonly files: readonly BmadCommandFile[];
73
+ }
74
+ export interface BmadFreezeChange {
75
+ readonly action: string;
76
+ readonly path: string;
77
+ readonly source?: string;
78
+ }
79
+ export interface BmadFreezeData {
80
+ readonly registry: RegistrySelection;
81
+ readonly pack: {
82
+ readonly name: string;
83
+ readonly version: string;
84
+ readonly path: string;
85
+ };
86
+ readonly provenance: BmadProvenance;
87
+ readonly sourceRoot: string;
88
+ readonly dryRun: boolean;
89
+ readonly skills: readonly BmadSkillInventory[];
90
+ readonly foreignSkills: readonly BmadForeignSkill[];
91
+ readonly skillsDeclared: number;
92
+ readonly skillsImported: number;
93
+ readonly skillsUnchanged: number;
94
+ readonly skillsSkipped: number;
95
+ readonly skillsFailed: number;
96
+ readonly commands: BmadCommandInventory;
97
+ readonly commandFiles: number;
98
+ readonly danglingCommands: number;
99
+ readonly changes: readonly BmadFreezeChange[];
100
+ }
101
+ export interface BmadStatusOptions extends RegistryOptions {
102
+ readonly signal?: {
103
+ readonly aborted: boolean;
104
+ };
105
+ }
106
+ export type BmadCanonicalState = "ok" | "missing" | "foreign" | "modified";
107
+ export interface BmadCanonicalStatus {
108
+ readonly name: string;
109
+ readonly path: string;
110
+ readonly state: BmadCanonicalState;
111
+ readonly digest: string | null;
112
+ readonly recordedDigest: string | null;
113
+ readonly references: readonly string[];
114
+ readonly provenance: Readonly<Record<string, unknown>> | null;
115
+ }
116
+ export interface BmadStatusData {
117
+ readonly registry: RegistrySelection;
118
+ readonly skills: readonly BmadCanonicalStatus[];
119
+ readonly traced: number;
120
+ readonly drifted: readonly string[];
121
+ readonly untraced: readonly string[];
122
+ readonly pack: string | null;
123
+ readonly packMembers: readonly string[];
124
+ readonly packVerified: boolean | null;
125
+ readonly findings: readonly import("./result.js").Diagnostic[];
126
+ }
127
+ export interface BmadExplainOptions extends RegistryOptions {
128
+ readonly signal?: {
129
+ readonly aborted: boolean;
130
+ };
131
+ }
132
+ export interface BmadReference {
133
+ readonly kind: "pack" | "set" | "skill";
134
+ readonly name: string;
135
+ readonly version?: string;
136
+ }
137
+ export interface BmadSkillExplanation {
138
+ readonly name: string;
139
+ readonly canonicalPath: string | null;
140
+ readonly digest: string | null;
141
+ readonly recordedDigest: string | null;
142
+ readonly modifiedLocally: boolean | null;
143
+ readonly bmadVersion: string | null;
144
+ readonly references: readonly BmadReference[];
145
+ readonly findings: readonly import("./result.js").Diagnostic[];
146
+ }
147
+ export interface BmadExplainData {
148
+ readonly registry: RegistrySelection;
149
+ readonly skill: BmadSkillExplanation;
150
+ }
@@ -0,0 +1,4 @@
1
+ import type { ProfileLocalEntry, ProfileLocation, ProfileOptions } from "./profile-types.js";
2
+ export declare function strictProfile(profile: ProfileLocation, options: ProfileOptions): Promise<boolean>;
3
+ export declare function assertStrictProfile(profile: ProfileLocation, options: ProfileOptions, local: readonly ProfileLocalEntry[]): Promise<boolean>;
4
+ export declare function publishStrictPolicy(profile: ProfileLocation): Promise<void>;
@@ -4,6 +4,7 @@ import type { RegistryOptions, SkillOrigin } from "./selection.js";
4
4
  export interface ProfileOptions extends RegistryOptions, LockOptions {
5
5
  readonly hermesRoot?: string;
6
6
  readonly project?: string;
7
+ readonly skillexOnly?: boolean;
7
8
  readonly signal?: {
8
9
  readonly aborted: boolean;
9
10
  };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  export { type ReceiptDocument, type ReceiptOptions, type ReceiptSnapshot, readActivationReceipt, validateActivationStateLocation, writeActivationReceipt, } from "./core/activation-state.js";
2
2
  export { aliasPaths, GLOBAL_CLI_ALIASES, NEVER_TOUCH, PROJECT_CLI_ALIASES, } from "./core/aliases.js";
3
+ export { freezeBmadPack } from "./core/bmad-freeze.js";
4
+ export { explainBmadSkill, inspectBmadStatus } from "./core/bmad-status.js";
5
+ export type { BmadCanonicalStatus, BmadCommandClient, BmadCommandFile, BmadCommandInventory, BmadExplainData, BmadExplainOptions, BmadForeignSkill, BmadFreezeChange, BmadFreezeData, BmadFreezeOptions, BmadProvenance, BmadReference, BmadSkillExplanation, BmadSkillInventory, BmadSkillManifestEntry, BmadSourceInstallation, BmadSourceModule, BmadStatusData, BmadStatusOptions, } from "./core/bmad-types.js";
3
6
  export { listSkills, showSkill } from "./core/catalog.js";
4
7
  export type { ListSkillsOptions, SkillDetails, SkillListData, SkillMetadata, SkillReference, SkillShowData, } from "./core/catalog-types.js";
5
8
  export { type CatalogChange, type CatalogWriteOptions, type CatalogWriteResult, type CreateSkillOptions, createSkill, importSkill, } from "./core/catalog-write.js";