Add Activepieces integration for workflow automation

- Add Activepieces fork with SmoothSchedule custom piece
- Create integrations app with Activepieces service layer
- Add embed token endpoint for iframe integration
- Create Automations page with embedded workflow builder
- Add sidebar visibility fix for embed mode
- Add list inactive customers endpoint to Public API
- Include SmoothSchedule triggers: event created/updated/cancelled
- Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-18 22:59:37 -05:00
parent 9848268d34
commit 3aa7199503
16292 changed files with 1284892 additions and 4708 deletions

View File

@@ -0,0 +1,33 @@
{
"extends": [
"../../../../.eslintrc.base.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
}
]
}

View File

@@ -0,0 +1,7 @@
# pieces-manus
This library was generated with [Nx](https://nx.dev).
## Building
Run `nx build pieces-manus` to build the library.

View File

@@ -0,0 +1,10 @@
{
"name": "@activepieces/piece-manus",
"version": "0.0.1",
"type": "commonjs",
"main": "./src/index.js",
"types": "./src/index.d.ts",
"dependencies": {
"tslib": "^2.3.0"
}
}

View File

@@ -0,0 +1,65 @@
{
"name": "pieces-manus",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/pieces/community/manus/src",
"projectType": "library",
"release": {
"version": {
"manifestRootsToUpdate": [
"dist/{projectRoot}"
],
"currentVersionResolver": "git-tag",
"fallbackCurrentVersionResolver": "disk"
}
},
"tags": [],
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": [
"{options.outputPath}"
],
"options": {
"outputPath": "dist/packages/pieces/community/manus",
"tsConfig": "packages/pieces/community/manus/tsconfig.lib.json",
"packageJson": "packages/pieces/community/manus/package.json",
"main": "packages/pieces/community/manus/src/index.ts",
"assets": [
"packages/pieces/community/manus/*.md",
{
"input": "packages/pieces/community/manus/src/i18n",
"output": "./src/i18n",
"glob": "**/!(i18n.json)"
}
],
"buildableProjectDepsInPackageJsonType": "dependencies",
"updateBuildableProjectDepsInPackageJson": true
},
"dependsOn": [
"prebuild",
"^build"
]
},
"nx-release-publish": {
"options": {
"packageRoot": "dist/{projectRoot}"
}
},
"prebuild": {
"dependsOn": [
"^build"
],
"executor": "nx:run-commands",
"options": {
"cwd": "packages/pieces/community/manus",
"command": "bun install --no-save --silent"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": [
"{options.outputFile}"
]
}
}
}

View File

