hypercore-cli 1.1.1 → 1.3.0

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 (158) hide show
  1. package/LICENSE +92 -21
  2. package/README.md +8 -1
  3. package/dist/App-YMX7FSXR.js +1 -0
  4. package/dist/api-Q2TX5JJL.js +1 -0
  5. package/dist/auth-X6CUT3DW.js +1 -0
  6. package/dist/background-ACODXSUG.js +1 -0
  7. package/dist/backlog-JD2IM336.js +1 -0
  8. package/dist/chunk-2QI2IU2V.js +1 -0
  9. package/dist/chunk-3KFRDIPQ.js +1 -0
  10. package/dist/chunk-42C5J7PN.js +1 -0
  11. package/dist/chunk-4D7XVJ7Q.js +1 -0
  12. package/dist/chunk-545IGTXV.js +1 -0
  13. package/dist/chunk-5KUSGQP2.js +1 -0
  14. package/dist/chunk-AUQ64BK2.js +1 -0
  15. package/dist/chunk-AV244H5C.js +1 -0
  16. package/dist/chunk-BQVBEFS4.js +1 -0
  17. package/dist/chunk-BYWQLFP2.js +1 -0
  18. package/dist/chunk-COITWWZJ.js +1 -0
  19. package/dist/chunk-CR7UUJVX.js +1 -0
  20. package/dist/chunk-E3MULLBX.js +1 -0
  21. package/dist/chunk-EWBV7YPP.js +1 -0
  22. package/dist/chunk-EZHYVJGQ.js +1 -0
  23. package/dist/chunk-FAKXBY7Q.js +1 -0
  24. package/dist/chunk-FHGATV5B.js +1 -0
  25. package/dist/chunk-I2G27Y5P.js +1 -0
  26. package/dist/chunk-IKF43TX2.js +1 -0
  27. package/dist/chunk-INSPHCBN.js +1 -0
  28. package/dist/chunk-LQMDUKIE.js +1 -0
  29. package/dist/chunk-M3MTKGA5.js +1 -0
  30. package/dist/chunk-MPO54FU3.js +1 -0
  31. package/dist/chunk-PVKCZI6A.js +1 -0
  32. package/dist/chunk-Q7KEPCYL.js +1 -0
  33. package/dist/chunk-R5XD3NT2.js +1 -0
  34. package/dist/chunk-ROBZ6PAL.js +1 -0
  35. package/dist/chunk-RXB5BS2N.js +1 -0
  36. package/dist/chunk-RZ3HNYMT.js +1 -0
  37. package/dist/chunk-UCGLRMTG.js +1 -0
  38. package/dist/chunk-UEHJVRKB.js +1 -0
  39. package/dist/chunk-UZYX5GGF.js +1 -0
  40. package/dist/chunk-XQJBB725.js +1 -0
  41. package/dist/chunk-ZB5ZQSXH.js +1 -0
  42. package/dist/claude-US2QPRBA.js +1 -0
  43. package/dist/commands-5TFN74MD.js +1 -0
  44. package/dist/commands-EKPWCB3T.js +1 -0
  45. package/dist/commands-QHJLREPM.js +1 -0
  46. package/dist/config-2OUL5FLS.js +1 -0
  47. package/dist/config-loader-N7IBWN2P.js +1 -0
  48. package/dist/diagnose-NLHN4SAJ.js +1 -0
  49. package/dist/display-TB5YACJV.js +1 -0
  50. package/dist/extractor-3KTM2IUL.js +1 -0
  51. package/dist/feature-flag-VVIF5FJG.js +1 -0
  52. package/dist/history-GVNDPXXQ.js +1 -0
  53. package/dist/index.js +1 -402
  54. package/dist/instance-registry-I5AIVJE2.js +1 -0
  55. package/dist/keybindings-RN3A7CRW.js +1 -0
  56. package/dist/loader-3IKPXP4R.js +1 -0
  57. package/dist/network-GI2F3IDE.js +1 -0
  58. package/dist/notify-O6FNVHC4.js +1 -0
  59. package/dist/openai-compat-IPCMINVF.js +1 -0
  60. package/dist/permissions-5O7KVAXU.js +1 -0
  61. package/dist/prompt-VWFPFM4N.js +1 -0
  62. package/dist/quality-GPQD25UL.js +1 -0
  63. package/dist/repl-YNXCDVU4.js +1 -0
  64. package/dist/roadmap-QRZODSNJ.js +1 -0
  65. package/dist/server-USQP4GC4.js +1 -0
  66. package/dist/session-5HDDQQP6.js +1 -0
  67. package/dist/skills-DXWSVJSU.js +1 -0
  68. package/dist/store-WXXTKTTL.js +1 -0
  69. package/dist/team-VTPJ3WRT.js +1 -0
  70. package/dist/telemetry-NT4UZLBS.js +1 -0
  71. package/dist/test-runner-F6B6RH3S.js +1 -0
  72. package/dist/theme-JJJ6ABR2.js +1 -0
  73. package/dist/upgrade-RUG3R7R5.js +1 -0
  74. package/dist/verify-6OGRY2PR.js +1 -0
  75. package/dist/version-DLROA5JN.js +1 -0
  76. package/dist/web/static/app.js +1 -562
  77. package/dist/web/static/index.html +114 -126
  78. package/dist/web/static/mirror.css +1 -1001
  79. package/dist/web/static/mirror.html +155 -178
  80. package/dist/web/static/mirror.js +1 -1125
  81. package/dist/web/static/onboard.css +1 -302
  82. package/dist/web/static/onboard.html +121 -145
  83. package/dist/web/static/onboard.js +1 -300
  84. package/dist/web/static/style.css +1 -602
  85. package/dist/web/static/utils.js +1 -0
  86. package/dist/web/static/workspace.css +1 -1568
  87. package/dist/web/static/workspace.html +369 -402
  88. package/dist/web/static/workspace.js +1 -1683
  89. package/dist/web-P5YUKEAU.js +1 -0
  90. package/package.json +25 -4
  91. package/dist/api-D4PUN5BN.js +0 -162
  92. package/dist/auth-UTR4I6QY.js +0 -21
  93. package/dist/background-2EGCAAQH.js +0 -14
  94. package/dist/backlog-Q2NZCLNY.js +0 -24
  95. package/dist/chunk-2CMSCWQW.js +0 -162
  96. package/dist/chunk-4DVYJAJL.js +0 -57
  97. package/dist/chunk-77FRUHTU.js +0 -271
  98. package/dist/chunk-7ZYMJFCA.js +0 -251
  99. package/dist/chunk-BE46C7JW.js +0 -46
  100. package/dist/chunk-CM423E2U.js +0 -133
  101. package/dist/chunk-E4NKO2KI.js +0 -263
  102. package/dist/chunk-GH7E2OJE.js +0 -223
  103. package/dist/chunk-GMLQ7GZ5.js +0 -134
  104. package/dist/chunk-GU2FZQ6A.js +0 -69
  105. package/dist/chunk-IOPKN5GD.js +0 -190
  106. package/dist/chunk-LWDNLX6B.js +0 -2025
  107. package/dist/chunk-MGLJ53QN.js +0 -219
  108. package/dist/chunk-NHPDLYEW.js +0 -139
  109. package/dist/chunk-OGQGKMDX.js +0 -173
  110. package/dist/chunk-OPZYEVYR.js +0 -150
  111. package/dist/chunk-OWAOKDIN.js +0 -1505
  112. package/dist/chunk-R3GPQC7I.js +0 -393
  113. package/dist/chunk-RKB2JOV2.js +0 -43
  114. package/dist/chunk-RNG3K465.js +0 -80
  115. package/dist/chunk-SHJQMIJL.js +0 -288
  116. package/dist/chunk-SVF2VWOZ.js +0 -145
  117. package/dist/chunk-TGTYKBGC.js +0 -86
  118. package/dist/chunk-V2EBSFPU.js +0 -575
  119. package/dist/chunk-VJDQNNSO.js +0 -681
  120. package/dist/chunk-VQ35XX7B.js +0 -167
  121. package/dist/chunk-WHLVZCQY.js +0 -245
  122. package/dist/chunk-XMGHVNH2.js +0 -66
  123. package/dist/chunk-YWOSOTUO.js +0 -58
  124. package/dist/chunk-ZQRNV2US.js +0 -166
  125. package/dist/chunk-ZSBHUGWR.js +0 -262
  126. package/dist/claude-O5FSOXZC.js +0 -12
  127. package/dist/commands-43PLOWRU.js +0 -128
  128. package/dist/commands-5YVUSUMP.js +0 -232
  129. package/dist/commands-VZMZJFZF.js +0 -1044
  130. package/dist/config-WXXEEEVW.js +0 -8
  131. package/dist/config-loader-SXO674TF.js +0 -24
  132. package/dist/diagnose-BX45APUZ.js +0 -12
  133. package/dist/display-IIUBEYWN.js +0 -58
  134. package/dist/extractor-R5ABXNTJ.js +0 -129
  135. package/dist/history-JPXZEOT3.js +0 -180
  136. package/dist/index.d.ts +0 -1
  137. package/dist/instance-registry-6NJTCAE4.js +0 -15
  138. package/dist/keybindings-ADWNOX5M.js +0 -15
  139. package/dist/loader-AXDDCB2G.js +0 -58
  140. package/dist/network-V3O4UZYZ.js +0 -279
  141. package/dist/notify-HPTALZDC.js +0 -14
  142. package/dist/openai-compat-UFDV2SCK.js +0 -12
  143. package/dist/permissions-JUKXMNDH.js +0 -10
  144. package/dist/prompt-5CZ34WGA.js +0 -166
  145. package/dist/quality-ST7PPNFR.js +0 -16
  146. package/dist/repl-EOWP6AAB.js +0 -3374
  147. package/dist/roadmap-5OBEKROY.js +0 -17
  148. package/dist/server-BB5AENWU.js +0 -57
  149. package/dist/session-5NDKKFLN.js +0 -21
  150. package/dist/skills-JVLIQVJN.js +0 -175
  151. package/dist/store-G7KRD4PN.js +0 -25
  152. package/dist/team-FVNNVDBY.js +0 -385
  153. package/dist/telemetry-6R4EIE6O.js +0 -30
  154. package/dist/test-runner-REKSVPPY.js +0 -619
  155. package/dist/theme-3SYJ3UQA.js +0 -14
  156. package/dist/upgrade-YSXCO63I.js +0 -83
  157. package/dist/verify-JUDKTPKZ.js +0 -14
  158. package/dist/web-H2BJXUBZ.js +0 -39
