### Development Setup for memU Bot Source: https://github.com/nevamind-ai/memubot/blob/main/CONTRIBUTING.md Follow these steps to set up the development environment for memU Bot. Ensure you have Node.js, npm, and Git installed. ```bash # 1. Fork the repository on GitHub # 2. Clone your fork locally git clone https://github.com/YOUR_USERNAME/memUBot.git cd memUBot # 3. Install dependencies npm install # 4. Start development mode npm run dev:memu ``` -------------------------------- ### Python Minimal Service Example Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/service-creator/reference/templates-minimal.md This Python example mirrors the Node.js pattern using `invoke.py` for service creation. It demonstrates data fetching, conditional logic, and service invocation, suitable for Python environments. ```python import json, urllib.request from invoke import invoke, dry_run_result, DRY_RUN, SERVICE_ID CONTEXT = { "userRequest": "Monitor BTC price, notify if above $50,000", "expectation": "Notify when BTC price exceeds $50,000", "notifyPlatform": "telegram" } THRESHOLD = 48000 def check_and_report(): with urllib.request.urlopen('https://api.example.com/btc/price') as resp: price = json.loads(resp.read())['price'] passed = price >= THRESHOLD reason = f"${price} >= ${THRESHOLD}" if passed else f"${price} < ${THRESHOLD}" if DRY_RUN: dry_run_result({'price': price}, {'passed': passed, 'reason': reason}, passed) return if not passed: return invoke(context=CONTEXT, summary=f"BTC at ${price}", details=f"Price: ${price}, threshold: ${THRESHOLD}") if __name__ == "__main__": import time if DRY_RUN: check_and_report() else: while True: check_and_report() time.sleep(60) ``` -------------------------------- ### Node.js Minimal Service Example Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/service-creator/reference/templates-minimal.md Use this Node.js pattern with the `invoke.js` helper for a recommended approach to creating services. It includes fetching data, local filtering, dry run capabilities, and conditional invocation. ```javascript const https = require('https'); const { invoke, dryRunResult, DRY_RUN, SERVICE_ID } = require('./invoke'); const CONTEXT = { userRequest: "Monitor BTC price, notify if above $50,000", expectation: "Notify when BTC price exceeds $50,000", notifyPlatform: "telegram" }; const THRESHOLD = 48000; // Buffer below 50k async function checkAndReport() { // 1. Fetch data (using only built-in https module) const price = await new Promise((resolve, reject) => { https.get('https://api.example.com/btc/price', (res) => { let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => { const json = JSON.parse(data); resolve(json.price); }); }).on('error', reject); }); // 2. Local filter const passed = price >= THRESHOLD; const reason = passed ? `$${price} >= $${THRESHOLD}` : `$${price} < $${THRESHOLD}`; // 3. Dry run: print and exit if (DRY_RUN) { dryRunResult({ price }, { passed, reason }, passed); return; } // 4. Invoke (only if filter passes) if (!passed) return; await invoke({ context: CONTEXT, summary: `BTC at $${price}`, details: `Price: $${price}, threshold: $${THRESHOLD}` }); } if (DRY_RUN) { checkAndReport().then(() => process.exit(0)).catch(e => { console.error(e); process.exit(1); }); } else { checkAndReport(); setInterval(checkAndReport, 60000); } ``` -------------------------------- ### Python Monitor with Local Filtering and Dry Run Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/service-creator/reference/templates-python-monitor.md This example shows a complete monitor service in Python. It includes local filtering based on CPU usage, a cooldown period to prevent excessive notifications, and a dry run mode for testing without invoking the LLM. The service continuously monitors CPU usage and reports when it exceeds a defined threshold. ```python #!/usr/bin/env python3 import os import time from invoke import invoke, dry_run_result, DRY_RUN, SERVICE_ID CONTEXT = { "userRequest": "Monitor server CPU, notify if over 80%", "expectation": "Notify when CPU usage exceeds 80%", "notifyPlatform": "telegram" } # ============ LOCAL FILTERING CONFIG ============ # Set threshold lower than user's requirement (80% -> 70%) LOCAL_THRESHOLD = 70 last_notified_at = None COOLDOWN_SECONDS = 300 # Don't notify more than once per 5 minutes def get_cpu_usage(): # Implement your CPU monitoring logic # Example using built-in os module: load = os.getloadavg()[0] # 1-minute load average cpu_count = os.cpu_count() or 1 return min(100, (load / cpu_count) * 100) def check_and_report(): global last_notified_at cpu = get_cpu_usage() print(f"[{SERVICE_ID}] CPU: {cpu:.1f}%") # ====== LOCAL FILTER ====== passes_filter = cpu >= LOCAL_THRESHOLD filter_reason = ( f"CPU {cpu:.1f}% exceeds threshold {LOCAL_THRESHOLD}%" if passes_filter else f"CPU {cpu:.1f}% below threshold {LOCAL_THRESHOLD}%" ) # ====== DRY RUN: print results and exit ====== if DRY_RUN: dry_run_result( {'cpu_percent': round(cpu, 1)}, {'passed': passes_filter, 'reason': filter_reason}, passes_filter ) return if not passes_filter: print(f"[{SERVICE_ID}] {filter_reason}, skipping LLM") return # Cooldown check if last_notified_at: elapsed = time.time() - last_notified_at if elapsed < COOLDOWN_SECONDS: print(f"[{SERVICE_ID}] In cooldown period, skipping") return # ====== PASSES LOCAL FILTER - CALL LLM ====== print(f"[{SERVICE_ID}] {filter_reason} - calling LLM for evaluation") result = invoke( context=CONTEXT, summary=f"Server CPU at {cpu:.1f}%", details=f"CPU usage has reached {cpu:.1f}%, which is above the monitoring threshold.", metadata={"cpu_percent": round(cpu, 1)} ) print(f"[{SERVICE_ID}] LLM decision: {result.get('data', {}).get('action')}") if result.get('data', {}).get('action') == 'notified': last_notified_at = time.time() # ============ ENTRY POINT ============ if __name__ == "__main__": if DRY_RUN: print(f"[{SERVICE_ID}] Running in DRY RUN mode...") try: check_and_report() except Exception as e: print(f"[{SERVICE_ID}] Dry run failed: {e}") exit(1) else: print(f"[Service:{SERVICE_ID}] Starting CPU monitor...") while True: check_and_report() time.sleep(30) ``` -------------------------------- ### Discord Bot Token Example Source: https://github.com/nevamind-ai/memubot/blob/main/docs/discord-bot-setup.md This is an example of a Discord bot token. Keep this token secure and do not share it publicly, as it grants access to your bot. ```text MTIzNDU2Nzg5MDEyMzQ1Njc4.XXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXX ``` -------------------------------- ### Set Bot Description Command Source: https://github.com/nevamind-ai/memubot/blob/main/docs/telegram-bot-setup.md Use this command with BotFather to set the description that users see when they start a chat with your bot. ```bash /setdescription ``` -------------------------------- ### Create Multi-Slide Keynote Presentation Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md A comprehensive AppleScript example that creates a new Keynote presentation with multiple slides, sets content, saves it, and includes essential delays for stability. This is the recommended pattern for robust automation. ```applescript osascript << 'EOF'\ntell application "Keynote"\n activate\n delay 1 -- IMPORTANT: Wait for Keynote to fully launch\n \n -- Create new document\n set newDoc to make new document with properties {document theme:theme "White"}\n delay 0.5 -- Wait for document to initialize\n \n tell newDoc\n -- First slide is created automatically, set it as title slide\n tell slide 1\n set base slide to master slide "Title - Center"\n set object text of default title item to "Q1 2026 Business Review"\n set object text of default body item to "Financial Services Division"\n end tell\n delay 0.3\n \n -- Add Overview slide\n set slide2 to make new slide with properties {base slide:master slide "Title & Bullets"}\n delay 0.3\n tell slide2\n set object text of default title item to "Executive Summary"\n set object text of default body item to "• Revenue increased 15% YoY\n• New client acquisition: $15M AUM\n• Client satisfaction: 4.8/5.0\n• All portfolios outperforming benchmarks"\n end tell\n \n -- Add Performance slide\n set slide3 to make new slide with properties {base slide:master slide "Title & Bullets"}\n delay 0.3\n tell slide3\n set object text of default title item to "Investment Performance"\n set object text of default body item to "• Growth Portfolio: +3.2% (Benchmark +2.8%)\n• Balanced Portfolio: +2.1% (Benchmark +1.9%)\n• Income Portfolio: +0.9% (Benchmark +0.7%)\n• Average Alpha: +0.3%"\n end tell\n \n -- Add Next Steps slide\n set slide4 to make new slide with properties {base slide:master slide "Title & Bullets"}\n delay 0.3\n tell slide4\n set object text of default title item to "Q2 Priorities"\n set object text of default body item to "• Complete endowment fund implementation\n• Expand alternative investment offerings\n• Launch client education seminar series\n• Target: $25M total new AUM"\n end tell\n \n delay 0.5 -- Wait before saving\n -- Save the presentation\n set savePath to POSIX file "~/Desktop/Q1_Review.key"\n save in savePath\n end tell\n \n return "Presentation created with 4 slides"\nend tell\nEOF ``` -------------------------------- ### Bot Token Example Source: https://github.com/nevamind-ai/memubot/blob/main/docs/telegram-bot-setup.md This is the token provided by BotFather. It is used to access the Telegram HTTP API and should be kept secure. ```text 1234567890:ABCdefGHIjklMNOpqrsTUVwxyz ``` -------------------------------- ### Python Invoke API Usage Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/service-creator/SKILL.md Example of using the Python invoke API with named parameters for making service calls. ```python invoke(context=CONTEXT, summary='...', details='...', metadata={}) ``` -------------------------------- ### Node.js Invoke API Usage Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/service-creator/SKILL.md Example of using the Node.js invoke API with named parameters for making service calls. ```javascript await invoke({ context: CONTEXT, summary: '...', details: '...', metadata: {} }) ``` -------------------------------- ### Get Slide Count Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Retrieves the total number of slides in the frontmost Keynote document. ```bash osascript -e 'tell application "Keynote" to count slides of front document' ``` -------------------------------- ### Help Command Source: https://github.com/nevamind-ai/memubot/blob/main/docs/telegram-bot-setup.md Displays a list of available commands for the bot. ```bash /help ``` -------------------------------- ### Common npm Commands for memU Bot Development Source: https://github.com/nevamind-ai/memubot/blob/main/CONTRIBUTING.md A list of essential npm commands for managing dependencies, running the development server, type checking, and building the project for different operating systems. ```bash npm install # Install dependencies npm run dev:memu # Start development mode npm run typecheck # Run TypeScript type checking npm run build:memu:mac # Build for macOS npm run build:memu:win # Build for Windows ``` -------------------------------- ### Stable Keynote Creation Workflow Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Demonstrates the recommended stable approach for creating Keynote presentations using a single AppleScript execution. This avoids issues caused by multiple rapid script calls. ```bash osascript << 'EOF'\ntell application "Keynote"\n activate\n delay 1 -- Wait for Keynote to fully launch\n \n -- Do ALL operations in ONE script\n set newDoc to make new document with properties {document theme:theme "White"}\n delay 0.5 -- Brief pause after creating document\n \n tell newDoc\n -- All slides and content in one block\n ...\n end tell\nend tell\nEOF ``` -------------------------------- ### Create New Keynote Presentation Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Creates a new Keynote document with a specified theme. Ensure Keynote is activated before creating the document. ```bash osascript << 'EOF'\ntell application "Keynote"\n activate\n set newDoc to make new document with properties {document theme:theme "White"}\n return name of newDoc\nend tell\nEOF ``` -------------------------------- ### Node.js Stock Monitor with Local Filtering and Dry Run Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/service-creator/reference/templates-stock-monitor.md This snippet implements a stock monitoring service. It fetches stock prices, applies local filtering based on a predefined threshold, and integrates with an LLM for final decision-making. It also supports a dry run mode for testing without actual LLM invocation. ```javascript const https = require('https'); const { invoke, dryRunResult, DRY_RUN, SERVICE_ID } = require('./invoke'); // User's original request const CONTEXT = { userRequest: "Monitor AAPL stock, notify me if it drops more than 5%", expectation: "Notify when AAPL price drops more than 5% from reference price", notifyPlatform: "telegram" }; // ============ LOCAL FILTERING CONFIG ============ // Set threshold slightly lower than user's requirement (5% -> 3%) // This allows LLM to make judgment calls on edge cases const LOCAL_THRESHOLD_PERCENT = 3.0; let referencePrice = null; let lastNotifiedPrice = null; // ============ DATA FETCHING ============ // IMPORTANT: Always validate API responses! External APIs may return: // - Rate limit errors (429) // - Unexpected JSON structure // - HTML error pages instead of JSON async function fetchStockPrice(symbol) { // Example using a free API (replace with your preferred source) return new Promise((resolve, reject) => { https.get(`https://api.example.com/stock/${symbol}/price`, (res) => { // Check HTTP status first if (res.statusCode !== 200) { reject(new Error(`API returned status ${res.statusCode}`)); return; } let data = ''; res.on('data', chunk => data += chunk); res.on('end', () => { try { const json = JSON.parse(data); // CRITICAL: Validate response structure before accessing nested properties if (!json || typeof json.price === 'undefined') { reject(new Error(`Invalid API response: missing 'price' field. Got: ${data.substring(0, 100)}`)); return; } resolve(json.price); } catch (e) { // JSON parse failed - API might have returned HTML error page reject(new Error(`Failed to parse API response: ${e.message}. Raw: ${data.substring(0, 100)}`)); } }); }).on('error', reject); }); } // ============ MAIN LOGIC WITH LOCAL FILTERING ============ async function checkAndReport() { try { const currentPrice = await fetchStockPrice('AAPL'); console.log(`[${SERVICE_ID}] AAPL: $${currentPrice}`); // For dry run, use current price as both reference and current const refPrice = referencePrice || currentPrice; if (referencePrice === null) { referencePrice = currentPrice; console.log(`[${SERVICE_ID}] Reference price set: $${referencePrice}`); } // Calculate change percentage const changePercent = ((currentPrice - refPrice) / refPrice) * 100; // ====== LOCAL FILTER ====== const passesFilter = Math.abs(changePercent) >= LOCAL_THRESHOLD_PERCENT; const filterReason = passesFilter ? `Change ${changePercent.toFixed(2)}% exceeds threshold ${LOCAL_THRESHOLD_PERCENT}%` : `Change ${changePercent.toFixed(2)}% below threshold ${LOCAL_THRESHOLD_PERCENT}%`; // ====== DRY RUN: print results and exit ====== if (DRY_RUN) { dryRunResult( { symbol: 'AAPL', currentPrice, referencePrice: refPrice }, { passed: passesFilter, reason: filterReason, changePercent }, passesFilter ); return; } if (!passesFilter) { console.log(`[${SERVICE_ID}] ${filterReason}, skipping LLM`); return; } // Avoid duplicate notifications for same price level if (lastNotifiedPrice && Math.abs(currentPrice - lastNotifiedPrice) < 1) { console.log(`[${SERVICE_ID}] Already notified at similar price, skipping`); return; } // ====== PASSES LOCAL FILTER - CALL LLM ====== console.log(`[${SERVICE_ID}] ${filterReason} - calling LLM for evaluation`); const result = await invoke({ context: CONTEXT, summary: `AAPL ${changePercent > 0 ? 'rose' : 'dropped'} ${Math.abs(changePercent).toFixed(2)}%`, details: `Current: $${currentPrice.toFixed(2)}, Reference: $${refPrice.toFixed(2)}`, metadata: { symbol: 'AAPL', currentPrice, referencePrice: refPrice, changePercent } }); console.log(`[${SERVICE_ID}] LLM decision: ${result.data?.action}`); if (result.data?.action === 'notified') { lastNotifiedPrice = currentPrice; } } catch (error) { console.error(`[${SERVICE_ID}] Error:`, error.message); if (DRY_RUN) throw error; // Let dry run fail visibly } } // ============ ENTRY POINT ============ if (DRY_RUN) { console.log(`[${SERVICE_ID}] Running in DRY RUN mode...`); checkAndReport() .then(() => process.exit(0)) .catch((e) => { console.error(`[${SERVICE_ID}] Dry run failed:`, e.message); process.exit(1); }); } else { console.log(`[${SERVICE_ID}] Starting stock monitor...`); checkAndReport(); setInterval(checkAndReport, 60000); } ``` -------------------------------- ### Bind User Account with Security Code Source: https://github.com/nevamind-ai/memubot/blob/main/docs/slack-bot-setup.md Use this command in a Slack channel or DM with the bot to bind your user account to memU by providing a security code. ```bash /bind YOUR_SECURITY_CODE ``` -------------------------------- ### Unstable Keynote Creation Workflow (Avoid) Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Illustrates a bad approach that can cause Keynote to crash or become unresponsive due to multiple separate AppleScript invocations for a single presentation. ```bash # Script 1: Create document\nosascript -e 'tell application "Keynote" to make new document'\n# Script 2: Add slide 1\nosascript -e 'tell application "Keynote" to tell front document to make new slide'\n# Script 3: Set title\nosascript -e 'tell application "Keynote" to tell front document to ...'\n# This will likely crash! ``` -------------------------------- ### Export Keynote to PDF Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Use this script to export the frontmost Keynote document to a PDF file. Ensure Keynote is running and a document is open. ```applescript osascript << 'EOF'\ntell application "Keynote"\n tell front document\n set exportPath to POSIX file "/Users/username/Desktop/presentation.pdf"\n export to exportPath as PDF\n end tell\nend tell\nEOF ``` -------------------------------- ### Node.js Invoke Helper Import Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/service-creator/SKILL.md Import the pre-built invoke helper for Node.js services to simplify API calls. ```javascript const { invoke, dryRunResult, DRY_RUN, SERVICE_ID } = require('./invoke'); ``` -------------------------------- ### Python Invoke Helper Import Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/service-creator/SKILL.md Import the pre-built invoke helper for Python services to simplify API calls. ```python from invoke import invoke, dry_run_result, DRY_RUN, SERVICE_ID ``` -------------------------------- ### Set Bot About Text Command Source: https://github.com/nevamind-ai/memubot/blob/main/docs/telegram-bot-setup.md Use this command with BotFather to set the text that appears in your bot's profile. ```bash /setabouttext ``` -------------------------------- ### Enable Inline Mode Command Source: https://github.com/nevamind-ai/memubot/blob/main/docs/telegram-bot-setup.md Use this command with BotFather to enable inline mode, allowing users to interact with your bot in other chats. ```bash /setinline ``` -------------------------------- ### Testing and Type Checking in memU Bot Source: https://github.com/nevamind-ai/memubot/blob/main/CONTRIBUTING.md Commands to ensure code quality and functionality. Run type checking before testing to catch potential TypeScript errors. ```bash # Run type checking npm run typecheck # Test the application npm run dev:memu ``` -------------------------------- ### Bind Discord Account Command Source: https://github.com/nevamind-ai/memubot/blob/main/docs/discord-bot-setup.md Use this slash command in a channel where the bot can see messages to bind your Discord account. Replace YOUR_SECURITY_CODE with your actual security code. ```discord /bind YOUR_SECURITY_CODE ``` -------------------------------- ### Set Bot Profile Picture Command Source: https://github.com/nevamind-ai/memubot/blob/main/docs/telegram-bot-setup.md Use this command with BotFather to upload and set a profile picture for your bot. ```bash /setuserpic ``` -------------------------------- ### Node.js Simple Reminder Service with Dry Run Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/service-creator/reference/templates-reminder.md This service sends reminders at a specified interval. It supports a dry-run mode to test the logic without actual invocation. Ensure the './invoke' module is available for its functions. ```javascript // Simple reminder service - runs periodically and notifies user const { invoke, dryRunResult, DRY_RUN, SERVICE_ID } = require('./invoke'); const INTERVAL_MINUTES = 15; // Reminder interval const CONTEXT = { userRequest: "Remind me to drink water every 15 minutes", expectation: "Send a reminder notification every 15 minutes", notifyPlatform: "telegram" }; async function sendReminder() { try { const now = new Date(); const timeStr = now.toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit' }); // ====== DRY RUN: verify logic and exit ====== if (DRY_RUN) { dryRunResult( { currentTime: timeStr, intervalMinutes: INTERVAL_MINUTES }, { passed: true, reason: 'Reminder services always invoke (time-based, no data filter)' }, true ); return; } console.log(`[${SERVICE_ID}] Sending reminder at ${timeStr}`); const result = await invoke({ context: CONTEXT, summary: "Time to drink water!", details: `Current time: ${timeStr}. Stay hydrated!`, metadata: { time: timeStr } }); console.log(`[${SERVICE_ID}] Result: ${result.data?.action}`); } catch (error) { console.error(`[${SERVICE_ID}] Error:`, error.message); if (DRY_RUN) throw error; } } // ============ ENTRY POINT ============ if (DRY_RUN) { console.log(`[${SERVICE_ID}] Running in DRY RUN mode...`); sendReminder() .then(() => process.exit(0)) .catch((e) => { console.error(`[${SERVICE_ID}] Dry run failed:`, e.message); process.exit(1); }); } else { console.log(`[${SERVICE_ID}] Reminder service started`); console.log(`[${SERVICE_ID}] Will remind every ${INTERVAL_MINUTES} minutes`); sendReminder(); setInterval(sendReminder, INTERVAL_MINUTES * 60 * 1000); } ``` -------------------------------- ### Set Slide Title and Body Text Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Sets the title and body text for the current slide in a Keynote presentation. This requires the slide to have default title and body items available. ```bash osascript << 'EOF'\ntell application "Keynote"\n tell front document\n tell current slide\n -- Set title\n set object text of default title item to "Your Title Here"\n \n -- Set body text (for slides with body placeholder)\n set object text of default body item to "• Point 1\n• Point 2\n• Point 3"\n end tell\n end tell\nend tell\nEOF ``` -------------------------------- ### Add Slide with Specific Layout Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Adds a new slide to the frontmost Keynote document using a specified master slide layout. Common layouts include 'Title - Center', 'Title & Bullets', and 'Blank'. ```bash osascript << 'EOF'\ntell application "Keynote"\n tell front document\n -- Add slide with specific layout\n set newSlide to make new slide with properties {base slide:master slide "Title - Center"}\n end tell\nend tell\nEOF ``` -------------------------------- ### Creating Feature and Bugfix Branches Source: https://github.com/nevamind-ai/memubot/blob/main/CONTRIBUTING.md Use these Git commands to create new branches for developing features or fixing bugs. It's recommended to base bugfix branches off the main development branch. ```bash git checkout -b feature/amazing-feature # or for bug fixes git checkout -b bugfix/fix-memory-leak ``` -------------------------------- ### Navigate to Specific Slide Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Sets the current slide of the frontmost Keynote document to a specific slide number. Slide numbers are 1-based. ```bash osascript << 'EOF'\ntell application "Keynote"\n tell front document\n set current slide to slide 3\n end tell\nend tell\nEOF ``` -------------------------------- ### Save Keynote Presentation Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md This script saves the frontmost Keynote document to a specified file path. The path should be a valid POSIX file path. ```applescript osascript << 'EOF'\ntell application "Keynote"\n tell front document\n set savePath to POSIX file "/Users/username/Desktop/my_presentation.key"\n save in savePath\n end tell\nend tell\nEOF ``` -------------------------------- ### Conventional Commit Message Format Source: https://github.com/nevamind-ai/memubot/blob/main/CONTRIBUTING.md Adhere to the conventional commit format for clear and consistent commit messages. This format helps automate changelog generation and versioning. ```text type(scope): description Examples: feat(memory): add semantic search functionality fix(llm): resolve OpenAI timeout issues docs(readme): update installation instructions test(agent): add unit tests for memory retrieval refactor(core): restructure memory storage logic ``` -------------------------------- ### Invite Bot to Slack Channel Source: https://github.com/nevamind-ai/memubot/blob/main/docs/slack-bot-setup.md Invite your Slack bot to a channel using this command. The bot requires channel membership to see messages. ```bash /invite @YourBotName ``` -------------------------------- ### Close Keynote using macos_close Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Use this function when the `macos_close` tool is available, typically in Visual Demo Mode, to close the Keynote application. ```python macos_close(target: "keynote", delay_ms: 500) ``` -------------------------------- ### Node.js Dry Run Pattern Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/service-creator/reference/dry-run.md Implement dry run logic in Node.js by checking the MEMU_DRY_RUN environment variable. This pattern fetches data, applies filters, prints structured output, and skips API calls or loops when dry run is enabled. It also handles process exit codes for success and failure. ```javascript const DRY_RUN = process.env.MEMU_DRY_RUN === 'true'; async function checkAndReport() { // ... fetch data ... // ... apply local filter ... if (DRY_RUN) { console.log('[DRY_RUN_RESULT]', JSON.stringify({ dataFetched: fetchedData, filterResult: { passed: shouldInvoke, reason: filterReason }, wouldInvoke: shouldInvoke })); return; } // ... call invoke API (only in real mode) ... } // Entry point if (DRY_RUN) { checkAndReport().then(() => process.exit(0)).catch(e => { console.error(e); process.exit(1); }); } else { checkAndReport(); setInterval(checkAndReport, INTERVAL_MS); } ``` -------------------------------- ### Add Image to Slide Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Inserts an image from a specified POSIX file path onto the current slide and sets its position and width. Ensure the image file path is correct. ```bash osascript << 'EOF'\ntell application "Keynote"\n tell front document\n tell current slide\n set imgFile to POSIX file "/path/to/image.jpg"\n set newImage to make new image with properties {file:imgFile}\n set position of newImage to {300, 200}\n set width of newImage to 400\n end tell\n end tell\nend tell\nEOF ``` -------------------------------- ### Commit Message Types Source: https://github.com/nevamind-ai/memubot/blob/main/CONTRIBUTING.md Understand the different types used in conventional commits. Each type signifies a specific kind of change, aiding in code review and release management. ```text **Types:** - `feat`: New feature - `fix`: Bug fix - `docs`: Documentation changes - `test`: Adding or fixing tests - `refactor`: Code restructuring without feature changes - `perf`: Performance improvements - `chore`: Maintenance tasks ``` -------------------------------- ### Python Dry Run Pattern Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/service-creator/reference/dry-run.md Implement dry run logic in Python by checking the MEMU_DRY_RUN environment variable. This pattern fetches data, applies filters, prints structured output, and skips API calls or loops when dry run is enabled. It uses a `while True` loop for continuous execution in non-dry run mode. ```python DRY_RUN = os.environ.get('MEMU_DRY_RUN') == 'true' def check_and_report(): # ... fetch data ... # ... apply local filter ... if DRY_RUN: print('[DRY_RUN_RESULT]', json.dumps({ 'dataFetched': fetched_data, 'filterResult': {'passed': should_invoke, 'reason': filter_reason}, 'wouldInvoke': should_invoke })) return # ... call invoke API (only in real mode) ... if __name__ == '__main__': if DRY_RUN: check_and_report() else: while True: check_and_report() time.sleep(INTERVAL_SECONDS) ``` -------------------------------- ### Close Keynote using AppleScript Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Alternatively, use this AppleScript command to quit the Keynote application when `macos_close` is not available. ```bash osascript -e 'tell application "Keynote" to quit' ``` -------------------------------- ### Add Text Box with Custom Position and Size Source: https://github.com/nevamind-ai/memubot/blob/main/src/main/builtin-skills/keynote-creator/SKILL.md Adds a new text box to the current slide with custom text content, position, and dimensions. The position is defined by X and Y coordinates. ```bash osascript << 'EOF'\ntell application "Keynote"\n tell front document\n tell current slide\n set newText to make new text item with properties {object text:"Custom text here"}\n set position of newText to {100, 200}\n set width of newText to 400\n set height of newText to 100\n end tell\n end tell\nend tell\nEOF ``` -------------------------------- ### Unbind Telegram Account Command Source: https://github.com/nevamind-ai/memubot/blob/main/docs/telegram-bot-setup.md Use this command to unbind your Telegram account from memU. ```bash /unbind ``` -------------------------------- ### Disable Bot Privacy Mode Command Source: https://github.com/nevamind-ai/memubot/blob/main/docs/telegram-bot-setup.md Use this command with BotFather to disable privacy mode, allowing your bot to see all messages in group chats. This is necessary for bots that need to respond to all messages, not just direct messages or commands. ```bash /setprivacy ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.