@@ -0,0 +1,68 @@
{
"AI-powered automation and task execution platform": "AI-powered automation and task execution platform",
"Your Manus API key from https://app.manus.ai/settings/api-keys": "Your Manus API key from https://app.manus.ai/settings/api-keys",
"Create Task": "Create Task",
"Get Task": "Get Task",
"Update Task": "Update Task",
"Delete Task": "Delete Task",
"Custom API Call": "Custom API Call",
"Create a new task for Manus AI to execute": "Create a new task for Manus AI to execute",
"Retrieve detailed information about a specific task by its ID": "Retrieve detailed information about a specific task by its ID",
"Update a task's metadata such as title, sharing settings, and visibility in the task list": "Update a task's metadata such as title, sharing settings, and visibility in the task list",
"Permanently delete a task by its ID. This action cannot be undone.": "Permanently delete a task by its ID. This action cannot be undone.",
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
"Prompt": "Prompt",
"Agent Profile": "Agent Profile",
"Task Mode": "Task Mode",
"Connectors": "Connectors",
"Hide in Task List": "Hide in Task List",
"Create Shareable Link": "Create Shareable Link",
"Task ID": "Task ID",
"Locale": "Locale",
"Attachments": "Attachments",
"Task": "Task",
"Title": "Title",
"Enable Sharing": "Enable Sharing",
"Visible in Task List": "Visible in Task List",
"Method": "Method",
"Headers": "Headers",
"Query Parameters": "Query Parameters",
"Body": "Body",
"Response is Binary ?": "Response is Binary ?",
"No Error on Failure": "No Error on Failure",
"Timeout (in seconds)": "Timeout (in seconds)",
"The task prompt or instruction for the Manus agent": "The task prompt or instruction for the Manus agent",
"The AI model profile to use for the task": "The AI model profile to use for the task",
"The interaction mode for the task": "The interaction mode for the task",
"List of connector IDs to enable for this task": "List of connector IDs to enable for this task",
"Whether to hide this task from the Manus webapp task list": "Whether to hide this task from the Manus webapp task list",
"Whether to make the chat publicly accessible to others on the Manus website": "Whether to make the chat publicly accessible to others on the Manus website",
"For continuing existing tasks (multi-turn conversations)": "For continuing existing tasks (multi-turn conversations)",
"Your default locale that you've set on Manus (e.g., \"en-US\", \"zh-CN\")": "Your default locale that you've set on Manus (e.g., \"en-US\", \"zh-CN\")",
"Array of file/image attachments (URLs or base64 data)": "Array of file/image attachments (URLs or base64 data)",
"Select the task to retrieve details for": "Select the task to retrieve details for",
"Select the task to update": "Select the task to update",
"New title for the task": "New title for the task",
"Whether to enable public sharing": "Whether to enable public sharing",
"Whether the task should be visible in the task list": "Whether the task should be visible in the task list",
"Select the task to delete": "Select the task to delete",
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
"Manus 1.5 (Recommended)": "Manus 1.5 (Recommended)",
"Manus 1.5 Lite (Faster)": "Manus 1.5 Lite (Faster)",
"Speed (Deprecated)": "Speed (Deprecated)",
"Quality (Deprecated)": "Quality (Deprecated)",
"Chat": "Chat",
"Adaptive": "Adaptive",
"Agent": "Agent",
"GET": "GET",
"POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
"HEAD": "HEAD",
"New Task Created": "New Task Created",
"Task Stopped": "Task Stopped",
"Triggers when a new task is successfully created in Manus": "Triggers when a new task is successfully created in Manus",
"Triggers when a task reaches a stopping point - either completion or requiring user input": "Triggers when a task reaches a stopping point - either completion or requiring user input"
}

View File

@@ -0,0 +1,39 @@
import { createPiece } from "@activepieces/pieces-framework";
import { createCustomApiCallAction } from "@activepieces/pieces-common";
import { PieceCategory } from "@activepieces/shared";
import { manusAuth } from "./lib/common/auth";
import { createTask } from "./lib/actions/create-task";
import { getTask } from "./lib/actions/get-task";
import { updateTask } from "./lib/actions/update-task";
import { deleteTask } from "./lib/actions/delete-task";
import { newTaskCreated } from "./lib/triggers/new-task-created";
import { taskStopped } from "./lib/triggers/task-stopped";
export const manus = createPiece({
displayName: "Manus",
description: "AI-powered automation and task execution platform",
auth: manusAuth,
minimumSupportedRelease: '0.36.1',
logoUrl: "https://cdn.activepieces.com/pieces/manus.png",
categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],
authors: ["onyedikachi-david"],
actions: [
createTask,
getTask,
updateTask,
deleteTask,
createCustomApiCallAction({
baseUrl: () => 'https://api.manus.ai/v1',
auth: manusAuth,
authMapping: async (auth) => ({
API_KEY: auth.secret_text,
}),
}),
],
triggers: [
newTaskCreated,
taskStopped,
],
});

View File

