@optima-chat/dev-skills 0.7.40 → 0.7.41

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.
@@ -5,13 +5,15 @@ import { getInfisicalConfig, getInfisicalToken } from './db-utils';
5
5
  const USER_AUTH_URLS: Record<string, string> = {
6
6
  stage: 'https://auth.stage.optima.onl',
7
7
  prod: 'https://auth.optima.onl',
8
- 'cn-prod': 'https://auth-cn.optima.chat',
8
+ // #201: yzsgo.com 全量迁移 (2026-06-12), 旧 auth-cn.optima.chat 路由已下线
9
+ 'cn-prod': 'https://auth.yzsgo.com',
9
10
  };
10
11
 
11
12
  // cn-prod URLs are hardcoded: cn Infisical (secrets-cn.optima.chat) is a
12
13
  // separate instance dev-skills has no machine identity for, and these domains
13
14
  // are stable. AWS envs keep reading /shared-secrets/domain-urls.
14
- const CN_PROD_BILLING_URL = 'https://billing-cn.optima.chat';
15
+ // #201: yzsgo.com 全量迁移 (2026-06-12), 旧 billing-cn.optima.chat 路由已下线
16
+ const CN_PROD_BILLING_URL = 'https://billing-api.yzsgo.com';
15
17
 
16
18
  /**
17
19
  * Validate the --env flag value at command entry, before any I/O.
@@ -24,7 +24,7 @@ interface MerchantSetupResponse {
24
24
  user_id: string;
25
25
  }
26
26
 
27
- type Environment = 'ci' | 'stage' | 'prod';
27
+ type Environment = 'ci' | 'stage' | 'prod' | 'cn-prod';
28
28
 
29
29
  interface EnvironmentConfig {
30
30
  authUrl: string;
@@ -51,6 +51,13 @@ const ENV_CONFIG: Record<Environment, EnvironmentConfig> = {
51
51
  apiUrl: 'https://api.optima.onl',
52
52
  clientId: 'commerce-cli-ecs-pro-i2r5of1h',
53
53
  envName: 'prod'
54
+ },
55
+ 'cn-prod': {
56
+ // #201: yzsgo.com 全量迁移 (2026-06-12), 旧 *-cn.optima.chat 路由已下线
57
+ authUrl: 'https://auth.yzsgo.com',
58
+ apiUrl: 'https://commerce.yzsgo.com',
59
+ clientId: 'commerce-cli-cn-prod',
60
+ envName: 'cn-prod'
54
61
  }
55
62
  };
56
63
 
@@ -190,10 +197,10 @@ async function main() {
190
197
  address = args[++i];
191
198
  } else if (arg === '--env' && args[i + 1]) {
192
199
  const envArg = args[++i];
193
- if (envArg === 'ci' || envArg === 'stage' || envArg === 'prod') {
194
- environment = envArg;
200
+ if (envArg === 'ci' || envArg === 'stage' || envArg === 'prod' || envArg === 'cn-prod') {
201
+ environment = envArg as Environment;
195
202
  } else {
196
- console.error(`❌ Invalid environment: ${envArg}. Must be 'ci', 'stage', or 'prod'.`);
203
+ console.error(`❌ Invalid environment: ${envArg}. Must be 'ci', 'stage', 'prod', or 'cn-prod'.`);
197
204
  process.exit(1);
198
205
  }
199
206
  } else if (arg === '--help' || arg === '-h') {
@@ -206,18 +213,20 @@ Options:
206
213
  --business-name <name> Merchant business name (default: auto-generated)
207
214
  --phone <phone> Merchant phone number (optional)
208
215
  --address <address> Merchant address (optional)
209
- --env <environment> Environment: ci (default), stage, or prod
216
+ --env <environment> Environment: ci (default), stage, prod, or cn-prod
210
217
  --help, -h Show this help message
211
218
 
212
219
  Environments:
213
- ci CI 环境 (auth.optima.chat, api.optima.chat)
214
- stage Stage 环境 (auth.stage.optima.onl, api.stage.optima.onl)
215
- prod Prod 环境 (auth.optima.onl, api.optima.onl)
220
+ ci CI 环境 (auth.optima.chat, api.optima.chat)
221
+ stage Stage 环境 (auth.stage.optima.onl, api.stage.optima.onl)
222
+ prod Prod 环境 (auth.optima.onl, api.optima.onl)
223
+ cn-prod 阿里云生产环境 (auth.yzsgo.com, commerce.yzsgo.com) [#201]
216
224
 
217
225
  Example:
218
226
  optima-generate-test-token
219
227
  optima-generate-test-token --env stage
220
228
  optima-generate-test-token --env prod
229
+ optima-generate-test-token --env cn-prod
221
230
  optima-generate-test-token --business-name "My Test Shop" --env stage
222
231
  `);
223
232
  process.exit(0);
@@ -20,7 +20,7 @@
20
20
  * optima-verify-health user-auth --env prod # 环境 stage|prod|cn|all
21
21
  * optima-verify-health --all --env all # stage/prod/cn 三环境矩阵
22
22
  * optima-verify-health gateway-core --expect-commit a1b2c3d
23
- * optima-verify-health --url https://auth-cn.optima.chat/health
23
+ * optima-verify-health --url https://auth.yzsgo.com/health
24
24
  * optima-verify-health --all --json # 机器可读,接 CI
25
25
  * optima-verify-health --all --strict # warn 也算不通过
26
26
  * 退出码:fail → 非 0;warn 默认放行(0),--strict 让 warn 也非 0。
@@ -33,15 +33,16 @@ type Env = 'stage' | 'prod' | 'cn';
33
33
  interface SvcCfg { path: string; stage?: string; prod?: string; cn?: string; cn_path?: string; }
34
34
 
35
35
  // 服务 × 环境 FQDN 表。某服务某环境没部署 → 该 env 键缺省,探时跳过。
36
- // cn-prod 真实 subdomain 抄自 optima-terraform 的 stack main.tf(非文档表,如 agentic-chat 真名是 agentic-chat-cn 不是 ai-cn)
36
+ // cn-prod 真实 subdomain 抄自 optima-terraform alicloud/stacks/cn-prod-ingress-sae/main.tf。
37
+ // #201 (2026-06-12): yzsgo.com 全量迁移完成,旧 *-cn.optima.chat 路由已下线。
37
38
  const SERVICES: Record<string, SvcCfg> = {
38
- 'user-auth': { path: '/health', stage: 'auth-stage.optima.onl', prod: 'auth.optima.onl', cn: 'auth-cn.optima.chat' },
39
- 'agentic-chat': { path: '/api/health', stage: 'ai-stage.optima.onl', prod: 'ai.optima.onl', cn: 'agentic-chat-cn.optima.chat' },
40
- 'commerce-backend': { path: '/health', stage: 'api-stage.optima.onl', prod: 'api.optima.onl', cn: 'api-cn.optima.chat', cn_path: '/health/live' },
39
+ 'user-auth': { path: '/health', stage: 'auth-stage.optima.onl', prod: 'auth.optima.onl', cn: 'auth.yzsgo.com' },
40
+ 'agentic-chat': { path: '/api/health', stage: 'ai-stage.optima.onl', prod: 'ai.optima.onl', cn: 'app.yzsgo.com' },
41
+ 'commerce-backend': { path: '/health', stage: 'api-stage.optima.onl', prod: 'api.optima.onl', cn: 'commerce.yzsgo.com', cn_path: '/health/live' },
41
42
  'mcp-host': { path: '/health', stage: 'mcp-stage.optima.onl', prod: 'mcp.optima.onl' },
42
- 'gateway-core': { path: '/health', cn: 'gw-cn.optima.chat' },
43
- 'optima-scout': { path: '/health', cn: 'scout-cn.optima.chat' },
44
- 'optima-skills': { path: '/health', cn: 'skills-cn.optima.chat' },
43
+ 'gateway-core': { path: '/health', cn: 'gw.yzsgo.com' },
44
+ 'optima-scout': { path: '/health', cn: 'scout.yzsgo.com' },
45
+ 'optima-skills': { path: '/health', cn: 'skills.yzsgo.com' },
45
46
  };
46
47
  const ENVS: Env[] = ['stage', 'prod', 'cn'];
47
48
 
@@ -12,12 +12,14 @@ const db_utils_1 = require("./db-utils");
12
12
  const USER_AUTH_URLS = {
13
13
  stage: 'https://auth.stage.optima.onl',
14
14
  prod: 'https://auth.optima.onl',
15
- 'cn-prod': 'https://auth-cn.optima.chat',
15
+ // #201: yzsgo.com 全量迁移 (2026-06-12), 旧 auth-cn.optima.chat 路由已下线
16
+ 'cn-prod': 'https://auth.yzsgo.com',
16
17
  };
17
18
  // cn-prod URLs are hardcoded: cn Infisical (secrets-cn.optima.chat) is a
18
19
  // separate instance dev-skills has no machine identity for, and these domains
19
20
  // are stable. AWS envs keep reading /shared-secrets/domain-urls.
20
- const CN_PROD_BILLING_URL = 'https://billing-cn.optima.chat';
21
+ // #201: yzsgo.com 全量迁移 (2026-06-12), 旧 billing-cn.optima.chat 路由已下线
22
+ const CN_PROD_BILLING_URL = 'https://billing-api.yzsgo.com';
21
23
  /**
22
24
  * Validate the --env flag value at command entry, before any I/O.
23
25
  *
File without changes
File without changes
@@ -55,6 +55,13 @@ const ENV_CONFIG = {
55
55
  apiUrl: 'https://api.optima.onl',
56
56
  clientId: 'commerce-cli-ecs-pro-i2r5of1h',
57
57
  envName: 'prod'
58
+ },
59
+ 'cn-prod': {
60
+ // #201: yzsgo.com 全量迁移 (2026-06-12), 旧 *-cn.optima.chat 路由已下线
61
+ authUrl: 'https://auth.yzsgo.com',
62
+ apiUrl: 'https://commerce.yzsgo.com',
63
+ clientId: 'commerce-cli-cn-prod',
64
+ envName: 'cn-prod'
58
65
  }
59
66
  };
60
67
  async function httpRequest(url, options = {}) {
@@ -176,11 +183,11 @@ async function main() {
176
183
  }
177
184
  else if (arg === '--env' && args[i + 1]) {
178
185
  const envArg = args[++i];
179
- if (envArg === 'ci' || envArg === 'stage' || envArg === 'prod') {
186
+ if (envArg === 'ci' || envArg === 'stage' || envArg === 'prod' || envArg === 'cn-prod') {
180
187
  environment = envArg;
181
188
  }
182
189
  else {
183
- console.error(`❌ Invalid environment: ${envArg}. Must be 'ci', 'stage', or 'prod'.`);
190
+ console.error(`❌ Invalid environment: ${envArg}. Must be 'ci', 'stage', 'prod', or 'cn-prod'.`);
184
191
  process.exit(1);
185
192
  }
186
193
  }
@@ -194,18 +201,20 @@ Options:
194
201
  --business-name <name> Merchant business name (default: auto-generated)
195
202
  --phone <phone> Merchant phone number (optional)
196
203
  --address <address> Merchant address (optional)
197
- --env <environment> Environment: ci (default), stage, or prod
204
+ --env <environment> Environment: ci (default), stage, prod, or cn-prod
198
205
  --help, -h Show this help message
199
206
 
200
207
  Environments:
201
- ci CI 环境 (auth.optima.chat, api.optima.chat)
202
- stage Stage 环境 (auth.stage.optima.onl, api.stage.optima.onl)
203
- prod Prod 环境 (auth.optima.onl, api.optima.onl)
208
+ ci CI 环境 (auth.optima.chat, api.optima.chat)
209
+ stage Stage 环境 (auth.stage.optima.onl, api.stage.optima.onl)
210
+ prod Prod 环境 (auth.optima.onl, api.optima.onl)
211
+ cn-prod 阿里云生产环境 (auth.yzsgo.com, commerce.yzsgo.com) [#201]
204
212
 
205
213
  Example:
206
214
  optima-generate-test-token
207
215
  optima-generate-test-token --env stage
208
216
  optima-generate-test-token --env prod
217
+ optima-generate-test-token --env cn-prod
209
218
  optima-generate-test-token --business-name "My Test Shop" --env stage
210
219
  `);
211
220
  process.exit(0);
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -55,7 +55,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
55
55
  * optima-verify-health user-auth --env prod # 环境 stage|prod|cn|all
56
56
  * optima-verify-health --all --env all # stage/prod/cn 三环境矩阵
57
57
  * optima-verify-health gateway-core --expect-commit a1b2c3d
58
- * optima-verify-health --url https://auth-cn.optima.chat/health
58
+ * optima-verify-health --url https://auth.yzsgo.com/health
59
59
  * optima-verify-health --all --json # 机器可读,接 CI
60
60
  * optima-verify-health --all --strict # warn 也算不通过
61
61
  * 退出码:fail → 非 0;warn 默认放行(0),--strict 让 warn 也非 0。
@@ -64,15 +64,16 @@ const node_dns_1 = require("node:dns");
64
64
  const tls = __importStar(require("node:tls"));
65
65
  const https = __importStar(require("node:https"));
66
66
  // 服务 × 环境 FQDN 表。某服务某环境没部署 → 该 env 键缺省,探时跳过。
67
- // cn-prod 真实 subdomain 抄自 optima-terraform 的 stack main.tf(非文档表,如 agentic-chat 真名是 agentic-chat-cn 不是 ai-cn)
67
+ // cn-prod 真实 subdomain 抄自 optima-terraform alicloud/stacks/cn-prod-ingress-sae/main.tf。
68
+ // #201 (2026-06-12): yzsgo.com 全量迁移完成,旧 *-cn.optima.chat 路由已下线。
68
69
  const SERVICES = {
69
- 'user-auth': { path: '/health', stage: 'auth-stage.optima.onl', prod: 'auth.optima.onl', cn: 'auth-cn.optima.chat' },
70
- 'agentic-chat': { path: '/api/health', stage: 'ai-stage.optima.onl', prod: 'ai.optima.onl', cn: 'agentic-chat-cn.optima.chat' },
71
- 'commerce-backend': { path: '/health', stage: 'api-stage.optima.onl', prod: 'api.optima.onl', cn: 'api-cn.optima.chat', cn_path: '/health/live' },
70
+ 'user-auth': { path: '/health', stage: 'auth-stage.optima.onl', prod: 'auth.optima.onl', cn: 'auth.yzsgo.com' },
71
+ 'agentic-chat': { path: '/api/health', stage: 'ai-stage.optima.onl', prod: 'ai.optima.onl', cn: 'app.yzsgo.com' },
72
+ 'commerce-backend': { path: '/health', stage: 'api-stage.optima.onl', prod: 'api.optima.onl', cn: 'commerce.yzsgo.com', cn_path: '/health/live' },
72
73
  'mcp-host': { path: '/health', stage: 'mcp-stage.optima.onl', prod: 'mcp.optima.onl' },
73
- 'gateway-core': { path: '/health', cn: 'gw-cn.optima.chat' },
74
- 'optima-scout': { path: '/health', cn: 'scout-cn.optima.chat' },
75
- 'optima-skills': { path: '/health', cn: 'skills-cn.optima.chat' },
74
+ 'gateway-core': { path: '/health', cn: 'gw.yzsgo.com' },
75
+ 'optima-scout': { path: '/health', cn: 'scout.yzsgo.com' },
76
+ 'optima-skills': { path: '/health', cn: 'skills.yzsgo.com' },
76
77
  };
77
78
  const ENVS = ['stage', 'prod', 'cn'];
78
79
  const G = '\x1b[32m', R = '\x1b[31m', Y = '\x1b[33m', B = '\x1b[34m', N = '\x1b[0m';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optima-chat/dev-skills",
3
- "version": "0.7.40",
3
+ "version": "0.7.41",
4
4
  "description": "Claude Code Skills for Optima development team - cross-environment collaboration tools",
5
5
  "main": "index.js",
6
6
  "bin": {