@jaimevalasek/aioson 1.3.0 → 1.5.1
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/CHANGELOG.md +31 -1
- package/LICENSE +661 -21
- package/README.md +22 -3
- package/docs/en/squad-dashboard.md +372 -0
- package/docs/openclaw-bridge.md +308 -0
- package/docs/pt/README.md +62 -2
- package/docs/pt/advisor-spec.md +5 -5
- package/docs/pt/agentes-customizados.md +670 -0
- package/docs/pt/agentes.md +235 -23
- package/docs/pt/automacao-squads.md +407 -0
- package/docs/pt/cenarios.md +49 -5
- package/docs/pt/clientes-ai.md +62 -0
- package/docs/pt/comandos-cli.md +226 -17
- package/docs/pt/deyvin.md +115 -0
- package/docs/pt/genome-3.0-spec.md +11 -11
- package/docs/pt/inicio-rapido.md +63 -2
- package/docs/pt/memoria-contexto.md +255 -0
- package/docs/pt/output-strategy-delivery.md +655 -0
- package/docs/pt/profiler-system.md +17 -17
- package/docs/pt/runtime-observability.md +5 -1
- package/docs/pt/skills.md +175 -0
- package/docs/pt/squad-dashboard.md +373 -0
- package/docs/pt/{squad-genoma.md → squad-genome.md} +81 -75
- package/docs/testing/genome-2.0-matrix.md +5 -5
- package/docs/testing/genome-2.0-rollout.md +10 -10
- package/package.json +4 -4
- package/src/agents.js +21 -5
- package/src/backup-local.js +74 -0
- package/src/backup-provider.js +303 -0
- package/src/cli.js +276 -2
- package/src/commands/agents.js +22 -4
- package/src/commands/backup-local-cmd.js +25 -0
- package/src/commands/backup.js +533 -0
- package/src/commands/cloud.js +17 -17
- package/src/commands/context-pack.js +45 -0
- package/src/commands/implementation-plan.js +340 -0
- package/src/commands/learning.js +134 -0
- package/src/commands/live.js +1583 -0
- package/src/commands/runtime.js +1075 -2
- package/src/commands/scan-project.js +288 -24
- package/src/commands/setup-context.js +30 -2
- package/src/commands/skill.js +558 -0
- package/src/commands/squad-agent-create.js +788 -0
- package/src/commands/squad-daemon.js +209 -0
- package/src/commands/squad-dashboard.js +39 -0
- package/src/commands/squad-deploy.js +64 -0
- package/src/commands/squad-doctor.js +103 -1
- package/src/commands/squad-investigate.js +261 -0
- package/src/commands/squad-learning.js +209 -0
- package/src/commands/squad-mcp.js +270 -0
- package/src/commands/squad-pipeline.js +247 -1
- package/src/commands/squad-plan.js +329 -0
- package/src/commands/squad-processes.js +56 -0
- package/src/commands/squad-recovery.js +42 -0
- package/src/commands/squad-roi.js +291 -0
- package/src/commands/squad-score.js +250 -0
- package/src/commands/squad-status.js +38 -2
- package/src/commands/squad-validate.js +118 -1
- package/src/commands/squad-webhook.js +160 -0
- package/src/commands/squad-worker.js +191 -0
- package/src/commands/squad-worktrees.js +75 -0
- package/src/commands/test-agents.js +6 -1
- package/src/commands/web-map.js +70 -0
- package/src/commands/web-scrape.js +71 -0
- package/src/commands/workflow-next.js +8 -1
- package/src/commands/workflow-status.js +250 -0
- package/src/constants.js +88 -16
- package/src/context-memory.js +837 -0
- package/src/context-writer.js +47 -1
- package/src/delivery-runner.js +319 -0
- package/src/genome-files.js +1 -1
- package/src/genome-format.js +1 -1
- package/src/i18n/messages/en.js +333 -8
- package/src/i18n/messages/es.js +240 -6
- package/src/i18n/messages/fr.js +239 -5
- package/src/i18n/messages/pt-BR.js +330 -12
- package/src/installer.js +30 -2
- package/src/lib/genomes/compat.js +1 -1
- package/src/lib/webhook-server.js +328 -0
- package/src/mcp-connectors/registry.js +602 -0
- package/src/runtime-store.js +1037 -42
- package/src/session-handoff.js +77 -0
- package/src/squad/external-session.js +180 -0
- package/src/squad/inter-squad.js +74 -0
- package/src/squad/recovery-context.js +201 -0
- package/src/squad/worktree-manager.js +114 -0
- package/src/squad-daemon.js +490 -0
- package/src/squad-dashboard/api.js +223 -0
- package/src/squad-dashboard/attachment-handler.js +93 -0
- package/src/squad-dashboard/context-monitor.js +157 -0
- package/src/squad-dashboard/execution-logs.js +115 -0
- package/src/squad-dashboard/hunk-review.js +209 -0
- package/src/squad-dashboard/metrics.js +133 -0
- package/src/squad-dashboard/process-monitor.js +125 -0
- package/src/squad-dashboard/renderer.js +858 -0
- package/src/squad-dashboard/server.js +232 -0
- package/src/squad-dashboard/styles.js +525 -0
- package/src/squad-dashboard/token-tracker.js +99 -0
- package/src/web.js +284 -0
- package/src/worker-runner.js +339 -0
- package/template/.aioson/agents/analyst.md +40 -9
- package/template/.aioson/agents/architect.md +24 -5
- package/template/.aioson/agents/dev.md +254 -25
- package/template/.aioson/agents/deyvin.md +174 -0
- package/template/.aioson/agents/discovery-design-doc.md +25 -1
- package/template/.aioson/agents/{genoma.md → genome.md} +20 -20
- package/template/.aioson/agents/neo.md +152 -0
- package/template/.aioson/agents/orache.md +388 -0
- package/template/.aioson/agents/orchestrator.md +63 -2
- package/template/.aioson/agents/pair.md +5 -0
- package/template/.aioson/agents/pm.md +17 -5
- package/template/.aioson/agents/product.md +113 -29
- package/template/.aioson/agents/profiler-enricher.md +1 -1
- package/template/.aioson/agents/profiler-forge.md +9 -9
- package/template/.aioson/agents/profiler-researcher.md +1 -1
- package/template/.aioson/agents/qa.md +18 -5
- package/template/.aioson/agents/setup.md +138 -18
- package/template/.aioson/agents/sheldon.md +603 -0
- package/template/.aioson/agents/squad.md +866 -28
- package/template/.aioson/agents/tester.md +254 -0
- package/template/.aioson/agents/ux-ui.md +289 -34
- package/template/.aioson/config.md +181 -0
- package/template/.aioson/context/spec.md.template +17 -0
- package/template/.aioson/genomes/.gitkeep +0 -0
- package/template/.aioson/installed-skills/.gitkeep +0 -0
- package/template/.aioson/locales/en/agents/analyst.md +34 -4
- package/template/.aioson/locales/en/agents/architect.md +18 -0
- package/template/.aioson/locales/en/agents/dev.md +155 -11
- package/template/.aioson/locales/en/agents/deyvin.md +137 -0
- package/template/.aioson/locales/en/agents/{genoma.md → genome.md} +14 -14
- package/template/.aioson/locales/en/agents/neo.md +8 -0
- package/template/.aioson/locales/en/agents/orchestrator.md +62 -2
- package/template/.aioson/locales/en/agents/pair.md +5 -0
- package/template/.aioson/locales/en/agents/pm.md +7 -0
- package/template/.aioson/locales/en/agents/product.md +35 -17
- package/template/.aioson/locales/en/agents/qa.md +56 -0
- package/template/.aioson/locales/en/agents/setup.md +53 -6
- package/template/.aioson/locales/en/agents/sheldon.md +340 -0
- package/template/.aioson/locales/en/agents/squad.md +203 -15
- package/template/.aioson/locales/en/agents/ux-ui.md +383 -35
- package/template/.aioson/locales/es/agents/analyst.md +24 -4
- package/template/.aioson/locales/es/agents/architect.md +18 -0
- package/template/.aioson/locales/es/agents/dev.md +136 -9
- package/template/.aioson/locales/es/agents/deyvin.md +97 -0
- package/template/.aioson/locales/es/agents/{genoma.md → genome.md} +13 -13
- package/template/.aioson/locales/es/agents/neo.md +48 -0
- package/template/.aioson/locales/es/agents/orache.md +103 -0
- package/template/.aioson/locales/es/agents/orchestrator.md +62 -2
- package/template/.aioson/locales/es/agents/pair.md +5 -0
- package/template/.aioson/locales/es/agents/pm.md +7 -0
- package/template/.aioson/locales/es/agents/product.md +13 -3
- package/template/.aioson/locales/es/agents/qa.md +33 -0
- package/template/.aioson/locales/es/agents/setup.md +30 -6
- package/template/.aioson/locales/es/agents/sheldon.md +192 -0
- package/template/.aioson/locales/es/agents/squad.md +284 -15
- package/template/.aioson/locales/es/agents/ux-ui.md +34 -25
- package/template/.aioson/locales/fr/agents/analyst.md +24 -4
- package/template/.aioson/locales/fr/agents/architect.md +18 -0
- package/template/.aioson/locales/fr/agents/dev.md +136 -9
- package/template/.aioson/locales/fr/agents/deyvin.md +97 -0
- package/template/.aioson/locales/fr/agents/{genoma.md → genome.md} +7 -7
- package/template/.aioson/locales/fr/agents/neo.md +48 -0
- package/template/.aioson/locales/fr/agents/orache.md +104 -0
- package/template/.aioson/locales/fr/agents/orchestrator.md +62 -2
- package/template/.aioson/locales/fr/agents/pair.md +5 -0
- package/template/.aioson/locales/fr/agents/pm.md +7 -0
- package/template/.aioson/locales/fr/agents/product.md +13 -3
- package/template/.aioson/locales/fr/agents/qa.md +33 -0
- package/template/.aioson/locales/fr/agents/setup.md +30 -6
- package/template/.aioson/locales/fr/agents/sheldon.md +192 -0
- package/template/.aioson/locales/fr/agents/squad.md +279 -10
- package/template/.aioson/locales/fr/agents/ux-ui.md +34 -25
- package/template/.aioson/locales/pt-BR/agents/analyst.md +45 -4
- package/template/.aioson/locales/pt-BR/agents/architect.md +29 -0
- package/template/.aioson/locales/pt-BR/agents/dev.md +167 -15
- package/template/.aioson/locales/pt-BR/agents/deyvin.md +137 -0
- package/template/.aioson/locales/pt-BR/agents/{genoma.md → genome.md} +49 -49
- package/template/.aioson/locales/pt-BR/agents/neo.md +147 -0
- package/template/.aioson/locales/pt-BR/agents/orache.md +137 -0
- package/template/.aioson/locales/pt-BR/agents/orchestrator.md +62 -2
- package/template/.aioson/locales/pt-BR/agents/pair.md +5 -0
- package/template/.aioson/locales/pt-BR/agents/pm.md +7 -0
- package/template/.aioson/locales/pt-BR/agents/product.md +43 -20
- package/template/.aioson/locales/pt-BR/agents/qa.md +67 -0
- package/template/.aioson/locales/pt-BR/agents/setup.md +53 -6
- package/template/.aioson/locales/pt-BR/agents/sheldon.md +192 -0
- package/template/.aioson/locales/pt-BR/agents/squad.md +591 -47
- package/template/.aioson/locales/pt-BR/agents/ux-ui.md +369 -22
- package/template/.aioson/my-agents/.gitkeep +0 -0
- package/template/.aioson/rules/.gitkeep +0 -0
- package/template/.aioson/rules/squad/.gitkeep +0 -0
- package/template/.aioson/rules/squad/README.md +50 -0
- package/template/.aioson/schemas/genome-meta.schema.json +1 -1
- package/template/.aioson/schemas/genome.schema.json +1 -1
- package/template/.aioson/schemas/squad-blueprint.schema.json +32 -0
- package/template/.aioson/schemas/squad-manifest.schema.json +434 -1
- package/template/.aioson/skills/design/bold-editorial-ui/SKILL.md +205 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/art-direction.md +338 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/components.md +977 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/dashboards.md +218 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/design-tokens.md +326 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/motion.md +461 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/patterns.md +293 -0
- package/template/.aioson/skills/design/bold-editorial-ui/references/websites.md +352 -0
- package/template/.aioson/skills/design/clean-saas-ui/SKILL.md +210 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/art-direction.md +319 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/components.md +365 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/dashboards.md +196 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/design-tokens.md +244 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/motion.md +235 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/patterns.md +215 -0
- package/template/.aioson/skills/design/clean-saas-ui/references/websites.md +295 -0
- package/template/.aioson/skills/design/cognitive-core-ui/SKILL.md +203 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/art-direction.md +339 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/components.md +407 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/dashboards.md +272 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/design-tokens.md +524 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/motion.md +277 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/patterns.md +289 -0
- package/template/.aioson/skills/design/cognitive-core-ui/references/websites.md +437 -0
- package/template/.aioson/skills/design/interface-design/SKILL.md +47 -0
- package/template/.aioson/skills/design/interface-design/references/components-and-states.md +105 -0
- package/template/.aioson/skills/design/interface-design/references/design-directions.md +101 -0
- package/template/.aioson/skills/design/interface-design/references/handoff-and-quality.md +71 -0
- package/template/.aioson/skills/design/interface-design/references/intent-and-domain.md +74 -0
- package/template/.aioson/skills/design/interface-design/references/tokens-and-depth.md +173 -0
- package/template/.aioson/skills/design/premium-command-center-ui/SKILL.md +62 -0
- package/template/.aioson/skills/design/premium-command-center-ui/references/operations.md +74 -0
- package/template/.aioson/skills/design/premium-command-center-ui/references/patterns.md +116 -0
- package/template/.aioson/skills/design/premium-command-center-ui/references/validation.md +47 -0
- package/template/.aioson/skills/design/premium-command-center-ui/references/visual-system.md +215 -0
- package/template/.aioson/skills/design/warm-craft-ui/SKILL.md +209 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/art-direction.md +324 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/components.md +508 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/dashboards.md +223 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/design-tokens.md +374 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/motion.md +356 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/patterns.md +288 -0
- package/template/.aioson/skills/design/warm-craft-ui/references/websites.md +289 -0
- package/template/.aioson/skills/design-system/SKILL.md +92 -0
- package/template/.aioson/skills/design-system/cognitive-core-ui.skill +0 -0
- package/template/.aioson/skills/design-system/components/SKILL.md +274 -0
- package/template/.aioson/skills/design-system/components/SKILL.md:Zone.Identifier +0 -0
- package/template/.aioson/skills/design-system/dashboards/SKILL.md +184 -0
- package/template/.aioson/skills/design-system/dashboards/SKILL.md:Zone.Identifier +0 -0
- package/template/.aioson/skills/design-system/foundations/SKILL.md +250 -0
- package/template/.aioson/skills/design-system/foundations/SKILL.md:Zone.Identifier +0 -0
- package/template/.aioson/skills/design-system/motion/SKILL.md +197 -0
- package/template/.aioson/skills/design-system/motion/SKILL.md:Zone.Identifier +0 -0
- package/template/.aioson/skills/design-system/patterns/SKILL.md +231 -0
- package/template/.aioson/skills/design-system/patterns/SKILL.md:Zone.Identifier +0 -0
- package/template/.aioson/skills/premium-visual-design/SKILL.md +83 -0
- package/template/.aioson/skills/premium-visual-design/components/agent-badge.md +92 -0
- package/template/.aioson/skills/premium-visual-design/components/dependency-node.md +102 -0
- package/template/.aioson/skills/premium-visual-design/components/mention-autocomplete.md +136 -0
- package/template/.aioson/skills/premium-visual-design/components/notification-center.md +136 -0
- package/template/.aioson/skills/premium-visual-design/components/review-action-bar.md +188 -0
- package/template/.aioson/skills/premium-visual-design/components/team-switcher.md +131 -0
- package/template/.aioson/skills/premium-visual-design/patterns/agent-message-thread.md +198 -0
- package/template/.aioson/skills/premium-visual-design/patterns/notification-panel.md +275 -0
- package/template/.aioson/skills/premium-visual-design/patterns/review-workflow-ui.md +234 -0
- package/template/.aioson/skills/premium-visual-design/patterns/task-dependency-graph.md +147 -0
- package/template/.aioson/skills/premium-visual-design/tokens/status-extended.md +142 -0
- package/template/.aioson/skills/squad/SKILL.md +58 -0
- package/template/.aioson/skills/squad/domains/.gitkeep +0 -0
- package/template/.aioson/skills/squad/formats/.gitkeep +0 -0
- package/template/.aioson/skills/squad/formats/catalog.json +15 -0
- package/template/.aioson/skills/squad/formats/content/blog-post.md +47 -0
- package/template/.aioson/skills/squad/formats/content/newsletter.md +47 -0
- package/template/.aioson/skills/squad/formats/creative/podcast-script.md +43 -0
- package/template/.aioson/skills/squad/formats/creative/video-script.md +41 -0
- package/template/.aioson/skills/squad/formats/social/instagram-feed.md +42 -0
- package/template/.aioson/skills/squad/formats/social/linkedin-post.md +42 -0
- package/template/.aioson/skills/squad/formats/social/tiktok.md +39 -0
- package/template/.aioson/skills/squad/formats/social/twitter-thread.md +39 -0
- package/template/.aioson/skills/squad/formats/social/youtube-long.md +47 -0
- package/template/.aioson/skills/squad/formats/social/youtube-shorts.md +39 -0
- package/template/.aioson/skills/squad/patterns/.gitkeep +0 -0
- package/template/.aioson/skills/squad/patterns/multi-platform-pattern.md +108 -0
- package/template/.aioson/skills/squad/patterns/persona-based-pattern.md +98 -0
- package/template/.aioson/skills/squad/patterns/pipeline-pattern.md +106 -0
- package/template/.aioson/skills/squad/patterns/review-loop-pattern.md +81 -0
- package/template/.aioson/skills/squad/references/.gitkeep +0 -0
- package/template/.aioson/skills/squad/references/checklist-templates.md +122 -0
- package/template/.aioson/skills/squad/references/executor-archetypes.md +123 -0
- package/template/.aioson/skills/squad/references/workflow-templates.md +169 -0
- package/template/.aioson/skills/static/debugging-protocol.md +42 -0
- package/template/.aioson/skills/static/git-worktrees.md +36 -0
- package/template/.aioson/tasks/implementation-plan.md +307 -0
- package/template/.aioson/tasks/squad-create.md +1 -1
- package/template/.aioson/tasks/squad-design.md +28 -0
- package/template/.aioson/tasks/squad-execution-plan.md +279 -0
- package/template/.aioson/tasks/squad-export.md +1 -1
- package/template/.aioson/tasks/squad-investigate.md +44 -0
- package/template/.aioson/tasks/squad-learning-review.md +44 -0
- package/template/.aioson/tasks/squad-output-config.md +177 -0
- package/template/.aioson/tasks/squad-profile.md +48 -0
- package/template/.aioson/tasks/squad-review.md +61 -0
- package/template/.aioson/tasks/squad-task-decompose.md +66 -0
- package/template/.aioson/tasks/squad-validate.md +1 -1
- package/template/.claude/commands/aioson/agent/deyvin.md +5 -0
- package/template/.claude/commands/aioson/agent/discovery-design-doc.md +5 -0
- package/template/.claude/commands/aioson/agent/genome.md +5 -0
- package/template/.claude/commands/aioson/agent/neo.md +5 -0
- package/template/.claude/commands/aioson/agent/product.md +5 -0
- package/template/.claude/commands/aioson/agent/profiler-enricher.md +5 -0
- package/template/.claude/commands/aioson/agent/profiler-forge.md +5 -0
- package/template/.claude/commands/aioson/agent/profiler-researcher.md +5 -0
- package/template/.claude/commands/aioson/agent/squad.md +5 -0
- package/template/.claude/commands/aioson/agent/tester.md +5 -0
- package/template/.gemini/GEMINI.md +3 -0
- package/template/.gemini/commands/aios-deyvin.toml +6 -0
- package/template/.gemini/commands/aios-neo.toml +4 -0
- package/template/.gemini/commands/aios-pair.toml +6 -0
- package/template/.gemini/commands/aios-tester.toml +6 -0
- package/template/AGENTS.md +37 -6
- package/template/CLAUDE.md +34 -4
- package/template/OPENCODE.md +8 -2
- package/template/squad-searches/.gitkeep +0 -0
- package/template/.aioson/skills/static/interface-design.md +0 -372
- package/template/.aioson/skills/static/premium-command-center-ui.md +0 -190
- /package/template/.aioson/{genomas → docs}/.gitkeep +0 -0
- /package/template/.claude/commands/aioson/{analyst.md → agent/analyst.md} +0 -0
- /package/template/.claude/commands/aioson/{architect.md → agent/architect.md} +0 -0
- /package/template/.claude/commands/aioson/{dev.md → agent/dev.md} +0 -0
- /package/template/.claude/commands/aioson/{orchestrator.md → agent/orchestrator.md} +0 -0
- /package/template/.claude/commands/aioson/{pm.md → agent/pm.md} +0 -0
- /package/template/.claude/commands/aioson/{qa.md → agent/qa.md} +0 -0
- /package/template/.claude/commands/aioson/{setup.md → agent/setup.md} +0 -0
- /package/template/.claude/commands/aioson/{ux-ui.md → agent/ux-ui.md} +0 -0
|
@@ -0,0 +1,655 @@
|
|
|
1
|
+
# Output Strategy e Delivery de Conteúdo
|
|
2
|
+
|
|
3
|
+
> Guia completo sobre como configurar, automatizar e monitorar a entrega de conteúdo gerado pelas squads.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Visão Geral
|
|
8
|
+
|
|
9
|
+
Toda squad gera **conteúdo** (HTMLs, arquivos JSON, markdown, etc). O **Output Strategy** define **onde** e **como** esse conteúdo é entregue:
|
|
10
|
+
|
|
11
|
+
- **Files**: Salva em `output/{squad-slug}/`
|
|
12
|
+
- **SQLite**: Indexa em tabela `content_items` do runtime
|
|
13
|
+
- **Hybrid**: Faz ambos
|
|
14
|
+
- **Webhooks**: Dispara requests HTTP automáticos para URLs externas
|
|
15
|
+
- **Cloud**: Publica no catálogo cloud do AIOSON
|
|
16
|
+
|
|
17
|
+
O **Delivery Runner** é o sistema que:
|
|
18
|
+
- Detecta conteúdo novo ou modificado
|
|
19
|
+
- Valida se deve disparar webhooks
|
|
20
|
+
- Executa retries automáticos (até 3 tentativas)
|
|
21
|
+
- Registra logs de cada entrega em `delivery_log`
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Configuração: Squad Manifest
|
|
26
|
+
|
|
27
|
+
Todo squad tem um arquivo `squad.manifest.json` que controla a estratégia:
|
|
28
|
+
|
|
29
|
+
### Informação importante: Método HTTP
|
|
30
|
+
|
|
31
|
+
⚠️ **Webhooks SEMPRE usam POST** com `Content-Type: application/json`
|
|
32
|
+
|
|
33
|
+
Seu servidor deve estar preparado para receber:
|
|
34
|
+
```
|
|
35
|
+
POST /seu-endpoint HTTP/1.1
|
|
36
|
+
Content-Type: application/json
|
|
37
|
+
|
|
38
|
+
{ payload JSON aqui }
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Estrutura básica
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"schemaVersion": "1.0.0",
|
|
46
|
+
"slug": "youtube-creator",
|
|
47
|
+
"name": "YouTube Creator Squad",
|
|
48
|
+
"mode": "content",
|
|
49
|
+
"mission": "Criar roteiros e assets para YouTube",
|
|
50
|
+
"goal": "Gerar conteúdos virais com retenção forte",
|
|
51
|
+
|
|
52
|
+
"outputStrategy": {
|
|
53
|
+
"mode": "hybrid",
|
|
54
|
+
"fileOutput": {
|
|
55
|
+
"enabled": true,
|
|
56
|
+
"dir": "output/youtube-creator/",
|
|
57
|
+
"formats": ["html", "md", "json"]
|
|
58
|
+
},
|
|
59
|
+
"dataOutput": {
|
|
60
|
+
"enabled": true,
|
|
61
|
+
"storage": "sqlite",
|
|
62
|
+
"table": "content_items",
|
|
63
|
+
"contentItems": true
|
|
64
|
+
},
|
|
65
|
+
"delivery": {
|
|
66
|
+
"webhooks": [
|
|
67
|
+
{
|
|
68
|
+
"slug": "slack-notifier",
|
|
69
|
+
"url": "https://hooks.slack.com/services/YOUR/HOOK/HERE",
|
|
70
|
+
"trigger": "on-publish",
|
|
71
|
+
"format": "json",
|
|
72
|
+
"timeout": 10000
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"slug": "external-api",
|
|
76
|
+
"url": "https://api.example.com/content?key={{ENV:API_KEY}}",
|
|
77
|
+
"trigger": "on-new",
|
|
78
|
+
"format": "json"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"cloudPublish": false,
|
|
82
|
+
"autoPublish": true
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
"rules": {
|
|
87
|
+
"outputsDir": "output/youtube-creator/",
|
|
88
|
+
"logsDir": "aioson-logs/youtube-creator/",
|
|
89
|
+
"mediaDir": "media/youtube-creator/"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Campos de `outputStrategy`
|
|
95
|
+
|
|
96
|
+
#### `mode`
|
|
97
|
+
Define qual combinação de saídas usar:
|
|
98
|
+
- `"files"` — apenas salva em disco
|
|
99
|
+
- `"sqlite"` — apenas indexa em SQLite
|
|
100
|
+
- `"hybrid"` — ambos (recomendado)
|
|
101
|
+
|
|
102
|
+
#### `fileOutput`
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"enabled": true,
|
|
106
|
+
"dir": "output/{squad-slug}/",
|
|
107
|
+
"formats": ["html", "md", "json"]
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
- `enabled`: true para ativar
|
|
111
|
+
- `dir`: onde salvar os arquivos
|
|
112
|
+
- `formats`: quais extensões importam (outras são ignoradas)
|
|
113
|
+
|
|
114
|
+
#### `dataOutput`
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"enabled": true,
|
|
118
|
+
"storage": "sqlite",
|
|
119
|
+
"table": "content_items",
|
|
120
|
+
"contentItems": true
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
- `storage`: sempre `"sqlite"` por enquanto
|
|
124
|
+
- `table`: qual tabela usar
|
|
125
|
+
- `contentItems`: true para rastrear conteúdo individual
|
|
126
|
+
|
|
127
|
+
#### `delivery.webhooks[]`
|
|
128
|
+
Array de webhooks que devem disparar:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"slug": "identificador-unico",
|
|
133
|
+
"url": "https://api.example.com/webhook",
|
|
134
|
+
"trigger": "on-publish",
|
|
135
|
+
"format": "json",
|
|
136
|
+
"timeout": 10000,
|
|
137
|
+
"headers": {
|
|
138
|
+
"Authorization": "Bearer {{ENV:WEBHOOK_TOKEN}}"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Campos obrigatórios:**
|
|
144
|
+
- `slug`: identificador único para este webhook
|
|
145
|
+
- `url`: destino HTTP (suporta `{{ENV:VAR}}` para variáveis de ambiente)
|
|
146
|
+
- `trigger`: quando disparar
|
|
147
|
+
|
|
148
|
+
**Campos opcionais:**
|
|
149
|
+
- `format`: `"json"` (padrão) ou `"form"`
|
|
150
|
+
- `timeout`: timeout em ms (padrão 10000)
|
|
151
|
+
- `headers`: headers HTTP customizados
|
|
152
|
+
|
|
153
|
+
**Triggers disponíveis:**
|
|
154
|
+
- `"on-new"` — quando conteúdo novo é criado
|
|
155
|
+
- `"on-publish"` — quando conteúdo é marcado como publicado
|
|
156
|
+
- `"on-update"` — quando conteúdo é atualizado
|
|
157
|
+
- `"always"` — em qualquer mudança
|
|
158
|
+
|
|
159
|
+
#### `delivery.cloudPublish`
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"cloudPublish": true
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
Se `true`, publica o conteúdo no catálogo cloud do AIOSON.
|
|
166
|
+
|
|
167
|
+
#### `delivery.autoPublish`
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"autoPublish": true
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
Se `true`, o delivery runner dispara webhooks automaticamente após content ingestion. Se `false`, apenas responde a comandos CLI.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Payloads de Webhook
|
|
178
|
+
|
|
179
|
+
**Método HTTP:** Sempre `POST`
|
|
180
|
+
**Content-Type:** `application/json` (por padrão)
|
|
181
|
+
|
|
182
|
+
### Formato JSON (padrão)
|
|
183
|
+
|
|
184
|
+
Quando um webhook dispara, o payload é:
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"event": "on-publish",
|
|
189
|
+
"squadSlug": "youtube-creator",
|
|
190
|
+
"contentKey": "episode-001",
|
|
191
|
+
"timestamp": "2026-03-20T14:30:00Z",
|
|
192
|
+
"content": {
|
|
193
|
+
"jsonPath": "output/youtube-creator/episode-001.json",
|
|
194
|
+
"htmlPath": "output/youtube-creator/episode-001.html",
|
|
195
|
+
"data": {
|
|
196
|
+
"title": "Top 10 YouTube Shorts Trends",
|
|
197
|
+
"description": "...",
|
|
198
|
+
"tags": ["shorts", "trends", "viral"]
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"attempt": 1,
|
|
202
|
+
"retryCount": 0
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Campos:**
|
|
207
|
+
- `event`: qual trigger disparou ("on-new", "on-publish", etc)
|
|
208
|
+
- `squadSlug`: qual squad gerou o conteúdo
|
|
209
|
+
- `contentKey`: identificador único do conteúdo
|
|
210
|
+
- `timestamp`: ISO 8601
|
|
211
|
+
- `content.jsonPath`: caminho relativo ao JSON (se existir)
|
|
212
|
+
- `content.htmlPath`: caminho relativo ao HTML (se existir)
|
|
213
|
+
- `content.data`: conteúdo parseado como JSON
|
|
214
|
+
- `attempt`: número da tentativa (1-3)
|
|
215
|
+
- `retryCount`: quantas vezes foi retentado
|
|
216
|
+
|
|
217
|
+
### Formato Form (application/x-www-form-urlencoded)
|
|
218
|
+
|
|
219
|
+
Se `format: "form"`:
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
event=on-publish&squadSlug=youtube-creator&contentKey=episode-001×tamp=2026-03-20T14%3A30%3A00Z&content=%7B%22jsonPath%22%3A...%7D
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Configurando Variáveis de Ambiente
|
|
228
|
+
|
|
229
|
+
Webhooks frequentemente precisam de tokens de autenticação. Use placeholders `{{ENV:VAR_NAME}}`:
|
|
230
|
+
|
|
231
|
+
```json
|
|
232
|
+
{
|
|
233
|
+
"slug": "slack",
|
|
234
|
+
"url": "https://hooks.slack.com/services/{{ENV:SLACK_WEBHOOK_ID}}",
|
|
235
|
+
"headers": {
|
|
236
|
+
"Authorization": "Bearer {{ENV:API_KEY}}"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**No seu `.env` ou environment:**
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
SLACK_WEBHOOK_ID=T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
|
|
245
|
+
API_KEY=sk_live_xxxxx
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
O delivery runner resolve esses placeholders antes de fazer a requisição HTTP.
|
|
249
|
+
|
|
250
|
+
**⚠️ Aviso:** Se uma variável de ambiente referenciada não existir:
|
|
251
|
+
- O webhook **não dispara**
|
|
252
|
+
- Um aviso aparece em `squad:doctor`
|
|
253
|
+
- O conteúdo é indexado mas não entregue
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Monitorando Delivery
|
|
258
|
+
|
|
259
|
+
### `squad:doctor` com output strategy
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
aioson squad:doctor --squad=youtube-creator
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Mostra informações sobre output strategy:
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
Output strategy: mode=hybrid, webhooks=2, cloudPublish=false, autoPublish=true
|
|
269
|
+
|
|
270
|
+
✓ Output strategy: OK
|
|
271
|
+
✗ Webhook "slack": env var SLACK_WEBHOOK_ID not set
|
|
272
|
+
⚠ autoPublish is enabled but one webhook has unset env vars
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### `delivery:log` (próximas versões)
|
|
276
|
+
|
|
277
|
+
Visualizar histórico de entregas:
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
aioson delivery:log --squad=youtube-creator --limit=20
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Mostra cada tentativa, status code, resposta do servidor.
|
|
284
|
+
|
|
285
|
+
### Dashboard
|
|
286
|
+
|
|
287
|
+
No dashboard (`/squads/[slug]`), há uma aba **"Saída"** que mostra:
|
|
288
|
+
- Modo configurado (files/sqlite/hybrid)
|
|
289
|
+
- Webhooks registrados
|
|
290
|
+
- Status da entrega automática
|
|
291
|
+
- Log das últimas entregas com status
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Comandos CLI
|
|
296
|
+
|
|
297
|
+
### Exportar output strategy
|
|
298
|
+
|
|
299
|
+
Salva a estratégia de uma squad em um arquivo JSON:
|
|
300
|
+
|
|
301
|
+
```bash
|
|
302
|
+
aioson output-strategy:export --squad=youtube-creator
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
Resultado: `output-strategy-youtube-creator.json`
|
|
306
|
+
|
|
307
|
+
**Útil para:** documentar configuração, compartilhar com outro projeto.
|
|
308
|
+
|
|
309
|
+
### Importar output strategy
|
|
310
|
+
|
|
311
|
+
Copia a estratégia de um arquivo ou outra squad:
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
# De um arquivo
|
|
315
|
+
aioson output-strategy:import --squad=nova-squad --file=output-strategy-youtube-creator.json
|
|
316
|
+
|
|
317
|
+
# De outra squad no mesmo projeto
|
|
318
|
+
aioson output-strategy:import --squad=nova-squad --from=youtube-creator
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
**Útil para:** replicar configuração, copiar webhooks entre squads.
|
|
322
|
+
|
|
323
|
+
### Disparar delivery manual
|
|
324
|
+
|
|
325
|
+
Se `autoPublish: false`, ou para reenviar conteúdo falho:
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
aioson deliver --squad=youtube-creator --content-key=episode-001
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
Isso re-dispara todos os webhooks para esse conteúdo.
|
|
332
|
+
|
|
333
|
+
### Validar manifest
|
|
334
|
+
|
|
335
|
+
Verifica se a output strategy está correta antes de rodar:
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
aioson squad:validate --squad=youtube-creator
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Valida:
|
|
342
|
+
- Schema do outputStrategy
|
|
343
|
+
- Modo vs configurações (ex: mode=files não pode ter dataOutput)
|
|
344
|
+
- Existência de arquivos de worker (se houver)
|
|
345
|
+
- Variáveis de ambiente referenciadas
|
|
346
|
+
- Triggers válidos
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Exemplos Práticos
|
|
351
|
+
|
|
352
|
+
### Exemplo 1: Squad com Slack + API customizada
|
|
353
|
+
|
|
354
|
+
```json
|
|
355
|
+
{
|
|
356
|
+
"outputStrategy": {
|
|
357
|
+
"mode": "hybrid",
|
|
358
|
+
"fileOutput": { "enabled": true, "dir": "output/marketing/", "formats": ["html", "json"] },
|
|
359
|
+
"dataOutput": { "enabled": true, "storage": "sqlite" },
|
|
360
|
+
"delivery": {
|
|
361
|
+
"webhooks": [
|
|
362
|
+
{
|
|
363
|
+
"slug": "slack-updates",
|
|
364
|
+
"url": "https://hooks.slack.com/services/{{ENV:SLACK_WEBHOOK}}",
|
|
365
|
+
"trigger": "on-publish",
|
|
366
|
+
"format": "json"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"slug": "marketing-api",
|
|
370
|
+
"url": "https://api.marketing.internal/content/ingest",
|
|
371
|
+
"trigger": "on-new",
|
|
372
|
+
"format": "json",
|
|
373
|
+
"headers": {
|
|
374
|
+
"Authorization": "Bearer {{ENV:MARKETING_API_TOKEN}}",
|
|
375
|
+
"X-Squad": "marketing"
|
|
376
|
+
},
|
|
377
|
+
"timeout": 15000
|
|
378
|
+
}
|
|
379
|
+
],
|
|
380
|
+
"autoPublish": true,
|
|
381
|
+
"cloudPublish": false
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
**Variáveis de ambiente:**
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
SLACK_WEBHOOK=T1234567/B7654321/XXXXXXXXXXXX
|
|
391
|
+
MARKETING_API_TOKEN=sk_test_XXXXX
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**Fluxo:**
|
|
395
|
+
1. Squad gera conteúdo em `output/marketing/`
|
|
396
|
+
2. Conteúdo é indexado em SQLite
|
|
397
|
+
3. Auto-delivery detecta novo conteúdo
|
|
398
|
+
4. Dispara POST para Slack (notificação)
|
|
399
|
+
5. Dispara POST para marketing API (ingestão)
|
|
400
|
+
6. Se qualquer um falhar (5xx ou timeout), retenta até 3 vezes com backoff
|
|
401
|
+
|
|
402
|
+
### Exemplo 2: Squad com Files Only (sem webhooks)
|
|
403
|
+
|
|
404
|
+
```json
|
|
405
|
+
{
|
|
406
|
+
"outputStrategy": {
|
|
407
|
+
"mode": "files",
|
|
408
|
+
"fileOutput": {
|
|
409
|
+
"enabled": true,
|
|
410
|
+
"dir": "output/research/",
|
|
411
|
+
"formats": ["md", "html", "json"]
|
|
412
|
+
},
|
|
413
|
+
"dataOutput": { "enabled": false },
|
|
414
|
+
"delivery": {
|
|
415
|
+
"webhooks": [],
|
|
416
|
+
"autoPublish": false,
|
|
417
|
+
"cloudPublish": false
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
**Use case:** Squad que gera documentação e pesquisa — conteúdo é salvo em disco mas não entregue automaticamente.
|
|
424
|
+
|
|
425
|
+
### Exemplo 3: Publicação Cloud
|
|
426
|
+
|
|
427
|
+
```json
|
|
428
|
+
{
|
|
429
|
+
"outputStrategy": {
|
|
430
|
+
"mode": "hybrid",
|
|
431
|
+
"fileOutput": { "enabled": true },
|
|
432
|
+
"dataOutput": { "enabled": true },
|
|
433
|
+
"delivery": {
|
|
434
|
+
"webhooks": [],
|
|
435
|
+
"autoPublish": false,
|
|
436
|
+
"cloudPublish": true
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
**Use case:** Squad publica conteúdo no catálogo cloud (para ser reusada por outros projetos).
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## Retry Logic
|
|
447
|
+
|
|
448
|
+
O delivery runner implementa retry inteligente:
|
|
449
|
+
|
|
450
|
+
### Quando retenta
|
|
451
|
+
- Status **5xx** (erros do servidor)
|
|
452
|
+
- Status **429** (rate limit)
|
|
453
|
+
- Timeouts (conexão expirou)
|
|
454
|
+
- Erros de rede (DNS, conexão recusada)
|
|
455
|
+
|
|
456
|
+
### Quando NÃO retenta
|
|
457
|
+
- Status **4xx** (erro do cliente — algo está errado com o payload)
|
|
458
|
+
- Status **2xx/3xx** (sucesso)
|
|
459
|
+
|
|
460
|
+
### Tentativas e delays
|
|
461
|
+
|
|
462
|
+
```
|
|
463
|
+
Tentativa 1: falha
|
|
464
|
+
→ aguarda 1s
|
|
465
|
+
Tentativa 2: falha
|
|
466
|
+
→ aguarda 3s
|
|
467
|
+
Tentativa 3: falha
|
|
468
|
+
→ registra falha permanente em delivery_log
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
Se todas as 3 tentativas falharem:
|
|
472
|
+
- Conteúdo continua indexado em SQLite
|
|
473
|
+
- Webhook não foi entregue
|
|
474
|
+
- Log registra em `delivery_log` com status "failed"
|
|
475
|
+
- Dashboard mostra o erro
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
## Troubleshooting
|
|
480
|
+
|
|
481
|
+
### Webhook não dispara
|
|
482
|
+
|
|
483
|
+
**Verificar:**
|
|
484
|
+
|
|
485
|
+
```bash
|
|
486
|
+
aioson squad:doctor --squad=seu-squad
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
Procure por:
|
|
490
|
+
- ✗ "autoPublish is enabled but no delivery targets configured"
|
|
491
|
+
- ✗ "Webhook 'X' references unset env var: Y"
|
|
492
|
+
- ✗ "Mode mismatch: hybrid mode but dataOutput disabled"
|
|
493
|
+
|
|
494
|
+
**Soluções:**
|
|
495
|
+
|
|
496
|
+
1. **Env var não definida?**
|
|
497
|
+
```bash
|
|
498
|
+
# Definir variável
|
|
499
|
+
export API_KEY="seu-valor"
|
|
500
|
+
|
|
501
|
+
# Ou replicar em .env
|
|
502
|
+
echo "API_KEY=seu-valor" >> .env
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
2. **Webhook mal formatado?**
|
|
506
|
+
```bash
|
|
507
|
+
aioson squad:validate --squad=seu-squad
|
|
508
|
+
```
|
|
509
|
+
Valida toda a estrutura do manifest.
|
|
510
|
+
|
|
511
|
+
3. **autoPublish desligado?**
|
|
512
|
+
Disparar manualmente:
|
|
513
|
+
```bash
|
|
514
|
+
aioson deliver --squad=seu-squad --content-key=seu-conteudo
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
4. **Conteúdo não foi gerado?**
|
|
518
|
+
Verificar se o arquivo existe:
|
|
519
|
+
```bash
|
|
520
|
+
ls -la output/seu-squad/
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
### Webhook retorna erro 4xx
|
|
524
|
+
|
|
525
|
+
Status 4xx significa erro do cliente (seu payload está errado).
|
|
526
|
+
|
|
527
|
+
**Debug:**
|
|
528
|
+
|
|
529
|
+
```bash
|
|
530
|
+
# Testar o webhook manualmente no dashboard
|
|
531
|
+
# Ou via CLI (próximas versões)
|
|
532
|
+
aioson webhook:test --squad=seu-squad --webhook=seu-webhook
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
Isso envia um payload de teste e mostra a resposta.
|
|
536
|
+
|
|
537
|
+
**Checklist:**
|
|
538
|
+
|
|
539
|
+
- [ ] URL é acessível? (`curl -I https://...`)
|
|
540
|
+
- [ ] ✅ Método é **sempre POST** (não configurável)
|
|
541
|
+
- [ ] ✅ Content-Type é **sempre JSON** (não configurável)
|
|
542
|
+
- [ ] Seu servidor está listening em POST na URL?
|
|
543
|
+
- [ ] Variáveis de ambiente foram resolvidas? (não há `{{ENV:X}}` no payload final)
|
|
544
|
+
- [ ] Token/auth está correto?
|
|
545
|
+
|
|
546
|
+
### Webhook retorna erro 5xx
|
|
547
|
+
|
|
548
|
+
Servidor dele está em problemas. O delivery runner vai retentar 2 mais vezes (delays: 3s, 8s).
|
|
549
|
+
|
|
550
|
+
**O que fazer:**
|
|
551
|
+
|
|
552
|
+
- [ ] Aguardar (servidor pode estar em manutenção)
|
|
553
|
+
- [ ] Conferir logs do servidor dele
|
|
554
|
+
- [ ] Disparar manualmente depois:
|
|
555
|
+
```bash
|
|
556
|
+
aioson deliver --squad=seu-squad --content-key=seu-conteudo
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
### Conteúdo não aparece em SQLite
|
|
560
|
+
|
|
561
|
+
Se `dataOutput.enabled: true` mas o conteúdo não está em `content_items`:
|
|
562
|
+
|
|
563
|
+
```bash
|
|
564
|
+
aioson squad:doctor --squad=seu-squad
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
Procure por:
|
|
568
|
+
- ✗ "Content indexing: X pending"
|
|
569
|
+
- ✗ "Mode mismatch: SQLite disabled"
|
|
570
|
+
|
|
571
|
+
**Soluções:**
|
|
572
|
+
|
|
573
|
+
1. **Runtime DB não foi inicializado?**
|
|
574
|
+
```bash
|
|
575
|
+
aioson runtime:init
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
2. **Conteúdo ainda não foi ingerido?**
|
|
579
|
+
```bash
|
|
580
|
+
# Forçar ingestão
|
|
581
|
+
aioson runtime:ingest output/seu-squad/
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
3. **Arquivo não tem extensão indexável?**
|
|
585
|
+
Verifique `fileOutput.formats` — contém `.html`, `.json`, etc?
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
## Exemplos Avançados
|
|
590
|
+
|
|
591
|
+
### Worker scripts personalizados (próximas versões)
|
|
592
|
+
|
|
593
|
+
Para lógica de delivery muito customizada, você pode registrar um script Python:
|
|
594
|
+
|
|
595
|
+
```json
|
|
596
|
+
{
|
|
597
|
+
"delivery": {
|
|
598
|
+
"webhooks": [
|
|
599
|
+
{
|
|
600
|
+
"slug": "custom-processor",
|
|
601
|
+
"worker": ".aioson/squads/seu-squad/workers/deliver.py",
|
|
602
|
+
"trigger": "on-publish"
|
|
603
|
+
}
|
|
604
|
+
]
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
O script recebe conteúdo como stdin e pode fazer qualquer coisa (salvar em S3, chamar APIs complexas, etc).
|
|
610
|
+
|
|
611
|
+
### Integração com Zapier/Make (próximas versões)
|
|
612
|
+
|
|
613
|
+
Use um webhook para disparar automações em Zapier:
|
|
614
|
+
|
|
615
|
+
```json
|
|
616
|
+
{
|
|
617
|
+
"slug": "zapier",
|
|
618
|
+
"url": "https://hooks.zapier.com/hooks/catch/YOUR_WEBHOOK_ID/",
|
|
619
|
+
"trigger": "on-publish",
|
|
620
|
+
"format": "json"
|
|
621
|
+
}
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
Zapier receberá o payload e poderá disparar outras ações (enviar email, atualizar Notion, etc).
|
|
625
|
+
|
|
626
|
+
---
|
|
627
|
+
|
|
628
|
+
## Resumo: Fluxo Completo
|
|
629
|
+
|
|
630
|
+
```
|
|
631
|
+
Squad gera arquivo (output/squad/content.html)
|
|
632
|
+
↓
|
|
633
|
+
Runtime indexa em content_items (SQLite)
|
|
634
|
+
↓
|
|
635
|
+
Delivery runner detecta novo conteúdo
|
|
636
|
+
↓
|
|
637
|
+
Resolve {{ENV:VAR}} em URLs e headers
|
|
638
|
+
↓
|
|
639
|
+
Dispara POST para cada webhook
|
|
640
|
+
↓
|
|
641
|
+
Se 2xx/3xx → sucesso (log em delivery_log)
|
|
642
|
+
Se 5xx/429/timeout → retenta (até 3 tentativas)
|
|
643
|
+
Se 4xx → falha permanente (log em delivery_log)
|
|
644
|
+
↓
|
|
645
|
+
Dashboard mostra status de cada entrega
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
---
|
|
649
|
+
|
|
650
|
+
## Próximas Passos
|
|
651
|
+
|
|
652
|
+
- Ler [Squad e Genome](./squad-genome.md) para entender estrutura geral
|
|
653
|
+
- Usar `aioson squad:validate` antes de rodar squads
|
|
654
|
+
- Monitorar em `/squads/[slug]` → aba "Saída"
|
|
655
|
+
- Debugar com `squad:doctor` se algo não funcionar
|