@@ -1,190 +0,0 @@
1
- import {
2
- getEventsSummary
3
- } from "./chunk-2CMSCWQW.js";
4
- import {
5
- getItem,
6
- listItems,
7
- updateItemMetrics
8
- } from "./chunk-MGLJ53QN.js";
9
-
10
- // src/admin/verify.ts
11
- function inferBaselineKey(item) {
12
- const titleLower = item.title.toLowerCase();
13
- const descLower = item.description.toLowerCase();
14
- const text = titleLower + " " + descLower;
15
- if (text.includes("\u5931\u8D25\u7387") || text.includes("fail")) {
16
- const cmdMatch = text.match(/(\/\w+)\s+失败/) || text.match(/(\/\w+).*fail/);
17
- if (cmdMatch) return `cmd_fail_rate:${cmdMatch[1]}`;
18
- return "cmd_fail_rate:all";
19
- }
20
- if (text.includes("\u9519\u8BEF") || text.includes("error")) {
21
- return "error_count";
22
- }
23
- if (text.includes("\u8017\u65F6") || text.includes("\u6027\u80FD") || text.includes("perf") || text.includes("duration")) {
24
- return "avg_session_rounds";
25
- }
26
- if (text.includes("\u4F1A\u8BDD") || text.includes("session") || text.includes("\u8F6E\u6B21")) {
27
- return "avg_session_rounds";
28
- }
29
- if (text.includes("test") || text.includes("\u6D4B\u8BD5")) {
30
- return "test_pass_rate";
31
- }
32
- if (text.includes("todo") || text.includes("fixme") || text.includes("\u6280\u672F\u503A")) {
33
- return "todo_count";
34
- }
35
- if (text.includes("\u4F53\u79EF") || text.includes("size") || text.includes("bundle")) {
36
- return "package_size";
37
- }
38
- if (item.type === "bugfix") return "error_count";
39
- if (item.type === "improvement") return "avg_session_rounds";
40
- return null;
41
- }
42
- async function getMetricValue(key, days = 7) {
43
- if (key.startsWith("cmd_fail_rate:")) {
44
- const cmd = key.replace("cmd_fail_rate:", "");
45
- const summary = await getEventsSummary(days);
46
- if (cmd === "all") {
47
- let total = 0, fail = 0;
48
- for (const stats2 of Object.values(summary.cmdCounts)) {
49
- total += stats2.total;
50
- fail += stats2.fail;
51
- }
52
- return total > 0 ? Math.round(fail / total * 1e3) / 10 : 0;
53
- }
54
- const stats = summary.cmdCounts[cmd];
55
- if (!stats || stats.total === 0) return 0;
56
- return Math.round(stats.fail / stats.total * 1e3) / 10;
57
- }
58
- if (key === "error_count") {
59
- const summary = await getEventsSummary(days);
60
- return summary.errors.reduce((s, e) => s + e.count, 0);
61
- }
62
- if (key === "avg_session_rounds") {
63
- const summary = await getEventsSummary(days);
64
- return summary.avgSessionRounds;
65
- }
66
- if (key === "test_pass_rate") {
67
- const { checkTests } = await import("./quality-ST7PPNFR.js");
68
- const result = await checkTests(process.cwd());
69
- return result.value ?? null;
70
- }
71
- if (key === "todo_count") {
72
- const { checkTodos } = await import("./quality-ST7PPNFR.js");
73
- const result = await checkTodos(process.cwd());
74
- return result.value ?? null;
75
- }
76
- if (key === "package_size") {
77
- const { checkPackageSize } = await import("./quality-ST7PPNFR.js");
78
- const result = await checkPackageSize(process.cwd());
79
- return result.value ?? null;
80
- }
81
- return null;
82
- }
83
- async function recordBaseline(itemId) {
84
- const item = await getItem(itemId);
85
- if (!item) return null;
86
- if (item.metrics.baselineKey && item.metrics.baselineValue !== null) {
87
- return { key: item.metrics.baselineKey, value: item.metrics.baselineValue };
88
- }
89
- const key = inferBaselineKey(item);
90
- if (!key) return null;
91
- const value = await getMetricValue(key);
92
- if (value === null) return null;
93
- const metrics = {
94
- ...item.metrics,
95
- baselineKey: key,
96
- baselineValue: value,
97
- baselineDate: (/* @__PURE__ */ new Date()).toISOString(),
98
- verified: false
99
- };
100
- const updated = await updateItemMetrics(itemId, metrics);
101
- if (!updated) return null;
102
- return { key, value };
103
- }
104
- async function verifyCompletedItems() {
105
- const items = await listItems({ status: "done" });
106
- const results = [];
107
- for (const item of items) {
108
- if (!item.metrics.baselineKey || item.metrics.baselineValue === null) continue;
109
- if (item.metrics.verified) continue;
110
- const currentValue = await getMetricValue(item.metrics.baselineKey);
111
- let changePercent = null;
112
- let verdict = "no-data";
113
- let detail = "";
114
- if (currentValue === null) {
115
- verdict = "no-data";
116
- detail = `\u65E0\u6CD5\u83B7\u53D6 ${item.metrics.baselineKey} \u7684\u5F53\u524D\u503C`;
117
- } else {
118
- const baseline = item.metrics.baselineValue;
119
- if (baseline === 0) {
120
- changePercent = currentValue === 0 ? 0 : 100;
121
- verdict = currentValue <= 0 ? "effective" : "pending";
122
- detail = `\u57FA\u7EBF: 0 \u2192 \u5F53\u524D: ${currentValue}`;
123
- } else {
124
- changePercent = Math.round((currentValue - baseline) / Math.abs(baseline) * 1e3) / 10;
125
- const lowerIsBetter = isLowerBetter(item.metrics.baselineKey);
126
- if (lowerIsBetter) {
127
- if (changePercent <= -50) {
128
- verdict = "effective";
129
- detail = `\u4E0B\u964D ${Math.abs(changePercent)}% (${baseline} \u2192 ${currentValue})`;
130
- } else if (changePercent <= -20) {
131
- verdict = "pending";
132
- detail = `\u4E0B\u964D ${Math.abs(changePercent)}%\uFF0C\u5F85\u8FDB\u4E00\u6B65\u89C2\u5BDF (${baseline} \u2192 ${currentValue})`;
133
- } else {
134
- verdict = "ineffective";
135
- detail = changePercent >= 0 ? `\u672A\u6539\u5584\uFF0C\u53CD\u5347 ${changePercent}% (${baseline} \u2192 ${currentValue})` : `\u4EC5\u4E0B\u964D ${Math.abs(changePercent)}% (${baseline} \u2192 ${currentValue})`;
136
- }
137
- } else {
138
- if (changePercent >= 50) {
139
- verdict = "effective";
140
- detail = `\u4E0A\u5347 ${changePercent}% (${baseline} \u2192 ${currentValue})`;
141
- } else if (changePercent >= 20) {
142
- verdict = "pending";
143
- detail = `\u4E0A\u5347 ${changePercent}%\uFF0C\u5F85\u8FDB\u4E00\u6B65\u89C2\u5BDF (${baseline} \u2192 ${currentValue})`;
144
- } else {
145
- verdict = "ineffective";
146
- detail = changePercent <= 0 ? `\u672A\u6539\u5584\uFF0C\u53CD\u964D ${Math.abs(changePercent)}% (${baseline} \u2192 ${currentValue})` : `\u4EC5\u4E0A\u5347 ${changePercent}% (${baseline} \u2192 ${currentValue})`;
147
- }
148
- }
149
- }
150
- item.metrics.afterValue = currentValue;
151
- item.metrics.afterDate = (/* @__PURE__ */ new Date()).toISOString();
152
- if (verdict === "effective" || verdict === "ineffective") {
153
- item.metrics.verified = true;
154
- }
155
- await updateItemMetrics(item.id, item.metrics);
156
- }
157
- results.push({
158
- itemId: item.id,
159
- title: item.title,
160
- baselineKey: item.metrics.baselineKey,
161
- baselineValue: item.metrics.baselineValue,
162
- afterValue: currentValue,
163
- changePercent,
164
- verdict,
165
- detail
166
- });
167
- }
168
- const summary = {
169
- total: results.length,
170
- effective: results.filter((r) => r.verdict === "effective").length,
171
- ineffective: results.filter((r) => r.verdict === "ineffective").length,
172
- pending: results.filter((r) => r.verdict === "pending").length,
173
- noData: results.filter((r) => r.verdict === "no-data").length
174
- };
175
- return { timestamp: (/* @__PURE__ */ new Date()).toISOString(), results, summary };
176
- }
177
- function isLowerBetter(key) {
178
- if (key.startsWith("cmd_fail_rate")) return true;
179
- if (key === "error_count") return true;
180
- if (key === "todo_count") return true;
181
- if (key === "package_size") return true;
182
- return false;
183
- }
184
-
185
- export {
186
- inferBaselineKey,
187
- getMetricValue,
188
- recordBaseline,
189
- verifyCompletedItems
190
- };