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.
@@ -3,6 +3,6 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@mariozechner/pi-coding-agent": "^0.67.2"
6
+ "@earendil-works/pi-coding-agent": "~0.79.6"
7
7
  }
8
8
  }
@@ -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 (`@mariozechner/pi-coding-agent`)
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 @mariozechner/pi-coding-agent
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 "@mariozechner/pi-coding-agent";
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.5",
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
- "@mariozechner/pi-agent-core": "^0.65.2",
68
- "@mariozechner/pi-ai": "^0.67.6",
69
- "@mariozechner/pi-coding-agent": "^0.65.2",
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 "@mariozechner/pi-coding-agent";
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 "@mariozechner/pi-agent-core";
20
- import type { Message } from "@mariozechner/pi-ai";
21
- import { StringEnum } from "@mariozechner/pi-ai";
22
- import { type ExtensionAPI, getMarkdownTheme } from "@mariozechner/pi-coding-agent";
23
- import { Container, Markdown, Spacer, Text } from "@mariozechner/pi-tui";
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 "@mariozechner/pi-ai";
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";
@@ -820,7 +820,7 @@ authCommand
820
820
  )
821
821
  .action(async (providerArg?: string) => {
822
822
  const { getOAuthProviders, getOAuthProvider } = await import(
823
- "@mariozechner/pi-ai/oauth"
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("@mariozechner/pi-ai/oauth");
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 "@mariozechner/pi-coding-agent";
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;
@@ -4,7 +4,7 @@ import {
4
4
  getOAuthApiKey,
5
5
  type OAuthCredentials,
6
6
  type OAuthProviderId,
7
- } from "@mariozechner/pi-ai/oauth";
7
+ } from "@earendil-works/pi-ai/oauth";
8
8
  import { logger } from "../logger.js";
9
9
 
10
10
  type AuthEntry =