@delorenj/skillex 0.1.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 (71) hide show
  1. package/README.md +91 -0
  2. package/dist/cli.d.ts +2 -0
  3. package/dist/cli.js +15851 -0
  4. package/dist/commands/compositions.d.ts +9 -0
  5. package/dist/commands/diagnostics.d.ts +7 -0
  6. package/dist/commands/migrate.d.ts +7 -0
  7. package/dist/commands/profiles.d.ts +8 -0
  8. package/dist/commands/selections.d.ts +7 -0
  9. package/dist/commands/sync.d.ts +7 -0
  10. package/dist/commands/vendor.d.ts +8 -0
  11. package/dist/core/activation-ownership.d.ts +18 -0
  12. package/dist/core/activation-state.d.ts +37 -0
  13. package/dist/core/activation-types.d.ts +32 -0
  14. package/dist/core/aliases.d.ts +7 -0
  15. package/dist/core/catalog-lock.d.ts +15 -0
  16. package/dist/core/catalog-types.d.ts +28 -0
  17. package/dist/core/catalog-write.d.ts +25 -0
  18. package/dist/core/catalog.d.ts +7 -0
  19. package/dist/core/composition-mutation.d.ts +38 -0
  20. package/dist/core/composition-types.d.ts +45 -0
  21. package/dist/core/composition.d.ts +12 -0
  22. package/dist/core/content.d.ts +25 -0
  23. package/dist/core/diagnostics-types.d.ts +76 -0
  24. package/dist/core/diagnostics.d.ts +6 -0
  25. package/dist/core/discovery.d.ts +5 -0
  26. package/dist/core/doctor-sources.d.ts +10 -0
  27. package/dist/core/doctor-types.d.ts +37 -0
  28. package/dist/core/doctor-writers.d.ts +11 -0
  29. package/dist/core/doctor.d.ts +4 -0
  30. package/dist/core/error.d.ts +8 -0
  31. package/dist/core/filesystem.d.ts +5 -0
  32. package/dist/core/lock.d.ts +18 -0
  33. package/dist/core/manifest.d.ts +7 -0
  34. package/dist/core/metadata.d.ts +6 -0
  35. package/dist/core/migration-activation-state.d.ts +52 -0
  36. package/dist/core/migration-activation.d.ts +6 -0
  37. package/dist/core/migration-common.d.ts +8 -0
  38. package/dist/core/migration-manifest.d.ts +4 -0
  39. package/dist/core/migration-registry-state.d.ts +72 -0
  40. package/dist/core/migration-registry.d.ts +7 -0
  41. package/dist/core/migration-sources.d.ts +4 -0
  42. package/dist/core/migration-types.d.ts +56 -0
  43. package/dist/core/migration.d.ts +4 -0
  44. package/dist/core/packs.d.ts +8 -0
  45. package/dist/core/profile-discovery.d.ts +15 -0
  46. package/dist/core/profile-state.d.ts +27 -0
  47. package/dist/core/profile-sync.d.ts +40 -0
  48. package/dist/core/profile-types.d.ts +88 -0
  49. package/dist/core/profiles.d.ts +6 -0
  50. package/dist/core/reconciliation-types.d.ts +36 -0
  51. package/dist/core/reconciliation.d.ts +47 -0
  52. package/dist/core/resolution.d.ts +6 -0
  53. package/dist/core/result.d.ts +37 -0
  54. package/dist/core/selection-command-types.d.ts +23 -0
  55. package/dist/core/selection-commands.d.ts +6 -0
  56. package/dist/core/selection-manifest.d.ts +18 -0
  57. package/dist/core/selection.d.ts +98 -0
  58. package/dist/core/sets.d.ts +7 -0
  59. package/dist/core/vendor-git.d.ts +26 -0
  60. package/dist/core/vendor-inspect.d.ts +5 -0
  61. package/dist/core/vendor-provenance.d.ts +9 -0
  62. package/dist/core/vendor-sources.d.ts +14 -0
  63. package/dist/core/vendor-state.d.ts +54 -0
  64. package/dist/core/vendor-sync.d.ts +4 -0
  65. package/dist/core/vendor-types.d.ts +132 -0
  66. package/dist/index.d.ts +32 -0
  67. package/dist/index.js +15028 -0
  68. package/dist/version.d.ts +1 -0
  69. package/package.json +62 -0
  70. package/schemas/result.schema.json +47 -0
  71. package/skills.schema.json +144 -0
