@action-state-group/capsule-viewer 0.0.0 → 0.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.
Files changed (95) hide show
  1. package/LICENSE +201 -0
  2. package/LICENSE-BSD-3-Clause +28 -0
  3. package/README.md +94 -1
  4. package/dist/alias-interpreters.d.ts +18 -0
  5. package/dist/alias-interpreters.js +50 -0
  6. package/dist/alias-interpreters.js.map +1 -0
  7. package/dist/browser.d.ts +7 -0
  8. package/dist/browser.js +25 -0
  9. package/dist/browser.js.map +1 -0
  10. package/dist/builtin-manifests.d.ts +51 -0
  11. package/dist/builtin-manifests.js +196 -0
  12. package/dist/builtin-manifests.js.map +1 -0
  13. package/dist/compliance-presentation.d.ts +51 -0
  14. package/dist/compliance-presentation.js +140 -0
  15. package/dist/compliance-presentation.js.map +1 -0
  16. package/dist/compliance-styles.d.ts +1 -0
  17. package/dist/compliance-styles.js +104 -0
  18. package/dist/compliance-styles.js.map +1 -0
  19. package/dist/compliance-view.d.ts +46 -0
  20. package/dist/compliance-view.js +828 -0
  21. package/dist/compliance-view.js.map +1 -0
  22. package/dist/compliance.d.ts +121 -0
  23. package/dist/compliance.js +412 -0
  24. package/dist/compliance.js.map +1 -0
  25. package/dist/composed-styles.d.ts +12 -0
  26. package/dist/composed-styles.js +20 -0
  27. package/dist/composed-styles.js.map +1 -0
  28. package/dist/composed-view.d.ts +24 -0
  29. package/dist/composed-view.js +186 -0
  30. package/dist/composed-view.js.map +1 -0
  31. package/dist/contract-report-wording.d.ts +195 -0
  32. package/dist/contract-report-wording.js +1141 -0
  33. package/dist/contract-report-wording.js.map +1 -0
  34. package/dist/contract-report.d.ts +92 -0
  35. package/dist/contract-report.js +63 -0
  36. package/dist/contract-report.js.map +1 -0
  37. package/dist/emitter-shell.html +310 -0
  38. package/dist/emitter.d.ts +105 -0
  39. package/dist/emitter.js +329 -0
  40. package/dist/emitter.js.map +1 -0
  41. package/dist/evidence-graph-view.d.ts +149 -0
  42. package/dist/evidence-graph-view.js +2718 -0
  43. package/dist/evidence-graph-view.js.map +1 -0
  44. package/dist/evidence-graph.iife.js +18159 -0
  45. package/dist/frame-tokens.generated.d.ts +3 -0
  46. package/dist/frame-tokens.generated.js +5 -0
  47. package/dist/frame-tokens.generated.js.map +1 -0
  48. package/dist/index.d.ts +5 -0
  49. package/dist/index.js +12 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/outcome-report-presentation.d.ts +48 -0
  52. package/dist/outcome-report-presentation.js +90 -0
  53. package/dist/outcome-report-presentation.js.map +1 -0
  54. package/dist/outcome-report-styles.d.ts +1 -0
  55. package/dist/outcome-report-styles.js +228 -0
  56. package/dist/outcome-report-styles.js.map +1 -0
  57. package/dist/outcome-report-view.d.ts +78 -0
  58. package/dist/outcome-report-view.js +1488 -0
  59. package/dist/outcome-report-view.js.map +1 -0
  60. package/dist/presentation-builder.d.ts +296 -0
  61. package/dist/presentation-builder.js +646 -0
  62. package/dist/presentation-builder.js.map +1 -0
  63. package/dist/presentation-fragment.d.ts +129 -0
  64. package/dist/presentation-fragment.js +213 -0
  65. package/dist/presentation-fragment.js.map +1 -0
  66. package/dist/presentation-mount.d.ts +26 -0
  67. package/dist/presentation-mount.js +45 -0
  68. package/dist/presentation-mount.js.map +1 -0
  69. package/dist/presentation-registry.d.ts +277 -0
  70. package/dist/presentation-registry.js +416 -0
  71. package/dist/presentation-registry.js.map +1 -0
  72. package/dist/record-content.d.ts +68 -0
  73. package/dist/record-content.js +153 -0
  74. package/dist/record-content.js.map +1 -0
  75. package/dist/record-dating.d.ts +10 -0
  76. package/dist/record-dating.js +76 -0
  77. package/dist/record-dating.js.map +1 -0
  78. package/dist/report-front-styles.d.ts +9 -0
  79. package/dist/report-front-styles.js +55 -0
  80. package/dist/report-front-styles.js.map +1 -0
  81. package/dist/report-front.d.ts +78 -0
  82. package/dist/report-front.js +274 -0
  83. package/dist/report-front.js.map +1 -0
  84. package/dist/report-levels.d.ts +206 -0
  85. package/dist/report-levels.js +739 -0
  86. package/dist/report-levels.js.map +1 -0
  87. package/dist/report-provenance.d.ts +111 -0
  88. package/dist/report-provenance.js +535 -0
  89. package/dist/report-provenance.js.map +1 -0
  90. package/dist/viewer-build.d.ts +37 -0
  91. package/dist/viewer-build.js +29 -0
  92. package/dist/viewer-build.js.map +1 -0
  93. package/dist/wording/contract-report-eu-ai-act.en.json +295 -0
  94. package/dist/wording/contract-report-outcomes.en.json +394 -0
  95. package/package.json +48 -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,96 @@
