Make mothership block use long input instead of prompt input

This commit is contained in:
Siddharth Ganesan
2026-03-10 11:06:03 -07:00
parent 2e8e578ede
commit 4751612b5f
2 changed files with 13 additions and 12 deletions

View File

@@ -22,27 +22,26 @@ export const MothershipBlock: BlockConfig<MothershipResponse> = {
'The Mothership block sends messages to the Mothership AI agent, which has access to subagents, integration tools, memory, and workspace context. Use it to perform complex multi-step reasoning, cross-service queries, or any task that benefits from the full Mothership intelligence within a workflow.',
bestPractices: `
- Use for tasks that require multi-step reasoning, tool use, or cross-service coordination.
- The Mothership picks its own model and tools internally — you only provide messages.
- The Mothership picks its own model and tools internally — you only provide a prompt.
`,
category: 'blocks',
bgColor: '#802FDE',
icon: Blimp,
subBlocks: [
{
id: 'messages',
title: 'Messages',
type: 'messages-input',
placeholder: 'Enter messages...',
id: 'prompt',
title: 'Prompt',
type: 'long-input',
placeholder: 'Enter your prompt for the Mothership...',
},
],
tools: {
access: [],
},
inputs: {
messages: {
type: 'json',
description:
'Array of message objects with role and content: [{ role: "system", content: "..." }, { role: "user", content: "..." }]',
prompt: {
type: 'string',
description: 'The prompt to send to the Mothership AI agent',
},
},
outputs: {

View File

@@ -1,7 +1,6 @@
import { createLogger } from '@sim/logger'
import type { BlockOutput } from '@/blocks/types'
import { BlockType } from '@/executor/constants'
import { resolveMessages } from '@/executor/handlers/shared/response-format'
import type { BlockHandler, ExecutionContext } from '@/executor/types'
import { buildAPIUrl, buildAuthHeaders, extractAPIErrorMessage } from '@/executor/utils/http'
import type { SerializedBlock } from '@/serializer/types'
@@ -25,7 +24,11 @@ export class MothershipBlockHandler implements BlockHandler {
block: SerializedBlock,
inputs: Record<string, any>
): Promise<BlockOutput> {
const messages = resolveMessages(inputs.messages)
const prompt = inputs.prompt
if (!prompt || typeof prompt !== 'string') {
throw new Error('Prompt input is required')
}
const messages = [{ role: 'user' as const, content: prompt }]
const chatId = crypto.randomUUID()
const url = buildAPIUrl('/api/mothership/execute')
@@ -40,7 +43,6 @@ export class MothershipBlockHandler implements BlockHandler {
logger.info('Executing Mothership block', {
blockId: block.id,
messageCount: messages.length,
})
const response = await fetch(url.toString(), {