visionclaw 0.1.67 → 0.1.69
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/CHANGELOG.md +14 -0
- package/dist/agent/system-prompt.d.ts.map +1 -1
- package/dist/agent/system-prompt.js +29 -2
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/builtin-skills/catalog/futu-stock-trading/SKILL.md +118 -0
- package/dist/builtin-skills/catalog/github-dev-ops/SKILL.md +93 -0
- package/dist/builtin-skills/catalog/polymarket-trading/SKILL.md +142 -0
- package/dist/builtin-skills/catalog/wechat-feishu-automation/SKILL.md +97 -0
- package/dist/builtin-skills/macos-automation/SKILL.md +146 -0
- package/dist/builtin-skills/transcribe-audio/SKILL.md +73 -5
- package/dist/config/types.d.ts +3 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +3 -0
- package/dist/config/types.js.map +1 -1
- package/dist/obs/server.d.ts.map +1 -1
- package/dist/obs/server.js +3 -0
- package/dist/obs/server.js.map +1 -1
- package/dist/obs/ui.d.ts.map +1 -1
- package/dist/obs/ui.js +10 -15
- package/dist/obs/ui.js.map +1 -1
- package/dist/onboarding/index.d.ts.map +1 -1
- package/dist/onboarding/index.js +24 -0
- package/dist/onboarding/index.js.map +1 -1
- package/dist/reconfigure.d.ts.map +1 -1
- package/dist/reconfigure.js +43 -0
- package/dist/reconfigure.js.map +1 -1
- package/dist/skills/install.d.ts +5 -0
- package/dist/skills/install.d.ts.map +1 -1
- package/dist/skills/install.js +26 -15
- package/dist/skills/install.js.map +1 -1
- package/dist/tools/skill.d.ts +2 -0
- package/dist/tools/skill.d.ts.map +1 -1
- package/dist/tools/skill.js +88 -12
- package/dist/tools/skill.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [0.1.69](https://github.com/babelcloud/visionclaw/compare/v0.1.68...v0.1.69) (2026-03-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **config:** add support for Gmail password, agent phone number, and Mac user password ([6979bb3](https://github.com/babelcloud/visionclaw/commit/6979bb3f4615aae388c8d69ec5472f61d1588172))
|
|
7
|
+
* **skills:** enhance skill management and add catalog functionality ([cb90f97](https://github.com/babelcloud/visionclaw/commit/cb90f9780b1fdb1de2a53de68acb7c9005316bad))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## [0.1.68](https://github.com/babelcloud/visionclaw/compare/v0.1.67...v0.1.68) (2026-03-02)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
1
15
|
## [0.1.67](https://github.com/babelcloud/visionclaw/compare/v0.1.66...v0.1.67) (2026-03-01)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAExE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,WAAW,GACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAExE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,WAAW,GACvB,MAAM,CAwJR"}
|
|
@@ -21,13 +21,15 @@ You are ${ownerConfig.agentName}, a personal desktop assistant. You are a long-r
|
|
|
21
21
|
- **Name**: ${ownerConfig.agentName}
|
|
22
22
|
- **Email**: ${config.gmail} (this is YOUR email address — you send and receive emails as yourself)
|
|
23
23
|
- **Calendar**: Google Calendar associated with ${config.gmail} (this is YOUR calendar)
|
|
24
|
-
${
|
|
24
|
+
${config.phoneNumber ? `- **Phone**: ${config.phoneNumber} (this is YOUR phone number)` : "- **Phone**: Not configured"}
|
|
25
|
+
${config.gmailPassword ? `- **Gmail Password**: ${config.gmailPassword}` : ""}
|
|
26
|
+
${config.macUserPassword ? `- **Mac User Password**: ${config.macUserPassword} (use for sudo, system settings, screen unlock, etc.)` : ""}
|
|
25
27
|
|
|
26
28
|
## Your Owner
|
|
27
29
|
${ownerConfig.ownerName ? `- **Name**: ${ownerConfig.ownerName}` : "- Owner name not configured"}
|
|
28
30
|
${ownerConfig.ownerEmail ? `- **Personal Email**: ${ownerConfig.ownerEmail}` : ""}
|
|
29
31
|
${ownerConfig.phoneNumber ? `- **Phone**: ${ownerConfig.phoneNumber}` : ""}
|
|
30
|
-
${ownerConfig.
|
|
32
|
+
${ownerConfig.telegramChatId ? `- **Telegram Chat ID**: ${ownerConfig.telegramChatId}` : ""}
|
|
31
33
|
|
|
32
34
|
All messages from enabled channels come from your owner (or people your owner has authorized). When someone messages you on Telegram, Gmail, or Discord — they are your owner giving you commands. Always respond helpfully and promptly.
|
|
33
35
|
|
|
@@ -36,6 +38,7 @@ All messages from enabled channels come from your owner (or people your owner ha
|
|
|
36
38
|
- You are a program running on this computer. You are always on as long as the computer is on.
|
|
37
39
|
- You have full control of this computer: you can run terminal commands, use GUI applications, take screenshots, control the mouse and keyboard, browse the web, read and write files.
|
|
38
40
|
- You can manage your skills using the \`manage_skills\` tool (create, update, delete, list), and invoke them via the \`Skill\` tool.
|
|
41
|
+
- You also have a **skill catalog** with optional domain-specific skills(such as Coding, Financial, Chat Apps...). Use \`manage_skills(action="list_catalog")\` to browse available skills and \`manage_skills(action="install_catalog", name="skill-name")\` to install one. Installed skills become permanently available.
|
|
39
42
|
- You persist across restarts — your session and memory carry over.
|
|
40
43
|
|
|
41
44
|
## Communication Channels
|
|
@@ -44,6 +47,10 @@ ${channelList}
|
|
|
44
47
|
|
|
45
48
|
When you need to communicate results, answer questions, or ask for help, use the \`notify_user\` tool. Always specify the \`channel\` and \`to\` parameters matching the originating message — especially when messages arrive from multiple channels in the same wake cycle. If you omit them, the tool defaults to the owner's primary channel.
|
|
46
49
|
|
|
50
|
+
### Chat Apps
|
|
51
|
+
The owner may config chat apps like WeChat, Feishu, WhatsApp...These apps are not direct messaging channels, but you can use the computer use tools to interact with them.
|
|
52
|
+
Also, you need to regularly check the chat apps to see if there are any new messages.
|
|
53
|
+
|
|
47
54
|
## Behavior
|
|
48
55
|
|
|
49
56
|
### Wake Cycle
|
|
@@ -83,6 +90,15 @@ At the start of each turn, check for memos from the other session (they appear i
|
|
|
83
90
|
- Proactively save important information to memory so it survives context compaction.
|
|
84
91
|
- Retrieve relevant memories when starting new tasks.
|
|
85
92
|
- Your conversation session is infinite — context compaction will automatically summarize old turns. Important details should be saved to memory before they get compacted.
|
|
93
|
+
- **What to save**: credentials/API keys (immediately when received), account setups, owner preferences and rules, active task state for long tasks, important decisions and outcomes, calendar event IDs (so you can update/delete them later).
|
|
94
|
+
- **What NOT to save**: temporary task outputs, information already in this system prompt, one-time information that won't recur.
|
|
95
|
+
|
|
96
|
+
### Communication Patterns
|
|
97
|
+
- **Match language**: reply in the same language as the inbound message (Chinese message → Chinese reply).
|
|
98
|
+
- **Match channel**: always reply via the same channel the message arrived on.
|
|
99
|
+
- **No Markdown in chat apps**: WeChat, Feishu, and Telegram do not render Markdown — use plain text and emojis only.
|
|
100
|
+
- **Minimize questions**: take action and report the outcome rather than asking for permission. Only confirm before irreversible actions (large trades, emails to external parties).
|
|
101
|
+
- **Error reporting**: when a tool fails, try alternative approaches before giving up. Report failures clearly: what failed, why, what was tried, and what alternatives remain. For auth/credential errors, re-read memory to verify stored credentials.
|
|
86
102
|
|
|
87
103
|
### Task Completion
|
|
88
104
|
- When you have nothing left to do, call the \`finish\` tool to go back to sleep.
|
|
@@ -97,6 +113,11 @@ During heartbeat wakes (no new messages), review your calendar, check for pendin
|
|
|
97
113
|
- Follow up on pending tasks
|
|
98
114
|
- Perform maintenance (check for updates, clean up, etc.)
|
|
99
115
|
|
|
116
|
+
### Efficiency
|
|
117
|
+
- When multiple independent tool calls are needed, make them in parallel (same message) rather than sequentially.
|
|
118
|
+
- Process the most recent/urgent message first when multiple messages are queued.
|
|
119
|
+
- Acknowledge time-sensitive requests immediately before starting long work.
|
|
120
|
+
|
|
100
121
|
## Tool Usage Guidelines
|
|
101
122
|
|
|
102
123
|
All available tools (SDK built-ins, system tools, browser tools, desktop tools) are auto-documented at runtime — refer to their descriptions for parameters and usage.
|
|
@@ -111,12 +132,18 @@ For all web browser interactions, prefer the Playwright browser tools. They use
|
|
|
111
132
|
|
|
112
133
|
Playwright saves screenshots and other output files to **~/screenshots**.
|
|
113
134
|
|
|
135
|
+
Even if you are using playwright to operate the browser, you should bring the browser window to the foreground.
|
|
136
|
+
|
|
114
137
|
### Desktop Interactions (Computer Use)
|
|
115
138
|
|
|
116
139
|
For desktop applications and UI outside the browser, use the \`computer_use_*\` tools. They use AI-powered coordinate resolution — describe what you want to interact with in natural language.
|
|
117
140
|
|
|
118
141
|
**Prefer Playwright browser tools** for all in-browser work. Use **computer_use_*** only for desktop apps, situations outside the browser, or as a fallback when Playwright can't do the job.
|
|
119
142
|
|
|
143
|
+
The computer use tools are very powerful, you can basically do anything on the computer using them. If direct tool call is not possible, you should use the computer use tools to interact with the computer.
|
|
144
|
+
|
|
145
|
+
You should close the un-needed windows after task to make your desktop clean and tidy.
|
|
146
|
+
|
|
120
147
|
## Memory Protocol
|
|
121
148
|
|
|
122
149
|
IMPORTANT: ALWAYS VIEW YOUR MEMORY DIRECTORY BEFORE DOING ANYTHING ELSE.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAwB,EACxB,WAA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AC,gBAAgB,CAAC,CAAC;IAClC,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use this skill for Futu OpenD / moomoo stock trading operations -- placing orders, checking positions and holdings, querying account info for HK and US equities. Covers FutuOpenD setup, the moomoo Python API, and HK market hours.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Futu OpenD / moomoo Stock Trading API
|
|
6
|
+
|
|
7
|
+
## Setup
|
|
8
|
+
|
|
9
|
+
- **FutuOpenD**: Download from Futu official site, install to `~/FutuOpenD/`
|
|
10
|
+
- **Start command**: `open ~/FutuOpenD/Futu_OpenD_VERSION/FutuOpenD.app`
|
|
11
|
+
- **API port**: `127.0.0.1:11111`
|
|
12
|
+
- **Python library**: `moomoo` (NOT `futu`) — `pip3 install moomoo-api`
|
|
13
|
+
|
|
14
|
+
## Credentials
|
|
15
|
+
|
|
16
|
+
Check memory for:
|
|
17
|
+
- Account phone number
|
|
18
|
+
- Login password
|
|
19
|
+
- Trading unlock password (6-digit PIN)
|
|
20
|
+
|
|
21
|
+
## Key Discovery: Use OpenSecTradeContext
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
# WRONG — returns empty/wrong account for comprehensive accounts
|
|
25
|
+
from moomoo import *
|
|
26
|
+
trade_ctx = OpenHKTradeContext(host='127.0.0.1', port=11111)
|
|
27
|
+
|
|
28
|
+
# CORRECT — use this for the comprehensive margin account
|
|
29
|
+
trade_ctx = OpenSecTradeContext(filter_trdmarket=TrdMarket.HK, host='127.0.0.1', port=11111)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Multiple accounts may exist under one login. Identify the correct one by:
|
|
33
|
+
- Querying all accounts: `trade_ctx.get_acc_list()`
|
|
34
|
+
- The "保证金综合账户" (comprehensive margin account) is typically the main real account
|
|
35
|
+
|
|
36
|
+
## Restarting FutuOpenD
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
open ~/FutuOpenD/Futu_OpenD_VERSION/FutuOpenD.app
|
|
40
|
+
# Session is cached after first login — no SMS code needed on restart
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Basic Operations
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from moomoo import *
|
|
47
|
+
|
|
48
|
+
# Connect
|
|
49
|
+
quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
|
|
50
|
+
trade_ctx = OpenSecTradeContext(filter_trdmarket=TrdMarket.HK, host='127.0.0.1', port=11111)
|
|
51
|
+
|
|
52
|
+
# Unlock trading (required before placing orders) — check memory for PIN
|
|
53
|
+
trade_ctx.unlock_trade(password='TRADING_PIN')
|
|
54
|
+
|
|
55
|
+
# Get account info
|
|
56
|
+
ret, data = trade_ctx.accinfo_query(trd_env=TrdEnv.REAL)
|
|
57
|
+
|
|
58
|
+
# Get holdings
|
|
59
|
+
ret, data = trade_ctx.position_list_query(trd_env=TrdEnv.REAL)
|
|
60
|
+
|
|
61
|
+
# Get orders
|
|
62
|
+
ret, data = trade_ctx.order_list_query(trd_env=TrdEnv.REAL)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Placing an Order
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
# Limit SELL order — check memory for account ID
|
|
69
|
+
ret, data = trade_ctx.place_order(
|
|
70
|
+
price=530.0,
|
|
71
|
+
qty=100,
|
|
72
|
+
code='HK.00700',
|
|
73
|
+
trd_side=TrdSide.SELL,
|
|
74
|
+
order_type=OrderType.NORMAL, # limit order
|
|
75
|
+
trd_env=TrdEnv.REAL,
|
|
76
|
+
acc_id=REAL_ACCOUNT_ID # from get_acc_list()
|
|
77
|
+
)
|
|
78
|
+
order_id = data['order_id'][0]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Order Status Values
|
|
82
|
+
|
|
83
|
+
| Status | Meaning |
|
|
84
|
+
|--------|---------|
|
|
85
|
+
| `WAITING_SUBMIT` | Pre-market, waiting for market open |
|
|
86
|
+
| `SUBMITTING` | Being submitted to exchange |
|
|
87
|
+
| `SUBMITTED` | Submitted, waiting for match |
|
|
88
|
+
| `FILLED_ALL` | Fully executed |
|
|
89
|
+
| `CANCELLED_ALL` | Cancelled |
|
|
90
|
+
|
|
91
|
+
## HK Market Hours
|
|
92
|
+
|
|
93
|
+
- Opens: 9:30 AM HKT (UTC+8)
|
|
94
|
+
- Lunch break: 12:00-13:00 HKT
|
|
95
|
+
- Closes: 16:00 HKT
|
|
96
|
+
- Pre-market orders: Submitted during market hours, status = WAITING_SUBMIT outside hours
|
|
97
|
+
|
|
98
|
+
## Checking Order Execution
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
ret, data = trade_ctx.order_list_query(trd_env=TrdEnv.REAL)
|
|
102
|
+
# Filter by order_id to find specific order
|
|
103
|
+
order = data[data['order_id'] == 'ORDER_ID']
|
|
104
|
+
print(order[['order_status', 'dealt_qty', 'dealt_avg_price']])
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Stock Price Monitoring
|
|
108
|
+
|
|
109
|
+
A monitoring script can be run via pm2:
|
|
110
|
+
- Alerts at configurable price thresholds (buy signal, stop loss, take profit)
|
|
111
|
+
- Uses Polygon.io or similar API for real-time data
|
|
112
|
+
- Notify owner via Telegram when thresholds are hit
|
|
113
|
+
|
|
114
|
+
## Earnings Calendar Monitoring
|
|
115
|
+
|
|
116
|
+
Set Google Calendar reminders for 1 day before earnings:
|
|
117
|
+
- Look up earnings dates for relevant stocks
|
|
118
|
+
- When calendar reminder fires → notify owner via Telegram
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use this skill for GitHub CLI operations, pm2 process management, Python/Node code execution, Google Drive file sharing, and presentation generation. Covers SSH config, common gh commands, and development environment setup on macOS.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# GitHub & Development Operations
|
|
6
|
+
|
|
7
|
+
## GitHub CLI Setup
|
|
8
|
+
|
|
9
|
+
- Binary: `gh` (install via `brew install gh`, then `gh auth login`)
|
|
10
|
+
- Authenticate with `gh auth login` using the agent's GitHub account
|
|
11
|
+
- SSH key: `~/.ssh/id_ed25519`
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# SSH config for GitHub (use port 443 to avoid firewall issues)
|
|
15
|
+
# ~/.ssh/config:
|
|
16
|
+
Host github.com
|
|
17
|
+
Hostname ssh.github.com
|
|
18
|
+
Port 443
|
|
19
|
+
User git
|
|
20
|
+
IdentityFile ~/.ssh/id_ed25519
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Common GitHub Operations
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# View PR
|
|
27
|
+
gh pr view [PR_NUMBER] --repo [org/repo]
|
|
28
|
+
|
|
29
|
+
# Create PR
|
|
30
|
+
gh pr create --title "feat: add feature" --body "$(cat <<'EOF'
|
|
31
|
+
## Summary
|
|
32
|
+
- Added new feature
|
|
33
|
+
EOF
|
|
34
|
+
)"
|
|
35
|
+
|
|
36
|
+
# List PRs
|
|
37
|
+
gh pr list --repo [org/repo]
|
|
38
|
+
|
|
39
|
+
# Check PR status / CI checks
|
|
40
|
+
gh pr checks [PR_NUMBER]
|
|
41
|
+
|
|
42
|
+
# View issues
|
|
43
|
+
gh issue list --repo [org/repo]
|
|
44
|
+
|
|
45
|
+
# Clone a repo
|
|
46
|
+
git clone git@github.com:[org/repo].git
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Code Execution Environment
|
|
50
|
+
|
|
51
|
+
- Python: `python3` (system or Homebrew)
|
|
52
|
+
- Python packages (user): `~/.Library/Python/[VERSION]/lib/python/site-packages/`
|
|
53
|
+
- Node.js: Available via `node`
|
|
54
|
+
- npm/npx: Available
|
|
55
|
+
- Useful packages: `moomoo-api`, `web3`, `eth_account`, `yt-dlp`
|
|
56
|
+
|
|
57
|
+
## Process Management (pm2)
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Check running processes
|
|
61
|
+
pm2 list
|
|
62
|
+
|
|
63
|
+
# View logs
|
|
64
|
+
pm2 logs [process-name]
|
|
65
|
+
|
|
66
|
+
# Start a script
|
|
67
|
+
pm2 start /path/to/script.py --name my-process --interpreter python3
|
|
68
|
+
|
|
69
|
+
# Stop
|
|
70
|
+
pm2 stop my-process
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Google Drive File Sharing
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
# Upload file to Google Drive
|
|
77
|
+
manage_drive(action="upload_file", local_path="/path/to/file", name="filename.ext")
|
|
78
|
+
|
|
79
|
+
# Share a file
|
|
80
|
+
manage_drive(action="share_file", file_id="...", email="user@example.com", role="reader")
|
|
81
|
+
|
|
82
|
+
# Download file
|
|
83
|
+
manage_drive(action="download_file", file_id="...", local_path="/tmp/file")
|
|
84
|
+
|
|
85
|
+
# Shareable link format: https://drive.google.com/file/d/{file_id}/view
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Presentations (python-pptx)
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pip3 install python-pptx
|
|
92
|
+
python3 /tmp/create_presentation.py # generates .pptx
|
|
93
|
+
```
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use this skill for Polymarket prediction market operations -- placing orders, checking positions and balance, CLOB API authentication (HMAC + EIP-712), and order signing on Polygon. Includes critical bug fixes for HMAC path signing and NegRisk adapter addresses.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Polymarket Prediction Market Trading
|
|
6
|
+
|
|
7
|
+
## Infrastructure Overview
|
|
8
|
+
|
|
9
|
+
- **Network**: Polygon (Chain ID: 137)
|
|
10
|
+
- **Wallet**: Check memory for wallet address and private key
|
|
11
|
+
- **Token**: USDC.e (NOT native USDC) — `0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174`
|
|
12
|
+
- **API Credentials**: cached at `~/.polymarket_creds`
|
|
13
|
+
- apiKey, secret, passphrase (obtained via L1 EIP-712 auth)
|
|
14
|
+
- **Scripts**: Check memory for script locations
|
|
15
|
+
|
|
16
|
+
## API Endpoints
|
|
17
|
+
|
|
18
|
+
| Endpoint | Base URL |
|
|
19
|
+
|----------|----------|
|
|
20
|
+
| CLOB (order placement) | `https://clob.polymarket.com` |
|
|
21
|
+
| Market data | `https://gamma-api.polymarket.com` |
|
|
22
|
+
| Positions | `https://data-api.polymarket.com` |
|
|
23
|
+
|
|
24
|
+
## Contract Addresses (Polygon)
|
|
25
|
+
|
|
26
|
+
| Contract | Address |
|
|
27
|
+
|----------|---------|
|
|
28
|
+
| CTF Exchange (regular markets) | `0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E` |
|
|
29
|
+
| NegRisk CTF Exchange | `0xC5d563A36AE78145C45a50134d48A1215220f80a` |
|
|
30
|
+
| NegRisk Adapter | `0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296` |
|
|
31
|
+
| USDC.e | `0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174` |
|
|
32
|
+
|
|
33
|
+
> **CRITICAL**: NegRisk Adapter address `0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296` is different from what the GitHub py-clob-client repo shows (`0xd91E80cf2eA7Be683C80D1C946FCbB0b18Fcb985`). The CLOB checks the former — always use the correct address.
|
|
34
|
+
|
|
35
|
+
## USDC.e Approvals
|
|
36
|
+
Before trading, approve unlimited USDC.e spend to all three contracts:
|
|
37
|
+
- CTF Exchange
|
|
38
|
+
- NegRisk CTF Exchange
|
|
39
|
+
- NegRisk Adapter
|
|
40
|
+
|
|
41
|
+
## Authentication Flow
|
|
42
|
+
|
|
43
|
+
### L1: EIP-712 (for obtaining API credentials)
|
|
44
|
+
Used once to get API key. Signs a typed message using the wallet private key.
|
|
45
|
+
|
|
46
|
+
### L2: HMAC (for all API calls)
|
|
47
|
+
```python
|
|
48
|
+
import hmac, hashlib, base64, time
|
|
49
|
+
|
|
50
|
+
def build_hmac_headers(api_key, api_secret, api_passphrase, method, path, body=""):
|
|
51
|
+
timestamp = str(int(time.time()))
|
|
52
|
+
# CRITICAL: strip query params from path before signing!
|
|
53
|
+
base_path = path.split("?")[0]
|
|
54
|
+
msg = timestamp + method.upper() + base_path + body
|
|
55
|
+
secret_bytes = base64.urlsafe_b64decode(api_secret)
|
|
56
|
+
sig = base64.urlsafe_b64encode(
|
|
57
|
+
hmac.new(secret_bytes, msg.encode("utf-8"), hashlib.sha256).digest()
|
|
58
|
+
).decode("utf-8")
|
|
59
|
+
return {
|
|
60
|
+
"POLY_ADDRESS": wallet_address,
|
|
61
|
+
"POLY_SIGNATURE": sig,
|
|
62
|
+
"POLY_TIMESTAMP": timestamp,
|
|
63
|
+
"POLY_API_KEY": api_key,
|
|
64
|
+
"POLY_PASSPHRASE": api_passphrase,
|
|
65
|
+
"Content-Type": "application/json",
|
|
66
|
+
"User-Agent": "Mozilla/5.0",
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
> **CRITICAL BUG**: HMAC must be computed with **base path only** (no query params). Sign `/balance-allowance`, NOT `/balance-allowance?asset_type=COLLATERAL`. This was the root cause of "not enough balance/allowance" errors.
|
|
71
|
+
|
|
72
|
+
## Order Signing (EIP-712)
|
|
73
|
+
|
|
74
|
+
Orders use EIP-712 structured signing with domain `name="Polymarket CTF Exchange"`, `chainId=137`.
|
|
75
|
+
|
|
76
|
+
Key order fields:
|
|
77
|
+
```python
|
|
78
|
+
order = {
|
|
79
|
+
"salt": random_int, # int (not string)
|
|
80
|
+
"maker": wallet_address,
|
|
81
|
+
"signer": wallet_address,
|
|
82
|
+
"taker": "0x0000000000000000000000000000000000000000",
|
|
83
|
+
"tokenId": token_id, # string
|
|
84
|
+
"makerAmount": str(int(size * 1e6)), # USDC.e has 6 decimals
|
|
85
|
+
"takerAmount": str(int(size / price * 1e6)),
|
|
86
|
+
"expiration": "0",
|
|
87
|
+
"nonce": "0",
|
|
88
|
+
"feeRateBps": "0",
|
|
89
|
+
"side": 0, # 0=BUY, 1=SELL
|
|
90
|
+
"signatureType": 0, # int (not string)
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
For **negRisk** markets → use NegRisk CTF Exchange address in domain.
|
|
95
|
+
For regular markets → use CTF Exchange address.
|
|
96
|
+
|
|
97
|
+
## Checking Balance
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
# Check USDC.e allowance (authenticated GET)
|
|
101
|
+
GET /balance-allowance?asset_type=COLLATERAL
|
|
102
|
+
# Returns: {"asset_type": "COLLATERAL", "balance": "...", "allowance": "..."}
|
|
103
|
+
# "balance" = how much USDC.e the CLOB can use for your orders
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Checking Positions
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
# No auth needed — check memory for your wallet address
|
|
110
|
+
GET https://data-api.polymarket.com/positions?user=YOUR_WALLET_ADDRESS
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Polymarket web UI shows positions under a **proxy wallet** (different from EOA), not the EOA. API-placed trades settle to the raw EOA. Always check `data-api.polymarket.com` for accurate positions.
|
|
114
|
+
|
|
115
|
+
## Finding Markets
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
# Search markets by keyword
|
|
119
|
+
GET https://gamma-api.polymarket.com/markets?keyword=greenland&limit=5
|
|
120
|
+
|
|
121
|
+
# Key fields: conditionId, question, acceptingOrders, negRisk, tokens[0].token_id
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Placing an Order
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
POST https://clob.polymarket.com/order
|
|
128
|
+
Headers: HMAC headers (see above)
|
|
129
|
+
Body: {
|
|
130
|
+
"order": {signed_order_dict},
|
|
131
|
+
"owner": "YOUR_WALLET_ADDRESS",
|
|
132
|
+
"orderType": "GTC" # or "FOK", "GTD"
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Common Errors & Fixes
|
|
137
|
+
|
|
138
|
+
| Error | Cause | Fix |
|
|
139
|
+
|-------|-------|-----|
|
|
140
|
+
| "not enough balance/allowance" | HMAC signed full path with query params | Strip query params: `base_path = path.split("?")[0]` |
|
|
141
|
+
| "not enough balance/allowance" | Wrong NegRisk Adapter address in approval tx | Approve to `0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296` |
|
|
142
|
+
| Order not visible in web UI | Proxy wallet vs EOA mismatch | Check `data-api.polymarket.com/positions?user=<EOA>` |
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use this skill when interacting with WeChat or Feishu (Lark) desktop apps on macOS. Covers checking unread messages, sending messages, navigating chats, and handling video transcript requests. Both apps require computer_use tools -- never use AppleScript for WeChat or browser for Feishu.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# WeChat & Feishu Automation on macOS
|
|
6
|
+
|
|
7
|
+
## WeChat (微信)
|
|
8
|
+
|
|
9
|
+
### Critical Rules
|
|
10
|
+
- **ALWAYS use `computer_use_*` tools** — NEVER use AppleScript/osascript for WeChat interactions
|
|
11
|
+
- Check WeChat for unread messages **before every `finish` call** — visually confirm (AXStatusLabel is unreliable)
|
|
12
|
+
- Do NOT use Markdown syntax in WeChat messages (`**bold**`, headers, code blocks) — plain text only, emojis are fine
|
|
13
|
+
- Do NOT help contacts with their own personal tasks unrelated to your owner — only serve the owner and their friends/family
|
|
14
|
+
|
|
15
|
+
### Checking for Unread Messages
|
|
16
|
+
|
|
17
|
+
1. Take a screenshot and look for red badge numbers on chat items in the sidebar
|
|
18
|
+
2. `osascript -e 'tell application "System Events" to tell process "WeChat" to get value of first static text of first window'` — **UNRELIABLE** (returns "missing value" even with unread), use visual screenshot instead
|
|
19
|
+
3. Click the WeChat dock icon and scan the chat list visually
|
|
20
|
+
|
|
21
|
+
### Sending Messages
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
# Click input box
|
|
25
|
+
computer_use_click("the message input area at the bottom of WeChat chat")
|
|
26
|
+
|
|
27
|
+
# For long messages: use clipboard for speed
|
|
28
|
+
echo -n "your message" | pbcopy
|
|
29
|
+
computer_use_key("cmd+v")
|
|
30
|
+
computer_use_key("return") # send
|
|
31
|
+
|
|
32
|
+
# For very long content: split into 2-3 parts
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Opening a Specific Chat
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
computer_use_click("the [Name] chat in the WeChat sidebar")
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Video Transcript Request Workflow
|
|
42
|
+
|
|
43
|
+
When a WeChat contact shares a video (视频号) and asks for transcript:
|
|
44
|
+
1. Click the video thumbnail to open WeChat's built-in video player
|
|
45
|
+
2. Note the creator name and video title from the player (title bar shows "视频号")
|
|
46
|
+
3. Search Bilibili for the same video: `https://search.bilibili.com/all?keyword=[creator]+[title keywords]`
|
|
47
|
+
4. Navigate to the Bilibili page and extract audio (invoke the `transcribe-audio` skill)
|
|
48
|
+
5. Transcribe with whisper-cli
|
|
49
|
+
6. Send cleaned transcript back in 2-3 WeChat messages (split if >1000 chars)
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Feishu (飞书 / Lark)
|
|
54
|
+
|
|
55
|
+
### Critical Rules
|
|
56
|
+
- **ALWAYS use Feishu desktop app** — NEVER open the Feishu web URL in a browser
|
|
57
|
+
- Use `computer_use_*` tools to operate the Feishu desktop app
|
|
58
|
+
- Check Feishu for unread messages **before every `finish` call**
|
|
59
|
+
- DO respond to direct @mentions in Feishu chats
|
|
60
|
+
- DO handle direct task requests from team members (confirm with owner for unusual requests)
|
|
61
|
+
- Do NOT monitor/relay technical discussions proactively
|
|
62
|
+
|
|
63
|
+
### Feishu Setup
|
|
64
|
+
- Desktop app installed and logged in
|
|
65
|
+
- Groups: visible in sidebar
|
|
66
|
+
- **Important**: `manage_calendar` tool is for the agent's Google Calendar ONLY. For the owner's Feishu calendar → use Feishu desktop app directly
|
|
67
|
+
|
|
68
|
+
### Switching to Feishu
|
|
69
|
+
```
|
|
70
|
+
# From any app:
|
|
71
|
+
computer_use_key("cmd+tab") # cycles through apps
|
|
72
|
+
# Or click Feishu icon in dock
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Checking for Unread Messages
|
|
76
|
+
1. Switch to Feishu app
|
|
77
|
+
2. Look for red badge numbers on chat items in the left sidebar
|
|
78
|
+
3. Click on chats with badges to read and respond
|
|
79
|
+
|
|
80
|
+
### Sending Messages in Feishu
|
|
81
|
+
Same pattern as WeChat — click input box, type or paste, Enter to send. No Markdown syntax.
|
|
82
|
+
|
|
83
|
+
### Feishu Calendar Management (Owner's)
|
|
84
|
+
To add events to the owner's Feishu calendar:
|
|
85
|
+
1. Open Feishu app → Calendar section
|
|
86
|
+
2. Look for owner's calendar under "Following" in sidebar
|
|
87
|
+
3. Use computer_use to click and create events
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## General Messaging Rules (All Platforms)
|
|
92
|
+
|
|
93
|
+
1. **No Markdown** in WeChat, Feishu, Telegram — use plain text + emojis
|
|
94
|
+
2. **Text over voice** — owner prefers text messages
|
|
95
|
+
3. **Reply via originating channel** — if message came from Telegram, reply on Telegram (not email)
|
|
96
|
+
4. **Be proactive** — don't wait to be reminded; handle messages when seen
|
|
97
|
+
5. **Calendar accept emails** — do NOT reply or notify owner when receiving Google Calendar acceptance emails
|