Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
design_source_types.hpp
Go to the documentation of this file.
1#pragma once
2
9
11
12#include <cstddef>
13#include <cstdint>
14#include <map>
15#include <optional>
16#include <string>
17#include <vector>
18
19namespace pulp::view {
20
22 std::vector<std::string> tokens;
23
24 bool has_dynamic_apis() const {
25 return !tokens.empty();
26 }
27};
28
30
33 std::string code; // e.g. "broken-ref", "duplicate-section"
34 std::string path; // dotted token path or section name
35 int line = 0; // 1-based; 0 = unknown
36 int column = 0; // 1-based; 0 = unknown
37 std::string message;
38};
39
41 std::string section;
42 std::string reason;
43};
44
47 std::vector<DesignMdDiagnostic> diagnostics;
48 // Sections seen in the body, in the order they appeared. Used by the
49 // section-order lint rule.
50 std::vector<std::string> sections;
51 bool had_frontmatter = false;
52 // Names of color tokens (the part after "colors.") that were
53 // dereferenced during parse. `resolve_references` rewrites
54 // `{colors.X}` to the resolved hex value in-place, which would
55 // otherwise hide the reference from `lint_designmd`'s
56 // orphaned-tokens rule. The rule consumes this set directly
57 // instead of re-scanning post-resolution strings.
58 std::vector<std::string> referenced_color_tokens;
59 // DESIGN.md 0.4 `omitted` declarations. These are metadata rather than
60 // design tokens; lint uses them to suppress intentional missing-section
61 // findings and to report unknown or redundant declarations.
62 std::vector<DesignMdOmittedSection> omitted_sections;
63};
64
66 std::vector<std::string> added; // tokens present in `after` only
67 std::vector<std::string> removed; // tokens present in `before` only
68 std::vector<std::string> modified; // tokens whose value changed
69};
70
75 // True if the `after` file has more error- or warning-severity
76 // diagnostics than `before` (matches @google/design.md's diff
77 // regression semantic).
78 bool regression = false;
79};
80
83 std::string uuid;
84 std::string mime;
85 std::vector<uint8_t> data;
86};
87
92 std::string family;
93 std::string runtime_family;
94 size_t asset_index = 0;
95 std::string weight;
96 std::string style;
97 std::string unicode_range;
98};
99
106 std::string id;
107 std::string kind;
108 std::string payload_json;
109};
110
114 std::vector<ClaudeBundleAsset> assets;
115 std::vector<size_t> javascript_indices;
117 std::vector<ClaudeBundleFontBinding> font_bindings;
118 std::vector<ClaudeBundleMaterializedBinding> materialized_bindings;
120 std::string template_html;
121};
122
124 std::uint64_t verifies = 0;
125 std::uint64_t hits = 0;
126 std::uint64_t rejected = 0;
127 std::uint64_t waits = 0;
128 std::size_t entries = 0;
129 std::size_t bytes = 0;
130};
131
139 size_t max_total_js_bytes = 6 * 1024 * 1024;
140
145 std::optional<int> engine_override; // pulp::view::JsEngineType opaque to header
146
151 std::string* error_out = nullptr;
152
158};
159
160using ClaudeClassNameRules = std::map<std::string, std::map<std::string, std::string>>;
161
162} // namespace pulp::view
Normalized intermediate representation (IR) for imported designs: the IR value model (style,...
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
DesignMdSeverity
Definition design_source_types.hpp:29
@ info
Definition design_source_types.hpp:29
std::map< std::string, std::map< std::string, std::string > > ClaudeClassNameRules
Definition design_source_types.hpp:160
@ warning
Definition design_ir.hpp:696
@ info
Definition design_ir.hpp:695
@ error
Definition design_ir.hpp:697
One asset entry from a Claude Design bundle.
Definition design_source_types.hpp:82
std::string mime
e.g. "text/javascript", "font/woff2"
Definition design_source_types.hpp:84
std::string uuid
envelope key (also referenced as <script src="<uuid>">)
Definition design_source_types.hpp:83
std::vector< uint8_t > data
already base64-decoded + gunzipped if compressed
Definition design_source_types.hpp:85
One captured @font-face rule joined to a content-addressed bundle asset.
Definition design_source_types.hpp:91
std::string weight
Definition design_source_types.hpp:95
std::string style
Definition design_source_types.hpp:96
std::string unicode_range
Definition design_source_types.hpp:97
size_t asset_index
Definition design_source_types.hpp:94
std::string runtime_family
Definition design_source_types.hpp:93
std::string family
Definition design_source_types.hpp:92
One id-addressed binding from a v2 materialized browser document.
Definition design_source_types.hpp:105
std::string payload_json
Definition design_source_types.hpp:108
std::string id
Definition design_source_types.hpp:106
std::string kind
semantic, layout, text, paint, or canvas
Definition design_source_types.hpp:107
Result of unpacking a Claude Design bundle's <script type="__bundler/manifest">.
Definition design_source_types.hpp:113
std::vector< ClaudeBundleFontBinding > font_bindings
captured @font-face assets
Definition design_source_types.hpp:117
std::string template_html
the unwrapped HTML template (with <div id="root"> etc.)
Definition design_source_types.hpp:120
std::vector< size_t > javascript_indices
indices into assets[] of MIME text/javascript,
Definition design_source_types.hpp:115
std::uint32_t materialized_schema_version
Definition design_source_types.hpp:119
std::vector< ClaudeBundleAsset > assets
all assets (JS, fonts, etc.) in manifest order
Definition design_source_types.hpp:114
std::vector< ClaudeBundleMaterializedBinding > materialized_bindings
Definition design_source_types.hpp:118
Options for the --execute-bundle import lane.
Definition design_source_types.hpp:133
std::string * error_out
If non-null, populated with a human-readable explanation when the runtime path bails out and the call...
Definition design_source_types.hpp:151
std::optional< int > engine_override
Override the JS engine backend.
Definition design_source_types.hpp:145
size_t max_total_js_bytes
Hard cap on bytes of bundled JS to evaluate.
Definition design_source_types.hpp:139
int runtime_snapshot_viewport_height
Definition design_source_types.hpp:157
int runtime_snapshot_viewport_width
Optional viewport used when a runtime-native tree is frozen into DesignIR.
Definition design_source_types.hpp:156
Complete design IR document.
Definition design_ir.hpp:791
Definition design_source_types.hpp:31
std::string code
Definition design_source_types.hpp:33
int column
Definition design_source_types.hpp:36
std::string path
Definition design_source_types.hpp:34
std::string message
Definition design_source_types.hpp:37
int line
Definition design_source_types.hpp:35
DesignMdSeverity severity
Definition design_source_types.hpp:32
Definition design_source_types.hpp:71
DesignMdTokenDiff dimensions
Definition design_source_types.hpp:73
DesignMdTokenDiff colors
Definition design_source_types.hpp:72
DesignMdTokenDiff strings
Definition design_source_types.hpp:74
bool regression
Definition design_source_types.hpp:78
Definition design_source_types.hpp:40
std::string section
Definition design_source_types.hpp:41
std::string reason
Definition design_source_types.hpp:42
Definition design_source_types.hpp:45
std::vector< DesignMdDiagnostic > diagnostics
Definition design_source_types.hpp:47
std::vector< std::string > sections
Definition design_source_types.hpp:50
std::vector< std::string > referenced_color_tokens
Definition design_source_types.hpp:58
DesignIR ir
Definition design_source_types.hpp:46
bool had_frontmatter
Definition design_source_types.hpp:51
std::vector< DesignMdOmittedSection > omitted_sections
Definition design_source_types.hpp:62
Definition design_source_types.hpp:65
std::vector< std::string > removed
Definition design_source_types.hpp:67
std::vector< std::string > added
Definition design_source_types.hpp:66
std::vector< std::string > modified
Definition design_source_types.hpp:68
Definition design_source_types.hpp:123
std::uint64_t verifies
full decode + verification passes run
Definition design_source_types.hpp:124
std::uint64_t rejected
inputs that failed verification
Definition design_source_types.hpp:126
std::size_t entries
Definition design_source_types.hpp:128
std::size_t bytes
input + decoded asset bytes held
Definition design_source_types.hpp:129
std::uint64_t waits
lookups that waited for an in-flight verification
Definition design_source_types.hpp:127
std::uint64_t hits
calls served from an earlier verification
Definition design_source_types.hpp:125
Definition design_source_types.hpp:21
bool has_dynamic_apis() const
Definition design_source_types.hpp:24
std::vector< std::string > tokens
Definition design_source_types.hpp:22