openfused 0.3.15 → 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.
Files changed (2) hide show
  1. package/dist/sync.js +12 -4
  2. package/package.json +1 -1
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 resp = await fetch(`${baseUrl}/read/${file}`);
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 (e) {
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.15",
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",