Skip to content

Commit

Permalink
add FTS for app name and windows name and fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashashwini2003 committed Dec 15, 2024
1 parent 6e32e5a commit cc0b1c6
Show file tree
Hide file tree
Showing 43 changed files with 2,995 additions and 1,217 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ jobs:
bun ./scripts/pre_build.js ${{ matrix.pre-build-args }}
working-directory: ./screenpipe-app-tauri

- uses: actions/setup-python@v5
if: matrix.tauri-args == '--target x86_64-pc-windows-msvc'
with:
python-version: '3.13'

- name: Copy library for MKL
if: matrix.tauri-args == '--target x86_64-pc-windows-msvc'
shell: powershell
Expand All @@ -378,6 +383,7 @@ jobs:
} else {
Write-Host "no existing dlls found, trying pip install..."
mkdir omp
python -m ensurepip --upgrade
python -m pip install intel-openmp --target omp
Get-ChildItem -Path ./omp -Recurse -Filter *.dll | Copy-Item -Destination $mkl_dir -Force
}
Expand All @@ -388,6 +394,7 @@ jobs:
if ($dll_count -eq 0) {
throw "No DLLs found in target directory!"
}
- name: Build
uses: tauri-apps/[email protected]
env:
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

first off, thank you for considering contributing to screen pipe! it's people like you that make screen pipe such a great tool. we're looking for developers who want to create paid pipes, with the potential to easily make $1000/m. let's [schedule a call](https://cal.com/louis030195/screenpipe) to get you onboarded.

btw, we prefer that you don't contribute if you are not using or will use the product and is just there for bounties, thank you.

## getting started

before you begin:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resolver = "2"


[workspace.package]
version = "0.2.15"
version = "0.2.16"
authors = ["louis030195 <[email protected]>"]
description = ""
repository = "https://github.com/mediar-ai/screenpipe"
Expand Down
Binary file removed cn
Binary file not shown.
13 changes: 13 additions & 0 deletions content/changelogs/0.17.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### **New Features:**
- **Added H.265 support for macOS:** Enabled H.265 support on macOS for improved video compression.
- **Made screenpipe-js Next.js client/server compatible:** Ensured compatibility with Next.js framework for a smoother client/server experience.

### **Improvements:**
- **Enhanced search functionality:** Fixed issue with search and pipe store for better search results.
- **Improved speaker argument in screenpipe-js:** Resolved speaker argument issue in screenpipe-js for better audio handling.

### **Fixes:**
- No relevant fixes were identified from the provided commits.

#### **Full Changelog:** [ddac8..34f5e](https://github.com/mediar-ai/screenpipe/compare/ddac8..34f5e)

10 changes: 10 additions & 0 deletions content/changelogs/0.17.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### **Improvements:**
- **Improved pipe download user experience (UX):** Enhancements made to the pipe download process for a better user experience.

### **Fixes:**
- **Fixed self-hosted builds:** Addressed issues with self-hosted builds for smoother deployment process.
- **Fixed compatibility with node/browser:** Updated screenpipe-js to be compatible with both node and browsers.
- **Fixed search functionality:** Resolved issues with the search feature for more accurate results.

#### **Full Changelog:** [cabec..d24be](https://github.com/mediar-ai/screenpipe/compare/cabec..d24be)

Binary file modified pipes/search/bun.lockb
Binary file not shown.
25 changes: 8 additions & 17 deletions pipes/search/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
transpilePackages: ['@screenpipe/js'],
transpilePackages: ["@screenpipe/js"],
webpack: (config, { isServer }) => {
if (!isServer) {
// don't resolve 'fs' module on the client to prevent this error on build --> Error: Can't resolve 'fs'
config.resolve.fallback = {
fs: false,
net: false,
tls: false,
child_process: false,
"stream": false,
"crypto": false,
"zlib": false,
"http": false,
"https": false,
"path": false,
}
}
return config
config.resolve.alias = {
...config.resolve.alias,
"@screenpipe/js": isServer
? "@screenpipe/js/dist/node.js"
: "@screenpipe/js/dist/browser.js",
};
return config;
},
};

