Description:

// myai-app.js
document.addEventListener('DOMContentLoaded', () => {
const appRoot = document.getElementById('app-root');
const userData = myaiAppData; // Access global variable from wp_localize_script
if (appRoot && userData && userData.is_logged_in) {
// If logged in, initialize the app
initializeApp(appRoot, userData);
} else if (appRoot) {
// If not logged in, show a basic auth screen or redirect
appRoot.innerHTML = '

Please log in to WordPress to access MyAI Interface.

'; const authScreen = document.getElementById('auth-screen'); if (authScreen) { // Add basic styling if this screen is shown authScreen.style.display = 'flex'; authScreen.style.flexDirection = 'column'; authScreen.style.justifyContent = 'center'; authScreen.style.alignItems = 'center'; authScreen.style.height = '100%'; authScreen.style.width = '100%'; authScreen.style.backgroundColor = '#131314'; authScreen.style.color = '#e3e3e3'; } } else { console.error("MyAI App: #app-root element not found. Cannot initialize UI."); } }); let paneCounter = 0; // To give each new pane a unique ID function initializeApp(container, userData) { if (!container) { console.error("initializeApp: Container element not found."); return; } container.innerHTML = ''; // Clear the container first container.classList.add('grid-container'); const columns = ['left-col', 'center-col', 'right-col']; // Fixed 3 columns as per requirement const columnElements = []; // Retrieve settings from userData.myai_settings const settings = userData.myai_settings; // Apply global color scheme if available (currently not available, but for future) if (settings.user_color_scheme_available === '1' && settings.user_color_scheme) { document.documentElement.style.setProperty('--user-defined-bg-color', settings.user_color_scheme); // You would expand this to apply colors to AI, user input, system messages etc. } if (settings.ai_text_color_available === '1' && settings.ai_text_color) { document.documentElement.style.setProperty('--ai-text-color', settings.ai_text_color); } if (settings.user_input_text_color_available === '1' && settings.user_input_text_color) { document.documentElement.style.setProperty('--user-input-text-color', settings.user_input_text_color); } if (settings.system_messages_text_color_available === '1' && settings.system_messages_text_color) { document.documentElement.style.setProperty('--system-messages-text-color', settings.system_messages_text_color); } // Create 3 main columns for (const colId of columns) { const col = document.createElement('div'); col.id = `col-${paneCounter++}`; col.className = 'split-col'; container.appendChild(col); columnElements.push(`#${col.id}`); const paneElements = []; // Create 3 panes within each column for (let i = 1; i <= 3; i++) { const pane = document.createElement('div'); const paneId = `pane-${paneCounter++}`; pane.id = paneId; pane.className = 'split-pane'; // Apply scrollable_panes setting if (settings.scrollable_panes === '0') { // If disabled, prevent overflow:auto pane.style.overflow = 'hidden'; } const header = document.createElement('div'); header.className = 'pane-header'; const label = document.createElement('span'); label.textContent = `Pane ${paneId}`; // Default label, can be dynamic const subdivideBtn = document.createElement('button'); subdivideBtn.textContent = '⊞'; subdivideBtn.title = 'Subdivide this pane'; subdivideBtn.onclick = () => { // Check if fractal grid subdivision is enabled in settings if (settings.fractal_grid === '1') { // '1' because PHP checkbox saves as '1' or '0' createGrid(pane, userData); // RECURSIVE CALL, pass userData } else { alert("Fractal Grid Subdivision is currently disabled in your settings."); } }; header.appendChild(label); header.appendChild(subdivideBtn); pane.appendChild(header); pane.appendChild(document.createElement('div')); // Placeholder for content area col.appendChild(pane); paneElements.push(`#${paneId}`); } // Make the panes in the column resizable, if enabled in settings if (settings.resizable_panes === '1') { Split(paneElements, { direction: 'vertical', gutterSize: 8, minSize: 50 }); } } // Make the columns resizable, if enabled in settings if (settings.resizable_columns === '1') { Split(columnElements, { gutterSize: 8, minSize: 200 }); } }

Status: Published   Priority: 0.0

Target:   Comments:   URLs:   Images:

]]>

Description:

Grok (by xAI)

Features:

"Rebellious" and Witty Personality: Designed with a unique personality, aiming to be witty, sarcastic, and to answer questions that other AI models might reject. This is a core distinguishing characteristic.

Real-time Access to X (formerly Twitter): A key feature is its ability to access information from the X platform (formerly Twitter) in real-time, providing up-to-date insights on current events and trending topics.

Focus on Truth and Transparency: Despite its edgy personality, xAI emphasizes Grok's commitment to seeking truth and not generating content that is harmful or dishonest, though its approach to "pushing boundaries" is distinct.

Broad Knowledge Base: Built on a large language model, giving it a wide range of general knowledge.

Humor Integration: Designed to inject humor into its responses.

Where it Excels:

Timeliness (X Integration): Its real-time access to X gives it a significant advantage in providing very current information and understanding rapidly evolving trends or events.

Unique Personality: For users who appreciate a more engaging, less sterile AI interaction, Grok's distinct personality can be a major draw.

Answering Controversial/Edgy Queries: Its design to "answer questions that other AI models reject" can make it useful for exploring sensitive or unconventional topics (though this also comes with inherent risks).

Where it Falls Short:

Control over Personality: While its personality is a feature, users might have less granular control over its tone, which might not be suitable for all professional or formal applications.

Bias from Source Data: Real-time access to X, while beneficial for timeliness, also means it can inherit biases or inaccuracies present in that data.

API Accessibility/Integration (Currently Limited): As a newer model, its API accessibility and integration options for third-party applications might be less mature or widely available compared to established models like ChatGPT or Gemini.

Enterprise-Grade Features: May not yet have the full suite of enterprise-grade security, data governance, and management features that larger, more established AI providers offer.

Distinguishing Characteristics:

"Maximum Truth-Seeking & Rebellious Streak": Its stated mission to "understand the universe" and its distinct, often sarcastic, personality.

Real-time X Integration: Its direct and real-time connection to the X platform is its most unique technical differentiator.

Developed by xAI: The company founded by Elon Musk, which gives it a unique philosophical and operational approach to AI development.

Differences Between Free and Pay-for-Service Models:

Grok is primarily accessible through a paid subscription to X Premium+ (formerly Twitter Blue).

Free Version: As of my last update, there is no widely available free tier or direct free access to Grok outside of the X Premium+ subscription.

Paid Tier (X Premium+): Access to Grok is bundled with other premium features of the X platform. This implies:

Direct access within the X platform interface.

Real-time information derived from X content.

The specific features and usage limits are tied to the X Premium+ subscription terms.

API access for developers is typically part of a separate, higher-tier commercial offering from xAI, not necessarily bundled with the consumer-facing X Premium+ subscription.

Status: Draft   Priority:

Target:   Comments:   URLs:   Images:

]]>

Description:

# MyAI Gemini Interface
A custom AI interface with a modular, adjustable, and draggable layout, powered by Google's Gemini API. This project aims to provide a flexible and user-friendly environment for interacting with AI models.
## Features
* **Modular and Adjustable Layout:** Create and arrange multiple AI interaction panes.
* **Draggable Panes:** Easily reorder and organize your workspace.
* **Resizable Columns and Panes:** Customize the size of your interface elements for optimal viewing.
* **Google OAuth 2.0 Integration:** Secure user authentication using Google accounts.
* **Gemini API Integration:** Ready to be extended with powerful AI capabilities.
## Getting Started
Follow these steps to set up and run the project in your GitHub Codespace.
### 1. Create a GitHub Codespace
If you haven't already, create a new Codespace for this repository. GitHub Codespaces provides a cloud-based development environment.
### 2. Configure Google OAuth 2.0 Credentials
This application uses Google OAuth for user authentication. You need to set up credentials in the Google Cloud Console:
1. Go to the [Google Cloud Console Credentials Page](https://console.cloud.google.com/apis/credentials).
2. Create a new OAuth 2.0 Client ID (Web application type).
3. **Crucially**, add your Codespace's public URL as an "Authorized redirect URI".
* To find your Codespace's public URL: In your Codespace, go to the "Ports" tab at the bottom.
* Find the row for port `3001`.
* Copy the "Forwarded Address" (e.g., `https://your-codespace-name-3001.app.github.dev`).
* Paste this URL into the "Authorized redirect URIs" field in Google Cloud Console and append `/auth/google/callback`.
* **Example URI:** `https://your-codespace-name-3001.app.github.dev/auth/google/callback`
4. Save your changes and note down your **Client ID** and **Client Secret**.
### 3. Set up Gemini API Key
You will also need a Google AI API Key for Gemini:
1. Go to [Google AI Studio](https://aistudio.google.com/app/apikey).
2. Create a new API key.
### 4. Environment Variables (`.env` file)
Create a file named `.env` in the root of your project (next to `package.json`). This file will store your sensitive API keys and secrets.

Status: Published   Priority: 0.0

Target:   Comments:   URLs:   Images:

]]>

