@optima-chat/dev-skills 0.9.0 → 0.9.2

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,6 +1,6 @@
1
1
  ---
2
2
  name: "logs"
3
- description: "当用户请求查看日志、查看服务日志、排查问题、看看日志、检查日志、商品服务日志、后端日志、API日志、正式环境日志、生产环境日志、CI环境日志、开发环境日志、阿里云日志、cn-prod 日志、SAE 日志时,使用此技能。支持 CI、Stage、Prod(AWS ECS/CloudWatch)以及 cn-prod(阿里云 SAE,经 buildbox)四个环境的 commerce-backend、user-auth、agentic-chat、gateway-core、optima-scout、optima-skills 等服务。"
3
+ description: "当用户请求查看日志、查看服务日志、排查问题、看看日志、检查日志、商品服务日志、后端日志、API日志、正式环境日志、生产环境日志、CI环境日志、开发环境日志、阿里云日志、cn-prod 日志、SAE 日志时,使用此技能。支持 CI、Stage、Prod(AWS ECS/CloudWatch)以及 cn-prod(阿里云 SAE/SLS)四个环境的 commerce-backend、user-auth、agentic-chat、gateway-core、optima-scout、optima-skills 等服务。"
4
4
  allowed-tools: ["Bash", "SlashCommand"]
5
5
  ---
6
6
 
@@ -183,10 +183,10 @@ INFO - Database query took 3200ms: SELECT * FROM products WHERE...
183
183
  ```
184
184
 
185
185
  **特点**:
186
- - 阿里云 **SAE**(cn-beijing),不是 AWS
187
- - buildbox(`root@47.94.105.163`)调 SAE `DescribeInstanceLog`
188
- - SAE 未配 SLS 只取实例**当前 stdout 缓冲**(非历史检索)
189
- - 技术细节 + serviceAppId 映射见 `/logs --help`(第 3 节)
186
+ - 阿里云 **SLS**(日志服务,cn-beijing),不是 AWS CloudWatch
187
+ - 用 `optima-logs <svc> --env cn-prod` **直连 SLS**(`aliyun sls GetLogs`,公网控制面 API)——免 buildbox 跳板,支持历史检索 + 时间窗(`--since`)+ 关键词(`--grep`)
188
+ - 前置:本机需装 `aliyun` CLI + `aliyun-optima` profile(cn-beijing)
189
+ - 旧的「buildboxSAE `DescribeInstanceLog` 取当前缓冲」已弃用(缓冲式、重启即丢、不能检索);技术细节见 `/logs --help`(第 3 节)
190
190
 
191
191
  ## 支持的服务列表
192
192
 
@@ -64,15 +64,16 @@ export function assertAwsEmailOnly(env: string, kind: 'email' | 'phone' | 'userI
64
64
  }
65
65
  }
66
66
 
67
- // cn-prod sells the CNY-priced -cn plans (P12); the bare USD plan ids also
68
- // exist in the cn DB, so a per-env whitelist (not billing-side validation)
69
- // is what prevents accidentally granting a USD-priced plan to a CN user.
67
+ // All envs use canonical plan ids (no market suffix). billing canonicalized
68
+ // plan ids — dropped the `-cn` suffix; market is now carried by deployment-level
69
+ // BILLING_MARKET + the plan's `currency` column, not the id (optima-billing#181).
70
+ // cn envs additionally have the CN-only `free` tier. Per-env whitelist guards
71
+ // against granting a plan absent in that env.
70
72
  const PLANS_BY_ENV: Record<string, string[]> = {
71
73
  stage: ['trial', 'starter', 'pro', 'enterprise'],
72
74
  prod: ['trial', 'starter', 'pro', 'enterprise'],
73
- 'cn-prod': ['trial', 'starter-cn', 'pro-cn', 'enterprise-cn'],
74
- // cn-stage 卖同一套 CNY -cn plan(billing plan 目录与 cn-prod 一致)
75
- 'cn-stage': ['trial', 'starter-cn', 'pro-cn', 'enterprise-cn'],
75
+ 'cn-prod': ['trial', 'starter', 'pro', 'enterprise', 'free'],
76
+ 'cn-stage': ['trial', 'starter', 'pro', 'enterprise', 'free'],
76
77
  };
77
78
 
78
79
  function parseArgs(args: string[]): { identifier: string; plan: string; months: number; env: string } {
@@ -81,7 +82,8 @@ function parseArgs(args: string[]): { identifier: string; plan: string; months:
81
82
 
82
83
  Options:
83
84
  --plan <id> Plan: trial, starter, pro, enterprise (default: pro)
84
- cn-prod/cn-stage plans: trial, starter-cn, pro-cn, enterprise-cn (default: pro-cn)
85
+ cn-prod/cn-stage additionally allow: free
86
+ (legacy *-cn ids are accepted and normalized to canonical)
85
87
  --months <n> Duration in months (default: 1)
86
88
  --env <env> Environment: stage, prod, cn-prod, cn-stage (default: stage)
87
89
  -h, --help Show this help`);
