# me.wilb.kasta.code

> Published by [wilb.me](https://lexicon.garden/identity/did:plc:oxdlsmnvpk2riyyuvq5jtdkd)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:oxdlsmnvpk2riyyuvq5jtdkd/me.wilb.kasta.code)
- [Documentation](https://lexicon.garden/lexicon/did:plc:oxdlsmnvpk2riyyuvq5jtdkd/me.wilb.kasta.code/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:oxdlsmnvpk2riyyuvq5jtdkd/me.wilb.kasta.code/examples)

## Definitions

### `me.wilb.kasta.code#file`

**Type**: `object`

A single source file within a kast.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `path` | `string` | Yes | File path relative to the kast root (e.g. 'main.ts', 'lib/utils.ts'). |
| `content` | `string` | Yes | Full source code of the file. |

### `me.wilb.kasta.code`

**Type**: `record`

An immutable snapshot of a kast's source code. Each write creates a new version; the pointer record controls which version is active.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `lang` | `string` | Yes | Programming language of the kast. |
| `name` | `string` | Yes | The kast name. Must match the rkey of the corresponding me.wilb.pointer record. |
| `files` | `array` | Yes | Source files that make up this kast. For single-file kasts this array has one element. |
| `createdAt` | `string` (datetime) | Yes |  |
| `entrypoint` | `string` | Yes | Path of the entry file within the files array (e.g. 'main.ts'). |

## Raw Schema

```json
{
  "id": "me.wilb.kasta.code",
  "defs": {
    "file": {
      "type": "object",
      "required": [
        "path",
        "content"
      ],
      "properties": {
        "path": {
          "type": "string",
          "maxLength": 512,
          "description": "File path relative to the kast root (e.g. 'main.ts', 'lib/utils.ts')."
        },
        "content": {
          "type": "string",
          "description": "Full source code of the file.",
          "maxGraphemes": 100000
        }
      },
      "description": "A single source file within a kast."
    },
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "name",
          "files",
          "entrypoint",
          "lang",
          "createdAt"
        ],
        "properties": {
          "lang": {
            "type": "string",
            "maxLength": 64,
            "description": "Programming language of the kast.",
            "knownValues": [
              "typescript"
            ]
          },
          "name": {
            "type": "string",
            "maxLength": 128,
            "description": "The kast name. Must match the rkey of the corresponding me.wilb.pointer record."
          },
          "files": {
            "type": "array",
            "items": {
              "ref": "#file",
              "type": "ref"
            },
            "minLength": 1,
            "description": "Source files that make up this kast. For single-file kasts this array has one element."
          },
          "createdAt": {
            "type": "string",
            "format": "datetime",
            "maxLength": 64
          },
          "entrypoint": {
            "type": "string",
            "maxLength": 512,
            "description": "Path of the entry file within the files array (e.g. 'main.ts')."
          }
        }
      },
      "description": "An immutable snapshot of a kast's source code. Each write creates a new version; the pointer record controls which version is active."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
