# fyi.opensocial.template

> Published by [lexicons.opensocial.fyi](https://lexicon.garden/identity/did:plc:2gqnilpksz2e7faj3bwvo6qc)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.template)
- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.template/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.template/examples)

## Definitions

### `fyi.opensocial.template#asGroup`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `collection` | `string` (nsid) | Yes |  |
| `in` | `string` (nsid) | Yes | The type of space it goes in. |

### `fyi.opensocial.template#entry`

**Type**: `object`

A tab, as the template suggests it, without the template itself.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `appviews` | `array` | No | The app servers it reads for the viewer, by the start of their methods' names. Bluesky's, for app.bsky, needs no naming. |
| `asGroup` | `array` | No | What it writes as the group rather than as the viewer, and the kind of space each goes in. Who may is up to each space's access record. |
| `calls` | `array` | No | The methods it may call for the viewer: the host's, and an app server's, like Bluesky's. |
| `for` | `string` (nsid) | No | The kind of thing a tab of it is about, if it is about one: a collection of records in the group's spaces, or a type of space; or, with pick.link, records anywhere on the network. Such a tab's `about` is one of them. |
| `labels` | `array` | No | Its words for what it lets people do, by record kind or method, to follow 'Lets people': 'post events'. |
| `members` | `boolean` | No | Shown to members only. |
| `network` | `array` | No | Collections it reads from everyone on the network who writes them, not only the group and its members: the host keeps each one whole from when the site is saved, and won't save one more accounts write than it can keep. |
| `pick` | `ref` → `#pick` | No | With for, how choosing which one is put, and what a tab about none of them shows. Without none, a tab of it must be about one. |
| `reads` | `array` | No | The collections it may read from the group, its members and its spaces. |
| `slug` | `string` | Yes |  |
| `summary` | `string` | No | One short line on what a tab of it shows, for choosing it. |
| `title` | `string` | No |  |
| `writes` | `array` | No | The collections it may write for the viewer, in their account or one of the group's spaces. |

### `fyi.opensocial.template#label`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `action` | `string` | No | For that write alone. |
| `nsid` | `string` (nsid) | Yes | A record kind it writes, or a method it calls. |
| `text` | `string` | Yes |  |

### `fyi.opensocial.template`

**Type**: `record`

A template for a tab for a group's site, published by whoever made it. A site names it by URI; an agent installs it as a skill. Keyed by the template's name.

**Key**: `any`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes |  |
| `description` | `string` | Yes | One line saying what it is and when to use it; what an agent matches a request against. |
| `entry` | `ref` → `#entry` | No | How a site uses it unless told otherwise; what it reads, writes and calls are what it needs to be allowed for it to work. |
| `guide` | `string` | Yes | How to use it, in markdown: what it shows, what it reads and who can see that, how to make it a group's own. |
| `html` | `string` | Yes | The page: a whole HTML document, drawn in a sandboxed frame with the site kit in front of it. |
| `name` | `string` | Yes | What a site and an agent call it: lowercase letters, digits and dashes. The same as the record key. |
| `preview` | `string` | No | A small drawing of a tab of it, as SVG, for choosing it: drawn in the site's colours by the tokens var(--bg), var(--ink), var(--muted), var(--line), var(--accent), var(--surface) and var(--soft). Shown as an image, so nothing in it runs. |

### `fyi.opensocial.template#pick`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `label` | `string` | Yes |  |
| `link` | `string` | No | Picked by pasting a link to one, anywhere on the network, rather than from the group's own: a Bluesky feed's. The field's hint. |
| `new` | `ref` → `#pickNew` | No | Making a new place of its own instead, from Add a tab: a space of this type, readable by everyone or some roles. |
| `none` | `string` | No |  |

