Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FEATURE_PARITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ This document tracks feature parity between IronClaw (Rust implementation) and O
| Slack ||| - | WASM tool |
| iMessage ||| P3 | BlueBubbles or Linq recommended |
| Linq ||| P3 | Real iMessage via API, no Mac required |
| Feishu/Lark || | P3 | Bitable create app/field tools, Docx table/image/file actions, rich-text media extraction |
| Feishu/Lark || 🚧 | P3 | WASM channel with Event Subscription v2.0; Bitable/Docx tools planned |
| LINE ||| P3 | |
| WebChat ||| - | Web gateway chat |
| Matrix ||| P3 | E2EE support |
Expand Down
28 changes: 28 additions & 0 deletions channels-src/feishu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "feishu-channel"
version = "0.1.0"
edition = "2021"
description = "Feishu/Lark Bot channel for IronClaw"
license = "MIT OR Apache-2.0"

[lib]
crate-type = ["cdylib"]

[dependencies]
# WIT bindgen for WASM component model
wit-bindgen = "0.36"

# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

# Exclude from parent workspace (this is a standalone WASM component)

[profile.release]
# Optimize for size
opt-level = "s"
lto = true
strip = true
codegen-units = 1

[workspace]
43 changes: 43 additions & 0 deletions channels-src/feishu/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# Build the Feishu/Lark channel WASM component
#
# Prerequisites:
# - Rust with wasm32-wasip2 target: rustup target add wasm32-wasip2
# - wasm-tools for component creation: cargo install wasm-tools
#
# Output:
# - feishu.wasm - WASM component ready for deployment
# - feishu.capabilities.json - Capabilities file (copy alongside .wasm)

set -euo pipefail

cd "$(dirname "$0")"

echo "Building Feishu/Lark channel WASM component..."

# Build the WASM module
cargo build --release --target wasm32-wasip2

# Convert to component model (if not already a component)
# wasm-tools component new is idempotent on components
WASM_PATH="target/wasm32-wasip2/release/feishu_channel.wasm"

if [ -f "$WASM_PATH" ]; then
# Create component if needed
wasm-tools component new "$WASM_PATH" -o feishu.wasm 2>/dev/null || cp "$WASM_PATH" feishu.wasm

# Optimize the component
wasm-tools strip feishu.wasm -o feishu.wasm

echo "Built: feishu.wasm ($(du -h feishu.wasm | cut -f1))"
echo ""
echo "To install:"
echo " mkdir -p ~/.ironclaw/channels"
echo " cp feishu.wasm feishu.capabilities.json ~/.ironclaw/channels/"
echo ""
echo "Then add your Feishu App credentials to secrets:"
echo " # Set FEISHU_APP_ID and FEISHU_APP_SECRET in your environment or secrets store"
else
echo "Error: WASM output not found at $WASM_PATH"
exit 1
fi
78 changes: 78 additions & 0 deletions channels-src/feishu/feishu.capabilities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"version": "0.1.0",
"wit_version": "0.3.0",
"type": "channel",
"name": "feishu",
"description": "Feishu/Lark Bot channel for receiving and responding to Feishu messages",
"auth": {
"secret_name": "feishu_app_id",
"display_name": "Feishu / Lark",
"instructions": "Create a bot at https://open.feishu.cn/app (Feishu) or https://open.larksuite.com/app (Lark). You need the App ID and App Secret.",
"setup_url": "https://open.feishu.cn/app",
"token_hint": "App ID looks like cli_XXXX, App Secret is a long alphanumeric string",
"env_var": "FEISHU_APP_ID"
},
"setup": {
"required_secrets": [
{
"name": "feishu_app_id",
"prompt": "Enter your Feishu/Lark App ID (from https://open.feishu.cn/app)",
"optional": false
},
{
"name": "feishu_app_secret",
"prompt": "Enter your Feishu/Lark App Secret",
"optional": false
},
{
"name": "feishu_verification_token",
"prompt": "Enter your Feishu/Lark Verification Token (from Event Subscription settings)",
"optional": true
}
],
"setup_url": "https://open.feishu.cn/app"
},
"capabilities": {
"http": {
"allowlist": [
{ "host": "open.feishu.cn", "path_prefix": "/open-apis/" },
{ "host": "open.larksuite.com", "path_prefix": "/open-apis/" }
],
"credentials": {
"feishu_bearer": {
"secret_name": "feishu_tenant_access_token",
"location": { "type": "bearer" },
"host_patterns": ["open.feishu.cn", "open.larksuite.com"]
}
},
"rate_limit": {
"requests_per_minute": 60,
"requests_per_hour": 2000
}
},
"secrets": {
"allowed_names": ["feishu_*"]
},
"channel": {
"allowed_paths": ["/webhook/feishu"],
"allow_polling": false,
"workspace_prefix": "channels/feishu/",
"emit_rate_limit": {
"messages_per_minute": 100,
"messages_per_hour": 5000
},
"webhook": {
"secret_header": "X-Feishu-Verification-Token",
"secret_name": "feishu_verification_token"
}
}
},
"config": {
"app_id": null,
"app_secret": null,
"api_base": "https://open.feishu.cn",
"owner_id": null,
"dm_policy": "pairing",
"allow_from": []
}
}
Loading
Loading