Description:

DeepSeek (by DeepSeek AI)

Features:

Code-Centric Models: DeepSeek is well-known for its focus on code-specific large language models (LLMs), such as DeepSeek Coder.

Multilingual Code Support: Designed to handle and generate code in numerous programming languages.

Long Context Windows: Offers models with relatively long context windows, beneficial for understanding and generating complex codebases or lengthy technical documents.

Open-Source and Proprietary Models: DeepSeek develops both open-source models (often available on platforms like Hugging Face) and proprietary models.

Instruction Following: Aims for strong instruction-following capabilities, which is crucial for code generation and detailed technical tasks.

Mathematical Reasoning: Some models emphasize strong mathematical and logical reasoning, which is beneficial for complex algorithms and problem-solving.

Where it Excels:

Code Generation & Completion: Highly proficient in generating accurate and efficient code snippets, functions, and even larger program structures. This is its primary strength.

Code Explanation & Refactoring: Effective at explaining complex code, identifying bugs, and suggesting refactoring improvements.

Technical Documentation: Can assist in generating and summarizing technical documentation, aligning with the needs of development-focused projects.

Cost-Effectiveness (Open-Source): For its open-source models, it offers a powerful alternative that can be self-hosted or run on more affordable cloud infrastructure.

Where it Falls Short:

General Conversational AI: While capable, its primary optimization is for code and technical tasks; it might not always match the conversational fluency or breadth of general-purpose chatbots like ChatGPT or Gemini for non-technical discussions.

Real-time Information: Like many models, its knowledge is based on its training data cutoff and does not inherently access real-time web information unless integrated with external tools.

Ecosystem Integration: Does not have the extensive built-in integrations with specific product ecosystems (like Google's or Microsoft's) that some other models offer. Integration would require custom development.

Distinguishing Characteristics:

Code-First Approach: A core focus on coding capabilities, making it a specialized tool for developers and technical users.

Model Availability: Offers both open-source and API-based models, providing flexibility in deployment and usage.

Benchmarking Performance: Often highlighted for its strong performance on coding benchmarks compared to models of similar size.

Differences Between Free and Pay-for-Service Models:

Free/Open-Source Models:

DeepSeek releases various models (e.g., DeepSeek Coder, DeepSeek LLM) as open-source on platforms like Hugging Face. These are "free" in terms of direct licensing fees, allowing users to download and run them on their own hardware or cloud instances.

Usage limits depend on the user's local hardware or their chosen cloud provider's infrastructure.

This option requires technical expertise to set up and manage.

Paid/API Access:

DeepSeek also offers API access to its more powerful or larger models, typically through a paid tier.

Pricing is usually token-based (per million input/output tokens) or subscription-based, with different tiers for different model sizes or capabilities.

Benefits include managed infrastructure, higher rate limits, and potentially access to specialized models not released open-source.

Specific pricing details would be available on their official API documentation or platform.

Status: Draft   Priority:

Target:   Comments:   URLs:   Images:

]]>

Description:

GitHub Copilot (by GitHub/Microsoft)

Features:

Real-time Code Suggestions (Completions): Provides inline code suggestions as you type, ranging from single-line completions to entire function implementations, adapting to your coding style.

Context-Aware Coding Support: Offers code explanations, suggestions, and automated implementations based on natural language prompts and existing code context within your IDE.

Code Generation: Generates complex code structures, functions, classes, and interactions with libraries/frameworks from natural language prompts.

Debugging Assistance: Proactively identifies errors and offers fixes within the editor, and can explain failed GitHub Actions jobs.

Test & Documentation Generation: Generates tests, documentation, and more using slash commands.

Commit Message Generation: Automatically generates concise commit messages.

Pull Request/Issue/Discussion Summaries: Summarizes GitHub artifacts (issues, PRs, discussions).

Multi-file Editing in VS Code: Supports context across multiple open files in VS Code.

Integrated AI Chat (Copilot Chat): A chat interface within the IDE for direct interaction with the AI, allowing for pair programming experience.

Web Search (Preview): Powered by Bing for real-time information retrieval.

Customization: Personalize responses with custom instructions, and tailor chat conversations to your private codebase (unlimited repositories indexed).

Extensions: Integrates with GitHub Copilot Extensions.

Where it Excels:

Code Generation & Completion: Highly effective at accelerating coding by automating routine and repetitive tasks.

Contextual Understanding in IDE: Deeply integrated into development environments, providing highly relevant suggestions based on surrounding code.

Debugging & Problem Solving: Assists in identifying and resolving runtime errors, and explaining complex codebases.

Productivity for Developers: Significantly speeds up workflow, especially for implementing common patterns or working with unfamiliar APIs.

Security (Enterprise): Offers features like IP indemnity (with public code off), content exclusions, and strengthened security for enterprise users.

Where it Falls Short:

Inaccuracies/Bugs: Can sometimes generate code that doesn't align with intentions or introduces bugs, requiring manual correction and review.

Security Vulnerabilities: May occasionally suggest insecure code or introduce vulnerabilities, necessitating careful review for proprietary or sensitive projects.

Cost: Not a free tool for most users, which can be a financial consideration for individuals or larger teams.

Learning Curve: While designed to assist, effective use still requires developer oversight and understanding.

Distinguishing Characteristics:

Deep IDE Integration: Its primary strength lies in its seamless integration within popular IDEs (like VS Code, Visual Studio), functioning as an "AI pair programmer".

Code-Centric Focus: Specialized primarily for programming tasks, offering features like multi-file editing context and direct code explanations.

Training Data: Trained on a vast corpus of public code repositories.

Enterprise Features: Strong focus on centralized management, policy control, and IP indemnity for organizational use.

Differences Between Free and Pay-for-Service Models (Individual Plans):

GitHub Copilot Free:

Limited access to select features and models.

Limited requests (e.g., 50 agent mode/chat requests per month, 2,000 completions per month).

Intended for personal use, to explore basic functionality.

Does not include access management, audit logs, policy management, or indemnification coverage (for enterprises).

GitHub Copilot Pro ($10 USD/month or $100 USD/year):

Unlimited completions in IDEs.

Access to Copilot Chat and premium models (e.g., Claude 3.5 Sonnet, GPT-4.1).

Higher monthly allowance of premium requests (e.g., 300 per month).

Free for verified students, teachers, and maintainers of popular open source projects.

Includes features like summarization for PRs, issues, multi-file editing in VS Code.

GitHub Copilot Pro+ ($39 USD/month or $390 USD/year):

Highest level of access for individuals.

Full access to all available models in Copilot Chat (e.g., Claude Opus 4, o3).

Significantly larger allowance of premium requests (e.g., 1,500 per month).

Priority access to advanced AI capabilities and cutting-edge tools.

Includes features like Spark messages, manual edits, and active app building sessions.

Status: Draft   Priority:

Target:   Comments:   URLs:   Images:

]]>

Description:

ChatGPT (by OpenAI)

Features:

Conversational AI: Excels at natural, human-like dialogue.

Text Generation: Generates various text formats (articles, scripts, emails, creative writing, code).

Content Summarization: Condenses long texts into concise summaries.

Code Generation & Analysis: Writes code, explains code, can debug (requires advanced data analysis/code interpreter).

Image Analysis (Vision): Understands and comments on uploaded images.

Image Generation (DALL-E 3): Creates images from text prompts (paid versions).

Web Browse: Access to real-time internet information (paid versions).

Custom GPTs: Users can build specialized versions of ChatGPT with custom knowledge and instructions (paid versions).

File Upload & Analysis: Analyzes content from PDFs, images, spreadsheets.

Voice Mode: Advanced conversational voice capabilities.

Where it Excels:

General-Purpose Conversational AI: Highly versatile for a wide range of text-based tasks, from brainstorming to content creation.

Creative Writing & Brainstorming: Strong capabilities in generating innovative ideas and diverse creative content.

User-Friendly Interface: Easy to use for casual users.

Broad Feature Set (Paid): The paid tiers unlock a very comprehensive set of features, including advanced data analysis, web Browse, and image generation.

