feat: port the client to MyGo native UI (0.3.0)
Switch from Asuka to MyGo, keeping the API client and the feature set: - servers: saved servers, passwordless and password login, proxy, self-signed certificates, per-server device tokens (Keystore), connect form, instance list sheet with switch/disconnect - sessions: virtualized list, search, new session, rename/archive/delete, running indicator, event stream keeps it live - chat: pushed window with system back bar, streaming Markdown via ui/markdown, reasoning and tool rows with image previews, footer menu (read aloud via a Kotlin TTS plugin, copy, fork), user message menu (copy, revert, fork), context usage ring and detail sheet, attachments (photos/files via the document picker), permissions - release builds allow plain http:// LAN servers (Go's net/http dials directly, no cleartext manifest needed) - a local fork of MyGo (third_party/mygo) lowers the Android host's minSdk to 24 (Android 7.0); Go 1.27.4 via mise Version 0.3.0.
This commit is contained in:
1 parent
2fb4a8ea79
commit
6c0ee61750
2538 files changed
+675779
-4792
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/egoist/mygo/internal/gpu/d3d11"
|
||||
)
|
||||
|
||||
// compile compiles the shader file within the Direct3D renderer's head
|
||||
// and tail.
|
||||
func compile(file string) (compiled string, code []byte, err error) {
|
||||
src, err := os.ReadFile(file)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
code, err = d3d11.CompileEffect(string(src))
|
||||
return d3d11.EffectSource(string(src)), code, err
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
//go:build !js
|
||||
|
||||
// Command gen compiles the glass's and the blur's shaders ahead of time,
|
||||
// so that renderers start without compiling them: the Metal libraries on
|
||||
// macOS, with Xcode's metal tools, into shaders_darwin.go, and the
|
||||
// Direct3D bytecode on Windows, with the system's d3dcompiler_47.dll, into
|
||||
// shaders_windows.go. Run it on each: go generate ./plugins/glass
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"go/format"
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/egoist/mygo/internal/gpu"
|
||||
)
|
||||
|
||||
// shader is a shader to compile, and the variables holding its code and
|
||||
// the SHA-256 of what that was compiled from.
|
||||
type shader struct{ file, codeVar, sumVar string }
|
||||
|
||||
func main() {
|
||||
file := "shaders_darwin.go"
|
||||
shaders := []shader{{"glass.metal", "metalLibrary", "metalSum"}, {"blur.metal", "blurMetalLibrary", "blurMetalSum"}}
|
||||
if runtime.GOOS == "windows" {
|
||||
file = "shaders_windows.go"
|
||||
shaders = []shader{{"glass.hlsl", "hlslBytecode", "hlslSum"}, {"blur.hlsl", "blurBytecode", "blurHLSLSum"}}
|
||||
}
|
||||
var names []string
|
||||
for _, sh := range shaders {
|
||||
names = append(names, sh.file)
|
||||
}
|
||||
var b bytes.Buffer
|
||||
fmt.Fprintf(&b, "// Code generated by internal/gen from %s; DO NOT EDIT.\n\n//go:build %s\n\npackage glass\n\n", strings.Join(names, " and "), runtime.GOOS)
|
||||
for _, sh := range shaders {
|
||||
compiled, code, err := compile(sh.file)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Fprintf(&b, "// %s is the SHA-256 of what %s was compiled from: %s\n// within the renderer's head and tail.\nconst %s = %q\n\n", sh.sumVar, sh.codeVar, sh.file, sh.sumVar, gpu.SourceSum(compiled))
|
||||
b.WriteString(gpu.GoBytes(sh.codeVar, code))
|
||||
b.WriteString("\n")
|
||||
}
|
||||
out, err := format.Source(b.Bytes())
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(file, out, 0o644); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
//go:build !ios
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/egoist/mygo/internal/gpu/metal"
|
||||
)
|
||||
|
||||
// compile compiles the shader file within the Metal renderer's head and
|
||||
// tail.
|
||||
func compile(file string) (compiled string, code []byte, err error) {
|
||||
src, err := os.ReadFile(file)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
compiled = metal.EffectSource(string(src))
|
||||
code, err = metal.CompileLibrary(compiled)
|
||||
return compiled, code, err
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
//go:build !(darwin && !ios) && !windows && !js
|
||||
|
||||
package main
|
||||
|
||||
import "errors"
|
||||
|
||||
func compile(string) (compiled string, code []byte, err error) {
|
||||
return "", nil, errors.New("the glass's shaders compile on macOS and Windows")
|
||||
}
|
||||
Reference in new issue
Block a user