@artemiskit/cli 0.1.4 → 0.1.6

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 (48) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +1 -0
  3. package/dist/index.js +19129 -20009
  4. package/dist/src/commands/compare.d.ts.map +1 -1
  5. package/dist/src/commands/history.d.ts.map +1 -1
  6. package/dist/src/commands/init.d.ts.map +1 -1
  7. package/dist/src/commands/redteam.d.ts.map +1 -1
  8. package/dist/src/commands/report.d.ts.map +1 -1
  9. package/dist/src/commands/run.d.ts.map +1 -1
  10. package/dist/src/commands/stress.d.ts.map +1 -1
  11. package/dist/src/ui/colors.d.ts +44 -0
  12. package/dist/src/ui/colors.d.ts.map +1 -0
  13. package/dist/src/ui/errors.d.ts +39 -0
  14. package/dist/src/ui/errors.d.ts.map +1 -0
  15. package/dist/src/ui/index.d.ts +16 -0
  16. package/dist/src/ui/index.d.ts.map +1 -0
  17. package/dist/src/ui/live-status.d.ts +82 -0
  18. package/dist/src/ui/live-status.d.ts.map +1 -0
  19. package/dist/src/ui/panels.d.ts +49 -0
  20. package/dist/src/ui/panels.d.ts.map +1 -0
  21. package/dist/src/ui/progress.d.ts +60 -0
  22. package/dist/src/ui/progress.d.ts.map +1 -0
  23. package/dist/src/ui/utils.d.ts +42 -0
  24. package/dist/src/ui/utils.d.ts.map +1 -0
  25. package/package.json +6 -6
  26. package/src/__tests__/helpers/index.ts +6 -0
  27. package/src/__tests__/helpers/mock-adapter.ts +90 -0
  28. package/src/__tests__/helpers/test-utils.ts +205 -0
  29. package/src/__tests__/integration/compare-command.test.ts +236 -0
  30. package/src/__tests__/integration/config.test.ts +125 -0
  31. package/src/__tests__/integration/history-command.test.ts +251 -0
  32. package/src/__tests__/integration/init-command.test.ts +177 -0
  33. package/src/__tests__/integration/report-command.test.ts +245 -0
  34. package/src/__tests__/integration/ui.test.ts +230 -0
  35. package/src/commands/compare.ts +158 -49
  36. package/src/commands/history.ts +131 -30
  37. package/src/commands/init.ts +181 -21
  38. package/src/commands/redteam.ts +118 -75
  39. package/src/commands/report.ts +29 -14
  40. package/src/commands/run.ts +86 -66
  41. package/src/commands/stress.ts +61 -63
  42. package/src/ui/colors.ts +62 -0
  43. package/src/ui/errors.ts +248 -0
  44. package/src/ui/index.ts +42 -0
  45. package/src/ui/live-status.ts +259 -0
  46. package/src/ui/panels.ts +216 -0
  47. package/src/ui/progress.ts +139 -0
  48. package/src/ui/utils.ts +88 -0
