library: the keep-here switch says sync, and is on while it syncs (bin.90)
bin.90 on Discord read the Library editor's 「只在这台电脑」 switch as a
LAN-sharing switch: "this computer only" says nothing about what it keeps
from where. It is about sync, so it now says so.
- Library editor (MCP servers, skills): the switch is "Sync to your other
computers" (同步到其他电脑 / 同步到其他電腦 / ほかのコンピュータと同期 /
Mit deinen anderen Computern synchronisieren), on while the server or
skill syncs. Its note says off keeps it here, and a sync from the
others neither removes it nor replaces it.
- The stored value keeps its meaning: `local` true is still kept here.
The switch shows !local and saves !on, so every saved library.json,
sync payload and CLI flag (`magpie library mcp local NAME on|off`)
means what it meant.
- Row tag: "Not synced" (不同步 / 同步しない / Nicht synchronisiert) where
it said "This computer only", in the Library, the TUI ("not synced ·")
and `magpie library` output.
- Agents page sibling (the same words for an agent's picks): its menu
item is "Don't sync picks to your other computers", its tag "Not
synced". The agentsHere setting is unchanged.
- docs/subsystems/library.md and sync-backup.md name the new labels.
app.js stays in its budget: origin/main 8af751987 was already 31 bytes
over coreScriptBudget (1,533,833 > 1,533,802), so a comment in
setAgentHidden was cut to one line (core 1,533,756 now), no raise.
Run on mote, rebased on 8af751987, budget again at 2cfeda3d3:
- GUI: mcp-local-server, agent-here, i18n-keys, skill-off-here: 78/78
before the rebase, in Chromium and WebKit, every language, at 390, 640
and 1100 wide and in the panel; after it agent-here, i18n-keys and
mcp-local-server 56/56, agent-here again 30/30 after the trim.
- go test ./internal/tui ./internal/cli ok; ./internal/gui ok except
TestMainWindowCorners/macOS_26_SDK, mote's macOS 27 (#3949, open,
the same without this change); TestCoreScriptBudget ok after the trim.
- go vet ./internal/tui ./internal/cli ./internal/gui; GOOS=linux go vet
-tags nogui and GOOS=windows go vet of tui and cli; gofmt -l clean.
Broken by hand: saving `d.local = on` (no negation) turns
mcp-local-server red (expected 'false', got 'true').
Not tried: a real sync between two computers with the switch flipped;
the stored value's meaning is checked through the saved request only.
This commit is contained in:
@@ -69,7 +69,7 @@ agents RTK, a CLI that cuts shell output down before the model reads it.
|
||||
- Discover's featured list is the same with nothing set up: one of magpie's own whose model or search isn't there yet, or which Settings turned off, carries `unready` (`gateway.OwnUnready`, set by the GUI's `/api/library/market/servers`), shown as a Not set up yet badge on its card and the full reason in its sheet. It can still be added, since it answers once that is set up, and until then its tools answer with the same reason, so no agent is given a tool that fails without a word.
|
||||
- A carried library (`Collect`) has every file of each skill, its templates and other binaries included, up to `maxCarried` (16 MiB) a file and `maxCarriedAll` (32 MiB) in all, chosen smallest first across the skills (`readSkills`), so every skill's text goes before any big file. The total keeps a sealed backup under the 64 MiB a sync reads: the files are base64 twice in it. What is left out is named in `Left`, and `Put` keeps this computer's copy of such a file in the skill it puts (`keepLeft`). [`carry.go`](../../internal/library/carry.go)
|
||||
- A skill can be turned off on this computer alone (`OffHere`, `SkillHere`; the row's power button, `magpie library skill off-here <name>` and `on-here`; hanslin1666 on Discord). No agent here gets it, whatever its `Agents` say (`gives`, which every reader of `Agents` for giving goes through: `syncSkills`, `desktop_skills.go`, `skill_changed.go`, `skill_edits.go`, `behind`, `Targets`). `Agents` stays what a sync carries, and the page leaves its chips as they are, faded. `Collect` never carries `OffHere`, so turning it off changes no part a sync uploads, and `Put` keeps this computer's `OffHere` for a skill it puts, so a sync from a computer that has it on, or gives it to more agents, never turns it on here. A library.json from before has no `offHere` and every skill stays on. Not covered: a project's skills; a library skill kept in `~/.agents/skills`, which agents read in place, until it is handed over (below); and a skill another computer removes, which takes the flag with it. [`skills.go`](../../internal/library/skills.go), [`carry.go`](../../internal/library/carry.go)
|
||||
- An MCP server can be kept to this computer (`Server.Local`; the editor's "This computer only" switch, `magpie library mcp add --local`, `magpie library mcp local <name> on|off`; huhuy72219405 on X). `Collect` never carries it (`carriedServers`), so a sync or a backup file never takes it to another computer, and turning a shared server local takes it out of what is carried: the other computers drop it at their next sync. `Put` (sync, join, Restore, Undo, a backup file) keeps every local server here, with its agents, and clears `Local` on what comes in (`putServers`). Another computer's server by the name of a local one doesn't take its place: it goes to `Library.Away`, given to no agent, not in the router, not checked, and carried on as it came, so a push from here never takes it from the computers that have it. `settleAway` runs on every change: while the name is local here the away copy stays; once no server of that name is left here (removed or renamed) it comes in as a sync would bring it; once a shared server has the name (local turned off) this computer's is the one carried. The router serves local servers like any other, since it runs on this computer. A carried subagent names its servers, a local one too; a computer without that server leaves it out of the agents' files, as any server the library hasn't. The TUI keeps the flag on edit and marks the row. (`TestLocalServerNotCarried`, `TestPutKeepsLocalServer`, `TestPutSameNameAsLocal`, `TestRestoreKeepsLocalServer`, `TestLocalServerThroughSync`, `mcp-local-server.test.cjs`) [`mcp_local.go`](../../internal/library/mcp_local.go), [`carry.go`](../../internal/library/carry.go)
|
||||
- An MCP server can be kept to this computer (`Server.Local`; the editor's "Sync to your other computers" switch, off for a local one (it said "This computer only", which bin.90 on Discord read as sharing), the row tagged "Not synced", `magpie library mcp add --local`, `magpie library mcp local <name> on|off`; huhuy72219405 on X). `Collect` never carries it (`carriedServers`), so a sync or a backup file never takes it to another computer, and turning a shared server local takes it out of what is carried: the other computers drop it at their next sync. `Put` (sync, join, Restore, Undo, a backup file) keeps every local server here, with its agents, and clears `Local` on what comes in (`putServers`). Another computer's server by the name of a local one doesn't take its place: it goes to `Library.Away`, given to no agent, not in the router, not checked, and carried on as it came, so a push from here never takes it from the computers that have it. `settleAway` runs on every change: while the name is local here the away copy stays; once no server of that name is left here (removed or renamed) it comes in as a sync would bring it; once a shared server has the name (local turned off) this computer's is the one carried. The router serves local servers like any other, since it runs on this computer. A carried subagent names its servers, a local one too; a computer without that server leaves it out of the agents' files, as any server the library hasn't. The TUI keeps the flag on edit and marks the row. (`TestLocalServerNotCarried`, `TestPutKeepsLocalServer`, `TestPutSameNameAsLocal`, `TestRestoreKeepsLocalServer`, `TestLocalServerThroughSync`, `mcp-local-server.test.cjs`) [`mcp_local.go`](../../internal/library/mcp_local.go), [`carry.go`](../../internal/library/carry.go)
|
||||
- A skill brought in from a link into a folder an app keeps per version (ego lite's framework `Versions/<v>`, #2635) is linked through the app's own steady link, or through `Versions/Current` when Current is that version (`linkVia`, `currentVersion`; `TestImportedSkillFollowsAppUpdate`, `TestImportedSkillThroughVersionsCurrent`). One brought in before that links straight to `Versions/<old>`, which the app's update deletes (tjhhhh on Discord). Every read of the page (looking at each link once, `readParts`, and starting that over when a link was mended) and the first step of every sync mend such links (`followMovedSkills`): a library skill that is a link, whose target isn't there, and whose first missing part is named like a version (`versionName`) is linked to the same place under that folder's `Current`, `current` or `latest` link, else under the highest version beside it that has a `SKILL.md` there (`movedVersion`, `versionLess`); one whose target is in `Versions/<v>` while the bundle's `Versions/Current` is a link to another version with the same skill is linked through Current (`laterCurrent`). `Source.Dir` follows. Only the library's link is replaced (`os.Remove` of the link, then `dirLink`; put back as it was when the new link can't be made). A folder of the library's own, a link to a folder the user deleted that isn't a version (shown missing as before) and the app's old version folder are left as they are (`TestOldImportFollowsDeletedVersion`, `TestOldImportFollowsVersionsCurrent`, `TestOldImportFollowsHighestVersion`, `TestMovedSkillsLeaveTheRest`). [`skill_moved.go`](../../internal/library/skill_moved.go)
|
||||
- A skill kept in `~/.agents/skills` is handed over to the library on the user's click (`HandOverSkills`, `POST /api/library/skills/hand-over` with `names`; the row's Manage in magpie in its source line, Manage {n} in magpie in the skills' heading, each asking first; `magpie library skill hand-over <name…>|--all`; tnt1223 on Discord). "Kept there" is `sharedEntry`: the entry in that folder that is the library skill's own folder, by its name or, for a library link into it under another folder's name, by that folder's (`SkillView.Shared`; `SharedElsewhere` when the entry only links to a folder kept elsewhere). Every reader of `sharedHas`/`sharedEntry` follows: `Always`, `syncSkills`' `inShared`, and the shared folder's own target (Goose, Kimi Code, Cindy), which is given no second link beside such an entry (`TestSharedUnderAnotherName`). Handed over, a folder in `~/.agents/skills` moves into the library's skills folder (`moveIn`: renamed, or copied, read back the same with `sameTree` and only then set aside with the backups; a failure leaves it where it was and the library's link as it was, `TestHandOverFailureKeepsOriginal`), and an entry that only links elsewhere is taken away while the library links past it to that folder. The user's own links to it in agents' folders, which would point at nothing, go too. Every agent here that read it (`readsSharedHere`, and the agent of each such link) is ticked, so each keeps it, now from the library, till it is unticked or turned off here. A skill found there and not in the library yet is brought in first. One that can't be handed over is left as it was, in `Result.Unmoved`, and the others are handed over all the same. `HandBackSkill` (`magpie library skill hand-back <name>`, CLI only; the sheet names it) moves the folder back and links the library to it, its ticks as they are. Not covered: another computer whose skill is still in its own `~/.agents/skills` gets the library's copy from a sync beside its own, until it is handed over there too; and the skills CLI's lock (`npx skills update`) may put the entry back (`TestHandOverSharedFolder`, `TestHandOverSharedLink`, `TestHandOverFound`, `TestHandOverWithGoose`, `TestLibrarySkillHandOver`, `skill-handover.test.cjs`). [`skill_handover.go`](../../internal/library/skill_handover.go)
|
||||
- The agents that read `~/.agents/skills` themselves are `readsShared` (Codex, Gemini CLI, OpenCode, DevEco Code, Crush, dsh, Command Code, Devin, Droid, Cline, Grok Build, Grok App, fx, Alma, Kimi Code and OmO) and, from the version that started to, `Target.SharedToo`: Pi from 0.54.0 (its CHANGELOG; `userAgentsSkillsDir` in package-manager.js) and omp from 11.0.0 (`discovery/agents.ts`; 10.6.2 doesn't). OmO runs on senpi, whose oldest version on npm (0.74.0) already reads it. A Pi or omp whose version isn't known is taken as older, as before. Every reader goes through `Target.readsSharedDir`: `Always` (the row's lock), `syncSkills`' `inShared` (no second link in its own folder) and `readsSharedHere` for a handover (usrname1833 on Discord; `TestPiReadsSharedSkillsFromItsVersion`).
|
||||
|
||||
@@ -80,8 +80,10 @@ three maps survive a change of server (`TestOwnModelStaysOnEachComputer`,
|
||||
`TestNewPicksStillGoBothWays`, `sync-own-fields.test.cjs`).
|
||||
|
||||
A whole agent's picks can be kept to one computer on purpose, as an MCP
|
||||
server can (chenxiang0010 on Discord): the Agents row's menu has **This
|
||||
computer only** (`POST /api/agents/here`), which adds the agent's id to
|
||||
server can (chenxiang0010 on Discord): the Agents row's menu has **Don't sync
|
||||
picks to your other computers** (`POST /api/agents/here`; the row says
|
||||
"Not synced"; it said "This computer only", which read as sharing, bin.90
|
||||
on Discord), which adds the agent's id to
|
||||
`Settings.AgentsHere`, a computer's own kept by `KeepOwn` and by a save of
|
||||
the Settings page (`settingsapi.Apply`). It is off by default, so an upgrade
|
||||
changes no pick anywhere. For each such agent, `withHere` adds `<id>.*` to
|
||||
|
||||
@@ -451,7 +451,7 @@ func libraryStatus() error {
|
||||
}
|
||||
fmt.Printf(" %s %s → %s\n", bold.Render(s.Name), muted.Render(what), on(s.Agents))
|
||||
if s.Local {
|
||||
fmt.Println(" ", muted.Render("this computer only: a sync never carries it · magpie library mcp local "+s.Name+" off"))
|
||||
fmt.Println(" ", muted.Render("not synced: a sync never carries it to your other computers · magpie library mcp local "+s.Name+" off"))
|
||||
}
|
||||
if s.Hub == library.HubDirect {
|
||||
fmt.Println(" ", muted.Render("direct: each agent's own entry, never through the hub · magpie library mcp hub "+s.Name+" shared"))
|
||||
|
||||
@@ -673,7 +673,7 @@ function renderAgents() {
|
||||
else if (!kind && a.appRestart) who.append(appRestart(a));
|
||||
// the CLI's version and its update (#202)
|
||||
if (mode !== "panel") who.append(cliTag(a));
|
||||
if (mode !== "panel" && isHere(a)) who.append(Object.assign(el("span", "ag-missing ag-here", t(HERE)), { title: t(HERE_TIP, { agent: a.name }) }));
|
||||
if (mode !== "panel" && isHere(a)) who.append(Object.assign(el("span", "ag-missing ag-here", t(HERE_TAG)), { title: t(HERE_TIP, { agent: a.name }) }));
|
||||
// which of magpie's models its lists show, on a line under the name
|
||||
if (mode !== "panel" && a.models && !kind) {
|
||||
const line = el("div", "ag-models-line");
|
||||
@@ -3058,7 +3058,7 @@ function moveAgent(id, to) {
|
||||
saveArrangement([...ids, ...folded.map((a) => a.id)], hiddenIds(), []);
|
||||
}
|
||||
|
||||
const HERE = "This computer only", HERE_TIP = "{agent}'s picks (model, effort…) stay as set here: sync, a Restore and a backup file neither bring another computer's in nor take these to the others";
|
||||
const HERE = "Don't sync picks to your other computers", HERE_TAG = "Not synced", HERE_TIP = "{agent}'s picks (model, effort…) stay as set here: sync, a Restore and a backup file neither bring another computer's in nor take these to the others";
|
||||
const HERE_GLYPH = "M3.5 4.5h9v6h-9zM2 12.5h12";
|
||||
const isHere = (a) => !!state.settings?.agentsHere?.includes(a.id);
|
||||
async function setAgentHere(a, on) {
|
||||
@@ -3077,9 +3077,7 @@ function setAgentHidden(a, hide) {
|
||||
// the rows that change go on the panel's edge, as the fold does
|
||||
agentsGlide = hide ? ROLLUP : UNROLL;
|
||||
saveArrangement(all.map((x) => x.id), hidden, []);
|
||||
// hidden, it says where it went, since the row goes out of sight; shown
|
||||
// with nothing set on it, it stays folded under Not set up, and says why:
|
||||
// one with a switch until it is connected
|
||||
// hidden, it says where it went; shown unset, why it stays folded
|
||||
const still = !hide && arrangeAgents().folded.includes(a);
|
||||
const until = connectable(a) ? "{agent} is no longer hidden · it stays under Not set up until it is connected"
|
||||
: "{agent} is no longer hidden · it stays under Not set up until a model is picked for it";
|
||||
|
||||
@@ -2838,7 +2838,8 @@ const I18N = {
|
||||
"This backup's settings use {names}, which isn't signed in on this computer. A backup carries settings, not sign-ins: to use it here, sign in in Providers → Add a provider; if you don't, nothing needs doing.": "这份备份的设置用到了 {names},但本机尚未登录。备份只带设置,不带登录信息:要在本机使用,请在 供应商 → 添加供应商 中登录;不在本机使用可忽略。",
|
||||
"{agent} {field}": "{agent} {field}",
|
||||
"Kept on this computer": "仅本机保留",
|
||||
"This computer only": "只在这台电脑",
|
||||
"Don't sync picks to your other computers": "不把选择同步到其他电脑",
|
||||
"Not synced": "不同步",
|
||||
"{agent}'s picks (model, effort…) stay as set here: sync, a Restore and a backup file neither bring another computer's in nor take these to the others": "{agent} 的选择(模型、推理强度…)保持这台电脑所设:同步、恢复和备份文件都不会带入其他电脑的选择,也不会把这里的带给其他电脑",
|
||||
"{agent}'s picks stay on this computer": "{agent} 的选择只在这台电脑生效",
|
||||
"{agent}'s picks sync with your other computers again": "{agent} 的选择重新与你的其他电脑同步",
|
||||
@@ -7296,7 +7297,8 @@ const I18N = {
|
||||
"This backup's settings use {names}, which isn't signed in on this computer. A backup carries settings, not sign-ins: to use it here, sign in in Providers → Add a provider; if you don't, nothing needs doing.": "這份備份的設定用到了 {names},但本機尚未登入。備份只帶設定,不帶登入資訊:要在本機使用,請在 供應商 → 新增供應商 中登入;不在本機使用可忽略。",
|
||||
"{agent} {field}": "{agent} {field}",
|
||||
"Kept on this computer": "僅本機保留",
|
||||
"This computer only": "只在這台電腦",
|
||||
"Don't sync picks to your other computers": "不把選擇同步到其他電腦",
|
||||
"Not synced": "不同步",
|
||||
"{agent}'s picks (model, effort…) stay as set here: sync, a Restore and a backup file neither bring another computer's in nor take these to the others": "{agent} 的選擇(模型、推理強度…)維持這台電腦所設:同步、還原和備份檔都不會帶入其他電腦的選擇,也不會把這裡的帶到其他電腦",
|
||||
"{agent}'s picks stay on this computer": "{agent} 的選擇只在這台電腦生效",
|
||||
"{agent}'s picks sync with your other computers again": "{agent} 的選擇重新與你的其他電腦同步",
|
||||
@@ -11753,7 +11755,8 @@ const I18N = {
|
||||
"This backup's settings use {names}, which isn't signed in on this computer. A backup carries settings, not sign-ins: to use it here, sign in in Providers → Add a provider; if you don't, nothing needs doing.": "このバックアップの設定は {names} を使っていますが、このコンピュータではまだサインインしていません。バックアップに含まれるのは設定だけで、サインイン情報は含まれません。ここで使うなら プロバイダ → プロバイダを追加 でサインインしてください。使わないなら何もしなくて構いません。",
|
||||
"{agent} {field}": "{agent} の{field}",
|
||||
"Kept on this computer": "このコンピュータだけで保持",
|
||||
"This computer only": "このコンピュータだけ",
|
||||
"Don't sync picks to your other computers": "選択をほかのコンピュータと同期しない",
|
||||
"Not synced": "同期しない",
|
||||
"{agent}'s picks (model, effort…) stay as set here: sync, a Restore and a backup file neither bring another computer's in nor take these to the others": "{agent} の選択(モデル、推論レベル…)はこのコンピュータでの設定のままです。同期、復元、バックアップファイルはほかのコンピュータの選択を持ち込まず、ここの選択もほかへ送りません",
|
||||
"{agent}'s picks stay on this computer": "{agent} の選択はこのコンピュータだけで有効です",
|
||||
"{agent}'s picks sync with your other computers again": "{agent} の選択はふたたびほかのコンピュータと同期されます",
|
||||
@@ -16221,7 +16224,8 @@ const I18N = {
|
||||
"This backup's settings use {names}, which isn't signed in on this computer. A backup carries settings, not sign-ins: to use it here, sign in in Providers → Add a provider; if you don't, nothing needs doing.": "Die Einstellungen dieser Sicherung nutzen {names}, auf diesem Computer aber nicht angemeldet. Eine Sicherung enthält Einstellungen, keine Anmeldungen: Um es hier zu nutzen, melde dich unter Anbieter → Anbieter hinzufügen an; sonst ist nichts zu tun.",
|
||||
"{agent} {field}": "{agent}: {field}",
|
||||
"Kept on this computer": "Nur auf diesem Computer",
|
||||
"This computer only": "Nur dieser Computer",
|
||||
"Don't sync picks to your other computers": "Auswahl nicht mit deinen anderen Computern synchronisieren",
|
||||
"Not synced": "Nicht synchronisiert",
|
||||
"{agent}'s picks (model, effort…) stay as set here: sync, a Restore and a backup file neither bring another computer's in nor take these to the others": "Die Auswahl für {agent} (Modell, Reasoning-Effort …) bleibt, wie sie hier eingestellt ist: Synchronisierung, Wiederherstellen und Sicherungsdateien übernehmen weder die eines anderen Computers noch bringen sie diese auf deine anderen Computer",
|
||||
"{agent}'s picks stay on this computer": "Die Auswahl für {agent} gilt nur auf diesem Computer",
|
||||
"{agent}'s picks sync with your other computers again": "Die Auswahl für {agent} wird wieder mit deinen anderen Computern synchronisiert",
|
||||
|
||||
@@ -2043,7 +2043,7 @@ magpie.plugin("library", (ctx) => {
|
||||
if (s.signIn?.dead) nm.append(tag(t("Sign-in ran out"), "warn", t("Open it to sign in again")));
|
||||
else if (s.signIn?.signedIn) nm.append(tag(t("Signed in"), "lib-signed", t("The agents given it use magpie's sign-in")));
|
||||
// kept to this computer: sync carries it nowhere (huhuy72219405 on X)
|
||||
if (s.local) nm.append(tag(t("This computer only"), "lib-local", t("Sync never carries it to your other computers")));
|
||||
if (s.local) nm.append(tag(t("Not synced"), "lib-local", t("Sync never carries it to your other computers")));
|
||||
// out of the hub, each agent's own entry (#4382): said only while the hub is on
|
||||
if (lib.mcpHub && s.hub === "direct") nm.append(tag(t("Not through the router"), "lib-direct", t("Each agent is given its own entry for it, as with the MCP router off")));
|
||||
// its status beside the name, not in it: the name is still the name
|
||||
@@ -2760,9 +2760,12 @@ magpie.plugin("library", (ctx) => {
|
||||
// kept to this computer: a sync neither carries it to the others nor
|
||||
// takes it away here (huhuy72219405 on X)
|
||||
const hereBox = el("div", "lib-localbox");
|
||||
const drawHere = () => hereBox.replaceChildren(toggle(d.local, t("This computer only"), (on) => { d.local = on; drawHere(); }));
|
||||
// said as sync, on while it syncs: "This computer only" read as a
|
||||
// sharing switch (bin.90 on Discord). local keeps its meaning: on is
|
||||
// kept here, so the switch shows and saves its opposite.
|
||||
const drawHere = () => hereBox.replaceChildren(toggle(!d.local, t("Sync to your other computers"), (on) => { d.local = !on; drawHere(); }));
|
||||
drawHere();
|
||||
ed.append(...field(t("This computer only"), hereBox, t("Sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place")));
|
||||
ed.append(...field(t("Sync to your other computers"), hereBox, t("Off keeps it on this computer: sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place")));
|
||||
// with the hub on, a server can stay each agent's own entry (#4382,
|
||||
// cuipengcx90): one that reads its project from the folder it starts
|
||||
// in, or keeps a session's state. Shown only while the hub is on
|
||||
|
||||
@@ -8,7 +8,8 @@ magpie.strings({
|
||||
"Through the MCP router": "经过 MCP 路由",
|
||||
"Off gives each agent its own entry for it, as with the router off: for a server that reads its project from the folder it starts in, or keeps a session's state": "关掉后,每个 Agent 各自有它的条目,和关掉路由时一样:适合从启动目录读取项目、或保存会话状态的服务器",
|
||||
"Sync never carries it to your other computers": "同步不会把它带到你的其他电脑",
|
||||
"Sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place": "同步不会把它带到你的其他电脑;其他电脑同步过来时,既不会删掉它,也不会用它们的同名服务器替换它",
|
||||
"Sync to your other computers": "同步到其他电脑",
|
||||
"Off keeps it on this computer: sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place": "关闭后只留在这台电脑:同步不会把它带到你的其他电脑;其他电脑同步过来时,既不会删掉它,也不会用它们的同名服务器替换它",
|
||||
"Move into the library": "移入资源库",
|
||||
"Manage in magpie": "交给 magpie 管理",
|
||||
"Manage {n} in magpie": "将 {n} 个交给 magpie 管理",
|
||||
@@ -770,7 +771,8 @@ magpie.strings({
|
||||
"Through the MCP router": "經過 MCP 路由",
|
||||
"Off gives each agent its own entry for it, as with the router off: for a server that reads its project from the folder it starts in, or keeps a session's state": "關掉後,每個 Agent 各自有它的條目,和關掉路由時一樣:適合從啟動目錄讀取專案、或保存工作階段狀態的伺服器",
|
||||
"Sync never carries it to your other computers": "同步不會把它帶到你的其他電腦",
|
||||
"Sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place": "同步不會把它帶到你的其他電腦;其他電腦同步過來時,既不會刪掉它,也不會用它們的同名伺服器取代它",
|
||||
"Sync to your other computers": "同步到其他電腦",
|
||||
"Off keeps it on this computer: sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place": "關閉後只留在這台電腦:同步不會把它帶到你的其他電腦;其他電腦同步過來時,既不會刪掉它,也不會用它們的同名伺服器取代它",
|
||||
"Move into the library": "移入資源庫",
|
||||
"Manage in magpie": "交給 magpie 管理",
|
||||
"Manage {n} in magpie": "將 {n} 個交給 magpie 管理",
|
||||
@@ -1532,7 +1534,8 @@ magpie.strings({
|
||||
"Through the MCP router": "MCP ルーターを通す",
|
||||
"Off gives each agent its own entry for it, as with the router off: for a server that reads its project from the folder it starts in, or keeps a session's state": "オフにすると、各エージェントに個別のエントリを渡します(ルーターがオフのときと同じ)。起動したフォルダからプロジェクトを読むサーバーや、セッションの状態を持つサーバー向けです",
|
||||
"Sync never carries it to your other computers": "同期でほかのコンピュータには送られません",
|
||||
"Sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place": "同期でほかのコンピュータには送られません。ほかのコンピュータからの同期で削除されたり、同じ名前のサーバーに置き換えられたりすることもありません",
|
||||
"Sync to your other computers": "ほかのコンピュータと同期",
|
||||
"Off keeps it on this computer: sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place": "オフにするとこのコンピュータだけに残ります。同期でほかのコンピュータには送られず、ほかのコンピュータからの同期で削除されたり、同じ名前のサーバーに置き換えられたりすることもありません",
|
||||
"Move into the library": "ライブラリへ移す",
|
||||
"Manage in magpie": "magpie で管理",
|
||||
"Manage {n} in magpie": "{n} 件を magpie で管理",
|
||||
@@ -2294,7 +2297,8 @@ magpie.strings({
|
||||
"Through the MCP router": "Über den MCP-Router",
|
||||
"Off gives each agent its own entry for it, as with the router off: for a server that reads its project from the folder it starts in, or keeps a session's state": "Aus bekommt jeder Agent einen eigenen Eintrag dafür, wie bei ausgeschaltetem Router: für einen Server, der sein Projekt aus dem Ordner liest, in dem er startet, oder den Zustand einer Sitzung hält",
|
||||
"Sync never carries it to your other computers": "Die Synchronisierung bringt ihn nicht auf deine anderen Computer",
|
||||
"Sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place": "Die Synchronisierung bringt ihn nicht auf deine anderen Computer, und eine Synchronisierung von dort entfernt ihn weder noch ersetzt sie ihn durch ihren gleichnamigen Server",
|
||||
"Sync to your other computers": "Mit deinen anderen Computern synchronisieren",
|
||||
"Off keeps it on this computer: sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place": "Aus bleibt er nur auf diesem Computer: Die Synchronisierung bringt ihn nicht auf deine anderen Computer, und eine Synchronisierung von dort entfernt ihn weder noch ersetzt sie ihn durch ihren gleichnamigen Server",
|
||||
"Move into the library": "In die Bibliothek verschieben",
|
||||
"Manage in magpie": "In magpie verwalten",
|
||||
"Manage {n} in magpie": "{n} in magpie verwalten",
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// Run with Node's test runner and Playwright on the module path; see README.md.
|
||||
// An agent's picks can be kept to this computer, as an MCP server can
|
||||
// (chenxiang0010 on Discord: 「agent当前选择的模型可不可以像mcp那样 只对当前设备生效」).
|
||||
// The row's menu has This computer only: it posts agents/here, is ticked
|
||||
// once on, and the window's row says it beside the version, in every
|
||||
// The row's menu has "Don't sync picks to your other computers" (said as
|
||||
// sync, not "This computer only", which read as sharing: bin.90 on
|
||||
// Discord): it posts agents/here, is ticked once on, and the window's row
|
||||
// says "Not synced" beside the version, in every
|
||||
// language, in Chromium and WebKit, in the window and the tray panel.
|
||||
// Off again, the tick and the words go. No backend: faked here.
|
||||
const assert = require("node:assert/strict");
|
||||
@@ -68,8 +70,10 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
await page.route("**/*", fixture(lang, posts).serve);
|
||||
await page.goto("http://magpie.test/" + (where === "panel" ? "?mode=panel" : ""));
|
||||
await page.locator(row).waitFor();
|
||||
const name = await page.evaluate(() => t("This computer only"));
|
||||
if (lang !== "en") assert.notEqual(name, "This computer only", "not translated");
|
||||
const name = await page.evaluate(() => t("Don't sync picks to your other computers"));
|
||||
const word = await page.evaluate(() => t("Not synced"));
|
||||
if (lang !== "en") assert.notEqual(name, "Don't sync picks to your other computers", "not translated");
|
||||
if (lang !== "en") assert.notEqual(word, "Not synced", "not translated");
|
||||
const item = () => page.locator(".row-menu .rm-item", { hasText: name });
|
||||
const open = async () => {
|
||||
await page.locator(row).click({ button: "right" });
|
||||
@@ -86,7 +90,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
if (where === "panel") assert.equal(await tag.count(), 0, "the panel's row has no room for it");
|
||||
else {
|
||||
await tag.waitFor();
|
||||
assert.equal(await tag.textContent(), name);
|
||||
assert.equal(await tag.textContent(), word);
|
||||
// the row keeps its width and the name stays whole
|
||||
const fit = await page.locator(row).evaluate((r) => {
|
||||
const n = r.querySelector(".who .name");
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// Run with Node's test runner and Playwright on the module path; see README.md.
|
||||
// huhuy72219405 on X ("能不能把不同设备的mcp区分一下,有些mcp属于本地的,同步之后
|
||||
// 其他设备不应该读取到"): an MCP server can be kept to this computer. Its
|
||||
// editor has one switch, "This computer only", saved with the server as
|
||||
// local and shown again; the row says so with a tag. Every language,
|
||||
// editor has one switch, "Sync to your other computers", on by default;
|
||||
// off saves the server as local and shows again off; the row says "Not
|
||||
// synced" with a tag. It said "This computer only", and bin.90 on Discord
|
||||
// read that as a sharing switch: the stored local keeps its meaning. Every language,
|
||||
// Chromium and WebKit, 1100 and 390 wide; nothing scrolls sideways. No
|
||||
// backend: the API is faked here.
|
||||
const assert = require("node:assert/strict");
|
||||
@@ -63,7 +65,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
for (const width of [1100, 390]) {
|
||||
await t.test(`${lang} ${width}`, async () => {
|
||||
const w = (s, v) => tr(lang, s, v);
|
||||
if (lang !== "en") for (const s of ["This computer only", "Sync never carries it to your other computers", "Sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place"]) assert.ok(I18N[lang][s], `${lang}: ${s}`);
|
||||
if (lang !== "en") for (const s of ["Sync to your other computers", "Not synced", "Sync never carries it to your other computers", "Off keeps it on this computer: sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place"]) assert.ok(I18N[lang][s], `${lang}: ${s}`);
|
||||
const calls = [];
|
||||
const ctx = await browser.newContext({ viewport: { width, height: 800 } });
|
||||
await ctx.addInitScript(() => { try { localStorage.setItem("magpie.libTab", "mcp"); } catch {} });
|
||||
@@ -76,27 +78,27 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
await page.locator('button[data-view="library"]').click();
|
||||
const row = page.locator("#view-library .lib-server", { has: page.locator('.lib-health[data-server="mine"]') });
|
||||
const ed = page.locator("#modal .lib-editor");
|
||||
const sw = ed.getByRole("switch", { name: w("This computer only"), exact: true });
|
||||
const sw = ed.getByRole("switch", { name: w("Sync to your other computers"), exact: true });
|
||||
const tag = row.locator(".lib-tag.lib-local");
|
||||
const open = async () => { await row.locator(".name").click(); await ed.waitFor(); };
|
||||
const save = async () => { await ed.locator(":scope > .bar button.primary").click(); await ed.waitFor({ state: "detached" }); };
|
||||
|
||||
await row.waitFor();
|
||||
assert.equal(await tag.count(), 0, "a shared server has no tag");
|
||||
// off for a server shared as before; the hint says what it does
|
||||
// on for a server synced as before; the hint says what off does
|
||||
await open();
|
||||
assert.equal(await sw.getAttribute("aria-checked"), "false");
|
||||
await ed.locator(".hint", { hasText: w("Sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place") }).waitFor();
|
||||
await sw.click();
|
||||
assert.equal(await sw.getAttribute("aria-checked"), "true");
|
||||
await ed.locator(".hint", { hasText: w("Off keeps it on this computer: sync never carries it to your other computers, and a sync from them neither removes it nor puts theirs in its place") }).waitFor();
|
||||
await sw.click();
|
||||
assert.equal(await sw.getAttribute("aria-checked"), "false");
|
||||
await save();
|
||||
assert.deepEqual(calls, ["mine true"]);
|
||||
// the row says so, and the editor shows it on again
|
||||
await tag.waitFor();
|
||||
assert.equal((await tag.textContent()).trim(), w("This computer only"));
|
||||
assert.equal((await tag.textContent()).trim(), w("Not synced"));
|
||||
await open();
|
||||
assert.equal(await sw.getAttribute("aria-checked"), "true");
|
||||
// off again, saved as shared
|
||||
assert.equal(await sw.getAttribute("aria-checked"), "false");
|
||||
// on again, saved as synced
|
||||
await sw.click();
|
||||
await save();
|
||||
assert.deepEqual(calls, ["mine true", "mine false"]);
|
||||
|
||||
@@ -65,7 +65,7 @@ func (m *model) reloadLibrary() {
|
||||
what = strings.TrimSpace(s.Command + " " + strings.Join(s.Args, " "))
|
||||
}
|
||||
if s.Local {
|
||||
what = "this computer only · " + what
|
||||
what = "not synced · " + what
|
||||
}
|
||||
m.lib = append(m.lib, libRow{kind: "mcp", name: s.Name, about: what, on: s.Agents, bad: len(s.Problems)})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user