@telepat/snoopy 0.1.13 → 0.1.15

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.
Files changed (36) hide show
  1. package/README.md +70 -215
  2. package/README.zh-CN.md +137 -0
  3. package/dist/src/agent/install.d.ts +18 -0
  4. package/dist/src/agent/install.js +488 -0
  5. package/dist/src/cli/commands/feedback.d.ts +18 -0
  6. package/dist/src/cli/commands/feedback.js +276 -0
  7. package/dist/src/cli/commands/prompt.d.ts +6 -0
  8. package/dist/src/cli/commands/prompt.js +92 -0
  9. package/dist/src/cli/commands/promptEditor.d.ts +1 -0
  10. package/dist/src/cli/commands/promptEditor.js +17 -0
  11. package/dist/src/cli/flows/jobAddFlow.js +1 -1
  12. package/dist/src/cli/index.js +86 -1
  13. package/dist/src/mcp/helpers.d.ts +46 -0
  14. package/dist/src/mcp/helpers.js +506 -0
  15. package/dist/src/mcp/server.d.ts +1 -0
  16. package/dist/src/mcp/server.js +299 -0
  17. package/dist/src/mcp/tools.d.ts +90 -0
  18. package/dist/src/mcp/tools.js +106 -0
  19. package/dist/src/services/db/migrations/002_feedback_fields.d.ts +7 -0
  20. package/dist/src/services/db/migrations/002_feedback_fields.js +22 -0
  21. package/dist/src/services/db/migrations/index.js +2 -1
  22. package/dist/src/services/db/repositories/jobsRepo.d.ts +2 -0
  23. package/dist/src/services/db/repositories/jobsRepo.js +15 -0
  24. package/dist/src/services/db/repositories/scanItemsRepo.d.ts +17 -0
  25. package/dist/src/services/db/repositories/scanItemsRepo.js +197 -2
  26. package/dist/src/services/feedback/consolidationService.d.ts +28 -0
  27. package/dist/src/services/feedback/consolidationService.js +124 -0
  28. package/dist/src/services/openrouter/client.d.ts +23 -0
  29. package/dist/src/services/openrouter/client.js +67 -0
  30. package/dist/src/types/settings.d.ts +1 -1
  31. package/dist/src/types/settings.js +1 -1
  32. package/dist/src/ui/components/MultilinePrompt.d.ts +10 -0
  33. package/dist/src/ui/components/MultilinePrompt.js +87 -0
  34. package/dist/src/ui/components/multilinePromptModel.d.ts +25 -0
  35. package/dist/src/ui/components/multilinePromptModel.js +76 -0
  36. package/package.json +4 -1
package/README.md CHANGED
@@ -1,10 +1,11 @@
1
- <p align="center"><img src="./snoopy-logo.webp" width="128" alt="Snoopy"></p>
1
+ <p align="center"><img src="./assets/avatar/snoopy-logo.webp" width="128" alt="Snoopy"></p>
2
2
  <h1 align="center">Snoopy</h1>
3
- <hr>
4
- <p align="center"><em>Sniff out the conversations that matter.</em></p>
3
+ <p align="center"><em>Monitor online conversations for high-intent signals with AI. Plain language criteria, continuous scanning, zero infrastructure.</em></p>
5
4
 
6
5
  <p align="center">
7
6
  <a href="https://docs.telepat.io/snoopy">📖 Docs</a>
7
+ · <a href="./README.md">🇺🇸 English</a>
8
+ · <a href="./README.zh-CN.md">🇨🇳 简体中文</a>
8
9
  </p>
9
10
 
10
11
  <p align="center">
@@ -14,269 +15,123 @@
14
15
  <a href="https://github.com/telepat-io/snoopy/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-yellow.svg" alt="License"></a>
15
16
  </p>
16
17
 
17
- Snoopy helps you monitor Reddit for high-intent conversations that match your business goals.
18
+ Snoopy monitors online conversations for high-intent signals that match your business goals.
18
19
 
19
- Define what you care about in plain language, let Snoopy create a monitoring job, and continuously scan and qualify posts/comments so you can focus on response and outreach.
20
+ Define what you care about in plain language, let Snoopy create a monitoring job, and continuously scan and qualify conversations so you can focus on response and outreach.
20
21
 
