feat(FN-3046): add fn binary panel and standalone CLI entrypoint
This merge introduces a standalone CLI binary mode ("droid") with a new dashboard panel for binary management, adds a todo planning entrypoint with peer exchange shutdown, and includes documentation updates for the CLI reference and standalone deployment. Key additions span the core database layer,
Fusion-Task-Id: FN-3046
This commit is contained in:
37
packages/core/src/__tests__/fn-binary.test.ts
Normal file
37
packages/core/src/__tests__/fn-binary.test.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import {
|
||||
detectFnBinary,
|
||||
FN_INSTALL_CURL,
|
||||
FN_INSTALL_NPM,
|
||||
FN_NPM_PACKAGE,
|
||||
FN_NPX_INVOCATION,
|
||||
} from "../fn-binary.js";
|
||||
|
||||
describe("fn-binary constants", () => {
|
||||
it("uses runfusion.ai as the canonical npm package", () => {
|
||||
expect(FN_NPM_PACKAGE).toBe("runfusion.ai");
|
||||
expect(FN_INSTALL_NPM).toBe("npm install -g runfusion.ai");
|
||||
expect(FN_NPX_INVOCATION).toBe("npx -y runfusion.ai");
|
||||
});
|
||||
|
||||
it("exposes the curl one-line installer", () => {
|
||||
expect(FN_INSTALL_CURL).toBe("curl -fsSL https://runfusion.ai/install.sh | sh");
|
||||
});
|
||||
});
|
||||
|
||||
describe("detectFnBinary", () => {
|
||||
it("never throws and always returns a usable invocation", async () => {
|
||||
// We don't assert installed/missing — the host running CI may or may not
|
||||
// have `fn` on PATH. The contract is: result is well-formed and
|
||||
// `invocation` is a string the caller can prepend to a command.
|
||||
const result = await detectFnBinary();
|
||||
expect(typeof result.installed).toBe("boolean");
|
||||
expect(typeof result.invocation).toBe("string");
|
||||
expect(result.invocation.length).toBeGreaterThan(0);
|
||||
if (!result.installed) {
|
||||
expect(result.invocation).toBe(FN_NPX_INVOCATION);
|
||||
} else {
|
||||
expect(["fn", "fusion"]).toContain(result.binary);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user