d25d482dc2
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
193 lines
4.6 KiB
TypeScript
193 lines
4.6 KiB
TypeScript
import type { WorkflowSearchWorkflow } from '@/lib/workflows/search-replace/types'
|
|
import type { SubBlockConfig } from '@/blocks/types'
|
|
|
|
export const SEARCH_REPLACE_BLOCK_CONFIGS: Record<string, { subBlocks: SubBlockConfig[] }> = {
|
|
agent: {
|
|
subBlocks: [
|
|
{ id: 'systemPrompt', title: 'System Prompt', type: 'long-input' },
|
|
{
|
|
id: 'credential',
|
|
title: 'Credential',
|
|
type: 'oauth-input',
|
|
serviceId: 'gmail',
|
|
canonicalParamId: 'oauthCredential',
|
|
},
|
|
{
|
|
id: 'label',
|
|
title: 'Label',
|
|
type: 'folder-selector',
|
|
selectorKey: 'gmail.labels',
|
|
dependsOn: ['credential'],
|
|
},
|
|
],
|
|
},
|
|
knowledge: {
|
|
subBlocks: [
|
|
{
|
|
id: 'knowledgeBaseIds',
|
|
title: 'Knowledge Bases',
|
|
type: 'knowledge-base-selector',
|
|
canonicalParamId: 'knowledgeBaseId',
|
|
},
|
|
{
|
|
id: 'documentId',
|
|
title: 'Document',
|
|
type: 'document-selector',
|
|
serviceId: 'knowledge',
|
|
selectorKey: 'knowledge.documents',
|
|
dependsOn: ['knowledgeBaseIds'],
|
|
},
|
|
],
|
|
},
|
|
api: {
|
|
subBlocks: [
|
|
{ id: 'body', title: 'Body', type: 'code' },
|
|
{ id: 'headers', title: 'Headers', type: 'table' },
|
|
],
|
|
},
|
|
slack: {
|
|
subBlocks: [
|
|
{
|
|
id: 'authMethod',
|
|
title: 'Authentication Method',
|
|
type: 'dropdown',
|
|
},
|
|
{
|
|
id: 'credential',
|
|
title: 'Slack Account',
|
|
type: 'oauth-input',
|
|
serviceId: 'slack',
|
|
canonicalParamId: 'oauthCredential',
|
|
condition: { field: 'authMethod', value: 'oauth' },
|
|
},
|
|
{
|
|
id: 'text',
|
|
title: 'Message',
|
|
type: 'long-input',
|
|
},
|
|
{
|
|
id: 'channel',
|
|
title: 'Channel',
|
|
type: 'channel-selector',
|
|
serviceId: 'slack',
|
|
selectorKey: 'slack.channels',
|
|
dependsOn: ['credential'],
|
|
},
|
|
{
|
|
id: 'attachmentFiles',
|
|
title: 'Attachments',
|
|
type: 'file-upload',
|
|
canonicalParamId: 'files',
|
|
condition: { field: 'operation', value: 'send' },
|
|
mode: 'basic',
|
|
},
|
|
],
|
|
},
|
|
workflow_input: {
|
|
subBlocks: [
|
|
{
|
|
id: 'workflowId',
|
|
title: 'Workflow',
|
|
type: 'workflow-selector',
|
|
selectorKey: 'sim.workflows',
|
|
},
|
|
{
|
|
id: 'inputMapping',
|
|
title: 'Inputs',
|
|
type: 'input-mapping',
|
|
dependsOn: ['workflowId'],
|
|
},
|
|
],
|
|
},
|
|
}
|
|
|
|
export function createSearchReplaceWorkflowFixture(): WorkflowSearchWorkflow {
|
|
return {
|
|
blocks: {
|
|
'agent-1': {
|
|
id: 'agent-1',
|
|
type: 'agent',
|
|
name: 'Agent 1',
|
|
position: { x: 0, y: 0 },
|
|
enabled: true,
|
|
outputs: {},
|
|
subBlocks: {
|
|
systemPrompt: {
|
|
id: 'systemPrompt',
|
|
type: 'long-input',
|
|
value: 'Email {{OLD_SECRET}} and then email again. Use <start.output>.',
|
|
},
|
|
credential: {
|
|
id: 'credential',
|
|
type: 'oauth-input',
|
|
value: 'gmail-credential-old',
|
|
},
|
|
label: {
|
|
id: 'label',
|
|
type: 'folder-selector',
|
|
value: 'INBOX',
|
|
},
|
|
},
|
|
},
|
|
'knowledge-1': {
|
|
id: 'knowledge-1',
|
|
type: 'knowledge',
|
|
name: 'Knowledge 1',
|
|
position: { x: 200, y: 0 },
|
|
enabled: true,
|
|
outputs: {},
|
|
subBlocks: {
|
|
knowledgeBaseIds: {
|
|
id: 'knowledgeBaseIds',
|
|
type: 'knowledge-base-selector',
|
|
value: 'kb-old,kb-second',
|
|
},
|
|
documentId: {
|
|
id: 'documentId',
|
|
type: 'document-selector',
|
|
value: 'doc-old',
|
|
},
|
|
},
|
|
},
|
|
'api-1': {
|
|
id: 'api-1',
|
|
type: 'api',
|
|
name: 'API 1',
|
|
position: { x: 400, y: 0 },
|
|
enabled: true,
|
|
outputs: {},
|
|
subBlocks: {
|
|
body: {
|
|
id: 'body',
|
|
type: 'code',
|
|
value: { content: 'email in nested body' },
|
|
},
|
|
headers: {
|
|
id: 'headers',
|
|
type: 'table',
|
|
value: [
|
|
{ id: 'row-1', cells: { Key: 'Authorization', Value: 'Bearer {{OLD_SECRET}}' } },
|
|
],
|
|
},
|
|
},
|
|
},
|
|
'locked-1': {
|
|
id: 'locked-1',
|
|
type: 'agent',
|
|
name: 'Locked Agent',
|
|
position: { x: 600, y: 0 },
|
|
enabled: true,
|
|
locked: true,
|
|
outputs: {},
|
|
subBlocks: {
|
|
systemPrompt: {
|
|
id: 'systemPrompt',
|
|
type: 'long-input',
|
|
value: 'email from locked block',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|