extensionset

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package extensionset holds the in-process half of the extension set DefaultResourceLoader loads: the inline and built-in extension factories (resource-loader.ts loadExtensionFactories, loadExtensionPaths' `builtin:` branch) and omitReplacedExtensions. The CLI's extension set and coding.DefaultResourceLoader both call it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuiltinNames

func BuiltinNames(extensions []extension.InlineExtension) []string

BuiltinNames are the names of the entries of extensions that supply `builtin:<name>` code, in order. Ports .upstream/v1.1.0/packages/coding-agent/src/core/resource-loader.ts:378-383 (the builtinExtensions Map keys).

func HasInline

func HasInline(extensions []extension.InlineExtension) bool

HasInline reports whether extensions holds an inline extension that is not built-in, which loadExtensionFactories loads.

func OmitReplaced

func OmitReplaced(extensions []extension.Extension, warnings *[]icodingagent.ExtensionWarning) []extension.Extension

OmitReplaced leaves out the replaceable extensions that share a tool, command or flag name with another extension. A replaced built-in extension adds a warning to warnings. Ports .upstream/v0.99.1/packages/coding-agent/src/core/resource-loader.ts:114-157 (omitReplacedExtensions).

Types

type LoadError

type LoadError struct{ Path, Error string }

LoadError is a {path, error} entry of types.ts LoadExtensionsResult.errors.

type Loader

type Loader struct {
	CWD string
	// Inline are the extensionFactories: built-in and inline extensions.
	Inline []extension.InlineExtension
	// Runtime is the runtime the factories register against. Nil: the loader creates one, which factoryRuntime returns.
	Runtime *extension.ExtensionRuntime
	// EventBus is the bus the factories share. Nil: the loader creates one.
	EventBus extension.EventBus
}

Loader runs the extension factories of one cwd.

func (*Loader) LoadBuiltin

func (l *Loader) LoadBuiltin(paths []string) ([]extension.Extension, []LoadError)

LoadBuiltin runs the factory of each `builtin:<name>` path. An unknown name is a load error. A built-in extension's source info is the synthetic one of its path, scope "temporary", whichever settings scope enabled it: applyExtensionSourceInfo resolves a synthetic path with getDefaultSourceInfoForPath (resource-loader.ts:906-975). Ports .upstream/v0.99.1/packages/coding-agent/src/core/resource-loader.ts:706-735 (loadExtensionPaths).

func (*Loader) LoadInline

func (l *Loader) LoadInline() ([]extension.Extension, []LoadError)

LoadInline runs the factories of the extensions that are not built-in, naming each `<inline:name>`. Ports .upstream/v0.99.1/packages/coding-agent/src/core/resource-loader.ts:1122-1145 (loadExtensionFactories).

Jump to

Keyboard shortcuts

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