@cmdoss/agent-pass-plugin 0.1.2-dev.24.1 → 0.1.2-dev.26.1

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/dist/http.js CHANGED
@@ -20,7 +20,7 @@ export function setupInfo(port, mode = "paper") {
20
20
  promptPreview: "Set up Senro, connect its MCP, and help me start a strategy.",
21
21
  commands: {
22
22
  codex: `codex mcp add agent-pass-plugin --env AGENT_PASS_PLUGIN_LOCAL_URL=http://127.0.0.1:${port} -- node ${root}/dist/mcp.js`,
23
- claude: `claude mcp add --transport stdio --env AGENT_PASS_PLUGIN_LOCAL_URL=http://127.0.0.1:${port} agent-pass-plugin -- node ${root}/dist/mcp.js`,
23
+ claude: `claude mcp add agent-pass-plugin --transport stdio --env AGENT_PASS_PLUGIN_LOCAL_URL=http://127.0.0.1:${port} -- node ${root}/dist/mcp.js`,
24
24
  },
25
25
  mcpConfig: {
26
26
  mcpServers: {
@@ -21,15 +21,30 @@ function publicReleaseIdentity(env) {
21
21
  artifactSha256: hexadecimal("RELEASE_ARTIFACT_SHA256", 64),
22
22
  };
23
23
  }
24
- export function publicSetup() {
24
+ /**
25
+ * npm version the hosted setup prompt installs. Defaults to package.json; a
26
+ * deployment built from `dev` sets SETUP_PACKAGE_VERSION to the matching
27
+ * published prerelease (for example 0.1.2-dev.24.1), because CI computes that
28
+ * version at publish time and the source package.json only holds the stable base.
29
+ */
30
+ function setupPackageVersion(env) {
31
+ const value = env.SETUP_PACKAGE_VERSION;
32
+ if (value === undefined || value === "")
33
+ return packageMetadata().version;
34
+ if (!/^\d+\.\d+\.\d+(?:-[0-9a-z]+(?:\.[0-9a-z]+)*)?$/i.test(value))
35
+ throw new Error("SETUP_PACKAGE_VERSION must be a published npm version such as 0.1.2 or 0.1.2-dev.24.1.");
36
+ return value;
37
+ }
38
+ export function publicSetup(version = packageMetadata().version) {
25
39
  return {
26
- prompt: `Set up Senro, powered by Agent Pass, locally from the public npm package @cmdoss/agent-pass-plugin@${packageMetadata().version}. Use Node 22.13+ and npm. Identify whether this is Claude Code or Codex and run PORT=4317 AGENT_PASS_PLUGIN_MODE=testnet npx --yes @cmdoss/agent-pass-plugin@${packageMetadata().version} setup --client claude (or codex) --register --start. Read the installed README.md and trading skill at skillPath in the setup output. Do not clone the private GitHub repository or build inside the installed package. Verify the agent-pass-plugin MCP tools, then marketplace_status and onboard; poll onboarding_status until the wallet is actually connected. Keep all keys, signing, plan data and the runner on my machine. Use Sui Testnet demo assets. Help me choose a strategy and collect its explicit amounts, price, budget, duration and gas limits. Owner authorization and Start are separate user actions. Do not authorize, sign or Start on my behalf, and never request a private key.`,
40
+ prompt: `Set up Senro, powered by Agent Pass, locally from the public npm package @cmdoss/agent-pass-plugin@${version}. Use Node 22.13+ and npm. Identify whether this is Claude Code or Codex and run PORT=4317 AGENT_PASS_PLUGIN_MODE=testnet npx --yes @cmdoss/agent-pass-plugin@${version} setup --client claude (or codex) --register --start. Read the installed README.md and trading skill at skillPath in the setup output. Do not clone the private GitHub repository or build inside the installed package. Verify the agent-pass-plugin MCP tools, then marketplace_status and onboard; poll onboarding_status until the wallet is actually connected. Keep all keys, signing, plan data and the runner on my machine. Use Sui Testnet demo assets. Help me choose a strategy and collect its explicit amounts, price, budget, duration and gas limits. Owner authorization and Start are separate user actions. Do not authorize, sign or Start on my behalf, and never request a private key.`,
27
41
  promptPreview: "Set up Senro on your machine and connect its MCP.",
28
42
  };
29
43
  }
30
44
  /** Hosted catalog only. This module never opens a store, signer or runner. */
31
45
  export async function buildPublicServer(env = process.env) {
32
46
  const release = publicReleaseIdentity(env);
47
+ const setup = publicSetup(setupPackageVersion(env));
33
48
  const app = Fastify({ logger: false, bodyLimit: 16384 });
34
49
  app.addHook("onRequest", async (req, reply) => {
35
50
  if (!["GET", "HEAD"].includes(req.method))
@@ -88,7 +103,7 @@ export async function buildPublicServer(env = process.env) {
88
103
  wallet,
89
104
  }));
90
105
  app.get("/api/portfolio", async () => status());
91
- app.get("/api/setup", async () => publicSetup());
106
+ app.get("/api/setup", async () => setup);
92
107
  app.get("/api/strategies", async (req) => testnetCatalog(z
93
108
  .object({ query: z.string().max(100).optional() })
94
109
  .strict()
@@ -4,6 +4,25 @@ import { join, resolve } from "node:path";
4
4
  import { readRuntimeConfig } from "./config.js";
5
5
  import { ensureRuntime } from "./installation.js";
6
6
  import { packageMetadata, packageRoot, payloadFingerprint, workspaceIdentity, } from "./paths.js";
7
+ // Arguments for `<client> mcp add`. The server name goes before any `--env`:
8
+ // Claude Code's `-e/--env` takes a variadic list, so a name placed after it is
9
+ // parsed as another variable and registration fails with
10
+ // "Invalid environment variable format: agent-pass-plugin".
11
+ export function mcpAddArgs(client, origin, command) {
12
+ const env = ["--env", `AGENT_PASS_PLUGIN_LOCAL_URL=${origin}`];
13
+ return client === "codex"
14
+ ? ["mcp", "add", "agent-pass-plugin", ...env, "--", ...command]
15
+ : [
16
+ "mcp",
17
+ "add",
18
+ "agent-pass-plugin",
19
+ "--transport",
20
+ "stdio",
21
+ ...env,
22
+ "--",
23
+ ...command,
24
+ ];
25
+ }
7
26
  export async function setup(args) {
8
27
  const allowed = new Set(["--client", "--register", "--start"]);
9
28
  for (let i = 0; i < args.length; i++) {
@@ -98,29 +117,10 @@ export async function setup(args) {
98
117
  }
99
118
  let registered = false;
100
119
  if (args.includes("--register")) {
101
- const cliArgs = client === "codex"
102
- ? [
103
- "mcp",
104
- "add",
105
- "agent-pass-plugin",
106
- "--env",
107
- `AGENT_PASS_PLUGIN_LOCAL_URL=${origin}`,
108
- "--",
109
- config.command,
110
- ...config.args,
111
- ]
112
- : [
113
- "mcp",
114
- "add",
115
- "--transport",
116
- "stdio",
117
- "--env",
118
- `AGENT_PASS_PLUGIN_LOCAL_URL=${origin}`,
119
- "agent-pass-plugin",
120
- "--",
121
- config.command,
122
- ...config.args,
123
- ];
120
+ const cliArgs = mcpAddArgs(client, origin, [
121
+ config.command,
122
+ ...config.args,
123
+ ]);
124
124
  const result = spawnSync(client, cliArgs, { cwd: root, stdio: "inherit" });
125
125
  if (result.error)
126
126
  throw new Error(`${client} CLI unavailable. Install/open the intended client first, then retry setup.`);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@cmdoss/agent-pass-plugin",
3
- "version": "0.1.2-dev.24.1",
3
+ "version": "0.1.2-dev.26.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@cmdoss/agent-pass-plugin",
9
- "version": "0.1.2-dev.24.1",
9
+ "version": "0.1.2-dev.26.1",
10
10
  "dependencies": {
11
11
  "@fastify/static": "10.1.10",
12
12
  "@modelcontextprotocol/sdk": "1.32.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmdoss/agent-pass-plugin",
3
- "version": "0.1.2-dev.24.1",
3
+ "version": "0.1.2-dev.26.1",
4
4
  "type": "module",
5
5
  "description": "Senro, powered by Agent Pass — local trading strategies, explicit permissions and an independent execution loop",
6
6
  "engines": {