@senguoyun/dsh-arkme 0.1.52 → 0.1.53

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.
Files changed (92) hide show
  1. package/assets/desktop_call/call-demo-peer.png +0 -0
  2. package/assets/desktop_call/call-demo-self.png +0 -0
  3. package/assets/desktop_call/call-demo-utterance-v1.m4a +0 -0
  4. package/assets/desktop_call/call-demo-utterance-v1.md +14 -0
  5. package/lib/client.js +12157 -4480
  6. package/lib/client.js.map +1 -1
  7. package/lib/harness-onboarding-client.js +73 -0
  8. package/lib/index.js +66 -2
  9. package/lib/persistent-extension.js +1 -1
  10. package/lib/{persistent-runtime-BRy2sNmS.js → persistent-runtime-Bu8Zk87a.js} +380 -355
  11. package/lib/types/arkme-service.d.ts +3 -0
  12. package/lib/types/arkme-service.d.ts.map +1 -1
  13. package/lib/types/client/ArkmeCallDetailContent.d.ts +2 -1
  14. package/lib/types/client/ArkmeCallDetailContent.d.ts.map +1 -1
  15. package/lib/types/client/ArkmeCallSurface.d.ts.map +1 -1
  16. package/lib/types/client/ArkmeCallTour.d.ts +22 -0
  17. package/lib/types/client/ArkmeCallTour.d.ts.map +1 -0
  18. package/lib/types/client/ArkmeConversationBottomControl.d.ts +9 -0
  19. package/lib/types/client/ArkmeConversationBottomControl.d.ts.map +1 -0
  20. package/lib/types/client/ArkmeEmojiPicker.d.ts +2 -1
  21. package/lib/types/client/ArkmeEmojiPicker.d.ts.map +1 -1
  22. package/lib/types/client/ArkmeHomeTour.d.ts +12 -0
  23. package/lib/types/client/ArkmeHomeTour.d.ts.map +1 -0
  24. package/lib/types/client/ArkmeNoteDetails.d.ts.map +1 -1
  25. package/lib/types/client/ArkmePersistentShell.d.ts.map +1 -1
  26. package/lib/types/client/ArkmeProductNavigation.d.ts.map +1 -1
  27. package/lib/types/client/ArkmeRecordingSurface.d.ts +6 -4
  28. package/lib/types/client/ArkmeRecordingSurface.d.ts.map +1 -1
  29. package/lib/types/client/ArkmeRecordingTour.d.ts +18 -0
  30. package/lib/types/client/ArkmeRecordingTour.d.ts.map +1 -0
  31. package/lib/types/client/ArkmeSearchSurface.d.ts.map +1 -1
  32. package/lib/types/client/ArkmeSendToSelfTour.d.ts +20 -0
  33. package/lib/types/client/ArkmeSendToSelfTour.d.ts.map +1 -0
  34. package/lib/types/client/ArkmeSidebar.d.ts.map +1 -1
  35. package/lib/types/client/ArkmeSourceBreadcrumb.d.ts +2 -1
  36. package/lib/types/client/ArkmeSourceBreadcrumb.d.ts.map +1 -1
  37. package/lib/types/client/ArkmeVirtualWorkspace.d.ts +11 -1
  38. package/lib/types/client/ArkmeVirtualWorkspace.d.ts.map +1 -1
  39. package/lib/types/client/api.d.ts +1 -1
  40. package/lib/types/client/api.d.ts.map +1 -1
  41. package/lib/types/client/arkme-emoji.d.ts.map +1 -1
  42. package/lib/types/client/call-tour-session.d.ts +9 -0
  43. package/lib/types/client/call-tour-session.d.ts.map +1 -0
  44. package/lib/types/client/chat-directory-store.d.ts +6 -0
  45. package/lib/types/client/chat-directory-store.d.ts.map +1 -1
  46. package/lib/types/client/conversation-resize-anchor.d.ts +6 -4
  47. package/lib/types/client/conversation-resize-anchor.d.ts.map +1 -1
  48. package/lib/types/client/conversation-viewport.d.ts +26 -0
  49. package/lib/types/client/conversation-viewport.d.ts.map +1 -0
  50. package/lib/types/client/detail-extension-composer-style.d.ts +38 -0
  51. package/lib/types/client/detail-extension-composer-style.d.ts.map +1 -0
  52. package/lib/types/client/emoji-recent-store.d.ts +3 -0
  53. package/lib/types/client/emoji-recent-store.d.ts.map +1 -0
  54. package/lib/types/client/harness-onboarding-client.d.ts +5 -0
  55. package/lib/types/client/harness-onboarding-client.d.ts.map +1 -0
  56. package/lib/types/client/home-tour-diagnostics.d.ts +4 -0
  57. package/lib/types/client/home-tour-diagnostics.d.ts.map +1 -0
  58. package/lib/types/client/home-tour-session.d.ts +13 -0
  59. package/lib/types/client/home-tour-session.d.ts.map +1 -0
  60. package/lib/types/client/navigation-cache.d.ts.map +1 -1
  61. package/lib/types/client/provider-instance-runtime.d.ts.map +1 -1
  62. package/lib/types/client/realtime-client-events.d.ts.map +1 -1
  63. package/lib/types/client/recording-tour-session.d.ts +9 -0
  64. package/lib/types/client/recording-tour-session.d.ts.map +1 -0
  65. package/lib/types/client/recordings/ArkmeRecordingMobileGuideDialog.d.ts +6 -0
  66. package/lib/types/client/recordings/ArkmeRecordingMobileGuideDialog.d.ts.map +1 -0
  67. package/lib/types/client/recordings/recording-mobile-guide-styles.d.ts +2 -0
  68. package/lib/types/client/recordings/recording-mobile-guide-styles.d.ts.map +1 -0
  69. package/lib/types/client/recordings/recording-tour-sample.d.ts +3 -0
  70. package/lib/types/client/recordings/recording-tour-sample.d.ts.map +1 -0
  71. package/lib/types/client/send-to-self-tour-session.d.ts +9 -0
  72. package/lib/types/client/send-to-self-tour-session.d.ts.map +1 -0
  73. package/lib/types/client/use-scroll-bottom-visibility.d.ts +7 -0
  74. package/lib/types/client/use-scroll-bottom-visibility.d.ts.map +1 -0
  75. package/lib/types/client/use-tour-account.d.ts +5 -0
  76. package/lib/types/client/use-tour-account.d.ts.map +1 -0
  77. package/lib/types/emoji-recent.d.ts +8 -0
  78. package/lib/types/emoji-recent.d.ts.map +1 -0
  79. package/lib/types/harness-embed-contract.d.ts +1 -0
  80. package/lib/types/harness-embed-contract.d.ts.map +1 -1
  81. package/lib/types/harness-embed-route.d.ts +1 -0
  82. package/lib/types/harness-embed-route.d.ts.map +1 -1
  83. package/lib/types/host-api.d.ts.map +1 -1
  84. package/lib/types/index.d.ts.map +1 -1
  85. package/lib/types/local-database.d.ts +5 -1
  86. package/lib/types/local-database.d.ts.map +1 -1
  87. package/lib/types/outgoing-call-assets.d.ts.map +1 -1
  88. package/lib/types/services/service.d.ts +2 -1
  89. package/lib/types/services/service.d.ts.map +1 -1
  90. package/lib/types/types.d.ts +1 -1
  91. package/lib/types/types.d.ts.map +1 -1
  92. package/package.json +6 -5