@@ -0,0 +1,7 @@
1
+ import type { CompositionMutationData, CompositionOptions, SetListData, SetShowData } from "./composition-types.js";
2
+ import { type ResultEnvelope } from "./result.js";
3
+ export declare function listSets(options?: CompositionOptions): Promise<ResultEnvelope<SetListData | null>>;
4
+ export declare function showSet(name: string, options?: CompositionOptions): Promise<ResultEnvelope<SetShowData | null>>;
5
+ export declare function createSet(name: string, options?: CompositionOptions): Promise<ResultEnvelope<CompositionMutationData | null>>;
6
+ export declare function addSetSkills(name: string, names: readonly string[], options?: CompositionOptions): Promise<ResultEnvelope<CompositionMutationData | null>>;
7
+ export declare function removeSetSkills(name: string, names: readonly string[], options?: CompositionOptions): Promise<ResultEnvelope<CompositionMutationData | null>>;
@@ -0,0 +1,26 @@
1
+ import { type ContentEntry } from "./content.js";
2
+ import type { VendorOptions, VendorSource } from "./vendor-types.js";
3
+ export interface VendorPin {
4
+ readonly commit: string;
5
+ readonly refKind: "branch" | "tag" | "commit" | "unknown";
6
+ readonly committedAt: string;
7
+ readonly origin?: string;
8
+ }
9
+ export interface VendorGitSkill {
10
+ readonly name: string;
11
+ readonly upstreamPath: string;
12
+ readonly tree: string;
13
+ readonly digest: string;
14
+ readonly entries: readonly ContentEntry[];
15
+ readonly previousProvenance?: Readonly<Record<string, unknown>>;
16
+ }
17
+ export interface VendorGitSource extends VendorPin {
18
+ readonly source: VendorSource;
19
+ readonly checkout: string;
20
+ readonly skills: readonly VendorGitSkill[];
21
+ }
22
+ export declare function vendorInterrupted(options: Pick<VendorOptions, "signal">): void;
23
+ /** Resolve a local commit without checking out files, fetching, or consulting replacement objects. */
24
+ export declare function resolveVendorPin(source: VendorSource, checkoutRoot: string, options?: VendorOptions): Promise<VendorPin>;
25
+ /** Read skill bytes by immutable blob OID; dirty checkout bytes and index state are irrelevant. */
26
+ export declare function readVendorGitSource(source: VendorSource, checkoutRoot: string, options?: VendorOptions): Promise<VendorGitSource>;
@@ -0,0 +1,5 @@
1
+ import { type ResultEnvelope } from "./result.js";
2
+ import type { VendorOptions, VendorSourceListResult, VendorSourceShowResult, VendorStatusResult } from "./vendor-types.js";
3
+ export declare function listVendorSources(options?: VendorOptions): Promise<ResultEnvelope<VendorSourceListResult | null>>;
4
+ export declare function showVendorSource(name: string, options?: VendorOptions): Promise<ResultEnvelope<VendorSourceShowResult | null>>;
5
+ export declare function inspectVendorStatus(options?: VendorOptions): Promise<ResultEnvelope<VendorStatusResult | null>>;
@@ -0,0 +1,9 @@
1
+ import type { VendorProvenance, VendorProvenanceInput } from "./vendor-types.js";
2
+ /** Parse known fields without treating absence, a local flag, or unknown metadata as ownership. */
3
+ export declare function parseVendorProvenance(raw: Readonly<Record<string, unknown>>, path: string): VendorProvenance;
4
+ export declare function readVendorProvenance(skillPath: string): Promise<VendorProvenance | null>;
5
+ export declare function serializeVendorProvenance(input: VendorProvenanceInput): string;
6
+ /** Python tree wire format: all authored files, root .source.yaml excluded, executable mode included. */
7
+ export declare function digestVendorTree(skillPath: string): Promise<string>;
8
+ /** Preserve C03 imported-link and C07 doctor digest semantics while sharing regular vendored checks. */
9
+ export declare function digestRecordedSkill(skillPath: string, provenance: Pick<VendorProvenance, "type" | "digestFormat">): Promise<string>;
@@ -0,0 +1,14 @@
1
+ import { type Diagnostic } from "./result.js";
2
+ import type { VendorCheckout, VendorOptions, VendorSource, VendorSourcesManifest } from "./vendor-types.js";
3
+ export declare function checkVendorSignal(options: Pick<VendorOptions, "signal">): void;
4
+ /** Load the owning catalog's declaration only; prepared migration files are never fallback input. */
5
+ export declare function readVendorSources(options?: VendorOptions): Promise<VendorSourcesManifest>;
6
+ /** Internal parser shared with explicit migration of a prepared declaration. */
7
+ export declare function parseVendorSourcesText(text: string, path: string): readonly VendorSource[];
8
+ export declare function selectVendorSources(manifest: VendorSourcesManifest, selected?: readonly string[]): readonly VendorSource[];
9
+ export declare function vendorCheckoutEnvironmentKey(id: string): string;
10
+ export declare function normalizeVendorRepo(repo: string): string;
11
+ /** Directory discovery is separate from Git observation, so list/show remain useful before checkout. */
12
+ export declare function resolveVendorCheckout(source: VendorSource, options?: VendorOptions): Promise<VendorCheckout>;
13
+ /** Stable, bounded text observation; declaration/receipt entries must be real files. */
14
+ export declare function readVendorText(path: string, code: Diagnostic["code"], allowLink?: boolean): Promise<string | null>;
@@ -0,0 +1,54 @@
1
+ import { type BigIntStats } from "node:fs";
2
+ import type { LockOptions } from "./lock.js";
3
+ import type { RegistrySelection } from "./selection.js";
4
+ import type { VendorChange } from "./vendor-types.js";
5
+ export interface VendorIdentity {
6
+ readonly dev: string;
7
+ readonly ino: string;
8
+ readonly uid: string;
9
+ readonly mode: number;
10
+ readonly kind: "file" | "directory";
11
+ }
12
+ export interface VendorTreeEvidence {
13
+ readonly root: VendorIdentity;
14
+ readonly entries: readonly {
15
+ readonly path: string;
16
+ readonly identity: VendorIdentity;
17
+ readonly hash: string | null;
18
+ }[];
19
+ }
20
+ export interface VendorOperation {
21
+ readonly change: VendorChange;
22
+ readonly stage: string | null;
23
+ readonly parked: string | null;
24
+ readonly before: VendorTreeEvidence | null;
25
+ readonly after: VendorTreeEvidence | null;
26
+ }
27
+ export interface VendorJournal {
28
+ readonly schema: 1;
29
+ readonly catalog: string;
30
+ readonly host: string;
31
+ readonly uid: string;
32
+ readonly phase: "preparing" | "ready";
33
+ readonly operations: readonly VendorOperation[];
34
+ }
35
+ export interface VendorJournalSnapshot {
36
+ readonly path: string;
37
+ readonly catalog: string;
38
+ readonly document: VendorJournal | null;
39
+ }
40
+ export declare function vendorLstat(path: string): Promise<BigIntStats | null>;
41
+ export declare function vendorIdentity(info: BigIntStats): VendorIdentity;
42
+ export declare function assertVendorIdentity(path: string, expected: VendorIdentity): Promise<void>;
43
+ /** Exact evidence includes every authored file, including the provenance receipt. */
44
+ export declare function captureVendorTree(root: string): Promise<VendorTreeEvidence>;
45
+ /** Missing entries are allowed only while cleaning exact parked/prepared recovery trees. */
46
+ export declare function assertVendorTree(root: string, expected: VendorTreeEvidence, allowMissing?: boolean): Promise<void>;
47
+ export declare function removeVendorTree(root: string, expected: VendorTreeEvidence): Promise<void>;
48
+ export declare function readVendorJournal(registry: RegistrySelection, options?: LockOptions): Promise<VendorJournalSnapshot>;
49
+ /** Caller holds the shared catalog lock. Journal publication is atomic and compare-before-write. */
50
+ export declare function writeVendorJournal(previous: VendorJournalSnapshot, document: VendorJournal): Promise<VendorJournalSnapshot>;
51
+ export declare function clearVendorJournal(previous: VendorJournalSnapshot): Promise<void>;
52
+ export declare function newVendorJournal(catalog: string, operations: readonly VendorOperation[], phase?: VendorJournal["phase"]): VendorJournal;
53
+ /** Read-only guard shared by create/import; sync alone can recover under the catalog lock. */
54
+ export declare function assertNoVendorJournal(registry: RegistrySelection, options?: LockOptions): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { type ResultEnvelope } from "./result.js";
2
+ import type { VendorSyncOptions, VendorSyncResult } from "./vendor-types.js";
3
+ /** Offline canonical-content writer; composition and activation links are owned by their existing APIs. */
4
+ export declare function syncVendorSources(options?: VendorSyncOptions): Promise<ResultEnvelope<VendorSyncResult | null>>;
@@ -0,0 +1,132 @@
1
+ import type { LockOptions } from "./lock.js";
2
+ import type { RegistryOptions, RegistrySelection } from "./selection.js";
3
+ export interface VendorOptions extends RegistryOptions {
4
+ readonly sources?: readonly string[];
5
+ readonly checkouts?: Readonly<Record<string, string>>;
6
+ readonly signal?: {
7
+ readonly aborted: boolean;
8
+ };
9
+ readonly upstream?: boolean;
10
+ readonly stateHome?: string;
11
+ }
12
+ export interface VendorSyncOptions extends VendorOptions, LockOptions {
13
+ readonly dryRun?: boolean;
14
+ readonly adopt?: boolean;
15
+ readonly discardLocalEdits?: boolean;
16
+ readonly prune?: boolean;
17
+ }
18
+ export interface VendorSourceSkill {
19
+ readonly name: string;
20
+ readonly dir: string;
21
+ }
22
+ export interface VendorSource {
23
+ readonly name: string;
24
+ readonly repo: string;
25
+ readonly version: string;
26
+ readonly checkout: string;
27
+ readonly subdir: string;
28
+ readonly membership: "explicit" | "discovery";
29
+ readonly skills: readonly VendorSourceSkill[];
30
+ readonly include: readonly string[];
31
+ readonly exclude: readonly string[];
32
+ readonly optional: boolean;
33
+ }
34
+ export interface VendorSourcesManifest {
35
+ readonly path: string;
36
+ readonly registry: RegistrySelection;
37
+ readonly version: 1;
38
+ readonly sources: readonly VendorSource[];
39
+ }
40
+ export interface VendorCheckout {
41
+ readonly id: string;
42
+ readonly root: string | null;
43
+ readonly source: "argument" | "environment" | "mapping" | "default";
44
+ readonly searched: readonly string[];
45
+ }
46
+ export interface VendorProvenance {
47
+ readonly path: string;
48
+ readonly type: string;
49
+ readonly source: string | null;
50
+ readonly upstream: string | null;
51
+ readonly upstreamVersion: string | null;
52
+ readonly upstreamCommit: string | null;
53
+ readonly upstreamTree: string | null;
54
+ readonly upstreamPath: string | null;
55
+ readonly extractedAt: string | null;
56
+ readonly digest: string | null;
57
+ readonly digestFormat: string | null;
58
+ readonly modifiedLocally: boolean;
59
+ readonly raw: Readonly<Record<string, unknown>>;
60
+ }
61
+ export interface VendorProvenanceInput {
62
+ readonly source: VendorSource;
63
+ readonly commit: string;
64
+ readonly tree: string;
65
+ readonly upstreamPath: string;
66
+ readonly digest: string;
67
+ readonly extractedAt: string;
68
+ readonly previousProvenance?: Readonly<Record<string, unknown>>;
69
+ }
70
+ export interface VendorSkillStatus {
71
+ readonly name: string;
72
+ readonly path: string;
73
+ readonly source: string;
74
+ readonly state: "ok" | "missing" | "unrecorded" | "invalid" | "modified" | "stale" | "unknown" | "recorded" | "orphaned" | "foreign";
75
+ readonly recordedCommit: string | null;
76
+ readonly upstreamCommit: string | null;
77
+ readonly recordedDigest: string | null;
78
+ readonly digest: string | null;
79
+ }
80
+ export interface VendorSourceListResult {
81
+ readonly registry: RegistrySelection;
82
+ readonly manifest: string;
83
+ readonly sources: readonly {
84
+ readonly source: VendorSource;
85
+ readonly checkout: VendorCheckout;
86
+ }[];
87
+ }
88
+ export interface VendorSourceShowResult {
89
+ readonly registry: RegistrySelection;
90
+ readonly manifest: string;
91
+ readonly source: VendorSource;
92
+ readonly checkout: VendorCheckout;
93
+ readonly membership: "explicit" | "recorded";
94
+ readonly skills: readonly VendorSkillStatus[];
95
+ }
96
+ export interface VendorStatusResult {
97
+ readonly registry: RegistrySelection;
98
+ readonly manifest: string;
99
+ readonly upstream: boolean;
100
+ readonly sources: readonly {
101
+ readonly name: string;
102
+ readonly membership: "explicit" | "recorded";
103
+ readonly checkout: VendorCheckout | null;
104
+ readonly upstreamCommit: string | null;
105
+ }[];
106
+ readonly skills: readonly VendorSkillStatus[];
107
+ }
108
+ export interface VendorSourceResolution {
109
+ readonly name: string;
110
+ readonly checkout: string | null;
111
+ readonly commit: string | null;
112
+ readonly refKind: "branch" | "tag" | "commit" | "unknown" | null;
113
+ readonly skipped: boolean;
114
+ }
115
+ export interface VendorChange {
116
+ readonly action: "create" | "update" | "adopt" | "prune" | "unchanged";
117
+ readonly name: string;
118
+ readonly source: string;
119
+ readonly path: string;
120
+ readonly commit?: string;
121
+ readonly tree?: string;
122
+ readonly upstreamPath?: string;
123
+ readonly digest?: string;
124
+ }
125
+ export interface VendorSyncResult {
126
+ readonly registry: RegistrySelection;
127
+ readonly manifest: string;
128
+ readonly dryRun: boolean;
129
+ readonly sources: readonly VendorSourceResolution[];
130
+ readonly changes: readonly VendorChange[];
131
+ readonly applied: readonly VendorChange[];
132
+ }
@@ -0,0 +1,32 @@
1
+ export { type ReceiptDocument, type ReceiptOptions, type ReceiptSnapshot, readActivationReceipt, validateActivationStateLocation, writeActivationReceipt, } from "./core/activation-state.js";
2
+ export { aliasPaths, GLOBAL_CLI_ALIASES, NEVER_TOUCH, PROJECT_CLI_ALIASES, } from "./core/aliases.js";
3
+ export { listSkills, showSkill } from "./core/catalog.js";
4
+ export type { ListSkillsOptions, SkillDetails, SkillListData, SkillMetadata, SkillReference, SkillShowData, } from "./core/catalog-types.js";
5
+ export { type CatalogChange, type CatalogWriteOptions, type CatalogWriteResult, type CreateSkillOptions, createSkill, importSkill, } from "./core/catalog-write.js";
6
+ export type { CompositionChange, CompositionDetails, CompositionMutationData, CompositionOptions, PackListData, PackShowData, SetListData, SetShowData, } from "./core/composition-types.js";
7
+ export { explainSkill, inspectStatus } from "./core/diagnostics.js";
8
+ export type { AliasObservation, DiagnosticOptions, ExplainResult, PathObservation, ReceiptObservation, SkillExplanation, SkillObservation, StatusResult, StatusScope, } from "./core/diagnostics-types.js";
9
+ export { discoverRegistry, discoverScopes } from "./core/discovery.js";
10
+ export { doctor } from "./core/doctor.js";
11
+ export type { ConfiguredLegacyWriter, DoctorOptions, DoctorResult, DoctorSourceInspection, DoctorWriterInspection, RunningLegacyWriter, } from "./core/doctor-types.js";
12
+ export { SkillexError } from "./core/error.js";
13
+ export { type LockOptions, withLock } from "./core/lock.js";
14
+ export { isSkillName, isVersionComponent, parseManifest, readManifest } from "./core/manifest.js";
15
+ export { migrate } from "./core/migration.js";
16
+ export type { MigrationItem, MigrationMapping, MigrationOptions, MigrationResult, } from "./core/migration-types.js";
17
+ export { addPackSkills, createPack, listPacks, removePackSkills, showPack, verifyPack, } from "./core/packs.js";
18
+ export type { HermesRootSelection, ProfileCandidate, ProfileChange, ProfileListResult, ProfileLocalEntry, ProfileLocation, ProfileOptions, ProfileShowResult, ProfileSummary, ProfileSyncOptions, ProfileSyncResult, } from "./core/profile-types.js";
19
+ export { listProfiles, showProfile, syncProfile } from "./core/profiles.js";
20
+ export { planSync, sync } from "./core/reconciliation.js";
21
+ export type { SyncChange, SyncOptions, SyncPlan, SyncResult, SyncScopePlan, } from "./core/reconciliation-types.js";
22
+ export { resolveSelection } from "./core/resolution.js";
23
+ export { type Diagnostic, ExitCode, JSON_SCHEMA_VERSION, makeResult, type ResultEnvelope, type ResultOptions, } from "./core/result.js";
24
+ export type { DiscoveryOptions, ExcludedBinding, PackSelection, RegistryOptions, RegistrySelection, Resolution, ResolvedBinding, ResolvedPack, ResolvedScope, ResolveOptions, ScopeDiscovery, ScopeLocation, ScopeName, SetSelection, SkillOrigin, SkillSelection, SkillsManifest, WriteScope, } from "./core/selection.js";
25
+ export type { SelectionChange, SelectionKind, SelectionOptions, SelectionResult, } from "./core/selection-command-types.js";
26
+ export { disableSelection, enableSelection, initScope, setInheritance, } from "./core/selection-commands.js";
27
+ export { readSelectionManifest, type SelectionManifestSnapshot, SelectionManifestWriteError, writeSelectionManifest, } from "./core/selection-manifest.js";
28
+ export { addSetSkills, createSet, listSets, removeSetSkills, showSet } from "./core/sets.js";
29
+ export { inspectVendorStatus, listVendorSources, showVendorSource } from "./core/vendor-inspect.js";
30
+ export { syncVendorSources } from "./core/vendor-sync.js";
31
+ export type { VendorChange, VendorCheckout, VendorOptions, VendorProvenance, VendorProvenanceInput, VendorSkillStatus, VendorSource, VendorSourceListResult, VendorSourceResolution, VendorSourceShowResult, VendorSourceSkill, VendorSourcesManifest, VendorStatusResult, VendorSyncOptions, VendorSyncResult, } from "./core/vendor-types.js";
32
+ export { VERSION } from "./version.js";