@jclvsh/iris 0.5.3 → 0.5.5

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.
@@ -51,14 +51,14 @@ export function registerAICommands(program, client) {
51
51
  }
52
52
  });
53
53
  ai.command("analyze")
54
- .description("analyze a response in a conversation")
54
+ .description("analyze an inbound message (email or DM) for sentiment, intent, and suggested reply")
55
55
  .requiredOption("--conversation-id <id>", "conversation ID")
56
- .requiredOption("--email-content <text>", "email content to analyze")
56
+ .requiredOption("--message-content <text>", "inbound message content to analyze")
57
57
  .action(async (opts) => {
58
58
  try {
59
59
  const result = await client.post("/ai/analyze", {
60
60
  conversation_id: opts.conversationId,
61
- email_content: opts.emailContent,
61
+ message_content: opts.messageContent,
62
62
  });
63
63
  formatOutput(result, getFormat(program.opts()));
64
64
  }
@@ -26,7 +26,7 @@ export function registerKeyCommands(program, client) {
26
26
  keys.command("create")
27
27
  .description("create a new API key (requires admin scope)")
28
28
  .requiredOption("-n, --name <name>", "key name")
29
- .option("--scopes <list>", "comma-separated scopes: read, write, delete, generate, send, admin (defaults to all)", parseList)
29
+ .option("--scopes <list>", "comma-separated scopes: read, write, generate, send, admin (defaults to all; empty rejected)", parseList)
30
30
  .action(async (opts) => {
31
31
  try {
32
32
  const body = { name: opts.name };
@@ -1,5 +1,13 @@
1
1
  import { z } from "zod";
2
- const SCOPES = ["read", "write", "delete", "generate", "send", "admin"];
2
+ // Five-verb scope vocabulary. iris uses soft-deletes everywhere, so DELETE
3
+ // routes gate on `write` — there is no separate `delete` scope.
4
+ //
5
+ // `*` is also accepted at the API as a wildcard sentinel (expands to all 5
6
+ // scopes). It must be the SOLE element of the array — mixing it with named
7
+ // scopes was a privilege-escalation footgun (round-6 audit). Same rule as the
8
+ // API route schema in src/app/api/v1/keys/route.ts.
9
+ const NAMED_SCOPES = ["read", "write", "generate", "send", "admin"];
10
+ const SCOPES_WITH_WILDCARD = [...NAMED_SCOPES, "*"];
3
11
  export function registerKeyTools(server, client) {
4
12
  server.tool("get_current_api_key", "get details about the currently authenticated API key.", {}, async () => {
5
13
  try {
@@ -43,10 +51,12 @@ export function registerKeyTools(server, client) {
43
51
  server.tool("create_api_key", "create a new API key. requires admin scope.", {
44
52
  name: z.string().min(1).max(100).describe("key name for identification"),
45
53
  scopes: z
46
- .array(z.enum(SCOPES))
54
+ .array(z.enum(SCOPES_WITH_WILDCARD))
55
+ .min(1, "scopes must be a non-empty array; omit the field for all scopes")
56
+ .refine((s) => !s.includes("*") || s.length === 1, "wildcard scope \"*\" must be the only element; mixing it with named scopes is rejected to prevent accidental privilege escalation")
47
57
  .optional()
48
- .describe("permission scopes (any of: read, write, delete, generate, send, admin). defaults to all scopes"),
49
- expires_at: z.string().optional().describe("expiration date in ISO 8601 format"),
58
+ .describe("permission scopes — any subset of [read, write, generate, send, admin], or [\"*\"] for all. omit the field for all scopes. empty array and mixed wildcard (e.g. [\"read\", \"*\"]) are rejected with 422."),
59
+ expires_at: z.string().optional().describe("expiration date in ISO 8601 format (must be in the future)"),
50
60
  }, async (args) => {
51
61
  try {
52
62
  const result = await client.post("/keys", args);
@@ -154,7 +154,7 @@ export function registerWebhookTools(server, client) {
154
154
  };
155
155
  }
156
156
  });
157
- server.tool("rotate_webhook_secret", "rotate the signing secret for a webhook. the new secret is returned in the response. the old secret is invalidated immediately — receivers must update their HMAC verification before the next delivery. requires write scope.", {
157
+ server.tool("rotate_webhook_secret", "rotate the signing secret for a webhook. the new secret is returned in the response. the old secret is invalidated immediately — receivers must update their HMAC verification before the next delivery. requires admin scope.", {
158
158
  id: z.string().uuid().describe("webhook ID"),
159
159
  }, async ({ id }) => {
160
160
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jclvsh/iris",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "MCP server for the Iris API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",