Commit Graph

158 Commits

Author SHA1 Message Date
Wutachi
d7da39d62b Fix telegram channel permission check 2026-02-12 02:39:55 -03:00
yinwm
4a7c48112a Merge pull request #49 from yinwm/main
refactor(channels): consolidate media handling and improve resource cleanup
2026-02-12 12:47:31 +08:00
yinwm
5c8626f07b refactor(channels): consolidate media handling and improve resource cleanup
Extract common file download and audio detection logic to utils package,
implement consistent temp file cleanup with defer, add allowlist checks
before downloading attachments, and improve context management across
Discord, Slack, and Telegram channels. Replace logging with structured
logger and prevent context leaks in transcription and thinking animations.
2026-02-12 12:46:28 +08:00
yinwm
4a39658e61 Merge pull request #45 from jadeydi/main
better version info
2026-02-12 12:07:42 +08:00
yinwm
64295955a5 Merge pull request #40 from mymmrac/telegram-using-telego
feat(telegram): Use Telego instead of go-telegram-bot-api
2026-02-12 12:07:00 +08:00
yinwm
fe4962794d Merge branch 'main' into telegram-using-telego 2026-02-12 12:06:48 +08:00
Wutachi
f4a8ff7571 Add provider field support for explicit provider selection
- Add Provider field to AgentDefaults struct
- Modify CreateProvider to use explicit provider field first, fallback to model name detection
- Allows using models without provider prefix (e.g., llama-3.1-8b-instant instead of groq/llama-3.1-8b-instant)
- Supports all providers: groq, openai, anthropic, openrouter, zhipu, gemini, vllm
- Backward compatible with existing configs

Fixes issue where models without provider prefix could not use configured API keys.
2026-02-12 01:01:23 -03:00
yinwm
292a371dca Merge pull request #34 from corylanou/issue-31-feat-add-slack-channel-integration-with-socket-mode-threads-reactions-and-slash-commands
feat(channels): add Slack channel integration with Socket Mode
2026-02-12 12:01:19 +08:00
yinwm
44e33d8b1c Merge branch 'main' into issue-31-feat-add-slack-channel-integration-with-socket-mode-threads-reactions-and-slash-commands 2026-02-12 11:59:05 +08:00
yinwm
167efc55e0 Merge pull request #33 from corylanou/issue-27-feat-add-picoclaw-migrate-command-for-openclaw-workspace-migration
feat(migrate): add picoclaw migrate command for OpenClaw workspace migration

Adds migrate command to migrate workspace and config from OpenClaw to PicoClaw.

- Migrates workspace files (SOUL.md, AGENTS.md, USER.md, TOOLS.md, HEARTBEAT.md, memory/, skills/)
- Converts config from camelCase (OpenClaw) to snake_case (PicoClaw) format
- Supports --dry-run, --refresh, --config-only, --workspace-only, --force flags
- Safety: backups (.bak), confirmation prompts, no silent overwrites

Closes #27
2026-02-12 11:28:50 +08:00
yinwm
66669d6635 Merge branch 'main' into issue-27-feat-add-picoclaw-migrate-command-for-openclaw-workspace-migration 2026-02-12 11:22:06 +08:00
yinwm
5f1caedec2 Merge pull request #32 from corylanou/issue-18-add-support-for-openai-anthropic-oauth-based-login
feat(auth): add OAuth login with SDK-based subscription providers
2026-02-12 11:05:12 +08:00
yinwm
ddd6fca1be Merge pull request #44 from Sethispr/patch-1
chore: lint readme.md
2026-02-12 10:33:14 +08:00
yinwm
fe59662df3 Merge pull request #30 from DevEverything01/fix/atomic-running
fix(agent): use atomic.Bool for AgentLoop.running to prevent data race
2026-02-12 10:21:39 +08:00
yinwm
91e8abf804 Merge pull request #29 from DevEverything01/fix/deduplicate-truncate
Remove duplicate truncate functions, reuse utils.Truncate
2026-02-12 09:48:28 +08:00
li
8ceef6e8a7 better version 2026-02-12 08:14:49 +08:00
seth
af3f6596f9 chore: lint readme
17 - MD012 / no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] [error] [Fix]
62 - MD012 / no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] [error] [Fix]
221 - MD012 / no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] [error] [Fix]
266 - MD012 / no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] [error] [Fix]
368 - MD012 / no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] [error] [Fix]
493 - MD012 / no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2] [error] [Fix]
39 - MD022 / blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## 📢 News"] [error] [Fix]
63 - MD022 / blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## 🦾 Demonstration"] [error] [Fix]
64 - MD022 / blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Above] [Context: "### 🛠️ Standard Assistant Workflows"] [error] [Fix]
64 - MD022 / blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### 🛠️ Standard Assistant Workflows"] [error] [Fix]
83 - MD022 / blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### 🐜 Innovative Low-Footprint Deploy"] [error] [Fix]
218 - MD031 / blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"] [error] [Fix]
296 - MD031 / blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"] [error] [Fix]
329 - MD031 / blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"] [error] [Fix]
401 - MD031 / blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```"] [error] [Fix]
503 - MD031 / blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```json"] [error] [Fix]
226 - MD032 / blanks-around-lists Lists should be surrounded by blank lines [Context: "- Go to https://discord.com/de..."] [error] [Fix]
231 - MD032 / blanks-around-lists Lists should be surrounded by blank lines [Context: "- In the Bot settings, enable ..."] [error] [Fix]
235 - MD032 / blanks-around-lists Lists should be surrounded by blank lines [Context: "- Discord Settings → Advanced ..."] [error] [Fix]
253 - MD032 / blanks-around-lists Lists should be surrounded by blank lines [Context: "- OAuth2 → URL Generator"] [error] [Fix]
373 - MD032 / blanks-around-lists Lists should be surrounded by blank lines [Context: "- Get [API key](https://bigmod..."] [error] [Fix]
501 - MD032 / blanks-around-lists Lists should be surrounded by blank lines [Context: "1. Get a free API key at [http..."] [error] [Fix]
2026-02-11 15:53:16 -08:00
Artem Yadelskyi
ca189588e6 feat(telegram): Use Telego instead of go-telegram-bot-api 2026-02-11 23:51:18 +02:00
Cory LaNou
83f6e44b02 chore(deps): upgrade openai-go from v1.12.0 to v3.21.0
Update to latest major version of the official OpenAI Go SDK.
Fix breaking change: FunctionCallOutput.Output is now a union type
(ResponseInputItemFunctionCallOutputOutputUnionParam) instead of string.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 13:39:19 -06:00
Cory LaNou
fbad753b2a feat(providers): add SDK-based providers for subscription OAuth login
Add ClaudeProvider (anthropic-sdk-go) and CodexProvider (openai-go) that
use the correct subscription endpoints and API formats:

