@huaweidevtools/aishell-dsh-brand 0.0.10 → 0.0.11
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.
package/lib/client.js
CHANGED
|
@@ -306,6 +306,14 @@ const SUGGESTIONS = [
|
|
|
306
306
|
titleKey: "suggestion.billing.title",
|
|
307
307
|
glossKey: "suggestion.billing.gloss",
|
|
308
308
|
promptKey: "suggestion.billing.prompt"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
id: "security",
|
|
312
|
+
icon: "security",
|
|
313
|
+
hue: { tile: "var(--dsw-static-red-400)" },
|
|
314
|
+
titleKey: "suggestion.security.title",
|
|
315
|
+
glossKey: "suggestion.security.gloss",
|
|
316
|
+
promptKey: "suggestion.security.prompt"
|
|
309
317
|
}
|
|
310
318
|
];
|
|
311
319
|
|
|
@@ -379,6 +387,25 @@ function CostIcon() {
|
|
|
379
387
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Stroke, { d: "M9.5 12.2h3.2" })
|
|
380
388
|
] });
|
|
381
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* A shield with a check: the security review.
|
|
392
|
+
*
|
|
393
|
+
* A shield is the one shape in this set that carries "protection" on its own,
|
|
394
|
+
* and the check inside it reads as an inspection that came back — which is
|
|
395
|
+
* the tool's actual job (it reports what it found, not that all is well).
|
|
396
|
+
*
|
|
397
|
+
* Chosen over a magnifier, which was the other candidate: a magnifier and the
|
|
398
|
+
* already-shipped cost glyph both reduce to "a rounded outline with a small
|
|
399
|
+
* mark inside" at 17px, and magnifiers are the generic stand-in for any
|
|
400
|
+
* lookup. The shield keeps this glyph's silhouette distinct from the others.
|
|
401
|
+
*
|
|
402
|
+
* The check's elbow sits at x=11.2 and its tail rises to the shield's inner
|
|
403
|
+
* edge; both strokes stay inside the outline so nothing breaks the closed
|
|
404
|
+
* silhouette the shape rules ask for.
|
|
405
|
+
*/
|
|
406
|
+
function SecurityIcon() {
|
|
407
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Stroke, { d: "M12 3 4.8 5.9v5.3c0 4.3 2.9 8.3 7.2 9.9 4.3-1.6 7.2-5.6 7.2-9.9V5.9z" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Stroke, { d: "m8.9 12.1 2.3 2.3 4.4-4.4" })] });
|
|
408
|
+
}
|
|
382
409
|
/** Resolve one icon key to its glyph. */
|
|
383
410
|
function SuggestionIconArt({ icon, size = 20 }) {
|
|
384
411
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
@@ -391,7 +418,8 @@ function SuggestionIconArt({ icon, size = 20 }) {
|
|
|
391
418
|
icon === "cloud" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InventoryIcon, {}),
|
|
392
419
|
icon === "deploy" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DeployIcon, {}),
|
|
393
420
|
icon === "architecture" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ArchitectureIcon, {}),
|
|
394
|
-
icon === "cost" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CostIcon, {})
|
|
421
|
+
icon === "cost" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CostIcon, {}),
|
|
422
|
+
icon === "security" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SecurityIcon, {})
|
|
395
423
|
]
|
|
396
424
|
});
|
|
397
425
|
}
|
|
@@ -499,7 +527,7 @@ function ringStep(pos, delta, n) {
|
|
|
499
527
|
*
|
|
500
528
|
* ## Why the strip advances on its own
|
|
501
529
|
*
|
|
502
|
-
* The strip shows three of
|
|
530
|
+
* The strip shows three of five cards, so cards are always off screen and a
|
|
503
531
|
* reader who never touches the arrows never learns it exists. Rotation is what
|
|
504
532
|
* makes the set self-evident. The cost is that content moves without being
|
|
505
533
|
* asked to, which is why every reason to stop is collected here rather than
|
|
@@ -1226,10 +1254,13 @@ const zh = {
|
|
|
1226
1254
|
"suggestion.deploy.prompt": "我要部署一个轻量级 Web 应用,请对比几种可行的部署方案,说明各自的适用规模、月度成本量级和运维复杂度,并给出你的推荐及理由。",
|
|
1227
1255
|
"suggestion.enterprise.title": "企业上云",
|
|
1228
1256
|
"suggestion.enterprise.gloss": "多账号、网络分区与权限边界的整体设计",
|
|
1229
|
-
"suggestion.enterprise.prompt": "
|
|
1257
|
+
"suggestion.enterprise.prompt": "一家 200 人的电商公司要把业务迁到华为云,需要满足等保三级。现状是开发、测试、生产共用一套 VPC,没有做网络隔离。请设计改造方案:账号怎么划分,VPC 和子网如何切分,安全组规则怎么定,以及迁移的先后顺序和每一步的风险。",
|
|
1230
1258
|
"suggestion.billing.title": "账单分析",
|
|
1231
1259
|
"suggestion.billing.gloss": "分析上个月的云资源支出",
|
|
1232
|
-
"suggestion.billing.prompt": "请分析我上个月的云资源支出构成,找出占比最高的几项服务,指出其中可以优化或降配的部分,并估算调整后能节省多少。"
|
|
1260
|
+
"suggestion.billing.prompt": "请分析我上个月的云资源支出构成,找出占比最高的几项服务,指出其中可以优化或降配的部分,并估算调整后能节省多少。",
|
|
1261
|
+
"suggestion.security.title": "安全审查",
|
|
1262
|
+
"suggestion.security.gloss": "检查云资源是否存在安全问题",
|
|
1263
|
+
"suggestion.security.prompt": "请检查我的华为云资源是否存在安全问题,重点看安全组规则、端口暴露、存储权限和密钥管理,指出高危项并给出修复建议。"
|
|
1233
1264
|
};
|
|
1234
1265
|
/** English dictionary. Complete against {@link zh}; also the terminal fallback. */
|
|
1235
1266
|
const en = {
|
|
@@ -1243,10 +1274,13 @@ const en = {
|
|
|
1243
1274
|
"suggestion.deploy.prompt": "I want to deploy a lightweight web application. Compare a few viable deployment options, covering the scale each one suits, its order-of-magnitude monthly cost, and its operational complexity, then recommend one and explain why.",
|
|
1244
1275
|
"suggestion.enterprise.title": "Landing zone",
|
|
1245
1276
|
"suggestion.enterprise.gloss": "Multi-account structure, network and permission boundaries",
|
|
1246
|
-
"suggestion.enterprise.prompt": "
|
|
1277
|
+
"suggestion.enterprise.prompt": "A 200-person e-commerce company is migrating to Huawei Cloud and must meet Level 3 of China's Multi-Level Protection Scheme (等保三级). Today development, test and production share a single VPC with no network isolation. Design the migration: how to split the accounts, how to divide the VPC and subnets, what the security group rules should be, and the order to migrate in with the risk at each step.",
|
|
1247
1278
|
"suggestion.billing.title": "Billing analysis",
|
|
1248
1279
|
"suggestion.billing.gloss": "Break down last month's cloud spend",
|
|
1249
|
-
"suggestion.billing.prompt": "Analyse my cloud spend for last month, identify the services that account for the largest share, point out what could be optimised or downsized, and estimate how much that would save."
|
|
1280
|
+
"suggestion.billing.prompt": "Analyse my cloud spend for last month, identify the services that account for the largest share, point out what could be optimised or downsized, and estimate how much that would save.",
|
|
1281
|
+
"suggestion.security.title": "Security review",
|
|
1282
|
+
"suggestion.security.gloss": "Check the cloud resources for security problems",
|
|
1283
|
+
"suggestion.security.prompt": "Check my Huawei Cloud resources for security problems, looking in particular at security group rules, exposed ports, storage permissions and key management. Point out anything high-risk and suggest how to fix it."
|
|
1250
1284
|
};
|
|
1251
1285
|
|
|
1252
1286
|
//#endregion
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
*
|
|
78
78
|
* ## Auto-rotation
|
|
79
79
|
*
|
|
80
|
-
* The strip shows three of
|
|
80
|
+
* The strip shows three of five cards, so two would otherwise be
|
|
81
81
|
* invisible to anyone who does not touch the arrows. It advances one card
|
|
82
82
|
* every {@link AUTOPLAY_INTERVAL_MS}, pausing on hover, on keyboard focus, in
|
|
83
83
|
* a background tab, and under `prefers-reduced-motion`. The policy itself
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* ## Why the strip advances on its own
|
|
9
9
|
*
|
|
10
|
-
* The strip shows three of
|
|
10
|
+
* The strip shows three of five cards, so cards are always off screen and a
|
|
11
11
|
* reader who never touches the arrows never learns it exists. Rotation is what
|
|
12
12
|
* makes the set self-evident. The cost is that content moves without being
|
|
13
13
|
* asked to, which is why every reason to stop is collected here rather than
|
|
@@ -34,10 +34,13 @@ export declare const zh: {
|
|
|
34
34
|
readonly 'suggestion.deploy.prompt': "我要部署一个轻量级 Web 应用,请对比几种可行的部署方案,说明各自的适用规模、月度成本量级和运维复杂度,并给出你的推荐及理由。";
|
|
35
35
|
readonly 'suggestion.enterprise.title': "企业上云";
|
|
36
36
|
readonly 'suggestion.enterprise.gloss': "多账号、网络分区与权限边界的整体设计";
|
|
37
|
-
readonly 'suggestion.enterprise.prompt': "
|
|
37
|
+
readonly 'suggestion.enterprise.prompt': "一家 200 人的电商公司要把业务迁到华为云,需要满足等保三级。现状是开发、测试、生产共用一套 VPC,没有做网络隔离。请设计改造方案:账号怎么划分,VPC 和子网如何切分,安全组规则怎么定,以及迁移的先后顺序和每一步的风险。";
|
|
38
38
|
readonly 'suggestion.billing.title': "账单分析";
|
|
39
39
|
readonly 'suggestion.billing.gloss': "分析上个月的云资源支出";
|
|
40
40
|
readonly 'suggestion.billing.prompt': "请分析我上个月的云资源支出构成,找出占比最高的几项服务,指出其中可以优化或降配的部分,并估算调整后能节省多少。";
|
|
41
|
+
readonly 'suggestion.security.title': "安全审查";
|
|
42
|
+
readonly 'suggestion.security.gloss': "检查云资源是否存在安全问题";
|
|
43
|
+
readonly 'suggestion.security.prompt': "请检查我的华为云资源是否存在安全问题,重点看安全组规则、端口暴露、存储权限和密钥管理,指出高危项并给出修复建议。";
|
|
41
44
|
};
|
|
42
45
|
/** English dictionary. Complete against {@link zh}; also the terminal fallback. */
|
|
43
46
|
export declare const en: {
|
|
@@ -55,6 +58,9 @@ export declare const en: {
|
|
|
55
58
|
readonly 'suggestion.billing.title': "Billing analysis";
|
|
56
59
|
readonly 'suggestion.billing.gloss': "Break down last month's cloud spend";
|
|
57
60
|
readonly 'suggestion.billing.prompt': string;
|
|
61
|
+
readonly 'suggestion.security.title': "Security review";
|
|
62
|
+
readonly 'suggestion.security.gloss': "Check the cloud resources for security problems";
|
|
63
|
+
readonly 'suggestion.security.prompt': string;
|
|
58
64
|
};
|
|
59
65
|
/** Every key, derived from the zh dictionary (the source of truth). */
|
|
60
66
|
export type AishellBrandLocaleKey = keyof typeof zh;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Inline SVG artwork for the suggestion cards.
|
|
3
3
|
*
|
|
4
|
-
* Inline rather than an icon dependency: the strip draws
|
|
4
|
+
* Inline rather than an icon dependency: the strip draws five shapes, and a
|
|
5
5
|
* dependency would add a package, a version to track, and a bundle face to
|
|
6
6
|
* keep in step with the host.
|
|
7
7
|
*
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
*
|
|
14
14
|
* The first draft drew "deploy" as a box with an arrow leaving it — which
|
|
15
15
|
* reads as SHARE or export, the one meaning this card must not carry. A
|
|
16
|
-
* glyph in a row
|
|
16
|
+
* glyph in a row is read at a glance and out of context, so each one
|
|
17
17
|
* has to be recognisable on its own:
|
|
18
18
|
*
|
|
19
19
|
* - nothing may resemble the share glyph (box + outward arrow) or the
|
|
20
20
|
* external-link glyph (box + arrow through a corner);
|
|
21
21
|
* - every shape is closed and filled-ish in silhouette, because outlines
|
|
22
|
-
* at 20px in a row
|
|
22
|
+
* at 20px in a row blur into each other;
|
|
23
23
|
* - no glyph carries more than three strokes, so they stay distinguishable
|
|
24
24
|
* at the size they are actually drawn.
|
|
25
25
|
*
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
*
|
|
27
27
|
* Three cards share one row, which at the default column leaves roughly 150px
|
|
28
28
|
* per title — about seven CJK glyphs, or noticeably more Latin ones. Measured
|
|
29
|
-
* against the shipped set: every title fits at 560px and above, and all
|
|
29
|
+
* against the shipped set: every title fits at 560px and above, and all five
|
|
30
30
|
* clip below ~460px. Keep them within a couple of characters of each other —
|
|
31
31
|
* the longest one is otherwise the only card that ever shows an ellipsis,
|
|
32
32
|
* which reads as a bug rather than as a long name.
|
|
@@ -54,13 +54,13 @@ export interface Suggestion {
|
|
|
54
54
|
readonly promptKey: AishellBrandLocaleKey;
|
|
55
55
|
}
|
|
56
56
|
/** The icon set this strip can draw. Keys are local to this plugin. */
|
|
57
|
-
export type SuggestionIcon = 'cloud' | 'deploy' | 'architecture' | 'cost';
|
|
57
|
+
export type SuggestionIcon = 'cloud' | 'deploy' | 'architecture' | 'cost' | 'security';
|
|
58
58
|
/**
|
|
59
59
|
* The tile colour for one card, as the shell's own token names.
|
|
60
60
|
*
|
|
61
61
|
* ## Why each card carries its own hue
|
|
62
62
|
*
|
|
63
|
-
* The first version drew every icon in one accent, on the reasoning that
|
|
63
|
+
* The first version drew every icon in one accent, on the reasoning that five
|
|
64
64
|
* hues beside the brand mark would read as noise. That was a guess, and the
|
|
65
65
|
* shell contradicts it: `FileTypeIcon` gives every item in a row its own hue
|
|
66
66
|
* (`code` blue, `excel` green, `folder` amber, `image` violet), which is the
|
|
@@ -83,15 +83,17 @@ export type SuggestionIcon = 'cloud' | 'deploy' | 'architecture' | 'cost';
|
|
|
83
83
|
* artwork. The same value is reused here rather than inventing a second one,
|
|
84
84
|
* and it is the only literal colour in this plugin.
|
|
85
85
|
*
|
|
86
|
-
* The
|
|
86
|
+
* The five were picked to clear three bars at once, in both themes:
|
|
87
87
|
*
|
|
88
88
|
* - glyph on its tile >= 4.5 — measured 5.42 at worst (violet);
|
|
89
89
|
* - tile against the card >= 1.6 — measured 2.05 at worst;
|
|
90
90
|
* - worst pairwise colour distance >= 30 (CIE76 dE) — measured 38.7.
|
|
91
91
|
*
|
|
92
|
-
* The last bar is the one that matters for "
|
|
92
|
+
* The last bar is the one that matters for "five colours, not one blur": an
|
|
93
93
|
* obvious-looking pick like blue + violet measures only 17.5 apart, which is
|
|
94
|
-
* why this is measured rather than eyeballed.
|
|
94
|
+
* why this is measured rather than eyeballed. Adding the fifth hue did not
|
|
95
|
+
* move either floor — red's nearest neighbour is amber at 42.9, and the
|
|
96
|
+
* tightest pair is still blue vs violet.
|
|
95
97
|
*/
|
|
96
98
|
export interface SuggestionHue {
|
|
97
99
|
/**
|
package/package.json
CHANGED