opencode-plugin-teleprompt 0.2.0 → 0.2.1

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 CHANGED
@@ -4,11 +4,12 @@ TUI-scoped OpenCode plugin that binds a Telegram channel to one active OpenCode
4
4
 
5
5
  ## What It Does
6
6
 
7
- - Polls a strict Telegram channel for `/tp` commands
8
- - Injects `/tp <prompt>` into the currently bound OpenCode session
9
- - Sends summary-only response messages back to the same channel
10
- - Relays OpenCode permission prompts and accepts Telegram `approve`, `approve-always`, `deny`
11
- - Keeps single-owner bridge semantics across multiple OpenCode consoles
7
+ - **Frictionless Chat Interface**: Type direct prompts (like `write a python function`) in your Telegram channel without any prefixes!
8
+ - **Direct Slash Commands**: Run administrative commands like `/status`, `/queue`, `/dc` or `/approve <id>` directly in the Telegram channel.
9
+ - **Backward Compatibility**: Fully supports old `/tp <prompt>` and `/tp:<command>` syntax out of the box.
10
+ - **Relays Permission Prompts**: Directly relays OpenCode permission requests and accepts direct `/approve`, `/approve-always`, and `/deny` replies.
11
+ - **Lease-based Owner Semantics**: Keeps single-owner bridge semantics across multiple OpenCode consoles.
12
+ - **Instant Ctrl+C Exit**: Stops event streams and cleans up instantly, ensuring no exit lags when shutting down OpenCode.
12
13
 
13
14
  ## V1 Limits
14
15
 
@@ -67,33 +68,33 @@ OpenCode installs npm plugins automatically at startup.
67
68
  5. While teleprompt is active, local prompt input is locked for that session.
68
69
  6. Disconnect options:
69
70
  - Press `Esc` twice in a row in OpenCode
70
- - Send `/tp:dc` in Telegram channel
71
+ - Send `/dc` in Telegram channel
71
72
  - Run `/tp:stop` in OpenCode
72
73
  7. Use Telegram channel commands:
73
- - `/tp <prompt>`
74
- - `/tp:interrupt`
75
- - `/tp:queue`
76
- - `/tp:cancel <job_id|last>`
77
- - `/tp:retry`
78
- - `/tp:context`
79
- - `/tp:compact`
80
- - `/tp:newsession`
81
- - `/tp:reset-context`
82
- - `/tp:who`
83
- - `/tp:health`
84
- - `/tp:reclaim`
85
- - `/tp:history`
86
- - `/tp:last-error`
87
- - `/tp:model`
88
- - `/tp:model fast`
89
- - `/tp:model smart`
90
- - `/tp:model max`
91
- - `/tp:model <provider>/<model>`
92
- - `/tp approve <request_id>`
93
- - `/tp approve-always <request_id>`
94
- - `/tp deny <request_id>`
95
- - `/tp status`
96
- - `/tp:dc`
74
+ - `<prompt>` (any message NOT starting with `/` is treated directly as a prompt!)
75
+ - `/interrupt` (or `/tp:interrupt`)
76
+ - `/queue` (or `/tp:queue`)
77
+ - `/cancel <job_id|last>` (or `/tp:cancel <job_id|last>`)
78
+ - `/retry` (or `/tp:retry`)
79
+ - `/context` (or `/tp:context`)
80
+ - `/compact` (or `/tp:compact`)
81
+ - `/newsession` (or `/tp:newsession`)
82
+ - `/reset-context` (or `/tp:reset-context`)
83
+ - `/who` (or `/tp:who`)
84
+ - `/health` (or `/tp:health`)
85
+ - `/reclaim` (or `/tp:reclaim`)
86
+ - `/history` (or `/tp:history`)
87
+ - `/last-error` (or `/tp:last-error`)
88
+ - `/model` (or `/tp:model`)
89
+ - `/model fast` (or `/tp:model fast`)
90
+ - `/model smart` (or `/tp:model smart`)
91
+ - `/model max` (or `/tp:model max`)
92
+ - `/model <provider>/<model>`
93
+ - `/approve <request_id>`
94
+ - `/approve-always <request_id>`
95
+ - `/deny <request_id>`
96
+ - `/status`
97
+ - `/dc` (or `/tp:dc`)
97
98
 
