@real-life/trust-protocol 0.6.1 → 0.8.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/CHANGELOG.md +165 -0
- package/README.md +68 -3
- package/dist/adapters/vti-mediator.d.ts +112 -5
- package/dist/adapters/vti-mediator.d.ts.map +1 -1
- package/dist/adapters/vti-mediator.js +370 -28
- package/dist/adapters/vti-mediator.js.map +1 -1
- package/dist/encounter/ceremony.d.ts +10 -0
- package/dist/encounter/ceremony.d.ts.map +1 -1
- package/dist/encounter/ceremony.js +70 -13
- package/dist/encounter/ceremony.js.map +1 -1
- package/dist/encounter.d.ts +4 -0
- package/dist/encounter.d.ts.map +1 -1
- package/dist/encounter.js +3 -1
- package/dist/encounter.js.map +1 -1
- package/dist/holder-api.d.ts +18 -2
- package/dist/holder-api.d.ts.map +1 -1
- package/dist/holder-api.js +16 -4
- package/dist/holder-api.js.map +1 -1
- package/dist/identity-state.d.ts +13 -1
- package/dist/identity-state.d.ts.map +1 -1
- package/dist/identity-state.js +36 -1
- package/dist/identity-state.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/results.d.ts +4 -0
- package/dist/results.d.ts.map +1 -1
- package/dist/results.js.map +1 -1
- package/dist/views.d.ts +14 -0
- package/dist/views.d.ts.map +1 -1
- package/dist/views.js +34 -5
- package/dist/views.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwEA,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAA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AY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,yEAAyE;AACzE,uEAAuE;AACvE,uEAAuE;AACvE,0EAA0E;AAC1E,WAAW;AACX,EAAE;AACF,4EAA4E;AAC5E,mEAAmE;AACnE,gFAAgF;AAChF,0DAA0D;AAC1D,2EAA2E;AAC3E,oEAAoE;AACpE,iFAAiF;AACjF,+EAA+E;AAC/E,uEAAuE;AACvE,gFAAgF;AAChF,2EAA2E;AAC3E,2EAA2E;AAC3E,uDAAuD;AACvD,6EAA6E;AAC7E,wEAAwE;AACxE,yEAAyE;AACzE,6EAA6E;AAC7E,2CAA2C;AAC3C,+EAA+E;AAC/E,oEAAoE;AACpE,2DAA2D;AAC3D,6DAA6D;AAC7D,0EAA0E;AAC1E,0EAA0E;AAC1E,2EAA2E;AAC3E,EAAE;AACF,oEAAoE;AACpE,4EAA4E;AAC5E,oEAAoE;AACpE,wEAAwE;AACxE,sEAAsE;AACtE,yEAAyE;AACzE,4DAA4D;AAC5D,0EAA0E;AAC1E,uEAAuE;AACvE,0EAA0E;AAC1E,2EAA2E;AAC3E,+DAA+D;AAC/D,EAAE;AACF,sDAAsD;AACtD,0EAA0E;AAC1E,4EAA4E;AAC5E,sDAAsD;AACtD,gFAAgF;AAChF,gFAAgF;AAChF,wEAAwE;AACxE,yDAAyD;AACzD,4EAA4E;AAC5E,EAAE;AACF,sBAAsB;AACtB,gFAAgF;AAChF,yEAAyE;AACzE,8EAA8E;AAC9E,mDAAmD;AACnD,6EAA6E;AAC7E,8EAA8E;AAC9E,4EAA4E;AAC5E,6DAA6D;AAC7D,2EAA2E;AAC3E,EAAE;AACF,2EAA2E;AAE3E,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,OAAO,EACL,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAC1H,eAAe,EAAE,YAAY,GAC9B,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAG5D,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEnD;4DAC4D;AAC5D,MAAM,UAAU,WAAW,CAAE,GAAY;IACvC,OAAO,gBAAgB,CAAC,GAAG,CAAiC,CAAA;AAC9D,CAAC;AAGD,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAEjE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA","sourcesContent":["// @real-life/trust-protocol — the reference library of RLTP.\n//\n// The holder: createHolder({store, keys, entropy?, log?, access?, retry?,\n// crypto?}) — one person's device state behind the human acts, receive,\n// report, resume and tick, and the views an app reads. The ports (Store,\n// KeyProvider, Entropy, Log, Access, DeliveryReport, Outbound) are the\n// app's; seedKeys is the default KeyProvider. Beside it, the pure wire\n// builders and verifiers of every layer, byte-compatible with the shipped\n// vectors.\n//\n// core the form every artifact obeys (JCS, digests, schemas)\n// crypto the primitives, and the Data Integrity proof\n// identity context derivation under the closed registry (§6.1/§6.2),\n// device labels device/<n>/<c> (§5.5)\n// profile profile@1 (Trust §6b): k_pr, the MAC, the bounds and\n// the picture's header read before any decoding\n// encounter the ceremony's wire forms: challenges, cards, credentials,\n// and its pure checks (5.6 acceptance, the bundle's forms)\n// membership Membership 0.20's forms and checks: the prelude,\n// invite, accept, evidence, vouch@2, the member label, oids\n// message Message Tasks 0.1's forms: message@1, k_msg, the MAC\n// introduction Trust §8's artifacts and checks, the act window, the\n// registry declaration's ack-delay\n// delivery the sealed envelope and the generic receive stages 1–4\n// carrier-identity the carrier-relationship principal (Identity §7a)\n// carrier the carrier side of the port (Delivery §4.4 + §5a)\n// carrier-holder the holder side of the carrier port: proofs, verdicts,\n// recovery (§5a, §9.3)\n// visibility the Trust Layer's wire forms, pure: anchor (self-card@2,\n// anchor-rotation@2, anchor-mapping@4), star@2,\n// group-star@1, continuity-probe@1 and\n// continuity-mapping@1, delivery-ack/0.1\n// ceremony the encounter's, the group's and the introduction's\n// wire forms, pure (the same as the root's encounter,\n// membership and introduction modules, under one name)\n//\n// The holder (holder-api.ts): the typed human acts (trust, untrust,\n// pauseTrust, setClass, setGroupClass, merge, depart, decide, rotateAnchor,\n// setProfile, addDevice, revokeDevice, show, scan, captureSentCard,\n// counter, foundGroup, invite, vouchFor, introduce, sendMessage, block,\n// unblock; {when, actId}), recover, takeMessages, act, receive, tick,\n// resume, report, subscribe, snapshot, deviceKey and the views contacts,\n// contact, groups, profile, prompts, inbox, deliveryStatus;\n// `invariants: true` checks invariants.ts on every commit (testing mode).\n// Its modules: identity (Identity §2, §5.4, §5.5), trust (Trust 2, 2a,\n// 5.2–5.4, 6.1–6.5, 6a, 6b), encounter (Encounter 0.31 §5–§7), membership\n// (Membership 0.20 with an in-library Access), introduction (Trust §8) and\n// message (Message Tasks 0.1: messages, the inbox, the block).\n//\n// views the view types (ContactView, …)\n// keys-seed seedKeys — the default KeyProvider over a root seed\n// state HolderState — opaque here (note §4.5): store adapters\n// persist it, apps read the views\n// codec decodeState (to the opaque state), CODEC, StateCodecError\n// ports Store, KeyProvider, Log, Access, DeliveryReport, Outbound\n// results, events ActResult, ReceiveResult, InfraError, HolderEvent\n// entropy the Entropy port by closed purpose\n// store-contract storeContract — the test suite a Store adapter passes\n//\n// Other entry points:\n// ./testing InMemoryStore, memoryLog, scriptedEntropy, storeContract,\n// emptyState, stateBuilder, freezeDeep, sampleState,\n// openPromptModule, the invariants, forgeMapping, SCHEMAS\n// and the generated wire types\n// ./internal the structural state, encodeState and the codec chain,\n// the engine's module types, the pure view functions, the\n// modules' factories and pure reads — for the library's\n// modules and tests, not an app contract\n// ./adapters/vti-mediator the VTI mediator's reports as DeliveryReport\n//\n// Specification, schemas and vectors: https://trust-protocol.real-life.org\n\nexport * from './core.js'\nexport * from './crypto.js'\nexport * from './identity.js'\nexport * from './encounter.js'\nexport * from './membership.js'\nexport * from './message.js'\nexport * from './introduction.js'\nexport * from './delivery.js'\nexport * from './carrier-identity.js'\nexport * from './carrier.js'\nexport * from './carrier-holder.js'\nexport {\n PROFILE_TYPE, PROFILE_LIMITS, profileSchemaOk, imageDimensions, imageWithinBounds, profileProblem, profileInfo, profileKey,\n assembleProfile, profileMacOk,\n} from './profile.js'\nexport type { ProfileContent, ProfileBody, ProfileArtifact, Dimensions, ImageDimensions } from './profile.js'\nexport * as visibility from './visibility.js'\nexport * as ceremony from './ceremony.js'\nimport { decodeState as decodeStructural } from './codec.js'\nimport type { OpaqueHolderState } from './state.js'\nexport type { OpaqueHolderState as HolderState, Dec, Millis, B64u, TrustClass, Setting, PromptKind, PromptChoice, OutboxStatus } from './state.js'\nexport { CODEC, StateCodecError } from './codec.js'\nexport type { StateCodecErrorCode } from './codec.js'\n/** Load a stored state (a JSON string or a parsed value): an independent,\n * opaque copy at the current codec, or StateCodecError. */\nexport function decodeState (raw: unknown): OpaqueHolderState {\n return decodeStructural(raw) as unknown as OpaqueHolderState\n}\nexport type * from './ports.js'\nexport type * from './events.js'\nexport { InfraError, CryptoUnavailableError } from './results.js'\nexport type { ActError, ActResult, ActReplay, ReceiveFailure, ReceiveStageNo, ReceiveResult, ReplayOutbound, ReplayResult, ResumeResult, InfraErrorCode } from './results.js'\nexport { ENTROPY_PURPOSES, EntropyError, randomEntropy } from './entropy.js'\nexport type { Entropy, EntropyPurpose, EntropyErrorCode, PlatformRandom } from './entropy.js'\nexport { storeContract } from './store-contract.js'\nexport { seedKeys } from './keys-seed.js'\nexport { createHolder } from './holder-api.js'\nexport type { Holder, HolderOptions, HolderSnapshot, HumanActOptions } from './holder-api.js'\nexport type { DeviceKeyResult } from './identity-state.js'\nexport type { ContactView, RelationshipView, ClassView, SealedClassView, ClassesView, ContactProfileView, GroupView, ProfileView, PromptView, InboxMessageView, DeliveryItemView, DeliveryStatusView } from './views.js'\nexport type { EnginePorts, CommitListener, CryptoHandle, TransportEntry, TransportView, TransportRefusal } from './engine.js'\nexport type { ContractHarness } from './store-contract.js'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,yEAAyE;AACzE,uEAAuE;AACvE,uEAAuE;AACvE,0EAA0E;AAC1E,WAAW;AACX,EAAE;AACF,4EAA4E;AAC5E,mEAAmE;AACnE,gFAAgF;AAChF,0DAA0D;AAC1D,2EAA2E;AAC3E,oEAAoE;AACpE,iFAAiF;AACjF,+EAA+E;AAC/E,uEAAuE;AACvE,gFAAgF;AAChF,2EAA2E;AAC3E,2EAA2E;AAC3E,uDAAuD;AACvD,6EAA6E;AAC7E,wEAAwE;AACxE,yEAAyE;AACzE,6EAA6E;AAC7E,2CAA2C;AAC3C,+EAA+E;AAC/E,oEAAoE;AACpE,2DAA2D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AM,YAAY,CAAA;AAEnD;4DAC4D;AAC5D,MAAM,UAAU,WAAW,CAAE,GAAY;IACvC,OAAO,gBAAgB,CAAC,GAAG,CAAiC,CAAA;AAC9D,CAAC;AAGD,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAEjE,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA","sourcesContent":["// @real-life/trust-protocol — the reference library of RLTP.\n//\n// The holder: createHolder({store, keys, entropy?, log?, access?, retry?,\n// crypto?}) — one person's device state behind the human acts, receive,\n// report, resume and tick, and the views an app reads. The ports (Store,\n// KeyProvider, Entropy, Log, Access, DeliveryReport, Outbound) are the\n// app's; seedKeys is the default KeyProvider. Beside it, the pure wire\n// builders and verifiers of every layer, byte-compatible with the shipped\n// vectors.\n//\n// core the form every artifact obeys (JCS, digests, schemas)\n// crypto the primitives, and the Data Integrity proof\n// identity context derivation under the closed registry (§6.1/§6.2),\n// device labels device/<n>/<c> (§5.5)\n// profile profile@1 (Trust §6b): k_pr, the MAC, the bounds and\n// the picture's header read before any decoding\n// encounter the ceremony's wire forms: challenges, cards, credentials,\n// and its pure checks (5.6 acceptance, the bundle's forms)\n// membership Membership 0.20's forms and checks: the prelude,\n// invite, accept, evidence, vouch@2, the member label, oids\n// message Message Tasks 0.1's forms: message@1, k_msg, the MAC\n// introduction Trust §8's artifacts and checks, the act window, the\n// registry declaration's ack-delay\n// delivery the sealed envelope and the generic receive stages 1–4\n// carrier-identity the carrier-relationship principal (Identity §7a)\n// carrier the carrier side of the port (Delivery §4.4 + §5a)\n// carrier-holder the holder side of the carrier port: proofs, verdicts,\n// recovery (§5a, §9.3)\n// visibility the Trust Layer's wire forms, pure: anchor (self-card@2,\n// anchor-rotation@2, anchor-mapping@4), star@2,\n// group-star@1, continuity-probe@1 and\n// continuity-mapping@1, delivery-ack/0.1\n// ceremony the encounter's, the group's and the introduction's\n// wire forms, pure (the same as the root's encounter,\n// membership and introduction modules, under one name)\n//\n// The holder (holder-api.ts): the typed human acts (trust, untrust,\n// pauseTrust, setClass, setGroupClass, merge, depart, decide, rotateAnchor,\n// setProfile, addDevice, revokeDevice, show, scan, captureSentCard,\n// counter, foundGroup, invite, vouchFor, introduce, sendMessage, block,\n// unblock; {when, actId}), recover, takeMessages, act, receive, tick,\n// resume, report, subscribe, snapshot, deviceKey and the views contacts,\n// contact, groups, profile, prompts, inbox, deliveryStatus;\n// `invariants: true` checks invariants.ts on every commit (testing mode).\n// Its modules: identity (Identity §2, §5.4, §5.5), trust (Trust 2, 2a,\n// 5.2–5.4, 6.1–6.5, 6a, 6b), encounter (Encounter 0.31 §5–§7), membership\n// (Membership 0.20 with an in-library Access), introduction (Trust §8) and\n// message (Message Tasks 0.1: messages, the inbox, the block).\n//\n// views the view types (ContactView, …)\n// keys-seed seedKeys — the default KeyProvider over a root seed\n// state HolderState — opaque here (note §4.5): store adapters\n// persist it, apps read the views\n// codec decodeState (to the opaque state), CODEC, StateCodecError\n// ports Store, KeyProvider, Log, Access, DeliveryReport, Outbound\n// results, events ActResult, ReceiveResult, InfraError, HolderEvent\n// entropy the Entropy port by closed purpose\n// store-contract storeContract — the test suite a Store adapter passes\n//\n// Other entry points:\n// ./testing InMemoryStore, memoryLog, scriptedEntropy, storeContract,\n// emptyState, stateBuilder, freezeDeep, sampleState,\n// openPromptModule, the invariants, forgeMapping, SCHEMAS\n// and the generated wire types\n// ./internal the structural state, encodeState and the codec chain,\n// the engine's module types, the pure view functions, the\n// modules' factories and pure reads — for the library's\n// modules and tests, not an app contract\n// ./adapters/vti-mediator the VTI mediator's reports as DeliveryReport\n//\n// Specification, schemas and vectors: https://trust-protocol.real-life.org\n\nexport * from './core.js'\nexport * from './crypto.js'\nexport * from './identity.js'\nexport * from './encounter.js'\nexport * from './membership.js'\nexport * from './message.js'\nexport * from './introduction.js'\nexport * from './delivery.js'\nexport * from './carrier-identity.js'\nexport * from './carrier.js'\nexport * from './carrier-holder.js'\nexport {\n PROFILE_TYPE, PROFILE_LIMITS, profileSchemaOk, imageDimensions, imageWithinBounds, profileProblem, profileInfo, profileKey,\n assembleProfile, profileMacOk,\n} from './profile.js'\nexport type { ProfileContent, ProfileBody, ProfileArtifact, Dimensions, ImageDimensions } from './profile.js'\nexport * as visibility from './visibility.js'\nexport * as ceremony from './ceremony.js'\nimport { decodeState as decodeStructural } from './codec.js'\nimport type { OpaqueHolderState } from './state.js'\nexport type { OpaqueHolderState as HolderState, Dec, Millis, B64u, TrustClass, Setting, PromptKind, PromptChoice, OutboxStatus } from './state.js'\nexport { CODEC, StateCodecError } from './codec.js'\nexport type { StateCodecErrorCode } from './codec.js'\n/** Load a stored state (a JSON string or a parsed value): an independent,\n * opaque copy at the current codec, or StateCodecError. */\nexport function decodeState (raw: unknown): OpaqueHolderState {\n return decodeStructural(raw) as unknown as OpaqueHolderState\n}\nexport type * from './ports.js'\nexport type * from './events.js'\nexport { InfraError, CryptoUnavailableError } from './results.js'\nexport type { ActError, ActResult, ActReplay, ReceiveFailure, ReceiveStageNo, ReceiveResult, ReplayOutbound, ReplayResult, ResumeResult, InfraErrorCode } from './results.js'\nexport { ENTROPY_PURPOSES, EntropyError, randomEntropy } from './entropy.js'\nexport type { Entropy, EntropyPurpose, EntropyErrorCode, PlatformRandom } from './entropy.js'\nexport { storeContract } from './store-contract.js'\nexport { seedKeys } from './keys-seed.js'\nexport { createHolder } from './holder-api.js'\nexport type { CarrierOffer, Holder, HolderOptions, HolderSnapshot, HumanActOptions } from './holder-api.js'\nexport type { DeviceKeyResult } from './identity-state.js'\nexport type { ContactView, RelationshipView, ClassView, SealedClassView, ClassesView, ContactProfileView, GroupView, ProfileView, PromptView, InboxMessageView, DeliveryItemView, DeliveryStatusView } from './views.js'\nexport type { EnginePorts, CommitListener, CryptoHandle, TransportEntry, TransportView, TransportRefusal } from './engine.js'\nexport type { ContractHarness } from './store-contract.js'\n"]}
|
package/dist/results.d.ts
CHANGED
|
@@ -43,6 +43,10 @@ export type ActError = 'unknown-contact' | 'no-own-channel' | 'tuple-deactivated
|
|
|
43
43
|
* keys, proof) or is not of the profile the act needs (displayed for a
|
|
44
44
|
* scan, sent and addressed to an own challenge's anchor for a capture) */
|
|
45
45
|
| 'card-invalid'
|
|
46
|
+
/** encounter.show, encounter.scan: the carrier nonce of the offer is not
|
|
47
|
+
* 32 bytes in canonical base64url, or the register already holds it as
|
|
48
|
+
* a carrier or pair nonce (Identity §7a.3: fresh) */
|
|
49
|
+
| 'carrier-nonce-invalid'
|
|
46
50
|
/** encounter.scan: this displayed code was scanned already: its
|
|
47
51
|
* challenge is in a record (5.3, 5170) */
|
|
48
52
|
| 'already-scanned'
|
package/dist/results.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE1C;oEACoE;AACpE,MAAM,WAAW,YAAY;IAAG,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAAC,MAAM,EAAE,WAAW,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE;AAEjG,qEAAqE;AACrE,MAAM,MAAM,QAAQ,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,WAAW,GACX,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB;AAClB,uEAAuE;GACrE,eAAe,GACf,aAAa;AACf,iGAAiG;GAC/F,cAAc,GACd,gBAAgB;AAClB,gDAAgD;GAC9C,gBAAgB;AAClB,+EAA+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a,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;gBAChB,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAKnF;AAED;yDACyD;AACzD,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;gBACtB,OAAO,EAAE,SAAS,MAAM,EAAE;CAKxC"}
|
package/dist/results.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results.js","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AA4MA,oEAAoE;AACpE,MAAM,OAAO,UAAW,SAAQ,KAAK;IAC1B,IAAI,CAAgB;IAC7B,YAAa,IAAoB,EAAE,OAAgB,EAAE,OAA6B;QAChF,KAAK,CAAC,OAAO,IAAI,IAAI,EAAE,OAAO,CAAC,CAAA;QAC/B,IAAI,CAAC,IAAI,GAAG,YAAY,CAAA;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF;AAED;yDACyD;AACzD,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,6EAA6E;IACpE,OAAO,CAAmB;IACnC,YAAa,OAA0B;QACrC,KAAK,CAAC,oBAAoB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAA;QACrG,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA;QACpC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAA;IAC5C,CAAC;CACF","sourcesContent":["// results — one closed result type for acts, one for reception, one error\n// class for infrastructure (lib Stage 2, note §4.4).\n//\n// \"Nothing to do\" is ok with empty outbound. A committed act with open\n// follow-up work is success plus a duty. Store and provider failures are\n// InfraError; programming errors and broken invariants throw. Human text\n// is the app's, made from the code.\nimport type { HolderEvent } from './events.js'\nimport type { Outbound } from './ports.js'\n\n/** What resume(when) hands out: retries and due duties, in the engine's\n * fixed order, and when to call again (absent: nothing is due). */\nexport interface ResumeResult { outbound: Outbound[], events: HolderEvent[], nextDueAt?: number }\n\n/** Why an act was refused; `ref` on the result may name the rule. */\nexport type ActError =\n | 'unknown-contact'\n | 'no-own-channel'\n | 'tuple-deactivated'\n | 'already-given'\n | 'in-flight'\n | 'scope-exhausted'\n | 'stale-issuance'\n | 'actid-conflict'\n /** a human act came without the actId the app must mint (note §4.2) */\n | 'actid-missing'\n | 'log-missing'\n /** the anchor mapping needs the holder's community anchor (register.community, Identity §5.4) */\n | 'no-community'\n | 'unknown-digest'\n /** prompt.decide: no open prompt has this id */\n | 'unknown-prompt'\n /** prompt.decide: the prompt's expiresAt is not after when; tick removes it */\n | 'prompt-expired'\n /** trust.merge: the manual merge joins at most one entry (6640), and\n * never relationships the binding rule keeps apart (6605) */\n | 'not-mergeable'\n /** identity.addDevice: not a device name of 6.2 (Identity §5.5) */\n | 'device-name-invalid'\n /** identity.addDevice: the register already holds the name (Identity §5.5, SHOULD) */\n | 'device-name-held'\n /** identity.addDevice: a revoked name is never given again (Identity §5.5) */\n | 'device-name-revoked'\n /** identity.revokeDevice: the register holds no such device name */\n | 'unknown-device'\n /** identity.rotate: the log replica does not hold the lineage through the\n * current generation (Identity §5.4, Access RLTP-ACC-5980); the rotation\n * stays pending until it does */\n | 'log-behind'\n /** identity.rotate: the log's head is no generation of this register's\n * lineage (another genesis, or a head the register does not follow) */\n | 'log-diverged'\n /** identity.rotate: the log answered failure; the rotation stays pending */\n | 'log-failure'\n /** setProfile: the body breaks 6430/6435 or its image 6475 */\n | 'profile-invalid'\n /** encounter: a card that fails Encounter 6 (schema, version, challenge,\n * keys, proof) or is not of the profile the act needs (displayed for a\n * scan, sent and addressed to an own challenge's anchor for a capture) */\n | 'card-invalid'\n /** encounter.scan: this displayed code was scanned already: its\n * challenge is in a record (5.3, 5170) */\n | 'already-scanned'\n /** encounter.capture: the bound challenge resolves unknown (5460) */\n | 'gate-expired'\n /** encounter: the own challenge is future-dated beyond the skew (5390) */\n | 'gate-future'\n /** encounter.capture: the challenge was consumed by another enactment (5440) */\n | 'consumed-challenge'\n /** encounter.capture: the same counterparty with other material (5450) */\n | 'card-mismatch'\n /** encounter.counter: no enactment record of the contact to issue on */\n | 'no-record'\n /** encounter.counter: the own step credential is issued already */\n | 'already-issued'\n /** membership: no such group, or the holder holds no role in it the act needs */\n | 'unknown-group'\n /** membership.vouch: no consent pair held for this member (Access 5.3) */\n | 'no-evidence'\n /** membership.vouch: the admitting member's own vouch never counts beside its admission */\n | 'own-admission'\n /** membership.found: a genesis admits under the rule of one; a stricter rule needs policy.change */\n | 'threshold-unsupported'\n /** introduction: no such act, or not in a state that allows the step */\n | 'unknown-act'\n /** introduction.request: the mediator's ack-delay declaration is not held (Delivery 4.4) */\n | 'no-declaration'\n /** a message, an invitation or the start of an introduction act toward\n * a relationship the holder has blocked (Message Tasks RLTP-MSG-6410) */\n | 'blocked'\n /** message.send: the tuple is not ready — no document of the\n * counterpart was accepted on it yet (Message Tasks RLTP-MSG-5020); the\n * app keeps the message unsent and sends it once the contact view says\n * `canMessage` */\n | 'not-ready'\n /** message.send: the text is not 1 to 4096 code points, or replyTo is no\n * lowercase UUID v4 (Message Tasks 3.2) */\n | 'message-invalid'\n\nexport type ActResult =\n /** nextDueAt: duty work this act opened or unblocked, or the first retry\n * or send deadline of a document it issued (a repeat: of its live\n * documents), is due then (`when`: now) — call resume at that time\n * (engine.ts) */\n | { ok: true, outbound: Outbound[], events: HolderEvent[], nextDueAt?: number }\n | { ok: false, code: ActError, ref?: string }\n\n/** One document of a journaled act, as replay(actId, when) sees it:\n * `live` is whether a repeat of the act at `when` would hand it out again\n * (neither delivered nor failed, and not past its sender lifetime or the\n * horizon at max(when, lastWhen)); deliveryStatus(digest) has the rest. */\nexport interface ReplayOutbound { readonly digest: string, readonly live: boolean }\n\n/** The journaled result of one human act (note §4.2): what the act's\n * commit answered. For sendMessage, the `message.sent` event carries\n * `mid` and `digest`; `at` is the commit time the message's `sentAt` was\n * taken from (whole seconds below it). */\nexport interface ActReplay {\n readonly actId: string\n /** the act's commit */\n readonly commitSeq: string\n /** the holder time of the act's commit (max(when, lastWhen) then) */\n readonly at: number\n /** the act's events as the commit announced them */\n readonly events: readonly HolderEvent[]\n /** the act's documents, in the act's order */\n readonly outbound: readonly ReplayOutbound[]\n}\n\n/** replay(actId, when): the journaled result, or `unknown-act` when the\n * journal holds no act under the id — never committed, or past the\n * journal's retention. A pure read: nothing runs, nothing commits. */\nexport type ReplayResult =\n | { readonly ok: true, readonly result: ActReplay }\n | { readonly ok: false, readonly code: 'unknown-act' | 'actid-missing' }\n\n/** Receiver failure dispositions (Delivery §6.2), by the stage that names them. */\nexport type ReceiveFailure =\n | 'oversize' // stage 1\n | 'malformed' // stages 2, 4, 5, 7\n | 'decryption-failed' // stage 3\n | 'wrong-recipient' // stage 5\n | 'unknown-type' // stage 6\n | 'validation-failed' // stages 6 (the entry's proof declaration), 8, 9\n | 'stale-issuance' // stages 8, 9\n /** transient (Delivery RLTP-DEL-5820, 6270, 6280): nothing committed, no\n * ack, no cache entry; the carrier keeps the document and the receiver\n * evaluates it afresh when it is delivered again — never concluded */\n | 'rate-limited' // stage 8\n | 'gate-future' // stage 9\n | 'consumed-challenge' // stage 9\n\nexport type ReceiveStageNo = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9\n\n/**\n * The outcome of receive(env, when). `unique`: the effect committed,\n * with its ack first among `outbound` where the type acknowledges (a\n * delivery-ack itself is terminal and earns none), then the documents\n * the effect issued. `duplicate-known`: the stored ack is re-sent\n * byte-identical (none for a terminal document); nothing commits beyond\n * a raised lastWhen. `failed`: nothing took effect and nothing commits.\n * `discarded`: the document's chunk met a receiver resource limit (Trust\n * 5365, reason `resource-limit`) or, authenticated, violated the assembly\n * rules so that its whole delivery is rejected (5260–5310, 5500, 5510,\n * reason `rejected`): the open assembly is dropped and its salt held as\n * the lower bound (5366), committed; no cache entry, no ack, no event.\n * Delivery §6.2 has no disposition for it yet (receive.ts: a gap for\n * Delivery 0.82).\n */\nexport type ReceiveResult =\n | { disposition: 'unique', digest: string, type: string, outbound: Outbound[], events: HolderEvent[], /** as on ActResult */ nextDueAt?: number }\n | { disposition: 'duplicate-known', digest: string, outbound: Outbound[] }\n | { disposition: 'discarded', digest: string, type: string, reason: 'resource-limit' | 'rejected', ref?: string }\n | {\n disposition: 'failed', reason: ReceiveFailure, stage: ReceiveStageNo, digest?: string,\n /** local diagnosis of a key failure, never a disposition of its own\n * (Delivery §5, §6.2): 'unknown' — an rkid this holder never issued,\n * failed(malformed) at stage 2; 'retired' — a tombstone (or a key\n * marked retired), failed(decryption-failed) at stage 3 */\n key?: 'unknown' | 'retired'\n /** the rule the document failed, where its task handler names one\n * (TaskRefusal.ref), e.g. RLTP-TRU-6118 */\n ref?: string\n }\n\nexport type InfraErrorCode =\n | 'store-read'\n | 'store-commit'\n /** the commit may or may not have landed; re-read and consult the act journal */\n | 'unknown-commit-outcome'\n /** the store kept answering `conflict` past the retry bound (RetryPolicy.commitAttempts) */\n | 'commit-conflict'\n | 'key-provider'\n | 'log'\n | 'access'\n /** testing mode only (createHolder's `invariants: true`): a commit would\n * break an invariant of invariants.ts; nothing committed, the\n * violations are the cause */\n | 'invariant-violated'\n /** the holder was closed (a lock, the end of a process): it runs nothing\n * more, and nothing it issued authorizes a hand-over (Delivery\n * RLTP-DEL-6125, 6130) */\n | 'closed'\n\n/** A failure of a port the host provides, never of the protocol. */\nexport class InfraError extends Error {\n readonly code: InfraErrorCode\n constructor (code: InfraErrorCode, message?: string, options?: { cause?: unknown }) {\n super(message ?? code, options)\n this.name = 'InfraError'\n this.code = code\n }\n}\n\n/** The WebCrypto handle lacks what the library needs; raised when a\n * holder is built, never at import (note §3 Crypto). */\nexport class CryptoUnavailableError extends Error {\n /** the algorithms (or 'subtle' itself) that are missing, in a fixed order */\n readonly missing: readonly string[]\n constructor (missing: readonly string[]) {\n super(`WebCrypto lacks: ${missing.join(', ')} (needs Ed25519, X25519, HKDF, HMAC, AES-GCM, SHA-256)`)\n this.name = 'CryptoUnavailableError'\n this.missing = Object.freeze([...missing])\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"results.js","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAgNA,oEAAoE;AACpE,MAAM,OAAO,UAAW,SAAQ,KAAK;IAC1B,IAAI,CAAgB;IAC7B,YAAa,IAAoB,EAAE,OAAgB,EAAE,OAA6B;QAChF,KAAK,CAAC,OAAO,IAAI,IAAI,EAAE,OAAO,CAAC,CAAA;QAC/B,IAAI,CAAC,IAAI,GAAG,YAAY,CAAA;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF;AAED;yDACyD;AACzD,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,6EAA6E;IACpE,OAAO,CAAmB;IACnC,YAAa,OAA0B;QACrC,KAAK,CAAC,oBAAoB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAA;QACrG,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA;QACpC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAA;IAC5C,CAAC;CACF","sourcesContent":["// results — one closed result type for acts, one for reception, one error\n// class for infrastructure (lib Stage 2, note §4.4).\n//\n// \"Nothing to do\" is ok with empty outbound. A committed act with open\n// follow-up work is success plus a duty. Store and provider failures are\n// InfraError; programming errors and broken invariants throw. Human text\n// is the app's, made from the code.\nimport type { HolderEvent } from './events.js'\nimport type { Outbound } from './ports.js'\n\n/** What resume(when) hands out: retries and due duties, in the engine's\n * fixed order, and when to call again (absent: nothing is due). */\nexport interface ResumeResult { outbound: Outbound[], events: HolderEvent[], nextDueAt?: number }\n\n/** Why an act was refused; `ref` on the result may name the rule. */\nexport type ActError =\n | 'unknown-contact'\n | 'no-own-channel'\n | 'tuple-deactivated'\n | 'already-given'\n | 'in-flight'\n | 'scope-exhausted'\n | 'stale-issuance'\n | 'actid-conflict'\n /** a human act came without the actId the app must mint (note §4.2) */\n | 'actid-missing'\n | 'log-missing'\n /** the anchor mapping needs the holder's community anchor (register.community, Identity §5.4) */\n | 'no-community'\n | 'unknown-digest'\n /** prompt.decide: no open prompt has this id */\n | 'unknown-prompt'\n /** prompt.decide: the prompt's expiresAt is not after when; tick removes it */\n | 'prompt-expired'\n /** trust.merge: the manual merge joins at most one entry (6640), and\n * never relationships the binding rule keeps apart (6605) */\n | 'not-mergeable'\n /** identity.addDevice: not a device name of 6.2 (Identity §5.5) */\n | 'device-name-invalid'\n /** identity.addDevice: the register already holds the name (Identity §5.5, SHOULD) */\n | 'device-name-held'\n /** identity.addDevice: a revoked name is never given again (Identity §5.5) */\n | 'device-name-revoked'\n /** identity.revokeDevice: the register holds no such device name */\n | 'unknown-device'\n /** identity.rotate: the log replica does not hold the lineage through the\n * current generation (Identity §5.4, Access RLTP-ACC-5980); the rotation\n * stays pending until it does */\n | 'log-behind'\n /** identity.rotate: the log's head is no generation of this register's\n * lineage (another genesis, or a head the register does not follow) */\n | 'log-diverged'\n /** identity.rotate: the log answered failure; the rotation stays pending */\n | 'log-failure'\n /** setProfile: the body breaks 6430/6435 or its image 6475 */\n | 'profile-invalid'\n /** encounter: a card that fails Encounter 6 (schema, version, challenge,\n * keys, proof) or is not of the profile the act needs (displayed for a\n * scan, sent and addressed to an own challenge's anchor for a capture) */\n | 'card-invalid'\n /** encounter.show, encounter.scan: the carrier nonce of the offer is not\n * 32 bytes in canonical base64url, or the register already holds it as\n * a carrier or pair nonce (Identity §7a.3: fresh) */\n | 'carrier-nonce-invalid'\n /** encounter.scan: this displayed code was scanned already: its\n * challenge is in a record (5.3, 5170) */\n | 'already-scanned'\n /** encounter.capture: the bound challenge resolves unknown (5460) */\n | 'gate-expired'\n /** encounter: the own challenge is future-dated beyond the skew (5390) */\n | 'gate-future'\n /** encounter.capture: the challenge was consumed by another enactment (5440) */\n | 'consumed-challenge'\n /** encounter.capture: the same counterparty with other material (5450) */\n | 'card-mismatch'\n /** encounter.counter: no enactment record of the contact to issue on */\n | 'no-record'\n /** encounter.counter: the own step credential is issued already */\n | 'already-issued'\n /** membership: no such group, or the holder holds no role in it the act needs */\n | 'unknown-group'\n /** membership.vouch: no consent pair held for this member (Access 5.3) */\n | 'no-evidence'\n /** membership.vouch: the admitting member's own vouch never counts beside its admission */\n | 'own-admission'\n /** membership.found: a genesis admits under the rule of one; a stricter rule needs policy.change */\n | 'threshold-unsupported'\n /** introduction: no such act, or not in a state that allows the step */\n | 'unknown-act'\n /** introduction.request: the mediator's ack-delay declaration is not held (Delivery 4.4) */\n | 'no-declaration'\n /** a message, an invitation or the start of an introduction act toward\n * a relationship the holder has blocked (Message Tasks RLTP-MSG-6410) */\n | 'blocked'\n /** message.send: the tuple is not ready — no document of the\n * counterpart was accepted on it yet (Message Tasks RLTP-MSG-5020); the\n * app keeps the message unsent and sends it once the contact view says\n * `canMessage` */\n | 'not-ready'\n /** message.send: the text is not 1 to 4096 code points, or replyTo is no\n * lowercase UUID v4 (Message Tasks 3.2) */\n | 'message-invalid'\n\nexport type ActResult =\n /** nextDueAt: duty work this act opened or unblocked, or the first retry\n * or send deadline of a document it issued (a repeat: of its live\n * documents), is due then (`when`: now) — call resume at that time\n * (engine.ts) */\n | { ok: true, outbound: Outbound[], events: HolderEvent[], nextDueAt?: number }\n | { ok: false, code: ActError, ref?: string }\n\n/** One document of a journaled act, as replay(actId, when) sees it:\n * `live` is whether a repeat of the act at `when` would hand it out again\n * (neither delivered nor failed, and not past its sender lifetime or the\n * horizon at max(when, lastWhen)); deliveryStatus(digest) has the rest. */\nexport interface ReplayOutbound { readonly digest: string, readonly live: boolean }\n\n/** The journaled result of one human act (note §4.2): what the act's\n * commit answered. For sendMessage, the `message.sent` event carries\n * `mid` and `digest`; `at` is the commit time the message's `sentAt` was\n * taken from (whole seconds below it). */\nexport interface ActReplay {\n readonly actId: string\n /** the act's commit */\n readonly commitSeq: string\n /** the holder time of the act's commit (max(when, lastWhen) then) */\n readonly at: number\n /** the act's events as the commit announced them */\n readonly events: readonly HolderEvent[]\n /** the act's documents, in the act's order */\n readonly outbound: readonly ReplayOutbound[]\n}\n\n/** replay(actId, when): the journaled result, or `unknown-act` when the\n * journal holds no act under the id — never committed, or past the\n * journal's retention. A pure read: nothing runs, nothing commits. */\nexport type ReplayResult =\n | { readonly ok: true, readonly result: ActReplay }\n | { readonly ok: false, readonly code: 'unknown-act' | 'actid-missing' }\n\n/** Receiver failure dispositions (Delivery §6.2), by the stage that names them. */\nexport type ReceiveFailure =\n | 'oversize' // stage 1\n | 'malformed' // stages 2, 4, 5, 7\n | 'decryption-failed' // stage 3\n | 'wrong-recipient' // stage 5\n | 'unknown-type' // stage 6\n | 'validation-failed' // stages 6 (the entry's proof declaration), 8, 9\n | 'stale-issuance' // stages 8, 9\n /** transient (Delivery RLTP-DEL-5820, 6270, 6280): nothing committed, no\n * ack, no cache entry; the carrier keeps the document and the receiver\n * evaluates it afresh when it is delivered again — never concluded */\n | 'rate-limited' // stage 8\n | 'gate-future' // stage 9\n | 'consumed-challenge' // stage 9\n\nexport type ReceiveStageNo = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9\n\n/**\n * The outcome of receive(env, when). `unique`: the effect committed,\n * with its ack first among `outbound` where the type acknowledges (a\n * delivery-ack itself is terminal and earns none), then the documents\n * the effect issued. `duplicate-known`: the stored ack is re-sent\n * byte-identical (none for a terminal document); nothing commits beyond\n * a raised lastWhen. `failed`: nothing took effect and nothing commits.\n * `discarded`: the document's chunk met a receiver resource limit (Trust\n * 5365, reason `resource-limit`) or, authenticated, violated the assembly\n * rules so that its whole delivery is rejected (5260–5310, 5500, 5510,\n * reason `rejected`): the open assembly is dropped and its salt held as\n * the lower bound (5366), committed; no cache entry, no ack, no event.\n * Delivery §6.2 has no disposition for it yet (receive.ts: a gap for\n * Delivery 0.82).\n */\nexport type ReceiveResult =\n | { disposition: 'unique', digest: string, type: string, outbound: Outbound[], events: HolderEvent[], /** as on ActResult */ nextDueAt?: number }\n | { disposition: 'duplicate-known', digest: string, outbound: Outbound[] }\n | { disposition: 'discarded', digest: string, type: string, reason: 'resource-limit' | 'rejected', ref?: string }\n | {\n disposition: 'failed', reason: ReceiveFailure, stage: ReceiveStageNo, digest?: string,\n /** local diagnosis of a key failure, never a disposition of its own\n * (Delivery §5, §6.2): 'unknown' — an rkid this holder never issued,\n * failed(malformed) at stage 2; 'retired' — a tombstone (or a key\n * marked retired), failed(decryption-failed) at stage 3 */\n key?: 'unknown' | 'retired'\n /** the rule the document failed, where its task handler names one\n * (TaskRefusal.ref), e.g. RLTP-TRU-6118 */\n ref?: string\n }\n\nexport type InfraErrorCode =\n | 'store-read'\n | 'store-commit'\n /** the commit may or may not have landed; re-read and consult the act journal */\n | 'unknown-commit-outcome'\n /** the store kept answering `conflict` past the retry bound (RetryPolicy.commitAttempts) */\n | 'commit-conflict'\n | 'key-provider'\n | 'log'\n | 'access'\n /** testing mode only (createHolder's `invariants: true`): a commit would\n * break an invariant of invariants.ts; nothing committed, the\n * violations are the cause */\n | 'invariant-violated'\n /** the holder was closed (a lock, the end of a process): it runs nothing\n * more, and nothing it issued authorizes a hand-over (Delivery\n * RLTP-DEL-6125, 6130) */\n | 'closed'\n\n/** A failure of a port the host provides, never of the protocol. */\nexport class InfraError extends Error {\n readonly code: InfraErrorCode\n constructor (code: InfraErrorCode, message?: string, options?: { cause?: unknown }) {\n super(message ?? code, options)\n this.name = 'InfraError'\n this.code = code\n }\n}\n\n/** The WebCrypto handle lacks what the library needs; raised when a\n * holder is built, never at import (note §3 Crypto). */\nexport class CryptoUnavailableError extends Error {\n /** the algorithms (or 'subtle' itself) that are missing, in a fixed order */\n readonly missing: readonly string[]\n constructor (missing: readonly string[]) {\n super(`WebCrypto lacks: ${missing.join(', ')} (needs Ed25519, X25519, HKDF, HMAC, AES-GCM, SHA-256)`)\n this.name = 'CryptoUnavailableError'\n this.missing = Object.freeze([...missing])\n }\n}\n"]}
|
package/dist/views.d.ts
CHANGED
|
@@ -93,6 +93,20 @@ export interface RelationshipView {
|
|
|
93
93
|
id: string;
|
|
94
94
|
tuples: number;
|
|
95
95
|
chainedFrom: string[];
|
|
96
|
+
/** the relationship's canonical carrier-nonce entry (Identity §7a.3):
|
|
97
|
+
* N in base64url and its generation, from which an adapter derives this
|
|
98
|
+
* side's wire identities; absent where none is held. A relationship
|
|
99
|
+
* chained into this one is listed only in chainedFrom and shows none:
|
|
100
|
+
* the chain is carried under this N (profile RLTP-VTI-1230) */
|
|
101
|
+
carrierNonce?: {
|
|
102
|
+
nonce: string;
|
|
103
|
+
generation: Dec;
|
|
104
|
+
};
|
|
105
|
+
/** the counterpart's delivery hints from the card of the enactment that
|
|
106
|
+
* opened this relationship (its first contact; Encounter 6080), as
|
|
107
|
+
* signed, uninterpreted; absent where that card carried none. A card of
|
|
108
|
+
* a later enactment chained into the relationship changes nothing */
|
|
109
|
+
counterpartDeliveryHints?: string[];
|
|
96
110
|
}
|
|
97
111
|
/** One group the holder is a member of. */
|
|
98
112
|
export interface GroupView {
|
package/dist/views.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../src/views.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../src/views.ts"],"names":[],"mappings":"AAmFA,OAAO,KAAK,EAED,GAAG,EAAE,WAAW,EAAE,MAAM,EAAc,YAAY,EAAE,UAAU,EAAgB,OAAO,EAAE,UAAU,EAC3G,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAE1F,0FAA0F;AA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AAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,kBAAkB;IAAG,SAAS,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAAE;AAgKjF,+DAA+D;AAC/D,wBAAgB,YAAY,CAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,WAAW,EAAE,CAUzE;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAG9F;AAED,8CAA8C;AAC9C,wBAAgB,UAAU,CAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,SAAS,EAAE,CAWrE;AAED,gCAAgC;AAChC,wBAAgB,WAAW,CAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,WAAW,CAEtE;AAED;+DAC+D;AAC/D,wBAAgB,WAAW,CAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,UAAU,EAAE,CAQvE;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAM/F;AAED,+EAA+E;AAC/E,wBAAgB,SAAS,CAAE,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,gBAAgB,EAAE,CAa3E"}
|
package/dist/views.js
CHANGED
|
@@ -62,7 +62,16 @@
|
|
|
62
62
|
// - deliveryStatus(x) lists the outbox items whose digest or threadId is
|
|
63
63
|
// x, by first submission, then digest; an unknown x lists none
|
|
64
64
|
// - relationships: the entry's own (relIds), in that order; chainedFrom
|
|
65
|
-
// the husks chained into each (chainedInto), by id
|
|
65
|
+
// the husks chained into each (chainedInto), by id; carrierNonce the
|
|
66
|
+
// canonical register entry under the relationship's id;
|
|
67
|
+
// counterpartDeliveryHints the deliveryHints of the counterparty card
|
|
68
|
+
// on the record of the relationship's first tuple, whose relId is the
|
|
69
|
+
// relationship's id (the enactment that opened it): a re-encounter's
|
|
70
|
+
// record names the husk it opened, so its card never replaces the
|
|
71
|
+
// first contact's hints. A chained relationship (a husk) is no
|
|
72
|
+
// RelationshipView of its own, only an id in chainedFrom: it shows no
|
|
73
|
+
// carrierNonce, because no adapter instance runs for it (profile
|
|
74
|
+
// RLTP-VTI-1230)
|
|
66
75
|
// - a contact without a relationship breaks an invariant and throws
|
|
67
76
|
import { freezeDeep } from './util-freeze.js';
|
|
68
77
|
import { triasOf } from './state.js';
|
|
@@ -70,6 +79,7 @@ import { CLASSES, activeTuple, classOn, findContact, lags, trusted as isTrusted,
|
|
|
70
79
|
import { sealedOn } from './trust/group-star.js';
|
|
71
80
|
import { classOfDuty } from './trust/duties.js';
|
|
72
81
|
import { messageChannel } from './message/holder.js';
|
|
82
|
+
import { canonicalCarrierNonce } from './identity-state.js';
|
|
73
83
|
// ── helpers ────────────────────────────────────────────────────────────
|
|
74
84
|
const cmp = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
75
85
|
const cmpDec = (a, b) => { const x = BigInt(a), y = BigInt(b); return x < y ? -1 : x > y ? 1 : 0; };
|
|
@@ -119,6 +129,28 @@ const relationshipsOf = (state, c, ids, ix) => {
|
|
|
119
129
|
}
|
|
120
130
|
return { own, all };
|
|
121
131
|
};
|
|
132
|
+
/** The counterparty card's delivery hints on the record that opened
|
|
133
|
+
* relationship `r`: the record of its first tuple's label (a chaining
|
|
134
|
+
* appends, so the first tuple stays the one the relationship opened with),
|
|
135
|
+
* found in the per-read label index. */
|
|
136
|
+
const firstHints = (r, rix) => {
|
|
137
|
+
const first = r.tuples[0];
|
|
138
|
+
const rec = first ? rix.get(first.ownPairLabel) : undefined;
|
|
139
|
+
if (!rec || rec.relId !== r.id)
|
|
140
|
+
return undefined;
|
|
141
|
+
const h = rec.card?.deliveryHints;
|
|
142
|
+
return Array.isArray(h) && h.length ? h.filter((x) => typeof x === 'string') : undefined;
|
|
143
|
+
};
|
|
144
|
+
const relationshipView = (state, r, rix) => {
|
|
145
|
+
const n = canonicalCarrierNonce(state.register, r.id);
|
|
146
|
+
const hints = firstHints(r, rix);
|
|
147
|
+
return {
|
|
148
|
+
id: r.id, tuples: r.tuples.length,
|
|
149
|
+
chainedFrom: Object.values(state.relationships).filter((x) => x.chainedInto === r.id).map((x) => x.id).sort(cmp),
|
|
150
|
+
...(n ? { carrierNonce: { nonce: n.nonce, generation: n.generation } } : {}),
|
|
151
|
+
...(hints ? { counterpartDeliveryHints: hints } : {}),
|
|
152
|
+
};
|
|
153
|
+
};
|
|
122
154
|
const project = (state, c, ix, rix) => {
|
|
123
155
|
const ids = new Set([c.id, ...c.aliases]);
|
|
124
156
|
const { own, all: rels } = relationshipsOf(state, c, ids, ix);
|
|
@@ -166,10 +198,7 @@ const project = (state, c, ix, rix) => {
|
|
|
166
198
|
commitSeq: state.commitSeq,
|
|
167
199
|
id: c.id,
|
|
168
200
|
aliases: [...c.aliases],
|
|
169
|
-
relationships: own.map((r) => (
|
|
170
|
-
id: r.id, tuples: r.tuples.length,
|
|
171
|
-
chainedFrom: Object.values(state.relationships).filter((x) => x.chainedInto === r.id).map((x) => x.id).sort(cmp),
|
|
172
|
-
})),
|
|
201
|
+
relationships: own.map((r) => relationshipView(state, r, rix)),
|
|
173
202
|
...(profile?.name !== undefined ? { displayName: profile.name } : cardName !== undefined ? { displayName: cardName } : {}),
|
|
174
203
|
provenance: origin.provenance.kind,
|
|
175
204
|
...(origin.provenance.kind === 'introduced' && origin.provenance.via !== undefined ? { via: origin.provenance.via } : {}),
|
package/dist/views.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views.js","sourceRoot":"","sources":["../src/views.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,4BAA4B;AAC5B,EAAE;AACF,uEAAuE;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C,CAAC,SAAS,CAAA;QACtG,MAAM,CAAC,GAAG,CAAC,CAAC,IAA0D,CAAA;QACtE,OAAO;YACL,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvE,OAAO,EAAE,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;YAChE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACpF,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS;SAC/E,CAAA;IACH,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACtF,OAAO,UAAU,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC","sourcesContent":["// views — what an app reads: pure projections of the holder's state\n// (lib Stage 2, note §4.5).\n//\n// `state → View`, synchronous, without the engine: every function here\n// reads one state and returns fresh, deep-frozen objects that share no\n// reference with it, so a UI can keep them and the state stays untouched.\n// Each view carries the commitSeq of the state it was read from; views of\n// one snapshot belong together. The holder hands them out over its\n// snapshot (holder-api.ts); after a `subscribe` announcement the app\n// re-reads them. Views never write: whatever ages state (expiry, the\n// encounter's aging latch) is an act, never a read.\n//\n// Rule numbers: bare four-digit numbers are RLTP-TRU (trust-layer.md).\n//\n// Choices this file makes where the note leaves them open:\n// - contacts are listed in entry-commit order (2120); entries without a\n// position (2060) follow, by id. A contact is found by its entry id or\n// by any of its aliases (2140)\n// - provenance and via come from the contact's oldest relationship (by\n// its provenance time, then id): how the person came, not how often\n// - tuples belong to the entry their entryId names (2145): an entry's\n// tuples are those whose entryId is its id or one of its aliases, over\n// its own relationships and any relationship that stands behind two\n// entries. Its heads are the active-head tuples among them of live\n// relationships (not chained into another), not deactivated; under\n// 2146 the appended tuple's entry takes the chain's active head\n// - verification is the edge of Encounter 4.2 over all of the entry's\n// tuples, deactivated and older ones included (historical evidence;\n// one edge per relationship, carried along its chain): `outgoing` an\n// own step credential was issued, `incoming` the counterparty's was\n// accepted (5.6), `mutual` both, `met` neither — read from the\n// enactment records of those tuples (encounter/ceremony.ts). An entry\n// with no record at all (built without a ceremony: introduced, or a\n// test state) reads the anchor mappings instead: `outgoing` one was\n// issued (mappingOut), `incoming` one was verified (mappingIn)\n// - displayName: the profile's name (6425), else the self-declared name\n// on the counterparty card of the entry's newest record (Encounter\n// 6120: the app binds its own local name to the anchor)\n// - trust.given is the anchor mapping class on (the Trust act, 2770);\n// trust.received a verified anchor mapping from the contact, whose\n// class has no default recipient (2760); trust.paused the pause of 5.4,\n// star and blinded group star both `off` (2780); trust.pending: given,\n// but not yet out on every head (no mapping issued on it, or its\n// relationship lags (6595)), or a re-issue or class-on duty for the\n// anchor mapping is open at a version this library handles (a duty of\n// an unhandled version is opaque, note §2.1). Delivery of the documents is not part of\n// it; deliveryStatus answers that\n// - classes give the setting and whether the class is on toward the\n// contact (2760, 2840); the sealed group star also per group (2830):\n// every group of the holder and every group the contact holds a\n// per-group setting for, by id, with the setting (`default` where none\n// is held) and whether it is on for (group, contact) — the per-group\n// setting first, else the class (trust/group-star.ts sealedOn)\n// - sharedGroups: the union of the groups the last accepted group star\n// on each of the entry's heads hit (5520, trust/group-star.ts), lagging\n// heads included (the group star travels on them, 6595); undefined\n// where no head ever accepted one\n// - a contact's profile (6425): among the verified profile@1 bodies\n// (6b.2) on its heads whose relationship does not lag (6461, 6595),\n// the highest revision, among equal ones the one verified last\n// (highest verifiedSeq); displayName is that profile's name\n// - deliveryStatus(x) lists the outbox items whose digest or threadId is\n// x, by first submission, then digest; an unknown x lists none\n// - relationships: the entry's own (relIds), in that order; chainedFrom\n// the husks chained into each (chainedInto), by id\n// - a contact without a relationship breaks an invariant and throws\nimport { freezeDeep } from './util-freeze.js'\nimport type { Json } from './core.js'\nimport { triasOf } from './state.js'\nimport { CLASSES, activeTuple, classOn, findContact, lags, trusted as isTrusted, tupleByLabel } from './trust/state.js'\nimport { sealedOn } from './trust/group-star.js'\nimport { classOfDuty } from './trust/duties.js'\nimport { messageChannel } from './message/holder.js'\nimport type {\n EnactmentRecord,\n Contact, Dec, HolderState, Millis, OutboxItem, OutboxStatus, PromptKind, Relationship, Setting, TrustClass, Tuple,\n} from './state.js'\nimport type { DeliveryFailure, PreTransportReason, ReceiverRefusalCode } from './ports.js'\n\n/** One trust class toward one contact: its setting (2810) and whether it is on (2760). */\nexport interface ClassView { setting: Setting, on: boolean }\n\n/** The sealed group star toward one contact: the class, and per group\n * (2830) the per-group setting and whether it is on for (group, contact). */\nexport interface SealedClassView extends ClassView { groups: Record<string, ClassView> }\n\n/** Every class toward one contact (2720), the sealed group star per group too. */\nexport type ClassesView = Record<Exclude<TrustClass, 'sealedGroupStar'>, ClassView> & { sealedGroupStar: SealedClassView }\n\n/** A contact's verified profile (6b.2): string fields only. */\nexport interface ContactProfileView { revision: Dec, name?: string, image?: string, text?: string }\n\n/** One contact, i.e. one entry of the deliverable set (2120, 2140). */\nexport interface ContactView {\n /** the commitSeq of the state this view was read from */\n commitSeq: Dec\n /** the entry id: stable across aliases (2140) and chains (6a.4) */\n id: string\n /** identities merged into this entry (2140) and the fresh contacts its\n * chains took in (6a.4); contact(alias) finds it too */\n aliases: string[]\n /** its relationships (Contact.relIds), each with the number of tuples\n * its chain holds (one per enactment that continued it, 6.4) and the\n * fresh relationships chained into it (6a.4); a relationship that\n * stands behind two entries (2145) is listed under both */\n relationships: RelationshipView[]\n /** the verified profile's name (6425); the ceremony card's name enters\n * the state only when Encounter graduates (PR 7), so without a profile\n * it is undefined */\n displayName?: string\n provenance: 'ceremony' | 'introduced'\n /** the introducer, for an introduced contact */\n via?: string\n verification: 'mutual' | 'outgoing' | 'incoming' | 'met'\n trust: { given: boolean, received: boolean, paused: boolean, pending: boolean }\n classes: ClassesView\n /** groups shared with the contact: the groups of the holder whose\n * digest hit in the contact's last completed group star (5520), over\n * its heads, sorted. A hit is the contact's claim (5.2, no veracity).\n * Undefined while no group star was ever accepted on a head, never a\n * claimed empty list. */\n sharedGroups?: string[]\n profile?: ContactProfileView\n /** a block holds on the contact's relationships (Message Tasks 6.1): an\n * application shows no content and no offer of it, and shows group\n * state and removal notices as without a block (6230) */\n blocked: boolean\n /** a message to the contact goes out now (Message Tasks 5.1): an\n * unblocked relationship whose active head is ready; false, sendMessage\n * answers not-ready, blocked or no-own-channel */\n canMessage: boolean\n}\n\n/** One message in the inbox (Message Tasks 4.5): accepted, not yet taken\n * over by the application (takeMessages). */\nexport interface InboxMessageView {\n commitSeq: Dec\n /** the inbox id, the accepted document's digest; takeMessages names it */\n id: string\n /** the contact of the relationship it arrived on; absent once that\n * relationship departed */\n contactId?: string\n /** the relationship is blocked now (it was not at acceptance): an\n * application shows nothing of it (6230) */\n blocked: boolean\n mid: string\n text: string\n replyTo?: string\n /** the sender's statement, distinct from receivedAt (4430) */\n sentAt: Millis\n /** t_ref of the acceptance (4410) */\n receivedAt: Millis\n /** min(sentAt, receivedAt), fixed at acceptance: the order of 4430 with mid */\n displayAt: Millis\n}\n\n/** One relationship of a contact, as its chain stands. */\nexport interface RelationshipView { id: string, tuples: number, chainedFrom: string[] }\n\n/** One group the holder is a member of. */\nexport interface GroupView {\n commitSeq: Dec\n /** genesis digest */\n id: string\n /** the group's name, as its genesis names it */\n name: string\n /** listed in the blinded group star (5.2b per-group switch) */\n listed: boolean\n vouchThreshold: Dec\n /** the members this holder knows of, by member anchor (its roster);\n * `self` marks the own one, `contactId` a member it knows as a contact */\n members: Array<{ anchor: string, name?: string, contactId?: string, self: boolean }>\n /** consent pairs held toward an admission (Membership 3.4), by subject */\n pending: Array<{ member: string, name?: string, vouches: number }>\n}\n\n/** The holder's own profile (6450). */\nexport interface ProfileView { commitSeq: Dec, revision: Dec, name?: string, image?: string, text?: string }\n\n/** One open decision of the human. */\nexport interface PromptView {\n commitSeq: Dec\n id: string\n kind: PromptKind\n contactId?: string\n groupId?: string\n openedAt: Millis\n expiresAt?: Millis\n}\n\n/** One issued document's sender status (Delivery §6.1). */\nexport interface DeliveryItemView {\n digest: string\n type: string\n threadId: string\n contactId: string\n /** the trias position */\n status: OutboxStatus\n /** the adapter holds the item before the trias (last step awaiting-transport) */\n awaiting?: PreTransportReason\n /** for delivered: after a failure (the holder's own give-up included) */\n late?: boolean\n /** for failed; task-expired: the sender lifetime its type declares ran out (Delivery 6110) */\n reason?: DeliveryFailure | 'task-expired'\n code?: ReceiverRefusalCode\n attempt: number\n submittedAt: Millis\n updatedAt: Millis\n nextAttemptAt?: Millis\n}\n\nexport interface DeliveryStatusView { commitSeq: Dec, items: DeliveryItemView[] }\n\n// ── helpers ────────────────────────────────────────────────────────────\n\nconst cmp = (a: string, b: string): number => (a < b ? -1 : a > b ? 1 : 0)\nconst cmpDec = (a: Dec, b: Dec): number => { const x = BigInt(a), y = BigInt(b); return x < y ? -1 : x > y ? 1 : 0 }\nconst isObj = (x: unknown): x is Record<string, Json> => x !== null && typeof x === 'object' && !Array.isArray(x)\n\n/** The string fields of a profile body that a view shows. */\nconst profileFields = (body: Json | null): { name?: string, image?: string, text?: string } => {\n const out: { name?: string, image?: string, text?: string } = {}\n if (!isObj(body)) return out\n for (const k of ['name', 'image', 'text'] as const) if (typeof body[k] === 'string') out[k] = body[k] as string\n return out\n}\n\n/** own pair label → its enactment record (encounter.records) */\ntype RecordIndex = Map<string, EnactmentRecord>\n\nconst recordIndex = (state: Readonly<HolderState>): RecordIndex => {\n const ix: RecordIndex = new Map()\n for (const r of Object.values(state.encounter.records)) ix.set(r.label, r)\n return ix\n}\n\n/** entry id → the relationships holding a tuple of that entry (2145) */\ntype EntryIndex = Map<string, Set<string>>\n\nconst entryIndex = (state: Readonly<HolderState>): EntryIndex => {\n const ix: EntryIndex = new Map()\n for (const r of Object.values(state.relationships)) {\n for (const t of r.tuples) {\n let s = ix.get(t.entryId)\n if (!s) ix.set(t.entryId, (s = new Set()))\n s.add(r.id)\n }\n }\n return ix\n}\n\n/** The contact's own relationships, then those holding a tuple of its entry. */\nconst relationshipsOf = (state: Readonly<HolderState>, c: Readonly<Contact>, ids: ReadonlySet<string>, ix: EntryIndex): { own: Relationship[], all: Relationship[] } => {\n const own = c.relIds.filter((id) => Object.hasOwn(state.relationships, id)).map((id) => state.relationships[id])\n if (!own.length) throw new Error(`views: contact ${c.id} has no relationship`)\n const seen = new Set(own.map((r) => r.id))\n const all = [...own]\n for (const id of ids) {\n for (const rid of ix.get(id) ?? []) {\n if (!seen.has(rid)) { seen.add(rid); all.push(state.relationships[rid]) }\n }\n }\n return { own, all }\n}\n\nconst project = (state: Readonly<HolderState>, c: Readonly<Contact>, ix: EntryIndex, rix: RecordIndex): ContactView => {\n const ids = new Set([c.id, ...c.aliases])\n const { own, all: rels } = relationshipsOf(state, c, ids, ix)\n const mine = (t: Tuple): boolean => ids.has(t.entryId)\n const tuples = rels.flatMap((r) => r.tuples.filter(mine))\n const origin = [...own].sort((a, b) => (a.provenance.at - b.provenance.at) || cmp(a.id, b.id))[0]\n const records = tuples.map((t) => rix.get(t.ownPairLabel)).filter((r): r is EnactmentRecord => r !== undefined)\n const out = records.length ? records.some((r) => r.out !== null) : tuples.some((t) => t.mappingOut.body !== null)\n const inn = records.length ? records.some((r) => r.in !== null) : tuples.some((t) => t.mappingIn.body !== null)\n const newest = [...records].sort((a, b) => b.at - a.at)[0]\n const introduced = own.map((r) => r.memory.introducedName).find((n): n is string => typeof n === 'string')\n const cardName = typeof (newest?.card as { name?: unknown } | undefined)?.name === 'string' ? (newest.card as { name: string }).name : introduced\n const trusted = isTrusted(c)\n const classes = {} as Record<TrustClass, ClassView>\n for (const cls of CLASSES) classes[cls] = { setting: c.settings[cls], on: classOn(cls, c.settings[cls], trusted) }\n const groups: Record<string, ClassView> = {}\n for (const g of [...new Set([...Object.keys(state.groups), ...Object.keys(c.groupSettings)])].sort(cmp)) {\n groups[g] = { setting: Object.hasOwn(c.groupSettings, g) ? c.groupSettings[g] : 'default', on: sealedOn(c, g) }\n }\n const heads: Array<{ r: Relationship, t: Tuple, lagging: boolean }> = []\n for (const r of rels) {\n if (r.chainedInto !== null) continue\n const t = activeTuple(r)\n if (t && !t.deactivated && mine(t)) heads.push({ r, t, lagging: lags(r, rels) })\n }\n // a class-on or re-issue of the anchor mapping, at a version this library\n // handles (classOfDuty: an unhandled version is opaque and owes nothing here)\n const owed = Object.values(state.duties).some((d) =>\n classOfDuty(d) === 'anchorMapping' && (d as { contactId?: unknown }).contactId === c.id)\n const pending = trusted && (owed || heads.some((h) => h.t.mappingOut.body === null || h.lagging))\n let best: Tuple | undefined\n for (const { t, lagging } of heads) {\n if (lagging || t.profileIn.body === null) continue\n if (!best || cmpDec(t.profileIn.rev, best.profileIn.rev) > 0 ||\n (cmpDec(t.profileIn.rev, best.profileIn.rev) === 0 && cmpDec(t.profileIn.verifiedSeq, best.profileIn.verifiedSeq) > 0)) best = t\n }\n const profile = best ? { revision: best.profileIn.rev, ...profileFields(best.profileIn.body) } : undefined\n const received = heads.map((h) => h.t.groupStarIn.accepted).filter((a) => a !== null)\n const sharedGroups = received.length ? [...new Set(received.flatMap((a) => a.groups))].sort(cmp) : undefined\n return {\n commitSeq: state.commitSeq,\n id: c.id,\n aliases: [...c.aliases],\n relationships: own.map((r) => ({\n id: r.id, tuples: r.tuples.length,\n chainedFrom: Object.values(state.relationships).filter((x) => x.chainedInto === r.id).map((x) => x.id).sort(cmp),\n })),\n ...(profile?.name !== undefined ? { displayName: profile.name } : cardName !== undefined ? { displayName: cardName } : {}),\n provenance: origin.provenance.kind,\n ...(origin.provenance.kind === 'introduced' && origin.provenance.via !== undefined ? { via: origin.provenance.via } : {}),\n verification: out && inn ? 'mutual' : out ? 'outgoing' : inn ? 'incoming' : 'met',\n trust: {\n given: trusted,\n received: tuples.some((t) => t.mappingIn.body !== null),\n paused: c.settings.star === 'off' && c.settings.groupStar === 'off',\n pending,\n },\n classes: { ...classes, sealedGroupStar: { ...classes.sealedGroupStar, groups } } as ClassesView,\n ...(sharedGroups ? { sharedGroups } : {}),\n ...(profile ? { profile } : {}),\n blocked: own.some((r) => state.messages.blocked.includes(r.id)),\n canMessage: !('ok' in messageChannel(state, c.id)),\n }\n}\n\nconst itemView = (digest: string, it: Readonly<OutboxItem>): DeliveryItemView => {\n const status = triasOf(it)\n const last = it.history[it.history.length - 1]\n let decisive: OutboxItem['history'][number] | undefined\n for (let i = it.history.length - 1; i >= 0 && !decisive; i--) if (it.history[i].status !== 'awaiting-transport') decisive = it.history[i]\n const v: DeliveryItemView = {\n digest, type: it.type, threadId: it.threadId, contactId: it.recipient.contactId, status,\n attempt: it.attempt, submittedAt: it.history[0]?.at ?? 0, updatedAt: last?.at ?? 0,\n }\n if (last?.status === 'awaiting-transport') v.awaiting = last.reason\n if (decisive?.status === 'delivered') v.late = decisive.late\n if (decisive?.status === 'failed') {\n v.reason = decisive.reason\n if (decisive.reason === 'rejected-by-receiver') v.code = decisive.code\n }\n if (it.nextAttemptAt !== undefined) v.nextAttemptAt = it.nextAttemptAt\n return v\n}\n\n// ── the views ──────────────────────────────────────────────────────────\n\n/** Every contact, in entry-commit order (2120), then by id. */\nexport function contactsView (state: Readonly<HolderState>): ContactView[] {\n const order = Object.values(state.contacts).sort((a, b) => {\n if (a.pos !== null && b.pos !== null) return cmpDec(a.pos, b.pos) || cmp(a.id, b.id)\n if (a.pos !== null) return -1\n if (b.pos !== null) return 1\n return cmp(a.id, b.id)\n })\n const ix = entryIndex(state)\n const rix = recordIndex(state)\n return freezeDeep(order.map((c) => project(state, c, ix, rix)))\n}\n\n/** One contact by entry id or alias; undefined if there is none. */\nexport function contactView (state: Readonly<HolderState>, id: string): ContactView | undefined {\n const c = findContact(state, id)\n return c ? freezeDeep(project(state, c, entryIndex(state), recordIndex(state))) : undefined\n}\n\n/** The holder's groups, by genesis digest. */\nexport function groupsView (state: Readonly<HolderState>): GroupView[] {\n return freezeDeep(Object.values(state.groups).sort((a, b) => cmp(a.id, b.id)).map((g) => ({\n commitSeq: state.commitSeq, id: g.id, name: g.name, listed: g.listed, vouchThreshold: g.rules.vouchThreshold,\n members: Object.values(g.roster).sort((a, b) => cmp(a.anchor, b.anchor)).map((m) => ({\n anchor: m.anchor, ...(m.name !== undefined ? { name: m.name } : {}), ...(m.contactId !== undefined ? { contactId: m.contactId } : {}), self: m.anchor === g.memberAnchor,\n })),\n pending: Object.values(g.evidence).map((e) => {\n const acc = (e.accept as { payload?: { accept?: { subject?: string, card?: { name?: string } } } }).payload?.accept\n return { member: acc?.subject ?? '', ...(typeof acc?.card?.name === 'string' ? { name: acc.card.name } : {}), vouches: e.vouches.length }\n }).sort((a, b) => cmp(a.member, b.member)),\n })))\n}\n\n/** The holder's own profile. */\nexport function profileView (state: Readonly<HolderState>): ProfileView {\n return freezeDeep({ commitSeq: state.commitSeq, revision: state.profile.revision, ...profileFields(state.profile.body) })\n}\n\n/** The open prompts, by opening time, then id. Expired prompts stay\n * listed until tick removes them; deciding one is refused. */\nexport function promptsView (state: Readonly<HolderState>): PromptView[] {\n return freezeDeep(Object.values(state.prompts).sort((a, b) => (a.openedAt - b.openedAt) || cmp(a.id, b.id)).map((p) => ({\n commitSeq: state.commitSeq, id: p.id, kind: p.kind,\n ...(p.contactId !== undefined ? { contactId: p.contactId } : {}),\n ...(p.groupId !== undefined ? { groupId: p.groupId } : {}),\n openedAt: p.openedAt,\n ...(p.expiresAt !== undefined ? { expiresAt: p.expiresAt } : {}),\n })))\n}\n\n/** The sender status of the documents whose digest or threadId is `x`. */\nexport function deliveryStatusView (state: Readonly<HolderState>, x: string): DeliveryStatusView {\n const items = Object.entries(state.outbox)\n .filter(([digest, it]) => digest === x || it.threadId === x)\n .map(([digest, it]) => itemView(digest, it))\n .sort((a, b) => (a.submittedAt - b.submittedAt) || cmp(a.digest, b.digest))\n return freezeDeep({ commitSeq: state.commitSeq, items })\n}\n\n/** The inbox (Message Tasks 4.5), ordered by display time, then mid (4430). */\nexport function inboxView (state: Readonly<HolderState>): InboxMessageView[] {\n const out = Object.values(state.messages.inbox).map((e) => {\n const t = tupleByLabel(state, e.tuple)\n const c = t ? (findContact(state, t.tuple.entryId) ?? findContact(state, t.rel.contactId)) : undefined\n const b = e.body as { text: string, replyTo?: string, sentAt: string }\n return {\n commitSeq: state.commitSeq, id: e.id, ...(c ? { contactId: c.id } : {}),\n blocked: t !== null && state.messages.blocked.includes(t.rel.id),\n mid: e.mid, text: b.text, ...(b.replyTo !== undefined ? { replyTo: b.replyTo } : {}),\n sentAt: Date.parse(b.sentAt), receivedAt: e.receivedAt, displayAt: e.displayAt,\n }\n }).sort((a, b) => (a.displayAt - b.displayAt) || cmp(a.mid, b.mid) || cmp(a.id, b.id))\n return freezeDeep(out)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"views.js","sourceRoot":"","sources":["../src/views.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,4BAA4B;AAC5B,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,0EAA0E;AAC1E,0EAA0E;AAC1E,mEAAmE;AACnE,qEAAqE;AACrE,qEAAqE;AACrE,oDAAoD;AACpD,EAAE;AACF,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`state → View`, synchronous, without the engine: every function here\n// reads one state and returns fresh, deep-frozen objects that share no\n// reference with it, so a UI can keep them and the state stays untouched.\n// Each view carries the commitSeq of the state it was read from; views of\n// one snapshot belong together. The holder hands them out over its\n// snapshot (holder-api.ts); after a `subscribe` announcement the app\n// re-reads them. Views never write: whatever ages state (expiry, the\n// encounter's aging latch) is an act, never a read.\n//\n// Rule numbers: bare four-digit numbers are RLTP-TRU (trust-layer.md).\n//\n// Choices this file makes where the note leaves them open:\n// - contacts are listed in entry-commit order (2120); entries without a\n// position (2060) follow, by id. A contact is found by its entry id or\n// by any of its aliases (2140)\n// - provenance and via come from the contact's oldest relationship (by\n// its provenance time, then id): how the person came, not how often\n// - tuples belong to the entry their entryId names (2145): an entry's\n// tuples are those whose entryId is its id or one of its aliases, over\n// its own relationships and any relationship that stands behind two\n// entries. Its heads are the active-head tuples among them of live\n// relationships (not chained into another), not deactivated; under\n// 2146 the appended tuple's entry takes the chain's active head\n// - verification is the edge of Encounter 4.2 over all of the entry's\n// tuples, deactivated and older ones included (historical evidence;\n// one edge per relationship, carried along its chain): `outgoing` an\n// own step credential was issued, `incoming` the counterparty's was\n// accepted (5.6), `mutual` both, `met` neither — read from the\n// enactment records of those tuples (encounter/ceremony.ts). An entry\n// with no record at all (built without a ceremony: introduced, or a\n// test state) reads the anchor mappings instead: `outgoing` one was\n// issued (mappingOut), `incoming` one was verified (mappingIn)\n// - displayName: the profile's name (6425), else the self-declared name\n// on the counterparty card of the entry's newest record (Encounter\n// 6120: the app binds its own local name to the anchor)\n// - trust.given is the anchor mapping class on (the Trust act, 2770);\n// trust.received a verified anchor mapping from the contact, whose\n// class has no default recipient (2760); trust.paused the pause of 5.4,\n// star and blinded group star both `off` (2780); trust.pending: given,\n// but not yet out on every head (no mapping issued on it, or its\n// relationship lags (6595)), or a re-issue or class-on duty for the\n// anchor mapping is open at a version this library handles (a duty of\n// an unhandled version is opaque, note §2.1). Delivery of the documents is not part of\n// it; deliveryStatus answers that\n// - classes give the setting and whether the class is on toward the\n// contact (2760, 2840); the sealed group star also per group (2830):\n// every group of the holder and every group the contact holds a\n// per-group setting for, by id, with the setting (`default` where none\n// is held) and whether it is on for (group, contact) — the per-group\n// setting first, else the class (trust/group-star.ts sealedOn)\n// - sharedGroups: the union of the groups the last accepted group star\n// on each of the entry's heads hit (5520, trust/group-star.ts), lagging\n// heads included (the group star travels on them, 6595); undefined\n// where no head ever accepted one\n// - a contact's profile (6425): among the verified profile@1 bodies\n// (6b.2) on its heads whose relationship does not lag (6461, 6595),\n// the highest revision, among equal ones the one verified last\n// (highest verifiedSeq); displayName is that profile's name\n// - deliveryStatus(x) lists the outbox items whose digest or threadId is\n// x, by first submission, then digest; an unknown x lists none\n// - relationships: the entry's own (relIds), in that order; chainedFrom\n// the husks chained into each (chainedInto), by id; carrierNonce the\n// canonical register entry under the relationship's id;\n// counterpartDeliveryHints the deliveryHints of the counterparty card\n// on the record of the relationship's first tuple, whose relId is the\n// relationship's id (the enactment that opened it): a re-encounter's\n// record names the husk it opened, so its card never replaces the\n// first contact's hints. A chained relationship (a husk) is no\n// RelationshipView of its own, only an id in chainedFrom: it shows no\n// carrierNonce, because no adapter instance runs for it (profile\n// RLTP-VTI-1230)\n// - a contact without a relationship breaks an invariant and throws\nimport { freezeDeep } from './util-freeze.js'\nimport type { Json } from './core.js'\nimport { triasOf } from './state.js'\nimport { CLASSES, activeTuple, classOn, findContact, lags, trusted as isTrusted, tupleByLabel } from './trust/state.js'\nimport { sealedOn } from './trust/group-star.js'\nimport { classOfDuty } from './trust/duties.js'\nimport { messageChannel } from './message/holder.js'\nimport { canonicalCarrierNonce } from './identity-state.js'\nimport type {\n EnactmentRecord,\n Contact, Dec, HolderState, Millis, OutboxItem, OutboxStatus, PromptKind, Relationship, Setting, TrustClass, Tuple,\n} from './state.js'\nimport type { DeliveryFailure, PreTransportReason, ReceiverRefusalCode } from './ports.js'\n\n/** One trust class toward one contact: its setting (2810) and whether it is on (2760). */\nexport interface ClassView { setting: Setting, on: boolean }\n\n/** The sealed group star toward one contact: the class, and per group\n * (2830) the per-group setting and whether it is on for (group, contact). */\nexport interface SealedClassView extends ClassView { groups: Record<string, ClassView> }\n\n/** Every class toward one contact (2720), the sealed group star per group too. */\nexport type ClassesView = Record<Exclude<TrustClass, 'sealedGroupStar'>, ClassView> & { sealedGroupStar: SealedClassView }\n\n/** A contact's verified profile (6b.2): string fields only. */\nexport interface ContactProfileView { revision: Dec, name?: string, image?: string, text?: string }\n\n/** One contact, i.e. one entry of the deliverable set (2120, 2140). */\nexport interface ContactView {\n /** the commitSeq of the state this view was read from */\n commitSeq: Dec\n /** the entry id: stable across aliases (2140) and chains (6a.4) */\n id: string\n /** identities merged into this entry (2140) and the fresh contacts its\n * chains took in (6a.4); contact(alias) finds it too */\n aliases: string[]\n /** its relationships (Contact.relIds), each with the number of tuples\n * its chain holds (one per enactment that continued it, 6.4) and the\n * fresh relationships chained into it (6a.4); a relationship that\n * stands behind two entries (2145) is listed under both */\n relationships: RelationshipView[]\n /** the verified profile's name (6425); the ceremony card's name enters\n * the state only when Encounter graduates (PR 7), so without a profile\n * it is undefined */\n displayName?: string\n provenance: 'ceremony' | 'introduced'\n /** the introducer, for an introduced contact */\n via?: string\n verification: 'mutual' | 'outgoing' | 'incoming' | 'met'\n trust: { given: boolean, received: boolean, paused: boolean, pending: boolean }\n classes: ClassesView\n /** groups shared with the contact: the groups of the holder whose\n * digest hit in the contact's last completed group star (5520), over\n * its heads, sorted. A hit is the contact's claim (5.2, no veracity).\n * Undefined while no group star was ever accepted on a head, never a\n * claimed empty list. */\n sharedGroups?: string[]\n profile?: ContactProfileView\n /** a block holds on the contact's relationships (Message Tasks 6.1): an\n * application shows no content and no offer of it, and shows group\n * state and removal notices as without a block (6230) */\n blocked: boolean\n /** a message to the contact goes out now (Message Tasks 5.1): an\n * unblocked relationship whose active head is ready; false, sendMessage\n * answers not-ready, blocked or no-own-channel */\n canMessage: boolean\n}\n\n/** One message in the inbox (Message Tasks 4.5): accepted, not yet taken\n * over by the application (takeMessages). */\nexport interface InboxMessageView {\n commitSeq: Dec\n /** the inbox id, the accepted document's digest; takeMessages names it */\n id: string\n /** the contact of the relationship it arrived on; absent once that\n * relationship departed */\n contactId?: string\n /** the relationship is blocked now (it was not at acceptance): an\n * application shows nothing of it (6230) */\n blocked: boolean\n mid: string\n text: string\n replyTo?: string\n /** the sender's statement, distinct from receivedAt (4430) */\n sentAt: Millis\n /** t_ref of the acceptance (4410) */\n receivedAt: Millis\n /** min(sentAt, receivedAt), fixed at acceptance: the order of 4430 with mid */\n displayAt: Millis\n}\n\n/** One relationship of a contact, as its chain stands. */\nexport interface RelationshipView {\n id: string\n tuples: number\n chainedFrom: string[]\n /** the relationship's canonical carrier-nonce entry (Identity §7a.3):\n * N in base64url and its generation, from which an adapter derives this\n * side's wire identities; absent where none is held. A relationship\n * chained into this one is listed only in chainedFrom and shows none:\n * the chain is carried under this N (profile RLTP-VTI-1230) */\n carrierNonce?: { nonce: string, generation: Dec }\n /** the counterpart's delivery hints from the card of the enactment that\n * opened this relationship (its first contact; Encounter 6080), as\n * signed, uninterpreted; absent where that card carried none. A card of\n * a later enactment chained into the relationship changes nothing */\n counterpartDeliveryHints?: string[]\n}\n\n/** One group the holder is a member of. */\nexport interface GroupView {\n commitSeq: Dec\n /** genesis digest */\n id: string\n /** the group's name, as its genesis names it */\n name: string\n /** listed in the blinded group star (5.2b per-group switch) */\n listed: boolean\n vouchThreshold: Dec\n /** the members this holder knows of, by member anchor (its roster);\n * `self` marks the own one, `contactId` a member it knows as a contact */\n members: Array<{ anchor: string, name?: string, contactId?: string, self: boolean }>\n /** consent pairs held toward an admission (Membership 3.4), by subject */\n pending: Array<{ member: string, name?: string, vouches: number }>\n}\n\n/** The holder's own profile (6450). */\nexport interface ProfileView { commitSeq: Dec, revision: Dec, name?: string, image?: string, text?: string }\n\n/** One open decision of the human. */\nexport interface PromptView {\n commitSeq: Dec\n id: string\n kind: PromptKind\n contactId?: string\n groupId?: string\n openedAt: Millis\n expiresAt?: Millis\n}\n\n/** One issued document's sender status (Delivery §6.1). */\nexport interface DeliveryItemView {\n digest: string\n type: string\n threadId: string\n contactId: string\n /** the trias position */\n status: OutboxStatus\n /** the adapter holds the item before the trias (last step awaiting-transport) */\n awaiting?: PreTransportReason\n /** for delivered: after a failure (the holder's own give-up included) */\n late?: boolean\n /** for failed; task-expired: the sender lifetime its type declares ran out (Delivery 6110) */\n reason?: DeliveryFailure | 'task-expired'\n code?: ReceiverRefusalCode\n attempt: number\n submittedAt: Millis\n updatedAt: Millis\n nextAttemptAt?: Millis\n}\n\nexport interface DeliveryStatusView { commitSeq: Dec, items: DeliveryItemView[] }\n\n// ── helpers ────────────────────────────────────────────────────────────\n\nconst cmp = (a: string, b: string): number => (a < b ? -1 : a > b ? 1 : 0)\nconst cmpDec = (a: Dec, b: Dec): number => { const x = BigInt(a), y = BigInt(b); return x < y ? -1 : x > y ? 1 : 0 }\nconst isObj = (x: unknown): x is Record<string, Json> => x !== null && typeof x === 'object' && !Array.isArray(x)\n\n/** The string fields of a profile body that a view shows. */\nconst profileFields = (body: Json | null): { name?: string, image?: string, text?: string } => {\n const out: { name?: string, image?: string, text?: string } = {}\n if (!isObj(body)) return out\n for (const k of ['name', 'image', 'text'] as const) if (typeof body[k] === 'string') out[k] = body[k] as string\n return out\n}\n\n/** own pair label → its enactment record (encounter.records) */\ntype RecordIndex = Map<string, EnactmentRecord>\n\nconst recordIndex = (state: Readonly<HolderState>): RecordIndex => {\n const ix: RecordIndex = new Map()\n for (const r of Object.values(state.encounter.records)) ix.set(r.label, r)\n return ix\n}\n\n/** entry id → the relationships holding a tuple of that entry (2145) */\ntype EntryIndex = Map<string, Set<string>>\n\nconst entryIndex = (state: Readonly<HolderState>): EntryIndex => {\n const ix: EntryIndex = new Map()\n for (const r of Object.values(state.relationships)) {\n for (const t of r.tuples) {\n let s = ix.get(t.entryId)\n if (!s) ix.set(t.entryId, (s = new Set()))\n s.add(r.id)\n }\n }\n return ix\n}\n\n/** The contact's own relationships, then those holding a tuple of its entry. */\nconst relationshipsOf = (state: Readonly<HolderState>, c: Readonly<Contact>, ids: ReadonlySet<string>, ix: EntryIndex): { own: Relationship[], all: Relationship[] } => {\n const own = c.relIds.filter((id) => Object.hasOwn(state.relationships, id)).map((id) => state.relationships[id])\n if (!own.length) throw new Error(`views: contact ${c.id} has no relationship`)\n const seen = new Set(own.map((r) => r.id))\n const all = [...own]\n for (const id of ids) {\n for (const rid of ix.get(id) ?? []) {\n if (!seen.has(rid)) { seen.add(rid); all.push(state.relationships[rid]) }\n }\n }\n return { own, all }\n}\n\n/** The counterparty card's delivery hints on the record that opened\n * relationship `r`: the record of its first tuple's label (a chaining\n * appends, so the first tuple stays the one the relationship opened with),\n * found in the per-read label index. */\nconst firstHints = (r: Readonly<Relationship>, rix: RecordIndex): string[] | undefined => {\n const first = r.tuples[0]\n const rec = first ? rix.get(first.ownPairLabel) : undefined\n if (!rec || rec.relId !== r.id) return undefined\n const h = (rec.card as { deliveryHints?: unknown } | undefined)?.deliveryHints\n return Array.isArray(h) && h.length ? h.filter((x): x is string => typeof x === 'string') : undefined\n}\n\nconst relationshipView = (state: Readonly<HolderState>, r: Readonly<Relationship>, rix: RecordIndex): RelationshipView => {\n const n = canonicalCarrierNonce(state.register, r.id)\n const hints = firstHints(r, rix)\n return {\n id: r.id, tuples: r.tuples.length,\n chainedFrom: Object.values(state.relationships).filter((x) => x.chainedInto === r.id).map((x) => x.id).sort(cmp),\n ...(n ? { carrierNonce: { nonce: n.nonce, generation: n.generation } } : {}),\n ...(hints ? { counterpartDeliveryHints: hints } : {}),\n }\n}\n\nconst project = (state: Readonly<HolderState>, c: Readonly<Contact>, ix: EntryIndex, rix: RecordIndex): ContactView => {\n const ids = new Set([c.id, ...c.aliases])\n const { own, all: rels } = relationshipsOf(state, c, ids, ix)\n const mine = (t: Tuple): boolean => ids.has(t.entryId)\n const tuples = rels.flatMap((r) => r.tuples.filter(mine))\n const origin = [...own].sort((a, b) => (a.provenance.at - b.provenance.at) || cmp(a.id, b.id))[0]\n const records = tuples.map((t) => rix.get(t.ownPairLabel)).filter((r): r is EnactmentRecord => r !== undefined)\n const out = records.length ? records.some((r) => r.out !== null) : tuples.some((t) => t.mappingOut.body !== null)\n const inn = records.length ? records.some((r) => r.in !== null) : tuples.some((t) => t.mappingIn.body !== null)\n const newest = [...records].sort((a, b) => b.at - a.at)[0]\n const introduced = own.map((r) => r.memory.introducedName).find((n): n is string => typeof n === 'string')\n const cardName = typeof (newest?.card as { name?: unknown } | undefined)?.name === 'string' ? (newest.card as { name: string }).name : introduced\n const trusted = isTrusted(c)\n const classes = {} as Record<TrustClass, ClassView>\n for (const cls of CLASSES) classes[cls] = { setting: c.settings[cls], on: classOn(cls, c.settings[cls], trusted) }\n const groups: Record<string, ClassView> = {}\n for (const g of [...new Set([...Object.keys(state.groups), ...Object.keys(c.groupSettings)])].sort(cmp)) {\n groups[g] = { setting: Object.hasOwn(c.groupSettings, g) ? c.groupSettings[g] : 'default', on: sealedOn(c, g) }\n }\n const heads: Array<{ r: Relationship, t: Tuple, lagging: boolean }> = []\n for (const r of rels) {\n if (r.chainedInto !== null) continue\n const t = activeTuple(r)\n if (t && !t.deactivated && mine(t)) heads.push({ r, t, lagging: lags(r, rels) })\n }\n // a class-on or re-issue of the anchor mapping, at a version this library\n // handles (classOfDuty: an unhandled version is opaque and owes nothing here)\n const owed = Object.values(state.duties).some((d) =>\n classOfDuty(d) === 'anchorMapping' && (d as { contactId?: unknown }).contactId === c.id)\n const pending = trusted && (owed || heads.some((h) => h.t.mappingOut.body === null || h.lagging))\n let best: Tuple | undefined\n for (const { t, lagging } of heads) {\n if (lagging || t.profileIn.body === null) continue\n if (!best || cmpDec(t.profileIn.rev, best.profileIn.rev) > 0 ||\n (cmpDec(t.profileIn.rev, best.profileIn.rev) === 0 && cmpDec(t.profileIn.verifiedSeq, best.profileIn.verifiedSeq) > 0)) best = t\n }\n const profile = best ? { revision: best.profileIn.rev, ...profileFields(best.profileIn.body) } : undefined\n const received = heads.map((h) => h.t.groupStarIn.accepted).filter((a) => a !== null)\n const sharedGroups = received.length ? [...new Set(received.flatMap((a) => a.groups))].sort(cmp) : undefined\n return {\n commitSeq: state.commitSeq,\n id: c.id,\n aliases: [...c.aliases],\n relationships: own.map((r) => relationshipView(state, r, rix)),\n ...(profile?.name !== undefined ? { displayName: profile.name } : cardName !== undefined ? { displayName: cardName } : {}),\n provenance: origin.provenance.kind,\n ...(origin.provenance.kind === 'introduced' && origin.provenance.via !== undefined ? { via: origin.provenance.via } : {}),\n verification: out && inn ? 'mutual' : out ? 'outgoing' : inn ? 'incoming' : 'met',\n trust: {\n given: trusted,\n received: tuples.some((t) => t.mappingIn.body !== null),\n paused: c.settings.star === 'off' && c.settings.groupStar === 'off',\n pending,\n },\n classes: { ...classes, sealedGroupStar: { ...classes.sealedGroupStar, groups } } as ClassesView,\n ...(sharedGroups ? { sharedGroups } : {}),\n ...(profile ? { profile } : {}),\n blocked: own.some((r) => state.messages.blocked.includes(r.id)),\n canMessage: !('ok' in messageChannel(state, c.id)),\n }\n}\n\nconst itemView = (digest: string, it: Readonly<OutboxItem>): DeliveryItemView => {\n const status = triasOf(it)\n const last = it.history[it.history.length - 1]\n let decisive: OutboxItem['history'][number] | undefined\n for (let i = it.history.length - 1; i >= 0 && !decisive; i--) if (it.history[i].status !== 'awaiting-transport') decisive = it.history[i]\n const v: DeliveryItemView = {\n digest, type: it.type, threadId: it.threadId, contactId: it.recipient.contactId, status,\n attempt: it.attempt, submittedAt: it.history[0]?.at ?? 0, updatedAt: last?.at ?? 0,\n }\n if (last?.status === 'awaiting-transport') v.awaiting = last.reason\n if (decisive?.status === 'delivered') v.late = decisive.late\n if (decisive?.status === 'failed') {\n v.reason = decisive.reason\n if (decisive.reason === 'rejected-by-receiver') v.code = decisive.code\n }\n if (it.nextAttemptAt !== undefined) v.nextAttemptAt = it.nextAttemptAt\n return v\n}\n\n// ── the views ──────────────────────────────────────────────────────────\n\n/** Every contact, in entry-commit order (2120), then by id. */\nexport function contactsView (state: Readonly<HolderState>): ContactView[] {\n const order = Object.values(state.contacts).sort((a, b) => {\n if (a.pos !== null && b.pos !== null) return cmpDec(a.pos, b.pos) || cmp(a.id, b.id)\n if (a.pos !== null) return -1\n if (b.pos !== null) return 1\n return cmp(a.id, b.id)\n })\n const ix = entryIndex(state)\n const rix = recordIndex(state)\n return freezeDeep(order.map((c) => project(state, c, ix, rix)))\n}\n\n/** One contact by entry id or alias; undefined if there is none. */\nexport function contactView (state: Readonly<HolderState>, id: string): ContactView | undefined {\n const c = findContact(state, id)\n return c ? freezeDeep(project(state, c, entryIndex(state), recordIndex(state))) : undefined\n}\n\n/** The holder's groups, by genesis digest. */\nexport function groupsView (state: Readonly<HolderState>): GroupView[] {\n return freezeDeep(Object.values(state.groups).sort((a, b) => cmp(a.id, b.id)).map((g) => ({\n commitSeq: state.commitSeq, id: g.id, name: g.name, listed: g.listed, vouchThreshold: g.rules.vouchThreshold,\n members: Object.values(g.roster).sort((a, b) => cmp(a.anchor, b.anchor)).map((m) => ({\n anchor: m.anchor, ...(m.name !== undefined ? { name: m.name } : {}), ...(m.contactId !== undefined ? { contactId: m.contactId } : {}), self: m.anchor === g.memberAnchor,\n })),\n pending: Object.values(g.evidence).map((e) => {\n const acc = (e.accept as { payload?: { accept?: { subject?: string, card?: { name?: string } } } }).payload?.accept\n return { member: acc?.subject ?? '', ...(typeof acc?.card?.name === 'string' ? { name: acc.card.name } : {}), vouches: e.vouches.length }\n }).sort((a, b) => cmp(a.member, b.member)),\n })))\n}\n\n/** The holder's own profile. */\nexport function profileView (state: Readonly<HolderState>): ProfileView {\n return freezeDeep({ commitSeq: state.commitSeq, revision: state.profile.revision, ...profileFields(state.profile.body) })\n}\n\n/** The open prompts, by opening time, then id. Expired prompts stay\n * listed until tick removes them; deciding one is refused. */\nexport function promptsView (state: Readonly<HolderState>): PromptView[] {\n return freezeDeep(Object.values(state.prompts).sort((a, b) => (a.openedAt - b.openedAt) || cmp(a.id, b.id)).map((p) => ({\n commitSeq: state.commitSeq, id: p.id, kind: p.kind,\n ...(p.contactId !== undefined ? { contactId: p.contactId } : {}),\n ...(p.groupId !== undefined ? { groupId: p.groupId } : {}),\n openedAt: p.openedAt,\n ...(p.expiresAt !== undefined ? { expiresAt: p.expiresAt } : {}),\n })))\n}\n\n/** The sender status of the documents whose digest or threadId is `x`. */\nexport function deliveryStatusView (state: Readonly<HolderState>, x: string): DeliveryStatusView {\n const items = Object.entries(state.outbox)\n .filter(([digest, it]) => digest === x || it.threadId === x)\n .map(([digest, it]) => itemView(digest, it))\n .sort((a, b) => (a.submittedAt - b.submittedAt) || cmp(a.digest, b.digest))\n return freezeDeep({ commitSeq: state.commitSeq, items })\n}\n\n/** The inbox (Message Tasks 4.5), ordered by display time, then mid (4430). */\nexport function inboxView (state: Readonly<HolderState>): InboxMessageView[] {\n const out = Object.values(state.messages.inbox).map((e) => {\n const t = tupleByLabel(state, e.tuple)\n const c = t ? (findContact(state, t.tuple.entryId) ?? findContact(state, t.rel.contactId)) : undefined\n const b = e.body as { text: string, replyTo?: string, sentAt: string }\n return {\n commitSeq: state.commitSeq, id: e.id, ...(c ? { contactId: c.id } : {}),\n blocked: t !== null && state.messages.blocked.includes(t.rel.id),\n mid: e.mid, text: b.text, ...(b.replyTo !== undefined ? { replyTo: b.replyTo } : {}),\n sentAt: Date.parse(b.sentAt), receivedAt: e.receivedAt, displayAt: e.displayAt,\n }\n }).sort((a, b) => (a.displayAt - b.displayAt) || cmp(a.mid, b.mid) || cmp(a.id, b.id))\n return freezeDeep(out)\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@real-life/trust-protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "The Real Life Trust Protocol (RLTP) \u2014 the executable form of the specification: encounters, introductions, trust disclosure, groups, continuity, and the delivery channel. Zero dependencies, WebCrypto only.",
|
|
5
5
|
"license": "CC-BY-4.0",
|
|
6
6
|
"type": "module",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"build": "tsc -p tsconfig.json",
|
|
87
|
-
"test": "node --test test/vectors.test.mjs test/vectors2.test.mjs test/vectors3.test.mjs test/vectors4.test.mjs test/carrier.test.mjs test/loopback.test.mjs test/adapter-vti-mediator.test.mjs test/anchor.test.mjs test/codec.test.mjs test/codec-fixture.test.mjs test/holder-state-schema.test.mjs test/entropy.test.mjs test/entropy-lint.test.mjs test/store.test.mjs test/keys-seed.test.mjs test/engine.test.mjs test/views.test.mjs test/prompts.test.mjs test/receive.test.mjs test/duties.test.mjs test/retention.test.mjs test/crypto-lazy.test.mjs test/trust-mapping.test.mjs test/trust-admission.test.mjs test/trust-classes.test.mjs test/trust-star.test.mjs test/trust-group-star.test.mjs test/trust-continuity.test.mjs test/trust-entries.test.mjs test/trust-ported.test.mjs test/trust-duties.test.mjs test/invariants.test.mjs test/invariants-generator.test.mjs test/invariants-coverage.test.mjs test/identity.test.mjs test/profile.test.mjs test/sha256.test.mjs test/encounter-holder.test.mjs test/encounter-ported.test.mjs test/membership-holder.test.mjs test/introduction-holder.test.mjs test/block-holder.test.mjs test/message-vectors.test.mjs test/message-holder.test.mjs test/message-interleavings.test.mjs test/transport-custody.test.mjs test/transport-interleavings.test.mjs test/act-replay.test.mjs",
|
|
87
|
+
"test": "node --test test/vectors.test.mjs test/vectors2.test.mjs test/vectors3.test.mjs test/vectors4.test.mjs test/carrier.test.mjs test/loopback.test.mjs test/adapter-vti-mediator.test.mjs test/anchor.test.mjs test/codec.test.mjs test/codec-fixture.test.mjs test/holder-state-schema.test.mjs test/entropy.test.mjs test/entropy-lint.test.mjs test/store.test.mjs test/keys-seed.test.mjs test/engine.test.mjs test/views.test.mjs test/prompts.test.mjs test/receive.test.mjs test/duties.test.mjs test/retention.test.mjs test/crypto-lazy.test.mjs test/trust-mapping.test.mjs test/trust-admission.test.mjs test/trust-classes.test.mjs test/trust-star.test.mjs test/trust-group-star.test.mjs test/trust-continuity.test.mjs test/trust-entries.test.mjs test/trust-ported.test.mjs test/trust-duties.test.mjs test/invariants.test.mjs test/invariants-generator.test.mjs test/invariants-coverage.test.mjs test/identity.test.mjs test/profile.test.mjs test/sha256.test.mjs test/encounter-holder.test.mjs test/encounter-ported.test.mjs test/delivery-hints.test.mjs test/membership-holder.test.mjs test/introduction-holder.test.mjs test/block-holder.test.mjs test/message-vectors.test.mjs test/message-holder.test.mjs test/message-interleavings.test.mjs test/transport-custody.test.mjs test/transport-interleavings.test.mjs test/act-replay.test.mjs",
|
|
88
88
|
"prepack": "npm run build && npm test"
|
|
89
89
|
},
|
|
90
90
|
"keywords": [
|