@@ -1800,6 +1800,368 @@ var RecordTopicAssignmentService = class {
1800
1800
  }
1801
1801
  };
1802
1802
  //#endregion
1803
+ //#region src/arkme-emoji-text.ts
1804
+ /** Asset-free emoji catalog shared by Browser UI and Host notification text. */
1805
+ const arkmeDefaultEmojiSeeds = Object.freeze([
1806
+ {
1807
+ id: "angry_face",
1808
+ unicode: "😡",
1809
+ label: "生气"
1810
+ },
1811
+ {
1812
+ id: "awkward_face",
1813
+ unicode: "😐",
1814
+ label: "尴尬"
1815
+ },
1816
+ {
1817
+ id: "heart_eyes",
1818
+ unicode: "😍",
1819
+ label: "喜欢"
1820
+ },
1821
+ {
1822
+ id: "smiling_face",
1823
+ unicode: "😊",
1824
+ label: "开心"
1825
+ },
1826
+ {
1827
+ id: "squint_tongue",
1828
+ unicode: "😝",
1829
+ label: "吐舌"
1830
+ },
1831
+ {
1832
+ id: "yelling_face",
1833
+ unicode: "😣",
1834
+ label: "崩溃"
1835
+ },
1836
+ {
1837
+ id: "sweat_smile",
1838
+ unicode: "😅",
1839
+ label: "汗笑"
1840
+ },
1841
+ {
1842
+ id: "grinning_face",
1843
+ unicode: "😁",
1844
+ label: "呲牙"
1845
+ },
1846
+ {
1847
+ id: "side_eye_smirk",
1848
+ unicode: "😏",
1849
+ label: "坏笑"
1850
+ },
1851
+ {
1852
+ id: "joy_face",
1853
+ unicode: "😂",
1854
+ label: "笑哭"
1855
+ },
1856
+ {
1857
+ id: "unamused_face",
1858
+ unicode: "🙄",
1859
+ label: "无语"
1860
+ },
1861
+ {
1862
+ id: "disappointed_face",
1863
+ unicode: "😔",
1864
+ label: "失落"
1865
+ },
1866
+ {
1867
+ id: "surprised_face",
1868
+ unicode: "😮",
1869
+ label: "惊讶"
1870
+ },
1871
+ {
1872
+ id: "teary_face",
1873
+ unicode: "😢",
1874
+ label: "委屈"
1875
+ },
1876
+ {
1877
+ id: "annoyed_face",
1878
+ unicode: "😒",
1879
+ label: "不爽"
1880
+ },
1881
+ {
1882
+ id: "kiss_heart",
1883
+ unicode: "😘",
1884
+ label: "飞吻"
1885
+ },
1886
+ {
1887
+ id: "yummy_face",
1888
+ unicode: "😋",
1889
+ label: "馋了"
1890
+ },
1891
+ {
1892
+ id: "goofy_grin",
1893
+ unicode: "🤪",
1894
+ label: "搞怪"
1895
+ },
1896
+ {
1897
+ id: "shouting_face",
1898
+ unicode: "😫",
1899
+ label: "抓狂"
1900
+ },
1901
+ {
1902
+ id: "speechless_sweat",
1903
+ unicode: "😓",
1904
+ label: "冒汗"
1905
+ },
1906
+ {
1907
+ id: "cute_face",
1908
+ unicode: "🥹",
1909
+ label: "可爱"
1910
+ },
1911
+ {
1912
+ id: "relaxed_face",
1913
+ unicode: "😌",
1914
+ label: "放松"
1915
+ },
1916
+ {
1917
+ id: "wink_tongue",
1918
+ unicode: "😜",
1919
+ label: "眨眼"
1920
+ },
1921
+ {
1922
+ id: "nauseated_face",
1923
+ unicode: "🤢",
1924
+ label: "恶心"
1925
+ },
1926
+ {
1927
+ id: "sleeping_face",
1928
+ unicode: "😴",
1929
+ label: "睡觉"
1930
+ },
1931
+ {
1932
+ id: "sleepy_face",
1933
+ unicode: "😪",
1934
+ label: "犯困"
1935
+ },
1936
+ {
1937
+ id: "groggy_face",
1938
+ unicode: "😩",
1939
+ label: "困顿"
1940
+ },
1941
+ {
1942
+ id: "crying_face",
1943
+ unicode: "😭",
1944
+ label: "大哭"
1945
+ },
1946
+ {
1947
+ id: "disgusted_face",
1948
+ unicode: "😖",
1949
+ label: "难受"
1950
+ },
1951
+ {
1952
+ id: "shocked_face",
1953
+ unicode: "😱",
1954
+ label: "吓到"
1955
+ },
1956
+ {
1957
+ id: "star_struck_face",
1958
+ unicode: "🤩",
1959
+ label: "星星眼"
1960
+ },
1961
+ {
1962
+ id: "yawning_face",
1963
+ unicode: "🥱",
1964
+ label: "打哈欠"
1965
+ },
1966
+ {
1967
+ id: "sobbing_face",
1968
+ unicode: "😭",
1969
+ label: "暴哭"
1970
+ },
1971
+ {
1972
+ id: "frustrated_face",
1973
+ unicode: "😣",
1974
+ label: "憋屈"
1975
+ },
1976
+ {
1977
+ id: "excited_face",
1978
+ unicode: "😛",
1979
+ label: "兴奋"
1980
+ },
1981
+ {
1982
+ id: "sick_face",
1983
+ unicode: "😨",
1984
+ label: "慌张"
1985
+ },
1986
+ {
1987
+ id: "worried_face",
1988
+ unicode: "😟",
1989
+ label: "担心"
1990
+ },
1991
+ {
1992
+ id: "kiss_sweat_face",
1993
+ unicode: "😗",
1994
+ label: "亲亲"
1995
+ },
1996
+ {
1997
+ id: "speechless_face",
1998
+ unicode: "😑",
1999
+ label: "无话可说"
2000
+ },
2001
+ {
2002
+ id: "masked_face",
2003
+ unicode: "😷",
2004
+ label: "戴口罩"
2005
+ },
2006
+ {
2007
+ id: "stunned_face",
2008
+ unicode: "😳",
2009
+ label: "呆住"
2010
+ },
2011
+ {
2012
+ id: "green_shock_face",
2013
+ unicode: "🤢",
2014
+ label: "反胃"
2015
+ },
2016
+ {
2017
+ id: "silent_face",
2018
+ unicode: "😶",
2019
+ label: "沉默"
2020
+ },
2021
+ {
2022
+ id: "yawn_face",
2023
+ unicode: "🥱",
2024
+ label: "困了"
2025
+ },
2026
+ {
2027
+ id: "pleading_face",
2028
+ unicode: "🥺",
2029
+ label: "求求"
2030
+ },
2031
+ {
2032
+ id: "dizzy_face",
2033
+ unicode: "😵",
2034
+ label: "晕了"
2035
+ },
2036
+ {
2037
+ id: "red_angry_face",
2038
+ unicode: "😠",
2039
+ label: "发火"
2040
+ },
2041
+ {
2042
+ id: "queasy_face",
2043
+ unicode: "🤮",
2044
+ label: "想吐"
2045
+ },
2046
+ {
2047
+ id: "ok_hand",
2048
+ unicode: "👌",
2049
+ label: "OK"
2050
+ },
2051
+ {
2052
+ id: "thumb_up",
2053
+ unicode: "👍",
2054
+ label: "赞"
2055
+ },
2056
+ {
2057
+ id: "thanks_hands",
2058
+ unicode: "🙏",
2059
+ label: "感谢"
2060
+ },
2061
+ {
2062
+ id: "fist",
2063
+ unicode: "👊",
2064
+ label: "拳头"
2065
+ },
2066
+ {
2067
+ id: "handshake",
2068
+ unicode: "🤝",
2069
+ label: "握手"
2070
+ },
2071
+ {
2072
+ id: "thumb_down",
2073
+ unicode: "👎",
2074
+ label: "弱"
2075
+ },
2076
+ {
2077
+ id: "victory_hand",
2078
+ unicode: "✌️",
2079
+ label: "胜利"
2080
+ },
2081
+ {
2082
+ id: "fist_salute",
2083
+ unicode: "🙏",
2084
+ label: "抱拳"
2085
+ }
2086
+ ]);
2087
+ const arkmeEmojiTokenPattern = /\[(?:jm_emoji|im_emoji):([a-z0-9_]+)\]/gu;
2088
+ const arkmeEmojiSeedById = new Map(arkmeDefaultEmojiSeeds.map((emoji) => [emoji.id, emoji]));
2089
+ /** The asset-free parser is shared by rich and plain-text projections. */
2090
+ function arkmeEmojiTextRuns(value) {
2091
+ const runs = [];
2092
+ let cursor = 0;
2093
+ for (const match of value.matchAll(arkmeEmojiTokenPattern)) {
2094
+ const emoji = arkmeEmojiSeedById.get(match[1] ?? "");
2095
+ if (emoji === void 0) continue;
2096
+ if (match.index > cursor) runs.push({
2097
+ kind: "text",
2098
+ text: value.slice(cursor, match.index)
2099
+ });
2100
+ runs.push({
2101
+ kind: "emoji",
2102
+ text: match[0],
2103
+ emoji
2104
+ });
2105
+ cursor = match.index + match[0].length;
2106
+ }
2107
+ if (cursor < value.length) runs.push({
2108
+ kind: "text",
2109
+ text: value.slice(cursor)
2110
+ });
2111
+ return runs;
2112
+ }
2113
+ function arkmeHasKnownEmojiToken(value) {
2114
+ if (value === "" || !value.includes("_emoji:")) return false;
2115
+ for (const match of value.matchAll(arkmeEmojiTokenPattern)) if (arkmeEmojiSeedById.has(match[1] ?? "")) return true;
2116
+ return false;
2117
+ }
2118
+ const graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
2119
+ /** Preserve the caller's budget; neither tokens nor graphemes can be split. */
2120
+ function arkmeEmojiTokenSafePrefix(value, maxLength, unit = "codePoints") {
2121
+ const limit = Math.floor(maxLength);
2122
+ if (!(limit > 0)) return "";
2123
+ let endOffset = Math.min(value.length, limit);
2124
+ if (unit === "codePoints") {
2125
+ endOffset = 0;
2126
+ let count = 0;
2127
+ for (const point of value) {
2128
+ if (count++ >= limit) break;
2129
+ endOffset += point.length;
2130
+ }
2131
+ }
2132
+ if (endOffset >= value.length) return value;
2133
+ for (const { index, segment } of graphemes.segment(value)) if (index + segment.length > endOffset) {
2134
+ endOffset = index;
2135
+ break;
2136
+ }
2137
+ for (const match of value.matchAll(arkmeEmojiTokenPattern)) {
2138
+ if (match.index >= endOffset) break;
2139
+ if (match.index < endOffset && endOffset < match.index + match[0].length) {
2140
+ endOffset = match.index;
2141
+ break;
2142
+ }
2143
+ }
2144
+ return value.slice(0, endOffset);
2145
+ }
2146
+ /** User-content equivalent of clippedText; keeps its UTF-16 limit and suffix. */
2147
+ function arkmeEmojiClippedText(value, limit = 4e3) {
2148
+ const text = typeof value === "string" ? value.trim() : "";
2149
+ return text.length > limit ? `${arkmeEmojiTokenSafePrefix(text, limit, "codeUnits")}…[已截断]` : text;
2150
+ }
2151
+ /** Known chat emoji tokens become Unicode; unknown and malformed tokens stay intact. */
2152
+ function arkmeEmojiPlainText(value) {
2153
+ if (value === "" || !value.includes("_emoji:")) return value;
2154
+ return arkmeEmojiTextRuns(value).map((run) => run.kind === "emoji" ? run.emoji.unicode : run.text).join("");
2155
+ }
2156
+ const knownIds = new Set(arkmeDefaultEmojiSeeds.map((emoji) => emoji.id));
2157
+ function isRecentEmojiId(id) {
2158
+ return knownIds.has(id);
2159
+ }
2160
+ function normalizeRecentEmojiIds(value) {
2161
+ if (!Array.isArray(value)) return [];
2162
+ return [...new Set(value.filter((id) => typeof id === "string" && isRecentEmojiId(id)))].slice(0, 8);
2163
+ }
2164
+ //#endregion
1803
2165
  //#region src/bot-chat-directory-projection.ts
