@senguoyun/dsh-arkme 0.1.58 → 0.1.59

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.
@@ -12,7 +12,7 @@ npm 接受发布请求后仍可能异步处理版本。工作流以 15 分钟为
12
12
 
13
13
  每次普通 PR 发版时,会查询当前 master 版本对应的 `release/v<版本号>` PR 是否已合并。已经合并表示该版本已分配,即使 npm latest 仍落后,新一轮发版也会递增 patch,避免复用可能已经上线的 Runtime 版本。未分配的显式版本递增仍保持原版本;重跑同一次发版时,先复用已有 `release_sha`,并从该提交读取原版本,不重复分配。
14
14
 
15
- npm 失败时,Runtime 可以先完成上线,对应的 Git Tag 和 GitHub Release 可能暂未创建。可重跑 npm 所在工作流的失败 job,继续发布同一提交的 npm 包。两条链路的结果分别查看 npm Action 与生产 Runtime Action;派发成功仅表示事件已发出。
15
+ npm 失败时,Runtime 可以先完成上线,对应的 Git Tag 和 GitHub Release 可能暂未创建。可重跑 npm 所在工作流的失败 job,继续发布同一提交的 npm 包。若版本已经可读且 integrity 一致,则跳过重复发布;若发布返回版本已暂存(staged 409)或已发布的冲突,则继续进入上述回读校验。发布命令最多等待 180 秒,命令超时或网络超时/连接重置同样转入回读,避免服务端已经接受请求、客户端却认为失败。权限、认证及其他错误仍立即失败;冲突或超时本身不算发布成功,必须通过 integrity 与 provenance 校验才能继续后续流程。若 npm 一直没有对外提供该版本,回读仍会超时报错。两条链路的结果分别查看 npm Action 与生产 Runtime Action;派发成功仅表示事件已发出。
16
16
 
17
17
  `pre-release` 分支的每次 push 会走同一套 Runtime 发布链路,但不会发布 npm。测试版本由稳定基准版本的下一补丁与 GitHub run number 组成,例如 `0.1.34` 在 run `128` 中生成 `0.1.35-pre.128`;版本修改只存在于 Action 临时工作区。
18
18
 
