YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
add ee/ enterprise edition with proprietary license
Louis Beaumont9a837543df89
diff --git a/LICENSE.md b/LICENSE.mdindex 94a0ab4cb..8cb6dc0d8 100644--- a/LICENSE.md+++ b/LICENSE.md@@ -19,3 +19,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.++---++The above MIT license applies to all code in this repository, with the+exception of code contained in the `ee/` directory, which is licensed under+the Screenpipe Enterprise License. See [ee/LICENSE](ee/LICENSE) for details.diff --git a/apps/screenpipe-app-tauri/tsconfig.json b/apps/screenpipe-app-tauri/tsconfig.jsonindex 18873514e..f7945f37b 100644--- a/apps/screenpipe-app-tauri/tsconfig.json+++ b/apps/screenpipe-app-tauri/tsconfig.json@@ -25,6 +25,9 @@"paths": {"@/*": ["./*"+ ],+ "@ee/*": [+ "../../ee/desktop/*"]},"types": ["@wdio/globals/types", "@wdio/mocha-framework","@tauri-apps/api"]diff --git a/ee/LICENSE b/ee/LICENSEnew file mode 100644index 000000000..fed7f8aee--- /dev/null+++ b/ee/LICENSE@@ -0,0 +1,26 @@+Screenpipe Enterprise Edition License++Copyright (c) 2024-2026 Screenpipe Inc. All Rights Reserved.++This software and associated documentation files (the "Software") may only be+used in production, if you (and any entity that you represent) have agreed to,+and are in compliance with, the Screenpipe Subscription Terms of Service,+available at https://screenpi.pe/terms (the "Enterprise Terms"), or other+agreement governing the use of the Software, as agreed by you and Screenpipe,+and otherwise have a valid Screenpipe Enterprise license for the correct number+of user seats.++Subject to the foregoing sentence, you are free to modify this Software and+publish patches to the Software. You agree that Screenpipe and/or its licensors+(as applicable) retain all right, title and interest in and to all such+modifications and/or patches, and all such modifications and/or patches may only+be used, copied, modified, displayed, distributed, or otherwise exploited with a+valid Screenpipe Enterprise license for the correct number of user seats.++Notwithstanding the foregoing, you may copy and modify the Software for+development and testing purposes, without requiring a subscription. You agree+that Screenpipe and/or its licensors (as applicable) retain all right, title and+interest in and to all such modifications. You are not granted any other rights+beyond what is expressly stated herein. Subject to the foregoing, it is+forbidden to copy, merge, publish, distribute, sublicense, and/or sell the+Software.diff --git a/ee/README.md b/ee/README.mdnew file mode 100644index 000000000..4ee4c739d--- /dev/null+++ b/ee/README.md@@ -0,0 +1,20 @@+# Screenpipe Enterprise Edition++This directory contains enterprise-only features for Screenpipe.++The code in this directory is licensed under the [Screenpipe Enterprise License](./LICENSE), not the MIT license used by the rest of the project. You may use this code for development and testing without a license, but production use requires a valid Screenpipe Enterprise subscription.++## What's in here++- **License key authentication** - replaces user login for IT-managed deployments+- **Admin policy enforcement** - centralized lockable settings pushed by admins+- **Enterprise UI controls** - hides consumer UI (billing, login, updates) in managed environments++## What's NOT in here (stays open source)++- Team management, encrypted pipe sync, cloud sync - these are consumer features available to everyone+- Screen recording, OCR, transcription, pipes, search - core functionality under MIT++## Getting a license++Contact [[email protected]](mailto:[email protected]) or visit [screenpi.pe/enterprise](https://screenpi.pe/enterprise).diff --git a/ee/desktop/components/enterprise-settings-guard.tsx b/ee/desktop/components/enterprise-settings-guard.tsxnew file mode 100644index 000000000..42a81b454--- /dev/null+++ b/ee/desktop/components/enterprise-settings-guard.tsx@@ -0,0 +1,49 @@+// Screenpipe Enterprise Edition+// Licensed under the Screenpipe Enterprise License (see ee/LICENSE)++"use client";++import { ReactNode } from "react";+import { EnterpriseState } from "../hooks/use-enterprise";++interface EnterpriseSettingsGuardProps {+ enterprise: EnterpriseState;+ settingKey?: string;+ sectionId?: string;+ children: ReactNode;+}++/**+ * Wraps a settings section or control.+ * - Hides the section entirely if admin policy says so.+ * - Renders a "managed by" overlay if the setting is locked.+ */+export function EnterpriseSettingsGuard({+ enterprise,+ settingKey,+ sectionId,+ children,+}: EnterpriseSettingsGuardProps) {+ if (!enterprise.isEnterprise || !enterprise.policy) {+ return <>{children}</>;+ }++ if (sectionId && enterprise.isSectionHidden(sectionId)) {+ return null;+ }++ if (settingKey && enterprise.isSettingLocked(settingKey)) {+ return (+ <div className="relative">+ <div className="pointer-events-none opacity-60">{children}</div>+ <div className="absolute inset-0 flex items-center justify-center">+ <span className="text-xs bg-muted px-2 py-1 rounded">+ managed by {enterprise.policy.orgName || "your organization"}+ </span>+ </div>+ </div>+ );+ }++ return <>{children}</>;+}diff --git a/ee/desktop/components/license-key-input.tsx b/ee/desktop/components/license-key-input.tsxnew file mode 100644index 000000000..c2802737f--- /dev/null+++ b/ee/desktop/components/license-key-input.tsx@@ -0,0 +1,60 @@+// Screenpipe Enterprise Edition+// Licensed under the Screenpipe Enterprise License (see ee/LICENSE)++"use client";++import { useState } from "react";+import { Input } from "@/components/ui/input";+import { Button } from "@/components/ui/button";++interface LicenseKeyInputProps {+ onActivate: (key: string) => Promise<boolean>;+ error: string | null;+ isLoading: boolean;+}++export function LicenseKeyInput({ onActivate, error, isLoading }: LicenseKeyInputProps) {+ const [key, setKey] = useState("");++ const handleSubmit = async (e: React.FormEvent) => {+ e.preventDefault();+ if (!key.trim()) return;+ await onActivate(key.trim());+ };++ return (+ <div className="flex items-center justify-center min-h-screen">+ <div className="w-full max-w-md p-8 space-y-6">+ <div className="text-center space-y-2">+ <h1 className="text-2xl font-bold">screenpipe enterprise</h1>+ <p className="text-sm text-muted-foreground">+ enter your license key to continue+ </p>+ </div>++ <form onSubmit={handleSubmit} className="space-y-4">+ <Input+ type="text"+ placeholder="XXXX-XXXX-XXXX-XXXX"+ value={key}+ onChange={(e) => setKey(e.target.value)}+ disabled={isLoading}+ autoFocus+ />++ {error && (+ <p className="text-sm text-destructive">{error}</p>+ )}++ <Button type="submit" className="w-full" disabled={isLoading || !key.trim()}>+ {isLoading ? "validating..." : "activate"}+ </Button>+ </form>++ <p className="text-xs text-center text-muted-foreground">+ contact your IT administrator if you don't have a license key+ </p>+ </div>+ </div>+ );+}diff --git a/ee/desktop/hooks/use-enterprise.ts b/ee/desktop/hooks/use-enterprise.tsnew file mode 100644index 000000000..6276e0ce5--- /dev/null+++ b/ee/desktop/hooks/use-enterprise.ts@@ -0,0 +1,130 @@+// Screenpipe Enterprise Edition+// Licensed under the Screenpipe Enterprise License (see ee/LICENSE)++"use client";++import { useState, useEffect, useCallback } from "react";+import { useIsEnterpriseBuild } from "@/lib/hooks/use-is-enterprise-build";+import {+ validateLicense,+ getStoredLicenseKey,+ storeLicenseKey,+ clearLicense,+ LicenseInfo,+} from "../lib/license-validation";+import {+ fetchAdminPolicy,+ AdminPolicy,+ isSettingLocked,+ getLockedValue,+ isSectionHidden,+} from "../lib/admin-policy";++export interface EnterpriseState {+ isEnterprise: boolean;+ isLoading: boolean;+ isLicensed: boolean;+ needsLicenseKey: boolean;+ license: LicenseInfo | null;+ policy: AdminPolicy | null;+ error: string | null;+ activateLicense: (key: string) => Promise<boolean>;+ deactivate: () => void;+ isSettingLocked: (key: string) => boolean;+ getLockedValue: <T>(key: string) => T | undefined;+ isSectionHidden: (sectionId: string) => boolean;+}++export function useEnterprise(): EnterpriseState {+ const isEnterprise = useIsEnterpriseBuild();+ const [isLoading, setIsLoading] = useState(true);+ const [license, setLicense] = useState<LicenseInfo | null>(null);+ const [policy, setPolicy] = useState<AdminPolicy | null>(null);+ const [error, setError] = useState<string | null>(null);++ const isLicensed = license?.valid ?? false;+ const needsLicenseKey = isEnterprise && !isLoading && !isLicensed;++ // On mount, check for stored license key and validate+ useEffect(() => {+ if (!isEnterprise) {+ setIsLoading(false);+ return;+ }++ const storedKey = getStoredLicenseKey();+ if (!storedKey) {+ setIsLoading(false);+ return;+ }++ (async () => {+ const result = await validateLicense(storedKey);+ if (result.ok) {+ setLicense(result.license);+ setError(null);+ const p = await fetchAdminPolicy(storedKey);+ setPolicy(p);+ } else {+ setError(result.error.message);+ }+ setIsLoading(false);+ })();+ }, [isEnterprise]);++ const activateLicense = useCallback(async (key: string): Promise<boolean> => {+ setIsLoading(true);+ setError(null);++ const result = await validateLicense(key);+ if (result.ok) {+ storeLicenseKey(key);+ setLicense(result.license);+ const p = await fetchAdminPolicy(key);+ setPolicy(p);+ setIsLoading(false);+ return true;+ }++ setError(result.error.message);+ setIsLoading(false);+ return false;+ }, []);++ const deactivate = useCallback(() => {+ clearLicense();+ setLicense(null);+ setPolicy(null);+ setError(null);+ }, []);++ const checkSettingLocked = useCallback(+ (key: string) => (policy ? isSettingLocked(policy, key) : false),+ [policy]+ );++ const checkLockedValue = useCallback(+ <T>(key: string) => (policy ? getLockedValue<T>(policy, key) : undefined),+ [policy]+ );++ const checkSectionHidden = useCallback(+ (sectionId: string) => (policy ? isSectionHidden(policy, sectionId) : false),+ [policy]+ );++ return {+ isEnterprise,+ isLoading,+ isLicensed,+ needsLicenseKey,+ license,+ policy,+ error,+ activateLicense,+ deactivate,+ isSettingLocked: checkSettingLocked,+ getLockedValue: checkLockedValue,+ isSectionHidden: checkSectionHidden,+ };+}diff --git a/ee/desktop/index.ts b/ee/desktop/index.tsnew file mode 100644index 000000000..cc8432af0--- /dev/null+++ b/ee/desktop/index.ts@@ -0,0 +1,14 @@+// Screenpipe Enterprise Edition+// Licensed under the Screenpipe Enterprise License (see ee/LICENSE)++export { useEnterprise } from "./hooks/use-enterprise";+export type { EnterpriseState } from "./hooks/use-enterprise";++export { LicenseKeyInput } from "./components/license-key-input";+export { EnterpriseSettingsGuard } from "./components/enterprise-settings-guard";++export { validateLicense, getStoredLicenseKey, storeLicenseKey, clearLicense } from "./lib/license-validation";+export type { LicenseInfo, LicenseError } from "./lib/license-validation";++export { fetchAdminPolicy, isSettingLocked, getLockedValue, isSectionHidden } from "./lib/admin-policy";+export type { AdminPolicy } from "./lib/admin-policy";diff --git a/ee/desktop/lib/admin-policy.ts b/ee/desktop/lib/admin-policy.tsnew file mode 100644index 000000000..5434a335a--- /dev/null+++ b/ee/desktop/lib/admin-policy.ts@@ -0,0 +1,96 @@+// Screenpipe Enterprise Edition+// Licensed under the Screenpipe Enterprise License (see ee/LICENSE)++/**+ * Enterprise admin policy.+ * Defines which settings are locked (forced values) and which UI sections are hidden.+ * Fetched from the server, pushed by the enterprise admin.+ */+export interface AdminPolicy {+ /** Settings forced to specific values - users cannot change these */+ lockedSettings: Record<string, unknown>;+ /** UI sections hidden in enterprise builds */+ hiddenSections: string[];+ /** Display name shown in "managed by" badges */+ orgName: string;+}++const POLICY_CACHE_KEY = "enterprise_admin_policy";+const POLICY_CACHE_TTL_MS = 30 * 60 * 1000; // 30 minutes++const EMPTY_POLICY: AdminPolicy = {+ lockedSettings: {},+ hiddenSections: [],+ orgName: "",+};++/**+ * Fetch admin policy for a license key.+ * Returns cached policy if network is unavailable.+ */+export async function fetchAdminPolicy(licenseKey: string): Promise<AdminPolicy> {+ try {+ const res = await fetch("https://screenpi.pe/api/enterprise/policy", {+ method: "GET",+ headers: {+ "Content-Type": "application/json",+ "X-License-Key": licenseKey,+ },+ });++ if (!res.ok) return getCachedPolicy();++ const policy: AdminPolicy = await res.json();+ cachePolicy(policy);+ return policy;+ } catch {+ return getCachedPolicy();+ }+}++function cachePolicy(policy: AdminPolicy): void {+ try {+ localStorage.setItem(+ POLICY_CACHE_KEY,+ JSON.stringify({ policy, cachedAt: Date.now() })+ );+ } catch {+ // ignore+ }+}++function getCachedPolicy(): AdminPolicy {+ try {+ const raw = localStorage.getItem(POLICY_CACHE_KEY);+ if (!raw) return EMPTY_POLICY;+ const { policy, cachedAt } = JSON.parse(raw);+ // Use cached policy even if stale (enterprise should keep working offline)+ return policy;+ } catch {+ return EMPTY_POLICY;+ }+}++/**+ * Check if a setting is locked by admin policy.+ */+export function isSettingLocked(policy: AdminPolicy, key: string): boolean {+ return key in policy.lockedSettings;+}++/**+ * Get the locked value for a setting, or undefined if not locked.+ */+export function getLockedValue<T>(policy: AdminPolicy, key: string): T | undefined {+ if (key in policy.lockedSettings) {+ return policy.lockedSettings[key] as T;+ }+ return undefined;+}++/**+ * Check if a UI section should be hidden.+ */+export function isSectionHidden(policy: AdminPolicy, sectionId: string): boolean {+ return policy.hiddenSections.includes(sectionId);+}diff --git a/ee/desktop/lib/license-validation.ts b/ee/desktop/lib/license-validation.tsnew file mode 100644index 000000000..385212b19--- /dev/null+++ b/ee/desktop/lib/license-validation.ts@@ -0,0 +1,115 @@+// Screenpipe Enterprise Edition+// Licensed under the Screenpipe Enterprise License (see ee/LICENSE)++export interface LicenseInfo {+ valid: boolean;+ teamId: string;+ maxSeats: number;+ currentSeats: number;+ expiresAt: string;+ features: string[];+ gracePeriod: boolean;+}++export interface LicenseError {+ code: "invalid" | "expired" | "seats_exceeded" | "network_error";+ message: string;+}++const LICENSE_CACHE_KEY = "enterprise_license_cache";+const LICENSE_KEY_KEY = "enterprise_license_key";+const CACHE_TTL_MS = 4 * 60 * 60 * 1000; // 4 hours+const GRACE_PERIOD_DAYS = 14;++/**+ * Validate a license key against the server.+ * Caches the result locally so the app works offline.+ */+export async function validateLicense(+ licenseKey: string+): Promise<{ ok: true; license: LicenseInfo } | { ok: false; error: LicenseError }> {+ try {+ const res = await fetch("https://screenpi.pe/api/license/validate", {+ method: "POST",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ license_key: licenseKey }),+ });++ if (!res.ok) {+ const data = await res.json().catch(() => ({}));+ const error: LicenseError = {+ code: res.status === 402 ? "expired" : "invalid",+ message: data.error || "license validation failed",+ };+ return { ok: false, error };+ }++ const license: LicenseInfo = await res.json();+ // Cache the successful validation+ cacheLicense(license);+ return { ok: true, license };+ } catch {+ // Network error - try cached license with grace period+ const cached = getCachedLicense();+ if (cached) {+ return { ok: true, license: { ...cached, gracePeriod: true } };+ }+ return {+ ok: false,+ error: { code: "network_error", message: "cannot reach license server and no cached license found" },+ };+ }+}++function cacheLicense(license: LicenseInfo): void {+ try {+ localStorage.setItem(+ LICENSE_CACHE_KEY,+ JSON.stringify({ license, cachedAt: Date.now() })+ );+ } catch {+ // localStorage may be unavailable+ }+}++export function getCachedLicense(): LicenseInfo | null {+ try {+ const raw = localStorage.getItem(LICENSE_CACHE_KEY);+ if (!raw) return null;+ const { license, cachedAt } = JSON.parse(raw);+ // Allow cached license during grace period even if TTL expired+ const age = Date.now() - cachedAt;+ if (age > GRACE_PERIOD_DAYS * 24 * 60 * 60 * 1000) return null;+ if (age > CACHE_TTL_MS) {+ return { ...license, gracePeriod: true };+ }+ return license;+ } catch {+ return null;+ }+}++export function getStoredLicenseKey(): string | null {+ try {+ return localStorage.getItem(LICENSE_KEY_KEY);+ } catch {+ return null;+ }+}++export function storeLicenseKey(key: string): void {+ try {+ localStorage.setItem(LICENSE_KEY_KEY, key);+ } catch {+ // ignore+ }+}++export function clearLicense(): void {+ try {+ localStorage.removeItem(LICENSE_CACHE_KEY);+ localStorage.removeItem(LICENSE_KEY_KEY);+ } catch {+ // ignore+ }+}