@jclvsh/iris 0.5.0 → 0.5.2

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/cli.js CHANGED
@@ -24,7 +24,19 @@ const program = new Command()
24
24
  .option("--json", "output as JSON (default)")
25
25
  .option("--format <fmt>", "output format: json, table", "json");
26
26
  try {
27
- const client = new IrisClient();
27
+ // Lazy client: defer the IrisClient constructor (which throws when
28
+ // IRIS_API_KEY is missing) until a command actually issues an HTTP call.
29
+ // `iris -V`, `iris --help`, `iris ai --help` etc. never touch the proxy,
30
+ // so they exit cleanly without an API key set.
31
+ let realClient = null;
32
+ const client = new Proxy({}, {
33
+ get(_target, prop, receiver) {
34
+ if (!realClient)
35
+ realClient = new IrisClient();
36
+ const value = Reflect.get(realClient, prop, receiver);
37
+ return typeof value === "function" ? value.bind(realClient) : value;
38
+ },
39
+ });
28
40
  registerCampaignCommands(program, client);
29
41
  registerContactCommands(program, client);
30
42
  registerMessageCommands(program, client);
package/dist/index.js CHANGED
@@ -22,7 +22,20 @@ const server = new McpServer({
22
22
  name: "iris",
23
23
  version: pkg.version,
24
24
  });
25
- const client = new IrisClient();
25
+ // Lazy client: defer the IrisClient constructor (which throws when
26
+ // IRIS_API_KEY is missing) until a tool invocation actually issues an HTTP call.
27
+ // MCP discovery (initialize, tools/list) never touches the proxy, so the server
28
+ // boots cleanly without an API key set and surfaces a structured error only
29
+ // when a tool is invoked.
30
+ let realClient = null;
31
+ const client = new Proxy({}, {
32
+ get(_target, prop, receiver) {
33
+ if (!realClient)
34
+ realClient = new IrisClient();
35
+ const value = Reflect.get(realClient, prop, receiver);
36
+ return typeof value === "function" ? value.bind(realClient) : value;
37
+ },
38
+ });
26
39
  registerCampaignTools(server, client);
27
40
  registerContactTools(server, client);
28
41
  registerConversationTools(server, client);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jclvsh/iris",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "MCP server for the Iris API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",