package/lib/client.js CHANGED
@@ -5934,7 +5934,7 @@ window.__ModuleLoader__.load({
5934
5934
  qrcode.stringToBytes;
5935
5935
  //#endregion
5936
5936
  //#region package.json
5937
- var version$3 = "0.1.58";
5937
+ var version$3 = "0.1.59";
5938
5938
  //#endregion
5939
5939
  //#region src/client/arkme-billing.css?inline
5940
5940
  var arkme_billing_default = ".arkme-billing-backdrop {\n z-index: 120;\n backdrop-filter: blur(3px);\n background: #181b223d;\n place-items: center;\n padding: 28px;\n display: grid;\n position: fixed;\n inset: 0;\n}\n\n.arkme-billing-recharge-dialog, .arkme-billing-payment-dialog {\n color: #20232c;\n background: #fff;\n border: 1px solid #dedfe3;\n border-radius: 20px;\n width: min(620px, 100%);\n max-height: min(720px, 100vh - 56px);\n overflow-y: auto;\n box-shadow: 0 24px 72px #191c232e;\n}\n\n.arkme-billing-payment-dialog {\n width: min(420px, 100%);\n}\n\n.arkme-billing-dialog-header {\n border-bottom: 1px solid #ececef;\n justify-content: space-between;\n align-items: flex-start;\n gap: 18px;\n min-height: 78px;\n padding: 20px 22px 16px;\n display: flex;\n}\n\n.arkme-billing-dialog-header h2 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n line-height: 25px;\n}\n\n.arkme-billing-dialog-header p {\n overflow-wrap: anywhere;\n color: #8a8e96;\n margin: 4px 0 0;\n font-size: 12px;\n line-height: 18px;\n}\n\n.arkme-billing-dialog-header > button {\n color: #777c85;\n width: 32px;\n height: 32px;\n font: inherit;\n cursor: pointer;\n background: none;\n border: 0;\n border-radius: 9px;\n flex: none;\n place-items: center;\n font-size: 22px;\n display: grid;\n}\n\n.arkme-billing-dialog-header > button:hover {\n color: #20232c;\n background: #f3f3f5;\n}\n\n.arkme-billing-dialog-body {\n padding: 18px 22px 22px;\n}\n\n.arkme-billing-dialog-balance {\n border-bottom: 1px solid #ececef;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n column-gap: 12px;\n min-height: 48px;\n padding: 0 2px 16px;\n display: grid;\n}\n\n.arkme-billing-dialog-balance > span {\n color: #8a8e96;\n grid-column: 1;\n font-size: 11px;\n line-height: 16px;\n}\n\n.arkme-billing-dialog-balance > strong {\n grid-column: 1;\n font-size: 22px;\n font-weight: 600;\n line-height: 28px;\n}\n\n.arkme-billing-dialog-balance > button, .arkme-billing-error > button {\n color: #626772;\n height: 30px;\n font: inherit;\n cursor: pointer;\n background: #fff;\n border: 1px solid #dfe1e5;\n border-radius: 9px;\n grid-area: 1 / 2 / span 2;\n padding: 0 12px;\n font-size: 11px;\n}\n\n.arkme-billing-products-section, .arkme-billing-payment-section {\n padding-top: 17px;\n}\n\n.arkme-billing-products-section h3, .arkme-billing-payment-section h3 {\n color: #747984;\n margin: 0 0 11px;\n font-size: 12px;\n font-weight: 500;\n line-height: 18px;\n}\n\n.arkme-billing-product-grid {\n width: 100%;\n}\n\n.arkme-billing-product-grid > button {\n color: #20232c;\n min-width: 0;\n min-height: 62px;\n font: inherit;\n text-align: left;\n cursor: pointer;\n background: #fff;\n border: 1px solid #dfe1e5;\n border-radius: 11px;\n align-content: center;\n gap: 4px;\n padding: 9px 11px;\n display: grid;\n}\n\n.arkme-billing-product-grid > button:hover {\n background: #f8f8f9;\n border-color: #cfd2d8;\n}\n\n.arkme-billing-product-grid > button.is-selected {\n border-color: #75839e;\n box-shadow: 0 0 0 1px #75839e;\n}\n\n.arkme-billing-product-grid > button > span {\n white-space: nowrap;\n text-overflow: ellipsis;\n font-size: 12px;\n font-weight: 500;\n line-height: 17px;\n overflow: hidden;\n}\n\n.arkme-billing-product-grid > button > strong {\n font-size: 14px;\n font-weight: 600;\n line-height: 19px;\n}\n\n.arkme-billing-payment-actions {\n flex-wrap: wrap;\n gap: 10px;\n display: flex;\n}\n\n.arkme-billing-payment-actions > button {\n color: #333842;\n min-width: 154px;\n height: 38px;\n font: inherit;\n cursor: pointer;\n background: #fff;\n border: 1px solid #dfe1e5;\n border-radius: 10px;\n justify-content: center;\n align-items: center;\n gap: 8px;\n padding: 0 14px;\n font-size: 12px;\n display: inline-flex;\n}\n\n.arkme-billing-payment-actions > button:hover {\n background: #f7f7f8;\n border-color: #cfd3da;\n}\n\n.arkme-billing-payment-actions > button:disabled, .arkme-billing-product-grid > button:disabled {\n opacity: .48;\n cursor: default;\n}\n\n.arkme-billing-platform-icon {\n flex: none;\n width: 18px;\n height: 18px;\n}\n\n.arkme-billing-platform-icon.is-alipay {\n color: #1677ff;\n}\n\n.arkme-billing-platform-icon.is-wechat {\n color: #07c160;\n}\n\n.arkme-billing-state {\n color: #858992;\n margin: 12px 0 2px;\n font-size: 12px;\n line-height: 18px;\n}\n\n.arkme-billing-error {\n color: #b54841;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n margin-top: 10px;\n font-size: 12px;\n line-height: 18px;\n display: flex;\n}\n\n.arkme-billing-error.is-purchase {\n justify-content: flex-start;\n}\n\n.arkme-billing-payment-content {\n text-align: center;\n justify-items: center;\n gap: 10px;\n padding: 28px 24px 18px;\n display: grid;\n}\n\n.arkme-billing-payment-content > .arkme-billing-platform-icon {\n width: 38px;\n height: 38px;\n margin-bottom: 4px;\n}\n\n.arkme-billing-payment-content > img {\n border-radius: 10px;\n width: 210px;\n height: 210px;\n}\n\n.arkme-billing-payment-content > strong {\n font-size: 14px;\n font-weight: 600;\n line-height: 21px;\n}\n\n.arkme-billing-payment-content > p {\n color: #858992;\n margin: 0;\n font-size: 12px;\n line-height: 18px;\n}\n\n.arkme-billing-payment-content.is-paid > strong {\n color: #16794f;\n font-size: 18px;\n line-height: 25px;\n}\n\n.arkme-billing-payment-content.is-paid > .arkme-billing-error {\n justify-content: center;\n}\n\n.arkme-billing-payment-content.is-crediting > strong {\n color: #335f9e;\n}\n\n.arkme-billing-dialog-actions {\n flex-wrap: wrap;\n justify-content: center;\n gap: 9px;\n padding: 0 22px 20px;\n display: flex;\n}\n\n.arkme-billing-dialog-actions > button, .arkme-billing-primary-action {\n color: #3c424d;\n height: 34px;\n font: inherit;\n cursor: pointer;\n background: #fff;\n border: 1px solid #dfe1e5;\n border-radius: 9px;\n padding: 0 14px;\n font-size: 12px;\n}\n\n.arkme-billing-dialog-actions > .arkme-billing-primary-action, .arkme-billing-payment-content > .arkme-billing-primary-action {\n color: #fff;\n background: #20232d;\n border-color: #20232d;\n}\n";
@@ -50818,6 +50818,7 @@ html body {
50818
50818
  video: active && reception.localRef !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("video", {
50819
50819
  ref: videoRef,
50820
50820
  src: arkmeLocalFileUrl(reception.localRef),
50821
+ muted: true,
50821
50822
  playsInline: true,
50822
50823
  "aria-label": `实况 ${cover.fileName}`,
50823
50824
  style: {
@@ -50850,12 +50851,12 @@ html body {
50850
50851
  alignItems: "center",
50851
50852
  gap: 6
50852
50853
  },
50853
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
50854
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
50854
50855
  type: "button",
50855
50856
  "data-arkme-live-photo-control": true,
50856
50857
  "aria-label": phase === "loading" ? "实况加载中" : motion === void 0 ? "实况动态片段不可用" : "播放实况",
50857
50858
  "aria-busy": phase === "loading",
50858
- title: phase === "loading" ? "实况加载中" : motion === void 0 ? "实况动态片段不可用" : "播放实况",
50859
+ title: motion === void 0 ? "实况动态片段不可用" : "播放实况",
50859
50860
  disabled: active || motion === void 0,
50860
50861
  onClick: start,
50861
50862
  style: {
@@ -50871,10 +50872,7 @@ html body {
50871
50872
  fontSize: 12,
50872
50873
  cursor: active ? "progress" : motion === void 0 ? "default" : "pointer"
50873
50874
  },
50874
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ArkmeLivePhotoBadge, {}), phase === "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
50875
- role: "status",
50876
- children: "加载中"
50877
- })]
50875
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ArkmeLivePhotoBadge, {})
50878
50876
  }), phase === "failed" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
50879
50877
  role: "alert",
50880
50878
  style: {
@@ -154959,6 +154957,10 @@ body[data-ds-dark-theme] .arkme-mention-all-avatar [data-arkme-theme-image="dark
154959
154957
  const [page, setPage] = (0, react$1.useState)();
154960
154958
  const [historyState, setHistoryState] = (0, react$1.useState)("loading");
154961
154959
  const [historyError, setHistoryError] = (0, react$1.useState)("");
154960
+ const [loadingMore, setLoadingMore] = (0, react$1.useState)(false);
154961
+ const [loadMoreError, setLoadMoreError] = (0, react$1.useState)("");
154962
+ const paginationAbortRef = (0, react$1.useRef)();
154963
+ const listRef = (0, react$1.useRef)(null);
154962
154964
  const [selectedRef, setSelectedRef] = (0, react$1.useState)("");
154963
154965
  const [detail, setDetail] = (0, react$1.useState)();
154964
154966
  const [detailState, setDetailState] = (0, react$1.useState)("idle");
@@ -154977,11 +154979,17 @@ body[data-ds-dark-theme] .arkme-mention-all-avatar [data-arkme-theme-image="dark
154977
154979
  const [officialAuthorProfile, setOfficialAuthorProfile] = (0, react$1.useState)();
154978
154980
  const searchRef = (0, react$1.useRef)(null);
154979
154981
  const historyGenerationRef = (0, react$1.useRef)(0);
154982
+ const historyRefreshingRef = (0, react$1.useRef)(false);
154980
154983
  const historyAbortRef = (0, react$1.useRef)();
154981
154984
  const historyRefreshTimerRef = (0, react$1.useRef)();
154982
154985
  const detailGenerationRef = (0, react$1.useRef)(0);
154983
154986
  const refreshHistory = (0, react$1.useCallback)((options = {}) => {
154987
+ historyRefreshingRef.current = true;
154984
154988
  historyAbortRef.current?.abort();
154989
+ paginationAbortRef.current?.abort();
154990
+ paginationAbortRef.current = void 0;
154991
+ setLoadingMore(false);
154992
+ setLoadMoreError("");
154985
154993
  const controller = new AbortController();
154986
154994
  historyAbortRef.current = controller;
154987
154995
  const generation = historyGenerationRef.current + 1;
@@ -154994,18 +155002,62 @@ body[data-ds-dark-theme] .arkme-mention-all-avatar [data-arkme-theme-image="dark
154994
155002
  }, controller.signal).then(async (value) => {
154995
155003
  await preloadHistoryAvatars(value);
154996
155004
  if (controller.signal.aborted || historyGenerationRef.current !== generation) return;
155005
+ historyRefreshingRef.current = false;
154997
155006
  setPage(value);
154998
155007
  setHistoryState("ready");
154999
155008
  }).catch((error) => {
155000
155009
  if (controller.signal.aborted || historyGenerationRef.current !== generation || options.silent === true) return;
155001
155010
  setHistoryError(readableError(error));
155002
155011
  setHistoryState("error");
155012
+ }).finally(() => {
155013
+ if (historyGenerationRef.current === generation) historyRefreshingRef.current = false;
155003
155014
  });
155004
155015
  }, []);
155016
+ const loadMoreHistory = (0, react$1.useCallback)(async () => {
155017
+ if (historyState !== "ready" || historyRefreshingRef.current || historyAbortRef.current?.signal.aborted || paginationAbortRef.current || !page?.hasMore || !page.nextCursor) return;
155018
+ const controller = new AbortController();
155019
+ paginationAbortRef.current = controller;
155020
+ const generation = historyGenerationRef.current;
155021
+ setLoadingMore(true);
155022
+ setLoadMoreError("");
155023
+ try {
155024
+ const value = await callArkme("calls.history.list", {
155025
+ limit: 30,
155026
+ cursor: page.nextCursor,
155027
+ includeRecentContacts: false
155028
+ }, controller.signal);
155029
+ if (value.hasMore && (!value.nextCursor?.trim() || value.nextCursor === page.nextCursor)) throw new Error("通话记录分页游标无效,请重试");
155030
+ await preloadHistoryAvatars(value);
155031
+ if (controller.signal.aborted || historyGenerationRef.current !== generation) return;
155032
+ setPage((previous) => previous === void 0 ? value : {
155033
+ ...previous,
155034
+ items: Array.from(new Map([...previous.items, ...value.items].map((item) => [item.stableId || item.callRef, item])).values()),
155035
+ hasMore: value.hasMore,
155036
+ nextCursor: value.nextCursor ?? ""
155037
+ });
155038
+ } catch (error) {
155039
+ if (!controller.signal.aborted && historyGenerationRef.current === generation) setLoadMoreError(readableError(error));
155040
+ } finally {
155041
+ if (paginationAbortRef.current === controller) {
155042
+ paginationAbortRef.current = void 0;
155043
+ setLoadingMore(false);
155044
+ }
155045
+ }
155046
+ }, [page, historyState]);
155047
+ (0, react$1.useEffect)(() => {
155048
+ const list = listRef.current;
155049
+ if (list && !loadingMore && !loadMoreError && list.scrollHeight <= list.clientHeight) loadMoreHistory();
155050
+ }, [
155051
+ loadMoreHistory,
155052
+ loadingMore,
155053
+ loadMoreError,
155054
+ query
155055
+ ]);
155005
155056
  (0, react$1.useEffect)(() => {
155006
155057
  refreshHistory();
155007
155058
  return () => {
155008
155059
  historyAbortRef.current?.abort();
155060
+ paginationAbortRef.current?.abort();
155009
155061
  if (historyRefreshTimerRef.current !== void 0) clearTimeout(historyRefreshTimerRef.current);
155010
155062
  };
155011
155063
  }, [refreshHistory]);
@@ -155086,7 +155138,7 @@ body[data-ds-dark-theme] .arkme-mention-all-avatar [data-arkme-theme-image="dark
155086
155138
  };
155087
155139
  }, [pickerOpen, pickerQuery]);
