mercury-agent 0.4.5 → 0.4.6
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.
- package/container/agent-package.json +1 -1
- package/docs/container-lifecycle.md +2 -2
- package/examples/extensions/permission-guard/index.ts +1 -1
- package/package.json +4 -4
- package/resources/pi-extensions/subagent/agents.ts +1 -1
- package/resources/pi-extensions/subagent/index.ts +5 -5
- package/src/agent/model-capabilities.ts +1 -1
- package/src/cli/mercury.ts +25 -2
- package/src/extensions/permission-guard.ts +1 -1
- package/src/storage/pi-auth.ts +1 -1
|
@@ -228,7 +228,7 @@ You can use custom Docker images via `MERCURY_AGENT_IMAGE`.
|
|
|
228
228
|
|
|
229
229
|
Your image **must** have:
|
|
230
230
|
- `bun` runtime
|
|
231
|
-
- `pi` CLI (`@
|
|
231
|
+
- `pi` CLI (`@earendil-works/pi-coding-agent`)
|
|
232
232
|
- `bubblewrap` (for agent sandboxing)
|
|
233
233
|
- `mrctl` wrapper (copied during build)
|
|
234
234
|
Extension CLIs (e.g. `pinchtab`, `napkin`, `gws`) are installed in derived images at runtime based on `.mercury/extensions/*` declarations.
|
|
@@ -279,7 +279,7 @@ RUN curl -fsSL https://bun.sh/install | bash
|
|
|
279
279
|
ENV PATH="/home/mercury/.bun/bin:$PATH"
|
|
280
280
|
|
|
281
281
|
# Install required CLIs
|
|
282
|
-
RUN bun add -g @
|
|
282
|
+
RUN bun add -g @earendil-works/pi-coding-agent
|
|
283
283
|
|
|
284
284
|
# Optional: install Playwright/Chromium if your extensions need browser automation
|
|
285
285
|
RUN bunx playwright install chromium
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* directly and blocks them with a message to use `mrctl` instead.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import type { ExtensionAPI } from "@
|
|
20
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
21
21
|
|
|
22
22
|
export default function (pi: ExtensionAPI) {
|
|
23
23
|
const extClisEnv = process.env.MERCURY_EXT_CLIS;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mercury-agent",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Personal AI assistant for chat platforms (WhatsApp, Slack, Discord, Telegram)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Avishai Tsabari",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"@chat-adapter/slack": "^4.14.0",
|
|
65
65
|
"@chat-adapter/teams": "^4.17.0",
|
|
66
66
|
"@chat-adapter/telegram": "^4.26.0",
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
69
|
-
"@
|
|
67
|
+
"@earendil-works/pi-agent-core": "~0.79.6",
|
|
68
|
+
"@earendil-works/pi-ai": "~0.79.10",
|
|
69
|
+
"@earendil-works/pi-coding-agent": "~0.79.6",
|
|
70
70
|
"@whiskeysockets/baileys": "^7.0.0-rc.9",
|
|
71
71
|
"axios": "^1.15.1",
|
|
72
72
|
"chat": "^4.14.0",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as fs from "node:fs";
|
|
6
6
|
import * as path from "node:path";
|
|
7
|
-
import { getAgentDir, parseFrontmatter } from "@
|
|
7
|
+
import { getAgentDir, parseFrontmatter } from "@earendil-works/pi-coding-agent";
|
|
8
8
|
|
|
9
9
|
export type AgentScope = "user" | "project" | "both";
|
|
10
10
|
|
|
@@ -16,11 +16,11 @@ import { spawn } from "node:child_process";
|
|
|
16
16
|
import * as fs from "node:fs";
|
|
17
17
|
import * as os from "node:os";
|
|
18
18
|
import * as path from "node:path";
|
|
19
|
-
import type { AgentToolResult } from "@
|
|
20
|
-
import type { Message } from "@
|
|
21
|
-
import { StringEnum } from "@
|
|
22
|
-
import { type ExtensionAPI, getMarkdownTheme } from "@
|
|
23
|
-
import { Container, Markdown, Spacer, Text } from "@
|
|
19
|
+
import type { AgentToolResult } from "@earendil-works/pi-agent-core";
|
|
20
|
+
import type { Message } from "@earendil-works/pi-ai";
|
|
21
|
+
import { StringEnum } from "@earendil-works/pi-ai";
|
|
22
|
+
import { type ExtensionAPI, getMarkdownTheme } from "@earendil-works/pi-coding-agent";
|
|
23
|
+
import { Container, Markdown, Spacer, Text } from "@earendil-works/pi-tui";
|
|
24
24
|
import { Type } from "@sinclair/typebox";
|
|
25
25
|
import { type AgentConfig, type AgentScope, discoverAgents } from "./agents.js";
|
|
26
26
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { existsSync, readFileSync } from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
|
-
import { getModels, type KnownProvider } from "@
|
|
7
|
+
import { getModels, type KnownProvider } from "@earendil-works/pi-ai";
|
|
8
8
|
import { parse as parseYaml } from "yaml";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import type { ModelLeg } from "../config.js";
|
package/src/cli/mercury.ts
CHANGED
|
@@ -820,7 +820,7 @@ authCommand
|
|
|
820
820
|
)
|
|
821
821
|
.action(async (providerArg?: string) => {
|
|
822
822
|
const { getOAuthProviders, getOAuthProvider } = await import(
|
|
823
|
-
"@
|
|
823
|
+
"@earendil-works/pi-ai/oauth"
|
|
824
824
|
);
|
|
825
825
|
const readline = await import("node:readline");
|
|
826
826
|
const { exec } = await import("node:child_process");
|
|
@@ -913,6 +913,12 @@ authCommand
|
|
|
913
913
|
: "xdg-open";
|
|
914
914
|
exec(`${openCmd} "${info.url}"`);
|
|
915
915
|
},
|
|
916
|
+
onDeviceCode: (info: { userCode: string; verificationUri: string }) => {
|
|
917
|
+
console.log(
|
|
918
|
+
`\nOpen this URL in your browser:\n ${info.verificationUri}`,
|
|
919
|
+
);
|
|
920
|
+
console.log(`Enter code: ${info.userCode}\n`);
|
|
921
|
+
},
|
|
916
922
|
onPrompt: async (prompt: { message: string; placeholder?: string }) => {
|
|
917
923
|
const answer = await new Promise<string>((resolve) => {
|
|
918
924
|
rl.question(
|
|
@@ -922,6 +928,23 @@ authCommand
|
|
|
922
928
|
});
|
|
923
929
|
return answer;
|
|
924
930
|
},
|
|
931
|
+
onSelect: async (prompt: {
|
|
932
|
+
message: string;
|
|
933
|
+
options: Array<{ id: string; label: string }>;
|
|
934
|
+
}) => {
|
|
935
|
+
console.log(`\n${prompt.message}`);
|
|
936
|
+
for (let i = 0; i < prompt.options.length; i++) {
|
|
937
|
+
console.log(` ${i + 1}. ${prompt.options[i].label}`);
|
|
938
|
+
}
|
|
939
|
+
const answer = await new Promise<string>((resolve) => {
|
|
940
|
+
rl.question("Choose (number): ", resolve);
|
|
941
|
+
});
|
|
942
|
+
const idx = Number.parseInt(answer, 10) - 1;
|
|
943
|
+
if (idx >= 0 && idx < prompt.options.length) {
|
|
944
|
+
return prompt.options[idx].id;
|
|
945
|
+
}
|
|
946
|
+
return undefined;
|
|
947
|
+
},
|
|
925
948
|
onProgress: (message: string) => {
|
|
926
949
|
console.log(message);
|
|
927
950
|
},
|
|
@@ -999,7 +1022,7 @@ authCommand
|
|
|
999
1022
|
.command("status")
|
|
1000
1023
|
.description("Show authentication status for all providers")
|
|
1001
1024
|
.action(async () => {
|
|
1002
|
-
const { getOAuthProviders } = await import("@
|
|
1025
|
+
const { getOAuthProviders } = await import("@earendil-works/pi-ai/oauth");
|
|
1003
1026
|
|
|
1004
1027
|
const dataDir = getProjectDataDir(CWD);
|
|
1005
1028
|
const authPath = join(CWD, dataDir, "global", "auth.json");
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Set automatically by Mercury's runtime based on caller permissions.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import type { ExtensionAPI } from "@
|
|
14
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
15
15
|
|
|
16
16
|
export default function (pi: ExtensionAPI) {
|
|
17
17
|
const deniedEnv = process.env.MERCURY_DENIED_CLIS;
|