@proposit/proposit-core 3.3.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -2
- package/dist/cli/commands/expressions.d.ts.map +1 -1
- package/dist/cli/commands/expressions.js +44 -0
- package/dist/cli/commands/expressions.js.map +1 -1
- package/dist/cli/commands/origins.d.ts +3 -0
- package/dist/cli/commands/origins.d.ts.map +1 -0
- package/dist/cli/commands/origins.js +264 -0
- package/dist/cli/commands/origins.js.map +1 -0
- package/dist/cli/commands/premises.d.ts.map +1 -1
- package/dist/cli/commands/premises.js +18 -2
- package/dist/cli/commands/premises.js.map +1 -1
- package/dist/cli/engine.d.ts.map +1 -1
- package/dist/cli/engine.js +5 -2
- package/dist/cli/engine.js.map +1 -1
- package/dist/cli/router.d.ts.map +1 -1
- package/dist/cli/router.js +1 -0
- package/dist/cli/router.js.map +1 -1
- package/dist/cli/schemata.d.ts +2 -0
- package/dist/cli/schemata.d.ts.map +1 -1
- package/dist/cli/schemata.js +14 -1
- package/dist/cli/schemata.js.map +1 -1
- package/dist/cli/storage/libraries.d.ts +4 -0
- package/dist/cli/storage/libraries.d.ts.map +1 -1
- package/dist/cli/storage/libraries.js +19 -0
- package/dist/cli/storage/libraries.js.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/extensions/basics/schemata.d.ts +2 -0
- package/dist/extensions/basics/schemata.d.ts.map +1 -1
- package/dist/extensions/citations/ieee/index.d.ts +1 -0
- package/dist/extensions/citations/ieee/index.d.ts.map +1 -1
- package/dist/extensions/citations/ieee/index.js +1 -0
- package/dist/extensions/citations/ieee/index.js.map +1 -1
- package/dist/extensions/citations/ieee/origin-document.d.ts +452 -0
- package/dist/extensions/citations/ieee/origin-document.d.ts.map +1 -0
- package/dist/extensions/citations/ieee/origin-document.js +25 -0
- package/dist/extensions/citations/ieee/origin-document.js.map +1 -0
- package/dist/extensions/pipelines/base/finalize-response-v2.d.ts +24 -0
- package/dist/extensions/pipelines/base/finalize-response-v2.d.ts.map +1 -1
- package/dist/extensions/pipelines/base/finalize-response-v2.js +249 -8
- package/dist/extensions/pipelines/base/finalize-response-v2.js.map +1 -1
- package/dist/extensions/pipelines/base/index.d.ts +3 -1
- package/dist/extensions/pipelines/base/index.d.ts.map +1 -1
- package/dist/extensions/pipelines/base/index.js +2 -1
- package/dist/extensions/pipelines/base/index.js.map +1 -1
- package/dist/extensions/pipelines/base/source-anchors.d.ts +58 -0
- package/dist/extensions/pipelines/base/source-anchors.d.ts.map +1 -0
- package/dist/extensions/pipelines/base/source-anchors.js +209 -0
- package/dist/extensions/pipelines/base/source-anchors.js.map +1 -0
- package/dist/extensions/pipelines/ingestion/canonical-stages.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/canonical-stages.js +1 -0
- package/dist/extensions/pipelines/ingestion/canonical-stages.js.map +1 -1
- package/dist/extensions/pipelines/ingestion/scholar/scholar.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/scholar/scholar.js +11 -1
- package/dist/extensions/pipelines/ingestion/scholar/scholar.js.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts +27 -11
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js +56 -22
- package/dist/extensions/pipelines/ingestion/scribe/extract-stage.js.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/schemas.d.ts +25 -1
- package/dist/extensions/pipelines/ingestion/scribe/schemas.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/schemas.js +25 -3
- package/dist/extensions/pipelines/ingestion/scribe/schemas.js.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/scribe.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/scribe.js +25 -4
- package/dist/extensions/pipelines/ingestion/scribe/scribe.js.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.d.ts +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.d.ts.map +1 -1
- package/dist/extensions/pipelines/ingestion/scribe/structure-stage.js +1 -1
- package/dist/lib/consts.d.ts.map +1 -1
- package/dist/lib/consts.js +27 -0
- package/dist/lib/consts.js.map +1 -1
- package/dist/lib/core/argument-engine.d.ts +5 -3
- package/dist/lib/core/argument-engine.d.ts.map +1 -1
- package/dist/lib/core/argument-engine.js +7 -4
- package/dist/lib/core/argument-engine.js.map +1 -1
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts +2 -1
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts.map +1 -1
- package/dist/lib/core/interfaces/index.d.ts +1 -1
- package/dist/lib/core/interfaces/index.d.ts.map +1 -1
- package/dist/lib/core/interfaces/library.interfaces.d.ts +72 -1
- package/dist/lib/core/interfaces/library.interfaces.d.ts.map +1 -1
- package/dist/lib/core/origin-library.d.ts +127 -0
- package/dist/lib/core/origin-library.d.ts.map +1 -0
- package/dist/lib/core/origin-library.js +520 -0
- package/dist/lib/core/origin-library.js.map +1 -0
- package/dist/lib/core/premise-engine.d.ts.map +1 -1
- package/dist/lib/core/premise-engine.js +20 -3
- package/dist/lib/core/premise-engine.js.map +1 -1
- package/dist/lib/core/proposit-core.d.ts +15 -8
- package/dist/lib/core/proposit-core.d.ts.map +1 -1
- package/dist/lib/core/proposit-core.js +28 -3
- package/dist/lib/core/proposit-core.js.map +1 -1
- package/dist/lib/grammar/types.d.ts +2 -2
- package/dist/lib/grammar/types.d.ts.map +1 -1
- package/dist/lib/grammar/types.js +2 -1
- package/dist/lib/grammar/types.js.map +1 -1
- package/dist/lib/grammar/validators/presentable.d.ts +19 -0
- package/dist/lib/grammar/validators/presentable.d.ts.map +1 -1
- package/dist/lib/grammar/validators/presentable.js +57 -0
- package/dist/lib/grammar/validators/presentable.js.map +1 -1
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +3 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/parsing/argument-parser.d.ts.map +1 -1
- package/dist/lib/parsing/argument-parser.js +4 -3
- package/dist/lib/parsing/argument-parser.js.map +1 -1
- package/dist/lib/schemata/index.d.ts +1 -0
- package/dist/lib/schemata/index.d.ts.map +1 -1
- package/dist/lib/schemata/index.js +1 -0
- package/dist/lib/schemata/index.js.map +1 -1
- package/dist/lib/schemata/origin.d.ts +48 -0
- package/dist/lib/schemata/origin.d.ts.map +1 -0
- package/dist/lib/schemata/origin.js +102 -0
- package/dist/lib/schemata/origin.js.map +1 -0
- package/dist/lib/schemata/propositional.d.ts +6 -0
- package/dist/lib/schemata/propositional.d.ts.map +1 -1
- package/dist/lib/schemata/propositional.js +13 -0
- package/dist/lib/schemata/propositional.js.map +1 -1
- package/dist/lib/types/checksum.d.ts +3 -0
- package/dist/lib/types/checksum.d.ts.map +1 -1
- package/dist/lib/types/validation.d.ts +19 -1
- package/dist/lib/types/validation.d.ts.map +1 -1
- package/dist/lib/types/validation.js +19 -0
- package/dist/lib/types/validation.js.map +1 -1
- package/dist/lib/utils/collections.d.ts +15 -0
- package/dist/lib/utils/collections.d.ts.map +1 -1
- package/dist/lib/utils/collections.js +17 -0
- package/dist/lib/utils/collections.js.map +1 -1
- package/dist/lib/utils/origin-text.d.ts +62 -0
- package/dist/lib/utils/origin-text.d.ts.map +1 -0
- package/dist/lib/utils/origin-text.js +204 -0
- package/dist/lib/utils/origin-text.js.map +1 -0
- package/dist/lib/utils/sha256.d.ts +6 -0
- package/dist/lib/utils/sha256.d.ts.map +1 -0
- package/dist/lib/utils/sha256.js +98 -0
- package/dist/lib/utils/sha256.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Origin data — the source text an argument was built from, its association
|
|
2
|
+
// with an argument version, and the spans of it individual argument parts
|
|
3
|
+
// derive from.
|
|
4
|
+
//
|
|
5
|
+
// The document text is opaque content: core stores it, digests it, and slices
|
|
6
|
+
// it by index, but never parses, renders, formats, or interprets it. Nothing
|
|
7
|
+
// here gives core a notion of user, session, or presentation.
|
|
8
|
+
//
|
|
9
|
+
// Every entity carries `additionalProperties: true`, following
|
|
10
|
+
// `CoreClaimConnectionSchema` — an application extends them with its own
|
|
11
|
+
// fields, and an IEEE attribution rides on a document through the same slot
|
|
12
|
+
// (see `extensions/citations/ieee/origin-document.ts`), exactly as an IEEE
|
|
13
|
+
// citation rides on `CoreClaimSchema`.
|
|
14
|
+
import Type, {} from "typebox";
|
|
15
|
+
import { UUID } from "./shared.js";
|
|
16
|
+
export const OriginStanceSchema = Type.Union([Type.Literal("representation"), Type.Literal("seed")], {
|
|
17
|
+
description: "What an argument claims about its source text. 'representation' asserts the argument faithfully renders the source, so unanchored content is meaningful; 'seed' says only that the argument started from the source.",
|
|
18
|
+
});
|
|
19
|
+
export const OriginAnchorTargetTypeSchema = Type.Union([
|
|
20
|
+
Type.Literal("expression"),
|
|
21
|
+
Type.Literal("premise"),
|
|
22
|
+
Type.Literal("argument"),
|
|
23
|
+
], {
|
|
24
|
+
description: "What an anchor points at. Argument-scoped only: a global claim is excluded because a claim is shared by reference across arguments, so 'where did it come from' has no single answer — the provenance belongs to this argument's use of it.",
|
|
25
|
+
});
|
|
26
|
+
export const OriginSegmentSchema = Type.Object({
|
|
27
|
+
segmentId: Type.String({
|
|
28
|
+
description: "Producer-assigned identifier for this segment.",
|
|
29
|
+
}),
|
|
30
|
+
startCodePoint: Type.Number({
|
|
31
|
+
description: "Inclusive start of the segment, counted in Unicode code points.",
|
|
32
|
+
}),
|
|
33
|
+
endCodePoint: Type.Number({
|
|
34
|
+
description: "Exclusive end of the segment, counted in Unicode code points.",
|
|
35
|
+
}),
|
|
36
|
+
}, {
|
|
37
|
+
additionalProperties: true,
|
|
38
|
+
description: "One entry of a document's optional segmentation overlay. Not load-bearing — nothing in core reads it, anchors do not depend on it, and segments need not cover the whole text.",
|
|
39
|
+
});
|
|
40
|
+
export const CoreOriginDocumentSchema = Type.Object({
|
|
41
|
+
id: UUID,
|
|
42
|
+
text: Type.String({
|
|
43
|
+
description: "The source text, normalized by `normalizeOriginText`. Immutable: correcting a document means replacing it, which invalidates its anchors by design. This string is the coordinate system every anchor indexes into.",
|
|
44
|
+
}),
|
|
45
|
+
digest: Type.String({
|
|
46
|
+
description: "SHA-256 of the normalized text, as 64 lowercase hex characters. Makes duplicate texts detectable; whether a duplicate may be reused is a consumer policy decision.",
|
|
47
|
+
}),
|
|
48
|
+
segments: Type.Optional(Type.Array(OriginSegmentSchema, {
|
|
49
|
+
description: "Optional segmentation overlay. Present only when a producer supplied one.",
|
|
50
|
+
})),
|
|
51
|
+
checksum: Type.String({
|
|
52
|
+
description: "Entity checksum for sync detection.",
|
|
53
|
+
}),
|
|
54
|
+
}, {
|
|
55
|
+
additionalProperties: true,
|
|
56
|
+
description: "An immutable source text an argument was built from. Extended via additionalProperties for app-level fields and for attribution metadata.",
|
|
57
|
+
});
|
|
58
|
+
export const CoreOriginLinkSchema = Type.Object({
|
|
59
|
+
id: UUID,
|
|
60
|
+
argumentId: UUID,
|
|
61
|
+
argumentVersion: Type.Number({
|
|
62
|
+
description: "The argument version this link attaches the document to. Links are per-version, so a new version records its own stance.",
|
|
63
|
+
}),
|
|
64
|
+
documentId: UUID,
|
|
65
|
+
stance: OriginStanceSchema,
|
|
66
|
+
checksum: Type.String({
|
|
67
|
+
description: "Entity checksum for sync detection.",
|
|
68
|
+
}),
|
|
69
|
+
}, {
|
|
70
|
+
additionalProperties: true,
|
|
71
|
+
description: "An association between one argument version and one origin document, carrying the stance the author takes toward that source.",
|
|
72
|
+
});
|
|
73
|
+
export const CoreOriginAnchorSchema = Type.Object({
|
|
74
|
+
id: UUID,
|
|
75
|
+
argumentId: UUID,
|
|
76
|
+
argumentVersion: Type.Number(),
|
|
77
|
+
documentId: UUID,
|
|
78
|
+
targetType: OriginAnchorTargetTypeSchema,
|
|
79
|
+
targetId: UUID,
|
|
80
|
+
exact: Type.String({
|
|
81
|
+
description: "The quoted passage. Durable identity for this anchor: the positions are a fast path, and this is what survives if they ever stop agreeing.",
|
|
82
|
+
}),
|
|
83
|
+
prefix: Type.Optional(Type.String({
|
|
84
|
+
description: "Text immediately before the quote, used to disambiguate a passage that occurs more than once.",
|
|
85
|
+
})),
|
|
86
|
+
suffix: Type.Optional(Type.String({
|
|
87
|
+
description: "Text immediately after the quote, used to disambiguate a passage that occurs more than once.",
|
|
88
|
+
})),
|
|
89
|
+
startCodePoint: Type.Number({
|
|
90
|
+
description: "Inclusive start of the quote in the document, counted in Unicode code points — never UTF-16 code units. Slice it with `sliceByCodePoints`; a bare `String.prototype.slice` is wrong on any astral-plane character.",
|
|
91
|
+
}),
|
|
92
|
+
endCodePoint: Type.Number({
|
|
93
|
+
description: "Exclusive end of the quote in the document, counted in Unicode code points.",
|
|
94
|
+
}),
|
|
95
|
+
checksum: Type.String({
|
|
96
|
+
description: "Entity checksum for sync detection.",
|
|
97
|
+
}),
|
|
98
|
+
}, {
|
|
99
|
+
additionalProperties: true,
|
|
100
|
+
description: "A span of an origin document that one part of one argument version derives from. Carries both of the Web Annotation Data Model's text selectors — the quote with its surrounding context, and the code-point positions.",
|
|
101
|
+
});
|
|
102
|
+
//# sourceMappingURL=origin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"origin.js","sourceRoot":"","sources":["../../../src/lib/schemata/origin.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,0EAA0E;AAC1E,eAAe;AACf,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,8DAA8D;AAC9D,EAAE;AACF,+DAA+D;AAC/D,yEAAyE;AACzE,4EAA4E;AAC5E,2EAA2E;AAC3E,uCAAuC;AAEvC,OAAO,IAAI,EAAE,EAAe,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,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C;CACL,EACD;IACI,oBAAoB,EAAE,IAAI;IAC1B,WAAW,EACP,yNAAyN;CAChO,CACJ,CAAA"}
|
|
@@ -13,6 +13,7 @@ export declare const CorePropositionalVariableExpressionSchema: Type.TObject<{
|
|
|
13
13
|
combinedChecksum: Type.TString;
|
|
14
14
|
type: Type.TLiteral<"variable">;
|
|
15
15
|
variableId: Type.TString;
|
|
16
|
+
enthymeme: Type.TOptional<Type.TLiteral<true>>;
|
|
16
17
|
}>;
|
|
17
18
|
export type TCorePropositionalVariableExpression = Static<typeof CorePropositionalVariableExpressionSchema>;
|
|
18
19
|
export declare const CoreLogicalOperatorType: Type.TUnion<[Type.TLiteral<"not">, Type.TLiteral<"and">, Type.TLiteral<"or">, Type.TLiteral<"implies">, Type.TLiteral<"iff">]>;
|
|
@@ -56,6 +57,7 @@ export declare const CorePropositionalExpressionSchema: Type.TUnion<[Type.TObjec
|
|
|
56
57
|
combinedChecksum: Type.TString;
|
|
57
58
|
type: Type.TLiteral<"variable">;
|
|
58
59
|
variableId: Type.TString;
|
|
60
|
+
enthymeme: Type.TOptional<Type.TLiteral<true>>;
|
|
59
61
|
}>, Type.TObject<{
|
|
60
62
|
id: Type.TString;
|
|
61
63
|
argumentId: Type.TString;
|
|
@@ -138,6 +140,7 @@ export declare const CoreFreeformPremiseSchema: Type.TObject<{
|
|
|
138
140
|
checksum: Type.TString;
|
|
139
141
|
descendantChecksum: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
140
142
|
combinedChecksum: Type.TString;
|
|
143
|
+
enthymeme: Type.TOptional<Type.TLiteral<true>>;
|
|
141
144
|
}>;
|
|
142
145
|
export declare const CoreDerivationPremiseSchema: Type.TObject<{
|
|
143
146
|
type: Type.TLiteral<"derivation">;
|
|
@@ -148,6 +151,7 @@ export declare const CoreDerivationPremiseSchema: Type.TObject<{
|
|
|
148
151
|
checksum: Type.TString;
|
|
149
152
|
descendantChecksum: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
150
153
|
combinedChecksum: Type.TString;
|
|
154
|
+
enthymeme: Type.TOptional<Type.TLiteral<true>>;
|
|
151
155
|
}>;
|
|
152
156
|
export declare const CorePremiseSchema: Type.TUnion<[Type.TObject<{
|
|
153
157
|
type: Type.TLiteral<"freeform">;
|
|
@@ -157,6 +161,7 @@ export declare const CorePremiseSchema: Type.TUnion<[Type.TObject<{
|
|
|
157
161
|
checksum: Type.TString;
|
|
158
162
|
descendantChecksum: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
159
163
|
combinedChecksum: Type.TString;
|
|
164
|
+
enthymeme: Type.TOptional<Type.TLiteral<true>>;
|
|
160
165
|
}>, Type.TObject<{
|
|
161
166
|
type: Type.TLiteral<"derivation">;
|
|
162
167
|
derivedClaimId: Type.TString;
|
|
@@ -166,6 +171,7 @@ export declare const CorePremiseSchema: Type.TUnion<[Type.TObject<{
|
|
|
166
171
|
checksum: Type.TString;
|
|
167
172
|
descendantChecksum: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
168
173
|
combinedChecksum: Type.TString;
|
|
174
|
+
enthymeme: Type.TOptional<Type.TLiteral<true>>;
|
|
169
175
|
}>]>;
|
|
170
176
|
export type TCoreFreeformPremise = Static<typeof CoreFreeformPremiseSchema>;
|
|
171
177
|
export type TCoreDerivationPremise = Static<typeof CoreDerivationPremiseSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propositional.d.ts","sourceRoot":"","sources":["../../../src/lib/schemata/propositional.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAO3C,eAAO,MAAM,gCAAgC,+FAI3C,CAAA;AACF,MAAM,MAAM,iCAAiC,GAAG,MAAM,CAClD,OAAO,gCAAgC,CAC1C,CAAA;
|
|
1
|
+
{"version":3,"file":"propositional.d.ts","sourceRoot":"","sources":["../../../src/lib/schemata/propositional.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,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M,MAAM,0BAA0B,GAAG,MAAM,CAC3C,OAAO,+BAA+B,CACzC,CAAA;AAED,iEAAiE;AACjE,wBAAgB,YAAY,CACxB,CAAC,EAAE,0BAA0B,GAC9B,CAAC,IAAI,mBAAmB,CAE1B;AAED,mEAAmE;AACnE,wBAAgB,cAAc,CAC1B,CAAC,EAAE,0BAA0B,GAC9B,CAAC,IAAI,qBAAqB,CAE5B;AAED,iGAAiG;AACjG,wBAAgB,iBAAiB,CAC7B,CAAC,EAAE,qBAAqB,EACxB,UAAU,EAAE,MAAM,GACnB,OAAO,CAET;AAoBD,eAAO,MAAM,yBAAyB;;;;;;;;;EAUrC,CAAA;AAED,eAAO,MAAM,2BAA2B;;;;;;;;;;EAWvC,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;IAM7B,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAC3E,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAC/E,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -29,9 +29,21 @@ const BasePropositionalExpressionSchema = Type.Object({
|
|
|
29
29
|
description: "Hash of checksum + descendantChecksum. Equals checksum when descendantChecksum is null.",
|
|
30
30
|
}),
|
|
31
31
|
});
|
|
32
|
+
// Optional and `true`-only, deliberately neither `Nullable` nor a plain
|
|
33
|
+
// boolean. Entity checksums include a field only when it is present on the
|
|
34
|
+
// entity, so an unmarked entity omitting the key hashes exactly as it did
|
|
35
|
+
// before this field existed — but `null` and `false` are both *present*, and
|
|
36
|
+
// either would change the checksum of every expression and premise in
|
|
37
|
+
// existence. `false` is the likelier of the two to arrive by accident, from an
|
|
38
|
+
// unchecked form control or an ORM default, so the schema refuses it rather
|
|
39
|
+
// than trusting every writer to know the difference. Unmarking deletes the key.
|
|
40
|
+
const EnthymemeField = Type.Optional(Type.Literal(true, {
|
|
41
|
+
description: "Present and true when this content is left unspoken in the natural-language original. Declared by an author, never derived. Omit the key entirely when unmarked — null and false are both present values and are not the same as absent.",
|
|
42
|
+
}));
|
|
32
43
|
export const CorePropositionalVariableExpressionSchema = Type.Interface([BasePropositionalExpressionSchema], {
|
|
33
44
|
type: VariableType,
|
|
34
45
|
variableId: UUID,
|
|
46
|
+
enthymeme: EnthymemeField,
|
|
35
47
|
});
|
|
36
48
|
export const CoreLogicalOperatorType = Type.Union([
|
|
37
49
|
Type.Literal("not"), // unary
|
|
@@ -113,6 +125,7 @@ const CommonPremiseFields = {
|
|
|
113
125
|
combinedChecksum: Type.String({
|
|
114
126
|
description: "Hash of checksum + descendantChecksum. Equals checksum when descendantChecksum is null.",
|
|
115
127
|
}),
|
|
128
|
+
enthymeme: EnthymemeField,
|
|
116
129
|
};
|
|
117
130
|
export const CoreFreeformPremiseSchema = Type.Object({
|
|
118
131
|
...CommonPremiseFields,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propositional.js","sourceRoot":"","sources":["../../../src/lib/schemata/propositional.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAe,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;AAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;AAC7C,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;AAE3C,MAAM,CAAC,MAAM,gCAAgC,GAAG,IAAI,CAAC,KAAK,CAAC;IACvD,YAAY;IACZ,YAAY;IACZ,WAAW;CACd,CAAC,CAAA;AAKF,MAAM,iCAAiC,GAAG,IAAI,CAAC,MAAM,CAAC;IAClD,EAAE,EAAE,IAAI;IACR,UAAU,EAAE,I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AM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC,MAAM,CAClD;IACI,GAAG,mBAAmB;IACtB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;IAChC,cAAc,EAAE,IAAI;CACvB,EACD;IACI,oBAAoB,EAAE,IAAI;IAC1B,WAAW,EACP,iHAAiH;CACxH,CACJ,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CACvC,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,EACxD;IACI,WAAW,EACP,+HAA+H;CACtI,CACJ,CAAA"}
|
|
@@ -16,5 +16,8 @@ export interface TCoreChecksumConfig {
|
|
|
16
16
|
claimCitationFields?: Set<string>;
|
|
17
17
|
/** Fields to hash for claim axioms. Defaults to ["claimId", "claimVersion", "supportingClaimId", "supportingClaimVersion"]. */
|
|
18
18
|
claimAxiomFields?: Set<string>;
|
|
19
|
+
originDocumentFields?: Set<string>;
|
|
20
|
+
originLinkFields?: Set<string>;
|
|
21
|
+
originAnchorFields?: Set<string>;
|
|
19
22
|
}
|
|
20
23
|
//# sourceMappingURL=checksum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checksum.d.ts","sourceRoot":"","sources":["../../../src/lib/types/checksum.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,WAAW,mBAAmB;IAChC,kGAAkG;IAClG,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC9B,yFAAyF;IACzF,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC5B,0FAA0F;IAC1F,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,qEAAqE;IACrE,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC5B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACxB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,kIAAkI;IAClI,mBAAmB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACjC,+HAA+H;IAC/H,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"checksum.d.ts","sourceRoot":"","sources":["../../../src/lib/types/checksum.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,WAAW,mBAAmB;IAChC,kGAAkG;IAClG,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC9B,yFAAyF;IACzF,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC5B,0FAA0F;IAC1F,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,qEAAqE;IACrE,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC5B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACxB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,kIAAkI;IAClI,mBAAmB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACjC,+HAA+H;IAC/H,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC9B,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAClC,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC9B,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACnC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TInvariantViolationEntityType = "expression" | "variable" | "premise" | "argument" | "claim" | "citation" | "axiom" | "fork" | "forkRecord";
|
|
1
|
+
export type TInvariantViolationEntityType = "expression" | "variable" | "premise" | "argument" | "claim" | "citation" | "axiom" | "fork" | "forkRecord" | "originDocument" | "originLink" | "originAnchor";
|
|
2
2
|
export type TInvariantViolation = {
|
|
3
3
|
code: string;
|
|
4
4
|
message: string;
|
|
@@ -55,6 +55,24 @@ export declare const AXIOM_CLAIM_NOT_NORMAL_TYPE = "AXIOM_CLAIM_NOT_NORMAL_TYPE"
|
|
|
55
55
|
export declare const AXIOM_VARIABLE_ASSIGNMENT_FORBIDDEN = "AXIOM_VARIABLE_ASSIGNMENT_FORBIDDEN";
|
|
56
56
|
export declare const AXIOM_NOT_FOUND = "AXIOM_NOT_FOUND";
|
|
57
57
|
export declare const LEGACY_MISSING_AXIOM_SLOT = "LEGACY_MISSING_AXIOM_SLOT";
|
|
58
|
+
export declare const ORIGIN_DOCUMENT_SCHEMA_INVALID = "ORIGIN_DOCUMENT_SCHEMA_INVALID";
|
|
59
|
+
export declare const ORIGIN_LINK_SCHEMA_INVALID = "ORIGIN_LINK_SCHEMA_INVALID";
|
|
60
|
+
export declare const ORIGIN_ANCHOR_SCHEMA_INVALID = "ORIGIN_ANCHOR_SCHEMA_INVALID";
|
|
61
|
+
export declare const ORIGIN_DOCUMENT_DUPLICATE_ID = "ORIGIN_DOCUMENT_DUPLICATE_ID";
|
|
62
|
+
export declare const ORIGIN_LINK_DUPLICATE_ID = "ORIGIN_LINK_DUPLICATE_ID";
|
|
63
|
+
export declare const ORIGIN_ANCHOR_DUPLICATE_ID = "ORIGIN_ANCHOR_DUPLICATE_ID";
|
|
64
|
+
export declare const ORIGIN_DOCUMENT_REF_NOT_FOUND = "ORIGIN_DOCUMENT_REF_NOT_FOUND";
|
|
65
|
+
export declare const ORIGIN_DOCUMENT_DIGEST_MISMATCH = "ORIGIN_DOCUMENT_DIGEST_MISMATCH";
|
|
66
|
+
export declare const ORIGIN_DOCUMENT_TEXT_NOT_NORMALIZED = "ORIGIN_DOCUMENT_TEXT_NOT_NORMALIZED";
|
|
67
|
+
export declare const ORIGIN_ANCHOR_SPAN_OUT_OF_RANGE = "ORIGIN_ANCHOR_SPAN_OUT_OF_RANGE";
|
|
68
|
+
/** The anchor's span does not slice out its own quote — an anchor at an unverified offset. */
|
|
69
|
+
export declare const ORIGIN_ANCHOR_QUOTE_MISMATCH = "ORIGIN_ANCHOR_QUOTE_MISMATCH";
|
|
70
|
+
/** The anchor's argument version is not linked to the document it anchors into. */
|
|
71
|
+
export declare const ORIGIN_ANCHOR_LINK_NOT_FOUND = "ORIGIN_ANCHOR_LINK_NOT_FOUND";
|
|
72
|
+
export declare const ORIGIN_DOCUMENT_NOT_FOUND = "ORIGIN_DOCUMENT_NOT_FOUND";
|
|
73
|
+
export declare const ORIGIN_LINK_NOT_FOUND = "ORIGIN_LINK_NOT_FOUND";
|
|
74
|
+
export declare const ORIGIN_ANCHOR_NOT_FOUND = "ORIGIN_ANCHOR_NOT_FOUND";
|
|
75
|
+
export declare const ORIGIN_DOCUMENT_IN_USE = "ORIGIN_DOCUMENT_IN_USE";
|
|
58
76
|
export declare const DERIVATION_STRUCTURE_INVALID = "DERIVATION_STRUCTURE_INVALID";
|
|
59
77
|
export declare const CREATE_DERIVATION_REQUIRES_DERIVED_CLAIM_ID = "CREATE_DERIVATION_REQUIRES_DERIVED_CLAIM_ID";
|
|
60
78
|
export declare const CREATE_DERIVATION_CLAIM_NOT_FOUND = "CREATE_DERIVATION_CLAIM_NOT_FOUND";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/lib/types/validation.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,6BAA6B,GACnC,YAAY,GACZ,UAAU,GACV,SAAS,GACT,UAAU,GACV,OAAO,GACP,UAAU,GACV,OAAO,GACP,MAAM,GACN,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/lib/types/validation.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,6BAA6B,GACnC,YAAY,GACZ,UAAU,G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E,eAAO,MAAM,wBAAwB,6BAA6B,CAAA;AAClE,eAAO,MAAM,0BAA0B,+BAA+B,CAAA;AACtE,eAAO,MAAM,6BAA6B,kCAAkC,CAAA;AAC5E,eAAO,MAAM,+BAA+B,oCAAoC,CAAA;AAChF,eAAO,MAAM,mCAAmC,wCACP,CAAA;AACzC,eAAO,MAAM,+BAA+B,oCAAoC,CAAA;AAChF,8FAA8F;AAC9F,eAAO,MAAM,4BAA4B,iCAAiC,CAAA;AAC1E,mFAAmF;AACnF,eAAO,MAAM,4BAA4B,iCAAiC,CAAA;AAC1E,eAAO,MAAM,yBAAyB,8BAA8B,CAAA;AACpE,eAAO,MAAM,qBAAqB,0BAA0B,CAAA;AAC5D,eAAO,MAAM,uBAAuB,4BAA4B,CAAA;AAChE,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAqB9D,eAAO,MAAM,4BAA4B,iCAAiC,CAAA;AAC1E,eAAO,MAAM,2CAA2C,gDACP,CAAA;AACjD,eAAO,MAAM,iCAAiC,sCACP,CAAA;AACvC,eAAO,MAAM,eAAe,oBAAoB,CAAA;AAChD,eAAO,MAAM,2BAA2B,gCAAgC,CAAA;AAGxE,eAAO,MAAM,0BAA0B,+BAA+B,CAAA"}
|
|
@@ -58,6 +58,25 @@ export const AXIOM_VARIABLE_ASSIGNMENT_FORBIDDEN = "AXIOM_VARIABLE_ASSIGNMENT_FO
|
|
|
58
58
|
export const AXIOM_NOT_FOUND = "AXIOM_NOT_FOUND";
|
|
59
59
|
// -- AxiomLibrary legacy codes --
|
|
60
60
|
export const LEGACY_MISSING_AXIOM_SLOT = "LEGACY_MISSING_AXIOM_SLOT";
|
|
61
|
+
// -- OriginLibrary codes --
|
|
62
|
+
export const ORIGIN_DOCUMENT_SCHEMA_INVALID = "ORIGIN_DOCUMENT_SCHEMA_INVALID";
|
|
63
|
+
export const ORIGIN_LINK_SCHEMA_INVALID = "ORIGIN_LINK_SCHEMA_INVALID";
|
|
64
|
+
export const ORIGIN_ANCHOR_SCHEMA_INVALID = "ORIGIN_ANCHOR_SCHEMA_INVALID";
|
|
65
|
+
export const ORIGIN_DOCUMENT_DUPLICATE_ID = "ORIGIN_DOCUMENT_DUPLICATE_ID";
|
|
66
|
+
export const ORIGIN_LINK_DUPLICATE_ID = "ORIGIN_LINK_DUPLICATE_ID";
|
|
67
|
+
export const ORIGIN_ANCHOR_DUPLICATE_ID = "ORIGIN_ANCHOR_DUPLICATE_ID";
|
|
68
|
+
export const ORIGIN_DOCUMENT_REF_NOT_FOUND = "ORIGIN_DOCUMENT_REF_NOT_FOUND";
|
|
69
|
+
export const ORIGIN_DOCUMENT_DIGEST_MISMATCH = "ORIGIN_DOCUMENT_DIGEST_MISMATCH";
|
|
70
|
+
export const ORIGIN_DOCUMENT_TEXT_NOT_NORMALIZED = "ORIGIN_DOCUMENT_TEXT_NOT_NORMALIZED";
|
|
71
|
+
export const ORIGIN_ANCHOR_SPAN_OUT_OF_RANGE = "ORIGIN_ANCHOR_SPAN_OUT_OF_RANGE";
|
|
72
|
+
/** The anchor's span does not slice out its own quote — an anchor at an unverified offset. */
|
|
73
|
+
export const ORIGIN_ANCHOR_QUOTE_MISMATCH = "ORIGIN_ANCHOR_QUOTE_MISMATCH";
|
|
74
|
+
/** The anchor's argument version is not linked to the document it anchors into. */
|
|
75
|
+
export const ORIGIN_ANCHOR_LINK_NOT_FOUND = "ORIGIN_ANCHOR_LINK_NOT_FOUND";
|
|
76
|
+
export const ORIGIN_DOCUMENT_NOT_FOUND = "ORIGIN_DOCUMENT_NOT_FOUND";
|
|
77
|
+
export const ORIGIN_LINK_NOT_FOUND = "ORIGIN_LINK_NOT_FOUND";
|
|
78
|
+
export const ORIGIN_ANCHOR_NOT_FOUND = "ORIGIN_ANCHOR_NOT_FOUND";
|
|
79
|
+
export const ORIGIN_DOCUMENT_IN_USE = "ORIGIN_DOCUMENT_IN_USE";
|
|
61
80
|
// -- Derivation premise errors --
|
|
62
81
|
// `DERIVATION_TYPE_MISMATCH`, `DERIVATION_CONSEQUENT_LOCKED`,
|
|
63
82
|
// `DERIVATION_ROOT_OPERATOR_INVALID`, and `DERIVATION_ANTECEDENT_NON_EMPTY`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/lib/types/validation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/lib/types/validation.ts"],"names":[],"mappings":"AA2BA,+BAA+B;AAC/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAA;AACxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AACpD,MAAM,CAAC,MAAM,4BAA4B,GAAG,8BAA8B,CAAA;AAC1E,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAA;AAC5D,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAA;AACpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAA;AAChE,kEAAkE;AAClE,qEAAqE;AACrE,sCAAsC;AACtC,6DAA6D;AAC7D,qCAAqC;AACrC,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAA;AACpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAA;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAE9D,4BAA4B;AAC5B,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAC9D,MAAM,CAAC,MAAM,+BAA+B,GAAG,iCAAiC,CAAA;AAChF,MAAM,CAAC,MAAM,8BAA8B,GAAG,gCAAgC,CAAA;AAC9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAA;AAEpE,6BAA6B;AAC7B,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AACtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA;AAClD,MAAM,CAAC,MA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AAqB,GAAG,uBAAuB,CAAA;AAC5D,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAA;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAE9D,kCAAkC;AAClC,8DAA8D;AAC9D,4EAA4E;AAC5E,4DAA4D;AAC5D,oEAAoE;AACpE,iEAAiE;AACjE,6DAA6D;AAC7D,+DAA+D;AAC/D,sEAAsE;AACtE,iEAAiE;AACjE,yDAAyD;AACzD,sEAAsE;AACtE,mDAAmD;AACnD,kEAAkE;AAClE,uEAAuE;AACvE,iCAAiC;AACjC,8DAA8D;AAC9D,qDAAqD;AACrD,2DAA2D;AAC3D,MAAM,CAAC,MAAM,4BAA4B,GAAG,8BAA8B,CAAA;AAC1E,MAAM,CAAC,MAAM,2CAA2C,GACpD,6CAA6C,CAAA;AACjD,MAAM,CAAC,MAAM,iCAAiC,GAC1C,mCAAmC,CAAA;AACvC,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAA;AAChD,MAAM,CAAC,MAAM,2BAA2B,GAAG,6BAA6B,CAAA;AAExE,4BAA4B;AAC5B,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAA"}
|
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
* `makeDefault` if absent.
|
|
4
4
|
*/
|
|
5
5
|
export declare function getOrCreate<K, V>(map: Map<K, V>, key: K, makeDefault: () => V): V;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a copy of `source` with every `undefined`-valued key removed.
|
|
8
|
+
*
|
|
9
|
+
* Entities in this library must never carry a key holding `undefined`. Two
|
|
10
|
+
* things go wrong when they do. `entityChecksum` includes a field only when
|
|
11
|
+
* the key is present, so clearing an app-level field by assigning `undefined`
|
|
12
|
+
* would leave the entity hashing as though it were still set — and clearing has
|
|
13
|
+
* to be exactly reversible. And `"field" in entity` becomes true, so any
|
|
14
|
+
* downstream mapper that turns `undefined` into `null` flips the field from
|
|
15
|
+
* absent to present, which moves the checksum of every entity of that kind.
|
|
16
|
+
*
|
|
17
|
+
* Applies wherever caller-supplied fields are spread into an entity: the
|
|
18
|
+
* `setExtras` pair on both engines, and the parser's `map*` extension hooks.
|
|
19
|
+
*/
|
|
20
|
+
export declare function withoutUndefinedValues(source: Record<string, unknown>): Record<string, unknown>;
|
|
6
21
|
/** Returns a shallow-copied array of items sorted by `id` in lexicographic order. */
|
|
7
22
|
export declare function sortedCopyById<T extends {
|
|
8
23
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/collections.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAC5B,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EACd,GAAG,EAAE,CAAC,EACN,WAAW,EAAE,MAAM,CAAC,GACrB,CAAC,CASH;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAExE;AAED,qDAAqD;AACrD,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAE/D"}
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/collections.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAC5B,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EACd,GAAG,EAAE,CAAC,EACN,WAAW,EAAE,MAAM,CAAC,GACrB,CAAC,CASH;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAIzB;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAExE;AAED,qDAAqD;AACrD,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAE/D"}
|
|
@@ -11,6 +11,23 @@ export function getOrCreate(map, key, makeDefault) {
|
|
|
11
11
|
map.set(key, value);
|
|
12
12
|
return value;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Returns a copy of `source` with every `undefined`-valued key removed.
|
|
16
|
+
*
|
|
17
|
+
* Entities in this library must never carry a key holding `undefined`. Two
|
|
18
|
+
* things go wrong when they do. `entityChecksum` includes a field only when
|
|
19
|
+
* the key is present, so clearing an app-level field by assigning `undefined`
|
|
20
|
+
* would leave the entity hashing as though it were still set — and clearing has
|
|
21
|
+
* to be exactly reversible. And `"field" in entity` becomes true, so any
|
|
22
|
+
* downstream mapper that turns `undefined` into `null` flips the field from
|
|
23
|
+
* absent to present, which moves the checksum of every entity of that kind.
|
|
24
|
+
*
|
|
25
|
+
* Applies wherever caller-supplied fields are spread into an entity: the
|
|
26
|
+
* `setExtras` pair on both engines, and the parser's `map*` extension hooks.
|
|
27
|
+
*/
|
|
28
|
+
export function withoutUndefinedValues(source) {
|
|
29
|
+
return Object.fromEntries(Object.entries(source).filter(([, value]) => value !== undefined));
|
|
30
|
+
}
|
|
14
31
|
/** Returns a shallow-copied array of items sorted by `id` in lexicographic order. */
|
|
15
32
|
export function sortedCopyById(items) {
|
|
16
33
|
return [...items].sort((a, b) => a.id.localeCompare(b.id));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../../src/lib/utils/collections.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,WAAW,CACvB,GAAc,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AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CAClC,MAA+B;IAE/B,OAAO,MAAM,CAAC,WAAW,CACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CACpE,CAAA;AACL,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,cAAc,CAA2B,KAAU;IAC/D,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAC9D,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,YAAY,CAAC,MAAwB;IACjD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;AACzE,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes an origin document's text for *encoding*, never for content.
|
|
3
|
+
*
|
|
4
|
+
* Does: folds every line-break form to LF; strips the byte-order mark,
|
|
5
|
+
* control characters other than LF and tab, bidirectional controls,
|
|
6
|
+
* zero-width characters, tag characters, and stray variation selectors —
|
|
7
|
+
* while preserving emoji ZWJ, keycap, CJK, Mongolian, and emoji-tag
|
|
8
|
+
* sequences; composes to Unicode NFC; trims leading and trailing whitespace.
|
|
9
|
+
*
|
|
10
|
+
* Does not: collapse internal whitespace, reflow paragraphs, fold smart
|
|
11
|
+
* quotes or dashes, case-fold, or strip punctuation, diacritics, emoji, or
|
|
12
|
+
* non-ASCII characters. The document is meant to be the original.
|
|
13
|
+
*
|
|
14
|
+
* Idempotent — `normalizeOriginText(normalizeOriginText(t))` equals
|
|
15
|
+
* `normalizeOriginText(t)` — which is what makes it safe to apply both at an
|
|
16
|
+
* application's import boundary and again on document creation.
|
|
17
|
+
*
|
|
18
|
+
* Two things make it idempotent, and both are load-bearing.
|
|
19
|
+
*
|
|
20
|
+
* The step order. Line breaks are folded first because a lone carriage return
|
|
21
|
+
* is itself a control character, so stripping first would delete the break
|
|
22
|
+
* rather than convert it. Stripping precedes NFC because removing an invisible
|
|
23
|
+
* character can leave a base letter adjacent to a combining mark it was
|
|
24
|
+
* previously separated from; composing first would leave that pair for a second
|
|
25
|
+
* application to compose. NFC never emits a control, an invisible, or a line
|
|
26
|
+
* break, so the reverse hazard does not exist.
|
|
27
|
+
*
|
|
28
|
+
* And the rule that a removal candidate never legitimizes another removal
|
|
29
|
+
* candidate — see `isLegitimateInContext`. Without it a character survives on
|
|
30
|
+
* the strength of a neighbour deleted in the same pass, and the next pass
|
|
31
|
+
* deletes it too.
|
|
32
|
+
*/
|
|
33
|
+
export declare function normalizeOriginText(text: string): string;
|
|
34
|
+
/** The number of Unicode code points in a string — not its UTF-16 `length`. */
|
|
35
|
+
export declare function codePointLength(text: string): number;
|
|
36
|
+
/**
|
|
37
|
+
* A reusable code-point↔UTF-16 offset map for one document.
|
|
38
|
+
*
|
|
39
|
+
* Build it once per document and reuse it across that document's anchors;
|
|
40
|
+
* resolving N anchors with `sliceByCodePoints` instead costs a full scan per
|
|
41
|
+
* anchor.
|
|
42
|
+
*/
|
|
43
|
+
export type TCodePointIndex = {
|
|
44
|
+
readonly text: string;
|
|
45
|
+
/** UTF-16 offset of each code point, with one extra entry for the end of the string. */
|
|
46
|
+
readonly offsets: readonly number[];
|
|
47
|
+
};
|
|
48
|
+
/** Builds the reusable offset map described by {@link TCodePointIndex}. */
|
|
49
|
+
export declare function buildCodePointIndex(text: string): TCodePointIndex;
|
|
50
|
+
/**
|
|
51
|
+
* Slices a string by **code-point** offsets.
|
|
52
|
+
*
|
|
53
|
+
* `String.prototype.slice` on the same offsets is wrong for any text
|
|
54
|
+
* containing an astral-plane character, and passes every ASCII test — which
|
|
55
|
+
* is why anchor fields are named `startCodePoint` / `endCodePoint` and why
|
|
56
|
+
* this helper exists. Offsets are clamped rather than rejected; range
|
|
57
|
+
* checking against a document belongs to the origin library's validation.
|
|
58
|
+
*/
|
|
59
|
+
export declare function sliceByCodePoints(text: string, startCodePoint: number, endCodePoint: number): string;
|
|
60
|
+
/** {@link sliceByCodePoints} against a prebuilt {@link TCodePointIndex}. */
|
|
61
|
+
export declare function sliceByCodePointsIndexed(index: TCodePointIndex, startCodePoint: number, endCodePoint: number): string;
|
|
62
|
+
//# sourceMappingURL=origin-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"origin-text.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/origin-text.ts"],"names":[],"mappings":"AA4IA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIxD;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wFAAwF;IACxF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CACtC,CAAA;AAED,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CASjE;AAMD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC7B,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,GACrB,MAAM,CAMR;AAED,4EAA4E;AAC5E,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,eAAe,EACtB,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,GACrB,MAAM,CAKR"}
|