From e65e282084b4c47bac0cefda157d615c6f016315 Mon Sep 17 00:00:00 2001
From: nish3451 <257724087+nish3451@users.noreply.github.com>
Date: Wed, 5 Aug 2026 21:34:34 +0530
Subject: [PATCH 01/19] feat: minimal-input Agent Desk (recovered from June
worktree)
Recovers 1,374 lines of uncommitted work from 2026-06-18 that reduces the
public intake from an eight-part form to email plus one business snapshot,
with optional fields progressively disclosed. Spec at
specs/002-minimal-input-agent-desk/ documents the original rationale.
---
MEMORY.md | 7 +-
README.md | 4 +-
...-001-feat-pipeline-loop-agent-desk-plan.md | 127 +++
...8-002-fix-minimal-input-agent-desk-plan.md | 91 ++
package.json | 4 +-
public/index.html | 174 +--
public/llms.txt | 22 +-
public/offer.md | 19 +-
public/script.js | 226 +++-
public/styles.css | 315 +++++-
scripts/check-site.mjs | 119 ++-
scripts/test-agent-ui.mjs | 192 ++++
scripts/test-agent-worker.mjs | 994 ++++++++++++++++++
specs/001-public-buyer-page/plan.md | 6 +-
specs/001-public-buyer-page/spec.md | 15 +-
specs/001-public-buyer-page/tasks.md | 2 +
specs/002-minimal-input-agent-desk/plan.md | 27 +
specs/002-minimal-input-agent-desk/spec.md | 57 +
specs/002-minimal-input-agent-desk/tasks.md | 16 +
src/worker.js | 666 +++++++++++-
20 files changed, 2878 insertions(+), 205 deletions(-)
create mode 100644 docs/plans/2026-06-18-001-feat-pipeline-loop-agent-desk-plan.md
create mode 100644 docs/plans/2026-06-18-002-fix-minimal-input-agent-desk-plan.md
create mode 100644 scripts/test-agent-ui.mjs
create mode 100644 scripts/test-agent-worker.mjs
create mode 100644 specs/002-minimal-input-agent-desk/plan.md
create mode 100644 specs/002-minimal-input-agent-desk/spec.md
create mode 100644 specs/002-minimal-input-agent-desk/tasks.md
diff --git a/MEMORY.md b/MEMORY.md
index 8dbc4ed2..948134b4 100644
--- a/MEMORY.md
+++ b/MEMORY.md
@@ -5,13 +5,14 @@
- This repo is the deployable public website source for `tinystudio.io`.
- The Growth Brain operating repo remains at `/Users/nish/Documents/TINY STUDIO` and is the source of deeper offer/delivery truth.
- As of the Agent Desk pass, `tinystudio.io` is reopening as a self-serve AI workspace for high-ticket pipeline setup.
-- Cloudflare Workers AI generates the Pipeline Brief from user-submitted context through `/api/agent-audit`.
+- Cloudflare Workers AI generates the Pipeline Brief, Implementation Checklist, and Weekly Fix Report from user-submitted context through `/api/agent-audit`.
## Product Truth
-- TinyStudio Agent Desk generates readiness diagnosis, funnel path, audience/pain map, first creative tests, lead qualification, follow-up/setter flow, CRM/tracking checklist, and decision plan.
+- TinyStudio Agent Desk generates a Pipeline Brief, Implementation Checklist, and Weekly Fix Report covering readiness diagnosis, funnel path, audience/pain map, first creative tests, lead qualification, follow-up/setter flow, CRM/tracking checklist, weekly metrics, and decision plan.
+- The default customer intake is minimal: email plus business snapshot. Offer, buyer, funnel, proof, follow-up, CRM, constraints, and weekly metrics are optional detail inputs, and agents should infer missing context before asking blocker questions.
- Email capture remains live through `/api/signups`.
-- The public app stores email and lightweight agent usage metadata in D1, including daily rate-limit counters and a daily IP-derived rate-limit key, but not the full submitted business brief.
+- The public app stores email and lightweight agent usage metadata in D1, including daily rate-limit counters and a daily IP-derived rate-limit key, but not the submitted business snapshot, optional details, weekly metrics, or generated artifacts.
- Public copy must not promise revenue, ROAS, SEO ranking, AI visibility, conversion lift, booked calls, sales lift, autonomous ad buying, or unapproved ad spend changes.
## Agent Desk Safety
diff --git a/README.md b/README.md
index bfb3a5f6..184fe6f9 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ Self-serve TinyStudio Agent Desk for high-ticket pipeline setup.
## What This Repo Owns
- The public `tinystudio.io` and `www.tinystudio.io` Agent Desk.
-- Cloudflare Workers AI generation through `/api/agent-audit`.
+- Cloudflare Workers AI generation through `/api/agent-audit` for Pipeline Brief, Implementation Checklist, and Weekly Fix Report outputs.
- Email capture through `/api/signups`, stored in Cloudflare D1.
- Lightweight agent usage metadata in Cloudflare D1, including daily rate-limit counters.
- The intentional retirement responses for `app.tinystudio.io` and `api.tinystudio.io`.
@@ -16,7 +16,7 @@ Self-serve TinyStudio Agent Desk for high-ticket pipeline setup.
- Any live private TinyStudio app/API product.
- Client folders, analytics exports, payment data, private sprint work, or ad-platform credentials.
- Revenue claims, ROAS claims, booked-call claims, ranking claims, sales-lift promises, autonomous ad buying, ad spend changes, campaign publishing, or ad-platform write actions.
-- Storage of submitted business briefs; the Agent Desk processes context for the generated output and stores only email plus lightweight usage metadata.
+- Storage of submitted business snapshots, optional detail inputs, weekly metrics, or generated artifacts; the Agent Desk processes context for the generated output and stores only email plus lightweight usage metadata.
## Commands
diff --git a/docs/plans/2026-06-18-001-feat-pipeline-loop-agent-desk-plan.md b/docs/plans/2026-06-18-001-feat-pipeline-loop-agent-desk-plan.md
new file mode 100644
index 00000000..994711e2
--- /dev/null
+++ b/docs/plans/2026-06-18-001-feat-pipeline-loop-agent-desk-plan.md
@@ -0,0 +1,127 @@
+---
+title: feat: Pipeline Loop Agent Desk
+type: feat
+date: 2026-06-18
+execution: code
+---
+
+# feat: Pipeline Loop Agent Desk
+
+## Summary
+
+Expand the TinyStudio Agent Desk from a single Pipeline Brief generator into a three-artifact applied-AI workflow: Pipeline Brief, Implementation Checklist, and Weekly Fix Report. The app remains self-serve, server-side AI powered, claim-safe, and approval-gated for external account or spend actions.
+
+---
+
+## Problem Frame
+
+The current Agent Desk proves TinyStudio can collect high-ticket pipeline context and generate a useful first brief. The next product layer should bridge AI output into operational work: what to build first, what to track weekly, and what to fix next without positioning TinyStudio as an autonomous ad agency.
+
+---
+
+## Requirements
+
+**Agent workflow**
+
+- R1. The Agent Desk must generate three distinct artifacts from one intake: Pipeline Brief, Implementation Checklist, and Weekly Fix Report.
+- R2. The Weekly Fix Report must use optional current-week metrics when supplied and must fall back to a tracker template when metrics are absent.
+- R3. The Implementation Checklist must convert the diagnosis into approval-gated setup work across offer, funnel, creative, qualification, follow-up, CRM, tracking, and decision cadence.
+
+**Public UI**
+
+- R4. The public page must expose the three-artifact workflow as the first-class self-serve experience.
+- R5. The intake must collect optional weekly lead-to-call metrics without making them required and without implying guaranteed performance targets.
+- R6. The output panel must let users inspect and copy each artifact separately while preserving a useful all-in-one response for fallback.
+
+**Safety and data boundary**
+
+- R7. The Worker must keep AI generation server-side through Cloudflare Workers AI and must not store submitted business briefs or generated artifacts.
+- R8. Public copy and generated output must avoid revenue, ROAS, booked-call, ranking, AI-visibility, conversion-lift, sales-lift, profit, or autonomous ad-buying guarantees.
+- R9. Ad spend changes, campaign publishing, platform connections, CRM outcome syncing, claims, and compliance-sensitive work must remain approval-gated.
+
+**Verification**
+
+- R10. Static content checks must validate the new artifacts, section contract, safety language, and Cloudflare AI boundary.
+- R11. A sample high-ticket scenario must exercise the end-to-end agent response and prove the outputs are useful without manual explanation.
+
+---
+
+## Key Technical Decisions
+
+- **Single API response with structured sections:** The Worker should ask the model for exact top-level headings, split the markdown into named sections, and return both `sections` and a backward-compatible combined `brief`. This keeps the client simple while preserving compatibility with the existing one-output contract.
+- **Optional metrics as prompt context only:** Weekly numbers belong in the request prompt and browser UI, not in D1. Existing D1 usage logging should remain lightweight and should not capture the business brief, the weekly metrics, or generated artifacts.
+- **Client-side tabs over multiple API calls:** One agent run should produce all three artifacts. Tabs only change presentation, which keeps AI cost, rate limits, and consistency predictable.
+- **Safety filter on combined generated text:** Existing forbidden-claim detection should run against the full generated response before any section is returned, so unsafe content cannot leak through a secondary tab.
+
+---
+
+## Implementation Units
+
+### U1. Worker section contract
+
+- **Goal:** Generate and return Pipeline Brief, Implementation Checklist, and Weekly Fix Report as structured sections.
+- **Requirements:** R1, R2, R3, R7, R8, R9
+- **Dependencies:** None
+- **Files:** `src/worker.js`, `scripts/check-site.mjs`
+- **Approach:** Extend the agent input with optional weekly metrics, update the prompt to require exact headings, add a section splitter, validate that all three sections are present, and keep the combined `brief` response for compatibility.
+- **Patterns to follow:** Existing `/api/agent-audit` validation, retry, safety-filter, and no-brief-storage behavior in `src/worker.js`.
+- **Test scenarios:** Submit a valid request with weekly metrics and expect all three response sections; submit a valid request without metrics and expect the Weekly Fix Report to become a tracker template; confirm unsafe generated claims are still rejected.
+- **Verification:** Static checks cover the section splitter, prompt headings, metrics fields, and forbidden claims.
+
+### U2. Public workflow UI
+
+- **Goal:** Make the page read as a self-serve workflow desk rather than a single brief generator.
+- **Requirements:** R4, R5, R6, R8, R9
+- **Dependencies:** U1
+- **Files:** `public/index.html`, `public/script.js`, `public/styles.css`, `scripts/check-site.mjs`
+- **Approach:** Add an optional weekly metrics group to the intake, render three output tabs backed by the structured API response, keep copy buttons scoped to the active artifact, and preserve a clear empty/error state.
+- **Patterns to follow:** Existing Agent Desk layout, form submission, progressive enhancement, and status handling in `public/index.html`, `public/script.js`, and `public/styles.css`.
+- **Test scenarios:** Load the page at desktop and mobile sizes; generate from sample context; switch tabs; copy the active artifact; verify empty, loading, success, and error states do not overlap or require technical explanation.
+- **Verification:** Browser inspection plus static checks confirm artifact labels, metric fields, output tabs, and safety copy.
+
+### U3. Public truth and repo docs
+
+- **Goal:** Keep machine-readable and maintainer-facing truth aligned with the new three-artifact workflow.
+- **Requirements:** R4, R8, R9, R10
+- **Dependencies:** U1, U2
+- **Files:** `public/llms.txt`, `public/offer.md`, `README.md`, `MEMORY.md`, `specs/001-public-buyer-page/plan.md`, `specs/001-public-buyer-page/spec.md`, `specs/001-public-buyer-page/tasks.md`
+- **Approach:** Update public docs to say the Agent Desk generates a Pipeline Brief, Implementation Checklist, and Weekly Fix Report. Preserve the no-guarantee and approval-gated boundaries.
+- **Patterns to follow:** Existing public truth files use short, direct claim-safe wording.
+- **Test scenarios:** Static content checks should fail if the new sections or safety boundaries are missing.
+- **Verification:** `npm test` validates content, safety claims, and AI boundary checks.
+
+### U4. End-to-end verification and review
+
+- **Goal:** Prove the implementation works locally before any ship path.
+- **Requirements:** R10, R11
+- **Dependencies:** U1, U2, U3
+- **Files:** `scripts/check-site.mjs`
+- **Approach:** Run the normal test command, run syntax checks where useful, browser-check desktop and mobile, and exercise `/api/agent-audit` with a sample high-ticket scenario.
+- **Patterns to follow:** Existing project verification in `README.md`, `MEMORY.md`, and `specs/001-public-buyer-page/plan.md`.
+- **Test scenarios:** Static test pass; sample AI response has all three artifacts; no forbidden claims; rendered page is nonblank and usable.
+- **Verification:** Final report lists exact checks run and any unverified items.
+
+---
+
+## Scope Boundaries
+
+- No payment collection, account provisioning, or paid subscription logic.
+- No Meta, Google, CRM, WhatsApp, SMS, or email platform write automation.
+- No campaign publishing, ad spend changes, CRM outcome syncing, or lead-message sending.
+- No storage of submitted business briefs, weekly metrics, or generated artifacts.
+- No public guarantees for revenue, ROAS, booked calls, profit, rankings, AI visibility, conversion lift, or sales lift.
+
+---
+
+## Risks & Dependencies
+
+- **Model shape drift:** The model may ignore exact headings. Mitigation: parse sections defensively, retry through existing fallback models, and fail safely if required artifacts are missing.
+- **Overclaiming by generation:** The model may produce unsafe claims. Mitigation: run the existing safety detector on the full response before returning it.
+- **Metric interpretation risk:** Weekly metrics can be incomplete or noisy. Mitigation: ask the model to diagnose bottlenecks and next checks, not guarantee outcomes.
+- **AI availability:** The feature depends on Cloudflare Workers AI binding. Mitigation: keep the existing safe unavailable state.
+
+---
+
+## Documentation / Operational Notes
+
+No D1 migration is planned because the new inputs and outputs are not stored. Any deploy path must still run the review gate and existing `npm test` before publishing.
diff --git a/docs/plans/2026-06-18-002-fix-minimal-input-agent-desk-plan.md b/docs/plans/2026-06-18-002-fix-minimal-input-agent-desk-plan.md
new file mode 100644
index 00000000..89daa948
--- /dev/null
+++ b/docs/plans/2026-06-18-002-fix-minimal-input-agent-desk-plan.md
@@ -0,0 +1,91 @@
+---
+title: fix: Minimal-input Agent Desk
+type: fix
+date: 2026-06-18
+execution: code
+---
+
+# fix: Minimal-input Agent Desk
+
+## Summary
+
+Make the Pipeline Loop Agent Desk feel agent-native: customers provide a small business seed, and the agents infer the offer, buyer, funnel, hooks, follow-up, CRM, tracking, and weekly fix loop unless a real blocker remains.
+
+---
+
+## Problem Frame
+
+The current page looks and behaves like an agency intake form. That makes paying customers do diagnosis work the agents should handle, and it weakens the promise that TinyStudio is self-serve with AI doing the heavy lifting.
+
+---
+
+## Requirements
+
+- R1. The public form must require only email and a compact business snapshot.
+- R2. Optional fields must stay available for better output, but they must not dominate the first screen.
+- R3. The Worker must accept minimal input and prompt the model to infer missing pieces, mark assumptions, and ask only true blocker questions.
+- R4. The generated artifacts must stay claim-safe and approval-gated for spend, publishing, platform connections, and compliance-sensitive actions.
+- R5. Existing structured section, metric snapshot, storage, and safety tests must keep passing.
+
+---
+
+## Key Technical Decisions
+
+- **Keep one endpoint:** `/api/agent-audit` remains the only agent run endpoint so rate limits, storage boundaries, and safety filtering stay centralized.
+- **Use business snapshot as the seed:** The existing `business` field becomes the one required context field, avoiding a data migration or extra API contract.
+- **Progressive disclosure:** Offer, audience, proof, follow-up, metrics, and funnel controls move behind an optional detail section rather than being removed.
+- **Prompt over workflow code:** Missing-input behavior belongs in the system/user prompt so the agents use judgment instead of hard-coded questionnaire logic.
+
+---
+
+## Implementation Units
+
+### U1. Minimal-input validation
+
+- **Goal:** Let customers run the agents with only email and business snapshot.
+- **Requirements:** R1, R3, R5
+- **Dependencies:** None
+- **Files:** `src/worker.js`, `public/script.js`, `scripts/test-agent-worker.mjs`, `scripts/test-agent-ui.mjs`
+- **Approach:** Relax validation to require only `email` and `business`; update client-side messages and tests to prove offer/audience are optional.
+- **Patterns to follow:** Existing `validateAgentInput`, `ERROR_MESSAGES`, and mocked Worker/UI tests.
+- **Test scenarios:** Minimal body succeeds; missing business seed fails; UI submits without offer/audience.
+- **Verification:** `npm test`.
+
+### U2. Agent-heavy prompt behavior
+
+- **Goal:** Make the agent infer missing offer, buyer, funnel, creative, follow-up, CRM, and metrics assumptions before asking questions.
+- **Requirements:** R3, R4, R5
+- **Dependencies:** U1
+- **Files:** `src/worker.js`, `scripts/test-agent-worker.mjs`
+- **Approach:** Add prompt guidance for assumption-making, blocker-only questions, and customer-delight output. Keep the existing no-guarantee and approval-gated constraints.
+- **Patterns to follow:** Current `agentSystemPrompt`, `agentUserPrompt`, and unsafe-output scrubber.
+- **Test scenarios:** Minimal prompt includes inference guidance and labels absent optional fields as missing context rather than invalid input.
+- **Verification:** Worker tests and live API smoke.
+
+### U3. Progressive-disclosure intake UI
+
+- **Goal:** Replace the visible questionnaire with a compact agent workspace.
+- **Requirements:** R1, R2
+- **Dependencies:** U1
+- **Files:** `public/index.html`, `public/styles.css`, `scripts/check-site.mjs`
+- **Approach:** Keep email, business snapshot, and constraints visible; move market, funnel, offer, audience, proof, follow-up, and weekly numbers into a collapsible optional section.
+- **Patterns to follow:** Existing single-page Agent Desk layout and output tabs.
+- **Test scenarios:** Desktop and mobile render without oversized form controls; optional details remain accessible.
+- **Verification:** Browser check at `http://127.0.0.1:8788/`.
+
+---
+
+## Scope Boundaries
+
+- No ad account, CRM, WhatsApp, SMS, email, or payment platform write automation in this fix.
+- No storage of business snapshots, optional details, metrics, or generated artifacts.
+- No public claims about guaranteed outcomes.
+- No new paid onboarding, account provisioning, or subscription logic.
+
+---
+
+## Risks & Dependencies
+
+- **Weak seed risk:** Some users will submit vague snapshots. Mitigation: prompt the agent to make explicit assumptions and ask only true blocker questions.
+- **Over-inference risk:** The model may invent proof or outcomes. Mitigation: preserve the existing unsafe-output filter and no-invented-proof prompt rules.
+- **Hidden detail risk:** Power users may miss optional fields. Mitigation: keep the optional drawer visible, short, and clearly labeled.
diff --git a/package.json b/package.json
index d4b0267d..2d8e3a46 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,9 @@
"scripts": {
"dev": "wrangler dev --remote --ip 127.0.0.1 --port 8788 --persist-to /tmp/tinystudio-agent-worker",
"check": "node scripts/check-site.mjs",
- "test": "npm run check",
+ "test": "npm run check && npm run test:worker && npm run test:ui",
+ "test:worker": "node --test scripts/test-agent-worker.mjs",
+ "test:ui": "node --test scripts/test-agent-ui.mjs",
"leads:list": "wrangler d1 execute tinystudio_email_signups --remote --command \"SELECT email, source, page_path, created_at, updated_at FROM email_signups ORDER BY updated_at DESC LIMIT 100;\"",
"leads:export": "wrangler d1 execute tinystudio_email_signups --remote --command \"SELECT email, source, page_path, created_at, updated_at FROM email_signups ORDER BY updated_at DESC;\" --json",
"migrate:remote": "wrangler d1 migrations apply tinystudio_email_signups --remote",
diff --git a/public/index.html b/public/index.html
index 15c8c99e..fc3ba8d8 100644
--- a/public/index.html
+++ b/public/index.html
@@ -6,12 +6,12 @@
TinyStudio Agent Desk
@@ -63,7 +63,7 @@
TinyStudio Agent Desk
Build the pipeline system before you buy more ads.
- The agents turn your offer, audience, proof, funnel, follow-up, CRM, and market context into a practical lead-to-call plan. They draft the system; you still approve spend, publishing, and claims.
+ The agents turn your offer, audience, proof, funnel, follow-up, CRM, weekly numbers, and market context into a Pipeline Brief, Implementation Checklist, and Weekly Fix Report. They draft the system; you still approve spend, publishing, and claims.
Offer Agent
@@ -79,8 +79,8 @@
Build the pipeline system before you buy more ads.
@@ -148,15 +197,20 @@
Pipeline intake
Agent output
-
Pipeline Brief
+
Pipeline Brief
+
+
+
+
+
-
+
- Your generated system will appear here: readiness diagnosis, funnel path, audience/pain map, four creative tests, lead form, follow-up, CRM, tracking, and decision rules.
+ Your generated system will appear here: Pipeline Brief, Implementation Checklist, and Weekly Fix Report.
-
+
@@ -170,7 +224,7 @@
Pipeline Brief
Stored
- Email and lightweight usage metadata, including daily rate-limit counters. The business brief is processed for the output and is not saved by this app.
+ Email and lightweight usage metadata, including daily rate-limit counters. The business snapshot, optional details, weekly metrics, and generated artifacts are processed for the output and are not saved by this app.
diff --git a/public/llms.txt b/public/llms.txt
index 2f7a2fe7..febe86e5 100644
--- a/public/llms.txt
+++ b/public/llms.txt
@@ -7,25 +7,21 @@ Contact: hello@tinystudio.io
## Current Product
-TinyStudio Agent Desk helps high-ticket coaches, consultants, service businesses, agencies, course sellers, and experts build a lead-to-call pipeline brief.
+TinyStudio Agent Desk helps high-ticket coaches, consultants, service businesses, agencies, course sellers, and experts build a lead-to-call pipeline loop.
-The public workflow asks for business context, offer, target buyer, proof/assets, market preference, current funnel, follow-up/CRM context, and constraints.
+The public workflow requires only email and a compact business snapshot. Offer, target buyer, proof/assets, market preference, current funnel, follow-up/CRM context, optional weekly lead-to-call metrics, bottleneck context, and constraints are optional detail inputs.
-Cloudflare Workers AI generates the Pipeline Brief server-side. Client-side code does not call model providers, platform admin APIs, ad accounts, databases, or private credentials directly.
+The agents are expected to infer missing context, label assumptions, and ask only true blocker questions when missing information would prevent a useful next step.
+
+Cloudflare Workers AI generates the Pipeline Brief, Implementation Checklist, and Weekly Fix Report server-side. Client-side code does not call model providers, platform admin APIs, ad accounts, databases, or private credentials directly.
## Agent Outputs
The Agent Desk can generate:
-- Readiness diagnosis
-- Recommended funnel path
-- Audience and pain map
-- First four creative tests
-- Lead qualification form
-- Follow-up and setter flow
-- CRM and tracking checklist
-- 7-day or 15-day decision plan
-- Approval gates and risks
+- Pipeline Brief with readiness diagnosis, funnel path, audience and pain map, first four creative tests, lead qualification, follow-up, CRM, tracking, decision plan, and approval gates
+- Implementation Checklist for setup work across offer, funnel, creative, qualification, follow-up, booking/reminders, CRM stages, tracking events, and review cadence
+- Weekly Fix Report that uses supplied weekly metrics when available, otherwise provides contextual first-week guidance plus the metrics to collect
## Safety And Limits
@@ -37,6 +33,6 @@ Claims, ad spend, campaign publishing, platform connections, tracking implementa
## Data Handling
-The public app stores email signup and lightweight usage metadata in Cloudflare D1, including daily rate-limit counters and a daily IP-derived rate-limit key. The business brief is processed to generate the output and is not stored by this app.
+The public app stores email signup and lightweight usage metadata in Cloudflare D1, including daily rate-limit counters and a daily IP-derived rate-limit key. The business snapshot, optional details, weekly metrics, and generated artifacts are processed to generate the output and are not stored by this app.
There is no public endpoint for reading collected emails or usage metadata.
diff --git a/public/offer.md b/public/offer.md
index 90719cc5..866d7d9c 100644
--- a/public/offer.md
+++ b/public/offer.md
@@ -2,19 +2,17 @@
TinyStudio Agent Desk is a self-serve AI workspace for high-ticket pipeline setup.
-It helps build the operating system around an offer before a business spends more on ads: offer diagnosis, funnel path, ad angles, qualification, follow-up, CRM stages, tracking checklist, and decision rules.
+It helps build the operating system around an offer before a business spends more on ads: offer diagnosis, funnel path, ad angles, qualification, follow-up, CRM stages, tracking checklist, implementation tasks, and weekly decision rules.
+
+The customer can start with only an email and a rough business snapshot. The agents infer missing context, state assumptions, and ask only true blocker questions when more information is genuinely needed.
## What It Generates
-- Readiness diagnosis
-- Recommended funnel path
-- Audience and pain map
-- First four creative tests
-- Lead qualification form
-- Follow-up and setter flow
-- CRM and tracking checklist
-- 7-day or 15-day decision plan
-- Approval gates and risks
+- Pipeline Brief
+- Implementation Checklist
+- Weekly Fix Report
+
+Those artifacts can include readiness diagnosis, recommended funnel path, audience and pain map, first four creative tests, lead qualification form, follow-up and setter flow, CRM and tracking checklist, 7-day or 15-day decision plan, metric tracker, and approval gates.
## What It Does Not Do
@@ -26,6 +24,7 @@ It helps build the operating system around an offer before a business spends mor
- No ad spend changes
- No ad account connection
- No prospect message sending
+- No storage of submitted business snapshots, optional details, weekly metrics, or generated artifacts
- No replacement for a sales team
## Contact
diff --git a/public/script.js b/public/script.js
index b7a231ef..b71fce9e 100644
--- a/public/script.js
+++ b/public/script.js
@@ -2,10 +2,17 @@ const agentForm = document.querySelector("[data-agent-form]");
const agentStatus = document.querySelector("[data-agent-status]");
const agentOutput = document.querySelector("[data-agent-output]");
const outputEmpty = document.querySelector("[data-output-empty]");
+const outputTitle = document.querySelector("[data-output-title]");
const copyButton = document.querySelector("[data-copy-output]");
+const outputTabs = [...document.querySelectorAll("[data-output-tab]")];
const EMPTY_OUTPUT_TEXT =
- "Your generated system will appear here: readiness diagnosis, funnel path, audience/pain map, four creative tests, lead form, follow-up, CRM, tracking, and decision rules.";
+ "Your generated system will appear here: Pipeline Brief, Implementation Checklist, and Weekly Fix Report.";
+const SECTION_LABELS = {
+ pipelineBrief: "Pipeline Brief",
+ implementationChecklist: "Implementation Checklist",
+ weeklyFixReport: "Weekly Fix Report"
+};
const ERROR_MESSAGES = {
ai_unavailable: "The AI desk is not available right now. Try again shortly.",
cross_site_blocked: "Open TinyStudio.io directly and run the agents from this page.",
@@ -13,7 +20,7 @@ const ERROR_MESSAGES = {
daily_ip_limit: "This connection has reached today's run limit. Try again tomorrow.",
empty_agent_output: "The agents could not produce a useful brief. Try again in a moment.",
invalid_email: "Add a valid email address.",
- invalid_input: "Add email, business, offer, and target buyer first.",
+ invalid_input: "Add email and a business snapshot first.",
method_not_allowed: "That request type is not supported.",
request_too_large: "That intake is too long. Shorten it and run the agents again.",
same_origin_required: "Open TinyStudio.io directly and run the agents from this page.",
@@ -22,6 +29,12 @@ const ERROR_MESSAGES = {
};
let copyResetTimer;
+let activeSection = "pipelineBrief";
+let currentSections = {
+ pipelineBrief: "",
+ implementationChecklist: "",
+ weeklyFixReport: ""
+};
function setStatus(message, state = "") {
if (!agentStatus || !agentForm) return;
@@ -39,12 +52,18 @@ function resetCopyButton() {
clearTimeout(copyResetTimer);
copyResetTimer = undefined;
}
- copyButton.textContent = "Copy brief";
+ copyButton.textContent = "Copy section";
copyButton.disabled = true;
}
function showEmpty(message = EMPTY_OUTPUT_TEXT) {
if (!agentOutput || !outputEmpty) return;
+ currentSections = {
+ pipelineBrief: "",
+ implementationChecklist: "",
+ weeklyFixReport: ""
+ };
+ setActiveSection("pipelineBrief");
agentOutput.textContent = "";
agentOutput.hidden = true;
outputEmpty.textContent = message;
@@ -52,13 +71,153 @@ function showEmpty(message = EMPTY_OUTPUT_TEXT) {
resetCopyButton();
}
-function showBrief(brief) {
+function normalizeSections(data) {
+ const sections = data?.sections || {};
+ return {
+ pipelineBrief: sections.pipelineBrief || data?.brief || "",
+ implementationChecklist: sections.implementationChecklist || "",
+ weeklyFixReport: sections.weeklyFixReport || ""
+ };
+}
+
+function activeSectionText() {
+ return currentSections[activeSection] || "";
+}
+
+function escapeHtml(value) {
+ return String(value || "")
+ .replace(/&/g, "&")
+ .replace(//g, ">")
+ .replace(/"/g, """)
+ .replace(/'/g, "'");
+}
+
+function inlineMarkdown(value) {
+ return escapeHtml(value).replace(/\*\*([^*]+)\*\*/g, "$1");
+}
+
+function renderTable(rows) {
+ const parsedRows = rows
+ .map((row) => row.trim().replace(/^\||\|$/g, "").split("|").map((cell) => cell.trim()))
+ .filter((cells) => cells.some(Boolean));
+ const dataRows = parsedRows.filter((cells) => !cells.every((cell) => /^:?-{3,}:?$/.test(cell)));
+ if (!dataRows.length) return "";
+
+ const [head, ...body] = dataRows;
+ return [
+ "
",
+ `
${head.map((cell) => `
${inlineMarkdown(cell)}
`).join("")}
`,
+ `${body.map((cells) => `
${cells.map((cell) => `
${inlineMarkdown(cell)}
`).join("")}
`).join("")}`,
+ "
"
+ ].join("");
+}
+
+function renderMarkdown(markdown, sectionKey) {
+ const title = SECTION_LABELS[sectionKey];
+ const lines = String(markdown || "").replace(/\r\n/g, "\n").split("\n");
+ const html = [];
+ let listItems = [];
+ let tableRows = [];
+ let paragraph = [];
+
+ const flushList = () => {
+ if (!listItems.length) return;
+ html.push(`
Build the pipeline system before you buy more ads.
+
+ The agents turn your offer, audience, proof, funnel, follow-up, CRM, weekly numbers, and market context into a Pipeline Brief, Implementation Checklist, and Weekly Fix Report. They draft the system; you still approve spend, publishing, and claims.
+
+ Your generated system will appear here: Pipeline Brief, Implementation Checklist, and Weekly Fix Report.
+
+
+
+
+
+
+ Automated now
+ Diagnosis, recommendations, hooks, lead forms, follow-up scripts, CRM stages, tracking checklist, and decision plan.
+
+
+ Approval-gated
+ Claims, ad spend, campaign publishing, platform connections, CRM outcome syncing, and anything compliance-sensitive.
+
+
+ Stored
+ Email and lightweight usage metadata, including daily rate-limit counters. The business snapshot, optional details, weekly metrics, and generated artifacts are processed for the output and are not saved by this app.
+
+
+
+
+
+
+
+
+