From 3ccbe6bc15c96a0cbb47ea574645fa5def3699fa Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 13 Oct 2026 15:45:20 +0800 Subject: [PATCH] =?UTF-8?q?plugins:=20a=20runtime=20for=20built-in=20plugi?= =?UTF-8?q?ns,=20and=20Plugins=20=E2=80=BA=20Built-in=20to=20switch=20them?= =?UTF-8?q?=20(P0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lxxyx on X (https://x.com/Lxxyx_/status/2109506752656150974): magpie has too much in it. This is P0 of making magpie's parts plugins, as DeepSeek Harness does: a runtime, plugins.yml, and the first five built-in plugins the user can switch off. - internal/pluginrt: a registry (Register from init), a manifest (API caret range, Requires/Provides, Essential, InUse, Apply, Parts, Defaults) and Reconcile: the plugins no longer wanted, with whatever needs a service they provided, are disposed newest first; the wanted ones are applied once their services are there. A plugin that fails or panics is failed and the rest run. TestPluginsImportOnlyCore keeps the boundary: nothing outside plugins/ imports one, none imports another. - plugins.yml (appdir.Config()): default → preset (essentials | all) → the user's rows → in use. A new install is written Essentials, a magpie that ran here before (settings.RanBefore) All, so existing users keep everything. Writes are locked, whole and keep a .bak; a file that doesn't parse is an error, never empty, and is never written over. - plugins/groups, library, otel, sessions, warmups. In P0 a plugin off is the window's alone: its page, sections and rows (data-feature) leave the window; the gateway, TUI and CLI serve the same, nothing is deleted. One in use stays on. - The window: Plugins › Built-in, the first tab, a switch per plugin; GET/POST /api/plugins/builtin; boot.js says which are off before the first paint. CLI: magpie plugin builtin [on|off ], plugin preset, plugin dump [--json]. - docs/subsystems/plugin-runtime.md, gui-shell.md. Run: go test ./internal/pluginrt/ ./internal/settings/ ./internal/gui/; gofmt -l; go vet ./...; GOOS=linux go vet -tags nogui ./...; GOOS=windows go vet ./.... GUI: builtins.test.cjs in Chromium and WebKit, 5 languages, 1100/800/420; list-sort, mobile-web, routing-keys-fold, routing-sessions pass. By hand under a sandbox HOME: a new install gets essentials, an existing one all, a broken plugins.yml is refused and kept, dump works. Full suite results after the rebase are in the push notes. --- docs/subsystems/README.md | 1 + docs/subsystems/gui-shell.md | 1 + docs/subsystems/plugin-runtime.md | 91 ++++++ internal/cli/builtin_cli.go | 104 +++++++ internal/cli/main.go | 10 + internal/cli/plugins_cli.go | 19 +- internal/gui/api.go | 8 + internal/gui/assets/app.css | 5 + internal/gui/assets/app.js | 103 ++++++- internal/gui/assets/i18n.js | 68 +++++ internal/gui/assets/index.html | 18 +- internal/gui/assets/plugins.js | 40 ++- internal/gui/assets/routing.js | 2 + internal/gui/builtins.go | 130 +++++++++ internal/gui/builtins_test.go | 149 ++++++++++ internal/gui/tests/builtins.test.cjs | 192 ++++++++++++ internal/gui/tests/list-sort.test.cjs | 2 +- internal/gui/tests/mobile-web.test.cjs | 8 + internal/library/setup.go | 18 ++ internal/pluginrt/config.go | 302 +++++++++++++++++++ internal/pluginrt/config_test.go | 127 ++++++++ internal/pluginrt/pluginrt.go | 388 +++++++++++++++++++++++++ internal/pluginrt/pluginrt_test.go | 149 ++++++++++ internal/settings/ranbefore.go | 29 ++ internal/settings/ranbefore_test.go | 30 ++ main.go | 6 +- plugins/all/all.go | 11 + plugins/groups/groups.go | 27 ++ plugins/library/library.go | 19 ++ plugins/otel/otel.go | 28 ++ plugins/sessions/sessions.go | 29 ++ plugins/warmups/warmups.go | 41 +++ 32 files changed, 2137 insertions(+), 18 deletions(-) create mode 100644 docs/subsystems/plugin-runtime.md create mode 100644 internal/cli/builtin_cli.go create mode 100644 internal/gui/builtins.go create mode 100644 internal/gui/builtins_test.go create mode 100644 internal/gui/tests/builtins.test.cjs create mode 100644 internal/pluginrt/config.go create mode 100644 internal/pluginrt/config_test.go create mode 100644 internal/pluginrt/pluginrt.go create mode 100644 internal/pluginrt/pluginrt_test.go create mode 100644 internal/settings/ranbefore.go create mode 100644 internal/settings/ranbefore_test.go create mode 100644 plugins/all/all.go create mode 100644 plugins/groups/groups.go create mode 100644 plugins/library/library.go create mode 100644 plugins/otel/otel.go create mode 100644 plugins/sessions/sessions.go create mode 100644 plugins/warmups/warmups.go diff --git a/docs/subsystems/README.md b/docs/subsystems/README.md index cc8ea72d3..57270e2b5 100644 --- a/docs/subsystems/README.md +++ b/docs/subsystems/README.md @@ -5,6 +5,7 @@ These pages describe current responsibilities, runtime paths, state, and contrac | Subsystem | Reference | | --- | --- | | Built-in subscriptions moving to plugins | [Provider and plugin ownership](provider-plugins.md) | +| Built-in plugins: registry, lifecycle, plugins.yml, presets | [Plugin runtime](plugin-runtime.md) | | Plugins that run on the gateway's requests and replies | [Gateway middleware](gateway-middleware.md) | | Claude subscription turns across Claude Code runs | [Claude subscription bridge](claude-subscription-bridge.md) | | How the gateway picks a provider, key or account, and falls back | [Gateway routing and fallback](gateway-routing.md) | diff --git a/docs/subsystems/gui-shell.md b/docs/subsystems/gui-shell.md index ab4d2dd37..cd4b725f8 100644 --- a/docs/subsystems/gui-shell.md +++ b/docs/subsystems/gui-shell.md @@ -17,6 +17,7 @@ three. | Browser mode | `StartWeb` serves the page and the gateway for `magpie web`. The browser signs in with a run key in a link. Gateway mode shows Providers, Gateway, Routing, Usage, Sessions, Plugins and Settings on a machine that is only a gateway. `webHandler` gzips the page's text files and the API's JSON for a browser that takes gzip (`webCompressed`, with a `-gzip` ETag that still answers 304); the app's own windows read the page in-process and get it uncompressed. | [`web.go`](../../internal/gui/web.go), [`gatewaymode.go`](../../internal/gui/gatewaymode.go) | | The page | `app.js` keeps one state object per view and renders it into a list, with no framework. The views have their own files: `routing.js`, `library.js`, `plugins.js`, `sessions.js` and `context.js` (Usage's Context tab, and the context window card the Routing page draws under a request's story, fed by `/api/context` in `context.go`, which scores and tags each agent; clicking a part, a cell or an item opens its text from `/api/context/text`, the last 10 requests' masked bodies in memory (`openCtxText`), rendered 100 items and 20000 characters at a time; its "Tuned for you" cards are fed by `/api/tune` in `tune.go`, see [agent wiring](agent-wiring.md)). Strings go through `t()` with translations in `i18n.js` (zh, zh-TW, ja and de; the English text is the key and the fallback). zh-TW is Traditional Chinese with Taiwan's words; a system language of zh-TW, zh-HK, zh-MO or any zh-Hant picks it, and the tray menu and notifications follow (`trayLang`). Dropdowns use `openProtoMenu`. Every app menu (`openProtoMenu`, `openRowMenu`, `openSessCombo`) is placed by `placeMenu`: under its anchor, or over it when the window runs out below; one that fits neither way takes the larger room, its height held to it, and scrolls inside itself, and a scroll inside a menu doesn't close it (#1437, `removed-groups-menu-scroll.test.cjs`). The highest any popover goes is `popTop`: 8px under `header.top` on a Mac window, where the traffic lights are drawn over the page, and 8px from the top elsewhere; `placeMenu`, the field picker's `placePop` (which also holds `#pop`'s height to that room) and an agent's model list (`openAgentModels`) all use it (#1573, `popover-mac-chrome.test.cjs`). Scrolling is done only by `scrollOnPurpose(e)` with the reader's event. | [`assets/app.js`](../../internal/gui/assets/app.js), [`assets/i18n.js`](../../internal/gui/assets/i18n.js) | | Window navigation | In the window from 1024 points wide (`SIDE_AT`, the same width as app.css's `side-nav` rules), `layoutNav` moves the brand, the pages (`#nav`) and Settings into the sidebar (`#side`): the pages in four groups (Work, Models, Insights, Extend; a group none of whose pages shows, as in gateway mode, leaves out its name), the gateway's address at its foot (`sideGwRead`, read from `/api/providers` only while there is a sidebar), and the header a breadcrumb (`renderCrumb`). The open page's own tabs (`NAV_SUBS`: Usage, Library, Plugins, Settings) are listed under it as `.nav-s` rows (`role="tab"`, `data-of` the page tab's id) and the page's strip is hidden; a row's click clicks that tab at once, the selection (`.nav-hl`) having set off as the row was pressed (`navSubGlide`; back if the press leaves the row), and is the list's only shape: a row hovered or pressed has no ground of its own, and a `MutationObserver` draws the list again when the strip changes. A page's tabs share its one scroll, so a row that picks another tab opens it at its top (`scrollOnPurpose` with the row's click); the tab already open, picked again, leaves the page where it is (`sidebar-tab-top.test.cjs`). The list opens and folds with an iOS-like spring (`navSubEnter`, `navSubLeave`; none under reduced motion), and a folding list is out of reach at once. Narrower, the page beside a sidebar would be narrower than Usage's requests table needs (768 points), so they go back into the header's row, as a Mac sidebar gives way in a narrow window. At every width the reader can pick the sidebar or the header's tabs from the title bar's button (`#sideToggle`, ⌃⌘S or Ctrl+Shift+S; `toggleSideNav`), kept in localStorage `magpie.navLayout` (`side` or `top`) and so laid out from the first frame; none picked, the sidebar comes from `SIDE_AT`. Picked in a narrow window the sidebar is narrower (184 points under 860), and magpie web on a phone keeps its own tab bar and has no button. The two layouts trade places in a view transition (`navMorph`, app.css `.nav-morph`): the sidebar slides, each page's tab flies to its place in the other, and the page slides as one (its old image dropped, so no line prints twice); without view transitions, under reduced motion, or in the Linux app the change is at once: WebKitGTK with compositing off (`WEBKIT_DISABLE_COMPOSITING_MODE`, which `webkit_linux.go` sets under Wayland) crashes in a view transition. Elsewhere a transition still going after `MORPH_MAX` (1.5s) is skipped, so a webview that never ends one can't leave the window on the old layout's picture. See `side-toggle.test.cjs`. A window made wider or narrower drops what a click held (`heldWidth`): the page laid out again isn't the click's doing. The reader's own place is kept instead for a second while the page is laid out again (`relaid`, a `ResizeObserver` on the open page's parts calling `backToReader`): crossing `SIDE_AT` the browser clamps the scroll to each layout it passes through, and the page ended short of its foot (#1672, `text-size.test.cjs`). See `sidebar.test.cjs`. A sidebar longer than a short window keeps no scroll bar beside its pages: the native bars of `.side-scroll` and `.side-foot` are hidden, and `sideBars` lays a thin bar over each box's edge that shows while it scrolls, fades about a second after it stops (kept while hovered or dragged), can be dragged or clicked to page, and is gone when the box fits, the same in WebKit, WebView2 and WebKitGTK. See `sidebar-overlay-scrollbar.test.cjs`. The window opens on the page the reader last left, as a Mac app comes back as it was (molvqingtai and lc on Discord): `show` keeps the page in localStorage `magpie.lastView` (which the app's webview keeps across restarts, as it keeps `magpie.navLayout`), and `keptView` opens it at start. A page asked for in the address (`?view=`, the tray's links, a reload) wins, Agents too; a kept name that is no page opens the first page, and one gateway mode leaves out opens Providers (`show`). Opening on it scrolls nothing. See `last-page.test.cjs`. | [`assets/app.js`](../../internal/gui/assets/app.js), [`assets/app.css`](../../internal/gui/assets/app.css) | +| Built-in plugins | Plugins › Built-in, the page's first tab (`drawBuiltin` in `plugins.js`, rows by `renderBuiltins` in `app.js`), lists magpie's built-in plugins, each with a name, a line on what it is and a switch: Routing groups, Library, Observability, Sessions, Warm-up and check-in. They are `plugins/*` registered with the [plugin runtime](plugin-runtime.md); `GET /api/plugins/builtin` says each one (`builtinJSON`: on is active, the user's own choice, what of it is in use) and `POST {id, on}` writes plugins.yml. A page marks what goes with a plugin `data-feature=""`. Off, `featureStyle` hides everything so marked (rows drawn later too), `navHides` leaves its page's tab out of the sidebar and the header, `show` opens Agents for an address kept for it, and `setSetTab`, `partShows` and `findSettings` leave its Settings tab and rows out, of the search too. One in use stays on: its switch is disabled and the row says what uses it, and the POST refuses it off. A plugins.yml that doesn't parse is said above the list and no switch moves. `boot.js` says which are off (`featuresOff`) before the first paint, and `settings.builtins` carries the list on every state read. The TUI doesn't follow them. See `builtins.test.cjs`, `builtins_test.go`. | [`builtins.go`](../../internal/gui/builtins.go), [`assets/plugins.js`](../../internal/gui/assets/plugins.js), [`assets/app.js`](../../internal/gui/assets/app.js) | | No GUI build | `-tags nogui` builds magpie without the GUI: `hasGUI` is false and `runGUI` says to use `magpie tui`. The files of `internal/gui` that need Wails build under `!nogui`. | [`gui_off.go`](../../internal/cli/gui_off.go) | ## Runtime path diff --git a/docs/subsystems/plugin-runtime.md b/docs/subsystems/plugin-runtime.md new file mode 100644 index 000000000..5baf38d6c --- /dev/null +++ b/docs/subsystems/plugin-runtime.md @@ -0,0 +1,91 @@ +# Plugin runtime + +magpie's built-in plugins are the parts of magpie not everyone needs, each +one a package under `plugins/` that the user can switch off. The runtime in +`internal/pluginrt` keeps their registry, applies the ones that are on in the +order their services make, and disposes of what each registered when it is +turned off. `plugins.yml` says which are on. This page describes P0: the +runtime, the file and the window's switch. OpenCode plugins (npm packages in +the plugin host) are a different thing; see +[provider and plugin ownership](provider-plugins.md) and +[gateway middleware](gateway-middleware.md). + +## Responsibilities and boundaries + +| Part | What it does | Source | +| --- | --- | --- | +| Registry | A plugin calls `pluginrt.Register(Manifest)` from `init`. `Registered` lists them by id; two with one id panic. `plugins/all` imports every plugin, and only `main.go` imports `plugins/all`, so core code and its tests run without any. | [`pluginrt.go`](../../internal/pluginrt/pluginrt.go), [`plugins/all/all.go`](../../plugins/all/all.go) | +| Manifest | `ID`, `API` (a caret range of the host API, `"^1"`; `pluginrt.API` is `"1.0"`), `Requires` and `Provides` (services), `Essential`, `Name`/`Sub` (English; the window translates them), `One`/`Many` (what is in use, of 1 or `{n}`), `InUse`, `Apply`, `Parts` (`{Slot, Key}`: the window's parts it is) and `Defaults` (its config). | [`pluginrt.go`](../../internal/pluginrt/pluginrt.go) | +| Lifecycle | `Runtime.Reconcile(on, config)`. Off first: every plugin no longer wanted, and every one requiring a service one of those provided, is disposed newest first. Then on: each wanted plugin whose requirements are provided (by `Core`, `settings`, `providers`, `gateway`, `window`, or an active plugin) is applied, again and again until no more can be. States: `off`, `pending` (waiting for a service, logged), `active`, `failed` (Apply returned an error or panicked, or the API range doesn't match; what it registered before is undone), `disposed`. A failed plugin never stops the others. | [`pluginrt.go`](../../internal/pluginrt/pluginrt.go) | +| Ctx | What `Apply` gets: `OnDispose(f)`, `Contribute(slot, key)`, `Provide(name, v)` (withdrawn when it goes), `Service(name)`, and its composed `Config`. Disposers run in reverse, each one's panic logged and the rest still run. | [`pluginrt.go`](../../internal/pluginrt/pluginrt.go) | +| plugins.yml | `appdir.Config()/plugins.yml`: `preset` (`essentials` or `all`) and `plugins`, rows of `{id, enabled, config}` holding only what the user set. | [`config.go`](../../internal/pluginrt/config.go) | +| Built-in plugins in P0 | `groups`, `library`, `otel`, `sessions`, `warmups`. None is Essential. Each one's `InUse` counts what the user made with it: routing groups not Auto and not hidden, library items given to agents, a collector sent to, gateway conversations recorded, warm-ups and check-ins on. | [`plugins/`](../../plugins) | + +The boundary is checked by `TestPluginsImportOnlyCore`: no package outside +`plugins/` imports one (but `main.go`, through `plugins/all`), a plugin never +imports another, and `plugins/all` imports every plugin folder. Plugins reach +each other only through services. + +## Source of truth and composing + +What a plugin runs with is composed field by field (`Compose`), each value +remembering its layer (`Source`): + +1. `default`: every plugin on, its `Manifest.Defaults`; +2. `preset`: Essentials leaves every plugin not `Essential` off; +3. `user`: the rows of plugins.yml (`enabled`, and `config` merged into the + defaults key by key, maps deeply); +4. `in use`: a plugin whose `InUse` is above 0 is on whatever the rows say, + since off its things would go on working with nowhere to see them. An + `InUse` error counts as in use. + +`Composed.Chosen` is plugins.yml's say before step 4. `magpie plugin dump` +(`--json`) prints the composed list with each plugin's state and why. + +## Runtime paths + +- **Start** (`internal/cli/main.go`, after `settings.Migrate`): + `pluginrt.Settle(!settings.RanBefore())` writes a first plugins.yml when + there is none: `essentials` on a new install, `all` on a magpie that ran + here before (one of `settings.ranBefore`'s files is there; one that can't + be looked at counts as there), so an existing user keeps everything. Then + `pluginrt.Refresh` makes the process's runtime and reconciles it. An error + is printed and magpie starts. +- **Every read**: `Refresh` loads plugins.yml again, composes it and + reconciles. The window's `/api/state`, `/api/plugins/builtin` and boot.js + each call it (`builtinsState`), so a change made by the CLI shows on the + next read. +- **Switch**: `Set(id, on)` (`POST /api/plugins/builtin`, `magpie plugin + builtin on|off `) writes the user's row; `SetPreset` the preset + (`magpie plugin preset essentials|all`). Off is refused while the plugin + is in use. +- **The window**: see [GUI app shell](gui-shell.md), "Built-in plugins". + +## Failure and compatibility + +- A plugins.yml that can't be read or doesn't parse, or names another + preset, is an error, never an empty file. `Refresh` returns it and leaves + the runtime as it was; before the first good read every plugin is on, as + before plugins existed. `Set` and `SetPreset` refuse to write over it, the + window says it above the list and disables every switch, and the CLI exits + with it. The user fixes the file or removes it. +- Writes hold `filelock.Mutex` (`plugins.yml.lock`) against other magpies + and a mutex in the process, are written whole (temp file, sync, rename), + and keep the file they replace as `plugins.yml.bak`. +- A plugin written for another major API, or a newer minor, is `failed` + with the reason; the rest run. +- In P0 a plugin's off is the window's alone: its page, sections and rows + leave the window. The gateway, the TUI and the CLI serve the same either + way, and nothing the user made is deleted. Davsync doesn't carry + plugins.yml. + +## Verification + +- `go test ./internal/pluginrt/` (`TestReconcile`, `TestCompatible`, + `TestPluginsImportOnlyCore`, `TestCompose`, `TestSettleAndSet`, + `TestBrokenFileIsKept`), `go test ./internal/settings/ -run TestRanBefore`. +- `go test ./internal/gui/ -run 'TestBuiltin|TestBootSaysBuiltinsOff'`. +- `internal/gui/tests/builtins.test.cjs` in Chromium and WebKit, every + language, 1100, 800 and 420 points. +- By hand, under a sandbox HOME: `magpie plugin builtin`, `magpie plugin + builtin on groups`, `magpie plugin dump`, and a plugins.yml broken by hand. diff --git a/internal/cli/builtin_cli.go b/internal/cli/builtin_cli.go new file mode 100644 index 000000000..0a8486761 --- /dev/null +++ b/internal/cli/builtin_cli.go @@ -0,0 +1,104 @@ +package cli + +import ( + "encoding/json" + "errors" + "fmt" + "os" + "slices" + + "gopkg.in/yaml.v3" + + "github.com/yetone/magpie/internal/pluginrt" +) + +// builtinCmd: `magpie plugin builtin [on|off ]` — magpie's built-in +// plugins (internal/pluginrt, plugins/), as Plugins › Built-in shows them. +// One in use is refused off, as the window refuses it. +func builtinCmd(rest []string) error { + if len(rest) == 0 || rest[0] == "list" { + cs, err := pluginrt.Refresh() + if err != nil { + return err + } + for _, m := range pluginrt.Registered() { + i := slices.IndexFunc(cs, func(c pluginrt.Composed) bool { return c.ID == m.ID }) + c := cs[i] + mark, how := muted.Render("○"), "off" + if c.Enabled { + mark, how = green.Render("●"), "on" + } + if c.Source == pluginrt.FromInUse { + how = "on, in use" + } + fmt.Printf("%s %-10s %-12s %s\n", mark, m.ID, how, muted.Render(m.Name)) + } + fmt.Println(muted.Render("in " + tildePath(pluginrt.Path()))) + return nil + } + if len(rest) != 2 || (rest[0] != "on" && rest[0] != "off") { + return errors.New(pluginUsage) + } + on, id := rest[0] == "on", rest[1] + cs, err := pluginrt.Refresh() + if err != nil { + return err + } + i := slices.IndexFunc(cs, func(c pluginrt.Composed) bool { return c.ID == id }) + if i < 0 { + return fmt.Errorf("no built-in plugin %q", id) + } + if !on && cs[i].InUse > 0 { + return fmt.Errorf("%s is in use and stays on", id) + } + if err := pluginrt.Set(id, on); err != nil { + return err + } + fmt.Println(green.Render("✓"), id, "is", rest[0]) + return nil +} + +// dumpPlugins: `magpie plugin dump` — what plugins.yml comes to after its +// layers: each built-in plugin, on or off and why, its config and the +// layer each value is from, and how it runs in this process. +func dumpPlugins(asJSON bool) error { + f, there, err := pluginrt.Load() + if err != nil { + return err + } + cs, err := pluginrt.Refresh() + if err != nil { + return err + } + type plug struct { + pluginrt.Composed `yaml:",inline"` + State pluginrt.State `json:"state" yaml:"state"` + Why string `json:"why,omitempty" yaml:"why,omitempty"` + } + st := map[string]pluginrt.Status{} + for _, s := range pluginrt.Running().Statuses() { + st[s.ID] = s + } + out := struct { + File string `json:"file" yaml:"file"` + There bool `json:"there" yaml:"there"` + Preset string `json:"preset" yaml:"preset"` + API string `json:"api" yaml:"api"` + Plugins []plug `json:"plugins" yaml:"plugins"` + }{File: pluginrt.Path(), There: there, Preset: f.Preset, API: pluginrt.API} + if out.Preset == "" { + out.Preset = pluginrt.PresetAll + } + for _, c := range cs { + out.Plugins = append(out.Plugins, plug{Composed: c, State: st[c.ID].State, Why: st[c.ID].Why}) + } + if asJSON { + b, _ := json.MarshalIndent(out, "", " ") + fmt.Println(string(b)) + return nil + } + e := yaml.NewEncoder(os.Stdout) + e.SetIndent(2) + defer e.Close() + return e.Encode(out) +} diff --git a/internal/cli/main.go b/internal/cli/main.go index cfb43b8f1..6e572f87e 100644 --- a/internal/cli/main.go +++ b/internal/cli/main.go @@ -21,6 +21,7 @@ import ( "github.com/yetone/magpie/internal/gateway" "github.com/yetone/magpie/internal/imagemcp" "github.com/yetone/magpie/internal/netproxy" + "github.com/yetone/magpie/internal/pluginrt" "github.com/yetone/magpie/internal/proc" "github.com/yetone/magpie/internal/profile" "github.com/yetone/magpie/internal/provider" @@ -221,6 +222,15 @@ func run(args []string) error { update.AwaitPredecessor() makeDirs() settings.Migrate() + // a new install starts with the Essentials preset of built-in plugins + // (plugins.yml), one that ran before with all of them, told by no file + // of a magpie run before: so before anything below writes one + if _, err := pluginrt.Settle(!settings.RanBefore()); err != nil { + fmt.Fprintf(os.Stderr, "magpie: plugins.yml: %v\n", err) + } + if _, err := pluginrt.Refresh(); err != nil { + fmt.Fprintf(os.Stderr, "magpie: plugins.yml: %v\n", err) + } // the providers and settings read once for every agent's fields, which // the moves below look at (a write among them reads them again) release := provider.Hold() diff --git a/internal/cli/plugins_cli.go b/internal/cli/plugins_cli.go index bb7ed4cad..01758709b 100644 --- a/internal/cli/plugins_cli.go +++ b/internal/cli/plugins_cli.go @@ -11,6 +11,7 @@ import ( "github.com/yetone/magpie/internal/middleware" "github.com/yetone/magpie/internal/plugin" + "github.com/yetone/magpie/internal/pluginrt" "github.com/yetone/magpie/internal/provider" ) @@ -24,7 +25,10 @@ const pluginUsage = `usage: magpie plugin [list] [--json] magpie plugin login [] sign in to a provider a plugin adds magpie plugin logout forget the sign-in magpie plugin move|migrate run a built-in subscription's accounts on its community plugin - magpie plugin move-back|unmigrate go back to the built-in, with its accounts` + magpie plugin move-back|unmigrate go back to the built-in, with its accounts + magpie plugin builtin [on|off ] list magpie's built-in plugins (Sessions, Library, routing groups…), or turn one on or off + magpie plugin preset essentials|all start the built-in plugins from the Essentials preset, or from all of them + magpie plugin dump [--json] what plugins.yml comes to: each built-in plugin, its config, and the layer each value is from` // pluginCmd: `magpie plugin …` — OpenCode's provider plugins and pi's // packages, which sign in to a subscription and carry its requests @@ -157,6 +161,19 @@ func pluginCmd(args []string) error { } fmt.Println(green.Render("✓"), rest[0], "is built-in again") return nil + case "builtin", "builtins", "built-in": + return builtinCmd(rest) + case "preset": + if len(rest) != 1 { + return errors.New(pluginUsage) + } + if err := pluginrt.SetPreset(rest[0]); err != nil { + return err + } + fmt.Println(green.Render("✓"), "built-in plugins start from", rest[0]) + return builtinCmd(nil) + case "dump": + return dumpPlugins(len(rest) > 0 && rest[0] == "--json") case "help", "-h", "--help": fmt.Println(pluginUsage) return nil diff --git a/internal/gui/api.go b/internal/gui/api.go index b59113733..ff9f15bad 100644 --- a/internal/gui/api.go +++ b/internal/gui/api.go @@ -342,6 +342,9 @@ type settingsJSON struct { Version string `json:"version"` Dir string `json:"dir"` // where magpie keeps its files, as shown Gateway string `json:"gateway"` // the local endpoint + // Builtins are the built-in plugins: each one's switch, whether it + // runs and what of it is in use (builtins.go) + Builtins []builtinJSON `json:"builtins"` // PublicURL is MAGPIE_PUBLIC_URL while other machines are let in // (shared, or MAGPIE_ADDR on the network): where they reach the // gateway, shown beside the local address agents here are pointed at @@ -557,6 +560,7 @@ type searchFailedJSON struct { func settingsState() settingsJSON { s := settingsJSON{Settings: settings.Load(), Version: Version, Dir: tilde(settings.Dir()), Portable: settings.Portable() != "", Gateway: gateway.URL()} s.AddrEnv = os.Getenv("MAGPIE_ADDR") + s.Builtins = builtinsState() s.OnNetwork = gateway.OnNetwork() if list, env := gateway.AllowIPs(); env { s.AllowIPsEnv, s.AllowIPsFromEnv = os.Getenv(gateway.AllowIPsEnv), list @@ -778,6 +782,9 @@ func Handler(w Windows, gw *gateway.Server) http.Handler { if on, _ := gatewayMode(isWeb(w)); on { boot["gateway"] = true } + // and the built-in plugins it leaves out (builtins.go), gone + // before the first paint rather than after the settings come + boot["featuresOff"] = builtinsOff(builtinsState()) // on Omarchy the page takes its theme's look before it paints if th, ok := omarchyTheme(); ok { boot["omarchy"] = th @@ -1083,6 +1090,7 @@ func Handler(w Windows, gw *gateway.Server) http.Handler { cliBehindRoutes(mux) gatewayFixRoutes(mux) gatewayModeRoutes(mux) + builtinRoutes(mux) mux.HandleFunc("GET /api/settings", func(rw http.ResponseWriter, r *http.Request) { access.MigrateLegacyLANKeyBestEffort() writeJSON(rw, settingsState()) diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index 63fd36947..ac1182139 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -2974,6 +2974,11 @@ body.window .ag-sk-icon { width: 22px; height: 22px; border-radius: 6px; } .set-searching .set-page::before { content: attr(data-part); display: block; margin: 4px 2px 6px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); } .set-none { margin: 18px 2px; font-size: 13px; color: var(--muted); text-align: center; } .set-page > .list:not(:last-child) { margin-bottom: 8px; } +/* Plugins › Built-in: what the list is over its rows, and a row in use + saying what uses it under its switch, which can't be turned off */ +.feat-say { margin: 2px 4px 10px; font-size: 12px; line-height: 1.45; color: var(--muted); } +.set-searching .feat-say { display: none; } +.row.pref .sub.feat-why { color: var(--muted); font-size: 11px; } .row.pref { min-height: 50px; padding: 8px 12px 8px 14px; gap: 14px; } .row.pref .who { flex: 1 1 auto; } .row.pref .sub { margin-top: 2px; color: var(--fg-2); } diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index f55432f1e..daf249043 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -18,6 +18,28 @@ const web = !!window.bootPrefs?.web; // General turns it off, and they are back. let gatewayMode = web && !!window.bootPrefs?.gateway; const GATEWAY_HIDES = ["agents", "library"]; +// Plugins › Built-in (builtins.go; Lxxyx on X: too much to look through): +// the optional parts of the window switched off, by id. Whatever is marked +// data-feature="" leaves the page while its feature is off — by a +// style, so what a page draws later goes too — a page's tab leaves the nav +// (navHides), a link to the page opens Agents (show), and Settings and its +// search pass over its rows. boot.js says which before the first paint, +// each read of the settings after (applyFeatures). The gateway is the +// same either way. +let featuresOff = new Set(window.bootPrefs?.featuresOff || []); +const featureSel = () => [...featuresOff].map((id) => `[data-feature~="${id}"]`).join(","); +const featureHides = (n) => { const sel = featureSel(); return !!sel && !!n?.closest(sel); }; +function featureStyle() { + let st = document.getElementById("featureStyle"); + if (!st) { + st = document.createElement("style"); + st.id = "featureStyle"; + document.head.append(st); + } + const sel = featureSel(); + st.textContent = sel ? sel + "{display:none!important}" : ""; +} +featureStyle(); // The window is dragged by its header, and only where the header says so // (--wails-draggable), so the tabs and buttons in it stay plain clicks. // Outside the app — a browser on the gateway's page, or on `magpie web` — @@ -1556,6 +1578,7 @@ function guideCard(g) { const three = guideStep(3, g.routing, t("Set up routing (optional)"), g.routing ? g.own.map((x) => x.name || x.id).join(", ") : t("A routing group sends each request to the right model, and to the next one when a model fails")); three.li.dataset.step = "routing"; + three.li.dataset.feature = "groups"; three.li.classList.add("optional"); if (!g.routing && g.source) { guideLoadGroups(); @@ -11317,6 +11340,8 @@ function renderModels(p) { const [tk, cb] = tick(t("Only through routing groups"), !!draft.unlisted); cb.onchange = () => { draft.unlisted = cb.checked; draw(); }; tk.title = t("Its models leave the list agents pick from; the routing groups they are in still use them"); + // with routing groups switched off, only while it is ticked: then it is in use + if (!draft.unlisted) tk.dataset.feature = "groups"; if (!decideOnly(p)) box.append(tk); const lost = el("div", "hint model-hint warn"); box.append(why, lost); @@ -16844,6 +16869,7 @@ function checkinRow(q, first, subs) { const r = q.checkin; const today = wbToday(); const row = el("div", "wb-checkin"); + row.dataset.feature = "warmups"; let kind = "", text; const last = r && r.day !== today && (r.outcome === "claimed" || r.outcome === "done") ? t("last checked in {day}", { day: r.day }) : ""; if (r && r.day === today) { @@ -20388,6 +20414,7 @@ function sessionItem(s) { r.append(go); const open = (e) => { if (window.getSelection()?.toString()) return; + if (featuresOff.has("sessions")) return; // Sessions is switched off: there is no page to open it on window.openSessionOnPage?.(s, e); }; r.onclick = open; @@ -20689,6 +20716,7 @@ async function loadSettings() { if (!prefsSettled(since) && prefs) return; // the save draws the page when it's in // the state's copy too, which the other pages draw from (#1433) prefs = state.settings = s; + applyFeatures(s.builtins); // the WebDAV setup can have been changed from outside the window (magpie // webdav at the terminal): the page's copy of it is dropped, so the page // is drawn from a fresh read. Coming back to the window is safe with a @@ -20785,7 +20813,7 @@ const partShows = (page) => { const rows = [...page.querySelectorAll(".row")]; return !rows.length || rows.some((r) => { for (let n = r; n && n !== page; n = n.parentElement) if (n.hidden && !n.matches('[role="tabpanel"]')) return false; - return true; + return !featureHides(r); }); }; function setSetTab(tab, remember) { @@ -20793,7 +20821,7 @@ function setSetTab(tab, remember) { setTab = tab; try { localStorage.setItem("magpie.settingsTab", tab); } catch {} } - for (const id of SET_TABS) $("#setTab-" + id).hidden = !partShows($("#setPage-" + id)); + for (const id of SET_TABS) $("#setTab-" + id).hidden = featureHides($("#setTab-" + id)) || !partShows($("#setPage-" + id)); if (!SET_TABS.includes(tab) || $("#setTab-" + tab).hidden) tab = SET_TABS.find((id) => !$("#setTab-" + id).hidden) || "general"; for (const id of SET_TABS) { const b = $("#setTab-" + id), on = id === tab; @@ -20858,6 +20886,7 @@ function findSettings() { let shows = hit; for (let a = n; shows && a && a !== page; a = a.parentElement) if (a.hidden && a !== pane) shows = false; if (shows && pane && $('[aria-controls="' + pane.id + '"]').hidden) shows = false; + if (shows && featureHides(n)) shows = false; // a built-in plugin switched off if (!shows) continue; hits++; lit.add(n.closest(".list") || n.parentElement); @@ -24041,6 +24070,8 @@ for (const v of document.querySelectorAll(".view")) { async function show(v) { // a page gateway mode leaves out (a link to it, an address kept) opens Providers if (gatewayMode && GATEWAY_HIDES.includes(v)) v = "providers"; + // and one a built-in plugin switched off has, Agents + if (featureHides($(`#nav button[data-view="${v}"]`))) v = gatewayMode ? "providers" : "agents"; if (v !== view) { if (view === "providers" && (editing !== null || importing || importingApps)) { if (!await cancelEdit(true)) return false; @@ -24114,11 +24145,76 @@ function setGatewayMode(on) { gatewayMode = on; document.body.classList.toggle("gateway-mode", on); if (mode !== "window") return; - for (const v of GATEWAY_HIDES) $(`#nav button[data-view="${v}"]`).hidden = on; + navHides(); if (on && GATEWAY_HIDES.includes(view)) show("providers"); else if (!sideNav()) slide($("#nav"), "nav"); navSubs(); } +// navHides leaves out the tabs of the pages gateway mode or a built-in +// plugin switched off leaves out +function navHides() { + if (mode !== "window") return; + for (const b of $("#nav").querySelectorAll("button[data-view]")) b.hidden = (gatewayMode && GATEWAY_HIDES.includes(b.dataset.view)) || featureHides(b); +} +// applyFeatures takes the built-in plugins' state from a read of the +// settings, or a switch on Plugins › Built-in: +// what is off leaves the window, and the page open, if it went, gives way +// to Agents (Providers in gateway mode) +function applyFeatures(list) { + if (!Array.isArray(list)) return; + const off = new Set(list.filter((f) => !f.on).map((f) => f.id)); + if (off.size === featuresOff.size && [...off].every((id) => featuresOff.has(id))) return; + featuresOff = off; + featureStyle(); + if (mode !== "window") return; + navHides(); + if (featureHides($(`#nav button[data-view="${view}"]`))) show(gatewayMode ? "providers" : "agents"); + else if (!sideNav()) slide($("#nav"), "nav"); + setSetTab(setTab); + navSubs(); +} +// Plugins › Built-in: a row each, its name, what it is and a switch, kept +// in plugins.yml (builtins.go). One in use can't be switched off, and says +// what uses it; a plugins.yml that doesn't parse says so, and none can be +// switched until it is fixed. done gets the list after a switch. +function renderBuiltins(box, list, done) { + const broken = list.find((f) => f.broken)?.broken; + const rows = list.map((f) => { + const r = el("div", "row pref feat-row"); + r.dataset.id = f.id; + const who = el("div", "who"); + who.append(el("div", "name", t(f.name)), el("div", "sub", t(f.sub))); + if (f.inUse > 0) who.append(el("div", "sub feat-why", t(f.use, { n: f.inUse }))); + const b = el("button", "lib-switch use-credits" + (f.on ? " on" : "")); + b.type = "button"; + b.setAttribute("role", "switch"); + b.setAttribute("aria-checked", String(f.on)); + b.setAttribute("aria-label", t(f.name)); + b.append(el("i")); + b.disabled = f.inUse > 0 || !!broken; + if (f.inUse > 0) b.title = t("In use, so it stays on"); + b.onclick = async () => { + if (b.disabled) return; + b.disabled = true; + try { + const next = await api("plugins/builtin", { id: f.id, on: !f.on }); + if (state.settings) state.settings.builtins = next; + applyFeatures(next); + done(next); + status(t("Saved"), "ok", 1500); + } catch (err) { + b.disabled = false; + status(t(err.message), "err"); + } + }; + r.append(who, b); + return r; + }); + const out = []; + if (broken) out.push(el("p", "feat-say warn", t("plugins.yml can't be read, so every built-in plugin stays as it was: {error}", { error: broken }))); + box.replaceChildren(...out, ...rows); +} +window.renderBuiltins = renderBuiltins; // openSettings: the Settings page, in the window (the panel opens it there) function openSettings() { if (mode !== "window") { api("window/main?view=settings", {}); return; } @@ -25125,6 +25221,7 @@ if (mode === "window" && params.get("view") === "usage") { for (const k of ["tab", "provider", "agent", "computer", "card", "purpose", "via"]) u.searchParams.delete(k); history.replaceState(null, "", u); } +navHides(); // the pages built-in plugins switched off have, from boot.js // The window opens on the page the reader last left, as a Mac app comes back // as it was (molvqingtai, lc on Discord): a page asked for (?view=, a link // from the tray or a reload) first, then the one kept; a page gateway mode diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index 6196579c8..a0dd2f470 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -768,6 +768,23 @@ const I18N = { "Looks in running WSL distros for agents to set up, their sessions and Claude Code; off, WSL is never asked anything and the agents found there are no longer shown": "在运行中的 WSL 发行版里查找可接入的 Agent、它们的会话和 Claude Code;关闭后不再向 WSL 询问任何内容,之前在那里找到的 Agent 也不再显示", "Screen on too": "屏幕也常亮", "Gateway mode": "网关模式", + "Built-in": "内置", + "plugins.yml can't be read, so every built-in plugin stays as it was: {error}": "plugins.yml 读不了,所以每个内置插件都保持原样:{error}", + "Parts of magpie not everyone needs. Switched off, a part leaves the sidebar, its pages and Settings; magpie works the same either way.": "不是人人都需要的部分。关掉后,它会从侧边栏、各页面和设置中隐去;magpie 的工作方式不变。", + "Your agents' past conversations: read, search, resume and export them": "Agent 的历史对话:查看、搜索、继续和导出", + "Recording gateway conversations": "正在记录网关对话", + "Instructions, MCP servers, skills and hooks, kept once and given to every agent": "指令、MCP 服务器、技能和 Hooks,统一管理,分发给每个 Agent", + "1 item given to agents": "1 项已分发给 Agent", + "{n} items given to agents": "{n} 项已分发给 Agent", + "Several models agents pick as one: each request goes to the right one, and to the next when one fails": "把几个模型当作一个给 Agent 选:每个请求发给合适的模型,一个失败时换下一个", + "1 group in use": "1 个路由组在用", + "{n} groups in use": "{n} 个路由组在用", + "Start a subscription's usage window at a time you pick, and claim vendors' daily check-in credits": "在你选的时间开启订阅的用量窗口,并领取厂商的每日签到额度", + "1 warm-up or check-in on": "1 项预热或签到已开启", + "{n} warm-ups and check-ins on": "{n} 项预热和签到已开启", + "Send each request's traces and metrics to an OpenTelemetry collector, such as Langfuse": "把每个请求的追踪和指标发送到 OpenTelemetry 收集器,比如 Langfuse", + "Sending to a collector": "正在发送到收集器", + "In use, so it stays on": "正在使用,因此保持开启", "Only what a gateway for other computers needs: no Agents or Library, nor this computer's agents' settings": "只显示给其他电脑当网关所需的内容:不显示 Agent 和资源库,也不显示本机 Agent 的设置", "Now on: magpie web was started with --gateway": "当前开启:magpie web 以 --gateway 启动", "Now on: no agents on this computer": "当前开启:本机没有 Agent", @@ -5414,6 +5431,23 @@ const I18N = { "Looks in running WSL distros for agents to set up, their sessions and Claude Code; off, WSL is never asked anything and the agents found there are no longer shown": "在執行中的 WSL 發行版裡尋找可接入的 Agent、它們的工作階段和 Claude Code;關閉後不再向 WSL 詢問任何內容,之前在那裡找到的 Agent 也不再顯示", "Screen on too": "螢幕也常亮", "Gateway mode": "閘道模式", + "Built-in": "內建", + "plugins.yml can't be read, so every built-in plugin stays as it was: {error}": "plugins.yml 讀不了,所以每個內建外掛都保持原樣:{error}", + "Parts of magpie not everyone needs. Switched off, a part leaves the sidebar, its pages and Settings; magpie works the same either way.": "不是人人都需要的部分。關掉後,它會從側邊欄、各頁面和設定中隱去;magpie 的運作方式不變。", + "Your agents' past conversations: read, search, resume and export them": "Agent 的歷史對話:檢視、搜尋、繼續和匯出", + "Recording gateway conversations": "正在記錄閘道對話", + "Instructions, MCP servers, skills and hooks, kept once and given to every agent": "指令、MCP 伺服器、技能和 Hooks,統一管理,分發給每個 Agent", + "1 item given to agents": "1 項已分發給 Agent", + "{n} items given to agents": "{n} 項已分發給 Agent", + "Several models agents pick as one: each request goes to the right one, and to the next when one fails": "把幾個模型當作一個給 Agent 選:每個請求發給合適的模型,一個失敗時換下一個", + "1 group in use": "1 個路由組在用", + "{n} groups in use": "{n} 個路由組在用", + "Start a subscription's usage window at a time you pick, and claim vendors' daily check-in credits": "在你選的時間開啟訂閱的用量時段,並領取廠商的每日簽到額度", + "1 warm-up or check-in on": "1 項預熱或簽到已開啟", + "{n} warm-ups and check-ins on": "{n} 項預熱和簽到已開啟", + "Send each request's traces and metrics to an OpenTelemetry collector, such as Langfuse": "把每個請求的追蹤和指標傳送到 OpenTelemetry 收集器,例如 Langfuse", + "Sending to a collector": "正在傳送到收集器", + "In use, so it stays on": "正在使用,因此保持開啟", "Only what a gateway for other computers needs: no Agents or Library, nor this computer's agents' settings": "只顯示給其他電腦當閘道所需的內容:不顯示 Agent 和資源庫,也不顯示本機 Agent 的設定", "Now on: magpie web was started with --gateway": "目前開啟:magpie web 以 --gateway 啟動", "Now on: no agents on this computer": "目前開啟:本機沒有 Agent", @@ -10027,6 +10061,23 @@ const I18N = { "Looks in running WSL distros for agents to set up, their sessions and Claude Code; off, WSL is never asked anything and the agents found there are no longer shown": "実行中の WSL ディストリビューションで、設定できるエージェント、そのセッション、Claude Code を探します。オフにすると WSL には一切問い合わせず、そこで見つかったエージェントも表示しません", "Screen on too": "画面もオン", "Gateway mode": "ゲートウェイモード", + "Built-in": "内蔵", + "plugins.yml can't be read, so every built-in plugin stays as it was: {error}": "plugins.yml を読めないため、内蔵プラグインはすべてそのままです:{error}", + "Parts of magpie not everyone needs. Switched off, a part leaves the sidebar, its pages and Settings; magpie works the same either way.": "誰もが使うわけではない部分です。オフにすると、サイドバー、各ページ、設定から消えます。magpie の動作は変わりません。", + "Your agents' past conversations: read, search, resume and export them": "エージェントの過去の会話:閲覧、検索、再開、書き出し", + "Recording gateway conversations": "ゲートウェイの会話を記録中", + "Instructions, MCP servers, skills and hooks, kept once and given to every agent": "指示、MCP サーバー、スキル、フックを一か所で管理し、すべてのエージェントに渡します", + "1 item given to agents": "1 件をエージェントに渡しています", + "{n} items given to agents": "{n} 件をエージェントに渡しています", + "Several models agents pick as one: each request goes to the right one, and to the next when one fails": "複数のモデルをエージェントが 1 つとして選べます。各リクエストは適したモデルへ、失敗したら次へ送られます", + "1 group in use": "1 つのグループを使用中", + "{n} groups in use": "{n} 個のグループを使用中", + "Start a subscription's usage window at a time you pick, and claim vendors' daily check-in credits": "サブスクリプションの利用枠を選んだ時刻に始め、ベンダーの毎日のチェックイン特典を受け取ります", + "1 warm-up or check-in on": "1 件のウォームアップまたはチェックインがオン", + "{n} warm-ups and check-ins on": "{n} 件のウォームアップとチェックインがオン", + "Send each request's traces and metrics to an OpenTelemetry collector, such as Langfuse": "各リクエストのトレースとメトリクスを Langfuse などの OpenTelemetry コレクターに送ります", + "Sending to a collector": "コレクターに送信中", + "In use, so it stays on": "使用中のためオンのままです", "Only what a gateway for other computers needs: no Agents or Library, nor this computer's agents' settings": "他のコンピューターのゲートウェイに必要なものだけ:エージェント、ライブラリ、このコンピューターのエージェントの設定は表示しません", "Now on: magpie web was started with --gateway": "現在オン:magpie web が --gateway で起動されています", "Now on: no agents on this computer": "現在オン:このコンピューターにエージェントがありません", @@ -14657,6 +14708,23 @@ const I18N = { "Looks in running WSL distros for agents to set up, their sessions and Claude Code; off, WSL is never asked anything and the agents found there are no longer shown": "Sucht in laufenden WSL-Distributionen nach einrichtbaren Agenten, ihren Sitzungen und Claude Code; aus, wird WSL nie etwas gefragt, und die dort gefundenen Agenten werden nicht mehr angezeigt", "Screen on too": "Bildschirm auch an", "Gateway mode": "Gateway-Modus", + "Built-in": "Eingebaut", + "plugins.yml can't be read, so every built-in plugin stays as it was: {error}": "plugins.yml lässt sich nicht lesen, daher bleibt jedes eingebaute Plugin, wie es war: {error}", + "Parts of magpie not everyone needs. Switched off, a part leaves the sidebar, its pages and Settings; magpie works the same either way.": "Teile von magpie, die nicht jeder braucht. Ausgeschaltet verschwindet ein Teil aus der Seitenleiste, seinen Seiten und den Einstellungen; magpie arbeitet weiter wie bisher.", + "Your agents' past conversations: read, search, resume and export them": "Die bisherigen Unterhaltungen deiner Agenten: lesen, suchen, fortsetzen und exportieren", + "Recording gateway conversations": "Gateway-Unterhaltungen werden aufgezeichnet", + "Instructions, MCP servers, skills and hooks, kept once and given to every agent": "Anweisungen, MCP-Server, Skills und Hooks, einmal gepflegt und an jeden Agenten gegeben", + "1 item given to agents": "1 Eintrag an Agenten gegeben", + "{n} items given to agents": "{n} Einträge an Agenten gegeben", + "Several models agents pick as one: each request goes to the right one, and to the next when one fails": "Mehrere Modelle, die Agenten als eines wählen: Jede Anfrage geht an das passende und beim Ausfall an das nächste", + "1 group in use": "1 Gruppe in Gebrauch", + "{n} groups in use": "{n} Gruppen in Gebrauch", + "Start a subscription's usage window at a time you pick, and claim vendors' daily check-in credits": "Das Nutzungsfenster eines Abos zu einer gewählten Zeit starten und die täglichen Check-in-Guthaben der Anbieter abholen", + "1 warm-up or check-in on": "1 Vorwärmen oder Check-in an", + "{n} warm-ups and check-ins on": "{n} Vorwärmen und Check-ins an", + "Send each request's traces and metrics to an OpenTelemetry collector, such as Langfuse": "Traces und Metriken jeder Anfrage an einen OpenTelemetry-Collector senden, etwa Langfuse", + "Sending to a collector": "Sendet an einen Collector", + "In use, so it stays on": "In Gebrauch, daher bleibt es an", "Only what a gateway for other computers needs: no Agents or Library, nor this computer's agents' settings": "Nur, was ein Gateway für andere Computer braucht: keine Agenten oder Bibliothek, keine Einstellungen der Agenten auf diesem Computer", "Now on: magpie web was started with --gateway": "Jetzt an: magpie web wurde mit --gateway gestartet", "Now on: no agents on this computer": "Jetzt an: keine Agenten auf diesem Computer", diff --git a/internal/gui/assets/index.html b/internal/gui/assets/index.html index 591bb578b..a8b0f67e7 100644 --- a/internal/gui/assets/index.html +++ b/internal/gui/assets/index.html @@ -47,8 +47,8 @@