1
1
  # @action-state-group/capsule-viewer
2
2
 
3
- Placeholder. Real releases start at 0.1.0, published from https://github.com/action-state-group/capsule-viewer.
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, and the Go
19
+ module ships the same build as `go/pageruntime`. Bundle verification comes from
20
+ `@action-state-group/agent-action-capsule`. Besides `registerPresentation`,
21
+ the runtime's global `EvidenceGraph` carries the verifier functions a
22
+ presentation module may call: `disclosureOf`, `ed25519Available`,
23
+ `verifiedPayload`, `verifyDisclosureEnvelope` and `verifyProducerEnvelope`.
24
+
25
+ The code moved here from agent-action-capsule (agent-action-capsule#281) and
26
+ keeps its BSD-3-Clause license (`LICENSE-BSD-3-Clause`); the rest of the
27
+ package is Apache-2.0 (`LICENSE`).
28
+
29
+ ## Tuning the contract-report module's words
30
+
31
+ The contract-report module (`src/contract-report.ts`) resolves on
32
+ `contract-report/v1` (agent-action-capsule spec/contract-report-v1.md),
33
+ registered in place of `aac.builtin.result-contract-report/v0`. It draws
34
+ one of two layouts -- `lines` (the Outcomes report) or `groups` (the EU AI
35
+ Act Results) -- each with its own bundled default wording pack
36
+ (`src/wording/contract-report-outcomes.en.json`,
37
+ `src/wording/contract-report-eu-ai-act.en.json`). A host passes its own
38
+ pack as the page's `wording`; its entries replace the default pack's,
39
+ entry by entry.
40
+
41
+ **The module's own keys** sit under `card.*` (shared by both layouts: the
42
+ front block, dating, the proofs), `lines.*` (the Outcomes report only) and
43
+ `groups.*` (the EU AI Act Results only) -- plus the shared `prov.*`,
44
+ `chat.*`, `case.*` and `judge.*` prefixes. These are never contract-report/v1
45
+ section 3 keys: a pack cannot use them to set something section 3 owns, and
46
+ the module never uses a section 3 prefix for its own concepts. `card.pf.*`
47
+ is the per-claim proofs line (`card.pf.assurance`, `card.pf.assurance.line`,
48
+ `card.pf.wording`, `card.pf.wording.refused`, ...); `card.wording.refused` is
49
+ the visible notice a refused host layer draws.
50
+
51
+ **The section 3 keys this module reads**, and where each shows:
52
+
53
+ | Key | Shows |
54
+ | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
55
+ | `report.title` | The card's heading (aliased onto `lines.title` / `groups.kicker`). |
56
+ | `report.summary` | One line under the title, drawn only when set (`reportSummary`, `report-levels.ts`). |
57
+ | `group.<segment>.title` | A group's heading -- the part of a row's `requirement_ref` before its first `.` (EU AI Act obligation headings; the Outcomes report's check groups). |
58
+ | `row.<requirement_ref>.label` | A row's name, in place of the producer's label or the id made readable. |
59
+ | `row.<requirement_ref>.detail` | A row's explanation, drawn beside its name when set. |
60
+ | `row.<requirement_ref>.not_evaluable` | The note shown when a row's claims are not evaluable, in place of the module's own note. |
61
+ | `verdict.met`, `.not_met`, `.not_evaluable`, `.out_of_scope` | Aliased onto the layout's own verdict words (`lines.verdict.*` / `groups.verdict.*`, and the Outcomes proofs' `lines.pf.verdict.*`): every pill and cell that draws that verdict. |
62
+ | `tier.recomputed`, `.judged` | Aliased onto the layout's own tier badge words. |
63
+ | `grade.self-attested`, `.witnessed`, `.countersigned` | Each claim's assurance line in its proofs (`assuranceRow`); locked, like `sufficiency.*` and `status.*`. |
64
+ | `sufficiency.satisfied`, `.gap`, `.insufficient`, `.unknown` | The same assurance line. |
65
+ | `status.<value>` | The same assurance line (the claim's carrier status, lowercased). |
66
+
67
+ A word with no entry, in any layer, is shown as its raw token or
68
+ identifier -- nothing is guessed. The default layer always words the
69
+ title (`lines.title` / `groups.kicker`, which `report.title` aliases). Until
70
+ the default EU pack carries `group.*` and `row.*` words, the EU card names
71
+ obligations and tests with the producer's labels, in italics as the
72
+ producer's text.
73
+
74
+ A Result whose claims the card cannot place one by one (a requirement
75
+ judged more than once in one conversation, claims under more than one
76
+ contract, claims of another type or id shape) is drawn as the generic
77
+ Result page, with a note, so no claim is merged or left out.
78
+
79
+ **The single-contract rule.** `row.*` and `group.*` apply only when every
80
+ claim in the Result cites the same `contract_ref` (`citesOneContract`,
81
+ contract-report.ts): a pack is written for one contract, and two contracts
82
+ can reuse one `requirement_ref` for different requirements. A Result that
83
+ cites more than one contract is drawn as the generic Result page (see
84
+ above), so the rule is a second guard for callers that draw a card directly.
85
+
86
+ **The refused-layer rule.** Each wording layer is checked on its own
87
+ (digest, shape, then fit against this module's words). A layer that does
88
+ not check is refused: it contributes no words, and the card draws with the
89
+ default layer alone, a visible `card.wording.refused` line
90
+ (`data-wording="refused"`) naming the reason, and a `card.pf.wording.refused`
91
+ proofs line naming the refused digest and the base layer that was applied
92
+ instead. The presentation builder (`buildPresentation`,
93
+ `presentation-builder.ts`) still refuses to _write_ a page whose pack does
94
+ not fit -- the graceful degrade above is only the live renderer's behaviour.
95
+
96
+ Releases follow [RELEASING.md](https://github.com/action-state-group/capsule-viewer/blob/main/RELEASING.md).
@@ -0,0 +1,18 @@
1
+ import { type ExtensionInterpreterId, type ExtensionRow } from "@action-state-group/agent-action-capsule";
2
+ /** The interpreters of the two deprecated cards, as AAC 0.7.0 named them. */
3
+ export type AliasInterpreterId = "outcome-report-card" | "compliance-card";
4
+ /** An interpreter a page of this viewer can run. */
5
+ export type PageInterpreterId = ExtensionInterpreterId | AliasInterpreterId;
6
+ /** AAC's extension row, with the alias interpreters as possible values. */
7
+ export interface PageExtensionRow extends Omit<ExtensionRow, "interpreter"> {
8
+ readonly interpreter?: PageInterpreterId;
9
+ }
10
+ /**
11
+ * AAC's extension rows, with a deprecated card's block shown as AAC 0.7.0
12
+ * showed it: interpreted by its card when that card's reader accepts the
13
+ * block and the card ran on this page (`applied`). Every other row is
14
+ * returned unchanged.
15
+ */
16
+ export declare function aliasExtensionRows(bundle: unknown, rows: readonly ExtensionRow[], applied: ReadonlySet<PageInterpreterId>): readonly PageExtensionRow[];
17
+ /** The interpreters in `applied` that AAC itself names. */
18
+ export declare function aacInterpreters(applied: ReadonlySet<PageInterpreterId>): ReadonlySet<ExtensionInterpreterId>;
@@ -0,0 +1,50 @@
1
+ // SPDX-License-Identifier: BSD-3-Clause
2
+ // The extension interpreters of the two deprecated aliases of
3
+ // contract-report/v1, defined here so the verification page reads as it did
4
+ // with agent-action-capsule 0.7.0. AAC 0.8.0 removed `outcome-report-card`
5
+ // and `compliance-card` from its `ExtensionInterpreterId` and reports an
6
+ // `outcome-report/v1` or `eu-ai-act-compliance/v1` block as uninterpreted
7
+ // (its spec/REGISTRY.md section 14). Removed with the alias path in the
8
+ // follow-up (agent-action-capsule#379, PR C2).
9
+ import { EXTENSION_SHOWN, } from "@action-state-group/agent-action-capsule";
10
+ import { readCompliancePresentation } from "./compliance-presentation.js";
11
+ import { readOutcomeReportPresentation } from "./outcome-report-presentation.js";
12
+ // AAC 0.7.0 extension-interpreters.ts, the two removed entries.
13
+ const ALIAS_INTERPRETERS = Object.freeze({
14
+ "outcome-report/v1": {
15
+ id: "outcome-report-card",
16
+ accepts: (bundle) => readOutcomeReportPresentation(bundle) !== undefined,
17
+ },
18
+ "eu-ai-act-compliance/v1": {
19
+ id: "compliance-card",
20
+ accepts: (bundle) => readCompliancePresentation(bundle) !== undefined,
21
+ },
22
+ });
23
+ /**
24
+ * AAC's extension rows, with a deprecated card's block shown as AAC 0.7.0
25
+ * showed it: interpreted by its card when that card's reader accepts the
26
+ * block and the card ran on this page (`applied`). Every other row is
27
+ * returned unchanged.
28
+ */
29
+ export function aliasExtensionRows(bundle, rows, applied) {
30
+ return rows.map((row) => {
31
+ if (row.interpreter !== undefined ||
32
+ !Object.hasOwn(ALIAS_INTERPRETERS, row.id))
33
+ return row;
34
+ const interpreter = ALIAS_INTERPRETERS[row.id];
35
+ if (!interpreter.accepts(bundle) || !applied.has(interpreter.id))
36
+ return row;
37
+ return {
38
+ id: row.id,
39
+ integrity: row.integrity,
40
+ interpreter: interpreter.id,
41
+ semantics: EXTENSION_SHOWN[row.integrity === "covered" ? "covered" : "notCovered"],
42
+ };
43
+ });
44
+ }
45
+ const isAlias = (id) => id === "outcome-report-card" || id === "compliance-card";
46
+ /** The interpreters in `applied` that AAC itself names. */
47
+ export function aacInterpreters(applied) {
48
+ return new Set([...applied].filter((id) => !isAlias(id)));
49
+ }
50
+ //# sourceMappingURL=alias-interpreters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alias-interpreters.js","sourceRoot":"","sources":["../src/alias-interpreters.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,8DAA8D;AAC9D,4EAA4E;AAC5E,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,wEAAwE;AACxE,+CAA+C;AAC/C,OAAO,EACL,eAAe,GAGhB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAajF,gEAAgE;AAChE,MAAM,kBAAkB,GAKpB,MAAM,CAAC,MAAM,CAAC;IAChB,mBAAmB,EAAE;QACnB,EAAE,EAAE,qBAAqB;QACzB,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,6BAA6B,CAAC,MAAM,CAAC,KAAK,SAAS;KACzE;IACD,yBAAyB,EAAE;QACzB,EAAE,EAAE,iBAAiB;QACrB,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,0BAA0B,CAAC,MAAM,CAAC,KAAK,SAAS;KACtE;CACF,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAe,EACf,IAA6B,EAC7B,OAAuC;IAEvC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAoB,EAAE;QACxC,IACE,GAAG,CAAC,WAAW,KAAK,SAAS;YAC7B,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,GAAG,CAAC,EAAE,CAAC;YAE1C,OAAO,GAAG,CAAC;QACb,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC;QAChD,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YAC9D,OAAO,GAAG,CAAC;QACb,OAAO;YACL,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,WAAW,EAAE,WAAW,CAAC,EAAE;YAC3B,SAAS,EACP,eAAe,CAAC,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC;SAC1E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,OAAO,GAAG,CAAC,EAAqB,EAA4B,EAAE,CAClE,EAAE,KAAK,qBAAqB,IAAI,EAAE,KAAK,iBAAiB,CAAC;AAE3D,2DAA2D;AAC3D,MAAM,UAAU,eAAe,CAC7B,OAAuC;IAEvC,OAAO,IAAI,GAAG,CACZ,CAAC,GAAG,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAgC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CACxE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from "./evidence-graph-view.js";
2
+ export * from "./contract-report.js";
3
+ export * from "./contract-report-wording.js";
4
+ export { conversationStatus } from "./outcome-report-view.js";
5
+ export { obligationStatus, rowStatus } from "./compliance-view.js";
6
+ export * from "./presentation-mount.js";
7
+ export { buildResultRoot, disclosureOf, ed25519Available, verifiedPayload, verifyDisclosureEnvelope, verifyProducerEnvelope, } from "@action-state-group/agent-action-capsule";
@@ -0,0 +1,25 @@
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. It bundles
5
+ // @action-state-group/agent-action-capsule (0.8.0 or later) through that
6
+ // package's own browser entry, by plain package resolution. The Go module
7
+ // ships the build as go/pageruntime.
8
+ export * from "./evidence-graph-view.js";
9
+ export * from "./contract-report.js";
10
+ export * from "./contract-report-wording.js";
11
+ export { conversationStatus } from "./outcome-report-view.js";
12
+ export { obligationStatus, rowStatus } from "./compliance-view.js";
13
+ export * from "./presentation-mount.js";
14
+ // The verifier functions a presentation module may call on the runtime's
15
+ // global (EvidenceGraph), beside registerPresentation: agent-action-capsule's
16
+ // own functions, re-exported by name and unchanged, so a module verifies with
17
+ // the same verifier the page does (ed25519Available is its check that the
18
+ // browser can verify Ed25519 signatures; buildResultRoot is its Result
19
+ // reader, which the Show-evidence component, static/show_evidence.js, draws
20
+ // from). This list is the runtime's contract
21
+ // with presentation modules: a name is added here only from
22
+ // agent-action-capsule's verifier, and removing one breaks the modules that
23
+ // call it.
24
+ export { buildResultRoot, disclosureOf, ed25519Available, verifiedPayload, verifyDisclosureEnvelope, verifyProducerEnvelope, } from "@action-state-group/agent-action-capsule";
25
+ //# 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,+DAA+D;AAC/D,yEAAyE;AACzE,0EAA0E;AAC1E,qCAAqC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACnE,cAAc,yBAAyB,CAAC;AAExC,yEAAyE;AACzE,8EAA8E;AAC9E,8EAA8E;AAC9E,0EAA0E;AAC1E,uEAAuE;AACvE,4EAA4E;AAC5E,6CAA6C;AAC7C,4DAA4D;AAC5D,4EAA4E;AAC5E,WAAW;AACX,OAAO,EACL,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,0CAA0C,CAAC"}
@@ -0,0 +1,51 @@
1
+ import type { PresentationManifest } from "./presentation-registry.js";
2
+ /**
3
+ * The seven built-in manifests of spec/presentation-contract-v0.md appendix A,
4
+ * as values. Each equals the JSON file of the same name under
5
+ * schemas/examples/presentation-manifest-v0/ (test/builtin-manifests.test.ts
6
+ * compares them when those files are present). The precedence between the
7
+ * built-in page shapes is stated here, in `forbids`, and nowhere in code:
8
+ *
9
+ * - rows first: every Result manifest forbids `spec_version:report/v1`;
10
+ * - the contract-report kind first among Result pages: the two cards and the
11
+ * generic Result page forbid `contract-report/v1`;
12
+ * - compliance only when outcome-report is not engaged: the compliance
13
+ * manifest forbids `outcome-report/v1`;
14
+ * - the generic Result page only when no card is engaged;
15
+ * - Result before graph: the graph forbids the Result profile;
16
+ * - the no-aggregate note is the one fallback.
17
+ */
18
+ export declare const BUILTIN_MANIFEST_REPORT_ROWS: PresentationManifest;
19
+ /**
20
+ * A Result root that opts into the contract-report view
21
+ * (spec/contract-report-v1.md). The core runtime ships no contract-report
22
+ * module, so this manifest draws the generic Result page. A registry that
23
+ * brings a contract-report module registers it in place of this manifest,
24
+ * never beside it (the two match the same descriptors).
25
+ */
26
+ export declare const BUILTIN_MANIFEST_RESULT_CONTRACT_REPORT: PresentationManifest;
27
+ export declare const BUILTIN_MANIFEST_RESULT_OUTCOME_REPORT: PresentationManifest;
28
+ export declare const BUILTIN_MANIFEST_RESULT_COMPLIANCE: PresentationManifest;
29
+ export declare const BUILTIN_MANIFEST_RESULT: PresentationManifest;
30
+ export declare const BUILTIN_MANIFEST_EVALUATION_SUMMARY_GRAPH: PresentationManifest;
31
+ export declare const BUILTIN_MANIFEST_NO_AGGREGATE: PresentationManifest;
32
+ /** All seven, in appendix A's table order (an order that decides nothing). */
33
+ export declare const BUILTIN_MANIFESTS: readonly PresentationManifest[];
34
+ /**
35
+ * The composition section: the generic view of a `composed/v1` block
36
+ * (members, observers, joins, composition closure, composed digest, and
37
+ * same-custody agreement shown as redundant, not corroborating). A specific
38
+ * module selected by the engaged extension alone.
39
+ *
40
+ * It is NOT one of the page manifests above, and must not be: one
41
+ * descriptor matches it together with each of the six specific page
42
+ * manifests (a Result root that also carries composed/v1, say), so the
43
+ * registration test of contract section 4.5 refuses it in that set, and it
44
+ * would equally refuse every composition-aware page module (appendix B,
45
+ * `org.example.composition-aware/v0`) that it is meant to sit beneath. It is
46
+ * resolved in the core's section registry instead, by the same algorithm,
47
+ * and renders after whichever page module the page registry selected.
48
+ */
49
+ export declare const BUILTIN_MANIFEST_COMPOSED: PresentationManifest;
50
+ /** The built-in section manifests (one today). */
51
+ export declare const BUILTIN_SECTION_MANIFESTS: readonly PresentationManifest[];