### `fyi.opensocial.template#pickNew`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `in` | `string` (nsid) | Yes | The type of space to make. |
| `label` | `string` | Yes |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "asGroup": {
      "properties": {
        "collection": {
          "format": "nsid",
          "type": "string"
        },
        "in": {
          "description": "The type of space it goes in.",
          "format": "nsid",
          "type": "string"
        }
      },
      "required": [
        "collection",
        "in"
      ],
      "type": "object"
    },
    "entry": {
      "description": "A tab, as the template suggests it, without the template itself.",
      "properties": {
        "appviews": {
          "description": "The app servers it reads for the viewer, by the start of their methods' names. Bluesky's, for app.bsky, needs no naming.",
          "items": {
            "ref": "fyi.opensocial.site#appview",
            "type": "ref"
          },
          "maxLength": 10,
          "type": "array"
        },
        "asGroup": {
          "description": "What it writes as the group rather than as the viewer, and the kind of space each goes in. Who may is up to each space's access record.",
          "items": {
            "ref": "#asGroup",
            "type": "ref"
          },
          "type": "array"
        },
        "calls": {
          "description": "The methods it may call for the viewer: the host's, and an app server's, like Bluesky's.",
          "items": {
            "format": "nsid",
            "type": "string"
          },
          "maxLength": 50,
          "type": "array"
        },
        "for": {
          "description": "The kind of thing a tab of it is about, if it is about one: a collection of records in the group's spaces, or a type of space; or, with pick.link, records anywhere on the network. Such a tab's `about` is one of them.",
          "format": "nsid",
          "type": "string"
        },
        "labels": {
          "description": "Its words for what it lets people do, by record kind or method, to follow 'Lets people': 'post events'.",
          "items": {
            "ref": "#label",
            "type": "ref"
          },
          "type": "array"
        },
        "members": {
          "description": "Shown to members only.",
          "type": "boolean"
        },
        "network": {
          "description": "Collections it reads from everyone on the network who writes them, not only the group and its members: the host keeps each one whole from when the site is saved, and won't save one more accounts write than it can keep.",
          "items": {
            "format": "nsid",
            "type": "string"
          },
          "maxLength": 20,
          "type": "array"
        },
        "pick": {
          "description": "With for, how choosing which one is put, and what a tab about none of them shows. Without none, a tab of it must be about one.",
          "ref": "#pick",
          "type": "ref"
        },
        "reads": {
          "description": "The collections it may read from the group, its members and its spaces.",
          "items": {
            "format": "nsid",
            "type": "string"
          },
          "maxLength": 50,
          "type": "array"
        },
        "slug": {
          "maxLength": 64,
          "type": "string"
        },
        "summary": {
          "description": "One short line on what a tab of it shows, for choosing it.",
          "maxGraphemes": 100,
          "maxLength": 1000,
          "type": "string"
        },
        "title": {
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        },
        "writes": {
          "description": "The collections it may write for the viewer, in their account or one of the group's spaces.",
          "items": {
            "format": "nsid",
            "type": "string"
          },
          "maxLength": 50,
          "type": "array"
        }
      },
      "required": [
        "slug"
      ],
      "type": "object"
    },
    "label": {
      "properties": {
        "action": {
          "description": "For that write alone.",
          "knownValues": [
            "create",
            "update",
            "delete"
          ],
          "type": "string"
        },
        "nsid": {
          "description": "A record kind it writes, or a method it calls.",
          "format": "nsid",
          "type": "string"
        },
        "text": {
          "maxGraphemes": 80,
          "maxLength": 300,
          "type": "string"
        }
      },
      "required": [
        "nsid",
        "text"
      ],
      "type": "object"
    },
    "main": {
      "description": "A template for a tab for a group's site, published by whoever made it. A site names it by URI; an agent installs it as a skill. Keyed by the template's name.",
      "key": "any",
      "record": {
        "properties": {
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "description": {
            "description": "One line saying what it is and when to use it; what an agent matches a request against.",
            "maxGraphemes": 300,
            "maxLength": 3000,
            "type": "string"
          },
          "entry": {
            "description": "How a site uses it unless told otherwise; what it reads, writes and calls are what it needs to be allowed for it to work.",
            "ref": "#entry",
            "type": "ref"
          },
          "guide": {
            "description": "How to use it, in markdown: what it shows, what it reads and who can see that, how to make it a group's own.",
            "maxLength": 50000,
            "type": "string"
          },
          "html": {
            "description": "The page: a whole HTML document, drawn in a sandboxed frame with the site kit in front of it.",
            "maxLength": 200000,
            "type": "string"
          },
          "name": {
            "description": "What a site and an agent call it: lowercase letters, digits and dashes. The same as the record key.",
            "maxLength": 64,
            "type": "string"
          },
          "preview": {
            "description": "A small drawing of a tab of it, as SVG, for choosing it: drawn in the site's colours by the tokens var(--bg), var(--ink), var(--muted), var(--line), var(--accent), var(--surface) and var(--soft). Shown as an image, so nothing in it runs.",
            "maxLength": 20000,
            "type": "string"
          }
        },
        "required": [
          "name",
          "description",
          "guide",
          "html",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "pick": {
      "properties": {
        "label": {
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        },
        "link": {
          "description": "Picked by pasting a link to one, anywhere on the network, rather than from the group's own: a Bluesky feed's. The field's hint.",
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        },
        "new": {
          "description": "Making a new place of its own instead, from Add a tab: a space of this type, readable by everyone or some roles.",
          "ref": "#pickNew",
          "type": "ref"
        },
        "none": {
          "maxGraphemes": 64,
          "maxLength": 640,
          "type": "string"
        }
      },
      "required": [
        "label"
      ],
      "type": "object"
    },
    "pickNew": {
      "properties": {
        "in": {
          "description": "The type of space to make.",
          "format": "nsid",
          "type": "string"
        },
        "label": {
          "maxGraphemes": 60,
          "maxLength": 300,
          "type": "string"
        }
      },
      "required": [
        "label",
        "in"
      ],
      "type": "object"
    }
  },
  "id": "fyi.opensocial.template",
  "lexicon": 1
}
```
