@labpics/colors 0.10.0 → 1.0.2

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.
@@ -1,19 +1,23 @@
1
1
  {
2
- "schemaVersion": 1,
2
+ "schemaVersion": 2,
3
3
  "package": {
4
4
  "name": "@labpics/colors",
5
- "version": "0.10.0"
5
+ "version": "1.0.2"
6
6
  },
7
- "sourceSha": "52d7895774c2fa3796e51f7133452cf83c09346b",
8
- "coreVersion": "0.2.0",
7
+ "sourceSha": "6b31d77c0cce9b5017784bc6718bd3bba3354620",
8
+ "coreVersion": "0.3.0",
9
9
  "conformance": {
10
- "packVersion": "2.0.0",
11
- "packDigest": "64a68cbd",
12
- "manifestSha256": "765c254d37fb4108461bbe71f392bc5ec42eca84ae58cc1cbf2562af6768ae1f",
13
- "familySetSha256": "1b7b446a66f1bf57a7d0538c4cb94b78d8ec7bdd42f7973a09c0029724deaa62"
10
+ "packVersion": "12.0.0",
11
+ "packDigest": "4487d438",
12
+ "manifestSha256": "3bc874bcede5a2c7b8afa73e93f30f594d848b9ff4b63a0aca822633aec0204b",
13
+ "familySetSha256": "433250df0b41e6d2c55312c6489d19019f34e47b796b9a6a8dd1a826eacc4ecc"
14
14
  },
15
- "wasm": {
16
- "bytes": 371584,
17
- "sha256": "44b0015851b120bee249e87fba9cbae6465d477ce333db4478f1a4ddc0cccb2c"
18
- }
15
+ "wasm": [
16
+ {
17
+ "role": "runtime",
18
+ "path": "pkg/labcolors_bg.wasm",
19
+ "bytes": 439355,
20
+ "sha256": "57f4add5f6228d5e050b131e5188d01361a211ff04b2ac08e5c7650633b384ab"
21
+ }
22
+ ]
19
23
  }
