fix: resolve mcp-server lint errors
- Replace deprecated z.string().url() with z.string() - Fix unbound-method: wrap stripAgentBlocks in arrow function - Use T[] syntax instead of Array<T>
This commit is contained in:
parent
c3ada8947d
commit
f9f3db7dcb
2 changed files with 4 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ import { jsonTextContent } from '../utils/format';
|
||||||
const toolContextSchema = {
|
const toolContextSchema = {
|
||||||
teamName: z.string().min(1),
|
teamName: z.string().min(1),
|
||||||
claudeDir: z.string().min(1).optional(),
|
claudeDir: z.string().min(1).optional(),
|
||||||
controlUrl: z.string().url().optional(),
|
controlUrl: z.string().optional(),
|
||||||
waitTimeoutMs: z.number().int().min(1000).max(600000).optional(),
|
waitTimeoutMs: z.number().int().min(1000).max(600000).optional(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { agentBlocks, getController } from '../controller';
|
||||||
import { jsonTextContent, taskWriteResult, slimTask, slimTaskForList } from '../utils/format';
|
import { jsonTextContent, taskWriteResult, slimTask, slimTaskForList } from '../utils/format';
|
||||||
|
|
||||||
/** stripAgentBlocks from canonical agentBlocks module — single source of truth for the tag format. */
|
/** stripAgentBlocks from canonical agentBlocks module — single source of truth for the tag format. */
|
||||||
const { stripAgentBlocks } = agentBlocks;
|
const stripAgentBlocksFn = (text: string): string => agentBlocks.stripAgentBlocks(text);
|
||||||
|
|
||||||
const toolContextSchema = {
|
const toolContextSchema = {
|
||||||
teamName: z.string().min(1),
|
teamName: z.string().min(1),
|
||||||
|
|
@ -161,7 +161,7 @@ export function registerTaskTools(server: Pick<FastMCP, 'addTool'>) {
|
||||||
|
|
||||||
// 4. Build sanitized source snapshot
|
// 4. Build sanitized source snapshot
|
||||||
const rawText = typeof message.text === 'string' ? message.text : '';
|
const rawText = typeof message.text === 'string' ? message.text : '';
|
||||||
const sanitizedText = stripAgentBlocks(rawText);
|
const sanitizedText = stripAgentBlocksFn(rawText);
|
||||||
|
|
||||||
const sourceMessage: Record<string, unknown> = {
|
const sourceMessage: Record<string, unknown> = {
|
||||||
text: sanitizedText,
|
text: sanitizedText,
|
||||||
|
|
@ -172,7 +172,7 @@ export function registerTaskTools(server: Pick<FastMCP, 'addTool'>) {
|
||||||
|
|
||||||
// Preserve attachment metadata by reference only — no blob copying
|
// Preserve attachment metadata by reference only — no blob copying
|
||||||
if (Array.isArray(message.attachments) && message.attachments.length > 0) {
|
if (Array.isArray(message.attachments) && message.attachments.length > 0) {
|
||||||
sourceMessage.attachments = (message.attachments as Array<Record<string, unknown>>)
|
sourceMessage.attachments = (message.attachments as Record<string, unknown>[])
|
||||||
.filter(
|
.filter(
|
||||||
(a) =>
|
(a) =>
|
||||||
a &&
|
a &&
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue