{"modulePath":"github.com/pencode-labs/pencode","version":"v0.1.0-rc.15","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package extensionhost\n\nPackage extensionhost owns extension discovery, registration and files. It deliberately has no dependency on the GUI or the client package.\n\n## Constants\n\n```go\nconst (\n\tStartupTimeout   = 5 * time.Second\n\tMaxExtensions    = 64\n\tMaxResourceBytes = 64 \u003c\u003c 20\n\tMaxFileBytes     = 32 \u003c\u003c 20\n\tMaxPackageBytes  = 256 \u003c\u003c 20\n\tMaxPackageFiles  = 4096\n)\n```\n\n## Functions\n\n```go\nfunc Directory() (string, error)\n```\n\n```go\nfunc JavaScriptRuntime() (string, error)\n```\nJavaScriptRuntime resolves tools in the workspace server's environment.\n\n```go\nfunc Open(root *os.Root, directory string, manifest Manifest, stderr io.Writer) (io.ReadWriteCloser, error)\n```\n\n```go\nfunc OpenPackage(directory string) (*os.Root, error)\n```\nOpenPackage holds a package directory open while allowing it to be renamed. On Windows, opening it relative to the parent shares delete access.\n\n```go\nfunc ReadResource(root *os.Root, name string, limit int64) ([]byte, error)\n```\n\n```go\nfunc ValidID(id string) bool\n```\n\n```go\nfunc ValidResourcePath(name string, resource bool) bool\n```\n\n## Types\n\n```go\ntype Installed = protocol.ExtensionInfo\n```\n\n```go\nfunc Inspect(directory, id string) (Installed, error)\n```\n\n```go\nfunc List(directory string) ([]Installed, error)\n```\nList reads metadata without executing extensions, including disabled and broken installations so that users can inspect and remove them.\n\n```go\nfunc SetDisabled(ctx context.Context, directory, id string, disabled bool) (Installed, error)\n```\n\n```go\ntype Manifest = protocol.ExtensionManifest\n```\nThe shared manifest and metadata are also the wire-domain types.\n\n```go\ntype Registration struct {\n\tInfo          Installed\n\tDiagnostics   string\n\tContributions peb.Contributions\n}\n```\n\n```go\nfunc Register(ctx context.Context, directory, id string, enable bool) (Registration, error)\n```\nRegister probes a package on the server. Appearance resources are interpreted by the GUI before an installation or enable transaction can be committed.\n\n```go\ntype Upload struct {\n\tDirectory string\n\t// contains filtered or unexported fields\n}\n```\nUpload retains one open file and accepts ordered chunks. The containing connection serializes its use and owns cleanup, including abandoned uploads.\n\n```go\nfunc Begin(directory, replace string) (*Upload, error)\n```\n\n```go\nfunc (u *Upload) Close()\n```\n\n```go\nfunc (u *Upload) Prepare(ctx context.Context) (Registration, error)\n```\n\n```go\nfunc (u *Upload) Publish(directory, id string, beforeReplace func()) (string, error)\n```\nPublish calls beforeReplace after validation, just before moving the old package.\n\n```go\nfunc (u *Upload) Write(name string, offset uint64, mode uint32, final bool, data []byte) error\n```\n\n","path":"github.com/pencode-labs/pencode/server/extensionhost","name":"extensionhost","synopsis":"Package extensionhost owns extension discovery, registration and files.","isRedistributable":true}