1804
2166
  function projectBotChatDirectory(sources, bots) {
1805
2167
  const sourcesByKey = new Map(sources.flatMap((source) => source.kind !== "private_chat" || source.sourceKey === void 0 || source.sourceKey === "" ? [] : [[source.sourceKey, source]]));
@@ -34751,360 +35113,6 @@ function arkmePickedFileKind(mimeType, fileName = "") {
34751
35113
  const mediaKind = arkmeMediaKind(arkmeNormalizedFileMimeType(mimeType, fileName), fileName);
34752
35114
  return mediaKind === "image" ? 1 : mediaKind === "video" ? 3 : 4;
34753
35115
  }
34754
- //#endregion
34755
- //#region src/arkme-emoji-text.ts
34756
- /** Asset-free emoji catalog shared by Browser UI and Host notification text. */
34757
- const arkmeDefaultEmojiSeeds = Object.freeze([
34758
- {
34759
- id: "angry_face",
34760
- unicode: "😡",
34761
- label: "生气"
34762
- },
34763
- {
34764
- id: "awkward_face",
34765
- unicode: "😐",
34766
- label: "尴尬"
34767
- },
34768
- {
34769
- id: "heart_eyes",
34770
- unicode: "😍",
34771
- label: "喜欢"
34772
- },
34773
- {
34774
- id: "smiling_face",
34775
- unicode: "😊",
34776
- label: "开心"
34777
- },
34778
- {
34779
- id: "squint_tongue",
34780
- unicode: "😝",
34781
- label: "吐舌"
34782
- },
34783
- {
34784
- id: "yelling_face",
34785
- unicode: "😣",
34786
- label: "崩溃"
34787
- },
34788
- {
34789
- id: "sweat_smile",
34790
- unicode: "😅",
34791
- label: "汗笑"
34792
- },
34793
- {
34794
- id: "grinning_face",
34795
- unicode: "😁",
34796
- label: "呲牙"
34797
- },
34798
- {
34799
- id: "side_eye_smirk",
34800
- unicode: "😏",
34801
- label: "坏笑"
34802
- },
34803
- {
34804
- id: "joy_face",
34805
- unicode: "😂",
34806
- label: "笑哭"
34807
- },
34808
- {
34809
- id: "unamused_face",
34810
- unicode: "🙄",
34811
- label: "无语"
34812
- },
34813
- {
34814
- id: "disappointed_face",
34815
- unicode: "😔",
34816
- label: "失落"
34817
- },
34818
- {
34819
- id: "surprised_face",
34820
- unicode: "😮",
34821
- label: "惊讶"
34822
- },
34823
- {
34824
- id: "teary_face",
34825
- unicode: "😢",
34826
- label: "委屈"
34827
- },
34828
- {
34829
- id: "annoyed_face",
34830
- unicode: "😒",
34831
- label: "不爽"
34832
- },
34833
- {
34834
- id: "kiss_heart",
34835
- unicode: "😘",
34836
- label: "飞吻"
34837
- },
34838
- {
34839
- id: "yummy_face",
34840
- unicode: "😋",
34841
- label: "馋了"
34842
- },
34843
- {
34844
- id: "goofy_grin",
34845
- unicode: "🤪",
34846
- label: "搞怪"
34847
- },
34848
- {
34849
- id: "shouting_face",
34850
- unicode: "😫",
34851
- label: "抓狂"
34852
- },
34853
- {
34854
- id: "speechless_sweat",
34855
- unicode: "😓",
34856
- label: "冒汗"
34857
- },
34858
- {
34859
- id: "cute_face",
34860
- unicode: "🥹",
34861
- label: "可爱"
34862
- },
34863
- {
34864
- id: "relaxed_face",
34865
- unicode: "😌",
34866
- label: "放松"
34867
- },
34868
- {
34869
- id: "wink_tongue",
34870
- unicode: "😜",
34871
- label: "眨眼"
34872
- },
34873
- {
34874
- id: "nauseated_face",
34875
- unicode: "🤢",
34876
- label: "恶心"
34877
- },
34878
- {
34879
- id: "sleeping_face",
34880
- unicode: "😴",
34881
- label: "睡觉"
34882
- },
34883
- {
34884
- id: "sleepy_face",
34885
- unicode: "😪",
34886
- label: "犯困"
34887
- },
34888
- {
34889
- id: "groggy_face",
34890
- unicode: "😩",
34891
- label: "困顿"
34892
- },
34893
- {
34894
- id: "crying_face",
34895
- unicode: "😭",
34896
- label: "大哭"
34897
- },
34898
- {
34899
- id: "disgusted_face",
34900
- unicode: "😖",
34901
- label: "难受"
34902
- },
34903
- {
34904
- id: "shocked_face",
34905
- unicode: "😱",
34906
- label: "吓到"
34907
- },
34908
- {
34909
- id: "star_struck_face",
34910
- unicode: "🤩",
34911
- label: "星星眼"
34912
- },
34913
- {
34914
- id: "yawning_face",
34915
- unicode: "🥱",
34916
- label: "打哈欠"
34917
- },
34918
- {
34919
- id: "sobbing_face",
34920
- unicode: "😭",
34921
- label: "暴哭"
34922
- },
34923
- {
34924
- id: "frustrated_face",
34925
- unicode: "😣",
34926
- label: "憋屈"
34927
- },
34928
- {
34929
- id: "excited_face",
34930
- unicode: "😛",
34931
- label: "兴奋"
34932
- },
34933
- {
34934
- id: "sick_face",
34935
- unicode: "😨",
34936
- label: "慌张"
34937
- },
34938
- {
34939
- id: "worried_face",
34940
- unicode: "😟",
34941
- label: "担心"
34942
- },
34943
- {
34944
- id: "kiss_sweat_face",
34945
- unicode: "😗",
34946
- label: "亲亲"
34947
- },
34948
- {
34949
- id: "speechless_face",
34950
- unicode: "😑",
34951
- label: "无话可说"
34952
- },
34953
- {
34954
- id: "masked_face",
34955
- unicode: "😷",
34956
- label: "戴口罩"
34957
- },
34958
- {
34959
- id: "stunned_face",
34960
- unicode: "😳",
34961
- label: "呆住"
34962
- },
34963
- {
34964
- id: "green_shock_face",
34965
- unicode: "🤢",
34966
- label: "反胃"
34967
- },
34968
- {
34969
- id: "silent_face",
34970
- unicode: "😶",
34971
- label: "沉默"
34972
- },
34973
- {
34974
- id: "yawn_face",
34975
- unicode: "🥱",
34976
- label: "困了"
34977
- },
34978
- {
34979
- id: "pleading_face",
34980
- unicode: "🥺",
34981
- label: "求求"
34982
- },
34983
- {
34984
- id: "dizzy_face",
34985
- unicode: "😵",
34986
- label: "晕了"
34987
- },
34988
- {
34989
- id: "red_angry_face",
34990
- unicode: "😠",
34991
- label: "发火"
34992
- },
34993
- {
34994
- id: "queasy_face",
34995
- unicode: "🤮",
34996
- label: "想吐"
34997
- },
34998
- {
34999
- id: "ok_hand",
35000
- unicode: "👌",
35001
- label: "OK"
35002
- },
35003
- {
35004
- id: "thumb_up",
35005
- unicode: "👍",
35006
- label: "赞"
35007
- },
35008
- {
35009
- id: "thanks_hands",
35010
- unicode: "🙏",
35011
- label: "感谢"
35012
- },
35013
- {
35014
- id: "fist",
35015
- unicode: "👊",
35016
- label: "拳头"
35017
- },
35018
- {
35019
- id: "handshake",
35020
- unicode: "🤝",
35021
- label: "握手"
35022
- },
35023
- {
35024
- id: "thumb_down",
35025
- unicode: "👎",
35026
- label: "弱"
35027
- },
35028
- {
35029
- id: "victory_hand",
35030
- unicode: "✌️",
35031
- label: "胜利"
35032
- },
35033
- {
35034
- id: "fist_salute",
35035
- unicode: "🙏",
35036
- label: "抱拳"
35037
- }
35038
- ]);
35039
- const arkmeEmojiTokenPattern = /\[(?:jm_emoji|im_emoji):([a-z0-9_]+)\]/gu;
35040
- const arkmeEmojiSeedById = new Map(arkmeDefaultEmojiSeeds.map((emoji) => [emoji.id, emoji]));
35041
- /** The asset-free parser is shared by rich and plain-text projections. */
35042
- function arkmeEmojiTextRuns(value) {
35043
- const runs = [];
35044
- let cursor = 0;
35045
- for (const match of value.matchAll(arkmeEmojiTokenPattern)) {
35046
- const emoji = arkmeEmojiSeedById.get(match[1] ?? "");
35047
- if (emoji === void 0) continue;
35048
- if (match.index > cursor) runs.push({
35049
- kind: "text",
35050
- text: value.slice(cursor, match.index)
35051
- });
35052
- runs.push({
35053
- kind: "emoji",
35054
- text: match[0],
35055
- emoji
35056
- });
35057
- cursor = match.index + match[0].length;
35058
- }
35059
- if (cursor < value.length) runs.push({
35060
- kind: "text",
35061
- text: value.slice(cursor)
35062
- });
35063
- return runs;
35064
- }
35065
- function arkmeHasKnownEmojiToken(value) {
35066
- if (value === "" || !value.includes("_emoji:")) return false;
35067
- for (const match of value.matchAll(arkmeEmojiTokenPattern)) if (arkmeEmojiSeedById.has(match[1] ?? "")) return true;
35068
- return false;
35069
- }
35070
- const graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
35071
- /** Preserve the caller's budget; neither tokens nor graphemes can be split. */
35072
- function arkmeEmojiTokenSafePrefix(value, maxLength, unit = "codePoints") {
35073
- const limit = Math.floor(maxLength);
35074
- if (!(limit > 0)) return "";
35075
- let endOffset = Math.min(value.length, limit);
35076
- if (unit === "codePoints") {
35077
- endOffset = 0;
35078
- let count = 0;
35079
- for (const point of value) {
35080
- if (count++ >= limit) break;
35081
- endOffset += point.length;
35082
- }
35083
- }
35084
- if (endOffset >= value.length) return value;
35085
- for (const { index, segment } of graphemes.segment(value)) if (index + segment.length > endOffset) {
35086
- endOffset = index;
35087
- break;
35088
- }
35089
- for (const match of value.matchAll(arkmeEmojiTokenPattern)) {
35090
- if (match.index >= endOffset) break;
35091
- if (match.index < endOffset && endOffset < match.index + match[0].length) {
35092
- endOffset = match.index;
35093
- break;
35094
- }
35095
- }
35096
- return value.slice(0, endOffset);
35097
- }
35098
- /** User-content equivalent of clippedText; keeps its UTF-16 limit and suffix. */
35099
- function arkmeEmojiClippedText(value, limit = 4e3) {
35100
- const text = typeof value === "string" ? value.trim() : "";
35101
- return text.length > limit ? `${arkmeEmojiTokenSafePrefix(text, limit, "codeUnits")}…[已截断]` : text;
35102
- }
35103
- /** Known chat emoji tokens become Unicode; unknown and malformed tokens stay intact. */
35104
- function arkmeEmojiPlainText(value) {
35105
- if (value === "" || !value.includes("_emoji:")) return value;
35106
- return arkmeEmojiTextRuns(value).map((run) => run.kind === "emoji" ? run.emoji.unicode : run.text).join("");
35107
- }
35108
35116
  const ARKME_DSH_INPUT_TOPIC_TITLE = "发给 DSH 的消息";
35109
35117
  /** Display only; source identities and stored titles remain unchanged. */
35110
35118
  function arkmeTopicDisplayName(title, topicKind) {
@@ -89540,6 +89548,23 @@ var ArkmeService = class {
89540
89548
  async sendSourceRich(sourceRef, input, options = {}) {
89541
89549
  return await this.chat.sendSourceRich(sourceRef, input, options);
89542
89550
  }
89551
+ async requireRecentEmojiAccount(accountKey, signal) {
89552
+ signal?.throwIfAborted();
89553
+ const { userId } = await this.runtime.requireSession();
89554
+ signal?.throwIfAborted();
89555
+ if (accountKey !== `${this.config.environment}:${userId}`) throw new ArkmePluginError("emoji-recent-account-changed", "登录账号已变化,请重新打开表情面板", false, 409);
89556
+ }
89557
+ async recentEmojiIds(accountKey, signal) {
89558
+ await this.requireRecentEmojiAccount(accountKey, signal);
89559
+ signal?.throwIfAborted();
89560
+ return await this.stateStore.recentEmojiIds(accountKey);
89561
+ }
89562
+ async recordRecentEmoji(accountKey, emojiId, signal) {
89563
+ await this.requireRecentEmojiAccount(accountKey, signal);
89564
+ signal?.throwIfAborted();
89565
+ if (!isRecentEmojiId(emojiId)) throw new ArkmePluginError("emoji-recent-invalid", "表情不存在", false, 400);
89566
+ return await this.stateStore.recordRecentEmoji(accountKey, emojiId);
89567
+ }
89543
89568
  async favoriteStickers(signal) {
89544
89569
  return await this.chat.favoriteStickers(signal);
89545
89570
  }
@@ -91469,4 +91494,4 @@ async function invokePersistentArkmeExtension(extensionId, method, args) {
91469
91494
  return jsonValue(await handler(jsonValue(args)));
91470
91495
  }
91471
91496
  //#endregion
91472
- export { ARKME_DEFAULT_SHARE_WEBSITE as $, inspectNativeBundleArtifactV3 as A, __exportAll as At, ARKME_EXTENSION_ICON_MAX_BYTES as B, ARKME_BUNDLE_MAX_BYTES as C, MAX_RECORDING_IMPORT_BYTES as Ct, bundleSha256 as D, createDesktopLifecycleReader as Dt, arkmeSandboxEntryId as E, retryAfterMillis as Et, assertExtensionArtifactSize as F, validateVoiceprintPcm16Wav as G, ARKME_EXTENSION_PREVIEW_MAX_BYTES as H, canonicalExtensionJson as I, arkmeRequiredLinkMetadataFallback as J, arkmeExtensionShareRefFromLink as K, sha256Hex as L, packLocalNativeBundleDirectoryV3 as M, __toCommonJS as Mt, readNativeBundleTarballV3 as N, canonicalBundleJson as O, __commonJSMin as Ot, renderArkmeSandboxHostEntry as P, parseArkmeRecordReeditAttachments as Q, unpackArkmeExtension as R, ARKME_BUNDLE_ARTIFACT_KIND as S, sameRecordingImportIdentity as St, ArkmeBundleArtifactError as T, ArkmePluginError as Tt, ARKME_EXTENSION_RUNTIME_UNAVAILABLE_MESSAGE as U, ARKME_EXTENSION_MAX_BYTES as V, ArkmeService as W, arkmeRichBackgroundSound as X, arkmeFileBackgroundSound as Y, ArkmeRecordReeditDraftConflict as Z, arkmeClientContentDigest as _, SecretValue as _t, persistentArkmeExtensionActive as a, ARKME_WORLD_PUBLISH_MAX_IMAGE_BYTES as at, verifyExtensionResolutionSignature as b, isUnresolvedRecordingImportJob as bt, persistentExtensionBundleDirectory as c, mergeMemberJoinEvents as ct, readPersistentExtensionActivation as d, ARKME_TOOL_FILE_MAX_BYTES as dt, ARKME_PROVIDER_CONTRACT_VERSION as et, refreshPersistentClientWrapper as f, arkmeCanInlineLocalFile as ft, activeProfileExtensionOwnerConflicts as g, ArkmeOutgoingCallError as gt, renderArkmeBundleClientBundle as h, isArkmeBotAvatarRef as ht, invokePersistentArkmeExtension as i, ARKME_WORLD_PUBLISH_MAX_IMAGES as it, packBundleFiles as j, __require as jt, inspectBundleArtifact as k, __esmMin as kt, persistentExtensionPackageIdentity as l, validateMemberUpdate as lt, writePersistentExtensionActivation as m, arkmePickedFileKind as mt, applyPersistentArkmeHostExtension as n, ARKME_VOICEPRINT_ENROLLMENT_MAX_DURATION_MS as nt, persistentArkmeExtensionRuntimeState as o, applyMemberUpdate as ot, repairPersistentExtensionInstallation as p, arkmeNormalizedFileMimeType as pt, arkmeIsGenericLinkMetadataTitle as q, deactivatePersistentArkmeExtension as r, ARKME_VOICEPRINT_ENROLLMENT_MIN_DURATION_MS as rt, materializePersistentExtensionBundle as s, cachedMemberItem as st, activatePersistentArkmeExtension as t, ARKME_VOICEPRINT_ENROLLMENT_MAX_AUDIO_BYTES as tt, quarantinePersistentExtension as u, ARKME_RUNTIME_INSTANCE_ID as ut, arkmeClientContentDigestFromSource as v, ArkmeDirectMessageAdmissionError as vt, ARKME_NATIVE_BUNDLE_ARTIFACT_KIND as w, recordingImportFileNameKey as wt, verifyNativeBundleResolutionSignature as x, recordingImportFileKind as xt, verifyBundleResolutionSignature as y, isRecordingInstantOnOrAfterUnixEpoch as yt, ARKME_EXTENSION_FORMAT as z };
91497
+ export { ARKME_DEFAULT_SHARE_WEBSITE as $, inspectNativeBundleArtifactV3 as A, __commonJSMin as At, ARKME_EXTENSION_ICON_MAX_BYTES as B, ARKME_BUNDLE_MAX_BYTES as C, MAX_RECORDING_IMPORT_BYTES as Ct, bundleSha256 as D, ArkmePluginError as Dt, arkmeSandboxEntryId as E, normalizeRecentEmojiIds as Et, assertExtensionArtifactSize as F, validateVoiceprintPcm16Wav as G, ARKME_EXTENSION_PREVIEW_MAX_BYTES as H, canonicalExtensionJson as I, arkmeRequiredLinkMetadataFallback as J, arkmeExtensionShareRefFromLink as K, sha256Hex as L, packLocalNativeBundleDirectoryV3 as M, __exportAll as Mt, readNativeBundleTarballV3 as N, __require as Nt, canonicalBundleJson as O, retryAfterMillis as Ot, renderArkmeSandboxHostEntry as P, __toCommonJS as Pt, parseArkmeRecordReeditAttachments as Q, unpackArkmeExtension as R, ARKME_BUNDLE_ARTIFACT_KIND as S, sameRecordingImportIdentity as St, ArkmeBundleArtifactError as T, isRecentEmojiId as Tt, ARKME_EXTENSION_RUNTIME_UNAVAILABLE_MESSAGE as U, ARKME_EXTENSION_MAX_BYTES as V, ArkmeService as W, arkmeRichBackgroundSound as X, arkmeFileBackgroundSound as Y, ArkmeRecordReeditDraftConflict as Z, arkmeClientContentDigest as _, SecretValue as _t, persistentArkmeExtensionActive as a, ARKME_WORLD_PUBLISH_MAX_IMAGE_BYTES as at, verifyExtensionResolutionSignature as b, isUnresolvedRecordingImportJob as bt, persistentExtensionBundleDirectory as c, mergeMemberJoinEvents as ct, readPersistentExtensionActivation as d, ARKME_TOOL_FILE_MAX_BYTES as dt, ARKME_PROVIDER_CONTRACT_VERSION as et, refreshPersistentClientWrapper as f, arkmeCanInlineLocalFile as ft, activeProfileExtensionOwnerConflicts as g, ArkmeOutgoingCallError as gt, renderArkmeBundleClientBundle as h, isArkmeBotAvatarRef as ht, invokePersistentArkmeExtension as i, ARKME_WORLD_PUBLISH_MAX_IMAGES as it, packBundleFiles as j, __esmMin as jt, inspectBundleArtifact as k, createDesktopLifecycleReader as kt, persistentExtensionPackageIdentity as l, validateMemberUpdate as lt, writePersistentExtensionActivation as m, arkmePickedFileKind as mt, applyPersistentArkmeHostExtension as n, ARKME_VOICEPRINT_ENROLLMENT_MAX_DURATION_MS as nt, persistentArkmeExtensionRuntimeState as o, applyMemberUpdate as ot, repairPersistentExtensionInstallation as p, arkmeNormalizedFileMimeType as pt, arkmeIsGenericLinkMetadataTitle as q, deactivatePersistentArkmeExtension as r, ARKME_VOICEPRINT_ENROLLMENT_MIN_DURATION_MS as rt, materializePersistentExtensionBundle as s, cachedMemberItem as st, activatePersistentArkmeExtension as t, ARKME_VOICEPRINT_ENROLLMENT_MAX_AUDIO_BYTES as tt, quarantinePersistentExtension as u, ARKME_RUNTIME_INSTANCE_ID as ut, arkmeClientContentDigestFromSource as v, ArkmeDirectMessageAdmissionError as vt, ARKME_NATIVE_BUNDLE_ARTIFACT_KIND as w, recordingImportFileNameKey as wt, verifyNativeBundleResolutionSignature as x, recordingImportFileKind as xt, verifyBundleResolutionSignature as y, isRecordingInstantOnOrAfterUnixEpoch as yt, ARKME_EXTENSION_FORMAT as z };