protocol

package
v0.0.0-...-5ed4770 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package protocol provides exported constants for the Sequify WebSocket protocol. These constants are the only externally importable part of the protocol SDK.

Index

Constants

View Source
const (
	MessageTypeRequest  = "Request"
	MessageTypeResponse = "Response"
	MessageTypeUpdates  = "Updates"
)

MessageType constants define the three envelope types.

View Source
const (
	MethodCreateConversation  = "create_conversation"
	MethodSwitchConversation  = "switch_conversation"
	MethodDestroyConversation = "destroy_conversation"
	MethodIntent              = "intent"
	MethodCancel              = "cancel"
	MethodEditMessage         = "edit_message"
	MethodResult              = "result"
	MethodGetMaxSeq           = "get_max_seq"
	MethodFetchUpdates        = "fetch_updates"
	MethodReadReceipt         = "read_receipt"
	MethodListConversations   = "list_conversations"
)

Method constants — client -> server (11 methods).

View Source
const (
	MethodToolCall            = "tool_call"
	MethodRequestCapabilities = "request_capabilities"
	MethodCallCapability      = "call_capability"
)

Method constants — server -> client (3 methods).

View Source
const (
	UpdateKindToolCall              = "tool_call"
	UpdateKindResult                = "result"
	UpdateKindReply                 = "reply"
	UpdateKindError                 = "error"
	UpdateKindReadReceipt           = "read_receipt"
	UpdateKindConversationCreated   = "conversation_created"
	UpdateKindConversationDestroyed = "conversation_destroyed"
	UpdateKindConversationSwitched  = "conversation_switched"
)

UpdateKind constants — persistent (seq > 0, 8 kinds).

View Source
const (
	UpdateKindTyping    = "typing"
	UpdateKindRetry     = "retry"
	UpdateKindStreaming = "streaming" // incremental reply content chunks {delta, done}
)

UpdateKind constants — non-persistent (seq = 0, 3 kinds).

View Source
const (
	CodeAuthFailed              = 4001 // Reserved for developer SDK — Sequify Server does not perform auth
	CodeCredentialExpired       = 4002 // Reserved for developer SDK — Sequify Server does not perform auth
	CodeConnLimit               = 4003
	CodeBadMessage              = 4004
	CodeCapabilityNotRegistered = 4005 // capability not registered
	CodeVersionIncompat         = 4006
)

ErrorCode constants — connection-level (4xxx).

View Source
const (
	CodeConvNotFound       = 5001
	CodeMsgNotFound        = 5002
	CodeIntentFailed       = 5003
	CodeToolTimeout        = 5004
	CodeConvDestroyed      = 5005
	CodeConcurrentConflict = 5006
	CodeCapabilityNotFound = 5007 // capability not found
)

ErrorCode constants — command-level (5xxx).

View Source
const (
	CodeInternal       = 6001
	CodeLLMUnavailable = 6002
	CodeQueueFull      = 6003
	CodeDB             = 6004
	CodeRedis          = 6005
)

ErrorCode constants — service-level (6xxx).

View Source
const ProtocolVersion = 1

ProtocolVersion is the current protocol version.

Variables

This section is empty.

Functions

func IsValidMethod

func IsValidMethod(method string) bool

IsValidMethod reports whether the given method string is a known protocol method.

func IsValidUpdateKind

func IsValidUpdateKind(kind string) bool

IsValidUpdateKind reports whether the given kind string is a known update kind.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL