@samva/markup 0.1.1 → 0.2.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 (97) hide show
  1. package/AGENTS.md +25 -5
  2. package/README.md +92 -26
  3. package/dist/{ast-DAhnAvQN.d.ts → ast-63I-VLQx.d.ts} +15 -2
  4. package/dist/ast.d.ts +2 -2
  5. package/dist/ast.js +15 -2
  6. package/dist/{checks-CW0nFj5n.js → checks-DXuERO4B.js} +37 -3
  7. package/dist/checks.d.ts +8 -1
  8. package/dist/checks.js +2 -2
  9. package/dist/compile-sms.d.ts +2 -2
  10. package/dist/compile-whatsapp.d.ts +2 -2
  11. package/dist/compile.d.ts +9 -84
  12. package/dist/compile.js +11 -920
  13. package/dist/compiler.d.ts +301 -0
  14. package/dist/compiler.js +1389 -0
  15. package/dist/components.d.ts +4 -4
  16. package/dist/conditionals.js +1 -1
  17. package/dist/corpus-Dz5irJ9x.d.ts +161 -0
  18. package/dist/diagnostics-Djd9ckLg.d.ts +90 -0
  19. package/dist/diagnostics.js +6 -3
  20. package/dist/elements-DtwKlFVH.d.ts +820 -0
  21. package/dist/email/components.d.ts +119 -0
  22. package/dist/email/components.js +207 -0
  23. package/dist/email/diagnostics.d.ts +2 -0
  24. package/dist/email/diagnostics.js +56 -0
  25. package/dist/email/elements.d.ts +2 -0
  26. package/dist/email/elements.js +299 -0
  27. package/dist/email/html.d.ts +42 -0
  28. package/dist/email/html.js +266 -0
  29. package/dist/email/jsx-dev-runtime.d.ts +26 -0
  30. package/dist/email/jsx-dev-runtime.js +12 -0
  31. package/dist/email/jsx-runtime.d.ts +2 -0
  32. package/dist/email/jsx-runtime.js +60 -0
  33. package/dist/email/render.d.ts +36 -0
  34. package/dist/email/render.js +6 -0
  35. package/dist/email/selection.d.ts +102 -0
  36. package/dist/email/selection.js +143 -0
  37. package/dist/email/source-edit.d.ts +67 -0
  38. package/dist/email/source-edit.js +185 -0
  39. package/dist/email/stylesheets.d.ts +2 -0
  40. package/dist/email/stylesheets.js +43 -0
  41. package/dist/email/text.d.ts +7 -0
  42. package/dist/email/text.js +92 -0
  43. package/dist/emit.d.ts +13 -12
  44. package/dist/emit.js +63 -63
  45. package/dist/input-schema-BIfzI63B.d.ts +23 -0
  46. package/dist/input-schema.d.ts +2 -0
  47. package/dist/input-schema.js +170 -0
  48. package/dist/jsx-dev-runtime.d.ts +4 -3
  49. package/dist/jsx-dev-runtime.js +9 -1
  50. package/dist/{jsx-runtime-fSxcvlx4.d.ts → jsx-runtime-C5k_Zq0A.d.ts} +4 -4
  51. package/dist/jsx-runtime.d.ts +1 -1
  52. package/dist/jsx-runtime.js +20 -1
  53. package/dist/model.d.ts +1 -1
  54. package/dist/ops.d.ts +1 -1
  55. package/dist/ops.js +2 -2
  56. package/dist/{parser-yzjUOGhc.d.ts → parser-CGBS73Gz.d.ts} +12 -3
  57. package/dist/parser.d.ts +2 -2
  58. package/dist/parser.js +48 -9
  59. package/dist/predicate-CvkzT-a2.js +539 -0
  60. package/dist/{predicate-DTtVtLK7.d.ts → predicate-G2SeSvoN.d.ts} +9 -2
  61. package/dist/predicate.d.ts +2 -2
  62. package/dist/predicate.js +2 -417
  63. package/dist/presets/corpus.d.ts +2 -0
  64. package/dist/presets/corpus.js +186 -0
  65. package/dist/presets/public-gallery.d.ts +241 -459
  66. package/dist/presets/public-gallery.js +305 -5
  67. package/dist/presets/public-handoff.d.ts +75 -3
  68. package/dist/presets/public-handoff.js +220 -37
  69. package/dist/presets/public-preview-artifacts.js +20 -26
  70. package/dist/presets/public-preview.d.ts +40 -1152
  71. package/dist/presets/public-preview.js +388 -1152
  72. package/dist/presets/sources.d.ts +17 -4
  73. package/dist/presets/sources.js +1212 -43
  74. package/dist/presets.d.ts +2 -2
  75. package/dist/printer.d.ts +1 -1
  76. package/dist/render-Cddsy_XF.js +585 -0
  77. package/dist/render-template.d.ts +6 -3
  78. package/dist/render-template.js +4 -2
  79. package/dist/source-locations-BCJQnIfU.d.ts +89 -0
  80. package/dist/source-locations.d.ts +2 -0
  81. package/dist/source-locations.js +125 -0
  82. package/dist/stylesheets-oDRAnYA3.d.ts +94 -0
  83. package/dist/template-Dy5yOPyp.d.ts +60 -0
  84. package/dist/template.d.ts +2 -0
  85. package/dist/template.js +37 -0
  86. package/dist/tsx-source-instrumentation.d.ts +23 -0
  87. package/dist/tsx-source-instrumentation.js +97 -0
  88. package/dist/tsx-tracer.d.ts +116 -0
  89. package/dist/tsx-tracer.js +985 -0
  90. package/dist/{variables-3NGLpNTB.d.ts → variables-if1VrV34.d.ts} +2 -2
  91. package/dist/variables.d.ts +1 -1
  92. package/dist/variables.js +1 -1
  93. package/generated/sml-agent-contract.json +574 -782
  94. package/generated/sml-email-agent-contract.json +502 -677
  95. package/generated/sml-email-language-reference.md +94 -160
  96. package/generated/sml-language-reference.md +195 -220
  97. package/package.json +111 -8
@@ -1,7 +1,7 @@
1
- import { m as ElementNode } from "./ast-DAhnAvQN.js";
2
- import { i as EMAIL_TAG_SPECS, l as WHATSAPP_TAG_SPECS, o as TagSpec, t as AttributeSpec } from "./parser-yzjUOGhc.js";
3
- import { r as PredicateRef, s as VariableRef } from "./variables-3NGLpNTB.js";
4
- import { s as SmlChildren } from "./jsx-runtime-fSxcvlx4.js";
1
+ import { m as ElementNode } from "./ast-63I-VLQx.js";
2
+ import { i as EMAIL_TAG_SPECS, l as WHATSAPP_TAG_SPECS, o as TagSpec, t as AttributeSpec } from "./parser-CGBS73Gz.js";
3
+ import { r as PredicateRef, s as VariableRef } from "./variables-if1VrV34.js";
4
+ import { s as SmlChildren } from "./jsx-runtime-C5k_Zq0A.js";
5
5
  //#region src/components.d.ts
6
6
  /**
7
7
  * The scalar type an attribute spec accepts. `level` narrows to the Heading
@@ -1,4 +1,4 @@
1
- import { evaluatePredicate, parsePredicate } from "./predicate.js";
1
+ import { i as parsePredicate, r as evaluatePredicate } from "./predicate-CvkzT-a2.js";
2
2
  import { Result } from "effect";
3
3
  //#region src/conditionals.ts
4
4
  const IF_MARKER = "<!--sml:if:";
@@ -0,0 +1,161 @@
1
+ import { Result, Schema } from "effect";
2
+ //#region presets/corpus.d.ts
3
+ declare const TemplateCorpusKind: Schema.Literals<readonly ["owned-editable-sml", "inspiration-reference"]>;
4
+ type TemplateCorpusKind = typeof TemplateCorpusKind.Type;
5
+ declare const templateFacetOptions: {
6
+ readonly jobType: readonly ["account-access", "commerce", "product-communication", "lifecycle", "publishing-campaigns"];
7
+ readonly lifecycle: readonly ["acquisition", "activation", "engagement", "transaction", "retention", "recovery"];
8
+ readonly industry: readonly ["saas", "ecommerce", "developer-tools", "newsletters-media"];
9
+ readonly season: readonly ["evergreen", "seasonal"];
10
+ readonly audience: readonly ["product-users", "customers", "members", "readers", "shoppers", "teams"];
11
+ readonly design: readonly ["minimal", "branded", "editorial", "data-heavy", "single-cta"];
12
+ readonly brandProvenance: readonly ["samva-original", "third-party-reference"];
13
+ };
14
+ declare const TemplateFacetSet: Schema.Struct<{
15
+ readonly jobType: Schema.$Array<Schema.Literals<readonly ["account-access", "commerce", "product-communication", "lifecycle", "publishing-campaigns"]>>;
16
+ readonly lifecycle: Schema.$Array<Schema.Literals<readonly ["acquisition", "activation", "engagement", "transaction", "retention", "recovery"]>>;
17
+ readonly industry: Schema.$Array<Schema.Literals<readonly ["saas", "ecommerce", "developer-tools", "newsletters-media"]>>;
18
+ readonly season: Schema.$Array<Schema.Literals<readonly ["evergreen", "seasonal"]>>;
19
+ readonly audience: Schema.$Array<Schema.Literals<readonly ["product-users", "customers", "members", "readers", "shoppers", "teams"]>>;
20
+ readonly design: Schema.$Array<Schema.Literals<readonly ["minimal", "branded", "editorial", "data-heavy", "single-cta"]>>;
21
+ readonly brandProvenance: Schema.$Array<Schema.Literals<readonly ["samva-original", "third-party-reference"]>>;
22
+ }>;
23
+ interface TemplateFacetSet extends Schema.Schema.Type<typeof TemplateFacetSet> {}
24
+ declare const OwnedEditablePreset: Schema.TaggedStruct<"OwnedEditablePreset", {
25
+ readonly corpusKind: Schema.Literal<"owned-editable-sml">;
26
+ readonly provenance: Schema.Struct<{
27
+ readonly owner: Schema.Literal<"Samva">;
28
+ readonly sourcePath: Schema.String;
29
+ readonly recordedAt: Schema.String;
30
+ }>;
31
+ readonly review: Schema.Struct<{
32
+ readonly state: Schema.Literals<readonly ["draft", "approved", "rejected"]>;
33
+ readonly reviewedBy: Schema.String;
34
+ readonly reviewedAt: Schema.String;
35
+ readonly notes: Schema.String;
36
+ }>;
37
+ readonly display: Schema.Struct<{
38
+ readonly state: Schema.Literals<readonly ["hidden", "public"]>;
39
+ readonly attributionLabel: Schema.String;
40
+ }>;
41
+ readonly retention: Schema.Struct<{
42
+ readonly policy: Schema.Literals<readonly ["retain-until-withdrawn", "retain-while-linked"]>;
43
+ readonly reviewedAt: Schema.String;
44
+ }>;
45
+ readonly takedown: Schema.Struct<{
46
+ readonly state: Schema.Literals<readonly ["active", "removed"]>;
47
+ readonly contact: Schema.String;
48
+ readonly procedureUrl: Schema.String;
49
+ }>;
50
+ }>;
51
+ interface OwnedEditablePreset extends Schema.Schema.Type<typeof OwnedEditablePreset> {}
52
+ declare const InspirationReference: Schema.TaggedStruct<"InspirationReference", {
53
+ readonly corpusKind: Schema.Literal<"inspiration-reference">;
54
+ readonly provenance: Schema.Struct<{
55
+ readonly publisher: Schema.String;
56
+ readonly sourceUrl: Schema.String;
57
+ readonly capturedAt: Schema.String;
58
+ readonly rightsBasis: Schema.Literals<readonly ["display-link-and-commentary", "permission"]>;
59
+ }>;
60
+ readonly review: Schema.Struct<{
61
+ readonly state: Schema.Literals<readonly ["draft", "approved", "rejected"]>;
62
+ readonly reviewedBy: Schema.String;
63
+ readonly reviewedAt: Schema.String;
64
+ readonly notes: Schema.String;
65
+ }>;
66
+ readonly display: Schema.Struct<{
67
+ readonly state: Schema.Literals<readonly ["hidden", "public"]>;
68
+ readonly attributionLabel: Schema.String;
69
+ }>;
70
+ readonly retention: Schema.Struct<{
71
+ readonly policy: Schema.Literals<readonly ["retain-until-withdrawn", "retain-while-linked"]>;
72
+ readonly reviewedAt: Schema.String;
73
+ }>;
74
+ readonly takedown: Schema.Struct<{
75
+ readonly state: Schema.Literals<readonly ["active", "removed"]>;
76
+ readonly contact: Schema.String;
77
+ readonly procedureUrl: Schema.String;
78
+ }>;
79
+ }>;
80
+ interface InspirationReference extends Schema.Schema.Type<typeof InspirationReference> {}
81
+ declare const TemplateCorpusRecord: Schema.Union<readonly [Schema.TaggedStruct<"OwnedEditablePreset", {
82
+ readonly corpusKind: Schema.Literal<"owned-editable-sml">;
83
+ readonly provenance: Schema.Struct<{
84
+ readonly owner: Schema.Literal<"Samva">;
85
+ readonly sourcePath: Schema.String;
86
+ readonly recordedAt: Schema.String;
87
+ }>;
88
+ readonly review: Schema.Struct<{
89
+ readonly state: Schema.Literals<readonly ["draft", "approved", "rejected"]>;
90
+ readonly reviewedBy: Schema.String;
91
+ readonly reviewedAt: Schema.String;
92
+ readonly notes: Schema.String;
93
+ }>;
94
+ readonly display: Schema.Struct<{
95
+ readonly state: Schema.Literals<readonly ["hidden", "public"]>;
96
+ readonly attributionLabel: Schema.String;
97
+ }>;
98
+ readonly retention: Schema.Struct<{
99
+ readonly policy: Schema.Literals<readonly ["retain-until-withdrawn", "retain-while-linked"]>;
100
+ readonly reviewedAt: Schema.String;
101
+ }>;
102
+ readonly takedown: Schema.Struct<{
103
+ readonly state: Schema.Literals<readonly ["active", "removed"]>;
104
+ readonly contact: Schema.String;
105
+ readonly procedureUrl: Schema.String;
106
+ }>;
107
+ }>, Schema.TaggedStruct<"InspirationReference", {
108
+ readonly corpusKind: Schema.Literal<"inspiration-reference">;
109
+ readonly provenance: Schema.Struct<{
110
+ readonly publisher: Schema.String;
111
+ readonly sourceUrl: Schema.String;
112
+ readonly capturedAt: Schema.String;
113
+ readonly rightsBasis: Schema.Literals<readonly ["display-link-and-commentary", "permission"]>;
114
+ }>;
115
+ readonly review: Schema.Struct<{
116
+ readonly state: Schema.Literals<readonly ["draft", "approved", "rejected"]>;
117
+ readonly reviewedBy: Schema.String;
118
+ readonly reviewedAt: Schema.String;
119
+ readonly notes: Schema.String;
120
+ }>;
121
+ readonly display: Schema.Struct<{
122
+ readonly state: Schema.Literals<readonly ["hidden", "public"]>;
123
+ readonly attributionLabel: Schema.String;
124
+ }>;
125
+ readonly retention: Schema.Struct<{
126
+ readonly policy: Schema.Literals<readonly ["retain-until-withdrawn", "retain-while-linked"]>;
127
+ readonly reviewedAt: Schema.String;
128
+ }>;
129
+ readonly takedown: Schema.Struct<{
130
+ readonly state: Schema.Literals<readonly ["active", "removed"]>;
131
+ readonly contact: Schema.String;
132
+ readonly procedureUrl: Schema.String;
133
+ }>;
134
+ }>]>;
135
+ type TemplateCorpusRecord = typeof TemplateCorpusRecord.Type;
136
+ interface PublicCorpusRegistration {
137
+ readonly id: string;
138
+ readonly corpus: TemplateCorpusRecord;
139
+ readonly facets: TemplateFacetSet;
140
+ }
141
+ interface PublicCorpusRegistrationIssue {
142
+ readonly id: string;
143
+ readonly message: string;
144
+ }
145
+ /** Decode and gate a record before it can enter any public projection. */
146
+ declare const registerPublicCorpusEntry: (input: unknown) => Result.Result<PublicCorpusRegistration, PublicCorpusRegistrationIssue>;
147
+ declare const TemplateFacetQuery: Schema.Struct<{
148
+ readonly jobType: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["account-access", "commerce", "product-communication", "lifecycle", "publishing-campaigns"]>>>;
149
+ readonly lifecycle: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["acquisition", "activation", "engagement", "transaction", "retention", "recovery"]>>>;
150
+ readonly industry: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["saas", "ecommerce", "developer-tools", "newsletters-media"]>>>;
151
+ readonly season: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["evergreen", "seasonal"]>>>;
152
+ readonly audience: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["product-users", "customers", "members", "readers", "shoppers", "teams"]>>>;
153
+ readonly design: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["minimal", "branded", "editorial", "data-heavy", "single-cta"]>>>;
154
+ readonly brandProvenance: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["samva-original", "third-party-reference"]>>>;
155
+ }>;
156
+ interface TemplateFacetQuery extends Schema.Schema.Type<typeof TemplateFacetQuery> {}
157
+ /** Strict intersection: every selected value in every selected dimension must match. */
158
+ declare const matchesTemplateFacets: (facets: TemplateFacetSet, query: TemplateFacetQuery) => boolean;
159
+ //#endregion
160
+ export { TemplateCorpusKind as a, TemplateFacetSet as c, templateFacetOptions as d, PublicCorpusRegistrationIssue as i, matchesTemplateFacets as l, OwnedEditablePreset as n, TemplateCorpusRecord as o, PublicCorpusRegistration as r, TemplateFacetQuery as s, InspirationReference as t, registerPublicCorpusEntry as u };
161
+ //# sourceMappingURL=corpus-Dz5irJ9x.d.ts.map
@@ -0,0 +1,90 @@
1
+ import { Schema } from "effect";
2
+ //#region src/email/diagnostics.d.ts
3
+ declare const EmailDiagnosticSeverity: Schema.Literals<readonly ["error", "warning", "info"]>;
4
+ type EmailDiagnosticSeverity = typeof EmailDiagnosticSeverity.Type;
5
+ /** What the emitted document establishes beyond the client feature matrix. */
6
+ declare const EmailCompatibilityAssessment: Schema.Struct<{
7
+ readonly assessment: Schema.Literals<readonly ["risk", "degradation", "unverified", "not-applicable"]>;
8
+ /** A short description of the consequence or the remaining verification. */
9
+ readonly title: Schema.String;
10
+ }>;
11
+ type EmailCompatibilityAssessment = typeof EmailCompatibilityAssessment.Type;
12
+ declare const EmailDiagnostic: Schema.Struct<{
13
+ /** Stable identifier, e.g. `unsupported-element` or `caniemail/css-border-radius`. */
14
+ readonly code: Schema.String;
15
+ readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
16
+ /** States what is wrong and what to write instead. */
17
+ readonly message: Schema.String;
18
+ /** Innermost authoring element first, then each enclosing component call site. */
19
+ readonly origins: Schema.$Array<Schema.Struct<{
20
+ readonly fileName: Schema.String;
21
+ readonly lineNumber: Schema.Int;
22
+ readonly columnNumber: Schema.Int;
23
+ }>>;
24
+ /** Target clients a compatibility finding applies to. */
25
+ readonly clients: Schema.optional<Schema.$Array<Schema.String>>;
26
+ /** Partial-support notes and other caveats a client matrix carries. */
27
+ readonly notes: Schema.optional<Schema.String>;
28
+ /** Which pinned rule data produced the finding. */
29
+ readonly provenance: Schema.optional<Schema.String>;
30
+ /** Declared fixtures whose rendered output produced this finding. */
31
+ readonly fixtures: Schema.optional<Schema.$Array<Schema.String>>;
32
+ /** Source chains for every located emitted occurrence; origins identifies the first. */
33
+ readonly occurrences: Schema.optional<Schema.$Array<Schema.$Array<Schema.Struct<{
34
+ readonly fileName: Schema.String;
35
+ readonly lineNumber: Schema.Int;
36
+ readonly columnNumber: Schema.Int;
37
+ }>>>>;
38
+ /** Compatibility observations are not automatically defects or proof of client rendering. */
39
+ readonly compatibility: Schema.optional<Schema.Struct<{
40
+ readonly assessment: Schema.Literals<readonly ["risk", "degradation", "unverified", "not-applicable"]>;
41
+ /** A short description of the consequence or the remaining verification. */
42
+ readonly title: Schema.String;
43
+ }>>;
44
+ }>;
45
+ interface EmailDiagnostic extends Schema.Schema.Type<typeof EmailDiagnostic> {}
46
+ declare const EmailCompileError_base: Schema.Class<EmailCompileError, Schema.TaggedStruct<"EmailCompileError", {
47
+ readonly diagnostics: Schema.$Array<Schema.Struct<{
48
+ /** Stable identifier, e.g. `unsupported-element` or `caniemail/css-border-radius`. */
49
+ readonly code: Schema.String;
50
+ readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
51
+ /** States what is wrong and what to write instead. */
52
+ readonly message: Schema.String;
53
+ /** Innermost authoring element first, then each enclosing component call site. */
54
+ readonly origins: Schema.$Array<Schema.Struct<{
55
+ readonly fileName: Schema.String;
56
+ readonly lineNumber: Schema.Int;
57
+ readonly columnNumber: Schema.Int;
58
+ }>>;
59
+ /** Target clients a compatibility finding applies to. */
60
+ readonly clients: Schema.optional<Schema.$Array<Schema.String>>;
61
+ /** Partial-support notes and other caveats a client matrix carries. */
62
+ readonly notes: Schema.optional<Schema.String>;
63
+ /** Which pinned rule data produced the finding. */
64
+ readonly provenance: Schema.optional<Schema.String>;
65
+ /** Declared fixtures whose rendered output produced this finding. */
66
+ readonly fixtures: Schema.optional<Schema.$Array<Schema.String>>;
67
+ /** Source chains for every located emitted occurrence; origins identifies the first. */
68
+ readonly occurrences: Schema.optional<Schema.$Array<Schema.$Array<Schema.Struct<{
69
+ readonly fileName: Schema.String;
70
+ readonly lineNumber: Schema.Int;
71
+ readonly columnNumber: Schema.Int;
72
+ }>>>>;
73
+ /** Compatibility observations are not automatically defects or proof of client rendering. */
74
+ readonly compatibility: Schema.optional<Schema.Struct<{
75
+ readonly assessment: Schema.Literals<readonly ["risk", "degradation", "unverified", "not-applicable"]>;
76
+ /** A short description of the consequence or the remaining verification. */
77
+ readonly title: Schema.String;
78
+ }>>;
79
+ }>>;
80
+ }>, import("effect/Cause").YieldableError>;
81
+ declare class EmailCompileError extends EmailCompileError_base {
82
+ get message(): string;
83
+ }
84
+ /** `emails/welcome.tsx:12:3 unsupported-element: …` — the shape agents iterate on. */
85
+ declare const formatEmailDiagnostic: (diagnostic: EmailDiagnostic) => string;
86
+ /** True when a set of findings must stop the compile or refuse a publication. */
87
+ declare const hasBlockingDiagnostic: (diagnostics: readonly EmailDiagnostic[]) => boolean;
88
+ //#endregion
89
+ export { formatEmailDiagnostic as a, EmailDiagnosticSeverity as i, EmailCompileError as n, hasBlockingDiagnostic as o, EmailDiagnostic as r, EmailCompatibilityAssessment as t };
90
+ //# sourceMappingURL=diagnostics-Djd9ckLg.d.ts.map
@@ -21,12 +21,12 @@ const DiagnosticSchema = Schema.Struct({
21
21
  span: SpanSchema,
22
22
  repair: Schema.optional(DiagnosticRepairSchema)
23
23
  });
