@jclvsh/iris 0.14.0 → 0.16.0

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,11 +3,12 @@ export function registerAICommands(program, client) {
3
3
  const ai = program.command("ai").description("AI content generation and analysis");
4
4
  ai.command("generate")
5
5
  .description("generate AI content (email draft, subject line, etc.)")
6
- .requiredOption("-t, --generation-type <type>", "generation type (e.g. email_draft, subject_line)")
6
+ .requiredOption("-t, --generation-type <type>", "generation type: initial_outreach, follow_up, response_negotiation, meeting_request, or closing")
7
7
  .requiredOption("--tone <tone>", "tone (e.g. professional, casual, friendly)")
8
8
  .option("--contact-id <id>", "contact ID for personalization")
9
9
  .option("--campaign-id <id>", "campaign ID for context")
10
10
  .option("--prompt <text>", "free-form prompt context")
11
+ .option("--format <format>", "email (default) or dm - dm is short platform-native text, empty subject")
11
12
  .action(async (opts) => {
12
13
  try {
13
14
  const body = {
@@ -20,6 +21,8 @@ export function registerAICommands(program, client) {
20
21
  body.campaign_id = opts.campaignId;
21
22
  if (opts.prompt)
22
23
  body.prompt = opts.prompt;
24
+ if (opts.format)
25
+ body.format = opts.format;
23
26
  const result = await client.post("/ai/generate", body);
24
27
  formatOutput(result, getFormat(program.opts()));
25
28
  }
@@ -11,7 +11,7 @@ export function registerConversationCommands(program, client) {
11
11
  .option("-s, --page-size <n>", "items per page (max 100)", "50")
12
12
  .option("--status <status>", "filter by status")
13
13
  .option("--campaign-id <id>", "filter by campaign")
14
- .option("--channel <channel>", "filter by channel: email, instagram, twitter")
14
+ .option("--channel <channel>", "filter by channel: email, instagram, twitter, tiktok")
15
15
  .action(async (opts) => {
16
16
  try {
17
17
  const params = {};
@@ -46,11 +46,15 @@ export function registerConversationCommands(program, client) {
46
46
  });
47
47
  conversations
48
48
  .command("create")
49
- .description("find-or-create the hub conversation for a contact (not tied to a campaign)")
49
+ .description("find-or-create a conversation for a contact (hub by default; campaign thread with --campaign-id)")
50
50
  .requiredOption("--contact-id <id>", "contact ID to converse with")
51
+ .option("--campaign-id <id>", "scope to a campaign the contact belongs to")
51
52
  .action(async (opts) => {
52
53
  try {
53
- const result = await client.post("/conversations", { contact_id: opts.contactId });
54
+ const body = { contact_id: opts.contactId };
55
+ if (opts.campaignId)
56
+ body.campaign_id = opts.campaignId;
57
+ const result = await client.post("/conversations", body);
54
58
  formatOutput(result, getFormat(program.opts()));
55
59
  }
56
60
  catch (error) {
@@ -63,7 +67,7 @@ export function registerConversationCommands(program, client) {
63
67
  .requiredOption("--content <text>", "message content")
64
68
  .requiredOption("--direction <direction>", "inbound or outbound")
65
69
  .requiredOption("--status <status>", "draft, queued, sending, pending_approval, sent, delivered, failed, bounced, or rejected")
66
- .requiredOption("--channel <channel>", "email, twitter, or instagram")
70
+ .requiredOption("--channel <channel>", "email, twitter, instagram, or tiktok (tiktok records only - manual send)")
67
71
  .option("--platform-recipient-id <id>", "platform recipient id (twitter/instagram channels)")
68
72
  .action(async (id, opts) => {
69
73
  try {
package/dist/tools/ai.js CHANGED
@@ -1,14 +1,32 @@
1
1
  import { z } from "zod";
2
2
  import { formatMcpError } from "../cli-utils.js";
3
3
  export function registerAiTools(server, client) {
4
- server.tool("generate_content", "generate AI content for a specific contact conversation (email draft, follow-up, reply). requires generate scope.", {
5
- contact_id: z.string().uuid().describe("contact ID"),
6
- conversation_id: z.string().uuid().describe("conversation ID"),
7
- generation_type: z.enum(["initial_email", "follow_up", "reply"]).describe("type of content to generate"),
8
- context: z.string().max(2000).optional().describe("additional context for the AI"),
9
- }, async (args) => {
4
+ server.tool("generate_content", "generate AI outreach content (email or DM draft) for a contact/campaign. the contact's tags + enrichment_data feed the generation context automatically. requires generate scope.", {
5
+ generation_type: z
6
+ .enum(["initial_outreach", "follow_up", "response_negotiation", "meeting_request", "closing"])
7
+ .describe("type of content to generate"),
8
+ tone: z
9
+ .string()
10
+ .min(1)
11
+ .describe("tone (e.g. professional, friendly, casual, formal, persuasive, informative)"),
12
+ campaign_id: z.string().uuid().optional().describe("campaign to scope the generation to"),
13
+ contact_id: z
14
+ .string()
15
+ .uuid()
16
+ .optional()
17
+ .describe("target contact - its tags + enrichment_data are used automatically"),
18
+ prompt: z.string().optional().describe("additional freeform instructions"),
19
+ format: z
20
+ .enum(["email", "dm"])
21
+ .optional()
22
+ .describe("dm = short platform-native message text with empty subject. defaults to email"),
23
+ include_cta: z.boolean().optional().describe("include a clear call-to-action"),
24
+ }, async ({ include_cta, ...rest }) => {
10
25
  try {
11
- const result = await client.post("/ai/generate", args);
26
+ const body = { ...rest };
27
+ if (include_cta !== undefined)
28
+ body.input_context = { include_cta };
29
+ const result = await client.post("/ai/generate", body);
12
30
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
13
31
  }
14
32
  catch (error) {
@@ -47,11 +47,15 @@ export function registerConversationTools(server, client) {
47
47
  return formatMcpError(error);
48
48
  }
49
49
  });
50
- server.tool("create_conversation", "find-or-create the hub conversation for a contact (not tied to a campaign) - the entry point for starting outreach outside a campaign flow. requires write scope.", {
50
+ server.tool("create_conversation", "find-or-create a conversation for a contact - the hub conversation by default, or the campaign-scoped thread when campaign_id is passed (contact must be in that campaign). requires write scope.", {
51
51
  contact_id: z.string().uuid().describe("contact ID to converse with"),
52
- }, async ({ contact_id }) => {
52
+ campaign_id: z.string().uuid().optional().describe("scope to a campaign the contact belongs to"),
53
+ }, async ({ contact_id, campaign_id }) => {
53
54
  try {
54
- const result = await client.post("/conversations", { contact_id });
55
+ const body = { contact_id };
56
+ if (campaign_id)
57
+ body.campaign_id = campaign_id;
58
+ const result = await client.post("/conversations", body);
55
59
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
56
60
  }
57
61
  catch (error) {
@@ -63,7 +67,7 @@ export function registerConversationTools(server, client) {
63
67
  content: z.string().min(1).describe("message content"),
64
68
  direction: z.enum(["inbound", "outbound"]).describe("message direction"),
65
69
  status: z.enum(MESSAGE_STATUSES).describe("initial message status"),
66
- channel: z.enum(["email", "twitter", "instagram"]).describe("delivery channel"),
70
+ channel: z.enum(["email", "twitter", "instagram", "tiktok"]).describe("delivery channel (tiktok is manual-send: record only)"),
67
71
  platform_recipient_id: z
68
72
  .string()
69
73
  .optional()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jclvsh/iris",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "description": "MCP server for the Iris API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -15,6 +15,7 @@
15
15
  ],
16
16
  "scripts": {
17
17
  "build": "tsc",
18
+ "prepublishOnly": "npm run build",
18
19
  "start": "node dist/index.js"
19
20
  },
20
21
  "dependencies": {