apache / apache/maka

refactor(runtime): extract bots subsystem to separate package

Open
#3,910 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.4k
Forks
502
Avg merge
1d 2h
Merged PRs (30d)
716

Description

## Summary

The bots subsystem (16 source files: telegram, discord, slack, wecom, wechat, feishu, dingtalk, qq bridges) is bundled inside `packages/runtime/src/bots/` despite being a delivery concern orthogonal to session management. This forces 6 third-party IM SDK dependencies into runtime's direct dependency tree.

## Evidence

- `packages/runtime/src/bots/` — 16 files including `base-adapter.ts`, `bot-registry.ts`, and 8 platform-specific bridges
- `packages/runtime/package.json` depends on `@slack/web-api`, `@larksuiteoapi/node-sdk`, `@wecom/aibot-node-sdk`, `ws` at runtime dependency level
- These dependencies are only needed for bot bridges, not for core session management
- `@maka/runtime/bots` is the public export path

## Proposed Solution

Extract `bots/` into its own package (`@maka/bots` or `@maka/runtime-bots`) with a dependency on `@maka/runtime` for session management types.

Benefits:
- Removes 6 third-party IM SDK dependencies from `@maka/runtime`'s dependency tree
- Clearer ownership boundary — bot bridges are a delivery concern
- Independent versioning and release cycle for bot integrations
- Smaller `@maka/runtime` install footprint for non-bot consumers

## Acceptance Criteria

- [ ] `@maka/bots` package exists with all 16 bot source files
- [ ] `@maka/runtime` no longer depends on IM SDK packages directly
- [ ] All bot bridge tests pass in the new package
- [ ] `@maka/runtime/bots` re-export path is preserved for backward compatibility
- [ ] Bot registry initialization works from the new package

## Labels

refactor, help wanted

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the 16 files under packages/runtime/src/bots/ and packages/runtime/package.json, then trace the public @maka/runtime/bots export and bot registry initialization. Compare the package boundary options named in the issue and locate the existing bot bridge tests. Done means the new package contains the bots, runtime no longer directly depends on the IM SDKs, tests pass, and the old export path still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.