origin

package
v1.44.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package origin contains transport-supplied identity and pure routing helpers. It never discovers sessions, interfaces, applications or parent chats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Text

func Text(s string, limit int, required bool) bool

Types

type Context

type Context struct {
	Provider        string
	Namespace       string
	SessionID       string
	AnonymousCaller string
	CallID          string
	Provenance      Provenance
	Locality        Locality
	Interface       Interface
	Hidden          bool
}

Context is built by the transport, never decoded from model Payload. Namespace is a stable source namespace, not an application/configuration ID. AnonymousCaller is an explicit transport namespace, permitted only for none.

func (Context) Scope

func (o Context) Scope() (source, session string)

Scope separates anonymous caller namespaces from real session identities. The hash avoids expanding a 256-byte ID beyond the journal's key limit.

func (Context) Validate

func (o Context) Validate(n notification.Navigation) error

type Interface

type Interface string
const (
	Desktop          Interface = "desktop"
	Headless         Interface = "headless"
	InterfaceUnknown Interface = "unknown"
)

type Locality

type Locality string
const (
	Local           Locality = "local"
	Remote          Locality = "remote"
	LocalityUnknown Locality = "unknown"
)

type Provenance

type Provenance string
const (
	ClientMetadata Provenance = "client_metadata"
	CallerAsserted Provenance = "caller_asserted"
)

type RoutePolicy

type RoutePolicy struct {
	LocalRouting        bool
	AllowUnknownCaller  bool
	AllowCallerAsserted bool
	ApplicationPath     string
	TeamID              string
}

type Target

type Target struct {
	Desktop    notification.DesktopTarget
	Navigation notification.NavigationResult
}

func ResolveCodex

func ResolveCodex(o Context, p RoutePolicy) Target

ResolveCodex preserves unknown interface/provenance and routes only under explicit operator policy. It does not claim profile or store compatibility.

Jump to

Keyboard shortcuts

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