Skip to content

zooai/yapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YBird

Downloads Build Status Donate

Y is a lightweight AI manager for macOS. It keeps the history of what you AI and lets you quickly navigate, search, and use previous AI contents.

Thanks to integration with Claude and Langchain, users can easily access best-in-class API straight from the clipboard.

Y works on macOS Mojave 10.14 or higher.

Features

  • Lightweight and fast
  • Keyboard-first
  • Secure and private
  • Native UI for Claude
  • SERP integrated for realtime internet queries
  • Langchain for linking up models
  • Chroma for vector database
  • Open source and free

How it works

Here is an explanation of how the API for YApp works:

The YApp API is designed to allow the YApp native clipboard manager to seamlessly integrate with the Claude AI assistant. When a user copies text to their clipboard in YApp, it sends that text to the /ask endpoint of the API.

The /ask endpoint takes the input text, creates a conversation history by looking at previous messages with the 'user' role, and uses that to construct a prompt for Claude. It uses the LangChain library to simplify the process of chatting with Claude. The prompt contains the chat history and the user's input text.

Claude then generates a response, which is returned by the API as a JSON object. This allows YApp to display Claude's response in the app interface, making it feel like a real-time conversation.

The /search endpoint works similarly, but instead of just chatting with Claude, it uses a tool to run a web search using SerpAPI. This allows Claude to provide more informed responses by looking up additional context on the web when needed.

The API uses Flask to handle the web requests and responses. It connects Claude and LangChain behind the scenes to add conversational AI abilities to YApp. The real-time nature of the API allows YApp to feel very responsive rather than needing to wait for network requests on each user interaction.

Overall, the API enables seamless integration between YApp and Claude using modern AI techniques. It expands the capabilities of YApp's clipboard manager by allowing users to have an intelligent conversation about the content they copy and paste.

Install

Download the latest version from the releases page.

git clone https://github.com/zeekay/yapp

Demo

For hackathon demo purposes, manually run api.py locally before using Mac app.

python api.py

Local access to server is available thru /ask and /search endpoints:

curl -X POST -H "Content-Type: application/json" -d '{"message":[{"role":"user","content":"what day is it?"}]}' http://localhost:5000/ask

Usage

  1. SHIFT (⇧) + COMMAND (⌘) + C to popup Y or click on its icon in the menu bar.
  2. Type what you want to find.
  3. To select the history item you wish to copy, press ENTER, or click the item, or use COMMAND (⌘) + n shortcut.
  4. To choose the history item and paste, press OPTION (⌥) + ENTER, or OPTION (⌥) + CLICK the item, or use OPTION (⌥) + n shortcut.
  5. To choose the history item and paste without formatting, press OPTION (⌥) + SHIFT (⇧) + ENTER, or OPTION (⌥) + SHIFT (⇧) + CLICK the item, or use OPTION (⌥) + SHIFT (⇧) + n shortcut.
  6. To delete the history item, press OPTION (⌥) + DELETE (⌫).
  7. To see the full text of the history item, wait a couple of seconds for tooltip.
  8. To pin the history item so that it remains on top of the list, press OPTION (⌥) + P. The item will be moved to the top with a random but permanent keyboard shortcut. To unpin it, press OPTION (⌥) + P again.
  9. To clear all unpinned items, select Clear in the menu, or press OPTION (⌥) + COMMAND (⌘) + DELETE (⌫). To clear all items including pinned, select Clear in the menu with OPTION (⌥) pressed, or press SHIFT (⇧) + OPTION (⌥) + COMMAND (⌘) + DELETE (⌫).
  10. To disable Y and ignore new copies, click on the menu icon with OPTION (⌥) pressed.
  11. To ignore only the next copy, click on the menu icon with OPTION (⌥) + SHIFT (⇧) pressed.
  12. To customize the behavior, check "Preferences..." window, or press COMMAND (⌘) + ,.

Advanced

Ignore Copied Items

You can tell Y to ignore all copied items:

defaults write org.yapp.Y ignoreEvents true # default is false

This is useful if you have some workflow for copying sensitive data. You can set ignoreEvents to true, copy the data and set ignoreEvents back to false.

You can also click the menu icon with OPTION (⌥) pressed. To ignore only the next copy, click with OPTION (⌥) + SHIFT (⇧) pressed.

Ignore Custom Copy Types

By default Y will ignore certain copy types that are considered to be confidential or temporary. The default list always include the following types:

  • org.nspasteboard.TransientType
  • org.nspasteboard.ConcealedType
  • org.nspasteboard.AutoGeneratedType

Also, default configuration includes the following types but they can be removed or overwritten:

  • com.agilebits.onepassword
  • com.typeit4me.clipping
  • de.petermaurer.TransientPasteboardType
  • Pasteboard generator type
  • net.antelle.keeweb

You can add additional custom types using preferences or defaults:

defaults write org.yapp.Y ignoredPasteboardTypes -array-add "com.myapp.CustomType"

If you need to find what custom types are used by an application, you can use free application Pasteboard-Viewer. Simply download the application, open it, copy something from the application you want to ignore and look for any custom types in the left sidebar.

If you accidentally removed default types, you can restore the original configuration:

defaults write org.yapp.Y ignoredPasteboardTypes -array "de.petermaurer.TransientPasteboardType" "com.typeit4me.clipping" "Pasteboard generator type" "com.agilebits.onepassword" "net.antelle.keeweb"

FAQ

Why doesn't it paste when I select an item in history?

  1. Make sure you have "Paste automatically" enabled in Preferences.
  2. Make sure "Y" is added to System Settings -> Privacy & Security -> Accessibility.

Motivation

There are dozens of similar applications out there, so why build another? Over the past years since I moved from Linux to macOS, I struggled to find a clipboard manager that is as free and simple as Parcellite, but I couldn't. So I've decided to build one.

Also, I wanted to learn Swift and get acquainted with macOS application development.

License

MIT

About

🧬 ZOO Mac app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published