24
- var SmlParseError = class extends Schema.TaggedErrorClass()("SmlParseError", { diagnostics: Schema.Array(DiagnosticSchema) }) {
24
+ var SmlParseError = class extends Schema.TaggedError()("SmlParseError", { diagnostics: Schema.Array(DiagnosticSchema) }) {
25
25
  get message() {
26
26
  return this.diagnostics.map((diagnostic) => diagnostic.message).join("\n");
27
27
  }
28
28
  };
29
- var SmlCompileError = class extends Schema.TaggedErrorClass()("SmlCompileError", { diagnostics: Schema.Array(DiagnosticSchema) }) {
29
+ var SmlCompileError = class extends Schema.TaggedError()("SmlCompileError", { diagnostics: Schema.Array(DiagnosticSchema) }) {
30
30
  get message() {
31
31
  return this.diagnostics.map((diagnostic) => diagnostic.message).join("\n");
32
32
  }
@@ -34,7 +34,10 @@ var SmlCompileError = class extends Schema.TaggedErrorClass()("SmlCompileError",
34
34
  /** Newline-offset line map. Build once per source, query with `lineColumn`. */
35
35
  const buildLineMap = (source) => {
36
36
  const lineStarts = [0];
37
- for (let index = 0; index < source.length; index++) if (source.charCodeAt(index) === 10) lineStarts.push(index + 1);
37
+ for (let index = 0; index < source.length; index++) {
38
+ const code = source.charCodeAt(index);
39
+ if (code === 10 || code === 13 && source.charCodeAt(index + 1) !== 10 || code === 8232 || code === 8233) lineStarts.push(index + 1);
40
+ }
38
41
  return lineStarts;
39
42
  };
40
43
  /** 1-based line/column for an absolute offset, via binary search. */