paperclip-plugin-telegram 0.5.0 → 0.6.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/dist/acp-bridge.d.ts +1 -1
- package/dist/acp-bridge.js +5 -5
- package/dist/acp-bridge.js.map +1 -1
- package/dist/commands.d.ts +1 -1
- package/dist/commands.js +2 -2
- package/dist/commands.js.map +1 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/manifest.js +1 -242
- package/dist/manifest.js.map +1 -1
- package/dist/ui/index.js +993 -5
- package/dist/ui/index.js.map +1 -1
- package/dist/worker.js +1 -1
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
package/dist/manifest.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PLUGIN_ID, PLUGIN_VERSION } from "./constants.js";
|
|
2
2
|
const manifest = {
|
|
3
3
|
id: PLUGIN_ID,
|
|
4
4
|
apiVersion: 1,
|
|
@@ -48,247 +48,6 @@ const manifest = {
|
|
|
48
48
|
},
|
|
49
49
|
],
|
|
50
50
|
},
|
|
51
|
-
instanceConfigSchema: {
|
|
52
|
-
type: "object",
|
|
53
|
-
properties: {
|
|
54
|
-
// --- Connection ---
|
|
55
|
-
telegramBotTokenRef: {
|
|
56
|
-
type: "string",
|
|
57
|
-
format: "secret-ref",
|
|
58
|
-
title: "Telegram Bot Token (secret reference)",
|
|
59
|
-
description: "Secret UUID for your Telegram Bot token. Create the secret in Settings > Secrets, then paste its UUID here. Get a token from @BotFather.",
|
|
60
|
-
default: DEFAULT_CONFIG.telegramBotTokenRef,
|
|
61
|
-
},
|
|
62
|
-
paperclipBaseUrl: {
|
|
63
|
-
type: "string",
|
|
64
|
-
title: "Paperclip API URL (internal)",
|
|
65
|
-
description: "Internal URL of the Paperclip API server. Used for API calls (approvals, comments). Keep as localhost for same-server deployments.",
|
|
66
|
-
default: DEFAULT_CONFIG.paperclipBaseUrl,
|
|
67
|
-
},
|
|
68
|
-
paperclipBoardApiTokenRef: {
|
|
69
|
-
type: "string",
|
|
70
|
-
format: "secret-ref",
|
|
71
|
-
title: "Paperclip Board API Token (secret reference)",
|
|
72
|
-
description: "Secret UUID for a Paperclip board API token. Used by Telegram approval buttons and /approve commands to resolve approvals as a board actor.",
|
|
73
|
-
default: DEFAULT_CONFIG.paperclipBoardApiTokenRef,
|
|
74
|
-
},
|
|
75
|
-
paperclipPublicUrl: {
|
|
76
|
-
type: "string",
|
|
77
|
-
title: "Paperclip Public URL",
|
|
78
|
-
description: "Public URL for issue links in Telegram messages (e.g. https://pc.example.com). Falls back to API URL if empty.",
|
|
79
|
-
default: DEFAULT_CONFIG.paperclipPublicUrl,
|
|
80
|
-
},
|
|
81
|
-
// --- Chat routing ---
|
|
82
|
-
defaultChatId: {
|
|
83
|
-
type: "string",
|
|
84
|
-
title: "Default Chat ID (fallback)",
|
|
85
|
-
description: "Fallback Telegram chat ID for notifications when no per-company chat is configured. Use /connect in a chat to set per-company routing.",
|
|
86
|
-
default: DEFAULT_CONFIG.defaultChatId,
|
|
87
|
-
},
|
|
88
|
-
approvalsChatId: {
|
|
89
|
-
type: "string",
|
|
90
|
-
title: "Approvals Chat ID",
|
|
91
|
-
description: "Chat ID for approval requests. Falls back to default chat.",
|
|
92
|
-
default: DEFAULT_CONFIG.approvalsChatId,
|
|
93
|
-
},
|
|
94
|
-
approvalsTopicId: {
|
|
95
|
-
type: "string",
|
|
96
|
-
title: "Approvals topic ID",
|
|
97
|
-
description: "Optional Telegram forum topic/thread ID for approval notifications inside the selected approvals/default chat.",
|
|
98
|
-
default: DEFAULT_CONFIG.approvalsTopicId,
|
|
99
|
-
},
|
|
100
|
-
errorsChatId: {
|
|
101
|
-
type: "string",
|
|
102
|
-
title: "Errors Chat ID",
|
|
103
|
-
description: "Chat ID for agent error notifications. Falls back to default chat.",
|
|
104
|
-
default: DEFAULT_CONFIG.errorsChatId,
|
|
105
|
-
},
|
|
106
|
-
errorsTopicId: {
|
|
107
|
-
type: "string",
|
|
108
|
-
title: "Errors topic ID",
|
|
109
|
-
description: "Optional Telegram forum topic/thread ID for agent error notifications inside the selected errors/default chat.",
|
|
110
|
-
default: DEFAULT_CONFIG.errorsTopicId,
|
|
111
|
-
},
|
|
112
|
-
digestChatId: {
|
|
113
|
-
type: "string",
|
|
114
|
-
title: "Digest Chat ID",
|
|
115
|
-
description: "Chat ID for digest notifications. Falls back to the company/default chat.",
|
|
116
|
-
default: DEFAULT_CONFIG.digestChatId,
|
|
117
|
-
},
|
|
118
|
-
digestTopicId: {
|
|
119
|
-
type: "string",
|
|
120
|
-
title: "Digest topic ID",
|
|
121
|
-
description: "Optional Telegram forum topic/thread ID for digest notifications inside the selected digest/company/default chat.",
|
|
122
|
-
default: DEFAULT_CONFIG.digestTopicId,
|
|
123
|
-
},
|
|
124
|
-
escalationChatId: {
|
|
125
|
-
type: "string",
|
|
126
|
-
title: "Escalation Chat ID",
|
|
127
|
-
description: "Telegram chat ID where escalations are sent for human review. If empty, escalations are logged but not forwarded.",
|
|
128
|
-
default: DEFAULT_CONFIG.escalationChatId,
|
|
129
|
-
},
|
|
130
|
-
topicRouting: {
|
|
131
|
-
type: "boolean",
|
|
132
|
-
title: "Forum topic routing",
|
|
133
|
-
description: "Map Telegram forum topics to Paperclip projects. Requires the bot to be in a group with forum topics enabled.",
|
|
134
|
-
default: DEFAULT_CONFIG.topicRouting,
|
|
135
|
-
},
|
|
136
|
-
// --- Notifications ---
|
|
137
|
-
notifyOnIssueCreated: {
|
|
138
|
-
type: "boolean",
|
|
139
|
-
title: "Notify on issue created",
|
|
140
|
-
default: DEFAULT_CONFIG.notifyOnIssueCreated,
|
|
141
|
-
},
|
|
142
|
-
notifyOnIssueDone: {
|
|
143
|
-
type: "boolean",
|
|
144
|
-
title: "Notify on issue completed",
|
|
145
|
-
default: DEFAULT_CONFIG.notifyOnIssueDone,
|
|
146
|
-
},
|
|
147
|
-
notifyOnIssueAssigned: {
|
|
148
|
-
type: "boolean",
|
|
149
|
-
title: "Notify on issue assignment changes",
|
|
150
|
-
description: "Send a message when an existing issue's assigneeUserId or assigneeAgentId changes. Complements notifyOnIssueCreated (which covers initial assignment on creation).",
|
|
151
|
-
default: DEFAULT_CONFIG.notifyOnIssueAssigned,
|
|
152
|
-
},
|
|
153
|
-
onlyNotifyIfAssignedTo: {
|
|
154
|
-
type: "string",
|
|
155
|
-
title: "Only notify when assigned to this user (user ID)",
|
|
156
|
-
description: "Optional. Paste your Paperclip user ID here to restrict assignment notifications to items newly assigned to you. Leave empty to notify on every assignment change. To find your user ID: sign in to Paperclip in a browser and visit /api/cli-auth/me — copy the `userId` field (a string like `mrvhBEpPds85TGeEjlAHviP0VdOHgymm`).",
|
|
157
|
-
default: DEFAULT_CONFIG.onlyNotifyIfAssignedTo,
|
|
158
|
-
},
|
|
159
|
-
notifyOnApprovalCreated: {
|
|
160
|
-
type: "boolean",
|
|
161
|
-
title: "Notify on approval requested",
|
|
162
|
-
default: DEFAULT_CONFIG.notifyOnApprovalCreated,
|
|
163
|
-
},
|
|
164
|
-
onlyNotifyBoardApprovals: {
|
|
165
|
-
type: "boolean",
|
|
166
|
-
title: "Only notify board approval requests",
|
|
167
|
-
description: "When enabled, Telegram approval notifications are sent only for request_board_approval approvals. Leave disabled to notify for every approval request.",
|
|
168
|
-
default: DEFAULT_CONFIG.onlyNotifyBoardApprovals,
|
|
169
|
-
},
|
|
170
|
-
notifyOnAgentError: {
|
|
171
|
-
type: "boolean",
|
|
172
|
-
title: "Notify on agent error",
|
|
173
|
-
default: DEFAULT_CONFIG.notifyOnAgentError,
|
|
174
|
-
},
|
|
175
|
-
// --- Digest ---
|
|
176
|
-
digestMode: {
|
|
177
|
-
type: "string",
|
|
178
|
-
title: "Digest mode",
|
|
179
|
-
description: "off = disabled, daily = once per day, bidaily = twice per day, tridaily = three times per day.",
|
|
180
|
-
enum: ["off", "daily", "bidaily", "tridaily"],
|
|
181
|
-
default: DEFAULT_CONFIG.digestMode,
|
|
182
|
-
},
|
|
183
|
-
dailyDigestTime: {
|
|
184
|
-
type: "string",
|
|
185
|
-
title: "Digest time (HH:MM UTC)",
|
|
186
|
-
description: "Time to send the digest. Used for daily mode and first slot of bidaily mode.",
|
|
187
|
-
default: DEFAULT_CONFIG.dailyDigestTime,
|
|
188
|
-
},
|
|
189
|
-
bidailySecondTime: {
|
|
190
|
-
type: "string",
|
|
191
|
-
title: "Bidaily second time (HH:MM UTC)",
|
|
192
|
-
description: "Second digest time for bidaily mode.",
|
|
193
|
-
default: DEFAULT_CONFIG.bidailySecondTime,
|
|
194
|
-
},
|
|
195
|
-
tridailyTimes: {
|
|
196
|
-
type: "string",
|
|
197
|
-
title: "Tridaily times (HH:MM,HH:MM,HH:MM UTC)",
|
|
198
|
-
description: "Three comma-separated times for tridaily mode.",
|
|
199
|
-
default: DEFAULT_CONFIG.tridailyTimes,
|
|
200
|
-
},
|
|
201
|
-
// --- Bot interaction ---
|
|
202
|
-
enableCommands: {
|
|
203
|
-
type: "boolean",
|
|
204
|
-
title: "Enable bot commands",
|
|
205
|
-
description: "Allow users to interact with Paperclip via Telegram bot commands (/status, /issues, /agents). If this is enabled, consider configuring the Telegram user/chat allowlists below.",
|
|
206
|
-
default: DEFAULT_CONFIG.enableCommands,
|
|
207
|
-
},
|
|
208
|
-
enableInbound: {
|
|
209
|
-
type: "boolean",
|
|
210
|
-
title: "Enable inbound message routing",
|
|
211
|
-
description: "Route Telegram messages to Paperclip issue comments. Messages sent in reply to a notification get attached to that issue. If this is enabled, consider configuring the Telegram user/chat allowlists below.",
|
|
212
|
-
default: DEFAULT_CONFIG.enableInbound,
|
|
213
|
-
},
|
|
214
|
-
allowedTelegramUserIds: {
|
|
215
|
-
type: "array",
|
|
216
|
-
items: { type: "string" },
|
|
217
|
-
title: "Allowed Telegram user IDs",
|
|
218
|
-
description: "Optional allowlist of Telegram user IDs allowed to interact with the bot. Leave empty to allow any user. Applies to bot commands, inbound replies, media intake, and inline button callbacks. If both user and chat allowlists are set, both must match. Save the config and restart the plugin if changes are not picked up immediately.",
|
|
219
|
-
default: DEFAULT_CONFIG.allowedTelegramUserIds,
|
|
220
|
-
},
|
|
221
|
-
allowedTelegramChatIds: {
|
|
222
|
-
type: "array",
|
|
223
|
-
items: { type: "string" },
|
|
224
|
-
title: "Allowed Telegram chat IDs",
|
|
225
|
-
description: "Optional allowlist of Telegram chat IDs where inbound bot interactions are accepted. Leave empty to allow any chat. Use private DM IDs and/or private group IDs to restrict where commands, replies, media intake, and callbacks are accepted. If both user and chat allowlists are set, both must match. Save the config and restart the plugin if changes are not picked up immediately.",
|
|
226
|
-
default: DEFAULT_CONFIG.allowedTelegramChatIds,
|
|
227
|
-
},
|
|
228
|
-
// --- Escalation ---
|
|
229
|
-
escalationTimeoutMs: {
|
|
230
|
-
type: "number",
|
|
231
|
-
title: "Escalation Timeout (ms)",
|
|
232
|
-
description: "How long to wait for a human response before taking the default action. Default: 900000 (15 minutes).",
|
|
233
|
-
default: DEFAULT_CONFIG.escalationTimeoutMs,
|
|
234
|
-
},
|
|
235
|
-
escalationDefaultAction: {
|
|
236
|
-
type: "string",
|
|
237
|
-
title: "Escalation Default Action",
|
|
238
|
-
description: "What to do when an escalation times out: defer (do nothing), auto_reply (send suggested reply), or close.",
|
|
239
|
-
enum: ["defer", "auto_reply", "close"],
|
|
240
|
-
default: DEFAULT_CONFIG.escalationDefaultAction,
|
|
241
|
-
},
|
|
242
|
-
escalationHoldMessage: {
|
|
243
|
-
type: "string",
|
|
244
|
-
title: "Escalation Hold Message",
|
|
245
|
-
description: "Message sent to the user when their conversation is escalated to a human.",
|
|
246
|
-
default: DEFAULT_CONFIG.escalationHoldMessage,
|
|
247
|
-
},
|
|
248
|
-
// --- Agent sessions ---
|
|
249
|
-
maxAgentsPerThread: {
|
|
250
|
-
type: "number",
|
|
251
|
-
title: "Max Agents Per Thread",
|
|
252
|
-
description: "Maximum number of concurrent agent sessions allowed in a single thread.",
|
|
253
|
-
default: MAX_AGENTS_PER_THREAD,
|
|
254
|
-
},
|
|
255
|
-
// --- Media pipeline ---
|
|
256
|
-
briefAgentId: {
|
|
257
|
-
type: "string",
|
|
258
|
-
title: "Brief Agent ID",
|
|
259
|
-
description: "Agent ID for processing media intake briefs. Leave empty to disable media pipeline.",
|
|
260
|
-
default: DEFAULT_CONFIG.briefAgentId,
|
|
261
|
-
},
|
|
262
|
-
briefAgentChatIds: {
|
|
263
|
-
type: "array",
|
|
264
|
-
items: { type: "string" },
|
|
265
|
-
title: "Brief Agent Intake Chat IDs",
|
|
266
|
-
description: "Telegram chat IDs where media is routed to the Brief Agent. Media in other chats goes to active agent sessions.",
|
|
267
|
-
default: DEFAULT_CONFIG.briefAgentChatIds,
|
|
268
|
-
},
|
|
269
|
-
transcriptionApiKeyRef: {
|
|
270
|
-
type: "string",
|
|
271
|
-
format: "secret-ref",
|
|
272
|
-
title: "Transcription API Key (secret reference)",
|
|
273
|
-
description: "Secret UUID for your OpenAI API key used for Whisper transcription. Create the secret in Settings > Secrets, then paste its UUID here.",
|
|
274
|
-
default: DEFAULT_CONFIG.transcriptionApiKeyRef,
|
|
275
|
-
},
|
|
276
|
-
// --- Proactive watches ---
|
|
277
|
-
maxSuggestionsPerHourPerCompany: {
|
|
278
|
-
type: "number",
|
|
279
|
-
title: "Max Suggestions per Hour per Company",
|
|
280
|
-
description: "Rate limit for proactive watch suggestions.",
|
|
281
|
-
default: DEFAULT_CONFIG.maxSuggestionsPerHourPerCompany,
|
|
282
|
-
},
|
|
283
|
-
watchDeduplicationWindowMs: {
|
|
284
|
-
type: "number",
|
|
285
|
-
title: "Watch Deduplication Window (ms)",
|
|
286
|
-
description: "Suppress duplicate watch suggestions for the same entity within this window. Default: 86400000 (24 hours).",
|
|
287
|
-
default: DEFAULT_CONFIG.watchDeduplicationWindowMs,
|
|
288
|
-
},
|
|
289
|
-
},
|
|
290
|
-
required: ["telegramBotTokenRef"],
|
|
291
|
-
},
|
|
292
51
|
jobs: [
|
|
293
52
|
{
|
|
294
53
|
jobKey: "telegram-daily-digest",
|
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,QAAQ,GAA8B;IAC1C,EAAE,EAAE,SAAS;IACb,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,cAAc;IAC3B,WAAW,EACT,iOAAiO;IACnO,MAAM,EAAE,UAAU;IAClB,UAAU,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;IACvC,YAAY,EAAE;QACZ,gBAAgB;QAChB,eAAe;QACf,aAAa;QACb,eAAe;QACf,eAAe;QACf,qBAAqB;QACrB,uBAAuB;QACvB,aAAa;QACb,eAAe;QACf,uBAAuB;QACvB,qBAAqB;QACrB,qBAAqB;QACrB,sBAAsB;QACtB,sBAAsB;QACtB,kBAAkB;QAClB,aAAa;QACb,mBAAmB;QACnB,oBAAoB;QACpB,eAAe;QACf,kBAAkB;QAClB,oBAAoB;QACpB,eAAe;QACf,eAAe;QACf,4BAA4B;QAC5B,kBAAkB;KACnB;IACD,WAAW,EAAE;QACX,MAAM,EAAE,kBAAkB;QAC1B,EAAE,EAAE,WAAW;KAChB;IACD,EAAE,EAAE;QACF,KAAK,EAAE;YACL;gBACE,IAAI,EAAE,cAAc;gBACpB,EAAE,EAAE,mBAAmB;gBACvB,WAAW,EAAE,mBAAmB;gBAChC,UAAU,EAAE,sBAAsB;aACnC;SACF;KACF;IACD,IAAI,EAAE;QACJ;YACE,MAAM,EAAE,uBAAuB;YAC/B,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EAAE,kEAAkE;YAC/E,QAAQ,EAAE,WAAW;SACtB;QACD;YACE,MAAM,EAAE,2BAA2B;YACnC,WAAW,EAAE,2BAA2B;YACxC,WAAW,EAAE,4DAA4D;YACzE,QAAQ,EAAE,WAAW;SACtB;QACD;YACE,MAAM,EAAE,eAAe;YACvB,WAAW,EAAE,yBAAyB;YACtC,WAAW,EAAE,2EAA2E;YACxF,QAAQ,EAAE,cAAc;SACzB;KACF;IACD,KAAK,EAAE;QACL;YACE,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,0EAA0E;YACvF,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SACrC;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,+CAA+C;YAC5D,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SACrC;QACD;YACE,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,oBAAoB;YACjC,WAAW,EAAE,wDAAwD;YACrE,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SACrC;QACD;YACE,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,yEAAyE;YACtF,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SACrC;KACF;CACF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|