@inline-openclaw/inline 0.0.36 → 0.0.38
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/README.md +1 -1
- package/dist/approval-handler.runtime.js +8 -2
- package/dist/approval-handler.runtime.js.map +3 -3
- package/dist/channel-plugin-api.js +325 -20
- package/dist/channel-plugin-api.js.map +7 -5
- package/dist/inline/bot-commands-sync.d.ts +9 -0
- package/dist/inline/bot-commands-sync.d.ts.map +1 -1
- package/dist/inline/monitor.d.ts.map +1 -1
- package/dist/runtime-register-api.js +36 -14
- package/dist/runtime-register-api.js.map +4 -4
- package/package.json +1 -1
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
|
|
2
|
+
import { type ResolvedInlineAccount } from "./accounts.js";
|
|
2
3
|
type InlineCommandsSyncLogger = {
|
|
3
4
|
info?: (message: string) => void;
|
|
4
5
|
warn?: (message: string) => void;
|
|
5
6
|
};
|
|
6
7
|
export declare function shouldSyncInlineNativeCommands(cfg: OpenClawConfig): boolean;
|
|
8
|
+
export declare function shouldSyncInlineNativeCommandsForAccount(params: {
|
|
9
|
+
cfg: OpenClawConfig;
|
|
10
|
+
account: ResolvedInlineAccount;
|
|
11
|
+
}): boolean;
|
|
12
|
+
export declare function shouldSyncInlineNativeSkillsForAccount(params: {
|
|
13
|
+
cfg: OpenClawConfig;
|
|
14
|
+
account: ResolvedInlineAccount;
|
|
15
|
+
}): boolean;
|
|
7
16
|
export declare function syncInlineNativeCommands(params: {
|
|
8
17
|
cfg: OpenClawConfig;
|
|
9
18
|
logger?: InlineCommandsSyncLogger;
|
|
@@ -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;
|
|
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;AAItB,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;AAqCD,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAM3E;AAED,wBAAgB,wCAAwC,CAAC,MAAM,EAAE;IAC/D,GAAG,EAAE,cAAc,CAAA;IACnB,OAAO,EAAE,qBAAqB,CAAA;CAC/B,GAAG,OAAO,CAGV;AAED,wBAAgB,sCAAsC,CAAC,MAAM,EAAE;IAC7D,GAAG,EAAE,cAAc,CAAA;IACnB,OAAO,EAAE,qBAAqB,CAAA;CAC/B,GAAG,OAAO,CAGV;AAwCD,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":"monitor.d.ts","sourceRoot":"","sources":["../../src/inline/monitor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"monitor.d.ts","sourceRoot":"","sources":["../../src/inline/monitor.ts"],"names":[],"mappings":"AAwDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA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CA40D/B"}
|
|
@@ -11297,7 +11297,8 @@ class UpdateDialogOrderInput$Type extends import_runtime4.MessageType {
|
|
|
11297
11297
|
super("UpdateDialogOrderInput", [
|
|
11298
11298
|
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
|
|
11299
11299
|
{ no: 2, name: "order", kind: "scalar", opt: true, T: 9 },
|
|
11300
|
-
{ no: 3, name: "pinned_order", kind: "scalar", opt: true, T: 9 }
|
|
11300
|
+
{ no: 3, name: "pinned_order", kind: "scalar", opt: true, T: 9 },
|
|
11301
|
+
{ no: 4, name: "pinned", kind: "scalar", opt: true, T: 8 }
|
|
11301
11302
|
]);
|
|
11302
11303
|
}
|
|
11303
11304
|
create(value) {
|
|
@@ -11320,6 +11321,9 @@ class UpdateDialogOrderInput$Type extends import_runtime4.MessageType {
|
|
|
11320
11321
|
case 3:
|
|
11321
11322
|
message.pinnedOrder = reader.string();
|
|
11322
11323
|
break;
|
|
11324
|
+
case 4:
|
|
11325
|
+
message.pinned = reader.bool();
|
|
11326
|
+
break;
|
|
11323
11327
|
default:
|
|
11324
11328
|
let u = options.readUnknownField;
|
|
11325
11329
|
if (u === "throw")
|
|
@@ -11338,6 +11342,8 @@ class UpdateDialogOrderInput$Type extends import_runtime4.MessageType {
|
|
|
11338
11342
|
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.order);
|
|
11339
11343
|
if (message.pinnedOrder !== undefined)
|
|
11340
11344
|
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.pinnedOrder);
|
|
11345
|
+
if (message.pinned !== undefined)
|
|
11346
|
+
writer.tag(4, import_runtime.WireType.Varint).bool(message.pinned);
|
|
11341
11347
|
let u = options.writeUnknownFields;
|
|
11342
11348
|
if (u !== false)
|
|
11343
11349
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -36915,21 +36921,19 @@ function appendUniqueCommand(out, seen, command, description, logger) {
|
|
|
36915
36921
|
seen.add(normalized);
|
|
36916
36922
|
out.push({ command: normalized, description: trimmedDescription });
|
|
36917
36923
|
}
|
|
36918
|
-
function
|
|
36919
|
-
const
|
|
36920
|
-
const effective = inlineNativeSetting ?? cfg.commands?.native ?? "auto";
|
|
36924
|
+
function shouldSyncInlineNativeCommandsForAccount(params) {
|
|
36925
|
+
const effective = params.account.config.commands?.native ?? params.cfg.commands?.native ?? "auto";
|
|
36921
36926
|
return effective !== false;
|
|
36922
36927
|
}
|
|
36923
|
-
function
|
|
36924
|
-
const
|
|
36925
|
-
const effective = inlineNativeSkillsSetting ?? cfg.commands?.nativeSkills ?? "auto";
|
|
36928
|
+
function shouldSyncInlineNativeSkillsForAccount(params) {
|
|
36929
|
+
const effective = params.account.config.commands?.nativeSkills ?? params.cfg.commands?.nativeSkills ?? "auto";
|
|
36926
36930
|
return effective !== false;
|
|
36927
36931
|
}
|
|
36928
36932
|
async function buildInlineNativeCommandsForConfig(params) {
|
|
36929
|
-
const route =
|
|
36933
|
+
const route = shouldSyncInlineNativeSkillsForAccount({ cfg: params.cfg, account: params.account }) ? resolveAgentRoute({
|
|
36930
36934
|
cfg: params.cfg,
|
|
36931
36935
|
channel: INLINE_NATIVE_COMMAND_PROVIDER,
|
|
36932
|
-
accountId: params.accountId
|
|
36936
|
+
accountId: params.account.accountId
|
|
36933
36937
|
}) : null;
|
|
36934
36938
|
const skillCommands = route ? listSkillCommandsForAgents({
|
|
36935
36939
|
cfg: params.cfg,
|
|
@@ -36952,15 +36956,17 @@ async function buildInlineNativeCommandsForConfig(params) {
|
|
|
36952
36956
|
}
|
|
36953
36957
|
async function syncInlineNativeCommands(params) {
|
|
36954
36958
|
const accountIds = listInlineAccountIds(params.cfg);
|
|
36955
|
-
|
|
36956
|
-
if (!nativeEnabled) {
|
|
36959
|
+
if (!accountIds.length) {
|
|
36957
36960
|
params.logger?.info?.("[inline] bot command sync disabled");
|
|
36958
36961
|
return { attempted: 0, synced: 0, failed: 0 };
|
|
36959
36962
|
}
|
|
36963
|
+
let attempted = 0;
|
|
36960
36964
|
let synced = 0;
|
|
36961
36965
|
let failed = 0;
|
|
36962
36966
|
for (const accountId of accountIds) {
|
|
36963
36967
|
const account = resolveInlineAccount({ cfg: params.cfg, accountId });
|
|
36968
|
+
const nativeEnabled = shouldSyncInlineNativeCommandsForAccount({ cfg: params.cfg, account });
|
|
36969
|
+
attempted += 1;
|
|
36964
36970
|
if (!account.enabled || !account.configured || !account.baseUrl) {
|
|
36965
36971
|
continue;
|
|
36966
36972
|
}
|
|
@@ -36984,9 +36990,25 @@ async function syncInlineNativeCommands(params) {
|
|
|
36984
36990
|
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": ${String(err)}`);
|
|
36985
36991
|
continue;
|
|
36986
36992
|
}
|
|
36993
|
+
if (!nativeEnabled) {
|
|
36994
|
+
try {
|
|
36995
|
+
await callInlineBotApi({
|
|
36996
|
+
baseUrl: account.baseUrl,
|
|
36997
|
+
token,
|
|
36998
|
+
methodName: "deleteMyCommands",
|
|
36999
|
+
method: "POST"
|
|
37000
|
+
});
|
|
37001
|
+
synced += 1;
|
|
37002
|
+
params.logger?.info?.(`[inline] bot commands cleared for account "${account.accountId}"`);
|
|
37003
|
+
} catch (err) {
|
|
37004
|
+
failed += 1;
|
|
37005
|
+
params.logger?.warn?.(`[inline] bot command clear failed for account "${account.accountId}": ${String(err)}`);
|
|
37006
|
+
}
|
|
37007
|
+
continue;
|
|
37008
|
+
}
|
|
36987
37009
|
const allCommands = await buildInlineNativeCommandsForConfig({
|
|
36988
37010
|
cfg: params.cfg,
|
|
36989
|
-
|
|
37011
|
+
account,
|
|
36990
37012
|
...params.logger ? { logger: params.logger } : {}
|
|
36991
37013
|
});
|
|
36992
37014
|
const commands = allCommands.slice(0, INLINE_COMMAND_LIMIT);
|
|
@@ -37013,7 +37035,7 @@ async function syncInlineNativeCommands(params) {
|
|
|
37013
37035
|
}
|
|
37014
37036
|
}
|
|
37015
37037
|
return {
|
|
37016
|
-
attempted
|
|
37038
|
+
attempted,
|
|
37017
37039
|
synced,
|
|
37018
37040
|
failed
|
|
37019
37041
|
};
|
|
@@ -37060,5 +37082,5 @@ export {
|
|
|
37060
37082
|
registerInlinePluginFull
|
|
37061
37083
|
};
|
|
37062
37084
|
|
|
37063
|
-
//# debugId=
|
|
37085
|
+
//# debugId=5ACEE44315B26ABD64756E2164756E21
|
|
37064
37086
|
//# sourceMappingURL=runtime-register-api.js.map
|