@hcmai/cli 0.4.11 → 0.4.12

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/index.js CHANGED
@@ -3173,7 +3173,15 @@ function formatDescriptionTable(desc, verbose = false) {
3173
3173
  const call = [a.scope, a.httpMethod].filter(Boolean).join(" ");
3174
3174
  const params = a.params?.length ? ` params: ${a.params.map((p) => `${p.name}:${p.type}`).join(", ")}` : "";
3175
3175
  const description = verbose && a.description ? ` ${a.description}` : "";
3176
- lines.push(` ${a.name.padEnd(20)} ${call.padEnd(12)} ${a.label ?? ""}${params}${description}`);
3176
+ const source = a.source && a.source.toLowerCase() !== "java" ? ` [${a.source.toLowerCase()}]` : "";
3177
+ lines.push(
3178
+ ` ${a.name.padEnd(20)} ${call.padEnd(12)} ${a.label ?? ""}${source}${params}${description}`
3179
+ );
3180
+ }
3181
+ if (!desc.effectiveActionsAvailable) {
3182
+ lines.push(
3183
+ ` \u26A0\uFE0F \u4EE5\u4E0A\u53EA\u542B\u6CE8\u89E3 action\uFF0CYAML \u58F0\u660E\u7684\u811A\u672C Action \u672A\u7EB3\u5165\uFF1A${desc.effectiveActionsNote ?? "\u539F\u56E0\u672A\u77E5"}`
3184
+ );
3177
3185
  }
3178
3186
  if (desc.relations.length) {
3179
3187
  lines.push(`relations: ${desc.relations.map((r) => `${r.key}(via ${r.via})`).join(", ")}`);
@@ -8002,9 +8010,10 @@ async function resolveCoreAction(request) {
8002
8010
  const description = await HcmClient19.fromAuthContext(auth).describe(request.model);
8003
8011
  const named = description.actions.filter((action2) => action2.name === request.action);
8004
8012
  if (named.length === 0) {
8013
+ const degraded = description.effectiveActionsAvailable ? "" : `\u26A0\uFE0F \u672C\u6B21\u6BD4\u5BF9\u4E0D\u542B\u811A\u672C Action\u2014\u2014${description.effectiveActionsNote ?? "\u539F\u56E0\u672A\u77E5"}\u3002`;
8005
8014
  return failed(
8006
8015
  "action-metadata-not-found",
8007
- `Core \u5143\u6570\u636E\u91CC\u6CA1\u6709 ${request.model}.${request.action} \u8FD9\u4E2A Action\u3002next_step=\u7528 \`hcm describe ${request.model}\` \u6838\u5BF9 Action \u540D`
8016
+ `Core \u5143\u6570\u636E\u91CC\u6CA1\u6709 ${request.model}.${request.action} \u8FD9\u4E2A Action\u3002${degraded}next_step=\u7528 \`hcm describe ${request.model}\` \u770B\u5B83\u5217\u51FA\u7684 Action \u540D\uFF08\u811A\u672C Action \u4F1A\u6807 [script]\uFF09`
8008
8017
  );
8009
8018
  }
8010
8019
  const matches = request.explicitShape ? named.filter((action2) => matchesRequest(action2, request)) : named;