Files
skillshare/internal/plugin/omp_extensions_lock_linux.go
Willie 97446744ff feat(omp): add native Oh My Pi support (#423)
* feat(omp): add native Oh My Pi support

Support OMP skills, instructions, MCP, code hooks and guarded extension selection using its verified native contracts rather than Pi aliases.

Add reviewed marketplace plugin installation, cache-preserving scoped removal and fresh-cache reinstall. Align Pi/OMP extension cards and localize inventory guidance while keeping native ownership and read-only constraints.

Include regression coverage, isolated E2E runbooks, documentation and verification policies. Native plugin updates and unverified runtime platforms remain guarded.

Refs #409

* fix(omp): guard runtime ownership and localize inventory guidance

Native install recursively replaces its runtime destination, and a missing cache manifest could leave the real runtime link installed after removal. Bind and recheck an absent reviewed destination, and recover removal names only from verified scope-local links.

Localize fixed backend reasons and warnings across dashboard locales while preserving paths and external diagnostics. Restore the reviewed source in the existing reinstall fixture and record real native verification.

* fix(omp): allow forgetting natively removed plugins

A different plugin can retain node_modules after native uninstall deletes this installation. When its cache, registration and known runtime state are absent, forget only the stale Skillshare binding instead of demanding runtime-name proof for unrelated files.

Extend the existing removal recovery test with a failing-before-fix case that verifies the binding is dropped and unrelated native lock bytes and plugin files are preserved. make check passes.
2026-10-05 20:36:39 +08:00

28 lines
585 B
Go

//go:build linux
package plugin
import (
"errors"
"net"
"syscall"
)
func ompLockSupported() bool { return true }
func ompAcquireLock(path string) (func() error, error) {
path, err := ompResolvedLockPath(path)
if err != nil {
return nil, err
}
// Do not substitute flock: native Linux writers use an abstract socket.
c, err := net.ListenUnixgram("unixgram", &net.UnixAddr{Name: "\x00" + ompLockName(path+".lock"), Net: "unixgram"})
if errors.Is(err, syscall.EADDRINUSE) {
return nil, ErrOMPExtensionsBusy
}
if err != nil {
return nil, err
}
return c.Close, nil
}