hypercore-cli 1.1.2 → 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.
- package/LICENSE +92 -21
- package/README.md +8 -1
- package/dist/App-YMX7FSXR.js +1 -0
- package/dist/api-Q2TX5JJL.js +1 -0
- package/dist/auth-X6CUT3DW.js +1 -0
- package/dist/background-ACODXSUG.js +1 -0
- package/dist/backlog-JD2IM336.js +1 -0
- package/dist/chunk-2QI2IU2V.js +1 -0
- package/dist/chunk-3KFRDIPQ.js +1 -0
- package/dist/chunk-42C5J7PN.js +1 -0
- package/dist/chunk-4D7XVJ7Q.js +1 -0
- package/dist/chunk-545IGTXV.js +1 -0
- package/dist/chunk-5KUSGQP2.js +1 -0
- package/dist/chunk-AUQ64BK2.js +1 -0
- package/dist/chunk-AV244H5C.js +1 -0
- package/dist/chunk-BQVBEFS4.js +1 -0
- package/dist/chunk-BYWQLFP2.js +1 -0
- package/dist/chunk-COITWWZJ.js +1 -0
- package/dist/chunk-CR7UUJVX.js +1 -0
- package/dist/chunk-E3MULLBX.js +1 -0
- package/dist/chunk-EWBV7YPP.js +1 -0
- package/dist/chunk-EZHYVJGQ.js +1 -0
- package/dist/chunk-FAKXBY7Q.js +1 -0
- package/dist/chunk-FHGATV5B.js +1 -0
- package/dist/chunk-I2G27Y5P.js +1 -0
- package/dist/chunk-IKF43TX2.js +1 -0
- package/dist/chunk-INSPHCBN.js +1 -0
- package/dist/chunk-LQMDUKIE.js +1 -0
- package/dist/chunk-M3MTKGA5.js +1 -0
- package/dist/chunk-MPO54FU3.js +1 -0
- package/dist/chunk-PVKCZI6A.js +1 -0
- package/dist/chunk-Q7KEPCYL.js +1 -0
- package/dist/chunk-R5XD3NT2.js +1 -0
- package/dist/chunk-ROBZ6PAL.js +1 -0
- package/dist/chunk-RXB5BS2N.js +1 -0
- package/dist/chunk-RZ3HNYMT.js +1 -0
- package/dist/chunk-UCGLRMTG.js +1 -0
- package/dist/chunk-UEHJVRKB.js +1 -0
- package/dist/chunk-UZYX5GGF.js +1 -0
- package/dist/chunk-XQJBB725.js +1 -0
- package/dist/chunk-ZB5ZQSXH.js +1 -0
- package/dist/claude-US2QPRBA.js +1 -0
- package/dist/commands-5TFN74MD.js +1 -0
- package/dist/commands-EKPWCB3T.js +1 -0
- package/dist/commands-QHJLREPM.js +1 -0
- package/dist/config-2OUL5FLS.js +1 -0
- package/dist/config-loader-N7IBWN2P.js +1 -0
- package/dist/diagnose-NLHN4SAJ.js +1 -0
- package/dist/display-TB5YACJV.js +1 -0
- package/dist/extractor-3KTM2IUL.js +1 -0
- package/dist/feature-flag-VVIF5FJG.js +1 -0
- package/dist/history-GVNDPXXQ.js +1 -0
- package/dist/index.js +1 -402
- package/dist/instance-registry-I5AIVJE2.js +1 -0
- package/dist/keybindings-RN3A7CRW.js +1 -0
- package/dist/loader-3IKPXP4R.js +1 -0
- package/dist/network-GI2F3IDE.js +1 -0
- package/dist/notify-O6FNVHC4.js +1 -0
- package/dist/openai-compat-IPCMINVF.js +1 -0
- package/dist/permissions-5O7KVAXU.js +1 -0
- package/dist/prompt-VWFPFM4N.js +1 -0
- package/dist/quality-GPQD25UL.js +1 -0
- package/dist/repl-YNXCDVU4.js +1 -0
- package/dist/roadmap-QRZODSNJ.js +1 -0
- package/dist/server-USQP4GC4.js +1 -0
- package/dist/session-5HDDQQP6.js +1 -0
- package/dist/skills-DXWSVJSU.js +1 -0
- package/dist/store-WXXTKTTL.js +1 -0
- package/dist/team-VTPJ3WRT.js +1 -0
- package/dist/telemetry-NT4UZLBS.js +1 -0
- package/dist/test-runner-F6B6RH3S.js +1 -0
- package/dist/theme-JJJ6ABR2.js +1 -0
- package/dist/upgrade-RUG3R7R5.js +1 -0
- package/dist/verify-6OGRY2PR.js +1 -0
- package/dist/version-DLROA5JN.js +1 -0
- package/dist/web/static/app.js +1 -562
- package/dist/web/static/index.html +114 -126
- package/dist/web/static/mirror.css +1 -1001
- package/dist/web/static/mirror.html +155 -178
- package/dist/web/static/mirror.js +1 -1125
- package/dist/web/static/onboard.css +1 -302
- package/dist/web/static/onboard.html +121 -145
- package/dist/web/static/onboard.js +1 -300
- package/dist/web/static/style.css +1 -602
- package/dist/web/static/utils.js +1 -0
- package/dist/web/static/workspace.css +1 -1568
- package/dist/web/static/workspace.html +369 -402
- package/dist/web/static/workspace.js +1 -1683
- package/dist/web-P5YUKEAU.js +1 -0
- package/package.json +25 -4
- package/dist/api-JHHOZTL6.js +0 -162
- package/dist/auth-5QFJLW7J.js +0 -21
- package/dist/background-2EGCAAQH.js +0 -14
- package/dist/backlog-Q2NZCLNY.js +0 -24
- package/dist/chunk-2CMSCWQW.js +0 -162
- package/dist/chunk-4DVYJAJL.js +0 -57
- package/dist/chunk-5GDYH676.js +0 -271
- package/dist/chunk-5NLVGLD7.js +0 -66
- package/dist/chunk-6XTEAFZQ.js +0 -575
- package/dist/chunk-AQBSMYLT.js +0 -2025
- package/dist/chunk-BE46C7JW.js +0 -46
- package/dist/chunk-CLKIMCXZ.js +0 -139
- package/dist/chunk-DN4ASQ26.js +0 -167
- package/dist/chunk-DUWREZXK.js +0 -173
- package/dist/chunk-FCW3K6F2.js +0 -263
- package/dist/chunk-GFORWAMW.js +0 -251
- package/dist/chunk-GH7E2OJE.js +0 -223
- package/dist/chunk-GU2FZQ6A.js +0 -69
- package/dist/chunk-I7WI3BMB.js +0 -161
- package/dist/chunk-IOPKN5GD.js +0 -190
- package/dist/chunk-LBVHDGZE.js +0 -133
- package/dist/chunk-MGLJ53QN.js +0 -219
- package/dist/chunk-NETIY5UB.js +0 -134
- package/dist/chunk-NP47L7LG.js +0 -288
- package/dist/chunk-O6MG7TOH.js +0 -58
- package/dist/chunk-OPZYEVYR.js +0 -150
- package/dist/chunk-R3GPQC7I.js +0 -393
- package/dist/chunk-R5T3A2NQ.js +0 -166
- package/dist/chunk-RKB2JOV2.js +0 -43
- package/dist/chunk-RNG3K465.js +0 -80
- package/dist/chunk-TGTYKBGC.js +0 -86
- package/dist/chunk-UCX4VZCT.js +0 -681
- package/dist/chunk-WHLVZCQY.js +0 -245
- package/dist/chunk-Y6HMJZDJ.js +0 -1505
- package/dist/chunk-ZSBHUGWR.js +0 -262
- package/dist/claude-4BX3MJSK.js +0 -12
- package/dist/commands-2X4OB5RF.js +0 -128
- package/dist/commands-GLBCEVQK.js +0 -1044
- package/dist/commands-IINRNBYX.js +0 -232
- package/dist/config-RSNQJQPS.js +0 -8
- package/dist/config-loader-SXO674TF.js +0 -24
- package/dist/diagnose-7UPLS7I4.js +0 -12
- package/dist/display-IIUBEYWN.js +0 -58
- package/dist/extractor-D3XWOAXI.js +0 -129
- package/dist/history-6I6FADAU.js +0 -180
- package/dist/index.d.ts +0 -1
- package/dist/instance-registry-J7UJ7U4Z.js +0 -15
- package/dist/keybindings-PDXIOV3O.js +0 -15
- package/dist/loader-GKEYT6Y7.js +0 -58
- package/dist/network-JYGHQXAR.js +0 -279
- package/dist/notify-HPTALZDC.js +0 -14
- package/dist/openai-compat-R7EKWG6Z.js +0 -12
- package/dist/permissions-JUKXMNDH.js +0 -10
- package/dist/prompt-UWHSZU4P.js +0 -166
- package/dist/quality-ST7PPNFR.js +0 -16
- package/dist/repl-QHIZ2JGF.js +0 -3374
- package/dist/roadmap-5OBEKROY.js +0 -17
- package/dist/server-HCNIP7ZQ.js +0 -57
- package/dist/session-5EBECDUP.js +0 -21
- package/dist/skills-HBQQTYO4.js +0 -175
- package/dist/store-FKUTR7GW.js +0 -25
- package/dist/team-7BBBP5YQ.js +0 -385
- package/dist/telemetry-6R4EIE6O.js +0 -30
- package/dist/test-runner-AUAGIBNM.js +0 -619
- package/dist/theme-3SYJ3UQA.js +0 -14
- package/dist/upgrade-MZFH7OCN.js +0 -83
- package/dist/verify-JUDKTPKZ.js +0 -14
- package/dist/web-KS3FUGJA.js +0 -39
package/dist/chunk-WHLVZCQY.js
DELETED
|
@@ -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
|
-
};
|