opencode-oncall 0.1.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.
Files changed (105) hide show
  1. package/LICENSE +151 -0
  2. package/README.md +50 -0
  3. package/dist/common-settings-actions.d.ts +15 -0
  4. package/dist/common-settings-actions.js +48 -0
  5. package/dist/common-settings-store.d.ts +1 -0
  6. package/dist/common-settings-store.js +1 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +1 -0
  9. package/dist/plugin-hooks.d.ts +51 -0
  10. package/dist/plugin-hooks.js +288 -0
  11. package/dist/plugin.d.ts +10 -0
  12. package/dist/plugin.js +115 -0
  13. package/dist/settings-store.d.ts +50 -0
  14. package/dist/settings-store.js +214 -0
  15. package/dist/store-paths.d.ts +16 -0
  16. package/dist/store-paths.js +61 -0
  17. package/dist/ui/wechat-menu.d.ts +26 -0
  18. package/dist/ui/wechat-menu.js +90 -0
  19. package/dist/wechat/bind-flow.d.ts +29 -0
  20. package/dist/wechat/bind-flow.js +207 -0
  21. package/dist/wechat/bridge.d.ts +136 -0
  22. package/dist/wechat/bridge.js +1059 -0
  23. package/dist/wechat/broker-client.d.ts +23 -0
  24. package/dist/wechat/broker-client.js +274 -0
  25. package/dist/wechat/broker-endpoint.d.ts +21 -0
  26. package/dist/wechat/broker-endpoint.js +78 -0
  27. package/dist/wechat/broker-entry.d.ts +123 -0
  28. package/dist/wechat/broker-entry.js +1321 -0
  29. package/dist/wechat/broker-launcher.d.ts +37 -0
  30. package/dist/wechat/broker-launcher.js +418 -0
  31. package/dist/wechat/broker-mutation-queue.d.ts +93 -0
  32. package/dist/wechat/broker-mutation-queue.js +126 -0
  33. package/dist/wechat/broker-server.d.ts +86 -0
  34. package/dist/wechat/broker-server.js +1340 -0
  35. package/dist/wechat/broker-state-store.d.ts +335 -0
  36. package/dist/wechat/broker-state-store.js +1964 -0
  37. package/dist/wechat/command-parser.d.ts +18 -0
  38. package/dist/wechat/command-parser.js +58 -0
  39. package/dist/wechat/compat/jiti-loader.d.ts +27 -0
  40. package/dist/wechat/compat/jiti-loader.js +118 -0
  41. package/dist/wechat/compat/openclaw-account-helpers.d.ts +29 -0
  42. package/dist/wechat/compat/openclaw-account-helpers.js +60 -0
  43. package/dist/wechat/compat/openclaw-bind-helpers.d.ts +29 -0
  44. package/dist/wechat/compat/openclaw-bind-helpers.js +169 -0
  45. package/dist/wechat/compat/openclaw-guided-smoke.d.ts +180 -0
  46. package/dist/wechat/compat/openclaw-guided-smoke.js +1134 -0
  47. package/dist/wechat/compat/openclaw-public-entry.d.ts +33 -0
  48. package/dist/wechat/compat/openclaw-public-entry.js +62 -0
  49. package/dist/wechat/compat/openclaw-public-helpers.d.ts +70 -0
  50. package/dist/wechat/compat/openclaw-public-helpers.js +68 -0
  51. package/dist/wechat/compat/openclaw-qr-gateway.d.ts +15 -0
  52. package/dist/wechat/compat/openclaw-qr-gateway.js +39 -0
  53. package/dist/wechat/compat/openclaw-smoke.d.ts +48 -0
  54. package/dist/wechat/compat/openclaw-smoke.js +100 -0
  55. package/dist/wechat/compat/openclaw-sync-buf.d.ts +24 -0
  56. package/dist/wechat/compat/openclaw-sync-buf.js +80 -0
  57. package/dist/wechat/compat/openclaw-updates-send.d.ts +47 -0
  58. package/dist/wechat/compat/openclaw-updates-send.js +38 -0
  59. package/dist/wechat/compat/qrcode-terminal-loader.d.ts +12 -0
  60. package/dist/wechat/compat/qrcode-terminal-loader.js +16 -0
  61. package/dist/wechat/compat/slash-guard.d.ts +11 -0
  62. package/dist/wechat/compat/slash-guard.js +24 -0
  63. package/dist/wechat/dead-letter-store.d.ts +48 -0
  64. package/dist/wechat/dead-letter-store.js +224 -0
  65. package/dist/wechat/debug-bundle-collector.d.ts +49 -0
  66. package/dist/wechat/debug-bundle-collector.js +580 -0
  67. package/dist/wechat/debug-bundle-flow.d.ts +37 -0
  68. package/dist/wechat/debug-bundle-flow.js +180 -0
  69. package/dist/wechat/debug-bundle-redaction.d.ts +14 -0
  70. package/dist/wechat/debug-bundle-redaction.js +339 -0
  71. package/dist/wechat/handle.d.ts +10 -0
  72. package/dist/wechat/handle.js +57 -0
  73. package/dist/wechat/ipc-auth.d.ts +6 -0
  74. package/dist/wechat/ipc-auth.js +39 -0
  75. package/dist/wechat/latest-account-state-store.d.ts +8 -0
  76. package/dist/wechat/latest-account-state-store.js +38 -0
  77. package/dist/wechat/notification-dispatcher.d.ts +34 -0
  78. package/dist/wechat/notification-dispatcher.js +266 -0
  79. package/dist/wechat/notification-format.d.ts +15 -0
  80. package/dist/wechat/notification-format.js +196 -0
  81. package/dist/wechat/notification-store.d.ts +72 -0
  82. package/dist/wechat/notification-store.js +807 -0
  83. package/dist/wechat/notification-types.d.ts +37 -0
  84. package/dist/wechat/notification-types.js +1 -0
  85. package/dist/wechat/openclaw-account-adapter.d.ts +30 -0
  86. package/dist/wechat/openclaw-account-adapter.js +60 -0
  87. package/dist/wechat/operator-store.d.ts +9 -0
  88. package/dist/wechat/operator-store.js +69 -0
  89. package/dist/wechat/protocol.d.ts +150 -0
  90. package/dist/wechat/protocol.js +197 -0
  91. package/dist/wechat/question-interaction.d.ts +24 -0
  92. package/dist/wechat/question-interaction.js +180 -0
  93. package/dist/wechat/request-store.d.ts +108 -0
  94. package/dist/wechat/request-store.js +669 -0
  95. package/dist/wechat/session-digest.d.ts +50 -0
  96. package/dist/wechat/session-digest.js +167 -0
  97. package/dist/wechat/state-paths.d.ts +26 -0
  98. package/dist/wechat/state-paths.js +92 -0
  99. package/dist/wechat/status-format.d.ts +26 -0
  100. package/dist/wechat/status-format.js +616 -0
  101. package/dist/wechat/token-store.d.ts +20 -0
  102. package/dist/wechat/token-store.js +193 -0
  103. package/dist/wechat/wechat-status-runtime.d.ts +89 -0
  104. package/dist/wechat/wechat-status-runtime.js +518 -0
  105. package/package.json +74 -0
