external atom AgentDirectoryObject id "atom:org.quixos.agent:directory"; external atom AgentObject id "atom:org.quixos.agent:agent"; external atom AgentThreadObject id "atom:org.quixos.agent:thread"; external atom AgentRequestObject id "atom:org.quixos.agent:request"; external atom AgentItemObject id "atom:org.quixos.agent:item"; external atom AgentQuestionObject id "atom:org.quixos.agent:question"; external atom AgentCompletionStreamObject id "atom:org.quixos.agent:completion-stream"; import interface AgentContextSubject; type AgentSubmission = record {text:string;data:optional;profile:optional;response:optional;sourceKind:string;sourceLabel:string;publication:optional;createdAt:string;contexts:list>;related:optional>;retryOf:optional>;root:optional>;causalDepth:uint32;}; type ThreadData = record {title:string;kind:string;archived:bool;sequence:uint64;pending:uint32;nextItem:uint64;updatedAt:string;}; interface AgentThread id "interface:org.quixos.agent:thread" revision "interface:org.quixos.agent:thread@1" { queryable value data id "agent:thread:data" : ThreadData {get id "agent:thread:data:get" execution snapshot;} queryable relation agent id "agent:thread:agent" : exactly-one atom AgentObject {resolve id "agent:thread:agent:resolve" execution snapshot;} queryable relation directory id "agent:thread:directory" : exactly-one atom AgentDirectoryObject {resolve id "agent:thread:directory:resolve" execution snapshot;} queryable relation active id "agent:thread:active" : optional-one atom AgentRequestObject {resolve id "agent:thread:active:resolve" execution snapshot;} queryable relation requests id "agent:thread:requests" : many-unique atom AgentRequestObject {resolve id "agent:thread:requests:resolve" execution snapshot;} queryable relation items id "agent:thread:items" : many-unique atom AgentItemObject {resolve id "agent:thread:items:resolve" execution snapshot;} queryable relation contexts id "agent:thread:contexts" : many-unique interface AgentContextSubject {resolve id "agent:thread:contexts:resolve" execution snapshot;} operation send id "agent:thread:send" : AgentSubmission -> atom-ref {call id "agent:thread:send:call" execution transaction;} operation rename id "agent:thread:rename" : string -> unit {call id "agent:thread:rename:call" execution transaction;} operation archive id "agent:thread:archive" : bool -> unit {call id "agent:thread:archive:call" execution transaction;} operation activate id "agent:thread:activate" : atom-ref -> bool {call id "agent:thread:activate:call" execution transaction;} operation release id "agent:thread:release" : atom-ref -> unit {call id "agent:thread:release:call" execution transaction;} operation adjustPending id "agent:thread:adjust-pending" : record {delta:int32;updatedAt:string;} -> uint64 {call id "agent:thread:adjust-pending:call" execution transaction;} operation allocateItem id "agent:thread:allocate-item" : string -> uint64 {call id "agent:thread:allocate-item:call" execution transaction;} }