@@ -0,0 +1 @@
1
+ {"artifact_id":"wcag22-srgb8-luminance-q55-v1","basis_point_proof":{"checks":30,"drop_all_semantics":"zero required surplus; current must still meet the anchor","drop_domain_inclusive":[0,10000],"nonpositive_baseline_semantics":"zero required surplus; current must meet the anchor"},"bound_id":"point-support-reference-surplus-q55-bps-v1","certified_claim":"for every successfully evaluated enabled stability cell, decision is Retained iff current_lower_surplus >= (10000-drop_bps)/10000 * max(baseline_lower_surplus,0); the declared anchor remains a separate hard floor","comparator_proof":{"algorithm":"euclidean-continued-fraction-ordering-v1","dense_denominator_inclusive":[1,31],"dense_numerator_inclusive":[0,31],"dense_small_cases":984064,"invariant":"equal integer parts; reciprocal proper fractions reverse order","largest_fibonacci_index":186,"oracle":"unbounded-integer-cross-product","random_cases":250000,"random_corpus_sha256":"97c4af7b452b31a4ab92645f70c17acb38bf57ca55484e32ad9d7d79d97a333d","random_seed":210583930,"termination":"each nonterminal denominator becomes a strictly smaller remainder","u128_adversarial_cases":190},"declared_operation_law":"q55-lower-reference-distance-explicit-anchor-bps-retention-v1","excluded_claim":"does not certify retention against the unknown exact baseline surplus, renderer equivalence outside encoded-sRGB8 source-over, or a successful result when evaluation fails","integer_replay_envelope":{"assumption":"every Q55 luminance upper <= scale + 3","i128_max":170141183460469231731687303715884105727,"offset_cleared_denominator_max":756604737398243388,"positive_baseline_numerator_max":1188950301625811064,"rational_denominator_max":1513209474796486776,"required_denominator_max":15132094747964867760000,"required_numerator_max":11889503016258110640000,"signed_anchor_abs_coarse_max":5296233161787703716,"u128_max":340282366920938463463374607431768211455,"u64_max":18446744073709551615},"profile_id":"srgb8-q55-retained-reference-surplus-bps-v1","proof_id":"point-support-reference-surplus-integer-v1","proof_payload_sha256":"47e5da91f26ef2238854ffeb31f7ddcd4680993ec19f58657f5d0ef191403f97","q55_dependency":{"artifact_id":"wcag22-srgb8-luminance-q55-v1","artifact_sha256":"7ff239d9052b346f3c50da01ca65ca2330892ed1a3ff30e190797fcef6f03604","maximum_luminance_upper":36028797018963971,"outward_interval_width_bound":3,"proof_id":"wcag22-srgb8-full-domain-q55-v1","proof_payload_sha256":"a4e02b4dce47c58310fb3ea9e34af1538ae5813b31b15ddee71a9a1be7bb76f8","proof_sha256":"2b2170e20bd24c059a0bbaf8d92603470ec941402f3a08185f54a5e1e41c69ca","q55_scale":36028797018963968},"reference_and_anchor_proof":{"anchor_identity_checks":75,"orientation_law":"distance-magnitude-symmetric-orientation-reported-separately","overlap_lower_distance":"0/1","separated_endpoint_checks":504},"schema_version":2,"site_id":"point-support-retained-reference-surplus-v1","source_binding_exclusions":["whole-crate compilation or compiler/toolchain attestation","binary, package, FFI, renderer, or browser transport attestation","unrelated Lab Colors modules outside the declared point-support semantic cone"],"source_binding_law":"point-support-rust-whole-file-semantic-cone-v2","source_binding_schema_version":2,"source_binding_scope":"exact bytes of the private point-support Rust semantic cone and its two WCAG include_str inputs; comments and cfg(test) text are intentionally significant","source_closure_sha256":"60e3ac14f92b40a1f1293e193dd1b0dfc2960fa82c2e8c91a37c4c81125b9204","source_files":[{"kind":"compile-time-input","path":"crates/labcolors-core/contracts/wcag22-srgb8-q55-proof-v1.json","sha256":"2b2170e20bd24c059a0bbaf8d92603470ec941402f3a08185f54a5e1e41c69ca"},{"kind":"compile-time-input","path":"crates/labcolors-core/contracts/wcag22-srgb8-v1.json","sha256":"b4bb7e5f17a99f2c911fdbe3da23a48b049277b796291094950f14680cc3cc7b"},{"kind":"rust-source","path":"crates/labcolors-core/src/appearance.rs","sha256":"912d03c716e961f8747a620bbcdf90dbd2fd3c3305e72321f18ab1f13d11bb5c"},{"kind":"rust-source","path":"crates/labcolors-core/src/composition.rs","sha256":"66506ab70fbe9223486ebfd480dd114542c6acab81115880871db56fe923e134"},{"kind":"rust-source","path":"crates/labcolors-core/src/constraints/exact.rs","sha256":"ae9d95c3aa08142192ff422cd7a5bd514855d47f58c8e54aaffb69bfd7481afc"},{"kind":"rust-source","path":"crates/labcolors-core/src/constraints/mod.rs","sha256":"93f914875c0a0780e612bfedad1b52f75aa63429e53a2242346db13031e4a0cd"},{"kind":"rust-source","path":"crates/labcolors-core/src/constraints/wcag22.rs","sha256":"63b78e4a4669d2b237812ffd62b4b9b5cb3761d9a6856f508ad50da68ab611fb"},{"kind":"rust-source","path":"crates/labcolors-core/src/hash.rs","sha256":"f97a0fd7d6ad3162f0f1dfb326fccfb7ed40da9a8fa67a5b8a239a1ae2ae49c3"},{"kind":"rust-source","path":"crates/labcolors-core/src/lcs_occurrence.rs","sha256":"78d37406e9bdc37f126b72987c9c92b452c13b3233c0aeb0a75ed25dadb83a68"},{"kind":"rust-source","path":"crates/labcolors-core/src/lib.rs","sha256":"85386e269feecb3928c5b3e48b42409492d963f5bed9ba40ec7e37670fb6d8c8"},{"kind":"rust-source","path":"crates/labcolors-core/src/numerics.rs","sha256":"94ab17694b86e724e149570dfda8fafa71619f1c1015dcb7af421bc72d44ff22"},{"kind":"rust-source","path":"crates/labcolors-core/src/observation.rs","sha256":"d7cf2beec8e8a242f346618856382e0e1d5a5eade17bdfd0dc7e27176c988c26"},{"kind":"rust-source","path":"crates/labcolors-core/src/point_support.rs","sha256":"f8c12113a1487cc33dc289621d16e54ef84ba99a65bc370dead1da185228f17e"},{"kind":"rust-source","path":"crates/labcolors-core/src/session.rs","sha256":"1d8d297a6372100c28fd09903fadf2f862c25227edfe24a9a3aa061b5274f807"},{"kind":"rust-source","path":"crates/labcolors-core/src/srgb8.rs","sha256":"c8d600491f92c86c79b33ae2643787c52bb616028a48cd66bd711ba27d0b19d7"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22.rs","sha256":"15de885a352794944993d00f61ccdab9ec78d12777efd247bfbff0004be89a4f"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22/kernel.rs","sha256":"8ab231b0a7fac8ebf78e04c3a2e70c1a7e477fdd3324ffa9d0eb100e89df1059"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22/q55_data.rs","sha256":"af4d23d6b70c45ce6efa839e7dda4bb0a61f6aae43cb805af6fa9b29e6c3bae2"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22_evidence.rs","sha256":"19dea4c88a75414c6869bedc0a36058a884d73f36ed9cb5c2f243764f10ac5dc"}],"source_negative_controls":43,"universal_algebraic_certificate":{"basis_point_scale_instantiation":10000,"domain":"integers; Q55 scale Q>0; anchor L>=D>=0; lighter monotonicity L2>=L1>D>=0; darker monotonicity L>D2>=D1>=0; current/baseline denominators b,q>0; basis-point scale B>0 instantiated as 10000; p>0; a>=0; 0<=drop_bps<=B","identities":["three explicit anchor-surplus formulas after denominator clearing","reference distance is monotone increasing in lighter L","reference distance is monotone decreasing in darker D","positive-baseline retained threshold is p*(B-drop)/(q*B)","a/b >= p*(B-drop)/(q*B) iff a*q*B >= p*(B-drop)*b"],"method":"exact-sparse-integer-polynomial-identities-plus-positive-denominator-order-lemma-v1","nonpositive_baseline_case":"max(baseline,0)=0; retained threshold is exactly zero","symbolic_mutation_controls":{"anchor_coefficients_and_denominator":6,"retained_cross_product":5},"wolfram_language_cross_check":{"query":"FullSimplify[{20 g/d - 0 == 20 g/d, 20 g/d - 2 == (20 g - 2 d)/d, 20 g/d - 7/2 == (40 g - 7 d)/(2 d), Equivalent[a/b >= p (s-x)/(q s), a q s >= p (s-x) b], Max[p/q, 0] (s-x)/s == Piecewise[{{0, p <= 0}}, p (s-x)/(q s)]}, Assumptions -> Element[{a,b,p,q,s,x,g,d}, Integers] && a >= 0 && b > 0 && q > 0 && s > 0 && 0 <= x <= s && d > 0 && g >= 0]","query_sha256":"8cdbb9964583030c8b92498961896cb2a98613f1cb31eb7c54acdf8e16beff10","result":"{True, True, True, True, True}","result_sha256":"13a8f2ee8d0fde335a638e46d7cc8a8427b9a1437c77d22cfcf925bb87fa6303"}},"verifier_sha256":"6de5b5b67f088260b805e8d75d433cc6e58397238f6f242d342010ea62990d71"}
@@ -0,0 +1 @@
1
+ {"artifact_id":"wcag22-srgb8-luminance-q55-v1","artifact_rust_source_sha256":"af4d23d6b70c45ce6efa839e7dda4bb0a61f6aae43cb805af6fa9b29e6c3bae2","artifact_sha256":"7ff239d9052b346f3c50da01ca65ca2330892ed1a3ff30e190797fcef6f03604","artifact_words":1536,"bound_id":"wcag22-srgb8-outward-q55-v1","colors":16777216,"declared_operation_law":"final-srgb8-outward-q55-two-orientation-integer-threshold-v1","facade_id":"wcag22-srgb8-public-facade-v1","facade_normalized_sha256":"c2f252829577f1a5455b91afdccc1669ff0c964e10d8935db9e79b0c8ce251d6","full_domain_algorithm":"unique-q55-interval-monotone-boundary-v1","generator_sha256":"7ad72f53e26ebb74ebfc2d8945f833613fa1317bb441d821f518d012c8c09687","integer_replay_envelope":{"carrier":"signed-64","carrier_maximum":9223372036854775807,"headroom":2485986994308513251,"maximum_luminance_upper":36028797018963971,"maximum_threshold_term":6737385042546262556,"next_scale_maximum_threshold_term":13474770085092524572,"next_scale_power":56,"observed_interval_width":3,"outward_interval_width_bound":3},"kernel_id":"wcag22-srgb8-evaluation-kernel-v1","kernel_source_sha256":"8ab231b0a7fac8ebf78e04c3a2e70c1a7e477fdd3324ffa9d0eb100e89df1059","max_color_interval_width":3,"negative_controls":15,"parser_id":"encoded-srgb8-hex-parser-v1","parser_source_sha256":"70fc992594762b97c3191a721156161b7f188b29cd05ee555c1656fb3840aed0","profile_checksum":"152813fe","profile_id":"wcag22-srgb8-contrast-v1","profile_source_sha256":"b4bb7e5f17a99f2c911fdbe3da23a48b049277b796291094950f14680cc3cc7b","proof_id":"wcag22-srgb8-full-domain-q55-v1","proof_payload_sha256":"a4e02b4dce47c58310fb3ea9e34af1538ae5813b31b15ddee71a9a1be7bb76f8","q55_scale":36028797018963968,"recommendation":"https://www.w3.org/TR/2024/REC-WCAG22-20241212/","registry_row_id":"wcag22-srgb8-contrast-v1","registry_row_negative_controls":10,"registry_row_sha256":"c91c5e185c432ae4a9fb9ea03e9838bf2565f2aabff56019e190aae97bfaa0f1","row_oracle":{"integer_tightness_cross_checks":768,"maximum_precision_used":72,"precision_schedule":[48,72,108,162],"rows_stable":768},"rows":768,"schema_version":2,"source_binding_law":"wcag22-rust-semantic-dependency-cone-v1","source_binding_schema_version":1,"source_route_sha256":"3b8dfe6f0a538e2e026484ff361dce97b1cee852e4e3029453b05915d49eef8c","terminal_evidence_id":"wcag22-srgb8-terminal-evidence-v1","terminal_evidence_source_sha256":"19dea4c88a75414c6869bedc0a36058a884d73f36ed9cb5c2f243764f10ac5dc","thresholds":[{"candidate_checks":0,"integer_law":{"dark_factor":30,"light_factor":10,"offset_factor":1},"minimum_fail_intervals":[{"bounds":[14728116861854887,14728116861854890],"rgb":"#89BB09"},{"bounds":[3708412386652940,3708412386652943],"rgb":"#8212DB"}],"minimum_fail_margin":3268,"minimum_pass_intervals":[{"bounds":[22947817375997342,22947817375997345],"rgb":"#32F120"},{"bounds":[6448312558033241,6448312558033244],"rgb":"#BF39C2"}],"minimum_pass_margin":12132,"threshold":"3.0","unresolved":0},{"candidate_checks":0,"integer_law":{"dark_factor":180,"light_factor":40,"offset_factor":7},"minimum_fail_intervals":[{"bounds":[9920609921116460,9920609921116463],"rgb":"#898CB8"},{"bounds":[803460098399708,803460098399711],"rgb":"#3E2217"}],"minimum_fail_margin":36696,"minimum_pass_intervals":[{"bounds":[9070597544121535,9070597544121538],"rgb":"#BE64DB"},{"bounds":[614568459067254,614568459067257],"rgb":"#480B1D"}],"minimum_pass_margin":7364,"threshold":"4.5","unresolved":0}],"unique_intervals":16777216,"verifier_sha256":"d22dedc689925ffe53d49d3c4b4b0d3ae67a97d26062b2fdd24bcb404e31f768"}
Binary file
@@ -0,0 +1 @@
1
+ {"blueWeight":"0.0722","channelSplit":"0.04045","contrastOffset":"0.05","encodedExponent":"2.4","encodedOffset":"0.055","encodedScale":"1.055","fixedPointScalePower":55,"greenWeight":"0.7152","largeTextRatio":"3.0","linearDivisor":"12.92","normalTextRatio":"4.5","profileId":"wcag22-srgb8-contrast-v1","recommendation":"https://www.w3.org/TR/2024/REC-WCAG22-20241212/","redWeight":"0.2126","requiredNonTextRatio":"3.0","schemaVersion":1}
package/index.d.ts CHANGED
@@ -1,70 +1,211 @@
1
- // Public types for @labpics/colors.
2
- //
3
- // Re-exports the wasm-bindgen-generated types (the rich `ResolvedTheme` /
4
- // `RoleResult` union and the `LabColors` engine) and the vanilla `applyTheme`
5
- // helper, so a consumer gets full typing from the package root.
1
+ /// <reference lib="esnext.disposable" />
2
+
3
+ // Terminal C7c public surface: canonical Program wire is the sole authoring
4
+ // and runtime root. Recipe DTOs and legacy theme helpers are not re-exported.
5
+
6
+ import type { Wcag22AssessmentV1 } from "./pkg/labcolors.js";
7
+ import type { ProgramAttachment } from "./pkg/labcolors.js";
8
+ import type { Wcag22CriterionV1 } from "./wcag22.js";
6
9
 