@@ -0,0 +1,137 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { manusAuth } from '../common/auth';
export const createTask = createAction({
name: 'create_task',
auth: manusAuth,
displayName: 'Create Task',
description: 'Create a new task for Manus AI to execute',
props: {
prompt: Property.LongText({
displayName: 'Prompt',
description: 'The task prompt or instruction for the Manus agent',
required: true,
}),
agentProfile: Property.StaticDropdown({
displayName: 'Agent Profile',
description: 'The AI model profile to use for the task',
required: true,
defaultValue: 'manus-1.5',
options: {
options: [
{
label: 'Manus 1.5 (Recommended)',
value: 'manus-1.5',
},
{
label: 'Manus 1.5 Lite (Faster)',
value: 'manus-1.5-lite',
},
{
label: 'Speed (Deprecated)',
value: 'speed',
},
{
label: 'Quality (Deprecated)',
value: 'quality',
},
],
},
}),
taskMode: Property.StaticDropdown({
displayName: 'Task Mode',
description: 'The interaction mode for the task',
required: false,
options: {
options: [
{
label: 'Chat',
value: 'chat',
},
{
label: 'Adaptive',
value: 'adaptive',
},
{
label: 'Agent',
value: 'agent',
},
],
},
}),
connectors: Property.Array({
displayName: 'Connectors',
description: 'List of connector IDs to enable for this task',
required: false,
}),
hideInTaskList: Property.Checkbox({
displayName: 'Hide in Task List',
description: 'Whether to hide this task from the Manus webapp task list',
required: false,
defaultValue: false,
}),
createShareableLink: Property.Checkbox({
displayName: 'Create Shareable Link',
description: 'Whether to make the chat publicly accessible to others on the Manus website',
required: false,
defaultValue: false,
}),
taskId: Property.ShortText({
displayName: 'Task ID',
description: 'For continuing existing tasks (multi-turn conversations)',
required: false,
}),
locale: Property.ShortText({
displayName: 'Locale',
description: 'Your default locale that you\'ve set on Manus (e.g., "en-US", "zh-CN")',
required: false,
}),
attachments: Property.Array({
displayName: 'Attachments',
description: 'Array of file/image attachments (URLs or base64 data)',
required: false,
}),
},
async run(context) {
const body: Record<string, any> = {
prompt: context.propsValue['prompt'],
agentProfile: context.propsValue['agentProfile'],
};
if (context.propsValue['taskMode']) {
body['taskMode'] = context.propsValue['taskMode'];
}
if (context.propsValue['connectors'] && context.propsValue['connectors'].length > 0) {
body['connectors'] = context.propsValue['connectors'];
}
if (context.propsValue['hideInTaskList'] !== undefined) {
body['hideInTaskList'] = context.propsValue['hideInTaskList'];
}
if (context.propsValue['createShareableLink'] !== undefined) {
body['createShareableLink'] = context.propsValue['createShareableLink'];
}
if (context.propsValue['taskId']) {
body['taskId'] = context.propsValue['taskId'];
}
if (context.propsValue['locale']) {
body['locale'] = context.propsValue['locale'];
}
if (context.propsValue['attachments'] && context.propsValue['attachments'].length > 0) {
body['attachments'] = context.propsValue['attachments'];
}
const response = await httpClient.sendRequest({
method: HttpMethod.POST,
url: 'https://api.manus.ai/v1/tasks',
headers: {
'accept': 'application/json',
'content-type': 'application/json',
'API_KEY': context.auth.secret_text,
},
body,
});
return response.body;
},
});

View File

@@ -0,0 +1,61 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { manusAuth } from '../common/auth';
async function getTasksDropdown(auth: string): Promise<{ label: string; value: string }[]> {
try {
const response = await httpClient.sendRequest({
method: HttpMethod.GET,
url: 'https://api.manus.ai/v1/tasks',
headers: {
'accept': 'application/json',
'API_KEY': auth,
},
queryParams: {
limit: '50',
order: 'desc',
orderBy: 'created_at',
},
});
const tasks = response.body?.data || [];
return tasks.map((task: any) => ({
label: `${task.instructions?.substring(0, 50) || 'Untitled Task'} (${task.status})`,
value: task.id,
}));
} catch (error) {
return [];
}
}
export const deleteTask = createAction({
name: 'delete_task',
auth: manusAuth,
displayName: 'Delete Task',
description: 'Permanently delete a task by its ID. This action cannot be undone.',
props: {
taskId: Property.Dropdown({
auth: manusAuth,
displayName: 'Task',
description: 'Select the task to delete',
required: true,
refreshers: ['auth'],
options: async ({ auth }) => {
if (!auth) return { disabled: true, options: [], placeholder: 'Connect account first' };
return { disabled: false, options: await getTasksDropdown(auth.secret_text) };
},
}),
},
async run(context) {
const response = await httpClient.sendRequest({
method: HttpMethod.DELETE,
url: `https://api.manus.ai/v1/tasks/${context.propsValue['taskId']}`,
headers: {
'accept': 'application/json',
'API_KEY': context.auth.secret_text,
},
});
return response.body;
},
});

View File

