Skip to content
Closed
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ development server after changes, or rebuild the frontend for deployment.
| `VITE_BACKEND_API_URL` | For backend features | URL of your Tangle backend (e.g. `http://127.0.0.1:8000`). |
| `TANGLE_UI_PORT` | No | Port for the local Vite dev server and Playwright base URL. Defaults to `3000`; set this in `.env`, `.env.local`, or your shell to use a different local port. |
| `VITE_ENABLE_TANGENT` | For Tangent | Set to `true` to unlock the Tangent beta toggle in Settings → Beta Features. See [Projects and Tangent (beta)](#projects-and-tangent-beta). |
| `VITE_TANGENT_BUNDLE_ID` | No | Agent bundle that Tangent sessions started from the app use. Defaults to `tangle-oss`, the bundle the open-source Tangent shell ships. Set it when your Tangent shell installs a different one. |
| `VITE_REMOTE_PIPELINES` | No | Opt in to remote pipeline storage with `true` on a backend that supports saved pipelines. Unset or `false` keeps new pipelines, imports, and copies in browser storage. Without a configured backend, storage stays local even when enabled. |
| `VITE_ARTIFACT_RETENTION_DAYS` | No | Number of days artifacts are stored by your backend. When set, the UI shows artifact expiry dates and warns when artifacts may no longer be available. |
| `VITE_BUGSNAG_API_KEY` | No | Bugsnag API key. Required alongside `VITE_TANGLE_ENV` to enable error reporting. |
Expand Down
25 changes: 25 additions & 0 deletions src/routes/v2/pages/Tangent/constants.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { afterEach, describe, expect, it, vi } from "vitest";

async function loadBundleId() {
vi.resetModules();
const { TANGENT_BUNDLE_ID } = await import("./constants");
return TANGENT_BUNDLE_ID;
}

describe("TANGENT_BUNDLE_ID", () => {
afterEach(() => {
vi.unstubAllEnvs();
});

it("uses the open-source tangle-oss bundle when the build sets none", async () => {
vi.stubEnv("VITE_TANGENT_BUNDLE_ID", "");

expect(await loadBundleId()).toBe("tangle-oss");
});

it("uses the bundle the build names", async () => {
vi.stubEnv("VITE_TANGENT_BUNDLE_ID", " research ");

expect(await loadBundleId()).toBe("research");
});
});
5 changes: 4 additions & 1 deletion src/routes/v2/pages/Tangent/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const DEFAULT_TANGENT_BUNDLE_ID = "tangle-oss";

/** Bundle that backs embedded Tangent sessions started from tangle-ui. */
export const TANGENT_BUNDLE_ID = "tangle";
export const TANGENT_BUNDLE_ID =
import.meta.env.VITE_TANGENT_BUNDLE_ID?.trim() || DEFAULT_TANGENT_BUNDLE_ID;

/**
* Only ever used by a dev build. A deployed origin that reached for loopback
Expand Down
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
interface ImportMetaEnv {
readonly VITE_REMOTE_PIPELINES?: string;
readonly VITE_ENABLE_TANGENT?: string;
readonly VITE_TANGENT_BUNDLE_ID?: string;
readonly VITE_TANGENT_REMOTE_ENV_TOKEN?: string;
}

Expand Down
Loading