@postman/postman-plugin 0.2.1-rc.0 → 0.2.1-rc.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.
@@ -1,12 +1,20 @@
1
1
  import path from 'node:path';
2
2
  import { guard, removeClone, syncClone } from './shared.js';
3
3
  import { result } from './types.js';
4
- // Cursor has no command to install a plugin, but loads any plugin folder under
5
- // plugins/local. Its Marketplace keeps its own copy under plugins/cache.
6
- const localClone = (system) => path.join(system.home, '.cursor', 'plugins', 'local', 'postman'), marketplaceCopy = (system) => path.join(system.home, '.cursor', 'plugins', 'cache', 'cursor-public', 'postman'), NEXT = 'Reload the Cursor window (Developer: Reload Window), or start a new Cursor CLI session, for the change to take effect.',
4
+ // Cursor has no command to install a plugin, but its editor loads any plugin folder under
5
+ // plugins/local; its CLI doesn't. Its Marketplace keeps its own copy under plugins/cache.
6
+ const localClone = (system) => path.join(system.home, '.cursor', 'plugins', 'local', 'postman'), marketplaceCopy = (system) => path.join(system.home, '.cursor', 'plugins', 'cache', 'cursor-public', 'postman'), NEXT = 'Reload the Cursor window (Developer: Reload Window) for the change to take effect.', cliOffPath = (system) => path.join(system.home, '.local', 'bin', 'cursor-agent'),
7
7
  // Cursor keeps a disabled Marketplace copy on disk and records "enabled" only in its
8
8
  // private state database, so the copy being there doesn't mean Postman is active.
9
9
  CHECK_ENABLED = 'If Postman isn\'t active in Cursor, enable it in Cursor Settings > Plugins.', MAYBE_TWICE = 'The Cursor Marketplace copy is present too; if it\'s enabled, Postman loads twice, so disable one in Cursor Settings > Plugins.';
10
+ // Until https://github.com/postmanlabs/postman-plugin/issues/82 is fixed. Names the CLI by its path when
11
+ // it isn't on PATH, which detect() accepts.
12
+ async function cliNext(system) {
13
+ const cli = (await system.which('cursor-agent')) === null && await system.exists(cliOffPath(system)) ?
14
+ `"${cliOffPath(system)}"` :
15
+ 'cursor-agent';
16
+ return `The Cursor CLI doesn't load plugins from there; start it with \`${cli} --plugin-dir "${localClone(system)}"\`.`;
17
+ }
10
18
  export const cursor = {
11
19
  id: 'cursor',
12
20
  name: 'Cursor',
@@ -16,7 +24,7 @@ export const cursor = {
16
24
  // ~/.local/bin on the PATH of the shell that ran it. It also installs `agent`, a name
17
25
  // too generic to mean Cursor.
18
26
  return (await system.which('cursor')) !== null || (await system.which('cursor-agent')) !== null ||
19
- await system.exists(path.join(system.home, '.local', 'bin', 'cursor-agent')) ||
27
+ await system.exists(cliOffPath(system)) ||
20
28
  (system.platform === 'darwin' && await system.exists('/Applications/Cursor.app')) ||
21
29
  await system.exists(path.join(system.home, '.cursor'));
22
30
  },
@@ -43,7 +51,8 @@ export const cursor = {
43
51
  // An existing clone is kept even next to the Marketplace copy, which may be
44
52
  // disabled: a duplicate is visible and fixable, deleting the working copy is not.
45
53
  const action = await syncClone(system, localClone(system));
46
- return result('done', `${action} ${localClone(system)}`, fromMarketplace ? `${NEXT} ${MAYBE_TWICE}` : NEXT);
54
+ const next = `${NEXT} ${await cliNext(system)}`;
55
+ return result('done', `${action} ${localClone(system)}`, fromMarketplace ? `${next} ${MAYBE_TWICE}` : next);
47
56
  });
48
57
  },
49
58
  remove(system) {
package/mcp.pi.json CHANGED
@@ -6,8 +6,8 @@
6
6
  "description": "Postman workspaces, collections, specs, environments, mocks and monitors",
7
7
  "headers": {
8
8
  "X-Source": "postman-pi-plugin",
9
- "X-Plugin-Version": "0.2.1-rc.0",
10
- "User-Agent": "postman-pi-plugin/0.2.1-rc.0"
9
+ "X-Plugin-Version": "0.2.1-rc.1",
10
+ "User-Agent": "postman-pi-plugin/0.2.1-rc.1"
11
11
  }
12
12
  }
13
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postman/postman-plugin",
3
- "version": "0.2.1-rc.0",
3
+ "version": "0.2.1-rc.1",
4
4
  "description": "Postman's API engineering skills for coding agents: a Pi package, and an npx installer that sets up Claude Code, Codex, Cursor, Kimi Code, Factory Droid, OpenCode and Pi.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",