Expand Down
2 changes: 1 addition & 1 deletion pipes/search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-toast": "^1.2.3",
"@radix-ui/react-tooltip": "^1.1.5",
"@screenpipe/js": "0.1.10-beta.11",
"@screenpipe/js": "0.1.10-beta.18",
"@shadcn/ui": "^0.0.4",
"@tanstack/react-query": "^5.62.7",
"@types/js-levenshtein": "^1.1.3",
Expand Down
80 changes: 80 additions & 0 deletions pipes/search/src/app/api/settings/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// app/api/settings/route.ts
import { pipe } from "@screenpipe/js";
import { NextResponse } from "next/server";
import type { Settings } from "@screenpipe/js";
// Force Node.js runtime
export const runtime = "nodejs"; // Add this line
export const dynamic = 'force-dynamic'

export async function GET() {
const defaultSettings: Settings = {
openaiApiKey: "",
deepgramApiKey: "",
aiModel: "gpt-4",
aiUrl: "https://api.openai.com/v1",
customPrompt: "",
port: 3030,
dataDir: "default",
disableAudio: false,
ignoredWindows: [],
includedWindows: [],
aiProviderType: "openai",
embeddedLLM: {
enabled: false,
model: "llama3.2:1b-instruct-q4_K_M",
port: 11438,
},
enableFrameCache: true,
enableUiMonitoring: false,
aiMaxContextChars: 128000,
};

try {
const settingsManager = pipe.settings;
if (!settingsManager) {
throw new Error("settingsManager not found");
}
const rawSettings = await settingsManager.getAll();
return NextResponse.json(rawSettings);
} catch (error) {
console.error("failed to get settings:", error);
return NextResponse.json(defaultSettings);
}
}

export async function PUT(request: Request) {
try {
const settingsManager = pipe.settings;
if (!settingsManager) {
throw new Error("settingsManager not found");
}

const body = await request.json();
const { key, value, isPartialUpdate, reset } = body;

if (reset) {
if (key) {
await settingsManager.resetKey(key);
} else {
await settingsManager.reset();
}
return NextResponse.json({ success: true });
}

if (isPartialUpdate) {
const serializedSettings = JSON.parse(JSON.stringify(value));
await settingsManager.update(serializedSettings);
} else {
const serializedValue = JSON.parse(JSON.stringify(value));
await settingsManager.set(key, serializedValue);
}

return NextResponse.json({ success: true });
} catch (error) {
console.error("failed to update settings:", error);
return NextResponse.json(
{ error: "failed to update settings" },
{ status: 500 }
);
}
}
62 changes: 38 additions & 24 deletions pipes/search/src/components/search-chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { JSX, useEffect, useRef, useState } from "react";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import { queryScreenpipe, ContentItem } from "@screenpipe/js";
import { pipe, ContentItem } from "@screenpipe/js";
import { Skeleton } from "@/components/ui/skeleton";
import { Slider } from "@/components/ui/slider";
import { Switch } from "@/components/ui/switch";
Expand Down Expand Up @@ -72,10 +72,16 @@ import { IconCode } from "@/components/ui/icons";
import { CodeBlock } from "@/components/ui/codeblock";
import { SqlAutocompleteInput } from "@/components/sql-autocomplete-input";
import { cn, removeDuplicateSelections } from "@/lib/utils";
import { ExampleSearch, ExampleSearchCards } from "@/components/example-search-cards";
import {
ExampleSearch,
ExampleSearchCards,
} from "@/components/example-search-cards";
import { useDebounce } from "@/lib/hooks/use-debounce";
import { useHealthCheck } from "@/lib/hooks/use-health-check";
import { SearchHistory, useSearchHistory } from "@/lib/hooks/use-search-history";
import {
SearchHistory,
useSearchHistory,
} from "@/lib/hooks/use-search-history";
import {
CommandInput,
CommandList,
Expand All @@ -85,11 +91,13 @@ import {
Command,
} from "./ui/command";
import { Speaker } from "@screenpipe/js";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
import { useSettings } from "@/lib/hooks/use-settings";



interface Agent {
id: string;
name: string;
Expand Down Expand Up @@ -230,6 +238,7 @@ export function SearchChat() {
const [offset, setOffset] = useState(0);
const [totalResults, setTotalResults] = useState(0);
const { settings } = useSettings();
console.log("settings", settings);
const [isAiLoading, setIsAiLoading] = useState(false);
const [minLength, setMinLength] = useState(50);
const [maxLength, setMaxLength] = useState(10000);
Expand Down Expand Up @@ -298,18 +307,21 @@ export function SearchChat() {
ui: false,
audio: true,
});
setContentType("audio");
}
}, [selectedSpeakers]);