- CodexProvider: chatgpt.com/backend-api/codex/responses (Responses API)
  with OAuth Bearer auth and Chatgpt-Account-Id header
- ClaudeProvider: api.anthropic.com/v1/messages (Messages API) with
  Authorization: Bearer token auth

Update CreateProvider() routing to use new SDK-based providers when
auth_method is "oauth" or "token", removing the stopgap that sent
subscription tokens to pay-per-token endpoints.

Closes #18

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 13:27:59 -06:00
Cory LaNou
5eec80c654 feat(channels): add Slack channel integration with Socket Mode
Add Slack as a messaging channel using Socket Mode (WebSocket), bringing
the total supported channels to 8. Features include bidirectional
messaging, thread support with per-thread session context, @mention
handling, ack reactions (👀/), slash commands,
file/attachment support with Groq Whisper audio transcription, and
allowlist filtering by Slack user ID.

Closes #31

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 12:48:32 -06:00
Cory LaNou
3d54ec59e2 feat(migrate): add picoclaw migrate command for OpenClaw workspace migration
Add a new `picoclaw migrate` CLI command that detects an existing OpenClaw
installation and migrates workspace files and configuration to PicoClaw.

Workspace markdown files (SOUL.md, AGENTS.md, USER.md, TOOLS.md, HEARTBEAT.md,
memory/, skills/) are copied 1:1. Config keys are mapped from OpenClaw's
camelCase JSON format to PicoClaw's snake_case format with provider and channel
field mapping.

Supports --dry-run, --refresh, --config-only, --workspace-only, --force flags.
Existing PicoClaw files are never silently overwritten; backups are created.

Closes #27

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 12:48:16 -06:00
Cory LaNou
5efe8a2020 feat(auth): add OAuth and token-based login for OpenAI and Anthropic
Add `picoclaw auth` CLI command supporting:
- OpenAI OAuth2 (PKCE + browser callback or device code flow)
- Anthropic paste-token flow
- Token storage at ~/.picoclaw/auth.json with 0600 permissions
- Auto-refresh for expired OAuth tokens in provider

Closes #18

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:41:13 -06:00
Together
eff0f491e9 fix(agent): use atomic.Bool for AgentLoop.running to prevent data race
Run() and Stop() access the `running` field from different goroutines
without synchronization. Replace the bare `bool` with `sync/atomic.Bool`
to eliminate the data race.
2026-02-12 01:26:22 +08:00
Together
f12c337965 Remove duplicate truncate functions, reuse utils.Truncate
Multiple packages had their own private truncate implementations:
- channels/telegram.go: truncateString (byte-based, no "...")
- channels/dingtalk.go: truncateStringDingTalk (byte-based, no "...")
- voice/transcriber.go: truncateText (byte-based, with "...")

All three are functionally equivalent to the existing utils.Truncate,
which already handles rune-safe truncation and appends "..." correctly.