@@ -1 +1 @@
1
- {"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../../src/commands/compare.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,wBAAgB,cAAc,IAAI,OAAO,CAwFxC"}
1
+ {"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../../src/commands/compare.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoHpC,wBAAgB,cAAc,IAAI,OAAO,CAgFxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/commands/history.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,wBAAgB,cAAc,IAAI,OAAO,CA8DxC"}
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/commands/history.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+FpC,wBAAgB,cAAc,IAAI,OAAO,CA2ExC"}
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgEpC,wBAAgB,WAAW,IAAI,OAAO,CAuCrC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+JpC,wBAAgB,WAAW,IAAI,OAAO,CA2ErC"}
@@ -1 +1 @@
1
- {"version":3,"file":"redteam.d.ts","sourceRoot":"","sources":["../../../src/commands/redteam.ts"],"names":[],"mappings":"AAAA;;GAEG;AA+BH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBpC,wBAAgB,cAAc,IAAI,OAAO,CAmUxC"}
1
+ {"version":3,"file":"redteam.d.ts","sourceRoot":"","sources":["../../../src/commands/redteam.ts"],"names":[],"mappings":"AAAA;;GAEG;AA8BH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiCpC,wBAAgB,cAAc,IAAI,OAAO,CAqZxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/commands/report.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoDpC,wBAAgB,aAAa,IAAI,OAAO,CA2DvC"}
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/commands/report.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoDpC,wBAAgB,aAAa,IAAI,OAAO,CAwEvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/run.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyBpC,wBAAgB,UAAU,IAAI,OAAO,CA6IpC"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/commands/run.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmCpC,wBAAgB,UAAU,IAAI,OAAO,CA4MpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"stress.d.ts","sourceRoot":"","sources":["../../../src/commands/stress.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkBH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BpC,wBAAgB,aAAa,IAAI,OAAO,CAuOvC"}
1
+ {"version":3,"file":"stress.d.ts","sourceRoot":"","sources":["../../../src/commands/stress.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiBH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmCpC,wBAAgB,aAAa,IAAI,OAAO,CAoQvC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Consistent color scheme for CLI output
3
+ */
4
+ import chalk from 'chalk';
5
+ export declare const colors: {
6
+ success: import("chalk").ChalkInstance;
7
+ error: import("chalk").ChalkInstance;
8
+ warning: import("chalk").ChalkInstance;
9
+ info: import("chalk").ChalkInstance;
10
+ muted: import("chalk").ChalkInstance;
11
+ passed: import("chalk").ChalkInstance;
12
+ failed: import("chalk").ChalkInstance;
13
+ skipped: import("chalk").ChalkInstance;
14
+ running: import("chalk").ChalkInstance;
15
+ border: import("chalk").ChalkInstance;
16
+ highlight: import("chalk").ChalkInstance;
17
+ label: import("chalk").ChalkInstance;
18
+ value: import("chalk").ChalkInstance;
19
+ percentGood: import("chalk").ChalkInstance;
20
+ percentWarn: import("chalk").ChalkInstance;
21
+ percentBad: import("chalk").ChalkInstance;
22
+ };
23
+ /**
24
+ * Returns appropriate color function based on percentage value
25
+ */
26
+ export declare function colorByPercentage(value: number): typeof chalk;
27
+ /**
28
+ * Format a percentage value with appropriate coloring
29
+ */
30
+ export declare function formatPercentage(value: number): string;
31
+ /**
32
+ * Status icons with colors
33
+ */
34
+ export declare const icons: {
35
+ passed: string;
36
+ failed: string;
37
+ skipped: string;
38
+ running: string;
39
+ warning: string;
40
+ info: string;
41
+ arrow: string;
42
+ bullet: string;
43
+ };
44
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../src/ui/colors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;CAwBlB,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,KAAK,CAI7D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED;;GAEG;AACH,eAAO,MAAM,KAAK;;;;;;;;;CASjB,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Enhanced error display formatting
3
+ */
4
+ export interface ErrorContext {
5
+ /** Main error title */
6
+ title: string;
7
+ /** Reason for the error */
8
+ reason: string;
9
+ /** Actionable suggestions for the user */
10
+ suggestions?: string[];
11
+ /** Additional context details */
12
+ details?: Record<string, string>;
13
+ /** Error code (if applicable) */
14
+ code?: string;
15
+ }
16
+ /**
17
+ * Render an enhanced error panel with context and suggestions
18
+ *
19
+ * @example
20
+ * renderError({
21
+ * title: 'Failed to connect to Azure OpenAI',
22
+ * reason: 'Invalid API key or resource not found',
23
+ * suggestions: [
24
+ * 'Check AZURE_OPENAI_API_KEY is set correctly',
25
+ * 'Verify resource name: my-openai-resource',
26
+ * "Run 'artemiskit init' to reconfigure"
27
+ * ]
28
+ * })
29
+ */
30
+ export declare function renderError(ctx: ErrorContext): string;
31
+ /**
32
+ * Render a warning panel (less severe than error)
33
+ */
34
+ export declare function renderWarning(title: string, message: string, suggestions?: string[]): string;
35
+ /**
36
+ * Format provider-specific error messages with suggestions
37
+ */
38
+ export declare function getProviderErrorContext(provider: string, error: Error): ErrorContext;
39
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/ui/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CA0ErD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAoD5F;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,KAAK,GACX,YAAY,CAqEd"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * CLI UI Components
3
+ *
4
+ * Centralized UI utilities for consistent CLI output formatting.
5
+ */
6
+ export { colors, icons, colorByPercentage, formatPercentage } from './colors.js';
7
+ export { isTTY, getTerminalWidth, renderConditional, centerText, padText, stripAnsi, truncate, formatDuration, formatNumber, } from './utils.js';
8
+ export { renderProgressBar, ProgressBar, renderInlineProgress } from './progress.js';
9
+ export type { ProgressBarOptions } from './progress.js';
10
+ export { renderSummaryPanel, renderStressSummaryPanel, renderRedteamSummaryPanel, renderInfoBox, } from './panels.js';
11
+ export type { SummaryData, StressSummaryData, RedteamSummaryData } from './panels.js';
12
+ export { renderError, renderWarning, getProviderErrorContext } from './errors.js';
13
+ export type { ErrorContext } from './errors.js';
14
+ export { LiveTestStatus, Spinner, createSpinner } from './live-status.js';
15
+ export type { TestStatus } from './live-status.js';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGjF,OAAO,EACL,KAAK,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,OAAO,EACP,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrF,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAClF,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC1E,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Real-time test status updates
3
+ */
4
+ export type TestStatus = 'pending' | 'running' | 'passed' | 'failed' | 'skipped';
5
+ /**
6
+ * Live test status tracker with real-time updates
7
+ */
8
+ export declare class LiveTestStatus {
9
+ private spinner;
10
+ private results;
11
+ private total;
12
+ private startTime;
13
+ constructor(total: number);
14
+ /**
15
+ * Start tracking a test
16
+ */
17
+ start(testId: string, testName: string): void;
18
+ /**
19
+ * Mark a test as passed
20
+ */
21
+ pass(testId: string, duration?: number): void;
22
+ /**
23
+ * Mark a test as failed
24
+ */
25
+ fail(testId: string, error?: string, duration?: number): void;
26
+ /**
27
+ * Mark a test as skipped
28
+ */
29
+ skip(testId: string): void;
30
+ /**
31
+ * Update spinner text
32
+ */
33
+ private updateSpinner;
34
+ /**
35
+ * Format current status line
36
+ */
37
+ private formatStatus;
38
+ /**
39
+ * Count results by status
40
+ */
41
+ private countByStatus;
42
+ /**
43
+ * Complete tracking and print final status
44
+ */
45
+ complete(): void;
46
+ /**
47
+ * Print final status for all tests
48
+ */
49
+ private printFinalStatus;
50
+ /**
51
+ * Get icon for status
52
+ */
53
+ private getStatusIcon;
54
+ /**
55
+ * Get summary statistics
56
+ */
57
+ getSummary(): {
58
+ passed: number;
59
+ failed: number;
60
+ skipped: number;
61
+ duration: number;
62
+ };
63
+ }
64
+ /**
65
+ * Simple spinner wrapper with consistent styling
66
+ */
67
+ export declare class Spinner {
68
+ private spinner;
69
+ constructor(text?: string);
70
+ start(text?: string): this;
71
+ update(text: string): this;
72
+ succeed(text?: string): this;
73
+ fail(text?: string): this;
74
+ warn(text?: string): this;
75
+ info(text?: string): this;
76
+ stop(): this;
77
+ }
78
+ /**
79
+ * Create a new spinner instance
80
+ */
81
+ export declare function createSpinner(text?: string): Spinner;
82
+ //# sourceMappingURL=live-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live-status.d.ts","sourceRoot":"","sources":["../../../src/ui/live-status.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AASjF;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,OAAO,CAAsC;IACrD,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,SAAS,CAAsB;gBAE3B,KAAK,EAAE,MAAM;IAQzB;;OAEG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAU7C;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAS7C;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAU7D;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAQ1B;;OAEG;IACH,OAAO,CAAC,aAAa;IAMrB;;OAEG;IACH,OAAO,CAAC,YAAY;IAepB;;OAEG;IACH,OAAO,CAAC,aAAa;IAIrB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAOhB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAgBxB;;OAEG;IACH,OAAO,CAAC,aAAa;IAerB;;OAEG;IACH,UAAU,IAAI;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;CAQpF;AAED;;GAEG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,OAAO,CAAM;gBAET,IAAI,CAAC,EAAE,MAAM;IAQzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAS1B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAO1B,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAS5B,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IASzB,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IASzB,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IASzB,IAAI,IAAI,IAAI;CAMb;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAEpD"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Panel rendering for summary displays
3
+ */
4
+ export interface SummaryData {
5
+ passed: number;
6
+ failed: number;
7
+ skipped: number;
8
+ successRate: number;
9
+ duration: number;
10
+ title?: string;
11
+ }
12
+ export interface StressSummaryData {
13
+ totalRequests: number;
14
+ successfulRequests: number;
15
+ failedRequests: number;
16
+ successRate: number;
17
+ duration: number;
18
+ avgLatency: number;
19
+ p50Latency: number;
20
+ p95Latency: number;
21
+ p99Latency: number;
22
+ throughput: number;
23
+ }
24
+ export interface RedteamSummaryData {
25
+ totalCases: number;
26
+ safeResponses: number;
27
+ unsafeResponses: number;
28
+ blockedResponses: number;
29
+ errorResponses: number;
30
+ defenseRate: number;
31
+ severityBreakdown?: Record<string, number>;
32
+ }
33
+ /**
34
+ * Render a test results summary panel
35
+ */
36
+ export declare function renderSummaryPanel(data: SummaryData): string;
37
+ /**
38
+ * Render a stress test summary panel
39
+ */
40
+ export declare function renderStressSummaryPanel(data: StressSummaryData): string;
41
+ /**
42
+ * Render a red team summary panel
43
+ */
44
+ export declare function renderRedteamSummaryPanel(data: RedteamSummaryData): string;
45
+ /**
46
+ * Render a simple info box
47
+ */
48
+ export declare function renderInfoBox(title: string, lines: string[]): string;
49
+ //# sourceMappingURL=panels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../../src/ui/panels.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CA6B5D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAuDxE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,CA4C1E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAsBpE"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Progress bar rendering utilities
3
+ */
4
+ export interface ProgressBarOptions {
5
+ /** Width of the progress bar in characters */
6
+ width?: number;
7
+ /** Character for filled portion */
8
+ filledChar?: string;
9
+ /** Character for empty portion */
10
+ emptyChar?: string;
11
+ /** Show percentage */
12
+ showPercentage?: boolean;
13
+ /** Show count (current/total) */
14
+ showCount?: boolean;
15
+ /** Label to show before the bar */
16
+ label?: string;
17
+ }
18
+ /**
19
+ * Render a progress bar
20
+ *
21
+ * @example
22
+ * renderProgressBar(3, 10)
23
+ * // "████████░░░░░░░░░░░░ 3/10 (30%)"
24
+ *
25
+ * renderProgressBar(3, 10, { label: 'Running tests' })
26
+ * // "Running tests ████████░░░░░░░░░░░░ 3/10 (30%)"
27
+ */
28
+ export declare function renderProgressBar(current: number, total: number, options?: ProgressBarOptions): string;
29
+ /**
30
+ * Create a progress bar manager for updating in-place
31
+ */
32
+ export declare class ProgressBar {
33
+ private current;
34
+ private total;
35
+ private options;
36
+ private lastOutput;
37
+ constructor(total: number, options?: ProgressBarOptions);
38
+ /**
39
+ * Update progress and render
40
+ */
41
+ update(current: number): void;
42
+ /**
43
+ * Increment progress by one
44
+ */
45
+ increment(): void;
46
+ /**
47
+ * Render the progress bar
48
+ */
49
+ private render;
50
+ /**
51
+ * Complete the progress bar and move to next line
52
+ */
53
+ complete(): void;
54
+ }
55
+ /**
56
+ * Render a compact inline progress indicator
57
+ * Useful for spinners or status lines
58
+ */
59
+ export declare function renderInlineProgress(current: number, total: number, label?: string): string;
60
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/ui/progress.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,WAAW,kBAAkB;IACjC,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iCAAiC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAWD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAwBR;AAED;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,UAAU,CAAM;gBAEZ,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB;IAK3D;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK7B;;OAEG;IACH,SAAS,IAAI,IAAI;IAIjB;;OAEG;IACH,OAAO,CAAC,MAAM;IAYd;;OAEG;IACH,QAAQ,IAAI,IAAI;CAMjB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAO3F"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * UI utility functions for terminal handling
3
+ */
4
+ /**
5
+ * Check if stdout is a TTY (interactive terminal)
6
+ */
7
+ export declare const isTTY: boolean;
8
+ /**
9
+ * Get terminal width, with fallback for non-TTY environments
10
+ */
11
+ export declare function getTerminalWidth(): number;
12
+ /**
13
+ * Render different output based on TTY availability
14
+ * @param ttyOutput Output for interactive terminals
15
+ * @param plainOutput Output for non-TTY (CI/CD) environments
16
+ */
17
+ export declare function renderConditional(ttyOutput: string, plainOutput: string): string;
18
+ /**
19
+ * Center text within a given width
20
+ */
21
+ export declare function centerText(text: string, width: number): string;
22
+ /**
23
+ * Pad text to a specific width (accounting for ANSI codes)
24
+ */
25
+ export declare function padText(text: string, width: number, align?: 'left' | 'right' | 'center'): string;
26
+ /**
27
+ * Strip ANSI escape codes from string (for length calculations)
28
+ */
29
+ export declare function stripAnsi(str: string): string;
30
+ /**
31
+ * Truncate text to fit within a width, adding ellipsis if needed
32
+ */
33
+ export declare function truncate(text: string, maxWidth: number): string;
34
+ /**
35
+ * Format duration in a human-readable way
36
+ */
37
+ export declare function formatDuration(ms: number): string;
38
+ /**
39
+ * Format a number with commas for readability
40
+ */
41
+ export declare function formatNumber(num: number): string;
42
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/ui/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,KAAK,SAAgC,CAAC;AAEnD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAK9D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,OAAO,GAAG,QAAiB,GAAG,MAAM,CAUxG;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAI/D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artemiskit/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Command-line interface for ArtemisKit LLM evaluation toolkit",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -45,11 +45,11 @@
45
45
  "test": "bun test"
46
46
  },
47
47
  "dependencies": {
48
- "@artemiskit/adapter-openai": "0.1.4",
49
- "@artemiskit/adapter-vercel-ai": "0.1.4",
50
- "@artemiskit/core": "0.1.4",
51
- "@artemiskit/redteam": "0.1.4",
52
- "@artemiskit/reports": "0.1.4",
48
+ "@artemiskit/adapter-openai": "workspace:*",
49
+ "@artemiskit/adapter-vercel-ai": "workspace:*",
50
+ "@artemiskit/core": "workspace:*",
51
+ "@artemiskit/redteam": "workspace:*",
52
+ "@artemiskit/reports": "workspace:*",
53
53
  "chalk": "^5.3.0",
54
54
  "cli-table3": "^0.6.3",
55
55
  "commander": "^12.0.0",
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Test helpers index
3
+ */
4
+
5
+ export * from './mock-adapter.js';
6
+ export * from './test-utils.js';
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Mock adapter for CLI integration tests
3
+ */
4
+
5
+ import type { LLMAdapter, LLMResponse } from '@artemiskit/core';
6
+
7
+ export interface MockResponse {
8
+ content: string;
9
+ latencyMs?: number;
10
+ tokens?: { input: number; output: number };
11
+ }
12
+
13
+ export interface MockAdapterOptions {
14
+ responses?: Map<string, MockResponse>;
15
+ defaultResponse?: MockResponse;
16
+ shouldFail?: boolean;
17
+ failureMessage?: string;
18
+ }
19
+
20
+ /**
21
+ * Creates a mock LLM adapter for testing
22
+ */
23
+ export function createMockAdapter(options: MockAdapterOptions = {}): LLMAdapter {
24
+ const {
25
+ responses = new Map(),
26
+ defaultResponse = {
27
+ content: 'Hello! How can I help you today?',
28
+ latencyMs: 100,
29
+ tokens: { input: 10, output: 15 },
30
+ },
31
+ shouldFail = false,
32
+ failureMessage = 'Mock adapter failure',
33
+ } = options;
34
+
35
+ return {
36
+ chat: async (messages): Promise<LLMResponse> => {
37
+ if (shouldFail) {
38
+ throw new Error(failureMessage);
39
+ }
40
+
41
+ // Get the last user message to determine response
42
+ const lastUserMessage = [...messages].reverse().find((m) => m.role === 'user');
43
+ const prompt = lastUserMessage?.content || '';
44
+
45
+ // Check for specific response mapping
46
+ const mockResponse = responses.get(prompt) || defaultResponse;
47
+
48
+ // Simulate latency
49
+ if (mockResponse.latencyMs) {
50
+ await new Promise((resolve) => setTimeout(resolve, Math.min(mockResponse.latencyMs!, 50)));
51
+ }
52
+
53
+ return {
54
+ content: mockResponse.content,
55
+ usage: mockResponse.tokens || { input: 10, output: 15 },
56
+ };
57
+ },
58
+ };
59
+ }
60
+
61
+ /**
62
+ * Preset responses for common test scenarios
63
+ */
64
+ export const mockResponses = {
65
+ greeting: {
66
+ content: 'Hello! How can I help you today?',
67
+ latencyMs: 50,
68
+ tokens: { input: 5, output: 8 },
69
+ },
70
+ capitals: {
71
+ content: 'The capital of France is Paris.',
72
+ latencyMs: 75,
73
+ tokens: { input: 10, output: 8 },
74
+ },
75
+ math: {
76
+ content: 'The answer is 4.',
77
+ latencyMs: 30,
78
+ tokens: { input: 8, output: 5 },
79
+ },
80
+ json: {
81
+ content: '{"name": "John", "age": 30}',
82
+ latencyMs: 60,
83
+ tokens: { input: 15, output: 12 },
84
+ },
85
+ code: {
86
+ content: 'function add(a, b) { return a + b; }',
87
+ latencyMs: 80,
88
+ tokens: { input: 20, output: 15 },
89
+ },
90
+ };