koishi-plugin-dynamic-bot 0.0.2 → 0.0.3
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/lib/dbk/avatar.d.ts +2 -0
- package/lib/dbk/bots.d.ts +24 -0
- package/lib/dbk/codec.d.ts +9 -0
- package/lib/dbk/error.d.ts +5 -0
- package/lib/dbk/gateway.d.ts +32 -0
- package/lib/dbk/get-target.d.ts +3 -0
- package/lib/dbk/handlers.d.ts +3 -0
- package/lib/dbk/list-targets.d.ts +3 -0
- package/lib/dbk/protocol.d.ts +71 -0
- package/lib/dbk/recall.d.ts +3 -0
- package/lib/dbk/send.d.ts +16 -0
- package/lib/dbk/session.d.ts +44 -0
- package/lib/dbk/socket.d.ts +17 -0
- package/lib/dbk/version.d.ts +1 -0
- package/lib/gen/dbk/v1/common_pb.d.ts +187 -0
- package/lib/gen/dbk/v1/frame_pb.d.ts +88 -0
- package/lib/gen/dbk/v1/rpc_pb.d.ts +717 -0
- package/lib/index.d.ts +23 -0
- package/lib/index.js +1942 -0
- package/package.json +21 -4
- package/src/dbk/version.ts +27 -2
- package/AGENTS.md +0 -6
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Bot, Context } from "koishi";
|
|
2
|
+
import { BotStatus, TargetKind } from "../gen/dbk/v1/common_pb";
|
|
3
|
+
import { type Bot as DbkBot } from "../gen/dbk/v1/rpc_pb";
|
|
4
|
+
export declare const BotFeature: {
|
|
5
|
+
readonly MESSAGE_RECALL: "message.recall";
|
|
6
|
+
readonly MESSAGE_FORWARD: "message.forward";
|
|
7
|
+
readonly MENTION_ALL: "mention.all";
|
|
8
|
+
readonly TARGETS_LIST: "targets.list";
|
|
9
|
+
readonly TARGET_USER: "target.user";
|
|
10
|
+
readonly TARGET_GROUP: "target.group";
|
|
11
|
+
readonly TARGET_CHANNEL: "target.channel";
|
|
12
|
+
readonly TARGET_THREAD: "target.thread";
|
|
13
|
+
};
|
|
14
|
+
export declare function listBots(ctx: Pick<Context, "bots">): DbkBot[];
|
|
15
|
+
export declare function toDbkBot(bot: Bot): DbkBot;
|
|
16
|
+
export declare function toDbkBotStatus(status: number): BotStatus;
|
|
17
|
+
export declare function botFeatures(bot: Bot): string[];
|
|
18
|
+
export declare function botTargetKinds(bot: Bot): TargetKind[];
|
|
19
|
+
export declare function targetKindFeature(kind: TargetKind): string | undefined;
|
|
20
|
+
/** Nested `channel.list` under a guild: Discord/KOOK-style servers, not sendable GROUP. */
|
|
21
|
+
export declare function hasNestedChannels(bot: Bot): boolean;
|
|
22
|
+
/** Guild/chat list or get, including flat adapters where the guild is the sendable target. */
|
|
23
|
+
export declare function hasGuildSurface(bot: Bot): boolean;
|
|
24
|
+
export declare function canListDirectUsers(bot: Bot): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { create, type DescMessage, type MessageShape } from "@bufbuild/protobuf";
|
|
2
|
+
import { FrameSchema, type Frame } from "../gen/dbk/v1/frame_pb";
|
|
3
|
+
import type { DbkEncoding } from "./protocol";
|
|
4
|
+
export declare function encodeFrame(frame: Frame, encoding: DbkEncoding): Uint8Array | string;
|
|
5
|
+
export declare function decodeFrame(data: Uint8Array | string, encoding: DbkEncoding): Frame;
|
|
6
|
+
export declare function encodePayload<Desc extends DescMessage>(schema: Desc, message: MessageShape<Desc>): Uint8Array;
|
|
7
|
+
export declare function decodePayload<Desc extends DescMessage>(schema: Desc, bytes: Uint8Array): MessageShape<Desc>;
|
|
8
|
+
export declare function createFrame(init: Parameters<typeof create<typeof FrameSchema>>[1]): Frame;
|
|
9
|
+
export declare function toBytes(data: unknown): Uint8Array;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Context } from "koishi";
|
|
2
|
+
import { type DbkEncoding, type DbkEventMap, type DbkGatewayHandlers } from "./protocol";
|
|
3
|
+
export interface DbkGatewayConfig {
|
|
4
|
+
encoding: DbkEncoding;
|
|
5
|
+
accessToken: string;
|
|
6
|
+
path: string;
|
|
7
|
+
host: string;
|
|
8
|
+
port: number;
|
|
9
|
+
reconnect: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class DbkGateway {
|
|
12
|
+
private readonly ctx;
|
|
13
|
+
private readonly config;
|
|
14
|
+
private readonly handlers;
|
|
15
|
+
private session;
|
|
16
|
+
private socket;
|
|
17
|
+
private closing;
|
|
18
|
+
private reconnectAttempts;
|
|
19
|
+
private reconnectTimer;
|
|
20
|
+
private reconnectSuspended;
|
|
21
|
+
constructor(ctx: Context, config: DbkGatewayConfig, handlers: DbkGatewayHandlers);
|
|
22
|
+
get isHandshook(): boolean;
|
|
23
|
+
emit<K extends keyof DbkEventMap>(method: K, event: DbkEventMap[K]): void;
|
|
24
|
+
startForward(): void;
|
|
25
|
+
startReverse(): void;
|
|
26
|
+
stop(): void;
|
|
27
|
+
private connectReverse;
|
|
28
|
+
private attach;
|
|
29
|
+
private onReverseClosed;
|
|
30
|
+
private scheduleReconnect;
|
|
31
|
+
}
|
|
32
|
+
export declare function watchBots(ctx: Context, gateway: DbkGateway): void;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
3
|
+
import { FrameSchema } from "../gen/dbk/v1/frame_pb";
|
|
4
|
+
import { type BotChangedEvent, type GetTargetRequest, type GetTargetResponse, type HelloRequest, type HelloResponse, type IncomingMessage, type ListBotsRequest, type ListBotsResponse, type ListTargetsRequest, type ListTargetsResponse, type RecallParams, type RecallResult, type SendParams, type SendResult } from "../gen/dbk/v1/rpc_pb";
|
|
5
|
+
export declare const PROTOCOL_VERSION = "1";
|
|
6
|
+
export { GATEWAY_VERSION } from "./version";
|
|
7
|
+
export declare const PING_INTERVAL_MS = 10000;
|
|
8
|
+
export declare const PONG_TIMEOUT_MS = 20000;
|
|
9
|
+
export declare const DbkMethod: {
|
|
10
|
+
readonly SESSION_HELLO: "session.hello";
|
|
11
|
+
readonly BOTS_LIST: "bots.list";
|
|
12
|
+
readonly TARGETS_LIST: "targets.list";
|
|
13
|
+
readonly TARGETS_GET: "targets.get";
|
|
14
|
+
readonly MESSAGE_SEND: "message.send";
|
|
15
|
+
readonly MESSAGE_RECALL: "message.recall";
|
|
16
|
+
};
|
|
17
|
+
export declare const DbkEvent: {
|
|
18
|
+
readonly BOT_CHANGED: "bot.changed";
|
|
19
|
+
readonly MESSAGE_CREATED: "message.created";
|
|
20
|
+
};
|
|
21
|
+
export type DbkMethodName = (typeof DbkMethod)[keyof typeof DbkMethod];
|
|
22
|
+
export type DbkEventName = (typeof DbkEvent)[keyof typeof DbkEvent];
|
|
23
|
+
export type DbkEncoding = "binary" | "json";
|
|
24
|
+
export interface DbkRpcMap {
|
|
25
|
+
[DbkMethod.SESSION_HELLO]: {
|
|
26
|
+
request: HelloRequest;
|
|
27
|
+
response: HelloResponse;
|
|
28
|
+
};
|
|
29
|
+
[DbkMethod.BOTS_LIST]: {
|
|
30
|
+
request: ListBotsRequest;
|
|
31
|
+
response: ListBotsResponse;
|
|
32
|
+
};
|
|
33
|
+
[DbkMethod.TARGETS_LIST]: {
|
|
34
|
+
request: ListTargetsRequest;
|
|
35
|
+
response: ListTargetsResponse;
|
|
36
|
+
};
|
|
37
|
+
[DbkMethod.TARGETS_GET]: {
|
|
38
|
+
request: GetTargetRequest;
|
|
39
|
+
response: GetTargetResponse;
|
|
40
|
+
};
|
|
41
|
+
[DbkMethod.MESSAGE_SEND]: {
|
|
42
|
+
request: SendParams;
|
|
43
|
+
response: SendResult;
|
|
44
|
+
};
|
|
45
|
+
[DbkMethod.MESSAGE_RECALL]: {
|
|
46
|
+
request: RecallParams;
|
|
47
|
+
response: RecallResult;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface DbkEventMap {
|
|
51
|
+
[DbkEvent.BOT_CHANGED]: BotChangedEvent;
|
|
52
|
+
[DbkEvent.MESSAGE_CREATED]: IncomingMessage;
|
|
53
|
+
}
|
|
54
|
+
export type DbkGatewayHandlers = {
|
|
55
|
+
[K in keyof DbkRpcMap]: (request: DbkRpcMap[K]["request"]) => Promise<DbkRpcMap[K]["response"]> | DbkRpcMap[K]["response"];
|
|
56
|
+
};
|
|
57
|
+
interface RpcCodec<Req extends Message, Res extends Message> {
|
|
58
|
+
request: GenMessage<Req>;
|
|
59
|
+
response: GenMessage<Res>;
|
|
60
|
+
}
|
|
61
|
+
export declare const DbkRpcCodecs: {
|
|
62
|
+
[K in keyof DbkRpcMap]: RpcCodec<DbkRpcMap[K]["request"], DbkRpcMap[K]["response"]>;
|
|
63
|
+
};
|
|
64
|
+
export declare const DbkEventCodecs: {
|
|
65
|
+
[K in keyof DbkEventMap]: GenMessage<DbkEventMap[K]>;
|
|
66
|
+
};
|
|
67
|
+
export { FrameSchema };
|
|
68
|
+
export type { Frame } from "../gen/dbk/v1/frame_pb";
|
|
69
|
+
export { FrameOp } from "../gen/dbk/v1/frame_pb";
|
|
70
|
+
export { ErrorCode, RpcErrorSchema } from "../gen/dbk/v1/common_pb";
|
|
71
|
+
export type { RpcError } from "../gen/dbk/v1/common_pb";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { h, type Context } from "koishi";
|
|
2
|
+
import { type Segment, type SendParams, type SendResult } from "../gen/dbk/v1/rpc_pb";
|
|
3
|
+
type El = ReturnType<typeof h>;
|
|
4
|
+
export interface SegmentRenderOptions {
|
|
5
|
+
/** Prepend `h.quote` unless a reply segment already uses this id. */
|
|
6
|
+
quoteMessageId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* `mention_all` mapping:
|
|
9
|
+
* - true → Satori `<at type="all"/>` (`h("at", { type: "all" })`)
|
|
10
|
+
* - false → degrade to text `@全体成员` (not PARTIAL)
|
|
11
|
+
*/
|
|
12
|
+
mentionAll?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function sendMessage(ctx: Context, request: SendParams): Promise<SendResult>;
|
|
15
|
+
export declare function segmentsToElements(segments: Segment[], options?: SegmentRenderOptions): El[];
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type Frame } from "../gen/dbk/v1/frame_pb";
|
|
2
|
+
import { type DbkEncoding, type DbkEventMap, type DbkGatewayHandlers } from "./protocol";
|
|
3
|
+
export interface DbkLogger {
|
|
4
|
+
debug(...args: unknown[]): void;
|
|
5
|
+
info(...args: unknown[]): void;
|
|
6
|
+
warn(...args: unknown[]): void;
|
|
7
|
+
error(...args: unknown[]): void;
|
|
8
|
+
}
|
|
9
|
+
export interface DbkSessionOptions {
|
|
10
|
+
encoding: DbkEncoding;
|
|
11
|
+
accessToken: string;
|
|
12
|
+
handlers: DbkGatewayHandlers;
|
|
13
|
+
logger: DbkLogger;
|
|
14
|
+
send: (data: Uint8Array | string) => void;
|
|
15
|
+
onDead: (reason: string) => void;
|
|
16
|
+
onUnauthorized?: () => void;
|
|
17
|
+
now?: () => number;
|
|
18
|
+
}
|
|
19
|
+
export declare class DbkGatewaySession {
|
|
20
|
+
private readonly options;
|
|
21
|
+
private closed;
|
|
22
|
+
private handshook;
|
|
23
|
+
private seq;
|
|
24
|
+
private sendQueue;
|
|
25
|
+
private lastInboundAt;
|
|
26
|
+
private heartbeat;
|
|
27
|
+
private readonly now;
|
|
28
|
+
constructor(options: DbkSessionOptions);
|
|
29
|
+
get isHandshook(): boolean;
|
|
30
|
+
onFrame(frame: Frame): void;
|
|
31
|
+
rejectText(): void;
|
|
32
|
+
rejectDecode(error: unknown): void;
|
|
33
|
+
emit<K extends keyof DbkEventMap>(method: K, event: DbkEventMap[K]): void;
|
|
34
|
+
close(reason?: string): void;
|
|
35
|
+
private handle;
|
|
36
|
+
private handleCall;
|
|
37
|
+
private dispatchCall;
|
|
38
|
+
private runRpc;
|
|
39
|
+
private hello;
|
|
40
|
+
private replyError;
|
|
41
|
+
private startHeartbeat;
|
|
42
|
+
private enqueueFrame;
|
|
43
|
+
private fail;
|
|
44
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DbkEncoding } from "./protocol";
|
|
2
|
+
import type { DbkGatewaySession } from "./session";
|
|
3
|
+
export interface DbkSocket {
|
|
4
|
+
readyState: number;
|
|
5
|
+
binaryType?: string;
|
|
6
|
+
send(data: Uint8Array | string): void;
|
|
7
|
+
close(code?: number, reason?: string): void;
|
|
8
|
+
on?(event: string, listener: (...args: unknown[]) => void): void;
|
|
9
|
+
addEventListener?(type: string, listener: (event: {
|
|
10
|
+
data?: unknown;
|
|
11
|
+
code?: number;
|
|
12
|
+
reason?: string;
|
|
13
|
+
}) => void): void;
|
|
14
|
+
}
|
|
15
|
+
export declare const WS_OPEN = 1;
|
|
16
|
+
export declare function sendSocket(socket: DbkSocket, data: Uint8Array | string): void;
|
|
17
|
+
export declare function attachSocket(socket: DbkSocket, session: DbkGatewaySession, encoding: DbkEncoding): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GATEWAY_VERSION: string;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* Describes the file dbk/v1/common.proto.
|
|
5
|
+
*/
|
|
6
|
+
export declare const file_dbk_v1_common: GenFile;
|
|
7
|
+
/**
|
|
8
|
+
* @generated from message dbk.v1.Target
|
|
9
|
+
*/
|
|
10
|
+
export type Target = Message<"dbk.v1.Target"> & {
|
|
11
|
+
/**
|
|
12
|
+
* @generated from field: dbk.v1.TargetKind kind = 1;
|
|
13
|
+
*/
|
|
14
|
+
kind: TargetKind;
|
|
15
|
+
/**
|
|
16
|
+
* @generated from field: string id = 2;
|
|
17
|
+
*/
|
|
18
|
+
id: string;
|
|
19
|
+
/**
|
|
20
|
+
* @generated from field: string guild_id = 3;
|
|
21
|
+
*/
|
|
22
|
+
guildId: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Describes the message dbk.v1.Target.
|
|
26
|
+
* Use `create(TargetSchema)` to create a new message.
|
|
27
|
+
*/
|
|
28
|
+
export declare const TargetSchema: GenMessage<Target>;
|
|
29
|
+
/**
|
|
30
|
+
* @generated from message dbk.v1.RpcError
|
|
31
|
+
*/
|
|
32
|
+
export type RpcError = Message<"dbk.v1.RpcError"> & {
|
|
33
|
+
/**
|
|
34
|
+
* @generated from field: dbk.v1.ErrorCode code = 1;
|
|
35
|
+
*/
|
|
36
|
+
code: ErrorCode;
|
|
37
|
+
/**
|
|
38
|
+
* @generated from field: string detail = 2;
|
|
39
|
+
*/
|
|
40
|
+
detail: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Describes the message dbk.v1.RpcError.
|
|
44
|
+
* Use `create(RpcErrorSchema)` to create a new message.
|
|
45
|
+
*/
|
|
46
|
+
export declare const RpcErrorSchema: GenMessage<RpcError>;
|
|
47
|
+
/**
|
|
48
|
+
* @generated from enum dbk.v1.TargetKind
|
|
49
|
+
*/
|
|
50
|
+
export declare enum TargetKind {
|
|
51
|
+
/**
|
|
52
|
+
* @generated from enum value: TARGET_KIND_UNSPECIFIED = 0;
|
|
53
|
+
*/
|
|
54
|
+
UNSPECIFIED = 0,
|
|
55
|
+
/**
|
|
56
|
+
* @generated from enum value: TARGET_KIND_USER = 1;
|
|
57
|
+
*/
|
|
58
|
+
USER = 1,
|
|
59
|
+
/**
|
|
60
|
+
* @generated from enum value: TARGET_KIND_GROUP = 2;
|
|
61
|
+
*/
|
|
62
|
+
GROUP = 2,
|
|
63
|
+
/**
|
|
64
|
+
* @generated from enum value: TARGET_KIND_CHANNEL = 3;
|
|
65
|
+
*/
|
|
66
|
+
CHANNEL = 3,
|
|
67
|
+
/**
|
|
68
|
+
* @generated from enum value: TARGET_KIND_THREAD = 4;
|
|
69
|
+
*/
|
|
70
|
+
THREAD = 4
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Describes the enum dbk.v1.TargetKind.
|
|
74
|
+
*/
|
|
75
|
+
export declare const TargetKindSchema: GenEnum<TargetKind>;
|
|
76
|
+
/**
|
|
77
|
+
* @generated from enum dbk.v1.BotStatus
|
|
78
|
+
*/
|
|
79
|
+
export declare enum BotStatus {
|
|
80
|
+
/**
|
|
81
|
+
* @generated from enum value: BOT_STATUS_UNSPECIFIED = 0;
|
|
82
|
+
*/
|
|
83
|
+
UNSPECIFIED = 0,
|
|
84
|
+
/**
|
|
85
|
+
* @generated from enum value: BOT_STATUS_READY = 1;
|
|
86
|
+
*/
|
|
87
|
+
READY = 1,
|
|
88
|
+
/**
|
|
89
|
+
* @generated from enum value: BOT_STATUS_UNAVAILABLE = 2;
|
|
90
|
+
*/
|
|
91
|
+
UNAVAILABLE = 2,
|
|
92
|
+
/**
|
|
93
|
+
* @generated from enum value: BOT_STATUS_CONNECTING = 3;
|
|
94
|
+
*/
|
|
95
|
+
CONNECTING = 3
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Describes the enum dbk.v1.BotStatus.
|
|
99
|
+
*/
|
|
100
|
+
export declare const BotStatusSchema: GenEnum<BotStatus>;
|
|
101
|
+
/**
|
|
102
|
+
* @generated from enum dbk.v1.SendStatus
|
|
103
|
+
*/
|
|
104
|
+
export declare enum SendStatus {
|
|
105
|
+
/**
|
|
106
|
+
* @generated from enum value: SEND_STATUS_UNSPECIFIED = 0;
|
|
107
|
+
*/
|
|
108
|
+
UNSPECIFIED = 0,
|
|
109
|
+
/**
|
|
110
|
+
* @generated from enum value: SEND_STATUS_OK = 1;
|
|
111
|
+
*/
|
|
112
|
+
OK = 1,
|
|
113
|
+
/**
|
|
114
|
+
* @generated from enum value: SEND_STATUS_PARTIAL = 2;
|
|
115
|
+
*/
|
|
116
|
+
PARTIAL = 2,
|
|
117
|
+
/**
|
|
118
|
+
* @generated from enum value: SEND_STATUS_UNKNOWN = 3;
|
|
119
|
+
*/
|
|
120
|
+
UNKNOWN = 3,
|
|
121
|
+
/**
|
|
122
|
+
* @generated from enum value: SEND_STATUS_FAILED = 4;
|
|
123
|
+
*/
|
|
124
|
+
FAILED = 4
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Describes the enum dbk.v1.SendStatus.
|
|
128
|
+
*/
|
|
129
|
+
export declare const SendStatusSchema: GenEnum<SendStatus>;
|
|
130
|
+
/**
|
|
131
|
+
* @generated from enum dbk.v1.ErrorCode
|
|
132
|
+
*/
|
|
133
|
+
export declare enum ErrorCode {
|
|
134
|
+
/**
|
|
135
|
+
* @generated from enum value: ERROR_CODE_UNSPECIFIED = 0;
|
|
136
|
+
*/
|
|
137
|
+
UNSPECIFIED = 0,
|
|
138
|
+
/**
|
|
139
|
+
* @generated from enum value: ERROR_CODE_UNAUTHORIZED = 1;
|
|
140
|
+
*/
|
|
141
|
+
UNAUTHORIZED = 1,
|
|
142
|
+
/**
|
|
143
|
+
* @generated from enum value: ERROR_CODE_PROTOCOL = 2;
|
|
144
|
+
*/
|
|
145
|
+
PROTOCOL = 2,
|
|
146
|
+
/**
|
|
147
|
+
* @generated from enum value: ERROR_CODE_NOT_FOUND = 3;
|
|
148
|
+
*/
|
|
149
|
+
NOT_FOUND = 3,
|
|
150
|
+
/**
|
|
151
|
+
* @generated from enum value: ERROR_CODE_UNSUPPORTED = 4;
|
|
152
|
+
*/
|
|
153
|
+
UNSUPPORTED = 4,
|
|
154
|
+
/**
|
|
155
|
+
* @generated from enum value: ERROR_CODE_INTERNAL = 5;
|
|
156
|
+
*/
|
|
157
|
+
INTERNAL = 5
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Describes the enum dbk.v1.ErrorCode.
|
|
161
|
+
*/
|
|
162
|
+
export declare const ErrorCodeSchema: GenEnum<ErrorCode>;
|
|
163
|
+
/**
|
|
164
|
+
* @generated from enum dbk.v1.BotChangeType
|
|
165
|
+
*/
|
|
166
|
+
export declare enum BotChangeType {
|
|
167
|
+
/**
|
|
168
|
+
* @generated from enum value: BOT_CHANGE_TYPE_UNSPECIFIED = 0;
|
|
169
|
+
*/
|
|
170
|
+
UNSPECIFIED = 0,
|
|
171
|
+
/**
|
|
172
|
+
* @generated from enum value: BOT_CHANGE_TYPE_ADDED = 1;
|
|
173
|
+
*/
|
|
174
|
+
ADDED = 1,
|
|
175
|
+
/**
|
|
176
|
+
* @generated from enum value: BOT_CHANGE_TYPE_UPDATED = 2;
|
|
177
|
+
*/
|
|
178
|
+
UPDATED = 2,
|
|
179
|
+
/**
|
|
180
|
+
* @generated from enum value: BOT_CHANGE_TYPE_REMOVED = 3;
|
|
181
|
+
*/
|
|
182
|
+
REMOVED = 3
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Describes the enum dbk.v1.BotChangeType.
|
|
186
|
+
*/
|
|
187
|
+
export declare const BotChangeTypeSchema: GenEnum<BotChangeType>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { RpcError } from "./common_pb";
|
|
3
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
4
|
+
/**
|
|
5
|
+
* Describes the file dbk/v1/frame.proto.
|
|
6
|
+
*/
|
|
7
|
+
export declare const file_dbk_v1_frame: GenFile;
|
|
8
|
+
/**
|
|
9
|
+
* @generated from message dbk.v1.Frame
|
|
10
|
+
*/
|
|
11
|
+
export type Frame = Message<"dbk.v1.Frame"> & {
|
|
12
|
+
/**
|
|
13
|
+
* @generated from field: dbk.v1.FrameOp op = 1;
|
|
14
|
+
*/
|
|
15
|
+
op: FrameOp;
|
|
16
|
+
/**
|
|
17
|
+
* CALL / OK / ERROR. Generated by the caller.
|
|
18
|
+
*
|
|
19
|
+
* @generated from field: string id = 2;
|
|
20
|
+
*/
|
|
21
|
+
id: string;
|
|
22
|
+
/**
|
|
23
|
+
* EVENT only. Monotonic per connection; v1 does not resume by seq.
|
|
24
|
+
*
|
|
25
|
+
* @generated from field: uint64 seq = 3;
|
|
26
|
+
*/
|
|
27
|
+
seq: bigint;
|
|
28
|
+
/**
|
|
29
|
+
* CALL / EVENT method name, e.g. `session.hello`, `message.created`.
|
|
30
|
+
*
|
|
31
|
+
* @generated from field: string method = 4;
|
|
32
|
+
*/
|
|
33
|
+
method: string;
|
|
34
|
+
/**
|
|
35
|
+
* Encoded request, response, or event body for `method`.
|
|
36
|
+
*
|
|
37
|
+
* @generated from field: bytes payload = 5;
|
|
38
|
+
*/
|
|
39
|
+
payload: Uint8Array;
|
|
40
|
+
/**
|
|
41
|
+
* ERROR only. Business send failures use OK + SendStatus, not this.
|
|
42
|
+
*
|
|
43
|
+
* @generated from field: dbk.v1.RpcError error = 6;
|
|
44
|
+
*/
|
|
45
|
+
error?: RpcError | undefined;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Describes the message dbk.v1.Frame.
|
|
49
|
+
* Use `create(FrameSchema)` to create a new message.
|
|
50
|
+
*/
|
|
51
|
+
export declare const FrameSchema: GenMessage<Frame>;
|
|
52
|
+
/**
|
|
53
|
+
* @generated from enum dbk.v1.FrameOp
|
|
54
|
+
*/
|
|
55
|
+
export declare enum FrameOp {
|
|
56
|
+
/**
|
|
57
|
+
* @generated from enum value: FRAME_OP_UNSPECIFIED = 0;
|
|
58
|
+
*/
|
|
59
|
+
UNSPECIFIED = 0,
|
|
60
|
+
/**
|
|
61
|
+
* @generated from enum value: FRAME_OP_CALL = 1;
|
|
62
|
+
*/
|
|
63
|
+
CALL = 1,
|
|
64
|
+
/**
|
|
65
|
+
* @generated from enum value: FRAME_OP_OK = 2;
|
|
66
|
+
*/
|
|
67
|
+
OK = 2,
|
|
68
|
+
/**
|
|
69
|
+
* @generated from enum value: FRAME_OP_ERROR = 3;
|
|
70
|
+
*/
|
|
71
|
+
ERROR = 3,
|
|
72
|
+
/**
|
|
73
|
+
* @generated from enum value: FRAME_OP_EVENT = 4;
|
|
74
|
+
*/
|
|
75
|
+
EVENT = 4,
|
|
76
|
+
/**
|
|
77
|
+
* @generated from enum value: FRAME_OP_PING = 5;
|
|
78
|
+
*/
|
|
79
|
+
PING = 5,
|
|
80
|
+
/**
|
|
81
|
+
* @generated from enum value: FRAME_OP_PONG = 6;
|
|
82
|
+
*/
|
|
83
|
+
PONG = 6
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Describes the enum dbk.v1.FrameOp.
|
|
87
|
+
*/
|
|
88
|
+
export declare const FrameOpSchema: GenEnum<FrameOp>;
|