hypercore-cli 1.1.2 → 1.4.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 (162) 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-ELP6F4NC.js +1 -0
  5. package/dist/auth-SICBMA3P.js +1 -0
  6. package/dist/auth-X6CUT3DW.js +1 -0
  7. package/dist/background-ACODXSUG.js +1 -0
  8. package/dist/backlog-JD2IM336.js +1 -0
  9. package/dist/chunk-2QI2IU2V.js +1 -0
  10. package/dist/chunk-3KFRDIPQ.js +1 -0
  11. package/dist/chunk-42C5J7PN.js +1 -0
  12. package/dist/chunk-4D7XVJ7Q.js +1 -0
  13. package/dist/chunk-5KUSGQP2.js +1 -0
  14. package/dist/chunk-5OEFAGD5.js +1 -0
  15. package/dist/chunk-AUQ64BK2.js +1 -0
  16. package/dist/chunk-AV244H5C.js +1 -0
  17. package/dist/chunk-BQVBEFS4.js +1 -0
  18. package/dist/chunk-BYWQLFP2.js +1 -0
  19. package/dist/chunk-C6YL7UHE.js +1 -0
  20. package/dist/chunk-COITWWZJ.js +1 -0
  21. package/dist/chunk-CR7UUJVX.js +1 -0
  22. package/dist/chunk-E3MULLBX.js +1 -0
  23. package/dist/chunk-EZHYVJGQ.js +1 -0
  24. package/dist/chunk-FAMURNNH.js +1 -0
  25. package/dist/chunk-FGP56E4W.js +1 -0
  26. package/dist/chunk-FHGATV5B.js +1 -0
  27. package/dist/chunk-I2G27Y5P.js +1 -0
  28. package/dist/chunk-IKF43TX2.js +1 -0
  29. package/dist/chunk-INSPHCBN.js +1 -0
  30. package/dist/chunk-JHMV366T.js +1 -0
  31. package/dist/chunk-L52HX5SX.js +1 -0
  32. package/dist/chunk-LQMDUKIE.js +1 -0
  33. package/dist/chunk-M3MTKGA5.js +1 -0
  34. package/dist/chunk-MPO54FU3.js +1 -0
  35. package/dist/chunk-PVKCZI6A.js +1 -0
  36. package/dist/chunk-Q7KEPCYL.js +1 -0
  37. package/dist/chunk-ROBZ6PAL.js +1 -0
  38. package/dist/chunk-RXB5BS2N.js +1 -0
  39. package/dist/chunk-RZ3HNYMT.js +1 -0
  40. package/dist/chunk-UCGLRMTG.js +1 -0
  41. package/dist/chunk-UEHJVRKB.js +1 -0
  42. package/dist/chunk-UZYX5GGF.js +1 -0
  43. package/dist/chunk-XQJBB725.js +1 -0
  44. package/dist/chunk-YXCRL6K3.js +1 -0
  45. package/dist/claude-US2QPRBA.js +1 -0
  46. package/dist/commands-EKPWCB3T.js +1 -0
  47. package/dist/commands-GYNKP5WV.js +1 -0
  48. package/dist/commands-QHJLREPM.js +1 -0
  49. package/dist/config-2OUL5FLS.js +1 -0
  50. package/dist/config-loader-N7IBWN2P.js +1 -0
  51. package/dist/diagnose-NLHN4SAJ.js +1 -0
  52. package/dist/display-RYAW2GFB.js +1 -0
  53. package/dist/extractor-3KTM2IUL.js +1 -0
  54. package/dist/feature-flag-VVIF5FJG.js +1 -0
  55. package/dist/history-3R2UHRDQ.js +1 -0
  56. package/dist/index.js +1 -402
  57. package/dist/instance-registry-I5AIVJE2.js +1 -0
  58. package/dist/keybindings-RN3A7CRW.js +1 -0
  59. package/dist/loader-3IKPXP4R.js +1 -0
  60. package/dist/network-K5HRJE44.js +1 -0
  61. package/dist/notify-O6FNVHC4.js +1 -0
  62. package/dist/openai-compat-IPCMINVF.js +1 -0
  63. package/dist/panels-2R5YEFXH.js +1 -0
  64. package/dist/permissions-5O7KVAXU.js +1 -0
  65. package/dist/prompt-VWFPFM4N.js +1 -0
  66. package/dist/quality-GPQD25UL.js +1 -0
  67. package/dist/repl-CL4SYHU4.js +1 -0
  68. package/dist/roadmap-QRZODSNJ.js +1 -0
  69. package/dist/server-PKOHK5M2.js +1 -0
  70. package/dist/session-5HDDQQP6.js +1 -0
  71. package/dist/skills-DXWSVJSU.js +1 -0
  72. package/dist/store-WXXTKTTL.js +1 -0
  73. package/dist/team-N2GF4YYS.js +1 -0
  74. package/dist/telemetry-NT4UZLBS.js +1 -0
  75. package/dist/test-runner-F6B6RH3S.js +1 -0
  76. package/dist/theme-JJJ6ABR2.js +1 -0
  77. package/dist/upgrade-RUG3R7R5.js +1 -0
  78. package/dist/verify-6OGRY2PR.js +1 -0
  79. package/dist/version-4RHTDUNQ.js +1 -0
  80. package/dist/web/static/app.js +1 -562
  81. package/dist/web/static/index.html +114 -126
  82. package/dist/web/static/mirror.css +1 -1001
  83. package/dist/web/static/mirror.html +155 -178
  84. package/dist/web/static/mirror.js +1 -1125
  85. package/dist/web/static/onboard.css +1 -302
  86. package/dist/web/static/onboard.html +121 -145
  87. package/dist/web/static/onboard.js +1 -300
  88. package/dist/web/static/style.css +1 -602
  89. package/dist/web/static/utils.js +1 -0
  90. package/dist/web/static/workspace.css +1 -1568
  91. package/dist/web/static/workspace.html +369 -402
  92. package/dist/web/static/workspace.js +1 -1683
  93. package/dist/web-CIC7ZKBM.js +1 -0
  94. package/package.json +26 -4
  95. package/dist/api-JHHOZTL6.js +0 -162
  96. package/dist/auth-5QFJLW7J.js +0 -21
  97. package/dist/background-2EGCAAQH.js +0 -14
  98. package/dist/backlog-Q2NZCLNY.js +0 -24
  99. package/dist/chunk-2CMSCWQW.js +0 -162
  100. package/dist/chunk-4DVYJAJL.js +0 -57
  101. package/dist/chunk-5GDYH676.js +0 -271
  102. package/dist/chunk-5NLVGLD7.js +0 -66
  103. package/dist/chunk-6XTEAFZQ.js +0 -575
  104. package/dist/chunk-AQBSMYLT.js +0 -2025
  105. package/dist/chunk-BE46C7JW.js +0 -46
  106. package/dist/chunk-CLKIMCXZ.js +0 -139
  107. package/dist/chunk-DN4ASQ26.js +0 -167
  108. package/dist/chunk-DUWREZXK.js +0 -173
  109. package/dist/chunk-FCW3K6F2.js +0 -263
  110. package/dist/chunk-GFORWAMW.js +0 -251
  111. package/dist/chunk-GH7E2OJE.js +0 -223
  112. package/dist/chunk-GU2FZQ6A.js +0 -69
  113. package/dist/chunk-I7WI3BMB.js +0 -161
  114. package/dist/chunk-IOPKN5GD.js +0 -190
  115. package/dist/chunk-LBVHDGZE.js +0 -133
  116. package/dist/chunk-MGLJ53QN.js +0 -219
  117. package/dist/chunk-NETIY5UB.js +0 -134
  118. package/dist/chunk-NP47L7LG.js +0 -288
  119. package/dist/chunk-O6MG7TOH.js +0 -58
  120. package/dist/chunk-OPZYEVYR.js +0 -150
  121. package/dist/chunk-R3GPQC7I.js +0 -393
  122. package/dist/chunk-R5T3A2NQ.js +0 -166
  123. package/dist/chunk-RKB2JOV2.js +0 -43
  124. package/dist/chunk-RNG3K465.js +0 -80
  125. package/dist/chunk-TGTYKBGC.js +0 -86
  126. package/dist/chunk-UCX4VZCT.js +0 -681
  127. package/dist/chunk-WHLVZCQY.js +0 -245
  128. package/dist/chunk-Y6HMJZDJ.js +0 -1505
  129. package/dist/chunk-ZSBHUGWR.js +0 -262
  130. package/dist/claude-4BX3MJSK.js +0 -12
  131. package/dist/commands-2X4OB5RF.js +0 -128
  132. package/dist/commands-GLBCEVQK.js +0 -1044
  133. package/dist/commands-IINRNBYX.js +0 -232
  134. package/dist/config-RSNQJQPS.js +0 -8
  135. package/dist/config-loader-SXO674TF.js +0 -24
  136. package/dist/diagnose-7UPLS7I4.js +0 -12
  137. package/dist/display-IIUBEYWN.js +0 -58
  138. package/dist/extractor-D3XWOAXI.js +0 -129
  139. package/dist/history-6I6FADAU.js +0 -180
  140. package/dist/index.d.ts +0 -1
  141. package/dist/instance-registry-J7UJ7U4Z.js +0 -15
  142. package/dist/keybindings-PDXIOV3O.js +0 -15
  143. package/dist/loader-GKEYT6Y7.js +0 -58
  144. package/dist/network-JYGHQXAR.js +0 -279
  145. package/dist/notify-HPTALZDC.js +0 -14
  146. package/dist/openai-compat-R7EKWG6Z.js +0 -12
  147. package/dist/permissions-JUKXMNDH.js +0 -10
  148. package/dist/prompt-UWHSZU4P.js +0 -166
  149. package/dist/quality-ST7PPNFR.js +0 -16
  150. package/dist/repl-QHIZ2JGF.js +0 -3374
  151. package/dist/roadmap-5OBEKROY.js +0 -17
  152. package/dist/server-HCNIP7ZQ.js +0 -57
  153. package/dist/session-5EBECDUP.js +0 -21
  154. package/dist/skills-HBQQTYO4.js +0 -175
  155. package/dist/store-FKUTR7GW.js +0 -25
  156. package/dist/team-7BBBP5YQ.js +0 -385
  157. package/dist/telemetry-6R4EIE6O.js +0 -30
  158. package/dist/test-runner-AUAGIBNM.js +0 -619
  159. package/dist/theme-3SYJ3UQA.js +0 -14
  160. package/dist/upgrade-MZFH7OCN.js +0 -83
  161. package/dist/verify-JUDKTPKZ.js +0 -14
  162. package/dist/web-KS3FUGJA.js +0 -39
