refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
@@ -33,7 +33,7 @@ Delivery:
|
||||
|
||||
### 2) Plugin Runtime (execution surface, injected)
|
||||
Scope: everything that touches core runtime behavior.
|
||||
Accessed via `ClawdbotPluginApi.runtime` so plugins never import `src/**`.
|
||||
Accessed via `MoltbotPluginApi.runtime` so plugins never import `src/**`.
|
||||
|
||||
Proposed surface (minimal but complete):
|
||||
```ts
|
||||
@@ -41,8 +41,8 @@ export type PluginRuntime = {
|
||||
channel: {
|
||||
text: {
|
||||
chunkMarkdownText(text: string, limit: number): string[];
|
||||
resolveTextChunkLimit(cfg: ClawdbotConfig, channel: string, accountId?: string): number;
|
||||
hasControlCommand(text: string, cfg: ClawdbotConfig): boolean;
|
||||
resolveTextChunkLimit(cfg: MoltbotConfig, channel: string, accountId?: string): number;
|
||||
hasControlCommand(text: string, cfg: MoltbotConfig): boolean;
|
||||
};
|
||||
reply: {
|
||||
dispatchReplyWithBufferedBlockDispatcher(params: {
|
||||
@@ -83,18 +83,18 @@ export type PluginRuntime = {
|
||||
): Promise<{ path: string; contentType?: string }>;
|
||||
};
|
||||
mentions: {
|
||||
buildMentionRegexes(cfg: ClawdbotConfig, agentId?: string): RegExp[];
|
||||
buildMentionRegexes(cfg: MoltbotConfig, agentId?: string): RegExp[];
|
||||
matchesMentionPatterns(text: string, regexes: RegExp[]): boolean;
|
||||
};
|
||||
groups: {
|
||||
resolveGroupPolicy(cfg: ClawdbotConfig, channel: string, accountId: string, groupId: string): {
|
||||
resolveGroupPolicy(cfg: MoltbotConfig, channel: string, accountId: string, groupId: string): {
|
||||
allowlistEnabled: boolean;
|
||||
allowed: boolean;
|
||||
groupConfig?: unknown;
|
||||
defaultConfig?: unknown;
|
||||
};
|
||||
resolveRequireMention(
|
||||
cfg: ClawdbotConfig,
|
||||
cfg: MoltbotConfig,
|
||||
channel: string,
|
||||
accountId: string,
|
||||
groupId: string,
|
||||
@@ -109,7 +109,7 @@ export type PluginRuntime = {
|
||||
onFlush: (entries: T[]) => Promise<void>;
|
||||
onError?: (err: unknown) => void;
|
||||
}): { push: (v: T) => void; flush: () => Promise<void> };
|
||||
resolveInboundDebounceMs(cfg: ClawdbotConfig, channel: string): number;
|
||||
resolveInboundDebounceMs(cfg: MoltbotConfig, channel: string): number;
|
||||
};
|
||||
commands: {
|
||||
resolveCommandAuthorizedFromAuthorizers(params: {
|
||||
@@ -123,7 +123,7 @@ export type PluginRuntime = {
|
||||
getChildLogger(name: string): PluginLogger;
|
||||
};
|
||||
state: {
|
||||
resolveStateDir(cfg: ClawdbotConfig): string;
|
||||
resolveStateDir(cfg: MoltbotConfig): string;
|
||||
};
|
||||
};
|
||||
```
|
||||
@@ -137,7 +137,7 @@ Notes:
|
||||
|
||||
### Phase 0: scaffolding
|
||||
- Introduce `@clawdbot/plugin-sdk`.
|
||||
- Add `api.runtime` to `ClawdbotPluginApi` with the surface above.
|
||||
- Add `api.runtime` to `MoltbotPluginApi` with the surface above.
|
||||
- Maintain existing imports during a transition window (deprecation warnings).
|
||||
|
||||
### Phase 1: bridge cleanup (low risk)
|
||||
@@ -165,7 +165,7 @@ Notes:
|
||||
## Compatibility and versioning
|
||||
- SDK: semver, published, documented changes.
|
||||
- Runtime: versioned per core release. Add `api.runtime.version`.
|
||||
- Plugins declare a required runtime range (e.g., `clawdbotRuntime: ">=2026.2.0"`).
|
||||
- Plugins declare a required runtime range (e.g., `moltbotRuntime: ">=2026.2.0"`).
|
||||
|
||||
## Testing strategy
|
||||
- Adapter-level unit tests (runtime functions exercised with real core implementation).
|
||||
|
||||
Reference in New Issue
Block a user