@lushly-dev/afd-adapters 2.2.1 → 2.3.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/README.md +29 -4
- package/css/afd-theme.css +33 -0
- package/dist/css-variables.d.ts +12 -12
- package/dist/css-variables.d.ts.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +5 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +9 -1
- package/dist/utils.js.map +1 -1
- package/dist/web-adapter.d.ts +12 -9
- package/dist/web-adapter.d.ts.map +1 -1
- package/dist/web-adapter.js +56 -39
- package/dist/web-adapter.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -58,10 +58,15 @@ Map AFD variables to Violet design tokens:
|
|
|
58
58
|
| Method | Description |
|
|
59
59
|
|--------|-------------|
|
|
60
60
|
| `renderPackageResults(data, options?)` | Render lint/test/build results |
|
|
61
|
-
| `renderError(message)` | Render error message |
|
|
62
|
-
| `renderSuccess(message)` | Render success message |
|
|
63
|
-
| `renderWarning(message)` | Render warning message |
|
|
64
|
-
| `renderResult(result)` | Auto-detect and render CommandResult |
|
|
61
|
+
| `renderError(message, options?)` | Render error message |
|
|
62
|
+
| `renderSuccess(message, options?)` | Render success message |
|
|
63
|
+
| `renderWarning(message, options?)` | Render warning message |
|
|
64
|
+
| `renderResult(result, options?)` | Auto-detect and render CommandResult |
|
|
65
|
+
| `renderCommandError(error, options?)` | Render a CommandError with its code, message, suggestion and details |
|
|
66
|
+
| `renderConfidence(confidence, reasoning?, options?)` | Render a confidence bar and its reasoning |
|
|
67
|
+
| `renderWarnings(warnings, options?)` | Render a list of warnings |
|
|
68
|
+
| `renderPipelineSteps(steps, options?)` | Render pipeline step progress |
|
|
69
|
+
| `renderCommandResult(result, options?)` | Render a full CommandResult with its metadata sections |
|
|
65
70
|
|
|
66
71
|
All text is escaped with `escapeHtml(value)`, also exported: it converts any value with
|
|
67
72
|
`String(value)` and escapes `&`, `<`, `>`, `"` and `'`, so the output is safe in element content
|
|
@@ -74,9 +79,29 @@ renders as 0%.
|
|
|
74
79
|
interface RenderOptions {
|
|
75
80
|
showFailureOutput?: boolean; // Show stderr for failed packages (default: true)
|
|
76
81
|
maxOutputLength?: number; // Truncate long output
|
|
82
|
+
styling?: 'inline' | 'classes'; // How spans are styled (default: 'inline')
|
|
77
83
|
}
|
|
78
84
|
```
|
|
79
85
|
|
|
86
|
+
### Styling under a Content-Security-Policy
|
|
87
|
+
|
|
88
|
+
By default spans carry a `style` attribute, which a policy of `style-src 'self'` refuses. With
|
|
89
|
+
`styling: 'classes'` no output has a `style` attribute:
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
const html = WebAdapter.renderCommandResult(result, { styling: 'classes' });
|
|
93
|
+
// <span class="afd-status-success afd-bold">Confidence: 90%</span>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Each span has one `afd-status-<type>` class, where `<type>` is `success`, `failure`, `warning`,
|
|
97
|
+
`info`, `muted` or `neutral`, and bold spans add `afd-bold`. `styledSpan(text, status, bold, styling)`
|
|
98
|
+
takes the same value, and an unknown status renders as `neutral`.
|
|
99
|
+
|
|
100
|
+
The default theme defines these classes, using the variables above. Defining only the variables
|
|
101
|
+
is not enough here: without the theme, define every class yourself, `afd-bold` included, or the
|
|
102
|
+
spans render unstyled. A document's stylesheet does not reach into a shadow root, so load the theme
|
|
103
|
+
there, or define the classes in the shadow root's own stylesheet.
|
|
104
|
+
|
|
80
105
|
## License
|
|
81
106
|
|
|
82
107
|
MIT
|
package/css/afd-theme.css
CHANGED
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
* --afd-success: var(--violet-color-semantic-success);
|
|
9
9
|
* --afd-error: var(--violet-color-semantic-error);
|
|
10
10
|
* etc.
|
|
11
|
+
*
|
|
12
|
+
* The classes below style output rendered with `styling: 'classes'`. A document's
|
|
13
|
+
* stylesheet does not reach into a shadow root: load this file there, or define the
|
|
14
|
+
* classes in the shadow root's own stylesheet.
|
|
11
15
|
*/
|
|
12
16
|
|
|
13
17
|
:root {
|
|
@@ -29,3 +33,32 @@
|
|
|
29
33
|
/* Default text - inherits from parent */
|
|
30
34
|
--afd-text: inherit;
|
|
31
35
|
}
|
|
36
|
+
|
|
37
|
+
/* Spans rendered with `styling: 'classes'`; the same declarations as `styling: 'inline'` */
|
|
38
|
+
.afd-status-success {
|
|
39
|
+
color: var(--afd-success, #22c55e);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.afd-status-failure {
|
|
43
|
+
color: var(--afd-error, #ef4444);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.afd-status-warning {
|
|
47
|
+
color: var(--afd-warning, #f59e0b);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.afd-status-info {
|
|
51
|
+
color: var(--afd-info, #3b82f6);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.afd-status-muted {
|
|
55
|
+
color: var(--afd-muted, #6b7280);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.afd-status-neutral {
|
|
59
|
+
color: inherit;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.afd-bold {
|
|
63
|
+
font-weight: bold;
|
|
64
|
+
}
|
package/dist/css-variables.d.ts
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* Status types for semantic styling.
|
|
6
6
|
*/
|
|
7
7
|
export declare const StatusType: {
|
|
8
|
-
readonly SUCCESS:
|
|
9
|
-
readonly FAILURE:
|
|
10
|
-
readonly WARNING:
|
|
11
|
-
readonly INFO:
|
|
12
|
-
readonly MUTED:
|
|
13
|
-
readonly NEUTRAL:
|
|
8
|
+
readonly SUCCESS: 'success';
|
|
9
|
+
readonly FAILURE: 'failure';
|
|
10
|
+
readonly WARNING: 'warning';
|
|
11
|
+
readonly INFO: 'info';
|
|
12
|
+
readonly MUTED: 'muted';
|
|
13
|
+
readonly NEUTRAL: 'neutral';
|
|
14
14
|
};
|
|
15
15
|
export type StatusTypeValue = (typeof StatusType)[keyof typeof StatusType];
|
|
16
16
|
/**
|
|
@@ -18,12 +18,12 @@ export type StatusTypeValue = (typeof StatusType)[keyof typeof StatusType];
|
|
|
18
18
|
* These should be defined in your stylesheet.
|
|
19
19
|
*/
|
|
20
20
|
export declare const AFD_CSS_VARIABLES: {
|
|
21
|
-
readonly success:
|
|
22
|
-
readonly error:
|
|
23
|
-
readonly warning:
|
|
24
|
-
readonly info:
|
|
25
|
-
readonly muted:
|
|
26
|
-
readonly text:
|
|
21
|
+
readonly success: '--afd-success';
|
|
22
|
+
readonly error: '--afd-error';
|
|
23
|
+
readonly warning: '--afd-warning';
|
|
24
|
+
readonly info: '--afd-info';
|
|
25
|
+
readonly muted: '--afd-muted';
|
|
26
|
+
readonly text: '--afd-text';
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* CSS variable mappings with fallback colors.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-variables.d.ts","sourceRoot":"","sources":["../src/css-variables.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"css-variables.d.ts","sourceRoot":"","sources":["../src/css-variables.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;aACtB,OAAO,EAAE,SAAS;aAClB,OAAO,EAAE,SAAS;aAClB,OAAO,EAAE,SAAS;aAClB,IAAI,EAAE,MAAM;aACZ,KAAK,EAAE,OAAO;aACd,OAAO,EAAE,SAAS;CACT,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,iBAAiB;aAC7B,OAAO,EAAE,eAAe;aACxB,KAAK,EAAE,aAAa;aACpB,OAAO,EAAE,eAAe;aACxB,IAAI,EAAE,YAAY;aAClB,KAAK,EAAE,aAAa;aACpB,IAAI,EAAE,YAAY;CACT,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAOzD,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -34,6 +34,13 @@ export interface RenderOptions {
|
|
|
34
34
|
* @default undefined (no limit)
|
|
35
35
|
*/
|
|
36
36
|
maxOutputLength?: number;
|
|
37
|
+
/**
|
|
38
|
+
* How spans carry their status and weight. `inline` writes a `style` attribute. `classes`
|
|
39
|
+
* writes `afd-status-<type>` and `afd-bold`, defined in `css/afd-theme.css`, for a
|
|
40
|
+
* Content-Security-Policy of `style-src 'self'`, which refuses `style` attributes.
|
|
41
|
+
* @default 'inline'
|
|
42
|
+
*/
|
|
43
|
+
styling?: 'inline' | 'classes';
|
|
37
44
|
}
|
|
38
45
|
/**
|
|
39
46
|
* A CommandError with optional suggestion for recovery.
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,eAAe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AI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/D"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Utility functions for adapters.
|
|
3
3
|
*/
|
|
4
4
|
import { type StatusTypeValue } from './css-variables.js';
|
|
5
|
+
import type { RenderOptions } from './types.js';
|
|
5
6
|
/**
|
|
6
7
|
* Escape HTML special characters (fast regex version, no DOM).
|
|
7
8
|
*
|
|
@@ -13,6 +14,9 @@ import { type StatusTypeValue } from './css-variables.js';
|
|
|
13
14
|
export declare function escapeHtml(text: unknown): string;
|
|
14
15
|
/**
|
|
15
16
|
* Create a styled span using CSS variables.
|
|
17
|
+
*
|
|
18
|
+
* With `styling: 'classes'` the span carries `afd-status-<type>` and `afd-bold` instead of a
|
|
19
|
+
* `style` attribute. An unknown status renders as neutral, so it never reaches the attribute.
|
|
16
20
|
*/
|
|
17
|
-
export declare function styledSpan(text: string, status?: StatusTypeValue, bold?: boolean): string;
|
|
21
|
+
export declare function styledSpan(text: string, status?: StatusTypeValue, bold?: boolean, styling?: RenderOptions['styling']): string;
|
|
18
22
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAA6B,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAA6B,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAOhD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACzB,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,eAAoC,EAC5C,IAAI,UAAQ,EACZ,OAAO,GAAE,aAAa,CAAC,SAAS,CAAY,GAC1C,MAAM,CAYR"}
|
package/dist/utils.js
CHANGED
|
@@ -20,8 +20,16 @@ export function escapeHtml(text) {
|
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Create a styled span using CSS variables.
|
|
23
|
+
*
|
|
24
|
+
* With `styling: 'classes'` the span carries `afd-status-<type>` and `afd-bold` instead of a
|
|
25
|
+
* `style` attribute. An unknown status renders as neutral, so it never reaches the attribute.
|
|
23
26
|
*/
|
|
24
|
-
export function styledSpan(text, status = StatusType.NEUTRAL, bold = false) {
|
|
27
|
+
export function styledSpan(text, status = StatusType.NEUTRAL, bold = false, styling = 'inline') {
|
|
28
|
+
if (styling === 'classes') {
|
|
29
|
+
const type = Object.hasOwn(STATUS_COLORS, status) ? status : StatusType.NEUTRAL;
|
|
30
|
+
const classes = bold ? `afd-status-${type} afd-bold` : `afd-status-${type}`;
|
|
31
|
+
return `<span class="${classes}">${escapeHtml(text)}</span>`;
|
|
32
|
+
}
|
|
25
33
|
const color = STATUS_COLORS[status] || 'inherit';
|
|
26
34
|
const fontWeight = bold ? 'font-weight: bold;' : '';
|
|
27
35
|
const style = `color: ${color}; ${fontWeight}`.trim();
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAwB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAwB,MAAM,oBAAoB,CAAC;AAGrF;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,IAAa;IACvC,OAAO,MAAM,CAAC,IAAI,CAAC;SACjB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACzB,IAAY,EACZ,MAAM,GAAoB,UAAU,CAAC,OAAO,EAC5C,IAAI,GAAG,KAAK,EACZ,OAAO,GAA6B,QAAQ;IAE5C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;QAChF,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,cAAc,IAAI,WAAW,CAAC,CAAC,CAAC,cAAc,IAAI,EAAE,CAAC;QAC5E,OAAO,gBAAgB,OAAO,KAAK,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;IAC9D,CAAC;IAED,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC;IACjD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC;IACpD,MAAM,KAAK,GAAG,UAAU,KAAK,KAAK,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC;IAEtD,OAAO,gBAAgB,KAAK,KAAK,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;AAC5D,CAAC"}
|
package/dist/web-adapter.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ import type { CommandErrorInput, CommandResultInput, PackageResults, PipelineSte
|
|
|
7
7
|
*
|
|
8
8
|
* Uses CSS custom properties for theming:
|
|
9
9
|
* --afd-success, --afd-error, --afd-warning, --afd-info, --afd-muted
|
|
10
|
+
*
|
|
11
|
+
* Every method takes `RenderOptions`. With `styling: 'classes'` the output has no `style`
|
|
12
|
+
* attribute, for a Content-Security-Policy of `style-src 'self'`.
|
|
10
13
|
*/
|
|
11
14
|
export declare const WebAdapter: {
|
|
12
15
|
/**
|
|
@@ -16,15 +19,15 @@ export declare const WebAdapter: {
|
|
|
16
19
|
/**
|
|
17
20
|
* Render an error message.
|
|
18
21
|
*/
|
|
19
|
-
renderError(message: string): string;
|
|
22
|
+
renderError(message: string, options?: RenderOptions): string;
|
|
20
23
|
/**
|
|
21
24
|
* Render a success message.
|
|
22
25
|
*/
|
|
23
|
-
renderSuccess(message: string): string;
|
|
26
|
+
renderSuccess(message: string, options?: RenderOptions): string;
|
|
24
27
|
/**
|
|
25
28
|
* Render a warning message.
|
|
26
29
|
*/
|
|
27
|
-
renderWarning(message: string): string;
|
|
30
|
+
renderWarning(message: string, options?: RenderOptions): string;
|
|
28
31
|
/**
|
|
29
32
|
* Render a generic result with auto-detection.
|
|
30
33
|
*/
|
|
@@ -32,28 +35,28 @@ export declare const WebAdapter: {
|
|
|
32
35
|
success: boolean;
|
|
33
36
|
data?: unknown;
|
|
34
37
|
error?: unknown;
|
|
35
|
-
}): string;
|
|
38
|
+
}, options?: RenderOptions): string;
|
|
36
39
|
/**
|
|
37
40
|
* Render a CommandError with code, message, and optional suggestion.
|
|
38
41
|
*/
|
|
39
|
-
renderCommandError(error: CommandErrorInput): string;
|
|
42
|
+
renderCommandError(error: CommandErrorInput, options?: RenderOptions): string;
|
|
40
43
|
/**
|
|
41
44
|
* Render a confidence indicator (0-1 scale). Values outside [0, 1] are clamped and a
|
|
42
45
|
* non-finite value renders as 0, so a server's bad value cannot throw after the command
|
|
43
46
|
* already succeeded.
|
|
44
47
|
*/
|
|
45
|
-
renderConfidence(rawConfidence: number, reasoning?: string): string;
|
|
48
|
+
renderConfidence(rawConfidence: number, reasoning?: string, options?: RenderOptions): string;
|
|
46
49
|
/**
|
|
47
50
|
* Render a list of warnings.
|
|
48
51
|
*/
|
|
49
|
-
renderWarnings(warnings: WarningInput[]): string;
|
|
52
|
+
renderWarnings(warnings: WarningInput[], options?: RenderOptions): string;
|
|
50
53
|
/**
|
|
51
54
|
* Render pipeline step progress.
|
|
52
55
|
*/
|
|
53
|
-
renderPipelineSteps(steps: PipelineStepInput[]): string;
|
|
56
|
+
renderPipelineSteps(steps: PipelineStepInput[], options?: RenderOptions): string;
|
|
54
57
|
/**
|
|
55
58
|
* Render a full CommandResult with all metadata sections.
|
|
56
59
|
*/
|
|
57
|
-
renderCommandResult(result: CommandResultInput): string;
|
|
60
|
+
renderCommandResult(result: CommandResultInput, options?: RenderOptions): string;
|
|
58
61
|
};
|
|
59
62
|
//# sourceMappingURL=web-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-adapter.d.ts","sourceRoot":"","sources":["../src/web-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"web-adapter.d.ts","sourceRoot":"","sources":["../src/web-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,MAAM,YAAY,CAAC;AAWpB;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU;IACtB;;OAEG;IACH,oBAAoB,OAAO,cAAc,YAAW,aAAa,GAAQ,MAAM;IAgE/E;;OAEG;IACH,WAAW,UAAU,MAAM,YAAW,aAAa,GAAQ,MAAM;IAKjE;;OAEG;IACH,aAAa,UAAU,MAAM,YAAW,aAAa,GAAQ,MAAM;IAKnE;;OAEG;IACH,aAAa,UAAU,MAAM,YAAW,aAAa,GAAQ,MAAM;IAKnE;;OAEG;IACH,YAAY,SACH;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,YACpD,aAAa,GACpB,MAAM;IAoBT;;OAEG;IACH,kBAAkB,QAAQ,iBAAiB,YAAW,aAAa,GAAQ,MAAM;IAiBjF;;;;OAIG;IACH,gBAAgB,gBAAgB,MAAM,cAAc,MAAM,YAAW,aAAa,GAAQ,MAAM;IA2BhG;;OAEG;IACH,cAAc,WAAW,YAAY,EAAE,YAAW,aAAa,GAAQ,MAAM;IAe7E;;OAEG;IACH,mBAAmB,QAAQ,iBAAiB,EAAE,YAAW,aAAa,GAAQ,MAAM;IA+CpF;;OAEG;IACH,mBAAmB,SAAS,kBAAkB,YAAW,aAAa,GAAQ,MAAM;CA8BpF,CAAC"}
|
package/dist/web-adapter.js
CHANGED
|
@@ -3,11 +3,20 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { StatusType } from './css-variables.js';
|
|
5
5
|
import { escapeHtml, styledSpan } from './utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* The span writer for one render, bound to its `styling`.
|
|
8
|
+
*/
|
|
9
|
+
function spanWriter(options) {
|
|
10
|
+
return (text, status, bold = false) => styledSpan(text, status, bold, options.styling);
|
|
11
|
+
}
|
|
6
12
|
/**
|
|
7
13
|
* WebAdapter transforms AFD CommandResult data into styled HTML.
|
|
8
14
|
*
|
|
9
15
|
* Uses CSS custom properties for theming:
|
|
10
16
|
* --afd-success, --afd-error, --afd-warning, --afd-info, --afd-muted
|
|
17
|
+
*
|
|
18
|
+
* Every method takes `RenderOptions`. With `styling: 'classes'` the output has no `style`
|
|
19
|
+
* attribute, for a Content-Security-Policy of `style-src 'self'`.
|
|
11
20
|
*/
|
|
12
21
|
export const WebAdapter = {
|
|
13
22
|
/**
|
|
@@ -15,6 +24,7 @@ export const WebAdapter = {
|
|
|
15
24
|
*/
|
|
16
25
|
renderPackageResults(data, options = {}) {
|
|
17
26
|
const { showFailureOutput = true, maxOutputLength } = options;
|
|
27
|
+
const span = spanWriter(options);
|
|
18
28
|
if (!data || !Array.isArray(data.packages)) {
|
|
19
29
|
return '<pre>No results</pre>';
|
|
20
30
|
}
|
|
@@ -23,20 +33,20 @@ export const WebAdapter = {
|
|
|
23
33
|
const passed = data.passed || 0;
|
|
24
34
|
const failed = data.failed || 0;
|
|
25
35
|
// Header
|
|
26
|
-
lines.push(
|
|
36
|
+
lines.push(span(`Processing ${total} package(s)...`, StatusType.NEUTRAL, true));
|
|
27
37
|
lines.push('');
|
|
28
38
|
// Package results
|
|
29
39
|
for (const pkg of data.packages) {
|
|
30
40
|
const name = pkg.name || 'unknown';
|
|
31
41
|
const pkgPassed = pkg.passed;
|
|
32
42
|
// Package name in info color (blue)
|
|
33
|
-
lines.push(
|
|
43
|
+
lines.push(span(`> ${name}`, StatusType.INFO));
|
|
34
44
|
// Status indicator
|
|
35
45
|
if (pkgPassed) {
|
|
36
|
-
lines.push(
|
|
46
|
+
lines.push(span(' [PASS]', StatusType.SUCCESS));
|
|
37
47
|
}
|
|
38
48
|
else {
|
|
39
|
-
lines.push(
|
|
49
|
+
lines.push(span(' [FAIL]', StatusType.FAILURE));
|
|
40
50
|
}
|
|
41
51
|
// Show output for failed packages
|
|
42
52
|
if (!pkgPassed && showFailureOutput) {
|
|
@@ -47,20 +57,20 @@ export const WebAdapter = {
|
|
|
47
57
|
output = `${output.slice(0, maxOutputLength)}...`;
|
|
48
58
|
}
|
|
49
59
|
if (output) {
|
|
50
|
-
lines.push(
|
|
60
|
+
lines.push(span(output, StatusType.MUTED));
|
|
51
61
|
}
|
|
52
62
|
}
|
|
53
63
|
lines.push('');
|
|
54
64
|
}
|
|
55
65
|
// Summary
|
|
56
|
-
const summaryParts = [
|
|
66
|
+
const summaryParts = [span('Results: ', StatusType.NEUTRAL, true)];
|
|
57
67
|
if (passed > 0) {
|
|
58
|
-
summaryParts.push(
|
|
68
|
+
summaryParts.push(span(`${passed} passed`, StatusType.SUCCESS));
|
|
59
69
|
}
|
|
60
70
|
if (failed > 0) {
|
|
61
71
|
if (passed > 0)
|
|
62
72
|
summaryParts.push(', ');
|
|
63
|
-
summaryParts.push(
|
|
73
|
+
summaryParts.push(span(`${failed} failed`, StatusType.FAILURE));
|
|
64
74
|
}
|
|
65
75
|
lines.push(summaryParts.join(''));
|
|
66
76
|
return `<pre>${lines.join('<br>')}</pre>`;
|
|
@@ -68,35 +78,38 @@ export const WebAdapter = {
|
|
|
68
78
|
/**
|
|
69
79
|
* Render an error message.
|
|
70
80
|
*/
|
|
71
|
-
renderError(message) {
|
|
72
|
-
|
|
81
|
+
renderError(message, options = {}) {
|
|
82
|
+
const span = spanWriter(options);
|
|
83
|
+
return `<pre>${span(`Error: ${message}`, StatusType.FAILURE)}</pre>`;
|
|
73
84
|
},
|
|
74
85
|
/**
|
|
75
86
|
* Render a success message.
|
|
76
87
|
*/
|
|
77
|
-
renderSuccess(message) {
|
|
78
|
-
|
|
88
|
+
renderSuccess(message, options = {}) {
|
|
89
|
+
const span = spanWriter(options);
|
|
90
|
+
return `<pre>${span(message, StatusType.SUCCESS)}</pre>`;
|
|
79
91
|
},
|
|
80
92
|
/**
|
|
81
93
|
* Render a warning message.
|
|
82
94
|
*/
|
|
83
|
-
renderWarning(message) {
|
|
84
|
-
|
|
95
|
+
renderWarning(message, options = {}) {
|
|
96
|
+
const span = spanWriter(options);
|
|
97
|
+
return `<pre>${span(`Warning: ${message}`, StatusType.WARNING)}</pre>`;
|
|
85
98
|
},
|
|
86
99
|
/**
|
|
87
100
|
* Render a generic result with auto-detection.
|
|
88
101
|
*/
|
|
89
|
-
renderResult(result) {
|
|
102
|
+
renderResult(result, options = {}) {
|
|
90
103
|
if (result.success === false && result.error) {
|
|
91
104
|
const errorMsg = typeof result.error === 'object' && result.error !== null
|
|
92
105
|
? result.error.message || String(result.error)
|
|
93
106
|
: String(result.error);
|
|
94
|
-
return this.renderError(errorMsg);
|
|
107
|
+
return this.renderError(errorMsg, options);
|
|
95
108
|
}
|
|
96
109
|
const data = result.data;
|
|
97
110
|
// Check if it's package results
|
|
98
111
|
if (data?.packages && Array.isArray(data.packages)) {
|
|
99
|
-
return this.renderPackageResults(data);
|
|
112
|
+
return this.renderPackageResults(data, options);
|
|
100
113
|
}
|
|
101
114
|
// Fallback to JSON display
|
|
102
115
|
return `<pre>${escapeHtml(JSON.stringify(result.data, null, 2))}</pre>`;
|
|
@@ -104,14 +117,15 @@ export const WebAdapter = {
|
|
|
104
117
|
/**
|
|
105
118
|
* Render a CommandError with code, message, and optional suggestion.
|
|
106
119
|
*/
|
|
107
|
-
renderCommandError(error) {
|
|
120
|
+
renderCommandError(error, options = {}) {
|
|
121
|
+
const span = spanWriter(options);
|
|
108
122
|
const lines = [];
|
|
109
|
-
lines.push(
|
|
123
|
+
lines.push(span(`[${error.code}] ${error.message}`, StatusType.FAILURE, true));
|
|
110
124
|
if (error.suggestion) {
|
|
111
|
-
lines.push(
|
|
125
|
+
lines.push(span(`Suggestion: ${error.suggestion}`, StatusType.INFO));
|
|
112
126
|
}
|
|
113
127
|
if (error.details) {
|
|
114
|
-
lines.push(
|
|
128
|
+
lines.push(span(`Details: ${JSON.stringify(error.details)}`, StatusType.MUTED));
|
|
115
129
|
}
|
|
116
130
|
return `<pre>${lines.join('<br>')}</pre>`;
|
|
117
131
|
},
|
|
@@ -120,7 +134,8 @@ export const WebAdapter = {
|
|
|
120
134
|
* non-finite value renders as 0, so a server's bad value cannot throw after the command
|
|
121
135
|
* already succeeded.
|
|
122
136
|
*/
|
|
123
|
-
renderConfidence(rawConfidence, reasoning) {
|
|
137
|
+
renderConfidence(rawConfidence, reasoning, options = {}) {
|
|
138
|
+
const span = spanWriter(options);
|
|
124
139
|
const confidence = Number.isFinite(rawConfidence) ? Math.min(1, Math.max(0, rawConfidence)) : 0;
|
|
125
140
|
const pct = Math.round(confidence * 100);
|
|
126
141
|
const barWidth = 20;
|
|
@@ -137,37 +152,39 @@ export const WebAdapter = {
|
|
|
137
152
|
status = StatusType.FAILURE;
|
|
138
153
|
}
|
|
139
154
|
const lines = [];
|
|
140
|
-
lines.push(`${
|
|
155
|
+
lines.push(`${span(`Confidence: ${pct}%`, status, true)} ${span(bar, status)}`);
|
|
141
156
|
if (reasoning) {
|
|
142
|
-
lines.push(
|
|
157
|
+
lines.push(span(reasoning, StatusType.MUTED));
|
|
143
158
|
}
|
|
144
159
|
return `<pre>${lines.join('<br>')}</pre>`;
|
|
145
160
|
},
|
|
146
161
|
/**
|
|
147
162
|
* Render a list of warnings.
|
|
148
163
|
*/
|
|
149
|
-
renderWarnings(warnings) {
|
|
164
|
+
renderWarnings(warnings, options = {}) {
|
|
150
165
|
if (warnings.length === 0)
|
|
151
166
|
return '';
|
|
167
|
+
const span = spanWriter(options);
|
|
152
168
|
const lines = [];
|
|
153
|
-
lines.push(
|
|
169
|
+
lines.push(span(`${warnings.length} warning(s):`, StatusType.WARNING, true));
|
|
154
170
|
for (const warning of warnings) {
|
|
155
171
|
const prefix = warning.code ? `[${warning.code}] ` : '';
|
|
156
|
-
lines.push(
|
|
172
|
+
lines.push(span(` \u26A0 ${prefix}${warning.message}`, StatusType.WARNING));
|
|
157
173
|
}
|
|
158
174
|
return `<pre>${lines.join('<br>')}</pre>`;
|
|
159
175
|
},
|
|
160
176
|
/**
|
|
161
177
|
* Render pipeline step progress.
|
|
162
178
|
*/
|
|
163
|
-
renderPipelineSteps(steps) {
|
|
179
|
+
renderPipelineSteps(steps, options = {}) {
|
|
164
180
|
if (steps.length === 0)
|
|
165
181
|
return '<pre>No pipeline steps</pre>';
|
|
182
|
+
const span = spanWriter(options);
|
|
166
183
|
const lines = [];
|
|
167
184
|
const succeeded = steps.filter((s) => s.status === 'success').length;
|
|
168
185
|
const failed = steps.filter((s) => s.status === 'failure').length;
|
|
169
186
|
const skipped = steps.filter((s) => s.status === 'skipped').length;
|
|
170
|
-
lines.push(
|
|
187
|
+
lines.push(span(`Pipeline: ${steps.length} steps`, StatusType.NEUTRAL, true));
|
|
171
188
|
lines.push('');
|
|
172
189
|
for (const step of steps) {
|
|
173
190
|
let icon;
|
|
@@ -186,36 +203,36 @@ export const WebAdapter = {
|
|
|
186
203
|
}
|
|
187
204
|
const alias = step.alias ? ` (${step.alias})` : '';
|
|
188
205
|
const time = step.executionTimeMs !== undefined ? ` ${step.executionTimeMs.toFixed(1)}ms` : '';
|
|
189
|
-
lines.push(
|
|
206
|
+
lines.push(span(` ${icon} ${step.command}${alias}${time}`, status));
|
|
190
207
|
if (step.status === 'failure' && step.error) {
|
|
191
|
-
lines.push(
|
|
208
|
+
lines.push(span(` ${step.error.message ?? 'Unknown error'}`, StatusType.FAILURE));
|
|
192
209
|
}
|
|
193
210
|
}
|
|
194
211
|
lines.push('');
|
|
195
212
|
const summaryParts = [];
|
|
196
213
|
if (succeeded > 0)
|
|
197
|
-
summaryParts.push(
|
|
214
|
+
summaryParts.push(span(`${succeeded} passed`, StatusType.SUCCESS));
|
|
198
215
|
if (failed > 0)
|
|
199
|
-
summaryParts.push(
|
|
216
|
+
summaryParts.push(span(`${failed} failed`, StatusType.FAILURE));
|
|
200
217
|
if (skipped > 0)
|
|
201
|
-
summaryParts.push(
|
|
218
|
+
summaryParts.push(span(`${skipped} skipped`, StatusType.MUTED));
|
|
202
219
|
lines.push(summaryParts.join(', '));
|
|
203
220
|
return `<pre>${lines.join('<br>')}</pre>`;
|
|
204
221
|
},
|
|
205
222
|
/**
|
|
206
223
|
* Render a full CommandResult with all metadata sections.
|
|
207
224
|
*/
|
|
208
|
-
renderCommandResult(result) {
|
|
225
|
+
renderCommandResult(result, options = {}) {
|
|
209
226
|
const sections = [];
|
|
210
227
|
// Error section
|
|
211
228
|
if (!result.success && result.error) {
|
|
212
|
-
sections.push(this.renderCommandError(result.error));
|
|
229
|
+
sections.push(this.renderCommandError(result.error, options));
|
|
213
230
|
}
|
|
214
231
|
// Success data
|
|
215
232
|
if (result.success && result.data !== undefined) {
|
|
216
233
|
const data = result.data;
|
|
217
234
|
if (data?.packages && Array.isArray(data.packages)) {
|
|
218
|
-
sections.push(this.renderPackageResults(data));
|
|
235
|
+
sections.push(this.renderPackageResults(data, options));
|
|
219
236
|
}
|
|
220
237
|
else {
|
|
221
238
|
sections.push(`<pre>${escapeHtml(JSON.stringify(result.data, null, 2))}</pre>`);
|
|
@@ -223,11 +240,11 @@ export const WebAdapter = {
|
|
|
223
240
|
}
|
|
224
241
|
// Confidence
|
|
225
242
|
if (result.confidence !== undefined) {
|
|
226
|
-
sections.push(this.renderConfidence(result.confidence, result.reasoning));
|
|
243
|
+
sections.push(this.renderConfidence(result.confidence, result.reasoning, options));
|
|
227
244
|
}
|
|
228
245
|
// Warnings
|
|
229
246
|
if (result.warnings && result.warnings.length > 0) {
|
|
230
|
-
sections.push(this.renderWarnings(result.warnings));
|
|
247
|
+
sections.push(this.renderWarnings(result.warnings, options));
|
|
231
248
|
}
|
|
232
249
|
return sections.join('\n');
|
|
233
250
|
},
|
package/dist/web-adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-adapter.js","sourceRoot":"","sources":["../src/web-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"web-adapter.js","sourceRoot":"","sources":["../src/web-adapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAwB,MAAM,oBAAoB,CAAC;AAStE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEpD;;GAEG;AACH,SAAS,UAAU,CAAC,OAAsB;IACzC,OAAO,CAAC,IAAY,EAAE,MAAuB,EAAE,IAAI,GAAG,KAAK,EAAU,EAAE,CACtE,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB;;OAEG;IACH,oBAAoB,CAAC,IAAoB,EAAE,OAAO,GAAkB,EAAE;QACrE,MAAM,EAAE,iBAAiB,GAAG,IAAI,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;QAC9D,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAEjC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5C,OAAO,uBAAuB,CAAC;QAChC,CAAC;QAED,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QAEhC,SAAS;QACT,KAAK,CAAC,IAAI,CAAC,IAAI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C,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;QACpF,CAAC;QAED,WAAW;QACX,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;CACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lushly-dev/afd-adapters",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Frontend adapters for rendering AFD CommandResult to styled HTML",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"css"
|
|
18
18
|
],
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@vitest/coverage-v8": "^4.1.
|
|
21
|
-
"typescript": "^
|
|
22
|
-
"vitest": "^4.1.
|
|
23
|
-
"@lushly-dev/afd-core": "2.
|
|
20
|
+
"@vitest/coverage-v8": "^4.1.12",
|
|
21
|
+
"typescript": "^7.0.2",
|
|
22
|
+
"vitest": "^4.1.12",
|
|
23
|
+
"@lushly-dev/afd-core": "2.3.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@lushly-dev/afd-core": "^2.
|
|
26
|
+
"@lushly-dev/afd-core": "^2.3.0"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
29
|
"afd",
|