21
- ## Why Use Snoopy
22
+ Built for founders, marketers, and sales teams who need to find genuine opportunities in online communities without manually scrolling.
22
23
 
23
- - Turn broad Reddit traffic into a focused stream of opportunities.
24
- - Define qualification logic once, then run continuously.
25
- - Trigger manual runs when you want quick validation.
26
- - Track run analytics (discovered/new/qualified items, token usage, cost estimate).
27
- - Run cross-platform with startup-on-reboot support.
24
+ ## Features
28
25
 
29
- ## What It Does
26
+ - **Plain language job creation** — Describe what you're looking for in plain language. Snoopy builds an AI-assisted monitoring job. No regex, no keyword configs.
27
+ - **AI qualification, not keyword matching** — Conversations are evaluated against your intent. Snoopy understands context — not just pattern matching.
28
+ - **Feedback-driven prompt learning** — Review results, submit valid/invalid feedback, and consolidate updates so your qualification prompt gets smarter over time.
29
+ - **Continuous daemon monitoring** — Set a cron schedule and let Snoopy scan in the background. `snoopy daemon start`
30
+ - **Code-driven efficiency** — Deterministic code handles scraping, scheduling, state management, and SQLite persistence. Tokens only spent on qualification.
31
+ - **Local & private** — SQLite database on your machine. No cloud dependency. Export to CSV or JSON on demand.
32
+ - **Cost-aware analytics** — Token usage, cost estimates, and qualified items per run. `snoopy analytics --days 7`
33
+ - **Agent & CI ready** — MCP server, direct SQLite access, non-interactive mode, machine-readable output.
34
+ - **Cross-platform** — macOS, Linux, Windows. Startup-on-reboot. `snoopy startup install`
30
35
 
31
- - Interactive job creation flow from natural-language criteria.
32
- - AI-assisted clarification and job spec generation.
33
- - Qualification against your prompt for posts (and comments when enabled).
34
- - Local SQLite persistence for jobs, runs, and scan items.
35
- - Built-in daemon for scheduled scanning (cron expressions).
36
- - On-demand CSV export of qualified results per job.
37
- - Explicit opt-in startup registration for macOS, Linux, and Windows.
38
- - Health checks via the doctor command.
39
-
40
- ## Install
41
-
42
- Requirements:
43
- - Node.js 20+
44
- - npm 10+
36
+ ## Quick Start
45
37
 
46
- From npm:
38
+ Requirements: Node.js 20+, npm 10+.
47
39
 
48
40
  ```bash
49
41
  npm install -g @telepat/snoopy
50
- snoopy --help
51
- ```
52
-
53
- From source:
54
-
55
- ```bash
56
- npm install
57
- npm run build
58
- npm link
59
- ```
60
-
61
- For first-time onboarding (OpenRouter key setup, first `job add`, and verification), see [Installation & Setup](docs/getting-started/installation.md).
62
-
63
- ## Development
64
-
65
- Run without a global install (contributors):
66
-
67
- ```bash
68
- npm run dev -- --help
69
- ```
70
-
71
- Core validation commands:
72
-
73
- ```bash
74
- npm run lint
75
- npm run build
76
- npm test
77
- ```
78
-
79
- To refresh coverage locally:
80
-
81
- ```bash
82
- npm test -- --coverage
83
42
  ```
84
43
 
