>>
HM Writes: TS SDK, CLI, Agent Skills

    Problem

      Attempting to solve several problems at once here.

      Agents Must be able to Write Documents

        For various reasons, we will need our AI agents to be able to natively contribute to the SHM ecosystem of content. We have created some experimental skills, but they are generally unable to write content.

      CLI for Document Writing

        We currently have a CLI built with TypeScript that consumes the public REST API of any Seed Web server. This is ideal because the daemon does not need to be running locally. The CLI already has some basic key management features, but it does not have the ability to sign and publish any data.

        So the CLI currently cannot be used for publishing documents and comments

      TS SDK for Document Writing

        We will use this SDK inside the CLI and (soon) inside the web frontend, so we can write documents from web.

        TS developers currently have no way to programmatically interface with SHM servers.

    Solution

      TS Library for SHM

        We will develop a standalone NPM package that can be imported by TS/JS devs. This will eventually be our fully-featured client for interacting with HM.

        This will involve re-organizing some of our existing code. Also we will need to develop a TypeScript implementation for creating Refs, Changes, Contacts, and Profiles. (Comments are already fully supported).

        The library will enforce our existing schemas for HM block types, and will be responsible for writing valid HM data.

        This is important for the next step of this project (the CLI), but also will internally unblock the development of document creation in the web frontend.

      CLI Upgrades

        We already have a CLI, but we need to expand it to support signing+publishing comments, documents, contacts, capabilities, profiles.

        The unmerged CLI branch also includes improved test infrastructure.

        We should do more thorough testing to make sure the CLI has elegant UX. For example it should support all our new URL formats like /:discussions . It should automatically resolve embedded content and queries, and it should support markdown

      New CreateBlobs HTTPS Endpoint

        The web API must support the ability to create arbitrary blobs. Currently it supports comments and profiles only.

        For now, the nodeJS server will pass these blobs directly into the daemon. The daemon will validate and index the blobs. Any unreferenced blobs will eventually be garbage collected (once that gets implemented one day).

        The blobs should also be validated against a schema on the server side. For now, we will keep things pretty simple.

      Agent Skills

        We will develop a new repo at gh/seed-hypermedia/skills which contains the markdown that agents will read for interacting with Seed and the CLI.

        Ideally the source of truth for this content will live in Seed. So it will be consumable by our general audience. We will run a cron job which periodically updates the skills repo with the latest markdown export of those Seed docs.

    Scope

      This requires no changes to daemon code. There are a lot of frontend changes, but it should be possible in about a week of focused work.