@@ -0,0 +1,61 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { manusAuth } from '../common/auth';
async function getTasksDropdown(auth: string): Promise<{ label: string; value: string }[]> {
try {
const response = await httpClient.sendRequest({
method: HttpMethod.GET,
url: 'https://api.manus.ai/v1/tasks',
headers: {
'accept': 'application/json',
'API_KEY': auth,
},
queryParams: {
limit: '50',
order: 'desc',
orderBy: 'created_at',
},
});
const tasks = response.body?.data || [];
return tasks.map((task: any) => ({
label: `${task.instructions?.substring(0, 50) || 'Untitled Task'} (${task.status})`,
value: task.id,
}));
} catch (error) {
return [];
}
}
export const getTask = createAction({
name: 'get_task',
auth: manusAuth,
displayName: 'Get Task',
description: 'Retrieve detailed information about a specific task by its ID',
props: {
taskId: Property.Dropdown({
auth: manusAuth,
displayName: 'Task',
description: 'Select the task to retrieve details for',
required: true,
refreshers: ['auth'],
options: async ({ auth }) => {
if (!auth) return { disabled: true, options: [], placeholder: 'Connect account first' };
return { disabled: false, options: await getTasksDropdown(auth.secret_text) };
},
}),
},
async run(context) {
const response = await httpClient.sendRequest({
method: HttpMethod.GET,
url: `https://api.manus.ai/v1/tasks/${context.propsValue['taskId']}`,
headers: {
'accept': 'application/json',
'API_KEY': context.auth.secret_text,
},
});
return response.body;
},
});

View File

@@ -0,0 +1,92 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { manusAuth } from '../common/auth';
async function getTasksDropdown(auth: string): Promise<{ label: string; value: string }[]> {
try {
const response = await httpClient.sendRequest({
method: HttpMethod.GET,
url: 'https://api.manus.ai/v1/tasks',
headers: {
'accept': 'application/json',
'API_KEY': auth,
},
queryParams: {
limit: '50',
order: 'desc',
orderBy: 'created_at',
},
});
const tasks = response.body?.data || [];
return tasks.map((task: any) => ({
label: `${task.instructions?.substring(0, 50) || 'Untitled Task'} (${task.status})`,
value: task.id,
}));
} catch (error) {
return [];
}
}
export const updateTask = createAction({
name: 'update_task',
auth: manusAuth,
displayName: 'Update Task',
description: 'Update a task\'s metadata such as title, sharing settings, and visibility in the task list',
props: {
taskId: Property.Dropdown({
auth: manusAuth,
displayName: 'Task',
description: 'Select the task to update',
required: true,
refreshers: ['auth'],
options: async ({ auth }) => {
if (!auth) return { disabled: true, options: [], placeholder: 'Connect account first' };
return { disabled: false, options: await getTasksDropdown(auth.secret_text) };
},
}),
title: Property.ShortText({
displayName: 'Title',
description: 'New title for the task',
required: false,
}),
enableShared: Property.Checkbox({
displayName: 'Enable Sharing',
description: 'Whether to enable public sharing',
required: false,
defaultValue: false,
}),
enableVisibleInTaskList: Property.Checkbox({
displayName: 'Visible in Task List',
description: 'Whether the task should be visible in the task list',
required: false,
defaultValue: true,
}),
},
async run(context) {
const body: Record<string, any> = {};
if (context.propsValue['title']) {
body['title'] = context.propsValue['title'];
}
if (context.propsValue['enableShared'] !== undefined) {
body['enableShared'] = context.propsValue['enableShared'];
}
if (context.propsValue['enableVisibleInTaskList'] !== undefined) {
body['enableVisibleInTaskList'] = context.propsValue['enableVisibleInTaskList'];
}
const response = await httpClient.sendRequest({
method: HttpMethod.PUT,
url: `https://api.manus.ai/v1/tasks/${context.propsValue['taskId']}`,
headers: {
'accept': 'application/json',
'content-type': 'application/json',
'API_KEY': context.auth.secret_text,
},
body,
});
return response.body;
},
});

View File

@@ -0,0 +1,33 @@
import { PieceAuth } from '@activepieces/pieces-framework';
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
export const manusAuth = PieceAuth.SecretText({
displayName: 'API Key',
description: 'Your Manus API key from https://app.manus.ai/settings/api-keys',
required: true,
validate: async ({ auth }) => {
try {
await httpClient.sendRequest({
url: 'https://api.manus.ai/v1/tasks',
method: HttpMethod.POST,
headers: {
'accept': 'application/json',
'content-type': 'application/json',
'API_KEY': auth as string,
},
body: {
prompt: 'test',
mode: 'speed'
},
});
return {
valid: true,
};
} catch (error) {
return {
valid: false,
error: 'Invalid API key',
};
}
},
});