85
- ## Releases
86
-
87
- Versioning and changelogs are managed automatically by [release-please](https://github.com/googleapis/release-please).
88
-
89
- **How it works:**
90
- 1. Merge commits to `main` following [Conventional Commits](https://www.conventionalcommits.org/) (`fix:`, `feat:`, `feat!:`, etc.).
91
- 2. release-please maintains an open "Release PR" that accumulates version bumps and CHANGELOG entries.
92
- 3. Merge the Release PR to cut a release: `package.json` version is bumped, `CHANGELOG.md` is updated, a git tag is created, and the package is published to npm automatically.
93
-
94
- **Commit types and semver mapping (while version < 1.0.0):**
95
- - `fix:` → patch bump
96
- - `feat:` → patch bump (minor bump is suppressed pre-1.0)
97
- - `feat!:` or `fix!:` (breaking change) → minor bump (major bump is suppressed pre-1.0)
98
-
99
- No manual `git tag` or `npm version` steps are needed.
100
-
101
- ## Quick Start
102
-
103
- Note:
104
- - Snoopy uses Reddit public JSON endpoints by default.
105
- - Optional Reddit OAuth fallback credentials can be configured in `snoopy settings` for environments where unauthenticated access is blocked.
106
- - `snoopy settings` shows a full settings menu so you can jump directly to any setting and save once.
107
- - If keychain storage is unavailable, configure secrets with environment variables (`SNOOPY_OPENROUTER_API_KEY`, `SNOOPY_REDDIT_CLIENT_SECRET`).
108
-
109
- 1. Start interactive setup and create your first job:
44
+ 1. Create your first monitoring job:
110
45
 
111
46
  ```bash
112
47
  snoopy job add
113
48
  ```
114
49
 
115
- `job add` now runs an immediate first scan after saving the job so you can validate results right away.
116
- Snoopy pauses scheduled scans for that new job during this first run attempt, then enables scheduling when it ends (including interruption/failure cases).
117
-
118
- 2. List jobs:
119
-
120
- ```bash
121
- snoopy jobs list
122
- ```
123
-
124
- 3. Run one job immediately (limit to 5 new items while testing):
50
+ 2. Run a quick test scan:
125
51
 
126
52
  ```bash
127
53
  snoopy job run --limit 5
128
- snoopy job run <jobRef> --limit 5
129
- ```
130
-
131
- If another run is already active for the same job, Snoopy marks the new attempt as `skipped` with an `already active` message.
132
- Duplicate candidates matching an existing scan item are treated as already scanned and do not fail the run.
133
-
134
- If `<jobRef>` is omitted for `job run`, `job enable`, `job disable`, `job delete`, `start`, `stop`, `errors`, or `results`, Snoopy shows your job list and lets you pick with up/down arrows and Enter.
135
-
136
- 4. View run history:
137
-
138
- ```bash
139
- snoopy job runs <jobRef>
140
54
  ```
141
55
 
142
- 5. View analytics globally or for one job:
56
+ 3. Start the background daemon:
143
57
 
144
58
  ```bash
145
- snoopy analytics
146
- snoopy analytics <jobRef>
147
- snoopy analytics --days 7
59
+ snoopy daemon start
148
60
  ```
149
61
 
150
- 6. Browse results in the interactive viewer:
62
+ 4. View results:
151
63
 
152
64
  ```bash
153
65
  snoopy results
154
- snoopy results <jobRef>
66
+ snoopy export --json --last-run
155
67
  ```
156
68
 
157
- 7. Regenerate qualified results files (all jobs or one job):
69
+ For full onboarding, see [Installation & Setup](https://docs.telepat.io/snoopy/getting-started/installation) and [Quick Start](https://docs.telepat.io/snoopy/getting-started/quickstart).
158
70
 
159
- ```bash
160
- snoopy export
161
- snoopy export <jobRef> --json --last-run
162
- ```
71
+ ## Requirements
163
72
 
164
- 8. Consume unconsumed qualified results (read-once, most recent first):
73
+ - Node.js 20+
74
+ - npm 10+
75
+ - macOS, Linux, or Windows
165
76
 
166
- ```bash
167
- snoopy consume
168
- snoopy consume <jobRef> --limit 10
169
- snoopy consume <jobRef> --json --dry-run
170
- ```
77
+ ## How It Works
171
78
 
172
- 9. Inspect one run's detailed log output:
79
+ Snoopy uses Reddit public JSON endpoints (with optional OAuth fallback) to scan posts and comments against an AI-assisted qualification prompt. Matches are stored in a local SQLite database. The built-in daemon runs jobs on cron schedules, and results can be exported as CSV or JSON on demand.
173
80
 
174
- ```bash
175
- snoopy logs
176
- snoopy logs <runId>
177
- snoopy logs <runId> --raw
178
- ```
81
+ ## Using With AI Agents
179
82
 
180
- When `runId` is omitted for `logs`, Snoopy first prompts for a job, then prompts for a run from that job (up/down arrows + Enter).
83
+ Snoopy is built for headless automation and agent-driven monitoring:
181
84
 
182
- 10. Show recent errors for one job:
85
+ - **Non-interactive CLI** Most commands support omitting `<jobRef>` to get an interactive picker, but automation can pass refs directly for zero-prompt execution.
86
+ - **Machine-readable output** — `snoopy export --json --last-run` and `snoopy consume --json` produce structured data for downstream agents.
87
+ - **Feedback loop for continuous quality** — Agents can run `snoopy feedback review --json`, collect human feedback, submit with `snoopy feedback submit`, and finalize with `snoopy feedback consolidate`.
88
+ - **Direct database access** — SQLite at `~/.snoopy/snoopy.db` (or `$SNOOPY_ROOT_DIR/snoopy.db`) with a documented schema. Agents can insert jobs, query results, and update lifecycle flags directly.
89
+ - **Environment variables** — `SNOOPY_OPENROUTER_API_KEY`, `SNOOPY_REDDIT_CLIENT_SECRET`, and `SNOOPY_ROOT_DIR` remove all interactive credential prompts.
90
+ - **Agent docs** — [Agent Operations](https://docs.telepat.io/snoopy/guides/agent-operations) provides a complete runbook for automation, including SQL schema, lifecycle flags, and recommended workflows.
183
91
 
184
- ```bash
185
- snoopy errors <jobRef>
186
- ```
92
+ ## Feedback Workflow
187
93
 
188
- 11. Enable daemon mode:
94
+ Use the feedback commands to improve qualification quality over time:
189
95
 
190
96
  ```bash
191
- snoopy daemon start
192
- snoopy daemon reload
193
- ```
97
+ # 1) Review unvalidated qualified results (agent-safe JSON)
98
+ snoopy feedback review --json --limit 10
194
99
 
195
- ## Most Used Commands
196
-
197
- - `job add`
198
- - `job list`
199
- - `job run [jobRef] --limit <N>`
200
- - `job runs [jobRef]`
201
- - `analytics [jobRef] --days <N>`
202
- - `results [jobRef]`
203
- - `export [jobRef] --csv|--json [--last-run]`
204
- - `consume [jobRef] [--limit <N>] [--json] [--dry-run]`
205
- - `logs [runId]`
206
- - `errors [jobRef] --hours <N>`
207
- - `start [jobRef]` / `stop [jobRef]`
208
- - `delete [jobRef]`
209
- - `daemon start|stop|status`
210
- - `daemon reload`
211
- - `startup status`
212
- - `doctor`
213
-
214
- ## Run Logs
215
-
216
- - Each job run writes a dedicated log file under `~/.snoopy/logs/`.
217
- - Files are named `run-<runId>.log`.
218
- - `snoopy logs` now supports guided selection (job first, then run) and shows a pretty timeline by default with post/comment text snippets, qualification result + justification, and clickable post/comment links.
219
- - Use `snoopy logs [runId] --raw` to print the full raw log file content, including full JSON request/response payloads for Reddit and OpenRouter calls.
220
- - Rich TTY manual runs (`snoopy job run <jobRef>`) show compact multi-line scan blocks with indented fields, clickable links, and qualification justifications.
221
- - In rich terminals, scan field labels are colorized and qualification status is highlighted (`qualified` in green, `not qualified` in red, `pending` in yellow).
222
- - Run logs older than 5 days are deleted automatically on daemon startup and after each job run.
223
- - Deleting a job also deletes all associated per-run log files for that job.
224
-
225
- ## Results Exports
226
-
227
- - Export files are generated on demand with `export`.
228
- - Files are written under `~/.snoopy/results/`.
229
- - Each export writes a timestamped file like `<YYYYMMDD-HHmmss>_<job-slug>.<ext>`.
230
- - Use `--csv` (default) or `--json` to choose output format.
231
- - Use `--last-run` to export only qualified rows from each job's most recent run.
232
- - Export files are regenerated from database truth on each export command.
233
-
234
- ## Live E2E Smoke Test
235
-
236
- Use the built-in smoke harness to verify create -> run(5) -> delete:
100
+ # 2) Submit per-result feedback
101
+ snoopy feedback submit <resultId> --valid
102
+ snoopy feedback submit <resultId> --invalid --reason "Not actually a buying signal"
237
103
 
238
- ```bash
239
- npm run e2e:smoke
104
+ # 3) Consolidate feedback into an updated qualification prompt
105
+ snoopy feedback consolidate
240
106
  ```
241
107
 
242
- Optional env vars:
243
- - `SNOOPY_E2E_LIMIT` (default `5`)
244
- - `SNOOPY_E2E_SUBREDDITS` (default `startups,entrepreneur`)
245
- - `SNOOPY_E2E_KEEP_JOB=true` to skip cleanup for debugging
108
+ Interactive `snoopy feedback review` sessions also prompt to run consolidation before exiting early.
246
109
 
247
- ## Full Documentation
110
+ ## Security And Trust
248
111
 
249
- - [Documentation Index](docs/index.md)
250
- - [Getting Started Overview](docs/getting-started/overview.md)
251
- - [Installation & Setup](docs/getting-started/installation.md)
252
- - [Quick Start](docs/getting-started/quickstart.md)
253
- - [CLI Reference](docs/reference/cli-reference.md)
254
- - [Database Schema](docs/reference/database-schema.md)
255
- - [Agent Operations](docs/guides/agent-operations.md)
256
- - [Scheduling, Cron, Daemon, and Startup](docs/guides/scheduling-and-startup.md)
257
- - [Security and Secret Storage](docs/technical/security.md)
258
- - [E2E Smoke Testing Guide](docs/technical/e2e-testing.md)
259
- - [Contributing](docs/contributing/development.md)
112
+ - Secrets are stored in the OS keychain by default (via `keytar`). Falls back to an encrypted file if keychain is unavailable.
113
+ - Environment variables override stored secrets and are recommended for CI and containerized environments.
114
+ - Reddit OAuth credentials are optional; public JSON endpoints are used by default.
115
+ - Run logs older than 5 days are deleted automatically.
260
116
 
261
- ## Docs Site
117
+ To report a security issue, open a private report through the repository security flow.
262
118
 
263
- Serve the Docusaurus docs site locally:
119
+ ## Documentation And Support
264
120
 
265
- ```bash
266
- npm run docs:start
267
- ```
121
+ - [Documentation site](https://docs.telepat.io/snoopy)
122
+ - [Installation & Setup](https://docs.telepat.io/snoopy/getting-started/installation)
123
+ - [Quick Start](https://docs.telepat.io/snoopy/getting-started/quickstart)
124
+ - [CLI Reference](https://docs.telepat.io/snoopy/reference/cli-reference)
125
+ - [Agent Operations](https://docs.telepat.io/snoopy/guides/agent-operations)
126
+ - [Scheduling & Daemon](https://docs.telepat.io/snoopy/guides/scheduling-and-startup)
127
+ - [Security](https://docs.telepat.io/snoopy/technical/security)
128
+ - [Repository](https://github.com/telepat-io/snoopy)
129
+ - [npm package](https://www.npmjs.com/package/@telepat/snoopy)
268
130
 
269
- Build and preview the static docs site:
131
+ ## Contributing
270
132
 
271
- ```bash
272
- npm run docs:build
273
- npm run docs:serve
274
- ```
133
+ Contributions are welcome. See [Development](https://docs.telepat.io/snoopy/contributing/development) for setup, workflow, and quality gates.
275
134
 
276
- Deploy to GitHub Pages:
277
-
278
- ```bash
279
- GITHUB_OWNER=telepat-io GITHUB_REPO=snoopy npm run docs:deploy
280
- ```
135
+ ## License
281
136
 
282
- Docs changes pushed to `main` under `docs/` or `website/` are also rebuilt and published to GitHub Pages automatically via GitHub Actions.
137
+ MIT. See [LICENSE](./LICENSE).
@@ -0,0 +1,137 @@
1
+ <p align="center"><img src="./assets/avatar/snoopy-logo.webp" width="128" alt="Snoopy"></p>
2
+ <h1 align="center">Snoopy</h1>
3
+ <p align="center"><em>使用 AI 监控在线对话中的高意向信号——自然语言标准,持续扫描,零基础设施。</em></p>
4
+
5
+ <p align="center">
6
+ <a href="https://docs.telepat.io/snoopy">📖 文档</a>
7
+ · <a href="./README.md">🇺🇸 English</a>
8
+ · <a href="./README.zh-CN.md">🇨🇳 简体中文</a>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://github.com/telepat-io/snoopy/actions/workflows/ci.yml"><img src="https://github.com/telepat-io/snoopy/actions/workflows/ci.yml/badge.svg?branch=main" alt="Build"></a>
13
+ <a href="https://codecov.io/gh/telepat-io/snoopy"><img src="https://codecov.io/gh/telepat-io/snoopy/graph/badge.svg" alt="Codecov"></a>
14
+ <a href="https://www.npmjs.com/package/@telepat/snoopy"><img src="https://img.shields.io/npm/v/@telepat/snoopy" alt="npm"></a>
15
+ <a href="https://github.com/telepat-io/snoopy/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-yellow.svg" alt="License"></a>
16
+ </p>
17
+
18
+ Snoopy 监控在线对话中的高意向信号,匹配您的业务目标。
19
+
20
+ 用自然语言定义您关心的内容,让 Snoopy 创建监控任务,持续扫描和评估对话,让您专注于回复和外联。
21
+
22
+ 专为需要发现真正机会而无需手动浏览在线社区的创始人、营销人员和销售团队打造。
23
+
24
+ ## 功能特性
25
+
26
+ - **自然语言任务创建** — 用自然语言描述您正在寻找的内容。Snoopy 构建 AI 辅助的监控任务。无需正则表达式,无需关键字配置。
27
+ - **AI 评估,而非关键词匹配** — 对话会对照您的意图进行评估。Snoopy 理解上下文——不仅仅是模式匹配。
28
+ - **反馈驱动的提示词进化** — 审阅结果、提交有效/无效反馈,并执行 consolidate,让评估提示词随时间持续优化。
29
+ - **持续守护进程监控** — 设置 cron 计划,让 Snoopy 在后台扫描。`snoopy daemon start`
30
+ - **代码驱动的高效率** — 确定性代码处理数据抓取、调度、状态管理和 SQLite 持久化。Token 仅用于评估。
31
+ - **本地化与隐私保护** — SQLite 数据库存储在您的机器上。无云依赖。按需导出为 CSV 或 JSON。
32
+ - **成本感知分析** — 每次运行的 Token 使用量、成本估算和符合条件的项目。`snoopy analytics --days 7`
33
+ - **智能体与 CI 就绪** — MCP 服务器、直接 SQLite 访问、非交互模式、机器可读输出。
34
+ - **跨平台** — macOS、Linux、Windows。支持开机自启。`snoopy startup install`
35
+
36
+ ## 快速开始
37
+
38
+ 环境要求:Node.js 20+、npm 10+。
39
+
40
+ ```bash
41
+ npm install -g @telepat/snoopy
42
+ ```
43
+
44
+ 1. 创建第一个监控任务:
45
+
46
+ ```bash
47
+ snoopy job add
48
+ ```
49
+
50
+ 2. 运行快速测试扫描:
51
+
52
+ ```bash
53
+ snoopy job run --limit 5
54
+ ```
55
+
56
+ 3. 启动后台守护进程:
57
+
58
+ ```bash
59
+ snoopy daemon start
60
+ ```
61
+
62
+ 4. 查看结果:
63
+
64
+ ```bash
65
+ snoopy results
66
+ snoopy export --json --last-run
67
+ ```
68
+
69
+ 完整入门流程请参阅[安装与设置](https://docs.telepat.io/snoopy/getting-started/installation)和[快速开始](https://docs.telepat.io/snoopy/getting-started/quickstart)。
70
+
71
+ ## 环境要求
72
+
73
+ - Node.js 20+
74
+ - npm 10+
75
+ - macOS、Linux 或 Windows
76
+
77
+ ## 工作原理
78
+
79
+ Snoopy 使用 Reddit 公开 JSON 端点(可选 OAuth 回退)扫描帖子和评论,并通过 AI 辅助的评估提示进行匹配。结果存储在本地 SQLite 数据库中。内置守护进程按 cron 表达式运行任务,结果可按需导出为 CSV 或 JSON。
80
+
81
+ ## 与 AI Agent 一起使用
82
+
83
+ Snoopy 专为无界面自动化和智能体驱动的监控设计:
84
+
85
+ - **非交互式 CLI** — 大多数命令支持省略 `<jobRef>` 以交互式选择,但自动化可以直接传入 ref 实现零提示执行。
86
+ - **机器可读输出** — `snoopy export --json --last-run` 和 `snoopy consume --json` 生成结构化数据,供下游智能体消费。
87
+ - **持续质量反馈闭环** — 智能体可执行 `snoopy feedback review --json`,收集人工反馈后调用 `snoopy feedback submit`,最后执行 `snoopy feedback consolidate`。
88
+ - **直接数据库访问** — SQLite 位于 `~/.snoopy/snoopy.db`(或 `$SNOOPY_ROOT_DIR/snoopy.db`),拥有完整文档化的 schema。智能体可以直接插入任务、查询结果并更新生命周期标志。
89
+ - **环境变量** — `SNOOPY_OPENROUTER_API_KEY`、`SNOOPY_REDDIT_CLIENT_SECRET` 和 `SNOOPY_ROOT_DIR` 可移除所有交互式凭证提示。
90
+ - **Agent 文档** — [Agent Operations](https://docs.telepat.io/snoopy/guides/agent-operations) 提供完整的自动化手册,包括 SQL schema、生命周期标志和推荐工作流。
91
+
92
+ ## 反馈工作流
93
+
94
+ 使用反馈命令持续提升评估质量:
95
+
96
+ ```bash
97
+ # 1)审阅未验证的合格结果(适合智能体的 JSON)
98
+ snoopy feedback review --json --limit 10
99
+
100
+ # 2)逐条提交反馈
101
+ snoopy feedback submit <resultId> --valid
102
+ snoopy feedback submit <resultId> --invalid --reason "这不是实际购买意图"
103
+
104
+ # 3)合并反馈并更新评估提示词
105
+ snoopy feedback consolidate
106
+ ```
107
+
108
+ 在交互式 `snoopy feedback review` 中,若提前退出会提示是否先执行 consolidate。
109
+
110
+ ## 安全与信任
111
+
112
+ - 密钥默认保存在 OS 钥匙串中(通过 `keytar`)。如果钥匙串不可用,则回退到加密文件。
113
+ - 环境变量会覆盖已存储的密钥,推荐用于 CI 和容器化环境。
114
+ - Reddit OAuth 凭证为可选;默认使用公开 JSON 端点。
115
+ - 运行日志超过 5 天会自动删除。
116
+
117
+ 如需报告安全问题,请通过仓库安全报告通道私下提交。
118
+
119
+ ## 文档与支持
120
+
121
+ - [文档站点](https://docs.telepat.io/snoopy)
122
+ - [安装与设置](https://docs.telepat.io/snoopy/getting-started/installation)
123
+ - [快速开始](https://docs.telepat.io/snoopy/getting-started/quickstart)
124
+ - [CLI 参考](https://docs.telepat.io/snoopy/reference/cli-reference)
125
+ - [Agent Operations](https://docs.telepat.io/snoopy/guides/agent-operations)
126
+ - [调度与守护进程](https://docs.telepat.io/snoopy/guides/scheduling-and-startup)
127
+ - [安全](https://docs.telepat.io/snoopy/technical/security)
128
+ - [仓库](https://github.com/telepat-io/snoopy)
129
+ - [npm 包](https://www.npmjs.com/package/@telepat/snoopy)
130
+
131
+ ## 贡献
132
+
133
+ 欢迎贡献。请参阅[开发指南](https://docs.telepat.io/snoopy/contributing/development)了解环境搭建、工作流和质量门禁。
134
+
135
+ ## 许可证
136
+
137
+ MIT。详见 [LICENSE](./LICENSE)。
@@ -0,0 +1,18 @@
1
+ export type AgentRuntime = 'claude' | 'claude-desktop' | 'chatgpt' | 'gemini' | 'codex' | 'cursor' | 'vscode' | 'opencode' | 'generic-mcp';
2
+ type AgentInstallResult = {
3
+ runtime: AgentRuntime;
4
+ installed: boolean;
5
+ configPath: string;
6
+ message: string;
7
+ };
8
+ type AgentStatusEntry = {
9
+ runtime: AgentRuntime;
10
+ installed: boolean;
11
+ configPath: string;
12
+ };
13
+ export declare function agentInstall(runtime: string): Promise<AgentInstallResult>;
14
+ export declare function agentUninstall(runtime: string): Promise<AgentInstallResult>;
15
+ export declare function agentStatus(): Promise<{
16
+ runtimes: AgentStatusEntry[];
17
+ }>;
18
+ export {};