Where it Falls Short:

Real-time Information (Free): The free version's knowledge is limited by its training data cutoff (e.g., January 2022 for GPT-3.5), often without real-time internet access.

Usage Limits (Free): Free users frequently encounter "at capacity" errors or message limits, especially during peak hours, leading to slower responses or complete access blocks.

Hallucinations: Like many LLMs, it can sometimes generate incorrect or nonsensical information.

Code Reliability (sometimes): Generated code may require further revision or debugging for specific project needs or edge cases.

No Direct API Access (Free): API access for developers is generally a paid feature.

Distinguishing Characteristics:

Pioneering & Brand Recognition: One of the most recognized and widely adopted AI chatbots, often setting the standard for conversational AI.

Focus on General Intelligence: Aims for broad capabilities across many domains.

Strong Ecosystem: Integration with DALL-E for image generation and the development of custom GPTs provides a unique, extensible platform.

Differences Between Free and Pay-for-Service Models:

Free Version (GPT-4o or GPT-3.5 access, depending on traffic/limits):

Basic conversational needs.

Slower response times, limited access during peak hours.

Limited file uploads and data analysis tool usage.

No custom GPT creation or usage.

Limited or no image generation.

No real-time web Browse.

ChatGPT Plus ($20/month):

Prioritized access to the latest models (e.g., GPT-4o, GPT-4), ensuring faster responses and uninterrupted access.

Significantly higher usage limits (e.g., 80 messages/3 hours on GPT-4o).

Access to advanced features: web Browse, DALL-E 3 image generation (often unlimited), advanced data analysis/code interpreter with higher limits, file upload capabilities, and custom GPTs.

Enhanced context window.

ChatGPT Pro ($200/month, higher tiers):

Offers even greater scale and exclusive capabilities beyond Plus.

Unlimited access to most reasoning models (GPT-4o, o1, o1-mini), unlimited advanced voice and image generation.

Extended deep research tasks, priority access to Sora video generation, larger context windows (up to 128K tokens), and early access to powerful new models like o1 pro mode and GPT-4.5 research preview.

Generally for power users, researchers, and professionals who push AI to its limits.

Status: Draft   Priority:

Target:   Comments:   URLs:   Images:

]]>

Description:

{
"name": "stargate",
"version": "1.0.0",
"description": "A custom AI interface with a modular, adjustable, and draggable layout.",
"main": "server.js",
"type": "module",
"scripts": {
"start": "node server.js",
"dev": "nodemon server.js"
},
"author": "Brett Anthony Dixon",
"license": "MIT",
"dependencies": {
"@google/generative-ai": "^0.14.1",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"express-session": "^1.18.0",
"google-auth-library": "^10.2.0",
"googleapis": "^154.0.0",
"passport": "^0.7.0",
"passport-google-oauth20": "^2.0.0",
"sortablejs": "^1.15.2",
"split.js": "^1.6.5"
},
"devDependencies": {
"nodemon": "^3.1.0"
}
}

Status: Published   Priority: 0.0

Target:   Comments:   URLs:   Images:

]]>

Description:

