keri-ts 0.4.0 → 0.5.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/esm/cesr/src/adapters/async-iterable.js +8 -0
- package/esm/cesr/src/adapters/effection.js +6 -0
- package/esm/cesr/src/annotate/annotator.js +12 -0
- package/esm/cesr/src/annotate/comments.js +5 -1
- package/esm/cesr/src/annotate/denot.js +6 -0
- package/esm/cesr/src/annotate/render.js +11 -2
- package/esm/cesr/src/core/bytes.js +9 -0
- package/esm/cesr/src/core/errors.js +3 -0
- package/esm/cesr/src/core/parser-engine.js +1 -1
- package/esm/cesr/src/core/parser-frame-parser.js +19 -16
- package/esm/cesr/src/core/vocabulary.js +47 -0
- package/esm/cesr/src/index.js +5 -0
- package/esm/cesr/src/parser/attachment-parser.js +4 -0
- package/esm/cesr/src/parser/cold-start.js +6 -0
- package/esm/cesr/src/parser/group-dispatch.js +2 -2
- package/esm/cesr/src/primitives/aggor.js +374 -30
- package/esm/cesr/src/primitives/bexter.js +2 -3
- package/esm/cesr/src/primitives/blinder.js +6 -0
- package/esm/cesr/src/primitives/byte-like.js +19 -0
- package/esm/cesr/src/primitives/cigar.js +17 -3
- package/esm/cesr/src/primitives/cipher.js +91 -6
- package/esm/cesr/src/primitives/codex.js +39 -6
- package/esm/cesr/src/primitives/compactor.js +307 -3
- package/esm/cesr/src/primitives/counter.js +6 -2
- package/esm/cesr/src/primitives/dater.js +1 -2
- package/esm/cesr/src/primitives/decimer.js +3 -5
- package/esm/cesr/src/primitives/decrypter.js +123 -7
- package/esm/cesr/src/primitives/diger.js +57 -3
- package/esm/cesr/src/primitives/disclosure.js +300 -0
- package/esm/cesr/src/primitives/encrypter.js +130 -7
- package/esm/cesr/src/primitives/hydrate.js +49 -0
- package/esm/cesr/src/primitives/ilker.js +2 -3
- package/esm/cesr/src/primitives/indexer.js +21 -4
- package/esm/cesr/src/primitives/labeler.js +1 -2
- package/esm/cesr/src/primitives/mapper.js +612 -35
- package/esm/cesr/src/primitives/matter.js +133 -3
- package/esm/cesr/src/primitives/mediar.js +6 -0
- package/esm/cesr/src/primitives/noncer.js +2 -3
- package/esm/cesr/src/primitives/number.js +1 -2
- package/esm/cesr/src/primitives/pather.js +102 -5
- package/esm/cesr/src/primitives/prefixer.js +1 -2
- package/esm/cesr/src/primitives/primitive.js +14 -0
- package/esm/cesr/src/primitives/registry.js +2 -0
- package/esm/cesr/src/primitives/saider.js +80 -3
- package/esm/cesr/src/primitives/salter.js +96 -2
- package/esm/cesr/src/primitives/sealed-box.js +41 -0
- package/esm/cesr/src/primitives/seqner.js +1 -2
- package/esm/cesr/src/primitives/siger.js +58 -3
- package/esm/cesr/src/primitives/signer.js +243 -9
- package/esm/cesr/src/primitives/streamer.js +28 -0
- package/esm/cesr/src/primitives/structing.js +727 -0
- package/esm/cesr/src/primitives/structor.js +20 -0
- package/esm/cesr/src/primitives/tagger.js +1 -2
- package/esm/cesr/src/primitives/texter.js +1 -2
- package/esm/cesr/src/primitives/tholder.js +552 -10
- package/esm/cesr/src/primitives/traitor.js +2 -3
- package/esm/cesr/src/primitives/verfer.js +50 -6
- package/esm/cesr/src/primitives/verser.js +16 -6
- package/esm/cesr/src/router/router-stub.js +1 -0
- package/esm/cesr/src/serder/native.js +1326 -0
- package/esm/cesr/src/serder/serder.js +1558 -59
- package/esm/cesr/src/serder/serdery.js +92 -7
- package/esm/cesr/src/serder/smell.js +26 -1
- package/esm/cesr/src/tables/codex-utils.js +2 -0
- package/esm/cesr/src/tables/counter-codex.js +2 -0
- package/esm/cesr/src/tables/counter-groups.js +6 -0
- package/esm/cesr/src/tables/versions.js +4 -0
- package/esm/cesr/src/version.js +5 -2
- package/esm/keri/src/app/agent-runtime.js +226 -0
- package/esm/keri/src/app/authenticating.js +135 -0
- package/esm/keri/src/app/challenging.js +163 -0
- package/esm/keri/src/app/cli/agent.js +65 -7
- package/esm/keri/src/app/cli/annotate.js +6 -0
- package/esm/keri/src/app/cli/challenge.js +136 -0
- package/esm/keri/src/app/cli/command-definitions.js +327 -18
- package/esm/keri/src/app/cli/common/existing.js +5 -0
- package/esm/keri/src/app/cli/common/parsing.js +13 -0
- package/esm/keri/src/app/cli/ends.js +63 -0
- package/esm/keri/src/app/cli/exchange.js +83 -0
- package/esm/keri/src/app/cli/incept.js +43 -4
- package/esm/keri/src/app/cli/index.js +5 -0
- package/esm/keri/src/app/cli/init.js +28 -0
- package/esm/keri/src/app/cli/loc.js +73 -0
- package/esm/keri/src/app/cli/oobi.js +149 -0
- package/esm/keri/src/app/configing.js +1 -0
- package/esm/keri/src/app/cue-runtime.js +70 -0
- package/esm/keri/src/app/exchanging.js +451 -0
- package/esm/keri/src/app/habbing.js +877 -141
- package/esm/keri/src/app/index.js +7 -0
- package/esm/keri/src/app/keeping.js +989 -159
- package/esm/keri/src/app/mailbox-director.js +216 -0
- package/esm/keri/src/app/oobiery.js +445 -0
- package/esm/keri/src/app/querying.js +671 -0
- package/esm/keri/src/app/reactor.js +558 -0
- package/esm/keri/src/app/runtime-turn.js +14 -0
- package/esm/keri/src/app/server.js +364 -41
- package/esm/keri/src/app/version.js +5 -2
- package/esm/keri/src/core/cues.js +1 -0
- package/esm/keri/src/core/deck.js +86 -0
- package/esm/keri/src/core/dispatch.js +361 -0
- package/esm/keri/src/core/errors.js +3 -0
- package/esm/keri/src/core/eventing.js +2259 -0
- package/esm/keri/src/core/index.js +10 -0
- package/esm/keri/src/core/kever-decisions.js +63 -0
- package/esm/keri/src/core/kever.js +1771 -0
- package/esm/keri/src/core/logger.js +5 -0
- package/esm/keri/src/core/mailbox-topics.js +13 -0
- package/esm/keri/src/core/messages.js +81 -0
- package/esm/keri/src/core/records.js +325 -1
- package/esm/keri/src/core/roles.js +29 -0
- package/esm/keri/src/core/routing.js +792 -0
- package/esm/keri/src/core/schemes.js +10 -0
- package/esm/keri/src/core/witnesses.js +65 -0
- package/esm/keri/src/db/basing.js +354 -87
- package/esm/keri/src/db/core/keys.js +12 -3
- package/esm/keri/src/db/core/lmdber.js +55 -31
- package/esm/keri/src/db/escrowing.js +358 -0
- package/esm/keri/src/db/index.js +1 -0
- package/esm/keri/src/db/keeping.js +137 -23
- package/esm/keri/src/db/koming.js +148 -34
- package/esm/keri/src/db/subing.js +437 -124
- package/esm/keri/src/time/mod.js +31 -0
- package/package.json +6 -3
- package/types/cesr/src/adapters/async-iterable.d.ts +8 -0
- package/types/cesr/src/adapters/async-iterable.d.ts.map +1 -1
- package/types/cesr/src/adapters/effection.d.ts +7 -0
- package/types/cesr/src/adapters/effection.d.ts.map +1 -1
- package/types/cesr/src/annotate/annotator.d.ts +12 -0
- package/types/cesr/src/annotate/annotator.d.ts.map +1 -1
- package/types/cesr/src/annotate/comments.d.ts +4 -0
- package/types/cesr/src/annotate/comments.d.ts.map +1 -1
- package/types/cesr/src/annotate/denot.d.ts +6 -0
- package/types/cesr/src/annotate/denot.d.ts.map +1 -1
- package/types/cesr/src/annotate/render.d.ts.map +1 -1
- package/types/cesr/src/annotate/types.d.ts +2 -0
- package/types/cesr/src/annotate/types.d.ts.map +1 -1
- package/types/cesr/src/bench/parser-benchmark.d.ts +3 -0
- package/types/cesr/src/bench/parser-benchmark.d.ts.map +1 -1
- package/types/cesr/src/core/bytes.d.ts +9 -0
- package/types/cesr/src/core/bytes.d.ts.map +1 -1
- package/types/cesr/src/core/errors.d.ts +3 -0
- package/types/cesr/src/core/errors.d.ts.map +1 -1
- package/types/cesr/src/core/parser-engine.d.ts +4 -0
- package/types/cesr/src/core/parser-engine.d.ts.map +1 -1
- package/types/cesr/src/core/parser-frame-parser.d.ts.map +1 -1
- package/types/cesr/src/core/types.d.ts +2 -0
- package/types/cesr/src/core/types.d.ts.map +1 -1
- package/types/cesr/src/core/vocabulary.d.ts +48 -0
- package/types/cesr/src/core/vocabulary.d.ts.map +1 -0
- package/types/cesr/src/index.d.ts +5 -0
- package/types/cesr/src/index.d.ts.map +1 -1
- package/types/cesr/src/parser/attachment-parser.d.ts +4 -0
- package/types/cesr/src/parser/attachment-parser.d.ts.map +1 -1
- package/types/cesr/src/parser/cold-start.d.ts +6 -0
- package/types/cesr/src/parser/cold-start.d.ts.map +1 -1
- package/types/cesr/src/parser/group-dispatch.d.ts.map +1 -1
- package/types/cesr/src/primitives/aggor.d.ts +100 -13
- package/types/cesr/src/primitives/aggor.d.ts.map +1 -1
- package/types/cesr/src/primitives/bexter.d.ts.map +1 -1
- package/types/cesr/src/primitives/blinder.d.ts +6 -0
- package/types/cesr/src/primitives/blinder.d.ts.map +1 -1
- package/types/cesr/src/primitives/byte-like.d.ts +7 -0
- package/types/cesr/src/primitives/byte-like.d.ts.map +1 -0
- package/types/cesr/src/primitives/cigar.d.ts +11 -1
- package/types/cesr/src/primitives/cigar.d.ts.map +1 -1
- package/types/cesr/src/primitives/cipher.d.ts +73 -2
- package/types/cesr/src/primitives/cipher.d.ts.map +1 -1
- package/types/cesr/src/primitives/codex.d.ts +34 -4
- package/types/cesr/src/primitives/codex.d.ts.map +1 -1
- package/types/cesr/src/primitives/compactor.d.ts +94 -2
- package/types/cesr/src/primitives/compactor.d.ts.map +1 -1
- package/types/cesr/src/primitives/counter.d.ts.map +1 -1
- package/types/cesr/src/primitives/dater.d.ts.map +1 -1
- package/types/cesr/src/primitives/decimer.d.ts.map +1 -1
- package/types/cesr/src/primitives/decrypter.d.ts +64 -3
- package/types/cesr/src/primitives/decrypter.d.ts.map +1 -1
- package/types/cesr/src/primitives/diger.d.ts +16 -0
- package/types/cesr/src/primitives/diger.d.ts.map +1 -1
- package/types/cesr/src/primitives/disclosure.d.ts +201 -0
- package/types/cesr/src/primitives/disclosure.d.ts.map +1 -0
- package/types/cesr/src/primitives/encrypter.d.ts +66 -4
- package/types/cesr/src/primitives/encrypter.d.ts.map +1 -1
- package/types/cesr/src/primitives/hydrate.d.ts +20 -0
- package/types/cesr/src/primitives/hydrate.d.ts.map +1 -0
- package/types/cesr/src/primitives/ilker.d.ts.map +1 -1
- package/types/cesr/src/primitives/indexer.d.ts.map +1 -1
- package/types/cesr/src/primitives/labeler.d.ts.map +1 -1
- package/types/cesr/src/primitives/mapper.d.ts +132 -11
- package/types/cesr/src/primitives/mapper.d.ts.map +1 -1
- package/types/cesr/src/primitives/matter.d.ts +33 -1
- package/types/cesr/src/primitives/matter.d.ts.map +1 -1
- package/types/cesr/src/primitives/mediar.d.ts +6 -0
- package/types/cesr/src/primitives/mediar.d.ts.map +1 -1
- package/types/cesr/src/primitives/noncer.d.ts.map +1 -1
- package/types/cesr/src/primitives/number.d.ts.map +1 -1
- package/types/cesr/src/primitives/pather.d.ts +21 -0
- package/types/cesr/src/primitives/pather.d.ts.map +1 -1
- package/types/cesr/src/primitives/prefixer.d.ts.map +1 -1
- package/types/cesr/src/primitives/primitive.d.ts +26 -0
- package/types/cesr/src/primitives/primitive.d.ts.map +1 -1
- package/types/cesr/src/primitives/registry.d.ts +3 -0
- package/types/cesr/src/primitives/registry.d.ts.map +1 -1
- package/types/cesr/src/primitives/saider.d.ts +41 -0
- package/types/cesr/src/primitives/saider.d.ts.map +1 -1
- package/types/cesr/src/primitives/salter.d.ts +56 -1
- package/types/cesr/src/primitives/salter.d.ts.map +1 -1
- package/types/cesr/src/primitives/sealed-box.d.ts +29 -0
- package/types/cesr/src/primitives/sealed-box.d.ts.map +1 -0
- package/types/cesr/src/primitives/seqner.d.ts.map +1 -1
- package/types/cesr/src/primitives/siger.d.ts +14 -0
- package/types/cesr/src/primitives/siger.d.ts.map +1 -1
- package/types/cesr/src/primitives/signer.d.ts +80 -4
- package/types/cesr/src/primitives/signer.d.ts.map +1 -1
- package/types/cesr/src/primitives/streamer.d.ts +31 -0
- package/types/cesr/src/primitives/streamer.d.ts.map +1 -0
- package/types/cesr/src/primitives/structing.d.ts +4114 -0
- package/types/cesr/src/primitives/structing.d.ts.map +1 -0
- package/types/cesr/src/primitives/structor.d.ts +6 -0
- package/types/cesr/src/primitives/structor.d.ts.map +1 -1
- package/types/cesr/src/primitives/tagger.d.ts.map +1 -1
- package/types/cesr/src/primitives/texter.d.ts.map +1 -1
- package/types/cesr/src/primitives/tholder.d.ts +150 -5
- package/types/cesr/src/primitives/tholder.d.ts.map +1 -1
- package/types/cesr/src/primitives/traitor.d.ts.map +1 -1
- package/types/cesr/src/primitives/unknown.d.ts +1 -0
- package/types/cesr/src/primitives/unknown.d.ts.map +1 -1
- package/types/cesr/src/primitives/verfer.d.ts +12 -0
- package/types/cesr/src/primitives/verfer.d.ts.map +1 -1
- package/types/cesr/src/primitives/verser.d.ts +14 -3
- package/types/cesr/src/primitives/verser.d.ts.map +1 -1
- package/types/cesr/src/router/router-stub.d.ts +3 -0
- package/types/cesr/src/router/router-stub.d.ts.map +1 -1
- package/types/cesr/src/serder/native.d.ts +115 -0
- package/types/cesr/src/serder/native.d.ts.map +1 -0
- package/types/cesr/src/serder/serder.d.ts +187 -9
- package/types/cesr/src/serder/serder.d.ts.map +1 -1
- package/types/cesr/src/serder/serdery.d.ts +42 -0
- package/types/cesr/src/serder/serdery.d.ts.map +1 -1
- package/types/cesr/src/serder/smell.d.ts +22 -0
- package/types/cesr/src/serder/smell.d.ts.map +1 -1
- package/types/cesr/src/tables/codex-utils.d.ts +3 -0
- package/types/cesr/src/tables/codex-utils.d.ts.map +1 -1
- package/types/cesr/src/tables/counter-codex.d.ts +4 -0
- package/types/cesr/src/tables/counter-codex.d.ts.map +1 -1
- package/types/cesr/src/tables/counter-groups.d.ts +6 -0
- package/types/cesr/src/tables/counter-groups.d.ts.map +1 -1
- package/types/cesr/src/tables/counter.tables.generated.d.ts.map +1 -1
- package/types/cesr/src/tables/indexer.codex.generated.d.ts.map +1 -1
- package/types/cesr/src/tables/matter.codex.generated.d.ts.map +1 -1
- package/types/cesr/src/tables/table-types.d.ts +6 -0
- package/types/cesr/src/tables/table-types.d.ts.map +1 -1
- package/types/cesr/src/tables/versions.d.ts +6 -0
- package/types/cesr/src/tables/versions.d.ts.map +1 -1
- package/types/cesr/src/version.d.ts +5 -2
- package/types/cesr/src/version.d.ts.map +1 -1
- package/types/keri/src/app/agent-runtime.d.ts +174 -0
- package/types/keri/src/app/agent-runtime.d.ts.map +1 -0
- package/types/keri/src/app/authenticating.d.ts +30 -0
- package/types/keri/src/app/authenticating.d.ts.map +1 -0
- package/types/keri/src/app/challenging.d.ts +56 -0
- package/types/keri/src/app/challenging.d.ts.map +1 -0
- package/types/keri/src/app/cli/agent.d.ts +9 -2
- package/types/keri/src/app/cli/agent.d.ts.map +1 -1
- package/types/keri/src/app/cli/annotate.d.ts +6 -0
- package/types/keri/src/app/cli/annotate.d.ts.map +1 -1
- package/types/keri/src/app/cli/challenge.d.ts +8 -0
- package/types/keri/src/app/cli/challenge.d.ts.map +1 -0
- package/types/keri/src/app/cli/command-definitions.d.ts +10 -1
- package/types/keri/src/app/cli/command-definitions.d.ts.map +1 -1
- package/types/keri/src/app/cli/common/existing.d.ts +6 -0
- package/types/keri/src/app/cli/common/existing.d.ts.map +1 -1
- package/types/keri/src/app/cli/common/parsing.d.ts +8 -2
- package/types/keri/src/app/cli/common/parsing.d.ts.map +1 -1
- package/types/keri/src/app/cli/ends.d.ts +15 -0
- package/types/keri/src/app/cli/ends.d.ts.map +1 -0
- package/types/keri/src/app/cli/exchange.d.ts +12 -0
- package/types/keri/src/app/cli/exchange.d.ts.map +1 -0
- package/types/keri/src/app/cli/incept.d.ts.map +1 -1
- package/types/keri/src/app/cli/index.d.ts +5 -0
- package/types/keri/src/app/cli/index.d.ts.map +1 -1
- package/types/keri/src/app/cli/init.d.ts.map +1 -1
- package/types/keri/src/app/cli/loc.d.ts +12 -0
- package/types/keri/src/app/cli/loc.d.ts.map +1 -0
- package/types/keri/src/app/cli/oobi.d.ts +22 -0
- package/types/keri/src/app/cli/oobi.d.ts.map +1 -0
- package/types/keri/src/app/configing.d.ts +2 -0
- package/types/keri/src/app/configing.d.ts.map +1 -1
- package/types/keri/src/app/cue-runtime.d.ts +38 -0
- package/types/keri/src/app/cue-runtime.d.ts.map +1 -0
- package/types/keri/src/app/exchanging.d.ts +115 -0
- package/types/keri/src/app/exchanging.d.ts.map +1 -0
- package/types/keri/src/app/habbing.d.ts +236 -39
- package/types/keri/src/app/habbing.d.ts.map +1 -1
- package/types/keri/src/app/index.d.ts +7 -0
- package/types/keri/src/app/index.d.ts.map +1 -1
- package/types/keri/src/app/keeping.d.ts +376 -28
- package/types/keri/src/app/keeping.d.ts.map +1 -1
- package/types/keri/src/app/mailbox-director.d.ts +81 -0
- package/types/keri/src/app/mailbox-director.d.ts.map +1 -0
- package/types/keri/src/app/oobiery.d.ts +126 -0
- package/types/keri/src/app/oobiery.d.ts.map +1 -0
- package/types/keri/src/app/querying.d.ts +223 -0
- package/types/keri/src/app/querying.d.ts.map +1 -0
- package/types/keri/src/app/reactor.d.ts +89 -0
- package/types/keri/src/app/reactor.d.ts.map +1 -0
- package/types/keri/src/app/runtime-turn.d.ts +10 -0
- package/types/keri/src/app/runtime-turn.d.ts.map +1 -0
- package/types/keri/src/app/server.d.ts +19 -4
- package/types/keri/src/app/server.d.ts.map +1 -1
- package/types/keri/src/app/version.d.ts +5 -2
- package/types/keri/src/app/version.d.ts.map +1 -1
- package/types/keri/src/core/cues.d.ts +162 -0
- package/types/keri/src/core/cues.d.ts.map +1 -0
- package/types/keri/src/core/deck.d.ts +42 -0
- package/types/keri/src/core/deck.d.ts.map +1 -0
- package/types/keri/src/core/dispatch.d.ts +140 -0
- package/types/keri/src/core/dispatch.d.ts.map +1 -0
- package/types/keri/src/core/errors.d.ts +3 -0
- package/types/keri/src/core/errors.d.ts.map +1 -1
- package/types/keri/src/core/eventing.d.ts +746 -0
- package/types/keri/src/core/eventing.d.ts.map +1 -0
- package/types/keri/src/core/index.d.ts +10 -0
- package/types/keri/src/core/index.d.ts.map +1 -1
- package/types/keri/src/core/kever-decisions.d.ts +243 -0
- package/types/keri/src/core/kever-decisions.d.ts.map +1 -0
- package/types/keri/src/core/kever.d.ts +419 -0
- package/types/keri/src/core/kever.d.ts.map +1 -0
- package/types/keri/src/core/logger.d.ts +7 -0
- package/types/keri/src/core/logger.d.ts.map +1 -1
- package/types/keri/src/core/mailbox-topics.d.ts +28 -0
- package/types/keri/src/core/mailbox-topics.d.ts.map +1 -0
- package/types/keri/src/core/messages.d.ts +41 -0
- package/types/keri/src/core/messages.d.ts.map +1 -0
- package/types/keri/src/core/records.d.ts +206 -37
- package/types/keri/src/core/records.d.ts.map +1 -1
- package/types/keri/src/core/roles.d.ts +30 -0
- package/types/keri/src/core/roles.d.ts.map +1 -0
- package/types/keri/src/core/routing.d.ts +334 -0
- package/types/keri/src/core/routing.d.ts.map +1 -0
- package/types/keri/src/core/schemes.d.ts +11 -0
- package/types/keri/src/core/schemes.d.ts.map +1 -0
- package/types/keri/src/core/witnesses.d.ts +36 -0
- package/types/keri/src/core/witnesses.d.ts.map +1 -0
- package/types/keri/src/db/basing.d.ts +99 -17
- package/types/keri/src/db/basing.d.ts.map +1 -1
- package/types/keri/src/db/core/keys.d.ts +12 -0
- package/types/keri/src/db/core/keys.d.ts.map +1 -1
- package/types/keri/src/db/core/lmdber.d.ts +19 -0
- package/types/keri/src/db/core/lmdber.d.ts.map +1 -1
- package/types/keri/src/db/escrowing.d.ts +135 -0
- package/types/keri/src/db/escrowing.d.ts.map +1 -0
- package/types/keri/src/db/index.d.ts +1 -0
- package/types/keri/src/db/index.d.ts.map +1 -1
- package/types/keri/src/db/keeping.d.ts +126 -23
- package/types/keri/src/db/keeping.d.ts.map +1 -1
- package/types/keri/src/db/koming.d.ts +91 -39
- package/types/keri/src/db/koming.d.ts.map +1 -1
- package/types/keri/src/db/subing.d.ts +258 -50
- package/types/keri/src/db/subing.d.ts.map +1 -1
- package/types/keri/src/time/mod.d.ts +20 -0
- package/types/keri/src/time/mod.d.ts.map +1 -0
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { createParser } from "../core/parser-engine.js";
|
|
2
|
+
/**
|
|
3
|
+
* Adapt an async byte stream into parsed CESR frames.
|
|
4
|
+
*
|
|
5
|
+
* Boundary contract:
|
|
6
|
+
* - chunks are fed in arrival order into one parser instance
|
|
7
|
+
* - emitted parser error events are rethrown as stream errors
|
|
8
|
+
* - yielded values are the historical `CesrMessage` frame payloads only
|
|
9
|
+
*/
|
|
2
10
|
export async function* toAsyncFrames(source, options = {}) {
|
|
3
11
|
const parser = createParser(options);
|
|
4
12
|
for await (const chunk of source) {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { action } from "effection";
|
|
2
2
|
import { toAsyncFrames } from "./async-iterable.js";
|
|
3
|
+
/**
|
|
4
|
+
* Bridge the async-iterable parser adapter into an Effection operation.
|
|
5
|
+
*
|
|
6
|
+
* This stays intentionally thin so parser semantics continue to live in
|
|
7
|
+
* `toAsyncFrames()` rather than forking behavior in an Effection-only path.
|
|
8
|
+
*/
|
|
3
9
|
export function* toEffectionFrames(source, options = {}) {
|
|
4
10
|
const frames = yield* action((resolve) => {
|
|
5
11
|
resolve(toAsyncFrames(source, options));
|
|
@@ -25,12 +25,24 @@ function parsedFramesOrThrow(frames) {
|
|
|
25
25
|
}
|
|
26
26
|
return parsedFrames;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Parse input and return one annotation structure per emitted frame.
|
|
30
|
+
*
|
|
31
|
+
* Use this when callers want to inspect annotation lines programmatically
|
|
32
|
+
* instead of flattening the whole stream to one rendered string.
|
|
33
|
+
*/
|
|
28
34
|
export function annotateFrames(input, options) {
|
|
29
35
|
const opts = resolveOptions(options);
|
|
30
36
|
const bytes = typeof input === "string" ? b(input) : input;
|
|
31
37
|
const frames = parsedFramesOrThrow(parseBytes(bytes));
|
|
32
38
|
return renderAnnotatedFrames(frames, opts);
|
|
33
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Render one CESR stream into maintainer-oriented annotated text.
|
|
42
|
+
*
|
|
43
|
+
* Wrapper-aware rendering is attempted first so opaque wrapper payloads can be
|
|
44
|
+
* preserved faithfully before falling back to frame-by-frame annotation.
|
|
45
|
+
*/
|
|
34
46
|
export function annotate(input, options) {
|
|
35
47
|
const opts = resolveOptions(options);
|
|
36
48
|
const bytes = typeof input === "string" ? b(input) : input;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveCounterCodeNameTable } from "../tables/counter-version-registry.js";
|
|
2
|
-
import { COUNTER_CODE_NAMES_V1, COUNTER_CODE_NAMES_V2
|
|
2
|
+
import { COUNTER_CODE_NAMES_V1, COUNTER_CODE_NAMES_V2 } from "../tables/counter.tables.generated.js";
|
|
3
3
|
import { MATTER_CODE_NAMES } from "../tables/matter.tables.generated.js";
|
|
4
4
|
const NATIVE_FIELD_LABELS = Object.freeze({
|
|
5
5
|
v: "version string",
|
|
@@ -17,6 +17,7 @@ const NATIVE_FIELD_LABELS = Object.freeze({
|
|
|
17
17
|
c: "traits/config",
|
|
18
18
|
a: "anchors/data",
|
|
19
19
|
});
|
|
20
|
+
/** Resolve a human-readable counter name against either known counter table. */
|
|
20
21
|
export function counterCodeName(code) {
|
|
21
22
|
const v2 = COUNTER_CODE_NAMES_V2[code];
|
|
22
23
|
if (v2)
|
|
@@ -26,13 +27,16 @@ export function counterCodeName(code) {
|
|
|
26
27
|
return v1;
|
|
27
28
|
return "Counter";
|
|
28
29
|
}
|
|
30
|
+
/** Resolve a counter name against the registry selected for one protocol version. */
|
|
29
31
|
export function counterCodeNameForVersion(code, version) {
|
|
30
32
|
const table = resolveCounterCodeNameTable(version);
|
|
31
33
|
return table[code] ?? "Counter";
|
|
32
34
|
}
|
|
35
|
+
/** Resolve a human-readable matter name from the generated matter code table. */
|
|
33
36
|
export function matterCodeName(code) {
|
|
34
37
|
return MATTER_CODE_NAMES[code] ?? "Matter";
|
|
35
38
|
}
|
|
39
|
+
/** Expand well-known native field labels for annotation comments when available. */
|
|
36
40
|
export function nativeLabelName(label) {
|
|
37
41
|
if (!label)
|
|
38
42
|
return null;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
const TEXT_ENCODER = new TextEncoder();
|
|
2
|
+
/**
|
|
3
|
+
* Strip annotation comments/whitespace and rebuild the raw CESR text stream.
|
|
4
|
+
*
|
|
5
|
+
* This is the inverse of maintainer-facing annotation output, not a general
|
|
6
|
+
* parser: comment lines and inline `# ...` commentary are discarded.
|
|
7
|
+
*/
|
|
2
8
|
export function denot(annotated) {
|
|
3
9
|
const tokens = [];
|
|
4
10
|
for (const line of annotated.split(/\r?\n/)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b64ToInt, intToB64 } from "../core/bytes.js";
|
|
2
|
-
import { DeserializeError, GroupSizeError, ShortageError, UnknownCodeError
|
|
2
|
+
import { DeserializeError, GroupSizeError, ShortageError, UnknownCodeError } from "../core/errors.js";
|
|
3
3
|
import { parseBytes } from "../core/parser-engine.js";
|
|
4
4
|
import { sniff } from "../parser/cold-start.js";
|
|
5
5
|
import { parseAttachmentDispatchCompat } from "../parser/group-dispatch.js";
|
|
@@ -8,7 +8,7 @@ import { Indexer } from "../primitives/indexer.js";
|
|
|
8
8
|
import { Matter, parseMatter } from "../primitives/matter.js";
|
|
9
9
|
import { isCounterGroupLike, isPrimitiveTuple } from "../primitives/primitive.js";
|
|
10
10
|
import { UnknownPrimitive } from "../primitives/unknown.js";
|
|
11
|
-
import { counterCodeName, counterCodeNameForVersion, matterCodeName, nativeLabelName
|
|
11
|
+
import { counterCodeName, counterCodeNameForVersion, matterCodeName, nativeLabelName } from "./comments.js";
|
|
12
12
|
const TEXT_DECODER = new TextDecoder();
|
|
13
13
|
const OPAQUE_TOKEN_COMMENT = "opaque token";
|
|
14
14
|
const OPAQUE_WRAPPER_PAYLOAD_COMMENT = "opaque wrapper payload";
|
|
@@ -59,6 +59,7 @@ function emitLine(lines, value, comment, indent, options) {
|
|
|
59
59
|
}
|
|
60
60
|
lines.push(`${pad}${value} # ${comment}`);
|
|
61
61
|
}
|
|
62
|
+
/** Parse counters with a bounded v1/v2 fallback for annotation-only rendering paths. */
|
|
62
63
|
function parseCounterCompat(input, version, domain) {
|
|
63
64
|
try {
|
|
64
65
|
return parseCounter(input, version, domain);
|
|
@@ -73,6 +74,7 @@ function parseCounterCompat(input, version, domain) {
|
|
|
73
74
|
return parseCounter(input, alternate, domain);
|
|
74
75
|
}
|
|
75
76
|
}
|
|
77
|
+
/** Decode a wrapped genus-version selector into the active protocol version context. */
|
|
76
78
|
function decodeVersionCounter(counter) {
|
|
77
79
|
const triplet = counter.qb64.length >= 3
|
|
78
80
|
? counter.qb64.slice(-3)
|
|
@@ -84,6 +86,7 @@ function decodeVersionCounter(counter) {
|
|
|
84
86
|
minor: minorRaw,
|
|
85
87
|
};
|
|
86
88
|
}
|
|
89
|
+
/** Render hydrated group entries recursively using semantic primitive comments. */
|
|
87
90
|
function renderGroupItems(lines, items, version, indent, options) {
|
|
88
91
|
for (const item of items) {
|
|
89
92
|
if (isPrimitiveTuple(item)) {
|
|
@@ -117,6 +120,7 @@ function renderGroupItems(lines, items, version, indent, options) {
|
|
|
117
120
|
emitLine(lines, String(item), OPAQUE_TOKEN_COMMENT, indent, options);
|
|
118
121
|
}
|
|
119
122
|
}
|
|
123
|
+
/** Render one raw attachment-group span, including nested wrapper groups when present. */
|
|
120
124
|
function renderAttachmentGroupRaw(lines, raw, version, indent, options) {
|
|
121
125
|
const domain = asDomain(raw);
|
|
122
126
|
if (domain !== "txt" && domain !== "bny") {
|
|
@@ -170,6 +174,7 @@ function renderAttachmentGroupRaw(lines, raw, version, indent, options) {
|
|
|
170
174
|
renderGroupItems(lines, parsed.group.items, version, indent + options.indent, options);
|
|
171
175
|
return parsed.consumed;
|
|
172
176
|
}
|
|
177
|
+
/** Render a native CESR body-group payload using hydrated native field projections when available. */
|
|
173
178
|
function renderNativeBody(lines, frame, options, version) {
|
|
174
179
|
const raw = frame.body.raw;
|
|
175
180
|
const domain = asDomain(raw);
|
|
@@ -211,6 +216,7 @@ function renderNativeBody(lines, frame, options, version) {
|
|
|
211
216
|
offset += matterSize;
|
|
212
217
|
}
|
|
213
218
|
}
|
|
219
|
+
/** Render non-native or opaque message bodies as one annotated body line. */
|
|
214
220
|
function renderMessageBody(lines, frame, options) {
|
|
215
221
|
const rawBody = TEXT_DECODER.decode(frame.body.raw);
|
|
216
222
|
const isOpaqueCesrBody = frame.body.kind === "CESR"
|
|
@@ -240,6 +246,7 @@ function renderMessageBody(lines, frame, options) {
|
|
|
240
246
|
].filter(Boolean).join(" ");
|
|
241
247
|
emitLine(lines, body, info, 0, options);
|
|
242
248
|
}
|
|
249
|
+
/** Render one parsed frame and all of its attachment groups into annotation lines. */
|
|
243
250
|
function renderFrame(frame, index, options) {
|
|
244
251
|
const lines = [];
|
|
245
252
|
const version = frame.body.gvrsn ?? frame.body.pvrsn;
|
|
@@ -255,6 +262,7 @@ function renderFrame(frame, index, options) {
|
|
|
255
262
|
}
|
|
256
263
|
return { index, frame, lines };
|
|
257
264
|
}
|
|
265
|
+
/** Parse and render a nested frame chunk inside wrapper-aware annotation flows. */
|
|
258
266
|
function renderFrameChunk(lines, input, indent, options) {
|
|
259
267
|
const parsed = parseBytes(input);
|
|
260
268
|
const frames = [];
|
|
@@ -271,6 +279,7 @@ function renderFrameChunk(lines, input, indent, options) {
|
|
|
271
279
|
}
|
|
272
280
|
}
|
|
273
281
|
}
|
|
282
|
+
/** Walk a stream that may begin with wrapper/version selectors before ordinary frames. */
|
|
274
283
|
function renderWrapperAwareStream(lines, input, inheritedVersion, indent, options) {
|
|
275
284
|
let offset = 0;
|
|
276
285
|
let activeVersion = inheritedVersion;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** Shared UTF-8 encoder used by CESR and DB byte helpers. */
|
|
1
2
|
export const encoder = new TextEncoder();
|
|
3
|
+
/** Shared UTF-8 decoder used by CESR and DB byte helpers. */
|
|
2
4
|
export const decoder = new TextDecoder();
|
|
3
5
|
const B64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
4
6
|
/**
|
|
@@ -17,6 +19,7 @@ export function concatBytes(...chunks) {
|
|
|
17
19
|
}
|
|
18
20
|
return out;
|
|
19
21
|
}
|
|
22
|
+
/** Encode a non-negative integer into CESR's URL-safe base64 sextet text. */
|
|
20
23
|
export function intToB64(value, length = 1) {
|
|
21
24
|
if (value < 0) {
|
|
22
25
|
throw new Error(`value must be >= 0, got ${value}`);
|
|
@@ -32,6 +35,7 @@ export function intToB64(value, length = 1) {
|
|
|
32
35
|
}
|
|
33
36
|
return out.padStart(length, "A");
|
|
34
37
|
}
|
|
38
|
+
/** Decode CESR URL-safe base64 sextet text into a non-negative integer. */
|
|
35
39
|
export function b64ToInt(text) {
|
|
36
40
|
let out = 0;
|
|
37
41
|
for (const ch of text) {
|
|
@@ -43,10 +47,12 @@ export function b64ToInt(text) {
|
|
|
43
47
|
}
|
|
44
48
|
return out;
|
|
45
49
|
}
|
|
50
|
+
/** Encode raw bytes to unpadded URL-safe base64 text. */
|
|
46
51
|
export function encodeB64(data) {
|
|
47
52
|
const str = btoa(String.fromCharCode(...data));
|
|
48
53
|
return str.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
|
|
49
54
|
}
|
|
55
|
+
/** Decode unpadded URL-safe base64 text into raw bytes. */
|
|
50
56
|
export function decodeB64(text) {
|
|
51
57
|
const padded = text + "===".slice((text.length + 3) % 4);
|
|
52
58
|
const raw = atob(padded.replace(/-/g, "+").replace(/_/g, "/"));
|
|
@@ -63,11 +69,13 @@ export function decodeB64(text) {
|
|
|
63
69
|
export function sceil(value) {
|
|
64
70
|
return Math.ceil(value);
|
|
65
71
|
}
|
|
72
|
+
/** Convert a CESR code string to the exact leading qb2 bytes that carry it. */
|
|
66
73
|
export function codeB64ToB2(text) {
|
|
67
74
|
const n = sceil((text.length * 3) / 4);
|
|
68
75
|
const full = text + "A".repeat((4 - (text.length % 4)) % 4);
|
|
69
76
|
return decodeB64(full).slice(0, n);
|
|
70
77
|
}
|
|
78
|
+
/** Convert leading qb2 bytes into the requested number of CESR sextets. */
|
|
71
79
|
export function codeB2ToB64(bytes, sextets) {
|
|
72
80
|
const n = sceil((sextets * 3) / 4);
|
|
73
81
|
if (n > bytes.length) {
|
|
@@ -75,6 +83,7 @@ export function codeB2ToB64(bytes, sextets) {
|
|
|
75
83
|
}
|
|
76
84
|
return encodeB64(bytes.slice(0, n)).slice(0, sextets);
|
|
77
85
|
}
|
|
86
|
+
/** Re-slice the first `sextets` worth of qb2 bytes for parser/code probing. */
|
|
78
87
|
export function nabSextets(bytes, sextets) {
|
|
79
88
|
return codeB64ToB2(codeB2ToB64(bytes, sextets));
|
|
80
89
|
}
|
|
@@ -56,6 +56,9 @@ export class GroupSizeError extends ParserError {
|
|
|
56
56
|
/** Qualified input could not be deserialized into a valid CESR payload. */
|
|
57
57
|
export class DeserializeError extends ParserError {
|
|
58
58
|
}
|
|
59
|
+
/** A CESR payload could not be serialized into a valid protocol representation. */
|
|
60
|
+
export class SerializeError extends ParserError {
|
|
61
|
+
}
|
|
59
62
|
/** Failure while constructing syntax artifacts from token bytes. */
|
|
60
63
|
export class SyntaxParseError extends ParserError {
|
|
61
64
|
constructor(message, cause, offset, context) {
|
|
@@ -6,7 +6,7 @@ import { DeferredFrameLifecycle } from "./parser-deferred-frames.js";
|
|
|
6
6
|
import { FrameParser } from "./parser-frame-parser.js";
|
|
7
7
|
import { createFrameBoundaryPolicy } from "./parser-policy.js";
|
|
8
8
|
import { ParserStreamState } from "./parser-stream-state.js";
|
|
9
|
-
import { composeRecoveryDiagnosticObserver
|
|
9
|
+
import { composeRecoveryDiagnosticObserver } from "./recovery-diagnostics.js";
|
|
10
10
|
/**
|
|
11
11
|
* Streaming CESR parser for message-domain and CESR-native body-group streams.
|
|
12
12
|
* Handles chunk boundaries, pending frames, and attachment continuation.
|
|
@@ -3,7 +3,7 @@ import { sniff } from "../parser/cold-start.js";
|
|
|
3
3
|
import { parseCounter } from "../primitives/counter.js";
|
|
4
4
|
import { parseIlker } from "../primitives/ilker.js";
|
|
5
5
|
import { isLabelerCode, parseLabeler } from "../primitives/labeler.js";
|
|
6
|
-
import { interpretMapperBodySyntax, parseMapperBodySyntax
|
|
6
|
+
import { interpretMapperBodySyntax, parseMapperBodySyntax } from "../primitives/mapper.js";
|
|
7
7
|
import { parseMatter } from "../primitives/matter.js";
|
|
8
8
|
import { parseVerser } from "../primitives/verser.js";
|
|
9
9
|
import { reapSerder } from "../serder/serdery.js";
|
|
@@ -274,23 +274,26 @@ export class FrameParser {
|
|
|
274
274
|
const syntax = this.parseNativeBodySyntax(raw, cold, version);
|
|
275
275
|
const metadata = this.interpretNativeMetadataSyntax(syntax.metadata, version);
|
|
276
276
|
const fields = this.interpretNativeFieldSyntax(syntax.fields);
|
|
277
|
+
// KERIpy parity rule: once the frame parser has classified a top-level
|
|
278
|
+
// FixBodyGroup/MapBodyGroup as a native message body, the result must be a
|
|
279
|
+
// real Serder or a parse error. Arbitrary native map/list corpora still
|
|
280
|
+
// belong to lower-level CESR-native surfaces such as Mapper/Aggor.
|
|
281
|
+
const { serder } = reapSerder(raw);
|
|
282
|
+
if (serder.proto !== metadata.proto
|
|
283
|
+
|| serder.pvrsn.major !== metadata.pvrsn.major
|
|
284
|
+
|| serder.pvrsn.minor !== metadata.pvrsn.minor
|
|
285
|
+
|| (metadata.ilk !== null && serder.ilk !== metadata.ilk)
|
|
286
|
+
|| (metadata.said !== null && serder.said !== metadata.said)) {
|
|
287
|
+
throw new SemanticInterpretationError("Native body syntax pre-read disagreed with Serder hydration");
|
|
288
|
+
}
|
|
289
|
+
serder.native = {
|
|
290
|
+
bodyCode,
|
|
291
|
+
fields,
|
|
292
|
+
};
|
|
293
|
+
const body = serder;
|
|
277
294
|
return {
|
|
278
295
|
frame: {
|
|
279
|
-
body
|
|
280
|
-
raw,
|
|
281
|
-
ked: null,
|
|
282
|
-
proto: metadata.proto,
|
|
283
|
-
kind: Kinds.cesr,
|
|
284
|
-
size: raw.length,
|
|
285
|
-
pvrsn: metadata.pvrsn,
|
|
286
|
-
gvrsn: metadata.gvrsn,
|
|
287
|
-
ilk: metadata.ilk,
|
|
288
|
-
said: metadata.said,
|
|
289
|
-
native: {
|
|
290
|
-
bodyCode,
|
|
291
|
-
fields,
|
|
292
|
-
},
|
|
293
|
-
},
|
|
296
|
+
body,
|
|
294
297
|
attachments: [],
|
|
295
298
|
},
|
|
296
299
|
consumed: offset + total,
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** KERI security tiers for deterministic secret derivation. */
|
|
2
|
+
export const Tiers = Object.freeze({
|
|
3
|
+
low: "low",
|
|
4
|
+
med: "med",
|
|
5
|
+
high: "high",
|
|
6
|
+
});
|
|
7
|
+
/** Return true when the value is one of the supported KERI security tiers. */
|
|
8
|
+
export function isTier(value) {
|
|
9
|
+
return Object.values(Tiers).includes(value);
|
|
10
|
+
}
|
|
11
|
+
/** KERI/ACDC message ilks mirrored from KERIpy's `kering.Ilks`. */
|
|
12
|
+
export const Ilks = Object.freeze({
|
|
13
|
+
icp: "icp",
|
|
14
|
+
rot: "rot",
|
|
15
|
+
ixn: "ixn",
|
|
16
|
+
dip: "dip",
|
|
17
|
+
drt: "drt",
|
|
18
|
+
rct: "rct",
|
|
19
|
+
qry: "qry",
|
|
20
|
+
rpy: "rpy",
|
|
21
|
+
xip: "xip",
|
|
22
|
+
exn: "exn",
|
|
23
|
+
pro: "pro",
|
|
24
|
+
bar: "bar",
|
|
25
|
+
vcp: "vcp",
|
|
26
|
+
vrt: "vrt",
|
|
27
|
+
iss: "iss",
|
|
28
|
+
rev: "rev",
|
|
29
|
+
bis: "bis",
|
|
30
|
+
brv: "brv",
|
|
31
|
+
rip: "rip",
|
|
32
|
+
bup: "bup",
|
|
33
|
+
upd: "upd",
|
|
34
|
+
acm: "acm",
|
|
35
|
+
act: "act",
|
|
36
|
+
acg: "acg",
|
|
37
|
+
ace: "ace",
|
|
38
|
+
sch: "sch",
|
|
39
|
+
att: "att",
|
|
40
|
+
agg: "agg",
|
|
41
|
+
edg: "edg",
|
|
42
|
+
rul: "rul",
|
|
43
|
+
});
|
|
44
|
+
/** Return true when the value is one of the known KERI/ACDC ilks. */
|
|
45
|
+
export function isIlk(value) {
|
|
46
|
+
return Object.values(Ilks).includes(value);
|
|
47
|
+
}
|
package/esm/cesr/src/index.js
CHANGED
|
@@ -13,6 +13,7 @@ export * from "./core/parser-engine.js";
|
|
|
13
13
|
export * from "./core/parser-policy.js";
|
|
14
14
|
export * from "./core/recovery-diagnostics.js";
|
|
15
15
|
export * from "./core/types.js";
|
|
16
|
+
export * from "./core/vocabulary.js";
|
|
16
17
|
export * from "./parser/cold-start.js";
|
|
17
18
|
export * from "./parser/group-dispatch.js";
|
|
18
19
|
export * from "./primitives/aggor.js";
|
|
@@ -27,7 +28,9 @@ export * from "./primitives/dater.js";
|
|
|
27
28
|
export * from "./primitives/decimer.js";
|
|
28
29
|
export * from "./primitives/decrypter.js";
|
|
29
30
|
export * from "./primitives/diger.js";
|
|
31
|
+
export * from "./primitives/disclosure.js";
|
|
30
32
|
export * from "./primitives/encrypter.js";
|
|
33
|
+
export * from "./primitives/hydrate.js";
|
|
31
34
|
export * from "./primitives/ilker.js";
|
|
32
35
|
export * from "./primitives/indexer.js";
|
|
33
36
|
export * from "./primitives/labeler.js";
|
|
@@ -46,6 +49,8 @@ export * from "./primitives/sealer.js";
|
|
|
46
49
|
export * from "./primitives/seqner.js";
|
|
47
50
|
export * from "./primitives/siger.js";
|
|
48
51
|
export * from "./primitives/signer.js";
|
|
52
|
+
export * from "./primitives/streamer.js";
|
|
53
|
+
export * from "./primitives/structing.js";
|
|
49
54
|
export * from "./primitives/structor.js";
|
|
50
55
|
export * from "./primitives/tagger.js";
|
|
51
56
|
export * from "./primitives/texter.js";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { parseAttachmentDispatchCompat } from "./group-dispatch.js";
|
|
2
|
+
/**
|
|
3
|
+
* Historical attachment-group entrypoint preserved as a thin wrapper around the
|
|
4
|
+
* newer dispatch-policy parser.
|
|
5
|
+
*/
|
|
2
6
|
export function parseAttachmentGroup(input, version, domain, options = {}) {
|
|
3
7
|
return parseAttachmentDispatchCompat(input, version, domain, options);
|
|
4
8
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { ColdStartError, ShortageError } from "../core/errors.js";
|
|
2
|
+
/**
|
|
3
|
+
* Classify the next unread stream bytes into CESR cold-start domains.
|
|
4
|
+
*
|
|
5
|
+
* This mirrors KERIpy's tritet probe: message-domain encodings, text CESR,
|
|
6
|
+
* binary CESR, or annotation separators all begin with distinct leading bits.
|
|
7
|
+
*/
|
|
2
8
|
export function sniff(ims) {
|
|
3
9
|
if (ims.length === 0) {
|
|
4
10
|
throw new ShortageError(1, 0);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { b, b64ToInt, intToB64 } from "../core/bytes.js";
|
|
2
2
|
import { GroupSizeError, ShortageError, UnknownCodeError } from "../core/errors.js";
|
|
3
|
-
import { composeRecoveryDiagnosticObserver
|
|
3
|
+
import { composeRecoveryDiagnosticObserver } from "../core/recovery-diagnostics.js";
|
|
4
4
|
import { CounterGroup, parseCounter } from "../primitives/counter.js";
|
|
5
5
|
import { parseIndexer } from "../primitives/indexer.js";
|
|
6
6
|
import { parseMatter } from "../primitives/matter.js";
|
|
7
7
|
import { UnknownPrimitive } from "../primitives/unknown.js";
|
|
8
8
|
import { CtrDexV1, CtrDexV2 } from "../tables/counter-codex.js";
|
|
9
|
-
import { resolveVersionedRegistryValue
|
|
9
|
+
import { resolveVersionedRegistryValue } from "../tables/counter-version-registry.js";
|
|
10
10
|
import { createAttachmentVersionFallbackPolicy, } from "./attachment-fallback-policy.js";
|
|
11
11
|
export { createAttachmentVersionFallbackPolicy } from "./attachment-fallback-policy.js";
|
|
12
12
|
function tupleItem(items) {
|