@caddis/cli 0.1.0 → 0.2.0
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/README.md +29 -16
- package/bundles/antigravity-plugin-extras/plugin.json +5 -0
- package/bundles/antigravity-plugin-extras/skills/_registry.md +154 -0
- package/bundles/antigravity-plugin-extras/skills/agent-md-refactor/SKILL.md +356 -0
- package/bundles/antigravity-plugin-extras/skills/agent-orchestration/SKILL.md +517 -0
- package/bundles/antigravity-plugin-extras/skills/algorithmic-art/SKILL.md +293 -0
- package/bundles/antigravity-plugin-extras/skills/anchor-review/SKILL.md +135 -0
- package/bundles/antigravity-plugin-extras/skills/api-client-patterns/SKILL.md +367 -0
- package/bundles/antigravity-plugin-extras/skills/architecture-design/SKILL.md +244 -0
- package/bundles/antigravity-plugin-extras/skills/architecture-diagram/SKILL.md +156 -0
- package/bundles/antigravity-plugin-extras/skills/architecture-document/SKILL.md +321 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/SKILL.md +74 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/scripts/init-artifact.sh +322 -0
- package/bundles/antigravity-plugin-extras/skills/artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/bundles/antigravity-plugin-extras/skills/ascii-art/SKILL.md +144 -0
- package/bundles/antigravity-plugin-extras/skills/asking-questions/SKILL.md +81 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/SKILL.md +118 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/cross-service/credential-management.md +450 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/browser/README.md +363 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/code-interpreter/README.md +232 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/README.md +100 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/deploy-template.sh +117 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/deployment-strategies.md +416 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/troubleshooting-guide.md +384 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/gateway/validate-deployment.sh +186 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/identity/README.md +186 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/memory/README.md +253 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/observability/README.md +517 -0
- package/bundles/antigravity-plugin-extras/skills/aws-agentic-ai/services/runtime/README.md +215 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cdk-development/SKILL.md +279 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cdk-development/references/cdk-patterns.md +431 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cdk-development/scripts/validate-stack.sh +240 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cost-operations/SKILL.md +318 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cost-operations/references/cloudwatch-alarms.md +567 -0
- package/bundles/antigravity-plugin-extras/skills/aws-cost-operations/references/operations-patterns.md +394 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/SKILL.md +758 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/deployment-best-practices.md +830 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/eda-patterns.md +1002 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/observability-best-practices.md +770 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/performance-optimization.md +671 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/security-best-practices.md +625 -0
- package/bundles/antigravity-plugin-extras/skills/aws-serverless-eda/references/serverless-patterns.md +838 -0
- package/bundles/antigravity-plugin-extras/skills/backend-to-frontend-handoff/SKILL.md +139 -0
- package/bundles/antigravity-plugin-extras/skills/banner-design/SKILL.md +188 -0
- package/bundles/antigravity-plugin-extras/skills/brand-design/SKILL.md +298 -0
- package/bundles/antigravity-plugin-extras/skills/brand-guidelines/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/brand-guidelines/SKILL.md +118 -0
- package/bundles/antigravity-plugin-extras/skills/brand-voice/SKILL.md +93 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/SKILL.md +392 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/agent-patterns.md +461 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/examples.md +188 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/state-patterns.md +360 -0
- package/bundles/antigravity-plugin-extras/skills/building-ai-agent-on-cloudflare/references/troubleshooting.md +362 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/SKILL.md +266 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/references/examples.md +115 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/references/oauth-setup.md +338 -0
- package/bundles/antigravity-plugin-extras/skills/building-mcp-server-on-cloudflare/references/troubleshooting.md +317 -0
- package/bundles/antigravity-plugin-extras/skills/caching-patterns/SKILL.md +385 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/SKILL.md +91 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/bundles/antigravity-plugin-extras/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/bundles/antigravity-plugin-extras/skills/changelog-generator/SKILL.md +105 -0
- package/bundles/antigravity-plugin-extras/skills/code-explainer/SKILL.md +91 -0
- package/bundles/antigravity-plugin-extras/skills/competitive-ads-extractor/SKILL.md +294 -0
- package/bundles/antigravity-plugin-extras/skills/component-testing/SKILL.md +310 -0
- package/bundles/antigravity-plugin-extras/skills/content-research-writer/SKILL.md +539 -0
- package/bundles/antigravity-plugin-extras/skills/cross-review/SKILL.md +51 -0
- package/bundles/antigravity-plugin-extras/skills/data-analysis/SKILL.md +111 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/README.md +248 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/SKILL.md +203 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/adapter.py.template +44 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/api-router.py.template +43 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/contract-test.py.template +384 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/display-dto.py.template +39 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/frontend-service.ts.template +46 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/frontend-types.ts.template +38 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/ingestion-model.py.template +42 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/mapping-doc.md.template +46 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/normalizer.py.template +48 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/prompts/extract_requirements.md +36 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/prompts/extract_ui_demand.md +35 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/prompts/reconcile_mapping.md +66 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/assets/query-catalog.md.template +62 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/references/consumer-driven-contracts.md +131 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/references/drift-check-catalog.md +305 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/references/layer-responsibilities.md +333 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/discover_connections.py +170 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/discover_sources.py +161 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/drift_check.py +171 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/extract_schema.py +1363 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/generate_gap_report.py +81 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/generate_mapping_doc.py +294 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/ts_dto_compare.py +214 -0
- package/bundles/antigravity-plugin-extras/skills/data-contract-pipeline/scripts/validate_lineage.py +51 -0
- package/bundles/antigravity-plugin-extras/skills/data-loader/SKILL.md +753 -0
- package/bundles/antigravity-plugin-extras/skills/data-validation/SKILL.md +220 -0
- package/bundles/antigravity-plugin-extras/skills/db-testing/SKILL.md +117 -0
- package/bundles/antigravity-plugin-extras/skills/deploy-local/SKILL.md +259 -0
- package/bundles/antigravity-plugin-extras/skills/design-md/SKILL.md +167 -0
- package/bundles/antigravity-plugin-extras/skills/design-system-tokens/SKILL.md +240 -0
- package/bundles/antigravity-plugin-extras/skills/design-system-tokens/references/DESIGN-SYSTEM-TEMPLATE.md +577 -0
- package/bundles/antigravity-plugin-extras/skills/developer-growth-analysis/SKILL.md +323 -0
- package/bundles/antigravity-plugin-extras/skills/doc-coauthoring/SKILL.md +378 -0
- package/bundles/antigravity-plugin-extras/skills/documentation-analyzer/SKILL.md +78 -0
- package/bundles/antigravity-plugin-extras/skills/domain-name-brainstormer/SKILL.md +213 -0
- package/bundles/antigravity-plugin-extras/skills/enterprise-dashboard-aesthetic-system/SKILL.md +120 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/SKILL.md +193 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/references/element-types.md +497 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/references/excalidraw-schema.md +356 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/references/reliable-diagrams.md +115 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/README.md +60 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/add-arrow.py +354 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/add-icon-to-diagram.py +412 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/scripts/split-excalidraw-library.py +183 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/business-flow-swimlane-template.excalidraw +334 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/class-diagram-template.excalidraw +558 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/data-flow-diagram-template.excalidraw +279 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/er-diagram-template.excalidraw +662 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/flowchart-template.excalidraw +179 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/mindmap-template.excalidraw +244 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/relationship-template.excalidraw +145 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/reliable-flowchart.excalidraw +1 -0
- package/bundles/antigravity-plugin-extras/skills/excalidraw/templates/sequence-diagram-template.excalidraw +509 -0
- package/bundles/antigravity-plugin-extras/skills/file-organizer/SKILL.md +434 -0
- package/bundles/antigravity-plugin-extras/skills/game-changing-features/README.md +221 -0
- package/bundles/antigravity-plugin-extras/skills/game-changing-features/SKILL.md +265 -0
- package/bundles/antigravity-plugin-extras/skills/github-issues/SKILL.md +359 -0
- package/bundles/antigravity-plugin-extras/skills/github-issues/references/templates.md +90 -0
- package/bundles/antigravity-plugin-extras/skills/golden-nuggets/SKILL.md +192 -0
- package/bundles/antigravity-plugin-extras/skills/humanizer/SKILL.md +194 -0
- package/bundles/antigravity-plugin-extras/skills/image-enhancer/SKILL.md +100 -0
- package/bundles/antigravity-plugin-extras/skills/intent-writer/SKILL.md +201 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/SKILL.md +124 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/3p-updates.md +47 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/company-newsletter.md +65 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/faq-answers.md +30 -0
- package/bundles/antigravity-plugin-extras/skills/internal-comms/examples/general-comms.md +16 -0
- package/bundles/antigravity-plugin-extras/skills/invoice-organizer/SKILL.md +447 -0
- package/bundles/antigravity-plugin-extras/skills/jira-issues/SKILL.md +182 -0
- package/bundles/antigravity-plugin-extras/skills/job-application/SKILL.md +188 -0
- package/bundles/antigravity-plugin-extras/skills/lead-research-assistant/SKILL.md +200 -0
- package/bundles/antigravity-plugin-extras/skills/llm-application-dev/SKILL.md +217 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/SKILL.md +100 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/evaluation.md +602 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/mcp_best_practices.md +915 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/node_mcp_server.md +916 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/references/python_mcp_server.md +752 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/connections.py +151 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/bundles/antigravity-plugin-extras/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/bundles/antigravity-plugin-extras/skills/meeting-insights-analyzer/SKILL.md +328 -0
- package/bundles/antigravity-plugin-extras/skills/monorepo/SKILL.md +267 -0
- package/bundles/antigravity-plugin-extras/skills/naming-analyzer/SKILL.md +376 -0
- package/bundles/antigravity-plugin-extras/skills/nextjs-app-router/SKILL.md +271 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/AUTHENTICATION.md +154 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/SKILL.md +270 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/api_reference.md +309 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/troubleshooting.md +376 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/references/usage_patterns.md +338 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/__init__.py +81 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/ask_question.py +256 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/auth_manager.py +358 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/browser_session.py +255 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/browser_utils.py +107 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/cleanup_manager.py +302 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/config.py +44 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/notebook_manager.py +410 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/run.py +102 -0
- package/bundles/antigravity-plugin-extras/skills/notebooklm/scripts/setup_environment.py +204 -0
- package/bundles/antigravity-plugin-extras/skills/observability/SKILL.md +371 -0
- package/bundles/antigravity-plugin-extras/skills/onboard-project/SKILL.md +192 -0
- package/bundles/antigravity-plugin-extras/skills/performance-testing/SKILL.md +226 -0
- package/bundles/antigravity-plugin-extras/skills/pipeline-state/SKILL.md +208 -0
- package/bundles/antigravity-plugin-extras/skills/plantuml/SKILL.md +228 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/SKILL.md +142 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/templates/linear.app.md +196 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/templates/stripe.md +214 -0
- package/bundles/antigravity-plugin-extras/skills/popular-web-designs/templates/vercel.md +218 -0
- package/bundles/antigravity-plugin-extras/skills/prd-to-code/SKILL.md +127 -0
- package/bundles/antigravity-plugin-extras/skills/raffle-winner-picker/SKILL.md +159 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/README.md +320 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/SKILL.md +53 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/alternatives.md +258 -0
- package/bundles/antigravity-plugin-extras/skills/react-useeffect/anti-patterns.md +290 -0
- package/bundles/antigravity-plugin-extras/skills/receiving-code-review/SKILL.md +213 -0
- package/bundles/antigravity-plugin-extras/skills/relay/SKILL.md +246 -0
- package/bundles/antigravity-plugin-extras/skills/requesting-code-review/SKILL.md +105 -0
- package/bundles/antigravity-plugin-extras/skills/requesting-code-review/code-reviewer.md +146 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/SKILL.md +350 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/references/pwa-checklist.md +226 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/references/touch-and-interaction.md +265 -0
- package/bundles/antigravity-plugin-extras/skills/responsive-mobile-native/references/transformation-catalogue.md +326 -0
- package/bundles/antigravity-plugin-extras/skills/schema-migration/SKILL.md +275 -0
- package/bundles/antigravity-plugin-extras/skills/setup-project-ai/SKILL.md +120 -0
- package/bundles/antigravity-plugin-extras/skills/shadcn-radix/SKILL.md +330 -0
- package/bundles/antigravity-plugin-extras/skills/sketch/SKILL.md +104 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/SKILL.md +646 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/color_palettes.py +302 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/easing.py +230 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/frame_composer.py +469 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/gif_builder.py +246 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/typography.py +357 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/validators.py +264 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/core/visual_effects.py +494 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/requirements.txt +4 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/bounce.py +106 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/explode.py +331 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/fade.py +329 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/flip.py +291 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/kaleidoscope.py +211 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/morph.py +329 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/move.py +293 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/pulse.py +268 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/shake.py +127 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/slide.py +291 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/spin.py +269 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/wiggle.py +300 -0
- package/bundles/antigravity-plugin-extras/skills/slack-gif-creator/templates/zoom.py +312 -0
- package/bundles/antigravity-plugin-extras/skills/slides/SKILL.md +38 -0
- package/bundles/antigravity-plugin-extras/skills/state-tracking/SKILL.md +131 -0
- package/bundles/antigravity-plugin-extras/skills/streamlit-dev/SKILL.md +268 -0
- package/bundles/antigravity-plugin-extras/skills/svg-create/SKILL.md +251 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/SKILL.md +59 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/theme-showcase.pdf +0 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/arctic-frost.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/botanical-garden.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/desert-rose.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/forest-canopy.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/golden-hour.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/midnight-galaxy.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/modern-minimalist.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/ocean-depths.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/sunset-boulevard.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/theme-factory/themes/tech-innovation.md +19 -0
- package/bundles/antigravity-plugin-extras/skills/ui-styling-patterns/LICENSE.txt +202 -0
- package/bundles/antigravity-plugin-extras/skills/ui-styling-patterns/SKILL.md +320 -0
- package/bundles/antigravity-plugin-extras/skills/ui-testing/SKILL.md +660 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/SKILL.md +660 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/_sync_all.py +414 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/app-interface.csv +31 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/charts.csv +26 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/colors.csv +162 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/design.csv +1776 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/draft.csv +1779 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/google-fonts.csv +1924 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/icons.csv +106 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/landing.csv +35 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/products.csv +162 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/react-performance.csv +45 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/styles.csv +85 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/typography.csv +74 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/ui-reasoning.csv +162 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/data/ux-guidelines.csv +100 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/scripts/core.py +247 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/scripts/design_system.py +1067 -0
- package/bundles/antigravity-plugin-extras/skills/ui-ux-intelligence/scripts/search.py +114 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/SKILL.md +140 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/references/commands.md +252 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/references/graph-schema.md +116 -0
- package/bundles/antigravity-plugin-extras/skills/understand-anything/references/pipeline.md +331 -0
- package/bundles/antigravity-plugin-extras/skills/update-readme/SKILL.md +74 -0
- package/bundles/antigravity-plugin-extras/skills/verification-loop/SKILL.md +209 -0
- package/bundles/antigravity-plugin-extras/skills/video-downloader/SKILL.md +107 -0
- package/bundles/antigravity-plugin-extras/skills/webapp-development/SKILL.md +288 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/SKILL.md +339 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/agents/agent-interface.md +175 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/html.md +384 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/nlp-keywords.md +127 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/palettes.md +149 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/python.md +249 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/react.md +427 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/shapes.md +135 -0
- package/bundles/antigravity-plugin-extras/skills/word-cloud/references/stopwords.md +115 -0
- package/bundles/antigravity-plugin-extras/skills/youtube-transcript/SKILL.md +416 -0
- package/bundles/manifest.json +2 -1
- package/dist/cli.js +166 -37
- package/package.json +1 -1
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
# Agent Patterns
|
|
2
|
+
|
|
3
|
+
Advanced patterns for building sophisticated agents.
|
|
4
|
+
|
|
5
|
+
## Tool Calling
|
|
6
|
+
|
|
7
|
+
Agents can expose tools that AI models can call:
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { Agent, Connection } from "agents";
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
|
|
13
|
+
interface Tool {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
parameters: z.ZodSchema;
|
|
17
|
+
handler: (params: any) => Promise<string>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class ToolAgent extends Agent<Env, State> {
|
|
21
|
+
private tools: Map<string, Tool> = new Map();
|
|
22
|
+
|
|
23
|
+
async onStart() {
|
|
24
|
+
// Register tools
|
|
25
|
+
this.registerTool({
|
|
26
|
+
name: "get_weather",
|
|
27
|
+
description: "Get current weather for a city",
|
|
28
|
+
parameters: z.object({ city: z.string() }),
|
|
29
|
+
handler: async ({ city }) => {
|
|
30
|
+
const res = await fetch(`https://api.weather.com/${city}`);
|
|
31
|
+
return JSON.stringify(await res.json());
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
this.registerTool({
|
|
36
|
+
name: "search_database",
|
|
37
|
+
description: "Search the document database",
|
|
38
|
+
parameters: z.object({ query: z.string(), limit: z.number().default(10) }),
|
|
39
|
+
handler: async ({ query, limit }) => {
|
|
40
|
+
const results = await this.sql`
|
|
41
|
+
SELECT * FROM documents
|
|
42
|
+
WHERE content LIKE ${`%${query}%`}
|
|
43
|
+
LIMIT ${limit}
|
|
44
|
+
`;
|
|
45
|
+
return JSON.stringify(results);
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
private registerTool(tool: Tool) {
|
|
51
|
+
this.tools.set(tool.name, tool);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async onMessage(connection: Connection, message: string) {
|
|
55
|
+
const data = JSON.parse(message);
|
|
56
|
+
|
|
57
|
+
if (data.type === "chat") {
|
|
58
|
+
await this.handleChatWithTools(connection, data.content);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private async handleChatWithTools(connection: Connection, userMessage: string) {
|
|
63
|
+
// Build tool descriptions for the AI
|
|
64
|
+
const toolDescriptions = Array.from(this.tools.values()).map((t) => ({
|
|
65
|
+
type: "function",
|
|
66
|
+
function: {
|
|
67
|
+
name: t.name,
|
|
68
|
+
description: t.description,
|
|
69
|
+
parameters: JSON.parse(JSON.stringify(t.parameters)),
|
|
70
|
+
},
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
// First AI call - may request tool use
|
|
74
|
+
const response = await this.env.AI.run("@cf/meta/llama-3-8b-instruct", {
|
|
75
|
+
messages: [
|
|
76
|
+
{ role: "system", content: "You are a helpful assistant with access to tools." },
|
|
77
|
+
...this.state.messages,
|
|
78
|
+
{ role: "user", content: userMessage },
|
|
79
|
+
],
|
|
80
|
+
tools: toolDescriptions,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// Check if AI wants to use a tool
|
|
84
|
+
if (response.tool_calls) {
|
|
85
|
+
for (const toolCall of response.tool_calls) {
|
|
86
|
+
const tool = this.tools.get(toolCall.function.name);
|
|
87
|
+
if (tool) {
|
|
88
|
+
const params = JSON.parse(toolCall.function.arguments);
|
|
89
|
+
const result = await tool.handler(params);
|
|
90
|
+
|
|
91
|
+
// Send tool result back to AI
|
|
92
|
+
const finalResponse = await this.env.AI.run("@cf/meta/llama-3-8b-instruct", {
|
|
93
|
+
messages: [
|
|
94
|
+
...this.state.messages,
|
|
95
|
+
{ role: "user", content: userMessage },
|
|
96
|
+
{ role: "assistant", tool_calls: response.tool_calls },
|
|
97
|
+
{ role: "tool", tool_call_id: toolCall.id, content: result },
|
|
98
|
+
],
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
connection.send(JSON.stringify({
|
|
102
|
+
type: "response",
|
|
103
|
+
content: finalResponse.response,
|
|
104
|
+
toolUsed: toolCall.function.name,
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
connection.send(JSON.stringify({
|
|
110
|
+
type: "response",
|
|
111
|
+
content: response.response,
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## RAG (Retrieval Augmented Generation)
|
|
119
|
+
|
|
120
|
+
Combine Vectorize with Agents for knowledge-grounded responses:
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
interface Env {
|
|
124
|
+
AI: Ai;
|
|
125
|
+
VECTORIZE: VectorizeIndex;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export class RAGAgent extends Agent<Env, State> {
|
|
129
|
+
async onMessage(connection: Connection, message: string) {
|
|
130
|
+
const data = JSON.parse(message);
|
|
131
|
+
|
|
132
|
+
if (data.type === "chat") {
|
|
133
|
+
// 1. Generate embedding for query
|
|
134
|
+
const embedding = await this.env.AI.run("@cf/baai/bge-base-en-v1.5", {
|
|
135
|
+
text: data.content,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// 2. Search vector database
|
|
139
|
+
const results = await this.env.VECTORIZE.query(embedding.data[0], {
|
|
140
|
+
topK: 5,
|
|
141
|
+
returnMetadata: true,
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// 3. Build context from results
|
|
145
|
+
const context = results.matches
|
|
146
|
+
.map((m) => m.metadata?.text || "")
|
|
147
|
+
.join("\n\n");
|
|
148
|
+
|
|
149
|
+
// 4. Generate response with context
|
|
150
|
+
const response = await this.env.AI.run("@cf/meta/llama-3-8b-instruct", {
|
|
151
|
+
messages: [
|
|
152
|
+
{
|
|
153
|
+
role: "system",
|
|
154
|
+
content: `Answer based on this context:\n\n${context}\n\nIf the context doesn't contain relevant information, say so.`,
|
|
155
|
+
},
|
|
156
|
+
{ role: "user", content: data.content },
|
|
157
|
+
],
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// 5. Update state and respond
|
|
161
|
+
this.setState({
|
|
162
|
+
messages: [
|
|
163
|
+
...this.state.messages,
|
|
164
|
+
{ role: "user", content: data.content },
|
|
165
|
+
{ role: "assistant", content: response.response },
|
|
166
|
+
],
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
connection.send(JSON.stringify({
|
|
170
|
+
type: "response",
|
|
171
|
+
content: response.response,
|
|
172
|
+
sources: results.matches.map((m) => m.metadata?.source),
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Ingest documents into vector store
|
|
178
|
+
async ingestDocument(doc: { id: string; text: string; source: string }) {
|
|
179
|
+
const embedding = await this.env.AI.run("@cf/baai/bge-base-en-v1.5", {
|
|
180
|
+
text: doc.text,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
await this.env.VECTORIZE.upsert([{
|
|
184
|
+
id: doc.id,
|
|
185
|
+
values: embedding.data[0],
|
|
186
|
+
metadata: { text: doc.text, source: doc.source },
|
|
187
|
+
}]);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Multi-Agent Orchestration
|
|
193
|
+
|
|
194
|
+
Coordinate multiple specialized agents:
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
interface Env {
|
|
198
|
+
RESEARCHER: DurableObjectNamespace;
|
|
199
|
+
WRITER: DurableObjectNamespace;
|
|
200
|
+
REVIEWER: DurableObjectNamespace;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export class OrchestratorAgent extends Agent<Env, State> {
|
|
204
|
+
async onMessage(connection: Connection, message: string) {
|
|
205
|
+
const data = JSON.parse(message);
|
|
206
|
+
|
|
207
|
+
if (data.type === "create_article") {
|
|
208
|
+
connection.send(JSON.stringify({ type: "status", step: "researching" }));
|
|
209
|
+
|
|
210
|
+
// Step 1: Research agent gathers information
|
|
211
|
+
const researchResult = await this.callAgent(
|
|
212
|
+
this.env.RESEARCHER,
|
|
213
|
+
data.topic,
|
|
214
|
+
{ action: "research", topic: data.topic }
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
connection.send(JSON.stringify({ type: "status", step: "writing" }));
|
|
218
|
+
|
|
219
|
+
// Step 2: Writer agent creates draft
|
|
220
|
+
const draftResult = await this.callAgent(
|
|
221
|
+
this.env.WRITER,
|
|
222
|
+
data.topic,
|
|
223
|
+
{ action: "write", research: researchResult, topic: data.topic }
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
connection.send(JSON.stringify({ type: "status", step: "reviewing" }));
|
|
227
|
+
|
|
228
|
+
// Step 3: Reviewer agent improves draft
|
|
229
|
+
const finalResult = await this.callAgent(
|
|
230
|
+
this.env.REVIEWER,
|
|
231
|
+
data.topic,
|
|
232
|
+
{ action: "review", draft: draftResult }
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
connection.send(JSON.stringify({
|
|
236
|
+
type: "complete",
|
|
237
|
+
article: finalResult,
|
|
238
|
+
}));
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
private async callAgent(
|
|
243
|
+
namespace: DurableObjectNamespace,
|
|
244
|
+
id: string,
|
|
245
|
+
payload: any
|
|
246
|
+
): Promise<string> {
|
|
247
|
+
const agentId = namespace.idFromName(id);
|
|
248
|
+
const agent = namespace.get(agentId);
|
|
249
|
+
|
|
250
|
+
const response = await agent.fetch("http://agent/task", {
|
|
251
|
+
method: "POST",
|
|
252
|
+
body: JSON.stringify(payload),
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
return response.text();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Human-in-the-Loop
|
|
261
|
+
|
|
262
|
+
Pause agent execution for human approval:
|
|
263
|
+
|
|
264
|
+
```typescript
|
|
265
|
+
interface State {
|
|
266
|
+
pendingApprovals: Array<{
|
|
267
|
+
id: string;
|
|
268
|
+
action: string;
|
|
269
|
+
data: any;
|
|
270
|
+
requestedAt: string;
|
|
271
|
+
}>;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export class ApprovalAgent extends Agent<Env, State> {
|
|
275
|
+
initialState: State = { pendingApprovals: [] };
|
|
276
|
+
|
|
277
|
+
async onMessage(connection: Connection, message: string) {
|
|
278
|
+
const data = JSON.parse(message);
|
|
279
|
+
|
|
280
|
+
if (data.type === "request_action") {
|
|
281
|
+
// Action requires approval
|
|
282
|
+
if (this.requiresApproval(data.action)) {
|
|
283
|
+
const approvalId = crypto.randomUUID();
|
|
284
|
+
|
|
285
|
+
this.setState({
|
|
286
|
+
pendingApprovals: [
|
|
287
|
+
...this.state.pendingApprovals,
|
|
288
|
+
{
|
|
289
|
+
id: approvalId,
|
|
290
|
+
action: data.action,
|
|
291
|
+
data: data.payload,
|
|
292
|
+
requestedAt: new Date().toISOString(),
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
connection.send(JSON.stringify({
|
|
298
|
+
type: "approval_required",
|
|
299
|
+
approvalId,
|
|
300
|
+
action: data.action,
|
|
301
|
+
description: this.describeAction(data.action, data.payload),
|
|
302
|
+
}));
|
|
303
|
+
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// Execute immediately if no approval needed
|
|
308
|
+
await this.executeAction(connection, data.action, data.payload);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (data.type === "approve") {
|
|
312
|
+
const approval = this.state.pendingApprovals.find(
|
|
313
|
+
(a) => a.id === data.approvalId
|
|
314
|
+
);
|
|
315
|
+
|
|
316
|
+
if (approval) {
|
|
317
|
+
// Remove from pending
|
|
318
|
+
this.setState({
|
|
319
|
+
pendingApprovals: this.state.pendingApprovals.filter(
|
|
320
|
+
(a) => a.id !== data.approvalId
|
|
321
|
+
),
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
// Execute the approved action
|
|
325
|
+
await this.executeAction(connection, approval.action, approval.data);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if (data.type === "reject") {
|
|
330
|
+
this.setState({
|
|
331
|
+
pendingApprovals: this.state.pendingApprovals.filter(
|
|
332
|
+
(a) => a.id !== data.approvalId
|
|
333
|
+
),
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
connection.send(JSON.stringify({
|
|
337
|
+
type: "action_rejected",
|
|
338
|
+
approvalId: data.approvalId,
|
|
339
|
+
}));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
private requiresApproval(action: string): boolean {
|
|
344
|
+
const sensitiveActions = ["delete", "send_email", "make_payment", "publish"];
|
|
345
|
+
return sensitiveActions.includes(action);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
private describeAction(action: string, data: any): string {
|
|
349
|
+
// Generate human-readable description
|
|
350
|
+
return `${action}: ${JSON.stringify(data)}`;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
private async executeAction(connection: Connection, action: string, data: any) {
|
|
354
|
+
// Execute the action
|
|
355
|
+
const result = await this.performAction(action, data);
|
|
356
|
+
|
|
357
|
+
connection.send(JSON.stringify({
|
|
358
|
+
type: "action_completed",
|
|
359
|
+
action,
|
|
360
|
+
result,
|
|
361
|
+
}));
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
## Streaming Responses
|
|
367
|
+
|
|
368
|
+
Stream AI responses in real-time:
|
|
369
|
+
|
|
370
|
+
```typescript
|
|
371
|
+
export class StreamingAgent extends Agent<Env, State> {
|
|
372
|
+
async onMessage(connection: Connection, message: string) {
|
|
373
|
+
const data = JSON.parse(message);
|
|
374
|
+
|
|
375
|
+
if (data.type === "chat") {
|
|
376
|
+
// Start streaming response
|
|
377
|
+
const stream = await this.env.AI.run("@cf/meta/llama-3-8b-instruct", {
|
|
378
|
+
messages: [
|
|
379
|
+
{ role: "system", content: "You are a helpful assistant." },
|
|
380
|
+
...this.state.messages,
|
|
381
|
+
{ role: "user", content: data.content },
|
|
382
|
+
],
|
|
383
|
+
stream: true,
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
let fullResponse = "";
|
|
387
|
+
|
|
388
|
+
// Stream chunks to client
|
|
389
|
+
for await (const chunk of stream) {
|
|
390
|
+
if (chunk.response) {
|
|
391
|
+
fullResponse += chunk.response;
|
|
392
|
+
connection.send(JSON.stringify({
|
|
393
|
+
type: "stream",
|
|
394
|
+
content: chunk.response,
|
|
395
|
+
done: false,
|
|
396
|
+
}));
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// Update state with complete response
|
|
401
|
+
this.setState({
|
|
402
|
+
messages: [
|
|
403
|
+
...this.state.messages,
|
|
404
|
+
{ role: "user", content: data.content },
|
|
405
|
+
{ role: "assistant", content: fullResponse },
|
|
406
|
+
],
|
|
407
|
+
});
|
|
408
|
+
|
|
409
|
+
// Signal completion
|
|
410
|
+
connection.send(JSON.stringify({
|
|
411
|
+
type: "stream",
|
|
412
|
+
content: "",
|
|
413
|
+
done: true,
|
|
414
|
+
}));
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
## Connecting to MCP Servers
|
|
421
|
+
|
|
422
|
+
Agents can connect to MCP servers as clients:
|
|
423
|
+
|
|
424
|
+
```typescript
|
|
425
|
+
export class MCPClientAgent extends Agent<Env, State> {
|
|
426
|
+
async onStart() {
|
|
427
|
+
// Connect to external MCP server
|
|
428
|
+
await this.addMcpServer(
|
|
429
|
+
"github",
|
|
430
|
+
"https://github-mcp.example.com/sse",
|
|
431
|
+
{ headers: { Authorization: `Bearer ${this.env.GITHUB_TOKEN}` } }
|
|
432
|
+
);
|
|
433
|
+
|
|
434
|
+
await this.addMcpServer(
|
|
435
|
+
"database",
|
|
436
|
+
"https://db-mcp.example.com/sse"
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
async onMessage(connection: Connection, message: string) {
|
|
441
|
+
const data = JSON.parse(message);
|
|
442
|
+
|
|
443
|
+
if (data.type === "use_tool") {
|
|
444
|
+
// Call tool on connected MCP server
|
|
445
|
+
const servers = await this.getMcpServers();
|
|
446
|
+
const server = servers.find((s) => s.name === data.server);
|
|
447
|
+
|
|
448
|
+
if (server) {
|
|
449
|
+
const result = await server.callTool(data.tool, data.params);
|
|
450
|
+
connection.send(JSON.stringify({ type: "tool_result", result }));
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
async onClose() {
|
|
456
|
+
// Cleanup MCP connections
|
|
457
|
+
await this.removeMcpServer("github");
|
|
458
|
+
await this.removeMcpServer("database");
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
```
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Project Bootstrapping
|
|
2
|
+
|
|
3
|
+
Instructions for creating new agent projects.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Create Command
|
|
8
|
+
|
|
9
|
+
Execute in terminal to generate a new project:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm create cloudflare@latest -- my-agent \
|
|
13
|
+
--template=cloudflare/agents-starter
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or use npx directly:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx create-cloudflare@latest --template cloudflare/agents-starter
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Includes:
|
|
23
|
+
- Persistent data via `this.setState` and `this.sql`
|
|
24
|
+
- WebSocket real-time connections
|
|
25
|
+
- Workers AI bindings ready
|
|
26
|
+
- React chat interface example
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Project Layout
|
|
31
|
+
|
|
32
|
+
Generated structure:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
my-agent/
|
|
36
|
+
├── src/
|
|
37
|
+
│ ├── app.tsx # React chat interface
|
|
38
|
+
│ ├── server.ts # Agent implementation
|
|
39
|
+
│ ├── tools.ts # Tool definitions
|
|
40
|
+
│ └── utils.ts # Helpers
|
|
41
|
+
├── wrangler.toml # Platform configuration
|
|
42
|
+
└── package.json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Agent Variations
|
|
48
|
+
|
|
49
|
+
**Chat-focused:**
|
|
50
|
+
|
|
51
|
+
Inherit from base `Agent` class, implement `onMessage` handler:
|
|
52
|
+
- Manual conversation tracking
|
|
53
|
+
- Full control over responses
|
|
54
|
+
- Integrates with any AI provider
|
|
55
|
+
|
|
56
|
+
**Persistent data:**
|
|
57
|
+
|
|
58
|
+
Use `this.setState()` for automatic persistence:
|
|
59
|
+
- JSON-serializable data
|
|
60
|
+
- Auto-syncs to connected clients
|
|
61
|
+
- Survives instance eviction
|
|
62
|
+
|
|
63
|
+
**Per-session isolation:**
|
|
64
|
+
|
|
65
|
+
Route by unique identifier in URL path:
|
|
66
|
+
- Each identifier gets dedicated instance
|
|
67
|
+
- Isolated data storage
|
|
68
|
+
- Horizontal scaling automatic
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Platform Documentation
|
|
73
|
+
|
|
74
|
+
- developers.cloudflare.com/agents/
|
|
75
|
+
- developers.cloudflare.com/agents/getting-started/
|
|
76
|
+
- developers.cloudflare.com/agents/api-reference/
|
|
77
|
+
|
|
78
|
+
**Source repositories:**
|
|
79
|
+
- `github.com/cloudflare/agents-starter` (starter template)
|
|
80
|
+
- `github.com/cloudflare/agents/tree/main/examples` (reference implementations)
|
|
81
|
+
|
|
82
|
+
**Related services:**
|
|
83
|
+
|
|
84
|
+
- developers.cloudflare.com/workers-ai/ (AI models)
|
|
85
|
+
- developers.cloudflare.com/vectorize/ (vector search)
|
|
86
|
+
- developers.cloudflare.com/d1/ (SQL database)
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Reference Implementations
|
|
91
|
+
|
|
92
|
+
Located at `github.com/cloudflare/agents/tree/main/examples`:
|
|
93
|
+
|
|
94
|
+
| Example | Description |
|
|
95
|
+
|---------|-------------|
|
|
96
|
+
| `resumable-stream-chat` | Chat with reconnection-safe streaming |
|
|
97
|
+
| `email-agent` | Handle incoming emails via Email Routing |
|
|
98
|
+
| `mcp-client` | Connect agents to external MCP servers |
|
|
99
|
+
| `mcp-worker` | Expose agent capabilities via MCP protocol |
|
|
100
|
+
| `cross-domain` | Multi-domain authentication patterns |
|
|
101
|
+
| `tictactoe` | Multiplayer game with shared state |
|
|
102
|
+
| `a2a` | Agent-to-agent communication |
|
|
103
|
+
| `codemode` | Code transformation workflows |
|
|
104
|
+
| `playground` | Interactive testing sandbox |
|
|
105
|
+
|
|
106
|
+
Browse each folder for complete implementation code and wrangler configuration.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Selection Matrix
|
|
111
|
+
|
|
112
|
+
| Goal | Approach |
|
|
113
|
+
|------|----------|
|
|
114
|
+
| Conversational bot | Agent + onMessage handler |
|
|
115
|
+
| Custom data schema | Agent + setState() |
|
|
116
|
+
| Knowledge retrieval | Agent + Vectorize |
|
|
117
|
+
| Background jobs | Agent + schedule() |
|
|
118
|
+
| External integrations | Agent + tool definitions |
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Commands Reference
|
|
123
|
+
|
|
124
|
+
**Local execution:**
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
cd my-agent
|
|
128
|
+
npm install
|
|
129
|
+
npm start
|
|
130
|
+
# Accessible at http://localhost:8787
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Production push:**
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npx wrangler deploy
|
|
137
|
+
# Accessible at https://[name].[subdomain].workers.dev
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**WebSocket connection:**
|
|
141
|
+
|
|
142
|
+
```javascript
|
|
143
|
+
// URL pattern: /agents/:className/:instanceName
|
|
144
|
+
const socket = new WebSocket("wss://my-agent.workers.dev/agents/MyAgent/session-123");
|
|
145
|
+
|
|
146
|
+
socket.onmessage = (e) => {
|
|
147
|
+
console.log("Received:", JSON.parse(e.data));
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
socket.send(JSON.stringify({ type: "chat", content: "Hello" }));
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**React integration:**
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
import { useAgent } from "agents/react";
|
|
157
|
+
|
|
158
|
+
function Chat() {
|
|
159
|
+
const { state, send } = useAgent({
|
|
160
|
+
agent: "my-agent",
|
|
161
|
+
name: "session-123",
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// state auto-updates, send() dispatches messages
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Key Methods (from Agent class)
|
|
171
|
+
|
|
172
|
+
| Method | Purpose |
|
|
173
|
+
|--------|---------|
|
|
174
|
+
| `onStart()` | Runs on instance startup |
|
|
175
|
+
| `onConnect()` | Handles new WebSocket connections |
|
|
176
|
+
| `onMessage()` | Processes incoming messages |
|
|
177
|
+
| `onClose()` | Cleanup on disconnect |
|
|
178
|
+
| `setState()` | Persist and broadcast data |
|
|
179
|
+
| `this.sql` | Query embedded SQLite |
|
|
180
|
+
| `schedule()` | Delayed/recurring tasks |
|
|
181
|
+
| `broadcast()` | Message all connections |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Help Channels
|
|
186
|
+
|
|
187
|
+
- Cloudflare Discord
|
|
188
|
+
- GitHub discussions on cloudflare/agents repository
|