This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # Decrypt encrypted PDFs matched by a glob pattern. | |
| # - If a file is not encrypted, it is left unchanged. | |
| # - If a file is encrypted, it is decrypted using the provided password. | |
| # The original is preserved as "<name>.orig.pdf" and the decrypted output | |
| # replaces the original filename. | |
| # ---- Dependency check (qpdf) ---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import dotenv from "dotenv"; | |
| import { Telegraf } from "telegraf"; | |
| import { message } from "telegraf/filters"; | |
| import process from "node:process"; | |
| import { ollama } from "ollama-ai-provider"; | |
| import { generateText, type CoreMessage, type StreamTextResult } from "ai"; | |
| dotenv.config(); |