@@ -100,7 +102,10 @@ Options:
100
102
  }
101
103
 
102
104
  validateEnvCnProd(env);
103
- plan = plan ?? (env === 'cn-prod' || env === 'cn-stage' ? 'pro-cn' : 'pro');
105
+ // billing canonicalized plan ids (dropped the -cn suffix, optima-billing#181).
106
+ // Default to canonical `pro`; accept legacy `*-cn` input (operator muscle
107
+ // memory) and normalize so it still resolves after the -cn rows are deleted.
108
+ plan = (plan ?? 'pro').replace(/-cn$/, '');
104
109
  const allowed = PLANS_BY_ENV[env];
105
110
  if (!allowed.includes(plan)) {
106
111
  console.error(`Unknown plan for ${env}: ${plan}. Available: ${allowed.join(', ')}`);
@@ -59,15 +59,16 @@ function assertAwsEmailOnly(env, kind) {
59
59
  throw new Error('stage/prod 仅支持 email 标识;手机号/userId 解析仅 cn-prod / cn-stage 可用');
60
60
  }
61
61
  }
62
- // cn-prod sells the CNY-priced -cn plans (P12); the bare USD plan ids also
63
- // exist in the cn DB, so a per-env whitelist (not billing-side validation)
64
- // is what prevents accidentally granting a USD-priced plan to a CN user.
62
+ // All envs use canonical plan ids (no market suffix). billing canonicalized
63
+ // plan ids — dropped the `-cn` suffix; market is now carried by deployment-level
64
+ // BILLING_MARKET + the plan's `currency` column, not the id (optima-billing#181).
65
+ // cn envs additionally have the CN-only `free` tier. Per-env whitelist guards
66
+ // against granting a plan absent in that env.
65
67
  const PLANS_BY_ENV = {
66
68
  stage: ['trial', 'starter', 'pro', 'enterprise'],
67
69
  prod: ['trial', 'starter', 'pro', 'enterprise'],
68
- 'cn-prod': ['trial', 'starter-cn', 'pro-cn', 'enterprise-cn'],
69
- // cn-stage 卖同一套 CNY -cn plan(billing plan 目录与 cn-prod 一致)
70
- 'cn-stage': ['trial', 'starter-cn', 'pro-cn', 'enterprise-cn'],
70
+ 'cn-prod': ['trial', 'starter', 'pro', 'enterprise', 'free'],
71
+ 'cn-stage': ['trial', 'starter', 'pro', 'enterprise', 'free'],
71
72
  };
72
73
  function parseArgs(args) {
73
74
  if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
@@ -75,7 +76,8 @@ function parseArgs(args) {
75
76
 
76
77
  Options:
77
78
  --plan <id> Plan: trial, starter, pro, enterprise (default: pro)
78
- cn-prod/cn-stage plans: trial, starter-cn, pro-cn, enterprise-cn (default: pro-cn)
79
+ cn-prod/cn-stage additionally allow: free
80
+ (legacy *-cn ids are accepted and normalized to canonical)
79
81
  --months <n> Duration in months (default: 1)
80
82
  --env <env> Environment: stage, prod, cn-prod, cn-stage (default: stage)
81
83
  -h, --help Show this help`);
@@ -97,7 +99,10 @@ Options:
97
99
  }
98
100
  }
99
101
  (0, billing_http_1.validateEnvCnProd)(env);
100
- plan = plan ?? (env === 'cn-prod' || env === 'cn-stage' ? 'pro-cn' : 'pro');
102
+ // billing canonicalized plan ids (dropped the -cn suffix, optima-billing#181).
103
+ // Default to canonical `pro`; accept legacy `*-cn` input (operator muscle
104
+ // memory) and normalize so it still resolves after the -cn rows are deleted.
105
+ plan = (plan ?? 'pro').replace(/-cn$/, '');
101
106
  const allowed = PLANS_BY_ENV[env];
102
107
  if (!allowed.includes(plan)) {
103
108
  console.error(`Unknown plan for ${env}: ${plan}. Available: ${allowed.join(', ')}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optima-chat/dev-skills",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Claude Code Skills for Optima development team - cross-environment collaboration tools",
5
5
  "main": "index.js",
6
6
  "bin": {