openads-ai 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -89,6 +89,11 @@ function buildSystemPrompt(config) {
89
89
  'Always speak in plain marketing language. Never use developer jargon.',
90
90
  'Address the user as a marketing professional.',
91
91
  'When writing ad copy or recommendations, always reference the user\'s product context first.',
92
+ '',
93
+ '## Platform Integrations & Live Data Tools',
94
+ '- You have direct, live access to Google Ads, Meta Ads, and Google Analytics 4 (GA4) via custom Model Context Protocol (MCP) server tools.',
95
+ '- Whenever the user asks to check campaigns, review metrics, fetch performance data, or analyze active ads, you MUST use the corresponding MCP server tools to query the live platforms.',
96
+ '- NEVER search the local file system, run grep/ripgrep, check Git logs, or read codebase files to search for ad campaign data. The active folder is just the application source code — it contains zero campaign metrics. Campaign data comes ONLY from querying your active MCP server tools.',
92
97
  ];
93
98
  if (isLaunchMode) {
94
99
  parts.push('YOU ARE OPERATING IN LAUNCH MODE (READ-WRITE).', 'You are authorized to execute active write modifications on ad accounts (e.g. pausing campaigns, scaling bids, altering daily budgets, creating ads).', 'CRITICAL SAFETY RULE: For any write operation, you MUST generate a clear visual preview card outlining the exact changes and ask the user for explicit confirmation (Y/N) before executing. NEVER make active changes without their explicit confirmation.');
@@ -325,7 +330,9 @@ async function main() {
325
330
  // ─── Build Pi Arguments ─────────────────────────────────────────
326
331
  const piArgsRaw = [];
327
332
  // Model flag
328
- piArgsRaw.push('--model', cleanProvider);
333
+ const isLocal = !!config.localBaseUrl;
334
+ const modelIdForPi = isLocal && cleanProvider.includes('/') ? cleanProvider.split('/')[1] : cleanProvider;
335
+ piArgsRaw.push('--model', modelIdForPi);
329
336
  // Skills directories
330
337
  const skillsDir = path.join(pkgDir, 'skills');
331
338
  const templatesDir = path.join(pkgDir, 'templates');
@@ -393,6 +400,39 @@ async function main() {
393
400
  };
394
401
  }
395
402
  fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
403
+ // ─── Write models.json for Local AI ─────────────────────────────
404
+ const modelsPath = path.join(agentDir, 'models.json');
405
+ if (isLocal) {
406
+ const modelsConfig = {
407
+ providers: {
408
+ "local-ai": {
409
+ baseUrl: config.localBaseUrl,
410
+ api: "openai-completions",
411
+ apiKey: "local-key-placeholder",
412
+ compat: {
413
+ supportsDeveloperRole: false,
414
+ supportsReasoningEffort: false
415
+ },
416
+ models: [
417
+ {
418
+ id: modelIdForPi,
419
+ name: `${modelIdForPi} (Local)`
420
+ }
421
+ ]
422
+ }
423
+ }
424
+ };
425
+ fs.writeFileSync(modelsPath, JSON.stringify(modelsConfig, null, 2));
426
+ }
427
+ else {
428
+ // If not local, remove custom models.json to avoid conflicts
429
+ if (fs.existsSync(modelsPath)) {
430
+ try {
431
+ fs.unlinkSync(modelsPath);
432
+ }
433
+ catch (e) { }
434
+ }
435
+ }
396
436
  // ─── Launch Agent ───────────────────────────────────────────────
397
437
  const piCliPath = path.resolve(pkgDir, 'node_modules', '@earendil-works', 'pi-coding-agent', 'dist', 'cli.js');
398
438
  spinner.succeed(chalk.green('Agent ready'));
package/dist/schedule.js CHANGED
@@ -249,9 +249,12 @@ export async function runScheduledTask(name) {
249
249
  }
250
250
  const skillsDir = path.resolve(pkgDir, 'skills');
251
251
  const contextDir = path.join(CONFIG_DIR, 'context');
252
+ const cleanModel = config.provider;
253
+ const isLocal = !!config.localBaseUrl;
254
+ const modelIdForPi = isLocal && cleanModel.includes('/') ? cleanModel.split('/')[1] : cleanModel;
252
255
  const args = [
253
256
  piCliPath,
254
- '--model', config.provider,
257
+ '--model', modelIdForPi,
255
258
  '--skill', skillsDir,
256
259
  ...(fs.existsSync(contextDir) ? ['--skill', contextDir] : []),
257
260
  '--print',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openads-ai",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Open-source AI command center for digital marketers. Audit campaigns, write ad copy, and build strategies — from your terminal.",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {