@itpay/cli 2.0.22 → 2.0.23

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.
@@ -1,15 +1,21 @@
1
1
  export function declaredAgentType(env = process.env, argv = process.argv) {
2
2
  if (env.ITPAY_AGENT_TYPE)
3
- return env.ITPAY_AGENT_TYPE;
3
+ return canonicalAgentType(env.ITPAY_AGENT_TYPE);
4
4
  for (let index = 0; index < argv.length; index += 1) {
5
5
  const value = argv[index];
6
6
  if (value === "--agent-type")
7
- return argv[index + 1];
7
+ return canonicalAgentType(argv[index + 1]);
8
8
  if (value?.startsWith("--agent-type="))
9
- return value.slice("--agent-type=".length);
9
+ return canonicalAgentType(value.slice("--agent-type=".length));
10
10
  }
11
11
  return undefined;
12
12
  }
13
+ export function canonicalAgentType(value) {
14
+ const normalized = value?.trim().toLowerCase();
15
+ if (!normalized)
16
+ return undefined;
17
+ return normalized === "codex" ? "codex-desktop" : normalized;
18
+ }
13
19
  export function qualifyItPayCommand(command, agentType) {
14
20
  if (!agentType || !/^[a-z0-9-]+$/.test(agentType))
15
21
  return command;
@@ -12,7 +12,7 @@ import { DeviceAuthority } from "./device_authority.js";
12
12
  import { OperationJournal } from "./operation_journal.js";
13
13
  export const DEFAULT_BASE_URL = "https://app.itpay.ai";
14
14
  export const DEV_BASE_URL = "https://dev.itpay.ai";
15
- export const CLI_VERSION = "2.0.22";
15
+ export const CLI_VERSION = "2.0.23";
16
16
  export const API_CONTRACT_REVISION = "sha256:0c6470d9e3c1b4ec317d6c1b0b597acc13ec10d39312f994ece4cfd25cb0b65e";
17
17
  const CART_SESSION_DEFAULT_DIR = ".itpay-v3";
18
18
  const CART_SESSION_FILENAME = "cart.json";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itpay/cli",
3
- "version": "2.0.22",
3
+ "version": "2.0.23",
4
4
  "description": "The single ItPay CLI entry point for buy workflows and future sell workflows.",
5
5
  "type": "module",
6
6
  "bin": {