View File

@@ -0,0 +1,74 @@
import {
createTrigger,
TriggerStrategy,
} from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { manusAuth } from '../common/auth';
export const newTaskCreated = createTrigger({
name: 'new_task_created',
displayName: 'New Task Created',
description: 'Triggers when a new task is successfully created in Manus',
props: {},
auth: manusAuth,
sampleData: {
event_id: "task_created_task_abc123",
event_type: "task_created",
task_detail: {
task_id: "task_abc123",
task_title: "Generate quarterly sales report",
task_url: "https://manus.im/app/task_abc123"
},
},
type: TriggerStrategy.WEBHOOK,
async onEnable({ webhookUrl, store, auth }) {
try {
const response = await httpClient.sendRequest({
method: HttpMethod.POST,
url: 'https://api.manus.ai/v1/webhooks',
headers: {
'accept': 'application/json',
'content-type': 'application/json',
'API_KEY': auth.secret_text,
},
body: {
webhook: {
url: webhookUrl,
},
},
});
const webhookId = response.body.webhook_id;
await store.put('webhook_id', webhookId);
await store.put('webhook_url', webhookUrl);
} catch (error) {
throw new Error(`Failed to create webhook: ${error}`);
}
},
async onDisable({ store, auth }) {
try {
const webhookId = await store.get('webhook_id');
if (webhookId) {
await httpClient.sendRequest({
method: HttpMethod.DELETE,
url: `https://api.manus.ai/v1/webhooks/${webhookId}`,
headers: {
'accept': 'application/json',
'API_KEY': auth.secret_text,
},
});
}
} catch (error) {
console.error('Failed to delete webhook:', error);
}
},
async run(context) {
const payload = context.payload.body as any;
if (!payload || payload.event_type !== 'task_created') {
return [];
}
return [payload];
},
});

View File

@@ -0,0 +1,83 @@
import {
createTrigger,
TriggerStrategy,
} from '@activepieces/pieces-framework';
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
import { manusAuth } from '../common/auth';
export const taskStopped = createTrigger({
name: 'task_stopped',
displayName: 'Task Stopped',
description: 'Triggers when a task reaches a stopping point - either completion or requiring user input',
props: {},
auth: manusAuth,
sampleData: {
event_id: "task_stopped_task_abc123",
event_type: "task_stopped",
task_detail: {
task_id: "task_abc123",
task_title: "Generate quarterly sales report",
task_url: "https://manus.im/app/task_abc123",
message: "I've completed the quarterly sales report analysis...",
attachments: [
{
file_name: "q4-sales-report.pdf",
url: "https://s3.amazonaws.com/manus-files/reports/q4-sales-report.pdf",
size_bytes: 2048576
}
],
stop_reason: "finish"
}
},
type: TriggerStrategy.WEBHOOK,
async onEnable({ webhookUrl, store, auth }) {
try {
const response = await httpClient.sendRequest({
method: HttpMethod.POST,
url: 'https://api.manus.ai/v1/webhooks',
headers: {
'accept': 'application/json',
'content-type': 'application/json',
'API_KEY': auth.secret_text,
},
body: {
webhook: {
url: webhookUrl,
},
},
});
const webhookId = response.body.webhook_id;
await store.put('webhook_id', webhookId);
await store.put('webhook_url', webhookUrl);
} catch (error) {
throw new Error(`Failed to create webhook: ${error}`);
}
},
async onDisable({ store, auth }) {
try {
const webhookId = await store.get('webhook_id');
if (webhookId) {
await httpClient.sendRequest({
method: HttpMethod.DELETE,
url: `https://api.manus.ai/v1/webhooks/${webhookId}`,
headers: {
'accept': 'application/json',
'API_KEY': auth.secret_text,
},
});
}
} catch (error) {
console.error('Failed to delete webhook:', error);
}
},
async run(context) {
const payload = context.payload.body as any;
if (!payload || payload.event_type !== 'task_stopped') {
return [];
}
return [payload];
},
});

View File

@@ -0,0 +1,20 @@
{
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"importHelpers": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noPropertyAccessFromIndexSignature": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
}

View File

@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"]
}