@telepat/snoopy 0.1.12 → 0.1.14
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/README.md +57 -221
- package/README.zh-CN.md +112 -0
- package/dist/src/agent/install.d.ts +18 -0
- package/dist/src/agent/install.js +488 -0
- package/dist/src/cli/commands/doctor.js +13 -2
- package/dist/src/cli/index.js +37 -0
- package/dist/src/mcp/helpers.d.ts +43 -0
- package/dist/src/mcp/helpers.js +433 -0
- package/dist/src/mcp/server.d.ts +1 -0
- package/dist/src/mcp/server.js +260 -0
- package/dist/src/mcp/tools.d.ts +77 -0
- package/dist/src/mcp/tools.js +90 -0
- package/dist/src/services/db/migrations/001_baseline.d.ts +7 -0
- package/dist/src/services/db/migrations/001_baseline.js +132 -0
- package/dist/src/services/db/migrations/index.d.ts +7 -0
- package/dist/src/services/db/migrations/index.js +3 -0
- package/dist/src/services/db/migrations/runner.d.ts +9 -0
- package/dist/src/services/db/migrations/runner.js +43 -0
- package/dist/src/services/db/sqlite.js +2 -201
- package/dist/src/utils/paths.js +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -1,276 +1,112 @@
|
|
|
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
3
|
<p align="center"><em>Sniff out the conversations that matter.</em></p>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<p align="center">
|
|
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>
|
|
9
|
+
</p>
|
|
8
10
|
|
|
9
|
-
|
|
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>
|
|
10
17
|
|
|
11
18
|
Snoopy helps you monitor Reddit for high-intent conversations that match your business goals.
|
|
12
19
|
|
|
13
|
-
Define what you care about in plain language, let Snoopy create a monitoring job, and continuously scan and qualify posts
|
|
20
|
+
Define what you care about in plain language, let Snoopy create a monitoring job, and continuously scan and qualify posts and comments so you can focus on response and outreach.
|
|
14
21
|
|
|
15
|
-
##
|
|
22
|
+
## What It Solves
|
|
16
23
|
|
|
17
24
|
- Turn broad Reddit traffic into a focused stream of opportunities.
|
|
18
25
|
- Define qualification logic once, then run continuously.
|
|
19
26
|
- Trigger manual runs when you want quick validation.
|
|
20
|
-
- Track run analytics (discovered
|
|
27
|
+
- Track run analytics (discovered, new, qualified items, token usage, cost estimate).
|
|
21
28
|
- Run cross-platform with startup-on-reboot support.
|
|
22
29
|
|
|
23
|
-
##
|
|
24
|
-
|
|
25
|
-
- Interactive job creation flow from natural-language criteria.
|
|
26
|
-
- AI-assisted clarification and job spec generation.
|
|
27
|
-
- Qualification against your prompt for posts (and comments when enabled).
|
|
28
|
-
- Local SQLite persistence for jobs, runs, and scan items.
|
|
29
|
-
- Built-in daemon for scheduled scanning (cron expressions).
|
|
30
|
-
- On-demand CSV export of qualified results per job.
|
|
31
|
-
- Explicit opt-in startup registration for macOS, Linux, and Windows.
|
|
32
|
-
- Health checks via the doctor command.
|
|
33
|
-
|
|
34
|
-
## Install
|
|
35
|
-
|
|
36
|
-
Requirements:
|
|
37
|
-
- Node.js 20+
|
|
38
|
-
- npm 10+
|
|
30
|
+
## Quick Start
|
|
39
31
|
|
|
40
|
-
|
|
32
|
+
Requirements: Node.js 20+, npm 10+.
|
|
41
33
|
|
|
42
34
|
```bash
|
|
43
35
|
npm install -g @telepat/snoopy
|
|
44
|
-
snoopy --help
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
From source:
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
npm install
|
|
51
|
-
npm run build
|
|
52
|
-
npm link
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
For first-time onboarding (OpenRouter key setup, first `job add`, and verification), see [Installation & Setup](docs/getting-started/installation.md).
|
|
56
|
-
|
|
57
|
-
## Development
|
|
58
|
-
|
|
59
|
-
Run without a global install (contributors):
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
npm run dev -- --help
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Core validation commands:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
npm run lint
|
|
69
|
-
npm run build
|
|
70
|
-
npm test
|
|
71
36
|
```
|
|
72
37
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
npm test -- --coverage
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Releases
|
|
80
|
-
|
|
81
|
-
Versioning and changelogs are managed automatically by [release-please](https://github.com/googleapis/release-please).
|
|
82
|
-
|
|
83
|
-
**How it works:**
|
|
84
|
-
1. Merge commits to `main` following [Conventional Commits](https://www.conventionalcommits.org/) (`fix:`, `feat:`, `feat!:`, etc.).
|
|
85
|
-
2. release-please maintains an open "Release PR" that accumulates version bumps and CHANGELOG entries.
|
|
86
|
-
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.
|
|
87
|
-
|
|
88
|
-
**Commit types and semver mapping (while version < 1.0.0):**
|
|
89
|
-
- `fix:` → patch bump
|
|
90
|
-
- `feat:` → patch bump (minor bump is suppressed pre-1.0)
|
|
91
|
-
- `feat!:` or `fix!:` (breaking change) → minor bump (major bump is suppressed pre-1.0)
|
|
92
|
-
|
|
93
|
-
No manual `git tag` or `npm version` steps are needed.
|
|
94
|
-
|
|
95
|
-
## Quick Start
|
|
96
|
-
|
|
97
|
-
Note:
|
|
98
|
-
- Snoopy uses Reddit public JSON endpoints by default.
|
|
99
|
-
- Optional Reddit OAuth fallback credentials can be configured in `snoopy settings` for environments where unauthenticated access is blocked.
|
|
100
|
-
- `snoopy settings` shows a full settings menu so you can jump directly to any setting and save once.
|
|
101
|
-
- If keychain storage is unavailable, configure secrets with environment variables (`SNOOPY_OPENROUTER_API_KEY`, `SNOOPY_REDDIT_CLIENT_SECRET`).
|
|
102
|
-
|
|
103
|
-
1. Start interactive setup and create your first job:
|
|
38
|
+
1. Create your first monitoring job:
|
|
104
39
|
|
|
105
40
|
```bash
|
|
106
41
|
snoopy job add
|
|
107
42
|
```
|
|
108
43
|
|
|
109
|
-
|
|
110
|
-
Snoopy pauses scheduled scans for that new job during this first run attempt, then enables scheduling when it ends (including interruption/failure cases).
|
|
111
|
-
|
|
112
|
-
2. List jobs:
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
snoopy jobs list
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
3. Run one job immediately (limit to 5 new items while testing):
|
|
44
|
+
2. Run a quick test scan:
|
|
119
45
|
|
|
120
46
|
```bash
|
|
121
47
|
snoopy job run --limit 5
|
|
122
|
-
snoopy job run <jobRef> --limit 5
|
|
123
48
|
```
|
|
124
49
|
|
|
125
|
-
|
|
126
|
-
Duplicate candidates matching an existing scan item are treated as already scanned and do not fail the run.
|
|
127
|
-
|
|
128
|
-
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.
|
|
129
|
-
|
|
130
|
-
4. View run history:
|
|
50
|
+
3. Start the background daemon:
|
|
131
51
|
|
|
132
52
|
```bash
|
|
133
|
-
snoopy
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
5. View analytics globally or for one job:
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
snoopy analytics
|
|
140
|
-
snoopy analytics <jobRef>
|
|
141
|
-
snoopy analytics --days 7
|
|
53
|
+
snoopy daemon start
|
|
142
54
|
```
|
|
143
55
|
|
|
144
|
-
|
|
56
|
+
4. View results:
|
|
145
57
|
|
|
146
58
|
```bash
|
|
147
59
|
snoopy results
|
|
148
|
-
snoopy
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
7. Regenerate qualified results files (all jobs or one job):
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
snoopy export
|
|
155
|
-
snoopy export <jobRef> --json --last-run
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
8. Consume unconsumed qualified results (read-once, most recent first):
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
snoopy consume
|
|
162
|
-
snoopy consume <jobRef> --limit 10
|
|
163
|
-
snoopy consume <jobRef> --json --dry-run
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
9. Inspect one run's detailed log output:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
snoopy logs
|
|
170
|
-
snoopy logs <runId>
|
|
171
|
-
snoopy logs <runId> --raw
|
|
60
|
+
snoopy export --json --last-run
|
|
172
61
|
```
|
|
173
62
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
10. Show recent errors for one job:
|
|
63
|
+
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).
|
|
177
64
|
|
|
178
|
-
|
|
179
|
-
snoopy errors <jobRef>
|
|
180
|
-
```
|
|
65
|
+
## Requirements
|
|
181
66
|
|
|
182
|
-
|
|
67
|
+
- Node.js 20+
|
|
68
|
+
- npm 10+
|
|
69
|
+
- macOS, Linux, or Windows
|
|
183
70
|
|
|
184
|
-
|
|
185
|
-
snoopy daemon start
|
|
186
|
-
snoopy daemon reload
|
|
187
|
-
```
|
|
71
|
+
## How It Works
|
|
188
72
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
- `job add`
|
|
192
|
-
- `job list`
|
|
193
|
-
- `job run [jobRef] --limit <N>`
|
|
194
|
-
- `job runs [jobRef]`
|
|
195
|
-
- `analytics [jobRef] --days <N>`
|
|
196
|
-
- `results [jobRef]`
|
|
197
|
-
- `export [jobRef] --csv|--json [--last-run]`
|
|
198
|
-
- `consume [jobRef] [--limit <N>] [--json] [--dry-run]`
|
|
199
|
-
- `logs [runId]`
|
|
200
|
-
- `errors [jobRef] --hours <N>`
|
|
201
|
-
- `start [jobRef]` / `stop [jobRef]`
|
|
202
|
-
- `delete [jobRef]`
|
|
203
|
-
- `daemon start|stop|status`
|
|
204
|
-
- `daemon reload`
|
|
205
|
-
- `startup status`
|
|
206
|
-
- `doctor`
|
|
207
|
-
|
|
208
|
-
## Run Logs
|
|
209
|
-
|
|
210
|
-
- Each job run writes a dedicated log file under `~/.snoopy/logs/`.
|
|
211
|
-
- Files are named `run-<runId>.log`.
|
|
212
|
-
- `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.
|
|
213
|
-
- Use `snoopy logs [runId] --raw` to print the full raw log file content, including full JSON request/response payloads for Reddit and OpenRouter calls.
|
|
214
|
-
- Rich TTY manual runs (`snoopy job run <jobRef>`) show compact multi-line scan blocks with indented fields, clickable links, and qualification justifications.
|
|
215
|
-
- In rich terminals, scan field labels are colorized and qualification status is highlighted (`qualified` in green, `not qualified` in red, `pending` in yellow).
|
|
216
|
-
- Run logs older than 5 days are deleted automatically on daemon startup and after each job run.
|
|
217
|
-
- Deleting a job also deletes all associated per-run log files for that job.
|
|
218
|
-
|
|
219
|
-
## Results Exports
|
|
220
|
-
|
|
221
|
-
- Export files are generated on demand with `export`.
|
|
222
|
-
- Files are written under `~/.snoopy/results/`.
|
|
223
|
-
- Each export writes a timestamped file like `<YYYYMMDD-HHmmss>_<job-slug>.<ext>`.
|
|
224
|
-
- Use `--csv` (default) or `--json` to choose output format.
|
|
225
|
-
- Use `--last-run` to export only qualified rows from each job's most recent run.
|
|
226
|
-
- Export files are regenerated from database truth on each export command.
|
|
227
|
-
|
|
228
|
-
## Live E2E Smoke Test
|
|
229
|
-
|
|
230
|
-
Use the built-in smoke harness to verify create -> run(5) -> delete:
|
|
73
|
+
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.
|
|
231
74
|
|
|
232
|
-
|
|
233
|
-
npm run e2e:smoke
|
|
234
|
-
```
|
|
75
|
+
## Using With AI Agents
|
|
235
76
|
|
|
236
|
-
|
|
237
|
-
- `SNOOPY_E2E_LIMIT` (default `5`)
|
|
238
|
-
- `SNOOPY_E2E_SUBREDDITS` (default `startups,entrepreneur`)
|
|
239
|
-
- `SNOOPY_E2E_KEEP_JOB=true` to skip cleanup for debugging
|
|
77
|
+
Snoopy is built for headless automation and agent-driven monitoring:
|
|
240
78
|
|
|
241
|
-
|
|
79
|
+
- **Non-interactive CLI** — Most commands support omitting `<jobRef>` to get an interactive picker, but automation can pass refs directly for zero-prompt execution.
|
|
80
|
+
- **Machine-readable output** — `snoopy export --json --last-run` and `snoopy consume --json` produce structured data for downstream agents.
|
|
81
|
+
- **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.
|
|
82
|
+
- **Environment variables** — `SNOOPY_OPENROUTER_API_KEY`, `SNOOPY_REDDIT_CLIENT_SECRET`, and `SNOOPY_ROOT_DIR` remove all interactive credential prompts.
|
|
83
|
+
- **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.
|
|
242
84
|
|
|
243
|
-
|
|
244
|
-
- [Getting Started Overview](docs/getting-started/overview.md)
|
|
245
|
-
- [Installation & Setup](docs/getting-started/installation.md)
|
|
246
|
-
- [Quick Start](docs/getting-started/quickstart.md)
|
|
247
|
-
- [CLI Reference](docs/reference/cli-reference.md)
|
|
248
|
-
- [Database Schema](docs/reference/database-schema.md)
|
|
249
|
-
- [Agent Operations](docs/guides/agent-operations.md)
|
|
250
|
-
- [Scheduling, Cron, Daemon, and Startup](docs/guides/scheduling-and-startup.md)
|
|
251
|
-
- [Security and Secret Storage](docs/technical/security.md)
|
|
252
|
-
- [E2E Smoke Testing Guide](docs/technical/e2e-testing.md)
|
|
253
|
-
- [Contributing](docs/contributing/development.md)
|
|
85
|
+
## Security And Trust
|
|
254
86
|
|
|
255
|
-
|
|
87
|
+
- Secrets are stored in the OS keychain by default (via `keytar`). Falls back to an encrypted file if keychain is unavailable.
|
|
88
|
+
- Environment variables override stored secrets and are recommended for CI and containerized environments.
|
|
89
|
+
- Reddit OAuth credentials are optional; public JSON endpoints are used by default.
|
|
90
|
+
- Run logs older than 5 days are deleted automatically.
|
|
256
91
|
|
|
257
|
-
|
|
92
|
+
To report a security issue, open a private report through the repository security flow.
|
|
258
93
|
|
|
259
|
-
|
|
260
|
-
npm run docs:start
|
|
261
|
-
```
|
|
94
|
+
## Documentation And Support
|
|
262
95
|
|
|
263
|
-
|
|
96
|
+
- [Documentation site](https://docs.telepat.io/snoopy)
|
|
97
|
+
- [Installation & Setup](https://docs.telepat.io/snoopy/getting-started/installation)
|
|
98
|
+
- [Quick Start](https://docs.telepat.io/snoopy/getting-started/quickstart)
|
|
99
|
+
- [CLI Reference](https://docs.telepat.io/snoopy/reference/cli-reference)
|
|
100
|
+
- [Agent Operations](https://docs.telepat.io/snoopy/guides/agent-operations)
|
|
101
|
+
- [Scheduling & Daemon](https://docs.telepat.io/snoopy/guides/scheduling-and-startup)
|
|
102
|
+
- [Security](https://docs.telepat.io/snoopy/technical/security)
|
|
103
|
+
- [Repository](https://github.com/telepat-io/snoopy)
|
|
104
|
+
- [npm package](https://www.npmjs.com/package/@telepat/snoopy)
|
|
264
105
|
|
|
265
|
-
|
|
266
|
-
npm run docs:build
|
|
267
|
-
npm run docs:serve
|
|
268
|
-
```
|
|
106
|
+
## Contributing
|
|
269
107
|
|
|
270
|
-
|
|
108
|
+
Contributions are welcome. See [Development](https://docs.telepat.io/snoopy/contributing/development) for setup, workflow, and quality gates.
|
|
271
109
|
|
|
272
|
-
|
|
273
|
-
GITHUB_OWNER=telepat-io GITHUB_REPO=snoopy npm run docs:deploy
|
|
274
|
-
```
|
|
110
|
+
## License
|
|
275
111
|
|
|
276
|
-
|
|
112
|
+
MIT. See [LICENSE](./LICENSE).
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
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>嗅出重要的对话。</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 帮助你监控 Reddit,找到与业务目标高度相关的对话。
|
|
19
|
+
|
|
20
|
+
用自然语言定义你关心的内容,让 Snoopy 创建监控任务,然后持续扫描和评估帖子和评论,让你专注于回复和外联。
|
|
21
|
+
|
|
22
|
+
## 它能解决什么问题
|
|
23
|
+
|
|
24
|
+
- 将广泛的 Reddit 流量转化为聚焦的机会流。
|
|
25
|
+
- 一次性定义评估逻辑,然后持续运行。
|
|
26
|
+
- 需要快速验证时触发手动运行。
|
|
27
|
+
- 跟踪运行分析数据(发现、新增、符合条件的项目、token 用量、成本估算)。
|
|
28
|
+
- 跨平台运行,支持开机自启。
|
|
29
|
+
|
|
30
|
+
## 快速开始
|
|
31
|
+
|
|
32
|
+
环境要求:Node.js 20+、npm 10+。
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install -g @telepat/snoopy
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
1. 创建第一个监控任务:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
snoopy job add
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
2. 运行快速测试扫描:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
snoopy job run --limit 5
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
3. 启动后台守护进程:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
snoopy daemon start
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
4. 查看结果:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
snoopy results
|
|
60
|
+
snoopy export --json --last-run
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
完整入门流程请参阅[安装与设置](https://docs.telepat.io/snoopy/getting-started/installation)和[快速开始](https://docs.telepat.io/snoopy/getting-started/quickstart)。
|
|
64
|
+
|
|
65
|
+
## 环境要求
|
|
66
|
+
|
|
67
|
+
- Node.js 20+
|
|
68
|
+
- npm 10+
|
|
69
|
+
- macOS、Linux 或 Windows
|
|
70
|
+
|
|
71
|
+
## 工作原理
|
|
72
|
+
|
|
73
|
+
Snoopy 使用 Reddit 公开 JSON 端点(可选 OAuth 回退)扫描帖子和评论,并通过 AI 辅助的评估提示进行匹配。结果存储在本地 SQLite 数据库中。内置守护进程按 cron 表达式运行任务,结果可按需导出为 CSV 或 JSON。
|
|
74
|
+
|
|
75
|
+
## 与 AI Agent 一起使用
|
|
76
|
+
|
|
77
|
+
Snoopy 专为无界面自动化和智能体驱动的监控设计:
|
|
78
|
+
|
|
79
|
+
- **非交互式 CLI** — 大多数命令支持省略 `<jobRef>` 以交互式选择,但自动化可以直接传入 ref 实现零提示执行。
|
|
80
|
+
- **机器可读输出** — `snoopy export --json --last-run` 和 `snoopy consume --json` 生成结构化数据,供下游智能体消费。
|
|
81
|
+
- **直接数据库访问** — SQLite 位于 `~/.snoopy/snoopy.db`(或 `$SNOOPY_ROOT_DIR/snoopy.db`),拥有完整文档化的 schema。智能体可以直接插入任务、查询结果并更新生命周期标志。
|
|
82
|
+
- **环境变量** — `SNOOPY_OPENROUTER_API_KEY`、`SNOOPY_REDDIT_CLIENT_SECRET` 和 `SNOOPY_ROOT_DIR` 可移除所有交互式凭证提示。
|
|
83
|
+
- **Agent 文档** — [Agent Operations](https://docs.telepat.io/snoopy/guides/agent-operations) 提供完整的自动化手册,包括 SQL schema、生命周期标志和推荐工作流。
|
|
84
|
+
|
|
85
|
+
## 安全与信任
|
|
86
|
+
|
|
87
|
+
- 密钥默认保存在 OS 钥匙串中(通过 `keytar`)。如果钥匙串不可用,则回退到加密文件。
|
|
88
|
+
- 环境变量会覆盖已存储的密钥,推荐用于 CI 和容器化环境。
|
|
89
|
+
- Reddit OAuth 凭证为可选;默认使用公开 JSON 端点。
|
|
90
|
+
- 运行日志超过 5 天会自动删除。
|
|
91
|
+
|
|
92
|
+
如需报告安全问题,请通过仓库安全报告通道私下提交。
|
|
93
|
+
|
|
94
|
+
## 文档与支持
|
|
95
|
+
|
|
96
|
+
- [文档站点](https://docs.telepat.io/snoopy)
|
|
97
|
+
- [安装与设置](https://docs.telepat.io/snoopy/getting-started/installation)
|
|
98
|
+
- [快速开始](https://docs.telepat.io/snoopy/getting-started/quickstart)
|
|
99
|
+
- [CLI 参考](https://docs.telepat.io/snoopy/reference/cli-reference)
|
|
100
|
+
- [Agent Operations](https://docs.telepat.io/snoopy/guides/agent-operations)
|
|
101
|
+
- [调度与守护进程](https://docs.telepat.io/snoopy/guides/scheduling-and-startup)
|
|
102
|
+
- [安全](https://docs.telepat.io/snoopy/technical/security)
|
|
103
|
+
- [仓库](https://github.com/telepat-io/snoopy)
|
|
104
|
+
- [npm 包](https://www.npmjs.com/package/@telepat/snoopy)
|
|
105
|
+
|
|
106
|
+
## 贡献
|
|
107
|
+
|
|
108
|
+
欢迎贡献。请参阅[开发指南](https://docs.telepat.io/snoopy/contributing/development)了解环境搭建、工作流和质量门禁。
|
|
109
|
+
|
|
110
|
+
## 许可证
|
|
111
|
+
|
|
112
|
+
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 {};
|