Skip to content

feat: add Lark channel adapter#241

Closed
redasm wants to merge 1 commit intoOpen-ACP:mainfrom
redasm:main
Closed

feat: add Lark channel adapter#241
redasm wants to merge 1 commit intoOpen-ACP:mainfrom
redasm:main

Conversation

@redasm
Copy link
Copy Markdown

@redasm redasm commented Apr 27, 2026

Adds a built-in Lark/Feishu adapter with setup wizard support, documentation, and tests so users can connect OpenACP through a self-built Lark bot over WebSocket. Also improves Windows package-runner resolution and makes the build script cross-platform.

Summary

Related Issues

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🔌 New adapter / plugin
  • 📝 Documentation
  • ♻️ Refactor (no functional change)
  • ⚡ Performance improvement
  • 🧪 Tests
  • 🔧 CI / Build / Config

Changes Made

Testing

  • Ran pnpm test — all tests pass
  • Tested manually with:
  • Added new tests for this change
  • No tests needed (explain why)

Platform Impact

  • Telegram
  • Discord
  • Slack
  • CLI
  • REST API
  • Web UI
  • All / Core

Screenshots / Recordings

Checklist

  • My code follows the project's TypeScript conventions (ESM, .js extensions)
  • I have updated relevant documentation (if needed)
  • I have added/updated tests (if applicable)
  • My changes don't introduce new warnings or errors
  • I have run pnpm build successfully
  • My changes are backward compatible with existing config and data formats
  • If changing plugin API / PluginContext: I have updated src/cli/plugin-template/

Adds a built-in Lark/Feishu adapter with setup wizard support, documentation, and tests so users can connect OpenACP through a self-built Lark bot over WebSocket. Also improves Windows package-runner resolution and makes the build script cross-platform.
@0xmrpeter
Copy link
Copy Markdown
Contributor

Hey @strangeland — this is great work! The Lark implementation is solid: the single-chat + thread-per-session model, WebSocket event stream, interactive cards, and the setup wizard are all well-thought-out.

However, there's an architectural mismatch here that needs to be addressed before we can merge.

The Issue

This PR bundles Lark directly into the OpenACP core (src/plugins/lark/) and adds @larksuiteoapi/node-sdk as a dependency of the core package. This means every OpenACP user gets the Lark SDK in their node_modules — even those who never use Lark.

Compare this with how Discord and Slack adapters are distributed:

These are external plugins that users opt into:

openacp plugin install @openacp/discord-adapter
openacp plugin install @openacp/lark-adapter    # ← what we want for Lark

What to Do Instead

Please convert this into a standalone plugin package — the same pattern as the Discord adapter. The CLI has a scaffold command to get you started:

# 1. Scaffold a new plugin project
openacp plugin create --name @your-org/lark-adapter

# 2. Start developing with hot-reload
cd lark-adapter
npm install
openacp dev .

# 3. Run tests
npm test

# 4. Build and publish to npm
npm run build
npm publish --access public

# 5. Users install it like any other plugin
openacp plugin install @your-org/lark-adapter

Your existing code is excellent and maps almost 1-to-1 onto the external plugin structure — index.ts stays the same, adapter.ts, formatting.ts, etc. just move into a new repo. The main change is replacing internal core imports with @openacp/plugin-sdk:

// ❌ Before (core-internal imports)
import type { OpenACPPlugin, InstallContext } from "../../core/plugin/types.js"

// ✅ After (SDK imports)
import type { OpenACPPlugin, InstallContext } from "@openacp/plugin-sdk"

Also revert the core changes: core-plugins.ts, package.json (@larksuiteoapi/node-sdk), and src/plugins/lark/ additions should not be in this repo.

Docs

Once submitted as an external plugin, we're happy to feature it in the README and docs as an officially supported adapter. The Lark/Feishu community will love this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants