binding

package
v0.8.1-alpha.10 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package binding maps canonical capabilities to stable presentation names.

Index

Constants

View Source
const MaxDirectNameLength = 64

MaxDirectNameLength is the provider-facing tool-name limit.

Variables

This section is empty.

Functions

func AppAlias added in v0.8.1

func AppAlias(slug string) string

AppAlias maps valid app slugs bijectively into safe JS property names. Slugs contain no underscores; an underscore prefix escapes digits and JS internals.

func External

func External(kind Kind, canonicalNamespace, namespaceAlias string, operations []string) (map[string]Path, error)

External creates collision-safe paths for arbitrary external operation names.

Types

type Kind

type Kind byte

Kind identifies a capability namespace.

const (
	Air Kind = iota + 1
	Tool
	Connection
	Topic
	MCP
	Host
	AppTool
	AppFile
	AppDatabase
	ResourceTool
	ResourceConnection
)

type Path

type Path struct {
	// contains filtered or unexported fields
}

Path carries canonical transport identity and presentation aliases.

func Local

func Local(kind Kind, namespace, operation string) Path

Local creates a path whose canonical and presentation names are identical.

func Qualified added in v0.8.1

func Qualified(kind Kind, target, alias, operation string) Path

Qualified keeps a host-resolved target identity separate from its JS alias. Only host-facing namespaces accept this constructor; app-local capabilities retain their manifest identities when delivered to an app runtime.

func (Path) CanonicalNamespace

func (p Path) CanonicalNamespace() string

CanonicalNamespace returns the namespace used by transport dispatch.

func (Path) CanonicalOperation

func (p Path) CanonicalOperation() string

CanonicalOperation returns the operation used by transport dispatch.

func (Path) Direct

func (p Path) Direct() string

Direct returns the provider-facing direct tool name.

func (Path) ID added in v0.7.0

func (p Path) ID() string

ID is independent of JS aliases and provider-facing name limits.

func (Path) JS

func (p Path) JS() string

JS returns the dotted run_js presentation path.

func (Path) JSParts

func (p Path) JSParts() []string

JSParts returns the object-property path used by run_js.

func (Path) Kind added in v0.7.0

func (p Path) Kind() Kind

Kind returns the canonical capability namespace kind.

Jump to

Keyboard shortcuts

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