155088
155140
  const realItems = page?.items ?? [];
155089
- const sampleItems = historyState === "ready" ? SAMPLE_CALLS : [];
155141
+ const sampleItems = historyState === "ready" && page?.hasMore === false ? SAMPLE_CALLS : [];
155090
155142
  const selectableItems = historyState === "ready" ? [...realItems, ...sampleItems] : realItems;
155091
155143
  const recentContacts = page?.recentContacts ?? [];
155092
155144
  const usingSampleContacts = historyState === "ready" && recentContacts.length === 0;
@@ -155501,12 +155553,72 @@ body[data-ds-dark-theme] .arkme-mention-all-avatar [data-arkme-theme-image="dark
155501
155553
  }) : historyState === "error" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
155502
155554
  style: styles$33.status,
155503
155555
  children: historyError || "通话记录暂时不可用"
155504
- }) : callRows.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
155505
- style: styles$33.status,
155506
- children: query.trim() === "" ? "还没有通话记录" : "没有符合条件的通话"
155507
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
155556
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("ul", {
155557
+ ref: listRef,
155558
+ "aria-label": "通话记录列表",
155508
155559
  style: styles$33.list,
155509
- children: callRows.map((row) => renderCallRow(row.item, row.sample))
155560
+ onScroll: (event) => {
155561
+ const list = event.currentTarget;
155562
+ if (!loadMoreError && list.scrollHeight - list.scrollTop - list.clientHeight <= 200) loadMoreHistory();
155563
+ },
155564
+ children: [
155565
+ callRows.map((row) => renderCallRow(row.item, row.sample)),
155566
+ callRows.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
155567
+ style: styles$33.status,
155568
+ children: query.trim() === "" ? "还没有通话记录" : "没有符合条件的通话"
155569
+ }),
155570
+ loadingMore && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
155571
+ role: "status",
155572
+ style: styles$33.status,
155573
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
155574
+ width: "14",
155575
+ height: "14",
155576
+ viewBox: "0 0 20 20",
155577
+ "aria-hidden": "true",
155578
+ style: {
155579
+ verticalAlign: "middle",
155580
+ marginRight: 6
155581
+ },
155582
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
155583
+ cx: "10",
155584
+ cy: "10",
155585
+ r: "8",
155586
+ fill: "none",
155587
+ stroke: "currentColor",
155588
+ strokeWidth: "2",
155589
+ strokeDasharray: "35 16",
155590
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("animateTransform", {
155591
+ attributeName: "transform",
155592
+ type: "rotate",
155593
+ from: "0 10 10",
155594
+ to: "360 10 10",
155595
+ dur: "0.8s",
155596
+ repeatCount: "indefinite"
155597
+ })
155598
+ })
155599
+ }), "加载更多…"]
155600
+ }),
155601
+ !loadingMore && loadMoreError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
155602
+ style: styles$33.status,
155603
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
155604
+ type: "button",
155605
+ onClick: () => {
155606
+ loadMoreHistory();
155607
+ },
155608
+ style: {
155609
+ color: "inherit",
155610
+ background: "none",
155611
+ border: 0,
155612
+ cursor: "pointer"
155613
+ },
155614
+ children: "加载失败,点击重试"
155615
+ })
155616
+ }),
155617
+ !loadingMore && !loadMoreError && page?.hasMore === false && realItems.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
155618
+ style: styles$33.status,
155619
+ children: "没有更多了"
155620
+ })
155621
+ ]
155510
155622
  })]
155511
155623
  })
155512
155624
  ]