{"modulePath":"github.com/pencode-labs/pencode","version":"v0.1.0-rc.15","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package extensions\n\nPackage extensions bridges server-owned extensions to GUI appearance and views.\n\n## Constants\n\n```go\nconst DefaultMarketplaceURL = \"https://pencode-labs.github.io/extensions/extensions.json\"\n```\n\n```go\nconst MarketplaceOutputChannelName = \"Extension Marketplace\"\n```\n\n```go\nconst (\n\tStartupTimeout = 5 * time.Second\n)\n```\n\n## Functions\n\n```go\nfunc Install(ctx context.Context, backend *client.Client, source string) (Installed, *Bundle, error)\n```\nInstall uploads a selected local package to the server. Only this explicit file-transfer source is opened locally; installed packages always live there.\n\n```go\nfunc SetEnabled(ctx context.Context, backend *client.Client, id string, enabled bool) (Installed, *Bundle, error)\n```\nEnabling is prepared on the server and committed only after GUI resource validation. Failed activation preserves the installed disabled manifest.\n\n## Types\n\n```go\ntype ActionExtension struct {\n\tOutput *output.Channel\n\n\tID      string\n\tActions []peb.Action\n\t// contains filtered or unexported fields\n}\n```\nActionExtension retains a validated process entry for its live button session.\n\n```go\nfunc (extension *ActionExtension) Start(values peb.SettingValues, wake func()) *ActionSession\n```\n\n```go\ntype ActionResult struct {\n\tErr       error\n\tUI        *peb.UI\n\tAssets    map[string][]byte\n\tIcons     map[string][]byte\n\tLifecycle *peb.LifecycleReply\n\tChange    peb.ActionChange\n\tToken     uint64\n\t// Fatal marks a disconnected process; its actions must be removed.\n\tFatal bool\n}\n```\n\n```go\ntype ActionSession struct {\n\tResults \u003c-chan ActionResult\n\tDone    \u003c-chan struct{}\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *ActionSession) Close()\n```\n\n```go\nfunc (s *ActionSession) Editor(a peb.Action) Editor\n```\nEditor binds a live Open With action to a view in the window's extension process.\n\n```go\nfunc (s *ActionSession) NotifyFiles(changes peb.FileChanges)\n```\n\n```go\nfunc (s *ActionSession) Submit(c peb.ActionContext) bool\n```\n\n```go\nfunc (s *ActionSession) SubmitLifecycle(event peb.LifecycleEvent, token uint64) bool\n```\nSubmitLifecycle serializes host lifecycle events with action and UI requests.\n\n```go\nfunc (s *ActionSession) SubmitSettings(values peb.SettingValues) bool\n```\n\n```go\nfunc (s *ActionSession) SubmitUI(event peb.UIEvent) bool\n```\n\n```go\ntype Bundle struct {\n\tID, Label       string\n\tLanguagePacks   []localization.Pack\n\tSettings        []peb.Setting\n\tActions         *ActionExtension\n\tThemes          []Theme\n\tIconThemes      []peb.IconTheme\n\tIcons           map[string][]byte\n\tEditors         []Editor\n\tFonts           []Font\n\tLanguageServers []LanguageServer\n\tDebugAdapters   []peb.DebugAdapter\n}\n```\nBundle owns all imported assets. No extension directory remains open after registration, and rendering performs no disk reads for extension icons.\n\n```go\nfunc Load(ctx context.Context, backend *client.Client, id string) (*Bundle, error)\n```\n\n```go\nfunc (b *Bundle) Close()\n```\nClose releases an unconsumed registration. Once imported into a workbench, its font registry owns these faces instead.\n\n```go\ntype Editor struct {\n\tOutput *output.Channel\n\n\tLocalID string\n\tpeb.Action\n\t// contains filtered or unexported fields\n}\n```\nEditor retains its validated process entry for on-demand activation.\n\n```go\nfunc (editor *Editor) Start(root string, values peb.SettingValues, wake func()) *EditorSession\n```\n\n```go\ntype EditorResult struct {\n\tReply   peb.EditorReply\n\tErr     error\n\tAssets  map[string][]byte\n\tMessage peb.EditorMessage\n}\n```\n\n```go\ntype EditorSession struct {\n\tResults \u003c-chan EditorResult\n\tDone    \u003c-chan struct{}\n\t// contains filtered or unexported fields\n}\n```\nEditorSession owns one view in the window's shared extension process. All pipe I/O happens on its worker; the UI submits at most one outstanding request and never blocks.\n\n```go\nfunc (s *EditorSession) Close()\n```\nClose releases this view asynchronously; the window's extension process stays alive.\n\n```go\nfunc (s *EditorSession) NotifyFiles(changes peb.FileChanges)\n```\n\n```go\nfunc (s *EditorSession) Submit(message peb.EditorMessage) bool\n```\n\n```go\nfunc (s *EditorSession) SubmitSettings(values peb.SettingValues) bool\n```\n\n```go\ntype Font struct {\n\tRegular, Bold *font.Face\n\tID, Label     string\n}\n```\nFont holds parsed, memory-backed faces validated on the loader worker.\n\n```go\ntype Host struct {\n\tResults \u003c-chan Result\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc Start(backend *client.Client, wake func(), logs *output.Store) *Host\n```\nStart discovers packages on the server. GUI workers import only immutable resources; no process creation or installed-directory I/O happens here.\n\n```go\nfunc (h *Host) Close()\n```\n\n```go\ntype Installed = protocol.ExtensionInfo\n```\n\n```go\ntype LanguageServer struct {\n\tOutput *output.Channel\n\n\tLocalID string\n\tpeb.LanguageServer\n\t// contains filtered or unexported fields\n}\n```\nLanguageServer describes a workspace-hosted stdio server. Built-ins open a normal workspace process. Extension launchers use their registration handle.\n\n```go\nfunc (s *LanguageServer) DocumentLanguage(name string) string\n```\n\n```go\nfunc (s *LanguageServer) Match(name string) bool\n```\n\n```go\nfunc (s *LanguageServer) Start(ctx context.Context, backend *client.Client, root string, values peb.SettingValues, handler lsp.Handler) (*lsp.Client, error)\n```\n\n```go\ntype Listing struct {\n\tName                          string `json:\"name\"`\n\tRepository                    string `json:\"repository\"`\n\tDescription                   string `json:\"description\"`\n\tVersion, URL, Digest, Problem string\n}\n```\n\n```go\nfunc (l *Listing) NewerThan(version string) bool\n```\n\n```go\ntype Manifest = protocol.ExtensionManifest\n```\nMetadata uses the same domain types on both sides of the connection.\n\n```go\ntype Marketplace struct {\n\tClient         *http.Client\n\tSource, GitHub string\n}\n```\nMarketplace's zero value uses the official catalog and public GitHub release pages.\n\n```go\nfunc (m Marketplace) Install(ctx context.Context, backend *client.Client, l Listing, update bool) (Installed, *Bundle, error)\n```\nInstall downloads and extracts a release into disposable local staging, then validates and publishes it through the workspace server's transaction.\n\n```go\nfunc (m Marketplace) List(ctx context.Context, goos, arch string) ([]Listing, error)\n```\nList checks release metadata only; packages are downloaded by an explicit Install.\n\n```go\ntype Result struct {\n\tErr    error\n\tBundle *Bundle\n\tID     string\n}\n```\n\n```go\ntype Theme struct {\n\tTheme     *syntax.Theme\n\tID, Label string\n}\n```\n\n","path":"github.com/pencode-labs/pencode/extensions","name":"extensions","synopsis":"Package extensions bridges server-owned extensions to GUI appearance and views.","isRedistributable":true}
