bpmax-cli 0.1.44-beta.24 → 0.1.44-beta.25

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/bin.js CHANGED
@@ -469,7 +469,7 @@ function pluginAgentCapabilityForRequest(method, normalizedPath) {
469
469
  // package.json
470
470
  var package_default = {
471
471
  name: "bpmax-cli",
472
- version: "0.1.44-beta.24",
472
+ version: "0.1.44-beta.25",
473
473
  description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
474
474
  type: "module",
475
475
  bin: {
@@ -4273,9 +4273,23 @@ function looksLikeParseEvalFunctionBody(script) {
4273
4273
  }
4274
4274
  function addCodeModeMessageScriptError(errors, pathName) {
4275
4275
  errors.push(
4276
- `${pathName} is code-mode message content but is not a parseEvalFunction body; wrap literal text as a JS return script, for example: return "\u8BF7\u5904\u7406..."; use return ""; to suppress default message sending.`
4276
+ `${pathName} is code-mode message content but is not a parseEvalFunction body; code-mode scripts must return a complete message object, for example: return { title: "...", content: [...], actions: [...], messageType: "step" }; use return ""; only to suppress outbound messages entirely.`
4277
4277
  );
4278
4278
  }
4279
+ function returnsBareNonEmptyString(script) {
4280
+ if (/\breturn\s+[{(]/.test(script)) {
4281
+ return false;
4282
+ }
4283
+ const matches = script.match(/\breturn\s+"([^"]*)"/);
4284
+ if (matches && matches[1] !== "") {
4285
+ return true;
4286
+ }
4287
+ const singleMatches = script.match(/\breturn\s+'([^']*)'/);
4288
+ if (singleMatches && singleMatches[1] !== "") {
4289
+ return true;
4290
+ }
4291
+ return false;
4292
+ }
4279
4293
  function validateCodeModeMessageScript(errors, pathName, value) {
4280
4294
  if (value === void 0 || value === null || value === "") {
4281
4295
  errors.push(
@@ -4285,6 +4299,12 @@ function validateCodeModeMessageScript(errors, pathName, value) {
4285
4299
  }
4286
4300
  if (typeof value !== "string" || !looksLikeParseEvalFunctionBody(value)) {
4287
4301
  addCodeModeMessageScriptError(errors, pathName);
4302
+ return;
4303
+ }
4304
+ if (returnsBareNonEmptyString(value)) {
4305
+ errors.push(
4306
+ `${pathName} is code-mode message content but returns a bare string; code-mode scripts must return a complete message object { title, content, actions: [{ type: "link", text, url, m_url }], messageType: "step" }. A non-empty bare string is treated as truthy and enters sendMessage but cannot render as a card. Only return ""; suppresses outbound messages.`
4307
+ );
4288
4308
  }
4289
4309
  }
4290
4310
  function validateCodeModeMessageActionUrl(errors, pathName, value) {