7
10
  export {
8
- default,
9
- default as init,
10
- initSync,
11
- LabColors,
11
+ compileProgramWire,
12
+ numericalCapabilityManifest,
13
+ ProgramRuntime,
14
+ ProgramSnapshot,
15
+ ProgramAttachment,
16
+ ProgramAttachedSnapshot,
17
+ ProgramAttachedRender,
18
+ AttachedMaterializationAuthority,
12
19
  } from "./pkg/labcolors.js";
13
20
 
14
- // Curated public schema/result surface. wasm-bindgen's InitOutput and raw
15
- // __wbg_* ABI helpers remain implementation details.
16
21
  export type {
17
- ThemeName,
18
- SolvedColor,
19
- NoneRole,
20
- UnreachableRole,
21
- TranslucentRole,
22
- GlowDecisionProfileV1,
23
- GlowLayerRecipeProfileV1,
24
- GlowDiagnosticProfileV1,
25
- GlowTargetStatusV1,
26
- NumericalIndeterminacyV1,
27
- GlowBitExactDecisionGuaranteeV1,
28
- GlowLegacyDecisionGuaranteeV1,
29
- GlowDecisionGuaranteeV1,
30
- GlowDeterminateRoleBase,
31
- GlowStableExactNoopRole,
32
- GlowLegacyReachedRole,
33
- GlowLegacyUnreachableRole,
34
- GlowDeterminateRole,
35
- GlowIndeterminateRoleBase,
36
- GlowIndeterminateRole,
37
- GlowRole,
38
- MaterialAlphaGuaranteeBaseV1,
39
- MaterialBisectionBracketGuaranteeV1,
40
- MaterialTransparentEndpointGuaranteeV1,
41
- MaterialOpaqueEndpointGuaranteeV1,
42
- MaterialAlphaGuaranteeV1,
43
- MaterialRoleBase,
44
- MaterialSatisfiedTransparentRole,
45
- MaterialSatisfiedBracketRole,
46
- MaterialDegradedOpaqueRole,
47
- MaterialRole,
48
- RoleResult,
49
- ThemeAnchors,
50
- LadderSource,
51
- LadderPositionV1,
52
- RoleRecipe,
53
- ThemeConfig,
54
- ResolvedTheme,
22
+ NumericalCapabilitySiteV2,
23
+ NumericalCapabilityManifestV2,
24
+ Wcag22DecisionV1,
25
+ Wcag22Q55BoundsV1,
26
+ Wcag22AssessmentV1,
55
27
  } from "./pkg/labcolors.js";
