Lexicons for Gemstone

init: readme and initial lexicons set

serenity 17c0550e

Changed files
+328
lexicons
systems
src
systems
+4
.editorconfig
···
+
root = true
+
+
[*]
+
indent_size = 2
+10
README.md
···
+
# Gemstone Systems Lexicons
+
+
This repository lists the lexicons in use by [Gemstone Systems](https://gmstn.systems/).
+
+
Heavy WIP at the moment. Currently, it is a convenient place to store our lexicons for development purposes.
+
+
In the future, we will do the following:
+
+
1. When the [`typelex`](https://tangled.org/@danabra.mov/typelex) project stabilises, we will use `typelex` to generate the lexicons for us in a nicer API. We currently use the playground manually.
+
2. When our [`anaxagoras`](https://tangled.org/@gmstn.systems/anaxagoras) project stabilises, we will also use `typelex` to generate a Zod schema, after which this repository will transition into a public npm package which will allow us access to our lexicons as types and schemas in our downstream projects.
+48
lexicons/systems/gmstn/development/channel.json
···
+
{
+
"lexicon": 1,
+
"id": "systems.gmstn.development.channel",
+
"defs": {
+
"main": {
+
"type": "record",
+
"key": "tid",
+
"record": {
+
"type": "object",
+
"properties": {
+
"name": {
+
"type": "string",
+
"maxLength": 1000,
+
"minLength": 1,
+
"maxGraphemes": 100,
+
"minGraphemes": 1,
+
"description": "The name of the channel."
+
},
+
"storeAt": {
+
"type": "ref",
+
"ref": "com.atproto.repo.strongRef",
+
"description": "The location to store the messages in this channel. Must resolve to a Shard or compatible message store."
+
},
+
"routeThrough": {
+
"type": "ref",
+
"ref": "com.atproto.repo.strongRef",
+
"description": "The service to route the messages in this channel through. Must resolve to a Lattice or compatible sync service."
+
},
+
"topic": {
+
"type": "string",
+
"maxLength": 2000,
+
"minLength": 1,
+
"maxGraphemes": 200,
+
"minGraphemes": 1,
+
"description": "(optional) The topic of the channel, similar to a sub-description."
+
},
+
"createdAt": {
+
"type": "string",
+
"format": "datetime",
+
"description": "The timestamp when this channel was created."
+
}
+
},
+
"required": ["name", "storeAt", "routeThrough", "createdAt"]
+
},
+
"description": "Record declaring a conversation channel."
+
}
+
}
+
}
+32
lexicons/systems/gmstn/development/channel/invite.json
···
+
{
+
"lexicon": 1,
+
"id": "systems.gmstn.development.channel.invite",
+
"defs": {
+
"main": {
+
"type": "record",
+
"key": "tid",
+
"record": {
+
"type": "object",
+
"properties": {
+
"recipient": {
+
"type": "string",
+
"format": "did",
+
"description": "The recipient of the invite."
+
},
+
"channel": {
+
"type": "ref",
+
"ref": "com.atproto.repo.strongRef",
+
"description": "The channel that this invite is for. Must resolve to a systems.gmstn.development.channel record."
+
},
+
"createdAt": {
+
"type": "string",
+
"format": "datetime",
+
"description": "The timestamp when this invite was created."
+
}
+
},
+
"required": ["recipient", "channel", "createdAt"]
+
},
+
"description": "Record declaring a channel invite."
+
}
+
}
+
}
+42
lexicons/systems/gmstn/development/channel/membership.json
···
+
{
+
"lexicon": 1,
+
"id": "systems.gmstn.development.channel.membership",
+
"defs": {
+
"main": {
+
"type": "record",
+
"key": "tid",
+
"record": {
+
"type": "object",
+
"properties": {
+
"channel": {
+
"type": "ref",
+
"ref": "com.atproto.repo.strongRef",
+
"description": "The channel that the membership is describing. Must resolve to a systems.gmstn.development.channel record on the channel owner's repository."
+
},
+
"invite": {
+
"type": "ref",
+
"ref": "com.atproto.repo.strongRef",
+
"description": "The original invite record for the channel. Must resolve to a systems.gmstn.development.channel.invite record on the channel owner's repository."
+
},
+
"state": {
+
"type": "string",
+
"enum": ["accepted", "rejected", "left"],
+
"description": "The current membership state"
+
},
+
"createdAt": {
+
"type": "string",
+
"format": "datetime",
+
"description": "The timestamp when this membership was created."
+
},
+
"updatedAt": {
+
"type": "string",
+
"format": "datetime",
+
"description": "The timestamp when this membership was last updated."
+
}
+
},
+
"required": ["channel", "invite", "state", "createdAt", "updatedAt"]
+
},
+
"description": "Record declaring the state of a user's channel membership."
+
}
+
}
+
}
+28
lexicons/systems/gmstn/development/lattice.json
···
+
{
+
"lexicon": 1,
+
"id": "systems.gmstn.development.lattice",
+
"defs": {
+
"main": {
+
"type": "record",
+
"key": "any",
+
"record": {
+
"type": "object",
+
"properties": {
+
"createdAt": {
+
"type": "string",
+
"format": "datetime",
+
"description": "Timestamp when this Lattice was registered"
+
},
+
"description": {
+
"type": "string",
+
"maxLength": 2000,
+
"maxGraphemes": 200,
+
"description": "(optional) Human-readable description of this Lattice. Does nothing for now."
+
}
+
},
+
"required": ["createdAt"]
+
},
+
"description": "Record defining a Lattice, a real-time sync engine. The record-key should be the domain where the Shard is accessible."
+
}
+
}
+
}
+28
lexicons/systems/gmstn/development/shard.json
···
+
{
+
"lexicon": 1,
+
"id": "systems.gmstn.development.shard",
+
"defs": {
+
"main": {
+
"type": "record",
+
"key": "any",
+
"record": {
+
"type": "object",
+
"properties": {
+
"createdAt": {
+
"type": "string",
+
"format": "datetime",
+
"description": "Timestamp when this Shard was registered"
+
},
+
"description": {
+
"type": "string",
+
"maxLength": 2000,
+
"maxGraphemes": 200,
+
"description": "(optional) Human-readable description of this Shard. Does nothing for now."
+
}
+
},
+
"required": ["createdAt"]
+
},
+
"description": "Record defining a Shard, a message store. The record-key should be the domain where the Shard is accessible."
+
}
+
}
+
}
+42
src/systems/gmstn/development/channel.tsp
···
+
import "@typelex/emitter";
+
+
namespace systems.gmstn.development.channel {
+
@rec("tid")
+
/** Record declaring a conversation channel. */
+
model Main {
+
/** The name of the channel. */
+
@minGraphemes(1)
+
@maxGraphemes(100)
+
@minLength(1)
+
@maxLength(1000)
+
@required
+
name: string;
+
+
/** The location to store the messages in this channel. Must resolve to a Shard or compatible message store. */
+
@required
+
storeAt: com.atproto.repo.strongRef.Main;
+
+
/** The service to route the messages in this channel through. Must resolve to a Lattice or compatible sync service. */
+
@required
+
routeThrough: com.atproto.repo.strongRef.Main;
+
+
/** (optional) The topic of the channel, similar to a sub-description. */
+
@minGraphemes(1)
+
@maxGraphemes(200)
+
@minLength(1)
+
@maxLength(2000)
+
topic?: string;
+
+
/** The timestamp when this channel was created. */
+
@required
+
createdAt: datetime;
+
}
+
}
+
+
// --- Externals ---
+
+
@external
+
namespace com.atproto.repo.strongRef {
+
model Main {}
+
}
+
+26
src/systems/gmstn/development/channel/invite.tsp
···
+
import "@typelex/emitter";
+
+
namespace systems.gmstn.development.channel.invite {
+
@rec("tid")
+
/** Record declaring a channel invite. */
+
model Main {
+
/** The recipient of the invite. */
+
@required
+
recipient: did;
+
+
/** The channel that this invite is for. Must resolve to a systems.gmstn.development.channel record. */
+
@required
+
channel: com.atproto.repo.strongRef.Main;
+
+
/** The timestamp when this invite was created. */
+
@required
+
createdAt: datetime;
+
}
+
}
+
+
// --- Externals ---
+
+
@external
+
namespace com.atproto.repo.strongRef {
+
model Main {}
+
}
+38
src/systems/gmstn/development/channel/membership.tsp
···
+
import "@typelex/emitter";
+
+
namespace systems.gmstn.development.channel.membership {
+
@rec("tid")
+
/** Record declaring the state of a user's channel membership. */
+
model Main {
+
/** The channel that the membership is describing. Must resolve to a systems.gmstn.development.channel record on the channel owner's repository. */
+
@required
+
channel: com.atproto.repo.strongRef.Main;
+
+
/** The original invite record for the channel. Must resolve to a systems.gmstn.development.channel.invite record on the channel owner's repository. */
+
@required
+
invite: com.atproto.repo.strongRef.Main;
+
+
/** The current membership state */
+
@required
+
state: InvitationState;
+
+
/** The timestamp when this membership was created. */
+
@required
+
createdAt: datetime;
+
+
/** The timestamp when this membership was last updated. */
+
@required
+
updatedAt: datetime;
+
}
+
+
@closed
+
@inline
+
union InvitationState { "accepted", "rejected", "left" };
+
}
+
+
// --- Externals ---
+
+
@external
+
namespace com.atproto.repo.strongRef {
+
model Main {}
+
}
+15
src/systems/gmstn/development/lattice.tsp
···
+
import "@typelex/emitter";
+
+
namespace systems.gmstn.development.lattice {
+
@rec("any")
+
/** Record defining a Lattice, a real-time sync engine. The record-key should be the domain where the Shard is accessible. */
+
model Main {
+
/** Timestamp when this Lattice was registered */
+
@required createdAt: datetime;
+
+
/** (optional) Human-readable description of this Lattice. Does nothing for now. */
+
@maxGraphemes(200)
+
@maxLength(2000)
+
description?: string;
+
}
+
}
+15
src/systems/gmstn/development/shard.tsp
···
+
import "@typelex/emitter";
+
+
namespace systems.gmstn.development.shard {
+
@rec("any")
+
/** Record defining a Shard, a message store. The record-key should be the domain where the Shard is accessible. */
+
model Main {
+
/** Timestamp when this Shard was registered */
+
@required createdAt: datetime;
+
+
/** (optional) Human-readable description of this Shard. Does nothing for now. */
+
@maxGraphemes(200)
+
@maxLength(2000)
+
description?: string;
+
}
+
}