# Publishing v1.0.1 - Infrastructure Removal Patch

## Critical Issue with v1.0.0

**Problem**: v1.0.0 was published with infrastructure provider names exposed in npm metadata:
- Keywords: "tavus", "daily.co", "avatar"
- Description: "integration for Tavus video avatars"
- README: Multiple mentions of "Tavus" and "Daily.co"

**Impact**: Customers can see our infrastructure stack, which should be hidden.

## v1.0.1 Fixes

### package.json Changes
- ✅ Version: 1.0.0 → 1.0.1
- ✅ Description: "Tavus video avatars" → "AI video presenters"
- ✅ Keywords removed: "tavus", "daily.co", "avatar"
- ✅ Keywords added: "ai-presenter", "video-conversation", "video-widget"

### README.md Changes
- ✅ "Tavus avatars" → "AI presenters"
- ✅ "Daily.co" → generic video call terminology
- ✅ Type names: `TavusApiError` → `ApiError`, `isDailyPostMessageEvent` → `isCallPostMessageEvent`
- ✅ Config fields: `persona_id`/`replica_id` → `presenter_id`

### CHANGELOG.md
- ✅ Added v1.0.1 release notes explaining the fix

## Pre-Publish Checklist

Before publishing v1.0.1, verify:

- [ ] All changes committed: `git status`
- [ ] On correct branch: `git branch --show-current` (should be epic/universal-npm-package-cdn-distribution)
- [ ] Build package: Run build command to generate dist/ with v1.0.1
- [ ] Verify dist/: Check `dist/libs/engage-package/package.json` shows v1.0.1
- [ ] Verify keywords: No "tavus" or "daily.co" in dist/ package.json
- [ ] Verify description: No "Tavus" in description
- [ ] npm login: Authenticated as @buzztrail-ai org member

## Publishing Steps

### 1. Rebuild Package

The source files have been updated, but dist/ still has v1.0.0 built files.

**Option A: If there's a build script**:
```bash
# From monorepo root
pnpm nx run engage-package:build
# or
cd libs/engage-package && pnpm run build
```

**Option B: Manual copy** (if no build script available):
```bash
# Copy updated source files to dist
cp libs/engage-package/package.json dist/libs/engage-package/
cp libs/engage-package/README.md dist/libs/engage-package/
cp libs/engage-package/CHANGELOG.md dist/libs/engage-package/
```

### 2. Verify Build Output

```bash
cd dist/libs/engage-package

# Check version
grep '"version"' package.json
# Should show: "version": "1.0.1"

# Check description (no "Tavus")
grep '"description"' package.json
# Should show: "AI video presenters" NOT "Tavus video avatars"

# Check keywords (no "tavus" or "daily.co")
grep -A 20 '"keywords"' package.json
# Should NOT contain "tavus" or "daily.co"
```

### 3. Dry Run

```bash
cd dist/libs/engage-package
npm pack --dry-run
```

Verify output:
- Tarball name: `buzztrail-ai-engage-1.0.1.tgz` (version 1.0.1)
- Files list includes README.md, CHANGELOG.md with v1.0.1 content

### 4. Publish to npm

```bash
cd dist/libs/engage-package
npm publish --access public
```

Expected output:
```
+ @buzztrail-ai/engage@1.0.1
```

### 5. Verify Publication

```bash
npm view @buzztrail-ai/engage
```

Check:
- ✅ Latest version: 1.0.1
- ✅ Description: "AI video presenters" (no "Tavus")
- ✅ Keywords: No "tavus" or "daily.co"
- ✅ dist-tags.latest: 1.0.1

### 6. Verify CDN Sync (wait 5-10 minutes)

**jsDelivr**:
```bash
curl -I https://cdn.jsdelivr.net/npm/@buzztrail-ai/engage@1.0.1/buzztrail.min.js
# Should return 200 OK after sync completes
```

**unpkg**:
```bash
curl -I https://unpkg.com/@buzztrail-ai/engage@1.0.1/buzztrail.min.js
# Should return 200 OK after sync completes
```

**@latest alias** (should now point to 1.0.1):
```bash
curl -I https://cdn.jsdelivr.net/npm/@buzztrail-ai/engage@latest/buzztrail.min.js
# Check x-jsd-version header: should be 1.0.1
```

## Post-Publishing Tasks

### 1. Deprecate v1.0.0

v1.0.0 exposed infrastructure, so deprecate it:

```bash
npm deprecate @buzztrail-ai/engage@1.0.0 "Infrastructure providers exposed in metadata. Use v1.0.1+ for customer-facing package."
```

This adds a warning when users try to install v1.0.0.

### 2. Update Documentation

- [ ] Update CDN examples to use @1.0.1 instead of @1.0.0
- [ ] Update production deployment guides
- [ ] Notify team of version update

### 3. Test Production Sites

- [ ] Test CDN loading on a test page
- [ ] Verify @latest now points to 1.0.1
- [ ] Check npm package page shows correct metadata

### 4. Git Tag

```bash
git tag -a v1.0.1 -m "Release v1.0.1: Remove infrastructure provider exposure"
git push origin v1.0.1
```

### 5. Update Epic Status

- [ ] Mark Issue #174 as "completed with patch"
- [ ] Update progress.md with v1.0.1 release
- [ ] Close GitHub issue with note about v1.0.1 fix

## Success Criteria

v1.0.1 is successful when:

- ✅ Published to npm as @buzztrail-ai/engage@1.0.1
- ✅ npm page shows NO "Tavus" or "Daily.co" in keywords or description
- ✅ @latest points to 1.0.1 on both jsDelivr and unpkg
- ✅ v1.0.0 deprecated with warning message
- ✅ All CDN URLs accessible for v1.0.1
- ✅ README on npm shows customer-facing content only

## Rollback Plan

If v1.0.1 has issues:

```bash
# Unpublish within 24 hours
npm unpublish @buzztrail-ai/engage@1.0.1

# Or deprecate and publish v1.0.2
npm deprecate @buzztrail-ai/engage@1.0.1 "Issue description"
# Fix issues, bump to 1.0.2, republish
```

## Notes

- **Why patch release?**: v1.0.0 is in production but has metadata issue
- **Breaking change?**: No - functionality identical, only metadata changed
- **User impact**: Users on v1.0.0 will see deprecation warning, should update
- **CDN impact**: @latest will point to 1.0.1, pinned @1.0.0 URLs still work

## Timeline

- **v1.0.0**: Published 2025-10-24 ~19:43 UTC
- **Issue discovered**: 2025-10-24 ~21:50 UTC (~2 hours later)
- **v1.0.1 fix prepared**: 2025-10-24 ~22:00 UTC
- **v1.0.1 publish target**: ASAP (infrastructure exposure is critical)

---

**Status**: Ready to build and publish
**Priority**: HIGH (infrastructure exposure)
**Risk**: LOW (metadata-only change)
