diff --git a/data/bindata.go b/data/bindata.go index af78e2fd..2878b63a 100644 --- a/data/bindata.go +++ b/data/bindata.go @@ -92,6 +92,12 @@ // .tmp/data/yao/models/kb.mod.yao // .tmp/data/yao/models/user.mod.yao // .tmp/data/yao/release/app.yaz +// .tmp/data/yao/stores/agent/cache.lru.yao +// .tmp/data/yao/stores/agent/memory.badger.yao +// .tmp/data/yao/stores/cache.lru.yao +// .tmp/data/yao/stores/oauth/cache.lru.yao +// .tmp/data/yao/stores/oauth/client.badger.yao +// .tmp/data/yao/stores/store.badger.yao package data import ( @@ -270,7 +276,7 @@ func cuiSetupIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "cui/setup/index.html", size: 10, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "cui/setup/index.html", size: 10, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -290,7 +296,7 @@ func cuiV09IndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "cui/v0.9/index.html", size: 13, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "cui/v0.9/index.html", size: 13, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -310,7 +316,7 @@ func cuiV10IndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "cui/v1.0/index.html", size: 49, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "cui/v1.0/index.html", size: 49, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -330,7 +336,7 @@ func cuiV10Layouts__indexAsyncJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "cui/v1.0/layouts__index.async.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "cui/v1.0/layouts__index.async.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -350,7 +356,7 @@ func cuiV10UmiJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "cui/v1.0/umi.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "cui/v1.0/umi.js", size: 71, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -370,7 +376,7 @@ func initEnv() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.env", size: 219, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.env", size: 219, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -390,7 +396,7 @@ func initVscodeSettingsJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/settings.json", size: 4666, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/settings.json", size: 4666, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -410,7 +416,7 @@ func initVscodeTypesRuntimeConsoleDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/console.d.ts", size: 221, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/console.d.ts", size: 221, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -430,7 +436,7 @@ func initVscodeTypesRuntimeExceptionDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/exception.d.ts", size: 738, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/exception.d.ts", size: 738, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -450,7 +456,7 @@ func initVscodeTypesRuntimeFsDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/fs.d.ts", size: 8554, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/fs.d.ts", size: 8554, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -470,7 +476,7 @@ func initVscodeTypesRuntimeGlobalDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/global.d.ts", size: 1759, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/global.d.ts", size: 1759, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -490,7 +496,7 @@ func initVscodeTypesRuntimeHttpDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/http.d.ts", size: 6179, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/http.d.ts", size: 6179, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -510,7 +516,7 @@ func initVscodeTypesRuntimeIoDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/io.d.ts", size: 587, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/io.d.ts", size: 587, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -530,7 +536,7 @@ func initVscodeTypesRuntimeLogDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/log.d.ts", size: 1692, mode: os.FileMode(493), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/log.d.ts", size: 1692, mode: os.FileMode(493), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -550,7 +556,7 @@ func initVscodeTypesRuntimeNeoDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/neo.d.ts", size: 3750, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/neo.d.ts", size: 3750, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -570,7 +576,7 @@ func initVscodeTypesRuntimeProcessFsDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/process/fs.d.ts", size: 11133, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/process/fs.d.ts", size: 11133, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -590,7 +596,7 @@ func initVscodeTypesRuntimeProcessHttpDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/process/http.d.ts", size: 5653, mode: os.FileMode(493), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/process/http.d.ts", size: 5653, mode: os.FileMode(493), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -610,7 +616,7 @@ func initVscodeTypesRuntimeProcessModelDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/process/model.d.ts", size: 6656, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/process/model.d.ts", size: 6656, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -630,7 +636,7 @@ func initVscodeTypesRuntimeProcessDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/process.d.ts", size: 23165, mode: os.FileMode(493), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/process.d.ts", size: 23165, mode: os.FileMode(493), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -650,7 +656,7 @@ func initVscodeTypesRuntimeQueryDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/query.d.ts", size: 6124, mode: os.FileMode(493), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/query.d.ts", size: 6124, mode: os.FileMode(493), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -670,7 +676,7 @@ func initVscodeTypesRuntimeStoreDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/store.d.ts", size: 2251, mode: os.FileMode(493), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/store.d.ts", size: 2251, mode: os.FileMode(493), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -690,7 +696,7 @@ func initVscodeTypesRuntimeSuiDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/sui.d.ts", size: 1713, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/sui.d.ts", size: 1713, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -710,7 +716,7 @@ func initVscodeTypesRuntimeTimeDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime/time.d.ts", size: 711, mode: os.FileMode(493), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime/time.d.ts", size: 711, mode: os.FileMode(493), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -730,7 +736,7 @@ func initVscodeTypesRuntimeDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/runtime.d.ts", size: 424, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/runtime.d.ts", size: 424, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -750,7 +756,7 @@ func initVscodeTypesSuiDTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/.vscode/types/sui.d.ts", size: 8931, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/.vscode/types/sui.d.ts", size: 8931, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -770,7 +776,7 @@ func initAppYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/app.yao", size: 3115, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/app.yao", size: 3115, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -790,7 +796,7 @@ func initDataReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/README.md", size: 41, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/data/README.md", size: 41, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -810,7 +816,7 @@ func initDataTemplatesDefault__assetsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__assets/README.md", size: 33, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__assets/README.md", size: 33, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -830,7 +836,7 @@ func initDataTemplatesDefault__assetsImagesIconsAppPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__assets/images/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__assets/images/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -850,7 +856,7 @@ func initDataTemplatesDefault__assetsImagesLogosLogo_colorSvg() (*asset, error) return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__assets/images/logos/logo_color.svg", size: 2909, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__assets/images/logos/logo_color.svg", size: 2909, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -870,7 +876,7 @@ func initDataTemplatesDefault__assetsImagesLogosWordmarkSvg() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__assets/images/logos/wordmark.svg", size: 3615, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__assets/images/logos/wordmark.svg", size: 3615, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -890,7 +896,7 @@ func initDataTemplatesDefault__dataJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__data.json", size: 30, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__data.json", size: 30, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -910,7 +916,7 @@ func initDataTemplatesDefault__documentHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/__document.html", size: 492, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/data/templates/default/__document.html", size: 492, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -930,7 +936,7 @@ func initDataTemplatesDefaultIndexIndexCss() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/index/index.css", size: 2896, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/data/templates/default/index/index.css", size: 2896, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -950,7 +956,7 @@ func initDataTemplatesDefaultIndexIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/index/index.html", size: 2361, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/data/templates/default/index/index.html", size: 2361, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -970,7 +976,7 @@ func initDataTemplatesDefaultIndexIndexJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/data/templates/default/index/index.json", size: 31, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/data/templates/default/index/index.json", size: 31, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -990,7 +996,7 @@ func initDbReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/db/README.md", size: 84, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/db/README.md", size: 84, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1010,7 +1016,7 @@ func initFlowsMenuFlowYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/flows/menu.flow.yao", size: 813, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/flows/menu.flow.yao", size: 813, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1030,7 +1036,7 @@ func initFormsAccountFormYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/forms/account.form.yao", size: 1194, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/forms/account.form.yao", size: 1194, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1050,7 +1056,7 @@ func initIconsAppIcns() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/icons/app.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/icons/app.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1070,7 +1076,7 @@ func initIconsAppIco() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/icons/app.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/icons/app.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1090,7 +1096,7 @@ func initIconsAppPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1110,7 +1116,7 @@ func initLoginsAdminLoginYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/logins/admin.login.yao", size: 302, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/logins/admin.login.yao", size: 302, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1130,7 +1136,7 @@ func initLogsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/logs/README.md", size: 28, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/logs/README.md", size: 28, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1150,7 +1156,7 @@ func initModelsAdminUserModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/models/admin/user.mod.yao", size: 6416, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/models/admin/user.mod.yao", size: 6416, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1170,7 +1176,7 @@ func initModelsTestsPetModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/models/tests/pet.mod.yao", size: 525, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/models/tests/pet.mod.yao", size: 525, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1190,7 +1196,7 @@ func initNeoNeoYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/neo/neo.yml", size: 724, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/neo/neo.yml", size: 724, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1210,7 +1216,7 @@ func initPublicReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/README.md", size: 108, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/public/README.md", size: 108, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1230,7 +1236,7 @@ func initPublicAssetsReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/README.md", size: 33, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/public/assets/README.md", size: 33, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1250,7 +1256,7 @@ func initPublicAssetsImagesIconsAppPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/images/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/public/assets/images/icons/app.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1270,7 +1276,7 @@ func initPublicAssetsImagesLogosLogo_colorSvg() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/images/logos/logo_color.svg", size: 2909, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/public/assets/images/logos/logo_color.svg", size: 2909, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1290,7 +1296,7 @@ func initPublicAssetsImagesLogosWordmarkSvg() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/images/logos/wordmark.svg", size: 3615, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/public/assets/images/logos/wordmark.svg", size: 3615, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1310,7 +1316,7 @@ func initPublicAssetsLibsuiMinJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/libsui.min.js", size: 12569, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/public/assets/libsui.min.js", size: 12569, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1330,7 +1336,7 @@ func initPublicAssetsLibsuiMinJsMap() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/assets/libsui.min.js.map", size: 38553, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/public/assets/libsui.min.js.map", size: 38553, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1350,7 +1356,7 @@ func initPublicIndexCfg() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/index.cfg", size: 85, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/public/index.cfg", size: 85, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1370,7 +1376,7 @@ func initPublicIndexSui() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/public/index.sui", size: 5682, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/public/index.sui", size: 5682, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1390,7 +1396,7 @@ func initScriptsAccountTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/account.ts", size: 2521, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/scripts/account.ts", size: 2521, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1410,7 +1416,7 @@ func initScriptsAiNeoTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/ai/neo.ts", size: 375, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/scripts/ai/neo.ts", size: 375, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1430,7 +1436,7 @@ func initScriptsTestsTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/tests.ts", size: 1044, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/scripts/tests.ts", size: 1044, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1450,7 +1456,7 @@ func initScriptsUtilsTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/scripts/utils.ts", size: 1230, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/scripts/utils.ts", size: 1230, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1470,7 +1476,7 @@ func initSuisWebSuiYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/suis/web.sui.yao", size: 675, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/suis/web.sui.yao", size: 675, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1490,7 +1496,7 @@ func initTablesAccountTabYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/tables/account.tab.yao", size: 5597, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/tables/account.tab.yao", size: 5597, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1510,7 +1516,7 @@ func initTsconfigJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "init/tsconfig.json", size: 178, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "init/tsconfig.json", size: 178, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1530,7 +1536,7 @@ func libsuiAgentTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "libsui/agent.ts", size: 15267, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "libsui/agent.ts", size: 15267, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1550,7 +1556,7 @@ func libsuiIndexTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "libsui/index.ts", size: 13049, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "libsui/index.ts", size: 13049, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1570,7 +1576,7 @@ func libsuiUtilsTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "libsui/utils.ts", size: 5959, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "libsui/utils.ts", size: 5959, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1590,7 +1596,7 @@ func libsuiYaoTs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "libsui/yao.ts", size: 4338, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "libsui/yao.ts", size: 4338, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1610,7 +1616,7 @@ func publicIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "public/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "public/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1630,7 +1636,7 @@ func uiIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "ui/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "ui/index.html", size: 11, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1650,7 +1656,7 @@ func yaoDataIcons404Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/data/icons/404.png", size: 9342, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1670,7 +1676,7 @@ func yaoDataIconsIconIcns() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.icns", size: 67465, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1690,7 +1696,7 @@ func yaoDataIconsIconIco() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.ico", size: 54993, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1710,7 +1716,7 @@ func yaoDataIconsIconPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/icons/icon.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/data/icons/icon.png", size: 34558, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1730,7 +1736,7 @@ func yaoDataIndexHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/data/index.html", size: 282, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/data/index.html", size: 282, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1750,7 +1756,7 @@ func yaoFieldsModelTransJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/fields/model.trans.json", size: 14938, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/fields/model.trans.json", size: 14938, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1770,7 +1776,7 @@ func yaoLangsEnUsJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/en-US.json", size: 66, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/langs/en-US.json", size: 66, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1790,7 +1796,7 @@ func yaoLangsZhCnGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/global.yml", size: 1762, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/global.yml", size: 1762, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1810,7 +1816,7 @@ func yaoLangsZhCnLoginsAdminLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1830,7 +1836,7 @@ func yaoLangsZhCnLoginsUserLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-cn/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/langs/zh-cn/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1850,7 +1856,7 @@ func yaoLangsZhHkGlobalYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/global.yml", size: 1762, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/global.yml", size: 1762, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1870,7 +1876,7 @@ func yaoLangsZhHkLoginsAdminLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/logins/admin.login.yml", size: 94, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1890,7 +1896,7 @@ func yaoLangsZhHkLoginsUserLoginYml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/langs/zh-hk/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/langs/zh-hk/logins/user.login.yml", size: 90, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1910,7 +1916,7 @@ func yaoModelsAssistantModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/assistant.mod.yao", size: 4114, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/models/assistant.mod.yao", size: 4114, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1930,7 +1936,7 @@ func yaoModelsAttachmentModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/attachment.mod.yao", size: 3264, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/models/attachment.mod.yao", size: 3264, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1950,7 +1956,7 @@ func yaoModelsAuditModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/audit.mod.yao", size: 5588, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/models/audit.mod.yao", size: 5588, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1970,7 +1976,7 @@ func yaoModelsChatModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/chat.mod.yao", size: 1444, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/models/chat.mod.yao", size: 1444, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1990,7 +1996,7 @@ func yaoModelsConfigModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/config.mod.yao", size: 1649, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/models/config.mod.yao", size: 1649, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2010,7 +2016,7 @@ func yaoModelsDslModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/dsl.mod.yao", size: 3806, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/models/dsl.mod.yao", size: 3806, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2030,7 +2036,7 @@ func yaoModelsHistoryModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/history.mod.yao", size: 2902, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/models/history.mod.yao", size: 2902, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2050,7 +2056,7 @@ func yaoModelsKbModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/kb.mod.yao", size: 2881, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/models/kb.mod.yao", size: 2881, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2070,7 +2076,7 @@ func yaoModelsUserModYao() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/models/user.mod.yao", size: 6775, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/models/user.mod.yao", size: 6775, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2090,7 +2096,127 @@ func yaoReleaseAppYaz() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "yao/release/app.yaz", size: 181682, mode: os.FileMode(420), modTime: time.Unix(1752809404, 0)} + info := bindataFileInfo{name: "yao/release/app.yaz", size: 181682, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _yaoStoresAgentCacheLruYao = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x90\x31\x4f\xc4\x30\x0c\x85\xf7\xfe\x8a\x27\xcf\x37\x00\x42\x48\x74\x43\xac\x4c\x20\x26\xc4\xe0\x4b\x7d\x47\x44\x9a\x14\xc7\x1d\x0a\xba\xff\x8e\xec\x8a\x95\x29\xc9\xf3\xf7\x5e\xf2\xf2\x33\x00\x54\xf8\x28\x85\x46\xd0\xc3\x59\xaa\xe1\x91\xd3\x87\xe0\xc5\x9a\x0a\x1d\x7c\x3e\x49\x4f\x9a\x17\xcb\xad\x3a\xf5\xf4\xfc\x8a\x14\x4c\x77\x06\xa7\xa6\xe0\x70\x9a\xcc\x4b\x53\xd6\x0d\x13\x1b\x83\xeb\x84\xaf\x35\xa7\x4f\x70\x4a\xd2\x3b\x66\x99\x9b\x6e\x7b\xa8\xf1\xb9\xd3\x88\x37\x0a\x2b\x1d\x40\x91\xe9\x9b\xa2\xab\x2f\x9c\xe9\x3d\x50\x15\x9e\x5a\x2d\x1b\x8d\x38\x71\xe9\x12\xe2\x71\xcd\xc5\xb2\x3f\xc8\x74\xdd\xa5\xde\xd4\x68\xc4\xcd\x75\x9c\x2a\xcf\xf2\x4f\x29\xdb\x96\x18\xc7\x65\x2e\xb4\xbf\x82\xfe\x27\x9e\x96\xbf\x1d\xb8\xbd\xba\xbf\x1b\x80\xcb\x70\x19\x7e\x03\x00\x00\xff\xff\x7c\x73\xd7\xda\x2d\x01\x00\x00") + +func yaoStoresAgentCacheLruYaoBytes() ([]byte, error) { + return bindataRead( + _yaoStoresAgentCacheLruYao, + "yao/stores/agent/cache.lru.yao", + ) +} + +func yaoStoresAgentCacheLruYao() (*asset, error) { + bytes, err := yaoStoresAgentCacheLruYaoBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "yao/stores/agent/cache.lru.yao", size: 301, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _yaoStoresAgentMemoryBadgerYao = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x90\x31\x6b\xc3\x40\x0c\x85\x77\xff\x8a\x87\xe6\x04\x97\x8e\xde\x5c\xba\x16\x43\x9b\xa5\x94\x12\xe4\x58\x71\x0f\xce\x77\xe6\x4e\x19\x8c\xf1\x7f\x2f\x27\x27\x6b\x36\xdd\xbb\xf7\x49\x7a\x5a\x2b\x80\x3c\xf7\xe2\xa9\x01\xb5\xa3\x04\xc5\x87\x4c\x31\x2d\xf8\xd2\x98\x84\x0e\xc5\x30\x48\xbe\x24\x37\xab\x8b\xa1\xd8\xde\x78\x18\x25\x1d\x7b\xce\x32\x20\x17\x1b\xae\x31\x81\x8d\x9e\x76\x7a\x96\x94\x5d\x56\x09\x17\x01\x87\x01\x3e\x86\xf1\xa8\x92\x26\x03\x78\xbc\x77\x56\x1e\x33\x35\xf8\x21\x83\xe9\x00\xda\xf9\x52\xf5\x36\xa6\x54\xec\xe8\xd7\xec\x49\x78\x88\xc1\x2f\xd4\xe0\xca\x3e\x8b\x89\xfd\xcd\x79\x75\x65\x33\x4d\xb7\x5d\xca\x31\x29\x35\x78\x7d\xb1\x57\xe0\x49\x9e\xc5\xd3\x65\xb6\xff\xc7\xc0\xa2\xc5\x47\xda\x72\x21\x80\x66\xd6\xbf\xe2\x59\x57\x7c\xb7\xdd\xf9\xbd\x3d\xb5\xe7\xcf\xae\x3b\x61\xdb\x6a\x3b\x41\xae\x2d\x42\x7d\xdf\xbf\x02\xb6\x6a\xab\xfe\x03\x00\x00\xff\xff\x2b\x8a\xe7\x6d\x60\x01\x00\x00") + +func yaoStoresAgentMemoryBadgerYaoBytes() ([]byte, error) { + return bindataRead( + _yaoStoresAgentMemoryBadgerYao, + "yao/stores/agent/memory.badger.yao", + ) +} + +func yaoStoresAgentMemoryBadgerYao() (*asset, error) { + bytes, err := yaoStoresAgentMemoryBadgerYaoBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "yao/stores/agent/memory.badger.yao", size: 352, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _yaoStoresCacheLruYao = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x8f\x31\x4f\x03\x31\x0c\x85\xf7\xfb\x15\x4f\x9e\x19\x10\x42\x48\xdc\xca\xca\x44\xc5\x80\x10\x43\x7a\x75\x4b\xa4\x24\xae\x62\xdf\x10\xaa\xfe\x77\x64\x57\xb7\x76\x4a\xf2\xf9\xd3\x8b\xdf\x65\x02\xa8\xa4\x3d\x17\x9a\x41\xbb\xa1\xc6\x15\x6f\x69\xf9\x65\xec\x4c\x3a\xd3\x83\x0b\x07\xd6\xa5\xe7\xb3\x65\x69\xae\xbd\x7f\x7c\x62\x09\x47\xdd\xc1\x51\x3a\x16\xa9\x55\x5a\xe0\xdc\x4e\xc8\x0d\x5f\x49\xa0\x11\x78\x0b\xb1\x74\x52\x9a\xf1\x4d\x1b\x04\x45\x88\x5f\x4a\x5f\xfd\xa8\x5c\xa5\x0f\xfa\x09\xbf\x73\x3a\x48\x2b\x83\x66\x1c\x53\x51\x0e\xb8\x5f\x73\xb1\xec\x5b\x58\x5f\x6f\x48\xa5\x1b\xcd\x78\x8a\x47\x4b\x95\xef\x35\xb1\x71\x8e\x79\x7c\xe8\x40\xb6\x56\x17\x90\xe6\x3f\x1f\x3e\x3f\xbe\xbe\xe0\x3a\x5d\xa7\xff\x00\x00\x00\xff\xff\xcc\xb6\x49\xf3\x1d\x01\x00\x00") + +func yaoStoresCacheLruYaoBytes() ([]byte, error) { + return bindataRead( + _yaoStoresCacheLruYao, + "yao/stores/cache.lru.yao", + ) +} + +func yaoStoresCacheLruYao() (*asset, error) { + bytes, err := yaoStoresCacheLruYaoBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "yao/stores/cache.lru.yao", size: 285, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _yaoStoresOauthCacheLruYao = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x90\xb1\x4a\x04\x31\x10\x86\xfb\x7d\x8a\x9f\xa9\xaf\xf0\x40\x04\xb7\x13\x5b\x41\x50\xac\xc4\x62\x6e\x77\xce\x0d\xe6\x32\x4b\x66\x52\xac\x72\xef\x2e\x93\xc5\xd6\x2a\xc9\x3f\x5f\xbe\x64\xe6\x67\x00\x28\xf3\x49\x32\x8d\xa0\xe7\x87\xe6\x0b\x1e\x79\x5a\x04\xaf\xae\x55\xe8\x10\xf5\x59\x6c\xaa\x69\xf5\xa4\x25\xa8\xa7\x97\x37\x4c\x9d\xb1\x60\x70\xd6\x8a\xfd\xa6\xeb\x97\x14\x3b\xc0\xc4\x2c\x69\x31\x70\x99\xe1\x72\x59\xb5\x72\xdd\x30\xb3\xf3\x6e\x74\xfe\x34\x1a\xf1\x4e\xca\xcd\x17\x3a\x80\xba\x30\x36\xb9\xb6\x58\xba\x8a\x3e\x3a\x5d\x85\x67\x2d\x79\xa3\x11\x67\xce\x26\x3d\x3c\xb5\x94\x3d\xc5\x87\xbc\xb6\x3d\x32\xad\x4e\x23\x8e\xc7\x7e\x2a\x7c\x91\x7f\x9a\xf2\x6d\xed\xe5\xfe\x5e\x04\xfa\xd7\x60\xcc\x24\x6c\xe9\x3b\x80\xdb\x9b\xfb\xbb\x01\xb8\x0e\xd7\xe1\x37\x00\x00\xff\xff\x7b\x5d\x79\x51\x2d\x01\x00\x00") + +func yaoStoresOauthCacheLruYaoBytes() ([]byte, error) { + return bindataRead( + _yaoStoresOauthCacheLruYao, + "yao/stores/oauth/cache.lru.yao", + ) +} + +func yaoStoresOauthCacheLruYao() (*asset, error) { + bytes, err := yaoStoresOauthCacheLruYaoBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "yao/stores/oauth/cache.lru.yao", size: 301, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _yaoStoresOauthClientBadgerYao = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x90\xb1\x4e\xc4\x30\x10\x44\xfb\x7c\xc5\x68\xeb\x43\x07\x6d\xba\x00\x7d\x24\xb8\x06\x21\x74\xda\xc4\x9b\x8b\x25\x9f\x1d\xd9\x9b\x22\x8a\xf2\xef\xc8\x36\xd7\xd2\xad\xc7\xf3\xbc\x9e\xd9\x1b\x80\x1c\x0f\xe2\xa8\x05\xf5\xdd\xaa\x33\xde\x9c\x15\xaf\xf8\xd4\x10\x85\x4e\xd9\x60\x24\x8d\xd1\x2e\x6a\x83\xcf\xb6\x57\x36\x37\x89\x4f\x03\x27\x31\x48\xd9\x86\x29\x44\x54\x7a\xac\xb4\xf5\x53\x88\x77\xce\x08\xd8\x1b\x8c\x51\x8c\x78\xb5\xec\x52\x7d\x53\xf9\x96\xa8\xc5\x37\x05\x5e\x75\xa6\x13\xa8\x92\x79\x1a\xca\x82\x3c\x25\x19\xd7\x68\x75\xa3\x9f\x02\x45\x61\x13\xbc\xdb\xa8\xc5\xc4\x2e\x49\x11\x87\xd5\x3a\xb5\xf9\x67\x1a\xd7\x2a\xa5\x10\x95\x5a\xbc\x3c\x97\x93\xe7\xbb\xfc\x17\x4f\xb7\xa5\xdc\x3f\xd6\x66\x2d\x3c\xd2\xe6\x86\x00\x5a\x58\xe7\xec\xd9\x77\x7c\x75\xfd\xf5\xbd\xbb\x74\xd7\x8f\xbe\xbf\xe0\x38\xce\xa5\x82\x74\x2e\x41\xce\x7f\x29\x1a\xe0\x68\x8e\xe6\x37\x00\x00\xff\xff\x10\x3a\xdc\xe7\x60\x01\x00\x00") + +func yaoStoresOauthClientBadgerYaoBytes() ([]byte, error) { + return bindataRead( + _yaoStoresOauthClientBadgerYao, + "yao/stores/oauth/client.badger.yao", + ) +} + +func yaoStoresOauthClientBadgerYao() (*asset, error) { + bytes, err := yaoStoresOauthClientBadgerYaoBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "yao/stores/oauth/client.badger.yao", size: 352, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _yaoStoresStoreBadgerYao = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x7c\x90\x41\x6b\xc3\x30\x0c\x85\xef\xf9\x15\x0f\x9d\x57\xc6\xae\xb9\x65\xf4\x1e\x58\x7b\x29\x63\x14\xa5\x51\xb3\x50\xc7\x0e\xb6\x52\x08\x21\xff\x7d\xc8\x59\xae\x3d\x59\xfe\xf4\xa4\xe7\xe7\xa5\x00\xc8\x71\x23\x8e\x4a\xd0\x69\x4e\x2a\x03\x8e\xac\x8c\x93\x86\x28\xf4\x66\xfd\x56\xd2\x2d\xf6\xa3\xf6\xc1\x9b\xea\x93\xdb\x4e\xe2\xa1\xe1\x24\x2d\x1e\x32\x1f\x9e\xec\x26\x41\xb2\x01\xdc\x43\xc4\x2d\x0c\x43\xf0\x68\x6d\x8d\x51\xee\x04\xbd\xc7\x85\x03\x52\x76\xd8\xd6\x2a\x77\x89\x4a\x7c\xd3\x0e\x41\xff\x6a\x2b\x9b\xec\x62\xd5\xe3\x49\x3f\x79\x20\x0a\xb7\xc1\xbb\x99\x4a\xdc\xd9\x25\xc9\xb0\x99\x7a\xa7\xbd\x3d\x4c\xe3\xb4\xa1\x14\xa2\x52\x89\x8f\x7c\xf1\x3c\xc8\x8b\x6c\x3a\x8f\xb9\xbd\xdb\x19\x0b\x7b\x54\xfb\x1d\x80\x46\xd6\x5f\xd3\x2c\x0b\x2e\x55\x7d\x3d\x56\xe7\xea\xfa\x55\xd7\x67\xac\xeb\x7b\x4e\x9d\xb6\x83\x0a\x60\x2d\xd6\xe2\x2f\x00\x00\xff\xff\xf5\x80\x51\x1b\x55\x01\x00\x00") + +func yaoStoresStoreBadgerYaoBytes() ([]byte, error) { + return bindataRead( + _yaoStoresStoreBadgerYao, + "yao/stores/store.badger.yao", + ) +} + +func yaoStoresStoreBadgerYao() (*asset, error) { + bytes, err := yaoStoresStoreBadgerYaoBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "yao/stores/store.badger.yao", size: 341, mode: os.FileMode(420), modTime: time.Unix(1752981303, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2239,6 +2365,12 @@ var _bindata = map[string]func() (*asset, error){ "yao/models/kb.mod.yao": yaoModelsKbModYao, "yao/models/user.mod.yao": yaoModelsUserModYao, "yao/release/app.yaz": yaoReleaseAppYaz, + "yao/stores/agent/cache.lru.yao": yaoStoresAgentCacheLruYao, + "yao/stores/agent/memory.badger.yao": yaoStoresAgentMemoryBadgerYao, + "yao/stores/cache.lru.yao": yaoStoresCacheLruYao, + "yao/stores/oauth/cache.lru.yao": yaoStoresOauthCacheLruYao, + "yao/stores/oauth/client.badger.yao": yaoStoresOauthClientBadgerYao, + "yao/stores/store.badger.yao": yaoStoresStoreBadgerYao, } // AssetDir returns the file names below a certain @@ -2475,6 +2607,18 @@ var _bintree = &bintree{nil, map[string]*bintree{ "release": {nil, map[string]*bintree{ "app.yaz": {yaoReleaseAppYaz, map[string]*bintree{}}, }}, + "stores": {nil, map[string]*bintree{ + "agent": {nil, map[string]*bintree{ + "cache.lru.yao": {yaoStoresAgentCacheLruYao, map[string]*bintree{}}, + "memory.badger.yao": {yaoStoresAgentMemoryBadgerYao, map[string]*bintree{}}, + }}, + "cache.lru.yao": {yaoStoresCacheLruYao, map[string]*bintree{}}, + "oauth": {nil, map[string]*bintree{ + "cache.lru.yao": {yaoStoresOauthCacheLruYao, map[string]*bintree{}}, + "client.badger.yao": {yaoStoresOauthClientBadgerYao, map[string]*bintree{}}, + }}, + "store.badger.yao": {yaoStoresStoreBadgerYao, map[string]*bintree{}}, + }}, }}, }} diff --git a/openapi/config.go b/openapi/config.go new file mode 100644 index 00000000..e97dd4da --- /dev/null +++ b/openapi/config.go @@ -0,0 +1,133 @@ +package openapi + +import ( + "errors" + + jsoniter "github.com/json-iterator/go" + "github.com/yaoapp/gou/store" + "github.com/yaoapp/yao/config" + "github.com/yaoapp/yao/openapi/oauth" + "github.com/yaoapp/yao/openapi/oauth/providers/client" + "github.com/yaoapp/yao/openapi/oauth/providers/user" + "github.com/yaoapp/yao/openapi/oauth/types" + "github.com/yaoapp/yao/share" +) + +// Validate validates the configuration +func (config *Config) Validate() error { + if config.Providers == nil { + return errors.New("providers is required") + } + + if config.BaseURL == "" { + return errors.New("baseurl is required") + } + + return nil +} + +// MarshalJSON JSON Marshaler +func (config *Config) MarshalJSON() ([]byte, error) { + return jsoniter.Marshal(config) +} + +// UnmarshalJSON JSON Unmarshaler +func (config *Config) UnmarshalJSON(data []byte) error { + return jsoniter.Unmarshal(data, config) +} + +// OAuthConfig converts the configuration to an OAuth configuration +func (config *Config) OAuthConfig(appConfig *config.Config) (*oauth.Config, error) { + var oauthConfig oauth.Config + + var prefix string = share.App.GetPrefix() + var providers *Providers = config.GetProviders() + + cacheStore, err := store.Get(string(providers.Cache)) + if err != nil { + return nil, err + } + + dataStore, err := store.Get(string(providers.Client)) + if err != nil { + return nil, err + } + + // Create the User provider + userProvider := user.NewDefaultUser(&user.DefaultUserOptions{ + Prefix: prefix, + Model: string(providers.User), + Cache: cacheStore, + TokenStore: dataStore, + }) + + // Create the Client provider + clientProvider, err := client.NewDefaultClient(&client.DefaultClientOptions{ + Prefix: prefix, + Store: dataStore, + Cache: cacheStore, + }) + + if err != nil { + return nil, err + } + + // Default OAuth configuration + if config.OAuth == nil { + config.OAuth = config.GetDefaultOAuthConfig() + } + + // Create the OAuth configuration + oauthConfig = oauth.Config{ + UserProvider: userProvider, + ClientProvider: clientProvider, + Cache: cacheStore, + Store: dataStore, + IssuerURL: config.BaseURL, + Signing: config.OAuth.Signing, + Token: config.OAuth.Token, + Security: config.OAuth.Security, + Client: config.OAuth.Client, + Features: config.OAuth.Features, + } + + return &oauthConfig, nil +} + +// GetDefaultOAuthConfig Get the default OAuth configuration +func (config *Config) GetDefaultOAuthConfig() *OAuth { + return &OAuth{ + Signing: types.SigningConfig{}, + Token: types.TokenConfig{}, + Security: types.SecurityConfig{}, + Client: types.ClientConfig{}, + Features: oauth.FeatureFlags{}, + } +} + +// GetProviders Get the providers from the configuration +func (config *Config) GetProviders() *Providers { + if config.Providers == nil { + config.Providers = &Providers{ + User: "__yao.user", + Cache: "__yao.oauth.cache", + Client: "__yao.oauth.client", + } + + return config.Providers + } + + if config.Providers.User == "" { + config.Providers.User = "__yao.user" + } + + if config.Providers.Cache == "" { + config.Providers.Cache = "__yao.oauth.cache" + } + + if config.Providers.Client == "" { + config.Providers.Client = "__yao.oauth.client" + } + + return config.Providers +} diff --git a/openapi/config_test.go b/openapi/config_test.go new file mode 100644 index 00000000..764d6c82 --- /dev/null +++ b/openapi/config_test.go @@ -0,0 +1 @@ +package openapi diff --git a/openapi/oauth/guard.go b/openapi/oauth/guard.go new file mode 100644 index 00000000..c90af7b3 --- /dev/null +++ b/openapi/oauth/guard.go @@ -0,0 +1 @@ +package oauth diff --git a/openapi/openapi.go b/openapi/openapi.go index 764d6c82..520d95b8 100644 --- a/openapi/openapi.go +++ b/openapi/openapi.go @@ -1 +1,52 @@ package openapi + +import ( + "path/filepath" + + "github.com/yaoapp/gou/application" + "github.com/yaoapp/yao/config" + "github.com/yaoapp/yao/openapi/oauth" + "github.com/yaoapp/yao/openapi/oauth/types" +) + +// Server is the OpenAPI server +var Server *OpenAPI = nil + +// OpenAPI is the OpenAPI server +type OpenAPI struct { + Config *Config // OpenAPI configuration + OAuth types.OAuth // OAuth service interface +} + +// Load loads the OpenAPI server from the configuration +func Load(appConfig *config.Config) (*OpenAPI, error) { + + var configPath string = filepath.Join("openapi", "openapi.yao") + var configRaw, err = application.App.Read(configPath) + if err != nil { + return nil, err + } + + // Parse the configuration + var config Config + err = application.Parse(configPath, configRaw, &config) + if err != nil { + return nil, err + } + + // Convert the configuration to an OAuth configuration + oauthConfig, err := config.OAuthConfig(appConfig) + if err != nil { + return nil, err + } + + // Create the OAuth service + oauthService, err := oauth.NewService(oauthConfig) + if err != nil { + return nil, err + } + + // Create the OpenAPI server + Server = &OpenAPI{Config: &config, OAuth: oauthService} + return Server, nil +} diff --git a/openapi/openapi_test.go b/openapi/openapi_test.go new file mode 100644 index 00000000..61701177 --- /dev/null +++ b/openapi/openapi_test.go @@ -0,0 +1,8 @@ +package openapi + +import ( + "testing" +) + +func TestLoad(t *testing.T) { +} diff --git a/openapi/types.go b/openapi/types.go new file mode 100644 index 00000000..13d35b14 --- /dev/null +++ b/openapi/types.go @@ -0,0 +1,33 @@ +package openapi + +import ( + "github.com/yaoapp/yao/openapi/oauth" + "github.com/yaoapp/yao/openapi/oauth/types" +) + +// Config is the configuration for the OpenAPI server +type Config struct { + BaseURL string `json:"baseurl" yaml:"baseurl"` + Providers *Providers `json:"providers,omitempty" yaml:"providers,omitempty"` + OAuth *OAuth `json:"oauth,omitempty" yaml:"oauth,omitempty"` +} + +// Provider is the provider for the OpenAPI server, and in the future will be refactored into a struct +type Provider string + +// Providers is the providers for the OpenAPI server +type Providers struct { + User Provider `json:"user,omitempty" yaml:"user,omitempty"` + Cache Provider `json:"cache,omitempty" yaml:"cache,omitempty"` + Client Provider `json:"client,omitempty" yaml:"client,omitempty"` +} + +// OAuth is the OAuth configuration for the OpenAPI server +type OAuth struct { + IssuerURL string `json:"issuer_url,omitempty" yaml:"issuer_url,omitempty"` + Signing types.SigningConfig `json:"signing,omitempty" yaml:"signing,omitempty"` + Token types.TokenConfig `json:"token,omitempty" yaml:"token,omitempty"` + Security types.SecurityConfig `json:"security,omitempty" yaml:"security,omitempty"` + Client types.ClientConfig `json:"client,omitempty" yaml:"client,omitempty"` + Features oauth.FeatureFlags `json:"features,omitempty" yaml:"features,omitempty"` +} diff --git a/share/app.go b/share/app.go index e0f6fed8..e167e207 100644 --- a/share/app.go +++ b/share/app.go @@ -10,3 +10,11 @@ func (app AppInfo) Public() AppInfo { app.Storage.S3 = nil return app } + +// GetPrefix Get the prefix of the app with the default value "yao_" +func (app AppInfo) GetPrefix() string { + if app.Prefix == "" { + return "yao_" + } + return app.Prefix +} diff --git a/store/store.go b/store/store.go index afd08287..7f181315 100644 --- a/store/store.go +++ b/store/store.go @@ -2,17 +2,52 @@ package store import ( "fmt" + "path/filepath" "strings" "github.com/yaoapp/gou/application" "github.com/yaoapp/gou/store" + "github.com/yaoapp/kun/log" "github.com/yaoapp/yao/config" + "github.com/yaoapp/yao/data" "github.com/yaoapp/yao/share" ) +var systemStores = map[string]string{ + "__yao.store": "yao/stores/store.badger.yao", // for common data store + "__yao.cache": "yao/stores/cache.lru.yao", // for common cache store + "__yao.oauth.client": "yao/stores/oauth/client.badger.yao", // for OAuth client store + "__yao.oauth.cache": "yao/stores/oauth/cache.lru.yao", // for OAuth cache store + "__yao.agent.memory": "yao/stores/agent/memory.badger.yao", // for agent memory store (for agent memory) + "__yao.agent.cache": "yao/stores/agent/cache.lru.yao", // for agent cache store (for agent cache) +} + +// replaceVars replaces template variables in the JSON string +// Supports {{ VAR_NAME }} syntax +func replaceVars(jsonStr string, vars map[string]string) string { + result := jsonStr + for key, value := range vars { + // Replace both {{ KEY }} and {{KEY}} patterns + patterns := []string{ + "{{ " + key + " }}", + "{{" + key + "}}", + } + for _, pattern := range patterns { + result = strings.ReplaceAll(result, pattern, value) + } + } + return result +} + // Load load store func Load(cfg config.Config) error { + // Load system stores + err := loadSystemStores(cfg) + if err != nil { + return err + } + // Ignore if the stores directory does not exist exists, err := application.App.Exists("stores") if err != nil { @@ -40,3 +75,31 @@ func Load(cfg config.Config) error { } return err } + +// loadSystemStores load system stores +func loadSystemStores(cfg config.Config) error { + for id, path := range systemStores { + raw, err := data.Read(path) + if err != nil { + return err + } + + // Replace template variables in the JSON string + source := string(raw) + if strings.Contains(source, "YAO_APP_ROOT") || strings.Contains(source, "YAO_DATA_ROOT") { + vars := map[string]string{ + "YAO_APP_ROOT": cfg.Root, + "YAO_DATA_ROOT": cfg.DataRoot, + } + source = replaceVars(source, vars) + } + + // Load store with the processed source + _, err = store.LoadSource([]byte(source), id, filepath.Join("__system", path)) + if err != nil { + log.Error("load system store %s error: %s", id, err.Error()) + return err + } + } + return nil +} diff --git a/store/store_test.go b/store/store_test.go index 4cb51b01..69e0fe9e 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -27,6 +27,14 @@ func check(t *testing.T) { assert.True(t, ids["cache"]) assert.True(t, ids["data"]) assert.True(t, ids["share"]) + + // System stores + assert.True(t, ids["__yao.store"]) + assert.True(t, ids["__yao.cache"]) + assert.True(t, ids["__yao.oauth.client"]) + assert.True(t, ids["__yao.oauth.cache"]) + assert.True(t, ids["__yao.agent.memory"]) + assert.True(t, ids["__yao.agent.cache"]) } func loadConnectors(t *testing.T) { diff --git a/test/utils.go b/test/utils.go index 402009b4..bdf93294 100644 --- a/test/utils.go +++ b/test/utils.go @@ -19,6 +19,7 @@ import ( "github.com/yaoapp/gou/query/gou" v8 "github.com/yaoapp/gou/runtime/v8" "github.com/yaoapp/gou/server/http" + "github.com/yaoapp/gou/store" "github.com/yaoapp/kun/exception" "github.com/yaoapp/kun/log" "github.com/yaoapp/xun/capsule" @@ -46,6 +47,58 @@ var testSystemModels = map[string]string{ "__yao.user": "yao/models/user.mod.yao", } +var testSystemStores = map[string]string{ + "__yao.store": "yao/stores/store.badger.yao", + "__yao.cache": "yao/stores/cache.lru.yao", + "__yao.oauth.client": "yao/stores/oauth/client.badger.yao", + "__yao.oauth.cache": "yao/stores/oauth/cache.lru.yao", + "__yao.agent.memory": "yao/stores/agent/memory.badger.yao", +} + +func loadSystemStores(t *testing.T, cfg config.Config) error { + for id, path := range testSystemStores { + raw, err := data.Read(path) + if err != nil { + return err + } + + // Replace template variables in the JSON string + source := string(raw) + if strings.Contains(source, "YAO_APP_ROOT") || strings.Contains(source, "YAO_DATA_ROOT") { + vars := map[string]string{ + "YAO_APP_ROOT": cfg.Root, + "YAO_DATA_ROOT": cfg.DataRoot, + } + source = replaceVars(source, vars) + } + + // Load store with the processed source + _, err = store.LoadSource([]byte(source), id, filepath.Join("__system", path)) + if err != nil { + log.Error("load system store %s error: %s", id, err.Error()) + return err + } + } + return nil +} + +// replaceVars replaces template variables in the JSON string +// Supports {{ VAR_NAME }} syntax +func replaceVars(jsonStr string, vars map[string]string) string { + result := jsonStr + for key, value := range vars { + // Replace both {{ KEY }} and {{KEY}} patterns + patterns := []string{ + "{{ " + key + " }}", + "{{" + key + "}}", + } + for _, pattern := range patterns { + result = strings.ReplaceAll(result, pattern, value) + } + } + return result +} + // loadSystemModels load system models for testing func loadSystemModels(t *testing.T, cfg config.Config) error { for id, path := range testSystemModels { @@ -203,6 +256,10 @@ func Prepare(t *testing.T, cfg config.Config, rootEnv ...string) { func Clean() { dbclose() runtime.Stop() + + // Remove the data store + var path = filepath.Join(os.Getenv("YAO_TEST_APPLICATION"), "data", "stores") + os.RemoveAll(path) } // Start the test server @@ -282,6 +339,7 @@ func startRuntime(t *testing.T, cfg config.Config) { func load(t *testing.T, cfg config.Config) { loadFS(t, cfg) + loadStore(t, cfg) loadScript(t, cfg) loadModel(t, cfg) loadConnector(t, cfg) @@ -345,6 +403,23 @@ func loadModel(t *testing.T, cfg config.Config) { } } +// loadStore load system stores for testing +func loadStore(t *testing.T, cfg config.Config) { + err := loadSystemStores(t, cfg) + if err != nil { + t.Fatal(err) + } + + exts := []string{"*.yao", "*.json", "*.jsonc"} + err = application.App.Walk("stores", func(root, file string, isdir bool) error { + if isdir { + return nil + } + _, err := store.Load(file, share.ID(root, file)) + return err + }, exts...) +} + func loadQuery(t *testing.T, cfg config.Config) { // query engine diff --git a/yao/stores/agent/cache.lru.yao b/yao/stores/agent/cache.lru.yao new file mode 100644 index 00000000..9784c569 --- /dev/null +++ b/yao/stores/agent/cache.lru.yao @@ -0,0 +1,13 @@ +{ + "label": "Agent Cache Store", + "description": "LRU cache store for agent temporary data and quick access memory", + "tags": ["agent", "cache", "lru", "ai"], + "readonly": false, + "builtin": true, + "sort": 21, + "name": "Agent Cache Store", + "type": "lru", + "option": { + "size": 4096 + } +} diff --git a/yao/stores/agent/memory.badger.yao b/yao/stores/agent/memory.badger.yao new file mode 100644 index 00000000..39e86be5 --- /dev/null +++ b/yao/stores/agent/memory.badger.yao @@ -0,0 +1,13 @@ +{ + "label": "Agent Memory Store", + "description": "Badger-based store for agent memory persistence and long-term storage", + "tags": ["agent", "memory", "badger", "ai"], + "readonly": false, + "builtin": true, + "sort": 20, + "name": "Agent Memory Store", + "type": "badger", + "option": { + "path": "{{ YAO_DATA_ROOT }}/stores/agent/memory" + } +} diff --git a/yao/stores/cache.lru.yao b/yao/stores/cache.lru.yao new file mode 100644 index 00000000..ac686532 --- /dev/null +++ b/yao/stores/cache.lru.yao @@ -0,0 +1,11 @@ +{ + "label": "System Cache Store", + "description": "LRU cache store for common caching in Yao system", + "tags": ["system", "cache", "lru", "memory"], + "readonly": false, + "builtin": true, + "sort": 2, + "name": "System Cache Store", + "type": "lru", + "option": { "size": 4096 } +} diff --git a/yao/stores/oauth/cache.lru.yao b/yao/stores/oauth/cache.lru.yao new file mode 100644 index 00000000..58208db4 --- /dev/null +++ b/yao/stores/oauth/cache.lru.yao @@ -0,0 +1,13 @@ +{ + "label": "OAuth Cache Store", + "description": "LRU cache store for OAuth tokens, sessions and temporary data", + "tags": ["oauth", "cache", "lru", "token"], + "readonly": false, + "builtin": true, + "sort": 11, + "name": "OAuth Cache Store", + "type": "lru", + "option": { + "size": 4096 + } +} diff --git a/yao/stores/oauth/client.badger.yao b/yao/stores/oauth/client.badger.yao new file mode 100644 index 00000000..35956da4 --- /dev/null +++ b/yao/stores/oauth/client.badger.yao @@ -0,0 +1,13 @@ +{ + "label": "OAuth Client Store", + "description": "Badger-based store for OAuth client information and credentials", + "tags": ["oauth", "client", "badger", "security"], + "readonly": false, + "builtin": true, + "sort": 10, + "name": "OAuth Client Store", + "type": "badger", + "option": { + "path": "{{ YAO_DATA_ROOT }}/stores/oauth/client" + } +} diff --git a/yao/stores/store.badger.yao b/yao/stores/store.badger.yao new file mode 100644 index 00000000..376fdf6e --- /dev/null +++ b/yao/stores/store.badger.yao @@ -0,0 +1,13 @@ +{ + "label": "System Data Store", + "description": "Badger-based key-value store for common data storage in Yao system", + "tags": ["system", "storage", "badger", "kv"], + "readonly": false, + "builtin": true, + "sort": 1, + "name": "System Data Store", + "type": "badger", + "option": { + "path": "{{ YAO_DATA_ROOT }}/stores/store" + } +}