Feature modules
The nine packages that make up Seed Exact, what each is responsible for, where its code lives, and how they depend on each other.

Seed Exact is split into nine packages. Seven have screens and a contract file. Two, identity and crypto, are libraries the others import. Every package keeps its TypeScript in src/<name> and exports its sources through the data module; its state, resources and actions live in its blocks of the root contract.

Packages

Package

Responsibility

Contract file

Source directory

Depends on

read

Load and render documents, the site home, the directory sheet, author pages, and open a site by URL

read.contract

src/read

none in TypeScript; its contract embeds discuss's DiscussSection

discuss

List comments under a document, show a thread, compose and publish signed comments

discuss.contract

src/discuss

read (client, ids, markdown), crypto, identity

activity

The notification inbox and email notification settings, through signed requests to the notify service

activity.contract

src/activity

crypto, identity, read (ids)

profile

Edit and publish an identity's name and summary on its home document

profile.contract

src/profile

crypto, identity, read (client)

me

List, create, import, rename, export and remove identities; choose the server

me.contract

src/me

identity

identity

Store keys in the Keychain secret seed-keys and hand out signers

none

src/identity

crypto

crypto

Key derivation, Ed25519 signing, DAG-CBOR blobs (changes, refs, comments, profiles), signed envelopes, the vault codec

none (a self-test resource in the root)

src/crypto

none

vault

The device role of the remote vault: connect ceremony, encrypted local file, sync and merge

vault.contract

src/vault

crypto, identity; its contract uses me's shapes

agents

Chat with Seed agents: lists, sessions, live transcript and run cards over signed CBOR and WebSockets

agents.contract

src/agents

crypto (codec, primitives), identity

The "depends on" column was read from the import lines of each src directory and the use lines of each contract.

Dependency diagram

flowchart TD read["read"] discuss["discuss"] activity["activity"] profile["profile"] me["me"] vault["vault"] agents["agents"] identity["identity"] crypto["crypto"] discuss --> read activity --> read profile --> read discuss --> identity activity --> identity profile --> identity me --> identity vault --> identity agents --> identity discuss --> crypto activity --> crypto profile --> crypto vault --> crypto agents --> crypto identity --> crypto read -. "contract embeds DiscussSection" .-> discuss vault -. "contract uses Me shapes" .-> me

How the packages relate

    Reading is the base. Read owns the Seed API client (api, apiUrl), the id and link helpers, and the block to Markdown conversion. Discuss reuses all three so a comment body renders exactly like a document paragraph. Profile reuses the client, activity the id helpers.

    Signing goes through identity. Any package that writes (a comment, a profile, a notify action, an agent command) calls signerFor(store, account) from identity, which reads the key and returns a signer built on crypto. No package other than identity and vault touches stored key material.

    Crypto is byte-exact. It reproduces the original client's encodings so that blobs and envelopes verify on existing servers. Agents sign with crypto's vendored CBOR encoder for the same reason.

    Vault and me share the key list. Vault writes restored identities into the same store me lists, and the root contract refreshes meIds after vault changes.

    The root wires them. Packages do not import each other's sources. Cross-package behaviour, such as a saved profile refreshing read's authors and docs, is declared in the root contract with refreshes.

Each package talks to one or two of the services. Conventions shared by all of them are in Package conventions and ownership blocks, and tests in Testing.

In this section

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Comments