opc-agent 4.1.1 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics/index.d.ts.map +1 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/channels/dingtalk.d.ts.map +1 -0
- package/dist/channels/dingtalk.js.map +1 -0
- package/dist/channels/discord.d.ts.map +1 -0
- package/dist/channels/discord.js.map +1 -0
- package/dist/channels/email.d.ts.map +1 -0
- package/dist/channels/email.js.map +1 -0
- package/dist/channels/feishu.d.ts.map +1 -0
- package/dist/channels/feishu.js.map +1 -0
- package/dist/channels/googlechat.d.ts.map +1 -0
- package/dist/channels/googlechat.js.map +1 -0
- package/dist/channels/imessage.d.ts.map +1 -0
- package/dist/channels/imessage.js.map +1 -0
- package/dist/channels/index.d.ts.map +1 -0
- package/dist/channels/index.js.map +1 -0
- package/dist/channels/irc.d.ts.map +1 -0
- package/dist/channels/irc.js.map +1 -0
- package/dist/channels/line.d.ts.map +1 -0
- package/dist/channels/line.js.map +1 -0
- package/dist/channels/matrix.d.ts.map +1 -0
- package/dist/channels/matrix.js.map +1 -0
- package/dist/channels/mattermost.d.ts.map +1 -0
- package/dist/channels/mattermost.js.map +1 -0
- package/dist/channels/msteams.d.ts.map +1 -0
- package/dist/channels/msteams.js.map +1 -0
- package/dist/channels/nostr.d.ts.map +1 -0
- package/dist/channels/nostr.js.map +1 -0
- package/dist/channels/qq.d.ts.map +1 -0
- package/dist/channels/qq.js.map +1 -0
- package/dist/channels/signal.d.ts.map +1 -0
- package/dist/channels/signal.js.map +1 -0
- package/dist/channels/slack.d.ts.map +1 -0
- package/dist/channels/slack.js.map +1 -0
- package/dist/channels/sms.d.ts.map +1 -0
- package/dist/channels/sms.js.map +1 -0
- package/dist/channels/telegram.d.ts.map +1 -0
- package/dist/channels/telegram.js.map +1 -0
- package/dist/channels/twitch.d.ts.map +1 -0
- package/dist/channels/twitch.js.map +1 -0
- package/dist/channels/voice-call.d.ts.map +1 -0
- package/dist/channels/voice-call.js.map +1 -0
- package/dist/channels/voice.d.ts.map +1 -0
- package/dist/channels/voice.js.map +1 -0
- package/dist/channels/web.d.ts.map +1 -0
- package/dist/channels/web.js +8 -2
- package/dist/channels/web.js.map +1 -0
- package/dist/channels/webhook.d.ts.map +1 -0
- package/dist/channels/webhook.js.map +1 -0
- package/dist/channels/websocket.d.ts.map +1 -0
- package/dist/channels/websocket.js.map +1 -0
- package/dist/channels/wechat.d.ts.map +1 -0
- package/dist/channels/wechat.js.map +1 -0
- package/dist/channels/whatsapp.d.ts.map +1 -0
- package/dist/channels/whatsapp.js.map +1 -0
- package/dist/cli/chat.d.ts.map +1 -0
- package/dist/cli/chat.js.map +1 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +261 -85
- package/dist/cli.js.map +1 -0
- package/dist/core/a2a.d.ts.map +1 -0
- package/dist/core/a2a.js.map +1 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/analytics-engine.d.ts.map +1 -0
- package/dist/core/analytics-engine.js.map +1 -0
- package/dist/core/api-server.d.ts.map +1 -0
- package/dist/core/api-server.js.map +1 -0
- package/dist/core/audio.d.ts.map +1 -0
- package/dist/core/audio.js.map +1 -0
- package/dist/core/auth.d.ts.map +1 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/cache.d.ts.map +1 -0
- package/dist/core/cache.js.map +1 -0
- package/dist/core/collaboration.d.ts.map +1 -0
- package/dist/core/collaboration.js.map +1 -0
- package/dist/core/compose.d.ts.map +1 -0
- package/dist/core/compose.js.map +1 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/context-discovery.d.ts.map +1 -0
- package/dist/core/context-discovery.js.map +1 -0
- package/dist/core/context-refs.d.ts.map +1 -0
- package/dist/core/context-refs.js.map +1 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/gateway.d.ts.map +1 -0
- package/dist/core/gateway.js.map +1 -0
- package/dist/core/heartbeat.d.ts.map +1 -0
- package/dist/core/heartbeat.js.map +1 -0
- package/dist/core/hitl.d.ts.map +1 -0
- package/dist/core/hitl.js.map +1 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/ide-bridge.d.ts.map +1 -0
- package/dist/core/ide-bridge.js.map +1 -0
- package/dist/core/knowledge.d.ts.map +1 -0
- package/dist/core/knowledge.js.map +1 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/node-network.d.ts.map +1 -0
- package/dist/core/node-network.js.map +1 -0
- package/dist/core/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/core/performance.d.ts.map +1 -0
- package/dist/core/performance.js.map +1 -0
- package/dist/core/profiles.d.ts.map +1 -0
- package/dist/core/profiles.js.map +1 -0
- package/dist/core/rate-limiter.d.ts.map +1 -0
- package/dist/core/rate-limiter.js.map +1 -0
- package/dist/core/room.d.ts.map +1 -0
- package/dist/core/room.js.map +1 -0
- package/dist/core/runtime.d.ts.map +1 -0
- package/dist/core/runtime.js +37 -15
- package/dist/core/runtime.js.map +1 -0
- package/dist/core/sandbox.d.ts.map +1 -0
- package/dist/core/sandbox.js.map +1 -0
- package/dist/core/scheduler.d.ts.map +1 -0
- package/dist/core/scheduler.js.map +1 -0
- package/dist/core/security.d.ts.map +1 -0
- package/dist/core/security.js.map +1 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/streaming.d.ts.map +1 -0
- package/dist/core/streaming.js.map +1 -0
- package/dist/core/subagent.d.ts.map +1 -0
- package/dist/core/subagent.js.map +1 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/versioning.d.ts.map +1 -0
- package/dist/core/versioning.js.map +1 -0
- package/dist/core/vision.d.ts.map +1 -0
- package/dist/core/vision.js.map +1 -0
- package/dist/core/watch.d.ts.map +1 -0
- package/dist/core/watch.js.map +1 -0
- package/dist/core/workflow-graph.d.ts.map +1 -0
- package/dist/core/workflow-graph.js.map +1 -0
- package/dist/core/workflow.d.ts.map +1 -0
- package/dist/core/workflow.js.map +1 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js.map +1 -0
- package/dist/deploy/hermes.d.ts.map +1 -0
- package/dist/deploy/hermes.js.map +1 -0
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js.map +1 -0
- package/dist/deploy/openclaw.d.ts.map +1 -0
- package/dist/deploy/openclaw.js.map +1 -0
- package/dist/doctor.d.ts +1 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +105 -10
- package/dist/doctor.js.map +1 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/hub/brain-seed.d.ts.map +1 -0
- package/dist/hub/brain-seed.js.map +1 -0
- package/dist/hub/client.d.ts.map +1 -0
- package/dist/hub/client.js.map +1 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/servers/calculator-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/calculator-mcp.js.map +1 -0
- package/dist/mcp/servers/crypto-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/crypto-mcp.js.map +1 -0
- package/dist/mcp/servers/database-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/database-mcp.js.map +1 -0
- package/dist/mcp/servers/datetime-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/datetime-mcp.js.map +1 -0
- package/dist/mcp/servers/filesystem.d.ts.map +1 -0
- package/dist/mcp/servers/filesystem.js.map +1 -0
- package/dist/mcp/servers/github-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/github-mcp.js.map +1 -0
- package/dist/mcp/servers/index.d.ts.map +1 -0
- package/dist/mcp/servers/index.js.map +1 -0
- package/dist/mcp/servers/json-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/json-mcp.js.map +1 -0
- package/dist/mcp/servers/memory-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/memory-mcp.js.map +1 -0
- package/dist/mcp/servers/regex-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/regex-mcp.js.map +1 -0
- package/dist/mcp/servers/web-mcp.d.ts.map +1 -0
- package/dist/mcp/servers/web-mcp.js.map +1 -0
- package/dist/memory/context-compressor.d.ts.map +1 -0
- package/dist/memory/context-compressor.js.map +1 -0
- package/dist/memory/deepbrain.d.ts +1 -1
- package/dist/memory/deepbrain.d.ts.map +1 -0
- package/dist/memory/deepbrain.js +95 -4
- package/dist/memory/deepbrain.js.map +1 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/seed-loader.d.ts.map +1 -0
- package/dist/memory/seed-loader.js.map +1 -0
- package/dist/memory/user-profiler.d.ts.map +1 -0
- package/dist/memory/user-profiler.js.map +1 -0
- package/dist/plugins/content-filter.d.ts.map +1 -0
- package/dist/plugins/content-filter.js.map +1 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/logger.d.ts.map +1 -0
- package/dist/plugins/logger.js.map +1 -0
- package/dist/plugins/rate-limiter.d.ts.map +1 -0
- package/dist/plugins/rate-limiter.js.map +1 -0
- package/dist/protocols/a2a/client.d.ts.map +1 -0
- package/dist/protocols/a2a/client.js.map +1 -0
- package/dist/protocols/a2a/index.d.ts.map +1 -0
- package/dist/protocols/a2a/index.js.map +1 -0
- package/dist/protocols/a2a/server.d.ts.map +1 -0
- package/dist/protocols/a2a/server.js.map +1 -0
- package/dist/protocols/a2a/types.d.ts.map +1 -0
- package/dist/protocols/a2a/types.js.map +1 -0
- package/dist/protocols/a2a/utils.d.ts.map +1 -0
- package/dist/protocols/a2a/utils.js.map +1 -0
- package/dist/protocols/agui/client.d.ts.map +1 -0
- package/dist/protocols/agui/client.js.map +1 -0
- package/dist/protocols/agui/index.d.ts.map +1 -0
- package/dist/protocols/agui/index.js.map +1 -0
- package/dist/protocols/agui/server.d.ts.map +1 -0
- package/dist/protocols/agui/server.js.map +1 -0
- package/dist/protocols/agui/types.d.ts.map +1 -0
- package/dist/protocols/agui/types.js.map +1 -0
- package/dist/protocols/index.d.ts.map +1 -0
- package/dist/protocols/index.js.map +1 -0
- package/dist/protocols/mcp/agent-tools.d.ts.map +1 -0
- package/dist/protocols/mcp/agent-tools.js.map +1 -0
- package/dist/protocols/mcp/index.d.ts.map +1 -0
- package/dist/protocols/mcp/index.js.map +1 -0
- package/dist/protocols/mcp/server.d.ts.map +1 -0
- package/dist/protocols/mcp/server.js.map +1 -0
- package/dist/protocols/mcp/types.d.ts.map +1 -0
- package/dist/protocols/mcp/types.js.map +1 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/publish/index.d.ts.map +1 -0
- package/dist/publish/index.js.map +1 -0
- package/dist/scheduler/cron-engine.d.ts.map +1 -0
- package/dist/scheduler/cron-engine.js +3 -36
- package/dist/scheduler/cron-engine.js.map +1 -0
- package/dist/scheduler/index.d.ts.map +1 -0
- package/dist/scheduler/index.js.map +1 -0
- package/dist/schema/oad.d.ts.map +1 -0
- package/dist/schema/oad.js.map +1 -0
- package/dist/security/approval.d.ts.map +1 -0
- package/dist/security/approval.js.map +1 -0
- package/dist/security/approvals.d.ts.map +1 -0
- package/dist/security/approvals.js.map +1 -0
- package/dist/security/elevated.d.ts.map +1 -0
- package/dist/security/elevated.js.map +1 -0
- package/dist/security/guardrails.d.ts.map +1 -0
- package/dist/security/guardrails.js.map +1 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/keys.d.ts.map +1 -0
- package/dist/security/keys.js.map +1 -0
- package/dist/security/secrets.d.ts.map +1 -0
- package/dist/security/secrets.js.map +1 -0
- package/dist/skills/auto-learn.d.ts.map +1 -0
- package/dist/skills/auto-learn.js.map +1 -0
- package/dist/skills/base.d.ts.map +1 -0
- package/dist/skills/base.js.map +1 -0
- package/dist/skills/builtin/index.d.ts.map +1 -0
- package/dist/skills/builtin/index.js.map +1 -0
- package/dist/skills/document.d.ts.map +1 -0
- package/dist/skills/document.js.map +1 -0
- package/dist/skills/http.d.ts.map +1 -0
- package/dist/skills/http.js.map +1 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/marketplace.d.ts.map +1 -0
- package/dist/skills/marketplace.js.map +1 -0
- package/dist/skills/scheduler.d.ts.map +1 -0
- package/dist/skills/scheduler.js.map +1 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/skills/webhook-trigger.d.ts.map +1 -0
- package/dist/skills/webhook-trigger.js.map +1 -0
- package/dist/studio/server.d.ts.map +1 -0
- package/dist/studio/server.js.map +1 -0
- package/dist/studio/templates-data.d.ts.map +1 -0
- package/dist/studio/templates-data.js.map +1 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/templates/code-reviewer.d.ts.map +1 -0
- package/dist/templates/code-reviewer.js.map +1 -0
- package/dist/templates/content-writer.d.ts.map +1 -0
- package/dist/templates/content-writer.js.map +1 -0
- package/dist/templates/customer-service.d.ts.map +1 -0
- package/dist/templates/customer-service.js.map +1 -0
- package/dist/templates/data-analyst.d.ts.map +1 -0
- package/dist/templates/data-analyst.js.map +1 -0
- package/dist/templates/executive-assistant.d.ts.map +1 -0
- package/dist/templates/executive-assistant.js.map +1 -0
- package/dist/templates/financial-advisor.d.ts.map +1 -0
- package/dist/templates/financial-advisor.js.map +1 -0
- package/dist/templates/hr-recruiter.d.ts.map +1 -0
- package/dist/templates/hr-recruiter.js.map +1 -0
- package/dist/templates/knowledge-base.d.ts.map +1 -0
- package/dist/templates/knowledge-base.js.map +1 -0
- package/dist/templates/legal-assistant.d.ts.map +1 -0
- package/dist/templates/legal-assistant.js.map +1 -0
- package/dist/templates/project-manager.d.ts.map +1 -0
- package/dist/templates/project-manager.js.map +1 -0
- package/dist/templates/sales-assistant.d.ts.map +1 -0
- package/dist/templates/sales-assistant.js.map +1 -0
- package/dist/templates/teacher.d.ts.map +1 -0
- package/dist/templates/teacher.js.map +1 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tools/builtin/browser.d.ts.map +1 -0
- package/dist/tools/builtin/browser.js.map +1 -0
- package/dist/tools/builtin/datetime.d.ts.map +1 -0
- package/dist/tools/builtin/datetime.js.map +1 -0
- package/dist/tools/builtin/file.d.ts.map +1 -0
- package/dist/tools/builtin/file.js.map +1 -0
- package/dist/tools/builtin/home-assistant.d.ts.map +1 -0
- package/dist/tools/builtin/home-assistant.js.map +1 -0
- package/dist/tools/builtin/index.d.ts.map +1 -0
- package/dist/tools/builtin/index.js.map +1 -0
- package/dist/tools/builtin/rl-tools.d.ts.map +1 -0
- package/dist/tools/builtin/rl-tools.js.map +1 -0
- package/dist/tools/builtin/shell.d.ts.map +1 -0
- package/dist/tools/builtin/shell.js.map +1 -0
- package/dist/tools/builtin/vision.d.ts.map +1 -0
- package/dist/tools/builtin/vision.js.map +1 -0
- package/dist/tools/builtin/web-search.d.ts.map +1 -0
- package/dist/tools/builtin/web-search.js.map +1 -0
- package/dist/tools/builtin/web.d.ts.map +1 -0
- package/dist/tools/builtin/web.js.map +1 -0
- package/dist/tools/calculator.d.ts.map +1 -0
- package/dist/tools/calculator.js.map +1 -0
- package/dist/tools/datetime.d.ts.map +1 -0
- package/dist/tools/datetime.js.map +1 -0
- package/dist/tools/document-processor.d.ts.map +1 -0
- package/dist/tools/document-processor.js.map +1 -0
- package/dist/tools/gateway.d.ts.map +1 -0
- package/dist/tools/gateway.js.map +1 -0
- package/dist/tools/image-generator.d.ts.map +1 -0
- package/dist/tools/image-generator.js.map +1 -0
- package/dist/tools/integrations/calendar.d.ts.map +1 -0
- package/dist/tools/integrations/calendar.js.map +1 -0
- package/dist/tools/integrations/code-exec.d.ts.map +1 -0
- package/dist/tools/integrations/code-exec.js.map +1 -0
- package/dist/tools/integrations/csv-analyzer.d.ts.map +1 -0
- package/dist/tools/integrations/csv-analyzer.js.map +1 -0
- package/dist/tools/integrations/database.d.ts.map +1 -0
- package/dist/tools/integrations/database.js.map +1 -0
- package/dist/tools/integrations/email-send.d.ts.map +1 -0
- package/dist/tools/integrations/email-send.js.map +1 -0
- package/dist/tools/integrations/git-tool.d.ts.map +1 -0
- package/dist/tools/integrations/git-tool.js.map +1 -0
- package/dist/tools/integrations/github-tool.d.ts.map +1 -0
- package/dist/tools/integrations/github-tool.js.map +1 -0
- package/dist/tools/integrations/image-gen.d.ts.map +1 -0
- package/dist/tools/integrations/image-gen.js.map +1 -0
- package/dist/tools/integrations/index.d.ts.map +1 -0
- package/dist/tools/integrations/index.js.map +1 -0
- package/dist/tools/integrations/jira.d.ts.map +1 -0
- package/dist/tools/integrations/jira.js.map +1 -0
- package/dist/tools/integrations/notion.d.ts.map +1 -0
- package/dist/tools/integrations/notion.js.map +1 -0
- package/dist/tools/integrations/npm-tool.d.ts.map +1 -0
- package/dist/tools/integrations/npm-tool.js.map +1 -0
- package/dist/tools/integrations/pdf-reader.d.ts.map +1 -0
- package/dist/tools/integrations/pdf-reader.js.map +1 -0
- package/dist/tools/integrations/slack.d.ts.map +1 -0
- package/dist/tools/integrations/slack.js.map +1 -0
- package/dist/tools/integrations/summarizer.d.ts.map +1 -0
- package/dist/tools/integrations/summarizer.js.map +1 -0
- package/dist/tools/integrations/translator.d.ts.map +1 -0
- package/dist/tools/integrations/translator.js.map +1 -0
- package/dist/tools/integrations/trello.d.ts.map +1 -0
- package/dist/tools/integrations/trello.js.map +1 -0
- package/dist/tools/integrations/vector-search.d.ts.map +1 -0
- package/dist/tools/integrations/vector-search.js.map +1 -0
- package/dist/tools/integrations/web-scraper.d.ts.map +1 -0
- package/dist/tools/integrations/web-scraper.js.map +1 -0
- package/dist/tools/integrations/web-search.d.ts.map +1 -0
- package/dist/tools/integrations/web-search.js.map +1 -0
- package/dist/tools/integrations/webhook.d.ts.map +1 -0
- package/dist/tools/integrations/webhook.js.map +1 -0
- package/dist/tools/json-transform.d.ts.map +1 -0
- package/dist/tools/json-transform.js.map +1 -0
- package/dist/tools/mcp-client.d.ts.map +1 -0
- package/dist/tools/mcp-client.js.map +1 -0
- package/dist/tools/mcp.d.ts.map +1 -0
- package/dist/tools/mcp.js.map +1 -0
- package/dist/tools/text-analysis.d.ts.map +1 -0
- package/dist/tools/text-analysis.js.map +1 -0
- package/dist/tools/web-scraper.d.ts.map +1 -0
- package/dist/tools/web-scraper.js.map +1 -0
- package/dist/tools/web-search.d.ts.map +1 -0
- package/dist/tools/web-search.js.map +1 -0
- package/dist/traces/index.d.ts.map +1 -0
- package/dist/traces/index.js.map +1 -0
- package/dist/ui/components.d.ts.map +1 -0
- package/dist/ui/components.js.map +1 -0
- package/package.json +1 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -20
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -14
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -13
- package/.github/workflows/ci.yml +0 -24
- package/docs/.vitepress/config.ts +0 -103
- package/docs/api/cli.md +0 -48
- package/docs/api/oad-schema.md +0 -64
- package/docs/api/sdk.md +0 -80
- package/docs/guide/concepts.md +0 -51
- package/docs/guide/configuration.md +0 -79
- package/docs/guide/deployment.md +0 -42
- package/docs/guide/getting-started.md +0 -44
- package/docs/guide/templates.md +0 -28
- package/docs/guide/testing.md +0 -84
- package/docs/index.md +0 -27
- package/docs/zh/api/cli.md +0 -54
- package/docs/zh/api/oad-schema.md +0 -87
- package/docs/zh/api/sdk.md +0 -102
- package/docs/zh/guide/concepts.md +0 -104
- package/docs/zh/guide/configuration.md +0 -135
- package/docs/zh/guide/deployment.md +0 -81
- package/docs/zh/guide/getting-started.md +0 -82
- package/docs/zh/guide/templates.md +0 -84
- package/docs/zh/guide/testing.md +0 -88
- package/docs/zh/index.md +0 -27
- package/fix-sidebar.mjs +0 -188
- package/serve-studio.js +0 -13
- package/serve-test.js +0 -25
- package/src/analytics/index.ts +0 -66
- package/src/channels/dingtalk.ts +0 -46
- package/src/channels/discord.ts +0 -192
- package/src/channels/email.ts +0 -351
- package/src/channels/feishu.ts +0 -349
- package/src/channels/googlechat.ts +0 -42
- package/src/channels/imessage.ts +0 -32
- package/src/channels/index.ts +0 -15
- package/src/channels/irc.ts +0 -82
- package/src/channels/line.ts +0 -33
- package/src/channels/matrix.ts +0 -34
- package/src/channels/mattermost.ts +0 -57
- package/src/channels/msteams.ts +0 -33
- package/src/channels/nostr.ts +0 -33
- package/src/channels/qq.ts +0 -34
- package/src/channels/signal.ts +0 -33
- package/src/channels/slack.ts +0 -217
- package/src/channels/sms.ts +0 -34
- package/src/channels/telegram.ts +0 -616
- package/src/channels/twitch.ts +0 -65
- package/src/channels/voice-call.ts +0 -100
- package/src/channels/voice.ts +0 -471
- package/src/channels/web.ts +0 -632
- package/src/channels/webhook.ts +0 -199
- package/src/channels/websocket.ts +0 -399
- package/src/channels/wechat.ts +0 -329
- package/src/channels/whatsapp.ts +0 -33
- package/src/cli/chat.ts +0 -99
- package/src/cli/setup.ts +0 -314
- package/src/cli.ts +0 -2723
- package/src/core/a2a.ts +0 -203
- package/src/core/agent.ts +0 -476
- package/src/core/analytics-engine.ts +0 -186
- package/src/core/api-server.ts +0 -277
- package/src/core/audio.ts +0 -98
- package/src/core/auth.ts +0 -57
- package/src/core/cache.ts +0 -141
- package/src/core/collaboration.ts +0 -275
- package/src/core/compose.ts +0 -77
- package/src/core/config.ts +0 -14
- package/src/core/context-discovery.ts +0 -85
- package/src/core/context-refs.ts +0 -140
- package/src/core/errors.ts +0 -148
- package/src/core/gateway.ts +0 -106
- package/src/core/heartbeat.ts +0 -51
- package/src/core/hitl.ts +0 -138
- package/src/core/hooks.ts +0 -105
- package/src/core/ide-bridge.ts +0 -133
- package/src/core/knowledge.ts +0 -255
- package/src/core/logger.ts +0 -57
- package/src/core/node-network.ts +0 -86
- package/src/core/orchestrator.ts +0 -215
- package/src/core/performance.ts +0 -187
- package/src/core/profiles.ts +0 -122
- package/src/core/rate-limiter.ts +0 -128
- package/src/core/room.ts +0 -109
- package/src/core/runtime.ts +0 -410
- package/src/core/sandbox.ts +0 -344
- package/src/core/scheduler.ts +0 -187
- package/src/core/security.ts +0 -171
- package/src/core/session-manager.ts +0 -137
- package/src/core/streaming.ts +0 -195
- package/src/core/subagent.ts +0 -98
- package/src/core/types.ts +0 -68
- package/src/core/versioning.ts +0 -106
- package/src/core/vision.ts +0 -180
- package/src/core/watch.ts +0 -178
- package/src/core/workflow-graph.ts +0 -365
- package/src/core/workflow.ts +0 -235
- package/src/daemon.ts +0 -96
- package/src/deploy/hermes.ts +0 -156
- package/src/deploy/index.ts +0 -255
- package/src/deploy/openclaw.ts +0 -190
- package/src/doctor.ts +0 -156
- package/src/eval/index.ts +0 -211
- package/src/eval/suites/basic.json +0 -16
- package/src/eval/suites/memory.json +0 -12
- package/src/eval/suites/safety.json +0 -14
- package/src/hub/brain-seed.ts +0 -54
- package/src/hub/client.ts +0 -60
- package/src/i18n/index.ts +0 -216
- package/src/index.ts +0 -283
- package/src/mcp/servers/calculator-mcp.ts +0 -65
- package/src/mcp/servers/crypto-mcp.ts +0 -73
- package/src/mcp/servers/database-mcp.ts +0 -72
- package/src/mcp/servers/datetime-mcp.ts +0 -69
- package/src/mcp/servers/filesystem.ts +0 -66
- package/src/mcp/servers/github-mcp.ts +0 -58
- package/src/mcp/servers/index.ts +0 -63
- package/src/mcp/servers/json-mcp.ts +0 -102
- package/src/mcp/servers/memory-mcp.ts +0 -56
- package/src/mcp/servers/regex-mcp.ts +0 -53
- package/src/mcp/servers/web-mcp.ts +0 -49
- package/src/memory/context-compressor.ts +0 -189
- package/src/memory/deepbrain.ts +0 -108
- package/src/memory/index.ts +0 -41
- package/src/memory/seed-loader.ts +0 -212
- package/src/memory/user-profiler.ts +0 -215
- package/src/plugins/content-filter.ts +0 -23
- package/src/plugins/index.ts +0 -339
- package/src/plugins/logger.ts +0 -18
- package/src/plugins/rate-limiter.ts +0 -38
- package/src/protocols/a2a/client.ts +0 -132
- package/src/protocols/a2a/index.ts +0 -8
- package/src/protocols/a2a/server.ts +0 -333
- package/src/protocols/a2a/types.ts +0 -88
- package/src/protocols/a2a/utils.ts +0 -50
- package/src/protocols/agui/client.ts +0 -83
- package/src/protocols/agui/index.ts +0 -4
- package/src/protocols/agui/server.ts +0 -218
- package/src/protocols/agui/types.ts +0 -153
- package/src/protocols/index.ts +0 -2
- package/src/protocols/mcp/agent-tools.ts +0 -134
- package/src/protocols/mcp/index.ts +0 -8
- package/src/protocols/mcp/server.ts +0 -262
- package/src/protocols/mcp/types.ts +0 -69
- package/src/providers/index.ts +0 -632
- package/src/publish/index.ts +0 -376
- package/src/scheduler/cron-engine.ts +0 -191
- package/src/scheduler/index.ts +0 -2
- package/src/schema/oad.ts +0 -217
- package/src/security/approval.ts +0 -131
- package/src/security/approvals.ts +0 -143
- package/src/security/elevated.ts +0 -105
- package/src/security/guardrails.ts +0 -248
- package/src/security/index.ts +0 -9
- package/src/security/keys.ts +0 -87
- package/src/security/secrets.ts +0 -129
- package/src/skills/auto-learn.ts +0 -262
- package/src/skills/base.ts +0 -16
- package/src/skills/builtin/index.ts +0 -408
- package/src/skills/document.ts +0 -100
- package/src/skills/http.ts +0 -35
- package/src/skills/index.ts +0 -27
- package/src/skills/marketplace.ts +0 -113
- package/src/skills/scheduler.ts +0 -80
- package/src/skills/types.ts +0 -42
- package/src/skills/webhook-trigger.ts +0 -59
- package/src/studio/server.ts +0 -1791
- package/src/studio/templates-data.ts +0 -178
- package/src/studio-ui/index.html +0 -3076
- package/src/telemetry/index.ts +0 -324
- package/src/templates/code-reviewer.ts +0 -30
- package/src/templates/content-writer.ts +0 -58
- package/src/templates/customer-service.ts +0 -76
- package/src/templates/data-analyst.ts +0 -66
- package/src/templates/executive-assistant.ts +0 -71
- package/src/templates/financial-advisor.ts +0 -60
- package/src/templates/hr-recruiter.ts +0 -58
- package/src/templates/knowledge-base.ts +0 -27
- package/src/templates/legal-assistant.ts +0 -71
- package/src/templates/project-manager.ts +0 -58
- package/src/templates/sales-assistant.ts +0 -75
- package/src/templates/teacher.ts +0 -75
- package/src/testing/index.ts +0 -181
- package/src/tools/builtin/browser.ts +0 -299
- package/src/tools/builtin/datetime.ts +0 -41
- package/src/tools/builtin/file.ts +0 -107
- package/src/tools/builtin/home-assistant.ts +0 -116
- package/src/tools/builtin/index.ts +0 -37
- package/src/tools/builtin/rl-tools.ts +0 -243
- package/src/tools/builtin/shell.ts +0 -43
- package/src/tools/builtin/vision.ts +0 -64
- package/src/tools/builtin/web-search.ts +0 -126
- package/src/tools/builtin/web.ts +0 -35
- package/src/tools/calculator.ts +0 -73
- package/src/tools/datetime.ts +0 -149
- package/src/tools/document-processor.ts +0 -213
- package/src/tools/gateway.ts +0 -220
- package/src/tools/image-generator.ts +0 -150
- package/src/tools/integrations/calendar.ts +0 -73
- package/src/tools/integrations/code-exec.ts +0 -39
- package/src/tools/integrations/csv-analyzer.ts +0 -92
- package/src/tools/integrations/database.ts +0 -44
- package/src/tools/integrations/email-send.ts +0 -76
- package/src/tools/integrations/git-tool.ts +0 -42
- package/src/tools/integrations/github-tool.ts +0 -76
- package/src/tools/integrations/image-gen.ts +0 -56
- package/src/tools/integrations/index.ts +0 -92
- package/src/tools/integrations/jira.ts +0 -83
- package/src/tools/integrations/notion.ts +0 -71
- package/src/tools/integrations/npm-tool.ts +0 -48
- package/src/tools/integrations/pdf-reader.ts +0 -58
- package/src/tools/integrations/slack.ts +0 -65
- package/src/tools/integrations/summarizer.ts +0 -49
- package/src/tools/integrations/translator.ts +0 -48
- package/src/tools/integrations/trello.ts +0 -60
- package/src/tools/integrations/vector-search.ts +0 -42
- package/src/tools/integrations/web-scraper.ts +0 -47
- package/src/tools/integrations/web-search.ts +0 -58
- package/src/tools/integrations/webhook.ts +0 -38
- package/src/tools/json-transform.ts +0 -187
- package/src/tools/mcp-client.ts +0 -131
- package/src/tools/mcp.ts +0 -76
- package/src/tools/text-analysis.ts +0 -116
- package/src/tools/web-scraper.ts +0 -179
- package/src/tools/web-search.ts +0 -180
- package/src/traces/index.ts +0 -132
- package/src/types/agent-workstation.d.ts +0 -2
- package/src/ui/components.ts +0 -127
- package/srv-err.txt +0 -0
- package/srv-out.txt +0 -1
- package/test-agent/Dockerfile +0 -9
- package/test-agent/README.md +0 -50
- package/test-agent/agent.yaml +0 -23
- package/test-agent/docker-compose.yml +0 -11
- package/test-agent/oad.yaml +0 -31
- package/test-agent/package-lock.json +0 -1492
- package/test-agent/package.json +0 -18
- package/test-agent/src/index.ts +0 -24
- package/test-agent/src/skills/echo.ts +0 -15
- package/test-agent/tsconfig.json +0 -25
- package/test-full.js +0 -43
- package/test-sidebar.js +0 -22
- package/test-studio3.js +0 -75
- package/test-studio4.js +0 -41
- package/tests/a2a-protocol.test.ts +0 -285
- package/tests/a2a.test.ts +0 -66
- package/tests/agent.test.ts +0 -72
- package/tests/agui-protocol.test.ts +0 -246
- package/tests/analytics.test.ts +0 -50
- package/tests/api-server.test.ts +0 -148
- package/tests/approvals.test.ts +0 -89
- package/tests/audio.test.ts +0 -40
- package/tests/auto-learn.test.ts +0 -105
- package/tests/brain-seed-extended.test.ts +0 -490
- package/tests/brain-seed.test.ts +0 -239
- package/tests/browser.test.ts +0 -179
- package/tests/builtin-tools.test.ts +0 -83
- package/tests/channel.test.ts +0 -39
- package/tests/channels/discord.test.ts +0 -79
- package/tests/channels/email.test.ts +0 -148
- package/tests/channels/feishu.test.ts +0 -123
- package/tests/channels/telegram.test.ts +0 -129
- package/tests/channels/websocket.test.ts +0 -53
- package/tests/channels/wechat.test.ts +0 -170
- package/tests/channels-extra.test.ts +0 -45
- package/tests/chat-cli.test.ts +0 -160
- package/tests/cli.test.ts +0 -46
- package/tests/collaboration.test.ts +0 -319
- package/tests/context-compressor.test.ts +0 -172
- package/tests/context-refs.test.ts +0 -121
- package/tests/cron-engine.test.ts +0 -101
- package/tests/daemon.test.ts +0 -135
- package/tests/deepbrain-wire.test.ts +0 -234
- package/tests/deploy-and-dag.test.ts +0 -196
- package/tests/doctor.test.ts +0 -38
- package/tests/document-processor.test.ts +0 -69
- package/tests/e2e-nocode.test.ts +0 -442
- package/tests/e2e.test.ts +0 -134
- package/tests/elevated.test.ts +0 -69
- package/tests/errors.test.ts +0 -83
- package/tests/eval.test.ts +0 -173
- package/tests/gateway.test.ts +0 -63
- package/tests/guardrails.test.ts +0 -177
- package/tests/hitl.test.ts +0 -71
- package/tests/home-assistant.test.ts +0 -40
- package/tests/hooks.test.ts +0 -79
- package/tests/i18n.test.ts +0 -41
- package/tests/ide-bridge.test.ts +0 -38
- package/tests/image-generator.test.ts +0 -84
- package/tests/init-role.test.ts +0 -124
- package/tests/integrations.test.ts +0 -249
- package/tests/mcp-client.test.ts +0 -92
- package/tests/mcp-server.test.ts +0 -178
- package/tests/mcp-servers.test.ts +0 -260
- package/tests/mcp.test.ts +0 -54
- package/tests/node-network.test.ts +0 -74
- package/tests/oad.test.ts +0 -68
- package/tests/performance.test.ts +0 -115
- package/tests/plugin-a2a-enhanced.test.ts +0 -230
- package/tests/plugin.test.ts +0 -74
- package/tests/profiles.test.ts +0 -61
- package/tests/publish.test.ts +0 -231
- package/tests/rl-tools.test.ts +0 -93
- package/tests/room.test.ts +0 -106
- package/tests/runtime.test.ts +0 -42
- package/tests/sandbox-manager.test.ts +0 -46
- package/tests/sandbox.test.ts +0 -46
- package/tests/scheduler.test.ts +0 -200
- package/tests/secrets.test.ts +0 -107
- package/tests/security-enhanced.test.ts +0 -233
- package/tests/security.test.ts +0 -60
- package/tests/settings-api.test.ts +0 -148
- package/tests/setup.test.ts +0 -73
- package/tests/skill-learner.test.ts +0 -161
- package/tests/streaming.test.ts +0 -109
- package/tests/studio.test.ts +0 -402
- package/tests/subagent.test.ts +0 -193
- package/tests/telegram-discord.test.ts +0 -60
- package/tests/telemetry.test.ts +0 -186
- package/tests/templates.test.ts +0 -77
- package/tests/tools/builtin-extended.test.ts +0 -138
- package/tests/user-profiler.test.ts +0 -169
- package/tests/v070.test.ts +0 -76
- package/tests/v090-features.test.ts +0 -254
- package/tests/versioning.test.ts +0 -75
- package/tests/vision.test.ts +0 -61
- package/tests/voice-call.test.ts +0 -47
- package/tests/voice-enhanced.test.ts +0 -169
- package/tests/voice-interaction.test.ts +0 -38
- package/tests/voice.test.ts +0 -61
- package/tests/web-search.test.ts +0 -155
- package/tests/webhook.test.ts +0 -29
- package/tests/workflow-graph.test.ts +0 -279
- package/tests/workflow.test.ts +0 -143
- package/tmp-js-test.js +0 -1532
- package/tmp-sc.js +0 -1716
- package/tutorial/customer-service-agent/README.md +0 -612
- package/tutorial/customer-service-agent/SOUL.md +0 -26
- package/tutorial/customer-service-agent/agent.yaml +0 -63
- package/tutorial/customer-service-agent/package.json +0 -19
- package/tutorial/customer-service-agent/src/index.ts +0 -69
- package/tutorial/customer-service-agent/src/skills/faq.ts +0 -27
- package/tutorial/customer-service-agent/src/skills/ticket.ts +0 -22
- package/tutorial/customer-service-agent/tsconfig.json +0 -14
- package/vitest.config.ts +0 -9
package/src/channels/feishu.ts
DELETED
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from './index';
|
|
2
|
-
import type { Message } from '../core/types';
|
|
3
|
-
import * as http from 'http';
|
|
4
|
-
import * as https from 'https';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Feishu / Lark Channel — v1.1.0
|
|
8
|
-
*
|
|
9
|
-
* Supports:
|
|
10
|
-
* - Event Subscription (webhook) mode for receiving messages
|
|
11
|
-
* - Bot send via Feishu Open API
|
|
12
|
-
* - URL verification challenge
|
|
13
|
-
* - Message card (interactive) responses
|
|
14
|
-
* - Group chat & P2P messaging
|
|
15
|
-
* - Event deduplication
|
|
16
|
-
* - No external dependencies (uses Node.js built-in http/https)
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
export interface FeishuChannelConfig {
|
|
20
|
-
/** Feishu App ID */
|
|
21
|
-
appId?: string;
|
|
22
|
-
/** Feishu App Secret */
|
|
23
|
-
appSecret?: string;
|
|
24
|
-
/** Verification token for event subscription */
|
|
25
|
-
verificationToken?: string;
|
|
26
|
-
/** Encrypt key (optional, for encrypted events) */
|
|
27
|
-
encryptKey?: string;
|
|
28
|
-
/** Webhook server port (default: 8081) */
|
|
29
|
-
port?: number;
|
|
30
|
-
/** API base URL (use 'https://open.larksuite.com' for Lark international) */
|
|
31
|
-
apiBase?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface FeishuTokenCache {
|
|
35
|
-
token: string;
|
|
36
|
-
expiresAt: number;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export class FeishuChannel extends BaseChannel {
|
|
40
|
-
readonly type = 'feishu';
|
|
41
|
-
private config: Required<Pick<FeishuChannelConfig, 'port' | 'apiBase'>> & FeishuChannelConfig;
|
|
42
|
-
private server: http.Server | null = null;
|
|
43
|
-
private tokenCache: FeishuTokenCache | null = null;
|
|
44
|
-
private processedEvents = new Set<string>();
|
|
45
|
-
|
|
46
|
-
constructor(config: FeishuChannelConfig = {}) {
|
|
47
|
-
super();
|
|
48
|
-
this.config = {
|
|
49
|
-
appId: config.appId ?? process.env.FEISHU_APP_ID ?? '',
|
|
50
|
-
appSecret: config.appSecret ?? process.env.FEISHU_APP_SECRET ?? '',
|
|
51
|
-
verificationToken: config.verificationToken ?? process.env.FEISHU_VERIFICATION_TOKEN ?? '',
|
|
52
|
-
encryptKey: config.encryptKey ?? process.env.FEISHU_ENCRYPT_KEY,
|
|
53
|
-
port: config.port ?? 8081,
|
|
54
|
-
apiBase: config.apiBase ?? 'https://open.feishu.cn',
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
async start(): Promise<void> {
|
|
59
|
-
if (!this.config.appId || !this.config.appSecret) {
|
|
60
|
-
console.warn('[FeishuChannel] Missing appId/appSecret. Set FEISHU_APP_ID and FEISHU_APP_SECRET.');
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
this.server = http.createServer(async (req, res) => {
|
|
65
|
-
if (req.method === 'GET' && req.url === '/health') {
|
|
66
|
-
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
67
|
-
res.end(JSON.stringify({ status: 'ok', channel: 'feishu' }));
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (req.method !== 'POST') {
|
|
72
|
-
res.writeHead(404);
|
|
73
|
-
res.end();
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
try {
|
|
78
|
-
const body = await this.readBody(req);
|
|
79
|
-
const parsed = JSON.parse(body);
|
|
80
|
-
await this.handleEvent(parsed, res);
|
|
81
|
-
} catch (err) {
|
|
82
|
-
console.error('[FeishuChannel] Error:', err);
|
|
83
|
-
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
84
|
-
res.end(JSON.stringify({ error: 'Internal error' }));
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
return new Promise((resolve) => {
|
|
89
|
-
this.server!.listen(this.config.port, () => {
|
|
90
|
-
console.log(`[FeishuChannel] Listening on port ${this.config.port}`);
|
|
91
|
-
resolve();
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
async stop(): Promise<void> {
|
|
97
|
-
return new Promise((resolve, reject) => {
|
|
98
|
-
if (!this.server) return resolve();
|
|
99
|
-
this.server.close((err) => (err ? reject(err) : resolve()));
|
|
100
|
-
this.server = null;
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/** Handle Feishu event */
|
|
105
|
-
private async handleEvent(body: any, res: http.ServerResponse): Promise<void> {
|
|
106
|
-
// URL verification challenge
|
|
107
|
-
if (body.type === 'url_verification') {
|
|
108
|
-
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
109
|
-
res.end(JSON.stringify({ challenge: body.challenge }));
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Deduplicate events
|
|
114
|
-
const eventId = body.header?.event_id;
|
|
115
|
-
if (eventId && this.processedEvents.has(eventId)) {
|
|
116
|
-
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
117
|
-
res.end(JSON.stringify({ ok: true }));
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (eventId) {
|
|
121
|
-
this.processedEvents.add(eventId);
|
|
122
|
-
if (this.processedEvents.size > 1000) {
|
|
123
|
-
const arr = [...this.processedEvents];
|
|
124
|
-
this.processedEvents = new Set(arr.slice(-500));
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Verify token
|
|
129
|
-
if (this.config.verificationToken && body.header?.token !== this.config.verificationToken) {
|
|
130
|
-
res.writeHead(403, { 'Content-Type': 'application/json' });
|
|
131
|
-
res.end(JSON.stringify({ error: 'Invalid verification token' }));
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Handle im.message.receive_v1
|
|
136
|
-
const event = body.event;
|
|
137
|
-
if (body.header?.event_type === 'im.message.receive_v1' && this.handler) {
|
|
138
|
-
const msgBody = event?.message;
|
|
139
|
-
if (!msgBody) {
|
|
140
|
-
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
141
|
-
res.end(JSON.stringify({ ok: true }));
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
const msgType = msgBody.message_type;
|
|
146
|
-
let content = '';
|
|
147
|
-
if (msgType === 'text') {
|
|
148
|
-
try {
|
|
149
|
-
const parsed = JSON.parse(msgBody.content);
|
|
150
|
-
content = parsed.text ?? '';
|
|
151
|
-
} catch {
|
|
152
|
-
content = msgBody.content ?? '';
|
|
153
|
-
}
|
|
154
|
-
} else {
|
|
155
|
-
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
156
|
-
res.end(JSON.stringify({ ok: true }));
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Strip @bot mentions
|
|
161
|
-
content = content.replace(/@_user_\d+/g, '').trim();
|
|
162
|
-
if (!content) {
|
|
163
|
-
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
164
|
-
res.end(JSON.stringify({ ok: true }));
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const chatId = msgBody.chat_id;
|
|
169
|
-
const senderId = event.sender?.sender_id?.open_id ?? 'unknown';
|
|
170
|
-
|
|
171
|
-
const msg: Message = {
|
|
172
|
-
id: `feishu_${msgBody.message_id}`,
|
|
173
|
-
role: 'user',
|
|
174
|
-
content,
|
|
175
|
-
timestamp: parseInt(msgBody.create_time, 10) || Date.now(),
|
|
176
|
-
metadata: {
|
|
177
|
-
sessionId: `feishu_${chatId}`,
|
|
178
|
-
chatId,
|
|
179
|
-
userId: senderId,
|
|
180
|
-
platform: 'feishu',
|
|
181
|
-
messageId: msgBody.message_id,
|
|
182
|
-
chatType: msgBody.chat_type,
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
// Don't block the response
|
|
187
|
-
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
188
|
-
res.end(JSON.stringify({ ok: true }));
|
|
189
|
-
|
|
190
|
-
try {
|
|
191
|
-
const response = await this.handler(msg);
|
|
192
|
-
await this.sendTextMessage(chatId, response.content);
|
|
193
|
-
} catch (err) {
|
|
194
|
-
console.error('[FeishuChannel] Handler error:', err);
|
|
195
|
-
}
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
200
|
-
res.end(JSON.stringify({ ok: true }));
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/** Parse Feishu event body (exported for testing) */
|
|
204
|
-
static parseEventBody(body: any): { type: string; challenge?: string; eventType?: string; content?: string; chatId?: string; senderId?: string; messageId?: string } {
|
|
205
|
-
if (body.type === 'url_verification') {
|
|
206
|
-
return { type: 'url_verification', challenge: body.challenge };
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const eventType = body.header?.event_type;
|
|
210
|
-
const event = body.event;
|
|
211
|
-
|
|
212
|
-
if (eventType === 'im.message.receive_v1' && event?.message) {
|
|
213
|
-
const msgBody = event.message;
|
|
214
|
-
let content = '';
|
|
215
|
-
if (msgBody.message_type === 'text') {
|
|
216
|
-
try {
|
|
217
|
-
const parsed = JSON.parse(msgBody.content);
|
|
218
|
-
content = parsed.text ?? '';
|
|
219
|
-
} catch {
|
|
220
|
-
content = msgBody.content ?? '';
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
return {
|
|
225
|
-
type: 'message',
|
|
226
|
-
eventType,
|
|
227
|
-
content: content.replace(/@_user_\d+/g, '').trim(),
|
|
228
|
-
chatId: msgBody.chat_id,
|
|
229
|
-
senderId: event.sender?.sender_id?.open_id,
|
|
230
|
-
messageId: msgBody.message_id,
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return { type: 'unknown', eventType };
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/** Get tenant access token (cached) */
|
|
238
|
-
private async getAccessToken(): Promise<string> {
|
|
239
|
-
if (this.tokenCache && Date.now() < this.tokenCache.expiresAt) {
|
|
240
|
-
return this.tokenCache.token;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const body = JSON.stringify({
|
|
244
|
-
app_id: this.config.appId,
|
|
245
|
-
app_secret: this.config.appSecret,
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
const result = await this.httpsPost(
|
|
249
|
-
`${this.config.apiBase}/open-apis/auth/v3/tenant_access_token/internal`,
|
|
250
|
-
body
|
|
251
|
-
);
|
|
252
|
-
|
|
253
|
-
const data = JSON.parse(result);
|
|
254
|
-
if (data.code !== 0) {
|
|
255
|
-
throw new Error(`[FeishuChannel] Failed to get access token: ${result}`);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
this.tokenCache = {
|
|
259
|
-
token: data.tenant_access_token,
|
|
260
|
-
expiresAt: Date.now() + (data.expire - 60) * 1000,
|
|
261
|
-
};
|
|
262
|
-
return this.tokenCache.token;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
/** Send a text message to a chat */
|
|
266
|
-
async sendTextMessage(chatId: string, text: string): Promise<void> {
|
|
267
|
-
const token = await this.getAccessToken();
|
|
268
|
-
const body = JSON.stringify({
|
|
269
|
-
receive_id: chatId,
|
|
270
|
-
msg_type: 'text',
|
|
271
|
-
content: JSON.stringify({ text }),
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
const url = `${this.config.apiBase}/open-apis/im/v1/messages?receive_id_type=chat_id`;
|
|
275
|
-
await this.httpsPostWithAuth(url, body, token);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/** Send an interactive card message */
|
|
279
|
-
async sendCardMessage(chatId: string, card: Record<string, unknown>): Promise<void> {
|
|
280
|
-
const token = await this.getAccessToken();
|
|
281
|
-
const body = JSON.stringify({
|
|
282
|
-
receive_id: chatId,
|
|
283
|
-
msg_type: 'interactive',
|
|
284
|
-
content: JSON.stringify(card),
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
const url = `${this.config.apiBase}/open-apis/im/v1/messages?receive_id_type=chat_id`;
|
|
288
|
-
await this.httpsPostWithAuth(url, body, token);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/** Read request body */
|
|
292
|
-
private readBody(req: http.IncomingMessage): Promise<string> {
|
|
293
|
-
return new Promise((resolve, reject) => {
|
|
294
|
-
const chunks: Buffer[] = [];
|
|
295
|
-
req.on('data', (chunk: Buffer) => chunks.push(chunk));
|
|
296
|
-
req.on('end', () => resolve(Buffer.concat(chunks).toString('utf-8')));
|
|
297
|
-
req.on('error', reject);
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/** HTTPS POST */
|
|
302
|
-
private httpsPost(url: string, body: string): Promise<string> {
|
|
303
|
-
return new Promise((resolve, reject) => {
|
|
304
|
-
const parsed = new URL(url);
|
|
305
|
-
const req = https.request({
|
|
306
|
-
hostname: parsed.hostname,
|
|
307
|
-
path: parsed.pathname + parsed.search,
|
|
308
|
-
method: 'POST',
|
|
309
|
-
headers: {
|
|
310
|
-
'Content-Type': 'application/json',
|
|
311
|
-
'Content-Length': Buffer.byteLength(body),
|
|
312
|
-
},
|
|
313
|
-
}, (res) => {
|
|
314
|
-
const chunks: Buffer[] = [];
|
|
315
|
-
res.on('data', (chunk: Buffer) => chunks.push(chunk));
|
|
316
|
-
res.on('end', () => resolve(Buffer.concat(chunks).toString()));
|
|
317
|
-
res.on('error', reject);
|
|
318
|
-
});
|
|
319
|
-
req.on('error', reject);
|
|
320
|
-
req.write(body);
|
|
321
|
-
req.end();
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/** HTTPS POST with Bearer auth */
|
|
326
|
-
private httpsPostWithAuth(url: string, body: string, token: string): Promise<string> {
|
|
327
|
-
return new Promise((resolve, reject) => {
|
|
328
|
-
const parsed = new URL(url);
|
|
329
|
-
const req = https.request({
|
|
330
|
-
hostname: parsed.hostname,
|
|
331
|
-
path: parsed.pathname + parsed.search,
|
|
332
|
-
method: 'POST',
|
|
333
|
-
headers: {
|
|
334
|
-
'Content-Type': 'application/json',
|
|
335
|
-
'Content-Length': Buffer.byteLength(body),
|
|
336
|
-
'Authorization': `Bearer ${token}`,
|
|
337
|
-
},
|
|
338
|
-
}, (res) => {
|
|
339
|
-
const chunks: Buffer[] = [];
|
|
340
|
-
res.on('data', (chunk: Buffer) => chunks.push(chunk));
|
|
341
|
-
res.on('end', () => resolve(Buffer.concat(chunks).toString()));
|
|
342
|
-
res.on('error', reject);
|
|
343
|
-
});
|
|
344
|
-
req.on('error', reject);
|
|
345
|
-
req.write(body);
|
|
346
|
-
req.end();
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from './index';
|
|
2
|
-
import type { Message } from '../core/types';
|
|
3
|
-
|
|
4
|
-
export interface GoogleChatChannelConfig {
|
|
5
|
-
webhookUrl: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class GoogleChatChannel extends BaseChannel {
|
|
9
|
-
readonly type = 'googlechat';
|
|
10
|
-
private config: GoogleChatChannelConfig;
|
|
11
|
-
private running = false;
|
|
12
|
-
|
|
13
|
-
constructor(config: GoogleChatChannelConfig) {
|
|
14
|
-
super();
|
|
15
|
-
if (!config.webhookUrl) {
|
|
16
|
-
throw new Error('GoogleChatChannel requires webhookUrl in config');
|
|
17
|
-
}
|
|
18
|
-
this.config = config;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async start(): Promise<void> {
|
|
22
|
-
this.running = true;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async stop(): Promise<void> {
|
|
26
|
-
this.running = false;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async send(spaceId: string, text: string): Promise<void> {
|
|
30
|
-
if (!this.running) {
|
|
31
|
-
throw new Error('GoogleChatChannel: not started. Call start() first.');
|
|
32
|
-
}
|
|
33
|
-
const res = await fetch(this.config.webhookUrl, {
|
|
34
|
-
method: 'POST',
|
|
35
|
-
headers: { 'Content-Type': 'application/json' },
|
|
36
|
-
body: JSON.stringify({ text }),
|
|
37
|
-
});
|
|
38
|
-
if (!res.ok) {
|
|
39
|
-
throw new Error(`Google Chat webhook failed: ${res.status}`);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
package/src/channels/imessage.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from './index';
|
|
2
|
-
import type { Message } from '../core/types';
|
|
3
|
-
|
|
4
|
-
export interface IMessageChannelConfig {
|
|
5
|
-
applescriptPath?: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class IMessageChannel extends BaseChannel {
|
|
9
|
-
readonly type = 'imessage';
|
|
10
|
-
private config: IMessageChannelConfig;
|
|
11
|
-
|
|
12
|
-
constructor(config: IMessageChannelConfig = {}) {
|
|
13
|
-
super();
|
|
14
|
-
this.config = config;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async start(): Promise<void> {
|
|
18
|
-
try {
|
|
19
|
-
require('macOS iMessage CLI');
|
|
20
|
-
} catch {
|
|
21
|
-
throw new Error('Install macOS iMessage CLI to use the IMessageChannel. Run: npm install macOS iMessage CLI');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async stop(): Promise<void> {
|
|
26
|
-
// cleanup
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async send(chatId: string, text: string): Promise<void> {
|
|
30
|
-
throw new Error('IMessageChannel: not yet connected. Call start() first.');
|
|
31
|
-
}
|
|
32
|
-
}
|
package/src/channels/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { IChannel, Message } from '../core/types';
|
|
2
|
-
|
|
3
|
-
export type { IChannel } from '../core/types';
|
|
4
|
-
|
|
5
|
-
export abstract class BaseChannel implements IChannel {
|
|
6
|
-
abstract type: string;
|
|
7
|
-
protected handler: ((message: Message) => Promise<Message>) | null = null;
|
|
8
|
-
|
|
9
|
-
onMessage(handler: (message: Message) => Promise<Message>): void {
|
|
10
|
-
this.handler = handler;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
abstract start(): Promise<void>;
|
|
14
|
-
abstract stop(): Promise<void>;
|
|
15
|
-
}
|
package/src/channels/irc.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from './index';
|
|
2
|
-
import type { Message } from '../core/types';
|
|
3
|
-
|
|
4
|
-
export interface IRCChannelConfig {
|
|
5
|
-
host: string;
|
|
6
|
-
port?: number;
|
|
7
|
-
nick: string;
|
|
8
|
-
channels: string[];
|
|
9
|
-
tls?: boolean;
|
|
10
|
-
password?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export class IRCChannel extends BaseChannel {
|
|
14
|
-
readonly type = 'irc';
|
|
15
|
-
private config: IRCChannelConfig;
|
|
16
|
-
private client: any = null;
|
|
17
|
-
private running = false;
|
|
18
|
-
|
|
19
|
-
constructor(config: IRCChannelConfig) {
|
|
20
|
-
super();
|
|
21
|
-
if (!config.host || !config.nick || !config.channels?.length) {
|
|
22
|
-
throw new Error('IRCChannel requires host, nick, and channels in config');
|
|
23
|
-
}
|
|
24
|
-
this.config = config;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async start(): Promise<void> {
|
|
28
|
-
let IRC: any;
|
|
29
|
-
try {
|
|
30
|
-
IRC = require('irc-framework');
|
|
31
|
-
} catch {
|
|
32
|
-
throw new Error('Install irc-framework to use the IRCChannel. Run: npm install irc-framework');
|
|
33
|
-
}
|
|
34
|
-
this.client = new IRC.Client();
|
|
35
|
-
this.client.connect({
|
|
36
|
-
host: this.config.host,
|
|
37
|
-
port: this.config.port ?? (this.config.tls ? 6697 : 6667),
|
|
38
|
-
nick: this.config.nick,
|
|
39
|
-
tls: this.config.tls ?? false,
|
|
40
|
-
password: this.config.password,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
await new Promise<void>((resolve, reject) => {
|
|
44
|
-
this.client.on('registered', () => {
|
|
45
|
-
for (const ch of this.config.channels) {
|
|
46
|
-
this.client.join(ch);
|
|
47
|
-
}
|
|
48
|
-
resolve();
|
|
49
|
-
});
|
|
50
|
-
this.client.on('error', (err: any) => reject(new Error(`IRC connection error: ${err.message || err}`)));
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
this.running = true;
|
|
54
|
-
|
|
55
|
-
this.client.on('privmsg', async (event: any) => {
|
|
56
|
-
if (!this.handler) return;
|
|
57
|
-
const msg: Message = {
|
|
58
|
-
id: Date.now().toString(),
|
|
59
|
-
role: 'user',
|
|
60
|
-
content: event.message,
|
|
61
|
-
timestamp: Date.now(),
|
|
62
|
-
metadata: { channel: event.target, nick: event.nick },
|
|
63
|
-
};
|
|
64
|
-
await this.handler(msg);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
async stop(): Promise<void> {
|
|
69
|
-
if (this.client) {
|
|
70
|
-
this.client.quit('Goodbye');
|
|
71
|
-
this.client = null;
|
|
72
|
-
}
|
|
73
|
-
this.running = false;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async send(target: string, text: string): Promise<void> {
|
|
77
|
-
if (!this.running || !this.client) {
|
|
78
|
-
throw new Error('IRCChannel: not started. Call start() first.');
|
|
79
|
-
}
|
|
80
|
-
this.client.say(target, text);
|
|
81
|
-
}
|
|
82
|
-
}
|
package/src/channels/line.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from './index';
|
|
2
|
-
import type { Message } from '../core/types';
|
|
3
|
-
|
|
4
|
-
export interface LINEChannelConfig {
|
|
5
|
-
channelAccessToken?: string;
|
|
6
|
-
channelSecret?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export class LINEChannel extends BaseChannel {
|
|
10
|
-
readonly type = 'line';
|
|
11
|
-
private config: LINEChannelConfig;
|
|
12
|
-
|
|
13
|
-
constructor(config: LINEChannelConfig = {}) {
|
|
14
|
-
super();
|
|
15
|
-
this.config = config;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async start(): Promise<void> {
|
|
19
|
-
try {
|
|
20
|
-
require('@line/bot-sdk');
|
|
21
|
-
} catch {
|
|
22
|
-
throw new Error('Install @line/bot-sdk to use the LINEChannel. Run: npm install @line/bot-sdk');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async stop(): Promise<void> {
|
|
27
|
-
// cleanup
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async send(chatId: string, text: string): Promise<void> {
|
|
31
|
-
throw new Error('LINEChannel: not yet connected. Call start() first.');
|
|
32
|
-
}
|
|
33
|
-
}
|
package/src/channels/matrix.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from './index';
|
|
2
|
-
import type { Message } from '../core/types';
|
|
3
|
-
|
|
4
|
-
export interface MatrixChannelConfig {
|
|
5
|
-
homeserverUrl?: string;
|
|
6
|
-
accessToken?: string;
|
|
7
|
-
userId?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export class MatrixChannel extends BaseChannel {
|
|
11
|
-
readonly type = 'matrix';
|
|
12
|
-
private config: MatrixChannelConfig;
|
|
13
|
-
|
|
14
|
-
constructor(config: MatrixChannelConfig = {}) {
|
|
15
|
-
super();
|
|
16
|
-
this.config = config;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async start(): Promise<void> {
|
|
20
|
-
try {
|
|
21
|
-
require('matrix-js-sdk');
|
|
22
|
-
} catch {
|
|
23
|
-
throw new Error('Install matrix-js-sdk to use the MatrixChannel. Run: npm install matrix-js-sdk');
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async stop(): Promise<void> {
|
|
28
|
-
// cleanup
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async send(chatId: string, text: string): Promise<void> {
|
|
32
|
-
throw new Error('MatrixChannel: not yet connected. Call start() first.');
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from './index';
|
|
2
|
-
import type { Message } from '../core/types';
|
|
3
|
-
|
|
4
|
-
export interface MattermostChannelConfig {
|
|
5
|
-
serverUrl: string;
|
|
6
|
-
token: string;
|
|
7
|
-
teamId?: string;
|
|
8
|
-
defaultChannelId?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class MattermostChannel extends BaseChannel {
|
|
12
|
-
readonly type = 'mattermost';
|
|
13
|
-
private config: MattermostChannelConfig;
|
|
14
|
-
private running = false;
|
|
15
|
-
private ws: any = null;
|
|
16
|
-
|
|
17
|
-
constructor(config: MattermostChannelConfig) {
|
|
18
|
-
super();
|
|
19
|
-
if (!config.serverUrl || !config.token) {
|
|
20
|
-
throw new Error('MattermostChannel requires serverUrl and token in config');
|
|
21
|
-
}
|
|
22
|
-
this.config = config;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async start(): Promise<void> {
|
|
26
|
-
// Verify connection by hitting the API
|
|
27
|
-
const res = await fetch(`${this.config.serverUrl}/api/v4/users/me`, {
|
|
28
|
-
headers: { Authorization: `Bearer ${this.config.token}` },
|
|
29
|
-
}).catch(() => null);
|
|
30
|
-
this.running = true;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async stop(): Promise<void> {
|
|
34
|
-
if (this.ws) {
|
|
35
|
-
this.ws.close();
|
|
36
|
-
this.ws = null;
|
|
37
|
-
}
|
|
38
|
-
this.running = false;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async send(channelId: string, text: string): Promise<void> {
|
|
42
|
-
if (!this.running) {
|
|
43
|
-
throw new Error('MattermostChannel: not started. Call start() first.');
|
|
44
|
-
}
|
|
45
|
-
const res = await fetch(`${this.config.serverUrl}/api/v4/posts`, {
|
|
46
|
-
method: 'POST',
|
|
47
|
-
headers: {
|
|
48
|
-
Authorization: `Bearer ${this.config.token}`,
|
|
49
|
-
'Content-Type': 'application/json',
|
|
50
|
-
},
|
|
51
|
-
body: JSON.stringify({ channel_id: channelId, message: text }),
|
|
52
|
-
});
|
|
53
|
-
if (!res.ok) {
|
|
54
|
-
throw new Error(`Mattermost API failed: ${res.status}`);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
package/src/channels/msteams.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BaseChannel } from './index';
|
|
2
|
-
import type { Message } from '../core/types';
|
|
3
|
-
|
|
4
|
-
export interface MSTeamsChannelConfig {
|
|
5
|
-
appId?: string;
|
|
6
|
-
appPassword?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export class MSTeamsChannel extends BaseChannel {
|
|
10
|
-
readonly type = 'msteams';
|
|
11
|
-
private config: MSTeamsChannelConfig;
|
|
12
|
-
|
|
13
|
-
constructor(config: MSTeamsChannelConfig = {}) {
|
|
14
|
-
super();
|
|
15
|
-
this.config = config;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async start(): Promise<void> {
|
|
19
|
-
try {
|
|
20
|
-
require('botframework-connector');
|
|
21
|
-
} catch {
|
|
22
|
-
throw new Error('Install botframework-connector to use the MSTeamsChannel. Run: npm install botframework-connector');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async stop(): Promise<void> {
|
|
27
|
-
// cleanup
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async send(chatId: string, text: string): Promise<void> {
|
|
31
|
-
throw new Error('MSTeamsChannel: not yet connected. Call start() first.');
|
|
32
|
-
}
|
|
33
|
-
}
|