Skip to content

Commit 4751612

Browse files
committed
Make mothership block use long input instead of prompt input
1 parent 2e8e578 commit 4751612

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

apps/sim/blocks/blocks/mothership.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,26 @@ export const MothershipBlock: BlockConfig<MothershipResponse> = {
2222
'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.',
2323
bestPractices: `
2424
- Use for tasks that require multi-step reasoning, tool use, or cross-service coordination.
25-
- The Mothership picks its own model and tools internally — you only provide messages.
25+
- The Mothership picks its own model and tools internally — you only provide a prompt.
2626
`,
2727
category: 'blocks',
2828
bgColor: '#802FDE',
2929
icon: Blimp,
3030
subBlocks: [
3131
{
32-
id: 'messages',
33-
title: 'Messages',
34-
type: 'messages-input',
35-
placeholder: 'Enter messages...',
32+
id: 'prompt',
33+
title: 'Prompt',
34+
type: 'long-input',
35+
placeholder: 'Enter your prompt for the Mothership...',
3636
},
3737
],
3838
tools: {
3939
access: [],
4040
},
4141
inputs: {
42-
messages: {
43-
type: 'json',
44-
description:
45-
'Array of message objects with role and content: [{ role: "system", content: "..." }, { role: "user", content: "..." }]',
42+
prompt: {
43+
type: 'string',
44+
description: 'The prompt to send to the Mothership AI agent',
4645
},
4746
},
4847
outputs: {

apps/sim/executor/handlers/mothership/mothership-handler.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { createLogger } from '@sim/logger'
22
import type { BlockOutput } from '@/blocks/types'
33
import { BlockType } from '@/executor/constants'
4-
import { resolveMessages } from '@/executor/handlers/shared/response-format'
54
import type { BlockHandler, ExecutionContext } from '@/executor/types'
65
import { buildAPIUrl, buildAuthHeaders, extractAPIErrorMessage } from '@/executor/utils/http'
76
import type { SerializedBlock } from '@/serializer/types'
@@ -25,7 +24,11 @@ export class MothershipBlockHandler implements BlockHandler {
2524
block: SerializedBlock,
2625
inputs: Record<string, any>
2726
): Promise<BlockOutput> {
28-
const messages = resolveMessages(inputs.messages)
27+
const prompt = inputs.prompt
28+
if (!prompt || typeof prompt !== 'string') {
29+
throw new Error('Prompt input is required')
30+
}
31+
const messages = [{ role: 'user' as const, content: prompt }]
2932
const chatId = crypto.randomUUID()
3033

3134
const url = buildAPIUrl('/api/mothership/execute')
@@ -40,7 +43,6 @@ export class MothershipBlockHandler implements BlockHandler {
4043

4144
logger.info('Executing Mothership block', {
4245
blockId: block.id,
43-
messageCount: messages.length,
4446
})
4547

4648
const response = await fetch(url.toString(), {

0 commit comments

Comments
 (0)