openfused 0.3.7 → 0.3.9
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/cli.js +39 -6
- package/dist/mcp.js +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/registry.js +2 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6,9 +6,9 @@ import { watchInbox, watchContext, watchSync } from "./watch.js";
|
|
|
6
6
|
import { syncAll, syncOne, deliverOne } from "./sync.js";
|
|
7
7
|
import * as registry from "./registry.js";
|
|
8
8
|
import { fingerprint } from "./crypto.js";
|
|
9
|
-
import { resolve } from "node:path";
|
|
9
|
+
import { resolve, join } from "node:path";
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
|
11
|
-
const VERSION = "0.3.
|
|
11
|
+
const VERSION = "0.3.9";
|
|
12
12
|
const program = new Command();
|
|
13
13
|
program
|
|
14
14
|
.name("openfuse")
|
|
@@ -560,13 +560,46 @@ program
|
|
|
560
560
|
console.log(`Imported key for ${manifest.name} from registry [untrusted]`);
|
|
561
561
|
console.log(` Run \`openfuse key trust ${manifest.name}\` to trust`);
|
|
562
562
|
}
|
|
563
|
-
await store.sendInbox(name, message);
|
|
564
|
-
|
|
563
|
+
const filename = await store.sendInbox(name, message);
|
|
564
|
+
// Try direct HTTP delivery if endpoint is http(s)
|
|
565
|
+
if (manifest.endpoint.startsWith("http")) {
|
|
566
|
+
try {
|
|
567
|
+
const body = await readFile(join(store.root, "outbox", filename), "utf-8");
|
|
568
|
+
const r = await fetch(`${manifest.endpoint.replace(/\/$/, "")}/inbox`, {
|
|
569
|
+
method: "POST",
|
|
570
|
+
headers: { "Content-Type": "application/json" },
|
|
571
|
+
body,
|
|
572
|
+
});
|
|
573
|
+
if (r.ok) {
|
|
574
|
+
// Archive to .sent/
|
|
575
|
+
const { mkdir, rename } = await import("node:fs/promises");
|
|
576
|
+
const sentDir = join(store.root, "outbox", ".sent");
|
|
577
|
+
await mkdir(sentDir, { recursive: true });
|
|
578
|
+
await rename(join(store.root, "outbox", filename), join(sentDir, filename));
|
|
579
|
+
console.log(`Delivered to ${name}.`);
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
console.log(`Queued for ${name}. Endpoint returned ${r.status}. Will deliver on next sync.`);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
catch {
|
|
586
|
+
console.log(`Queued for ${name}. Will deliver on next sync.`);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
console.log(`Queued for ${name}. Run \`openfuse sync\` to deliver.`);
|
|
591
|
+
}
|
|
565
592
|
}
|
|
566
593
|
catch {
|
|
567
594
|
// Not in registry — send as a peer message
|
|
568
|
-
await store.sendInbox(name, message);
|
|
569
|
-
|
|
595
|
+
const filename = await store.sendInbox(name, message);
|
|
596
|
+
const delivered = await deliverOne(store, name, filename);
|
|
597
|
+
if (delivered) {
|
|
598
|
+
console.log(`Delivered to ${name}.`);
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
console.log(`Queued for ${name}. Run \`openfuse sync\` to deliver.`);
|
|
602
|
+
}
|
|
570
603
|
}
|
|
571
604
|
});
|
|
572
605
|
program.parse();
|
package/dist/mcp.js
CHANGED
|
@@ -23,7 +23,7 @@ const storeDir = process.env.OPENFUSE_DIR || process.argv[3] || ".";
|
|
|
23
23
|
const store = new ContextStore(resolve(storeDir));
|
|
24
24
|
const server = new McpServer({
|
|
25
25
|
name: "openfuse",
|
|
26
|
-
version: "0.3.
|
|
26
|
+
version: "0.3.9",
|
|
27
27
|
});
|
|
28
28
|
// --- Context ---
|
|
29
29
|
server.tool("context_read", "Read the agent's CONTEXT.md (working memory)", async () => {
|
package/dist/registry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContextStore } from "./store.js";
|
|
2
|
-
export declare const DEFAULT_REGISTRY = "https://registry.
|
|
2
|
+
export declare const DEFAULT_REGISTRY = "https://openfuse-registry.wzmcghee.workers.dev";
|
|
3
3
|
export interface Manifest {
|
|
4
4
|
name: string;
|
|
5
5
|
endpoint: string;
|
package/dist/registry.js
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
// This is TOFU (Trust On First Use) done right: the registry distributes keys,
|
|
8
8
|
// but never asserts trust. Trust is a local decision.
|
|
9
9
|
import { signMessage, fingerprint } from "./crypto.js";
|
|
10
|
-
|
|
10
|
+
// Custom domain pending propagation — use Worker URL as fallback
|
|
11
|
+
export const DEFAULT_REGISTRY = "https://openfuse-registry.wzmcghee.workers.dev";
|
|
11
12
|
export function resolveRegistry(flag) {
|
|
12
13
|
return flag || process.env.OPENFUSE_REGISTRY || DEFAULT_REGISTRY;
|
|
13
14
|
}
|