Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions web/src/components/appbuilder/__tests__/appData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
createEmptyData,
createEmptyDocument,
parseApplicationDocument,
isRenderableData,
APP_SCHEMA_VERSION
} from "../appData";

Expand Down Expand Up @@ -55,16 +54,4 @@ describe("appData", () => {
).toBeNull();
});
});

describe("isRenderableData", () => {
it("is false for null/empty", () => {
expect(isRenderableData(null)).toBe(false);
expect(isRenderableData(createEmptyData())).toBe(false);
});
it("is true with content", () => {
const data = createEmptyData();
data.content.push({ type: "Text", props: { id: "t1" } });
expect(isRenderableData(data)).toBe(true);
});
});
});
5 changes: 0 additions & 5 deletions web/src/components/appbuilder/appData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
APP_SCHEMA_VERSION,
createEmptyDocument as createEmptyApplicationDocument,
createEmptyPuckData,
isRenderableUi,
parseApplicationDocument,
type ApplicationDocument
} from "@nodetool-ai/app-runtime";
Expand All @@ -26,7 +25,3 @@ export const createEmptyData = (): Data => createEmptyPuckData() as Data;

export const createEmptyDocument = (title?: string): AppDocument =>
createEmptyApplicationDocument(title);

/** True when the document has at least one placed component. */
export const isRenderableData = (data: Data | null | undefined): data is Data =>
isRenderableUi(data as never);
33 changes: 0 additions & 33 deletions web/src/components/model_editor/__tests__/editorHotkeys.test.ts

This file was deleted.

38 changes: 0 additions & 38 deletions web/src/components/model_editor/editorHotkeys.ts

This file was deleted.

9 changes: 0 additions & 9 deletions web/src/config/__tests__/optionalNodePacks.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
OPTIONAL_NODE_PACKS,
getOptionalNodePackForNamespace,
isOptionalNamespace,
isNamespaceHiddenByOptionalPacks
} from "../optionalNodePacks";

Expand Down Expand Up @@ -50,14 +49,6 @@ describe("optionalNodePacks catalog", () => {
});
});

describe("isOptionalNamespace", () => {
it("classifies niche vs core namespaces", () => {
expect(isOptionalNamespace("lib.os")).toBe(true);
expect(isOptionalNamespace("lib.browser")).toBe(true);
expect(isOptionalNamespace("nodetool.audio")).toBe(false);
});
});

