Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(file-helper): ui improvement (#16613)

Talal Jaber8c6ff7f8575d
diff --git a/bun.lock b/bun.lock
index 51faa261eda..7bdeb4b7046 100644
--- a/bun.lock
+++ b/bun.lock
@@ -10579,7 +10579,7 @@
},
"packages/pieces/core/file-helper": {
"name": "@activepieces/piece-file-helper",
- "version": "0.2.0",
+ "version": "0.3.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
diff --git a/packages/pieces/core/file-helper/package.json b/packages/pieces/core/file-helper/package.json
index 12acc90c0c2..35dc7680567 100644
--- a/packages/pieces/core/file-helper/package.json
+++ b/packages/pieces/core/file-helper/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-file-helper",
- "version": "0.2.0",
+ "version": "0.3.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"dependencies": {
diff --git a/packages/pieces/core/file-helper/src/lib/actions/change-file-encoding.ts b/packages/pieces/core/file-helper/src/lib/actions/change-file-encoding.ts
index c93c807500f..13e5a180d84 100644
--- a/packages/pieces/core/file-helper/src/lib/actions/change-file-encoding.ts
+++ b/packages/pieces/core/file-helper/src/lib/actions/change-file-encoding.ts
@@ -10,6 +10,10 @@ export const changeFileEncoding = createAction({
description: 'Convert a file from one text encoding to another.',
aiMetadata: { description: 'Re-encodes the bytes of a file from one character encoding to another (e.g. latin1 to utf8), writing the result to a new file under the output name you give. Use it when a downstream step mis-reads a file because of its character set; use Read File to simply get the content as text, or Create File to build a file from a string. The declared source encoding must actually match the file, since it is decoded blindly - a wrong choice silently corrupts characters rather than failing; deterministic and idempotent.', idempotent: true },
outputSchema: changeFileEncodingActionOutputSchema,
+ propertyGroups: [
+ { key: 'source', display: 'section', label: 'Source', icon: 'paperclip', props: ['inputFile', 'inputEncoding'] },
+ { key: 'output', display: 'section', label: 'Output', icon: 'file', props: ['outputFileName', 'outputEncoding'] },
+ ],
props: {
inputFile: Property.File({
displayName: 'Source File',
diff --git a/packages/pieces/core/file-helper/src/lib/actions/check-file-type.ts b/packages/pieces/core/file-helper/src/lib/actions/check-file-type.ts
index 579c2cd4fdc..2e3081b0b2b 100644
--- a/packages/pieces/core/file-helper/src/lib/actions/check-file-type.ts
+++ b/packages/pieces/core/file-helper/src/lib/actions/check-file-type.ts
@@ -11,6 +11,10 @@ export const checkFileType = createAction({
description: "Detect a file's type and check it against the one you pick.",
aiMetadata: { description: 'Determines the MIME type of a file from its extension and reports whether it matches the selected MIME type. Use it as a guard before a format-specific step (e.g. only continue for images or PDFs); use Get File Name if you only want the name, or Read File to get the contents. Detection is extension-based only - contents are never sniffed, so the extension is trusted as-is and only a missing or unrecognized one falls back to application/octet-stream; read-only and idempotent.', idempotent: true },
outputSchema: checkFileTypeActionOutputSchema,
+ propertyGroups: [
+ { key: 'input', display: 'section', label: 'File', icon: 'paperclip', props: ['file'] },
+ { key: 'match', display: 'section', label: 'Match', icon: 'tag', props: ['mimeTypes'] },
+ ],
props: {
file: Property.File({
displayName: 'File',
diff --git a/packages/pieces/core/file-helper/src/lib/actions/create-file.ts b/packages/pieces/core/file-helper/src/lib/actions/create-file.ts
index b86eeb7e88c..b4760dba5c4 100644
--- a/packages/pieces/core/file-helper/src/lib/actions/create-file.ts
+++ b/packages/pieces/core/file-helper/src/lib/actions/create-file.ts
@@ -10,6 +10,10 @@ export const createFile = createAction({
description: 'Save text as a new file.',
aiMetadata: { description: 'Writes a text string out to a new file with the given file name and character encoding (utf8 by default). Use it when a downstream step needs an actual file rather than a value - for example to attach generated CSV or JSON text to an email - and use Read File for the opposite direction. Requires the content and file name, and the encoding must be one of the supported Buffer encodings; nothing outside the run is changed, so it is idempotent.', idempotent: true },
outputSchema: createFileActionOutputSchema,
+ propertyGroups: [
+ { key: 'body', display: 'section', label: 'Content', icon: 'text', props: ['content', 'encoding'] },
+ { key: 'file', display: 'section', label: 'File', icon: 'file', props: ['fileName'] },
+ ],
props: {
content: Property.LongText({
displayName: 'Content',
diff --git a/packages/pieces/core/file-helper/src/lib/actions/read-file.ts b/packages/pieces/core/file-helper/src/lib/actions/read-file.ts
index 13ac47ca4c9..31509224fa8 100644
--- a/packages/pieces/core/file-helper/src/lib/actions/read-file.ts
+++ b/packages/pieces/core/file-helper/src/lib/actions/read-file.ts
@@ -15,6 +15,10 @@ export const readFileAction = createAction({
description: "Return a file's contents as text or Base64.",
aiMetadata: { description: 'Decodes an input file and returns its contents as either UTF-8 text or a base64 string, selected by the output-format option. Use it to turn a file from a trigger or earlier step into a usable value - Text for text-based files such as .txt/.json, Base64 for binary files or API payloads; use Create File for the reverse direction, and Convert CSV to JSON in the CSV piece when you need parsed rows. Requires a file input and an output format (any other value errors); read-only and idempotent.', idempotent: true },
outputSchema: readFileActionOutputSchema,
+ propertyGroups: [
+ { key: 'input', display: 'section', label: 'File', icon: 'paperclip', props: ['file'] },
+ { key: 'output', display: 'section', label: 'Output', icon: 'type', props: ['readOptions'] },
+ ],
props: {
file: Property.File({
displayName: 'File',
@@ -25,10 +29,11 @@ export const readFileAction = createAction({
displayName: 'Output Format',
description: 'Text for text files, Base64 for images, PDFs and other binaries.',
required: true,
+ display: 'cards',
options: {
options: [
- { label: 'Text', value: filesOutput.Text },
- { label: 'Base64', value: filesOutput.Base64 },
+ { label: 'Text', value: filesOutput.Text, description: 'For text files', icon: 'text' },
+ { label: 'Base64', value: filesOutput.Base64, description: 'For binary files', icon: 'code' },
],
},
}),
diff --git a/packages/pieces/core/file-helper/src/lib/actions/unzip-file.ts b/packages/pieces/core/file-helper/src/lib/actions/unzip-file.ts
index 128c5787544..dd6e55a2644 100644
--- a/packages/pieces/core/file-helper/src/lib/actions/unzip-file.ts
+++ b/packages/pieces/core/file-helper/src/lib/actions/unzip-file.ts
@@ -25,6 +25,10 @@ export const unzipFile = createAction({
description: 'Extract every file inside a zip archive.',
aiMetadata: { description: 'Extracts every file entry from a zip archive, writing each one out as its own file; supports password-protected archives. Use it to reach the contents of a zip attachment before processing them; use Zip Files for the reverse direction. Set Max Files to throw when an untrusted archive exceeds that entry count; directory entries are skipped, a wrong or missing password makes extraction fail, and the source archive is unchanged, so it is idempotent.', idempotent: true },
outputSchema: unzipFileActionOutputSchema,
+ propertyGroups: [
+ { key: 'archive', display: 'section', label: 'Archive', icon: 'paperclip', props: ['file'] },
+ { key: 'password', display: 'section', label: 'Password', icon: 'sliders', props: ['usePassword', 'passwordOptions'] },
+ ],
props: {
file: Property.File({
displayName: 'Zip File',
diff --git a/packages/pieces/core/file-helper/src/lib/actions/zip-files.ts b/packages/pieces/core/file-helper/src/lib/actions/zip-files.ts
index 6ffb59ff0e3..b42fa7febe0 100644
--- a/packages/pieces/core/file-helper/src/lib/actions/zip-files.ts
+++ b/packages/pieces/core/file-helper/src/lib/actions/zip-files.ts
@@ -25,6 +25,10 @@ export const zipFiles = createAction({
description: 'Bundle one or more files into a zip archive.',
aiMetadata: { description: 'Compresses one or many input files into a single zip archive, optionally placing each entry at a custom path inside the archive (e.g. foo/test.txt) and optionally password-protecting it with ZipCrypto or AES-256. Use it to bundle several files into one attachment or download; use Unzip File for the reverse direction. Requires the list of files and an output file name; entries default to their own file names, reusing the same in-zip path keeps only the later file, and there are no external side effects, so it is idempotent.', idempotent: true },
outputSchema: zipFilesActionOutputSchema,
+ propertyGroups: [
+ { key: 'archive', display: 'section', label: 'Archive', icon: 'paperclip', props: ['files', 'outputFileName'] },
+ { key: 'password', display: 'section', label: 'Password', icon: 'sliders', props: ['usePassword', 'passwordOptions'] },
+ ],
props: {
files: Property.Array({
displayName: 'Files',