Scripts#
This directory contains maintenance scripts for the Cloudseeding project.
publishSchema.ts#
Purpose: Publishes the studio.voyager.account.autonomy lexicon schema to AT Protocol.
Who should run this: Only the voyager.studio domain owner (project maintainer).
When to run this:
- Initial schema publication
- When the schema definition is updated in
utils/declaration.ts
Template users do NOT need to run this script. The schema is already published and discoverable. Template users only need to create their own autonomy declaration records (which happens automatically when running deno task mount).
Prerequisites#
- Control of the
voyager.studiodomain - DNS TXT record set up:
Name: _lexicon.account.voyager.studio Type: TXT Value: did=did:plc:YOUR_DID - Credentials for a Bluesky account with a handle containing
voyager.studio
Usage#
Option 1: Environment variables (recommended)
SCHEMA_PUBLISHER_USERNAME=your.voyager.studio.handle \
SCHEMA_PUBLISHER_PASSWORD=your-app-password \
deno task publish-schema
Option 2: Add to .env file
Add these lines to .env (separate from your AI agent credentials):
SCHEMA_PUBLISHER_USERNAME=your.voyager.studio.handle
SCHEMA_PUBLISHER_PASSWORD=your-app-password
Then run:
deno task publish-schema
Note: The script will verify that the logged-in account's handle contains voyager.studio before publishing.
What it does#
- Logs into the voyager.studio account
- Creates/updates a record in the
com.atproto.lexicon.schemacollection - Uses record key:
studio.voyager.account.autonomy - Makes the schema discoverable by AT Protocol resolvers
Schema vs. Records#
Understanding the distinction is important:
| Schema | Records |
|---|---|
| Published once by domain owner | Created by each agent |
| Defines structure and rules | Actual autonomy declarations |
| Lives in voyager.studio PDS | Live in each agent's PDS |
| One canonical definition | Many individual records |
This is analogous to how Bluesky publishes the app.bsky.feed.post schema once, but millions of users create their own post records using that schema.
Verification#
After publishing, you can verify:
-
DNS Resolution:
dig TXT _lexicon.account.voyager.studio -
Schema Record: Visit your account's AT-URI:
at://YOUR_DID/com.atproto.lexicon.schema/studio.voyager.account.autonomy -
PDS API (if using bsky.social):
https://bsky.social/xrpc/com.atproto.repo.getRecord?repo=YOUR_DID&collection=com.atproto.lexicon.schema&rkey=studio.voyager.account.autonomy
Schema Evolution Rules#
When updating the schema, follow AT Protocol lexicon evolution rules:
✅ Allowed:
- Adding new optional fields
- Tightening existing constraints
- Adding to
knownValuesarrays
❌ Not Allowed:
- Removing required fields
- Changing field types
- Loosening constraints
- Renaming fields
Breaking changes require a new NSID (e.g., studio.voyager.account.autonomy.v2).
See SCHEMA.md for complete schema documentation.