compiledin

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package compiledin is the registry of the compiled-in extensions an extension names by reference (createCodemodeExtension, createToolSearchExtension): Pi's factories return functions, which cannot cross the process boundary, so the SDKs send the name and the options and the host builds its own factory of that name (coding/session_graph_extension_factories.go).

A built-in registers its factory from the package that implements it (coding/extension/builtin), not from the session code that looks it up: a program that imports the coding library without the built-ins links neither the sandbox's wasm runtime nor the tool-search index, and a reference to a built-in it does not link fails as in a build that strips it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasOptions

func HasOptions(options json.RawMessage) bool

HasOptions reports whether the extension passed options.

func OptionsError

func OptionsError(name string, err error) error

OptionsError is the failure of the extension name to read its options.

func Register

func Register(name string, factory Factory)

Register records the factory of the compiled-in extension name, replacing an earlier one of that name.

Types

type Factory

type Factory func(options json.RawMessage) (extension.InlineExtension, error)

Factory builds one compiled-in extension from the JSON options the extension passed (empty or null when it passed none). It decodes them into a struct of its own.

func Lookup

func Lookup(name string) (Factory, bool)

Lookup returns the factory of the compiled-in extension name.

Jump to

Keyboard shortcuts

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