@godwit/magpie-agent 0.0.0-stage → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +25 -2
  2. package/agent.js +42 -0
  3. package/package.json +34 -4
package/README.md CHANGED
@@ -1,3 +1,26 @@
1
- # Temporary Holding Version
1
+ # @godwit/magpie-agent
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Connects [Godwit](https://godwit.email) to [magpie](https://usemagpie.ai): Godwit's Wit can then use magpie's models, the MCP servers in magpie's library (memory, web search, browser and the tools of magpie's plugins), its skills and its instructions.
4
+
5
+ ```sh
6
+ magpie plugin add @godwit/magpie-agent
7
+ ```
8
+
9
+ Then turn Godwit on in magpie's Agents page and choose a model (or `magpie godwit <model>`). In magpie's Library, give Godwit the MCP servers, skills and instructions you want it to have: like every agent, it gets only those given to it.
10
+
11
+ ## What it writes
12
+
13
+ magpie writes into `~/.godwit/external/`, and Godwit (of this package's version or later) mirrors it:
14
+
15
+ | File | In Godwit |
16
+ |---|---|
17
+ | `models.json` | A model service named `magpie`, with every model magpie gives Godwit, written as magpie describes them; Godwit takes their names and context windows (routing groups included). The model chosen in magpie is Godwit's default model while connected; Godwit reads it from the file and keeps your own default beneath it. |
18
+ | `mcp.json` | magpie's MCP servers. Each starts without a grant: Godwit asks you to grant it in Settings → Extensions before it runs. |
19
+ | `skills/` | magpie's skills (linked from magpie's library), beside your own. A skill of yours with the same name wins. |
20
+ | `AGENTS.md` | Your instructions from magpie's library, added to Wit's system prompt. |
21
+
22
+ Godwit shows each of them as managed by magpie: change them in magpie, not in Godwit. Requests to the model go through magpie's gateway on this computer, and Godwit masks them the same as for any model service.
23
+
24
+ ## Disconnecting
25
+
26
+ Turn Godwit off in magpie (or `magpie godwit default`): magpie restores the file, Godwit removes the `magpie` model service, and your own default model is the default again. The library's MCP servers, skills and instructions follow magpie's Library, as for any agent: take them from Godwit there and Godwit removes them too.
package/agent.js ADDED
@@ -0,0 +1,42 @@
1
+ // The Godwit agent for magpie (https://usemagpie.ai/docs/plugins#agents).
2
+ // magpie writes these files and restores them when the user disconnects;
3
+ // Godwit mirrors them as read-only settings (ADR 0041 in the Godwit repo).
4
+ // One path on every system: this file runs in moejs and cannot tell them apart.
5
+ // Godwit creates the folder when it starts, which is how magpie finds it installed.
6
+ const dir = "~/.godwit/external"
7
+
8
+ export const agent = {
9
+ id: "godwit",
10
+ name: "Godwit",
11
+ icon: "https://godwit.email/icon.png", // on the agent itself: a plugin loaded from a folder has no package icon
12
+ bin: "godwit",
13
+ dir,
14
+ config: `${dir}/models.json`,
15
+ model: "magpie.model", // the default model Godwit switches to
16
+ ua: ["godwit"],
17
+ notice: "Godwit picks this up within a few seconds.",
18
+ library: {
19
+ instructions: `${dir}/AGENTS.md`,
20
+ mcp: `${dir}/mcp.json`,
21
+ mcpFormat: "claude",
22
+ skills: `${dir}/skills`,
23
+ },
24
+ }
25
+
26
+ // connect is the service Godwit adds: the gateway's address, this agent's own
27
+ // key and every model magpie gives it, as magpie describes them (name, context
28
+ // window, efforts…); Godwit takes what it uses. Key by key, not one object:
29
+ // magpie tells it is connected by the key holding its key, and the model key
30
+ // sits beside them. magpie calls it again when the models change.
31
+ export function connect({ gateway, model, models }) {
32
+ if (!gateway?.v1 || !gateway?.key) throw new Error("magpie gave no gateway address or key")
33
+ const list = [...(models ?? [])]
34
+ if (model?.id && !list.some((m) => m.id === model.id)) list.push(model) // the chosen one is always offered
35
+ return {
36
+ "magpie.by": "magpie",
37
+ "magpie.baseURL": gateway.v1,
38
+ "magpie.apiKey": gateway.key,
39
+ "magpie.kind": "openai",
40
+ "magpie.models": list,
41
+ }
42
+ }
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
2
  "name": "@godwit/magpie-agent",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.37.0",
4
+ "description": "Connect Godwit to magpie: its models, MCP servers, skills and instructions",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/godwit-email/godwit.git",
10
+ "directory": "packages/magpie-agent"
11
+ },
12
+ "homepage": "https://github.com/godwit-email/godwit/tree/main/packages/magpie-agent",
13
+ "keywords": [
14
+ "magpie",
15
+ "magpie-agent",
16
+ "magpie-plugin",
17
+ "llm-gateway",
18
+ "godwit"
19
+ ],
20
+ "files": [
21
+ "agent.js",
22
+ "README.md"
23
+ ],
24
+ "magpie": {
25
+ "agent": "./agent.js",
26
+ "name": "Godwit",
27
+ "icon": "https://godwit.email/icon.png",
28
+ "summary": {
29
+ "en": "Use magpie's models, MCP servers, skills and instructions in Godwit's Wit.",
30
+ "zh": "在 Godwit 的 Wit 里使用 magpie 的模型、MCP 服务器、技能和指令。"
31
+ }
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ }
36
+ }