hypercore-cli 1.1.0 → 1.1.1
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/dist/{api-XGC7D5AW.js → api-D4PUN5BN.js} +13 -13
- package/dist/{auth-DNQWYQKT.js → auth-UTR4I6QY.js} +2 -2
- package/dist/{chunk-GOOTEPBK.js → chunk-77FRUHTU.js} +1 -1
- package/dist/{chunk-KRPOPWGA.js → chunk-7ZYMJFCA.js} +1 -1
- package/dist/{chunk-GPPMJYSM.js → chunk-CM423E2U.js} +1 -1
- package/dist/{chunk-43OLRXM5.js → chunk-E4NKO2KI.js} +1 -1
- package/dist/{chunk-XOS6HPEF.js → chunk-GMLQ7GZ5.js} +1 -1
- package/dist/{chunk-AUHU7ALH.js → chunk-LWDNLX6B.js} +33 -31
- package/dist/{chunk-B6A2AKLN.js → chunk-NHPDLYEW.js} +1 -1
- package/dist/{chunk-6OL3GA3P.js → chunk-OGQGKMDX.js} +2 -2
- package/dist/{chunk-IXOIOGR5.js → chunk-OWAOKDIN.js} +2 -2
- package/dist/{chunk-3RPFCQKJ.js → chunk-SHJQMIJL.js} +2 -2
- package/dist/{chunk-V5UHPPSY.js → chunk-SVF2VWOZ.js} +8 -3
- package/dist/{chunk-MV4TTRYX.js → chunk-V2EBSFPU.js} +53 -11
- package/dist/{chunk-U5SGAIMM.js → chunk-VJDQNNSO.js} +6 -6
- package/dist/{chunk-2LJ2DVEB.js → chunk-VQ35XX7B.js} +2 -2
- package/dist/{chunk-XDRCBMZZ.js → chunk-XMGHVNH2.js} +1 -1
- package/dist/{chunk-CUVAUOXL.js → chunk-YWOSOTUO.js} +1 -1
- package/dist/{chunk-QTSLP47C.js → chunk-ZQRNV2US.js} +2 -2
- package/dist/{claude-NSQ442XD.js → claude-O5FSOXZC.js} +3 -3
- package/dist/{commands-CK3WFAGI.js → commands-43PLOWRU.js} +2 -2
- package/dist/{commands-ZE6GD3WC.js → commands-5YVUSUMP.js} +3 -3
- package/dist/{commands-U63OEO5J.js → commands-VZMZJFZF.js} +1 -1
- package/dist/{config-4EW42BSF.js → config-WXXEEEVW.js} +1 -1
- package/dist/{diagnose-AFW3ZTZ4.js → diagnose-BX45APUZ.js} +1 -1
- package/dist/{extractor-QV53W2YJ.js → extractor-R5ABXNTJ.js} +4 -4
- package/dist/{history-WMSCHERZ.js → history-JPXZEOT3.js} +1 -1
- package/dist/index.js +61 -64
- package/dist/{instance-registry-YSIJXSO7.js → instance-registry-6NJTCAE4.js} +2 -2
- package/dist/{keybindings-JAAMLH3G.js → keybindings-ADWNOX5M.js} +2 -2
- package/dist/{loader-WHNTZTLP.js → loader-AXDDCB2G.js} +2 -2
- package/dist/{network-MM6YWPGO.js → network-V3O4UZYZ.js} +8 -8
- package/dist/{openai-compat-UQWJXBEK.js → openai-compat-UFDV2SCK.js} +3 -3
- package/dist/{prompt-QV45TXRL.js → prompt-5CZ34WGA.js} +7 -7
- package/dist/{repl-RT3AHL7M.js → repl-EOWP6AAB.js} +32 -33
- package/dist/{server-PORT7OEG.js → server-BB5AENWU.js} +12 -12
- package/dist/{session-4VUNDWLH.js → session-5NDKKFLN.js} +2 -2
- package/dist/{skills-V4A35XKG.js → skills-JVLIQVJN.js} +2 -2
- package/dist/{store-Y4LU5QTO.js → store-G7KRD4PN.js} +2 -2
- package/dist/{team-HO7Z4SIM.js → team-FVNNVDBY.js} +3 -3
- package/dist/{test-runner-ZQH5Y6OJ.js → test-runner-REKSVPPY.js} +1 -1
- package/dist/{upgrade-7TGI3SXO.js → upgrade-YSXCO63I.js} +1 -1
- package/dist/web/static/onboard.html +11 -0
- package/dist/web/static/onboard.js +40 -0
- package/dist/{web-Z5HSCQHW.js → web-H2BJXUBZ.js} +12 -12
- package/package.json +1 -1
|
@@ -8,31 +8,31 @@ import {
|
|
|
8
8
|
loadRound,
|
|
9
9
|
saveNetworkConfig,
|
|
10
10
|
updateProfileField
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VJDQNNSO.js";
|
|
12
12
|
import {
|
|
13
13
|
parseBody,
|
|
14
14
|
sendError,
|
|
15
15
|
sendJSON
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-LWDNLX6B.js";
|
|
17
|
+
import "./chunk-VQ35XX7B.js";
|
|
18
18
|
import {
|
|
19
19
|
loadTeam
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-OGQGKMDX.js";
|
|
21
|
+
import "./chunk-GMLQ7GZ5.js";
|
|
22
22
|
import {
|
|
23
23
|
validateToken
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-XMGHVNH2.js";
|
|
25
|
+
import "./chunk-V2EBSFPU.js";
|
|
26
|
+
import "./chunk-OWAOKDIN.js";
|
|
27
|
+
import "./chunk-7ZYMJFCA.js";
|
|
28
28
|
import "./chunk-GU2FZQ6A.js";
|
|
29
29
|
import "./chunk-R3GPQC7I.js";
|
|
30
30
|
import "./chunk-BE46C7JW.js";
|
|
31
31
|
import "./chunk-RNG3K465.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-E4NKO2KI.js";
|
|
33
|
+
import "./chunk-77FRUHTU.js";
|
|
34
|
+
import "./chunk-NHPDLYEW.js";
|
|
35
|
+
import "./chunk-SVF2VWOZ.js";
|
|
36
36
|
import "./chunk-WHLVZCQY.js";
|
|
37
37
|
import "./chunk-TGTYKBGC.js";
|
|
38
38
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attachWebSocket
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VQ35XX7B.js";
|
|
4
4
|
import {
|
|
5
5
|
addMember,
|
|
6
6
|
addTask,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
loadRun,
|
|
13
13
|
loadTeam,
|
|
14
14
|
updateTask
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OGQGKMDX.js";
|
|
16
16
|
import {
|
|
17
17
|
deleteSession,
|
|
18
18
|
exportSession,
|
|
@@ -20,18 +20,18 @@ import {
|
|
|
20
20
|
listSessions,
|
|
21
21
|
loadSession,
|
|
22
22
|
saveSession
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-GMLQ7GZ5.js";
|
|
24
24
|
import {
|
|
25
25
|
validateToken
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-XMGHVNH2.js";
|
|
27
27
|
import {
|
|
28
28
|
Engine,
|
|
29
29
|
HYPERCORE_DIR,
|
|
30
30
|
initializeWorkspace
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-V2EBSFPU.js";
|
|
32
32
|
import {
|
|
33
33
|
createToolRegistry
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-OWAOKDIN.js";
|
|
35
35
|
import {
|
|
36
36
|
estimateCost,
|
|
37
37
|
formatCost
|
|
@@ -39,18 +39,18 @@ import {
|
|
|
39
39
|
import {
|
|
40
40
|
createLLMClient,
|
|
41
41
|
streamCallLLM
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-E4NKO2KI.js";
|
|
43
43
|
import {
|
|
44
44
|
createOpenAIClient,
|
|
45
45
|
streamOpenAIChat
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-77FRUHTU.js";
|
|
47
47
|
import {
|
|
48
48
|
hookManager
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-NHPDLYEW.js";
|
|
50
50
|
import {
|
|
51
51
|
HYPERCORE_DIR as HYPERCORE_DIR2,
|
|
52
52
|
loadConfig
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-SVF2VWOZ.js";
|
|
54
54
|
import {
|
|
55
55
|
listLines
|
|
56
56
|
} from "./chunk-WHLVZCQY.js";
|
|
@@ -662,7 +662,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
662
662
|
}
|
|
663
663
|
if (pathname === "/api/team/local-token" && method === "GET") {
|
|
664
664
|
try {
|
|
665
|
-
const { loadLocalToken } = await import("./auth-
|
|
665
|
+
const { loadLocalToken } = await import("./auth-UTR4I6QY.js");
|
|
666
666
|
const token = await loadLocalToken();
|
|
667
667
|
sendJSON(res, token || { available: false });
|
|
668
668
|
} catch {
|
|
@@ -778,7 +778,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
778
778
|
}
|
|
779
779
|
if (pathname === "/api/memory" && method === "GET") {
|
|
780
780
|
try {
|
|
781
|
-
const { getMemoryStats, listMemories } = await import("./store-
|
|
781
|
+
const { getMemoryStats, listMemories } = await import("./store-G7KRD4PN.js");
|
|
782
782
|
const layers = {};
|
|
783
783
|
for (const layer of ["personal", "project"]) {
|
|
784
784
|
try {
|
|
@@ -802,14 +802,14 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
802
802
|
}
|
|
803
803
|
if (pathname === "/api/memory/search" && method === "POST") {
|
|
804
804
|
try {
|
|
805
|
-
const { parseBody: parseBody2 } = await import("./server-
|
|
805
|
+
const { parseBody: parseBody2 } = await import("./server-BB5AENWU.js");
|
|
806
806
|
const body = await parseBody2(req);
|
|
807
807
|
const query = body.query;
|
|
808
808
|
if (!query) {
|
|
809
809
|
sendError(res, "query is required", 400);
|
|
810
810
|
return;
|
|
811
811
|
}
|
|
812
|
-
const { searchMemories } = await import("./store-
|
|
812
|
+
const { searchMemories } = await import("./store-G7KRD4PN.js");
|
|
813
813
|
const results = await searchMemories("personal", query, {
|
|
814
814
|
category: body.category,
|
|
815
815
|
limit: 20
|
|
@@ -885,7 +885,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
885
885
|
}
|
|
886
886
|
if (pathname === "/api/instances" && method === "GET") {
|
|
887
887
|
try {
|
|
888
|
-
const { listInstances } = await import("./instance-registry-
|
|
888
|
+
const { listInstances } = await import("./instance-registry-6NJTCAE4.js");
|
|
889
889
|
const instances = await listInstances();
|
|
890
890
|
const currentPid = process.pid;
|
|
891
891
|
sendJSON(res, {
|
|
@@ -936,7 +936,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
936
936
|
}
|
|
937
937
|
if (pathname === "/api/onboard" && method === "POST") {
|
|
938
938
|
try {
|
|
939
|
-
const { parseBody: parseBody2 } = await import("./server-
|
|
939
|
+
const { parseBody: parseBody2 } = await import("./server-BB5AENWU.js");
|
|
940
940
|
const body = await parseBody2(req);
|
|
941
941
|
if (!body.industry || !body.role || !body.provider || !body.apiKey) {
|
|
942
942
|
sendError(res, "\u7F3A\u5C11\u5FC5\u8981\u5B57\u6BB5\uFF08industry, role, provider, apiKey\uFF09", 400);
|
|
@@ -958,7 +958,9 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
958
958
|
provider: body.provider,
|
|
959
959
|
apiKey: body.apiKey,
|
|
960
960
|
tavilyKey: body.tavilyKey || void 0,
|
|
961
|
-
role: body.role
|
|
961
|
+
role: body.role,
|
|
962
|
+
customBaseUrl: body.customBaseUrl || void 0,
|
|
963
|
+
customModelName: body.customModelName || void 0
|
|
962
964
|
});
|
|
963
965
|
const profilePath = join(HYPERCORE_DIR, "workspace-profile.json");
|
|
964
966
|
await writeFile(profilePath, JSON.stringify(profile, null, 2), "utf-8");
|
|
@@ -1047,7 +1049,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
1047
1049
|
}
|
|
1048
1050
|
if (pathname === "/api/admin/diagnose" && method === "GET") {
|
|
1049
1051
|
try {
|
|
1050
|
-
const { runRuleDiagnosis } = await import("./diagnose-
|
|
1052
|
+
const { runRuleDiagnosis } = await import("./diagnose-BX45APUZ.js");
|
|
1051
1053
|
const url = new URL(req.url || "/", "http://localhost");
|
|
1052
1054
|
const days = parseInt(url.searchParams.get("days") || "7") || 7;
|
|
1053
1055
|
const findings = await runRuleDiagnosis(days);
|
|
@@ -1091,7 +1093,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
1091
1093
|
}
|
|
1092
1094
|
if (pathname === "/api/admin/tests" && method === "GET") {
|
|
1093
1095
|
try {
|
|
1094
|
-
const { getTestRunnerSnapshot } = await import("./test-runner-
|
|
1096
|
+
const { getTestRunnerSnapshot } = await import("./test-runner-REKSVPPY.js");
|
|
1095
1097
|
const snapshot = await getTestRunnerSnapshot({
|
|
1096
1098
|
projectRoot: process.cwd(),
|
|
1097
1099
|
baseUrl: `http://127.0.0.1:${getActivePort()}`
|
|
@@ -1104,7 +1106,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
1104
1106
|
}
|
|
1105
1107
|
if (pathname === "/api/admin/tests/auto" && method === "GET") {
|
|
1106
1108
|
try {
|
|
1107
|
-
const { getAutoRegressionSnapshot } = await import("./test-runner-
|
|
1109
|
+
const { getAutoRegressionSnapshot } = await import("./test-runner-REKSVPPY.js");
|
|
1108
1110
|
const snapshot = await getAutoRegressionSnapshot({
|
|
1109
1111
|
projectRoot: process.cwd(),
|
|
1110
1112
|
baseUrl: `http://127.0.0.1:${getActivePort()}`
|
|
@@ -1117,7 +1119,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
1117
1119
|
}
|
|
1118
1120
|
if (pathname === "/api/admin/tests/auto" && method === "POST") {
|
|
1119
1121
|
try {
|
|
1120
|
-
const { parseBody: parseBody2 } = await import("./server-
|
|
1122
|
+
const { parseBody: parseBody2 } = await import("./server-BB5AENWU.js");
|
|
1121
1123
|
const body = await parseBody2(req);
|
|
1122
1124
|
const update = {};
|
|
1123
1125
|
if (Object.prototype.hasOwnProperty.call(body, "enabled")) {
|
|
@@ -1143,7 +1145,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
1143
1145
|
}
|
|
1144
1146
|
update.intervalMinutes = Math.floor(interval);
|
|
1145
1147
|
}
|
|
1146
|
-
const { updateAutoRegressionConfig, getTestRunnerSnapshot } = await import("./test-runner-
|
|
1148
|
+
const { updateAutoRegressionConfig, getTestRunnerSnapshot } = await import("./test-runner-REKSVPPY.js");
|
|
1147
1149
|
await updateAutoRegressionConfig(update, {
|
|
1148
1150
|
projectRoot: process.cwd(),
|
|
1149
1151
|
baseUrl: `http://127.0.0.1:${getActivePort()}`
|
|
@@ -1166,7 +1168,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
1166
1168
|
getTestRunDetail,
|
|
1167
1169
|
formatTestRunDownloadText,
|
|
1168
1170
|
getTestRunDownloadFileName
|
|
1169
|
-
} = await import("./test-runner-
|
|
1171
|
+
} = await import("./test-runner-REKSVPPY.js");
|
|
1170
1172
|
const detail = await getTestRunDetail(runId);
|
|
1171
1173
|
const filename = getTestRunDownloadFileName(detail.info, "log");
|
|
1172
1174
|
const content = formatTestRunDownloadText(detail);
|
|
@@ -1180,7 +1182,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
1180
1182
|
if (testRunExportMatch && method === "GET") {
|
|
1181
1183
|
try {
|
|
1182
1184
|
const runId = decodeURIComponent(testRunExportMatch[1]);
|
|
1183
|
-
const { getTestRunDetail, getTestRunDownloadFileName } = await import("./test-runner-
|
|
1185
|
+
const { getTestRunDetail, getTestRunDownloadFileName } = await import("./test-runner-REKSVPPY.js");
|
|
1184
1186
|
const detail = await getTestRunDetail(runId);
|
|
1185
1187
|
const filename = getTestRunDownloadFileName(detail.info, "json");
|
|
1186
1188
|
const content = JSON.stringify(detail, null, 2);
|
|
@@ -1194,7 +1196,7 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
1194
1196
|
if (testRunDetailMatch && method === "GET") {
|
|
1195
1197
|
try {
|
|
1196
1198
|
const runId = decodeURIComponent(testRunDetailMatch[1]);
|
|
1197
|
-
const { getTestRunDetail } = await import("./test-runner-
|
|
1199
|
+
const { getTestRunDetail } = await import("./test-runner-REKSVPPY.js");
|
|
1198
1200
|
const detail = await getTestRunDetail(runId);
|
|
1199
1201
|
sendJSON(res, detail);
|
|
1200
1202
|
} catch (err) {
|
|
@@ -1204,10 +1206,10 @@ async function handleApiRequest(req, res, config, pathname) {
|
|
|
1204
1206
|
}
|
|
1205
1207
|
if (pathname === "/api/admin/tests/run" && method === "POST") {
|
|
1206
1208
|
try {
|
|
1207
|
-
const { parseBody: parseBody2 } = await import("./server-
|
|
1209
|
+
const { parseBody: parseBody2 } = await import("./server-BB5AENWU.js");
|
|
1208
1210
|
const body = await parseBody2(req);
|
|
1209
1211
|
const suiteId = typeof body.suiteId === "string" && body.suiteId.trim() ? body.suiteId.trim() : void 0;
|
|
1210
|
-
const { startTestSuiteRun } = await import("./test-runner-
|
|
1212
|
+
const { startTestSuiteRun } = await import("./test-runner-REKSVPPY.js");
|
|
1211
1213
|
const snapshot = await startTestSuiteRun({
|
|
1212
1214
|
projectRoot: process.cwd(),
|
|
1213
1215
|
suiteId,
|
|
@@ -1863,7 +1865,7 @@ function buildWebServer(config, host = "127.0.0.1") {
|
|
|
1863
1865
|
return;
|
|
1864
1866
|
}
|
|
1865
1867
|
if (pathname.startsWith("/api/network/")) {
|
|
1866
|
-
const { handleNetworkApiRequest } = await import("./api-
|
|
1868
|
+
const { handleNetworkApiRequest } = await import("./api-D4PUN5BN.js");
|
|
1867
1869
|
await handleNetworkApiRequest(req, res, config, pathname);
|
|
1868
1870
|
return;
|
|
1869
1871
|
}
|
|
@@ -1893,7 +1895,7 @@ function createWebServer(config, port, host = "127.0.0.1") {
|
|
|
1893
1895
|
const browserHost = resolveBrowserHost(host);
|
|
1894
1896
|
server.listen(port, host, () => {
|
|
1895
1897
|
setActivePort(port);
|
|
1896
|
-
import("./test-runner-
|
|
1898
|
+
import("./test-runner-REKSVPPY.js").then(({ getAutoRegressionSnapshot }) => {
|
|
1897
1899
|
getAutoRegressionSnapshot({
|
|
1898
1900
|
projectRoot: process.cwd(),
|
|
1899
1901
|
baseUrl: `http://127.0.0.1:${port}`
|
|
@@ -1940,7 +1942,7 @@ function createWebServerAutoPort(config, startPort = 3210, host = "127.0.0.1", m
|
|
|
1940
1942
|
trackWebStart(host, port, host === "0.0.0.0" || host === "::");
|
|
1941
1943
|
}).catch(() => {
|
|
1942
1944
|
});
|
|
1943
|
-
import("./test-runner-
|
|
1945
|
+
import("./test-runner-REKSVPPY.js").then(({ getAutoRegressionSnapshot }) => {
|
|
1944
1946
|
getAutoRegressionSnapshot({
|
|
1945
1947
|
projectRoot: process.cwd(),
|
|
1946
1948
|
baseUrl: `http://127.0.0.1:${port}`
|
|
@@ -1965,7 +1967,7 @@ function createWebServerAutoPort(config, startPort = 3210, host = "127.0.0.1", m
|
|
|
1965
1967
|
});
|
|
1966
1968
|
}
|
|
1967
1969
|
if (process.argv[1] && process.argv[1].includes("web/server")) {
|
|
1968
|
-
const { loadConfig: loadConfig2 } = await import("./config-
|
|
1970
|
+
const { loadConfig: loadConfig2 } = await import("./config-WXXEEEVW.js");
|
|
1969
1971
|
const config = await loadConfig2();
|
|
1970
1972
|
const port = parseInt(process.env.PORT || "3210", 10);
|
|
1971
1973
|
createWebServer(config, port);
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
generateId,
|
|
3
3
|
generateJoinCode,
|
|
4
4
|
generateToken
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-XMGHVNH2.js";
|
|
6
6
|
import {
|
|
7
7
|
HYPERCORE_DIR
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SVF2VWOZ.js";
|
|
9
9
|
|
|
10
10
|
// src/team/store.ts
|
|
11
11
|
import { readFile, writeFile, mkdir, readdir } from "fs/promises";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addMemory,
|
|
3
3
|
searchMemories
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7ZYMJFCA.js";
|
|
5
5
|
import {
|
|
6
6
|
applyPermissions
|
|
7
7
|
} from "./chunk-GU2FZQ6A.js";
|
|
8
8
|
import {
|
|
9
9
|
HYPERCORE_DIR
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SVF2VWOZ.js";
|
|
11
11
|
import {
|
|
12
12
|
getTaskOutput,
|
|
13
13
|
spawnBackground
|
|
@@ -214,7 +214,7 @@ async function runAIDiagnosis(ctx, days = 7) {
|
|
|
214
214
|
const aiFindings = [];
|
|
215
215
|
try {
|
|
216
216
|
if (ctx.config.modelConfig.sdkType === "openai") {
|
|
217
|
-
const { streamOpenAIChat } = await import("./openai-compat-
|
|
217
|
+
const { streamOpenAIChat } = await import("./openai-compat-UFDV2SCK.js");
|
|
218
218
|
const OpenAI = (await import("openai")).default;
|
|
219
219
|
const client = ctx.getClient();
|
|
220
220
|
const result = await streamOpenAIChat(client, [
|
|
@@ -231,7 +231,7 @@ async function runAIDiagnosis(ctx, days = 7) {
|
|
|
231
231
|
});
|
|
232
232
|
aiRawText = result.content.trim();
|
|
233
233
|
} else {
|
|
234
|
-
const { streamCallLLM } = await import("./claude-
|
|
234
|
+
const { streamCallLLM } = await import("./claude-O5FSOXZC.js");
|
|
235
235
|
const Anthropic = (await import("@anthropic-ai/sdk")).default;
|
|
236
236
|
const client = ctx.getClient();
|
|
237
237
|
const result = await streamCallLLM(client, {
|
|
@@ -61,10 +61,15 @@ function parseSectionValues(content, sectionName) {
|
|
|
61
61
|
if (!match) return {};
|
|
62
62
|
const result = {};
|
|
63
63
|
const lines = match[1].split("\n");
|
|
64
|
-
for (const
|
|
65
|
-
const kvMatch =
|
|
64
|
+
for (const rawLine of lines) {
|
|
65
|
+
const kvMatch = rawLine.match(/^\s*([A-Za-z_]\w*)\s*=\s*(?:"((?:\\.|[^"])*)"|(\S+))(?:\s+#.*)?\s*$/);
|
|
66
66
|
if (kvMatch) {
|
|
67
|
-
|
|
67
|
+
const key = kvMatch[1];
|
|
68
|
+
const quoted = kvMatch[2];
|
|
69
|
+
const bare = kvMatch[3];
|
|
70
|
+
let value = quoted != null ? quoted : bare;
|
|
71
|
+
value = value.replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\"/g, '"').replace(/\\\\/g, "\\");
|
|
72
|
+
result[key] = value;
|
|
68
73
|
}
|
|
69
74
|
}
|
|
70
75
|
return result;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createToolRegistry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OWAOKDIN.js";
|
|
4
4
|
import {
|
|
5
5
|
callLLM
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-E4NKO2KI.js";
|
|
7
7
|
import {
|
|
8
8
|
callOpenAILLM
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-77FRUHTU.js";
|
|
10
10
|
import {
|
|
11
11
|
MODEL_ALIASES,
|
|
12
12
|
MODEL_PROVIDERS
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SVF2VWOZ.js";
|
|
14
14
|
import {
|
|
15
15
|
loadAgent,
|
|
16
16
|
loadLine,
|
|
@@ -47,15 +47,47 @@ async function copyTemplateDir(srcDir, destDir) {
|
|
|
47
47
|
} catch {
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
+
function normalizeTemplateFileName(name, kind) {
|
|
51
|
+
const trimmed = name.trim();
|
|
52
|
+
if (!trimmed) return "";
|
|
53
|
+
if (trimmed.endsWith(`.${kind}.md`)) return trimmed;
|
|
54
|
+
if (trimmed.endsWith(".md")) return trimmed;
|
|
55
|
+
return `${trimmed}.${kind}.md`;
|
|
56
|
+
}
|
|
57
|
+
async function copyTemplateSubset(srcDir, destDir, selected, kind) {
|
|
58
|
+
if (!selected || selected.length === 0) {
|
|
59
|
+
await copyTemplateDir(srcDir, destDir);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
await mkdir(destDir, { recursive: true });
|
|
63
|
+
const wanted = new Set(
|
|
64
|
+
selected.map((name) => normalizeTemplateFileName(name, kind)).filter(Boolean)
|
|
65
|
+
);
|
|
66
|
+
try {
|
|
67
|
+
const entries = await readdir(srcDir, { withFileTypes: true });
|
|
68
|
+
for (const entry of entries) {
|
|
69
|
+
if (!entry.isFile()) continue;
|
|
70
|
+
if (!wanted.has(entry.name)) continue;
|
|
71
|
+
const srcPath = join(srcDir, entry.name);
|
|
72
|
+
const destPath = join(destDir, entry.name);
|
|
73
|
+
if (!existsSync(destPath)) {
|
|
74
|
+
await copyFile(srcPath, destPath);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
} catch {
|
|
78
|
+
}
|
|
79
|
+
}
|
|
50
80
|
function escapeTomlValue(value) {
|
|
51
81
|
return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r");
|
|
52
82
|
}
|
|
53
|
-
function generateConfigToml(provider, apiKey, tavilyKey) {
|
|
83
|
+
function generateConfigToml(provider, apiKey, tavilyKey, customBaseUrl, customModelName) {
|
|
54
84
|
const modelConfigs = {
|
|
55
85
|
anthropic: { name: "claude-sonnet-4-20250514" },
|
|
56
86
|
minimax: { name: "MiniMax-M2.5", base_url: "https://api.minimax.io/anthropic" },
|
|
57
87
|
gemini: { name: "gemini-2.5-flash", base_url: "https://generativelanguage.googleapis.com/v1beta/openai" },
|
|
58
|
-
deepseek: { name: "deepseek-chat", base_url: "https://api.deepseek.com/v1" }
|
|
88
|
+
deepseek: { name: "deepseek-chat", base_url: "https://api.deepseek.com/v1" },
|
|
89
|
+
"deepseek-coder": { name: "deepseek-coder", base_url: "https://api.deepseek.com/v1" },
|
|
90
|
+
"openai-compatible": { name: customModelName || "gpt-4o", base_url: customBaseUrl }
|
|
59
91
|
};
|
|
60
92
|
const modelConfig = modelConfigs[provider] || modelConfigs["gemini"];
|
|
61
93
|
let config = `# Hypercore \u914D\u7F6E\u6587\u4EF6
|
|
@@ -110,15 +142,25 @@ ${role}
|
|
|
110
142
|
`;
|
|
111
143
|
}
|
|
112
144
|
async function initializeWorkspace(options) {
|
|
113
|
-
const {
|
|
145
|
+
const {
|
|
146
|
+
provider,
|
|
147
|
+
apiKey,
|
|
148
|
+
tavilyKey,
|
|
149
|
+
role,
|
|
150
|
+
customBaseUrl,
|
|
151
|
+
customModelName,
|
|
152
|
+
agents,
|
|
153
|
+
skills,
|
|
154
|
+
lines
|
|
155
|
+
} = options;
|
|
114
156
|
await mkdir(HYPERCORE_DIR, { recursive: true });
|
|
115
157
|
for (const sub of ["agents", "skills", "lines", "outputs", "memory"]) {
|
|
116
158
|
await mkdir(join(HYPERCORE_DIR, sub), { recursive: true });
|
|
117
159
|
}
|
|
118
160
|
const templatesDir = getTemplatesDir();
|
|
119
|
-
await
|
|
120
|
-
await
|
|
121
|
-
await
|
|
161
|
+
await copyTemplateSubset(join(templatesDir, "agents"), join(HYPERCORE_DIR, "agents"), agents, "agent");
|
|
162
|
+
await copyTemplateSubset(join(templatesDir, "skills"), join(HYPERCORE_DIR, "skills"), skills, "skill");
|
|
163
|
+
await copyTemplateSubset(join(templatesDir, "lines"), join(HYPERCORE_DIR, "lines"), lines, "line");
|
|
122
164
|
if (role) {
|
|
123
165
|
const pwpPath = join(HYPERCORE_DIR, "PWP.md");
|
|
124
166
|
if (!existsSync(pwpPath)) {
|
|
@@ -132,7 +174,7 @@ async function initializeWorkspace(options) {
|
|
|
132
174
|
}
|
|
133
175
|
await writeFile(
|
|
134
176
|
configPath,
|
|
135
|
-
generateConfigToml(provider, apiKey, tavilyKey),
|
|
177
|
+
generateConfigToml(provider, apiKey, tavilyKey, customBaseUrl, customModelName),
|
|
136
178
|
"utf-8"
|
|
137
179
|
);
|
|
138
180
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
broadcastToTeam,
|
|
3
3
|
sendToMember
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VQ35XX7B.js";
|
|
5
5
|
import {
|
|
6
6
|
listTasks,
|
|
7
7
|
loadTeam
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OGQGKMDX.js";
|
|
9
9
|
import {
|
|
10
10
|
generateId
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XMGHVNH2.js";
|
|
12
12
|
import {
|
|
13
13
|
callLLM,
|
|
14
14
|
createLLMClient
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-E4NKO2KI.js";
|
|
16
16
|
import {
|
|
17
17
|
callOpenAILLM
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-77FRUHTU.js";
|
|
19
19
|
import {
|
|
20
20
|
MODEL_ALIASES,
|
|
21
21
|
MODEL_PROVIDERS
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-SVF2VWOZ.js";
|
|
23
23
|
|
|
24
24
|
// src/network/store.ts
|
|
25
25
|
import fs from "fs/promises";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadTeam,
|
|
3
3
|
updateMemberStatus
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OGQGKMDX.js";
|
|
5
5
|
import {
|
|
6
6
|
validateToken
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XMGHVNH2.js";
|
|
8
8
|
|
|
9
9
|
// src/web/ws.ts
|
|
10
10
|
import { WebSocketServer, WebSocket } from "ws";
|
|
@@ -58,7 +58,7 @@ ${task.description}`;
|
|
|
58
58
|
});
|
|
59
59
|
const executionPromise = (async () => {
|
|
60
60
|
if (config.modelConfig.sdkType === "openai") {
|
|
61
|
-
const { streamOpenAIChat } = await import("./openai-compat-
|
|
61
|
+
const { streamOpenAIChat } = await import("./openai-compat-UFDV2SCK.js");
|
|
62
62
|
const OpenAI = (await import("openai")).default;
|
|
63
63
|
const openaiClient = client;
|
|
64
64
|
const messages = [
|
|
@@ -81,7 +81,7 @@ ${task.description}`;
|
|
|
81
81
|
tokenUsage.inputTokens += result.tokenUsage.inputTokens;
|
|
82
82
|
tokenUsage.outputTokens += result.tokenUsage.outputTokens;
|
|
83
83
|
} else {
|
|
84
|
-
const { streamCallLLM } = await import("./claude-
|
|
84
|
+
const { streamCallLLM } = await import("./claude-O5FSOXZC.js");
|
|
85
85
|
const Anthropic = (await import("@anthropic-ai/sdk")).default;
|
|
86
86
|
const anthropicClient = client;
|
|
87
87
|
const result = await streamCallLLM(anthropicClient, {
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
callLLM,
|
|
3
3
|
createLLMClient,
|
|
4
4
|
streamCallLLM
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-E4NKO2KI.js";
|
|
6
|
+
import "./chunk-NHPDLYEW.js";
|
|
7
|
+
import "./chunk-SVF2VWOZ.js";
|
|
8
8
|
export {
|
|
9
9
|
callLLM,
|
|
10
10
|
createLLMClient,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadLocalToken
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XMGHVNH2.js";
|
|
4
4
|
import {
|
|
5
5
|
showError,
|
|
6
6
|
showTaskList,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-R3GPQC7I.js";
|
|
9
9
|
import "./chunk-BE46C7JW.js";
|
|
10
10
|
import "./chunk-RNG3K465.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-SVF2VWOZ.js";
|
|
12
12
|
|
|
13
13
|
// src/team/commands.ts
|
|
14
14
|
import chalk from "chalk";
|