@@ -0,0 +1,86 @@
1
+ import { type BrokerState } from "./broker-state-store.js";
2
+ import type { WechatSlashCommand } from "./command-parser.js";
3
+ import { type BridgeToBrokerEvent, type BrokerAckEnvelope, type BrokerToBridgeCommand, type BrokerToBridgeCommandType, type BrokerToBridgeControl, type HelloRegisterPayload, type RegisterAckEnvelope, type ReplyMutationResult } from "./protocol.js";
4
+ export declare const DEFAULT_HEARTBEAT_TIMEOUT_MS = 30000;
5
+ export declare const DEFAULT_STATUS_COLLECT_WINDOW_MS = 5000;
6
+ export declare const WECHAT_BROKER_WS_PROTOCOL_VERSION = 2;
7
+ export declare const WECHAT_BROKER_WS_STATE_GENERATION = "wechat-ws-v1";
8
+ export type BrokerWsRegisterResult = {
9
+ accepted: boolean;
10
+ ack: RegisterAckEnvelope;
11
+ control?: BrokerToBridgeControl;
12
+ pendingCommands: BrokerToBridgeCommand[];
13
+ };
14
+ export type BrokerWsHandleBridgeEventResult = {
15
+ ack: BrokerAckEnvelope;
16
+ };
17
+ export type BrokerWsCommandDispatchInput = {
18
+ instanceID: string;
19
+ instanceIncarnation: string;
20
+ commandId: string;
21
+ type: BrokerToBridgeCommandType;
22
+ payload?: unknown;
23
+ target: Record<string, unknown>;
24
+ };
25
+ export type BrokerWsCoordinator = {
26
+ getState: () => BrokerState;
27
+ registerBridge: (hello: HelloRegisterPayload) => BrokerWsRegisterResult;
28
+ handleBridgeEvent: (event: BridgeToBrokerEvent, context: {
29
+ instanceID: string;
30
+ controlId?: string;
31
+ }) => BrokerWsHandleBridgeEventResult;
32
+ dispatchCommand: (input: BrokerWsCommandDispatchInput) => BrokerToBridgeCommand | null;
33
+ };
34
+ export declare function createBrokerWsCoordinator(input?: {
35
+ protocolVersion?: number;
36
+ stateGeneration?: string;
37
+ state?: BrokerState;
38
+ }): BrokerWsCoordinator;
39
+ type AggregatedStatusInstance = {
40
+ instanceID: string;
41
+ status: "ok";
42
+ snapshot: unknown;
43
+ } | {
44
+ instanceID: string;
45
+ status: "timeout/unreachable";
46
+ };
47
+ type CollectStatusResult = {
48
+ requestId: string;
49
+ instances: AggregatedStatusInstance[];
50
+ reply: string;
51
+ };
52
+ export type BrokerServerHandle = {
53
+ endpoint: string;
54
+ startedAt: number;
55
+ collectStatus: () => Promise<CollectStatusResult>;
56
+ handleWechatSlashCommand: (command: WechatSlashCommand) => Promise<string>;
57
+ handleNotificationDeliveryFailure: (input: {
58
+ instanceID: string;
59
+ wechatAccountId: string;
60
+ userId: string;
61
+ registrationEpoch?: string;
62
+ }) => Promise<void>;
63
+ dispatchReplyQuestionToInstance: (input: {
64
+ instanceID: string;
65
+ mutationId: string;
66
+ requestID: string;
67
+ answers: unknown[];
68
+ }) => Promise<ReplyMutationResult>;
69
+ dispatchReplyPermissionToInstance: (input: {
70
+ instanceID: string;
71
+ mutationId: string;
72
+ requestID: string;
73
+ reply: "once" | "always" | "reject";
74
+ message?: string;
75
+ }) => Promise<ReplyMutationResult>;
76
+ dispatchReplyNaturalStopToInstance: (input: {
77
+ instanceID: string;
78
+ mutationId: string;
79
+ sessionID: string;
80
+ text: string;
81
+ }) => Promise<ReplyMutationResult>;
82
+ hasBlockingActivity: () => Promise<boolean>;
83
+ close: () => Promise<void>;
84
+ };
85
+ export declare function startBrokerServer(endpoint: string): Promise<BrokerServerHandle>;
86
+ export {};