@runfusion/fusion 0.23.0 → 0.25.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/dist/bin.js +27921 -21003
- package/dist/client/assets/AgentDetailView-BwJaLqZh.css +1 -0
- package/dist/client/assets/AgentDetailView-ZbHEbYRT.js +18 -0
- package/dist/client/assets/AgentsView-B3jYk8Kt.js +29 -0
- package/dist/client/assets/{AgentsView-DSGQWObq.css → AgentsView-CV3vm7Qk.css} +1 -1
- package/dist/client/assets/ChatView-DhPkiEGs.js +1 -0
- package/dist/client/assets/ChatView-DwJAd5G1.css +1 -0
- package/dist/client/assets/{DevServerView-C9lzHrcT.js → DevServerView-DyGDEiBP.js} +1 -1
- package/dist/client/assets/{DirectoryPicker-aVdFaV37.js → DirectoryPicker-D5UIeIl6.js} +1 -1
- package/dist/client/assets/{DocumentsView-DIpg3NSP.js → DocumentsView-DNHu1T8K.js} +1 -1
- package/dist/client/assets/{DocumentsView-BrhyOdeE.css → DocumentsView-gv4zG3aT.css} +1 -1
- package/dist/client/assets/EvalsView-CUNJ1TLc.css +1 -0
- package/dist/client/assets/EvalsView-CpRobtDi.js +1 -0
- package/dist/client/assets/{agentSkills-DDHJnrkn.css → ExperimentalAgentOnboardingModal-B-APN_lM.css} +1 -1
- package/dist/client/assets/ExperimentalAgentOnboardingModal-DOY_oZi7.js +499 -0
- package/dist/client/assets/InsightsView-B0J4mhzV.css +1 -0
- package/dist/client/assets/InsightsView-vp0RE8Mg.js +11 -0
- package/dist/client/assets/MemoryView-PSc5lGJt.js +2 -0
- package/dist/client/assets/MemoryView-zaXewZzi.css +1 -0
- package/dist/client/assets/NodesView-DMj6HGeC.js +14 -0
- package/dist/client/assets/NodesView-DT4pXowv.css +1 -0
- package/dist/client/assets/{PiExtensionsManager-Buopv-jb.js → PiExtensionsManager-DL_QcN56.js} +2 -2
- package/dist/client/assets/PluginManager-BtYKm8IT.js +1 -0
- package/dist/client/assets/PluginManager-DtRQXia5.css +1 -0
- package/dist/client/assets/{ResearchView-_BHXUv2j.js → ResearchView-BhWqfdV0.js} +1 -1
- package/dist/client/assets/SettingsModal-BAgB4_AR.js +31 -0
- package/dist/client/assets/SettingsModal-CUCyaAyE.js +1 -0
- package/dist/client/assets/SettingsModal-DzsLquBu.css +1 -0
- package/dist/client/assets/SetupWizardModal-BKscasuh.js +1 -0
- package/dist/client/assets/{SkillsView-hDpTBdFT.js → SkillsView-BdELqTy7.js} +1 -1
- package/dist/client/assets/TodoView-Cx9cVhq7.css +1 -0
- package/dist/client/assets/TodoView-DFNGBDNV.js +6 -0
- package/dist/client/assets/{folder-open-usZkXdq2.js → folder-open-k1xmUMyr.js} +1 -1
- package/dist/client/assets/index-Qq2JOOWx.css +1 -0
- package/dist/client/assets/index-TFYXEVpn.js +692 -0
- package/dist/client/assets/projectDetection-G3XuxD2X.js +1 -0
- package/dist/client/assets/{star-BAT_ObKE.js → star-ne32r3Y4.js} +1 -1
- package/dist/client/assets/{upload-BC2YKNEV.js → upload-MS-2Gx53.js} +1 -1
- package/dist/client/assets/{users-Dkd4rtrN.js → users-C519GSjH.js} +1 -1
- package/dist/client/index.html +12 -20
- package/dist/client/theme-data.css +106 -0
- package/dist/client/version.json +1 -1
- package/dist/droid-cli/package.json +1 -1
- package/dist/extension.js +15395 -9935
- package/dist/pi-claude-cli/package.json +1 -1
- package/dist/plugins/fusion-plugin-cursor-runtime/bundled.js +216 -0
- package/dist/plugins/fusion-plugin-cursor-runtime/manifest.json +6 -0
- package/dist/plugins/fusion-plugin-cursor-runtime/package.json +11 -0
- package/dist/plugins/fusion-plugin-dependency-graph/bundled.js +30 -0
- package/dist/plugins/fusion-plugin-dependency-graph/manifest.json +1 -1
- package/dist/plugins/fusion-plugin-dependency-graph/package.json +3 -26
- package/dist/plugins/fusion-plugin-droid-runtime/bundled.js +136684 -0
- package/dist/plugins/fusion-plugin-droid-runtime/manifest.json +13 -0
- package/dist/plugins/fusion-plugin-droid-runtime/mcp-schema-server.cjs +49 -0
- package/dist/plugins/fusion-plugin-droid-runtime/package.json +11 -0
- package/dist/plugins/fusion-plugin-hermes-runtime/bundled.js +68 -71
- package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-openclaw-runtime/bundled.js +137 -53
- package/dist/plugins/fusion-plugin-openclaw-runtime/mcp-schema-server.cjs +59 -0
- package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-paperclip-runtime/bundled.js +155 -109
- package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
- package/dist/plugins/fusion-plugin-reports/manifest.json +33 -0
- package/dist/plugins/fusion-plugin-reports/package.json +26 -0
- package/dist/plugins/fusion-plugin-reports/src/__tests__/manifest.test.ts +51 -0
- package/dist/plugins/fusion-plugin-reports/src/__tests__/review-panel.test.ts +166 -0
- package/dist/plugins/fusion-plugin-reports/src/__tests__/settings.test.ts +157 -0
- package/dist/plugins/fusion-plugin-reports/src/index.ts +87 -0
- package/dist/plugins/fusion-plugin-reports/src/report-schema.ts +38 -0
- package/dist/plugins/fusion-plugin-reports/src/review-panel.ts +294 -0
- package/dist/plugins/fusion-plugin-reports/src/review-types.ts +75 -0
- package/dist/plugins/fusion-plugin-reports/src/settings.ts +105 -0
- package/dist/plugins/fusion-plugin-reports/src/store/__tests__/report-schema.test.ts +66 -0
- package/dist/plugins/fusion-plugin-reports/src/store/__tests__/report-store.test.ts +177 -0
- package/dist/plugins/fusion-plugin-reports/src/store/report-store.ts +341 -0
- package/dist/plugins/fusion-plugin-reports/src/store/report-types.ts +77 -0
- package/dist/plugins/fusion-plugin-roadmap/manifest.json +16 -0
- package/dist/plugins/fusion-plugin-roadmap/package.json +48 -0
- package/dist/plugins/fusion-plugin-roadmap/src/__tests__/api-client.test.ts +101 -0
- package/dist/plugins/fusion-plugin-roadmap/src/__tests__/index.test.ts +92 -0
- package/dist/plugins/fusion-plugin-roadmap/src/__tests__/roadmap-routes.test.ts +48 -0
- package/dist/plugins/fusion-plugin-roadmap/src/__tests__/roadmap-suggestions.test.ts +31 -0
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/RoadmapsView.css +1299 -0
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/RoadmapsView.tsx +2559 -0
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/__tests__/RoadmapsView.test.tsx +1144 -0
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/__tests__/useRoadmaps.test.ts +1756 -0
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/api.ts +70 -0
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/test-setup.ts +7 -0
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/types.ts +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/useConfirm.ts +8 -0
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/useRoadmaps.ts +1188 -0
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard/useViewportMode.ts +20 -0
- package/dist/plugins/fusion-plugin-roadmap/src/dashboard-view.tsx +6 -0
- package/dist/plugins/fusion-plugin-roadmap/src/index.ts +74 -0
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-routes.ts +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-schema.ts +41 -0
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-suggestions.d.ts +15 -0
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-suggestions.ts +15 -0
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-types.d.ts +283 -0
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-types.d.ts.map +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-types.js +21 -0
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-types.js.map +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/roadmap-types.ts +310 -0
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-routes.d.ts +5 -0
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-routes.d.ts.map +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-routes.js +361 -0
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-routes.js.map +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-routes.ts +408 -0
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-suggestions.d.ts +68 -0
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-suggestions.d.ts.map +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-suggestions.js +300 -0
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-suggestions.js.map +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/routes/roadmap-suggestions.ts +381 -0
- package/dist/plugins/fusion-plugin-roadmap/src/server/index.d.ts +3 -0
- package/dist/plugins/fusion-plugin-roadmap/src/server/index.ts +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-handoff.test.ts +445 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-ordering.test.ts +334 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/__tests__/roadmap-store.test.ts +1318 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-handoff.ts +163 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-ordering.d.ts +37 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-ordering.d.ts.map +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-ordering.js +188 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-ordering.js.map +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-ordering.ts +311 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-store.d.ts +299 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-store.d.ts.map +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-store.js +765 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-store.js.map +1 -0
- package/dist/plugins/fusion-plugin-roadmap/src/store/roadmap-store.ts +1001 -0
- package/dist/plugins/fusion-plugin-whatsapp-chat/manifest.json +8 -0
- package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +34 -0
- package/dist/plugins/fusion-plugin-whatsapp-chat/src/__tests__/auth-state.test.ts +99 -0
- package/dist/plugins/fusion-plugin-whatsapp-chat/src/__tests__/connection.test.ts +145 -0
- package/dist/plugins/fusion-plugin-whatsapp-chat/src/__tests__/index.test.ts +216 -0
- package/dist/plugins/fusion-plugin-whatsapp-chat/src/__tests__/reply.test.ts +52 -0
- package/dist/plugins/fusion-plugin-whatsapp-chat/src/auth-state.ts +89 -0
- package/dist/plugins/fusion-plugin-whatsapp-chat/src/connection.ts +253 -0
- package/dist/plugins/fusion-plugin-whatsapp-chat/src/index.ts +262 -0
- package/dist/plugins/fusion-plugin-whatsapp-chat/src/qrcode.d.ts +1 -0
- package/dist/plugins/fusion-plugin-whatsapp-chat/src/reply.ts +37 -0
- package/package.json +2 -2
- package/skill/fusion/SKILL.md +2 -2
- package/skill/fusion/references/engine-tools.md +3 -0
- package/skill/fusion/references/extension-tools.md +39 -0
- package/skill/fusion/references/fusion-capabilities.md +3 -0
- package/dist/client/assets/AgentDetailView-C1XceMgi.js +0 -18
- package/dist/client/assets/AgentDetailView-CeO_1MK7.css +0 -1
- package/dist/client/assets/AgentsView-Deh125ss.js +0 -527
- package/dist/client/assets/ChatView-7D_RQDqT.js +0 -1
- package/dist/client/assets/InsightsView-AWo5o_81.css +0 -1
- package/dist/client/assets/InsightsView-jKjEFAx_.js +0 -11
- package/dist/client/assets/MemoryView-DiajLXby.css +0 -1
- package/dist/client/assets/MemoryView-nXlTqebk.js +0 -2
- package/dist/client/assets/NodesView-Di2SvOhg.js +0 -14
- package/dist/client/assets/NodesView-fXqDk9ur.css +0 -1
- package/dist/client/assets/PluginManager-B9-NbQ8f.js +0 -1
- package/dist/client/assets/PluginManager-C1DbPaar.css +0 -1
- package/dist/client/assets/RoadmapsView-DHWjUoc8.js +0 -6
- package/dist/client/assets/RoadmapsView-DdGlfuu-.css +0 -1
- package/dist/client/assets/SettingsModal-C89Ikhfm.js +0 -1
- package/dist/client/assets/SettingsModal-DHitIpsa.css +0 -1
- package/dist/client/assets/SettingsModal-DR_yirvK.js +0 -31
- package/dist/client/assets/SetupWizardModal-BtDMY9pa.js +0 -1
- package/dist/client/assets/agentSkills-B-w5wFHh.js +0 -1
- package/dist/client/assets/index-Bc6ZdGMz.css +0 -1
- package/dist/client/assets/index-D__RMku8.js +0 -694
- package/dist/plugins/fusion-plugin-dependency-graph/src/DependencyGraphView.css +0 -141
- package/dist/plugins/fusion-plugin-dependency-graph/src/DependencyGraphView.tsx +0 -428
- package/dist/plugins/fusion-plugin-dependency-graph/src/__tests__/DependencyGraphView.test.tsx +0 -261
- package/dist/plugins/fusion-plugin-dependency-graph/src/__tests__/storage.test.ts +0 -41
- package/dist/plugins/fusion-plugin-dependency-graph/src/index.ts +0 -25
- package/dist/plugins/fusion-plugin-dependency-graph/src/storage.ts +0 -22
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "fusion-plugin-droid-runtime",
|
|
3
|
+
"name": "Droid Runtime Plugin",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Droid runtime plugin for Fusion",
|
|
6
|
+
"author": "Fusion Team",
|
|
7
|
+
"runtime": {
|
|
8
|
+
"runtimeId": "droid",
|
|
9
|
+
"name": "Droid Runtime",
|
|
10
|
+
"description": "Drives the Droid CLI for Fusion agents",
|
|
11
|
+
"version": "0.1.0"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Schema-only MCP server. Reads tool schemas from a JSON file.
|
|
3
|
+
// Only implements initialize + tools/list. tools/call is never reached
|
|
4
|
+
// because the parent process kills the Claude subprocess at message_stop
|
|
5
|
+
// before tool execution (break-early pattern).
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
const fs = require("fs");
|
|
9
|
+
const readline = require("readline");
|
|
10
|
+
|
|
11
|
+
const schemaPath = process.argv[2];
|
|
12
|
+
if (!schemaPath) {
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let tools = [];
|
|
17
|
+
try {
|
|
18
|
+
tools = JSON.parse(fs.readFileSync(schemaPath, "utf-8"));
|
|
19
|
+
} catch {
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const rl = readline.createInterface({ input: process.stdin });
|
|
24
|
+
rl.on("line", (line) => {
|
|
25
|
+
let msg;
|
|
26
|
+
try {
|
|
27
|
+
msg = JSON.parse(line);
|
|
28
|
+
} catch {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (msg.method === "initialize") {
|
|
33
|
+
const resp = {
|
|
34
|
+
jsonrpc: "2.0",
|
|
35
|
+
id: msg.id,
|
|
36
|
+
result: {
|
|
37
|
+
protocolVersion: "2024-11-05",
|
|
38
|
+
capabilities: { tools: {} },
|
|
39
|
+
serverInfo: { name: "custom-tools", version: "1.0.0" },
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
process.stdout.write(JSON.stringify(resp) + "\n");
|
|
43
|
+
} else if (msg.method === "tools/list") {
|
|
44
|
+
const resp = { jsonrpc: "2.0", id: msg.id, result: { tools } };
|
|
45
|
+
process.stdout.write(JSON.stringify(resp) + "\n");
|
|
46
|
+
}
|
|
47
|
+
// notifications/initialized: no response needed (notification)
|
|
48
|
+
// tools/call: never reached (break-early kills subprocess first)
|
|
49
|
+
});
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
// ../plugin-sdk/
|
|
1
|
+
// ../plugin-sdk/src/index.ts
|
|
2
2
|
function definePlugin(plugin2) {
|
|
3
3
|
return plugin2;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
// ../../plugins/fusion-plugin-hermes-runtime/
|
|
6
|
+
// ../../plugins/fusion-plugin-hermes-runtime/src/cli-spawn.ts
|
|
7
7
|
import { spawn, spawnSync } from "node:child_process";
|
|
8
8
|
import os from "node:os";
|
|
9
9
|
import path, { sep as PATH_SEP } from "node:path";
|
|
10
10
|
var resolvedBinaryCache = /* @__PURE__ */ new Map();
|
|
11
11
|
function resolveBinaryForSpawn(binary) {
|
|
12
|
-
if (process.platform !== "win32")
|
|
13
|
-
return binary;
|
|
12
|
+
if (process.platform !== "win32") return binary;
|
|
14
13
|
if (binary.includes(PATH_SEP) || binary.includes("/") || /\.[a-z]{2,4}$/i.test(binary)) {
|
|
15
14
|
return binary;
|
|
16
15
|
}
|
|
17
16
|
const cached = resolvedBinaryCache.get(binary);
|
|
18
|
-
if (cached)
|
|
19
|
-
return cached;
|
|
17
|
+
if (cached) return cached;
|
|
20
18
|
try {
|
|
21
19
|
const result = spawnSync("where", [binary], { encoding: "utf-8" });
|
|
22
20
|
if (result.status === 0) {
|
|
@@ -50,19 +48,15 @@ function parseProfileListOutput(raw) {
|
|
|
50
48
|
const lines = raw.replace(ANSI_RE, "").replace(/\r\n/g, "\n").replace(/\r/g, "\n").split("\n");
|
|
51
49
|
const profiles = [];
|
|
52
50
|
for (const line of lines) {
|
|
53
|
-
if (line.trim() === "")
|
|
54
|
-
|
|
55
|
-
if (
|
|
56
|
-
continue;
|
|
57
|
-
if (PROFILE_RULE_RE.test(line))
|
|
58
|
-
continue;
|
|
51
|
+
if (line.trim() === "") continue;
|
|
52
|
+
if (/^\s*Profile\b/.test(line)) continue;
|
|
53
|
+
if (PROFILE_RULE_RE.test(line)) continue;
|
|
59
54
|
const stripped = line.replace(/^\s+/, "");
|
|
60
55
|
const columns = stripped.split(/\s{2,}/);
|
|
61
56
|
const rawName = columns[0] ?? "";
|
|
62
57
|
const isDefault = rawName.startsWith("\u25C6");
|
|
63
58
|
const name = rawName.replace(/^◆/, "").trim();
|
|
64
|
-
if (!name)
|
|
65
|
-
continue;
|
|
59
|
+
if (!name) continue;
|
|
66
60
|
const toUndef = (v) => v === void 0 || v.trim() === "" || v.trim() === EM_DASH ? void 0 : v.trim();
|
|
67
61
|
profiles.push({
|
|
68
62
|
name,
|
|
@@ -76,8 +70,7 @@ function parseProfileListOutput(raw) {
|
|
|
76
70
|
}
|
|
77
71
|
function hermesProfileHome(profileName) {
|
|
78
72
|
const base = process.env.HERMES_HOME ?? path.join(os.homedir(), ".hermes");
|
|
79
|
-
if (profileName === "default" || profileName === "")
|
|
80
|
-
return base;
|
|
73
|
+
if (profileName === "default" || profileName === "") return base;
|
|
81
74
|
return path.join(base, "profiles", profileName);
|
|
82
75
|
}
|
|
83
76
|
async function listHermesProfiles(opts) {
|
|
@@ -90,8 +83,7 @@ async function listHermesProfiles(opts) {
|
|
|
90
83
|
env: { ...process.env }
|
|
91
84
|
});
|
|
92
85
|
const timer = setTimeout(() => {
|
|
93
|
-
if (settled)
|
|
94
|
-
return;
|
|
86
|
+
if (settled) return;
|
|
95
87
|
settled = true;
|
|
96
88
|
try {
|
|
97
89
|
child.kill("SIGKILL");
|
|
@@ -108,16 +100,18 @@ async function listHermesProfiles(opts) {
|
|
|
108
100
|
stderr += chunk.toString("utf-8");
|
|
109
101
|
});
|
|
110
102
|
child.on("error", (err) => {
|
|
111
|
-
if (settled)
|
|
112
|
-
return;
|
|
103
|
+
if (settled) return;
|
|
113
104
|
settled = true;
|
|
114
105
|
clearTimeout(timer);
|
|
115
106
|
const isNotFound = err.code === "ENOENT";
|
|
116
|
-
reject(
|
|
107
|
+
reject(
|
|
108
|
+
new Error(
|
|
109
|
+
isNotFound ? `hermes profile list failed: binary not found at "${opts?.binaryPath ?? "hermes"}"` : `hermes profile list failed: ${err.message}`
|
|
110
|
+
)
|
|
111
|
+
);
|
|
117
112
|
});
|
|
118
113
|
child.on("close", (code) => {
|
|
119
|
-
if (settled)
|
|
120
|
-
return;
|
|
114
|
+
if (settled) return;
|
|
121
115
|
settled = true;
|
|
122
116
|
clearTimeout(timer);
|
|
123
117
|
if (code !== 0) {
|
|
@@ -133,22 +127,18 @@ ${combined}`));
|
|
|
133
127
|
function resolveCliSettings(settings) {
|
|
134
128
|
const str = (v) => typeof v === "string" && v.trim().length > 0 ? v.trim() : void 0;
|
|
135
129
|
const num = (v, envKey, fallback) => {
|
|
136
|
-
if (typeof v === "number" && Number.isFinite(v) && v > 0)
|
|
137
|
-
return v;
|
|
130
|
+
if (typeof v === "number" && Number.isFinite(v) && v > 0) return v;
|
|
138
131
|
const raw = str(v) ?? str(process.env[envKey]);
|
|
139
132
|
if (raw !== void 0) {
|
|
140
133
|
const parsed = Number(raw);
|
|
141
|
-
if (Number.isFinite(parsed) && parsed > 0)
|
|
142
|
-
return parsed;
|
|
134
|
+
if (Number.isFinite(parsed) && parsed > 0) return parsed;
|
|
143
135
|
}
|
|
144
136
|
return fallback;
|
|
145
137
|
};
|
|
146
138
|
const bool = (v, envKey, fallback) => {
|
|
147
|
-
if (typeof v === "boolean")
|
|
148
|
-
return v;
|
|
139
|
+
if (typeof v === "boolean") return v;
|
|
149
140
|
const raw = str(v) ?? str(process.env[envKey]);
|
|
150
|
-
if (raw !== void 0)
|
|
151
|
-
return raw === "1" || raw.toLowerCase() === "true";
|
|
141
|
+
if (raw !== void 0) return raw === "1" || raw.toLowerCase() === "true";
|
|
152
142
|
return fallback;
|
|
153
143
|
};
|
|
154
144
|
return {
|
|
@@ -214,8 +204,7 @@ async function invokeHermesCli(prompt, settings, resumeSessionId, signal) {
|
|
|
214
204
|
env: spawnEnv
|
|
215
205
|
});
|
|
216
206
|
const hardKillTimer = setTimeout(() => {
|
|
217
|
-
if (settled)
|
|
218
|
-
return;
|
|
207
|
+
if (settled) return;
|
|
219
208
|
settled = true;
|
|
220
209
|
try {
|
|
221
210
|
child.kill("SIGKILL");
|
|
@@ -224,8 +213,7 @@ async function invokeHermesCli(prompt, settings, resumeSessionId, signal) {
|
|
|
224
213
|
reject(new Error(`hermes: process timed out after ${settings.cliTimeoutMs}ms`));
|
|
225
214
|
}, settings.cliTimeoutMs);
|
|
226
215
|
const onAbort = () => {
|
|
227
|
-
if (settled)
|
|
228
|
-
return;
|
|
216
|
+
if (settled) return;
|
|
229
217
|
settled = true;
|
|
230
218
|
clearTimeout(hardKillTimer);
|
|
231
219
|
try {
|
|
@@ -250,17 +238,19 @@ async function invokeHermesCli(prompt, settings, resumeSessionId, signal) {
|
|
|
250
238
|
stderr += chunk.toString("utf-8");
|
|
251
239
|
});
|
|
252
240
|
child.on("error", (err) => {
|
|
253
|
-
if (settled)
|
|
254
|
-
return;
|
|
241
|
+
if (settled) return;
|
|
255
242
|
settled = true;
|
|
256
243
|
clearTimeout(hardKillTimer);
|
|
257
244
|
signal?.removeEventListener("abort", onAbort);
|
|
258
245
|
const isNotFound = err.code === "ENOENT";
|
|
259
|
-
reject(
|
|
246
|
+
reject(
|
|
247
|
+
new Error(
|
|
248
|
+
isNotFound ? `hermes: binary not found at "${settings.binaryPath}". Install hermes or set binaryPath/HERMES_BIN.` : `hermes: spawn error \u2014 ${err.message}`
|
|
249
|
+
)
|
|
250
|
+
);
|
|
260
251
|
});
|
|
261
252
|
child.on("close", (code) => {
|
|
262
|
-
if (settled)
|
|
263
|
-
return;
|
|
253
|
+
if (settled) return;
|
|
264
254
|
settled = true;
|
|
265
255
|
clearTimeout(hardKillTimer);
|
|
266
256
|
signal?.removeEventListener("abort", onAbort);
|
|
@@ -279,16 +269,25 @@ ${combined}`));
|
|
|
279
269
|
});
|
|
280
270
|
}
|
|
281
271
|
|
|
282
|
-
// ../../plugins/fusion-plugin-hermes-runtime/
|
|
283
|
-
import {
|
|
272
|
+
// ../../plugins/fusion-plugin-hermes-runtime/src/fusion-skill-install.ts
|
|
273
|
+
import {
|
|
274
|
+
cpSync,
|
|
275
|
+
existsSync,
|
|
276
|
+
lstatSync,
|
|
277
|
+
mkdirSync,
|
|
278
|
+
readFileSync,
|
|
279
|
+
readlinkSync,
|
|
280
|
+
rmSync,
|
|
281
|
+
symlinkSync,
|
|
282
|
+
unlinkSync
|
|
283
|
+
} from "node:fs";
|
|
284
284
|
import { homedir } from "node:os";
|
|
285
285
|
import { basename, dirname, join, resolve } from "node:path";
|
|
286
286
|
import { fileURLToPath } from "node:url";
|
|
287
287
|
var FUSION_SKILL_NAME = "fusion";
|
|
288
288
|
function resolveHermesHome(profile) {
|
|
289
289
|
const base = process.env.HERMES_HOME ?? join(homedir(), ".hermes");
|
|
290
|
-
if (!profile || profile === "default")
|
|
291
|
-
return base;
|
|
290
|
+
if (!profile || profile === "default") return base;
|
|
292
291
|
return join(base, "profiles", profile);
|
|
293
292
|
}
|
|
294
293
|
function getFusionSkillSourceCandidates(moduleUrl = import.meta.url) {
|
|
@@ -304,8 +303,7 @@ function getFusionSkillSourceCandidates(moduleUrl = import.meta.url) {
|
|
|
304
303
|
function resolveBundledFusionSkillSource() {
|
|
305
304
|
const candidates = getFusionSkillSourceCandidates();
|
|
306
305
|
for (const candidate of candidates) {
|
|
307
|
-
if (existsSync(join(candidate, "SKILL.md")))
|
|
308
|
-
return candidate;
|
|
306
|
+
if (existsSync(join(candidate, "SKILL.md"))) return candidate;
|
|
309
307
|
}
|
|
310
308
|
return null;
|
|
311
309
|
}
|
|
@@ -401,8 +399,7 @@ function isBrokenSymlink(path2) {
|
|
|
401
399
|
}
|
|
402
400
|
function looksLikePriorFusionInstall(path2) {
|
|
403
401
|
const skillMd = join(path2, "SKILL.md");
|
|
404
|
-
if (!existsSync(skillMd))
|
|
405
|
-
return false;
|
|
402
|
+
if (!existsSync(skillMd)) return false;
|
|
406
403
|
try {
|
|
407
404
|
const body = readFileSync(skillMd, "utf-8");
|
|
408
405
|
return /\bfusion\b/i.test(body) && /\bskill\b/i.test(body);
|
|
@@ -411,14 +408,12 @@ function looksLikePriorFusionInstall(path2) {
|
|
|
411
408
|
}
|
|
412
409
|
}
|
|
413
410
|
function looksLikeFusionSkillTarget(path2) {
|
|
414
|
-
if (!path2)
|
|
415
|
-
|
|
416
|
-
if (basename(path2).toLowerCase() === FUSION_SKILL_NAME)
|
|
417
|
-
return true;
|
|
411
|
+
if (!path2) return false;
|
|
412
|
+
if (basename(path2).toLowerCase() === FUSION_SKILL_NAME) return true;
|
|
418
413
|
return existsSync(join(path2, "SKILL.md"));
|
|
419
414
|
}
|
|
420
415
|
|
|
421
|
-
// ../../plugins/fusion-plugin-hermes-runtime/
|
|
416
|
+
// ../../plugins/fusion-plugin-hermes-runtime/src/runtime-adapter.ts
|
|
422
417
|
function buildRuntimeContextSection(options) {
|
|
423
418
|
const skillNames = Array.isArray(options.skills) ? options.skills.filter((value) => typeof value === "string" && value.trim().length > 0) : [];
|
|
424
419
|
const skillSelection = options.skillSelection;
|
|
@@ -439,7 +434,9 @@ var HermesRuntimeAdapter = class {
|
|
|
439
434
|
name = "Hermes Runtime";
|
|
440
435
|
settings;
|
|
441
436
|
constructor(settings) {
|
|
442
|
-
this.settings = resolveCliSettings(
|
|
437
|
+
this.settings = resolveCliSettings(
|
|
438
|
+
settings
|
|
439
|
+
);
|
|
443
440
|
}
|
|
444
441
|
async createSession(options) {
|
|
445
442
|
const session = {
|
|
@@ -483,17 +480,14 @@ ${prompt}`;
|
|
|
483
480
|
describeFromSettings() {
|
|
484
481
|
const provider = this.settings.provider;
|
|
485
482
|
const model = this.settings.model;
|
|
486
|
-
if (provider && model)
|
|
487
|
-
|
|
488
|
-
if (
|
|
489
|
-
return `hermes/${model}`;
|
|
490
|
-
if (provider)
|
|
491
|
-
return `hermes/${provider}`;
|
|
483
|
+
if (provider && model) return `hermes/${provider}/${model}`;
|
|
484
|
+
if (model) return `hermes/${model}`;
|
|
485
|
+
if (provider) return `hermes/${provider}`;
|
|
492
486
|
return "hermes";
|
|
493
487
|
}
|
|
494
488
|
};
|
|
495
489
|
|
|
496
|
-
// ../../plugins/fusion-plugin-hermes-runtime/
|
|
490
|
+
// ../../plugins/fusion-plugin-hermes-runtime/src/probe.ts
|
|
497
491
|
import { spawn as spawn2 } from "node:child_process";
|
|
498
492
|
var DEFAULT_PROBE_TIMEOUT_MS = 2e3;
|
|
499
493
|
async function probeHermesBinary(opts) {
|
|
@@ -510,8 +504,7 @@ async function probeHermesBinary(opts) {
|
|
|
510
504
|
stdio: ["ignore", "pipe", "pipe"]
|
|
511
505
|
});
|
|
512
506
|
const timer = setTimeout(() => {
|
|
513
|
-
if (settled)
|
|
514
|
-
return;
|
|
507
|
+
if (settled) return;
|
|
515
508
|
settled = true;
|
|
516
509
|
try {
|
|
517
510
|
child.kill("SIGKILL");
|
|
@@ -532,8 +525,7 @@ async function probeHermesBinary(opts) {
|
|
|
532
525
|
stderr += chunk.toString("utf-8");
|
|
533
526
|
});
|
|
534
527
|
child.on("error", (err) => {
|
|
535
|
-
if (settled)
|
|
536
|
-
return;
|
|
528
|
+
if (settled) return;
|
|
537
529
|
settled = true;
|
|
538
530
|
clearTimeout(timer);
|
|
539
531
|
const isNotFound = err.code === "ENOENT";
|
|
@@ -544,8 +536,7 @@ async function probeHermesBinary(opts) {
|
|
|
544
536
|
});
|
|
545
537
|
});
|
|
546
538
|
child.on("close", (code) => {
|
|
547
|
-
if (settled)
|
|
548
|
-
return;
|
|
539
|
+
if (settled) return;
|
|
549
540
|
settled = true;
|
|
550
541
|
clearTimeout(timer);
|
|
551
542
|
if (code === 0) {
|
|
@@ -584,7 +575,7 @@ async function tryResolveBinaryPath(binary) {
|
|
|
584
575
|
});
|
|
585
576
|
}
|
|
586
577
|
|
|
587
|
-
// ../../plugins/fusion-plugin-hermes-runtime/
|
|
578
|
+
// ../../plugins/fusion-plugin-hermes-runtime/src/index.ts
|
|
588
579
|
var HERMES_RUNTIME_ID = "hermes";
|
|
589
580
|
var HERMES_RUNTIME_VERSION = "0.2.0";
|
|
590
581
|
var hermesRuntimeMetadata = {
|
|
@@ -612,11 +603,17 @@ var plugin = definePlugin({
|
|
|
612
603
|
const settings = resolveCliSettings(ctx.settings);
|
|
613
604
|
const skillInstall = installFusionSkillIntoHermesHome({ profile: settings.profile });
|
|
614
605
|
if (skillInstall.outcome === "warning") {
|
|
615
|
-
ctx.logger.warn(
|
|
606
|
+
ctx.logger.warn(
|
|
607
|
+
`Hermes Runtime Plugin: Fusion skill auto-install warning: ${skillInstall.reason ?? "unknown"}`
|
|
608
|
+
);
|
|
616
609
|
} else if (skillInstall.outcome === "skipped") {
|
|
617
|
-
ctx.logger.warn(
|
|
610
|
+
ctx.logger.warn(
|
|
611
|
+
`Hermes Runtime Plugin: Fusion skill auto-install skipped: ${skillInstall.reason ?? "unknown"}`
|
|
612
|
+
);
|
|
618
613
|
}
|
|
619
|
-
ctx.logger.info(
|
|
614
|
+
ctx.logger.info(
|
|
615
|
+
`Hermes Runtime Plugin loaded \u2014 binary=${settings.binaryPath} model=${settings.model ?? "(default)"} fusionSkill=${skillInstall.outcome}`
|
|
616
|
+
);
|
|
620
617
|
ctx.emitEvent("hermes-runtime:loaded", {
|
|
621
618
|
runtimeId: HERMES_RUNTIME_ID,
|
|
622
619
|
version: HERMES_RUNTIME_VERSION
|