agents: a new user's list is folded under Get started (Renzexi01)
Renzexi01 on X (一进来就这么复杂): a new user saw Get started and, under
it, every agent found on the computer at once. While the Get started card
shows and no agent is in use yet, the whole Agents list is folded under
it behind "Show all {n} agents" (en, zh, zh-TW, ja, de); the card's
second step already names the agents found, each connected in a click.
Once one is connected, or the card is put away, the list is as before:
the ones in use in view, the rest under "Show {n} more".
getting-started checks the list folded under the card, the button's
words and aria-expanded in every language, and the list back once an
agent is connected or the card put away. Tests whose fake state is a new
user with no agent in use, and which read the agents' rows, now set
guideHidden as a user past Get started has (account-arrange,
aside-native, agent-*, claude-picker-magpie-first, codex-accounts-via,
omp-profile-connect, picker-rail-current, picker-speeds, pop-phone-room,
reasonix-roles, snow-fields).
What was run, on mote through mote-run, at a9a82a1c3 (tree e91b8e625,
the same as this commit once its fixup was squashed in), on base
0872bc2a0:
- The whole GUI suite (node --test --test-concurrency=4
internal/gui/tests/*.test.cjs, both engines, every language), while
mote ran 14 other test processes: 18901 pass, 292 fail in 57 files.
- Those 57 files again at a9a82a1c3 (concurrency 2): 748 pass, 275 fail;
at 0872bc2a0: 756 pass, 267 fail. 43 files were red at both, most with
the same counts (model-chip-steady 40/40, usage-agents-hide 22/22,
segs-press-redraw 16/16, provider-fetch-again 14/14).
- Those 43 at origin/main e17b6cefc: 442 pass, 262 fail, the same files
with the same counts. Each has an open issue (among them #4388, #4566,
#3414, #5057, #5013, #4320, #4585, #4625).
- The 7 files red at a9a82a1c3 only, alone (concurrency 1): 79 of 82
pass at a9a82a1c3 (group-found-skip 1, name-suffix-remote 2), 76 of 82
at 0872bc2a0 (group-found-skip, images-codex-one 2, name-suffix-remote,
title-bar-tools 2): load, nothing red at the head alone that is not red
at the base alone. name-suffix-remote, red alone at both, is #5147;
group-found-skip is #4617.
- getting-started and group-switch-add-many at a9a82a1c3: 64 of 64 pass.
Broken by hand: app.js and plugins/routing/client.js put back to
0872bc2a0 (tests and i18n kept), the same two test files: 30 of 64 red.
getting-started went red in all 30 of its "Get started ticks from state"
cases ("no agent row in view under Get started").
Not tried: the real app with a fresh HOME (macOS, Linux WebKitGTK,
Windows), and the tray panel beyond the test's panel layout.
This commit is contained in:
@@ -793,6 +793,7 @@ function renderAgents() {
|
||||
// what is folded, and how many of them were hidden by hand
|
||||
label.textContent = showAllAgents ? t("Show less")
|
||||
: !unset.length ? t("{n} hidden agents", { n: byHand.length })
|
||||
: !used.length ? t("Show all {n} agents", { n: unset.length })
|
||||
: t("Show {n} more", { n: unset.length });
|
||||
more.setAttribute("aria-expanded", String(showAllAgents));
|
||||
};
|
||||
@@ -2864,9 +2865,14 @@ function arrangeAgents() {
|
||||
// having nothing to connect, once any is set
|
||||
const counts = all.some(connectable) ? onMagpie : agentUsed;
|
||||
const anyUsed = all.some((a) => !hidden.has(a.id) && counts(a));
|
||||
// a new user's first view is Get started alone: its second step names the
|
||||
// agents found here, each connected in a click, and the whole list is
|
||||
// folded under it until one is, a step at a time rather than every agent
|
||||
// at once (Renzexi01 on X: 一进来就这么复杂)
|
||||
const guiding = !anyUsed && !!guideShown();
|
||||
// what is set on it alone decides where one not hidden goes: pinned in view
|
||||
// by hand, one cleared stayed up among the set ones with nothing to say why
|
||||
const inView = (a) => !hidden.has(a.id) && (!anyUsed || agentUsed(a));
|
||||
const inView = (a) => !guiding && !hidden.has(a.id) && (!anyUsed || agentUsed(a));
|
||||
return { all, shown: all.filter(inView), folded: all.filter((a) => !inView(a)) };
|
||||
}
|
||||
|
||||
|
||||
@@ -572,6 +572,7 @@ const I18N = {
|
||||
"No agents found": "没有找到 Agent",
|
||||
"Install Claude Code, Codex, Gemini CLI, OpenCode… and magpie will list them here.": "安装 Claude Code、Codex、Gemini CLI、OpenCode 等之后,会列在这里。",
|
||||
"Show {n} more": "显示其余 {n} 个",
|
||||
"Show all {n} agents": "显示全部 {n} 个 Agent",
|
||||
"Show less": "收起",
|
||||
"Expand the list": "展开列表",
|
||||
"Collapse the list": "收起列表",
|
||||
@@ -5147,6 +5148,7 @@ const I18N = {
|
||||
"No agents found": "沒有找到 Agent",
|
||||
"Install Claude Code, Codex, Gemini CLI, OpenCode… and magpie will list them here.": "安裝 Claude Code、Codex、Gemini CLI、OpenCode 等之後,會列在這裡。",
|
||||
"Show {n} more": "顯示其餘 {n} 個",
|
||||
"Show all {n} agents": "顯示全部 {n} 個 Agent",
|
||||
"Show less": "收起",
|
||||
"Expand the list": "展開列表",
|
||||
"Collapse the list": "收起列表",
|
||||
@@ -9686,6 +9688,7 @@ const I18N = {
|
||||
"No agents found": "エージェントが見つかりません",
|
||||
"Install Claude Code, Codex, Gemini CLI, OpenCode… and magpie will list them here.": "Claude Code、Codex、Gemini CLI、OpenCode… をインストールすると、magpie がここに表示します。",
|
||||
"Show {n} more": "さらに {n} 件表示",
|
||||
"Show all {n} agents": "{n} 件のエージェントをすべて表示",
|
||||
"Show less": "表示を減らす",
|
||||
"Expand the list": "リストを広げる",
|
||||
"Collapse the list": "リストを畳む",
|
||||
@@ -14243,6 +14246,7 @@ const I18N = {
|
||||
"No agents found": "Keine Agenten gefunden",
|
||||
"Install Claude Code, Codex, Gemini CLI, OpenCode… and magpie will list them here.": "Installieren Sie Claude Code, Codex, Gemini CLI, OpenCode…, dann listet magpie sie hier auf.",
|
||||
"Show {n} more": "{n} weitere anzeigen",
|
||||
"Show all {n} agents": "Alle {n} Agents anzeigen",
|
||||
"Show less": "Weniger anzeigen",
|
||||
"Expand the list": "Liste aufklappen",
|
||||
"Collapse the list": "Liste einklappen",
|
||||
|
||||
@@ -14,7 +14,8 @@ function fixture() {
|
||||
{ ...base, id: "antigravity", name: "Antigravity", keyList: [], account: { agent: "antigravity", agentName: "Antigravity", user: logins[0].user, logins } },
|
||||
{ ...base, id: "relay", name: "Relay", keyList: Array.from({ length: 5 }, (_, i) => ({ id: `key-${i + 1}`, name: `Key ${i + 1}`, masked: `test-key-${i + 1}`, active: i === 0, on: i !== 2 })) },
|
||||
], presets: [], excluded: [], gateway: { running: false, window: true } };
|
||||
const state = { agents: ["alpha", "beta", "gamma"].map(id => ({ id, name: id, icon: "generic", path: "/fixture", fields: [] })), profiles: [], settings: { lang: "en", theme: "light" } };
|
||||
// Get started put away: under it a new user's agents are folded
|
||||
const state = { agents: ["alpha", "beta", "gamma"].map(id => ({ id, name: id, icon: "generic", path: "/fixture", fields: [] })), profiles: [], settings: { lang: "en", theme: "light", guideHidden: true } };
|
||||
const f = { providers, state, posted: [], failNext: false };
|
||||
const items = p => p.account ? p.account.logins : p.keyList;
|
||||
const id = (p, item) => p.account ? item.user : item.id;
|
||||
|
||||
@@ -24,7 +24,7 @@ function server(lang, posts, answer) {
|
||||
const json = (data, status = 200) => route.fulfill({ status, json: data });
|
||||
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` });
|
||||
if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
|
||||
if (url.pathname === "/api/state") return json({ ...state, settings: { lang, theme: "light" } });
|
||||
if (url.pathname === "/api/state") return json({ ...state, settings: { lang, theme: "light", guideHidden: true } });
|
||||
if (url.pathname === "/api/agents/connect/codex") {
|
||||
posts.push(url.pathname);
|
||||
return json(answer, 400);
|
||||
|
||||
@@ -25,7 +25,7 @@ const fresh = () => ({
|
||||
|
||||
function server(lang, posts) {
|
||||
let cur = fresh();
|
||||
const reply = (route) => route.fulfill({ json: { ...cur, settings: { lang, theme: "light" } } });
|
||||
const reply = (route) => route.fulfill({ json: { ...cur, settings: { lang, theme: "light", guideHidden: true } } });
|
||||
return async (route) => {
|
||||
const req = route.request(), url = new URL(req.url());
|
||||
const json = (data) => route.fulfill({ json: data });
|
||||
|
||||
@@ -35,7 +35,7 @@ const AGENTS = [
|
||||
];
|
||||
|
||||
function serve(lang, agents = AGENTS) {
|
||||
const state = { agents, profiles: [], settings: { lang, theme: "light" } };
|
||||
const state = { agents, profiles: [], settings: { lang, theme: "light", guideHidden: true } };
|
||||
return async (route) => {
|
||||
const url = new URL(route.request().url());
|
||||
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` });
|
||||
|
||||
@@ -30,7 +30,7 @@ function server(lang) {
|
||||
const json = (data) => route.fulfill({ json: data });
|
||||
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` });
|
||||
if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
|
||||
if (url.pathname === "/api/state") return json({ ...state(), settings: { lang, theme: "light" } });
|
||||
if (url.pathname === "/api/state") return json({ ...state(), settings: { lang, theme: "light", guideHidden: true } });
|
||||
if (url.pathname === "/api/usage/quotas") return json([]);
|
||||
if (url.pathname === "/api/groups") return json({ groups: [] });
|
||||
if (url.pathname === "/api/plugins") return json({ plugins: [] });
|
||||
|
||||
@@ -29,7 +29,7 @@ const crew = (on) => ({
|
||||
|
||||
function server(lang, answers) {
|
||||
let on = false;
|
||||
const st = () => ({ agents: [crew(on)], profiles: [], settings: { lang, theme: "light" } });
|
||||
const st = () => ({ agents: [crew(on)], profiles: [], settings: { lang, theme: "light", guideHidden: true } });
|
||||
return async (route) => {
|
||||
const url = new URL(route.request().url());
|
||||
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` });
|
||||
|
||||
@@ -26,7 +26,7 @@ const fresh = () => ({
|
||||
|
||||
function server(lang, posts) {
|
||||
let cur = fresh();
|
||||
const reply = (route) => route.fulfill({ json: { ...cur, settings: { lang, theme: "light" } } });
|
||||
const reply = (route) => route.fulfill({ json: { ...cur, settings: { lang, theme: "light", guideHidden: true } } });
|
||||
return async (route) => {
|
||||
const req = route.request(), url = new URL(req.url());
|
||||
const json = (data) => route.fulfill({ json: data });
|
||||
|
||||
@@ -41,7 +41,7 @@ function agents({ ultracode = "", effort = "", tierEffort = "", subEffort = "",
|
||||
const IDS = ["claude", "codex", "gemini", "opencode"];
|
||||
|
||||
function serve(first) {
|
||||
let state = { agents: agents(first), profiles: [], settings: { lang: "en", theme: "light" } };
|
||||
let state = { agents: agents(first), profiles: [], settings: { lang: "en", theme: "light", guideHidden: true } };
|
||||
return async (route) => {
|
||||
const req = route.request();
|
||||
const url = new URL(req.url());
|
||||
|
||||
@@ -21,7 +21,7 @@ for (const engine of ['chromium', 'webkit']) {
|
||||
{ key: 'image', label: 'image', value: 'magpie/art/gpt-image-1', options: [{ value: 'magpie/art/gpt-image-1', ref: 'art/gpt-image-1', label: 'GPT image' }] },
|
||||
],
|
||||
};
|
||||
const state = () => ({ agents: [a], profiles: [], settings: { lang, theme: 'light' } });
|
||||
const state = () => ({ agents: [a], profiles: [], settings: { lang, theme: 'light', guideHidden: true } });
|
||||
await page.route('**/*', async (route) => {
|
||||
const req = route.request(), url = new URL(req.url()), p = url.pathname;
|
||||
if (req.method() === 'POST') posts.push(p);
|
||||
@@ -81,7 +81,7 @@ for (const engine of ['chromium', 'webkit']) {
|
||||
native: { provider: 'connected', runtime: 'applied', fields: {} },
|
||||
fields: [{ key: 'model', label: 'model', value: 'native/current', options: [{ value: 'native/current', label: 'Current model' }, { value: 'magpie/relay/m1', ref: 'relay/m1', label: 'New model' }] }],
|
||||
};
|
||||
const current = () => ({ agents: [a], profiles: [], settings: { lang, theme: 'light' } });
|
||||
const current = () => ({ agents: [a], profiles: [], settings: { lang, theme: 'light', guideHidden: true } });
|
||||
await page.route('**/*', async route => {
|
||||
const req = route.request(), p = new URL(req.url()).pathname;
|
||||
if (req.method() === 'POST') posts.push({ path: p, body: req.postDataJSON() });
|
||||
|
||||
@@ -45,12 +45,12 @@ function server(lang, value, wired, sets) {
|
||||
const req = route.request(), url = new URL(req.url());
|
||||
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` });
|
||||
if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
|
||||
if (url.pathname === "/api/state") return route.fulfill({ json: { ...cur, settings: { lang, theme: "light" } } });
|
||||
if (url.pathname === "/api/state") return route.fulfill({ json: { ...cur, settings: { lang, theme: "light", guideHidden: true } } });
|
||||
if (url.pathname === "/api/set") {
|
||||
const body = req.postDataJSON();
|
||||
sets.push(body);
|
||||
cur = state(body.value, true);
|
||||
return route.fulfill({ json: { ...cur, settings: { lang, theme: "light" } } });
|
||||
return route.fulfill({ json: { ...cur, settings: { lang, theme: "light", guideHidden: true } } });
|
||||
}
|
||||
if (url.pathname === "/api/usage/quotas") return route.fulfill({ json: [] });
|
||||
if (url.pathname === "/api/groups") return route.fulfill({ json: { groups: [] } });
|
||||
|
||||
@@ -20,7 +20,7 @@ const state = (lang) => ({
|
||||
{ value: "codex/gpt-5.5", label: "GPT-5.5", note: "me@example.com · via magpie", group: "Codex", ref: "codex/gpt-5.5" },
|
||||
{ value: "relay/m1", label: "m1", ref: "relay/m1", note: "Relay · via magpie", group: "Relay" }] }] },
|
||||
],
|
||||
profiles: [], settings: { lang, theme: "light" },
|
||||
profiles: [], settings: { lang, theme: "light", guideHidden: true },
|
||||
});
|
||||
|
||||
function server(lang, posts) {
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
// models in a click. Each step is ticked from the state the server gives,
|
||||
// never from having been seen; the card goes once the first two are done,
|
||||
// and put away it stays away, kept in the settings, not the page's storage.
|
||||
// Renzexi01 on X (一进来就这么复杂): while the card shows, the agents'
|
||||
// list is folded under it, behind "Show all {n} agents", since its second
|
||||
// step names the ones found here; one connected, or the card put away,
|
||||
// and the list is in view as before.
|
||||
// Both engines, a wide and a narrow window and the panel, every language.
|
||||
// No backend, the API is faked here.
|
||||
const assert = require("node:assert/strict");
|
||||
@@ -101,10 +105,14 @@ async function open(browser, layout, lang, w, posts) {
|
||||
page.on("pageerror", (e) => page.errors.push(e.message));
|
||||
await page.route("**/*", server(lang, w, posts));
|
||||
await page.goto("http://magpie.test" + layout.url);
|
||||
await page.locator(".row.agent").first().waitFor();
|
||||
// folded under Get started, the rows are there but out of view
|
||||
await page.locator(".row.agent").first().waitFor({ state: "attached" });
|
||||
return { context, page };
|
||||
}
|
||||
|
||||
// the agents' rows in view, not folded under the list's Show more
|
||||
const inView = (page) => page.locator(".row.agent").evaluateAll((rs) => rs.filter((r) => !r.closest(".agent-fold")).map((r) => r.dataset.id || r.id));
|
||||
const folded = (page) => page.locator(".agent-fold .row.agent").count();
|
||||
const stepDone = (page, step) => page.locator(`.guide-step[data-step="${step}"]`).evaluate((e) => e.classList.contains("done"));
|
||||
const tops = (page) => page.evaluate(() => [document.scrollingElement.scrollTop, document.querySelector("#view-agents")?.scrollTop]);
|
||||
const sideways = (page) => page.evaluate(() => {
|
||||
@@ -139,6 +147,15 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
assert.ok(await page.locator(".guide-agent").evaluateAll((bs) => bs.every((b) => b.disabled)));
|
||||
// routing waits for a model source: no button yet
|
||||
assert.equal(await page.locator(".guide-tpl").count(), 0);
|
||||
// the card alone, the list folded under it
|
||||
assert.deepEqual(await inView(page), [], "no agent row in view under Get started");
|
||||
assert.equal(await folded(page), 5);
|
||||
if (layout.name !== "panel") {
|
||||
const more = page.locator(".agent-more");
|
||||
assert.equal((await more.textContent()).trim(), await tr("Show all {n} agents", { n: 5 }));
|
||||
if (lang !== "en") assert.notEqual(await tr("Show all {n} agents"), "Show all {n} agents", `${lang} has "Show all {n} agents"`);
|
||||
assert.equal(await more.getAttribute("aria-expanded"), "false");
|
||||
}
|
||||
assert.equal(await sideways(page), false, "nothing runs off sideways");
|
||||
if (shots && (lang === "en" || lang === "zh")) await page.screenshot({ path: path.join(shots, `getting-started-${engine}-${lang}-${layout.name}-new.png`) });
|
||||
|
||||
@@ -185,10 +202,12 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
assert.deepEqual(await tops(page), before, "no click moved the page");
|
||||
assert.equal(top[0], before[0]);
|
||||
|
||||
// done stays done: a reload brings no card back
|
||||
// done stays done: a reload brings no card back, and the agent
|
||||
// connected is in view, the rest folded as for anyone
|
||||
await page.goto("http://magpie.test" + layout.url);
|
||||
await page.locator(".row.agent").first().waitFor();
|
||||
assert.equal(await page.locator(".guide").count(), 0);
|
||||
assert.equal(await folded(page), 4);
|
||||
assert.deepEqual(page.errors, []);
|
||||
});
|
||||
|
||||
@@ -204,6 +223,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
await page.locator(".guide").waitFor({ state: "detached" });
|
||||
assert.ok(posts.includes("/api/settings/guide"));
|
||||
assert.equal(w.hidden, true);
|
||||
// put away, the list is in view as it was before there was a card
|
||||
assert.equal(await folded(page), 0);
|
||||
assert.deepEqual(await tops(page), top, "no click moved the page");
|
||||
assert.deepEqual(page.errors, []);
|
||||
await first.context.close();
|
||||
|
||||
@@ -22,7 +22,7 @@ const fresh = () => ({
|
||||
|
||||
function server(posts) {
|
||||
let cur = fresh();
|
||||
const reply = (route) => route.fulfill({ json: { ...cur, settings: { lang: "en", theme: "light" } } });
|
||||
const reply = (route) => route.fulfill({ json: { ...cur, settings: { lang: "en", theme: "light", guideHidden: true } } });
|
||||
return async (route) => {
|
||||
const url = new URL(route.request().url());
|
||||
const json = (data) => route.fulfill({ json: data });
|
||||
|
||||
@@ -23,7 +23,7 @@ const options = [
|
||||
];
|
||||
const state = (wired, value) => ({
|
||||
agents: [{ id: "codex", name: "Codex", path: "/test/config.toml", icon: "codex-color", wired, fields: [{ key: "model", label: "model", value, options }] }],
|
||||
profiles: [], settings: { lang: "en", theme: "light" },
|
||||
profiles: [], settings: { lang: "en", theme: "light", guideHidden: true },
|
||||
});
|
||||
|
||||
function serve(st) {
|
||||
|
||||
@@ -37,7 +37,7 @@ function serve(lang) {
|
||||
const url = new URL(route.request().url());
|
||||
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:${JSON.stringify(lang)},theme:"light",web:true};` });
|
||||
if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
|
||||
if (url.pathname === "/api/state") return route.fulfill({ json: { agents: [{ id: "codex", name: "Codex", path: "/test/config.toml", icon: "codex-color", wired: false, fields: [{ key: "model", label: "model", value: "kimi/k3", options }] }], profiles: [], settings: { lang, theme: "light" } } });
|
||||
if (url.pathname === "/api/state") return route.fulfill({ json: { agents: [{ id: "codex", name: "Codex", path: "/test/config.toml", icon: "codex-color", wired: false, fields: [{ key: "model", label: "model", value: "kimi/k3", options }] }], profiles: [], settings: { lang, theme: "light", guideHidden: true } } });
|
||||
if (url.pathname === "/api/model-speeds") return route.fulfill({ json: speeds });
|
||||
if (url.pathname === "/api/agents/cli") return route.fulfill({ json: { agents: {}, pending: false } });
|
||||
if (url.pathname === "/api/groups") return route.fulfill({ json: { groups: [] } });
|
||||
|
||||
@@ -21,7 +21,7 @@ function server(lang) {
|
||||
const url = new URL(route.request().url());
|
||||
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` });
|
||||
if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
|
||||
if (url.pathname === "/api/state") return route.fulfill({ json: { ...state, settings: { lang, theme: "light" } } });
|
||||
if (url.pathname === "/api/state") return route.fulfill({ json: { ...state, settings: { lang, theme: "light", guideHidden: true } } });
|
||||
if (url.pathname === "/api/usage/quotas") return route.fulfill({ json: [] });
|
||||
if (url.pathname === "/api/groups") return route.fulfill({ json: { groups: [] } });
|
||||
if (url.pathname === "/api/agents/cli") return route.fulfill({ json: { agents: {}, pending: false } });
|
||||
|
||||
@@ -33,7 +33,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
const roleText = { executor: "执行模型", planner: "规划模型" };
|
||||
const labelText = (l) => (lang === "zh" ? roleText[l] : l);
|
||||
const posts = [];
|
||||
const state = () => ({ agents: [{ id: "reasonix", name: "Reasonix Studio", icon: "reasonix-color", path: "/fixture/config.toml", wired: fields.some((f) => f.value.startsWith("magpie/")), fields }], profiles: [], settings: { lang, theme: "light" } });
|
||||
const state = () => ({ agents: [{ id: "reasonix", name: "Reasonix Studio", icon: "reasonix-color", path: "/fixture/config.toml", wired: fields.some((f) => f.value.startsWith("magpie/")), fields }], profiles: [], settings: { lang, theme: "light", guideHidden: true } });
|
||||
await page.addInitScript(() => localStorage.setItem("magpie.modelFavorites", '["a/pro"]'));
|
||||
await page.route("**/*", async (route) => {
|
||||
const url = new URL(route.request().url());
|
||||
|
||||
@@ -34,7 +34,7 @@ function server(lang, ours) {
|
||||
const req = route.request(), url = new URL(req.url());
|
||||
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:true};` });
|
||||
if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
|
||||
if (url.pathname === "/api/state") return route.fulfill({ json: { agents: [snow(ours)], profiles: [], settings: { lang, theme: "light" } } });
|
||||
if (url.pathname === "/api/state") return route.fulfill({ json: { agents: [snow(ours)], profiles: [], settings: { lang, theme: "light", guideHidden: true } } });
|
||||
if (url.pathname === "/api/usage/quotas") return route.fulfill({ json: [] });
|
||||
if (url.pathname === "/api/groups") return route.fulfill({ json: { groups: [] } });
|
||||
if (url.pathname === "/api/plugins") return route.fulfill({ json: { plugins: [] } });
|
||||
|
||||
Reference in New Issue
Block a user