
工作流自动化低代码AI 应用人工智能AI AgentMCP 服务后端前端【免费下载链接】activepiecesAI 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项目地址https://gitcode.com/GitHub_Trending/ac/activepieces点击查看免费下载本篇指南聚焦 Activepieces 开源仓库中的社区版 Hastewire Piece介绍如何通过 Turbo 工作区构建该库并结合源码剖析其两个核心 ActionAI 文本检测detect-text与人性化改写humanize-text的认证方式、请求参数与底层 HTTP 调用链。读完本文你将掌握该 Piece 从源码构建、API Key 配置到在 Activepieces 流程中落地的完整实操路径。Hastewire Piece 概览与模块结构Hastewire Piece 是 Activepieces 社区集成之一归类于PieceCategory.ARTIFICIAL_INTELLIGENCE见 index.ts为自动化流程提供两项 AI 文本处理能力检测一段文本由 AI 生成还是人类书写的可能性以及将 AI 生成的文本改写得更像人类书写。该 Piece 不含触发器仅提供两个 Action。从模块目录结构可以清晰看到它的组织方式源码布局见 packages/pieces/community/hastewirehastewire/ ├── README.md # 构建说明本文核心依据 ├── package.json # 包定义与构建脚本 ├── tsconfig.json ├── tsconfig.lib.json └── src/ ├── index.ts # createPiece 注册入口 ├── i18n/ # 多语言文案de/es/fr/ja/nl/pt/zh 等 └── lib/ ├── actions/ │ ├── detect-text.ts # AI 文本检测 │ └── humanize-text.ts # 文本人性化改写 └── common/ └── auth.ts # API Key 认证定义包元数据定义在 package.json 中包名为activepieces/piece-hastewire当前版本0.1.7输出格式为 CommonJS入口为./dist/src/index.js依赖集中于activepieces/pieces-common、activepieces/pieces-framework等 workspace 内部包。注册信息index.ts表明该 Piece 的minimumSupportedRelease为0.36.1即低于该版本的 Activepieces 实例无法加载此 Piece。构建 Piece从源码产出可发布库关联文档给出的构建方式是核心入口原样继承如下turbo run build --filteractivepieces/piece-hastewire该命令基于仓库根目录的 turbo.json 任务编排通过--filter精确限定只构建 Hastewire 这一个包避免在大型 monorepo 中触发全量构建。其底层执行逻辑来自 package.json 的scripts配置{ scripts: { build: tsc -p tsconfig.lib.json cp package.json dist/, bundle: node ../../../../dist/packages/cli/src/index.js pieces bundle, lint: eslint src/**/*.ts } }build先用 TypeScript 按tsconfig.lib.json编译源码再将package.json复制进dist/保证产物目录自包含bundle调用仓库 CLI 对 Piece 做打包供发布与分发使用lint对src下所有.ts文件做 ESLint 静态检查适合在构建前先跑一遍。构建产物落在dist/src/index.js。对于仅需在本地验证的场景直接执行npm run build或对应的 bun 命令仓库根目录为 bun 项目见 bun.lock即可。认证配置API Key 的获取与绑定Hastewire Piece 的认证采用PieceAuth.SecretText即一段密文形式的 API Key。完整定义见 auth.tsimport { PieceAuth } from activepieces/pieces-framework; export const hastewireAuth PieceAuth.SecretText({ displayName:API Key, required:true, description:You can obtain API key from [Settings](https://hastewire.com/humanizer/account/api-keys). })要点必填required: true流程中不绑定连接该 Piece 的 Action 无法运行密文存储SecretTextProperty在框架层对应PropertyType.SECRET_TEXT认证值在数据库中按敏感信息处理框架定义见 secret-text-property.ts字段语义在流程编辑器里用户需要先创建连接并填入 API Key之后context.auth.secret_text即可在 Action 运行时取出该值。该认证对象通过auth: hastewireAuth挂载到两个 Action见 detect-text.ts 与 humanize-text.ts并在 Piece 注册时一并声明index.ts。Detect TextAI 文本检测 Action 实战detect-textAction 用于分析文本并返回其由 AI 生成或人类书写的可能性评分。完整实现见 detect-text.tsimport { createAction, Property } from activepieces/pieces-framework; import { hastewireAuth } from ../common/auth; import {AuthenticationType, httpClient, HttpMethod} from activepieces/pieces-common; export const detectTextAction createAction({ name:detect-text, auth:hastewireAuth, displayName:Detect Text, description:Analyzes text and returns the likelihood of it being AI-generated or human-written., audience: both, aiMetadata: { description: Runs AI-detection on a block of text via the Hastewire API, scoring how likely it is to be AI-generated versus human-written. Choose this to classify or vet content before acting on it; it only reads/analyzes the supplied text and does not modify or store it, so repeating the same input yields the same score., idempotent: true }, props:{ text:Property.LongText({ displayName:Input Text, required:true }) }, async run(context) { const response await httpClient.sendRequest({ method:HttpMethod.POST, url:https://hastewire.com/api/v1/detect, authentication:{ type:AuthenticationType.BEARER_TOKEN, token:context.auth.secret_text }, body:{ text:context.propsValue.text } }) return response.body; } })参数与行为梳理维度说明Action 名称detect-text流程中以此引用输入参数text类型LongText长文本必填请求方式POST https://hastewire.com/api/v1/detect认证Bearer Tokentoken 取自身份验证中的secret_text请求体{ text: 待检测文本 }输出透传 Hastewire API 的response.body含 AI 生成可能性评分幂等性aiMetadata.idempotent true相同输入返回相同评分仅读取不修改数据值得注意的是audience: both与aiMetadata字段前者声明该 Action 同时面向人工与 AI 编排场景使用后者为 AI 代理提供语义化描述框架中AiMetadata由description与idempotent两个可选字段构成见 piece-metadata.ts。Humanize Text文本人性化改写 Action 实战humanize-textAction 将给定的 AI 生成文本改写得更接近人类书写并支持指定输出风格。完整实现见 humanize-text.tsimport { createAction, Property } from activepieces/pieces-framework; import { hastewireAuth } from ../common/auth; import { AuthenticationType, httpClient, HttpMethod } from activepieces/pieces-common; export const humanizeTextAction createAction({ name: humanize-text, auth: hastewireAuth, displayName: Humanize Text, description: Rephrases a given AI-generated text to be more human like., audience: both, aiMetadata: { description: Rewrites AI-generated text into a more human-sounding version via the Hastewire API, optionally targeting a writing style (formal, standard, or academic). Choose this to make machine-written content read naturally or to reduce AI-detection signals. Each call performs a fresh generative rewrite, so it is not idempotent and repeated calls may return different output., idempotent: false }, props: { text: Property.LongText({ displayName: Input Text, required: true }), style: Property.StaticDropdown({ displayName: Text Style, required: false, description:The desired writing style for the output., options: { disabled: false, options: [ { label: formal, value: formal }, { label: standard, value: standard }, { label: academic, value: academic } ] } }) }, async run(context) { const response await httpClient.sendRequest({ method: HttpMethod.POST, url: https://hastewire.com/api/v1/humanize, authentication: { type: AuthenticationType.BEARER_TOKEN, token: context.auth.secret_text }, body: { text: context.propsValue.text, style:context.propsValue.style } }) return response.body; } })与 Detect Text 相比的关键差异多一个可选参数styleStaticDropdown提供formal正式、standard标准、academic学术三种取值required: false表示不传时由服务端采用默认风格非幂等aiMetadata.idempotent false每次调用都是一次全新的生成式改写重复调用可能返回不同输出请求体{ text: 待改写文本, style: formal|standard|academic }端点POST https://hastewire.com/api/v1/humanize。底层调用链Bearer Token 认证与 HTTP 请求机制两个 Action 均复用activepieces/pieces-common提供的httpClient.sendRequest认证统一走AuthenticationType.BEARER_TOKEN。框架侧的认证类型定义见 packages/pieces/common/src/lib/authentication/index.tsexport enum AuthenticationType { BEARER_TOKEN BEARER_TOKEN, BASIC BASIC, } export type BearerTokenAuthentication BaseAuthenticationAuthenticationType.BEARER_TOKEN { token: string; };这意味着每个请求都会在Authorization头中携带Bearer API Key。运行时取值链为连接中保存的密钥 →context.auth.secret_text→ 请求认证头。这一模式在 Activepieces 社区 Piece 中是标准做法从源码结构看Hastewire Piece 直接透传服务端响应体return response.body后续节点可继续引用其中的字段做分支判断或内容处理。Piece 元数据与框架契约Piece 的注册入口 index.ts 展示了它与activepieces/pieces-framework的契约关系export const hastewire createPiece({ displayName: Hastewire, auth: hastewireAuth, categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE], minimumSupportedRelease: 0.36.1, logoUrl: https://cdn.activepieces.com/pieces/hastewire.png, authors: [kishanprmr], actions: [detectTextAction, humanizeTextAction], triggers: [], });分类ARTIFICIAL_INTELLIGENCE在流程编辑器的 AI 类目下展示版本门槛minimumSupportedRelease: 0.36.1低于此版本的实例不加载成员actions数组注册上述两个 Actiontriggers为空该 Piece 无触发器。此外两个 Action 都声明了audience: both。框架层对Audience的定义见 piece-metadata.tsz.enum([human, ai, both])说明该 Action 既面向人工构建流程也可被 AI Agent 通过工具调用方式使用这与 Hastewire 作为 AI 内容治理工具的场景一致。多语言文案支持Piece 内置了完整的 i18n 文案目录见 src/i18n覆盖de德语、es西班牙语、fr法语、ja日语、nl荷兰语、pt葡萄牙语、zh中文以及默认的translation.json。以 translation.json 为例翻译键覆盖认证提示、Action 显示名、描述与参数标签{ You can obtain API key from [Settings](https://hastewire.com/humanizer/account/api-keys).: You can obtain API key from [Settings](https://hastewire.com/humanizer/account/api-keys)., Detect Text: Detect Text, Humanize Text: Humanize Text, Input Text: Input Text, Text Style: Text Style, formal: formal, standard: standard, academic: academic }这些键与源码中的displayName、description一一对应说明界面文案可在不同语言环境下本地化渲染。在 Activepieces 流程中使用该 Piece启用该 Piece 后在流程编辑器中按以下步骤落地平台层面的 Piece 可见性管理参考 manage-pieces.mdx创建连接在 Pieces 列表中找到 Hastewire新建连接并填入从 Hastewire 账户设置页获取的 API Key拖入 Detect Text将长文本来源如 Webhook、Google Sheets 行数据传入Input Text用于先判断内容是否疑似 AI 生成条件分流依据检测评分设置分支——疑似 AI 生成的内容进入 Humanize Text 节点选择formal/standard/academic风格完成改写透传结果两个 Action 都返回原始response.body后续节点如发送到 Slack、写回表格可直接引用该结构化结果。典型场景包括内容审核管线发布前自动检测 AI 生成内容、内容本地化润色、以及面向投稿/评论区的 AI 文本过滤。由于 Detect Text 幂等而 Humanize Text 非幂等设计流程时应避免对同一文本重复调用改写节点以免输出漂移。说明以上实现细节均来自当前仓库源码detect-text.ts、humanize-text.ts、auth.ts与包配置package.json具体响应字段结构以 Hastewire 服务端实际返回为准。赞分享工作流自动化低代码AI 应用人工智能AI AgentMCP 服务后端前端【免费下载链接】activepiecesAI 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项目地址https://gitcode.com/GitHub_Trending/ac/activepieces点击查看免费下载相关推荐Activepieces Upgrade.chat Piece 集成指南构建、认证配置与 CRM 自动化实战Activepieces Upgrade.chat Piece 集成指南构建、认证配置与 CRM 自动化实战 本篇技术指南围绕 Activepieces 开源工作流自动化低代码AI 应用人工智能AI AgentMCP 服务后端前端RVC 语音克隆用 10 分钟数据训练 AI 歌手的完整指南RVC 语音克隆用 10 分钟数据训练 AI 歌手的完整指南 Retrieval based Voice Conversion WebUI社区常简称 RVC人工智能AI 应用语音音频深度学习Activepieces 中 Gender API 集成 Piece 的源码解析与构建指南Activepieces 中 Gender API 集成 Piece 的源码解析与构建指南 导读 Gender APIgender apiPiece 是 A工作流自动化低代码AI 应用人工智能AI AgentMCP 服务后端前端上一篇如何快速上手Iconic从安装到使用的新手教程下一篇LimiX-16M模型部署全攻略GPU与CPU环境配置最佳实践创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考