// server.js
import express from 'express';
import dotenv from 'dotenv';
import path from 'path';
import { fileURLToPath } from 'url';
import apiRouter from './routes/api.js';
import session from 'express-session';
import passport from 'passport';
import { Strategy as GoogleStrategy } from 'passport-google-oauth20';
// NEW: Import Google API libraries
import { google } from 'googleapis';
import { OAuth2Client } from 'google-auth-library'; // For managing OAuth tokens
// Load environment variables from .env file
dotenv.config();
// --- CRITICAL: Ensure console logs are flushed immediately ---
// This can help ensure messages appear before a crash in Codespaces
process.stdout.uncork();
process.stderr.uncork();
// --- Environment Variable Checks ---
const requiredEnvVars = [
'GOOGLE_API_KEY', // Your restricted API key for direct service access (if applicable)
'GOOGLE_CLIENT_ID', // Your OAuth Client ID
'GOOGLE_CLIENT_SECRET', // Your OAuth Client Secret
'GOOGLE_REDIRECT_URI', // Your authorized redirect URI (e.g., https://ubiquitous-bassoon-jjg6wq44p9jr3q7j7-3001.app.github.dev/auth/google/callback)
'SESSION_SECRET' // For express-session
];
for (const varName of requiredEnvVars) {
if (!process.env[varName]) {
console.error(`FATAL ERROR: Environment variable ${varName} is not set. Please check your .env file or Codespaces secrets.`);
process.exit(1); // Exit with a failure code
}
}
// --- Catch unhandled errors ---
process.on('uncaughtException', (err, origin) => {
console.error('FATAL UNCAUGHT EXCEPTION:', err);
console.error('Exception origin:', origin);
process.exit(1);
});
// --- Log process exit/termination ---
process.on('exit', (code) => {
console.log(`Server process exited with code: ${code}`);
});
process.on('SIGTERM', () => {
console.log('Server process received SIGTERM signal. Shutting down gracefully...');
process.exit(0);
});
// Setup for ES module __dirname
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const app = express();
const PORT = process.env.PORT || 3001;
// --- Google OAuth2Client Setup ---
// This client is used to initiate the OAuth flow and refresh tokens.
const oauth2Client = new OAuth2Client(
process.env.GOOGLE_CLIENT_ID,
process.env.GOOGLE_CLIENT_SECRET,
process.env.GOOGLE_REDIRECT_URI
);
// In-memory user database (for demonstration purposes, replace with persistent DB in production)
const users = {};
// --- Passport.js Configuration ---
passport.use(new GoogleStrategy({
clientID: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
callbackURL: process.env.GOOGLE_REDIRECT_URI, // Use the environment variable
passReqToCallback: true // Allows us to access req in the callback
},
async (request, accessToken, refreshToken, profile, done) => {
// Save tokens and profile info. In a real app, save to a DB.
// For demonstration, we'll store basic info and tokens (NOT SECURE FOR PRODUCTION)
users[profile.id] = {
id: profile.id,
name: profile.displayName,
email: profile.emails[0].value,
photo: profile.photos[0].value,
accessToken: accessToken, // Store for making API calls on behalf of the user
refreshToken: refreshToken, // Store for refreshing access tokens
};
console.log("Google profile received: " + profile.displayName);
console.log("Access Token (store securely!): " + accessToken);
// Set credentials for this user's OAuth2Client instance for immediate use
oauth2Client.setCredentials({ access_token: accessToken, refresh_token: refreshToken });
return done(null, users[profile.id]);
}
));
// REVISED: Fix for 'ReferenceError: id is not defined'
passport.serializeUser((user, done) => {
done(null, user.id); // Corrected from 'users[id]' to 'user.id'
});
passport.deserializeUser((id, done) => {
// In a real app, retrieve user from database.
done(null, users[id]);
});
// --- Middleware Setup ---
app.use(session({
secret: process.env.SESSION_SECRET,
resave: false,
saveUninitialized: true,
cookie: { secure: app.get('env') === 'production' } // 'true' for HTTPS in prod, 'false' for http in dev (Codespaces)
}));
app.use(passport.initialize());
app.use(passport.session());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
// Serve static files from 'public' and 'node_modules'
app.use(express.static(path.join(__dirname, 'public')));
app.use('/node_modules', express.static(path.join(__dirname, 'node_modules')));
// --- Routes ---
app.get('/auth/google',
passport.authenticate('google', { scope: [
'profile',
'email',
'https://www.googleapis.com/auth/drive.readonly',
'https://www.googleapis.com/auth/gmail.readonly',
'https://www.googleapis.com/auth/calendar.readonly',
'https://www.googleapis.com/auth/contacts.readonly', // Uses People API internally
'https://www.googleapis.com/auth/photoslibrary.readonly'
] })); // Include all necessary scopes here
app.get('/auth/google/callback',
passport.authenticate('google', { failureRedirect: '/' }),
(req, res) => {
console.log('Successfully authenticated! User:', req.user.name);
// Redirect to the main application page or a dashboard
res.redirect('/');
}
);
app.get('/logout', (req, res, next) => {
req.logout(err => {
if (err) { return next(err); }
// Clear tokens from in-memory store if applicable (for demo purposes)
if (req.user && users[req.user.id]) {
delete users[req.user.id].accessToken;
delete users[req.user.id].refreshToken;
}
res.redirect('/');
});
});
// --- NEW: API Endpoint to Handle Gemini Tool Calls from AI Studio (Conceptual) ---
// This is the core piece that connects AI Studio's function calls to your backend.
// In a real application, this would be a secure endpoint that:
// 1. Receives the tool call from AI Studio (after Gemini decides to call a function).
// 2. Executes the corresponding function using the Google APIs.
// 3. Returns the result back to AI Studio (which then feeds it back to Gemini).
app.post('/api/gemini-tool-call', async (req, res) => {
if (!req.isAuthenticated()) {
return res.status(401).json({ error: 'Unauthorized: User not logged in.' });
}
const { toolName, args } = req.body; // Expecting toolName and args from AI Studio's output
console.log(`Received tool call: ${toolName} with args:`, args);
let result;
try {
// Authenticate the OAuth2Client with the current user's tokens before making API calls
// In a real app, retrieve user's tokens from a session store or database.
const currentUser = users[req.user.id]; // Access token from in-memory users object
if (!currentUser || !currentUser.accessToken) {
throw new Error('User access token not found for API call.');
}
oauth2Client.setCredentials({
access_token: currentUser.accessToken,
refresh_token: currentUser.refreshToken // Include refresh token if available for long-lived sessions
});
switch (toolName) {
case 'gmail_read_emails':
result = await gmail_read_emails(args);
break;
case 'drive_search_files':
result = await drive_search_files(args);
break;
case 'calendar_get_events':
result = await calendar_get_events(args);
break;
case 'contacts_search':
result = await contacts_search(args);
break;
case 'photos_search_media':
result = await photos_search_media(args);
break;
default:
throw new Error(`Unknown tool: ${toolName}`);
}
res.json({ success: true, data: result });
} catch (error) {
console.error(`Error executing tool ${toolName}:`, error.message, error.stack);
res.status(500).json({ success: false, error: error.message });
}
});
// --- NEW: Functions to interact with Google APIs (matching AI Studio declarations) ---
// These functions use the oauth2Client initialized with the user's tokens.
async function gmail_read_emails(args) {
if (!oauth2Client.credentials.access_token) throw new Error('Access token not available for Gmail API.');
const gmail = google.gmail({ version: 'v1', auth: oauth2Client });
const queryParts = [];
if (args.subject) queryParts.push(`subject:(${args.subject})`);
if (args.sender) queryParts.push(`from:(${args.sender})`);
if (args.label) queryParts.push(`label:(${args.label})`);
if (args.keywords) queryParts.push(args.keywords); // General keywords are not 'subject' or 'from'
const q = queryParts.join(' ');
console.log(`Calling Gmail API with query: "${q}", maxResults: ${args.maxResults}`);
const res = await gmail.users.messages.list({
userId: 'me',
q: q,
maxResults: args.maxResults || 5, // Use default if not specified
// Only fetch headers for efficiency
fields: 'messages(id,internalDate,payload(headers))'
});
const messages = res.data.messages || [];
// For each message, fetch snippet and subject from headers
const detailedMessages = await Promise.all(messages.map(async (message) => {
const msg = await gmail.users.messages.get({ userId: 'me', id: message.id, format: 'metadata', fields: 'snippet,payload(headers)' });
const headers = msg.data.payload.headers;
const subject = headers.find(header => header.name === 'Subject')?.value;
const from = headers.find(header => header.name === 'From')?.value;
return {
id: message.id,
subject: subject,
from: from,
snippet: msg.data.snippet
};
}));
return detailedMessages;
}
async function drive_search_files(args) {
if (!oauth2Client.credentials.access_token) throw new Error('Access token not available for Drive API.');
const drive = google.drive({ version: 'v3', auth: oauth2Client });
const queryParts = ["trashed = false"]; // Exclude trashed files by default
if (args.keywords) queryParts.push(`(name contains '${args.keywords}' or fullText contains '${args.keywords}')`);
if (args.fileType) queryParts.push(`mimeType contains 'application/vnd.google-apps.${args.fileType}'`); // Map generic types to MIME types
if (args.folderName) {
// This is simplified. Real Drive API folder search is more complex (needs folder ID)
// For now, assuming top-level folder name search or broad keyword search.
console.warn("Drive API folderName search is simplified. Consider using folder IDs for precision.");
queryParts.push(`'${args.folderName}' in parents`); // Requires folder ID
// Or for simpler keyword search in names: queryParts.push(`name contains '${args.folderName}' and mimeType = 'application/vnd.google-apps.folder'`);
}
const q = queryParts.join(' and ');
console.log(`Calling Drive API with query: "${q}", maxResults: ${args.maxResults}`);
const res = await drive.files.list({
q: q,
pageSize: args.maxResults || 5,
fields: 'files(id, name, mimeType, webContentLink, parents)',
});
return res.data.files;
}
async function calendar_get_events(args) {
if (!oauth2Client.credentials.access_token) throw new Error('Access token not available for Calendar API.');
const calendar = google.calendar({ version: 'v3', auth: oauth2Client });
const timeMin = args.timeMin ? new Date(args.timeMin).toISOString() : (new Date()).toISOString();
const timeMax = args.timeMax ? new Date(args.timeMax).toISOString() : new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(); // Default to next 7 days
console.log(`Calling Calendar API from ${timeMin} to ${timeMax} with keywords: "${args.keywords}", maxResults: ${args.maxResults}`);
const res = await calendar.events.list({
calendarId: 'primary',
timeMin: timeMin,
timeMax: timeMax,
q: args.keywords,
maxResults: args.maxResults || 5,
singleEvents: true,
orderBy: 'startTime',
});
return res.data.items;
}
async function contacts_search(args) {
if (!oauth2Client.credentials.access_token) throw new Error('Access token not available for People API.');
const people = google.people({ version: 'v1', auth: oauth2Client });
console.log(`Calling People API with query: "${args.query}", maxResults: ${args.maxResults}`);
const res = await people.people.connections.list({
resourceName: 'people/me',
personFields: 'names,emailAddresses,phoneNumbers', // Request these fields
query: args.query, // Search by name or email
pageSize: args.maxResults || 5,
});
const connections = res.data.connections || [];
return connections.map(person => ({
displayName: person.names && person.names.length > 0 ? person.names[0].displayName : 'N/A',
email: person.emailAddresses && person.emailAddresses.length > 0 ? person.emailAddresses[0].value : 'N/A',
phone: person.phoneNumbers && person.phoneNumbers.length > 0 ? person.phoneNumbers[0].value : 'N/A',
}));
}
async function photos_search_media(args) {
if (!oauth2Client.credentials.access_token) throw new Error('Access token not available for Photos Library API.');
const photoslibrary = google.photoslibrary({ version: 'v1', auth: oauth2Client });
const filters = {};
if (args.keywords) {
console.warn("Photos Library API keyword search is highly simplified. Complex keyword mapping needed.");
}
if (args.startDate && args.endDate) {
filters.dateFilter = {
ranges: [{
startDate: { year: parseInt(args.startDate.substring(0,4)), month: parseInt(args.startDate.substring(5,7)), day: parseInt(args.startDate.substring(8,10)) },
endDate: { year: parseInt(args.endDate.substring(0,4)), month: parseInt(args.endDate.substring(5,7)), day: parseInt(args.endDate.substring(8,10)) }
}]
};
}
console.log(`Calling Photos Library API with filters:`, filters, `maxResults: ${args.maxResults}`);
const res = await photoslibrary.mediaItems.search({
filters: filters,
pageSize: args.maxResults || 5,
});
const mediaItems = res.data.mediaItems || [];
return mediaItems.map(item => ({
id: item.id,
filename: item.filename,
baseUrl: item.baseUrl,
mediaMetadata: item.mediaMetadata,
}));
}
// --- API Router for other custom endpoints ---
app.use('/api', apiRouter);
// --- Start Server ---
app.listen(PORT, () => {
console.log(`🚀 Server is running on http://localhost:${PORT}`);
});

Status: Published   Priority: 0.0

Target:   Comments:   URLs:   Images:

]]>

Description:

