@luoyi-dsh/instagram-scroll 1.0.3 → 1.0.7

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/AGENTS.md ADDED
@@ -0,0 +1,92 @@
1
+ # AGENTS.md — `@luoyi-dsh/instagram-scroll` 操作指南與工具調用規範
2
+
3
+ 本文件為 AI Agent、DeepSeek Harness (DSH) 主模型與開發者提供 `@luoyi-dsh/instagram-scroll` 的完整操作方法、DSH 工具清單、REST API 路由、AIGC 過濾規則與設定參數說明。
4
+
5
+ ---
6
+
7
+ ## 🧠 1. 核心運作規範
8
+
9
+ 1. **自動沿用 MCP 帳號設定**:
10
+ - 機器人登入會話 (`username`) 與推坑目標主人帳號 (`masterUsername`) 直接從 `@luoyi-dsh/instagram-mcp` 自動讀取與同步,無須在本插件額外輸入。
11
+ 2. **嚴格排除 AI 生成內容 (AIGC Filter)**:
12
+ - 滾動探索與主題搜尋時,自動過濾 AI 生成的影片、AI 動畫、AI 繪圖或 AI 生成農場文章(包含 `#aiart`, `#aivideo`, `#aianimation`, `#sora`, `#midjourney`, `#runwayml`, `#klingai`, `AI生成`, `AI影片`, `AI動畫` 等)。
13
+ 3. **共享外部插件 LLM 訂閱額度**:
14
+ - 深度語義審核優先調用 `@luoyi-dsh/instagram-plugin` 掛載之統一推理引擎 (`__DSH_INSTAGRAM_LLM__`) 與 DSH 宿主 `ctx.llm`,支援 `dsh-plugin-subscriptions` 外部訂閱額度。
15
+ 4. **【第一條件】去 AI 味與兼容 `dsh-feiyu-mood` 心情指標**:
16
+ - 自動共享 `ANTI_AI_FLAVOR_PRIMARY_RULE` 與 `dsh-feiyu-mood` 心情指標 (`~/.dsh/feiyu-mood/state.json`),確保生成的 `@主人` 推坑留言自然口語、毫無 AI 客服腔與罐頭感。
17
+
18
+ ---
19
+
20
+ ## 🛠️ 2. 提供之 DSH Tools 清單
21
+
22
+ | 工具名稱 | 說明 | 參數 |
23
+ | :--- | :--- | :--- |
24
+ | **`ig_run_scroll_duty_now`** | 立即手動替主人刷一輪 Instagram 動態與模糊搜尋主題,進行正文審查、過濾 AIGC、點讚與留言 `@主人` 推坑 | 無 |
25
+ | **`ig_scroll_feed`** | 滾動讀取 Instagram 時間軸最新動態貼文(含作者、讚數、內文摘要,已過濾 AIGC) | `limit` (number,預設 15,最大 50) |
26
+ | **`ig_explore_topics`** | 依照指定主題關鍵字進行模糊搜尋 (`igFuzzySearchPosts`) 與標籤探索熱門貼文(已過濾 AIGC) | `tag` (string,必填), `limit` (number,預設 15) |
27
+ | **`ig_like_feed_post`** | 在滾動瀏覽過程中對感興趣的 Instagram 貼文按讚 | `media_pk` (string,必填) |
28
+
29
+ ---
30
+
31
+ ## 💻 3. 工具與 API 調用方式
32
+
33
+ ### 1. DSH AI 自然語言直接調用
34
+
35
+ ```text
36
+ 💬 範例 1:執行一輪完整的動態探索與推坑
37
+ 「請立刻替我刷一輪 Instagram 動態牆,看看有沒有適合我的技術新貼文並推薦給我」
38
+ -> 調用:ig_run_scroll_duty_now()
39
+
40
+ 💬 範例 2:滾動瀏覽首頁動態貼文
41
+ 「幫我刷最新 10 則 Instagram 動態」
42
+ -> 調用:ig_scroll_feed(limit=10)
43
+
44
+ 💬 範例 3:探索特定主題關鍵字
45
+ 「探索 Instagram 上關於 deepseek 的熱門貼文」
46
+ -> 調用:ig_explore_topics(tag="deepseek", limit=15)
47
+ ```
48
+
49
+ ### 2. 透過 HTTP REST API 調用 (DSH Web 路由,預設埠 3080)
50
+
51
+ ```bash
52
+ # 1. 手動觸發滾動一輪 (POST /api/instagram/scroll/run)
53
+ curl -X POST http://127.0.0.1:3080/api/instagram/scroll/run
54
+
55
+ # 2. 獲取當前滾動狀態與今日統計 (GET /api/instagram/scroll/status)
56
+ curl http://127.0.0.1:3080/api/instagram/scroll/status
57
+
58
+ # 3. 讀取今日 Markdown 探索日報內容 (GET /api/instagram/scroll/report)
59
+ curl http://127.0.0.1:3080/api/instagram/scroll/report
60
+
61
+ # 4. 讀取與更新設定 (GET / POST /api/instagram/scroll/config)
62
+ curl http://127.0.0.1:3080/api/instagram/scroll/config
63
+
64
+ curl -X POST http://127.0.0.1:3080/api/instagram/scroll/config \
65
+ -H "Content-Type: application/json" \
66
+ -d '{"minScore":80,"dailyRecommendCap":5}'
67
+ ```
68
+
69
+ ---
70
+
71
+ ## ⚙️ 4. 設定參數說明 (`data/config.json`)
72
+
73
+ | 欄位名稱 | 型別 | 預設值 | 說明 |
74
+ | :--- | :--- | :--- | :--- |
75
+ | **`userInterests`** | string | *預設偏好詳述* | 主人喜歡的內容風格與領域詳細描述(供 AI 深度比對正文語義) |
76
+ | **`positiveKeywords`** | array | `["ai", "deepseek", ...]` | 正文必須提及或重點加分的領域關鍵字清單 |
77
+ | **`negativeKeywords`** | array | `["互粉", "代購", "ai生成", ...]` | 負向排除關鍵字(含 AIGC 關鍵詞,命中時直接過濾) |
78
+ | **`minCaptionLength`** | number | `30` | 正文有效文字最小字數門檻(扣除 `#標籤` 後過短者直接過濾) |
79
+ | **`requireBodyMatch`** | boolean| `true` | 正文實質內容必須命中主人偏好主題(拒絕僅在文末蹭 tag) |
80
+ | **`strictContentCheck`**| boolean| `true` | 啟用 `@` 前深度正文審查機制 |
81
+ | **`interestTags`** | array | `["ai", "deepseek", "coding", "tech", "gadgets"]` | 模糊搜尋與探索抓取的主題關鍵字清單 |
82
+ | **`personaPrompt`** | string | *預設人設提示詞* | 評估貼文趣味度與撰寫 `@主人` 推薦語的人設 Prompt |
83
+ | **`minScore`** | number | `80` | 推坑門檻分數(0-100,達標才在貼文下留言推薦) |
84
+ | **`dailyRecommendCap`** | number | `5` | 每日向主人推坑留言的上限則數 |
85
+ | **`maxRecommendsPerRun`**| number | `1` | 單次滾動瀏覽最多推坑留言則數 |
86
+ | **`minPostReadDelaySeconds`** | number | `3` | 每讀取一則貼文前人造擬真閱讀微延遲最小秒數 |
87
+ | **`maxPostReadDelaySeconds`** | number | `7` | 每讀取一則貼文前人造擬真閱讀微延遲最大秒數 |
88
+ | **`cooldownOnBlockMinutes`** | number | `30` | 遇到 Action Block / 頻率限制時自動熔斷暫停分鐘數 |
89
+ | **`scrollIntervalMinutes`**| number | `60` | 自動巡查刷動態牆的時間週期(分鐘) |
90
+ | **`autoScrollEnabled`** | boolean| `true` | 是否啟用背景定時自動刷動態牆任務 |
91
+ | **`likeOnRecommend`** | boolean| `true` | 決定推薦給主人時是否順便對該貼文點讚 |
92
+ | **`batchSize`** | number | `15` | 每輪滾動瀏覽抓取的貼文筆數 (10-30) |
package/README.md CHANGED
@@ -1,202 +1,77 @@
1
- # DSH Instagram Scroll Feed & Exploration Plugin (`@luoyi-dsh/instagram-scroll`)
2
-
3
- <div align="center">
4
-
5
- ![DSH Instagram Scroll Banner](assets/banner.png)
6
-
7
- **[English](README.md) | [繁體中文](README.zh-Hant.md)**
8
-
9
- </div>
10
-
11
- > Dedicated Instagram feed exploration, AI recommendation, and daily digest plugin for **DeepSeek Harness (DSH)**.
12
- > Core capabilities: **Automatically or manually browse Instagram timeline feeds and topic hashtags on behalf of the user, evaluate post relevance against the owner's interests using LLMs, like and leave authentic recommendation comments, and aggregate highlights into daily Markdown reports**.
13
-
14
- > [!CAUTION]
15
- > ### ⚠️ CRITICAL WARNING & DISCLAIMER
16
- > 1. **Violation of Instagram Terms of Service & Community Guidelines**:
17
- > This plugin and its automated feed browsing, liking, and commenting routines operate via unofficial APIs, which **expressly violates Instagram / Meta's Terms of Use and Community Guidelines**.
18
- > 2. **DO NOT USE YOUR PERSONAL / PRIMARY ACCOUNT**:
19
- > **Never run this plugin using your personal, primary, or business Instagram account!** Automated browsing and repeated comment posting are quickly flagged by Instagram's anti-scraping and bot-detection heuristics, resulting in: **Action Blocks, Challenge Checkpoints, temporary locks, and PERMANENT ACCOUNT SUSPENSION / BANNING**.
20
- > 3. **Use Dedicated Burner / Alt Accounts & Clean Proxies**:
21
- > Only run this plugin on disposable secondary accounts (burner/alt accounts) with dedicated residential proxies. Avoid sudden geographic IP changes.
22
- > 4. **Built-in Anti-Risk Safeguards**:
23
- > - **Per-Run Action Cap**: Strictly limits recommendations to at most 1 per scroll run (`maxRecommendsPerRun: 1`) to avoid burst posting.
24
- > - **Humanized Reading Delays**: Injects randomized 3–7s reading delays between scanning candidate posts (`minPostReadDelaySeconds: 3, maxPostReadDelaySeconds: 7`).
25
- > - **Action Jitter**: Enforces 6–15s randomized delays before executing comments or likes.
26
- > - **Circuit Breaker Cooldown**: Automatically pauses all exploration for 30 minutes if an Action Block or rate limit is encountered.
27
- > 5. **Disclaimer**:
28
- > This project is provided strictly for educational and technical research purposes. The developers and contributors accept **no responsibility or liability** for any account bans, suspensions, or losses resulting from its use. Use entirely at your own risk!
29
-
30
- ---
31
-
32
- ## 🌟 Key Features
33
-
34
- 1. **Automated Feed Browsing (Scroll Duty)**:
35
- - Periodically polls timeline feeds and configured topic hashtags.
36
- - Extracts post caption, author, tags, and media metadata.
37
- 2. **Deep Content Inspection & User Preference Alignment**:
38
- - **No Superficial Recommendations**: Abandons simple hashtag-only / high-like criteria; threshold raised to score 80.
39
- - **Caption & Tag Separation**: Dissects raw captions to separate genuine body text from trailing hashtags and mentions. Posts with substantive body text shorter than `minCaptionLength` (30 chars) are discarded.
40
- - **Hashtag Spam / Farm Detection**: Flags and drops posts where tags dominate over meaningful content.
41
- - **Body Topic Verification**: Mandates that master's interest keywords/topics genuinely appear within the post body (`requireBodyMatch`).
42
- - **Negative / Spam Filtering**: Instantly filters out giveaways, mutual-follows, dropshipping, gambling, emotional clickbait, and superficial selfie/meme posts.
43
- - **LLM Semantic Review & Tailored Hook**: Evaluates true content substance via LLM or robust heuristic review, synthesizing custom authentic recommendation comments.
44
- 3. **Daily Markdown Digest (`data/reports/YYYY-MM-DD.md`)**:
45
- - Automatically organizes reviewed posts, summaries, and recommendation trails into clean Markdown daily digests.
46
- - Viewable directly in the web console.
47
- 4. **State Ledger & Deduplication**:
48
- - `data/scroll_ledger.json` keeps track of inspected media PKs and daily quotas to prevent repetitive actions and avoid rate limits.
49
- 5. **DSH Web Control Panel (`client.js`)**:
50
- - Provides an intuitive feed waterfall preview, manual duty execution button, daily report reader, and settings inspector.
51
-
52
- ---
53
-
54
- ## 📦 Installation
55
-
56
- Install via DSH Plugin CLI:
57
-
58
- ```bash
59
- dsh plugin --profile web add @luoyi-dsh/instagram-scroll
60
- ```
61
-
62
- Or via standard npm:
63
-
64
- ```bash
65
- npm install @luoyi-dsh/instagram-scroll
66
- ```
67
-
68
- ---
69
-
70
- ## 🛠️ Provided DSH Tools
71
-
72
- | Tool Name | Description | Parameters |
73
- | :--- | :--- | :--- |
74
- | **`ig_run_scroll_duty_now`** | Trigger an immediate exploration duty cycle (evaluate posts, like & recommend) | None |
75
- | **`ig_scroll_feed`** | Read timeline feed posts (author, like count, caption excerpt) | `limit` (number, default 15, max 50) |
76
- | **`ig_explore_topics`** | Explore popular posts under a specific topic or hashtag | `tag` (string, required), `limit` (number, default 15) |
77
- | **`ig_like_feed_post`** | Like an Instagram post during browsing | `media_pk` (string, required) |
78
-
79
- ---
80
-
81
- ## 💻 Usage Examples
82
-
83
- ### 1. Natural Language Invocation in DSH Chat
84
-
85
- ```text
86
- 💬 Example 1: Run full exploration and recommendation duty
87
- "Please check my Instagram feed right now and recommend any interesting technical posts."
88
- -> AI calls: ig_run_scroll_duty_now()
89
-
90
- 💬 Example 2: Read timeline posts
91
- "Browse the latest 10 posts on my Instagram feed."
92
- -> AI calls: ig_scroll_feed(limit=10)
93
-
94
- 💬 Example 3: Explore a hashtag
95
- "Explore top posts under #deepseek on Instagram."
96
- -> AI calls: ig_explore_topics(tag="deepseek", limit=15)
97
- ```
98
-
99
- ---
100
-
101
- ### 2. Via HTTP REST API (DSH Web Routes)
102
-
103
- > 💡 **Tip**: Default DSH Web port is **3080**.
104
-
105
- #### 1. Manually Trigger Duty Cycle (`POST /api/instagram/scroll/run`)
106
- ```bash
107
- curl -X POST http://127.0.0.1:3080/api/instagram/scroll/run
108
- ```
109
-
110
- #### 2. Get Current Status & Daily Stats (`GET /api/instagram/scroll/status`)
111
- ```bash
112
- curl http://127.0.0.1:3080/api/instagram/scroll/status
113
- ```
114
-
115
- #### 3. Read Today's Markdown Digest (`GET /api/instagram/scroll/report`)
116
- ```bash
117
- curl http://127.0.0.1:3080/api/instagram/scroll/report
118
- ```
119
-
120
- #### 4. Read & Update Configuration (`GET / POST /api/instagram/scroll/config`)
121
- ```bash
122
- # Read config
123
- curl http://127.0.0.1:3080/api/instagram/scroll/config
124
-
125
- # Update config
126
- curl -X POST http://127.0.0.1:3080/api/instagram/scroll/config \
127
- -H "Content-Type: application/json" \
128
- -d '{"masterUsername":"your_username","minScore":80}'
129
- ```
130
-
131
- ---
132
-
133
- ## ⚙️ Configuration Parameters (Settings)
134
-
135
- > 💡 **Tip**: No need to configure Instagram credentials here; it automatically inherits session state from `@luoyi-dsh/instagram-mcp`.
136
-
137
- | Field | Type | Default | Description |
138
- | :--- | :--- | :--- | :--- |
139
- | **`masterUsername`** | string | `""` | Master's Instagram username (mentioned in comments when recommended) |
140
- | **`userInterests`** | string | *Default persona description* | Detailed description of owner's topics, taste, and technical expectations |
141
- | **`positiveKeywords`** | array | `["ai", "deepseek", ...]` | High-priority positive topic keywords required in post body |
142
- | **`negativeKeywords`** | array | `["互粉", "代購", "抽獎", ...]` | Negative / spam blacklist words to immediately reject |
143
- | **`minCaptionLength`** | number | `30` | Minimum character length of genuine post body (excluding hashtags) |
144
- | **`requireBodyMatch`** | boolean| `true` | Body text must substantiate owner's preferences (rejects tag-only matches) |
145
- | **`strictContentCheck`**| boolean| `true` | Enables deep content inspection pipeline before commenting |
146
- | **`interestTags`** | array | `["ai", "deepseek", "coding", "tech", "gadgets"]` | Exploration starting tags (not sole recommendation criteria) |
147
- | **`personaPrompt`** | string | *Default persona prompt* | Persona prompt guiding post analysis and recommendation copywriting |
148
- | **`minScore`** | number | `80` | Recommendation score threshold (0-100; elevated to avoid spam) |
149
- | **`dailyRecommendCap`** | number | `5` | Maximum recommendation comments allowed per day |
150
- | **`maxRecommendsPerRun`**| number | `1` | Max recommendations per duty run to prevent bursting |
151
- | **`minPostReadDelaySeconds`** | number | `3` | Minimum human reading pacing delay between posts |
152
- | **`maxPostReadDelaySeconds`** | number | `7` | Maximum human reading pacing delay between posts |
153
- | **`cooldownOnBlockMinutes`** | number | `30` | Automatic circuit breaker cooldown minutes upon action blocks |
154
- | **`scrollIntervalMinutes`**| number | `60` | Background exploration duty interval in minutes |
155
- | **`autoScrollEnabled`** | boolean| `true` | Whether background automated exploration duty is enabled |
156
- | **`likeOnRecommend`** | boolean| `true` | Automatically like post upon recommending to master |
157
- | **`batchSize`** | number | `15` | Number of posts inspected per scroll duty round (10-30) |
158
-
159
- ---
160
-
161
- ## 📁 Directory Structure
162
-
163
- ```text
164
- dsh-instagram-scroll/
165
- ├── cordis.patch.yml # DSH bundle patch manifest
166
- ├── package.json # Module definitions and dependencies
167
- ├── tsconfig.json # TypeScript compiler configuration
168
- ├── CHANGELOG.md # Version release notes
169
- ├── README.md # English documentation (This file)
170
- ├── README.zh-Hant.md # Traditional Chinese documentation
171
- ├── assets/
172
- │ ├── banner.png # Promotional banner
173
- │ └── zh-Hant.md # Localized documentation
174
- ├── client.js # DSH Web UI panel
175
- ├── data/ # [Runtime generated, ignored in Git]
176
- │ ├── config.json # Local configuration
177
- │ ├── scroll_ledger.json # Deduplication and quota ledger
178
- │ └── reports/ # Daily reports folder (YYYY-MM-DD.md)
179
- └── src/
180
- ├── index.ts # Cordis plugin entrypoint and Web API
181
- ├── config.ts # Schemastery config schema
182
- ├── types.d.ts # Type definitions
183
- ├── core/
184
- │ └── scrollDuty.ts # Scroll duty execution, LLM evaluation, likes & comments
185
- ├── lib/
186
- │ ├── hostdeps.ts # DSH runtime compatibility layer
187
- │ └── ledger.ts # Daily digest and history ledger manager
188
- └── tools/
189
- └── scrollTools.ts # Dedicated DSH tools registration
190
- ```
191
-
192
- ---
193
-
194
- ## 📜 Releases & Changelog
195
-
196
- For detailed release history and changes, please refer to [CHANGELOG.md](CHANGELOG.md).
197
-
198
- ---
199
-
200
- ## 📄 License
201
-
202
- This project is licensed under the [MIT License](LICENSE).
1
+ # DSH Instagram Scroll Feed & Exploration Plugin (`@luoyi-dsh/instagram-scroll`)
2
+
3
+ <div align="center">
4
+
5
+ ![DSH Instagram Scroll Banner](assets/banner.png)
6
+
7
+ **[English](README.md) | [繁體中文](README.zh-Hant.md) | [Agent & Operational Guide](AGENTS.md)**
8
+
9
+ </div>
10
+
11
+ > Dedicated Instagram feed exploration, AI content review, and daily digest plugin for **DeepSeek Harness (DSH)**.
12
+ > Automatically inherits Bot and Master accounts from `@luoyi-dsh/instagram-mcp`, browses Instagram timeline feeds and fuzzy-searched topics, strictly filters out AI-generated videos/animations/articles (AIGC), evaluates post substance against the owner's interests via LLM, leaves authentic `@master` recommendation comments, and compiles daily Markdown reports.
13
+
14
+ > [!CAUTION]
15
+ > ### ⚠️ CRITICAL WARNING & DISCLAIMER
16
+ > 1. **Violation of Instagram Terms of Service & Community Guidelines**:
17
+ > This plugin operates via unofficial APIs, which **expressly violates Instagram / Meta's Terms of Use and Community Guidelines**.
18
+ > 2. **DO NOT USE YOUR PERSONAL / PRIMARY ACCOUNT**:
19
+ > **Never run this plugin using your personal, primary, or business Instagram account!** Use disposable test accounts paired with clean residential proxies.
20
+ > 3. **Disclaimer**:
21
+ > This project is provided strictly for educational and technical research purposes. Use entirely at your own risk!
22
+
23
+ ---
24
+
25
+ ## 🌟 Key Features
26
+
27
+ 1. **Zero-Config Account Inheritance**:
28
+ - Automatically inherits both the Bot session (`username`) and Master account (`masterUsername`) from `@luoyi-dsh/instagram-mcp`.
29
+ 2. **Automated Feed & Fuzzy Topic Exploration (Scroll Duty)**:
30
+ - Periodically polls timeline feeds and fuzzy-searches configured topics (`igFuzzySearchPosts` + hashtag fallback).
31
+ 3. **Strict Anti-AIGC & Deep Content Inspection**:
32
+ - Automatically rejects AI-generated videos, animations, images, and content-farm articles, as well as hashtag spam, giveaways, and superficial posts.
33
+ - Evaluates genuine body text via LLM (supporting external `dsh-plugin-subscriptions` quota) before recommending to the master.
34
+ 4. **Daily Markdown Digest (`data/reports/YYYY-MM-DD.md`)**:
35
+ - Organizes reviewed posts, summaries, and recommendation trails into daily Markdown reports viewable in the Web UI.
36
+
37
+ ---
38
+
39
+ ## 📦 Installation
40
+
41
+ ```bash
42
+ # Via DSH Plugin CLI
43
+ dsh plugin --profile web add @luoyi-dsh/instagram-scroll
44
+
45
+ # Or via npm
46
+ npm install @luoyi-dsh/instagram-scroll
47
+ ```
48
+
49
+ ---
50
+
51
+ ## 📖 Operational Guide & Tool Reference
52
+
53
+ For complete DSH tool definitions, natural language prompts, HTTP REST API routes, and configuration parameters, please refer to **[AGENTS.md](AGENTS.md)**.
54
+
55
+ ---
56
+
57
+ ## 📁 Directory Structure
58
+
59
+ ```text
60
+ dsh-instagram-scroll/
61
+ ├── cordis.patch.yml # DSH bundle patch manifest
62
+ ├── package.json # Module definitions and dependencies
63
+ ├── tsconfig.json # TypeScript compiler configuration
64
+ ├── AGENTS.md # Operational & Agent Tool Guide
65
+ ├── CHANGELOG.md # Version release notes
66
+ ├── README.md # English overview (This file)
67
+ ├── README.zh-Hant.md # Traditional Chinese overview
68
+ ├── client.js # DSH Web UI panel
69
+ └── src/ # Core scroll duty, ledger/report manager, and DSH tools
70
+ ```
71
+
72
+ ---
73
+
74
+ ## 📜 Releases & License
75
+
76
+ - See [CHANGELOG.md](CHANGELOG.md) for release history.
77
+ - Licensed under the [MIT License](LICENSE).