paperclip-plugin-telegram 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.
Files changed (61) hide show
  1. package/dist/acp-bridge.d.ts +34 -0
  2. package/dist/acp-bridge.js +805 -0
  3. package/dist/acp-bridge.js.map +1 -0
  4. package/dist/adapter.d.ts +35 -0
  5. package/dist/adapter.js +75 -0
  6. package/dist/adapter.js.map +1 -0
  7. package/dist/command-registry.d.ts +3 -0
  8. package/dist/command-registry.js +273 -0
  9. package/dist/command-registry.js.map +1 -0
  10. package/dist/commands.d.ts +10 -0
  11. package/dist/commands.js +213 -0
  12. package/dist/commands.js.map +1 -0
  13. package/dist/constants.d.ts +44 -0
  14. package/dist/constants.js +48 -0
  15. package/dist/constants.js.map +1 -0
  16. package/dist/escalation.d.ts +41 -0
  17. package/dist/escalation.js +254 -0
  18. package/dist/escalation.js.map +1 -0
  19. package/dist/formatters.d.ts +13 -0
  20. package/dist/formatters.js +130 -0
  21. package/dist/formatters.js.map +1 -0
  22. package/dist/index.js +4 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/manifest.d.ts +3 -0
  25. package/dist/manifest.js +230 -0
  26. package/dist/manifest.js.map +1 -0
  27. package/dist/media-pipeline.d.ts +46 -0
  28. package/dist/media-pipeline.js +161 -0
  29. package/dist/media-pipeline.js.map +1 -0
  30. package/dist/telegram-api.d.ts +28 -0
  31. package/dist/telegram-api.js +147 -0
  32. package/dist/telegram-api.js.map +1 -0
  33. package/dist/watch-registry.d.ts +9 -0
  34. package/dist/watch-registry.js +272 -0
  35. package/dist/watch-registry.js.map +1 -0
  36. package/dist/worker.d.ts +1 -0
  37. package/dist/worker.js +548 -0
  38. package/dist/worker.js.map +1 -0
  39. package/package.json +7 -3
  40. package/src/acp-bridge.ts +0 -1273
  41. package/src/adapter.ts +0 -129
  42. package/src/command-registry.ts +0 -482
  43. package/src/commands.ts +0 -346
  44. package/src/constants.ts +0 -51
  45. package/src/escalation.ts +0 -421
  46. package/src/formatters.ts +0 -148
  47. package/src/manifest.ts +0 -246
  48. package/src/media-pipeline.ts +0 -234
  49. package/src/telegram-api.ts +0 -202
  50. package/src/watch-registry.ts +0 -369
  51. package/src/worker.ts +0 -783
  52. package/tests/acp-bridge.test.ts +0 -314
  53. package/tests/command-registry.test.ts +0 -283
  54. package/tests/commands.test.ts +0 -213
  55. package/tests/escalation.test.ts +0 -550
  56. package/tests/formatters.test.ts +0 -185
  57. package/tests/media-pipeline.test.ts +0 -324
  58. package/tests/telegram-api.test.ts +0 -108
  59. package/tests/watch-registry.test.ts +0 -404
  60. package/tsconfig.json +0 -16
  61. /package/{src/index.ts → dist/index.d.ts} +0 -0
@@ -0,0 +1,34 @@
1
+ import type { PluginContext } from "@paperclipai/plugin-sdk";
2
+ export type ChatSession = {
3
+ sessionId: string;
4
+ agentId: string;
5
+ agentName: string;
6
+ agentDisplayName: string;
7
+ transport: "native" | "acp";
8
+ spawnedAt: string;
9
+ status: "active" | "closed";
10
+ lastActivityAt: string;
11
+ };
12
+ type AcpOutputEvent = {
13
+ sessionId: string;
14
+ chatId: string;
15
+ threadId: number;
16
+ text: string;
17
+ done?: boolean;
18
+ };
19
+ export declare function setupAcpOutputListener(ctx: PluginContext, token: string): void;
20
+ export declare function handleAcpCommand(ctx: PluginContext, token: string, chatId: string, args: string, messageThreadId?: number, companyId?: string): Promise<void>;
21
+ export declare function routeMessageToAgent(ctx: PluginContext, token: string, chatId: string, threadId: number, text: string, replyToMessageId?: number, companyId?: string): Promise<boolean>;
22
+ export declare function handleAcpOutput(ctx: PluginContext, token: string, event: AcpOutputEvent): Promise<void>;
23
+ export declare function handleHandoffToolCall(ctx: PluginContext, token: string, params: Record<string, unknown>, companyId: string, sourceAgentId: string): Promise<{
24
+ content?: string;
25
+ error?: string;
26
+ }>;
27
+ export declare function handleHandoffApproval(ctx: PluginContext, token: string, handoffId: string, actor: string, callbackQueryId: string, chatId: string | null, messageId: number | undefined): Promise<void>;
28
+ export declare function handleHandoffRejection(ctx: PluginContext, token: string, handoffId: string, actor: string, callbackQueryId: string, chatId: string | null, messageId: number | undefined): Promise<void>;
29
+ export declare function handleDiscussToolCall(ctx: PluginContext, token: string, params: Record<string, unknown>, companyId: string, sourceAgentId: string): Promise<{
30
+ content?: string;
31
+ error?: string;
32
+ }>;
33
+ export declare function getSessions(ctx: PluginContext, chatId: string, threadId: number): Promise<ChatSession[]>;
34
+ export {};