@zhin.js/adapter-kook 1.0.84 → 1.1.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 (84) hide show
  1. package/CHANGELOG.md +898 -17
  2. package/PERMITS.md +23 -0
  3. package/README.md +73 -374
  4. package/adapters/kook/index.js +41 -0
  5. package/adapters/kook/index.ts +56 -0
  6. package/agents/kook/agent.json +20 -0
  7. package/agents/kook/boundaries.md +3 -0
  8. package/agents/kook/conventions.md +3 -0
  9. package/agents/kook/skills/kook/SKILL.md +20 -0
  10. package/agents/kook/skills/kook/tools/blacklist/index.js +31 -0
  11. package/agents/kook/skills/kook/tools/blacklist/index.ts +31 -0
  12. package/agents/kook/skills/kook/tools/create_role/index.js +23 -0
  13. package/agents/kook/skills/kook/tools/create_role/index.ts +23 -0
  14. package/agents/kook/skills/kook/tools/delete_role/index.js +19 -0
  15. package/agents/kook/skills/kook/tools/delete_role/index.ts +19 -0
  16. package/agents/kook/skills/kook/tools/grant_role/index.js +20 -0
  17. package/agents/kook/skills/kook/tools/grant_role/index.ts +20 -0
  18. package/agents/kook/skills/kook/tools/list_roles/index.js +25 -0
  19. package/agents/kook/skills/kook/tools/list_roles/index.ts +25 -0
  20. package/agents/kook/skills/kook/tools/revoke_role/index.js +20 -0
  21. package/agents/kook/skills/kook/tools/revoke_role/index.ts +20 -0
  22. package/agents/kook/system.md +3 -0
  23. package/commands/kook/endpoint/add/[id]/index.js +3 -0
  24. package/commands/kook/endpoint/add/[id]/index.ts +3 -0
  25. package/commands/kook/endpoint/definition.js +19 -0
  26. package/commands/kook/endpoint/definition.ts +19 -0
  27. package/commands/kook/endpoint/list/index.js +3 -0
  28. package/commands/kook/endpoint/list/index.ts +3 -0
  29. package/commands/kook/endpoint/remove/[id]/index.js +3 -0
  30. package/commands/kook/endpoint/remove/[id]/index.ts +3 -0
  31. package/lib/client.d.ts +11 -0
  32. package/lib/client.js +2 -0
  33. package/lib/endpoint.d.ts +59 -0
  34. package/lib/endpoint.js +374 -0
  35. package/lib/index.d.ts +6 -18
  36. package/lib/index.js +6 -342
  37. package/lib/kook-runtime-state.d.ts +1 -0
  38. package/lib/kook-runtime-state.js +6 -0
  39. package/lib/platform-permit.d.ts +22 -0
  40. package/lib/platform-permit.js +48 -0
  41. package/lib/protocol.d.ts +126 -0
  42. package/lib/protocol.js +300 -0
  43. package/lib/side-event-dispatch.d.ts +3 -0
  44. package/lib/side-event-dispatch.js +49 -0
  45. package/lib/webhook.d.ts +16 -0
  46. package/lib/webhook.js +71 -0
  47. package/lib/ws.d.ts +56 -0
  48. package/lib/ws.js +63 -0
  49. package/package.json +73 -29
  50. package/plugin.js +19 -0
  51. package/schema.json +171 -0
  52. package/src/client.ts +15 -0
  53. package/src/endpoint.ts +433 -0
  54. package/src/index.ts +45 -322
  55. package/src/kook-runtime-state.ts +7 -0
  56. package/src/platform-permit.ts +75 -0
  57. package/src/protocol.ts +433 -0
  58. package/src/side-event-dispatch.ts +54 -0
  59. package/src/webhook.ts +114 -0
  60. package/src/ws.ts +131 -0
  61. package/client/Dashboard.tsx +0 -255
  62. package/client/index.tsx +0 -11
  63. package/client/tsconfig.json +0 -7
  64. package/client/utils/api.ts +0 -17
  65. package/dist/index.js +0 -31
  66. package/lib/adapter.d.ts +0 -26
  67. package/lib/adapter.d.ts.map +0 -1
  68. package/lib/adapter.js +0 -61
  69. package/lib/adapter.js.map +0 -1
  70. package/lib/bot.d.ts +0 -122
  71. package/lib/bot.d.ts.map +0 -1
  72. package/lib/bot.js +0 -608
  73. package/lib/bot.js.map +0 -1
  74. package/lib/index.d.ts.map +0 -1
  75. package/lib/index.js.map +0 -1
  76. package/lib/types.d.ts +0 -32
  77. package/lib/types.d.ts.map +0 -1
  78. package/lib/types.js +0 -8
  79. package/lib/types.js.map +0 -1
  80. package/plugin.yml +0 -3
  81. package/skills/kook/SKILL.md +0 -80
  82. package/src/adapter.ts +0 -71
  83. package/src/bot.ts +0 -693
  84. package/src/types.ts +0 -36
package/src/types.ts DELETED
@@ -1,36 +0,0 @@
1
- /**
2
- * KOOK 适配器类型与配置
3
- */
4
- import type { PrivateMessageEvent, ChannelMessageEvent } from "kook-client";
5
- import type { LogLevel } from "kook-client";
6
-
7
- export type { LogLevel };
8
-
9
- export enum KookPermission {
10
- Normal = 1,
11
- Admin = 2,
12
- Owner = 4,
13
- ChannelAdmin = 5,
14
- }
15
-
16
- export interface KookSenderInfo {
17
- id: string;
18
- name: string;
19
- permission?: KookPermission;
20
- roles?: number[];
21
- isGuildOwner?: boolean;
22
- isAdmin?: boolean;
23
- }
24
-
25
- export interface KookBotConfig {
26
- context: "kook";
27
- name: string;
28
- token: string;
29
- data_dir?: string;
30
- timeout?: number;
31
- max_retry?: number;
32
- ignore?: "bot" | "self";
33
- logLevel?: LogLevel;
34
- }
35
-
36
- export type KookRawMessage = PrivateMessageEvent | ChannelMessageEvent;