28
+ export type { Wcag22CriterionV1 } from "./wcag22.js";
56
29
 
57
- export { applyTheme } from "./apply-theme.js";
58
- export { watchTheme } from "./watch-theme.js";
59
- export type { WatchThemeOptions, WatchController } from "./watch-theme.js";
60
- export { adaptTheme } from "./adapt-theme.js";
61
- export type { AdaptThemeOptions, AdaptController } from "./adapt-theme.js";
62
- export {
63
- effectiveBackground,
64
- parseCssColor,
65
- compositeOver,
66
- compositeStackToHex,
67
- toHex,
68
- oklabLerp,
69
- } from "./effective-bg.js";
70
- export type { Rgba, EffectiveBackgroundOptions, StyleLike } from "./effective-bg.js";
30
+ export type ProgramInfrastructureErrorCode =
31
+ | "program_resource_exhausted"
32
+ | "program_internal_invariant";
33
+ export type ProgramCompileErrorCode =
34
+ | ProgramInfrastructureErrorCode
35
+ | "program_wire"
36
+ | "program_compile"
37
+ | "program_family_artifacts_required"
38
+ | "program_instantiate";
39
+ export type ProgramUpdateErrorCode = "program_update" | ProgramInfrastructureErrorCode;
40
+ export type ProgramAttachmentErrorCode =
41
+ | ProgramCompileErrorCode
42
+ | "program_attachment_binding"
43
+ | "program_attachment_instantiate"
44
+ | "program_attachment_sink_admission"
45
+ | "program_attachment_resource_exhausted"
46
+ | "program_attachment_internal_invariant"
47
+ | "program_attachment_non_terminal_target";
48
+ export type ProgramAttachmentUpdateErrorCode =
49
+ | "program_attachment_update"
50
+ | "program_attachment_resource_exhausted"
51
+ | "program_attachment_internal_invariant"
52
+ | "program_attachment_already_disposed"
53
+ | "program_attachment_patch_scope_mismatch"
54
+ | "program_attachment_stamp_mismatch"
55
+ | "program_attachment_revision_mismatch"
56
+ | "program_attachment_already_installed"
57
+ | "program_attachment_host_rejected"
58
+ | "program_attachment_host_protocol"
59
+ | "program_attachment_busy";
60
+ export type ProgramAttachmentDisposeErrorCode =
61
+ | "program_attachment_already_disposed"
62
+ | "program_attachment_revoke_unconfirmed"
63
+ | "program_attachment_dispose"
64
+ | "program_attachment_busy";
65
+ export type ProgramAttachmentFreeErrorCode =
66
+ | "program_attachment_revoke_unconfirmed"
67
+ | "program_attachment_busy";
68
+ export type ProgramPhysicalIdentityErrorCode = "program_physical_identity";
69
+ export type ProgramMaterializationErrorCode =
70
+ | "program_attachment_resource_exhausted"
71
+ | "program_materialization_not_ready"
72
+ | "program_materialization_paint_not_authority"
73
+ | "program_materialization_stale_revision"
74
+ | "program_materialization_stale_identity"
75
+ | "program_materialization_stale_sink_stamp"
76
+ | "program_materialization_foreign_binding_epoch"
77
+ | "program_materialization_terminal_binding_mismatch"
78
+ | "program_materialization_missing_point_absence_proof"
79
+ | "program_materialization_ambiguous_observation_cases"
80
+ | "program_attachment_busy";
81
+ export type ProgramUpdateOperation = "updateObserved" | "updateUnknown";
82
+ export type ProgramError = Error & (
83
+ | Readonly<{ code: ProgramCompileErrorCode; operation: "compileProgramWire" }>
84
+ | Readonly<{ code: ProgramUpdateErrorCode; operation: ProgramUpdateOperation }>
85
+ | Readonly<{ code: ProgramAttachmentErrorCode; operation: "attachProgramWire" }>
86
+ | Readonly<{
87
+ code: ProgramAttachmentUpdateErrorCode;
88
+ operation: "attachmentUpdateObserved" | "attachmentUpdateUnknown";
89
+ }>
90
+ | Readonly<{ code: ProgramAttachmentDisposeErrorCode; operation: "attachmentDispose" }>
91
+ | Readonly<{ code: ProgramAttachmentFreeErrorCode; operation: "attachmentFree" }>
92
+ | Readonly<{ code: ProgramPhysicalIdentityErrorCode; operation: "physicalIdentity" }>
93
+ | Readonly<{ code: ProgramMaterializationErrorCode; operation: "materializationAuthority" }>
94
+ );
95
+ export type ProgramErrorCode = ProgramError["code"];
96
+ export type ProgramOperation = ProgramError["operation"];
97
+ export declare function isProgramError(error: unknown): error is ProgramError;
98
+
99
+ export type CertificateDecodeErrorCode =
100
+ | "certificate_invalid_magic"
101
+ | "certificate_unsupported_schema"
102
+ | "certificate_unknown_operation"
103
+ | "certificate_unknown_authority_kind"
104
+ | "certificate_unsupported_authority_version"
105
+ | "certificate_invalid_utf8"
106
+ | "certificate_invalid_length"
107
+ | "certificate_truncated_input"
108
+ | "certificate_trailing_bytes"
109
+ | "certificate_non_canonical_revision"
110
+ | "certificate_invalid_payload_type"
111
+ | "certificate_unsupported_payload_version"
112
+ | "certificate_payload_digest_mismatch"
113
+ | "certificate_binding_digest_mismatch"
114
+ | "certificate_missing_producer_attestation"
115
+ | "certificate_producer_binding_mismatch"
116
+ | "certificate_runtime_artifact_mismatch"
117
+ | "certificate_producer_revision_mismatch"
118
+ | "certificate_content_identity_mismatch"
119
+ | "certificate_context_mismatch"
120
+ | "certificate_resource_limit_exceeded"
121
+ | "certificate_admission_capacity_exceeded"
122
+ | "certificate_unsupported_opaque"
123
+ | "certificate_binding_conflict"
124
+ | "certificate_invalid_input";
125
+ export type CertificateProducerErrorCode =
126
+ | Exclude<CertificateDecodeErrorCode, "certificate_invalid_input">
127
+ | "certificate_producer_identity_unavailable";
128
+ export type CertificateErrorCode = CertificateDecodeErrorCode | CertificateProducerErrorCode;
129
+ export type CertificateError = Error & (
130
+ | Readonly<{ code: CertificateDecodeErrorCode; operation: "decodeCertificateEnvelope" }>
131
+ | Readonly<{ code: CertificateProducerErrorCode; operation: "issueSourceCertificateEnvelope" }>
132
+ );
133
+ export interface UntrustedCertificateEnvelopeV1 {
134
+ readonly schemaVersion: 1;
135
+ readonly operation: "issue-certificate";
136
+ readonly authorityKind: "generic-typed-certificate";
137
+ readonly authorityVersion: 1;
138
+ readonly runtimeArtifactId: string;
139
+ readonly producerRevision: string;
140
+ readonly producerContentIdentity: Uint8Array;
141
+ readonly contextId: string;
142
+ readonly payloadType: "non-semantic-transport-v1";
143
+ readonly payloadVersion: 1;
144
+ readonly payloadLength: number;
145
+ readonly payloadSha256: Uint8Array;
146
+ readonly bindingSha256: Uint8Array;
147
+ }
148
+ export declare const MAX_CERTIFICATE_ENVELOPE_BYTES: 2097152;
149
+ export declare function decodeCertificateEnvelope(
150
+ bytes: Uint8Array,
151
+ ): UntrustedCertificateEnvelopeV1;
152
+ /**
153
+ * Копия канонических байтов сертификата встроенного дескриптора исходников Core.
154
+ * Не выдаёт capability или полномочий на приём.
155
+ * При недоступной идентичности бросает certificate_producer_identity_unavailable.
156
+ */
157
+ export declare function issueSourceCertificateEnvelope(): Uint8Array;
158
+ export declare function isCertificateError(error: unknown): error is CertificateError;
159
+
160
+ export type ProgramPointSinkOperation = "setAll" | "revokeAll" | "confirmExact";
161
+ export interface ProgramPointSinkPoint {
162
+ readonly slot: number;
163
+ readonly source: Uint8Array;
164
+ readonly opacity: number;
165
+ }
166
+ export interface ProgramPointSinkIntent {
167
+ readonly operation: ProgramPointSinkOperation;
168
+ readonly revision: bigint;
169
+ readonly expectedSequence: bigint;
170
+ readonly desiredSequence: bigint;
171
+ readonly bindingEpoch: bigint;
172
+ readonly sinkOutput: number;
173
+ readonly point: ProgramPointSinkPoint | null;
174
+ }
175
+ export type ProgramPointSinkHost = (intent: ProgramPointSinkIntent) => boolean;
176
+
177
+ type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
178
+ type SyncInitInput = BufferSource | WebAssembly.Module;
179
+
180
+ export declare function init(
181
+ input?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>,
182
+ ): Promise<void>;
183
+ export declare function initSync(input: { module: SyncInitInput } | SyncInitInput): void;
184
+ export default init;
185
+
186
+ export declare function evaluateWcag22(
187
+ foreground: string,
188
+ background: string,
189
+ criterion: Wcag22CriterionV1,
190
+ ): Wcag22AssessmentV1;
191
+
192
+ export declare function attachProgramWire(
193
+ bytes: Uint8Array,
194
+ streamId: number,
195
+ outputSlot: number,
196
+ sinkOutput: number,
197
+ presentationRoot: number,
198
+ occurrence: number,
199
+ host: ProgramPointSinkHost,
200
+ ): ProgramAttachment;
201
+
202
+
203
+ export type BindingError = Error & (
204
+ | Readonly<{
205
+ operation: "evaluateWcag22";
206
+ code: "invalid_color" | "unknown_wcag22_criterion" | "internal_error";
207
+ }>
208
+ | Readonly<{ operation: "numericalCapabilityManifest"; code: "internal_error" }>
209
+ | Readonly<{ operation: "readProgramOutput"; code: "invalid_output_index" }>
210
+ );
211
+ export declare function isBindingError(error: unknown): error is BindingError;