shuadouyin 0.4.0 → 0.4.1
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/.dy-build-commit +1 -1
- package/CHANGELOG.md +7 -0
- package/README.en.md +116 -127
- package/README.md +110 -102
- package/package.json +2 -1
package/.dy-build-commit
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
d9528376f4f68e7e7414bc7968f619267fd656b4
|
package/CHANGELOG.md
CHANGED
package/README.en.md
CHANGED
|
@@ -5,196 +5,185 @@
|
|
|
5
5
|
|
|
6
6
|
<div align="center">
|
|
7
7
|
|
|
8
|
-
# ShuaDouyin
|
|
8
|
+
# ShuaDouyin · 刷抖音
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
<img src="docs/assets/shuadouyin-hero.png" alt="ShuaDouyin: browsing and search, comments and reactions, chat and sharing, live rooms, relationships, persona and memory" width="100%" />
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
leaves the judgement to whatever agent is driving it.
|
|
12
|
+
**Let your AI Agent use Douyin with a persona and a memory.**
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<img src="https://img.shields.io/
|
|
14
|
+
A local command-line tool connecting your Agent, the Douyin page, and context that lasts.
|
|
15
|
+
|
|
16
|
+
<img src="https://img.shields.io/badge/node-%E2%89%A522.19-339933?logo=node.js&logoColor=white" alt="Node.js 22.19+" />
|
|
17
|
+
<img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License" />
|
|
18
|
+
<img src="https://img.shields.io/github/stars/9Ashwin/ShuaDouyin?style=social" alt="GitHub Stars" />
|
|
19
|
+
|
|
20
|
+
[Quick start](#quick-start) · [Capabilities](#capabilities) · [Agent integration](#agent-integration) · [Development](#development-and-contributing)
|
|
18
21
|
|
|
19
22
|
</div>
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
## What is this?
|
|
25
|
+
|
|
26
|
+
ShuaDouyin's executable is `dy`. Give it to an AI Agent that can run shell commands to search content, inspect works and comments, interact with your authorization, handle messages and shares, visit live rooms, and keep sourced memories and relationship records.
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
**You define the name, voice and boundaries. The Agent interprets and decides; `dy` supplies operations and evidence.** It bundles no model and schedules no tasks. It uses your existing Agent and local Chrome, with persona and memory stored locally across sessions.
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
decides nothing about content — it provides the state, context and primitives
|
|
27
|
-
one browsing round needs, and leaves the judgement to the agent calling it.
|
|
30
|
+
## Quick start
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
lines got an answer. What it will not decide for you: whether to send, what to
|
|
31
|
-
say, or whether a person is worth knowing.
|
|
32
|
+
You need **Node.js 22.19+, Chrome, and an Agent that can execute shell commands**.
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
### 1. Install the CLI and skill
|
|
34
35
|
|
|
35
36
|
```bash
|
|
36
37
|
npm install -g shuadouyin
|
|
38
|
+
dy --version
|
|
39
|
+
dy skill install
|
|
37
40
|
```
|
|
38
41
|
|
|
39
|
-
`
|
|
40
|
-
the published tarball ships a built `dist/`, so nothing compiles on install. The
|
|
41
|
-
only requirement is a local Chrome — **no browser is downloaded**.
|
|
42
|
+
The npm package is `shuadouyin`; the command is `dy`. The published package includes the build output and uses your local Chrome, without downloading another browser. The skill installer detects supported Agent directories and preserves existing copies it does not manage.
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
### 2. Create the workspace and log in
|
|
44
45
|
|
|
45
46
|
```bash
|
|
46
|
-
|
|
47
|
+
dy init
|
|
48
|
+
dy auth login
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
Scan the login QR code in the dedicated Chrome window. The default workspace is `~/.dy`; the browser login persists in `~/.dy/chrome`.
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
<summary><strong>Other options</strong></summary>
|
|
53
|
+
### 3. Start a conversation with your Agent
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
> Use dy to help me set up a name, voice and boundaries. Then browse five works, pick one to inspect its frames and comments, and tell me what you observed. Only read this round; do not interact.
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
curl -fsSL https://raw.githubusercontent.com/9Ashwin/ShuaDouyin/main/scripts/install.sh | sh
|
|
58
|
-
```
|
|
57
|
+
You can also start with a specific task:
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
- **Research content:** “Search for AI coding, inspect two works, and separate what their titles, frames and comments tell us.”
|
|
60
|
+
- **Continue a conversation:** “Check new messages in the conversation I specify and draft a reply using the earlier context.”
|
|
61
|
+
- **Follow up:** “Review the people I have recorded and list follow-ups due today.”
|
|
62
|
+
- **Review the day:** “Summarize today's local activity and receipts, clearly separating uncertain outcomes.”
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
npm uninstall -g shuadouyin
|
|
64
|
-
```
|
|
64
|
+
For manual terminal use, run `dy tui`. It needs an interactive terminal and shares the CLI's operations and state.
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
## Capabilities
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+

|
|
69
|
+
|
|
70
|
+
The artwork uses Chinese labels. The character represents a configurable Agent, not a fixed persona. Four sample positions and five comments came from an actual browsing run; the scenes are redrawn illustrations. The other panels show capabilities, not messages or gifts sent during that run.
|
|
71
|
+
|
|
72
|
+
| Capability | Common entry points |
|
|
73
|
+
| --- | --- |
|
|
74
|
+
| Search works and people; browse a batch of feed items | `dy search` · `dy user search` · `dy feed sweep` |
|
|
75
|
+
| Read works, sample frames, inspect comments and replies | `dy video digest` · `dy comment list` · `dy comment replies` |
|
|
76
|
+
| Like, favorite, follow, post text or image comments | `dy video like` · `dy video favorite` · `dy user follow` · `dy comment post` · `dy comment image` |
|
|
77
|
+
| Read messages, send text and images, quote a reply | `dy chat read` · `dy chat send` · `dy chat image` · `dy chat reply` |
|
|
78
|
+
| Share a work as a link or native card | `dy chat share` · `dy chat forward` |
|
|
79
|
+
| Read live-room info and chat, speak, send a named and priced gift | `dy live info` · `dy live chat` · `dy live say` · `dy live gift` |
|
|
80
|
+
| Read persona, recall context, save sourced facts | `dy persona show` · `dy context show` · `dy memory add` |
|
|
81
|
+
| Derive voice from actual writing, retain lessons, check wording | `dy persona evolve` · `dy learn keep` · `dy voice check` |
|
|
82
|
+
| Track browsing rounds, goals, relationships and follow-ups | `dy browse start` · `dy social goal` · `dy social due` |
|
|
83
|
+
| Inspect write receipts; prepare and save daily reports | `dy receipt get` · `dy report prepare` · `dy report save` |
|
|
84
|
+
|
|
85
|
+
These are command entry points. Use `dy <command> --help` for required arguments, or `dy schema` for the complete command and field catalog.
|
|
86
|
+
|
|
87
|
+
## Persona and memory across sessions
|
|
69
88
|
|
|
70
|
-
|
|
89
|
+
The default `~/.dy` workspace separates persona, people records, memory and the browser login:
|
|
90
|
+
|
|
91
|
+
- **`AGENTS.md`** defines the Agent's identity, voice and boundaries. You can revise the settings.
|
|
92
|
+
- **`PROFILES.md` and `memory/`** hold people records and sourced memories. Owner statements, page observations and inferences stay distinct. Markdown is the source of truth for memory bodies.
|
|
93
|
+
- **`growth review`, `learn keep` and `persona evolve`** support reviewing activity, retaining lessons and deriving changes in voice. The caller decides what is worth keeping; a viewed work does not automatically become a lasting preference.
|
|
94
|
+
|
|
95
|
+
Updating or reinstalling the CLI continues to use the existing workspace. Use the reset commands below when you want to start over.
|
|
96
|
+
|
|
97
|
+
## Agent integration
|
|
98
|
+
|
|
99
|
+
The [dy skill](skills/dy/SKILL.md) teaches Agents to use the tool, with topic-specific workflows in [references](skills/dy/references/). As an alternative to `dy skill install`, use the skills installer:
|
|
71
100
|
|
|
72
101
|
```bash
|
|
73
|
-
|
|
102
|
+
npx skills add https://github.com/9Ashwin/ShuaDouyin --skill dy
|
|
74
103
|
```
|
|
75
104
|
|
|
76
|
-
|
|
105
|
+
Start each task by reading persona and relevant context:
|
|
77
106
|
|
|
78
107
|
```bash
|
|
79
|
-
dy
|
|
80
|
-
dy
|
|
81
|
-
dy
|
|
82
|
-
dy feed next # next work in the recommended feed
|
|
83
|
-
dy video info # read the current work
|
|
108
|
+
dy persona show
|
|
109
|
+
dy context show --query "The question for this task"
|
|
110
|
+
dy feed sweep --count 5
|
|
84
111
|
```
|
|
85
112
|
|
|
86
|
-
|
|
87
|
-
`~/.dy/chrome`. That login is kept across restarts.
|
|
113
|
+
Choose a work ID from the results, open its detail page, then sample it:
|
|
88
114
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
115
|
+
```bash
|
|
116
|
+
dy video open <video-id>
|
|
117
|
+
dy video digest --video-id <video-id> --limit 5
|
|
118
|
+
```
|
|
92
119
|
|
|
93
|
-
|
|
120
|
+
`dy guide` returns instructions matching the installed version; `dy schema` describes commands, arguments and effects. Run one workspace operation at a time to avoid account-lock conflicts.
|
|
94
121
|
|
|
95
|
-
|
|
96
|
-
| --- | --- |
|
|
97
|
-
| Browse the feed | `dy feed open` / `dy feed next` / `dy video info` |
|
|
98
|
-
| Read works and comments | `dy video info` / `dy comment list` / `dy comment replies` |
|
|
99
|
-
| Interact | `dy video like` / `dy video favorite` / `dy comment post` / `dy comment reply` |
|
|
100
|
-
| Direct messages | `dy chat list` / `dy chat read` / `dy chat send` / `dy chat image` |
|
|
101
|
-
| People | `dy user get` / `dy user search` / `dy user followers` / `dy user follow` |
|
|
102
|
-
| Live rooms | `dy live info` / `dy live chat` / `dy live say` / `dy live gift` |
|
|
103
|
-
| Search | `dy search` / `dy user search` |
|
|
104
|
-
| Memory and persona | `dy memory add` / `dy memory search` / `dy context show` |
|
|
105
|
-
| Browsing rounds | `dy browse start` / `dy browse watch` / `dy browse end` |
|
|
106
|
-
| Relationships | `dy social goal` / `dy social list` / `dy social due` / `dy social log` |
|
|
107
|
-
| Teach an agent to use it | `dy guide` |
|
|
122
|
+
Success emits `{ok:true,data}` to stdout. Failure emits `{ok:false,error}` to stderr and exits nonzero. Writes use a unique `--request-id`. The `--dry-run` option validates input and the plan without connecting to Chrome, filling inputs or sending. See [docs/contracts.md](docs/contracts.md) for the full contract.
|
|
108
123
|
|
|
109
|
-
|
|
124
|
+
## Actions and evidence
|
|
110
125
|
|
|
111
|
-
|
|
126
|
+
- **A receipt before dispatch.** Replaying a confirmed request ID returns the saved receipt. Inspect `delivery_uncertain` outcomes instead of automatically resending. Native-card sharing currently cannot verify delivery and keeps dispatched shares uncertain.
|
|
127
|
+
- **Stable identities.** Use the work, user and conversation IDs returned by the CLI. Display names are only labels.
|
|
128
|
+
- **Samples are not full viewing.** Lists contain loaded content and generally report `complete: false`. The live picture is not returned as readable content. The Agent draws conclusions from the evidence it actually has.
|
|
129
|
+
- **External actions need authorization.** Comments, messages, follows and live chat affect a real account. Gifts cost money and require explicit agreement plus a name-and-price check. Deletion and recall depend on platform conditions and cannot guarantee that content was unseen.
|
|
130
|
+
- **Local login and data.** Automation may trigger verification, rate limits or account penalties. A person must complete verification; the project offers no bypass. `~/.dy` contains login state, messages and memories and should not be committed or shared. See [SECURITY.md](SECURITY.md).
|
|
131
|
+
|
|
132
|
+
## Installation options and workspace management
|
|
133
|
+
|
|
134
|
+
<details>
|
|
135
|
+
<summary><strong>Other installation methods, uninstall and reset</strong></summary>
|
|
112
136
|
|
|
113
|
-
|
|
137
|
+
Install from GitHub source, which runs a build:
|
|
114
138
|
|
|
115
139
|
```bash
|
|
116
|
-
|
|
140
|
+
npm install -g github:9Ashwin/ShuaDouyin
|
|
117
141
|
```
|
|
118
142
|
|
|
119
|
-
|
|
120
|
-
references: browsing and growth, memory and persona, reports, what to do when
|
|
121
|
-
something fails, and **platform facts** — the last one is the record of what
|
|
122
|
-
this project got wrong on the real page, and reading it saves repeating that.
|
|
123
|
-
|
|
124
|
-
## Principles
|
|
125
|
-
|
|
126
|
-
- **No judgement.** The CLI returns facts and candidates; the caller decides.
|
|
127
|
-
It acts on a real account, so the code's job is to make every action auditable
|
|
128
|
-
and reversible — not to decide whether the action is appropriate.
|
|
129
|
-
- **A receipt before anything leaves.** Every write lands on disk before it can
|
|
130
|
-
dispatch, and replaying a request ID returns the original receipt. A
|
|
131
|
-
`delivery_uncertain` write is never retried automatically: it may already be
|
|
132
|
-
out, and sending again makes two.
|
|
133
|
-
- **Identity is a stable id.** Display names collide and change; `sec_uid` does
|
|
134
|
-
not.
|
|
135
|
-
- **Report what is readable.** The live picture is a canvas with no text layer,
|
|
136
|
-
so nothing is claimed about it. Comment lists are sampled and say so.
|
|
137
|
-
- **Memory belongs to the account.** A new install is a new bot; it does not
|
|
138
|
-
inherit anyone else's conclusions.
|
|
139
|
-
|
|
140
|
-
## Reset
|
|
143
|
+
On macOS / Linux, an installer can use a private installation directory:
|
|
141
144
|
|
|
142
145
|
```bash
|
|
143
|
-
|
|
144
|
-
dy bot reset --write # back up to ~/.dy-backup-<time>, then clear
|
|
145
|
-
dy init # create a fresh bot
|
|
146
|
+
curl -fsSL https://raw.githubusercontent.com/9Ashwin/ShuaDouyin/main/scripts/install.sh | sh
|
|
146
147
|
```
|
|
147
148
|
|
|
148
|
-
|
|
149
|
+
Check installed skill copies against the current version:
|
|
149
150
|
|
|
150
|
-
|
|
151
|
+
```bash
|
|
152
|
+
dy skill status
|
|
153
|
+
```
|
|
151
154
|
|
|
152
|
-
|
|
155
|
+
Remove an npm global installation while retaining `~/.dy`:
|
|
153
156
|
|
|
154
157
|
```bash
|
|
155
|
-
|
|
156
|
-
pnpm build
|
|
157
|
-
pnpm test # unit tests
|
|
158
|
-
pnpm test:browser # isolated Chrome tests
|
|
159
|
-
pnpm check # Biome + tsc
|
|
158
|
+
npm uninstall -g shuadouyin
|
|
160
159
|
```
|
|
161
160
|
|
|
162
|
-
|
|
163
|
-
[docs/contracts.md](docs/contracts.md). Source layout, module ownership and the
|
|
164
|
-
check sequence are in [AGENTS.md](AGENTS.md).
|
|
161
|
+
Reset persona, memories and activity after a backup; keep the Chrome login:
|
|
165
162
|
|
|
166
|
-
|
|
163
|
+
```bash
|
|
164
|
+
dy bot reset # preview the scope
|
|
165
|
+
dy bot reset --write # back up and reset; use the returned backup path
|
|
166
|
+
dy init # create the workspace again
|
|
167
|
+
```
|
|
167
168
|
|
|
168
|
-
|
|
169
|
+
</details>
|
|
169
170
|
|
|
170
|
-
|
|
171
|
-
verification, rate limits or penalties. The project offers no bypass and will
|
|
172
|
-
not help you evade them. When a challenge appears, a person has to solve it in
|
|
173
|
-
the headed Chrome window.
|
|
174
|
-
- **What is sent cannot be taken back.** Comments, direct messages, danmaku and
|
|
175
|
-
gifts are public and irreversible, and gifts cost real money. Check the target
|
|
176
|
-
and the text first; `--dry-run` shows the plan without acting.
|
|
177
|
-
- **Local state is sensitive.** `~/.dy` holds the login, everything that was read
|
|
178
|
-
and the long-term memory. Do not commit it, screenshot it or put it somewhere
|
|
179
|
-
shared. See [SECURITY.md](SECURITY.md).
|
|
180
|
-
- **What you read is not everything.** Lists are sampled and say
|
|
181
|
-
`complete: false`; the live picture is a canvas with no text. Concluding from a
|
|
182
|
-
sample is your judgement, not the tool's finding.
|
|
183
|
-
- **It does not decide.** Whether to send, to whom, or whether a person is worth
|
|
184
|
-
knowing is not a decision the commands make, and being driven by an agent does
|
|
185
|
-
not lower that bar.
|
|
171
|
+
## Development and contributing
|
|
186
172
|
|
|
187
|
-
|
|
173
|
+
Requires Node.js 22.19+, pnpm, and local Chrome.
|
|
188
174
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
175
|
+
```bash
|
|
176
|
+
pnpm install --frozen-lockfile --ignore-scripts
|
|
177
|
+
pnpm build
|
|
178
|
+
pnpm check # Biome + TypeScript
|
|
179
|
+
pnpm test # unit tests
|
|
180
|
+
pnpm test:browser # temporary Chrome profile and fixture pages
|
|
181
|
+
```
|
|
192
182
|
|
|
193
|
-
|
|
183
|
+
Browser tests use no account credentials. Passing them does not prove behavior on the real Douyin page. The project is early, and page changes can affect operations; error codes, arguments and response fields are maintained as public contracts.
|
|
194
184
|
|
|
195
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
196
|
-
[SECURITY.md](SECURITY.md).
|
|
185
|
+
See [AGENTS.md](AGENTS.md) for development rules, [docs/architecture.md](docs/architecture.md) for the architecture, [CONTRIBUTING.md](CONTRIBUTING.md) to contribute, and [CHANGELOG.md](CHANGELOG.md) for release changes.
|
|
197
186
|
|
|
198
187
|
## License
|
|
199
188
|
|
|
200
|
-
MIT
|
|
189
|
+
[MIT](LICENSE)
|
package/README.md
CHANGED
|
@@ -5,177 +5,185 @@
|
|
|
5
5
|
|
|
6
6
|
<div align="center">
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# ShuaDouyin · 刷抖音
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
<img src="docs/assets/shuadouyin-hero.png" alt="ShuaDouyin 刷抖音:浏览与搜索、评论与互动、私信与分享、直播与弹幕、关系与跟进、人格与记忆" width="100%" />
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
**让你的 AI Agent,带着人格和记忆使用抖音。**
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
<img src="https://img.shields.io/badge/license-MIT-blue" alt="License" />
|
|
16
|
-
<img src="https://img.shields.io/github/stars/9Ashwin/ShuaDouyin?style=social" alt="Stars" />
|
|
14
|
+
一个本地命令行工具,连接 Agent、抖音页面和持续积累的上下文。
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
<img src="https://img.shields.io/badge/node-%E2%89%A522.19-339933?logo=node.js&logoColor=white" alt="Node.js 22.19+" />
|
|
17
|
+
<img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License" />
|
|
18
|
+
<img src="https://img.shields.io/github/stars/9Ashwin/ShuaDouyin?style=social" alt="GitHub Stars" />
|
|
19
|
+
|
|
20
|
+
[快速开始](#快速开始) · [功能一览](#功能一览) · [Agent 接入](#给-agent-接入) · [开发与参与](#开发与参与)
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
</div>
|
|
21
23
|
|
|
22
24
|
## 这是什么
|
|
23
25
|
|
|
24
|
-
`dy
|
|
26
|
+
ShuaDouyin 的命令叫 `dy`。把它交给能执行 shell 的 AI Agent,就能搜索内容、浏览作品与评论、按授权互动、处理私信与分享、进入直播间,并保存有来源的记忆和关系记录。
|
|
27
|
+
|
|
28
|
+
**你定义名字、语气和边界,Agent 负责理解与判断,`dy` 提供操作和证据。** 项目不内建模型,也不运行定时任务;使用你已有的 Agent 和本机 Chrome。人设与记忆保存在本地,可以跨会话继续使用。
|
|
25
29
|
|
|
26
|
-
|
|
30
|
+
## 快速开始
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
准备好 **Node.js 22.19+、Chrome,以及一个能执行 shell 的 Agent**。
|
|
33
|
+
|
|
34
|
+
### 1. 安装工具与 skill
|
|
29
35
|
|
|
30
36
|
```bash
|
|
31
37
|
npm install -g shuadouyin
|
|
38
|
+
dy --version
|
|
39
|
+
dy skill install
|
|
32
40
|
```
|
|
33
41
|
|
|
34
|
-
`dy`
|
|
42
|
+
npm 包叫 `shuadouyin`,可执行命令叫 `dy`。发布包已包含构建产物;使用本机 Chrome,不额外下载浏览器。`dy skill install` 会为已检测到的 Agent 安装技能,已有的非托管副本会保留。
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<details>
|
|
39
|
-
<summary><strong>其他</strong></summary>
|
|
40
|
-
|
|
41
|
-
从源码装(会构建一次,几秒):
|
|
44
|
+
### 2. 建立工作区并登录
|
|
42
45
|
|
|
43
46
|
```bash
|
|
44
|
-
|
|
47
|
+
dy init
|
|
48
|
+
dy auth login
|
|
45
49
|
```
|
|
46
50
|
|
|
47
|
-
|
|
51
|
+
在打开的专用 Chrome 窗口里扫码登录。工作区默认位于 `~/.dy`,浏览器登录保存在 `~/.dy/chrome`,后续继续使用。
|
|
48
52
|
|
|
49
|
-
|
|
50
|
-
curl -fsSL https://raw.githubusercontent.com/9Ashwin/ShuaDouyin/main/scripts/install.sh | sh
|
|
51
|
-
```
|
|
53
|
+
### 3. 在你的 Agent 里开始聊
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
> 用 dy 带我完成设置,先问我名字、语气和边界。然后刷 5 条,挑 1 条读画面和评论,告诉我看到了什么。这轮只看,不互动。
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
npm uninstall -g shuadouyin
|
|
57
|
-
```
|
|
57
|
+
也可以从具体任务开始:
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
- **带着问题找内容:**“搜一下 AI 编程,挑两条展开读,区分标题、画面和评论提供的信息。”
|
|
60
|
+
- **继续已有对话:**“看看我指定会话的新消息,结合之前的上下文拟一条回复。”
|
|
61
|
+
- **跟进关系:**“整理我已记录的人,看看今天有哪些到期的跟进事项。”
|
|
62
|
+
- **回顾一天:**“根据今天的本地记录和收据写个摘要,结果不明的操作单独说明。”
|
|
60
63
|
|
|
61
|
-
|
|
64
|
+
想自己操作终端界面,可以运行 `dy tui`;它需要真实终端,和 CLI 共用同一套操作与状态。
|
|
65
|
+
|
|
66
|
+
## 功能一览
|
|
67
|
+
|
|
68
|
+

|
|
69
|
+
|
|
70
|
+
图中角色代表可配置的 Agent,名字、语气和边界由你定义。四个采样点和五条评论来自一次实际浏览,画面为重绘;其他场景是功能示意,不代表本次执行了发送或送礼。
|
|
71
|
+
|
|
72
|
+
| 能力 | 常用入口 |
|
|
73
|
+
| --- | --- |
|
|
74
|
+
| 搜索作品、找人、批量浏览推荐流 | `dy search` · `dy user search` · `dy feed sweep` |
|
|
75
|
+
| 读取作品、采样画面、查看评论与回复 | `dy video digest` · `dy comment list` · `dy comment replies` |
|
|
76
|
+
| 点赞、收藏、关注、发布文字或图片评论 | `dy video like` · `dy video favorite` · `dy user follow` · `dy comment post` · `dy comment image` |
|
|
77
|
+
| 读取私信、发送文字和图片、引用回复 | `dy chat read` · `dy chat send` · `dy chat image` · `dy chat reply` |
|
|
78
|
+
| 分享作品链接或原生卡片 | `dy chat share` · `dy chat forward` |
|
|
79
|
+
| 读取直播信息与弹幕、发言、按名称和价格送礼 | `dy live info` · `dy live chat` · `dy live say` · `dy live gift` |
|
|
80
|
+
| 读取人格、召回记忆、保存带来源的事实 | `dy persona show` · `dy context show` · `dy memory add` |
|
|
81
|
+
| 从实际表达中更新声音、积累经验、自查文风 | `dy persona evolve` · `dy learn keep` · `dy voice check` |
|
|
82
|
+
| 管理浏览轮次、目标、关系与跟进事项 | `dy browse start` · `dy social goal` · `dy social due` |
|
|
83
|
+
| 查询操作收据、准备和保存日报 | `dy receipt get` · `dy report prepare` · `dy report save` |
|
|
84
|
+
|
|
85
|
+
表中是命令入口,必填参数见 `dy <命令> --help`;完整命令与字段见 `dy schema`。
|
|
86
|
+
|
|
87
|
+
## 人格和记忆如何延续
|
|
88
|
+
|
|
89
|
+
默认工作区 `~/.dy` 将人格、人物资料、记忆和账号登录分开保存:
|
|
62
90
|
|
|
63
|
-
|
|
91
|
+
- **`AGENTS.md`** 定义这个 Agent 的身份、语气和边界,设定可以修改。
|
|
92
|
+
- **`PROFILES.md` 与 `memory/`** 保存人物资料和带来源的记忆。用户明确表达的事实、页面观察和推测分开记录;Markdown 是记忆正文的来源。
|
|
93
|
+
- **`growth review`、`learn keep` 与 `persona evolve`** 为回顾、经验和表达变化提供依据。是否值得保存由调用方判断,浏览不等于自动形成长期偏好。
|
|
94
|
+
|
|
95
|
+
更新或重新安装 CLI 会继续使用原工作区。需要重新开始时,使用下方的重置命令。
|
|
96
|
+
|
|
97
|
+
## 给 Agent 接入
|
|
98
|
+
|
|
99
|
+
[dy skill](skills/dy/SKILL.md) 负责教 Agent 如何使用工具,主题流程放在 [references](skills/dy/references/) 中。除了 `dy skill install`,也可以使用技能安装器:
|
|
64
100
|
|
|
65
101
|
```bash
|
|
66
102
|
npx skills add https://github.com/9Ashwin/ShuaDouyin --skill dy
|
|
67
103
|
```
|
|
68
104
|
|
|
69
|
-
|
|
105
|
+
每次任务先读人格和相关上下文,再读页面:
|
|
70
106
|
|
|
71
107
|
```bash
|
|
72
|
-
dy
|
|
73
|
-
dy
|
|
108
|
+
dy persona show
|
|
109
|
+
dy context show --query "这次要解决的问题"
|
|
110
|
+
dy feed sweep --count 5
|
|
74
111
|
```
|
|
75
112
|
|
|
76
|
-
|
|
113
|
+
从结果中选出作品 ID 后,先打开对应详情页,再采样:
|
|
77
114
|
|
|
78
115
|
```bash
|
|
79
|
-
dy
|
|
80
|
-
dy
|
|
81
|
-
dy auth login # 打开 Chrome 扫码登录抖音
|
|
82
|
-
dy feed next # 刷下一条
|
|
83
|
-
dy video info # 读当前作品
|
|
116
|
+
dy video open <video-id>
|
|
117
|
+
dy video digest --video-id <video-id> --limit 5
|
|
84
118
|
```
|
|
85
119
|
|
|
86
|
-
|
|
120
|
+
`dy guide` 提供与当前安装版本一致的使用说明;`dy schema` 提供命令、参数和副作用类型。一次只运行一个工作区操作,避免账号锁冲突。
|
|
87
121
|
|
|
88
|
-
|
|
122
|
+
成功输出 `{ok:true,data}` 到 stdout;失败输出 `{ok:false,error}` 到 stderr,并返回非零退出码。写入使用唯一的 `--request-id`;`--dry-run` 只验证参数和计划,不连接 Chrome、不填表、不发送。完整契约见 [docs/contracts.md](docs/contracts.md)。
|
|
89
123
|
|
|
90
|
-
##
|
|
124
|
+
## 操作与证据边界
|
|
91
125
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
| 文风自查 | `dy voice check --text "…"` |
|
|
105
|
-
| 浏览轮次 | `dy browse start` / `dy browse watch` / `dy browse end` |
|
|
106
|
-
| 社交关系 | `dy social goal` / `dy social list` / `dy social due` / `dy social log` |
|
|
107
|
-
| 让 agent 会用 | `dy guide` |
|
|
108
|
-
|
|
109
|
-
完整命令见 `dy schema`,或 `dy <命令> --help`。
|
|
110
|
-
|
|
111
|
-
## 给 agent 用
|
|
112
|
-
|
|
113
|
-
`dy` 是为 agent 设计的。把它交给任何能跑 shell 的 agent:
|
|
126
|
+
- **写之前先留收据。** 已确认的 request ID 重放时返回原收据;遇到 `delivery_uncertain` 先核对,不自动重发。原生卡片分享目前无法验证送达,发出后会保留不确定状态。
|
|
127
|
+
- **用稳定 ID 定位。** 作品、用户和会话以 CLI 返回的稳定 ID 为准;昵称只用于展示。
|
|
128
|
+
- **采样不等于完整观看。** 列表只包含已加载内容,通常标记 `complete: false`;直播画面不作为可读内容返回。判断由 Agent 根据实际证据作出。
|
|
129
|
+
- **对外动作需要授权。** 评论、私信、关注和直播发言作用于真实账号;礼物会花真钱,必须明确同意并核对名称和价格。删除或撤回受平台条件限制,不能保证收回已被看到的内容。
|
|
130
|
+
- **登录和数据留在本机。** 自动化可能触发验证、限流或账号处罚;验证需要真人完成,项目不提供绕过手段。`~/.dy` 含登录态、消息和记忆,不应提交或共享。详见 [SECURITY.md](SECURITY.md)。
|
|
131
|
+
|
|
132
|
+
## 安装方式与工作区管理
|
|
133
|
+
|
|
134
|
+
<details>
|
|
135
|
+
<summary><strong>其他安装方式、卸载与重置</strong></summary>
|
|
136
|
+
|
|
137
|
+
从 GitHub 源码安装,会执行构建:
|
|
114
138
|
|
|
115
139
|
```bash
|
|
116
|
-
|
|
140
|
+
npm install -g github:9Ashwin/ShuaDouyin
|
|
117
141
|
```
|
|
118
142
|
|
|
119
|
-
|
|
143
|
+
macOS / Linux 也可以使用独立目录安装器:
|
|
120
144
|
|
|
121
145
|
```bash
|
|
122
|
-
|
|
146
|
+
curl -fsSL https://raw.githubusercontent.com/9Ashwin/ShuaDouyin/main/scripts/install.sh | sh
|
|
123
147
|
```
|
|
124
148
|
|
|
125
|
-
|
|
149
|
+
检查 skill 副本与当前版本是否一致:
|
|
126
150
|
|
|
127
|
-
|
|
151
|
+
```bash
|
|
152
|
+
dy skill status
|
|
153
|
+
```
|
|
128
154
|
|
|
129
|
-
|
|
155
|
+
卸载 npm 全局安装的命令,保留 `~/.dy`:
|
|
130
156
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
- **读到什么说什么。** 直播画面是 canvas,读不到就不报内容;评论是抽样,标 `complete: false`。
|
|
135
|
-
- **记忆跟账号走。** 换一个安装就是新的 bot,不继承别人的判断。
|
|
157
|
+
```bash
|
|
158
|
+
npm uninstall -g shuadouyin
|
|
159
|
+
```
|
|
136
160
|
|
|
137
|
-
|
|
161
|
+
重置人格、记忆及活动状态,会先备份;Chrome 登录保留:
|
|
138
162
|
|
|
139
163
|
```bash
|
|
140
|
-
dy bot reset #
|
|
141
|
-
dy bot reset --write #
|
|
142
|
-
dy init #
|
|
164
|
+
dy bot reset # 只预览范围
|
|
165
|
+
dy bot reset --write # 备份后重置,以返回的备份路径为准
|
|
166
|
+
dy init # 重新建立工作区
|
|
143
167
|
```
|
|
144
168
|
|
|
145
|
-
|
|
169
|
+
</details>
|
|
146
170
|
|
|
147
|
-
##
|
|
171
|
+
## 开发与参与
|
|
148
172
|
|
|
149
173
|
需要 Node.js 22.19+、pnpm 和本机 Chrome。
|
|
150
174
|
|
|
151
175
|
```bash
|
|
152
176
|
pnpm install --frozen-lockfile --ignore-scripts
|
|
153
177
|
pnpm build
|
|
178
|
+
pnpm check # Biome + TypeScript
|
|
154
179
|
pnpm test # 单元测试
|
|
155
|
-
pnpm test:browser #
|
|
156
|
-
pnpm check # Biome + tsc
|
|
180
|
+
pnpm test:browser # 临时 Chrome profile + fixture 页面
|
|
157
181
|
```
|
|
158
182
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
## 风险与边界
|
|
162
|
-
|
|
163
|
-
这是一个操作真实抖音账号的工具。用它意味着接受下面几件事:
|
|
164
|
-
|
|
165
|
-
- **账号风险由你承担。** 自动化使用抖音可能触发平台的人机验证、限流或处罚。项目不提供任何绕过手段,也不会帮你规避风控。验证弹出来时,需要真人在有头的 Chrome 里完成。
|
|
166
|
-
- **发出去的东西撤不回来。** 评论、私信、弹幕、礼物都是对外且不可逆的。送礼花的是真钱。发之前先确认对象和内容,`--dry-run` 可以先看计划。
|
|
167
|
-
- **本地状态含敏感信息。** `~/.dy` 里有登录态、读过的消息和长期记忆。不要提交、不要截图、不要放进共享目录。详见 [SECURITY.md](SECURITY.md)。
|
|
168
|
-
- **读到的不是全部。** 列表是抽样并标 `complete: false`,直播画面是 canvas 读不到字。基于抽样下结论是你自己的判断,不是工具的结论。
|
|
169
|
-
- **它不做判断。** 该不该发、发给谁、这个人值不值得认识,命令不会替你决定,也不会因为调用方是 agent 就降低门槛。
|
|
170
|
-
|
|
171
|
-
## 状态
|
|
172
|
-
|
|
173
|
-
早期阶段。命令、错误码和返回字段是公开契约,会尽量保持稳定;数据库结构随版本迁移。CI 在 Ubuntu、macOS 和 Windows 上跑单元测试与隔离 Chrome 测试。
|
|
174
|
-
|
|
175
|
-
## 参与
|
|
183
|
+
浏览器测试不使用账号凭据,通过测试不等于通过真实抖音页面验证。项目仍处于早期阶段,页面变化可能影响操作;错误码、参数和返回字段按公开契约维护。
|
|
176
184
|
|
|
177
|
-
|
|
185
|
+
开发规则见 [AGENTS.md](AGENTS.md),架构见 [docs/architecture.md](docs/architecture.md),贡献方式见 [CONTRIBUTING.md](CONTRIBUTING.md),版本变化见 [CHANGELOG.md](CHANGELOG.md)。
|
|
178
186
|
|
|
179
187
|
## 许可
|
|
180
188
|
|
|
181
|
-
MIT
|
|
189
|
+
[MIT](LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shuadouyin",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"packageManager": "pnpm@10.34.7",
|
|
5
5
|
"description": "Browse Douyin with a persistent bot persona and a memory of its own",
|
|
6
6
|
"type": "module",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"skills",
|
|
22
22
|
".dy-build-commit",
|
|
23
23
|
"!dist/**/*.map",
|
|
24
|
+
"!docs/assets",
|
|
24
25
|
"!dist/**/*.d.ts",
|
|
25
26
|
".dy-build-origin"
|
|
26
27
|
],
|