98
99
  During remote runs, teleprompt posts lifecycle updates (`accepted`, `queued`, `running`, `waiting-permission`, `completed`, `failed`) and result summaries are sent as replies to the originating Telegram message for clear correlation.
99
100
 
@@ -119,23 +120,23 @@ During remote runs, teleprompt posts lifecycle updates (`accepted`, `queued`, `r
119
120
  - `OPENCODE_TELEGRAM_CHANNEL_ID`
120
121
  3. Start OpenCode and ensure plugin loads without startup errors.
121
122
  4. Open one session, run `/tp:start`, verify bridge binds.
122
- 5. Send `/tp status` from Telegram and confirm status response.
123
- 6. Send `/tp test ping` and confirm lifecycle + summary reply.
124
- 7. Send `/tp:dc` and confirm local input is unlocked in OpenCode.
123
+ 5. Send `/status` from Telegram and confirm status response.
124
+ 6. Send `test ping` and confirm lifecycle + summary reply.
125
+ 7. Send `/dc` and confirm local input is unlocked in OpenCode.
125
126
 
126
127
  ## Telegram Live E2E Quick Checklist
127
128
 
128
129
  1. Start OpenCode session and run `/tp:start`.
129
- 2. From Telegram channel, run `/tp status` and verify owner/session info.
130
- 3. Run `/tp:model` and switch once with `/tp:model fast` (or explicit provider/model).
131
- 4. Send `/tp write a 1-line summary of this session` and verify:
130
+ 2. From Telegram channel, run `/status` and verify owner/session info.
131
+ 3. Run `/model` and switch once with `/model fast` (or explicit provider/model).
132
+ 4. Send `write a 1-line summary of this session` and verify:
132
133
  - `accepted` -> `running` -> `completed`
133
134
  - summary arrives as reply to the same Telegram message
134
135
  5. Trigger a permissioned action prompt and verify:
135
136
  - plugin posts permission request with `request_id`
136
- - `/tp approve <request_id>` (or `/tp deny <request_id>`) is applied immediately
137
- 6. Send `/tp:interrupt` during a long run and confirm graceful stop.
138
- 7. Send `/tp:dc` and confirm disconnect/unlock behavior.
137
+ - `/approve <request_id>` (or `/deny <request_id>`) is applied immediately
138
+ 6. Send `/interrupt` during a long run and confirm graceful stop.
139
+ 7. Send `/dc` and confirm disconnect/unlock behavior.
139
140
 
140
141
  ## Command Reference
141
142
 
@@ -149,32 +150,32 @@ During remote runs, teleprompt posts lifecycle updates (`accepted`, `queued`, `r
149
150
 
150
151
  ### Telegram Commands
151
152
 
152
- - `/tp <prompt>`: Queue a new prompt for the currently bound session.
153
- - `/tp:interrupt`: Abort the currently running remote prompt without disconnecting the bridge.
154
- - `/tp:queue`: Show active prompt and queued prompts.
155
- - `/tp:cancel <job_id|last>`: Remove a queued prompt by job ID, or remove the newest queued prompt with `last`.
156
- - `/tp:retry`: Re-queue the most recent prompt from prompt history.
157
- - `/tp:context`: Show compact session context (recent prompts, summaries, and changed files).
158
- - `/tp:compact`: Trigger session summarization/compaction for long-running sessions.
159
- - `/tp:newsession`: Create a new OpenCode session and switch teleprompt binding to it.
160
- - `/tp:reset-context`: Alias behavior for creating/switching to a fresh session context.
161
- - `/tp:who`: Show lease ownership details (current instance, lease owner, ownership state).
162
- - `/tp:health`: Show bridge health (lease age/staleness, poller/event stream status, queue stats).
163
- - `/tp:reclaim`: Try to reclaim bridge ownership for the current instance.
164
- - `/tp:history`: Show recent run history with status and short summaries.
165
- - `/tp:last-error`: Show the latest failed or interrupted run summary.
166
- - `/tp:model`: List available models by provider and show current model selection.
167
- - `/tp:model fast`: Select a model using the `fast` preset resolver.
168
- - `/tp:model smart`: Select a model using the `smart` preset resolver.
169
- - `/tp:model max`: Select a model using the `max` preset resolver.
170
- - `/tp:model <provider>/<model>`: Select an explicit provider/model for the bound session.
171
- - `/tp approve <request_id>`: Approve a pending permission request once.
172
- - `/tp approve-always <request_id>`: Approve a pending permission request and persist approval behavior when supported.
173
- - `/tp deny <request_id>`: Reject a pending permission request.
174
- - `/tp status`: Show bridge status from Telegram.
175
- - `/tp:dc`: Disconnect teleprompt from Telegram and unbind the current session.
153
+ - `<prompt>`: Any message not starting with `/` is queued directly as a prompt for the session.
154
+ - `/interrupt`: Abort the currently running remote prompt without disconnecting the bridge.
155
+ - `/queue`: Show active prompt and queued prompts.
156
+ - `/cancel <job_id|last>`: Remove a queued prompt by job ID, or remove the newest queued prompt with `last`.
157
+ - `/retry`: Re-queue the most recent prompt from prompt history.
158
+ - `/context`: Show compact session context (recent prompts, summaries, and changed files).
159
+ - `/compact`: Trigger session summarization/compaction for long-running sessions.
160
+ - `/newsession`: Create a new OpenCode session and switch teleprompt binding to it.
161
+ - `/reset-context`: Alias behavior for creating/switching to a fresh session context.
162
+ - `/who`: Show lease ownership details (current instance, lease owner, ownership state).
163
+ - `/health`: Show bridge health (lease age/staleness, poller/event stream status, queue stats).
164
+ - `/reclaim`: Try to reclaim bridge ownership for the current instance.
165
+ - `/history`: Show recent run history with status and short summaries.
166
+ - `/last-error`: Show the latest failed or interrupted run summary.
167
+ - `/model`: List available models by provider and show current model selection.
168
+ - `/model fast`: Select a model using the `fast` preset resolver.
169
+ - `/model smart`: Select a model using the `smart` preset resolver.
170
+ - `/model max`: Select a model using the `max` preset resolver.
171
+ - `/model <provider>/<model>`: Select an explicit provider/model for the bound session.
172
+ - `/approve <request_id>`: Approve a pending permission request once.
173
+ - `/approve-always <request_id>`: Approve a pending permission request and persist approval behavior when supported.
174
+ - `/deny <request_id>`: Reject a pending permission request.
175
+ - `/status`: Show bridge status from Telegram.
176
+ - `/dc`: Disconnect teleprompt from Telegram and unbind the current session.
176
177
 
177
178
  ## Shutdown Behavior
178
179
 
179
- - On normal TUI disposal (`Ctrl+C`, clean exit), poller and heartbeat stop and lease is released.
180
+ - On normal TUI disposal (`Ctrl+C`, clean exit), poller and heartbeat stop and lease is released **instantly** without hangs.
180
181
  - On unclean termination, lease expires by TTL and next owner instance can reclaim.
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PLUGIN_VERSION = "0.2.0";
1
+ export declare const PLUGIN_VERSION = "0.2.1";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const PLUGIN_VERSION = "0.2.0";
1
+ export const PLUGIN_VERSION = "0.2.1";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-plugin-teleprompt",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "OpenCode TUI plugin — control your AI coding session remotely via Telegram. Queue prompts, approve permissions, and get results as Telegram messages.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",