Skip to content

Commit ee03930

Browse files
engineerCopilot
andcommitted
fix(telegram): revert to defineChannelPluginEntry from plugin-sdk/core
defineBundledChannelEntry from channel-entry-contract is not in the package.json exports map, causing ERR_PACKAGE_PATH_NOT_EXPORTED at post-build. defineChannelPluginEntry from plugin-sdk/core IS exported and supports registerFull. This was the original PR approach. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent bcafe72 commit ee03930

2 files changed

Lines changed: 12 additions & 26 deletions

File tree

.github/workflows/docker-telegram-proxy.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@ jobs:
3636
id: image
3737
run: echo "name=${REGISTRY}/${GITHUB_REPOSITORY,,}:telegram-proxy" >> "$GITHUB_OUTPUT"
3838

39-
- name: Verify source files
40-
run: |
41-
echo "=== Checking proxy-ingress source ==="
42-
ls -la extensions/telegram/src/proxy-ingress.ts
43-
head -5 extensions/telegram/index.ts
44-
echo "=== Checking proxy-ingress exists ==="
45-
grep -c "createProxyIngressHandler" extensions/telegram/index.ts
46-
grep -c "registerFull" extensions/telegram/index.ts
47-
4839
- name: Build and push
4940
id: build
5041
uses: docker/build-push-action@v6

extensions/telegram/index.ts

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
1+
import type { ChannelPlugin } from "openclaw/plugin-sdk/core";
2+
import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
3+
import { telegramPlugin } from "./src/channel.js";
4+
import { createProxyIngressHandler } from "./src/proxy-ingress.js";
5+
import { setTelegramRuntime } from "./src/runtime.js";
26

3-
export default defineBundledChannelEntry({
7+
export { telegramPlugin } from "./src/channel.js";
8+
export { setTelegramRuntime } from "./src/runtime.js";
9+
10+
export default defineChannelPluginEntry({
411
id: "telegram",
512
name: "Telegram",
613
description: "Telegram channel plugin",
7-
importMetaUrl: import.meta.url,
8-
plugin: {
9-
specifier: "./channel-plugin-api.js",
10-
exportName: "telegramPlugin",
11-
},
12-
secrets: {
13-
specifier: "./secret-contract-api.js",
14-
exportName: "channelSecrets",
15-
},
16-
runtime: {
17-
specifier: "./runtime-api.js",
18-
exportName: "setTelegramRuntime",
19-
},
20-
async registerFull(api) {
21-
const { createProxyIngressHandler } = await import("./src/proxy-ingress.js");
14+
plugin: telegramPlugin as ChannelPlugin,
15+
setRuntime: setTelegramRuntime,
16+
registerFull(api) {
2217
const handler = createProxyIngressHandler(api);
2318
api.registerHttpRoute({
2419
path: "/api/channels/telegram/proxy-ingress",

0 commit comments

Comments
 (0)