poke-gate 0.1.1 → 0.1.4
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/.github/workflows/docs.yml +56 -0
- package/README.md +8 -4
- package/assets/screenshots/agents-editor.png +0 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/AgentsView.swift +485 -0
- package/clients/Poke macOS Gate/Poke macOS Gate/Poke_macOS_GateApp.swift +10 -0
- package/clients/Poke macOS Gate/Poke macOS Gate.xcodeproj/project.pbxproj +2 -2
- package/clients/Poke macOS Gate/Poke macOS Gate.xcodeproj/project.xcworkspace/xcuserdata/fka.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/docs/.vitepress/config.mts +75 -0
- package/docs/agents/beeper.md +107 -0
- package/docs/agents/community.md +77 -0
- package/docs/agents/creating.md +132 -0
- package/docs/agents/index.md +85 -0
- package/docs/agents/installing.md +66 -0
- package/docs/agents/sharing.md +97 -0
- package/docs/cli.md +73 -0
- package/docs/getting-started.md +62 -0
- package/docs/how-it-works.md +56 -0
- package/docs/index.md +63 -0
- package/docs/macos-app.md +74 -0
- package/docs/package-lock.json +3629 -0
- package/docs/package.json +15 -0
- package/docs/public/CNAME +1 -0
- package/docs/public/agents-editor.png +0 -0
- package/docs/public/logo.png +0 -0
- package/docs/security.md +35 -0
- package/docs/tools.md +101 -0
- package/examples/agents/battery.30m.js +78 -0
- package/examples/agents/screentime.24h.js +86 -0
- package/examples/agents/wifi.30m.js +85 -0
- package/package.json +1 -1
- package/src/agents.js +20 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Beeper Agent
|
|
2
|
+
|
|
3
|
+
The Beeper agent fetches messages from the last hour via [Beeper Desktop](https://beeper.com)'s local API, groups them by sender, and sends a summary to your Poke agent.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Every hour:
|
|
8
|
+
|
|
9
|
+
1. Calls Beeper's local API at `http://localhost:23373`
|
|
10
|
+
2. Searches for messages from the last 60 minutes
|
|
11
|
+
3. Filters out messages you sent (only shows incoming)
|
|
12
|
+
4. Groups messages by sender name
|
|
13
|
+
5. Formats a summary with sender name, message count, and last 3 messages
|
|
14
|
+
6. Sends the summary to Poke via `sendMessage`
|
|
15
|
+
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
- [Beeper Desktop](https://beeper.com) running on your machine
|
|
19
|
+
- Beeper API token (find it in Beeper Desktop > Settings > API)
|
|
20
|
+
- Signed in to Poke (`npx poke login`)
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx poke-gate agent get beeper
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
When prompted, paste your Beeper token:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
BEEPER_TOKEN (Find it in Beeper Desktop > Settings > API): <paste>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Test
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx poke-gate run-agent beeper
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Expected output:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
[agents] Running agent: beeper (beeper.1h.js)
|
|
44
|
+
[agents] [beeper] Fetching messages from the last hour...
|
|
45
|
+
[agents] [beeper] Found 42 messages
|
|
46
|
+
[agents] [beeper] Sending summary to Poke...
|
|
47
|
+
[agents] [beeper] Summary sent to Poke.
|
|
48
|
+
[agents] [beeper] completed
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## What Poke receives
|
|
52
|
+
|
|
53
|
+
Your Poke agent gets a message like:
|
|
54
|
+
|
|
55
|
+
> Messages from the last hour (3 people):
|
|
56
|
+
>
|
|
57
|
+
> Alice (5 messages):
|
|
58
|
+
> - Hey, are you free for lunch?
|
|
59
|
+
> - The meeting got moved to 3pm
|
|
60
|
+
> - Can you review my PR?
|
|
61
|
+
>
|
|
62
|
+
> Bob (2 messages):
|
|
63
|
+
> - Deployed the fix
|
|
64
|
+
> - All tests passing now
|
|
65
|
+
>
|
|
66
|
+
> Mom (1 messages):
|
|
67
|
+
> - Don't forget dinner tonight!
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
### Env variables
|
|
72
|
+
|
|
73
|
+
| Variable | Required | Description |
|
|
74
|
+
|----------|----------|-------------|
|
|
75
|
+
| `BEEPER_TOKEN` | yes | Beeper Desktop API token |
|
|
76
|
+
| `BEEPER_BASE_URL` | no | Override default `http://localhost:23373` |
|
|
77
|
+
|
|
78
|
+
Edit: `~/.config/poke-gate/agents/.env.beeper`
|
|
79
|
+
|
|
80
|
+
### Change the interval
|
|
81
|
+
|
|
82
|
+
Rename the file to change how often it runs:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Every 30 minutes
|
|
86
|
+
mv ~/.config/poke-gate/agents/beeper.1h.js ~/.config/poke-gate/agents/beeper.30m.js
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Or use the macOS Agents editor.
|
|
90
|
+
|
|
91
|
+
## Frontmatter
|
|
92
|
+
|
|
93
|
+
```javascript
|
|
94
|
+
/**
|
|
95
|
+
* @agent beeper
|
|
96
|
+
* @name Beeper Message Digest
|
|
97
|
+
* @description Fetches messages from the last hour via Beeper Desktop and sends a summary to Poke.
|
|
98
|
+
* @interval 1h
|
|
99
|
+
* @env BEEPER_TOKEN - Beeper Desktop local API token (Settings > API)
|
|
100
|
+
* @env BEEPER_BASE_URL - (optional) Override default http://localhost:23373
|
|
101
|
+
* @author f
|
|
102
|
+
*/
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Source
|
|
106
|
+
|
|
107
|
+
[View on GitHub](https://github.com/f/poke-gate/blob/main/examples/agents/beeper.1h.js)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Community Agents
|
|
2
|
+
|
|
3
|
+
Ready-to-use agents you can install with a single command. All agents are open source and included in the [Poke Gate repository](https://github.com/f/poke-gate/tree/main/examples/agents).
|
|
4
|
+
|
|
5
|
+
## Beeper Message Digest
|
|
6
|
+
|
|
7
|
+
Fetches messages from the last hour via [Beeper Desktop](https://beeper.com)'s local API, groups them by sender, and sends a summary to Poke. Great for staying on top of conversations across all your messaging platforms without checking each one.
|
|
8
|
+
|
|
9
|
+
| | |
|
|
10
|
+
|---|---|
|
|
11
|
+
| **File** | `beeper.1h.js` |
|
|
12
|
+
| **Interval** | Every hour |
|
|
13
|
+
| **Requires** | Beeper Desktop running, API token |
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx poke-gate agent get beeper
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
[Full documentation →](/agents/beeper)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Screen Time Report
|
|
24
|
+
|
|
25
|
+
Sends a daily summary of your Mac usage — currently running apps, uptime, and top processes. Poke learns your work patterns and can answer questions like "what was I doing yesterday?" or "how long have I been working today?".
|
|
26
|
+
|
|
27
|
+
| | |
|
|
28
|
+
|---|---|
|
|
29
|
+
| **File** | `screentime.24h.js` |
|
|
30
|
+
| **Interval** | Every 24 hours |
|
|
31
|
+
| **Requires** | Nothing — works out of the box |
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx poke-gate agent get screentime
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Battery Guardian
|
|
40
|
+
|
|
41
|
+
Monitors your battery and alerts you via Poke when it drops below 20% on battery power. Only alerts once per discharge cycle — won't spam you. Resets when you plug in.
|
|
42
|
+
|
|
43
|
+
| | |
|
|
44
|
+
|---|---|
|
|
45
|
+
| **File** | `battery.30m.js` |
|
|
46
|
+
| **Interval** | Every 30 minutes |
|
|
47
|
+
| **Requires** | Nothing — works out of the box |
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx poke-gate agent get battery
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
::: tip Custom threshold
|
|
54
|
+
Set `BATTERY_THRESHOLD` in `.env.battery` to change the alert level (default: 20%).
|
|
55
|
+
:::
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## WiFi Logger
|
|
60
|
+
|
|
61
|
+
Tracks which WiFi network you're on and notifies Poke when you switch networks or disconnect. This gives Poke passive context about your location — it knows if you're at home, at the office, or at a cafe without you telling it.
|
|
62
|
+
|
|
63
|
+
| | |
|
|
64
|
+
|---|---|
|
|
65
|
+
| **File** | `wifi.30m.js` |
|
|
66
|
+
| **Interval** | Every 30 minutes |
|
|
67
|
+
| **Requires** | Nothing — works out of the box |
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx poke-gate agent get wifi
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Want more?
|
|
76
|
+
|
|
77
|
+
Check the [Sharing Agents](/agents/sharing) page for ideas and instructions on contributing your own agent to the community.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Creating Agents
|
|
2
|
+
|
|
3
|
+
This guide walks you through creating an agent from scratch.
|
|
4
|
+
|
|
5
|
+
## Step 1: Create the file
|
|
6
|
+
|
|
7
|
+
Agents live in `~/.config/poke-gate/agents/`. Create a file with the naming convention `name.interval.js`:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
touch ~/.config/poke-gate/agents/hello.1h.js
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This creates an agent called "hello" that runs every hour.
|
|
14
|
+
|
|
15
|
+
## Step 2: Add frontmatter
|
|
16
|
+
|
|
17
|
+
Start with the frontmatter block. This is optional but recommended — it's displayed in the macOS Agents editor.
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
/**
|
|
21
|
+
* @agent hello
|
|
22
|
+
* @name Hello World
|
|
23
|
+
* @description Sends a greeting to Poke every hour.
|
|
24
|
+
* @interval 1h
|
|
25
|
+
* @author you
|
|
26
|
+
*/
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Step 3: Write your logic
|
|
30
|
+
|
|
31
|
+
Agents are standard Node.js ESM scripts. They can import the Poke SDK and any globally installed packages.
|
|
32
|
+
|
|
33
|
+
```javascript
|
|
34
|
+
/**
|
|
35
|
+
* @agent hello
|
|
36
|
+
* @name Hello World
|
|
37
|
+
* @description Sends a greeting to Poke every hour.
|
|
38
|
+
* @interval 1h
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
import { Poke, getToken } from "poke";
|
|
42
|
+
|
|
43
|
+
const token = getToken();
|
|
44
|
+
if (!token) {
|
|
45
|
+
console.error("Not signed in. Run: npx poke login");
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const poke = new Poke({ apiKey: token });
|
|
50
|
+
await poke.sendMessage("Hello! This is an automated message from my Hello agent.");
|
|
51
|
+
|
|
52
|
+
console.log("Sent greeting to Poke.");
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Step 4: Add env variables (optional)
|
|
56
|
+
|
|
57
|
+
If your agent needs secrets (API tokens, URLs, etc.), create a `.env.<name>` file:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
nano ~/.config/poke-gate/agents/.env.hello
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```env
|
|
64
|
+
# My custom config
|
|
65
|
+
MY_API_KEY=secret_123
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Then read them in your script:
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
const apiKey = process.env.MY_API_KEY;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Step 5: Test it
|
|
75
|
+
|
|
76
|
+
Run your agent manually:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npx poke-gate run-agent hello
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
You should see:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
[agents] Running agent: hello (hello.1h.js)
|
|
86
|
+
[agents] [hello] Sent greeting to Poke.
|
|
87
|
+
[agents] [hello] completed
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Step 6: Let it run
|
|
91
|
+
|
|
92
|
+
Start Poke Gate normally. Your agent will be discovered and scheduled:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npx poke-gate
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
[agents] Found 1 agent(s):
|
|
100
|
+
Hello World (every 1h)
|
|
101
|
+
[agents] Running agent: hello (hello.1h.js)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Tips
|
|
105
|
+
|
|
106
|
+
- **Keep agents fast.** They have a 5-minute timeout. If your agent takes longer, it'll be killed.
|
|
107
|
+
- **Use `console.log`** for debugging. Output appears in the Poke Gate logs.
|
|
108
|
+
- **Handle errors gracefully.** If your agent throws, it logs the error and continues to the next scheduled run.
|
|
109
|
+
- **Change the interval** by renaming the file (e.g. `hello.1h.js` → `hello.30m.js`) or using the macOS Agents editor.
|
|
110
|
+
|
|
111
|
+
## Template
|
|
112
|
+
|
|
113
|
+
Here's a minimal template to copy:
|
|
114
|
+
|
|
115
|
+
```javascript
|
|
116
|
+
/**
|
|
117
|
+
* @agent my-agent
|
|
118
|
+
* @name My Agent
|
|
119
|
+
* @description What this agent does.
|
|
120
|
+
* @interval 1h
|
|
121
|
+
*/
|
|
122
|
+
|
|
123
|
+
import { Poke, getToken } from "poke";
|
|
124
|
+
|
|
125
|
+
const poke = new Poke({ apiKey: getToken() });
|
|
126
|
+
|
|
127
|
+
// Your logic here
|
|
128
|
+
const result = "Something useful";
|
|
129
|
+
|
|
130
|
+
await poke.sendMessage(result);
|
|
131
|
+
console.log("Done.");
|
|
132
|
+
```
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Agents
|
|
2
|
+
|
|
3
|
+
Agents are scheduled scripts that **push information from your computer to Poke**. They run in the background, gather data from local sources (APIs, files, services), and send it to your Poke agent — so Poke learns about what's happening on your machine without you asking.
|
|
4
|
+
|
|
5
|
+
Think of it this way: **Tools** let Poke pull from your machine (you ask, Poke acts). **Agents** let your machine push to Poke (your computer tells Poke, Poke learns and replies).
|
|
6
|
+
|
|
7
|
+
::: tip Secure and deterministic
|
|
8
|
+
Agents are **push-only** — they send data to Poke, but Poke cannot reach back into the agent or your computer through them. Each agent is a plain JavaScript file that you write and control. It runs the same way every time, with no AI decision-making involved. The agent doesn't "try" to access your machine — it only does exactly what the script says. This makes agents predictable, auditable, and safe.
|
|
9
|
+
:::
|
|
10
|
+
|
|
11
|
+
```mermaid
|
|
12
|
+
flowchart LR
|
|
13
|
+
subgraph YourMac ["Your Mac"]
|
|
14
|
+
Agent["Agent script"]
|
|
15
|
+
Local["Local data source"]
|
|
16
|
+
Local -->|reads| Agent
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
Agent -->|sendMessage| Poke["Poke Agent"]
|
|
20
|
+
Poke -->|replies| You["You"]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Example:** A Beeper agent runs every hour, fetches your unread messages, and sends a digest to Poke. Now Poke knows who messaged you — and can answer "did anyone text me?" without needing your machine in real time.
|
|
24
|
+
|
|
25
|
+
## How agents work
|
|
26
|
+
|
|
27
|
+
1. You place a `.js` file in `~/.config/poke-gate/agents/`
|
|
28
|
+
2. The filename defines the schedule: `name.interval.js`
|
|
29
|
+
3. When Poke Gate connects, it discovers all agents and starts their timers
|
|
30
|
+
4. Each agent runs once immediately, then repeats on schedule
|
|
31
|
+
5. Agents use the Poke SDK to send messages — pushing data to your agent
|
|
32
|
+
|
|
33
|
+
## Naming convention
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
<name>.<interval>.js
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
| File | Runs |
|
|
40
|
+
|------|------|
|
|
41
|
+
| `beeper.1h.js` | Every hour |
|
|
42
|
+
| `backup.2h.js` | Every 2 hours |
|
|
43
|
+
| `health.10m.js` | Every 10 minutes |
|
|
44
|
+
| `cleanup.30m.js` | Every 30 minutes |
|
|
45
|
+
| `digest.24h.js` | Every 24 hours |
|
|
46
|
+
|
|
47
|
+
**Intervals:** `Nm` (minutes) or `Nh` (hours). Minimum is **10 minutes**.
|
|
48
|
+
|
|
49
|
+
## Frontmatter
|
|
50
|
+
|
|
51
|
+
Each agent starts with a JSDoc-style frontmatter block:
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
/**
|
|
55
|
+
* @agent beeper
|
|
56
|
+
* @name Beeper Message Digest
|
|
57
|
+
* @description Fetches messages from the last hour and sends a summary.
|
|
58
|
+
* @interval 1h
|
|
59
|
+
* @env BEEPER_TOKEN - Beeper Desktop local API token
|
|
60
|
+
* @author f
|
|
61
|
+
*/
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The `@name` and `@description` are shown in the macOS app's Agents editor and in the scheduler logs.
|
|
65
|
+
|
|
66
|
+
## Per-agent env files
|
|
67
|
+
|
|
68
|
+
Each agent can have a `.env.<name>` file in the same directory:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
~/.config/poke-gate/agents/.env.beeper
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```env
|
|
75
|
+
BEEPER_TOKEN=your_token_here
|
|
76
|
+
BEEPER_BASE_URL=http://localhost:23373
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Variables are injected into the agent's environment automatically. The agent reads them via `process.env.BEEPER_TOKEN`.
|
|
80
|
+
|
|
81
|
+
## What's next?
|
|
82
|
+
|
|
83
|
+
- [Creating Agents](/agents/creating) — write your first agent from scratch
|
|
84
|
+
- [Installing Agents](/agents/installing) — download community agents
|
|
85
|
+
- [Beeper Example](/agents/beeper) — full walkthrough of a real agent
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Installing Agents
|
|
2
|
+
|
|
3
|
+
You can download community agents from the Poke Gate repository with a single command.
|
|
4
|
+
|
|
5
|
+
## Install an agent
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx poke-gate agent get <name>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
For example:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx poke-gate agent get beeper
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This does three things:
|
|
18
|
+
|
|
19
|
+
1. **Downloads the agent script** from GitHub to `~/.config/poke-gate/agents/`
|
|
20
|
+
2. **Downloads the env template** (if one exists)
|
|
21
|
+
3. **Prompts you to fill in env variables** interactively
|
|
22
|
+
|
|
23
|
+
## Interactive env setup
|
|
24
|
+
|
|
25
|
+
If the agent needs secrets, you'll be prompted:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Fetching agent "beeper" from GitHub...
|
|
29
|
+
Saved: ~/.config/poke-gate/agents/beeper.1h.js
|
|
30
|
+
|
|
31
|
+
This agent needs 1 env variable(s):
|
|
32
|
+
|
|
33
|
+
BEEPER_TOKEN (Find it in Beeper Desktop > Settings > API): █
|
|
34
|
+
|
|
35
|
+
Saved: ~/.config/poke-gate/agents/.env.beeper
|
|
36
|
+
|
|
37
|
+
Test it: npx poke-gate run-agent beeper
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The prompt parses the `.env` template, identifies placeholder values, and asks you for real ones. Comments from the template are shown as hints.
|
|
41
|
+
|
|
42
|
+
## Test after installing
|
|
43
|
+
|
|
44
|
+
Always test the agent before relying on it:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx poke-gate run-agent beeper
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Existing env files
|
|
51
|
+
|
|
52
|
+
If you already have a `.env.<name>` file, it won't be overwritten. You'll see:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
.env.beeper already exists, skipped.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Browse available agents
|
|
59
|
+
|
|
60
|
+
See all community agents at:
|
|
61
|
+
|
|
62
|
+
[github.com/f/poke-gate/tree/main/examples/agents](https://github.com/f/poke-gate/tree/main/examples/agents)
|
|
63
|
+
|
|
64
|
+
## Install via macOS app
|
|
65
|
+
|
|
66
|
+
You can also manage agents through the macOS app's **Agents** window — browse, edit, and create agents with a built-in syntax-highlighted editor.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Sharing Agents
|
|
2
|
+
|
|
3
|
+
Built a useful agent? Share it with the community by opening a pull request.
|
|
4
|
+
|
|
5
|
+
## How sharing works
|
|
6
|
+
|
|
7
|
+
Community agents live in the [`examples/agents/`](https://github.com/f/poke-gate/tree/main/examples/agents) directory of the Poke Gate repository. Anyone can install them with:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx poke-gate agent get <name>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Submit your agent
|
|
14
|
+
|
|
15
|
+
### 1. Fork the repo
|
|
16
|
+
|
|
17
|
+
Go to [github.com/f/poke-gate](https://github.com/f/poke-gate) and click **Fork**.
|
|
18
|
+
|
|
19
|
+
### 2. Add your agent files
|
|
20
|
+
|
|
21
|
+
Place your files in `examples/agents/`:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
examples/agents/
|
|
25
|
+
your-agent.1h.js # The agent script
|
|
26
|
+
.env.your-agent # Env template with placeholder values
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 3. Agent checklist
|
|
30
|
+
|
|
31
|
+
Before submitting, make sure your agent:
|
|
32
|
+
|
|
33
|
+
- Has a **frontmatter block** with `@agent`, `@name`, `@description`, `@interval`, `@env`, `@author`
|
|
34
|
+
- Uses **placeholder values** in the `.env` file (e.g. `YOUR_TOKEN_HERE`) — never real credentials
|
|
35
|
+
- Has **comments in the `.env`** explaining where to find each value
|
|
36
|
+
- Handles **errors gracefully** — logs useful messages, doesn't crash silently
|
|
37
|
+
- Stays within the **5-minute timeout**
|
|
38
|
+
- Uses `getToken()` from the Poke SDK for authentication (not hardcoded tokens)
|
|
39
|
+
|
|
40
|
+
### 4. Frontmatter example
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
/**
|
|
44
|
+
* @agent your-agent
|
|
45
|
+
* @name Your Agent Name
|
|
46
|
+
* @description Clear one-line description of what this agent does.
|
|
47
|
+
* @interval 1h
|
|
48
|
+
* @env API_TOKEN - Where to find this token
|
|
49
|
+
* @env BASE_URL - (optional) Override the default URL
|
|
50
|
+
* @author your-github-username
|
|
51
|
+
*/
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 5. Env template example
|
|
55
|
+
|
|
56
|
+
```env
|
|
57
|
+
# Where to find this token: App > Settings > API
|
|
58
|
+
API_TOKEN=your_token_here
|
|
59
|
+
|
|
60
|
+
# Optional: override the default API URL
|
|
61
|
+
# BASE_URL=http://localhost:8080
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Use `your_*_here` as placeholder values — the installer detects these and prompts the user.
|
|
65
|
+
|
|
66
|
+
### 6. Open a PR
|
|
67
|
+
|
|
68
|
+
Push to your fork and open a pull request to `f/poke-gate` with:
|
|
69
|
+
|
|
70
|
+
- **Title:** `agent: add <name>`
|
|
71
|
+
- **Description:** What the agent does, what service it connects to, any prerequisites
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git checkout -b agent/your-agent
|
|
75
|
+
git add examples/agents/
|
|
76
|
+
git commit -m "agent: add your-agent"
|
|
77
|
+
git push origin agent/your-agent
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Then open the PR at [github.com/f/poke-gate/compare](https://github.com/f/poke-gate/compare).
|
|
81
|
+
|
|
82
|
+
## Agent ideas
|
|
83
|
+
|
|
84
|
+
Looking for inspiration? Here are some agents the community would love:
|
|
85
|
+
|
|
86
|
+
| Idea | What it does |
|
|
87
|
+
|------|-------------|
|
|
88
|
+
| **GitHub notifications** | Fetch unread notifications and send a digest |
|
|
89
|
+
| **Calendar summary** | Summarize today's upcoming meetings |
|
|
90
|
+
| **Disk space monitor** | Alert when disk space is below a threshold |
|
|
91
|
+
| **Uptime checker** | Ping a list of URLs and report any downtime |
|
|
92
|
+
| **RSS reader** | Fetch latest articles from your feeds |
|
|
93
|
+
| **Git status** | Report uncommitted changes across your projects |
|
|
94
|
+
| **Docker health** | Check running containers and their status |
|
|
95
|
+
| **Mail digest** | Summarize unread emails from a local mail client |
|
|
96
|
+
|
|
97
|
+
Build one and share it!
|
package/docs/cli.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# CLI Reference
|
|
2
|
+
|
|
3
|
+
## Start the gate
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx poke-gate
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Starts the MCP server, connects the tunnel, and begins the agent scheduler. On first run, if you're not signed in, opens Poke OAuth in your browser.
|
|
10
|
+
|
|
11
|
+
### Verbose mode
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx poke-gate --verbose
|
|
15
|
+
# or
|
|
16
|
+
npx poke-gate -v
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Shows real-time tool calls:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
[14:52:01] tool: run_command
|
|
23
|
+
[14:52:01] $ ls -la ~/Code
|
|
24
|
+
[14:52:03] tool: read_file
|
|
25
|
+
[14:52:03] read: ~/.zshrc
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Run an agent
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx poke-gate run-agent <name>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Runs a single agent script immediately and exits. Useful for testing.
|
|
35
|
+
|
|
36
|
+
**Example:**
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx poke-gate run-agent beeper
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Finds `~/.config/poke-gate/agents/beeper.*.js` and runs it with the env from `.env.beeper`.
|
|
43
|
+
|
|
44
|
+
## Install an agent
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx poke-gate agent get <name>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Downloads an agent from the [community repository](https://github.com/f/poke-gate/tree/main/examples/agents) and saves it to `~/.config/poke-gate/agents/`.
|
|
51
|
+
|
|
52
|
+
If the agent has an `.env` file, you'll be prompted to fill in the values:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Fetching agent "beeper" from GitHub...
|
|
56
|
+
Saved: ~/.config/poke-gate/agents/beeper.1h.js
|
|
57
|
+
|
|
58
|
+
This agent needs 1 env variable(s):
|
|
59
|
+
|
|
60
|
+
BEEPER_TOKEN (Find it in Beeper Desktop > Settings > API): <you type>
|
|
61
|
+
|
|
62
|
+
Saved: ~/.config/poke-gate/agents/.env.beeper
|
|
63
|
+
|
|
64
|
+
Test it: npx poke-gate run-agent beeper
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Environment variables
|
|
68
|
+
|
|
69
|
+
| Variable | Description |
|
|
70
|
+
|----------|-------------|
|
|
71
|
+
| `POKE_API_KEY` | Override the API key (skips OAuth) |
|
|
72
|
+
| `POKE_API` | Override the Poke API base URL |
|
|
73
|
+
| `POKE_FRONTEND` | Override the Poke frontend URL |
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
### Homebrew
|
|
6
|
+
|
|
7
|
+
The recommended way to install the macOS app:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
brew install f/tap/poke-gate
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Manual download
|
|
14
|
+
|
|
15
|
+
Download the latest **Poke.macOS.Gate.dmg** from [GitHub Releases](https://github.com/f/poke-gate/releases/latest), open it, and drag to Applications.
|
|
16
|
+
|
|
17
|
+
Since the app is not notarized, you may need to run:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
xattr -cr /Applications/Poke\ macOS\ Gate.app
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### CLI only
|
|
24
|
+
|
|
25
|
+
If you don't need the macOS app:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx poke-gate
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Sign in
|
|
32
|
+
|
|
33
|
+
Poke Gate uses Poke OAuth to authenticate. On first launch:
|
|
34
|
+
|
|
35
|
+
1. Open Poke Gate from your menu bar
|
|
36
|
+
2. The app starts and connects automatically
|
|
37
|
+
3. If you're not signed in, a browser window opens for Poke OAuth
|
|
38
|
+
4. After signing in, the connection is established
|
|
39
|
+
|
|
40
|
+
You can also sign in manually:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx poke login
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Verify it works
|
|
47
|
+
|
|
48
|
+
Once connected, you'll see a green dot in the menu bar. The popover shows:
|
|
49
|
+
|
|
50
|
+
> ● Connected to your Poke, [your name]
|
|
51
|
+
|
|
52
|
+
Now open iMessage or Telegram and message your Poke:
|
|
53
|
+
|
|
54
|
+
> "What's my hostname?"
|
|
55
|
+
|
|
56
|
+
Poke will use the `system_info` tool to answer from your machine.
|
|
57
|
+
|
|
58
|
+
## What's next?
|
|
59
|
+
|
|
60
|
+
- [How It Works](/how-it-works) — understand the architecture
|
|
61
|
+
- [Tools](/tools) — see all available tools
|
|
62
|
+
- [Agents](/agents/) — set up scheduled automation
|