Skip to content

Commit 9ed4664

Browse files
ElianElian
authored andcommitted
Initial commit: Refly Bot v1.0.0
- Add Feishu/Lark platform support - Integrate with Refly.ai API - Implement smart message handling with request merging - Add progress tracking for long-running operations - Support rich card responses with images and files - Add optional Cloudflare AI Search integration - Implement workflow execution with real-time status - Add comprehensive documentation and examples
0 parents  commit 9ed4664

File tree

14 files changed

+5575
-0
lines changed

14 files changed

+5575
-0
lines changed

.env.example

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Feishu/Lark App Configuration
2+
APP_ID=your_app_id_here
3+
APP_SECRET=your_app_secret_here
4+
BASE_DOMAIN=https://open.feishu.cn
5+
6+
# Refly.ai Configuration
7+
REFLY_API_KEY=your_refly_api_key_here
8+
REFLY_API_BASE_URL=https://api.refly.ai/v1
9+
REFLY_CANVAS_ID=your_canvas_id_here
10+
REFLY_PLANNER_CANVAS_ID=your_planner_canvas_id_here
11+
12+
# Optional: Variable Names
13+
REFLY_INPUT_VAR=input
14+
REFLY_FILES_VAR=files
15+
REFLY_COPILOT_LOCALE=zh-Hans
16+
17+
# Optional: Bot Identity (auto-detected if not set)
18+
# BOT_USER_ID=
19+
# BOT_OPEN_ID=
20+
21+
# Optional: Logging
22+
LOG_LEVEL=info
23+
24+
# Optional: Request Handling
25+
REQUEST_MERGE_WINDOW_MS=3000
26+
MERGE_NOTICE_TEXT=收到,已合并。
27+
USER_MAX_GENERATE_CONCURRENCY=5
28+
USER_MAX_RUN_CONCURRENCY=5
29+
30+
# Optional: Progress Messages
31+
PROGRESS_PLANNER_TEXT=正在理解需求...
32+
PROGRESS_COPILOT_TEXT=正在生成Skills...
33+
PROGRESS_READY_TEXT=已理解需求,准备生成Skills...
34+
PROGRESS_SHOW_ID=false
35+
PROGRESS_OUTPUT_LINES=6
36+
37+
# Optional: Timeouts & Limits
38+
WORKFLOW_MAX_MINUTES=30
39+
PLANNER_MAX_MINUTES=5
40+
WORKFLOW_POLL_INTERVAL_MS=3000
41+
WORKFLOW_OUTPUT_INTERVAL_MS=5000
42+
WORKFLOW_STATUS_NOTIFY_INTERVAL_MS=5000
43+
LARK_MAX_UPLOAD_MB=20
44+
LARK_MAX_DOWNLOAD_MB=100
45+
LARK_MAX_IMAGE_MB=10
46+
47+
# Optional: Card Display
48+
ENABLE_ARTIFACTS_CARD=true
49+
CARD_HEADER_BADGE=
50+
CARD_MAX_IMAGES=20
51+
CARD_MAX_FILES=30
52+
CARD_TEXT_MAX_LENGTH=500
53+
54+
# Optional: Cloudflare AI Search Integration
55+
# AI_SEARCH_ENDPOINT=
56+
# AI_SEARCH_API_TOKEN=
57+
# AI_SEARCH_ACCOUNT_ID=
58+
# AI_SEARCH_MODE=autorag
59+
# AI_SEARCH_MODEL=
60+
# AI_SEARCH_INDEX=
61+
# AI_SEARCH_FILTER=
62+
# AI_SEARCH_TOP_K=5
63+
# AI_SEARCH_MIN_SCORE=0
64+
# AI_SEARCH_TIMEOUT_MS=2000
65+
# AI_SEARCH_MAX_CONTEXT_CHARS=2000
66+
# AI_SEARCH_MAX_ITEM_CHARS=500
67+
# AI_SEARCH_INCLUDE_SCORE=false
68+
# AI_SEARCH_REWRITE_QUERY=false
69+
# AI_SEARCH_RERANK_ENABLED=false
70+
# AI_SEARCH_RERANK_MODEL=
71+
# AI_SEARCH_STREAM=false

.gitattributes

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Source code
5+
*.js text eol=lf
6+
*.json text eol=lf
7+
*.md text eol=lf
8+
*.yml text eol=lf
9+
*.yaml text eol=lf
10+
11+
# Shell scripts
12+
*.sh text eol=lf
13+
*.bat text eol=crlf
14+
15+
# Documentation
16+
*.txt text eol=lf
17+
LICENSE text eol=lf
18+
CHANGELOG text eol=lf
19+
20+
# Images
21+
*.png binary
22+
*.jpg binary
23+
*.jpeg binary
24+
*.gif binary
25+
*.ico binary
26+
*.svg text
27+
28+
# Archives
29+
*.zip binary
30+
*.tar binary
31+
*.gz binary
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Configure with '...'
16+
2. Send message '...'
17+
3. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Screenshots**
23+
If applicable, add screenshots to help explain your problem.
24+
25+
**Environment:**
26+
- OS: [e.g. macOS, Windows, Linux]
27+
- Node.js version: [e.g. 18.0.0]
28+
- Bot version: [e.g. 1.0.0]
29+
30+
**Logs**
31+
Please include relevant log output (with sensitive information removed).
32+
33+
**Additional context**
34+
Add any other context about the problem here.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
21+
22+
**Would you like to implement this feature?**
23+
- [ ] Yes, I'd like to work on this
24+
- [ ] No, but I'd be happy to test it
25+
- [ ] Just suggesting

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [14.x, 16.x, 18.x, 20.x]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Check for syntax errors
30+
run: node --check index.js

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
package-lock.json
7+
8+
# Environment variables
9+
.env
10+
.env*.local
11+
.dev.vars
12+
13+
# IDE
14+
.idea/
15+
.vscode/
16+
*.swp
17+
*.swo
18+
*~
19+
20+
# OS
21+
.DS_Store
22+
Thumbs.db
23+
24+
# Build output
25+
dist/
26+
build/
27+
*.log
28+
29+
# Python (for future multi-language support)
30+
__pycache__/
31+
*.py[cod]
32+
.venv/
33+
venv/
34+
35+
# Java (for future multi-language support)
36+
target/
37+
.mvn/
38+
*.class
39+
40+
# Temporary files
41+
*.tmp
42+
*.temp
43+
.cache/
44+
45+
# Test coverage
46+
coverage/
47+
.nyc_output/

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2026-02-02
9+
10+
### Added
11+
- Initial release of Refly Bot
12+
- Feishu/Lark platform support
13+
- Integration with Refly.ai API
14+
- Smart message handling with request merging
15+
- Progress tracking for long-running operations
16+
- Rich card responses with images and files
17+
- Optional Cloudflare AI Search integration
18+
- Workflow execution with real-time status updates
19+
- Session management and conversation context
20+
- Concurrency control per user
21+
- Configurable timeouts and limits
22+
- Multi-language support
23+
- Comprehensive environment variable configuration
24+
- Bootstrap scripts for easy deployment
25+
26+
### Features
27+
- Direct message and group mention support
28+
- Automatic message deduplication
29+
- Intelligent request merging for rapid messages
30+
- Real-time progress updates
31+
- Interactive message cards
32+
- File upload and download handling
33+
- Image processing and display
34+
- Workflow cancellation support
35+
- Retry mechanism for failed operations
36+
- Clarification flow for ambiguous requests
37+
38+
[1.0.0]: https://github.com/yourusername/refly-bot/releases/tag/v1.0.0

0 commit comments

Comments
 (0)