@@ -1,245 +0,0 @@
1
- // src/core/config-loader.ts
2
- import { readFile, readdir } from "fs/promises";
3
- import { join } from "path";
4
- function splitByHeadings(markdown, level) {
5
- const regex = new RegExp(`^${"#".repeat(level)}\\s+(.+)$`, "gm");
6
- const sections = [];
7
- let lastIndex = 0;
8
- let lastTitle = "";
9
- let match;
10
- while ((match = regex.exec(markdown)) !== null) {
11
- if (lastTitle) {
12
- sections.push({
13
- title: lastTitle,
14
- content: markdown.slice(lastIndex, match.index).trim(),
15
- level
16
- });
17
- }
18
- lastTitle = match[1].trim();
19
- lastIndex = match.index + match[0].length;
20
- }
21
- if (lastTitle) {
22
- sections.push({
23
- title: lastTitle,
24
- content: markdown.slice(lastIndex).trim(),
25
- level
26
- });
27
- }
28
- return sections;
29
- }
30
- function parseKeyValue(text) {
31
- const result = {};
32
- const lines = text.split("\n");
33
- let currentKey = "";
34
- let currentValue = "";
35
- let inMultiline = false;
36
- for (const line of lines) {
37
- if (inMultiline) {
38
- if (/^\w+:/.test(line) && !line.startsWith(" ")) {
39
- result[currentKey] = currentValue.trim();
40
- inMultiline = false;
41
- } else {
42
- currentValue += "\n" + line;
43
- continue;
44
- }
45
- }
46
- const kvMatch = line.match(/^(\w[\w_]*)\s*:\s*(.*)$/);
47
- if (kvMatch) {
48
- const [, key, value] = kvMatch;
49
- if (value === "|" || value === "") {
50
- currentKey = key;
51
- currentValue = "";
52
- inMultiline = true;
53
- } else {
54
- result[key] = value.trim();
55
- }
56
- }
57
- }
58
- if (inMultiline && currentKey) {
59
- result[currentKey] = currentValue.trim();
60
- }
61
- return result;
62
- }
63
- function parseList(text) {
64
- return text.split("\n").filter((line) => line.trim().startsWith("-")).map((line) => line.replace(/^[\s]*-\s*/, "").trim());
65
- }
66
- function parsePWP(content) {
67
- const sections = splitByHeadings(content, 2);
68
- let identity = "";
69
- let qualityStandards = [];
70
- for (const section of sections) {
71
- const titleLower = section.title.toLowerCase();
72
- if (titleLower.includes("\u8EAB\u4EFD") || titleLower.includes("identity")) {
73
- identity = section.content;
74
- } else if (titleLower.includes("\u54C1\u8D28") || titleLower.includes("quality") || titleLower.includes("\u6807\u51C6")) {
75
- qualityStandards = parseList(section.content);
76
- }
77
- }
78
- return { identity, qualityStandards, rawContent: content };
79
- }
80
- function parseAgent(content) {
81
- const sections = splitByHeadings(content, 2);
82
- const firstLine = content.split("\n").find((l) => l.startsWith("# "));
83
- const name = firstLine ? firstLine.replace(/^#\s+/, "").trim() : "unknown";
84
- let role = "";
85
- let skillIds = [];
86
- let style = "";
87
- for (const section of sections) {
88
- const titleLower = section.title.toLowerCase();
89
- if (titleLower.includes("\u89D2\u8272") || titleLower.includes("role")) {
90
- role = section.content;
91
- } else if (titleLower.includes("\u6280\u80FD") || titleLower.includes("skill")) {
92
- skillIds = parseList(section.content);
93
- } else if (titleLower.includes("\u98CE\u683C") || titleLower.includes("style") || titleLower.includes("\u6027\u683C")) {
94
- style = section.content;
95
- }
96
- }
97
- return { name, role, skillIds, style, rawContent: content };
98
- }
99
- function parseSkill(content) {
100
- const sections = splitByHeadings(content, 2);
101
- const firstLine = content.split("\n").find((l) => l.startsWith("# "));
102
- const name = firstLine ? firstLine.replace(/^#\s+/, "").trim() : "unknown";
103
- let domain = "";
104
- let knowledge = "";
105
- let toolStrategy = "";
106
- let qualityStandards = [];
107
- for (const section of sections) {
108
- const titleLower = section.title.toLowerCase();
109
- if (titleLower.includes("\u9886\u57DF") || titleLower.includes("domain")) {
110
- domain = section.content;
111
- } else if (titleLower.includes("\u77E5\u8BC6") || titleLower.includes("knowledge") || titleLower.includes("\u65B9\u6CD5")) {
112
- knowledge = section.content;
113
- } else if (titleLower.includes("\u5DE5\u5177") || titleLower.includes("tool")) {
114
- toolStrategy = section.content;
115
- } else if (titleLower.includes("\u8D28\u91CF") || titleLower.includes("quality") || titleLower.includes("\u6807\u51C6")) {
116
- qualityStandards = parseList(section.content);
117
- }
118
- }
119
- return { name, domain, knowledge, toolStrategy, qualityStandards, rawContent: content };
120
- }
121
- function parseProductionLine(content) {
122
- const sections = splitByHeadings(content, 2);
123
- const firstLine = content.split("\n").find((l) => l.startsWith("# "));
124
- const name = firstLine ? firstLine.replace(/^#\s+/, "").trim() : "unknown";
125
- let description = "";
126
- let icon;
127
- let inputs = [];
128
- let stations = [];
129
- let output = { format: "markdown", description: "" };
130
- for (const section of sections) {
131
- const titleLower = section.title.toLowerCase();
132
- if (titleLower.includes("\u63CF\u8FF0") || titleLower.includes("description")) {
133
- description = section.content;
134
- } else if (titleLower.includes("\u56FE\u6807") || titleLower.includes("icon")) {
135
- icon = section.content.trim();
136
- } else if (titleLower.includes("\u8F93\u5165") || titleLower.includes("input")) {
137
- inputs = parseInputs(section.content);
138
- } else if (titleLower.includes("\u5DE5\u4F4D") || titleLower.includes("station")) {
139
- stations = parseStations(section.content);
140
- } else if (titleLower.includes("\u8F93\u51FA") || titleLower.includes("output")) {
141
- const kv = parseKeyValue(section.content);
142
- output = {
143
- format: kv["format"] || "markdown",
144
- description: kv["description"] || ""
145
- };
146
- }
147
- }
148
- return { name, description, icon, inputs, stations, output };
149
- }
150
- function parseInputs(content) {
151
- return parseList(content).map((line) => {
152
- const nameMatch = line.match(/^(\w+)\s*[::]\s*(.+)/);
153
- if (!nameMatch) return { name: line, type: "string", required: false, description: line };
154
- const [, paramName, rest] = nameMatch;
155
- const required = rest.includes("\u5FC5\u586B") || rest.includes("required");
156
- const defaultMatch = rest.match(/默认值?\s*[::]\s*(.+?)(?:[,,))]|$)/);
157
- return {
158
- name: paramName,
159
- type: "string",
160
- required,
161
- description: rest,
162
- defaultValue: defaultMatch?.[1]?.trim()
163
- };
164
- });
165
- }
166
- function parseStations(content) {
167
- const stationSections = splitByHeadings(content, 3);
168
- return stationSections.map((section, i) => {
169
- const nameMatch = section.title.match(/^\d+\.\s*(.+)/);
170
- const stationName = nameMatch ? nameMatch[1].trim() : section.title;
171
- const kv = parseKeyValue(section.content);
172
- let checkpoint;
173
- if (kv["checkpoint"]) {
174
- const cp = kv["checkpoint"].toLowerCase();
175
- if (cp === "decision" || cp === "approval") {
176
- checkpoint = cp;
177
- }
178
- }
179
- return {
180
- index: i + 1,
181
- name: stationName,
182
- agentName: kv["agent"] || "default",
183
- task: kv["task"] || section.content,
184
- skillName: kv["skill"],
185
- model: kv["model"],
186
- retry: kv["retry"] ? parseInt(kv["retry"], 10) : void 0,
187
- condition: kv["condition"],
188
- checkpoint,
189
- checkpointDescription: kv["checkpoint_description"]
190
- };
191
- });
192
- }
193
- async function loadFile(path) {
194
- return readFile(path, "utf-8");
195
- }
196
- async function loadPWP(dir) {
197
- const content = await loadFile(join(dir, "PWP.md"));
198
- return parsePWP(content);
199
- }
200
- async function loadAgent(dir, name) {
201
- const content = await loadFile(join(dir, "agents", `${name}.agent.md`));
202
- return parseAgent(content);
203
- }
204
- async function loadSkill(dir, name) {
205
- const content = await loadFile(join(dir, "skills", `${name}.skill.md`));
206
- return parseSkill(content);
207
- }
208
- async function loadLine(dir, name) {
209
- const content = await loadFile(join(dir, "lines", `${name}.line.md`));
210
- return parseProductionLine(content);
211
- }
212
- async function listLines(dir) {
213
- const linesDir = join(dir, "lines");
214
- try {
215
- const files = await readdir(linesDir);
216
- const lines = [];
217
- for (const file of files) {
218
- if (file.endsWith(".line.md")) {
219
- const content = await loadFile(join(linesDir, file));
220
- const line = parseProductionLine(content);
221
- lines.push({
222
- name: line.name,
223
- description: line.description,
224
- icon: line.icon
225
- });
226
- }
227
- }
228
- return lines;
229
- } catch {
230
- return [];
231
- }
232
- }
233
-
234
- export {
235
- parsePWP,
236
- parseAgent,
237
- parseSkill,
238
- parseProductionLine,
239
- loadFile,
240
- loadPWP,
241
- loadAgent,
242
- loadSkill,
243
- loadLine,
244
- listLines
245
- };