fix: add involves edge from task to agent:nomos at creation
Plus sync vendor directory for Docker build compatibility.
This commit is contained in:
23
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/os.go
generated
vendored
Normal file
23
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/os.go
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
package operatingsystem
|
||||
|
||||
// OS contains information about the operating system
|
||||
type OS struct {
|
||||
ID string `json:"ID"`
|
||||
Name string `json:"Name"`
|
||||
Version string `json:"Version"`
|
||||
Branding string `json:"Branding"`
|
||||
}
|
||||
|
||||
func (o *OS) AsLogSlice() []any {
|
||||
return []any{
|
||||
"ID", o.ID,
|
||||
"Name", o.Name,
|
||||
"Version", o.Version,
|
||||
"Branding", o.Branding,
|
||||
}
|
||||
}
|
||||
|
||||
// Info retrieves information about the current platform
|
||||
func Info() (*OS, error) {
|
||||
return platformInfo()
|
||||
}
|
||||
17
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/os_android.go
generated
vendored
Normal file
17
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/os_android.go
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
//go:build android
|
||||
|
||||
package operatingsystem
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func platformInfo() (*OS, error) {
|
||||
return &OS{
|
||||
ID: "android",
|
||||
Name: "Android",
|
||||
Version: fmt.Sprintf("Go %s", runtime.Version()),
|
||||
Branding: "Android",
|
||||
}, nil
|
||||
}
|
||||
72
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/os_darwin.go
generated
vendored
Normal file
72
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/os_darwin.go
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
//go:build darwin
|
||||
|
||||
package operatingsystem
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var macOSNames = map[string]string{
|
||||
"10.10": "Yosemite",
|
||||
"10.11": "El Capitan",
|
||||
"10.12": "Sierra",
|
||||
"10.13": "High Sierra",
|
||||
"10.14": "Mojave",
|
||||
"10.15": "Catalina",
|
||||
"11": "Big Sur",
|
||||
"12": "Monterey",
|
||||
"13": "Ventura",
|
||||
"14": "Sonoma",
|
||||
"15": "Sequoia",
|
||||
// Add newer versions as they are released...
|
||||
}
|
||||
|
||||
func getOSName(version string) string {
|
||||
trimmedVersion := version
|
||||
if !strings.HasPrefix(version, "10.") {
|
||||
trimmedVersion = strings.SplitN(version, ".", 2)[0]
|
||||
}
|
||||
name, ok := macOSNames[trimmedVersion]
|
||||
if ok {
|
||||
return name
|
||||
}
|
||||
return "MacOS " + version
|
||||
}
|
||||
|
||||
func getSysctlValue(key string) (string, error) {
|
||||
// Run "sysctl" command
|
||||
command := exec.Command("sysctl", key)
|
||||
// Capture stdout
|
||||
var stdout strings.Builder
|
||||
command.Stdout = &stdout
|
||||
// Run command
|
||||
err := command.Run()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
version := strings.TrimPrefix(stdout.String(), key+": ")
|
||||
return strings.TrimSpace(version), nil
|
||||
}
|
||||
|
||||
func platformInfo() (*OS, error) {
|
||||
// Default value
|
||||
var result OS
|
||||
result.ID = "Unknown"
|
||||
result.Name = "MacOS"
|
||||
result.Version = "Unknown"
|
||||
|
||||
version, err := getSysctlValue("kern.osproductversion")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result.Version = version
|
||||
ID, err := getSysctlValue("kern.osversion")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result.ID = ID
|
||||
result.Branding = getOSName(result.Version)
|
||||
|
||||
return &result, nil
|
||||
}
|
||||
52
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/os_linux.go
generated
vendored
Normal file
52
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/os_linux.go
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
//go:build linux && !android
|
||||
|
||||
package operatingsystem
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// platformInfo is the platform specific method to get system information
|
||||
func platformInfo() (*OS, error) {
|
||||
_, err := os.Stat("/etc/os-release")
|
||||
if os.IsNotExist(err) {
|
||||
return nil, fmt.Errorf("unable to read system information")
|
||||
}
|
||||
|
||||
osRelease, _ := os.ReadFile("/etc/os-release")
|
||||
return parseOsRelease(string(osRelease)), nil
|
||||
}
|
||||
|
||||
func parseOsRelease(osRelease string) *OS {
|
||||
|
||||
// Default value
|
||||
var result OS
|
||||
result.ID = "Unknown"
|
||||
result.Name = "Unknown"
|
||||
result.Version = "Unknown"
|
||||
|
||||
// Split into lines
|
||||
lines := strings.Split(osRelease, "\n")
|
||||
// Iterate lines
|
||||
for _, line := range lines {
|
||||
// Split each line by the equals char
|
||||
splitLine := strings.SplitN(line, "=", 2)
|
||||
// Check we have
|
||||
if len(splitLine) != 2 {
|
||||
continue
|
||||
}
|
||||
switch splitLine[0] {
|
||||
case "ID":
|
||||
result.ID = strings.ToLower(strings.Trim(splitLine[1], `"`))
|
||||
case "NAME":
|
||||
result.Name = strings.Trim(splitLine[1], `"`)
|
||||
case "VERSION_ID":
|
||||
result.Version = strings.Trim(splitLine[1], `"`)
|
||||
case "VERSION":
|
||||
result.Branding = strings.Trim(splitLine[1], `"`)
|
||||
}
|
||||
}
|
||||
return &result
|
||||
}
|
||||
34
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/os_windows.go
generated
vendored
Normal file
34
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/os_windows.go
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
//go:build windows
|
||||
|
||||
package operatingsystem
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/wailsapp/wails/v3/pkg/w32"
|
||||
|
||||
"golang.org/x/sys/windows/registry"
|
||||
)
|
||||
|
||||
func platformInfo() (*OS, error) {
|
||||
// Default value
|
||||
var result OS
|
||||
result.ID = "Unknown"
|
||||
result.Name = "Windows"
|
||||
result.Version = "Unknown"
|
||||
|
||||
// Credit: https://stackoverflow.com/a/33288328
|
||||
// Ignore errors as it isn't a showstopper
|
||||
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
|
||||
|
||||
productName, _, _ := key.GetStringValue("ProductName")
|
||||
currentBuild, _, _ := key.GetStringValue("CurrentBuildNumber")
|
||||
displayVersion, _, _ := key.GetStringValue("DisplayVersion")
|
||||
releaseId, _, _ := key.GetStringValue("ReleaseId")
|
||||
|
||||
result.Name = productName
|
||||
result.Version = fmt.Sprintf("%s (Build: %s)", releaseId, currentBuild)
|
||||
result.ID = displayVersion
|
||||
result.Branding = w32.GetBranding()
|
||||
|
||||
return &result, key.Close()
|
||||
}
|
||||
62
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/version_windows.go
generated
vendored
Normal file
62
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/version_windows.go
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
//go:build windows
|
||||
|
||||
package operatingsystem
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"golang.org/x/sys/windows/registry"
|
||||
)
|
||||
|
||||
type WindowsVersionInfo struct {
|
||||
Major int
|
||||
Minor int
|
||||
Build int
|
||||
DisplayVersion string
|
||||
}
|
||||
|
||||
func (w *WindowsVersionInfo) IsWindowsVersionAtLeast(major, minor, buildNumber int) bool {
|
||||
return w.Major >= major && w.Minor >= minor && w.Build >= buildNumber
|
||||
}
|
||||
|
||||
func GetWindowsVersionInfo() (*WindowsVersionInfo, error) {
|
||||
key, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &WindowsVersionInfo{
|
||||
Major: regDWORDKeyAsInt(key, "CurrentMajorVersionNumber"),
|
||||
Minor: regDWORDKeyAsInt(key, "CurrentMinorVersionNumber"),
|
||||
Build: regStringKeyAsInt(key, "CurrentBuildNumber"),
|
||||
DisplayVersion: regKeyAsString(key, "DisplayVersion"),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func regDWORDKeyAsInt(key registry.Key, name string) int {
|
||||
result, _, err := key.GetIntegerValue(name)
|
||||
if err != nil {
|
||||
return -1
|
||||
}
|
||||
return int(result)
|
||||
}
|
||||
|
||||
func regStringKeyAsInt(key registry.Key, name string) int {
|
||||
resultStr, _, err := key.GetStringValue(name)
|
||||
if err != nil {
|
||||
return -1
|
||||
}
|
||||
result, err := strconv.Atoi(resultStr)
|
||||
if err != nil {
|
||||
return -1
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func regKeyAsString(key registry.Key, name string) string {
|
||||
resultStr, _, err := key.GetStringValue(name)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return resultStr
|
||||
}
|
||||
42
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/webkit_linux.go
generated
vendored
Normal file
42
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/webkit_linux.go
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
//go:build linux && cgo && !gtk3 && !android
|
||||
|
||||
package operatingsystem
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk4 webkitgtk-6.0
|
||||
#include <webkit/webkit.h>
|
||||
*/
|
||||
import "C"
|
||||
import "fmt"
|
||||
|
||||
type WebkitVersion struct {
|
||||
Major uint
|
||||
Minor uint
|
||||
Micro uint
|
||||
}
|
||||
|
||||
func GetWebkitVersion() WebkitVersion {
|
||||
var major, minor, micro C.uint
|
||||
major = C.webkit_get_major_version()
|
||||
minor = C.webkit_get_minor_version()
|
||||
micro = C.webkit_get_micro_version()
|
||||
return WebkitVersion{
|
||||
Major: uint(major),
|
||||
Minor: uint(minor),
|
||||
Micro: uint(micro),
|
||||
}
|
||||
}
|
||||
|
||||
func (v WebkitVersion) String() string {
|
||||
return fmt.Sprintf("v%d.%d.%d", v.Major, v.Minor, v.Micro)
|
||||
}
|
||||
|
||||
func (v WebkitVersion) IsAtLeast(major int, minor int, micro int) bool {
|
||||
if v.Major != uint(major) {
|
||||
return v.Major > uint(major)
|
||||
}
|
||||
if v.Minor != uint(minor) {
|
||||
return v.Minor > uint(minor)
|
||||
}
|
||||
return v.Micro >= uint(micro)
|
||||
}
|
||||
42
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/webkit_linux_gtk3.go
generated
vendored
Normal file
42
vendor/github.com/wailsapp/wails/v3/internal/operatingsystem/webkit_linux_gtk3.go
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
//go:build linux && cgo && gtk3 && !android
|
||||
|
||||
package operatingsystem
|
||||
|
||||
/*
|
||||
#cgo linux pkg-config: gtk+-3.0 webkit2gtk-4.1
|
||||
#include <webkit2/webkit2.h>
|
||||
*/
|
||||
import "C"
|
||||
import "fmt"
|
||||
|
||||
type WebkitVersion struct {
|
||||
Major uint
|
||||
Minor uint
|
||||
Micro uint
|
||||
}
|
||||
|
||||
func GetWebkitVersion() WebkitVersion {
|
||||
var major, minor, micro C.uint
|
||||
major = C.webkit_get_major_version()
|
||||
minor = C.webkit_get_minor_version()
|
||||
micro = C.webkit_get_micro_version()
|
||||
return WebkitVersion{
|
||||
Major: uint(major),
|
||||
Minor: uint(minor),
|
||||
Micro: uint(micro),
|
||||
}
|
||||
}
|
||||
|
||||
func (v WebkitVersion) String() string {
|
||||
return fmt.Sprintf("v%d.%d.%d", v.Major, v.Minor, v.Micro)
|
||||
}
|
||||
|
||||
func (v WebkitVersion) IsAtLeast(major int, minor int, micro int) bool {
|
||||
if v.Major != uint(major) {
|
||||
return v.Major > uint(major)
|
||||
}
|
||||
if v.Minor != uint(minor) {
|
||||
return v.Minor > uint(minor)
|
||||
}
|
||||
return v.Micro >= uint(micro)
|
||||
}
|
||||
Reference in New Issue
Block a user