@thirdfy/agent-cli 0.1.4 → 0.1.5

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.
@@ -1094,15 +1094,29 @@ async function resolveActionSelection(ctx, flags) {
1094
1094
  return { requestedAction, resolvedAction: requestedAction };
1095
1095
  }
1096
1096
 
1097
- const exact = keyed.filter(
1098
- (entry) => entry.key.toLowerCase() === requestedLower || entry.aliases.some((a) => a.toLowerCase() === requestedLower)
1099
- );
1100
- if (exact.length === 1) {
1101
- return { requestedAction, resolvedAction: exact[0].key };
1097
+ // Prefer direct action id matches over alias matches.
1098
+ // This keeps UX simple for commands like `--action swap` when another action aliases to "swap".
1099
+ const exactKey = keyed.filter((entry) => entry.key.toLowerCase() === requestedLower);
1100
+ if (exactKey.length === 1) {
1101
+ return { requestedAction, resolvedAction: exactKey[0].key };
1102
+ }
1103
+ if (exactKey.length > 1) {
1104
+ throw new Error(
1105
+ `Ambiguous --action "${requestedAction}". Multiple exact matches found: ${formatActionList(
1106
+ exactKey.map((v) => v.key)
1107
+ )}.`
1108
+ );
1109
+ }
1110
+
1111
+ const exactAlias = keyed.filter((entry) => entry.aliases.some((a) => a.toLowerCase() === requestedLower));
1112
+ if (exactAlias.length === 1) {
1113
+ return { requestedAction, resolvedAction: exactAlias[0].key };
1102
1114
  }
1103
- if (exact.length > 1) {
1115
+ if (exactAlias.length > 1) {
1104
1116
  throw new Error(
1105
- `Ambiguous --action "${requestedAction}". Multiple exact matches found: ${formatActionList(exact.map((v) => v.key))}.`
1117
+ `Ambiguous --action "${requestedAction}". Alias matches multiple actions: ${formatActionList(
1118
+ exactAlias.map((v) => v.key)
1119
+ )}.`
1106
1120
  );
1107
1121
  }
1108
1122
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thirdfy/agent-cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Thirdfy Agent CLI for onboarding, governance preflight, execute-intent, and status polling.",
5
5
  "type": "module",
6
6
  "bin": {