Replace all private copies with utils.Truncate and delete the dead code.
2026-02-12 00:46:48 +08:00
Only_Xianzo
6ccd9d0a99 Fix: prioritize explicit provider prefixes and update max_tokens schema 2026-02-11 22:49:47 +08:00
zepan
4f51441a3b 1. update wechat group qrcode 2026-02-11 22:46:28 +08:00
lxowalle
4fbf017991 Merge pull request #23 from yinwm/fix/gateway-cron-tool
feat: Cron tool and agent integration
2026-02-11 21:25:06 +08:00
yinwm
f5b919179d Merge upstream/main 2026-02-11 21:08:30 +08:00
Harshdeep Sharma
9ec84c6630 Fix typos and update API keys in README 2026-02-11 20:46:01 +08:00
Harshdeep Sharma
ae9cfc2f31 Fix typos and update API keys in README 2026-02-11 20:42:22 +08:00
yinwm
c704990cec refactor(tools): remove duplicate truncate functions and add docs
- Remove duplicate truncate/truncateString functions from loop.go and cron.go
- Use utils.Truncate consistently across codebase
- Add Workspace Layout section to README
- Document cron/scheduled tasks functionality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:31:41 +08:00
yinwm
af60ce26fc refactor(agent): improve code quality and restore summarization
Code review fixes:
- Use map for O(n) job lookup in cron service (was O(n²))
- Set DeleteAfterRun=true for one-time cron tasks
- Restore context compression/summarization to prevent context overflow
- Add pkg/utils/string.go with Unicode-aware Truncate function
- Simplify setupCronTool to return only CronService
- Change Chinese comments to English in context.go

Refactoring:
- Replace toolsSummary callback with SetToolsRegistry setter pattern
- This makes dependency injection clearer and easier to test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:31:41 +08:00
yinwm
4bc9e2d768 fix(cron): add one-time reminders and fix data paths to workspace
- Add at_seconds parameter for one-time reminders (e.g., "remind me in 10 minutes")
- Update every_seconds description to emphasize recurring-only usage
- Route cron delivery: deliver=true sends directly, deliver=false uses agent
- Fix cron data path from ~/.picoclaw/cron to workspace/cron
- Fix sessions path from workspace/../sessions to workspace/sessions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:31:41 +08:00
yinwm
6d4d2bc61e feat: add cron tool integration with agent
- Add adhocore/gronx dependency for cron expression parsing
- Fix CronService race conditions and add cron expression support
- Add CronTool with add/list/remove/enable/disable actions
- Add ContextualTool interface for tools needing channel/chatID context
- Add ProcessDirectWithChannel to AgentLoop for cron job execution
- Register CronTool in gateway and wire up onJob handler
- Fix slice bounds panic in addJob for short messages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 20:28:46 +08:00
Harshdeep Sharma
18bdbef815 Fix typos and update API keys in README 2026-02-11 20:26:03 +08:00
lxowalle
3e902abb5c Merge pull request #19 from n0bisuke/main
fix a typo
2026-02-11 19:55:15 +08:00
lxowalle
833c092998 Merge pull request #14 from yinwm/fix/tool-execution
Agent Memory System & Tool Execution Improvements
2026-02-11 19:53:26 +08:00
lxowalle
8c8daf64ef Merge branch 'pr-12' 2026-02-11 19:47:11 +08:00
lxowalle
7231d48c26 Merge pull request #5 from yinwm/add-qq-channel
Add QQ channel support
2026-02-11 17:25:32 +08:00
n0bisuke
94935c53ae fix a typo 2026-02-11 12:56:06 +09:00
yinwm
c3f5398538 Fix BuildMessages calls, remove conflict markers, and add skills_available field 2026-02-11 00:30:38 +08:00
yinwm
21d60f63fc Add memory system, dynamic tool loading, and fix logging issues
- Add MemoryStore for persistent long-term and daily notes
- Add dynamic tool summary generation in system prompt
- Fix YAML frontmatter parsing for nanobot skill format
- Add GetSummaries() method to ToolRegistry
- Fix DebugCF logging to use structured metadata
- Improve web_search and shell tool descriptions
2026-02-11 00:14:33 +08:00
yinwm
10442732b4 Add memory system, debug mode, and tools 2026-02-11 00:14:23 +08:00
yinwm
be2ed5d759 Add logging to agent loop and tool execution 2026-02-11 00:11:39 +08:00
yinwm
2b3de5cae5 add QQ channel support 2026-02-11 00:00:53 +08:00
w0x7ce
c5f6bec44b feat: Add DingTalk channel support via Stream Mode
- Add pkg/channels/dingtalk.go with WebSocket Stream Mode
- Add DingTalkConfig to config.go
- Register DingTalk in manager.go
- Update README with DingTalk setup instructions
- Add open-dingtalk/dingtalk-stream-sdk-go v0.9.1 dependency
2026-02-10 21:33:55 +08:00
lxowalle
9936dbce52 * Discord & Telegram support ASR through groq 2026-02-10 17:11:42 +08:00
zepan
24d5e833ad 1. add hardware samples 2026-02-10 15:54:59 +08:00
lxowalle
91e7e18e85 Merge pull request #6 from imguoguo/fix-feishu
fix: enable Feishu message flow
2026-02-10 15:27:38 +08:00