cesr-ts 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -3
- package/esm/src/adapters/async-iterable.js +9 -9
- package/esm/src/annotate/annotator.js +18 -10
- package/esm/src/annotate/comments.js +3 -6
- package/esm/src/annotate/render.js +123 -24
- package/esm/src/bench/parser-benchmark.js +134 -0
- package/esm/src/core/bytes.js +6 -0
- package/esm/src/core/errors.js +24 -0
- package/esm/src/core/parser-attachment-collector.js +154 -0
- package/esm/src/core/parser-constants.js +74 -0
- package/esm/src/core/parser-deferred-frames.js +73 -0
- package/esm/src/core/parser-engine.js +128 -505
- package/esm/src/core/parser-frame-parser.js +643 -0
- package/esm/src/core/parser-policy.js +137 -0
- package/esm/src/core/parser-stream-state.js +62 -0
- package/esm/src/core/recovery-diagnostics.js +25 -0
- package/esm/src/index.js +4 -0
- package/esm/src/parser/attachment-fallback-policy.js +142 -0
- package/esm/src/parser/group-dispatch.js +547 -233
- package/esm/src/primitives/counter.js +4 -5
- package/esm/src/primitives/mapper.js +126 -45
- package/esm/src/primitives/matter.js +1 -1
- package/esm/src/router/router-stub.js +6 -6
- package/esm/src/serder/serder.js +44 -7
- package/esm/src/serder/smell.js +2 -1
- package/esm/src/tables/counter-version-registry.js +201 -0
- package/esm/src/version.js +2 -2
- package/package.json +3 -1
- package/types/_dnt.polyfills.d.ts +5 -0
- package/types/_dnt.polyfills.d.ts.map +1 -1
- package/types/src/adapters/async-iterable.d.ts +2 -2
- package/types/src/adapters/async-iterable.d.ts.map +1 -1
- package/types/src/adapters/effection.d.ts +2 -2
- package/types/src/adapters/effection.d.ts.map +1 -1
- package/types/src/annotate/annotator.d.ts.map +1 -1
- package/types/src/annotate/comments.d.ts.map +1 -1
- package/types/src/annotate/render.d.ts +8 -2
- package/types/src/annotate/render.d.ts.map +1 -1
- package/types/src/annotate/types.d.ts +2 -2
- package/types/src/annotate/types.d.ts.map +1 -1
- package/types/src/bench/parser-benchmark.d.ts +70 -0
- package/types/src/bench/parser-benchmark.d.ts.map +1 -0
- package/types/src/core/bytes.d.ts +6 -0
- package/types/src/core/bytes.d.ts.map +1 -1
- package/types/src/core/errors.d.ts +10 -0
- package/types/src/core/errors.d.ts.map +1 -1
- package/types/src/core/parser-attachment-collector.d.ts +51 -0
- package/types/src/core/parser-attachment-collector.d.ts.map +1 -0
- package/types/src/core/parser-constants.d.ts +30 -0
- package/types/src/core/parser-constants.d.ts.map +1 -0
- package/types/src/core/parser-deferred-frames.d.ts +38 -0
- package/types/src/core/parser-deferred-frames.d.ts.map +1 -0
- package/types/src/core/parser-engine.d.ts +53 -44
- package/types/src/core/parser-engine.d.ts.map +1 -1
- package/types/src/core/parser-frame-parser.d.ts +89 -0
- package/types/src/core/parser-frame-parser.d.ts.map +1 -0
- package/types/src/core/parser-policy.d.ts +27 -0
- package/types/src/core/parser-policy.d.ts.map +1 -0
- package/types/src/core/parser-stream-state.d.ts +30 -0
- package/types/src/core/parser-stream-state.d.ts.map +1 -0
- package/types/src/core/recovery-diagnostics.d.ts +59 -0
- package/types/src/core/recovery-diagnostics.d.ts.map +1 -0
- package/types/src/core/types.d.ts +61 -7
- package/types/src/core/types.d.ts.map +1 -1
- package/types/src/index.d.ts +4 -0
- package/types/src/index.d.ts.map +1 -1
- package/types/src/parser/attachment-fallback-policy.d.ts +78 -0
- package/types/src/parser/attachment-fallback-policy.d.ts.map +1 -0
- package/types/src/parser/group-dispatch.d.ts +85 -15
- package/types/src/parser/group-dispatch.d.ts.map +1 -1
- package/types/src/primitives/aggor.d.ts +2 -2
- package/types/src/primitives/aggor.d.ts.map +1 -1
- package/types/src/primitives/blinder.d.ts +2 -2
- package/types/src/primitives/blinder.d.ts.map +1 -1
- package/types/src/primitives/counter.d.ts.map +1 -1
- package/types/src/primitives/mapper.d.ts +44 -1
- package/types/src/primitives/mapper.d.ts.map +1 -1
- package/types/src/primitives/mediar.d.ts +2 -2
- package/types/src/primitives/mediar.d.ts.map +1 -1
- package/types/src/primitives/sealer.d.ts +2 -2
- package/types/src/primitives/sealer.d.ts.map +1 -1
- package/types/src/router/router-stub.d.ts +5 -5
- package/types/src/router/router-stub.d.ts.map +1 -1
- package/types/src/serder/serder.d.ts +2 -2
- package/types/src/serder/serder.d.ts.map +1 -1
- package/types/src/serder/serdery.d.ts +2 -2
- package/types/src/serder/serdery.d.ts.map +1 -1
- package/types/src/serder/smell.d.ts.map +1 -1
- package/types/src/tables/counter-version-registry.d.ts +90 -0
- package/types/src/tables/counter-version-registry.d.ts.map +1 -0
- package/types/src/version.d.ts +2 -2
- package/types/src/version.d.ts.map +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Versionage } from "../tables/table-types.js";
|
|
2
|
+
/** Attachment-dispatch recovery can only occur in counter domains. */
|
|
3
|
+
export type RecoveryDispatchDomain = "txt" | "bny";
|
|
4
|
+
/** Backward-compatible fallback callback payload shape. */
|
|
5
|
+
export interface RecoveryVersionFallbackInfo {
|
|
6
|
+
from: Versionage;
|
|
7
|
+
to: Versionage;
|
|
8
|
+
domain: RecoveryDispatchDomain;
|
|
9
|
+
reason: string;
|
|
10
|
+
}
|
|
11
|
+
/** Version-retry fallback accepted in attachment dispatch. */
|
|
12
|
+
export interface VersionFallbackAcceptedDiagnostic {
|
|
13
|
+
type: "version-fallback-accepted";
|
|
14
|
+
from: Versionage;
|
|
15
|
+
to: Versionage;
|
|
16
|
+
domain: RecoveryDispatchDomain;
|
|
17
|
+
reason: string;
|
|
18
|
+
}
|
|
19
|
+
/** Version-retry fallback rejected in attachment dispatch. */
|
|
20
|
+
export interface VersionFallbackRejectedDiagnostic {
|
|
21
|
+
type: "version-fallback-rejected";
|
|
22
|
+
version: Versionage;
|
|
23
|
+
domain: RecoveryDispatchDomain;
|
|
24
|
+
errorName: string;
|
|
25
|
+
reason: string;
|
|
26
|
+
}
|
|
27
|
+
/** Wrapper nested parse failure recovered by preserving opaque tail units. */
|
|
28
|
+
export interface WrapperOpaqueTailPreservedDiagnostic {
|
|
29
|
+
type: "wrapper-opaque-tail-preserved";
|
|
30
|
+
version: Versionage;
|
|
31
|
+
domain: RecoveryDispatchDomain;
|
|
32
|
+
wrapperCode: string;
|
|
33
|
+
opaqueItemCount: number;
|
|
34
|
+
errorName: string;
|
|
35
|
+
reason: string;
|
|
36
|
+
}
|
|
37
|
+
/** Parser non-shortage error handling path that emits error + reset. */
|
|
38
|
+
export interface ParserErrorResetDiagnostic {
|
|
39
|
+
type: "parser-error-reset";
|
|
40
|
+
offset: number;
|
|
41
|
+
errorName: string;
|
|
42
|
+
reason: string;
|
|
43
|
+
}
|
|
44
|
+
/** Structured recovery diagnostics union for parser/dispatch observability. */
|
|
45
|
+
export type RecoveryDiagnostic = VersionFallbackAcceptedDiagnostic | VersionFallbackRejectedDiagnostic | WrapperOpaqueTailPreservedDiagnostic | ParserErrorResetDiagnostic;
|
|
46
|
+
/** Observer contract for structured recovery diagnostics. */
|
|
47
|
+
export type RecoveryDiagnosticObserver = (diagnostic: RecoveryDiagnostic) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Compose diagnostics and legacy fallback callback observers.
|
|
50
|
+
*
|
|
51
|
+
* Why:
|
|
52
|
+
* keeps compatibility with legacy fallback callbacks while normalizing
|
|
53
|
+
* observability through one structured diagnostics stream.
|
|
54
|
+
*/
|
|
55
|
+
export declare function composeRecoveryDiagnosticObserver(options?: {
|
|
56
|
+
onRecoveryDiagnostic?: RecoveryDiagnosticObserver;
|
|
57
|
+
onAttachmentVersionFallback?: (info: RecoveryVersionFallbackInfo) => void;
|
|
58
|
+
}): RecoveryDiagnosticObserver | undefined;
|
|
59
|
+
//# sourceMappingURL=recovery-diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery-diagnostics.d.ts","sourceRoot":"","sources":["../../../src/src/core/recovery-diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,M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AAM,MAAM,0BAA0B,GAAG,CACvC,UAAU,EAAE,kBAAkB,KAC3B,IAAI,CAAC;AAEV;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,GAAE;IACzD,oBAAoB,CAAC,EAAE,0BAA0B,CAAC;IAClD,2BAA2B,CAAC,EAAE,CAAC,IAAI,EAAE,2BAA2B,KAAK,IAAI,CAAC;CACtE,GAAG,0BAA0B,GAAG,SAAS,CAsB9C"}
|
|
@@ -8,18 +8,33 @@ export interface Smellage {
|
|
|
8
8
|
gvrsn: Versionage | null;
|
|
9
9
|
}
|
|
10
10
|
export type ColdCode = "msg" | "txt" | "bny" | "ano";
|
|
11
|
-
|
|
11
|
+
/** Body payload for one parsed CESR frame. */
|
|
12
|
+
export interface CesrBody {
|
|
13
|
+
/** The raw bytes of the body. */
|
|
12
14
|
raw: Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* The "key event dictionary" of the parsed bytes. Insertion ordered dictionary of fields.
|
|
17
|
+
*/
|
|
13
18
|
ked: Record<string, unknown> | null;
|
|
14
|
-
|
|
19
|
+
/** Serialization kind of the body. */
|
|
15
20
|
kind: Kind;
|
|
21
|
+
/** The size of the body in bytes. */
|
|
16
22
|
size: number;
|
|
23
|
+
/** The protocol of the body. */
|
|
24
|
+
proto: Protocol;
|
|
25
|
+
/** The protocol version of the body. */
|
|
17
26
|
pvrsn: Versionage;
|
|
27
|
+
/** The genus version of the body. */
|
|
18
28
|
gvrsn: Versionage | null;
|
|
29
|
+
/** The event type of the body. */
|
|
19
30
|
ilk: string | null;
|
|
31
|
+
/** The SAID of the body. */
|
|
20
32
|
said: string | null;
|
|
33
|
+
/** The native fields of the body. */
|
|
21
34
|
native?: {
|
|
35
|
+
/** The body code of the native fields. */
|
|
22
36
|
bodyCode: string;
|
|
37
|
+
/** The fields of the native fields. */
|
|
23
38
|
fields: Array<{
|
|
24
39
|
label: string | null;
|
|
25
40
|
code: string;
|
|
@@ -27,24 +42,63 @@ export interface SerderEnvelope {
|
|
|
27
42
|
}>;
|
|
28
43
|
};
|
|
29
44
|
}
|
|
45
|
+
/** Discriminated model for one parsed attachment payload unit. */
|
|
46
|
+
export type AttachmentItem = AttachmentQb64Item | AttachmentQb2Item | AttachmentTupleItem | AttachmentNestedGroupItem;
|
|
47
|
+
/** Text-domain unit (single qb64 token or opaque quadlet). */
|
|
48
|
+
export interface AttachmentQb64Item {
|
|
49
|
+
kind: "qb64";
|
|
50
|
+
qb64: string;
|
|
51
|
+
opaque: boolean;
|
|
52
|
+
}
|
|
53
|
+
/** Binary-domain unit (single qb2 token or opaque triplet). */
|
|
54
|
+
export interface AttachmentQb2Item {
|
|
55
|
+
kind: "qb2";
|
|
56
|
+
qb2: Uint8Array;
|
|
57
|
+
opaque: boolean;
|
|
58
|
+
}
|
|
59
|
+
/** Tuple/repeated payload unit preserving source ordering. */
|
|
60
|
+
export interface AttachmentTupleItem {
|
|
61
|
+
kind: "tuple";
|
|
62
|
+
items: AttachmentItem[];
|
|
63
|
+
}
|
|
64
|
+
/** Wrapper-enclosed nested group summary. */
|
|
65
|
+
export interface AttachmentNestedGroupItem {
|
|
66
|
+
kind: "group";
|
|
67
|
+
code: string;
|
|
68
|
+
name: string;
|
|
69
|
+
count: number;
|
|
70
|
+
}
|
|
71
|
+
/** Trailing attachment group parsed after a frame body. */
|
|
30
72
|
export interface AttachmentGroup {
|
|
31
73
|
code: string;
|
|
32
74
|
name: string;
|
|
33
75
|
count: number;
|
|
34
76
|
raw: Uint8Array;
|
|
35
|
-
items:
|
|
77
|
+
items: AttachmentItem[];
|
|
36
78
|
}
|
|
37
|
-
|
|
38
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Historical public type name for one parsed frame payload.
|
|
81
|
+
*
|
|
82
|
+
* Terminology note: parser docs use "frame" for the emitted unit
|
|
83
|
+
* (`body` + trailing `attachments`), while this exported type name
|
|
84
|
+
* remains `CesrMessage` for backward compatibility.
|
|
85
|
+
*/
|
|
86
|
+
export interface CesrMessage {
|
|
87
|
+
body: CesrBody;
|
|
39
88
|
attachments: AttachmentGroup[];
|
|
40
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* State of the CESR parser engine.
|
|
92
|
+
* Contains the buffer of bytes to be parsed and the current offset.
|
|
93
|
+
*/
|
|
41
94
|
export interface ParserState {
|
|
42
95
|
buffer: Uint8Array;
|
|
43
96
|
offset: number;
|
|
44
97
|
}
|
|
45
|
-
|
|
98
|
+
/** Parser stream event union: parsed frame payload or parse error. */
|
|
99
|
+
export type CesrFrame = {
|
|
46
100
|
type: "frame";
|
|
47
|
-
frame:
|
|
101
|
+
frame: CesrMessage;
|
|
48
102
|
} | {
|
|
49
103
|
type: "error";
|
|
50
104
|
error: Error;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAErD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,QAAQ,CAAC;I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jB;AAED,+DAA+D;AAC/D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,KAAK,CAAC;IACZ,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED,6CAA6C;AAC7C,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,UAAU,CAAC;IAChB,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,sEAAsE;AACtE,MAAM,MAAM,SAAS,GACjB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC"}
|
package/types/src/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./core/types.js";
|
|
2
2
|
export * from "./core/errors.js";
|
|
3
3
|
export * from "./core/parser-engine.js";
|
|
4
|
+
export * from "./core/parser-policy.js";
|
|
5
|
+
export * from "./core/recovery-diagnostics.js";
|
|
4
6
|
export * from "./parser/cold-start.js";
|
|
5
7
|
export * from "./parser/group-dispatch.js";
|
|
6
8
|
export * from "./serder/smell.js";
|
|
@@ -39,9 +41,11 @@ export * from "./router/router-stub.js";
|
|
|
39
41
|
export * from "./tables/versions.js";
|
|
40
42
|
export * from "./tables/table-types.js";
|
|
41
43
|
export * from "./tables/counter-codex.js";
|
|
44
|
+
export * from "./tables/counter-version-registry.js";
|
|
42
45
|
export * from "./annotate/types.js";
|
|
43
46
|
export * from "./annotate/comments.js";
|
|
44
47
|
export * from "./annotate/render.js";
|
|
45
48
|
export * from "./annotate/annotator.js";
|
|
46
49
|
export * from "./annotate/denot.js";
|
|
50
|
+
export * from "./bench/parser-benchmark.js";
|
|
47
51
|
//# sourceMappingURL=index.d.ts.map
|
package/types/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAA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AAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { ColdCode } from "../core/types.js";
|
|
2
|
+
import type { Versionage } from "../tables/table-types.js";
|
|
3
|
+
/** Attachment dispatch fallback is only defined for counter domains. */
|
|
4
|
+
export type AttachmentDispatchDomain = Extract<ColdCode, "txt" | "bny">;
|
|
5
|
+
/** Named presets for default attachment fallback strategy behavior. */
|
|
6
|
+
export type AttachmentDispatchMode = "strict" | "compat";
|
|
7
|
+
/** Structured info emitted when compat fallback crosses major versions. */
|
|
8
|
+
export interface VersionFallbackInfo {
|
|
9
|
+
/** Version used for the failed primary dispatch attempt. */
|
|
10
|
+
from: Versionage;
|
|
11
|
+
/** Version selected for retry by compat policy. */
|
|
12
|
+
to: Versionage;
|
|
13
|
+
/** Parse domain where fallback occurred (`txt` qb64 or `bny` qb2). */
|
|
14
|
+
domain: AttachmentDispatchDomain;
|
|
15
|
+
/** Root parse failure message from the primary attempt. */
|
|
16
|
+
reason: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Policy decision for versioned attachment dispatch failure handling.
|
|
20
|
+
*
|
|
21
|
+
* `throw`:
|
|
22
|
+
* - preserve strict fail-fast behavior.
|
|
23
|
+
*
|
|
24
|
+
* `retry`:
|
|
25
|
+
* - perform one alternate-major retry and surface structured fallback info.
|
|
26
|
+
*/
|
|
27
|
+
export type VersionDispatchDecision = {
|
|
28
|
+
action: "throw";
|
|
29
|
+
} | {
|
|
30
|
+
action: "retry";
|
|
31
|
+
retryVersion: Versionage;
|
|
32
|
+
info: VersionFallbackInfo;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Strategy interface for strict/compat dispatch fallback and wrapper recovery
|
|
36
|
+
* semantics.
|
|
37
|
+
*/
|
|
38
|
+
export interface AttachmentVersionFallbackPolicy {
|
|
39
|
+
/**
|
|
40
|
+
* Decide whether a versioned dispatch failure should rethrow or retry.
|
|
41
|
+
*
|
|
42
|
+
* Why this exists:
|
|
43
|
+
* keeps strict-vs-compat behavior out of parser control flow so policy can be
|
|
44
|
+
* injected and validated independently.
|
|
45
|
+
*/
|
|
46
|
+
onVersionDispatchFailure(error: Error, version: Versionage, domain: AttachmentDispatchDomain): VersionDispatchDecision;
|
|
47
|
+
/**
|
|
48
|
+
* Observe accepted fallback decisions (callback/telemetry/warning hook).
|
|
49
|
+
*
|
|
50
|
+
* Why this exists:
|
|
51
|
+
* dispatch logic should not hardcode observability side effects.
|
|
52
|
+
*/
|
|
53
|
+
onVersionFallback(info: VersionFallbackInfo): void;
|
|
54
|
+
/**
|
|
55
|
+
* Decide whether wrapper nested parse errors should preserve opaque remainder.
|
|
56
|
+
*
|
|
57
|
+
* Why this exists:
|
|
58
|
+
* strict mode must fail on malformed wrapper tails; compat mode intentionally
|
|
59
|
+
* keeps opaque remainder to preserve real-world stream tolerance.
|
|
60
|
+
*/
|
|
61
|
+
shouldPreserveWrapperRemainder(error: Error): boolean;
|
|
62
|
+
}
|
|
63
|
+
/** Legacy strict/compat configuration inputs for policy construction. */
|
|
64
|
+
export interface AttachmentVersionFallbackPolicyOptions {
|
|
65
|
+
/** Legacy strict/compat selector used only when no explicit policy is supplied. */
|
|
66
|
+
mode?: AttachmentDispatchMode;
|
|
67
|
+
/** Optional callback invoked when compat policy accepts a major-version retry. */
|
|
68
|
+
onVersionFallback?: (info: VersionFallbackInfo) => void;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Build default fallback strategy from legacy options.
|
|
72
|
+
*
|
|
73
|
+
* Why:
|
|
74
|
+
* preserves backward-compatible `mode` API while allowing explicit policy
|
|
75
|
+
* injection for new call sites.
|
|
76
|
+
*/
|
|
77
|
+
export declare function createAttachmentVersionFallbackPolicy(options?: AttachmentVersionFallbackPolicyOptions): AttachmentVersionFallbackPolicy;
|
|
78
|
+
//# sourceMappingURL=attachment-fallback-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-fallback-policy.d.ts","sourceRoot":"","sources":["../../../src/src/parser/attachment-fallback-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,wEAAwE;AACxE,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC;AACxE,uEAAuE;AACvE,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEzD,2EAA2E;AAC3E,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,IAAI,EAAE,UAAU,CAAC;IACjB,mDAAmD;IACnD,EAAE,EAAE,UAAU,CAAC;IACf,sEAAsE;IACtE,MAAM,EAAE,wBAAwB,CAAC;IACjC,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAC/B;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IACA,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,UAAU,CAAC;IACzB,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC;AAEJ;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;;;OAMG;IACH,wBAAwB,CACtB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,wBAAwB,GAC/B,uBAAuB,CAAC;IAC3B;;;;;OAKG;IACH,iBAAiB,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnD;;;;;;OAMG;IACH,8BAA8B,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;CACvD;AAED,yEAAyE;AACzE,MAAM,WAAW,sCAAsC;IACrD,mFAAmF;IACnF,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,kFAAkF;IAClF,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACzD;AAiJD;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,OAAO,GAAE,sCAA2C,GACnD,+BAA+B,CAKjC"}
|
|
@@ -1,29 +1,99 @@
|
|
|
1
|
-
import type { AttachmentGroup
|
|
1
|
+
import type { AttachmentGroup } from "../core/types.js";
|
|
2
2
|
import type { Versionage } from "../tables/table-types.js";
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import { type RecoveryDiagnosticObserver } from "../core/recovery-diagnostics.js";
|
|
4
|
+
import { type AttachmentDispatchDomain, type AttachmentVersionFallbackPolicy, type AttachmentVersionFallbackPolicyOptions } from "./attachment-fallback-policy.js";
|
|
5
|
+
export { createAttachmentVersionFallbackPolicy, } from "./attachment-fallback-policy.js";
|
|
6
|
+
export type { AttachmentDispatchMode, AttachmentVersionFallbackPolicy, VersionDispatchDecision, VersionFallbackInfo, } from "./attachment-fallback-policy.js";
|
|
7
|
+
/** Attachment parsing can only proceed in counter domains. */
|
|
8
|
+
type ParseDomain = AttachmentDispatchDomain;
|
|
9
|
+
/** Primitive token families used by tuple/repetition parsers. */
|
|
10
|
+
type PrimitiveKind = "matter" | "indexer";
|
|
11
|
+
/**
|
|
12
|
+
* Public options for attachment dispatch behavior and fallback observability.
|
|
13
|
+
*
|
|
14
|
+
* Precedence:
|
|
15
|
+
* 1) `versionFallbackPolicy` when provided (fully explicit strategy injection)
|
|
16
|
+
* 2) otherwise build default strategy from `mode` and adapt
|
|
17
|
+
* `onVersionFallback` into structured diagnostics.
|
|
18
|
+
*/
|
|
19
|
+
export interface AttachmentDispatchOptions extends AttachmentVersionFallbackPolicyOptions {
|
|
20
|
+
/** Explicit strategy override for fallback + wrapper remainder decisions. */
|
|
21
|
+
versionFallbackPolicy?: AttachmentVersionFallbackPolicy;
|
|
22
|
+
/** Structured recovery diagnostics observer. */
|
|
23
|
+
onRecoveryDiagnostic?: RecoveryDiagnosticObserver;
|
|
10
24
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Dispatch table major-version discriminator.
|
|
27
|
+
*
|
|
28
|
+
* Invariant:
|
|
29
|
+
* all dispatch artifacts in this module are built for exactly these two major
|
|
30
|
+
* versions; runtime fallback policy decides when/if cross-version retry occurs.
|
|
31
|
+
*/
|
|
32
|
+
type DispatchVersion = 1 | 2;
|
|
33
|
+
/**
|
|
34
|
+
* Parser family keys used to map descriptor entries to concrete parser functions.
|
|
35
|
+
*
|
|
36
|
+
* Maintainer rule:
|
|
37
|
+
* adding a new parser family requires touching this union and
|
|
38
|
+
* `parserForDescriptor(...)` together so routing remains exhaustive.
|
|
39
|
+
*/
|
|
40
|
+
type DispatchParserKind = "genusVersion" | "quadlet" | "repeatTuple" | "transIdxSigGroups" | "transLastIdxSigGroups" | "sadPathSig" | "sadPathSigGroup";
|
|
41
|
+
/**
|
|
42
|
+
* Semantic classification for descriptor entries.
|
|
43
|
+
*
|
|
44
|
+
* This metadata is intentionally domain-facing (review/debug/docs) and does not
|
|
45
|
+
* alter parser behavior by itself. Behavioral switches are driven only by
|
|
46
|
+
* `parserKind`, `tupleKinds`, `wrapperGroup`, and `allowsSigerList`.
|
|
47
|
+
*/
|
|
48
|
+
type DispatchSemanticShape = "genusVersionMarker" | "countedGroupPayload" | "wrapperGroupPayload" | "primitiveTuples" | "signatureGroupTuples" | "lastSignatureGroupTuples" | "sadPathSignatures" | "sadPathSignatureGroup";
|
|
49
|
+
/**
|
|
50
|
+
* Authoring-time dispatch spec row.
|
|
51
|
+
*
|
|
52
|
+
* This form groups equivalent parser semantics across major versions to reduce
|
|
53
|
+
* duplicate declarations in the canonical spec constant.
|
|
54
|
+
*/
|
|
55
|
+
interface DispatchFamilySpec {
|
|
56
|
+
parserKind: DispatchParserKind;
|
|
57
|
+
semanticShape: DispatchSemanticShape;
|
|
58
|
+
codesByVersion: Partial<Record<DispatchVersion, readonly string[]>>;
|
|
59
|
+
tupleKinds?: readonly PrimitiveKind[];
|
|
60
|
+
wrapperGroup?: boolean;
|
|
61
|
+
allowsSigerList?: boolean;
|
|
14
62
|
}
|
|
15
63
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
64
|
+
* Canonical attachment dispatch specification (authoring form).
|
|
65
|
+
*
|
|
66
|
+
* This is the single source of truth for:
|
|
67
|
+
* - code -> parser routing
|
|
68
|
+
* - semantic shape classification
|
|
69
|
+
* - wrapper-group recursion eligibility
|
|
70
|
+
* - nested siger-list allowance
|
|
71
|
+
*
|
|
72
|
+
* Maintainer workflow:
|
|
73
|
+
* when adding/removing a counter route, edit this constant only, then rely on
|
|
74
|
+
* descriptor expansion + generated dispatch maps below.
|
|
75
|
+
*/
|
|
76
|
+
export declare const ATTACHMENT_DISPATCH_SPEC: readonly DispatchFamilySpec[];
|
|
77
|
+
/**
|
|
78
|
+
* Parse one attachment group with policy-aware fallback behavior.
|
|
79
|
+
*
|
|
80
|
+
* By default this uses compat policy semantics to mirror historical
|
|
81
|
+
* `parseAttachmentDispatchCompat` behavior unless overridden via
|
|
82
|
+
* `options.versionFallbackPolicy`.
|
|
18
83
|
*/
|
|
19
84
|
export declare function parseAttachmentDispatchCompat(input: Uint8Array, version: Versionage, domain: ParseDomain, options?: AttachmentDispatchOptions): {
|
|
20
85
|
group: AttachmentGroup;
|
|
21
86
|
consumed: number;
|
|
22
87
|
};
|
|
23
|
-
/**
|
|
88
|
+
/**
|
|
89
|
+
* Parse one attachment group with strict fail-fast semantics.
|
|
90
|
+
*
|
|
91
|
+
* Why:
|
|
92
|
+
* this API guarantees no major-version fallback and no wrapper opaque-tail
|
|
93
|
+
* preservation, matching parity/validation use cases.
|
|
94
|
+
*/
|
|
24
95
|
export declare function parseAttachmentDispatch(input: Uint8Array, version: Versionage, domain: ParseDomain): {
|
|
25
96
|
group: AttachmentGroup;
|
|
26
97
|
consumed: number;
|
|
27
98
|
};
|
|
28
|
-
export {};
|
|
29
99
|
//# sourceMappingURL=group-dispatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group-dispatch.d.ts","sourceRoot":"","sources":["../../../src/src/parser/group-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"group-dispatch.d.ts","sourceRoot":"","sources":["../../../src/src/parser/group-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAe3D,OAAO,EAEL,KAAK,0BAA0B,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,EAAE,OAAO,CAAC;CAC3B;AAkBD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,EAAE,SAAS,kBAAkB,EA8NjE,CAAC;AA+qBF;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,yBAA8B,GACtC;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAgB9C;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,WAAW,GAClB;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAM9C"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ColdCode } from "../core/types.js";
|
|
1
|
+
import type { AttachmentItem, ColdCode } from "../core/types.js";
|
|
2
2
|
import type { Versionage } from "../tables/table-types.js";
|
|
3
3
|
import type { MapperField } from "./mapper.js";
|
|
4
4
|
export interface Aggor {
|
|
5
5
|
code: string;
|
|
6
6
|
count: number;
|
|
7
7
|
kind: "list" | "map";
|
|
8
|
-
listItems?:
|
|
8
|
+
listItems?: AttachmentItem[];
|
|
9
9
|
mapFields?: MapperField[];
|
|
10
10
|
consumed: number;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggor.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/aggor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"aggor.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/aggor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAK3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAgB/C,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,GACrC,KAAK,CA2BP"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ColdCode } from "../core/types.js";
|
|
1
|
+
import type { AttachmentItem, ColdCode } from "../core/types.js";
|
|
2
2
|
import type { Versionage } from "../tables/table-types.js";
|
|
3
3
|
export interface Blinder {
|
|
4
4
|
code: string;
|
|
5
5
|
name: string;
|
|
6
6
|
count: number;
|
|
7
|
-
items:
|
|
7
|
+
items: AttachmentItem[];
|
|
8
8
|
raw: Uint8Array;
|
|
9
9
|
consumed: number;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blinder.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/blinder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"blinder.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/blinder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAW3D,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,GAAG,EAAE,UAAU,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,GACrC,OAAO,CAeT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/counter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/counter.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAMjD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAgBD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,UAAU,GAClB,OAAO,CAkDT;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,UAAU,GAClB,OAAO,CA2CT;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,GACrC,OAAO,CAIT"}
|
|
@@ -17,9 +17,52 @@ export interface Mapper {
|
|
|
17
17
|
totalSizeB2: number;
|
|
18
18
|
fields: MapperField[];
|
|
19
19
|
}
|
|
20
|
+
/** Label token artifact produced during map payload syntax parsing. */
|
|
21
|
+
export interface MapperLabelTokenSyntax {
|
|
22
|
+
kind: "label";
|
|
23
|
+
code: string;
|
|
24
|
+
qb64: string;
|
|
25
|
+
label: string;
|
|
26
|
+
consumed: number;
|
|
27
|
+
}
|
|
28
|
+
/** Value token artifact produced during map payload syntax parsing. */
|
|
29
|
+
export interface MapperValueTokenSyntax {
|
|
30
|
+
kind: "value";
|
|
31
|
+
code: string;
|
|
32
|
+
qb64: string;
|
|
33
|
+
isCounter: boolean;
|
|
34
|
+
consumed: number;
|
|
35
|
+
children?: MapperBodySyntax;
|
|
36
|
+
}
|
|
37
|
+
/** Ordered syntax token stream for one map payload. */
|
|
38
|
+
export type MapperSyntaxEntry = MapperLabelTokenSyntax | MapperValueTokenSyntax;
|
|
39
|
+
/** Syntax artifact for a parsed map-body/group token sequence. */
|
|
40
|
+
export interface MapperBodySyntax {
|
|
41
|
+
/** Map/group counter code parsed at the payload head. */
|
|
42
|
+
code: string;
|
|
43
|
+
/** Counter count from map/group header. */
|
|
44
|
+
count: number;
|
|
45
|
+
/** Counter token size in qb64 bytes. */
|
|
46
|
+
fullSize: number;
|
|
47
|
+
/** Counter token size in qb2 bytes. */
|
|
48
|
+
fullSizeB2: number;
|
|
49
|
+
/** Total group span in qb64 bytes (header + payload). */
|
|
50
|
+
totalSize: number;
|
|
51
|
+
/** Total group span in qb2 bytes (header + payload). */
|
|
52
|
+
totalSizeB2: number;
|
|
53
|
+
/** Ordered token artifacts from payload tokenization. */
|
|
54
|
+
entries: MapperSyntaxEntry[];
|
|
55
|
+
}
|
|
56
|
+
/** Convert syntax entries into labeled semantic map fields. */
|
|
57
|
+
export declare function interpretMapperBodySyntax(syntax: MapperBodySyntax): MapperField[];
|
|
58
|
+
/**
|
|
59
|
+
* Parse map-style native bodies/counters into syntax artifacts.
|
|
60
|
+
* Parsing is strict: payload boundaries must be exact.
|
|
61
|
+
*/
|
|
62
|
+
export declare function parseMapperBodySyntax(input: Uint8Array, version: Versionage, domain: ParseDomain): MapperBodySyntax;
|
|
20
63
|
/**
|
|
21
64
|
* Parse map-style native bodies/counters into labeled semantic fields.
|
|
22
|
-
*
|
|
65
|
+
* Compatibility wrapper over syntax parsing + semantic interpretation phases.
|
|
23
66
|
*/
|
|
24
67
|
export declare function parseMapperBody(input: Uint8Array, version: Versionage, domain: ParseDomain): Mapper;
|
|
25
68
|
/** True for counter codes that represent map/list-native aggregate primitives. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/mapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mapper.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/mapper.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAK3D,KAAK,WAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC;AAgBpD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,uEAAuE;AACvE,MAA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,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ColdCode } from "../core/types.js";
|
|
1
|
+
import type { AttachmentItem, ColdCode } from "../core/types.js";
|
|
2
2
|
import type { Versionage } from "../tables/table-types.js";
|
|
3
3
|
export interface Mediar {
|
|
4
4
|
code: string;
|
|
5
5
|
name: string;
|
|
6
6
|
count: number;
|
|
7
|
-
items:
|
|
7
|
+
items: AttachmentItem[];
|
|
8
8
|
raw: Uint8Array;
|
|
9
9
|
consumed: number;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediar.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/mediar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"mediar.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/mediar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAS3D,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,GAAG,EAAE,UAAU,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,GACrC,MAAM,CAeR"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ColdCode } from "../core/types.js";
|
|
1
|
+
import type { AttachmentItem, ColdCode } from "../core/types.js";
|
|
2
2
|
import type { Versionage } from "../tables/table-types.js";
|
|
3
3
|
export interface Sealer {
|
|
4
4
|
code: string;
|
|
5
5
|
name: string;
|
|
6
6
|
count: number;
|
|
7
|
-
items:
|
|
7
|
+
items: AttachmentItem[];
|
|
8
8
|
raw: Uint8Array;
|
|
9
9
|
consumed: number;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sealer.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/sealer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"sealer.d.ts","sourceRoot":"","sources":["../../../src/src/primitives/sealer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAuB3D,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,GAAG,EAAE,UAAU,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,OAAO,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,GACrC,MAAM,CAeR"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CesrMessage } from "../core/types.js";
|
|
2
2
|
export interface CesrRouter {
|
|
3
|
-
route(
|
|
3
|
+
route(message: CesrMessage): Promise<void>;
|
|
4
4
|
}
|
|
5
5
|
export interface RouterHandlers {
|
|
6
|
-
onKeri?: (
|
|
7
|
-
onAcdc?: (
|
|
8
|
-
onUnknown?: (
|
|
6
|
+
onKeri?: (message: CesrMessage) => Promise<void> | void;
|
|
7
|
+
onAcdc?: (message: CesrMessage) => Promise<void> | void;
|
|
8
|
+
onUnknown?: (message: CesrMessage) => Promise<void> | void;
|
|
9
9
|
}
|
|
10
10
|
export declare function createRouterStub(handlers?: RouterHandlers): CesrRouter;
|
|
11
11
|
//# sourceMappingURL=router-stub.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-stub.d.ts","sourceRoot":"","sources":["../../../src/src/router/router-stub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"router-stub.d.ts","sourceRoot":"","sources":["../../../src/src/router/router-stub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACxD,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC5D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,GAAE,cAAmB,GAAG,UAAU,CAgB1E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CesrBody } from "../core/types.js";
|
|
2
2
|
import type { Smellage } from "../core/types.js";
|
|
3
|
-
export declare function parseSerder(raw: Uint8Array, smellage: Smellage):
|
|
3
|
+
export declare function parseSerder(raw: Uint8Array, smellage: Smellage): CesrBody;
|
|
4
4
|
//# sourceMappingURL=serder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serder.d.ts","sourceRoot":"","sources":["../../../src/src/serder/serder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"serder.d.ts","sourceRoot":"","sources":["../../../src/src/serder/serder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA4BjD,wBAAgB,WAAW,CACzB,GAAG,EAAE,UAAU,EACf,QAAQ,EAAE,QAAQ,GACjB,QAAQ,CA0CV"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CesrBody } from "../core/types.js";
|
|
2
2
|
export declare function reapSerder(input: Uint8Array): {
|
|
3
|
-
serder:
|
|
3
|
+
serder: CesrBody;
|
|
4
4
|
consumed: number;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=serdery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serdery.d.ts","sourceRoot":"","sources":["../../../src/src/serder/serdery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"serdery.d.ts","sourceRoot":"","sources":["../../../src/src/serder/serdery.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,wBAAgB,UAAU,CACxB,KAAK,EAAE,UAAU,GAChB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAQxC"}
|