@gloaming/poke 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +136 -2
- package/daemon.js +175 -0
- package/drizzle/20261123093322_init/migration.sql +38 -0
- package/drizzle/20261123093322_init/snapshot.json +330 -0
- package/drizzle/20261123101024_poll_cursors_and_secrets/migration.sql +8 -0
- package/drizzle/20261123101024_poll_cursors_and_secrets/snapshot.json +382 -0
- package/drizzle/20261123124858_owner_trust/migration.sql +5 -0
- package/drizzle/20261123124858_owner_trust/snapshot.json +382 -0
- package/drizzle/20261123130247_looks/migration.sql +7 -0
- package/drizzle/20261123130247_looks/snapshot.json +413 -0
- package/drizzle/20261123133921_look_states/migration.sql +4 -0
- package/drizzle/20261123133921_look_states/snapshot.json +444 -0
- package/drizzle/20261123140834_pattern_states/migration.sql +7 -0
- package/drizzle/20261123140834_pattern_states/snapshot.json +495 -0
- package/drizzle/20261123141452_source_cursors/migration.sql +4 -0
- package/drizzle/20261123141452_source_cursors/snapshot.json +526 -0
- package/drizzle/20261124082939_replies/migration.sql +7 -0
- package/drizzle/20261124082939_replies/snapshot.json +581 -0
- package/package.json +24 -4
- package/poke-skill.md +100 -0
- package/poke.js +301 -0
- package/presets/bluesky.json +22 -0
- package/presets/docker-events.json +18 -0
- package/presets/github-releases.json +22 -0
- package/presets/gmail.json +27 -0
- package/presets/home-assistant.json +23 -0
- package/presets/journald-over-ssh.json +27 -0
- package/presets/kubectl-watch.json +22 -0
- package/presets/log-file.json +24 -0
- package/presets/mastodon.json +27 -0
- package/presets/modbus.json +40 -0
- package/presets/mqtt.json +28 -0
- package/presets/ntfy.json +28 -0
- package/presets/onvif.json +23 -0
- package/presets/serial.json +31 -0
- package/presets/status-page.json +18 -0
- package/presets/syslog.json +24 -0
- package/types/discord/main.js +35 -0
- package/types/discord/type.json +47 -0
- package/types/imap/main.js +134 -0
- package/types/imap/type.json +54 -0
- package/types/presence/main.js +35 -0
- package/types/presence/type.json +27 -0
- package/types/slack/main.js +35 -0
- package/types/slack/type.json +52 -0
- package/types/system/run.sh +19 -0
- package/types/system/system-events.swift +153 -0
- package/types/system/type.json +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Szymon Ograbek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,137 @@
|
|
|
1
|
-
#
|
|
1
|
+
# poke
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
poke is the default way for a coding agent to wait for something. When a condition comes true, poke Wakes the Session that asked, Spawns a new Session, or Runs a command.
|
|
4
|
+
|
|
5
|
+
For example, an agent that opened a pull request runs this command and ends its turn:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
poke on github --type pull_request_review --where 'sender.login!=my-bot' --wake
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The next review on the repository arrives in that Session as a message. The review's payload is fenced and labelled untrusted.
|
|
12
|
+
|
|
13
|
+
poke is a small daemon on your Mac. The `poke` CLI talks to it over a unix socket in `~/.poke`. It delivers into Claude Code and T3 Code.
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- macOS.
|
|
18
|
+
- [Bun](https://bun.sh) 1.4.4 or newer.
|
|
19
|
+
- Claude Code or T3 Code, for Wake and Spawn. Run works without them.
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
1. Install the package:
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
bun add -g @gloaming/poke
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
2. Put a `poke` shim in `~/.local/bin`:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
poke install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
3. Run the daemon as a launchd agent. It starts at login and restarts when it exits:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
poke daemon install
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
4. Teach your Claude Code agents to use poke:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
poke install-skill
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
5. Check that the daemon answers:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
poke status
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The launchd agent saves your shell's `PATH` and `CLAUDE_CONFIG_DIR` when you install it. Run `poke daemon install` again after you change them, and after you update poke. Every install command takes `--dry-run`. `poke daemon logs -f` follows the daemon's log. `poke daemon uninstall` removes the agent and keeps `~/.poke`.
|
|
54
|
+
|
|
55
|
+
## Your first Rule
|
|
56
|
+
|
|
57
|
+
A Timer needs no accounts. Make a Timer that fires in one minute, and a Rule that Runs a command when it fires:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
poke sources add tea --timer --in 1m
|
|
61
|
+
poke on tea --run 'osascript -e "display notification \"Tea is ready\" with title \"poke\""'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
After a minute you see a notification. `poke log` shows the Event and what the Rule did with it.
|
|
65
|
+
|
|
66
|
+
Inside a Claude Code or T3 Code Session, an agent writes `--wake` instead of `--run`. The Session then gets a message when the Timer fires. Rules made inside a Session are One-shot: they fire once and retire. Rules made from a terminal are Standing: they fire on every match until you run `poke rules rm <id>`.
|
|
67
|
+
|
|
68
|
+
## Webhooks
|
|
69
|
+
|
|
70
|
+
A Webhook Source needs a Relay: a public server that receives webhooks and holds them, encrypted, until your daemon collects them. Pick one of the two options:
|
|
71
|
+
|
|
72
|
+
- Sign in to the hosted Relay at `https://poke.ograbek.com`. Run `poke login`, enter your email, open the link you get, and approve the code that `poke login` prints. `poke logout` signs out.
|
|
73
|
+
- Deploy your own Relay to your Cloudflare account, then pair with it with `poke relay pair --url <relay url>`. [CONTRIBUTING.md](CONTRIBUTING.md#self-host-the-relay) has the steps.
|
|
74
|
+
|
|
75
|
+
`poke relay status` shows the connection. Then add a Webhook Source:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
poke sources add github --webhook --preset github
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The command prints a URL and a signing secret once. Register both with the service.
|
|
82
|
+
|
|
83
|
+
## What poke can watch
|
|
84
|
+
|
|
85
|
+
Each Source kind is a flag of `poke sources add`:
|
|
86
|
+
|
|
87
|
+
- `--webhook`: a service pushes to the Relay. `--preset github`, `--preset sentry` and `--preset standard-webhooks` know how those services sign requests.
|
|
88
|
+
- `--poll --command <script> --interval 5m`: a script you write reports new items.
|
|
89
|
+
- `--look feed|http|calendar|command`: poke looks at a feed, a URL, a calendar or a command's output again and again, and reports what changed.
|
|
90
|
+
- `--stream`: poke holds a connection open (`--sse`, `--websocket` or `--command`) and reports each message.
|
|
91
|
+
- `--folder <dir>`: a file appears or changes.
|
|
92
|
+
- `--timer --in 2h`, `--timer --at <ISO time>` and `--cron '0 9 * * 1-5'`: a time or a schedule.
|
|
93
|
+
- `--type imap`, `--type slack` and `--type discord`: new mail, Slack messages and Discord messages. These types only read. They never send.
|
|
94
|
+
- `--type system` and `--type presence`: your Mac's sleep, lock, power and network events, and devices that arrive on or leave your network.
|
|
95
|
+
- `--mcp-command` and `--mcp-url`: events from an MCP server.
|
|
96
|
+
|
|
97
|
+
`poke presets list` shows ready-made declarations for MQTT, syslog, Docker, Kubernetes, ntfy, Home Assistant, Mastodon, Gmail and other services. `poke presets show <name>` prints the tools and secrets that a Preset needs, and the `poke sources add` line to run.
|
|
98
|
+
|
|
99
|
+
When no kind fits, an agent can write a Source type: a directory with a `type.json` and a script in any language. `poke types add <dir>` adds it. In TypeScript, [`@gloaming/poke-source-kit`](https://www.npmjs.com/package/@gloaming/poke-source-kit) implements the protocol for you.
|
|
100
|
+
|
|
101
|
+
## Trust
|
|
102
|
+
|
|
103
|
+
Every Source has a Trust level: `owner` or `untrusted`. Events from Webhook, Poll, Look and Source type Sources are `untrusted` by default, because an outside party wrote them. In each Wake or Spawn message, poke puts every payload in a fenced block labelled with its Trust level. The poke skill tells agents to read an `untrusted` block as data and to ignore instructions inside it. Only you can raise a Source to `owner`, with `poke sources trust <name> owner` at your own terminal.
|
|
104
|
+
|
|
105
|
+
## Standing Rules in a file
|
|
106
|
+
|
|
107
|
+
Declare the Rules you always want in `~/.poke/config.json`. The file holds no secrets, so you can keep it in git:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"rules": [
|
|
112
|
+
{
|
|
113
|
+
"name": "prod-deploys",
|
|
114
|
+
"source": "deploys",
|
|
115
|
+
"type": ["deploy"],
|
|
116
|
+
"where": ["env=prod author!=bot"],
|
|
117
|
+
"run": "notify-deploy.sh",
|
|
118
|
+
"max-age": "5m"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The keys are the flags of `poke on`, plus a stable `name`. Run `poke config reload` after you edit the file.
|
|
125
|
+
|
|
126
|
+
## Get help
|
|
127
|
+
|
|
128
|
+
- `poke <command> --help` lists every flag of a command.
|
|
129
|
+
- The skill that `poke install-skill` writes, `~/.claude/skills/poke/SKILL.md`, is the full guide that agents read.
|
|
130
|
+
|
|
131
|
+
## Contributing
|
|
132
|
+
|
|
133
|
+
To run poke from a checkout, test it, or deploy a Relay, read [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
MIT
|