chore(examples): migrate to v3 authoring and lifecycle APIs
Draft
ZR
4d ago+1930+1930+0123456789012345678901234567890123456789-1279-1279-0123456789012345678901234567890123456789
PR Checklist
- Commit message follows repository conventions.
Bugs / Features
- Examples and generated starter code updated.
- CLI deployment guidance updated.
- Changeset included for CLI and create-voltagent-app.
What is the current behavior?
Examples and generators teach constructor-based authoring and implicit startup, so newly scaffolded applications do not match the v3 API.
What is the new behavior?
- Migrate repository examples to canonical authoring factories and explicit application readiness.
- Update create-voltagent-app templates and the example generator.
- Update CLI deployment output, including serverless readiness guidance.
- Preserve native AI SDK tools and integration-specific behavior.
Testing
- CLI and create-voltagent-app builds passed.
- LibSQL dependency and the base example build passed.
- Repository lint, changed Markdown formatting, and whitespace checks passed.
- The entire example catalog was not individually built or run against external services.
Notes for reviewers
Layer 3 of 4. Depends on #1454 and #1455; merge those first.
This cross-fork draft targets upstream next, so its diff initially includes layers 1–2. The examples/scaffolding-specific commit is 681f108d. Rebase this branch onto next after its dependencies merge, preserving that commit.
Review order: #1454 → #1455 → this PR → documentation.
Summary by cubic
Migrates repository examples and generated starter code to the v3 authoring and lifecycle APIs so newly scaffolded applications match the v3 core API.
- Replaces
new Agent(...),tool(...), andnew VoltAgent(...)in examples withdefineAgent,defineTool, and thevoltagentfactory. - Makes application startup explicit by awaiting
voltagent(...).ready()instead of relying on implicit construction-time startup. - Updates
create-voltagent-apptemplates and the example generator to use the canonical factories. - Updates CLI deployment guidance with
await app.ready()before creating serverless handlers. AgentandVoltAgentare now type-only exports; their runtime classes are internal.
Notes for reviewers
- Layer 3 of 4; depends on #1454 and #1455, which should merge first.
- Native AI SDK tools and integration-specific behavior are preserved.
- CLI and
create-voltagent-appbuilds, the LibSQL dependency, the base example, lint, and Markdown/whitespace checks passed; the full example catalog was not built or run against external services.