@geoly-ai/skills-hub 0.3.8 → 0.3.9
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/package.json +1 -1
- package/src/commands/install.mjs +10 -2
- package/src/commands/update.mjs +3 -1
package/package.json
CHANGED
package/src/commands/install.mjs
CHANGED
|
@@ -906,14 +906,22 @@ function emitTelemetry(ctx, results, perClient, snap) {
|
|
|
906
906
|
if (!rec) return;
|
|
907
907
|
for (const r of results) {
|
|
908
908
|
// 🔴 每个 target 记的是**它自己那份名单**(--all 下按 client 各不相同)
|
|
909
|
-
|
|
909
|
+
const recs = perClient.get(r.client)?.records ?? [];
|
|
910
|
+
for (const a of recs) {
|
|
910
911
|
// 🔴 `reason` 只能来自 REASONS 有限代码表;`record()` 自己不抛,但传错值会被它内部
|
|
911
912
|
// 的 assertValidEvent 拒掉并静默丢事件 —— 所以 reason 由 classify() 产出。
|
|
912
913
|
rec({
|
|
913
914
|
artifact: a.id,
|
|
914
915
|
client: r.client,
|
|
915
916
|
kind: 'install',
|
|
916
|
-
|
|
917
|
+
// 🔴 `r.ms` 是**整个 target 事务**的耗时,拆不到事务里的单个制品上。
|
|
918
|
+
// 早先每个制品都记同一个 r.ms:一次装 N 个就把这批耗时算了 N 遍,
|
|
919
|
+
// 服务端按制品版本算的分位数因此按制品数加权(2026-09-14 用户要求修)。
|
|
920
|
+
// 现在只有「这个 target 这次只装了一个制品」时才带 ms —— 分位数的口径
|
|
921
|
+
// 就是「单个制品装一次要多久」。多个 spec / --all 的批量安装不带 ms。
|
|
922
|
+
// ⚠️ 这里的名单是**请求的 root**:装 pack 只有 pack 自己一条,成员不各记一条,
|
|
923
|
+
// 所以 pack 算「一个制品」,带 ms。
|
|
924
|
+
ms: recs.length === 1 ? r.ms : undefined,
|
|
917
925
|
reason: r.ok ? undefined : r.reason,
|
|
918
926
|
result: r.ok ? 'ok' : 'failed',
|
|
919
927
|
scope: r.scope,
|
package/src/commands/update.mjs
CHANGED
|
@@ -831,7 +831,9 @@ function emitTelemetry(ctx, results, previews) {
|
|
|
831
831
|
}
|
|
832
832
|
for (const a of recs) {
|
|
833
833
|
rec({
|
|
834
|
-
|
|
834
|
+
// 🔴 同 install.mjs emitTelemetry:r.ms 是整个 target 事务的耗时,
|
|
835
|
+
// 一次更新多个制品时不带 ms,免得同一批耗时被算 N 遍。
|
|
836
|
+
artifact: a.id, client: r.client, kind: 'update', ms: recs.length === 1 ? r.ms : undefined,
|
|
835
837
|
reason: r.ok ? undefined : r.reason, result: r.ok ? 'ok' : 'failed',
|
|
836
838
|
scope: r.scope, version: a.version,
|
|
837
839
|
});
|