@inline-openclaw/inline 0.0.37 → 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.
@@ -35762,6 +35762,7 @@ import {
35762
35762
  buildCommandTextFromArgs,
35763
35763
  findCommandByNativeName,
35764
35764
  formatCommandArgMenuTitle,
35765
+ listNativeCommandSpecsForConfig as listNativeCommandSpecsForConfig2,
35765
35766
  parseCommandArgs,
35766
35767
  resolveCommandArgMenu
35767
35768
  } from "openclaw/plugin-sdk/native-command-registry";
@@ -35796,6 +35797,7 @@ import {
35796
35797
  } from "openclaw/plugin-sdk/config-runtime";
35797
35798
  import { buildModelsProviderData } from "openclaw/plugin-sdk/models-provider-runtime";
35798
35799
  import { listSkillCommandsForAgents as listSkillCommandsForAgents2 } from "openclaw/plugin-sdk/skill-commands-runtime";
35800
+ import { getPluginCommandSpecs as getPluginCommandSpecs2 } from "openclaw/plugin-sdk/plugin-runtime";
35799
35801
  import { isReasoningReplyPayload } from "openclaw/plugin-sdk/reply-payload";
35800
35802
  import {
35801
35803
  findCodeRegions,
@@ -39174,12 +39176,12 @@ function shouldSyncInlineNativeCommandsForAccount(params) {
39174
39176
  const effective = params.account.config.commands?.native ?? params.cfg.commands?.native ?? "auto";
39175
39177
  return effective !== false;
39176
39178
  }
39177
- function shouldSyncInlineNativeSkills(params) {
39179
+ function shouldSyncInlineNativeSkillsForAccount(params) {
39178
39180
  const effective = params.account.config.commands?.nativeSkills ?? params.cfg.commands?.nativeSkills ?? "auto";
39179
39181
  return effective !== false;
39180
39182
  }
39181
39183
  async function buildInlineNativeCommandsForConfig(params) {
39182
- const route = shouldSyncInlineNativeSkills({ cfg: params.cfg, account: params.account }) ? resolveAgentRoute({
39184
+ const route = shouldSyncInlineNativeSkillsForAccount({ cfg: params.cfg, account: params.account }) ? resolveAgentRoute({
39183
39185
  cfg: params.cfg,
39184
39186
  channel: INLINE_NATIVE_COMMAND_PROVIDER,
39185
39187
  accountId: params.account.accountId
@@ -39582,6 +39584,11 @@ function findInlineNativeCommandFromBody(commandBody) {
39582
39584
  return null;
39583
39585
  return findCommandByNativeName(match[1], INLINE_NATIVE_COMMAND_PROVIDER2) ?? null;
39584
39586
  }
39587
+ function resolveInlineCommandNameFromBody(commandBody) {
39588
+ const match = commandBody.trim().match(/^\/([^\s]+)(?:\s+[\s\S]*)?$/);
39589
+ const raw = match?.[1]?.trim().toLowerCase();
39590
+ return raw || null;
39591
+ }
39585
39592
  function buildInlineNativeCommandCallbackData(commandText) {
39586
39593
  return `${INLINE_NATIVE_COMMAND_CALLBACK_PREFIX}${commandText}`;
39587
39594
  }
@@ -39598,7 +39605,29 @@ function isInlineNativeCommandBody(params) {
39598
39605
  if (!shouldSyncInlineNativeCommandsForAccount({ cfg: params.cfg, account: params.account })) {
39599
39606
  return false;
39600
39607
  }
39601
- return findInlineNativeCommandFromBody(params.commandBody) != null;
39608
+ const commandName = resolveInlineCommandNameFromBody(params.commandBody);
39609
+ if (!commandName)
39610
+ return false;
39611
+ const skillCommands = shouldSyncInlineNativeSkillsForAccount({
39612
+ cfg: params.cfg,
39613
+ account: params.account
39614
+ }) ? listSkillCommandsForAgents2({
39615
+ cfg: params.cfg,
39616
+ agentIds: [params.agentId]
39617
+ }) : [];
39618
+ const commandSpecs = listNativeCommandSpecsForConfig2(params.cfg, {
39619
+ skillCommands,
39620
+ provider: INLINE_NATIVE_COMMAND_PROVIDER2
39621
+ });
39622
+ for (const spec of commandSpecs) {
39623
+ if (spec.name.trim().toLowerCase() === commandName)
39624
+ return true;
39625
+ }
39626
+ for (const spec of getPluginCommandSpecs2("inline", { config: params.cfg })) {
39627
+ if (spec.name.trim().toLowerCase() === commandName)
39628
+ return true;
39629
+ }
39630
+ return false;
39602
39631
  }
39603
39632
  function escapeInlineRegExp(raw) {
39604
39633
  return raw.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -41017,9 +41046,23 @@ ${JSON.stringify(payload)}`;
41017
41046
  }
41018
41047
  const shouldEditCallbackTargetInPlace = callbackActionEvent != null;
41019
41048
  const normalizedCommandBody = callbackCommandBody ?? normalizeInlineCommandBody(rawBody, botUsername);
41049
+ const route = core3.channel.routing.resolveAgentRoute({
41050
+ cfg,
41051
+ channel: CHANNEL_ID,
41052
+ accountId: account.accountId,
41053
+ peer: {
41054
+ kind: isGroup ? "group" : "direct",
41055
+ id: isGroup ? String(effectiveChatId) : senderId
41056
+ }
41057
+ });
41020
41058
  const nativeCallbackCommandBody = callbackActionEvent ? parseInlineNativeCommandCallbackData(callbackDataToUtf8(callbackActionEvent.data)) : null;
41021
41059
  const hasControlCommand = core3.channel.text.hasControlCommand(callbackCommandBody ?? rawBody, cfg, botUsername ? { botUsername } : undefined);
41022
- const commandSource = hasControlCommand ? (nativeCallbackCommandBody != null || !callbackActionEvent) && isInlineNativeCommandBody({ cfg, account, commandBody: normalizedCommandBody }) ? "native" : "text" : undefined;
41060
+ const commandSource = hasControlCommand ? (nativeCallbackCommandBody != null || !callbackActionEvent) && isInlineNativeCommandBody({
41061
+ cfg,
41062
+ account,
41063
+ commandBody: normalizedCommandBody,
41064
+ agentId: route.agentId
41065
+ }) ? "native" : "text" : undefined;
41023
41066
  const allowTextCommands = core3.channel.commands.shouldHandleTextCommands({
41024
41067
  cfg,
41025
41068
  surface: CHANNEL_ID,
@@ -41130,15 +41173,6 @@ ${JSON.stringify(payload)}`;
41130
41173
  });
41131
41174
  return;
41132
41175
  }
41133
- const route = core3.channel.routing.resolveAgentRoute({
41134
- cfg,
41135
- channel: CHANNEL_ID,
41136
- accountId: account.accountId,
41137
- peer: {
41138
- kind: isGroup ? "group" : "direct",
41139
- id: isGroup ? String(effectiveChatId) : senderId
41140
- }
41141
- });
41142
41176
  const mentionRegexes = core3.channel.mentions.buildMentionRegexes(cfg, route.agentId);
41143
41177
  const nativeMentioned = typeof msg.mentioned === "boolean" ? msg.mentioned : false;
41144
41178
  const patternMentioned = mentionRegexes.length ? core3.channel.mentions.matchesMentionPatterns(rawBody, mentionRegexes) : false;
@@ -44821,5 +44855,5 @@ export {
44821
44855
  inlineChannelPlugin
44822
44856
  };
44823
44857
 
44824
- //# debugId=3F378342A86B5C1E64756E2164756E21
44858
+ //# debugId=F677CBD78FB5C51A64756E2164756E21
44825
44859
  //# sourceMappingURL=channel-plugin-api.js.map