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
2 changes: 1 addition & 1 deletion extensions/ai/backslash.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id = "ai"
title = "AI"
description = "Ask questions, fix, rewrite, summarize, translate and explain text, with Claude, OpenAI, Mistral, Groq, OpenRouter or a local Ollama"
version = "1.0.0"
version = "1.1.0"
author = "Backslash"
icon = "✨"
license = "MIT"
Expand Down
2 changes: 2 additions & 0 deletions extensions/ai/chat.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { action, clipboard, close, detail, field, form, replace, storage } from "@backslash/api";
import { languageRule, type Message, type Prefs } from "./lib.ts";
import { canPaste, pasteText } from "./paste.ts";
import { answer, modelName } from "./llm.ts";

export interface Conversation {
Expand Down Expand Up @@ -72,6 +73,7 @@ export function chat(prefs: Prefs, previous: Conversation | undefined, question?
return close("Answer copied");
}, { icon: "edit-copy" }),
action("Ask a Follow-up…", () => followUp, { icon: "mail-reply-sender", shortcut: "<Ctrl>r" }),
...(canPaste ? [action("Paste Answer", () => pasteText(last), { icon: "edit-paste", shortcut: "<Ctrl>p" })] : []),
action("Copy Conversation", async () => {
await clipboard.write(transcript(convo.messages));
return close("Conversation copied");
Expand Down
9 changes: 9 additions & 0 deletions extensions/ai/paste.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { clipboard } from "@backslash/api";

/** clipboard.paste came with Backslash 0.4. */
export const canPaste = "paste" in clipboard;

/** Pastes into the app the user was in, closing the launcher. */
export async function pasteText(text: string) {
await clipboard.paste(text);
}
2 changes: 2 additions & 0 deletions extensions/ai/tools.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type Action, action, clipboard, close, type Context, detail, replace } from "@backslash/api";
import { chat } from "./chat.ts";
import { languageRule, type Prefs } from "./lib.ts";
import { canPaste, pasteText } from "./paste.ts";
import { answer, modelName } from "./llm.ts";

/** The streamed result of an instruction applied to `text`; Enter copies it. */
Expand All @@ -23,6 +24,7 @@ export function toolView(
}
},
actions: [
...(canPaste ? [action("Paste Result", () => pasteText(result), { icon: "edit-paste" })] : []),
action("Copy Result", async () => {
await clipboard.write(result);
return close("Copied");
Expand Down
2 changes: 1 addition & 1 deletion extensions/emoji/backslash.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id = "emoji"
title = "Emoji & Symbols"
description = "Search emoji and symbols by name and copy them"
version = "1.1.0"
version = "1.2.0"
author = "Backslash"
icon = "😀"
license = "MIT"
Expand Down
5 changes: 5 additions & 0 deletions extensions/emoji/commands/search.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import * as api from "@backslash/api";
import { copy, list } from "@backslash/api";

// paste() came with Backslash 0.4; older launchers only copy.
const pasteFirst = (text: string) => ("paste" in api ? [api.paste(text, "Paste Emoji")] : []);
import data from "../emoji.json" with { type: "json" };

// Names are "common words · official unicode name"; the title keeps the
Expand All @@ -22,6 +26,7 @@ export default list({
icon: emoji,
keywords: name.includes(" · ") ? [name.split(" · ")[0], ...name.split(" ")] : name.split(" "),
actions: [
...pasteFirst(emoji),
copy(emoji, "Copy Emoji"),
copy(title(name), "Copy Name"),
copy(codepoints, "Copy Code Point"),
Expand Down
6 changes: 3 additions & 3 deletions registry/ai.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ title = "AI"
description = "Ask questions, fix, rewrite, summarize, translate and explain text, with Claude, OpenAI, Mistral, Groq, OpenRouter or a local Ollama"
author = "Backslash"
icon = "✨"
version = "1.0.0"
version = "1.1.0"
repository = "https://github.com/backslash-app/plugins"
path = "extensions/ai"
commit = "e2762ad04c6bc8eddadcd95bc2640611cdd763fc"
checksum = "sha256:bf618cffe2c612643f7b10c97c825dc5da1ccb4f5689407ba06093cc34eedad2"
commit = "4355eb15974003b4d0f61febb95dd5dca5c4d614"
checksum = "sha256:6f09352f8175b132111367f1926cd9e36bf86567d7cfd44fda862a749703f8bc"
permissions = ["Access api.anthropic.com", "Access api.openai.com", "Access api.mistral.ai", "Access api.groq.com", "Access openrouter.ai", "Access localhost:11434", "Read the clipboard"]
commands = ["Ask AI", "Fix Spelling and Grammar", "Improve Writing", "Summarize", "Translate", "Explain"]

6 changes: 3 additions & 3 deletions registry/emoji.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ title = "Emoji & Symbols"
description = "Search emoji and symbols by name and copy them"
author = "Backslash"
icon = "😀"
version = "1.1.0"
version = "1.2.0"
repository = "https://github.com/backslash-app/plugins"
path = "extensions/emoji"
commit = "5b791b35805a9d4c6c3e3cb8ccb89796c84a0a97"
checksum = "sha256:27f4e8abf5cf616d7f38625b709225ffb69f8720d997243dc7efb3091c706b7e"
commit = "4355eb15974003b4d0f61febb95dd5dca5c4d614"
checksum = "sha256:3d6c8065bb45587d5e68b3226ab7ab0ed73cc0772f7daf494f53b6b0575b543f"
permissions = []
commands = ["Search Emoji & Symbols"]

Loading