@action-state-group/capsule-viewer 0.0.0 → 0.1.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/LICENSE +201 -0
- package/LICENSE-BSD-3-Clause +28 -0
- package/README.md +23 -1
- package/dist/browser.d.ts +4 -0
- package/dist/browser.js +11 -0
- package/dist/browser.js.map +1 -0
- package/dist/compliance-presentation.d.ts +51 -0
- package/dist/compliance-presentation.js +140 -0
- package/dist/compliance-presentation.js.map +1 -0
- package/dist/compliance-styles.d.ts +8 -0
- package/dist/compliance-styles.js +66 -0
- package/dist/compliance-styles.js.map +1 -0
- package/dist/compliance-view.d.ts +6 -0
- package/dist/compliance-view.js +394 -0
- package/dist/compliance-view.js.map +1 -0
- package/dist/compliance.d.ts +92 -0
- package/dist/compliance.js +333 -0
- package/dist/compliance.js.map +1 -0
- package/dist/composed-view.d.ts +24 -0
- package/dist/composed-view.js +179 -0
- package/dist/composed-view.js.map +1 -0
- package/dist/emitter-shell.html +136 -0
- package/dist/emitter.d.ts +69 -0
- package/dist/emitter.js +266 -0
- package/dist/emitter.js.map +1 -0
- package/dist/evidence-graph-view.d.ts +96 -0
- package/dist/evidence-graph-view.js +1480 -0
- package/dist/evidence-graph-view.js.map +1 -0
- package/dist/evidence-graph.iife.js +11373 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/outcome-report-styles.d.ts +16 -0
- package/dist/outcome-report-styles.js +225 -0
- package/dist/outcome-report-styles.js.map +1 -0
- package/dist/outcome-report-view.d.ts +5 -0
- package/dist/outcome-report-view.js +885 -0
- package/dist/outcome-report-view.js.map +1 -0
- package/dist/presentation-builder.d.ts +247 -0
- package/dist/presentation-builder.js +552 -0
- package/dist/presentation-builder.js.map +1 -0
- package/dist/presentation-mount.d.ts +26 -0
- package/dist/presentation-mount.js +45 -0
- package/dist/presentation-mount.js.map +1 -0
- package/package.json +47 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Action State Group, Inc.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its contributors
|
|
16
|
+
may be used to endorse or promote products derived from this software
|
|
17
|
+
without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
1
|
# @action-state-group/capsule-viewer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
capsule-viewer's page emitter and presentation builder: they turn an
|
|
4
|
+
[Agent Action Capsule](https://github.com/action-state-group/agent-action-capsule)
|
|
5
|
+
Evidence Bundle into a self-contained HTML page under AAC's presentation
|
|
6
|
+
contract (`spec/presentation-contract-v0.md`). The Go twin,
|
|
7
|
+
`github.com/action-state-group/capsule-viewer/go/emitter`, emits the same
|
|
8
|
+
bytes; both are held to shared goldens in `go/emitter/testdata`.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import {
|
|
12
|
+
buildPresentation,
|
|
13
|
+
emitEvidenceGraphHtml,
|
|
14
|
+
} from "@action-state-group/capsule-viewer";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The in-browser renderer (`renderEvidenceGraph`) ships bundled as
|
|
18
|
+
`dist/evidence-graph.iife.js`, for a page's core runtime slot. Bundle verification comes from
|
|
19
|
+
`@action-state-group/agent-action-capsule`.
|
|
20
|
+
|
|
21
|
+
The code moved here from agent-action-capsule (agent-action-capsule#281) and
|
|
22
|
+
keeps its BSD-3-Clause license (`LICENSE-BSD-3-Clause`); the rest of the
|
|
23
|
+
package is Apache-2.0 (`LICENSE`).
|
|
24
|
+
|
|
25
|
+
Releases follow [RELEASING.md](https://github.com/action-state-group/capsule-viewer/blob/main/RELEASING.md).
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// The in-browser renderer the emitted page runs. It is published only as
|
|
3
|
+
// dist/evidence-graph.iife.js (`npm run emitter:iife`), which exposes
|
|
4
|
+
// renderEvidenceGraph, and not as a package export: under the browser
|
|
5
|
+
// condition @action-state-group/agent-action-capsule 0.1.1 lacks modules it
|
|
6
|
+
// imports, which only the bundling plugin (scripts/aac-browser.mjs) supplies.
|
|
7
|
+
export * from "./evidence-graph-view.js";
|
|
8
|
+
export * from "./outcome-report-view.js";
|
|
9
|
+
export * from "./compliance-view.js";
|
|
10
|
+
export * from "./presentation-mount.js";
|
|
11
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,sEAAsE;AACtE,sEAAsE;AACtE,4EAA4E;AAC5E,8EAA8E;AAC9E,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `eu-ai-act-compliance/v1` typed extension: opts a verified Result v0
|
|
3
|
+
* bundle into the EU AI Act obligations-report card, read only after the
|
|
4
|
+
* bundle verified, and carries the producer's REGULATORY MAPPING for it:
|
|
5
|
+
* per obligation its article, title, plain-language summary, applicability
|
|
6
|
+
* and method; per test its short label, an optional not-evaluable note and
|
|
7
|
+
* an optional finding template (severity, recommendation, owner).
|
|
8
|
+
*
|
|
9
|
+
* Everything read here is presentation, outside the signed records, and the
|
|
10
|
+
* card labels it so. Which obligations and tests exist, every verdict and
|
|
11
|
+
* count, each test's wording and tier, and the pack come from the sealed
|
|
12
|
+
* claims and reports (compliance.ts), never from this block.
|
|
13
|
+
*/
|
|
14
|
+
export interface ComplianceFinding {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly severity: string;
|
|
17
|
+
readonly recommendation: string;
|
|
18
|
+
readonly ownerDue: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ComplianceRow {
|
|
21
|
+
readonly criterionId: string;
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly notEvaluableNote?: string;
|
|
24
|
+
readonly finding?: ComplianceFinding;
|
|
25
|
+
}
|
|
26
|
+
export interface ComplianceApplicability {
|
|
27
|
+
readonly status: "in_force" | "future";
|
|
28
|
+
readonly note: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ComplianceObligation {
|
|
31
|
+
readonly key: string;
|
|
32
|
+
readonly article: string;
|
|
33
|
+
readonly title: string;
|
|
34
|
+
readonly plain: string;
|
|
35
|
+
readonly judgedTerms: readonly string[];
|
|
36
|
+
readonly applicability: ComplianceApplicability;
|
|
37
|
+
readonly method: string;
|
|
38
|
+
readonly rows: readonly ComplianceRow[];
|
|
39
|
+
}
|
|
40
|
+
export interface ComplianceQualityProtocol {
|
|
41
|
+
readonly protocol?: string;
|
|
42
|
+
readonly cadence?: string;
|
|
43
|
+
readonly note?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface CompliancePresentation {
|
|
46
|
+
readonly enabled: boolean;
|
|
47
|
+
readonly regulation: string;
|
|
48
|
+
readonly obligations: readonly ComplianceObligation[];
|
|
49
|
+
readonly qualityProtocol?: ComplianceQualityProtocol;
|
|
50
|
+
}
|
|
51
|
+
export declare function readCompliancePresentation(bundle: unknown): CompliancePresentation | undefined;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
/**
|
|
3
|
+
* `eu-ai-act-compliance/v1` typed extension: opts a verified Result v0
|
|
4
|
+
* bundle into the EU AI Act obligations-report card, read only after the
|
|
5
|
+
* bundle verified, and carries the producer's REGULATORY MAPPING for it:
|
|
6
|
+
* per obligation its article, title, plain-language summary, applicability
|
|
7
|
+
* and method; per test its short label, an optional not-evaluable note and
|
|
8
|
+
* an optional finding template (severity, recommendation, owner).
|
|
9
|
+
*
|
|
10
|
+
* Everything read here is presentation, outside the signed records, and the
|
|
11
|
+
* card labels it so. Which obligations and tests exist, every verdict and
|
|
12
|
+
* count, each test's wording and tier, and the pack come from the sealed
|
|
13
|
+
* claims and reports (compliance.ts), never from this block.
|
|
14
|
+
*/
|
|
15
|
+
function object(value) {
|
|
16
|
+
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
17
|
+
? value
|
|
18
|
+
: undefined;
|
|
19
|
+
}
|
|
20
|
+
function str(value) {
|
|
21
|
+
return typeof value === "string" ? value : undefined;
|
|
22
|
+
}
|
|
23
|
+
function strArray(value) {
|
|
24
|
+
return Array.isArray(value)
|
|
25
|
+
? value.filter((v) => typeof v === "string")
|
|
26
|
+
: [];
|
|
27
|
+
}
|
|
28
|
+
function readFinding(value) {
|
|
29
|
+
const obj = object(value);
|
|
30
|
+
const id = str(obj?.id);
|
|
31
|
+
const severity = str(obj?.severity);
|
|
32
|
+
const recommendation = str(obj?.recommendation);
|
|
33
|
+
const ownerDue = str(obj?.owner_due);
|
|
34
|
+
if (id === undefined ||
|
|
35
|
+
severity === undefined ||
|
|
36
|
+
recommendation === undefined ||
|
|
37
|
+
ownerDue === undefined)
|
|
38
|
+
return undefined;
|
|
39
|
+
return { id, severity, recommendation, ownerDue };
|
|
40
|
+
}
|
|
41
|
+
function readRow(value) {
|
|
42
|
+
const obj = object(value);
|
|
43
|
+
const criterionId = str(obj?.criterion_id);
|
|
44
|
+
const name = str(obj?.name);
|
|
45
|
+
if (criterionId === undefined || name === undefined)
|
|
46
|
+
return undefined;
|
|
47
|
+
const notEvaluableNote = str(obj?.not_evaluable_note);
|
|
48
|
+
const finding = obj?.finding === undefined ? undefined : readFinding(obj.finding);
|
|
49
|
+
return {
|
|
50
|
+
criterionId,
|
|
51
|
+
name,
|
|
52
|
+
...(notEvaluableNote === undefined ? {} : { notEvaluableNote }),
|
|
53
|
+
...(finding === undefined ? {} : { finding }),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function readApplicability(value) {
|
|
57
|
+
const obj = object(value);
|
|
58
|
+
const status = obj?.status === "in_force" || obj?.status === "future"
|
|
59
|
+
? obj.status
|
|
60
|
+
: undefined;
|
|
61
|
+
const note = str(obj?.note);
|
|
62
|
+
if (status === undefined || note === undefined)
|
|
63
|
+
return undefined;
|
|
64
|
+
return { status, note };
|
|
65
|
+
}
|
|
66
|
+
function readObligation(value) {
|
|
67
|
+
const obj = object(value);
|
|
68
|
+
const key = str(obj?.key);
|
|
69
|
+
const article = str(obj?.article);
|
|
70
|
+
const title = str(obj?.title);
|
|
71
|
+
const plain = str(obj?.plain);
|
|
72
|
+
const method = str(obj?.method);
|
|
73
|
+
const applicability = readApplicability(obj?.applicability);
|
|
74
|
+
if (key === undefined ||
|
|
75
|
+
article === undefined ||
|
|
76
|
+
title === undefined ||
|
|
77
|
+
plain === undefined ||
|
|
78
|
+
method === undefined ||
|
|
79
|
+
applicability === undefined)
|
|
80
|
+
return undefined;
|
|
81
|
+
const rows = Array.isArray(obj?.rows)
|
|
82
|
+
? obj.rows.flatMap((r) => {
|
|
83
|
+
const row = readRow(r);
|
|
84
|
+
return row === undefined ? [] : [row];
|
|
85
|
+
})
|
|
86
|
+
: [];
|
|
87
|
+
return {
|
|
88
|
+
key,
|
|
89
|
+
article,
|
|
90
|
+
title,
|
|
91
|
+
plain,
|
|
92
|
+
judgedTerms: strArray(obj?.judged_terms),
|
|
93
|
+
applicability,
|
|
94
|
+
method,
|
|
95
|
+
rows,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function readQualityProtocol(value) {
|
|
99
|
+
const obj = object(value);
|
|
100
|
+
if (obj === undefined)
|
|
101
|
+
return undefined;
|
|
102
|
+
const protocol = str(obj.protocol);
|
|
103
|
+
const cadence = str(obj.cadence);
|
|
104
|
+
const note = str(obj.note);
|
|
105
|
+
if (protocol === undefined && cadence === undefined && note === undefined)
|
|
106
|
+
return undefined;
|
|
107
|
+
return {
|
|
108
|
+
...(protocol === undefined ? {} : { protocol }),
|
|
109
|
+
...(cadence === undefined ? {} : { cadence }),
|
|
110
|
+
...(note === undefined ? {} : { note }),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export function readCompliancePresentation(bundle) {
|
|
114
|
+
const top = object(bundle);
|
|
115
|
+
const extensions = object(top?.extensions);
|
|
116
|
+
const block = object(extensions?.["eu-ai-act-compliance/v1"]);
|
|
117
|
+
if (block === undefined || block.enabled !== true)
|
|
118
|
+
return undefined;
|
|
119
|
+
const regulation = str(block.regulation) ?? "Regulation (EU) 2024/1689";
|
|
120
|
+
const obligations = Array.isArray(block.obligations)
|
|
121
|
+
? block.obligations.flatMap((o) => {
|
|
122
|
+
const obligation = readObligation(o);
|
|
123
|
+
return obligation === undefined ? [] : [obligation];
|
|
124
|
+
})
|
|
125
|
+
: [];
|
|
126
|
+
// Absent is never pass: a block with `enabled: true` but zero recognizable
|
|
127
|
+
// obligations is not a usable card -- treated the same as not enabled at
|
|
128
|
+
// all, falling back to the generic Result page rather than rendering an
|
|
129
|
+
// empty shell.
|
|
130
|
+
if (obligations.length === 0)
|
|
131
|
+
return undefined;
|
|
132
|
+
const qualityProtocol = readQualityProtocol(block.quality_protocol);
|
|
133
|
+
return {
|
|
134
|
+
enabled: true,
|
|
135
|
+
regulation,
|
|
136
|
+
obligations,
|
|
137
|
+
...(qualityProtocol === undefined ? {} : { qualityProtocol }),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=compliance-presentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compliance-presentation.js","sourceRoot":"","sources":["../src/compliance-presentation.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC;;;;;;;;;;;;GAYG;AAEH,SAAS,MAAM,CAAC,KAAc;IAC5B,O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AU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QACtD,CAAC,CAAC;QACJ,CAAC,CAAC,EAAE,CAAC;IACP,2EAA2E;IAC3E,yEAAyE;IACzE,wEAAwE;IACxE,eAAe;IACf,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC/C,MAAM,eAAe,GAAG,mBAAmB,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACpE,OAAO;QACL,OAAO,EAAE,IAAI;QACb,UAAU;QACV,WAAW;QACX,GAAG,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC;KAC9D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The compliance card's own stylesheet, trimmed to the sections this card
|
|
3
|
+
* renders (summary, test results, findings, sessions drill-down via native
|
|
4
|
+
* `<details>`, quality protocol, run info) and scoped under `.cc` on every
|
|
5
|
+
* selector, so it can never leak onto, or be affected by, the verification
|
|
6
|
+
* page or any other card on the same document.
|
|
7
|
+
*/
|
|
8
|
+
export declare const COMPLIANCE_CSS = "\n.cc{--navy:#232F42;--gold:#E8A33D;--gold-l:#FBEFD9;--cream:#F6F2EA;--line:#E3DED3;--slate:#6B7482;--ink:#1F2733;--ok:#2E7D5B;--ok-l:#E3F1EA;--bad:#B5462F;--bad-l:#F8E6E1;--person:#5B4BA0;--person-l:#ECE8F7;--r:14px;\n font:16px/1.5 -apple-system,BlinkMacSystemFont,\"Segoe UI\",Inter,Helvetica,Arial,sans-serif;color:var(--ink);background:#fff;display:block;max-width:1080px;margin:26px auto;padding:0 28px}\n.cc *{box-sizing:border-box}\n.cc h1,.cc h2,.cc h3{font-family:Georgia,\"Iowan Old Style\",Cambria,serif;color:var(--navy);margin:0}\n.cc a{color:var(--navy);cursor:pointer}\n.cc .hd{background:var(--navy);color:#fff;padding:28px 32px;border-radius:var(--r) var(--r) 0 0;margin-top:20px}\n.cc .hd .kicker{font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:#C9CED6}\n.cc .hd h1{color:#fff;font-size:28px;margin:6px 0 4px}\n.cc .hd .sub{color:#DDE1E7;font-size:15px}\n.cc section{padding:28px 32px;border:1px solid var(--line);border-top:0}\n.cc section h2{font-size:21px;margin-bottom:10px}\n.cc .lede{color:var(--slate);margin:0 0 16px;max-width:760px}\n.cc table.grid{width:100%;border-collapse:collapse;font-size:14.5px}\n.cc table.grid th{text-align:left;font-size:11.5px;letter-spacing:.05em;text-transform:uppercase;color:var(--slate);border-bottom:2px solid var(--navy);padding:8px 10px}\n.cc table.grid td{border-bottom:1px solid var(--line);padding:10px;vertical-align:top}\n.cc table.grid td.n{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}\n.cc .kind{display:inline-block;font-size:11px;font-weight:700;padding:2px 8px;border-radius:99px;text-transform:uppercase;letter-spacing:.03em}\n.cc .kind.judged{background:var(--person-l);color:var(--person)}\n.cc .kind.recomputed{background:#E6EEF6;color:#2B5A85}\n.cc .kind.unstated{background:var(--cream);color:var(--slate)}\n.cc .tx{margin:8px 0 4px;font-size:13px}\n.cc .tx .turn{padding:3px 0;border-top:1px solid var(--line);white-space:pre-wrap}\n.cc .tx code{font-size:12px;color:var(--slate)}\n.cc .hd .na{color:var(--ink)}\n.cc .st{font-weight:700;font-size:13px}\n.cc .st.ok{color:var(--ok)}.cc .st.exc{color:var(--bad)}.cc .st.ne{color:#8A93A6}.cc .st.future{color:var(--gold)}\n.cc .fnd{border:1px solid var(--line);border-radius:12px;padding:14px 18px;margin-bottom:12px}\n.cc .fnd .fh{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:8px}\n.cc .fnd .fh b{color:var(--navy)}\n.cc .sev{font-size:11px;font-weight:700;padding:2px 9px;border-radius:99px;text-transform:uppercase}\n.cc .sev.high{background:var(--bad-l);color:var(--bad)}\n.cc .sev.medium{background:var(--gold-l);color:#8A6A2F}\n.cc .sev.low{background:var(--ok-l);color:var(--ok)}\n.cc .fnd table.fk{width:100%;font-size:14px}\n.cc .fnd table.fk th{text-align:left;color:var(--slate);font-weight:600;width:140px;vertical-align:top;padding:4px 0}\n.cc .fnd table.fk td{padding:4px 0}\n.cc details{margin-top:8px;border:1px solid var(--line);border-radius:10px;padding:8px 14px}\n.cc details > summary{cursor:pointer;color:var(--navy);font-weight:600;font-size:14px}\n.cc details.session{margin:8px 0 0 16px}\n.cc .sessrow{display:flex;gap:10px;align-items:center;padding:6px 0;font-size:14px}\n.cc .sessrow code{font-size:12px;color:var(--slate)}\n.cc .tk{display:inline-block;width:20px;height:20px;border-radius:6px;text-align:center;line-height:20px;font-size:12px;margin-left:3px}\n.cc .tk.y{background:var(--ok-l);color:var(--ok)}.cc .tk.n{background:var(--bad-l);color:var(--bad)}.cc .tk.ne{background:#EDEFF2;color:#8A93A6}\n.cc .ck{border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin:8px 0;font-size:14px}\n.cc .ck .h{display:flex;gap:8px;align-items:center;font-weight:700;color:var(--navy)}\n.cc .ck .why{margin-top:4px;color:var(--ink)}\n.cc .ck .ev{margin-top:4px;font-size:12px;color:var(--slate)}\n.cc .ck .ev code{background:var(--cream);padding:1px 6px;border-radius:5px;margin-right:4px}\n.cc .na{margin-top:16px;font-size:13px;color:var(--slate);background:var(--cream);border-radius:10px;padding:10px 14px}\n.cc .ran{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}\n.cc .ran .it{background:var(--cream);border-radius:10px;padding:10px 12px}\n.cc .ran .k{font-size:12.5px;color:var(--slate)}\n.cc .ran .v{font-weight:600;color:var(--navy);word-break:break-word;font-size:13.5px}\n.cc .applic{font-size:13px;color:var(--slate)}\n@media (max-width:760px){.cc .ran{grid-template-columns:1fr}}\n";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
/**
|
|
3
|
+
* The compliance card's own stylesheet, trimmed to the sections this card
|
|
4
|
+
* renders (summary, test results, findings, sessions drill-down via native
|
|
5
|
+
* `<details>`, quality protocol, run info) and scoped under `.cc` on every
|
|
6
|
+
* selector, so it can never leak onto, or be affected by, the verification
|
|
7
|
+
* page or any other card on the same document.
|
|
8
|
+
*/
|
|
9
|
+
export const COMPLIANCE_CSS = `
|
|
10
|
+
.cc{--navy:#232F42;--gold:#E8A33D;--gold-l:#FBEFD9;--cream:#F6F2EA;--line:#E3DED3;--slate:#6B7482;--ink:#1F2733;--ok:#2E7D5B;--ok-l:#E3F1EA;--bad:#B5462F;--bad-l:#F8E6E1;--person:#5B4BA0;--person-l:#ECE8F7;--r:14px;
|
|
11
|
+
font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Helvetica,Arial,sans-serif;color:var(--ink);background:#fff;display:block;max-width:1080px;margin:26px auto;padding:0 28px}
|
|
12
|
+
.cc *{box-sizing:border-box}
|
|
13
|
+
.cc h1,.cc h2,.cc h3{font-family:Georgia,"Iowan Old Style",Cambria,serif;color:var(--navy);margin:0}
|
|
14
|
+
.cc a{color:var(--navy);cursor:pointer}
|
|
15
|
+
.cc .hd{background:var(--navy);color:#fff;padding:28px 32px;border-radius:var(--r) var(--r) 0 0;margin-top:20px}
|
|
16
|
+
.cc .hd .kicker{font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:#C9CED6}
|
|
17
|
+
.cc .hd h1{color:#fff;font-size:28px;margin:6px 0 4px}
|
|
18
|
+
.cc .hd .sub{color:#DDE1E7;font-size:15px}
|
|
19
|
+
.cc section{padding:28px 32px;border:1px solid var(--line);border-top:0}
|
|
20
|
+
.cc section h2{font-size:21px;margin-bottom:10px}
|
|
21
|
+
.cc .lede{color:var(--slate);margin:0 0 16px;max-width:760px}
|
|
22
|
+
.cc table.grid{width:100%;border-collapse:collapse;font-size:14.5px}
|
|
23
|
+
.cc table.grid th{text-align:left;font-size:11.5px;letter-spacing:.05em;text-transform:uppercase;color:var(--slate);border-bottom:2px solid var(--navy);padding:8px 10px}
|
|
24
|
+
.cc table.grid td{border-bottom:1px solid var(--line);padding:10px;vertical-align:top}
|
|
25
|
+
.cc table.grid td.n{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
|
|
26
|
+
.cc .kind{display:inline-block;font-size:11px;font-weight:700;padding:2px 8px;border-radius:99px;text-transform:uppercase;letter-spacing:.03em}
|
|
27
|
+
.cc .kind.judged{background:var(--person-l);color:var(--person)}
|
|
28
|
+
.cc .kind.recomputed{background:#E6EEF6;color:#2B5A85}
|
|
29
|
+
.cc .kind.unstated{background:var(--cream);color:var(--slate)}
|
|
30
|
+
.cc .tx{margin:8px 0 4px;font-size:13px}
|
|
31
|
+
.cc .tx .turn{padding:3px 0;border-top:1px solid var(--line);white-space:pre-wrap}
|
|
32
|
+
.cc .tx code{font-size:12px;color:var(--slate)}
|
|
33
|
+
.cc .hd .na{color:var(--ink)}
|
|
34
|
+
.cc .st{font-weight:700;font-size:13px}
|
|
35
|
+
.cc .st.ok{color:var(--ok)}.cc .st.exc{color:var(--bad)}.cc .st.ne{color:#8A93A6}.cc .st.future{color:var(--gold)}
|
|
36
|
+
.cc .fnd{border:1px solid var(--line);border-radius:12px;padding:14px 18px;margin-bottom:12px}
|
|
37
|
+
.cc .fnd .fh{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
|
|
38
|
+
.cc .fnd .fh b{color:var(--navy)}
|
|
39
|
+
.cc .sev{font-size:11px;font-weight:700;padding:2px 9px;border-radius:99px;text-transform:uppercase}
|
|
40
|
+
.cc .sev.high{background:var(--bad-l);color:var(--bad)}
|
|
41
|
+
.cc .sev.medium{background:var(--gold-l);color:#8A6A2F}
|
|
42
|
+
.cc .sev.low{background:var(--ok-l);color:var(--ok)}
|
|
43
|
+
.cc .fnd table.fk{width:100%;font-size:14px}
|
|
44
|
+
.cc .fnd table.fk th{text-align:left;color:var(--slate);font-weight:600;width:140px;vertical-align:top;padding:4px 0}
|
|
45
|
+
.cc .fnd table.fk td{padding:4px 0}
|
|
46
|
+
.cc details{margin-top:8px;border:1px solid var(--line);border-radius:10px;padding:8px 14px}
|
|
47
|
+
.cc details > summary{cursor:pointer;color:var(--navy);font-weight:600;font-size:14px}
|
|
48
|
+
.cc details.session{margin:8px 0 0 16px}
|
|
49
|
+
.cc .sessrow{display:flex;gap:10px;align-items:center;padding:6px 0;font-size:14px}
|
|
50
|
+
.cc .sessrow code{font-size:12px;color:var(--slate)}
|
|
51
|
+
.cc .tk{display:inline-block;width:20px;height:20px;border-radius:6px;text-align:center;line-height:20px;font-size:12px;margin-left:3px}
|
|
52
|
+
.cc .tk.y{background:var(--ok-l);color:var(--ok)}.cc .tk.n{background:var(--bad-l);color:var(--bad)}.cc .tk.ne{background:#EDEFF2;color:#8A93A6}
|
|
53
|
+
.cc .ck{border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin:8px 0;font-size:14px}
|
|
54
|
+
.cc .ck .h{display:flex;gap:8px;align-items:center;font-weight:700;color:var(--navy)}
|
|
55
|
+
.cc .ck .why{margin-top:4px;color:var(--ink)}
|
|
56
|
+
.cc .ck .ev{margin-top:4px;font-size:12px;color:var(--slate)}
|
|
57
|
+
.cc .ck .ev code{background:var(--cream);padding:1px 6px;border-radius:5px;margin-right:4px}
|
|
58
|
+
.cc .na{margin-top:16px;font-size:13px;color:var(--slate);background:var(--cream);border-radius:10px;padding:10px 14px}
|
|
59
|
+
.cc .ran{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
|
|
60
|
+
.cc .ran .it{background:var(--cream);border-radius:10px;padding:10px 12px}
|
|
61
|
+
.cc .ran .k{font-size:12.5px;color:var(--slate)}
|
|
62
|
+
.cc .ran .v{font-weight:600;color:var(--navy);word-break:break-word;font-size:13.5px}
|
|
63
|
+
.cc .applic{font-size:13px;color:var(--slate)}
|
|
64
|
+
@media (max-width:760px){.cc .ran{grid-template-columns:1fr}}
|
|
65
|
+
`;
|
|
66
|
+
//# sourceMappingURL=compliance-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compliance-styles.js","sourceRoot":"","sources":["../src/compliance-styles.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwD7B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BundleVerificationResult } from "@action-state-group/agent-action-capsule";
|
|
2
|
+
import { type ComplianceModel, type ComplianceFindingModel, type ObligationModel, type ObligationRowModel, type Session, type SessionTest } from "./compliance.js";
|
|
3
|
+
import type { CompliancePresentation } from "./compliance-presentation.js";
|
|
4
|
+
import type { ResultRoot } from "@action-state-group/agent-action-capsule";
|
|
5
|
+
export declare function renderCompliancePage(result: ResultRoot, presentation: CompliancePresentation, _bundle: unknown, _verified: BundleVerificationResult, root: HTMLElement): void;
|
|
6
|
+
export type { ComplianceModel, ComplianceFindingModel, ObligationModel, ObligationRowModel, Session, SessionTest, };
|