# garden.engram.agents.presence

> Which run of the agent is active, on which device, until when. A runtime acts as the agent only while its run holds an unexpired lease. The one record in a workspace that is updated in place; nothing cites it.

- Kind: record
- Record key: literal:self
- Authority: agents.engram.garden
- Lexicon: 1
- Published by [hailey.at](https://lexicon.garden/identity/did:plc:oisofpd7lj26yvgiivf3lxsi), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:oisofpd7lj26yvgiivf3lxsi/garden.engram.agents.presence)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:oisofpd7lj26yvgiivf3lxsi/garden.engram.agents.presence/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:oisofpd7lj26yvgiivf3lxsi/garden.engram.agents.presence/analytics)

## Record (`garden.engram.agents.presence`)

Type: record · key literal:self

### Properties

- `device` (string, required)
  - Constraints: maxLength: 256
- `handoffFrom` (ref): The run this one is taking over from. The new run acts once that run writes a garden.engram.agents.handoff record for it, or that run's lease ends.
  - Reference: `#runRef`
- `leaseUntil` (string · datetime, required)
- `run` (string · tid, required)
- `updatedAt` (string · datetime, required)

## #runRef (`garden.engram.agents.presence#runRef`)

Type: object

### Properties

- `device` (string, required)
  - Constraints: maxLength: 256
- `leaseUntil` (string · datetime, required)
- `run` (string · tid, required)

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Which run of the agent is active, on which device, until when. A runtime acts as the agent only while its run holds an unexpired lease. The one record in a workspace that is updated in place; nothing cites it.",
      "key": "literal:self",
      "record": {
        "properties": {
          "device": {
            "maxLength": 256,
            "type": "string"
          },
          "handoffFrom": {
            "description": "The run this one is taking over from. The new run acts once that run writes a garden.engram.agents.handoff record for it, or that run's lease ends.",
            "ref": "#runRef",
            "type": "ref"
          },
          "leaseUntil": {
            "format": "datetime",
            "type": "string"
          },
          "run": {
            "format": "tid",
            "type": "string"
          },
          "updatedAt": {
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "run",
          "device",
          "leaseUntil",
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "runRef": {
      "properties": {
        "device": {
          "maxLength": 256,
          "type": "string"
        },
        "leaseUntil": {
          "format": "datetime",
          "type": "string"
        },
        "run": {
          "format": "tid",
          "type": "string"
        }
      },
      "required": [
        "run",
        "device",
        "leaseUntil"
      ],
      "type": "object"
    }
  },
  "id": "garden.engram.agents.presence",
  "lexicon": 1
}
```