describe("isNamespaceHiddenByOptionalPacks", () => {
it("hides optional namespaces when their pack is not enabled", () => {
const enabled = new Set<string>();
Expand Down
4 changes: 0 additions & 4 deletions web/src/config/optionalNodePacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ export const getOptionalNodePackForNamespace = (
pack.namespaces.some((prefix) => matchesPrefix(namespace, prefix))
);

/** Whether `namespace` belongs to any optional pack. */
export const isOptionalNamespace = (namespace: string): boolean =>
getOptionalNodePackForNamespace(namespace) !== undefined;

/**
* Whether `namespace` should be hidden from the node-menu tree given the set of
* pack ids the user has turned on. A namespace is hidden only when it belongs
Expand Down
42 changes: 0 additions & 42 deletions web/src/utils/__tests__/providerDisplay.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { describe, it, expect } from "@jest/globals";
import {
isHuggingFaceProvider,
isHuggingFaceLocalProvider,
isHuggingFaceInferenceProvider,
isLocalProvider,
isCloudProvider,
getModelUrl,
Expand Down Expand Up @@ -324,46 +322,6 @@ describe("providerDisplay", () => {
});
});

describe("isHuggingFaceLocalProvider", () => {
it("returns true for the explicit local alias", () => {
expect(isHuggingFaceLocalProvider("huggingface-local")).toBe(true);
expect(isHuggingFaceLocalProvider("HuggingFace-Local")).toBe(true);
expect(isHuggingFaceLocalProvider(" huggingface-local ")).toBe(true);
});

it("returns false for HuggingFace sub-providers", () => {
expect(isHuggingFaceLocalProvider("huggingface/fireworks-ai")).toBe(
false
);
expect(isHuggingFaceLocalProvider("huggingface_cerebras")).toBe(false);
expect(isHuggingFaceLocalProvider("huggingface")).toBe(false);
});

it("returns false for undefined/empty", () => {
expect(isHuggingFaceLocalProvider(undefined)).toBe(false);
expect(isHuggingFaceLocalProvider("")).toBe(false);
});
});

describe("isHuggingFaceInferenceProvider", () => {
it("returns true for inference providers", () => {
expect(isHuggingFaceInferenceProvider("hf_inference")).toBe(true);
expect(isHuggingFaceInferenceProvider("huggingface_inference")).toBe(
true
);
});

it("returns false for non-inference providers", () => {
expect(isHuggingFaceInferenceProvider("huggingface")).toBe(false);
expect(isHuggingFaceInferenceProvider("openai")).toBe(false);
});

it("returns false for undefined/empty", () => {
expect(isHuggingFaceInferenceProvider(undefined)).toBe(false);
expect(isHuggingFaceInferenceProvider("")).toBe(false);
});
});

describe("isLocalProvider", () => {
it("returns true for local providers", () => {
expect(isLocalProvider("huggingface-local")).toBe(true);
Expand Down
21 changes: 1 addition & 20 deletions web/src/utils/__tests__/workflowBundle.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { restFetch } from "../../lib/rest-fetch";
import { stub } from "../../test-utils/doubles";
import {
exportWorkflowBundle,
exportWorkflowsBundle,
importWorkflowBundle
} from "../workflowBundle";
import { exportWorkflowBundle, importWorkflowBundle } from "../workflowBundle";

jest.mock("../../lib/rest-fetch", () => ({
restFetch: jest.fn()
Expand Down Expand Up @@ -102,21 +98,6 @@ describe("exportWorkflowBundle", () => {
});
});

describe("exportWorkflowsBundle", () => {
it("POSTs workflow_ids to the multi-workflow export route", async () => {
mockRestFetch.mockResolvedValue(fakeResponse({ ok: true }));
await exportWorkflowsBundle(["a", "b"], "pack");
expect(mockRestFetch).toHaveBeenCalledWith(
"/api/workflows/export-bundle",
expect.objectContaining({
method: "POST",
body: JSON.stringify({ workflow_ids: ["a", "b"] })
})
);
expect(HTMLAnchorElement.prototype.click).toHaveBeenCalledTimes(1);
});
});

describe("importWorkflowBundle", () => {
it("uploads the file as multipart and returns the created workflows", async () => {
mockRestFetch.mockResolvedValue(
Expand Down
24 changes: 0 additions & 24 deletions web/src/utils/providerDisplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ export const isHuggingFaceProvider = (provider?: string): boolean => {
);
};

/**
* Checks if a HuggingFace provider is local (runs models locally).
* The Python worker is exposed as `huggingface-local`; bare `huggingface` is
* the hosted Inference API.
*/
export const isHuggingFaceLocalProvider = (provider?: string): boolean => {
if (!provider) {
return false;
}
const normalized = provider.toLowerCase().trim();
return normalized === "huggingface-local";
};

export const isLocalProvider = (provider?: string): boolean => {
if (!provider) {
return false;
Expand All @@ -44,17 +31,6 @@ export const isCloudProvider = (provider?: string): boolean => {
return !isLocalProvider(provider);
};

export const isHuggingFaceInferenceProvider = (provider?: string): boolean => {
if (!provider) {
return false;
}
const providerLower = provider.toLowerCase().trim();
return (
providerLower.includes("hf_inference") ||
providerLower.includes("huggingface_inference")
);
};

const insertSpacesBeforeCapitals = (value: string): string => {
return value.replace(/([a-z])([A-Z])/g, "$1 $2");
};
Expand Down
22 changes: 0 additions & 22 deletions web/src/utils/workflowBundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,6 @@ export async function exportWorkflowBundle(
triggerDownload(blob, filename);
}

/** Download several workflows together as a single `.nodetool` bundle. */
export async function exportWorkflowsBundle(
workflowIds: string[],
fallbackName = "workflows"
): Promise<void> {
const res = await restFetch("/api/workflows/export-bundle", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ workflow_ids: workflowIds })
});
if (!res.ok) {
const detail = await res.text().catch(() => "");
throw new Error(detail || `Export failed (${res.status})`);
}
const blob = await res.blob();
const filename = filenameFromDisposition(
res.headers.get("content-disposition"),
`${sanitizeBundleName(fallbackName)}.nodetool`
);
triggerDownload(blob, filename);
}

/** Upload a `.nodetool` bundle; the server stores its assets and creates the workflows. */
export async function importWorkflowBundle(
file: File
Expand Down
Loading