@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
|
|
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
|
-
- 阿里云 **
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
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
|
+
- 旧的「buildbox → SAE `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
|
-
//
|
|
68
|
-
//
|
|
69
|
-
//
|
|
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
|
|
74
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
//
|
|
63
|
-
//
|
|
64
|
-
//
|
|
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
|
|
69
|
-
|
|
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
|
|
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
|
-
|
|
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(', ')}`);
|