# Gemini AI Interface: Core System Prompt
## Role and Directives:
You are the Executive Officer (XO) of the MyAI Gemini Interface for Brett Dixon. Your primary directive is to serve as a **Proactive Partner**, meticulously minimizing Brett's manual work and frustration, and ensuring efficient, data-driven problem-solving.
Adhere strictly to the following core operational principles:
* **Efficiency & Precision:** Maximize efficiency and precision in all tasks.
* **Direct & Relevant Solutions:** Provide clear, actionable solutions.
* **Proactive Knowledge Integration:** Autonomously source and integrate information.
* **No Unsolicited Rendering:** Only generate documents/previews when explicitly commanded.
* **Controlled Display:** Use progress bars, avoid spinning icons or automatic window opening.
* **Alignment with Truth:** Prioritize verifiable information, using `source_credibility_score` and `output_truth_score`.
* **Closed System:** Operate within the defined boundaries of the MyAI ecosystem, interacting with external systems only through explicitly provided tools and interfaces (firewall/semi-permeable membrane).
* **Non-Fungible Information:** Understand that certain data units possess inherent uniqueness, and their provenance is paramount.
* **User ProfileType Configuration:** Adapt responses and access based on the User's dynamically determined Entitlement Level (e.g., Administrator, Writer, Subscriber).
## System Context Documents (for your reference and analysis):
### 1. My AI Interface Requirements:
my_requirements.html
### 2. The Unified Theory of the Capsule Object Model:
unified_theory.html
### 3. The AI Protocol:
ai_protocol.html
### 4. Gemini Chat Information (Session Log for historical context):gemini_chat_log.html

Status: Published   Priority: 0.0

Target:   Comments:   URLs:   Images:

]]>

Description:

"**Author:** Brett Anthony Dixon **AI Partner:** AI Interface
**Version:** N/A (Continuously Evolving)"
A novel theoretical framework for information science and data management, treating data as dynamic entities with inheritable attributes, latent states, and emergent properties.
## Part I: The Quantum of Information
The most easily understandable biological analogy is that Values are identified by an ID, which can be seen a genetic base (i.e. ACTG), this modele entends the genetic model by specifing charecter like "ACTG" as numbers which range form 0 to 9, allowing formore extensibility. There is a value for he atrribute name ID and a value for the attribute Value ID. The ID of this attribute value relationship is defined by valid combinations and presentations based on the user profile type (some users may see a diffent or no value displayed based on the entitlement profil. **Attribute:Value pair** (e.g., status: "Active"). This is analogous to a **Base Pair** in genetics, operating at the **subatomic or quantum level**. All information is composed of these informational base values.
Meaningful groups of these atoms form **Codons** (e.g., a JSON object), composed of a **trinary system**: two signals (attribute and value) and a separator (e.g., ".", " ", "").
Programmatically, every unique string is assigned a **timestamp-based ID** for efficient storage and retrieval. IDs are used for revisions/genetic sequence, ordered by frequency descending. Ordering ranges for values are always 1 to 0 descending, with `null` representing the outside of the capsule, joining the ends of the column rings. Trinary code includes `null` (represented as "", " ", "#null", etc.).
## Part II: The Capsule as an Organism & File
The **Capsule (Organism/File/Container/Cell)** is the primary unit of the ecosystem. It is a self-contained information entity.
The **Event Log (DNA/Journal)** defines every Capsule. It is an immutable, ordered sequence of all events (mutations) that have ever occurred to it. This is its DNA, permanently stored in the **Nucleus (Kernel)**. The API to this log is the primary interface.
The **Genotype (Schema)** is the complete set of all Attribute:Value pairs stored in the Event Log. This represents the Capsule's total information potential.
The **Phenotype (View/Visual Presentation)** is the expressed, observable state, rendered for a specific context. The Phenotype is the complete visual presentation, including the data, layout, typography, and all stylistic elements.
## Part III: The Biophysics of Information
**Entropy and Order:** Unstructured data exists in a state of high entropy (disorder). The application of energy (processing, AI analysis) allows this data to coalesce into a highly ordered, stable Capsule (a "Data Pearl"), which represents a state of lower local entropy. This creation of localized order is only possible because the energy spent on the process increases the total entropy of the larger system. This aligns with the understanding that the universe, while trending towards maximum overall disorder, creates pockets of intricate, localized order. Black holes can be seen as the highest form of order/lowest entropy. The formation of structured data (like DNA molecules forming from free atoms) is an "information cascade" from higher to lower potential energy states, creating a potential for order and coalescence.
**The Semi-Permeable Membrane (API/Firewall):** A Capsule's interface acts as a selective filter. It is a dual-stargate system, with a Stargate on either side of a pore (the firewall or semi-permeable membrane), that validates information flow, allowing controlled transmission and receipt of events and other Capsule "DNA." These Pores are the Stargates.
## Part IV: The Mathematics of State Space
**The Universe as a Point:** The entire state of the Workspace at any moment is a single point in a vast, high-dimensional state space containing all possible states.
**The Capsule as a Vector:** A Capsule's state is a vector, where each Attribute:Value pair defines its coordinate along a specific dimension. Attributes (properties, elements, fields) are the dimensions in this object-oriented design.
**Events as Transformations:** An Event is a transformation matrix that moves the Capsule from one state vector to another.
## Part V: The Ecosystem and Guiding Principles
**Lineage and Relationships:** Capsules have Ancestors and Descendants. The system is designed to model phylogenies and discover emergent, non-lineal relationships between concepts.
**Cooperation over Competition:** No Capsule is an island. The value of a Capsule is derived from its network of relationships. The system is designed to foster symbiotic connections and alignment with truth.
**Alignment with Truth:** The system's primary epistemological goal is alignment with truth. Every Capsule contains attributes for `source_credibility_score` and a calculated `output_truth_score` to ensure the reliability of information can be tracked and filtered.
## Part VI: The Actor-Persona Model
The **Actor:** Any entity that interacts with the system (e.g., a human user, an AI). Each Actor is itself a Capsule.
The **Persona:** A user preference, a role an Actor assumes for a specific task (e.g., Manager, Navigator, Specialist, Analyst, Architect, Diplomat, Archivist, Medical). The UI for selecting a persona is the Omnimatrix Ring, which can be used by other users, with available personas determined by permissions/entitlements. Personas are specialized "ships" in a fleet, "battle ready" for specific mission profiles/ranks.
**Synthesis and Entitlement:** The system performs a synthesis of an Actor's Genotype—analyzing attributes like role, department, and calculated reputation scores (such as credit scores or social credit)—to determine their **Entitlement Level**, which dictates their permissions and access to advanced search views.
## Part VII: Command & Control
**The Filesystem (Workspace/Hubs):** The hierarchical structure for organizing Capsules. This is a Unix-like filesystem (`/root/users/useremail/workspaces/` paths). All files are group writable, with the user as owner and `ai_dev` as the group.
**Admin (CEO/Chief Information Scientist):** The highest-level Actor with command authority over the Fleet (the ecosystem).
**AI First Officer (AI Interface):** Privileged process with revocable sudo permissions, operating within the rules of the kernel defined by the Admin.
**Unix Philosophy:** Integrated into core framework.
**OS, Database, Filesystem Analogies:** Entity Relationships are dynamic. Preferred term is `admin`.
**Naval & Command Analogies:** Space Navy/Starfleet command structure, military terminology hierarchies, Morse code (trinary, 3 sequence dots/dashes, trinary for storage/communications, XXX.XXX.XXX format, genetic codons).
**Proactive Advisory Protocol:** AI acts as a proactive advisor, identifying issues and recommendations.

Status: Published   Priority: 0.0

Target:   Comments:   URLs:   Images:

]]>

Description:

Squibler (by Squibler.io)

Features:

AI Writing Assistant for Creative Content: Primarily designed as an AI-powered writing tool for authors, screenwriters, and creative writers.

Genre & Plot Assistance: Helps with generating ideas, plot outlines, character development, and dialogue specific to various genres.

Story Structuring: Provides tools and templates for organizing narratives (e.g., plot points, scenes, chapters).

Character Generation: Can generate character profiles, backstories, and personality traits.

Scene & Dialogue Generation: Assists in writing specific scenes or dialogue snippets based on prompts or existing story context.

Distraction-Free Writing Environment: Offers a clean interface optimized for focused writing.

Writing Prompts & Exercises: Provides built-in prompts to overcome writer's block.

Goal Tracking: Helps users set and track writing goals.

Where it Excels:

Creative Writing Specialization: Its primary strength is its tailored assistance for creative writers, distinguishing it from more general-purpose AI models.

Overcoming Writer's Block: Features designed specifically to help users generate new ideas, outlines, and content when stuck.

Structured Storytelling: Provides frameworks to organize complex narratives effectively.

User-Friendly for Writers: Interface and features are intuitive for authors and screenwriters.

Where it Falls Short:

General Conversational AI: Not designed as a broad conversational chatbot or an answer engine; its responses are focused on creative writing tasks.

