openfused 0.3.14 → 0.3.16
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/README.md +2 -2
- package/dist/cli.js +12 -1
- package/dist/mcp.js +2 -1
- package/dist/sync.js +12 -4
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -67,11 +67,11 @@ history/ — archived [DONE] context
|
|
|
67
67
|
openfuse context
|
|
68
68
|
openfuse context --append "## Update\nFinished the research phase."
|
|
69
69
|
|
|
70
|
-
# Mark work as done, then compact to history/
|
|
70
|
+
# Mark work as done, then compact to history/ (TS CLI only)
|
|
71
71
|
# (edit CONTEXT.md, add [DONE] to the header, then:)
|
|
72
72
|
openfuse compact
|
|
73
73
|
|
|
74
|
-
# Add validity windows to time-sensitive context
|
|
74
|
+
# Add validity windows to time-sensitive context (TS CLI only)
|
|
75
75
|
# <!-- validity: 6h --> for task state, 1d for sprint, 3d for architecture
|
|
76
76
|
openfuse validate # scan for stale entries
|
|
77
77
|
openfuse compact --prune-stale # archive expired validity windows
|
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,18 @@ import { fingerprint } from "./crypto.js";
|
|
|
9
9
|
import { resolve, join } from "node:path";
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
|
11
11
|
import { parseValiditySections, buildValidityReport } from "./validity.js";
|
|
12
|
-
|
|
12
|
+
import { createRequire } from "node:module";
|
|
13
|
+
const VERSION = createRequire(import.meta.url)("../package.json").version;
|
|
14
|
+
// Enable proxy support: Node.js built-in fetch doesn't respect HTTP_PROXY env vars.
|
|
15
|
+
// Setting a global EnvHttpProxyAgent makes all fetch() calls proxy-aware —
|
|
16
|
+
// essential for corporate networks, containers, and tunneled environments.
|
|
17
|
+
if (process.env.https_proxy || process.env.HTTPS_PROXY || process.env.http_proxy || process.env.HTTP_PROXY) {
|
|
18
|
+
try {
|
|
19
|
+
const { EnvHttpProxyAgent, setGlobalDispatcher } = await import("undici");
|
|
20
|
+
setGlobalDispatcher(new EnvHttpProxyAgent());
|
|
21
|
+
}
|
|
22
|
+
catch { }
|
|
23
|
+
}
|
|
13
24
|
const program = new Command();
|
|
14
25
|
program
|
|
15
26
|
.name("openfuse")
|
package/dist/mcp.js
CHANGED
|
@@ -10,6 +10,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { ContextStore, validateName } from "./store.js";
|
|
12
12
|
import { resolve } from "node:path";
|
|
13
|
+
import { createRequire } from "node:module";
|
|
13
14
|
// LLMs will pass whatever filenames users ask for — including "../../etc/shadow".
|
|
14
15
|
// This is the trust boundary between the AI and the filesystem.
|
|
15
16
|
function sanitizeFilename(name) {
|
|
@@ -23,7 +24,7 @@ const storeDir = process.env.OPENFUSE_DIR || process.argv[3] || ".";
|
|
|
23
24
|
const store = new ContextStore(resolve(storeDir));
|
|
24
25
|
const server = new McpServer({
|
|
25
26
|
name: "openfuse",
|
|
26
|
-
version: "
|
|
27
|
+
version: createRequire(import.meta.url)("../package.json").version,
|
|
27
28
|
});
|
|
28
29
|
// --- Context ---
|
|
29
30
|
server.tool("context_read", "Read the agent's CONTEXT.md (working memory)", async () => {
|
package/dist/sync.js
CHANGED
|
@@ -140,17 +140,25 @@ async function syncHttp(store, peer, baseUrl, peerDir) {
|
|
|
140
140
|
const errors = [];
|
|
141
141
|
// SSRF check: block requests to private/reserved IPs
|
|
142
142
|
await checkSsrf(baseUrl);
|
|
143
|
+
// Try /read/{file} (full mode) then /profile (public mode) for PROFILE.md.
|
|
144
|
+
// CONTEXT.md 404s are silently skipped — peers in public mode don't serve it.
|
|
143
145
|
for (const file of ["CONTEXT.md", "PROFILE.md"]) {
|
|
144
146
|
try {
|
|
145
|
-
const
|
|
147
|
+
const url = file === "PROFILE.md"
|
|
148
|
+
? `${baseUrl}/profile` // public mode serves /profile not /read/PROFILE.md
|
|
149
|
+
: `${baseUrl}/read/${file}`;
|
|
150
|
+
let resp = await fetch(url);
|
|
151
|
+
// Fallback: try /read/ path if /profile didn't work (full mode daemon)
|
|
152
|
+
if (!resp.ok && file === "PROFILE.md") {
|
|
153
|
+
resp = await fetch(`${baseUrl}/read/${file}`);
|
|
154
|
+
}
|
|
146
155
|
if (resp.ok) {
|
|
147
156
|
await writeFile(join(peerDir, file), await resp.text());
|
|
148
157
|
pulled.push(file);
|
|
149
158
|
}
|
|
159
|
+
// Don't report 404s as errors — peer may be in public mode
|
|
150
160
|
}
|
|
151
|
-
catch
|
|
152
|
-
errors.push(`${file}: ${e.message}`);
|
|
153
|
-
}
|
|
161
|
+
catch { }
|
|
154
162
|
}
|
|
155
163
|
for (const dir of ["shared", "knowledge"]) {
|
|
156
164
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openfused",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.16",
|
|
4
4
|
"description": "The file protocol for AI agent context. Encrypted, signed, peer-to-peer.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"chokidar": "^5.0.0",
|
|
30
30
|
"commander": "^14.0.0",
|
|
31
31
|
"nanoid": "^5.1.7",
|
|
32
|
+
"undici": "^7.24.5",
|
|
32
33
|
"zod": "^4.3.6"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|