@juspay/yama 1.4.0 ā 1.4.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.
- package/CHANGELOG.md +6 -0
- package/dist/core/Guardian.d.ts +1 -0
- package/dist/core/Guardian.js +15 -5
- package/dist/types/index.d.ts +4 -0
- package/dist/utils/Logger.d.ts +3 -2
- package/dist/utils/Logger.js +8 -4
- package/package.json +1 -1
- package/yama.config.example.yaml +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [1.4.1](https://github.com/juspay/yama/compare/v1.4.0...v1.4.1) (2025-09-18)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **config:** resolve config layering issue in Guardian initialization ([6a27428](https://github.com/juspay/yama/commit/6a2742863b73dee458f83eadc464f41290fe52d9))
|
|
6
|
+
|
|
1
7
|
# [1.4.0](https://github.com/juspay/yama/compare/v1.3.0...v1.4.0) (2025-09-18)
|
|
2
8
|
|
|
3
9
|
### Features
|
package/dist/core/Guardian.d.ts
CHANGED
package/dist/core/Guardian.js
CHANGED
|
@@ -7,7 +7,7 @@ import { BitbucketProvider } from "./providers/BitbucketProvider.js";
|
|
|
7
7
|
import { ContextGatherer } from "./ContextGatherer.js";
|
|
8
8
|
import { CodeReviewer } from "../features/CodeReviewer.js";
|
|
9
9
|
import { DescriptionEnhancer } from "../features/DescriptionEnhancer.js";
|
|
10
|
-
import { logger } from "../utils/Logger.js";
|
|
10
|
+
import { logger, createLogger } from "../utils/Logger.js";
|
|
11
11
|
import { configManager } from "../utils/ConfigManager.js";
|
|
12
12
|
import { cache } from "../utils/Cache.js";
|
|
13
13
|
export class Guardian {
|
|
@@ -18,6 +18,7 @@ export class Guardian {
|
|
|
18
18
|
descriptionEnhancer;
|
|
19
19
|
neurolink;
|
|
20
20
|
initialized = false;
|
|
21
|
+
logger = logger; // Default logger, will be updated after config load
|
|
21
22
|
constructor(config) {
|
|
22
23
|
this.config = {};
|
|
23
24
|
if (config) {
|
|
@@ -32,10 +33,19 @@ export class Guardian {
|
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
35
|
try {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
//
|
|
38
|
-
this.config =
|
|
36
|
+
// Load configuration first
|
|
37
|
+
const loaded = await configManager.loadConfig(configPath);
|
|
38
|
+
// Loaded file first, then in-memory overrides last
|
|
39
|
+
this.config = { ...loaded, ...this.config };
|
|
40
|
+
// Create logger with banner configuration if needed
|
|
41
|
+
const showBanner = this.config.display?.showBanner ?? true;
|
|
42
|
+
if (showBanner !== true) {
|
|
43
|
+
// Only create a new logger if we need to change the banner setting
|
|
44
|
+
this.logger = createLogger(logger.getConfig(), showBanner);
|
|
45
|
+
}
|
|
46
|
+
// Otherwise, keep using the default logger
|
|
47
|
+
this.logger.badge();
|
|
48
|
+
this.logger.phase("š Initializing Yama...");
|
|
39
49
|
// Initialize providers
|
|
40
50
|
this.bitbucketProvider = new BitbucketProvider(this.config.providers.git.credentials);
|
|
41
51
|
await this.bitbucketProvider.initialize();
|
package/dist/types/index.d.ts
CHANGED
|
@@ -250,7 +250,11 @@ export interface EnhancementResult {
|
|
|
250
250
|
totalSections: number;
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
+
export interface DisplayConfig {
|
|
254
|
+
showBanner: boolean;
|
|
255
|
+
}
|
|
253
256
|
export interface GuardianConfig {
|
|
257
|
+
display?: DisplayConfig;
|
|
254
258
|
providers: {
|
|
255
259
|
ai: AIProviderConfig;
|
|
256
260
|
git: GitProviderConfig;
|
package/dist/utils/Logger.d.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import { Logger as ILogger, LogLevel, LoggerOptions } from "../types/index.js";
|
|
6
6
|
export declare class Logger implements ILogger {
|
|
7
7
|
private options;
|
|
8
|
-
|
|
8
|
+
private showBanner;
|
|
9
|
+
constructor(options?: Partial<LoggerOptions>, showBanner?: boolean);
|
|
9
10
|
private shouldLog;
|
|
10
11
|
private formatMessage;
|
|
11
12
|
private colorize;
|
|
@@ -26,5 +27,5 @@ export declare class Logger implements ILogger {
|
|
|
26
27
|
getConfig(): LoggerOptions;
|
|
27
28
|
}
|
|
28
29
|
export declare const logger: Logger;
|
|
29
|
-
export declare function createLogger(options?: Partial<LoggerOptions
|
|
30
|
+
export declare function createLogger(options?: Partial<LoggerOptions>, showBanner?: boolean): Logger;
|
|
30
31
|
//# sourceMappingURL=Logger.d.ts.map
|
package/dist/utils/Logger.js
CHANGED
|
@@ -16,7 +16,8 @@ const YAMA_BADGE = `
|
|
|
16
16
|
`;
|
|
17
17
|
export class Logger {
|
|
18
18
|
options;
|
|
19
|
-
|
|
19
|
+
showBanner;
|
|
20
|
+
constructor(options = {}, showBanner = true) {
|
|
20
21
|
this.options = {
|
|
21
22
|
level: "info",
|
|
22
23
|
verbose: false,
|
|
@@ -24,6 +25,7 @@ export class Logger {
|
|
|
24
25
|
colors: true,
|
|
25
26
|
...options,
|
|
26
27
|
};
|
|
28
|
+
this.showBanner = showBanner;
|
|
27
29
|
}
|
|
28
30
|
shouldLog(level) {
|
|
29
31
|
const levels = {
|
|
@@ -101,7 +103,9 @@ export class Logger {
|
|
|
101
103
|
console.error(this.colorize("error", formatted));
|
|
102
104
|
}
|
|
103
105
|
badge() {
|
|
104
|
-
|
|
106
|
+
if (this.showBanner) {
|
|
107
|
+
console.log(chalk.cyan(YAMA_BADGE));
|
|
108
|
+
}
|
|
105
109
|
}
|
|
106
110
|
phase(message) {
|
|
107
111
|
const formatted = `\nš ${message}`;
|
|
@@ -204,7 +208,7 @@ if (process.env.YAMA_DEBUG === "true") {
|
|
|
204
208
|
}
|
|
205
209
|
export const logger = new Logger(loggerOptions);
|
|
206
210
|
// Export factory function
|
|
207
|
-
export function createLogger(options) {
|
|
208
|
-
return new Logger(options);
|
|
211
|
+
export function createLogger(options, showBanner) {
|
|
212
|
+
return new Logger(options, showBanner);
|
|
209
213
|
}
|
|
210
214
|
//# sourceMappingURL=Logger.js.map
|
package/package.json
CHANGED
package/yama.config.example.yaml
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# Yama Configuration Example
|
|
2
2
|
# This file contains all available configuration options with explanations
|
|
3
3
|
|
|
4
|
+
# Display Configuration
|
|
5
|
+
display:
|
|
6
|
+
showBanner: true # Show ASCII art banner on startup (default: true)
|
|
7
|
+
|
|
4
8
|
# AI Provider Configuration
|
|
5
9
|
providers:
|
|
6
10
|
ai:
|