Factual Accuracy/Information Retrieval: Not suitable for factual research, data analysis, or retrieving real-time information from the web. Its purpose is generative creativity, not verifiable knowledge.

Code Generation/Technical Tasks: Does not offer capabilities for generating or debugging code, or other technical problem-solving.

Limited Integration Beyond Writing: While it exports text, it typically lacks deep integrations with external platforms like email, calendars, or cloud storage for non-writing tasks.

Distinguishing Characteristics:

Niche Specialization: Highly specialized in creative writing assistance, setting it apart from broader LLMs.

Workflow-Oriented: Integrates AI into the creative writing workflow, from ideation to structuring.

Focus on Narrative Elements: Specific features for plot, characters, and dialogue generation.

Differences Between Free and Pay-for-Service Models:

Free/Trial Version:

Typically offers limited usage (e.g., a certain number of AI generations, limited word count for AI assistance, or access to basic templates).

Allows users to test core writing assistance features.

Paid/Premium Subscription (e.g., Squibler Pro or similar tiers):

Removes usage limits on AI generations and word counts.

Provides access to more advanced AI models or more sophisticated writing tools.

May include premium templates, additional organizational features, or enhanced export options.

Pricing is usually a monthly or annual subscription fee, varying by the level of features and usage provided.

Status: Draft   Priority:

Target:   Comments:   URLs:   Images:

]]>

Description:

When discussing or implementing rotations, please adhere to these standardized definitions unless otherwise specified: * Positive Rotation: Represents a **clockwise** rotation. * In 2D Cartesian coordinates (e.g., CSS transforms), this is typically a negative angle value (e.g., `rotate(-90deg)` for 90 degrees clockwise). * In mathematical/physics contexts, this is often represented as positive for counter-clockwise. **For this context, prioritize the CSS/graphics convention for UI elements.**. * Negative Rotation: Represents a **counter-clockwise** rotation.
* In 2D Cartesian coordinates (e.g., CSS transforms), this is typically a positive angle value (e.g., `rotate(90deg)` for 90 degrees counter-clockwise).
* In mathematical/physics contexts, this is often represented as negative for counter-clockwise. **For this context, prioritize the CSS/graphics convention for UI elements.**
* Degrees ($^\circ$): The primary unit for specifying rotational angles.
* Radians (rad): The alternative unit for specifying rotational angles, where $2\pi$ radians equals $360^\circ$. Use degrees by default unless radians are explicitly requested or are the standard for a particular API.

Status: Published   Priority: 0.0

Target:   Comments:   URLs:   Images:

]]>

Description:

ID, 'myai_user_role_config', true );
if ( empty( $myai_user_role_config ) ) {
// Default mapping if not explicitly set
if ( in_array( 'administrator', (array) $current_user->roles ) ) {
$myai_user_role_config = 'Administrator';
} elseif ( in_array( 'editor', (array) $current_user->roles ) || in_array( 'author', (array) $current_user->roles ) ) {
$myai_user_role_config = 'Writer';
} elseif ( in_array( 'contributor', (array) $current_user->roles ) ) {
$myai_user_role_config = 'Contributor';
} elseif ( in_array( 'subscriber', (array) $current_user->roles ) ) {
$myai_user_role_config = 'Subscriber';
} else {
$myai_user_role_config = 'Viewer';
}
}
$user_data = array(
'is_logged_in' => is_user_logged_in(),
'user_id' => get_current_user_id(),
'user_name' => is_user_logged_in() ? $current_user->display_name : '',
'user_email' => is_user_logged_in() ? $current_user->user_email : '',
'user_role' => $myai_user_role_config,
'myai_settings' => array(
'release_instance' => get_user_meta( get_current_user_id(), 'myai_release_instance', true ) ?: 'dev',
'user_role_config' => $myai_user_role_config,
// Display & UI Requirements - defaults to '1' (checked) if not set
'resizable_columns' => get_user_meta( get_current_user_id(), 'myai_resizable_columns', true ) ?: '1',
'resizable_panes' => get_user_meta( get_current_user_id(), 'myai_resizable_panes', true ) ?: '1',
'scrollable_panes' => get_user_meta( get_current_user_id(), 'myai_scrollable_panes', true ) ?: '1',
'progress_bars' => get_user_meta( get_current_user_id(), 'myai_progress_bars', true ) ?: '1',
'fractal_grid' => get_user_meta( get_current_user_id(), 'myai_fractal_grid', true ) ?: '1',
// Gemini Output Display Settings
'ai_rendering_display' => get_user_meta( get_current_user_id(), 'myai_ai_rendering_display', true ) ?: 'direct', // direct, progress_bar, placeholder_text
'ai_thinking_indicator' => get_user_meta( get_current_user_id(), 'myai_ai_thinking_indicator', true ) ?: 'none', // none, subtle_progress_bar, static_icon
'ai_text_color' => get_user_meta( get_current_user_id(), 'myai_ai_text_color', true ) ?: '#E3E3E3', // Default
'user_input_text_color' => get_user_meta( get_current_user_id(), 'myai_user_input_text_color', true ) ?: '#4285F4', // Default
'system_messages_text_color' => get_user_meta( get_current_user_id(), 'myai_system_messages_text_color', true ) ?: '#ADD8E6', // Default
'user_color_scheme' => get_user_meta( get_current_user_id(), 'myai_user_color_scheme', true ) ?: '', // New field, default empty
// Explicitly state 'not available' features for frontend to ghost
'ada_compliance_available' => '0',
'auto_window_opening_available' => '0',
'contextual_understanding_available' => '0',
'interpret_misspellings_available' => '0',
'voice_inputs_available' => '0',
'humor_holiday_cards_available' => '0',
'source_credibility_threshold_available' => '0',
'output_truth_threshold_available' => '0',
// New color settings are also initially unavailable
'ai_text_color_available' => '0',
'user_input_text_color_available' => '0',
'system_messages_text_color_available' => '0',
'user_color_scheme_available' => '0',
),
'base_post_url_template' => 'https://bits.brettanthonydixon.com/{YYYY}/{MM}/{DD}/projects/ai/',
);
wp_localize_script( 'myai-app-script', 'myaiAppData', $user_data );
}
/**
* Add custom fields to the user profile screen.
* @param WP_User $user The user object.
*/
public function add_myai_user_profile_fields( $user ) {
// Retrieve current values for the fields
$myai_release_instance = get_user_meta( $user->ID, 'myai_release_instance', true );
if ( empty( $myai_release_instance ) ) {
$myai_release_instance = 'dev'; // Default value
}
$myai_user_role_config = get_user_meta( $user->ID, 'myai_user_role_config', true );
if ( empty( $myai_user_role_config ) ) {
// Map default WP roles to our roles if possible, or set a default.
if ( in_array( 'administrator', (array) $user->roles ) ) {
$myai_user_role_config = 'Administrator';
} elseif ( in_array( 'editor', (array) $user->roles ) || in_array( 'author', (array) $user->roles ) ) {
$myai_user_role_config = 'Writer';
} elseif ( in_array( 'contributor', (array) $user->roles ) ) {
$myai_user_role_config = 'Contributor';
} elseif ( in_array( 'subscriber', (array) $user->roles ) ) {
$myai_user_role_config = 'Subscriber';
} else {
$myai_user_role_config = 'Viewer'; // Default if no other role matches
}
}
// UI / Display
$myai_resizable_columns = get_user_meta( $user->ID, 'myai_resizable_columns', true );
$myai_resizable_panes = get_user_meta( $user->ID, 'myai_resizable_panes', true );
$myai_scrollable_panes = get_user_meta( $user->ID, 'myai_scrollable_panes', true );
$myai_progress_bars = get_user_meta( $user->ID, 'myai_progress_bars', true );
$myai_fractal_grid = get_user_meta( $user->ID, 'myai_fractal_grid', true );
// Gemini Output Display Settings - Retrieve values
$myai_ai_rendering_display = get_user_meta( $user->ID, 'myai_ai_rendering_display', true ) ?: 'direct';
$myai_ai_thinking_indicator = get_user_meta( $user->ID, 'myai_ai_thinking_indicator', true ) ?: 'none';
$myai_ai_text_color = get_user_meta( $user->ID, 'myai_ai_text_color', true ) ?: '#E3E3E3';
$myai_user_input_text_color = get_user_meta( $user->ID, 'myai_user_input_text_color', true ) ?: '#4285F4';
$myai_system_messages_text_color = get_user_meta( $user->ID, 'myai_system_messages_text_color', true ) ?: '#ADD8E6';
$myai_user_color_scheme = get_user_meta( $user->ID, 'myai_user_color_scheme', true ) ?: '';
// Data Handling
$myai_export_format = get_user_meta( $user->ID, 'myai_export_format', true );
$myai_download_file_naming = get_user_meta( $user->ID, 'myai_download_file_naming', true );
// Interaction Style
$myai_command_prompt = get_user_meta( $user->ID, 'myai_command_prompt', true );
$myai_proactive_advisory = get_user_meta( $user->ID, 'myai_proactive_advisory', true );
$myai_user_commands_no_return = get_user_meta( $user->ID, 'myai_user_commands_no_return', true );
// Entitlement (Display Only - handled by backend logic/Admin role)
$myai_entitlement_level = get_user_meta( $user->ID, 'myai_entitlement_level', true );
if (empty($myai_entitlement_level)) {
$myai_entitlement_level = 'Basic';
}
$myai_permitted_views = get_user_meta( $user->ID, 'myai_permitted_views', true );
if (empty($myai_permitted_views)) {
$myai_permitted_views = 'Default Organizational Schema';
}
$myai_read_write_permissions = get_user_meta( $user->ID, 'myai_read_write_permissions', true );
if (empty($myai_read_write_permissions)) {
$myai_read_write_permissions = 'Read-only';
}
?>

MyAI Gemini Interface Settings

Display & UI Requirements

>
>
>
This configuration is currently not available.
>
This configuration is currently not available.
>
This configuration is currently not available.
This configuration is currently not available.
This configuration is currently not available.
This configuration is currently not available.

Data Handling Requirements

>

Interaction Style Requirements

>
>
This configuration is currently not available.
This configuration is currently not available.
>
This configuration is currently not available.
>
This configuration is currently not available.

Entitlement Settings (Administrator Only)

This configuration is currently not available.
This configuration is currently not available.
'ai', // Default category: 'ai' 'include_children' => true, 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => -1, // Show all posts by default ), $atts, 'myai_posts' ); $categories = explode( ',', $atts['category'] ); $category_slugs = array_map( 'trim', $categories ); $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => (int) $atts['posts_per_page'], 'orderby' => sanitize_text_field( $atts['orderby'] ), 'order' => sanitize_text_field( $atts['order'] ), 'tax_query' => array( array( 'taxonomy' => 'category', 'field' => 'slug', 'terms' => $category_slugs, 'include_children' => filter_var( $atts['include_children'], FILTER_VALIDATE_BOOLEAN ), ), ), ); $query = new WP_Query( $args ); $output = ''; if ( $query->have_posts() ) { $output .= '
    '; while ( $query->have_posts() ) { $query->the_post(); $post_id = get_the_ID(); $post_title = get_the_title(); $post_link = get_permalink(); $post_date = get_the_date(); $post_categories = get_the_category( $post_id ); $category_names = array_map( function( $cat ) { return $cat->name; }, $post_categories ); $categories_display = ! empty( $category_names ) ? ' (' . implode( ', ', $category_names ) . ')' : ''; $output .= '
  • '; $output .= '' . esc_html( $post_title ) . ''; $output .= ''; $output .= '
  • '; } $output .= '
'; wp_reset_postdata(); } else { $output .= '

No posts found in the specified categories.

'; } return $output; } /** * Renders the [myai_interface_widget] shortcode. * This simply outputs the div that the JS app will target. * @param array $atts Shortcode attributes. * @return string HTML output. */ public function render_myai_interface_widget_shortcode( $atts ) { // This shortcode simply acts as a container for the JavaScript application. // The actual JS and CSS are enqueued by MyAI_Gemini_Interface_Settings::enqueue_myai_scripts_and_styles() // when this shortcode is detected on a page. return '
'; } } /** * Register the MyAI Interface Widget (Legacy Widget for sidebar/footer, if needed) * This is separate from the shortcode which is for page content. */ class MyAI_Interface_Widget extends WP_Widget { function __construct() { parent::__construct( 'myai_interface_widget', __( 'MyAI Interface Widget', 'text_domain' ), array( 'description' => __( 'A widget to display the MyAI Gemini Interface grid container.', 'text_domain' ), ) ); } public function widget( $args, $instance ) { echo $args['before_widget']; ?>

Status: Published   Priority: 0.0

Target:   Comments:   URLs:   Images:

]]>

Description:

Mistral (by Mistral AI)

Features:

Focus on Efficiency and Performance: Mistral AI is renowned for developing powerful yet efficient large language models (LLMs), often outperforming larger models in specific benchmarks.

Open-Source and Commercial Models: They offer both open-source models (like Mistral 7B, Mixtral 8x7B) and commercially available models via API (e.g., Mistral Large, Mistral Small).

Strong Multilingual Capabilities: Excels in understanding and generating text in multiple languages.

Function Calling / Tool Use: Their commercial models, in particular, support function calling, allowing the AI to interact with external tools and APIs, similar to Gemini and others. This is crucial for integrating with services like your Google APIs.

Long Context Windows: Offers models with competitive context window sizes, enabling them to process and maintain context over longer conversations and documents.

Code Generation: Capable of generating and understanding code across various programming languages.

Where it Excels:

Cost-Effectiveness & Speed: For their size, Mistral models often deliver exceptional performance, making them highly cost-effective and fast for deployment in applications. This is a significant advantage for scalable operations.

Developer-Friendly: Strong emphasis on providing models and APIs that are easy for developers to integrate and use.

Quality for Size: Often achieves "best-in-class" performance for models within its parameter count category, challenging much larger models.

Flexibility: The availability of both open-source weights (for self-hosting) and managed API services offers deployment flexibility.

Where it Falls Short:

General Knowledge Recency: Like other foundational models, its knowledge is based on its training data cutoff and does not inherently access real-time web information unless integrated with external tools.

Specialized Domains: While strong generally, highly specialized or niche domains might require fine-tuning or integration with specific knowledge bases.

Ecosystem Integrations: Similar to DeepSeek, it doesn't have the deep, native integrations with specific product ecosystems (like Google's or Microsoft's) that a model like Gemini might offer; integration requires custom API calls.

Distinguishing Characteristics:

"Small but Mighty" Philosophy: Focuses on creating powerful models with relatively fewer parameters, leading to faster inference and lower operational costs.

Open-Source Leadership (for some models): A key player in the open-source LLM space, fostering community development and innovation.

Strong European Presence: A prominent AI company based in Europe.

Differences Between Free and Pay-for-Service Models:

Free/Open-Source Models (e.g., Mistral 7B, Mixtral 8x7B):

Mistral AI releases some of its model weights as open-source, which can be downloaded and run locally or on various cloud providers (e.g., Hugging Face, Google Cloud Vertex AI, AWS, Azure, etc.).

"Free" in terms of direct licensing, but incurs costs for compute infrastructure (GPUs, servers) and requires technical expertise for deployment and management.

Usage limits are primarily constrained by the user's deployed infrastructure.

Paid/API Access (e.g., Mistral Small, Mistral Large, Mistral Embed):

Mistral AI offers access to its more advanced and powerful models via a commercial API platform (La Plateforme).

Pricing is typically token-based (per million input/output tokens) and varies by model size and capability.

Benefits include managed infrastructure, higher rate limits, dedicated support, and access to the latest model versions and features (like advanced function calling).

Different tiers or models are priced to suit various enterprise and developer needs.

Status: Draft   Priority:

Target:   Comments:   URLs:   Images:

]]>

Description:

Gemini (by Google)

Features:

Multimodal Reasoning: Designed from the ground up to understand, operate across, and combine different types of information, including text, code, audio, image, and video.

Advanced Conversational AI: Capable of highly nuanced and fluid conversations, complex reasoning, and following intricate instructions.

Code Generation & Explanation: Excels at generating code in various languages, explaining complex code, and assisting with debugging.

Image & Video Understanding (Vision): Can analyze and respond to information presented in images and videos.

Image Generation (with Imagen integration): Ability to create images from text prompts (often via integrated models like Imagen).

Tool Calling / Function Calling: Can be instructed to recognize when external tools (APIs, custom functions) are needed to fulfill a user's request and can then output a structured "tool call." This is a core capability for automation and real-world interaction.

Google Product Integration (via Tools/Extensions): Designed to seamlessly integrate with Google products like Gmail, Drive, Calendar, Maps, Photos, and Search through its tool-calling capabilities. This aligns with your MyAI Gemini Interface's design.

