craftdesk 0.2.0 → 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/CHANGELOG.md +57 -0
- package/README.md +968 -92
- package/dist/commands/add.d.ts +5 -0
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +303 -7
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/convert.d.ts +8 -0
- package/dist/commands/convert.d.ts.map +1 -0
- package/dist/commands/convert.js +146 -0
- package/dist/commands/convert.js.map +1 -0
- package/dist/commands/info.d.ts +8 -0
- package/dist/commands/info.d.ts.map +1 -0
- package/dist/commands/info.js +66 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +9 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install.d.ts +5 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +24 -4
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/list.d.ts +5 -0
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +72 -7
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/login.d.ts +8 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +158 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +8 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +51 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/outdated.d.ts +23 -0
- package/dist/commands/outdated.d.ts.map +1 -0
- package/dist/commands/outdated.js +268 -0
- package/dist/commands/outdated.js.map +1 -0
- package/dist/commands/publish.d.ts +8 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +198 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/remove.d.ts +5 -0
- package/dist/commands/remove.d.ts.map +1 -1
- package/dist/commands/remove.js +52 -11
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/search.d.ts +8 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +60 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/update.d.ts +8 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +369 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/whoami.d.ts +8 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +58 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/converters/base-converter.d.ts +89 -0
- package/dist/converters/base-converter.d.ts.map +1 -0
- package/dist/converters/base-converter.js +249 -0
- package/dist/converters/base-converter.js.map +1 -0
- package/dist/converters/continue-converter.d.ts +53 -0
- package/dist/converters/continue-converter.d.ts.map +1 -0
- package/dist/converters/continue-converter.js +243 -0
- package/dist/converters/continue-converter.js.map +1 -0
- package/dist/converters/cursor-converter.d.ts +70 -0
- package/dist/converters/cursor-converter.d.ts.map +1 -0
- package/dist/converters/cursor-converter.js +272 -0
- package/dist/converters/cursor-converter.js.map +1 -0
- package/dist/index.js +35 -4
- package/dist/index.js.map +1 -1
- package/dist/services/config-manager.d.ts +128 -10
- package/dist/services/config-manager.d.ts.map +1 -1
- package/dist/services/config-manager.js +189 -18
- package/dist/services/config-manager.js.map +1 -1
- package/dist/services/converter.d.ts +53 -0
- package/dist/services/converter.d.ts.map +1 -0
- package/dist/services/converter.js +185 -0
- package/dist/services/converter.js.map +1 -0
- package/dist/services/craft-wrapper.d.ts +108 -0
- package/dist/services/craft-wrapper.d.ts.map +1 -0
- package/dist/services/craft-wrapper.js +268 -0
- package/dist/services/craft-wrapper.js.map +1 -0
- package/dist/services/git-resolver.d.ts +9 -3
- package/dist/services/git-resolver.d.ts.map +1 -1
- package/dist/services/git-resolver.js +35 -10
- package/dist/services/git-resolver.js.map +1 -1
- package/dist/services/installer.d.ts +51 -1
- package/dist/services/installer.d.ts.map +1 -1
- package/dist/services/installer.js +245 -14
- package/dist/services/installer.js.map +1 -1
- package/dist/services/plugin-resolver.d.ts +80 -0
- package/dist/services/plugin-resolver.d.ts.map +1 -0
- package/dist/services/plugin-resolver.js +182 -0
- package/dist/services/plugin-resolver.js.map +1 -0
- package/dist/services/registry-client.d.ts +132 -5
- package/dist/services/registry-client.d.ts.map +1 -1
- package/dist/services/registry-client.js +239 -34
- package/dist/services/registry-client.js.map +1 -1
- package/dist/services/settings-manager.d.ts +151 -0
- package/dist/services/settings-manager.d.ts.map +1 -0
- package/dist/services/settings-manager.js +333 -0
- package/dist/services/settings-manager.js.map +1 -0
- package/dist/types/claude-settings.d.ts +155 -0
- package/dist/types/claude-settings.d.ts.map +1 -0
- package/dist/types/claude-settings.js +20 -0
- package/dist/types/claude-settings.js.map +1 -0
- package/dist/types/converter.d.ts +98 -0
- package/dist/types/converter.d.ts.map +1 -0
- package/dist/types/converter.js +6 -0
- package/dist/types/converter.js.map +1 -0
- package/dist/types/craftdesk-json.d.ts +63 -3
- package/dist/types/craftdesk-json.d.ts.map +1 -1
- package/dist/types/craftdesk-lock.d.ts +62 -1
- package/dist/types/craftdesk-lock.d.ts.map +1 -1
- package/dist/utils/crypto.d.ts +23 -0
- package/dist/utils/crypto.d.ts.map +1 -0
- package/dist/utils/crypto.js +52 -0
- package/dist/utils/crypto.js.map +1 -0
- package/dist/utils/file-system.d.ts +43 -0
- package/dist/utils/file-system.d.ts.map +1 -1
- package/dist/utils/file-system.js +45 -2
- package/dist/utils/file-system.js.map +1 -1
- package/dist/utils/logger.d.ts +75 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +76 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/version-utils.d.ts +63 -0
- package/dist/utils/version-utils.d.ts.map +1 -0
- package/dist/utils/version-utils.js +130 -0
- package/dist/utils/version-utils.js.map +1 -0
- package/package.json +36 -9
- package/.claude/settings.local.json +0 -17
- package/.github/workflows/ci.yml +0 -94
- package/API.md +0 -414
- package/TESTING.md +0 -263
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -56
- package/dist/commands/config.js.map +0 -1
- package/dist/types/config.d.ts +0 -17
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/config.js +0 -3
- package/dist/types/config.js.map +0 -1
- package/docs/DEPENDENCY_RESOLUTION.md +0 -237
- package/examples/craftdesk-all-sources.json +0 -79
- package/examples/craftdesk-git-monorepo.json +0 -41
- package/examples/craftdesk-multi-registry.json +0 -40
- package/examples/craftdesk-with-registries.json +0 -49
- package/examples/simple-craftdesk.json +0 -10
- package/src/commands/add.ts +0 -314
- package/src/commands/init.ts +0 -55
- package/src/commands/install.ts +0 -126
- package/src/commands/list.ts +0 -126
- package/src/commands/remove.ts +0 -82
- package/src/index.ts +0 -56
- package/src/services/config-manager.ts +0 -150
- package/src/services/git-resolver.ts +0 -370
- package/src/services/installer.ts +0 -314
- package/src/services/registry-client.ts +0 -163
- package/src/types/craftdesk-json.ts +0 -53
- package/src/types/craftdesk-lock.ts +0 -38
- package/src/utils/file-system.ts +0 -55
- package/src/utils/logger.ts +0 -82
- package/tests/fixtures/craftdesk-git.json +0 -17
- package/tests/fixtures/craftdesk.json +0 -15
- package/tests/helpers/test-utils.ts +0 -60
- package/tests/integration/init-command.test.ts +0 -70
- package/tests/integration/list-command.test.ts +0 -77
- package/tests/unit/config-manager.test.ts +0 -228
- package/tests/unit/git-resolver.test.ts +0 -303
- package/tests/unit/installer.test.ts +0 -105
- package/tsconfig.json +0 -20
- package/vitest.config.ts +0 -29
|
@@ -1,42 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main configuration file for CraftDesk projects (craftdesk.json)
|
|
3
|
+
* Similar to package.json but for Claude skills, agents, commands, and plugins
|
|
4
|
+
*/
|
|
1
5
|
export interface CraftDeskJson {
|
|
6
|
+
/** Project name in author/name format */
|
|
2
7
|
name: string;
|
|
8
|
+
/** Semantic version of the project */
|
|
3
9
|
version: string;
|
|
4
|
-
|
|
10
|
+
/** Type of craft being defined */
|
|
11
|
+
type?: 'skill' | 'agent' | 'command' | 'hook' | 'plugin' | 'collection';
|
|
12
|
+
/** Human-readable description of the project */
|
|
5
13
|
description?: string;
|
|
14
|
+
/** Author name or identifier */
|
|
6
15
|
author?: string;
|
|
16
|
+
/** Software license (e.g., MIT, Apache-2.0) */
|
|
7
17
|
license?: string;
|
|
18
|
+
/** Homepage URL for the project */
|
|
8
19
|
homepage?: string;
|
|
20
|
+
/** Repository information */
|
|
9
21
|
repository?: {
|
|
22
|
+
/** Version control type (e.g., git) */
|
|
10
23
|
type: string;
|
|
24
|
+
/** Repository URL */
|
|
11
25
|
url: string;
|
|
12
26
|
};
|
|
27
|
+
/** Keywords for discovery and categorization */
|
|
13
28
|
keywords?: string[];
|
|
29
|
+
/** Production dependencies - can be simple version strings or detailed configuration objects */
|
|
14
30
|
dependencies?: Record<string, string | DependencyConfig>;
|
|
31
|
+
/** Development-only dependencies */
|
|
15
32
|
devDependencies?: Record<string, string | DependencyConfig>;
|
|
33
|
+
/** Dependencies that must be manually installed by the user */
|
|
16
34
|
peerDependencies?: Record<string, string | DependencyConfig>;
|
|
35
|
+
/** Dependencies that are not required for core functionality */
|
|
17
36
|
optionalDependencies?: Record<string, string | DependencyConfig>;
|
|
37
|
+
/** Registry configuration for dependency resolution */
|
|
18
38
|
registries?: Record<string, RegistryConfig>;
|
|
39
|
+
/** Command definitions */
|
|
19
40
|
commands?: Record<string, string | CommandConfig>;
|
|
41
|
+
/** Hook definitions mapping events to command arrays */
|
|
20
42
|
hooks?: Record<string, string[]>;
|
|
21
|
-
|
|
43
|
+
/** Index signature to allow dynamic property access for future extensibility */
|
|
44
|
+
[key: string]: unknown;
|
|
22
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Configuration for a dependency with various resolution strategies
|
|
48
|
+
* Supports version ranges, git repositories, and registry-based resolution
|
|
49
|
+
*/
|
|
23
50
|
export interface DependencyConfig {
|
|
51
|
+
/** Semantic version or version range (optional for git dependencies) */
|
|
24
52
|
version?: string;
|
|
53
|
+
/** Registry name (from registries section) or direct URL */
|
|
25
54
|
registry?: string;
|
|
55
|
+
/** Git repository URL for git-based dependencies */
|
|
26
56
|
git?: string;
|
|
57
|
+
/** Git branch to use (defaults to main/master) */
|
|
27
58
|
branch?: string;
|
|
59
|
+
/** Git tag to checkout */
|
|
28
60
|
tag?: string;
|
|
61
|
+
/** Specific git commit hash */
|
|
29
62
|
commit?: string;
|
|
63
|
+
/** Subdirectory path within the repository */
|
|
30
64
|
path?: string;
|
|
65
|
+
/** Direct file path within the repository */
|
|
31
66
|
file?: string;
|
|
32
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Plugin-specific dependency configuration
|
|
70
|
+
* Extends DependencyConfig with plugin-specific options
|
|
71
|
+
*/
|
|
72
|
+
export interface PluginDependencyConfig extends DependencyConfig {
|
|
73
|
+
/** Expose plugin capabilities as tools */
|
|
74
|
+
exposeAsTools?: boolean;
|
|
75
|
+
/** Expose plugin via MCP server */
|
|
76
|
+
exposeAsMCP?: boolean;
|
|
77
|
+
/** Auto-wrap individual craft as plugin */
|
|
78
|
+
wrapAsPlugin?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Configuration for a dependency registry
|
|
82
|
+
* Defines how to resolve dependencies from a specific source
|
|
83
|
+
*/
|
|
33
84
|
export interface RegistryConfig {
|
|
85
|
+
/** Base URL of the registry */
|
|
34
86
|
url: string;
|
|
87
|
+
/** Optional scope like "@company" for scoped packages */
|
|
35
88
|
scope?: string;
|
|
89
|
+
/** Optional auth token (should prefer ~/.craftrc for security) */
|
|
36
90
|
auth?: string;
|
|
37
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Configuration for a command
|
|
94
|
+
* Associates a command with a specific version and optional settings
|
|
95
|
+
*/
|
|
38
96
|
export interface CommandConfig {
|
|
97
|
+
/** Command version */
|
|
39
98
|
version: string;
|
|
40
|
-
|
|
99
|
+
/** Command-specific configuration options */
|
|
100
|
+
config?: Record<string, unknown>;
|
|
41
101
|
}
|
|
42
102
|
//# sourceMappingURL=craftdesk-json.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"craftdesk-json.d.ts","sourceRoot":"","sources":["../../src/types/craftdesk-json.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"craftdesk-json.d.ts","sourceRoot":"","sources":["../../src/types/craftdesk-json.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IAEb,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAEhB,kCAAkC;IAClC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAC;IAExE,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,gCAAgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,6BAA6B;IAC7B,UAAU,CAAC,EAAE;QACX,uCAAuC;QACvC,IAAI,EAAE,MAAM,CAAC;QACb,qBAAqB;QACrB,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IAEF,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB,gGAAgG;IAChG,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC;IAEzD,oCAAoC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC;IAE5D,+DAA+D;IAC/D,gBAA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;IAC/B,GAAG,EAAE,MAAM,CAAC;IAEZ,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAEhB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC"}
|
|
@@ -1,34 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lockfile format for CraftDesk (craftdesk.lock)
|
|
3
|
+
* Ensures reproducible installations by recording exact resolved versions
|
|
4
|
+
*/
|
|
1
5
|
export interface CraftDeskLock {
|
|
6
|
+
/** CraftDesk project version */
|
|
2
7
|
version: string;
|
|
8
|
+
/** Lockfile format version */
|
|
3
9
|
lockfileVersion: number;
|
|
10
|
+
/** ISO timestamp of when the lockfile was generated */
|
|
4
11
|
generatedAt: string;
|
|
12
|
+
/** Map of craft names to their resolved lock entries */
|
|
5
13
|
crafts: Record<string, LockEntry>;
|
|
14
|
+
/** Dependency tree showing parent-child relationships */
|
|
6
15
|
tree?: DependencyTree;
|
|
16
|
+
/** Plugin dependency tree showing plugin-specific relationships */
|
|
17
|
+
pluginTree?: PluginDependencyTree;
|
|
18
|
+
/** Installation metadata and statistics */
|
|
7
19
|
metadata?: {
|
|
20
|
+
/** Total number of crafts installed */
|
|
8
21
|
totalCrafts: number;
|
|
22
|
+
/** Total number of plugins installed */
|
|
23
|
+
totalPlugins?: number;
|
|
24
|
+
/** Total installation size as a human-readable string */
|
|
9
25
|
totalSize: string;
|
|
26
|
+
/** Path where crafts are installed */
|
|
10
27
|
installPath: string;
|
|
11
28
|
};
|
|
12
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Lockfile entry for a single craft
|
|
32
|
+
* Records the exact resolved version and source information
|
|
33
|
+
*/
|
|
13
34
|
export interface LockEntry {
|
|
35
|
+
/** Resolved semantic version */
|
|
14
36
|
version: string;
|
|
37
|
+
/** Download URL or git repository URL */
|
|
15
38
|
resolved: string;
|
|
39
|
+
/** SHA-256 hash for registry downloads or git commit hash */
|
|
16
40
|
integrity: string;
|
|
17
|
-
|
|
41
|
+
/** Type of craft */
|
|
42
|
+
type: 'skill' | 'agent' | 'command' | 'hook' | 'plugin' | 'collection';
|
|
43
|
+
/** Author identifier */
|
|
18
44
|
author?: string;
|
|
45
|
+
/** Registry URL where the craft was resolved */
|
|
19
46
|
registry?: string;
|
|
47
|
+
/** Scope if the craft is scoped */
|
|
20
48
|
scope?: string;
|
|
49
|
+
/** Dependencies of this craft mapped to their versions */
|
|
21
50
|
dependencies?: Record<string, string>;
|
|
51
|
+
/** Installation method */
|
|
52
|
+
installedAs?: 'plugin' | 'dependency' | 'direct' | 'wrapped';
|
|
53
|
+
/** Plugin that wraps this craft (if installedAs is 'wrapped') */
|
|
54
|
+
wrappedBy?: string;
|
|
55
|
+
/** Git repository URL for git-based installations */
|
|
22
56
|
git?: string;
|
|
57
|
+
/** Git branch used */
|
|
23
58
|
branch?: string;
|
|
59
|
+
/** Git tag used */
|
|
24
60
|
tag?: string;
|
|
61
|
+
/** Resolved git commit hash */
|
|
25
62
|
commit?: string;
|
|
63
|
+
/** Subdirectory path within repository */
|
|
26
64
|
path?: string;
|
|
65
|
+
/** Direct file path within repository */
|
|
27
66
|
file?: string;
|
|
28
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Recursive dependency tree structure
|
|
70
|
+
* Shows hierarchical relationships between crafts
|
|
71
|
+
*/
|
|
29
72
|
export interface DependencyTree {
|
|
73
|
+
/** Maps craft names to their dependencies or a "(shared)" marker */
|
|
30
74
|
[key: string]: {
|
|
75
|
+
/** Nested dependencies of this craft */
|
|
31
76
|
dependencies?: DependencyTree;
|
|
32
77
|
} | string;
|
|
33
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Plugin dependency tree
|
|
81
|
+
* Tracks which dependencies belong to which plugins
|
|
82
|
+
*/
|
|
83
|
+
export interface PluginDependencyTree {
|
|
84
|
+
[pluginName: string]: {
|
|
85
|
+
/** Plugin version */
|
|
86
|
+
version: string;
|
|
87
|
+
/** Dependencies of this plugin */
|
|
88
|
+
dependencies?: string[];
|
|
89
|
+
/** Whether this plugin was installed as a dependency of another plugin */
|
|
90
|
+
isDependency?: boolean;
|
|
91
|
+
/** Parent plugin (if this is a transitive dependency) */
|
|
92
|
+
requiredBy?: string[];
|
|
93
|
+
};
|
|
94
|
+
}
|
|
34
95
|
//# sourceMappingURL=craftdesk-lock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"craftdesk-lock.d.ts","sourceRoot":"","sources":["../../src/types/craftdesk-lock.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"craftdesk-lock.d.ts","sourceRoot":"","sources":["../../src/types/craftdesk-lock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAEhB,8BAA8B;IAC9B,eAAe,EAAE,MAAM,CAAC;IAExB,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IAEpB,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAElC,yDAAyD;IACzD,IAAI,CAAC,EAAE,cAAc,CAAC;IAEtB,mEAAmE;IACnE,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAElC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE;QACT,uCAAuC;QACvC,WAAW,EAAE,MAAM,CAAC;QACpB,wCAAwC;QACxC,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,yDAAyD;QACzD,SAAS,EAAE,MAAM,CAAC;QAClB,sCAAsC;QACtC,WAAW,EAAE,MAAM,CAAC;KACrB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pB,qBAAqB;QACrB,OAAO,EAAE,MAAM,CAAC;QAEhB,kCAAkC;QAClC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QAExB,0EAA0E;QAC1E,YAAY,CAAC,EAAE,OAAO,CAAC;QAEvB,yDAAyD;QACzD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC;CACH"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate SHA-256 checksum of a file
|
|
3
|
+
*
|
|
4
|
+
* @param filePath - Path to the file
|
|
5
|
+
* @returns Promise resolving to hex-encoded SHA-256 hash
|
|
6
|
+
*/
|
|
7
|
+
export declare function calculateFileChecksum(filePath: string): Promise<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Verify file checksum matches expected value
|
|
10
|
+
*
|
|
11
|
+
* @param filePath - Path to the file to verify
|
|
12
|
+
* @param expectedChecksum - Expected SHA-256 hash (hex-encoded)
|
|
13
|
+
* @returns Promise resolving to true if match, false otherwise
|
|
14
|
+
*/
|
|
15
|
+
export declare function verifyFileChecksum(filePath: string, expectedChecksum: string): Promise<boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* Format checksum for display (first 12 chars)
|
|
18
|
+
*
|
|
19
|
+
* @param checksum - Full checksum string
|
|
20
|
+
* @returns Shortened checksum for display
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatChecksum(checksum: string): string;
|
|
23
|
+
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/utils/crypto.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB7E;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGrG;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.calculateFileChecksum = calculateFileChecksum;
|
|
7
|
+
exports.verifyFileChecksum = verifyFileChecksum;
|
|
8
|
+
exports.formatChecksum = formatChecksum;
|
|
9
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
10
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
11
|
+
/**
|
|
12
|
+
* Calculate SHA-256 checksum of a file
|
|
13
|
+
*
|
|
14
|
+
* @param filePath - Path to the file
|
|
15
|
+
* @returns Promise resolving to hex-encoded SHA-256 hash
|
|
16
|
+
*/
|
|
17
|
+
async function calculateFileChecksum(filePath) {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
const hash = crypto_1.default.createHash('sha256');
|
|
20
|
+
const stream = fs_extra_1.default.createReadStream(filePath);
|
|
21
|
+
stream.on('data', (data) => {
|
|
22
|
+
hash.update(data);
|
|
23
|
+
});
|
|
24
|
+
stream.on('end', () => {
|
|
25
|
+
resolve(hash.digest('hex'));
|
|
26
|
+
});
|
|
27
|
+
stream.on('error', (err) => {
|
|
28
|
+
reject(err);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Verify file checksum matches expected value
|
|
34
|
+
*
|
|
35
|
+
* @param filePath - Path to the file to verify
|
|
36
|
+
* @param expectedChecksum - Expected SHA-256 hash (hex-encoded)
|
|
37
|
+
* @returns Promise resolving to true if match, false otherwise
|
|
38
|
+
*/
|
|
39
|
+
async function verifyFileChecksum(filePath, expectedChecksum) {
|
|
40
|
+
const actualChecksum = await calculateFileChecksum(filePath);
|
|
41
|
+
return actualChecksum.toLowerCase() === expectedChecksum.toLowerCase();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Format checksum for display (first 12 chars)
|
|
45
|
+
*
|
|
46
|
+
* @param checksum - Full checksum string
|
|
47
|
+
* @returns Shortened checksum for display
|
|
48
|
+
*/
|
|
49
|
+
function formatChecksum(checksum) {
|
|
50
|
+
return checksum.substring(0, 12);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=crypto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/utils/crypto.ts"],"names":[],"mappings":";;;;;AASA,sDAiBC;AASD,gDAGC;AAQD,wCAEC;AAhDD,oDAA4B;AAC5B,wDAA0B;AAE1B;;;;;GAKG;AACI,KAAK,UAAU,qBAAqB,CAAC,QAAgB;IAC1D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,IAAI,GAAG,gBAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACzC,MAAM,MAAM,GAAG,kBAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAE7C,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YACzB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACpB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACzB,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,kBAAkB,CAAC,QAAgB,EAAE,gBAAwB;IACjF,MAAM,cAAc,GAAG,MAAM,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAC7D,OAAO,cAAc,CAAC,WAAW,EAAE,KAAK,gBAAgB,CAAC,WAAW,EAAE,CAAC;AACzE,CAAC;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,QAAgB;IAC7C,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1,10 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File system utilities for reading and writing CraftDesk configuration files
|
|
3
|
+
*/
|
|
1
4
|
import { CraftDeskJson } from '../types/craftdesk-json';
|
|
2
5
|
import { CraftDeskLock } from '../types/craftdesk-lock';
|
|
6
|
+
/**
|
|
7
|
+
* Reads and parses a craftdesk.json file from the specified directory
|
|
8
|
+
*
|
|
9
|
+
* @param dir - Directory containing craftdesk.json (defaults to current working directory)
|
|
10
|
+
* @returns Parsed CraftDeskJson object or null if file doesn't exist or is invalid
|
|
11
|
+
*/
|
|
3
12
|
export declare function readCraftDeskJson(dir?: string): Promise<CraftDeskJson | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Writes a CraftDeskJson object to craftdesk.json with pretty formatting
|
|
15
|
+
*
|
|
16
|
+
* @param data - CraftDeskJson object to write
|
|
17
|
+
* @param dir - Directory to write craftdesk.json to (defaults to current working directory)
|
|
18
|
+
*/
|
|
4
19
|
export declare function writeCraftDeskJson(data: CraftDeskJson, dir?: string): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Reads and parses a craftdesk.lock file from the specified directory
|
|
22
|
+
*
|
|
23
|
+
* @param dir - Directory containing craftdesk.lock (defaults to current working directory)
|
|
24
|
+
* @returns Parsed CraftDeskLock object or null if file doesn't exist or is invalid
|
|
25
|
+
*/
|
|
5
26
|
export declare function readCraftDeskLock(dir?: string): Promise<CraftDeskLock | null>;
|
|
27
|
+
/**
|
|
28
|
+
* Writes a CraftDeskLock object to craftdesk.lock with pretty formatting
|
|
29
|
+
*
|
|
30
|
+
* @param data - CraftDeskLock object to write
|
|
31
|
+
* @param dir - Directory to write craftdesk.lock to (defaults to current working directory)
|
|
32
|
+
*/
|
|
6
33
|
export declare function writeCraftDeskLock(data: CraftDeskLock, dir?: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Ensures a directory exists, creating it and any parent directories if needed
|
|
36
|
+
*
|
|
37
|
+
* @param dirPath - Path to the directory to ensure exists
|
|
38
|
+
*/
|
|
7
39
|
export declare function ensureDir(dirPath: string): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Recursively removes a directory and all its contents
|
|
42
|
+
*
|
|
43
|
+
* @param dirPath - Path to the directory to remove
|
|
44
|
+
*/
|
|
8
45
|
export declare function removeDir(dirPath: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if a file or directory exists at the specified path
|
|
48
|
+
*
|
|
49
|
+
* @param filePath - Path to check for existence
|
|
50
|
+
* @returns True if the path exists and is accessible, false otherwise
|
|
51
|
+
*/
|
|
9
52
|
export declare function exists(filePath: string): Promise<boolean>;
|
|
10
53
|
//# sourceMappingURL=file-system.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-system.d.ts","sourceRoot":"","sources":["../../src/utils/file-system.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-system.d.ts","sourceRoot":"","sources":["../../src/utils/file-system.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CASlG;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAIxG;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CASlG;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAIxG;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D;AAED;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO/D"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* File system utilities for reading and writing CraftDesk configuration files
|
|
4
|
+
*/
|
|
2
5
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
6
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
7
|
};
|
|
@@ -12,42 +15,82 @@ exports.removeDir = removeDir;
|
|
|
12
15
|
exports.exists = exists;
|
|
13
16
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
14
17
|
const path_1 = __importDefault(require("path"));
|
|
18
|
+
/**
|
|
19
|
+
* Reads and parses a craftdesk.json file from the specified directory
|
|
20
|
+
*
|
|
21
|
+
* @param dir - Directory containing craftdesk.json (defaults to current working directory)
|
|
22
|
+
* @returns Parsed CraftDeskJson object or null if file doesn't exist or is invalid
|
|
23
|
+
*/
|
|
15
24
|
async function readCraftDeskJson(dir = process.cwd()) {
|
|
16
25
|
const filePath = path_1.default.join(dir, 'craftdesk.json');
|
|
17
26
|
try {
|
|
18
27
|
const content = await fs_extra_1.default.readFile(filePath, 'utf-8');
|
|
19
28
|
return JSON.parse(content);
|
|
20
29
|
}
|
|
21
|
-
catch
|
|
30
|
+
catch {
|
|
22
31
|
return null;
|
|
23
32
|
}
|
|
24
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Writes a CraftDeskJson object to craftdesk.json with pretty formatting
|
|
36
|
+
*
|
|
37
|
+
* @param data - CraftDeskJson object to write
|
|
38
|
+
* @param dir - Directory to write craftdesk.json to (defaults to current working directory)
|
|
39
|
+
*/
|
|
25
40
|
async function writeCraftDeskJson(data, dir = process.cwd()) {
|
|
26
41
|
const filePath = path_1.default.join(dir, 'craftdesk.json');
|
|
27
42
|
const content = JSON.stringify(data, null, 2);
|
|
28
43
|
await fs_extra_1.default.writeFile(filePath, content, 'utf-8');
|
|
29
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Reads and parses a craftdesk.lock file from the specified directory
|
|
47
|
+
*
|
|
48
|
+
* @param dir - Directory containing craftdesk.lock (defaults to current working directory)
|
|
49
|
+
* @returns Parsed CraftDeskLock object or null if file doesn't exist or is invalid
|
|
50
|
+
*/
|
|
30
51
|
async function readCraftDeskLock(dir = process.cwd()) {
|
|
31
52
|
const filePath = path_1.default.join(dir, 'craftdesk.lock');
|
|
32
53
|
try {
|
|
33
54
|
const content = await fs_extra_1.default.readFile(filePath, 'utf-8');
|
|
34
55
|
return JSON.parse(content);
|
|
35
56
|
}
|
|
36
|
-
catch
|
|
57
|
+
catch {
|
|
37
58
|
return null;
|
|
38
59
|
}
|
|
39
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Writes a CraftDeskLock object to craftdesk.lock with pretty formatting
|
|
63
|
+
*
|
|
64
|
+
* @param data - CraftDeskLock object to write
|
|
65
|
+
* @param dir - Directory to write craftdesk.lock to (defaults to current working directory)
|
|
66
|
+
*/
|
|
40
67
|
async function writeCraftDeskLock(data, dir = process.cwd()) {
|
|
41
68
|
const filePath = path_1.default.join(dir, 'craftdesk.lock');
|
|
42
69
|
const content = JSON.stringify(data, null, 2);
|
|
43
70
|
await fs_extra_1.default.writeFile(filePath, content, 'utf-8');
|
|
44
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Ensures a directory exists, creating it and any parent directories if needed
|
|
74
|
+
*
|
|
75
|
+
* @param dirPath - Path to the directory to ensure exists
|
|
76
|
+
*/
|
|
45
77
|
async function ensureDir(dirPath) {
|
|
46
78
|
await fs_extra_1.default.ensureDir(dirPath);
|
|
47
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Recursively removes a directory and all its contents
|
|
82
|
+
*
|
|
83
|
+
* @param dirPath - Path to the directory to remove
|
|
84
|
+
*/
|
|
48
85
|
async function removeDir(dirPath) {
|
|
49
86
|
await fs_extra_1.default.remove(dirPath);
|
|
50
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Checks if a file or directory exists at the specified path
|
|
90
|
+
*
|
|
91
|
+
* @param filePath - Path to check for existence
|
|
92
|
+
* @returns True if the path exists and is accessible, false otherwise
|
|
93
|
+
*/
|
|
51
94
|
async function exists(filePath) {
|
|
52
95
|
try {
|
|
53
96
|
await fs_extra_1.default.access(filePath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-system.js","sourceRoot":"","sources":["../../src/utils/file-system.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"file-system.js","sourceRoot":"","sources":["../../src/utils/file-system.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAaH,8CASC;AAQD,gDAIC;AAQD,8CASC;AAQD,gDAIC;AAOD,8BAEC;AAOD,8BAEC;AAQD,wBAOC;AA9FD,wDAA0B;AAC1B,gDAAwB;AAIxB;;;;;GAKG;AACI,KAAK,UAAU,iBAAiB,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE;IACjE,MAAM,QAAQ,GAAG,cAAI,CAAC,IA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C,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9C,MAAM,kBAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,SAAS,CAAC,OAAe;IAC7C,MAAM,kBAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,SAAS,CAAC,OAAe;IAC7C,MAAM,kBAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,MAAM,CAAC,QAAgB;IAC3C,IAAI,CAAC;QACH,MAAM,kBAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -1,18 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Console logging utility with color support and spinner functionality
|
|
3
|
+
* Provides consistent, formatted output for CLI operations
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Logger class for formatted console output
|
|
7
|
+
* Supports success, error, warning, info, debug, and spinner states
|
|
8
|
+
*/
|
|
1
9
|
export declare class Logger {
|
|
10
|
+
/** Current spinner text (null if no spinner is active) */
|
|
2
11
|
private spinnerText;
|
|
12
|
+
/**
|
|
13
|
+
* Logs a success message with a green checkmark
|
|
14
|
+
*
|
|
15
|
+
* @param message - Success message to display
|
|
16
|
+
*/
|
|
3
17
|
success(message: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* Logs an error message with a red X
|
|
20
|
+
*
|
|
21
|
+
* @param message - Error message to display
|
|
22
|
+
*/
|
|
4
23
|
error(message: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* Logs a warning message with a yellow exclamation mark
|
|
26
|
+
*
|
|
27
|
+
* @param message - Warning message to display
|
|
28
|
+
*/
|
|
5
29
|
warn(message: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Logs an informational message with a blue arrow
|
|
32
|
+
*
|
|
33
|
+
* @param message - Info message to display
|
|
34
|
+
*/
|
|
6
35
|
info(message: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Logs a debug message if DEBUG environment variable is set
|
|
38
|
+
*
|
|
39
|
+
* @param message - Debug message to display
|
|
40
|
+
*/
|
|
7
41
|
debug(message: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Starts a spinner with the specified text
|
|
44
|
+
*
|
|
45
|
+
* @param text - Text to display with the spinner
|
|
46
|
+
*/
|
|
8
47
|
startSpinner(text: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* Updates the current spinner with new text
|
|
50
|
+
*
|
|
51
|
+
* @param text - New text to display
|
|
52
|
+
*/
|
|
9
53
|
updateSpinner(text: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Completes the spinner with a success state
|
|
56
|
+
*
|
|
57
|
+
* @param text - Optional override text (defaults to current spinner text)
|
|
58
|
+
*/
|
|
10
59
|
succeedSpinner(text?: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* Completes the spinner with a failure state
|
|
62
|
+
*
|
|
63
|
+
* @param text - Optional override text (defaults to current spinner text)
|
|
64
|
+
*/
|
|
11
65
|
failSpinner(text?: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Stops the current spinner without completing it
|
|
68
|
+
*/
|
|
12
69
|
stopSpinner(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Logs a plain message without formatting
|
|
72
|
+
*
|
|
73
|
+
* @param message - Message to display
|
|
74
|
+
*/
|
|
13
75
|
log(message: string): void;
|
|
76
|
+
/**
|
|
77
|
+
* Wraps text with bold ANSI formatting
|
|
78
|
+
*
|
|
79
|
+
* @param text - Text to make bold
|
|
80
|
+
* @returns Text wrapped with bold ANSI codes
|
|
81
|
+
*/
|
|
14
82
|
bold(text: string): string;
|
|
83
|
+
/**
|
|
84
|
+
* Wraps text with dim ANSI formatting
|
|
85
|
+
*
|
|
86
|
+
* @param text - Text to make dim
|
|
87
|
+
* @returns Text wrapped with dim ANSI codes
|
|
88
|
+
*/
|
|
15
89
|
dim(text: string): string;
|
|
16
90
|
}
|
|
91
|
+
/** Global logger instance for use throughout the application */
|
|
17
92
|
export declare const logger: Logger;
|
|
18
93
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH;;;GAGG;AACH,qBAAa,MAAM;IACjB,0DAA0D;IAC1D,OAAO,CAAC,WAAW,CAAuB;IAE1C;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI9B;;;;OAIG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI3B;;;;OAIG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM5B;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKhC;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAOjC;;;;OAIG;IACH,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAOnC;;;;OAIG;IACH,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAOhC;;OAEG;IACH,WAAW,IAAI,IAAI;IAInB;;;;OAIG;IACH,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI1B;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAI1B;;;;;OAKG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAG1B;AAED,gEAAgE;AAChE,eAAO,MAAM,MAAM,QAAe,CAAC"}
|