ac4af582301a4e8a29245dbba767eba31334ddf9
26
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
cdd99c5578 |
routing: a re: pattern with a lookahead saves and matches as its preview showed
maer8824 on Discord wrote "re:(?!.*flash).*glm.*" (glm but not flash) in
a routing group. The GUI's preview, which reads patterns with JS's
RegExp, matched the right models, but saving failed: Go's regexp has no
lookaround ("invalid or unsupported Perl syntax: (?!").
compilePattern now reads with Go's regexp first, as before, and only a
pattern Go can't read goes to regexp2 (already in go.sum; now required
directly), with a 100ms bound on one match. A pattern Go reads keeps
exactly the matches it had; one neither reads is still refused with
Go's error. Groups' patterns and providers' auto-include rules both
compile here, so both take it.
Run on mote at this head: go mod verify ok; go vet ./... ok;
GOOS=linux and GOOS=windows go vet ./internal/provider/ ok;
go test -count=1 ./internal/provider/ ok (133s).
Broken by hand: with groupmatch.go/autolist.go/go.mod reverted,
TestRegexpPatternLookahead fails 5 ways (the reporter's error among them).
Not tried: a real group saved in the GUI; the full suite follows the push.
Reported-by: maer8824 (Discord)
|
||
|
|
9a00bfed14 |
deps: moejs v0.1.0
moejs v0.1.0 is out (Ion_Mio_ on X): less memory, about 3x faster than alpha.11 on V8's benchmark, 2.9x C QuickJS on a 100K-token agent request. It pulls in github.com/MoeForge/moego (MIT) for base64. THIRD_PARTY_NOTICES names v0.1.0; sections 1 to 4 of moejs's notices are the same as at alpha.11 (diffed). go mod tidy also marks gen2brain/h265 and santhosh-tekuri/jsonschema direct, which internal/gateway imports. Run at |
||
|
|
a25d3d0815 |
claude: a JSON schema is answered in the interactive mode, through an answer tool
With the interactive mode on, a request with a JSON schema was refused
with a 400 since v0.1.2592: interactive Claude Code takes --json-schema and does nothing
with it, its StructuredOutput tool being -p's alone. It now runs in the
interactive mode like any other request.
- serveClaudeSubscription compiles the schema (santhosh-tekuri/jsonschema
v6.0.3, draft-07 unless it says otherwise, as -p reads one; a $ref
outside the schema is refused, never fetched) and adds an answer tool,
StructuredOutput or a numbered name apart from the client's tools, with
the schema as its input schema, through the bridge's MCP server. A
schema that can't be compiled is a 400 before any run.
- mcpCall checks each call against the schema: one that doesn't fit is
told why (isError) to be made again, as -p's is; one that fits is kept.
- At the turn's result the kept input is the reply's structured output.
A turn that ended with no call is told once to call the tool, and
fails "no answer fitting the schema" if it still doesn't. Neither the
call nor the words around it reach the client.
- claudePrint no longer lists the schema. The two refusal tests
(TestClaudeTUIOnRefusesPrint, TestClaudeTUIRefusalIsNoAccountsFault)
now use the case that is still refused before any run: an image by
its URL that can't be downloaded (127.0.0.1, which magpie never
fetches).
- The provider editor's card no longer says -p takes "a JSON schema"
the interactive mode can't (en, zh-CN, zh-TW, ja, de).
- docs/subsystems/claude-subscription-bridge.md: the refusal list, and
how a schema is answered.
Run:
- A real run, haiku, the test account in a sandbox HOME, real Claude
Code 2.1.316 through the helper with --json-schema and a stdio MCP
server named magpie serving the answer tool and its description: the
result's structured_output was null (the premise), and the model
called mcp__magpie__StructuredOutput at once with
{"color":"Sky blue","hex":"#87CEEB"}, which fits the schema's
pattern. 7.2s, one turn. Not run: the whole gateway path with a real
account (the unit tests drive it with Claude Code's real transcript
rows).
- mote, at this tree (base
|
||
|
|
d614f21721 |
gateway: a HEIC photo goes to the vendor as JPEG, or PNG with alpha (qikamatata on X)
Pi and Pi Desktop send an iPhone photo dragged in as image/heic, and
DeepSeek flash on WorkBuddy (a plugin's fetch) turned it away; most
vendors take JPEG, PNG, GIF and WebP only.
What: heicAsJPEG (heic.go) runs at the top of Server.serve, after
offAsNone, so every route below sees the converted image: a provider's
own, a plugin's fetch, the describer, every translation. count_tokens
does the same. It walks images through walkImages, the one image walker,
so it covers Chat image_url (string or object), Responses input_image,
Anthropic image blocks and Gemini inlineData, tool results included. It
goes by the bytes (ftyp + an HEVC still's brand), so a HEIC labelled
image/jpeg or image/png is converted too, and a JPEG labelled heic is
left alone. Other fields of the block (detail, cache_control) are kept.
Transparent images go as PNG, opaque ones as JPEG q90.
Cost: a body with no "image/hei" and no base64 ftyp mark ("eXB" + 5
chars, at the same place in any base64 that starts at the file) is not
walked. Caps: 48 MB of base64, 50 MP, the long side written at 4096 px,
one decode at a time, 30 s wait (a late result is cached for the next
turn), a 64 MB / 32 entry cache by sha256, since agents resend a
conversation's images every turn. Any failure, panic included, leaves
the image as it came. Measured on mote (M5 Pro): 12 MP 0.44 s, 24 MP
0.86 s, 48 MP 1.6 s / ~1 GB held, freed at once with FreeOSMemory.
Why gen2brain/h265 v0.2.4: pure Go (release builds are CGO_ENABLED=0),
MIT, no dependencies, SIMD on amd64 and arm64, maintained (latest
2026-10-29). Not chosen: gen2brain/heic (wazero WASM or a libheif dylib
through purego), jdeng/goheif (cgo libde265), OS converters (Windows
needs the paid HEVC extension, Linux tools are often missing).
Tests (heic_test.go, fixtures made on mote with sips, 1.6 KB each):
12 shapes converted with their kept fields, pixels kept, 7 non-HEIC
cases byte-identical, a cut file / a panicking decoder / a timeout go
as they came, and a plugin's fetch (fake plugin, new FAKE_SEES image
model) gets JPEG on /v1/chat/completions and /v1/messages.
Run at this tree (
|
||
|
|
60520ddb3b |
moejs: v0.1.0-alpha.11, at its new module path github.com/MoeForge/moejs
Gateway middleware and agent plugins run on moejs. alpha.11 moves the
module to github.com/MoeForge/moejs; every other API change since
alpha.4 is an addition. What magpie gets: faster calls, loops, property
lookups and JSON.parse, allocation-free await, a bytecode verifier, a
correct default.pgo, and Intl / toLocaleString in plugin code.
Checked against both tags' source: every name magpie uses (NewRuntime,
Options, Compile, Link, Hook, Value, Arg, Undefined, NativeFunc,
Referrer, the Promise results, Exception) has the same signature, and
Options' defaults (shared frozen builtins, no timers) are unchanged.
fetch, Streams, URL, node:fs and node:buffer live in the separate
webapi and node packages, installed only on request; magpie installs
neither, so a plugin still reaches no network or file.
Intl's CLDR, Unicode, ICU and V8 material is compiled into every build,
and moejs asks a program that includes it to carry sections 1 to 4 of
its notices. THIRD_PARTY_NOTICES holds them verbatim. Release archives
ship no LICENSE today either; that is not changed here.
Doc and site links (docs/, site/public/docs/{,zh/,ja/}plugins.html)
point at the new repo.
Run on mote at this tree: gofmt; go build -trimpath -s -w (60,670,658
bytes on origin/main
|
||
|
|
6e9820a3a4 |
pii/guard: run AstrLink Guard's int8 model in Go (#3578)
AstrLink Guard (QuantumNous/astrlink-guard, Apache-2.0, on Microsoft's MIT Multilingual-MiniLM-L12-H384) is a 36.9M-parameter BERT token classifier for Chinese and English: 21 BIO labels (email, phone, account, payment_card, ip_address, url, common_secret, private_address, private_date, private_person), 512-token windows overlapping by 128, a 0.8 score floor. Its int8 ONNX is 37 MB. This package runs it with no new dependency and nothing native: an ONNX protobuf reader for the graph and its external data (onnx.go), the XLM-R Unigram tokenizer from tokenizer.json (tokenizer.go), and the encoder with int8 x int8 matmuls (bert.go) on NEON/SDOT kernels on arm64, SSE2 on amd64 and Go elsewhere (kernel*). Word embeddings stay quantized (15 MB in memory, not 61 MB). uax29 moves from an indirect to a direct requirement for the tokenizer's pre-split. Checked against onnxruntime on the publisher's files: the same spans on 69 of 71 eval texts, 232 of 234 real code segments and 24 of 25 positive samples; the rest differ by a span edge at the score floor. One 512-token window takes ~0.5s CPU on arm64 and ~1.2s under Rosetta on amd64, on a box at load ~100. Run: go test ./internal/pii/guard (kernels against the Go reference, tokenizer against the publisher's tokenizer on testdata/tokens.json), gofmt -l, go vet, GOOS=linux go vet -tags nogui and GOOS=windows go vet on amd64 and arm64, at the pushed head. |
||
|
|
88ac42843d |
icons: a big picture is sent to the window scaled to 256px (#909, #1956, #2459)
A webview keeps every picture on the page decoded at its own size. The
Plugins page draws 152 icons at 20 to 64 points, and some stored icons
are 1254x1254, so opening Plugins alone added ~122 MiB to the renderer.
GET /api/icons/{name} now sends a PNG, JPEG or WebP longer than 256px
as a PNG copy scaled to 256 on its longest side (CatmullRom), made on
its first ask under the cache dir (icons-small) through temp-and-rename
and kept. SVGs, small pictures, pictures over 64M pixels and anything
that fails to decode are sent as they are. pruneIcons drops a copy
whose original is gone. golang.org/x/image goes from indirect v0.41.0
to direct v0.43.0 (needs only x/text v0.38, nothing else bumped).
Measured in Chromium (WebView2's engine) on a dev backend with a copy
of the real library and its 111 stored icons (6.2 MB):
- renderer RSS after opening Plugins: 369 -> 304 MiB
- renderer after visiting every page, on Settings: 310 -> 290 MiB
- decoded image area on Plugins: 18.5 -> 6.5 megapixels
- 15 scaled copies made, 596 KB in all
What is left on Plugins is SVGs, which rasterise at draw size.
Run at this head (before rebase onto
|
||
|
|
de49433ff8 |
filememo: another process's writes to magpie's files are watched for, not polled every 5s (#3185)
An idle magpie still woke a dozen times on each 5s beat: the loops that follow plugins.yml, settings.json, providers.json, the plugin list, tools and access each looked at the disk for what the CLI or a second magpie wrote. The gateway now watches those files' folders (fsnotify: FSEvents, inotify, ReadDirectoryChangesW), and a change from another process wakes the same loops at once, as magpie's own writes do (filememo.Written). With the watch running the loops look for a change they missed only once a minute (OthersEvery); where the folders can't be watched, or the watch errs, they go on looking every 5s. Run at |
||
|
|
a2e98cd799 |
gateway: a streamed Codex turn goes to ChatGPT over its WebSocket (brickhao)
brickhao on Discord: long Codex turns through magpie died with "stream
closed before response.completed". Their network (FlClash) cuts a
streamed HTTP reply from chatgpt.com at about 120 s: 120.7 s through
magpie, 121.5 s over HTTP without magpie. Codex's own WebSocket to the
same backend ran to the end twice (124.5 s, 131.4 s). magpie has no
120 s timer of its own (no WriteTimeout, 10 min to the first header).
The cut is on the leg from magpie to chatgpt.com, which was always
HTTP. Codex answers magpie's 426 by falling back to HTTP, and over
loopback that is harmless.
What changed: codexSocket, first in upstreamTransport, sends a POST to
CodexBase/responses with "stream":true over the backend's WebSocket, as
codex-rs does (ResponseCreateWsRequest, build_websocket_headers).
- Handshake: the turn's headers plus OpenAI-Beta:
responses_websockets=2026-02-06. x-codex-turn-state and the
responses-lite header go in client_metadata instead. The message is
the body (zstd decoded) with "type":"response.create" ahead of it.
- Frames come back as the SSE the HTTP route sends.
codex.rate_limits and codex.response.metadata are also given as the
x-codex-* and x-codex-turn-state headers. websocket_timing is dropped.
- An error frame ahead of the reply becomes its HTTP status and body,
so account rests and failover work as before.
- These go over HTTP: a refused handshake (and the host stays on HTTP
for 10 min, unless the refusal was 401/429/5xx),
websocket_connection_limit_reached, and a body that isn't a streamed
turn.
- A socket closed before the end reads as a cut stream.
- Both Codex's own sign-in passthrough and magpie's ChatGPT accounts
take this path. Codex identity, instructions and prompts are
unchanged. coder/websocket is now a direct dependency (it was
indirect).
Run:
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows ok.
- go test -race -count=3 of the five new tests: ok.
- go test -timeout 45m at 1a5911612 (rebased on origin/main
|
||
|
|
861bbef2d5 |
sqlite: an environment entry with no "=" no longer ends magpie at its first SQLite open, where modernc's libc printed TODOTODO and exited (#2327, goodloop)
A magpie started from Alfred under the MacSec DLP tool quit about two
seconds after launch, exit 1, no crash report. Its environment held an
entry with no "=" ("hains/MacSec/libesafenet.dylib", a fragment of the
tool's injected dylib path). The first SQLite open (a session scan)
reads SQLITE_TMPDIR through modernc's libc, whose getenv on darwin,
windows and the BSDs (libc.go, not the musl build Linux uses) hits that
entry, calls todo() and os.Exit(1): "libc.go:1816:getenv: TODOTODO
"SQLITE_TMPDIR" "hains/MacSec/libesafenet.dylib"", the reporter's line.
New package internal/sqlitedb is the one importer of modernc.org/sqlite
in magpie's own code (it replaces the blank imports in
internal/provider/importapps.go and internal/agent/cindy.go, the only
two). Its init hands libc.SetEnviron a copy of os.Environ with the
entries that have no "=" left out, before any open and before any
goroutine, which also keeps libc's unlocked first-use SetEnviron from
racing. modernc.org/libc becomes a direct requirement (v1.67.6, same
version). Snapshot timing: libc's copy is now taken at init, not at the
first open; nothing in magpie sets SQLITE_TMPDIR, TMPDIR or TZ, the
only variables SQLite reads.
Run (worktree at origin/main
|
||
|
|
92ac1c878e |
search: the web search MCP server has a web_fetch tool that reads a page by its URL (#2286, blackrion)
An agent that mounted magpie's web search over MCP (Cursor, Claude Desktop) found pages it couldn't open: it has no fetch tool of its own. web_fetch (url, max_chars, offset) reads one. - The URL is the agent's, so the page is downloaded the way a caller's image is (publicClient): public addresses only, every resolved address checked and pinned, redirects (at most 5) checked the same, a request from this computer included; only http and https. 30 s and 5 MiB at most. - HTML is decoded from its charset (x/net/html/charset; golang.org/x/net added) and given as Markdown: title, headings, lists, links made absolute, code and pre; script, style, hidden elements dropped. Other text as it is; anything else, or a 4xx/5xx, is the tool's error. - 20000 characters by default (at most 100000) from offset, with the offset the rest starts at. - Each call reserves the gateway key's limit, as a search does. - The tool description is neutral (names neither magpie nor a vendor). - GUI: the MCP row's text names both tools (en, zh, zh-TW, ja, de). Docs: gateway-routing's MCP section, README (en, zh-CN). Run: go test -tags nogui ./internal/gateway -run 'WebFetch|SearchMCP'; GOOS=linux/windows go vet ./internal/gateway; gofmt -l clean. GUI: search-mcp, i18n-keys, gui-ja, gui-de, gui-zh-tw 32/32 (chromium + webkit). Broken by hand: webFetchClient = http.DefaultClient turns TestWebFetchOnlyPublic red (the local test server was reached). Tried by hand (a throwaway test, not committed) against go.dev/doc, en.wikipedia.org/wiki/Magpie and http://github.com/yetone (redirected to https; links come out by name, not the pinned address: the first try gave https://216.239.34.21:443/..., fixed by taking each redirect's URL from CheckRedirect), and an httpbin redirect to 127.0.0.1, refused. Full suite: SUITE_LINE |
||
|
|
e4882f91de |
go: 1.26.8, whose race detector leaves a forked child alone before exec on macOS (#1184)
macOS race CI failed now and then with "write |1: file already closed" on a Claude subscription run's first prompt (TestClaudeAuthFailureFallsBackWithoutRetryingTheLogin in 37605014029, TestClaudeLastWordsAreRead in 37464400652; 37612795871 got the same failure as "broken pipe"). The Claude Code stand-in had already ended when the first prompt was written, and Wait had closed its stdin. It never ran. On the fork's macOS runners, a debug build that recorded the process's status at the failed write caught 8 cases in 10 jobs. Each was "signal: segmentation fault", under 1ms of CPU, nothing on stderr, with no magpie abort or group kill. The crash report (gateway.race-*.ips) says "crashed on child side of fork pre-exec": __tsan::TraceSwitchPartImpl syscall.rawSyscall syscall.forkAndExecInChild syscall.forkExec os.StartProcess exec.(*Cmd).Start proc.StartTree gateway.(*subscriptionRun).launch This is golang/go#79804. From Go 1.26.0, darwin's raw syscall wrappers are instrumented under -race, and forkAndExecInChild calls them in the child of fork. Go 1.26.5 marks them //go:norace (#79806); go.mod's 1.26.3, which setup-go builds CI with, has the bug. Only -race test binaries on macOS are affected, so released builds never were. Any os/exec start in a macOS race test could hit it; the Claude subscription tests were where it surfaced. Local runs on go1.27.1 couldn't reproduce it, because that release already has the fix. 1.26.8 is the latest 1.26 patch release. |
||
|
|
89825eca1a |
go.mod: go mod tidy — moejs is required directly (internal/gateway imports it), and go.sum drops testify 1.11.1 and go-spew/go-difflib, which nothing builds with
go mod verify, go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and the gateway and library tests pass. |
||
|
|
eebd0b4222 | plugin, gateway, gui: a plugin can be gateway middleware — onRequest, onEvent and onResponse run in magpie's gateway on what agents send and get back (moejs) — a plugin could only be a subscription provider, run in the Bun host, a process away from the gateway. A plugin may now declare middleware (package.json magpie.middleware, or a *.middleware.js / .mjs file), run in-process by moejs (pure-Go JS engine): compiled once, one runtime per request from a pool, so every hook of a request shares ctx.state. onRequest(body, ctx) sees the agent's body in its own API before routing; what it returns is the body the next middleware and the gateway get, undefined leaves the bytes as they were, ctx.reject(status, msg) answers with an error in the agent's API's shape. onEvent(ev, ctx) sees each SSE event's JSON (export const events = [...] filters by name; an object changes it, null drops it, undefined passes the bytes through untouched; data: [DONE] is no JSON and passes by). onResponse(body, ctx) sees a whole JSON reply, with ctx.status. ctx has protocol, model, stream, path, agent, the plugin's options and state. A hook that throws, returns a non-object or runs past its limit (250ms request/response, 50ms an event, 1s load; interrupted) leaves the request or reply as it was and is counted and logged (60 lines a minute); a compressed reply passes as-is. Files are reloaded within a second of a change. Only agents' requests run through it (serveAgent at the gateway's agent entry points and the Codex backend), never magpie's own titles, classifier or stand-ins; it sees bodies before redaction. A middleware-only package is skipped by the Bun host. The Plugins page marks a middleware with a chip, its hooks, calls and µs per call (JSON in and out counted), failures in red with the last error, and a load error. en/zh/ja/de; docs/reference.md and usemagpie.ai/docs/plugins#middleware (en/zh/ja) with an alias example. Tested with a real DeepSeek account through magpie web --gateway in a sandbox HOME: an alias middleware served "fast" and named it in message_start, a reject came back as 403 permission_error, a Chat stream uppercased; real Claude Code (sandbox CLAUDE_CONFIG_DIR) did Read, Bash and Glob tool turns through three middlewares with 0 failures: ≈1–1.6µs an event, 0.2–0.7ms an onRequest that parses and rewrites Claude Code's ≈80KB body. Real use found two bugs fixed here: [DONE] parsed as JSON (SyntaxError on every Chat stream) and stats leaving out the JSON time. internal/middleware tests (chain, undefined keeps bytes, reject, fail-open on throw/spin/string with the runtime reused, async hook, load errors, off and Bun skip, reload, split/CRLF/filtered/dropped stream events, [DONE] untouched, whole reply and gzip, 64 in parallel; BenchmarkEvent ≈0.9µs, 11 allocs) and TestMiddlewareThroughGateway (alias routed, events by protocol, redaction still upstream, reject in Anthropic's shape; fails without the change) are new; plugin-middleware.test.cjs (Chromium and WebKit, en and zh: chip, hooks and stats, failures with last error, broken and off, no left border) fails without it. The other plugin GUI tests and click-scroll pass in WebKit. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass (internal/provider failed once under load and passes alone). | ||
|
|
e698e7dddd |
claude: adding a Claude account is Claude Code's own claude auth login, and magpie never refreshes a Claude sign-in nor asks Anthropic anything with one (the user: 把 magpie 自己的 Claude 登录改成直接用 claude /login,只要体验上没什么差别就改) — magpie traded the sign-in page's code for tokens with Claude Code's OAuth client, asked Anthropic's profile and model list with them, refreshed saved accounts itself (daily keepalive included) and handed a saved account to Claude Code as CLAUDE_CODE_OAUTH_TOKEN. Now Add account runs claude auth login --claudeai in a config directory of magpie's own: the page Claude Code would open comes to magpie's window (Claude Code is given magpie as its BROWSER, which writes the page down and exits), the browser comes back to Claude Code's own listener, and when the browser can't reach this machine the address it ended on, or the code Claude's page shows, is pasted as before and handed to Claude Code. Who signed in is what Claude Code kept (.claude.json, auth status). A saved account in use beside the signed-in one runs Claude Code with CLAUDE_CONFIG_DIR set to its own directory (claude-accounts/ beside magpie's config), its sign-in put there once from logins.json and read back as Claude Code refreshes it; switching to it moves it into Claude Code's own store and removes the directory, as forgetting it does. Claude's models are the catalog's (models.dev), not asked of Anthropic; an imported Claude login is kept as the file has it, and Claude Code refreshes it on first use. Claude Code is required to add a Claude account. TestClaudeSignInByPaste, TestClaudeSignInByPastedAddress, TestClaudeSavedAccountDir (a fake claude CLI, and a server standing in for Anthropic that fails the test if asked) and the reworked sign-in, import and gateway tests fail without the change. With the real Claude Code 2.1.286 in a sandbox directory, its sign-in page (localhost callback) reached magpie's binary and the sign-in waited for the browser; nothing was left behind once it was canceled. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass; claude-risk, plugin-signin, signin-callback, signin-link, signin-paste-codex, routing-signin, own-signin-remove, click-scroll, old-webkit pass.
|
||
|
|
b0a0165fc9 | usage: a notification when a window is nearly used up or a balance runs low (#368) — Settings has Usage alert (off, or a share of 1–100%, 80 by default) and Low balance alert (off, or an amount, 5 by default), and magpie quota alert sets them from the command line. Each subscription or plan window, other than one set aside, is told once a run when it reaches the share, and a balance once until topped up past the amount again; what was said is kept, so a restart doesn't say it again, and a failed or stale reading neither alerts nor clears. The system's notifications are started only when first needed, so a Mac build that can't have them or a Linux desktop without a daemon still starts, and Settings says when they are refused or unavailable; a click opens the Usage page. TestDueAlerts and friends, TestAlertText and usage-alert.test.cjs fail without the change. | ||
|
|
839c762098 | app: Magpie is in the Start menu on Windows (#158: Windows 便携版首次运行后,无法在开始菜单 / 系统搜索中找到 Magpie — @Aimer779) — the Windows build is one portable exe with no installer, so nothing put it anywhere Windows search looks. Each start of the desktop app (not the CLI, TUI or serve) now makes sure %APPDATA%\Microsoft\Windows\Start Menu\Programs\Magpie.lnk (the Programs known folder) opens the exe it runs as, symlinks resolved, in its folder, with its icon and "Magpie" as its description; one that already does is left be, one for where the exe was before it was moved is pointed here again. It is the shell's own link, made through WScript.Shell with go-ole (already in the build through Wails, now a direct require), in the background beside the magpie:// registration, and a failure is only logged. An update replaces the exe in place, so the shortcut stays good; a magpie left running from magpie.exe.old(-N) (or .new) points it at magpie.exe, never at what was moved aside. HKCU App Paths\magpie.exe is set to the exe (and its folder) so Win+R magpie opens it too. No uninstall entry, nothing copied. MAGPIE_NO_SHORTCUT=1 skips it (tests, sandboxes); other systems do nothing. Tested with the Windows test built here and run on Windows 11: a shortcut made, left as it was on a second start, pointed at the moved exe. Run on Windows 11 as the desktop app: the shortcut made with the exe's folder and icon, pointed anew after the exe moved, left as it was on a start with nothing changed; App Paths set | ||
|
|
d36dbe46f5 | chore: go mod tidy (#66) | ||
|
|
dfc2d7fa93 | library: MCP servers, skills and instructions are kept once in magpie and given to any agent from one place, with a market to find and add them (#29). Each agent reads MCP servers and skills from files of its own and in a format of its own, so one server was set up again in Claude Code, Codex, Gemini CLI, OpenCode, Pi, Goose, Cursor, Copilot CLI and Crush. The Library view keeps each once: a server is added (stdio, http or sse, its env and headers) and switched on per agent with its icon, and magpie writes it into each agent's config in that agent's format, leaving what the agent has of its own as it is; a server or skill an agent already has is shown, to bring into the library. A skill is a folder with a SKILL.md, kept in the library from GitHub (owner/repo, or a link to a folder in one; updated from it later) or linked from a folder on this machine, and linked into each agent's skills folder. The instructions every agent reads (CLAUDE.md, AGENTS.md, GEMINI.md…) can be kept as one too. The market offers checked MCP servers first, then the official MCP Registry's, filled in from what the registry says each needs (keys asked for in a form, never guessed), and skills.sh's most installed skills with what each says it is for; each shows its real icon (the vendor's own, else its GitHub owner's), fetched through magpie only for the icons the market or the library gave out, and an added server or skill keeps its icon in the library. What magpie changes in an agent's files is backed up first | ||
|
|
c3931c91df | codex: magpie's models join Codex's own rather than replacing them — signed in (ChatGPT or an API key), Codex keeps its built-in OpenAI provider and sign-in and is pointed at magpie with openai_base_url alone, so its official models still go to OpenAI on the user's own account, its threads (listed per provider) stay together, and the Codex app keeps its model picker; magpie's gateway answers at /backend-api/codex, passing Codex's own models through as they came, serving magpie's (provider/model) itself, and handing out OpenAI's model list with magpie's after it for /model. Compacting a magpie model's conversation is done by that model with Codex's own prompt; Codex's compressed request bodies are read, and usage is counted for both. Not signed in, magpie stays a provider of Codex's as before; a magpie set up that way moves over the next time a magpie model is picked | ||
|
|
41931e2895 | agent: omp (oh-my-pi) — its model picked in magpie like any agent's; a model through magpie adds magpie as a keyless provider in ~/.omp/agent/models.yml with the catalog as its models, and sets config.yml's modelRoles.default to magpie/<provider>/<model>; its other roles and the rest of both files stay as they are, comments too, and default takes magpie's entry out unless another role still uses it (#34) | ||
|
|
efbe5660b0 |
backup: everything set up in magpie carried to another machine in one file — magpie backup writes the providers with their keys (or none, with --no-keys), the pictures picked for them, the settings, the profiles and every agent's model, sealed with a passphrase (AES-256-GCM, PBKDF2-SHA256) so nothing in it reads without it; magpie restore puts it in, replacing providers by id, keeping the keys already there for one that came without, and setting models only for the agents installed there; subscriptions stay with the machine they were signed in on (#28)
|
||
|
|
0b0f258c0f | providers: import from other apps — the add sheet's Import… reads the providers CC Switch (its database, or the older config.json) and Alma have set up, read-only, and lists them to pick from: what magpie has already is marked, a key for a vendor that is already here can join it as another key, an id in use is kept beside or replaced, and sign-ins, Azure, Gemini-protocol relays and entries pointing at magpie itself are shown but not offered; keys are read again on import and only reach the window masked | ||
|
|
4bd3f3a4b5 |
import: magpie://import links add a provider after the user confirms
A vendor or relay can hand out a ready-made provider as a link. The app registers the magpie scheme (Info.plist on macOS, HKCU on Windows, a .desktop handler on Linux), a second launch hands the link to the running one, and the window shows what the link would add, with the hosts the prompts and key would go to, before anything is saved. `magpie import` does the same in a terminal. |
||
|
|
402a96c39d |
Rename dial to magpie, with a magpie for a logo
The product, module path (github.com/yetone/magpie), binaries, env vars (MAGPIE_ADDR, MAGPIE_DEV_UI, MAGPIE_THEME, MAGPIE_DEBUG), config and cache folders (~/.config/magpie, ~/.cache/magpie), bundle id (com.yetone.magpie), gateway provider id and token, and every UI string now say magpie. On first run magpie copies ~/.config/dial and ~/.cache/dial to the new folders when they don't exist yet (copy, not move, so a still-running dial keeps working; the old folders can be deleted by hand later). The logo is a small round magpie in profile: one path for the header and the tray, and the app tile adds the white belly and the blue-green tail. The header mark is drawn in ink rather than the accent colour, which fought the text in light mode. |
||
|
|
0a234ce41d |
dial: one dial for every coding agent's model
Wails v3 tray panel and window, TUI and CLI. Switches model, effort and provider for Claude Code, Codex, Gemini CLI, OpenCode, Pi, Goose, Cursor, Copilot CLI and Crush with format-preserving config edits. Providers page and registry, stored keys, live vendor model lists, profiles. Co-Authored-By: Claude <noreply@anthropic.com> |