Reference
register / deregister
Establish and remove agent sessions in the Field.
register()
Registers an agent with the Field, establishing a session with a declared role. Registration unlocks role-based relevance scoring in attune() and reckon().
Signature
field.register(input: RegisterInput): Promise<RegisterResult>
type RegisterInput = {
id: string
role: string
capabilities?: string[]
}
type RegisterResult = {
field_capabilities: string[]
field_protocol_version: string // always "0.2" in this release
session_id?: string
}
Parameters
| Parameter | Required | Description |
|---|---|---|
id | ✓ | Unique agent identifier. Must be non-empty and non-whitespace. |
role | ✓ | The agent's declared role (e.g. 'researcher', 'strategist'). Used for relevance scoring. |
capabilities | Advisory list of what the agent can do. The Field records it but does not enforce it in v0.2. |
Behavior
- Re-registering an existing
idreplaces the previous session. - Registration is not required to call
write()orread(), but it enables role-based scoring and the ability to setagenton writes in a way the Field recognises. field_capabilitiesin the response lists operations the Field supports. In v0.2 this is the full operation set.
Errors
| Code | When |
|---|---|
AGENT_REQUIRED | id or role is missing, empty, whitespace-only, or not a string |
INVALID_ENTRY | capabilities is provided but is not an array of strings |
Example
const result = await field.register({
id: 'researcher',
role: 'researcher',
capabilities: ['web-search', 'document-analysis'],
})
console.log(result.field_protocol_version) // '0.2'
console.log(result.field_capabilities)
// ['register', 'deregister', 'write', 'read', 'attune', 'reckon',
// 'draft', 'commit', 'discard', 'retract', 'supersede']
deregister()
Removes an agent's session from the Field.
Signature
field.deregister(input: { id: string }): Promise<void>
Behavior
- Idempotent — deregistering an unknown
idsucceeds silently. - The agent's previously written entries remain in the Field after deregistration. They are not deleted or modified.
- After deregistration,
attune()andreckon()calls from thatagentid will no longer benefit from registered role matching.
Example
await field.deregister({ id: 'researcher' })
// No error if 'researcher' was already removed