opencode-plugin-teleprompt 0.2.1 → 0.2.2
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 +28 -8
- package/dist/opencode/events.d.ts +43 -1
- package/dist/opencode/events.js +374 -7
- package/dist/opencode/events.js.map +1 -1
- package/dist/opencode/permissions.d.ts +8 -2
- package/dist/opencode/permissions.js +95 -8
- package/dist/opencode/permissions.js.map +1 -1
- package/dist/runtime/controller.d.ts +38 -3
- package/dist/runtime/controller.js +517 -24
- package/dist/runtime/controller.js.map +1 -1
- package/dist/state/store.js +52 -0
- package/dist/state/store.js.map +1 -1
- package/dist/summary/format.js +1 -1
- package/dist/summary/format.js.map +1 -1
- package/dist/telegram/api.d.ts +32 -3
- package/dist/telegram/api.js +49 -6
- package/dist/telegram/api.js.map +1 -1
- package/dist/telegram/callback.d.ts +47 -0
- package/dist/telegram/callback.js +195 -0
- package/dist/telegram/callback.js.map +1 -0
- package/dist/telegram/parser.d.ts +3 -2
- package/dist/telegram/parser.js +129 -0
- package/dist/telegram/parser.js.map +1 -1
- package/dist/telegram/poller.d.ts +4 -2
- package/dist/telegram/poller.js +23 -6
- package/dist/telegram/poller.js.map +1 -1
- package/dist/types.d.ts +84 -1
- package/package.json +3 -1
package/dist/types.d.ts
CHANGED
|
@@ -40,6 +40,31 @@ export type PendingPermission = {
|
|
|
40
40
|
metadata: Record<string, unknown>;
|
|
41
41
|
announcedAt: number;
|
|
42
42
|
};
|
|
43
|
+
export type QuestionOption = {
|
|
44
|
+
label: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
export type QuestionInfo = {
|
|
48
|
+
question: string;
|
|
49
|
+
header: string;
|
|
50
|
+
options: QuestionOption[];
|
|
51
|
+
multiple?: boolean;
|
|
52
|
+
custom?: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type PendingQuestion = {
|
|
55
|
+
requestID: string;
|
|
56
|
+
sessionID: string;
|
|
57
|
+
questions: QuestionInfo[];
|
|
58
|
+
tool?: {
|
|
59
|
+
messageID: string;
|
|
60
|
+
callID: string;
|
|
61
|
+
};
|
|
62
|
+
announcedAt: number;
|
|
63
|
+
};
|
|
64
|
+
export type PendingQuestionAnswer = {
|
|
65
|
+
questionIndex: number;
|
|
66
|
+
labels: string[];
|
|
67
|
+
};
|
|
43
68
|
export type PromptHistoryItem = {
|
|
44
69
|
jobID: string;
|
|
45
70
|
prompt: string;
|
|
@@ -56,6 +81,8 @@ export type BridgeStoreData = {
|
|
|
56
81
|
promptQueue: PromptJob[];
|
|
57
82
|
activePrompt?: PromptJob;
|
|
58
83
|
pendingPermissions: Record<string, PendingPermission>;
|
|
84
|
+
pendingQuestions: Record<string, PendingQuestion>;
|
|
85
|
+
questionAnswers: Record<string, PendingQuestionAnswer[]>;
|
|
59
86
|
promptHistory: PromptHistoryItem[];
|
|
60
87
|
recentPrompts: Array<{
|
|
61
88
|
jobID: string;
|
|
@@ -68,6 +95,7 @@ export type TelegramUpdate = {
|
|
|
68
95
|
update_id: number;
|
|
69
96
|
message?: TelegramChannelPost;
|
|
70
97
|
channel_post?: TelegramChannelPost;
|
|
98
|
+
callback_query?: TelegramCallbackQuery;
|
|
71
99
|
};
|
|
72
100
|
export type TelegramChannelPost = {
|
|
73
101
|
message_id: number;
|
|
@@ -79,6 +107,32 @@ export type TelegramChannelPost = {
|
|
|
79
107
|
};
|
|
80
108
|
text?: string;
|
|
81
109
|
};
|
|
110
|
+
export type TelegramCallbackQuery = {
|
|
111
|
+
id: string;
|
|
112
|
+
from: {
|
|
113
|
+
id: number;
|
|
114
|
+
is_bot?: boolean;
|
|
115
|
+
first_name?: string;
|
|
116
|
+
};
|
|
117
|
+
message?: {
|
|
118
|
+
message_id: number;
|
|
119
|
+
date: number;
|
|
120
|
+
chat: {
|
|
121
|
+
id: number | string;
|
|
122
|
+
type: string;
|
|
123
|
+
};
|
|
124
|
+
text?: string;
|
|
125
|
+
};
|
|
126
|
+
chat_instance?: string;
|
|
127
|
+
data?: string;
|
|
128
|
+
};
|
|
129
|
+
export type TelegramInlineKeyboardButton = {
|
|
130
|
+
text: string;
|
|
131
|
+
callback_data: string;
|
|
132
|
+
};
|
|
133
|
+
export type TelegramInlineKeyboardMarkup = {
|
|
134
|
+
inline_keyboard: TelegramInlineKeyboardButton[][];
|
|
135
|
+
};
|
|
82
136
|
export type TelegramCommandPrompt = {
|
|
83
137
|
kind: "prompt";
|
|
84
138
|
prompt: string;
|
|
@@ -88,6 +142,14 @@ export type TelegramCommandPermission = {
|
|
|
88
142
|
action: "once" | "always" | "reject";
|
|
89
143
|
requestID: string;
|
|
90
144
|
};
|
|
145
|
+
export type TelegramCommandQuestionReply = {
|
|
146
|
+
kind: "question";
|
|
147
|
+
action: "reply" | "reject" | "toggle" | "confirm";
|
|
148
|
+
requestID: string;
|
|
149
|
+
answers?: PendingQuestionAnswer[];
|
|
150
|
+
questionIndex?: number;
|
|
151
|
+
optionIndex?: number;
|
|
152
|
+
};
|
|
91
153
|
export type TelegramCommandStatus = {
|
|
92
154
|
kind: "status";
|
|
93
155
|
};
|
|
@@ -145,13 +207,25 @@ export type TelegramCommandModel = {
|
|
|
145
207
|
};
|
|
146
208
|
preset?: "fast" | "smart" | "max";
|
|
147
209
|
};
|
|
148
|
-
export type
|
|
210
|
+
export type TelegramCommandDiag = {
|
|
211
|
+
kind: "diag";
|
|
212
|
+
};
|
|
213
|
+
export type TelegramCommand = TelegramCommandPrompt | TelegramCommandPermission | TelegramCommandQuestionReply | TelegramCommandStatus | TelegramCommandDiag | TelegramCommandDisconnect | TelegramCommandInterrupt | TelegramCommandQueue | TelegramCommandCancel | TelegramCommandRetry | TelegramCommandContext | TelegramCommandCompact | TelegramCommandNewSession | TelegramCommandResetContext | TelegramCommandWho | TelegramCommandHealth | TelegramCommandReclaim | TelegramCommandHistory | TelegramCommandLastError | TelegramCommandVersion | TelegramCommandModel;
|
|
149
214
|
export type ParsedTelegramCommand = {
|
|
150
215
|
updateID: number;
|
|
151
216
|
messageID: number;
|
|
152
217
|
channelID: string;
|
|
153
218
|
rawText: string;
|
|
154
219
|
command: TelegramCommand;
|
|
220
|
+
callbackQueryID?: string;
|
|
221
|
+
};
|
|
222
|
+
export type ParsedCallbackQuery = {
|
|
223
|
+
updateID: number;
|
|
224
|
+
callbackQueryID: string;
|
|
225
|
+
channelID: string;
|
|
226
|
+
messageID: number;
|
|
227
|
+
rawData: string;
|
|
228
|
+
command: TelegramCommand;
|
|
155
229
|
};
|
|
156
230
|
export type SummaryPayload = {
|
|
157
231
|
text: string;
|
|
@@ -169,3 +243,12 @@ export type PermissionAskInput = {
|
|
|
169
243
|
patterns: string[];
|
|
170
244
|
metadata: Record<string, unknown>;
|
|
171
245
|
};
|
|
246
|
+
export type QuestionAskInput = {
|
|
247
|
+
id: string;
|
|
248
|
+
sessionID: string;
|
|
249
|
+
questions: QuestionInfo[];
|
|
250
|
+
tool?: {
|
|
251
|
+
messageID: string;
|
|
252
|
+
callID: string;
|
|
253
|
+
};
|
|
254
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-plugin-teleprompt",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
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",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsc -p tsconfig.json",
|
|
46
46
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
47
|
+
"test": "node --import tsx --test tests/**/*.test.ts",
|
|
47
48
|
"verify:release": "npm run typecheck && npm run build && npm pack --dry-run",
|
|
48
49
|
"prepublishOnly": "npm run verify:release"
|
|
49
50
|
},
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"@types/node": "^22.15.0",
|
|
56
57
|
"opencode-plugin-teleprompt": "file:",
|
|
58
|
+
"tsx": "^4.22.4",
|
|
57
59
|
"typescript": "^5.8.3"
|
|
58
60
|
}
|
|
59
61
|
}
|