useEffect(() => {
// More reliable OS detection
const platform = window.navigator.platform.toLowerCase();
const os =
platform.includes('mac') ? 'macos' :
platform.includes('win') ? 'windows' :
platform.includes('linux') ? 'linux' :
'unknown';

const os = platform.includes("mac")
? "macos"
: platform.includes("win")
? "windows"
: platform.includes("linux")
? "linux"
: "unknown";

setCurrentPlatform(os);
}, []);

Expand Down Expand Up @@ -359,6 +371,7 @@ export function SearchChat() {
ui: false,
audio: true,
});
setContentType("audio");
}

// Convert checkbox state to content type
Expand Down Expand Up @@ -412,7 +425,6 @@ export function SearchChat() {
}, []);

const handleExampleSelect = async (example: ExampleSearch) => {

const newWindowName = example.windowName || "";
const newAppName = example.appName || "";
const newLimit = example.limit || limit;
Expand Down Expand Up @@ -595,7 +607,6 @@ export function SearchChat() {
return;
}


const userMessage = {
id: generateId(),
role: "user" as const,
Expand All @@ -617,8 +628,6 @@ export function SearchChat() {
});
console.log("openai", settings.openaiApiKey, settings.aiUrl);



const model = settings.aiModel;
const customPrompt = settings.customPrompt || "";

Expand Down Expand Up @@ -728,24 +737,26 @@ export function SearchChat() {
setResults([]);
setSimilarityThreshold(1); // Reset similarity threshold to 1


try {
const searchParams = {
q: query || undefined,
contentType: overrides.contentType || contentType,
limit: overrides.limit || limit,
offset: newOffset,
startTime: overrides.startDate?.toISOString() || startDate.toISOString(),
startTime:
overrides.startDate?.toISOString() || startDate.toISOString(),
endTime: endDate.toISOString(),
appName: overrides.appName || appName || undefined,
windowName: overrides.windowName || windowName || undefined,
includeFrames: includeFrames,
minLength: overrides.minLength || minLength,
maxLength: maxLength,
speakerIds: Object.values(selectedSpeakers).map((speaker) => speaker.id)
speakerIds: Object.values(selectedSpeakers).map(
(speaker) => speaker.id
),
};

const response = await queryScreenpipe(searchParams);
const response = await pipe.queryScreenpipe(searchParams);

// Add debug logging
console.log("search response:", response);
Expand Down Expand Up @@ -907,7 +918,10 @@ export function SearchChat() {
<Badge
className="text-xs cursor-pointer"
onClick={() =>
handleBadgeClick(item.content.windowName, "window")
handleBadgeClick(
item.content.windowName,
"window"
)
}
>
{item.content.windowName}
Expand Down Expand Up @@ -1019,13 +1033,13 @@ export function SearchChat() {
</Badge>
</div>
)}
{'tags' in item.content && item.content.tags && (
{"tags" in item.content &&
item.content.tags &&
item.content.tags.map((tag, index) => (
<Badge key={index} className="text-xs">
{tag}
</Badge>
))
)}
))}
</div>
</CardContent>
</Card>
Expand Down
Loading

0 comments on commit cc0b1c6

Please sign in to comment.