fix: add involves edge from task to agent:nomos at creation
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
ci / web (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled

Plus sync vendor directory for Docker build compatibility.
This commit is contained in:
2026-08-11 22:03:12 +02:00
parent 7d6a3320d4
commit febc153b7f
3384 changed files with 945212 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
node_modules
.task
*.tsbuildinfo
desktop/@wailsio/runtime/dist/
desktop/@wailsio/runtime/types/

View File

@@ -0,0 +1,3 @@
# Runtime
To rebuild the runtime run `task build` or if you have Wails v3 CLI, you can use `wails3 task build`.

View File

@@ -0,0 +1,128 @@
# https://taskfile.dev
version: "3"
vars:
ESBUILD: desktop/@wailsio/runtime/node_modules/.bin/esbuild
tasks:
install-deps:
internal: true
# once: build:debug and build:production dep on this in parallel; two
# concurrent npm installs in the same directory corrupt node_modules.
run: once
dir: desktop/@wailsio/runtime
sources:
- package.json
cmds:
- npm install
check:
dir: desktop/@wailsio/runtime
deps:
- install-deps
cmds:
- npm run check
test:
dir: desktop/@wailsio/runtime
deps:
- install-deps
cmds:
- npm test
build:debug:
internal: true
deps:
- install-deps
cmds:
- "{{.ESBUILD}} desktop/@wailsio/runtime/src/index.ts --inject:desktop/compiled/main.js --format=esm --target=safari11 --bundle --ignore-annotations --tree-shaking=true --sourcemap=inline --outfile=../assetserver/bundledassets/runtime.debug.js --define:DEBUG=true"
build:production:
internal: true
deps:
- install-deps
cmds:
- "{{.ESBUILD}} desktop/@wailsio/runtime/src/index.ts --inject:desktop/compiled/main.js --format=esm --target=safari11 --bundle --ignore-annotations --tree-shaking=true --minify --outfile=../assetserver/bundledassets/runtime.js --define:DEBUG=false --drop:console"
build:docs:
internal: true
dir: desktop/@wailsio/runtime
deps:
- install-deps
cmds:
- npm run build:docs
build:docs:md:
internal: true
dir: desktop/@wailsio/runtime
deps:
- install-deps
cmds:
- npm run build:docs:md
build:assets:
desc: Rebuild only the embedded runtime bundles (bundledassets); CI verifies PR bundles against this exact output.
deps:
- build:debug
- build:production
build:runtime:
internal: true
deps:
- build:debug
- build:production
cmds:
- cmd: echo "Runtime build complete."
build:all:
internal: true
cmds:
- task: generate:events
- task: build:docs
- task: build:runtime
- echo "Build Complete."
build:
deps:
- install-deps
cmds:
- task: build:all
docs:
summary: Generate TypeDoc documentation for the runtime
dir: desktop/@wailsio/runtime
deps:
- install-deps
cmds:
- npm run build:docs
- echo "Documentation generated at desktop/@wailsio/runtime/docs/"
docs:md:
summary: Generate markdown documentation for the runtime
dir: desktop/@wailsio/runtime
deps:
- install-deps
cmds:
- npm run build:docs:md
- echo "Markdown documentation generated"
generate:events:
dir: ../../tasks/events
cmds:
- go run generate.go
- go fmt ../../pkg/events/events.go
clean:
summary: Clean built artifacts and documentation
dir: desktop/@wailsio/runtime
cmds:
- npm run clean
- echo "Cleaned runtime artifacts"
generate:
summary: Generate events only (use runtime:build to rebuild everything)
cmds:
- task: generate:events
- echo "Events generated. Run 'wails3 task runtime:build' to rebuild runtime with updated documentation"

View File

@@ -0,0 +1,6 @@
{
"name": "runtime",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}

View File

@@ -0,0 +1,22 @@
package runtime
import (
"fmt"
"encoding/json"
)
var runtimeInit = `window._wails=window._wails||{};window._wails.flags=window._wails.flags||{};window.wails=window.wails||{};`
var runtimeConfigReady = `Promise.resolve().then(function(){window.dispatchEvent(new Event("wails:runtime-config-ready"));});`
func Core(flags map[string]any) string {
flagsStr := ""
if len(flags) > 0 {
f, err := json.Marshal(flags)
if err == nil {
flagsStr += fmt.Sprintf("window._wails.flags=%s;", f)
}
}
return runtimeInit + flagsStr + invoke + environment + runtimeConfigReady
}

View File

@@ -0,0 +1,16 @@
//go:build android
package runtime
// Android uses window.wails.invoke which is set up via addJavascriptInterface in WailsJSBridge
// We need to log the state to debug why it's not being detected
var invoke = `
console.log('[Wails Android Runtime] Injecting runtime, window.wails exists:', !!window.wails);
console.log('[Wails Android Runtime] window.wails.invoke exists:', !!(window.wails && window.wails.invoke));
window._wails.invoke=function(m){
console.log('[Wails Android Runtime] _wails.invoke called:', m);
return window.wails.invoke(typeof m==='string'?m:JSON.stringify(m));
};
console.log('[Wails Android Runtime] Runtime injection complete');
`
var flags = ""

View File

@@ -0,0 +1,5 @@
//go:build darwin
package runtime
var invoke = "window._wails.invoke=function(msg){window.webkit.messageHandlers.external.postMessage(msg);};"

View File

@@ -0,0 +1,10 @@
//go:build !production
package runtime
import (
"fmt"
"runtime"
)
var environment = fmt.Sprintf(`window._wails.environment={"OS":"%s","Arch":"%s","Debug":true};`, runtime.GOOS, runtime.GOARCH)

View File

@@ -0,0 +1,11 @@
//go:build linux && !android
package runtime
// On webkit2gtk, `messageHandlers.external.postMessage` only works when
// `this` is bound to the handler object. Assigning the bare function
// reference (as we did historically) silently swallows messages when
// called as `window._wails.invoke(msg)` — the page's invoke loses the
// receiver. Wrap it like darwin does so callers can invoke without
// thinking about receiver binding.
var invoke = "window._wails.invoke=function(msg){window.webkit.messageHandlers.external.postMessage(msg);};"

View File

@@ -0,0 +1,8 @@
//go:build production
package runtime
import "fmt"
import goruntime "runtime"
var environment = fmt.Sprintf(`window._wails.environment={"OS":"%s","Arch":"%s","Debug":false};`, goruntime.GOOS, goruntime.GOARCH)

View File

@@ -0,0 +1,5 @@
//go:build windows
package runtime
var invoke = `window._wails.invoke=window.chrome.webview.postMessage;`