@sendinel/mcp-server 1.0.88 → 1.0.89

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,4 +1,4 @@
1
- export { FALLBACK_MODEL_IDS, MODEL_REGISTRY, ROLE, getAnthropicFastModelId, getAnthropicFrontierModelId, getAnthropicModelId, getAnthropicReasoningModelId, getModelIdForRole, resolveModel, type ModelMetadata, type ModelRole, type ResolvedModel, } from '@desler/models';
1
+ export { FALLBACK_MODEL_IDS, HAIKU_4_5_MODEL_ID, MODEL_REGISTRY, ROLE, getAnthropicFastModelId, getAnthropicHaiku45ModelId, getAnthropicFrontierModelId, getAnthropicModelId, getAnthropicReasoningModelId, getModelIdForRole, resolveModel, type ModelMetadata, type ModelRole, type ResolvedModel, } from '@desler/models';
2
2
  import { type ModelRole, type ResolvedModel } from '@desler/models';
3
3
  export declare const DEFAULT_ANTHROPIC_MODEL_ID: string;
4
4
  export declare const DEFAULT_ANTHROPIC_FAST_MODEL_ID: string;
@@ -1,4 +1,4 @@
1
- export { FALLBACK_MODEL_IDS, MODEL_REGISTRY, ROLE, getAnthropicFastModelId, getAnthropicFrontierModelId, getAnthropicModelId, getAnthropicReasoningModelId, getModelIdForRole, resolveModel, } from '@desler/models';
1
+ export { FALLBACK_MODEL_IDS, HAIKU_4_5_MODEL_ID, MODEL_REGISTRY, ROLE, getAnthropicFastModelId, getAnthropicHaiku45ModelId, getAnthropicFrontierModelId, getAnthropicModelId, getAnthropicReasoningModelId, getModelIdForRole, resolveModel, } from '@desler/models';
2
2
  import { MODEL_REGISTRY, resolveModel } from '@desler/models';
3
3
  import { adminDb } from './db.js';
4
4
  export const DEFAULT_ANTHROPIC_MODEL_ID = MODEL_REGISTRY.default.id;
@@ -1,4 +1,4 @@
1
- import { anthropicResponseText, assertUsableStopReason } from '@sendinel/domain';
1
+ import { anthropicRequiredText } from '@sendinel/domain';
2
2
  import { z } from 'zod';
3
3
  import Anthropic from '@anthropic-ai/sdk';
4
4
  import { adminDb, db } from '../db.js';
@@ -6,6 +6,8 @@ import { getProjectId } from '../project.js';
6
6
  import { buildVoicePrompt, deriveTemplateVariables } from '../lib/voice.js';
7
7
  import { getAnthropicFastModelId } from '../anthropic-model.js';
8
8
  import { BLOCK_GENERATION_SCHEMA, blocksToHtml, blocksToText, normalizeComposerBlocks } from '../lib/composer-blocks.js';
9
+ // Haiku 5.5 (fast role) thinks before answering; thinking counts toward max_tokens (#4193).
10
+ const FAST_MIN_MAX_TOKENS = 8000;
9
11
  const j = (data) => ({ content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] });
10
12
  const HEX6 = /^#[0-9A-Fa-f]{6}$/;
11
13
  function stringArray(value) {
@@ -77,7 +79,7 @@ export function registerCompoundTools(server) {
77
79
  try {
78
80
  const msg = await getAnthropicClient().messages.create({
79
81
  model: getAnthropicFastModelId(),
80
- max_tokens: 4096,
82
+ max_tokens: FAST_MIN_MAX_TOKENS,
81
83
  messages: [{
82
84
  role: 'user',
83
85
  content: `You are writing a ${num_steps}-step email campaign for "${site?.name ?? 'our product'}".
@@ -100,8 +102,7 @@ Do not include body_html. Sendinel renders body_html from blocks.
100
102
  Respond with a JSON array.`,
101
103
  }],
102
104
  });
103
- assertUsableStopReason(msg.stop_reason);
104
- const raw = anthropicResponseText(msg);
105
+ const raw = anthropicRequiredText(msg);
105
106
  steps = extractJsonArray(raw).map((step, index) => {
106
107
  const blocks = normalizeComposerBlocks(step.blocks, brandVisual.resolvedButtonColor);
107
108
  return {
@@ -197,7 +198,7 @@ Respond with a JSON array.`,
197
198
  try {
198
199
  const msg = await getAnthropicClient().messages.create({
199
200
  model: getAnthropicFastModelId(),
200
- max_tokens: 4096,
201
+ max_tokens: FAST_MIN_MAX_TOKENS,
201
202
  messages: [{
202
203
  role: 'user',
203
204
  content: `Write an email for "${site?.name ?? 'our product'}".
@@ -210,8 +211,7 @@ Do not include body_html. Sendinel renders body_html from blocks.
210
211
  Respond with JSON: { "subject": "...", "blocks": [...], "body_text": "..." }`,
211
212
  }],
212
213
  });
213
- assertUsableStopReason(msg.stop_reason);
214
- const raw = anthropicResponseText(msg);
214
+ const raw = anthropicRequiredText(msg);
215
215
  const parsed = extractJsonObject(raw);
216
216
  const blocks = normalizeComposerBlocks(parsed.blocks, brandVisual.resolvedButtonColor);
217
217
  if (!blocks.length)
@@ -296,7 +296,7 @@ Respond with JSON: { "subject": "...", "blocks": [...], "body_text": "..." }`,
296
296
  };
297
297
  const analysisMsg = await getAnthropicClient().messages.create({
298
298
  model: getAnthropicFastModelId(),
299
- max_tokens: 2048,
299
+ max_tokens: FAST_MIN_MAX_TOKENS,
300
300
  messages: [{
301
301
  role: 'user',
302
302
  content: `You are a deliverability engineer. Diagnose this email delivery issue.
@@ -308,8 +308,7 @@ ${JSON.stringify(diagnosticData, null, 2)}
308
308
  Identify the most likely root cause and give 3-5 concise actionable next steps.`,
309
309
  }],
310
310
  });
311
- assertUsableStopReason(analysisMsg.stop_reason);
312
- const analysis = anthropicResponseText(analysisMsg);
311
+ const analysis = anthropicRequiredText(analysisMsg);
313
312
  return j({
314
313
  diagnostic_data: diagnosticData,
315
314
  analysis,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendinel/mcp-server",
3
- "version": "1.0.88",
3
+ "version": "1.0.89",
4
4
  "description": "AI-controlled email operations control plane for campaigns, contacts, segments, analytics, and multi-provider sending via MCP.",
5
5
  "mcpName": "ai.sendinel/mcp-server",
6
6
  "type": "module",