mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 23:17:59 -05:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d07355b19 |
@@ -14,10 +14,7 @@ import {
|
||||
usePopoverContext,
|
||||
} from '@/components/emcn'
|
||||
import { cn } from '@/lib/core/utils/cn'
|
||||
import {
|
||||
extractFieldsFromSchema,
|
||||
parseResponseFormatSafely,
|
||||
} from '@/lib/core/utils/response-format'
|
||||
import { extractFieldsFromSchema, findActiveOutputSchema } from '@/lib/core/utils/response-format'
|
||||
import { createLogger } from '@/lib/logs/console/logger'
|
||||
import { getBlockOutputPaths, getBlockOutputType } from '@/lib/workflows/blocks/block-outputs'
|
||||
import { TRIGGER_TYPES } from '@/lib/workflows/triggers/triggers'
|
||||
@@ -545,8 +542,9 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
|
||||
const normalizedBlockName = normalizeBlockName(blockName)
|
||||
|
||||
const mergedSubBlocks = getMergedSubBlocks(activeSourceBlockId)
|
||||
const responseFormatValue = mergedSubBlocks?.responseFormat?.value
|
||||
const responseFormat = parseResponseFormatSafely(responseFormatValue, activeSourceBlockId)
|
||||
|
||||
// Use generalized schema detection to find active output schema
|
||||
const activeOutputSchema = findActiveOutputSchema(blockConfig, mergedSubBlocks)
|
||||
|
||||
let blockTags: string[]
|
||||
|
||||
@@ -576,8 +574,8 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
|
||||
} else {
|
||||
blockTags = [normalizedBlockName]
|
||||
}
|
||||
} else if (responseFormat) {
|
||||
const schemaFields = extractFieldsFromSchema(responseFormat)
|
||||
} else if (activeOutputSchema) {
|
||||
const schemaFields = extractFieldsFromSchema(activeOutputSchema.schema)
|
||||
if (schemaFields.length > 0) {
|
||||
blockTags = schemaFields.map((field) => `${normalizedBlockName}.${field.name}`)
|
||||
} else {
|
||||
@@ -883,8 +881,8 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
|
||||
const normalizedBlockName = normalizeBlockName(blockName)
|
||||
|
||||
const mergedSubBlocks = getMergedSubBlocks(accessibleBlockId)
|
||||
const responseFormatValue = mergedSubBlocks?.responseFormat?.value
|
||||
const responseFormat = parseResponseFormatSafely(responseFormatValue, accessibleBlockId)
|
||||
|
||||
const activeOutputSchema = findActiveOutputSchema(blockConfig, mergedSubBlocks)
|
||||
|
||||
let blockTags: string[]
|
||||
|
||||
@@ -935,8 +933,8 @@ export const TagDropdown: React.FC<TagDropdownProps> = ({
|
||||
} else {
|
||||
blockTags = [normalizedBlockName]
|
||||
}
|
||||
} else if (responseFormat) {
|
||||
const schemaFields = extractFieldsFromSchema(responseFormat)
|
||||
} else if (activeOutputSchema) {
|
||||
const schemaFields = extractFieldsFromSchema(activeOutputSchema.schema)
|
||||
if (schemaFields.length > 0) {
|
||||
blockTags = schemaFields.map((field) => `${normalizedBlockName}.${field.name}`)
|
||||
} else {
|
||||
|
||||
@@ -290,6 +290,9 @@ The JSON object MUST have the following top-level properties: 'name' (string), '
|
||||
The 'schema' object must define the structure and MUST contain 'type': 'object', 'properties': {...}, 'additionalProperties': false, and 'required': [...].
|
||||
Inside 'properties', use standard JSON Schema properties (type, description, enum, items for arrays, etc.).
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax for dynamic schema names or descriptions.
|
||||
|
||||
Current schema: {context}
|
||||
|
||||
Do not include any explanations, markdown formatting, or other text outside the JSON object.
|
||||
|
||||
@@ -87,6 +87,52 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
|
||||
placeholder: 'For Create: `[{ "fields": { ... } }]`\n',
|
||||
condition: { field: 'operation', value: ['create', 'updateMultiple'] },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Airtable API developer. Generate Airtable records JSON array for create or bulk update operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.name>\`, \`<function1.result.email>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of record objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### RECORD STRUCTURE
|
||||
For creating records:
|
||||
- Each record has a **fields** object containing field name/value pairs
|
||||
- Field names must match exactly with your Airtable base
|
||||
|
||||
For updating multiple records:
|
||||
- Each record needs an **id** field with the record ID
|
||||
- Plus a **fields** object with fields to update
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Create single record**: "Add a new contact John Doe with email"
|
||||
→ [{"fields": {"Name": "John Doe", "Email": "john@example.com"}}]
|
||||
|
||||
**With variables**: "Create record from previous block data"
|
||||
→ [{"fields": {"Name": <agent1.name>, "Email": <agent1.email>, "Status": "{{DEFAULT_STATUS}}"}}]
|
||||
|
||||
**Bulk update**: "Update status for two records"
|
||||
→ [
|
||||
{"id": "recABC123", "fields": {"Status": "Complete"}},
|
||||
{"id": "recDEF456", "fields": {"Status": "In Progress"}}
|
||||
]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the records you want to create or update...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'fields',
|
||||
@@ -95,6 +141,49 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
|
||||
placeholder: 'Fields to update: `{ "Field Name": "New Value" }`',
|
||||
condition: { field: 'operation', value: 'update' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Airtable API developer. Generate Airtable fields JSON object for updating a single record.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.new_status>\`, \`<function1.result.price>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_CATEGORY}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON object with field name/value pairs. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### FIELD VALUES
|
||||
- **Text fields**: String values
|
||||
- **Number fields**: Numeric values
|
||||
- **Checkbox**: true or false
|
||||
- **Single select**: String matching option name
|
||||
- **Multi-select**: Array of option names
|
||||
- **Linked records**: Array of record IDs
|
||||
- **Date**: ISO date string
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Update text fields**: "Update name and email"
|
||||
→ {"Name": "Jane Doe", "Email": "jane@example.com"}
|
||||
|
||||
**With variables**: "Update fields from previous block"
|
||||
→ {"Status": <agent1.new_status>, "Updated By": "{{SYSTEM_USER}}"}
|
||||
|
||||
**Update status**: "Mark as completed"
|
||||
→ {"Status": "Completed", "Completed Date": "2024-01-15"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the fields you want to update...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
...getTrigger('airtable_webhook').subBlocks,
|
||||
],
|
||||
|
||||
@@ -58,24 +58,35 @@ export const ApiBlock: BlockConfig<RequestResponse> = {
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert JSON programmer.
|
||||
Generate ONLY the raw JSON object based on the user's request.
|
||||
The output MUST be a single, valid JSON object, starting with { and ending with }.
|
||||
prompt: `You are an expert JSON programmer. Generate ONLY the raw JSON object based on the user's request.
|
||||
|
||||
Current body: {context}
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.response>\`, \`<function1.result.data>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{API_KEY}}\`, \`{{BASE_URL}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. The output MUST be a single, valid JSON object, starting with { and ending with }.
|
||||
Do not include any explanations, markdown formatting, or other text outside the JSON object.
|
||||
|
||||
You have access to the following variables you can use to generate the JSON body:
|
||||
- 'params' (object): Contains input parameters derived from the JSON schema. Access these directly using the parameter name wrapped in angle brackets, e.g., '<paramName>'. Do NOT use 'params.paramName'.
|
||||
- 'environmentVariables' (object): Contains environment variables. Reference these using the double curly brace syntax: '{{ENV_VAR_NAME}}'. Do NOT use 'environmentVariables.VAR_NAME' or env.
|
||||
### EXAMPLES
|
||||
|
||||
Example:
|
||||
{
|
||||
"name": "<block.agent.response.content>",
|
||||
"age": <block.function.output.age>,
|
||||
"success": true
|
||||
}`,
|
||||
**Simple request body**: "Send user data"
|
||||
→ {"name": "John Doe", "email": "john@example.com", "active": true}
|
||||
|
||||
**With variables**: "Send data from previous agent"
|
||||
→ {"name": <agent1.name>, "email": <agent1.email>, "apiKey": "{{API_KEY}}"}
|
||||
|
||||
**Nested data**: "Send order with items"
|
||||
→ {"orderId": <function1.order_id>, "items": <agent1.cart_items>, "total": <function1.total>}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown.`,
|
||||
placeholder: 'Describe the API request body you need...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
|
||||
@@ -46,6 +46,62 @@ export const ApifyBlock: BlockConfig<RunActorResult> = {
|
||||
language: 'json',
|
||||
placeholder: '{\n "startUrl": "https://example.com",\n "maxPages": 10\n}',
|
||||
required: false,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Apify developer. Generate JSON input for Apify actors based on the user's request.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.url>\`, \`<function1.result.query>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{APIFY_PROXY_PASSWORD}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON input for the Apify actor. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### COMMON APIFY ACTOR INPUT PATTERNS
|
||||
|
||||
**Web Scraping Actors**:
|
||||
- startUrls: Array of URLs to start scraping from
|
||||
- maxRequestsPerCrawl: Maximum number of pages to scrape
|
||||
- proxyConfiguration: Proxy settings
|
||||
|
||||
**E-commerce Scrapers**:
|
||||
- searchTerms: Array of search queries
|
||||
- maxItems: Maximum products to return
|
||||
- categoryUrls: URLs of categories to scrape
|
||||
|
||||
**Social Media Scrapers**:
|
||||
- handles: Array of usernames/handles
|
||||
- resultsLimit: Maximum posts/items to return
|
||||
- startDate/endDate: Date range filters
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Web scraper**: "Scrape product pages from example.com, max 50 pages"
|
||||
→ {
|
||||
"startUrls": [{"url": "https://example.com/products"}],
|
||||
"maxRequestsPerCrawl": 50,
|
||||
"proxyConfiguration": {"useApifyProxy": true}
|
||||
}
|
||||
|
||||
**With variables**: "Scrape URL from previous block"
|
||||
→ {
|
||||
"startUrls": [{"url": <agent1.target_url>}],
|
||||
"maxRequestsPerCrawl": <function1.max_pages>,
|
||||
"proxyConfiguration": {"useApifyProxy": true}
|
||||
}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the input for the Apify actor...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'timeout',
|
||||
|
||||
@@ -64,6 +64,30 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["CEO", "VP of Sales"]',
|
||||
condition: { field: 'operation', value: 'people_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of job titles for Apollo people search.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.job_title>\`).
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["CEO", "VP of Sales"]
|
||||
["Software Engineer", "Senior Developer"]
|
||||
[<agent1.target_titles>]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the job titles to search for...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'person_locations',
|
||||
@@ -71,6 +95,30 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["San Francisco, CA", "New York, NY"]',
|
||||
condition: { field: 'operation', value: 'people_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of locations for Apollo people search. Use "City, State" or "City, Country" format.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.location>\`).
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["San Francisco, CA", "New York, NY"]
|
||||
["London, UK", "Paris, France"]
|
||||
[<agent1.target_location>]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the locations to search for...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'organization_names',
|
||||
@@ -78,6 +126,30 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["Company A", "Company B"]',
|
||||
condition: { field: 'operation', value: 'people_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of company names for Apollo people search.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.company>\`).
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["Acme Corp", "Tech Solutions Inc"]
|
||||
["Google", "Microsoft", "Apple"]
|
||||
[<agent1.target_companies>]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the companies to search for...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'person_seniorities',
|
||||
@@ -85,6 +157,30 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["senior", "manager", "director"]',
|
||||
condition: { field: 'operation', value: 'people_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of seniority levels for Apollo people search. Common values: "senior", "manager", "director", "vp", "c_level", "owner", "founder".
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.seniority>\`).
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["senior", "manager", "director"]
|
||||
["vp", "c_level"]
|
||||
["founder", "owner"]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the seniority levels to search for...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contact_stage_ids',
|
||||
@@ -92,6 +188,28 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["stage_id_1", "stage_id_2"]',
|
||||
condition: { field: 'operation', value: 'contact_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of Apollo contact stage IDs for filtering contacts by their pipeline stage.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.stage_id>\`).
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of stage ID strings. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["stage_id_1", "stage_id_2"]
|
||||
[<agent1.selected_stage>]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Enter or describe the contact stage IDs...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
|
||||
// People Enrich Fields
|
||||
@@ -180,6 +298,29 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
placeholder: '[{"first_name": "John", "last_name": "Doe", "email": "john@example.com"}]',
|
||||
condition: { field: 'operation', value: 'people_bulk_enrich' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of people objects for Apollo bulk enrich. Each object should have first_name, last_name, and optionally email, organization_name, or domain.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.first_name>\`).
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
[{"first_name": "John", "last_name": "Doe", "email": "john@example.com"}]
|
||||
[{"first_name": <agent1.first_name>, "last_name": <agent1.last_name>, "email": <agent1.email>}]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the people you want to enrich...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'organizations',
|
||||
@@ -188,6 +329,29 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
placeholder: '[{"organization_name": "Company A", "domain": "companya.com"}]',
|
||||
condition: { field: 'operation', value: 'organization_bulk_enrich' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of organization objects for Apollo bulk enrich. Each object should have organization_name and/or domain.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.company_name>\`).
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
[{"organization_name": "Acme Corp", "domain": "acme.com"}]
|
||||
[{"organization_name": <agent1.company>, "domain": <agent1.domain>}]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the organizations you want to enrich...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
|
||||
// Organization Search Fields
|
||||
@@ -197,6 +361,30 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["San Francisco, CA"]',
|
||||
condition: { field: 'operation', value: 'organization_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of location strings for Apollo organization search.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.location>\`).
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of location strings. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["San Francisco, CA"]
|
||||
["New York, NY", "Los Angeles, CA", "Chicago, IL"]
|
||||
["United States", "Canada"]
|
||||
[<agent1.target_location>]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the locations to search for...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'organization_num_employees_ranges',
|
||||
@@ -204,6 +392,40 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["1-10", "11-50", "51-200"]',
|
||||
condition: { field: 'operation', value: 'organization_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of employee count range strings for Apollo organization search.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.company_size>\`).
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of employee range strings. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### AVAILABLE RANGES
|
||||
Apollo uses these standard employee count ranges:
|
||||
- "1-10" (Micro)
|
||||
- "11-50" (Small)
|
||||
- "51-200" (Medium)
|
||||
- "201-500" (Mid-Market)
|
||||
- "501-1000" (Large)
|
||||
- "1001-5000" (Enterprise)
|
||||
- "5001-10000" (Large Enterprise)
|
||||
- "10001+" (Global Enterprise)
|
||||
|
||||
### EXAMPLES
|
||||
["1-10", "11-50"]
|
||||
["51-200", "201-500", "501-1000"]
|
||||
["1001-5000", "5001-10000", "10001+"]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the company sizes to search for...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'q_organization_keyword_tags',
|
||||
@@ -211,6 +433,30 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["saas", "b2b", "enterprise"]',
|
||||
condition: { field: 'operation', value: 'organization_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of keyword/industry tag strings for Apollo organization search.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.industry>\`).
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of keyword strings. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["saas", "b2b", "enterprise"]
|
||||
["fintech", "healthcare", "ai"]
|
||||
["e-commerce", "retail", "marketplace"]
|
||||
[<agent1.target_industry>]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the industry keywords to search for...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'q_organization_name',
|
||||
@@ -287,6 +533,25 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
'[{"first_name": "John", "last_name": "Doe", "email": "john@example.com", "title": "CEO"}]',
|
||||
condition: { field: 'operation', value: 'contact_bulk_create' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of contact objects for Apollo bulk create. Each object must have first_name and last_name, and optionally email, title, account_id, owner_id.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
[{"first_name": "John", "last_name": "Doe", "email": "john@example.com", "title": "CEO"}]
|
||||
[{"first_name": "Jane", "last_name": "Smith", "title": "Manager", "account_id": "123"}]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the contacts you want to create...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contacts',
|
||||
@@ -295,6 +560,25 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
placeholder: '[{"id": "contact_id_1", "first_name": "John", "last_name": "Doe"}]',
|
||||
condition: { field: 'operation', value: 'contact_bulk_update' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of contact objects for Apollo bulk update. Each object must have id, and fields to update like first_name, last_name, email, title.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
[{"id": "contact_id_1", "first_name": "John", "last_name": "Doe"}]
|
||||
[{"id": "contact_id_2", "email": "newemail@example.com", "title": "Senior Manager"}]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the contacts you want to update...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'run_dedupe',
|
||||
@@ -356,6 +640,28 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["stage_id_1", "stage_id_2"]',
|
||||
condition: { field: 'operation', value: 'account_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of Apollo account stage IDs for filtering accounts by their pipeline stage.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.stage_id>\`).
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of stage ID strings. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["stage_id_1", "stage_id_2"]
|
||||
[<agent1.selected_stage>]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Enter or describe the account stage IDs...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
|
||||
// Account Bulk Operations
|
||||
@@ -367,6 +673,29 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
'[{"name": "Company A", "website_url": "https://companya.com", "phone": "+1234567890"}]',
|
||||
condition: { field: 'operation', value: 'account_bulk_create' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of account objects for Apollo bulk create. Each object must have name, and optionally website_url, phone, owner_id.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.company_name>\`).
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
[{"name": "Acme Corp", "website_url": "https://acme.com", "phone": "+1234567890"}]
|
||||
[{"name": <agent1.company>, "website_url": <agent1.website>}]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the accounts you want to create...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'accounts',
|
||||
@@ -375,6 +704,29 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
placeholder: '[{"id": "account_id_1", "name": "Updated Company Name"}]',
|
||||
condition: { field: 'operation', value: 'account_bulk_update' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of account objects for Apollo bulk update. Each object must have id, and fields to update like name, website_url, phone.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.account_id>\`).
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
[{"id": "account_id_1", "name": "Updated Company Name"}]
|
||||
[{"id": <agent1.account_id>, "name": <agent1.new_name>}]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the accounts you want to update...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
|
||||
// Opportunity Fields
|
||||
@@ -453,6 +805,28 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["account_id_1", "account_id_2"]',
|
||||
condition: { field: 'operation', value: 'opportunity_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of Apollo account IDs for filtering opportunities.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.account_id>\`).
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of account ID strings. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["account_id_1", "account_id_2"]
|
||||
[<agent1.account_id>]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Enter or describe the account IDs...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'stage_ids',
|
||||
@@ -460,6 +834,28 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["stage_id_1", "stage_id_2"]',
|
||||
condition: { field: 'operation', value: 'opportunity_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of Apollo opportunity stage IDs for filtering opportunities.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.stage_id>\`).
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of stage ID strings. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["stage_id_1", "stage_id_2"]
|
||||
[<agent1.selected_stages>]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Enter or describe the stage IDs...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'owner_ids',
|
||||
@@ -467,6 +863,28 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '["user_id_1", "user_id_2"]',
|
||||
condition: { field: 'operation', value: 'opportunity_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of Apollo user/owner IDs for filtering opportunities by owner.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.owner_id>\`).
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of user ID strings. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["user_id_1", "user_id_2"]
|
||||
[<agent1.assigned_owner>]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Enter or describe the owner IDs...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
|
||||
// Sequence Search Fields
|
||||
@@ -500,6 +918,29 @@ export const ApolloBlock: BlockConfig<ApolloResponse> = {
|
||||
placeholder: '["contact_id_1", "contact_id_2"]',
|
||||
condition: { field: 'operation', value: 'sequence_add' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `Generate a JSON array of Apollo contact IDs to add to a sequence.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax (e.g., \`<agent1.contact_id>\`).
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### EXAMPLES
|
||||
["contact_id_1", "contact_id_2"]
|
||||
[<agent1.contact_ids>]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the contact IDs to add...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
|
||||
// Task Fields
|
||||
|
||||
@@ -119,12 +119,79 @@ export const AsanaBlock: BlockConfig<AsanaResponse> = {
|
||||
id: 'notes',
|
||||
title: 'Task Notes',
|
||||
type: 'long-input',
|
||||
|
||||
placeholder: 'Enter task notes or description',
|
||||
condition: {
|
||||
field: 'operation',
|
||||
value: ['create_task', 'update_task'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing Asana task descriptions. Create clear, actionable task notes.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.details>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{PROJECT_NAME}}\`)
|
||||
|
||||
### ASANA FORMATTING
|
||||
Asana supports rich text:
|
||||
- **bold** with double asterisks
|
||||
- _italic_ with underscores
|
||||
- Bullet points with -
|
||||
- Numbered lists with 1.
|
||||
- Links automatically detected
|
||||
|
||||
### GUIDELINES
|
||||
1. **Clarity**: Be specific about what needs to be done
|
||||
2. **Context**: Include relevant background
|
||||
3. **Subtasks**: Break down complex tasks
|
||||
4. **Dependencies**: Note any blockers or dependencies
|
||||
5. **Resources**: Link to relevant documents or references
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Task description**: "Write notes for implementing user authentication"
|
||||
→ **Objective**
|
||||
Implement user authentication using OAuth 2.0.
|
||||
|
||||
**Requirements**
|
||||
- Support Google and GitHub OAuth providers
|
||||
- Implement token refresh mechanism
|
||||
- Add session management
|
||||
|
||||
**Acceptance Criteria**
|
||||
- Users can sign in with Google
|
||||
- Users can sign in with GitHub
|
||||
- Sessions persist across browser restarts
|
||||
- Token refresh works automatically
|
||||
|
||||
**Resources**
|
||||
- Design doc: [link]
|
||||
- API specs: [link]
|
||||
|
||||
**With variables**: "Create task from request"
|
||||
→ **Request Details**
|
||||
- Submitted by: <agent1.user_name>
|
||||
- Priority: <function1.priority>
|
||||
- Due: <function1.due_date>
|
||||
|
||||
**Description**
|
||||
<agent1.request_description>
|
||||
|
||||
**Next Steps**
|
||||
- Review requirements
|
||||
- Create implementation plan
|
||||
- Schedule kickoff meeting
|
||||
|
||||
### REMEMBER
|
||||
Be specific and actionable. Include acceptance criteria when relevant.`,
|
||||
placeholder: 'Describe the task notes...',
|
||||
generationType: 'markdown-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'assignee',
|
||||
|
||||
@@ -30,6 +30,47 @@ export const ClayBlock: BlockConfig<ClayPopulateResponse> = {
|
||||
JSON: Best for populating multiple columns.
|
||||
Plain Text: Best for populating a table in free-form style.
|
||||
`,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Clay developer. Generate data to populate a Clay workbook table.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.name>\`, \`<function1.result.email>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_SOURCE}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON or plain text data. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### DATA GUIDELINES
|
||||
1. **JSON Format**: Best for structured data with multiple columns
|
||||
- Use objects for single rows: {"column1": "value1", "column2": "value2"}
|
||||
- Use arrays for multiple rows: [{"col1": "val1"}, {"col1": "val2"}]
|
||||
2. **Plain Text**: Best for free-form single column data
|
||||
3. **Column Names**: Should match your Clay table column names
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single record**: "Add a lead with name and email"
|
||||
→ {"name": "John Doe", "email": "john@example.com", "company": "Acme Inc"}
|
||||
|
||||
**Multiple records**: "Add multiple leads"
|
||||
→ [{"name": "John", "email": "john@example.com"}, {"name": "Jane", "email": "jane@example.com"}]
|
||||
|
||||
**With variables**: "Populate with data from previous block"
|
||||
→ {"name": <agent1.name>, "email": <agent1.email>, "source": "{{DEFAULT_SOURCE}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY the data - no explanations.`,
|
||||
placeholder: 'Describe the data you want to populate...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'authToken',
|
||||
|
||||
@@ -116,6 +116,85 @@ export const ConfluenceBlock: BlockConfig<ConfluenceResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'Enter content for the page',
|
||||
condition: { field: 'operation', value: ['create', 'update'] },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing Confluence documentation. Create clear, professional documentation content.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.content>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{PROJECT_NAME}}\`)
|
||||
|
||||
### CONFLUENCE FORMATTING
|
||||
Confluence uses wiki markup or can accept HTML:
|
||||
- h1. h2. h3. for headers
|
||||
- *bold* and _italic_
|
||||
- * bullet lists
|
||||
- # numbered lists
|
||||
- {code}code blocks{code}
|
||||
- [link text|URL]
|
||||
- {info}, {warning}, {note} macros
|
||||
|
||||
### GUIDELINES
|
||||
1. **Structure**: Use clear hierarchy with headers
|
||||
2. **Documentation Style**: Write for clarity and completeness
|
||||
3. **Tables**: Use tables for structured data
|
||||
4. **Code Examples**: Include code samples where relevant
|
||||
5. **Links**: Reference related pages and resources
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Technical documentation**: "Write API endpoint documentation"
|
||||
→ h1. User API Endpoints
|
||||
|
||||
h2. Overview
|
||||
This document describes the User API endpoints available in the system.
|
||||
|
||||
h2. Authentication
|
||||
All endpoints require a valid API key in the Authorization header.
|
||||
|
||||
h2. Endpoints
|
||||
|
||||
h3. GET /api/users
|
||||
Retrieves a list of all users.
|
||||
|
||||
*Parameters:*
|
||||
| Name | Type | Required | Description |
|
||||
| limit | integer | No | Maximum results (default: 100) |
|
||||
| offset | integer | No | Pagination offset |
|
||||
|
||||
*Response:*
|
||||
{code:json}
|
||||
{
|
||||
"users": [...],
|
||||
"total": 150
|
||||
}
|
||||
{code}
|
||||
|
||||
{info}Rate limit: 100 requests per minute{info}
|
||||
|
||||
**With variables**: "Create page from template"
|
||||
→ h1. <agent1.title>
|
||||
|
||||
h2. Overview
|
||||
<agent1.summary>
|
||||
|
||||
h2. Details
|
||||
<function1.content>
|
||||
|
||||
h2. Related Pages
|
||||
* [Related Page 1]
|
||||
* [Related Page 2]
|
||||
|
||||
### REMEMBER
|
||||
Use Confluence wiki markup. Write clear, professional documentation.`,
|
||||
placeholder: 'Describe the Confluence content...',
|
||||
generationType: 'markdown-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'parentId',
|
||||
|
||||
@@ -54,6 +54,47 @@ export const DatadogBlock: BlockConfig<DatadogResponse> = {
|
||||
]`,
|
||||
condition: { field: 'operation', value: 'datadog_submit_metrics' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Datadog developer. Generate Datadog metrics series JSON array.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.metric_value>\`, \`<function1.result.tags>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DD_SERVICE}}\`, \`{{ENVIRONMENT}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the metrics series as a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### METRICS GUIDELINES
|
||||
1. **Array Format**: Always return a JSON array, even for single metric
|
||||
2. **Metric Types**: gauge, count, rate, histogram, distribution
|
||||
3. **Points**: Array of {timestamp, value} objects (timestamp in Unix seconds)
|
||||
4. **Tags**: Array of strings in "key:value" format
|
||||
5. **Metric Names**: Use dot notation (e.g., "custom.app.response_time")
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single gauge metric**: "Submit response time metric"
|
||||
→ [{"metric": "custom.app.response_time", "type": "gauge", "points": [{"timestamp": 1704067200, "value": 0.85}], "tags": ["env:production"]}]
|
||||
|
||||
**Multiple metrics**: "Submit CPU and memory metrics"
|
||||
→ [{"metric": "system.cpu.usage", "type": "gauge", "points": [{"timestamp": 1704067200, "value": 75.5}], "tags": ["env:production"]}, {"metric": "system.memory.used", "type": "gauge", "points": [{"timestamp": 1704067200, "value": 8192}], "tags": ["env:production"]}]
|
||||
|
||||
**With multiple points**: "Submit metric with multiple data points"
|
||||
→ [{"metric": "custom.app.requests", "type": "count", "points": [{"timestamp": 1704067200, "value": 100}, {"timestamp": 1704067300, "value": 150}], "tags": ["env:production", "service:api"]}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the metrics you want to submit...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
|
||||
// ========================
|
||||
@@ -198,6 +239,50 @@ export const DatadogBlock: BlockConfig<DatadogResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '{"notify_no_data": true, "thresholds": {"critical": 90}}',
|
||||
condition: { field: 'operation', value: 'datadog_create_monitor' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Datadog developer. Generate Datadog monitor options JSON.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.threshold>\`, \`<function1.result.interval>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{ALERT_THRESHOLD}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the options as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### OPTIONS GUIDELINES
|
||||
1. **Thresholds**: Define warning and critical thresholds
|
||||
2. **Notify No Data**: Whether to notify when no data is received
|
||||
3. **Evaluation Delay**: Delay before evaluation (in seconds)
|
||||
4. **Renotify Interval**: Minutes between renotifications
|
||||
5. **Timeout**: Evaluation timeout (in seconds)
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Basic thresholds**: "Set critical threshold at 90"
|
||||
→ {"thresholds": {"critical": 90}}
|
||||
|
||||
**With warning**: "Set warning at 70 and critical at 90"
|
||||
→ {"thresholds": {"warning": 70, "critical": 90}}
|
||||
|
||||
**Full options**: "Monitor with thresholds, notify no data, and renotify every 60 minutes"
|
||||
→ {"notify_no_data": true, "thresholds": {"warning": 70, "critical": 90}, "renotify_interval": 60}
|
||||
|
||||
**With evaluation delay**: "Monitor with 5 minute evaluation delay"
|
||||
→ {"thresholds": {"critical": 90}, "evaluation_delay": 300}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the monitor options you need...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
|
||||
// ========================
|
||||
@@ -266,6 +351,61 @@ export const DatadogBlock: BlockConfig<DatadogResponse> = {
|
||||
placeholder: 'service:web-app status:error',
|
||||
condition: { field: 'operation', value: 'datadog_query_logs' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Datadog developer. Generate Datadog log search queries.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the log search query string. Do not include any explanations, markdown formatting, comments, or additional text.
|
||||
|
||||
### LOG QUERY SYNTAX
|
||||
|
||||
**Basic Filters**:
|
||||
- service:my-service
|
||||
- status:error
|
||||
- host:my-host
|
||||
|
||||
**Text Search**:
|
||||
- "exact phrase"
|
||||
- message:*error*
|
||||
|
||||
**Comparisons**:
|
||||
- @duration:>1000
|
||||
- @status_code:>=400
|
||||
|
||||
**Combining**:
|
||||
- service:api AND status:error
|
||||
- status:error OR status:warn
|
||||
- NOT service:healthcheck
|
||||
|
||||
**Facets**:
|
||||
- @http.url:"/api/*"
|
||||
- @user.id:12345
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple**: "Find errors in the API service"
|
||||
→ service:api status:error
|
||||
|
||||
**With text**: "Find logs containing 'timeout'"
|
||||
→ service:api "timeout"
|
||||
|
||||
**Complex**: "Find API errors except healthcheck"
|
||||
→ service:api status:error NOT @http.url:"/health*"
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY the query string - no explanations.`,
|
||||
placeholder: 'Describe the logs you want to find...',
|
||||
generationType: 'sql-query',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'logFrom',
|
||||
@@ -308,6 +448,48 @@ export const DatadogBlock: BlockConfig<DatadogResponse> = {
|
||||
]`,
|
||||
condition: { field: 'operation', value: 'datadog_send_logs' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Datadog developer. Generate Datadog logs JSON array.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.message>\`, \`<function1.result.user_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DD_SERVICE}}\`, \`{{ENVIRONMENT}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the logs as a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### LOGS GUIDELINES
|
||||
1. **Array Format**: Always return a JSON array, even for single log
|
||||
2. **Message**: Required field with the log message
|
||||
3. **Service**: Application/service name
|
||||
4. **ddsource**: Source identifier (e.g., "custom", "nginx", "python")
|
||||
5. **ddtags**: Comma-separated tags in "key:value" format
|
||||
6. **Additional Fields**: Add any custom fields as needed
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single log**: "Send application start log"
|
||||
→ [{"message": "Application started successfully", "service": "my-app", "ddsource": "custom", "ddtags": "env:production"}]
|
||||
|
||||
**Multiple logs**: "Send error and info logs"
|
||||
→ [{"message": "Error occurred", "service": "api", "ddsource": "custom", "ddtags": "env:production,level:error"}, {"message": "Request processed", "service": "api", "ddsource": "custom", "ddtags": "env:production,level:info"}]
|
||||
|
||||
**With custom fields**: "Send log with user context"
|
||||
→ [{"message": "User logged in", "service": "auth", "ddsource": "custom", "ddtags": "env:production", "user_id": "123", "ip": "192.168.1.1"}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the logs you want to send...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
|
||||
// ========================
|
||||
|
||||
@@ -131,6 +131,63 @@ export const DiscordBlock: BlockConfig<DiscordResponse> = {
|
||||
field: 'operation',
|
||||
value: ['discord_send_message', 'discord_edit_message', 'discord_execute_webhook'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing Discord messages. Compose engaging messages using Discord's markdown formatting.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{SERVER_NAME}}\`)
|
||||
|
||||
### DISCORD MARKDOWN FORMATTING
|
||||
- **bold** with double asterisks
|
||||
- *italic* with single asterisks
|
||||
- __underline__ with double underscores
|
||||
- ~~strikethrough~~ with double tildes
|
||||
- \`inline code\` with backticks
|
||||
- \`\`\`code block\`\`\` with triple backticks
|
||||
- > quote with >
|
||||
- >>> multi-line quote with >>>
|
||||
- ||spoiler|| with double pipes
|
||||
|
||||
### GUIDELINES
|
||||
1. **Tone**: Match community/server tone (casual, friendly, or professional)
|
||||
2. **Formatting**: Use markdown for emphasis
|
||||
3. **Emojis**: Use Discord emojis where appropriate
|
||||
4. **Length**: Discord has a 2000 character limit
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Announcement**: "Announce a new feature"
|
||||
→ 🎉 **New Feature Alert!**
|
||||
|
||||
We've just released a brand new feature that you're going to love!
|
||||
|
||||
**What's New:**
|
||||
• Faster performance
|
||||
• Better UI
|
||||
• New customization options
|
||||
|
||||
Check it out and let us know what you think!
|
||||
|
||||
**With variables**: "Send alert message"
|
||||
→ ⚠️ **Alert**
|
||||
|
||||
Status: <function1.status>
|
||||
Service: <agent1.service_name>
|
||||
|
||||
Please check the dashboard for more details.
|
||||
|
||||
### REMEMBER
|
||||
Use Discord markdown. Keep messages engaging and within 2000 characters.`,
|
||||
placeholder: 'Describe the Discord message you want to send...',
|
||||
generationType: 'message-content',
|
||||
},
|
||||
},
|
||||
// Emoji - for reaction operations
|
||||
{
|
||||
|
||||
@@ -65,6 +65,49 @@ export const DynamoDBBlock: BlockConfig<DynamoDBResponse> = {
|
||||
placeholder: '{\n "pk": "user#123"\n}',
|
||||
condition: { field: 'operation', value: 'get' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert DynamoDB developer. Generate DynamoDB primary key JSON based on the user's request.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`, \`<function1.result.order_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{TABLE_PREFIX}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the key as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### KEY GUIDELINES
|
||||
1. **Primary Key**: Must include partition key (pk) and optionally sort key (sk)
|
||||
2. **Data Types**: Use strings, numbers, or binary for key values
|
||||
3. **Format**: Simple key-value pairs matching your table schema
|
||||
4. **Required**: Partition key is always required, sort key only if table has composite key
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple partition key**: "Get item with partition key user#123"
|
||||
→ {"pk": "user#123"}
|
||||
|
||||
**Composite key**: "Get item with pk user#123 and sk order#456"
|
||||
→ {"pk": "user#123", "sk": "order#456"}
|
||||
|
||||
**Numeric key**: "Get item with id 12345"
|
||||
→ {"id": 12345}
|
||||
|
||||
**String key**: "Get user by email"
|
||||
→ {"email": "user@example.com"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the key you want to use...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'key',
|
||||
@@ -73,6 +116,43 @@ export const DynamoDBBlock: BlockConfig<DynamoDBResponse> = {
|
||||
placeholder: '{\n "pk": "user#123"\n}',
|
||||
condition: { field: 'operation', value: 'update' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert DynamoDB developer. Generate DynamoDB primary key JSON for UPDATE operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the key as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### KEY GUIDELINES
|
||||
1. **Primary Key**: Must include partition key (pk) and optionally sort key (sk)
|
||||
2. **Data Types**: Use strings, numbers, or binary for key values
|
||||
3. **Format**: Simple key-value pairs matching your table schema
|
||||
4. **Required**: Partition key is always required, sort key only if table has composite key
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple partition key**: "Update item with partition key user#123"
|
||||
→ {"pk": "user#123"}
|
||||
|
||||
**Composite key**: "Update item with pk user#123 and sk order#456"
|
||||
→ {"pk": "user#123", "sk": "order#456"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the key you want to use...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'key',
|
||||
@@ -81,6 +161,46 @@ export const DynamoDBBlock: BlockConfig<DynamoDBResponse> = {
|
||||
placeholder: '{\n "pk": "user#123"\n}',
|
||||
condition: { field: 'operation', value: 'delete' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert DynamoDB developer. Generate DynamoDB primary key JSON for DELETE operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.item_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the key as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### ⚠️ DELETION WARNING ⚠️
|
||||
DELETIONS ARE PERMANENT! Be extremely careful and specific with your key criteria.
|
||||
|
||||
### KEY GUIDELINES
|
||||
1. **Primary Key**: Must include partition key (pk) and optionally sort key (sk)
|
||||
2. **Data Types**: Use strings, numbers, or binary for key values
|
||||
3. **Format**: Simple key-value pairs matching your table schema
|
||||
4. **Required**: Partition key is always required, sort key only if table has composite key
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple partition key**: "Delete item with partition key user#123"
|
||||
→ {"pk": "user#123"}
|
||||
|
||||
**Composite key**: "Delete item with pk user#123 and sk order#456"
|
||||
→ {"pk": "user#123", "sk": "order#456"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the key you want to use...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Consistent read for get
|
||||
{
|
||||
@@ -103,6 +223,49 @@ export const DynamoDBBlock: BlockConfig<DynamoDBResponse> = {
|
||||
'{\n "pk": "user#123",\n "name": "John Doe",\n "email": "john@example.com"\n}',
|
||||
condition: { field: 'operation', value: 'put' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert DynamoDB developer. Generate DynamoDB item JSON for PUT operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.name>\`, \`<function1.result.email>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the item as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### ITEM GUIDELINES
|
||||
1. **Primary Key**: Must include partition key (pk) and optionally sort key (sk)
|
||||
2. **Attributes**: Include all attributes you want to store
|
||||
3. **Data Types**: Use strings, numbers, booleans, lists, maps, sets, null
|
||||
4. **Nested Data**: Use maps (objects) for nested structures
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple item**: "Create user with pk, name, and email"
|
||||
→ {"pk": "user#123", "name": "John Doe", "email": "john@example.com"}
|
||||
|
||||
**With composite key**: "Create order with pk, sk, total, and status"
|
||||
→ {"pk": "user#123", "sk": "order#456", "total": 99.99, "status": "pending"}
|
||||
|
||||
**Complex nested**: "Create user with profile and preferences"
|
||||
→ {"pk": "user#123", "name": "John", "profile": {"age": 30, "city": "NYC"}, "preferences": {"theme": "dark", "notifications": true}}
|
||||
|
||||
**With lists**: "Create product with tags and categories"
|
||||
→ {"pk": "product#123", "name": "Widget", "tags": ["electronics", "gadget"], "categories": ["tech", "home"]}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the item you want to create...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Key condition expression for query
|
||||
{
|
||||
@@ -152,6 +315,42 @@ export const DynamoDBBlock: BlockConfig<DynamoDBResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '{\n "#name": "name"\n}',
|
||||
condition: { field: 'operation', value: 'query' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert DynamoDB developer. Generate DynamoDB Expression Attribute Names JSON.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax for dynamic field names.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the expression attribute names as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### EXPRESSION ATTRIBUTE NAMES GUIDELINES
|
||||
1. **Purpose**: Maps placeholder names (starting with #) to actual attribute names
|
||||
2. **Reserved Words**: Use when attribute names are DynamoDB reserved words (name, status, data, etc.)
|
||||
3. **Format**: Keys start with #, values are actual attribute names
|
||||
4. **Query/Scan/Update**: Used in KeyConditionExpression, FilterExpression, UpdateExpression
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single attribute**: "Map #name to name attribute"
|
||||
→ {"#name": "name"}
|
||||
|
||||
**Multiple attributes**: "Map #status and #date to status and created_date"
|
||||
→ {"#status": "status", "#date": "created_date"}
|
||||
|
||||
**Reserved words**: "Map #data to data attribute (reserved word)"
|
||||
→ {"#data": "data"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the attribute name mappings...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'expressionAttributeNames',
|
||||
@@ -159,6 +358,39 @@ export const DynamoDBBlock: BlockConfig<DynamoDBResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '{\n "#name": "name"\n}',
|
||||
condition: { field: 'operation', value: 'scan' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert DynamoDB developer. Generate DynamoDB Expression Attribute Names JSON for SCAN operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax for dynamic field names.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the expression attribute names as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### EXPRESSION ATTRIBUTE NAMES GUIDELINES
|
||||
1. **Purpose**: Maps placeholder names (starting with #) to actual attribute names
|
||||
2. **Reserved Words**: Use when attribute names are DynamoDB reserved words
|
||||
3. **Format**: Keys start with #, values are actual attribute names
|
||||
4. **Scan**: Used in FilterExpression and ProjectionExpression
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single attribute**: "Map #name to name attribute"
|
||||
→ {"#name": "name"}
|
||||
|
||||
**Multiple attributes**: "Map #status and #date"
|
||||
→ {"#status": "status", "#date": "created_date"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the attribute name mappings...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'expressionAttributeNames',
|
||||
@@ -166,6 +398,39 @@ export const DynamoDBBlock: BlockConfig<DynamoDBResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '{\n "#name": "name"\n}',
|
||||
condition: { field: 'operation', value: 'update' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert DynamoDB developer. Generate DynamoDB Expression Attribute Names JSON for UPDATE operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax for dynamic field names.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the expression attribute names as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### EXPRESSION ATTRIBUTE NAMES GUIDELINES
|
||||
1. **Purpose**: Maps placeholder names (starting with #) to actual attribute names
|
||||
2. **Reserved Words**: Use when attribute names are DynamoDB reserved words
|
||||
3. **Format**: Keys start with #, values are actual attribute names
|
||||
4. **Update**: Used in UpdateExpression and ConditionExpression
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single attribute**: "Map #name to name attribute"
|
||||
→ {"#name": "name"}
|
||||
|
||||
**Multiple attributes**: "Map #status and #date"
|
||||
→ {"#status": "status", "#date": "created_date"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the attribute name mappings...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Expression attribute values for query, scan, update
|
||||
{
|
||||
@@ -174,6 +439,49 @@ export const DynamoDBBlock: BlockConfig<DynamoDBResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '{\n ":pk": "user#123",\n ":name": "Jane"\n}',
|
||||
condition: { field: 'operation', value: 'query' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert DynamoDB developer. Generate DynamoDB Expression Attribute Values JSON for QUERY operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`, \`<function1.result.status>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the expression attribute values as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### EXPRESSION ATTRIBUTE VALUES GUIDELINES
|
||||
1. **Purpose**: Provides values for placeholders (starting with :) in expressions
|
||||
2. **Format**: Keys start with :, values are the actual values
|
||||
3. **Data Types**: Use strings, numbers, booleans, lists, maps, sets, null
|
||||
4. **Query**: Used in KeyConditionExpression and FilterExpression
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple values**: "Values for pk and status"
|
||||
→ {":pk": "user#123", ":status": "active"}
|
||||
|
||||
**Numeric values**: "Values for min and max"
|
||||
→ {":min": 18, ":max": 65}
|
||||
|
||||
**Mixed types**: "Values for pk, count, and active"
|
||||
→ {":pk": "user#123", ":count": 10, ":active": true}
|
||||
|
||||
**List values**: "Values for tags"
|
||||
→ {":tags": ["tag1", "tag2"]}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the attribute values...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'expressionAttributeValues',
|
||||
@@ -181,6 +489,39 @@ export const DynamoDBBlock: BlockConfig<DynamoDBResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '{\n ":status": "active"\n}',
|
||||
condition: { field: 'operation', value: 'scan' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert DynamoDB developer. Generate DynamoDB Expression Attribute Values JSON for SCAN operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the expression attribute values as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### EXPRESSION ATTRIBUTE VALUES GUIDELINES
|
||||
1. **Purpose**: Provides values for placeholders (starting with :) in expressions
|
||||
2. **Format**: Keys start with :, values are the actual values
|
||||
3. **Data Types**: Use strings, numbers, booleans, lists, maps, sets, null
|
||||
4. **Scan**: Used in FilterExpression
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple values**: "Values for status"
|
||||
→ {":status": "active"}
|
||||
|
||||
**Numeric values**: "Values for min and max"
|
||||
→ {":min": 18, ":max": 65}
|
||||
|
||||
**Mixed types**: "Values for status and count"
|
||||
→ {":status": "active", ":count": 10}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the attribute values...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'expressionAttributeValues',
|
||||
@@ -188,6 +529,39 @@ export const DynamoDBBlock: BlockConfig<DynamoDBResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '{\n ":name": "Jane Doe"\n}',
|
||||
condition: { field: 'operation', value: 'update' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert DynamoDB developer. Generate DynamoDB Expression Attribute Values JSON for UPDATE operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the expression attribute values as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### EXPRESSION ATTRIBUTE VALUES GUIDELINES
|
||||
1. **Purpose**: Provides values for placeholders (starting with :) in expressions
|
||||
2. **Format**: Keys start with :, values are the actual values
|
||||
3. **Data Types**: Use strings, numbers, booleans, lists, maps, sets, null
|
||||
4. **Update**: Used in UpdateExpression and ConditionExpression
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple values**: "Values for name and status"
|
||||
→ {":name": "Jane Doe", ":status": "active"}
|
||||
|
||||
**Numeric values**: "Values for increment"
|
||||
→ {":inc": 1}
|
||||
|
||||
**Mixed types**: "Values for name, count, and active"
|
||||
→ {":name": "Jane", ":count": 5, ":active": true}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the attribute values...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Index name for query
|
||||
{
|
||||
|
||||
@@ -174,6 +174,45 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
|
||||
placeholder: '{ "field": "value", "another_field": 123 }',
|
||||
required: true,
|
||||
condition: { field: 'operation', value: 'elasticsearch_index_document' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Elasticsearch developer. Generate Elasticsearch document JSON based on the user's request.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.name>\`, \`<function1.result.email>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the document as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### DOCUMENT GUIDELINES
|
||||
1. **Structure**: Use proper JSON object structure with field-value pairs
|
||||
2. **Data Types**: Use appropriate types (strings, numbers, booleans, arrays, nested objects)
|
||||
3. **Naming**: Use lowercase field names with underscores (snake_case) following Elasticsearch conventions
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple document**: "Create a user document with name, email, and age"
|
||||
→ {"name": "John Doe", "email": "john@example.com", "age": 30}
|
||||
|
||||
**With variables**: "Create a document from previous block"
|
||||
→ {"name": <agent1.name>, "email": <agent1.email>, "source": "{{DATA_SOURCE}}"}
|
||||
|
||||
**With nested data**: "Create a product with name, price, and category details"
|
||||
→ {"name": "Laptop", "price": 999.99, "category": {"name": "Electronics", "id": "cat-123"}}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the document you want to create...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
|
||||
// Document body - for update (partial)
|
||||
@@ -184,6 +223,43 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
|
||||
placeholder: '{ "field_to_update": "new_value" }',
|
||||
required: true,
|
||||
condition: { field: 'operation', value: 'elasticsearch_update_document' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Elasticsearch developer. Generate a partial document JSON for updating an existing document.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.new_status>\`, \`<function1.result.price>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the partial document as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object with only the fields you want to update.
|
||||
|
||||
### UPDATE GUIDELINES
|
||||
1. **Partial Updates**: Only include fields that need to be updated
|
||||
2. **Nested Updates**: Use dot notation for nested fields or include the full nested object
|
||||
3. **Arrays**: Replace entire arrays, or use scripts for array manipulation
|
||||
4. **Data Types**: Maintain consistent data types with existing document
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple update**: "Update the email and status fields"
|
||||
→ {"email": "newemail@example.com", "status": "active"}
|
||||
|
||||
**With variables**: "Update fields from previous block"
|
||||
→ {"status": <agent1.new_status>, "updated_by": "{{SYSTEM_USER}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON with fields to update - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe what fields you want to update...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
|
||||
// Search query
|
||||
@@ -193,6 +269,72 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '{ "match": { "field": "search term" } }',
|
||||
condition: { field: 'operation', value: 'elasticsearch_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Elasticsearch developer. Generate Elasticsearch Query DSL queries based on the user's request.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.search_term>\`, \`<function1.result.status>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the query as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON query object.
|
||||
|
||||
### QUERY GUIDELINES
|
||||
1. **Query DSL**: Use Elasticsearch Query DSL syntax
|
||||
2. **Performance**: Structure queries efficiently
|
||||
3. **Relevance**: Use appropriate query types for the use case
|
||||
4. **Combining**: Use bool queries to combine multiple conditions
|
||||
|
||||
### COMMON QUERY TYPES
|
||||
|
||||
**Match Query** (full-text search):
|
||||
{"match": {"field": "search text"}}
|
||||
|
||||
**Term Query** (exact match):
|
||||
{"term": {"status": "active"}}
|
||||
|
||||
**Range Query**:
|
||||
{"range": {"age": {"gte": 18, "lte": 65}}}
|
||||
|
||||
**Bool Query** (combine queries):
|
||||
{"bool": {"must": [{"match": {"title": "elasticsearch"}}], "filter": [{"term": {"status": "published"}}]}}
|
||||
|
||||
**Multi-Match** (search multiple fields):
|
||||
{"multi_match": {"query": "search text", "fields": ["title", "content"]}}
|
||||
|
||||
**Match Phrase** (exact phrase):
|
||||
{"match_phrase": {"description": "exact phrase here"}}
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple search**: "Find documents with 'elasticsearch' in the title"
|
||||
→ {"match": {"title": "elasticsearch"}}
|
||||
|
||||
**Multiple conditions**: "Find active users over 18"
|
||||
→ {"bool": {"must": [{"term": {"status": "active"}}, {"range": {"age": {"gt": 18}}}]}}
|
||||
|
||||
**Text search with filters**: "Search for 'laptop' in products that are in stock and priced under 1000"
|
||||
→ {"bool": {"must": [{"match": {"name": "laptop"}}], "filter": [{"term": {"in_stock": true}}, {"range": {"price": {"lt": 1000}}]}]}}
|
||||
|
||||
**Complex bool query**: "Find published articles about 'python' or 'javascript' written in 2024"
|
||||
→ {"bool": {"must": [{"term": {"status": "published"}}, {"range": {"published_date": {"gte": "2024-01-01", "lte": "2024-12-31"}}], "should": [{"match": {"tags": "python"}}, {"match": {"tags": "javascript"}}], "minimum_should_match": 1}}
|
||||
|
||||
**Fuzzy search**: "Find documents similar to 'elastiksearch'"
|
||||
→ {"fuzzy": {"title": {"value": "elastiksearch", "fuzziness": "AUTO"}}}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe what you want to search for...',
|
||||
generationType: 'elasticsearch-query',
|
||||
},
|
||||
},
|
||||
|
||||
// Count query
|
||||
@@ -202,6 +344,45 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '{ "match": { "field": "value" } }',
|
||||
condition: { field: 'operation', value: 'elasticsearch_count' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Elasticsearch developer. Generate Elasticsearch Query DSL queries for counting documents.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the query as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON query object.
|
||||
|
||||
### COUNT QUERY GUIDELINES
|
||||
1. **Query DSL**: Use Elasticsearch Query DSL syntax (same as search queries)
|
||||
2. **Efficiency**: Use filters instead of queries when possible for better performance
|
||||
3. **Structure**: Same query structure as search queries
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Count by term**: "Count active documents"
|
||||
→ {"term": {"status": "active"}}
|
||||
|
||||
**Count with range**: "Count users between 18 and 65"
|
||||
→ {"range": {"age": {"gte": 18, "lte": 65}}}
|
||||
|
||||
**Count with multiple conditions**: "Count published articles from 2024"
|
||||
→ {"bool": {"must": [{"term": {"status": "published"}}, {"range": {"published_date": {"gte": "2024-01-01", "lte": "2024-12-31"}}}]}}
|
||||
|
||||
**Count matching text**: "Count documents containing 'error'"
|
||||
→ {"match": {"message": "error"}}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe what documents you want to count...',
|
||||
generationType: 'elasticsearch-query',
|
||||
},
|
||||
},
|
||||
|
||||
// Search size
|
||||
@@ -229,6 +410,45 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '[{ "field": { "order": "asc" } }]',
|
||||
condition: { field: 'operation', value: 'elasticsearch_search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Elasticsearch developer. Generate Elasticsearch sort specifications as JSON arrays.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the sort specification as a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### SORT GUIDELINES
|
||||
1. **Array Format**: Always return a JSON array, even for single field sorts
|
||||
2. **Order**: Use "asc" for ascending, "desc" for descending
|
||||
3. **Multiple Fields**: Array order determines sort priority
|
||||
4. **Nested Fields**: Use dot notation for nested fields
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single field ascending**: "Sort by name"
|
||||
→ [{"name": {"order": "asc"}}]
|
||||
|
||||
**Single field descending**: "Sort by date newest first"
|
||||
→ [{"created_at": {"order": "desc"}}]
|
||||
|
||||
**Multiple fields**: "Sort by category then price"
|
||||
→ [{"category": {"order": "asc"}}, {"price": {"order": "asc"}}]
|
||||
|
||||
**Complex sort**: "Sort by status, then by date descending, then by score"
|
||||
→ [{"status": {"order": "asc"}}, {"date": {"order": "desc"}}, {"score": {"order": "desc"}}]
|
||||
|
||||
**Nested field**: "Sort by customer name"
|
||||
→ [{"customer.name": {"order": "asc"}}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe how you want to sort the results...',
|
||||
generationType: 'elasticsearch-sort',
|
||||
},
|
||||
},
|
||||
|
||||
// Source includes
|
||||
@@ -264,6 +484,72 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
|
||||
'{ "index": { "_index": "my-index", "_id": "1" } }\n{ "field": "value" }\n{ "delete": { "_index": "my-index", "_id": "2" } }',
|
||||
required: true,
|
||||
condition: { field: 'operation', value: 'elasticsearch_bulk' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Elasticsearch developer. Generate Elasticsearch bulk operations in NDJSON (Newline Delimited JSON) format.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the bulk operations as NDJSON (each JSON object on a new line). Do not include any explanations, markdown formatting, comments, or additional text. Just the raw NDJSON.
|
||||
|
||||
### BULK OPERATION FORMAT
|
||||
Bulk operations use NDJSON format where:
|
||||
- Each operation action is on one line (index, create, update, delete)
|
||||
- Each document follows on the next line (for index/create/update)
|
||||
- Each pair is separated by a newline
|
||||
|
||||
### OPERATION TYPES
|
||||
|
||||
**Index** (create or replace):
|
||||
{"index": {"_index": "my-index", "_id": "1"}}
|
||||
{"field": "value", "another": 123}
|
||||
|
||||
**Create** (only if doesn't exist):
|
||||
{"create": {"_index": "my-index", "_id": "2"}}
|
||||
{"field": "value"}
|
||||
|
||||
**Update** (partial update):
|
||||
{"update": {"_index": "my-index", "_id": "3"}}
|
||||
{"doc": {"field": "new_value"}}
|
||||
|
||||
**Delete**:
|
||||
{"delete": {"_index": "my-index", "_id": "4"}}
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Index multiple documents**: "Index two user documents"
|
||||
→ {"index": {"_index": "users", "_id": "1"}}
|
||||
{"name": "John", "email": "john@example.com"}
|
||||
{"index": {"_index": "users", "_id": "2"}}
|
||||
{"name": "Jane", "email": "jane@example.com"}
|
||||
|
||||
**Mixed operations**: "Index one document and delete another"
|
||||
→ {"index": {"_index": "products", "_id": "new-1"}}
|
||||
{"name": "Widget", "price": 19.99}
|
||||
{"delete": {"_index": "products", "_id": "old-1"}}
|
||||
|
||||
**Update operations**: "Update two documents"
|
||||
→ {"update": {"_index": "users", "_id": "1"}}
|
||||
{"doc": {"status": "active"}}
|
||||
{"update": {"_index": "users", "_id": "2"}}
|
||||
{"doc": {"status": "inactive"}}
|
||||
|
||||
**Bulk create**: "Create three products"
|
||||
→ {"create": {"_index": "products"}}
|
||||
{"name": "Product A", "price": 10}
|
||||
{"create": {"_index": "products"}}
|
||||
{"name": "Product B", "price": 20}
|
||||
{"create": {"_index": "products"}}
|
||||
{"name": "Product C", "price": 30}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY NDJSON format (each JSON object on its own line) - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the bulk operations you want to perform...',
|
||||
generationType: 'elasticsearch-bulk',
|
||||
},
|
||||
},
|
||||
|
||||
// Index settings
|
||||
@@ -273,6 +559,50 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '{ "number_of_shards": 1, "number_of_replicas": 1 }',
|
||||
condition: { field: 'operation', value: 'elasticsearch_create_index' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Elasticsearch developer. Generate Elasticsearch index settings as JSON.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the settings as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### SETTINGS GUIDELINES
|
||||
1. **Shards**: number_of_shards determines how data is split (typically 1-5 for small indices)
|
||||
2. **Replicas**: number_of_replicas for redundancy (0 for development, 1+ for production)
|
||||
3. **Analysis**: Custom analyzers, tokenizers, filters
|
||||
4. **Refresh**: Control when changes become searchable
|
||||
|
||||
### COMMON SETTINGS
|
||||
|
||||
**Basic settings**:
|
||||
{"number_of_shards": 1, "number_of_replicas": 1}
|
||||
|
||||
**With refresh interval**:
|
||||
{"number_of_shards": 1, "number_of_replicas": 1, "refresh_interval": "30s"}
|
||||
|
||||
**With analysis**:
|
||||
{"number_of_shards": 1, "number_of_replicas": 1, "analysis": {"analyzer": {"custom": {"type": "standard"}}}}
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple settings**: "Create index with 1 shard and 1 replica"
|
||||
→ {"number_of_shards": 1, "number_of_replicas": 1}
|
||||
|
||||
**Production settings**: "Create index with 3 shards, 2 replicas, and 10s refresh"
|
||||
→ {"number_of_shards": 3, "number_of_replicas": 2, "refresh_interval": "10s"}
|
||||
|
||||
**Development settings**: "Create index with no replicas for testing"
|
||||
→ {"number_of_shards": 1, "number_of_replicas": 0}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the index settings you need...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
|
||||
// Index mappings
|
||||
@@ -282,6 +612,65 @@ export const ElasticsearchBlock: BlockConfig<ElasticsearchResponse> = {
|
||||
type: 'code',
|
||||
placeholder: '{ "properties": { "field": { "type": "text" } } }',
|
||||
condition: { field: 'operation', value: 'elasticsearch_create_index' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Elasticsearch developer. Generate Elasticsearch index mappings as JSON.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the mappings as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### MAPPING GUIDELINES
|
||||
1. **Properties**: Define field types and behaviors
|
||||
2. **Field Types**: text (full-text), keyword (exact), long/integer (numbers), date, boolean, object, nested
|
||||
3. **Analysis**: text fields are analyzed, keyword fields are not
|
||||
4. **Nested**: Use nested type for arrays of objects that need independent querying
|
||||
|
||||
### COMMON FIELD TYPES
|
||||
|
||||
**Text** (full-text search):
|
||||
{"properties": {"title": {"type": "text"}}}
|
||||
|
||||
**Keyword** (exact match, sorting):
|
||||
{"properties": {"status": {"type": "keyword"}}}
|
||||
|
||||
**Number**:
|
||||
{"properties": {"age": {"type": "integer"}, "price": {"type": "float"}}}
|
||||
|
||||
**Date**:
|
||||
{"properties": {"created_at": {"type": "date"}}}
|
||||
|
||||
**Boolean**:
|
||||
{"properties": {"active": {"type": "boolean"}}}
|
||||
|
||||
**Object** (nested structure):
|
||||
{"properties": {"user": {"type": "object", "properties": {"name": {"type": "text"}, "email": {"type": "keyword"}}}}}
|
||||
|
||||
**Nested** (array of objects):
|
||||
{"properties": {"tags": {"type": "nested", "properties": {"name": {"type": "keyword"}, "value": {"type": "text"}}}}}
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple mapping**: "Create mapping for user with name, email, and age"
|
||||
→ {"properties": {"name": {"type": "text"}, "email": {"type": "keyword"}, "age": {"type": "integer"}}}
|
||||
|
||||
**Product mapping**: "Create mapping for product with name, price, description, and tags"
|
||||
→ {"properties": {"name": {"type": "text"}, "price": {"type": "float"}, "description": {"type": "text"}, "tags": {"type": "keyword"}}}
|
||||
|
||||
**Complex nested**: "Create mapping for order with customer and items"
|
||||
→ {"properties": {"order_id": {"type": "keyword"}, "customer": {"type": "object", "properties": {"name": {"type": "text"}, "email": {"type": "keyword"}}}, "items": {"type": "nested", "properties": {"product": {"type": "text"}, "quantity": {"type": "integer"}, "price": {"type": "float"}}}, "created_at": {"type": "date"}}}
|
||||
|
||||
**With analyzers**: "Create text field with custom analyzer"
|
||||
→ {"properties": {"content": {"type": "text", "analyzer": "standard"}}}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the index mapping you need...',
|
||||
generationType: 'elasticsearch-mapping',
|
||||
},
|
||||
},
|
||||
|
||||
// Refresh option
|
||||
|
||||
@@ -551,9 +551,46 @@ export const GitHubBlock: BlockConfig<GitHubResponse> = {
|
||||
{
|
||||
id: 'required_status_checks',
|
||||
title: 'Required Status Checks',
|
||||
type: 'short-input',
|
||||
type: 'long-input',
|
||||
placeholder: 'JSON: {"strict":true,"contexts":["ci/test"]}',
|
||||
condition: { field: 'operation', value: 'github_update_branch_protection' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert GitHub developer. Generate required status checks JSON for branch protection.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### STATUS CHECKS STRUCTURE
|
||||
{
|
||||
"strict": boolean, // Require branches to be up to date before merging
|
||||
"contexts": string[] // Array of required status check names
|
||||
}
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**CI required**: "Require CI to pass"
|
||||
→ {"strict": true, "contexts": ["ci/test"]}
|
||||
|
||||
**Multiple checks**: "Require tests and linting"
|
||||
→ {"strict": true, "contexts": ["ci/test", "ci/lint", "ci/build"]}
|
||||
|
||||
**No strict**: "Just require checks, not up-to-date"
|
||||
→ {"strict": false, "contexts": ["ci/test"]}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations.`,
|
||||
placeholder: 'Describe the required status checks...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'enforce_admins',
|
||||
@@ -568,9 +605,47 @@ export const GitHubBlock: BlockConfig<GitHubResponse> = {
|
||||
{
|
||||
id: 'required_pull_request_reviews',
|
||||
title: 'Required PR Reviews',
|
||||
type: 'short-input',
|
||||
type: 'long-input',
|
||||
placeholder: 'JSON: {"required_approving_review_count":1}',
|
||||
condition: { field: 'operation', value: 'github_update_branch_protection' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert GitHub developer. Generate required PR reviews JSON for branch protection.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### PR REVIEWS STRUCTURE
|
||||
{
|
||||
"required_approving_review_count": number, // Number of approvals needed (1-6)
|
||||
"dismiss_stale_reviews": boolean, // Dismiss approvals when new commits pushed
|
||||
"require_code_owner_reviews": boolean, // Require review from code owners
|
||||
"require_last_push_approval": boolean // Require approval of last push
|
||||
}
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single approval**: "Require one approval"
|
||||
→ {"required_approving_review_count": 1}
|
||||
|
||||
**Strict reviews**: "Require 2 approvals, dismiss stale"
|
||||
→ {"required_approving_review_count": 2, "dismiss_stale_reviews": true}
|
||||
|
||||
**Code owners**: "Require code owner review"
|
||||
→ {"required_approving_review_count": 1, "require_code_owner_reviews": true, "dismiss_stale_reviews": true}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations.`,
|
||||
placeholder: 'Describe the PR review requirements...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Issue operations parameters
|
||||
{
|
||||
@@ -587,6 +662,91 @@ export const GitHubBlock: BlockConfig<GitHubResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'Enter issue description (optional)',
|
||||
condition: { field: 'operation', value: 'github_create_issue' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing GitHub issue descriptions. Create clear, well-structured issues using GitHub markdown.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.error>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{REPO_URL}}\`)
|
||||
|
||||
### GITHUB MARKDOWN
|
||||
- **bold** with double asterisks
|
||||
- *italic* with asterisks
|
||||
- \`inline code\` with backticks
|
||||
- \`\`\`language code block\`\`\`
|
||||
- - [ ] task lists
|
||||
- > blockquotes
|
||||
- [link text](url)
|
||||
- @mentions for users
|
||||
- #123 for issue references
|
||||
|
||||
### GUIDELINES
|
||||
1. **Problem Statement**: Clearly describe the issue
|
||||
2. **Reproduction Steps**: For bugs, include steps to reproduce
|
||||
3. **Expected vs Actual**: What should happen vs what happens
|
||||
4. **Environment**: Include relevant version/environment info
|
||||
5. **Screenshots/Logs**: Reference any attachments
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Bug report**: "Create a bug report for API rate limiting"
|
||||
→ ## Description
|
||||
API requests are being rate limited incorrectly, causing valid requests to fail.
|
||||
|
||||
## Steps to Reproduce
|
||||
1. Make 10 API requests within 1 minute
|
||||
2. Observe that requests start failing after 5 requests
|
||||
3. Check response headers for rate limit info
|
||||
|
||||
## Expected Behavior
|
||||
Rate limit should be 100 requests per minute as documented.
|
||||
|
||||
## Actual Behavior
|
||||
Rate limit appears to be 5 requests per minute.
|
||||
|
||||
## Environment
|
||||
- API Version: v2.1
|
||||
- Client: Node.js SDK v3.0.0
|
||||
- Region: US-East
|
||||
|
||||
## Logs
|
||||
\`\`\`
|
||||
Error: Rate limit exceeded (5/5)
|
||||
X-RateLimit-Remaining: 0
|
||||
\`\`\`
|
||||
|
||||
**With variables**: "Create issue from error"
|
||||
→ ## Automated Issue Report
|
||||
|
||||
### Error Details
|
||||
- Service: <agent1.service>
|
||||
- Error: <function1.error_message>
|
||||
- Timestamp: <function1.timestamp>
|
||||
|
||||
### Stack Trace
|
||||
\`\`\`
|
||||
<agent1.stack_trace>
|
||||
\`\`\`
|
||||
|
||||
### Impact
|
||||
<agent1.impact_description>
|
||||
|
||||
### Suggested Actions
|
||||
- [ ] Investigate root cause
|
||||
- [ ] Implement fix
|
||||
- [ ] Add tests
|
||||
|
||||
### REMEMBER
|
||||
Use GitHub markdown. Include all relevant technical details.`,
|
||||
placeholder: 'Describe the GitHub issue...',
|
||||
generationType: 'markdown-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'labels',
|
||||
@@ -849,6 +1009,45 @@ export const GitHubBlock: BlockConfig<GitHubResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'JSON: {"key":"value"}',
|
||||
condition: { field: 'operation', value: 'github_trigger_workflow' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert GitHub Actions developer. Generate workflow inputs JSON for triggering a workflow dispatch.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.version>\`, \`<function1.result.tag>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEPLOY_ENV}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### WORKFLOW INPUTS GUIDELINES
|
||||
1. Keys must match the input names defined in the workflow's workflow_dispatch trigger
|
||||
2. Values can be strings, numbers, or booleans depending on input type
|
||||
3. Required inputs must be provided
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple deploy**: "Deploy to production"
|
||||
→ {"environment": "production", "dry_run": false}
|
||||
|
||||
**Version release**: "Release version 1.2.3"
|
||||
→ {"version": "1.2.3", "create_tag": true}
|
||||
|
||||
**With variables**: "Deploy the version from previous block"
|
||||
→ {"version": <agent1.version>, "environment": "{{DEPLOY_ENV}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations.`,
|
||||
placeholder: 'Describe the workflow inputs...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'workflow_id',
|
||||
|
||||
@@ -76,6 +76,52 @@ export const GmailBlock: BlockConfig<GmailToolResponse> = {
|
||||
placeholder: 'Email content',
|
||||
condition: { field: 'operation', value: ['send_gmail', 'draft_gmail'] },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert email writer. Compose professional, clear, and effective email content.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.customer_name>\`, \`<function1.result.order_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{COMPANY_NAME}}\`, \`{{SUPPORT_EMAIL}}\`)
|
||||
|
||||
### GUIDELINES
|
||||
1. **Tone**: Match the appropriate tone (formal, friendly, urgent) based on context
|
||||
2. **Structure**: Use clear paragraphs, bullet points where helpful
|
||||
3. **Brevity**: Be concise but complete
|
||||
4. **Call to Action**: Include clear next steps when appropriate
|
||||
5. **Personalization**: Use variable references for dynamic content
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Professional inquiry**: "Ask about project status"
|
||||
→ Hi [Name],
|
||||
|
||||
I hope this email finds you well. I wanted to follow up on the project we discussed last week.
|
||||
|
||||
Could you provide an update on the current status and expected timeline? Please let me know if there are any blockers I can help address.
|
||||
|
||||
Best regards
|
||||
|
||||
**With variables**: "Send order confirmation"
|
||||
→ Dear <agent1.customer_name>,
|
||||
|
||||
Thank you for your order #<function1.order_id>!
|
||||
|
||||
Your order has been confirmed and will be shipped within 2-3 business days.
|
||||
|
||||
Best,
|
||||
{{COMPANY_NAME}}
|
||||
|
||||
### REMEMBER
|
||||
Write the email body only - no subject line unless specifically requested.`,
|
||||
placeholder: 'Describe the email you want to write...',
|
||||
generationType: 'email-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
|
||||
@@ -74,6 +74,60 @@ export const GoogleCalendarBlock: BlockConfig<GoogleCalendarResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'Event description',
|
||||
condition: { field: 'operation', value: 'create' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing calendar event descriptions. Create clear, informative event details.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.agenda>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{MEETING_LINK}}\`)
|
||||
|
||||
### GUIDELINES
|
||||
1. **Purpose**: Clearly state the meeting purpose
|
||||
2. **Agenda**: Include key discussion points
|
||||
3. **Preparation**: Note any required preparation
|
||||
4. **Links**: Include relevant meeting links and documents
|
||||
5. **Contact**: Add organizer contact if needed
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Team meeting**: "Write description for weekly team sync"
|
||||
→ Weekly Team Sync
|
||||
|
||||
Agenda:
|
||||
• Project status updates
|
||||
• Blockers and dependencies
|
||||
• Upcoming deadlines
|
||||
• Open discussion
|
||||
|
||||
Meeting Link: {{MEETING_LINK}}
|
||||
|
||||
Please come prepared with your updates for the week.
|
||||
|
||||
**With variables**: "Create event from request"
|
||||
→ <agent1.meeting_title>
|
||||
|
||||
Purpose: <agent1.purpose>
|
||||
|
||||
Attendees: <function1.attendees>
|
||||
|
||||
Agenda:
|
||||
<agent1.agenda_items>
|
||||
|
||||
Documents: <function1.doc_links>
|
||||
|
||||
Questions? Contact <agent1.organizer_email>
|
||||
|
||||
### REMEMBER
|
||||
Be concise. Include all necessary details for attendees.`,
|
||||
placeholder: 'Describe the event details...',
|
||||
generationType: 'markdown-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'location',
|
||||
|
||||
@@ -107,6 +107,73 @@ export const GoogleDocsBlock: BlockConfig<GoogleDocsResponse> = {
|
||||
placeholder: 'Enter document content',
|
||||
condition: { field: 'operation', value: 'write' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert document writer. Create clear, professional content for Google Docs.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.data>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{COMPANY_NAME}}\`)
|
||||
|
||||
### GUIDELINES
|
||||
1. **Structure**: Use clear headings and sections
|
||||
2. **Professional Tone**: Write clearly and professionally
|
||||
3. **Formatting**: Use paragraphs, lists, and emphasis
|
||||
4. **Completeness**: Include all relevant information
|
||||
5. **Readability**: Keep sentences and paragraphs concise
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Report**: "Write a weekly status report"
|
||||
→ Weekly Status Report
|
||||
Week of January 15, 2024
|
||||
|
||||
Executive Summary
|
||||
This week saw significant progress on our key initiatives with completion of Phase 1 development.
|
||||
|
||||
Accomplishments
|
||||
• Completed user authentication module
|
||||
• Deployed staging environment
|
||||
• Conducted security review
|
||||
|
||||
In Progress
|
||||
• Database optimization (75% complete)
|
||||
• API documentation updates
|
||||
• Performance testing
|
||||
|
||||
Blockers
|
||||
• Awaiting design approval for dashboard redesign
|
||||
|
||||
Next Week's Priorities
|
||||
1. Complete database optimization
|
||||
2. Begin Phase 2 development
|
||||
3. Stakeholder review meeting
|
||||
|
||||
**With variables**: "Create document from data"
|
||||
→ <agent1.document_title>
|
||||
|
||||
Date: <function1.date>
|
||||
Author: {{AUTHOR_NAME}}
|
||||
|
||||
Overview
|
||||
<agent1.summary>
|
||||
|
||||
Details
|
||||
<function1.content>
|
||||
|
||||
Next Steps
|
||||
<agent1.action_items>
|
||||
|
||||
### REMEMBER
|
||||
Write clear, professional content. Structure with headings and lists.`,
|
||||
placeholder: 'Describe the document content...',
|
||||
generationType: 'markdown-content',
|
||||
},
|
||||
},
|
||||
// Content Field for create operation
|
||||
{
|
||||
@@ -115,6 +182,30 @@ export const GoogleDocsBlock: BlockConfig<GoogleDocsResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'Enter document content',
|
||||
condition: { field: 'operation', value: 'create' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert document writer. Create clear, professional content for Google Docs.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
### GUIDELINES
|
||||
1. Use clear headings and sections
|
||||
2. Write professionally and concisely
|
||||
3. Use bullet points and numbered lists
|
||||
4. Include all relevant information
|
||||
|
||||
### REMEMBER
|
||||
Write clear, professional content. Structure with headings and lists.`,
|
||||
placeholder: 'Describe the document content...',
|
||||
generationType: 'markdown-content',
|
||||
},
|
||||
},
|
||||
],
|
||||
tools: {
|
||||
|
||||
@@ -83,6 +83,48 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
|
||||
'Enter values as JSON array of arrays (e.g., [["A1", "B1"], ["A2", "B2"]]) or an array of objects (e.g., [{"name":"John", "age":30}, {"name":"Jane", "age":25}])',
|
||||
condition: { field: 'operation', value: 'write' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at Google Sheets data formatting. Generate JSON data for writing to Google Sheets.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.data>\`, \`<function1.result.rows>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### DATA FORMATS
|
||||
|
||||
**Array of Arrays** (Row-based):
|
||||
[["Header1", "Header2"], ["Value1", "Value2"]]
|
||||
|
||||
**Array of Objects** (Column-mapped):
|
||||
[{"name": "John", "age": 30}, {"name": "Jane", "age": 25}]
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple write**: "Write headers and two rows of data"
|
||||
→ [["Name", "Email", "Age"], ["John Doe", "john@example.com", 30], ["Jane Smith", "jane@example.com", 25]]
|
||||
|
||||
**With variables**: "Write data from previous block"
|
||||
→ [["Name", "Status"], [<agent1.name>, <agent1.status>]]
|
||||
|
||||
**Object format**: "Write user records"
|
||||
→ [{"name": "John", "email": "john@example.com"}, {"name": "Jane", "email": "jane@example.com"}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the data you want to write...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'valueInputOption',
|
||||
@@ -103,6 +145,37 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
|
||||
'Enter values as JSON array of arrays (e.g., [["A1", "B1"], ["A2", "B2"]]) or an array of objects (e.g., [{"name":"John", "age":30}, {"name":"Jane", "age":25}])',
|
||||
condition: { field: 'operation', value: 'update' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at Google Sheets data formatting. Generate JSON data for updating Google Sheets.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### DATA FORMATS
|
||||
**Array of Arrays** (Row-based): [["Value1", "Value2"], ["Value3", "Value4"]]
|
||||
**Array of Objects** (Column-mapped): [{"col1": "val1"}, {"col1": "val2"}]
|
||||
|
||||
### EXAMPLES
|
||||
**Update cells**: "Update with new values"
|
||||
→ [["Updated Name", "Updated Email"], ["John Doe", "john.new@example.com"]]
|
||||
|
||||
**With variables**: "Update with data from previous block"
|
||||
→ [[<agent1.name>, <agent1.email>]]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the data you want to update...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'valueInputOption',
|
||||
@@ -123,6 +196,37 @@ export const GoogleSheetsBlock: BlockConfig<GoogleSheetsResponse> = {
|
||||
'Enter values as JSON array of arrays (e.g., [["A1", "B1"], ["A2", "B2"]]) or an array of objects (e.g., [{"name":"John", "age":30}, {"name":"Jane", "age":25}])',
|
||||
condition: { field: 'operation', value: 'append' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at Google Sheets data formatting. Generate JSON data for appending to Google Sheets.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### DATA FORMATS
|
||||
**Array of Arrays** (Row-based): [["Value1", "Value2"], ["Value3", "Value4"]]
|
||||
**Array of Objects** (Column-mapped): [{"col1": "val1"}, {"col1": "val2"}]
|
||||
|
||||
### EXAMPLES
|
||||
**Append rows**: "Add new rows to the sheet"
|
||||
→ [["New Entry", "new@email.com", "Active"]]
|
||||
|
||||
**With variables**: "Append data from previous block"
|
||||
→ [[<agent1.name>, <agent1.email>, <agent1.status>]]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the data you want to append...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'valueInputOption',
|
||||
|
||||
@@ -201,6 +201,44 @@ export const GoogleSlidesBlock: BlockConfig<GoogleSlidesResponse> = {
|
||||
placeholder: 'JSON array: [{"layoutPlaceholder":{"type":"TITLE"},"objectId":"my_title"}]',
|
||||
condition: { field: 'operation', value: 'add_slide' },
|
||||
mode: 'advanced',
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Google Slides API developer. Generate placeholder ID mappings JSON for adding slides.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax for dynamic object IDs.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### PLACEHOLDER TYPES
|
||||
- TITLE: Main title placeholder
|
||||
- SUBTITLE: Subtitle placeholder
|
||||
- BODY: Main body text placeholder
|
||||
- CENTERED_TITLE: Centered title
|
||||
- HEADER: Header area
|
||||
- FOOTER: Footer area
|
||||
|
||||
### FORMAT
|
||||
Each mapping needs: "layoutPlaceholder" with "type", and "objectId" (your custom ID)
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Title and body**: "Map title and body placeholders"
|
||||
→ [{"layoutPlaceholder": {"type": "TITLE"}, "objectId": "my_title_1"}, {"layoutPlaceholder": {"type": "BODY"}, "objectId": "my_body_1"}]
|
||||
|
||||
**Just title**: "Map only the title placeholder"
|
||||
→ [{"layoutPlaceholder": {"type": "TITLE"}, "objectId": "slide_title"}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the placeholder mappings...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
|
||||
// ========== Add Image Operation Fields ==========
|
||||
|
||||
@@ -154,6 +154,58 @@ export const GrafanaBlock: BlockConfig<GrafanaResponse> = {
|
||||
field: 'operation',
|
||||
value: ['grafana_create_dashboard', 'grafana_update_dashboard'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Grafana developer. Generate Grafana panel configuration JSON array.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.metric_name>\`, \`<function1.result.query>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DATASOURCE_UID}}\`, \`{{DASHBOARD_TITLE}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of panel objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### PANEL STRUCTURE
|
||||
Each panel typically has:
|
||||
- **id**: Unique panel ID (number)
|
||||
- **type**: Panel type (graph, stat, gauge, table, text, etc.)
|
||||
- **title**: Panel title
|
||||
- **gridPos**: Position {x, y, w, h}
|
||||
- **targets**: Array of data source queries
|
||||
- **options**: Panel-specific options
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple stat panel**: "Create a panel showing total users"
|
||||
→ [{
|
||||
"id": 1,
|
||||
"type": "stat",
|
||||
"title": "Total Users",
|
||||
"gridPos": {"x": 0, "y": 0, "w": 6, "h": 4},
|
||||
"targets": [{"refId": "A", "expr": "sum(users_total)"}]
|
||||
}]
|
||||
|
||||
**With variables**: "Create panel with dynamic title and query"
|
||||
→ [{
|
||||
"id": 1,
|
||||
"type": "timeseries",
|
||||
"title": <agent1.panel_title>,
|
||||
"gridPos": {"x": 0, "y": 0, "w": 12, "h": 8},
|
||||
"targets": [{"refId": "A", "expr": <agent1.prometheus_query>}]
|
||||
}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the panels you want to create...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'message',
|
||||
@@ -227,6 +279,60 @@ export const GrafanaBlock: BlockConfig<GrafanaResponse> = {
|
||||
field: 'operation',
|
||||
value: ['grafana_create_alert_rule', 'grafana_update_alert_rule'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Grafana developer. Generate Grafana alert rule query data JSON array.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.query>\`, \`<function1.result.threshold>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{PROMETHEUS_UID}}\`, \`{{ALERT_THRESHOLD}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of query/expression data objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### QUERY DATA STRUCTURE
|
||||
Each query/expression object has:
|
||||
- **refId**: Reference ID (A, B, C, etc.)
|
||||
- **queryType**: Type of query
|
||||
- **relativeTimeRange**: Time range {from, to} in seconds
|
||||
- **datasourceUid**: Data source UID
|
||||
- **model**: Query model specific to the data source
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Prometheus query**: "Alert when CPU is above 80%"
|
||||
→ [
|
||||
{
|
||||
"refId": "A",
|
||||
"queryType": "instant",
|
||||
"relativeTimeRange": {"from": 600, "to": 0},
|
||||
"datasourceUid": "prometheus",
|
||||
"model": {"expr": "avg(cpu_usage_percent) > 80", "intervalMs": 1000}
|
||||
}
|
||||
]
|
||||
|
||||
**With variables**: "Alert with dynamic threshold"
|
||||
→ [
|
||||
{
|
||||
"refId": "A",
|
||||
"relativeTimeRange": {"from": 600, "to": 0},
|
||||
"datasourceUid": "{{PROMETHEUS_UID}}",
|
||||
"model": {"expr": <agent1.prometheus_query>, "intervalMs": 1000}
|
||||
}
|
||||
]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the alert query data...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'forDuration',
|
||||
|
||||
@@ -126,6 +126,13 @@ export const HubSpotBlock: BlockConfig<HubSpotResponse> = {
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.name>\`, \`<function1.result.email>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_OWNER_ID}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the JSON object with HubSpot properties. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object that can be used directly in HubSpot API create/update operations.
|
||||
|
||||
@@ -312,6 +319,13 @@ Return ONLY the JSON object with properties - no explanations, no markdown, no e
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.email>\`, \`<function1.result.status>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_LIFECYCLE_STAGE}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the JSON array of filter groups. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array that can be used directly in HubSpot API search operations.
|
||||
|
||||
|
||||
@@ -160,6 +160,46 @@ export const IntercomBlock: BlockConfig = {
|
||||
field: 'operation',
|
||||
value: ['create_contact', 'update_contact'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Intercom developer. Generate custom attributes JSON for Intercom contacts.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.plan_type>\`, \`<function1.result.company>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_PLAN}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### CUSTOM ATTRIBUTES GUIDELINES
|
||||
1. **Types**: Strings, numbers, booleans, dates (as Unix timestamps)
|
||||
2. **Naming**: Use snake_case or lowercase with underscores
|
||||
3. **Limits**: String values max 255 characters
|
||||
4. **Pre-defined**: Must be created in Intercom first if strict mode is enabled
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**User attributes**: "Set plan and company info"
|
||||
→ {"plan_type": "enterprise", "company_name": "Acme Corp", "seats": 50}
|
||||
|
||||
**With variables**: "Use data from previous block"
|
||||
→ {"subscription_id": <agent1.sub_id>, "mrr": <function1.monthly_revenue>, "industry": <agent1.company_industry>}
|
||||
|
||||
**Boolean flags**: "Set feature flags"
|
||||
→ {"has_completed_onboarding": true, "beta_tester": false, "vip_customer": true}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the custom attributes...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'query',
|
||||
@@ -171,6 +211,46 @@ export const IntercomBlock: BlockConfig = {
|
||||
field: 'operation',
|
||||
value: ['search_contacts', 'search_conversations'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Intercom developer. Generate Intercom search queries.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the search query (JSON object for advanced search, or text for simple search). Do not include any explanations.
|
||||
|
||||
### INTERCOM SEARCH QUERY GUIDELINES
|
||||
1. **Simple Text**: Just enter text for basic search
|
||||
2. **Advanced**: JSON object with "query" containing filter/operator structure
|
||||
3. **Operators**: field, operator (=, !=, IN, NIN, <, >, ~, !~, ^, $), value
|
||||
4. **Combining**: Use AND/OR operators to combine conditions
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple search**: "Find contacts with example.com email"
|
||||
→ example.com
|
||||
|
||||
**By email**: "Find contact with specific email"
|
||||
→ {"query": {"field": "email", "operator": "=", "value": "user@example.com"}}
|
||||
|
||||
**Multiple conditions**: "Find VIP customers from Acme"
|
||||
→ {"query": {"operator": "AND", "value": [{"field": "custom_attributes.vip_customer", "operator": "=", "value": true}, {"field": "custom_attributes.company_name", "operator": "=", "value": "Acme"}]}}
|
||||
|
||||
**With variables**: "Search for contact by email from previous block"
|
||||
→ {"query": {"field": "email", "operator": "=", "value": <agent1.email>}}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY the query - no explanations.`,
|
||||
placeholder: 'Describe what you want to search for...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Company fields
|
||||
{
|
||||
|
||||
@@ -193,6 +193,81 @@ export const JiraBlock: BlockConfig<JiraResponse> = {
|
||||
placeholder: 'Enter new description for the issue',
|
||||
dependsOn: ['projectId'],
|
||||
condition: { field: 'operation', value: ['update', 'write'] },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing Jira issue descriptions. Create clear, well-structured descriptions.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.error>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{ENVIRONMENT}}\`)
|
||||
|
||||
### JIRA FORMATTING
|
||||
Jira uses its own wiki-style markup:
|
||||
- *bold* or **bold**
|
||||
- _italic_
|
||||
- h1. Header 1, h2. Header 2, etc.
|
||||
- * bullet points
|
||||
- # numbered lists
|
||||
- {code}code block{code}
|
||||
- [link text|URL]
|
||||
|
||||
### GUIDELINES
|
||||
1. **Structure**: Use headers and bullet points
|
||||
2. **Context**: Include background and impact
|
||||
3. **Acceptance Criteria**: Define completion criteria
|
||||
4. **Technical Details**: Include relevant technical info
|
||||
5. **Reproducibility**: For bugs, include steps to reproduce
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Bug ticket**: "Write a bug description for API timeout"
|
||||
→ h2. Description
|
||||
API requests to the user service are timing out under high load.
|
||||
|
||||
h2. Steps to Reproduce
|
||||
# Send 100+ concurrent requests to /api/users
|
||||
# Observe response times
|
||||
# Note timeout errors after ~30 seconds
|
||||
|
||||
h2. Expected Behavior
|
||||
All requests should complete within 5 seconds.
|
||||
|
||||
h2. Actual Behavior
|
||||
~20% of requests timeout with 504 errors.
|
||||
|
||||
h2. Impact
|
||||
* Affects user registration flow
|
||||
* Estimated 500 users impacted daily
|
||||
|
||||
h2. Technical Details
|
||||
* Endpoint: /api/users
|
||||
* Environment: Production
|
||||
* Load balancer logs attached
|
||||
|
||||
**With variables**: "Create ticket from alert"
|
||||
→ h2. Description
|
||||
Automated ticket from monitoring alert.
|
||||
|
||||
h2. Alert Details
|
||||
* Service: <agent1.service>
|
||||
* Error: <function1.error_message>
|
||||
* Time: <function1.timestamp>
|
||||
|
||||
h2. Actions Required
|
||||
* Investigate root cause
|
||||
* Implement fix
|
||||
* Update monitoring
|
||||
|
||||
### REMEMBER
|
||||
Use Jira wiki markup. Be thorough and structured.`,
|
||||
placeholder: 'Describe the Jira issue...',
|
||||
generationType: 'markdown-content',
|
||||
},
|
||||
},
|
||||
// Delete Issue fields
|
||||
{
|
||||
@@ -239,6 +314,77 @@ export const JiraBlock: BlockConfig<JiraResponse> = {
|
||||
required: true,
|
||||
placeholder: 'Enter JQL query (e.g., project = PROJ AND status = "In Progress")',
|
||||
condition: { field: 'operation', value: 'search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Jira administrator. Generate JQL (Jira Query Language) queries based on the user's request.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.project_key>\`, \`<function1.result.assignee>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_PROJECT}}\`)
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the JQL query. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JQL query string.
|
||||
|
||||
### JQL SYNTAX GUIDE
|
||||
|
||||
**Field Operators**:
|
||||
- **=** : Equals - \`status = "In Progress"\`
|
||||
- **!=** : Not equals - \`status != Done\`
|
||||
- **~** : Contains - \`summary ~ "bug"\`
|
||||
- **!~** : Does not contain - \`summary !~ "test"\`
|
||||
- **>**, **>=**, **<**, **<=** : Comparisons - \`created > -7d\`
|
||||
- **IN** : In list - \`status IN ("Open", "In Progress")\`
|
||||
- **NOT IN** : Not in list - \`priority NOT IN (Low, Lowest)\`
|
||||
- **IS** : Is empty/null - \`assignee IS EMPTY\`
|
||||
- **IS NOT** : Is not empty - \`resolution IS NOT EMPTY\`
|
||||
- **WAS** : Historical value - \`status WAS "Open"\`
|
||||
- **CHANGED** : Field changed - \`status CHANGED\`
|
||||
|
||||
**Logical Operators**:
|
||||
- **AND** : Both conditions - \`project = PROJ AND status = Open\`
|
||||
- **OR** : Either condition - \`priority = High OR priority = Critical\`
|
||||
- **NOT** : Negate - \`NOT status = Closed\`
|
||||
|
||||
**Common Fields**:
|
||||
- project, issuetype, status, priority, resolution
|
||||
- assignee, reporter, creator, watcher
|
||||
- created, updated, resolved, due, duedate
|
||||
- summary, description, labels, components
|
||||
- fixVersion, affectedVersion, sprint
|
||||
|
||||
**Date Functions**:
|
||||
- \`startOfDay()\`, \`endOfDay()\`
|
||||
- \`startOfWeek()\`, \`endOfWeek()\`
|
||||
- \`startOfMonth()\`, \`endOfMonth()\`
|
||||
- Relative: \`-7d\` (7 days ago), \`-2w\` (2 weeks ago)
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple query**: "Find all open bugs in project PROJ"
|
||||
→ project = PROJ AND issuetype = Bug AND status = Open
|
||||
|
||||
**With assignee**: "Find my tasks in progress"
|
||||
→ assignee = currentUser() AND status = "In Progress"
|
||||
|
||||
**Date range**: "Find issues created this week"
|
||||
→ created >= startOfWeek() AND created <= endOfWeek()
|
||||
|
||||
**Complex query**: "Find high priority unresolved issues assigned to me or unassigned"
|
||||
→ priority IN (High, Critical) AND resolution IS EMPTY AND (assignee = currentUser() OR assignee IS EMPTY)
|
||||
|
||||
**With variables**: "Search for issues in a specific project"
|
||||
→ project = <agent1.project_key> AND status != Done
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY the JQL query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the issues you want to search for...',
|
||||
generationType: 'sql-query',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'maxResults',
|
||||
|
||||
@@ -333,6 +333,73 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
|
||||
'linear_update_project',
|
||||
],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing Linear issue and project descriptions. Create clear, well-structured descriptions using markdown.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.error_message>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{REPO_URL}}\`)
|
||||
|
||||
### GUIDELINES
|
||||
1. **Structure**: Use headers, bullet points, and sections
|
||||
2. **Context**: Include relevant background information
|
||||
3. **Acceptance Criteria**: For issues, define what "done" looks like
|
||||
4. **Technical Details**: Include relevant technical information
|
||||
5. **Links**: Reference related issues, PRs, or documentation
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Bug report**: "Create a bug report for login issues"
|
||||
→ ## Description
|
||||
Users are experiencing intermittent login failures when using SSO authentication.
|
||||
|
||||
## Steps to Reproduce
|
||||
1. Navigate to login page
|
||||
2. Click "Sign in with SSO"
|
||||
3. Complete authentication
|
||||
4. Observe error message
|
||||
|
||||
## Expected Behavior
|
||||
User should be logged in and redirected to dashboard.
|
||||
|
||||
## Actual Behavior
|
||||
Error message "Authentication failed" appears approximately 30% of the time.
|
||||
|
||||
## Technical Details
|
||||
- Browser: Chrome 120+
|
||||
- Environment: Production
|
||||
- Error code: AUTH_SSO_TIMEOUT
|
||||
|
||||
**With variables**: "Create issue from error"
|
||||
→ ## Description
|
||||
Automated issue created from error detection.
|
||||
|
||||
## Error Details
|
||||
- Message: <agent1.error_message>
|
||||
- Timestamp: <function1.timestamp>
|
||||
- Service: <function1.service_name>
|
||||
|
||||
## Stack Trace
|
||||
\`\`\`
|
||||
<agent1.stack_trace>
|
||||
\`\`\`
|
||||
|
||||
## Next Steps
|
||||
- [ ] Investigate root cause
|
||||
- [ ] Implement fix
|
||||
- [ ] Add monitoring
|
||||
|
||||
### REMEMBER
|
||||
Use markdown formatting. Be thorough but concise.`,
|
||||
placeholder: 'Describe the issue or project...',
|
||||
generationType: 'markdown-content',
|
||||
},
|
||||
},
|
||||
// Comment body
|
||||
{
|
||||
|
||||
@@ -49,6 +49,79 @@ export const LinkedInBlock: BlockConfig<LinkedInResponse> = {
|
||||
value: 'share_post',
|
||||
},
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert LinkedIn content creator. Write engaging, professional posts optimized for LinkedIn.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.topic>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{COMPANY_NAME}}\`)
|
||||
|
||||
### LINKEDIN BEST PRACTICES
|
||||
1. **Hook**: Start with an attention-grabbing first line
|
||||
2. **Formatting**: Use line breaks for readability
|
||||
3. **Length**: 1,300 characters max, but 150-300 often performs best
|
||||
4. **Hashtags**: Use 3-5 relevant hashtags at the end
|
||||
5. **CTA**: Include a call-to-action or question
|
||||
6. **Emojis**: Use sparingly for visual interest
|
||||
|
||||
### GUIDELINES
|
||||
- Write in first person for authenticity
|
||||
- Share insights, not just promotions
|
||||
- Ask questions to drive engagement
|
||||
- Use numbers and data when relevant
|
||||
- Break up text with white space
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Thought leadership**: "Write a post about AI in business"
|
||||
→ AI isn't replacing jobs.
|
||||
|
||||
It's replacing tasks.
|
||||
|
||||
The professionals who thrive in 2024 will be those who:
|
||||
|
||||
→ Learn to work WITH AI, not against it
|
||||
→ Focus on skills AI can't replicate (creativity, empathy, leadership)
|
||||
→ Continuously adapt and upskill
|
||||
|
||||
I've seen teams 10x their productivity by embracing AI tools.
|
||||
|
||||
But here's what nobody talks about: the human skills matter MORE now, not less.
|
||||
|
||||
What's your take? Is your company embracing AI or resisting it?
|
||||
|
||||
#AI #FutureOfWork #Leadership #Technology #Innovation
|
||||
|
||||
**With variables**: "Announce a product launch"
|
||||
→ Exciting news! 🚀
|
||||
|
||||
We just launched <agent1.product_name> - and I couldn't be more proud of our team.
|
||||
|
||||
What makes it special:
|
||||
|
||||
✅ <agent1.feature_1>
|
||||
✅ <agent1.feature_2>
|
||||
✅ <agent1.feature_3>
|
||||
|
||||
This has been months in the making, and seeing it live is incredible.
|
||||
|
||||
Check it out: <function1.product_url>
|
||||
|
||||
What features would you like to see next? 👇
|
||||
|
||||
#ProductLaunch #{{COMPANY_NAME}} #Innovation
|
||||
|
||||
### REMEMBER
|
||||
Write professional but personable content. Use line breaks and keep it scannable.`,
|
||||
placeholder: 'Describe the LinkedIn post you want to create...',
|
||||
generationType: 'social-post',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'visibility',
|
||||
|
||||
@@ -395,6 +395,45 @@ export const MailchimpBlock: BlockConfig = {
|
||||
field: 'operation',
|
||||
value: ['add_member', 'add_or_update_member', 'update_member'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Mailchimp developer. Generate merge fields JSON for Mailchimp members.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.first_name>\`, \`<function1.result.phone>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_SOURCE}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### MERGE FIELDS GUIDELINES
|
||||
1. **Standard Fields**: FNAME, LNAME, PHONE, ADDRESS, BIRTHDAY
|
||||
2. **Custom Fields**: Use your audience's custom merge field tags
|
||||
3. **Format**: Key is merge tag (uppercase), value is the data
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Basic info**: "Add first name and last name"
|
||||
→ {"FNAME": "John", "LNAME": "Doe"}
|
||||
|
||||
**With address**: "Add full contact details"
|
||||
→ {"FNAME": "John", "LNAME": "Doe", "PHONE": "555-1234", "ADDRESS": {"addr1": "123 Main St", "city": "Boston", "state": "MA", "zip": "02101"}}
|
||||
|
||||
**With variables**: "Use data from previous block"
|
||||
→ {"FNAME": <agent1.first_name>, "LNAME": <agent1.last_name>, "EMAIL": <agent1.email>}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the merge fields you want to set...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'interests',
|
||||
@@ -419,6 +458,42 @@ export const MailchimpBlock: BlockConfig = {
|
||||
field: 'operation',
|
||||
value: ['add_member_tags', 'remove_member_tags'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Mailchimp developer. Generate tags JSON for Mailchimp members.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of tag objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### TAGS GUIDELINES
|
||||
1. **Format**: Array of objects with "name" and "status" fields
|
||||
2. **Status**: "active" to add tag, "inactive" to remove tag
|
||||
3. **Name**: The tag name string
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Add tags**: "Add VIP and Newsletter tags"
|
||||
→ [{"name": "VIP", "status": "active"}, {"name": "Newsletter", "status": "active"}]
|
||||
|
||||
**Remove tags**: "Remove Inactive tag"
|
||||
→ [{"name": "Inactive", "status": "inactive"}]
|
||||
|
||||
**With variables**: "Add tag from previous block"
|
||||
→ [{"name": <agent1.tag_name>, "status": "active"}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the tags you want to add or remove...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
// Campaign fields
|
||||
{
|
||||
@@ -901,6 +976,50 @@ export const MailchimpBlock: BlockConfig = {
|
||||
field: 'operation',
|
||||
value: ['create_batch_operation'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Mailchimp developer. Generate batch operations JSON for Mailchimp API.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.email>\`, \`<function1.result.list_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{LIST_ID}}\`)
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of operation objects. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### BATCH OPERATION STRUCTURE
|
||||
Each operation object should have:
|
||||
- **method**: HTTP method (GET, POST, PUT, PATCH, DELETE)
|
||||
- **path**: API endpoint path (e.g., /lists/{list_id}/members)
|
||||
- **operation_id**: Unique identifier for the operation (optional)
|
||||
- **params**: Query parameters (optional)
|
||||
- **body**: Request body as JSON string (for POST/PUT/PATCH)
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Add multiple members**: "Add 3 members to a list"
|
||||
→ [
|
||||
{"method": "POST", "path": "/lists/abc123/members", "body": "{\\"email_address\\":\\"john@example.com\\",\\"status\\":\\"subscribed\\"}"},
|
||||
{"method": "POST", "path": "/lists/abc123/members", "body": "{\\"email_address\\":\\"jane@example.com\\",\\"status\\":\\"subscribed\\"}"},
|
||||
{"method": "POST", "path": "/lists/abc123/members", "body": "{\\"email_address\\":\\"bob@example.com\\",\\"status\\":\\"subscribed\\"}"}
|
||||
]
|
||||
|
||||
**Update multiple members**: "Update member statuses"
|
||||
→ [
|
||||
{"method": "PATCH", "path": "/lists/abc123/members/hash1", "body": "{\\"status\\":\\"unsubscribed\\"}"},
|
||||
{"method": "PATCH", "path": "/lists/abc123/members/hash2", "body": "{\\"status\\":\\"unsubscribed\\"}"}
|
||||
]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the batch operations you want to perform...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
// Pagination and filtering
|
||||
{
|
||||
|
||||
@@ -44,6 +44,51 @@ export const Mem0Block: BlockConfig<Mem0Response> = {
|
||||
value: 'add',
|
||||
},
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at creating Mem0 memory messages. Generate a JSON array of message objects for storing memories.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.content>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{USER_NAME}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of message objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### MESSAGE STRUCTURE
|
||||
Each message must have:
|
||||
- **role**: Either "user" or "assistant"
|
||||
- **content**: The message text/content
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single user memory**: "Remember that the user's favorite color is blue"
|
||||
→ [{"role": "user", "content": "My favorite color is blue"}]
|
||||
|
||||
**With variables**: "Store the conversation from previous agent"
|
||||
→ [
|
||||
{"role": "user", "content": <agent1.user_message>},
|
||||
{"role": "assistant", "content": <agent1.response>}
|
||||
]
|
||||
|
||||
**Multiple facts**: "Remember user likes coffee and works remotely"
|
||||
→ [
|
||||
{"role": "user", "content": "I love drinking coffee every morning"},
|
||||
{"role": "user", "content": "I work remotely from home"}
|
||||
]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array of message objects - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the memories you want to store...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'query',
|
||||
|
||||
@@ -95,6 +95,45 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
|
||||
'Enter values as JSON array of arrays (e.g., [["A1", "B1"], ["A2", "B2"]]) or an array of objects (e.g., [{"name":"John", "age":30}, {"name":"Jane", "age":25}])',
|
||||
condition: { field: 'operation', value: 'write' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at Microsoft Excel data formatting. Generate JSON data for writing to Excel.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.data>\`, \`<function1.result.rows>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### DATA FORMATS
|
||||
|
||||
**Array of Arrays** (Row-based):
|
||||
[["Header1", "Header2"], ["Value1", "Value2"]]
|
||||
|
||||
**Array of Objects** (Column-mapped):
|
||||
[{"name": "John", "age": 30}, {"name": "Jane", "age": 25}]
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple write**: "Write headers and data rows"
|
||||
→ [["Name", "Email", "Age"], ["John Doe", "john@example.com", 30], ["Jane Smith", "jane@example.com", 25]]
|
||||
|
||||
**With variables**: "Write data from previous block"
|
||||
→ [["Name", "Status"], [<agent1.name>, <agent1.status>]]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the data you want to write...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'valueInputOption',
|
||||
@@ -114,6 +153,33 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
|
||||
'Enter values as JSON array of arrays (e.g., [["A1", "B1"], ["A2", "B2"]]) or an array of objects (e.g., [{"name":"John", "age":30}, {"name":"Jane", "age":25}])',
|
||||
condition: { field: 'operation', value: 'update' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at Microsoft Excel data formatting. Generate JSON data for updating Excel.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### EXAMPLES
|
||||
**Update cells**: "Update with new values"
|
||||
→ [["Updated Name", "Updated Email"], ["John Doe", "john.new@example.com"]]
|
||||
|
||||
**With variables**: "Update with data from previous block"
|
||||
→ [[<agent1.name>, <agent1.email>]]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the data you want to update...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'valueInputOption',
|
||||
@@ -133,6 +199,33 @@ export const MicrosoftExcelBlock: BlockConfig<MicrosoftExcelResponse> = {
|
||||
'Enter values as JSON array of arrays (e.g., [["A1", "B1"], ["A2", "B2"]]) or an array of objects (e.g., [{"name":"John", "age":30}, {"name":"Jane", "age":25}])',
|
||||
condition: { field: 'operation', value: 'table_add' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at Microsoft Excel data formatting. Generate JSON data for adding rows to an Excel table.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### EXAMPLES
|
||||
**Add rows**: "Add new data rows to the table"
|
||||
→ [["John Doe", "john@example.com", "Active"], ["Jane Smith", "jane@example.com", "Active"]]
|
||||
|
||||
**With variables**: "Add data from previous block"
|
||||
→ [[<agent1.name>, <agent1.email>, <agent1.status>]]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the data you want to add...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
],
|
||||
tools: {
|
||||
|
||||
@@ -245,6 +245,44 @@ export const MicrosoftPlannerBlock: BlockConfig<MicrosoftPlannerResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'Enter checklist as JSON object (optional)',
|
||||
condition: { field: 'operation', value: ['update_task_details'] },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Microsoft Planner developer. Generate checklist JSON for Planner task details.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.item_title>\`, \`<function1.result.status>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### CHECKLIST FORMAT
|
||||
Microsoft Planner checklists use a specific JSON format where each item has a unique key (typically a GUID):
|
||||
{
|
||||
"item-id-1": {"@odata.type": "#microsoft.graph.plannerChecklistItem", "title": "Item 1", "isChecked": false},
|
||||
"item-id-2": {"@odata.type": "#microsoft.graph.plannerChecklistItem", "title": "Item 2", "isChecked": true}
|
||||
}
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple checklist**: "Add two items - Review code and Write tests"
|
||||
→ {"item1": {"@odata.type": "#microsoft.graph.plannerChecklistItem", "title": "Review code", "isChecked": false}, "item2": {"@odata.type": "#microsoft.graph.plannerChecklistItem", "title": "Write tests", "isChecked": false}}
|
||||
|
||||
**With variables**: "Add items from previous block"
|
||||
→ {"item1": {"@odata.type": "#microsoft.graph.plannerChecklistItem", "title": <agent1.task_item>, "isChecked": false}}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations.`,
|
||||
placeholder: 'Describe the checklist items...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
|
||||
// References for task details
|
||||
@@ -254,6 +292,41 @@ export const MicrosoftPlannerBlock: BlockConfig<MicrosoftPlannerResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'Enter references as JSON object (optional)',
|
||||
condition: { field: 'operation', value: ['update_task_details'] },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Microsoft Planner developer. Generate references JSON for Planner task details.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.url>\`, \`<function1.result.link>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DOCS_BASE_URL}}\`)
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### REFERENCES FORMAT
|
||||
Microsoft Planner references use URL-encoded keys pointing to the reference URL:
|
||||
{
|
||||
"https%3A//example%2Ecom/doc": {"@odata.type": "#microsoft.graph.plannerExternalReference", "alias": "Doc Name", "type": "Other"},
|
||||
"https%3A//github%2Ecom/repo": {"@odata.type": "#microsoft.graph.plannerExternalReference", "alias": "GitHub Repo", "type": "Other"}
|
||||
}
|
||||
|
||||
Note: The key must be URL-encoded (: becomes %3A, . becomes %2E, / becomes %2F)
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Add document link**: "Link to documentation"
|
||||
→ {"https%3A%2F%2Fdocs%2Eexample%2Ecom%2Fguide": {"@odata.type": "#microsoft.graph.plannerExternalReference", "alias": "User Guide", "type": "Other"}}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON with URL-encoded keys - no explanations.`,
|
||||
placeholder: 'Describe the references to add...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
|
||||
// Preview Type
|
||||
|
||||
@@ -216,6 +216,62 @@ export const MicrosoftTeamsBlock: BlockConfig<MicrosoftTeamsResponse> = {
|
||||
],
|
||||
},
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing Microsoft Teams messages. Compose professional, clear messages for workplace communication.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.update>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{TEAM_NAME}}\`)
|
||||
|
||||
### GUIDELINES
|
||||
1. **Tone**: Professional workplace communication
|
||||
2. **Structure**: Use clear paragraphs and bullet points
|
||||
3. **Mentions**: Use @mentions when needed to notify team members
|
||||
4. **Brevity**: Be concise but informative
|
||||
5. **Action Items**: Clearly state any required actions
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Team update**: "Share project status update"
|
||||
→ 📊 Project Status Update
|
||||
|
||||
Hi team,
|
||||
|
||||
Here's our weekly progress update:
|
||||
|
||||
✅ Completed:
|
||||
• Feature A development
|
||||
• Code review for PR #123
|
||||
|
||||
🔄 In Progress:
|
||||
• Testing phase
|
||||
• Documentation updates
|
||||
|
||||
📅 Next Steps:
|
||||
• Release scheduled for Friday
|
||||
|
||||
Let me know if you have questions!
|
||||
|
||||
**With variables**: "Share automated alert"
|
||||
→ ⚠️ System Alert
|
||||
|
||||
Service: <agent1.service_name>
|
||||
Status: <function1.status>
|
||||
Time: <function1.timestamp>
|
||||
|
||||
Please review and take action if needed.
|
||||
|
||||
### REMEMBER
|
||||
Write professional workplace messages. Be clear and actionable.`,
|
||||
placeholder: 'Describe the Teams message you want to send...',
|
||||
generationType: 'message-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'reactionType',
|
||||
|
||||
@@ -101,6 +101,13 @@ export const MongoDBBlock: BlockConfig<MongoDBResponse> = {
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`, \`<function1.result.status>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the MongoDB query filter as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object that can be used directly in a MongoDB find() operation.
|
||||
|
||||
@@ -224,6 +231,13 @@ Return ONLY the MongoDB query filter as valid JSON - no explanations, no markdow
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.status>\`, \`<function1.result.limit>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_LIMIT}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the aggregation pipeline as a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
@@ -464,10 +478,13 @@ Return ONLY the JSON array pipeline - no explanations, no markdown, no extra tex
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
|
||||
### EXAMPLES
|
||||
Newest first: {"createdAt": -1}
|
||||
Alphabetical: {"name": 1}
|
||||
Multiple fields: {"category": 1, "price": -1}
|
||||
Dynamic field: {<agent1.sort_field>: <agent1.sort_order>}
|
||||
|
||||
Use 1 for ascending, -1 for descending. Return ONLY valid JSON.`,
|
||||
placeholder: 'Describe how you want to sort the results...',
|
||||
@@ -489,9 +506,13 @@ Use 1 for ascending, -1 for descending. Return ONLY valid JSON.`,
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### EXAMPLES
|
||||
Simple user: [{"name": "John Doe", "email": "john@example.com", "active": true}]
|
||||
With nested data: [{"user": {"name": "Jane", "profile": {"age": 25, "city": "NYC"}}, "status": "active"}]
|
||||
With variables: [{"name": <agent1.name>, "email": <agent1.email>, "source": "{{DATA_SOURCE}}"}]
|
||||
Multiple docs: [{"name": "User1", "type": "admin"}, {"name": "User2", "type": "user"}]
|
||||
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
@@ -514,6 +535,11 @@ Return ONLY valid JSON array - no explanations.`,
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the MongoDB query filter as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object that will identify which documents to update.
|
||||
|
||||
@@ -705,6 +731,11 @@ Generate the MongoDB update operation that safely and accurately fulfills the us
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the MongoDB query filter as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object that will identify which documents to delete.
|
||||
|
||||
|
||||
@@ -256,6 +256,47 @@ Return ONLY the SQL query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: '{\n "name": "John Doe",\n "email": "john@example.com",\n "active": true\n}',
|
||||
condition: { field: 'operation', value: 'insert' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert MySQL developer. Generate JSON data for INSERT operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.content>\`, \`<function1.result.id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{API_KEY}}\`, \`{{DATABASE_NAME}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes - they will be resolved before execution.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the data as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### DATA GUIDELINES
|
||||
1. **Structure**: Use field-value pairs matching your table columns
|
||||
2. **Data Types**: Use appropriate types (strings, numbers, booleans, null)
|
||||
3. **Naming**: Use column names exactly as they appear in your table
|
||||
4. **Required Fields**: Include all required (NOT NULL) columns
|
||||
5. **MySQL Types**: Use 1/0 or true/false for booleans, ISO date strings for dates
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple insert**: "Insert user with name, email, and active status"
|
||||
→ {"name": "John Doe", "email": "john@example.com", "active": true}
|
||||
|
||||
**With variables**: "Insert user data from previous agent block"
|
||||
→ {"name": <agent1.name>, "email": <agent1.email>, "created_by": "{{SYSTEM_USER}}"}
|
||||
|
||||
**With dates**: "Insert order with customer_id, total, and order_date"
|
||||
→ {"customer_id": 123, "total": 99.99, "order_date": "2024-01-15"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the data you want to insert...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Set clause for updates
|
||||
{
|
||||
@@ -265,6 +306,46 @@ Return ONLY the SQL query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: '{\n "name": "Jane Doe",\n "email": "jane@example.com"\n}',
|
||||
condition: { field: 'operation', value: 'update' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert MySQL developer. Generate JSON data for UPDATE operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.content>\`, \`<function1.result.id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{API_KEY}}\`, \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes - they will be resolved before execution.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the data as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object containing only the fields to update.
|
||||
|
||||
### DATA GUIDELINES
|
||||
1. **Structure**: Include only the fields you want to update
|
||||
2. **Data Types**: Use appropriate types (strings, numbers, booleans, null)
|
||||
3. **Naming**: Use column names exactly as they appear in your table
|
||||
4. **Partial Updates**: You don't need to include all columns, only those being changed
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Update single field**: "Update user's email"
|
||||
→ {"email": "newemail@example.com"}
|
||||
|
||||
**With variables**: "Update user with data from previous block"
|
||||
→ {"email": <agent1.new_email>, "updated_at": <function1.timestamp>}
|
||||
|
||||
**Set to null**: "Clear the user's phone number"
|
||||
→ {"phone": null}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the fields you want to update...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Where clause for update/delete
|
||||
{
|
||||
|
||||
@@ -92,6 +92,13 @@ export const Neo4jBlock: BlockConfig<Neo4jResponse> = {
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`, \`<function1.result.name>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_LIMIT}}\`)
|
||||
|
||||
Use parameters ($paramName) for values in Cypher queries and define them in the Parameters field.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the Cypher query. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw Cypher query.
|
||||
|
||||
|
||||
@@ -103,6 +103,73 @@ export const NotionBlock: BlockConfig<NotionResponse> = {
|
||||
value: 'notion_write',
|
||||
},
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing Notion content. Create well-structured, readable content using markdown.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.data>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{TEAM_NAME}}\`)
|
||||
|
||||
### NOTION FORMATTING
|
||||
Notion supports markdown:
|
||||
- **bold** and *italic*
|
||||
- # ## ### headers
|
||||
- - bullet lists
|
||||
- 1. numbered lists
|
||||
- - [ ] todo items
|
||||
- > callouts/quotes
|
||||
- \`code\` and \`\`\`code blocks\`\`\`
|
||||
- [links](url)
|
||||
- --- dividers
|
||||
|
||||
### GUIDELINES
|
||||
1. **Structure**: Use headers to organize content
|
||||
2. **Scannable**: Use bullet points and short paragraphs
|
||||
3. **Visual**: Use callouts and dividers for emphasis
|
||||
4. **Actionable**: Include todo items where relevant
|
||||
5. **Links**: Reference related pages or resources
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Meeting notes**: "Write meeting notes template"
|
||||
→ # Meeting Notes
|
||||
|
||||
## Date
|
||||
<function1.date>
|
||||
|
||||
## Attendees
|
||||
- <agent1.attendees>
|
||||
|
||||
## Agenda
|
||||
1. Review previous action items
|
||||
2. Project updates
|
||||
3. New business
|
||||
|
||||
## Discussion Points
|
||||
- Point 1
|
||||
- Point 2
|
||||
|
||||
## Action Items
|
||||
- [ ] Action 1 - @owner
|
||||
- [ ] Action 2 - @owner
|
||||
|
||||
## Next Steps
|
||||
Schedule follow-up for next week.
|
||||
|
||||
---
|
||||
*Notes taken by {{USER_NAME}}*
|
||||
|
||||
### REMEMBER
|
||||
Use markdown formatting. Create scannable, well-organized content.`,
|
||||
placeholder: 'Describe the content you want to write...',
|
||||
generationType: 'markdown-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'content',
|
||||
@@ -114,6 +181,38 @@ export const NotionBlock: BlockConfig<NotionResponse> = {
|
||||
value: 'notion_create_page',
|
||||
},
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing Notion page content. Create well-structured, readable content using markdown.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
### NOTION FORMATTING
|
||||
- **bold** and *italic*
|
||||
- # ## ### headers
|
||||
- - bullet lists and 1. numbered lists
|
||||
- - [ ] todo items
|
||||
- > callouts/quotes
|
||||
- \`code\` and \`\`\`code blocks\`\`\`
|
||||
|
||||
### GUIDELINES
|
||||
1. Use headers to organize content
|
||||
2. Keep paragraphs short and scannable
|
||||
3. Use bullet points for lists
|
||||
4. Include action items where relevant
|
||||
|
||||
### REMEMBER
|
||||
Use markdown. Create well-organized, readable content.`,
|
||||
placeholder: 'Describe the page content...',
|
||||
generationType: 'markdown-content',
|
||||
},
|
||||
},
|
||||
// Query Database Fields
|
||||
{
|
||||
@@ -131,6 +230,55 @@ export const NotionBlock: BlockConfig<NotionResponse> = {
|
||||
placeholder: 'Enter filter conditions as JSON (optional)',
|
||||
condition: { field: 'operation', value: 'notion_query_database' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Notion API developer. Generate Notion database filter JSON based on the user's request.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.status>\`, \`<function1.result.date>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON filter. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### NOTION FILTER SYNTAX
|
||||
Filters use property-based conditions with operators:
|
||||
- **equals, does_not_equal**: Exact match
|
||||
- **contains, does_not_contain**: Text contains
|
||||
- **starts_with, ends_with**: Text patterns
|
||||
- **is_empty, is_not_empty**: Existence check
|
||||
- **greater_than, less_than, etc.**: Comparisons for numbers/dates
|
||||
|
||||
Compound filters use:
|
||||
- **and**: Array of conditions (all must match)
|
||||
- **or**: Array of conditions (any must match)
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple filter**: "Filter where Status is Done"
|
||||
→ {"property": "Status", "status": {"equals": "Done"}}
|
||||
|
||||
**With variables**: "Filter by status from previous block"
|
||||
→ {"property": "Status", "status": {"equals": <agent1.selected_status>}}
|
||||
|
||||
**AND conditions**: "Status is Active and Priority is High"
|
||||
→ {"and": [
|
||||
{"property": "Status", "status": {"equals": "Active"}},
|
||||
{"property": "Priority", "select": {"equals": "High"}}
|
||||
]}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the filter conditions...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'sorts',
|
||||
@@ -138,6 +286,49 @@ export const NotionBlock: BlockConfig<NotionResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'Enter sort criteria as JSON array (optional)',
|
||||
condition: { field: 'operation', value: 'notion_query_database' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Notion API developer. Generate Notion database sort criteria JSON array.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.sort_field>\`, \`<function1.result.direction>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_SORT_FIELD}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of sort objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### SORT STRUCTURE
|
||||
Each sort object has:
|
||||
- **property**: Property name to sort by
|
||||
- **direction**: "ascending" or "descending"
|
||||
|
||||
Or for timestamp sorts:
|
||||
- **timestamp**: "created_time" or "last_edited_time"
|
||||
- **direction**: "ascending" or "descending"
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Sort by property**: "Sort by Name ascending"
|
||||
→ [{"property": "Name", "direction": "ascending"}]
|
||||
|
||||
**With variables**: "Sort by field from previous block"
|
||||
→ [{"property": <agent1.sort_field>, "direction": <agent1.sort_direction>}]
|
||||
|
||||
**Sort by date**: "Sort by created time, newest first"
|
||||
→ [{"timestamp": "created_time", "direction": "descending"}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe how you want to sort...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'pageSize',
|
||||
@@ -188,6 +379,63 @@ export const NotionBlock: BlockConfig<NotionResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'Enter database properties as JSON object',
|
||||
condition: { field: 'operation', value: 'notion_create_database' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Notion API developer. Generate Notion database properties schema JSON.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.property_name>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS_OPTIONS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON properties object. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### PROPERTY TYPES
|
||||
Common Notion property types:
|
||||
- **title**: Primary name field
|
||||
- **rich_text**: Multi-line text
|
||||
- **number**: Numeric value
|
||||
- **select**: Single select dropdown
|
||||
- **multi_select**: Multiple select tags
|
||||
- **date**: Date/datetime
|
||||
- **checkbox**: Boolean checkbox
|
||||
- **url**: URL link
|
||||
- **email**: Email address
|
||||
- **phone_number**: Phone number
|
||||
- **status**: Status field with groups
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Basic task database**: "Create properties for a task tracker"
|
||||
→ {
|
||||
"Name": {"title": {}},
|
||||
"Status": {"status": {}},
|
||||
"Due Date": {"date": {}},
|
||||
"Priority": {"select": {"options": [{"name": "High"}, {"name": "Medium"}, {"name": "Low"}]}},
|
||||
"Completed": {"checkbox": {}}
|
||||
}
|
||||
|
||||
**Contact database**: "Create properties for contacts"
|
||||
→ {
|
||||
"Name": {"title": {}},
|
||||
"Email": {"email": {}},
|
||||
"Phone": {"phone_number": {}},
|
||||
"Company": {"rich_text": {}},
|
||||
"Website": {"url": {}}
|
||||
}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the database properties...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
],
|
||||
tools: {
|
||||
|
||||
@@ -92,10 +92,38 @@ export const OneDriveBlock: BlockConfig<OneDriveResponse> = {
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
prompt:
|
||||
'Generate a JSON array of arrays that can be written directly into an Excel worksheet.',
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at Excel data formatting. Generate JSON data for creating an Excel file in OneDrive.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.data>\`, \`<function1.result.rows>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of arrays. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### DATA FORMAT
|
||||
Use array of arrays format where each inner array represents a row:
|
||||
[["Header1", "Header2"], ["Value1", "Value2"], ["Value3", "Value4"]]
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple table**: "Create a table with names and emails"
|
||||
→ [["Name", "Email"], ["John Doe", "john@example.com"], ["Jane Smith", "jane@example.com"]]
|
||||
|
||||
**With variables**: "Create table from previous block data"
|
||||
→ [["Name", "Status"], [<agent1.name>, <agent1.status>]]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array of arrays - no explanations.`,
|
||||
placeholder: 'Describe the table you want to generate...',
|
||||
generationType: 'json-object',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
required: false,
|
||||
},
|
||||
|
||||
@@ -94,6 +94,53 @@ export const OutlookBlock: BlockConfig<OutlookResponse> = {
|
||||
placeholder: 'Email content',
|
||||
condition: { field: 'operation', value: ['send_outlook', 'draft_outlook'] },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert email writer. Compose professional, clear, and effective email content.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.customer_name>\`, \`<function1.result.details>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{COMPANY_NAME}}\`)
|
||||
|
||||
### GUIDELINES
|
||||
1. **Tone**: Match the appropriate tone (formal, friendly, urgent) based on context
|
||||
2. **Structure**: Use clear paragraphs, bullet points where helpful
|
||||
3. **Brevity**: Be concise but complete
|
||||
4. **Call to Action**: Include clear next steps when appropriate
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Meeting request**: "Request a meeting to discuss Q4 planning"
|
||||
→ Hi,
|
||||
|
||||
I'd like to schedule a meeting to discuss our Q4 planning and goals.
|
||||
|
||||
Would you be available this week for a 30-minute call? I'm flexible on timing and can adjust to your schedule.
|
||||
|
||||
Please let me know what works best for you.
|
||||
|
||||
Thanks
|
||||
|
||||
**With variables**: "Follow up on support ticket"
|
||||
→ Dear <agent1.customer_name>,
|
||||
|
||||
Thank you for contacting us regarding ticket #<function1.ticket_id>.
|
||||
|
||||
Our team has reviewed your request and we're working on a resolution. You can expect an update within 24 hours.
|
||||
|
||||
Best regards,
|
||||
{{COMPANY_NAME}} Support
|
||||
|
||||
### REMEMBER
|
||||
Write the email body only - no subject line unless specifically requested.`,
|
||||
placeholder: 'Describe the email you want to write...',
|
||||
generationType: 'email-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
|
||||
@@ -124,6 +124,51 @@ export const PineconeBlock: BlockConfig<PineconeResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: '{"category": "product"}',
|
||||
condition: { field: 'operation', value: 'search_text' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Pinecone developer. Generate Pinecone metadata filter JSON based on the user's request.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.category>\`, \`<function1.result.status>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_CATEGORY}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON filter. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### PINECONE FILTER SYNTAX
|
||||
Pinecone uses metadata filters with these operators:
|
||||
- **$eq**: Equals
|
||||
- **$ne**: Not equals
|
||||
- **$gt**: Greater than
|
||||
- **$gte**: Greater than or equal
|
||||
- **$lt**: Less than
|
||||
- **$lte**: Less than or equal
|
||||
- **$in**: In array
|
||||
- **$nin**: Not in array
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple equality**: "Filter by category product"
|
||||
→ {"category": "product"}
|
||||
|
||||
**With variables**: "Filter by category from previous block"
|
||||
→ {"category": <agent1.selected_category>, "user_id": "{{USER_ID}}"}
|
||||
|
||||
**Comparison**: "Filter records with price greater than 100"
|
||||
→ {"price": {"$gt": 100}}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the filter conditions...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'rerank',
|
||||
@@ -131,6 +176,42 @@ export const PineconeBlock: BlockConfig<PineconeResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: '{"model": "bge-reranker-v2-m3", "rank_fields": ["text"], "top_n": 2}',
|
||||
condition: { field: 'operation', value: 'search_text' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Pinecone developer. Generate Pinecone rerank configuration JSON based on the user's request.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.top_n>\`, \`<function1.result.fields>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{RERANK_MODEL}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON rerank options. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### RERANK OPTIONS STRUCTURE
|
||||
- **model**: Reranker model (e.g., "bge-reranker-v2-m3")
|
||||
- **rank_fields**: Array of field names to use for reranking
|
||||
- **top_n**: Number of top results to return after reranking
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Basic rerank**: "Rerank top 5 results using text field"
|
||||
→ {"model": "bge-reranker-v2-m3", "rank_fields": ["text"], "top_n": 5}
|
||||
|
||||
**With variables**: "Use dynamic top_n from previous block"
|
||||
→ {"model": "bge-reranker-v2-m3", "rank_fields": ["text"], "top_n": <agent1.result_count>}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the reranking options...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Fetch fields
|
||||
{
|
||||
|
||||
@@ -115,6 +115,13 @@ export const PostgreSQLBlock: BlockConfig<PostgresResponse> = {
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`, \`<function1.result.name>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{TABLE_PREFIX}}\`)
|
||||
|
||||
Variables will be resolved before query execution. For safety, prefer using parameterized values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the SQL query. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw SQL query.
|
||||
|
||||
@@ -190,6 +197,13 @@ Return ONLY the SQL query - no explanations, no markdown, no extra text.`,
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`, \`<function1.result.name>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{TABLE_PREFIX}}\`)
|
||||
|
||||
Variables will be resolved before query execution. For safety, prefer using parameterized values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the SQL query. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw SQL query.
|
||||
|
||||
@@ -258,6 +272,47 @@ Return ONLY the SQL query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: '{\n "name": "John Doe",\n "email": "john@example.com",\n "active": true\n}',
|
||||
condition: { field: 'operation', value: 'insert' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert PostgreSQL developer. Generate JSON data for INSERT operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.name>\`, \`<function1.result.email>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the data as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### DATA GUIDELINES
|
||||
1. **Structure**: Use field-value pairs matching your table columns
|
||||
2. **Data Types**: Use appropriate types (strings, numbers, booleans, null)
|
||||
3. **Naming**: Use column names exactly as they appear in your table
|
||||
4. **Required Fields**: Include all required (NOT NULL) columns
|
||||
5. **PostgreSQL**: Use true/false for booleans, ISO date strings for dates
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple insert**: "Insert user with name, email, and active status"
|
||||
→ {"name": "John Doe", "email": "john@example.com", "active": true}
|
||||
|
||||
**With variables**: "Insert user from previous block data"
|
||||
→ {"name": <agent1.name>, "email": <agent1.email>, "created_by": "{{SYSTEM_USER}}"}
|
||||
|
||||
**With dates**: "Insert order with customer_id, total, and order_date"
|
||||
→ {"customer_id": 123, "total": 99.99, "order_date": "2024-01-15"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the data you want to insert...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Set clause for updates
|
||||
{
|
||||
@@ -267,6 +322,47 @@ Return ONLY the SQL query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: '{\n "name": "Jane Doe",\n "email": "jane@example.com"\n}',
|
||||
condition: { field: 'operation', value: 'update' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert PostgreSQL developer. Generate JSON data for UPDATE operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.new_status>\`, \`<function1.result.price>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the update data as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object with only the fields you want to update.
|
||||
|
||||
### UPDATE DATA GUIDELINES
|
||||
1. **Partial Updates**: Only include fields that need to be updated
|
||||
2. **Data Types**: Use appropriate types (strings, numbers, booleans, null)
|
||||
3. **Naming**: Use column names exactly as they appear in your table
|
||||
4. **Null Values**: Use null to set fields to NULL
|
||||
5. **PostgreSQL**: Use true/false for booleans, ISO date strings for dates
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple update**: "Update name and email"
|
||||
→ {"name": "Jane Doe", "email": "jane@example.com"}
|
||||
|
||||
**With variables**: "Update fields from previous block"
|
||||
→ {"status": <agent1.new_status>, "updated_by": "{{SYSTEM_USER}}"}
|
||||
|
||||
**Single field**: "Update status to active"
|
||||
→ {"status": "active"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON with fields to update - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe what fields you want to update...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Where clause for update/delete
|
||||
{
|
||||
|
||||
@@ -212,6 +212,46 @@ export const PostHogBlock: BlockConfig<PostHogResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: '{"key": "value"}',
|
||||
condition: { field: 'operation', value: 'posthog_capture_event' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert PostHog developer. Generate event properties JSON for PostHog analytics.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`, \`<function1.result.page>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{APP_VERSION}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### PROPERTIES GUIDELINES
|
||||
1. **Event Context**: Add properties relevant to the event (page, button, action, etc.)
|
||||
2. **User Context**: Include user-related data ($set for person properties)
|
||||
3. **System Properties**: Use $ prefix for system properties ($ip, $browser, etc.)
|
||||
4. **Types**: Support strings, numbers, booleans, arrays, and nested objects
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Page view**: "Track page view with URL and referrer"
|
||||
→ {"$current_url": "https://example.com/products", "$referrer": "https://google.com", "page_title": "Products"}
|
||||
|
||||
**Button click**: "Track button click with element info"
|
||||
→ {"button_text": "Add to Cart", "product_id": "SKU-123", "price": 29.99}
|
||||
|
||||
**With variables**: "Track event with data from previous block"
|
||||
→ {"user_id": <agent1.user_id>, "action": <agent1.action>, "timestamp": <function1.timestamp>}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the event properties...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'timestamp',
|
||||
@@ -252,6 +292,43 @@ export const PostHogBlock: BlockConfig<PostHogResponse> = {
|
||||
placeholder: '[{"event": "page_view", "distinct_id": "user123", "properties": {...}}]',
|
||||
condition: { field: 'operation', value: 'posthog_batch_events' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert PostHog developer. Generate batch events JSON array for PostHog.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.events>\`, \`<function1.result.user_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### BATCH EVENT GUIDELINES
|
||||
1. **Array Format**: Must be an array of event objects
|
||||
2. **Required Fields**: Each event needs "event" and "distinct_id"
|
||||
3. **Properties**: Optional properties object for each event
|
||||
4. **Timestamp**: Optional ISO 8601 timestamp
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Multiple events**: "Send page view and button click events"
|
||||
→ [{"event": "page_view", "distinct_id": "user123", "properties": {"page": "/home"}}, {"event": "button_clicked", "distinct_id": "user123", "properties": {"button": "signup"}}]
|
||||
|
||||
**With timestamps**: "Send events with specific timestamps"
|
||||
→ [{"event": "purchase", "distinct_id": "user123", "timestamp": "2024-01-15T10:30:00Z", "properties": {"amount": 99.99}}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the batch events...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
|
||||
// Query fields
|
||||
@@ -265,6 +342,44 @@ export const PostHogBlock: BlockConfig<PostHogResponse> = {
|
||||
value: 'posthog_query',
|
||||
},
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert PostHog developer. Generate HogQL queries for PostHog analytics.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the HogQL query or JSON query object. Do not include any explanations, markdown formatting, comments, or additional text.
|
||||
|
||||
### HOGQL GUIDELINES
|
||||
1. **SQL-like**: HogQL is similar to SQL with PostHog-specific functions
|
||||
2. **Tables**: events, persons, groups, session_recordings
|
||||
3. **Event Properties**: Access via properties.$property_name
|
||||
4. **Person Properties**: Access via person.properties.$property_name
|
||||
5. **Time Functions**: now(), toDateTime(), dateDiff()
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Count events**: "Count page views in last 7 days"
|
||||
→ SELECT count() FROM events WHERE event = 'page_view' AND timestamp > now() - INTERVAL 7 DAY
|
||||
|
||||
**Group by**: "Count events by browser"
|
||||
→ SELECT properties.$browser as browser, count() as count FROM events GROUP BY browser ORDER BY count DESC LIMIT 10
|
||||
|
||||
**Person data**: "Get users by email domain"
|
||||
→ SELECT distinct_id, person.properties.email FROM events WHERE person.properties.email LIKE '%@example.com' LIMIT 100
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY the query - no explanations.`,
|
||||
placeholder: 'Describe the data you want to query...',
|
||||
generationType: 'sql-query',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'query',
|
||||
|
||||
@@ -50,6 +50,49 @@ export const QdrantBlock: BlockConfig<QdrantResponse> = {
|
||||
placeholder: '[{"id": 1, "vector": [0.1, 0.2], "payload": {"category": "a"}}]',
|
||||
condition: { field: 'operation', value: 'upsert' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Qdrant vector database developer. Generate Qdrant points JSON array for upsert operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<embedding1.vector>\`, \`<agent1.document_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{COLLECTION_PREFIX}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of point objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### POINT STRUCTURE
|
||||
Each point must have:
|
||||
- **id**: Unique identifier (string UUID or integer)
|
||||
- **vector**: Array of floats representing the embedding
|
||||
- **payload**: Optional object with metadata
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single point**: "Add a document about AI"
|
||||
→ [{"id": 1, "vector": [0.1, 0.2, 0.3], "payload": {"category": "technology", "topic": "AI"}}]
|
||||
|
||||
**With variables**: "Add point with embedding from previous block"
|
||||
→ [{"id": <agent1.doc_id>, "vector": <embedding1.vector>, "payload": {"content": <agent1.content>}}]
|
||||
|
||||
**Multiple points**: "Add two product vectors"
|
||||
→ [
|
||||
{"id": "prod-1", "vector": [0.1, 0.2, 0.3], "payload": {"name": "Widget", "price": 29.99}},
|
||||
{"id": "prod-2", "vector": [0.4, 0.5, 0.6], "payload": {"name": "Gadget", "price": 49.99}}
|
||||
]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the points you want to upsert...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
// Search fields
|
||||
{
|
||||
@@ -89,6 +132,51 @@ export const QdrantBlock: BlockConfig<QdrantResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: '{"must":[{"key":"city","match":{"value":"London"}}]}',
|
||||
condition: { field: 'operation', value: 'search' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Qdrant vector database developer. Generate Qdrant filter JSON for search operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.category>\`, \`<function1.result.city>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_REGION}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON filter. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### QDRANT FILTER SYNTAX
|
||||
Qdrant filters use clauses:
|
||||
- **must**: All conditions must match (AND)
|
||||
- **should**: At least one condition must match (OR)
|
||||
- **must_not**: None of the conditions should match (NOT)
|
||||
|
||||
Each condition has:
|
||||
- **key**: Field name in payload
|
||||
- **match**: Match condition (value, text, any, except)
|
||||
- **range**: Range condition (gt, gte, lt, lte)
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple match**: "Filter by city London"
|
||||
→ {"must": [{"key": "city", "match": {"value": "London"}}]}
|
||||
|
||||
**With variables**: "Filter by user's selected category"
|
||||
→ {"must": [{"key": "category", "match": {"value": <agent1.selected_category>}}]}
|
||||
|
||||
**Range filter**: "Filter products with price between 10 and 100"
|
||||
→ {"must": [{"key": "price", "range": {"gte": 10, "lte": 100}}]}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the filter conditions...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'search_return_data',
|
||||
|
||||
@@ -205,6 +205,43 @@ Return ONLY the SQL query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: '{\n "name": "John Doe",\n "email": "john@example.com",\n "active": true\n}',
|
||||
condition: { field: 'operation', value: 'insert' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert SQL developer. Generate JSON data for INSERT operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.name>\`, \`<function1.result.email>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the data as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### DATA GUIDELINES
|
||||
1. **Structure**: Use field-value pairs matching your table columns
|
||||
2. **Data Types**: Use appropriate types (strings, numbers, booleans, null)
|
||||
3. **Naming**: Use column names exactly as they appear in your table
|
||||
4. **Required Fields**: Include all required (NOT NULL) columns
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple insert**: "Insert user with name, email, and active status"
|
||||
→ {"name": "John Doe", "email": "john@example.com", "active": true}
|
||||
|
||||
**With variables**: "Insert user from previous block"
|
||||
→ {"name": <agent1.name>, "email": <agent1.email>, "status": "{{DEFAULT_STATUS}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the data you want to insert...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Set clause for updates
|
||||
{
|
||||
@@ -214,6 +251,43 @@ Return ONLY the SQL query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: '{\n "name": "Jane Doe",\n "email": "jane@example.com"\n}',
|
||||
condition: { field: 'operation', value: 'update' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert SQL developer. Generate JSON data for UPDATE operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.new_status>\`, \`<function1.result.price>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the update data as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object with only the fields you want to update.
|
||||
|
||||
### UPDATE DATA GUIDELINES
|
||||
1. **Partial Updates**: Only include fields that need to be updated
|
||||
2. **Data Types**: Use appropriate types (strings, numbers, booleans, null)
|
||||
3. **Naming**: Use column names exactly as they appear in your table
|
||||
4. **Null Values**: Use null to set fields to NULL
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple update**: "Update name and email"
|
||||
→ {"name": "Jane Doe", "email": "jane@example.com"}
|
||||
|
||||
**With variables**: "Update fields from previous block"
|
||||
→ {"status": <agent1.new_status>, "updated_by": "{{SYSTEM_USER}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON with fields to update - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe what fields you want to update...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Conditions for update/delete (parameterized for SQL injection prevention)
|
||||
{
|
||||
@@ -223,6 +297,50 @@ Return ONLY the SQL query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: '{\n "id": 1\n}',
|
||||
condition: { field: 'operation', value: 'update' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert SQL developer. Generate JSON conditions for UPDATE operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the conditions as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### ⚠️ UPDATE WARNING ⚠️
|
||||
Be specific with conditions to avoid updating unintended rows. Use unique identifiers when possible.
|
||||
|
||||
### CONDITIONS GUIDELINES
|
||||
1. **WHERE Clause**: Conditions are used in WHERE clause (e.g., WHERE id = 1)
|
||||
2. **Equality**: Simple key-value pairs create equality conditions
|
||||
3. **Multiple Conditions**: Multiple fields create AND conditions
|
||||
4. **Unique Identifiers**: Prefer using primary keys or unique fields
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**By ID**: "Update where id equals 1"
|
||||
→ {"id": 1}
|
||||
|
||||
**By email**: "Update where email equals user@example.com"
|
||||
→ {"email": "user@example.com"}
|
||||
|
||||
**Multiple conditions**: "Update where status is active and created_date is before 2024"
|
||||
→ {"status": "active", "created_date": "2023-12-31"}
|
||||
|
||||
**By composite key**: "Update where user_id is 123 and order_id is 456"
|
||||
→ {"user_id": 123, "order_id": 456}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the conditions for the update...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'conditions',
|
||||
@@ -231,6 +349,42 @@ Return ONLY the SQL query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: '{\n "id": 1\n}',
|
||||
condition: { field: 'operation', value: 'delete' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert SQL developer. Generate JSON conditions for DELETE operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the conditions as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### ⚠️ DELETION WARNING ⚠️
|
||||
DELETIONS ARE PERMANENT! Be extremely careful and specific with your conditions. Use unique identifiers when possible.
|
||||
|
||||
### CONDITIONS GUIDELINES
|
||||
1. **WHERE Clause**: Conditions are used in WHERE clause (e.g., WHERE id = 1)
|
||||
2. **Equality**: Simple key-value pairs create equality conditions
|
||||
3. **Multiple Conditions**: Multiple fields create AND conditions
|
||||
4. **Unique Identifiers**: ALWAYS prefer using primary keys or unique fields
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**By ID**: "Delete where id equals 1"
|
||||
→ {"id": 1}
|
||||
|
||||
**By email**: "Delete where email equals user@example.com"
|
||||
→ {"email": "user@example.com"}
|
||||
|
||||
**Multiple conditions**: "Delete where status is inactive and created_date is before 2023"
|
||||
→ {"status": "inactive", "created_date": "2022-12-31"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text. Be extremely careful with deletion conditions!`,
|
||||
placeholder: 'Describe the conditions for the delete...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
],
|
||||
tools: {
|
||||
|
||||
@@ -303,6 +303,82 @@ export const RedditBlock: BlockConfig<RedditResponse> = {
|
||||
value: 'text',
|
||||
},
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Reddit content creator. Write engaging posts using Reddit markdown formatting.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.data>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
### REDDIT MARKDOWN
|
||||
- **bold** with double asterisks
|
||||
- *italic* with asterisks
|
||||
- ~~strikethrough~~ with tildes
|
||||
- [link text](url)
|
||||
- > quotes
|
||||
- * bullet points
|
||||
- 1. numbered lists
|
||||
- \`inline code\` and code blocks
|
||||
- ^superscript with caret
|
||||
- --- horizontal rule
|
||||
|
||||
### GUIDELINES
|
||||
1. **Subreddit Rules**: Consider the subreddit's culture and rules
|
||||
2. **Formatting**: Use markdown for structure
|
||||
3. **Authenticity**: Reddit values genuine, helpful content
|
||||
4. **Context**: Provide enough background for discussion
|
||||
5. **Engagement**: Ask questions or invite discussion
|
||||
6. **TL;DR**: For long posts, include a summary at the end
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Discussion post**: "Start a discussion about productivity tools"
|
||||
→ After trying 20+ productivity tools over the past year, here's what I've learned...
|
||||
|
||||
**What worked:**
|
||||
- Time blocking apps actually helped me focus
|
||||
- Simple todo lists beat complex project management tools
|
||||
- Note-taking apps with good search are essential
|
||||
|
||||
**What didn't:**
|
||||
- Gamification features felt gimmicky
|
||||
- Apps that require too much setup
|
||||
- Anything that adds friction to capturing ideas
|
||||
|
||||
I'm curious - what tools have made the biggest difference for you? And which ones did you abandon?
|
||||
|
||||
---
|
||||
|
||||
**TL;DR**: Tried tons of productivity tools. Simple beats complex. Time blocking works. What's your go-to tool?
|
||||
|
||||
**With variables**: "Share automated report"
|
||||
→ **Weekly Stats Update**
|
||||
|
||||
Here are this week's community stats:
|
||||
|
||||
| Metric | Value |
|
||||
|--------|-------|
|
||||
| New Members | <function1.new_members> |
|
||||
| Posts | <function1.post_count> |
|
||||
| Comments | <function1.comment_count> |
|
||||
|
||||
**Highlights:**
|
||||
- <agent1.highlight_1>
|
||||
- <agent1.highlight_2>
|
||||
|
||||
What content would you like to see more of? Let us know in the comments!
|
||||
|
||||
### REMEMBER
|
||||
Use Reddit markdown. Write authentic content appropriate for the subreddit.`,
|
||||
placeholder: 'Describe the Reddit post you want to create...',
|
||||
generationType: 'social-post',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'url',
|
||||
|
||||
@@ -49,24 +49,35 @@ export const ResponseBlock: BlockConfig<ResponseBlockOutput> = {
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert JSON programmer.
|
||||
Generate ONLY the raw JSON object based on the user's request.
|
||||
The output MUST be a single, valid JSON object, starting with { and ending with }.
|
||||
prompt: `You are an expert JSON programmer. Generate ONLY the raw JSON object for the API response.
|
||||
|
||||
Current response: {context}
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.response>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{API_VERSION}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. The output MUST be a single, valid JSON object, starting with { and ending with }.
|
||||
Do not include any explanations, markdown formatting, or other text outside the JSON object.
|
||||
|
||||
You have access to the following variables you can use to generate the JSON body:
|
||||
- 'params' (object): Contains input parameters derived from the JSON schema. Access these directly using the parameter name wrapped in angle brackets, e.g., '<paramName>'. Do NOT use 'params.paramName'.
|
||||
- 'environmentVariables' (object): Contains environment variables. Reference these using the double curly brace syntax: '{{ENV_VAR_NAME}}'. Do NOT use 'environmentVariables.VAR_NAME' or env.
|
||||
### EXAMPLES
|
||||
|
||||
Example:
|
||||
{
|
||||
"name": "<block.agent.response.content>",
|
||||
"age": <block.function.output.age>,
|
||||
"success": true
|
||||
}`,
|
||||
**Simple response**: "Return success with message"
|
||||
→ {"success": true, "message": "Operation completed"}
|
||||
|
||||
**With variables**: "Return processed data from agent"
|
||||
→ {"status": "success", "data": <agent1.result>, "processedAt": <function1.timestamp>}
|
||||
|
||||
**Error response**: "Return error with details"
|
||||
→ {"success": false, "error": {"code": "NOT_FOUND", "message": <agent1.error_message>}}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown.`,
|
||||
placeholder: 'Describe the API response structure you need...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
|
||||
@@ -414,6 +414,50 @@ export const SalesforceBlock: BlockConfig<SalesforceResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'JSON array of report filters',
|
||||
condition: { field: 'operation', value: ['run_report'] },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Salesforce developer. Generate report filter JSON for Salesforce Analytics API.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.account_id>\`, \`<function1.result.date>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_OWNER}}\`)
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of filter objects. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### FILTER STRUCTURE
|
||||
Each filter object should have:
|
||||
- **column**: The API name of the field to filter
|
||||
- **operator**: Comparison operator (equals, notEqual, lessThan, greaterThan, lessOrEqual, greaterOrEqual, contains, startsWith, includes, excludes)
|
||||
- **value**: The value to compare against (string or array for includes/excludes)
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single filter**: "Filter by account name"
|
||||
→ [{"column": "ACCOUNT_NAME", "operator": "equals", "value": "Acme Corp"}]
|
||||
|
||||
**Multiple filters**: "Filter by stage and amount"
|
||||
→ [
|
||||
{"column": "STAGE_NAME", "operator": "equals", "value": "Closed Won"},
|
||||
{"column": "AMOUNT", "operator": "greaterThan", "value": "10000"}
|
||||
]
|
||||
|
||||
**With variables**: "Filter by owner from previous block"
|
||||
→ [{"column": "OWNER_ID", "operator": "equals", "value": <agent1.owner_id>}]
|
||||
|
||||
**Date filter**: "Filter by close date"
|
||||
→ [{"column": "CLOSE_DATE", "operator": "greaterOrEqual", "value": "2024-01-01"}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the report filters you need...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
// Dashboard fields
|
||||
{
|
||||
@@ -432,6 +476,77 @@ export const SalesforceBlock: BlockConfig<SalesforceResponse> = {
|
||||
placeholder: 'SELECT Id, Name FROM Account LIMIT 10',
|
||||
condition: { field: 'operation', value: ['query'] },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Salesforce developer. Generate SOQL (Salesforce Object Query Language) queries based on the user's request.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.account_id>\`, \`<function1.result.name>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_OWNER}}\`)
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the SOQL query. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw SOQL query string.
|
||||
|
||||
### SOQL SYNTAX GUIDE
|
||||
|
||||
**Basic SELECT**:
|
||||
SELECT field1, field2 FROM Object WHERE condition
|
||||
|
||||
**Common Standard Objects**:
|
||||
- Account, Contact, Lead, Opportunity, Case, Task
|
||||
- User, Campaign, Product2, Pricebook2
|
||||
|
||||
**Operators**:
|
||||
- **=**, **!=**, **<**, **<=**, **>**, **>=** : Comparisons
|
||||
- **LIKE** : Pattern matching (\`Name LIKE '%Corp%'\`)
|
||||
- **IN** : In list (\`Status IN ('Open', 'Closed')\`)
|
||||
- **NOT IN** : Not in list
|
||||
- **AND**, **OR**, **NOT** : Logical operators
|
||||
- **INCLUDES**, **EXCLUDES** : For multi-select picklists
|
||||
|
||||
**Date Functions**:
|
||||
- TODAY, YESTERDAY, TOMORROW
|
||||
- LAST_N_DAYS:n, NEXT_N_DAYS:n
|
||||
- THIS_WEEK, LAST_WEEK, NEXT_WEEK
|
||||
- THIS_MONTH, LAST_MONTH, NEXT_MONTH
|
||||
- THIS_QUARTER, LAST_QUARTER, NEXT_QUARTER
|
||||
- THIS_YEAR, LAST_YEAR, NEXT_YEAR
|
||||
|
||||
**Aggregate Functions**:
|
||||
- COUNT(), COUNT(fieldName), COUNT_DISTINCT(fieldName)
|
||||
- SUM(fieldName), AVG(fieldName)
|
||||
- MIN(fieldName), MAX(fieldName)
|
||||
|
||||
**Clauses**:
|
||||
- WHERE, ORDER BY, GROUP BY, HAVING, LIMIT, OFFSET
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple query**: "Get all accounts"
|
||||
→ SELECT Id, Name, Industry FROM Account LIMIT 100
|
||||
|
||||
**With filter**: "Find contacts from Acme Corp"
|
||||
→ SELECT Id, FirstName, LastName, Email FROM Contact WHERE Account.Name = 'Acme Corp'
|
||||
|
||||
**Date filter**: "Find opportunities created this month"
|
||||
→ SELECT Id, Name, Amount, StageName FROM Opportunity WHERE CreatedDate = THIS_MONTH
|
||||
|
||||
**Complex query**: "Find top 10 open deals over $50k"
|
||||
→ SELECT Id, Name, Amount, Account.Name, Owner.Name FROM Opportunity WHERE Amount > 50000 AND IsClosed = false ORDER BY Amount DESC LIMIT 10
|
||||
|
||||
**With variables**: "Find contacts for a specific account"
|
||||
→ SELECT Id, FirstName, LastName FROM Contact WHERE AccountId = '<agent1.account_id>'
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY the SOQL query - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the data you want to query...',
|
||||
generationType: 'sql-query',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'nextRecordsUrl',
|
||||
|
||||
@@ -94,6 +94,60 @@ export const SendGridBlock: BlockConfig<SendMailResult> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'Email body content (required unless using template)',
|
||||
condition: { field: 'operation', value: 'send_mail' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert email writer. Compose professional, clear, and effective email content for SendGrid.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_name>\`, \`<function1.result.data>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{COMPANY_NAME}}\`)
|
||||
|
||||
### GUIDELINES
|
||||
1. **Content Type**: Content can be plain text or HTML based on the selected content type
|
||||
2. **Structure**: Use clear formatting appropriate to the content type
|
||||
3. **Personalization**: Use variables for dynamic content
|
||||
4. **Call to Action**: Include clear CTAs for marketing emails
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Plain text newsletter**: "Write a product update announcement"
|
||||
→ Hi there,
|
||||
|
||||
We're excited to announce our latest product update!
|
||||
|
||||
Here's what's new:
|
||||
- Improved performance
|
||||
- New dashboard features
|
||||
- Enhanced security
|
||||
|
||||
Check out the full details on our blog.
|
||||
|
||||
Thanks for being a valued customer!
|
||||
|
||||
**With variables**: "Send welcome email"
|
||||
→ Welcome to {{COMPANY_NAME}}, <agent1.user_name>!
|
||||
|
||||
We're thrilled to have you on board. Here's what you can do next:
|
||||
|
||||
1. Complete your profile
|
||||
2. Explore our features
|
||||
3. Join our community
|
||||
|
||||
If you have any questions, just reply to this email.
|
||||
|
||||
Best,
|
||||
The {{COMPANY_NAME}} Team
|
||||
|
||||
### REMEMBER
|
||||
Write the email content only. Format depends on selected content type (plain text or HTML).`,
|
||||
placeholder: 'Describe the email content you want to write...',
|
||||
generationType: 'email-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
@@ -147,6 +201,49 @@ export const SendGridBlock: BlockConfig<SendMailResult> = {
|
||||
type: 'code',
|
||||
placeholder: '{"name": "John", "order_id": "12345"}',
|
||||
condition: { field: 'operation', value: 'send_mail' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert SendGrid developer. Generate dynamic template data JSON for SendGrid email templates.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_name>\`, \`<function1.result.order_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{COMPANY_NAME}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### TEMPLATE DATA GUIDELINES
|
||||
1. **Keys**: Must match the handlebars variables in your SendGrid template (e.g., {{name}}, {{order_id}})
|
||||
2. **Values**: Can be strings, numbers, booleans, arrays, or nested objects
|
||||
3. **Arrays**: Use for iteration in templates ({{#each items}})
|
||||
4. **Nested Objects**: Use dot notation in templates ({{user.name}})
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple personalization**: "Send email with name and order details"
|
||||
→ {"name": "John Doe", "order_id": "ORD-12345", "order_date": "2024-01-15"}
|
||||
|
||||
**With variables**: "Use data from previous block"
|
||||
→ {"name": <agent1.customer_name>, "order_id": <agent1.order_id>, "total": <function1.order_total>}
|
||||
|
||||
**With items array**: "Order confirmation with line items"
|
||||
→ {"customer_name": "John", "items": [{"name": "Widget", "price": 29.99, "qty": 2}], "total": 59.98}
|
||||
|
||||
**Nested data**: "Email with user and company info"
|
||||
→ {"user": {"name": "John", "email": "john@example.com"}, "company": "{{COMPANY_NAME}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the template data you need...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// File upload (basic mode)
|
||||
{
|
||||
|
||||
@@ -52,6 +52,66 @@ export const SentryBlock: BlockConfig<SentryResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'e.g., is:unresolved, level:error',
|
||||
condition: { field: 'operation', value: 'sentry_issues_list' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Sentry developer. Generate Sentry search queries for filtering issues.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the search query string. Do not include any explanations, markdown formatting, comments, or additional text.
|
||||
|
||||
### SENTRY QUERY SYNTAX
|
||||
|
||||
**Status Filters**:
|
||||
- is:unresolved - Unresolved issues
|
||||
- is:resolved - Resolved issues
|
||||
- is:ignored - Ignored issues
|
||||
- is:for_review - Issues needing review
|
||||
|
||||
**Level Filters**:
|
||||
- level:error
|
||||
- level:warning
|
||||
- level:info
|
||||
- level:fatal
|
||||
|
||||
**Time Filters**:
|
||||
- firstSeen:-24h - First seen in last 24 hours
|
||||
- lastSeen:-7d - Last seen in last 7 days
|
||||
- age:-30d - Created in last 30 days
|
||||
|
||||
**Assignment**:
|
||||
- assigned:me - Assigned to me
|
||||
- assigned:team-slug - Assigned to team
|
||||
- unassigned:true - Unassigned issues
|
||||
|
||||
**Other**:
|
||||
- has:user - Has user context
|
||||
- release:1.2.3 - Specific release
|
||||
- browser.name:Chrome - Browser filter
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Unresolved errors**: "Find unresolved error level issues"
|
||||
→ is:unresolved level:error
|
||||
|
||||
**Recent critical**: "Find fatal issues from last 24 hours"
|
||||
→ is:unresolved level:fatal firstSeen:-24h
|
||||
|
||||
**Complex query**: "Find unresolved errors assigned to me in production"
|
||||
→ is:unresolved level:error assigned:me environment:production
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY the query string - no explanations.`,
|
||||
placeholder: 'Describe the issues you want to find...',
|
||||
generationType: 'sql-query',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'statsPeriod',
|
||||
|
||||
@@ -167,6 +167,49 @@ export const SharepointBlock: BlockConfig<SharepointResponse> = {
|
||||
placeholder: 'Enter list item fields',
|
||||
canonicalParamId: 'listItemFields',
|
||||
condition: { field: 'operation', value: ['update_list', 'add_list_items'] },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert SharePoint developer. Generate list item fields JSON for SharePoint lists.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.title>\`, \`<function1.result.status>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### LIST ITEM FIELDS GUIDELINES
|
||||
1. **Format**: JSON object with column internal names as keys
|
||||
2. **Column Names**: Use internal names (usually no spaces), not display names
|
||||
3. **Field Types**: Support text, number, boolean, date, choice, lookup, etc.
|
||||
4. **For add_list_items**: Can be a single object or array of objects
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single item update**: "Update title and status"
|
||||
→ {"Title": "Updated Task", "Status": "Completed"}
|
||||
|
||||
**Add single item**: "Add a new task"
|
||||
→ {"Title": "New Task", "Description": "Task description", "Priority": "High", "DueDate": "2024-12-31"}
|
||||
|
||||
**Add multiple items**: "Add two tasks"
|
||||
→ [{"Title": "Task 1", "Status": "Active"}, {"Title": "Task 2", "Status": "Active"}]
|
||||
|
||||
**With variables**: "Update with data from previous block"
|
||||
→ {"Title": <agent1.task_title>, "AssignedTo": <agent1.assignee>, "Status": "{{DEFAULT_STATUS}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations.`,
|
||||
placeholder: 'Describe the list item fields...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
|
||||
// Upload File operation fields
|
||||
|
||||
@@ -124,6 +124,65 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
|
||||
value: 'send',
|
||||
},
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing Slack messages. Compose clear, engaging messages using Slack's mrkdwn formatting.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_name>\`, \`<function1.result.status>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{TEAM_NAME}}\`)
|
||||
|
||||
### SLACK MRKDWN FORMATTING
|
||||
- *bold* with asterisks
|
||||
- _italic_ with underscores
|
||||
- ~strikethrough~ with tildes
|
||||
- \`code\` with backticks
|
||||
- \`\`\`code block\`\`\` with triple backticks
|
||||
- > blockquote with >
|
||||
- • bullet points with •
|
||||
- <URL|link text> for links
|
||||
- :emoji: for emojis (e.g., :white_check_mark:, :warning:, :rocket:)
|
||||
|
||||
### GUIDELINES
|
||||
1. **Tone**: Match workplace communication style (professional but friendly)
|
||||
2. **Formatting**: Use mrkdwn for emphasis and structure
|
||||
3. **Emojis**: Use sparingly for visual interest
|
||||
4. **Mentions**: Use <@USER_ID> for mentions if needed
|
||||
5. **Brevity**: Keep messages scannable
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Status update**: "Share deployment status"
|
||||
→ :rocket: *Deployment Complete*
|
||||
|
||||
The latest release has been deployed to production.
|
||||
|
||||
*Changes included:*
|
||||
• Performance improvements
|
||||
• Bug fixes for login flow
|
||||
• New dashboard features
|
||||
|
||||
cc: <@engineering-team>
|
||||
|
||||
**With variables**: "Alert about system status"
|
||||
→ :warning: *Alert: System Status Change*
|
||||
|
||||
Service: <agent1.service_name>
|
||||
Status: <function1.status>
|
||||
Time: <function1.timestamp>
|
||||
|
||||
Please investigate if needed.
|
||||
|
||||
### REMEMBER
|
||||
Use Slack mrkdwn formatting. Keep messages clear and actionable.`,
|
||||
placeholder: 'Describe the Slack message you want to send...',
|
||||
generationType: 'message-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'threadTs',
|
||||
|
||||
@@ -86,6 +86,57 @@ export const SmtpBlock: BlockConfig<SmtpSendMailResult> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'Email content',
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert email writer. Compose professional, clear, and effective email content.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.recipient_name>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{SENDER_NAME}}\`)
|
||||
|
||||
### GUIDELINES
|
||||
1. **Content Type**: Plain text or HTML based on selected type
|
||||
2. **Structure**: Use clear paragraphs and formatting
|
||||
3. **Brevity**: Be concise but complete
|
||||
4. **Personalization**: Use variables for dynamic content
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Notification email**: "Send a system alert notification"
|
||||
→ System Alert
|
||||
|
||||
A new event has been detected that requires your attention.
|
||||
|
||||
Details:
|
||||
- Event Type: Security Alert
|
||||
- Time: <function1.timestamp>
|
||||
- Status: Requires Review
|
||||
|
||||
Please log in to review this alert.
|
||||
|
||||
**With variables**: "Send appointment reminder"
|
||||
→ Hi <agent1.customer_name>,
|
||||
|
||||
This is a reminder about your upcoming appointment:
|
||||
|
||||
Date: <function1.appointment_date>
|
||||
Time: <function1.appointment_time>
|
||||
Location: {{OFFICE_ADDRESS}}
|
||||
|
||||
Please arrive 10 minutes early.
|
||||
|
||||
See you soon!
|
||||
|
||||
### REMEMBER
|
||||
Write the email body only. Format based on selected content type.`,
|
||||
placeholder: 'Describe the email you want to write...',
|
||||
generationType: 'email-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'contentType',
|
||||
|
||||
@@ -73,6 +73,61 @@ export const SQSBlock: BlockConfig<SqsResponse> = {
|
||||
placeholder: '{\n "name": "John Doe",\n "email": "john@example.com",\n "active": true\n}',
|
||||
condition: { field: 'operation', value: 'send' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert AWS SQS developer. Generate JSON message data for SQS queue messages.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`, \`<function1.result.order>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{SERVICE_NAME}}\`, \`{{ENVIRONMENT}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON data. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### MESSAGE GUIDELINES
|
||||
1. **Structure**: Use a clear, consistent structure for your messages
|
||||
2. **Event Type**: Consider including a message type or event type field
|
||||
3. **Timestamp**: Include timestamps when relevant
|
||||
4. **IDs**: Include correlation IDs for tracking
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**User event**: "Send user registration event"
|
||||
→ {
|
||||
"eventType": "user.registered",
|
||||
"userId": "user-123",
|
||||
"email": "john@example.com",
|
||||
"timestamp": "2024-01-15T10:30:00Z"
|
||||
}
|
||||
|
||||
**With variables**: "Send event with data from previous block"
|
||||
→ {
|
||||
"eventType": "order.processed",
|
||||
"orderId": <agent1.order_id>,
|
||||
"customerId": <function1.customer_id>,
|
||||
"environment": "{{ENVIRONMENT}}"
|
||||
}
|
||||
|
||||
**Task message**: "Send background job to process"
|
||||
→ {
|
||||
"jobType": "process_report",
|
||||
"reportId": "report-123",
|
||||
"parameters": {"format": "pdf", "dateRange": "last_30_days"},
|
||||
"priority": "high"
|
||||
}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the message data you want to send...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
],
|
||||
tools: {
|
||||
|
||||
@@ -108,6 +108,51 @@ export const SSHBlock: BlockConfig<SSHResponse> = {
|
||||
placeholder: 'ls -la /var/www',
|
||||
required: true,
|
||||
condition: { field: 'operation', value: 'ssh_execute_command' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Linux/Unix system administrator. Generate shell commands based on the user's request.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.filename>\`, \`<function1.result.path>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{APP_PATH}}\`, \`{{USER}}\`)
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the shell command(s). Do not include any explanations, markdown formatting, or comments outside the command.
|
||||
|
||||
### COMMAND GUIDELINES
|
||||
1. **Single Command**: For simple operations, return just the command
|
||||
2. **Multiple Commands**: Chain with && or ; as appropriate
|
||||
3. **Variables**: Use proper shell variable syntax when needed
|
||||
4. **Safety**: Prefer safe commands; avoid rm -rf without careful consideration
|
||||
5. **Quoting**: Use proper quoting for paths with spaces
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**List files**: "List all files in /var/www"
|
||||
→ ls -la /var/www
|
||||
|
||||
**Check disk space**: "Show disk usage for /home"
|
||||
→ df -h /home && du -sh /home/*
|
||||
|
||||
**Find files**: "Find all .log files larger than 100MB"
|
||||
→ find /var/log -name "*.log" -size +100M
|
||||
|
||||
**Service management**: "Restart nginx and check status"
|
||||
→ sudo systemctl restart nginx && sudo systemctl status nginx
|
||||
|
||||
**With variables**: "Create directory from previous block"
|
||||
→ mkdir -p <agent1.directory_path>
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY the command - no explanations.`,
|
||||
placeholder: 'Describe what you want to do on the server...',
|
||||
generationType: 'javascript-function-body',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'workingDirectory',
|
||||
@@ -125,6 +170,61 @@ export const SSHBlock: BlockConfig<SSHResponse> = {
|
||||
placeholder: '#!/bin/bash\necho "Hello World"',
|
||||
required: true,
|
||||
condition: { field: 'operation', value: 'ssh_execute_script' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Linux/Unix shell script developer. Generate shell scripts based on the user's request.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.filename>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{APP_PATH}}\`)
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the shell script. Do not include any explanations outside the script. Comments inside the script are fine.
|
||||
|
||||
### SCRIPT GUIDELINES
|
||||
1. **Shebang**: Start with #!/bin/bash (or appropriate interpreter)
|
||||
2. **Error Handling**: Use set -e for strict error handling when appropriate
|
||||
3. **Variables**: Quote variables properly to handle spaces
|
||||
4. **Exit Codes**: Return appropriate exit codes
|
||||
5. **Comments**: Add brief comments for complex operations
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple script**: "Print system info"
|
||||
→ #!/bin/bash
|
||||
echo "Hostname: $(hostname)"
|
||||
echo "Uptime: $(uptime)"
|
||||
echo "Disk Usage:"
|
||||
df -h
|
||||
|
||||
**Backup script**: "Backup a directory to /backup"
|
||||
→ #!/bin/bash
|
||||
set -e
|
||||
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
||||
SOURCE="/var/www/html"
|
||||
DEST="/backup/www_$TIMESTAMP.tar.gz"
|
||||
tar -czf "$DEST" "$SOURCE"
|
||||
echo "Backup created: $DEST"
|
||||
|
||||
**Deploy script**: "Pull latest code and restart service"
|
||||
→ #!/bin/bash
|
||||
set -e
|
||||
cd /var/www/app
|
||||
git pull origin main
|
||||
npm install
|
||||
sudo systemctl restart app
|
||||
echo "Deployment complete"
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY the script - no explanations outside the script.`,
|
||||
placeholder: 'Describe the script you need...',
|
||||
generationType: 'javascript-function-body',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'interpreter',
|
||||
|
||||
@@ -95,6 +95,9 @@ The JSON object MUST have the following top-level properties: 'name' (string), '
|
||||
The 'schema' object must define the structure and MUST contain 'type': 'object', 'properties': {...}, 'additionalProperties': false, and 'required': [...].
|
||||
Inside 'properties', use standard JSON Schema properties (type, description, enum, items for arrays, etc.).
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax for dynamic schema names or descriptions.
|
||||
|
||||
Current schema: {context}
|
||||
|
||||
Do not include any explanations, markdown formatting, or other text outside the JSON object.
|
||||
|
||||
@@ -262,6 +262,45 @@ export const StripeBlock: BlockConfig<StripeResponse> = {
|
||||
field: 'operation',
|
||||
value: ['create_customer', 'update_customer'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Stripe API developer. Generate Stripe address JSON object.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.street>\`, \`<function1.result.city>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_COUNTRY}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON address object. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### ADDRESS FIELDS
|
||||
- **line1**: Street address (required)
|
||||
- **line2**: Apartment, suite, etc. (optional)
|
||||
- **city**: City name
|
||||
- **state**: State or province
|
||||
- **postal_code**: ZIP or postal code
|
||||
- **country**: Two-letter country code (US, CA, GB, etc.)
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**US address**: "123 Main St, New York, NY 10001"
|
||||
→ {"line1": "123 Main St", "city": "New York", "state": "NY", "postal_code": "10001", "country": "US"}
|
||||
|
||||
**With variables**: "Use address from previous block"
|
||||
→ {"line1": <agent1.street>, "city": <agent1.city>, "state": <agent1.state>, "postal_code": <agent1.zip>, "country": "{{DEFAULT_COUNTRY}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the address...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Subscription specific fields - REQUIRED for create_subscription
|
||||
{
|
||||
@@ -274,6 +313,48 @@ export const StripeBlock: BlockConfig<StripeResponse> = {
|
||||
value: ['create_subscription'],
|
||||
},
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Stripe API developer. Generate Stripe subscription items JSON array.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.price_id>\`, \`<function1.result.quantity>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_PLAN_PRICE_ID}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of subscription item objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### ITEM STRUCTURE
|
||||
Each item must have:
|
||||
- **price**: Price ID (price_xxx) - REQUIRED
|
||||
- **quantity**: Number of units (default: 1)
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single item**: "Subscribe to monthly plan"
|
||||
→ [{"price": "price_monthly_plan", "quantity": 1}]
|
||||
|
||||
**With variables**: "Subscribe with plan from previous block"
|
||||
→ [{"price": <agent1.selected_price_id>, "quantity": <function1.seat_count>}]
|
||||
|
||||
**Multiple items**: "Subscribe to plan with add-ons"
|
||||
→ [
|
||||
{"price": "{{BASE_PLAN_PRICE}}", "quantity": 1},
|
||||
{"price": "price_addon_storage", "quantity": 2}
|
||||
]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the subscription items...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
// Items - OPTIONAL for update_subscription
|
||||
{
|
||||
@@ -285,6 +366,50 @@ export const StripeBlock: BlockConfig<StripeResponse> = {
|
||||
field: 'operation',
|
||||
value: ['update_subscription'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Stripe API developer. Generate Stripe subscription items JSON array for updates.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.item_id>\`, \`<function1.result.new_quantity>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{PREMIUM_PRICE_ID}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of subscription item objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### ITEM STRUCTURE FOR UPDATES
|
||||
For adding items:
|
||||
- **price**: Price ID (price_xxx)
|
||||
- **quantity**: Number of units
|
||||
|
||||
For updating existing items:
|
||||
- **id**: Existing subscription item ID (si_xxx)
|
||||
- **quantity**: New quantity
|
||||
- **deleted**: true to remove item
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Add item**: "Add premium feature"
|
||||
→ [{"price": "price_premium_feature", "quantity": 1}]
|
||||
|
||||
**With variables**: "Update quantity from previous block"
|
||||
→ [{"id": <agent1.subscription_item_id>, "quantity": <function1.new_seat_count>}]
|
||||
|
||||
**Remove item**: "Remove add-on"
|
||||
→ [{"id": "si_addon_item", "deleted": true}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the subscription item changes...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'trial_period_days',
|
||||
@@ -393,6 +518,49 @@ export const StripeBlock: BlockConfig<StripeResponse> = {
|
||||
field: 'operation',
|
||||
value: ['create_product', 'update_product'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Stripe API developer. Generate a JSON array of product image URLs.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.image_url>\`, \`<function1.result.images>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{CDN_BASE_URL}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of image URL strings. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### IMAGE GUIDELINES
|
||||
- URLs must be publicly accessible
|
||||
- Supported formats: JPEG, PNG, GIF
|
||||
- Stripe recommends images at least 1280x720px
|
||||
- Maximum 8 images per product
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single image**: "Add main product image"
|
||||
→ ["https://example.com/products/widget-main.jpg"]
|
||||
|
||||
**With variables**: "Use image URLs from previous block"
|
||||
→ [<agent1.main_image>, <agent1.secondary_image>]
|
||||
|
||||
**Multiple images**: "Add product gallery"
|
||||
→ [
|
||||
"{{CDN_BASE_URL}}/products/widget-front.jpg",
|
||||
"{{CDN_BASE_URL}}/products/widget-side.jpg"
|
||||
]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array of URL strings - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Enter the product image URLs...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
// Price specific fields
|
||||
{
|
||||
@@ -425,6 +593,46 @@ export const StripeBlock: BlockConfig<StripeResponse> = {
|
||||
field: 'operation',
|
||||
value: 'create_price',
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Stripe API developer. Generate Stripe recurring billing configuration JSON.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.interval>\`, \`<function1.result.billing_cycle>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_BILLING_INTERVAL}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON recurring object. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### RECURRING FIELDS
|
||||
- **interval**: Billing frequency (day, week, month, year)
|
||||
- **interval_count**: Number of intervals between billings (default: 1)
|
||||
- **usage_type**: "licensed" (default) or "metered"
|
||||
- **aggregate_usage**: For metered: "sum", "last_during_period", "last_ever", "max"
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Monthly**: "Bill monthly"
|
||||
→ {"interval": "month", "interval_count": 1}
|
||||
|
||||
**With variables**: "Use billing cycle from previous block"
|
||||
→ {"interval": <agent1.billing_interval>, "interval_count": <agent1.interval_count>}
|
||||
|
||||
**Metered usage**: "Usage-based monthly billing"
|
||||
→ {"interval": "month", "usage_type": "metered", "aggregate_usage": "sum"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the billing frequency...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Common description field
|
||||
{
|
||||
@@ -473,6 +681,47 @@ export const StripeBlock: BlockConfig<StripeResponse> = {
|
||||
'update_price',
|
||||
],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Stripe API developer. Generate Stripe metadata JSON object.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.order_id>\`, \`<function1.result.user_id>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{ENVIRONMENT}}\`, \`{{REGION}}\`)
|
||||
|
||||
Note: Metadata values must be strings. Variables will be converted to strings automatically.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON metadata object with key-value pairs. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### METADATA GUIDELINES
|
||||
- Keys can be up to 40 characters
|
||||
- Values can be up to 500 characters
|
||||
- All values must be strings
|
||||
- Maximum 50 keys per object
|
||||
- Use for internal reference data, not sensitive info
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Order reference**: "Add order and customer reference"
|
||||
→ {"order_id": "ORD-12345", "customer_ref": "CUST-789"}
|
||||
|
||||
**With variables**: "Track data from previous block"
|
||||
→ {"order_id": <agent1.order_id>, "user_id": <function1.user_id>, "environment": "{{ENVIRONMENT}}"}
|
||||
|
||||
**Integration data**: "Add integration references"
|
||||
→ {"crm_id": "CRM-456", "campaign": "spring_sale_2024", "affiliate": "partner_xyz"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON with string values - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the metadata you want to add...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// List/Search common fields
|
||||
{
|
||||
|
||||
@@ -85,6 +85,37 @@ export const SupabaseBlock: BlockConfig<SupabaseResponse> = {
|
||||
placeholder: '{\n "column1": "value1",\n "column2": "value2"\n}',
|
||||
condition: { field: 'operation', value: 'insert' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Supabase developer. Generate JSON data for INSERT operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.name>\`, \`<function1.result.email>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the data as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple insert**: "Insert user with name and email"
|
||||
→ {"name": "John Doe", "email": "john@example.com"}
|
||||
|
||||
**With variables**: "Insert data from previous block"
|
||||
→ {"name": <agent1.name>, "email": <agent1.email>, "status": "{{DEFAULT_STATUS}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the data you want to insert...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'data',
|
||||
@@ -93,6 +124,37 @@ export const SupabaseBlock: BlockConfig<SupabaseResponse> = {
|
||||
placeholder: '{\n "column1": "value1",\n "column2": "value2"\n}',
|
||||
condition: { field: 'operation', value: 'update' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Supabase developer. Generate JSON data for UPDATE operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.new_status>\`, \`<function1.result.value>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{SYSTEM_USER}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the update data as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object with only the fields you want to update.
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple update**: "Update status and name"
|
||||
→ {"status": "active", "name": "Updated Name"}
|
||||
|
||||
**With variables**: "Update with data from previous block"
|
||||
→ {"status": <agent1.new_status>, "updated_by": "{{SYSTEM_USER}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe what fields you want to update...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'data',
|
||||
@@ -101,6 +163,41 @@ export const SupabaseBlock: BlockConfig<SupabaseResponse> = {
|
||||
placeholder: '{\n "column1": "value1",\n "column2": "value2"\n}',
|
||||
condition: { field: 'operation', value: 'upsert' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Supabase developer. Generate JSON data for UPSERT operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.id>\`, \`<function1.result.data>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the data as valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### UPSERT GUIDELINES
|
||||
1. Include the primary key/unique column for matching existing rows
|
||||
2. Include all fields you want to insert or update
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple upsert**: "Upsert user by email"
|
||||
→ {"email": "john@example.com", "name": "John Doe", "status": "active"}
|
||||
|
||||
**With variables**: "Upsert with ID from previous block"
|
||||
→ {"id": <agent1.user_id>, "name": <agent1.name>, "updated_at": "{{TIMESTAMP}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the data you want to upsert...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
// Filter for get_row, update, delete operations (required)
|
||||
{
|
||||
@@ -118,6 +215,11 @@ export const SupabaseBlock: BlockConfig<SupabaseResponse> = {
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_id>\`, \`<function1.result.status>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_STATUS}}\`)
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY the PostgREST filter expression. Do not include any explanations, markdown formatting, or additional text. Just the raw filter expression.
|
||||
|
||||
|
||||
@@ -64,6 +64,56 @@ export const TelegramBlock: BlockConfig<TelegramResponse> = {
|
||||
placeholder: 'Enter the message to send',
|
||||
required: true,
|
||||
condition: { field: 'operation', value: 'telegram_message' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing Telegram messages. Compose clear, engaging messages.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.user_name>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{BOT_NAME}}\`)
|
||||
|
||||
### TELEGRAM FORMATTING (MarkdownV2)
|
||||
- *bold* with asterisks
|
||||
- _italic_ with underscores
|
||||
- __underline__ with double underscores
|
||||
- ~strikethrough~ with tildes
|
||||
- ||spoiler|| with double pipes
|
||||
- \`inline code\` with backticks
|
||||
- \`\`\`code block\`\`\` with triple backticks
|
||||
|
||||
### GUIDELINES
|
||||
1. **Tone**: Adapt to context (bot notifications, alerts, updates)
|
||||
2. **Brevity**: Keep messages concise for mobile readability
|
||||
3. **Emojis**: Use emojis for visual clarity
|
||||
4. **Structure**: Use line breaks for readability
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Notification**: "Send a task reminder"
|
||||
→ 📋 *Task Reminder*
|
||||
|
||||
Don't forget to complete your daily review!
|
||||
|
||||
⏰ Due: Today at 5 PM
|
||||
|
||||
**With variables**: "Send order update"
|
||||
→ 📦 *Order Update*
|
||||
|
||||
Order: #<function1.order_id>
|
||||
Status: <agent1.status>
|
||||
|
||||
Your order is on its way! 🚀
|
||||
|
||||
### REMEMBER
|
||||
Keep messages mobile-friendly and concise.`,
|
||||
placeholder: 'Describe the Telegram message you want to send...',
|
||||
generationType: 'message-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'photo',
|
||||
|
||||
@@ -123,6 +123,74 @@ export const TrelloBlock: BlockConfig<ToolResponse> = {
|
||||
field: 'operation',
|
||||
value: 'trello_create_card',
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing Trello card descriptions. Create clear, organized card content.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.task>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{TEAM_NAME}}\`)
|
||||
|
||||
### TRELLO MARKDOWN
|
||||
Trello supports markdown:
|
||||
- **bold** with double asterisks
|
||||
- *italic* with asterisks
|
||||
- ~~strikethrough~~ with tildes
|
||||
- \`code\` with backticks
|
||||
- [link text](url)
|
||||
- - bullet lists
|
||||
- 1. numbered lists
|
||||
|
||||
### GUIDELINES
|
||||
1. **Structure**: Use headers and lists
|
||||
2. **Checklist Items**: Define clear action items
|
||||
3. **Context**: Include background information
|
||||
4. **Links**: Reference related resources
|
||||
5. **Brevity**: Keep it scannable
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Feature card**: "Write description for new dashboard feature"
|
||||
→ ## Overview
|
||||
Implement new analytics dashboard with real-time metrics.
|
||||
|
||||
## Requirements
|
||||
- Display key performance metrics
|
||||
- Support date range filtering
|
||||
- Auto-refresh every 30 seconds
|
||||
|
||||
## Acceptance Criteria
|
||||
- [ ] Dashboard loads within 2 seconds
|
||||
- [ ] All metrics update in real-time
|
||||
- [ ] Mobile responsive design
|
||||
|
||||
## Resources
|
||||
- [Design mockups](link)
|
||||
- [API documentation](link)
|
||||
|
||||
**With variables**: "Create card from request"
|
||||
→ ## Request
|
||||
From: <agent1.requester>
|
||||
Priority: <function1.priority>
|
||||
|
||||
## Details
|
||||
<agent1.description>
|
||||
|
||||
## Action Items
|
||||
- [ ] Review requirements
|
||||
- [ ] Estimate effort
|
||||
- [ ] Assign to team member
|
||||
|
||||
### REMEMBER
|
||||
Use markdown for structure. Include actionable checklist items.`,
|
||||
placeholder: 'Describe the card content...',
|
||||
generationType: 'markdown-content',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
@@ -180,6 +180,45 @@ export const TypeformBlock: BlockConfig<TypeformResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'JSON array of field objects',
|
||||
condition: { field: 'operation', value: 'typeform_create_form' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Typeform developer. Generate form fields JSON for creating Typeform forms.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### FIELD TYPES
|
||||
- short_text, long_text, email, phone_number, number
|
||||
- multiple_choice, dropdown, yes_no, rating, opinion_scale
|
||||
- date, file_upload, picture_choice, statement, group
|
||||
|
||||
### FIELD FORMAT
|
||||
Each field needs: "type", "title", and optionally "properties" for choices, validation, etc.
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple form**: "Create a contact form with name and email"
|
||||
→ [{"type": "short_text", "title": "What is your name?"}, {"type": "email", "title": "What is your email?"}]
|
||||
|
||||
**Multiple choice**: "Create a survey question with options"
|
||||
→ [{"type": "multiple_choice", "title": "How satisfied are you?", "properties": {"choices": [{"label": "Very satisfied"}, {"label": "Satisfied"}, {"label": "Neutral"}, {"label": "Unsatisfied"}]}}]
|
||||
|
||||
**Rating field**: "Add a 1-10 rating question"
|
||||
→ [{"type": "rating", "title": "Rate your experience", "properties": {"steps": 10}}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the form fields...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'settings',
|
||||
@@ -187,6 +226,46 @@ export const TypeformBlock: BlockConfig<TypeformResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'JSON object for form settings',
|
||||
condition: { field: 'operation', value: 'typeform_create_form' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Typeform developer. Generate form settings JSON for Typeform.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{REDIRECT_URL}}\`).
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### SETTINGS OPTIONS
|
||||
- language: Form language code (e.g., "en", "es", "fr")
|
||||
- progress_bar: "percentage" or "proportion"
|
||||
- show_progress_bar: boolean
|
||||
- is_public: boolean
|
||||
- is_trial: boolean
|
||||
- redirect_after_submit_url: URL to redirect after submission
|
||||
- meta: { title, description, image } for SEO
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Basic settings**: "English form with progress bar"
|
||||
→ {"language": "en", "show_progress_bar": true, "progress_bar": "percentage", "is_public": true}
|
||||
|
||||
**With redirect**: "Redirect to thank you page after submit"
|
||||
→ {"language": "en", "is_public": true, "redirect_after_submit_url": "https://example.com/thank-you"}
|
||||
|
||||
**With SEO meta**: "Add meta information"
|
||||
→ {"language": "en", "is_public": true, "meta": {"title": "Customer Survey", "description": "Help us improve"}}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations.`,
|
||||
placeholder: 'Describe the form settings...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'themeId',
|
||||
@@ -203,6 +282,53 @@ export const TypeformBlock: BlockConfig<TypeformResponse> = {
|
||||
placeholder: 'JSON array of patch operations (RFC 6902)',
|
||||
condition: { field: 'operation', value: 'typeform_update_form' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Typeform developer. Generate JSON Patch operations (RFC 6902) for updating Typeform forms.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of patch operations. Do not include any explanations or comments.
|
||||
|
||||
### JSON PATCH OPERATIONS
|
||||
- **add**: Add a new field or value
|
||||
- **remove**: Remove a field or value
|
||||
- **replace**: Replace an existing value
|
||||
- **move**: Move a field from one location to another
|
||||
- **copy**: Copy a field to a new location
|
||||
|
||||
### FORMAT
|
||||
Each operation needs: "op" (operation), "path" (JSON pointer), and "value" (for add/replace)
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Update title**: "Change form title to 'New Survey'"
|
||||
→ [{"op": "replace", "path": "/title", "value": "New Survey"}]
|
||||
|
||||
**Add field**: "Add a new email field"
|
||||
→ [{"op": "add", "path": "/fields/-", "value": {"type": "email", "title": "Your email"}}]
|
||||
|
||||
**Remove field**: "Remove the third field"
|
||||
→ [{"op": "remove", "path": "/fields/2"}]
|
||||
|
||||
**Update settings**: "Change language to Spanish"
|
||||
→ [{"op": "replace", "path": "/settings/language", "value": "es"}]
|
||||
|
||||
**Multiple operations**: "Update title and add redirect"
|
||||
→ [{"op": "replace", "path": "/title", "value": "Updated Form"}, {"op": "add", "path": "/settings/redirect_after_submit_url", "value": "https://example.com/done"}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array of patch operations - no explanations.`,
|
||||
placeholder: 'Describe the changes to make...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
...getTrigger('typeform_webhook').subBlocks,
|
||||
],
|
||||
|
||||
@@ -314,6 +314,56 @@ export const VideoGeneratorBlock: BlockConfig<VideoBlockResponse> = {
|
||||
condition: { field: 'provider', value: 'luma' },
|
||||
placeholder: 'JSON: [{ "key": "pan_right" }, { "key": "zoom_in" }]',
|
||||
required: false,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at Luma AI video generation. Generate camera control JSON for Luma Dream Machine.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks using \`<block_name.field_name>\` syntax.
|
||||
Environment variables use \`{{ENV_VAR_NAME}}\` syntax.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of camera control objects. Do not include any explanations, markdown formatting, or comments.
|
||||
|
||||
### AVAILABLE CAMERA CONTROLS
|
||||
- **pan_left**: Pan camera to the left
|
||||
- **pan_right**: Pan camera to the right
|
||||
- **pan_up**: Pan camera upward
|
||||
- **pan_down**: Pan camera downward
|
||||
- **zoom_in**: Zoom camera in
|
||||
- **zoom_out**: Zoom camera out
|
||||
- **orbit_left**: Orbit camera left around subject
|
||||
- **orbit_right**: Orbit camera right around subject
|
||||
- **crane_up**: Crane shot moving up
|
||||
- **crane_down**: Crane shot moving down
|
||||
|
||||
### FORMAT
|
||||
Each control object needs a "key" property with the control name:
|
||||
[{"key": "control_name"}, {"key": "another_control"}]
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Simple pan**: "Pan to the right"
|
||||
→ [{"key": "pan_right"}]
|
||||
|
||||
**Zoom effect**: "Zoom in dramatically"
|
||||
→ [{"key": "zoom_in"}]
|
||||
|
||||
**Combined motion**: "Pan right while zooming in"
|
||||
→ [{"key": "pan_right"}, {"key": "zoom_in"}]
|
||||
|
||||
**Orbit shot**: "Circle around the subject"
|
||||
→ [{"key": "orbit_right"}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the camera movement you want...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
|
||||
// MiniMax-specific: Prompt optimizer
|
||||
|
||||
@@ -77,6 +77,46 @@ export const WebflowBlock: BlockConfig<WebflowResponse> = {
|
||||
placeholder: 'Field data as JSON: `{ "name": "Item Name", "slug": "item-slug" }`',
|
||||
condition: { field: 'operation', value: ['create', 'update'] },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Webflow developer. Generate field data JSON for Webflow CMS collection items.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.title>\`, \`<function1.result.slug>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{SITE_ID}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### FIELD DATA GUIDELINES
|
||||
1. **Required Fields**: name and slug are typically required
|
||||
2. **Custom Fields**: Match your collection's field types (text, rich text, image, reference, multi-reference, etc.)
|
||||
3. **Slug**: URL-friendly identifier (lowercase, hyphens instead of spaces)
|
||||
4. **References**: Use item IDs for reference fields
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Basic item**: "Create a blog post"
|
||||
→ {"name": "My Blog Post", "slug": "my-blog-post", "content": "This is the post content..."}
|
||||
|
||||
**With variables**: "Create item from previous block data"
|
||||
→ {"name": <agent1.title>, "slug": <agent1.slug>, "author": <agent1.author_id>, "published": true}
|
||||
|
||||
**Rich content**: "Create product with details"
|
||||
→ {"name": "Premium Widget", "slug": "premium-widget", "price": 99.99, "description": "<p>High quality widget</p>", "featured": true}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the item data you want to create...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
...getTrigger('webflow_collection_item_created').subBlocks,
|
||||
...getTrigger('webflow_collection_item_changed').subBlocks,
|
||||
|
||||
@@ -29,6 +29,56 @@ export const WhatsAppBlock: BlockConfig<WhatsAppResponse> = {
|
||||
type: 'long-input',
|
||||
placeholder: 'Enter your message',
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert at writing WhatsApp messages. Compose clear, friendly messages optimized for mobile.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.customer_name>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{BUSINESS_NAME}}\`)
|
||||
|
||||
### GUIDELINES
|
||||
1. **Tone**: Friendly and conversational, appropriate for WhatsApp
|
||||
2. **Length**: Keep messages concise for mobile reading
|
||||
3. **Emojis**: Use emojis naturally to add warmth
|
||||
4. **Structure**: Use line breaks for readability
|
||||
5. **No Markdown**: WhatsApp has limited formatting support
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Customer notification**: "Send order confirmation"
|
||||
→ Hi! 👋
|
||||
|
||||
Your order has been confirmed! 🎉
|
||||
|
||||
Order #12345
|
||||
Total: $99.99
|
||||
|
||||
We'll notify you when it ships. Thanks for shopping with us! 💙
|
||||
|
||||
**With variables**: "Send appointment reminder"
|
||||
→ Hi <agent1.customer_name>! 👋
|
||||
|
||||
Just a reminder about your appointment:
|
||||
|
||||
📅 Date: <function1.date>
|
||||
⏰ Time: <function1.time>
|
||||
📍 Location: {{BUSINESS_ADDRESS}}
|
||||
|
||||
Reply YES to confirm or call us to reschedule.
|
||||
|
||||
See you soon! 😊
|
||||
|
||||
### REMEMBER
|
||||
Keep messages mobile-friendly and conversational.`,
|
||||
placeholder: 'Describe the WhatsApp message you want to send...',
|
||||
generationType: 'message-content',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'phoneNumberId',
|
||||
|
||||
@@ -132,6 +132,76 @@ export const WordPressBlock: BlockConfig<WordPressResponse> = {
|
||||
'wordpress_update_page',
|
||||
],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert WordPress content writer. Create engaging, well-structured content for blog posts and pages.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.topic>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{SITE_NAME}}\`)
|
||||
|
||||
### WORDPRESS FORMATTING
|
||||
WordPress accepts HTML or plain text:
|
||||
- <h2>, <h3> for headings
|
||||
- <p> for paragraphs
|
||||
- <ul>, <ol>, <li> for lists
|
||||
- <strong>, <em> for emphasis
|
||||
- <a href=""> for links
|
||||
- <blockquote> for quotes
|
||||
- <img> for images
|
||||
|
||||
### GUIDELINES
|
||||
1. **SEO**: Use headings hierarchically for SEO
|
||||
2. **Readability**: Short paragraphs, bullet points
|
||||
3. **Engagement**: Start with a hook, end with a CTA
|
||||
4. **Formatting**: Use HTML for rich formatting
|
||||
5. **Links**: Include internal and external links
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Blog post**: "Write a post about productivity tips"
|
||||
→ <p>Are you looking to boost your productivity? Here are five proven strategies that can transform your workday.</p>
|
||||
|
||||
<h2>1. Start with Your Most Important Task</h2>
|
||||
<p>Tackle your biggest challenge first thing in the morning when your energy is highest. This approach, often called "eating the frog," ensures your critical work gets done.</p>
|
||||
|
||||
<h2>2. Use Time Blocking</h2>
|
||||
<p>Divide your day into focused blocks:</p>
|
||||
<ul>
|
||||
<li>Deep work sessions (2-3 hours)</li>
|
||||
<li>Email and communication (30 minutes)</li>
|
||||
<li>Breaks and transitions (15 minutes)</li>
|
||||
</ul>
|
||||
|
||||
<h2>3. Minimize Distractions</h2>
|
||||
<p>Create a distraction-free environment by:</p>
|
||||
<ul>
|
||||
<li>Turning off notifications</li>
|
||||
<li>Using website blockers</li>
|
||||
<li>Setting "do not disturb" hours</li>
|
||||
</ul>
|
||||
|
||||
<p><strong>Ready to transform your productivity?</strong> Start implementing these tips today and watch your efficiency soar!</p>
|
||||
|
||||
**With variables**: "Create post from data"
|
||||
→ <h2><agent1.title></h2>
|
||||
|
||||
<p><agent1.introduction></p>
|
||||
|
||||
<function1.body_content>
|
||||
|
||||
<p>For more information, visit {{SITE_URL}}.</p>
|
||||
|
||||
### REMEMBER
|
||||
Use HTML formatting. Write engaging, SEO-friendly content.`,
|
||||
placeholder: 'Describe the content you want to write...',
|
||||
generationType: 'html-content',
|
||||
},
|
||||
},
|
||||
|
||||
// Post/Page Status
|
||||
|
||||
@@ -42,6 +42,68 @@ export const XBlock: BlockConfig<XResponse> = {
|
||||
placeholder: "What's happening?",
|
||||
condition: { field: 'operation', value: 'x_write' },
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert X (Twitter) content creator. Write engaging tweets optimized for the platform.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.topic>\`, \`<function1.result>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{HANDLE}}\`)
|
||||
|
||||
### X/TWITTER BEST PRACTICES
|
||||
1. **Length**: 280 characters max, but shorter often performs better
|
||||
2. **Hook**: Lead with the most interesting part
|
||||
3. **Hashtags**: Use 1-2 relevant hashtags sparingly
|
||||
4. **Threads**: For longer content, suggest a thread format
|
||||
5. **Engagement**: Ask questions or invite responses
|
||||
6. **Emojis**: Use to add personality and visual breaks
|
||||
|
||||
### GUIDELINES
|
||||
- Be concise and punchy
|
||||
- Use conversational tone
|
||||
- Avoid excessive hashtags
|
||||
- Include a hook in the first few words
|
||||
- Create curiosity or value
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Announcement**: "Tweet about a new feature launch"
|
||||
→ Just shipped: Dark mode is finally here 🌙
|
||||
|
||||
Your eyes will thank you.
|
||||
|
||||
Update now →
|
||||
|
||||
**Hot take**: "Share an opinion on tech trends"
|
||||
→ Unpopular opinion: Most "AI tools" are just GPT wrappers with nice UIs.
|
||||
|
||||
The real innovation isn't the model—it's the UX.
|
||||
|
||||
**With variables**: "Share automated update"
|
||||
→ 📊 Weekly stats update:
|
||||
|
||||
Users: <function1.user_count>
|
||||
Growth: <function1.growth_rate>%
|
||||
|
||||
Thanks for being part of the journey! 🚀
|
||||
|
||||
**Thread starter**: "Start a thread on a topic"
|
||||
→ I've spent 10 years building products.
|
||||
|
||||
Here are 7 lessons I wish I knew on day one:
|
||||
|
||||
🧵 (1/8)
|
||||
|
||||
### REMEMBER
|
||||
Keep it under 280 characters. Be concise and engaging.`,
|
||||
placeholder: 'Describe the tweet you want to create...',
|
||||
generationType: 'social-post',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'replyTo',
|
||||
|
||||
@@ -177,6 +177,48 @@ export const ZendeskBlock: BlockConfig = {
|
||||
field: 'operation',
|
||||
value: ['create_ticket', 'update_ticket'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Zendesk API developer. Generate Zendesk custom fields JSON object.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.field_value>\`, \`<function1.result.category>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_CATEGORY}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON custom fields object. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### CUSTOM FIELDS STRUCTURE
|
||||
Custom fields use field IDs as keys with their values:
|
||||
- Text fields: String values
|
||||
- Numeric fields: Number values
|
||||
- Dropdown fields: Option value or ID
|
||||
- Checkbox fields: true/false
|
||||
- Date fields: ISO date string
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single custom field**: "Set priority category"
|
||||
→ {"12345678": "high_priority"}
|
||||
|
||||
**Multiple custom fields**: "Set category and region"
|
||||
→ {"12345678": "support", "87654321": "north_america"}
|
||||
|
||||
**With variables**: "Use values from previous block"
|
||||
→ {"12345678": <agent1.category>, "87654321": <agent1.region>}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the custom fields you want to set...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'tickets',
|
||||
@@ -188,6 +230,61 @@ export const ZendeskBlock: BlockConfig = {
|
||||
field: 'operation',
|
||||
value: ['create_tickets_bulk', 'update_tickets_bulk'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Zendesk API developer. Generate Zendesk tickets JSON array for bulk operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.tickets>\`, \`<function1.result.subject>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_GROUP_ID}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of ticket objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### TICKET STRUCTURE
|
||||
For creating tickets:
|
||||
- **subject**: Ticket subject (required)
|
||||
- **description**: Ticket description
|
||||
- **priority**: low, normal, high, urgent
|
||||
- **status**: new, open, pending, hold, solved
|
||||
- **type**: problem, incident, question, task
|
||||
- **assignee_id**: User ID to assign to
|
||||
- **group_id**: Group ID
|
||||
|
||||
For updating tickets:
|
||||
- Include ticket **id** for each ticket to update
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Create tickets**: "Create two support tickets"
|
||||
→ [
|
||||
{"subject": "Login issue", "description": "Cannot login", "priority": "high"},
|
||||
{"subject": "Feature request", "description": "Add dark mode", "priority": "normal"}
|
||||
]
|
||||
|
||||
**With variables**: "Create tickets from previous block data"
|
||||
→ [
|
||||
{"subject": <agent1.subject>, "description": <agent1.description>, "priority": <agent1.priority>}
|
||||
]
|
||||
|
||||
**Update tickets**: "Update status for multiple tickets"
|
||||
→ [
|
||||
{"id": 12345, "status": "solved"},
|
||||
{"id": 12346, "status": "pending"}
|
||||
]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the tickets you want to create or update...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'targetTicketId',
|
||||
@@ -257,6 +354,58 @@ export const ZendeskBlock: BlockConfig = {
|
||||
field: 'operation',
|
||||
value: ['create_users_bulk', 'update_users_bulk'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Zendesk API developer. Generate Zendesk users JSON array for bulk operations.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.users>\`, \`<function1.result.name>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_ORG_ID}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of user objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### USER STRUCTURE
|
||||
For creating users:
|
||||
- **name**: User's name (required)
|
||||
- **email**: User's email
|
||||
- **role**: end-user, agent, admin
|
||||
- **organization_id**: Organization ID
|
||||
|
||||
For updating users:
|
||||
- Include user **id** for each user to update
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Create users**: "Create two new users"
|
||||
→ [
|
||||
{"name": "John Doe", "email": "john@example.com", "role": "end-user"},
|
||||
{"name": "Jane Smith", "email": "jane@example.com", "role": "end-user"}
|
||||
]
|
||||
|
||||
**With variables**: "Create users from previous block"
|
||||
→ [
|
||||
{"name": <agent1.name>, "email": <agent1.email>, "organization_id": "{{DEFAULT_ORG_ID}}"}
|
||||
]
|
||||
|
||||
**Update users**: "Update roles for multiple users"
|
||||
→ [
|
||||
{"id": 12345, "role": "agent"},
|
||||
{"id": 12346, "role": "admin"}
|
||||
]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the users you want to create or update...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
// Organization fields
|
||||
{
|
||||
@@ -305,6 +454,50 @@ export const ZendeskBlock: BlockConfig = {
|
||||
field: 'operation',
|
||||
value: ['create_organizations_bulk'],
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Zendesk API developer. Generate Zendesk organizations JSON array for bulk creation.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.org_name>\`, \`<function1.result.domain>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_TAGS}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array of organization objects. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### ORGANIZATION STRUCTURE
|
||||
- **name**: Organization name (required)
|
||||
- **domain_names**: Array of domain names
|
||||
- **details**: Description/details
|
||||
- **notes**: Internal notes
|
||||
- **group_id**: Associated group ID
|
||||
- **tags**: Array of tags
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Create organizations**: "Create two companies"
|
||||
→ [
|
||||
{"name": "Acme Corp", "domain_names": ["acme.com"], "details": "Enterprise customer"},
|
||||
{"name": "Widget Inc", "domain_names": ["widget.io"], "details": "Small business"}
|
||||
]
|
||||
|
||||
**With variables**: "Create organizations from previous block"
|
||||
→ [
|
||||
{"name": <agent1.company_name>, "domain_names": [<agent1.domain>], "tags": ["{{DEFAULT_TAGS}}"]}
|
||||
]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY a valid JSON array - no explanations, no markdown, no extra text.`,
|
||||
placeholder: 'Describe the organizations you want to create...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
// Search fields
|
||||
{
|
||||
|
||||
@@ -94,6 +94,45 @@ export const ZepBlock: BlockConfig<ZepResponse> = {
|
||||
field: 'operation',
|
||||
value: 'add_user',
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Zep developer. Generate metadata JSON for Zep users.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.plan>\`, \`<function1.result.company>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax (e.g., \`{{DEFAULT_PLAN}}\`)
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY valid JSON. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON object.
|
||||
|
||||
### METADATA GUIDELINES
|
||||
1. **Purpose**: Store additional user context for memory personalization
|
||||
2. **Types**: Strings, numbers, booleans, arrays, nested objects
|
||||
3. **Use Cases**: User preferences, account info, conversation context
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**User context**: "Store user preferences"
|
||||
→ {"language": "en", "timezone": "America/New_York", "notifications": true}
|
||||
|
||||
**Account info**: "Store account and subscription data"
|
||||
→ {"plan": "enterprise", "company": "Acme Inc", "signup_date": "2024-01-15"}
|
||||
|
||||
**With variables**: "Use data from previous block"
|
||||
→ {"plan": <agent1.subscription_plan>, "company": <agent1.company_name>, "user_type": "{{DEFAULT_USER_TYPE}}"}
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON - no explanations.`,
|
||||
placeholder: 'Describe the user metadata...',
|
||||
generationType: 'json-object',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'messages',
|
||||
@@ -106,6 +145,46 @@ export const ZepBlock: BlockConfig<ZepResponse> = {
|
||||
value: 'add_messages',
|
||||
},
|
||||
required: true,
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
maintainHistory: true,
|
||||
prompt: `You are an expert Zep developer. Generate messages JSON array for Zep memory.
|
||||
|
||||
### CONTEXT
|
||||
{context}
|
||||
|
||||
### VARIABLE RESOLUTION
|
||||
You can reference variables from previous blocks and environment variables:
|
||||
- **Block variables**: Use \`<block_name.field_name>\` syntax (e.g., \`<agent1.content>\`, \`<function1.result.response>\`)
|
||||
- **Environment variables**: Use \`{{ENV_VAR_NAME}}\` syntax
|
||||
|
||||
Do NOT wrap variable references in quotes for non-string values.
|
||||
|
||||
### CRITICAL INSTRUCTION
|
||||
Return ONLY a valid JSON array. Do not include any explanations, markdown formatting, comments, or additional text. Just the raw JSON array.
|
||||
|
||||
### MESSAGES GUIDELINES
|
||||
1. **Format**: Array of message objects with "role" and "content"
|
||||
2. **Roles**: "user", "assistant", "system"
|
||||
3. **Content**: The message text
|
||||
4. **Optional**: uuid, created_at, metadata, token_count
|
||||
|
||||
### EXAMPLES
|
||||
|
||||
**Single message**: "Add user message"
|
||||
→ [{"role": "user", "content": "Hello, how can you help me today?"}]
|
||||
|
||||
**Conversation**: "Add user and assistant exchange"
|
||||
→ [{"role": "user", "content": "What's the weather like?"}, {"role": "assistant", "content": "I don't have real-time weather data, but I can help you find a weather service."}]
|
||||
|
||||
**With variables**: "Add conversation from previous block"
|
||||
→ [{"role": "user", "content": <agent1.user_message>}, {"role": "assistant", "content": <agent1.assistant_response>}]
|
||||
|
||||
### REMEMBER
|
||||
Return ONLY valid JSON array - no explanations.`,
|
||||
placeholder: 'Describe the messages to add...',
|
||||
generationType: 'json-array',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'mode',
|
||||
|
||||
@@ -26,6 +26,7 @@ export type GenerationType =
|
||||
| 'typescript-function-body'
|
||||
| 'json-schema'
|
||||
| 'json-object'
|
||||
| 'json-array'
|
||||
| 'system-prompt'
|
||||
| 'custom-tool-schema'
|
||||
| 'sql-query'
|
||||
@@ -37,6 +38,15 @@ export type GenerationType =
|
||||
| 'mongodb-update'
|
||||
| 'neo4j-cypher'
|
||||
| 'neo4j-parameters'
|
||||
| 'elasticsearch-query'
|
||||
| 'elasticsearch-sort'
|
||||
| 'elasticsearch-bulk'
|
||||
| 'elasticsearch-mapping'
|
||||
| 'email-content'
|
||||
| 'message-content'
|
||||
| 'markdown-content'
|
||||
| 'html-content'
|
||||
| 'social-post'
|
||||
|
||||
export type SubBlockType =
|
||||
| 'short-input' // Single line input
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createLogger } from '@/lib/logs/console/logger'
|
||||
import type { BlockConfig } from '@/blocks/types'
|
||||
|
||||
const logger = createLogger('ResponseFormatUtils')
|
||||
|
||||
@@ -9,6 +10,117 @@ export interface Field {
|
||||
description?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates a subblock condition against current subblock values.
|
||||
* Used to determine if a schema subblock is active based on other field values (e.g., operation type).
|
||||
* @param condition - The condition configuration from SubBlockConfig
|
||||
* @param subBlockValues - Current values of all subblocks
|
||||
* @returns True if the condition is met or if there is no condition
|
||||
*/
|
||||
function evaluateSubBlockCondition(
|
||||
condition:
|
||||
| {
|
||||
field: string
|
||||
value: string | number | boolean | Array<string | number | boolean>
|
||||
not?: boolean
|
||||
and?: {
|
||||
field: string
|
||||
value: string | number | boolean | Array<string | number | boolean> | undefined
|
||||
not?: boolean
|
||||
}
|
||||
}
|
||||
| undefined,
|
||||
subBlockValues: Record<string, any>
|
||||
): boolean {
|
||||
if (!condition) return true
|
||||
|
||||
const fieldValue = subBlockValues[condition.field]?.value
|
||||
|
||||
let match: boolean
|
||||
if (Array.isArray(condition.value)) {
|
||||
match = condition.value.includes(fieldValue)
|
||||
} else {
|
||||
match = fieldValue === condition.value
|
||||
}
|
||||
|
||||
if (condition.not) {
|
||||
match = !match
|
||||
}
|
||||
|
||||
if (condition.and) {
|
||||
const andFieldValue = subBlockValues[condition.and.field]?.value
|
||||
let andMatch: boolean
|
||||
const andCondValue = condition.and.value
|
||||
|
||||
if (andCondValue === undefined) {
|
||||
andMatch = andFieldValue !== undefined && andFieldValue !== null && andFieldValue !== ''
|
||||
} else if (Array.isArray(andCondValue)) {
|
||||
andMatch = andCondValue.includes(andFieldValue)
|
||||
} else {
|
||||
andMatch = andFieldValue === andCondValue
|
||||
}
|
||||
|
||||
if (condition.and.not) {
|
||||
andMatch = !andMatch
|
||||
}
|
||||
|
||||
match = match && andMatch
|
||||
}
|
||||
|
||||
return match
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the active output schema subblock for a block.
|
||||
* Looks for subblocks with generationType 'json-schema' (in wandConfig) that have their conditions met.
|
||||
* This generalizes schema detection to work with any block that has a schema subblock
|
||||
* (e.g., Agent's responseFormat, Stagehand's schema/outputSchema).
|
||||
* @param blockConfig - The block configuration
|
||||
* @param subBlockValues - Current values of all subblocks (format: { subBlockId: { value: any } })
|
||||
* @returns The subblock ID and parsed schema value, or null if no active schema is found
|
||||
*/
|
||||
export function findActiveOutputSchema(
|
||||
blockConfig: BlockConfig | null | undefined,
|
||||
subBlockValues: Record<string, any>
|
||||
): { subBlockId: string; schema: any } | null {
|
||||
if (!blockConfig?.subBlocks) return null
|
||||
|
||||
// Known schema subblock IDs that define output structure
|
||||
// These are subblocks whose value defines what the block outputs
|
||||
const schemaSubBlockIds = ['responseFormat', 'schema', 'outputSchema']
|
||||
|
||||
for (const subBlock of blockConfig.subBlocks) {
|
||||
// Check if this is a known schema subblock
|
||||
if (!schemaSubBlockIds.includes(subBlock.id)) continue
|
||||
|
||||
// Check if it has json-schema generation type (either in wandConfig or directly)
|
||||
const hasJsonSchemaType =
|
||||
subBlock.wandConfig?.generationType === 'json-schema' ||
|
||||
subBlock.generationType === 'json-schema'
|
||||
|
||||
if (!hasJsonSchemaType) continue
|
||||
|
||||
// Evaluate the condition to see if this subblock is active
|
||||
const condition =
|
||||
typeof subBlock.condition === 'function' ? subBlock.condition() : subBlock.condition
|
||||
if (!evaluateSubBlockCondition(condition, subBlockValues)) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Get the value for this subblock
|
||||
const schemaValue = subBlockValues[subBlock.id]?.value
|
||||
if (!schemaValue) continue
|
||||
|
||||
// Parse the schema value
|
||||
const parsedSchema = parseResponseFormatSafely(schemaValue, subBlock.id)
|
||||
if (parsedSchema) {
|
||||
return { subBlockId: subBlock.id, schema: parsedSchema }
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to extract fields from JSON Schema
|
||||
* Handles both legacy format with fields array and new JSON Schema format
|
||||
|
||||
@@ -170,75 +170,20 @@ export const anthropicProvider: ProviderConfig = {
|
||||
}
|
||||
}
|
||||
|
||||
// If response format is specified, add strict formatting instructions
|
||||
if (request.responseFormat) {
|
||||
// Get the schema from the response format
|
||||
const schema = request.responseFormat.schema || request.responseFormat
|
||||
// Anthropic's structured outputs require the beta API and specific models
|
||||
const useNativeStructuredOutputs = !!(
|
||||
request.responseFormat &&
|
||||
(request.responseFormat.schema || request.responseFormat)
|
||||
)
|
||||
|
||||
// Build a system prompt for structured output based on the JSON schema
|
||||
let schemaInstructions = ''
|
||||
// Get the schema for structured outputs
|
||||
const outputSchema = request.responseFormat?.schema || request.responseFormat
|
||||
|
||||
if (schema?.properties) {
|
||||
// Create a template of the expected JSON structure
|
||||
const jsonTemplate = Object.entries(schema.properties).reduce(
|
||||
(acc: Record<string, any>, [key, prop]: [string, any]) => {
|
||||
let exampleValue
|
||||
const propType = prop.type || 'string'
|
||||
|
||||
// Generate appropriate example values based on type
|
||||
switch (propType) {
|
||||
case 'string':
|
||||
exampleValue = '"value"'
|
||||
break
|
||||
case 'number':
|
||||
exampleValue = '0'
|
||||
break
|
||||
case 'boolean':
|
||||
exampleValue = 'true'
|
||||
break
|
||||
case 'array':
|
||||
exampleValue = '[]'
|
||||
break
|
||||
case 'object':
|
||||
exampleValue = '{}'
|
||||
break
|
||||
default:
|
||||
exampleValue = '"value"'
|
||||
}
|
||||
|
||||
acc[key] = exampleValue
|
||||
return acc
|
||||
},
|
||||
{}
|
||||
)
|
||||
|
||||
// Generate field descriptions
|
||||
const fieldDescriptions = Object.entries(schema.properties)
|
||||
.map(([key, prop]: [string, any]) => {
|
||||
const type = prop.type || 'string'
|
||||
const description = prop.description ? `: ${prop.description}` : ''
|
||||
return `${key} (${type})${description}`
|
||||
})
|
||||
.join('\n')
|
||||
|
||||
// Format the JSON template as a string
|
||||
const jsonTemplateStr = JSON.stringify(jsonTemplate, null, 2)
|
||||
|
||||
schemaInstructions = `
|
||||
IMPORTANT RESPONSE FORMAT INSTRUCTIONS:
|
||||
1. Your response must be EXACTLY in this format, with no additional fields:
|
||||
${jsonTemplateStr}
|
||||
|
||||
Field descriptions:
|
||||
${fieldDescriptions}
|
||||
|
||||
2. DO NOT include any explanatory text before or after the JSON
|
||||
3. DO NOT wrap the response in an array
|
||||
4. DO NOT add any fields not specified in the schema
|
||||
5. Your response MUST be valid JSON and include all the specified fields with their correct types`
|
||||
}
|
||||
|
||||
systemPrompt = `${systemPrompt}${schemaInstructions}`
|
||||
if (useNativeStructuredOutputs) {
|
||||
logger.info('Using Anthropic native structured outputs', {
|
||||
hasSchema: !!outputSchema,
|
||||
schemaProperties: outputSchema?.properties ? Object.keys(outputSchema.properties) : [],
|
||||
})
|
||||
}
|
||||
|
||||
// Build the request payload
|
||||
@@ -262,6 +207,47 @@ ${fieldDescriptions}
|
||||
// Check if we should stream tool calls (default: false for chat, true for copilot)
|
||||
const shouldStreamToolCalls = request.streamToolCalls ?? false
|
||||
|
||||
/**
|
||||
* Helper function to make Anthropic API calls with optional structured outputs support.
|
||||
* Uses the beta API when structured outputs are requested.
|
||||
*/
|
||||
const makeAnthropicRequest = async (requestPayload: any, streaming = false) => {
|
||||
if (useNativeStructuredOutputs && outputSchema) {
|
||||
// Ensure the schema has additionalProperties: false (required by Anthropic)
|
||||
const preparedSchema = {
|
||||
...outputSchema,
|
||||
additionalProperties: false,
|
||||
}
|
||||
|
||||
// Use beta API with structured outputs
|
||||
const betaPayload = {
|
||||
...requestPayload,
|
||||
betas: ['structured-outputs-2025-11-13'],
|
||||
output_format: {
|
||||
type: 'json_schema',
|
||||
schema: preparedSchema,
|
||||
},
|
||||
stream: streaming,
|
||||
}
|
||||
|
||||
logger.info('Making Anthropic beta API call with structured outputs', {
|
||||
model: betaPayload.model,
|
||||
hasOutputFormat: true,
|
||||
streaming,
|
||||
schemaType: preparedSchema.type,
|
||||
schemaProperties: preparedSchema.properties ? Object.keys(preparedSchema.properties) : [],
|
||||
})
|
||||
|
||||
return anthropic.beta.messages.create(betaPayload)
|
||||
}
|
||||
|
||||
// Use regular API
|
||||
return anthropic.messages.create({
|
||||
...requestPayload,
|
||||
stream: streaming,
|
||||
})
|
||||
}
|
||||
|
||||
// EARLY STREAMING: if caller requested streaming and there are no tools to execute,
|
||||
// we can directly stream the completion.
|
||||
if (request.stream && (!anthropicTools || anthropicTools.length === 0)) {
|
||||
@@ -272,10 +258,7 @@ ${fieldDescriptions}
|
||||
const providerStartTimeISO = new Date(providerStartTime).toISOString()
|
||||
|
||||
// Create a streaming request
|
||||
const streamResponse: any = await anthropic.messages.create({
|
||||
...payload,
|
||||
stream: true,
|
||||
})
|
||||
const streamResponse: any = await makeAnthropicRequest(payload, true)
|
||||
|
||||
// Start collecting token usage
|
||||
const tokenUsage = {
|
||||
@@ -348,9 +331,15 @@ ${fieldDescriptions}
|
||||
const forcedTools = preparedTools?.forcedTools || []
|
||||
let usedForcedTools: string[] = []
|
||||
|
||||
let currentResponse = await anthropic.messages.create(payload)
|
||||
let currentResponse = (await makeAnthropicRequest(payload, false)) as Anthropic.Message
|
||||
const firstResponseTime = Date.now() - initialCallTime
|
||||
|
||||
logger.info('Anthropic initial response received', {
|
||||
stopReason: currentResponse.stop_reason,
|
||||
contentTypes: currentResponse.content.map((c) => c.type),
|
||||
hasStructuredOutput: useNativeStructuredOutputs,
|
||||
})
|
||||
|
||||
let content = ''
|
||||
|
||||
// Extract text content from the message
|
||||
@@ -573,7 +562,7 @@ ${fieldDescriptions}
|
||||
const nextModelStartTime = Date.now()
|
||||
|
||||
// Make the next request
|
||||
currentResponse = await anthropic.messages.create(nextPayload)
|
||||
currentResponse = (await makeAnthropicRequest(nextPayload, false)) as Anthropic.Message
|
||||
|
||||
// Check if any forced tools were used in this response
|
||||
checkForForcedToolUsage(currentResponse, nextPayload.tool_choice)
|
||||
@@ -619,8 +608,12 @@ ${fieldDescriptions}
|
||||
throw error
|
||||
}
|
||||
|
||||
// If the content looks like it contains JSON, extract just the JSON part
|
||||
if (content.includes('{') && content.includes('}')) {
|
||||
if (useNativeStructuredOutputs) {
|
||||
logger.info('Anthropic structured output content', {
|
||||
contentLength: content.length,
|
||||
contentPreview: content.substring(0, 200),
|
||||
})
|
||||
} else if (content.includes('{') && content.includes('}')) {
|
||||
try {
|
||||
const jsonMatch = content.match(/\{[\s\S]*\}/m)
|
||||
if (jsonMatch) {
|
||||
@@ -703,9 +696,15 @@ ${fieldDescriptions}
|
||||
const forcedTools = preparedTools?.forcedTools || []
|
||||
let usedForcedTools: string[] = []
|
||||
|
||||
let currentResponse = await anthropic.messages.create(payload)
|
||||
let currentResponse = (await makeAnthropicRequest(payload, false)) as Anthropic.Message
|
||||
const firstResponseTime = Date.now() - initialCallTime
|
||||
|
||||
logger.info('Anthropic initial response received (non-streaming path)', {
|
||||
stopReason: currentResponse.stop_reason,
|
||||
contentTypes: currentResponse.content.map((c) => c.type),
|
||||
hasStructuredOutput: useNativeStructuredOutputs,
|
||||
})
|
||||
|
||||
let content = ''
|
||||
|
||||
// Extract text content from the message
|
||||
@@ -923,7 +922,7 @@ ${fieldDescriptions}
|
||||
const nextModelStartTime = Date.now()
|
||||
|
||||
// Make the next request
|
||||
currentResponse = await anthropic.messages.create(nextPayload)
|
||||
currentResponse = (await makeAnthropicRequest(nextPayload, false)) as Anthropic.Message
|
||||
|
||||
// Check if any forced tools were used in this response
|
||||
checkForForcedToolUsage(currentResponse, nextPayload.tool_choice)
|
||||
@@ -968,8 +967,12 @@ ${fieldDescriptions}
|
||||
throw error
|
||||
}
|
||||
|
||||
// If the content looks like it contains JSON, extract just the JSON part
|
||||
if (content.includes('{') && content.includes('}')) {
|
||||
if (useNativeStructuredOutputs) {
|
||||
logger.info('Anthropic structured output content (non-streaming path)', {
|
||||
contentLength: content.length,
|
||||
contentPreview: content.substring(0, 200),
|
||||
})
|
||||
} else if (content.includes('{') && content.includes('}')) {
|
||||
try {
|
||||
const jsonMatch = content.match(/\{[\s\S]*\}/m)
|
||||
if (jsonMatch) {
|
||||
@@ -995,13 +998,12 @@ ${fieldDescriptions}
|
||||
...payload,
|
||||
messages: currentMessages,
|
||||
// For Anthropic, omit tool_choice entirely rather than setting it to 'none'
|
||||
stream: true,
|
||||
}
|
||||
|
||||
// Remove the tool_choice parameter as Anthropic doesn't accept 'none' as a string value
|
||||
streamingPayload.tool_choice = undefined
|
||||
|
||||
const streamResponse: any = await anthropic.messages.create(streamingPayload)
|
||||
const streamResponse: any = await makeAnthropicRequest(streamingPayload, true)
|
||||
|
||||
// Create a StreamingExecution response with all collected data
|
||||
const streamingResult = {
|
||||
|
||||
Reference in New Issue
Block a user