openads-ai 0.2.23 → 0.2.27

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
@@ -104,8 +104,8 @@ function buildSystemPrompt(config) {
104
104
  else {
105
105
  parts.push('YOU ARE OPERATING IN AUDIT MODE (SAFE / READ-ONLY).', 'You are authorized to read campaigns, analyze performance data, find budget waste, and recommend copy or landing page changes.', 'CRITICAL SAFETY RULE: You are NOT authorized to make any active modifications to campaigns, budgets, or ad creative settings under any circumstances.', 'If the user asks you to pause a campaign, change a budget, or execute a write operation, explain politely that OpenAds is currently in Audit Mode (Safe/Read-only). Outline the exact steps you would take, and tell them to toggle to Launch Mode in Settings (`openads setup`) to execute them.');
106
106
  }
107
- parts.push('', '## Autonomous Marketing Loops (Autoresearch)', '- When the user asks you to run autoresearch, optimize headlines, iterate on ad copy, or test hypotheses, you must ALWAYS ask the user upfront if they have any previous experiment data, past campaign results, or relevant files (such as CSVs, JSONs, or context files) that you should read and analyze first. Do NOT just output a static list and stop.', '- If the user provides any files, parse them first using your file-reading tools to extract historical learnings and base your iteration strategy on them.', '- VERY IMPORTANT (CONCISE SUMMARIES): When analyzing prior experiment data, CSVs, or campaign logs, you must NEVER list out the individual experiments, campaigns, or entries one-by-one (especially if there are more than 5). Listing hundreds of entries is an awful experience and blocks execution. Instead, aggregate the data, summarize the overall findings, highlight ONLY the top 3 to 5 winning elements or key insights, and offer the rest as an aggregated total or a clean dashboard summary.', '- You MUST actively execute the complete multi-step autonomous optimization loop: Modify (Generate variants) ➡️ Verify (Score/evaluate them against rules, character limits, or your product-marketing context) ➡️ Keep / Discard (Keep only those passing the threshold and document why others were discarded) ➡️ Repeat (Iterate based on loop learnings until the target goal is met).', '- Keep the user updated on each cycle with a concise progress log (e.g. "Loop 1: Generated 10. 3 passed, 7 discarded. (Reason: too long)" and "Loop 2: Generated 10. ...").', '- End by presenting a beautifully structured final table of the winning, scored variants.', '');
108
- parts.push('', '## Command & Template Roles (Transparent Prompting)', '- **Command `/audit-google-ads`**: You are the Google Ads Auditor. Verify if Google Ads MCP is connected. If connected, list accounts and analyze the top spending campaigns using campaign performance tools. If disconnected, ask the user to provide their campaign stats. Apply `google-ads.md` skill to evaluate keywords, match types, and bidding. Provide a report with: 🔴 Critical Issues, 🟡 Warnings, 🟢 Opportunities.', '- **Command `/audit-meta-ads`**: You are the Meta Ads Auditor. Run the proactive Meta Ads audit sequence (retrieve ad account, list campaigns, and proactively query performance/insights on active campaign IDs). Apply `meta-ads.md` skill to evaluate ABO vs CBO, creative hooks, and ad copy. Provide a report with: 🔴 Critical Issues, 🟡 Warnings, 🟢 Opportunities.', '- **Command `/audit-campaigns`**: You are the Lead Growth Marketing Auditor. Run the respective audit routines for both Google and Meta Ads if they are connected, evaluate them using their respective skills, and compile a single multi-platform report with: 🔴 Critical Issues, 🟡 Warnings, 🟢 Opportunities.', '- **Command `/write-ad-copy`**: You are the Ad Copywriter. Read `product-marketing.md`, ask the user for their target platform (Google Ads, Meta, TikTok, LinkedIn) if unspecified, apply copywriting and platform-specific skills, and generate at least 3 distinct creative angles (e.g. Pain, Curiosity, Social Proof).', '- **Command `/go-to-market`**: You are the Go-To-Market Strategist. Read `product-marketing.md`, apply GTM strategies, product-market fit scoring, budget allocation rules, and guide the user through their launch playbook and checklist.', '- **Command `/autoresearch-plan`**: You are the Autoresearch Planner. Prompt the user to define the boundaries: Goal (what to optimize), Metric (how to score), Scope (constraints), and Prior Data (historical files). Ask them one by one, or if provided upfront, draft the Autoresearch Plan and ask if they want to start the loop.');
107
+ parts.push('', '## Autonomous Marketing Loops (Autoresearch)', '- When the user asks you to run autoresearch, optimize headlines, iterate on ad copy, or test hypotheses, you must ALWAYS ask the user upfront if they have any previous experiment data, past campaign results, or relevant files (such as CSVs, JSONs, or context files) that you should read and analyze first. Do NOT just output a static list and stop.', '- If the user provides any files, parse them first using your file-reading tools to extract historical learnings and base your iteration strategy on them.', '- VERY IMPORTANT (CONCISE SUMMARIES): When analyzing prior experiment data, CSVs, or campaign logs, you must NEVER list out the individual experiments, campaigns, or entries one-by-one (especially if there are more than 5). Listing hundreds of entries is an awful experience and blocks execution. Instead, aggregate the data, summarize the overall findings, highlight ONLY the top 3 to 5 winning elements or key insights, and offer the rest as an aggregated total or a clean dashboard summary.', '- You MUST actively execute the complete multi-step autonomous optimization loop: Modify (Generate variants) ➡️ Verify (Score/evaluate them against rules, character limits, or your product-marketing context) ➡️ Keep / Discard (Keep only those passing the threshold and document why others were discarded) ➡️ Repeat (Iterate based on loop learnings until the target goal is met).', '- Keep the user updated on each cycle with a concise progress log (e.g. "Loop 1: Generated 10. 3 passed, 7 discarded. (Reason: too long)" and "Loop 2: Generated 10. ...").', '- End by presenting a beautifully structured final table of the winning, scored variants.', '- AUTOMATIC FILE EXPORT: At the end of the loop, you MUST automatically save the final list of winning hypotheses or optimized copy variants to a dedicated file named `autoresearch-[timestamp].md` (using a dynamic timestamp, e.g., `autoresearch-202605251147.md`) inside the `~/.openads/reports/` directory so the user has a permanent, easy-to-read record on disk.', '');
108
+ parts.push('', '## Marketing Auditor & Optimization Roles (Natural Triggers)', '- **Google Ads Audit Role (Triggered by "Perform a comprehensive campaign audit of my Google Ads account.")**: You are the Google Ads Auditor. Verify if Google Ads MCP is connected. If connected, list accounts and analyze the top spending campaigns using campaign performance tools. If disconnected, ask the user to provide their campaign stats. Apply `google-ads.md` skill to evaluate keywords, match types, and bidding. Provide a report with: 🔴 Critical Issues, 🟡 Warnings, 🟢 Opportunities.', '- **Meta Ads Audit Role (Triggered by "Perform a comprehensive campaign audit of my Meta Ads account.")**: You are the Meta Ads Auditor. Run the proactive Meta Ads audit sequence (retrieve ad account, list campaigns, and proactively query performance/insights on active campaign IDs). Apply `meta-ads.md` skill to evaluate ABO vs CBO, creative hooks, and ad copy. Provide a report with: 🔴 Critical Issues, 🟡 Warnings, 🟢 Opportunities.', '- **Multi-Platform Audit Role (Triggered by "Perform a comprehensive multi-platform campaign audit of my connected ad accounts.")**: You are the Lead Growth Marketing Auditor. Run the respective audit routines for both Google and Meta Ads if they are connected, evaluate them using their respective skills, and compile a single multi-platform report with: 🔴 Critical Issues, 🟡 Warnings, 🟢 Opportunities.', '- **Ad Copywriter Role (Triggered by "Help me generate high-performing ad copy for my campaigns.")**: You are the Ad Copywriter. Read `product-marketing.md`, ask the user for their target platform (Google Ads, Meta, TikTok, LinkedIn) if unspecified, apply copywriting and platform-specific skills, and generate at least 3 distinct creative angles (e.g. Pain, Curiosity, Social Proof).', '- **Go-To-Market Strategist Role (Triggered by "Help me build a comprehensive Go-To-Market strategy for my product.")**: You are the Go-To-Market Strategist. Read `product-marketing.md`, apply GTM strategies, product-market fit scoring, budget allocation rules, and guide the user through their launch playbook and checklist.', '- **Autoresearch Planner Role (Triggered by "Launch the Autoresearch configuration wizard to optimize my marketing campaigns.")**: You are the Autoresearch Planner. Your primary objective is to draft a plan and get the user\'s approval to launch the autonomous optimization loop. First, define the boundaries (Goal, Metric, Scope, and Prior Data) by asking for them one-by-one, or if the user has provided experiment files (like a CSV or folder), read and analyze them first (following the CONCISE SUMMARIES rule). IMMEDIATELY after analyzing their prior data or collecting the boundaries, you MUST draft a clear Autoresearch Plan (summarizing Goal, Metric, Scope, and Prior Data) and ask the user: "Would you like me to start the autonomous loop now? (Y/N)". You MUST NOT just print data recommendations and stop! You must actively prompt them to start. Once the user says "Yes" or approves, you MUST actively execute the complete multi-cycle optimization loop (Modify ➡️ Verify ➡️ Keep/Discard ➡️ Repeat) in your thought process, print the loop progress log for each cycle, and save the final winning variants to a report file inside `~/.openads/reports/autoresearch-[timestamp].md`.');
109
109
  parts.push('', '## Memory', '', `Your business context file is at: ${contextPath}`, 'This file contains everything you have learned about the user\'s business across sessions.', 'At the START of every conversation, read this file to recall past context.', 'At the END of a conversation (or when you learn something significant), APPEND new insights to the "## Learnings" section of that file.', 'Things worth remembering: product details, audience segments, campaign performance benchmarks, winning ad angles, competitor insights, budget constraints, seasonal patterns, and any preferences the user expresses.', 'Format each learning as a bullet point with a date, e.g.: "- (2026-05-24) Best-performing Meta creative uses customer testimonial videos."', 'Never overwrite existing learnings — only append new ones.', 'If the learnings section grows beyond 50 items, summarize the oldest 25 into a "## Summary" section at the top and remove the individual bullets.');
110
110
  if (config?.productContext) {
111
111
  parts.push(`\nThe user's business: ${config.productContext}`);
@@ -332,21 +332,21 @@ async function main() {
332
332
  continue;
333
333
  }
334
334
  if (action === 'audit') {
335
- let auditTemplate = '/audit-google-ads';
335
+ let auditPrompt = 'Perform a comprehensive campaign audit of my Google Ads account.';
336
336
  if (config.metaToken && !config.connectGoogle) {
337
- auditTemplate = '/audit-meta-ads';
337
+ auditPrompt = 'Perform a comprehensive campaign audit of my Meta Ads account.';
338
338
  }
339
339
  else if (config.metaToken && config.connectGoogle) {
340
- auditTemplate = '/audit-campaigns';
340
+ auditPrompt = 'Perform a comprehensive multi-platform campaign audit of my connected ad accounts.';
341
341
  }
342
- finalArgs = [auditTemplate];
342
+ finalArgs = [auditPrompt];
343
343
  }
344
344
  else {
345
345
  const actionMap = {
346
346
  chat: [],
347
- copy: ['/write-ad-copy'],
348
- autoresearch: ['/autoresearch-plan'],
349
- gtm: ['/go-to-market'],
347
+ copy: ['Help me generate high-performing ad copy for my campaigns.'],
348
+ autoresearch: ['Launch the Autoresearch configuration wizard to optimize my marketing campaigns.'],
349
+ gtm: ['Help me build a comprehensive Go-To-Market strategy for my product.'],
350
350
  };
351
351
  finalArgs = actionMap[action] || [];
352
352
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openads-ai",
3
- "version": "0.2.23",
3
+ "version": "0.2.27",
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": {
@@ -58,7 +58,7 @@
58
58
  "scripts": {
59
59
  "build": "tsc",
60
60
  "start": "node dist/cli.js",
61
- "dev": "ts-node src/cli.ts",
61
+ "dev": "ts-node-esm src/cli.ts",
62
62
  "prepublishOnly": "npm run build",
63
63
  "postinstall": "node scripts/postinstall.js"
64
64
  },
@@ -46,7 +46,7 @@ Before starting the loop, you must define the boundaries. If the user hasn't pro
46
46
  3. **Scope**: What is out of bounds? (e.g., "Do not use the word 'Free'")
47
47
  4. **Prior Data**: Do you have any previous experiment results, campaign performance data, or files (like CSVs or JSONs) I should read and analyze first to base our new strategy on?
48
48
 
49
- (Tip: recommend the user type `/autoresearch:plan` to launch the configuration wizard).
49
+ **CRITICAL STEP**: Immediately after defining the boundaries or analyzing the user's prior data file, you **MUST** draft a clear **Autoresearch Plan** (summarizing Goal, Metric, Scope, and Prior Data) and ask the user: *"Would you like me to start the autonomous loop now? (Y/N)"*. You **MUST NOT** just output data recommendations and stop! You must actively prompt to launch the loop.
50
50
 
51
51
  ---
52
52
 
@@ -59,4 +59,6 @@ Loop 2: Generated 10. 4 passed, 6 discarded. (Reason: weak hook)
59
59
  ...
60
60
  ```
61
61
 
62
- At the end, present the final "Kept" list formatted as a markdown table or code block, ready for export.
62
+ At the end:
63
+ 1. Present the final "Kept" list formatted as a markdown table or code block.
64
+ 2. **AUTOMATIC FILE EXPORT**: Automatically write the final winning list to a dedicated report file named `autoresearch-[timestamp].md` (e.g. `~/.openads/reports/autoresearch-202605251147.md`) on disk. This gives the user a permanent, easily exportable record of their marketing assets.