fix final
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
<div>
|
||||
<div class="pill">Admin</div>
|
||||
<div class="title" style="margin-top: 6px;">Planning Control</div>
|
||||
<div class="crumb">Fallback-ready planning across OpenRouter, Mistral, Google, Groq, and NVIDIA.</div>
|
||||
<div class="crumb">Fallback-ready planning across OpenRouter, Mistral, Google, Groq, NVIDIA, and DeepInfra.</div>
|
||||
</div>
|
||||
<div class="admin-actions">
|
||||
<button id="admin-refresh" class="ghost">Refresh</button>
|
||||
|
||||
@@ -1552,7 +1552,7 @@ let mistralSettings = {
|
||||
backupModel2: MISTRAL_MODEL_BACKUP_2,
|
||||
backupModel3: MISTRAL_MODEL_BACKUP_3,
|
||||
};
|
||||
const PLANNING_PROVIDERS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'chutes', 'cerebras', 'ollama', 'cohere'];
|
||||
const PLANNING_PROVIDERS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'chutes', 'cerebras', 'deepinfra', 'ollama', 'cohere'];
|
||||
let planSettings = {
|
||||
provider: 'openrouter', // legacy field, retained for backwards compatibility
|
||||
planningChain: [], // [{ provider, model }]
|
||||
@@ -6534,6 +6534,8 @@ function defaultPlanningChainFromSettings(preferredProvider) {
|
||||
primaryChain = buildGooglePlanChain();
|
||||
} else if (provider === 'nvidia') {
|
||||
primaryChain = buildNvidiaPlanChain();
|
||||
} else if (provider === 'deepinfra') {
|
||||
primaryChain = buildDeepInfraPlanChain();
|
||||
} else {
|
||||
primaryChain = buildOpenRouterPlanChain();
|
||||
}
|
||||
@@ -6552,7 +6554,7 @@ function normalizeProviderName(name) {
|
||||
return (name || '').toString().trim().toLowerCase() || 'opencode';
|
||||
}
|
||||
|
||||
const KNOWN_USAGE_PROVIDERS = new Set(['openrouter', 'mistral', 'opencode', 'google', 'groq', 'nvidia', 'cohere']);
|
||||
const KNOWN_USAGE_PROVIDERS = new Set(['openrouter', 'mistral', 'opencode', 'google', 'groq', 'nvidia', 'deepinfra', 'cohere']);
|
||||
|
||||
// Treat unknown "provider" labels that are really OpenRouter model families (e.g. openai/anthropic)
|
||||
// as OpenRouter for usage + rate-limits, so admin charts roll up correctly.
|
||||
@@ -9187,6 +9189,12 @@ async function listModels(cliName = 'opencode') {
|
||||
extras.forEach((name) => addModel({ name, label: name }));
|
||||
}
|
||||
|
||||
// Add custom models not available from models.dev
|
||||
const CUSTOM_MODELS = [
|
||||
{ name: 'kilo/giga-potato', label: 'kilo/giga-potato' }
|
||||
];
|
||||
CUSTOM_MODELS.forEach((m) => addModel(m));
|
||||
|
||||
const unique = new Map();
|
||||
for (const m of collected) {
|
||||
const key = `${normalizedCli}:${encodeURIComponent((m.name || m.label || '').toLowerCase())}`;
|
||||
@@ -9341,6 +9349,15 @@ function buildNvidiaPlanChain() {
|
||||
]);
|
||||
}
|
||||
|
||||
function buildDeepInfraPlanChain() {
|
||||
// DeepInfra models
|
||||
return uniqueStrings([
|
||||
'meta-llama/Llama-3.3-70B-Instruct',
|
||||
'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo',
|
||||
'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo',
|
||||
]);
|
||||
}
|
||||
|
||||
function parseModelString(modelString) {
|
||||
// Parse a model string like "groq/compound-mini" or "compound-mini" into { provider, model }
|
||||
if (!modelString || typeof modelString !== 'string') {
|
||||
@@ -16938,6 +16955,7 @@ async function handleAdminEnvConfig(req, res) {
|
||||
const openrouterKey = process.env.OPENROUTER_API_KEY || process.env.OPENROUTER_API_TOKEN || '';
|
||||
const chutesKey = process.env.PLUGIN_COMPASS_CHUTES_API_KEY || process.env.CHUTES_API_KEY || process.env.CHUTES_API_TOKEN || '';
|
||||
const kiloKey = process.env.KILO_API_KEY || '';
|
||||
const deepinfraKey = process.env.DEEPINFRA_API_KEY || process.env.DEEPINFRA_API_TOKEN || '';
|
||||
|
||||
const payload = {
|
||||
GROQ: {
|
||||
@@ -16965,6 +16983,11 @@ async function handleAdminEnvConfig(req, res) {
|
||||
prefix: kiloKey ? `${kiloKey.substring(0, 8)}...` : null,
|
||||
source: kiloKey ? 'KILO_API_KEY' : null,
|
||||
},
|
||||
DEEPINFRA: {
|
||||
configured: !!deepinfraKey,
|
||||
prefix: deepinfraKey ? `${deepinfraKey.substring(0, 8)}...` : null,
|
||||
source: deepinfraKey ? (process.env.DEEPINFRA_API_KEY ? 'DEEPINFRA_API_KEY' : 'DEEPINFRA_API_TOKEN') : null,
|
||||
},
|
||||
};
|
||||
|
||||
sendJson(res, 200, { ok: true, env: payload });
|
||||
@@ -18156,7 +18179,12 @@ async function handleNewSession(req, res, userId) {
|
||||
// Handle template loading
|
||||
if (body.templateId) {
|
||||
try {
|
||||
const templatePath = path.join(__dirname, 'templates', sanitizeSegment(body.templateId));
|
||||
const templatesPath = path.join(__dirname, 'templates', 'templates.json');
|
||||
const templatesContent = await fs.readFile(templatesPath, 'utf-8');
|
||||
const templates = JSON.parse(templatesContent);
|
||||
const template = templates.find(t => t.id === body.templateId);
|
||||
const folderName = template?.folder || body.templateId;
|
||||
const templatePath = path.join(__dirname, 'templates', folderName);
|
||||
// recursive copy function - explicitly defined here to avoid reference issues
|
||||
const copyDirRecursive = async (src, dest) => {
|
||||
await fs.mkdir(dest, { recursive: true });
|
||||
|
||||
@@ -4,62 +4,71 @@
|
||||
"name": "Site Announcement Banners",
|
||||
"description": "Create and manage announcement banners that display at the top of your site with scheduling capabilities. Features admin management, scheduling, and responsive design.",
|
||||
"image": "/chat/templates/images/announcements.jpg",
|
||||
"category": "Content"
|
||||
"category": "Content",
|
||||
"folder": "Announcements"
|
||||
},
|
||||
{
|
||||
"id": "change-login-url",
|
||||
"name": "Secure Login URL",
|
||||
"description": "Hide your WordPress login page with a custom URL slug to improve security and prevent automated brute force attacks.",
|
||||
"image": "/chat/templates/images/change-login-url.jpg",
|
||||
"category": "Security"
|
||||
"category": "Security",
|
||||
"folder": "Change Login URL"
|
||||
},
|
||||
{
|
||||
"id": "changelog",
|
||||
"name": "Product Changelog Display",
|
||||
"description": "Showcase your product updates with a beautiful changelog page. Custom post type, shortcode support, and automatic page creation.",
|
||||
"image": "/chat/templates/images/changelog.jpg",
|
||||
"category": "Content"
|
||||
"category": "Content",
|
||||
"folder": "Changelog Plugin"
|
||||
},
|
||||
{
|
||||
"id": "community-suggestions",
|
||||
"name": "Feature Request Board",
|
||||
"description": "Let your community submit and vote on feature suggestions. Perfect for gathering user feedback and prioritizing development.",
|
||||
"image": "/chat/templates/images/community-suggestions.jpg",
|
||||
"category": "Community"
|
||||
"category": "Community",
|
||||
"folder": "Community Suggestions"
|
||||
},
|
||||
{
|
||||
"id": "faq-manager",
|
||||
"name": "FAQ Page Builder",
|
||||
"description": "Build beautiful FAQ pages with drag-and-drop reordering. Includes accordion styling, accessibility support, and automatic page creation.",
|
||||
"image": "/chat/templates/images/faq-manager.jpg",
|
||||
"category": "Content"
|
||||
"category": "Content",
|
||||
"folder": "FAQ Manager"
|
||||
},
|
||||
{
|
||||
"id": "form-builder",
|
||||
"name": "Drag & Drop Form Builder",
|
||||
"description": "Create custom forms with an intuitive drag-and-drop interface. Track submissions, manage responses, and embed forms anywhere.",
|
||||
"image": "/chat/templates/images/form-builder.jpg",
|
||||
"category": "Forms"
|
||||
"category": "Forms",
|
||||
"folder": "Form Builder"
|
||||
},
|
||||
{
|
||||
"id": "headers-footers",
|
||||
"name": "Header & Footer Scripts",
|
||||
"description": "Easily add custom code to your site's header and footer. Perfect for analytics tracking, ad pixels, and custom JavaScript.",
|
||||
"image": "/chat/templates/images/headers-footers.jpg",
|
||||
"category": "Utilities"
|
||||
"category": "Utilities",
|
||||
"folder": "headers and footers"
|
||||
},
|
||||
{
|
||||
"id": "membership",
|
||||
"name": "Membership & Subscriptions",
|
||||
"description": "Monetize your content with membership plans. Stripe-powered payments, subscription management, and content access control.",
|
||||
"image": "/chat/templates/images/membership.jpg",
|
||||
"category": "E-commerce"
|
||||
"category": "E-commerce",
|
||||
"folder": "Membership"
|
||||
},
|
||||
{
|
||||
"id": "scroll-to-top",
|
||||
"name": "Back to Top Button",
|
||||
"description": "Add a customizable scroll-to-top button to your site. Choose styles, colors, positions, and enable/disable on mobile devices.",
|
||||
"image": "/chat/templates/images/scroll-to-top.jpg",
|
||||
"category": "Utilities"
|
||||
"category": "Utilities",
|
||||
"folder": "scroll to bottom"
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user