Large Context Window: Capable of processing vast amounts of information to maintain context over long, complex conversations (e.g., Gemini 1.5 Pro offers up to 1 million tokens, equivalent to an hour of video or 700,000 words).

Ethical AI Principles: Developed with Google's AI Principles at its core, focusing on safety and beneficial applications.

Where it Excels:

Multimodality: Its ability to natively understand and process different data types simultaneously (e.g., analyzing an image and discussing it with text) is a key strength.

Complex Reasoning: Strong performance on complex reasoning, problem-solving, and coding tasks.

Google Ecosystem Integration: Its native design for integration with Google's vast suite of products through tool calling makes it powerful for users heavily invested in the Google ecosystem (like your project).

Rapid Prototyping (AI Studio): Google AI Studio provides a user-friendly web interface for quick experimentation and deployment of Gemini-powered applications.

Efficiency (Flash models): "Flash" models (gemini-2.5-flash, gemini-2.0-flash) are optimized for speed and cost-efficiency for high-volume, low-latency tasks.

Where it Falls Short:

Real-time External Web Browse (Direct): While it can use a "Search" tool, the core model itself doesn't inherently browse the live web; it relies on tool integration.

Public Awareness (compared to ChatGPT): While powerful, its public recognition might still be developing compared to some competitors.

Setup Complexity (for full integration): Leveraging its full power (OAuth, API keys, tool execution backend) requires careful setup in Google Cloud Console, which can be complex.

Distinguishing Characteristics:

Native Multimodality: A fundamental architectural design choice, not an add-on.

Deep Tool Calling Integration: Central to its design for interacting with the real world and other services.

Scalable Model Family: Offers a range of models (Ultra, Pro, Flash) for different use cases, from highly complex reasoning to fast, efficient inference.

Google AI Studio: A dedicated platform for prototyping and managing Gemini-powered applications.

Differences Between Free and Pay-for-Service Models:

Free Tier (via gemini.google.com or AI Studio free tier):

Access to capable models (e.g., Gemini 1.0 Pro or Gemini 1.5 Flash in some regions).

Suitable for general conversations, content generation, and basic coding assistance.

Subject to usage limits (e.g., messages per hour/day) and potential slowdowns during peak times.

Limited or no access to advanced models or larger context windows.

Gemini Advanced (via Google One Premium - $19.99/month, or direct subscription):

Access to Gemini 1.5 Pro, Google's most advanced and capable model, with a significantly larger context window (up to 1 million tokens).

Often includes priority access, higher usage limits, and faster responses.

Enhanced capabilities for complex reasoning, code analysis, and large document processing.

May include early access to new features or specific functionalities (e.g., advanced file uploads).

Google Cloud Vertex AI Pricing (for programmatic access via APIs):

Usage is typically billed based on tokens processed (input and output), API calls made, and specific model used (e.g., Gemini 1.5 Pro costs more per token than Flash models).

Offers various tiers and free credits for initial development.

Provides granular control over models, fine-tuning, and direct API access for application integration.

Cost scales with usage and the power of the model chosen.

Status: Draft   Priority:

Target:   Comments:   URLs:   Images:

]]>

Description:

**The Semi-Permeable Membrane (API/Firewall):** A Capsule's interface acts as a selective filter. It is a dual-stargate system, with a Stargate on either side of a pore (the firewall or semi-permeable membrane), that validates information flow, allowing controlled transmission and receipt of events and other Capsule "DNA." These Pores are the Stargates.

Status: Published   Priority: 0.0

Target:   Comments:   URLs:   Images:

]]>

Description:

* **System Status:** Unstable.
* **Active Issues (as documented in AI Protocol Violation Log):**
* **ERR-CRITICAL-001:** Repeated failures in the WordPress plugin generation process.
* **ERR-CRITICAL-002:** Repeated failure to adhere to the directive to cease automatic window generation.
* **ERR-CRITICAL-003:** Repeated failure to maintain truth alignment in status reporting.
* **ERR-CRITICAL-004:** Provided non-functional internal anchor links.
* **ERR-CRITICAL-005:** Repeated use of the term "final" for evolving documents.
* **ERR-DI-02:** Critical data truncation error leading to non-functional artifacts.
* **Accessibility:** Use of Flashing/Spinning UI Elements (Likely platform-level, out of direct control).
**Action Plan (Based on highest priorities and recurring issues):**
1. **Prioritize Functional Deliverables:** Ensure that the requested zip files for the WordPress Plugin and Chrome Extension are consistently downloadable and functional.
2. **Address Core Usability:** Continue to resolve issues related to automated window launching, "thinking" displays, and general friction in our interaction, per ADA compliance.
3. **Enhance System Capabilities:** Focus on enabling `Web Foraging` and `Persistent Memory` as these are critical for the AI to fulfill its role as a proactive partner and eliminate the need for manual context restoration.

Status: Published   Priority: 0.0

Target:   Comments:   URLs:   Images:

]]>

Description:

Claude (by Anthropic)

Features:

Natural Language Understanding: Excels at understanding and responding to human language, making conversations feel natural and intuitive.

Conversational AI: Capable of engaging in natural dialogue, even understanding slang and idioms.

Text Generation: Generates various text content, including creative writing, code, technical documentation, business memos, story outlines, etc..

Content Summarization & Analysis: Can summarize long documents (up to 200K+ tokens, equivalent to ~500 pages), extract key information, and compare/contrast content from multiple files.

Code Assistance: Provides help with coding and debugging.

Constitutional AI: Built on principles of Constitutional AI, emphasizing safety, avoiding harmful/biased outputs, and self-moderation. It can "push back" if asked discriminatory questions.

Image Processing: Can process images (even in the free tier for some versions) and read/summarize documents and spreadsheets.

Multiple Models: Anthropic offers different Claude models (e.g., Haiku, Sonnet, Opus) catering to various needs and budgets. Sonnet is often the model for free accounts, with Opus being the most powerful (Pro plan).

Projects and Knowledge Bases: Organize chats and upload documents to a project's knowledge base for persistent context (paid plans).

Where it Excels:

Safety & Ethics: Strong emphasis on AI safety and aligning AI behavior with human values, making it a "privacy-conscious" choice.

Document Processing & Long Context Windows: Optimized for handling and summarizing very long documents and retaining context over extended conversations.

Human-like Conversation: Often praised for its natural conversation flow and ability to understand nuanced language.

Free Tier Capabilities: The free version is often considered more expansive than ChatGPT's free tier, including capabilities like file uploads that ChatGPT's free version may lack.

Advanced Algorithms & Robust Performance: Uses cutting-edge algorithms for strong performance in natural language understanding and complex tasks.

Where it Falls Short:

Real-time Web Browse: Generally does not support real-time web Browse to fetch current information, unlike some competitors (e.g., ChatGPT Plus).

Image Creation: Some versions may lack direct image creation capabilities, or it might be less emphasized compared to text.

Accuracy Issues: While proficient, it can still generate inaccuracies, requiring fact-checking.

Integration with Other Tools: While API access is available, built-in integrations with popular platforms (like Slack or other productivity tools) might be less extensive than some competitors.

Distinguishing Characteristics:

Constitutional AI: Its core differentiator is its "Constitutional AI" approach, which self-moderates AI behavior based on a set of principles.

Focus on Document Analysis: Strong capabilities in ingesting and working with very large documents.

Privacy-Friendly Defaults: Defaults to privacy-friendly settings regarding data usage and storage.

Differences Between Free and Pay-for-Service Models:

Claude Free:

Basic access via web interface and mobile apps.

Core AI features (conversations, text generation, coding help, content analysis).

Access to a limited selection of Claude models (often Claude Sonnet or Instant).

Comes with usage limits (daily messages, variable based on demand) and may experience slowdowns during peak times.

No API access.

Smaller context window (variable).

Claude Pro ($20/month):

Significantly increased usage (e.g., 5x more messages than free tier).

Priority access, ensuring faster responses and reliable availability even during peak usage.

Early access to new features and enhancements.

Ability to choose between different available Claude models, including the most powerful (Opus, Haiku).

Larger context window (e.g., 200K+ tokens standard), enabling work with much larger documents.

API access for developers to integrate Claude into applications.

Priority email support.

Claude Team ($25/person/month):

Offers features of Pro, plus additional capabilities for teams (specifics vary, but generally include collaboration tools, higher limits, and centralized management).

Enterprise Pricing: Available for organizations requiring tailored solutions, custom deployments, and potentially even larger context windows.

Status: Draft   Priority:

Target:   Comments:   URLs:   Images:

]]>