@inline-openclaw/inline 0.0.44 → 0.0.45
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/account-inspect-api.js +4 -2
- package/dist/account-inspect-api.js.map +3 -3
- package/dist/approval-handler.runtime.js +47 -10
- package/dist/approval-handler.runtime.js.map +5 -5
- package/dist/channel-plugin-api.js +656 -58
- package/dist/channel-plugin-api.js.map +13 -12
- package/dist/inline/bot-commands-sync.d.ts.map +1 -1
- package/dist/inline/channel.d.ts.map +1 -1
- package/dist/inline/config-schema.d.ts +2 -0
- package/dist/inline/config-schema.d.ts.map +1 -1
- package/dist/inline/doctor.d.ts.map +1 -1
- package/dist/inline/monitor.d.ts.map +1 -1
- package/dist/inline/security.d.ts.map +1 -1
- package/dist/inline/setup-surface.d.ts.map +1 -1
- package/dist/inline/threadreply-command.d.ts +31 -0
- package/dist/inline/threadreply-command.d.ts.map +1 -1
- package/dist/runtime-register-api.js +225 -160
- package/dist/runtime-register-api.js.map +7 -7
- package/dist/setup-plugin-api.js +23 -13
- package/dist/setup-plugin-api.js.map +6 -6
- package/openclaw.plugin.json +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-commands-sync.d.ts","sourceRoot":"","sources":["../../src/inline/bot-commands-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAK9D,OAAO,EAML,KAAK,qBAAqB,EAC3B,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"bot-commands-sync.d.ts","sourceRoot":"","sources":["../../src/inline/bot-commands-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAK9D,OAAO,EAML,KAAK,qBAAqB,EAC3B,MAAM,eAAe,CAAA;AAKtB,KAAK,wBAAwB,GAAG;IAC9B,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC,CAAA;AAiDD,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAI3E;AAED,wBAAgB,wCAAwC,CAAC,MAAM,EAAE;IAC/D,GAAG,EAAE,cAAc,CAAA;IACnB,OAAO,EAAE,qBAAqB,CAAA;CAC/B,GAAG,OAAO,CAOV;AAED,wBAAgB,sCAAsC,CAAC,MAAM,EAAE;IAC7D,GAAG,EAAE,cAAc,CAAA;IACnB,OAAO,EAAE,qBAAqB,CAAA;CAC/B,GAAG,OAAO,CAOV;AA2CD,wBAAsB,wBAAwB,CAAC,MAAM,EAAE;IACrD,GAAG,EAAE,cAAc,CAAA;IACnB,MAAM,CAAC,EAAE,wBAAwB,CAAA;CAClC,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CA0GjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/inline/channel.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAA;AAmBjC,OAAO,EAQL,KAAK,qBAAqB,EAC3B,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/inline/channel.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAA;AAmBjC,OAAO,EAQL,KAAK,qBAAqB,EAC3B,MAAM,eAAe,CAAA;AAwuCtB,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,qBAAqB,CAulBpE,CAAA"}
|
|
@@ -5,6 +5,8 @@ export declare const InlineReplyThreadModeSchema: z.ZodEnum<{
|
|
|
5
5
|
main: "main";
|
|
6
6
|
}>;
|
|
7
7
|
export type InlineReplyThreadMode = z.infer<typeof InlineReplyThreadModeSchema>;
|
|
8
|
+
export declare const INLINE_DEFAULT_GROUP_POLICY: "open";
|
|
9
|
+
export declare const INLINE_DEFAULT_REQUIRE_MENTION = true;
|
|
8
10
|
export declare const InlineAccountSchemaBase: z.ZodObject<{
|
|
9
11
|
name: z.ZodOptional<z.ZodString>;
|
|
10
12
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-schema.d.ts","sourceRoot":"","sources":["../../src/inline/config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAuCvB,eAAO,MAAM,2BAA2B;;;;EAAqC,CAAA;AAC7E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"config-schema.d.ts","sourceRoot":"","sources":["../../src/inline/config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAuCvB,eAAO,MAAM,2BAA2B;;;;EAAqC,CAAA;AAC7E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAsC/E,eAAO,MAAM,2BAA2B,EAAG,MAAe,CAAA;AAC1D,eAAO,MAAM,8BAA8B,OAAO,CAAA;AAqFlD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAuCzB,CAAA;AAEX,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAS9B,CAAA;AAiBF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEvB,CAAA;AAEhB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEtB,CAAA;AAEhB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAc3B,CAAA;AAEJ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAC7D,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AACrE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/inline/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/inline/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAG7D,KAAK,aAAa,GAAG,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAA;AAuDzD,eAAO,MAAM,YAAY,EAAE,aAO1B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monitor.d.ts","sourceRoot":"","sources":["../../src/inline/monitor.ts"],"names":[],"mappings":"AAqEA,OAAO,KAAK,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"monitor.d.ts","sourceRoot":"","sources":["../../src/inline/monitor.ts"],"names":[],"mappings":"AAqEA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,0BAA0B,CAAA;AACpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAEjE,OAAO,EAAsB,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAA;AA6E9E,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;CACpB,CAAA;AAUD,KAAK,UAAU,GAAG,CAAC,KAAK,EAAE;IACxB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,KAAK,IAAI,CAAA;AA6nEV,wBAAsB,qBAAqB,CAAC,MAAM,EAAE;IAClD,GAAG,EAAE,cAAc,CAAA;IACnB,OAAO,EAAE,qBAAqB,CAAA;IAC9B,OAAO,EAAE,UAAU,CAAA;IACnB,cAAc,CAAC,EAAE,qBAAqB,CAAA;IACtC,WAAW,EAAE,WAAW,CAAA;IACxB,GAAG,CAAC,EAAE;QAAE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAA;IAC/H,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAm/E/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/inline/security.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,0BAA0B,CAAA;AAG7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/inline/security.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,0BAA0B,CAAA;AAG7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAO1D,KAAK,qBAAqB,GAAG,WAAW,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;AAwG1F,eAAO,MAAM,qBAAqB,EAAE,qBAuHnC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-surface.d.ts","sourceRoot":"","sources":["../../src/inline/setup-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"setup-surface.d.ts","sourceRoot":"","sources":["../../src/inline/setup-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAmBnE,OAAO,EAA2B,kBAAkB,EAA8B,MAAM,iBAAiB,CAAA;AA4OzG,eAAO,MAAM,iBAAiB,EAAE,kBAqH/B,CAAA;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import type { OpenClawPluginApi, OpenClawPluginCommandDefinition, PluginCommandContext } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
+
type InlineThreadReplyCommandConfigRuntime = Pick<OpenClawPluginApi["runtime"]["config"], "current" | "mutateConfigFile">;
|
|
3
|
+
type InlineBuiltinCommandSpec = {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
acceptsArgs: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const INLINE_THREADREPLY_COMMAND_SPEC: {
|
|
9
|
+
name: string;
|
|
10
|
+
nativeNames: {
|
|
11
|
+
inline: string;
|
|
12
|
+
};
|
|
13
|
+
description: string;
|
|
14
|
+
channels: string[];
|
|
15
|
+
acceptsArgs: true;
|
|
16
|
+
};
|
|
17
|
+
export declare function listInlineBuiltinCommandSpecs(): InlineBuiltinCommandSpec[];
|
|
2
18
|
export declare function handleInlineThreadReplyCommand(api: OpenClawPluginApi, ctx: PluginCommandContext): Promise<{
|
|
3
19
|
text: string;
|
|
4
20
|
channelData?: never;
|
|
@@ -13,5 +29,20 @@ export declare function handleInlineThreadReplyCommand(api: OpenClawPluginApi, c
|
|
|
13
29
|
};
|
|
14
30
|
};
|
|
15
31
|
}>;
|
|
32
|
+
export declare function handleInlineThreadReplyCommandWithConfigRuntime(configRuntime: InlineThreadReplyCommandConfigRuntime, ctx: PluginCommandContext): Promise<{
|
|
33
|
+
text: string;
|
|
34
|
+
channelData?: never;
|
|
35
|
+
} | {
|
|
36
|
+
text: string;
|
|
37
|
+
channelData: {
|
|
38
|
+
inline: {
|
|
39
|
+
buttons: {
|
|
40
|
+
text: string;
|
|
41
|
+
callback_data: string;
|
|
42
|
+
}[][];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
16
46
|
export declare function createInlineThreadReplyCommand(api: OpenClawPluginApi): OpenClawPluginCommandDefinition;
|
|
47
|
+
export {};
|
|
17
48
|
//# sourceMappingURL=threadreply-command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"threadreply-command.d.ts","sourceRoot":"","sources":["../../src/inline/threadreply-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,+BAA+B,EAC/B,oBAAoB,EACrB,MAAM,4CAA4C,CAAA;
|
|
1
|
+
{"version":3,"file":"threadreply-command.d.ts","sourceRoot":"","sources":["../../src/inline/threadreply-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,+BAA+B,EAC/B,oBAAoB,EACrB,MAAM,4CAA4C,CAAA;AAmCnD,KAAK,qCAAqC,GAAG,IAAI,CAC/C,iBAAiB,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACtC,SAAS,GAAG,kBAAkB,CAC/B,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,+BAA+B;;;;;;;;CAS3C,CAAA;AAED,wBAAgB,6BAA6B,IAAI,wBAAwB,EAAE,CAQ1E;AAgRD,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,iBAAiB,EACtB,GAAG,EAAE,oBAAoB;;;;;;;;;;;;;GAG1B;AAED,wBAAsB,+CAA+C,CACnE,aAAa,EAAE,qCAAqC,EACpD,GAAG,EAAE,oBAAoB;;;;;;;;;;;;;GA8F1B;AAED,wBAAgB,8BAA8B,CAC5C,GAAG,EAAE,iBAAiB,GACrB,+BAA+B,CAKjC"}
|
|
@@ -11165,7 +11165,8 @@ class UpdateSidecars$Type extends import_runtime4.MessageType {
|
|
|
11165
11165
|
super("UpdateSidecars", [
|
|
11166
11166
|
{ no: 1, name: "users", kind: "message", repeat: 1, T: () => User },
|
|
11167
11167
|
{ no: 2, name: "chats", kind: "message", repeat: 1, T: () => Chat },
|
|
11168
|
-
{ no: 3, name: "dialogs", kind: "message", repeat: 1, T: () => Dialog }
|
|
11168
|
+
{ no: 3, name: "dialogs", kind: "message", repeat: 1, T: () => Dialog },
|
|
11169
|
+
{ no: 4, name: "spaces", kind: "message", repeat: 1, T: () => Space }
|
|
11169
11170
|
]);
|
|
11170
11171
|
}
|
|
11171
11172
|
create(value) {
|
|
@@ -11173,6 +11174,7 @@ class UpdateSidecars$Type extends import_runtime4.MessageType {
|
|
|
11173
11174
|
message.users = [];
|
|
11174
11175
|
message.chats = [];
|
|
11175
11176
|
message.dialogs = [];
|
|
11177
|
+
message.spaces = [];
|
|
11176
11178
|
if (value !== undefined)
|
|
11177
11179
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
11178
11180
|
return message;
|
|
@@ -11191,6 +11193,9 @@ class UpdateSidecars$Type extends import_runtime4.MessageType {
|
|
|
11191
11193
|
case 3:
|
|
11192
11194
|
message.dialogs.push(Dialog.internalBinaryRead(reader, reader.uint32(), options));
|
|
11193
11195
|
break;
|
|
11196
|
+
case 4:
|
|
11197
|
+
message.spaces.push(Space.internalBinaryRead(reader, reader.uint32(), options));
|
|
11198
|
+
break;
|
|
11194
11199
|
default:
|
|
11195
11200
|
let u = options.readUnknownField;
|
|
11196
11201
|
if (u === "throw")
|
|
@@ -11209,6 +11214,8 @@ class UpdateSidecars$Type extends import_runtime4.MessageType {
|
|
|
11209
11214
|
Chat.internalBinaryWrite(message.chats[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11210
11215
|
for (let i = 0;i < message.dialogs.length; i++)
|
|
11211
11216
|
Dialog.internalBinaryWrite(message.dialogs[i], writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11217
|
+
for (let i = 0;i < message.spaces.length; i++)
|
|
11218
|
+
Space.internalBinaryWrite(message.spaces[i], writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11212
11219
|
let u = options.writeUnknownFields;
|
|
11213
11220
|
if (u !== false)
|
|
11214
11221
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -21029,7 +21036,7 @@ class InlineSdkClient {
|
|
|
21029
21036
|
await this.handleUpdate(update);
|
|
21030
21037
|
}
|
|
21031
21038
|
}
|
|
21032
|
-
async handleUpdate(update) {
|
|
21039
|
+
async handleUpdate(update, options) {
|
|
21033
21040
|
const seq = update.seq ?? 0;
|
|
21034
21041
|
const date = update.date ?? 0n;
|
|
21035
21042
|
switch (update.update.oneofKind) {
|
|
@@ -21161,6 +21168,34 @@ class InlineSdkClient {
|
|
|
21161
21168
|
});
|
|
21162
21169
|
return;
|
|
21163
21170
|
}
|
|
21171
|
+
case "participantAdd": {
|
|
21172
|
+
const payload = update.update.participantAdd;
|
|
21173
|
+
if (options?.source !== "user" && options?.source !== "space") {
|
|
21174
|
+
this.bumpChatSeq(payload.chatId, seq);
|
|
21175
|
+
}
|
|
21176
|
+
await this.eventStream.send({
|
|
21177
|
+
kind: "chat.participant.add",
|
|
21178
|
+
chatId: payload.chatId,
|
|
21179
|
+
...payload.participant ? { participant: payload.participant } : {},
|
|
21180
|
+
seq,
|
|
21181
|
+
date
|
|
21182
|
+
});
|
|
21183
|
+
return;
|
|
21184
|
+
}
|
|
21185
|
+
case "participantDelete": {
|
|
21186
|
+
const payload = update.update.participantDelete;
|
|
21187
|
+
if (options?.source !== "user" && options?.source !== "space") {
|
|
21188
|
+
this.bumpChatSeq(payload.chatId, seq);
|
|
21189
|
+
}
|
|
21190
|
+
await this.eventStream.send({
|
|
21191
|
+
kind: "chat.participant.delete",
|
|
21192
|
+
chatId: payload.chatId,
|
|
21193
|
+
userId: payload.userId,
|
|
21194
|
+
seq,
|
|
21195
|
+
date
|
|
21196
|
+
});
|
|
21197
|
+
return;
|
|
21198
|
+
}
|
|
21164
21199
|
case "messageActionInvoked": {
|
|
21165
21200
|
const payload = update.update.messageActionInvoked;
|
|
21166
21201
|
if (this.shouldSkipUserSeq(seq)) {
|
|
@@ -21261,14 +21296,14 @@ class InlineSdkClient {
|
|
|
21261
21296
|
}
|
|
21262
21297
|
}
|
|
21263
21298
|
requestCatchUpUser() {
|
|
21264
|
-
const lastUserSeq = this.state.lastUserSeq
|
|
21265
|
-
if (lastUserSeq
|
|
21299
|
+
const lastUserSeq = this.state.lastUserSeq;
|
|
21300
|
+
if (lastUserSeq == null && !this.options.catchUpUserFromStart) {
|
|
21266
21301
|
return;
|
|
21267
21302
|
}
|
|
21268
21303
|
if (this.userCatchUpInFlight) {
|
|
21269
21304
|
return;
|
|
21270
21305
|
}
|
|
21271
|
-
this.userCatchUpInFlight = this.doCatchUpUser(lastUserSeq).catch((error) => {
|
|
21306
|
+
this.userCatchUpInFlight = this.doCatchUpUser(lastUserSeq ?? 0).catch((error) => {
|
|
21272
21307
|
this.log.warn?.("GET_UPDATES user catch-up failed; continuing live delivery", {
|
|
21273
21308
|
error: extractErrorMessage(error)
|
|
21274
21309
|
});
|
|
@@ -21309,7 +21344,7 @@ class InlineSdkClient {
|
|
|
21309
21344
|
return;
|
|
21310
21345
|
}
|
|
21311
21346
|
for (const update of payload.updates) {
|
|
21312
|
-
await this.handleUpdate(update);
|
|
21347
|
+
await this.handleUpdate(update, { source: "user" });
|
|
21313
21348
|
}
|
|
21314
21349
|
this.bumpUserSeq(deliveredSeq);
|
|
21315
21350
|
if (payload.date !== 0n) {
|
|
@@ -21408,7 +21443,7 @@ class InlineSdkClient {
|
|
|
21408
21443
|
}
|
|
21409
21444
|
this.bumpChatSeq(chatId, deliveredSeq);
|
|
21410
21445
|
for (const update of payload.updates) {
|
|
21411
|
-
await this.handleUpdate(update);
|
|
21446
|
+
await this.handleUpdate(update, { source: "chat" });
|
|
21412
21447
|
}
|
|
21413
21448
|
if (payload.date !== 0n) {
|
|
21414
21449
|
this.state.dateCursor = payload.date;
|
|
@@ -21510,7 +21545,7 @@ class InlineSdkClient {
|
|
|
21510
21545
|
}
|
|
21511
21546
|
this.bumpSpaceSeq(spaceId, deliveredSeq);
|
|
21512
21547
|
for (const update of payload.updates) {
|
|
21513
|
-
await this.handleUpdate(update);
|
|
21548
|
+
await this.handleUpdate(update, { source: "space" });
|
|
21514
21549
|
}
|
|
21515
21550
|
if (payload.date !== 0n) {
|
|
21516
21551
|
this.state.dateCursor = payload.date;
|
|
@@ -36445,6 +36480,8 @@ var InlineExecApprovalsSchema = exports_external.object({
|
|
|
36445
36480
|
var InlineReactionNotificationsSchema = exports_external.enum(["off", "own", "all", "allowlist"]);
|
|
36446
36481
|
var InlineStreamingModeSchema = exports_external.enum(["off", "partial", "block", "progress"]);
|
|
36447
36482
|
var InlineStreamingCommandTextSchema = exports_external.enum(["raw", "status"]);
|
|
36483
|
+
var INLINE_DEFAULT_GROUP_POLICY = "open";
|
|
36484
|
+
var INLINE_DEFAULT_REQUIRE_MENTION = true;
|
|
36448
36485
|
var InlineStreamingChunkSchema = exports_external.object({
|
|
36449
36486
|
minChars: exports_external.number().int().positive().optional(),
|
|
36450
36487
|
maxChars: exports_external.number().int().positive().optional(),
|
|
@@ -36516,7 +36553,7 @@ var InlineAccountSchemaBase = exports_external.object({
|
|
|
36516
36553
|
defaultTo: InlineTargetSchema.optional(),
|
|
36517
36554
|
systemPrompt: exports_external.string().optional(),
|
|
36518
36555
|
groupAllowFrom: exports_external.array(InlineAllowEntrySchema).optional(),
|
|
36519
|
-
groupPolicy: GroupPolicySchema.optional().default(
|
|
36556
|
+
groupPolicy: GroupPolicySchema.optional().default(INLINE_DEFAULT_GROUP_POLICY),
|
|
36520
36557
|
groups: exports_external.record(exports_external.string(), InlineGroupSchema.optional()).optional(),
|
|
36521
36558
|
requireMention: exports_external.boolean().optional(),
|
|
36522
36559
|
replyThreadMode: InlineReplyThreadModeSchema.optional(),
|
|
@@ -38867,148 +38904,6 @@ import { listNativeCommandSpecsForConfig } from "openclaw/plugin-sdk/native-comm
|
|
|
38867
38904
|
import { getPluginCommandSpecs } from "openclaw/plugin-sdk/plugin-runtime";
|
|
38868
38905
|
import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
|
|
38869
38906
|
import { listSkillCommandsForAgents } from "openclaw/plugin-sdk/skill-commands-runtime";
|
|
38870
|
-
var INLINE_COMMAND_NAME_RE = /^[a-z0-9_]{1,32}$/;
|
|
38871
|
-
var INLINE_COMMAND_LIMIT = 100;
|
|
38872
|
-
var INLINE_COMMAND_DESCRIPTION_LIMIT = 256;
|
|
38873
|
-
var INLINE_NATIVE_COMMAND_PROVIDER = "inline";
|
|
38874
|
-
function normalizeDynamicCommandName(raw) {
|
|
38875
|
-
const trimmed = raw.trim().toLowerCase();
|
|
38876
|
-
const withoutSlash = trimmed.startsWith("/") ? trimmed.slice(1) : trimmed;
|
|
38877
|
-
return withoutSlash.trim();
|
|
38878
|
-
}
|
|
38879
|
-
function appendUniqueCommand(out, seen, command, description, logger) {
|
|
38880
|
-
const normalized = normalizeDynamicCommandName(command);
|
|
38881
|
-
if (!INLINE_COMMAND_NAME_RE.test(normalized) || seen.has(normalized))
|
|
38882
|
-
return;
|
|
38883
|
-
const rawDescription = adaptInlineVisibleCopy(description).trim();
|
|
38884
|
-
const trimmedDescription = rawDescription.length > INLINE_COMMAND_DESCRIPTION_LIMIT ? rawDescription.slice(0, INLINE_COMMAND_DESCRIPTION_LIMIT).trimEnd() : rawDescription;
|
|
38885
|
-
if (!trimmedDescription)
|
|
38886
|
-
return;
|
|
38887
|
-
if (trimmedDescription.length !== rawDescription.length) {
|
|
38888
|
-
logger?.warn?.(`[inline] bot command sync truncated description for /${normalized} to ${INLINE_COMMAND_DESCRIPTION_LIMIT} characters`);
|
|
38889
|
-
}
|
|
38890
|
-
seen.add(normalized);
|
|
38891
|
-
out.push({ command: normalized, description: trimmedDescription });
|
|
38892
|
-
}
|
|
38893
|
-
function shouldSyncInlineNativeCommandsForAccount(params) {
|
|
38894
|
-
const effective = params.account.config.commands?.native ?? params.cfg.commands?.native ?? "auto";
|
|
38895
|
-
return effective !== false;
|
|
38896
|
-
}
|
|
38897
|
-
function shouldSyncInlineNativeSkillsForAccount(params) {
|
|
38898
|
-
const effective = params.account.config.commands?.nativeSkills ?? params.cfg.commands?.nativeSkills ?? "auto";
|
|
38899
|
-
return effective !== false;
|
|
38900
|
-
}
|
|
38901
|
-
async function buildInlineNativeCommandsForConfig(params) {
|
|
38902
|
-
const route = shouldSyncInlineNativeSkillsForAccount({ cfg: params.cfg, account: params.account }) ? resolveAgentRoute({
|
|
38903
|
-
cfg: params.cfg,
|
|
38904
|
-
channel: INLINE_NATIVE_COMMAND_PROVIDER,
|
|
38905
|
-
accountId: params.account.accountId
|
|
38906
|
-
}) : null;
|
|
38907
|
-
const skillCommands = route ? listSkillCommandsForAgents({
|
|
38908
|
-
cfg: params.cfg,
|
|
38909
|
-
agentIds: [route.agentId]
|
|
38910
|
-
}) : [];
|
|
38911
|
-
const nativeSpecs = listNativeCommandSpecsForConfig(params.cfg, {
|
|
38912
|
-
skillCommands,
|
|
38913
|
-
provider: INLINE_NATIVE_COMMAND_PROVIDER
|
|
38914
|
-
});
|
|
38915
|
-
const pluginSpecs = getPluginCommandSpecs("inline", { config: params.cfg });
|
|
38916
|
-
const seen = new Set;
|
|
38917
|
-
const resolved = [];
|
|
38918
|
-
for (const spec of nativeSpecs) {
|
|
38919
|
-
appendUniqueCommand(resolved, seen, spec.name, spec.description, params.logger);
|
|
38920
|
-
}
|
|
38921
|
-
for (const spec of pluginSpecs) {
|
|
38922
|
-
appendUniqueCommand(resolved, seen, spec.name, spec.description, params.logger);
|
|
38923
|
-
}
|
|
38924
|
-
return resolved;
|
|
38925
|
-
}
|
|
38926
|
-
async function syncInlineNativeCommands(params) {
|
|
38927
|
-
const accountIds = listInlineAccountIds(params.cfg);
|
|
38928
|
-
if (!accountIds.length) {
|
|
38929
|
-
params.logger?.info?.("[inline] bot command sync disabled");
|
|
38930
|
-
return { attempted: 0, synced: 0, failed: 0 };
|
|
38931
|
-
}
|
|
38932
|
-
let attempted = 0;
|
|
38933
|
-
let synced = 0;
|
|
38934
|
-
let failed = 0;
|
|
38935
|
-
for (const accountId of accountIds) {
|
|
38936
|
-
const account = resolveInlineAccount({ cfg: params.cfg, accountId });
|
|
38937
|
-
const nativeEnabled = shouldSyncInlineNativeCommandsForAccount({ cfg: params.cfg, account });
|
|
38938
|
-
attempted += 1;
|
|
38939
|
-
if (!account.enabled || !account.configured || !account.baseUrl) {
|
|
38940
|
-
continue;
|
|
38941
|
-
}
|
|
38942
|
-
const ownerAccountId = findInlineTokenOwnerAccountId({
|
|
38943
|
-
cfg: params.cfg,
|
|
38944
|
-
accountId: account.accountId
|
|
38945
|
-
});
|
|
38946
|
-
if (ownerAccountId) {
|
|
38947
|
-
failed += 1;
|
|
38948
|
-
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": ${formatDuplicateInlineTokenReason({
|
|
38949
|
-
accountId: account.accountId,
|
|
38950
|
-
ownerAccountId
|
|
38951
|
-
})}`);
|
|
38952
|
-
continue;
|
|
38953
|
-
}
|
|
38954
|
-
let token;
|
|
38955
|
-
try {
|
|
38956
|
-
token = await resolveInlineToken(account);
|
|
38957
|
-
} catch (err) {
|
|
38958
|
-
failed += 1;
|
|
38959
|
-
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": ${String(err)}`);
|
|
38960
|
-
continue;
|
|
38961
|
-
}
|
|
38962
|
-
if (!nativeEnabled) {
|
|
38963
|
-
try {
|
|
38964
|
-
await callInlineBotApi({
|
|
38965
|
-
baseUrl: account.baseUrl,
|
|
38966
|
-
token,
|
|
38967
|
-
methodName: "deleteMyCommands",
|
|
38968
|
-
method: "POST"
|
|
38969
|
-
});
|
|
38970
|
-
synced += 1;
|
|
38971
|
-
params.logger?.info?.(`[inline] bot commands cleared for account "${account.accountId}"`);
|
|
38972
|
-
} catch (err) {
|
|
38973
|
-
failed += 1;
|
|
38974
|
-
params.logger?.warn?.(`[inline] bot command clear failed for account "${account.accountId}": ${String(err)}`);
|
|
38975
|
-
}
|
|
38976
|
-
continue;
|
|
38977
|
-
}
|
|
38978
|
-
const allCommands = await buildInlineNativeCommandsForConfig({
|
|
38979
|
-
cfg: params.cfg,
|
|
38980
|
-
account,
|
|
38981
|
-
...params.logger ? { logger: params.logger } : {}
|
|
38982
|
-
});
|
|
38983
|
-
const commands = allCommands.slice(0, INLINE_COMMAND_LIMIT);
|
|
38984
|
-
if (allCommands.length > INLINE_COMMAND_LIMIT) {
|
|
38985
|
-
params.logger?.warn?.(`[inline] bot command sync truncating ${allCommands.length} commands to ${INLINE_COMMAND_LIMIT}`);
|
|
38986
|
-
}
|
|
38987
|
-
if (commands.length === 0) {
|
|
38988
|
-
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": no valid commands resolved`);
|
|
38989
|
-
continue;
|
|
38990
|
-
}
|
|
38991
|
-
try {
|
|
38992
|
-
await callInlineBotApi({
|
|
38993
|
-
baseUrl: account.baseUrl,
|
|
38994
|
-
token,
|
|
38995
|
-
methodName: "setMyCommands",
|
|
38996
|
-
method: "POST",
|
|
38997
|
-
body: { commands }
|
|
38998
|
-
});
|
|
38999
|
-
synced += 1;
|
|
39000
|
-
params.logger?.info?.(`[inline] bot commands synced for account "${account.accountId}" (${commands.length} command${commands.length === 1 ? "" : "s"})`);
|
|
39001
|
-
} catch (err) {
|
|
39002
|
-
failed += 1;
|
|
39003
|
-
params.logger?.warn?.(`[inline] bot command sync failed for account "${account.accountId}": ${String(err)}`);
|
|
39004
|
-
}
|
|
39005
|
-
}
|
|
39006
|
-
return {
|
|
39007
|
-
attempted,
|
|
39008
|
-
synced,
|
|
39009
|
-
failed
|
|
39010
|
-
};
|
|
39011
|
-
}
|
|
39012
38907
|
|
|
39013
38908
|
// src/inline/policy.ts
|
|
39014
38909
|
function normalizeAccountId2(raw) {
|
|
@@ -39188,6 +39083,23 @@ var MODE_LABELS = {
|
|
|
39188
39083
|
main: "main"
|
|
39189
39084
|
};
|
|
39190
39085
|
var DEFAULT_REPLY_THREAD_AUTO_CREATE_MIN_MESSAGES = 50;
|
|
39086
|
+
var INLINE_THREADREPLY_NATIVE_NAME = "threadreply";
|
|
39087
|
+
var INLINE_THREADREPLY_COMMAND_SPEC = {
|
|
39088
|
+
name: "threadreply",
|
|
39089
|
+
nativeNames: { inline: INLINE_THREADREPLY_NATIVE_NAME },
|
|
39090
|
+
description: "Set Inline reply-thread mode for this chat.",
|
|
39091
|
+
channels: ["inline"],
|
|
39092
|
+
acceptsArgs: true
|
|
39093
|
+
};
|
|
39094
|
+
function listInlineBuiltinCommandSpecs() {
|
|
39095
|
+
return [
|
|
39096
|
+
{
|
|
39097
|
+
name: INLINE_THREADREPLY_COMMAND_SPEC.nativeNames.inline ?? INLINE_THREADREPLY_COMMAND_SPEC.name,
|
|
39098
|
+
description: INLINE_THREADREPLY_COMMAND_SPEC.description,
|
|
39099
|
+
acceptsArgs: INLINE_THREADREPLY_COMMAND_SPEC.acceptsArgs
|
|
39100
|
+
}
|
|
39101
|
+
];
|
|
39102
|
+
}
|
|
39191
39103
|
function isRecord3(value) {
|
|
39192
39104
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
39193
39105
|
}
|
|
@@ -39385,6 +39297,9 @@ function normalizeAction(args) {
|
|
|
39385
39297
|
return normalizeMode(normalized);
|
|
39386
39298
|
}
|
|
39387
39299
|
async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
39300
|
+
return await handleInlineThreadReplyCommandWithConfigRuntime(api2.runtime.config, ctx);
|
|
39301
|
+
}
|
|
39302
|
+
async function handleInlineThreadReplyCommandWithConfigRuntime(configRuntime, ctx) {
|
|
39388
39303
|
if (!ctx.isAuthorizedSender) {
|
|
39389
39304
|
return { text: "This command requires authorization." };
|
|
39390
39305
|
}
|
|
@@ -39392,7 +39307,7 @@ async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
|
39392
39307
|
if (!groupId) {
|
|
39393
39308
|
return { text: "/threadreply is only available in Inline group chats." };
|
|
39394
39309
|
}
|
|
39395
|
-
const currentConfig =
|
|
39310
|
+
const currentConfig = configRuntime.current();
|
|
39396
39311
|
const args = ctx.args?.trim() ?? "";
|
|
39397
39312
|
const [first = "", second, ...rest] = args.split(/\s+/).filter(Boolean);
|
|
39398
39313
|
if (["min", "minimum", "threshold", "limit"].includes(first.trim().toLowerCase())) {
|
|
@@ -39400,7 +39315,7 @@ async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
|
39400
39315
|
if (minMessages == null || rest.length > 0) {
|
|
39401
39316
|
return { text: "Usage: /threadreply min <0-or-greater>|inherit" };
|
|
39402
39317
|
}
|
|
39403
|
-
const committed2 = await
|
|
39318
|
+
const committed2 = await configRuntime.mutateConfigFile({
|
|
39404
39319
|
afterWrite: { mode: "auto" },
|
|
39405
39320
|
mutate: (draft) => {
|
|
39406
39321
|
setGroupMinMessages({
|
|
@@ -39455,7 +39370,7 @@ async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
|
39455
39370
|
`)
|
|
39456
39371
|
};
|
|
39457
39372
|
}
|
|
39458
|
-
const committed = await
|
|
39373
|
+
const committed = await configRuntime.mutateConfigFile({
|
|
39459
39374
|
afterWrite: { mode: "auto" },
|
|
39460
39375
|
mutate: (draft) => {
|
|
39461
39376
|
setGroupMode({
|
|
@@ -39477,15 +39392,165 @@ async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
|
39477
39392
|
}
|
|
39478
39393
|
function createInlineThreadReplyCommand(api2) {
|
|
39479
39394
|
return {
|
|
39480
|
-
|
|
39481
|
-
nativeNames: { inline: "threadreply" },
|
|
39482
|
-
description: "Set Inline reply-thread mode for this chat.",
|
|
39483
|
-
channels: ["inline"],
|
|
39484
|
-
acceptsArgs: true,
|
|
39395
|
+
...INLINE_THREADREPLY_COMMAND_SPEC,
|
|
39485
39396
|
handler: async (ctx) => await handleInlineThreadReplyCommand(api2, ctx)
|
|
39486
39397
|
};
|
|
39487
39398
|
}
|
|
39488
39399
|
|
|
39400
|
+
// src/inline/bot-commands-sync.ts
|
|
39401
|
+
var INLINE_COMMAND_NAME_RE = /^[a-z0-9_]{1,32}$/;
|
|
39402
|
+
var INLINE_COMMAND_LIMIT = 100;
|
|
39403
|
+
var INLINE_COMMAND_DESCRIPTION_LIMIT = 256;
|
|
39404
|
+
var INLINE_NATIVE_COMMAND_PROVIDER = "inline";
|
|
39405
|
+
function resolveInlineChannelCommands(cfg) {
|
|
39406
|
+
const inline = cfg.channels?.inline;
|
|
39407
|
+
if (typeof inline !== "object" || inline === null || Array.isArray(inline))
|
|
39408
|
+
return;
|
|
39409
|
+
const commands = inline.commands;
|
|
39410
|
+
return typeof commands === "object" && commands !== null && !Array.isArray(commands) ? commands : undefined;
|
|
39411
|
+
}
|
|
39412
|
+
function normalizeDynamicCommandName(raw) {
|
|
39413
|
+
const trimmed = raw.trim().toLowerCase();
|
|
39414
|
+
const withoutSlash = trimmed.startsWith("/") ? trimmed.slice(1) : trimmed;
|
|
39415
|
+
return withoutSlash.trim();
|
|
39416
|
+
}
|
|
39417
|
+
function appendUniqueCommand(out, seen, command, description, logger) {
|
|
39418
|
+
const normalized = normalizeDynamicCommandName(command);
|
|
39419
|
+
if (!INLINE_COMMAND_NAME_RE.test(normalized) || seen.has(normalized))
|
|
39420
|
+
return;
|
|
39421
|
+
const rawDescription = adaptInlineVisibleCopy(description).trim();
|
|
39422
|
+
const trimmedDescription = rawDescription.length > INLINE_COMMAND_DESCRIPTION_LIMIT ? rawDescription.slice(0, INLINE_COMMAND_DESCRIPTION_LIMIT).trimEnd() : rawDescription;
|
|
39423
|
+
if (!trimmedDescription)
|
|
39424
|
+
return;
|
|
39425
|
+
if (trimmedDescription.length !== rawDescription.length) {
|
|
39426
|
+
logger?.warn?.(`[inline] bot command sync truncated description for /${normalized} to ${INLINE_COMMAND_DESCRIPTION_LIMIT} characters`);
|
|
39427
|
+
}
|
|
39428
|
+
seen.add(normalized);
|
|
39429
|
+
out.push({ command: normalized, description: trimmedDescription });
|
|
39430
|
+
}
|
|
39431
|
+
function shouldSyncInlineNativeCommandsForAccount(params) {
|
|
39432
|
+
const effective = params.account.config.commands?.native ?? resolveInlineChannelCommands(params.cfg)?.native ?? params.cfg.commands?.native ?? "auto";
|
|
39433
|
+
return effective !== false;
|
|
39434
|
+
}
|
|
39435
|
+
function shouldSyncInlineNativeSkillsForAccount(params) {
|
|
39436
|
+
const effective = params.account.config.commands?.nativeSkills ?? resolveInlineChannelCommands(params.cfg)?.nativeSkills ?? params.cfg.commands?.nativeSkills ?? "auto";
|
|
39437
|
+
return effective !== false;
|
|
39438
|
+
}
|
|
39439
|
+
async function buildInlineNativeCommandsForConfig(params) {
|
|
39440
|
+
const route = shouldSyncInlineNativeSkillsForAccount({ cfg: params.cfg, account: params.account }) ? resolveAgentRoute({
|
|
39441
|
+
cfg: params.cfg,
|
|
39442
|
+
channel: INLINE_NATIVE_COMMAND_PROVIDER,
|
|
39443
|
+
accountId: params.account.accountId
|
|
39444
|
+
}) : null;
|
|
39445
|
+
const skillCommands = route ? listSkillCommandsForAgents({
|
|
39446
|
+
cfg: params.cfg,
|
|
39447
|
+
agentIds: [route.agentId]
|
|
39448
|
+
}) : [];
|
|
39449
|
+
const nativeSpecs = listNativeCommandSpecsForConfig(params.cfg, {
|
|
39450
|
+
skillCommands,
|
|
39451
|
+
provider: INLINE_NATIVE_COMMAND_PROVIDER
|
|
39452
|
+
});
|
|
39453
|
+
const pluginSpecs = [
|
|
39454
|
+
...getPluginCommandSpecs("inline", { config: params.cfg }),
|
|
39455
|
+
...listInlineBuiltinCommandSpecs()
|
|
39456
|
+
];
|
|
39457
|
+
const seen = new Set;
|
|
39458
|
+
const resolved = [];
|
|
39459
|
+
for (const spec of nativeSpecs) {
|
|
39460
|
+
appendUniqueCommand(resolved, seen, spec.name, spec.description, params.logger);
|
|
39461
|
+
}
|
|
39462
|
+
for (const spec of pluginSpecs) {
|
|
39463
|
+
appendUniqueCommand(resolved, seen, spec.name, spec.description, params.logger);
|
|
39464
|
+
}
|
|
39465
|
+
return resolved;
|
|
39466
|
+
}
|
|
39467
|
+
async function syncInlineNativeCommands(params) {
|
|
39468
|
+
const accountIds = listInlineAccountIds(params.cfg);
|
|
39469
|
+
if (!accountIds.length) {
|
|
39470
|
+
params.logger?.info?.("[inline] bot command sync disabled");
|
|
39471
|
+
return { attempted: 0, synced: 0, failed: 0 };
|
|
39472
|
+
}
|
|
39473
|
+
let attempted = 0;
|
|
39474
|
+
let synced = 0;
|
|
39475
|
+
let failed = 0;
|
|
39476
|
+
for (const accountId of accountIds) {
|
|
39477
|
+
const account = resolveInlineAccount({ cfg: params.cfg, accountId });
|
|
39478
|
+
const nativeEnabled = shouldSyncInlineNativeCommandsForAccount({ cfg: params.cfg, account });
|
|
39479
|
+
attempted += 1;
|
|
39480
|
+
if (!account.enabled || !account.configured || !account.baseUrl) {
|
|
39481
|
+
continue;
|
|
39482
|
+
}
|
|
39483
|
+
const ownerAccountId = findInlineTokenOwnerAccountId({
|
|
39484
|
+
cfg: params.cfg,
|
|
39485
|
+
accountId: account.accountId
|
|
39486
|
+
});
|
|
39487
|
+
if (ownerAccountId) {
|
|
39488
|
+
failed += 1;
|
|
39489
|
+
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": ${formatDuplicateInlineTokenReason({
|
|
39490
|
+
accountId: account.accountId,
|
|
39491
|
+
ownerAccountId
|
|
39492
|
+
})}`);
|
|
39493
|
+
continue;
|
|
39494
|
+
}
|
|
39495
|
+
let token;
|
|
39496
|
+
try {
|
|
39497
|
+
token = await resolveInlineToken(account);
|
|
39498
|
+
} catch (err) {
|
|
39499
|
+
failed += 1;
|
|
39500
|
+
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": ${String(err)}`);
|
|
39501
|
+
continue;
|
|
39502
|
+
}
|
|
39503
|
+
if (!nativeEnabled) {
|
|
39504
|
+
try {
|
|
39505
|
+
await callInlineBotApi({
|
|
39506
|
+
baseUrl: account.baseUrl,
|
|
39507
|
+
token,
|
|
39508
|
+
methodName: "deleteMyCommands",
|
|
39509
|
+
method: "POST"
|
|
39510
|
+
});
|
|
39511
|
+
synced += 1;
|
|
39512
|
+
params.logger?.info?.(`[inline] bot commands cleared for account "${account.accountId}"`);
|
|
39513
|
+
} catch (err) {
|
|
39514
|
+
failed += 1;
|
|
39515
|
+
params.logger?.warn?.(`[inline] bot command clear failed for account "${account.accountId}": ${String(err)}`);
|
|
39516
|
+
}
|
|
39517
|
+
continue;
|
|
39518
|
+
}
|
|
39519
|
+
const allCommands = await buildInlineNativeCommandsForConfig({
|
|
39520
|
+
cfg: params.cfg,
|
|
39521
|
+
account,
|
|
39522
|
+
...params.logger ? { logger: params.logger } : {}
|
|
39523
|
+
});
|
|
39524
|
+
const commands = allCommands.slice(0, INLINE_COMMAND_LIMIT);
|
|
39525
|
+
if (allCommands.length > INLINE_COMMAND_LIMIT) {
|
|
39526
|
+
params.logger?.warn?.(`[inline] bot command sync truncating ${allCommands.length} commands to ${INLINE_COMMAND_LIMIT}`);
|
|
39527
|
+
}
|
|
39528
|
+
if (commands.length === 0) {
|
|
39529
|
+
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": no valid commands resolved`);
|
|
39530
|
+
continue;
|
|
39531
|
+
}
|
|
39532
|
+
try {
|
|
39533
|
+
await callInlineBotApi({
|
|
39534
|
+
baseUrl: account.baseUrl,
|
|
39535
|
+
token,
|
|
39536
|
+
methodName: "setMyCommands",
|
|
39537
|
+
method: "POST",
|
|
39538
|
+
body: { commands }
|
|
39539
|
+
});
|
|
39540
|
+
synced += 1;
|
|
39541
|
+
params.logger?.info?.(`[inline] bot commands synced for account "${account.accountId}" (${commands.length} command${commands.length === 1 ? "" : "s"})`);
|
|
39542
|
+
} catch (err) {
|
|
39543
|
+
failed += 1;
|
|
39544
|
+
params.logger?.warn?.(`[inline] bot command sync failed for account "${account.accountId}": ${String(err)}`);
|
|
39545
|
+
}
|
|
39546
|
+
}
|
|
39547
|
+
return {
|
|
39548
|
+
attempted,
|
|
39549
|
+
synced,
|
|
39550
|
+
failed
|
|
39551
|
+
};
|
|
39552
|
+
}
|
|
39553
|
+
|
|
39489
39554
|
// src/runtime-register-api.ts
|
|
39490
39555
|
function registerInlinePluginFull(api2) {
|
|
39491
39556
|
api2.registerTool((ctx) => createInlineMembersTool(ctx), {
|
|
@@ -39534,5 +39599,5 @@ export {
|
|
|
39534
39599
|
registerInlinePluginFull
|
|
39535
39600
|
};
|
|
39536
39601
|
|
|
39537
|
-
//# debugId=
|
|
39602
|
+
//# debugId=5BA7B51393DC41BD64756E2164756E21
|
|
39538
39603
|
//# sourceMappingURL=runtime-register-api.js.map
|